519 lines
2.2 MiB
Plaintext
519 lines
2.2 MiB
Plaintext
var strudel=function(exports){"use strict";var _documentCurrentScript=typeof document<"u"?document.currentScript:null;const logKey="strudel.log";let debounce=1e3,lastMessage,lastTime;function errorLogger$1(o,e="cyclist"){logger$2(`[${e}] error: ${o.message}`)}function logger$2(o,e,l={}){let d=performance.now();lastMessage===o&&d-lastTime<debounce||(lastMessage=o,lastTime=d,console.log(`%c${o}`,"background-color: black;color:white;border-radius:15px"),typeof document<"u"&&typeof CustomEvent<"u"&&document.dispatchEvent(new CustomEvent(logKey,{detail:{message:o,type:e,data:l}})))}logger$2.key=logKey,typeof BigInt>"u"&&(BigInt=function(o){if(isNaN(o))throw new Error("");return o});const C_ZERO=BigInt(0),C_ONE=BigInt(1),C_TWO=BigInt(2),C_FIVE=BigInt(5),C_TEN=BigInt(10),MAX_CYCLE_LEN=2e3,P$1={s:C_ONE,n:C_ZERO,d:C_ONE};function assign(o,e){try{o=BigInt(o)}catch{throw InvalidParameter()}return o*e}function trunc(o){return typeof o=="bigint"?o:Math.floor(o)}function newFraction(o,e){if(e===C_ZERO)throw DivisionByZero();const l=Object.create(Fraction.prototype);l.s=o<C_ZERO?-C_ONE:C_ONE,o=o<C_ZERO?-o:o;const d=gcd$1(o,e);return l.n=o/d,l.d=e/d,l}function factorize(o){const e={};let l=o,d=C_TWO,p=C_FIVE-C_ONE;for(;p<=l;){for(;l%d===C_ZERO;)l/=d,e[d]=(e[d]||C_ZERO)+C_ONE;p+=C_ONE+C_TWO*d++}return l!==o?l>1&&(e[l]=(e[l]||C_ZERO)+C_ONE):e[o]=(e[o]||C_ZERO)+C_ONE,e}const parse$7=function(o,e){let l=C_ZERO,d=C_ONE,p=C_ONE;if(o!=null)if(e!==void 0){if(typeof o=="bigint")l=o;else{if(isNaN(o))throw InvalidParameter();if(o%1!==0)throw NonIntegerParameter();l=BigInt(o)}if(typeof e=="bigint")d=e;else{if(isNaN(e))throw InvalidParameter();if(e%1!==0)throw NonIntegerParameter();d=BigInt(e)}p=l*d}else if(typeof o=="object"){if("d"in o&&"n"in o)l=BigInt(o.n),d=BigInt(o.d),"s"in o&&(l*=BigInt(o.s));else if(0 in o)l=BigInt(o[0]),1 in o&&(d=BigInt(o[1]));else if(typeof o=="bigint")l=o;else throw InvalidParameter();p=l*d}else if(typeof o=="number"){if(isNaN(o))throw InvalidParameter();if(o<0&&(p=-C_ONE,o=-o),o%1===0)l=BigInt(o);else if(o>0){let b=1,R=0,I=1,z=1,se=1,le=1e7;for(o>=1&&(b=10**Math.floor(1+Math.log10(o)),o/=b);I<=le&&se<=le;){let tn=(R+z)/(I+se);if(o===tn){I+se<=le?(l=R+z,d=I+se):se>I?(l=z,d=se):(l=R,d=I);break}else o>tn?(R+=z,I+=se):(z+=R,se+=I),I>le?(l=z,d=se):(l=R,d=I)}l=BigInt(l)*BigInt(b),d=BigInt(d)}}else if(typeof o=="string"){let b=0,R=C_ZERO,I=C_ZERO,z=C_ZERO,se=C_ONE,le=C_ONE,tn=o.replace(/_/g,"").match(/\d+|./g);if(tn===null)throw InvalidParameter();if(tn[b]==="-"?(p=-C_ONE,b++):tn[b]==="+"&&b++,tn.length===b+1?I=assign(tn[b++],p):tn[b+1]==="."||tn[b]==="."?(tn[b]!=="."&&(R=assign(tn[b++],p)),b++,(b+1===tn.length||tn[b+1]==="("&&tn[b+3]===")"||tn[b+1]==="'"&&tn[b+3]==="'")&&(I=assign(tn[b],p),se=C_TEN**BigInt(tn[b].length),b++),(tn[b]==="("&&tn[b+2]===")"||tn[b]==="'"&&tn[b+2]==="'")&&(z=assign(tn[b+1],p),le=C_TEN**BigInt(tn[b+1].length)-C_ONE,b+=3)):tn[b+1]==="/"||tn[b+1]===":"?(I=assign(tn[b],p),se=assign(tn[b+2],C_ONE),b+=3):tn[b+3]==="/"&&tn[b+1]===" "&&(R=assign(tn[b],p),I=assign(tn[b+2],p),se=assign(tn[b+4],C_ONE),b+=5),tn.length<=b)d=se*le,p=l=z+d*R+le*I;else throw InvalidParameter()}else if(typeof o=="bigint")l=o,p=o,d=C_ONE;else throw InvalidParameter();if(d===C_ZERO)throw DivisionByZero();P$1.s=p<C_ZERO?-C_ONE:C_ONE,P$1.n=l<C_ZERO?-l:l,P$1.d=d<C_ZERO?-d:d};function modpow(o,e,l){let d=C_ONE;for(;e>C_ZERO;o=o*o%l,e>>=C_ONE)e&C_ONE&&(d=d*o%l);return d}function cycleLen(o,e){for(;e%C_TWO===C_ZERO;e/=C_TWO);for(;e%C_FIVE===C_ZERO;e/=C_FIVE);if(e===C_ONE)return C_ZERO;let l=C_TEN%e,d=1;for(;l!==C_ONE;d++)if(l=l*C_TEN%e,d>MAX_CYCLE_LEN)return C_ZERO;return BigInt(d)}function cycleStart(o,e,l){let d=C_ONE,p=modpow(C_TEN,l,e);for(let b=0;b<300;b++){if(d===p)return BigInt(b);d=d*C_TEN%e,p=p*C_TEN%e}return 0}function gcd$1(o,e){if(!o)return e;if(!e)return o;for(;;){if(o%=e,!o)return e;if(e%=o,!e)return o}}function Fraction(o,e){if(parse$7(o,e),this instanceof Fraction)o=gcd$1(P$1.d,P$1.n),this.s=P$1.s,this.n=P$1.n/o,this.d=P$1.d/o;else return newFraction(P$1.s*P$1.n,P$1.d)}var DivisionByZero=function(){return new Error("Division by Zero")},InvalidParameter=function(){return new Error("Invalid argument")},NonIntegerParameter=function(){return new Error("Parameters must be integer")};Fraction.prototype={s:C_ONE,n:C_ZERO,d:C_ONE,abs:function(){return newFraction(this.n,this.d)},neg:function(){return newFraction(-this.s*this.n,this.d)},add:function(o,e){return parse$7(o,e),newFraction(this.s*this.n*P$1.d+P$1.s*this.d*P$1.n,this.d*P$1.d)},sub:function(o,e){return parse$7(o,e),newFraction(this.s*this.n*P$1.d-P$1.s*this.d*P$1.n,this.d*P$1.d)},mul:function(o,e){return parse$7(o,e),newFraction(this.s*P$1.s*this.n*P$1.n,this.d*P$1.d)},div:function(o,e){return parse$7(o,e),newFraction(this.s*P$1.s*this.n*P$1.d,this.d*P$1.n)},clone:function(){return newFraction(this.s*this.n,this.d)},mod:function(o,e){if(o===void 0)return newFraction(this.s*this.n%this.d,C_ONE);if(parse$7(o,e),C_ZERO===P$1.n*this.d)throw DivisionByZero();return newFraction(this.s*(P$1.d*this.n)%(P$1.n*this.d),P$1.d*this.d)},gcd:function(o,e){return parse$7(o,e),newFraction(gcd$1(P$1.n,this.n)*gcd$1(P$1.d,this.d),P$1.d*this.d)},lcm:function(o,e){return parse$7(o,e),P$1.n===C_ZERO&&this.n===C_ZERO?newFraction(C_ZERO,C_ONE):newFraction(P$1.n*this.n,gcd$1(P$1.n,this.n)*gcd$1(P$1.d,this.d))},inverse:function(){return newFraction(this.s*this.d,this.n)},pow:function(o,e){if(parse$7(o,e),P$1.d===C_ONE)return P$1.s<C_ZERO?newFraction((this.s*this.d)**P$1.n,this.n**P$1.n):newFraction((this.s*this.n)**P$1.n,this.d**P$1.n);if(this.s<C_ZERO)return null;let l=factorize(this.n),d=factorize(this.d),p=C_ONE,b=C_ONE;for(let R in l)if(R!=="1"){if(R==="0"){p=C_ZERO;break}if(l[R]*=P$1.n,l[R]%P$1.d===C_ZERO)l[R]/=P$1.d;else return null;p*=BigInt(R)**l[R]}for(let R in d)if(R!=="1"){if(d[R]*=P$1.n,d[R]%P$1.d===C_ZERO)d[R]/=P$1.d;else return null;b*=BigInt(R)**d[R]}return P$1.s<C_ZERO?newFraction(b,p):newFraction(p,b)},log:function(o,e){if(parse$7(o,e),this.s<=C_ZERO||P$1.s<=C_ZERO)return null;const l={},d=factorize(P$1.n),p=factorize(P$1.d),b=factorize(this.n),R=factorize(this.d);for(const se in p)d[se]=(d[se]||C_ZERO)-p[se];for(const se in R)b[se]=(b[se]||C_ZERO)-R[se];for(const se in d)se!=="1"&&(l[se]=!0);for(const se in b)se!=="1"&&(l[se]=!0);let I=null,z=null;for(const se in l){const le=d[se]||C_ZERO,tn=b[se]||C_ZERO;if(le===C_ZERO){if(tn!==C_ZERO)return null;continue}let an=tn,sn=le;const ln=gcd$1(an,sn);if(an/=ln,sn/=ln,I===null&&z===null)I=an,z=sn;else if(an*z!==I*sn)return null}return I!==null&&z!==null?newFraction(I,z):null},equals:function(o,e){return parse$7(o,e),this.s*this.n*P$1.d===P$1.s*P$1.n*this.d},lt:function(o,e){return parse$7(o,e),this.s*this.n*P$1.d<P$1.s*P$1.n*this.d},lte:function(o,e){return parse$7(o,e),this.s*this.n*P$1.d<=P$1.s*P$1.n*this.d},gt:function(o,e){return parse$7(o,e),this.s*this.n*P$1.d>P$1.s*P$1.n*this.d},gte:function(o,e){return parse$7(o,e),this.s*this.n*P$1.d>=P$1.s*P$1.n*this.d},compare:function(o,e){parse$7(o,e);let l=this.s*this.n*P$1.d-P$1.s*P$1.n*this.d;return(C_ZERO<l)-(l<C_ZERO)},ceil:function(o){return o=C_TEN**BigInt(o||0),newFraction(trunc(this.s*o*this.n/this.d)+(o*this.n%this.d>C_ZERO&&this.s>=C_ZERO?C_ONE:C_ZERO),o)},floor:function(o){return o=C_TEN**BigInt(o||0),newFraction(trunc(this.s*o*this.n/this.d)-(o*this.n%this.d>C_ZERO&&this.s<C_ZERO?C_ONE:C_ZERO),o)},round:function(o){return o=C_TEN**BigInt(o||0),newFraction(trunc(this.s*o*this.n/this.d)+this.s*((this.s>=C_ZERO?C_ONE:C_ZERO)+C_TWO*(o*this.n%this.d)>this.d?C_ONE:C_ZERO),o)},roundTo:function(o,e){parse$7(o,e);const l=this.n*P$1.d,d=this.d*P$1.n,p=l%d;let b=trunc(l/d);return p+p>=d&&b++,newFraction(this.s*b*P$1.n,P$1.d)},divisible:function(o,e){return parse$7(o,e),!(!(P$1.n*this.d)||this.n*P$1.d%(P$1.n*this.d))},valueOf:function(){return Number(this.s*this.n)/Number(this.d)},toString:function(o){let e=this.n,l=this.d;o=o||15;let d=cycleLen(e,l),p=cycleStart(e,l,d),b=this.s<C_ZERO?"-":"";if(b+=trunc(e/l),e%=l,e*=C_TEN,e&&(b+="."),d){for(let R=p;R--;)b+=trunc(e/l),e%=l,e*=C_TEN;b+="(";for(let R=d;R--;)b+=trunc(e/l),e%=l,e*=C_TEN;b+=")"}else for(let R=o;e&&R--;)b+=trunc(e/l),e%=l,e*=C_TEN;return b},toFraction:function(o){let e=this.n,l=this.d,d=this.s<C_ZERO?"-":"";if(l===C_ONE)d+=e;else{let p=trunc(e/l);o&&p>C_ZERO&&(d+=p,d+=" ",e%=l),d+=e,d+="/",d+=l}return d},toLatex:function(o){let e=this.n,l=this.d,d=this.s<C_ZERO?"-":"";if(l===C_ONE)d+=e;else{let p=trunc(e/l);o&&p>C_ZERO&&(d+=p,e%=l),d+="\\frac{",d+=e,d+="}{",d+=l,d+="}"}return d},toContinued:function(){let o=this.n,e=this.d,l=[];do{l.push(trunc(o/e));let d=o%e;o=e,e=d}while(o!==C_ONE);return l},simplify:function(o){const e=BigInt(1/(o||.001)|0),l=this.abs(),d=l.toContinued();for(let p=1;p<d.length;p++){let b=newFraction(d[p-1],C_ONE);for(let I=p-2;I>=0;I--)b=b.inverse().add(d[I]);let R=b.sub(l);if(R.n*e<R.d)return b.mul(this.s)}return this}};const isNoteWithOctave=o=>/^[a-gA-G][#bsf]*[0-9]*$/.test(o),isNote=o=>/^[a-gA-G][#bsf]*-?[0-9]*$/.test(o),tokenizeNote$3=o=>{if(typeof o!="string")return[];const[e,l="",d]=o.match(/^([a-gA-G])([#bsf]*)(-?[0-9]*)$/)?.slice(1)||[];return e?[e,l,d?Number(d):void 0]:[]},chromas$2={c:0,d:2,e:4,f:5,g:7,a:9,b:11},accs$2={"#":1,b:-1,s:1,f:-1},getAccidentalsOffset$1=o=>o?.split("").reduce((e,l)=>e+accs$2[l],0)||0,noteToMidi$1=(o,e=3)=>{const[l,d,p=e]=tokenizeNote$3(o);if(!l)throw new Error('not a note: "'+o+'"');const b=chromas$2[l.toLowerCase()],R=getAccidentalsOffset$1(d);return(Number(p)+1)*12+b+R},midiToFreq$2=o=>Math.pow(2,(o-69)/12)*440,freqToMidi$2=o=>12*Math.log(o/440)/Math.LN2+69,valueToMidi$1=(o,e)=>{if(typeof o!="object")throw new Error("valueToMidi: expected object value");let{freq:l,note:d}=o;if(typeof l=="number")return freqToMidi$2(l);if(typeof d=="string")return noteToMidi$1(d);if(typeof d=="number")return d;if(!e)throw new Error("valueToMidi: expected freq or note to be set");return e},getEventOffsetMs=(o,e)=>(o-e)*1e3,getFreq=o=>midiToFreq$2(typeof o=="number"?o:noteToMidi$1(o)),pcs$1=["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"],midi2note$1=o=>{const e=Math.floor(o/12)-1;return pcs$1[o%12]+e},_mod$2=(o,e)=>(o%e+e)%e,averageArray=o=>o.reduce((e,l)=>e+l)/o.length;function nanFallback$1(o,e=0){return isNaN(Number(o))?(logger$2(`"${o}" is not a number, falling back to ${e}`,"warning"),e):o}const getSoundIndex$1=(o,e)=>_mod$2(Math.round(nanFallback$1(o??0,0)),e),getPlayableNoteValue=o=>{let{value:e,context:l}=o,d=e;if(typeof d=="object"&&!Array.isArray(d)&&(d=d.note||d.n||d.value,d===void 0))throw new Error(`cannot find a playable note for ${JSON.stringify(e)}`);if(typeof d=="number"&&l.type!=="frequency")d=midiToFreq$2(o.value);else if(typeof d=="number"&&l.type==="frequency")d=o.value;else if(typeof d!="string"||!isNote(d))throw new Error("not a note: "+JSON.stringify(d));return d},getFrequency=o=>{let{value:e,context:l}=o;if(typeof e=="object")return e.freq?e.freq:getFreq(e.note||e.n||e.value);if(typeof e=="number"&&l.type!=="frequency")e=midiToFreq$2(o.value);else if(typeof e=="string"&&isNote(e))e=midiToFreq$2(noteToMidi$1(o.value));else if(typeof e!="number")throw new Error("not a note or frequency: "+e);return e},rotate$2=(o,e)=>o.slice(e).concat(o.slice(0,e)),pipe=(...o)=>o.reduce((e,l)=>(...d)=>e(l(...d)),e=>e),compose=(...o)=>pipe(...o.reverse()),removeUndefineds=o=>o.filter(e=>e!=null),flatten$1=o=>[].concat(...o),id$1=o=>o,constant=(o,e)=>o,listRange=(o,e)=>Array.from({length:e-o+1},(l,d)=>d+o);function curry(o,e,l=o.length){const d=function p(...b){if(b.length>=l)return o.apply(this,b);{const R=function(...I){return p.apply(this,b.concat(I))};return e&&e(R,b),R}};return e&&e(d,[]),d}function parseNumeral(o){const e=Number(o);if(!isNaN(e))return e;if(isNote(o))return noteToMidi$1(o);throw new Error(`cannot parse as numeral: "${o}"`)}function mapArgs(o,e){return(...l)=>o(...l.map(e))}function numeralArgs(o){return mapArgs(o,parseNumeral)}function parseFractional(o){const e=Number(o);if(!isNaN(e))return e;const l={pi:Math.PI,w:1,h:.5,q:.25,e:.125,s:.0625,t:1/3,f:.2,x:1/6}[o];if(typeof l<"u")return l;throw new Error(`cannot parse as fractional: "${o}"`)}const fractionalArgs=o=>mapArgs(o,parseFractional),splitAt=function(o,e){return[e.slice(0,o),e.slice(o)]},zipWith=(o,e,l)=>e.map((d,p)=>o(d,l[p])),pairs=function(o){const e=[];for(let l=0;l<o.length-1;++l)e.push([o[l],o[l+1]]);return e},clamp$1=(o,e,l)=>Math.min(Math.max(o,e),l),solfeggio=["Do","Reb","Re","Mib","Mi","Fa","Solb","Sol","Lab","La","Sib","Si"],indian=["Sa","Re","Ga","Ma","Pa","Dha","Ni"],german=["C","Db","D","Eb","E","F","Gb","G","Ab","A","Hb","H"],byzantine=["Ni","Pab","Pa","Voub","Vou","Ga","Dib","Di","Keb","Ke","Zob","Zo"],japanese=["I","Ro","Ha","Ni","Ho","He","To"],english=["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"],sol2note=(o,e="letters")=>{const d=(e==="solfeggio"?solfeggio:e==="indian"?indian:e==="german"?german:e==="byzantine"?byzantine:e==="japanese"?japanese:english)[o%12],p=Math.floor(o/12)-1;return d+p};function uniq(o){var e={};return o.filter(function(l){return e.hasOwn(l)?!1:e[l]=!0})}function uniqsort(o){return o.sort().filter(function(e,l,d){return!l||e!=d[l-1]})}function uniqsortr(o){return o.sort((e,l)=>e.compare(l)).filter(function(e,l,d){return!l||e.ne(d[l-1])})}function unicodeToBase64(o){const e=new TextEncoder().encode(o);let l="";const d=32768;for(let p=0;p<e.length;p+=d){const b=e.subarray(p,p+d);l+=String.fromCharCode.apply(null,b)}return btoa(l)}function base64ToUnicode(o){const e=new Uint8Array(atob(o).split("").map(d=>d.charCodeAt(0)));return new TextDecoder().decode(e)}function code2hash(o){return encodeURIComponent(unicodeToBase64(o))}function hash2code(o){return base64ToUnicode(decodeURIComponent(o))}function objectMap(o,e){return Array.isArray(o)?o.map(e):Object.fromEntries(Object.entries(o).map(([l,d],p)=>[l,e(d,l,p)]))}function cycleToSeconds$1(o,e){return o/e}class ClockCollator{constructor({getTargetClockTime:e=getUnixTimeSeconds,weight:l=16,offsetDelta:d=.005,checkAfterTime:p=2,resetAfterTime:b=8}){this.offsetTime,this.timeAtPrevOffsetSample,this.prevOffsetTimes=[],this.getTargetClockTime=e,this.weight=l,this.offsetDelta=d,this.checkAfterTime=p,this.resetAfterTime=b,this.reset=()=>{this.prevOffsetTimes=[],this.offsetTime=null,this.timeAtPrevOffsetSample=null}}calculateOffset(e){const l=this.getTargetClockTime(),d=l-this.timeAtPrevOffsetSample,p=l-e;if(d>this.resetAfterTime&&this.reset(),this.offsetTime==null&&(this.offsetTime=p),this.prevOffsetTimes.push(p),this.prevOffsetTimes.length>this.weight&&this.prevOffsetTimes.shift(),this.timeAtPrevOffsetSample==null||d>this.checkAfterTime){this.timeAtPrevOffsetSample=l;const b=averageArray(this.prevOffsetTimes);Math.abs(b-this.offsetTime)>this.offsetDelta&&(this.offsetTime=b)}return this.offsetTime}calculateTimestamp(e,l){return this.calculateOffset(e)+l}}function getPerformanceTimeSeconds(){return performance.now()*.001}function getUnixTimeSeconds(){return Date.now()*.001}const keyAlias=new Map([["control","Control"],["ctrl","Control"],["alt","Alt"],["shift","Shift"],["down","ArrowDown"],["up","ArrowUp"],["left","ArrowLeft"],["right","ArrowRight"]]);let keyState;function getCurrentKeyboardState(){if(keyState==null){if(typeof window>"u")return;keyState={},window.addEventListener("keydown",o=>{keyState[o.key]=!0}),window.addEventListener("keyup",o=>{keyState[o.key]=!1})}return{...keyState}}function stringifyValues(o,e=!1){return typeof o=="object"?e?JSON.stringify(o).slice(1,-1).replaceAll('"',"").replaceAll(","," "):JSON.stringify(o):o}Fraction.prototype.sam=function(){return this.floor()},Fraction.prototype.nextSam=function(){return this.sam().add(1)},Fraction.prototype.wholeCycle=function(){return new TimeSpan(this.sam(),this.nextSam())},Fraction.prototype.cyclePos=function(){return this.sub(this.sam())},Fraction.prototype.lt=function(o){return this.compare(o)<0},Fraction.prototype.gt=function(o){return this.compare(o)>0},Fraction.prototype.lte=function(o){return this.compare(o)<=0},Fraction.prototype.gte=function(o){return this.compare(o)>=0},Fraction.prototype.eq=function(o){return this.compare(o)==0},Fraction.prototype.ne=function(o){return this.compare(o)!=0},Fraction.prototype.max=function(o){return this.gt(o)?this:o},Fraction.prototype.maximum=function(...o){return o=o.map(e=>new Fraction(e)),o.reduce((e,l)=>l.max(e),this)},Fraction.prototype.min=function(o){return this.lt(o)?this:o},Fraction.prototype.mulmaybe=function(o){return o!==void 0?this.mul(o):void 0},Fraction.prototype.divmaybe=function(o){return o!==void 0?this.div(o):void 0},Fraction.prototype.addmaybe=function(o){return o!==void 0?this.add(o):void 0},Fraction.prototype.submaybe=function(o){return o!==void 0?this.sub(o):void 0},Fraction.prototype.show=function(){return this.s*this.n+"/"+this.d},Fraction.prototype.or=function(o){return this.eq(0)?o:this};const fraction$1=o=>Fraction(o),gcd=(...o)=>{if(o=removeUndefineds(o),o.length!==0)return o.reduce((e,l)=>e.gcd(l),fraction$1(1))},lcm=(...o)=>{if(o=removeUndefineds(o),o.length===0)return;const e=o.pop();return o.reduce((l,d)=>l===void 0||d===void 0?void 0:l.lcm(d),e)},isFraction=o=>o instanceof Fraction;fraction$1._original=Fraction;class TimeSpan{constructor(e,l){this.begin=fraction$1(e),this.end=fraction$1(l)}get spanCycles(){const e=[];var l=this.begin;const d=this.end,p=d.sam();if(l.equals(d))return[new TimeSpan(l,d)];for(;d.gt(l);){if(l.sam().equals(p)){e.push(new TimeSpan(l,this.end));break}const b=l.nextSam();e.push(new TimeSpan(l,b)),l=b}return e}get duration(){return this.end.sub(this.begin)}cycleArc(){const e=this.begin.cyclePos(),l=e.add(this.duration);return new TimeSpan(e,l)}withTime(e){return new TimeSpan(e(this.begin),e(this.end))}withEnd(e){return new TimeSpan(this.begin,e(this.end))}withCycle(e){const l=this.begin.sam(),d=l.add(e(this.begin.sub(l))),p=l.add(e(this.end.sub(l)));return new TimeSpan(d,p)}intersection(e){const l=this.begin.max(e.begin),d=this.end.min(e.end);if(!l.gt(d)&&!(l.equals(d)&&(l.equals(this.end)&&this.begin.lt(this.end)||l.equals(e.end)&&e.begin.lt(e.end))))return new TimeSpan(l,d)}intersection_e(e){const l=this.intersection(e);if(l==null)throw"TimeSpans do not intersect";return l}midpoint(){return this.begin.add(this.duration.div(fraction$1(2)))}equals(e){return this.begin.equals(e.begin)&&this.end.equals(e.end)}show(){return this.begin.show()+" → "+this.end.show()}}class Hap{constructor(e,l,d,p={},b=!1){this.whole=e,this.part=l,this.value=d,this.context=p,this.stateful=b,b&&console.assert(typeof this.value=="function","Stateful values must be functions")}get duration(){let e;return typeof this.value?.duration=="number"?e=fraction$1(this.value.duration):e=this.whole.end.sub(this.whole.begin),typeof this.value?.clip=="number"?e.mul(this.value.clip):e}get endClipped(){return this.whole.begin.add(this.duration)}isActive(e){return this.whole.begin<=e&&this.endClipped>=e}isInPast(e){return e>this.endClipped}isInNearPast(e,l){return l-e<=this.endClipped}isInFuture(e){return e<this.whole.begin}isInNearFuture(e,l){return l<this.whole.begin&&l>this.whole.begin-e}isWithinTime(e,l){return this.whole.begin<=l&&this.endClipped>=e}wholeOrPart(){return this.whole?this.whole:this.part}withSpan(e){const l=this.whole?e(this.whole):void 0;return new Hap(l,e(this.part),this.value,this.context)}withValue(e){return new Hap(this.whole,this.part,e(this.value),this.context)}hasOnset(){return this.whole!=null&&this.whole.begin.equals(this.part.begin)}hasTag(e){return this.context.tags?.includes(e)}resolveState(e){if(this.stateful&&this.hasOnset()){console.log("stateful");const l=this.value,[d,p]=l(e);return[d,new Hap(this.whole,this.part,p,this.context,!1)]}return[e,this]}spanEquals(e){return this.whole==null&&e.whole==null||this.whole.equals(e.whole)}equals(e){return this.spanEquals(e)&&this.part.equals(e.part)&&this.value===e.value}show(e=!1){const l=typeof this.value=="object"?e?JSON.stringify(this.value).slice(1,-1).replaceAll('"',"").replaceAll(","," "):JSON.stringify(this.value):this.value;var d="";if(this.whole==null)d="~"+this.part.show;else{var p=this.whole.begin.equals(this.part.begin)&&this.whole.end.equals(this.part.end);this.whole.begin.equals(this.part.begin)||(d=this.whole.begin.show()+" ⇜ "),p||(d+="("),d+=this.part.show(),p||(d+=")"),this.whole.end.equals(this.part.end)||(d+=" ⇝ "+this.whole.end.show())}return"[ "+d+" | "+l+" ]"}showWhole(e=!1){return`${this.whole==null?"~":this.whole.show()}: ${stringifyValues(this.value,e)}`}combineContext(e){const l=this;return{...l.context,...e.context,locations:(l.context.locations||[]).concat(e.context.locations||[])}}setContext(e){return new Hap(this.whole,this.part,this.value,e)}ensureObjectValue(){if(typeof this.value!="object")throw new Error(`expected hap.value to be an object, but got "${this.value}". Hint: append .note() or .s() to the end`,"error")}}class State{constructor(e,l={}){this.span=e,this.controls=l}setSpan(e){return new State(e,this.controls)}withSpan(e){return this.setSpan(e(this.span))}setControls(e){return new State(this.span,{...this.controls,...e})}}function unionWithObj(o,e,l){if(e?.value!==void 0&&Object.keys(e).length===1)return logger$2("[warn]: Can't do arithmetic on control pattern."),o;const d=Object.keys(o).filter(p=>Object.keys(e).includes(p));return Object.assign({},o,e,Object.fromEntries(d.map(p=>[p,l(o[p],e[p])])))}curry((o,e)=>o*e),curry((o,e)=>e.map(o));function drawLine(o,e=60){let l=0,d=fraction$1(0),p=[""],b="";for(;p[0].length<e;){const R=o.queryArc(l,l+1),I=R.filter(le=>le.hasOnset()).map(le=>le.duration),z=gcd(...I),se=z.inverse();p=p.map(le=>le+"|"),b+="|";for(let le=0;le<se;le++){const[tn,an]=[d,d.add(z)],sn=R.filter(un=>un.whole.begin.lte(tn)&&un.whole.end.gte(an)),ln=sn.length-p.length;ln>0&&(p=p.concat(Array(ln).fill(b))),p=p.map((un,pn)=>{const yn=sn[pn];if(yn){const Pn=yn.whole.begin.eq(tn)?""+yn.value:"-";return un+Pn}return un+"."}),b+=".",d=d.add(z)}l++}return p.join(`
|
||
`)}const strudelScope={};globalThis.strudelScope=strudelScope;const userDefinedKeys=new Set;globalThis.userDefinedKeys=userDefinedKeys;const clearScope=()=>{for(const o of userDefinedKeys)delete strudelScope[o],delete globalThis[o];return userDefinedKeys.clear(),globalThis.silence};globalThis.clearScope=clearScope;const evalScope=async(...o)=>{const e=await Promise.allSettled(o),l=e.filter(d=>d.status==="fulfilled").map(d=>d.value);return e.forEach((d,p)=>{d.status==="rejected"&&console.warn(`evalScope: module with index ${p} could not be loaded:`,d.reason)}),l.forEach(d=>{Object.entries(d).forEach(([p,b])=>{globalThis[p]=b,strudelScope[p]=b})}),l};function safeEval(o,e={}){const{wrapExpression:l=!0,wrapAsync:d=!0}=e;l&&(o=`{${o}}`),d&&(o=`(async ()=>${o})()`);const p=`"use strict";return (${o})`;return Function(p)()}const evaluate=async(o,e,l)=>{let d={};if(e){const R=e(o,l);o=R.output,d=R}return{mode:"javascript",pattern:await safeEval(o,{wrapExpression:!!e}),meta:d}};let stringParser,__steps=!0;const calculateSteps=function(o){__steps=!!o},setStringParser=o=>stringParser=o;let Pattern$1=class ps{constructor(e,l=void 0){this.query=e,this._Pattern=!0,this._steps=l}get _steps(){return this.__steps}set _steps(e){this.__steps=e===void 0?void 0:fraction$1(e)}setSteps(e){return this._steps=e,this}withSteps(e){return __steps?new ps(this.query,this._steps===void 0?void 0:e(this._steps)):this}get hasSteps(){return this._steps!==void 0}withValue(e){const l=new ps(d=>this.query(d).map(p=>p.withValue(e)));return l._steps=this._steps,l}withState(e){return new ps(l=>this.query(e(l)))}fmap(e){return this.withValue(e)}appWhole(e,l){const d=this,p=function(b){const R=d.query(b),I=l.query(b),z=function(se,le){const tn=se.part.intersection(le.part);if(tn!=null)return new Hap(e(se.whole,le.whole),tn,se.value(le.value),le.combineContext(se))};return flatten$1(R.map(se=>removeUndefineds(I.map(le=>z(se,le)))))};return new ps(p)}appBoth(e){const l=this,d=function(b,R){if(!(b==null||R==null))return b.intersection_e(R)},p=l.appWhole(d,e);return __steps&&(p._steps=lcm(e._steps,l._steps)),p}appLeft(e){const l=this,d=function(b){const R=[];for(const I of l.query(b)){const z=e.query(b.setSpan(I.wholeOrPart()));for(const se of z){const le=I.whole,tn=I.part.intersection(se.part);if(tn){const an=I.value(se.value),sn=se.combineContext(I),ln=new Hap(le,tn,an,sn);R.push(ln)}}}return R},p=new ps(d);return p._steps=this._steps,p}appRight(e){const l=this,d=function(b){const R=[];for(const I of e.query(b)){const z=l.query(b.setSpan(I.wholeOrPart()));for(const se of z){const le=I.whole,tn=se.part.intersection(I.part);if(tn){const an=se.value(I.value),sn=I.combineContext(se),ln=new Hap(le,tn,an,sn);R.push(ln)}}}return R},p=new ps(d);return p._steps=e._steps,p}bindWhole(e,l){const d=this,p=function(b){const R=function(z,se){return new Hap(e(z.whole,se.whole),se.part,se.value,Object.assign({},z.context,se.context,{locations:(z.context.locations||[]).concat(se.context.locations||[])}))},I=function(z){return l(z.value).query(b.setSpan(z.part)).map(se=>R(z,se))};return flatten$1(d.query(b).map(z=>I(z)))};return new ps(p)}bind(e){const l=function(d,p){if(!(d==null||p==null))return d.intersection_e(p)};return this.bindWhole(l,e)}join(){return this.bind(id$1)}outerBind(e){return this.bindWhole(l=>l,e).setSteps(this._steps)}outerJoin(){return this.outerBind(id$1)}innerBind(e){return this.bindWhole((l,d)=>d,e)}innerJoin(){return this.innerBind(id$1)}resetJoin(e=!1){const l=this;return new ps(d=>l.discreteOnly().query(d).map(p=>p.value.late(e?p.whole.begin:p.whole.begin.cyclePos()).query(d).map(b=>new Hap(b.whole?b.whole.intersection(p.whole):void 0,b.part.intersection(p.part),b.value).setContext(p.combineContext(b))).filter(b=>b.part)).flat())}restartJoin(){return this.resetJoin(!0)}squeezeJoin(){const e=this;function l(d){const p=e.discreteOnly().query(d);function b(I){const se=I.value._focusSpan(I.wholeOrPart()).query(d.setSpan(I.part));function le(tn,an){let sn;if(an.whole&&tn.whole&&(sn=an.whole.intersection(tn.whole),!sn))return;const ln=an.part.intersection(tn.part);if(!ln)return;const un=an.combineContext(tn);return new Hap(sn,ln,an.value,un)}return se.map(tn=>le(I,tn))}return flatten$1(p.map(b)).filter(I=>I)}return new ps(l)}squeezeBind(e){return this.fmap(e).squeezeJoin()}polyJoin=function(){const e=this;return e.fmap(l=>l.extend(e._steps.div(l._steps))).outerJoin()};polyBind(e){return this.fmap(e).polyJoin()}queryArc(e,l,d={}){try{return this.query(new State(new TimeSpan(e,l),d))}catch(p){return errorLogger$1(p,"query"),[]}}splitQueries(){const e=this,l=d=>flatten$1(d.span.spanCycles.map(p=>e.query(d.setSpan(p))));return new ps(l)}withQuerySpan(e){return new ps(l=>this.query(l.withSpan(e)))}withQuerySpanMaybe(e){const l=this;return new ps(d=>{const p=d.withSpan(e);return p.span?l.query(p):[]})}withQueryTime(e){return new ps(l=>this.query(l.withSpan(d=>d.withTime(e))))}withHapSpan(e){return new ps(l=>this.query(l).map(d=>d.withSpan(e)))}withHapTime(e){return this.withHapSpan(l=>l.withTime(e))}withHaps(e){const l=new ps(d=>e(this.query(d),d));return l._steps=this._steps,l}withHap(e){return this.withHaps(l=>l.map(e))}setContext(e){return this.withHap(l=>l.setContext(e))}withContext(e){const l=this.withHap(d=>d.setContext(e(d.context)));return this.__pure!==void 0&&(l.__pure=this.__pure,l.__pure_loc=this.__pure_loc),l}stripContext(){return this.withHap(e=>e.setContext({}))}withLoc(e,l){const d={start:e,end:l},p=this.withContext(b=>{const R=(b.locations||[]).concat([d]);return{...b,locations:R}});return this.__pure&&(p.__pure=this.__pure,p.__pure_loc=d),p}filterHaps(e){return new ps(l=>this.query(l).filter(e))}filterValues(e){return new ps(l=>this.query(l).filter(d=>e(d.value))).setSteps(this._steps)}removeUndefineds(){return this.filterValues(e=>e!=null)}onsetsOnly(){return this.filterHaps(e=>e.hasOnset())}discreteOnly(){return this.filterHaps(e=>e.whole)}defragmentHaps(){return this.discreteOnly().withHaps(l=>{const d=[];for(var p=0;p<l.length;++p){for(var b=!0,R=l[p];b;){const se=JSON.stringify(l[p].value);for(var I=!1,z=p+1;z<l.length;z++){const le=l[z];if(R.whole.equals(le.whole)){if(R.part.begin.eq(le.part.end)){if(se===JSON.stringify(le.value)){R=new Hap(R.whole,new TimeSpan(le.part.begin,R.part.end),R.value),l.splice(z,1),I=!0;break}}else if(le.part.begin.eq(R.part.end)&&se==JSON.stringify(le.value)){R=new Hap(R.whole,new TimeSpan(R.part.begin,le.part.end),R.value),l.splice(z,1),I=!0;break}}}b=I}d.push(R)}return d})}firstCycle(e=!1){var l=this;return e||(l=l.stripContext()),l.query(new State(new TimeSpan(fraction$1(0),fraction$1(1))))}get firstCycleValues(){return this.firstCycle().map(e=>e.value)}get showFirstCycle(){return this.firstCycle().map(e=>`${e.value}: ${e.whole.begin.toFraction()} - ${e.whole.end.toFraction()}`)}sortHapsByPart(){return this.withHaps(e=>e.sort((l,d)=>l.part.begin.sub(d.part.begin).or(l.part.end.sub(d.part.end)).or(l.whole.begin.sub(d.whole.begin).or(l.whole.end.sub(d.whole.end)))))}asNumber(){return this.fmap(parseNumeral)}_opIn(e,l){return this.fmap(l).appLeft(reify(e))}_opOut(e,l){return this.fmap(l).appRight(reify(e))}_opMix(e,l){return this.fmap(l).appBoth(reify(e))}_opSqueeze(e,l){const d=reify(e);return this.fmap(p=>d.fmap(b=>l(p)(b))).squeezeJoin()}_opSqueezeOut(e,l){const d=this;return reify(e).fmap(b=>d.fmap(R=>l(R)(b))).squeezeJoin()}_opReset(e,l){return reify(e).fmap(p=>this.fmap(b=>l(b)(p))).resetJoin()}_opRestart(e,l){return reify(e).fmap(p=>this.fmap(b=>l(b)(p))).restartJoin()}_opPoly(e,l){const d=reify(e);return this.fmap(p=>d.fmap(b=>l(b)(p))).polyJoin()}layer(...e){return stack(...e.map(l=>l(this)))}superimpose(...e){return this.stack(...e.map(l=>l(this)))}stack(...e){return stack(this,...e)}sequence(...e){return sequence(this,...e)}seq(...e){return sequence(this,...e)}cat(...e){return cat(this,...e)}fastcat(...e){return fastcat(this,...e)}slowcat(...e){return slowcat(this,...e)}onTrigger(e,l=!0){return this.withHap(d=>d.setContext({...d.context,onTrigger:(...p)=>{d.context.onTrigger?.(...p),e(...p)},dominantTrigger:d.context.dominantTrigger||l}))}log(e=d=>`[hap] ${d.showWhole(!0)}`,l=d=>({hap:d})){return this.onTrigger((...d)=>{logger$2(e(...d),void 0,l(...d))},!1)}logValues(e=l=>`[hap] ${stringifyValues(l,!0)}`){return this.log(l=>e(l.value))}drawLine(){return console.log(drawLine(this)),this}unjoin(e,l=id$1){return e.withHap(d=>d.withValue(p=>p?l(this.ribbon(d.whole.begin,d.whole.duration)):this))}into(e,l){return this.unjoin(e,l).innerJoin()}};function groupHapsBy(o,e){let l=[];return e.forEach(d=>{const p=l.findIndex(([b])=>o(d,b));p===-1?l.push([d]):l[p].push(d)}),l}const congruent=(o,e)=>o.spanEquals(e);Pattern$1.prototype.collect=function(){return this.withHaps(o=>groupHapsBy(congruent,o).map(e=>new Hap(e[0].whole,e[0].part,e,{})))};const arpWith=register("arpWith",(o,e)=>e.collect().fmap(l=>reify(o(l))).innerJoin().withHap(l=>new Hap(l.whole,l.part,l.value.value,l.combineContext(l.value)))),arp=register("arp",(o,e)=>e.arpWith(l=>reify(o).fmap(d=>l[d%l.length])),!1);function _nonArrayObject(o){return!Array.isArray(o)&&typeof o=="object"&&!isFraction(o)}function _composeOp(o,e,l){return _nonArrayObject(o)||_nonArrayObject(e)?(_nonArrayObject(o)||(o={value:o}),_nonArrayObject(e)||(e={value:e}),unionWithObj(o,e,l)):l(o,e)}const COMPOSERS={set:[(o,e)=>e],keep:[o=>o],keepif:[(o,e)=>e?o:void 0],add:[numeralArgs((o,e)=>o+e)],sub:[numeralArgs((o,e)=>o-e)],mul:[numeralArgs((o,e)=>o*e)],div:[numeralArgs((o,e)=>o/e)],mod:[numeralArgs(_mod$2)],pow:[numeralArgs(Math.pow)],band:[numeralArgs((o,e)=>o&e)],bor:[numeralArgs((o,e)=>o|e)],bxor:[numeralArgs((o,e)=>o^e)],blshift:[numeralArgs((o,e)=>o<<e)],brshift:[numeralArgs((o,e)=>o>>e)],lt:[(o,e)=>o<e],gt:[(o,e)=>o>e],lte:[(o,e)=>o<=e],gte:[(o,e)=>o>=e],eq:[(o,e)=>o==e],eqt:[(o,e)=>o===e],ne:[(o,e)=>o!=e],net:[(o,e)=>o!==e],and:[(o,e)=>o&&e],or:[(o,e)=>o||e],func:[(o,e)=>e(o)]},_setupAlignments=()=>{for(const[o,[e,l]]of Object.entries(COMPOSERS))Pattern$1.prototype["_"+o]=function(d){return this.fmap(p=>e(p,d))},Object.defineProperty(Pattern$1.prototype,o,{configurable:!0,get:function(){const d=this,p=(...b)=>d[o][DEFAULT_ALIGNMENT](...b);for(const b of ALIGNMENTS)p[b.toLowerCase()]=function(...R){var I=d;R=sequence(R),l&&(I=l(I),R=l(R));var z;return o==="keepif"?(z=I["_op"+b](R,se=>le=>e(se,le)),z=z.removeUndefineds()):z=I["_op"+b](R,se=>le=>_composeOp(se,le,e)),z};return p.squeezein=p.squeeze,p}})};let DEFAULT_ALIGNMENT="in";const ALIGNMENTS=["In","Out","Mix","Squeeze","SqueezeOut","Reset","Restart","Poly"],ALIGNMENT_KEYS=ALIGNMENTS.map(o=>o.toLowerCase());(function(){_setupAlignments();for(const o of ALIGNMENTS)Pattern$1.prototype[o.toLowerCase()]=function(...e){return this.set[o.toLowerCase()](e)};Pattern$1.prototype.struct=function(...o){return this.keepif.out(...o)},Pattern$1.prototype.structAll=function(...o){return this.keep.out(...o)},Pattern$1.prototype.mask=function(...o){return this.keepif.in(...o)},Pattern$1.prototype.maskAll=function(...o){return this.keep.in(...o)},Pattern$1.prototype.reset=function(...o){return this.keepif.reset(...o)},Pattern$1.prototype.resetAll=function(...o){return this.keep.reset(...o)},Pattern$1.prototype.restart=function(...o){return this.keepif.restart(...o)},Pattern$1.prototype.restartAll=function(...o){return this.keep.restart(...o)}})();const setDefaultJoin=o=>{o=o?.toLowerCase(),DEFAULT_ALIGNMENT!==o&&ALIGNMENT_KEYS.includes(o)&&(DEFAULT_ALIGNMENT=o,_setupAlignments())},polyrhythm=stack,pr=stack,pm=polymeter,gap=o=>new Pattern$1(()=>[],o),silence=gap(1),nothing=gap(0);function pure(o){function e(d){return d.span.spanCycles.map(p=>new Hap(fraction$1(p.begin).wholeCycle(),p,o))}const l=new Pattern$1(e,1);return l.__pure=o,l}function isPattern(o){return o instanceof Pattern$1||o?._Pattern}function reify(o){return isPattern(o)?o:stringParser&&typeof o=="string"?stringParser(o):pure(o)}function sequenceP(o){let e=pure([]);for(const l of o)e=e.bind(d=>l.fmap(p=>d.concat([p])));return e}function stack(...o){o=o.map(d=>Array.isArray(d)?sequence(...d):reify(d));const e=d=>flatten$1(o.map(p=>p.query(d))),l=new Pattern$1(e);return __steps&&(l._steps=lcm(...o.map(d=>d._steps))),l}function _stackWith(o,e){if(e=e.map(b=>Array.isArray(b)?sequence(...b):reify(b)),e.length===0)return silence;if(e.length===1)return e[0];const[l,...d]=e.map(b=>b._steps),p=__steps?l.maximum(...d):void 0;return stack(...o(p,e))}function stackLeft(...o){return _stackWith((e,l)=>l.map(d=>d._steps.eq(e)?d:stepcat(d,gap(e.sub(d._steps)))),o)}function stackRight(...o){return _stackWith((e,l)=>l.map(d=>d._steps.eq(e)?d:stepcat(gap(e.sub(d._steps)),d)),o)}function stackCentre(...o){return _stackWith((e,l)=>l.map(d=>{if(d._steps.eq(e))return d;const p=gap(e.sub(d._steps).div(2));return stepcat(p,d,p)}),o)}function stackBy(o,...e){const[l,...d]=e.map(R=>R._steps),p=l.maximum(...d),b={centre:stackCentre,left:stackLeft,right:stackRight,expand:stack,repeat:(...R)=>polymeter(...R).steps(p)};return o.inhabit(b).fmap(R=>R(...e)).innerJoin().setSteps(p)}function slowcat(...o){if(o=o.map(d=>Array.isArray(d)?fastcat(...d):reify(d)),o.length==1)return o[0];const e=function(d){const p=d.span,b=_mod$2(p.begin.sam(),o.length),R=o[b];if(!R)return[];const I=p.begin.floor().sub(p.begin.div(o.length).floor());return R.withHapTime(z=>z.add(I)).query(d.setSpan(p.withTime(z=>z.sub(I))))},l=__steps?lcm(...o.map(d=>d._steps)):void 0;return new Pattern$1(e).splitQueries().setSteps(l)}function slowcatPrime(...o){o=o.map(reify);const e=function(l){const d=Math.floor(l.span.begin)%o.length;return o[d]?.query(l)||[]};return new Pattern$1(e).splitQueries()}function cat(...o){return slowcat(...o)}function arrange(...o){const e=o.reduce((l,[d])=>l+d,0);return o=o.map(([l,d])=>[l,d.fast(l)]),stepcat(...o).slow(e)}function seqPLoop(...o){let e=fraction$1(0);for(let l of o)l.length==2&&l.unshift(e),e=l[1];return stack(...o.map(([l,d,p])=>pure(reify(p)).compress(fraction$1(l).div(e),fraction$1(d).div(e)))).slow(e).innerJoin()}function fastcat(...o){let e=slowcat(...o);return o.length>1&&(e=e._fast(o.length),e._steps=o.length),o.length==1&&o[0].__steps_source&&(o._steps=o[0]._steps),e}function sequence(...o){return fastcat(...o)}function seq(...o){return fastcat(...o)}function _sequenceCount(o){return Array.isArray(o)?o.length==0?[silence,0]:o.length==1?_sequenceCount(o[0]):[fastcat(...o.map(e=>_sequenceCount(e)[0])),o.length]:[reify(o),1]}const mask=curry((o,e)=>reify(e).mask(o)),struct=curry((o,e)=>reify(e).struct(o)),superimpose=curry((o,e)=>reify(e).superimpose(...o)),withValue=curry((o,e)=>reify(e).withValue(o)),bind=curry((o,e)=>reify(e).bind(o)),innerBind=curry((o,e)=>reify(e).innerBind(o)),outerBind=curry((o,e)=>reify(e).outerBind(o)),squeezeBind=curry((o,e)=>reify(e).squeezeBind(o)),stepBind=curry((o,e)=>reify(e).stepBind(o)),polyBind=curry((o,e)=>reify(e).polyBind(o)),set=curry((o,e)=>reify(e).set(o)),keep=curry((o,e)=>reify(e).keep(o)),keepif=curry((o,e)=>reify(e).keepif(o)),add$7=curry((o,e)=>reify(e).add(o)),sub=curry((o,e)=>reify(e).sub(o)),mul=curry((o,e)=>reify(e).mul(o)),div=curry((o,e)=>reify(e).div(o)),mod$3=curry((o,e)=>reify(e).mod(o)),pow=curry((o,e)=>reify(e).pow(o)),band=curry((o,e)=>reify(e).band(o)),bor=curry((o,e)=>reify(e).bor(o)),bxor=curry((o,e)=>reify(e).bxor(o)),blshift=curry((o,e)=>reify(e).blshift(o)),brshift=curry((o,e)=>reify(e).brshift(o)),lt$2=curry((o,e)=>reify(e).lt(o)),gt$1=curry((o,e)=>reify(e).gt(o)),lte=curry((o,e)=>reify(e).lte(o)),gte=curry((o,e)=>reify(e).gte(o)),eq=curry((o,e)=>reify(e).eq(o)),eqt=curry((o,e)=>reify(e).eqt(o)),ne$1=curry((o,e)=>reify(e).ne(o)),net=curry((o,e)=>reify(e).net(o)),and=curry((o,e)=>reify(e).and(o)),or=curry((o,e)=>reify(e).or(o)),func=curry((o,e)=>reify(e).func(o));function register(o,e,l=!0,d=!1,p=b=>b.innerJoin()){if(Array.isArray(o)){const z={};for(const se of o)z[se]=register(se,e,l,d,p);return z}const b=e.length;var R;l?R=function(...z){z=z.map(reify);const se=z[z.length-1];let le;if(b===1)le=e(se);else{const tn=z.slice(0,-1);if(tn.every(an=>an.__pure!=null)){const an=tn.map(ln=>ln.__pure),sn=tn.filter(ln=>ln.__pure_loc).map(ln=>ln.__pure_loc);le=e(...an,se),le=le.withContext(ln=>{const un=(ln.locations||[]).concat(sn);return{...ln,locations:un}})}else{const[an,...sn]=tn;let ln=(...un)=>e(...un,se);ln=curry(ln,null,b-1),le=p(sn.reduce((un,pn)=>un.appLeft(pn),an.fmap(ln)))}}return d&&(le._steps=se._steps),le}:R=function(...z){z=z.map(reify);const se=e(...z);return d&&(se._steps=z[z.length-1]._steps),se},Pattern$1.prototype[o]=function(...z){if(b===2&&z.length!==1)z=[sequence(...z)];else if(b!==z.length+1)throw new Error(`.${o}() expects ${b-1} inputs but got ${z.length}.`);return z=z.map(reify),R(...z,this)},b>1&&(Pattern$1.prototype["_"+o]=function(...z){const se=e(...z,this);return d&&se.setSteps(this._steps),se});const I=curry(R,null,b);return strudelScope[o]=I,I}function stepRegister(o,e,l=!0,d=!1,p=b=>b.stepJoin()){return register(o,e,l,d,p)}const round=register("round",function(o){return o.asNumber().fmap(e=>Math.round(e))}),floor=register("floor",function(o){return o.asNumber().fmap(e=>Math.floor(e))}),log2=register("log2",o=>o.asNumber().fmap(e=>Math.log2(e))),ceil=register("ceil",function(o){return o.asNumber().fmap(e=>Math.ceil(e))}),toBipolar=register("toBipolar",function(o){return o.fmap(e=>e*2-1)}),fromBipolar=register("fromBipolar",function(o){return o.fmap(e=>(e+1)/2)}),range$2=register("range",function(o,e,l){return l.mul(e-o).add(o)}),rangex=register("rangex",function(o,e,l){return l._range(Math.log(o),Math.log(e)).fmap(Math.exp)}),range2=register("range2",function(o,e,l){return l.fromBipolar()._range(o,e)}),ratio$2=register("ratio",o=>o.fmap(e=>Array.isArray(e)?e.slice(1).reduce((l,d)=>l/d,e[0]):e)),compress=register("compress",function(o,e,l){return o=fraction$1(o),e=fraction$1(e),o.gt(e)||o.gt(1)||e.gt(1)||o.lt(0)||e.lt(0)?silence:l._fastGap(fraction$1(1).div(e.sub(o)))._late(o)}),{compressSpan,compressspan}=register(["compressSpan","compressspan"],function(o,e){return e._compress(o.begin,o.end)}),{fastGap,fastgap}=register(["fastGap","fastgap"],function(o,e){const l=function(p){const b=p.begin.sam(),R=p.begin.sub(b).mul(o).min(1),I=p.end.sub(b).mul(o).min(1);if(!(R>=1))return new TimeSpan(b.add(R),b.add(I))},d=function(p){const b=p.part.begin,R=p.part.end,I=b.sam(),z=b.sub(I).div(o).min(1),se=R.sub(I).div(o).min(1),le=new TimeSpan(I.add(z),I.add(se)),tn=p.whole?new TimeSpan(le.begin.sub(b.sub(p.whole.begin).div(o)),le.end.add(p.whole.end.sub(R).div(o))):void 0;return new Hap(tn,le,p.value,p.context)};return e.withQuerySpanMaybe(l).withHap(d).splitQueries()}),focus=register("focus",function(o,e,l){return o=fraction$1(o),e=fraction$1(e),l._early(o.sam())._fast(fraction$1(1).div(e.sub(o)))._late(o)}),{focusSpan,focusspan}=register(["focusSpan","focusspan"],function(o,e){return e._focus(o.begin,o.end)}),ply=register("ply",function(o,e){const l=e.fmap(d=>pure(d)._fast(o)).squeezeJoin();return __steps&&(l._steps=fraction$1(o).mulmaybe(e._steps)),l}),{fast,density:density$1}=register(["fast","density"],function(o,e){return o===0?silence:(o=fraction$1(o),e.withQueryTime(d=>d.mul(o)).withHapTime(d=>d.div(o)).setSteps(e._steps))},!0,!0),hurry=register("hurry",function(o,e){return e._fast(o).mul(pure({speed:o}))}),{slow,sparsity}=register(["slow","sparsity"],function(o,e){return o===0?silence:e._fast(fraction$1(1).div(o))}),inside$1=register("inside",function(o,e,l){return e(l._slow(o))._fast(o)}),outside=register("outside",function(o,e,l){return e(l._fast(o))._slow(o)}),lastOf=register("lastOf",function(o,e,l){const d=Array(o-1).fill(l);return d.push(e(l)),slowcatPrime(...d)}),{firstOf,every}=register(["firstOf","every"],function(o,e,l){const d=Array(o-1).fill(l);return d.unshift(e(l)),slowcatPrime(...d)}),apply=register("apply",function(o,e){return o(e)}),cpm=register("cpm",function(o,e){return e._fast(o/60/1)}),early=register("early",function(o,e){return o=fraction$1(o),e.withQueryTime(l=>l.add(o)).withHapTime(l=>l.sub(o))},!0,!0),late=register("late",function(o,e){return o=fraction$1(o),e._early(fraction$1(0).sub(o))},!0,!0),zoom=register("zoom",function(o,e,l){if(e=fraction$1(e),o=fraction$1(o),o.gte(e))return nothing;const d=e.sub(o),p=__steps?l._steps?.mulmaybe(d):void 0;return l.withQuerySpan(b=>b.withCycle(R=>R.mul(d).add(o))).withHapSpan(b=>b.withCycle(R=>R.sub(o).div(d))).splitQueries().setSteps(p)}),{zoomArc,zoomarc}=register(["zoomArc","zoomarc"],function(o,e){return e.zoom(o.begin,o.end)}),bite=register("bite",(o,e,l)=>e.fmap(d=>p=>{const b=fraction$1(d).div(p).mod(1),R=b.add(fraction$1(1).div(p));return l.zoom(b,R)}).appLeft(o).squeezeJoin(),!1),linger=register("linger",function(o,e){return o==0?silence:o<0?e._zoom(o.add(1),1)._slow(o):e._zoom(0,o)._slow(o)},!0,!0),{segment,seg}=register(["segment","seg"],function(o,e){return e.struct(pure(!0)._fast(o)).setSteps(o)}),swingBy=register("swingBy",(o,e,l)=>l.inside(e,late(seq(0,o/2)))),swing=register("swing",(o,e)=>e.swingBy(1/3,o)),{invert:invert$1,inv}=register(["invert","inv"],function(o){return o.fmap(e=>!e)},!0,!0),when=register("when",function(o,e,l){return o?e(l):l}),off$1=register("off",function(o,e,l){return stack(l,e(l.late(o)))}),brak=register("brak",function(o){return o.when(slowcat(!1,!0),e=>fastcat(e,silence)._late(.25))}),rev=register("rev",function(o){const e=function(l){const d=l.span,p=d.begin.sam(),b=d.begin.nextSam(),R=function(z){const se=z.withTime(tn=>p.add(b.sub(tn))),le=se.begin;return se.begin=se.end,se.end=le,se};return o.query(l.setSpan(R(d))).map(z=>z.withSpan(R))};return new Pattern$1(e).splitQueries()},!1,!0),revv=register("revv",function(o){const e=l=>new TimeSpan(fraction$1(0).sub(l.end),fraction$1(0).sub(l.begin));return o.withQuerySpan(e).withHapSpan(e)}),pressBy=register("pressBy",function(o,e){return e.fmap(l=>pure(l).compress(o,1)).squeezeJoin()}),press=register("press",function(o){return o._pressBy(.5)});Pattern$1.prototype.hush=function(){return silence};const palindrome=register("palindrome",function(o){return o.lastOf(2,rev)},!0,!0),{juxBy,juxby}=register(["juxBy","juxby"],function(o,e,l){o/=2;const d=function(R,I,z){return I in R?R[I]:z},p=l.withValue(R=>Object.assign({},R,{pan:d(R,"pan",.5)-o})),b=e(l.withValue(R=>Object.assign({},R,{pan:d(R,"pan",.5)+o})));return stack(p,b).setSteps(__steps?lcm(p._steps,b._steps):void 0)}),jux=register("jux",function(o,e){return e._juxBy(1,o,e)}),{echoWith,echowith,stutWith,stutwith}=register(["echoWith","echowith","stutWith","stutwith"],function(o,e,l,d){return stack(...listRange(0,o-1).map(p=>l(d.late(fraction$1(e).mul(p)),p)))}),echo=register("echo",function(o,e,l,d){return d._echoWith(o,e,(p,b)=>p.gain(Math.pow(l,b)))}),stut=register("stut",function(o,e,l,d){return d._echoWith(o,l,(p,b)=>p.gain(Math.pow(e,b)))}),applyN=register("applyN",function(o,e,l){let d=l;for(let p=0;p<o;p++)d=e(d);return d}),plyWith=register(["plyWith","plywith"],function(o,e,l){const d=l.fmap(p=>cat(...listRange(0,o-1).map(b=>applyN(b,e,p)))._fast(o)).squeezeJoin();return __steps&&(d._steps=fraction$1(o).mulmaybe(l._steps)),d}),plyForEach=register(["plyForEach","plyforeach"],function(o,e,l){const d=l.fmap(p=>cat(cat(pure(p),...listRange(1,o-1).map(b=>e(pure(p),b))))._fast(o)).squeezeJoin();return __steps&&(d._steps=fraction$1(o).mulmaybe(l._steps)),d}),_iter=function(o,e,l=!1){return o=fraction$1(o),slowcat(...listRange(0,o.sub(1)).map(d=>l?e.late(fraction$1(d).div(o)):e.early(fraction$1(d).div(o))))},iter=register("iter",function(o,e){return _iter(o,e,!1)},!0,!0),{iterBack,iterback}=register(["iterBack","iterback"],function(o,e){return _iter(o,e,!0)},!0,!0),{repeatCycles}=register("repeatCycles",function(o,e){return new Pattern$1(function(l){const d=l.span.begin.sam(),p=d.div(o).sam(),b=d.sub(p);return l=l.withSpan(R=>R.withTime(I=>I.sub(b))),e.query(l).map(R=>R.withSpan(I=>I.withTime(z=>z.add(b))))}).splitQueries()},!0,!0),_chunk=function(o,e,l,d=!1,p=!1){const b=Array(o-1).fill(!1);b.unshift(!0);const R=_iter(o,sequence(...b),!d);return p||(l=l.repeatCycles(o)),l.when(R,e)},{chunk,slowchunk,slowChunk}=register(["chunk","slowchunk","slowChunk"],function(o,e,l){return _chunk(o,e,l,!1,!1)},!0,!0),{chunkBack,chunkback}=register(["chunkBack","chunkback"],function(o,e,l){return _chunk(o,e,l,!0)},!0,!0),{fastchunk,fastChunk}=register(["fastchunk","fastChunk"],function(o,e,l){return _chunk(o,e,l,!1,!0)},!0,!0),{chunkinto,chunkInto}=register(["chunkinto","chunkInto"],function(o,e,l){return l.into(fastcat(!0,...Array(o-1).fill(!1))._iterback(o),e)}),{chunkbackinto,chunkBackInto}=register(["chunkbackinto","chunkBackInto"],function(o,e,l){return l.into(fastcat(!0,...Array(o-1).fill(!1))._iter(o)._early(1),e)}),bypass=register("bypass",function(o,e){return o=!!parseInt(o),o?silence:e},!0,!0),{ribbon,rib}=register(["ribbon","rib"],(o,e,l)=>l.early(o).restart(pure(1).slow(e))),hsla=register("hsla",(o,e,l,d,p)=>p.color(`hsla(${o}turn,${e*100}%,${l*100}%,${d})`)),hsl=register("hsl",(o,e,l,d)=>d.color(`hsl(${o}turn,${e*100}%,${l*100}%)`));Pattern$1.prototype.tag=function(o){return this.withContext(e=>({...e,tags:(e.tags||[]).concat([o])}))};const filter$1=register("filter",(o,e)=>e.withHaps(l=>l.filter(o))),filterWhen=register("filterWhen",(o,e)=>e.filter(l=>o(l.whole.begin))),within=register("within",(o,e,l,d)=>stack(l(d.filterWhen(p=>p.cyclePos()>=o&&p.cyclePos()<=e)),d.filterWhen(p=>p.cyclePos()<o||p.cyclePos()>e)));Pattern$1.prototype.stepJoin=function(){const o=this,e=stepcat(..._retime(_slices(o.queryArc(0,1))))._steps,l=function(d){const b=o.early(d.span.begin.sam()).query(d.setSpan(new TimeSpan(fraction$1(0),fraction$1(1))));return stepcat(..._retime(_slices(b))).query(d)};return new Pattern$1(l,e)},Pattern$1.prototype.stepBind=function(o){return this.fmap(o).stepJoin()};function _retime(o){const e=o.filter((b,R)=>R.hasSteps).reduce((b,R)=>b.add(R),fraction$1(0)),l=removeUndefineds(o.map((b,R)=>R._steps)).reduce((b,R)=>b.add(R),fraction$1(0)),d=e.eq(0)?void 0:l.div(e);function p(b,R){return R._steps===void 0?[b.mulmaybe(d),R]:[R._steps,R]}return o.map(b=>p(...b))}function _slices(o){const e=flatten$1(o.map(p=>[p.part.begin,p.part.end])),l=uniqsortr([fraction$1(0),fraction$1(1),...e]);return pairs(l).map(p=>[p[1].sub(p[0]),stack(..._fitslice(new TimeSpan(...p),o).map(b=>b.value.withHap(R=>R.setContext(R.combineContext(b)))))])}function _fitslice(o,e){return removeUndefineds(e.map(l=>_match(o,l)))}function _match(o,e){const l=o.intersection(e.part);if(l!=null)return new Hap(e.whole,l,e.value,e.context)}const pace=register("pace",function(o,e){return e._steps===void 0?e:e._steps.eq(fraction$1(0))?nothing:e._fast(fraction$1(o).div(e._steps)).setSteps(o)});function _polymeterListSteps(o,...e){const l=e.map(p=>_sequenceCount(p));if(l.length==0)return silence;o==0&&(o=l[0][1]);const d=[];for(const p of l)p[1]!=0&&(o==p[1]?d.push(p[0]):d.push(p[0]._fast(fraction$1(o).div(fraction$1(p[1])))));return stack(...d)}function polymeter(...o){if(Array.isArray(o[0]))return _polymeterListSteps(0,...o);if(o=o.filter(d=>d.hasSteps),o.length==0)return silence;const e=lcm(...o.map(d=>d._steps));if(e.eq(fraction$1(0)))return nothing;const l=stack(...o.map(d=>d.pace(e)));return l._steps=e,l}function stepcat(...o){if(o.length===0)return nothing;const e=R=>Array.isArray(R)?R:[R._steps??1,R];if(o=o.map(e),o.find(R=>R[0]===void 0)){const R=o.map(z=>z[0]).filter(z=>z!==void 0);if(R.length===0)return fastcat(...o.map(z=>z[1]));if(R.length===o.length)return nothing;const I=R.reduce((z,se)=>z.add(se),fraction$1(0)).div(R.length);for(let z of o)z[0]===void 0&&(z[0]=I)}if(o.length==1)return reify(o[0][1]).withSteps(I=>o[0][0]);const l=o.map(R=>R[0]).reduce((R,I)=>R.add(I),fraction$1(0));let d=fraction$1(0);const p=[];for(const[R,I]of o){if(fraction$1(R).eq(0))continue;const z=d.add(R);p.push(reify(I)._compress(d.div(l),z.div(l))),d=z}const b=stack(...p);return b._steps=l,b}function stepalt(...o){o=o.map(p=>Array.isArray(p)?p.map(reify):[reify(p)]);const e=lcm(...o.map(p=>fraction$1(p.length)));let l=[];for(let p=0;p<e;++p)l.push(...o.map(b=>b.length==0?silence:b[p%b.length]));l=l.filter(p=>p.hasSteps&&p._steps>0);const d=l.reduce((p,b)=>p.add(b._steps),fraction$1(0));return l=stepcat(...l),l._steps=d,l}const take=stepRegister("take",function(o,e){if(!e.hasSteps||e._steps.lte(0)||(o=fraction$1(o),o.eq(0)))return nothing;const l=o<0;l&&(o=o.abs());const d=o.div(e._steps);return d.lte(0)?nothing:d.gte(1)?e:l?e.zoom(fraction$1(1).sub(d),1):e.zoom(0,d)}),drop=stepRegister("drop",function(o,e){return e.hasSteps?(o=fraction$1(o),o.lt(0)?e.take(e._steps.add(o)):e.take(fraction$1(0).sub(e._steps.sub(o)))):nothing}),extend=stepRegister("extend",function(o,e){return e.fast(o).expand(o)}),replicate=stepRegister("replicate",function(o,e){return e.repeatCycles(o).fast(o).expand(o)}),expand=stepRegister("expand",function(o,e){return e.withSteps(l=>l.mul(fraction$1(o)))}),contract=stepRegister("contract",function(o,e){return e.withSteps(l=>l.div(fraction$1(o)))});Pattern$1.prototype.shrinklist=function(o){const e=this;if(!e.hasSteps)return[e];let[l,d]=Array.isArray(o)?o:[o,e._steps];if(l=fraction$1(l),d===0||l===0)return[e];const p=l>0,b=[];if(p){const R=fraction$1(1).div(e._steps).mul(l);for(let I=0;I<d;++I){const z=R.mul(I);if(z.gt(1))break;b.push([z,1])}}else{l=fraction$1(0).sub(l);const R=fraction$1(1).div(e._steps).mul(l);for(let I=0;I<d;++I){const z=fraction$1(1).sub(R.mul(I));if(z.lt(0))break;b.push([fraction$1(0),z])}}return b.map(R=>e.zoom(...R))};const shrinklist=(o,e)=>e.shrinklist(o),shrink=register("shrink",function(o,e){if(!e.hasSteps)return nothing;const l=e.shrinklist(o),d=stepcat(...l);return d._steps=l.reduce((p,b)=>p.add(b._steps),fraction$1(0)),d},!0,!1,o=>o.stepJoin()),grow=register("grow",function(o,e){if(!e.hasSteps)return nothing;const l=e.shrinklist(fraction$1(0).sub(o));l.reverse();const d=stepcat(...l);return d._steps=l.reduce((p,b)=>p.add(b._steps),fraction$1(0)),d},!0,!1,o=>o.stepJoin()),tour=function(o,...e){return o.tour(...e)};Pattern$1.prototype.tour=function(...o){return stepcat(...[].concat(...o.map((e,l)=>[...o.slice(0,o.length-l),this,...o.slice(o.length-l)]),this,...o))};const zip=function(...o){o=o.filter(d=>d.hasSteps);const e=slowcat(...o.map(d=>d._slow(d._steps))),l=lcm(...o.map(d=>d._steps));return e._fast(l).setSteps(l)},timecat=stepcat,timeCat=stepcat,s_cat=stepcat,s_alt=stepalt,s_polymeter=polymeter;Pattern$1.prototype.s_polymeter=Pattern$1.prototype.polymeter;const s_taper=shrink;Pattern$1.prototype.s_taper=Pattern$1.prototype.shrink;const s_taperlist=shrinklist;Pattern$1.prototype.s_taperlist=Pattern$1.prototype.shrinklist;const s_add=take;Pattern$1.prototype.s_add=Pattern$1.prototype.take;const s_sub=drop;Pattern$1.prototype.s_sub=Pattern$1.prototype.drop;const s_expand=expand;Pattern$1.prototype.s_expand=Pattern$1.prototype.expand;const s_extend=extend;Pattern$1.prototype.s_extend=Pattern$1.prototype.extend;const s_contract=contract;Pattern$1.prototype.s_contract=Pattern$1.prototype.contract;const s_tour=tour;Pattern$1.prototype.s_tour=Pattern$1.prototype.tour;const s_zip=zip;Pattern$1.prototype.s_zip=Pattern$1.prototype.zip;const steps$2=pace;Pattern$1.prototype.steps=Pattern$1.prototype.pace;const chop=register("chop",function(o,e){const d=Array.from({length:o},(R,I)=>I).map(R=>({begin:R/o,end:(R+1)/o})),p=function(R,I){if("begin"in R&&"end"in R&&R.begin!==void 0&&R.end!==void 0){const z=R.end-R.begin;I={begin:R.begin+I.begin*z,end:R.begin+I.end*z}}return Object.assign({},R,I)},b=function(R){return sequence(d.map(I=>p(R,I)))};return e.squeezeBind(b).setSteps(__steps?fraction$1(o).mulmaybe(e._steps):void 0)}),striate=register("striate",function(o,e){const d=Array.from({length:o},(b,R)=>R).map(b=>({begin:b/o,end:(b+1)/o})),p=slowcat(...d);return e.set(p)._fast(o).setSteps(__steps?fraction$1(o).mulmaybe(e._steps):void 0)}),_loopAt=function(o,e,l=.5){return e.speed(1/o*l).unit("c").slow(o)},{loopAt,loopat}=register(["loopAt","loopat"],function(o,e){const l=e._steps?e._steps.div(o):void 0;return new Pattern$1(d=>_loopAt(o,e,d.controls._cps).query(d),l)}),slice=register("slice",function(o,e,l){return o.innerBind(d=>e.outerBind(p=>l.outerBind(b=>{b=b instanceof Object?b:{s:b};const R=Array.isArray(d)?d[p]:p/d,I=Array.isArray(d)?d[p+1]:(p+1)/d;return pure({begin:R,end:I,_slices:d,...b})}))).setSteps(e._steps)},!1);Pattern$1.prototype.onTriggerTime=function(o){return this.onTrigger((e,l,d,p)=>{const b=p-l;window.setTimeout(()=>{o(e)},b*1e3)},!1)};const splice=register("splice",function(o,e,l){const d=slice(o,e,l);return new Pattern$1(p=>{const b=p.controls._cps||1;return d.query(p).map(I=>I.withValue(z=>({speed:b/z._slices/I.whole.duration*(z.speed||1),unit:"c",...z})))}).setSteps(e._steps)},!1),fit=register("fit",o=>o.withHaps((e,l)=>e.map(d=>d.withValue(p=>{const b=("end"in p?p.end:1)-("begin"in p?p.begin:0);return{...p,speed:(l.controls._cps||1)/d.whole.duration*b,unit:"c"}})))),{loopAtCps,loopatcps}=register(["loopAtCps","loopatcps"],function(o,e,l){return _loopAt(o,l,e)}),ref$1=o=>pure(1).withValue(()=>reify(o())).innerJoin();let fadeGain=o=>o<.5?1:1-(o-.5)/.5,xfade=(o,e,l)=>{e=reify(e),o=reify(o),l=reify(l);let d=e.fmap(b=>({gain:fadeGain(b)})),p=e.fmap(b=>({gain:fadeGain(1-b)}));return stack(o.mul(d),l.mul(p))};Pattern$1.prototype.xfade=function(o,e){return xfade(this,o,e)};const __beat=o=>(e,l,d)=>{e=fraction$1(e).mod(l),l=fraction$1(l);const p=e.div(l),b=e.add(1).div(l);return o(d.fmap(R=>pure(R)._compress(p,b)))},{beat}=register(["beat"],__beat(o=>o.innerJoin())),_morph=(o,e,l)=>{l=fraction$1(l);const d=fraction$1(1).div(o.length),p=I=>{const z=[];for(const[se,le]of I.entries())le&&z.push([fraction$1(se).div(I.length),le]);return z},b=zipWith(([I,z],[se,le])=>{const tn=l.mul(se-I).add(I),an=tn.add(d);return new TimeSpan(tn,an)},p(o),p(e));function R(I){const z=I.span.begin.sam(),se=I.span.cycleArc(),le=[];for(const tn of b){const an=tn.intersection(se);an!==void 0&&le.push(new Hap(tn.withTime(sn=>sn.add(z)),an.withTime(sn=>sn.add(z)),!0))}return le}return new Pattern$1(R).splitQueries()},morph=(o,e,l)=>(o=reify(o),e=reify(e),l=reify(l),o.innerBind(d=>e.innerBind(p=>l.innerBind(b=>_morph(d,p,b))))),_distortWithAlg=function(o){const e=function(l,d){const p=reify(l).fmap(b=>Array.isArray(b)?[...b,o]:[b,1,o]);return d?d.distort(p):pure({}).distort(p)};return Pattern$1.prototype[o]=function(l){return e(l,this)},e},soft=_distortWithAlg("soft"),hard=_distortWithAlg("hard"),cubic=_distortWithAlg("cubic"),diode=_distortWithAlg("diode"),asym=_distortWithAlg("asym"),fold=_distortWithAlg("fold"),sinefold=_distortWithAlg("sinefold"),chebyshev=_distortWithAlg("chebyshev"),parray=o=>{let l=pure(curry((...d)=>d,null,o.length));for(const d of o)l=l.appBoth(reify(d));return l},_ensureListPattern=o=>Array.isArray(o)?parray(o):reify(o);Pattern$1.prototype.partials=function(o){return this.withValue(e=>l=>({...e,partials:l})).appLeft(_ensureListPattern(o))};const partials=o=>_ensureListPattern(o).as("partials");Pattern$1.prototype.phases=function(o){return this.withValue(e=>l=>({...e,phases:l})).appLeft(_ensureListPattern(o))};const phases=o=>_ensureListPattern(o).as("phases");Pattern$1.prototype.FX=function(...o){return o=o.map(reify),this.withValue(e=>l=>{const d=e.FX??[];return{...e,FX:d.concat(l)}}).appLeft(parray(o))};const _asArrayPattern=o=>{let l=pure(curry((...d)=>d,null,o.length));for(const d of o)l=l.appLeft(d);return l};Pattern$1.prototype.worklet=function(o,...e){return e=e.map(reify),this.outerBind(l=>_asArrayPattern(e).withValue(d=>{const p=l.workletInputs??[];return{...l,workletSrc:o,workletInputs:p.concat(d)}}))};const worklet$1=(...o)=>pure({}).worklet(...o);function createParam(o){let e=Array.isArray(o);o=e?o:[o];const l=o[0],d=b=>{let R;if(typeof b=="object"&&b.value!==void 0&&(R={...b},b=b.value,delete R.value),e&&Array.isArray(b)){const I=R||{};return b.forEach((z,se)=>{se<o.length&&(I[o[se]]=z)}),I}else return R?(R[l]=b,R):{[l]:b}},p=function(b,R){return R?typeof b>"u"?R.fmap(d):R.set(reify(b).withValue(d)):reify(b).withValue(d)};return Pattern$1.prototype[l]=function(b){return p(b,this)},p}const controlAlias=new Map;function isControlName(o){return controlAlias.has(o)}function registerControl(o,...e){const l=Array.isArray(o)?o[0]:o;let d={};return d[l]=createParam(o),controlAlias.set(l,l),e.forEach(p=>{d[p]=d[l],controlAlias.set(p,l),Pattern$1.prototype[p]=Pattern$1.prototype[l]}),d}function registerMultiControl(o,e,...l){o=Array.isArray(o)?o:[o];let d={};for(let p=1;p<=e;p++){let b=[...l],R=[...o];if(p===1){const z=b.map(le=>`${le}1`),se=R.map(le=>`${le}1`);b=b.concat(z).concat(se)}else b=b.map(z=>`${z}${p}`),R=R.map(z=>`${z}${p}`);const I=registerControl(R,...b);d={...d,...I}}return d}const{s:s$1,sound}=registerControl(["s","n","gain"],"sound"),{wt:wt$1,wavetablePosition}=registerControl("wt","wavetablePosition"),{wtenv}=registerControl("wtenv"),{wtattack,wtatt}=registerControl("wtattack","wtatt"),{wtdecay,wtdec}=registerControl("wtdecay","wtdec"),{wtsustain,wtsus}=registerControl("wtsustain","wtsus"),{wtrelease,wtrel}=registerControl("wtrelease","wtrel"),{wtrate}=registerControl("wtrate"),{wtsync}=registerControl("wtsync"),{wtdepth}=registerControl("wtdepth"),{wtshape}=registerControl("wtshape"),{wtdc}=registerControl("wtdc"),{wtskew}=registerControl("wtskew"),{warp,wavetableWarp}=registerControl("warp","wavetableWarp"),{warpattack,warpatt}=registerControl("warpattack","warpatt"),{warpdecay,warpdec}=registerControl("warpdecay","warpdec"),{warpsustain,warpsus}=registerControl("warpsustain","warpsus"),{warprelease,warprel}=registerControl("warprelease","warprel"),{warprate}=registerControl("warprate"),{warpdepth}=registerControl("warpdepth"),{warpshape}=registerControl("warpshape"),{warpdc}=registerControl("warpdc"),{warpskew}=registerControl("warpskew"),{warpmode,wavetableWarpMode}=registerControl("warpmode","wavetableWarpMode"),{wtphaserand,wavetablePhaseRand}=registerControl("wtphaserand","wavetablePhaseRand"),{warpenv}=registerControl("warpenv"),{warpsync}=registerControl("warpsync"),{source,src}=registerControl("source","src"),{n}=registerControl("n"),{i:i$2}=registerControl("i"),{note:note$2}=registerControl(["note","n"]),{accelerate}=registerControl("accelerate"),{velocity,vel}=registerControl("velocity","vel"),{gain}=registerControl("gain"),{postgain}=registerControl("postgain"),{amp}=registerControl("amp"),{fmh,fmh1,fmh2,fmh3,fmh4,fmh5,fmh6,fmh7,fmh8}=registerMultiControl(["fmh","fmi"],8,"fmh"),{fmi,fmi1,fmi2,fmi3,fmi4,fmi5,fmi6,fmi7,fmi8,fm:fm$1,fm1,fm2,fm3,fm4,fm5,fm6,fm7,fm8}=registerMultiControl(["fmi","fmh"],8,"fm"),{fmenv,fmenv1,fmenv2,fmenv3,fmenv4,fmenv5,fmenv6,fmenv7,fmenv8,fme}=registerMultiControl("fmenv",8,"fme"),{fmattack,fmattack1,fmattack2,fmattack3,fmattack4,fmattack5,fmattack6,fmattack7,fmattack8,fmatt,fmatt1,fmatt2,fmatt3,fmatt4,fmatt5,fmatt6,fmatt7,fmatt8}=registerMultiControl("fmattack",8,"fmatt"),{fmwave,fmwave1,fmwave2,fmwave3,fmwave4,fmwave5,fmwave6,fmwave7,fmwave8}=registerMultiControl("fmwave",8),{fmdecay,fmdecay1,fmdecay2,fmdecay3,fmdecay4,fmdecay5,fmdecay6,fmdecay7,fmdecay8,fmdec,fmdec1,fmdec2,fmdec3,fmdec4,fmdec5,fmdec6,fmdec7,fmdec8}=registerMultiControl("fmdecay",8,"fmdec"),{fmsustain,fmsustain1,fmsustain2,fmsustain3,fmsustain4,fmsustain5,fmsustain6,fmsustain7,fmsustain8,fmsus,fmsus1,fmsus2,fmsus3,fmsus4,fmsus5,fmsus6,fmsus7,fmsus8}=registerMultiControl("fmsustain",8,"fmsus"),{fmrelease,fmrelease1,fmrelease2,fmrelease3,fmrelease4,fmrelease5,fmrelease6,fmrelease7,fmrelease8,fmrel,fmrel1,fmrel2,fmrel3,fmrel4,fmrel5,fmrel6,fmrel7,fmrel8}=registerMultiControl("fmrelease",8,"fmrel");for(let o=0;o<=8;o++)for(let e=0;e<=8;e++)registerControl(`fmi${o}${e}`,`fm${o}${e}`);const{bank}=registerControl("bank"),{chorus}=registerControl("chorus"),{analyze}=registerControl("analyze"),{fft}=registerControl("fft"),{attack,att}=registerControl("attack","att"),{decay,dec:dec$1}=registerControl("decay","dec"),{sustain,sus}=registerControl("sustain","sus"),{release,rel}=registerControl("release","rel"),{hold}=registerControl("hold"),{bandf,bpf,bp}=registerControl(["bandf","bandq","bpenv"],"bpf","bp"),{bandq,bpq}=registerControl("bandq","bpq"),{begin}=registerControl("begin"),{end}=registerControl("end"),{loop}=registerControl("loop"),{loopBegin,loopb}=registerControl("loopBegin","loopb"),{loopEnd,loope}=registerControl("loopEnd","loope"),{crush}=registerControl("crush"),{coarse}=registerControl("coarse"),{tremolo,trem}=registerControl(["tremolo","tremolodepth","tremoloskew","tremolophase"],"trem"),{tremolosync}=registerControl(["tremolosync","tremolodepth","tremoloskew","tremolophase"],"tremsync"),{tremolodepth}=registerControl("tremolodepth","tremdepth"),{tremoloskew}=registerControl("tremoloskew","tremskew"),{tremolophase}=registerControl("tremolophase","tremphase"),{tremoloshape}=registerControl("tremoloshape","tremshape"),{drive}=registerControl("drive"),{duck}=registerControl("duckorbit","duck"),{duckdepth}=registerControl("duckdepth"),{duckonset}=registerControl("duckonset","duckons"),{duckattack}=registerControl("duckattack","duckatt","datt"),{byteBeatExpression,bbexpr}=registerControl("byteBeatExpression","bbexpr","bb"),{byteBeatStartTime,bbst}=registerControl("byteBeatStartTime","bbst"),{channels,ch}=registerControl("channels","ch"),{pw}=registerControl(["pw","pwrate","pwsweep"]),{pwrate}=registerControl("pwrate","pwr"),{pwsweep}=registerControl("pwsweep","pws"),{phaserrate,ph,phaser}=registerControl(["phaserrate","phaserdepth","phasercenter","phasersweep"],"ph","phaser"),{phasersweep,phs}=registerControl("phasersweep","phs"),{phasercenter,phc}=registerControl("phasercenter","phc"),{phaserdepth,phd,phasdp}=registerControl("phaserdepth","phd","phasdp"),{channel}=registerControl("channel"),{cut}=registerControl("cut"),{cutoff,ctf,lpf,lp}=registerControl(["cutoff","resonance","lpenv"],"ctf","lpf","lp"),{lpenv,lpe}=registerControl("lpenv","lpe"),{hpenv,hpe}=registerControl("hpenv","hpe"),{bpenv,bpe}=registerControl("bpenv","bpe"),{lpattack,lpa}=registerControl("lpattack","lpa"),{hpattack,hpa}=registerControl("hpattack","hpa"),{bpattack,bpa}=registerControl("bpattack","bpa"),{lpdecay,lpd}=registerControl("lpdecay","lpd"),{hpdecay,hpd}=registerControl("hpdecay","hpd"),{bpdecay,bpd}=registerControl("bpdecay","bpd"),{lpsustain,lps}=registerControl("lpsustain","lps"),{hpsustain,hps}=registerControl("hpsustain","hps"),{bpsustain,bps}=registerControl("bpsustain","bps"),{lprelease,lpr}=registerControl("lprelease","lpr"),{hprelease,hpr}=registerControl("hprelease","hpr"),{bprelease,bpr}=registerControl("bprelease","bpr"),{ftype}=registerControl("ftype"),{fanchor}=registerControl("fanchor"),{lprate}=registerControl("lprate"),{lpsync}=registerControl("lpsync"),{lpdepth}=registerControl("lpdepth"),{lpdepthfrequency,lpdepthfreq}=registerControl("lpdepthfrequency","lpdepthfreq"),{lpshape}=registerControl("lpshape"),{lpdc}=registerControl("lpdc"),{lpskew}=registerControl("lpskew"),{bprate}=registerControl("bprate"),{bpsync}=registerControl("bpsync"),{bpdepth}=registerControl("bpdepth"),{bpdepthfrequency,bpdepthfreq}=registerControl("bpdepthfrequency","bpdepthfreq"),{bpshape}=registerControl("bpshape"),{bpdc}=registerControl("bpdc"),{bpskew}=registerControl("bpskew"),{hprate}=registerControl("hprate"),{hpsync}=registerControl("hpsync"),{hpdepth}=registerControl("hpdepth"),{hpdepthfrequency,hpdepthfreq}=registerControl("hpdepthfrequency","hpdepthfreq"),{hpshape}=registerControl("hpshape"),{hpdc}=registerControl("hpdc"),{hpskew}=registerControl("hpskew"),{vib,vibrato,v}=registerControl(["vib","vibmod"],"vibrato","v"),{noise}=registerControl("noise"),{vibmod,vmod}=registerControl(["vibmod","vib"],"vmod"),{hcutoff,hpf,hp}=registerControl(["hcutoff","hresonance","hpenv"],"hpf","hp"),{hresonance,hpq}=registerControl("hresonance","hpq"),{resonance,lpq}=registerControl("resonance","lpq"),{djf}=registerControl("djf"),{delay}=registerControl(["delay","delaytime","delayfeedback"]),{delayfeedback,delayfb,dfb}=registerControl("delayfeedback","delayfb","dfb"),{delayspeed}=registerControl("delayspeed"),{delaytime,delayt,dt:dt$1}=registerControl("delaytime","delayt","dt"),{delaysync}=registerControl("delaysync","delays","ds"),{lock}=registerControl("lock"),{detune,det}=registerControl("detune","det"),{unison}=registerControl("unison"),{spread}=registerControl("spread"),{dry}=registerControl("dry"),{fadeTime,fadeOutTime}=registerControl("fadeTime","fadeOutTime"),{fadeInTime}=registerControl("fadeInTime"),{freq:freq$1}=registerControl("freq"),{pattack,patt}=registerControl("pattack","patt"),{pdecay,pdec}=registerControl("pdecay","pdec"),{psustain,psus}=registerControl("psustain","psus"),{prelease,prel}=registerControl("prelease","prel"),{penv}=registerControl("penv"),{pcurve}=registerControl("pcurve"),{panchor}=registerControl("panchor"),{gate,gat}=registerControl("gate","gat"),{leslie}=registerControl("leslie"),{lrate}=registerControl("lrate"),{lsize}=registerControl("lsize"),{activeLabel}=registerControl("activeLabel"),{label}=registerControl(["label","activeLabel"]),{degree}=registerControl("degree"),{mtranspose}=registerControl("mtranspose"),{ctranspose}=registerControl("ctranspose"),{harmonic}=registerControl("harmonic"),{stepsPerOctave}=registerControl("stepsPerOctave"),{octaveR}=registerControl("octaveR"),{nudge}=registerControl("nudge"),{octave:octave$1,oct}=registerControl("octave","oct"),{orbit}=registerControl("orbit","o"),{bus}=registerControl("bus"),{busgain,bgain}=registerControl("busgain","bgain"),{overgain}=registerControl("overgain"),{overshape}=registerControl("overshape"),{pan}=registerControl("pan"),{panspan}=registerControl("panspan"),{pansplay}=registerControl("pansplay"),{panwidth:panwidth$1}=registerControl("panwidth"),{panorient}=registerControl("panorient"),{slide}=registerControl("slide"),{semitone}=registerControl("semitone"),{voice}=registerControl("voice"),{chord:chord$1}=registerControl("chord"),{dictionary:dictionary$3,dict}=registerControl("dictionary","dict"),{anchor}=registerControl("anchor"),{offset}=registerControl("offset"),{octaves}=registerControl("octaves"),{mode:mode$1}=registerControl(["mode","anchor"]),{room}=registerControl(["room","size"]),{roomlp,rlp}=registerControl("roomlp","rlp"),{roomdim,rdim}=registerControl("roomdim","rdim"),{roomfade,rfade}=registerControl("roomfade","rfade"),{ir,iresponse}=registerControl(["ir","i"],"iresponse"),{irspeed}=registerControl("irspeed"),{irbegin}=registerControl("irbegin"),{roomsize,size,sz,rsize}=registerControl("roomsize","size","sz","rsize"),{shape}=registerControl(["shape","shapevol"]),{distort,dist:dist$3}=registerControl(["distort","distortvol","distorttype"],"dist"),{distortvol}=registerControl("distortvol","distvol"),{distorttype}=registerControl("distorttype","disttype"),{compressor}=registerControl(["compressor","compressorRatio","compressorKnee","compressorAttack","compressorRelease"]),{compressorKnee}=registerControl("compressorKnee"),{compressorRatio}=registerControl("compressorRatio"),{compressorAttack}=registerControl("compressorAttack"),{compressorRelease}=registerControl("compressorRelease"),{speed}=registerControl("speed"),{stretch}=registerControl("stretch"),{unit}=registerControl("unit"),{squiz}=registerControl("squiz"),{vowel}=registerControl("vowel"),{waveloss}=registerControl("waveloss"),{density}=registerControl("density"),{expression}=registerControl("expression"),{sustainpedal}=registerControl("sustainpedal"),{fshift}=registerControl("fshift"),{fshiftnote}=registerControl("fshiftnote"),{fshiftphase}=registerControl("fshiftphase"),{triode}=registerControl("triode"),{krush}=registerControl("krush"),{kcutoff}=registerControl("kcutoff"),{octer}=registerControl("octer"),{octersub}=registerControl("octersub"),{octersubsub}=registerControl("octersubsub"),{ring}=registerControl("ring"),{ringf}=registerControl("ringf"),{ringdf}=registerControl("ringdf"),{freeze}=registerControl("freeze"),{xsdelay}=registerControl("xsdelay"),{tsdelay}=registerControl("tsdelay"),{real}=registerControl("real"),{imag}=registerControl("imag"),{enhance}=registerControl("enhance"),{comb}=registerControl("comb"),{smear:smear$1}=registerControl("smear"),{scram}=registerControl("scram"),{binshift}=registerControl("binshift"),{hbrick}=registerControl("hbrick"),{lbrick}=registerControl("lbrick"),{frameRate}=registerControl("frameRate"),{frames}=registerControl("frames"),{hours}=registerControl("hours"),{minutes}=registerControl("minutes"),{seconds}=registerControl("seconds"),{songPtr}=registerControl("songPtr"),{uid}=registerControl("uid"),{val}=registerControl("val"),{cps}=registerControl("cps"),{clip:clip$1,legato}=registerControl("clip","legato"),{duration,dur}=registerControl("duration","dur"),{zrand}=registerControl("zrand"),{curve}=registerControl("curve"),{deltaSlide}=registerControl("deltaSlide"),{pitchJump}=registerControl("pitchJump"),{pitchJumpTime}=registerControl("pitchJumpTime"),{znoise}=registerControl("znoise"),{zmod}=registerControl("zmod"),{zcrush}=registerControl("zcrush"),{zdelay}=registerControl("zdelay"),{zzfx}=registerControl("zzfx"),{color,colour}=registerControl(["color","colour"]);let createParams=(...o)=>o.reduce((e,l)=>Object.assign(e,{[l]:createParam(l)}),{});const adsr=register("adsr",(o,e)=>{o=Array.isArray(o)?o:[o];const[l,d,p,b]=o;return e.set({attack:l,decay:d,sustain:p,release:b})}),ad=register("ad",(o,e)=>{o=Array.isArray(o)?o:[o];const[l,d=l]=o;return e.attack(l).decay(d)}),ds=register("ds",(o,e)=>{o=Array.isArray(o)?o:[o];const[l,d=0]=o;return e.set({decay:l,sustain:d})}),ar=register("ar",(o,e)=>{o=Array.isArray(o)?o:[o];const[l,d=l]=o;return e.set({attack:l,release:d})}),{midichan}=registerControl("midichan"),{midimap}=registerControl("midimap"),{midiport}=registerControl("midiport"),{midicmd}=registerControl("midicmd"),control=register("control",(o,e)=>{if(!Array.isArray(o))throw new Error("control expects an array of [ccn, ccv]");const[l,d]=o;return e.ccn(l).ccv(d)}),{ccn}=registerControl("ccn"),{ccv}=registerControl("ccv"),{ctlNum}=registerControl("ctlNum"),{nrpnn}=registerControl("nrpnn"),{nrpv}=registerControl("nrpv"),{progNum}=registerControl("progNum"),sysex=register("sysex",(o,e)=>{if(!Array.isArray(o))throw new Error("sysex expects an array of [id, data]");const[l,d]=o;return e.sysexid(l).sysexdata(d)}),{sysexid}=registerControl("sysexid"),{sysexdata}=registerControl("sysexdata"),{midibend}=registerControl("midibend"),{miditouch}=registerControl("miditouch"),{polyTouch}=registerControl("polyTouch"),{oschost}=registerControl("oschost"),{oscport}=registerControl("oscport"),getControlName=o=>controlAlias.has(o)?controlAlias.get(o):o,as=register("as",(o,e)=>(o=Array.isArray(o)?o:[o],e.fmap(l=>{l=Array.isArray(l)?l:[l];const d=[];for(let p=0;p<o.length;++p)l[p]!==void 0&&d.push([getControlName(o[p]),l[p]]);return Object.fromEntries(d)}))),scrub=register("scrub",(o,e)=>o.outerBind(l=>{Array.isArray(l)||(l=[l]);const[d,p=1]=l;return e.begin(d).mul(speed(p)).clip(1)}),!1),subControlAliases=new Map,registerSubControl=(o,e,...l)=>{const d=subControlAliases.get(o)??new Map,p=new Set([e,...l]);for(const b of p)d.set(String(b).toLowerCase(),e);subControlAliases.set(o,d)},registerSubControls=(o,e=[])=>{for(const[l,...d]of e)registerSubControl(o,l,...d)},getMainSubcontrolName=(o,e)=>{const l=subControlAliases.get(o);return l?l.get(String(e).toLowerCase())??e:e};registerSubControls("lfo",[["control","c"],["subControl","sc"],["rate","r"],["depth","dep","dr"],["depthabs","da"],["dcoffset","dc"],["shape","sh"],["skew","sk"],["curve","cu"],["sync","s"],["retrig","rt"],["fxi"]]),registerSubControls("env",[["control","c"],["subControl","sc"],["attack","att","a"],["decay","dec","d"],["sustain","sus","s"],["release","rel","r"],["depth","dep","dr"],["depthabs","da"],["acurve","ac"],["dcurve","dc"],["rcurve","rc"],["fxi"]]),registerSubControls("bmod",[["bus","b"],["control","c"],["subControl","sc"],["depth","dep","dr"],["depthabs","da"],["dc"],["fxi"]]),Pattern$1.prototype.modulate=function(o,e,l){e={control:void 0,...e};const d=["lfo","env","bmod"];if(!d.includes(o))return logger$2(`[core] Modulation type ${o} not found. Please use one of 'lfo', 'env', 'bmod'`),this;let p=this,b;p=p.fmap(R=>I=>({v:R,id:I})).appLeft(reify(l));for(const[R,I]of Object.entries(e)){const z=getMainSubcontrolName(o,R),se=reify(I);p=p.fmap(({v:le,id:tn})=>an=>{if(b===void 0){let ln=getControlName(Object.keys(le).at(-1));d.includes(ln)&&(ln=`${ln}_${[...le[ln].__ids].at(-1)}`),b=ln}le[o]??={__ids:new Set};const sn=le[o];return tn??=sn.__ids.size,sn[tn]??={control:b},sn.__ids.add(tn),an===void 0?{v:le,id:tn}:(z==="control"||z==="subControl"?sn[tn][z]=getControlName(an):sn[tn][z]=an,{v:le,id:tn})}).appLeft(se)}return p.fmap(({v:R})=>R)},Pattern$1.prototype.lfo=function(o,e){return this.modulate("lfo",o,e)};const lfo=o=>pure({}).lfo(o);Pattern$1.prototype.env=function(o,e){return this.modulate("env",o,e)};const env=o=>pure({}).env(o);Pattern$1.prototype.bmod=function(o,e){return this.modulate("bmod",o,e)};const bmod=o=>pure({}).bmod(o),{transient}=registerControl(["transient","transsustain"]),{FXrelease,FXrel,FXr,fxr}=registerControl("FXrelease","FXrel","FXr","fxr"),controls=Object.freeze(Object.defineProperty({__proto__:null,FXr,FXrel,FXrelease,accelerate,activeLabel,ad,adsr,amp,analyze,anchor,ar,as,att,attack,bandf,bandq,bank,bbexpr,bbst,begin,bgain,binshift,bmod,bp,bpa,bpattack,bpd,bpdc,bpdecay,bpdepth,bpdepthfreq,bpdepthfrequency,bpe,bpenv,bpf,bpq,bpr,bprate,bprelease,bps,bpshape,bpskew,bpsustain,bpsync,bus,busgain,byteBeatExpression,byteBeatStartTime,ccn,ccv,ch,channel,channels,chord:chord$1,chorus,clip:clip$1,coarse,color,colour,comb,compressor,compressorAttack,compressorKnee,compressorRatio,compressorRelease,control,cps,createParam,createParams,crush,ctf,ctlNum,ctranspose,curve,cut,cutoff,dec:dec$1,decay,degree,delay,delayfb,delayfeedback,delayspeed,delaysync,delayt,delaytime,deltaSlide,density,det,detune,dfb,dict,dictionary:dictionary$3,dist:dist$3,distort,distorttype,distortvol,djf,drive,dry,ds,dt:dt$1,duck,duckattack,duckdepth,duckonset,dur,duration,end,enhance,env,expression,fadeInTime,fadeOutTime,fadeTime,fanchor,fft,fm:fm$1,fm1,fm2,fm3,fm4,fm5,fm6,fm7,fm8,fmatt,fmatt1,fmatt2,fmatt3,fmatt4,fmatt5,fmatt6,fmatt7,fmatt8,fmattack,fmattack1,fmattack2,fmattack3,fmattack4,fmattack5,fmattack6,fmattack7,fmattack8,fmdec,fmdec1,fmdec2,fmdec3,fmdec4,fmdec5,fmdec6,fmdec7,fmdec8,fmdecay,fmdecay1,fmdecay2,fmdecay3,fmdecay4,fmdecay5,fmdecay6,fmdecay7,fmdecay8,fme,fmenv,fmenv1,fmenv2,fmenv3,fmenv4,fmenv5,fmenv6,fmenv7,fmenv8,fmh,fmh1,fmh2,fmh3,fmh4,fmh5,fmh6,fmh7,fmh8,fmi,fmi1,fmi2,fmi3,fmi4,fmi5,fmi6,fmi7,fmi8,fmrel,fmrel1,fmrel2,fmrel3,fmrel4,fmrel5,fmrel6,fmrel7,fmrel8,fmrelease,fmrelease1,fmrelease2,fmrelease3,fmrelease4,fmrelease5,fmrelease6,fmrelease7,fmrelease8,fmsus,fmsus1,fmsus2,fmsus3,fmsus4,fmsus5,fmsus6,fmsus7,fmsus8,fmsustain,fmsustain1,fmsustain2,fmsustain3,fmsustain4,fmsustain5,fmsustain6,fmsustain7,fmsustain8,fmwave,fmwave1,fmwave2,fmwave3,fmwave4,fmwave5,fmwave6,fmwave7,fmwave8,frameRate,frames,freeze,freq:freq$1,fshift,fshiftnote,fshiftphase,ftype,fxr,gain,gat,gate,getControlName,harmonic,hbrick,hcutoff,hold,hours,hp,hpa,hpattack,hpd,hpdc,hpdecay,hpdepth,hpdepthfreq,hpdepthfrequency,hpe,hpenv,hpf,hpq,hpr,hprate,hprelease,hps,hpshape,hpskew,hpsustain,hpsync,hresonance,i:i$2,imag,ir,irbegin,iresponse,irspeed,isControlName,kcutoff,krush,label,lbrick,legato,leslie,lfo,lock,loop,loopBegin,loopEnd,loopb,loope,lp,lpa,lpattack,lpd,lpdc,lpdecay,lpdepth,lpdepthfreq,lpdepthfrequency,lpe,lpenv,lpf,lpq,lpr,lprate,lprelease,lps,lpshape,lpskew,lpsustain,lpsync,lrate,lsize,midibend,midichan,midicmd,midimap,midiport,miditouch,minutes,mode:mode$1,mtranspose,n,noise,note:note$2,nrpnn,nrpv,nudge,oct,octave:octave$1,octaveR,octaves,octer,octersub,octersubsub,offset,orbit,oschost,oscport,overgain,overshape,pan,panchor,panorient,panspan,pansplay,panwidth:panwidth$1,patt,pattack,pcurve,pdec,pdecay,penv,ph,phasdp,phaser,phasercenter,phaserdepth,phaserrate,phasersweep,phc,phd,phs,pitchJump,pitchJumpTime,polyTouch,postgain,prel,prelease,progNum,psus,psustain,pw,pwrate,pwsweep,rdim,real,registerControl,registerMultiControl,rel,release,resonance,rfade,ring,ringdf,ringf,rlp,room,roomdim,roomfade,roomlp,roomsize,rsize,s:s$1,scram,scrub,seconds,semitone,shape,size,slide,smear:smear$1,songPtr,sound,source,speed,spread,squiz,src,stepsPerOctave,stretch,sus,sustain,sustainpedal,sysex,sysexdata,sysexid,sz,transient,trem,tremolo,tremolodepth,tremolophase,tremoloshape,tremoloskew,tremolosync,triode,tsdelay,uid,unison,unit,v,val,vel,velocity,vib,vibmod,vibrato,vmod,voice,vowel,warp,warpatt,warpattack,warpdc,warpdec,warpdecay,warpdepth,warpenv,warpmode,warprate,warprel,warprelease,warpshape,warpskew,warpsus,warpsustain,warpsync,waveloss,wavetablePhaseRand,wavetablePosition,wavetableWarp,wavetableWarpMode,wt:wt$1,wtatt,wtattack,wtdc,wtdec,wtdecay,wtdepth,wtenv,wtphaserand,wtrate,wtrel,wtrelease,wtshape,wtskew,wtsus,wtsustain,wtsync,xsdelay,zcrush,zdelay,zmod,znoise,zrand,zzfx},Symbol.toStringTag,{value:"Module"})),left=function(o,e){const[l,d]=o,[p,b]=e,[R,I]=splitAt(d,p);return[[d,l-d],[zipWith((z,se)=>z.concat(se),R,b),I]]},right=function(o,e){const[l,d]=o,[p,b]=e,[R,I]=splitAt(l,b);return[[l,d-l],[zipWith((se,le)=>se.concat(le),p,R),I]]},_bjorklund=function(o,e){const[l,d]=o;return Math.min(l,d)<=1?[o,e]:_bjorklund(...l>d?left(o,e):right(o,e))},bjorklund=function(o,e){const l=o<0,d=Math.abs(o),p=e-d,b=Array(d).fill([1]),R=Array(p).fill([0]),I=_bjorklund([d,p],[b,R]),z=flatten$1(I[1][0]).concat(flatten$1(I[1][1]));return l?z.map(se=>1-se):z},_euclidRot=function(o,e,l){const d=bjorklund(o,e);return l?rotate$2(d,-l):d},euclid=register("euclid",function(o,e,l){return l.struct(_euclidRot(o,e,0))}),bjork=register("bjork",function(o,e){Array.isArray(o)||(o=[o]);const[l,d=l,p=0]=o;return e.struct(_euclidRot(l,d,p))}),{euclidrot,euclidRot}=register(["euclidrot","euclidRot"],function(o,e,l,d){return d.struct(_euclidRot(o,e,l))}),_euclidLegato=function(o,e,l,d){if(o<1)return silence;const b=_euclidRot(o,e,0).join("").split("1").slice(1).map(R=>[R.length+1,!0]);return d.struct(timeCat(...b)).late(fraction$1(l).div(e))},euclidLegato=register(["euclidLegato"],function(o,e,l){return _euclidLegato(o,e,0,l)}),euclidLegatoRot=register(["euclidLegatoRot"],function(o,e,l,d){return _euclidLegato(o,e,l,d)}),{euclidish,eish}=register(["euclidish","eish"],function(o,e,l,d){const p=_morph(bjorklund(o,e),new Array(o).fill(1),l);return d.struct(p).setSteps(e)});function createClock(o,e,l=.05,d=.1,p=.1,b=globalThis.setInterval,R=globalThis.clearInterval,I=!0){let z=0,se=0,le=10**4,tn=.01;const an=vn=>l=vn(l);p=p||d/2;const sn=()=>{const vn=o(),bn=vn+d+p;for(se===0&&(se=vn+tn);se<bn;)se=I?Math.round(se*le)/le:se,e(se,l,z,vn),se+=l,z++};let ln;const un=()=>{pn(),sn(),ln=b(sn,d*1e3)},pn=()=>{ln!==void 0&&R(ln),ln=void 0};return{setDuration:an,start:un,stop:()=>{z=0,se=0,pn()},pause:()=>pn(),duration:l,interval:d,getPhase:()=>se,minLatency:tn}}class Cyclist{constructor({interval:e,onTrigger:l,onToggle:d,onError:p,getTime:b,latency:R=.1,setInterval:I,clearInterval:z,beforeStart:se}){this.started=!1,this.beforeStart=se,this.cps=.5,this.num_ticks_since_cps_change=0,this.lastTick=0,this.lastBegin=0,this.lastEnd=0,this.getTime=b,this.num_cycles_at_cps_change=0,this.seconds_at_cps_change,this.onToggle=d,this.latency=R,this.clock=createClock(b,(le,tn,an,sn)=>{this.num_ticks_since_cps_change===0&&(this.num_cycles_at_cps_change=this.lastEnd,this.seconds_at_cps_change=le),this.num_ticks_since_cps_change++;const un=this.num_ticks_since_cps_change*tn*this.cps;try{const pn=this.lastEnd;this.lastBegin=pn;const yn=this.num_cycles_at_cps_change+un;if(this.lastEnd=yn,this.lastTick=le,le<sn){console.log("skip query: too late");return}this.pattern.queryArc(pn,yn,{_cps:this.cps,cyclist:"cyclist"}).forEach(Pn=>{if(Pn.hasOnset()){const vn=(Pn.whole.begin-this.num_cycles_at_cps_change)/this.cps+this.seconds_at_cps_change+R,bn=Pn.duration/this.cps,Sn=vn-le;l?.(Pn,Sn,bn,this.cps,vn),Pn.value.cps!==void 0&&this.cps!=Pn.value.cps&&(this.cps=Pn.value.cps,this.num_ticks_since_cps_change=0)}})}catch(pn){errorLogger$1(pn),p?.(pn)}},e,.1,.1,I,z)}now(){if(!this.started)return 0;const e=this.getTime()-this.lastTick-this.clock.duration;return this.lastBegin+e*this.cps}setStarted(e){this.started=e,this.onToggle?.(e)}async start(){if(await this.beforeStart?.(),this.num_ticks_since_cps_change=0,this.num_cycles_at_cps_change=0,!this.pattern)throw new Error("Scheduler: no pattern set! call .setPattern first.");logger$2("[cyclist] start"),this.clock.start(),this.setStarted(!0)}pause(){logger$2("[cyclist] pause"),this.clock.pause(),this.setStarted(!1)}stop(){logger$2("[cyclist] stop"),this.clock.stop(),this.lastEnd=0,this.setStarted(!1)}async setPattern(e,l=!1){this.pattern=e,l&&!this.started&&await this.start()}setCps(e=.5){this.cps!==e&&(this.cps=e,this.num_ticks_since_cps_change=0)}log(e,l,d){const p=d.filter(b=>b.hasOnset());console.log(`${e.toFixed(4)} - ${l.toFixed(4)} ${Array(p.length).fill("I").join("")}`)}}let timelines={};const reset_state=function(){reset_timelines()},reset_timelines=function(){timelines={}},timeline=register("timeline",function(o,e){o=reify(o);const l=function(d){const p=!!d.controls.cyclist,b=o.query(d),R=[];for(const I of b){const z=I.value;let se;if(z===0)se=0;else if(z in timelines)se=timelines[z];else{const tn=I.wholeOrPart();!p||d.span.begin.lt(tn.midpoint())?se=tn.begin:se=tn.end}p&&(timelines[z]=se,z!==0&&delete timelines[-z]);const le=e.late(se).query(d.setSpan(I.part)).map(tn=>tn.setContext(tn.combineContext(I)));R.push(...le)}return R};return new Pattern$1(l,e._steps)},!1),_pick=function(o,e,l=!0){const d=Array.isArray(o),p=Object.keys(o).length;return o=objectMap(o,reify),p===0?silence:e.fmap(b=>{let R=b;return d&&(R=l?Math.round(R)%p:clamp$1(Math.round(R),0,o.length-1)),o[R]})},pick=function(o,e){return Array.isArray(e)&&([e,o]=[o,e]),__pick(o,e)},__pick=register("pick",function(o,e){return _pick(o,e,!1).innerJoin()}),pickmod=register("pickmod",function(o,e){return _pick(o,e,!0).innerJoin()}),pickF=register("pickF",function(o,e,l){return l.apply(pick(e,o))}),pickmodF=register("pickmodF",function(o,e,l){return l.apply(pickmod(e,o))}),pickOut=register("pickOut",function(o,e){return _pick(o,e,!1).outerJoin()}),pickmodOut=register("pickmodOut",function(o,e){return _pick(o,e,!0).outerJoin()}),pickRestart=register("pickRestart",function(o,e){return _pick(o,e,!1).restartJoin()}),pickmodRestart=register("pickmodRestart",function(o,e){return _pick(o,e,!0).restartJoin()}),pickReset=register("pickReset",function(o,e){return _pick(o,e,!1).resetJoin()}),pickmodReset=register("pickmodReset",function(o,e){return _pick(o,e,!0).resetJoin()}),{inhabit,pickSqueeze}=register(["inhabit","pickSqueeze"],function(o,e){return _pick(o,e,!1).squeezeJoin()}),{inhabitmod,pickmodSqueeze}=register(["inhabitmod","pickmodSqueeze"],function(o,e){return _pick(o,e,!0).squeezeJoin()}),squeeze=(o,e)=>(e=e.map(reify),e.length==0?silence:o.fmap(l=>{const d=_mod$2(Math.round(l),e.length);return e[d]}).squeezeJoin());class NeoCyclist{constructor({onTrigger:e,onToggle:l,getTime:d}){this.started=!1,this.cps=.5,this.getTime=d,this.time_at_last_tick_message=0,this.collator=new ClockCollator({getTargetClockTime:d}),this.onToggle=l,this.latency=.1,this.cycle=0,this.id=Math.round(Date.now()*Math.random()),this.worker=new SharedWorker(new URL(""+new URL("assets/clockworker-ZDiUtESR.js",document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"&&document.currentScript.src||document.baseURI).href,_documentCurrentScript&&_documentCurrentScript.tagName.toUpperCase()==="SCRIPT"&&_documentCurrentScript.src||new URL("index.js",document.baseURI).href)),this.worker.port.start(),this.channel=new BroadcastChannel("strudeltick");const p=R=>{const{cps:I,begin:z,end:se,cycle:le,time:tn}=R;this.cps=I,this.cycle=le;const an=this.collator.calculateOffset(tn)+tn;b(z,se,an),this.time_at_last_tick_message=an},b=(R,I,z)=>{if(this.started===!1)return;this.pattern.queryArc(R,I,{_cps:this.cps,cyclist:"neocyclist"}).forEach(le=>{if(le.hasOnset()){const an=cycleToSeconds$1(le.whole.begin-this.cycle,this.cps)+z+this.latency,sn=cycleToSeconds$1(le.duration,this.cps);e?.(le,0,sn,this.cps,an)}})};this.channel.onmessage=R=>{if(!this.started)return;const{payload:I,type:z}=R.data;switch(z){case"tick":p(I)}}}sendMessage(e,l){this.worker.port.postMessage({type:e,payload:l,id:this.id})}now(){const e=(this.getTime()-this.time_at_last_tick_message)*this.cps;return this.cycle+e}setCps(e=1){this.sendMessage("cpschange",{cps:e})}setCycle(e){this.sendMessage("setcycle",{cycle:e})}setStarted(e){this.sendMessage("toggle",{started:e}),this.started=e,this.onToggle?.(e)}start(){logger$2("[cyclist] start"),this.setStarted(!0)}stop(){logger$2("[cyclist] stop"),this.collator.reset(),this.setStarted(!1)}setPattern(e,l=!1){this.pattern=e,l&&!this.started&&this.start()}log(e,l,d){const p=d.filter(b=>b.hasOnset());console.log(`${e.toFixed(4)} - ${l.toFixed(4)} ${Array(p.length).fill("I").join("")}`)}}let time$1,cpsFunc,pattern,triggerFunc,isStarted;function getTime(){if(!time$1)throw new Error("no time set! use setTime to define a time source");return time$1()}function setTime(o){time$1=o}function setCpsFunc(o){cpsFunc=o}function getCps(){return cpsFunc?.()}function setPattern(o){pattern=o}function getPattern(){return pattern}function setTriggerFunc(o){triggerFunc=o}function getTriggerFunc(){return triggerFunc}function setIsStarted(o){isStarted=!!o}function getIsStarted(){return isStarted}function repl$1({defaultOutput:o,onEvalError:e,beforeEval:l,beforeStart:d,afterEval:p,getTime:b,transpiler:R,onToggle:I,editPattern:z,onUpdateState:se,sync:le=!1,setInterval:tn,clearInterval:an,id:sn,mondo:ln=!1}){const un={schedulerError:void 0,evalError:void 0,code:"// LOADING",activeCode:"// LOADING",pattern:void 0,miniLocations:[],widgets:[],sliders:[],pending:!1,started:!1},pn={id:sn},yn=Jn=>{Object.assign(un,Jn),un.isDirty=un.code!==un.activeCode,un.error=un.evalError||un.schedulerError,se?.(un)},_n={onTrigger:getTrigger({defaultOutput:o,getTime:b}),getTime:b,onToggle:Jn=>{yn({started:Jn}),setIsStarted(Jn),I?.(Jn),Jn||reset_state()},setInterval:tn,clearInterval:an,beforeStart:d},Pn=le&&typeof SharedWorker<"u"?new NeoCyclist(_n):new Cyclist(_n);setTriggerFunc(_n.onTrigger),setCpsFunc(()=>Pn.cps);let vn={},bn=0,Sn,An={},Dn=null,Bn=new Map;function Nn(Jn){return Object.entries(An).flatMap(([ga,_i])=>ga==="$"?Array.isArray(_i)?_i.flatMap(Un=>Un[Jn]||[]):[]:_i[Jn]||[])}function Qn(Jn,ga,_i,Un,ha){const sa=Jn[ga],Ga=Jn[ga+1]||{index:_i.length,end:_i.length},Ha=_i.slice(sa.index,Ga.index),ls=[sa.index+Un.range[0],sa.end+Un.range[0]],ns=sa.index+Un.range[0],Ba=Ga.index+Un.range[0],rs=(ha?.widgets||[]).filter(Za=>{const ca=Za.from??Za.index??0;return ca>=ns&&ca<Ba}),bs=(ha?.sliders||[]).filter(Za=>{const ca=Za.from??Za.index??0;return ca>=ns&&ca<Ba}),Fa=(ha?.miniLocations||[]).filter(Za=>{const ca=Array.isArray(Za)?Za[0]:Za.start??Za.from??0;return ca>=ns&&ca<Ba});Vn(sa,Ha,{...Un,range:ls},{widgets:rs,sliders:bs,miniLocations:Fa})}function Zn(Jn,ga,_i){for(const[Un,ha]of Object.entries(Jn)){if(Un===ga||!ha.range)continue;const[sa,Ga]=ha.range,[Ha,ls]=_i;ls<=sa||Ha>=Ga||delete Jn[Un]}}function Vn(Jn,ga,_i,Un){const ha=Jn.activeVisualizer||null;ha!==null&&(Dn=Jn.name),An[Jn.name]={code:ga,range:_i.range,labels:[Jn.name],miniLocations:Un?.miniLocations||[],widgets:Un?.widgets||[],sliders:Un?.sliders||[],activeVisualizer:ha},Zn(An,Jn.name,_i.range)}function qn(Jn,ga,_i){const Un=ga.range||[];if(Un.length<2)return;const ha=`_decl:${Un[0]}:${Un[1]}`;An[ha]={code:Jn,range:Un,labels:[],miniLocations:_i?.miniLocations||[],widgets:_i?.widgets||[],sliders:_i?.sliders||[],activeVisualizer:null},Zn(An,ha,Un)}const ia=function(){return vn={},bn=0,Sn=void 0,An={},Bn.clear(),Dn=null,silence};function ra(Jn){return Jn._Pattern?Jn.__pure:Jn}const aa=async(Jn,ga=!0)=>(Jn=z?.(Jn)||Jn,await Pn.setPattern(Jn,ga),setPattern(Jn),Jn);setTime(()=>Pn.now());function jn(Jn){if(Object.values(vn).length){let _i=[],Un=!1;for(const[ha,sa]of Object.entries(vn)){const Ga=ha.length>1&&ha.startsWith("S");if(Ga&&Un===!1&&(_i=[],Un=!0),!Un||Un&&Ga){const Ha=sa.withState(ls=>ls.setControls({id:ha}));_i.push(Ha)}}Sn&&(_i=_i.map(ha=>Sn(ha))),Jn=stack(..._i)}else Sn&&(Jn=Sn(Jn));if(va.length)for(const _i of va)Jn=_i(Jn);return isPattern(Jn)||(Jn=silence),Jn}const ka=()=>{An={},Bn.clear(),vn={},Dn=null,yn({miniLocations:[],widgets:[],sliders:[]}),Pn.stop()},Aa=()=>Pn.start(),Na=()=>Pn.pause(),Kn=()=>Pn.toggle(),Ea=Jn=>(Pn.setCps(ra(Jn)),silence),qa=Jn=>(Pn.setCps(ra(Jn)/60),silence);let va=[];const Oa=function(Jn){return va.push(Jn),silence},Va=function(Jn){return Sn=Jn,silence},$a=()=>{Pattern$1.prototype.p=function(ga){return typeof ga=="string"&&(ga.startsWith("_")||ga.endsWith("_"))?silence:(ga.includes("$")&&(ga=`${ga}${bn}`,bn++),vn[ga]=this,this)},Pattern$1.prototype.q=function(ga){return silence};try{for(let ga=1;ga<10;++ga)Object.defineProperty(Pattern$1.prototype,`d${ga}`,{get(){return this.p(ga)},configurable:!0}),Object.defineProperty(Pattern$1.prototype,`p${ga}`,{get(){return this.p(ga)},configurable:!0}),Pattern$1.prototype[`q${ga}`]=silence}catch(ga){console.warn("injectPatternMethods: error:",ga)}const Jn=register("cpm",function(ga,_i){return _i._fast(ga/60/Pn.cps)});return evalScope({all:Oa,each:Va,hush:ia,cpm:Jn,setCps:Ea,setcps:Ea,setCpm:qa,setcpm:qa})};return{scheduler:Pn,evaluate:async(Jn,ga=!0)=>{if(!Jn)throw new Error("no code to evaluate");try{yn({code:Jn,pending:!0}),await $a(),setTime(()=>Pn.now()),await l?.({code:Jn,blockBased:!1}),va=[],An={},ia(),ln&&(Jn=`mondolang\`${Jn}\``);let{pattern:_i,meta:Un}=await evaluate(Jn,R,pn);return _i=jn(_i),logger$2("[eval] code updated"),_i=await aa(_i,ga),yn({miniLocations:Un?.miniLocations||[],widgets:Un?.widgets||[],sliders:Un?.sliders||[],activeCode:Jn,pattern:_i,evalError:void 0,schedulerError:void 0,pending:!1}),p?.({code:Jn,pattern:_i,meta:Un,range:void 0,widgetRemoved:!1}),_i}catch(_i){logger$2(`[eval] error: ${_i.message}`,"error"),console.error(_i),yn({evalError:_i,pending:!1}),e?.(_i)}},evaluateBlock:async(Jn,ga=!0,_i={})=>{if(!Jn)throw new Error("no code to evaluate");try{yn({code:Jn,pending:!0}),await $a(),setTime(()=>Pn.now()),await l?.({code:Jn,blockBased:!0}),va=[];const Un={...pn,blockBased:!0,range:_i.range||[]};ln&&(Jn=`mondolang\`${Jn}\``);let{pattern:ha,meta:sa}=await evaluate(Jn,R,Un),Ga=!1;const Ha=sa.labels||[];if(Ha.some(Ba=>Ba.name.startsWith("$")))throw new Error("anonymous labels disabled for block based evaluation (see https://strudel.cc/blog/#label-notation)");if(Ha.length>0)for(let Ba=0;Ba<Ha.length;Ba++)Qn(Ha,Ba,sa.output,_i,sa);else qn(Jn,_i,sa);sa.miniLocations=Nn("miniLocations"),sa.widgets=Nn("widgets"),sa.sliders=Nn("sliders");const ns=Ha.map(Ba=>Ba.name);for(const[Ba,rs]of Object.entries(An))ns.includes(Ba)&&(rs.activeVisualizer!==null?Dn=Ba:Dn===Ba&&(Ga=!0,Dn=null));return vn=Object.fromEntries(Object.entries(vn).filter(([Ba])=>Object.keys(An).includes(Ba))),ha=jn(ha),logger$2("[eval] code updated"),ha=await aa(ha,ga),yn({miniLocations:sa?.miniLocations||[],widgets:sa?.widgets||[],sliders:sa?.sliders||[],activeCode:Jn,pattern:ha,evalError:void 0,schedulerError:void 0,pending:!1}),p?.({code:Jn,pattern:ha,meta:sa,range:_i.range,widgetRemoved:Ga}),ha}catch(Un){logger$2(`[eval] error: ${Un.message}`,"error"),console.error(Un),yn({evalError:Un,pending:!1}),e?.(Un)}},start:Aa,stop:ka,pause:Na,setCps:Ea,setPattern:aa,setCode:Jn=>yn({code:Jn}),toggle:Kn,state:un}}const getTrigger=({getTime:o,defaultOutput:e})=>async(l,d,p,b,R)=>{try{(!l.context.onTrigger||!l.context.dominantTrigger)&&await e(l,d,p,b,R),l.context.onTrigger&&await l.context.onTrigger(l,o(),b,R)}catch(I){errorLogger$1(I,"getTrigger")}};function steady(o){return new Pattern$1(e=>[new Hap(void 0,e.span,o)])}const signal$1=o=>{const e=l=>[new Hap(void 0,l.span,o(l.span.begin,l.controls))];return new Pattern$1(e)},saw=signal$1(o=>o%1),saw2=saw.toBipolar(),isaw=signal$1(o=>1-o%1),isaw2=isaw.toBipolar(),sine2=signal$1(o=>Math.sin(Math.PI*2*o)),sine=sine2.fromBipolar(),cosine=sine._early(fraction$1(1).div(4)),cosine2=sine2._early(fraction$1(1).div(4)),square=signal$1(o=>Math.floor(o*2%2)),square2=square.toBipolar(),tri=fastcat(saw,isaw),tri2=fastcat(saw2,isaw2),itri=fastcat(isaw,saw),itri2=fastcat(isaw2,saw2),time=signal$1(id$1);let _mouseY=0,_mouseX=0;typeof window<"u"&&document.addEventListener("mousemove",o=>{_mouseY=o.clientY/document.body.clientHeight,_mouseX=o.clientX/document.body.clientWidth});const mousey=signal$1(()=>_mouseY),mouseY=signal$1(()=>_mouseY),mousex=signal$1(()=>_mouseX),mouseX=signal$1(()=>_mouseX),_murmurHashFinalizer=o=>(o|=0,o^=o>>>16,o=Math.imul(o,2246822507),o^=o>>>13,o=Math.imul(o,3266489909),o^=o>>>16,o>>>0),_tToT=o=>Math.floor(o*536870912),_decorrelate=(o,e=0,l=0)=>{const d=o>>>0>>>0,p=Math.floor(o/4294967296)>>>0;let b=d^Math.imul(p^2246822507,3266489909);return b^=Math.imul(e^2135587861,2654435769),b^=Math.imul(l^374761393,668265261),b>>>0},randAt=(o,e=0,l=0)=>_murmurHashFinalizer(_decorrelate(o,e,l))/4294967296,timeToRands=(o,e,l=0)=>{const d=_tToT(o);if(e===1)return randAt(d,0,l);const p=new Array(e);for(let b=0;b<e;b++)p[b]=randAt(d,b,l);return p},__xorwise=o=>{const e=o<<13^o,l=e>>17^e;return l<<5^l},__frac=o=>o-Math.trunc(o),__timeToIntSeed=o=>__xorwise(Math.trunc(__frac(o/300)*536870912)),__intSeedToRand=o=>o%536870912/536870912,__timeToRandsPrime=(o,e)=>{if(e===1)return Math.abs(__intSeedToRand(o));const l=[];for(let d=0;d<e;d++)l.push(__intSeedToRand(o)),o=__xorwise(o);return l},__timeToRands=(o,e)=>__timeToRandsPrime(__timeToIntSeed(o),e);let RNG_MODE="legacy";const getRandsAtTime=(o,e=1,l=0)=>RNG_MODE==="legacy"?__timeToRands(o+l,e):timeToRands(o,e,l),useRNG=(o="legacy")=>RNG_MODE=o,run=o=>saw.range(0,o).round().segment(o),binary=o=>{const e=reify(o).log2().floor().add(1);return binaryN(o,e)},binaryN=(o,e=16)=>{e=reify(e);const l=run(e).mul(-1).add(e.sub(1));return reify(o).segment(e).brshift(l).band(pure(1))},binaryL=o=>{const e=reify(o).log2().floor().add(1);return binaryNL(o,e)},binaryNL=(o,e=16)=>reify(o).withValue(l=>d=>{const p=[];for(let b=d-1;b>=0;b--)p.push(l>>b&1);return p}).appLeft(reify(e)),randL=o=>signal$1(e=>l=>getRandsAtTime(e,l).map(Math.abs)).appLeft(reify(o)),randrun=o=>signal$1((e,l)=>{let d=getRandsAtTime(e.floor().add(.5),o,l.randSeed);Array.isArray(d)||(d=[d]);const p=d.map((R,I)=>[R,I]).sort((R,I)=>(R[0]>I[0])-(R[0]<I[0])).map(R=>R[1]),b=e.cyclePos().mul(o).floor()%o;return p[b]})._segment(o),_rearrangeWith=(o,e,l)=>{const d=[...Array(e).keys()].map(p=>l.zoom(fraction$1(p).div(e),fraction$1(p+1).div(e)));return o.fmap(p=>d[p].repeatCycles(e)._fast(e)).innerJoin()},shuffle$2=register("shuffle",(o,e)=>_rearrangeWith(randrun(o),o,e)),scramble=register("scramble",(o,e)=>_rearrangeWith(_irand(o)._segment(o),o,e)),withSeed=(o,e)=>new Pattern$1(l=>{let{randSeed:d,...p}=l.controls;return d=o(d),e.query(l.setControls({...p,randSeed:d}))},e._steps),seed=register("seed",(o,e)=>withSeed(()=>o,e)),rand=signal$1((o,e)=>getRandsAtTime(o,1,e.randSeed)),rand2=rand.toBipolar(),_brandBy=o=>rand.fmap(e=>e<o),brandBy=o=>reify(o).fmap(_brandBy).innerJoin(),brand=_brandBy(.5),_irand=o=>rand.fmap(e=>Math.trunc(e*o)),irand=o=>reify(o).fmap(_irand).innerJoin(),__chooseWith=(o,e)=>(e=e.map(reify),e.length==0?silence:o.range(0,e.length).fmap(l=>{const d=Math.min(Math.max(Math.floor(l),0),e.length-1);return e[d]})),chooseWith=(o,e)=>__chooseWith(o,e).outerJoin(),chooseInWith=(o,e)=>__chooseWith(o,e).innerJoin(),choose=(...o)=>chooseWith(rand,o),chooseIn=(...o)=>chooseInWith(rand,o),chooseOut=choose;Pattern$1.prototype.choose=function(...o){return chooseWith(this,o)},Pattern$1.prototype.choose2=function(...o){return chooseWith(this.fromBipolar(),o)};const chooseCycles=(...o)=>chooseInWith(rand.segment(1),o),randcat=chooseCycles,_wchooseWith=function(o,...e){const l=e.map(I=>reify(I[0])),d=[];let p=pure(0);for(const I of e)p=p.add(I[1]),d.push(p);const b=sequenceP(d),R=function(I){const z=p.mul(I);return b.fmap(se=>le=>l[se.findIndex(tn=>tn>le,se)]).appLeft(z)};return o.bind(R)},wchooseWith=(...o)=>_wchooseWith(...o).outerJoin(),wchoose=(...o)=>wchooseWith(rand,...o),wchooseCycles=(...o)=>_wchooseWith(rand.segment(1),...o).innerJoin(),wrandcat=wchooseCycles;function _perlin(o,e=0){let l=Math.floor(o),d=l+1;const p=se=>6*se**5-15*se**4+10*se**3,b=se=>le=>tn=>le+p(se)*(tn-le),R=getRandsAtTime(l,1,e),I=getRandsAtTime(d,1,e);return b(o-l)(R)(I)}function _berlin(o,e=0){const l=Math.floor(o),d=l+1,p=getRandsAtTime(l,1,e),b=getRandsAtTime(d,1,e),R=p+b,I=(o-l)/(d-l);return((se,le,tn)=>se+tn*(le-se))(p,R,I)/2}const perlin=signal$1((o,e)=>_perlin(o,e.randSeed)),berlin=signal$1((o,e)=>_berlin(o,e.randSeed)),degradeByWith=register("degradeByWith",(o,e,l)=>l.fmap(d=>p=>d).appLeft(o.filterValues(d=>d>e)),!0,!0),degradeBy=register("degradeBy",function(o,e){return e._degradeByWith(rand,o)},!0,!0),degrade=register("degrade",o=>o._degradeBy(.5),!0,!0),undegradeBy=register("undegradeBy",function(o,e){return e._degradeByWith(rand.fmap(l=>1-l),o)},!0,!0),undegrade=register("undegrade",o=>o._undegradeBy(.5),!0,!0),sometimesBy=register("sometimesBy",function(o,e,l){return reify(o).fmap(d=>stack(l._degradeBy(d),e(l._undegradeBy(1-d)))).innerJoin()}),sometimes=register("sometimes",function(o,e){return e._sometimesBy(.5,o)}),someCyclesBy=register("someCyclesBy",function(o,e,l){return reify(o).fmap(d=>stack(l._degradeByWith(rand._segment(1),d),e(l._degradeByWith(rand.fmap(p=>1-p)._segment(1),1-d)))).innerJoin()}),someCycles=register("someCycles",function(o,e){return e._someCyclesBy(.5,o)}),often=register("often",function(o,e){return e.sometimesBy(.75,o)}),rarely=register("rarely",function(o,e){return e.sometimesBy(.25,o)}),almostNever=register("almostNever",function(o,e){return e.sometimesBy(.1,o)}),almostAlways=register("almostAlways",function(o,e){return e.sometimesBy(.9,o)}),never=register("never",function(o,e){return e}),always=register("always",function(o,e){return o(e)});function _keyDown(o){Array.isArray(o)===!1&&(o=[o]);const e=getCurrentKeyboardState();return o.every(l=>{const d=keyAlias.get(l)??l;return e[d]})}const whenKey=register("whenKey",function(o,e,l){return l.when(_keyDown(o),e)}),keyDown=register("keyDown",function(o){return o.fmap(_keyDown)}),cyclesPer=new Pattern$1(function(o){return[new Hap(void 0,o.span,o.span.duration)]}),per=new Pattern$1(function(o){return[new Hap(void 0,o.span,fraction$1(1).div(o.span.duration))]}),perCycle=per,perx=new Pattern$1(function(o){const e=fraction$1(1).div(o.span.duration);return[new Hap(void 0,o.span,Math.log(e)/Math.log(2)+1)]});let synth;try{synth=window?.speechSynthesis}catch(o){console.warn("cannot use window: not in browser?")}let allVoices=synth?.getVoices();function triggerSpeech(o,e,l){synth.cancel();const d=new SpeechSynthesisUtterance(o);d.lang=e,allVoices=synth.getVoices();const p=allVoices.filter(b=>b.lang.includes(e));typeof l=="number"?d.voice=p[l%p.length]:typeof l=="string"&&(d.voice=p.find(b=>b.name===b)),speechSynthesis.speak(d)}const speak=register("speak",function(o,e,l){return l.onTrigger(d=>{triggerSpeech(d.value,o,e)})}),backgroundImage=function(o,e={}){const l=document.getElementById("code"),d="background-image:url("+o+");background-size:contain;";l.style=d;const{className:p}=l,b=(z,se)=>{({style:()=>l.style=d+";"+se,className:()=>l.className=se+" "+p})[z]()},R=Object.entries(e).filter(([z,se])=>typeof se=="function");Object.entries(e).filter(([z,se])=>typeof se=="string").forEach(([z,se])=>b(z,se)),R.length},cleanupUi=()=>{const o=document.getElementById("code");o&&(o.style="")};logger$2("🌀 @strudel/core loaded 🌀"),globalThis._strudelLoaded&&console.warn(`@strudel/core was loaded more than once...
|
||
This might happen when you have multiple versions of strudel installed.
|
||
Please check with "npm ls @strudel/core".`),globalThis._strudelLoaded=!0;const core=Object.freeze(Object.defineProperty({__proto__:null,ClockCollator,Cyclist,FXr,FXrel,FXrelease,Fraction:fraction$1,Hap,Pattern:Pattern$1,State,TimeSpan,__chooseWith,_brandBy,_fitslice,_irand,_keyDown,_match,_mod:_mod$2,_morph,_polymeterListSteps,_retime,_slices,accelerate,activeLabel,ad,add:add$7,adsr,almostAlways,almostNever,always,amp,analyze,anchor,and,apply,applyN,ar,arp,arpWith,arrange,as,asym,att,attack,averageArray,backgroundImage,band,bandf,bandq,bank,base64ToUnicode,bbexpr,bbst,beat,begin,berlin,bgain,binary,binaryL,binaryN,binaryNL,bind,binshift,bite,bjork,bjorklund,blshift,bmod,bor,bp,bpa,bpattack,bpd,bpdc,bpdecay,bpdepth,bpdepthfreq,bpdepthfrequency,bpe,bpenv,bpf,bpq,bpr,bprate,bprelease,bps,bpshape,bpskew,bpsustain,bpsync,brak,brand,brandBy,brshift,bus,busgain,bxor,bypass,byteBeatExpression,byteBeatStartTime,calculateSteps,cat,ccn,ccv,ceil,ch,channel,channels,chebyshev,choose,chooseCycles,chooseIn,chooseInWith,chooseOut,chooseWith,chop,chord:chord$1,chorus,chunk,chunkBack,chunkBackInto,chunkInto,chunkback,chunkbackinto,chunkinto,clamp:clamp$1,cleanupUi,clearScope,clip:clip$1,coarse,code2hash,color,colour,comb,compose,compress,compressSpan,compressor,compressorAttack,compressorKnee,compressorRatio,compressorRelease,compressspan,constant,contract,control,controls,cosine,cosine2,cpm,cps,createClock,createParam,createParams,crush,ctf,ctlNum,ctranspose,cubic,curry,curve,cut,cutoff,cycleToSeconds:cycleToSeconds$1,cyclesPer,dec:dec$1,decay,degrade,degradeBy,degradeByWith,degree,delay,delayfb,delayfeedback,delayspeed,delaysync,delayt,delaytime,deltaSlide,det,detune,dfb,dict,dictionary:dictionary$3,diode,dist:dist$3,distort,distorttype,distortvol,div,djf,drawLine,drive,drop,dry,ds,dt:dt$1,duck,duckattack,duckdepth,duckonset,dur,duration,early,echo,echoWith,echowith,eish,end,enhance,env,eq,eqt,errorLogger:errorLogger$1,euclid,euclidLegato,euclidLegatoRot,euclidRot,euclidish,euclidrot,evalScope,evaluate,every,expand,expression,extend,fadeInTime,fadeOutTime,fadeTime,fanchor,fast,fastChunk,fastGap,fastcat,fastchunk,fastgap,fft,filter:filter$1,filterWhen,firstOf,fit,flatten:flatten$1,floor,fm:fm$1,fm1,fm2,fm3,fm4,fm5,fm6,fm7,fm8,fmatt,fmatt1,fmatt2,fmatt3,fmatt4,fmatt5,fmatt6,fmatt7,fmatt8,fmattack,fmattack1,fmattack2,fmattack3,fmattack4,fmattack5,fmattack6,fmattack7,fmattack8,fmdec,fmdec1,fmdec2,fmdec3,fmdec4,fmdec5,fmdec6,fmdec7,fmdec8,fmdecay,fmdecay1,fmdecay2,fmdecay3,fmdecay4,fmdecay5,fmdecay6,fmdecay7,fmdecay8,fme,fmenv,fmenv1,fmenv2,fmenv3,fmenv4,fmenv5,fmenv6,fmenv7,fmenv8,fmh,fmh1,fmh2,fmh3,fmh4,fmh5,fmh6,fmh7,fmh8,fmi,fmi1,fmi2,fmi3,fmi4,fmi5,fmi6,fmi7,fmi8,fmrel,fmrel1,fmrel2,fmrel3,fmrel4,fmrel5,fmrel6,fmrel7,fmrel8,fmrelease,fmrelease1,fmrelease2,fmrelease3,fmrelease4,fmrelease5,fmrelease6,fmrelease7,fmrelease8,fmsus,fmsus1,fmsus2,fmsus3,fmsus4,fmsus5,fmsus6,fmsus7,fmsus8,fmsustain,fmsustain1,fmsustain2,fmsustain3,fmsustain4,fmsustain5,fmsustain6,fmsustain7,fmsustain8,fmwave,fmwave1,fmwave2,fmwave3,fmwave4,fmwave5,fmwave6,fmwave7,fmwave8,focus,focusSpan,focusspan,fold,fractionalArgs,frameRate,frames,freeze,freq:freq$1,freqToMidi:freqToMidi$2,fromBipolar,fshift,fshiftnote,fshiftphase,ftype,func,fxr,gain,gap,gat,gate,getAccidentalsOffset:getAccidentalsOffset$1,getControlName,getCps,getCurrentKeyboardState,getEventOffsetMs,getFreq,getFrequency,getIsStarted,getPattern,getPerformanceTimeSeconds,getPlayableNoteValue,getRandsAtTime,getSoundIndex:getSoundIndex$1,getTime,getTrigger,getTriggerFunc,grow,gt:gt$1,gte,hard,harmonic,hash2code,hbrick,hcutoff,hold,hours,hp,hpa,hpattack,hpd,hpdc,hpdecay,hpdepth,hpdepthfreq,hpdepthfrequency,hpe,hpenv,hpf,hpq,hpr,hprate,hprelease,hps,hpshape,hpskew,hpsustain,hpsync,hresonance,hsl,hsla,hurry,i:i$2,id:id$1,imag,inhabit,inhabitmod,innerBind,inside:inside$1,inv,invert:invert$1,ir,irand,irbegin,iresponse,irspeed,isControlName,isNote,isNoteWithOctave,isPattern,isaw,isaw2,iter,iterBack,iterback,itri,itri2,jux,juxBy,juxby,kcutoff,keep,keepif,keyAlias,keyDown,krush,label,lastOf,late,lbrick,legato,leslie,lfo,linger,listRange,lock,log2,logKey,logger:logger$2,loop,loopAt,loopAtCps,loopBegin,loopEnd,loopat,loopatcps,loopb,loope,lp,lpa,lpattack,lpd,lpdc,lpdecay,lpdepth,lpdepthfreq,lpdepthfrequency,lpe,lpenv,lpf,lpq,lpr,lprate,lprelease,lps,lpshape,lpskew,lpsustain,lpsync,lrate,lsize,lt:lt$2,lte,mapArgs,mask,midi2note:midi2note$1,midiToFreq:midiToFreq$2,midibend,midichan,midicmd,midimap,midiport,miditouch,minutes,mod:mod$3,mode:mode$1,morph,mouseX,mouseY,mousex,mousey,mtranspose,mul,n,nanFallback:nanFallback$1,ne:ne$1,net,never,noise,note:note$2,noteToMidi:noteToMidi$1,nothing,nrpnn,nrpv,nudge,numeralArgs,objectMap,oct,octave:octave$1,octaveR,octaves,octer,octersub,octersubsub,off:off$1,offset,often,or,orbit,oschost,oscport,outerBind,outside,overgain,overshape,pace,pairs,palindrome,pan,panchor,panorient,panspan,pansplay,panwidth:panwidth$1,parray,parseFractional,parseNumeral,partials,patt,pattack,pcurve,pdec,pdecay,penv,per,perCycle,perlin,perx,ph,phasdp,phaser,phasercenter,phaserdepth,phaserrate,phasersweep,phases,phc,phd,phs,pick,pickF,pickOut,pickReset,pickRestart,pickSqueeze,pickmod,pickmodF,pickmodOut,pickmodReset,pickmodRestart,pickmodSqueeze,pipe,pitchJump,pitchJumpTime,ply,plyForEach,plyWith,pm,polyBind,polyTouch,polymeter,polyrhythm,postgain,pow,pr,prel,prelease,press,pressBy,progNum,psus,psustain,pure,pw,pwrate,pwsweep,rand,rand2,randL,randcat,randrun,range:range$2,range2,rangex,rarely,ratio:ratio$2,rdim,real,ref:ref$1,register,registerControl,registerMultiControl,reify,rel,release,removeUndefineds,repeatCycles,repl:repl$1,replicate,reset_state,reset_timelines,resonance,rev,revv,rfade,rib,ribbon,ring,ringdf,ringf,rlp,room,roomdim,roomfade,roomlp,roomsize,rotate:rotate$2,round,rsize,run,s:s$1,s_add,s_alt,s_cat,s_contract,s_expand,s_extend,s_polymeter,s_sub,s_taper,s_taperlist,s_tour,s_zip,saw,saw2,scram,scramble,scrub,seconds,seed,seg,segment,semitone,seq,seqPLoop,sequence,sequenceP,set,setCpsFunc,setDefaultJoin,setIsStarted,setPattern,setStringParser,setTime,setTriggerFunc,shape,shrink,shrinklist,shuffle:shuffle$2,signal:signal$1,silence,sine,sine2,sinefold,size,slice,slide,slow,slowChunk,slowcat,slowcatPrime,slowchunk,smear:smear$1,soft,sol2note,someCycles,someCyclesBy,sometimes,sometimesBy,songPtr,sound,source,sparsity,speak,speed,splice,splitAt,spread,square,square2,squeeze,squeezeBind,squiz,src,stack,stackBy,stackCentre,stackLeft,stackRight,steady,stepBind,stepalt,stepcat,steps:steps$2,stepsPerOctave,stretch,striate,stringifyValues,struct,strudelScope,stut,stutWith,stutwith,sub,superimpose,sus,sustain,sustainpedal,swing,swingBy,sysex,sysexdata,sysexid,sz,take,time,timeCat,timecat,timeline,toBipolar,tokenizeNote:tokenizeNote$3,tour,transient,trem,tremolo,tremolodepth,tremolophase,tremoloshape,tremoloskew,tremolosync,tri,tri2,triode,tsdelay,uid,undegrade,undegradeBy,unicodeToBase64,uniq,uniqsort,uniqsortr,unison,unit,useRNG,userDefinedKeys,v,val,valueToMidi:valueToMidi$1,vel,velocity,vib,vibmod,vibrato,vmod,voice,vowel,warp,warpatt,warpattack,warpdc,warpdec,warpdecay,warpdepth,warpenv,warpmode,warprate,warprel,warprelease,warpshape,warpskew,warpsus,warpsustain,warpsync,waveloss,wavetablePhaseRand,wavetablePosition,wavetableWarp,wavetableWarpMode,wchoose,wchooseCycles,when,whenKey,withSeed,withValue,within,worklet:worklet$1,wrandcat,wt:wt$1,wtatt,wtattack,wtdc,wtdec,wtdecay,wtdepth,wtenv,wtphaserand,wtrate,wtrel,wtrelease,wtshape,wtskew,wtsus,wtsustain,wtsync,xfade,xsdelay,zcrush,zdelay,zip,zipWith,zmod,znoise,zoom,zoomArc,zoomarc,zrand,zzfx},Symbol.toStringTag,{value:"Module"})),getDrawContext=(o="test-canvas",e)=>{let{contextType:l="2d",pixelated:d=!1,pixelRatio:p=window.devicePixelRatio}=e||{},b=document.querySelector("#"+o);if(!b){b=document.createElement("canvas"),b.id=o,b.width=window.innerWidth*p,b.height=window.innerHeight*p,b.style="pointer-events:none;width:100%;height:100%;position:fixed;top:0;left:0",d&&(b.style.imageRendering="pixelated"),document.body.prepend(b);let R;window.addEventListener("resize",()=>{R&&clearTimeout(R),R=setTimeout(()=>{b.width=window.innerWidth*p,b.height=window.innerHeight*p},200)})}return b.getContext(l,{willReadFrequently:!0})};let animationFrames={};function stopAnimationFrame(o){animationFrames[o]!==void 0&&(cancelAnimationFrame(animationFrames[o]),delete animationFrames[o])}function stopAllAnimations(o){Object.keys(animationFrames).forEach(e=>(!o||e.startsWith(o))&&stopAnimationFrame(e))}let memory={};Pattern$1.prototype.draw=function(o,e){if(typeof window>"u")return this;let{id:l=1,lookbehind:d=0,lookahead:p=0}=e,b=Math.max(getTime(),0);stopAnimationFrame(l),d=Math.abs(d),memory[l]=(memory[l]||[]).filter(se=>!se.isInFuture(b));let R=this.queryArc(b,b+p).filter(se=>se.hasOnset());memory[l]=memory[l].concat(R);let I;const z=()=>{const se=getTime(),le=se+p;memory[l]=memory[l].filter(sn=>sn.isInNearPast(d,se));let tn=Math.max(I||le,le-1/10);const an=this.queryArc(tn,le).filter(sn=>sn.hasOnset());memory[l]=memory[l].concat(an),I=le,o(memory[l],se,le,this),animationFrames[l]=requestAnimationFrame(z)};return animationFrames[l]=requestAnimationFrame(z),this};const cleanupDraw=(o=!0,e)=>{const l=getDrawContext();o&&l.clearRect(0,0,l.canvas.width,l.canvas.height),stopAllAnimations(e)},cleanupDrawContext=o=>{const e=getDrawContext();e.clearRect(0,0,e.canvas.width,e.canvas.height),Object.keys(animationFrames).forEach(l=>(!o||l.startsWith(o))&&!l.startsWith("_")&&stopAnimationFrame(l))};Pattern$1.prototype.onPaint=function(o){return this.withState(e=>(e.controls.painters||(e.controls.painters=[]),e.controls.painters.push(o),e))},Pattern$1.prototype.getPainters=function(){let o=[];return this.queryArc(0,0,{painters:o}),o};class Framer{constructor(e,l){this.onFrame=e,this.onError=l}start(){const e=this;let l=requestAnimationFrame(function d(p){try{e.onFrame(p)}catch(b){e.onError(b)}l=requestAnimationFrame(d)});e.cancel=()=>{cancelAnimationFrame(l)}}stop(){this.cancel&&this.cancel()}}class Drawer{constructor(e,l){this.visibleHaps=[],this.lastFrame=null,this.drawTime=l,this.painters=[],this.framer=new Framer(()=>{if(!this.scheduler){console.warn("Drawer: no scheduler");return}const d=Math.abs(this.drawTime[0]),p=this.drawTime[1],b=this.scheduler.now()+p;if(this.lastFrame===null){this.lastFrame=b;return}const R=this.scheduler.pattern.queryArc(Math.max(this.lastFrame,b-1/10),b);this.lastFrame=b,this.visibleHaps=(this.visibleHaps||[]).filter(z=>z.whole&&z.endClipped>=b-d-p).concat(R.filter(z=>z.hasOnset()));const I=b-p;e(this.visibleHaps,I,this,this.painters)},d=>{console.warn("draw error",d)})}setDrawTime(e){this.drawTime=e}invalidate(e=this.scheduler,l){if(!e)return;l=l??e.now(),this.scheduler=e;let[d,p]=this.drawTime;const[b,R]=[Math.max(l,0),l+p+.1];this.visibleHaps=this.visibleHaps.filter(z=>z.whole?.begin<l),this.painters=[];const I=e.pattern.queryArc(b,R,{painters:this.painters});this.visibleHaps=this.visibleHaps.concat(I)}start(e){this.scheduler=e,this.invalidate(),this.framer.start()}stop(){this.framer&&this.framer.stop()}}function getComputedPropertyValue(o){return typeof window>"u"?"#fff":getComputedStyle(document.documentElement).getPropertyValue(o)}let theme$2={background:"#222",foreground:"#75baff",caret:"#ffcc00",selection:"rgba(128, 203, 196, 0.5)",selectionMatch:"#036dd626",lineHighlight:"#00000050",gutterBackground:"transparent",gutterForeground:"#8a919966"};function getTheme(){return theme$2}function setTheme(o){theme$2=o}let clearColor="#22222210";Pattern$1.prototype.animate=function({callback:o,sync:e=!1,smear:l=.5}={}){window.frame&&cancelAnimationFrame(window.frame);const d=getDrawContext();let{clientWidth:p,clientHeight:b}=d.canvas;p*=window.devicePixelRatio,b*=window.devicePixelRatio;let R=l===0?"99":Number((1-l)*100).toFixed(0);R=R.length===1?`0${R}`:R,clearColor=`#200010${R}`;const I=z=>{let se;z=Math.round(z),se=this.slow(1e3).queryArc(z,z),d.fillStyle=clearColor,d.fillRect(0,0,p,b),se.forEach(le=>{let{x:tn,y:an,w:sn,h:ln,s:un,r:pn,angle:yn=0,fill:_n="darkseagreen"}=le.value;if(sn*=p,ln*=b,pn!==void 0&&yn!==void 0){const vn=yn*2*Math.PI,[bn,Sn]=[(p-sn)/2,(b-ln)/2];tn=bn+Math.cos(vn)*pn*bn,an=Sn+Math.sin(vn)*pn*Sn}else tn*=p-sn,an*=b-ln;const Pn={...le.value,x:tn,y:an,w:sn,h:ln};d.fillStyle=_n,un==="rect"?d.fillRect(tn,an,sn,ln):un==="ellipse"&&(d.beginPath(),d.ellipse(tn+sn/2,an+ln/2,sn/2,ln/2,0,0,2*Math.PI),d.fill()),o&&o(d,Pn,le)}),window.frame=requestAnimationFrame(I)};return window.frame=requestAnimationFrame(I),silence};const{x:x$2,y:y$1,w:w$1,h:h$2,angle,r,fill,smear}=createParams("x","y","w","h","angle","r","fill","smear"),rescale=register("rescale",function(o,e){return e.mul(x$2(o).w(o).y(o).h(o))}),moveXY=register("moveXY",function(o,e,l){return l.add(x$2(o).y(e))}),zoomIn=register("zoomIn",function(o,e){const l=pure(1).sub(o).div(2);return e.rescale(o).move(l,l)}),colorMap={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function convertColorToNumber(o){return o=o.toLowerCase(),o[0]==="#"?convertHexToNumber(o):colorMap[o]!==void 0?convertHexToNumber(colorMap[o]):-1}function convertHexToNumber(o){return o=o.slice(1),parseInt(o,16)}const scale$2=(o,e,l)=>o*(l-e)+e,getValue=o=>{let{value:e}=o;typeof o.value!="object"&&(e={value:e});let{note:l,n:d,freq:p,s:b}=e;if(p)return freqToMidi$2(p);if(l=l??d,typeof l=="string")try{return noteToMidi$1(l)}catch{return 0}return typeof l=="number"?l:b?"_"+b:e};Pattern$1.prototype.pianoroll=function(o={}){let{cycles:e=4,playhead:l=.5,overscan:d=0,hideNegative:p=!1,ctx:b=getDrawContext(),id:R=1}=o,I=-e*l,z=e*(1-l);const se=(le,tn)=>(!p||le.whole.begin>=0)&&le.isWithinTime(tn+I,tn+z);return this.draw((le,tn)=>{__pianoroll({...o,time:tn,ctx:b,haps:le.filter(an=>se(an,tn))})},{lookbehind:I-d,lookahead:z+d,id:R}),this};function pianoroll(o){return isPattern(o)?o.pianoroll():e=>e.pianoroll(o)}function __pianoroll({time:o,haps:e,cycles:l=4,playhead:d=.5,flipTime:p=0,flipValues:b=0,hideNegative:R=!1,inactive:I=getTheme().foreground,active:z=getTheme().foreground,background:se="transparent",smear:le=0,playheadColor:tn=getTheme().foreground,minMidi:an=10,maxMidi:sn=90,autorange:ln=0,timeframe:un,fold:pn=1,vertical:yn=0,labels:_n=!1,fill:Pn=1,fillActive:vn=!1,strokeActive:bn=!0,stroke:Sn,hideInactive:An=0,colorizeInactive:Dn=1,fontFamily:Bn,ctx:Nn,id:Qn}={}){const Zn=Nn.canvas.width,Vn=Nn.canvas.height;let qn=-l*d,ia=l*(1-d);Qn&&(e=e.filter($a=>$a.hasTag(Qn))),un&&(console.warn("timeframe is deprecated! use from/to instead"),qn=0,ia=un);const ra=yn?Vn:Zn,aa=yn?Zn:Vn;let jn=yn?[ra,0]:[0,ra];const ka=ia-qn,Aa=yn?[0,aa]:[aa,0];let Na=sn-an+1,Kn=aa/Na,Ea=[];p&&jn.reverse(),b&&Aa.reverse();const{min:qa,max:va,values:Oa}=e.reduce(({min:$a,max:Ua,values:ss},ua)=>{const Jn=getValue(ua);return{min:Jn<$a?Jn:$a,max:Jn>Ua?Jn:Ua,values:ss.includes(Jn)?ss:[...ss,Jn]}},{min:1/0,max:-1/0,values:[]});ln&&(an=qa,sn=va,Na=sn-an+1),Ea=Oa.sort(($a,Ua)=>typeof $a=="number"&&typeof Ua=="number"?$a-Ua:typeof $a=="number"?1:String($a).localeCompare(String(Ua))),Kn=pn?aa/Ea.length:aa/Na,Nn.fillStyle=se,Nn.globalAlpha=1,le||(Nn.clearRect(0,0,Zn,Vn),Nn.fillRect(0,0,Zn,Vn)),e.forEach($a=>{const Ua=$a.whole.begin<=o&&$a.endClipped>o;let ss=Sn??(bn&&Ua),ua=!Ua&&Pn||Ua&&vn;if(An&&!Ua)return;let Jn=$a.value?.color;z=Jn||z,I=Dn&&Jn||I,Jn=Ua?z:I,Nn.fillStyle=ua?Jn:"transparent",Nn.strokeStyle=Jn;const{velocity:ga=1,gain:_i=1}=$a.value||{};Nn.globalAlpha=ga*_i;const Un=($a.whole.begin-(p?ia:qn))/ka,ha=scale$2(Un,...jn);let sa=scale$2($a.duration/ka,0,ra);const Ga=getValue($a),Ha=pn?Ea.indexOf(Ga)/Ea.length:(Number(Ga)-an)/Na,ls=scale$2(Ha,...Aa);let ns=0;const Ba=scale$2(o/ka,...jn);let rs;if(yn?rs=[ls+1-(b?Kn:0),ra-Ba+ha+ns+1-(p?0:sa),Kn-2,sa-2]:rs=[ha-Ba+ns+1-(p?sa:0),ls+1-(b?0:Kn),sa-2,Kn-2],ss&&Nn.strokeRect(...rs),ua&&Nn.fillRect(...rs),_n){const bs=$a.value.note??$a.value.s+($a.value.n?`:${$a.value.n}`:""),{label:Fa,activeLabel:Za}=$a.value,es=(Ua&&Za||Fa)??bs;let Ta=yn?sa:Kn*.75;Nn.font=`${Ta}px ${Bn||"monospace"}`,Nn.fillStyle=ua?"black":Jn,Nn.textBaseline="top",Nn.fillText(es,...rs)}}),Nn.globalAlpha=1;const Va=scale$2(-qn/ka,...jn);return Nn.strokeStyle=tn,Nn.beginPath(),yn?(Nn.moveTo(0,Va),Nn.lineTo(aa,Va)):(Nn.moveTo(Va,0),Nn.lineTo(Va,aa)),Nn.stroke(),this}function getDrawOptions(o,e={}){let[l,d]=o;l=Math.abs(l);const p=d+l,b=p!==0?l/p:0;return{fold:1,...e,cycles:p,playhead:b}}const getPunchcardPainter=(o={})=>(e,l,d,p)=>__pianoroll({ctx:e,time:l,haps:d,...getDrawOptions(p,o)});Pattern$1.prototype.punchcard=function(o){return this.onPaint(getPunchcardPainter(o))},Pattern$1.prototype.wordfall=function(o){return this.punchcard({vertical:1,labels:1,stroke:0,fillActive:1,active:"white",...o})};function drawPianoroll(o){const{drawTime:e,...l}=o;__pianoroll({...getDrawOptions(e),...l})}function fromPolar(o,e,l,d){const p=(o-90)*Math.PI/180;return[l+Math.cos(p)*e,d+Math.sin(p)*e]}const xyOnSpiral=(o,e,l,d,p=0)=>fromPolar((o+p)*360,e*o,l,d);function spiralSegment(o){let{ctx:e,from:l=0,to:d=3,margin:p=50,cx:b=100,cy:R=100,rotate:I=0,thickness:z=p/2,color:se=getTheme().foreground,cap:le="round",stretch:tn=1,fromOpacity:an=1,toOpacity:sn=1}=o;l*=tn,d*=tn,I*=tn,e.lineWidth=z,e.lineCap=le,e.strokeStyle=se,e.globalAlpha=an,e.beginPath();let[ln,un]=xyOnSpiral(l,p,b,R,I);e.moveTo(ln,un);const pn=1/60;let yn=l;for(;yn<=d;){const[_n,Pn]=xyOnSpiral(yn,p,b,R,I);e.globalAlpha=(yn-l)/(d-l)*sn,e.lineTo(_n,Pn),yn+=pn}e.stroke()}function drawSpiral(o){let{stretch:e=1,size:l=80,thickness:d=l/2,cap:p="butt",inset:b=3,playheadColor:R="#ffffff",playheadLength:I=.02,playheadThickness:z=d,padding:se=0,steady:le=1,activeColor:tn=getTheme().foreground,inactiveColor:an=getTheme().gutterForeground,colorizeInactive:sn=0,fade:ln=!0,ctx:un,time:pn,haps:yn,drawTime:_n,id:Pn}=o;Pn&&(yn=yn.filter(Zn=>Zn.hasTag(Pn)));const[vn,bn]=[un.canvas.width,un.canvas.height];un.clearRect(0,0,vn*2,bn*2);const[Sn,An]=[vn/2,bn/2],Dn={margin:l/e,cx:Sn,cy:An,stretch:e,cap:p,thickness:d},Bn={...Dn,thickness:z,from:b-I,to:b,color:R},[Nn]=_n,Qn=le*pn;yn.forEach(Zn=>{const Vn=Zn.whole.begin<=pn&&Zn.endClipped>pn,qn=Zn.whole.begin-pn+b,ia=Zn.endClipped-pn+b-se,ra=Zn.value?.color||tn,aa=sn||Vn?ra:an,jn=ln?1-Math.abs((Zn.whole.begin-pn)/Nn):1;spiralSegment({ctx:un,...Dn,from:qn,to:ia,rotate:Qn,color:aa,fromOpacity:jn,toOpacity:jn})}),spiralSegment({ctx:un,...Bn,rotate:Qn})}Pattern$1.prototype.spiral=function(o={}){return this.onPaint((e,l,d,p)=>drawSpiral({ctx:e,time:l,haps:d,drawTime:p,...o}))};const c$3=midiToFreq$2(36),circlePos=(o,e,l,d)=>{d=d*Math.PI*2;const p=Math.sin(d)*l+o,b=Math.cos(d)*l+e;return[p,b]},freq2angle=(o,e)=>.5-Math.log2(o/e)%1;function pitchwheel({haps:o,ctx:e,id:l,hapcircles:d=1,circle:p=0,edo:b=12,root:R=c$3,thickness:I=3,hapRadius:z=6,mode:se="flake",margin:le=10}={}){const tn=se==="polygon",an=se==="flake",sn=e.canvas.width,ln=e.canvas.height;e.clearRect(0,0,sn,ln);const un=getTheme().foreground,yn=Math.min(sn,ln)/2-I/2-z-le,_n=sn/2,Pn=ln/2;if(l&&(o=o.filter(bn=>bn.hasTag(l))),e.strokeStyle=un,e.fillStyle=un,e.globalAlpha=1,e.lineWidth=I,p&&(e.beginPath(),e.arc(_n,Pn,yn,0,2*Math.PI),e.stroke()),b){b=o.length>=1&&o[0].value&&o[0].value.edo?o[0].value.edo:b,R=o.length>=1&&o[0].value&&o[0].value.root?o[0].value.root:R;const bn=o.length>=1&&o[0].value&&o[0].value.degreeIndexes?o[0].value.degreeIndexes:null,Sn=o.length>=1&&o[0].value&&o[0].value.intLabels?o[0].value.intLabels:null;e.font="20px sans-serif";const An=`${b} EDO`;e.fillText(An,_n+yn-e.measureText(An).width+15,Pn+yn),Array.from({length:b},(Dn,Bn)=>{const Nn=freq2angle(R*Math.pow(2,Bn/b),R),[Qn,Zn]=circlePos(_n,Pn,yn,Nn);if(e.beginPath(),bn===null||bn.includes(Bn)){if(e.globalAlpha=1,e.arc(Qn,Zn,z,0,2*Math.PI),Sn!==null){const Vn=bn.indexOf(Bn);Sn[Vn]&&(Nn<.32&&Nn>.125?e.fillText(Sn[Vn],Qn-34,Zn):Nn<.1&&Nn>-1.125?e.fillText(Sn[Vn],Qn-7,Zn-12):e.fillText(Sn[Vn],Qn+9,Zn))}}else e.globalAlpha=.15,e.arc(Qn,Zn,z,0,2*Math.PI);e.fill()}),e.stroke()}let vn=[];e.lineWidth=z,o.forEach(bn=>{let Sn;try{Sn=getFrequency(bn)}catch{return}const An=freq2angle(Sn,R),[Dn,Bn]=circlePos(_n,Pn,yn,An),Nn=bn.value.color||un;e.strokeStyle=Nn,e.fillStyle=Nn;const{velocity:Qn=1,gain:Zn=1}=bn.value||{},Vn=Qn*Zn;e.globalAlpha=Vn,vn.push([Dn,Bn,An,Nn,Vn]),e.beginPath(),d&&(e.moveTo(Dn+z,Bn),e.arc(Dn,Bn,z,0,2*Math.PI),e.fill()),an&&(e.moveTo(_n,Pn),e.lineTo(Dn,Bn)),e.stroke()}),e.strokeStyle=un,e.globalAlpha=1,tn&&vn.length&&(vn=vn.sort((bn,Sn)=>bn[2]-Sn[2]),e.beginPath(),e.moveTo(vn[0][0],vn[0][1]),vn.forEach(([bn,Sn,An,Dn,Bn])=>{e.strokeStyle=Dn,e.globalAlpha=Bn,e.lineTo(bn,Sn)}),e.lineTo(vn[0][0],vn[0][1]),e.stroke())}Pattern$1.prototype.pitchwheel=function(o={}){let{ctx:e=getDrawContext(),id:l=1}=o;return this.tag(l).onPaint((d,p,b)=>pitchwheel({...o,time:p,ctx:e,haps:b.filter(R=>R.isActive(p)),id:l}))};const index$d=Object.freeze(Object.defineProperty({__proto__:null,Drawer,Framer,__pianoroll,angle,cleanupDraw,cleanupDrawContext,colorMap,convertColorToNumber,convertHexToNumber,drawPianoroll,fill,getComputedPropertyValue,getDrawContext,getDrawOptions,getPunchcardPainter,getTheme,h:h$2,moveXY,pianoroll,pitchwheel,r,rescale,setTheme,smear,w:w$1,x:x$2,y:y$1,zoomIn},Symbol.toStringTag,{value:"Module"}));function peg$subclass(o,e){function l(){this.constructor=o}l.prototype=e.prototype,o.prototype=new l}function peg$SyntaxError(o,e,l,d){var p=Error.call(this,o);return Object.setPrototypeOf&&Object.setPrototypeOf(p,peg$SyntaxError.prototype),p.expected=e,p.found=l,p.location=d,p.name="SyntaxError",p}peg$subclass(peg$SyntaxError,Error);function peg$padEnd(o,e,l){return l=l||" ",o.length>e?o:(e-=o.length,l+=l.repeat(e),o+l.slice(0,e))}peg$SyntaxError.prototype.format=function(o){var e="Error: "+this.message;if(this.location){var l=null,d;for(d=0;d<o.length;d++)if(o[d].source===this.location.source){l=o[d].text.split(/\r\n|\n|\r/g);break}var p=this.location.start,b=this.location.source&&typeof this.location.source.offset=="function"?this.location.source.offset(p):p,R=this.location.source+":"+b.line+":"+b.column;if(l){var I=this.location.end,z=peg$padEnd("",b.line.toString().length," "),se=l[p.line-1],le=p.line===I.line?I.column:se.length+1,tn=le-p.column||1;e+=`
|
||
--> `+R+`
|
||
`+z+` |
|
||
`+b.line+" | "+se+`
|
||
`+z+" | "+peg$padEnd("",p.column-1," ")+peg$padEnd("",tn,"^")}else e+=`
|
||
at `+R}return e},peg$SyntaxError.buildMessage=function(o,e){var l={literal:function(se){return'"'+p(se.text)+'"'},class:function(se){var le=se.parts.map(function(tn){return Array.isArray(tn)?b(tn[0])+"-"+b(tn[1]):b(tn)});return"["+(se.inverted?"^":"")+le.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(se){return se.description}};function d(se){return se.charCodeAt(0).toString(16).toUpperCase()}function p(se){return se.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(le){return"\\x0"+d(le)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(le){return"\\x"+d(le)})}function b(se){return se.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(le){return"\\x0"+d(le)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(le){return"\\x"+d(le)})}function R(se){return l[se.type](se)}function I(se){var le=se.map(R),tn,an;if(le.sort(),le.length>0){for(tn=1,an=1;tn<le.length;tn++)le[tn-1]!==le[tn]&&(le[an]=le[tn],an++);le.length=an}switch(le.length){case 1:return le[0];case 2:return le[0]+" or "+le[1];default:return le.slice(0,-1).join(", ")+", or "+le[le.length-1]}}function z(se){return se?'"'+p(se)+'"':"end of input"}return"Expected "+I(o)+" but "+z(e)+" found."};function peg$parse(o,e){e=e!==void 0?e:{};var l={},d=e.grammarSource,p={start:br},b=br,R=".",I="-",z="0",se=",",le="|",tn="[",an="]",sn="{",ln="}",un="%",pn="<",yn=">",_n="!",Pn="(",vn=")",bn="/",Sn="*",An="?",Dn=":",Bn="..",Nn="^",Qn="struct",Zn="target",Vn="euclid",qn="slow",ia="rotL",ra="rotR",aa="fast",jn="scale",ka="//",Aa="cat",Na="$",Kn="setcps",Ea="setbpm",qa="hush",va=/^[1-9]/,Oa=/^[eE]/,Va=/^[+\-]/,$a=/^[0-9]/,Ua=/^[ \n\r\t\xA0]/,ss=/^["']/,ua=/^[#\--.0-9A-Z\^-_a-z~\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376-\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E-\u066F\u0671-\u06D3\u06D5\u06E5-\u06E6\u06EE-\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4-\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1\u09FC\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0-\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B35-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60-\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0-\u0CE1\u0CF1-\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32-\u0E33\u0E40-\u0E46\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065-\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE-\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5-\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7B9\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD-\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5-\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,Jn=/^[@_]/,ga=/^[^\n]/,_i=zs("number"),Un=Da(".",!1),ha=ws([["1","9"]],!1,!1),sa=ws(["e","E"],!1,!1),Ga=ws(["+","-"],!1,!1),Ha=Da("-",!1),ls=Da("0",!1),ns=ws([["0","9"]],!1,!1),Ba=zs("whitespace"),rs=ws([" ",`
|
||
`,"\r"," "," "],!1,!1),bs=Da(",",!1),Fa=Da("|",!1),Za=ws(['"',"'"],!1,!1),ca=zs('a letter, a number, "-", "#", ".", "^", "_"'),es=ws(["#",["-","."],["0","9"],["A","Z"],["^","_"],["a","z"],"~","ª","µ","º",["À","Ö"],["Ø","ö"],["ø","ˁ"],["ˆ","ˑ"],["ˠ","ˤ"],"ˬ","ˮ",["Ͱ","ʹ"],["Ͷ","ͷ"],["ͺ","ͽ"],"Ϳ","Ά",["Έ","Ί"],"Ό",["Ύ","Ρ"],["Σ","ϵ"],["Ϸ","ҁ"],["Ҋ","ԯ"],["Ա","Ֆ"],"ՙ",["ՠ","ֈ"],["א","ת"],["ׯ","ײ"],["ؠ","ي"],["ٮ","ٯ"],["ٱ","ۓ"],"ە",["ۥ","ۦ"],["ۮ","ۯ"],["ۺ","ۼ"],"ۿ","ܐ",["ܒ","ܯ"],["ݍ","ޥ"],"ޱ",["ߊ","ߪ"],["ߴ","ߵ"],"ߺ",["ࠀ","ࠕ"],"ࠚ","ࠤ","ࠨ",["ࡀ","ࡘ"],["ࡠ","ࡪ"],["ࢠ","ࢴ"],["ࢶ","ࢽ"],["ऄ","ह"],"ऽ","ॐ",["क़","ॡ"],["ॱ","ঀ"],["অ","ঌ"],["এ","ঐ"],["ও","ন"],["প","র"],"ল",["শ","হ"],"ঽ","ৎ",["ড়","ঢ়"],["য়","ৡ"],["ৰ","ৱ"],"ৼ",["ਅ","ਊ"],["ਏ","ਐ"],["ਓ","ਨ"],["ਪ","ਰ"],["ਲ","ਲ਼"],["ਵ","ਸ਼"],["ਸ","ਹ"],["ਖ਼","ੜ"],"ਫ਼",["ੲ","ੴ"],["અ","ઍ"],["એ","ઑ"],["ઓ","ન"],["પ","ર"],["લ","ળ"],["વ","હ"],"ઽ","ૐ",["ૠ","ૡ"],"ૹ",["ଅ","ଌ"],["ଏ","ଐ"],["ଓ","ନ"],["ପ","ର"],["ଲ","ଳ"],["ଵ","ହ"],"ଽ",["ଡ଼","ଢ଼"],["ୟ","ୡ"],"ୱ","ஃ",["அ","ஊ"],["எ","ஐ"],["ஒ","க"],["ங","ச"],"ஜ",["ஞ","ட"],["ண","த"],["ந","ப"],["ம","ஹ"],"ௐ",["అ","ఌ"],["ఎ","ఐ"],["ఒ","న"],["ప","హ"],"ఽ",["ౘ","ౚ"],["ౠ","ౡ"],"ಀ",["ಅ","ಌ"],["ಎ","ಐ"],["ಒ","ನ"],["ಪ","ಳ"],["ವ","ಹ"],"ಽ","ೞ",["ೠ","ೡ"],["ೱ","ೲ"],["അ","ഌ"],["എ","ഐ"],["ഒ","ഺ"],"ഽ","ൎ",["ൔ","ൖ"],["ൟ","ൡ"],["ൺ","ൿ"],["අ","ඖ"],["ක","න"],["ඳ","ර"],"ල",["ව","ෆ"],["ก","ะ"],["า","ำ"],["เ","ๆ"],["ກ","ຂ"],"ຄ",["ງ","ຈ"],"ຊ","ຍ",["ດ","ທ"],["ນ","ຟ"],["ມ","ຣ"],"ລ","ວ",["ສ","ຫ"],["ອ","ະ"],["າ","ຳ"],"ຽ",["ເ","ໄ"],"ໆ",["ໜ","ໟ"],"ༀ",["ཀ","ཇ"],["ཉ","ཬ"],["ྈ","ྌ"],["က","ဪ"],"ဿ",["ၐ","ၕ"],["ၚ","ၝ"],"ၡ",["ၥ","ၦ"],["ၮ","ၰ"],["ၵ","ႁ"],"ႎ",["Ⴀ","Ⴥ"],"Ⴧ","Ⴭ",["ა","ჺ"],["ჼ","ቈ"],["ቊ","ቍ"],["ቐ","ቖ"],"ቘ",["ቚ","ቝ"],["በ","ኈ"],["ኊ","ኍ"],["ነ","ኰ"],["ኲ","ኵ"],["ኸ","ኾ"],"ዀ",["ዂ","ዅ"],["ወ","ዖ"],["ዘ","ጐ"],["ጒ","ጕ"],["ጘ","ፚ"],["ᎀ","ᎏ"],["Ꭰ","Ᏽ"],["ᏸ","ᏽ"],["ᐁ","ᙬ"],["ᙯ","ᙿ"],["ᚁ","ᚚ"],["ᚠ","ᛪ"],["ᛮ","ᛸ"],["ᜀ","ᜌ"],["ᜎ","ᜑ"],["ᜠ","ᜱ"],["ᝀ","ᝑ"],["ᝠ","ᝬ"],["ᝮ","ᝰ"],["ក","ឳ"],"ៗ","ៜ",["ᠠ","ᡸ"],["ᢀ","ᢄ"],["ᢇ","ᢨ"],"ᢪ",["ᢰ","ᣵ"],["ᤀ","ᤞ"],["ᥐ","ᥭ"],["ᥰ","ᥴ"],["ᦀ","ᦫ"],["ᦰ","ᧉ"],["ᨀ","ᨖ"],["ᨠ","ᩔ"],"ᪧ",["ᬅ","ᬳ"],["ᭅ","ᭋ"],["ᮃ","ᮠ"],["ᮮ","ᮯ"],["ᮺ","ᯥ"],["ᰀ","ᰣ"],["ᱍ","ᱏ"],["ᱚ","ᱽ"],["ᲀ","ᲈ"],["Ა","Ჺ"],["Ჽ","Ჿ"],["ᳩ","ᳬ"],["ᳮ","ᳱ"],["ᳵ","ᳶ"],["ᴀ","ᶿ"],["Ḁ","ἕ"],["Ἐ","Ἕ"],["ἠ","ὅ"],["Ὀ","Ὅ"],["ὐ","ὗ"],"Ὑ","Ὓ","Ὕ",["Ὗ","ώ"],["ᾀ","ᾴ"],["ᾶ","ᾼ"],"ι",["ῂ","ῄ"],["ῆ","ῌ"],["ῐ","ΐ"],["ῖ","Ί"],["ῠ","Ῥ"],["ῲ","ῴ"],["ῶ","ῼ"],"ⁱ","ⁿ",["ₐ","ₜ"],"ℂ","ℇ",["ℊ","ℓ"],"ℕ",["ℙ","ℝ"],"ℤ","Ω","ℨ",["K","ℭ"],["ℯ","ℹ"],["ℼ","ℿ"],["ⅅ","ⅉ"],"ⅎ",["Ⅰ","ↈ"],["Ⰰ","Ⱞ"],["ⰰ","ⱞ"],["Ⱡ","ⳤ"],["Ⳬ","ⳮ"],["Ⳳ","ⳳ"],["ⴀ","ⴥ"],"ⴧ","ⴭ",["ⴰ","ⵧ"],"ⵯ",["ⶀ","ⶖ"],["ⶠ","ⶦ"],["ⶨ","ⶮ"],["ⶰ","ⶶ"],["ⶸ","ⶾ"],["ⷀ","ⷆ"],["ⷈ","ⷎ"],["ⷐ","ⷖ"],["ⷘ","ⷞ"],"ⸯ",["々","〇"],["〡","〩"],["〱","〵"],["〸","〼"],["ぁ","ゖ"],["ゝ","ゟ"],["ァ","ヺ"],["ー","ヿ"],["ㄅ","ㄯ"],["ㄱ","ㆎ"],["ㆠ","ㆺ"],["ㇰ","ㇿ"],["㐀","䶵"],["一","鿯"],["ꀀ","ꒌ"],["ꓐ","ꓽ"],["ꔀ","ꘌ"],["ꘐ","ꘟ"],["ꘪ","ꘫ"],["Ꙁ","ꙮ"],["ꙿ","ꚝ"],["ꚠ","ꛯ"],["ꜗ","ꜟ"],["Ꜣ","ꞈ"],["Ꞌ","ꞹ"],["ꟷ","ꠁ"],["ꠃ","ꠅ"],["ꠇ","ꠊ"],["ꠌ","ꠢ"],["ꡀ","ꡳ"],["ꢂ","ꢳ"],["ꣲ","ꣷ"],"ꣻ",["ꣽ","ꣾ"],["ꤊ","ꤥ"],["ꤰ","ꥆ"],["ꥠ","ꥼ"],["ꦄ","ꦲ"],"ꧏ",["ꧠ","ꧤ"],["ꧦ","ꧯ"],["ꧺ","ꧾ"],["ꨀ","ꨨ"],["ꩀ","ꩂ"],["ꩄ","ꩋ"],["ꩠ","ꩶ"],"ꩺ",["ꩾ","ꪯ"],"ꪱ",["ꪵ","ꪶ"],["ꪹ","ꪽ"],"ꫀ","ꫂ",["ꫛ","ꫝ"],["ꫠ","ꫪ"],["ꫲ","ꫴ"],["ꬁ","ꬆ"],["ꬉ","ꬎ"],["ꬑ","ꬖ"],["ꬠ","ꬦ"],["ꬨ","ꬮ"],["ꬰ","ꭚ"],["ꭜ","ꭥ"],["ꭰ","ꯢ"],["가","힣"],["ힰ","ퟆ"],["ퟋ","ퟻ"],["豈","舘"],["並","龎"],["ff","st"],["ﬓ","ﬗ"],"יִ",["ײַ","ﬨ"],["שׁ","זּ"],["טּ","לּ"],"מּ",["נּ","סּ"],["ףּ","פּ"],["צּ","ﮱ"],["ﯓ","ﴽ"],["ﵐ","ﶏ"],["ﶒ","ﷇ"],["ﷰ","ﷻ"],["ﹰ","ﹴ"],["ﹶ","ﻼ"],["A","Z"],["a","z"],["ヲ","ᄒ"],["ᅡ","ᅦ"],["ᅧ","ᅬ"],["ᅭ","ᅲ"],["ᅳ","ᅵ"]],!1,!1),Ta=Da("[",!1),Os=Da("]",!1),Ka=Da("{",!1),cs=Da("}",!1),As=Da("%",!1),ya=Da("<",!1),xa=Da(">",!1),wa=ws(["@","_"],!1,!1),Ia=Da("!",!1),da=Da("(",!1),Ca=Da(")",!1),is=Da("/",!1),hs=Da("*",!1),os=Da("?",!1),Ls=Da(":",!1),Vs=Da("..",!1),hn=Da("^",!1),xn=Da("struct",!1),kn=Da("target",!1),wn=Da("euclid",!1),Gn=Da("slow",!1),zn=Da("rotL",!1),Yn=Da("rotR",!1),ta=Da("fast",!1),la=Da("scale",!1),Xa=Da("//",!1),za=ws([`
|
||
`],!0,!1),Cs=Da("cat",!1),Es=Da("$",!1),gs=Da("setcps",!1),Ds=Da("setbpm",!1),_s=Da("hush",!1),Ys=function(){return parseFloat(fs())},qs=function(mn){const Mn=mn.join("");return Mn==="."||Mn==="_"},Sr=function(mn){return new po(mn.join(""))},Ks=function(mn){return mn},Cr=function(mn,Mn){return mn.arguments_.stepsPerCycle=Mn,mn},Js=function(mn){return mn},Pr=function(mn){return mn.arguments_.alignment="polymeter_slowcat",mn},er=function(mn){return Mn=>Mn.options_.weight=(Mn.options_.weight??1)+(mn??2)-1},Ws=function(mn){return Mn=>{const Tn=(Mn.options_.reps??1)+(mn??2)-1;Mn.options_.reps=Tn,Mn.options_.ops=Mn.options_.ops.filter(Hn=>Hn.type_!=="replicate"),Mn.options_.ops.push({type_:"replicate",arguments_:{amount:Tn}}),Mn.options_.weight=Tn}},Mr=function(mn,Mn,Tn){return Hn=>Hn.options_.ops.push({type_:"bjorklund",arguments_:{pulse:mn,step:Mn,rotation:Tn}})},Ps=function(mn){return Mn=>Mn.options_.ops.push({type_:"stretch",arguments_:{amount:mn,type:"slow"}})},Ar=function(mn){return Mn=>Mn.options_.ops.push({type_:"stretch",arguments_:{amount:mn,type:"fast"}})},nr=function(mn){return Mn=>Mn.options_.ops.push({type_:"degradeBy",arguments_:{amount:mn,seed:jr++}})},sr=function(mn){return Mn=>Mn.options_.ops.push({type_:"tail",arguments_:{element:mn}})},Er=function(mn){return Mn=>Mn.options_.ops.push({type_:"range",arguments_:{element:mn}})},rr=function(mn,Mn){const Tn=new mo(mn,{ops:[],weight:1,reps:1});for(const Hn of Mn)Hn(Tn);return Tn},Gr=function(mn,Mn){return new Or(Mn,"fastcat",void 0,!!mn)},Fr=function(mn){return{alignment:"stack",list:mn}},vs=function(mn){return{alignment:"rand",list:mn,seed:jr++}},Dr=function(mn){return{alignment:"feet",list:mn,seed:jr++}},Tr=function(mn,Mn){return Mn&&Mn.list.length>0?new Or([mn,...Mn.list],Mn.alignment,Mn.seed):mn},lr=function(mn,Mn){return new Or(Mn?[mn,...Mn.list]:[mn],"polymeter")},cr=function(mn){return mn},Lr=function(mn){return{name:"struct",args:{mini:mn}}},ur=function(mn){return{name:"target",args:{name:mn}}},Rr=function(mn,Mn,Tn){return{name:"bjorklund",args:{pulse:mn,step:parseInt(Mn)}}},dr=function(mn){return{name:"stretch",args:{amount:mn}}},Nr=function(mn){return{name:"shift",args:{amount:"-"+mn}}},hr=function(mn){return{name:"shift",args:{amount:mn}}},xs=function(mn){return{name:"stretch",args:{amount:"1/"+mn}}},Qa=function(mn){return{name:"scale",args:{scale:mn.join("")}}},mr=function(mn,Mn){return Mn},Zs=function(mn,Mn){return Mn.unshift(mn),new Or(Mn,"slowcat")},$r=function(mn){return mn},Rs=function(mn,Mn){return new ho(mn.name,mn.args,Mn)},Br=function(mn){return mn},Ns=function(mn){return mn},Qs=function(mn){return new zr("setcps",{value:mn})},fr=function(mn){return new zr("setcps",{value:mn/120/2})},Zr=function(){return new zr("hush")},Fn=e.peg$currPos|0,Ma=Fn,Gs=[{line:1,column:1}],ms=Fn,$s=e.peg$maxFailExpected||[],pa=e.peg$silentFails|0,Ts;if(e.startRule){if(!(e.startRule in p))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');b=p[e.startRule]}function fs(){return o.substring(Ma,Fn)}function gr(){return js(Ma,Fn)}function Da(mn,Mn){return{type:"literal",text:mn,ignoreCase:Mn}}function ws(mn,Mn,Tn){return{type:"class",parts:mn,inverted:Mn,ignoreCase:Tn}}function Ir(){return{type:"end"}}function zs(mn){return{type:"other",description:mn}}function yr(mn){var Mn=Gs[mn],Tn;if(Mn)return Mn;if(mn>=Gs.length)Tn=Gs.length-1;else for(Tn=mn;!Gs[--Tn];);for(Mn=Gs[Tn],Mn={line:Mn.line,column:Mn.column};Tn<mn;)o.charCodeAt(Tn)===10?(Mn.line++,Mn.column=1):Mn.column++,Tn++;return Gs[mn]=Mn,Mn}function js(mn,Mn,Tn){var Hn=yr(mn),fa=yr(Mn),ts={source:d,start:{offset:mn,line:Hn.line,column:Hn.column},end:{offset:Mn,line:fa.line,column:fa.column}};return ts}function ba(mn){Fn<ms||(Fn>ms&&(ms=Fn,$s=[]),$s.push(mn))}function Xr(mn,Mn,Tn){return new peg$SyntaxError(peg$SyntaxError.buildMessage(mn,Mn),mn,Mn,Tn)}function br(){var mn;return mn=uo(),mn}function Ss(){var mn,Mn;return pa++,mn=Fn,Us(),Mn=Bs(),Mn!==l?(wr(),xr(),Ma=mn,mn=Ys()):(Fn=mn,mn=l),pa--,mn===l&&pa===0&&ba(_i),mn}function _r(){var mn;return o.charCodeAt(Fn)===46?(mn=R,Fn++):(mn=l,pa===0&&ba(Un)),mn}function kr(){var mn;return mn=o.charAt(Fn),va.test(mn)?Fn++:(mn=l,pa===0&&ba(ha)),mn}function vr(){var mn;return mn=o.charAt(Fn),Oa.test(mn)?Fn++:(mn=l,pa===0&&ba(sa)),mn}function xr(){var mn,Mn,Tn,Hn,fa;if(mn=Fn,Mn=vr(),Mn!==l){if(Tn=o.charAt(Fn),Va.test(Tn)?Fn++:(Tn=l,pa===0&&ba(Ga)),Tn===l&&(Tn=null),Hn=[],fa=nn(),fa!==l)for(;fa!==l;)Hn.push(fa),fa=nn();else Hn=l;Hn!==l?(Mn=[Mn,Tn,Hn],mn=Mn):(Fn=mn,mn=l)}else Fn=mn,mn=l;return mn}function wr(){var mn,Mn,Tn,Hn;if(mn=Fn,Mn=_r(),Mn!==l){if(Tn=[],Hn=nn(),Hn!==l)for(;Hn!==l;)Tn.push(Hn),Hn=nn();else Tn=l;Tn!==l?(Mn=[Mn,Tn],mn=Mn):(Fn=mn,mn=l)}else Fn=mn,mn=l;return mn}function Bs(){var mn,Mn,Tn,Hn;if(mn=Vr(),mn===l)if(mn=Fn,Mn=kr(),Mn!==l){for(Tn=[],Hn=nn();Hn!==l;)Tn.push(Hn),Hn=nn();Mn=[Mn,Tn],mn=Mn}else Fn=mn,mn=l;return mn}function Us(){var mn;return o.charCodeAt(Fn)===45?(mn=I,Fn++):(mn=l,pa===0&&ba(Ha)),mn}function Vr(){var mn;return o.charCodeAt(Fn)===48?(mn=z,Fn++):(mn=l,pa===0&&ba(ls)),mn}function nn(){var mn;return mn=o.charAt(Fn),$a.test(mn)?Fn++:(mn=l,pa===0&&ba(ns)),mn}function rn(){var mn,Mn;for(pa++,mn=[],Mn=o.charAt(Fn),Ua.test(Mn)?Fn++:(Mn=l,pa===0&&ba(rs));Mn!==l;)mn.push(Mn),Mn=o.charAt(Fn),Ua.test(Mn)?Fn++:(Mn=l,pa===0&&ba(rs));return pa--,Mn=l,pa===0&&ba(Ba),mn}function cn(){var mn,Mn,Tn,Hn;return mn=Fn,Mn=rn(),o.charCodeAt(Fn)===44?(Tn=se,Fn++):(Tn=l,pa===0&&ba(bs)),Tn!==l?(Hn=rn(),Mn=[Mn,Tn,Hn],mn=Mn):(Fn=mn,mn=l),mn}function dn(){var mn,Mn,Tn,Hn;return mn=Fn,Mn=rn(),o.charCodeAt(Fn)===124?(Tn=le,Fn++):(Tn=l,pa===0&&ba(Fa)),Tn!==l?(Hn=rn(),Mn=[Mn,Tn,Hn],mn=Mn):(Fn=mn,mn=l),mn}function fn(){var mn,Mn,Tn,Hn;return mn=Fn,Mn=rn(),o.charCodeAt(Fn)===46?(Tn=R,Fn++):(Tn=l,pa===0&&ba(Un)),Tn!==l?(Hn=rn(),Mn=[Mn,Tn,Hn],mn=Mn):(Fn=mn,mn=l),mn}function gn(){var mn;return mn=o.charAt(Fn),ss.test(mn)?Fn++:(mn=l,pa===0&&ba(Za)),mn}function On(){var mn;return pa++,mn=o.charAt(Fn),ua.test(mn)?Fn++:(mn=l,pa===0&&ba(es)),pa--,mn===l&&pa===0&&ba(ca),mn}function Cn(){var mn,Mn,Tn,Hn;if(mn=Fn,rn(),Mn=[],Tn=On(),Tn!==l)for(;Tn!==l;)Mn.push(Tn),Tn=On();else Mn=l;return Mn!==l?(Tn=rn(),Ma=Fn,Hn=qs(Mn),Hn?Hn=l:Hn=void 0,Hn!==l?(Ma=mn,mn=Sr(Mn)):(Fn=mn,mn=l)):(Fn=mn,mn=l),mn}function En(){var mn,Mn,Tn,Hn;return mn=Fn,rn(),o.charCodeAt(Fn)===91?(Mn=tn,Fn++):(Mn=l,pa===0&&ba(Ta)),Mn!==l?(rn(),Tn=ys(),Tn!==l?(rn(),o.charCodeAt(Fn)===93?(Hn=an,Fn++):(Hn=l,pa===0&&ba(Os)),Hn!==l?(rn(),Ma=mn,mn=Ks(Tn)):(Fn=mn,mn=l)):(Fn=mn,mn=l)):(Fn=mn,mn=l),mn}function Rn(){var mn,Mn,Tn,Hn,fa;return mn=Fn,rn(),o.charCodeAt(Fn)===123?(Mn=sn,Fn++):(Mn=l,pa===0&&ba(Ka)),Mn!==l?(rn(),Tn=us(),Tn!==l?(rn(),o.charCodeAt(Fn)===125?(Hn=ln,Fn++):(Hn=l,pa===0&&ba(cs)),Hn!==l?(fa=Ln(),fa===l&&(fa=null),rn(),Ma=mn,mn=Cr(Tn,fa)):(Fn=mn,mn=l)):(Fn=mn,mn=l)):(Fn=mn,mn=l),mn}function Ln(){var mn,Mn,Tn;return mn=Fn,o.charCodeAt(Fn)===37?(Mn=un,Fn++):(Mn=l,pa===0&&ba(As)),Mn!==l?(Tn=In(),Tn!==l?(Ma=mn,mn=Js(Tn)):(Fn=mn,mn=l)):(Fn=mn,mn=l),mn}function Xn(){var mn,Mn,Tn,Hn;return mn=Fn,rn(),o.charCodeAt(Fn)===60?(Mn=pn,Fn++):(Mn=l,pa===0&&ba(ya)),Mn!==l?(rn(),Tn=us(),Tn!==l?(rn(),o.charCodeAt(Fn)===62?(Hn=yn,Fn++):(Hn=l,pa===0&&ba(xa)),Hn!==l?(rn(),Ma=mn,mn=Pr(Tn)):(Fn=mn,mn=l)):(Fn=mn,mn=l)):(Fn=mn,mn=l),mn}function In(){var mn;return mn=Cn(),mn===l&&(mn=En(),mn===l&&(mn=Rn(),mn===l&&(mn=Xn()))),mn}function Wn(){var mn;return mn=$n(),mn===l&&(mn=na(),mn===l&&(mn=ma(),mn===l&&(mn=oa(),mn===l&&(mn=ea(),mn===l&&(mn=Pa(),mn===l&&(mn=Ra(),mn===l&&(mn=La()))))))),mn}function $n(){var mn,Mn,Tn;return mn=Fn,rn(),Mn=o.charAt(Fn),Jn.test(Mn)?Fn++:(Mn=l,pa===0&&ba(wa)),Mn!==l?(Tn=Ss(),Tn===l&&(Tn=null),Ma=mn,mn=er(Tn)):(Fn=mn,mn=l),mn}function ea(){var mn,Mn,Tn;return mn=Fn,rn(),o.charCodeAt(Fn)===33?(Mn=_n,Fn++):(Mn=l,pa===0&&ba(Ia)),Mn!==l?(Tn=Ss(),Tn===l&&(Tn=null),Ma=mn,mn=Ws(Tn)):(Fn=mn,mn=l),mn}function na(){var mn,Mn,Tn,Hn,fa,ts,Ms;return mn=Fn,o.charCodeAt(Fn)===40?(Mn=Pn,Fn++):(Mn=l,pa===0&&ba(da)),Mn!==l?(rn(),Tn=Ya(),Tn!==l?(rn(),Hn=cn(),Hn!==l?(rn(),fa=Ya(),fa!==l?(rn(),cn(),rn(),ts=Ya(),ts===l&&(ts=null),rn(),o.charCodeAt(Fn)===41?(Ms=vn,Fn++):(Ms=l,pa===0&&ba(Ca)),Ms!==l?(Ma=mn,mn=Mr(Tn,fa,ts)):(Fn=mn,mn=l)):(Fn=mn,mn=l)):(Fn=mn,mn=l)):(Fn=mn,mn=l)):(Fn=mn,mn=l),mn}function ma(){var mn,Mn,Tn;return mn=Fn,o.charCodeAt(Fn)===47?(Mn=bn,Fn++):(Mn=l,pa===0&&ba(is)),Mn!==l?(Tn=In(),Tn!==l?(Ma=mn,mn=Ps(Tn)):(Fn=mn,mn=l)):(Fn=mn,mn=l),mn}function oa(){var mn,Mn,Tn;return mn=Fn,o.charCodeAt(Fn)===42?(Mn=Sn,Fn++):(Mn=l,pa===0&&ba(hs)),Mn!==l?(Tn=In(),Tn!==l?(Ma=mn,mn=Ar(Tn)):(Fn=mn,mn=l)):(Fn=mn,mn=l),mn}function Pa(){var mn,Mn,Tn;return mn=Fn,o.charCodeAt(Fn)===63?(Mn=An,Fn++):(Mn=l,pa===0&&ba(os)),Mn!==l?(Tn=Ss(),Tn===l&&(Tn=null),Ma=mn,mn=nr(Tn)):(Fn=mn,mn=l),mn}function Ra(){var mn,Mn,Tn;return mn=Fn,o.charCodeAt(Fn)===58?(Mn=Dn,Fn++):(Mn=l,pa===0&&ba(Ls)),Mn!==l?(Tn=In(),Tn!==l?(Ma=mn,mn=sr(Tn)):(Fn=mn,mn=l)):(Fn=mn,mn=l),mn}function La(){var mn,Mn,Tn;return mn=Fn,o.substr(Fn,2)===Bn?(Mn=Bn,Fn+=2):(Mn=l,pa===0&&ba(Vs)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l)):(Fn=Tn,Tn=l),Tn!==l)for(;Tn!==l;)Mn.push(Tn),Tn=Fn,Hn=fn(),Hn!==l?(fa=ja(),fa!==l?Tn=fa:(Fn=Tn,Tn=l)):(Fn=Tn,Tn=l);else Mn=l;return Mn!==l&&(Ma=mn,Mn=Dr(Mn)),mn=Mn,mn}function ys(){var mn,Mn,Tn;return mn=Fn,Mn=ja(),Mn!==l?(Tn=Wa(),Tn===l&&(Tn=Sa(),Tn===l&&(Tn=Ja())),Tn===l&&(Tn=null),Ma=mn,mn=Tr(Mn,Tn)):(Fn=mn,mn=l),mn}function us(){var mn,Mn,Tn;return mn=Fn,Mn=ja(),Mn!==l?(Tn=Wa(),Tn===l&&(Tn=null),Ma=mn,mn=lr(Mn,Tn)):(Fn=mn,mn=l),mn}function ks(){var mn,Mn,Tn,Hn;return mn=Fn,rn(),Mn=gn(),Mn!==l?(rn(),Tn=ys(),Tn!==l?(rn(),Hn=gn(),Hn!==l?(Ma=mn,mn=cr(Tn)):(Fn=mn,mn=l)):(Fn=mn,mn=l)):(Fn=mn,mn=l),mn}function Fs(){var mn;return mn=to(),mn===l&&(mn=qr(),mn===l&&(mn=eo(),mn===l&&(mn=Hs(),mn===l&&(mn=Yr(),mn===l&&(mn=Wr(),mn===l&&(mn=Jr(),mn===l&&(mn=Kr()))))))),mn}function Wr(){var mn,Mn,Tn;return mn=Fn,o.substr(Fn,6)===Qn?(Mn=Qn,Fn+=6):(Mn=l,pa===0&&ba(xn)),Mn!==l?(rn(),Tn=Is(),Tn!==l?(Ma=mn,mn=Lr(Tn)):(Fn=mn,mn=l)):(Fn=mn,mn=l),mn}function Hs(){var mn,Mn,Tn,Hn,fa;return mn=Fn,o.substr(Fn,6)===Zn?(Mn=Zn,Fn+=6):(Mn=l,pa===0&&ba(kn)),Mn!==l?(rn(),Tn=gn(),Tn!==l?(Hn=Cn(),Hn!==l?(fa=gn(),fa!==l?(Ma=mn,mn=ur(Hn)):(Fn=mn,mn=l)):(Fn=mn,mn=l)):(Fn=mn,mn=l)):(Fn=mn,mn=l),mn}function Yr(){var mn,Mn,Tn,Hn;return mn=Fn,o.substr(Fn,6)===Vn?(Mn=Vn,Fn+=6):(Mn=l,pa===0&&ba(wn)),Mn!==l?(rn(),Tn=Bs(),Tn!==l?(rn(),Hn=Bs(),Hn!==l?(rn(),Bs(),Ma=mn,mn=Rr(Tn,Hn)):(Fn=mn,mn=l)):(Fn=mn,mn=l)):(Fn=mn,mn=l),mn}function qr(){var mn,Mn,Tn;return mn=Fn,o.substr(Fn,4)===qn?(Mn=qn,Fn+=4):(Mn=l,pa===0&&ba(Gn)),Mn!==l?(rn(),Tn=Ss(),Tn!==l?(Ma=mn,mn=dr(Tn)):(Fn=mn,mn=l)):(Fn=mn,mn=l),mn}function Kr(){var mn,Mn,Tn;return mn=Fn,o.substr(Fn,4)===ia?(Mn=ia,Fn+=4):(Mn=l,pa===0&&ba(zn)),Mn!==l?(rn(),Tn=Ss(),Tn!==l?(Ma=mn,mn=Nr(Tn)):(Fn=mn,mn=l)):(Fn=mn,mn=l),mn}function Jr(){var mn,Mn,Tn;return mn=Fn,o.substr(Fn,4)===ra?(Mn=ra,Fn+=4):(Mn=l,pa===0&&ba(Yn)),Mn!==l?(rn(),Tn=Ss(),Tn!==l?(Ma=mn,mn=hr(Tn)):(Fn=mn,mn=l)):(Fn=mn,mn=l),mn}function eo(){var mn,Mn,Tn;return mn=Fn,o.substr(Fn,4)===aa?(Mn=aa,Fn+=4):(Mn=l,pa===0&&ba(ta)),Mn!==l?(rn(),Tn=Ss(),Tn!==l?(Ma=mn,mn=xs(Tn)):(Fn=mn,mn=l)):(Fn=mn,mn=l),mn}function to(){var mn,Mn,Tn,Hn,fa;if(mn=Fn,o.substr(Fn,5)===jn?(Mn=jn,Fn+=5):(Mn=l,pa===0&&ba(la)),Mn!==l)if(rn(),Tn=gn(),Tn!==l){if(Hn=[],fa=On(),fa!==l)for(;fa!==l;)Hn.push(fa),fa=On();else Hn=l;Hn!==l?(fa=gn(),fa!==l?(Ma=mn,mn=Qa(Hn)):(Fn=mn,mn=l)):(Fn=mn,mn=l)}else Fn=mn,mn=l;else Fn=mn,mn=l;return mn}function Qr(){var mn,Mn,Tn,Hn;if(mn=Fn,o.substr(Fn,2)===ka?(Mn=ka,Fn+=2):(Mn=l,pa===0&&ba(Xa)),Mn!==l){for(Tn=[],Hn=o.charAt(Fn),ga.test(Hn)?Fn++:(Hn=l,pa===0&&ba(za));Hn!==l;)Tn.push(Hn),Hn=o.charAt(Fn),ga.test(Hn)?Fn++:(Hn=l,pa===0&&ba(za));Mn=[Mn,Tn],mn=Mn}else Fn=mn,mn=l;return mn}function no(){var mn,Mn,Tn,Hn,fa,ts,Ms,Xs;if(mn=Fn,o.substr(Fn,3)===Aa?(Mn=Aa,Fn+=3):(Mn=l,pa===0&&ba(Cs)),Mn!==l)if(rn(),o.charCodeAt(Fn)===91?(Tn=tn,Fn++):(Tn=l,pa===0&&ba(Ta)),Tn!==l)if(rn(),Hn=Is(),Hn!==l){for(fa=[],ts=Fn,Ms=cn(),Ms!==l?(Xs=Is(),Xs!==l?(Ma=ts,ts=mr(Hn,Xs)):(Fn=ts,ts=l)):(Fn=ts,ts=l);ts!==l;)fa.push(ts),ts=Fn,Ms=cn(),Ms!==l?(Xs=Is(),Xs!==l?(Ma=ts,ts=mr(Hn,Xs)):(Fn=ts,ts=l)):(Fn=ts,ts=l);ts=rn(),o.charCodeAt(Fn)===93?(Ms=an,Fn++):(Ms=l,pa===0&&ba(Os)),Ms!==l?(Ma=mn,mn=Zs(Hn,fa)):(Fn=mn,mn=l)}else Fn=mn,mn=l;else Fn=mn,mn=l;else Fn=mn,mn=l;return mn}function io(){var mn;return mn=no(),mn===l&&(mn=ks()),mn}function Is(){var mn,Mn,Tn,Hn,fa;if(mn=Fn,Mn=io(),Mn!==l){for(rn(),Tn=[],Hn=Qr();Hn!==l;)Tn.push(Hn),Hn=Qr();Ma=mn,mn=$r(Mn)}else Fn=mn,mn=l;return mn===l&&(mn=Fn,Mn=Fs(),Mn!==l?(rn(),o.charCodeAt(Fn)===36?(Tn=Na,Fn++):(Tn=l,pa===0&&ba(Es)),Tn!==l?(Hn=rn(),fa=Is(),fa!==l?(Ma=mn,mn=Rs(Mn,fa)):(Fn=mn,mn=l)):(Fn=mn,mn=l)):(Fn=mn,mn=l)),mn}function ao(){var mn,Mn;return mn=Fn,Mn=Is(),Mn!==l&&(Ma=mn,Mn=Br(Mn)),mn=Mn,mn===l&&(mn=Qr()),mn}function so(){var mn;return mn=ao(),mn}function ro(){var mn,Mn;return mn=Fn,rn(),Mn=oo(),Mn===l&&(Mn=lo(),Mn===l&&(Mn=co())),Mn!==l?(rn(),Ma=mn,mn=Ns(Mn)):(Fn=mn,mn=l),mn}function oo(){var mn,Mn,Tn;return mn=Fn,o.substr(Fn,6)===Kn?(Mn=Kn,Fn+=6):(Mn=l,pa===0&&ba(gs)),Mn!==l?(rn(),Tn=Ss(),Tn!==l?(Ma=mn,mn=Qs(Tn)):(Fn=mn,mn=l)):(Fn=mn,mn=l),mn}function lo(){var mn,Mn,Tn;return mn=Fn,o.substr(Fn,6)===Ea?(Mn=Ea,Fn+=6):(Mn=l,pa===0&&ba(Ds)),Mn!==l?(rn(),Tn=Ss(),Tn!==l?(Ma=mn,mn=fr(Tn)):(Fn=mn,mn=l)):(Fn=mn,mn=l),mn}function co(){var mn,Mn;return mn=Fn,o.substr(Fn,4)===qa?(Mn=qa,Fn+=4):(Mn=l,pa===0&&ba(_s)),Mn!==l&&(Ma=mn,Mn=Zr()),mn=Mn,mn}function uo(){var mn;return mn=so(),mn===l&&(mn=ro()),mn}var po=function(mn){this.type_="atom",this.source_=mn,this.location_=gr()},Or=function(mn,Mn,Tn,Hn){this.type_="pattern",this.arguments_={alignment:Mn,_steps:Hn},Tn!==void 0&&(this.arguments_.seed=Tn),this.source_=mn},ho=function(mn,Mn,Tn){this.type_=mn,this.arguments_=Mn,this.source_=Tn},mo=function(mn,Mn){this.type_="element",this.source_=mn,this.options_=Mn,this.location_=gr()},zr=function(mn,Mn){this.type_="command",this.name_=mn,this.options_=Mn},jr=0;if(Ts=b(),e.peg$library)return{peg$result:Ts,peg$currPos:Fn,peg$FAILED:l,peg$maxFailExpected:$s,peg$maxFailPos:ms};if(Ts!==l&&Fn===o.length)return Ts;throw Ts!==l&&Fn<o.length&&ba(Ir()),Xr($s,ms<o.length?o.charAt(ms):null,ms<o.length?js(ms,ms+1):js(ms,ms))}const peg$allowedStartRules=["start"],randOffset=3e-4,applyOptions=(o,e)=>(l,d)=>{const R=o.source_[d].options_?.ops,I=l.__steps_source;if(R)for(const z of R)switch(z.type_){case"stretch":{const se=["fast","slow"],{type:le,amount:tn}=z.arguments_;if(!se.includes(le))throw new Error(`mini: stretch: type must be one of ${se.join("|")} but got ${le}`);l=reify(l)[le](e(tn));break}case"replicate":{const{amount:se}=z.arguments_;l=reify(l),l=l._repeatCycles(se)._fast(se);break}case"bjorklund":{z.arguments_.rotation?l=l.euclidRot(e(z.arguments_.pulse),e(z.arguments_.step),e(z.arguments_.rotation)):l=l.euclid(e(z.arguments_.pulse),e(z.arguments_.step));break}case"degradeBy":{l=reify(l)._degradeByWith(rand.early(randOffset*z.arguments_.seed),z.arguments_.amount??.5);break}case"tail":{const se=e(z.arguments_.element);l=l.fmap(le=>tn=>Array.isArray(le)?[...le,tn]:[le,tn]).appLeft(se);break}case"range":{const se=e(z.arguments_.element);l=reify(l);const le=(an,sn,ln=1)=>Array.from({length:Math.abs(sn-an)/ln+1},(un,pn)=>an<sn?an+pn*ln:an-pn*ln);l=((an,sn)=>an.squeezeBind(ln=>sn.bind(un=>fastcat(...le(ln,un)))))(l,se);break}default:console.warn(`operator "${z.type_}" not implemented`)}return l.__steps_source=l.__steps_source||I,l};function patternifyAST(o,e,l,d=0){l?.(o);const p=b=>patternifyAST(b,e,l,d);switch(o.type_){case"pattern":{const b=o.source_.map(se=>p(se)).map(applyOptions(o,p)),R=o.arguments_.alignment,I=b.filter(se=>se.__steps_source);let z;switch(R){case"stack":{z=stack(...b),I.length&&(z._steps=lcm(...I.map(se=>fraction$1(se._steps))));break}case"polymeter_slowcat":{z=stack(...b.map(se=>se._slow(se.__weight))),I.length&&(z._steps=lcm(...I.map(se=>fraction$1(se._steps))));break}case"polymeter":{const se=o.arguments_.stepsPerCycle?p(o.arguments_.stepsPerCycle).fmap(tn=>fraction$1(tn)):pure(fraction$1(b.length>0?b[0].__weight:1)),le=b.map(tn=>tn.fast(se.fmap(an=>an.div(tn.__weight))));z=stack(...le);break}case"rand":{z=chooseInWith(rand.early(randOffset*o.arguments_.seed).segment(1),b),I.length&&(z._steps=lcm(...I.map(se=>fraction$1(se._steps))));break}case"feet":{z=fastcat(...b);break}default:{if(o.source_.some(le=>!!le.options_?.weight)){const le=o.source_.reduce((tn,an)=>tn.add(an.options_?.weight||fraction$1(1)),fraction$1(0));z=timeCat(...o.source_.map((tn,an)=>[tn.options_?.weight||fraction$1(1),b[an]])),z.__weight=le,z._steps=le,I.length&&(z._steps=z._steps.mul(lcm(...I.map(tn=>fraction$1(tn._steps)))))}else z=sequence(...b),z._steps=b.length;o.arguments_._steps&&(z.__steps_source=!0)}}return I.length&&(z.__steps_source=!0),z}case"element":return p(o.source_);case"atom":{if(o.source_==="~"||o.source_==="-")return silence;if(!o.location_)return console.warn("no location for",o),o.source_;const b=isNaN(Number(o.source_))?o.source_:Number(o.source_);if(d===-1)return pure(b);const[R,I]=getLeafLocation(e,o,d);return pure(b).withLoc(R,I)}case"stretch":return p(o.source_).slow(p(o.arguments_.amount));default:return console.warn(`node type "${o.type_}" not implemented -> returning silence`),silence}}const getLeafLocation=(o,e,l=0)=>{const{start:d,end:p}=e.location_,b=o?.split("").slice(d.offset,p.offset).join(""),[R=0,I=0]=b?b.split(e.source_).map(z=>z.split("").filter(se=>se===" ").length):[];return[d.offset+R+l,p.offset-I+l]},mini2ast=(o,e=0,l=o)=>{try{return peg$parse(o)}catch(d){const p=[d.location.start.offset+e,d.location.end.offset+e],b=l.slice(0,p[0]).split(`
|
||
`).length;throw new Error(`[mini] parse error at line ${b}: ${d.message}`)}},getLeaves=(o,e,l)=>{const d=mini2ast(o,e,l);let p=[];return patternifyAST(d,o,b=>{b.type_==="atom"&&p.push(b)},-1),p},getLeafLocations=(o,e=0,l)=>getLeaves(o,e,l).map(d=>getLeafLocation(o,d,e)),mini$1=(...o)=>{const e=o.map(l=>{const d=`"${l}"`,p=mini2ast(d);return patternifyAST(p,d)});return sequence(...e)},m$1=(o,e)=>{const l=`"${o}"`,d=mini2ast(l);return patternifyAST(d,l,null,e)},h$1=o=>{const e=mini2ast(o);return patternifyAST(e,o)};function minify(o){return typeof o=="string"?mini$1(o):reify(o)}function miniAllStrings(){setStringParser(mini$1)}const index$c=Object.freeze(Object.defineProperty({__proto__:null,StartRules:peg$allowedStartRules,SyntaxError:peg$SyntaxError,getLeafLocation,getLeafLocations,getLeaves,h:h$1,m:m$1,mini:mini$1,mini2ast,miniAllStrings,minify,parse:peg$parse,patternifyAST},Symbol.toStringTag,{value:"Module"}));var astralIdentifierCodes=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239],astralIdentifierStartCodes=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],nonASCIIidentifierChars="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",nonASCIIidentifierStartChars="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ꟑꟑꟓꟕ-ꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",reservedWords={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},ecma5AndLessKeywords="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",keywords$1={5:ecma5AndLessKeywords,"5module":ecma5AndLessKeywords+" export import",6:ecma5AndLessKeywords+" const class extends export import super"},keywordRelationalOperator=/^in(stanceof)?$/,nonASCIIidentifierStart=new RegExp("["+nonASCIIidentifierStartChars+"]"),nonASCIIidentifier=new RegExp("["+nonASCIIidentifierStartChars+nonASCIIidentifierChars+"]");function isInAstralSet(o,e){for(var l=65536,d=0;d<e.length;d+=2){if(l+=e[d],l>o)return!1;if(l+=e[d+1],l>=o)return!0}return!1}function isIdentifierStart(o,e){return o<65?o===36:o<91?!0:o<97?o===95:o<123?!0:o<=65535?o>=170&&nonASCIIidentifierStart.test(String.fromCharCode(o)):e===!1?!1:isInAstralSet(o,astralIdentifierStartCodes)}function isIdentifierChar(o,e){return o<48?o===36:o<58?!0:o<65?!1:o<91?!0:o<97?o===95:o<123?!0:o<=65535?o>=170&&nonASCIIidentifier.test(String.fromCharCode(o)):e===!1?!1:isInAstralSet(o,astralIdentifierStartCodes)||isInAstralSet(o,astralIdentifierCodes)}var TokenType=function(e,l){l===void 0&&(l={}),this.label=e,this.keyword=l.keyword,this.beforeExpr=!!l.beforeExpr,this.startsExpr=!!l.startsExpr,this.isLoop=!!l.isLoop,this.isAssign=!!l.isAssign,this.prefix=!!l.prefix,this.postfix=!!l.postfix,this.binop=l.binop||null,this.updateContext=null};function binop(o,e){return new TokenType(o,{beforeExpr:!0,binop:e})}var beforeExpr={beforeExpr:!0},startsExpr={startsExpr:!0},keywords$2={};function kw(o,e){return e===void 0&&(e={}),e.keyword=o,keywords$2[o]=new TokenType(o,e)}var types$1={num:new TokenType("num",startsExpr),regexp:new TokenType("regexp",startsExpr),string:new TokenType("string",startsExpr),name:new TokenType("name",startsExpr),privateId:new TokenType("privateId",startsExpr),eof:new TokenType("eof"),bracketL:new TokenType("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new TokenType("]"),braceL:new TokenType("{",{beforeExpr:!0,startsExpr:!0}),braceR:new TokenType("}"),parenL:new TokenType("(",{beforeExpr:!0,startsExpr:!0}),parenR:new TokenType(")"),comma:new TokenType(",",beforeExpr),semi:new TokenType(";",beforeExpr),colon:new TokenType(":",beforeExpr),dot:new TokenType("."),question:new TokenType("?",beforeExpr),questionDot:new TokenType("?."),arrow:new TokenType("=>",beforeExpr),template:new TokenType("template"),invalidTemplate:new TokenType("invalidTemplate"),ellipsis:new TokenType("...",beforeExpr),backQuote:new TokenType("`",startsExpr),dollarBraceL:new TokenType("${",{beforeExpr:!0,startsExpr:!0}),eq:new TokenType("=",{beforeExpr:!0,isAssign:!0}),assign:new TokenType("_=",{beforeExpr:!0,isAssign:!0}),incDec:new TokenType("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new TokenType("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:binop("||",1),logicalAND:binop("&&",2),bitwiseOR:binop("|",3),bitwiseXOR:binop("^",4),bitwiseAND:binop("&",5),equality:binop("==/!=/===/!==",6),relational:binop("</>/<=/>=",7),bitShift:binop("<</>>/>>>",8),plusMin:new TokenType("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:binop("%",10),star:binop("*",10),slash:binop("/",10),starstar:new TokenType("**",{beforeExpr:!0}),coalesce:binop("??",1),_break:kw("break"),_case:kw("case",beforeExpr),_catch:kw("catch"),_continue:kw("continue"),_debugger:kw("debugger"),_default:kw("default",beforeExpr),_do:kw("do",{isLoop:!0,beforeExpr:!0}),_else:kw("else",beforeExpr),_finally:kw("finally"),_for:kw("for",{isLoop:!0}),_function:kw("function",startsExpr),_if:kw("if"),_return:kw("return",beforeExpr),_switch:kw("switch"),_throw:kw("throw",beforeExpr),_try:kw("try"),_var:kw("var"),_const:kw("const"),_while:kw("while",{isLoop:!0}),_with:kw("with"),_new:kw("new",{beforeExpr:!0,startsExpr:!0}),_this:kw("this",startsExpr),_super:kw("super",startsExpr),_class:kw("class",startsExpr),_extends:kw("extends",beforeExpr),_export:kw("export"),_import:kw("import",startsExpr),_null:kw("null",startsExpr),_true:kw("true",startsExpr),_false:kw("false",startsExpr),_in:kw("in",{beforeExpr:!0,binop:7}),_instanceof:kw("instanceof",{beforeExpr:!0,binop:7}),_typeof:kw("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:kw("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:kw("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},lineBreak=/\r\n?|\n|\u2028|\u2029/,lineBreakG=new RegExp(lineBreak.source,"g");function isNewLine(o){return o===10||o===13||o===8232||o===8233}function nextLineBreak(o,e,l){l===void 0&&(l=o.length);for(var d=e;d<l;d++){var p=o.charCodeAt(d);if(isNewLine(p))return d<l-1&&p===13&&o.charCodeAt(d+1)===10?d+2:d+1}return-1}var nonASCIIwhitespace=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,skipWhiteSpace=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,ref=Object.prototype,hasOwnProperty=ref.hasOwnProperty,toString=ref.toString,hasOwn=Object.hasOwn||function(o,e){return hasOwnProperty.call(o,e)},isArray=Array.isArray||function(o){return toString.call(o)==="[object Array]"},regexpCache=Object.create(null);function wordsRegexp(o){return regexpCache[o]||(regexpCache[o]=new RegExp("^(?:"+o.replace(/ /g,"|")+")$"))}function codePointToString(o){return o<=65535?String.fromCharCode(o):(o-=65536,String.fromCharCode((o>>10)+55296,(o&1023)+56320))}var loneSurrogate=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Position=function(e,l){this.line=e,this.column=l};Position.prototype.offset=function(e){return new Position(this.line,this.column+e)};var SourceLocation=function(e,l,d){this.start=l,this.end=d,e.sourceFile!==null&&(this.source=e.sourceFile)};function getLineInfo(o,e){for(var l=1,d=0;;){var p=nextLineBreak(o,d,e);if(p<0)return new Position(l,e-d);++l,d=p}}var defaultOptions={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},warnedAboutEcmaVersion=!1;function getOptions(o){var e={};for(var l in defaultOptions)e[l]=o&&hasOwn(o,l)?o[l]:defaultOptions[l];if(e.ecmaVersion==="latest"?e.ecmaVersion=1e8:e.ecmaVersion==null?(!warnedAboutEcmaVersion&&typeof console=="object"&&console.warn&&(warnedAboutEcmaVersion=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
||
Defaulting to 2020, but this will stop working in the future.`)),e.ecmaVersion=11):e.ecmaVersion>=2015&&(e.ecmaVersion-=2009),e.allowReserved==null&&(e.allowReserved=e.ecmaVersion<5),(!o||o.allowHashBang==null)&&(e.allowHashBang=e.ecmaVersion>=14),isArray(e.onToken)){var d=e.onToken;e.onToken=function(p){return d.push(p)}}return isArray(e.onComment)&&(e.onComment=pushComment(e,e.onComment)),e}function pushComment(o,e){return function(l,d,p,b,R,I){var z={type:l?"Block":"Line",value:d,start:p,end:b};o.locations&&(z.loc=new SourceLocation(this,R,I)),o.ranges&&(z.range=[p,b]),e.push(z)}}var SCOPE_TOP=1,SCOPE_FUNCTION=2,SCOPE_ASYNC=4,SCOPE_GENERATOR=8,SCOPE_ARROW=16,SCOPE_SIMPLE_CATCH=32,SCOPE_SUPER=64,SCOPE_DIRECT_SUPER=128,SCOPE_CLASS_STATIC_BLOCK=256,SCOPE_VAR=SCOPE_TOP|SCOPE_FUNCTION|SCOPE_CLASS_STATIC_BLOCK;function functionFlags(o,e){return SCOPE_FUNCTION|(o?SCOPE_ASYNC:0)|(e?SCOPE_GENERATOR:0)}var BIND_NONE=0,BIND_VAR=1,BIND_LEXICAL=2,BIND_FUNCTION=3,BIND_SIMPLE_CATCH=4,BIND_OUTSIDE=5,Parser$1=function(e,l,d){this.options=e=getOptions(e),this.sourceFile=e.sourceFile,this.keywords=wordsRegexp(keywords$1[e.ecmaVersion>=6?6:e.sourceType==="module"?"5module":5]);var p="";e.allowReserved!==!0&&(p=reservedWords[e.ecmaVersion>=6?6:e.ecmaVersion===5?5:3],e.sourceType==="module"&&(p+=" await")),this.reservedWords=wordsRegexp(p);var b=(p?p+" ":"")+reservedWords.strict;this.reservedWordsStrict=wordsRegexp(b),this.reservedWordsStrictBind=wordsRegexp(b+" "+reservedWords.strictBind),this.input=String(l),this.containsEsc=!1,d?(this.pos=d,this.lineStart=this.input.lastIndexOf(`
|
||
`,d-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(lineBreak).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=types$1.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&e.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(SCOPE_TOP),this.regexpState=null,this.privateNameStack=[]},prototypeAccessors={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};Parser$1.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},prototypeAccessors.inFunction.get=function(){return(this.currentVarScope().flags&SCOPE_FUNCTION)>0},prototypeAccessors.inGenerator.get=function(){return(this.currentVarScope().flags&SCOPE_GENERATOR)>0&&!this.currentVarScope().inClassFieldInit},prototypeAccessors.inAsync.get=function(){return(this.currentVarScope().flags&SCOPE_ASYNC)>0&&!this.currentVarScope().inClassFieldInit},prototypeAccessors.canAwait.get=function(){for(var o=this.scopeStack.length-1;o>=0;o--){var e=this.scopeStack[o];if(e.inClassFieldInit||e.flags&SCOPE_CLASS_STATIC_BLOCK)return!1;if(e.flags&SCOPE_FUNCTION)return(e.flags&SCOPE_ASYNC)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},prototypeAccessors.allowSuper.get=function(){var o=this.currentThisScope(),e=o.flags,l=o.inClassFieldInit;return(e&SCOPE_SUPER)>0||l||this.options.allowSuperOutsideMethod},prototypeAccessors.allowDirectSuper.get=function(){return(this.currentThisScope().flags&SCOPE_DIRECT_SUPER)>0},prototypeAccessors.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},prototypeAccessors.allowNewDotTarget.get=function(){var o=this.currentThisScope(),e=o.flags,l=o.inClassFieldInit;return(e&(SCOPE_FUNCTION|SCOPE_CLASS_STATIC_BLOCK))>0||l},prototypeAccessors.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&SCOPE_CLASS_STATIC_BLOCK)>0},Parser$1.extend=function(){for(var e=[],l=arguments.length;l--;)e[l]=arguments[l];for(var d=this,p=0;p<e.length;p++)d=e[p](d);return d},Parser$1.parse=function(e,l){return new this(l,e).parse()},Parser$1.parseExpressionAt=function(e,l,d){var p=new this(d,e,l);return p.nextToken(),p.parseExpression()},Parser$1.tokenizer=function(e,l){return new this(l,e)},Object.defineProperties(Parser$1.prototype,prototypeAccessors);var pp$9=Parser$1.prototype,literal$1=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;pp$9.strictDirective=function(o){if(this.options.ecmaVersion<5)return!1;for(;;){skipWhiteSpace.lastIndex=o,o+=skipWhiteSpace.exec(this.input)[0].length;var e=literal$1.exec(this.input.slice(o));if(!e)return!1;if((e[1]||e[2])==="use strict"){skipWhiteSpace.lastIndex=o+e[0].length;var l=skipWhiteSpace.exec(this.input),d=l.index+l[0].length,p=this.input.charAt(d);return p===";"||p==="}"||lineBreak.test(l[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(p)||p==="!"&&this.input.charAt(d+1)==="=")}o+=e[0].length,skipWhiteSpace.lastIndex=o,o+=skipWhiteSpace.exec(this.input)[0].length,this.input[o]===";"&&o++}},pp$9.eat=function(o){return this.type===o?(this.next(),!0):!1},pp$9.isContextual=function(o){return this.type===types$1.name&&this.value===o&&!this.containsEsc},pp$9.eatContextual=function(o){return this.isContextual(o)?(this.next(),!0):!1},pp$9.expectContextual=function(o){this.eatContextual(o)||this.unexpected()},pp$9.canInsertSemicolon=function(){return this.type===types$1.eof||this.type===types$1.braceR||lineBreak.test(this.input.slice(this.lastTokEnd,this.start))},pp$9.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},pp$9.semicolon=function(){!this.eat(types$1.semi)&&!this.insertSemicolon()&&this.unexpected()},pp$9.afterTrailingComma=function(o,e){if(this.type===o)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),e||this.next(),!0},pp$9.expect=function(o){this.eat(o)||this.unexpected()},pp$9.unexpected=function(o){this.raise(o??this.start,"Unexpected token")};var DestructuringErrors=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};pp$9.checkPatternErrors=function(o,e){if(o){o.trailingComma>-1&&this.raiseRecoverable(o.trailingComma,"Comma is not permitted after the rest element");var l=e?o.parenthesizedAssign:o.parenthesizedBind;l>-1&&this.raiseRecoverable(l,e?"Assigning to rvalue":"Parenthesized pattern")}},pp$9.checkExpressionErrors=function(o,e){if(!o)return!1;var l=o.shorthandAssign,d=o.doubleProto;if(!e)return l>=0||d>=0;l>=0&&this.raise(l,"Shorthand property assignments are valid only in destructuring patterns"),d>=0&&this.raiseRecoverable(d,"Redefinition of __proto__ property")},pp$9.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},pp$9.isSimpleAssignTarget=function(o){return o.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(o.expression):o.type==="Identifier"||o.type==="MemberExpression"};var pp$8=Parser$1.prototype;pp$8.parseTopLevel=function(o){var e=Object.create(null);for(o.body||(o.body=[]);this.type!==types$1.eof;){var l=this.parseStatement(null,!0,e);o.body.push(l)}if(this.inModule)for(var d=0,p=Object.keys(this.undefinedExports);d<p.length;d+=1){var b=p[d];this.raiseRecoverable(this.undefinedExports[b].start,"Export '"+b+"' is not defined")}return this.adaptDirectivePrologue(o.body),this.next(),o.sourceType=this.options.sourceType,this.finishNode(o,"Program")};var loopLabel={kind:"loop"},switchLabel={kind:"switch"};pp$8.isLet=function(o){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;skipWhiteSpace.lastIndex=this.pos;var e=skipWhiteSpace.exec(this.input),l=this.pos+e[0].length,d=this.input.charCodeAt(l);if(d===91||d===92)return!0;if(o)return!1;if(d===123||d>55295&&d<56320)return!0;if(isIdentifierStart(d,!0)){for(var p=l+1;isIdentifierChar(d=this.input.charCodeAt(p),!0);)++p;if(d===92||d>55295&&d<56320)return!0;var b=this.input.slice(l,p);if(!keywordRelationalOperator.test(b))return!0}return!1},pp$8.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;skipWhiteSpace.lastIndex=this.pos;var o=skipWhiteSpace.exec(this.input),e=this.pos+o[0].length,l;return!lineBreak.test(this.input.slice(this.pos,e))&&this.input.slice(e,e+8)==="function"&&(e+8===this.input.length||!(isIdentifierChar(l=this.input.charCodeAt(e+8))||l>55295&&l<56320))},pp$8.parseStatement=function(o,e,l){var d=this.type,p=this.startNode(),b;switch(this.isLet(o)&&(d=types$1._var,b="let"),d){case types$1._break:case types$1._continue:return this.parseBreakContinueStatement(p,d.keyword);case types$1._debugger:return this.parseDebuggerStatement(p);case types$1._do:return this.parseDoStatement(p);case types$1._for:return this.parseForStatement(p);case types$1._function:return o&&(this.strict||o!=="if"&&o!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(p,!1,!o);case types$1._class:return o&&this.unexpected(),this.parseClass(p,!0);case types$1._if:return this.parseIfStatement(p);case types$1._return:return this.parseReturnStatement(p);case types$1._switch:return this.parseSwitchStatement(p);case types$1._throw:return this.parseThrowStatement(p);case types$1._try:return this.parseTryStatement(p);case types$1._const:case types$1._var:return b=b||this.value,o&&b!=="var"&&this.unexpected(),this.parseVarStatement(p,b);case types$1._while:return this.parseWhileStatement(p);case types$1._with:return this.parseWithStatement(p);case types$1.braceL:return this.parseBlock(!0,p);case types$1.semi:return this.parseEmptyStatement(p);case types$1._export:case types$1._import:if(this.options.ecmaVersion>10&&d===types$1._import){skipWhiteSpace.lastIndex=this.pos;var R=skipWhiteSpace.exec(this.input),I=this.pos+R[0].length,z=this.input.charCodeAt(I);if(z===40||z===46)return this.parseExpressionStatement(p,this.parseExpression())}return this.options.allowImportExportEverywhere||(e||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),d===types$1._import?this.parseImport(p):this.parseExport(p,l);default:if(this.isAsyncFunction())return o&&this.unexpected(),this.next(),this.parseFunctionStatement(p,!0,!o);var se=this.value,le=this.parseExpression();return d===types$1.name&&le.type==="Identifier"&&this.eat(types$1.colon)?this.parseLabeledStatement(p,se,le,o):this.parseExpressionStatement(p,le)}},pp$8.parseBreakContinueStatement=function(o,e){var l=e==="break";this.next(),this.eat(types$1.semi)||this.insertSemicolon()?o.label=null:this.type!==types$1.name?this.unexpected():(o.label=this.parseIdent(),this.semicolon());for(var d=0;d<this.labels.length;++d){var p=this.labels[d];if((o.label==null||p.name===o.label.name)&&(p.kind!=null&&(l||p.kind==="loop")||o.label&&l))break}return d===this.labels.length&&this.raise(o.start,"Unsyntactic "+e),this.finishNode(o,l?"BreakStatement":"ContinueStatement")},pp$8.parseDebuggerStatement=function(o){return this.next(),this.semicolon(),this.finishNode(o,"DebuggerStatement")},pp$8.parseDoStatement=function(o){return this.next(),this.labels.push(loopLabel),o.body=this.parseStatement("do"),this.labels.pop(),this.expect(types$1._while),o.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(types$1.semi):this.semicolon(),this.finishNode(o,"DoWhileStatement")},pp$8.parseForStatement=function(o){this.next();var e=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(loopLabel),this.enterScope(0),this.expect(types$1.parenL),this.type===types$1.semi)return e>-1&&this.unexpected(e),this.parseFor(o,null);var l=this.isLet();if(this.type===types$1._var||this.type===types$1._const||l){var d=this.startNode(),p=l?"let":this.value;return this.next(),this.parseVar(d,!0,p),this.finishNode(d,"VariableDeclaration"),(this.type===types$1._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&d.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===types$1._in?e>-1&&this.unexpected(e):o.await=e>-1),this.parseForIn(o,d)):(e>-1&&this.unexpected(e),this.parseFor(o,d))}var b=this.isContextual("let"),R=!1,I=this.containsEsc,z=new DestructuringErrors,se=this.start,le=e>-1?this.parseExprSubscripts(z,"await"):this.parseExpression(!0,z);return this.type===types$1._in||(R=this.options.ecmaVersion>=6&&this.isContextual("of"))?(e>-1?(this.type===types$1._in&&this.unexpected(e),o.await=!0):R&&this.options.ecmaVersion>=8&&(le.start===se&&!I&&le.type==="Identifier"&&le.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(o.await=!1)),b&&R&&this.raise(le.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(le,!1,z),this.checkLValPattern(le),this.parseForIn(o,le)):(this.checkExpressionErrors(z,!0),e>-1&&this.unexpected(e),this.parseFor(o,le))},pp$8.parseFunctionStatement=function(o,e,l){return this.next(),this.parseFunction(o,FUNC_STATEMENT|(l?0:FUNC_HANGING_STATEMENT),!1,e)},pp$8.parseIfStatement=function(o){return this.next(),o.test=this.parseParenExpression(),o.consequent=this.parseStatement("if"),o.alternate=this.eat(types$1._else)?this.parseStatement("if"):null,this.finishNode(o,"IfStatement")},pp$8.parseReturnStatement=function(o){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(types$1.semi)||this.insertSemicolon()?o.argument=null:(o.argument=this.parseExpression(),this.semicolon()),this.finishNode(o,"ReturnStatement")},pp$8.parseSwitchStatement=function(o){this.next(),o.discriminant=this.parseParenExpression(),o.cases=[],this.expect(types$1.braceL),this.labels.push(switchLabel),this.enterScope(0);for(var e,l=!1;this.type!==types$1.braceR;)if(this.type===types$1._case||this.type===types$1._default){var d=this.type===types$1._case;e&&this.finishNode(e,"SwitchCase"),o.cases.push(e=this.startNode()),e.consequent=[],this.next(),d?e.test=this.parseExpression():(l&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),l=!0,e.test=null),this.expect(types$1.colon)}else e||this.unexpected(),e.consequent.push(this.parseStatement(null));return this.exitScope(),e&&this.finishNode(e,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(o,"SwitchStatement")},pp$8.parseThrowStatement=function(o){return this.next(),lineBreak.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),o.argument=this.parseExpression(),this.semicolon(),this.finishNode(o,"ThrowStatement")};var empty$1=[];pp$8.parseCatchClauseParam=function(){var o=this.parseBindingAtom(),e=o.type==="Identifier";return this.enterScope(e?SCOPE_SIMPLE_CATCH:0),this.checkLValPattern(o,e?BIND_SIMPLE_CATCH:BIND_LEXICAL),this.expect(types$1.parenR),o},pp$8.parseTryStatement=function(o){if(this.next(),o.block=this.parseBlock(),o.handler=null,this.type===types$1._catch){var e=this.startNode();this.next(),this.eat(types$1.parenL)?e.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),e.param=null,this.enterScope(0)),e.body=this.parseBlock(!1),this.exitScope(),o.handler=this.finishNode(e,"CatchClause")}return o.finalizer=this.eat(types$1._finally)?this.parseBlock():null,!o.handler&&!o.finalizer&&this.raise(o.start,"Missing catch or finally clause"),this.finishNode(o,"TryStatement")},pp$8.parseVarStatement=function(o,e,l){return this.next(),this.parseVar(o,!1,e,l),this.semicolon(),this.finishNode(o,"VariableDeclaration")},pp$8.parseWhileStatement=function(o){return this.next(),o.test=this.parseParenExpression(),this.labels.push(loopLabel),o.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(o,"WhileStatement")},pp$8.parseWithStatement=function(o){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),o.object=this.parseParenExpression(),o.body=this.parseStatement("with"),this.finishNode(o,"WithStatement")},pp$8.parseEmptyStatement=function(o){return this.next(),this.finishNode(o,"EmptyStatement")},pp$8.parseLabeledStatement=function(o,e,l,d){for(var p=0,b=this.labels;p<b.length;p+=1){var R=b[p];R.name===e&&this.raise(l.start,"Label '"+e+"' is already declared")}for(var I=this.type.isLoop?"loop":this.type===types$1._switch?"switch":null,z=this.labels.length-1;z>=0;z--){var se=this.labels[z];if(se.statementStart===o.start)se.statementStart=this.start,se.kind=I;else break}return this.labels.push({name:e,kind:I,statementStart:this.start}),o.body=this.parseStatement(d?d.indexOf("label")===-1?d+"label":d:"label"),this.labels.pop(),o.label=l,this.finishNode(o,"LabeledStatement")},pp$8.parseExpressionStatement=function(o,e){return o.expression=e,this.semicolon(),this.finishNode(o,"ExpressionStatement")},pp$8.parseBlock=function(o,e,l){for(o===void 0&&(o=!0),e===void 0&&(e=this.startNode()),e.body=[],this.expect(types$1.braceL),o&&this.enterScope(0);this.type!==types$1.braceR;){var d=this.parseStatement(null);e.body.push(d)}return l&&(this.strict=!1),this.next(),o&&this.exitScope(),this.finishNode(e,"BlockStatement")},pp$8.parseFor=function(o,e){return o.init=e,this.expect(types$1.semi),o.test=this.type===types$1.semi?null:this.parseExpression(),this.expect(types$1.semi),o.update=this.type===types$1.parenR?null:this.parseExpression(),this.expect(types$1.parenR),o.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(o,"ForStatement")},pp$8.parseForIn=function(o,e){var l=this.type===types$1._in;return this.next(),e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!l||this.options.ecmaVersion<8||this.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier")&&this.raise(e.start,(l?"for-in":"for-of")+" loop variable declaration may not have an initializer"),o.left=e,o.right=l?this.parseExpression():this.parseMaybeAssign(),this.expect(types$1.parenR),o.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(o,l?"ForInStatement":"ForOfStatement")},pp$8.parseVar=function(o,e,l,d){for(o.declarations=[],o.kind=l;;){var p=this.startNode();if(this.parseVarId(p,l),this.eat(types$1.eq)?p.init=this.parseMaybeAssign(e):!d&&l==="const"&&!(this.type===types$1._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!d&&p.id.type!=="Identifier"&&!(e&&(this.type===types$1._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):p.init=null,o.declarations.push(this.finishNode(p,"VariableDeclarator")),!this.eat(types$1.comma))break}return o},pp$8.parseVarId=function(o,e){o.id=this.parseBindingAtom(),this.checkLValPattern(o.id,e==="var"?BIND_VAR:BIND_LEXICAL,!1)};var FUNC_STATEMENT=1,FUNC_HANGING_STATEMENT=2,FUNC_NULLABLE_ID=4;pp$8.parseFunction=function(o,e,l,d,p){this.initFunction(o),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!d)&&(this.type===types$1.star&&e&FUNC_HANGING_STATEMENT&&this.unexpected(),o.generator=this.eat(types$1.star)),this.options.ecmaVersion>=8&&(o.async=!!d),e&FUNC_STATEMENT&&(o.id=e&FUNC_NULLABLE_ID&&this.type!==types$1.name?null:this.parseIdent(),o.id&&!(e&FUNC_HANGING_STATEMENT)&&this.checkLValSimple(o.id,this.strict||o.generator||o.async?this.treatFunctionsAsVar?BIND_VAR:BIND_LEXICAL:BIND_FUNCTION));var b=this.yieldPos,R=this.awaitPos,I=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(functionFlags(o.async,o.generator)),e&FUNC_STATEMENT||(o.id=this.type===types$1.name?this.parseIdent():null),this.parseFunctionParams(o),this.parseFunctionBody(o,l,!1,p),this.yieldPos=b,this.awaitPos=R,this.awaitIdentPos=I,this.finishNode(o,e&FUNC_STATEMENT?"FunctionDeclaration":"FunctionExpression")},pp$8.parseFunctionParams=function(o){this.expect(types$1.parenL),o.params=this.parseBindingList(types$1.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},pp$8.parseClass=function(o,e){this.next();var l=this.strict;this.strict=!0,this.parseClassId(o,e),this.parseClassSuper(o);var d=this.enterClassBody(),p=this.startNode(),b=!1;for(p.body=[],this.expect(types$1.braceL);this.type!==types$1.braceR;){var R=this.parseClassElement(o.superClass!==null);R&&(p.body.push(R),R.type==="MethodDefinition"&&R.kind==="constructor"?(b&&this.raiseRecoverable(R.start,"Duplicate constructor in the same class"),b=!0):R.key&&R.key.type==="PrivateIdentifier"&&isPrivateNameConflicted(d,R)&&this.raiseRecoverable(R.key.start,"Identifier '#"+R.key.name+"' has already been declared"))}return this.strict=l,this.next(),o.body=this.finishNode(p,"ClassBody"),this.exitClassBody(),this.finishNode(o,e?"ClassDeclaration":"ClassExpression")},pp$8.parseClassElement=function(o){if(this.eat(types$1.semi))return null;var e=this.options.ecmaVersion,l=this.startNode(),d="",p=!1,b=!1,R="method",I=!1;if(this.eatContextual("static")){if(e>=13&&this.eat(types$1.braceL))return this.parseClassStaticBlock(l),l;this.isClassElementNameStart()||this.type===types$1.star?I=!0:d="static"}if(l.static=I,!d&&e>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===types$1.star)&&!this.canInsertSemicolon()?b=!0:d="async"),!d&&(e>=9||!b)&&this.eat(types$1.star)&&(p=!0),!d&&!b&&!p){var z=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?R=z:d=z)}if(d?(l.computed=!1,l.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),l.key.name=d,this.finishNode(l.key,"Identifier")):this.parseClassElementName(l),e<13||this.type===types$1.parenL||R!=="method"||p||b){var se=!l.static&&checkKeyName(l,"constructor"),le=se&&o;se&&R!=="method"&&this.raise(l.key.start,"Constructor can't have get/set modifier"),l.kind=se?"constructor":R,this.parseClassMethod(l,p,b,le)}else this.parseClassField(l);return l},pp$8.isClassElementNameStart=function(){return this.type===types$1.name||this.type===types$1.privateId||this.type===types$1.num||this.type===types$1.string||this.type===types$1.bracketL||this.type.keyword},pp$8.parseClassElementName=function(o){this.type===types$1.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),o.computed=!1,o.key=this.parsePrivateIdent()):this.parsePropertyName(o)},pp$8.parseClassMethod=function(o,e,l,d){var p=o.key;o.kind==="constructor"?(e&&this.raise(p.start,"Constructor can't be a generator"),l&&this.raise(p.start,"Constructor can't be an async method")):o.static&&checkKeyName(o,"prototype")&&this.raise(p.start,"Classes may not have a static property named prototype");var b=o.value=this.parseMethod(e,l,d);return o.kind==="get"&&b.params.length!==0&&this.raiseRecoverable(b.start,"getter should have no params"),o.kind==="set"&&b.params.length!==1&&this.raiseRecoverable(b.start,"setter should have exactly one param"),o.kind==="set"&&b.params[0].type==="RestElement"&&this.raiseRecoverable(b.params[0].start,"Setter cannot use rest params"),this.finishNode(o,"MethodDefinition")},pp$8.parseClassField=function(o){if(checkKeyName(o,"constructor")?this.raise(o.key.start,"Classes can't have a field named 'constructor'"):o.static&&checkKeyName(o,"prototype")&&this.raise(o.key.start,"Classes can't have a static field named 'prototype'"),this.eat(types$1.eq)){var e=this.currentThisScope(),l=e.inClassFieldInit;e.inClassFieldInit=!0,o.value=this.parseMaybeAssign(),e.inClassFieldInit=l}else o.value=null;return this.semicolon(),this.finishNode(o,"PropertyDefinition")},pp$8.parseClassStaticBlock=function(o){o.body=[];var e=this.labels;for(this.labels=[],this.enterScope(SCOPE_CLASS_STATIC_BLOCK|SCOPE_SUPER);this.type!==types$1.braceR;){var l=this.parseStatement(null);o.body.push(l)}return this.next(),this.exitScope(),this.labels=e,this.finishNode(o,"StaticBlock")},pp$8.parseClassId=function(o,e){this.type===types$1.name?(o.id=this.parseIdent(),e&&this.checkLValSimple(o.id,BIND_LEXICAL,!1)):(e===!0&&this.unexpected(),o.id=null)},pp$8.parseClassSuper=function(o){o.superClass=this.eat(types$1._extends)?this.parseExprSubscripts(null,!1):null},pp$8.enterClassBody=function(){var o={declared:Object.create(null),used:[]};return this.privateNameStack.push(o),o.declared},pp$8.exitClassBody=function(){var o=this.privateNameStack.pop(),e=o.declared,l=o.used;if(this.options.checkPrivateFields)for(var d=this.privateNameStack.length,p=d===0?null:this.privateNameStack[d-1],b=0;b<l.length;++b){var R=l[b];hasOwn(e,R.name)||(p?p.used.push(R):this.raiseRecoverable(R.start,"Private field '#"+R.name+"' must be declared in an enclosing class"))}};function isPrivateNameConflicted(o,e){var l=e.key.name,d=o[l],p="true";return e.type==="MethodDefinition"&&(e.kind==="get"||e.kind==="set")&&(p=(e.static?"s":"i")+e.kind),d==="iget"&&p==="iset"||d==="iset"&&p==="iget"||d==="sget"&&p==="sset"||d==="sset"&&p==="sget"?(o[l]="true",!1):d?!0:(o[l]=p,!1)}function checkKeyName(o,e){var l=o.computed,d=o.key;return!l&&(d.type==="Identifier"&&d.name===e||d.type==="Literal"&&d.value===e)}pp$8.parseExportAllDeclaration=function(o,e){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(o.exported=this.parseModuleExportName(),this.checkExport(e,o.exported,this.lastTokStart)):o.exported=null),this.expectContextual("from"),this.type!==types$1.string&&this.unexpected(),o.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(o.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(o,"ExportAllDeclaration")},pp$8.parseExport=function(o,e){if(this.next(),this.eat(types$1.star))return this.parseExportAllDeclaration(o,e);if(this.eat(types$1._default))return this.checkExport(e,"default",this.lastTokStart),o.declaration=this.parseExportDefaultDeclaration(),this.finishNode(o,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())o.declaration=this.parseExportDeclaration(o),o.declaration.type==="VariableDeclaration"?this.checkVariableExport(e,o.declaration.declarations):this.checkExport(e,o.declaration.id,o.declaration.id.start),o.specifiers=[],o.source=null;else{if(o.declaration=null,o.specifiers=this.parseExportSpecifiers(e),this.eatContextual("from"))this.type!==types$1.string&&this.unexpected(),o.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(o.attributes=this.parseWithClause());else{for(var l=0,d=o.specifiers;l<d.length;l+=1){var p=d[l];this.checkUnreserved(p.local),this.checkLocalExport(p.local),p.local.type==="Literal"&&this.raise(p.local.start,"A string literal cannot be used as an exported binding without `from`.")}o.source=null}this.semicolon()}return this.finishNode(o,"ExportNamedDeclaration")},pp$8.parseExportDeclaration=function(o){return this.parseStatement(null)},pp$8.parseExportDefaultDeclaration=function(){var o;if(this.type===types$1._function||(o=this.isAsyncFunction())){var e=this.startNode();return this.next(),o&&this.next(),this.parseFunction(e,FUNC_STATEMENT|FUNC_NULLABLE_ID,!1,o)}else if(this.type===types$1._class){var l=this.startNode();return this.parseClass(l,"nullableID")}else{var d=this.parseMaybeAssign();return this.semicolon(),d}},pp$8.checkExport=function(o,e,l){o&&(typeof e!="string"&&(e=e.type==="Identifier"?e.name:e.value),hasOwn(o,e)&&this.raiseRecoverable(l,"Duplicate export '"+e+"'"),o[e]=!0)},pp$8.checkPatternExport=function(o,e){var l=e.type;if(l==="Identifier")this.checkExport(o,e,e.start);else if(l==="ObjectPattern")for(var d=0,p=e.properties;d<p.length;d+=1){var b=p[d];this.checkPatternExport(o,b)}else if(l==="ArrayPattern")for(var R=0,I=e.elements;R<I.length;R+=1){var z=I[R];z&&this.checkPatternExport(o,z)}else l==="Property"?this.checkPatternExport(o,e.value):l==="AssignmentPattern"?this.checkPatternExport(o,e.left):l==="RestElement"&&this.checkPatternExport(o,e.argument)},pp$8.checkVariableExport=function(o,e){if(o)for(var l=0,d=e;l<d.length;l+=1){var p=d[l];this.checkPatternExport(o,p.id)}},pp$8.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()},pp$8.parseExportSpecifier=function(o){var e=this.startNode();return e.local=this.parseModuleExportName(),e.exported=this.eatContextual("as")?this.parseModuleExportName():e.local,this.checkExport(o,e.exported,e.exported.start),this.finishNode(e,"ExportSpecifier")},pp$8.parseExportSpecifiers=function(o){var e=[],l=!0;for(this.expect(types$1.braceL);!this.eat(types$1.braceR);){if(l)l=!1;else if(this.expect(types$1.comma),this.afterTrailingComma(types$1.braceR))break;e.push(this.parseExportSpecifier(o))}return e},pp$8.parseImport=function(o){return this.next(),this.type===types$1.string?(o.specifiers=empty$1,o.source=this.parseExprAtom()):(o.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),o.source=this.type===types$1.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(o.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(o,"ImportDeclaration")},pp$8.parseImportSpecifier=function(){var o=this.startNode();return o.imported=this.parseModuleExportName(),this.eatContextual("as")?o.local=this.parseIdent():(this.checkUnreserved(o.imported),o.local=o.imported),this.checkLValSimple(o.local,BIND_LEXICAL),this.finishNode(o,"ImportSpecifier")},pp$8.parseImportDefaultSpecifier=function(){var o=this.startNode();return o.local=this.parseIdent(),this.checkLValSimple(o.local,BIND_LEXICAL),this.finishNode(o,"ImportDefaultSpecifier")},pp$8.parseImportNamespaceSpecifier=function(){var o=this.startNode();return this.next(),this.expectContextual("as"),o.local=this.parseIdent(),this.checkLValSimple(o.local,BIND_LEXICAL),this.finishNode(o,"ImportNamespaceSpecifier")},pp$8.parseImportSpecifiers=function(){var o=[],e=!0;if(this.type===types$1.name&&(o.push(this.parseImportDefaultSpecifier()),!this.eat(types$1.comma)))return o;if(this.type===types$1.star)return o.push(this.parseImportNamespaceSpecifier()),o;for(this.expect(types$1.braceL);!this.eat(types$1.braceR);){if(e)e=!1;else if(this.expect(types$1.comma),this.afterTrailingComma(types$1.braceR))break;o.push(this.parseImportSpecifier())}return o},pp$8.parseWithClause=function(){var o=[];if(!this.eat(types$1._with))return o;this.expect(types$1.braceL);for(var e={},l=!0;!this.eat(types$1.braceR);){if(l)l=!1;else if(this.expect(types$1.comma),this.afterTrailingComma(types$1.braceR))break;var d=this.parseImportAttribute(),p=d.key.type==="Identifier"?d.key.name:d.key.value;hasOwn(e,p)&&this.raiseRecoverable(d.key.start,"Duplicate attribute key '"+p+"'"),e[p]=!0,o.push(d)}return o},pp$8.parseImportAttribute=function(){var o=this.startNode();return o.key=this.type===types$1.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(types$1.colon),this.type!==types$1.string&&this.unexpected(),o.value=this.parseExprAtom(),this.finishNode(o,"ImportAttribute")},pp$8.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===types$1.string){var o=this.parseLiteral(this.value);return loneSurrogate.test(o.value)&&this.raise(o.start,"An export name cannot include a lone surrogate."),o}return this.parseIdent(!0)},pp$8.adaptDirectivePrologue=function(o){for(var e=0;e<o.length&&this.isDirectiveCandidate(o[e]);++e)o[e].directive=o[e].expression.raw.slice(1,-1)},pp$8.isDirectiveCandidate=function(o){return this.options.ecmaVersion>=5&&o.type==="ExpressionStatement"&&o.expression.type==="Literal"&&typeof o.expression.value=="string"&&(this.input[o.start]==='"'||this.input[o.start]==="'")};var pp$7=Parser$1.prototype;pp$7.toAssignable=function(o,e,l){if(this.options.ecmaVersion>=6&&o)switch(o.type){case"Identifier":this.inAsync&&o.name==="await"&&this.raise(o.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":o.type="ObjectPattern",l&&this.checkPatternErrors(l,!0);for(var d=0,p=o.properties;d<p.length;d+=1){var b=p[d];this.toAssignable(b,e),b.type==="RestElement"&&(b.argument.type==="ArrayPattern"||b.argument.type==="ObjectPattern")&&this.raise(b.argument.start,"Unexpected token")}break;case"Property":o.kind!=="init"&&this.raise(o.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(o.value,e);break;case"ArrayExpression":o.type="ArrayPattern",l&&this.checkPatternErrors(l,!0),this.toAssignableList(o.elements,e);break;case"SpreadElement":o.type="RestElement",this.toAssignable(o.argument,e),o.argument.type==="AssignmentPattern"&&this.raise(o.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":o.operator!=="="&&this.raise(o.left.end,"Only '=' operator can be used for specifying default value."),o.type="AssignmentPattern",delete o.operator,this.toAssignable(o.left,e);break;case"ParenthesizedExpression":this.toAssignable(o.expression,e,l);break;case"ChainExpression":this.raiseRecoverable(o.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!e)break;default:this.raise(o.start,"Assigning to rvalue")}else l&&this.checkPatternErrors(l,!0);return o},pp$7.toAssignableList=function(o,e){for(var l=o.length,d=0;d<l;d++){var p=o[d];p&&this.toAssignable(p,e)}if(l){var b=o[l-1];this.options.ecmaVersion===6&&e&&b&&b.type==="RestElement"&&b.argument.type!=="Identifier"&&this.unexpected(b.argument.start)}return o},pp$7.parseSpread=function(o){var e=this.startNode();return this.next(),e.argument=this.parseMaybeAssign(!1,o),this.finishNode(e,"SpreadElement")},pp$7.parseRestBinding=function(){var o=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==types$1.name&&this.unexpected(),o.argument=this.parseBindingAtom(),this.finishNode(o,"RestElement")},pp$7.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case types$1.bracketL:var o=this.startNode();return this.next(),o.elements=this.parseBindingList(types$1.bracketR,!0,!0),this.finishNode(o,"ArrayPattern");case types$1.braceL:return this.parseObj(!0)}return this.parseIdent()},pp$7.parseBindingList=function(o,e,l,d){for(var p=[],b=!0;!this.eat(o);)if(b?b=!1:this.expect(types$1.comma),e&&this.type===types$1.comma)p.push(null);else{if(l&&this.afterTrailingComma(o))break;if(this.type===types$1.ellipsis){var R=this.parseRestBinding();this.parseBindingListItem(R),p.push(R),this.type===types$1.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(o);break}else p.push(this.parseAssignableListItem(d))}return p},pp$7.parseAssignableListItem=function(o){var e=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(e),e},pp$7.parseBindingListItem=function(o){return o},pp$7.parseMaybeDefault=function(o,e,l){if(l=l||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(types$1.eq))return l;var d=this.startNodeAt(o,e);return d.left=l,d.right=this.parseMaybeAssign(),this.finishNode(d,"AssignmentPattern")},pp$7.checkLValSimple=function(o,e,l){e===void 0&&(e=BIND_NONE);var d=e!==BIND_NONE;switch(o.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(o.name)&&this.raiseRecoverable(o.start,(d?"Binding ":"Assigning to ")+o.name+" in strict mode"),d&&(e===BIND_LEXICAL&&o.name==="let"&&this.raiseRecoverable(o.start,"let is disallowed as a lexically bound name"),l&&(hasOwn(l,o.name)&&this.raiseRecoverable(o.start,"Argument name clash"),l[o.name]=!0),e!==BIND_OUTSIDE&&this.declareName(o.name,e,o.start));break;case"ChainExpression":this.raiseRecoverable(o.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":d&&this.raiseRecoverable(o.start,"Binding member expression");break;case"ParenthesizedExpression":return d&&this.raiseRecoverable(o.start,"Binding parenthesized expression"),this.checkLValSimple(o.expression,e,l);default:this.raise(o.start,(d?"Binding":"Assigning to")+" rvalue")}},pp$7.checkLValPattern=function(o,e,l){switch(e===void 0&&(e=BIND_NONE),o.type){case"ObjectPattern":for(var d=0,p=o.properties;d<p.length;d+=1){var b=p[d];this.checkLValInnerPattern(b,e,l)}break;case"ArrayPattern":for(var R=0,I=o.elements;R<I.length;R+=1){var z=I[R];z&&this.checkLValInnerPattern(z,e,l)}break;default:this.checkLValSimple(o,e,l)}},pp$7.checkLValInnerPattern=function(o,e,l){switch(e===void 0&&(e=BIND_NONE),o.type){case"Property":this.checkLValInnerPattern(o.value,e,l);break;case"AssignmentPattern":this.checkLValPattern(o.left,e,l);break;case"RestElement":this.checkLValPattern(o.argument,e,l);break;default:this.checkLValPattern(o,e,l)}};var TokContext=function(e,l,d,p,b){this.token=e,this.isExpr=!!l,this.preserveSpace=!!d,this.override=p,this.generator=!!b},types$2={b_stat:new TokContext("{",!1),b_expr:new TokContext("{",!0),b_tmpl:new TokContext("${",!1),p_stat:new TokContext("(",!1),p_expr:new TokContext("(",!0),q_tmpl:new TokContext("`",!0,!0,function(o){return o.tryReadTemplateToken()}),f_stat:new TokContext("function",!1),f_expr:new TokContext("function",!0),f_expr_gen:new TokContext("function",!0,!1,null,!0),f_gen:new TokContext("function",!1,!1,null,!0)},pp$6=Parser$1.prototype;pp$6.initialContext=function(){return[types$2.b_stat]},pp$6.curContext=function(){return this.context[this.context.length-1]},pp$6.braceIsBlock=function(o){var e=this.curContext();return e===types$2.f_expr||e===types$2.f_stat?!0:o===types$1.colon&&(e===types$2.b_stat||e===types$2.b_expr)?!e.isExpr:o===types$1._return||o===types$1.name&&this.exprAllowed?lineBreak.test(this.input.slice(this.lastTokEnd,this.start)):o===types$1._else||o===types$1.semi||o===types$1.eof||o===types$1.parenR||o===types$1.arrow?!0:o===types$1.braceL?e===types$2.b_stat:o===types$1._var||o===types$1._const||o===types$1.name?!1:!this.exprAllowed},pp$6.inGeneratorContext=function(){for(var o=this.context.length-1;o>=1;o--){var e=this.context[o];if(e.token==="function")return e.generator}return!1},pp$6.updateContext=function(o){var e,l=this.type;l.keyword&&o===types$1.dot?this.exprAllowed=!1:(e=l.updateContext)?e.call(this,o):this.exprAllowed=l.beforeExpr},pp$6.overrideContext=function(o){this.curContext()!==o&&(this.context[this.context.length-1]=o)},types$1.parenR.updateContext=types$1.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var o=this.context.pop();o===types$2.b_stat&&this.curContext().token==="function"&&(o=this.context.pop()),this.exprAllowed=!o.isExpr},types$1.braceL.updateContext=function(o){this.context.push(this.braceIsBlock(o)?types$2.b_stat:types$2.b_expr),this.exprAllowed=!0},types$1.dollarBraceL.updateContext=function(){this.context.push(types$2.b_tmpl),this.exprAllowed=!0},types$1.parenL.updateContext=function(o){var e=o===types$1._if||o===types$1._for||o===types$1._with||o===types$1._while;this.context.push(e?types$2.p_stat:types$2.p_expr),this.exprAllowed=!0},types$1.incDec.updateContext=function(){},types$1._function.updateContext=types$1._class.updateContext=function(o){o.beforeExpr&&o!==types$1._else&&!(o===types$1.semi&&this.curContext()!==types$2.p_stat)&&!(o===types$1._return&&lineBreak.test(this.input.slice(this.lastTokEnd,this.start)))&&!((o===types$1.colon||o===types$1.braceL)&&this.curContext()===types$2.b_stat)?this.context.push(types$2.f_expr):this.context.push(types$2.f_stat),this.exprAllowed=!1},types$1.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0},types$1.backQuote.updateContext=function(){this.curContext()===types$2.q_tmpl?this.context.pop():this.context.push(types$2.q_tmpl),this.exprAllowed=!1},types$1.star.updateContext=function(o){if(o===types$1._function){var e=this.context.length-1;this.context[e]===types$2.f_expr?this.context[e]=types$2.f_expr_gen:this.context[e]=types$2.f_gen}this.exprAllowed=!0},types$1.name.updateContext=function(o){var e=!1;this.options.ecmaVersion>=6&&o!==types$1.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(e=!0),this.exprAllowed=e};var pp$5=Parser$1.prototype;pp$5.checkPropClash=function(o,e,l){if(!(this.options.ecmaVersion>=9&&o.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(o.computed||o.method||o.shorthand))){var d=o.key,p;switch(d.type){case"Identifier":p=d.name;break;case"Literal":p=String(d.value);break;default:return}var b=o.kind;if(this.options.ecmaVersion>=6){p==="__proto__"&&b==="init"&&(e.proto&&(l?l.doubleProto<0&&(l.doubleProto=d.start):this.raiseRecoverable(d.start,"Redefinition of __proto__ property")),e.proto=!0);return}p="$"+p;var R=e[p];if(R){var I;b==="init"?I=this.strict&&R.init||R.get||R.set:I=R.init||R[b],I&&this.raiseRecoverable(d.start,"Redefinition of property")}else R=e[p]={init:!1,get:!1,set:!1};R[b]=!0}},pp$5.parseExpression=function(o,e){var l=this.start,d=this.startLoc,p=this.parseMaybeAssign(o,e);if(this.type===types$1.comma){var b=this.startNodeAt(l,d);for(b.expressions=[p];this.eat(types$1.comma);)b.expressions.push(this.parseMaybeAssign(o,e));return this.finishNode(b,"SequenceExpression")}return p},pp$5.parseMaybeAssign=function(o,e,l){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(o);this.exprAllowed=!1}var d=!1,p=-1,b=-1,R=-1;e?(p=e.parenthesizedAssign,b=e.trailingComma,R=e.doubleProto,e.parenthesizedAssign=e.trailingComma=-1):(e=new DestructuringErrors,d=!0);var I=this.start,z=this.startLoc;(this.type===types$1.parenL||this.type===types$1.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=o==="await");var se=this.parseMaybeConditional(o,e);if(l&&(se=l.call(this,se,I,z)),this.type.isAssign){var le=this.startNodeAt(I,z);return le.operator=this.value,this.type===types$1.eq&&(se=this.toAssignable(se,!1,e)),d||(e.parenthesizedAssign=e.trailingComma=e.doubleProto=-1),e.shorthandAssign>=se.start&&(e.shorthandAssign=-1),this.type===types$1.eq?this.checkLValPattern(se):this.checkLValSimple(se),le.left=se,this.next(),le.right=this.parseMaybeAssign(o),R>-1&&(e.doubleProto=R),this.finishNode(le,"AssignmentExpression")}else d&&this.checkExpressionErrors(e,!0);return p>-1&&(e.parenthesizedAssign=p),b>-1&&(e.trailingComma=b),se},pp$5.parseMaybeConditional=function(o,e){var l=this.start,d=this.startLoc,p=this.parseExprOps(o,e);if(this.checkExpressionErrors(e))return p;if(this.eat(types$1.question)){var b=this.startNodeAt(l,d);return b.test=p,b.consequent=this.parseMaybeAssign(),this.expect(types$1.colon),b.alternate=this.parseMaybeAssign(o),this.finishNode(b,"ConditionalExpression")}return p},pp$5.parseExprOps=function(o,e){var l=this.start,d=this.startLoc,p=this.parseMaybeUnary(e,!1,!1,o);return this.checkExpressionErrors(e)||p.start===l&&p.type==="ArrowFunctionExpression"?p:this.parseExprOp(p,l,d,-1,o)},pp$5.parseExprOp=function(o,e,l,d,p){var b=this.type.binop;if(b!=null&&(!p||this.type!==types$1._in)&&b>d){var R=this.type===types$1.logicalOR||this.type===types$1.logicalAND,I=this.type===types$1.coalesce;I&&(b=types$1.logicalAND.binop);var z=this.value;this.next();var se=this.start,le=this.startLoc,tn=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,p),se,le,b,p),an=this.buildBinary(e,l,o,tn,z,R||I);return(R&&this.type===types$1.coalesce||I&&(this.type===types$1.logicalOR||this.type===types$1.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(an,e,l,d,p)}return o},pp$5.buildBinary=function(o,e,l,d,p,b){d.type==="PrivateIdentifier"&&this.raise(d.start,"Private identifier can only be left side of binary expression");var R=this.startNodeAt(o,e);return R.left=l,R.operator=p,R.right=d,this.finishNode(R,b?"LogicalExpression":"BinaryExpression")},pp$5.parseMaybeUnary=function(o,e,l,d){var p=this.start,b=this.startLoc,R;if(this.isContextual("await")&&this.canAwait)R=this.parseAwait(d),e=!0;else if(this.type.prefix){var I=this.startNode(),z=this.type===types$1.incDec;I.operator=this.value,I.prefix=!0,this.next(),I.argument=this.parseMaybeUnary(null,!0,z,d),this.checkExpressionErrors(o,!0),z?this.checkLValSimple(I.argument):this.strict&&I.operator==="delete"&&isLocalVariableAccess(I.argument)?this.raiseRecoverable(I.start,"Deleting local variable in strict mode"):I.operator==="delete"&&isPrivateFieldAccess(I.argument)?this.raiseRecoverable(I.start,"Private fields can not be deleted"):e=!0,R=this.finishNode(I,z?"UpdateExpression":"UnaryExpression")}else if(!e&&this.type===types$1.privateId)(d||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),R=this.parsePrivateIdent(),this.type!==types$1._in&&this.unexpected();else{if(R=this.parseExprSubscripts(o,d),this.checkExpressionErrors(o))return R;for(;this.type.postfix&&!this.canInsertSemicolon();){var se=this.startNodeAt(p,b);se.operator=this.value,se.prefix=!1,se.argument=R,this.checkLValSimple(R),this.next(),R=this.finishNode(se,"UpdateExpression")}}if(!l&&this.eat(types$1.starstar))if(e)this.unexpected(this.lastTokStart);else return this.buildBinary(p,b,R,this.parseMaybeUnary(null,!1,!1,d),"**",!1);else return R};function isLocalVariableAccess(o){return o.type==="Identifier"||o.type==="ParenthesizedExpression"&&isLocalVariableAccess(o.expression)}function isPrivateFieldAccess(o){return o.type==="MemberExpression"&&o.property.type==="PrivateIdentifier"||o.type==="ChainExpression"&&isPrivateFieldAccess(o.expression)||o.type==="ParenthesizedExpression"&&isPrivateFieldAccess(o.expression)}pp$5.parseExprSubscripts=function(o,e){var l=this.start,d=this.startLoc,p=this.parseExprAtom(o,e);if(p.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return p;var b=this.parseSubscripts(p,l,d,!1,e);return o&&b.type==="MemberExpression"&&(o.parenthesizedAssign>=b.start&&(o.parenthesizedAssign=-1),o.parenthesizedBind>=b.start&&(o.parenthesizedBind=-1),o.trailingComma>=b.start&&(o.trailingComma=-1)),b},pp$5.parseSubscripts=function(o,e,l,d,p){for(var b=this.options.ecmaVersion>=8&&o.type==="Identifier"&&o.name==="async"&&this.lastTokEnd===o.end&&!this.canInsertSemicolon()&&o.end-o.start===5&&this.potentialArrowAt===o.start,R=!1;;){var I=this.parseSubscript(o,e,l,d,b,R,p);if(I.optional&&(R=!0),I===o||I.type==="ArrowFunctionExpression"){if(R){var z=this.startNodeAt(e,l);z.expression=I,I=this.finishNode(z,"ChainExpression")}return I}o=I}},pp$5.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(types$1.arrow)},pp$5.parseSubscriptAsyncArrow=function(o,e,l,d){return this.parseArrowExpression(this.startNodeAt(o,e),l,!0,d)},pp$5.parseSubscript=function(o,e,l,d,p,b,R){var I=this.options.ecmaVersion>=11,z=I&&this.eat(types$1.questionDot);d&&z&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var se=this.eat(types$1.bracketL);if(se||z&&this.type!==types$1.parenL&&this.type!==types$1.backQuote||this.eat(types$1.dot)){var le=this.startNodeAt(e,l);le.object=o,se?(le.property=this.parseExpression(),this.expect(types$1.bracketR)):this.type===types$1.privateId&&o.type!=="Super"?le.property=this.parsePrivateIdent():le.property=this.parseIdent(this.options.allowReserved!=="never"),le.computed=!!se,I&&(le.optional=z),o=this.finishNode(le,"MemberExpression")}else if(!d&&this.eat(types$1.parenL)){var tn=new DestructuringErrors,an=this.yieldPos,sn=this.awaitPos,ln=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var un=this.parseExprList(types$1.parenR,this.options.ecmaVersion>=8,!1,tn);if(p&&!z&&this.shouldParseAsyncArrow())return this.checkPatternErrors(tn,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=an,this.awaitPos=sn,this.awaitIdentPos=ln,this.parseSubscriptAsyncArrow(e,l,un,R);this.checkExpressionErrors(tn,!0),this.yieldPos=an||this.yieldPos,this.awaitPos=sn||this.awaitPos,this.awaitIdentPos=ln||this.awaitIdentPos;var pn=this.startNodeAt(e,l);pn.callee=o,pn.arguments=un,I&&(pn.optional=z),o=this.finishNode(pn,"CallExpression")}else if(this.type===types$1.backQuote){(z||b)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var yn=this.startNodeAt(e,l);yn.tag=o,yn.quasi=this.parseTemplate({isTagged:!0}),o=this.finishNode(yn,"TaggedTemplateExpression")}return o},pp$5.parseExprAtom=function(o,e,l){this.type===types$1.slash&&this.readRegexp();var d,p=this.potentialArrowAt===this.start;switch(this.type){case types$1._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),d=this.startNode(),this.next(),this.type===types$1.parenL&&!this.allowDirectSuper&&this.raise(d.start,"super() call outside constructor of a subclass"),this.type!==types$1.dot&&this.type!==types$1.bracketL&&this.type!==types$1.parenL&&this.unexpected(),this.finishNode(d,"Super");case types$1._this:return d=this.startNode(),this.next(),this.finishNode(d,"ThisExpression");case types$1.name:var b=this.start,R=this.startLoc,I=this.containsEsc,z=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!I&&z.name==="async"&&!this.canInsertSemicolon()&&this.eat(types$1._function))return this.overrideContext(types$2.f_expr),this.parseFunction(this.startNodeAt(b,R),0,!1,!0,e);if(p&&!this.canInsertSemicolon()){if(this.eat(types$1.arrow))return this.parseArrowExpression(this.startNodeAt(b,R),[z],!1,e);if(this.options.ecmaVersion>=8&&z.name==="async"&&this.type===types$1.name&&!I&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return z=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(types$1.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(b,R),[z],!0,e)}return z;case types$1.regexp:var se=this.value;return d=this.parseLiteral(se.value),d.regex={pattern:se.pattern,flags:se.flags},d;case types$1.num:case types$1.string:return this.parseLiteral(this.value);case types$1._null:case types$1._true:case types$1._false:return d=this.startNode(),d.value=this.type===types$1._null?null:this.type===types$1._true,d.raw=this.type.keyword,this.next(),this.finishNode(d,"Literal");case types$1.parenL:var le=this.start,tn=this.parseParenAndDistinguishExpression(p,e);return o&&(o.parenthesizedAssign<0&&!this.isSimpleAssignTarget(tn)&&(o.parenthesizedAssign=le),o.parenthesizedBind<0&&(o.parenthesizedBind=le)),tn;case types$1.bracketL:return d=this.startNode(),this.next(),d.elements=this.parseExprList(types$1.bracketR,!0,!0,o),this.finishNode(d,"ArrayExpression");case types$1.braceL:return this.overrideContext(types$2.b_expr),this.parseObj(!1,o);case types$1._function:return d=this.startNode(),this.next(),this.parseFunction(d,0);case types$1._class:return this.parseClass(this.startNode(),!1);case types$1._new:return this.parseNew();case types$1.backQuote:return this.parseTemplate();case types$1._import:return this.options.ecmaVersion>=11?this.parseExprImport(l):this.unexpected();default:return this.parseExprAtomDefault()}},pp$5.parseExprAtomDefault=function(){this.unexpected()},pp$5.parseExprImport=function(o){var e=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===types$1.parenL&&!o)return this.parseDynamicImport(e);if(this.type===types$1.dot){var l=this.startNodeAt(e.start,e.loc&&e.loc.start);return l.name="import",e.meta=this.finishNode(l,"Identifier"),this.parseImportMeta(e)}else this.unexpected()},pp$5.parseDynamicImport=function(o){if(this.next(),o.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(types$1.parenR)?o.options=null:(this.expect(types$1.comma),this.afterTrailingComma(types$1.parenR)?o.options=null:(o.options=this.parseMaybeAssign(),this.eat(types$1.parenR)||(this.expect(types$1.comma),this.afterTrailingComma(types$1.parenR)||this.unexpected())));else if(!this.eat(types$1.parenR)){var e=this.start;this.eat(types$1.comma)&&this.eat(types$1.parenR)?this.raiseRecoverable(e,"Trailing comma is not allowed in import()"):this.unexpected(e)}return this.finishNode(o,"ImportExpression")},pp$5.parseImportMeta=function(o){this.next();var e=this.containsEsc;return o.property=this.parseIdent(!0),o.property.name!=="meta"&&this.raiseRecoverable(o.property.start,"The only valid meta property for import is 'import.meta'"),e&&this.raiseRecoverable(o.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(o.start,"Cannot use 'import.meta' outside a module"),this.finishNode(o,"MetaProperty")},pp$5.parseLiteral=function(o){var e=this.startNode();return e.value=o,e.raw=this.input.slice(this.start,this.end),e.raw.charCodeAt(e.raw.length-1)===110&&(e.bigint=e.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(e,"Literal")},pp$5.parseParenExpression=function(){this.expect(types$1.parenL);var o=this.parseExpression();return this.expect(types$1.parenR),o},pp$5.shouldParseArrow=function(o){return!this.canInsertSemicolon()},pp$5.parseParenAndDistinguishExpression=function(o,e){var l=this.start,d=this.startLoc,p,b=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var R=this.start,I=this.startLoc,z=[],se=!0,le=!1,tn=new DestructuringErrors,an=this.yieldPos,sn=this.awaitPos,ln;for(this.yieldPos=0,this.awaitPos=0;this.type!==types$1.parenR;)if(se?se=!1:this.expect(types$1.comma),b&&this.afterTrailingComma(types$1.parenR,!0)){le=!0;break}else if(this.type===types$1.ellipsis){ln=this.start,z.push(this.parseParenItem(this.parseRestBinding())),this.type===types$1.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else z.push(this.parseMaybeAssign(!1,tn,this.parseParenItem));var un=this.lastTokEnd,pn=this.lastTokEndLoc;if(this.expect(types$1.parenR),o&&this.shouldParseArrow(z)&&this.eat(types$1.arrow))return this.checkPatternErrors(tn,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=an,this.awaitPos=sn,this.parseParenArrowList(l,d,z,e);(!z.length||le)&&this.unexpected(this.lastTokStart),ln&&this.unexpected(ln),this.checkExpressionErrors(tn,!0),this.yieldPos=an||this.yieldPos,this.awaitPos=sn||this.awaitPos,z.length>1?(p=this.startNodeAt(R,I),p.expressions=z,this.finishNodeAt(p,"SequenceExpression",un,pn)):p=z[0]}else p=this.parseParenExpression();if(this.options.preserveParens){var yn=this.startNodeAt(l,d);return yn.expression=p,this.finishNode(yn,"ParenthesizedExpression")}else return p},pp$5.parseParenItem=function(o){return o},pp$5.parseParenArrowList=function(o,e,l,d){return this.parseArrowExpression(this.startNodeAt(o,e),l,!1,d)};var empty$2=[];pp$5.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var o=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===types$1.dot){var e=this.startNodeAt(o.start,o.loc&&o.loc.start);e.name="new",o.meta=this.finishNode(e,"Identifier"),this.next();var l=this.containsEsc;return o.property=this.parseIdent(!0),o.property.name!=="target"&&this.raiseRecoverable(o.property.start,"The only valid meta property for new is 'new.target'"),l&&this.raiseRecoverable(o.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(o.start,"'new.target' can only be used in functions and class static block"),this.finishNode(o,"MetaProperty")}var d=this.start,p=this.startLoc;return o.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),d,p,!0,!1),this.eat(types$1.parenL)?o.arguments=this.parseExprList(types$1.parenR,this.options.ecmaVersion>=8,!1):o.arguments=empty$2,this.finishNode(o,"NewExpression")},pp$5.parseTemplateElement=function(o){var e=o.isTagged,l=this.startNode();return this.type===types$1.invalidTemplate?(e||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),l.value={raw:this.value.replace(/\r\n?/g,`
|
||
`),cooked:null}):l.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|
||
`),cooked:this.value},this.next(),l.tail=this.type===types$1.backQuote,this.finishNode(l,"TemplateElement")},pp$5.parseTemplate=function(o){o===void 0&&(o={});var e=o.isTagged;e===void 0&&(e=!1);var l=this.startNode();this.next(),l.expressions=[];var d=this.parseTemplateElement({isTagged:e});for(l.quasis=[d];!d.tail;)this.type===types$1.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(types$1.dollarBraceL),l.expressions.push(this.parseExpression()),this.expect(types$1.braceR),l.quasis.push(d=this.parseTemplateElement({isTagged:e}));return this.next(),this.finishNode(l,"TemplateLiteral")},pp$5.isAsyncProp=function(o){return!o.computed&&o.key.type==="Identifier"&&o.key.name==="async"&&(this.type===types$1.name||this.type===types$1.num||this.type===types$1.string||this.type===types$1.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===types$1.star)&&!lineBreak.test(this.input.slice(this.lastTokEnd,this.start))},pp$5.parseObj=function(o,e){var l=this.startNode(),d=!0,p={};for(l.properties=[],this.next();!this.eat(types$1.braceR);){if(d)d=!1;else if(this.expect(types$1.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(types$1.braceR))break;var b=this.parseProperty(o,e);o||this.checkPropClash(b,p,e),l.properties.push(b)}return this.finishNode(l,o?"ObjectPattern":"ObjectExpression")},pp$5.parseProperty=function(o,e){var l=this.startNode(),d,p,b,R;if(this.options.ecmaVersion>=9&&this.eat(types$1.ellipsis))return o?(l.argument=this.parseIdent(!1),this.type===types$1.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(l,"RestElement")):(l.argument=this.parseMaybeAssign(!1,e),this.type===types$1.comma&&e&&e.trailingComma<0&&(e.trailingComma=this.start),this.finishNode(l,"SpreadElement"));this.options.ecmaVersion>=6&&(l.method=!1,l.shorthand=!1,(o||e)&&(b=this.start,R=this.startLoc),o||(d=this.eat(types$1.star)));var I=this.containsEsc;return this.parsePropertyName(l),!o&&!I&&this.options.ecmaVersion>=8&&!d&&this.isAsyncProp(l)?(p=!0,d=this.options.ecmaVersion>=9&&this.eat(types$1.star),this.parsePropertyName(l)):p=!1,this.parsePropertyValue(l,o,d,p,b,R,e,I),this.finishNode(l,"Property")},pp$5.parseGetterSetter=function(o){o.kind=o.key.name,this.parsePropertyName(o),o.value=this.parseMethod(!1);var e=o.kind==="get"?0:1;if(o.value.params.length!==e){var l=o.value.start;o.kind==="get"?this.raiseRecoverable(l,"getter should have no params"):this.raiseRecoverable(l,"setter should have exactly one param")}else o.kind==="set"&&o.value.params[0].type==="RestElement"&&this.raiseRecoverable(o.value.params[0].start,"Setter cannot use rest params")},pp$5.parsePropertyValue=function(o,e,l,d,p,b,R,I){(l||d)&&this.type===types$1.colon&&this.unexpected(),this.eat(types$1.colon)?(o.value=e?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,R),o.kind="init"):this.options.ecmaVersion>=6&&this.type===types$1.parenL?(e&&this.unexpected(),o.kind="init",o.method=!0,o.value=this.parseMethod(l,d)):!e&&!I&&this.options.ecmaVersion>=5&&!o.computed&&o.key.type==="Identifier"&&(o.key.name==="get"||o.key.name==="set")&&this.type!==types$1.comma&&this.type!==types$1.braceR&&this.type!==types$1.eq?((l||d)&&this.unexpected(),this.parseGetterSetter(o)):this.options.ecmaVersion>=6&&!o.computed&&o.key.type==="Identifier"?((l||d)&&this.unexpected(),this.checkUnreserved(o.key),o.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=p),o.kind="init",e?o.value=this.parseMaybeDefault(p,b,this.copyNode(o.key)):this.type===types$1.eq&&R?(R.shorthandAssign<0&&(R.shorthandAssign=this.start),o.value=this.parseMaybeDefault(p,b,this.copyNode(o.key))):o.value=this.copyNode(o.key),o.shorthand=!0):this.unexpected()},pp$5.parsePropertyName=function(o){if(this.options.ecmaVersion>=6){if(this.eat(types$1.bracketL))return o.computed=!0,o.key=this.parseMaybeAssign(),this.expect(types$1.bracketR),o.key;o.computed=!1}return o.key=this.type===types$1.num||this.type===types$1.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")},pp$5.initFunction=function(o){o.id=null,this.options.ecmaVersion>=6&&(o.generator=o.expression=!1),this.options.ecmaVersion>=8&&(o.async=!1)},pp$5.parseMethod=function(o,e,l){var d=this.startNode(),p=this.yieldPos,b=this.awaitPos,R=this.awaitIdentPos;return this.initFunction(d),this.options.ecmaVersion>=6&&(d.generator=o),this.options.ecmaVersion>=8&&(d.async=!!e),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(functionFlags(e,d.generator)|SCOPE_SUPER|(l?SCOPE_DIRECT_SUPER:0)),this.expect(types$1.parenL),d.params=this.parseBindingList(types$1.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(d,!1,!0,!1),this.yieldPos=p,this.awaitPos=b,this.awaitIdentPos=R,this.finishNode(d,"FunctionExpression")},pp$5.parseArrowExpression=function(o,e,l,d){var p=this.yieldPos,b=this.awaitPos,R=this.awaitIdentPos;return this.enterScope(functionFlags(l,!1)|SCOPE_ARROW),this.initFunction(o),this.options.ecmaVersion>=8&&(o.async=!!l),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,o.params=this.toAssignableList(e,!0),this.parseFunctionBody(o,!0,!1,d),this.yieldPos=p,this.awaitPos=b,this.awaitIdentPos=R,this.finishNode(o,"ArrowFunctionExpression")},pp$5.parseFunctionBody=function(o,e,l,d){var p=e&&this.type!==types$1.braceL,b=this.strict,R=!1;if(p)o.body=this.parseMaybeAssign(d),o.expression=!0,this.checkParams(o,!1);else{var I=this.options.ecmaVersion>=7&&!this.isSimpleParamList(o.params);(!b||I)&&(R=this.strictDirective(this.end),R&&I&&this.raiseRecoverable(o.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var z=this.labels;this.labels=[],R&&(this.strict=!0),this.checkParams(o,!b&&!R&&!e&&!l&&this.isSimpleParamList(o.params)),this.strict&&o.id&&this.checkLValSimple(o.id,BIND_OUTSIDE),o.body=this.parseBlock(!1,void 0,R&&!b),o.expression=!1,this.adaptDirectivePrologue(o.body.body),this.labels=z}this.exitScope()},pp$5.isSimpleParamList=function(o){for(var e=0,l=o;e<l.length;e+=1){var d=l[e];if(d.type!=="Identifier")return!1}return!0},pp$5.checkParams=function(o,e){for(var l=Object.create(null),d=0,p=o.params;d<p.length;d+=1){var b=p[d];this.checkLValInnerPattern(b,BIND_VAR,e?null:l)}},pp$5.parseExprList=function(o,e,l,d){for(var p=[],b=!0;!this.eat(o);){if(b)b=!1;else if(this.expect(types$1.comma),e&&this.afterTrailingComma(o))break;var R=void 0;l&&this.type===types$1.comma?R=null:this.type===types$1.ellipsis?(R=this.parseSpread(d),d&&this.type===types$1.comma&&d.trailingComma<0&&(d.trailingComma=this.start)):R=this.parseMaybeAssign(!1,d),p.push(R)}return p},pp$5.checkUnreserved=function(o){var e=o.start,l=o.end,d=o.name;if(this.inGenerator&&d==="yield"&&this.raiseRecoverable(e,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&d==="await"&&this.raiseRecoverable(e,"Cannot use 'await' as identifier inside an async function"),this.currentThisScope().inClassFieldInit&&d==="arguments"&&this.raiseRecoverable(e,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(d==="arguments"||d==="await")&&this.raise(e,"Cannot use "+d+" in class static initialization block"),this.keywords.test(d)&&this.raise(e,"Unexpected keyword '"+d+"'"),!(this.options.ecmaVersion<6&&this.input.slice(e,l).indexOf("\\")!==-1)){var p=this.strict?this.reservedWordsStrict:this.reservedWords;p.test(d)&&(!this.inAsync&&d==="await"&&this.raiseRecoverable(e,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(e,"The keyword '"+d+"' is reserved"))}},pp$5.parseIdent=function(o){var e=this.parseIdentNode();return this.next(!!o),this.finishNode(e,"Identifier"),o||(this.checkUnreserved(e),e.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=e.start)),e},pp$5.parseIdentNode=function(){var o=this.startNode();return this.type===types$1.name?o.name=this.value:this.type.keyword?(o.name=this.type.keyword,(o.name==="class"||o.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=types$1.name):this.unexpected(),o},pp$5.parsePrivateIdent=function(){var o=this.startNode();return this.type===types$1.privateId?o.name=this.value:this.unexpected(),this.next(),this.finishNode(o,"PrivateIdentifier"),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(o.start,"Private field '#"+o.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(o)),o},pp$5.parseYield=function(o){this.yieldPos||(this.yieldPos=this.start);var e=this.startNode();return this.next(),this.type===types$1.semi||this.canInsertSemicolon()||this.type!==types$1.star&&!this.type.startsExpr?(e.delegate=!1,e.argument=null):(e.delegate=this.eat(types$1.star),e.argument=this.parseMaybeAssign(o)),this.finishNode(e,"YieldExpression")},pp$5.parseAwait=function(o){this.awaitPos||(this.awaitPos=this.start);var e=this.startNode();return this.next(),e.argument=this.parseMaybeUnary(null,!0,!1,o),this.finishNode(e,"AwaitExpression")};var pp$4=Parser$1.prototype;pp$4.raise=function(o,e){var l=getLineInfo(this.input,o);e+=" ("+l.line+":"+l.column+")";var d=new SyntaxError(e);throw d.pos=o,d.loc=l,d.raisedAt=this.pos,d},pp$4.raiseRecoverable=pp$4.raise,pp$4.curPosition=function(){if(this.options.locations)return new Position(this.curLine,this.pos-this.lineStart)};var pp$3=Parser$1.prototype,Scope=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[],this.inClassFieldInit=!1};pp$3.enterScope=function(o){this.scopeStack.push(new Scope(o))},pp$3.exitScope=function(){this.scopeStack.pop()},pp$3.treatFunctionsAsVarInScope=function(o){return o.flags&SCOPE_FUNCTION||!this.inModule&&o.flags&SCOPE_TOP},pp$3.declareName=function(o,e,l){var d=!1;if(e===BIND_LEXICAL){var p=this.currentScope();d=p.lexical.indexOf(o)>-1||p.functions.indexOf(o)>-1||p.var.indexOf(o)>-1,p.lexical.push(o),this.inModule&&p.flags&SCOPE_TOP&&delete this.undefinedExports[o]}else if(e===BIND_SIMPLE_CATCH){var b=this.currentScope();b.lexical.push(o)}else if(e===BIND_FUNCTION){var R=this.currentScope();this.treatFunctionsAsVar?d=R.lexical.indexOf(o)>-1:d=R.lexical.indexOf(o)>-1||R.var.indexOf(o)>-1,R.functions.push(o)}else for(var I=this.scopeStack.length-1;I>=0;--I){var z=this.scopeStack[I];if(z.lexical.indexOf(o)>-1&&!(z.flags&SCOPE_SIMPLE_CATCH&&z.lexical[0]===o)||!this.treatFunctionsAsVarInScope(z)&&z.functions.indexOf(o)>-1){d=!0;break}if(z.var.push(o),this.inModule&&z.flags&SCOPE_TOP&&delete this.undefinedExports[o],z.flags&SCOPE_VAR)break}d&&this.raiseRecoverable(l,"Identifier '"+o+"' has already been declared")},pp$3.checkLocalExport=function(o){this.scopeStack[0].lexical.indexOf(o.name)===-1&&this.scopeStack[0].var.indexOf(o.name)===-1&&(this.undefinedExports[o.name]=o)},pp$3.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},pp$3.currentVarScope=function(){for(var o=this.scopeStack.length-1;;o--){var e=this.scopeStack[o];if(e.flags&SCOPE_VAR)return e}},pp$3.currentThisScope=function(){for(var o=this.scopeStack.length-1;;o--){var e=this.scopeStack[o];if(e.flags&SCOPE_VAR&&!(e.flags&SCOPE_ARROW))return e}};var Node=function(e,l,d){this.type="",this.start=l,this.end=0,e.options.locations&&(this.loc=new SourceLocation(e,d)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[l,0])},pp$2=Parser$1.prototype;pp$2.startNode=function(){return new Node(this,this.start,this.startLoc)},pp$2.startNodeAt=function(o,e){return new Node(this,o,e)};function finishNodeAt(o,e,l,d){return o.type=e,o.end=l,this.options.locations&&(o.loc.end=d),this.options.ranges&&(o.range[1]=l),o}pp$2.finishNode=function(o,e){return finishNodeAt.call(this,o,e,this.lastTokEnd,this.lastTokEndLoc)},pp$2.finishNodeAt=function(o,e,l,d){return finishNodeAt.call(this,o,e,l,d)},pp$2.copyNode=function(o){var e=new Node(this,o.start,this.startLoc);for(var l in o)e[l]=o[l];return e};var scriptValuesAddedInUnicode="Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz",ecma9BinaryProperties="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",ecma10BinaryProperties=ecma9BinaryProperties+" Extended_Pictographic",ecma11BinaryProperties=ecma10BinaryProperties,ecma12BinaryProperties=ecma11BinaryProperties+" EBase EComp EMod EPres ExtPict",ecma13BinaryProperties=ecma12BinaryProperties,ecma14BinaryProperties=ecma13BinaryProperties,unicodeBinaryProperties={9:ecma9BinaryProperties,10:ecma10BinaryProperties,11:ecma11BinaryProperties,12:ecma12BinaryProperties,13:ecma13BinaryProperties,14:ecma14BinaryProperties},ecma14BinaryPropertiesOfStrings="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",unicodeBinaryPropertiesOfStrings={9:"",10:"",11:"",12:"",13:"",14:ecma14BinaryPropertiesOfStrings},unicodeGeneralCategoryValues="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",ecma9ScriptValues="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",ecma10ScriptValues=ecma9ScriptValues+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",ecma11ScriptValues=ecma10ScriptValues+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",ecma12ScriptValues=ecma11ScriptValues+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",ecma13ScriptValues=ecma12ScriptValues+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",ecma14ScriptValues=ecma13ScriptValues+" "+scriptValuesAddedInUnicode,unicodeScriptValues={9:ecma9ScriptValues,10:ecma10ScriptValues,11:ecma11ScriptValues,12:ecma12ScriptValues,13:ecma13ScriptValues,14:ecma14ScriptValues},data={};function buildUnicodeData(o){var e=data[o]={binary:wordsRegexp(unicodeBinaryProperties[o]+" "+unicodeGeneralCategoryValues),binaryOfStrings:wordsRegexp(unicodeBinaryPropertiesOfStrings[o]),nonBinary:{General_Category:wordsRegexp(unicodeGeneralCategoryValues),Script:wordsRegexp(unicodeScriptValues[o])}};e.nonBinary.Script_Extensions=e.nonBinary.Script,e.nonBinary.gc=e.nonBinary.General_Category,e.nonBinary.sc=e.nonBinary.Script,e.nonBinary.scx=e.nonBinary.Script_Extensions}for(var i$1=0,list$1=[9,10,11,12,13,14];i$1<list$1.length;i$1+=1){var ecmaVersion=list$1[i$1];buildUnicodeData(ecmaVersion)}var pp$1=Parser$1.prototype,BranchID=function(e,l){this.parent=e,this.base=l||this};BranchID.prototype.separatedFrom=function(e){for(var l=this;l;l=l.parent)for(var d=e;d;d=d.parent)if(l.base===d.base&&l!==d)return!0;return!1},BranchID.prototype.sibling=function(){return new BranchID(this.parent,this.base)};var RegExpValidationState=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":"")+(e.options.ecmaVersion>=13?"d":"")+(e.options.ecmaVersion>=15?"v":""),this.unicodeProperties=data[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};RegExpValidationState.prototype.reset=function(e,l,d){var p=d.indexOf("v")!==-1,b=d.indexOf("u")!==-1;this.start=e|0,this.source=l+"",this.flags=d,p&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=b&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=b&&this.parser.options.ecmaVersion>=9)},RegExpValidationState.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},RegExpValidationState.prototype.at=function(e,l){l===void 0&&(l=!1);var d=this.source,p=d.length;if(e>=p)return-1;var b=d.charCodeAt(e);if(!(l||this.switchU)||b<=55295||b>=57344||e+1>=p)return b;var R=d.charCodeAt(e+1);return R>=56320&&R<=57343?(b<<10)+R-56613888:b},RegExpValidationState.prototype.nextIndex=function(e,l){l===void 0&&(l=!1);var d=this.source,p=d.length;if(e>=p)return p;var b=d.charCodeAt(e),R;return!(l||this.switchU)||b<=55295||b>=57344||e+1>=p||(R=d.charCodeAt(e+1))<56320||R>57343?e+1:e+2},RegExpValidationState.prototype.current=function(e){return e===void 0&&(e=!1),this.at(this.pos,e)},RegExpValidationState.prototype.lookahead=function(e){return e===void 0&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},RegExpValidationState.prototype.advance=function(e){e===void 0&&(e=!1),this.pos=this.nextIndex(this.pos,e)},RegExpValidationState.prototype.eat=function(e,l){return l===void 0&&(l=!1),this.current(l)===e?(this.advance(l),!0):!1},RegExpValidationState.prototype.eatChars=function(e,l){l===void 0&&(l=!1);for(var d=this.pos,p=0,b=e;p<b.length;p+=1){var R=b[p],I=this.at(d,l);if(I===-1||I!==R)return!1;d=this.nextIndex(d,l)}return this.pos=d,!0},pp$1.validateRegExpFlags=function(o){for(var e=o.validFlags,l=o.flags,d=!1,p=!1,b=0;b<l.length;b++){var R=l.charAt(b);e.indexOf(R)===-1&&this.raise(o.start,"Invalid regular expression flag"),l.indexOf(R,b+1)>-1&&this.raise(o.start,"Duplicate regular expression flag"),R==="u"&&(d=!0),R==="v"&&(p=!0)}this.options.ecmaVersion>=15&&d&&p&&this.raise(o.start,"Invalid regular expression flag")};function hasProp(o){for(var e in o)return!0;return!1}pp$1.validateRegExpPattern=function(o){this.regexp_pattern(o),!o.switchN&&this.options.ecmaVersion>=9&&hasProp(o.groupNames)&&(o.switchN=!0,this.regexp_pattern(o))},pp$1.regexp_pattern=function(o){o.pos=0,o.lastIntValue=0,o.lastStringValue="",o.lastAssertionIsQuantifiable=!1,o.numCapturingParens=0,o.maxBackReference=0,o.groupNames=Object.create(null),o.backReferenceNames.length=0,o.branchID=null,this.regexp_disjunction(o),o.pos!==o.source.length&&(o.eat(41)&&o.raise("Unmatched ')'"),(o.eat(93)||o.eat(125))&&o.raise("Lone quantifier brackets")),o.maxBackReference>o.numCapturingParens&&o.raise("Invalid escape");for(var e=0,l=o.backReferenceNames;e<l.length;e+=1){var d=l[e];o.groupNames[d]||o.raise("Invalid named capture referenced")}},pp$1.regexp_disjunction=function(o){var e=this.options.ecmaVersion>=16;for(e&&(o.branchID=new BranchID(o.branchID,null)),this.regexp_alternative(o);o.eat(124);)e&&(o.branchID=o.branchID.sibling()),this.regexp_alternative(o);e&&(o.branchID=o.branchID.parent),this.regexp_eatQuantifier(o,!0)&&o.raise("Nothing to repeat"),o.eat(123)&&o.raise("Lone quantifier brackets")},pp$1.regexp_alternative=function(o){for(;o.pos<o.source.length&&this.regexp_eatTerm(o););},pp$1.regexp_eatTerm=function(o){return this.regexp_eatAssertion(o)?(o.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(o)&&o.switchU&&o.raise("Invalid quantifier"),!0):(o.switchU?this.regexp_eatAtom(o):this.regexp_eatExtendedAtom(o))?(this.regexp_eatQuantifier(o),!0):!1},pp$1.regexp_eatAssertion=function(o){var e=o.pos;if(o.lastAssertionIsQuantifiable=!1,o.eat(94)||o.eat(36))return!0;if(o.eat(92)){if(o.eat(66)||o.eat(98))return!0;o.pos=e}if(o.eat(40)&&o.eat(63)){var l=!1;if(this.options.ecmaVersion>=9&&(l=o.eat(60)),o.eat(61)||o.eat(33))return this.regexp_disjunction(o),o.eat(41)||o.raise("Unterminated group"),o.lastAssertionIsQuantifiable=!l,!0}return o.pos=e,!1},pp$1.regexp_eatQuantifier=function(o,e){return e===void 0&&(e=!1),this.regexp_eatQuantifierPrefix(o,e)?(o.eat(63),!0):!1},pp$1.regexp_eatQuantifierPrefix=function(o,e){return o.eat(42)||o.eat(43)||o.eat(63)||this.regexp_eatBracedQuantifier(o,e)},pp$1.regexp_eatBracedQuantifier=function(o,e){var l=o.pos;if(o.eat(123)){var d=0,p=-1;if(this.regexp_eatDecimalDigits(o)&&(d=o.lastIntValue,o.eat(44)&&this.regexp_eatDecimalDigits(o)&&(p=o.lastIntValue),o.eat(125)))return p!==-1&&p<d&&!e&&o.raise("numbers out of order in {} quantifier"),!0;o.switchU&&!e&&o.raise("Incomplete quantifier"),o.pos=l}return!1},pp$1.regexp_eatAtom=function(o){return this.regexp_eatPatternCharacters(o)||o.eat(46)||this.regexp_eatReverseSolidusAtomEscape(o)||this.regexp_eatCharacterClass(o)||this.regexp_eatUncapturingGroup(o)||this.regexp_eatCapturingGroup(o)},pp$1.regexp_eatReverseSolidusAtomEscape=function(o){var e=o.pos;if(o.eat(92)){if(this.regexp_eatAtomEscape(o))return!0;o.pos=e}return!1},pp$1.regexp_eatUncapturingGroup=function(o){var e=o.pos;if(o.eat(40)){if(o.eat(63)){if(this.options.ecmaVersion>=16){var l=this.regexp_eatModifiers(o),d=o.eat(45);if(l||d){for(var p=0;p<l.length;p++){var b=l.charAt(p);l.indexOf(b,p+1)>-1&&o.raise("Duplicate regular expression modifiers")}if(d){var R=this.regexp_eatModifiers(o);!l&&!R&&o.current()===58&&o.raise("Invalid regular expression modifiers");for(var I=0;I<R.length;I++){var z=R.charAt(I);(R.indexOf(z,I+1)>-1||l.indexOf(z)>-1)&&o.raise("Duplicate regular expression modifiers")}}}}if(o.eat(58)){if(this.regexp_disjunction(o),o.eat(41))return!0;o.raise("Unterminated group")}}o.pos=e}return!1},pp$1.regexp_eatCapturingGroup=function(o){if(o.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(o):o.current()===63&&o.raise("Invalid group"),this.regexp_disjunction(o),o.eat(41))return o.numCapturingParens+=1,!0;o.raise("Unterminated group")}return!1},pp$1.regexp_eatModifiers=function(o){for(var e="",l=0;(l=o.current())!==-1&&isRegularExpressionModifier(l);)e+=codePointToString(l),o.advance();return e};function isRegularExpressionModifier(o){return o===105||o===109||o===115}pp$1.regexp_eatExtendedAtom=function(o){return o.eat(46)||this.regexp_eatReverseSolidusAtomEscape(o)||this.regexp_eatCharacterClass(o)||this.regexp_eatUncapturingGroup(o)||this.regexp_eatCapturingGroup(o)||this.regexp_eatInvalidBracedQuantifier(o)||this.regexp_eatExtendedPatternCharacter(o)},pp$1.regexp_eatInvalidBracedQuantifier=function(o){return this.regexp_eatBracedQuantifier(o,!0)&&o.raise("Nothing to repeat"),!1},pp$1.regexp_eatSyntaxCharacter=function(o){var e=o.current();return isSyntaxCharacter(e)?(o.lastIntValue=e,o.advance(),!0):!1};function isSyntaxCharacter(o){return o===36||o>=40&&o<=43||o===46||o===63||o>=91&&o<=94||o>=123&&o<=125}pp$1.regexp_eatPatternCharacters=function(o){for(var e=o.pos,l=0;(l=o.current())!==-1&&!isSyntaxCharacter(l);)o.advance();return o.pos!==e},pp$1.regexp_eatExtendedPatternCharacter=function(o){var e=o.current();return e!==-1&&e!==36&&!(e>=40&&e<=43)&&e!==46&&e!==63&&e!==91&&e!==94&&e!==124?(o.advance(),!0):!1},pp$1.regexp_groupSpecifier=function(o){if(o.eat(63)){this.regexp_eatGroupName(o)||o.raise("Invalid group");var e=this.options.ecmaVersion>=16,l=o.groupNames[o.lastStringValue];if(l)if(e)for(var d=0,p=l;d<p.length;d+=1){var b=p[d];b.separatedFrom(o.branchID)||o.raise("Duplicate capture group name")}else o.raise("Duplicate capture group name");e?(l||(o.groupNames[o.lastStringValue]=[])).push(o.branchID):o.groupNames[o.lastStringValue]=!0}},pp$1.regexp_eatGroupName=function(o){if(o.lastStringValue="",o.eat(60)){if(this.regexp_eatRegExpIdentifierName(o)&&o.eat(62))return!0;o.raise("Invalid capture group name")}return!1},pp$1.regexp_eatRegExpIdentifierName=function(o){if(o.lastStringValue="",this.regexp_eatRegExpIdentifierStart(o)){for(o.lastStringValue+=codePointToString(o.lastIntValue);this.regexp_eatRegExpIdentifierPart(o);)o.lastStringValue+=codePointToString(o.lastIntValue);return!0}return!1},pp$1.regexp_eatRegExpIdentifierStart=function(o){var e=o.pos,l=this.options.ecmaVersion>=11,d=o.current(l);return o.advance(l),d===92&&this.regexp_eatRegExpUnicodeEscapeSequence(o,l)&&(d=o.lastIntValue),isRegExpIdentifierStart(d)?(o.lastIntValue=d,!0):(o.pos=e,!1)};function isRegExpIdentifierStart(o){return isIdentifierStart(o,!0)||o===36||o===95}pp$1.regexp_eatRegExpIdentifierPart=function(o){var e=o.pos,l=this.options.ecmaVersion>=11,d=o.current(l);return o.advance(l),d===92&&this.regexp_eatRegExpUnicodeEscapeSequence(o,l)&&(d=o.lastIntValue),isRegExpIdentifierPart(d)?(o.lastIntValue=d,!0):(o.pos=e,!1)};function isRegExpIdentifierPart(o){return isIdentifierChar(o,!0)||o===36||o===95||o===8204||o===8205}pp$1.regexp_eatAtomEscape=function(o){return this.regexp_eatBackReference(o)||this.regexp_eatCharacterClassEscape(o)||this.regexp_eatCharacterEscape(o)||o.switchN&&this.regexp_eatKGroupName(o)?!0:(o.switchU&&(o.current()===99&&o.raise("Invalid unicode escape"),o.raise("Invalid escape")),!1)},pp$1.regexp_eatBackReference=function(o){var e=o.pos;if(this.regexp_eatDecimalEscape(o)){var l=o.lastIntValue;if(o.switchU)return l>o.maxBackReference&&(o.maxBackReference=l),!0;if(l<=o.numCapturingParens)return!0;o.pos=e}return!1},pp$1.regexp_eatKGroupName=function(o){if(o.eat(107)){if(this.regexp_eatGroupName(o))return o.backReferenceNames.push(o.lastStringValue),!0;o.raise("Invalid named reference")}return!1},pp$1.regexp_eatCharacterEscape=function(o){return this.regexp_eatControlEscape(o)||this.regexp_eatCControlLetter(o)||this.regexp_eatZero(o)||this.regexp_eatHexEscapeSequence(o)||this.regexp_eatRegExpUnicodeEscapeSequence(o,!1)||!o.switchU&&this.regexp_eatLegacyOctalEscapeSequence(o)||this.regexp_eatIdentityEscape(o)},pp$1.regexp_eatCControlLetter=function(o){var e=o.pos;if(o.eat(99)){if(this.regexp_eatControlLetter(o))return!0;o.pos=e}return!1},pp$1.regexp_eatZero=function(o){return o.current()===48&&!isDecimalDigit(o.lookahead())?(o.lastIntValue=0,o.advance(),!0):!1},pp$1.regexp_eatControlEscape=function(o){var e=o.current();return e===116?(o.lastIntValue=9,o.advance(),!0):e===110?(o.lastIntValue=10,o.advance(),!0):e===118?(o.lastIntValue=11,o.advance(),!0):e===102?(o.lastIntValue=12,o.advance(),!0):e===114?(o.lastIntValue=13,o.advance(),!0):!1},pp$1.regexp_eatControlLetter=function(o){var e=o.current();return isControlLetter(e)?(o.lastIntValue=e%32,o.advance(),!0):!1};function isControlLetter(o){return o>=65&&o<=90||o>=97&&o<=122}pp$1.regexp_eatRegExpUnicodeEscapeSequence=function(o,e){e===void 0&&(e=!1);var l=o.pos,d=e||o.switchU;if(o.eat(117)){if(this.regexp_eatFixedHexDigits(o,4)){var p=o.lastIntValue;if(d&&p>=55296&&p<=56319){var b=o.pos;if(o.eat(92)&&o.eat(117)&&this.regexp_eatFixedHexDigits(o,4)){var R=o.lastIntValue;if(R>=56320&&R<=57343)return o.lastIntValue=(p-55296)*1024+(R-56320)+65536,!0}o.pos=b,o.lastIntValue=p}return!0}if(d&&o.eat(123)&&this.regexp_eatHexDigits(o)&&o.eat(125)&&isValidUnicode(o.lastIntValue))return!0;d&&o.raise("Invalid unicode escape"),o.pos=l}return!1};function isValidUnicode(o){return o>=0&&o<=1114111}pp$1.regexp_eatIdentityEscape=function(o){if(o.switchU)return this.regexp_eatSyntaxCharacter(o)?!0:o.eat(47)?(o.lastIntValue=47,!0):!1;var e=o.current();return e!==99&&(!o.switchN||e!==107)?(o.lastIntValue=e,o.advance(),!0):!1},pp$1.regexp_eatDecimalEscape=function(o){o.lastIntValue=0;var e=o.current();if(e>=49&&e<=57){do o.lastIntValue=10*o.lastIntValue+(e-48),o.advance();while((e=o.current())>=48&&e<=57);return!0}return!1};var CharSetNone=0,CharSetOk=1,CharSetString=2;pp$1.regexp_eatCharacterClassEscape=function(o){var e=o.current();if(isCharacterClassEscape(e))return o.lastIntValue=-1,o.advance(),CharSetOk;var l=!1;if(o.switchU&&this.options.ecmaVersion>=9&&((l=e===80)||e===112)){o.lastIntValue=-1,o.advance();var d;if(o.eat(123)&&(d=this.regexp_eatUnicodePropertyValueExpression(o))&&o.eat(125))return l&&d===CharSetString&&o.raise("Invalid property name"),d;o.raise("Invalid property name")}return CharSetNone};function isCharacterClassEscape(o){return o===100||o===68||o===115||o===83||o===119||o===87}pp$1.regexp_eatUnicodePropertyValueExpression=function(o){var e=o.pos;if(this.regexp_eatUnicodePropertyName(o)&&o.eat(61)){var l=o.lastStringValue;if(this.regexp_eatUnicodePropertyValue(o)){var d=o.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(o,l,d),CharSetOk}}if(o.pos=e,this.regexp_eatLoneUnicodePropertyNameOrValue(o)){var p=o.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(o,p)}return CharSetNone},pp$1.regexp_validateUnicodePropertyNameAndValue=function(o,e,l){hasOwn(o.unicodeProperties.nonBinary,e)||o.raise("Invalid property name"),o.unicodeProperties.nonBinary[e].test(l)||o.raise("Invalid property value")},pp$1.regexp_validateUnicodePropertyNameOrValue=function(o,e){if(o.unicodeProperties.binary.test(e))return CharSetOk;if(o.switchV&&o.unicodeProperties.binaryOfStrings.test(e))return CharSetString;o.raise("Invalid property name")},pp$1.regexp_eatUnicodePropertyName=function(o){var e=0;for(o.lastStringValue="";isUnicodePropertyNameCharacter(e=o.current());)o.lastStringValue+=codePointToString(e),o.advance();return o.lastStringValue!==""};function isUnicodePropertyNameCharacter(o){return isControlLetter(o)||o===95}pp$1.regexp_eatUnicodePropertyValue=function(o){var e=0;for(o.lastStringValue="";isUnicodePropertyValueCharacter(e=o.current());)o.lastStringValue+=codePointToString(e),o.advance();return o.lastStringValue!==""};function isUnicodePropertyValueCharacter(o){return isUnicodePropertyNameCharacter(o)||isDecimalDigit(o)}pp$1.regexp_eatLoneUnicodePropertyNameOrValue=function(o){return this.regexp_eatUnicodePropertyValue(o)},pp$1.regexp_eatCharacterClass=function(o){if(o.eat(91)){var e=o.eat(94),l=this.regexp_classContents(o);return o.eat(93)||o.raise("Unterminated character class"),e&&l===CharSetString&&o.raise("Negated character class may contain strings"),!0}return!1},pp$1.regexp_classContents=function(o){return o.current()===93?CharSetOk:o.switchV?this.regexp_classSetExpression(o):(this.regexp_nonEmptyClassRanges(o),CharSetOk)},pp$1.regexp_nonEmptyClassRanges=function(o){for(;this.regexp_eatClassAtom(o);){var e=o.lastIntValue;if(o.eat(45)&&this.regexp_eatClassAtom(o)){var l=o.lastIntValue;o.switchU&&(e===-1||l===-1)&&o.raise("Invalid character class"),e!==-1&&l!==-1&&e>l&&o.raise("Range out of order in character class")}}},pp$1.regexp_eatClassAtom=function(o){var e=o.pos;if(o.eat(92)){if(this.regexp_eatClassEscape(o))return!0;if(o.switchU){var l=o.current();(l===99||isOctalDigit(l))&&o.raise("Invalid class escape"),o.raise("Invalid escape")}o.pos=e}var d=o.current();return d!==93?(o.lastIntValue=d,o.advance(),!0):!1},pp$1.regexp_eatClassEscape=function(o){var e=o.pos;if(o.eat(98))return o.lastIntValue=8,!0;if(o.switchU&&o.eat(45))return o.lastIntValue=45,!0;if(!o.switchU&&o.eat(99)){if(this.regexp_eatClassControlLetter(o))return!0;o.pos=e}return this.regexp_eatCharacterClassEscape(o)||this.regexp_eatCharacterEscape(o)},pp$1.regexp_classSetExpression=function(o){var e=CharSetOk,l;if(!this.regexp_eatClassSetRange(o))if(l=this.regexp_eatClassSetOperand(o)){l===CharSetString&&(e=CharSetString);for(var d=o.pos;o.eatChars([38,38]);){if(o.current()!==38&&(l=this.regexp_eatClassSetOperand(o))){l!==CharSetString&&(e=CharSetOk);continue}o.raise("Invalid character in character class")}if(d!==o.pos)return e;for(;o.eatChars([45,45]);)this.regexp_eatClassSetOperand(o)||o.raise("Invalid character in character class");if(d!==o.pos)return e}else o.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(o)){if(l=this.regexp_eatClassSetOperand(o),!l)return e;l===CharSetString&&(e=CharSetString)}},pp$1.regexp_eatClassSetRange=function(o){var e=o.pos;if(this.regexp_eatClassSetCharacter(o)){var l=o.lastIntValue;if(o.eat(45)&&this.regexp_eatClassSetCharacter(o)){var d=o.lastIntValue;return l!==-1&&d!==-1&&l>d&&o.raise("Range out of order in character class"),!0}o.pos=e}return!1},pp$1.regexp_eatClassSetOperand=function(o){return this.regexp_eatClassSetCharacter(o)?CharSetOk:this.regexp_eatClassStringDisjunction(o)||this.regexp_eatNestedClass(o)},pp$1.regexp_eatNestedClass=function(o){var e=o.pos;if(o.eat(91)){var l=o.eat(94),d=this.regexp_classContents(o);if(o.eat(93))return l&&d===CharSetString&&o.raise("Negated character class may contain strings"),d;o.pos=e}if(o.eat(92)){var p=this.regexp_eatCharacterClassEscape(o);if(p)return p;o.pos=e}return null},pp$1.regexp_eatClassStringDisjunction=function(o){var e=o.pos;if(o.eatChars([92,113])){if(o.eat(123)){var l=this.regexp_classStringDisjunctionContents(o);if(o.eat(125))return l}else o.raise("Invalid escape");o.pos=e}return null},pp$1.regexp_classStringDisjunctionContents=function(o){for(var e=this.regexp_classString(o);o.eat(124);)this.regexp_classString(o)===CharSetString&&(e=CharSetString);return e},pp$1.regexp_classString=function(o){for(var e=0;this.regexp_eatClassSetCharacter(o);)e++;return e===1?CharSetOk:CharSetString},pp$1.regexp_eatClassSetCharacter=function(o){var e=o.pos;if(o.eat(92))return this.regexp_eatCharacterEscape(o)||this.regexp_eatClassSetReservedPunctuator(o)?!0:o.eat(98)?(o.lastIntValue=8,!0):(o.pos=e,!1);var l=o.current();return l<0||l===o.lookahead()&&isClassSetReservedDoublePunctuatorCharacter(l)||isClassSetSyntaxCharacter(l)?!1:(o.advance(),o.lastIntValue=l,!0)};function isClassSetReservedDoublePunctuatorCharacter(o){return o===33||o>=35&&o<=38||o>=42&&o<=44||o===46||o>=58&&o<=64||o===94||o===96||o===126}function isClassSetSyntaxCharacter(o){return o===40||o===41||o===45||o===47||o>=91&&o<=93||o>=123&&o<=125}pp$1.regexp_eatClassSetReservedPunctuator=function(o){var e=o.current();return isClassSetReservedPunctuator(e)?(o.lastIntValue=e,o.advance(),!0):!1};function isClassSetReservedPunctuator(o){return o===33||o===35||o===37||o===38||o===44||o===45||o>=58&&o<=62||o===64||o===96||o===126}pp$1.regexp_eatClassControlLetter=function(o){var e=o.current();return isDecimalDigit(e)||e===95?(o.lastIntValue=e%32,o.advance(),!0):!1},pp$1.regexp_eatHexEscapeSequence=function(o){var e=o.pos;if(o.eat(120)){if(this.regexp_eatFixedHexDigits(o,2))return!0;o.switchU&&o.raise("Invalid escape"),o.pos=e}return!1},pp$1.regexp_eatDecimalDigits=function(o){var e=o.pos,l=0;for(o.lastIntValue=0;isDecimalDigit(l=o.current());)o.lastIntValue=10*o.lastIntValue+(l-48),o.advance();return o.pos!==e};function isDecimalDigit(o){return o>=48&&o<=57}pp$1.regexp_eatHexDigits=function(o){var e=o.pos,l=0;for(o.lastIntValue=0;isHexDigit(l=o.current());)o.lastIntValue=16*o.lastIntValue+hexToInt(l),o.advance();return o.pos!==e};function isHexDigit(o){return o>=48&&o<=57||o>=65&&o<=70||o>=97&&o<=102}function hexToInt(o){return o>=65&&o<=70?10+(o-65):o>=97&&o<=102?10+(o-97):o-48}pp$1.regexp_eatLegacyOctalEscapeSequence=function(o){if(this.regexp_eatOctalDigit(o)){var e=o.lastIntValue;if(this.regexp_eatOctalDigit(o)){var l=o.lastIntValue;e<=3&&this.regexp_eatOctalDigit(o)?o.lastIntValue=e*64+l*8+o.lastIntValue:o.lastIntValue=e*8+l}else o.lastIntValue=e;return!0}return!1},pp$1.regexp_eatOctalDigit=function(o){var e=o.current();return isOctalDigit(e)?(o.lastIntValue=e-48,o.advance(),!0):(o.lastIntValue=0,!1)};function isOctalDigit(o){return o>=48&&o<=55}pp$1.regexp_eatFixedHexDigits=function(o,e){var l=o.pos;o.lastIntValue=0;for(var d=0;d<e;++d){var p=o.current();if(!isHexDigit(p))return o.pos=l,!1;o.lastIntValue=16*o.lastIntValue+hexToInt(p),o.advance()}return!0};var Token=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new SourceLocation(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},pp=Parser$1.prototype;pp.next=function(o){!o&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new Token(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},pp.getToken=function(){return this.next(),new Token(this)},typeof Symbol<"u"&&(pp[Symbol.iterator]=function(){var o=this;return{next:function(){var e=o.getToken();return{done:e.type===types$1.eof,value:e}}}}),pp.nextToken=function(){var o=this.curContext();if((!o||!o.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(types$1.eof);if(o.override)return o.override(this);this.readToken(this.fullCharCodeAtPos())},pp.readToken=function(o){return isIdentifierStart(o,this.options.ecmaVersion>=6)||o===92?this.readWord():this.getTokenFromCode(o)},pp.fullCharCodeAtPos=function(){var o=this.input.charCodeAt(this.pos);if(o<=55295||o>=56320)return o;var e=this.input.charCodeAt(this.pos+1);return e<=56319||e>=57344?o:(o<<10)+e-56613888},pp.skipBlockComment=function(){var o=this.options.onComment&&this.curPosition(),e=this.pos,l=this.input.indexOf("*/",this.pos+=2);if(l===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=l+2,this.options.locations)for(var d=void 0,p=e;(d=nextLineBreak(this.input,p,this.pos))>-1;)++this.curLine,p=this.lineStart=d;this.options.onComment&&this.options.onComment(!0,this.input.slice(e+2,l),e,this.pos,o,this.curPosition())},pp.skipLineComment=function(o){for(var e=this.pos,l=this.options.onComment&&this.curPosition(),d=this.input.charCodeAt(this.pos+=o);this.pos<this.input.length&&!isNewLine(d);)d=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(e+o,this.pos),e,this.pos,l,this.curPosition())},pp.skipSpace=function(){e:for(;this.pos<this.input.length;){var o=this.input.charCodeAt(this.pos);switch(o){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(o>8&&o<14||o>=5760&&nonASCIIwhitespace.test(String.fromCharCode(o)))++this.pos;else break e}}},pp.finishToken=function(o,e){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var l=this.type;this.type=o,this.value=e,this.updateContext(l)},pp.readToken_dot=function(){var o=this.input.charCodeAt(this.pos+1);if(o>=48&&o<=57)return this.readNumber(!0);var e=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&o===46&&e===46?(this.pos+=3,this.finishToken(types$1.ellipsis)):(++this.pos,this.finishToken(types$1.dot))},pp.readToken_slash=function(){var o=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):o===61?this.finishOp(types$1.assign,2):this.finishOp(types$1.slash,1)},pp.readToken_mult_modulo_exp=function(o){var e=this.input.charCodeAt(this.pos+1),l=1,d=o===42?types$1.star:types$1.modulo;return this.options.ecmaVersion>=7&&o===42&&e===42&&(++l,d=types$1.starstar,e=this.input.charCodeAt(this.pos+2)),e===61?this.finishOp(types$1.assign,l+1):this.finishOp(d,l)},pp.readToken_pipe_amp=function(o){var e=this.input.charCodeAt(this.pos+1);if(e===o){if(this.options.ecmaVersion>=12){var l=this.input.charCodeAt(this.pos+2);if(l===61)return this.finishOp(types$1.assign,3)}return this.finishOp(o===124?types$1.logicalOR:types$1.logicalAND,2)}return e===61?this.finishOp(types$1.assign,2):this.finishOp(o===124?types$1.bitwiseOR:types$1.bitwiseAND,1)},pp.readToken_caret=function(){var o=this.input.charCodeAt(this.pos+1);return o===61?this.finishOp(types$1.assign,2):this.finishOp(types$1.bitwiseXOR,1)},pp.readToken_plus_min=function(o){var e=this.input.charCodeAt(this.pos+1);return e===o?e===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||lineBreak.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(types$1.incDec,2):e===61?this.finishOp(types$1.assign,2):this.finishOp(types$1.plusMin,1)},pp.readToken_lt_gt=function(o){var e=this.input.charCodeAt(this.pos+1),l=1;return e===o?(l=o===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+l)===61?this.finishOp(types$1.assign,l+1):this.finishOp(types$1.bitShift,l)):e===33&&o===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(e===61&&(l=2),this.finishOp(types$1.relational,l))},pp.readToken_eq_excl=function(o){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(types$1.equality,this.input.charCodeAt(this.pos+2)===61?3:2):o===61&&e===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(types$1.arrow)):this.finishOp(o===61?types$1.eq:types$1.prefix,1)},pp.readToken_question=function(){var o=this.options.ecmaVersion;if(o>=11){var e=this.input.charCodeAt(this.pos+1);if(e===46){var l=this.input.charCodeAt(this.pos+2);if(l<48||l>57)return this.finishOp(types$1.questionDot,2)}if(e===63){if(o>=12){var d=this.input.charCodeAt(this.pos+2);if(d===61)return this.finishOp(types$1.assign,3)}return this.finishOp(types$1.coalesce,2)}}return this.finishOp(types$1.question,1)},pp.readToken_numberSign=function(){var o=this.options.ecmaVersion,e=35;if(o>=13&&(++this.pos,e=this.fullCharCodeAtPos(),isIdentifierStart(e,!0)||e===92))return this.finishToken(types$1.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+codePointToString(e)+"'")},pp.getTokenFromCode=function(o){switch(o){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(types$1.parenL);case 41:return++this.pos,this.finishToken(types$1.parenR);case 59:return++this.pos,this.finishToken(types$1.semi);case 44:return++this.pos,this.finishToken(types$1.comma);case 91:return++this.pos,this.finishToken(types$1.bracketL);case 93:return++this.pos,this.finishToken(types$1.bracketR);case 123:return++this.pos,this.finishToken(types$1.braceL);case 125:return++this.pos,this.finishToken(types$1.braceR);case 58:return++this.pos,this.finishToken(types$1.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(types$1.backQuote);case 48:var e=this.input.charCodeAt(this.pos+1);if(e===120||e===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(e===111||e===79)return this.readRadixNumber(8);if(e===98||e===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(o);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(o);case 124:case 38:return this.readToken_pipe_amp(o);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(o);case 60:case 62:return this.readToken_lt_gt(o);case 61:case 33:return this.readToken_eq_excl(o);case 63:return this.readToken_question();case 126:return this.finishOp(types$1.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+codePointToString(o)+"'")},pp.finishOp=function(o,e){var l=this.input.slice(this.pos,this.pos+e);return this.pos+=e,this.finishToken(o,l)},pp.readRegexp=function(){for(var o,e,l=this.pos;;){this.pos>=this.input.length&&this.raise(l,"Unterminated regular expression");var d=this.input.charAt(this.pos);if(lineBreak.test(d)&&this.raise(l,"Unterminated regular expression"),o)o=!1;else{if(d==="[")e=!0;else if(d==="]"&&e)e=!1;else if(d==="/"&&!e)break;o=d==="\\"}++this.pos}var p=this.input.slice(l,this.pos);++this.pos;var b=this.pos,R=this.readWord1();this.containsEsc&&this.unexpected(b);var I=this.regexpState||(this.regexpState=new RegExpValidationState(this));I.reset(l,p,R),this.validateRegExpFlags(I),this.validateRegExpPattern(I);var z=null;try{z=new RegExp(p,R)}catch{}return this.finishToken(types$1.regexp,{pattern:p,flags:R,value:z})},pp.readInt=function(o,e,l){for(var d=this.options.ecmaVersion>=12&&e===void 0,p=l&&this.input.charCodeAt(this.pos)===48,b=this.pos,R=0,I=0,z=0,se=e??1/0;z<se;++z,++this.pos){var le=this.input.charCodeAt(this.pos),tn=void 0;if(d&&le===95){p&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),I===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),z===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),I=le;continue}if(le>=97?tn=le-97+10:le>=65?tn=le-65+10:le>=48&&le<=57?tn=le-48:tn=1/0,tn>=o)break;I=le,R=R*o+tn}return d&&I===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===b||e!=null&&this.pos-b!==e?null:R};function stringToNumber(o,e){return e?parseInt(o,8):parseFloat(o.replace(/_/g,""))}function stringToBigInt(o){return typeof BigInt!="function"?null:BigInt(o.replace(/_/g,""))}pp.readRadixNumber=function(o){var e=this.pos;this.pos+=2;var l=this.readInt(o);return l==null&&this.raise(this.start+2,"Expected number in radix "+o),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(l=stringToBigInt(this.input.slice(e,this.pos)),++this.pos):isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(types$1.num,l)},pp.readNumber=function(o){var e=this.pos;!o&&this.readInt(10,void 0,!0)===null&&this.raise(e,"Invalid number");var l=this.pos-e>=2&&this.input.charCodeAt(e)===48;l&&this.strict&&this.raise(e,"Invalid number");var d=this.input.charCodeAt(this.pos);if(!l&&!o&&this.options.ecmaVersion>=11&&d===110){var p=stringToBigInt(this.input.slice(e,this.pos));return++this.pos,isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(types$1.num,p)}l&&/[89]/.test(this.input.slice(e,this.pos))&&(l=!1),d===46&&!l&&(++this.pos,this.readInt(10),d=this.input.charCodeAt(this.pos)),(d===69||d===101)&&!l&&(d=this.input.charCodeAt(++this.pos),(d===43||d===45)&&++this.pos,this.readInt(10)===null&&this.raise(e,"Invalid number")),isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var b=stringToNumber(this.input.slice(e,this.pos),l);return this.finishToken(types$1.num,b)},pp.readCodePoint=function(){var o=this.input.charCodeAt(this.pos),e;if(o===123){this.options.ecmaVersion<6&&this.unexpected();var l=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(l,"Code point out of bounds")}else e=this.readHexChar(4);return e},pp.readString=function(o){for(var e="",l=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var d=this.input.charCodeAt(this.pos);if(d===o)break;d===92?(e+=this.input.slice(l,this.pos),e+=this.readEscapedChar(!1),l=this.pos):d===8232||d===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(isNewLine(d)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return e+=this.input.slice(l,this.pos++),this.finishToken(types$1.string,e)};var INVALID_TEMPLATE_ESCAPE_ERROR={};pp.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(o){if(o===INVALID_TEMPLATE_ESCAPE_ERROR)this.readInvalidTemplateToken();else throw o}this.inTemplateElement=!1},pp.invalidStringToken=function(o,e){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw INVALID_TEMPLATE_ESCAPE_ERROR;this.raise(o,e)},pp.readTmplToken=function(){for(var o="",e=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var l=this.input.charCodeAt(this.pos);if(l===96||l===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===types$1.template||this.type===types$1.invalidTemplate)?l===36?(this.pos+=2,this.finishToken(types$1.dollarBraceL)):(++this.pos,this.finishToken(types$1.backQuote)):(o+=this.input.slice(e,this.pos),this.finishToken(types$1.template,o));if(l===92)o+=this.input.slice(e,this.pos),o+=this.readEscapedChar(!0),e=this.pos;else if(isNewLine(l)){switch(o+=this.input.slice(e,this.pos),++this.pos,l){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:o+=`
|
||
`;break;default:o+=String.fromCharCode(l);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),e=this.pos}else++this.pos}},pp.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(types$1.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":this.input[this.pos+1]===`
|
||
`&&++this.pos;case`
|
||
`:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")},pp.readEscapedChar=function(o){var e=this.input.charCodeAt(++this.pos);switch(++this.pos,e){case 110:return`
|
||
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return codePointToString(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),o){var l=this.pos-1;this.invalidStringToken(l,"Invalid escape sequence in template string")}default:if(e>=48&&e<=55){var d=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],p=parseInt(d,8);return p>255&&(d=d.slice(0,-1),p=parseInt(d,8)),this.pos+=d.length-1,e=this.input.charCodeAt(this.pos),(d!=="0"||e===56||e===57)&&(this.strict||o)&&this.invalidStringToken(this.pos-1-d.length,o?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(p)}return isNewLine(e)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(e)}},pp.readHexChar=function(o){var e=this.pos,l=this.readInt(16,o);return l===null&&this.invalidStringToken(e,"Bad character escape sequence"),l},pp.readWord1=function(){this.containsEsc=!1;for(var o="",e=!0,l=this.pos,d=this.options.ecmaVersion>=6;this.pos<this.input.length;){var p=this.fullCharCodeAtPos();if(isIdentifierChar(p,d))this.pos+=p<=65535?1:2;else if(p===92){this.containsEsc=!0,o+=this.input.slice(l,this.pos);var b=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var R=this.readCodePoint();(e?isIdentifierStart:isIdentifierChar)(R,d)||this.invalidStringToken(b,"Invalid Unicode escape"),o+=codePointToString(R),l=this.pos}else break;e=!1}return o+this.input.slice(l,this.pos)},pp.readWord=function(){var o=this.readWord1(),e=types$1.name;return this.keywords.test(o)&&(e=keywords$2[o]),this.finishToken(e,o)};var version$1="8.14.0";Parser$1.acorn={Parser:Parser$1,version:version$1,defaultOptions,Position,SourceLocation,getLineInfo,Node,TokenType,tokTypes:types$1,keywordTypes:keywords$2,TokContext,tokContexts:types$2,isIdentifierChar,isIdentifierStart,Token,isNewLine,lineBreak,lineBreakG,nonASCIIwhitespace};function parse$6(o,e){return Parser$1.parse(o,e)}var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}function getAugmentedNamespace(o){if(o.__esModule)return o;var e=o.default;if(typeof e=="function"){var l=function d(){return this instanceof d?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};l.prototype=e.prototype}else l={};return Object.defineProperty(l,"__esModule",{value:!0}),Object.keys(o).forEach(function(d){var p=Object.getOwnPropertyDescriptor(o,d);Object.defineProperty(l,d,p.get?p:{enumerable:!0,get:function(){return o[d]}})}),l}var escodegen$1={},estraverse={},hasRequiredEstraverse;function requireEstraverse(){return hasRequiredEstraverse||(hasRequiredEstraverse=1,function(o){(function e(l){var d,p,b,R,I,z;function se(bn){var Sn={},An,Dn;for(An in bn)bn.hasOwnProperty(An)&&(Dn=bn[An],typeof Dn=="object"&&Dn!==null?Sn[An]=se(Dn):Sn[An]=Dn);return Sn}function le(bn,Sn){var An,Dn,Bn,Nn;for(Dn=bn.length,Bn=0;Dn;)An=Dn>>>1,Nn=Bn+An,Sn(bn[Nn])?Dn=An:(Bn=Nn+1,Dn-=An+1);return Bn}d={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ChainExpression:"ChainExpression",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportExpression:"ImportExpression",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",PrivateIdentifier:"PrivateIdentifier",Program:"Program",Property:"Property",PropertyDefinition:"PropertyDefinition",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},b={AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportAllDeclaration:["source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportExpression:["source"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],Super:[],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},R={},I={},z={},p={Break:R,Skip:I,Remove:z};function tn(bn,Sn){this.parent=bn,this.key=Sn}tn.prototype.replace=function(Sn){this.parent[this.key]=Sn},tn.prototype.remove=function(){return Array.isArray(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)};function an(bn,Sn,An,Dn){this.node=bn,this.path=Sn,this.wrap=An,this.ref=Dn}function sn(){}sn.prototype.path=function(){var Sn,An,Dn,Bn,Nn,Qn;function Zn(Vn,qn){if(Array.isArray(qn))for(Dn=0,Bn=qn.length;Dn<Bn;++Dn)Vn.push(qn[Dn]);else Vn.push(qn)}if(!this.__current.path)return null;for(Nn=[],Sn=2,An=this.__leavelist.length;Sn<An;++Sn)Qn=this.__leavelist[Sn],Zn(Nn,Qn.path);return Zn(Nn,this.__current.path),Nn},sn.prototype.type=function(){var bn=this.current();return bn.type||this.__current.wrap},sn.prototype.parents=function(){var Sn,An,Dn;for(Dn=[],Sn=1,An=this.__leavelist.length;Sn<An;++Sn)Dn.push(this.__leavelist[Sn].node);return Dn},sn.prototype.current=function(){return this.__current.node},sn.prototype.__execute=function(Sn,An){var Dn,Bn;return Bn=void 0,Dn=this.__current,this.__current=An,this.__state=null,Sn&&(Bn=Sn.call(this,An.node,this.__leavelist[this.__leavelist.length-1].node)),this.__current=Dn,Bn},sn.prototype.notify=function(Sn){this.__state=Sn},sn.prototype.skip=function(){this.notify(I)},sn.prototype.break=function(){this.notify(R)},sn.prototype.remove=function(){this.notify(z)},sn.prototype.__initialize=function(bn,Sn){this.visitor=Sn,this.root=bn,this.__worklist=[],this.__leavelist=[],this.__current=null,this.__state=null,this.__fallback=null,Sn.fallback==="iteration"?this.__fallback=Object.keys:typeof Sn.fallback=="function"&&(this.__fallback=Sn.fallback),this.__keys=b,Sn.keys&&(this.__keys=Object.assign(Object.create(this.__keys),Sn.keys))};function ln(bn){return bn==null?!1:typeof bn=="object"&&typeof bn.type=="string"}function un(bn,Sn){return(bn===d.ObjectExpression||bn===d.ObjectPattern)&&Sn==="properties"}function pn(bn,Sn){for(var An=bn.length-1;An>=0;--An)if(bn[An].node===Sn)return!0;return!1}sn.prototype.traverse=function(Sn,An){var Dn,Bn,Nn,Qn,Zn,Vn,qn,ia,ra,aa,jn,ka;for(this.__initialize(Sn,An),ka={},Dn=this.__worklist,Bn=this.__leavelist,Dn.push(new an(Sn,null,null,null)),Bn.push(new an(null,null,null,null));Dn.length;){if(Nn=Dn.pop(),Nn===ka){if(Nn=Bn.pop(),Vn=this.__execute(An.leave,Nn),this.__state===R||Vn===R)return;continue}if(Nn.node){if(Vn=this.__execute(An.enter,Nn),this.__state===R||Vn===R)return;if(Dn.push(ka),Bn.push(Nn),this.__state===I||Vn===I)continue;if(Qn=Nn.node,Zn=Qn.type||Nn.wrap,aa=this.__keys[Zn],!aa)if(this.__fallback)aa=this.__fallback(Qn);else throw new Error("Unknown node type "+Zn+".");for(ia=aa.length;(ia-=1)>=0;)if(qn=aa[ia],jn=Qn[qn],!!jn){if(Array.isArray(jn)){for(ra=jn.length;(ra-=1)>=0;)if(jn[ra]&&!pn(Bn,jn[ra])){if(un(Zn,aa[ia]))Nn=new an(jn[ra],[qn,ra],"Property",null);else if(ln(jn[ra]))Nn=new an(jn[ra],[qn,ra],null,null);else continue;Dn.push(Nn)}}else if(ln(jn)){if(pn(Bn,jn))continue;Dn.push(new an(jn,qn,null,null))}}}}},sn.prototype.replace=function(Sn,An){var Dn,Bn,Nn,Qn,Zn,Vn,qn,ia,ra,aa,jn,ka,Aa;function Na(Kn){var Ea,qa,va,Oa;if(Kn.ref.remove()){for(qa=Kn.ref.key,Oa=Kn.ref.parent,Ea=Dn.length;Ea--;)if(va=Dn[Ea],va.ref&&va.ref.parent===Oa){if(va.ref.key<qa)break;--va.ref.key}}}for(this.__initialize(Sn,An),jn={},Dn=this.__worklist,Bn=this.__leavelist,ka={root:Sn},Vn=new an(Sn,null,null,new tn(ka,"root")),Dn.push(Vn),Bn.push(Vn);Dn.length;){if(Vn=Dn.pop(),Vn===jn){if(Vn=Bn.pop(),Zn=this.__execute(An.leave,Vn),Zn!==void 0&&Zn!==R&&Zn!==I&&Zn!==z&&Vn.ref.replace(Zn),(this.__state===z||Zn===z)&&Na(Vn),this.__state===R||Zn===R)return ka.root;continue}if(Zn=this.__execute(An.enter,Vn),Zn!==void 0&&Zn!==R&&Zn!==I&&Zn!==z&&(Vn.ref.replace(Zn),Vn.node=Zn),(this.__state===z||Zn===z)&&(Na(Vn),Vn.node=null),this.__state===R||Zn===R)return ka.root;if(Nn=Vn.node,!!Nn&&(Dn.push(jn),Bn.push(Vn),!(this.__state===I||Zn===I))){if(Qn=Nn.type||Vn.wrap,ra=this.__keys[Qn],!ra)if(this.__fallback)ra=this.__fallback(Nn);else throw new Error("Unknown node type "+Qn+".");for(qn=ra.length;(qn-=1)>=0;)if(Aa=ra[qn],aa=Nn[Aa],!!aa)if(Array.isArray(aa)){for(ia=aa.length;(ia-=1)>=0;)if(aa[ia]){if(un(Qn,ra[qn]))Vn=new an(aa[ia],[Aa,ia],"Property",new tn(aa,ia));else if(ln(aa[ia]))Vn=new an(aa[ia],[Aa,ia],null,new tn(aa,ia));else continue;Dn.push(Vn)}}else ln(aa)&&Dn.push(new an(aa,Aa,null,new tn(Nn,Aa)))}}return ka.root};function yn(bn,Sn){var An=new sn;return An.traverse(bn,Sn)}function _n(bn,Sn){var An=new sn;return An.replace(bn,Sn)}function Pn(bn,Sn){var An;return An=le(Sn,function(Bn){return Bn.range[0]>bn.range[0]}),bn.extendedRange=[bn.range[0],bn.range[1]],An!==Sn.length&&(bn.extendedRange[1]=Sn[An].range[0]),An-=1,An>=0&&(bn.extendedRange[0]=Sn[An].range[1]),bn}function vn(bn,Sn,An){var Dn=[],Bn,Nn,Qn,Zn;if(!bn.range)throw new Error("attachComments needs range information");if(!An.length){if(Sn.length){for(Qn=0,Nn=Sn.length;Qn<Nn;Qn+=1)Bn=se(Sn[Qn]),Bn.extendedRange=[0,bn.range[0]],Dn.push(Bn);bn.leadingComments=Dn}return bn}for(Qn=0,Nn=Sn.length;Qn<Nn;Qn+=1)Dn.push(Pn(se(Sn[Qn]),An));return Zn=0,yn(bn,{enter:function(Vn){for(var qn;Zn<Dn.length&&(qn=Dn[Zn],!(qn.extendedRange[1]>Vn.range[0]));)qn.extendedRange[1]===Vn.range[0]?(Vn.leadingComments||(Vn.leadingComments=[]),Vn.leadingComments.push(qn),Dn.splice(Zn,1)):Zn+=1;if(Zn===Dn.length)return p.Break;if(Dn[Zn].extendedRange[0]>Vn.range[1])return p.Skip}}),Zn=0,yn(bn,{leave:function(Vn){for(var qn;Zn<Dn.length&&(qn=Dn[Zn],!(Vn.range[1]<qn.extendedRange[0]));)Vn.range[1]===qn.extendedRange[0]?(Vn.trailingComments||(Vn.trailingComments=[]),Vn.trailingComments.push(qn),Dn.splice(Zn,1)):Zn+=1;if(Zn===Dn.length)return p.Break;if(Dn[Zn].extendedRange[0]>Vn.range[1])return p.Skip}}),bn}return l.Syntax=d,l.traverse=yn,l.replace=_n,l.attachComments=vn,l.VisitorKeys=b,l.VisitorOption=p,l.Controller=sn,l.cloneEnvironment=function(){return e({})},l})(o)}(estraverse)),estraverse}var utils={},ast={exports:{}},hasRequiredAst;function requireAst(){return hasRequiredAst||(hasRequiredAst=1,function(){function o(R){if(R==null)return!1;switch(R.type){case"ArrayExpression":case"AssignmentExpression":case"BinaryExpression":case"CallExpression":case"ConditionalExpression":case"FunctionExpression":case"Identifier":case"Literal":case"LogicalExpression":case"MemberExpression":case"NewExpression":case"ObjectExpression":case"SequenceExpression":case"ThisExpression":case"UnaryExpression":case"UpdateExpression":return!0}return!1}function e(R){if(R==null)return!1;switch(R.type){case"DoWhileStatement":case"ForInStatement":case"ForStatement":case"WhileStatement":return!0}return!1}function l(R){if(R==null)return!1;switch(R.type){case"BlockStatement":case"BreakStatement":case"ContinueStatement":case"DebuggerStatement":case"DoWhileStatement":case"EmptyStatement":case"ExpressionStatement":case"ForInStatement":case"ForStatement":case"IfStatement":case"LabeledStatement":case"ReturnStatement":case"SwitchStatement":case"ThrowStatement":case"TryStatement":case"VariableDeclaration":case"WhileStatement":case"WithStatement":return!0}return!1}function d(R){return l(R)||R!=null&&R.type==="FunctionDeclaration"}function p(R){switch(R.type){case"IfStatement":return R.alternate!=null?R.alternate:R.consequent;case"LabeledStatement":case"ForStatement":case"ForInStatement":case"WhileStatement":case"WithStatement":return R.body}return null}function b(R){var I;if(R.type!=="IfStatement"||R.alternate==null)return!1;I=R.consequent;do{if(I.type==="IfStatement"&&I.alternate==null)return!0;I=p(I)}while(I);return!1}ast.exports={isExpression:o,isStatement:l,isIterationStatement:e,isSourceElement:d,isProblematicIfStatement:b,trailingStatement:p}}()),ast.exports}var code$1={exports:{}},hasRequiredCode;function requireCode(){return hasRequiredCode||(hasRequiredCode=1,function(){var o,e,l,d,p,b;e={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,NonAsciiIdentifierPart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u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\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/},o={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B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-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF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\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\u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uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};function R(pn){return 48<=pn&&pn<=57}function I(pn){return 48<=pn&&pn<=57||97<=pn&&pn<=102||65<=pn&&pn<=70}function z(pn){return pn>=48&&pn<=55}l=[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function se(pn){return pn===32||pn===9||pn===11||pn===12||pn===160||pn>=5760&&l.indexOf(pn)>=0}function le(pn){return pn===10||pn===13||pn===8232||pn===8233}function tn(pn){if(pn<=65535)return String.fromCharCode(pn);var yn=String.fromCharCode(Math.floor((pn-65536)/1024)+55296),_n=String.fromCharCode((pn-65536)%1024+56320);return yn+_n}for(d=new Array(128),b=0;b<128;++b)d[b]=b>=97&&b<=122||b>=65&&b<=90||b===36||b===95;for(p=new Array(128),b=0;b<128;++b)p[b]=b>=97&&b<=122||b>=65&&b<=90||b>=48&&b<=57||b===36||b===95;function an(pn){return pn<128?d[pn]:e.NonAsciiIdentifierStart.test(tn(pn))}function sn(pn){return pn<128?p[pn]:e.NonAsciiIdentifierPart.test(tn(pn))}function ln(pn){return pn<128?d[pn]:o.NonAsciiIdentifierStart.test(tn(pn))}function un(pn){return pn<128?p[pn]:o.NonAsciiIdentifierPart.test(tn(pn))}code$1.exports={isDecimalDigit:R,isHexDigit:I,isOctalDigit:z,isWhiteSpace:se,isLineTerminator:le,isIdentifierStartES5:an,isIdentifierPartES5:sn,isIdentifierStartES6:ln,isIdentifierPartES6:un}}()),code$1.exports}var keyword$1={exports:{}},hasRequiredKeyword;function requireKeyword(){return hasRequiredKeyword||(hasRequiredKeyword=1,function(){var o=requireCode();function e(an){switch(an){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"let":return!0;default:return!1}}function l(an,sn){return!sn&&an==="yield"?!1:d(an,sn)}function d(an,sn){if(sn&&e(an))return!0;switch(an.length){case 2:return an==="if"||an==="in"||an==="do";case 3:return an==="var"||an==="for"||an==="new"||an==="try";case 4:return an==="this"||an==="else"||an==="case"||an==="void"||an==="with"||an==="enum";case 5:return an==="while"||an==="break"||an==="catch"||an==="throw"||an==="const"||an==="yield"||an==="class"||an==="super";case 6:return an==="return"||an==="typeof"||an==="delete"||an==="switch"||an==="export"||an==="import";case 7:return an==="default"||an==="finally"||an==="extends";case 8:return an==="function"||an==="continue"||an==="debugger";case 10:return an==="instanceof";default:return!1}}function p(an,sn){return an==="null"||an==="true"||an==="false"||l(an,sn)}function b(an,sn){return an==="null"||an==="true"||an==="false"||d(an,sn)}function R(an){return an==="eval"||an==="arguments"}function I(an){var sn,ln,un;if(an.length===0||(un=an.charCodeAt(0),!o.isIdentifierStartES5(un)))return!1;for(sn=1,ln=an.length;sn<ln;++sn)if(un=an.charCodeAt(sn),!o.isIdentifierPartES5(un))return!1;return!0}function z(an,sn){return(an-55296)*1024+(sn-56320)+65536}function se(an){var sn,ln,un,pn,yn;if(an.length===0)return!1;for(yn=o.isIdentifierStartES6,sn=0,ln=an.length;sn<ln;++sn){if(un=an.charCodeAt(sn),55296<=un&&un<=56319){if(++sn,sn>=ln||(pn=an.charCodeAt(sn),!(56320<=pn&&pn<=57343)))return!1;un=z(un,pn)}if(!yn(un))return!1;yn=o.isIdentifierPartES6}return!0}function le(an,sn){return I(an)&&!p(an,sn)}function tn(an,sn){return se(an)&&!b(an,sn)}keyword$1.exports={isKeywordES5:l,isKeywordES6:d,isReservedWordES5:p,isReservedWordES6:b,isRestrictedWord:R,isIdentifierNameES5:I,isIdentifierNameES6:se,isIdentifierES5:le,isIdentifierES6:tn}}()),keyword$1.exports}var hasRequiredUtils;function requireUtils(){return hasRequiredUtils||(hasRequiredUtils=1,function(){utils.ast=requireAst(),utils.code=requireCode(),utils.keyword=requireKeyword()}()),utils}var sourceMap={},sourceMapGenerator={},base64Vlq={},base64={},hasRequiredBase64;function requireBase64(){if(hasRequiredBase64)return base64;hasRequiredBase64=1;var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");return base64.encode=function(e){if(0<=e&&e<o.length)return o[e];throw new TypeError("Must be between 0 and 63: "+e)},base64.decode=function(e){var l=65,d=90,p=97,b=122,R=48,I=57,z=43,se=47,le=26,tn=52;return l<=e&&e<=d?e-l:p<=e&&e<=b?e-p+le:R<=e&&e<=I?e-R+tn:e==z?62:e==se?63:-1},base64}var hasRequiredBase64Vlq;function requireBase64Vlq(){if(hasRequiredBase64Vlq)return base64Vlq;hasRequiredBase64Vlq=1;var o=requireBase64(),e=5,l=1<<e,d=l-1,p=l;function b(I){return I<0?(-I<<1)+1:(I<<1)+0}function R(I){var z=(I&1)===1,se=I>>1;return z?-se:se}return base64Vlq.encode=function(z){var se="",le,tn=b(z);do le=tn&d,tn>>>=e,tn>0&&(le|=p),se+=o.encode(le);while(tn>0);return se},base64Vlq.decode=function(z,se,le){var tn=z.length,an=0,sn=0,ln,un;do{if(se>=tn)throw new Error("Expected more digits in base 64 VLQ value.");if(un=o.decode(z.charCodeAt(se++)),un===-1)throw new Error("Invalid base64 digit: "+z.charAt(se-1));ln=!!(un&p),un&=d,an=an+(un<<sn),sn+=e}while(ln);le.value=R(an),le.rest=se},base64Vlq}var util={},hasRequiredUtil;function requireUtil(){return hasRequiredUtil||(hasRequiredUtil=1,function(o){function e(vn,bn,Sn){if(bn in vn)return vn[bn];if(arguments.length===3)return Sn;throw new Error('"'+bn+'" is a required argument.')}o.getArg=e;var l=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,d=/^data:.+\,.+$/;function p(vn){var bn=vn.match(l);return bn?{scheme:bn[1],auth:bn[2],host:bn[3],port:bn[4],path:bn[5]}:null}o.urlParse=p;function b(vn){var bn="";return vn.scheme&&(bn+=vn.scheme+":"),bn+="//",vn.auth&&(bn+=vn.auth+"@"),vn.host&&(bn+=vn.host),vn.port&&(bn+=":"+vn.port),vn.path&&(bn+=vn.path),bn}o.urlGenerate=b;function R(vn){var bn=vn,Sn=p(vn);if(Sn){if(!Sn.path)return vn;bn=Sn.path}for(var An=o.isAbsolute(bn),Dn=bn.split(/\/+/),Bn,Nn=0,Qn=Dn.length-1;Qn>=0;Qn--)Bn=Dn[Qn],Bn==="."?Dn.splice(Qn,1):Bn===".."?Nn++:Nn>0&&(Bn===""?(Dn.splice(Qn+1,Nn),Nn=0):(Dn.splice(Qn,2),Nn--));return bn=Dn.join("/"),bn===""&&(bn=An?"/":"."),Sn?(Sn.path=bn,b(Sn)):bn}o.normalize=R;function I(vn,bn){vn===""&&(vn="."),bn===""&&(bn=".");var Sn=p(bn),An=p(vn);if(An&&(vn=An.path||"/"),Sn&&!Sn.scheme)return An&&(Sn.scheme=An.scheme),b(Sn);if(Sn||bn.match(d))return bn;if(An&&!An.host&&!An.path)return An.host=bn,b(An);var Dn=bn.charAt(0)==="/"?bn:R(vn.replace(/\/+$/,"")+"/"+bn);return An?(An.path=Dn,b(An)):Dn}o.join=I,o.isAbsolute=function(vn){return vn.charAt(0)==="/"||l.test(vn)};function z(vn,bn){vn===""&&(vn="."),vn=vn.replace(/\/$/,"");for(var Sn=0;bn.indexOf(vn+"/")!==0;){var An=vn.lastIndexOf("/");if(An<0||(vn=vn.slice(0,An),vn.match(/^([^\/]+:\/)?\/*$/)))return bn;++Sn}return Array(Sn+1).join("../")+bn.substr(vn.length+1)}o.relative=z;var se=function(){var vn=Object.create(null);return!("__proto__"in vn)}();function le(vn){return vn}function tn(vn){return sn(vn)?"$"+vn:vn}o.toSetString=se?le:tn;function an(vn){return sn(vn)?vn.slice(1):vn}o.fromSetString=se?le:an;function sn(vn){if(!vn)return!1;var bn=vn.length;if(bn<9||vn.charCodeAt(bn-1)!==95||vn.charCodeAt(bn-2)!==95||vn.charCodeAt(bn-3)!==111||vn.charCodeAt(bn-4)!==116||vn.charCodeAt(bn-5)!==111||vn.charCodeAt(bn-6)!==114||vn.charCodeAt(bn-7)!==112||vn.charCodeAt(bn-8)!==95||vn.charCodeAt(bn-9)!==95)return!1;for(var Sn=bn-10;Sn>=0;Sn--)if(vn.charCodeAt(Sn)!==36)return!1;return!0}function ln(vn,bn,Sn){var An=pn(vn.source,bn.source);return An!==0||(An=vn.originalLine-bn.originalLine,An!==0)||(An=vn.originalColumn-bn.originalColumn,An!==0||Sn)||(An=vn.generatedColumn-bn.generatedColumn,An!==0)||(An=vn.generatedLine-bn.generatedLine,An!==0)?An:pn(vn.name,bn.name)}o.compareByOriginalPositions=ln;function un(vn,bn,Sn){var An=vn.generatedLine-bn.generatedLine;return An!==0||(An=vn.generatedColumn-bn.generatedColumn,An!==0||Sn)||(An=pn(vn.source,bn.source),An!==0)||(An=vn.originalLine-bn.originalLine,An!==0)||(An=vn.originalColumn-bn.originalColumn,An!==0)?An:pn(vn.name,bn.name)}o.compareByGeneratedPositionsDeflated=un;function pn(vn,bn){return vn===bn?0:vn===null?1:bn===null?-1:vn>bn?1:-1}function yn(vn,bn){var Sn=vn.generatedLine-bn.generatedLine;return Sn!==0||(Sn=vn.generatedColumn-bn.generatedColumn,Sn!==0)||(Sn=pn(vn.source,bn.source),Sn!==0)||(Sn=vn.originalLine-bn.originalLine,Sn!==0)||(Sn=vn.originalColumn-bn.originalColumn,Sn!==0)?Sn:pn(vn.name,bn.name)}o.compareByGeneratedPositionsInflated=yn;function _n(vn){return JSON.parse(vn.replace(/^\)]}'[^\n]*\n/,""))}o.parseSourceMapInput=_n;function Pn(vn,bn,Sn){if(bn=bn||"",vn&&(vn[vn.length-1]!=="/"&&bn[0]!=="/"&&(vn+="/"),bn=vn+bn),Sn){var An=p(Sn);if(!An)throw new Error("sourceMapURL could not be parsed");if(An.path){var Dn=An.path.lastIndexOf("/");Dn>=0&&(An.path=An.path.substring(0,Dn+1))}bn=I(b(An),bn)}return R(bn)}o.computeSourceURL=Pn}(util)),util}var arraySet={},hasRequiredArraySet;function requireArraySet(){if(hasRequiredArraySet)return arraySet;hasRequiredArraySet=1;var o=requireUtil(),e=Object.prototype.hasOwnProperty,l=typeof Map<"u";function d(){this._array=[],this._set=l?new Map:Object.create(null)}return d.fromArray=function(b,R){for(var I=new d,z=0,se=b.length;z<se;z++)I.add(b[z],R);return I},d.prototype.size=function(){return l?this._set.size:Object.getOwnPropertyNames(this._set).length},d.prototype.add=function(b,R){var I=l?b:o.toSetString(b),z=l?this.has(b):e.call(this._set,I),se=this._array.length;(!z||R)&&this._array.push(b),z||(l?this._set.set(b,se):this._set[I]=se)},d.prototype.has=function(b){if(l)return this._set.has(b);var R=o.toSetString(b);return e.call(this._set,R)},d.prototype.indexOf=function(b){if(l){var R=this._set.get(b);if(R>=0)return R}else{var I=o.toSetString(b);if(e.call(this._set,I))return this._set[I]}throw new Error('"'+b+'" is not in the set.')},d.prototype.at=function(b){if(b>=0&&b<this._array.length)return this._array[b];throw new Error("No element indexed by "+b)},d.prototype.toArray=function(){return this._array.slice()},arraySet.ArraySet=d,arraySet}var mappingList={},hasRequiredMappingList;function requireMappingList(){if(hasRequiredMappingList)return mappingList;hasRequiredMappingList=1;var o=requireUtil();function e(d,p){var b=d.generatedLine,R=p.generatedLine,I=d.generatedColumn,z=p.generatedColumn;return R>b||R==b&&z>=I||o.compareByGeneratedPositionsInflated(d,p)<=0}function l(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}return l.prototype.unsortedForEach=function(p,b){this._array.forEach(p,b)},l.prototype.add=function(p){e(this._last,p)?(this._last=p,this._array.push(p)):(this._sorted=!1,this._array.push(p))},l.prototype.toArray=function(){return this._sorted||(this._array.sort(o.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},mappingList.MappingList=l,mappingList}var hasRequiredSourceMapGenerator;function requireSourceMapGenerator(){if(hasRequiredSourceMapGenerator)return sourceMapGenerator;hasRequiredSourceMapGenerator=1;var o=requireBase64Vlq(),e=requireUtil(),l=requireArraySet().ArraySet,d=requireMappingList().MappingList;function p(b){b||(b={}),this._file=e.getArg(b,"file",null),this._sourceRoot=e.getArg(b,"sourceRoot",null),this._skipValidation=e.getArg(b,"skipValidation",!1),this._sources=new l,this._names=new l,this._mappings=new d,this._sourcesContents=null}return p.prototype._version=3,p.fromSourceMap=function(R){var I=R.sourceRoot,z=new p({file:R.file,sourceRoot:I});return R.eachMapping(function(se){var le={generated:{line:se.generatedLine,column:se.generatedColumn}};se.source!=null&&(le.source=se.source,I!=null&&(le.source=e.relative(I,le.source)),le.original={line:se.originalLine,column:se.originalColumn},se.name!=null&&(le.name=se.name)),z.addMapping(le)}),R.sources.forEach(function(se){var le=se;I!==null&&(le=e.relative(I,se)),z._sources.has(le)||z._sources.add(le);var tn=R.sourceContentFor(se);tn!=null&&z.setSourceContent(se,tn)}),z},p.prototype.addMapping=function(R){var I=e.getArg(R,"generated"),z=e.getArg(R,"original",null),se=e.getArg(R,"source",null),le=e.getArg(R,"name",null);this._skipValidation||this._validateMapping(I,z,se,le),se!=null&&(se=String(se),this._sources.has(se)||this._sources.add(se)),le!=null&&(le=String(le),this._names.has(le)||this._names.add(le)),this._mappings.add({generatedLine:I.line,generatedColumn:I.column,originalLine:z!=null&&z.line,originalColumn:z!=null&&z.column,source:se,name:le})},p.prototype.setSourceContent=function(R,I){var z=R;this._sourceRoot!=null&&(z=e.relative(this._sourceRoot,z)),I!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[e.toSetString(z)]=I):this._sourcesContents&&(delete this._sourcesContents[e.toSetString(z)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},p.prototype.applySourceMap=function(R,I,z){var se=I;if(I==null){if(R.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);se=R.file}var le=this._sourceRoot;le!=null&&(se=e.relative(le,se));var tn=new l,an=new l;this._mappings.unsortedForEach(function(sn){if(sn.source===se&&sn.originalLine!=null){var ln=R.originalPositionFor({line:sn.originalLine,column:sn.originalColumn});ln.source!=null&&(sn.source=ln.source,z!=null&&(sn.source=e.join(z,sn.source)),le!=null&&(sn.source=e.relative(le,sn.source)),sn.originalLine=ln.line,sn.originalColumn=ln.column,ln.name!=null&&(sn.name=ln.name))}var un=sn.source;un!=null&&!tn.has(un)&&tn.add(un);var pn=sn.name;pn!=null&&!an.has(pn)&&an.add(pn)},this),this._sources=tn,this._names=an,R.sources.forEach(function(sn){var ln=R.sourceContentFor(sn);ln!=null&&(z!=null&&(sn=e.join(z,sn)),le!=null&&(sn=e.relative(le,sn)),this.setSourceContent(sn,ln))},this)},p.prototype._validateMapping=function(R,I,z,se){if(I&&typeof I.line!="number"&&typeof I.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(R&&"line"in R&&"column"in R&&R.line>0&&R.column>=0&&!I&&!z&&!se)){if(R&&"line"in R&&"column"in R&&I&&"line"in I&&"column"in I&&R.line>0&&R.column>=0&&I.line>0&&I.column>=0&&z)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:R,source:z,original:I,name:se}))}},p.prototype._serializeMappings=function(){for(var R=0,I=1,z=0,se=0,le=0,tn=0,an="",sn,ln,un,pn,yn=this._mappings.toArray(),_n=0,Pn=yn.length;_n<Pn;_n++){if(ln=yn[_n],sn="",ln.generatedLine!==I)for(R=0;ln.generatedLine!==I;)sn+=";",I++;else if(_n>0){if(!e.compareByGeneratedPositionsInflated(ln,yn[_n-1]))continue;sn+=","}sn+=o.encode(ln.generatedColumn-R),R=ln.generatedColumn,ln.source!=null&&(pn=this._sources.indexOf(ln.source),sn+=o.encode(pn-tn),tn=pn,sn+=o.encode(ln.originalLine-1-se),se=ln.originalLine-1,sn+=o.encode(ln.originalColumn-z),z=ln.originalColumn,ln.name!=null&&(un=this._names.indexOf(ln.name),sn+=o.encode(un-le),le=un)),an+=sn}return an},p.prototype._generateSourcesContent=function(R,I){return R.map(function(z){if(!this._sourcesContents)return null;I!=null&&(z=e.relative(I,z));var se=e.toSetString(z);return Object.prototype.hasOwnProperty.call(this._sourcesContents,se)?this._sourcesContents[se]:null},this)},p.prototype.toJSON=function(){var R={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(R.file=this._file),this._sourceRoot!=null&&(R.sourceRoot=this._sourceRoot),this._sourcesContents&&(R.sourcesContent=this._generateSourcesContent(R.sources,R.sourceRoot)),R},p.prototype.toString=function(){return JSON.stringify(this.toJSON())},sourceMapGenerator.SourceMapGenerator=p,sourceMapGenerator}var sourceMapConsumer={},binarySearch={},hasRequiredBinarySearch;function requireBinarySearch(){return hasRequiredBinarySearch||(hasRequiredBinarySearch=1,function(o){o.GREATEST_LOWER_BOUND=1,o.LEAST_UPPER_BOUND=2;function e(l,d,p,b,R,I){var z=Math.floor((d-l)/2)+l,se=R(p,b[z],!0);return se===0?z:se>0?d-z>1?e(z,d,p,b,R,I):I==o.LEAST_UPPER_BOUND?d<b.length?d:-1:z:z-l>1?e(l,z,p,b,R,I):I==o.LEAST_UPPER_BOUND?z:l<0?-1:l}o.search=function(d,p,b,R){if(p.length===0)return-1;var I=e(-1,p.length,d,p,b,R||o.GREATEST_LOWER_BOUND);if(I<0)return-1;for(;I-1>=0&&b(p[I],p[I-1],!0)===0;)--I;return I}}(binarySearch)),binarySearch}var quickSort={},hasRequiredQuickSort;function requireQuickSort(){if(hasRequiredQuickSort)return quickSort;hasRequiredQuickSort=1;function o(d,p,b){var R=d[p];d[p]=d[b],d[b]=R}function e(d,p){return Math.round(d+Math.random()*(p-d))}function l(d,p,b,R){if(b<R){var I=e(b,R),z=b-1;o(d,I,R);for(var se=d[R],le=b;le<R;le++)p(d[le],se)<=0&&(z+=1,o(d,z,le));o(d,z+1,le);var tn=z+1;l(d,p,b,tn-1),l(d,p,tn+1,R)}}return quickSort.quickSort=function(d,p){l(d,p,0,d.length-1)},quickSort}var hasRequiredSourceMapConsumer;function requireSourceMapConsumer(){if(hasRequiredSourceMapConsumer)return sourceMapConsumer;hasRequiredSourceMapConsumer=1;var o=requireUtil(),e=requireBinarySearch(),l=requireArraySet().ArraySet,d=requireBase64Vlq(),p=requireQuickSort().quickSort;function b(se,le){var tn=se;return typeof se=="string"&&(tn=o.parseSourceMapInput(se)),tn.sections!=null?new z(tn,le):new R(tn,le)}b.fromSourceMap=function(se,le){return R.fromSourceMap(se,le)},b.prototype._version=3,b.prototype.__generatedMappings=null,Object.defineProperty(b.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),b.prototype.__originalMappings=null,Object.defineProperty(b.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),b.prototype._charIsMappingSeparator=function(le,tn){var an=le.charAt(tn);return an===";"||an===","},b.prototype._parseMappings=function(le,tn){throw new Error("Subclasses must implement _parseMappings")},b.GENERATED_ORDER=1,b.ORIGINAL_ORDER=2,b.GREATEST_LOWER_BOUND=1,b.LEAST_UPPER_BOUND=2,b.prototype.eachMapping=function(le,tn,an){var sn=tn||null,ln=an||b.GENERATED_ORDER,un;switch(ln){case b.GENERATED_ORDER:un=this._generatedMappings;break;case b.ORIGINAL_ORDER:un=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var pn=this.sourceRoot;un.map(function(yn){var _n=yn.source===null?null:this._sources.at(yn.source);return _n=o.computeSourceURL(pn,_n,this._sourceMapURL),{source:_n,generatedLine:yn.generatedLine,generatedColumn:yn.generatedColumn,originalLine:yn.originalLine,originalColumn:yn.originalColumn,name:yn.name===null?null:this._names.at(yn.name)}},this).forEach(le,sn)},b.prototype.allGeneratedPositionsFor=function(le){var tn=o.getArg(le,"line"),an={source:o.getArg(le,"source"),originalLine:tn,originalColumn:o.getArg(le,"column",0)};if(an.source=this._findSourceIndex(an.source),an.source<0)return[];var sn=[],ln=this._findMapping(an,this._originalMappings,"originalLine","originalColumn",o.compareByOriginalPositions,e.LEAST_UPPER_BOUND);if(ln>=0){var un=this._originalMappings[ln];if(le.column===void 0)for(var pn=un.originalLine;un&&un.originalLine===pn;)sn.push({line:o.getArg(un,"generatedLine",null),column:o.getArg(un,"generatedColumn",null),lastColumn:o.getArg(un,"lastGeneratedColumn",null)}),un=this._originalMappings[++ln];else for(var yn=un.originalColumn;un&&un.originalLine===tn&&un.originalColumn==yn;)sn.push({line:o.getArg(un,"generatedLine",null),column:o.getArg(un,"generatedColumn",null),lastColumn:o.getArg(un,"lastGeneratedColumn",null)}),un=this._originalMappings[++ln]}return sn},sourceMapConsumer.SourceMapConsumer=b;function R(se,le){var tn=se;typeof se=="string"&&(tn=o.parseSourceMapInput(se));var an=o.getArg(tn,"version"),sn=o.getArg(tn,"sources"),ln=o.getArg(tn,"names",[]),un=o.getArg(tn,"sourceRoot",null),pn=o.getArg(tn,"sourcesContent",null),yn=o.getArg(tn,"mappings"),_n=o.getArg(tn,"file",null);if(an!=this._version)throw new Error("Unsupported version: "+an);un&&(un=o.normalize(un)),sn=sn.map(String).map(o.normalize).map(function(Pn){return un&&o.isAbsolute(un)&&o.isAbsolute(Pn)?o.relative(un,Pn):Pn}),this._names=l.fromArray(ln.map(String),!0),this._sources=l.fromArray(sn,!0),this._absoluteSources=this._sources.toArray().map(function(Pn){return o.computeSourceURL(un,Pn,le)}),this.sourceRoot=un,this.sourcesContent=pn,this._mappings=yn,this._sourceMapURL=le,this.file=_n}R.prototype=Object.create(b.prototype),R.prototype.consumer=b,R.prototype._findSourceIndex=function(se){var le=se;if(this.sourceRoot!=null&&(le=o.relative(this.sourceRoot,le)),this._sources.has(le))return this._sources.indexOf(le);var tn;for(tn=0;tn<this._absoluteSources.length;++tn)if(this._absoluteSources[tn]==se)return tn;return-1},R.fromSourceMap=function(le,tn){var an=Object.create(R.prototype),sn=an._names=l.fromArray(le._names.toArray(),!0),ln=an._sources=l.fromArray(le._sources.toArray(),!0);an.sourceRoot=le._sourceRoot,an.sourcesContent=le._generateSourcesContent(an._sources.toArray(),an.sourceRoot),an.file=le._file,an._sourceMapURL=tn,an._absoluteSources=an._sources.toArray().map(function(Sn){return o.computeSourceURL(an.sourceRoot,Sn,tn)});for(var un=le._mappings.toArray().slice(),pn=an.__generatedMappings=[],yn=an.__originalMappings=[],_n=0,Pn=un.length;_n<Pn;_n++){var vn=un[_n],bn=new I;bn.generatedLine=vn.generatedLine,bn.generatedColumn=vn.generatedColumn,vn.source&&(bn.source=ln.indexOf(vn.source),bn.originalLine=vn.originalLine,bn.originalColumn=vn.originalColumn,vn.name&&(bn.name=sn.indexOf(vn.name)),yn.push(bn)),pn.push(bn)}return p(an.__originalMappings,o.compareByOriginalPositions),an},R.prototype._version=3,Object.defineProperty(R.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function I(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}R.prototype._parseMappings=function(le,tn){for(var an=1,sn=0,ln=0,un=0,pn=0,yn=0,_n=le.length,Pn=0,vn={},bn={},Sn=[],An=[],Dn,Bn,Nn,Qn,Zn;Pn<_n;)if(le.charAt(Pn)===";")an++,Pn++,sn=0;else if(le.charAt(Pn)===",")Pn++;else{for(Dn=new I,Dn.generatedLine=an,Qn=Pn;Qn<_n&&!this._charIsMappingSeparator(le,Qn);Qn++);if(Bn=le.slice(Pn,Qn),Nn=vn[Bn],Nn)Pn+=Bn.length;else{for(Nn=[];Pn<Qn;)d.decode(le,Pn,bn),Zn=bn.value,Pn=bn.rest,Nn.push(Zn);if(Nn.length===2)throw new Error("Found a source, but no line and column");if(Nn.length===3)throw new Error("Found a source and line, but no column");vn[Bn]=Nn}Dn.generatedColumn=sn+Nn[0],sn=Dn.generatedColumn,Nn.length>1&&(Dn.source=pn+Nn[1],pn+=Nn[1],Dn.originalLine=ln+Nn[2],ln=Dn.originalLine,Dn.originalLine+=1,Dn.originalColumn=un+Nn[3],un=Dn.originalColumn,Nn.length>4&&(Dn.name=yn+Nn[4],yn+=Nn[4])),An.push(Dn),typeof Dn.originalLine=="number"&&Sn.push(Dn)}p(An,o.compareByGeneratedPositionsDeflated),this.__generatedMappings=An,p(Sn,o.compareByOriginalPositions),this.__originalMappings=Sn},R.prototype._findMapping=function(le,tn,an,sn,ln,un){if(le[an]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+le[an]);if(le[sn]<0)throw new TypeError("Column must be greater than or equal to 0, got "+le[sn]);return e.search(le,tn,ln,un)},R.prototype.computeColumnSpans=function(){for(var le=0;le<this._generatedMappings.length;++le){var tn=this._generatedMappings[le];if(le+1<this._generatedMappings.length){var an=this._generatedMappings[le+1];if(tn.generatedLine===an.generatedLine){tn.lastGeneratedColumn=an.generatedColumn-1;continue}}tn.lastGeneratedColumn=1/0}},R.prototype.originalPositionFor=function(le){var tn={generatedLine:o.getArg(le,"line"),generatedColumn:o.getArg(le,"column")},an=this._findMapping(tn,this._generatedMappings,"generatedLine","generatedColumn",o.compareByGeneratedPositionsDeflated,o.getArg(le,"bias",b.GREATEST_LOWER_BOUND));if(an>=0){var sn=this._generatedMappings[an];if(sn.generatedLine===tn.generatedLine){var ln=o.getArg(sn,"source",null);ln!==null&&(ln=this._sources.at(ln),ln=o.computeSourceURL(this.sourceRoot,ln,this._sourceMapURL));var un=o.getArg(sn,"name",null);return un!==null&&(un=this._names.at(un)),{source:ln,line:o.getArg(sn,"originalLine",null),column:o.getArg(sn,"originalColumn",null),name:un}}}return{source:null,line:null,column:null,name:null}},R.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(le){return le==null}):!1},R.prototype.sourceContentFor=function(le,tn){if(!this.sourcesContent)return null;var an=this._findSourceIndex(le);if(an>=0)return this.sourcesContent[an];var sn=le;this.sourceRoot!=null&&(sn=o.relative(this.sourceRoot,sn));var ln;if(this.sourceRoot!=null&&(ln=o.urlParse(this.sourceRoot))){var un=sn.replace(/^file:\/\//,"");if(ln.scheme=="file"&&this._sources.has(un))return this.sourcesContent[this._sources.indexOf(un)];if((!ln.path||ln.path=="/")&&this._sources.has("/"+sn))return this.sourcesContent[this._sources.indexOf("/"+sn)]}if(tn)return null;throw new Error('"'+sn+'" is not in the SourceMap.')},R.prototype.generatedPositionFor=function(le){var tn=o.getArg(le,"source");if(tn=this._findSourceIndex(tn),tn<0)return{line:null,column:null,lastColumn:null};var an={source:tn,originalLine:o.getArg(le,"line"),originalColumn:o.getArg(le,"column")},sn=this._findMapping(an,this._originalMappings,"originalLine","originalColumn",o.compareByOriginalPositions,o.getArg(le,"bias",b.GREATEST_LOWER_BOUND));if(sn>=0){var ln=this._originalMappings[sn];if(ln.source===an.source)return{line:o.getArg(ln,"generatedLine",null),column:o.getArg(ln,"generatedColumn",null),lastColumn:o.getArg(ln,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},sourceMapConsumer.BasicSourceMapConsumer=R;function z(se,le){var tn=se;typeof se=="string"&&(tn=o.parseSourceMapInput(se));var an=o.getArg(tn,"version"),sn=o.getArg(tn,"sections");if(an!=this._version)throw new Error("Unsupported version: "+an);this._sources=new l,this._names=new l;var ln={line:-1,column:0};this._sections=sn.map(function(un){if(un.url)throw new Error("Support for url field in sections not implemented.");var pn=o.getArg(un,"offset"),yn=o.getArg(pn,"line"),_n=o.getArg(pn,"column");if(yn<ln.line||yn===ln.line&&_n<ln.column)throw new Error("Section offsets must be ordered and non-overlapping.");return ln=pn,{generatedOffset:{generatedLine:yn+1,generatedColumn:_n+1},consumer:new b(o.getArg(un,"map"),le)}})}return z.prototype=Object.create(b.prototype),z.prototype.constructor=b,z.prototype._version=3,Object.defineProperty(z.prototype,"sources",{get:function(){for(var se=[],le=0;le<this._sections.length;le++)for(var tn=0;tn<this._sections[le].consumer.sources.length;tn++)se.push(this._sections[le].consumer.sources[tn]);return se}}),z.prototype.originalPositionFor=function(le){var tn={generatedLine:o.getArg(le,"line"),generatedColumn:o.getArg(le,"column")},an=e.search(tn,this._sections,function(ln,un){var pn=ln.generatedLine-un.generatedOffset.generatedLine;return pn||ln.generatedColumn-un.generatedOffset.generatedColumn}),sn=this._sections[an];return sn?sn.consumer.originalPositionFor({line:tn.generatedLine-(sn.generatedOffset.generatedLine-1),column:tn.generatedColumn-(sn.generatedOffset.generatedLine===tn.generatedLine?sn.generatedOffset.generatedColumn-1:0),bias:le.bias}):{source:null,line:null,column:null,name:null}},z.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(le){return le.consumer.hasContentsOfAllSources()})},z.prototype.sourceContentFor=function(le,tn){for(var an=0;an<this._sections.length;an++){var sn=this._sections[an],ln=sn.consumer.sourceContentFor(le,!0);if(ln)return ln}if(tn)return null;throw new Error('"'+le+'" is not in the SourceMap.')},z.prototype.generatedPositionFor=function(le){for(var tn=0;tn<this._sections.length;tn++){var an=this._sections[tn];if(an.consumer._findSourceIndex(o.getArg(le,"source"))!==-1){var sn=an.consumer.generatedPositionFor(le);if(sn){var ln={line:sn.line+(an.generatedOffset.generatedLine-1),column:sn.column+(an.generatedOffset.generatedLine===sn.line?an.generatedOffset.generatedColumn-1:0)};return ln}}}return{line:null,column:null}},z.prototype._parseMappings=function(le,tn){this.__generatedMappings=[],this.__originalMappings=[];for(var an=0;an<this._sections.length;an++)for(var sn=this._sections[an],ln=sn.consumer._generatedMappings,un=0;un<ln.length;un++){var pn=ln[un],yn=sn.consumer._sources.at(pn.source);yn=o.computeSourceURL(sn.consumer.sourceRoot,yn,this._sourceMapURL),this._sources.add(yn),yn=this._sources.indexOf(yn);var _n=null;pn.name&&(_n=sn.consumer._names.at(pn.name),this._names.add(_n),_n=this._names.indexOf(_n));var Pn={source:yn,generatedLine:pn.generatedLine+(sn.generatedOffset.generatedLine-1),generatedColumn:pn.generatedColumn+(sn.generatedOffset.generatedLine===pn.generatedLine?sn.generatedOffset.generatedColumn-1:0),originalLine:pn.originalLine,originalColumn:pn.originalColumn,name:_n};this.__generatedMappings.push(Pn),typeof Pn.originalLine=="number"&&this.__originalMappings.push(Pn)}p(this.__generatedMappings,o.compareByGeneratedPositionsDeflated),p(this.__originalMappings,o.compareByOriginalPositions)},sourceMapConsumer.IndexedSourceMapConsumer=z,sourceMapConsumer}var sourceNode={},hasRequiredSourceNode;function requireSourceNode(){if(hasRequiredSourceNode)return sourceNode;hasRequiredSourceNode=1;var o=requireSourceMapGenerator().SourceMapGenerator,e=requireUtil(),l=/(\r?\n)/,d=10,p="$$$isSourceNode$$$";function b(R,I,z,se,le){this.children=[],this.sourceContents={},this.line=R??null,this.column=I??null,this.source=z??null,this.name=le??null,this[p]=!0,se!=null&&this.add(se)}return b.fromStringWithSourceMap=function(I,z,se){var le=new b,tn=I.split(l),an=0,sn=function(){var _n=vn(),Pn=vn()||"";return _n+Pn;function vn(){return an<tn.length?tn[an++]:void 0}},ln=1,un=0,pn=null;return z.eachMapping(function(_n){if(pn!==null)if(ln<_n.generatedLine)yn(pn,sn()),ln++,un=0;else{var Pn=tn[an]||"",vn=Pn.substr(0,_n.generatedColumn-un);tn[an]=Pn.substr(_n.generatedColumn-un),un=_n.generatedColumn,yn(pn,vn),pn=_n;return}for(;ln<_n.generatedLine;)le.add(sn()),ln++;if(un<_n.generatedColumn){var Pn=tn[an]||"";le.add(Pn.substr(0,_n.generatedColumn)),tn[an]=Pn.substr(_n.generatedColumn),un=_n.generatedColumn}pn=_n},this),an<tn.length&&(pn&&yn(pn,sn()),le.add(tn.splice(an).join(""))),z.sources.forEach(function(_n){var Pn=z.sourceContentFor(_n);Pn!=null&&(se!=null&&(_n=e.join(se,_n)),le.setSourceContent(_n,Pn))}),le;function yn(_n,Pn){if(_n===null||_n.source===void 0)le.add(Pn);else{var vn=se?e.join(se,_n.source):_n.source;le.add(new b(_n.originalLine,_n.originalColumn,vn,Pn,_n.name))}}},b.prototype.add=function(I){if(Array.isArray(I))I.forEach(function(z){this.add(z)},this);else if(I[p]||typeof I=="string")I&&this.children.push(I);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+I);return this},b.prototype.prepend=function(I){if(Array.isArray(I))for(var z=I.length-1;z>=0;z--)this.prepend(I[z]);else if(I[p]||typeof I=="string")this.children.unshift(I);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+I);return this},b.prototype.walk=function(I){for(var z,se=0,le=this.children.length;se<le;se++)z=this.children[se],z[p]?z.walk(I):z!==""&&I(z,{source:this.source,line:this.line,column:this.column,name:this.name})},b.prototype.join=function(I){var z,se,le=this.children.length;if(le>0){for(z=[],se=0;se<le-1;se++)z.push(this.children[se]),z.push(I);z.push(this.children[se]),this.children=z}return this},b.prototype.replaceRight=function(I,z){var se=this.children[this.children.length-1];return se[p]?se.replaceRight(I,z):typeof se=="string"?this.children[this.children.length-1]=se.replace(I,z):this.children.push("".replace(I,z)),this},b.prototype.setSourceContent=function(I,z){this.sourceContents[e.toSetString(I)]=z},b.prototype.walkSourceContents=function(I){for(var z=0,se=this.children.length;z<se;z++)this.children[z][p]&&this.children[z].walkSourceContents(I);for(var le=Object.keys(this.sourceContents),z=0,se=le.length;z<se;z++)I(e.fromSetString(le[z]),this.sourceContents[le[z]])},b.prototype.toString=function(){var I="";return this.walk(function(z){I+=z}),I},b.prototype.toStringWithSourceMap=function(I){var z={code:"",line:1,column:0},se=new o(I),le=!1,tn=null,an=null,sn=null,ln=null;return this.walk(function(un,pn){z.code+=un,pn.source!==null&&pn.line!==null&&pn.column!==null?((tn!==pn.source||an!==pn.line||sn!==pn.column||ln!==pn.name)&&se.addMapping({source:pn.source,original:{line:pn.line,column:pn.column},generated:{line:z.line,column:z.column},name:pn.name}),tn=pn.source,an=pn.line,sn=pn.column,ln=pn.name,le=!0):le&&(se.addMapping({generated:{line:z.line,column:z.column}}),tn=null,le=!1);for(var yn=0,_n=un.length;yn<_n;yn++)un.charCodeAt(yn)===d?(z.line++,z.column=0,yn+1===_n?(tn=null,le=!1):le&&se.addMapping({source:pn.source,original:{line:pn.line,column:pn.column},generated:{line:z.line,column:z.column},name:pn.name})):z.column++}),this.walkSourceContents(function(un,pn){se.setSourceContent(un,pn)}),{code:z.code,map:se}},sourceNode.SourceNode=b,sourceNode}var hasRequiredSourceMap;function requireSourceMap(){return hasRequiredSourceMap||(hasRequiredSourceMap=1,sourceMap.SourceMapGenerator=requireSourceMapGenerator().SourceMapGenerator,sourceMap.SourceMapConsumer=requireSourceMapConsumer().SourceMapConsumer,sourceMap.SourceNode=requireSourceNode().SourceNode),sourceMap}const name$3="escodegen",description="ECMAScript code generator",homepage="http://github.com/estools/escodegen",main="escodegen.js",bin={esgenerate:"./bin/esgenerate.js",escodegen:"./bin/escodegen.js"},files=["LICENSE.BSD","README.md","bin","escodegen.js","package.json"],version="2.1.0",engines={node:">=6.0"},maintainers=[{name:"Yusuke Suzuki",email:"utatane.tea@gmail.com",web:"http://github.com/Constellation"}],repository={type:"git",url:"http://github.com/estools/escodegen.git"},dependencies={estraverse:"^5.2.0",esutils:"^2.0.2",esprima:"^4.0.1"},optionalDependencies={"source-map":"~0.6.1"},devDependencies={acorn:"^8.0.4",bluebird:"^3.4.7","bower-registry-client":"^1.0.0",chai:"^4.2.0","chai-exclude":"^2.0.2","commonjs-everywhere":"^0.9.7",gulp:"^4.0.2","gulp-eslint":"^6.0.0","gulp-mocha":"^7.0.2",minimist:"^1.2.5",optionator:"^0.9.1",semver:"^7.3.4"},license="BSD-2-Clause",scripts={test:"gulp travis","unit-test":"gulp test",lint:"gulp lint",release:"node tools/release.js","build-min":"./node_modules/.bin/cjsify -ma path: tools/entry-point.js > escodegen.browser.min.js",build:"./node_modules/.bin/cjsify -a path: tools/entry-point.js > escodegen.browser.js"},require$$3={name:name$3,description,homepage,main,bin,files,version,engines,maintainers,repository,dependencies,optionalDependencies,devDependencies,license,scripts};var hasRequiredEscodegen;function requireEscodegen(){return hasRequiredEscodegen||(hasRequiredEscodegen=1,function(o){(function(){var e,l,d,p,b,R,I,z,se,le,tn,an,sn,ln,un,pn,yn,_n,Pn,vn,bn,Sn,An,Dn,Bn,Nn;b=requireEstraverse(),R=requireUtils(),e=b.Syntax;function Qn(hn){return da.Expression.hasOwnProperty(hn.type)}function Zn(hn){return da.Statement.hasOwnProperty(hn.type)}l={Sequence:0,Yield:1,Assignment:1,Conditional:2,ArrowFunction:2,Coalesce:3,LogicalOR:4,LogicalAND:5,BitwiseOR:6,BitwiseXOR:7,BitwiseAND:8,Equality:9,Relational:10,BitwiseSHIFT:11,Additive:12,Multiplicative:13,Exponentiation:14,Await:15,Unary:15,Postfix:16,OptionalChaining:17,Call:18,New:19,TaggedTemplate:20,Member:21,Primary:22},d={"??":l.Coalesce,"||":l.LogicalOR,"&&":l.LogicalAND,"|":l.BitwiseOR,"^":l.BitwiseXOR,"&":l.BitwiseAND,"==":l.Equality,"!=":l.Equality,"===":l.Equality,"!==":l.Equality,is:l.Equality,isnt:l.Equality,"<":l.Relational,">":l.Relational,"<=":l.Relational,">=":l.Relational,in:l.Relational,instanceof:l.Relational,"<<":l.BitwiseSHIFT,">>":l.BitwiseSHIFT,">>>":l.BitwiseSHIFT,"+":l.Additive,"-":l.Additive,"*":l.Multiplicative,"%":l.Multiplicative,"/":l.Multiplicative,"**":l.Exponentiation};var Vn=1,qn=2,ia=4,ra=8,aa=16,jn=32,ka=64,Aa=qn|ia,Na=Vn|qn,Kn=Vn|qn|ia,Ea=Vn,qa=ia,va=Vn|ia,Oa=Vn,Va=Vn|jn,$a=0,Ua=Vn|aa,ss=Vn|ra;function ua(){return{indent:null,base:null,parse:null,comment:!1,format:{indent:{style:" ",base:0,adjustMultilineComment:!1},newline:`
|
||
`,space:" ",json:!1,renumber:!1,hexadecimal:!1,quotes:"single",escapeless:!1,compact:!1,parentheses:!0,semicolons:!0,safeConcatenation:!1,preserveBlankLines:!1},moz:{comprehensionExpressionStartsWithAssignment:!1,starlessGenerator:!1},sourceMap:null,sourceMapRoot:null,sourceMapWithCode:!1,directive:!1,raw:!0,verbatim:null,sourceCode:null}}function Jn(hn,xn){var kn="";for(xn|=0;xn>0;xn>>>=1,hn+=hn)xn&1&&(kn+=hn);return kn}function ga(hn){return/[\r\n]/g.test(hn)}function _i(hn){var xn=hn.length;return xn&&R.code.isLineTerminator(hn.charCodeAt(xn-1))}function Un(hn,xn){var kn;for(kn in xn)xn.hasOwnProperty(kn)&&(hn[kn]=xn[kn]);return hn}function ha(hn,xn){var kn,wn;function Gn(zn){return typeof zn=="object"&&zn instanceof Object&&!(zn instanceof RegExp)}for(kn in xn)xn.hasOwnProperty(kn)&&(wn=xn[kn],Gn(wn)?Gn(hn[kn])?ha(hn[kn],wn):hn[kn]=ha({},wn):hn[kn]=wn);return hn}function sa(hn){var xn,kn,wn,Gn,zn;if(hn!==hn)throw new Error("Numeric literal whose value is NaN");if(hn<0||hn===0&&1/hn<0)throw new Error("Numeric literal whose value is negative");if(hn===1/0)return se?"null":le?"1e400":"1e+400";if(xn=""+hn,!le||xn.length<3)return xn;for(kn=xn.indexOf("."),!se&&xn.charCodeAt(0)===48&&kn===1&&(kn=0,xn=xn.slice(1)),wn=xn,xn=xn.replace("e+","e"),Gn=0,(zn=wn.indexOf("e"))>0&&(Gn=+wn.slice(zn+1),wn=wn.slice(0,zn)),kn>=0&&(Gn-=wn.length-kn-1,wn=+(wn.slice(0,kn)+wn.slice(kn+1))+""),zn=0;wn.charCodeAt(wn.length+zn-1)===48;)--zn;return zn!==0&&(Gn-=zn,wn=wn.slice(0,zn)),Gn!==0&&(wn+="e"+Gn),(wn.length<xn.length||tn&&hn>1e12&&Math.floor(hn)===hn&&(wn="0x"+hn.toString(16)).length<xn.length)&&+wn===hn&&(xn=wn),xn}function Ga(hn,xn){return(hn&-2)===8232?(xn?"u":"\\u")+(hn===8232?"2028":"2029"):hn===10||hn===13?(xn?"":"\\")+(hn===10?"n":"r"):String.fromCharCode(hn)}function Ha(hn){var xn,kn,wn,Gn,zn,Yn,ta,la;if(kn=hn.toString(),hn.source){if(xn=kn.match(/\/([^/]*)$/),!xn)return kn;for(wn=xn[1],kn="",ta=!1,la=!1,Gn=0,zn=hn.source.length;Gn<zn;++Gn)Yn=hn.source.charCodeAt(Gn),la?(kn+=Ga(Yn,la),la=!1):(ta?Yn===93&&(ta=!1):Yn===47?kn+="\\":Yn===91&&(ta=!0),kn+=Ga(Yn,la),la=Yn===92);return"/"+kn+"/"+wn}return kn}function ls(hn,xn){var kn;return hn===8?"\\b":hn===12?"\\f":hn===9?"\\t":(kn=hn.toString(16).toUpperCase(),se||hn>255?"\\u"+"0000".slice(kn.length)+kn:hn===0&&!R.code.isDecimalDigit(xn)?"\\0":hn===11?"\\x0B":"\\x"+"00".slice(kn.length)+kn)}function ns(hn){if(hn===92)return"\\\\";if(hn===10)return"\\n";if(hn===13)return"\\r";if(hn===8232)return"\\u2028";if(hn===8233)return"\\u2029";throw new Error("Incorrectly classified character")}function Ba(hn){var xn,kn,wn,Gn;for(Gn=an==="double"?'"':"'",xn=0,kn=hn.length;xn<kn;++xn)if(wn=hn.charCodeAt(xn),wn===39){Gn='"';break}else if(wn===34){Gn="'";break}else wn===92&&++xn;return Gn+hn+Gn}function rs(hn){var xn="",kn,wn,Gn,zn=0,Yn=0,ta,la;for(kn=0,wn=hn.length;kn<wn;++kn){if(Gn=hn.charCodeAt(kn),Gn===39)++zn;else if(Gn===34)++Yn;else if(Gn===47&&se)xn+="\\";else if(R.code.isLineTerminator(Gn)||Gn===92){xn+=ns(Gn);continue}else if(!R.code.isIdentifierPartES5(Gn)&&(se&&Gn<32||!se&&!sn&&(Gn<32||Gn>126))){xn+=ls(Gn,hn.charCodeAt(kn+1));continue}xn+=String.fromCharCode(Gn)}if(ta=!(an==="double"||an==="auto"&&Yn<zn),la=ta?"'":'"',!(ta?zn:Yn))return la+xn+la;for(hn=xn,xn=la,kn=0,wn=hn.length;kn<wn;++kn)Gn=hn.charCodeAt(kn),(Gn===39&&ta||Gn===34&&!ta)&&(xn+="\\"),xn+=String.fromCharCode(Gn);return xn+la}function bs(hn){var xn,kn,wn,Gn="";for(xn=0,kn=hn.length;xn<kn;++xn)wn=hn[xn],Gn+=Array.isArray(wn)?bs(wn):wn;return Gn}function Fa(hn,xn){if(!Sn)return Array.isArray(hn)?bs(hn):hn;if(xn==null){if(hn instanceof p)return hn;xn={}}return xn.loc==null?new p(null,null,Sn,hn,xn.name||null):new p(xn.loc.start.line,xn.loc.start.column,Sn===!0?xn.loc.source||null:Sn,hn,xn.name||null)}function Za(){return un||" "}function ca(hn,xn){var kn,wn,Gn,zn;return kn=Fa(hn).toString(),kn.length===0?[xn]:(wn=Fa(xn).toString(),wn.length===0?[hn]:(Gn=kn.charCodeAt(kn.length-1),zn=wn.charCodeAt(0),(Gn===43||Gn===45)&&Gn===zn||R.code.isIdentifierPartES5(Gn)&&R.code.isIdentifierPartES5(zn)||Gn===47&&zn===105?[hn,Za(),xn]:R.code.isWhiteSpace(Gn)||R.code.isLineTerminator(Gn)||R.code.isWhiteSpace(zn)||R.code.isLineTerminator(zn)?[hn,xn]:[hn,un,xn]))}function es(hn){return[I,hn]}function Ta(hn){var xn;xn=I,I+=z,hn(I),I=xn}function Os(hn){var xn;for(xn=hn.length-1;xn>=0&&!R.code.isLineTerminator(hn.charCodeAt(xn));--xn);return hn.length-1-xn}function Ka(hn,xn){var kn,wn,Gn,zn,Yn,ta,la,Xa;for(kn=hn.split(/\r\n|[\r\n]/),ta=Number.MAX_VALUE,wn=1,Gn=kn.length;wn<Gn;++wn){for(zn=kn[wn],Yn=0;Yn<zn.length&&R.code.isWhiteSpace(zn.charCodeAt(Yn));)++Yn;ta>Yn&&(ta=Yn)}for(typeof xn<"u"?(la=I,kn[1][ta]==="*"&&(xn+=" "),I=xn):(ta&1&&--ta,la=I),wn=1,Gn=kn.length;wn<Gn;++wn)Xa=Fa(es(kn[wn].slice(ta))),kn[wn]=Sn?Xa.join(""):Xa;return I=la,kn.join(`
|
||
`)}function cs(hn,xn){if(hn.type==="Line"){if(_i(hn.value))return"//"+hn.value;var kn="//"+hn.value;return Dn||(kn+=`
|
||
`),kn}return vn.format.indent.adjustMultilineComment&&/[\n\r]/.test(hn.value)?Ka("/*"+hn.value+"*/",xn):"/*"+hn.value+"*/"}function As(hn,xn){var kn,wn,Gn,zn,Yn,ta,la,Xa,za,Cs,Es,gs,Ds,_s;if(hn.leadingComments&&hn.leadingComments.length>0){if(zn=xn,Dn){for(Gn=hn.leadingComments[0],xn=[],Xa=Gn.extendedRange,za=Gn.range,Es=An.substring(Xa[0],za[0]),_s=(Es.match(/\n/g)||[]).length,_s>0?(xn.push(Jn(`
|
||
`,_s)),xn.push(es(cs(Gn)))):(xn.push(Es),xn.push(cs(Gn))),Cs=za,kn=1,wn=hn.leadingComments.length;kn<wn;kn++)Gn=hn.leadingComments[kn],za=Gn.range,gs=An.substring(Cs[1],za[0]),_s=(gs.match(/\n/g)||[]).length,xn.push(Jn(`
|
||
`,_s)),xn.push(es(cs(Gn))),Cs=za;Ds=An.substring(za[1],Xa[1]),_s=(Ds.match(/\n/g)||[]).length,xn.push(Jn(`
|
||
`,_s))}else for(Gn=hn.leadingComments[0],xn=[],_n&&hn.type===e.Program&&hn.body.length===0&&xn.push(`
|
||
`),xn.push(cs(Gn)),_i(Fa(xn).toString())||xn.push(`
|
||
`),kn=1,wn=hn.leadingComments.length;kn<wn;++kn)Gn=hn.leadingComments[kn],la=[cs(Gn)],_i(Fa(la).toString())||la.push(`
|
||
`),xn.push(es(la));xn.push(es(zn))}if(hn.trailingComments)if(Dn)Gn=hn.trailingComments[0],Xa=Gn.extendedRange,za=Gn.range,Es=An.substring(Xa[0],za[0]),_s=(Es.match(/\n/g)||[]).length,_s>0?(xn.push(Jn(`
|
||
`,_s)),xn.push(es(cs(Gn)))):(xn.push(Es),xn.push(cs(Gn)));else for(Yn=!_i(Fa(xn).toString()),ta=Jn(" ",Os(Fa([I,xn,z]).toString())),kn=0,wn=hn.trailingComments.length;kn<wn;++kn)Gn=hn.trailingComments[kn],Yn?(kn===0?xn=[xn,z]:xn=[xn,ta],xn.push(cs(Gn,ta))):xn=[xn,es(cs(Gn))],kn!==wn-1&&!_i(Fa(xn).toString())&&(xn=[xn,`
|
||
`]);return xn}function ya(hn,xn,kn){var wn,Gn=0;for(wn=hn;wn<xn;wn++)An[wn]===`
|
||
`&&Gn++;for(wn=1;wn<Gn;wn++)kn.push(ln)}function xa(hn,xn,kn){return xn<kn?["(",hn,")"]:hn}function wa(hn){var xn,kn,wn;for(wn=hn.split(/\r\n|\n/),xn=1,kn=wn.length;xn<kn;xn++)wn[xn]=ln+I+wn[xn];return wn}function Ia(hn,xn){var kn,wn,Gn;return kn=hn[vn.verbatim],typeof kn=="string"?wn=xa(wa(kn),l.Sequence,xn):(wn=wa(kn.content),Gn=kn.precedence!=null?kn.precedence:l.Sequence,wn=xa(wn,Gn,xn)),Fa(wn,hn)}function da(){}da.prototype.maybeBlock=function(hn,xn){var kn,wn,Gn=this;return wn=!vn.comment||!hn.leadingComments,hn.type===e.BlockStatement&&wn?[un,this.generateStatement(hn,xn)]:hn.type===e.EmptyStatement&&wn?";":(Ta(function(){kn=[ln,es(Gn.generateStatement(hn,xn))]}),kn)},da.prototype.maybeBlockSuffix=function(hn,xn){var kn=_i(Fa(xn).toString());return hn.type===e.BlockStatement&&(!vn.comment||!hn.leadingComments)&&!kn?[xn,un]:kn?[xn,I]:[xn,ln,I]};function Ca(hn){return Fa(hn.name,hn)}function is(hn,xn){return hn.async?"async"+(xn?Za():un):""}function hs(hn){var xn=hn.generator&&!vn.moz.starlessGenerator;return xn?"*"+un:""}function os(hn){var xn=hn.value,kn="";return xn.async&&(kn+=is(xn,!hn.computed)),xn.generator&&(kn+=hs(xn)?"*":""),kn}da.prototype.generatePattern=function(hn,xn,kn){return hn.type===e.Identifier?Ca(hn):this.generateExpression(hn,xn,kn)},da.prototype.generateFunctionParams=function(hn){var xn,kn,wn,Gn;if(Gn=!1,hn.type===e.ArrowFunctionExpression&&!hn.rest&&(!hn.defaults||hn.defaults.length===0)&&hn.params.length===1&&hn.params[0].type===e.Identifier)wn=[is(hn,!0),Ca(hn.params[0])];else{for(wn=hn.type===e.ArrowFunctionExpression?[is(hn,!1)]:[],wn.push("("),hn.defaults&&(Gn=!0),xn=0,kn=hn.params.length;xn<kn;++xn)Gn&&hn.defaults[xn]?wn.push(this.generateAssignment(hn.params[xn],hn.defaults[xn],"=",l.Assignment,Kn)):wn.push(this.generatePattern(hn.params[xn],l.Assignment,Kn)),xn+1<kn&&wn.push(","+un);hn.rest&&(hn.params.length&&wn.push(","+un),wn.push("..."),wn.push(Ca(hn.rest))),wn.push(")")}return wn},da.prototype.generateFunctionBody=function(hn){var xn,kn;return xn=this.generateFunctionParams(hn),hn.type===e.ArrowFunctionExpression&&(xn.push(un),xn.push("=>")),hn.expression?(xn.push(un),kn=this.generateExpression(hn.body,l.Assignment,Kn),kn.toString().charAt(0)==="{"&&(kn=["(",kn,")"]),xn.push(kn)):xn.push(this.maybeBlock(hn.body,ss)),xn},da.prototype.generateIterationForStatement=function(hn,xn,kn){var wn=["for"+(xn.await?Za()+"await":"")+un+"("],Gn=this;return Ta(function(){xn.left.type===e.VariableDeclaration?Ta(function(){wn.push(xn.left.kind+Za()),wn.push(Gn.generateStatement(xn.left.declarations[0],$a))}):wn.push(Gn.generateExpression(xn.left,l.Call,Kn)),wn=ca(wn,hn),wn=[ca(wn,Gn.generateExpression(xn.right,l.Assignment,Kn)),")"]}),wn.push(this.maybeBlock(xn.body,kn)),wn},da.prototype.generatePropertyKey=function(hn,xn){var kn=[];return xn&&kn.push("["),kn.push(this.generateExpression(hn,l.Assignment,Kn)),xn&&kn.push("]"),kn},da.prototype.generateAssignment=function(hn,xn,kn,wn,Gn){return l.Assignment<wn&&(Gn|=Vn),xa([this.generateExpression(hn,l.Call,Gn),un+kn+un,this.generateExpression(xn,l.Assignment,Gn)],l.Assignment,wn)},da.prototype.semicolon=function(hn){return!yn&&hn&jn?"":";"},da.Statement={BlockStatement:function(hn,xn){var kn,wn,Gn=["{",ln],zn=this;return Ta(function(){hn.body.length===0&&Dn&&(kn=hn.range,kn[1]-kn[0]>2&&(wn=An.substring(kn[0]+1,kn[1]-1),wn[0]===`
|
||
`&&(Gn=["{"]),Gn.push(wn)));var Yn,ta,la,Xa;for(Xa=Oa,xn&ra&&(Xa|=aa),Yn=0,ta=hn.body.length;Yn<ta;++Yn)Dn&&(Yn===0&&(hn.body[0].leadingComments&&(kn=hn.body[0].leadingComments[0].extendedRange,wn=An.substring(kn[0],kn[1]),wn[0]===`
|
||
`&&(Gn=["{"])),hn.body[0].leadingComments||ya(hn.range[0],hn.body[0].range[0],Gn)),Yn>0&&!hn.body[Yn-1].trailingComments&&!hn.body[Yn].leadingComments&&ya(hn.body[Yn-1].range[1],hn.body[Yn].range[0],Gn)),Yn===ta-1&&(Xa|=jn),hn.body[Yn].leadingComments&&Dn?la=zn.generateStatement(hn.body[Yn],Xa):la=es(zn.generateStatement(hn.body[Yn],Xa)),Gn.push(la),_i(Fa(la).toString())||Dn&&Yn<ta-1&&hn.body[Yn+1].leadingComments||Gn.push(ln),Dn&&Yn===ta-1&&(hn.body[Yn].trailingComments||ya(hn.body[Yn].range[1],hn.range[1],Gn))}),Gn.push(es("}")),Gn},BreakStatement:function(hn,xn){return hn.label?"break "+hn.label.name+this.semicolon(xn):"break"+this.semicolon(xn)},ContinueStatement:function(hn,xn){return hn.label?"continue "+hn.label.name+this.semicolon(xn):"continue"+this.semicolon(xn)},ClassBody:function(hn,xn){var kn=["{",ln],wn=this;return Ta(function(Gn){var zn,Yn;for(zn=0,Yn=hn.body.length;zn<Yn;++zn)kn.push(Gn),kn.push(wn.generateExpression(hn.body[zn],l.Sequence,Kn)),zn+1<Yn&&kn.push(ln)}),_i(Fa(kn).toString())||kn.push(ln),kn.push(I),kn.push("}"),kn},ClassDeclaration:function(hn,xn){var kn,wn;return kn=["class"],hn.id&&(kn=ca(kn,this.generateExpression(hn.id,l.Sequence,Kn))),hn.superClass&&(wn=ca("extends",this.generateExpression(hn.superClass,l.Unary,Kn)),kn=ca(kn,wn)),kn.push(un),kn.push(this.generateStatement(hn.body,Va)),kn},DirectiveStatement:function(hn,xn){return vn.raw&&hn.raw?hn.raw+this.semicolon(xn):Ba(hn.directive)+this.semicolon(xn)},DoWhileStatement:function(hn,xn){var kn=ca("do",this.maybeBlock(hn.body,Oa));return kn=this.maybeBlockSuffix(hn.body,kn),ca(kn,["while"+un+"(",this.generateExpression(hn.test,l.Sequence,Kn),")"+this.semicolon(xn)])},CatchClause:function(hn,xn){var kn,wn=this;return Ta(function(){var Gn;hn.param?(kn=["catch"+un+"(",wn.generateExpression(hn.param,l.Sequence,Kn),")"],hn.guard&&(Gn=wn.generateExpression(hn.guard,l.Sequence,Kn),kn.splice(2,0," if ",Gn))):kn=["catch"]}),kn.push(this.maybeBlock(hn.body,Oa)),kn},DebuggerStatement:function(hn,xn){return"debugger"+this.semicolon(xn)},EmptyStatement:function(hn,xn){return";"},ExportDefaultDeclaration:function(hn,xn){var kn=["export"],wn;return wn=xn&jn?Va:Oa,kn=ca(kn,"default"),Zn(hn.declaration)?kn=ca(kn,this.generateStatement(hn.declaration,wn)):kn=ca(kn,this.generateExpression(hn.declaration,l.Assignment,Kn)+this.semicolon(xn)),kn},ExportNamedDeclaration:function(hn,xn){var kn=["export"],wn,Gn=this;return wn=xn&jn?Va:Oa,hn.declaration?ca(kn,this.generateStatement(hn.declaration,wn)):(hn.specifiers&&(hn.specifiers.length===0?kn=ca(kn,"{"+un+"}"):hn.specifiers[0].type===e.ExportBatchSpecifier?kn=ca(kn,this.generateExpression(hn.specifiers[0],l.Sequence,Kn)):(kn=ca(kn,"{"),Ta(function(zn){var Yn,ta;for(kn.push(ln),Yn=0,ta=hn.specifiers.length;Yn<ta;++Yn)kn.push(zn),kn.push(Gn.generateExpression(hn.specifiers[Yn],l.Sequence,Kn)),Yn+1<ta&&kn.push(","+ln)}),_i(Fa(kn).toString())||kn.push(ln),kn.push(I+"}")),hn.source?kn=ca(kn,["from"+un,this.generateExpression(hn.source,l.Sequence,Kn),this.semicolon(xn)]):kn.push(this.semicolon(xn))),kn)},ExportAllDeclaration:function(hn,xn){return["export"+un,"*"+un,"from"+un,this.generateExpression(hn.source,l.Sequence,Kn),this.semicolon(xn)]},ExpressionStatement:function(hn,xn){var kn,wn;function Gn(ta){var la;return ta.slice(0,5)!=="class"?!1:(la=ta.charCodeAt(5),la===123||R.code.isWhiteSpace(la)||R.code.isLineTerminator(la))}function zn(ta){var la;return ta.slice(0,8)!=="function"?!1:(la=ta.charCodeAt(8),la===40||R.code.isWhiteSpace(la)||la===42||R.code.isLineTerminator(la))}function Yn(ta){var la,Xa,za;if(ta.slice(0,5)!=="async"||!R.code.isWhiteSpace(ta.charCodeAt(5)))return!1;for(Xa=6,za=ta.length;Xa<za&&R.code.isWhiteSpace(ta.charCodeAt(Xa));++Xa);return Xa===za||ta.slice(Xa,Xa+8)!=="function"?!1:(la=ta.charCodeAt(Xa+8),la===40||R.code.isWhiteSpace(la)||la===42||R.code.isLineTerminator(la))}return kn=[this.generateExpression(hn.expression,l.Sequence,Kn)],wn=Fa(kn).toString(),wn.charCodeAt(0)===123||Gn(wn)||zn(wn)||Yn(wn)||Pn&&xn&aa&&hn.expression.type===e.Literal&&typeof hn.expression.value=="string"?kn=["(",kn,")"+this.semicolon(xn)]:kn.push(this.semicolon(xn)),kn},ImportDeclaration:function(hn,xn){var kn,wn,Gn=this;return hn.specifiers.length===0?["import",un,this.generateExpression(hn.source,l.Sequence,Kn),this.semicolon(xn)]:(kn=["import"],wn=0,hn.specifiers[wn].type===e.ImportDefaultSpecifier&&(kn=ca(kn,[this.generateExpression(hn.specifiers[wn],l.Sequence,Kn)]),++wn),hn.specifiers[wn]&&(wn!==0&&kn.push(","),hn.specifiers[wn].type===e.ImportNamespaceSpecifier?kn=ca(kn,[un,this.generateExpression(hn.specifiers[wn],l.Sequence,Kn)]):(kn.push(un+"{"),hn.specifiers.length-wn===1?(kn.push(un),kn.push(this.generateExpression(hn.specifiers[wn],l.Sequence,Kn)),kn.push(un+"}"+un)):(Ta(function(zn){var Yn,ta;for(kn.push(ln),Yn=wn,ta=hn.specifiers.length;Yn<ta;++Yn)kn.push(zn),kn.push(Gn.generateExpression(hn.specifiers[Yn],l.Sequence,Kn)),Yn+1<ta&&kn.push(","+ln)}),_i(Fa(kn).toString())||kn.push(ln),kn.push(I+"}"+un)))),kn=ca(kn,["from"+un,this.generateExpression(hn.source,l.Sequence,Kn),this.semicolon(xn)]),kn)},VariableDeclarator:function(hn,xn){var kn=xn&Vn?Kn:Aa;return hn.init?[this.generateExpression(hn.id,l.Assignment,kn),un,"=",un,this.generateExpression(hn.init,l.Assignment,kn)]:this.generatePattern(hn.id,l.Assignment,kn)},VariableDeclaration:function(hn,xn){var kn,wn,Gn,zn,Yn,ta=this;kn=[hn.kind],Yn=xn&Vn?Oa:$a;function la(){for(zn=hn.declarations[0],vn.comment&&zn.leadingComments?(kn.push(`
|
||
`),kn.push(es(ta.generateStatement(zn,Yn)))):(kn.push(Za()),kn.push(ta.generateStatement(zn,Yn))),wn=1,Gn=hn.declarations.length;wn<Gn;++wn)zn=hn.declarations[wn],vn.comment&&zn.leadingComments?(kn.push(","+ln),kn.push(es(ta.generateStatement(zn,Yn)))):(kn.push(","+un),kn.push(ta.generateStatement(zn,Yn)))}return hn.declarations.length>1?Ta(la):la(),kn.push(this.semicolon(xn)),kn},ThrowStatement:function(hn,xn){return[ca("throw",this.generateExpression(hn.argument,l.Sequence,Kn)),this.semicolon(xn)]},TryStatement:function(hn,xn){var kn,wn,Gn,zn;if(kn=["try",this.maybeBlock(hn.block,Oa)],kn=this.maybeBlockSuffix(hn.block,kn),hn.handlers)for(wn=0,Gn=hn.handlers.length;wn<Gn;++wn)kn=ca(kn,this.generateStatement(hn.handlers[wn],Oa)),(hn.finalizer||wn+1!==Gn)&&(kn=this.maybeBlockSuffix(hn.handlers[wn].body,kn));else{for(zn=hn.guardedHandlers||[],wn=0,Gn=zn.length;wn<Gn;++wn)kn=ca(kn,this.generateStatement(zn[wn],Oa)),(hn.finalizer||wn+1!==Gn)&&(kn=this.maybeBlockSuffix(zn[wn].body,kn));if(hn.handler)if(Array.isArray(hn.handler))for(wn=0,Gn=hn.handler.length;wn<Gn;++wn)kn=ca(kn,this.generateStatement(hn.handler[wn],Oa)),(hn.finalizer||wn+1!==Gn)&&(kn=this.maybeBlockSuffix(hn.handler[wn].body,kn));else kn=ca(kn,this.generateStatement(hn.handler,Oa)),hn.finalizer&&(kn=this.maybeBlockSuffix(hn.handler.body,kn))}return hn.finalizer&&(kn=ca(kn,["finally",this.maybeBlock(hn.finalizer,Oa)])),kn},SwitchStatement:function(hn,xn){var kn,wn,Gn,zn,Yn,ta=this;if(Ta(function(){kn=["switch"+un+"(",ta.generateExpression(hn.discriminant,l.Sequence,Kn),")"+un+"{"+ln]}),hn.cases)for(Yn=Oa,Gn=0,zn=hn.cases.length;Gn<zn;++Gn)Gn===zn-1&&(Yn|=jn),wn=es(this.generateStatement(hn.cases[Gn],Yn)),kn.push(wn),_i(Fa(wn).toString())||kn.push(ln);return kn.push(es("}")),kn},SwitchCase:function(hn,xn){var kn,wn,Gn,zn,Yn,ta=this;return Ta(function(){for(hn.test?kn=[ca("case",ta.generateExpression(hn.test,l.Sequence,Kn)),":"]:kn=["default:"],Gn=0,zn=hn.consequent.length,zn&&hn.consequent[0].type===e.BlockStatement&&(wn=ta.maybeBlock(hn.consequent[0],Oa),kn.push(wn),Gn=1),Gn!==zn&&!_i(Fa(kn).toString())&&kn.push(ln),Yn=Oa;Gn<zn;++Gn)Gn===zn-1&&xn&jn&&(Yn|=jn),wn=es(ta.generateStatement(hn.consequent[Gn],Yn)),kn.push(wn),Gn+1!==zn&&!_i(Fa(wn).toString())&&kn.push(ln)}),kn},IfStatement:function(hn,xn){var kn,wn,Gn,zn=this;return Ta(function(){kn=["if"+un+"(",zn.generateExpression(hn.test,l.Sequence,Kn),")"]}),Gn=xn&jn,wn=Oa,Gn&&(wn|=jn),hn.alternate?(kn.push(this.maybeBlock(hn.consequent,Oa)),kn=this.maybeBlockSuffix(hn.consequent,kn),hn.alternate.type===e.IfStatement?kn=ca(kn,["else ",this.generateStatement(hn.alternate,wn)]):kn=ca(kn,ca("else",this.maybeBlock(hn.alternate,wn)))):kn.push(this.maybeBlock(hn.consequent,wn)),kn},ForStatement:function(hn,xn){var kn,wn=this;return Ta(function(){kn=["for"+un+"("],hn.init?hn.init.type===e.VariableDeclaration?kn.push(wn.generateStatement(hn.init,$a)):(kn.push(wn.generateExpression(hn.init,l.Sequence,Aa)),kn.push(";")):kn.push(";"),hn.test&&(kn.push(un),kn.push(wn.generateExpression(hn.test,l.Sequence,Kn))),kn.push(";"),hn.update&&(kn.push(un),kn.push(wn.generateExpression(hn.update,l.Sequence,Kn))),kn.push(")")}),kn.push(this.maybeBlock(hn.body,xn&jn?Va:Oa)),kn},ForInStatement:function(hn,xn){return this.generateIterationForStatement("in",hn,xn&jn?Va:Oa)},ForOfStatement:function(hn,xn){return this.generateIterationForStatement("of",hn,xn&jn?Va:Oa)},LabeledStatement:function(hn,xn){return[hn.label.name+":",this.maybeBlock(hn.body,xn&jn?Va:Oa)]},Program:function(hn,xn){var kn,wn,Gn,zn,Yn;for(zn=hn.body.length,kn=[_n&&zn>0?`
|
||
`:""],Yn=Ua,Gn=0;Gn<zn;++Gn)!_n&&Gn===zn-1&&(Yn|=jn),Dn&&(Gn===0&&(hn.body[0].leadingComments||ya(hn.range[0],hn.body[Gn].range[0],kn)),Gn>0&&!hn.body[Gn-1].trailingComments&&!hn.body[Gn].leadingComments&&ya(hn.body[Gn-1].range[1],hn.body[Gn].range[0],kn)),wn=es(this.generateStatement(hn.body[Gn],Yn)),kn.push(wn),Gn+1<zn&&!_i(Fa(wn).toString())&&(Dn&&hn.body[Gn+1].leadingComments||kn.push(ln)),Dn&&Gn===zn-1&&(hn.body[Gn].trailingComments||ya(hn.body[Gn].range[1],hn.range[1],kn));return kn},FunctionDeclaration:function(hn,xn){return[is(hn,!0),"function",hs(hn)||Za(),hn.id?Ca(hn.id):"",this.generateFunctionBody(hn)]},ReturnStatement:function(hn,xn){return hn.argument?[ca("return",this.generateExpression(hn.argument,l.Sequence,Kn)),this.semicolon(xn)]:["return"+this.semicolon(xn)]},WhileStatement:function(hn,xn){var kn,wn=this;return Ta(function(){kn=["while"+un+"(",wn.generateExpression(hn.test,l.Sequence,Kn),")"]}),kn.push(this.maybeBlock(hn.body,xn&jn?Va:Oa)),kn},WithStatement:function(hn,xn){var kn,wn=this;return Ta(function(){kn=["with"+un+"(",wn.generateExpression(hn.object,l.Sequence,Kn),")"]}),kn.push(this.maybeBlock(hn.body,xn&jn?Va:Oa)),kn}},Un(da.prototype,da.Statement),da.Expression={SequenceExpression:function(hn,xn,kn){var wn,Gn,zn;for(l.Sequence<xn&&(kn|=Vn),wn=[],Gn=0,zn=hn.expressions.length;Gn<zn;++Gn)wn.push(this.generateExpression(hn.expressions[Gn],l.Assignment,kn)),Gn+1<zn&&wn.push(","+un);return xa(wn,l.Sequence,xn)},AssignmentExpression:function(hn,xn,kn){return this.generateAssignment(hn.left,hn.right,hn.operator,xn,kn)},ArrowFunctionExpression:function(hn,xn,kn){return xa(this.generateFunctionBody(hn),l.ArrowFunction,xn)},ConditionalExpression:function(hn,xn,kn){return l.Conditional<xn&&(kn|=Vn),xa([this.generateExpression(hn.test,l.Coalesce,kn),un+"?"+un,this.generateExpression(hn.consequent,l.Assignment,kn),un+":"+un,this.generateExpression(hn.alternate,l.Assignment,kn)],l.Conditional,xn)},LogicalExpression:function(hn,xn,kn){return hn.operator==="??"&&(kn|=ka),this.BinaryExpression(hn,xn,kn)},BinaryExpression:function(hn,xn,kn){var wn,Gn,zn,Yn,ta,la;return Yn=d[hn.operator],Gn=hn.operator==="**"?l.Postfix:Yn,zn=hn.operator==="**"?Yn:Yn+1,Yn<xn&&(kn|=Vn),ta=this.generateExpression(hn.left,Gn,kn),la=ta.toString(),la.charCodeAt(la.length-1)===47&&R.code.isIdentifierPartES5(hn.operator.charCodeAt(0))?wn=[ta,Za(),hn.operator]:wn=ca(ta,hn.operator),ta=this.generateExpression(hn.right,zn,kn),hn.operator==="/"&&ta.toString().charAt(0)==="/"||hn.operator.slice(-1)==="<"&&ta.toString().slice(0,3)==="!--"?(wn.push(Za()),wn.push(ta)):wn=ca(wn,ta),hn.operator==="in"&&!(kn&Vn)?["(",wn,")"]:(hn.operator==="||"||hn.operator==="&&")&&kn&ka?["(",wn,")"]:xa(wn,Yn,xn)},CallExpression:function(hn,xn,kn){var wn,Gn,zn;for(wn=[this.generateExpression(hn.callee,l.Call,Na)],hn.optional&&wn.push("?."),wn.push("("),Gn=0,zn=hn.arguments.length;Gn<zn;++Gn)wn.push(this.generateExpression(hn.arguments[Gn],l.Assignment,Kn)),Gn+1<zn&&wn.push(","+un);return wn.push(")"),kn&qn?xa(wn,l.Call,xn):["(",wn,")"]},ChainExpression:function(hn,xn,kn){l.OptionalChaining<xn&&(kn|=qn);var wn=this.generateExpression(hn.expression,l.OptionalChaining,kn);return xa(wn,l.OptionalChaining,xn)},NewExpression:function(hn,xn,kn){var wn,Gn,zn,Yn,ta;if(Gn=hn.arguments.length,ta=kn&ia&&!pn&&Gn===0?va:Ea,wn=ca("new",this.generateExpression(hn.callee,l.New,ta)),!(kn&ia)||pn||Gn>0){for(wn.push("("),zn=0,Yn=Gn;zn<Yn;++zn)wn.push(this.generateExpression(hn.arguments[zn],l.Assignment,Kn)),zn+1<Yn&&wn.push(","+un);wn.push(")")}return xa(wn,l.New,xn)},MemberExpression:function(hn,xn,kn){var wn,Gn;return wn=[this.generateExpression(hn.object,l.Call,kn&qn?Na:Ea)],hn.computed?(hn.optional&&wn.push("?."),wn.push("["),wn.push(this.generateExpression(hn.property,l.Sequence,kn&qn?Kn:va)),wn.push("]")):(!hn.optional&&hn.object.type===e.Literal&&typeof hn.object.value=="number"&&(Gn=Fa(wn).toString(),Gn.indexOf(".")<0&&!/[eExX]/.test(Gn)&&R.code.isDecimalDigit(Gn.charCodeAt(Gn.length-1))&&!(Gn.length>=2&&Gn.charCodeAt(0)===48)&&wn.push(" ")),wn.push(hn.optional?"?.":"."),wn.push(Ca(hn.property))),xa(wn,l.Member,xn)},MetaProperty:function(hn,xn,kn){var wn;return wn=[],wn.push(typeof hn.meta=="string"?hn.meta:Ca(hn.meta)),wn.push("."),wn.push(typeof hn.property=="string"?hn.property:Ca(hn.property)),xa(wn,l.Member,xn)},UnaryExpression:function(hn,xn,kn){var wn,Gn,zn,Yn,ta;return Gn=this.generateExpression(hn.argument,l.Unary,Kn),un===""?wn=ca(hn.operator,Gn):(wn=[hn.operator],hn.operator.length>2?wn=ca(wn,Gn):(Yn=Fa(wn).toString(),ta=Yn.charCodeAt(Yn.length-1),zn=Gn.toString().charCodeAt(0),((ta===43||ta===45)&&ta===zn||R.code.isIdentifierPartES5(ta)&&R.code.isIdentifierPartES5(zn))&&wn.push(Za()),wn.push(Gn))),xa(wn,l.Unary,xn)},YieldExpression:function(hn,xn,kn){var wn;return hn.delegate?wn="yield*":wn="yield",hn.argument&&(wn=ca(wn,this.generateExpression(hn.argument,l.Yield,Kn))),xa(wn,l.Yield,xn)},AwaitExpression:function(hn,xn,kn){var wn=ca(hn.all?"await*":"await",this.generateExpression(hn.argument,l.Await,Kn));return xa(wn,l.Await,xn)},UpdateExpression:function(hn,xn,kn){return hn.prefix?xa([hn.operator,this.generateExpression(hn.argument,l.Unary,Kn)],l.Unary,xn):xa([this.generateExpression(hn.argument,l.Postfix,Kn),hn.operator],l.Postfix,xn)},FunctionExpression:function(hn,xn,kn){var wn=[is(hn,!0),"function"];return hn.id?(wn.push(hs(hn)||Za()),wn.push(Ca(hn.id))):wn.push(hs(hn)||un),wn.push(this.generateFunctionBody(hn)),wn},ArrayPattern:function(hn,xn,kn){return this.ArrayExpression(hn,xn,kn,!0)},ArrayExpression:function(hn,xn,kn,wn){var Gn,zn,Yn=this;return hn.elements.length?(zn=wn?!1:hn.elements.length>1,Gn=["[",zn?ln:""],Ta(function(ta){var la,Xa;for(la=0,Xa=hn.elements.length;la<Xa;++la)hn.elements[la]?(Gn.push(zn?ta:""),Gn.push(Yn.generateExpression(hn.elements[la],l.Assignment,Kn))):(zn&&Gn.push(ta),la+1===Xa&&Gn.push(",")),la+1<Xa&&Gn.push(","+(zn?ln:un))}),zn&&!_i(Fa(Gn).toString())&&Gn.push(ln),Gn.push(zn?I:""),Gn.push("]"),Gn):"[]"},RestElement:function(hn,xn,kn){return"..."+this.generatePattern(hn.argument)},ClassExpression:function(hn,xn,kn){var wn,Gn;return wn=["class"],hn.id&&(wn=ca(wn,this.generateExpression(hn.id,l.Sequence,Kn))),hn.superClass&&(Gn=ca("extends",this.generateExpression(hn.superClass,l.Unary,Kn)),wn=ca(wn,Gn)),wn.push(un),wn.push(this.generateStatement(hn.body,Va)),wn},MethodDefinition:function(hn,xn,kn){var wn,Gn;return hn.static?wn=["static"+un]:wn=[],hn.kind==="get"||hn.kind==="set"?Gn=[ca(hn.kind,this.generatePropertyKey(hn.key,hn.computed)),this.generateFunctionBody(hn.value)]:Gn=[os(hn),this.generatePropertyKey(hn.key,hn.computed),this.generateFunctionBody(hn.value)],ca(wn,Gn)},Property:function(hn,xn,kn){return hn.kind==="get"||hn.kind==="set"?[hn.kind,Za(),this.generatePropertyKey(hn.key,hn.computed),this.generateFunctionBody(hn.value)]:hn.shorthand?hn.value.type==="AssignmentPattern"?this.AssignmentPattern(hn.value,l.Sequence,Kn):this.generatePropertyKey(hn.key,hn.computed):hn.method?[os(hn),this.generatePropertyKey(hn.key,hn.computed),this.generateFunctionBody(hn.value)]:[this.generatePropertyKey(hn.key,hn.computed),":"+un,this.generateExpression(hn.value,l.Assignment,Kn)]},ObjectExpression:function(hn,xn,kn){var wn,Gn,zn,Yn=this;return hn.properties.length?(wn=hn.properties.length>1,Ta(function(){zn=Yn.generateExpression(hn.properties[0],l.Sequence,Kn)}),!wn&&!ga(Fa(zn).toString())?["{",un,zn,un,"}"]:(Ta(function(ta){var la,Xa;if(Gn=["{",ln,ta,zn],wn)for(Gn.push(","+ln),la=1,Xa=hn.properties.length;la<Xa;++la)Gn.push(ta),Gn.push(Yn.generateExpression(hn.properties[la],l.Sequence,Kn)),la+1<Xa&&Gn.push(","+ln)}),_i(Fa(Gn).toString())||Gn.push(ln),Gn.push(I),Gn.push("}"),Gn)):"{}"},AssignmentPattern:function(hn,xn,kn){return this.generateAssignment(hn.left,hn.right,"=",xn,kn)},ObjectPattern:function(hn,xn,kn){var wn,Gn,zn,Yn,ta,la=this;if(!hn.properties.length)return"{}";if(Yn=!1,hn.properties.length===1)ta=hn.properties[0],ta.type===e.Property&&ta.value.type!==e.Identifier&&(Yn=!0);else for(Gn=0,zn=hn.properties.length;Gn<zn;++Gn)if(ta=hn.properties[Gn],ta.type===e.Property&&!ta.shorthand){Yn=!0;break}return wn=["{",Yn?ln:""],Ta(function(Xa){var za,Cs;for(za=0,Cs=hn.properties.length;za<Cs;++za)wn.push(Yn?Xa:""),wn.push(la.generateExpression(hn.properties[za],l.Sequence,Kn)),za+1<Cs&&wn.push(","+(Yn?ln:un))}),Yn&&!_i(Fa(wn).toString())&&wn.push(ln),wn.push(Yn?I:""),wn.push("}"),wn},ThisExpression:function(hn,xn,kn){return"this"},Super:function(hn,xn,kn){return"super"},Identifier:function(hn,xn,kn){return Ca(hn)},ImportDefaultSpecifier:function(hn,xn,kn){return Ca(hn.id||hn.local)},ImportNamespaceSpecifier:function(hn,xn,kn){var wn=["*"],Gn=hn.id||hn.local;return Gn&&wn.push(un+"as"+Za()+Ca(Gn)),wn},ImportSpecifier:function(hn,xn,kn){var wn=hn.imported,Gn=[wn.name],zn=hn.local;return zn&&zn.name!==wn.name&&Gn.push(Za()+"as"+Za()+Ca(zn)),Gn},ExportSpecifier:function(hn,xn,kn){var wn=hn.local,Gn=[wn.name],zn=hn.exported;return zn&&zn.name!==wn.name&&Gn.push(Za()+"as"+Za()+Ca(zn)),Gn},Literal:function(hn,xn,kn){var wn;if(hn.hasOwnProperty("raw")&&bn&&vn.raw)try{if(wn=bn(hn.raw).body[0].expression,wn.type===e.Literal&&wn.value===hn.value)return hn.raw}catch{}return hn.regex?"/"+hn.regex.pattern+"/"+hn.regex.flags:typeof hn.value=="bigint"?hn.value.toString()+"n":hn.bigint?hn.bigint+"n":hn.value===null?"null":typeof hn.value=="string"?rs(hn.value):typeof hn.value=="number"?sa(hn.value):typeof hn.value=="boolean"?hn.value?"true":"false":Ha(hn.value)},GeneratorExpression:function(hn,xn,kn){return this.ComprehensionExpression(hn,xn,kn)},ComprehensionExpression:function(hn,xn,kn){var wn,Gn,zn,Yn,ta=this;return wn=hn.type===e.GeneratorExpression?["("]:["["],vn.moz.comprehensionExpressionStartsWithAssignment&&(Yn=this.generateExpression(hn.body,l.Assignment,Kn),wn.push(Yn)),hn.blocks&&Ta(function(){for(Gn=0,zn=hn.blocks.length;Gn<zn;++Gn)Yn=ta.generateExpression(hn.blocks[Gn],l.Sequence,Kn),Gn>0||vn.moz.comprehensionExpressionStartsWithAssignment?wn=ca(wn,Yn):wn.push(Yn)}),hn.filter&&(wn=ca(wn,"if"+un),Yn=this.generateExpression(hn.filter,l.Sequence,Kn),wn=ca(wn,["(",Yn,")"])),vn.moz.comprehensionExpressionStartsWithAssignment||(Yn=this.generateExpression(hn.body,l.Assignment,Kn),wn=ca(wn,Yn)),wn.push(hn.type===e.GeneratorExpression?")":"]"),wn},ComprehensionBlock:function(hn,xn,kn){var wn;return hn.left.type===e.VariableDeclaration?wn=[hn.left.kind,Za(),this.generateStatement(hn.left.declarations[0],$a)]:wn=this.generateExpression(hn.left,l.Call,Kn),wn=ca(wn,hn.of?"of":"in"),wn=ca(wn,this.generateExpression(hn.right,l.Sequence,Kn)),["for"+un+"(",wn,")"]},SpreadElement:function(hn,xn,kn){return["...",this.generateExpression(hn.argument,l.Assignment,Kn)]},TaggedTemplateExpression:function(hn,xn,kn){var wn=Na;kn&qn||(wn=Ea);var Gn=[this.generateExpression(hn.tag,l.Call,wn),this.generateExpression(hn.quasi,l.Primary,qa)];return xa(Gn,l.TaggedTemplate,xn)},TemplateElement:function(hn,xn,kn){return hn.value.raw},TemplateLiteral:function(hn,xn,kn){var wn,Gn,zn;for(wn=["`"],Gn=0,zn=hn.quasis.length;Gn<zn;++Gn)wn.push(this.generateExpression(hn.quasis[Gn],l.Primary,Kn)),Gn+1<zn&&(wn.push("${"+un),wn.push(this.generateExpression(hn.expressions[Gn],l.Sequence,Kn)),wn.push(un+"}"));return wn.push("`"),wn},ModuleSpecifier:function(hn,xn,kn){return this.Literal(hn,xn,kn)},ImportExpression:function(hn,xn,kn){return xa(["import(",this.generateExpression(hn.source,l.Assignment,Kn),")"],l.Call,xn)}},Un(da.prototype,da.Expression),da.prototype.generateExpression=function(hn,xn,kn){var wn,Gn;return Gn=hn.type||e.Property,vn.verbatim&&hn.hasOwnProperty(vn.verbatim)?Ia(hn,xn):(wn=this[Gn](hn,xn,kn),vn.comment&&(wn=As(hn,wn)),Fa(wn,hn))},da.prototype.generateStatement=function(hn,xn){var kn,wn;return kn=this[hn.type](hn,xn),vn.comment&&(kn=As(hn,kn)),wn=Fa(kn).toString(),hn.type===e.Program&&!_n&&ln===""&&wn.charAt(wn.length-1)===`
|
||
`&&(kn=Sn?Fa(kn).replaceRight(/\s+$/,""):wn.replace(/\s+$/,"")),Fa(kn,hn)};function Ls(hn){var xn;if(xn=new da,Zn(hn))return xn.generateStatement(hn,Oa);if(Qn(hn))return xn.generateExpression(hn,l.Sequence,Kn);throw new Error("Unknown node type: "+hn.type)}function Vs(hn,xn){var kn=ua(),wn,Gn;return xn!=null?(typeof xn.indent=="string"&&(kn.format.indent.style=xn.indent),typeof xn.base=="number"&&(kn.format.indent.base=xn.base),xn=ha(kn,xn),z=xn.format.indent.style,typeof xn.base=="string"?I=xn.base:I=Jn(z,xn.format.indent.base)):(xn=kn,z=xn.format.indent.style,I=Jn(z,xn.format.indent.base)),se=xn.format.json,le=xn.format.renumber,tn=se?!1:xn.format.hexadecimal,an=se?"double":xn.format.quotes,sn=xn.format.escapeless,ln=xn.format.newline,un=xn.format.space,xn.format.compact&&(ln=un=z=I=""),pn=xn.format.parentheses,yn=xn.format.semicolons,_n=xn.format.safeConcatenation,Pn=xn.directive,bn=se?null:xn.parse,Sn=xn.sourceMap,An=xn.sourceCode,Dn=xn.format.preserveBlankLines&&An!==null,vn=xn,Sn&&(o.browser?p=commonjsGlobal.sourceMap.SourceNode:p=requireSourceMap().SourceNode),wn=Ls(hn),Sn?(Gn=wn.toStringWithSourceMap({file:xn.file,sourceRoot:xn.sourceMapRoot}),xn.sourceContent&&Gn.map.setSourceContent(xn.sourceMap,xn.sourceContent),xn.sourceMapWithCode?Gn:Gn.map.toString()):(Gn={code:wn.toString(),map:null},xn.sourceMapWithCode?Gn:Gn.code)}Bn={indent:{style:"",base:0},renumber:!0,hexadecimal:!0,quotes:"auto",escapeless:!0,compact:!0,parentheses:!1,semicolons:!1},Nn=ua().format,o.version=require$$3.version,o.generate=Vs,o.attachComments=b.attachComments,o.Precedence=ha({},l),o.browser=!1,o.FORMAT_MINIFY=Bn,o.FORMAT_DEFAULTS=Nn})()}(escodegen$1)),escodegen$1}var escodegenExports=requireEscodegen();const escodegen=getDefaultExportFromCjs(escodegenExports);class WalkerBase{constructor(){this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:()=>this.should_skip=!0,remove:()=>this.should_remove=!0,replace:e=>this.replacement=e}}replace(e,l,d,p){e&&l&&(d!=null?e[l][d]=p:e[l]=p)}remove(e,l,d){e&&l&&(d!=null?e[l].splice(d,1):delete e[l])}}class SyncWalker extends WalkerBase{constructor(e,l){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:()=>this.should_skip=!0,remove:()=>this.should_remove=!0,replace:d=>this.replacement=d},this.enter=e,this.leave=l}visit(e,l,d,p){if(e){if(this.enter){const R=this.should_skip,I=this.should_remove,z=this.replacement;this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.enter.call(this.context,e,l,d,p),this.replacement&&(e=this.replacement,this.replace(l,d,p,e)),this.should_remove&&this.remove(l,d,p);const se=this.should_skip,le=this.should_remove;if(this.should_skip=R,this.should_remove=I,this.replacement=z,se)return e;if(le)return null}let b;for(b in e){const R=e[b];if(R&&typeof R=="object")if(Array.isArray(R)){const I=R;for(let z=0;z<I.length;z+=1){const se=I[z];isNode(se)&&(this.visit(se,e,b,z)||z--)}}else isNode(R)&&this.visit(R,e,b,null)}if(this.leave){const R=this.replacement,I=this.should_remove;this.replacement=null,this.should_remove=!1,this.leave.call(this.context,e,l,d,p),this.replacement&&(e=this.replacement,this.replace(l,d,p,e)),this.should_remove&&this.remove(l,d,p);const z=this.should_remove;if(this.replacement=R,this.should_remove=I,z)return null}}return e}}function isNode(o){return o!==null&&typeof o=="object"&&"type"in o&&typeof o.type=="string"}function walk(o,{enter:e,leave:l}){return new SyncWalker(e,l).visit(o,null)}let widgetMethods=[];function registerWidgetType(o){widgetMethods.push(o)}let languages=new Map;function transpiler(o,e={}){const{wrapAsync:l=!1,addReturn:d=!0,emitMiniLocations:p=!0,emitWidgets:b=!0,blockBased:R=!1,range:I=[]}=e,z=[];let se=parse$6(o,{ecmaVersion:2022,allowAwaitOutsideFunction:!0,locations:!0,onComment:z});const le=findMiniDisableRanges(z,o.length);let tn=[],an=I&&I.length>0?I[0]:0,sn=[];const ln=(bn,Sn)=>{const An=languages.get("minilang");if(An){const Dn=`[${bn}]`,Bn=An.getLocations(Dn,Sn.start);tn=tn.concat(Bn)}else{const Dn=getLeafLocations(`"${bn}"`,Sn.start,o);tn=tn.concat(Dn)}};let un=[],pn=[],yn=[];walk(se,{enter(bn,Sn){if(R&&bn.start!==void 0&&(bn.start=bn.start+an,bn.end=bn.end+an),R&&Sn?.type==="Program")if(bn.type==="VariableDeclaration")for(const An of bn.declarations)An.id?.name&&sn.push(An.id.name);else bn.type==="FunctionDeclaration"&&bn.id?.name&&sn.push(bn.id.name);if(isLanguageLiteral(bn)){const{name:An}=bn.tag,Dn=languages.get(An),Bn=bn.quasi.quasis[0].value.raw,Nn=bn.quasi.start+1;if(p){const Qn=Dn.getLocations(Bn,Nn);tn=tn.concat(Qn)}return this.skip(),this.replace(languageWithLocation(An,Bn,Nn))}if(isTemplateLiteral(bn,"tidal")){const An=bn.quasi.quasis[0].value.raw,Dn=bn.quasi.start+1;if(p){const Bn=collectHaskellMiniLocations(An,Dn);tn=tn.concat(Bn)}return this.skip(),this.replace(tidalWithLocation(An,Dn))}if(isBackTickString(bn,Sn)){if(isMiniDisabled(bn.start,le))return;const{quasis:An}=bn,{raw:Dn}=An[0].value;return this.skip(),p&&ln(Dn,bn),this.replace(miniWithLocation(Dn,bn))}if(isStringWithDoubleQuotes(bn)){if(isMiniDisabled(bn.start,le))return;const{value:An}=bn;return this.skip(),p&&ln(An,bn),this.replace(miniWithLocation(An,bn))}if(isSliderFunction(bn)){const An=bn.arguments[0].start+an,Dn=bn.arguments[0].end+an,Bn=`${An}:${Dn}`,Nn={from:An,to:Dn,id:Bn,value:bn.arguments[0].raw,min:bn.arguments[1]?.value??0,max:bn.arguments[2]?.value??1,step:bn.arguments[3]?.value,type:"slider"};return b&&un.push(Nn),pn.push(Nn),this.replace(sliderWithLocation(bn,an))}if(isWidgetMethod(bn)){const An=bn.callee.property.name,Dn=un.filter(Nn=>Nn.type===An).length,Bn={from:bn.start,to:bn.end,index:Dn,type:An,id:e.id};return b&&un.push(Bn),this.replace(widgetWithLocation(bn,Bn))}if(isBareSamplesCall(bn,Sn))return this.replace(withAwait(bn));if(isLabelStatement(bn))return R&&yn.push({name:bn.label.name,index:bn.start-an,end:bn.label.end-an,fullMatch:o.slice(bn.start-an,bn.label.end-an),activeVisualizer:findVisualizerInSubtree(bn.body)}),this.replace(labelToP(bn));R&&isAllCall(bn)&&yn.push({name:"all",index:bn.start-an,end:bn.end-an,fullMatch:o.slice(bn.start-an,bn.end-an),activeVisualizer:bn.arguments[0]?findVisualizerInSubtree(bn.arguments[0]):null})},leave(bn,Sn,An,Dn){if(!isKabelCall(bn))return;let[Bn,...Nn]=bn.arguments;if(!Bn)throw new Error("K(...) requires an expression");shouldCallKabelExpression(Bn)&&(Bn={type:"CallExpression",callee:Bn,arguments:[],optional:!1});const{template:Qn,patternExprs:Zn}=extractPatternPlaceholders(Bn);if(Zn.length){const ra=[{type:"Literal",value:Qn},...Zn,...Nn];let aa=bn.callee;return aa.type==="ChainExpression"&&(aa=aa.expression),aa.type==="MemberExpression"?this.replace({type:"CallExpression",callee:workletMemberAst(aa.object),arguments:ra,optional:!1}):this.replace({type:"CallExpression",callee:{type:"Identifier",name:"worklet"},arguments:ra,optional:!1})}const qn=[{type:"Literal",value:genExprSource(Bn)},...Nn];let ia=bn.callee;return ia.type==="ChainExpression"&&(ia=ia.expression),ia.type==="MemberExpression"?this.replace({type:"CallExpression",callee:workletMemberAst(ia.object),arguments:qn,optional:!1}):this.replace({type:"CallExpression",callee:{type:"Identifier",name:"worklet"},arguments:qn,optional:!1})}});let{body:_n}=se;const Pn={type:"ExpressionStatement",expression:{type:"Identifier",name:"silence"}};if(_n.length?_n?.[_n.length-1]?.expression||_n.push(Pn):(console.warn("empty body -> fallback to silence"),_n.push(Pn)),R&&sn.length>0){const bn=sn.flatMap(Sn=>createScopeAssignment(Sn));_n.splice(_n.length-1,0,...bn)}if(d){const{expression:bn}=_n[_n.length-1];_n[_n.length-1]={type:"ReturnStatement",argument:bn}}let vn=escodegen.generate(se);return l&&(vn=`(async ()=>{${vn}})()`),p?{output:vn,miniLocations:tn,widgets:un,sliders:pn,labels:yn}:{output:vn}}function isKabelCall(o){if(o.type!=="CallExpression")return!1;let e=o.callee;return e.type==="ChainExpression"&&(e=e.expression),e.type==="MemberExpression"?!e.computed&&e.property?.name==="K":e.type==="Identifier"&&e.name==="K"}function shouldCallKabelExpression(o){return o.type!=="ArrowFunctionExpression"&&o.type!=="FunctionExpression"||o.params.length?!1:o.body?.type==="BlockStatement"}function genExprSource(o){return escodegen.generate(o,{format:{semicolons:!1}})}function extractPatternPlaceholders(o){const e=cloneNode(o),l=new Map,d=[];if(walk(e,{enter(I,z,se,le){l.set(I,{parent:z,prop:se,index:le});const tn=getStrudelPatternExpr(I);tn&&(d.push({node:I,patternExpr:tn}),this.skip())}}),!d.length)return{template:genExprSource(e),patternExprs:[]};d.sort((I,z)=>getPatternNodeOrder(I.node)-getPatternNodeOrder(z.node));const p=d.map(({patternExpr:I})=>cloneNode(I));let b=e;return d.forEach(({node:I},z)=>{b=replaceNode(I,placeholderAst(z),l,b)}),{template:genExprSource(b),patternExprs:p}}function getStrudelPatternExpr(o){if(isStrudelPatternWrap(o)){const e=o.arguments?.[0];if(!e)throw new Error("S(...) requires an argument");return e}return isMiniCall(o)?o:null}function isStrudelPatternWrap(o){if(o.type!=="CallExpression")return!1;const e=o.callee;return e.type==="Identifier"?e.name==="S":e.type==="MemberExpression"&&!e.computed?e.property?.name==="S":!1}function getMinilangName(){return languages.get("minilang")?.name||"m"}function isMiniCall(o){if(o.type!=="CallExpression")return!1;const e=o.callee;if(e.type!=="Identifier"||e.name!==getMinilangName())return!1;const l=o.arguments?.[0];return l?.type==="Literal"&&typeof l.value=="string"}function getPatternNodeOrder(o){if(typeof o.start=="number")return o.start;if(isMiniCall(o)){const e=o.arguments?.[1];if(e?.type==="Literal"&&typeof e.value=="number")return e.value}return 0}function placeholderAst(o){return{type:"MemberExpression",object:{type:"Identifier",name:"pat"},property:{type:"Literal",value:o},computed:!0,optional:!1}}function replaceNode(o,e,l,d){const p=l.get(o);if(!p||!p.parent)return e;const{parent:b,prop:R,index:I}=p;return Array.isArray(b[R])?b[R][I]=e:b[R]=e,l.set(e,{parent:b,prop:R,index:I}),d}function cloneNode(o){return JSON.parse(JSON.stringify(o))}function workletMemberAst(o){return{type:"MemberExpression",object:o,property:{type:"Identifier",name:"worklet"},computed:!1,optional:!1}}function isStringWithDoubleQuotes(o,e,l){return o.type!=="Literal"?!1:o.raw[0]==='"'}function isBackTickString(o,e){return o.type==="TemplateLiteral"&&e.type!=="TaggedTemplateExpression"}function miniWithLocation(o,e){const{start:l}=e,d=languages.get("minilang");let p="m";return d&&d.name&&(p=d.name),{type:"CallExpression",callee:{type:"Identifier",name:p},arguments:[{type:"Literal",value:o},{type:"Literal",value:l}],optional:!1}}function isSliderFunction(o){return o.type==="CallExpression"&&o.callee.name==="slider"}function isWidgetMethod(o){return o.type==="CallExpression"&&widgetMethods.includes(o.callee.property?.name)}function sliderWithLocation(o,e=0){const l=o.arguments[0].start+e,d=o.arguments[0].end+e,p=`${l}:${d}`;return o.arguments.unshift({type:"Literal",value:p,raw:p}),o.callee.name="sliderWithID",o}function getWidgetID(o){let e;return o.from!==void 0&&o.to!==void 0?e=`${o.from}-${o.to}`:e=o.to||o.from||0,`${`${o.id||""}_widget_${o.type}`}_${o.index}_${e}`}function widgetWithLocation(o,e){const l=getWidgetID(e);return e.id=l,o.arguments.unshift({type:"Literal",value:l,raw:l}),o}function isBareSamplesCall(o,e){return o.type==="CallExpression"&&o.callee.name==="samples"&&e.type!=="AwaitExpression"}function isAllCall(o){return o.type==="CallExpression"&&o.callee.name==="all"}function withAwait(o){return{type:"AwaitExpression",argument:o}}function isLabelStatement(o){return o.type==="LabeledStatement"}function labelToP(o){return{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:o.body.expression,property:{type:"Identifier",name:"p"}},arguments:[{type:"Literal",value:o.label.name,raw:`'${o.label.name}'`}]}}}function isLanguageLiteral(o){return o.type==="TaggedTemplateExpression"&&languages.has(o.tag.name)}function isTemplateLiteral(o,e){return o.type==="TaggedTemplateExpression"&&o.tag.name===e}function collectHaskellMiniLocations(o,e){return o.split("").reduce((l,d,p)=>(d!=='"'||(!l.length||l[l.length-1].length>1?l.push([p+1]):l[l.length-1].push(p)),l),[]).map(([l,d])=>{const p=o.slice(l,d);return getLeafLocations(`"${p}"`,e+l-1)}).flat()}function tidalWithLocation(o,e){return{type:"CallExpression",callee:{type:"Identifier",name:"tidal"},arguments:[{type:"Literal",value:o},{type:"Literal",value:e}],optional:!1}}function languageWithLocation(o,e,l){return{type:"CallExpression",callee:{type:"Identifier",name:o},arguments:[{type:"Literal",value:e},{type:"Literal",value:l}],optional:!1}}const nonInlineWidgets=["punchcard","spiral","scope","pitchwheel","spectrum","pianoroll","wordfall"];function isVisualizerCall(o){return o.type==="CallExpression"&&o.callee.type==="MemberExpression"&&nonInlineWidgets.includes(o.callee.property?.name)?o.callee.property.name:null}function findVisualizerInSubtree(o){if(!o||typeof o!="object")return null;const e=isVisualizerCall(o);if(e)return e;for(const l of Object.keys(o)){if(l==="parent")continue;const d=o[l];if(Array.isArray(d))for(const p of d){const b=findVisualizerInSubtree(p);if(b)return b}else if(d&&typeof d=="object"&&d.type){const p=findVisualizerInSubtree(d);if(p)return p}}return null}function createScopeAssignment(o){return[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"userDefinedKeys"},property:{type:"Identifier",name:"add"},computed:!1},arguments:[{type:"Literal",value:o}]}},{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"MemberExpression",object:{type:"Identifier",name:"strudelScope"},property:{type:"Identifier",name:o},computed:!1},right:{type:"Identifier",name:o}}},{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"MemberExpression",object:{type:"Identifier",name:"globalThis"},property:{type:"Identifier",name:o},computed:!1},right:{type:"Identifier",name:o}}}]}function findMiniDisableRanges(o,e){const l=[],d=[];for(const p of o){const b=p.value.trim();if(b.startsWith("mini-off"))d.push(p.start);else if(b.startsWith("mini-on")){const R=d.pop();l.push([R,p.end])}}for(;d.length;){const p=d.pop();l.push([p,e])}return l}function isMiniDisabled(o,e){for(const[l,d]of e)if(o>=l&&o<d)return!0;return!1}if(typeof DelayNode<"u"){class o extends DelayNode{constructor(l,d,p,b){return super(l),d=Math.abs(d),this.delayTime.value=p,this.feedbackGain=l.createGain(),this.feedbackGain.gain.value=Math.min(Math.abs(b),.995),this.feedback=this.feedbackGain.gain,this.delayGain=l.createGain(),this.delayGain.gain.value=d,this.connect(this.feedbackGain),this.connect(this.delayGain),this.feedbackGain.connect(this),this.connect=R=>this.delayGain.connect(R),this}start(l){this.delayGain.gain.setValueAtTime(this.delayGain.gain.value,l+this.delayTime.value)}}BaseAudioContext.prototype.createFeedbackDelay=function(e,l,d){return new o(this,e,l,d)}}let audioContext;const setDefaultAudioContext=()=>(audioContext=new AudioContext,audioContext),setAudioContext=o=>(audioContext=o,audioContext),getAudioContext=()=>audioContext||setDefaultAudioContext();function getAudioContextCurrentTime(){return getAudioContext().currentTime}let log=o=>console.log(o);function errorLogger(o,e="superdough"){logger$1(`[${e}] error: ${o.message}`)}const logger$1=(...o)=>log(...o),setLogger=o=>{log=o};let noiseCache={};function getNoiseBuffer(o,e){const l=getAudioContext();if(noiseCache[o])return noiseCache[o];const d=2*l.sampleRate,p=l.createBuffer(1,d,l.sampleRate),b=p.getChannelData(0);let R=0,I,z,se,le,tn,an,sn;I=z=se=le=tn=an=sn=0;for(let ln=0;ln<d;ln++)if(o==="white")b[ln]=Math.random()*2-1;else if(o==="brown"){let un=Math.random()*2-1;b[ln]=(R+.02*un)/1.02,R=b[ln]}else if(o==="pink"){let un=Math.random()*2-1;I=.99886*I+un*.0555179,z=.99332*z+un*.0750759,se=.969*se+un*.153852,le=.8665*le+un*.3104856,tn=.55*tn+un*.5329522,an=-.7616*an-un*.016898,b[ln]=I+z+se+le+tn+an+sn+un*.5362,b[ln]*=.11,sn=un*.115926}else if(o==="crackle"){const un=e*.01;Math.random()<un?b[ln]=Math.random()*2-1:b[ln]=0}return o!=="crackle"&&(noiseCache[o]=p),p}function getNoiseOscillator(o="white",e,l=.02){const p=getAudioContext().createBufferSource();return p.buffer=getNoiseBuffer(o,l),p.loop=!0,p.start(e),{node:p,stop:b=>p.stop(b)}}function getNoiseMix(o,e,l){const d=getNoiseOscillator("pink",l),p=drywet(o,d.node,e);return onceEnded(d.node,()=>{releaseAudioNode(d.node)}),{node:p.node,stop:b=>d?.stop(b),teardown:p.teardown}}const nodePools=new Map,POOL_KEY=Symbol("nodePoolKey"),isPoolable=o=>!!o[POOL_KEY],getNodeTime=o=>o.context?.currentTime??0,getParams=o=>{const e=new Set;o.parameters?.forEach(p=>e.add(p));const l=new Set;let d=o;for(;d!==Object.prototype;){for(const p of Object.getOwnPropertyNames(d)){if(l.has(p))continue;l.add(p);const b=o[p];b instanceof AudioParam&&e.add(b)}d=Object.getPrototypeOf(d)}return e},releaseNodeToPool=o=>{if(o.disconnect(),o instanceof AudioScheduledSourceNode)return;const e=o[POOL_KEY];if(e==null)return;const l=getNodeTime(o);getParams(o).forEach(p=>p.cancelScheduledValues(l));const d=nodePools.get(e)??[];d.push(new WeakRef(o)),nodePools.set(e,d)},isNodeAlive=o=>{if(!(o instanceof AudioWorkletNode))return!0;const e=getNodeTime(o),l=o?.parameters?.get("end").value??0;return e<l+.45},getNodeFromPool=(o,e)=>{const l=nodePools.get(o)??[];let d,p=!1;for(;l.length;)if(d=l.pop()?.deref(),d!=null&&isNodeAlive(d)){p=!0;break}return p||(d=e()),d[POOL_KEY]=o,d},tokenizeNote$2=o=>{if(typeof o!="string")return[];const[e,l="",d]=o.match(/^([a-gA-G])([#bsf]*)(-?[0-9]*)$/)?.slice(1)||[];return e?[e,l,d?Number(d):void 0]:[]},chromas$1={c:0,d:2,e:4,f:5,g:7,a:9,b:11},accs$1={"#":1,b:-1,s:1,f:-1},getAccidentalsOffset=o=>o?.split("").reduce((e,l)=>e+accs$1[l],0)||0,noteToMidi=(o,e=3)=>{const[l,d,p=e]=tokenizeNote$2(o);if(!l)throw new Error('not a note: "'+o+'"');const b=chromas$1[l.toLowerCase()],R=getAccidentalsOffset(d);return(Number(p)+1)*12+b+R},midiToFreq$1=o=>Math.pow(2,(o-69)/12)*440,clamp=(o,e,l)=>Math.min(Math.max(o,e),l),freqToMidi$1=o=>12*Math.log(o/440)/Math.LN2+69,valueToMidi=(o,e)=>{if(typeof o!="object")throw new Error("valueToMidi: expected object value");let{freq:l,note:d}=o;return typeof l=="number"?freqToMidi$1(l):typeof d=="string"?noteToMidi(d):typeof d=="number"?d:e};function nanFallback(o,e=0,l){return isNaN(Number(o))?(!l&&logger$1(`"${o}" is not a number, falling back to ${e}`,"warning"),e):o}const _mod$1=(o,e)=>(o%e+e)%e,getSoundIndex=(o,e)=>_mod$1(Math.round(nanFallback(o,0)),e);function cycleToSeconds(o,e){return o/e}function getCommonSampleInfo(o,e){const{s:l,n:d=0}=o;let p=valueToMidi(o,36),b=p-36,R,I=0;if(Array.isArray(e))I=getSoundIndex(d,e.length),R=e[I];else{const se=tn=>noteToMidi(tn)-p,le=Object.keys(e).filter(tn=>!tn.startsWith("_")).reduce((tn,an,sn)=>!tn||Math.abs(se(an))<Math.abs(se(tn))?an:tn,null);b=-se(le),I=getSoundIndex(d,e[le].length),R=e[le][I]}const z=`${l}:${I}`;return{transpose:b,url:R,index:I,midi:p,label:z}}const pickAndRename=(o,e)=>Object.fromEntries(Object.entries(e).map(([l,d])=>[l,o[d]])),getBaseURL=o=>{try{return new URL(".",new URL(o)).href.replace(/\/$/,"")}catch{return o.split("/").slice(0,-1).join("/")}},noises=["pink","white","brown","crackle"];function gainNode(o){const e=getAudioContext().createGain();return e.gain.value=o,e}function effectSend(o,e,l){const d=gainNode(l);return o.connect(d),d.connect(e),d}const getSlope=(o,e,l,d)=>d-l===0?0:(e-o)/(d-l);function getWorklet(o,e,l,d){const p=new AudioWorkletNode(o,e,d);return Object.entries(l).forEach(([b,R])=>{R!==void 0&&(p.parameters.get(b).value=R)}),p}const getParamADSR=(o,e,l,d,p,b,R,I,z,se="exponential")=>{e=nanFallback(e),l=nanFallback(l),d=nanFallback(d),p=nanFallback(p);const le=se==="exponential"?"exponentialRampToValueAtTime":"linearRampToValueAtTime";se==="exponential"&&(b=b===0?.001:b,R=R===0?.001:R);const tn=R-b,an=b+d*tn,sn=z-I,ln=un=>{let pn;return e>un?pn=un*getSlope(b,R,0,e)+b:pn=(un-e)*getSlope(R,an,0,l)+R,se==="exponential"&&(pn=pn||.001),pn};o.setValueAtTime(b,I),e>sn?o[le](ln(sn),z):e+l>sn?(o[le](ln(e),I+e),o[le](ln(sn),z)):(o[le](ln(e),I+e),o[le](ln(e+l),I+e+l),o.setValueAtTime(an,z)),o[le](b,z+p)};function getModulationShapeInput(o){return typeof o=="number"?o%5:{tri:0,triangle:0,sine:1,ramp:2,saw:3,square:4}[o]??0}function getEnvelope(o,e={}){return getWorklet(o,"envelope-processor",e)}function getLfo(o,e={}){const{shape:l=0,begin:d=0,end:p=0,time:b,depth:R=1,dcoffset:I=-.5,frequency:z=1,skew:se=.5,phaseoffset:le=0,curve:tn=1,min:an,max:sn,...ln}=e,un={begin:d,end:p,time:b??d,depth:R,dcoffset:I,frequency:z,skew:se,phaseoffset:le,curve:tn,shape:getModulationShapeInput(l),min:an??I*R,max:sn??I*R+R,...ln};return getWorklet(o,"lfo-processor",un)}function getCompressor(o,e,l,d,p,b){const R=getNodeFromPool("compressor",()=>new DynamicsCompressorNode(o,{}));return Object.entries({threshold:e??-3,ratio:l??10,knee:d??10,attack:p??.005,release:b??.05}).forEach(([z,se])=>{R[z].value=se}),R}const getADSRValues=(o,e="linear",l)=>{const[R,I,z,se]=o;if(R==null&&I==null&&z==null&&se==null)return l??[.001,.001,1,.01];const le=z??(R!=null&&I==null||R==null&&I==null?1:.001);return[Math.max(R??0,.001),Math.max(I??0,.001),Math.min(le,1),Math.max(se??0,.01)]};function getParamLfo(o,e,l,d,p){let{defaultDepth:b=1,depth:R,dcoffset:I,...z}=p;R==null&&(R=Object.values(z).some(tn=>tn!=null)?b:0);let se;return R&&(se=getLfo(o,{begin:l,end:d,depth:R,dcoffset:I,...z}),se.connect(e)),se}function applyParameterModulators(o,e,l,d,p,b){let{amount:R,offset:I,defaultAmount:z=1,curve:se="linear",values:le,holdEnd:tn,defaultValues:an}=p;R==null&&(R=le.some(_n=>_n!=null)?z:0);const sn=I??0,ln=R+sn;if(Math.abs(ln-sn)){const[yn,_n,Pn,vn]=getADSRValues(le,se,an);getParamADSR(e,yn,_n,Pn,vn,sn,ln,l,tn,se)}return getParamLfo(o,e,l,d,b)}function createFilter(o,e,l,d,p,b){let{frequency:R,anchor:I,env:z,type:se,model:le,q:tn=1,drive:an=.69,depth:sn,depthfrequency:ln,dcoffset:un=-.5,skew:pn,shape:yn,rate:_n,sync:Pn}=d,vn,bn;le==="ladder"?(bn=getWorklet(o,"ladder-processor",{frequency:R,q:tn,drive:an}),vn=bn.parameters.get("frequency")):(bn=getNodeFromPool("filter",()=>o.createBiquadFilter()),bn.type=se,Object.entries({Q:tn,frequency:R}).forEach(([ia,ra])=>{bn[ia].value=ra}),vn=bn.frequency);const Sn=[d.attack,d.decay,d.sustain,d.release],[An,Dn,Bn,Nn]=getADSRValues(Sn,"exponential",[.005,.14,0,.1]);if([...Sn,z].some(qn=>qn!==void 0)){z=nanFallback(z,1,!0),I=nanFallback(I,0,!0);const qn=Math.abs(z),ia=qn*I;let ra=clamp(2**-ia*R,0,2e4),aa=clamp(2**(qn-ia)*R,0,2e4);z<0&&([ra,aa]=[aa,ra]),getParamADSR(vn,An,Dn,Bn,Nn,ra,aa,e,l,"exponential")}Pn!=null&&(_n=p*Pn);const Zn=[sn,ln,pn,yn,_n].some(qn=>qn!==void 0);let Vn;if(Zn){sn=sn??1;const qn=b/p,ra={depth:ln??(sn??1)*R,dcoffset:un,skew:pn,shape:yn,frequency:_n??p,min:-R+30,max:2e4-R,time:qn,curve:1};Vn=getParamLfo(o,vn,e,l,ra)}return{filter:bn,lfo:Vn}}let wetfade=o=>o<.5?1:1-(o-.5)/.5;function drywet(o,e,l=0){const d=getAudioContext();if(!l)return o;let p=d.createGain(),b=d.createGain();o.connect(p),e.connect(b),p.gain.value=wetfade(l),b.gain.value=wetfade(1-l);let R=d.createGain();return p.connect(R),b.connect(R),{node:R,teardown:()=>{releaseAudioNode(p),releaseAudioNode(b),o.disconnect(p),e.disconnect(b)}}}let curves=["linear","exponential"];function getPitchEnvelope(o,e,l,d){if((e.pattack??e.pdecay??e.psustain??e.prelease??e.penv)===void 0)return;const b=nanFallback(e.penv,1,!0),R=curves[e.pcurve??0];let[I,z,se,le]=getADSRValues([e.pattack,e.pdecay,e.psustain,e.prelease],R,[.2,.001,1,.001]),tn=e.panchor??se;const an=b*100,sn=0-an*tn,ln=an-an*tn;getParamADSR(o,I,z,se,le,sn,ln,l,d,R)}function getVibratoOscillator(o,e,l){const{vibmod:d=.5,vib:p}=e;let b;if(p>0){b=getAudioContext().createOscillator(),b.frequency.value=p;const R=getAudioContext().createGain();return R.gain.value=d*100,b.connect(R),R.connect(o),onceEnded(b,()=>{releaseAudioNode(R),releaseAudioNode(b)}),b.start(l),{stop:I=>b.stop(I),nodes:{vib:[b],vib_gain:[R]}}}}function scheduleAtTime(o,e,l=getAudioContext()){const d=l.currentTime;webAudioTimeout(l,o,d,e)}function webAudioTimeout(o,e,l,d){const p=new ConstantSourceNode(o),b=gainNode(0);return b.connect(o.destination),p.connect(b),onceEnded(p,()=>{releaseAudioNode(b),releaseAudioNode(p),e()}),p.start(l),p.stop(d),p}const mod$2=(o,e="sine")=>{const l=getAudioContext();let d;return noises.includes(e)?(d=l.createBufferSource(),d.buffer=getNoiseBuffer(e,2),d.loop=!0):(d=l.createOscillator(),d.type=e,d.frequency.value=o),d.start(),d},fm=(o,e,l="sine")=>{const p=o.value*e;return{osc:mod$2(p,l),freq:p}};function applyFM(o,e,l){const d=getAudioContext(),p=[],b={},R={};for(let I=1;I<=8;I++)for(let z=0;z<=8;z++){let se;I===z+1?se=`fmi${I===1?"":I}`:se=`fmi${I}${z}`;const le=e[se];if(!le)continue;let tn=[];for(let[an,sn]of[[!0,I],[!1,z]]){if(sn===0){tn.push(o);continue}if(!b[sn]){const bn=sn===1?"":sn,{osc:Sn,freq:An}=fm(o,e[`fmh${bn}`]??1,e[`fmwave${bn}`]??"sine");p.push(Sn);const Dn=[Sn],Bn=["attack","decay","sustain","release"].map(Qn=>e[`fm${Qn}${bn}`]);let Nn=Sn;if(Bn.some(Qn=>Qn!==void 0)){const Qn=d.createGain(),[Zn,Vn,qn,ia]=getADSRValues(Bn),ra=l+e.duration,aa=e[`fmenv${bn}`]??"exp";getParamADSR(Qn.gain,Zn,Vn,qn,ia,0,1,l,ra,aa==="exp"?"exponential":"linear"),Dn.push(Qn),Nn=Sn.connect(Qn)}b[sn]={input:Sn.frequency,output:Nn,freq:An,osc:Sn,toCleanup:Dn},R[`fm_${sn}`]=[Sn]}const{input:ln,output:un,freq:pn,osc:yn,toCleanup:_n}=b[sn],Pn=gainNode(le),vn=gainNode(pn);tn.push(an?un.connect(Pn).connect(vn):ln),cleanupOnEnd(yn,[..._n,Pn,vn]),R[`fm_${sn}_gain`]=[Pn]}if(!tn[1]){logger$1(`[superdough] control ${se} failed to connect FM ${I} to target ${z} due to missing frequency parameter (likely because fm${z} is noise)`,"warning");continue}tn[0].connect(tn[1])}return{nodes:R,stop:I=>p.forEach(z=>z?.stop(I))}}const __squash=o=>o/(1+o),_mod=(o,e)=>(o%e+e)%e,_scurve=(o,e)=>(1+e)*o/(1+e*Math.abs(o)),_soft=(o,e)=>Math.tanh(o*(1+e)),_hard=(o,e)=>clamp((1+e)*o,-1,1),_fold=(o,e)=>{let l=(1+.5*e)*o;const d=_mod(l+1,4);return 1-Math.abs(d-2)},_sineFold=(o,e)=>Math.sin(Math.PI/2*_fold(o,e)),_cubic=(o,e)=>{const l=__squash(Math.log1p(e)),d=(o-l/3*o*o*o)/(1-l/3);return _soft(d,e)},_diode=(o,e,l=!1)=>{const d=1+2*e,b=.07*__squash(Math.log1p(e)),R=_soft(o+b,2*e),I=_soft(l?b:-o+b,2*e),z=R-I,se=1/Math.cosh(d*b),le=se*se,tn=Math.max(1e-8,(l?1:2)*d*le);return _soft(z/tn,e)},_asym=(o,e)=>_diode(o,e,!0),_chebyshev=(o,e)=>{const l=10*Math.log1p(e);let d=1,p=o,b,R=0;for(let I=1;I<64;I++){if(I<2){R+=I==0?d:p;continue}b=2*o*d-p,p=d,d=b,I%2===0&&(R+=Math.min(1.3*l/I,2)*b)}return _soft(R,l/20)},distortionAlgorithms={scurve:_scurve,soft:_soft,hard:_hard,cubic:_cubic,diode:_diode,asym:_asym,fold:_fold,sinefold:_sineFold,chebyshev:_chebyshev},_algoNames=Object.freeze(Object.keys(distortionAlgorithms)),getDistortionAlgorithm=o=>{let e=o;typeof o=="string"&&(e=_algoNames.indexOf(o),e===-1&&(logger$1(`[superdough] Could not find waveshaping algorithm ${o}.
|
||
Available options are ${_algoNames.join(", ")}.
|
||
Defaulting to ${_algoNames[0]}.`),e=0));const l=_algoNames[e%_algoNames.length];return distortionAlgorithms[l]},getDistortion=(o,e,l)=>getWorklet(getAudioContext(),"distort-processor",{distort:o,postgain:e},{processorOptions:{algorithm:l}}),getFrequencyFromValue=(o,e=36)=>{let{note:l,freq:d,octave:p=0}=o;return l=l||e,typeof l=="string"&&(l=noteToMidi(l)),!d&&typeof l=="number"&&(d=midiToFreq$1(l)),d*=Math.pow(2,p),Number(d)},onceEnded=(o,e)=>{const l=e;o.onended=function(){l&&l(),this.onended=null}},releaseAudioNode=o=>{if(o!=null){if(!(o instanceof AudioNode))throw new Error("releaseAudioNode can only release an AudioNode");if(o.disconnect(),o instanceof AudioScheduledSourceNode)try{o.stop()}catch{o.start(o.context.currentTime+5),o.stop()}o instanceof AudioWorkletNode&&o.parameters.get("end")?.setValueAtTime(0,0)}},cleanupOnEnd=(o,e)=>{onceEnded(o,()=>e.forEach(l=>releaseAudioNode(l)))};var reverbGen={};reverbGen.generateReverb=function(o,e){for(var l=o.audioContext||new AudioContext,d=l.sampleRate,p=o.numChannels||2,b=o.decayTime*1.5,R=Math.round(o.decayTime*d),I=Math.round(b*d),z=Math.round((o.fadeInTime||0)*d),se=Math.pow(1/1e3,1/R),le=l.createBuffer(p,I,d),tn=0;tn<p;tn++){for(var an=le.getChannelData(tn),sn=0;sn<I;sn++)an[sn]=randomSample()*Math.pow(se,sn);for(var sn=0;sn<z;sn++)an[sn]*=sn/z}applyGradualLowpass(le,o.lpFreqStart||0,o.lpFreqEnd||0,o.decayTime,e)},reverbGen.generateGraph=function(o,e,l,d,p){var b=document.createElement("canvas");b.width=e,b.height=l;var R=b.getContext("2d");R.fillStyle="#000",R.fillRect(0,0,b.width,b.height),R.fillStyle="#fff";for(var I=e/o.length,z=l/(p-d),se=0;se<o.length;se++)R.fillRect(se*I,l-(o[se]-d)*z,1,1);return b};var applyGradualLowpass=function(o,e,l,d,p){if(e==0){p(o);return}var b=getAllChannelData(o),R=new OfflineAudioContext(o.numberOfChannels,b[0].length,o.sampleRate),I=R.createBufferSource();I.buffer=o;var z=R.createBiquadFilter();e=Math.min(e,o.sampleRate/2),l=Math.min(l,o.sampleRate/2),z.type="lowpass",z.Q.value=1e-4,z.frequency.setValueAtTime(e,0),z.frequency.linearRampToValueAtTime(l,d),I.connect(z),z.connect(R.destination),I.start(),R.oncomplete=function(se){p(se.renderedBuffer),releaseAudioNode(z),releaseAudioNode(I)},R.startRendering(),window.filterNode=z},getAllChannelData=function(o){for(var e=[],l=0;l<o.numberOfChannels;l++)e[l]=o.getChannelData(l);return e},randomSample=function(){return Math.random()*2-1};typeof AudioContext<"u"&&(BaseAudioContext.prototype.adjustLength=function(o,e,l=1,d=0){const p=Math.floor(clamp(d,0,1)*e.length),b=e.sampleRate*o,R=this.createBuffer(e.numberOfChannels,e.length,e.sampleRate);for(let I=0;I<e.numberOfChannels;I++){let z=e.getChannelData(I),se=R.getChannelData(I);for(let le=0;le<b;le++){let tn=(p+le*Math.abs(l))%z.length;l<1&&(tn=tn*-1),se[le]=z.at(tn)||0}}return R},BaseAudioContext.prototype.createReverb=function(o,e,l,d,p,b,R){const I=this.createConvolver();return I.generate=(z=2,se=.1,le=15e3,tn=1e3,an,sn,ln)=>{I.duration=z,I.fade=se,I.lp=le,I.dim=tn,I.ir=an,I.irspeed=sn,I.irbegin=ln,an?I.buffer=this.adjustLength(z,an,sn,ln):reverbGen.generateReverb({audioContext:this,numChannels:2,decayTime:z,fadeInTime:se,lpFreqStart:le,lpFreqEnd:tn},un=>{I.buffer=un})},I.generate(o,e,l,d,p,b,R),I});var vowelFormant={a:{freqs:[660,1120,2750,3e3,3350],gains:[1,.5012,.0708,.0631,.0126],qs:[80,90,120,130,140]},e:{freqs:[440,1800,2700,3e3,3300],gains:[1,.1995,.1259,.1,.1],qs:[70,80,100,120,120]},i:{freqs:[270,1850,2900,3350,3590],gains:[1,.0631,.0631,.0158,.0158],qs:[40,90,100,120,120]},o:{freqs:[430,820,2700,3e3,3300],gains:[1,.3162,.0501,.0794,.01995],qs:[40,80,100,120,120]},u:{freqs:[370,630,2750,3e3,3400],gains:[1,.1,.0708,.0316,.01995],qs:[40,60,100,120,120]},ae:{freqs:[650,1515,2400,3e3,3350],gains:[1,.5,.1008,.0631,.0126],qs:[80,90,120,130,140]},aa:{freqs:[560,900,2570,3e3,3300],gains:[1,.5,.0708,.0631,.0126],qs:[80,90,120,130,140]},oe:{freqs:[500,1430,2300,3e3,3300],gains:[1,.2,.0708,.0316,.01995],qs:[40,60,100,120,120]},ue:{freqs:[250,1750,2150,3200,3300],gains:[1,.1,.0708,.0316,.01995],qs:[40,60,100,120,120]},y:{freqs:[400,1460,2400,3e3,3300],gains:[1,.2,.0708,.0316,.02995],qs:[40,60,100,120,120]},uh:{freqs:[600,1250,2100,3100,3500],gains:[1,.3,.0608,.0316,.01995],qs:[40,70,100,120,130]},un:{freqs:[500,1240,2280,3e3,3500],gains:[1,.1,.1708,.0216,.02995],qs:[40,60,100,120,120]},en:{freqs:[600,1480,2450,3200,3300],gains:[1,.15,.0708,.0316,.02995],qs:[40,60,100,120,120]},an:{freqs:[700,1050,2500,3e3,3300],gains:[1,.1,.0708,.0316,.02995],qs:[40,60,100,120,120]},on:{freqs:[500,1080,2350,3e3,3300],gains:[1,.1,.0708,.0316,.02995],qs:[40,60,100,120,120]},get æ(){return this.ae},get ø(){return this.oe},get ɑ(){return this.aa},get å(){return this.aa},get ö(){return this.oe},get ü(){return this.ue},get ı(){return this.y}};if(typeof GainNode<"u"){class o extends GainNode{constructor(l,d){if(super(l),!vowelFormant[d])throw new Error("vowel: unknown vowel "+d);const{gains:p,qs:b,freqs:R}=vowelFormant[d];this.makeupGain=l.createGain(),this.filters=[],this.gains=[];for(let I=0;I<5;I++){const z=l.createGain();z.gain.value=p[I];const se=l.createBiquadFilter();se.type="bandpass",se.Q.value=b[I],se.frequency.value=R[I],super.connect(se),se.connect(z),this.filters.push(se),z.connect(this.makeupGain),this.gains.push(z)}return this.makeupGain.gain.value=8,this}connect(l){this.makeupGain.connect(l)}disconnect(){releaseAudioNode(this.makeupGain),this.filters.forEach(releaseAudioNode),this.gains.forEach(releaseAudioNode),super.disconnect(),this.makeupGain=null,this.filters=null,this.gains=null}}BaseAudioContext.prototype.createVowelFilter=function(e){return new o(this,e)}}const workletsUrl="data:text/javascript;base64,dmFyIF89ZnVuY3Rpb24oUil7InVzZSBzdHJpY3QiO3ZhciBXZT1PYmplY3QuZGVmaW5lUHJvcGVydHk7dmFyIFllPShSLFcsWCk9PlcgaW4gUj9XZShSLFcse2VudW1lcmFibGU6ITAsY29uZmlndXJhYmxlOiEwLHdyaXRhYmxlOiEwLHZhbHVlOlh9KTpSW1ddPVg7dmFyIER0PShSLFcsWCk9PlllKFIsdHlwZW9mIFchPSJzeW1ib2wiP1crIiI6VyxYKTtjbGFzcyBYIGV4dGVuZHMgQXVkaW9Xb3JrbGV0UHJvY2Vzc29ye2NvbnN0cnVjdG9yKHQpe3N1cGVyKHQpLHRoaXMuc3RhcnRlZD0hMSx0aGlzLm5iSW5wdXRzPXQubnVtYmVyT2ZJbnB1dHMsdGhpcy5uYk91dHB1dHM9dC5udW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Vycyx0aGlzLm91dHB1dHMsdGhpcy5zb3VyY2VzKTtjb25zdCBmPXRoaXMub3V0cHV0c1swXSx1PXRoaXMub3V0cHV0c1sxXTthPyhuW2hdPWYsYVtoXT11KTpuW2hdPS41KihmK3UpLHRoaXMucGxheVBvcys9MS9zYW1wbGVSYXRlfXJldHVybiEwfX1yZXR1cm4gcmVnaXN0ZXJQcm9jZXNzb3IoImdlbmVyaWMtcHJvY2Vzc29yIixBZSksUi5XYXJwTW9kZT14LE9iamVjdC5kZWZpbmVQcm9wZXJ0eShSLFN5bWJvbC50b1N0cmluZ1RhZyx7dmFsdWU6Ik1vZHVsZSJ9KSxSfSh7fSk7Cg==";let listenerQueue=[],lqIndex=0;const QUEUE_ITEMS_PER_LISTENER=4;let atom=o=>{let e=[],l={get(){return l.lc||l.listen(()=>{})(),l.value},lc:0,listen(d){return l.lc=e.push(d),()=>{for(let b=lqIndex+QUEUE_ITEMS_PER_LISTENER;b<listenerQueue.length;)listenerQueue[b]===d?listenerQueue.splice(b,QUEUE_ITEMS_PER_LISTENER):b+=QUEUE_ITEMS_PER_LISTENER;let p=e.indexOf(d);~p&&(e.splice(p,1),--l.lc||l.off())}},notify(d,p){let b=!listenerQueue.length;for(let R of e)listenerQueue.push(R,l.value,d,p);if(b){for(lqIndex=0;lqIndex<listenerQueue.length;lqIndex+=QUEUE_ITEMS_PER_LISTENER)listenerQueue[lqIndex](listenerQueue[lqIndex+1],listenerQueue[lqIndex+2],listenerQueue[lqIndex+3]);listenerQueue.length=0}},off(){},set(d){let p=l.value;p!==d&&(l.value=d,l.notify(p))},subscribe(d){let p=l.listen(d);return d(l.value),p},value:o};return l};const MOUNT=5,UNMOUNT=6,REVERT_MUTATION=10;let on$1=(o,e,l,d)=>(o.events=o.events||{},o.events[l+REVERT_MUTATION]||(o.events[l+REVERT_MUTATION]=d(p=>{o.events[l].reduceRight((b,R)=>(R(b),b),{shared:{},...p})})),o.events[l]=o.events[l]||[],o.events[l].push(e),()=>{let p=o.events[l],b=p.indexOf(e);p.splice(b,1),p.length||(delete o.events[l],o.events[l+REVERT_MUTATION](),delete o.events[l+REVERT_MUTATION])}),STORE_UNMOUNT_DELAY=1e3,onMount=(o,e)=>on$1(o,d=>{let p=e(d);p&&o.events[UNMOUNT].push(p)},MOUNT,d=>{let p=o.listen;o.listen=(...R)=>(!o.lc&&!o.active&&(o.active=!0,d()),p(...R));let b=o.off;return o.events[UNMOUNT]=[],o.off=()=>{b(),setTimeout(()=>{if(o.active&&!o.lc){o.active=!1;for(let R of o.events[UNMOUNT])R();o.events[UNMOUNT]=[]}},STORE_UNMOUNT_DELAY)},()=>{o.listen=p,o.off=b}}),map=(o={})=>{let e=atom(o);return e.setKey=function(l,d){let p=e.value;typeof d>"u"&&l in e.value?(e.value={...e.value},delete e.value[l],e.notify(p,l)):e.value[l]!==d&&(e.value={...e.value,[l]:d},e.notify(p,l))},e};const CONTROL_TARGETS={stretch:{node:"stretch",param:"pitchFactor"},gain:{node:"gain",param:"gain"},postgain:{node:"post",param:"gain"},pan:{node:"pan",param:"pan"},tremolo:{node:"tremolo",param:"frequency"},tremolosync:{node:"tremolo",param:"frequency"},tremolodepth:{node:"tremolo_gain",param:"gain"},tremoloskew:{node:"tremolo",param:"skew"},tremolophase:{node:"tremolo",param:"phase"},tremoloshape:{node:"tremolo",param:"shape"},lfo:{node:"lfo",param:"frequency"},lfo_rate:{node:"lfo",param:"frequency"},lfo_sync:{node:"lfo",param:"frequency"},lfo_depth:{node:"lfo",param:"depth"},lfo_depthabs:{node:"lfo",param:"depth"},lfo_skew:{node:"lfo",param:"skew"},lfo_curve:{node:"lfo",param:"curve"},lfo_dcoffset:{node:"lfo",param:"dcoffset"},env:{node:"env",param:"depth"},env_attack:{node:"env",param:"attack"},env_decay:{node:"env",param:"decay"},env_sustain:{node:"env",param:"sustain"},env_release:{node:"env",param:"release"},bmod:{node:"bmod",param:"depth"},bmod_depth:{node:"bmod",param:"depth"},bmod_depthabs:{node:"bmod",param:"depth"},cutoff:{node:"lpf",param:"frequency"},resonance:{node:"lpf",param:"Q"},lprate:{node:"lpf_lfo",param:"rate"},lpsync:{node:"lpf_lfo",param:"sync"},lpdepth:{node:"lpf_lfo",param:"depth"},lpdepthfrequency:{node:"lpf_lfo",param:"depth"},lpshape:{node:"lpf_lfo",param:"shape"},lpdc:{node:"lpf_lfo",param:"dcoffset"},lpskew:{node:"lpf_lfo",param:"skew"},hcutoff:{node:"hpf",param:"frequency"},hresonance:{node:"hpf",param:"Q"},hprate:{node:"hpf_lfo",param:"rate"},hpsync:{node:"hpf_lfo",param:"sync"},hpdepth:{node:"hpf_lfo",param:"depth"},hpdepthfrequency:{node:"hpf_lfo",param:"depth"},hpshape:{node:"hpf_lfo",param:"shape"},hpdc:{node:"hpf_lfo",param:"dcoffset"},hpskew:{node:"hpf_lfo",param:"skew"},bandf:{node:"bpf",param:"frequency"},bandq:{node:"bpf",param:"Q"},bprate:{node:"bpf_lfo",param:"rate"},bpsync:{node:"bpf_lfo",param:"sync"},bpdepth:{node:"bpf_lfo",param:"depth"},bpdepthfrequency:{node:"bpf_lfo",param:"depth"},bpshape:{node:"bpf_lfo",param:"shape"},bpdc:{node:"bpf_lfo",param:"dcoffset"},bpskew:{node:"bpf_lfo",param:"skew"},vowel:{node:"vowel",param:"frequency"},coarse:{node:"coarse",param:"coarse"},crush:{node:"crush",param:"crush"},shape:{node:"shape",param:"shape"},shapevol:{node:"shape",param:"postgain"},distort:{node:"distort",param:"distort"},distortvol:{node:"distort",param:"postgain"},distorttype:{node:"distort",param:"distort"},compressor:{node:"compressor",param:"threshold"},compressorRatio:{node:"compressor",param:"ratio"},compressorKnee:{node:"compressor",param:"knee"},compressorAttack:{node:"compressor",param:"attack"},compressorRelease:{node:"compressor",param:"release"},phaserrate:{node:"phaser_lfo",param:"frequency"},phasersweep:{node:"phaser_lfo",param:"depth"},phasercenter:{node:"phaser",param:"frequency"},phaserdepth:{node:"phaser",param:"Q"},delay:{node:"delay_mix",param:"gain"},delaytime:{node:"delay",param:"delayTime"},delayfeedback:{node:"delay",param:"feedback"},delaysync:{node:"delay",param:"delayTime"},dry:{node:"dry",param:"gain"},room:{node:"room_mix",param:"gain"},djf:{node:"djf",param:"value"},busgain:{node:"bus",param:"gain"},s:{node:"source",param:"frequency"},detune:{node:"source",param:"freqspread"},wt:{node:"source",param:"position"},warp:{node:"source",param:"warp"},freq:{node:"source",param:"frequency"},note:{node:"source",param:"frequency"},wtdc:{node:"wt_lfo",param:"dc"},wtskew:{node:"wt_lfo",param:"skew"},wtrate:{node:"wt_lfo",param:"frequency"},wtsync:{node:"wt_lfo",param:"frequency"},wtdepth:{node:"wt_lfo",param:"depth"},warpdc:{node:"warp_lfo",param:"dc"},warpskew:{node:"warp_lfo",param:"skew"},warprate:{node:"warp_lfo",param:"frequency"},warpsync:{node:"warp_lfo",param:"frequency"},warpdepth:{node:"warp_lfo",param:"depth"},fmi:{node:"fm_1_gain",param:"gain"},fmi2:{node:"fm_2_gain",param:"gain"},fmi3:{node:"fm_3_gain",param:"gain"},fmi4:{node:"fm_4_gain",param:"gain"},fmi5:{node:"fm_5_gain",param:"gain"},fmi6:{node:"fm_6_gain",param:"gain"},fmi7:{node:"fm_7_gain",param:"gain"},fmi8:{node:"fm_8_gain",param:"gain"},fmh:{node:"fm_1",param:"frequency"},fmh2:{node:"fm_2",param:"frequency"},fmh3:{node:"fm_3",param:"frequency"},fmh4:{node:"fm_4",param:"frequency"},fmh5:{node:"fm_5",param:"frequency"},fmh6:{node:"fm_6",param:"frequency"},fmh7:{node:"fm_7",param:"frequency"},fmh8:{node:"fm_8",param:"frequency"},pw:{node:"source",param:"pulsewidth"},pwrate:{node:"pw_lfo",param:"frequency"},pwsweep:{node:"pw_lfo",param:"depth"},vib:{node:"vib",param:"frequency"},vibmod:{node:"vib_gain",param:"gain"},byteBeatStartTime:{node:"source",param:"byteBeatStartTime"},spread:{node:"source",param:"panspread"},transient:{node:"transient",param:"attack"}};function getSuperdoughControlTargets(){return CONTROL_TARGETS}const getNodeParam=(o,e)=>{if(o?.parameters){const d=o.parameters.get(e);if(d instanceof AudioParam)return d}let l=o?.[e];if(l===void 0&&e==="frequency"&&(l=o?.detune??o?.playbackRate),l instanceof AudioParam)return l},controlTargets=getSuperdoughControlTargets(),getControlData=(o,e)=>{const l=o.split("_")[0];return controlTargets[`${l}_${e}`]??controlTargets[l]},getRangeForParam=(o,e)=>o==="frequency"&&e>=30?{min:20-e,max:24e3-e}:{min:void 0,max:void 0},clampWithWaveShaper=(o,e,l)=>{const d=getAudioContext(),p=new Float32Array(256);for(let I=0;I<p.length;I++){const z=I/(p.length-1)*2-1;p[I]=clamp(z*l,e,l)}const b=new WaveShaperNode(d,{curve:p}),R=gainNode(1/l);return o.connect(R).connect(b),{modulator:o,toCleanup:[b,R]}},getTargetParamsForControl=(o,e,l)=>{const d=getControlData(o,l);if(!d)return errorLogger(new Error(`Could not find control data for target '${o}'. It may not be modulatable.`),"superdough"),{targetParams:[],paramName:o};const p=d.param,b=e[d.node]?d.node:o,R=e[b];if(!R){const z=Object.keys(e);return errorLogger(new Error(`Could not connect to target '${b}' — it does not exist. Available targets: ${z.join(", ")}`),"superdough"),{targetParams:[],paramName:p}}const I=[];return R.forEach(z=>{const se=getNodeParam(z,p);I.push(se)}),{targetParams:I,paramName:p}},connectLFO=(o,e,l)=>{const{rate:d=1,sync:p,cps:b,cycle:R,control:I="lfo",subControl:z,fxi:se="main",depth:le=1,depthabs:tn,retrig:an=0,...sn}=e,{targetParams:ln,paramName:un}=getTargetParamsForControl(I,l[se],z);if(!ln.length)return;let pn=ln[0].value;pn=pn===0?1:pn;const{min:yn,max:_n}=getRangeForParam(un,pn),Pn=tn??le*pn,vn={...sn,frequency:p!==void 0?p*b:d,time:an>.5?0:R/b,depth:Pn,min:yn,max:_n},bn=getLfo(getAudioContext(),vn);return l.main[`lfo_${o}`]=[bn],ln.forEach(Sn=>bn.connect(Sn)),bn},connectEnvelope=(o,e,l)=>{const{control:d,subControl:p,acurve:b,dcurve:R,rcurve:I,depth:z=1,depthabs:se,fxi:le="main",...tn}=e,{targetParams:an,paramName:sn}=getTargetParamsForControl(d,l[le],p);if(!an.length)return;let ln=an[0].value;ln=ln===0?1:ln;const{min:un,max:pn}=getRangeForParam(sn,ln),yn=se??z*ln,_n=getEnvelope(getAudioContext(),{...tn,depth:yn,min:un,max:pn,attackCurve:b,decayCurve:R,releaseCurve:I});return l.main[`env_${o}`]=[_n],an.forEach(Pn=>_n.connect(Pn)),_n},connectBusModulator=(o,e,l)=>{const d=getAudioContext(),{control:p,subControl:b,depth:R=1,depthabs:I,fxi:z="main"}=o,{targetParams:se,paramName:le}=getTargetParamsForControl(p,e[z],b);if(!se.length)return{toCleanup:[]};const tn=l.getBus(o.bus),an=new ConstantSourceNode(d,{offset:o.dc??0});an.start(o.begin);const sn=an.connect(gainNode(1));tn.connect(sn);let ln=se[0].value;ln=ln===0?1:ln;const{min:un,max:pn}=getRangeForParam(le,ln),yn=I??R*ln,_n=gainNode(Math.sign(yn)*Math.abs(yn)/.3),Pn=sn.connect(_n),vn=[];let bn=Pn;if(un!==void 0&&pn!==void 0){const Sn=clampWithWaveShaper(Pn,un,pn);bn=Sn.modulator,vn.push(...Sn.toCleanup)}return webAudioTimeout(d,()=>{se.forEach(Sn=>bn.connect(Sn))},0,o.begin),vn.push(an,sn,_n),{modulator:bn,toCleanup:vn}},bufferCache$1={},loadCache$3={},getCachedBuffer=o=>bufferCache$1[o];function humanFileSize$1(o,e){var l=1024;if(o<l)return o+" B";var d=["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],p=-1;do o/=l,++p;while(o>=l);return o.toFixed(1)+" "+d[p]}function getSampleInfo(o,e){const{speed:l=1}=o,{transpose:d,url:p,index:b,midi:R,label:I}=getCommonSampleInfo(o,e);let z=Math.abs(l)*Math.pow(2,d/12);return{transpose:d,url:p,index:b,midi:R,label:I,playbackRate:z}}const getSampleBuffer=async(o,e,l)=>{let{url:d,label:p,playbackRate:b}=getSampleInfo(o,e);l&&(d=await l(d));const R=getAudioContext(),I=await loadBuffer$1(d,R,p);return o.unit==="c"&&(b=b*I.duration),{buffer:I,playbackRate:b}},getSampleBufferSource=async(o,e,l)=>{let{buffer:d,playbackRate:p}=await getSampleBuffer(o,e,l);o.speed<0&&(d=reverseBuffer(d));const R=getAudioContext().createBufferSource();R.buffer=d,R.playbackRate.value=p;const{loopBegin:I=0,loopEnd:z=1,begin:se=0,end:le=1}=o,tn=R.buffer.duration,an=se*tn;o.loop&&(R.loop=!0,R.loopStart=I*tn,R.loopEnd=z*tn);const ln=tn/R.playbackRate.value,un=(le-se)*ln;return{bufferSource:R,offset:an,bufferDuration:tn,playbackDuration:ln,sliceDuration:un}},loadBuffer$1=(o,e,l,d=0)=>{const p=l?`sound "${l}:${d}"`:"sample";if(o=o.replace("#","%23"),!loadCache$3[o]){logger$1(`[sampler] load ${p}..`,"load-sample",{url:o});const b=Date.now();loadCache$3[o]=fetch(o).then(R=>R.arrayBuffer()).then(async R=>{const I=Date.now()-b,z=humanFileSize$1(R.byteLength);logger$1(`[sampler] load ${p}... done! loaded ${z} in ${I}ms`,"loaded-sample",{url:o});const se=await e.decodeAudioData(R);return bufferCache$1[o]=se,se})}return loadCache$3[o]};function reverseBuffer(o){const e=getAudioContext(),l=e.createBuffer(o.numberOfChannels,o.length,e.sampleRate);for(let d=0;d<o.numberOfChannels;d++)l.copyToChannel(o.getChannelData(d).slice().reverse(),d,d);return l}const getLoadedBuffer=o=>bufferCache$1[o];function resolveSpecialPaths(o){if(o.startsWith("bubo:")){const[e,l]=o.split(":");o=`github:Bubobubobubobubo/dough-${l}`}return o}function githubPath$3(o,e=""){if(!o.startsWith("github:"))throw new Error('expected "github:" at the start of pseudoUrl');let l=o.slice(7);l=l.endsWith("/")?l.slice(0,-1):l;let d=l.split("/"),p=d[0],b=d.length>=2?d[1]:"samples",R=d.length>=3?d[2]:"main",I=d.slice(3);return I.push(e||""),I=I.join("/"),`https://raw.githubusercontent.com/${p}/${b}/${R}/${I}`}const processSampleMap=(o,e,l=o._base||"")=>Object.entries(o).forEach(([d,p])=>{if(typeof p=="string"&&(p=[p]),typeof p!="object")throw new Error("wrong sample map format for "+d);l=p._base||l,l=resolveSpecialPaths(l),l.startsWith("github:")&&(l=githubPath$3(l,""));const b=R=>l+R;Array.isArray(p)?p=p.map(b):p=Object.fromEntries(Object.entries(p).map(([R,I])=>[R,(typeof I=="string"?[I]:I).map(b)])),e(d,p)});let resourcePrefixHandlers={};function registerSamplesPrefix(o,e){resourcePrefixHandlers[o]=e}function getSamplesPrefixHandler(o){const e=Object.entries(resourcePrefixHandlers).find(([l])=>o.startsWith(l));if(e)return e[1]}async function fetchSampleMap$1(o){const e=getSamplesPrefixHandler(o);if(e)return e(o);if(o=resolveSpecialPaths(o),o.startsWith("github:")&&(o=githubPath$3(o,"strudel.json")),o.startsWith("local:")&&(o="http://localhost:5432"),o.startsWith("shabda:")){let[p,b]=o.split("shabda:");o=`https://shabda.ndre.gr/${b}.json?strudel=1`}if(o.startsWith("shabda/speech")){let[p,b]=o.split("shabda/speech");b=b.startsWith("/")?b.substring(1):b;let[R,I]=b.split(":"),z="f",se="en-GB";R&&([se,z]=R.split("/")),o=`https://shabda.ndre.gr/speech/${I}.json?gender=${z}&language=${se}&strudel=1'`}if(typeof fetch!="function")return;const l=getBaseURL(o);if(typeof fetch>"u")return;const d=await fetch(o).then(p=>p.json()).catch(p=>{throw console.error(p),new Error(`error loading "${o}"`)});return[d,d._base||l]}const samples=async(o,e=o._base||"",l={})=>{if(typeof o=="string"){const[b,R]=await fetchSampleMap$1(o);return samples(b,e||R,l)}const{prebake:d,tag:p}=l;processSampleMap(o,(b,R)=>{registerSampleSource(b,R,{baseUrl:e,prebake:d,tag:p})},e)},cutGroups=[];async function onTriggerSample(o,e,l,d,p){let{s:b,nudge:R=0,cut:I,loop:z,clip:se=void 0,n:le=0,speed:tn=1,duration:an}=e;if(tn===0)return;const sn=getAudioContext();let[ln,un,pn,yn]=getADSRValues([e.attack,e.decay,e.sustain,e.release]);const{bufferSource:_n,sliceDuration:Pn,offset:vn}=await getSampleBufferSource(e,d,p);if(!_n){logger$1(`[sampler] could not load "${b}:${le}"`,"error");return}if(sn.currentTime>o){logger$1(`[sampler] loading sound "${b}:${le}" took too long`,"highlight"),releaseAudioNode(_n);return}const bn=getVibratoOscillator(_n.detune,e,o),Sn=o+R;_n.start(Sn,vn);const An=sn.createGain(),Dn=_n.connect(An);se==null&&z==null&&e.release==null&&(an=Pn);let Bn=o+an;getParamADSR(Dn.gain,ln,un,pn,yn,0,1,o,Bn,"linear"),getPitchEnvelope(_n.detune,e,o,Bn);const Nn=sn.createGain();Dn.connect(Nn),onceEnded(_n,function(){releaseAudioNode(_n),bn?.stop(),releaseAudioNode(Dn),releaseAudioNode(Nn),l()});let Qn=Bn+yn+.01;_n.stop(Qn);const Zn=qn=>{_n.stop(qn)},Vn={node:Nn,nodes:{source:[_n],...bn?.nodes},stop:Zn};if(I!==void 0){const qn=cutGroups[I];qn&&(qn.node.gain.setValueAtTime(1,Sn),qn.node.gain.linearRampToValueAtTime(0,Sn+.01)),cutGroups[I]=Vn}return Vn}function registerSample(o,e,l){registerSound(o,(d,p,b)=>onTriggerSample(d,p,b,e),{type:"sample",samples:e,...l})}function registerSampleSource(o,e,l){o.startsWith("wt_")?registerWaveTable(o,e,l):registerSample(o,e,l)}const hasChanged=(o,e)=>o!==void 0&&o!==e,getStereoNode=o=>new GainNode(o,{gain:1,channelCount:2,channelCountMode:"explicit"});class Orbit{reverbNode;delayNode;output;summingNode;djfNode;audioContext;constructor(e){this.audioContext=e,this.output=getStereoNode(e),this.summingNode=getStereoNode(e),this.summingNode.connect(this.output)}disconnect(){this.output.disconnect(),this.summingNode.disconnect(),this.delayNode?.disconnect(),this.reverbNode?.disconnect()}getDjf(e,l=0){return this.djfNode==null&&(this.djfNode=getWorklet(this.audioContext,"djf-processor",{value:e}),this.summingNode.disconnect(),this.summingNode.connect(this.djfNode),this.djfNode.connect(this.output)),this.djfNode.parameters.get("value").setValueAtTime(e,l),this.djfNode}getDelay(e=0,l=.5,d){return l=clamp(l,0,.98),this.delayNode==null&&(this.delayNode=this.audioContext.createFeedbackDelay(1,e,l),this.delayNode.connect(this.summingNode),this.delayNode.start?.(d)),this.delayNode.delayTime.value!==e&&this.delayNode.delayTime.setValueAtTime(e,d),this.delayNode.feedback.value!==l&&this.delayNode.feedback.setValueAtTime(l,d),this.delayNode}getReverb(e,l,d,p,b,R,I){return this.reverbNode==null&&(this.reverbNode=this.audioContext.createReverb(e,l,d,p,b,R,I),this.reverbNode.connect(this.summingNode)),(hasChanged(e,this.reverbNode.duration)||hasChanged(l,this.reverbNode.fade)||hasChanged(d,this.reverbNode.lp)||hasChanged(p,this.reverbNode.dim)||hasChanged(R,this.reverbNode.irspeed)||hasChanged(I,this.reverbNode.irbegin)||this.reverbNode.ir!==b)&&this.reverbNode.generate(e,l,d,p,b,R,I),this.reverbNode}sendReverb(e,l){return effectSend(e,this.reverbNode,l)}sendDelay(e,l){return effectSend(e,this.delayNode,l)}duck(e,l=0,d=.1,p=1){const b=l,R=Math.max(d,.002),I=this.output.gain;webAudioTimeout(this.audioContext,()=>{const z=this.audioContext.currentTime,se=I.value;I.cancelScheduledValues(z),I.setValueAtTime(se,z);const le=Math.max(e,z),tn=clamp(1-Math.sqrt(p),.01,se);I.exponentialRampToValueAtTime(tn,le+b),I.exponentialRampToValueAtTime(1,le+b+R)},0,e-.01)}connectToOutput(e){e.connect(this.summingNode)}}class SuperdoughOutput{channelMerger;destinationGain;constructor(e){this.audioContext=e,this.initializeAudio()}initializeAudio(){const e=this.audioContext,l=e.destination.maxChannelCount;this.audioContext.destination.channelCount=l,this.channelMerger=new ChannelMergerNode(e,{numberOfInputs:e.destination.channelCount}),this.destinationGain=new GainNode(e),this.channelMerger.connect(this.destinationGain),this.destinationGain.connect(e.destination)}reset(){this.disconnect(),this.initializeAudio()}disconnect(){this.channelMerger.disconnect(),this.destinationGain.disconnect(),this.destinationGain=null,this.channelMerger=null}connectToDestination=(e,l=[0,1])=>{const d=new StereoPannerNode(this.audioContext);e.connect(d);const p=new ChannelSplitterNode(this.audioContext,{numberOfOutputs:d.channelCount});d.connect(p),l.forEach((b,R)=>{p.connect(this.channelMerger,R%d.channelCount,b%this.audioContext.destination.channelCount)})}}class SuperdoughAudioController{audioContext;output;nodes={};buses={};constructor(e){this.audioContext=e,this.output=new SuperdoughOutput(e)}reset(){Object.values(this.nodes).forEach(e=>{e.disconnect()}),Object.values(this.buses).forEach(e=>{e.disconnect()}),this.nodes={},this.buses={},this.output.reset()}duck(e,l,d=0,p=.1,b=1){const R=[e].flat(),I=[d].flat(),z=[p].flat(),se=[b].flat();R.forEach((le,tn)=>{const an=this.nodes[le];if(an==null){errorLogger(new Error(`duck target orbit ${le} does not exist`),"superdough");return}const sn=I[tn]??I[0],ln=Math.max(z[tn]??z[0],.002),un=se[tn]??se[0];an.duck(l,sn,ln,un)})}getOrbit(e,l){return this.nodes[e]==null&&(this.nodes[e]=new Orbit(this.audioContext),this.output.connectToDestination(this.nodes[e].output,l)),this.nodes[e]}getBus(e){return this.buses[e]==null&&(this.buses[e]=getStereoNode(this.audioContext)),this.buses[e]}}const Warpmode=Object.freeze({NONE:0,ASYM:1,MIRROR:2,BENDP:3,BENDM:4,BENDMP:5,SYNC:6,QUANT:7,FOLD:8,PWM:9,ORBIT:10,SPIN:11,CHAOS:12,PRIMES:13,BINARY:14,BROWNIAN:15,RECIPROCAL:16,WORMHOLE:17,LOGISTIC:18,SIGMOID:19,FRACTAL:20,FLIP:21}),seenKeys=new Set;function resetSeenKeys(){seenKeys.clear()}async function getPayload(o,e,l=2048){const d=`${o},${l}`;if(!seenKeys.has(d)){const b=(await loadBuffer(o,e)).getChannelData(0),R=b.length,I=Math.max(1,Math.floor(R/l)),z=new Array(I);for(let se=0;se<I;se++){const le=se*l;z[se]=b.subarray(le,le+l)}return seenKeys.add(d),{frames:z,frameLen:l,numFrames:I,key:d}}return{frameLen:l,key:d}}function humanFileSize(o,e){var l=1024;if(o<l)return o+" B";var d=["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],p=-1;do o/=l,++p;while(o>=l);return o.toFixed(1)+" "+d[p]}function parseWavSampleRate(o){const e=new DataView(o);let l=12;for(;l+8<=e.byteLength;){const d=String.fromCharCode(e.getUint8(l),e.getUint8(l+1),e.getUint8(l+2),e.getUint8(l+3)),p=e.getUint32(l+4,!0);if(d==="fmt ")return e.getUint32(l+12,!0);l+=8+p+(p&1)}return null}async function decodeAtNativeRate(o){const e=parseWavSampleRate(o)||44100;return await new OfflineAudioContext(1,1,e).decodeAudioData(o)}const loadCache$2={},loadBuffer=(o,e)=>{if(o=o.replace("#","%23"),!loadCache$2[o]){logger$1(`[wavetable] load table ${e}..`,"load-table",{url:o});const l=Date.now();loadCache$2[o]=fetch(o).then(d=>d.arrayBuffer()).then(async d=>{const p=Date.now()-l,b=humanFileSize(d.byteLength);return logger$1(`[wavetable] load table ${e}... done! loaded ${b} in ${p}ms`,"loaded-table",{url:o}),await decodeAtNativeRate(d)})}return loadCache$2[o]};function githubPath$2(o,e=""){if(!o.startsWith("github:"))throw new Error('expected "github:" at the start of pseudoUrl');let[l,d]=o.split("github:");return d=d.endsWith("/")?d.slice(0,-1):d,d.split("/").length===2&&(d+="/main"),`https://raw.githubusercontent.com/${d}/${e}`}const _processTables=(o,e,l,d={})=>(e=o._base||e,Object.entries(o).forEach(([p,b])=>{if(p==="_base")return!1;if(typeof b=="string"&&(b=[b]),typeof b!="object")throw new Error("wrong json format for "+p);let R=e;R.startsWith("github:")&&(R=githubPath$2(R,"")),b=b.map(I=>R+I).filter(I=>I.toLowerCase().endsWith(".wav")?!0:(logger$1(`[wavetable] skipping ${I} -- wavetables must be ".wav" format`),!1)),b.length&®isterWaveTable(p,b,{baseUrl:e,frameLen:l})}));function registerWaveTable(o,e,l){registerSound(o,(d,p,b,R)=>onTriggerSynth(d,p,b,e,R,l?.frameLen??2048),{type:"wavetable",tables:e,...l})}const tables=async(o,e,l,d={})=>{if(l!==void 0)return _processTables(l,o,e);o.startsWith("github:")&&(o=githubPath$2(o,"strudel.json")),o.startsWith("local:")&&(o="http://localhost:5432");const p=getBaseURL(o);if(typeof fetch=="function"&&!(typeof fetch>"u"))return fetch(o).then(b=>b.json()).then(b=>_processTables(b,p,e,d)).catch(b=>{throw console.error(b),new Error(`error loading "${o}"`)})};async function onTriggerSynth(o,e,l,d,p,b){const{s:R,n:I=0,duration:z,clip:se}=e,le=getAudioContext(),[tn,an,sn,ln]=getADSRValues([e.attack,e.decay,e.sustain,e.release]);let{warpmode:un}=e;typeof un=="string"&&(un=Warpmode[un.toUpperCase()]??Warpmode.NONE);const pn=getFrequencyFromValue(e),{url:yn,label:_n}=getCommonSampleInfo(e,d),Pn=await getPayload(yn,_n,b);let vn=o+z;se!==void 0&&(vn=Math.min(o+se*z,vn));const bn=vn+ln,Sn=bn+.01,An={begin:o,end:Sn,frequency:pn,freqspread:e.detune,position:e.wt,warp:e.warp,warpMode:un,voices:Math.max(e.unison??1,1),panspread:e.spread,phaserand:e.wtphaserand??e.unison>1?1:0},Bn=getNodeFromPool("wavetable",()=>new AudioWorkletNode(le,"wavetable-oscillator-processor",{outputChannelCount:[2]}));if(Object.entries(An).forEach(([va,Oa])=>{const Va=Bn.parameters.get(va),$a=Oa!==void 0?Oa:Va.defaultValue;Va.value=$a}),Bn.port.postMessage({type:"initialize",payload:Pn}),le.currentTime>o){logger$1(`[wavetable] still loading sound "${R}:${I}"`,"highlight");return}const Nn=[e.wtattack,e.wtdecay,e.wtsustain,e.wtrelease],Qn=[e.warpattack,e.warpdecay,e.warpsustain,e.warprelease],Zn=Bn.parameters,Vn=Zn.get("position"),qn=Zn.get("warp");let ia=e.wtrate;e.wtsync!=null&&(ia=p*e.wtsync);const ra=applyParameterModulators(le,Vn,o,bn,{offset:e.wt,amount:e.wtenv,defaultAmount:.5,shape:"linear",values:Nn,holdEnd:vn,defaultValues:[0,.5,0,.1]},{frequency:ia,depth:e.wtdepth,defaultDepth:.5,shape:e.wtshape,skew:e.wtskew,dcoffset:e.wtdc??0});let aa=e.warprate;e.warpsync!=null&&(aa=aa=p*e.warpsync);const jn=applyParameterModulators(le,qn,o,bn,{offset:e.warp,amount:e.warpenv,defaultAmount:.5,shape:"linear",values:Qn,holdEnd:vn,defaultValues:[0,.5,0,.1]},{frequency:aa,depth:e.warpdepth,defaultDepth:.5,shape:e.warpshape,skew:e.warpskew,dcoffset:e.warpdc??0}),ka=getVibratoOscillator(Bn.parameters.get("detune"),e,o),Aa=applyFM(Bn.parameters.get("frequency"),e,o),Na=le.createGain(),Kn=Bn.connect(Na);getParamADSR(Kn.gain,tn,an,sn,ln,0,.3,o,vn,"linear"),getPitchEnvelope(Bn.parameters.get("detune"),e,o,vn);const Ea={node:Kn,nodes:{source:[Bn],wt_lfo:[ra],warp_lfo:[jn],...Aa?.nodes,...ka?.nodes}},qa=webAudioTimeout(le,()=>{releaseNodeToPool(Bn),ka?.stop(),Aa?.stop(),releaseAudioNode(ra),releaseAudioNode(jn),l()},o,Sn);return Ea.stop=va=>{qa.stop(va)},Ea}const DEFAULT_MAX_POLYPHONY=128,DEFAULT_AUDIO_DEVICE_NAME="System Standard";let maxPolyphony=DEFAULT_MAX_POLYPHONY;function setMaxPolyphony(o){maxPolyphony=parseInt(o)??DEFAULT_MAX_POLYPHONY}let multiChannelOrbits=!1;function setMultiChannelOrbits(o){multiChannelOrbits=o==!0}const soundMap$1=map();function registerSound(o,e,l={}){o=o.toLowerCase().replace(/\s+/g,"_"),soundMap$1.setKey(o,{onTrigger:e,data:l})}let gainCurveFunc=o=>o;function applyGainCurve(o){return gainCurveFunc(o)}function setGainCurve(o){gainCurveFunc=o}function aliasBankMap(o){for(const l in o)o[l.toLowerCase()]=o[l];const e=soundMap$1.get();for(const l in e){const[d,p]=l.split("_");if(!p)continue;const b=o[d];if(b){if(typeof b=="string")e[`${b}_${p}`.toLowerCase()]=e[l];else if(Array.isArray(b))for(const R of b)e[`${R}_${p}`.toLowerCase()]=e[l]}}soundMap$1.set({...e})}async function aliasBankPath(o){const l=await(await fetch(o)).json();aliasBankMap(l)}async function aliasBank(...o){switch(o.length){case 1:return typeof o[0]=="string"?aliasBankPath(o[0]):aliasBankMap(o[0]);case 2:return aliasBankMap({[o[0]]:o[1]});default:throw new Error("aliasMap expects 1 or 2 arguments, received "+o.length)}}function soundAlias(o,e){if(getSound(o)==null){logger$1("soundAlias: original sound not found");return}soundMap$1.setKey(e,getSound(o))}function getSound(o){return typeof o!="string"?(console.warn(`getSound: expected string got "${o}". fall back to triangle`),soundMap$1.get().triangle):soundMap$1.get()[o.toLowerCase()]}const getAudioDevices=async()=>{await navigator.mediaDevices.getUserMedia({audio:!0});let o=await navigator.mediaDevices.enumerateDevices();o=o.filter(l=>l.kind==="audiooutput"&&l.deviceId!=="default");const e=new Map;return e.set(DEFAULT_AUDIO_DEVICE_NAME,""),o.forEach(l=>{e.set(l.label,l.deviceId)}),e};let defaultDefaultValues={s:"triangle",gain:.8,postgain:1,density:".03",channels:[1,2],phaserdepth:.75,shapevol:1,distortvol:1,distorttype:0,delay:0,busgain:1,byteBeatExpression:"0",delayfeedback:.5,delaysync:3/16,orbit:1,i:1,velocity:1,fft:8,tremolodepth:1,tremolophase:0,release:.01};const defaultDefaultDefaultValues=Object.freeze({...defaultDefaultValues});function setDefault(o,e){defaultDefaultValues[o]=e}function resetDefaults(){defaultDefaultValues={...defaultDefaultDefaultValues}}let defaultControls=new Map(Object.entries(defaultDefaultValues));function setDefaultValue(o,e){defaultControls.set(o,e)}function getDefaultValue(o){return defaultControls.get(o)}function setDefaultValues(o){Object.keys(o).forEach(e=>{setDefaultValue(e,o[e])})}function resetDefaultValues(){defaultControls=new Map(Object.entries(defaultDefaultValues))}function setVersionDefaults(o){resetDefaultValues(),o==="1.0"&&setDefaultValue("fanchor",.5)}const resetLoadedSounds=()=>soundMap$1.set({});let externalWorklets=[];function registerWorklet(o){externalWorklets.push(o)}let workletsLoading;function loadWorklets(){if(!workletsLoading){const o=getAudioContext(),e=externalWorklets.concat([workletsUrl]);workletsLoading=Promise.all(e.map(l=>o.audioWorklet.addModule(l))).then(()=>workletsLoading=void 0)}return workletsLoading}let kabel;async function initKabelsalat(){const{SalatRepl:o}=await Promise.resolve().then(()=>index$3);return logger$1("[kabelsalat] ready"),kabel=new o({localScope:!0}),kabel}async function initAudio(o={}){const{disableWorklets:e=!1,maxPolyphony:l,audioDeviceName:d=DEFAULT_AUDIO_DEVICE_NAME,multiChannelOrbits:p=!1}=o;if(setMaxPolyphony(l),setMultiChannelOrbits(p),resetSeenKeys(),typeof window>"u")return;const b=getAudioContext();if(d!=null&&d!=DEFAULT_AUDIO_DEVICE_NAME)try{const I=(await getAudioDevices()).get(d),z=(I??"").length>0;b.sinkId!==I&&z&&await b.setSinkId(I),logger$1(`[superdough] Audio Device set to ${d}, it might take a few seconds before audio plays on all output channels`)}catch{logger$1("[superdough] failed to set audio interface","warning")}if(!b instanceof OfflineAudioContext&&await b.resume(),e){logger$1("[superdough]: AudioWorklets disabled with disableWorklets");return}try{await loadWorklets(),logger$1("[superdough] AudioWorklets loaded")}catch(R){console.warn("could not load AudioWorklet effects",R)}await initKabelsalat(),logger$1("[superdough] ready")}let audioReady;async function initAudioOnFirstClick(o){return audioReady||(audioReady=new Promise(e=>{document.addEventListener("mousedown",async function l(){document.removeEventListener("mousedown",l),await initAudio(o),e()})})),audioReady}let controller;function getSuperdoughAudioController(){return controller==null&&(controller=new SuperdoughAudioController(getAudioContext())),controller}function setSuperdoughAudioController(o){return controller=o,controller}function connectToDestination(o,e){getSuperdoughAudioController().output.connectToDestination(o,e)}function getPhaser(o,e,l=1,d=.5,p=1e3,b=2e3){const R=getAudioContext(),I=getLfo(R,{frequency:l,depth:b*2,begin:o,end:e}),z=1;let se=282;const le=[];for(let tn=0;tn<z;tn++){const an=getNodeFromPool("filter",()=>R.createBiquadFilter());an.type="notch",an.gain.value=1,an.frequency.value=p+se,an.Q.value=2-Math.min(Math.max(d*2,0),1.9),I.connect(an.detune),se+=282,le.push(an)}return{filterChain:le,lfo:I}}function getFilterType(o){o=o??0;const e=["12db","ladder","24db"];return typeof o=="number"?e[Math.floor(_mod$1(o,e.length))]:o}let analysers={},analysersData={};function getAnalyserById(o,e=1024,l=.5){if(!analysers[o]||analysers[o].context!=getAudioContext()){const d=getAudioContext().createAnalyser();d.fftSize=e,d.smoothingTimeConstant=l,analysers[o]=d,analysersData[o]=new Float32Array(analysers[o].frequencyBinCount)}return analysers[o].fftSize!==e&&(analysers[o].fftSize=e,analysersData[o]=new Float32Array(analysers[o].frequencyBinCount)),analysers[o]}function getAnalyzerData(o="time",e=1){const l={time:()=>analysers[e]?.getFloatTimeDomainData(analysersData[e]),frequency:()=>analysers[e]?.getFloatFrequencyData(analysersData[e])}[o];if(!l)throw new Error(`getAnalyzerData: ${o} not supported. use one of ${Object.keys(l).join(", ")}`);return l(),analysersData[e]}function resetGlobalEffects(){controller?.reset(),analysers={},analysersData={}}let activeSoundSources=new Map;function mapChannelNumbers(o){return(Array.isArray(o)?o:[o]).map(e=>e-1)}class Chain{constructor(){this.audioNodes=[],this.tails=[]}connect(...e){return e.forEach(l=>{this.tails.forEach(d=>{d.connect(l)})}),this.tails=e,this.audioNodes.push(...e),this}connectOne(e,l){return this.tails[e].connect(l),this.tails[e]=l,this.audioNodes.push(l),this}releaseNodes(){this.audioNodes.forEach(e=>isPoolable(e)?releaseNodeToPool(e):releaseAudioNode(e)),this.audioNodes=[],this.tails=[]}}const compileKabel=o=>{if(!kabel)throw new Error("kabelsalat not loaded");return kabel.evaluate(o).compile({log:!1})},superdough=async(o,e,l,d=.5,p=.5)=>{const b={main:{}},R=getAudioContext(),I=getSuperdoughAudioController();let{stretch:z}=o;if(z!=null&&(e=e-.04),typeof o!="object")throw new Error(`expected hap.value to be an object, but got "${o}". Hint: append .note() or .s() to the end`,"error");if(o.duration=l,e<R.currentTime){console.warn(`[superdough]: cannot schedule sounds in the past (target: ${e.toFixed(2)}, now: ${R.currentTime.toFixed(2)})`);return}let{s:se=getDefaultValue("s"),bank:le,source:tn,postgain:an=getDefaultValue("postgain"),duckorbit:sn,duckonset:ln,duckattack:un,duckdepth:pn,djf:yn,release:_n=getDefaultValue("release"),dry:Pn,delay:vn=getDefaultValue("delay"),delayfeedback:bn=getDefaultValue("delayfeedback"),delaysync:Sn=getDefaultValue("delaysync"),delaytime:An,orbit:Dn=getDefaultValue("orbit"),bus:Bn,busgain:Nn=getDefaultValue("busgain"),room:Qn,roomfade:Zn,roomlp:Vn,roomdim:qn,roomsize:ia,ir:ra,irspeed:aa,irbegin:jn,i:ka=getDefaultValue("i"),analyze:Aa,fft:Na=getDefaultValue("fft"),FX:Kn=[],FXrelease:Ea}=o;An=An??cycleToSeconds(Sn,d);const qa=mapChannelNumbers(multiChannelOrbits&&Dn>0?[Dn*2-1,Dn*2]:getDefaultValue("channels")),va=o.channels!=null?mapChannelNumbers(o.channels):qa,Oa=I.getOrbit(Dn,va);sn!=null&&I.duck(sn,e,ln,un,pn),an=applyGainCurve(an),vn=applyGainCurve(vn),Nn=applyGainCurve(Nn);const Va=e+l,$a=Math.max(_n,Ea??0),Ua=Va+$a,ss=Math.round(Math.random()*1e6);for(let _i=0;_i<=activeSoundSources.size-maxPolyphony;_i++){const Un=activeSoundSources.entries().next(),ha=Un.value[1].deref(),sa=Un.value[0],Ga=e+.25;ha?.node?.gain?.linearRampToValueAtTime(0,Ga),ha?.stop?.(Ga),activeSoundSources.delete(sa)}if(["-","~","_"].includes(se))return;le&&se&&(se=`${le}_${se}`,o.s=se);const ua=new Chain;let Jn;if(tn)Jn=tn(e,o,l,d),b.main.source=[Jn];else if(getSound(se)){const{onTrigger:_i}=getSound(se),ha=await _i(e,o,()=>webAudioTimeout(R,()=>{ua.releaseNodes(),activeSoundSources.delete(ss)},0,Ua),d);ha&&(Jn=ha.node,activeSoundSources.set(ss,new WeakRef(ha)),b.main={...b.main,...ha.nodes})}else throw new Error(`sound ${se} not found! Is it loaded?`);if(!Jn)return;if(R.currentTime>e){logger$1("[webaudio] skip hap: still loading",R.currentTime-e);return}ua.connect(Jn),Kn=[...Kn,o];for(let[_i,Un]of Object.entries(Kn)){const ha=_i==Kn.length-1?"main":_i;b[ha]??={};const sa=b[ha];let{gain:Ga=getDefaultValue("gain"),velocity:Ha=getDefaultValue("velocity"),shapevol:ls=getDefaultValue("shapevol"),distorttype:ns=getDefaultValue("distorttype"),distortvol:Ba=getDefaultValue("distortvol"),tremolodepth:rs=getDefaultValue("tremolodepth"),phaserdepth:bs=getDefaultValue("phaserdepth"),delay:Fa=getDefaultValue("delay"),delayfeedback:Za=getDefaultValue("delayfeedback"),delaysync:ca=getDefaultValue("delaysync"),delaytime:es,i:Ta=getDefaultValue("i")}=Un;if(Ga=applyGainCurve(nanFallback(Ga,1)),ls=applyGainCurve(ls),Ba=applyGainCurve(Ba),Ha=applyGainCurve(Ha),rs=applyGainCurve(rs),Ga*=Ha,es=es??cycleToSeconds(ca,d),Un.workletSrc!==void 0){const ya=getWorklet(R,"generic-processor",{},{outputChannelCount:[2]});ua.connect(ya);const xa=Un.workletSrc.replace(/\bpat\[(\d+)\]/g,(Ca,is)=>Un.workletInputs[is]).replaceAll("sFreq",getFrequencyFromValue(o)).replaceAll("sGate",`cc('strudel-gate-${ss}')`),{src:wa,ugens:Ia,registers:da}=compileKabel(xa);ya.port.postMessage({src:wa,schema:{ugens:Ia,registers:da},start:e,gateEnd:Va,end:Ua})}if(Un.stretch!==void 0){const ya=getWorklet(R,"phase-vocoder-processor",{pitchFactor:Un.stretch});ua.connect(ya),sa.stretch=[ya]}if(Un.transient!==void 0){const ya=getWorklet(R,"transient-processor",{},{processorOptions:{attack:Un.transient,sustain:Un.transsustain,begin:e,end:Ua}});ua.connect(ya),sa.transient=ya}const Os=gainNode(Ga);sa.gain=[Os],ua.connect(Os);const Ka=getFilterType(o.ftype),cs=ya=>createFilter(R,e,Va,ya,d,p);if(Un.cutoff!==void 0){const xa=pickAndRename(Un,{frequency:"cutoff",q:"resonance",attack:"lpattack",decay:"lpdecay",sustain:"lpsustain",release:"lprelease",env:"lpenv",anchor:"fanchor",model:"ftype",drive:"drive",rate:"lprate",sync:"lpsync",depth:"lpdepth",depthfrequency:"lpdepthfrequency",shape:"lpshape",dcoffset:"lpdc",skew:"lpskew"});xa.type="lowpass";const{filter:wa,lfo:Ia}=cs(xa);if(sa.lpf=[wa],sa.lpf_lfo=[Ia],ua.connect(wa),Ia&&ua.audioNodes.push(Ia),Ka==="24db"){const{filter:da,lfo:Ca}=cs(xa);sa.lpf.push(da),sa.lpf_lfo.push(Ca),ua.connect(da),Ca&&ua.audioNodes.push(Ca)}}if(Un.hcutoff!==void 0){const xa=pickAndRename(Un,{frequency:"hcutoff",q:"hresonance",attack:"hpattack",decay:"hpdecay",sustain:"hpsustain",release:"hprelease",env:"hpenv",anchor:"fanchor",model:"ftype",drive:"drive",rate:"hprate",sync:"hpsync",depth:"hpdepth",depthfrequency:"hpdepthfrequency",shape:"hpshape",dcoffset:"hpdc",skew:"hpskew"});xa.type="highpass";const{filter:wa,lfo:Ia}=cs(xa);if(sa.hpf=[wa],sa.hpf_lfo=[Ia],Ia&&ua.audioNodes.push(Ia),ua.connect(wa),Ka==="24db"){const{filter:da,lfo:Ca}=cs(xa);sa.hpf.push(da),sa.hpf_lfo.push(Ca),ua.connect(da),Ca&&ua.audioNodes.push(Ca)}}if(Un.bandf!==void 0){const xa=pickAndRename(Un,{frequency:"bandf",q:"bandq",attack:"bpattack",decay:"bpdecay",sustain:"bpsustain",release:"bprelease",env:"bpenv",anchor:"fanchor",model:"ftype",drive:"drive",rate:"bprate",sync:"bpsync",depth:"bpdepth",depthfrequency:"bpdepthfrequency",shape:"bpshape",dcoffset:"bpdc",skew:"bpskew"});xa.type="bandpass";const{filter:wa,lfo:Ia}=cs(xa);if(sa.bpf=[wa],sa.bpf_lfo=[Ia],ua.connect(wa),Ia&&ua.audioNodes.push(Ia),Ka==="24db"){const{filter:da,lfo:Ca}=cs(xa);sa.bpf.push(da),sa.bpf_lfo.push(Ca),ua.connect(da),Ca&&ua.audioNodes.push(Ca)}}if(Un.vowel!==void 0){const ya=R.createVowelFilter(Un.vowel);sa.vowel=ya.filters,ua.connect(ya)}if(Un.coarse!==void 0){const ya=getWorklet(R,"coarse-processor",{coarse:Un.coarse});sa.coarse=[ya],ua.connect(ya)}if(Un.crush!==void 0){const ya=getWorklet(R,"crush-processor",{crush:Un.crush});sa.crush=[ya],ua.connect(ya)}if(Un.shape!==void 0){const ya=getWorklet(R,"shape-processor",{shape:Un.shape,postgain:ls});sa.shape=[ya],ua.connect(ya)}if(Un.distort!==void 0){const ya=getDistortion(Un.distort,Ba,ns);sa.distort=[ya],ua.connect(ya)}let As=Un.tremolo;if(Un.tremolosync!=null&&(As=d*Un.tremolosync),As!==void 0){const ya=Math.max(1-rs,0),xa=new GainNode(R,{gain:ya}),wa=p/d,Ia=getLfo(R,{skew:Un.tremoloskew??(Un.tremoloshape!=null?.5:1),frequency:As,depth:rs,time:wa,dcoffset:0,shape:Un.tremoloshape,phaseoffset:Un.tremolophase,min:0,max:1,curve:1.5,begin:e,end:Ua});sa.tremolo=[Ia],sa.tremolo_gain=[xa],Ia.connect(xa.gain),ua.audioNodes.push(Ia),ua.connect(xa)}if(Un.compressor!==void 0){const ya=getCompressor(R,Un.compressor,Un.compressorRatio,Un.compressorKnee,Un.compressorAttack,Un.compressorRelease);sa.compressor=[ya],ua.connect(ya)}if(Un.pan!==void 0){const ya=R.createStereoPanner();sa.pan=[ya],ya.pan.value=2*Un.pan-1,ua.connect(ya)}if(Un.phaserrate!==void 0&&bs>0){const{filterChain:ya,lfo:xa}=getPhaser(e,Ua,Un.phaserrate,bs,Un.phasercenter,Un.phasersweep);sa.phaser=[...ya],sa.phaser_lfo=[xa],ya.forEach(wa=>ua.connect(wa)),ua.audioNodes.push(xa)}if(ha!=="main"&&Fa>0&&es>0&&Za>0){const ya=gainNode(1);Za=clamp(Za,0,.98);const xa=R.createFeedbackDelay(1,es,Za),wa=gainNode(Fa),Ia=gainNode(Un.dry??1),da=new GainNode(R,{gain:1,channelCount:2,channelCountMode:"explicit"});ua.connect(ya).connect(Ia,xa).connectOne(1,wa).connect(da),ua.audioNodes.push(xa.feedbackGain,xa.delayGain),sa.delay=[xa],sa.delay_mix=[wa]}if(ha!=="main"&&Un.room>0){let ya;if(Un.ir!==void 0){let is,hs=getSound(Un.ir);Array.isArray(hs)?is=hs.data.samples[Un.i%hs.data.samples.length]:typeof hs=="object"&&(is=Object.values(hs.data.samples).flat()[Ta%Object.values(hs.data.samples).length]),ya=await loadBuffer$1(is,R,Un.ir,0)}const xa=gainNode(1),wa=R.createReverb(Un.roomsize,Un.roomfade,Un.roomlp,Un.roomdim,ya,Un.irspeed,Un.irbegin),Ia=gainNode(Un.room),da=gainNode(Un.dry??1),Ca=new GainNode(R,{gain:1,channelCount:2,channelCountMode:"explicit"});ua.connect(xa).connect(da,wa).connectOne(1,Ia).connect(Ca),sa.room=[wa],sa.room_mix=[Ia]}}if(Ea!==void 0&&Ea>_n){const _i=gainNode(1);_i.gain.setValueAtTime(1,Va+_n),_i.gain.linearRampToValueAtTime(0,Ua),ua.connect(_i)}const ga=new GainNode(R,{gain:an});if(b.main.post=[ga],ua.connect(ga),vn>0&&An>0&&bn>0){const _i=Oa.getDelay(An,bn,e);b.main.delay=[_i];const Un=Oa.sendDelay(ga,vn);b.main.delay_mix=[Un],ua.audioNodes.push(Un)}if(Qn>0){let _i;if(ra!==void 0){let sa,Ga=getSound(ra);Array.isArray(Ga)?sa=Ga.data.samples[ka%Ga.data.samples.length]:typeof Ga=="object"&&(sa=Object.values(Ga.data.samples).flat()[ka%Object.values(Ga.data.samples).length]),_i=await loadBuffer$1(sa,R,ra,0)}const Un=Oa.getReverb(ia,Zn,Vn,qn,_i,aa,jn);b.main.room=[Un];const ha=Oa.sendReverb(ga,Qn);b.main.room_mix=[ha],ua.audioNodes.push(ha)}if(Bn!=null){const _i=I.getBus(Bn),Un=effectSend(ga,_i,Nn);ua.audioNodes.push(Un)}if(yn!=null){const _i=Oa.getDjf(yn,e);b.main.djf=[_i]}if(Aa&&!(R instanceof OfflineAudioContext)){const _i=getAnalyserById(Aa,2**(Na+5)),Un=effectSend(ga,_i,1);ua.audioNodes.push(Un)}if(Pn!=null){Pn=applyGainCurve(Pn);const _i=new GainNode(R,{gain:Pn});ua.connect(_i),Oa.connectToOutput(_i)}else Oa.connectToOutput(ga);Kn.forEach((_i,Un)=>{const ha=Un===Kn.length-1?"main":Un;if(_i.lfo)for(const sa of _i.lfo.__ids){const Ga=_i.lfo[sa];Ga.fxi??=ha;const Ha=connectLFO(sa,{...Ga,cps:d,cycle:p,begin:e,end:Ua},b);Ha&&ua.audioNodes.push(Ha)}if(_i.env)for(const sa of _i.env.__ids){const Ga=_i.env[sa];Ga.fxi??=ha;const Ha=connectEnvelope(sa,{...Ga,begin:e,end:Ua},b);Ha&&ua.audioNodes.push(Ha)}if(_i.bmod)for(const sa of _i.bmod.__ids){const Ga=_i.bmod[sa];Ga.fxi??=ha;const{toCleanup:Ha}=connectBusModulator({...Ga,begin:e,end:Ua},b,controller);ua.audioNodes.push(...Ha)}})},superdoughTrigger=(o,e,l,d)=>{superdough(e,o-l,e.duration/d,d)},waveforms=["triangle","square","sawtooth","sine","user","one"],waveformAliases=[["tri","triangle"],["sqr","square"],["saw","sawtooth"],["sin","sine"]];function makeSaturationCurve(o,e){const l=o,d=new Float32Array(e);for(let p=0;p<e;p++){const b=p*2/e-1;d[p]=Math.tanh(b*l)}return d}function registerSynthSounds(){[...waveforms].forEach(o=>{registerSound(o,(e,l,d)=>{const[p,b,R,I]=getADSRValues([l.attack,l.decay,l.sustain,l.release],"linear",[.001,.05,.6,.01]),z=gainNode(.3),se=getOscillator(o,e,l,()=>{releaseAudioNode(z),d()}),{node:le,nodes:tn,stop:an,triggerRelease:sn}=se,{duration:ln}=l,un=gainNode(1),pn=le.connect(z).connect(un),yn=e+ln;getParamADSR(pn.gain,p,b,R,I,0,1,e,yn,"linear");const _n=yn+I+.01;return sn?.(_n),an(_n),{node:pn,nodes:tn,stop:Pn=>{an(Pn)}}},{type:"synth",prebake:!0})}),registerSound("sbd",(o,e,l)=>{const{duration:d,decay:p=.5,pdecay:b=.5,penv:R=36,clip:I}=e,z=getAudioContext(),se=.02,le=1.2,tn=.025,an=1,sn=z.createOscillator();sn.type="triangle",sn.frequency.value=getFrequencyFromValue(e,29),sn.detune.setValueAtTime(R*100,0),sn.detune.setValueAtTime(R*100,o),sn.detune.exponentialRampToValueAtTime(.001,o+b);const ln=gainNode(1);ln.gain.setValueAtTime(1,o+se),ln.gain.exponentialRampToValueAtTime(.001,o+se+p),sn.start(o);const un=getNoiseOscillator("brown",o,2),pn=gainNode(1);pn.gain.setValueAtTime(le,o),pn.gain.exponentialRampToValueAtTime(.001,o+tn);const yn=new WaveShaperNode(z);yn.curve=makeSaturationCurve(2,z.sampleRate);const _n=gainNode(an);onceEnded(sn,()=>{releaseAudioNode(sn),releaseAudioNode(ln),releaseAudioNode(yn),releaseAudioNode(un.node),releaseAudioNode(pn),releaseAudioNode(_n),l()});const Pn=sn.connect(yn).connect(ln).connect(_n);un.node.connect(pn).connect(_n);let bn=o+p+.01;return I!=null&&(bn=Math.min(o+I*d,bn)),_n.gain.setValueAtTime(an,bn-.01),_n.gain.linearRampToValueAtTime(0,bn),sn.stop(bn),un.stop(bn),{node:Pn,nodes:{source:[sn]},stop:Sn=>{sn.stop(Sn)}}},{type:"synth",prebake:!0}),registerSound("supersaw",(o,e,l)=>{const d=getAudioContext();let{duration:p,n:b,unison:R=5,spread:I=.6,detune:z}=e;z=z??b??.18;const se=getFrequencyFromValue(e),[le,tn,an,sn]=getADSRValues([e.attack,e.decay,e.sustain,e.release],"linear",[.001,.05,.6,.01]),ln=o+p,un=ln+sn+.01,pn=clamp(R,1,100);let yn=pn>1?clamp(I,0,1):0;const _n={frequency:se,begin:o,end:un,freqspread:z,voices:pn,panspread:yn},vn=getNodeFromPool("supersaw",()=>new AudioWorkletNode(d,"supersaw-oscillator",{outputChannelCount:[2]}));Object.entries(_n).forEach(([Nn,Qn])=>{const Zn=vn.parameters.get(Nn),Vn=Qn!==void 0?Qn:Zn.defaultValue;Zn.value=Vn}),vn.port.postMessage({type:"initialize"});const bn=1/Math.sqrt(pn);getPitchEnvelope(vn.parameters.get("detune"),e,o,ln);const Sn=getVibratoOscillator(vn.parameters.get("detune"),e,o),An=applyFM(vn.parameters.get("frequency"),e,o);let Dn=gainNode(1);Dn=vn.connect(Dn),getParamADSR(Dn.gain,le,tn,an,sn,0,.3*bn,o,ln,"linear");let Bn=webAudioTimeout(d,()=>{releaseNodeToPool(vn),l(),An?.stop(),Sn?.stop()},o,un);return{node:Dn,nodes:{source:[vn],...An?.nodes,...Sn?.nodes},stop:Nn=>{Bn.stop(Nn)}}},{prebake:!0,type:"synth"}),registerSound("bytebeat",(o,e,l)=>{const d=["(t%255 >= t/255%255)*255","(t*(t*8%60 <= 300)|(-t)*(t*4%512 < 256))+t/400","t","t*(t >> 10^t)","t&128","t&t>>8","((t%255+t%128+t%64+t%32+t%16+t%127.8+t%64.8+t%32.8+t%16.8)/3)","((t%64+t%63.8+t%64.15+t%64.35+t%63.5)/1.25)","(t&(t>>7)-t)","(sin(t*PI/128)*127+127)","((t^t/2+t+64*(sin((t*PI/64)+(t*PI/32768))+64))%128*2)","((t^t/2+t+64*(cos >> 0))%127.85*2)","((t^t/2+t+64)%128*2)","(((t * .25)^(t * .25)/100+(t * .25))%128)*2","((t^t/2+t+64)%7 * 24)"],{n:p=0}=e,b=getFrequencyFromValue(e),{byteBeatExpression:R=d[p%d.length],byteBeatStartTime:I}=e,z=getAudioContext();let{duration:se}=e;const[le,tn,an,sn]=getADSRValues([e.attack,e.decay,e.sustain,e.release],"linear",[.001,.05,.6,.01]),ln=o+se,un=ln+sn+.01;let pn=getWorklet(z,"byte-beat-processor",{frequency:b,begin:o,end:un},{outputChannelCount:[2]});pn.port.postMessage({codeText:R,byteBeatStartTime:I,frequency:b});let yn=gainNode(1);yn=pn.connect(yn),getParamADSR(yn.gain,le,tn,an,sn,0,1,o,ln,"linear");let _n=webAudioTimeout(z,()=>{releaseAudioNode(pn),l()},o,un);return{node:yn,source:pn,stop:Pn=>{_n.stop(Pn)}}},{prebake:!0,type:"synth"}),registerSound("pulse",(o,e,l)=>{const d=getAudioContext();let{pwrate:p,pwsweep:b}=e;b==null&&(p!=null?b=.3:b=0),p==null&&b!=null&&(p=1);let{duration:R,pw:I=.5}=e;const z=getFrequencyFromValue(e),[se,le,tn,an]=getADSRValues([e.attack,e.decay,e.sustain,e.release],"linear",[.001,.05,.6,.01]),sn=o+R,ln=sn+an+.01;let un=getWorklet(d,"pulse-oscillator",{frequency:z,begin:o,end:ln,pulsewidth:I},{outputChannelCount:[2]});getPitchEnvelope(un.parameters.get("detune"),e,o,sn);const pn=getVibratoOscillator(un.parameters.get("detune"),e,o),yn=applyFM(un.parameters.get("frequency"),e,o);let _n=gainNode(1);_n=un.connect(_n),getParamADSR(_n.gain,se,le,tn,an,0,1,o,sn,"linear");let Pn;b!=0&&(Pn=getLfo(d,{frequency:p,depth:b,begin:o,end:ln}),Pn.connect(un.parameters.get("pulsewidth")));let vn=webAudioTimeout(d,()=>{releaseAudioNode(un),releaseAudioNode(Pn),l(),yn?.stop(),pn?.stop()},o,ln);return{node:_n,nodes:{source:[un],pw_lfo:[Pn],...yn?.nodes,...pn?.nodes},stop:bn=>{vn.stop(bn)}}},{prebake:!0,type:"synth"}),registerSound("bus",(o,e,l)=>{const d=getAudioContext(),[p,b,R,I]=getADSRValues([e.attack,e.decay,e.sustain,e.release],"linear",[.001,.05,1,.01]),z=o+e.duration,se=z+I+.01,le=getSuperdoughAudioController().getBus(e.n??0),tn=le.connect(gainNode(0));getParamADSR(tn.gain,p,b,R,I,0,1,o,z,"linear");const an=webAudioTimeout(d,()=>{le.disconnect(tn),l()},o,se);return{node:tn,nodes:{source:[le]},stop:sn=>{an.stop(sn)}}},{prebake:!0,type:"input"}),[...noises].forEach(o=>{registerSound(o,(e,l,d)=>{const[p,b,R,I]=getADSRValues([l.attack,l.decay,l.sustain,l.release],"linear",[.001,.05,.6,.01]);let z,{density:se}=l;z=getNoiseOscillator(o,e,se);let{node:le,stop:tn,triggerRelease:an}=z;const sn=gainNode(.3),{duration:ln}=l;onceEnded(le,()=>{releaseAudioNode(le),releaseAudioNode(sn),d()});const un=gainNode(1);let pn=le.connect(sn).connect(un);const yn=e+ln;getParamADSR(pn.gain,p,b,R,I,0,1,e,yn,"linear");const _n=yn+I+.01;return an?.(_n),tn(_n),{node:pn,nodes:{source:[le]},stop:Pn=>{tn(Pn)}}},{type:"synth",prebake:!0})}),waveformAliases.forEach(([o,e])=>soundMap$1.set({...soundMap$1.get(),[o]:soundMap$1.get()[e]}))}const PI2=2*Math.PI;function waveformN(o,e,l){o=typeof o=="object"?o:new Float32Array(o).fill(1);const p=o.length,b=new Float32Array(p+1),R=new Float32Array(p+1),I=getAudioContext(),z=I.createOscillator(),se={sawtooth:tn=>[0,-1/tn],square:tn=>[0,tn%2===0?0:1/tn],triangle:tn=>[tn%2===0?0:1/(tn*tn),0],user:tn=>[0,1]};if(!se[l])throw new Error(`unknown wave type ${l}`);for(let tn=0;tn<p;tn++){const an=o[tn],[sn,ln]=se[l](tn+1),un=e?.[tn]??0;let pn=sn*an,yn=ln*an;if(un!==0){const _n=Math.cos(PI2*un),Pn=Math.sin(PI2*un);pn=_n*pn-Pn*yn,yn=Pn*pn+_n*yn}b[tn+1]=pn,R[tn+1]=yn}const le=I.createPeriodicWave(b,R);return z.setPeriodicWave(le),z}function getOscillator(o,e,l,d){const{duration:p,noise:b=0}=l,R=l.partials??l.n;let I;if(o==="user"&&!R&&(logger$1("[superdough] Synth 'user' was selected, but partials not specified. Defaulting to triangle. Use pat.partials to setup custom waveform"),o="triangle"),o=o==="user"&&!R?"triangle":o,o==="one")return I=new ConstantSourceNode(getAudioContext(),{offset:1}),I.start(e),{node:I,nodes:{source:I},stop:tn=>I?.stop(tn)};!R||R?.length===0||o==="sine"?(I=getAudioContext().createOscillator(),I.type=o||"triangle"):I=waveformN(R,l.phases,o),I.frequency.value=getFrequencyFromValue(l);const z=getVibratoOscillator(I.detune,l,e);getPitchEnvelope(I.detune,l,e,e+p);const se=applyFM(I.frequency,l,e);let le;return b&&(le=getNoiseMix(I,b,e)),onceEnded(I,()=>{le?.teardown(),releaseAudioNode(I),releaseAudioNode(le?.node),d()}),I.start(e),{node:le?.node||I,nodes:{source:[I],...z?.nodes,...se?.nodes},stop:tn=>{se.stop(tn),z?.stop(tn),le?.stop(tn),I.stop(tn)},triggerRelease:tn=>{}}}function buildSamples(o=1,e=.05,l=220,d=0,p=0,b=.1,R=0,I=1,z=0,se=0,le=0,tn=0,an=0,sn=0,ln=0,un=0,pn=0,yn=1,_n=0,Pn=0){let vn=Math.PI*2,bn=getAudioContext().sampleRate,Sn=ka=>ka>0?1:-1,An=z*=500*vn/bn/bn,Dn=l*=(1+e*2*Math.random()-e)*vn/bn,Bn=[],Nn=0,Qn=0,Zn=0,Vn=1,qn=0,ia=0,ra=0,aa,jn;for(d=d*bn+9,_n*=bn,p*=bn,b*=bn,pn*=bn,se*=500*vn/bn**3,ln*=vn/bn,le*=vn/bn,tn*=bn,an=an*bn|0,jn=d+_n+p+b+pn|0;Zn<jn;Bn[Zn++]=ra)++ia%(un*100|0)||(ra=R?R>1?R>2?R>3?Math.sin((Nn%vn)**3):Math.max(Math.min(Math.tan(Nn),1),-1):1-(2*Nn/vn%2+2)%2:1-4*Math.abs(Math.round(Nn/vn)-Nn/vn):Math.sin(Nn),ra=(an?1-Pn+Pn*Math.sin(vn*Zn/an):1)*Sn(ra)*Math.abs(ra)**I*o*1*(Zn<d?Zn/d:Zn<d+_n?1-(Zn-d)/_n*(1-yn):Zn<d+_n+p?yn:Zn<jn-pn?(jn-Zn-pn)/b*yn:0),ra=pn?ra/2+(pn>Zn?0:(Zn<jn-pn?1:(jn-Zn)/pn)*Bn[Zn-pn|0]/2):ra),aa=(l+=z+=se)*Math.cos(ln*Qn++),Nn+=aa-aa*sn*(1-(Math.sin(Zn)+1)*1e9%2),Vn&&++Vn>tn&&(l+=le,Dn+=le,Vn=0),an&&!(++qn%an)&&(l=Dn,z=An,Vn||=1);return Bn}const getZZFX=(o,e)=>{let{s:l,note:d=36,freq:p,zrand:b=0,attack:R=0,decay:I=0,sustain:z=.8,release:se=.1,curve:le=1,slide:tn=0,deltaSlide:an=0,pitchJump:sn=0,pitchJumpTime:ln=0,lfo:un=0,znoise:pn=0,zmod:yn=0,zcrush:_n=0,zdelay:Pn=0,tremolo:vn=0,duration:bn=.2,zzfx:Sn}=o;const An=Math.max(bn-R-I,0);typeof d=="string"&&(d=noteToMidi(d)),!p&&typeof d=="number"&&(p=midiToFreq$1(d)),l=l.replace("z_","");const Dn=["sine","triangle","sawtooth","tan","noise"].indexOf(l)||0;le=l==="square"?0:le;const Nn=buildSamples(...Sn||[.25,b,p,R,An,se,Dn,le,tn,an,sn,ln,un,pn,yn,_n,Pn,z,I,vn]),Qn=getAudioContext(),Zn=Qn.createBuffer(1,Nn.length,Qn.sampleRate);Zn.getChannelData(0).set(Nn);const Vn=getAudioContext().createBufferSource();return Vn.buffer=Zn,Vn.start(e),{node:Vn}};function registerZZFXSounds(){["zzfx","z_sine","z_sawtooth","z_triangle","z_square","z_tan","z_noise"].forEach(o=>{registerSound(o,(e,l,d)=>{const{node:p}=getZZFX({s:o,...l},e);return onceEnded(p,()=>{releaseAudioNode(p),d()}),{node:p,nodes:{source:[p]},stop:()=>{}}},{type:"synth",prebake:!0})})}let worklet;async function dspWorklet(o,e){const l=`dsp-worklet-${Date.now()}`,d=`${e}
|
||
let __q = []; // trigger queue
|
||
class MyProcessor extends AudioWorkletProcessor {
|
||
constructor() {
|
||
super();
|
||
this.t = 0;
|
||
this.stopped = false;
|
||
this.port.onmessage = (e) => {
|
||
if(e.data==='stop') {
|
||
this.stopped = true;
|
||
} else if(e.data?.dough) {
|
||
__q.push(e.data)
|
||
} else {
|
||
msg?.(e.data)
|
||
}
|
||
};
|
||
}
|
||
process(inputs, outputs, parameters) {
|
||
const output = outputs[0];
|
||
if(__q.length) {
|
||
for(let i=0;i<__q.length;++i) {
|
||
const deadline = __q[i].time-currentTime;
|
||
if(deadline<=0) {
|
||
trigger(__q[i].dough)
|
||
__q.splice(i,1)
|
||
}
|
||
}
|
||
}
|
||
for (let i = 0; i < output[0].length; i++) {
|
||
const out = dsp(this.t / sampleRate);
|
||
output.forEach((channel) => {
|
||
channel[i] = out;
|
||
});
|
||
this.t++;
|
||
}
|
||
return !this.stopped;
|
||
}
|
||
}
|
||
registerProcessor('${l}', MyProcessor);
|
||
`,b=`data:text/javascript;base64,${btoa(d)}`;await o.audioWorklet.addModule(b);const R=new AudioWorkletNode(o,l);return{node:R,stop:()=>R.port.postMessage("stop")}}const stop=()=>{worklet&&(worklet?.stop(),worklet?.node?.disconnect())};typeof window<"u"&&window.addEventListener("message",o=>{o.data==="strudel-stop"?stop():o.data?.dough&&worklet?.node.port.postMessage(o.data)});const dough=async o=>{const e=getAudioContext();stop(),worklet=await dspWorklet(e,o),worklet.node.connect(e.destination)};function doughTrigger(o,e,l,d){window.postMessage({time:d,dough:o.value,currentTime:e,duration:o.duration,cps:l})}let doughWorklet;function initDoughWorklet(){const o=getAudioContext();doughWorklet=getWorklet(o,"dough-processor",{},{outputChannelCount:[2]}),connectToDestination(doughWorklet)}const soundMap=new Map,loadedSounds=new Map;Pattern$1.prototype.supradough=function(){return this.onTrigger((o,e,l,d)=>{o.value._begin=d,o.value._duration=o.duration/l,!doughWorklet&&initDoughWorklet();const p=(o.value.bank?o.value.bank+"_":"")+o.value.s,b=o.value.n??0,R=`${p}:${b}`;if(soundMap.has(p)&&(o.value.s=R),soundMap.has(p)&&!loadedSounds.has(R)){const I=soundMap.get(p),z=I[b%I.length];console.log(`load ${R} from ${z}`);const se=fetchSample(z);loadedSounds.set(R,se),se.then(({channels:le,sampleRate:tn})=>doughWorklet.port.postMessage({sample:R,channels:le,sampleRate:tn}))}doughWorklet.port.postMessage({spawn:o.value})},1)};function githubPath$1(o,e=""){if(!o.startsWith("github:"))throw new Error('expected "github:" at the start of pseudoUrl');let[l,d]=o.split("github:");return d=d.endsWith("/")?d.slice(0,-1):d,d.split("/").length===2&&(d+="/main"),`https://raw.githubusercontent.com/${d}/${e}`}async function fetchSampleMap(o){if(o.startsWith("github:")&&(o=githubPath$1(o,"strudel.json")),o.startsWith("local:")&&(o="http://localhost:5432"),o.startsWith("shabda:")){let[d,p]=o.split("shabda:");o=`https://shabda.ndre.gr/${p}.json?strudel=1`}if(o.startsWith("shabda/speech")){let[d,p]=o.split("shabda/speech");p=p.startsWith("/")?p.substring(1):p;let[b,R]=p.split(":"),I="f",z="en-GB";b&&([z,I]=b.split("/")),o=`https://shabda.ndre.gr/speech/${R}.json?gender=${I}&language=${z}&strudel=1'`}if(typeof fetch!="function")return;const e=o.split("/").slice(0,-1).join("/");if(typeof fetch>"u")return;const l=await fetch(o).then(d=>d.json()).catch(d=>{throw console.error(d),new Error(`error loading "${o}"`)});return[l,l._base||e]}async function fetchSample(o){const e=await fetch(o).then(d=>d.arrayBuffer()).then(d=>getAudioContext().decodeAudioData(d));let l=[];for(let d=0;d<e.numberOfChannels;d++)l.push(e.getChannelData(d));return{channels:l,sampleRate:e.sampleRate}}async function doughsamples(o,e){if(typeof o=="string"){const[l,d]=await fetchSampleMap(o);return doughsamples(l,d)}Object.entries(o).map(async([l,d])=>{l!=="_base"&&(d=d.map(p=>e+p),soundMap.set(l,d))})}const _workletUrl="data:text/javascript;base64,dmFyIGh0PU9iamVjdC5kZWZpbmVQcm9wZXJ0eTt2YXIgbnQ9KHUsbSxmKT0+bSBpbiB1P2h0KHUsbSx7ZW51bWVyYWJsZTohMCxjb25maWd1cmFibGU6ITAsd3JpdGFibGU6ITAsdmFsdWU6Zn0pOnVbbV09Zjt2YXIgZT0odSxtLGYpPT5udCh1LHR5cGVvZiBt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9cz0+e3MuZGF0YS5zcGF3bj90aGlzLmRvdWdoLnNjaGVkdWxlU3Bhd24ocy5kYXRhLnNwYXduKTpzLmRhdGEuc2FtcGxlP3RoaXMuZG91Z2gubG9hZFNhbXBsZShzLmRhdGEuc2FtcGxlLHMuZGF0YS5jaGFubmVscyxzLmRhdGEuc2FtcGxlUmF0ZSk6cy5kYXRhLnNhbXBsZXM/cy5kYXRhLnNhbXBsZXMuZm9yRWFjaCgoW3QsaSxuXSk9Pnt0aGlzLmRvdWdoLmxvYWRTYW1wbGUodCxpLG4pfSk6Y29uc29sZS5sb2coInVucmVjb2duaXplZCBldmVudCB0eXBlIixzLmRhdGEpfX1wcm9jZXNzKHMsdCxpKXtpZih0aGlzLmRpc2Nvbm5lY3RlZClyZXR1cm4hMTtjb25zdCBuPXRbMF07Zm9yKGxldCBsPTA7bDxuWzBdLmxlbmd0aDtsKyspe3RoaXMuZG91Z2gudXBkYXRlKCk7Zm9yKGxldCByPTA7cjxuLmxlbmd0aDtyKyspbltyXVtsXT1pdCh0aGlzLmRvdWdoLm91dFtyXSwtMSwxKX1yZXR1cm4hMH19cmVnaXN0ZXJQcm9jZXNzb3IoImRvdWdoLXByb2Nlc3NvciIsYXQpfSkoKTsK";typeof sampleRate<"u"&&sampleRate;const workletUrl=_workletUrl;registerWorklet(workletUrl);const{Pattern,logger,repl}=core;setLogger(logger);const hap2value=o=>(o.ensureObjectValue(),o.value),webaudioOutput=(o,e,l,d,p)=>superdough(hap2value(o),p,l,d,o.whole?.begin.valueOf());async function renderPatternAudio(o,e,l,d,p,b,R,I=void 0){let z=getAudioContext();await z.close(),z=new OfflineAudioContext(2,(d-l)/e*p,p),setAudioContext(z),setSuperdoughAudioController(new SuperdoughAudioController(z)),await initAudio({maxPolyphony:b,multiChannelOrbits:R}),logger("[webaudio] preloading");let se=o.queryArc(l,d,{_cps:e}).sort((le,tn)=>le.whole.begin.valueOf()-tn.whole.begin.valueOf());for(const le of se)if(le.hasOnset())try{await superdough(hap2value(le),(le.whole.begin.valueOf()-l)/e,le.duration/e,e,(le.whole?.begin.valueOf()-l)/e)}catch(tn){errorLogger(tn,"webaudio")}return logger("[webaudio] start rendering"),z.startRendering().then(le=>{const tn=audioBufferToWav(le),an=new Blob([tn],{type:"audio/wav"}),sn=URL.createObjectURL(an),ln=document.createElement("a");ln.href=sn,I=I?`${I}.wav`:`${new Date().toISOString()}.wav`,ln.download=`${I}`,document.body.appendChild(ln),ln.click(),document.body.removeChild(ln),URL.revokeObjectURL(sn)}).finally(async()=>{setAudioContext(null),setSuperdoughAudioController(null),resetGlobalEffects()})}function webaudioRepl(o={}){const e=o.audioContext??getAudioContext();return setAudioContext(e),o={getTime:()=>e.currentTime,defaultOutput:webaudioOutput,...o},repl(o)}Pattern.prototype.dough=function(){return this.onTrigger(doughTrigger,1)};function audioBufferToWav(o,e){e=e||{};var l=o.numberOfChannels,d=o.sampleRate,p=e.float32?3:1,b=p===3?32:16,R;return l===2?R=interleave(o.getChannelData(0),o.getChannelData(1)):R=o.getChannelData(0),encodeWAV(R,p,d,l,b)}function encodeWAV(o,e,l,d,p){var b=p/8,R=d*b,I=new ArrayBuffer(44+o.length*b),z=new DataView(I);return writeString(z,0,"RIFF"),z.setUint32(4,36+o.length*b,!0),writeString(z,8,"WAVE"),writeString(z,12,"fmt "),z.setUint32(16,16,!0),z.setUint16(20,e,!0),z.setUint16(22,d,!0),z.setUint32(24,l,!0),z.setUint32(28,l*R,!0),z.setUint16(32,R,!0),z.setUint16(34,p,!0),writeString(z,36,"data"),z.setUint32(40,o.length*b,!0),e===1?floatTo16BitPCM(z,44,o):writeFloat32(z,44,o),I}function interleave(o,e){for(var l=o.length+e.length,d=new Float32Array(l),p=0,b=0;p<l;)d[p++]=o[b],d[p++]=e[b],b++;return d}function writeFloat32(o,e,l){for(var d=0;d<l.length;d++,e+=4)o.setFloat32(e,l[d],!0)}function floatTo16BitPCM(o,e,l){for(var d=0;d<l.length;d++,e+=2){var p=Math.max(-1,Math.min(1,l[d]));o.setInt16(e,p<0?p*32768:p*32767,!0)}}function writeString(o,e,l){for(var d=0;d<l.length;d++)o.setUint8(e+d,l.charCodeAt(d))}function drawTimeScope(o,{align:e=!0,color:l="white",thickness:d=3,scale:p=.25,pos:b=.75,trigger:R=0,ctx:I=getDrawContext(),id:z=1}={}){I.lineWidth=d,I.strokeStyle=l;let se=I.canvas;if(!o){I.beginPath();let un=b*se.height;I.moveTo(0,un),I.lineTo(se.width,un),I.stroke();return}const le=getAnalyzerData("time",z);I.beginPath();const tn=o.frequencyBinCount;let an=e?Array.from(le).findIndex((un,pn,yn)=>pn&&yn[pn-1]>-R&&un<=-R):0;an=Math.max(an,0);const sn=se.width*1/tn;let ln=0;for(let un=an;un<tn;un++){const pn=le[un]+1,yn=(b-p*(pn-1))*se.height;un===0?I.moveTo(ln,yn):I.lineTo(ln,yn),ln+=sn}I.stroke()}function drawFrequencyScope(o,{color:e="white",scale:l=.25,pos:d=.75,lean:p=.5,min:b=-150,max:R=0,ctx:I=getDrawContext(),id:z=1}={}){if(!o){I.beginPath();let ln=d*le.height;I.moveTo(0,ln),I.lineTo(le.width,ln),I.stroke();return}const se=getAnalyzerData("frequency",z),le=I.canvas;I.fillStyle=e;const tn=o.frequencyBinCount,an=le.width*1/tn;let sn=0;for(let ln=0;ln<tn;ln++){const pn=clamp$1((se[ln]-b)/(R-b),0,1)*l,yn=pn*le.height,_n=(d-pn*p)*le.height;I.fillRect(sn,_n,Math.max(an,1),yn),sn+=an}}function clearScreen(o=0,e="0,0,0",l=getDrawContext()){o?(l.fillStyle=`rgba(${e},${1-o})`,l.fillRect(0,0,l.canvas.width,l.canvas.height)):l.clearRect(0,0,l.canvas.width,l.canvas.height)}Pattern$1.prototype.fscope=function(o={}){let e=o.id??1;return this.analyze(e).draw(()=>{clearScreen(o.smear,"0,0,0",o.ctx),analysers[e]&&drawFrequencyScope(analysers[e],o)},{id:e})},Pattern$1.prototype.tscope=function(o={}){let e=o.id??1;return this.analyze(e).draw(l=>{o.color=l[0]?.value?.color||getTheme().foreground,o.color,clearScreen(o.smear,"0,0,0",o.ctx),drawTimeScope(analysers[e],o)},{id:e})},Pattern$1.prototype.scope=Pattern$1.prototype.tscope;let latestColor={};Pattern$1.prototype.spectrum=function(o={}){let e=o.id??1;return this.analyze(e).draw(l=>{o.color=l[0]?.value?.color||latestColor[e]||getTheme().foreground,latestColor[e]=o.color,drawSpectrum(analysers[e],o)},{id:e})},Pattern$1.prototype.scope=Pattern$1.prototype.tscope;const lastFrames=new Map;function drawSpectrum(o,{thickness:e=3,speed:l=1,min:d=-80,max:p=0,ctx:b=getDrawContext(),id:R=1,color:I}={}){if(b.lineWidth=e,b.strokeStyle=I,!o)return;const z=l,se=getAnalyzerData("frequency",R),le=b.canvas;b.fillStyle=I;const tn=o.frequencyBinCount;let an=lastFrames.get(R)||b.getImageData(0,0,le.width,le.height);lastFrames.set(R,an),b.clearRect(0,0,b.canvas.width,b.canvas.height),b.putImageData(an,-z,0);let sn=le.width-l;for(let ln=0;ln<tn;ln++){const un=clamp$1((se[ln]-d)/(p-d),0,1);b.globalAlpha=un;const pn=Math.log(ln+1)/Math.log(tn)*le.height;b.fillRect(sn,le.height-pn,z,2)}lastFrames.set(R,b.getImageData(0,0,le.width,le.height))}const index$b=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_MAX_POLYPHONY,Warpmode,aliasBank,get analysers(){return analysers},get analysersData(){return analysersData},applyFM,applyGainCurve,applyParameterModulators,cleanupOnEnd,connectBusModulator,connectEnvelope,connectLFO,connectToDestination,createFilter,distortionAlgorithms,dough,doughTrigger,doughsamples,drawFrequencyScope,drawTimeScope,drywet,dspWorklet,effectSend,errorLogger,gainNode,getADSRValues,getAnalyserById,getAnalyzerData,getAudioContext,getAudioContextCurrentTime,getAudioDevices,getCachedBuffer,getCompressor,getDefaultValue,getDistortion,getDistortionAlgorithm,getEnvelope,getFrequencyFromValue,getLfo,getLoadedBuffer,getOscillator,getParamADSR,getParamLfo,getPitchEnvelope,getSampleBuffer,getSampleBufferSource,getSampleInfo,getSound,getSuperdoughAudioController,getVibratoOscillator,getWorklet,getZZFX,initAudio,initAudioOnFirstClick,loadBuffer:loadBuffer$1,loadWorklets,logger:logger$1,get maxPolyphony(){return maxPolyphony},get multiChannelOrbits(){return multiChannelOrbits},noises,onTriggerSample,onTriggerSynth,onceEnded,processSampleMap,registerSampleSource,registerSamplesPrefix,registerSound,registerSynthSounds,registerWaveTable,registerWorklet,registerZZFXSounds,releaseAudioNode,renderPatternAudio,resetDefaultValues,resetDefaults,resetGlobalEffects,resetLoadedSounds,resetSeenKeys,reverseBuffer,samples,scheduleAtTime,setAudioContext,setDefault,setDefaultAudioContext,setDefaultValue,setDefaultValues,setGainCurve,setLogger,setMaxPolyphony,setMultiChannelOrbits,setSuperdoughAudioController,setVersionDefaults,soundAlias,soundMap:soundMap$1,superdough,superdoughTrigger,tables,waveformN,webAudioTimeout,webaudioOutput,webaudioRepl},Symbol.toStringTag,{value:"Module"}));let rangeFrom=[],rangeTo=[];(()=>{let o="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,l=0;e<o.length;e++)(e%2?rangeTo:rangeFrom).push(l=l+o[e])})();function isExtendingChar(o){if(o<768)return!1;for(let e=0,l=rangeFrom.length;;){let d=e+l>>1;if(o<rangeFrom[d])l=d;else if(o>=rangeTo[d])e=d+1;else return!0;if(e==l)return!1}}function isRegionalIndicator(o){return o>=127462&&o<=127487}const ZWJ=8205;function findClusterBreak$1(o,e,l=!0,d=!0){return(l?nextClusterBreak$1:prevClusterBreak)(o,e,d)}function nextClusterBreak$1(o,e,l){if(e==o.length)return e;e&&surrogateLow$1(o.charCodeAt(e))&&surrogateHigh$1(o.charCodeAt(e-1))&&e--;let d=codePointAt$1(o,e);for(e+=codePointSize$1(d);e<o.length;){let p=codePointAt$1(o,e);if(d==ZWJ||p==ZWJ||l&&isExtendingChar(p))e+=codePointSize$1(p),d=p;else if(isRegionalIndicator(p)){let b=0,R=e-2;for(;R>=0&&isRegionalIndicator(codePointAt$1(o,R));)b++,R-=2;if(b%2==0)break;e+=2}else break}return e}function prevClusterBreak(o,e,l){for(;e>0;){let d=nextClusterBreak$1(o,e-2,l);if(d<e)return d;e--}return 0}function codePointAt$1(o,e){let l=o.charCodeAt(e);if(!surrogateHigh$1(l)||e+1==o.length)return l;let d=o.charCodeAt(e+1);return surrogateLow$1(d)?(l-55296<<10)+(d-56320)+65536:l}function surrogateLow$1(o){return o>=56320&&o<57344}function surrogateHigh$1(o){return o>=55296&&o<56320}function codePointSize$1(o){return o<65536?1:2}let Text$1=class Ur{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,l,d){[e,l]=clip(this,e,l);let p=[];return this.decompose(0,e,p,2),d.length&&d.decompose(0,d.length,p,3),this.decompose(l,this.length,p,1),TextNode.from(p,this.length-(l-e)+d.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,l=this.length){[e,l]=clip(this,e,l);let d=[];return this.decompose(e,l,d,0),TextNode.from(d,l-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let l=this.scanIdentical(e,1),d=this.length-this.scanIdentical(e,-1),p=new RawTextCursor(this),b=new RawTextCursor(e);for(let R=l,I=l;;){if(p.next(R),b.next(R),R=0,p.lineBreak!=b.lineBreak||p.done!=b.done||p.value!=b.value)return!1;if(I+=p.value.length,p.done||I>=d)return!0}}iter(e=1){return new RawTextCursor(this,e)}iterRange(e,l=this.length){return new PartialTextCursor(this,e,l)}iterLines(e,l){let d;if(e==null)d=this.iter();else{l==null&&(l=this.lines+1);let p=this.line(e).from;d=this.iterRange(p,Math.max(p,l==this.lines+1?this.length:l<=1?0:this.line(l-1).to))}return new LineCursor(d)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Ur.empty:e.length<=32?new TextLeaf(e):TextNode.from(TextLeaf.split(e,[]))}};class TextLeaf extends Text$1{constructor(e,l=textLength(e)){super(),this.text=e,this.length=l}get lines(){return this.text.length}get children(){return null}lineInner(e,l,d,p){for(let b=0;;b++){let R=this.text[b],I=p+R.length;if((l?d:I)>=e)return new Line(p,I,d,R);p=I+1,d++}}decompose(e,l,d,p){let b=e<=0&&l>=this.length?this:new TextLeaf(sliceText(this.text,e,l),Math.min(l,this.length)-Math.max(0,e));if(p&1){let R=d.pop(),I=appendText(b.text,R.text.slice(),0,b.length);if(I.length<=32)d.push(new TextLeaf(I,R.length+b.length));else{let z=I.length>>1;d.push(new TextLeaf(I.slice(0,z)),new TextLeaf(I.slice(z)))}}else d.push(b)}replace(e,l,d){if(!(d instanceof TextLeaf))return super.replace(e,l,d);[e,l]=clip(this,e,l);let p=appendText(this.text,appendText(d.text,sliceText(this.text,0,e)),l),b=this.length+d.length-(l-e);return p.length<=32?new TextLeaf(p,b):TextNode.from(TextLeaf.split(p,[]),b)}sliceString(e,l=this.length,d=`
|
||
`){[e,l]=clip(this,e,l);let p="";for(let b=0,R=0;b<=l&&R<this.text.length;R++){let I=this.text[R],z=b+I.length;b>e&&R&&(p+=d),e<z&&l>b&&(p+=I.slice(Math.max(0,e-b),l-b)),b=z+1}return p}flatten(e){for(let l of this.text)e.push(l)}scanIdentical(){return 0}static split(e,l){let d=[],p=-1;for(let b of e)d.push(b),p+=b.length+1,d.length==32&&(l.push(new TextLeaf(d,p)),d=[],p=-1);return p>-1&&l.push(new TextLeaf(d,p)),l}}class TextNode extends Text$1{constructor(e,l){super(),this.children=e,this.length=l,this.lines=0;for(let d of e)this.lines+=d.lines}lineInner(e,l,d,p){for(let b=0;;b++){let R=this.children[b],I=p+R.length,z=d+R.lines-1;if((l?z:I)>=e)return R.lineInner(e,l,d,p);p=I+1,d=z+1}}decompose(e,l,d,p){for(let b=0,R=0;R<=l&&b<this.children.length;b++){let I=this.children[b],z=R+I.length;if(e<=z&&l>=R){let se=p&((R<=e?1:0)|(z>=l?2:0));R>=e&&z<=l&&!se?d.push(I):I.decompose(e-R,l-R,d,se)}R=z+1}}replace(e,l,d){if([e,l]=clip(this,e,l),d.lines<this.lines)for(let p=0,b=0;p<this.children.length;p++){let R=this.children[p],I=b+R.length;if(e>=b&&l<=I){let z=R.replace(e-b,l-b,d),se=this.lines-R.lines+z.lines;if(z.lines<se>>4&&z.lines>se>>6){let le=this.children.slice();return le[p]=z,new TextNode(le,this.length-(l-e)+d.length)}return super.replace(b,I,z)}b=I+1}return super.replace(e,l,d)}sliceString(e,l=this.length,d=`
|
||
`){[e,l]=clip(this,e,l);let p="";for(let b=0,R=0;b<this.children.length&&R<=l;b++){let I=this.children[b],z=R+I.length;R>e&&b&&(p+=d),e<z&&l>R&&(p+=I.sliceString(e-R,l-R,d)),R=z+1}return p}flatten(e){for(let l of this.children)l.flatten(e)}scanIdentical(e,l){if(!(e instanceof TextNode))return 0;let d=0,[p,b,R,I]=l>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;p+=l,b+=l){if(p==R||b==I)return d;let z=this.children[p],se=e.children[b];if(z!=se)return d+z.scanIdentical(se,l);d+=z.length+1}}static from(e,l=e.reduce((d,p)=>d+p.length+1,-1)){let d=0;for(let sn of e)d+=sn.lines;if(d<32){let sn=[];for(let ln of e)ln.flatten(sn);return new TextLeaf(sn,l)}let p=Math.max(32,d>>5),b=p<<1,R=p>>1,I=[],z=0,se=-1,le=[];function tn(sn){let ln;if(sn.lines>b&&sn instanceof TextNode)for(let un of sn.children)tn(un);else sn.lines>R&&(z>R||!z)?(an(),I.push(sn)):sn instanceof TextLeaf&&z&&(ln=le[le.length-1])instanceof TextLeaf&&sn.lines+ln.lines<=32?(z+=sn.lines,se+=sn.length+1,le[le.length-1]=new TextLeaf(ln.text.concat(sn.text),ln.length+1+sn.length)):(z+sn.lines>p&&an(),z+=sn.lines,se+=sn.length+1,le.push(sn))}function an(){z!=0&&(I.push(le.length==1?le[0]:TextNode.from(le,se)),se=-1,z=le.length=0)}for(let sn of e)tn(sn);return an(),I.length==1?I[0]:new TextNode(I,l)}}Text$1.empty=new TextLeaf([""],0);function textLength(o){let e=-1;for(let l of o)e+=l.length+1;return e}function appendText(o,e,l=0,d=1e9){for(let p=0,b=0,R=!0;b<o.length&&p<=d;b++){let I=o[b],z=p+I.length;z>=l&&(z>d&&(I=I.slice(0,d-p)),p<l&&(I=I.slice(l-p)),R?(e[e.length-1]+=I,R=!1):e.push(I)),p=z+1}return e}function sliceText(o,e,l){return appendText(o,[""],e,l)}class RawTextCursor{constructor(e,l=1){this.dir=l,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[l>0?1:(e instanceof TextLeaf?e.text.length:e.children.length)<<1]}nextInner(e,l){for(this.done=this.lineBreak=!1;;){let d=this.nodes.length-1,p=this.nodes[d],b=this.offsets[d],R=b>>1,I=p instanceof TextLeaf?p.text.length:p.children.length;if(R==(l>0?I:0)){if(d==0)return this.done=!0,this.value="",this;l>0&&this.offsets[d-1]++,this.nodes.pop(),this.offsets.pop()}else if((b&1)==(l>0?0:1)){if(this.offsets[d]+=l,e==0)return this.lineBreak=!0,this.value=`
|
||
`,this;e--}else if(p instanceof TextLeaf){let z=p.text[R+(l<0?-1:0)];if(this.offsets[d]+=l,z.length>Math.max(0,e))return this.value=e==0?z:l>0?z.slice(e):z.slice(0,z.length-e),this;e-=z.length}else{let z=p.children[R+(l<0?-1:0)];e>z.length?(e-=z.length,this.offsets[d]+=l):(l<0&&this.offsets[d]--,this.nodes.push(z),this.offsets.push(l>0?1:(z instanceof TextLeaf?z.text.length:z.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class PartialTextCursor{constructor(e,l,d){this.value="",this.done=!1,this.cursor=new RawTextCursor(e,l>d?-1:1),this.pos=l>d?e.length:0,this.from=Math.min(l,d),this.to=Math.max(l,d)}nextInner(e,l){if(l<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,l<0?this.pos-this.to:this.from-this.pos);let d=l<0?this.pos-this.from:this.to-this.pos;e>d&&(e=d),d-=e;let{value:p}=this.cursor.next(e);return this.pos+=(p.length+e)*l,this.value=p.length<=d?p:l<0?p.slice(p.length-d):p.slice(0,d),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class LineCursor{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:l,lineBreak:d,value:p}=this.inner.next(e);return l&&this.afterBreak?(this.value="",this.afterBreak=!1):l?(this.done=!0,this.value=""):d?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=p,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Text$1.prototype[Symbol.iterator]=function(){return this.iter()},RawTextCursor.prototype[Symbol.iterator]=PartialTextCursor.prototype[Symbol.iterator]=LineCursor.prototype[Symbol.iterator]=function(){return this});class Line{constructor(e,l,d,p){this.from=e,this.to=l,this.number=d,this.text=p}get length(){return this.to-this.from}}function clip(o,e,l){return e=Math.max(0,Math.min(o.length,e)),[e,Math.max(e,Math.min(o.length,l))]}function findClusterBreak(o,e,l=!0,d=!0){return findClusterBreak$1(o,e,l,d)}function surrogateLow(o){return o>=56320&&o<57344}function surrogateHigh(o){return o>=55296&&o<56320}function codePointAt(o,e){let l=o.charCodeAt(e);if(!surrogateHigh(l)||e+1==o.length)return l;let d=o.charCodeAt(e+1);return surrogateLow(d)?(l-55296<<10)+(d-56320)+65536:l}function fromCodePoint(o){return o<=65535?String.fromCharCode(o):(o-=65536,String.fromCharCode((o>>10)+55296,(o&1023)+56320))}function codePointSize(o){return o<65536?1:2}const DefaultSplit=/\r\n?|\n/;var MapMode=function(o){return o[o.Simple=0]="Simple",o[o.TrackDel=1]="TrackDel",o[o.TrackBefore=2]="TrackBefore",o[o.TrackAfter=3]="TrackAfter",o}(MapMode||(MapMode={}));class ChangeDesc{constructor(e){this.sections=e}get length(){let e=0;for(let l=0;l<this.sections.length;l+=2)e+=this.sections[l];return e}get newLength(){let e=0;for(let l=0;l<this.sections.length;l+=2){let d=this.sections[l+1];e+=d<0?this.sections[l]:d}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let l=0,d=0,p=0;l<this.sections.length;){let b=this.sections[l++],R=this.sections[l++];R<0?(e(d,p,b),p+=b):p+=R,d+=b}}iterChangedRanges(e,l=!1){iterChanges(this,e,l)}get invertedDesc(){let e=[];for(let l=0;l<this.sections.length;){let d=this.sections[l++],p=this.sections[l++];p<0?e.push(d,p):e.push(p,d)}return new ChangeDesc(e)}composeDesc(e){return this.empty?e:e.empty?this:composeSets(this,e)}mapDesc(e,l=!1){return e.empty?this:mapSet(this,e,l)}mapPos(e,l=-1,d=MapMode.Simple){let p=0,b=0;for(let R=0;R<this.sections.length;){let I=this.sections[R++],z=this.sections[R++],se=p+I;if(z<0){if(se>e)return b+(e-p);b+=I}else{if(d!=MapMode.Simple&&se>=e&&(d==MapMode.TrackDel&&p<e&&se>e||d==MapMode.TrackBefore&&p<e||d==MapMode.TrackAfter&&se>e))return null;if(se>e||se==e&&l<0&&!I)return e==p||l<0?b:b+z;b+=z}p=se}if(e>p)throw new RangeError(`Position ${e} is out of range for changeset of length ${p}`);return b}touchesRange(e,l=e){for(let d=0,p=0;d<this.sections.length&&p<=l;){let b=this.sections[d++],R=this.sections[d++],I=p+b;if(R>=0&&p<=l&&I>=e)return p<e&&I>l?"cover":!0;p=I}return!1}toString(){let e="";for(let l=0;l<this.sections.length;){let d=this.sections[l++],p=this.sections[l++];e+=(e?" ":"")+d+(p>=0?":"+p:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(l=>typeof l!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new ChangeDesc(e)}static create(e){return new ChangeDesc(e)}}class ChangeSet extends ChangeDesc{constructor(e,l){super(e),this.inserted=l}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return iterChanges(this,(l,d,p,b,R)=>e=e.replace(p,p+(d-l),R),!1),e}mapDesc(e,l=!1){return mapSet(this,e,l,!0)}invert(e){let l=this.sections.slice(),d=[];for(let p=0,b=0;p<l.length;p+=2){let R=l[p],I=l[p+1];if(I>=0){l[p]=I,l[p+1]=R;let z=p>>1;for(;d.length<z;)d.push(Text$1.empty);d.push(R?e.slice(b,b+R):Text$1.empty)}b+=R}return new ChangeSet(l,d)}compose(e){return this.empty?e:e.empty?this:composeSets(this,e,!0)}map(e,l=!1){return e.empty?this:mapSet(this,e,l,!0)}iterChanges(e,l=!1){iterChanges(this,e,l)}get desc(){return ChangeDesc.create(this.sections)}filter(e){let l=[],d=[],p=[],b=new SectionIter(this);e:for(let R=0,I=0;;){let z=R==e.length?1e9:e[R++];for(;I<z||I==z&&b.len==0;){if(b.done)break e;let le=Math.min(b.len,z-I);addSection(p,le,-1);let tn=b.ins==-1?-1:b.off==0?b.ins:0;addSection(l,le,tn),tn>0&&addInsert(d,l,b.text),b.forward(le),I+=le}let se=e[R++];for(;I<se;){if(b.done)break e;let le=Math.min(b.len,se-I);addSection(l,le,-1),addSection(p,le,b.ins==-1?-1:b.off==0?b.ins:0),b.forward(le),I+=le}}return{changes:new ChangeSet(l,d),filtered:ChangeDesc.create(p)}}toJSON(){let e=[];for(let l=0;l<this.sections.length;l+=2){let d=this.sections[l],p=this.sections[l+1];p<0?e.push(d):p==0?e.push([d]):e.push([d].concat(this.inserted[l>>1].toJSON()))}return e}static of(e,l,d){let p=[],b=[],R=0,I=null;function z(le=!1){if(!le&&!p.length)return;R<l&&addSection(p,l-R,-1);let tn=new ChangeSet(p,b);I=I?I.compose(tn.map(I)):tn,p=[],b=[],R=0}function se(le){if(Array.isArray(le))for(let tn of le)se(tn);else if(le instanceof ChangeSet){if(le.length!=l)throw new RangeError(`Mismatched change set length (got ${le.length}, expected ${l})`);z(),I=I?I.compose(le.map(I)):le}else{let{from:tn,to:an=tn,insert:sn}=le;if(tn>an||tn<0||an>l)throw new RangeError(`Invalid change range ${tn} to ${an} (in doc of length ${l})`);let ln=sn?typeof sn=="string"?Text$1.of(sn.split(d||DefaultSplit)):sn:Text$1.empty,un=ln.length;if(tn==an&&un==0)return;tn<R&&z(),tn>R&&addSection(p,tn-R,-1),addSection(p,an-tn,un),addInsert(b,p,ln),R=an}}return se(e),z(!I),I}static empty(e){return new ChangeSet(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let l=[],d=[];for(let p=0;p<e.length;p++){let b=e[p];if(typeof b=="number")l.push(b,-1);else{if(!Array.isArray(b)||typeof b[0]!="number"||b.some((R,I)=>I&&typeof R!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(b.length==1)l.push(b[0],0);else{for(;d.length<p;)d.push(Text$1.empty);d[p]=Text$1.of(b.slice(1)),l.push(b[0],d[p].length)}}}return new ChangeSet(l,d)}static createSet(e,l){return new ChangeSet(e,l)}}function addSection(o,e,l,d=!1){if(e==0&&l<=0)return;let p=o.length-2;p>=0&&l<=0&&l==o[p+1]?o[p]+=e:p>=0&&e==0&&o[p]==0?o[p+1]+=l:d?(o[p]+=e,o[p+1]+=l):o.push(e,l)}function addInsert(o,e,l){if(l.length==0)return;let d=e.length-2>>1;if(d<o.length)o[o.length-1]=o[o.length-1].append(l);else{for(;o.length<d;)o.push(Text$1.empty);o.push(l)}}function iterChanges(o,e,l){let d=o.inserted;for(let p=0,b=0,R=0;R<o.sections.length;){let I=o.sections[R++],z=o.sections[R++];if(z<0)p+=I,b+=I;else{let se=p,le=b,tn=Text$1.empty;for(;se+=I,le+=z,z&&d&&(tn=tn.append(d[R-2>>1])),!(l||R==o.sections.length||o.sections[R+1]<0);)I=o.sections[R++],z=o.sections[R++];e(p,se,b,le,tn),p=se,b=le}}}function mapSet(o,e,l,d=!1){let p=[],b=d?[]:null,R=new SectionIter(o),I=new SectionIter(e);for(let z=-1;;){if(R.done&&I.len||I.done&&R.len)throw new Error("Mismatched change set lengths");if(R.ins==-1&&I.ins==-1){let se=Math.min(R.len,I.len);addSection(p,se,-1),R.forward(se),I.forward(se)}else if(I.ins>=0&&(R.ins<0||z==R.i||R.off==0&&(I.len<R.len||I.len==R.len&&!l))){let se=I.len;for(addSection(p,I.ins,-1);se;){let le=Math.min(R.len,se);R.ins>=0&&z<R.i&&R.len<=le&&(addSection(p,0,R.ins),b&&addInsert(b,p,R.text),z=R.i),R.forward(le),se-=le}I.next()}else if(R.ins>=0){let se=0,le=R.len;for(;le;)if(I.ins==-1){let tn=Math.min(le,I.len);se+=tn,le-=tn,I.forward(tn)}else if(I.ins==0&&I.len<le)le-=I.len,I.next();else break;addSection(p,se,z<R.i?R.ins:0),b&&z<R.i&&addInsert(b,p,R.text),z=R.i,R.forward(R.len-le)}else{if(R.done&&I.done)return b?ChangeSet.createSet(p,b):ChangeDesc.create(p);throw new Error("Mismatched change set lengths")}}}function composeSets(o,e,l=!1){let d=[],p=l?[]:null,b=new SectionIter(o),R=new SectionIter(e);for(let I=!1;;){if(b.done&&R.done)return p?ChangeSet.createSet(d,p):ChangeDesc.create(d);if(b.ins==0)addSection(d,b.len,0,I),b.next();else if(R.len==0&&!R.done)addSection(d,0,R.ins,I),p&&addInsert(p,d,R.text),R.next();else{if(b.done||R.done)throw new Error("Mismatched change set lengths");{let z=Math.min(b.len2,R.len),se=d.length;if(b.ins==-1){let le=R.ins==-1?-1:R.off?0:R.ins;addSection(d,z,le,I),p&&le&&addInsert(p,d,R.text)}else R.ins==-1?(addSection(d,b.off?0:b.len,z,I),p&&addInsert(p,d,b.textBit(z))):(addSection(d,b.off?0:b.len,R.off?0:R.ins,I),p&&!R.off&&addInsert(p,d,R.text));I=(b.ins>z||R.ins>=0&&R.len>z)&&(I||d.length>se),b.forward2(z),R.forward(z)}}}}class SectionIter{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,l=this.i-2>>1;return l>=e.length?Text$1.empty:e[l]}textBit(e){let{inserted:l}=this.set,d=this.i-2>>1;return d>=l.length&&!e?Text$1.empty:l[d].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class SelectionRange{constructor(e,l,d){this.from=e,this.to=l,this.flags=d}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,l=-1){let d,p;return this.empty?d=p=e.mapPos(this.from,l):(d=e.mapPos(this.from,1),p=e.mapPos(this.to,-1)),d==this.from&&p==this.to?this:new SelectionRange(d,p,this.flags)}extend(e,l=e){if(e<=this.anchor&&l>=this.anchor)return EditorSelection.range(e,l);let d=Math.abs(e-this.anchor)>Math.abs(l-this.anchor)?e:l;return EditorSelection.range(this.anchor,d)}eq(e,l=!1){return this.anchor==e.anchor&&this.head==e.head&&(!l||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return EditorSelection.range(e.anchor,e.head)}static create(e,l,d){return new SelectionRange(e,l,d)}}class EditorSelection{constructor(e,l){this.ranges=e,this.mainIndex=l}map(e,l=-1){return e.empty?this:EditorSelection.create(this.ranges.map(d=>d.map(e,l)),this.mainIndex)}eq(e,l=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let d=0;d<this.ranges.length;d++)if(!this.ranges[d].eq(e.ranges[d],l))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new EditorSelection([this.main],0)}addRange(e,l=!0){return EditorSelection.create([e].concat(this.ranges),l?0:this.mainIndex+1)}replaceRange(e,l=this.mainIndex){let d=this.ranges.slice();return d[l]=e,EditorSelection.create(d,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new EditorSelection(e.ranges.map(l=>SelectionRange.fromJSON(l)),e.main)}static single(e,l=e){return new EditorSelection([EditorSelection.range(e,l)],0)}static create(e,l=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let d=0,p=0;p<e.length;p++){let b=e[p];if(b.empty?b.from<=d:b.from<d)return EditorSelection.normalized(e.slice(),l);d=b.to}return new EditorSelection(e,l)}static cursor(e,l=0,d,p){return SelectionRange.create(e,e,(l==0?0:l<0?8:16)|(d==null?7:Math.min(6,d))|(p??16777215)<<6)}static range(e,l,d,p){let b=(d??16777215)<<6|(p==null?7:Math.min(6,p));return l<e?SelectionRange.create(l,e,48|b):SelectionRange.create(e,l,(l>e?8:0)|b)}static normalized(e,l=0){let d=e[l];e.sort((p,b)=>p.from-b.from),l=e.indexOf(d);for(let p=1;p<e.length;p++){let b=e[p],R=e[p-1];if(b.empty?b.from<=R.to:b.from<R.to){let I=R.from,z=Math.max(b.to,R.to);p<=l&&l--,e.splice(--p,2,b.anchor>b.head?EditorSelection.range(z,I):EditorSelection.range(I,z))}}return new EditorSelection(e,l)}}function checkSelection(o,e){for(let l of o.ranges)if(l.to>e)throw new RangeError("Selection points outside of document")}let nextID=0;class Facet{constructor(e,l,d,p,b){this.combine=e,this.compareInput=l,this.compare=d,this.isStatic=p,this.id=nextID++,this.default=e([]),this.extensions=typeof b=="function"?b(this):b}get reader(){return this}static define(e={}){return new Facet(e.combine||(l=>l),e.compareInput||((l,d)=>l===d),e.compare||(e.combine?(l,d)=>l===d:sameArray$1),!!e.static,e.enables)}of(e){return new FacetProvider([],this,0,e)}compute(e,l){if(this.isStatic)throw new Error("Can't compute a static facet");return new FacetProvider(e,this,1,l)}computeN(e,l){if(this.isStatic)throw new Error("Can't compute a static facet");return new FacetProvider(e,this,2,l)}from(e,l){return l||(l=d=>d),this.compute([e],d=>l(d.field(e)))}}function sameArray$1(o,e){return o==e||o.length==e.length&&o.every((l,d)=>l===e[d])}class FacetProvider{constructor(e,l,d,p){this.dependencies=e,this.facet=l,this.type=d,this.value=p,this.id=nextID++}dynamicSlot(e){var l;let d=this.value,p=this.facet.compareInput,b=this.id,R=e[b]>>1,I=this.type==2,z=!1,se=!1,le=[];for(let tn of this.dependencies)tn=="doc"?z=!0:tn=="selection"?se=!0:((l=e[tn.id])!==null&&l!==void 0?l:1)&1||le.push(e[tn.id]);return{create(tn){return tn.values[R]=d(tn),1},update(tn,an){if(z&&an.docChanged||se&&(an.docChanged||an.selection)||ensureAll(tn,le)){let sn=d(tn);if(I?!compareArray(sn,tn.values[R],p):!p(sn,tn.values[R]))return tn.values[R]=sn,1}return 0},reconfigure:(tn,an)=>{let sn,ln=an.config.address[b];if(ln!=null){let un=getAddr(an,ln);if(this.dependencies.every(pn=>pn instanceof Facet?an.facet(pn)===tn.facet(pn):pn instanceof StateField?an.field(pn,!1)==tn.field(pn,!1):!0)||(I?compareArray(sn=d(tn),un,p):p(sn=d(tn),un)))return tn.values[R]=un,0}else sn=d(tn);return tn.values[R]=sn,1}}}}function compareArray(o,e,l){if(o.length!=e.length)return!1;for(let d=0;d<o.length;d++)if(!l(o[d],e[d]))return!1;return!0}function ensureAll(o,e){let l=!1;for(let d of e)ensureAddr(o,d)&1&&(l=!0);return l}function dynamicFacetSlot(o,e,l){let d=l.map(z=>o[z.id]),p=l.map(z=>z.type),b=d.filter(z=>!(z&1)),R=o[e.id]>>1;function I(z){let se=[];for(let le=0;le<d.length;le++){let tn=getAddr(z,d[le]);if(p[le]==2)for(let an of tn)se.push(an);else se.push(tn)}return e.combine(se)}return{create(z){for(let se of d)ensureAddr(z,se);return z.values[R]=I(z),1},update(z,se){if(!ensureAll(z,b))return 0;let le=I(z);return e.compare(le,z.values[R])?0:(z.values[R]=le,1)},reconfigure(z,se){let le=ensureAll(z,d),tn=se.config.facets[e.id],an=se.facet(e);if(tn&&!le&&sameArray$1(l,tn))return z.values[R]=an,0;let sn=I(z);return e.compare(sn,an)?(z.values[R]=an,0):(z.values[R]=sn,1)}}}const initField=Facet.define({static:!0});class StateField{constructor(e,l,d,p,b){this.id=e,this.createF=l,this.updateF=d,this.compareF=p,this.spec=b,this.provides=void 0}static define(e){let l=new StateField(nextID++,e.create,e.update,e.compare||((d,p)=>d===p),e);return e.provide&&(l.provides=e.provide(l)),l}create(e){let l=e.facet(initField).find(d=>d.field==this);return(l?.create||this.createF)(e)}slot(e){let l=e[this.id]>>1;return{create:d=>(d.values[l]=this.create(d),1),update:(d,p)=>{let b=d.values[l],R=this.updateF(b,p);return this.compareF(b,R)?0:(d.values[l]=R,1)},reconfigure:(d,p)=>p.config.address[this.id]!=null?(d.values[l]=p.field(this),0):(d.values[l]=this.create(d),1)}}init(e){return[this,initField.of({field:this,create:e})]}get extension(){return this}}const Prec_={lowest:4,low:3,default:2,high:1,highest:0};function prec(o){return e=>new PrecExtension(e,o)}const Prec={highest:prec(Prec_.highest),high:prec(Prec_.high),default:prec(Prec_.default),low:prec(Prec_.low),lowest:prec(Prec_.lowest)};class PrecExtension{constructor(e,l){this.inner=e,this.prec=l}}class Compartment{of(e){return new CompartmentInstance(this,e)}reconfigure(e){return Compartment.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class CompartmentInstance{constructor(e,l){this.compartment=e,this.inner=l}}class Configuration{constructor(e,l,d,p,b,R){for(this.base=e,this.compartments=l,this.dynamicSlots=d,this.address=p,this.staticValues=b,this.facets=R,this.statusTemplate=[];this.statusTemplate.length<d.length;)this.statusTemplate.push(0)}staticFacet(e){let l=this.address[e.id];return l==null?e.default:this.staticValues[l>>1]}static resolve(e,l,d){let p=[],b=Object.create(null),R=new Map;for(let an of flatten(e,l,R))an instanceof StateField?p.push(an):(b[an.facet.id]||(b[an.facet.id]=[])).push(an);let I=Object.create(null),z=[],se=[];for(let an of p)I[an.id]=se.length<<1,se.push(sn=>an.slot(sn));let le=d?.config.facets;for(let an in b){let sn=b[an],ln=sn[0].facet,un=le&&le[an]||[];if(sn.every(pn=>pn.type==0))if(I[ln.id]=z.length<<1|1,sameArray$1(un,sn))z.push(d.facet(ln));else{let pn=ln.combine(sn.map(yn=>yn.value));z.push(d&&ln.compare(pn,d.facet(ln))?d.facet(ln):pn)}else{for(let pn of sn)pn.type==0?(I[pn.id]=z.length<<1|1,z.push(pn.value)):(I[pn.id]=se.length<<1,se.push(yn=>pn.dynamicSlot(yn)));I[ln.id]=se.length<<1,se.push(pn=>dynamicFacetSlot(pn,ln,sn))}}let tn=se.map(an=>an(I));return new Configuration(e,R,tn,I,z,b)}}function flatten(o,e,l){let d=[[],[],[],[],[]],p=new Map;function b(R,I){let z=p.get(R);if(z!=null){if(z<=I)return;let se=d[z].indexOf(R);se>-1&&d[z].splice(se,1),R instanceof CompartmentInstance&&l.delete(R.compartment)}if(p.set(R,I),Array.isArray(R))for(let se of R)b(se,I);else if(R instanceof CompartmentInstance){if(l.has(R.compartment))throw new RangeError("Duplicate use of compartment in extensions");let se=e.get(R.compartment)||R.inner;l.set(R.compartment,se),b(se,I)}else if(R instanceof PrecExtension)b(R.inner,R.prec);else if(R instanceof StateField)d[I].push(R),R.provides&&b(R.provides,I);else if(R instanceof FacetProvider)d[I].push(R),R.facet.extensions&&b(R.facet.extensions,Prec_.default);else{let se=R.extension;if(!se)throw new Error(`Unrecognized extension value in extension set (${R}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);b(se,I)}}return b(o,Prec_.default),d.reduce((R,I)=>R.concat(I))}function ensureAddr(o,e){if(e&1)return 2;let l=e>>1,d=o.status[l];if(d==4)throw new Error("Cyclic dependency between fields and/or facets");if(d&2)return d;o.status[l]=4;let p=o.computeSlot(o,o.config.dynamicSlots[l]);return o.status[l]=2|p}function getAddr(o,e){return e&1?o.config.staticValues[e>>1]:o.values[e>>1]}const languageData=Facet.define(),allowMultipleSelections=Facet.define({combine:o=>o.some(e=>e),static:!0}),lineSeparator=Facet.define({combine:o=>o.length?o[0]:void 0,static:!0}),changeFilter=Facet.define(),transactionFilter=Facet.define(),transactionExtender=Facet.define(),readOnly=Facet.define({combine:o=>o.length?o[0]:!1});class Annotation{constructor(e,l){this.type=e,this.value=l}static define(){return new AnnotationType}}class AnnotationType{of(e){return new Annotation(this,e)}}class StateEffectType{constructor(e){this.map=e}of(e){return new StateEffect(this,e)}}class StateEffect{constructor(e,l){this.type=e,this.value=l}map(e){let l=this.type.map(this.value,e);return l===void 0?void 0:l==this.value?this:new StateEffect(this.type,l)}is(e){return this.type==e}static define(e={}){return new StateEffectType(e.map||(l=>l))}static mapEffects(e,l){if(!e.length)return e;let d=[];for(let p of e){let b=p.map(l);b&&d.push(b)}return d}}StateEffect.reconfigure=StateEffect.define(),StateEffect.appendConfig=StateEffect.define();class Transaction{constructor(e,l,d,p,b,R){this.startState=e,this.changes=l,this.selection=d,this.effects=p,this.annotations=b,this.scrollIntoView=R,this._doc=null,this._state=null,d&&checkSelection(d,l.newLength),b.some(I=>I.type==Transaction.time)||(this.annotations=b.concat(Transaction.time.of(Date.now())))}static create(e,l,d,p,b,R){return new Transaction(e,l,d,p,b,R)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let l of this.annotations)if(l.type==e)return l.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let l=this.annotation(Transaction.userEvent);return!!(l&&(l==e||l.length>e.length&&l.slice(0,e.length)==e&&l[e.length]=="."))}}Transaction.time=Annotation.define(),Transaction.userEvent=Annotation.define(),Transaction.addToHistory=Annotation.define(),Transaction.remote=Annotation.define();function joinRanges(o,e){let l=[];for(let d=0,p=0;;){let b,R;if(d<o.length&&(p==e.length||e[p]>=o[d]))b=o[d++],R=o[d++];else if(p<e.length)b=e[p++],R=e[p++];else return l;!l.length||l[l.length-1]<b?l.push(b,R):l[l.length-1]<R&&(l[l.length-1]=R)}}function mergeTransaction(o,e,l){var d;let p,b,R;return l?(p=e.changes,b=ChangeSet.empty(e.changes.length),R=o.changes.compose(e.changes)):(p=e.changes.map(o.changes),b=o.changes.mapDesc(e.changes,!0),R=o.changes.compose(p)),{changes:R,selection:e.selection?e.selection.map(b):(d=o.selection)===null||d===void 0?void 0:d.map(p),effects:StateEffect.mapEffects(o.effects,p).concat(StateEffect.mapEffects(e.effects,b)),annotations:o.annotations.length?o.annotations.concat(e.annotations):e.annotations,scrollIntoView:o.scrollIntoView||e.scrollIntoView}}function resolveTransactionInner(o,e,l){let d=e.selection,p=asArray$1(e.annotations);return e.userEvent&&(p=p.concat(Transaction.userEvent.of(e.userEvent))),{changes:e.changes instanceof ChangeSet?e.changes:ChangeSet.of(e.changes||[],l,o.facet(lineSeparator)),selection:d&&(d instanceof EditorSelection?d:EditorSelection.single(d.anchor,d.head)),effects:asArray$1(e.effects),annotations:p,scrollIntoView:!!e.scrollIntoView}}function resolveTransaction(o,e,l){let d=resolveTransactionInner(o,e.length?e[0]:{},o.doc.length);e.length&&e[0].filter===!1&&(l=!1);for(let b=1;b<e.length;b++){e[b].filter===!1&&(l=!1);let R=!!e[b].sequential;d=mergeTransaction(d,resolveTransactionInner(o,e[b],R?d.changes.newLength:o.doc.length),R)}let p=Transaction.create(o,d.changes,d.selection,d.effects,d.annotations,d.scrollIntoView);return extendTransaction(l?filterTransaction(p):p)}function filterTransaction(o){let e=o.startState,l=!0;for(let p of e.facet(changeFilter)){let b=p(o);if(b===!1){l=!1;break}Array.isArray(b)&&(l=l===!0?b:joinRanges(l,b))}if(l!==!0){let p,b;if(l===!1)b=o.changes.invertedDesc,p=ChangeSet.empty(e.doc.length);else{let R=o.changes.filter(l);p=R.changes,b=R.filtered.mapDesc(R.changes).invertedDesc}o=Transaction.create(e,p,o.selection&&o.selection.map(b),StateEffect.mapEffects(o.effects,b),o.annotations,o.scrollIntoView)}let d=e.facet(transactionFilter);for(let p=d.length-1;p>=0;p--){let b=d[p](o);b instanceof Transaction?o=b:Array.isArray(b)&&b.length==1&&b[0]instanceof Transaction?o=b[0]:o=resolveTransaction(e,asArray$1(b),!1)}return o}function extendTransaction(o){let e=o.startState,l=e.facet(transactionExtender),d=o;for(let p=l.length-1;p>=0;p--){let b=l[p](o);b&&Object.keys(b).length&&(d=mergeTransaction(d,resolveTransactionInner(e,b,o.changes.newLength),!0))}return d==o?o:Transaction.create(e,o.changes,o.selection,d.effects,d.annotations,d.scrollIntoView)}const none$2=[];function asArray$1(o){return o==null?none$2:Array.isArray(o)?o:[o]}var CharCategory=function(o){return o[o.Word=0]="Word",o[o.Space=1]="Space",o[o.Other=2]="Other",o}(CharCategory||(CharCategory={}));const nonASCIISingleCaseWordChar=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let wordChar$1;try{wordChar$1=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(o){}function hasWordChar(o){if(wordChar$1)return wordChar$1.test(o);for(let e=0;e<o.length;e++){let l=o[e];if(/\w/.test(l)||l>""&&(l.toUpperCase()!=l.toLowerCase()||nonASCIISingleCaseWordChar.test(l)))return!0}return!1}function makeCategorizer(o){return e=>{if(!/\S/.test(e))return CharCategory.Space;if(hasWordChar(e))return CharCategory.Word;for(let l=0;l<o.length;l++)if(e.indexOf(o[l])>-1)return CharCategory.Word;return CharCategory.Other}}class EditorState{constructor(e,l,d,p,b,R){this.config=e,this.doc=l,this.selection=d,this.values=p,this.status=e.statusTemplate.slice(),this.computeSlot=b,R&&(R._state=this);for(let I=0;I<this.config.dynamicSlots.length;I++)ensureAddr(this,I<<1);this.computeSlot=null}field(e,l=!0){let d=this.config.address[e.id];if(d==null){if(l)throw new RangeError("Field is not present in this state");return}return ensureAddr(this,d),getAddr(this,d)}update(...e){return resolveTransaction(this,e,!0)}applyTransaction(e){let l=this.config,{base:d,compartments:p}=l;for(let I of e.effects)I.is(Compartment.reconfigure)?(l&&(p=new Map,l.compartments.forEach((z,se)=>p.set(se,z)),l=null),p.set(I.value.compartment,I.value.extension)):I.is(StateEffect.reconfigure)?(l=null,d=I.value):I.is(StateEffect.appendConfig)&&(l=null,d=asArray$1(d).concat(I.value));let b;l?b=e.startState.values.slice():(l=Configuration.resolve(d,p,this),b=new EditorState(l,this.doc,this.selection,l.dynamicSlots.map(()=>null),(z,se)=>se.reconfigure(z,this),null).values);let R=e.startState.facet(allowMultipleSelections)?e.newSelection:e.newSelection.asSingle();new EditorState(l,e.newDoc,R,b,(I,z)=>z.update(I,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(l=>({changes:{from:l.from,to:l.to,insert:e},range:EditorSelection.cursor(l.from+e.length)}))}changeByRange(e){let l=this.selection,d=e(l.ranges[0]),p=this.changes(d.changes),b=[d.range],R=asArray$1(d.effects);for(let I=1;I<l.ranges.length;I++){let z=e(l.ranges[I]),se=this.changes(z.changes),le=se.map(p);for(let an=0;an<I;an++)b[an]=b[an].map(le);let tn=p.mapDesc(se,!0);b.push(z.range.map(tn)),p=p.compose(le),R=StateEffect.mapEffects(R,le).concat(StateEffect.mapEffects(asArray$1(z.effects),tn))}return{changes:p,selection:EditorSelection.create(b,l.mainIndex),effects:R}}changes(e=[]){return e instanceof ChangeSet?e:ChangeSet.of(e,this.doc.length,this.facet(EditorState.lineSeparator))}toText(e){return Text$1.of(e.split(this.facet(EditorState.lineSeparator)||DefaultSplit))}sliceDoc(e=0,l=this.doc.length){return this.doc.sliceString(e,l,this.lineBreak)}facet(e){let l=this.config.address[e.id];return l==null?e.default:(ensureAddr(this,l),getAddr(this,l))}toJSON(e){let l={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let d in e){let p=e[d];p instanceof StateField&&this.config.address[p.id]!=null&&(l[d]=p.spec.toJSON(this.field(e[d]),this))}return l}static fromJSON(e,l={},d){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let p=[];if(d){for(let b in d)if(Object.prototype.hasOwnProperty.call(e,b)){let R=d[b],I=e[b];p.push(R.init(z=>R.spec.fromJSON(I,z)))}}return EditorState.create({doc:e.doc,selection:EditorSelection.fromJSON(e.selection),extensions:l.extensions?p.concat([l.extensions]):p})}static create(e={}){let l=Configuration.resolve(e.extensions||[],new Map),d=e.doc instanceof Text$1?e.doc:Text$1.of((e.doc||"").split(l.staticFacet(EditorState.lineSeparator)||DefaultSplit)),p=e.selection?e.selection instanceof EditorSelection?e.selection:EditorSelection.single(e.selection.anchor,e.selection.head):EditorSelection.single(0);return checkSelection(p,d.length),l.staticFacet(allowMultipleSelections)||(p=p.asSingle()),new EditorState(l,d,p,l.dynamicSlots.map(()=>null),(b,R)=>R.create(b),null)}get tabSize(){return this.facet(EditorState.tabSize)}get lineBreak(){return this.facet(EditorState.lineSeparator)||`
|
||
`}get readOnly(){return this.facet(readOnly)}phrase(e,...l){for(let d of this.facet(EditorState.phrases))if(Object.prototype.hasOwnProperty.call(d,e)){e=d[e];break}return l.length&&(e=e.replace(/\$(\$|\d*)/g,(d,p)=>{if(p=="$")return"$";let b=+(p||1);return!b||b>l.length?d:l[b-1]})),e}languageDataAt(e,l,d=-1){let p=[];for(let b of this.facet(languageData))for(let R of b(this,l,d))Object.prototype.hasOwnProperty.call(R,e)&&p.push(R[e]);return p}charCategorizer(e){return makeCategorizer(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:l,from:d,length:p}=this.doc.lineAt(e),b=this.charCategorizer(e),R=e-d,I=e-d;for(;R>0;){let z=findClusterBreak(l,R,!1);if(b(l.slice(z,R))!=CharCategory.Word)break;R=z}for(;I<p;){let z=findClusterBreak(l,I);if(b(l.slice(I,z))!=CharCategory.Word)break;I=z}return R==I?null:EditorSelection.range(R+d,I+d)}}EditorState.allowMultipleSelections=allowMultipleSelections,EditorState.tabSize=Facet.define({combine:o=>o.length?o[0]:4}),EditorState.lineSeparator=lineSeparator,EditorState.readOnly=readOnly,EditorState.phrases=Facet.define({compare(o,e){let l=Object.keys(o),d=Object.keys(e);return l.length==d.length&&l.every(p=>o[p]==e[p])}}),EditorState.languageData=languageData,EditorState.changeFilter=changeFilter,EditorState.transactionFilter=transactionFilter,EditorState.transactionExtender=transactionExtender,Compartment.reconfigure=StateEffect.define();function combineConfig(o,e,l={}){let d={};for(let p of o)for(let b of Object.keys(p)){let R=p[b],I=d[b];if(I===void 0)d[b]=R;else if(!(I===R||R===void 0))if(Object.hasOwnProperty.call(l,b))d[b]=l[b](I,R);else throw new Error("Config merge conflict for field "+b)}for(let p in e)d[p]===void 0&&(d[p]=e[p]);return d}class RangeValue{eq(e){return this==e}range(e,l=e){return Range$1.create(e,l,this)}}RangeValue.prototype.startSide=RangeValue.prototype.endSide=0,RangeValue.prototype.point=!1,RangeValue.prototype.mapMode=MapMode.TrackDel;let Range$1=class Hr{constructor(e,l,d){this.from=e,this.to=l,this.value=d}static create(e,l,d){return new Hr(e,l,d)}};function cmpRange(o,e){return o.from-e.from||o.value.startSide-e.value.startSide}class Chunk{constructor(e,l,d,p){this.from=e,this.to=l,this.value=d,this.maxPoint=p}get length(){return this.to[this.to.length-1]}findIndex(e,l,d,p=0){let b=d?this.to:this.from;for(let R=p,I=b.length;;){if(R==I)return R;let z=R+I>>1,se=b[z]-e||(d?this.value[z].endSide:this.value[z].startSide)-l;if(z==R)return se>=0?R:I;se>=0?I=z:R=z+1}}between(e,l,d,p){for(let b=this.findIndex(l,-1e9,!0),R=this.findIndex(d,1e9,!1,b);b<R;b++)if(p(this.from[b]+e,this.to[b]+e,this.value[b])===!1)return!1}map(e,l){let d=[],p=[],b=[],R=-1,I=-1;for(let z=0;z<this.value.length;z++){let se=this.value[z],le=this.from[z]+e,tn=this.to[z]+e,an,sn;if(le==tn){let ln=l.mapPos(le,se.startSide,se.mapMode);if(ln==null||(an=sn=ln,se.startSide!=se.endSide&&(sn=l.mapPos(le,se.endSide),sn<an)))continue}else if(an=l.mapPos(le,se.startSide),sn=l.mapPos(tn,se.endSide),an>sn||an==sn&&se.startSide>0&&se.endSide<=0)continue;(sn-an||se.endSide-se.startSide)<0||(R<0&&(R=an),se.point&&(I=Math.max(I,sn-an)),d.push(se),p.push(an-R),b.push(sn-R))}return{mapped:d.length?new Chunk(p,b,d,I):null,pos:R}}}class RangeSet{constructor(e,l,d,p){this.chunkPos=e,this.chunk=l,this.nextLayer=d,this.maxPoint=p}static create(e,l,d,p){return new RangeSet(e,l,d,p)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let l of this.chunk)e+=l.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:l=[],sort:d=!1,filterFrom:p=0,filterTo:b=this.length}=e,R=e.filter;if(l.length==0&&!R)return this;if(d&&(l=l.slice().sort(cmpRange)),this.isEmpty)return l.length?RangeSet.of(l):this;let I=new LayerCursor(this,null,-1).goto(0),z=0,se=[],le=new RangeSetBuilder;for(;I.value||z<l.length;)if(z<l.length&&(I.from-l[z].from||I.startSide-l[z].value.startSide)>=0){let tn=l[z++];le.addInner(tn.from,tn.to,tn.value)||se.push(tn)}else I.rangeIndex==1&&I.chunkIndex<this.chunk.length&&(z==l.length||this.chunkEnd(I.chunkIndex)<l[z].from)&&(!R||p>this.chunkEnd(I.chunkIndex)||b<this.chunkPos[I.chunkIndex])&&le.addChunk(this.chunkPos[I.chunkIndex],this.chunk[I.chunkIndex])?I.nextChunk():((!R||p>I.to||b<I.from||R(I.from,I.to,I.value))&&(le.addInner(I.from,I.to,I.value)||se.push(Range$1.create(I.from,I.to,I.value))),I.next());return le.finishInner(this.nextLayer.isEmpty&&!se.length?RangeSet.empty:this.nextLayer.update({add:se,filter:R,filterFrom:p,filterTo:b}))}map(e){if(e.empty||this.isEmpty)return this;let l=[],d=[],p=-1;for(let R=0;R<this.chunk.length;R++){let I=this.chunkPos[R],z=this.chunk[R],se=e.touchesRange(I,I+z.length);if(se===!1)p=Math.max(p,z.maxPoint),l.push(z),d.push(e.mapPos(I));else if(se===!0){let{mapped:le,pos:tn}=z.map(I,e);le&&(p=Math.max(p,le.maxPoint),l.push(le),d.push(tn))}}let b=this.nextLayer.map(e);return l.length==0?b:new RangeSet(d,l,b||RangeSet.empty,p)}between(e,l,d){if(!this.isEmpty){for(let p=0;p<this.chunk.length;p++){let b=this.chunkPos[p],R=this.chunk[p];if(l>=b&&e<=b+R.length&&R.between(b,e-b,l-b,d)===!1)return}this.nextLayer.between(e,l,d)}}iter(e=0){return HeapCursor.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,l=0){return HeapCursor.from(e).goto(l)}static compare(e,l,d,p,b=-1){let R=e.filter(tn=>tn.maxPoint>0||!tn.isEmpty&&tn.maxPoint>=b),I=l.filter(tn=>tn.maxPoint>0||!tn.isEmpty&&tn.maxPoint>=b),z=findSharedChunks(R,I,d),se=new SpanCursor(R,z,b),le=new SpanCursor(I,z,b);d.iterGaps((tn,an,sn)=>compare(se,tn,le,an,sn,p)),d.empty&&d.length==0&&compare(se,0,le,0,0,p)}static eq(e,l,d=0,p){p==null&&(p=999999999);let b=e.filter(le=>!le.isEmpty&&l.indexOf(le)<0),R=l.filter(le=>!le.isEmpty&&e.indexOf(le)<0);if(b.length!=R.length)return!1;if(!b.length)return!0;let I=findSharedChunks(b,R),z=new SpanCursor(b,I,0).goto(d),se=new SpanCursor(R,I,0).goto(d);for(;;){if(z.to!=se.to||!sameValues(z.active,se.active)||z.point&&(!se.point||!z.point.eq(se.point)))return!1;if(z.to>p)return!0;z.next(),se.next()}}static spans(e,l,d,p,b=-1){let R=new SpanCursor(e,null,b).goto(l),I=l,z=R.openStart;for(;;){let se=Math.min(R.to,d);if(R.point){let le=R.activeForPoint(R.to),tn=R.pointFrom<l?le.length+1:R.point.startSide<0?le.length:Math.min(le.length,z);p.point(I,se,R.point,le,tn,R.pointRank),z=Math.min(R.openEnd(se),le.length)}else se>I&&(p.span(I,se,R.active,z),z=R.openEnd(se));if(R.to>d)return z+(R.point&&R.to>d?1:0);I=R.to,R.next()}}static of(e,l=!1){let d=new RangeSetBuilder;for(let p of e instanceof Range$1?[e]:l?lazySort(e):e)d.add(p.from,p.to,p.value);return d.finish()}static join(e){if(!e.length)return RangeSet.empty;let l=e[e.length-1];for(let d=e.length-2;d>=0;d--)for(let p=e[d];p!=RangeSet.empty;p=p.nextLayer)l=new RangeSet(p.chunkPos,p.chunk,l,Math.max(p.maxPoint,l.maxPoint));return l}}RangeSet.empty=new RangeSet([],[],null,-1);function lazySort(o){if(o.length>1)for(let e=o[0],l=1;l<o.length;l++){let d=o[l];if(cmpRange(e,d)>0)return o.slice().sort(cmpRange);e=d}return o}RangeSet.empty.nextLayer=RangeSet.empty;class RangeSetBuilder{finishChunk(e){this.chunks.push(new Chunk(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,l,d){this.addInner(e,l,d)||(this.nextLayer||(this.nextLayer=new RangeSetBuilder)).add(e,l,d)}addInner(e,l,d){let p=e-this.lastTo||d.startSide-this.last.endSide;if(p<=0&&(e-this.lastFrom||d.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return p<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(l-this.chunkStart),this.last=d,this.lastFrom=e,this.lastTo=l,this.value.push(d),d.point&&(this.maxPoint=Math.max(this.maxPoint,l-e)),!0)}addChunk(e,l){if((e-this.lastTo||l.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,l.maxPoint),this.chunks.push(l),this.chunkPos.push(e);let d=l.value.length-1;return this.last=l.value[d],this.lastFrom=l.from[d]+e,this.lastTo=l.to[d]+e,!0}finish(){return this.finishInner(RangeSet.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let l=RangeSet.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,l}}function findSharedChunks(o,e,l){let d=new Map;for(let b of o)for(let R=0;R<b.chunk.length;R++)b.chunk[R].maxPoint<=0&&d.set(b.chunk[R],b.chunkPos[R]);let p=new Set;for(let b of e)for(let R=0;R<b.chunk.length;R++){let I=d.get(b.chunk[R]);I!=null&&(l?l.mapPos(I):I)==b.chunkPos[R]&&!l?.touchesRange(I,I+b.chunk[R].length)&&p.add(b.chunk[R])}return p}class LayerCursor{constructor(e,l,d,p=0){this.layer=e,this.skip=l,this.minPoint=d,this.rank=p}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,l=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,l,!1),this}gotoInner(e,l,d){for(;this.chunkIndex<this.layer.chunk.length;){let p=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(p)||this.layer.chunkEnd(this.chunkIndex)<e||p.maxPoint<this.minPoint))break;this.chunkIndex++,d=!1}if(this.chunkIndex<this.layer.chunk.length){let p=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],l,!0);(!d||this.rangeIndex<p)&&this.setRangeIndex(p)}this.next()}forward(e,l){(this.to-e||this.endSide-l)<0&&this.gotoInner(e,l,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],l=this.layer.chunk[this.chunkIndex],d=e+l.from[this.rangeIndex];if(this.from=d,this.to=e+l.to[this.rangeIndex],this.value=l.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class HeapCursor{constructor(e){this.heap=e}static from(e,l=null,d=-1){let p=[];for(let b=0;b<e.length;b++)for(let R=e[b];!R.isEmpty;R=R.nextLayer)R.maxPoint>=d&&p.push(new LayerCursor(R,l,d,b));return p.length==1?p[0]:new HeapCursor(p)}get startSide(){return this.value?this.value.startSide:0}goto(e,l=-1e9){for(let d of this.heap)d.goto(e,l);for(let d=this.heap.length>>1;d>=0;d--)heapBubble(this.heap,d);return this.next(),this}forward(e,l){for(let d of this.heap)d.forward(e,l);for(let d=this.heap.length>>1;d>=0;d--)heapBubble(this.heap,d);(this.to-e||this.value.endSide-l)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),heapBubble(this.heap,0)}}}function heapBubble(o,e){for(let l=o[e];;){let d=(e<<1)+1;if(d>=o.length)break;let p=o[d];if(d+1<o.length&&p.compare(o[d+1])>=0&&(p=o[d+1],d++),l.compare(p)<0)break;o[d]=l,o[e]=p,e=d}}class SpanCursor{constructor(e,l,d){this.minPoint=d,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=HeapCursor.from(e,l,d)}goto(e,l=-1e9){return this.cursor.goto(e,l),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=l,this.openStart=-1,this.next(),this}forward(e,l){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-l)<0;)this.removeActive(this.minActive);this.cursor.forward(e,l)}removeActive(e){remove(this.active,e),remove(this.activeTo,e),remove(this.activeRank,e),this.minActive=findMinIndex(this.active,this.activeTo)}addActive(e){let l=0,{value:d,to:p,rank:b}=this.cursor;for(;l<this.activeRank.length&&(b-this.activeRank[l]||p-this.activeTo[l])>0;)l++;insert(this.active,l,d),insert(this.activeTo,l,p),insert(this.activeRank,l,b),e&&insert(e,l,this.cursor.from),this.minActive=findMinIndex(this.active,this.activeTo)}next(){let e=this.to,l=this.point;this.point=null;let d=this.openStart<0?[]:null;for(;;){let p=this.minActive;if(p>-1&&(this.activeTo[p]-this.cursor.from||this.active[p].endSide-this.cursor.startSide)<0){if(this.activeTo[p]>e){this.to=this.activeTo[p],this.endSide=this.active[p].endSide;break}this.removeActive(p),d&&remove(d,p)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let b=this.cursor.value;if(!b.point)this.addActive(d),this.cursor.next();else if(l&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=b,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=b.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(d){this.openStart=0;for(let p=d.length-1;p>=0&&d[p]<e;p--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let l=[];for(let d=this.active.length-1;d>=0&&!(this.activeRank[d]<this.pointRank);d--)(this.activeTo[d]>e||this.activeTo[d]==e&&this.active[d].endSide>=this.point.endSide)&&l.push(this.active[d]);return l.reverse()}openEnd(e){let l=0;for(let d=this.activeTo.length-1;d>=0&&this.activeTo[d]>e;d--)l++;return l}}function compare(o,e,l,d,p,b){o.goto(e),l.goto(d);let R=d+p,I=d,z=d-e;for(;;){let se=o.to+z-l.to,le=se||o.endSide-l.endSide,tn=le<0?o.to+z:l.to,an=Math.min(tn,R);if(o.point||l.point?o.point&&l.point&&(o.point==l.point||o.point.eq(l.point))&&sameValues(o.activeForPoint(o.to),l.activeForPoint(l.to))||b.comparePoint(I,an,o.point,l.point):an>I&&!sameValues(o.active,l.active)&&b.compareRange(I,an,o.active,l.active),tn>R)break;(se||o.openEnd!=l.openEnd)&&b.boundChange&&b.boundChange(tn),I=tn,le<=0&&o.next(),le>=0&&l.next()}}function sameValues(o,e){if(o.length!=e.length)return!1;for(let l=0;l<o.length;l++)if(o[l]!=e[l]&&!o[l].eq(e[l]))return!1;return!0}function remove(o,e){for(let l=e,d=o.length-1;l<d;l++)o[l]=o[l+1];o.pop()}function insert(o,e,l){for(let d=o.length-1;d>=e;d--)o[d+1]=o[d];o[e]=l}function findMinIndex(o,e){let l=-1,d=1e9;for(let p=0;p<e.length;p++)(e[p]-d||o[p].endSide-o[l].endSide)<0&&(l=p,d=e[p]);return l}function countColumn(o,e,l=o.length){let d=0;for(let p=0;p<l&&p<o.length;)o.charCodeAt(p)==9?(d+=e-d%e,p++):(d++,p=findClusterBreak(o,p));return d}function findColumn(o,e,l,d){for(let p=0,b=0;;){if(b>=e)return p;if(p==o.length)break;b+=o.charCodeAt(p)==9?l-b%l:1,p=findClusterBreak(o,p)}return d===!0?-1:o.length}const C$2="ͼ",COUNT=typeof Symbol>"u"?"__"+C$2:Symbol.for(C$2),SET=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),top=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class StyleModule{constructor(e,l){this.rules=[];let{finish:d}=l||{};function p(R){return/^@/.test(R)?[R]:R.split(/,\s*/)}function b(R,I,z,se){let le=[],tn=/^@(\w+)\b/.exec(R[0]),an=tn&&tn[1]=="keyframes";if(tn&&I==null)return z.push(R[0]+";");for(let sn in I){let ln=I[sn];if(/&/.test(sn))b(sn.split(/,\s*/).map(un=>R.map(pn=>un.replace(/&/,pn))).reduce((un,pn)=>un.concat(pn)),ln,z);else if(ln&&typeof ln=="object"){if(!tn)throw new RangeError("The value of a property ("+sn+") should be a primitive value.");b(p(sn),ln,le,an)}else ln!=null&&le.push(sn.replace(/_.*/,"").replace(/[A-Z]/g,un=>"-"+un.toLowerCase())+": "+ln+";")}(le.length||an)&&z.push((d&&!tn&&!se?R.map(d):R).join(", ")+" {"+le.join(" ")+"}")}for(let R in e)b(p(R),e[R],this.rules)}getRules(){return this.rules.join(`
|
||
`)}static newName(){let e=top[COUNT]||1;return top[COUNT]=e+1,C$2+e.toString(36)}static mount(e,l,d){let p=e[SET],b=d&&d.nonce;p?b&&p.setNonce(b):p=new StyleSet(e,b),p.mount(Array.isArray(l)?l:[l],e)}}let adoptedSet=new Map;class StyleSet{constructor(e,l){let d=e.ownerDocument||e,p=d.defaultView;if(!e.head&&e.adoptedStyleSheets&&p.CSSStyleSheet){let b=adoptedSet.get(d);if(b)return e[SET]=b;this.sheet=new p.CSSStyleSheet,adoptedSet.set(d,this)}else this.styleTag=d.createElement("style"),l&&this.styleTag.setAttribute("nonce",l);this.modules=[],e[SET]=this}mount(e,l){let d=this.sheet,p=0,b=0;for(let R=0;R<e.length;R++){let I=e[R],z=this.modules.indexOf(I);if(z<b&&z>-1&&(this.modules.splice(z,1),b--,z=-1),z==-1){if(this.modules.splice(b++,0,I),d)for(let se=0;se<I.rules.length;se++)d.insertRule(I.rules[se],p++)}else{for(;b<z;)p+=this.modules[b++].rules.length;p+=I.rules.length,b++}}if(d)l.adoptedStyleSheets.indexOf(this.sheet)<0&&(l.adoptedStyleSheets=[this.sheet,...l.adoptedStyleSheets]);else{let R="";for(let z=0;z<this.modules.length;z++)R+=this.modules[z].getRules()+`
|
||
`;this.styleTag.textContent=R;let I=l.head||l;this.styleTag.parentNode!=I&&I.insertBefore(this.styleTag,I.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}for(var base={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},shift={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},mac=typeof navigator<"u"&&/Mac/.test(navigator.platform),ie$2=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),i=0;i<10;i++)base[48+i]=base[96+i]=String(i);for(var i=1;i<=24;i++)base[i+111]="F"+i;for(var i=65;i<=90;i++)base[i]=String.fromCharCode(i+32),shift[i]=String.fromCharCode(i);for(var code in base)shift.hasOwnProperty(code)||(shift[code]=base[code]);function keyName(o){var e=mac&&o.metaKey&&o.shiftKey&&!o.ctrlKey&&!o.altKey||ie$2&&o.shiftKey&&o.key&&o.key.length==1||o.key=="Unidentified",l=!e&&o.key||(o.shiftKey?shift:base)[o.keyCode]||o.key||"Unidentified";return l=="Esc"&&(l="Escape"),l=="Del"&&(l="Delete"),l=="Left"&&(l="ArrowLeft"),l=="Up"&&(l="ArrowUp"),l=="Right"&&(l="ArrowRight"),l=="Down"&&(l="ArrowDown"),l}function getSelection(o){let e;return o.nodeType==11?e=o.getSelection?o:o.ownerDocument:e=o,e.getSelection()}function contains(o,e){return e?o==e||o.contains(e.nodeType!=1?e.parentNode:e):!1}function hasSelection(o,e){if(!e.anchorNode)return!1;try{return contains(o,e.anchorNode)}catch{return!1}}function clientRectsFor(o){return o.nodeType==3?textRange(o,0,o.nodeValue.length).getClientRects():o.nodeType==1?o.getClientRects():[]}function isEquivalentPosition(o,e,l,d){return l?scanFor(o,e,l,d,-1)||scanFor(o,e,l,d,1):!1}function domIndex(o){for(var e=0;;e++)if(o=o.previousSibling,!o)return e}function isBlockElement(o){return o.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(o.nodeName)}function scanFor(o,e,l,d,p){for(;;){if(o==l&&e==d)return!0;if(e==(p<0?0:maxOffset(o))){if(o.nodeName=="DIV")return!1;let b=o.parentNode;if(!b||b.nodeType!=1)return!1;e=domIndex(o)+(p<0?0:1),o=b}else if(o.nodeType==1){if(o=o.childNodes[e+(p<0?-1:0)],o.nodeType==1&&o.contentEditable=="false")return!1;e=p<0?maxOffset(o):0}else return!1}}function maxOffset(o){return o.nodeType==3?o.nodeValue.length:o.childNodes.length}function flattenRect(o,e){let l=e?o.left:o.right;return{left:l,right:l,top:o.top,bottom:o.bottom}}function windowRect(o){let e=o.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:o.innerWidth,top:0,bottom:o.innerHeight}}function getScale$1(o,e){let l=e.width/o.offsetWidth,d=e.height/o.offsetHeight;return(l>.995&&l<1.005||!isFinite(l)||Math.abs(e.width-o.offsetWidth)<1)&&(l=1),(d>.995&&d<1.005||!isFinite(d)||Math.abs(e.height-o.offsetHeight)<1)&&(d=1),{scaleX:l,scaleY:d}}function scrollRectIntoView(o,e,l,d,p,b,R,I){let z=o.ownerDocument,se=z.defaultView||window;for(let le=o,tn=!1;le&&!tn;)if(le.nodeType==1){let an,sn=le==z.body,ln=1,un=1;if(sn)an=windowRect(se);else{if(/^(fixed|sticky)$/.test(getComputedStyle(le).position)&&(tn=!0),le.scrollHeight<=le.clientHeight&&le.scrollWidth<=le.clientWidth){le=le.assignedSlot||le.parentNode;continue}let _n=le.getBoundingClientRect();({scaleX:ln,scaleY:un}=getScale$1(le,_n)),an={left:_n.left,right:_n.left+le.clientWidth*ln,top:_n.top,bottom:_n.top+le.clientHeight*un}}let pn=0,yn=0;if(p=="nearest")e.top<an.top?(yn=-(an.top-e.top+R),l>0&&e.bottom>an.bottom+yn&&(yn=e.bottom-an.bottom+yn+R)):e.bottom>an.bottom&&(yn=e.bottom-an.bottom+R,l<0&&e.top-yn<an.top&&(yn=-(an.top+yn-e.top+R)));else{let _n=e.bottom-e.top,Pn=an.bottom-an.top;yn=(p=="center"&&_n<=Pn?e.top+_n/2-Pn/2:p=="start"||p=="center"&&l<0?e.top-R:e.bottom-Pn+R)-an.top}if(d=="nearest"?e.left<an.left?(pn=-(an.left-e.left+b),l>0&&e.right>an.right+pn&&(pn=e.right-an.right+pn+b)):e.right>an.right&&(pn=e.right-an.right+b,l<0&&e.left<an.left+pn&&(pn=-(an.left+pn-e.left+b))):pn=(d=="center"?e.left+(e.right-e.left)/2-(an.right-an.left)/2:d=="start"==I?e.left-b:e.right-(an.right-an.left)+b)-an.left,pn||yn)if(sn)se.scrollBy(pn,yn);else{let _n=0,Pn=0;if(yn){let vn=le.scrollTop;le.scrollTop+=yn/un,Pn=(le.scrollTop-vn)*un}if(pn){let vn=le.scrollLeft;le.scrollLeft+=pn/ln,_n=(le.scrollLeft-vn)*ln}e={left:e.left-_n,top:e.top-Pn,right:e.right-_n,bottom:e.bottom-Pn},_n&&Math.abs(_n-pn)<1&&(d="nearest"),Pn&&Math.abs(Pn-yn)<1&&(p="nearest")}if(sn)break;le=le.assignedSlot||le.parentNode}else if(le.nodeType==11)le=le.host;else break}function scrollableParents(o){let e=o.ownerDocument,l,d;for(let p=o.parentNode;p&&!(p==e.body||l&&d);)if(p.nodeType==1)!d&&p.scrollHeight>p.clientHeight&&(d=p),!l&&p.scrollWidth>p.clientWidth&&(l=p),p=p.assignedSlot||p.parentNode;else if(p.nodeType==11)p=p.host;else break;return{x:l,y:d}}class DOMSelectionState{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:l,focusNode:d}=e;this.set(l,Math.min(e.anchorOffset,l?maxOffset(l):0),d,Math.min(e.focusOffset,d?maxOffset(d):0))}set(e,l,d,p){this.anchorNode=e,this.anchorOffset=l,this.focusNode=d,this.focusOffset=p}}let preventScrollSupported=null;function focusPreventScroll(o){if(o.setActive)return o.setActive();if(preventScrollSupported)return o.focus(preventScrollSupported);let e=[];for(let l=o;l&&(e.push(l,l.scrollTop,l.scrollLeft),l!=l.ownerDocument);l=l.parentNode);if(o.focus(preventScrollSupported==null?{get preventScroll(){return preventScrollSupported={preventScroll:!0},!0}}:void 0),!preventScrollSupported){preventScrollSupported=!1;for(let l=0;l<e.length;){let d=e[l++],p=e[l++],b=e[l++];d.scrollTop!=p&&(d.scrollTop=p),d.scrollLeft!=b&&(d.scrollLeft=b)}}}let scratchRange;function textRange(o,e,l=e){let d=scratchRange||(scratchRange=document.createRange());return d.setEnd(o,l),d.setStart(o,e),d}function dispatchKey(o,e,l,d){let p={key:e,code:e,keyCode:l,which:l,cancelable:!0};d&&({altKey:p.altKey,ctrlKey:p.ctrlKey,shiftKey:p.shiftKey,metaKey:p.metaKey}=d);let b=new KeyboardEvent("keydown",p);b.synthetic=!0,o.dispatchEvent(b);let R=new KeyboardEvent("keyup",p);return R.synthetic=!0,o.dispatchEvent(R),b.defaultPrevented||R.defaultPrevented}function getRoot(o){for(;o;){if(o&&(o.nodeType==9||o.nodeType==11&&o.host))return o;o=o.assignedSlot||o.parentNode}return null}function clearAttributes(o){for(;o.attributes.length;)o.removeAttributeNode(o.attributes[0])}function atElementStart(o,e){let l=e.focusNode,d=e.focusOffset;if(!l||e.anchorNode!=l||e.anchorOffset!=d)return!1;for(d=Math.min(d,maxOffset(l));;)if(d){if(l.nodeType!=1)return!1;let p=l.childNodes[d-1];p.contentEditable=="false"?d--:(l=p,d=maxOffset(l))}else{if(l==o)return!0;d=domIndex(l),l=l.parentNode}}function isScrolledToBottom(o){return o.scrollTop>Math.max(1,o.scrollHeight-o.clientHeight-4)}function textNodeBefore(o,e){for(let l=o,d=e;;){if(l.nodeType==3&&d>0)return{node:l,offset:d};if(l.nodeType==1&&d>0){if(l.contentEditable=="false")return null;l=l.childNodes[d-1],d=maxOffset(l)}else if(l.parentNode&&!isBlockElement(l))d=domIndex(l),l=l.parentNode;else return null}}function textNodeAfter(o,e){for(let l=o,d=e;;){if(l.nodeType==3&&d<l.nodeValue.length)return{node:l,offset:d};if(l.nodeType==1&&d<l.childNodes.length){if(l.contentEditable=="false")return null;l=l.childNodes[d],d=0}else if(l.parentNode&&!isBlockElement(l))d=domIndex(l)+1,l=l.parentNode;else return null}}class DOMPos{constructor(e,l,d=!0){this.node=e,this.offset=l,this.precise=d}static before(e,l){return new DOMPos(e.parentNode,domIndex(e),l)}static after(e,l){return new DOMPos(e.parentNode,domIndex(e)+1,l)}}const noChildren=[];class ContentView{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let l=this.posAtStart;for(let d of this.children){if(d==e)return l;l+=d.length+d.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,l){if(this.flags&2){let d=this.dom,p=null,b;for(let R of this.children){if(R.flags&7){if(!R.dom&&(b=p?p.nextSibling:d.firstChild)){let I=ContentView.get(b);(!I||!I.parent&&I.canReuseDOM(R))&&R.reuseDOM(b)}R.sync(e,l),R.flags&=-8}if(b=p?p.nextSibling:d.firstChild,l&&!l.written&&l.node==d&&b!=R.dom&&(l.written=!0),R.dom.parentNode==d)for(;b&&b!=R.dom;)b=rm$1(b);else d.insertBefore(R.dom,b);p=R.dom}for(b=p?p.nextSibling:d.firstChild,b&&l&&l.node==d&&(l.written=!0);b;)b=rm$1(b)}else if(this.flags&1)for(let d of this.children)d.flags&7&&(d.sync(e,l),d.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,l){let d;if(e==this.dom)d=this.dom.childNodes[l];else{let p=maxOffset(e)==0?0:l==0?-1:1;for(;;){let b=e.parentNode;if(b==this.dom)break;p==0&&b.firstChild!=b.lastChild&&(e==b.firstChild?p=-1:p=1),e=b}p<0?d=e:d=e.nextSibling}if(d==this.dom.firstChild)return 0;for(;d&&!ContentView.get(d);)d=d.nextSibling;if(!d)return this.length;for(let p=0,b=0;;p++){let R=this.children[p];if(R.dom==d)return b;b+=R.length+R.breakAfter}}domBoundsAround(e,l,d=0){let p=-1,b=-1,R=-1,I=-1;for(let z=0,se=d,le=d;z<this.children.length;z++){let tn=this.children[z],an=se+tn.length;if(se<e&&an>l)return tn.domBoundsAround(e,l,se);if(an>=e&&p==-1&&(p=z,b=se),se>l&&tn.dom.parentNode==this.dom){R=z,I=le;break}le=an,se=an+tn.breakAfter}return{from:b,to:I<0?d+this.length:I,startDOM:(p?this.children[p-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:R<this.children.length&&R>=0?this.children[R].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let l=this.parent;l;l=l.parent){if(e&&(l.flags|=2),l.flags&1)return;l.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let l=e.parent;if(!l)return e;e=l}}replaceChildren(e,l,d=noChildren){this.markDirty();for(let p=e;p<l;p++){let b=this.children[p];b.parent==this&&d.indexOf(b)<0&&b.destroy()}d.length<250?this.children.splice(e,l-e,...d):this.children=[].concat(this.children.slice(0,e),d,this.children.slice(l));for(let p=0;p<d.length;p++)d[p].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new ChildCursor(this.children,e,this.children.length)}childPos(e,l=1){return this.childCursor().findPos(e,l)}toString(){let e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+(e=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(e){return e.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(e,l,d,p,b,R){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!((this.flags|e.flags)&8)}getSide(){return 0}destroy(){for(let e of this.children)e.parent==this&&e.destroy();this.parent=null}}ContentView.prototype.breakAfter=0;function rm$1(o){let e=o.nextSibling;return o.parentNode.removeChild(o),e}class ChildCursor{constructor(e,l,d){this.children=e,this.pos=l,this.i=d,this.off=0}findPos(e,l=1){for(;;){if(e>this.pos||e==this.pos&&(l>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let d=this.children[--this.i];this.pos-=d.length+d.breakAfter}}}function replaceRange(o,e,l,d,p,b,R,I,z){let{children:se}=o,le=se.length?se[e]:null,tn=b.length?b[b.length-1]:null,an=tn?tn.breakAfter:R;if(!(e==d&&le&&!R&&!an&&b.length<2&&le.merge(l,p,b.length?tn:null,l==0,I,z))){if(d<se.length){let sn=se[d];sn&&(p<sn.length||sn.breakAfter&&tn?.breakAfter)?(e==d&&(sn=sn.split(p),p=0),!an&&tn&&sn.merge(0,p,tn,!0,0,z)?b[b.length-1]=sn:((p||sn.children.length&&!sn.children[0].length)&&sn.merge(0,p,null,!1,0,z),b.push(sn))):sn?.breakAfter&&(tn?tn.breakAfter=1:R=1),d++}for(le&&(le.breakAfter=R,l>0&&(!R&&b.length&&le.merge(l,le.length,b[0],!1,I,0)?le.breakAfter=b.shift().breakAfter:(l<le.length||le.children.length&&le.children[le.children.length-1].length==0)&&le.merge(l,le.length,null,!1,I,0),e++));e<d&&b.length;)if(se[d-1].become(b[b.length-1]))d--,b.pop(),z=b.length?0:I;else if(se[e].become(b[0]))e++,b.shift(),I=b.length?0:z;else break;!b.length&&e&&d<se.length&&!se[e-1].breakAfter&&se[d].merge(0,0,se[e-1],!1,I,z)&&e--,(e<d||b.length)&&o.replaceChildren(e,d,b)}}function mergeChildrenInto(o,e,l,d,p,b){let R=o.childCursor(),{i:I,off:z}=R.findPos(l,1),{i:se,off:le}=R.findPos(e,-1),tn=e-l;for(let an of d)tn+=an.length;o.length+=tn,replaceRange(o,se,le,I,z,d,0,p,b)}let nav=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},doc=typeof document<"u"?document:{documentElement:{style:{}}};const ie_edge=/Edge\/(\d+)/.exec(nav.userAgent),ie_upto10=/MSIE \d/.test(nav.userAgent),ie_11up=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(nav.userAgent),ie$1=!!(ie_upto10||ie_11up||ie_edge),gecko=!ie$1&&/gecko\/(\d+)/i.test(nav.userAgent),chrome=!ie$1&&/Chrome\/(\d+)/.exec(nav.userAgent),webkit="webkitFontSmoothing"in doc.documentElement.style,safari=!ie$1&&/Apple Computer/.test(nav.vendor),ios=safari&&(/Mobile\/\w+/.test(nav.userAgent)||nav.maxTouchPoints>2);var browser={mac:ios||/Mac/.test(nav.platform),windows:/Win/.test(nav.platform),linux:/Linux|X11/.test(nav.platform),ie:ie$1,ie_version:ie_upto10?doc.documentMode||6:ie_11up?+ie_11up[1]:ie_edge?+ie_edge[1]:0,gecko,gecko_version:gecko?+(/Firefox\/(\d+)/.exec(nav.userAgent)||[0,0])[1]:0,chrome:!!chrome,chrome_version:chrome?+chrome[1]:0,ios,android:/Android\b/.test(nav.userAgent),webkit,safari,webkit_version:webkit?+(/\bAppleWebKit\/(\d+)/.exec(nav.userAgent)||[0,0])[1]:0,tabSize:doc.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const MaxJoinLen=256;class TextView extends ContentView{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,l){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(l&&l.node==this.dom&&(l.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,l,d){return this.flags&8||d&&(!(d instanceof TextView)||this.length-(l-e)+d.length>MaxJoinLen||d.flags&8)?!1:(this.text=this.text.slice(0,e)+(d?d.text:"")+this.text.slice(l),this.markDirty(),!0)}split(e){let l=new TextView(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),l.flags|=this.flags&8,l}localPosFromDOM(e,l){return e==this.dom?l:l?this.text.length:0}domAtPos(e){return new DOMPos(this.dom,e)}domBoundsAround(e,l,d){return{from:d,to:d+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,l){return textCoords(this.dom,e,l)}}class MarkView extends ContentView{constructor(e,l=[],d=0){super(),this.mark=e,this.children=l,this.length=d;for(let p of l)p.setParent(this)}setAttrs(e){if(clearAttributes(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let l in this.mark.attrs)e.setAttribute(l,this.mark.attrs[l]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,l){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,l)}merge(e,l,d,p,b,R){return d&&(!(d instanceof MarkView&&d.mark.eq(this.mark))||e&&b<=0||l<this.length&&R<=0)?!1:(mergeChildrenInto(this,e,l,d?d.children.slice():[],b-1,R-1),this.markDirty(),!0)}split(e){let l=[],d=0,p=-1,b=0;for(let I of this.children){let z=d+I.length;z>e&&l.push(d<e?I.split(e-d):I),p<0&&d>=e&&(p=b),d=z,b++}let R=this.length-e;return this.length=e,p>-1&&(this.children.length=p,this.markDirty()),new MarkView(this.mark,l,R)}domAtPos(e){return inlineDOMAtPos(this,e)}coordsAt(e,l){return coordsInChildren(this,e,l)}}function textCoords(o,e,l){let d=o.nodeValue.length;e>d&&(e=d);let p=e,b=e,R=0;e==0&&l<0||e==d&&l>=0?browser.chrome||browser.gecko||(e?(p--,R=1):b<d&&(b++,R=-1)):l<0?p--:b<d&&b++;let I=textRange(o,p,b).getClientRects();if(!I.length)return null;let z=I[(R?R<0:l>=0)?0:I.length-1];return browser.safari&&!R&&z.width==0&&(z=Array.prototype.find.call(I,se=>se.width)||z),R?flattenRect(z,R<0):z||null}class WidgetView extends ContentView{static create(e,l,d){return new WidgetView(e,l,d)}constructor(e,l,d){super(),this.widget=e,this.length=l,this.side=d,this.prevWidget=null}split(e){let l=WidgetView.create(this.widget,this.length-e,this.side);return this.length-=e,l}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,l,d,p,b,R){return d&&(!(d instanceof WidgetView)||!this.widget.compare(d.widget)||e>0&&b<=0||l<this.length&&R<=0)?!1:(this.length=e+(d?d.length:0)+(this.length-l),!0)}become(e){return e instanceof WidgetView&&e.side==this.side&&this.widget.constructor==e.widget.constructor?(this.widget.compare(e.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get overrideDOMText(){if(this.length==0)return Text$1.empty;let e=this;for(;e.parent;)e=e.parent;let{view:l}=e,d=l&&l.state.doc,p=this.posAtStart;return d?d.slice(p,p+this.length):Text$1.empty}domAtPos(e){return(this.length?e==0:this.side>0)?DOMPos.before(this.dom):DOMPos.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,l){let d=this.widget.coordsAt(this.dom,e,l);if(d)return d;let p=this.dom.getClientRects(),b=null;if(!p.length)return null;let R=this.side?this.side<0:e>0;for(let I=R?p.length-1:0;b=p[I],!(e>0?I==0:I==p.length-1||b.top<b.bottom);I+=R?-1:1);return flattenRect(b,!R)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class WidgetBufferView extends ContentView{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof WidgetBufferView&&e.side==this.side}split(){return new WidgetBufferView(this.side)}sync(){if(!this.dom){let e=document.createElement("img");e.className="cm-widgetBuffer",e.setAttribute("aria-hidden","true"),this.setDOM(e)}}getSide(){return this.side}domAtPos(e){return this.side>0?DOMPos.before(this.dom):DOMPos.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return Text$1.empty}get isHidden(){return!0}}TextView.prototype.children=WidgetView.prototype.children=WidgetBufferView.prototype.children=noChildren;function inlineDOMAtPos(o,e){let l=o.dom,{children:d}=o,p=0;for(let b=0;p<d.length;p++){let R=d[p],I=b+R.length;if(!(I==b&&R.getSide()<=0)){if(e>b&&e<I&&R.dom.parentNode==l)return R.domAtPos(e-b);if(e<=b)break;b=I}}for(let b=p;b>0;b--){let R=d[b-1];if(R.dom.parentNode==l)return R.domAtPos(R.length)}for(let b=p;b<d.length;b++){let R=d[b];if(R.dom.parentNode==l)return R.domAtPos(0)}return new DOMPos(l,0)}function joinInlineInto(o,e,l){let d,{children:p}=o;l>0&&e instanceof MarkView&&p.length&&(d=p[p.length-1])instanceof MarkView&&d.mark.eq(e.mark)?joinInlineInto(d,e.children[0],l-1):(p.push(e),e.setParent(o)),o.length+=e.length}function coordsInChildren(o,e,l){let d=null,p=-1,b=null,R=-1;function I(se,le){for(let tn=0,an=0;tn<se.children.length&&an<=le;tn++){let sn=se.children[tn],ln=an+sn.length;ln>=le&&(sn.children.length?I(sn,le-an):(!b||b.isHidden&&l>0)&&(ln>le||an==ln&&sn.getSide()>0)?(b=sn,R=le-an):(an<le||an==ln&&sn.getSide()<0&&!sn.isHidden)&&(d=sn,p=le-an)),an=ln}}I(o,e);let z=(l<0?d:b)||d||b;return z?z.coordsAt(Math.max(0,z==d?p:R),l):fallbackRect(o)}function fallbackRect(o){let e=o.dom.lastChild;if(!e)return o.dom.getBoundingClientRect();let l=clientRectsFor(e);return l[l.length-1]||null}function combineAttrs(o,e){for(let l in o)l=="class"&&e.class?e.class+=" "+o.class:l=="style"&&e.style?e.style+=";"+o.style:e[l]=o[l];return e}const noAttrs$1=Object.create(null);function attrsEq(o,e,l){if(o==e)return!0;o||(o=noAttrs$1),e||(e=noAttrs$1);let d=Object.keys(o),p=Object.keys(e);if(d.length-(l&&d.indexOf(l)>-1?1:0)!=p.length-(l&&p.indexOf(l)>-1?1:0))return!1;for(let b of d)if(b!=l&&(p.indexOf(b)==-1||o[b]!==e[b]))return!1;return!0}function updateAttrs(o,e,l){let d=!1;if(e)for(let p in e)l&&p in l||(d=!0,p=="style"?o.style.cssText="":o.removeAttribute(p));if(l)for(let p in l)e&&e[p]==l[p]||(d=!0,p=="style"?o.style.cssText=l[p]:o.setAttribute(p,l[p]));return d}function getAttrs(o){let e=Object.create(null);for(let l=0;l<o.attributes.length;l++){let d=o.attributes[l];e[d.name]=d.value}return e}class WidgetType{eq(e){return!1}updateDOM(e,l){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,l,d){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var BlockType=function(o){return o[o.Text=0]="Text",o[o.WidgetBefore=1]="WidgetBefore",o[o.WidgetAfter=2]="WidgetAfter",o[o.WidgetRange=3]="WidgetRange",o}(BlockType||(BlockType={}));class Decoration extends RangeValue{constructor(e,l,d,p){super(),this.startSide=e,this.endSide=l,this.widget=d,this.spec=p}get heightRelevant(){return!1}static mark(e){return new MarkDecoration(e)}static widget(e){let l=Math.max(-1e4,Math.min(1e4,e.side||0)),d=!!e.block;return l+=d&&!e.inlineOrder?l>0?3e8:-4e8:l>0?1e8:-1e8,new PointDecoration(e,l,l,d,e.widget||null,!1)}static replace(e){let l=!!e.block,d,p;if(e.isBlockGap)d=-5e8,p=4e8;else{let{start:b,end:R}=getInclusive(e,l);d=(b?l?-3e8:-1:5e8)-1,p=(R?l?2e8:1:-6e8)+1}return new PointDecoration(e,d,p,l,e.widget||null,!0)}static line(e){return new LineDecoration(e)}static set(e,l=!1){return RangeSet.of(e,l)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Decoration.none=RangeSet.empty;class MarkDecoration extends Decoration{constructor(e){let{start:l,end:d}=getInclusive(e);super(l?-1:5e8,d?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var l,d;return this==e||e instanceof MarkDecoration&&this.tagName==e.tagName&&(this.class||((l=this.attrs)===null||l===void 0?void 0:l.class))==(e.class||((d=e.attrs)===null||d===void 0?void 0:d.class))&&attrsEq(this.attrs,e.attrs,"class")}range(e,l=e){if(e>=l)throw new RangeError("Mark decorations may not be empty");return super.range(e,l)}}MarkDecoration.prototype.point=!1;class LineDecoration extends Decoration{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof LineDecoration&&this.spec.class==e.spec.class&&attrsEq(this.spec.attributes,e.spec.attributes)}range(e,l=e){if(l!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,l)}}LineDecoration.prototype.mapMode=MapMode.TrackBefore,LineDecoration.prototype.point=!0;class PointDecoration extends Decoration{constructor(e,l,d,p,b,R){super(l,d,b,e),this.block=p,this.isReplace=R,this.mapMode=p?l<=0?MapMode.TrackBefore:MapMode.TrackAfter:MapMode.TrackDel}get type(){return this.startSide!=this.endSide?BlockType.WidgetRange:this.startSide<=0?BlockType.WidgetBefore:BlockType.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof PointDecoration&&widgetsEq(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,l=e){if(this.isReplace&&(e>l||e==l&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&l!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,l)}}PointDecoration.prototype.point=!0;function getInclusive(o,e=!1){let{inclusiveStart:l,inclusiveEnd:d}=o;return l==null&&(l=o.inclusive),d==null&&(d=o.inclusive),{start:l??e,end:d??e}}function widgetsEq(o,e){return o==e||!!(o&&e&&o.compare(e))}function addRange(o,e,l,d=0){let p=l.length-1;p>=0&&l[p]+d>=o?l[p]=Math.max(l[p],e):l.push(o,e)}class LineView extends ContentView{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,l,d,p,b,R){if(d){if(!(d instanceof LineView))return!1;this.dom||d.transferDOM(this)}return p&&this.setDeco(d?d.attrs:null),mergeChildrenInto(this,e,l,d?d.children.slice():[],b,R),!0}split(e){let l=new LineView;if(l.breakAfter=this.breakAfter,this.length==0)return l;let{i:d,off:p}=this.childPos(e);p&&(l.append(this.children[d].split(p),0),this.children[d].merge(p,this.children[d].length,null,!1,0,0),d++);for(let b=d;b<this.children.length;b++)l.append(this.children[b],0);for(;d>0&&this.children[d-1].length==0;)this.children[--d].destroy();return this.children.length=d,this.markDirty(),this.length=e,l}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){attrsEq(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,l){joinInlineInto(this,e,l)}addLineDeco(e){let l=e.spec.attributes,d=e.spec.class;l&&(this.attrs=combineAttrs(l,this.attrs||{})),d&&(this.attrs=combineAttrs({class:d},this.attrs||{}))}domAtPos(e){return inlineDOMAtPos(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,l){var d;this.dom?this.flags&4&&(clearAttributes(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(updateAttrs(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,l);let p=this.dom.lastChild;for(;p&&ContentView.get(p)instanceof MarkView;)p=p.lastChild;if(!p||!this.length||p.nodeName!="BR"&&((d=ContentView.get(p))===null||d===void 0?void 0:d.isEditable)==!1&&(!browser.ios||!this.children.some(b=>b instanceof TextView))){let b=document.createElement("BR");b.cmIgnore=!0,this.dom.appendChild(b)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,l;for(let d of this.children){if(!(d instanceof TextView)||/[^ -~]/.test(d.text))return null;let p=clientRectsFor(d.dom);if(p.length!=1)return null;e+=p[0].width,l=p[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:l}:null}coordsAt(e,l){let d=coordsInChildren(this,e,l);if(!this.children.length&&d&&this.parent){let{heightOracle:p}=this.parent.view.viewState,b=d.bottom-d.top;if(Math.abs(b-p.lineHeight)<2&&p.textHeight<b){let R=(b-p.textHeight)/2;return{top:d.top+R,bottom:d.bottom-R,left:d.left,right:d.left}}}return d}become(e){return e instanceof LineView&&this.children.length==0&&e.children.length==0&&attrsEq(this.attrs,e.attrs)&&this.breakAfter==e.breakAfter}covers(){return!0}static find(e,l){for(let d=0,p=0;d<e.children.length;d++){let b=e.children[d],R=p+b.length;if(R>=l){if(b instanceof LineView)return b;if(R>l)break}p=R+b.breakAfter}return null}}class BlockWidgetView extends ContentView{constructor(e,l,d){super(),this.widget=e,this.length=l,this.deco=d,this.breakAfter=0,this.prevWidget=null}merge(e,l,d,p,b,R){return d&&(!(d instanceof BlockWidgetView)||!this.widget.compare(d.widget)||e>0&&b<=0||l<this.length&&R<=0)?!1:(this.length=e+(d?d.length:0)+(this.length-l),!0)}domAtPos(e){return e==0?DOMPos.before(this.dom):DOMPos.after(this.dom,e==this.length)}split(e){let l=this.length-e;this.length=e;let d=new BlockWidgetView(this.widget,l,this.deco);return d.breakAfter=this.breakAfter,d}get children(){return noChildren}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):Text$1.empty}domBoundsAround(){return null}become(e){return e instanceof BlockWidgetView&&e.widget.constructor==this.widget.constructor?(e.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,this.deco=e.deco,this.breakAfter=e.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(e,l){let d=this.widget.coordsAt(this.dom,e,l);return d||(this.widget instanceof BlockGapWidget?null:flattenRect(this.dom.getBoundingClientRect(),this.length?e==0:l<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(e){let{startSide:l,endSide:d}=this.deco;return l==d?!1:e<0?l<0:d>0}}class BlockGapWidget extends WidgetType{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class ContentBuilder{constructor(e,l,d,p){this.doc=e,this.pos=l,this.end=d,this.disallowBlockEffectsFor=p,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=l}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof BlockWidgetView&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new LineView),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(wrapMarks(new WidgetBufferView(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof BlockWidgetView)&&this.getLine()}buildText(e,l,d){for(;e>0;){if(this.textOff==this.text.length){let{value:b,lineBreak:R,done:I}=this.cursor.next(this.skip);if(this.skip=0,I)throw new Error("Ran out of text content when drawing inline views");if(R){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=b,this.textOff=0}let p=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(l.slice(l.length-d)),this.getLine().append(wrapMarks(new TextView(this.text.slice(this.textOff,this.textOff+p)),l),d),this.atCursorPos=!0,this.textOff+=p,e-=p,d=0}}span(e,l,d,p){this.buildText(l-e,d,p),this.pos=l,this.openStart<0&&(this.openStart=p)}point(e,l,d,p,b,R){if(this.disallowBlockEffectsFor[R]&&d instanceof PointDecoration){if(d.block)throw new RangeError("Block decorations may not be specified via plugins");if(l>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let I=l-e;if(d instanceof PointDecoration)if(d.block)d.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new BlockWidgetView(d.widget||NullWidget.block,I,d));else{let z=WidgetView.create(d.widget||NullWidget.inline,I,I?0:d.startSide),se=this.atCursorPos&&!z.isEditable&&b<=p.length&&(e<l||d.startSide>0),le=!z.isEditable&&(e<l||b>p.length||d.startSide<=0),tn=this.getLine();this.pendingBuffer==2&&!se&&!z.isEditable&&(this.pendingBuffer=0),this.flushBuffer(p),se&&(tn.append(wrapMarks(new WidgetBufferView(1),p),b),b=p.length+Math.max(0,b-p.length)),tn.append(wrapMarks(z,p),b),this.atCursorPos=le,this.pendingBuffer=le?e<l||b>p.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=p.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(d);I&&(this.textOff+I<=this.text.length?this.textOff+=I:(this.skip+=I-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=l),this.openStart<0&&(this.openStart=b)}static build(e,l,d,p,b){let R=new ContentBuilder(e,l,d,b);return R.openEnd=RangeSet.spans(p,l,d,R),R.openStart<0&&(R.openStart=R.openEnd),R.finish(R.openEnd),R}}function wrapMarks(o,e){for(let l of e)o=new MarkView(l,[o],o.length);return o}class NullWidget extends WidgetType{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}NullWidget.inline=new NullWidget("span"),NullWidget.block=new NullWidget("div");var Direction=function(o){return o[o.LTR=0]="LTR",o[o.RTL=1]="RTL",o}(Direction||(Direction={}));const LTR=Direction.LTR,RTL=Direction.RTL;function dec(o){let e=[];for(let l=0;l<o.length;l++)e.push(1<<+o[l]);return e}const LowTypes=dec("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),ArabicTypes=dec("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Brackets=Object.create(null),BracketStack=[];for(let o of["()","[]","{}"]){let e=o.charCodeAt(0),l=o.charCodeAt(1);Brackets[e]=l,Brackets[l]=-e}function charType(o){return o<=247?LowTypes[o]:1424<=o&&o<=1524?2:1536<=o&&o<=1785?ArabicTypes[o-1536]:1774<=o&&o<=2220?4:8192<=o&&o<=8204?256:64336<=o&&o<=65023?4:1}const BidiRE=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class BidiSpan{get dir(){return this.level%2?RTL:LTR}constructor(e,l,d){this.from=e,this.to=l,this.level=d}side(e,l){return this.dir==l==e?this.to:this.from}forward(e,l){return e==(this.dir==l)}static find(e,l,d,p){let b=-1;for(let R=0;R<e.length;R++){let I=e[R];if(I.from<=l&&I.to>=l){if(I.level==d)return R;(b<0||(p!=0?p<0?I.from<l:I.to>l:e[b].level>I.level))&&(b=R)}}if(b<0)throw new RangeError("Index out of range");return b}}function isolatesEq(o,e){if(o.length!=e.length)return!1;for(let l=0;l<o.length;l++){let d=o[l],p=e[l];if(d.from!=p.from||d.to!=p.to||d.direction!=p.direction||!isolatesEq(d.inner,p.inner))return!1}return!0}const types=[];function computeCharTypes(o,e,l,d,p){for(let b=0;b<=d.length;b++){let R=b?d[b-1].to:e,I=b<d.length?d[b].from:l,z=b?256:p;for(let se=R,le=z,tn=z;se<I;se++){let an=charType(o.charCodeAt(se));an==512?an=le:an==8&&tn==4&&(an=16),types[se]=an==4?2:an,an&7&&(tn=an),le=an}for(let se=R,le=z,tn=z;se<I;se++){let an=types[se];if(an==128)se<I-1&&le==types[se+1]&&le&24?an=types[se]=le:types[se]=256;else if(an==64){let sn=se+1;for(;sn<I&&types[sn]==64;)sn++;let ln=se&&le==8||sn<l&&types[sn]==8?tn==1?1:8:256;for(let un=se;un<sn;un++)types[un]=ln;se=sn-1}else an==8&&tn==1&&(types[se]=1);le=an,an&7&&(tn=an)}}}function processBracketPairs(o,e,l,d,p){let b=p==1?2:1;for(let R=0,I=0,z=0;R<=d.length;R++){let se=R?d[R-1].to:e,le=R<d.length?d[R].from:l;for(let tn=se,an,sn,ln;tn<le;tn++)if(sn=Brackets[an=o.charCodeAt(tn)])if(sn<0){for(let un=I-3;un>=0;un-=3)if(BracketStack[un+1]==-sn){let pn=BracketStack[un+2],yn=pn&2?p:pn&4?pn&1?b:p:0;yn&&(types[tn]=types[BracketStack[un]]=yn),I=un;break}}else{if(BracketStack.length==189)break;BracketStack[I++]=tn,BracketStack[I++]=an,BracketStack[I++]=z}else if((ln=types[tn])==2||ln==1){let un=ln==p;z=un?0:1;for(let pn=I-3;pn>=0;pn-=3){let yn=BracketStack[pn+2];if(yn&2)break;if(un)BracketStack[pn+2]|=2;else{if(yn&4)break;BracketStack[pn+2]|=4}}}}}function processNeutrals(o,e,l,d){for(let p=0,b=d;p<=l.length;p++){let R=p?l[p-1].to:o,I=p<l.length?l[p].from:e;for(let z=R;z<I;){let se=types[z];if(se==256){let le=z+1;for(;;)if(le==I){if(p==l.length)break;le=l[p++].to,I=p<l.length?l[p].from:e}else if(types[le]==256)le++;else break;let tn=b==1,an=(le<e?types[le]:d)==1,sn=tn==an?tn?1:2:d;for(let ln=le,un=p,pn=un?l[un-1].to:o;ln>z;)ln==pn&&(ln=l[--un].from,pn=un?l[un-1].to:o),types[--ln]=sn;z=le}else b=se,z++}}}function emitSpans(o,e,l,d,p,b,R){let I=d%2?2:1;if(d%2==p%2)for(let z=e,se=0;z<l;){let le=!0,tn=!1;if(se==b.length||z<b[se].from){let un=types[z];un!=I&&(le=!1,tn=un==16)}let an=!le&&I==1?[]:null,sn=le?d:d+1,ln=z;e:for(;;)if(se<b.length&&ln==b[se].from){if(tn)break e;let un=b[se];if(!le)for(let pn=un.to,yn=se+1;;){if(pn==l)break e;if(yn<b.length&&b[yn].from==pn)pn=b[yn++].to;else{if(types[pn]==I)break e;break}}if(se++,an)an.push(un);else{un.from>z&&R.push(new BidiSpan(z,un.from,sn));let pn=un.direction==LTR!=!(sn%2);computeSectionOrder(o,pn?d+1:d,p,un.inner,un.from,un.to,R),z=un.to}ln=un.to}else{if(ln==l||(le?types[ln]!=I:types[ln]==I))break;ln++}an?emitSpans(o,z,ln,d+1,p,an,R):z<ln&&R.push(new BidiSpan(z,ln,sn)),z=ln}else for(let z=l,se=b.length;z>e;){let le=!0,tn=!1;if(!se||z>b[se-1].to){let un=types[z-1];un!=I&&(le=!1,tn=un==16)}let an=!le&&I==1?[]:null,sn=le?d:d+1,ln=z;e:for(;;)if(se&&ln==b[se-1].to){if(tn)break e;let un=b[--se];if(!le)for(let pn=un.from,yn=se;;){if(pn==e)break e;if(yn&&b[yn-1].to==pn)pn=b[--yn].from;else{if(types[pn-1]==I)break e;break}}if(an)an.push(un);else{un.to<z&&R.push(new BidiSpan(un.to,z,sn));let pn=un.direction==LTR!=!(sn%2);computeSectionOrder(o,pn?d+1:d,p,un.inner,un.from,un.to,R),z=un.from}ln=un.from}else{if(ln==e||(le?types[ln-1]!=I:types[ln-1]==I))break;ln--}an?emitSpans(o,ln,z,d+1,p,an,R):ln<z&&R.push(new BidiSpan(ln,z,sn)),z=ln}}function computeSectionOrder(o,e,l,d,p,b,R){let I=e%2?2:1;computeCharTypes(o,p,b,d,I),processBracketPairs(o,p,b,d,I),processNeutrals(p,b,d,I),emitSpans(o,p,b,e,l,d,R)}function computeOrder(o,e,l){if(!o)return[new BidiSpan(0,0,e==RTL?1:0)];if(e==LTR&&!l.length&&!BidiRE.test(o))return trivialOrder(o.length);if(l.length)for(;o.length>types.length;)types[types.length]=256;let d=[],p=e==LTR?0:1;return computeSectionOrder(o,p,p,l,0,o.length,d),d}function trivialOrder(o){return[new BidiSpan(0,o,0)]}let movedOver="";function moveVisually(o,e,l,d,p){var b;let R=d.head-o.from,I=BidiSpan.find(e,R,(b=d.bidiLevel)!==null&&b!==void 0?b:-1,d.assoc),z=e[I],se=z.side(p,l);if(R==se){let an=I+=p?1:-1;if(an<0||an>=e.length)return null;z=e[I=an],R=z.side(!p,l),se=z.side(p,l)}let le=findClusterBreak(o.text,R,z.forward(p,l));(le<z.from||le>z.to)&&(le=se),movedOver=o.text.slice(Math.min(R,le),Math.max(R,le));let tn=I==(p?e.length-1:0)?null:e[I+(p?1:-1)];return tn&&le==se&&tn.level+(p?0:1)<z.level?EditorSelection.cursor(tn.side(!p,l)+o.from,tn.forward(p,l)?1:-1,tn.level):EditorSelection.cursor(le+o.from,z.forward(p,l)?-1:1,z.level)}function autoDirection(o,e,l){for(let d=e;d<l;d++){let p=charType(o.charCodeAt(d));if(p==1)return LTR;if(p==2||p==4)return RTL}return LTR}const clickAddsSelectionRange=Facet.define(),dragMovesSelection$1=Facet.define(),mouseSelectionStyle=Facet.define(),exceptionSink=Facet.define(),updateListener=Facet.define(),inputHandler$1=Facet.define(),focusChangeEffect=Facet.define(),clipboardInputFilter=Facet.define(),clipboardOutputFilter=Facet.define(),perLineTextDirection=Facet.define({combine:o=>o.some(e=>e)}),nativeSelectionHidden=Facet.define({combine:o=>o.some(e=>e)}),scrollHandler=Facet.define();class ScrollTarget{constructor(e,l="nearest",d="nearest",p=5,b=5,R=!1){this.range=e,this.y=l,this.x=d,this.yMargin=p,this.xMargin=b,this.isSnapshot=R}map(e){return e.empty?this:new ScrollTarget(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new ScrollTarget(EditorSelection.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const scrollIntoView$1=StateEffect.define({map:(o,e)=>o.map(e)}),setEditContextFormatting=StateEffect.define();function logException(o,e,l){let d=o.facet(exceptionSink);d.length?d[0](e):window.onerror?window.onerror(String(e),l,void 0,void 0,e):l?console.error(l+":",e):console.error(e)}const editable=Facet.define({combine:o=>o.length?o[0]:!0});let nextPluginID=0;const viewPlugin=Facet.define();class ViewPlugin{constructor(e,l,d,p,b){this.id=e,this.create=l,this.domEventHandlers=d,this.domEventObservers=p,this.extension=b(this)}static define(e,l){const{eventHandlers:d,eventObservers:p,provide:b,decorations:R}=l||{};return new ViewPlugin(nextPluginID++,e,d,p,I=>{let z=[viewPlugin.of(I)];return R&&z.push(decorations.of(se=>{let le=se.plugin(I);return le?R(le):Decoration.none})),b&&z.push(b(I)),z})}static fromClass(e,l){return ViewPlugin.define(d=>new e(d),l)}}class PluginInstance{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let l=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(l)}catch(d){if(logException(l.state,d,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(l){logException(e.state,l,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var l;if(!((l=this.value)===null||l===void 0)&&l.destroy)try{this.value.destroy()}catch(d){logException(e.state,d,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const editorAttributes=Facet.define(),contentAttributes=Facet.define(),decorations=Facet.define(),outerDecorations=Facet.define(),atomicRanges=Facet.define(),bidiIsolatedRanges=Facet.define();function getIsolatedRanges(o,e){let l=o.state.facet(bidiIsolatedRanges);if(!l.length)return l;let d=l.map(b=>b instanceof Function?b(o):b),p=[];return RangeSet.spans(d,e.from,e.to,{point(){},span(b,R,I,z){let se=b-e.from,le=R-e.from,tn=p;for(let an=I.length-1;an>=0;an--,z--){let sn=I[an].spec.bidiIsolate,ln;if(sn==null&&(sn=autoDirection(e.text,se,le)),z>0&&tn.length&&(ln=tn[tn.length-1]).to==se&&ln.direction==sn)ln.to=le,tn=ln.inner;else{let un={from:se,to:le,direction:sn,inner:[]};tn.push(un),tn=un.inner}}}}),p}const scrollMargins=Facet.define();function getScrollMargins(o){let e=0,l=0,d=0,p=0;for(let b of o.state.facet(scrollMargins)){let R=b(o);R&&(R.left!=null&&(e=Math.max(e,R.left)),R.right!=null&&(l=Math.max(l,R.right)),R.top!=null&&(d=Math.max(d,R.top)),R.bottom!=null&&(p=Math.max(p,R.bottom)))}return{left:e,right:l,top:d,bottom:p}}const styleModule=Facet.define();class ChangedRange{constructor(e,l,d,p){this.fromA=e,this.toA=l,this.fromB=d,this.toB=p}join(e){return new ChangedRange(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let l=e.length,d=this;for(;l>0;l--){let p=e[l-1];if(!(p.fromA>d.toA)){if(p.toA<d.fromA)break;d=d.join(p),e.splice(l-1,1)}}return e.splice(l,0,d),e}static extendWithRanges(e,l){if(l.length==0)return e;let d=[];for(let p=0,b=0,R=0,I=0;;p++){let z=p==e.length?null:e[p],se=R-I,le=z?z.fromB:1e9;for(;b<l.length&&l[b]<le;){let tn=l[b],an=l[b+1],sn=Math.max(I,tn),ln=Math.min(le,an);if(sn<=ln&&new ChangedRange(sn+se,ln+se,sn,ln).addToSet(d),an>le)break;b+=2}if(!z)return d;new ChangedRange(z.fromA,z.toA,z.fromB,z.toB).addToSet(d),R=z.toA,I=z.toB}}}class ViewUpdate{constructor(e,l,d){this.view=e,this.state=l,this.transactions=d,this.flags=0,this.startState=e.state,this.changes=ChangeSet.empty(this.startState.doc.length);for(let b of d)this.changes=this.changes.compose(b.changes);let p=[];this.changes.iterChangedRanges((b,R,I,z)=>p.push(new ChangedRange(b,R,I,z))),this.changedRanges=p}static create(e,l,d){return new ViewUpdate(e,l,d)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class DocView extends ContentView{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=Decoration.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new LineView],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new ChangedRange(0,0,0,e.state.doc.length)],0,null)}update(e){var l;let d=e.changedRanges;this.minWidth>0&&d.length&&(d.every(({fromA:se,toA:le})=>le<this.minWidthFrom||se>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let p=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((l=this.domChanged)===null||l===void 0)&&l.newSel?p=this.domChanged.newSel.head:!touchesComposition(e.changes,this.hasComposition)&&!e.selectionSet&&(p=e.state.selection.main.head));let b=p>-1?findCompositionRange(this.view,e.changes,p):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:se,to:le}=this.hasComposition;d=new ChangedRange(se,le,e.changes.mapPos(se,-1),e.changes.mapPos(le,1)).addToSet(d.slice())}this.hasComposition=b?{from:b.range.fromB,to:b.range.toB}:null,(browser.ie||browser.chrome)&&!b&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let R=this.decorations,I=this.updateDeco(),z=findChangedDeco(R,I,e.changes);return d=ChangedRange.extendWithRanges(d,z),!(this.flags&7)&&d.length==0?!1:(this.updateInner(d,e.startState.doc.length,b),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,l,d){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,l,d);let{observer:p}=this.view;p.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let R=browser.chrome||browser.ios?{node:p.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,R),this.flags&=-8,R&&(R.written||p.selectionRange.focusNode!=R.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(R=>R.flags&=-9);let b=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let R of this.children)R instanceof BlockWidgetView&&R.widget instanceof BlockGapWidget&&b.push(R.dom);p.updateGaps(b)}updateChildren(e,l,d){let p=d?d.range.addToSet(e.slice()):e,b=this.childCursor(l);for(let R=p.length-1;;R--){let I=R>=0?p[R]:null;if(!I)break;let{fromA:z,toA:se,fromB:le,toB:tn}=I,an,sn,ln,un;if(d&&d.range.fromB<tn&&d.range.toB>le){let vn=ContentBuilder.build(this.view.state.doc,le,d.range.fromB,this.decorations,this.dynamicDecorationMap),bn=ContentBuilder.build(this.view.state.doc,d.range.toB,tn,this.decorations,this.dynamicDecorationMap);sn=vn.breakAtStart,ln=vn.openStart,un=bn.openEnd;let Sn=this.compositionView(d);bn.breakAtStart?Sn.breakAfter=1:bn.content.length&&Sn.merge(Sn.length,Sn.length,bn.content[0],!1,bn.openStart,0)&&(Sn.breakAfter=bn.content[0].breakAfter,bn.content.shift()),vn.content.length&&Sn.merge(0,0,vn.content[vn.content.length-1],!0,0,vn.openEnd)&&vn.content.pop(),an=vn.content.concat(Sn).concat(bn.content)}else({content:an,breakAtStart:sn,openStart:ln,openEnd:un}=ContentBuilder.build(this.view.state.doc,le,tn,this.decorations,this.dynamicDecorationMap));let{i:pn,off:yn}=b.findPos(se,1),{i:_n,off:Pn}=b.findPos(z,-1);replaceRange(this,_n,Pn,pn,yn,an,sn,ln,un)}d&&this.fixCompositionDOM(d)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let l of e.transactions)for(let d of l.effects)d.is(setEditContextFormatting)&&(this.editContextFormatting=d.value)}compositionView(e){let l=new TextView(e.text.nodeValue);l.flags|=8;for(let{deco:p}of e.marks)l=new MarkView(p,[l],l.length);let d=new LineView;return d.append(l,0),d}fixCompositionDOM(e){let l=(b,R)=>{R.flags|=8|(R.children.some(z=>z.flags&7)?1:0),this.markedForComposition.add(R);let I=ContentView.get(b);I&&I!=R&&(I.dom=null),R.setDOM(b)},d=this.childPos(e.range.fromB,1),p=this.children[d.i];l(e.line,p);for(let b=e.marks.length-1;b>=-1;b--)d=p.childPos(d.off,1),p=p.children[d.i],l(b>=0?e.marks[b].node:e.text,p)}updateSelection(e=!1,l=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let d=this.view.root.activeElement,p=d==this.dom,b=!p&&!(this.view.state.facet(editable)||this.dom.tabIndex>-1)&&hasSelection(this.dom,this.view.observer.selectionRange)&&!(d&&this.dom.contains(d));if(!(p||l||b))return;let R=this.forceSelection;this.forceSelection=!1;let I=this.view.state.selection.main,z=this.moveToLine(this.domAtPos(I.anchor)),se=I.empty?z:this.moveToLine(this.domAtPos(I.head));if(browser.gecko&&I.empty&&!this.hasComposition&&betweenUneditable(z)){let tn=document.createTextNode("");this.view.observer.ignore(()=>z.node.insertBefore(tn,z.node.childNodes[z.offset]||null)),z=se=new DOMPos(tn,0),R=!0}let le=this.view.observer.selectionRange;(R||!le.focusNode||(!isEquivalentPosition(z.node,z.offset,le.anchorNode,le.anchorOffset)||!isEquivalentPosition(se.node,se.offset,le.focusNode,le.focusOffset))&&!this.suppressWidgetCursorChange(le,I))&&(this.view.observer.ignore(()=>{browser.android&&browser.chrome&&this.dom.contains(le.focusNode)&&inUneditable(le.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let tn=getSelection(this.view.root);if(tn)if(I.empty){if(browser.gecko){let an=nextToUneditable(z.node,z.offset);if(an&&an!=3){let sn=(an==1?textNodeBefore:textNodeAfter)(z.node,z.offset);sn&&(z=new DOMPos(sn.node,sn.offset))}}tn.collapse(z.node,z.offset),I.bidiLevel!=null&&tn.caretBidiLevel!==void 0&&(tn.caretBidiLevel=I.bidiLevel)}else if(tn.extend){tn.collapse(z.node,z.offset);try{tn.extend(se.node,se.offset)}catch{}}else{let an=document.createRange();I.anchor>I.head&&([z,se]=[se,z]),an.setEnd(se.node,se.offset),an.setStart(z.node,z.offset),tn.removeAllRanges(),tn.addRange(an)}b&&this.view.root.activeElement==this.dom&&(this.dom.blur(),d&&d.focus())}),this.view.observer.setSelectionRange(z,se)),this.impreciseAnchor=z.precise?null:new DOMPos(le.anchorNode,le.anchorOffset),this.impreciseHead=se.precise?null:new DOMPos(le.focusNode,le.focusOffset)}suppressWidgetCursorChange(e,l){return this.hasComposition&&l.empty&&isEquivalentPosition(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==l.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,l=e.state.selection.main,d=getSelection(e.root),{anchorNode:p,anchorOffset:b}=e.observer.selectionRange;if(!d||!l.empty||!l.assoc||!d.modify)return;let R=LineView.find(this,l.head);if(!R)return;let I=R.posAtStart;if(l.head==I||l.head==I+R.length)return;let z=this.coordsAt(l.head,-1),se=this.coordsAt(l.head,1);if(!z||!se||z.bottom>se.top)return;let le=this.domAtPos(l.head+l.assoc);d.collapse(le.node,le.offset),d.modify("move",l.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let tn=e.observer.selectionRange;e.docView.posFromDOM(tn.anchorNode,tn.anchorOffset)!=l.from&&d.collapse(p,b)}moveToLine(e){let l=this.dom,d;if(e.node!=l)return e;for(let p=e.offset;!d&&p<l.childNodes.length;p++){let b=ContentView.get(l.childNodes[p]);b instanceof LineView&&(d=b.domAtPos(0))}for(let p=e.offset-1;!d&&p>=0;p--){let b=ContentView.get(l.childNodes[p]);b instanceof LineView&&(d=b.domAtPos(b.length))}return d?new DOMPos(d.node,d.offset,!0):e}nearest(e){for(let l=e;l;){let d=ContentView.get(l);if(d&&d.rootView==this)return d;l=l.parentNode}return null}posFromDOM(e,l){let d=this.nearest(e);if(!d)throw new RangeError("Trying to find position for a DOM position outside of the document");return d.localPosFromDOM(e,l)+d.posAtStart}domAtPos(e){let{i:l,off:d}=this.childCursor().findPos(e,-1);for(;l<this.children.length-1;){let p=this.children[l];if(d<p.length||p instanceof LineView)break;l++,d=0}return this.children[l].domAtPos(d)}coordsAt(e,l){let d=null,p=0;for(let b=this.length,R=this.children.length-1;R>=0;R--){let I=this.children[R],z=b-I.breakAfter,se=z-I.length;if(z<e)break;if(se<=e&&(se<e||I.covers(-1))&&(z>e||I.covers(1))&&(!d||I instanceof LineView&&!(d instanceof LineView&&l>=0)))d=I,p=se;else if(d&&se==e&&z==e&&I instanceof BlockWidgetView&&Math.abs(l)<2){if(I.deco.startSide<0)break;R&&(d=null)}b=se}return d?d.coordsAt(e-p,l):null}coordsForChar(e){let{i:l,off:d}=this.childPos(e,1),p=this.children[l];if(!(p instanceof LineView))return null;for(;p.children.length;){let{i:I,off:z}=p.childPos(d,1);for(;;I++){if(I==p.children.length)return null;if((p=p.children[I]).length)break}d=z}if(!(p instanceof TextView))return null;let b=findClusterBreak(p.text,d);if(b==d)return null;let R=textRange(p.dom,d,b).getClientRects();for(let I=0;I<R.length;I++){let z=R[I];if(I==R.length-1||z.top<z.bottom&&z.left<z.right)return z}return null}measureVisibleLineHeights(e){let l=[],{from:d,to:p}=e,b=this.view.contentDOM.clientWidth,R=b>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,I=-1,z=this.view.textDirection==Direction.LTR;for(let se=0,le=0;le<this.children.length;le++){let tn=this.children[le],an=se+tn.length;if(an>p)break;if(se>=d){let sn=tn.dom.getBoundingClientRect();if(l.push(sn.height),R){let ln=tn.dom.lastChild,un=ln?clientRectsFor(ln):[];if(un.length){let pn=un[un.length-1],yn=z?pn.right-sn.left:sn.right-pn.left;yn>I&&(I=yn,this.minWidth=b,this.minWidthFrom=se,this.minWidthTo=an)}}}se=an+tn.breakAfter}return l}textDirectionAt(e){let{i:l}=this.childPos(e,1);return getComputedStyle(this.children[l].dom).direction=="rtl"?Direction.RTL:Direction.LTR}measureTextSize(){for(let b of this.children)if(b instanceof LineView){let R=b.measureTextSize();if(R)return R}let e=document.createElement("div"),l,d,p;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let b=clientRectsFor(e.firstChild)[0];l=e.getBoundingClientRect().height,d=b?b.width/27:7,p=b?b.height:l,e.remove()}),{lineHeight:l,charWidth:d,textHeight:p}}childCursor(e=this.length){let l=this.children.length;return l&&(e-=this.children[--l].length),new ChildCursor(this.children,e,l)}computeBlockGapDeco(){let e=[],l=this.view.viewState;for(let d=0,p=0;;p++){let b=p==l.viewports.length?null:l.viewports[p],R=b?b.from-1:this.length;if(R>d){let I=(l.lineBlockAt(R).bottom-l.lineBlockAt(d).top)/this.view.scaleY;e.push(Decoration.replace({widget:new BlockGapWidget(I),block:!0,inclusive:!0,isBlockGap:!0}).range(d,R))}if(!b)break;d=b.to+1}return Decoration.set(e)}updateDeco(){let e=1,l=this.view.state.facet(decorations).map(b=>(this.dynamicDecorationMap[e++]=typeof b=="function")?b(this.view):b),d=!1,p=this.view.state.facet(outerDecorations).map((b,R)=>{let I=typeof b=="function";return I&&(d=!0),I?b(this.view):b});for(p.length&&(this.dynamicDecorationMap[e++]=d,l.push(RangeSet.join(p))),this.decorations=[this.editContextFormatting,...l,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;return this.decorations}scrollIntoView(e){if(e.isSnapshot){let se=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=se.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let se of this.view.state.facet(scrollHandler))try{if(se(this.view,e.range,e))return!0}catch(le){logException(this.view.state,le,"scroll handler")}let{range:l}=e,d=this.coordsAt(l.head,l.empty?l.assoc:l.head>l.anchor?-1:1),p;if(!d)return;!l.empty&&(p=this.coordsAt(l.anchor,l.anchor>l.head?-1:1))&&(d={left:Math.min(d.left,p.left),top:Math.min(d.top,p.top),right:Math.max(d.right,p.right),bottom:Math.max(d.bottom,p.bottom)});let b=getScrollMargins(this.view),R={left:d.left-b.left,top:d.top-b.top,right:d.right+b.right,bottom:d.bottom+b.bottom},{offsetWidth:I,offsetHeight:z}=this.view.scrollDOM;scrollRectIntoView(this.view.scrollDOM,R,l.head<l.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,I),-I),Math.max(Math.min(e.yMargin,z),-z),this.view.textDirection==Direction.LTR)}}function betweenUneditable(o){return o.node.nodeType==1&&o.node.firstChild&&(o.offset==0||o.node.childNodes[o.offset-1].contentEditable=="false")&&(o.offset==o.node.childNodes.length||o.node.childNodes[o.offset].contentEditable=="false")}function findCompositionNode(o,e){let l=o.observer.selectionRange;if(!l.focusNode)return null;let d=textNodeBefore(l.focusNode,l.focusOffset),p=textNodeAfter(l.focusNode,l.focusOffset),b=d||p;if(p&&d&&p.node!=d.node){let I=ContentView.get(p.node);if(!I||I instanceof TextView&&I.text!=p.node.nodeValue)b=p;else if(o.docView.lastCompositionAfterCursor){let z=ContentView.get(d.node);!z||z instanceof TextView&&z.text!=d.node.nodeValue||(b=p)}}if(o.docView.lastCompositionAfterCursor=b!=d,!b)return null;let R=e-b.offset;return{from:R,to:R+b.node.nodeValue.length,node:b.node}}function findCompositionRange(o,e,l){let d=findCompositionNode(o,l);if(!d)return null;let{node:p,from:b,to:R}=d,I=p.nodeValue;if(/[\n\r]/.test(I)||o.state.doc.sliceString(d.from,d.to)!=I)return null;let z=e.invertedDesc,se=new ChangedRange(z.mapPos(b),z.mapPos(R),b,R),le=[];for(let tn=p.parentNode;;tn=tn.parentNode){let an=ContentView.get(tn);if(an instanceof MarkView)le.push({node:tn,deco:an.mark});else{if(an instanceof LineView||tn.nodeName=="DIV"&&tn.parentNode==o.contentDOM)return{range:se,text:p,marks:le,line:tn};if(tn!=o.contentDOM)le.push({node:tn,deco:new MarkDecoration({inclusive:!0,attributes:getAttrs(tn),tagName:tn.tagName.toLowerCase()})});else return null}}}function nextToUneditable(o,e){return o.nodeType!=1?0:(e&&o.childNodes[e-1].contentEditable=="false"?1:0)|(e<o.childNodes.length&&o.childNodes[e].contentEditable=="false"?2:0)}let DecorationComparator$1=class{constructor(){this.changes=[]}compareRange(e,l){addRange(e,l,this.changes)}comparePoint(e,l){addRange(e,l,this.changes)}boundChange(e){addRange(e,e,this.changes)}};function findChangedDeco(o,e,l){let d=new DecorationComparator$1;return RangeSet.compare(o,e,l,d),d.changes}function inUneditable(o,e){for(let l=o;l&&l!=e;l=l.assignedSlot||l.parentNode)if(l.nodeType==1&&l.contentEditable=="false")return!0;return!1}function touchesComposition(o,e){let l=!1;return e&&o.iterChangedRanges((d,p)=>{d<e.to&&p>e.from&&(l=!0)}),l}function groupAt(o,e,l=1){let d=o.charCategorizer(e),p=o.doc.lineAt(e),b=e-p.from;if(p.length==0)return EditorSelection.cursor(e);b==0?l=1:b==p.length&&(l=-1);let R=b,I=b;l<0?R=findClusterBreak(p.text,b,!1):I=findClusterBreak(p.text,b);let z=d(p.text.slice(R,I));for(;R>0;){let se=findClusterBreak(p.text,R,!1);if(d(p.text.slice(se,R))!=z)break;R=se}for(;I<p.length;){let se=findClusterBreak(p.text,I);if(d(p.text.slice(I,se))!=z)break;I=se}return EditorSelection.range(R+p.from,I+p.from)}function getdx(o,e){return e.left>o?e.left-o:Math.max(0,o-e.right)}function getdy(o,e){return e.top>o?e.top-o:Math.max(0,o-e.bottom)}function yOverlap(o,e){return o.top<e.bottom-1&&o.bottom>e.top+1}function upTop(o,e){return e<o.top?{top:e,left:o.left,right:o.right,bottom:o.bottom}:o}function upBot(o,e){return e>o.bottom?{top:o.top,left:o.left,right:o.right,bottom:e}:o}function domPosAtCoords(o,e,l){let d,p,b,R,I=!1,z,se,le,tn;for(let ln=o.firstChild;ln;ln=ln.nextSibling){let un=clientRectsFor(ln);for(let pn=0;pn<un.length;pn++){let yn=un[pn];p&&yOverlap(p,yn)&&(yn=upTop(upBot(yn,p.bottom),p.top));let _n=getdx(e,yn),Pn=getdy(l,yn);if(_n==0&&Pn==0)return ln.nodeType==3?domPosInText(ln,e,l):domPosAtCoords(ln,e,l);if(!d||R>Pn||R==Pn&&b>_n){d=ln,p=yn,b=_n,R=Pn;let vn=Pn?l<yn.top?-1:1:_n?e<yn.left?-1:1:0;I=!vn||(vn>0?pn<un.length-1:pn>0)}_n==0?l>yn.bottom&&(!le||le.bottom<yn.bottom)?(z=ln,le=yn):l<yn.top&&(!tn||tn.top>yn.top)&&(se=ln,tn=yn):le&&yOverlap(le,yn)?le=upBot(le,yn.bottom):tn&&yOverlap(tn,yn)&&(tn=upTop(tn,yn.top))}}if(le&&le.bottom>=l?(d=z,p=le):tn&&tn.top<=l&&(d=se,p=tn),!d)return{node:o,offset:0};let an=Math.max(p.left,Math.min(p.right,e));if(d.nodeType==3)return domPosInText(d,an,l);if(I&&d.contentEditable!="false")return domPosAtCoords(d,an,l);let sn=Array.prototype.indexOf.call(o.childNodes,d)+(e>=(p.left+p.right)/2?1:0);return{node:o,offset:sn}}function domPosInText(o,e,l){let d=o.nodeValue.length,p=-1,b=1e9,R=0;for(let I=0;I<d;I++){let z=textRange(o,I,I+1).getClientRects();for(let se=0;se<z.length;se++){let le=z[se];if(le.top==le.bottom)continue;R||(R=e-le.left);let tn=(le.top>l?le.top-l:l-le.bottom)-1;if(le.left-1<=e&&le.right+1>=e&&tn<b){let an=e>=(le.left+le.right)/2,sn=an;if((browser.chrome||browser.gecko)&&textRange(o,I).getBoundingClientRect().left==le.right&&(sn=!an),tn<=0)return{node:o,offset:I+(sn?1:0)};p=I+(sn?1:0),b=tn}}}return{node:o,offset:p>-1?p:R>0?o.nodeValue.length:0}}function posAtCoords(o,e,l,d=-1){var p,b;let R=o.contentDOM.getBoundingClientRect(),I=R.top+o.viewState.paddingTop,z,{docHeight:se}=o.viewState,{x:le,y:tn}=e,an=tn-I;if(an<0)return 0;if(an>se)return o.state.doc.length;for(let vn=o.viewState.heightOracle.textHeight/2,bn=!1;z=o.elementAtHeight(an),z.type!=BlockType.Text;)for(;an=d>0?z.bottom+vn:z.top-vn,!(an>=0&&an<=se);){if(bn)return l?null:0;bn=!0,d=-d}tn=I+an;let sn=z.from;if(sn<o.viewport.from)return o.viewport.from==0?0:l?null:posAtCoordsImprecise(o,R,z,le,tn);if(sn>o.viewport.to)return o.viewport.to==o.state.doc.length?o.state.doc.length:l?null:posAtCoordsImprecise(o,R,z,le,tn);let ln=o.dom.ownerDocument,un=o.root.elementFromPoint?o.root:ln,pn=un.elementFromPoint(le,tn);pn&&!o.contentDOM.contains(pn)&&(pn=null),pn||(le=Math.max(R.left+1,Math.min(R.right-1,le)),pn=un.elementFromPoint(le,tn),pn&&!o.contentDOM.contains(pn)&&(pn=null));let yn,_n=-1;if(pn&&((p=o.docView.nearest(pn))===null||p===void 0?void 0:p.isEditable)!=!1){if(ln.caretPositionFromPoint){let vn=ln.caretPositionFromPoint(le,tn);vn&&({offsetNode:yn,offset:_n}=vn)}else if(ln.caretRangeFromPoint){let vn=ln.caretRangeFromPoint(le,tn);vn&&({startContainer:yn,startOffset:_n}=vn,(!o.contentDOM.contains(yn)||browser.safari&&isSuspiciousSafariCaretResult(yn,_n,le)||browser.chrome&&isSuspiciousChromeCaretResult(yn,_n,le))&&(yn=void 0))}yn&&(_n=Math.min(maxOffset(yn),_n))}if(!yn||!o.docView.dom.contains(yn)){let vn=LineView.find(o.docView,sn);if(!vn)return an>z.top+z.height/2?z.to:z.from;({node:yn,offset:_n}=domPosAtCoords(vn.dom,le,tn))}let Pn=o.docView.nearest(yn);if(!Pn)return null;if(Pn.isWidget&&((b=Pn.dom)===null||b===void 0?void 0:b.nodeType)==1){let vn=Pn.dom.getBoundingClientRect();return e.y<vn.top||e.y<=vn.bottom&&e.x<=(vn.left+vn.right)/2?Pn.posAtStart:Pn.posAtEnd}else return Pn.localPosFromDOM(yn,_n)+Pn.posAtStart}function posAtCoordsImprecise(o,e,l,d,p){let b=Math.round((d-e.left)*o.defaultCharacterWidth);if(o.lineWrapping&&l.height>o.defaultLineHeight*1.5){let I=o.viewState.heightOracle.textHeight,z=Math.floor((p-l.top-(o.defaultLineHeight-I)*.5)/I);b+=z*o.viewState.heightOracle.lineLength}let R=o.state.sliceDoc(l.from,l.to);return l.from+findColumn(R,b,o.state.tabSize)}function isSuspiciousSafariCaretResult(o,e,l){let d;if(o.nodeType!=3||e!=(d=o.nodeValue.length))return!1;for(let p=o.nextSibling;p;p=p.nextSibling)if(p.nodeType!=1||p.nodeName!="BR")return!1;return textRange(o,d-1,d).getBoundingClientRect().left>l}function isSuspiciousChromeCaretResult(o,e,l){if(e!=0)return!1;for(let p=o;;){let b=p.parentNode;if(!b||b.nodeType!=1||b.firstChild!=p)return!1;if(b.classList.contains("cm-line"))break;p=b}let d=o.nodeType==1?o.getBoundingClientRect():textRange(o,0,Math.max(o.nodeValue.length,1)).getBoundingClientRect();return l-d.left>5}function blockAt(o,e){let l=o.lineBlockAt(e);if(Array.isArray(l.type)){for(let d of l.type)if(d.to>e||d.to==e&&(d.to==l.to||d.type==BlockType.Text))return d}return l}function moveToLineBoundary(o,e,l,d){let p=blockAt(o,e.head),b=!d||p.type!=BlockType.Text||!(o.lineWrapping||p.widgetLineBreaks)?null:o.coordsAtPos(e.assoc<0&&e.head>p.from?e.head-1:e.head);if(b){let R=o.dom.getBoundingClientRect(),I=o.textDirectionAt(p.from),z=o.posAtCoords({x:l==(I==Direction.LTR)?R.right-1:R.left+1,y:(b.top+b.bottom)/2});if(z!=null)return EditorSelection.cursor(z,l?-1:1)}return EditorSelection.cursor(l?p.to:p.from,l?-1:1)}function moveByChar$1(o,e,l,d){let p=o.state.doc.lineAt(e.head),b=o.bidiSpans(p),R=o.textDirectionAt(p.from);for(let I=e,z=null;;){let se=moveVisually(p,b,R,I,l),le=movedOver;if(!se){if(p.number==(l?o.state.doc.lines:1))return I;le=`
|
||
`,p=o.state.doc.line(p.number+(l?1:-1)),b=o.bidiSpans(p),se=o.visualLineSide(p,!l)}if(z){if(!z(le))return I}else{if(!d)return se;z=d(le)}I=se}}function byGroup(o,e,l){let d=o.state.charCategorizer(e),p=d(l);return b=>{let R=d(b);return p==CharCategory.Space&&(p=R),p==R}}function moveVertically(o,e,l,d){let p=e.head,b=l?1:-1;if(p==(l?o.state.doc.length:0))return EditorSelection.cursor(p,e.assoc);let R=e.goalColumn,I,z=o.contentDOM.getBoundingClientRect(),se=o.coordsAtPos(p,e.assoc||-1),le=o.documentTop;if(se)R==null&&(R=se.left-z.left),I=b<0?se.top:se.bottom;else{let sn=o.viewState.lineBlockAt(p);R==null&&(R=Math.min(z.right-z.left,o.defaultCharacterWidth*(p-sn.from))),I=(b<0?sn.top:sn.bottom)+le}let tn=z.left+R,an=d??o.viewState.heightOracle.textHeight>>1;for(let sn=0;;sn+=10){let ln=I+(an+sn)*b,un=posAtCoords(o,{x:tn,y:ln},!1,b);if(ln<z.top||ln>z.bottom||(b<0?un<p:un>p)){let pn=o.docView.coordsForChar(un),yn=!pn||ln<pn.top?-1:1;return EditorSelection.cursor(un,yn,void 0,R)}}}function skipAtomicRanges(o,e,l){for(;;){let d=0;for(let p of o)p.between(e-1,e+1,(b,R,I)=>{if(e>b&&e<R){let z=d||l||(e-b<R-e?-1:1);e=z<0?b:R,d=z}});if(!d)return e}}function skipAtoms(o,e,l){let d=skipAtomicRanges(o.state.facet(atomicRanges).map(p=>p(o)),l.from,e.head>l.from?-1:1);return d==l.from?l:EditorSelection.cursor(d,d<l.from?1:-1)}const LineBreakPlaceholder="";class DOMReader{constructor(e,l){this.points=e,this.text="",this.lineSeparator=l.facet(EditorState.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=LineBreakPlaceholder}readRange(e,l){if(!e)return this;let d=e.parentNode;for(let p=e;;){this.findPointBefore(d,p);let b=this.text.length;this.readNode(p);let R=p.nextSibling;if(R==l)break;let I=ContentView.get(p),z=ContentView.get(R);(I&&z?I.breakAfter:(I?I.breakAfter:isBlockElement(p))||isBlockElement(R)&&(p.nodeName!="BR"||p.cmIgnore)&&this.text.length>b)&&this.lineBreak(),p=R}return this.findPointBefore(d,l),this}readTextNode(e){let l=e.nodeValue;for(let d of this.points)d.node==e&&(d.pos=this.text.length+Math.min(d.offset,l.length));for(let d=0,p=this.lineSeparator?null:/\r\n?|\n/g;;){let b=-1,R=1,I;if(this.lineSeparator?(b=l.indexOf(this.lineSeparator,d),R=this.lineSeparator.length):(I=p.exec(l))&&(b=I.index,R=I[0].length),this.append(l.slice(d,b<0?l.length:b)),b<0)break;if(this.lineBreak(),R>1)for(let z of this.points)z.node==e&&z.pos>this.text.length&&(z.pos-=R-1);d=b+R}}readNode(e){if(e.cmIgnore)return;let l=ContentView.get(e),d=l&&l.overrideDOMText;if(d!=null){this.findPointInside(e,d.length);for(let p=d.iter();!p.next().done;)p.lineBreak?this.lineBreak():this.append(p.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,l){for(let d of this.points)d.node==e&&e.childNodes[d.offset]==l&&(d.pos=this.text.length)}findPointInside(e,l){for(let d of this.points)(e.nodeType==3?d.node==e:e.contains(d.node))&&(d.pos=this.text.length+(isAtEnd(e,d.node,d.offset)?l:0))}}function isAtEnd(o,e,l){for(;;){if(!e||l<maxOffset(e))return!1;if(e==o)return!0;l=domIndex(e)+1,e=e.parentNode}}class DOMPoint{constructor(e,l){this.node=e,this.offset=l,this.pos=-1}}class DOMChange{constructor(e,l,d,p){this.typeOver=p,this.bounds=null,this.text="",this.domChanged=l>-1;let{impreciseHead:b,impreciseAnchor:R}=e.docView;if(e.state.readOnly&&l>-1)this.newSel=null;else if(l>-1&&(this.bounds=e.docView.domBoundsAround(l,d,0))){let I=b||R?[]:selectionPoints(e),z=new DOMReader(I,e.state);z.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=z.text,this.newSel=selectionFromPoints(I,this.bounds.from)}else{let I=e.observer.selectionRange,z=b&&b.node==I.focusNode&&b.offset==I.focusOffset||!contains(e.contentDOM,I.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(I.focusNode,I.focusOffset),se=R&&R.node==I.anchorNode&&R.offset==I.anchorOffset||!contains(e.contentDOM,I.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(I.anchorNode,I.anchorOffset),le=e.viewport;if((browser.ios||browser.chrome)&&e.state.selection.main.empty&&z!=se&&(le.from>0||le.to<e.state.doc.length)){let tn=Math.min(z,se),an=Math.max(z,se),sn=le.from-tn,ln=le.to-an;(sn==0||sn==1||tn==0)&&(ln==0||ln==-1||an==e.state.doc.length)&&(z=0,se=e.state.doc.length)}this.newSel=EditorSelection.single(se,z)}}}function applyDOMChange(o,e){let l,{newSel:d}=e,p=o.state.selection.main,b=o.inputState.lastKeyTime>Date.now()-100?o.inputState.lastKeyCode:-1;if(e.bounds){let{from:R,to:I}=e.bounds,z=p.from,se=null;(b===8||browser.android&&e.text.length<I-R)&&(z=p.to,se="end");let le=findDiff(o.state.doc.sliceString(R,I,LineBreakPlaceholder),e.text,z-R,se);le&&(browser.chrome&&b==13&&le.toB==le.from+2&&e.text.slice(le.from,le.toB)==LineBreakPlaceholder+LineBreakPlaceholder&&le.toB--,l={from:R+le.from,to:R+le.toA,insert:Text$1.of(e.text.slice(le.from,le.toB).split(LineBreakPlaceholder))})}else d&&(!o.hasFocus&&o.state.facet(editable)||d.main.eq(p))&&(d=null);if(!l&&!d)return!1;if(!l&&e.typeOver&&!p.empty&&d&&d.main.empty?l={from:p.from,to:p.to,insert:o.state.doc.slice(p.from,p.to)}:(browser.mac||browser.android)&&l&&l.from==l.to&&l.from==p.head-1&&/^\. ?$/.test(l.insert.toString())&&o.contentDOM.getAttribute("autocorrect")=="off"?(d&&l.insert.length==2&&(d=EditorSelection.single(d.main.anchor-1,d.main.head-1)),l={from:l.from,to:l.to,insert:Text$1.of([l.insert.toString().replace("."," ")])}):l&&l.from>=p.from&&l.to<=p.to&&(l.from!=p.from||l.to!=p.to)&&p.to-p.from-(l.to-l.from)<=4?l={from:p.from,to:p.to,insert:o.state.doc.slice(p.from,l.from).append(l.insert).append(o.state.doc.slice(l.to,p.to))}:browser.chrome&&l&&l.from==l.to&&l.from==p.head&&l.insert.toString()==`
|
||
`&&o.lineWrapping&&(d&&(d=EditorSelection.single(d.main.anchor-1,d.main.head-1)),l={from:p.from,to:p.to,insert:Text$1.of([" "])}),l)return applyDOMChangeInner(o,l,d,b);if(d&&!d.main.eq(p)){let R=!1,I="select";return o.inputState.lastSelectionTime>Date.now()-50&&(o.inputState.lastSelectionOrigin=="select"&&(R=!0),I=o.inputState.lastSelectionOrigin),o.dispatch({selection:d,scrollIntoView:R,userEvent:I}),!0}else return!1}function applyDOMChangeInner(o,e,l,d=-1){if(browser.ios&&o.inputState.flushIOSKey(e))return!0;let p=o.state.selection.main;if(browser.android&&(e.to==p.to&&(e.from==p.from||e.from==p.from-1&&o.state.sliceDoc(e.from,p.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&dispatchKey(o.contentDOM,"Enter",13)||(e.from==p.from-1&&e.to==p.to&&e.insert.length==0||d==8&&e.insert.length<e.to-e.from&&e.to>p.head)&&dispatchKey(o.contentDOM,"Backspace",8)||e.from==p.from&&e.to==p.to+1&&e.insert.length==0&&dispatchKey(o.contentDOM,"Delete",46)))return!0;let b=e.insert.toString();o.inputState.composing>=0&&o.inputState.composing++;let R,I=()=>R||(R=applyDefaultInsert(o,e,l));return o.state.facet(inputHandler$1).some(z=>z(o,e.from,e.to,b,I))||o.dispatch(I()),!0}function applyDefaultInsert(o,e,l){let d,p=o.state,b=p.selection.main;if(e.from>=b.from&&e.to<=b.to&&e.to-e.from>=(b.to-b.from)/3&&(!l||l.main.empty&&l.main.from==e.from+e.insert.length)&&o.inputState.composing<0){let I=b.from<e.from?p.sliceDoc(b.from,e.from):"",z=b.to>e.to?p.sliceDoc(e.to,b.to):"";d=p.replaceSelection(o.state.toText(I+e.insert.sliceString(0,void 0,o.state.lineBreak)+z))}else{let I=p.changes(e),z=l&&l.main.to<=I.newLength?l.main:void 0;if(p.selection.ranges.length>1&&o.inputState.composing>=0&&e.to<=b.to&&e.to>=b.to-10){let se=o.state.sliceDoc(e.from,e.to),le,tn=l&&findCompositionNode(o,l.main.head);if(tn){let ln=e.insert.length-(e.to-e.from);le={from:tn.from,to:tn.to-ln}}else le=o.state.doc.lineAt(b.head);let an=b.to-e.to,sn=b.to-b.from;d=p.changeByRange(ln=>{if(ln.from==b.from&&ln.to==b.to)return{changes:I,range:z||ln.map(I)};let un=ln.to-an,pn=un-se.length;if(ln.to-ln.from!=sn||o.state.sliceDoc(pn,un)!=se||ln.to>=le.from&&ln.from<=le.to)return{range:ln};let yn=p.changes({from:pn,to:un,insert:e.insert}),_n=ln.to-b.to;return{changes:yn,range:z?EditorSelection.range(Math.max(0,z.anchor+_n),Math.max(0,z.head+_n)):ln.map(yn)}})}else d={changes:I,selection:z&&p.selection.replaceRange(z)}}let R="input.type";return(o.composing||o.inputState.compositionPendingChange&&o.inputState.compositionEndedAt>Date.now()-50)&&(o.inputState.compositionPendingChange=!1,R+=".compose",o.inputState.compositionFirstChange&&(R+=".start",o.inputState.compositionFirstChange=!1)),p.update(d,{userEvent:R,scrollIntoView:!0})}function findDiff(o,e,l,d){let p=Math.min(o.length,e.length),b=0;for(;b<p&&o.charCodeAt(b)==e.charCodeAt(b);)b++;if(b==p&&o.length==e.length)return null;let R=o.length,I=e.length;for(;R>0&&I>0&&o.charCodeAt(R-1)==e.charCodeAt(I-1);)R--,I--;if(d=="end"){let z=Math.max(0,b-Math.min(R,I));l-=R+z-b}if(R<b&&o.length<e.length){let z=l<=b&&l>=R?b-l:0;b-=z,I=b+(I-R),R=b}else if(I<b){let z=l<=b&&l>=I?b-l:0;b-=z,R=b+(R-I),I=b}return{from:b,toA:R,toB:I}}function selectionPoints(o){let e=[];if(o.root.activeElement!=o.contentDOM)return e;let{anchorNode:l,anchorOffset:d,focusNode:p,focusOffset:b}=o.observer.selectionRange;return l&&(e.push(new DOMPoint(l,d)),(p!=l||b!=d)&&e.push(new DOMPoint(p,b))),e}function selectionFromPoints(o,e){if(o.length==0)return null;let l=o[0].pos,d=o.length==2?o[1].pos:l;return l>-1&&d>-1?EditorSelection.single(l+e,d+e):null}class InputState{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,browser.safari&&e.contentDOM.addEventListener("input",()=>null),browser.gecko&&firefoxCopyCutHack(e.contentDOM.ownerDocument)}handleEvent(e){!eventBelongsToEditor(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,l){let d=this.handlers[e];if(d){for(let p of d.observers)p(this.view,l);for(let p of d.handlers){if(l.defaultPrevented)break;if(p(this.view,l)){l.preventDefault();break}}}}ensureHandlers(e){let l=computeHandlers(e),d=this.handlers,p=this.view.contentDOM;for(let b in l)if(b!="scroll"){let R=!l[b].handlers.length,I=d[b];I&&R!=!I.handlers.length&&(p.removeEventListener(b,this.handleEvent),I=null),I||p.addEventListener(b,this.handleEvent,{passive:R})}for(let b in d)b!="scroll"&&!l[b]&&p.removeEventListener(b,this.handleEvent);this.handlers=l}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&modifierCodes.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),browser.android&&browser.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let l;return browser.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((l=PendingKeys.find(d=>d.keyCode==e.keyCode))&&!e.ctrlKey||EmacsyPendingKeys.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=l||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let l=this.pendingIOSKey;return!l||l.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,dispatchKey(this.view.contentDOM,l.key,l.keyCode,l instanceof KeyboardEvent?l:void 0))}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:browser.safari&&!browser.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function bindHandler(o,e){return(l,d)=>{try{return e.call(o,d,l)}catch(p){logException(l.state,p)}}}function computeHandlers(o){let e=Object.create(null);function l(d){return e[d]||(e[d]={observers:[],handlers:[]})}for(let d of o){let p=d.spec;if(p&&p.domEventHandlers)for(let b in p.domEventHandlers){let R=p.domEventHandlers[b];R&&l(b).handlers.push(bindHandler(d.value,R))}if(p&&p.domEventObservers)for(let b in p.domEventObservers){let R=p.domEventObservers[b];R&&l(b).observers.push(bindHandler(d.value,R))}}for(let d in handlers$1)l(d).handlers.push(handlers$1[d]);for(let d in observers)l(d).observers.push(observers[d]);return e}const PendingKeys=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],EmacsyPendingKeys="dthko",modifierCodes=[16,17,18,20,91,92,224,225],dragScrollMargin=6;function dragScrollSpeed(o){return Math.max(0,o)*.7+8}function dist$2(o,e){return Math.max(Math.abs(o.clientX-e.clientX),Math.abs(o.clientY-e.clientY))}class MouseSelection{constructor(e,l,d,p){this.view=e,this.startEvent=l,this.style=d,this.mustSelect=p,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=l,this.scrollParents=scrollableParents(e.contentDOM),this.atoms=e.state.facet(atomicRanges).map(R=>R(e));let b=e.contentDOM.ownerDocument;b.addEventListener("mousemove",this.move=this.move.bind(this)),b.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=l.shiftKey,this.multiple=e.state.facet(EditorState.allowMultipleSelections)&&addsSelectionRange(e,l),this.dragging=isInPrimarySelection(e,l)&&getClickType(l)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&dist$2(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let l=0,d=0,p=0,b=0,R=this.view.win.innerWidth,I=this.view.win.innerHeight;this.scrollParents.x&&({left:p,right:R}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:b,bottom:I}=this.scrollParents.y.getBoundingClientRect());let z=getScrollMargins(this.view);e.clientX-z.left<=p+dragScrollMargin?l=-dragScrollSpeed(p-e.clientX):e.clientX+z.right>=R-dragScrollMargin&&(l=dragScrollSpeed(e.clientX-R)),e.clientY-z.top<=b+dragScrollMargin?d=-dragScrollSpeed(b-e.clientY):e.clientY+z.bottom>=I-dragScrollMargin&&(d=dragScrollSpeed(e.clientY-I)),this.setScrollSpeed(l,d)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,l){this.scrollSpeed={x:e,y:l},e||l?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:l}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),l&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=l,l=0),(e||l)&&this.view.win.scrollBy(e,l),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let l=null;for(let d=0;d<e.ranges.length;d++){let p=e.ranges[d],b=null;if(p.empty){let R=skipAtomicRanges(this.atoms,p.from,0);R!=p.from&&(b=EditorSelection.cursor(R,-1))}else{let R=skipAtomicRanges(this.atoms,p.from,-1),I=skipAtomicRanges(this.atoms,p.to,1);(R!=p.from||I!=p.to)&&(b=EditorSelection.range(p.from==p.anchor?R:I,p.from==p.head?R:I))}b&&(l||(l=e.ranges.slice()),l[d]=b)}return l?EditorSelection.create(l,e.mainIndex):e}select(e){let{view:l}=this,d=this.skipAtoms(this.style.get(e,this.extend,this.multiple));(this.mustSelect||!d.eq(l.state.selection,this.dragging===!1))&&this.view.dispatch({selection:d,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(l=>l.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function addsSelectionRange(o,e){let l=o.state.facet(clickAddsSelectionRange);return l.length?l[0](e):browser.mac?e.metaKey:e.ctrlKey}function dragMovesSelection(o,e){let l=o.state.facet(dragMovesSelection$1);return l.length?l[0](e):browser.mac?!e.altKey:!e.ctrlKey}function isInPrimarySelection(o,e){let{main:l}=o.state.selection;if(l.empty)return!1;let d=getSelection(o.root);if(!d||d.rangeCount==0)return!0;let p=d.getRangeAt(0).getClientRects();for(let b=0;b<p.length;b++){let R=p[b];if(R.left<=e.clientX&&R.right>=e.clientX&&R.top<=e.clientY&&R.bottom>=e.clientY)return!0}return!1}function eventBelongsToEditor(o,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let l=e.target,d;l!=o.contentDOM;l=l.parentNode)if(!l||l.nodeType==11||(d=ContentView.get(l))&&d.ignoreEvent(e))return!1;return!0}const handlers$1=Object.create(null),observers=Object.create(null),brokenClipboardAPI=browser.ie&&browser.ie_version<15||browser.ios&&browser.webkit_version<604;function capturePaste(o){let e=o.dom.parentNode;if(!e)return;let l=e.appendChild(document.createElement("textarea"));l.style.cssText="position: fixed; left: -10000px; top: 10px",l.focus(),setTimeout(()=>{o.focus(),l.remove(),doPaste(o,l.value)},50)}function textFilter(o,e,l){for(let d of o.facet(e))l=d(l,o);return l}function doPaste(o,e){e=textFilter(o.state,clipboardInputFilter,e);let{state:l}=o,d,p=1,b=l.toText(e),R=b.lines==l.selection.ranges.length;if(lastLinewiseCopy!=null&&l.selection.ranges.every(z=>z.empty)&&lastLinewiseCopy==b.toString()){let z=-1;d=l.changeByRange(se=>{let le=l.doc.lineAt(se.from);if(le.from==z)return{range:se};z=le.from;let tn=l.toText((R?b.line(p++).text:e)+l.lineBreak);return{changes:{from:le.from,insert:tn},range:EditorSelection.cursor(se.from+tn.length)}})}else R?d=l.changeByRange(z=>{let se=b.line(p++);return{changes:{from:z.from,to:z.to,insert:se.text},range:EditorSelection.cursor(z.from+se.length)}}):d=l.replaceSelection(b);o.dispatch(d,{userEvent:"input.paste",scrollIntoView:!0})}observers.scroll=o=>{o.inputState.lastScrollTop=o.scrollDOM.scrollTop,o.inputState.lastScrollLeft=o.scrollDOM.scrollLeft},handlers$1.keydown=(o,e)=>(o.inputState.setSelectionOrigin("select"),e.keyCode==27&&o.inputState.tabFocusMode!=0&&(o.inputState.tabFocusMode=Date.now()+2e3),!1),observers.touchstart=(o,e)=>{o.inputState.lastTouchTime=Date.now(),o.inputState.setSelectionOrigin("select.pointer")},observers.touchmove=o=>{o.inputState.setSelectionOrigin("select.pointer")},handlers$1.mousedown=(o,e)=>{if(o.observer.flush(),o.inputState.lastTouchTime>Date.now()-2e3)return!1;let l=null;for(let d of o.state.facet(mouseSelectionStyle))if(l=d(o,e),l)break;if(!l&&e.button==0&&(l=basicMouseSelection(o,e)),l){let d=!o.hasFocus;o.inputState.startMouseSelection(new MouseSelection(o,e,l,d)),d&&o.observer.ignore(()=>{focusPreventScroll(o.contentDOM);let b=o.root.activeElement;b&&!b.contains(o.contentDOM)&&b.blur()});let p=o.inputState.mouseSelection;if(p)return p.start(e),p.dragging===!1}return!1};function rangeForClick(o,e,l,d){if(d==1)return EditorSelection.cursor(e,l);if(d==2)return groupAt(o.state,e,l);{let p=LineView.find(o.docView,e),b=o.state.doc.lineAt(p?p.posAtEnd:e),R=p?p.posAtStart:b.from,I=p?p.posAtEnd:b.to;return I<o.state.doc.length&&I==b.to&&I++,EditorSelection.range(R,I)}}let inside=(o,e,l)=>e>=l.top&&e<=l.bottom&&o>=l.left&&o<=l.right;function findPositionSide(o,e,l,d){let p=LineView.find(o.docView,e);if(!p)return 1;let b=e-p.posAtStart;if(b==0)return 1;if(b==p.length)return-1;let R=p.coordsAt(b,-1);if(R&&inside(l,d,R))return-1;let I=p.coordsAt(b,1);return I&&inside(l,d,I)?1:R&&R.bottom>=d?-1:1}function queryPos(o,e){let l=o.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:l,bias:findPositionSide(o,l,e.clientX,e.clientY)}}const BadMouseDetail=browser.ie&&browser.ie_version<=11;let lastMouseDown=null,lastMouseDownCount=0,lastMouseDownTime=0;function getClickType(o){if(!BadMouseDetail)return o.detail;let e=lastMouseDown,l=lastMouseDownTime;return lastMouseDown=o,lastMouseDownTime=Date.now(),lastMouseDownCount=!e||l>Date.now()-400&&Math.abs(e.clientX-o.clientX)<2&&Math.abs(e.clientY-o.clientY)<2?(lastMouseDownCount+1)%3:1}function basicMouseSelection(o,e){let l=queryPos(o,e),d=getClickType(e),p=o.state.selection;return{update(b){b.docChanged&&(l.pos=b.changes.mapPos(l.pos),p=p.map(b.changes))},get(b,R,I){let z=queryPos(o,b),se,le=rangeForClick(o,z.pos,z.bias,d);if(l.pos!=z.pos&&!R){let tn=rangeForClick(o,l.pos,l.bias,d),an=Math.min(tn.from,le.from),sn=Math.max(tn.to,le.to);le=an<le.from?EditorSelection.range(an,sn):EditorSelection.range(sn,an)}return R?p.replaceRange(p.main.extend(le.from,le.to)):I&&d==1&&p.ranges.length>1&&(se=removeRangeAround(p,z.pos))?se:I?p.addRange(le):EditorSelection.create([le])}}}function removeRangeAround(o,e){for(let l=0;l<o.ranges.length;l++){let{from:d,to:p}=o.ranges[l];if(d<=e&&p>=e)return EditorSelection.create(o.ranges.slice(0,l).concat(o.ranges.slice(l+1)),o.mainIndex==l?0:o.mainIndex-(o.mainIndex>l?1:0))}return null}handlers$1.dragstart=(o,e)=>{let{selection:{main:l}}=o.state;if(e.target.draggable){let p=o.docView.nearest(e.target);if(p&&p.isWidget){let b=p.posAtStart,R=b+p.length;(b>=l.to||R<=l.from)&&(l=EditorSelection.range(b,R))}}let{inputState:d}=o;return d.mouseSelection&&(d.mouseSelection.dragging=!0),d.draggedContent=l,e.dataTransfer&&(e.dataTransfer.setData("Text",textFilter(o.state,clipboardOutputFilter,o.state.sliceDoc(l.from,l.to))),e.dataTransfer.effectAllowed="copyMove"),!1},handlers$1.dragend=o=>(o.inputState.draggedContent=null,!1);function dropText(o,e,l,d){if(l=textFilter(o.state,clipboardInputFilter,l),!l)return;let p=o.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:b}=o.inputState,R=d&&b&&dragMovesSelection(o,e)?{from:b.from,to:b.to}:null,I={from:p,insert:l},z=o.state.changes(R?[R,I]:I);o.focus(),o.dispatch({changes:z,selection:{anchor:z.mapPos(p,-1),head:z.mapPos(p,1)},userEvent:R?"move.drop":"input.drop"}),o.inputState.draggedContent=null}handlers$1.drop=(o,e)=>{if(!e.dataTransfer)return!1;if(o.state.readOnly)return!0;let l=e.dataTransfer.files;if(l&&l.length){let d=Array(l.length),p=0,b=()=>{++p==l.length&&dropText(o,e,d.filter(R=>R!=null).join(o.state.lineBreak),!1)};for(let R=0;R<l.length;R++){let I=new FileReader;I.onerror=b,I.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(I.result)||(d[R]=I.result),b()},I.readAsText(l[R])}return!0}else{let d=e.dataTransfer.getData("Text");if(d)return dropText(o,e,d,!0),!0}return!1},handlers$1.paste=(o,e)=>{if(o.state.readOnly)return!0;o.observer.flush();let l=brokenClipboardAPI?null:e.clipboardData;return l?(doPaste(o,l.getData("text/plain")||l.getData("text/uri-list")),!0):(capturePaste(o),!1)};function captureCopy(o,e){let l=o.dom.parentNode;if(!l)return;let d=l.appendChild(document.createElement("textarea"));d.style.cssText="position: fixed; left: -10000px; top: 10px",d.value=e,d.focus(),d.selectionEnd=e.length,d.selectionStart=0,setTimeout(()=>{d.remove(),o.focus()},50)}function copiedRange(o){let e=[],l=[],d=!1;for(let p of o.selection.ranges)p.empty||(e.push(o.sliceDoc(p.from,p.to)),l.push(p));if(!e.length){let p=-1;for(let{from:b}of o.selection.ranges){let R=o.doc.lineAt(b);R.number>p&&(e.push(R.text),l.push({from:R.from,to:Math.min(o.doc.length,R.to+1)})),p=R.number}d=!0}return{text:textFilter(o,clipboardOutputFilter,e.join(o.lineBreak)),ranges:l,linewise:d}}let lastLinewiseCopy=null;handlers$1.copy=handlers$1.cut=(o,e)=>{let{text:l,ranges:d,linewise:p}=copiedRange(o.state);if(!l&&!p)return!1;lastLinewiseCopy=p?l:null,e.type=="cut"&&!o.state.readOnly&&o.dispatch({changes:d,scrollIntoView:!0,userEvent:"delete.cut"});let b=brokenClipboardAPI?null:e.clipboardData;return b?(b.clearData(),b.setData("text/plain",l),!0):(captureCopy(o,l),!1)};const isFocusChange=Annotation.define();function focusChangeTransaction(o,e){let l=[];for(let d of o.facet(focusChangeEffect)){let p=d(o,e);p&&l.push(p)}return l?o.update({effects:l,annotations:isFocusChange.of(!0)}):null}function updateForFocusChange(o){setTimeout(()=>{let e=o.hasFocus;if(e!=o.inputState.notifiedFocused){let l=focusChangeTransaction(o.state,e);l?o.dispatch(l):o.update([])}},10)}observers.focus=o=>{o.inputState.lastFocusTime=Date.now(),!o.scrollDOM.scrollTop&&(o.inputState.lastScrollTop||o.inputState.lastScrollLeft)&&(o.scrollDOM.scrollTop=o.inputState.lastScrollTop,o.scrollDOM.scrollLeft=o.inputState.lastScrollLeft),updateForFocusChange(o)},observers.blur=o=>{o.observer.clearSelectionRange(),updateForFocusChange(o)},observers.compositionstart=observers.compositionupdate=o=>{o.observer.editContext||(o.inputState.compositionFirstChange==null&&(o.inputState.compositionFirstChange=!0),o.inputState.composing<0&&(o.inputState.composing=0))},observers.compositionend=o=>{o.observer.editContext||(o.inputState.composing=-1,o.inputState.compositionEndedAt=Date.now(),o.inputState.compositionPendingKey=!0,o.inputState.compositionPendingChange=o.observer.pendingRecords().length>0,o.inputState.compositionFirstChange=null,browser.chrome&&browser.android?o.observer.flushSoon():o.inputState.compositionPendingChange?Promise.resolve().then(()=>o.observer.flush()):setTimeout(()=>{o.inputState.composing<0&&o.docView.hasComposition&&o.update([])},50))},observers.contextmenu=o=>{o.inputState.lastContextMenu=Date.now()},handlers$1.beforeinput=(o,e)=>{var l,d;if(e.inputType=="insertReplacementText"&&o.observer.editContext){let b=(l=e.dataTransfer)===null||l===void 0?void 0:l.getData("text/plain"),R=e.getTargetRanges();if(b&&R.length){let I=R[0],z=o.posAtDOM(I.startContainer,I.startOffset),se=o.posAtDOM(I.endContainer,I.endOffset);return applyDOMChangeInner(o,{from:z,to:se,insert:o.state.toText(b)},null),!0}}let p;if(browser.chrome&&browser.android&&(p=PendingKeys.find(b=>b.inputType==e.inputType))&&(o.observer.delayAndroidKey(p.key,p.keyCode),p.key=="Backspace"||p.key=="Delete")){let b=((d=window.visualViewport)===null||d===void 0?void 0:d.height)||0;setTimeout(()=>{var R;(((R=window.visualViewport)===null||R===void 0?void 0:R.height)||0)>b+10&&o.hasFocus&&(o.contentDOM.blur(),o.focus())},100)}return browser.ios&&e.inputType=="deleteContentForward"&&o.observer.flushSoon(),browser.safari&&e.inputType=="insertText"&&o.inputState.composing>=0&&setTimeout(()=>observers.compositionend(o,e),20),!1};const appliedFirefoxHack=new Set;function firefoxCopyCutHack(o){appliedFirefoxHack.has(o)||(appliedFirefoxHack.add(o),o.addEventListener("copy",()=>{}),o.addEventListener("cut",()=>{}))}const wrappingWhiteSpace=["pre-wrap","normal","pre-line","break-spaces"];let heightChangeFlag=!1;function clearHeightChangeFlag(){heightChangeFlag=!1}class HeightOracle{constructor(e){this.lineWrapping=e,this.doc=Text$1.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,l){let d=this.doc.lineAt(l).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(d+=Math.max(0,Math.ceil((l-e-d*this.lineLength*.5)/this.lineLength))),this.lineHeight*d}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return wrappingWhiteSpace.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let l=!1;for(let d=0;d<e.length;d++){let p=e[d];p<0?d++:this.heightSamples[Math.floor(p*10)]||(l=!0,this.heightSamples[Math.floor(p*10)]=!0)}return l}refresh(e,l,d,p,b,R){let I=wrappingWhiteSpace.indexOf(e)>-1,z=Math.round(l)!=Math.round(this.lineHeight)||this.lineWrapping!=I;if(this.lineWrapping=I,this.lineHeight=l,this.charWidth=d,this.textHeight=p,this.lineLength=b,z){this.heightSamples={};for(let se=0;se<R.length;se++){let le=R[se];le<0?se++:this.heightSamples[Math.floor(le*10)]=!0}}return z}}class MeasuredHeights{constructor(e,l){this.from=e,this.heights=l,this.index=0}get more(){return this.index<this.heights.length}}class BlockInfo{constructor(e,l,d,p,b){this.from=e,this.length=l,this.top=d,this.height=p,this._content=b}get type(){return typeof this._content=="number"?BlockType.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof PointDecoration?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let l=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new BlockInfo(this.from,this.length+e.length,this.top,this.height+e.height,l)}}var QueryType$1=function(o){return o[o.ByPos=0]="ByPos",o[o.ByHeight=1]="ByHeight",o[o.ByPosNoHeight=2]="ByPosNoHeight",o}(QueryType$1||(QueryType$1={}));const Epsilon=.001;class HeightMap{constructor(e,l,d=2){this.length=e,this.height=l,this.flags=d}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Epsilon&&(heightChangeFlag=!0),this.height=e)}replace(e,l,d){return HeightMap.of(d)}decomposeLeft(e,l){l.push(this)}decomposeRight(e,l){l.push(this)}applyChanges(e,l,d,p){let b=this,R=d.doc;for(let I=p.length-1;I>=0;I--){let{fromA:z,toA:se,fromB:le,toB:tn}=p[I],an=b.lineAt(z,QueryType$1.ByPosNoHeight,d.setDoc(l),0,0),sn=an.to>=se?an:b.lineAt(se,QueryType$1.ByPosNoHeight,d,0,0);for(tn+=sn.to-se,se=sn.to;I>0&&an.from<=p[I-1].toA;)z=p[I-1].fromA,le=p[I-1].fromB,I--,z<an.from&&(an=b.lineAt(z,QueryType$1.ByPosNoHeight,d,0,0));le+=an.from-z,z=an.from;let ln=NodeBuilder.build(d.setDoc(R),e,le,tn);b=replace(b,b.replace(z,se,ln))}return b.updateHeight(d,0)}static empty(){return new HeightMapText(0,0)}static of(e){if(e.length==1)return e[0];let l=0,d=e.length,p=0,b=0;for(;;)if(l==d)if(p>b*2){let I=e[l-1];I.break?e.splice(--l,1,I.left,null,I.right):e.splice(--l,1,I.left,I.right),d+=1+I.break,p-=I.size}else if(b>p*2){let I=e[d];I.break?e.splice(d,1,I.left,null,I.right):e.splice(d,1,I.left,I.right),d+=2+I.break,b-=I.size}else break;else if(p<b){let I=e[l++];I&&(p+=I.size)}else{let I=e[--d];I&&(b+=I.size)}let R=0;return e[l-1]==null?(R=1,l--):e[l]==null&&(R=1,d++),new HeightMapBranch(HeightMap.of(e.slice(0,l)),R,HeightMap.of(e.slice(d)))}}function replace(o,e){return o==e?o:(o.constructor!=e.constructor&&(heightChangeFlag=!0),e)}HeightMap.prototype.size=1;class HeightMapBlock extends HeightMap{constructor(e,l,d){super(e,l),this.deco=d}blockAt(e,l,d,p){return new BlockInfo(p,this.length,d,this.height,this.deco||0)}lineAt(e,l,d,p,b){return this.blockAt(0,d,p,b)}forEachLine(e,l,d,p,b,R){e<=b+this.length&&l>=b&&R(this.blockAt(0,d,p,b))}updateHeight(e,l=0,d=!1,p){return p&&p.from<=l&&p.more&&this.setHeight(p.heights[p.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class HeightMapText extends HeightMapBlock{constructor(e,l){super(e,l,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,l,d,p){return new BlockInfo(p,this.length,d,this.height,this.breaks)}replace(e,l,d){let p=d[0];return d.length==1&&(p instanceof HeightMapText||p instanceof HeightMapGap&&p.flags&4)&&Math.abs(this.length-p.length)<10?(p instanceof HeightMapGap?p=new HeightMapText(p.length,this.height):p.height=this.height,this.outdated||(p.outdated=!1),p):HeightMap.of(d)}updateHeight(e,l=0,d=!1,p){return p&&p.from<=l&&p.more?this.setHeight(p.heights[p.index++]):(d||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class HeightMapGap extends HeightMap{constructor(e){super(e,0)}heightMetrics(e,l){let d=e.doc.lineAt(l).number,p=e.doc.lineAt(l+this.length).number,b=p-d+1,R,I=0;if(e.lineWrapping){let z=Math.min(this.height,e.lineHeight*b);R=z/b,this.length>b+1&&(I=(this.height-z)/(this.length-b-1))}else R=this.height/b;return{firstLine:d,lastLine:p,perLine:R,perChar:I}}blockAt(e,l,d,p){let{firstLine:b,lastLine:R,perLine:I,perChar:z}=this.heightMetrics(l,p);if(l.lineWrapping){let se=p+(e<l.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-d)/this.height))*this.length)),le=l.doc.lineAt(se),tn=I+le.length*z,an=Math.max(d,e-tn/2);return new BlockInfo(le.from,le.length,an,tn,0)}else{let se=Math.max(0,Math.min(R-b,Math.floor((e-d)/I))),{from:le,length:tn}=l.doc.line(b+se);return new BlockInfo(le,tn,d+I*se,I,0)}}lineAt(e,l,d,p,b){if(l==QueryType$1.ByHeight)return this.blockAt(e,d,p,b);if(l==QueryType$1.ByPosNoHeight){let{from:sn,to:ln}=d.doc.lineAt(e);return new BlockInfo(sn,ln-sn,0,0,0)}let{firstLine:R,perLine:I,perChar:z}=this.heightMetrics(d,b),se=d.doc.lineAt(e),le=I+se.length*z,tn=se.number-R,an=p+I*tn+z*(se.from-b-tn);return new BlockInfo(se.from,se.length,Math.max(p,Math.min(an,p+this.height-le)),le,0)}forEachLine(e,l,d,p,b,R){e=Math.max(e,b),l=Math.min(l,b+this.length);let{firstLine:I,perLine:z,perChar:se}=this.heightMetrics(d,b);for(let le=e,tn=p;le<=l;){let an=d.doc.lineAt(le);if(le==e){let ln=an.number-I;tn+=z*ln+se*(e-b-ln)}let sn=z+se*an.length;R(new BlockInfo(an.from,an.length,tn,sn,0)),tn+=sn,le=an.to+1}}replace(e,l,d){let p=this.length-l;if(p>0){let b=d[d.length-1];b instanceof HeightMapGap?d[d.length-1]=new HeightMapGap(b.length+p):d.push(null,new HeightMapGap(p-1))}if(e>0){let b=d[0];b instanceof HeightMapGap?d[0]=new HeightMapGap(e+b.length):d.unshift(new HeightMapGap(e-1),null)}return HeightMap.of(d)}decomposeLeft(e,l){l.push(new HeightMapGap(e-1),null)}decomposeRight(e,l){l.push(null,new HeightMapGap(this.length-e-1))}updateHeight(e,l=0,d=!1,p){let b=l+this.length;if(p&&p.from<=l+this.length&&p.more){let R=[],I=Math.max(l,p.from),z=-1;for(p.from>l&&R.push(new HeightMapGap(p.from-l-1).updateHeight(e,l));I<=b&&p.more;){let le=e.doc.lineAt(I).length;R.length&&R.push(null);let tn=p.heights[p.index++];z==-1?z=tn:Math.abs(tn-z)>=Epsilon&&(z=-2);let an=new HeightMapText(le,tn);an.outdated=!1,R.push(an),I+=le+1}I<=b&&R.push(null,new HeightMapGap(b-I).updateHeight(e,I));let se=HeightMap.of(R);return(z<0||Math.abs(se.height-this.height)>=Epsilon||Math.abs(z-this.heightMetrics(e,l).perLine)>=Epsilon)&&(heightChangeFlag=!0),replace(this,se)}else(d||this.outdated)&&(this.setHeight(e.heightForGap(l,l+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class HeightMapBranch extends HeightMap{constructor(e,l,d){super(e.length+l+d.length,e.height+d.height,l|(e.outdated||d.outdated?2:0)),this.left=e,this.right=d,this.size=e.size+d.size}get break(){return this.flags&1}blockAt(e,l,d,p){let b=d+this.left.height;return e<b?this.left.blockAt(e,l,d,p):this.right.blockAt(e,l,b,p+this.left.length+this.break)}lineAt(e,l,d,p,b){let R=p+this.left.height,I=b+this.left.length+this.break,z=l==QueryType$1.ByHeight?e<R:e<I,se=z?this.left.lineAt(e,l,d,p,b):this.right.lineAt(e,l,d,R,I);if(this.break||(z?se.to<I:se.from>I))return se;let le=l==QueryType$1.ByPosNoHeight?QueryType$1.ByPosNoHeight:QueryType$1.ByPos;return z?se.join(this.right.lineAt(I,le,d,R,I)):this.left.lineAt(I,le,d,p,b).join(se)}forEachLine(e,l,d,p,b,R){let I=p+this.left.height,z=b+this.left.length+this.break;if(this.break)e<z&&this.left.forEachLine(e,l,d,p,b,R),l>=z&&this.right.forEachLine(e,l,d,I,z,R);else{let se=this.lineAt(z,QueryType$1.ByPos,d,p,b);e<se.from&&this.left.forEachLine(e,se.from-1,d,p,b,R),se.to>=e&&se.from<=l&&R(se),l>se.to&&this.right.forEachLine(se.to+1,l,d,I,z,R)}}replace(e,l,d){let p=this.left.length+this.break;if(l<p)return this.balanced(this.left.replace(e,l,d),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-p,l-p,d));let b=[];e>0&&this.decomposeLeft(e,b);let R=b.length;for(let I of d)b.push(I);if(e>0&&mergeGaps(b,R-1),l<this.length){let I=b.length;this.decomposeRight(l,b),mergeGaps(b,I)}return HeightMap.of(b)}decomposeLeft(e,l){let d=this.left.length;if(e<=d)return this.left.decomposeLeft(e,l);l.push(this.left),this.break&&(d++,e>=d&&l.push(null)),e>d&&this.right.decomposeLeft(e-d,l)}decomposeRight(e,l){let d=this.left.length,p=d+this.break;if(e>=p)return this.right.decomposeRight(e-p,l);e<d&&this.left.decomposeRight(e,l),this.break&&e<p&&l.push(null),l.push(this.right)}balanced(e,l){return e.size>2*l.size||l.size>2*e.size?HeightMap.of(this.break?[e,null,l]:[e,l]):(this.left=replace(this.left,e),this.right=replace(this.right,l),this.setHeight(e.height+l.height),this.outdated=e.outdated||l.outdated,this.size=e.size+l.size,this.length=e.length+this.break+l.length,this)}updateHeight(e,l=0,d=!1,p){let{left:b,right:R}=this,I=l+b.length+this.break,z=null;return p&&p.from<=l+b.length&&p.more?z=b=b.updateHeight(e,l,d,p):b.updateHeight(e,l,d),p&&p.from<=I+R.length&&p.more?z=R=R.updateHeight(e,I,d,p):R.updateHeight(e,I,d),z?this.balanced(b,R):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function mergeGaps(o,e){let l,d;o[e]==null&&(l=o[e-1])instanceof HeightMapGap&&(d=o[e+1])instanceof HeightMapGap&&o.splice(e-1,3,new HeightMapGap(l.length+1+d.length))}const relevantWidgetHeight=5;class NodeBuilder{constructor(e,l){this.pos=e,this.oracle=l,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,l){if(this.lineStart>-1){let d=Math.min(l,this.lineEnd),p=this.nodes[this.nodes.length-1];p instanceof HeightMapText?p.length+=d-this.pos:(d>this.pos||!this.isCovered)&&this.nodes.push(new HeightMapText(d-this.pos,-1)),this.writtenTo=d,l>d&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=l}point(e,l,d){if(e<l||d.heightRelevant){let p=d.widget?d.widget.estimatedHeight:0,b=d.widget?d.widget.lineBreaks:0;p<0&&(p=this.oracle.lineHeight);let R=l-e;d.block?this.addBlock(new HeightMapBlock(R,p,d)):(R||b||p>=relevantWidgetHeight)&&this.addLineDeco(p,b,R)}else l>e&&this.span(e,l);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:l}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=l,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new HeightMapText(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,l){let d=new HeightMapGap(l-e);return this.oracle.doc.lineAt(e).to==l&&(d.flags|=4),d}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof HeightMapText)return e;let l=new HeightMapText(0,-1);return this.nodes.push(l),l}addBlock(e){this.enterLine();let l=e.deco;l&&l.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,l&&l.endSide>0&&(this.covering=e)}addLineDeco(e,l,d){let p=this.ensureLine();p.length+=d,p.collapsed+=d,p.widgetHeight=Math.max(p.widgetHeight,e),p.breaks+=l,this.writtenTo=this.pos=this.pos+d}finish(e){let l=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(l instanceof HeightMapText)&&!this.isCovered?this.nodes.push(new HeightMapText(0,-1)):(this.writtenTo<this.pos||l==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let d=e;for(let p of this.nodes)p instanceof HeightMapText&&p.updateHeight(this.oracle,d),d+=p?p.length:1;return this.nodes}static build(e,l,d,p){let b=new NodeBuilder(d,e);return RangeSet.spans(l,d,p,b,0),b.finish(d)}}function heightRelevantDecoChanges(o,e,l){let d=new DecorationComparator;return RangeSet.compare(o,e,l,d,0),d.changes}class DecorationComparator{constructor(){this.changes=[]}compareRange(){}comparePoint(e,l,d,p){(e<l||d&&d.heightRelevant||p&&p.heightRelevant)&&addRange(e,l,this.changes,5)}}function visiblePixelRange(o,e){let l=o.getBoundingClientRect(),d=o.ownerDocument,p=d.defaultView||window,b=Math.max(0,l.left),R=Math.min(p.innerWidth,l.right),I=Math.max(0,l.top),z=Math.min(p.innerHeight,l.bottom);for(let se=o.parentNode;se&&se!=d.body;)if(se.nodeType==1){let le=se,tn=window.getComputedStyle(le);if((le.scrollHeight>le.clientHeight||le.scrollWidth>le.clientWidth)&&tn.overflow!="visible"){let an=le.getBoundingClientRect();b=Math.max(b,an.left),R=Math.min(R,an.right),I=Math.max(I,an.top),z=Math.min(se==o.parentNode?p.innerHeight:z,an.bottom)}se=tn.position=="absolute"||tn.position=="fixed"?le.offsetParent:le.parentNode}else if(se.nodeType==11)se=se.host;else break;return{left:b-l.left,right:Math.max(b,R)-l.left,top:I-(l.top+e),bottom:Math.max(I,z)-(l.top+e)}}function inWindow(o){let e=o.getBoundingClientRect(),l=o.ownerDocument.defaultView||window;return e.left<l.innerWidth&&e.right>0&&e.top<l.innerHeight&&e.bottom>0}function fullPixelRange(o,e){let l=o.getBoundingClientRect();return{left:0,right:l.right-l.left,top:e,bottom:l.bottom-(l.top+e)}}class LineGap{constructor(e,l,d,p){this.from=e,this.to=l,this.size=d,this.displaySize=p}static same(e,l){if(e.length!=l.length)return!1;for(let d=0;d<e.length;d++){let p=e[d],b=l[d];if(p.from!=b.from||p.to!=b.to||p.size!=b.size)return!1}return!0}draw(e,l){return Decoration.replace({widget:new LineGapWidget(this.displaySize*(l?e.scaleY:e.scaleX),l)}).range(this.from,this.to)}}class LineGapWidget extends WidgetType{constructor(e,l){super(),this.size=e,this.vertical=l}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class ViewState{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=IdScaler,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Direction.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let l=e.facet(contentAttributes).some(d=>typeof d!="function"&&d.class=="cm-lineWrapping");this.heightOracle=new HeightOracle(l),this.stateDeco=e.facet(decorations).filter(d=>typeof d!="function"),this.heightMap=HeightMap.empty().applyChanges(this.stateDeco,Text$1.empty,this.heightOracle.setDoc(e.doc),[new ChangedRange(0,0,0,e.doc.length)]);for(let d=0;d<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());d++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Decoration.set(this.lineGaps.map(d=>d.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:l}=this.state.selection;for(let d=0;d<=1;d++){let p=d?l.head:l.anchor;if(!e.some(({from:b,to:R})=>p>=b&&p<=R)){let{from:b,to:R}=this.lineBlockAt(p);e.push(new Viewport(b,R))}}return this.viewports=e.sort((d,p)=>d.from-p.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?IdScaler:new BigScaler(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(scaleBlock(e,this.scaler))})}update(e,l=null){this.state=e.state;let d=this.stateDeco;this.stateDeco=this.state.facet(decorations).filter(le=>typeof le!="function");let p=e.changedRanges,b=ChangedRange.extendWithRanges(p,heightRelevantDecoChanges(d,this.stateDeco,e?e.changes:ChangeSet.empty(this.state.doc.length))),R=this.heightMap.height,I=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);clearHeightChangeFlag(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),b),(this.heightMap.height!=R||heightChangeFlag)&&(e.flags|=2),I?(this.scrollAnchorPos=e.changes.mapPos(I.from,-1),this.scrollAnchorHeight=I.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let z=b.length?this.mapViewport(this.viewport,e.changes):this.viewport;(l&&(l.range.head<z.from||l.range.head>z.to)||!this.viewportIsAppropriate(z))&&(z=this.getViewport(0,l));let se=z.from!=this.viewport.from||z.to!=this.viewport.to;this.viewport=z,e.flags|=this.updateForViewport(),(se||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),l&&(this.scrollTarget=l),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(nativeSelectionHidden)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let l=e.contentDOM,d=window.getComputedStyle(l),p=this.heightOracle,b=d.whiteSpace;this.defaultTextDirection=d.direction=="rtl"?Direction.RTL:Direction.LTR;let R=this.heightOracle.mustRefreshForWrapping(b),I=l.getBoundingClientRect(),z=R||this.mustMeasureContent||this.contentDOMHeight!=I.height;this.contentDOMHeight=I.height,this.mustMeasureContent=!1;let se=0,le=0;if(I.width&&I.height){let{scaleX:vn,scaleY:bn}=getScale$1(l,I);(vn>.005&&Math.abs(this.scaleX-vn)>.005||bn>.005&&Math.abs(this.scaleY-bn)>.005)&&(this.scaleX=vn,this.scaleY=bn,se|=16,R=z=!0)}let tn=(parseInt(d.paddingTop)||0)*this.scaleY,an=(parseInt(d.paddingBottom)||0)*this.scaleY;(this.paddingTop!=tn||this.paddingBottom!=an)&&(this.paddingTop=tn,this.paddingBottom=an,se|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(p.lineWrapping&&(z=!0),this.editorWidth=e.scrollDOM.clientWidth,se|=16);let sn=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=sn&&(this.scrollAnchorHeight=-1,this.scrollTop=sn),this.scrolledToBottom=isScrolledToBottom(e.scrollDOM);let ln=(this.printing?fullPixelRange:visiblePixelRange)(l,this.paddingTop),un=ln.top-this.pixelViewport.top,pn=ln.bottom-this.pixelViewport.bottom;this.pixelViewport=ln;let yn=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(yn!=this.inView&&(this.inView=yn,yn&&(z=!0)),!this.inView&&!this.scrollTarget&&!inWindow(e.dom))return 0;let _n=I.width;if((this.contentDOMWidth!=_n||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=I.width,this.editorHeight=e.scrollDOM.clientHeight,se|=16),z){let vn=e.docView.measureVisibleLineHeights(this.viewport);if(p.mustRefreshForHeights(vn)&&(R=!0),R||p.lineWrapping&&Math.abs(_n-this.contentDOMWidth)>p.charWidth){let{lineHeight:bn,charWidth:Sn,textHeight:An}=e.docView.measureTextSize();R=bn>0&&p.refresh(b,bn,Sn,An,_n/Sn,vn),R&&(e.docView.minWidth=0,se|=16)}un>0&&pn>0?le=Math.max(un,pn):un<0&&pn<0&&(le=Math.min(un,pn)),clearHeightChangeFlag();for(let bn of this.viewports){let Sn=bn.from==this.viewport.from?vn:e.docView.measureVisibleLineHeights(bn);this.heightMap=(R?HeightMap.empty().applyChanges(this.stateDeco,Text$1.empty,this.heightOracle,[new ChangedRange(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(p,0,R,new MeasuredHeights(bn.from,Sn))}heightChangeFlag&&(se|=2)}let Pn=!this.viewportIsAppropriate(this.viewport,le)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return Pn&&(se&2&&(se|=this.updateScaler()),this.viewport=this.getViewport(le,this.scrollTarget),se|=this.updateForViewport()),(se&2||Pn)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(R?[]:this.lineGaps,e)),se|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),se}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,l){let d=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),p=this.heightMap,b=this.heightOracle,{visibleTop:R,visibleBottom:I}=this,z=new Viewport(p.lineAt(R-d*1e3,QueryType$1.ByHeight,b,0,0).from,p.lineAt(I+(1-d)*1e3,QueryType$1.ByHeight,b,0,0).to);if(l){let{head:se}=l.range;if(se<z.from||se>z.to){let le=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),tn=p.lineAt(se,QueryType$1.ByPos,b,0,0),an;l.y=="center"?an=(tn.top+tn.bottom)/2-le/2:l.y=="start"||l.y=="nearest"&&se<z.from?an=tn.top:an=tn.bottom-le,z=new Viewport(p.lineAt(an-500,QueryType$1.ByHeight,b,0,0).from,p.lineAt(an+le+500,QueryType$1.ByHeight,b,0,0).to)}}return z}mapViewport(e,l){let d=l.mapPos(e.from,-1),p=l.mapPos(e.to,1);return new Viewport(this.heightMap.lineAt(d,QueryType$1.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(p,QueryType$1.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:l},d=0){if(!this.inView)return!0;let{top:p}=this.heightMap.lineAt(e,QueryType$1.ByPos,this.heightOracle,0,0),{bottom:b}=this.heightMap.lineAt(l,QueryType$1.ByPos,this.heightOracle,0,0),{visibleTop:R,visibleBottom:I}=this;return(e==0||p<=R-Math.max(10,Math.min(-d,250)))&&(l==this.state.doc.length||b>=I+Math.max(10,Math.min(d,250)))&&p>R-2e3&&b<I+2e3}mapLineGaps(e,l){if(!e.length||l.empty)return e;let d=[];for(let p of e)l.touchesRange(p.from,p.to)||d.push(new LineGap(l.mapPos(p.from),l.mapPos(p.to),p.size,p.displaySize));return d}ensureLineGaps(e,l){let d=this.heightOracle.lineWrapping,p=d?1e4:2e3,b=p>>1,R=p<<1;if(this.defaultTextDirection!=Direction.LTR&&!d)return[];let I=[],z=(le,tn,an,sn)=>{if(tn-le<b)return;let ln=this.state.selection.main,un=[ln.from];ln.empty||un.push(ln.to);for(let yn of un)if(yn>le&&yn<tn){z(le,yn-10,an,sn),z(yn+10,tn,an,sn);return}let pn=find(e,yn=>yn.from>=an.from&&yn.to<=an.to&&Math.abs(yn.from-le)<b&&Math.abs(yn.to-tn)<b&&!un.some(_n=>yn.from<_n&&yn.to>_n));if(!pn){if(tn<an.to&&l&&d&&l.visibleRanges.some(Pn=>Pn.from<=tn&&Pn.to>=tn)){let Pn=l.moveToLineBoundary(EditorSelection.cursor(tn),!1,!0).head;Pn>le&&(tn=Pn)}let yn=this.gapSize(an,le,tn,sn),_n=d||yn<2e6?yn:2e6;pn=new LineGap(le,tn,yn,_n)}I.push(pn)},se=le=>{if(le.length<R||le.type!=BlockType.Text)return;let tn=lineStructure(le.from,le.to,this.stateDeco);if(tn.total<R)return;let an=this.scrollTarget?this.scrollTarget.range.head:null,sn,ln;if(d){let un=p/this.heightOracle.lineLength*this.heightOracle.lineHeight,pn,yn;if(an!=null){let _n=findFraction(tn,an),Pn=((this.visibleBottom-this.visibleTop)/2+un)/le.height;pn=_n-Pn,yn=_n+Pn}else pn=(this.visibleTop-le.top-un)/le.height,yn=(this.visibleBottom-le.top+un)/le.height;sn=findPosition(tn,pn),ln=findPosition(tn,yn)}else{let un=tn.total*this.heightOracle.charWidth,pn=p*this.heightOracle.charWidth,yn=0;if(un>2e6)for(let Sn of e)Sn.from>=le.from&&Sn.from<le.to&&Sn.size!=Sn.displaySize&&Sn.from*this.heightOracle.charWidth+yn<this.pixelViewport.left&&(yn=Sn.size-Sn.displaySize);let _n=this.pixelViewport.left+yn,Pn=this.pixelViewport.right+yn,vn,bn;if(an!=null){let Sn=findFraction(tn,an),An=((Pn-_n)/2+pn)/un;vn=Sn-An,bn=Sn+An}else vn=(_n-pn)/un,bn=(Pn+pn)/un;sn=findPosition(tn,vn),ln=findPosition(tn,bn)}sn>le.from&&z(le.from,sn,le,tn),ln<le.to&&z(ln,le.to,le,tn)};for(let le of this.viewportLines)Array.isArray(le.type)?le.type.forEach(se):se(le);return I}gapSize(e,l,d,p){let b=findFraction(p,d)-findFraction(p,l);return this.heightOracle.lineWrapping?e.height*b:p.total*this.heightOracle.charWidth*b}updateLineGaps(e){LineGap.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Decoration.set(e.map(l=>l.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let l=this.stateDeco;this.lineGaps.length&&(l=l.concat(this.lineGapDeco));let d=[];RangeSet.spans(l,this.viewport.from,this.viewport.to,{span(b,R){d.push({from:b,to:R})},point(){}},20);let p=0;if(d.length!=this.visibleRanges.length)p=12;else for(let b=0;b<d.length&&!(p&8);b++){let R=this.visibleRanges[b],I=d[b];(R.from!=I.from||R.to!=I.to)&&(p|=4,e&&e.mapPos(R.from,-1)==I.from&&e.mapPos(R.to,1)==I.to||(p|=8))}return this.visibleRanges=d,p}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(l=>l.from<=e&&l.to>=e)||scaleBlock(this.heightMap.lineAt(e,QueryType$1.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(l=>l.top<=e&&l.bottom>=e)||scaleBlock(this.heightMap.lineAt(this.scaler.fromDOM(e),QueryType$1.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let l=this.lineBlockAtHeight(e+8);return l.from>=this.viewport.from||this.viewportLines[0].top-e>200?l:this.viewportLines[0]}elementAtHeight(e){return scaleBlock(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Viewport{constructor(e,l){this.from=e,this.to=l}}function lineStructure(o,e,l){let d=[],p=o,b=0;return RangeSet.spans(l,o,e,{span(){},point(R,I){R>p&&(d.push({from:p,to:R}),b+=R-p),p=I}},20),p<e&&(d.push({from:p,to:e}),b+=e-p),{total:b,ranges:d}}function findPosition({total:o,ranges:e},l){if(l<=0)return e[0].from;if(l>=1)return e[e.length-1].to;let d=Math.floor(o*l);for(let p=0;;p++){let{from:b,to:R}=e[p],I=R-b;if(d<=I)return b+d;d-=I}}function findFraction(o,e){let l=0;for(let{from:d,to:p}of o.ranges){if(e<=p){l+=e-d;break}l+=p-d}return l/o.total}function find(o,e){for(let l of o)if(e(l))return l}const IdScaler={toDOM(o){return o},fromDOM(o){return o},scale:1,eq(o){return o==this}};class BigScaler{constructor(e,l,d){let p=0,b=0,R=0;this.viewports=d.map(({from:I,to:z})=>{let se=l.lineAt(I,QueryType$1.ByPos,e,0,0).top,le=l.lineAt(z,QueryType$1.ByPos,e,0,0).bottom;return p+=le-se,{from:I,to:z,top:se,bottom:le,domTop:0,domBottom:0}}),this.scale=(7e6-p)/(l.height-p);for(let I of this.viewports)I.domTop=R+(I.top-b)*this.scale,R=I.domBottom=I.domTop+(I.bottom-I.top),b=I.bottom}toDOM(e){for(let l=0,d=0,p=0;;l++){let b=l<this.viewports.length?this.viewports[l]:null;if(!b||e<b.top)return p+(e-d)*this.scale;if(e<=b.bottom)return b.domTop+(e-b.top);d=b.bottom,p=b.domBottom}}fromDOM(e){for(let l=0,d=0,p=0;;l++){let b=l<this.viewports.length?this.viewports[l]:null;if(!b||e<b.domTop)return d+(e-p)/this.scale;if(e<=b.domBottom)return b.top+(e-b.domTop);d=b.bottom,p=b.domBottom}}eq(e){return e instanceof BigScaler?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((l,d)=>l.from==e.viewports[d].from&&l.to==e.viewports[d].to):!1}}function scaleBlock(o,e){if(e.scale==1)return o;let l=e.toDOM(o.top),d=e.toDOM(o.bottom);return new BlockInfo(o.from,o.length,l,d-l,Array.isArray(o._content)?o._content.map(p=>scaleBlock(p,e)):o._content)}const theme$1=Facet.define({combine:o=>o.join(" ")}),darkTheme=Facet.define({combine:o=>o.indexOf(!0)>-1}),baseThemeID=StyleModule.newName(),baseLightID=StyleModule.newName(),baseDarkID=StyleModule.newName(),lightDarkIDs={"&light":"."+baseLightID,"&dark":"."+baseDarkID};function buildTheme(o,e,l){return new StyleModule(e,{finish(d){return/&/.test(d)?d.replace(/&\w*/,p=>{if(p=="&")return o;if(!l||!l[p])throw new RangeError(`Unsupported selector: ${p}`);return l[p]}):o+" "+d}})}const baseTheme$1$2=buildTheme("."+baseThemeID,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},lightDarkIDs),observeOptions={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},useCharData=browser.ie&&browser.ie_version<=11;class DOMObserver{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new DOMSelectionState,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(l=>{for(let d of l)this.queue.push(d);(browser.ie&&browser.ie_version<=11||browser.ios&&e.composing)&&l.some(d=>d.type=="childList"&&d.removedNodes.length||d.type=="characterData"&&d.oldValue.length>d.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&e.constructor.EDIT_CONTEXT!==!1&&!(browser.chrome&&browser.chrome_version<126)&&(this.editContext=new EditContextManager(e),e.state.facet(editable)&&(e.contentDOM.editContext=this.editContext.editContext)),useCharData&&(this.onCharData=l=>{this.queue.push({target:l.target,type:"characterData",oldValue:l.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var l;((l=this.view.docView)===null||l===void 0?void 0:l.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(l=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),l.length>0&&l[l.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(l=>{l.length>0&&l[l.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((l,d)=>l!=e[d]))){this.gapIntersection.disconnect();for(let l of e)this.gapIntersection.observe(l);this.gaps=e}}onSelectionChange(e){let l=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:d}=this,p=this.selectionRange;if(d.state.facet(editable)?d.root.activeElement!=this.dom:!hasSelection(this.dom,p))return;let b=p.anchorNode&&d.docView.nearest(p.anchorNode);if(b&&b.ignoreEvent(e)){l||(this.selectionChanged=!1);return}(browser.ie&&browser.ie_version<=11||browser.android&&browser.chrome)&&!d.state.selection.main.empty&&p.focusNode&&isEquivalentPosition(p.focusNode,p.focusOffset,p.anchorNode,p.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,l=getSelection(e.root);if(!l)return!1;let d=browser.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&safariSelectionRangeHack(this.view,l)||l;if(!d||this.selectionRange.eq(d))return!1;let p=hasSelection(this.dom,d);return p&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&atElementStart(this.dom,d)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(d),p&&(this.selectionChanged=!0),!0)}setSelectionRange(e,l){this.selectionRange.set(e.node,e.offset,l.node,l.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,l=null;for(let d=this.dom;d;)if(d.nodeType==1)!l&&e<this.scrollTargets.length&&this.scrollTargets[e]==d?e++:l||(l=this.scrollTargets.slice(0,e)),l&&l.push(d),d=d.assignedSlot||d.parentNode;else if(d.nodeType==11)d=d.host;else break;if(e<this.scrollTargets.length&&!l&&(l=this.scrollTargets.slice(0,e)),l){for(let d of this.scrollTargets)d.removeEventListener("scroll",this.onScroll);for(let d of this.scrollTargets=l)d.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,observeOptions),useCharData&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),useCharData&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,l){var d;if(!this.delayedAndroidKey){let p=()=>{let b=this.delayedAndroidKey;b&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=b.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&b.force&&dispatchKey(this.dom,b.key,b.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(p)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:l,force:this.lastChange<Date.now()-50||!!(!((d=this.delayedAndroidKey)===null||d===void 0)&&d.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let l=-1,d=-1,p=!1;for(let b of e){let R=this.readMutation(b);R&&(R.typeOver&&(p=!0),l==-1?{from:l,to:d}=R:(l=Math.min(R.from,l),d=Math.max(R.to,d)))}return{from:l,to:d,typeOver:p}}readChange(){let{from:e,to:l,typeOver:d}=this.processRecords(),p=this.selectionChanged&&hasSelection(this.dom,this.selectionRange);if(e<0&&!p)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let b=new DOMChange(this.view,e,l,d);return this.view.docView.domChanged={newSel:b.newSel?b.newSel.main:null},b}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let l=this.readChange();if(!l)return this.view.requestMeasure(),!1;let d=this.view.state,p=applyDOMChange(this.view,l);return this.view.state==d&&(l.domChanged||l.newSel&&!l.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),p}readMutation(e){let l=this.view.docView.nearest(e.target);if(!l||l.ignoreMutation(e))return null;if(l.markDirty(e.type=="attributes"),e.type=="attributes"&&(l.flags|=4),e.type=="childList"){let d=findChild(l,e.previousSibling||e.target.previousSibling,-1),p=findChild(l,e.nextSibling||e.target.nextSibling,1);return{from:d?l.posAfter(d):l.posAtStart,to:p?l.posBefore(p):l.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:l.posAtStart,to:l.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(editable)!=e.state.facet(editable)&&(e.view.contentDOM.editContext=e.state.facet(editable)?this.editContext.editContext:null))}destroy(){var e,l,d;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(l=this.gapIntersection)===null||l===void 0||l.disconnect(),(d=this.resizeScroll)===null||d===void 0||d.disconnect();for(let p of this.scrollTargets)p.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function findChild(o,e,l){for(;e;){let d=ContentView.get(e);if(d&&d.parent==o)return d;let p=e.parentNode;e=p!=o.dom?p:l>0?e.nextSibling:e.previousSibling}return null}function buildSelectionRangeFromRange(o,e){let l=e.startContainer,d=e.startOffset,p=e.endContainer,b=e.endOffset,R=o.docView.domAtPos(o.state.selection.main.anchor);return isEquivalentPosition(R.node,R.offset,p,b)&&([l,d,p,b]=[p,b,l,d]),{anchorNode:l,anchorOffset:d,focusNode:p,focusOffset:b}}function safariSelectionRangeHack(o,e){if(e.getComposedRanges){let p=e.getComposedRanges(o.root)[0];if(p)return buildSelectionRangeFromRange(o,p)}let l=null;function d(p){p.preventDefault(),p.stopImmediatePropagation(),l=p.getTargetRanges()[0]}return o.contentDOM.addEventListener("beforeinput",d,!0),o.dom.ownerDocument.execCommand("indent"),o.contentDOM.removeEventListener("beforeinput",d,!0),l?buildSelectionRangeFromRange(o,l):null}class EditContextManager{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let l=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=d=>{let p=e.state.selection.main,{anchor:b,head:R}=p,I=this.toEditorPos(d.updateRangeStart),z=this.toEditorPos(d.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:d.updateRangeStart,editorBase:I,drifted:!1});let se={from:I,to:z,insert:Text$1.of(d.text.split(`
|
||
`))};if(se.from==this.from&&b<this.from?se.from=b:se.to==this.to&&b>this.to&&(se.to=b),se.from==se.to&&!se.insert.length){let le=EditorSelection.single(this.toEditorPos(d.selectionStart),this.toEditorPos(d.selectionEnd));le.main.eq(p)||e.dispatch({selection:le,userEvent:"select"});return}if((browser.mac||browser.android)&&se.from==R-1&&/^\. ?$/.test(d.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(se={from:I,to:z,insert:Text$1.of([d.text.replace("."," ")])}),this.pendingContextChange=se,!e.state.readOnly){let le=this.to-this.from+(se.to-se.from+se.insert.length);applyDOMChangeInner(e,se,EditorSelection.single(this.toEditorPos(d.selectionStart,le),this.toEditorPos(d.selectionEnd,le)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state))},this.handlers.characterboundsupdate=d=>{let p=[],b=null;for(let R=this.toEditorPos(d.rangeStart),I=this.toEditorPos(d.rangeEnd);R<I;R++){let z=e.coordsForChar(R);b=z&&new DOMRect(z.left,z.top,z.right-z.left,z.bottom-z.top)||b||new DOMRect,p.push(b)}l.updateCharacterBounds(d.rangeStart,p)},this.handlers.textformatupdate=d=>{let p=[];for(let b of d.getTextFormats()){let R=b.underlineStyle,I=b.underlineThickness;if(R!="None"&&I!="None"){let z=this.toEditorPos(b.rangeStart),se=this.toEditorPos(b.rangeEnd);if(z<se){let le=`text-decoration: underline ${R=="Dashed"?"dashed ":R=="Squiggle"?"wavy ":""}${I=="Thin"?1:2}px`;p.push(Decoration.mark({attributes:{style:le}}).range(z,se))}}}e.dispatch({effects:setEditContextFormatting.of(Decoration.set(p))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:d}=this.composing;this.composing=null,d&&this.reset(e.state)}};for(let d in this.handlers)l.addEventListener(d,this.handlers[d]);this.measureReq={read:d=>{this.editContext.updateControlBounds(d.contentDOM.getBoundingClientRect());let p=getSelection(d.root);p&&p.rangeCount&&this.editContext.updateSelectionBounds(p.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let l=0,d=!1,p=this.pendingContextChange;return e.changes.iterChanges((b,R,I,z,se)=>{if(d)return;let le=se.length-(R-b);if(p&&R>=p.to)if(p.from==b&&p.to==R&&p.insert.eq(se)){p=this.pendingContextChange=null,l+=le,this.to+=le;return}else p=null,this.revertPending(e.state);if(b+=l,R+=l,R<=this.from)this.from+=le,this.to+=le;else if(b<this.to){if(b<this.from||R>this.to||this.to-this.from+se.length>3e4){d=!0;return}this.editContext.updateText(this.toContextPos(b),this.toContextPos(R),se.toString()),this.to+=le}l+=le}),p&&!d&&this.revertPending(e.state),!d}update(e){let l=this.pendingContextChange;this.composing&&(this.composing.drifted||e.transactions.some(d=>!d.isUserEvent("input.type")&&d.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||l)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:l}=e.selection.main;this.from=Math.max(0,l-1e4),this.to=Math.min(e.doc.length,l+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let l=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(l.from),this.toContextPos(l.from+l.insert.length),e.doc.sliceString(l.from,l.to))}setSelection(e){let{main:l}=e.selection,d=this.toContextPos(Math.max(this.from,Math.min(this.to,l.anchor))),p=this.toContextPos(l.head);(this.editContext.selectionStart!=d||this.editContext.selectionEnd!=p)&&this.editContext.updateSelection(d,p)}rangeIsValid(e){let{head:l}=e.selection.main;return!(this.from>0&&l-this.from<500||this.to<e.doc.length&&this.to-l<500||this.to-this.from>3e4)}toEditorPos(e,l=this.to-this.from){e=Math.min(e,l);let d=this.composing;return d&&d.drifted?d.editorBase+(e-d.contextBase):e+this.from}toContextPos(e){let l=this.composing;return l&&l.drifted?l.contextBase+(e-l.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class EditorView{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var l;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:d}=e;this.dispatchTransactions=e.dispatchTransactions||d&&(p=>p.forEach(b=>d(b,this)))||(p=>this.update(p)),this.dispatch=this.dispatch.bind(this),this._root=e.root||getRoot(e.parent)||document,this.viewState=new ViewState(e.state||EditorState.create(e)),e.scrollTo&&e.scrollTo.is(scrollIntoView$1)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(viewPlugin).map(p=>new PluginInstance(p));for(let p of this.plugins)p.update(this);this.observer=new DOMObserver(this),this.inputState=new InputState(this),this.inputState.ensureHandlers(this.plugins),this.docView=new DocView(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((l=document.fonts)===null||l===void 0)&&l.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let l=e.length==1&&e[0]instanceof Transaction?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(l,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let l=!1,d=!1,p,b=this.state;for(let an of e){if(an.startState!=b)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");b=an.state}if(this.destroyed){this.viewState.state=b;return}let R=this.hasFocus,I=0,z=null;e.some(an=>an.annotation(isFocusChange))?(this.inputState.notifiedFocused=R,I=1):R!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=R,z=focusChangeTransaction(b,R),z||(I=1));let se=this.observer.delayedAndroidKey,le=null;if(se?(this.observer.clearDelayedAndroidKey(),le=this.observer.readChange(),(le&&!this.state.doc.eq(b.doc)||!this.state.selection.eq(b.selection))&&(le=null)):this.observer.clear(),b.facet(EditorState.phrases)!=this.state.facet(EditorState.phrases))return this.setState(b);p=ViewUpdate.create(this,b,e),p.flags|=I;let tn=this.viewState.scrollTarget;try{this.updateState=2;for(let an of e){if(tn&&(tn=tn.map(an.changes)),an.scrollIntoView){let{main:sn}=an.state.selection;tn=new ScrollTarget(sn.empty?sn:EditorSelection.cursor(sn.head,sn.head>sn.anchor?-1:1))}for(let sn of an.effects)sn.is(scrollIntoView$1)&&(tn=sn.value.clip(this.state))}this.viewState.update(p,tn),this.bidiCache=CachedOrder.update(this.bidiCache,p.changes),p.empty||(this.updatePlugins(p),this.inputState.update(p)),l=this.docView.update(p),this.state.facet(styleModule)!=this.styleModules&&this.mountStyles(),d=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(l,e.some(an=>an.isUserEvent("select.pointer")))}finally{this.updateState=0}if(p.startState.facet(theme$1)!=p.state.facet(theme$1)&&(this.viewState.mustMeasureContent=!0),(l||d||tn||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),l&&this.docViewUpdate(),!p.empty)for(let an of this.state.facet(updateListener))try{an(p)}catch(sn){logException(this.state,sn,"update listener")}(z||le)&&Promise.resolve().then(()=>{z&&this.state==z.startState&&this.dispatch(z),le&&!applyDOMChange(this,le)&&se.force&&dispatchKey(this.contentDOM,se.key,se.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let l=this.hasFocus;try{for(let d of this.plugins)d.destroy(this);this.viewState=new ViewState(e),this.plugins=e.facet(viewPlugin).map(d=>new PluginInstance(d)),this.pluginMap.clear();for(let d of this.plugins)d.update(this);this.docView.destroy(),this.docView=new DocView(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}l&&this.focus(),this.requestMeasure()}updatePlugins(e){let l=e.startState.facet(viewPlugin),d=e.state.facet(viewPlugin);if(l!=d){let p=[];for(let b of d){let R=l.indexOf(b);if(R<0)p.push(new PluginInstance(b));else{let I=this.plugins[R];I.mustUpdate=e,p.push(I)}}for(let b of this.plugins)b.mustUpdate!=e&&b.destroy(this);this.plugins=p,this.pluginMap.clear()}else for(let p of this.plugins)p.mustUpdate=e;for(let p=0;p<this.plugins.length;p++)this.plugins[p].update(this);l!=d&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let l=e.value;if(l&&l.docViewUpdate)try{l.docViewUpdate(this)}catch(d){logException(this.state,d,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let l=null,d=this.scrollDOM,p=d.scrollTop*this.scaleY,{scrollAnchorPos:b,scrollAnchorHeight:R}=this.viewState;Math.abs(p-this.viewState.scrollTop)>1&&(R=-1),this.viewState.scrollAnchorHeight=-1;try{for(let I=0;;I++){if(R<0)if(isScrolledToBottom(d))b=-1,R=this.viewState.heightMap.height;else{let sn=this.viewState.scrollAnchorAt(p);b=sn.from,R=sn.top}this.updateState=1;let z=this.viewState.measure(this);if(!z&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(I>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let se=[];z&4||([this.measureRequests,se]=[se,this.measureRequests]);let le=se.map(sn=>{try{return sn.read(this)}catch(ln){return logException(this.state,ln),BadMeasure}}),tn=ViewUpdate.create(this,this.state,[]),an=!1;tn.flags|=z,l?l.flags|=z:l=tn,this.updateState=2,tn.empty||(this.updatePlugins(tn),this.inputState.update(tn),this.updateAttrs(),an=this.docView.update(tn),an&&this.docViewUpdate());for(let sn=0;sn<se.length;sn++)if(le[sn]!=BadMeasure)try{let ln=se[sn];ln.write&&ln.write(le[sn],this)}catch(ln){logException(this.state,ln)}if(an&&this.docView.updateSelection(!0),!tn.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,R=-1;continue}else{let ln=(b<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(b).top)-R;if(ln>1||ln<-1){p=p+ln,d.scrollTop=p/this.scaleY,R=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(l&&!l.empty)for(let I of this.state.facet(updateListener))I(l)}get themeClasses(){return baseThemeID+" "+(this.state.facet(darkTheme)?baseDarkID:baseLightID)+" "+this.state.facet(theme$1)}updateAttrs(){let e=attrsFromFacet(this,editorAttributes,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),l={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(editable)?"true":"false",class:"cm-content",style:`${browser.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(l["aria-readonly"]="true"),attrsFromFacet(this,contentAttributes,l);let d=this.observer.ignore(()=>{let p=updateAttrs(this.contentDOM,this.contentAttrs,l),b=updateAttrs(this.dom,this.editorAttrs,e);return p||b});return this.editorAttrs=e,this.contentAttrs=l,d}showAnnouncements(e){let l=!0;for(let d of e)for(let p of d.effects)if(p.is(EditorView.announce)){l&&(this.announceDOM.textContent=""),l=!1;let b=this.announceDOM.appendChild(document.createElement("div"));b.textContent=p.value}}mountStyles(){this.styleModules=this.state.facet(styleModule);let e=this.state.facet(EditorView.cspNonce);StyleModule.mount(this.root,this.styleModules.concat(baseTheme$1$2).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let l=0;l<this.measureRequests.length;l++)if(this.measureRequests[l].key===e.key){this.measureRequests[l]=e;return}}this.measureRequests.push(e)}}plugin(e){let l=this.pluginMap.get(e);return(l===void 0||l&&l.spec!=e)&&this.pluginMap.set(e,l=this.plugins.find(d=>d.spec==e)||null),l&&l.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,l,d){return skipAtoms(this,e,moveByChar$1(this,e,l,d))}moveByGroup(e,l){return skipAtoms(this,e,moveByChar$1(this,e,l,d=>byGroup(this,e.head,d)))}visualLineSide(e,l){let d=this.bidiSpans(e),p=this.textDirectionAt(e.from),b=d[l?d.length-1:0];return EditorSelection.cursor(b.side(l,p)+e.from,b.forward(!l,p)?1:-1)}moveToLineBoundary(e,l,d=!0){return moveToLineBoundary(this,e,l,d)}moveVertically(e,l,d){return skipAtoms(this,e,moveVertically(this,e,l,d))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,l=0){return this.docView.posFromDOM(e,l)}posAtCoords(e,l=!0){return this.readMeasured(),posAtCoords(this,e,l)}coordsAtPos(e,l=1){this.readMeasured();let d=this.docView.coordsAt(e,l);if(!d||d.left==d.right)return d;let p=this.state.doc.lineAt(e),b=this.bidiSpans(p),R=b[BidiSpan.find(b,e-p.from,-1,l)];return flattenRect(d,R.dir==Direction.LTR==l>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(perLineTextDirection)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>MaxBidiLine)return trivialOrder(e.length);let l=this.textDirectionAt(e.from),d;for(let b of this.bidiCache)if(b.from==e.from&&b.dir==l&&(b.fresh||isolatesEq(b.isolates,d=getIsolatedRanges(this,e))))return b.order;d||(d=getIsolatedRanges(this,e));let p=computeOrder(e.text,l,d);return this.bidiCache.push(new CachedOrder(e.from,e.to,l,d,!0,p)),p}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||browser.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{focusPreventScroll(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,l={}){return scrollIntoView$1.of(new ScrollTarget(typeof e=="number"?EditorSelection.cursor(e):e,l.y,l.x,l.yMargin,l.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:l}=this.scrollDOM,d=this.viewState.scrollAnchorAt(e);return scrollIntoView$1.of(new ScrollTarget(EditorSelection.cursor(d.from),"start","start",d.top-e,l,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return ViewPlugin.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return ViewPlugin.define(()=>({}),{eventObservers:e})}static theme(e,l){let d=StyleModule.newName(),p=[theme$1.of(d),styleModule.of(buildTheme(`.${d}`,e))];return l&&l.dark&&p.push(darkTheme.of(!0)),p}static baseTheme(e){return Prec.lowest(styleModule.of(buildTheme("."+baseThemeID,e,lightDarkIDs)))}static findFromDOM(e){var l;let d=e.querySelector(".cm-content"),p=d&&ContentView.get(d)||ContentView.get(e);return((l=p?.rootView)===null||l===void 0?void 0:l.view)||null}}EditorView.styleModule=styleModule,EditorView.inputHandler=inputHandler$1,EditorView.clipboardInputFilter=clipboardInputFilter,EditorView.clipboardOutputFilter=clipboardOutputFilter,EditorView.scrollHandler=scrollHandler,EditorView.focusChangeEffect=focusChangeEffect,EditorView.perLineTextDirection=perLineTextDirection,EditorView.exceptionSink=exceptionSink,EditorView.updateListener=updateListener,EditorView.editable=editable,EditorView.mouseSelectionStyle=mouseSelectionStyle,EditorView.dragMovesSelection=dragMovesSelection$1,EditorView.clickAddsSelectionRange=clickAddsSelectionRange,EditorView.decorations=decorations,EditorView.outerDecorations=outerDecorations,EditorView.atomicRanges=atomicRanges,EditorView.bidiIsolatedRanges=bidiIsolatedRanges,EditorView.scrollMargins=scrollMargins,EditorView.darkTheme=darkTheme,EditorView.cspNonce=Facet.define({combine:o=>o.length?o[0]:""}),EditorView.contentAttributes=contentAttributes,EditorView.editorAttributes=editorAttributes,EditorView.lineWrapping=EditorView.contentAttributes.of({class:"cm-lineWrapping"}),EditorView.announce=StateEffect.define();const MaxBidiLine=4096,BadMeasure={};class CachedOrder{constructor(e,l,d,p,b,R){this.from=e,this.to=l,this.dir=d,this.isolates=p,this.fresh=b,this.order=R}static update(e,l){if(l.empty&&!e.some(b=>b.fresh))return e;let d=[],p=e.length?e[e.length-1].dir:Direction.LTR;for(let b=Math.max(0,e.length-10);b<e.length;b++){let R=e[b];R.dir==p&&!l.touchesRange(R.from,R.to)&&d.push(new CachedOrder(l.mapPos(R.from,1),l.mapPos(R.to,-1),R.dir,R.isolates,!1,R.order))}return d}}function attrsFromFacet(o,e,l){for(let d=o.state.facet(e),p=d.length-1;p>=0;p--){let b=d[p],R=typeof b=="function"?b(o):b;R&&combineAttrs(R,l)}return l}const currentPlatform=browser.mac?"mac":browser.windows?"win":browser.linux?"linux":"key";function normalizeKeyName(o,e){const l=o.split(/-(?!$)/);let d=l[l.length-1];d=="Space"&&(d=" ");let p,b,R,I;for(let z=0;z<l.length-1;++z){const se=l[z];if(/^(cmd|meta|m)$/i.test(se))I=!0;else if(/^a(lt)?$/i.test(se))p=!0;else if(/^(c|ctrl|control)$/i.test(se))b=!0;else if(/^s(hift)?$/i.test(se))R=!0;else if(/^mod$/i.test(se))e=="mac"?I=!0:b=!0;else throw new Error("Unrecognized modifier name: "+se)}return p&&(d="Alt-"+d),b&&(d="Ctrl-"+d),I&&(d="Meta-"+d),R&&(d="Shift-"+d),d}function modifiers(o,e,l){return e.altKey&&(o="Alt-"+o),e.ctrlKey&&(o="Ctrl-"+o),e.metaKey&&(o="Meta-"+o),l!==!1&&e.shiftKey&&(o="Shift-"+o),o}const handleKeyEvents=Prec.default(EditorView.domEventHandlers({keydown(o,e){return runHandlers(getKeymap(e.state),o,e,"editor")}})),keymap=Facet.define({enables:handleKeyEvents}),Keymaps=new WeakMap;function getKeymap(o){let e=o.facet(keymap),l=Keymaps.get(e);return l||Keymaps.set(e,l=buildKeymap(e.reduce((d,p)=>d.concat(p),[]))),l}function runScopeHandlers(o,e,l){return runHandlers(getKeymap(o.state),e,o,l)}let storedPrefix=null;const PrefixTimeout=4e3;function buildKeymap(o,e=currentPlatform){let l=Object.create(null),d=Object.create(null),p=(R,I)=>{let z=d[R];if(z==null)d[R]=I;else if(z!=I)throw new Error("Key binding "+R+" is used both as a regular binding and as a multi-stroke prefix")},b=(R,I,z,se,le)=>{var tn,an;let sn=l[R]||(l[R]=Object.create(null)),ln=I.split(/ (?!$)/).map(yn=>normalizeKeyName(yn,e));for(let yn=1;yn<ln.length;yn++){let _n=ln.slice(0,yn).join(" ");p(_n,!0),sn[_n]||(sn[_n]={preventDefault:!0,stopPropagation:!1,run:[Pn=>{let vn=storedPrefix={view:Pn,prefix:_n,scope:R};return setTimeout(()=>{storedPrefix==vn&&(storedPrefix=null)},PrefixTimeout),!0}]})}let un=ln.join(" ");p(un,!1);let pn=sn[un]||(sn[un]={preventDefault:!1,stopPropagation:!1,run:((an=(tn=sn._any)===null||tn===void 0?void 0:tn.run)===null||an===void 0?void 0:an.slice())||[]});z&&pn.run.push(z),se&&(pn.preventDefault=!0),le&&(pn.stopPropagation=!0)};for(let R of o){let I=R.scope?R.scope.split(" "):["editor"];if(R.any)for(let se of I){let le=l[se]||(l[se]=Object.create(null));le._any||(le._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:tn}=R;for(let an in le)le[an].run.push(sn=>tn(sn,currentKeyEvent))}let z=R[e]||R.key;if(z)for(let se of I)b(se,z,R.run,R.preventDefault,R.stopPropagation),R.shift&&b(se,"Shift-"+z,R.shift,R.preventDefault,R.stopPropagation)}return l}let currentKeyEvent=null;function runHandlers(o,e,l,d){currentKeyEvent=e;let p=keyName(e),b=codePointAt(p,0),R=codePointSize(b)==p.length&&p!=" ",I="",z=!1,se=!1,le=!1;storedPrefix&&storedPrefix.view==l&&storedPrefix.scope==d&&(I=storedPrefix.prefix+" ",modifierCodes.indexOf(e.keyCode)<0&&(se=!0,storedPrefix=null));let tn=new Set,an=pn=>{if(pn){for(let yn of pn.run)if(!tn.has(yn)&&(tn.add(yn),yn(l)))return pn.stopPropagation&&(le=!0),!0;pn.preventDefault&&(pn.stopPropagation&&(le=!0),se=!0)}return!1},sn=o[d],ln,un;return sn&&(an(sn[I+modifiers(p,e,!R)])?z=!0:R&&(e.altKey||e.metaKey||e.ctrlKey)&&!(browser.windows&&e.ctrlKey&&e.altKey)&&(ln=base[e.keyCode])&&ln!=p?(an(sn[I+modifiers(ln,e,!0)])||e.shiftKey&&(un=shift[e.keyCode])!=p&&un!=ln&&an(sn[I+modifiers(un,e,!1)]))&&(z=!0):R&&e.shiftKey&&an(sn[I+modifiers(p,e,!0)])&&(z=!0),!z&&an(sn._any)&&(z=!0)),se&&(z=!0),z&&le&&e.stopPropagation(),currentKeyEvent=null,z}class RectangleMarker{constructor(e,l,d,p,b){this.className=e,this.left=l,this.top=d,this.width=p,this.height=b}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,l){return l.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,l,d){if(d.empty){let p=e.coordsAtPos(d.head,d.assoc||1);if(!p)return[];let b=getBase$2(e);return[new RectangleMarker(l,p.left-b.left,p.top-b.top,null,p.bottom-p.top)]}else return rectanglesForRange(e,l,d)}}function getBase$2(o){let e=o.scrollDOM.getBoundingClientRect();return{left:(o.textDirection==Direction.LTR?e.left:e.right-o.scrollDOM.clientWidth*o.scaleX)-o.scrollDOM.scrollLeft*o.scaleX,top:e.top-o.scrollDOM.scrollTop*o.scaleY}}function wrappedLine(o,e,l,d){let p=o.coordsAtPos(e,l*2);if(!p)return d;let b=o.dom.getBoundingClientRect(),R=(p.top+p.bottom)/2,I=o.posAtCoords({x:b.left+1,y:R}),z=o.posAtCoords({x:b.right-1,y:R});return I==null||z==null?d:{from:Math.max(d.from,Math.min(I,z)),to:Math.min(d.to,Math.max(I,z))}}function rectanglesForRange(o,e,l){if(l.to<=o.viewport.from||l.from>=o.viewport.to)return[];let d=Math.max(l.from,o.viewport.from),p=Math.min(l.to,o.viewport.to),b=o.textDirection==Direction.LTR,R=o.contentDOM,I=R.getBoundingClientRect(),z=getBase$2(o),se=R.querySelector(".cm-line"),le=se&&window.getComputedStyle(se),tn=I.left+(le?parseInt(le.paddingLeft)+Math.min(0,parseInt(le.textIndent)):0),an=I.right-(le?parseInt(le.paddingRight):0),sn=blockAt(o,d),ln=blockAt(o,p),un=sn.type==BlockType.Text?sn:null,pn=ln.type==BlockType.Text?ln:null;if(un&&(o.lineWrapping||sn.widgetLineBreaks)&&(un=wrappedLine(o,d,1,un)),pn&&(o.lineWrapping||ln.widgetLineBreaks)&&(pn=wrappedLine(o,p,-1,pn)),un&&pn&&un.from==pn.from&&un.to==pn.to)return _n(Pn(l.from,l.to,un));{let bn=un?Pn(l.from,null,un):vn(sn,!1),Sn=pn?Pn(null,l.to,pn):vn(ln,!0),An=[];return(un||sn).to<(pn||ln).from-(un&&pn?1:0)||sn.widgetLineBreaks>1&&bn.bottom+o.defaultLineHeight/2<Sn.top?An.push(yn(tn,bn.bottom,an,Sn.top)):bn.bottom<Sn.top&&o.elementAtHeight((bn.bottom+Sn.top)/2).type==BlockType.Text&&(bn.bottom=Sn.top=(bn.bottom+Sn.top)/2),_n(bn).concat(An).concat(_n(Sn))}function yn(bn,Sn,An,Dn){return new RectangleMarker(e,bn-z.left,Sn-z.top,An-bn,Dn-Sn)}function _n({top:bn,bottom:Sn,horizontal:An}){let Dn=[];for(let Bn=0;Bn<An.length;Bn+=2)Dn.push(yn(An[Bn],bn,An[Bn+1],Sn));return Dn}function Pn(bn,Sn,An){let Dn=1e9,Bn=-1e9,Nn=[];function Qn(qn,ia,ra,aa,jn){let ka=o.coordsAtPos(qn,qn==An.to?-2:2),Aa=o.coordsAtPos(ra,ra==An.from?2:-2);!ka||!Aa||(Dn=Math.min(ka.top,Aa.top,Dn),Bn=Math.max(ka.bottom,Aa.bottom,Bn),jn==Direction.LTR?Nn.push(b&&ia?tn:ka.left,b&&aa?an:Aa.right):Nn.push(!b&&aa?tn:Aa.left,!b&&ia?an:ka.right))}let Zn=bn??An.from,Vn=Sn??An.to;for(let qn of o.visibleRanges)if(qn.to>Zn&&qn.from<Vn)for(let ia=Math.max(qn.from,Zn),ra=Math.min(qn.to,Vn);;){let aa=o.state.doc.lineAt(ia);for(let jn of o.bidiSpans(aa)){let ka=jn.from+aa.from,Aa=jn.to+aa.from;if(ka>=ra)break;Aa>ia&&Qn(Math.max(ka,ia),bn==null&&ka<=Zn,Math.min(Aa,ra),Sn==null&&Aa>=Vn,jn.dir)}if(ia=aa.to+1,ia>=ra)break}return Nn.length==0&&Qn(Zn,bn==null,Vn,Sn==null,o.textDirection),{top:Dn,bottom:Bn,horizontal:Nn}}function vn(bn,Sn){let An=I.top+(Sn?bn.top:bn.bottom);return{top:An,bottom:An,horizontal:[]}}}function sameMarker(o,e){return o.constructor==e.constructor&&o.eq(e)}class LayerView{constructor(e,l){this.view=e,this.layer=l,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),l.above&&this.dom.classList.add("cm-layer-above"),l.class&&this.dom.classList.add(l.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),l.mount&&l.mount(this.dom,e)}update(e){e.startState.facet(layerOrder)!=e.state.facet(layerOrder)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let l=0,d=e.facet(layerOrder);for(;l<d.length&&d[l]!=this.layer;)l++;this.dom.style.zIndex=String((this.layer.above?150:-1)-l)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:l}=this.view;(e!=this.scaleX||l!=this.scaleY)&&(this.scaleX=e,this.scaleY=l,this.dom.style.transform=`scale(${1/e}, ${1/l})`)}draw(e){if(e.length!=this.drawn.length||e.some((l,d)=>!sameMarker(l,this.drawn[d]))){let l=this.dom.firstChild,d=0;for(let p of e)p.update&&l&&p.constructor&&this.drawn[d].constructor&&p.update(l,this.drawn[d])?(l=l.nextSibling,d++):this.dom.insertBefore(p.draw(),l);for(;l;){let p=l.nextSibling;l.remove(),l=p}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const layerOrder=Facet.define();function layer(o){return[ViewPlugin.define(e=>new LayerView(e,o)),layerOrder.of(o)]}const CanHidePrimary=!(browser.ios&&browser.webkit&&browser.webkit_version<534),selectionConfig=Facet.define({combine(o){return combineConfig(o,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,l)=>Math.min(e,l),drawRangeCursor:(e,l)=>e||l})}});function drawSelection(o={}){return[selectionConfig.of(o),cursorLayer,selectionLayer,hideNativeSelection$2,nativeSelectionHidden.of(!0)]}function getDrawSelectionConfig$2(o){return o.facet(selectionConfig)}function configChanged$2(o){return o.startState.facet(selectionConfig)!=o.state.facet(selectionConfig)}const cursorLayer=layer({above:!0,markers(o){let{state:e}=o,l=e.facet(selectionConfig),d=[];for(let p of e.selection.ranges){let b=p==e.selection.main;if(p.empty?!b||CanHidePrimary:l.drawRangeCursor){let R=b?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",I=p.empty?p:EditorSelection.cursor(p.head,p.head>p.anchor?-1:1);for(let z of RectangleMarker.forRange(o,R,I))d.push(z)}}return d},update(o,e){o.transactions.some(d=>d.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let l=configChanged$2(o);return l&&setBlinkRate(o.state,e),o.docChanged||o.selectionSet||l},mount(o,e){setBlinkRate(e.state,o)},class:"cm-cursorLayer"});function setBlinkRate(o,e){e.style.animationDuration=o.facet(selectionConfig).cursorBlinkRate+"ms"}const selectionLayer=layer({above:!1,markers(o){return o.state.selection.ranges.map(e=>e.empty?[]:RectangleMarker.forRange(o,"cm-selectionBackground",e)).reduce((e,l)=>e.concat(l))},update(o,e){return o.docChanged||o.selectionSet||o.viewportChanged||configChanged$2(o)},class:"cm-selectionLayer"}),themeSpec$2={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};CanHidePrimary&&(themeSpec$2[".cm-line"].caretColor=themeSpec$2[".cm-content"].caretColor="transparent !important");const hideNativeSelection$2=Prec.highest(EditorView.theme(themeSpec$2)),setDropCursorPos=StateEffect.define({map(o,e){return o==null?null:e.mapPos(o)}}),dropCursorPos=StateField.define({create(){return null},update(o,e){return o!=null&&(o=e.changes.mapPos(o)),e.effects.reduce((l,d)=>d.is(setDropCursorPos)?d.value:l,o)}}),drawDropCursor=ViewPlugin.fromClass(class{constructor(o){this.view=o,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(o){var e;let l=o.state.field(dropCursorPos);l==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(o.startState.field(dropCursorPos)!=l||o.docChanged||o.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:o}=this,e=o.state.field(dropCursorPos),l=e!=null&&o.coordsAtPos(e);if(!l)return null;let d=o.scrollDOM.getBoundingClientRect();return{left:l.left-d.left+o.scrollDOM.scrollLeft*o.scaleX,top:l.top-d.top+o.scrollDOM.scrollTop*o.scaleY,height:l.bottom-l.top}}drawCursor(o){if(this.cursor){let{scaleX:e,scaleY:l}=this.view;o?(this.cursor.style.left=o.left/e+"px",this.cursor.style.top=o.top/l+"px",this.cursor.style.height=o.height/l+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(o){this.view.state.field(dropCursorPos)!=o&&this.view.dispatch({effects:setDropCursorPos.of(o)})}},{eventObservers:{dragover(o){this.setDropPos(this.view.posAtCoords({x:o.clientX,y:o.clientY}))},dragleave(o){(o.target==this.view.contentDOM||!this.view.contentDOM.contains(o.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function dropCursor(){return[dropCursorPos,drawDropCursor]}function iterMatches(o,e,l,d,p){e.lastIndex=0;for(let b=o.iterRange(l,d),R=l,I;!b.next().done;R+=b.value.length)if(!b.lineBreak)for(;I=e.exec(b.value);)p(R+I.index,I)}function matchRanges(o,e){let l=o.visibleRanges;if(l.length==1&&l[0].from==o.viewport.from&&l[0].to==o.viewport.to)return l;let d=[];for(let{from:p,to:b}of l)p=Math.max(o.state.doc.lineAt(p).from,p-e),b=Math.min(o.state.doc.lineAt(b).to,b+e),d.length&&d[d.length-1].to>=p?d[d.length-1].to=b:d.push({from:p,to:b});return d}class MatchDecorator{constructor(e){const{regexp:l,decoration:d,decorate:p,boundary:b,maxLength:R=1e3}=e;if(!l.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=l,p)this.addMatch=(I,z,se,le)=>p(le,se,se+I[0].length,I,z);else if(typeof d=="function")this.addMatch=(I,z,se,le)=>{let tn=d(I,z,se);tn&&le(se,se+I[0].length,tn)};else if(d)this.addMatch=(I,z,se,le)=>le(se,se+I[0].length,d);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=b,this.maxLength=R}createDeco(e){let l=new RangeSetBuilder,d=l.add.bind(l);for(let{from:p,to:b}of matchRanges(e,this.maxLength))iterMatches(e.state.doc,this.regexp,p,b,(R,I)=>this.addMatch(I,e,R,d));return l.finish()}updateDeco(e,l){let d=1e9,p=-1;return e.docChanged&&e.changes.iterChanges((b,R,I,z)=>{z>=e.view.viewport.from&&I<=e.view.viewport.to&&(d=Math.min(I,d),p=Math.max(z,p))}),e.viewportMoved||p-d>1e3?this.createDeco(e.view):p>-1?this.updateRange(e.view,l.map(e.changes),d,p):l}updateRange(e,l,d,p){for(let b of e.visibleRanges){let R=Math.max(b.from,d),I=Math.min(b.to,p);if(I>R){let z=e.state.doc.lineAt(R),se=z.to<I?e.state.doc.lineAt(I):z,le=Math.max(b.from,z.from),tn=Math.min(b.to,se.to);if(this.boundary){for(;R>z.from;R--)if(this.boundary.test(z.text[R-1-z.from])){le=R;break}for(;I<se.to;I++)if(this.boundary.test(se.text[I-se.from])){tn=I;break}}let an=[],sn,ln=(un,pn,yn)=>an.push(yn.range(un,pn));if(z==se)for(this.regexp.lastIndex=le-z.from;(sn=this.regexp.exec(z.text))&&sn.index<tn-z.from;)this.addMatch(sn,e,sn.index+z.from,ln);else iterMatches(e.state.doc,this.regexp,le,tn,(un,pn)=>this.addMatch(pn,e,un,ln));l=l.update({filterFrom:le,filterTo:tn,filter:(un,pn)=>un<le||pn>tn,add:an})}}return l}}const UnicodeRegexpSupport=/x/.unicode!=null?"gu":"g",Specials=new RegExp(`[\0-\b
|
||
--\u2028\u2029\uFEFF-]`,UnicodeRegexpSupport),Names={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let _supportsTabSize=null;function supportsTabSize(){var o;if(_supportsTabSize==null&&typeof document<"u"&&document.body){let e=document.body.style;_supportsTabSize=((o=e.tabSize)!==null&&o!==void 0?o:e.MozTabSize)!=null}return _supportsTabSize||!1}const specialCharConfig=Facet.define({combine(o){let e=combineConfig(o,{render:null,specialChars:Specials,addSpecialChars:null});return(e.replaceTabs=!supportsTabSize())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,UnicodeRegexpSupport)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,UnicodeRegexpSupport)),e}});function highlightSpecialChars(o={}){return[specialCharConfig.of(o),specialCharPlugin()]}let _plugin=null;function specialCharPlugin(){return _plugin||(_plugin=ViewPlugin.fromClass(class{constructor(o){this.view=o,this.decorations=Decoration.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(o.state.facet(specialCharConfig)),this.decorations=this.decorator.createDeco(o)}makeDecorator(o){return new MatchDecorator({regexp:o.specialChars,decoration:(e,l,d)=>{let{doc:p}=l.state,b=codePointAt(e[0],0);if(b==9){let R=p.lineAt(d),I=l.state.tabSize,z=countColumn(R.text,I,d-R.from);return Decoration.replace({widget:new TabWidget((I-z%I)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[b]||(this.decorationCache[b]=Decoration.replace({widget:new SpecialCharWidget(o,b)}))},boundary:o.replaceTabs?void 0:/[^]/})}update(o){let e=o.state.facet(specialCharConfig);o.startState.facet(specialCharConfig)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(o.view)):this.decorations=this.decorator.updateDeco(o,this.decorations)}},{decorations:o=>o.decorations}))}const DefaultPlaceholder="•";function placeholder$1(o){return o>=32?DefaultPlaceholder:o==10?"":String.fromCharCode(9216+o)}class SpecialCharWidget extends WidgetType{constructor(e,l){super(),this.options=e,this.code=l}eq(e){return e.code==this.code}toDOM(e){let l=placeholder$1(this.code),d=e.state.phrase("Control character")+" "+(Names[this.code]||"0x"+this.code.toString(16)),p=this.options.render&&this.options.render(this.code,d,l);if(p)return p;let b=document.createElement("span");return b.textContent=l,b.title=d,b.setAttribute("aria-label",d),b.className="cm-specialChar",b}ignoreEvent(){return!1}}class TabWidget extends WidgetType{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function highlightActiveLine(){return activeLineHighlighter}const lineDeco=Decoration.line({class:"cm-activeLine"}),activeLineHighlighter=ViewPlugin.fromClass(class{constructor(o){this.decorations=this.getDeco(o)}update(o){(o.docChanged||o.selectionSet)&&(this.decorations=this.getDeco(o.view))}getDeco(o){let e=-1,l=[];for(let d of o.state.selection.ranges){let p=o.lineBlockAt(d.head);p.from>e&&(l.push(lineDeco.range(p.from)),e=p.from)}return Decoration.set(l)}},{decorations:o=>o.decorations}),MaxOff=2e3;function rectangleFor(o,e,l){let d=Math.min(e.line,l.line),p=Math.max(e.line,l.line),b=[];if(e.off>MaxOff||l.off>MaxOff||e.col<0||l.col<0){let R=Math.min(e.off,l.off),I=Math.max(e.off,l.off);for(let z=d;z<=p;z++){let se=o.doc.line(z);se.length<=I&&b.push(EditorSelection.range(se.from+R,se.to+I))}}else{let R=Math.min(e.col,l.col),I=Math.max(e.col,l.col);for(let z=d;z<=p;z++){let se=o.doc.line(z),le=findColumn(se.text,R,o.tabSize,!0);if(le<0)b.push(EditorSelection.cursor(se.to));else{let tn=findColumn(se.text,I,o.tabSize);b.push(EditorSelection.range(se.from+le,se.from+tn))}}}return b}function absoluteColumn(o,e){let l=o.coordsAtPos(o.viewport.from);return l?Math.round(Math.abs((l.left-e)/o.defaultCharacterWidth)):-1}function getPos(o,e){let l=o.posAtCoords({x:e.clientX,y:e.clientY},!1),d=o.state.doc.lineAt(l),p=l-d.from,b=p>MaxOff?-1:p==d.length?absoluteColumn(o,e.clientX):countColumn(d.text,o.state.tabSize,l-d.from);return{line:d.number,col:b,off:p}}function rectangleSelectionStyle(o,e){let l=getPos(o,e),d=o.state.selection;return l?{update(p){if(p.docChanged){let b=p.changes.mapPos(p.startState.doc.line(l.line).from),R=p.state.doc.lineAt(b);l={line:R.number,col:l.col,off:Math.min(l.off,R.length)},d=d.map(p.changes)}},get(p,b,R){let I=getPos(o,p);if(!I)return d;let z=rectangleFor(o.state,l,I);return z.length?R?EditorSelection.create(z.concat(d.ranges)):EditorSelection.create(z):d}}:null}function rectangularSelection(o){let e=l=>l.altKey&&l.button==0;return EditorView.mouseSelectionStyle.of((l,d)=>e(d)?rectangleSelectionStyle(l,d):null)}const keys$3={Alt:[18,o=>!!o.altKey],Control:[17,o=>!!o.ctrlKey],Shift:[16,o=>!!o.shiftKey],Meta:[91,o=>!!o.metaKey]},showCrosshair={style:"cursor: crosshair"};function crosshairCursor(o={}){let[e,l]=keys$3[o.key||"Alt"],d=ViewPlugin.fromClass(class{constructor(p){this.view=p,this.isDown=!1}set(p){this.isDown!=p&&(this.isDown=p,this.view.update([]))}},{eventObservers:{keydown(p){this.set(p.keyCode==e||l(p))},keyup(p){(p.keyCode==e||!l(p))&&this.set(!1)},mousemove(p){this.set(l(p))}}});return[d,EditorView.contentAttributes.of(p=>{var b;return!((b=p.plugin(d))===null||b===void 0)&&b.isDown?showCrosshair:null})]}const Outside="-10000px";class TooltipViewManager{constructor(e,l,d,p){this.facet=l,this.createTooltipView=d,this.removeTooltipView=p,this.input=e.state.facet(l),this.tooltips=this.input.filter(R=>R);let b=null;this.tooltipViews=this.tooltips.map(R=>b=d(R,b))}update(e,l){var d;let p=e.state.facet(this.facet),b=p.filter(z=>z);if(p===this.input){for(let z of this.tooltipViews)z.update&&z.update(e);return!1}let R=[],I=l?[]:null;for(let z=0;z<b.length;z++){let se=b[z],le=-1;if(se){for(let tn=0;tn<this.tooltips.length;tn++){let an=this.tooltips[tn];an&&an.create==se.create&&(le=tn)}if(le<0)R[z]=this.createTooltipView(se,z?R[z-1]:null),I&&(I[z]=!!se.above);else{let tn=R[z]=this.tooltipViews[le];I&&(I[z]=l[le]),tn.update&&tn.update(e)}}}for(let z of this.tooltipViews)R.indexOf(z)<0&&(this.removeTooltipView(z),(d=z.destroy)===null||d===void 0||d.call(z));return l&&(I.forEach((z,se)=>l[se]=z),l.length=I.length),this.input=p,this.tooltips=b,this.tooltipViews=R,!0}}function windowSpace(o){let{win:e}=o;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const tooltipConfig=Facet.define({combine:o=>{var e,l,d;return{position:browser.ios?"absolute":((e=o.find(p=>p.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((l=o.find(p=>p.parent))===null||l===void 0?void 0:l.parent)||null,tooltipSpace:((d=o.find(p=>p.tooltipSpace))===null||d===void 0?void 0:d.tooltipSpace)||windowSpace}}}),knownHeight=new WeakMap,tooltipPlugin=ViewPlugin.fromClass(class{constructor(o){this.view=o,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=o.state.facet(tooltipConfig);this.position=e.position,this.parent=e.parent,this.classes=o.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new TooltipViewManager(o,showTooltip,(l,d)=>this.createTooltip(l,d),l=>{this.resizeObserver&&this.resizeObserver.unobserve(l.dom),l.dom.remove()}),this.above=this.manager.tooltips.map(l=>!!l.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(l=>{Date.now()>this.lastTransaction-50&&l.length>0&&l[l.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),o.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let o of this.manager.tooltipViews)this.intersectionObserver.observe(o.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(o){o.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(o,this.above);e&&this.observeIntersection();let l=e||o.geometryChanged,d=o.state.facet(tooltipConfig);if(d.position!=this.position&&!this.madeAbsolute){this.position=d.position;for(let p of this.manager.tooltipViews)p.dom.style.position=this.position;l=!0}if(d.parent!=this.parent){this.parent&&this.container.remove(),this.parent=d.parent,this.createContainer();for(let p of this.manager.tooltipViews)this.container.appendChild(p.dom);l=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);l&&this.maybeMeasure()}createTooltip(o,e){let l=o.create(this.view),d=e?e.dom:null;if(l.dom.classList.add("cm-tooltip"),o.arrow&&!l.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let p=document.createElement("div");p.className="cm-tooltip-arrow",l.dom.appendChild(p)}return l.dom.style.position=this.position,l.dom.style.top=Outside,l.dom.style.left="0px",this.container.insertBefore(l.dom,d),l.mount&&l.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(l.dom),l}destroy(){var o,e,l;this.view.win.removeEventListener("resize",this.measureSoon);for(let d of this.manager.tooltipViews)d.dom.remove(),(o=d.destroy)===null||o===void 0||o.call(d);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(l=this.intersectionObserver)===null||l===void 0||l.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let o=1,e=1,l=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:b}=this.manager.tooltipViews[0];if(browser.gecko)l=b.offsetParent!=this.container.ownerDocument.body;else if(b.style.top==Outside&&b.style.left=="0px"){let R=b.getBoundingClientRect();l=Math.abs(R.top+1e4)>1||Math.abs(R.left)>1}}if(l||this.position=="absolute")if(this.parent){let b=this.parent.getBoundingClientRect();b.width&&b.height&&(o=b.width/this.parent.offsetWidth,e=b.height/this.parent.offsetHeight)}else({scaleX:o,scaleY:e}=this.view.viewState);let d=this.view.scrollDOM.getBoundingClientRect(),p=getScrollMargins(this.view);return{visible:{left:d.left+p.left,top:d.top+p.top,right:d.right-p.right,bottom:d.bottom-p.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((b,R)=>{let I=this.manager.tooltipViews[R];return I.getCoords?I.getCoords(b.pos):this.view.coordsAtPos(b.pos)}),size:this.manager.tooltipViews.map(({dom:b})=>b.getBoundingClientRect()),space:this.view.state.facet(tooltipConfig).tooltipSpace(this.view),scaleX:o,scaleY:e,makeAbsolute:l}}writeMeasure(o){var e;if(o.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let I of this.manager.tooltipViews)I.dom.style.position="absolute"}let{visible:l,space:d,scaleX:p,scaleY:b}=o,R=[];for(let I=0;I<this.manager.tooltips.length;I++){let z=this.manager.tooltips[I],se=this.manager.tooltipViews[I],{dom:le}=se,tn=o.pos[I],an=o.size[I];if(!tn||z.clip!==!1&&(tn.bottom<=Math.max(l.top,d.top)||tn.top>=Math.min(l.bottom,d.bottom)||tn.right<Math.max(l.left,d.left)-.1||tn.left>Math.min(l.right,d.right)+.1)){le.style.top=Outside;continue}let sn=z.arrow?se.dom.querySelector(".cm-tooltip-arrow"):null,ln=sn?7:0,un=an.right-an.left,pn=(e=knownHeight.get(se))!==null&&e!==void 0?e:an.bottom-an.top,yn=se.offset||noOffset,_n=this.view.textDirection==Direction.LTR,Pn=an.width>d.right-d.left?_n?d.left:d.right-an.width:_n?Math.max(d.left,Math.min(tn.left-(sn?14:0)+yn.x,d.right-un)):Math.min(Math.max(d.left,tn.left-un+(sn?14:0)-yn.x),d.right-un),vn=this.above[I];!z.strictSide&&(vn?tn.top-pn-ln-yn.y<d.top:tn.bottom+pn+ln+yn.y>d.bottom)&&vn==d.bottom-tn.bottom>tn.top-d.top&&(vn=this.above[I]=!vn);let bn=(vn?tn.top-d.top:d.bottom-tn.bottom)-ln;if(bn<pn&&se.resize!==!1){if(bn<this.view.defaultLineHeight){le.style.top=Outside;continue}knownHeight.set(se,pn),le.style.height=(pn=bn)/b+"px"}else le.style.height&&(le.style.height="");let Sn=vn?tn.top-pn-ln-yn.y:tn.bottom+ln+yn.y,An=Pn+un;if(se.overlap!==!0)for(let Dn of R)Dn.left<An&&Dn.right>Pn&&Dn.top<Sn+pn&&Dn.bottom>Sn&&(Sn=vn?Dn.top-pn-2-ln:Dn.bottom+ln+2);if(this.position=="absolute"?(le.style.top=(Sn-o.parent.top)/b+"px",setLeftStyle(le,(Pn-o.parent.left)/p)):(le.style.top=Sn/b+"px",setLeftStyle(le,Pn/p)),sn){let Dn=tn.left+(_n?yn.x:-yn.x)-(Pn+14-7);sn.style.left=Dn/p+"px"}se.overlap!==!0&&R.push({left:Pn,top:Sn,right:An,bottom:Sn+pn}),le.classList.toggle("cm-tooltip-above",vn),le.classList.toggle("cm-tooltip-below",!vn),se.positioned&&se.positioned(o.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let o of this.manager.tooltipViews)o.dom.style.top=Outside}},{eventObservers:{scroll(){this.maybeMeasure()}}});function setLeftStyle(o,e){let l=parseInt(o.style.left,10);(isNaN(l)||Math.abs(e-l)>1)&&(o.style.left=e+"px")}const baseTheme$5=EditorView.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),noOffset={x:0,y:0},showTooltip=Facet.define({enables:[tooltipPlugin,baseTheme$5]}),showHoverTooltip=Facet.define({combine:o=>o.reduce((e,l)=>e.concat(l),[])});class HoverTooltipHost{static create(e){return new HoverTooltipHost(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new TooltipViewManager(e,showHoverTooltip,(l,d)=>this.createHostedView(l,d),l=>l.dom.remove())}createHostedView(e,l){let d=e.create(this.view);return d.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(d.dom,l?l.dom.nextSibling:this.dom.firstChild),this.mounted&&d.mount&&d.mount(this.view),d}mount(e){for(let l of this.manager.tooltipViews)l.mount&&l.mount(e);this.mounted=!0}positioned(e){for(let l of this.manager.tooltipViews)l.positioned&&l.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let l of this.manager.tooltipViews)(e=l.destroy)===null||e===void 0||e.call(l)}passProp(e){let l;for(let d of this.manager.tooltipViews){let p=d[e];if(p!==void 0){if(l===void 0)l=p;else if(l!==p)return}}return l}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const showHoverTooltipHost=showTooltip.compute([showHoverTooltip],o=>{let e=o.facet(showHoverTooltip);return e.length===0?null:{pos:Math.min(...e.map(l=>l.pos)),end:Math.max(...e.map(l=>{var d;return(d=l.end)!==null&&d!==void 0?d:l.pos})),create:HoverTooltipHost.create,above:e[0].above,arrow:e.some(l=>l.arrow)}});class HoverPlugin{constructor(e,l,d,p,b){this.view=e,this.source=l,this.field=d,this.setHover=p,this.hoverTime=b,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:l}=this,d=e.docView.nearest(l.target);if(!d)return;let p,b=1;if(d instanceof WidgetView)p=d.posAtStart;else{if(p=e.posAtCoords(l),p==null)return;let I=e.coordsAtPos(p);if(!I||l.y<I.top||l.y>I.bottom||l.x<I.left-e.defaultCharacterWidth||l.x>I.right+e.defaultCharacterWidth)return;let z=e.bidiSpans(e.state.doc.lineAt(p)).find(le=>le.from<=p&&le.to>=p),se=z&&z.dir==Direction.RTL?-1:1;b=l.x<I.left?-se:se}let R=this.source(e,p,b);if(R?.then){let I=this.pending={pos:p};R.then(z=>{this.pending==I&&(this.pending=null,z&&!(Array.isArray(z)&&!z.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(z)?z:[z])}))},z=>logException(e.state,z,"hover tooltip"))}else R&&!(Array.isArray(R)&&!R.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(R)?R:[R])})}get tooltip(){let e=this.view.plugin(tooltipPlugin),l=e?e.manager.tooltips.findIndex(d=>d.create==HoverTooltipHost.create):-1;return l>-1?e.manager.tooltipViews[l]:null}mousemove(e){var l,d;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:p,tooltip:b}=this;if(p.length&&b&&!isInTooltip(b.dom,e)||this.pending){let{pos:R}=p[0]||this.pending,I=(d=(l=p[0])===null||l===void 0?void 0:l.end)!==null&&d!==void 0?d:R;(R==I?this.view.posAtCoords(this.lastMove)!=R:!isOverRange(this.view,R,I,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:l}=this;if(l.length){let{tooltip:d}=this;d&&d.dom.contains(e.relatedTarget)?this.watchTooltipLeave(d.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let l=d=>{e.removeEventListener("mouseleave",l),this.active.length&&!this.view.dom.contains(d.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",l)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const tooltipMargin=4;function isInTooltip(o,e){let{left:l,right:d,top:p,bottom:b}=o.getBoundingClientRect(),R;if(R=o.querySelector(".cm-tooltip-arrow")){let I=R.getBoundingClientRect();p=Math.min(I.top,p),b=Math.max(I.bottom,b)}return e.clientX>=l-tooltipMargin&&e.clientX<=d+tooltipMargin&&e.clientY>=p-tooltipMargin&&e.clientY<=b+tooltipMargin}function isOverRange(o,e,l,d,p,b){let R=o.scrollDOM.getBoundingClientRect(),I=o.documentTop+o.documentPadding.top+o.contentHeight;if(R.left>d||R.right<d||R.top>p||Math.min(R.bottom,I)<p)return!1;let z=o.posAtCoords({x:d,y:p},!1);return z>=e&&z<=l}function hoverTooltip(o,e={}){let l=StateEffect.define(),d=StateField.define({create(){return[]},update(p,b){if(p.length&&(e.hideOnChange&&(b.docChanged||b.selection)?p=[]:e.hideOn&&(p=p.filter(R=>!e.hideOn(b,R))),b.docChanged)){let R=[];for(let I of p){let z=b.changes.mapPos(I.pos,-1,MapMode.TrackDel);if(z!=null){let se=Object.assign(Object.create(null),I);se.pos=z,se.end!=null&&(se.end=b.changes.mapPos(se.end)),R.push(se)}}p=R}for(let R of b.effects)R.is(l)&&(p=R.value),R.is(closeHoverTooltipEffect)&&(p=[]);return p},provide:p=>showHoverTooltip.from(p)});return{active:d,extension:[d,ViewPlugin.define(p=>new HoverPlugin(p,o,d,l,e.hoverTime||300)),showHoverTooltipHost]}}function getTooltip(o,e){let l=o.plugin(tooltipPlugin);if(!l)return null;let d=l.manager.tooltips.indexOf(e);return d<0?null:l.manager.tooltipViews[d]}const closeHoverTooltipEffect=StateEffect.define(),panelConfig=Facet.define({combine(o){let e,l;for(let d of o)e=e||d.topContainer,l=l||d.bottomContainer;return{topContainer:e,bottomContainer:l}}});function getPanel(o,e){let l=o.plugin(panelPlugin),d=l?l.specs.indexOf(e):-1;return d>-1?l.panels[d]:null}const panelPlugin=ViewPlugin.fromClass(class{constructor(o){this.input=o.state.facet(showPanel),this.specs=this.input.filter(l=>l),this.panels=this.specs.map(l=>l(o));let e=o.state.facet(panelConfig);this.top=new PanelGroup(o,!0,e.topContainer),this.bottom=new PanelGroup(o,!1,e.bottomContainer),this.top.sync(this.panels.filter(l=>l.top)),this.bottom.sync(this.panels.filter(l=>!l.top));for(let l of this.panels)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}update(o){let e=o.state.facet(panelConfig);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new PanelGroup(o.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new PanelGroup(o.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let l=o.state.facet(showPanel);if(l!=this.input){let d=l.filter(z=>z),p=[],b=[],R=[],I=[];for(let z of d){let se=this.specs.indexOf(z),le;se<0?(le=z(o.view),I.push(le)):(le=this.panels[se],le.update&&le.update(o)),p.push(le),(le.top?b:R).push(le)}this.specs=d,this.panels=p,this.top.sync(b),this.bottom.sync(R);for(let z of I)z.dom.classList.add("cm-panel"),z.mount&&z.mount()}else for(let d of this.panels)d.update&&d.update(o)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:o=>EditorView.scrollMargins.of(e=>{let l=e.plugin(o);return l&&{top:l.top.scrollMargin(),bottom:l.bottom.scrollMargin()}})});class PanelGroup{constructor(e,l,d){this.view=e,this.top=l,this.container=d,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let l of this.panels)l.destroy&&e.indexOf(l)<0&&l.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let l=this.container||this.view.dom;l.insertBefore(this.dom,this.top?l.firstChild:null)}let e=this.dom.firstChild;for(let l of this.panels)if(l.dom.parentNode==this.dom){for(;e!=l.dom;)e=rm(e);e=e.nextSibling}else this.dom.insertBefore(l.dom,e);for(;e;)e=rm(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function rm(o){let e=o.nextSibling;return o.remove(),e}const showPanel=Facet.define({enables:panelPlugin});class GutterMarker extends RangeValue{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}GutterMarker.prototype.elementClass="",GutterMarker.prototype.toDOM=void 0,GutterMarker.prototype.mapMode=MapMode.TrackBefore,GutterMarker.prototype.startSide=GutterMarker.prototype.endSide=-1,GutterMarker.prototype.point=!0;const gutterLineClass=Facet.define(),gutterWidgetClass=Facet.define(),activeGutters=Facet.define(),unfixGutters=Facet.define({combine:o=>o.some(e=>e)});function gutters(o){return[gutterView]}const gutterView=ViewPlugin.fromClass(class{constructor(o){this.view=o,this.prevViewport=o.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=o.state.facet(activeGutters).map(e=>new SingleGutterView(o,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!o.state.facet(unfixGutters),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),o.scrollDOM.insertBefore(this.dom,o.contentDOM)}update(o){if(this.updateGutters(o)){let e=this.prevViewport,l=o.view.viewport,d=Math.min(e.to,l.to)-Math.max(e.from,l.from);this.syncGutters(d<(l.to-l.from)*.8)}o.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(unfixGutters)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=o.view.viewport}syncGutters(o){let e=this.dom.nextSibling;o&&this.dom.remove();let l=RangeSet.iter(this.view.state.facet(gutterLineClass),this.view.viewport.from),d=[],p=this.gutters.map(b=>new UpdateContext(b,this.view.viewport,-this.view.documentPadding.top));for(let b of this.view.viewportLineBlocks)if(d.length&&(d=[]),Array.isArray(b.type)){let R=!0;for(let I of b.type)if(I.type==BlockType.Text&&R){advanceCursor(l,d,I.from);for(let z of p)z.line(this.view,I,d);R=!1}else if(I.widget)for(let z of p)z.widget(this.view,I)}else if(b.type==BlockType.Text){advanceCursor(l,d,b.from);for(let R of p)R.line(this.view,b,d)}else if(b.widget)for(let R of p)R.widget(this.view,b);for(let b of p)b.finish();o&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(o){let e=o.startState.facet(activeGutters),l=o.state.facet(activeGutters),d=o.docChanged||o.heightChanged||o.viewportChanged||!RangeSet.eq(o.startState.facet(gutterLineClass),o.state.facet(gutterLineClass),o.view.viewport.from,o.view.viewport.to);if(e==l)for(let p of this.gutters)p.update(o)&&(d=!0);else{d=!0;let p=[];for(let b of l){let R=e.indexOf(b);R<0?p.push(new SingleGutterView(this.view,b)):(this.gutters[R].update(o),p.push(this.gutters[R]))}for(let b of this.gutters)b.dom.remove(),p.indexOf(b)<0&&b.destroy();for(let b of p)this.dom.appendChild(b.dom);this.gutters=p}return d}destroy(){for(let o of this.gutters)o.destroy();this.dom.remove()}},{provide:o=>EditorView.scrollMargins.of(e=>{let l=e.plugin(o);return!l||l.gutters.length==0||!l.fixed?null:e.textDirection==Direction.LTR?{left:l.dom.offsetWidth*e.scaleX}:{right:l.dom.offsetWidth*e.scaleX}})});function asArray(o){return Array.isArray(o)?o:[o]}function advanceCursor(o,e,l){for(;o.value&&o.from<=l;)o.from==l&&e.push(o.value),o.next()}class UpdateContext{constructor(e,l,d){this.gutter=e,this.height=d,this.i=0,this.cursor=RangeSet.iter(e.markers,l.from)}addElement(e,l,d){let{gutter:p}=this,b=(l.top-this.height)/e.scaleY,R=l.height/e.scaleY;if(this.i==p.elements.length){let I=new GutterElement(e,R,b,d);p.elements.push(I),p.dom.appendChild(I.dom)}else p.elements[this.i].update(e,R,b,d);this.height=l.bottom,this.i++}line(e,l,d){let p=[];advanceCursor(this.cursor,p,l.from),d.length&&(p=p.concat(d));let b=this.gutter.config.lineMarker(e,l,p);b&&p.unshift(b);let R=this.gutter;p.length==0&&!R.config.renderEmptyElements||this.addElement(e,l,p)}widget(e,l){let d=this.gutter.config.widgetMarker(e,l.widget,l),p=d?[d]:null;for(let b of e.state.facet(gutterWidgetClass)){let R=b(e,l.widget,l);R&&(p||(p=[])).push(R)}p&&this.addElement(e,l,p)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let l=e.elements.pop();e.dom.removeChild(l.dom),l.destroy()}}}class SingleGutterView{constructor(e,l){this.view=e,this.config=l,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let d in l.domEventHandlers)this.dom.addEventListener(d,p=>{let b=p.target,R;if(b!=this.dom&&this.dom.contains(b)){for(;b.parentNode!=this.dom;)b=b.parentNode;let z=b.getBoundingClientRect();R=(z.top+z.bottom)/2}else R=p.clientY;let I=e.lineBlockAtHeight(R-e.documentTop);l.domEventHandlers[d](e,I,p)&&p.preventDefault()});this.markers=asArray(l.markers(e)),l.initialSpacer&&(this.spacer=new GutterElement(e,0,0,[l.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let l=this.markers;if(this.markers=asArray(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let p=this.config.updateSpacer(this.spacer.markers[0],e);p!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[p])}let d=e.view.viewport;return!RangeSet.eq(this.markers,l,d.from,d.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class GutterElement{constructor(e,l,d,p){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,l,d,p)}update(e,l,d,p){this.height!=l&&(this.height=l,this.dom.style.height=l+"px"),this.above!=d&&(this.dom.style.marginTop=(this.above=d)?d+"px":""),sameMarkers(this.markers,p)||this.setMarkers(e,p)}setMarkers(e,l){let d="cm-gutterElement",p=this.dom.firstChild;for(let b=0,R=0;;){let I=R,z=b<l.length?l[b++]:null,se=!1;if(z){let le=z.elementClass;le&&(d+=" "+le);for(let tn=R;tn<this.markers.length;tn++)if(this.markers[tn].compare(z)){I=tn,se=!0;break}}else I=this.markers.length;for(;R<I;){let le=this.markers[R++];if(le.toDOM){le.destroy(p);let tn=p.nextSibling;p.remove(),p=tn}}if(!z)break;z.toDOM&&(se?p=p.nextSibling:this.dom.insertBefore(z.toDOM(e),p)),se&&R++}this.dom.className=d,this.markers=l}destroy(){this.setMarkers(null,[])}}function sameMarkers(o,e){if(o.length!=e.length)return!1;for(let l=0;l<o.length;l++)if(!o[l].compare(e[l]))return!1;return!0}const lineNumberMarkers=Facet.define(),lineNumberWidgetMarker=Facet.define(),lineNumberConfig=Facet.define({combine(o){return combineConfig(o,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,l){let d=Object.assign({},e);for(let p in l){let b=d[p],R=l[p];d[p]=b?(I,z,se)=>b(I,z,se)||R(I,z,se):R}return d}})}});class NumberMarker extends GutterMarker{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function formatNumber(o,e){return o.state.facet(lineNumberConfig).formatNumber(e,o.state)}const lineNumberGutter=activeGutters.compute([lineNumberConfig],o=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(lineNumberMarkers)},lineMarker(e,l,d){return d.some(p=>p.toDOM)?null:new NumberMarker(formatNumber(e,e.state.doc.lineAt(l.from).number))},widgetMarker:(e,l,d)=>{for(let p of e.state.facet(lineNumberWidgetMarker)){let b=p(e,l,d);if(b)return b}return null},lineMarkerChange:e=>e.startState.facet(lineNumberConfig)!=e.state.facet(lineNumberConfig),initialSpacer(e){return new NumberMarker(formatNumber(e,maxLineNumber(e.state.doc.lines)))},updateSpacer(e,l){let d=formatNumber(l.view,maxLineNumber(l.view.state.doc.lines));return d==e.number?e:new NumberMarker(d)},domEventHandlers:o.facet(lineNumberConfig).domEventHandlers}));function lineNumbers(o={}){return[lineNumberConfig.of(o),gutters(),lineNumberGutter]}function maxLineNumber(o){let e=9;for(;e<o;)e=e*10+9;return e}const activeLineGutterMarker=new class extends GutterMarker{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},activeLineGutterHighlighter=gutterLineClass.compute(["selection"],o=>{let e=[],l=-1;for(let d of o.selection.ranges){let p=o.doc.lineAt(d.head).from;p>l&&(l=p,e.push(activeLineGutterMarker.range(p)))}return RangeSet.of(e)});function highlightActiveLineGutter(){return activeLineGutterHighlighter}const DefaultBufferLength=1024;let nextPropID=0;class Range{constructor(e,l){this.from=e,this.to=l}}class NodeProp{constructor(e={}){this.id=nextPropID++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=NodeType.match(e)),l=>{let d=e(l);return d===void 0?null:[this,d]}}}NodeProp.closedBy=new NodeProp({deserialize:o=>o.split(" ")}),NodeProp.openedBy=new NodeProp({deserialize:o=>o.split(" ")}),NodeProp.group=new NodeProp({deserialize:o=>o.split(" ")}),NodeProp.isolate=new NodeProp({deserialize:o=>{if(o&&o!="rtl"&&o!="ltr"&&o!="auto")throw new RangeError("Invalid value for isolate: "+o);return o||"auto"}}),NodeProp.contextHash=new NodeProp({perNode:!0}),NodeProp.lookAhead=new NodeProp({perNode:!0}),NodeProp.mounted=new NodeProp({perNode:!0});class MountedTree{constructor(e,l,d){this.tree=e,this.overlay=l,this.parser=d}static get(e){return e&&e.props&&e.props[NodeProp.mounted.id]}}const noProps=Object.create(null);class NodeType{constructor(e,l,d,p=0){this.name=e,this.props=l,this.id=d,this.flags=p}static define(e){let l=e.props&&e.props.length?Object.create(null):noProps,d=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),p=new NodeType(e.name||"",l,e.id,d);if(e.props){for(let b of e.props)if(Array.isArray(b)||(b=b(p)),b){if(b[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");l[b[0].id]=b[1]}}return p}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let l=this.prop(NodeProp.group);return l?l.indexOf(e)>-1:!1}return this.id==e}static match(e){let l=Object.create(null);for(let d in e)for(let p of d.split(" "))l[p]=e[d];return d=>{for(let p=d.prop(NodeProp.group),b=-1;b<(p?p.length:0);b++){let R=l[b<0?d.name:p[b]];if(R)return R}}}}NodeType.none=new NodeType("",Object.create(null),0,8);class NodeSet{constructor(e){this.types=e;for(let l=0;l<e.length;l++)if(e[l].id!=l)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let l=[];for(let d of this.types){let p=null;for(let b of e){let R=b(d);R&&(p||(p=Object.assign({},d.props)),p[R[0].id]=R[1])}l.push(p?new NodeType(d.name,p,d.id,d.flags):d)}return new NodeSet(l)}}const CachedNode=new WeakMap,CachedInnerNode=new WeakMap;var IterMode;(function(o){o[o.ExcludeBuffers=1]="ExcludeBuffers",o[o.IncludeAnonymous=2]="IncludeAnonymous",o[o.IgnoreMounts=4]="IgnoreMounts",o[o.IgnoreOverlays=8]="IgnoreOverlays"})(IterMode||(IterMode={}));class Tree{constructor(e,l,d,p,b){if(this.type=e,this.children=l,this.positions=d,this.length=p,this.props=null,b&&b.length){this.props=Object.create(null);for(let[R,I]of b)this.props[typeof R=="number"?R:R.id]=I}}toString(){let e=MountedTree.get(this);if(e&&!e.overlay)return e.tree.toString();let l="";for(let d of this.children){let p=d.toString();p&&(l&&(l+=","),l+=p)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(l.length?"("+l+")":""):l}cursor(e=0){return new TreeCursor(this.topNode,e)}cursorAt(e,l=0,d=0){let p=CachedNode.get(this)||this.topNode,b=new TreeCursor(p);return b.moveTo(e,l),CachedNode.set(this,b._tree),b}get topNode(){return new TreeNode(this,0,0,null)}resolve(e,l=0){let d=resolveNode(CachedNode.get(this)||this.topNode,e,l,!1);return CachedNode.set(this,d),d}resolveInner(e,l=0){let d=resolveNode(CachedInnerNode.get(this)||this.topNode,e,l,!0);return CachedInnerNode.set(this,d),d}resolveStack(e,l=0){return stackIterator(this,e,l)}iterate(e){let{enter:l,leave:d,from:p=0,to:b=this.length}=e,R=e.mode||0,I=(R&IterMode.IncludeAnonymous)>0;for(let z=this.cursor(R|IterMode.IncludeAnonymous);;){let se=!1;if(z.from<=b&&z.to>=p&&(!I&&z.type.isAnonymous||l(z)!==!1)){if(z.firstChild())continue;se=!0}for(;se&&d&&(I||!z.type.isAnonymous)&&d(z),!z.nextSibling();){if(!z.parent())return;se=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let l in this.props)e.push([+l,this.props[l]]);return e}balance(e={}){return this.children.length<=8?this:balanceRange(NodeType.none,this.children,this.positions,0,this.children.length,0,this.length,(l,d,p)=>new Tree(this.type,l,d,p,this.propValues),e.makeTree||((l,d,p)=>new Tree(NodeType.none,l,d,p)))}static build(e){return buildTree(e)}}Tree.empty=new Tree(NodeType.none,[],[],0);class FlatBufferCursor{constructor(e,l){this.buffer=e,this.index=l}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new FlatBufferCursor(this.buffer,this.index)}}class TreeBuffer{constructor(e,l,d){this.buffer=e,this.length=l,this.set=d}get type(){return NodeType.none}toString(){let e=[];for(let l=0;l<this.buffer.length;)e.push(this.childString(l)),l=this.buffer[l+3];return e.join(",")}childString(e){let l=this.buffer[e],d=this.buffer[e+3],p=this.set.types[l],b=p.name;if(/\W/.test(b)&&!p.isError&&(b=JSON.stringify(b)),e+=4,d==e)return b;let R=[];for(;e<d;)R.push(this.childString(e)),e=this.buffer[e+3];return b+"("+R.join(",")+")"}findChild(e,l,d,p,b){let{buffer:R}=this,I=-1;for(let z=e;z!=l&&!(checkSide(b,p,R[z+1],R[z+2])&&(I=z,d>0));z=R[z+3]);return I}slice(e,l,d){let p=this.buffer,b=new Uint16Array(l-e),R=0;for(let I=e,z=0;I<l;){b[z++]=p[I++],b[z++]=p[I++]-d;let se=b[z++]=p[I++]-d;b[z++]=p[I++]-e,R=Math.max(R,se)}return new TreeBuffer(b,R,this.set)}}function checkSide(o,e,l,d){switch(o){case-2:return l<e;case-1:return d>=e&&l<e;case 0:return l<e&&d>e;case 1:return l<=e&&d>e;case 2:return d>e;case 4:return!0}}function resolveNode(o,e,l,d){for(var p;o.from==o.to||(l<1?o.from>=e:o.from>e)||(l>-1?o.to<=e:o.to<e);){let R=!d&&o instanceof TreeNode&&o.index<0?null:o.parent;if(!R)return o;o=R}let b=d?0:IterMode.IgnoreOverlays;if(d)for(let R=o,I=R.parent;I;R=I,I=R.parent)R instanceof TreeNode&&R.index<0&&((p=I.enter(e,l,b))===null||p===void 0?void 0:p.from)!=R.from&&(o=I);for(;;){let R=o.enter(e,l,b);if(!R)return o;o=R}}class BaseNode{cursor(e=0){return new TreeCursor(this,e)}getChild(e,l=null,d=null){let p=getChildren(this,e,l,d);return p.length?p[0]:null}getChildren(e,l=null,d=null){return getChildren(this,e,l,d)}resolve(e,l=0){return resolveNode(this,e,l,!1)}resolveInner(e,l=0){return resolveNode(this,e,l,!0)}matchContext(e){return matchNodeContext(this.parent,e)}enterUnfinishedNodesBefore(e){let l=this.childBefore(e),d=this;for(;l;){let p=l.lastChild;if(!p||p.to!=l.to)break;p.type.isError&&p.from==p.to?(d=l,l=p.prevSibling):l=p}return d}get node(){return this}get next(){return this.parent}}class TreeNode extends BaseNode{constructor(e,l,d,p){super(),this._tree=e,this.from=l,this.index=d,this._parent=p}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,l,d,p,b=0){for(let R=this;;){for(let{children:I,positions:z}=R._tree,se=l>0?I.length:-1;e!=se;e+=l){let le=I[e],tn=z[e]+R.from;if(checkSide(p,d,tn,tn+le.length)){if(le instanceof TreeBuffer){if(b&IterMode.ExcludeBuffers)continue;let an=le.findChild(0,le.buffer.length,l,d-tn,p);if(an>-1)return new BufferNode(new BufferContext(R,le,e,tn),null,an)}else if(b&IterMode.IncludeAnonymous||!le.type.isAnonymous||hasChild(le)){let an;if(!(b&IterMode.IgnoreMounts)&&(an=MountedTree.get(le))&&!an.overlay)return new TreeNode(an.tree,tn,e,R);let sn=new TreeNode(le,tn,e,R);return b&IterMode.IncludeAnonymous||!sn.type.isAnonymous?sn:sn.nextChild(l<0?le.children.length-1:0,l,d,p)}}}if(b&IterMode.IncludeAnonymous||!R.type.isAnonymous||(R.index>=0?e=R.index+l:e=l<0?-1:R._parent._tree.children.length,R=R._parent,!R))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,l,d=0){let p;if(!(d&IterMode.IgnoreOverlays)&&(p=MountedTree.get(this._tree))&&p.overlay){let b=e-this.from;for(let{from:R,to:I}of p.overlay)if((l>0?R<=b:R<b)&&(l<0?I>=b:I>b))return new TreeNode(p.tree,p.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,l,d)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function getChildren(o,e,l,d){let p=o.cursor(),b=[];if(!p.firstChild())return b;if(l!=null){for(let R=!1;!R;)if(R=p.type.is(l),!p.nextSibling())return b}for(;;){if(d!=null&&p.type.is(d))return b;if(p.type.is(e)&&b.push(p.node),!p.nextSibling())return d==null?b:[]}}function matchNodeContext(o,e,l=e.length-1){for(let d=o;l>=0;d=d.parent){if(!d)return!1;if(!d.type.isAnonymous){if(e[l]&&e[l]!=d.name)return!1;l--}}return!0}class BufferContext{constructor(e,l,d,p){this.parent=e,this.buffer=l,this.index=d,this.start=p}}class BufferNode extends BaseNode{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,l,d){super(),this.context=e,this._parent=l,this.index=d,this.type=e.buffer.set.types[e.buffer.buffer[d]]}child(e,l,d){let{buffer:p}=this.context,b=p.findChild(this.index+4,p.buffer[this.index+3],e,l-this.context.start,d);return b<0?null:new BufferNode(this.context,this,b)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,l,d=0){if(d&IterMode.ExcludeBuffers)return null;let{buffer:p}=this.context,b=p.findChild(this.index+4,p.buffer[this.index+3],l>0?1:-1,e-this.context.start,l);return b<0?null:new BufferNode(this.context,this,b)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,l=e.buffer[this.index+3];return l<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new BufferNode(this.context,this._parent,l):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,l=this._parent?this._parent.index+4:0;return this.index==l?this.externalSibling(-1):new BufferNode(this.context,this._parent,e.findChild(l,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],l=[],{buffer:d}=this.context,p=this.index+4,b=d.buffer[this.index+3];if(b>p){let R=d.buffer[this.index+1];e.push(d.slice(p,b,R)),l.push(0)}return new Tree(this.type,e,l,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function iterStack(o){if(!o.length)return null;let e=0,l=o[0];for(let b=1;b<o.length;b++){let R=o[b];(R.from>l.from||R.to<l.to)&&(l=R,e=b)}let d=l instanceof TreeNode&&l.index<0?null:l.parent,p=o.slice();return d?p[e]=d:p.splice(e,1),new StackIterator(p,l)}class StackIterator{constructor(e,l){this.heads=e,this.node=l}get next(){return iterStack(this.heads)}}function stackIterator(o,e,l){let d=o.resolveInner(e,l),p=null;for(let b=d instanceof TreeNode?d:d.context.parent;b;b=b.parent)if(b.index<0){let R=b.parent;(p||(p=[d])).push(R.resolve(e,l)),b=R}else{let R=MountedTree.get(b.tree);if(R&&R.overlay&&R.overlay[0].from<=e&&R.overlay[R.overlay.length-1].to>=e){let I=new TreeNode(R.tree,R.overlay[0].from+b.from,-1,b);(p||(p=[d])).push(resolveNode(I,e,l,!1))}}return p?iterStack(p):d}class TreeCursor{get name(){return this.type.name}constructor(e,l=0){if(this.mode=l,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof TreeNode)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let d=e._parent;d;d=d._parent)this.stack.unshift(d.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,l){this.index=e;let{start:d,buffer:p}=this.buffer;return this.type=l||p.set.types[p.buffer[e]],this.from=d+p.buffer[e+1],this.to=d+p.buffer[e+2],!0}yield(e){return e?e instanceof TreeNode?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,l,d){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,l,d,this.mode));let{buffer:p}=this.buffer,b=p.findChild(this.index+4,p.buffer[this.index+3],e,l-this.buffer.start,d);return b<0?!1:(this.stack.push(this.index),this.yieldBuf(b))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,l,d=this.mode){return this.buffer?d&IterMode.ExcludeBuffers?!1:this.enterChild(1,e,l):this.yield(this._tree.enter(e,l,d))}parent(){if(!this.buffer)return this.yieldNode(this.mode&IterMode.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&IterMode.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:l}=this.buffer,d=this.stack.length-1;if(e<0){let p=d<0?0:this.stack[d]+4;if(this.index!=p)return this.yieldBuf(l.findChild(p,this.index,-1,0,4))}else{let p=l.buffer[this.index+3];if(p<(d<0?l.buffer.length:l.buffer[this.stack[d]+3]))return this.yieldBuf(p)}return d<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let l,d,{buffer:p}=this;if(p){if(e>0){if(this.index<p.buffer.buffer.length)return!1}else for(let b=0;b<this.index;b++)if(p.buffer.buffer[b+3]<this.index)return!1;({index:l,parent:d}=p)}else({index:l,_parent:d}=this._tree);for(;d;{index:l,_parent:d}=d)if(l>-1)for(let b=l+e,R=e<0?-1:d._tree.children.length;b!=R;b+=e){let I=d._tree.children[b];if(this.mode&IterMode.IncludeAnonymous||I instanceof TreeBuffer||!I.type.isAnonymous||hasChild(I))return!1}return!0}move(e,l){if(l&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,l=0){for(;(this.from==this.to||(l<1?this.from>=e:this.from>e)||(l>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,l););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,l=null,d=0;if(e&&e.context==this.buffer)e:for(let p=this.index,b=this.stack.length;b>=0;){for(let R=e;R;R=R._parent)if(R.index==p){if(p==this.index)return R;l=R,d=b+1;break e}p=this.stack[--b]}for(let p=d;p<this.stack.length;p++)l=new BufferNode(this.buffer,l,this.stack[p]);return this.bufferNode=new BufferNode(this.buffer,l,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,l){for(let d=0;;){let p=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){d++;continue}this.type.isAnonymous||(p=!0)}for(;;){if(p&&l&&l(this),p=this.type.isAnonymous,!d)return;if(this.nextSibling())break;this.parent(),d--,p=!0}}}matchContext(e){if(!this.buffer)return matchNodeContext(this.node.parent,e);let{buffer:l}=this.buffer,{types:d}=l.set;for(let p=e.length-1,b=this.stack.length-1;p>=0;b--){if(b<0)return matchNodeContext(this._tree,e,p);let R=d[l.buffer[this.stack[b]]];if(!R.isAnonymous){if(e[p]&&e[p]!=R.name)return!1;p--}}return!0}}function hasChild(o){return o.children.some(e=>e instanceof TreeBuffer||!e.type.isAnonymous||hasChild(e))}function buildTree(o){var e;let{buffer:l,nodeSet:d,maxBufferLength:p=DefaultBufferLength,reused:b=[],minRepeatType:R=d.types.length}=o,I=Array.isArray(l)?new FlatBufferCursor(l,l.length):l,z=d.types,se=0,le=0;function tn(bn,Sn,An,Dn,Bn,Nn){let{id:Qn,start:Zn,end:Vn,size:qn}=I,ia=le,ra=se;for(;qn<0;)if(I.next(),qn==-1){let Na=b[Qn];An.push(Na),Dn.push(Zn-bn);return}else if(qn==-3){se=Qn;return}else if(qn==-4){le=Qn;return}else throw new RangeError(`Unrecognized record size: ${qn}`);let aa=z[Qn],jn,ka,Aa=Zn-bn;if(Vn-Zn<=p&&(ka=pn(I.pos-Sn,Bn))){let Na=new Uint16Array(ka.size-ka.skip),Kn=I.pos-ka.size,Ea=Na.length;for(;I.pos>Kn;)Ea=yn(ka.start,Na,Ea);jn=new TreeBuffer(Na,Vn-ka.start,d),Aa=ka.start-bn}else{let Na=I.pos-qn;I.next();let Kn=[],Ea=[],qa=Qn>=R?Qn:-1,va=0,Oa=Vn;for(;I.pos>Na;)qa>=0&&I.id==qa&&I.size>=0?(I.end<=Oa-p&&(ln(Kn,Ea,Zn,va,I.end,Oa,qa,ia,ra),va=Kn.length,Oa=I.end),I.next()):Nn>2500?an(Zn,Na,Kn,Ea):tn(Zn,Na,Kn,Ea,qa,Nn+1);if(qa>=0&&va>0&&va<Kn.length&&ln(Kn,Ea,Zn,va,Zn,Oa,qa,ia,ra),Kn.reverse(),Ea.reverse(),qa>-1&&va>0){let Va=sn(aa,ra);jn=balanceRange(aa,Kn,Ea,0,Kn.length,0,Vn-Zn,Va,Va)}else jn=un(aa,Kn,Ea,Vn-Zn,ia-Vn,ra)}An.push(jn),Dn.push(Aa)}function an(bn,Sn,An,Dn){let Bn=[],Nn=0,Qn=-1;for(;I.pos>Sn;){let{id:Zn,start:Vn,end:qn,size:ia}=I;if(ia>4)I.next();else{if(Qn>-1&&Vn<Qn)break;Qn<0&&(Qn=qn-p),Bn.push(Zn,Vn,qn),Nn++,I.next()}}if(Nn){let Zn=new Uint16Array(Nn*4),Vn=Bn[Bn.length-2];for(let qn=Bn.length-3,ia=0;qn>=0;qn-=3)Zn[ia++]=Bn[qn],Zn[ia++]=Bn[qn+1]-Vn,Zn[ia++]=Bn[qn+2]-Vn,Zn[ia++]=ia;An.push(new TreeBuffer(Zn,Bn[2]-Vn,d)),Dn.push(Vn-bn)}}function sn(bn,Sn){return(An,Dn,Bn)=>{let Nn=0,Qn=An.length-1,Zn,Vn;if(Qn>=0&&(Zn=An[Qn])instanceof Tree){if(!Qn&&Zn.type==bn&&Zn.length==Bn)return Zn;(Vn=Zn.prop(NodeProp.lookAhead))&&(Nn=Dn[Qn]+Zn.length+Vn)}return un(bn,An,Dn,Bn,Nn,Sn)}}function ln(bn,Sn,An,Dn,Bn,Nn,Qn,Zn,Vn){let qn=[],ia=[];for(;bn.length>Dn;)qn.push(bn.pop()),ia.push(Sn.pop()+An-Bn);bn.push(un(d.types[Qn],qn,ia,Nn-Bn,Zn-Nn,Vn)),Sn.push(Bn-An)}function un(bn,Sn,An,Dn,Bn,Nn,Qn){if(Nn){let Zn=[NodeProp.contextHash,Nn];Qn=Qn?[Zn].concat(Qn):[Zn]}if(Bn>25){let Zn=[NodeProp.lookAhead,Bn];Qn=Qn?[Zn].concat(Qn):[Zn]}return new Tree(bn,Sn,An,Dn,Qn)}function pn(bn,Sn){let An=I.fork(),Dn=0,Bn=0,Nn=0,Qn=An.end-p,Zn={size:0,start:0,skip:0};e:for(let Vn=An.pos-bn;An.pos>Vn;){let qn=An.size;if(An.id==Sn&&qn>=0){Zn.size=Dn,Zn.start=Bn,Zn.skip=Nn,Nn+=4,Dn+=4,An.next();continue}let ia=An.pos-qn;if(qn<0||ia<Vn||An.start<Qn)break;let ra=An.id>=R?4:0,aa=An.start;for(An.next();An.pos>ia;){if(An.size<0)if(An.size==-3)ra+=4;else break e;else An.id>=R&&(ra+=4);An.next()}Bn=aa,Dn+=qn,Nn+=ra}return(Sn<0||Dn==bn)&&(Zn.size=Dn,Zn.start=Bn,Zn.skip=Nn),Zn.size>4?Zn:void 0}function yn(bn,Sn,An){let{id:Dn,start:Bn,end:Nn,size:Qn}=I;if(I.next(),Qn>=0&&Dn<R){let Zn=An;if(Qn>4){let Vn=I.pos-(Qn-4);for(;I.pos>Vn;)An=yn(bn,Sn,An)}Sn[--An]=Zn,Sn[--An]=Nn-bn,Sn[--An]=Bn-bn,Sn[--An]=Dn}else Qn==-3?se=Dn:Qn==-4&&(le=Dn);return An}let _n=[],Pn=[];for(;I.pos>0;)tn(o.start||0,o.bufferStart||0,_n,Pn,-1,0);let vn=(e=o.length)!==null&&e!==void 0?e:_n.length?Pn[0]+_n[0].length:0;return new Tree(z[o.topID],_n.reverse(),Pn.reverse(),vn)}const nodeSizeCache=new WeakMap;function nodeSize(o,e){if(!o.isAnonymous||e instanceof TreeBuffer||e.type!=o)return 1;let l=nodeSizeCache.get(e);if(l==null){l=1;for(let d of e.children){if(d.type!=o||!(d instanceof Tree)){l=1;break}l+=nodeSize(o,d)}nodeSizeCache.set(e,l)}return l}function balanceRange(o,e,l,d,p,b,R,I,z){let se=0;for(let ln=d;ln<p;ln++)se+=nodeSize(o,e[ln]);let le=Math.ceil(se*1.5/8),tn=[],an=[];function sn(ln,un,pn,yn,_n){for(let Pn=pn;Pn<yn;){let vn=Pn,bn=un[Pn],Sn=nodeSize(o,ln[Pn]);for(Pn++;Pn<yn;Pn++){let An=nodeSize(o,ln[Pn]);if(Sn+An>=le)break;Sn+=An}if(Pn==vn+1){if(Sn>le){let An=ln[vn];sn(An.children,An.positions,0,An.children.length,un[vn]+_n);continue}tn.push(ln[vn])}else{let An=un[Pn-1]+ln[Pn-1].length-bn;tn.push(balanceRange(o,ln,un,vn,Pn,bn,An,null,z))}an.push(bn+_n-b)}}return sn(e,l,d,p,0),(I||z)(tn,an,R)}class NodeWeakMap{constructor(){this.map=new WeakMap}setBuffer(e,l,d){let p=this.map.get(e);p||this.map.set(e,p=new Map),p.set(l,d)}getBuffer(e,l){let d=this.map.get(e);return d&&d.get(l)}set(e,l){e instanceof BufferNode?this.setBuffer(e.context.buffer,e.index,l):e instanceof TreeNode&&this.map.set(e.tree,l)}get(e){return e instanceof BufferNode?this.getBuffer(e.context.buffer,e.index):e instanceof TreeNode?this.map.get(e.tree):void 0}cursorSet(e,l){e.buffer?this.setBuffer(e.buffer.buffer,e.index,l):this.map.set(e.tree,l)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class TreeFragment{constructor(e,l,d,p,b=!1,R=!1){this.from=e,this.to=l,this.tree=d,this.offset=p,this.open=(b?1:0)|(R?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,l=[],d=!1){let p=[new TreeFragment(0,e.length,e,0,!1,d)];for(let b of l)b.to>e.length&&p.push(b);return p}static applyChanges(e,l,d=128){if(!l.length)return e;let p=[],b=1,R=e.length?e[0]:null;for(let I=0,z=0,se=0;;I++){let le=I<l.length?l[I]:null,tn=le?le.fromA:1e9;if(tn-z>=d)for(;R&&R.from<tn;){let an=R;if(z>=an.from||tn<=an.to||se){let sn=Math.max(an.from,z)-se,ln=Math.min(an.to,tn)-se;an=sn>=ln?null:new TreeFragment(sn,ln,an.tree,an.offset+se,I>0,!!le)}if(an&&p.push(an),R.to>tn)break;R=b<e.length?e[b++]:null}if(!le)break;z=le.toA,se=le.toA-le.toB}return p}}class Parser{startParse(e,l,d){return typeof e=="string"&&(e=new StringInput(e)),d=d?d.length?d.map(p=>new Range(p.from,p.to)):[new Range(0,0)]:[new Range(0,e.length)],this.createParse(e,l||[],d)}parse(e,l,d){let p=this.startParse(e,l,d);for(;;){let b=p.advance();if(b)return b}}}class StringInput{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,l){return this.string.slice(e,l)}}new NodeProp({perNode:!0});let nextTagID=0;class Tag{constructor(e,l,d,p){this.name=e,this.set=l,this.base=d,this.modified=p,this.id=nextTagID++}toString(){let{name:e}=this;for(let l of this.modified)l.name&&(e=`${l.name}(${e})`);return e}static define(e,l){let d=typeof e=="string"?e:"?";if(e instanceof Tag&&(l=e),l?.base)throw new Error("Can not derive from a modified tag");let p=new Tag(d,[],null,[]);if(p.set.push(p),l)for(let b of l.set)p.set.push(b);return p}static defineModifier(e){let l=new Modifier(e);return d=>d.modified.indexOf(l)>-1?d:Modifier.get(d.base||d,d.modified.concat(l).sort((p,b)=>p.id-b.id))}}let nextModifierID=0;class Modifier{constructor(e){this.name=e,this.instances=[],this.id=nextModifierID++}static get(e,l){if(!l.length)return e;let d=l[0].instances.find(I=>I.base==e&&sameArray(l,I.modified));if(d)return d;let p=[],b=new Tag(e.name,p,e,l);for(let I of l)I.instances.push(b);let R=powerSet(l);for(let I of e.set)if(!I.modified.length)for(let z of R)p.push(Modifier.get(I,z));return b}}function sameArray(o,e){return o.length==e.length&&o.every((l,d)=>l==e[d])}function powerSet(o){let e=[[]];for(let l=0;l<o.length;l++)for(let d=0,p=e.length;d<p;d++)e.push(e[d].concat(o[l]));return e.sort((l,d)=>d.length-l.length)}function styleTags(o){let e=Object.create(null);for(let l in o){let d=o[l];Array.isArray(d)||(d=[d]);for(let p of l.split(" "))if(p){let b=[],R=2,I=p;for(let tn=0;;){if(I=="..."&&tn>0&&tn+3==p.length){R=1;break}let an=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(I);if(!an)throw new RangeError("Invalid path: "+p);if(b.push(an[0]=="*"?"":an[0][0]=='"'?JSON.parse(an[0]):an[0]),tn+=an[0].length,tn==p.length)break;let sn=p[tn++];if(tn==p.length&&sn=="!"){R=0;break}if(sn!="/")throw new RangeError("Invalid path: "+p);I=p.slice(tn)}let z=b.length-1,se=b[z];if(!se)throw new RangeError("Invalid path: "+p);let le=new Rule(d,R,z>0?b.slice(0,z):null);e[se]=le.sort(e[se])}}return ruleNodeProp.add(e)}const ruleNodeProp=new NodeProp;class Rule{constructor(e,l,d,p){this.tags=e,this.mode=l,this.context=d,this.next=p}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}Rule.empty=new Rule([],2,null);function tagHighlighter(o,e){let l=Object.create(null);for(let b of o)if(!Array.isArray(b.tag))l[b.tag.id]=b.class;else for(let R of b.tag)l[R.id]=b.class;let{scope:d,all:p=null}=e||{};return{style:b=>{let R=p;for(let I of b)for(let z of I.set){let se=l[z.id];if(se){R=R?R+" "+se:se;break}}return R},scope:d}}function highlightTags(o,e){let l=null;for(let d of o){let p=d.style(e);p&&(l=l?l+" "+p:p)}return l}function highlightTree(o,e,l,d=0,p=o.length){let b=new HighlightBuilder(d,Array.isArray(e)?e:[e],l);b.highlightRange(o.cursor(),d,p,"",b.highlighters),b.flush(p)}class HighlightBuilder{constructor(e,l,d){this.at=e,this.highlighters=l,this.span=d,this.class=""}startSpan(e,l){l!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=l)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,l,d,p,b){let{type:R,from:I,to:z}=e;if(I>=d||z<=l)return;R.isTop&&(b=this.highlighters.filter(sn=>!sn.scope||sn.scope(R)));let se=p,le=getStyleTags(e)||Rule.empty,tn=highlightTags(b,le.tags);if(tn&&(se&&(se+=" "),se+=tn,le.mode==1&&(p+=(p?" ":"")+tn)),this.startSpan(Math.max(l,I),se),le.opaque)return;let an=e.tree&&e.tree.prop(NodeProp.mounted);if(an&&an.overlay){let sn=e.node.enter(an.overlay[0].from+I,1),ln=this.highlighters.filter(pn=>!pn.scope||pn.scope(an.tree.type)),un=e.firstChild();for(let pn=0,yn=I;;pn++){let _n=pn<an.overlay.length?an.overlay[pn]:null,Pn=_n?_n.from+I:z,vn=Math.max(l,yn),bn=Math.min(d,Pn);if(vn<bn&&un)for(;e.from<bn&&(this.highlightRange(e,vn,bn,p,b),this.startSpan(Math.min(bn,e.to),se),!(e.to>=Pn||!e.nextSibling())););if(!_n||Pn>d)break;yn=_n.to+I,yn>l&&(this.highlightRange(sn.cursor(),Math.max(l,_n.from+I),Math.min(d,yn),"",ln),this.startSpan(Math.min(d,yn),se))}un&&e.parent()}else if(e.firstChild()){an&&(p="");do if(!(e.to<=l)){if(e.from>=d)break;this.highlightRange(e,l,d,p,b),this.startSpan(Math.min(d,e.to),se)}while(e.nextSibling());e.parent()}}}function getStyleTags(o){let e=o.type.prop(ruleNodeProp);for(;e&&e.context&&!o.matchContext(e.context);)e=e.next;return e||null}const t=Tag.define,comment=t(),name$2=t(),typeName=t(name$2),propertyName=t(name$2),literal=t(),string=t(literal),number=t(literal),content=t(),heading=t(content),keyword=t(),operator=t(),punctuation$1=t(),bracket=t(punctuation$1),meta=t(),tags={comment,lineComment:t(comment),blockComment:t(comment),docComment:t(comment),name:name$2,variableName:t(name$2),typeName,tagName:t(typeName),propertyName,attributeName:t(propertyName),className:t(name$2),labelName:t(name$2),namespace:t(name$2),macroName:t(name$2),literal,string,docString:t(string),character:t(string),attributeValue:t(string),number,integer:t(number),float:t(number),bool:t(literal),regexp:t(literal),escape:t(literal),color:t(literal),url:t(literal),keyword,self:t(keyword),null:t(keyword),atom:t(keyword),unit:t(keyword),modifier:t(keyword),operatorKeyword:t(keyword),controlKeyword:t(keyword),definitionKeyword:t(keyword),moduleKeyword:t(keyword),operator,derefOperator:t(operator),arithmeticOperator:t(operator),logicOperator:t(operator),bitwiseOperator:t(operator),compareOperator:t(operator),updateOperator:t(operator),definitionOperator:t(operator),typeOperator:t(operator),controlOperator:t(operator),punctuation:punctuation$1,separator:t(punctuation$1),bracket,angleBracket:t(bracket),squareBracket:t(bracket),paren:t(bracket),brace:t(bracket),content,heading,heading1:t(heading),heading2:t(heading),heading3:t(heading),heading4:t(heading),heading5:t(heading),heading6:t(heading),contentSeparator:t(content),list:t(content),quote:t(content),emphasis:t(content),strong:t(content),link:t(content),monospace:t(content),strikethrough:t(content),inserted:t(),deleted:t(),changed:t(),invalid:t(),meta,documentMeta:t(meta),annotation:t(meta),processingInstruction:t(meta),definition:Tag.defineModifier("definition"),constant:Tag.defineModifier("constant"),function:Tag.defineModifier("function"),standard:Tag.defineModifier("standard"),local:Tag.defineModifier("local"),special:Tag.defineModifier("special")};for(let o in tags){let e=tags[o];e instanceof Tag&&(e.name=o)}tagHighlighter([{tag:tags.link,class:"tok-link"},{tag:tags.heading,class:"tok-heading"},{tag:tags.emphasis,class:"tok-emphasis"},{tag:tags.strong,class:"tok-strong"},{tag:tags.keyword,class:"tok-keyword"},{tag:tags.atom,class:"tok-atom"},{tag:tags.bool,class:"tok-bool"},{tag:tags.url,class:"tok-url"},{tag:tags.labelName,class:"tok-labelName"},{tag:tags.inserted,class:"tok-inserted"},{tag:tags.deleted,class:"tok-deleted"},{tag:tags.literal,class:"tok-literal"},{tag:tags.string,class:"tok-string"},{tag:tags.number,class:"tok-number"},{tag:[tags.regexp,tags.escape,tags.special(tags.string)],class:"tok-string2"},{tag:tags.variableName,class:"tok-variableName"},{tag:tags.local(tags.variableName),class:"tok-variableName tok-local"},{tag:tags.definition(tags.variableName),class:"tok-variableName tok-definition"},{tag:tags.special(tags.variableName),class:"tok-variableName2"},{tag:tags.definition(tags.propertyName),class:"tok-propertyName tok-definition"},{tag:tags.typeName,class:"tok-typeName"},{tag:tags.namespace,class:"tok-namespace"},{tag:tags.className,class:"tok-className"},{tag:tags.macroName,class:"tok-macroName"},{tag:tags.propertyName,class:"tok-propertyName"},{tag:tags.operator,class:"tok-operator"},{tag:tags.comment,class:"tok-comment"},{tag:tags.meta,class:"tok-meta"},{tag:tags.invalid,class:"tok-invalid"},{tag:tags.punctuation,class:"tok-punctuation"}]);var _a;const languageDataProp=new NodeProp;function defineLanguageFacet(o){return Facet.define({combine:o?e=>e.concat(o):void 0})}const sublanguageProp=new NodeProp;class Language{constructor(e,l,d=[],p=""){this.data=e,this.name=p,EditorState.prototype.hasOwnProperty("tree")||Object.defineProperty(EditorState.prototype,"tree",{get(){return syntaxTree(this)}}),this.parser=l,this.extension=[language.of(this),EditorState.languageData.of((b,R,I)=>{let z=topNodeAt(b,R,I),se=z.type.prop(languageDataProp);if(!se)return[];let le=b.facet(se),tn=z.type.prop(sublanguageProp);if(tn){let an=z.resolve(R-z.from,I);for(let sn of tn)if(sn.test(an,b)){let ln=b.facet(sn.facet);return sn.type=="replace"?ln:ln.concat(le)}}return le})].concat(d)}isActiveAt(e,l,d=-1){return topNodeAt(e,l,d).type.prop(languageDataProp)==this.data}findRegions(e){let l=e.facet(language);if(l?.data==this.data)return[{from:0,to:e.doc.length}];if(!l||!l.allowsNesting)return[];let d=[],p=(b,R)=>{if(b.prop(languageDataProp)==this.data){d.push({from:R,to:R+b.length});return}let I=b.prop(NodeProp.mounted);if(I){if(I.tree.prop(languageDataProp)==this.data){if(I.overlay)for(let z of I.overlay)d.push({from:z.from+R,to:z.to+R});else d.push({from:R,to:R+b.length});return}else if(I.overlay){let z=d.length;if(p(I.tree,I.overlay[0].from+R),d.length>z)return}}for(let z=0;z<b.children.length;z++){let se=b.children[z];se instanceof Tree&&p(se,b.positions[z]+R)}};return p(syntaxTree(e),0),d}get allowsNesting(){return!0}}Language.setState=StateEffect.define();function topNodeAt(o,e,l){let d=o.facet(language),p=syntaxTree(o).topNode;if(!d||d.allowsNesting)for(let b=p;b;b=b.enter(e,l,IterMode.ExcludeBuffers))b.type.isTop&&(p=b);return p}class LRLanguage extends Language{constructor(e,l,d){super(e,l,[],d),this.parser=l}static define(e){let l=defineLanguageFacet(e.languageData);return new LRLanguage(l,e.parser.configure({props:[languageDataProp.add(d=>d.isTop?l:void 0)]}),e.name)}configure(e,l){return new LRLanguage(this.data,this.parser.configure(e),l||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function syntaxTree(o){let e=o.field(Language.state,!1);return e?e.tree:Tree.empty}function ensureSyntaxTree(o,e,l=50){var d;let p=(d=o.field(Language.state,!1))===null||d===void 0?void 0:d.context;if(!p)return null;let b=p.viewport;p.updateViewport({from:0,to:e});let R=p.isDone(e)||p.work(l,e)?p.tree:null;return p.updateViewport(b),R}class DocInput{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,l){let d=this.cursorPos-this.string.length;return e<d||l>=this.cursorPos?this.doc.sliceString(e,l):this.string.slice(e-d,l-d)}}let currentContext=null;class ParseContext{constructor(e,l,d=[],p,b,R,I,z){this.parser=e,this.state=l,this.fragments=d,this.tree=p,this.treeLen=b,this.viewport=R,this.skipped=I,this.scheduleOn=z,this.parse=null,this.tempSkipped=[]}static create(e,l,d){return new ParseContext(e,l,[],Tree.empty,0,d,[],null)}startParse(){return this.parser.startParse(new DocInput(this.state.doc),this.fragments)}work(e,l){return l!=null&&l>=this.state.doc.length&&(l=void 0),this.tree!=Tree.empty&&this.isDone(l??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var d;if(typeof e=="number"){let p=Date.now()+e;e=()=>Date.now()>p}for(this.parse||(this.parse=this.startParse()),l!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>l)&&l<this.state.doc.length&&this.parse.stopAt(l);;){let p=this.parse.advance();if(p)if(this.fragments=this.withoutTempSkipped(TreeFragment.addTree(p,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(d=this.parse.stoppedAt)!==null&&d!==void 0?d:this.state.doc.length,this.tree=p,this.parse=null,this.treeLen<(l??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,l;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(l=this.parse.advance()););}),this.treeLen=e,this.tree=l,this.fragments=this.withoutTempSkipped(TreeFragment.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let l=currentContext;currentContext=this;try{return e()}finally{currentContext=l}}withoutTempSkipped(e){for(let l;l=this.tempSkipped.pop();)e=cutFragments(e,l.from,l.to);return e}changes(e,l){let{fragments:d,tree:p,treeLen:b,viewport:R,skipped:I}=this;if(this.takeTree(),!e.empty){let z=[];if(e.iterChangedRanges((se,le,tn,an)=>z.push({fromA:se,toA:le,fromB:tn,toB:an})),d=TreeFragment.applyChanges(d,z),p=Tree.empty,b=0,R={from:e.mapPos(R.from,-1),to:e.mapPos(R.to,1)},this.skipped.length){I=[];for(let se of this.skipped){let le=e.mapPos(se.from,1),tn=e.mapPos(se.to,-1);le<tn&&I.push({from:le,to:tn})}}}return new ParseContext(this.parser,l,d,p,b,R,I,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let l=this.skipped.length;for(let d=0;d<this.skipped.length;d++){let{from:p,to:b}=this.skipped[d];p<e.to&&b>e.from&&(this.fragments=cutFragments(this.fragments,p,b),this.skipped.splice(d--,1))}return this.skipped.length>=l?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,l){this.skipped.push({from:e,to:l})}static getSkippingParser(e){return new class extends Parser{createParse(l,d,p){let b=p[0].from,R=p[p.length-1].to;return{parsedPos:b,advance(){let z=currentContext;if(z){for(let se of p)z.tempSkipped.push(se);e&&(z.scheduleOn=z.scheduleOn?Promise.all([z.scheduleOn,e]):e)}return this.parsedPos=R,new Tree(NodeType.none,[],[],R-b)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let l=this.fragments;return this.treeLen>=e&&l.length&&l[0].from==0&&l[0].to>=e}static get(){return currentContext}}function cutFragments(o,e,l){return TreeFragment.applyChanges(o,[{fromA:e,toA:l,fromB:e,toB:l}])}class LanguageState{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let l=this.context.changes(e.changes,e.state),d=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),l.viewport.to);return l.work(20,d)||l.takeTree(),new LanguageState(l)}static init(e){let l=Math.min(3e3,e.doc.length),d=ParseContext.create(e.facet(language).parser,e,{from:0,to:l});return d.work(20,l)||d.takeTree(),new LanguageState(d)}}Language.state=StateField.define({create:LanguageState.init,update(o,e){for(let l of e.effects)if(l.is(Language.setState))return l.value;return e.startState.facet(language)!=e.state.facet(language)?LanguageState.init(e.state):o.apply(e)}});let requestIdle=o=>{let e=setTimeout(()=>o(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(requestIdle=o=>{let e=-1,l=setTimeout(()=>{e=requestIdleCallback(o,{timeout:400})},100);return()=>e<0?clearTimeout(l):cancelIdleCallback(e)});const isInputPending=typeof navigator<"u"&&(!((_a=navigator.scheduling)===null||_a===void 0)&&_a.isInputPending)?()=>navigator.scheduling.isInputPending():null,parseWorker=ViewPlugin.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let l=this.view.state.field(Language.state).context;(l.updateViewport(e.view.viewport)||this.view.viewport.to>l.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(l)}scheduleWork(){if(this.working)return;let{state:e}=this.view,l=e.field(Language.state);(l.tree!=l.context.tree||!l.context.isDone(e.doc.length))&&(this.working=requestIdle(this.work))}work(e){this.working=null;let l=Date.now();if(this.chunkEnd<l&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=l+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:d,viewport:{to:p}}=this.view,b=d.field(Language.state);if(b.tree==b.context.tree&&b.context.isDone(p+1e5))return;let R=Date.now()+Math.min(this.chunkBudget,100,e&&!isInputPending?Math.max(25,e.timeRemaining()-5):1e9),I=b.context.treeLen<p&&d.doc.length>p+1e3,z=b.context.work(()=>isInputPending&&isInputPending()||Date.now()>R,p+(I?0:1e5));this.chunkBudget-=Date.now()-l,(z||this.chunkBudget<=0)&&(b.context.takeTree(),this.view.dispatch({effects:Language.setState.of(new LanguageState(b.context))})),this.chunkBudget>0&&!(z&&!I)&&this.scheduleWork(),this.checkAsyncSchedule(b.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(l=>logException(this.view.state,l)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),language=Facet.define({combine(o){return o.length?o[0]:null},enables:o=>[Language.state,parseWorker,EditorView.contentAttributes.compute([o],e=>{let l=e.facet(o);return l&&l.name?{"data-language":l.name}:{}})]});class LanguageSupport{constructor(e,l=[]){this.language=e,this.support=l,this.extension=[e,l]}}const indentService=Facet.define(),indentUnit=Facet.define({combine:o=>{if(!o.length)return" ";let e=o[0];if(!e||/\S/.test(e)||Array.from(e).some(l=>l!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(o[0]));return e}});function getIndentUnit(o){let e=o.facet(indentUnit);return e.charCodeAt(0)==9?o.tabSize*e.length:e.length}function indentString(o,e){let l="",d=o.tabSize,p=o.facet(indentUnit)[0];if(p==" "){for(;e>=d;)l+=" ",e-=d;p=" "}for(let b=0;b<e;b++)l+=p;return l}function getIndentation(o,e){o instanceof EditorState&&(o=new IndentContext(o));for(let d of o.state.facet(indentService)){let p=d(o,e);if(p!==void 0)return p}let l=syntaxTree(o.state);return l.length>=e?syntaxIndentation(o,l,e):null}class IndentContext{constructor(e,l={}){this.state=e,this.options=l,this.unit=getIndentUnit(e)}lineAt(e,l=1){let d=this.state.doc.lineAt(e),{simulateBreak:p,simulateDoubleBreak:b}=this.options;return p!=null&&p>=d.from&&p<=d.to?b&&p==e?{text:"",from:e}:(l<0?p<e:p<=e)?{text:d.text.slice(p-d.from),from:p}:{text:d.text.slice(0,p-d.from),from:d.from}:d}textAfterPos(e,l=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:d,from:p}=this.lineAt(e,l);return d.slice(e-p,Math.min(d.length,e+100-p))}column(e,l=1){let{text:d,from:p}=this.lineAt(e,l),b=this.countColumn(d,e-p),R=this.options.overrideIndentation?this.options.overrideIndentation(p):-1;return R>-1&&(b+=R-this.countColumn(d,d.search(/\S|$/))),b}countColumn(e,l=e.length){return countColumn(e,this.state.tabSize,l)}lineIndent(e,l=1){let{text:d,from:p}=this.lineAt(e,l),b=this.options.overrideIndentation;if(b){let R=b(p);if(R>-1)return R}return this.countColumn(d,d.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const indentNodeProp=new NodeProp;function syntaxIndentation(o,e,l){let d=e.resolveStack(l),p=e.resolveInner(l,-1).resolve(l,0).enterUnfinishedNodesBefore(l);if(p!=d.node){let b=[];for(let R=p;R&&!(R.from==d.node.from&&R.type==d.node.type);R=R.parent)b.push(R);for(let R=b.length-1;R>=0;R--)d={node:b[R],next:d}}return indentFor(d,o,l)}function indentFor(o,e,l){for(let d=o;d;d=d.next){let p=indentStrategy(d.node);if(p)return p(TreeIndentContext.create(e,l,d))}return 0}function ignoreClosed(o){return o.pos==o.options.simulateBreak&&o.options.simulateDoubleBreak}function indentStrategy(o){let e=o.type.prop(indentNodeProp);if(e)return e;let l=o.firstChild,d;if(l&&(d=l.type.prop(NodeProp.closedBy))){let p=o.lastChild,b=p&&d.indexOf(p.name)>-1;return R=>delimitedStrategy(R,!0,1,void 0,b&&!ignoreClosed(R)?p.from:void 0)}return o.parent==null?topIndent:null}function topIndent(){return 0}class TreeIndentContext extends IndentContext{constructor(e,l,d){super(e.state,e.options),this.base=e,this.pos=l,this.context=d}get node(){return this.context.node}static create(e,l,d){return new TreeIndentContext(e,l,d)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let l=this.state.doc.lineAt(e.from);for(;;){let d=e.resolve(l.from);for(;d.parent&&d.parent.from==d.from;)d=d.parent;if(isParent(d,e))break;l=this.state.doc.lineAt(d.from)}return this.lineIndent(l.from)}continue(){return indentFor(this.context.next,this.base,this.pos)}}function isParent(o,e){for(let l=e;l;l=l.parent)if(o==l)return!0;return!1}function bracketedAligned(o){let e=o.node,l=e.childAfter(e.from),d=e.lastChild;if(!l)return null;let p=o.options.simulateBreak,b=o.state.doc.lineAt(l.from),R=p==null||p<=b.from?b.to:Math.min(b.to,p);for(let I=l.to;;){let z=e.childAfter(I);if(!z||z==d)return null;if(!z.type.isSkipped){if(z.from>=R)return null;let se=/^ */.exec(b.text.slice(l.to-b.from))[0].length;return{from:l.from,to:l.to+se}}I=z.to}}function delimitedIndent({closing:o,align:e=!0,units:l=1}){return d=>delimitedStrategy(d,e,l,o)}function delimitedStrategy(o,e,l,d,p){let b=o.textAfter,R=b.match(/^\s*/)[0].length,I=d&&b.slice(R,R+d.length)==d||p==o.pos+R,z=e?bracketedAligned(o):null;return z?I?o.column(z.from):o.column(z.to):o.baseIndent+(I?0:o.unit*l)}const flatIndent=o=>o.baseIndent;function continuedIndent({except:o,units:e=1}={}){return l=>{let d=o&&o.test(l.textAfter);return l.baseIndent+(d?0:e*l.unit)}}const foldService=Facet.define(),foldNodeProp=new NodeProp;function foldInside(o){let e=o.firstChild,l=o.lastChild;return e&&e.to<l.from?{from:e.to,to:l.type.isError?o.to:l.from}:null}function syntaxFolding(o,e,l){let d=syntaxTree(o);if(d.length<l)return null;let p=d.resolveStack(l,1),b=null;for(let R=p;R;R=R.next){let I=R.node;if(I.to<=l||I.from>l)continue;if(b&&I.from<e)break;let z=I.type.prop(foldNodeProp);if(z&&(I.to<d.length-50||d.length==o.doc.length||!isUnfinished(I))){let se=z(I,o);se&&se.from<=l&&se.from>=e&&se.to>l&&(b=se)}}return b}function isUnfinished(o){let e=o.lastChild;return e&&e.to==o.to&&e.type.isError}function foldable(o,e,l){for(let d of o.facet(foldService)){let p=d(o,e,l);if(p)return p}return syntaxFolding(o,e,l)}function mapRange(o,e){let l=e.mapPos(o.from,1),d=e.mapPos(o.to,-1);return l>=d?void 0:{from:l,to:d}}const foldEffect=StateEffect.define({map:mapRange}),unfoldEffect=StateEffect.define({map:mapRange});function selectedLines(o){let e=[];for(let{head:l}of o.state.selection.ranges)e.some(d=>d.from<=l&&d.to>=l)||e.push(o.lineBlockAt(l));return e}const foldState=StateField.define({create(){return Decoration.none},update(o,e){o=o.map(e.changes);for(let l of e.effects)if(l.is(foldEffect)&&!foldExists(o,l.value.from,l.value.to)){let{preparePlaceholder:d}=e.state.facet(foldConfig),p=d?Decoration.replace({widget:new PreparedFoldWidget(d(e.state,l.value))}):foldWidget;o=o.update({add:[p.range(l.value.from,l.value.to)]})}else l.is(unfoldEffect)&&(o=o.update({filter:(d,p)=>l.value.from!=d||l.value.to!=p,filterFrom:l.value.from,filterTo:l.value.to}));if(e.selection){let l=!1,{head:d}=e.selection.main;o.between(d,d,(p,b)=>{p<d&&b>d&&(l=!0)}),l&&(o=o.update({filterFrom:d,filterTo:d,filter:(p,b)=>b<=d||p>=d}))}return o},provide:o=>EditorView.decorations.from(o),toJSON(o,e){let l=[];return o.between(0,e.doc.length,(d,p)=>{l.push(d,p)}),l},fromJSON(o){if(!Array.isArray(o)||o.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let l=0;l<o.length;){let d=o[l++],p=o[l++];if(typeof d!="number"||typeof p!="number")throw new RangeError("Invalid JSON for fold state");e.push(foldWidget.range(d,p))}return Decoration.set(e,!0)}});function findFold(o,e,l){var d;let p=null;return(d=o.field(foldState,!1))===null||d===void 0||d.between(e,l,(b,R)=>{(!p||p.from>b)&&(p={from:b,to:R})}),p}function foldExists(o,e,l){let d=!1;return o.between(e,e,(p,b)=>{p==e&&b==l&&(d=!0)}),d}function maybeEnable(o,e){return o.field(foldState,!1)?e:e.concat(StateEffect.appendConfig.of(codeFolding()))}const foldCode=o=>{for(let e of selectedLines(o)){let l=foldable(o.state,e.from,e.to);if(l)return o.dispatch({effects:maybeEnable(o.state,[foldEffect.of(l),announceFold(o,l)])}),!0}return!1},unfoldCode=o=>{if(!o.state.field(foldState,!1))return!1;let e=[];for(let l of selectedLines(o)){let d=findFold(o.state,l.from,l.to);d&&e.push(unfoldEffect.of(d),announceFold(o,d,!1))}return e.length&&o.dispatch({effects:e}),e.length>0};function announceFold(o,e,l=!0){let d=o.state.doc.lineAt(e.from).number,p=o.state.doc.lineAt(e.to).number;return EditorView.announce.of(`${o.state.phrase(l?"Folded lines":"Unfolded lines")} ${d} ${o.state.phrase("to")} ${p}.`)}const foldAll=o=>{let{state:e}=o,l=[];for(let d=0;d<e.doc.length;){let p=o.lineBlockAt(d),b=foldable(e,p.from,p.to);b&&l.push(foldEffect.of(b)),d=(b?o.lineBlockAt(b.to):p).to+1}return l.length&&o.dispatch({effects:maybeEnable(o.state,l)}),!!l.length},unfoldAll=o=>{let e=o.state.field(foldState,!1);if(!e||!e.size)return!1;let l=[];return e.between(0,o.state.doc.length,(d,p)=>{l.push(unfoldEffect.of({from:d,to:p}))}),o.dispatch({effects:l}),!0},defaultConfig={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},foldConfig=Facet.define({combine(o){return combineConfig(o,defaultConfig)}});function codeFolding(o){return[foldState,baseTheme$1$1]}function widgetToDOM(o,e){let{state:l}=o,d=l.facet(foldConfig),p=R=>{let I=o.lineBlockAt(o.posAtDOM(R.target)),z=findFold(o.state,I.from,I.to);z&&o.dispatch({effects:unfoldEffect.of(z)}),R.preventDefault()};if(d.placeholderDOM)return d.placeholderDOM(o,p,e);let b=document.createElement("span");return b.textContent=d.placeholderText,b.setAttribute("aria-label",l.phrase("folded code")),b.title=l.phrase("unfold"),b.className="cm-foldPlaceholder",b.onclick=p,b}const foldWidget=Decoration.replace({widget:new class extends WidgetType{toDOM(o){return widgetToDOM(o,null)}}});class PreparedFoldWidget extends WidgetType{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return widgetToDOM(e,this.value)}}const baseTheme$1$1=EditorView.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class HighlightStyle{constructor(e,l){this.specs=e;let d;function p(I){let z=StyleModule.newName();return(d||(d=Object.create(null)))["."+z]=I,z}const b=typeof l.all=="string"?l.all:l.all?p(l.all):void 0,R=l.scope;this.scope=R instanceof Language?I=>I.prop(languageDataProp)==R.data:R?I=>I==R:void 0,this.style=tagHighlighter(e.map(I=>({tag:I.tag,class:I.class||p(Object.assign({},I,{tag:null}))})),{all:b}).style,this.module=d?new StyleModule(d):null,this.themeType=l.themeType}static define(e,l){return new HighlightStyle(e,l||{})}}const highlighterFacet=Facet.define(),fallbackHighlighter=Facet.define({combine(o){return o.length?[o[0]]:null}});function getHighlighters(o){let e=o.facet(highlighterFacet);return e.length?e:o.facet(fallbackHighlighter)}function syntaxHighlighting(o,e){let l=[treeHighlighter],d;return o instanceof HighlightStyle&&(o.module&&l.push(EditorView.styleModule.of(o.module)),d=o.themeType),e?.fallback?l.push(fallbackHighlighter.of(o)):d?l.push(highlighterFacet.computeN([EditorView.darkTheme],p=>p.facet(EditorView.darkTheme)==(d=="dark")?[o]:[])):l.push(highlighterFacet.of(o)),l}class TreeHighlighter{constructor(e){this.markCache=Object.create(null),this.tree=syntaxTree(e.state),this.decorations=this.buildDeco(e,getHighlighters(e.state)),this.decoratedTo=e.viewport.to}update(e){let l=syntaxTree(e.state),d=getHighlighters(e.state),p=d!=getHighlighters(e.startState),{viewport:b}=e.view,R=e.changes.mapPos(this.decoratedTo,1);l.length<b.to&&!p&&l.type==this.tree.type&&R>=b.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=R):(l!=this.tree||e.viewportChanged||p)&&(this.tree=l,this.decorations=this.buildDeco(e.view,d),this.decoratedTo=b.to)}buildDeco(e,l){if(!l||!this.tree.length)return Decoration.none;let d=new RangeSetBuilder;for(let{from:p,to:b}of e.visibleRanges)highlightTree(this.tree,l,(R,I,z)=>{d.add(R,I,this.markCache[z]||(this.markCache[z]=Decoration.mark({class:z})))},p,b);return d.finish()}}const treeHighlighter=Prec.high(ViewPlugin.fromClass(TreeHighlighter,{decorations:o=>o.decorations})),defaultHighlightStyle=HighlightStyle.define([{tag:tags.meta,color:"#404740"},{tag:tags.link,textDecoration:"underline"},{tag:tags.heading,textDecoration:"underline",fontWeight:"bold"},{tag:tags.emphasis,fontStyle:"italic"},{tag:tags.strong,fontWeight:"bold"},{tag:tags.strikethrough,textDecoration:"line-through"},{tag:tags.keyword,color:"#708"},{tag:[tags.atom,tags.bool,tags.url,tags.contentSeparator,tags.labelName],color:"#219"},{tag:[tags.literal,tags.inserted],color:"#164"},{tag:[tags.string,tags.deleted],color:"#a11"},{tag:[tags.regexp,tags.escape,tags.special(tags.string)],color:"#e40"},{tag:tags.definition(tags.variableName),color:"#00f"},{tag:tags.local(tags.variableName),color:"#30a"},{tag:[tags.typeName,tags.namespace],color:"#085"},{tag:tags.className,color:"#167"},{tag:[tags.special(tags.variableName),tags.macroName],color:"#256"},{tag:tags.definition(tags.propertyName),color:"#00c"},{tag:tags.comment,color:"#940"},{tag:tags.invalid,color:"#f00"}]),baseTheme$4=EditorView.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),DefaultScanDist=1e4,DefaultBrackets="()[]{}",bracketMatchingConfig=Facet.define({combine(o){return combineConfig(o,{afterCursor:!0,brackets:DefaultBrackets,maxScanDistance:DefaultScanDist,renderMatch:defaultRenderMatch})}}),matchingMark=Decoration.mark({class:"cm-matchingBracket"}),nonmatchingMark=Decoration.mark({class:"cm-nonmatchingBracket"});function defaultRenderMatch(o){let e=[],l=o.matched?matchingMark:nonmatchingMark;return e.push(l.range(o.start.from,o.start.to)),o.end&&e.push(l.range(o.end.from,o.end.to)),e}const bracketMatchingState=StateField.define({create(){return Decoration.none},update(o,e){if(!e.docChanged&&!e.selection)return o;let l=[],d=e.state.facet(bracketMatchingConfig);for(let p of e.state.selection.ranges){if(!p.empty)continue;let b=matchBrackets(e.state,p.head,-1,d)||p.head>0&&matchBrackets(e.state,p.head-1,1,d)||d.afterCursor&&(matchBrackets(e.state,p.head,1,d)||p.head<e.state.doc.length&&matchBrackets(e.state,p.head+1,-1,d));b&&(l=l.concat(d.renderMatch(b,e.state)))}return Decoration.set(l,!0)},provide:o=>EditorView.decorations.from(o)}),bracketMatchingUnique=[bracketMatchingState,baseTheme$4];function bracketMatching(o={}){return[bracketMatchingConfig.of(o),bracketMatchingUnique]}const bracketMatchingHandle=new NodeProp;function matchingNodes(o,e,l){let d=o.prop(e<0?NodeProp.openedBy:NodeProp.closedBy);if(d)return d;if(o.name.length==1){let p=l.indexOf(o.name);if(p>-1&&p%2==(e<0?1:0))return[l[p+e]]}return null}function findHandle(o){let e=o.type.prop(bracketMatchingHandle);return e?e(o.node):o}function matchBrackets(o,e,l,d={}){let p=d.maxScanDistance||DefaultScanDist,b=d.brackets||DefaultBrackets,R=syntaxTree(o),I=R.resolveInner(e,l);for(let z=I;z;z=z.parent){let se=matchingNodes(z.type,l,b);if(se&&z.from<z.to){let le=findHandle(z);if(le&&(l>0?e>=le.from&&e<le.to:e>le.from&&e<=le.to))return matchMarkedBrackets(o,e,l,z,le,se,b)}}return matchPlainBrackets(o,e,l,R,I.type,p,b)}function matchMarkedBrackets(o,e,l,d,p,b,R){let I=d.parent,z={from:p.from,to:p.to},se=0,le=I?.cursor();if(le&&(l<0?le.childBefore(d.from):le.childAfter(d.to)))do if(l<0?le.to<=d.from:le.from>=d.to){if(se==0&&b.indexOf(le.type.name)>-1&&le.from<le.to){let tn=findHandle(le);return{start:z,end:tn?{from:tn.from,to:tn.to}:void 0,matched:!0}}else if(matchingNodes(le.type,l,R))se++;else if(matchingNodes(le.type,-l,R)){if(se==0){let tn=findHandle(le);return{start:z,end:tn&&tn.from<tn.to?{from:tn.from,to:tn.to}:void 0,matched:!1}}se--}}while(l<0?le.prevSibling():le.nextSibling());return{start:z,matched:!1}}function matchPlainBrackets(o,e,l,d,p,b,R){let I=l<0?o.sliceDoc(e-1,e):o.sliceDoc(e,e+1),z=R.indexOf(I);if(z<0||z%2==0!=l>0)return null;let se={from:l<0?e-1:e,to:l>0?e+1:e},le=o.doc.iterRange(e,l>0?o.doc.length:0),tn=0;for(let an=0;!le.next().done&&an<=b;){let sn=le.value;l<0&&(an+=sn.length);let ln=e+an*l;for(let un=l>0?0:sn.length-1,pn=l>0?sn.length:-1;un!=pn;un+=l){let yn=R.indexOf(sn[un]);if(!(yn<0||d.resolveInner(ln+un,1).type!=p))if(yn%2==0==l>0)tn++;else{if(tn==1)return{start:se,end:{from:ln+un,to:ln+un+1},matched:yn>>1==z>>1};tn--}}l>0&&(an+=sn.length)}return le.done?{start:se,matched:!1}:null}function countCol(o,e,l,d=0,p=0){e==null&&(e=o.search(/[^\s\u00a0]/),e==-1&&(e=o.length));let b=p;for(let R=d;R<e;R++)o.charCodeAt(R)==9?b+=l-b%l:b++;return b}class StringStream{constructor(e,l,d,p){this.string=e,this.tabSize=l,this.indentUnit=d,this.overrideIndent=p,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let l=this.string.charAt(this.pos),d;if(typeof e=="string"?d=l==e:d=l&&(e instanceof RegExp?e.test(l):e(l)),d)return++this.pos,l}eatWhile(e){let l=this.pos;for(;this.eat(e););return this.pos>l}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let l=this.string.indexOf(e,this.pos);if(l>-1)return this.pos=l,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=countCol(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var e;return(e=this.overrideIndent)!==null&&e!==void 0?e:countCol(this.string,null,this.tabSize)}match(e,l,d){if(typeof e=="string"){let p=R=>d?R.toLowerCase():R,b=this.string.substr(this.pos,e.length);return p(b)==p(e)?(l!==!1&&(this.pos+=e.length),!0):null}else{let p=this.string.slice(this.pos).match(e);return p&&p.index>0?null:(p&&l!==!1&&(this.pos+=p[0].length),p)}}current(){return this.string.slice(this.start,this.pos)}}const noTokens=Object.create(null),typeArray=[NodeType.none],warned=[],byTag=Object.create(null),defaultTable=Object.create(null);for(let[o,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])defaultTable[o]=createTokenType(noTokens,e);function warnForPart(o,e){warned.indexOf(o)>-1||(warned.push(o),console.warn(e))}function createTokenType(o,e){let l=[];for(let I of e.split(" ")){let z=[];for(let se of I.split(".")){let le=o[se]||tags[se];le?typeof le=="function"?z.length?z=z.map(le):warnForPart(se,`Modifier ${se} used at start of tag`):z.length?warnForPart(se,`Tag ${se} used as modifier`):z=Array.isArray(le)?le:[le]:warnForPart(se,`Unknown highlighting tag ${se}`)}for(let se of z)l.push(se)}if(!l.length)return 0;let d=e.replace(/ /g,"_"),p=d+" "+l.map(I=>I.id),b=byTag[p];if(b)return b.id;let R=byTag[p]=NodeType.define({id:typeArray.length,name:d,props:[styleTags({[d]:l})]});return typeArray.push(R),R.id}Direction.RTL,Direction.LTR;class CompletionContext{constructor(e,l,d,p){this.state=e,this.pos=l,this.explicit=d,this.view=p,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let l=syntaxTree(this.state).resolveInner(this.pos,-1);for(;l&&e.indexOf(l.name)<0;)l=l.parent;return l?{from:l.from,to:this.pos,text:this.state.sliceDoc(l.from,this.pos),type:l.type}:null}matchBefore(e){let l=this.state.doc.lineAt(this.pos),d=Math.max(l.from,this.pos-250),p=l.text.slice(d-l.from,this.pos-l.from),b=p.search(ensureAnchor(e,!1));return b<0?null:{from:d+b,to:this.pos,text:p.slice(b)}}get aborted(){return this.abortListeners==null}addEventListener(e,l,d){e=="abort"&&this.abortListeners&&(this.abortListeners.push(l),d&&d.onDocChange&&(this.abortOnDocChange=!0))}}function toSet(o){let e=Object.keys(o).join(""),l=/\w/.test(e);return l&&(e=e.replace(/\w/g,"")),`[${l?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function prefixMatch(o){let e=Object.create(null),l=Object.create(null);for(let{label:p}of o){e[p[0]]=!0;for(let b=1;b<p.length;b++)l[p[b]]=!0}let d=toSet(e)+toSet(l)+"*$";return[new RegExp("^"+d),new RegExp(d)]}function completeFromList(o){let e=o.map(p=>typeof p=="string"?{label:p}:p),[l,d]=e.every(p=>/^\w+$/.test(p.label))?[/\w*$/,/\w+$/]:prefixMatch(e);return p=>{let b=p.matchBefore(d);return b||p.explicit?{from:b?b.from:p.pos,options:e,validFor:l}:null}}function ifNotIn(o,e){return l=>{for(let d=syntaxTree(l.state).resolveInner(l.pos,-1);d;d=d.parent){if(o.indexOf(d.name)>-1)return null;if(d.type.isTop)break}return e(l)}}class Option{constructor(e,l,d,p){this.completion=e,this.source=l,this.match=d,this.score=p}}function cur(o){return o.selection.main.from}function ensureAnchor(o,e){var l;let{source:d}=o,p=e&&d[0]!="^",b=d[d.length-1]!="$";return!p&&!b?o:new RegExp(`${p?"^":""}(?:${d})${b?"$":""}`,(l=o.flags)!==null&&l!==void 0?l:o.ignoreCase?"i":"")}const pickedCompletion=Annotation.define();function insertCompletionText(o,e,l,d){let{main:p}=o.selection,b=l-p.from,R=d-p.from;return Object.assign(Object.assign({},o.changeByRange(I=>{if(I!=p&&l!=d&&o.sliceDoc(I.from+b,I.from+R)!=o.sliceDoc(l,d))return{range:I};let z=o.toText(e);return{changes:{from:I.from+b,to:d==p.from?I.to:I.from+R,insert:z},range:EditorSelection.cursor(I.from+b+z.length)}})),{scrollIntoView:!0,userEvent:"input.complete"})}const SourceCache=new WeakMap;function asSource(o){if(!Array.isArray(o))return o;let e=SourceCache.get(o);return e||SourceCache.set(o,e=completeFromList(o)),e}const startCompletionEffect=StateEffect.define(),closeCompletionEffect=StateEffect.define();class FuzzyMatcher{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let l=0;l<e.length;){let d=codePointAt(e,l),p=codePointSize(d);this.chars.push(d);let b=e.slice(l,l+p),R=b.toUpperCase();this.folded.push(codePointAt(R==b?b.toLowerCase():R,0)),l+=p}this.astral=e.length!=this.chars.length}ret(e,l){return this.score=e,this.matched=l,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:l,folded:d,any:p,precise:b,byWord:R}=this;if(l.length==1){let _n=codePointAt(e,0),Pn=codePointSize(_n),vn=Pn==e.length?0:-100;if(_n!=l[0])if(_n==d[0])vn+=-200;else return null;return this.ret(vn,[0,Pn])}let I=e.indexOf(this.pattern);if(I==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let z=l.length,se=0;if(I<0){for(let _n=0,Pn=Math.min(e.length,200);_n<Pn&&se<z;){let vn=codePointAt(e,_n);(vn==l[se]||vn==d[se])&&(p[se++]=_n),_n+=codePointSize(vn)}if(se<z)return null}let le=0,tn=0,an=!1,sn=0,ln=-1,un=-1,pn=/[a-z]/.test(e),yn=!0;for(let _n=0,Pn=Math.min(e.length,200),vn=0;_n<Pn&&tn<z;){let bn=codePointAt(e,_n);I<0&&(le<z&&bn==l[le]&&(b[le++]=_n),sn<z&&(bn==l[sn]||bn==d[sn]?(sn==0&&(ln=_n),un=_n+1,sn++):sn=0));let Sn,An=bn<255?bn>=48&&bn<=57||bn>=97&&bn<=122?2:bn>=65&&bn<=90?1:0:(Sn=fromCodePoint(bn))!=Sn.toLowerCase()?1:Sn!=Sn.toUpperCase()?2:0;(!_n||An==1&&pn||vn==0&&An!=0)&&(l[tn]==bn||d[tn]==bn&&(an=!0)?R[tn++]=_n:R.length&&(yn=!1)),vn=An,_n+=codePointSize(bn)}return tn==z&&R[0]==0&&yn?this.result(-100+(an?-200:0),R,e):sn==z&&ln==0?this.ret(-200-e.length+(un==e.length?0:-100),[0,un]):I>-1?this.ret(-700-e.length,[I,I+this.pattern.length]):sn==z?this.ret(-900-e.length,[ln,un]):tn==z?this.result(-100+(an?-200:0)+-700+(yn?0:-1100),R,e):l.length==2?null:this.result((p[0]?-700:0)+-200+-1100,p,e)}result(e,l,d){let p=[],b=0;for(let R of l){let I=R+(this.astral?codePointSize(codePointAt(d,R)):1);b&&p[b-1]==R?p[b-1]=I:(p[b++]=R,p[b++]=I)}return this.ret(e-d.length,p)}}class StrictMatcher{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let l=e.slice(0,this.pattern.length),d=l==this.pattern?0:l.toLowerCase()==this.folded?-200:null;return d==null?null:(this.matched=[0,l.length],this.score=d+(e.length==this.pattern.length?0:-100),this)}}const completionConfig=Facet.define({combine(o){return combineConfig(o,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:defaultPositionInfo,filterStrict:!1,compareCompletions:(e,l)=>e.label.localeCompare(l.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,l)=>e&&l,closeOnBlur:(e,l)=>e&&l,icons:(e,l)=>e&&l,tooltipClass:(e,l)=>d=>joinClass(e(d),l(d)),optionClass:(e,l)=>d=>joinClass(e(d),l(d)),addToOptions:(e,l)=>e.concat(l),filterStrict:(e,l)=>e||l})}});function joinClass(o,e){return o?e?o+" "+e:o:e}function defaultPositionInfo(o,e,l,d,p,b){let R=o.textDirection==Direction.RTL,I=R,z=!1,se="top",le,tn,an=e.left-p.left,sn=p.right-e.right,ln=d.right-d.left,un=d.bottom-d.top;if(I&&an<Math.min(ln,sn)?I=!1:!I&&sn<Math.min(ln,an)&&(I=!0),ln<=(I?an:sn))le=Math.max(p.top,Math.min(l.top,p.bottom-un))-e.top,tn=Math.min(400,I?an:sn);else{z=!0,tn=Math.min(400,(R?e.right:p.right-e.left)-30);let _n=p.bottom-e.bottom;_n>=un||_n>e.top?le=l.bottom-e.top:(se="bottom",le=e.bottom-l.top)}let pn=(e.bottom-e.top)/b.offsetHeight,yn=(e.right-e.left)/b.offsetWidth;return{style:`${se}: ${le/pn}px; max-width: ${tn/yn}px`,class:"cm-completionInfo-"+(z?R?"left-narrow":"right-narrow":I?"left":"right")}}function optionContent(o){let e=o.addToOptions.slice();return o.icons&&e.push({render(l){let d=document.createElement("div");return d.classList.add("cm-completionIcon"),l.type&&d.classList.add(...l.type.split(/\s+/g).map(p=>"cm-completionIcon-"+p)),d.setAttribute("aria-hidden","true"),d},position:20}),e.push({render(l,d,p,b){let R=document.createElement("span");R.className="cm-completionLabel";let I=l.displayLabel||l.label,z=0;for(let se=0;se<b.length;){let le=b[se++],tn=b[se++];le>z&&R.appendChild(document.createTextNode(I.slice(z,le)));let an=R.appendChild(document.createElement("span"));an.appendChild(document.createTextNode(I.slice(le,tn))),an.className="cm-completionMatchedText",z=tn}return z<I.length&&R.appendChild(document.createTextNode(I.slice(z))),R},position:50},{render(l){if(!l.detail)return null;let d=document.createElement("span");return d.className="cm-completionDetail",d.textContent=l.detail,d},position:80}),e.sort((l,d)=>l.position-d.position).map(l=>l.render)}function rangeAroundSelected(o,e,l){if(o<=l)return{from:0,to:o};if(e<0&&(e=0),e<=o>>1){let p=Math.floor(e/l);return{from:p*l,to:(p+1)*l}}let d=Math.floor((o-e)/l);return{from:o-(d+1)*l,to:o-d*l}}class CompletionTooltip{constructor(e,l,d){this.view=e,this.stateField=l,this.applyCompletion=d,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:z=>this.placeInfo(z),key:this},this.space=null,this.currentClass="";let p=e.state.field(l),{options:b,selected:R}=p.open,I=e.state.facet(completionConfig);this.optionContent=optionContent(I),this.optionClass=I.optionClass,this.tooltipClass=I.tooltipClass,this.range=rangeAroundSelected(b.length,R,I.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",z=>{let{options:se}=e.state.field(l).open;for(let le=z.target,tn;le&&le!=this.dom;le=le.parentNode)if(le.nodeName=="LI"&&(tn=/-(\d+)$/.exec(le.id))&&+tn[1]<se.length){this.applyCompletion(e,se[+tn[1]]),z.preventDefault();return}}),this.dom.addEventListener("focusout",z=>{let se=e.state.field(this.stateField,!1);se&&se.tooltip&&e.state.facet(completionConfig).closeOnBlur&&z.relatedTarget!=e.contentDOM&&e.dispatch({effects:closeCompletionEffect.of(null)})}),this.showOptions(b,p.id)}mount(){this.updateSel()}showOptions(e,l){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,l,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var l;let d=e.state.field(this.stateField),p=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),d!=p){let{options:b,selected:R,disabled:I}=d.open;(!p.open||p.open.options!=b)&&(this.range=rangeAroundSelected(b.length,R,e.state.facet(completionConfig).maxRenderedOptions),this.showOptions(b,d.id)),this.updateSel(),I!=((l=p.open)===null||l===void 0?void 0:l.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!I)}}updateTooltipClass(e){let l=this.tooltipClass(e);if(l!=this.currentClass){for(let d of this.currentClass.split(" "))d&&this.dom.classList.remove(d);for(let d of l.split(" "))d&&this.dom.classList.add(d);this.currentClass=l}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),l=e.open;if((l.selected>-1&&l.selected<this.range.from||l.selected>=this.range.to)&&(this.range=rangeAroundSelected(l.options.length,l.selected,this.view.state.facet(completionConfig).maxRenderedOptions),this.showOptions(l.options,e.id)),this.updateSelectedOption(l.selected)){this.destroyInfo();let{completion:d}=l.options[l.selected],{info:p}=d;if(!p)return;let b=typeof p=="string"?document.createTextNode(p):p(d);if(!b)return;"then"in b?b.then(R=>{R&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(R,d)}).catch(R=>logException(this.view.state,R,"completion info")):this.addInfoPane(b,d)}}addInfoPane(e,l){this.destroyInfo();let d=this.info=document.createElement("div");if(d.className="cm-tooltip cm-completionInfo",e.nodeType!=null)d.appendChild(e),this.infoDestroy=null;else{let{dom:p,destroy:b}=e;d.appendChild(p),this.infoDestroy=b||null}this.dom.appendChild(d),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let l=null;for(let d=this.list.firstChild,p=this.range.from;d;d=d.nextSibling,p++)d.nodeName!="LI"||!d.id?p--:p==e?d.hasAttribute("aria-selected")||(d.setAttribute("aria-selected","true"),l=d):d.hasAttribute("aria-selected")&&d.removeAttribute("aria-selected");return l&&scrollIntoView(this.list,l),l}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let l=this.dom.getBoundingClientRect(),d=this.info.getBoundingClientRect(),p=e.getBoundingClientRect(),b=this.space;if(!b){let R=this.dom.ownerDocument.defaultView||window;b={left:0,top:0,right:R.innerWidth,bottom:R.innerHeight}}return p.top>Math.min(b.bottom,l.bottom)-10||p.bottom<Math.max(b.top,l.top)+10?null:this.view.state.facet(completionConfig).positionInfo(this.view,l,p,d,b,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,l,d){const p=document.createElement("ul");p.id=l,p.setAttribute("role","listbox"),p.setAttribute("aria-expanded","true"),p.setAttribute("aria-label",this.view.state.phrase("Completions"));let b=null;for(let R=d.from;R<d.to;R++){let{completion:I,match:z}=e[R],{section:se}=I;if(se){let an=typeof se=="string"?se:se.name;if(an!=b&&(R>d.from||d.from==0))if(b=an,typeof se!="string"&&se.header)p.appendChild(se.header(se));else{let sn=p.appendChild(document.createElement("completion-section"));sn.textContent=an}}const le=p.appendChild(document.createElement("li"));le.id=l+"-"+R,le.setAttribute("role","option");let tn=this.optionClass(I);tn&&(le.className=tn);for(let an of this.optionContent){let sn=an(I,this.view.state,this.view,z);sn&&le.appendChild(sn)}}return d.from&&p.classList.add("cm-completionListIncompleteTop"),d.to<e.length&&p.classList.add("cm-completionListIncompleteBottom"),p}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function completionTooltip(o,e){return l=>new CompletionTooltip(l,o,e)}function scrollIntoView(o,e){let l=o.getBoundingClientRect(),d=e.getBoundingClientRect(),p=l.height/o.offsetHeight;d.top<l.top?o.scrollTop-=(l.top-d.top)/p:d.bottom>l.bottom&&(o.scrollTop+=(d.bottom-l.bottom)/p)}function score(o){return(o.boost||0)*100+(o.apply?10:0)+(o.info?5:0)+(o.type?1:0)}function sortOptions(o,e){let l=[],d=null,p=se=>{l.push(se);let{section:le}=se.completion;if(le){d||(d=[]);let tn=typeof le=="string"?le:le.name;d.some(an=>an.name==tn)||d.push(typeof le=="string"?{name:tn}:le)}},b=e.facet(completionConfig);for(let se of o)if(se.hasResult()){let le=se.result.getMatch;if(se.result.filter===!1)for(let tn of se.result.options)p(new Option(tn,se.source,le?le(tn):[],1e9-l.length));else{let tn=e.sliceDoc(se.from,se.to),an,sn=b.filterStrict?new StrictMatcher(tn):new FuzzyMatcher(tn);for(let ln of se.result.options)if(an=sn.match(ln.label)){let un=ln.displayLabel?le?le(ln,an.matched):[]:an.matched;p(new Option(ln,se.source,un,an.score+(ln.boost||0)))}}}if(d){let se=Object.create(null),le=0,tn=(an,sn)=>{var ln,un;return((ln=an.rank)!==null&&ln!==void 0?ln:1e9)-((un=sn.rank)!==null&&un!==void 0?un:1e9)||(an.name<sn.name?-1:1)};for(let an of d.sort(tn))le-=1e5,se[an.name]=le;for(let an of l){let{section:sn}=an.completion;sn&&(an.score+=se[typeof sn=="string"?sn:sn.name])}}let R=[],I=null,z=b.compareCompletions;for(let se of l.sort((le,tn)=>tn.score-le.score||z(le.completion,tn.completion))){let le=se.completion;!I||I.label!=le.label||I.detail!=le.detail||I.type!=null&&le.type!=null&&I.type!=le.type||I.apply!=le.apply||I.boost!=le.boost?R.push(se):score(se.completion)>score(I)&&(R[R.length-1]=se),I=se.completion}return R}class CompletionDialog{constructor(e,l,d,p,b,R){this.options=e,this.attrs=l,this.tooltip=d,this.timestamp=p,this.selected=b,this.disabled=R}setSelected(e,l){return e==this.selected||e>=this.options.length?this:new CompletionDialog(this.options,makeAttrs(l,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,l,d,p,b,R){if(p&&!R&&e.some(se=>se.isPending))return p.setDisabled();let I=sortOptions(e,l);if(!I.length)return p&&e.some(se=>se.isPending)?p.setDisabled():null;let z=l.facet(completionConfig).selectOnOpen?0:-1;if(p&&p.selected!=z&&p.selected!=-1){let se=p.options[p.selected].completion;for(let le=0;le<I.length;le++)if(I[le].completion==se){z=le;break}}return new CompletionDialog(I,makeAttrs(d,z),{pos:e.reduce((se,le)=>le.hasResult()?Math.min(se,le.from):se,1e8),create:createTooltip,above:b.aboveCursor},p?p.timestamp:Date.now(),z,!1)}map(e){return new CompletionDialog(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new CompletionDialog(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class CompletionState{constructor(e,l,d){this.active=e,this.id=l,this.open=d}static start(){return new CompletionState(none$1,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:l}=e,d=l.facet(completionConfig),b=(d.override||l.languageDataAt("autocomplete",cur(l)).map(asSource)).map(z=>(this.active.find(le=>le.source==z)||new ActiveSource(z,this.active.some(le=>le.state!=0)?1:0)).update(e,d));b.length==this.active.length&&b.every((z,se)=>z==this.active[se])&&(b=this.active);let R=this.open,I=e.effects.some(z=>z.is(setActiveEffect));R&&e.docChanged&&(R=R.map(e.changes)),e.selection||b.some(z=>z.hasResult()&&e.changes.touchesRange(z.from,z.to))||!sameResults(b,this.active)||I?R=CompletionDialog.build(b,l,this.id,R,d,I):R&&R.disabled&&!b.some(z=>z.isPending)&&(R=null),!R&&b.every(z=>!z.isPending)&&b.some(z=>z.hasResult())&&(b=b.map(z=>z.hasResult()?new ActiveSource(z.source,0):z));for(let z of e.effects)z.is(setSelectedEffect)&&(R=R&&R.setSelected(z.value,this.id));return b==this.active&&R==this.open?this:new CompletionState(b,this.id,R)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?baseAttrs:noAttrs}}function sameResults(o,e){if(o==e)return!0;for(let l=0,d=0;;){for(;l<o.length&&!o[l].hasResult();)l++;for(;d<e.length&&!e[d].hasResult();)d++;let p=l==o.length,b=d==e.length;if(p||b)return p==b;if(o[l++].result!=e[d++].result)return!1}}const baseAttrs={"aria-autocomplete":"list"},noAttrs={};function makeAttrs(o,e){let l={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":o};return e>-1&&(l["aria-activedescendant"]=o+"-"+e),l}const none$1=[];function getUpdateType(o,e){if(o.isUserEvent("input.complete")){let d=o.annotation(pickedCompletion);if(d&&e.activateOnCompletion(d))return 12}let l=o.isUserEvent("input.type");return l&&e.activateOnTyping?5:l?1:o.isUserEvent("delete.backward")?2:o.selection?8:o.docChanged?16:0}class ActiveSource{constructor(e,l,d=!1){this.source=e,this.state=l,this.explicit=d}hasResult(){return!1}get isPending(){return this.state==1}update(e,l){let d=getUpdateType(e,l),p=this;(d&8||d&16&&this.touches(e))&&(p=new ActiveSource(p.source,0)),d&4&&p.state==0&&(p=new ActiveSource(this.source,1)),p=p.updateFor(e,d);for(let b of e.effects)if(b.is(startCompletionEffect))p=new ActiveSource(p.source,1,b.value);else if(b.is(closeCompletionEffect))p=new ActiveSource(p.source,0);else if(b.is(setActiveEffect))for(let R of b.value)R.source==p.source&&(p=R);return p}updateFor(e,l){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(cur(e.state))}}class ActiveResult extends ActiveSource{constructor(e,l,d,p,b,R){super(e,3,l),this.limit=d,this.result=p,this.from=b,this.to=R}hasResult(){return!0}updateFor(e,l){var d;if(!(l&3))return this.map(e.changes);let p=this.result;p.map&&!e.changes.empty&&(p=p.map(p,e.changes));let b=e.changes.mapPos(this.from),R=e.changes.mapPos(this.to,1),I=cur(e.state);if(I>R||!p||l&2&&(cur(e.startState)==this.from||I<this.limit))return new ActiveSource(this.source,l&4?1:0);let z=e.changes.mapPos(this.limit);return checkValid(p.validFor,e.state,b,R)?new ActiveResult(this.source,this.explicit,z,p,b,R):p.update&&(p=p.update(p,b,R,new CompletionContext(e.state,I,!1)))?new ActiveResult(this.source,this.explicit,z,p,p.from,(d=p.to)!==null&&d!==void 0?d:cur(e.state)):new ActiveSource(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new ActiveResult(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new ActiveSource(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function checkValid(o,e,l,d){if(!o)return!1;let p=e.sliceDoc(l,d);return typeof o=="function"?o(p,l,d,e):ensureAnchor(o,!0).test(p)}const setActiveEffect=StateEffect.define({map(o,e){return o.map(l=>l.map(e))}}),setSelectedEffect=StateEffect.define(),completionState=StateField.define({create(){return CompletionState.start()},update(o,e){return o.update(e)},provide:o=>[showTooltip.from(o,e=>e.tooltip),EditorView.contentAttributes.from(o,e=>e.attrs)]});function applyCompletion(o,e){const l=e.completion.apply||e.completion.label;let d=o.state.field(completionState).active.find(p=>p.source==e.source);return d instanceof ActiveResult?(typeof l=="string"?o.dispatch(Object.assign(Object.assign({},insertCompletionText(o.state,l,d.from,d.to)),{annotations:pickedCompletion.of(e.completion)})):l(o,e.completion,d.from,d.to),!0):!1}const createTooltip=completionTooltip(completionState,applyCompletion);function moveCompletionSelection(o,e="option"){return l=>{let d=l.state.field(completionState,!1);if(!d||!d.open||d.open.disabled||Date.now()-d.open.timestamp<l.state.facet(completionConfig).interactionDelay)return!1;let p=1,b;e=="page"&&(b=getTooltip(l,d.open.tooltip))&&(p=Math.max(2,Math.floor(b.dom.offsetHeight/b.dom.querySelector("li").offsetHeight)-1));let{length:R}=d.open.options,I=d.open.selected>-1?d.open.selected+p*(o?1:-1):o?0:R-1;return I<0?I=e=="page"?0:R-1:I>=R&&(I=e=="page"?R-1:0),l.dispatch({effects:setSelectedEffect.of(I)}),!0}}const acceptCompletion=o=>{let e=o.state.field(completionState,!1);return o.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<o.state.facet(completionConfig).interactionDelay?!1:applyCompletion(o,e.open.options[e.open.selected])},startCompletion=o=>o.state.field(completionState,!1)?(o.dispatch({effects:startCompletionEffect.of(!0)}),!0):!1,closeCompletion=o=>{let e=o.state.field(completionState,!1);return!e||!e.active.some(l=>l.state!=0)?!1:(o.dispatch({effects:closeCompletionEffect.of(null)}),!0)};class RunningQuery{constructor(e,l){this.active=e,this.context=l,this.time=Date.now(),this.updates=[],this.done=void 0}}const MaxUpdateCount=50,MinAbortTime=1e3,completionPlugin=ViewPlugin.fromClass(class{constructor(o){this.view=o,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of o.state.field(completionState).active)e.isPending&&this.startQuery(e)}update(o){let e=o.state.field(completionState),l=o.state.facet(completionConfig);if(!o.selectionSet&&!o.docChanged&&o.startState.field(completionState)==e)return;let d=o.transactions.some(b=>{let R=getUpdateType(b,l);return R&8||(b.selection||b.docChanged)&&!(R&3)});for(let b=0;b<this.running.length;b++){let R=this.running[b];if(d||R.context.abortOnDocChange&&o.docChanged||R.updates.length+o.transactions.length>MaxUpdateCount&&Date.now()-R.time>MinAbortTime){for(let I of R.context.abortListeners)try{I()}catch(z){logException(this.view.state,z)}R.context.abortListeners=null,this.running.splice(b--,1)}else R.updates.push(...o.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),o.transactions.some(b=>b.effects.some(R=>R.is(startCompletionEffect)))&&(this.pendingStart=!0);let p=this.pendingStart?50:l.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(b=>b.isPending&&!this.running.some(R=>R.active.source==b.source))?setTimeout(()=>this.startUpdate(),p):-1,this.composing!=0)for(let b of o.transactions)b.isUserEvent("input.type")?this.composing=2:this.composing==2&&b.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:o}=this.view,e=o.field(completionState);for(let l of e.active)l.isPending&&!this.running.some(d=>d.active.source==l.source)&&this.startQuery(l);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(completionConfig).updateSyncTime))}startQuery(o){let{state:e}=this.view,l=cur(e),d=new CompletionContext(e,l,o.explicit,this.view),p=new RunningQuery(o,d);this.running.push(p),Promise.resolve(o.source(d)).then(b=>{p.context.aborted||(p.done=b||null,this.scheduleAccept())},b=>{this.view.dispatch({effects:closeCompletionEffect.of(null)}),logException(this.view.state,b)})}scheduleAccept(){this.running.every(o=>o.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(completionConfig).updateSyncTime))}accept(){var o;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],l=this.view.state.facet(completionConfig),d=this.view.state.field(completionState);for(let p=0;p<this.running.length;p++){let b=this.running[p];if(b.done===void 0)continue;if(this.running.splice(p--,1),b.done){let I=cur(b.updates.length?b.updates[0].startState:this.view.state),z=Math.min(I,b.done.from+(b.active.explicit?0:1)),se=new ActiveResult(b.active.source,b.active.explicit,z,b.done,b.done.from,(o=b.done.to)!==null&&o!==void 0?o:I);for(let le of b.updates)se=se.update(le,l);if(se.hasResult()){e.push(se);continue}}let R=d.active.find(I=>I.source==b.active.source);if(R&&R.isPending)if(b.done==null){let I=new ActiveSource(b.active.source,0);for(let z of b.updates)I=I.update(z,l);I.isPending||e.push(I)}else this.startQuery(R)}(e.length||d.open&&d.open.disabled)&&this.view.dispatch({effects:setActiveEffect.of(e)})}},{eventHandlers:{blur(o){let e=this.view.state.field(completionState,!1);if(e&&e.tooltip&&this.view.state.facet(completionConfig).closeOnBlur){let l=e.open&&getTooltip(this.view,e.open.tooltip);(!l||!l.dom.contains(o.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:closeCompletionEffect.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:startCompletionEffect.of(!1)}),20),this.composing=0}}}),windows=typeof navigator=="object"&&/Win/.test(navigator.platform),commitCharacters=Prec.highest(EditorView.domEventHandlers({keydown(o,e){let l=e.state.field(completionState,!1);if(!l||!l.open||l.open.disabled||l.open.selected<0||o.key.length>1||o.ctrlKey&&!(windows&&o.altKey)||o.metaKey)return!1;let d=l.open.options[l.open.selected],p=l.active.find(R=>R.source==d.source),b=d.completion.commitCharacters||p.result.commitCharacters;return b&&b.indexOf(o.key)>-1&&applyCompletion(e,d),!1}})),baseTheme$3=EditorView.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class FieldPos{constructor(e,l,d,p){this.field=e,this.line=l,this.from=d,this.to=p}}class FieldRange{constructor(e,l,d){this.field=e,this.from=l,this.to=d}map(e){let l=e.mapPos(this.from,-1,MapMode.TrackDel),d=e.mapPos(this.to,1,MapMode.TrackDel);return l==null||d==null?null:new FieldRange(this.field,l,d)}}class Snippet{constructor(e,l){this.lines=e,this.fieldPositions=l}instantiate(e,l){let d=[],p=[l],b=e.doc.lineAt(l),R=/^\s*/.exec(b.text)[0];for(let z of this.lines){if(d.length){let se=R,le=/^\t*/.exec(z)[0].length;for(let tn=0;tn<le;tn++)se+=e.facet(indentUnit);p.push(l+se.length-le),z=se+z.slice(le)}d.push(z),l+=z.length+1}let I=this.fieldPositions.map(z=>new FieldRange(z.field,p[z.line]+z.from,p[z.line]+z.to));return{text:d,ranges:I}}static parse(e){let l=[],d=[],p=[],b;for(let R of e.split(/\r\n?|\n/)){for(;b=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(R);){let I=b[1]?+b[1]:null,z=b[2]||b[3]||"",se=-1,le=z.replace(/\\[{}]/g,tn=>tn[1]);for(let tn=0;tn<l.length;tn++)(I!=null?l[tn].seq==I:le&&l[tn].name==le)&&(se=tn);if(se<0){let tn=0;for(;tn<l.length&&(I==null||l[tn].seq!=null&&l[tn].seq<I);)tn++;l.splice(tn,0,{seq:I,name:le}),se=tn;for(let an of p)an.field>=se&&an.field++}p.push(new FieldPos(se,d.length,b.index,b.index+le.length)),R=R.slice(0,b.index)+z+R.slice(b.index+b[0].length)}R=R.replace(/\\([{}])/g,(I,z,se)=>{for(let le of p)le.line==d.length&&le.from>se&&(le.from--,le.to--);return z}),d.push(R)}return new Snippet(d,p)}}let fieldMarker=Decoration.widget({widget:new class extends WidgetType{toDOM(){let o=document.createElement("span");return o.className="cm-snippetFieldPosition",o}ignoreEvent(){return!1}}}),fieldRange=Decoration.mark({class:"cm-snippetField"});class ActiveSnippet{constructor(e,l){this.ranges=e,this.active=l,this.deco=Decoration.set(e.map(d=>(d.from==d.to?fieldMarker:fieldRange).range(d.from,d.to)))}map(e){let l=[];for(let d of this.ranges){let p=d.map(e);if(!p)return null;l.push(p)}return new ActiveSnippet(l,this.active)}selectionInsideField(e){return e.ranges.every(l=>this.ranges.some(d=>d.field==this.active&&d.from<=l.from&&d.to>=l.to))}}const setActive=StateEffect.define({map(o,e){return o&&o.map(e)}}),moveToField=StateEffect.define(),snippetState=StateField.define({create(){return null},update(o,e){for(let l of e.effects){if(l.is(setActive))return l.value;if(l.is(moveToField)&&o)return new ActiveSnippet(o.ranges,l.value)}return o&&e.docChanged&&(o=o.map(e.changes)),o&&e.selection&&!o.selectionInsideField(e.selection)&&(o=null),o},provide:o=>EditorView.decorations.from(o,e=>e?e.deco:Decoration.none)});function fieldSelection(o,e){return EditorSelection.create(o.filter(l=>l.field==e).map(l=>EditorSelection.range(l.from,l.to)))}function snippet(o){let e=Snippet.parse(o);return(l,d,p,b)=>{let{text:R,ranges:I}=e.instantiate(l.state,p),{main:z}=l.state.selection,se={changes:{from:p,to:b==z.from?z.to:b,insert:Text$1.of(R)},scrollIntoView:!0,annotations:d?[pickedCompletion.of(d),Transaction.userEvent.of("input.complete")]:void 0};if(I.length&&(se.selection=fieldSelection(I,0)),I.some(le=>le.field>0)){let le=new ActiveSnippet(I,0),tn=se.effects=[setActive.of(le)];l.state.field(snippetState,!1)===void 0&&tn.push(StateEffect.appendConfig.of([snippetState,addSnippetKeymap,snippetPointerHandler,baseTheme$3]))}l.dispatch(l.state.update(se))}}function moveField(o){return({state:e,dispatch:l})=>{let d=e.field(snippetState,!1);if(!d||o<0&&d.active==0)return!1;let p=d.active+o,b=o>0&&!d.ranges.some(R=>R.field==p+o);return l(e.update({selection:fieldSelection(d.ranges,p),effects:setActive.of(b?null:new ActiveSnippet(d.ranges,p)),scrollIntoView:!0})),!0}}const clearSnippet=({state:o,dispatch:e})=>o.field(snippetState,!1)?(e(o.update({effects:setActive.of(null)})),!0):!1,nextSnippetField=moveField(1),prevSnippetField=moveField(-1),defaultSnippetKeymap=[{key:"Tab",run:nextSnippetField,shift:prevSnippetField},{key:"Escape",run:clearSnippet}],snippetKeymap=Facet.define({combine(o){return o.length?o[0]:defaultSnippetKeymap}}),addSnippetKeymap=Prec.highest(keymap.compute([snippetKeymap],o=>o.facet(snippetKeymap)));function snippetCompletion(o,e){return Object.assign(Object.assign({},e),{apply:snippet(o)})}const snippetPointerHandler=EditorView.domEventHandlers({mousedown(o,e){let l=e.state.field(snippetState,!1),d;if(!l||(d=e.posAtCoords({x:o.clientX,y:o.clientY}))==null)return!1;let p=l.ranges.find(b=>b.from<=d&&b.to>=d);return!p||p.field==l.active?!1:(e.dispatch({selection:fieldSelection(l.ranges,p.field),effects:setActive.of(l.ranges.some(b=>b.field>p.field)?new ActiveSnippet(l.ranges,p.field):null),scrollIntoView:!0}),!0)}}),defaults={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},closeBracketEffect=StateEffect.define({map(o,e){let l=e.mapPos(o,-1,MapMode.TrackAfter);return l??void 0}}),closedBracket=new class extends RangeValue{};closedBracket.startSide=1,closedBracket.endSide=-1;const bracketState=StateField.define({create(){return RangeSet.empty},update(o,e){if(o=o.map(e.changes),e.selection){let l=e.state.doc.lineAt(e.selection.main.head);o=o.update({filter:d=>d>=l.from&&d<=l.to})}for(let l of e.effects)l.is(closeBracketEffect)&&(o=o.update({add:[closedBracket.range(l.value,l.value+1)]}));return o}});function closeBrackets(){return[inputHandler,bracketState]}const definedClosing="()[]{}<>";function closing(o){for(let e=0;e<definedClosing.length;e+=2)if(definedClosing.charCodeAt(e)==o)return definedClosing.charAt(e+1);return fromCodePoint(o<128?o:o+1)}function config(o,e){return o.languageDataAt("closeBrackets",e)[0]||defaults}const android$1=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),inputHandler=EditorView.inputHandler.of((o,e,l,d)=>{if((android$1?o.composing:o.compositionStarted)||o.state.readOnly)return!1;let p=o.state.selection.main;if(d.length>2||d.length==2&&codePointSize(codePointAt(d,0))==1||e!=p.from||l!=p.to)return!1;let b=insertBracket(o.state,d);return b?(o.dispatch(b),!0):!1}),deleteBracketPair=({state:o,dispatch:e})=>{if(o.readOnly)return!1;let d=config(o,o.selection.main.head).brackets||defaults.brackets,p=null,b=o.changeByRange(R=>{if(R.empty){let I=prevChar(o.doc,R.head);for(let z of d)if(z==I&&nextChar(o.doc,R.head)==closing(codePointAt(z,0)))return{changes:{from:R.head-z.length,to:R.head+z.length},range:EditorSelection.cursor(R.head-z.length)}}return{range:p=R}});return p||e(o.update(b,{scrollIntoView:!0,userEvent:"delete.backward"})),!p},closeBracketsKeymap=[{key:"Backspace",run:deleteBracketPair}];function insertBracket(o,e){let l=config(o,o.selection.main.head),d=l.brackets||defaults.brackets;for(let p of d){let b=closing(codePointAt(p,0));if(e==p)return b==p?handleSame(o,p,d.indexOf(p+p+p)>-1,l):handleOpen(o,p,b,l.before||defaults.before);if(e==b&&closedBracketAt(o,o.selection.main.from))return handleClose(o,p,b)}return null}function closedBracketAt(o,e){let l=!1;return o.field(bracketState).between(0,o.doc.length,d=>{d==e&&(l=!0)}),l}function nextChar(o,e){let l=o.sliceString(e,e+2);return l.slice(0,codePointSize(codePointAt(l,0)))}function prevChar(o,e){let l=o.sliceString(e-2,e);return codePointSize(codePointAt(l,0))==l.length?l:l.slice(1)}function handleOpen(o,e,l,d){let p=null,b=o.changeByRange(R=>{if(!R.empty)return{changes:[{insert:e,from:R.from},{insert:l,from:R.to}],effects:closeBracketEffect.of(R.to+e.length),range:EditorSelection.range(R.anchor+e.length,R.head+e.length)};let I=nextChar(o.doc,R.head);return!I||/\s/.test(I)||d.indexOf(I)>-1?{changes:{insert:e+l,from:R.head},effects:closeBracketEffect.of(R.head+e.length),range:EditorSelection.cursor(R.head+e.length)}:{range:p=R}});return p?null:o.update(b,{scrollIntoView:!0,userEvent:"input.type"})}function handleClose(o,e,l){let d=null,p=o.changeByRange(b=>b.empty&&nextChar(o.doc,b.head)==l?{changes:{from:b.head,to:b.head+l.length,insert:l},range:EditorSelection.cursor(b.head+l.length)}:d={range:b});return d?null:o.update(p,{scrollIntoView:!0,userEvent:"input.type"})}function handleSame(o,e,l,d){let p=d.stringPrefixes||defaults.stringPrefixes,b=null,R=o.changeByRange(I=>{if(!I.empty)return{changes:[{insert:e,from:I.from},{insert:e,from:I.to}],effects:closeBracketEffect.of(I.to+e.length),range:EditorSelection.range(I.anchor+e.length,I.head+e.length)};let z=I.head,se=nextChar(o.doc,z),le;if(se==e){if(nodeStart(o,z))return{changes:{insert:e+e,from:z},effects:closeBracketEffect.of(z+e.length),range:EditorSelection.cursor(z+e.length)};if(closedBracketAt(o,z)){let an=l&&o.sliceDoc(z,z+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:z,to:z+an.length,insert:an},range:EditorSelection.cursor(z+an.length)}}}else{if(l&&o.sliceDoc(z-2*e.length,z)==e+e&&(le=canStartStringAt(o,z-2*e.length,p))>-1&&nodeStart(o,le))return{changes:{insert:e+e+e+e,from:z},effects:closeBracketEffect.of(z+e.length),range:EditorSelection.cursor(z+e.length)};if(o.charCategorizer(z)(se)!=CharCategory.Word&&canStartStringAt(o,z,p)>-1&&!probablyInString(o,z,e,p))return{changes:{insert:e+e,from:z},effects:closeBracketEffect.of(z+e.length),range:EditorSelection.cursor(z+e.length)}}return{range:b=I}});return b?null:o.update(R,{scrollIntoView:!0,userEvent:"input.type"})}function nodeStart(o,e){let l=syntaxTree(o).resolveInner(e+1);return l.parent&&l.from==e}function probablyInString(o,e,l,d){let p=syntaxTree(o).resolveInner(e,-1),b=d.reduce((R,I)=>Math.max(R,I.length),0);for(let R=0;R<5;R++){let I=o.sliceDoc(p.from,Math.min(p.to,p.from+l.length+b)),z=I.indexOf(l);if(!z||z>-1&&d.indexOf(I.slice(0,z))>-1){let le=p.firstChild;for(;le&&le.from==p.from&&le.to-le.from>l.length+z;){if(o.sliceDoc(le.to-l.length,le.to)==l)return!1;le=le.firstChild}return!0}let se=p.to==e&&p.parent;if(!se)break;p=se}return!1}function canStartStringAt(o,e,l){let d=o.charCategorizer(e);if(d(o.sliceDoc(e-1,e))!=CharCategory.Word)return e;for(let p of l){let b=e-p.length;if(o.sliceDoc(b,e)==p&&d(o.sliceDoc(b-1,b))!=CharCategory.Word)return b}return-1}function autocompletion(o={}){return[commitCharacters,completionState,completionConfig.of(o),completionPlugin,completionKeymapExt,baseTheme$3]}const completionKeymap=[{key:"Ctrl-Space",run:startCompletion},{mac:"Alt-`",run:startCompletion},{key:"Escape",run:closeCompletion},{key:"ArrowDown",run:moveCompletionSelection(!0)},{key:"ArrowUp",run:moveCompletionSelection(!1)},{key:"PageDown",run:moveCompletionSelection(!0,"page")},{key:"PageUp",run:moveCompletionSelection(!1,"page")},{key:"Enter",run:acceptCompletion}],completionKeymapExt=Prec.highest(keymap.computeN([completionConfig],o=>o.facet(completionConfig).defaultKeymap?[completionKeymap]:[]));function completionStatus(o){let e=o.field(completionState,!1);return e&&e.active.some(l=>l.isPending)?"pending":e&&e.active.some(l=>l.state!=0)?"active":null}const toggleComment=o=>{let{state:e}=o,l=e.doc.lineAt(e.selection.main.from),d=getConfig(o.state,l.from);return d.line?toggleLineComment(o):d.block?toggleBlockCommentByLine(o):!1};function command(o,e){return({state:l,dispatch:d})=>{if(l.readOnly)return!1;let p=o(e,l);return p?(d(l.update(p)),!0):!1}}const toggleLineComment=command(changeLineComment,0),lineComment=command(changeLineComment,1),lineUncomment=command(changeLineComment,2),toggleBlockComment=command(changeBlockComment,0),toggleBlockCommentByLine=command((o,e)=>changeBlockComment(o,e,selectedLineRanges(e)),0);function getConfig(o,e){let l=o.languageDataAt("commentTokens",e);return l.length?l[0]:{}}const SearchMargin=50;function findBlockComment(o,{open:e,close:l},d,p){let b=o.sliceDoc(d-SearchMargin,d),R=o.sliceDoc(p,p+SearchMargin),I=/\s*$/.exec(b)[0].length,z=/^\s*/.exec(R)[0].length,se=b.length-I;if(b.slice(se-e.length,se)==e&&R.slice(z,z+l.length)==l)return{open:{pos:d-I,margin:I&&1},close:{pos:p+z,margin:z&&1}};let le,tn;p-d<=2*SearchMargin?le=tn=o.sliceDoc(d,p):(le=o.sliceDoc(d,d+SearchMargin),tn=o.sliceDoc(p-SearchMargin,p));let an=/^\s*/.exec(le)[0].length,sn=/\s*$/.exec(tn)[0].length,ln=tn.length-sn-l.length;return le.slice(an,an+e.length)==e&&tn.slice(ln,ln+l.length)==l?{open:{pos:d+an+e.length,margin:/\s/.test(le.charAt(an+e.length))?1:0},close:{pos:p-sn-l.length,margin:/\s/.test(tn.charAt(ln-1))?1:0}}:null}function selectedLineRanges(o){let e=[];for(let l of o.selection.ranges){let d=o.doc.lineAt(l.from),p=l.to<=d.to?d:o.doc.lineAt(l.to);p.from>d.from&&p.from==l.to&&(p=l.to==d.to+1?d:o.doc.lineAt(l.to-1));let b=e.length-1;b>=0&&e[b].to>d.from?e[b].to=p.to:e.push({from:d.from+/^\s*/.exec(d.text)[0].length,to:p.to})}return e}function changeBlockComment(o,e,l=e.selection.ranges){let d=l.map(b=>getConfig(e,b.from).block);if(!d.every(b=>b))return null;let p=l.map((b,R)=>findBlockComment(e,d[R],b.from,b.to));if(o!=2&&!p.every(b=>b))return{changes:e.changes(l.map((b,R)=>p[R]?[]:[{from:b.from,insert:d[R].open+" "},{from:b.to,insert:" "+d[R].close}]))};if(o!=1&&p.some(b=>b)){let b=[];for(let R=0,I;R<p.length;R++)if(I=p[R]){let z=d[R],{open:se,close:le}=I;b.push({from:se.pos-z.open.length,to:se.pos+se.margin},{from:le.pos-le.margin,to:le.pos+z.close.length})}return{changes:b}}return null}function changeLineComment(o,e,l=e.selection.ranges){let d=[],p=-1;for(let{from:b,to:R}of l){let I=d.length,z=1e9,se=getConfig(e,b).line;if(se){for(let le=b;le<=R;){let tn=e.doc.lineAt(le);if(tn.from>p&&(b==R||R>tn.from)){p=tn.from;let an=/^\s*/.exec(tn.text)[0].length,sn=an==tn.length,ln=tn.text.slice(an,an+se.length)==se?an:-1;an<tn.text.length&&an<z&&(z=an),d.push({line:tn,comment:ln,token:se,indent:an,empty:sn,single:!1})}le=tn.to+1}if(z<1e9)for(let le=I;le<d.length;le++)d[le].indent<d[le].line.text.length&&(d[le].indent=z);d.length==I+1&&(d[I].single=!0)}}if(o!=2&&d.some(b=>b.comment<0&&(!b.empty||b.single))){let b=[];for(let{line:I,token:z,indent:se,empty:le,single:tn}of d)(tn||!le)&&b.push({from:I.from+se,insert:z+" "});let R=e.changes(b);return{changes:R,selection:e.selection.map(R,1)}}else if(o!=1&&d.some(b=>b.comment>=0)){let b=[];for(let{line:R,comment:I,token:z}of d)if(I>=0){let se=R.from+I,le=se+z.length;R.text[le-R.from]==" "&&le++,b.push({from:se,to:le})}return{changes:b}}return null}const fromHistory=Annotation.define(),isolateHistory=Annotation.define(),invertedEffects=Facet.define(),historyConfig=Facet.define({combine(o){return combineConfig(o,{minDepth:100,newGroupDelay:500,joinToEvent:(e,l)=>l},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,l)=>(d,p)=>e(d,p)||l(d,p)})}}),historyField_=StateField.define({create(){return HistoryState.empty},update(o,e){let l=e.state.facet(historyConfig),d=e.annotation(fromHistory);if(d){let z=HistEvent.fromTransaction(e,d.selection),se=d.side,le=se==0?o.undone:o.done;return z?le=updateBranch(le,le.length,l.minDepth,z):le=addSelection(le,e.startState.selection),new HistoryState(se==0?d.rest:le,se==0?le:d.rest)}let p=e.annotation(isolateHistory);if((p=="full"||p=="before")&&(o=o.isolate()),e.annotation(Transaction.addToHistory)===!1)return e.changes.empty?o:o.addMapping(e.changes.desc);let b=HistEvent.fromTransaction(e),R=e.annotation(Transaction.time),I=e.annotation(Transaction.userEvent);return b?o=o.addChanges(b,R,I,l,e):e.selection&&(o=o.addSelection(e.startState.selection,R,I,l.newGroupDelay)),(p=="full"||p=="after")&&(o=o.isolate()),o},toJSON(o){return{done:o.done.map(e=>e.toJSON()),undone:o.undone.map(e=>e.toJSON())}},fromJSON(o){return new HistoryState(o.done.map(HistEvent.fromJSON),o.undone.map(HistEvent.fromJSON))}});function history(o={}){return[historyField_,historyConfig.of(o),EditorView.domEventHandlers({beforeinput(e,l){let d=e.inputType=="historyUndo"?undo:e.inputType=="historyRedo"?redo:null;return d?(e.preventDefault(),d(l)):!1}})]}function cmd(o,e){return function({state:l,dispatch:d}){if(!e&&l.readOnly)return!1;let p=l.field(historyField_,!1);if(!p)return!1;let b=p.pop(o,l,e);return b?(d(b),!0):!1}}const undo=cmd(0,!1),redo=cmd(1,!1),undoSelection=cmd(0,!0),redoSelection=cmd(1,!0);class HistEvent{constructor(e,l,d,p,b){this.changes=e,this.effects=l,this.mapped=d,this.startSelection=p,this.selectionsAfter=b}setSelAfter(e){return new HistEvent(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,l,d;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(l=this.mapped)===null||l===void 0?void 0:l.toJSON(),startSelection:(d=this.startSelection)===null||d===void 0?void 0:d.toJSON(),selectionsAfter:this.selectionsAfter.map(p=>p.toJSON())}}static fromJSON(e){return new HistEvent(e.changes&&ChangeSet.fromJSON(e.changes),[],e.mapped&&ChangeDesc.fromJSON(e.mapped),e.startSelection&&EditorSelection.fromJSON(e.startSelection),e.selectionsAfter.map(EditorSelection.fromJSON))}static fromTransaction(e,l){let d=none;for(let p of e.startState.facet(invertedEffects)){let b=p(e);b.length&&(d=d.concat(b))}return!d.length&&e.changes.empty?null:new HistEvent(e.changes.invert(e.startState.doc),d,void 0,l||e.startState.selection,none)}static selection(e){return new HistEvent(void 0,none,void 0,void 0,e)}}function updateBranch(o,e,l,d){let p=e+1>l+20?e-l-1:0,b=o.slice(p,e);return b.push(d),b}function isAdjacent(o,e){let l=[],d=!1;return o.iterChangedRanges((p,b)=>l.push(p,b)),e.iterChangedRanges((p,b,R,I)=>{for(let z=0;z<l.length;){let se=l[z++],le=l[z++];I>=se&&R<=le&&(d=!0)}}),d}function eqSelectionShape(o,e){return o.ranges.length==e.ranges.length&&o.ranges.filter((l,d)=>l.empty!=e.ranges[d].empty).length===0}function conc(o,e){return o.length?e.length?o.concat(e):o:e}const none=[],MaxSelectionsPerEvent=200;function addSelection(o,e){if(o.length){let l=o[o.length-1],d=l.selectionsAfter.slice(Math.max(0,l.selectionsAfter.length-MaxSelectionsPerEvent));return d.length&&d[d.length-1].eq(e)?o:(d.push(e),updateBranch(o,o.length-1,1e9,l.setSelAfter(d)))}else return[HistEvent.selection([e])]}function popSelection(o){let e=o[o.length-1],l=o.slice();return l[o.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),l}function addMappingToBranch(o,e){if(!o.length)return o;let l=o.length,d=none;for(;l;){let p=mapEvent(o[l-1],e,d);if(p.changes&&!p.changes.empty||p.effects.length){let b=o.slice(0,l);return b[l-1]=p,b}else e=p.mapped,l--,d=p.selectionsAfter}return d.length?[HistEvent.selection(d)]:none}function mapEvent(o,e,l){let d=conc(o.selectionsAfter.length?o.selectionsAfter.map(I=>I.map(e)):none,l);if(!o.changes)return HistEvent.selection(d);let p=o.changes.map(e),b=e.mapDesc(o.changes,!0),R=o.mapped?o.mapped.composeDesc(b):b;return new HistEvent(p,StateEffect.mapEffects(o.effects,e),R,o.startSelection.map(b),d)}const joinableUserEvent=/^(input\.type|delete)($|\.)/;class HistoryState{constructor(e,l,d=0,p=void 0){this.done=e,this.undone=l,this.prevTime=d,this.prevUserEvent=p}isolate(){return this.prevTime?new HistoryState(this.done,this.undone):this}addChanges(e,l,d,p,b){let R=this.done,I=R[R.length-1];return I&&I.changes&&!I.changes.empty&&e.changes&&(!d||joinableUserEvent.test(d))&&(!I.selectionsAfter.length&&l-this.prevTime<p.newGroupDelay&&p.joinToEvent(b,isAdjacent(I.changes,e.changes))||d=="input.type.compose")?R=updateBranch(R,R.length-1,p.minDepth,new HistEvent(e.changes.compose(I.changes),conc(StateEffect.mapEffects(e.effects,I.changes),I.effects),I.mapped,I.startSelection,none)):R=updateBranch(R,R.length,p.minDepth,e),new HistoryState(R,none,l,d)}addSelection(e,l,d,p){let b=this.done.length?this.done[this.done.length-1].selectionsAfter:none;return b.length>0&&l-this.prevTime<p&&d==this.prevUserEvent&&d&&/^select($|\.)/.test(d)&&eqSelectionShape(b[b.length-1],e)?this:new HistoryState(addSelection(this.done,e),this.undone,l,d)}addMapping(e){return new HistoryState(addMappingToBranch(this.done,e),addMappingToBranch(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,l,d){let p=e==0?this.done:this.undone;if(p.length==0)return null;let b=p[p.length-1],R=b.selectionsAfter[0]||l.selection;if(d&&b.selectionsAfter.length)return l.update({selection:b.selectionsAfter[b.selectionsAfter.length-1],annotations:fromHistory.of({side:e,rest:popSelection(p),selection:R}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(b.changes){let I=p.length==1?none:p.slice(0,p.length-1);return b.mapped&&(I=addMappingToBranch(I,b.mapped)),l.update({changes:b.changes,selection:b.startSelection,effects:b.effects,annotations:fromHistory.of({side:e,rest:I,selection:R}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}HistoryState.empty=new HistoryState(none,none);const historyKeymap=[{key:"Mod-z",run:undo,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:redo,preventDefault:!0},{linux:"Ctrl-Shift-z",run:redo,preventDefault:!0},{key:"Mod-u",run:undoSelection,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:redoSelection,preventDefault:!0}];function updateSel(o,e){return EditorSelection.create(o.ranges.map(e),o.mainIndex)}function setSel(o,e){return o.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function moveSel({state:o,dispatch:e},l){let d=updateSel(o.selection,l);return d.eq(o.selection,!0)?!1:(e(setSel(o,d)),!0)}function rangeEnd(o,e){return EditorSelection.cursor(e?o.to:o.from)}function cursorByChar$1(o,e){return moveSel(o,l=>l.empty?o.moveByChar(l,e):rangeEnd(l,e))}function ltrAtCursor(o){return o.textDirectionAt(o.state.selection.main.head)==Direction.LTR}const cursorCharLeft=o=>cursorByChar$1(o,!ltrAtCursor(o)),cursorCharRight=o=>cursorByChar$1(o,ltrAtCursor(o)),cursorCharBackward=o=>cursorByChar$1(o,!1);function cursorByGroup(o,e){return moveSel(o,l=>l.empty?o.moveByGroup(l,e):rangeEnd(l,e))}const cursorGroupLeft=o=>cursorByGroup(o,!ltrAtCursor(o)),cursorGroupRight=o=>cursorByGroup(o,ltrAtCursor(o));function interestingNode(o,e,l){if(e.type.prop(l))return!0;let d=e.to-e.from;return d&&(d>2||/[^\s,.;:]/.test(o.sliceDoc(e.from,e.to)))||e.firstChild}function moveBySyntax(o,e,l){let d=syntaxTree(o).resolveInner(e.head),p=l?NodeProp.closedBy:NodeProp.openedBy;for(let z=e.head;;){let se=l?d.childAfter(z):d.childBefore(z);if(!se)break;interestingNode(o,se,p)?d=se:z=l?se.to:se.from}let b=d.type.prop(p),R,I;return b&&(R=l?matchBrackets(o,d.from,1):matchBrackets(o,d.to,-1))&&R.matched?I=l?R.end.to:R.end.from:I=l?d.to:d.from,EditorSelection.cursor(I,l?-1:1)}const cursorSyntaxLeft=o=>moveSel(o,e=>moveBySyntax(o.state,e,!ltrAtCursor(o))),cursorSyntaxRight=o=>moveSel(o,e=>moveBySyntax(o.state,e,ltrAtCursor(o)));function cursorByLine$1(o,e){return moveSel(o,l=>{if(!l.empty)return rangeEnd(l,e);let d=o.moveVertically(l,e);return d.head!=l.head?d:o.moveToLineBoundary(l,e)})}const cursorLineUp=o=>cursorByLine$1(o,!1),cursorLineDown=o=>cursorByLine$1(o,!0);function pageInfo(o){let e=o.scrollDOM.clientHeight<o.scrollDOM.scrollHeight-2,l=0,d=0,p;if(e){for(let b of o.state.facet(EditorView.scrollMargins)){let R=b(o);R?.top&&(l=Math.max(R?.top,l)),R?.bottom&&(d=Math.max(R?.bottom,d))}p=o.scrollDOM.clientHeight-l-d}else p=(o.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:l,marginBottom:d,selfScroll:e,height:Math.max(o.defaultLineHeight,p-5)}}function cursorByPage(o,e){let l=pageInfo(o),{state:d}=o,p=updateSel(d.selection,R=>R.empty?o.moveVertically(R,e,l.height):rangeEnd(R,e));if(p.eq(d.selection))return!1;let b;if(l.selfScroll){let R=o.coordsAtPos(d.selection.main.head),I=o.scrollDOM.getBoundingClientRect(),z=I.top+l.marginTop,se=I.bottom-l.marginBottom;R&&R.top>z&&R.bottom<se&&(b=EditorView.scrollIntoView(p.main.head,{y:"start",yMargin:R.top-z}))}return o.dispatch(setSel(d,p),{effects:b}),!0}const cursorPageUp=o=>cursorByPage(o,!1),cursorPageDown=o=>cursorByPage(o,!0);function moveByLineBoundary(o,e,l){let d=o.lineBlockAt(e.head),p=o.moveToLineBoundary(e,l);if(p.head==e.head&&p.head!=(l?d.to:d.from)&&(p=o.moveToLineBoundary(e,l,!1)),!l&&p.head==d.from&&d.length){let b=/^\s*/.exec(o.state.sliceDoc(d.from,Math.min(d.from+100,d.to)))[0].length;b&&e.head!=d.from+b&&(p=EditorSelection.cursor(d.from+b))}return p}const cursorLineBoundaryForward=o=>moveSel(o,e=>moveByLineBoundary(o,e,!0)),cursorLineBoundaryBackward=o=>moveSel(o,e=>moveByLineBoundary(o,e,!1)),cursorLineBoundaryLeft=o=>moveSel(o,e=>moveByLineBoundary(o,e,!ltrAtCursor(o))),cursorLineBoundaryRight=o=>moveSel(o,e=>moveByLineBoundary(o,e,ltrAtCursor(o))),cursorLineStart=o=>moveSel(o,e=>EditorSelection.cursor(o.lineBlockAt(e.head).from,1)),cursorLineEnd=o=>moveSel(o,e=>EditorSelection.cursor(o.lineBlockAt(e.head).to,-1));function toMatchingBracket(o,e,l){let d=!1,p=updateSel(o.selection,b=>{let R=matchBrackets(o,b.head,-1)||matchBrackets(o,b.head,1)||b.head>0&&matchBrackets(o,b.head-1,1)||b.head<o.doc.length&&matchBrackets(o,b.head+1,-1);if(!R||!R.end)return b;d=!0;let I=R.start.from==b.head?R.end.to:R.end.from;return EditorSelection.cursor(I)});return d?(e(setSel(o,p)),!0):!1}const cursorMatchingBracket=({state:o,dispatch:e})=>toMatchingBracket(o,e);function extendSel(o,e){let l=updateSel(o.state.selection,d=>{let p=e(d);return EditorSelection.range(d.anchor,p.head,p.goalColumn,p.bidiLevel||void 0)});return l.eq(o.state.selection)?!1:(o.dispatch(setSel(o.state,l)),!0)}function selectByChar$1(o,e){return extendSel(o,l=>o.moveByChar(l,e))}const selectCharLeft=o=>selectByChar$1(o,!ltrAtCursor(o)),selectCharRight=o=>selectByChar$1(o,ltrAtCursor(o));function selectByGroup(o,e){return extendSel(o,l=>o.moveByGroup(l,e))}const selectGroupLeft=o=>selectByGroup(o,!ltrAtCursor(o)),selectGroupRight=o=>selectByGroup(o,ltrAtCursor(o)),selectSyntaxLeft=o=>extendSel(o,e=>moveBySyntax(o.state,e,!ltrAtCursor(o))),selectSyntaxRight=o=>extendSel(o,e=>moveBySyntax(o.state,e,ltrAtCursor(o)));function selectByLine$1(o,e){return extendSel(o,l=>o.moveVertically(l,e))}const selectLineUp=o=>selectByLine$1(o,!1),selectLineDown=o=>selectByLine$1(o,!0);function selectByPage(o,e){return extendSel(o,l=>o.moveVertically(l,e,pageInfo(o).height))}const selectPageUp=o=>selectByPage(o,!1),selectPageDown=o=>selectByPage(o,!0),selectLineBoundaryForward=o=>extendSel(o,e=>moveByLineBoundary(o,e,!0)),selectLineBoundaryBackward=o=>extendSel(o,e=>moveByLineBoundary(o,e,!1)),selectLineBoundaryLeft=o=>extendSel(o,e=>moveByLineBoundary(o,e,!ltrAtCursor(o))),selectLineBoundaryRight=o=>extendSel(o,e=>moveByLineBoundary(o,e,ltrAtCursor(o))),selectLineStart=o=>extendSel(o,e=>EditorSelection.cursor(o.lineBlockAt(e.head).from)),selectLineEnd=o=>extendSel(o,e=>EditorSelection.cursor(o.lineBlockAt(e.head).to)),cursorDocStart=({state:o,dispatch:e})=>(e(setSel(o,{anchor:0})),!0),cursorDocEnd=({state:o,dispatch:e})=>(e(setSel(o,{anchor:o.doc.length})),!0),selectDocStart=({state:o,dispatch:e})=>(e(setSel(o,{anchor:o.selection.main.anchor,head:0})),!0),selectDocEnd=({state:o,dispatch:e})=>(e(setSel(o,{anchor:o.selection.main.anchor,head:o.doc.length})),!0),selectAll=({state:o,dispatch:e})=>(e(o.update({selection:{anchor:0,head:o.doc.length},userEvent:"select"})),!0),selectLine=({state:o,dispatch:e})=>{let l=selectedLineBlocks(o).map(({from:d,to:p})=>EditorSelection.range(d,Math.min(p+1,o.doc.length)));return e(o.update({selection:EditorSelection.create(l),userEvent:"select"})),!0},selectParentSyntax=({state:o,dispatch:e})=>{let l=updateSel(o.selection,d=>{let p=syntaxTree(o),b=p.resolveStack(d.from,1);if(d.empty){let R=p.resolveStack(d.from,-1);R.node.from>=b.node.from&&R.node.to<=b.node.to&&(b=R)}for(let R=b;R;R=R.next){let{node:I}=R;if((I.from<d.from&&I.to>=d.to||I.to>d.to&&I.from<=d.from)&&R.next)return EditorSelection.range(I.to,I.from)}return d});return l.eq(o.selection)?!1:(e(setSel(o,l)),!0)},simplifySelection=({state:o,dispatch:e})=>{let l=o.selection,d=null;return l.ranges.length>1?d=EditorSelection.create([l.main]):l.main.empty||(d=EditorSelection.create([EditorSelection.cursor(l.main.head)])),d?(e(setSel(o,d)),!0):!1};function deleteBy(o,e){if(o.state.readOnly)return!1;let l="delete.selection",{state:d}=o,p=d.changeByRange(b=>{let{from:R,to:I}=b;if(R==I){let z=e(b);z<R?(l="delete.backward",z=skipAtomic(o,z,!1)):z>R&&(l="delete.forward",z=skipAtomic(o,z,!0)),R=Math.min(R,z),I=Math.max(I,z)}else R=skipAtomic(o,R,!1),I=skipAtomic(o,I,!0);return R==I?{range:b}:{changes:{from:R,to:I},range:EditorSelection.cursor(R,R<b.head?-1:1)}});return p.changes.empty?!1:(o.dispatch(d.update(p,{scrollIntoView:!0,userEvent:l,effects:l=="delete.selection"?EditorView.announce.of(d.phrase("Selection deleted")):void 0})),!0)}function skipAtomic(o,e,l){if(o instanceof EditorView)for(let d of o.state.facet(EditorView.atomicRanges).map(p=>p(o)))d.between(e,e,(p,b)=>{p<e&&b>e&&(e=l?b:p)});return e}const deleteByChar=(o,e,l)=>deleteBy(o,d=>{let p=d.from,{state:b}=o,R=b.doc.lineAt(p),I,z;if(l&&!e&&p>R.from&&p<R.from+200&&!/[^ \t]/.test(I=R.text.slice(0,p-R.from))){if(I[I.length-1]==" ")return p-1;let se=countColumn(I,b.tabSize),le=se%getIndentUnit(b)||getIndentUnit(b);for(let tn=0;tn<le&&I[I.length-1-tn]==" ";tn++)p--;z=p}else z=findClusterBreak(R.text,p-R.from,e,e)+R.from,z==p&&R.number!=(e?b.doc.lines:1)?z+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(R.text.slice(z-R.from,p-R.from))&&(z=findClusterBreak(R.text,z-R.from,!1,!1)+R.from);return z}),deleteCharBackward=o=>deleteByChar(o,!1,!0),deleteCharForward=o=>deleteByChar(o,!0,!1),deleteByGroup=(o,e)=>deleteBy(o,l=>{let d=l.head,{state:p}=o,b=p.doc.lineAt(d),R=p.charCategorizer(d);for(let I=null;;){if(d==(e?b.to:b.from)){d==l.head&&b.number!=(e?p.doc.lines:1)&&(d+=e?1:-1);break}let z=findClusterBreak(b.text,d-b.from,e)+b.from,se=b.text.slice(Math.min(d,z)-b.from,Math.max(d,z)-b.from),le=R(se);if(I!=null&&le!=I)break;(se!=" "||d!=l.head)&&(I=le),d=z}return d}),deleteGroupBackward=o=>deleteByGroup(o,!1),deleteGroupForward=o=>deleteByGroup(o,!0),deleteToLineEnd=o=>deleteBy(o,e=>{let l=o.lineBlockAt(e.head).to;return e.head<l?l:Math.min(o.state.doc.length,e.head+1)}),deleteToLineStart=o=>deleteBy(o,e=>{let l=o.lineBlockAt(e.head).from;return e.head>l?l:Math.max(0,e.head-1)}),deleteLineBoundaryBackward=o=>deleteBy(o,e=>{let l=o.moveToLineBoundary(e,!1).head;return e.head>l?l:Math.max(0,e.head-1)}),deleteLineBoundaryForward=o=>deleteBy(o,e=>{let l=o.moveToLineBoundary(e,!0).head;return e.head<l?l:Math.min(o.state.doc.length,e.head+1)}),splitLine=({state:o,dispatch:e})=>{if(o.readOnly)return!1;let l=o.changeByRange(d=>({changes:{from:d.from,to:d.to,insert:Text$1.of(["",""])},range:EditorSelection.cursor(d.from)}));return e(o.update(l,{scrollIntoView:!0,userEvent:"input"})),!0},transposeChars=({state:o,dispatch:e})=>{if(o.readOnly)return!1;let l=o.changeByRange(d=>{if(!d.empty||d.from==0||d.from==o.doc.length)return{range:d};let p=d.from,b=o.doc.lineAt(p),R=p==b.from?p-1:findClusterBreak(b.text,p-b.from,!1)+b.from,I=p==b.to?p+1:findClusterBreak(b.text,p-b.from,!0)+b.from;return{changes:{from:R,to:I,insert:o.doc.slice(p,I).append(o.doc.slice(R,p))},range:EditorSelection.cursor(I)}});return l.changes.empty?!1:(e(o.update(l,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function selectedLineBlocks(o){let e=[],l=-1;for(let d of o.selection.ranges){let p=o.doc.lineAt(d.from),b=o.doc.lineAt(d.to);if(!d.empty&&d.to==b.from&&(b=o.doc.lineAt(d.to-1)),l>=p.number){let R=e[e.length-1];R.to=b.to,R.ranges.push(d)}else e.push({from:p.from,to:b.to,ranges:[d]});l=b.number+1}return e}function moveLine(o,e,l){if(o.readOnly)return!1;let d=[],p=[];for(let b of selectedLineBlocks(o)){if(l?b.to==o.doc.length:b.from==0)continue;let R=o.doc.lineAt(l?b.to+1:b.from-1),I=R.length+1;if(l){d.push({from:b.to,to:R.to},{from:b.from,insert:R.text+o.lineBreak});for(let z of b.ranges)p.push(EditorSelection.range(Math.min(o.doc.length,z.anchor+I),Math.min(o.doc.length,z.head+I)))}else{d.push({from:R.from,to:b.from},{from:b.to,insert:o.lineBreak+R.text});for(let z of b.ranges)p.push(EditorSelection.range(z.anchor-I,z.head-I))}}return d.length?(e(o.update({changes:d,scrollIntoView:!0,selection:EditorSelection.create(p,o.selection.mainIndex),userEvent:"move.line"})),!0):!1}const moveLineUp=({state:o,dispatch:e})=>moveLine(o,e,!1),moveLineDown=({state:o,dispatch:e})=>moveLine(o,e,!0);function copyLine(o,e,l){if(o.readOnly)return!1;let d=[];for(let p of selectedLineBlocks(o))l?d.push({from:p.from,insert:o.doc.slice(p.from,p.to)+o.lineBreak}):d.push({from:p.to,insert:o.lineBreak+o.doc.slice(p.from,p.to)});return e(o.update({changes:d,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const copyLineUp=({state:o,dispatch:e})=>copyLine(o,e,!1),copyLineDown=({state:o,dispatch:e})=>copyLine(o,e,!0),deleteLine=o=>{if(o.state.readOnly)return!1;let{state:e}=o,l=e.changes(selectedLineBlocks(e).map(({from:p,to:b})=>(p>0?p--:b<e.doc.length&&b++,{from:p,to:b}))),d=updateSel(e.selection,p=>{let b;if(o.lineWrapping){let R=o.lineBlockAt(p.head),I=o.coordsAtPos(p.head,p.assoc||1);I&&(b=R.bottom+o.documentTop-I.bottom+o.defaultLineHeight/2)}return o.moveVertically(p,!0,b)}).map(l);return o.dispatch({changes:l,selection:d,scrollIntoView:!0,userEvent:"delete.line"}),!0};function isBetweenBrackets(o,e){if(/\(\)|\[\]|\{\}/.test(o.sliceDoc(e-1,e+1)))return{from:e,to:e};let l=syntaxTree(o).resolveInner(e),d=l.childBefore(e),p=l.childAfter(e),b;return d&&p&&d.to<=e&&p.from>=e&&(b=d.type.prop(NodeProp.closedBy))&&b.indexOf(p.name)>-1&&o.doc.lineAt(d.to).from==o.doc.lineAt(p.from).from&&!/\S/.test(o.sliceDoc(d.to,p.from))?{from:d.to,to:p.from}:null}const insertNewlineAndIndent=newlineAndIndent(!1),insertBlankLine=newlineAndIndent(!0);function newlineAndIndent(o){return({state:e,dispatch:l})=>{if(e.readOnly)return!1;let d=e.changeByRange(p=>{let{from:b,to:R}=p,I=e.doc.lineAt(b),z=!o&&b==R&&isBetweenBrackets(e,b);o&&(b=R=(R<=I.to?I:e.doc.lineAt(R)).to);let se=new IndentContext(e,{simulateBreak:b,simulateDoubleBreak:!!z}),le=getIndentation(se,b);for(le==null&&(le=countColumn(/^\s*/.exec(e.doc.lineAt(b).text)[0],e.tabSize));R<I.to&&/\s/.test(I.text[R-I.from]);)R++;z?{from:b,to:R}=z:b>I.from&&b<I.from+100&&!/\S/.test(I.text.slice(0,b))&&(b=I.from);let tn=["",indentString(e,le)];return z&&tn.push(indentString(e,se.lineIndent(I.from,-1))),{changes:{from:b,to:R,insert:Text$1.of(tn)},range:EditorSelection.cursor(b+1+tn[1].length)}});return l(e.update(d,{scrollIntoView:!0,userEvent:"input"})),!0}}function changeBySelectedLine(o,e){let l=-1;return o.changeByRange(d=>{let p=[];for(let R=d.from;R<=d.to;){let I=o.doc.lineAt(R);I.number>l&&(d.empty||d.to>I.from)&&(e(I,p,d),l=I.number),R=I.to+1}let b=o.changes(p);return{changes:p,range:EditorSelection.range(b.mapPos(d.anchor,1),b.mapPos(d.head,1))}})}const indentSelection=({state:o,dispatch:e})=>{if(o.readOnly)return!1;let l=Object.create(null),d=new IndentContext(o,{overrideIndentation:b=>{let R=l[b];return R??-1}}),p=changeBySelectedLine(o,(b,R,I)=>{let z=getIndentation(d,b.from);if(z==null)return;/\S/.test(b.text)||(z=0);let se=/^\s*/.exec(b.text)[0],le=indentString(o,z);(se!=le||I.from<b.from+se.length)&&(l[b.from]=z,R.push({from:b.from,to:b.from+se.length,insert:le}))});return p.changes.empty||e(o.update(p,{userEvent:"indent"})),!0},indentMore=({state:o,dispatch:e})=>o.readOnly?!1:(e(o.update(changeBySelectedLine(o,(l,d)=>{d.push({from:l.from,insert:o.facet(indentUnit)})}),{userEvent:"input.indent"})),!0),indentLess=({state:o,dispatch:e})=>o.readOnly?!1:(e(o.update(changeBySelectedLine(o,(l,d)=>{let p=/^\s*/.exec(l.text)[0];if(!p)return;let b=countColumn(p,o.tabSize),R=0,I=indentString(o,Math.max(0,b-getIndentUnit(o)));for(;R<p.length&&R<I.length&&p.charCodeAt(R)==I.charCodeAt(R);)R++;d.push({from:l.from+R,to:l.from+p.length,insert:I.slice(R)})}),{userEvent:"delete.dedent"})),!0),toggleTabFocusMode=o=>(o.setTabFocusMode(),!0),emacsStyleKeymap=[{key:"Ctrl-b",run:cursorCharLeft,shift:selectCharLeft,preventDefault:!0},{key:"Ctrl-f",run:cursorCharRight,shift:selectCharRight},{key:"Ctrl-p",run:cursorLineUp,shift:selectLineUp},{key:"Ctrl-n",run:cursorLineDown,shift:selectLineDown},{key:"Ctrl-a",run:cursorLineStart,shift:selectLineStart},{key:"Ctrl-e",run:cursorLineEnd,shift:selectLineEnd},{key:"Ctrl-d",run:deleteCharForward},{key:"Ctrl-h",run:deleteCharBackward},{key:"Ctrl-k",run:deleteToLineEnd},{key:"Ctrl-Alt-h",run:deleteGroupBackward},{key:"Ctrl-o",run:splitLine},{key:"Ctrl-t",run:transposeChars},{key:"Ctrl-v",run:cursorPageDown}],standardKeymap=[{key:"ArrowLeft",run:cursorCharLeft,shift:selectCharLeft,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:cursorGroupLeft,shift:selectGroupLeft,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:cursorLineBoundaryLeft,shift:selectLineBoundaryLeft,preventDefault:!0},{key:"ArrowRight",run:cursorCharRight,shift:selectCharRight,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:cursorGroupRight,shift:selectGroupRight,preventDefault:!0},{mac:"Cmd-ArrowRight",run:cursorLineBoundaryRight,shift:selectLineBoundaryRight,preventDefault:!0},{key:"ArrowUp",run:cursorLineUp,shift:selectLineUp,preventDefault:!0},{mac:"Cmd-ArrowUp",run:cursorDocStart,shift:selectDocStart},{mac:"Ctrl-ArrowUp",run:cursorPageUp,shift:selectPageUp},{key:"ArrowDown",run:cursorLineDown,shift:selectLineDown,preventDefault:!0},{mac:"Cmd-ArrowDown",run:cursorDocEnd,shift:selectDocEnd},{mac:"Ctrl-ArrowDown",run:cursorPageDown,shift:selectPageDown},{key:"PageUp",run:cursorPageUp,shift:selectPageUp},{key:"PageDown",run:cursorPageDown,shift:selectPageDown},{key:"Home",run:cursorLineBoundaryBackward,shift:selectLineBoundaryBackward,preventDefault:!0},{key:"Mod-Home",run:cursorDocStart,shift:selectDocStart},{key:"End",run:cursorLineBoundaryForward,shift:selectLineBoundaryForward,preventDefault:!0},{key:"Mod-End",run:cursorDocEnd,shift:selectDocEnd},{key:"Enter",run:insertNewlineAndIndent,shift:insertNewlineAndIndent},{key:"Mod-a",run:selectAll},{key:"Backspace",run:deleteCharBackward,shift:deleteCharBackward},{key:"Delete",run:deleteCharForward},{key:"Mod-Backspace",mac:"Alt-Backspace",run:deleteGroupBackward},{key:"Mod-Delete",mac:"Alt-Delete",run:deleteGroupForward},{mac:"Mod-Backspace",run:deleteLineBoundaryBackward},{mac:"Mod-Delete",run:deleteLineBoundaryForward}].concat(emacsStyleKeymap.map(o=>({mac:o.key,run:o.run,shift:o.shift}))),defaultKeymap=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:cursorSyntaxLeft,shift:selectSyntaxLeft},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:cursorSyntaxRight,shift:selectSyntaxRight},{key:"Alt-ArrowUp",run:moveLineUp},{key:"Shift-Alt-ArrowUp",run:copyLineUp},{key:"Alt-ArrowDown",run:moveLineDown},{key:"Shift-Alt-ArrowDown",run:copyLineDown},{key:"Escape",run:simplifySelection},{key:"Mod-Enter",run:insertBlankLine},{key:"Alt-l",mac:"Ctrl-l",run:selectLine},{key:"Mod-i",run:selectParentSyntax,preventDefault:!0},{key:"Mod-[",run:indentLess},{key:"Mod-]",run:indentMore},{key:"Mod-Alt-\\",run:indentSelection},{key:"Shift-Mod-k",run:deleteLine},{key:"Shift-Mod-\\",run:cursorMatchingBracket},{key:"Mod-/",run:toggleComment},{key:"Alt-A",run:toggleBlockComment},{key:"Ctrl-m",mac:"Shift-Alt-m",run:toggleTabFocusMode}].concat(standardKeymap),indentWithTab={key:"Tab",run:indentMore,shift:indentLess};class Stack{constructor(e,l,d,p,b,R,I,z,se,le=0,tn){this.p=e,this.stack=l,this.state=d,this.reducePos=p,this.pos=b,this.score=R,this.buffer=I,this.bufferBase=z,this.curContext=se,this.lookAhead=le,this.parent=tn}toString(){return`[${this.stack.filter((e,l)=>l%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,l,d=0){let p=e.parser.context;return new Stack(e,[],l,d,d,0,[],0,p?new StackContext(p,p.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,l){this.stack.push(this.state,l,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var l;let d=e>>19,p=e&65535,{parser:b}=this.p,R=this.reducePos<this.pos-25;R&&this.setLookAhead(this.pos);let I=b.dynamicPrecedence(p);if(I&&(this.score+=I),d==0){this.pushState(b.getGoto(this.state,p,!0),this.reducePos),p<b.minRepeatTerm&&this.storeNode(p,this.reducePos,this.reducePos,R?8:4,!0),this.reduceContext(p,this.reducePos);return}let z=this.stack.length-(d-1)*3-(e&262144?6:0),se=z?this.stack[z-2]:this.p.ranges[0].from,le=this.reducePos-se;le>=2e3&&!(!((l=this.p.parser.nodeSet.types[p])===null||l===void 0)&&l.isAnonymous)&&(se==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=le):this.p.lastBigReductionSize<le&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=se,this.p.lastBigReductionSize=le));let tn=z?this.stack[z-1]:0,an=this.bufferBase+this.buffer.length-tn;if(p<b.minRepeatTerm||e&131072){let sn=b.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(p,se,sn,an+4,!0)}if(e&262144)this.state=this.stack[z];else{let sn=this.stack[z-3];this.state=b.getGoto(sn,p,!0)}for(;this.stack.length>z;)this.stack.pop();this.reduceContext(p,se)}storeNode(e,l,d,p=4,b=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let R=this,I=this.buffer.length;if(I==0&&R.parent&&(I=R.bufferBase-R.parent.bufferBase,R=R.parent),I>0&&R.buffer[I-4]==0&&R.buffer[I-1]>-1){if(l==d)return;if(R.buffer[I-2]>=l){R.buffer[I-2]=d;return}}}if(!b||this.pos==d)this.buffer.push(e,l,d,p);else{let R=this.buffer.length;if(R>0&&this.buffer[R-4]!=0){let I=!1;for(let z=R;z>0&&this.buffer[z-2]>d;z-=4)if(this.buffer[z-1]>=0){I=!0;break}if(I)for(;R>0&&this.buffer[R-2]>d;)this.buffer[R]=this.buffer[R-4],this.buffer[R+1]=this.buffer[R-3],this.buffer[R+2]=this.buffer[R-2],this.buffer[R+3]=this.buffer[R-1],R-=4,p>4&&(p-=4)}this.buffer[R]=e,this.buffer[R+1]=l,this.buffer[R+2]=d,this.buffer[R+3]=p}}shift(e,l,d,p){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=p,this.shiftContext(l,d),l<=this.p.parser.maxNode&&this.buffer.push(l,d,p,4);else{let b=e,{parser:R}=this.p;(p>this.pos||l<=R.maxNode)&&(this.pos=p,R.stateFlag(b,1)||(this.reducePos=p)),this.pushState(b,d),this.shiftContext(l,d),l<=R.maxNode&&this.buffer.push(l,d,p,4)}}apply(e,l,d,p){e&65536?this.reduce(e):this.shift(e,l,d,p)}useNode(e,l){let d=this.p.reused.length-1;(d<0||this.p.reused[d]!=e)&&(this.p.reused.push(e),d++);let p=this.pos;this.reducePos=this.pos=p+e.length,this.pushState(l,p),this.buffer.push(d,p,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,l=e.buffer.length;for(;l>0&&e.buffer[l-2]>e.reducePos;)l-=4;let d=e.buffer.slice(l),p=e.bufferBase+l;for(;e&&p==e.bufferBase;)e=e.parent;return new Stack(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,d,p,this.curContext,this.lookAhead,e)}recoverByDelete(e,l){let d=e<=this.p.parser.maxNode;d&&this.storeNode(e,this.pos,l,4),this.storeNode(0,this.pos,l,d?8:4),this.pos=this.reducePos=l,this.score-=190}canShift(e){for(let l=new SimulatedStack(this);;){let d=this.p.parser.stateSlot(l.state,4)||this.p.parser.hasAction(l.state,e);if(d==0)return!1;if(!(d&65536))return!0;l.reduce(d)}}recoverByInsert(e){if(this.stack.length>=300)return[];let l=this.p.parser.nextStates(this.state);if(l.length>8||this.stack.length>=120){let p=[];for(let b=0,R;b<l.length;b+=2)(R=l[b+1])!=this.state&&this.p.parser.hasAction(R,e)&&p.push(l[b],R);if(this.stack.length<120)for(let b=0;p.length<8&&b<l.length;b+=2){let R=l[b+1];p.some((I,z)=>z&1&&I==R)||p.push(l[b],R)}l=p}let d=[];for(let p=0;p<l.length&&d.length<4;p+=2){let b=l[p+1];if(b==this.state)continue;let R=this.split();R.pushState(b,this.pos),R.storeNode(0,R.pos,R.pos,4,!0),R.shiftContext(l[p],this.pos),R.reducePos=this.pos,R.score-=200,d.push(R)}return d}forceReduce(){let{parser:e}=this.p,l=e.stateSlot(this.state,5);if(!(l&65536))return!1;if(!e.validAction(this.state,l)){let d=l>>19,p=l&65535,b=this.stack.length-d*3;if(b<0||e.getGoto(this.stack[b],p,!1)<0){let R=this.findForcedReduction();if(R==null)return!1;l=R}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(l),!0}findForcedReduction(){let{parser:e}=this.p,l=[],d=(p,b)=>{if(!l.includes(p))return l.push(p),e.allActions(p,R=>{if(!(R&393216))if(R&65536){let I=(R>>19)-b;if(I>1){let z=R&65535,se=this.stack.length-I*3;if(se>=0&&e.getGoto(this.stack[se],z,!1)>=0)return I<<19|65536|z}}else{let I=d(R,b+1);if(I!=null)return I}})};return d(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let l=0;l<this.stack.length;l+=3)if(this.stack[l]!=e.stack[l])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,l){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(l)))}reduceContext(e,l){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(l)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let l=new StackContext(this.curContext.tracker,e);l.hash!=this.curContext.hash&&this.emitContext(),this.curContext=l}}setLookAhead(e){e>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class StackContext{constructor(e,l){this.tracker=e,this.context=l,this.hash=e.strict?e.hash(l):0}}class SimulatedStack{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let l=e&65535,d=e>>19;d==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(d-1)*3;let p=this.start.p.parser.getGoto(this.stack[this.base-3],l,!0);this.state=p}}class StackBufferCursor{constructor(e,l,d){this.stack=e,this.pos=l,this.index=d,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,l=e.bufferBase+e.buffer.length){return new StackBufferCursor(e,l,l-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new StackBufferCursor(this.stack,this.pos,this.index)}}function decodeArray(o,e=Uint16Array){if(typeof o!="string")return o;let l=null;for(let d=0,p=0;d<o.length;){let b=0;for(;;){let R=o.charCodeAt(d++),I=!1;if(R==126){b=65535;break}R>=92&&R--,R>=34&&R--;let z=R-32;if(z>=46&&(z-=46,I=!0),b+=z,I)break;b*=46}l?l[p++]=b:l=new e(b)}return l}class CachedToken{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const nullToken=new CachedToken;class InputStream{constructor(e,l){this.input=e,this.ranges=l,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=nullToken,this.rangeIndex=0,this.pos=this.chunkPos=l[0].from,this.range=l[0],this.end=l[l.length-1].to,this.readNext()}resolveOffset(e,l){let d=this.range,p=this.rangeIndex,b=this.pos+e;for(;b<d.from;){if(!p)return null;let R=this.ranges[--p];b-=d.from-R.to,d=R}for(;l<0?b>d.to:b>=d.to;){if(p==this.ranges.length-1)return null;let R=this.ranges[++p];b+=R.from-d.to,d=R}return b}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let l of this.ranges)if(l.to>e)return Math.max(e,l.from);return this.end}peek(e){let l=this.chunkOff+e,d,p;if(l>=0&&l<this.chunk.length)d=this.pos+e,p=this.chunk.charCodeAt(l);else{let b=this.resolveOffset(e,1);if(b==null)return-1;if(d=b,d>=this.chunk2Pos&&d<this.chunk2Pos+this.chunk2.length)p=this.chunk2.charCodeAt(d-this.chunk2Pos);else{let R=this.rangeIndex,I=this.range;for(;I.to<=d;)I=this.ranges[++R];this.chunk2=this.input.chunk(this.chunk2Pos=d),d+this.chunk2.length>I.to&&(this.chunk2=this.chunk2.slice(0,I.to-d)),p=this.chunk2.charCodeAt(0)}}return d>=this.token.lookAhead&&(this.token.lookAhead=d+1),p}acceptToken(e,l=0){let d=l?this.resolveOffset(l,-1):this.pos;if(d==null||d<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=d}acceptTokenTo(e,l){this.token.value=e,this.token.end=l}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:l}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=l,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),l=this.pos+e.length;this.chunk=l>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,l){if(l?(this.token=l,l.start=e,l.lookAhead=e+1,l.value=l.extended=-1):this.token=nullToken,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,l){if(e>=this.chunkPos&&l<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,l-this.chunkPos);if(e>=this.chunk2Pos&&l<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,l-this.chunk2Pos);if(e>=this.range.from&&l<=this.range.to)return this.input.read(e,l);let d="";for(let p of this.ranges){if(p.from>=l)break;p.to>e&&(d+=this.input.read(Math.max(p.from,e),Math.min(p.to,l)))}return d}}class TokenGroup{constructor(e,l){this.data=e,this.id=l}token(e,l){let{parser:d}=l.p;readToken(this.data,e,l,this.id,d.data,d.tokenPrecTable)}}TokenGroup.prototype.contextual=TokenGroup.prototype.fallback=TokenGroup.prototype.extend=!1;class LocalTokenGroup{constructor(e,l,d){this.precTable=l,this.elseToken=d,this.data=typeof e=="string"?decodeArray(e):e}token(e,l){let d=e.pos,p=0;for(;;){let b=e.next<0,R=e.resolveOffset(1,1);if(readToken(this.data,e,l,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(b||p++,R==null)break;e.reset(R,e.token)}p&&(e.reset(d,e.token),e.acceptToken(this.elseToken,p))}}LocalTokenGroup.prototype.contextual=TokenGroup.prototype.fallback=TokenGroup.prototype.extend=!1;class ExternalTokenizer{constructor(e,l={}){this.token=e,this.contextual=!!l.contextual,this.fallback=!!l.fallback,this.extend=!!l.extend}}function readToken(o,e,l,d,p,b){let R=0,I=1<<d,{dialect:z}=l.p.parser;e:for(;I&o[R];){let se=o[R+1];for(let sn=R+3;sn<se;sn+=2)if((o[sn+1]&I)>0){let ln=o[sn];if(z.allows(ln)&&(e.token.value==-1||e.token.value==ln||overrides(ln,e.token.value,p,b))){e.acceptToken(ln);break}}let le=e.next,tn=0,an=o[R+2];if(e.next<0&&an>tn&&o[se+an*3-3]==65535){R=o[se+an*3-1];continue e}for(;tn<an;){let sn=tn+an>>1,ln=se+sn+(sn<<1),un=o[ln],pn=o[ln+1]||65536;if(le<un)an=sn;else if(le>=pn)tn=sn+1;else{R=o[ln+2],e.advance();continue e}}break}}function findOffset(o,e,l){for(let d=e,p;(p=o[d])!=65535;d++)if(p==l)return d-e;return-1}function overrides(o,e,l,d){let p=findOffset(l,d,e);return p<0||findOffset(l,d,o)<p}const verbose=typeof process<"u"&&process.env&&/\bparse\b/.test(process.env.LOG);let stackIDs=null;function cutAt(o,e,l){let d=o.cursor(IterMode.IncludeAnonymous);for(d.moveTo(e);;)if(!(l<0?d.childBefore(e):d.childAfter(e)))for(;;){if((l<0?d.to<e:d.from>e)&&!d.type.isError)return l<0?Math.max(0,Math.min(d.to-1,e-25)):Math.min(o.length,Math.max(d.from+1,e+25));if(l<0?d.prevSibling():d.nextSibling())break;if(!d.parent())return l<0?0:o.length}}class FragmentCursor{constructor(e,l){this.fragments=e,this.nodeSet=l,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?cutAt(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?cutAt(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let l=this.trees.length-1;if(l<0)return this.nextFragment(),null;let d=this.trees[l],p=this.index[l];if(p==d.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let b=d.children[p],R=this.start[l]+d.positions[p];if(R>e)return this.nextStart=R,null;if(b instanceof Tree){if(R==e){if(R<this.safeFrom)return null;let I=R+b.length;if(I<=this.safeTo){let z=b.prop(NodeProp.lookAhead);if(!z||I+z<this.fragment.to)return b}}this.index[l]++,R+b.length>=Math.max(this.safeFrom,e)&&(this.trees.push(b),this.start.push(R),this.index.push(0))}else this.index[l]++,this.nextStart=R+b.length}}}class TokenCache{constructor(e,l){this.stream=l,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(d=>new CachedToken)}getActions(e){let l=0,d=null,{parser:p}=e.p,{tokenizers:b}=p,R=p.stateSlot(e.state,3),I=e.curContext?e.curContext.hash:0,z=0;for(let se=0;se<b.length;se++){if(!(1<<se&R))continue;let le=b[se],tn=this.tokens[se];if(!(d&&!le.fallback)&&((le.contextual||tn.start!=e.pos||tn.mask!=R||tn.context!=I)&&(this.updateCachedToken(tn,le,e),tn.mask=R,tn.context=I),tn.lookAhead>tn.end+25&&(z=Math.max(tn.lookAhead,z)),tn.value!=0)){let an=l;if(tn.extended>-1&&(l=this.addActions(e,tn.extended,tn.end,l)),l=this.addActions(e,tn.value,tn.end,l),!le.extend&&(d=tn,l>an))break}}for(;this.actions.length>l;)this.actions.pop();return z&&e.setLookAhead(z),!d&&e.pos==this.stream.end&&(d=new CachedToken,d.value=e.p.parser.eofTerm,d.start=d.end=e.pos,l=this.addActions(e,d.value,d.end,l)),this.mainToken=d,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let l=new CachedToken,{pos:d,p}=e;return l.start=d,l.end=Math.min(d+1,p.stream.end),l.value=d==p.stream.end?p.parser.eofTerm:0,l}updateCachedToken(e,l,d){let p=this.stream.clipPos(d.pos);if(l.token(this.stream.reset(p,e),d),e.value>-1){let{parser:b}=d.p;for(let R=0;R<b.specialized.length;R++)if(b.specialized[R]==e.value){let I=b.specializers[R](this.stream.read(e.start,e.end),d);if(I>=0&&d.p.parser.dialect.allows(I>>1)){I&1?e.extended=I>>1:e.value=I>>1;break}}}else e.value=0,e.end=this.stream.clipPos(p+1)}putAction(e,l,d,p){for(let b=0;b<p;b+=3)if(this.actions[b]==e)return p;return this.actions[p++]=e,this.actions[p++]=l,this.actions[p++]=d,p}addActions(e,l,d,p){let{state:b}=e,{parser:R}=e.p,{data:I}=R;for(let z=0;z<2;z++)for(let se=R.stateSlot(b,z?2:1);;se+=3){if(I[se]==65535)if(I[se+1]==1)se=pair(I,se+2);else{p==0&&I[se+1]==2&&(p=this.putAction(pair(I,se+2),l,d,p));break}I[se]==l&&(p=this.putAction(pair(I,se+1),l,d,p))}return p}}class Parse{constructor(e,l,d,p){this.parser=e,this.input=l,this.ranges=p,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new InputStream(l,p),this.tokens=new TokenCache(e,this.stream),this.topTerm=e.top[1];let{from:b}=p[0];this.stacks=[Stack.start(this,e.top[0],b)],this.fragments=d.length&&this.stream.end-b>e.bufferLength*4?new FragmentCursor(d,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,l=this.minStackPos,d=this.stacks=[],p,b;if(this.bigReductionCount>300&&e.length==1){let[R]=e;for(;R.forceReduce()&&R.stack.length&&R.stack[R.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let R=0;R<e.length;R++){let I=e[R];for(;;){if(this.tokens.mainToken=null,I.pos>l)d.push(I);else{if(this.advanceStack(I,d,e))continue;{p||(p=[],b=[]),p.push(I);let z=this.tokens.getMainToken(I);b.push(z.value,z.end)}}break}}if(!d.length){let R=p&&findFinished(p);if(R)return verbose&&console.log("Finish with "+this.stackID(R)),this.stackToTree(R);if(this.parser.strict)throw verbose&&p&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+l);this.recovering||(this.recovering=5)}if(this.recovering&&p){let R=this.stoppedAt!=null&&p[0].pos>this.stoppedAt?p[0]:this.runRecovery(p,b,d);if(R)return verbose&&console.log("Force-finish "+this.stackID(R)),this.stackToTree(R.forceAll())}if(this.recovering){let R=this.recovering==1?1:this.recovering*3;if(d.length>R)for(d.sort((I,z)=>z.score-I.score);d.length>R;)d.pop();d.some(I=>I.reducePos>l)&&this.recovering--}else if(d.length>1){e:for(let R=0;R<d.length-1;R++){let I=d[R];for(let z=R+1;z<d.length;z++){let se=d[z];if(I.sameState(se)||I.buffer.length>500&&se.buffer.length>500)if((I.score-se.score||I.buffer.length-se.buffer.length)>0)d.splice(z--,1);else{d.splice(R--,1);continue e}}}d.length>12&&d.splice(12,d.length-12)}this.minStackPos=d[0].pos;for(let R=1;R<d.length;R++)d[R].pos<this.minStackPos&&(this.minStackPos=d[R].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,l,d){let p=e.pos,{parser:b}=this,R=verbose?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&p>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let se=e.curContext&&e.curContext.tracker.strict,le=se?e.curContext.hash:0;for(let tn=this.fragments.nodeAt(p);tn;){let an=this.parser.nodeSet.types[tn.type.id]==tn.type?b.getGoto(e.state,tn.type.id):-1;if(an>-1&&tn.length&&(!se||(tn.prop(NodeProp.contextHash)||0)==le))return e.useNode(tn,an),verbose&&console.log(R+this.stackID(e)+` (via reuse of ${b.getName(tn.type.id)})`),!0;if(!(tn instanceof Tree)||tn.children.length==0||tn.positions[0]>0)break;let sn=tn.children[0];if(sn instanceof Tree&&tn.positions[0]==0)tn=sn;else break}}let I=b.stateSlot(e.state,4);if(I>0)return e.reduce(I),verbose&&console.log(R+this.stackID(e)+` (via always-reduce ${b.getName(I&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let z=this.tokens.getActions(e);for(let se=0;se<z.length;){let le=z[se++],tn=z[se++],an=z[se++],sn=se==z.length||!d,ln=sn?e:e.split(),un=this.tokens.mainToken;if(ln.apply(le,tn,un?un.start:ln.pos,an),verbose&&console.log(R+this.stackID(ln)+` (via ${le&65536?`reduce of ${b.getName(le&65535)}`:"shift"} for ${b.getName(tn)} @ ${p}${ln==e?"":", split"})`),sn)return!0;ln.pos>p?l.push(ln):d.push(ln)}return!1}advanceFully(e,l){let d=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>d)return pushStackDedup(e,l),!0}}runRecovery(e,l,d){let p=null,b=!1;for(let R=0;R<e.length;R++){let I=e[R],z=l[R<<1],se=l[(R<<1)+1],le=verbose?this.stackID(I)+" -> ":"";if(I.deadEnd&&(b||(b=!0,I.restart(),verbose&&console.log(le+this.stackID(I)+" (restarted)"),this.advanceFully(I,d))))continue;let tn=I.split(),an=le;for(let sn=0;tn.forceReduce()&&sn<10&&(verbose&&console.log(an+this.stackID(tn)+" (via force-reduce)"),!this.advanceFully(tn,d));sn++)verbose&&(an=this.stackID(tn)+" -> ");for(let sn of I.recoverByInsert(z))verbose&&console.log(le+this.stackID(sn)+" (via recover-insert)"),this.advanceFully(sn,d);this.stream.end>I.pos?(se==I.pos&&(se++,z=0),I.recoverByDelete(z,se),verbose&&console.log(le+this.stackID(I)+` (via recover-delete ${this.parser.getName(z)})`),pushStackDedup(I,d)):(!p||p.score<I.score)&&(p=I)}return p}stackToTree(e){return e.close(),Tree.build({buffer:StackBufferCursor.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let l=(stackIDs||(stackIDs=new WeakMap)).get(e);return l||stackIDs.set(e,l=String.fromCodePoint(this.nextStackID++)),l+e}}function pushStackDedup(o,e){for(let l=0;l<e.length;l++){let d=e[l];if(d.pos==o.pos&&d.sameState(o)){e[l].score<o.score&&(e[l]=o);return}}e.push(o)}class Dialect{constructor(e,l,d){this.source=e,this.flags=l,this.disabled=d}allows(e){return!this.disabled||this.disabled[e]==0}}const id=o=>o;class ContextTracker{constructor(e){this.start=e.start,this.shift=e.shift||id,this.reduce=e.reduce||id,this.reuse=e.reuse||id,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class LRParser extends Parser{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let l=e.nodeNames.split(" ");this.minRepeatTerm=l.length;for(let I=0;I<e.repeatNodeCount;I++)l.push("");let d=Object.keys(e.topRules).map(I=>e.topRules[I][1]),p=[];for(let I=0;I<l.length;I++)p.push([]);function b(I,z,se){p[I].push([z,z.deserialize(String(se))])}if(e.nodeProps)for(let I of e.nodeProps){let z=I[0];typeof z=="string"&&(z=NodeProp[z]);for(let se=1;se<I.length;){let le=I[se++];if(le>=0)b(le,z,I[se++]);else{let tn=I[se+-le];for(let an=-le;an>0;an--)b(I[se++],z,tn);se++}}}this.nodeSet=new NodeSet(l.map((I,z)=>NodeType.define({name:z>=this.minRepeatTerm?void 0:I,id:z,props:p[z],top:d.indexOf(z)>-1,error:z==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(z)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=DefaultBufferLength;let R=decodeArray(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let I=0;I<this.specializerSpecs.length;I++)this.specialized[I]=this.specializerSpecs[I].term;this.specializers=this.specializerSpecs.map(getSpecializer),this.states=decodeArray(e.states,Uint32Array),this.data=decodeArray(e.stateData),this.goto=decodeArray(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(I=>typeof I=="number"?new TokenGroup(R,I):I),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,l,d){let p=new Parse(this,e,l,d);for(let b of this.wrappers)p=b(p,e,l,d);return p}getGoto(e,l,d=!1){let p=this.goto;if(l>=p[0])return-1;for(let b=p[l+1];;){let R=p[b++],I=R&1,z=p[b++];if(I&&d)return z;for(let se=b+(R>>1);b<se;b++)if(p[b]==e)return z;if(I)return-1}}hasAction(e,l){let d=this.data;for(let p=0;p<2;p++)for(let b=this.stateSlot(e,p?2:1),R;;b+=3){if((R=d[b])==65535)if(d[b+1]==1)R=d[b=pair(d,b+2)];else{if(d[b+1]==2)return pair(d,b+2);break}if(R==l||R==0)return pair(d,b+1)}return 0}stateSlot(e,l){return this.states[e*6+l]}stateFlag(e,l){return(this.stateSlot(e,0)&l)>0}validAction(e,l){return!!this.allActions(e,d=>d==l?!0:null)}allActions(e,l){let d=this.stateSlot(e,4),p=d?l(d):void 0;for(let b=this.stateSlot(e,1);p==null;b+=3){if(this.data[b]==65535)if(this.data[b+1]==1)b=pair(this.data,b+2);else break;p=l(pair(this.data,b+1))}return p}nextStates(e){let l=[];for(let d=this.stateSlot(e,1);;d+=3){if(this.data[d]==65535)if(this.data[d+1]==1)d=pair(this.data,d+2);else break;if(!(this.data[d+2]&1)){let p=this.data[d+1];l.some((b,R)=>R&1&&b==p)||l.push(this.data[d],p)}}return l}configure(e){let l=Object.assign(Object.create(LRParser.prototype),this);if(e.props&&(l.nodeSet=this.nodeSet.extend(...e.props)),e.top){let d=this.topRules[e.top];if(!d)throw new RangeError(`Invalid top rule name ${e.top}`);l.top=d}return e.tokenizers&&(l.tokenizers=this.tokenizers.map(d=>{let p=e.tokenizers.find(b=>b.from==d);return p?p.to:d})),e.specializers&&(l.specializers=this.specializers.slice(),l.specializerSpecs=this.specializerSpecs.map((d,p)=>{let b=e.specializers.find(I=>I.from==d.external);if(!b)return d;let R=Object.assign(Object.assign({},d),{external:b.to});return l.specializers[p]=getSpecializer(R),R})),e.contextTracker&&(l.context=e.contextTracker),e.dialect&&(l.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(l.strict=e.strict),e.wrap&&(l.wrappers=l.wrappers.concat(e.wrap)),e.bufferLength!=null&&(l.bufferLength=e.bufferLength),l}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let l=this.dynamicPrecedences;return l==null?0:l[e]||0}parseDialect(e){let l=Object.keys(this.dialects),d=l.map(()=>!1);if(e)for(let b of e.split(" ")){let R=l.indexOf(b);R>=0&&(d[R]=!0)}let p=null;for(let b=0;b<l.length;b++)if(!d[b])for(let R=this.dialects[l[b]],I;(I=this.data[R++])!=65535;)(p||(p=new Uint8Array(this.maxTerm+1)))[I]=1;return new Dialect(e,d,p)}static deserialize(e){return new LRParser(e)}}function pair(o,e){return o[e]|o[e+1]<<16}function findFinished(o){let e=null;for(let l of o){let d=l.p.stoppedAt;(l.pos==l.p.stream.end||d!=null&&l.pos>d)&&l.p.parser.stateFlag(l.state,2)&&(!e||e.score<l.score)&&(e=l)}return e}function getSpecializer(o){if(o.external){let e=o.extend?1:0;return(l,d)=>o.external(l,d)<<1|e}return o.get}const noSemi=314,noSemiType=315,incdec=1,incdecPrefix=2,questionDot=3,JSXStartTag=4,insertSemi=316,spaces=318,newline=319,LineComment=5,BlockComment=6,Dialect_jsx=0,space=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],braceR=125,semicolon=59,slash=47,star=42,plus=43,minus=45,lt$1=60,comma=44,question=63,dot=46,bracketL=91,trackNewline=new ContextTracker({start:!1,shift(o,e){return e==LineComment||e==BlockComment||e==spaces?o:e==newline},strict:!1}),insertSemicolon=new ExternalTokenizer((o,e)=>{let{next:l}=o;(l==braceR||l==-1||e.context)&&o.acceptToken(insertSemi)},{contextual:!0,fallback:!0}),noSemicolon=new ExternalTokenizer((o,e)=>{let{next:l}=o,d;space.indexOf(l)>-1||l==slash&&((d=o.peek(1))==slash||d==star)||l!=braceR&&l!=semicolon&&l!=-1&&!e.context&&o.acceptToken(noSemi)},{contextual:!0}),noSemicolonType=new ExternalTokenizer((o,e)=>{o.next==bracketL&&!e.context&&o.acceptToken(noSemiType)},{contextual:!0}),operatorToken=new ExternalTokenizer((o,e)=>{let{next:l}=o;if(l==plus||l==minus){if(o.advance(),l==o.next){o.advance();let d=!e.context&&e.canShift(incdec);o.acceptToken(d?incdec:incdecPrefix)}}else l==question&&o.peek(1)==dot&&(o.advance(),o.advance(),(o.next<48||o.next>57)&&o.acceptToken(questionDot))},{contextual:!0});function identifierChar(o,e){return o>=65&&o<=90||o>=97&&o<=122||o==95||o>=192||!e&&o>=48&&o<=57}const jsx=new ExternalTokenizer((o,e)=>{if(o.next!=lt$1||!e.dialectEnabled(Dialect_jsx)||(o.advance(),o.next==slash))return;let l=0;for(;space.indexOf(o.next)>-1;)o.advance(),l++;if(identifierChar(o.next,!0)){for(o.advance(),l++;identifierChar(o.next,!1);)o.advance(),l++;for(;space.indexOf(o.next)>-1;)o.advance(),l++;if(o.next==comma)return;for(let d=0;;d++){if(d==7){if(!identifierChar(o.next,!0))return;break}if(o.next!="extends".charCodeAt(d))break;o.advance(),l++}}o.acceptToken(JSXStartTag,-l)}),jsHighlight=styleTags({"get set async static":tags.modifier,"for while do if else switch try catch finally return throw break continue default case":tags.controlKeyword,"in of await yield void typeof delete instanceof":tags.operatorKeyword,"let var const using function class extends":tags.definitionKeyword,"import export from":tags.moduleKeyword,"with debugger as new":tags.keyword,TemplateString:tags.special(tags.string),super:tags.atom,BooleanLiteral:tags.bool,this:tags.self,null:tags.null,Star:tags.modifier,VariableName:tags.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":tags.function(tags.variableName),VariableDefinition:tags.definition(tags.variableName),Label:tags.labelName,PropertyName:tags.propertyName,PrivatePropertyName:tags.special(tags.propertyName),"CallExpression/MemberExpression/PropertyName":tags.function(tags.propertyName),"FunctionDeclaration/VariableDefinition":tags.function(tags.definition(tags.variableName)),"ClassDeclaration/VariableDefinition":tags.definition(tags.className),"NewExpression/VariableName":tags.className,PropertyDefinition:tags.definition(tags.propertyName),PrivatePropertyDefinition:tags.definition(tags.special(tags.propertyName)),UpdateOp:tags.updateOperator,"LineComment Hashbang":tags.lineComment,BlockComment:tags.blockComment,Number:tags.number,String:tags.string,Escape:tags.escape,ArithOp:tags.arithmeticOperator,LogicOp:tags.logicOperator,BitOp:tags.bitwiseOperator,CompareOp:tags.compareOperator,RegExp:tags.regexp,Equals:tags.definitionOperator,Arrow:tags.function(tags.punctuation),": Spread":tags.punctuation,"( )":tags.paren,"[ ]":tags.squareBracket,"{ }":tags.brace,"InterpolationStart InterpolationEnd":tags.special(tags.brace),".":tags.derefOperator,", ;":tags.separator,"@":tags.meta,TypeName:tags.typeName,TypeDefinition:tags.definition(tags.typeName),"type enum interface implements namespace module declare":tags.definitionKeyword,"abstract global Privacy readonly override":tags.modifier,"is keyof unique infer asserts":tags.operatorKeyword,JSXAttributeValue:tags.attributeValue,JSXText:tags.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":tags.angleBracket,"JSXIdentifier JSXNameSpacedName":tags.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":tags.attributeName,"JSXBuiltin/JSXIdentifier":tags.standard(tags.tagName)}),spec_identifier={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,const:52,extends:56,this:60,true:68,false:68,null:80,void:84,typeof:88,super:104,new:138,delete:150,yield:159,await:163,class:168,public:231,private:231,protected:231,readonly:233,instanceof:252,satisfies:255,in:256,import:290,keyof:347,unique:351,infer:357,asserts:393,is:395,abstract:415,implements:417,type:419,let:422,var:424,using:427,interface:433,enum:437,namespace:443,module:445,declare:449,global:453,for:472,of:481,while:484,with:488,do:492,if:496,else:498,switch:502,case:508,try:514,catch:518,finally:522,return:526,throw:530,break:534,continue:538,debugger:542},spec_word={__proto__:null,async:125,get:127,set:129,declare:191,public:193,private:193,protected:193,static:195,abstract:197,override:199,readonly:205,accessor:207,new:399},spec_LessThan={__proto__:null,"<":189},parser=LRParser.deserialize({version:14,states:"$EOQ%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#D_O.QQlO'#DeO.bQlO'#DpO%[QlO'#DxO0fQlO'#EQOOQ!0Lf'#EY'#EYO1PQ`O'#EVOOQO'#En'#EnOOQO'#Ij'#IjO1XQ`O'#GrO1dQ`O'#EmO1iQ`O'#EmO3hQ!0MxO'#JpO6[Q!0MxO'#JqO6uQ`O'#F[O6zQ,UO'#FsOOQ!0Lf'#Fe'#FeO7VO7dO'#FeO7eQMhO'#F{O9UQ`O'#FzOOQ!0Lf'#Jq'#JqOOQ!0Lb'#Jp'#JpO9ZQ`O'#GvOOQ['#K]'#K]O9fQ`O'#IWO9kQ!0LrO'#IXOOQ['#J^'#J^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< TypeParamList const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:378,context:trackNewline,nodeProps:[["isolate",-8,5,6,14,35,37,49,51,53,""],["group",-26,9,17,19,66,206,210,214,215,217,220,223,233,235,241,243,245,247,250,256,262,264,266,268,270,272,273,"Statement",-34,13,14,30,33,34,40,49,52,53,55,60,68,70,74,78,80,82,83,108,109,118,119,135,138,140,141,142,143,144,146,147,166,168,170,"Expression",-23,29,31,35,39,41,43,172,174,176,177,179,180,181,183,184,185,187,188,189,200,202,204,205,"Type",-3,86,101,107,"ClassItem"],["openedBy",23,"<",36,"InterpolationStart",54,"[",58,"{",71,"(",159,"JSXStartCloseTag"],["closedBy",-2,24,167,">",38,"InterpolationEnd",48,"]",59,"}",72,")",164,"JSXEndTag"]],propSources:[jsHighlight],skippedNodes:[0,5,6,276],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU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z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[noSemicolon,noSemicolonType,operatorToken,jsx,2,3,4,5,6,7,8,9,10,11,12,13,14,insertSemicolon,new LocalTokenGroup("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOv~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!S~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(a~~",141,338),new LocalTokenGroup("j~RQYZXz{^~^O(O~~aP!P!Qd~iO(P~~",25,321)],topRules:{Script:[0,7],SingleExpression:[1,274],SingleClassItem:[2,275]},dialects:{jsx:0,ts:15091},dynamicPrecedences:{78:1,80:1,92:1,168:1,198:1},specialized:[{term:325,get:o=>spec_identifier[o]||-1},{term:341,get:o=>spec_word[o]||-1},{term:93,get:o=>spec_LessThan[o]||-1}],tokenPrec:15116}),snippets=[snippetCompletion("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),snippetCompletion("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),snippetCompletion("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),snippetCompletion("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),snippetCompletion("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),snippetCompletion(`try {
|
||
\${}
|
||
} catch (\${error}) {
|
||
\${}
|
||
}`,{label:"try",detail:"/ catch block",type:"keyword"}),snippetCompletion("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),snippetCompletion(`if (\${}) {
|
||
\${}
|
||
} else {
|
||
\${}
|
||
}`,{label:"if",detail:"/ else block",type:"keyword"}),snippetCompletion(`class \${name} {
|
||
constructor(\${params}) {
|
||
\${}
|
||
}
|
||
}`,{label:"class",detail:"definition",type:"keyword"}),snippetCompletion('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),snippetCompletion('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],typescriptSnippets=snippets.concat([snippetCompletion("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),snippetCompletion("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),snippetCompletion("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),cache$6=new NodeWeakMap,ScopeNodes=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function defID(o){return(e,l)=>{let d=e.node.getChild("VariableDefinition");return d&&l(d,o),!0}}const functionContext=["FunctionDeclaration"],gatherCompletions={FunctionDeclaration:defID("function"),ClassDeclaration:defID("class"),ClassExpression:()=>!0,EnumDeclaration:defID("constant"),TypeAliasDeclaration:defID("type"),NamespaceDeclaration:defID("namespace"),VariableDefinition(o,e){o.matchContext(functionContext)||e(o,"variable")},TypeDefinition(o,e){e(o,"type")},__proto__:null};function getScope(o,e){let l=cache$6.get(e);if(l)return l;let d=[],p=!0;function b(R,I){let z=o.sliceString(R.from,R.to);d.push({label:z,type:I})}return e.cursor(IterMode.IncludeAnonymous).iterate(R=>{if(p)p=!1;else if(R.name){let I=gatherCompletions[R.name];if(I&&I(R,b)||ScopeNodes.has(R.name))return!1}else if(R.to-R.from>8192){for(let I of getScope(o,R.node))d.push(I);return!1}}),cache$6.set(e,d),d}const Identifier=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,dontComplete=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function localCompletionSource(o){let e=syntaxTree(o.state).resolveInner(o.pos,-1);if(dontComplete.indexOf(e.name)>-1)return null;let l=e.name=="VariableName"||e.to-e.from<20&&Identifier.test(o.state.sliceDoc(e.from,e.to));if(!l&&!o.explicit)return null;let d=[];for(let p=e;p;p=p.parent)ScopeNodes.has(p.name)&&(d=d.concat(getScope(o.state.doc,p)));return{options:d,from:l?e.from:o.pos,validFor:Identifier}}const javascriptLanguage=LRLanguage.define({name:"javascript",parser:parser.configure({props:[indentNodeProp.add({IfStatement:continuedIndent({except:/^\s*({|else\b)/}),TryStatement:continuedIndent({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:flatIndent,SwitchBody:o=>{let e=o.textAfter,l=/^\s*\}/.test(e),d=/^\s*(case|default)\b/.test(e);return o.baseIndent+(l?0:d?1:2)*o.unit},Block:delimitedIndent({closing:"}"}),ArrowFunction:o=>o.baseIndent+o.unit,"TemplateString BlockComment":()=>null,"Statement Property":continuedIndent({except:/^{/}),JSXElement(o){let e=/^\s*<\//.test(o.textAfter);return o.lineIndent(o.node.from)+(e?0:o.unit)},JSXEscape(o){let e=/\s*\}/.test(o.textAfter);return o.lineIndent(o.node.from)+(e?0:o.unit)},"JSXOpenTag JSXSelfClosingTag"(o){return o.column(o.node.from)+o.unit}}),foldNodeProp.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":foldInside,BlockComment(o){return{from:o.from+2,to:o.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),jsxSublanguage={test:o=>/^JSX/.test(o.name),facet:defineLanguageFacet({commentTokens:{block:{open:"{/*",close:"*/}"}}})},typescriptLanguage=javascriptLanguage.configure({dialect:"ts"},"typescript"),jsxLanguage=javascriptLanguage.configure({dialect:"jsx",props:[sublanguageProp.add(o=>o.isTop?[jsxSublanguage]:void 0)]}),tsxLanguage=javascriptLanguage.configure({dialect:"jsx ts",props:[sublanguageProp.add(o=>o.isTop?[jsxSublanguage]:void 0)]},"typescript");let kwCompletion=o=>({label:o,type:"keyword"});const keywords="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(kwCompletion),typescriptKeywords=keywords.concat(["declare","implements","private","protected","public"].map(kwCompletion));function javascript(o={}){let e=o.jsx?o.typescript?tsxLanguage:jsxLanguage:o.typescript?typescriptLanguage:javascriptLanguage,l=o.typescript?typescriptSnippets.concat(typescriptKeywords):snippets.concat(keywords);return new LanguageSupport(e,[javascriptLanguage.data.of({autocomplete:ifNotIn(dontComplete,completeFromList(l))}),javascriptLanguage.data.of({autocomplete:localCompletionSource}),o.jsx?autoCloseTags:[]])}function findOpenTag(o){for(;;){if(o.name=="JSXOpenTag"||o.name=="JSXSelfClosingTag"||o.name=="JSXFragmentTag")return o;if(o.name=="JSXEscape"||!o.parent)return null;o=o.parent}}function elementName(o,e,l=o.length){for(let d=e?.firstChild;d;d=d.nextSibling)if(d.name=="JSXIdentifier"||d.name=="JSXBuiltin"||d.name=="JSXNamespacedName"||d.name=="JSXMemberExpression")return o.sliceString(d.from,Math.min(d.to,l));return""}const android=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),autoCloseTags=EditorView.inputHandler.of((o,e,l,d,p)=>{if((android?o.composing:o.compositionStarted)||o.state.readOnly||e!=l||d!=">"&&d!="/"||!javascriptLanguage.isActiveAt(o.state,e,-1))return!1;let b=p(),{state:R}=b,I=R.changeByRange(z=>{var se;let{head:le}=z,tn=syntaxTree(R).resolveInner(le-1,-1),an;if(tn.name=="JSXStartTag"&&(tn=tn.parent),!(R.doc.sliceString(le-1,le)!=d||tn.name=="JSXAttributeValue"&&tn.to>le)){if(d==">"&&tn.name=="JSXFragmentTag")return{range:z,changes:{from:le,insert:"</>"}};if(d=="/"&&tn.name=="JSXStartCloseTag"){let sn=tn.parent,ln=sn.parent;if(ln&&sn.from==le-2&&((an=elementName(R.doc,ln.firstChild,le))||((se=ln.firstChild)===null||se===void 0?void 0:se.name)=="JSXFragmentTag")){let un=`${an}>`;return{range:EditorSelection.cursor(le+un.length,-1),changes:{from:le,insert:un}}}}else if(d==">"){let sn=findOpenTag(tn);if(sn&&sn.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(R.doc.sliceString(le,le+2))&&(an=elementName(R.doc,sn,le)))return{range:z,changes:{from:le,insert:`</${an}>`}}}}return{range:z}});return I.changes.empty?!1:(o.dispatch([b,R.update(I,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});let identity=o=>o,storageEngine={},eventsEngine={addEventListener(){},removeEventListener(){}};function testSupport(){try{return typeof localStorage<"u"}catch{return!1}}testSupport()&&(storageEngine=localStorage);let windowPersistentEvents={addEventListener(o,e,l){window.addEventListener("storage",e),window.addEventListener("pageshow",l)},removeEventListener(o,e,l){window.removeEventListener("storage",e),window.removeEventListener("pageshow",l)}};typeof window<"u"&&(eventsEngine=windowPersistentEvents);function persistentAtom(o,e=void 0,l={}){let d=l.encode||identity,p=l.decode||identity,b=atom(e),R=b.set;b.set=se=>{typeof se>"u"?delete storageEngine[o]:storageEngine[o]=d(se),R(se)};function I(se){se.key===o?se.newValue===null?R(void 0):R(p(se.newValue)):storageEngine[o]||R(void 0)}function z(){b.set(storageEngine[o]?p(storageEngine[o]):e)}return onMount(b,()=>{if(z(),l.listen!==!1)return eventsEngine.addEventListener(o,I,z),()=>{eventsEngine.removeEventListener(o,I,z)}}),b}const docs=JSON.parse(`[{"comment":"/**\\n * Overrides the css of highlighted events. Make sure to use single quotes!\\n * @name markcss\\n * @tag visualization\\n * @example\\n * note(\\"c a f e\\")\\n * .markcss('text-decoration:underline')\\n */","meta":{"filename":"codemirror.mjs","lineno":495,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror","code":{}},"description":"<p>Overrides the css of highlighted events. Make sure to use single quotes!</p>","name":"markcss","tags":[{"originalTitle":"tag","title":"tag","text":"visualization","value":"visualization"}],"examples":["note(\\"c a f e\\")\\n.markcss('text-decoration:underline')"],"longname":"markcss","kind":"member","scope":"global"},{"comment":"/**\\n * Displays a slider widget to allow the user manipulate a value\\n *\\n * @name slider\\n * @tags external_io, visualization\\n * @param {number} value Initial value\\n * @param {number} min Minimum value - optional, defaults to 0\\n * @param {number} max Maximum value - optional, defaults to 1\\n * @param {number} step Step size - optional\\n */","meta":{"filename":"slider.mjs","lineno":204,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror","code":{}},"description":"<p>Displays a slider widget to allow the user manipulate a value</p>","name":"slider","tags":["external_io","visualization"],"params":[{"type":{"names":["number"]},"description":"<p>Initial value</p>","name":"value"},{"type":{"names":["number"]},"description":"<p>Minimum value - optional, defaults to 0</p>","name":"min"},{"type":{"names":["number"]},"description":"<p>Maximum value - optional, defaults to 1</p>","name":"max"},{"type":{"names":["number"]},"description":"<p>Step size - optional</p>","name":"step"}],"longname":"slider","kind":"member","scope":"global"},{"comment":"/**\\n * Select a sound / sample by name. When using mininotation, you can also optionally supply 'n' and 'gain' parameters\\n * separated by ':'.\\n *\\n * @name s\\n * @tags superdough, samples\\n * @param {string | Pattern} sound The sound / pattern of sounds to pick\\n * @synonyms sound\\n * @example\\n * s(\\"bd hh\\")\\n * @example\\n * s(\\"bd:0 bd:1 bd:0:0.3 bd:1:1.4\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":97,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Select a sound / sample by name. When using mininotation, you can also optionally supply 'n' and 'gain' parameters\\nseparated by ':'.</p>","name":"s","tags":["superdough","samples"],"params":[{"type":{"names":["string","Pattern"]},"description":"<p>The sound / pattern of sounds to pick</p>","name":"sound"}],"synonyms_text":"sound","synonyms":["sound"],"examples":["s(\\"bd hh\\")","s(\\"bd:0 bd:1 bd:0:0.3 bd:1:1.4\\")"],"longname":"s","kind":"member","scope":"global"},{"comment":"/**\\n * Position in the wavetable of the wavetable oscillator\\n *\\n * @name wt\\n * @tags wavetable, superdough\\n * @param {number | Pattern} position Position in the wavetable from 0 to 1\\n * @synonyms wavetablePosition\\n * @example\\n * s(\\"squelch\\").bank(\\"wt_digital\\").seg(8).note(\\"F1\\").wt(\\"0 0.25 0.5 0.75 1\\")\\n */","meta":{"filename":"controls.mjs","lineno":113,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Position in the wavetable of the wavetable oscillator</p>","name":"wt","tags":["wavetable","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>Position in the wavetable from 0 to 1</p>","name":"position"}],"synonyms_text":"wavetablePosition","synonyms":["wavetablePosition"],"examples":["s(\\"squelch\\").bank(\\"wt_digital\\").seg(8).note(\\"F1\\").wt(\\"0 0.25 0.5 0.75 1\\")"],"longname":"wt","kind":"member","scope":"global"},{"comment":"/**\\n * Amount of envelope applied wavetable oscillator's position envelope\\n *\\n * @name wtenv\\n * @tags wavetable, envelope, superdough\\n * @param {number | Pattern} amount between 0 and 1\\n */","meta":{"filename":"controls.mjs","lineno":125,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Amount of envelope applied wavetable oscillator's position envelope</p>","name":"wtenv","tags":["wavetable","envelope","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>between 0 and 1</p>","name":"amount"}],"longname":"wtenv","kind":"member","scope":"global"},{"comment":"/**\\n * Attack time of the wavetable oscillator's position envelope\\n *\\n * @name wtattack\\n * @tags wavetable, envelope, superdough\\n * @synonyms wtatt\\n * @param {number | Pattern} time attack time in seconds\\n */","meta":{"filename":"controls.mjs","lineno":133,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Attack time of the wavetable oscillator's position envelope</p>","name":"wtattack","tags":["wavetable","envelope","superdough"],"synonyms_text":"wtatt","synonyms":["wtatt"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>attack time in seconds</p>","name":"time"}],"longname":"wtattack","kind":"member","scope":"global"},{"comment":"/**\\n * Decay time of the wavetable oscillator's position envelope\\n *\\n * @name wtdecay\\n * @tags wavetable, envelope, superdough\\n * @synonyms wtdec\\n * @param {number | Pattern} time decay time in seconds\\n */","meta":{"filename":"controls.mjs","lineno":143,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Decay time of the wavetable oscillator's position envelope</p>","name":"wtdecay","tags":["wavetable","envelope","superdough"],"synonyms_text":"wtdec","synonyms":["wtdec"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>decay time in seconds</p>","name":"time"}],"longname":"wtdecay","kind":"member","scope":"global"},{"comment":"/**\\n * Sustain time of the wavetable oscillator's position envelope\\n *\\n * @name wtsustain\\n * @tags wavetable, envelope, superdough\\n * @synonyms wtsus\\n * @param {number | Pattern} gain sustain level (0 to 1)\\n */","meta":{"filename":"controls.mjs","lineno":153,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sustain time of the wavetable oscillator's position envelope</p>","name":"wtsustain","tags":["wavetable","envelope","superdough"],"synonyms_text":"wtsus","synonyms":["wtsus"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>sustain level (0 to 1)</p>","name":"gain"}],"longname":"wtsustain","kind":"member","scope":"global"},{"comment":"/**\\n * Release time of the wavetable oscillator's position envelope\\n *\\n * @name wtrelease\\n * @tags wavetable, envelope, superdough\\n * @synonyms wtrel\\n * @param {number | Pattern} time release time in seconds\\n */","meta":{"filename":"controls.mjs","lineno":163,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Release time of the wavetable oscillator's position envelope</p>","name":"wtrelease","tags":["wavetable","envelope","superdough"],"synonyms_text":"wtrel","synonyms":["wtrel"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>release time in seconds</p>","name":"time"}],"longname":"wtrelease","kind":"member","scope":"global"},{"comment":"/**\\n * Rate of the LFO for the wavetable oscillator's position\\n *\\n * @name wtrate\\n * @tags wavetable, lfo, superdough\\n * @param {number | Pattern} rate rate in hertz\\n */","meta":{"filename":"controls.mjs","lineno":173,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Rate of the LFO for the wavetable oscillator's position</p>","name":"wtrate","tags":["wavetable","lfo","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>rate in hertz</p>","name":"rate"}],"longname":"wtrate","kind":"member","scope":"global"},{"comment":"/**\\n * cycle synced rate of the LFO for the wavetable oscillator's position\\n *\\n * @name wtsync\\n * @tags wavetable, lfo, superdough\\n * @param {number | Pattern} rate rate in cycles\\n */","meta":{"filename":"controls.mjs","lineno":181,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>cycle synced rate of the LFO for the wavetable oscillator's position</p>","name":"wtsync","tags":["wavetable","lfo","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>rate in cycles</p>","name":"rate"}],"longname":"wtsync","kind":"member","scope":"global"},{"comment":"/**\\n * Depth of the LFO for the wavetable oscillator's position\\n *\\n * @name wtdepth\\n * @tags wavetable, lfo, superdough\\n * @param {number | Pattern} depth depth of modulation\\n */","meta":{"filename":"controls.mjs","lineno":190,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Depth of the LFO for the wavetable oscillator's position</p>","name":"wtdepth","tags":["wavetable","lfo","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>depth of modulation</p>","name":"depth"}],"longname":"wtdepth","kind":"member","scope":"global"},{"comment":"/**\\n * Shape of the LFO for the wavetable oscillator's position\\n *\\n * @name wtshape\\n * @tags wavetable, lfo, superdough\\n * @param {number | Pattern} shape Shape of the lfo (0, 1, 2, ..)\\n */","meta":{"filename":"controls.mjs","lineno":199,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Shape of the LFO for the wavetable oscillator's position</p>","name":"wtshape","tags":["wavetable","lfo","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>Shape of the lfo (0, 1, 2, ..)</p>","name":"shape"}],"longname":"wtshape","kind":"member","scope":"global"},{"comment":"/**\\n * DC offset of the LFO for the wavetable oscillator's position\\n *\\n * @name wtdc\\n * @tags wavetable, lfo, superdough\\n * @param {number | Pattern} dcoffset dc offset. set to 0 for unipolar\\n */","meta":{"filename":"controls.mjs","lineno":208,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>DC offset of the LFO for the wavetable oscillator's position</p>","name":"wtdc","tags":["wavetable","lfo","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>dc offset. set to 0 for unipolar</p>","name":"dcoffset"}],"longname":"wtdc","kind":"member","scope":"global"},{"comment":"/**\\n * Skew of the LFO for the wavetable oscillator's position\\n *\\n * @name wtskew\\n * @tags wavetable, lfo, superdough\\n * @param {number | Pattern} skew How much to bend the LFO shape\\n */","meta":{"filename":"controls.mjs","lineno":217,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Skew of the LFO for the wavetable oscillator's position</p>","name":"wtskew","tags":["wavetable","lfo","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>How much to bend the LFO shape</p>","name":"skew"}],"longname":"wtskew","kind":"member","scope":"global"},{"comment":"/**\\n * Amount of warp (alteration of the waveform) to apply to the wavetable oscillator\\n *\\n * @name warp\\n * @tags wavetable, superdough\\n * @param {number | Pattern} amount Warp of the wavetable from 0 to 1\\n * @synonyms wavetableWarp\\n * @example\\n * s(\\"basique\\").bank(\\"wt_digital\\").seg(8).note(\\"F1\\").warp(\\"0 0.25 0.5 0.75 1\\")\\n * .warpmode(\\"spin\\")\\n */","meta":{"filename":"controls.mjs","lineno":226,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Amount of warp (alteration of the waveform) to apply to the wavetable oscillator</p>","name":"warp","tags":["wavetable","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>Warp of the wavetable from 0 to 1</p>","name":"amount"}],"synonyms_text":"wavetableWarp","synonyms":["wavetableWarp"],"examples":["s(\\"basique\\").bank(\\"wt_digital\\").seg(8).note(\\"F1\\").warp(\\"0 0.25 0.5 0.75 1\\")\\n .warpmode(\\"spin\\")"],"longname":"warp","kind":"member","scope":"global"},{"comment":"/**\\n * Attack time of the wavetable oscillator's warp envelope\\n *\\n * @name warpattack\\n * @tags wavetable, envelope, superdough\\n * @synonyms warpatt\\n * @param {number | Pattern} time attack time in seconds\\n */","meta":{"filename":"controls.mjs","lineno":239,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Attack time of the wavetable oscillator's warp envelope</p>","name":"warpattack","tags":["wavetable","envelope","superdough"],"synonyms_text":"warpatt","synonyms":["warpatt"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>attack time in seconds</p>","name":"time"}],"longname":"warpattack","kind":"member","scope":"global"},{"comment":"/**\\n * Decay time of the wavetable oscillator's warp envelope\\n *\\n * @name warpdecay\\n * @tags wavetable, envelope, superdough\\n * @synonyms warpdec\\n * @param {number | Pattern} time decay time in seconds\\n */","meta":{"filename":"controls.mjs","lineno":249,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Decay time of the wavetable oscillator's warp envelope</p>","name":"warpdecay","tags":["wavetable","envelope","superdough"],"synonyms_text":"warpdec","synonyms":["warpdec"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>decay time in seconds</p>","name":"time"}],"longname":"warpdecay","kind":"member","scope":"global"},{"comment":"/**\\n * Sustain time of the wavetable oscillator's warp envelope\\n *\\n * @name warpsustain\\n * @tags wavetable, envelope, superdough\\n * @synonyms warpsus\\n * @param {number | Pattern} gain sustain level (0 to 1)\\n */","meta":{"filename":"controls.mjs","lineno":259,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sustain time of the wavetable oscillator's warp envelope</p>","name":"warpsustain","tags":["wavetable","envelope","superdough"],"synonyms_text":"warpsus","synonyms":["warpsus"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>sustain level (0 to 1)</p>","name":"gain"}],"longname":"warpsustain","kind":"member","scope":"global"},{"comment":"/**\\n * Release time of the wavetable oscillator's warp envelope\\n *\\n * @name warprelease\\n * @tags wavetable, envelope, superdough\\n * @synonyms warprel\\n * @param {number | Pattern} time release time in seconds\\n */","meta":{"filename":"controls.mjs","lineno":269,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Release time of the wavetable oscillator's warp envelope</p>","name":"warprelease","tags":["wavetable","envelope","superdough"],"synonyms_text":"warprel","synonyms":["warprel"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>release time in seconds</p>","name":"time"}],"longname":"warprelease","kind":"member","scope":"global"},{"comment":"/**\\n * Rate of the LFO for the wavetable oscillator's warp\\n *\\n * @name warprate\\n * @tags wavetable, lfo, superdough\\n * @param {number | Pattern} rate rate in hertz\\n */","meta":{"filename":"controls.mjs","lineno":279,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Rate of the LFO for the wavetable oscillator's warp</p>","name":"warprate","tags":["wavetable","lfo","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>rate in hertz</p>","name":"rate"}],"longname":"warprate","kind":"member","scope":"global"},{"comment":"/**\\n * Depth of the LFO for the wavetable oscillator's warp\\n *\\n * @name warpdepth\\n * @tags wavetable, lfo, superdough\\n * @param {number | Pattern} depth depth of modulation\\n */","meta":{"filename":"controls.mjs","lineno":288,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Depth of the LFO for the wavetable oscillator's warp</p>","name":"warpdepth","tags":["wavetable","lfo","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>depth of modulation</p>","name":"depth"}],"longname":"warpdepth","kind":"member","scope":"global"},{"comment":"/**\\n * Shape of the LFO for the wavetable oscillator's warp\\n *\\n * @name warpshape\\n * @tags wavetable, lfo, superdough\\n * @param {number | Pattern} shape Shape of the lfo (0, 1, 2, ..)\\n */","meta":{"filename":"controls.mjs","lineno":297,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Shape of the LFO for the wavetable oscillator's warp</p>","name":"warpshape","tags":["wavetable","lfo","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>Shape of the lfo (0, 1, 2, ..)</p>","name":"shape"}],"longname":"warpshape","kind":"member","scope":"global"},{"comment":"/**\\n * DC offset of the LFO for the wavetable oscillator's warp\\n *\\n * @name warpdc\\n * @tags wavetable, lfo, superdough\\n * @param {number | Pattern} dcoffset dc offset. set to 0 for unipolar\\n */","meta":{"filename":"controls.mjs","lineno":306,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>DC offset of the LFO for the wavetable oscillator's warp</p>","name":"warpdc","tags":["wavetable","lfo","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>dc offset. set to 0 for unipolar</p>","name":"dcoffset"}],"longname":"warpdc","kind":"member","scope":"global"},{"comment":"/**\\n * Skew of the LFO for the wavetable oscillator's warp\\n *\\n * @name warpskew\\n * @tags wavetable, lfo, superdough\\n * @param {number | Pattern} skew How much to bend the LFO shape\\n */","meta":{"filename":"controls.mjs","lineno":315,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Skew of the LFO for the wavetable oscillator's warp</p>","name":"warpskew","tags":["wavetable","lfo","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>How much to bend the LFO shape</p>","name":"skew"}],"longname":"warpskew","kind":"member","scope":"global"},{"comment":"/**\\n * Type of warp (alteration of the waveform) to apply to the wavetable oscillator.\\n *\\n * The current options are: none, asym, bendp, bendm, bendmp, sync, quant, fold, pwm, orbit,\\n * spin, chaos, primes, binary, brownian, reciprocal, wormhole, logistic, sigmoid, fractal, flip\\n *\\n * @name warpmode\\n * @tags wavetable, superdough\\n * @param {number | string | Pattern} mode Warp mode\\n * @synonyms wavetableWarpMode\\n * @example\\n * s(\\"morgana\\").bank(\\"wt_digital\\").seg(8).note(\\"F1\\").warp(\\"0 0.25 0.5 0.75 1\\")\\n * .warpmode(\\"<asym bendp spin logistic sync wormhole brownian>*2\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":324,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Type of warp (alteration of the waveform) to apply to the wavetable oscillator.</p>\\n<p>The current options are: none, asym, bendp, bendm, bendmp, sync, quant, fold, pwm, orbit,\\nspin, chaos, primes, binary, brownian, reciprocal, wormhole, logistic, sigmoid, fractal, flip</p>","name":"warpmode","tags":["wavetable","superdough"],"params":[{"type":{"names":["number","string","Pattern"]},"description":"<p>Warp mode</p>","name":"mode"}],"synonyms_text":"wavetableWarpMode","synonyms":["wavetableWarpMode"],"examples":["s(\\"morgana\\").bank(\\"wt_digital\\").seg(8).note(\\"F1\\").warp(\\"0 0.25 0.5 0.75 1\\")\\n .warpmode(\\"<asym bendp spin logistic sync wormhole brownian>*2\\")"],"longname":"warpmode","kind":"member","scope":"global"},{"comment":"/**\\n * Amount of randomness of the initial phase of the wavetable oscillator.\\n *\\n * @name wtphaserand\\n * @tags wavetable, superdough\\n * @param {number | Pattern} amount Randomness of the initial phase. Between 0 (not random) and 1 (fully random)\\n * @synonyms wavetablePhaseRand\\n * @example\\n * s(\\"basique\\").bank(\\"wt_digital\\").seg(16).wtphaserand(\\"<0 1>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":341,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Amount of randomness of the initial phase of the wavetable oscillator.</p>","name":"wtphaserand","tags":["wavetable","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>Randomness of the initial phase. Between 0 (not random) and 1 (fully random)</p>","name":"amount"}],"synonyms_text":"wavetablePhaseRand","synonyms":["wavetablePhaseRand"],"examples":["s(\\"basique\\").bank(\\"wt_digital\\").seg(16).wtphaserand(\\"<0 1>\\")"],"longname":"wtphaserand","kind":"member","scope":"global"},{"comment":"/**\\n * Amount of envelope applied wavetable oscillator's position envelope\\n *\\n * @name warpenv\\n * @tags wavetable, envelope, superdough\\n * @param {number | Pattern} amount between 0 and 1\\n */","meta":{"filename":"controls.mjs","lineno":354,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Amount of envelope applied wavetable oscillator's position envelope</p>","name":"warpenv","tags":["wavetable","envelope","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>between 0 and 1</p>","name":"amount"}],"longname":"warpenv","kind":"member","scope":"global"},{"comment":"/**\\n * cycle synced rate of the LFO for the wavetable warp position\\n *\\n * @name warpsync\\n * @tags wavetable, lfo, superdough\\n * @param {number | Pattern} rate rate in cycles\\n */","meta":{"filename":"controls.mjs","lineno":363,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>cycle synced rate of the LFO for the wavetable warp position</p>","name":"warpsync","tags":["wavetable","lfo","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>rate in cycles</p>","name":"rate"}],"longname":"warpsync","kind":"member","scope":"global"},{"comment":"/**\\n * Define a custom webaudio node to use as a sound source.\\n *\\n * @name source\\n * @tags external_io, superdough\\n * @synonyms src\\n * @param {function} getSource\\n * @synonyms src\\n *\\n */","meta":{"filename":"controls.mjs","lineno":372,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Define a custom webaudio node to use as a sound source.</p>","name":"source","tags":["external_io","superdough"],"synonyms_text":"src","synonyms":["src"],"params":[{"type":{"names":["function"]},"name":"getSource"}],"longname":"source","kind":"member","scope":"global"},{"comment":"/**\\n * Selects the given index:\\n * - for samples, it picks the sample by index, with wrap around\\n * - for scales, it picks the scale degree\\n * - for voicings, it picks the voice index\\n *\\n * @name n\\n * @tags superdough, samples, tonal\\n * @param {number | Pattern} value sample index starting from 0\\n * @example\\n * s(\\"bd sd [~ bd] sd,hh*6\\").n(\\"<0 1>\\")\\n */","meta":{"filename":"controls.mjs","lineno":383,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Selects the given index:</p>\\n<ul>\\n<li>for samples, it picks the sample by index, with wrap around</li>\\n<li>for scales, it picks the scale degree</li>\\n<li>for voicings, it picks the voice index</li>\\n</ul>","name":"n","tags":["superdough","samples","tonal"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>sample index starting from 0</p>","name":"value"}],"examples":["s(\\"bd sd [~ bd] sd,hh*6\\").n(\\"<0 1>\\")"],"longname":"n","kind":"member","scope":"global"},{"comment":"/**\\n * Selects the given degree. Currently used in \`xen\` and \`tune\`:\\n *\\n * @name i\\n * @tags tonal\\n * @param {number | Pattern} value\\n * @example\\n * i(\\"0 1 2 3 4 5 6 7\\").xen(\\"<5edo 10edo 15edo hexany15>\\")\\n */","meta":{"filename":"controls.mjs","lineno":398,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Selects the given degree. Currently used in <code>xen</code> and <code>tune</code>:</p>","name":"i","tags":["tonal"],"params":[{"type":{"names":["number","Pattern"]},"name":"value"}],"examples":["i(\\"0 1 2 3 4 5 6 7\\").xen(\\"<5edo 10edo 15edo hexany15>\\")"],"longname":"i","kind":"member","scope":"global"},{"comment":"/**\\n * Plays the given note name or midi number. A note name consists of\\n *\\n * - a letter (a-g or A-G)\\n * - optional accidentals (b or #)\\n * - optional (possibly negative) octave number (0-9). Defaults to 3\\n *\\n * Examples of valid note names: \`c\`, \`bb\`, \`Bb\`, \`f#\`, \`c3\`, \`A4\`, \`Eb2\`, \`c#5\`\\n *\\n * You can also use midi numbers instead of note names, where 69 is mapped to A4 440Hz in 12EDO.\\n *\\n * @name note\\n * @tags tonal\\n * @example\\n * note(\\"c a f e\\")\\n * @example\\n * note(\\"c4 a4 f4 e4\\")\\n * @example\\n * note(\\"60 69 65 64\\")\\n * @example\\n * note(\\"fbb1 a#0 cbbb-1 e##-2\\").sound(\\"saw\\")\\n */","meta":{"filename":"controls.mjs","lineno":409,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Plays the given note name or midi number. A note name consists of</p>\\n<ul>\\n<li>a letter (a-g or A-G)</li>\\n<li>optional accidentals (b or #)</li>\\n<li>optional (possibly negative) octave number (0-9). Defaults to 3</li>\\n</ul>\\n<p>Examples of valid note names: <code>c</code>, <code>bb</code>, <code>Bb</code>, <code>f#</code>, <code>c3</code>, <code>A4</code>, <code>Eb2</code>, <code>c#5</code></p>\\n<p>You can also use midi numbers instead of note names, where 69 is mapped to A4 440Hz in 12EDO.</p>","name":"note","tags":["tonal"],"examples":["note(\\"c a f e\\")","note(\\"c4 a4 f4 e4\\")","note(\\"60 69 65 64\\")","note(\\"fbb1 a#0 cbbb-1 e##-2\\").sound(\\"saw\\")"],"longname":"note","kind":"member","scope":"global"},{"comment":"/**\\n * A pattern of numbers that speed up (or slow down) samples while they play. Currently only supported by osc / superdirt.\\n *\\n * @name accelerate\\n * @tags samples, superdirt\\n * @param {number | Pattern} amount acceleration.\\n * @superdirtOnly\\n * @example\\n * s(\\"sax\\").accelerate(\\"<0 1 2 4 8 16>\\").slow(2).osc()\\n *\\n */","meta":{"filename":"controls.mjs","lineno":433,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>A pattern of numbers that speed up (or slow down) samples while they play. Currently only supported by osc / superdirt.</p>","name":"accelerate","tags":["samples","superdirt",{"originalTitle":"superdirtOnly","title":"superdirtonly","text":""}],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>acceleration.</p>","name":"amount"}],"examples":["s(\\"sax\\").accelerate(\\"<0 1 2 4 8 16>\\").slow(2).osc()"],"longname":"accelerate","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the velocity from 0 to 1. Is multiplied together with gain.\\n *\\n * @name velocity\\n * @tags amplitude, superdough, supradough\\n * @synonyms vel\\n * @example\\n * s(\\"hh*8\\")\\n * .gain(\\".4!2 1 .4!2 1 .4 1\\")\\n * .velocity(\\".4 1\\")\\n */","meta":{"filename":"controls.mjs","lineno":445,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the velocity from 0 to 1. Is multiplied together with gain.</p>","name":"velocity","tags":["amplitude","superdough","supradough"],"synonyms_text":"vel","synonyms":["vel"],"examples":["s(\\"hh*8\\")\\n.gain(\\".4!2 1 .4!2 1 .4 1\\")\\n.velocity(\\".4 1\\")"],"longname":"velocity","kind":"member","scope":"global"},{"comment":"/**\\n * Controls the gain by an exponential amount.\\n *\\n * @name gain\\n * @tags amplitude, superdough, supradough\\n * @param {number | Pattern} amount gain.\\n * @example\\n * s(\\"hh*8\\").gain(\\".4!2 1 .4!2 1 .4 1\\").fast(2)\\n *\\n */","meta":{"filename":"controls.mjs","lineno":457,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Controls the gain by an exponential amount.</p>","name":"gain","tags":["amplitude","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>gain.</p>","name":"amount"}],"examples":["s(\\"hh*8\\").gain(\\".4!2 1 .4!2 1 .4 1\\").fast(2)"],"longname":"gain","kind":"member","scope":"global"},{"comment":"/**\\n * Gain applied after all effects have been processed.\\n *\\n * @name postgain\\n * @tags amplitude, superdough, supradough\\n * @example\\n * s(\\"bd sd [~ bd] sd,hh*8\\")\\n * .compressor(\\"-20:20:10:.002:.02\\").postgain(1.5)\\n *\\n */","meta":{"filename":"controls.mjs","lineno":468,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Gain applied after all effects have been processed.</p>","name":"postgain","tags":["amplitude","superdough","supradough"],"examples":["s(\\"bd sd [~ bd] sd,hh*8\\")\\n.compressor(\\"-20:20:10:.002:.02\\").postgain(1.5)"],"longname":"postgain","kind":"member","scope":"global"},{"comment":"/**\\n * Like \`gain\`, but linear.\\n *\\n * @name amp\\n * @tags amplitude, superdirt\\n * @param {number | Pattern} amount gain.\\n * @superdirtOnly\\n * @example\\n * s(\\"bd*8\\").amp(\\".1*2 .5 .1*2 .5 .1 .5\\").osc()\\n *\\n */","meta":{"filename":"controls.mjs","lineno":479,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Like <code>gain</code>, but linear.</p>","name":"amp","tags":["amplitude","superdirt",{"originalTitle":"superdirtOnly","title":"superdirtonly","text":""}],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>gain.</p>","name":"amount"}],"examples":["s(\\"bd*8\\").amp(\\".1*2 .5 .1*2 .5 .1 .5\\").osc()"],"longname":"amp","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the Frequency Modulation Harmonicity Ratio.\\n * Controls the timbre of the sound.\\n * Whole numbers and simple ratios sound more natural,\\n * while decimal numbers and complex ratios sound metallic.\\n *\\n * A number may be added afterwards to control the harmonicity of\\n * any of the 8 individual FMs (e.g. \`fmh2\`)\\n *\\n * @name fmh\\n * @tags fm, superdough, supradough\\n * @param {number | Pattern} harmonicity\\n * @example\\n * note(\\"c e g b g e\\")\\n * .fm(4)\\n * .fmh(\\"<1 2 1.5 1.61>\\")\\n * ._scope()\\n *\\n */","meta":{"filename":"controls.mjs","lineno":492,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the Frequency Modulation Harmonicity Ratio.\\nControls the timbre of the sound.\\nWhole numbers and simple ratios sound more natural,\\nwhile decimal numbers and complex ratios sound metallic.</p>\\n<p>A number may be added afterwards to control the harmonicity of\\nany of the 8 individual FMs (e.g. <code>fmh2</code>)</p>","name":"fmh","tags":["fm","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"name":"harmonicity"}],"examples":["note(\\"c e g b g e\\")\\n.fm(4)\\n.fmh(\\"<1 2 1.5 1.61>\\")\\n._scope()"],"longname":"fmh","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the Frequency Modulation of the synth.\\n * Controls the modulation index, which defines the brightness of the sound.\\n *\\n * A number may be added afterwards to control the modulation index of\\n * any of the 8 individual FMs (e.g. \`fm3\`). Also, FMs may be routed into\\n * each other with matrix commands like \`fm13\`, which would send \`fm1\` back into\\n * \`fm3\`\\n *\\n * @name fmi\\n * @tags fm, superdough, supradough\\n * @param {number | Pattern} brightness modulation index\\n * @synonyms fm\\n * @example\\n * note(\\"c e g b g e\\")\\n * .fm(\\"<0 1 2 8 32>\\")\\n * ._scope()\\n * @example\\n * s(\\"sine\\").note(\\"F1\\").seg(8)\\n * .fm(4).fm2(rand.mul(4)).fm3(saw.mul(8).slow(8))\\n * .fmh(1.06).fmh2(10).fmh3(0.1)\\n *\\n */","meta":{"filename":"controls.mjs","lineno":513,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the Frequency Modulation of the synth.\\nControls the modulation index, which defines the brightness of the sound.</p>\\n<p>A number may be added afterwards to control the modulation index of\\nany of the 8 individual FMs (e.g. <code>fm3</code>). Also, FMs may be routed into\\neach other with matrix commands like <code>fm13</code>, which would send <code>fm1</code> back into\\n<code>fm3</code></p>","name":"fmi","tags":["fm","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>modulation index</p>","name":"brightness"}],"synonyms_text":"fm","synonyms":["fm"],"examples":["note(\\"c e g b g e\\")\\n.fm(\\"<0 1 2 8 32>\\")\\n._scope()","s(\\"sine\\").note(\\"F1\\").seg(8)\\n .fm(4).fm2(rand.mul(4)).fm3(saw.mul(8).slow(8))\\n .fmh(1.06).fmh2(10).fmh3(0.1)"],"longname":"fmi","kind":"member","scope":"global"},{"comment":"/**\\n * Ramp type of fm envelope. Exp might be a bit broken..\\n *\\n * A number may be added afterwards to control the envelope of\\n * any of the 8 individual FMs (e.g. \`fmenv4\`)\\n *\\n * @name fmenv\\n * @tags fm, envelope, superdough, supradough\\n * @param {number | Pattern} type lin | exp\\n * @synonyms fme\\n * @example\\n * note(\\"c e g b g e\\")\\n * .fm(4)\\n * .fmdecay(.2)\\n * .fmsustain(0)\\n * .fmenv(\\"<exp lin>\\")\\n * ._scope()\\n *\\n */","meta":{"filename":"controls.mjs","lineno":540,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Ramp type of fm envelope. Exp might be a bit broken..</p>\\n<p>A number may be added afterwards to control the envelope of\\nany of the 8 individual FMs (e.g. <code>fmenv4</code>)</p>","name":"fmenv","tags":["fm","envelope","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>lin | exp</p>","name":"type"}],"synonyms_text":"fme","synonyms":["fme"],"examples":["note(\\"c e g b g e\\")\\n.fm(4)\\n.fmdecay(.2)\\n.fmsustain(0)\\n.fmenv(\\"<exp lin>\\")\\n._scope()"],"longname":"fmenv","kind":"member","scope":"global"},{"comment":"/**\\n * Attack time for the FM envelope: time it takes to reach maximum modulation\\n *\\n * A number may be added afterwards to control the attack of the envelope of\\n * any of the 8 individual FMs (e.g. \`fmatt5\`)\\n *\\n * @name fmattack\\n * @tags fm, envelope, superdough, supradough\\n * @synonyms fmatt\\n * @param {number | Pattern} time attack time\\n * @synonyms fmatt\\n * @example\\n * note(\\"c e g b g e\\")\\n * .fm(4)\\n * .fmattack(\\"<0 .05 .1 .2>\\")\\n * ._scope()\\n *\\n */","meta":{"filename":"controls.mjs","lineno":565,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Attack time for the FM envelope: time it takes to reach maximum modulation</p>\\n<p>A number may be added afterwards to control the attack of the envelope of\\nany of the 8 individual FMs (e.g. <code>fmatt5</code>)</p>","name":"fmattack","tags":["fm","envelope","superdough","supradough"],"synonyms_text":"fmatt","synonyms":["fmatt"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>attack time</p>","name":"time"}],"examples":["note(\\"c e g b g e\\")\\n.fm(4)\\n.fmattack(\\"<0 .05 .1 .2>\\")\\n._scope()"],"longname":"fmattack","kind":"member","scope":"global"},{"comment":"/**\\n * Waveform of the fm modulator\\n *\\n * A number may be added afterwards to control the waveform\\n * any of the 8 individual FMs (e.g. \`fmwave6\`)\\n *\\n * @name fmwave\\n * @tags fm, superdough, supradough\\n * @param {number | Pattern} wave waveform\\n * @example\\n * n(\\"0 1 2 3\\".fast(4)).scale(\\"d:minor\\").s(\\"sine\\").fmwave(\\"<sine square sawtooth crackle>\\").fm(4).fmh(2.01)\\n * @example\\n * n(\\"0 1 2 3\\".fast(4)).chord(\\"<Dm Am F G>\\").voicing().s(\\"sawtooth\\").fmwave(\\"brown\\").fm(.6)\\n *\\n */","meta":{"filename":"controls.mjs","lineno":604,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Waveform of the fm modulator</p>\\n<p>A number may be added afterwards to control the waveform\\nany of the 8 individual FMs (e.g. <code>fmwave6</code>)</p>","name":"fmwave","tags":["fm","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>waveform</p>","name":"wave"}],"examples":["n(\\"0 1 2 3\\".fast(4)).scale(\\"d:minor\\").s(\\"sine\\").fmwave(\\"<sine square sawtooth crackle>\\").fm(4).fmh(2.01)","n(\\"0 1 2 3\\".fast(4)).chord(\\"<Dm Am F G>\\").voicing().s(\\"sawtooth\\").fmwave(\\"brown\\").fm(.6)"],"longname":"fmwave","kind":"member","scope":"global"},{"comment":"/**\\n * Decay time for the FM envelope: seconds until the sustain level is reached after the attack phase.\\n *\\n * A number may be added afterwards to control the decay of the envelope of\\n * any of the 8 individual FMs (e.g. \`fmdec6\`)\\n *\\n * @name fmdecay\\n * @tags fm, envelope, superdough, supradough\\n * @synonyms fmdec\\n * @param {number | Pattern} time decay time\\n * @synonyms fmdec\\n * @example\\n * note(\\"c e g b g e\\")\\n * .fm(4)\\n * .fmdecay(\\"<.01 .05 .1 .2>\\")\\n * .fmsustain(.4)\\n * ._scope()\\n *\\n */","meta":{"filename":"controls.mjs","lineno":624,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Decay time for the FM envelope: seconds until the sustain level is reached after the attack phase.</p>\\n<p>A number may be added afterwards to control the decay of the envelope of\\nany of the 8 individual FMs (e.g. <code>fmdec6</code>)</p>","name":"fmdecay","tags":["fm","envelope","superdough","supradough"],"synonyms_text":"fmdec","synonyms":["fmdec"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>decay time</p>","name":"time"}],"examples":["note(\\"c e g b g e\\")\\n.fm(4)\\n.fmdecay(\\"<.01 .05 .1 .2>\\")\\n.fmsustain(.4)\\n._scope()"],"longname":"fmdecay","kind":"member","scope":"global"},{"comment":"/**\\n * Sustain level for the FM envelope: how much modulation is applied after the decay phase\\n *\\n * A number may be added afterwards to control the sustain of the envelope of\\n * any of the 8 individual FMs (e.g. \`fmsus7\`)\\n *\\n * @name fmsustain\\n * @tags fm, envelope, superdough, supradough\\n * @synonyms fmsus\\n * @param {number | Pattern} level sustain level\\n * @synonyms fmsus\\n * @example\\n * note(\\"c e g b g e\\")\\n * .fm(4)\\n * .fmdecay(.1)\\n * .fmsustain(\\"<1 .75 .5 0>\\")\\n * ._scope()\\n *\\n */","meta":{"filename":"controls.mjs","lineno":664,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sustain level for the FM envelope: how much modulation is applied after the decay phase</p>\\n<p>A number may be added afterwards to control the sustain of the envelope of\\nany of the 8 individual FMs (e.g. <code>fmsus7</code>)</p>","name":"fmsustain","tags":["fm","envelope","superdough","supradough"],"synonyms_text":"fmsus","synonyms":["fmsus"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>sustain level</p>","name":"level"}],"examples":["note(\\"c e g b g e\\")\\n.fm(4)\\n.fmdecay(.1)\\n.fmsustain(\\"<1 .75 .5 0>\\")\\n._scope()"],"longname":"fmsustain","kind":"member","scope":"global"},{"comment":"/**\\n * Release time for the FM envelope: how much modulation is applied after the note is released\\n *\\n * A number may be added afterwards to control the release of the envelope of\\n * any of the 8 individual FMs (e.g. \`fmrel8\`)\\n *\\n * @name fmrelease\\n * @tags fm, envelope, superdough, supradough\\n * @synonyms fmrel\\n * @param {number | Pattern} time release time\\n *\\n */","meta":{"filename":"controls.mjs","lineno":704,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Release time for the FM envelope: how much modulation is applied after the note is released</p>\\n<p>A number may be added afterwards to control the release of the envelope of\\nany of the 8 individual FMs (e.g. <code>fmrel8</code>)</p>","name":"fmrelease","tags":["fm","envelope","superdough","supradough"],"synonyms_text":"fmrel","synonyms":["fmrel"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>release time</p>","name":"time"}],"longname":"fmrelease","kind":"member","scope":"global"},{"comment":"/**\\n * Select the sound bank to use. To be used together with \`s\`. The bank name (+ \\"_\\") will be prepended to the value of \`s\`.\\n *\\n * @name bank\\n * @tags samples, superdough\\n * @param {string | Pattern} bank the name of the bank\\n * @example\\n * s(\\"bd sd [~ bd] sd\\").bank('RolandTR909') // = s(\\"RolandTR909_bd RolandTR909_sd\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":748,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Select the sound bank to use. To be used together with <code>s</code>. The bank name (+ "_") will be prepended to the value of <code>s</code>.</p>","name":"bank","tags":["samples","superdough"],"params":[{"type":{"names":["string","Pattern"]},"description":"<p>the name of the bank</p>","name":"bank"}],"examples":["s(\\"bd sd [~ bd] sd\\").bank('RolandTR909') // = s(\\"RolandTR909_bd RolandTR909_sd\\")"],"longname":"bank","kind":"member","scope":"global"},{"comment":"/**\\n * mix control for the chorus effect\\n *\\n * @name chorus\\n * @tags pitch\\n * @param {string | Pattern} chorus mix amount between 0 and 1\\n * @example\\n * note(\\"d d a# a\\").s(\\"sawtooth\\").chorus(.5)\\n *\\n */","meta":{"filename":"controls.mjs","lineno":760,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>mix control for the chorus effect</p>","name":"chorus","tags":["pitch"],"params":[{"type":{"names":["string","Pattern"]},"description":"<p>mix amount between 0 and 1</p>","name":"chorus"}],"examples":["note(\\"d d a# a\\").s(\\"sawtooth\\").chorus(.5)"],"longname":"chorus","kind":"member","scope":"global"},{"comment":"/**\\n * Amplitude envelope attack time: Specifies how long it takes for the sound to reach its peak value, relative to the onset.\\n *\\n * @name attack\\n * @tags amplitude, envelope, superdough, supradough\\n * @param {number | Pattern} attack time in seconds.\\n * @synonyms att\\n * @example\\n * note(\\"c3 e3 f3 g3\\").attack(\\"<0 .1 .5>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":777,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Amplitude envelope attack time: Specifies how long it takes for the sound to reach its peak value, relative to the onset.</p>","name":"attack","tags":["amplitude","envelope","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>time in seconds.</p>","name":"attack"}],"synonyms_text":"att","synonyms":["att"],"examples":["note(\\"c3 e3 f3 g3\\").attack(\\"<0 .1 .5>\\")"],"longname":"attack","kind":"member","scope":"global"},{"comment":"/**\\n * Amplitude envelope decay time: the time it takes after the attack time to reach the sustain level.\\n * Note that the decay is only audible if the sustain value is lower than 1.\\n *\\n * @name decay\\n * @tags amplitude, envelope, superdough, supradough\\n * @param {number | Pattern} time decay time in seconds\\n * @synonyms dec\\n * @example\\n * note(\\"c3 e3 f3 g3\\").decay(\\"<.1 .2 .3 .4>\\").sustain(0)\\n *\\n */","meta":{"filename":"controls.mjs","lineno":790,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Amplitude envelope decay time: the time it takes after the attack time to reach the sustain level.\\nNote that the decay is only audible if the sustain value is lower than 1.</p>","name":"decay","tags":["amplitude","envelope","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>decay time in seconds</p>","name":"time"}],"synonyms_text":"dec","synonyms":["dec"],"examples":["note(\\"c3 e3 f3 g3\\").decay(\\"<.1 .2 .3 .4>\\").sustain(0)"],"longname":"decay","kind":"member","scope":"global"},{"comment":"/**\\n * Amplitude envelope sustain level: The level which is reached after attack / decay, being sustained until the offset.\\n *\\n * @name sustain\\n * @tags amplitude, envelope, superdough, supradough\\n * @param {number | Pattern} gain sustain level between 0 and 1\\n * @synonyms sus\\n * @example\\n * note(\\"c3 e3 f3 g3\\").decay(.2).sustain(\\"<0 .1 .4 .6 1>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":803,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Amplitude envelope sustain level: The level which is reached after attack / decay, being sustained until the offset.</p>","name":"sustain","tags":["amplitude","envelope","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>sustain level between 0 and 1</p>","name":"gain"}],"synonyms_text":"sus","synonyms":["sus"],"examples":["note(\\"c3 e3 f3 g3\\").decay(.2).sustain(\\"<0 .1 .4 .6 1>\\")"],"longname":"sustain","kind":"member","scope":"global"},{"comment":"/**\\n * Amplitude envelope release time: The time it takes after the offset to go from sustain level to zero.\\n *\\n * @name release\\n * @tags amplitude, envelope, superdough, supradough\\n * @param {number | Pattern} time release time in seconds\\n * @synonyms rel\\n * @example\\n * note(\\"c3 e3 g3 c4\\").release(\\"<0 .1 .4 .6 1>/2\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":815,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Amplitude envelope release time: The time it takes after the offset to go from sustain level to zero.</p>","name":"release","tags":["amplitude","envelope","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>release time in seconds</p>","name":"time"}],"synonyms_text":"rel","synonyms":["rel"],"examples":["note(\\"c3 e3 g3 c4\\").release(\\"<0 .1 .4 .6 1>/2\\")"],"longname":"release","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the center frequency of the **b**and-**p**ass **f**ilter. When using mininotation, you\\n * can also optionally supply the 'bpq' parameter separated by ':'.\\n *\\n * @name bpf\\n * @tags filter, superdough, supradough\\n * @param {number | Pattern} frequency center frequency\\n * @synonyms bandf, bp\\n * @example\\n * s(\\"bd sd [~ bd] sd,hh*6\\").bpf(\\"<1000 2000 4000 8000>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":829,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the center frequency of the <strong>b</strong>and-<strong>p</strong>ass <strong>f</strong>ilter. When using mininotation, you\\ncan also optionally supply the 'bpq' parameter separated by ':'.</p>","name":"bpf","tags":["filter","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>center frequency</p>","name":"frequency"}],"synonyms_text":"bandf, bp","synonyms":["bandf","bp"],"examples":["s(\\"bd sd [~ bd] sd,hh*6\\").bpf(\\"<1000 2000 4000 8000>\\")"],"longname":"bpf","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the **b**and-**p**ass **q**-factor (resonance).\\n *\\n * @name bpq\\n * @tags filter, superdough, supradough\\n * @param {number | Pattern} q q factor\\n * @synonyms bandq\\n * @example\\n * s(\\"bd sd [~ bd] sd\\").bpf(500).bpq(\\"<0 1 2 3>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":843,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the <strong>b</strong>and-<strong>p</strong>ass <strong>q</strong>-factor (resonance).</p>","name":"bpq","tags":["filter","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>q factor</p>","name":"q"}],"synonyms_text":"bandq","synonyms":["bandq"],"examples":["s(\\"bd sd [~ bd] sd\\").bpf(500).bpq(\\"<0 1 2 3>\\")"],"longname":"bpq","kind":"member","scope":"global"},{"comment":"/**\\n * A pattern of numbers from 0 to 1. Skips the beginning of each sample, e.g. \`0.25\` to cut off the first quarter from each sample.\\n *\\n * @name begin\\n * @tags samples\\n * @param {number | Pattern} amount between 0 and 1, where 1 is the length of the sample\\n * @example\\n * samples({ rave: 'rave/AREUREADY.wav' }, 'github:tidalcycles/dirt-samples')\\n * s(\\"rave\\").begin(\\"<0 .25 .5 .75>\\").fast(2)\\n *\\n */","meta":{"filename":"controls.mjs","lineno":857,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>A pattern of numbers from 0 to 1. Skips the beginning of each sample, e.g. <code>0.25</code> to cut off the first quarter from each sample.</p>","name":"begin","tags":["samples"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>between 0 and 1, where 1 is the length of the sample</p>","name":"amount"}],"examples":["samples({ rave: 'rave/AREUREADY.wav' }, 'github:tidalcycles/dirt-samples')\\ns(\\"rave\\").begin(\\"<0 .25 .5 .75>\\").fast(2)"],"longname":"begin","kind":"member","scope":"global"},{"comment":"/**\\n * The same as .begin, but cuts off the end off each sample.\\n *\\n * @memberof Pattern\\n * @name end\\n * @tags samples\\n * @param {number | Pattern} length 1 = whole sample, .5 = half sample, .25 = quarter sample etc..\\n * @example\\n * s(\\"bd*2,oh*4\\").end(\\"<.1 .2 .5 1>\\").fast(2)\\n *\\n */","meta":{"filename":"controls.mjs","lineno":869,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>The same as .begin, but cuts off the end off each sample.</p>","memberof":"Pattern","name":"end","tags":["samples"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>1 = whole sample, .5 = half sample, .25 = quarter sample etc..</p>","name":"length"}],"examples":["s(\\"bd*2,oh*4\\").end(\\"<.1 .2 .5 1>\\").fast(2)"],"scope":"static","longname":"Pattern.end","kind":"member"},{"comment":"/**\\n * Loops the sample.\\n * Note that the tempo of the loop is not synced with the cycle tempo.\\n * To change the loop region, use loopBegin / loopEnd.\\n *\\n * @name loop\\n * @tags samples\\n * @param {number | Pattern} on If 1, the sample is looped\\n * @example\\n * s(\\"casio\\").loop(1)\\n *\\n */","meta":{"filename":"controls.mjs","lineno":881,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Loops the sample.\\nNote that the tempo of the loop is not synced with the cycle tempo.\\nTo change the loop region, use loopBegin / loopEnd.</p>","name":"loop","tags":["samples"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>If 1, the sample is looped</p>","name":"on"}],"examples":["s(\\"casio\\").loop(1)"],"longname":"loop","kind":"member","scope":"global"},{"comment":"/**\\n * Begin to loop at a specific point in the sample (inbetween \`begin\` and \`end\`).\\n * Note that the loop point must be inbetween \`begin\` and \`end\`, and before \`loopEnd\`!\\n * Note: Samples starting with wt_ will automatically loop! (wt = wavetable)\\n *\\n * @name loopBegin\\n * @tags samples\\n * @param {number | Pattern} time between 0 and 1, where 1 is the length of the sample\\n * @synonyms loopb\\n * @example\\n * s(\\"space\\").loop(1)\\n * .loopBegin(\\"<0 .125 .25>\\")._scope()\\n */","meta":{"filename":"controls.mjs","lineno":894,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Begin to loop at a specific point in the sample (inbetween <code>begin</code> and <code>end</code>).\\nNote that the loop point must be inbetween <code>begin</code> and <code>end</code>, and before <code>loopEnd</code>!\\nNote: Samples starting with wt_ will automatically loop! (wt = wavetable)</p>","name":"loopBegin","tags":["samples"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>between 0 and 1, where 1 is the length of the sample</p>","name":"time"}],"synonyms_text":"loopb","synonyms":["loopb"],"examples":["s(\\"space\\").loop(1)\\n.loopBegin(\\"<0 .125 .25>\\")._scope()"],"longname":"loopBegin","kind":"member","scope":"global"},{"comment":"/**\\n *\\n * End the looping section at a specific point in the sample (inbetween \`begin\` and \`end\`).\\n * Note that the loop point must be inbetween \`begin\` and \`end\`, and after \`loopBegin\`!\\n *\\n * @name loopEnd\\n * @tags samples\\n * @param {number | Pattern} time between 0 and 1, where 1 is the length of the sample\\n * @synonyms loope\\n * @example\\n * s(\\"space\\").loop(1)\\n * .loopEnd(\\"<1 .75 .5 .25>\\")._scope()\\n */","meta":{"filename":"controls.mjs","lineno":908,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>End the looping section at a specific point in the sample (inbetween <code>begin</code> and <code>end</code>).\\nNote that the loop point must be inbetween <code>begin</code> and <code>end</code>, and after <code>loopBegin</code>!</p>","name":"loopEnd","tags":["samples"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>between 0 and 1, where 1 is the length of the sample</p>","name":"time"}],"synonyms_text":"loope","synonyms":["loope"],"examples":["s(\\"space\\").loop(1)\\n.loopEnd(\\"<1 .75 .5 .25>\\")._scope()"],"longname":"loopEnd","kind":"member","scope":"global"},{"comment":"/**\\n * Bit crusher effect.\\n *\\n * @name crush\\n * @tags superdough, supradough\\n * @param {number | Pattern} depth between 1 (for drastic reduction in bit-depth) to 16 (for barely no reduction).\\n * @example\\n * s(\\"<bd sd>,hh*3\\").fast(2).crush(\\"<16 8 7 6 5 4 3 2>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":922,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Bit crusher effect.</p>","name":"crush","tags":["superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>between 1 (for drastic reduction in bit-depth) to 16 (for barely no reduction).</p>","name":"depth"}],"examples":["s(\\"<bd sd>,hh*3\\").fast(2).crush(\\"<16 8 7 6 5 4 3 2>\\")"],"longname":"crush","kind":"member","scope":"global"},{"comment":"/**\\n * Fake-resampling for lowering the sample rate. Caution: This effect seems to only work in chromium based browsers\\n *\\n * @name coarse\\n * @tags superdough, supradough\\n * @param {number | Pattern} factor 1 for original 2 for half, 3 for a third and so on.\\n * @example\\n * s(\\"bd sd [~ bd] sd,hh*8\\").coarse(\\"<1 4 8 16 32>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":934,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Fake-resampling for lowering the sample rate. Caution: This effect seems to only work in chromium based browsers</p>","name":"coarse","tags":["superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>1 for original 2 for half, 3 for a third and so on.</p>","name":"factor"}],"examples":["s(\\"bd sd [~ bd] sd,hh*8\\").coarse(\\"<1 4 8 16 32>\\")"],"longname":"coarse","kind":"member","scope":"global"},{"comment":"/**\\n * Modulate the amplitude of a sound with a continuous waveform\\n *\\n * @name tremolo\\n * @tags amplitude, lfo, superdough\\n * @synonyms trem\\n * @param {number | Pattern} speed modulation speed in HZ\\n * @example\\n * note(\\"d d d# d\\".fast(4)).s(\\"supersaw\\").tremolo(\\"<3 2 100> \\").tremoloskew(\\"<.5>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":946,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Modulate the amplitude of a sound with a continuous waveform</p>","name":"tremolo","tags":["amplitude","lfo","superdough"],"synonyms_text":"trem","synonyms":["trem"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>modulation speed in HZ</p>","name":"speed"}],"examples":["note(\\"d d d# d\\".fast(4)).s(\\"supersaw\\").tremolo(\\"<3 2 100> \\").tremoloskew(\\"<.5>\\")"],"longname":"tremolo","kind":"member","scope":"global"},{"comment":"/**\\n * Modulate the amplitude of a sound with a continuous waveform\\n *\\n * @name tremolosync\\n * @tags amplitude, lfo, superdough\\n * @synonyms tremsync\\n * @param {number | Pattern} cycles modulation speed in cycles\\n * @example\\n * note(\\"d d d# d\\".fast(4)).s(\\"supersaw\\").tremolosync(\\"4\\").tremoloskew(\\"<1 .5 0>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":959,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Modulate the amplitude of a sound with a continuous waveform</p>","name":"tremolosync","tags":["amplitude","lfo","superdough"],"synonyms_text":"tremsync","synonyms":["tremsync"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>modulation speed in cycles</p>","name":"cycles"}],"examples":["note(\\"d d d# d\\".fast(4)).s(\\"supersaw\\").tremolosync(\\"4\\").tremoloskew(\\"<1 .5 0>\\")"],"longname":"tremolosync","kind":"member","scope":"global"},{"comment":"/**\\n * Depth of amplitude modulation\\n *\\n * @name tremolodepth\\n * @tags amplitude, lfo, superdough\\n * @synonyms tremdepth\\n * @param {number | Pattern} depth\\n * @example\\n * note(\\"a1 a1 a#1 a1\\".fast(4)).s(\\"pulse\\").tremsync(4).tremolodepth(\\"<1 2 .7>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":975,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Depth of amplitude modulation</p>","name":"tremolodepth","tags":["amplitude","lfo","superdough"],"synonyms_text":"tremdepth","synonyms":["tremdepth"],"params":[{"type":{"names":["number","Pattern"]},"name":"depth"}],"examples":["note(\\"a1 a1 a#1 a1\\".fast(4)).s(\\"pulse\\").tremsync(4).tremolodepth(\\"<1 2 .7>\\")"],"longname":"tremolodepth","kind":"member","scope":"global"},{"comment":"/**\\n * Alter the shape of the modulation waveform\\n *\\n * @name tremoloskew\\n * @tags amplitude, lfo, superdough\\n * @synonyms tremskew\\n * @param {number | Pattern} amount between 0 & 1, the shape of the waveform\\n * @example\\n * note(\\"{f a c e}%16\\").s(\\"sawtooth\\").tremsync(4).tremoloskew(\\"<.5 0 1>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":987,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Alter the shape of the modulation waveform</p>","name":"tremoloskew","tags":["amplitude","lfo","superdough"],"synonyms_text":"tremskew","synonyms":["tremskew"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>between 0 & 1, the shape of the waveform</p>","name":"amount"}],"examples":["note(\\"{f a c e}%16\\").s(\\"sawtooth\\").tremsync(4).tremoloskew(\\"<.5 0 1>\\")"],"longname":"tremoloskew","kind":"member","scope":"global"},{"comment":"/**\\n * Alter the phase of the modulation waveform\\n *\\n * @name tremolophase\\n * @tags amplitude, lfo, superdough\\n * @synonyms tremphase\\n * @param {number | Pattern} offset the offset in cycles of the modulation\\n * @example\\n * note(\\"{f a c e}%16\\").s(\\"sawtooth\\").tremsync(4).tremolophase(\\"<0 .25 .66>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1000,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Alter the phase of the modulation waveform</p>","name":"tremolophase","tags":["amplitude","lfo","superdough"],"synonyms_text":"tremphase","synonyms":["tremphase"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>the offset in cycles of the modulation</p>","name":"offset"}],"examples":["note(\\"{f a c e}%16\\").s(\\"sawtooth\\").tremsync(4).tremolophase(\\"<0 .25 .66>\\")"],"longname":"tremolophase","kind":"member","scope":"global"},{"comment":"/**\\n * Shape of amplitude modulation\\n *\\n * @name tremoloshape\\n * @tags amplitude, lfo, superdough\\n * @synonyms tremshape\\n * @param {number | Pattern} shape tri | square | sine | saw | ramp\\n * @example\\n * note(\\"{f g c d}%16\\").tremsync(4).tremoloshape(\\"<sine tri square>\\").s(\\"sawtooth\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1013,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Shape of amplitude modulation</p>","name":"tremoloshape","tags":["amplitude","lfo","superdough"],"synonyms_text":"tremshape","synonyms":["tremshape"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>tri | square | sine | saw | ramp</p>","name":"shape"}],"examples":["note(\\"{f g c d}%16\\").tremsync(4).tremoloshape(\\"<sine tri square>\\").s(\\"sawtooth\\")"],"longname":"tremoloshape","kind":"member","scope":"global"},{"comment":"/**\\n * Filter overdrive for supported filter types\\n *\\n * @name drive\\n * @tags filter, superdough\\n * @param {number | Pattern} amount\\n * @example\\n * note(\\"{f g g c d a a#}%16\\".sub(17)).s(\\"supersaw\\").lpenv(8).lpf(150).lpq(.8).ftype('ladder').drive(\\"<.5 4>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1025,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Filter overdrive for supported filter types</p>","name":"drive","tags":["filter","superdough"],"params":[{"type":{"names":["number","Pattern"]},"name":"amount"}],"examples":["note(\\"{f g g c d a a#}%16\\".sub(17)).s(\\"supersaw\\").lpenv(8).lpf(150).lpq(.8).ftype('ladder').drive(\\"<.5 4>\\")"],"longname":"drive","kind":"member","scope":"global"},{"comment":"/**\\n * Modulate the amplitude of an orbit to create a \\"sidechain\\" like effect.\\n *\\n * Can be applied to multiple orbits with the ':' mininotation, e.g. \`duckorbit(\\"2:3\\")\`\\n *\\n * @name duckorbit\\n * @tags amplitude, orbit, superdough\\n * @synonyms duck\\n * @param {number | Pattern} orbit target orbit\\n * @example\\n * $: n(run(16)).scale(\\"c:minor:pentatonic\\").s(\\"sawtooth\\").delay(.7).orbit(2)\\n * $: s(\\"bd:4!4\\").beat(\\"0,4,8,11,14\\",16).duckorbit(2).duckattack(0.2).duckdepth(1)\\n * @example\\n * $: n(run(16)).scale(\\"c:minor:pentatonic\\").s(\\"sawtooth\\").delay(.7).orbit(2)\\n * $: s(\\"hh*16\\").orbit(3)\\n * $: s(\\"bd:4!4\\").beat(\\"0,4,8,11,14\\",16).duckorbit(\\"2:3\\").duckattack(0.2).duckdepth(1)\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1037,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Modulate the amplitude of an orbit to create a "sidechain" like effect.</p>\\n<p>Can be applied to multiple orbits with the ':' mininotation, e.g. <code>duckorbit("2:3")</code></p>","name":"duckorbit","tags":["amplitude","orbit","superdough"],"synonyms_text":"duck","synonyms":["duck"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>target orbit</p>","name":"orbit"}],"examples":["$: n(run(16)).scale(\\"c:minor:pentatonic\\").s(\\"sawtooth\\").delay(.7).orbit(2)\\n$: s(\\"bd:4!4\\").beat(\\"0,4,8,11,14\\",16).duckorbit(2).duckattack(0.2).duckdepth(1)","$: n(run(16)).scale(\\"c:minor:pentatonic\\").s(\\"sawtooth\\").delay(.7).orbit(2)\\n$: s(\\"hh*16\\").orbit(3)\\n$: s(\\"bd:4!4\\").beat(\\"0,4,8,11,14\\",16).duckorbit(\\"2:3\\").duckattack(0.2).duckdepth(1)"],"longname":"duckorbit","kind":"member","scope":"global"},{"comment":"/**\\n * The amount of ducking applied to target orbit\\n *\\n * Can vary across orbits with the ':' mininotation, e.g. \`duckdepth(\\"0.3:0.1\\")\`.\\n * Note: this requires first applying the effect to multiple orbits with e.g. \`duckorbit(\\"2:3\\")\`.\\n *\\n * @name duckdepth\\n * @tags amplitude, orbit, superdough\\n * @param {number | Pattern} depth depth of modulation from 0 to 1\\n * @example\\n * stack( n(run(8)).scale(\\"c:minor\\").s(\\"sawtooth\\").delay(.7).orbit(2), s(\\"bd:4!4\\").beat(\\"0,4,8,11,14\\",16).duckorbit(2).duckattack(0.2).duckdepth(\\"<1 .9 .6 0>\\"))\\n * @example\\n * $: n(run(16)).scale(\\"c:minor:pentatonic\\").s(\\"sawtooth\\").delay(.7).orbit(2)\\n * $: s(\\"hh*16\\").orbit(3)\\n * $: s(\\"bd:4!4\\").beat(\\"0,4,8,11,14\\",16).duckorbit(\\"2:3\\").duckattack(0.2).duckdepth(\\"1:0.5\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1057,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>The amount of ducking applied to target orbit</p>\\n<p>Can vary across orbits with the ':' mininotation, e.g. <code>duckdepth("0.3:0.1")</code>.\\nNote: this requires first applying the effect to multiple orbits with e.g. <code>duckorbit("2:3")</code>.</p>","name":"duckdepth","tags":["amplitude","orbit","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>depth of modulation from 0 to 1</p>","name":"depth"}],"examples":["stack( n(run(8)).scale(\\"c:minor\\").s(\\"sawtooth\\").delay(.7).orbit(2), s(\\"bd:4!4\\").beat(\\"0,4,8,11,14\\",16).duckorbit(2).duckattack(0.2).duckdepth(\\"<1 .9 .6 0>\\"))","$: n(run(16)).scale(\\"c:minor:pentatonic\\").s(\\"sawtooth\\").delay(.7).orbit(2)\\n$: s(\\"hh*16\\").orbit(3)\\n$: s(\\"bd:4!4\\").beat(\\"0,4,8,11,14\\",16).duckorbit(\\"2:3\\").duckattack(0.2).duckdepth(\\"1:0.5\\")"],"longname":"duckdepth","kind":"member","scope":"global"},{"comment":"/**\\n * The time required for the ducked signal(s) to reach their lowest volume.\\n * Can be used to prevent clicking or for creative rhythmic effects.\\n *\\n * Can vary across orbits with the ':' mininotation, e.g. \`duckonset(\\"0:0.003\\")\`.\\n * Note: this requires first applying the effect to multiple orbits with e.g. \`duckorbit(\\"2:3\\")\`.\\n *\\n * @name duckonset\\n * @tags amplitude, envelope, orbit, superdough\\n * @synonyms duckons\\n *\\n * @param {number | Pattern} time The onset time in seconds\\n * @example\\n * // Clicks\\n * sound: freq(\\"63.2388\\").s(\\"sine\\").orbit(2).gain(4)\\n * duckerWithClick: s(\\"bd*4\\").duckorbit(2).duckattack(0.3).duckonset(0).postgain(0)\\n * @example\\n * // No clicks\\n * sound: freq(\\"63.2388\\").s(\\"sine\\").orbit(2).gain(4)\\n * duckerWithoutClick: s(\\"bd*4\\").duckorbit(2).duckattack(0.3).duckonset(0.01).postgain(0)\\n * @example\\n * // Rhythmic\\n * noise: s(\\"pink\\").distort(\\"2:1\\").orbit(4) // used rhythmically with 0.3 onset below\\n * hhat: s(\\"hh*16\\").orbit(7)\\n * ducker: s(\\"bd*4\\").bank(\\"tr909\\").duckorbit(\\"4:7\\").duckonset(\\"0.3:0.003\\").duckattack(0.25)\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1076,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>The time required for the ducked signal(s) to reach their lowest volume.\\nCan be used to prevent clicking or for creative rhythmic effects.</p>\\n<p>Can vary across orbits with the ':' mininotation, e.g. <code>duckonset("0:0.003")</code>.\\nNote: this requires first applying the effect to multiple orbits with e.g. <code>duckorbit("2:3")</code>.</p>","name":"duckonset","tags":["amplitude","envelope","orbit","superdough"],"synonyms_text":"duckons","synonyms":["duckons"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>The onset time in seconds</p>","name":"time"}],"examples":["// Clicks\\nsound: freq(\\"63.2388\\").s(\\"sine\\").orbit(2).gain(4)\\nduckerWithClick: s(\\"bd*4\\").duckorbit(2).duckattack(0.3).duckonset(0).postgain(0)","// No clicks\\nsound: freq(\\"63.2388\\").s(\\"sine\\").orbit(2).gain(4)\\nduckerWithoutClick: s(\\"bd*4\\").duckorbit(2).duckattack(0.3).duckonset(0.01).postgain(0)","// Rhythmic\\nnoise: s(\\"pink\\").distort(\\"2:1\\").orbit(4) // used rhythmically with 0.3 onset below\\nhhat: s(\\"hh*16\\").orbit(7)\\nducker: s(\\"bd*4\\").bank(\\"tr909\\").duckorbit(\\"4:7\\").duckonset(\\"0.3:0.003\\").duckattack(0.25)"],"longname":"duckonset","kind":"member","scope":"global"},{"comment":"/**\\n * The time required for the ducked signal(s) to return to their normal volume.\\n *\\n * Can vary across orbits with the ':' mininotation, e.g. \`duckonset(\\"0:0.003\\")\`.\\n * Note: this requires first applying the effect to multiple orbits with e.g. \`duckorbit(\\"2:3\\")\`.\\n *\\n * @name duckattack\\n * @tags amplitude, envelope, orbit, superdough\\n * @synonyms duckatt, datt\\n *\\n * @param {number | Pattern} time The attack time in seconds\\n * @example\\n * sound: n(run(8)).scale(\\"c:minor\\").s(\\"sawtooth\\").delay(.7).orbit(2)\\n * ducker: s(\\"bd:4!4\\").beat(\\"0,4,8,11,14\\",16).duckorbit(2).duckattack(\\"<0.2 0 0.4>\\").duckdepth(1)\\n * @example\\n * moreduck: n(run(8)).scale(\\"c:minor\\").s(\\"sawtooth\\").delay(.7).orbit(2)\\n * lessduck: s(\\"hh*16\\").orbit(5)\\n * ducker: s(\\"bd:4!4\\").beat(\\"0,4,8,11,14\\",16).duckorbit(\\"2:5\\").duckattack(\\"0.4:0.1\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1105,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>The time required for the ducked signal(s) to return to their normal volume.</p>\\n<p>Can vary across orbits with the ':' mininotation, e.g. <code>duckonset("0:0.003")</code>.\\nNote: this requires first applying the effect to multiple orbits with e.g. <code>duckorbit("2:3")</code>.</p>","name":"duckattack","tags":["amplitude","envelope","orbit","superdough"],"synonyms_text":"duckatt, datt","synonyms":["duckatt","datt"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>The attack time in seconds</p>","name":"time"}],"examples":["sound: n(run(8)).scale(\\"c:minor\\").s(\\"sawtooth\\").delay(.7).orbit(2)\\nducker: s(\\"bd:4!4\\").beat(\\"0,4,8,11,14\\",16).duckorbit(2).duckattack(\\"<0.2 0 0.4>\\").duckdepth(1)","moreduck: n(run(8)).scale(\\"c:minor\\").s(\\"sawtooth\\").delay(.7).orbit(2)\\nlessduck: s(\\"hh*16\\").orbit(5)\\nducker: s(\\"bd:4!4\\").beat(\\"0,4,8,11,14\\",16).duckorbit(\\"2:5\\").duckattack(\\"0.4:0.1\\")"],"longname":"duckattack","kind":"member","scope":"global"},{"comment":"/**\\n * Create byte beats with custom expressions\\n *\\n * @name byteBeatExpression\\n * @synonyms bbexpr, bb\\n * @tags superdough\\n *\\n * @param {number | Pattern} byteBeatExpression bitwise expression for creating bytebeat\\n * @example\\n * s(\\"bytebeat\\").bbexpr('t*(t>>15^t>>66)')\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1127,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Create byte beats with custom expressions</p>","name":"byteBeatExpression","synonyms_text":"bbexpr, bb","synonyms":["bbexpr","bb"],"tags":["superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>bitwise expression for creating bytebeat</p>","name":"byteBeatExpression"}],"examples":["s(\\"bytebeat\\").bbexpr('t*(t>>15^t>>66)')"],"longname":"byteBeatExpression","kind":"member","scope":"global"},{"comment":"/**\\n * Create byte beats with custom expressions\\n *\\n * @name byteBeatStartTime\\n * @synonyms bbst\\n * @tags superdough\\n *\\n * @param {number | Pattern} byteBeatStartTime in samples (t)\\n * @example\\n * note(\\"c3!8\\".add(\\"{0 0 12 0 7 5 3}%8\\")).s(\\"bytebeat:5\\").bbst(\\"<3 1>\\".mul(10000))._scope()\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1141,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Create byte beats with custom expressions</p>","name":"byteBeatStartTime","synonyms_text":"bbst","synonyms":["bbst"],"tags":["superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>in samples (t)</p>","name":"byteBeatStartTime"}],"examples":["note(\\"c3!8\\".add(\\"{0 0 12 0 7 5 3}%8\\")).s(\\"bytebeat:5\\").bbst(\\"<3 1>\\".mul(10000))._scope()"],"longname":"byteBeatStartTime","kind":"member","scope":"global"},{"comment":"/**\\n * Allows you to set the output channels on the interface\\n *\\n * @name channels\\n * @tags external_io, superdough\\n * @synonyms ch\\n *\\n * @param {number | Pattern} channels pattern the output channels\\n * @example\\n * note(\\"e a d b g\\").channels(\\"3:4\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1155,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Allows you to set the output channels on the interface</p>","name":"channels","tags":["external_io","superdough"],"synonyms_text":"ch","synonyms":["ch"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>pattern the output channels</p>","name":"channels"}],"examples":["note(\\"e a d b g\\").channels(\\"3:4\\")"],"longname":"channels","kind":"member","scope":"global"},{"comment":"/**\\n * Controls the pulsewidth of the pulse oscillator\\n *\\n * @name pw\\n * @tags superdough\\n * @param {number | Pattern} pulsewidth\\n * @example\\n * note(\\"{f a c e}%16\\").s(\\"pulse\\").pw(\\".8:1:.2\\")\\n * @example\\n * n(run(8)).scale(\\"D:pentatonic\\").s(\\"pulse\\").pw(\\"0 .75 .5 1\\")\\n */","meta":{"filename":"controls.mjs","lineno":1169,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Controls the pulsewidth of the pulse oscillator</p>","name":"pw","tags":["superdough"],"params":[{"type":{"names":["number","Pattern"]},"name":"pulsewidth"}],"examples":["note(\\"{f a c e}%16\\").s(\\"pulse\\").pw(\\".8:1:.2\\")","n(run(8)).scale(\\"D:pentatonic\\").s(\\"pulse\\").pw(\\"0 .75 .5 1\\")"],"longname":"pw","kind":"member","scope":"global"},{"comment":"/**\\n * Controls the lfo rate for the pulsewidth of the pulse oscillator\\n *\\n * @name pwrate\\n * @synonyms pwr\\n * @tags superdough, lfo\\n * @param {number | Pattern} rate\\n * @example\\n * n(run(8)).scale(\\"D:pentatonic\\").s(\\"pulse\\").pw(\\"0.5\\").pwrate(\\"<5 .1 25>\\").pwsweep(\\"<0.3 .8>\\")\\n\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1182,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Controls the lfo rate for the pulsewidth of the pulse oscillator</p>","name":"pwrate","synonyms_text":"pwr","synonyms":["pwr"],"tags":["superdough","lfo"],"params":[{"type":{"names":["number","Pattern"]},"name":"rate"}],"examples":["n(run(8)).scale(\\"D:pentatonic\\").s(\\"pulse\\").pw(\\"0.5\\").pwrate(\\"<5 .1 25>\\").pwsweep(\\"<0.3 .8>\\")"],"longname":"pwrate","kind":"member","scope":"global"},{"comment":"/**\\n * Controls the lfo sweep for the pulsewidth of the pulse oscillator\\n *\\n * @name pwsweep\\n * @synonyms pws\\n * @tags superdough, lfo\\n * @param {number | Pattern} sweep\\n * @example\\n * n(run(8)).scale(\\"D:pentatonic\\").s(\\"pulse\\").pw(\\"0.5\\").pwrate(\\"<5 .1 25>\\").pwsweep(\\"<0.3 .8>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1196,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Controls the lfo sweep for the pulsewidth of the pulse oscillator</p>","name":"pwsweep","synonyms_text":"pws","synonyms":["pws"],"tags":["superdough","lfo"],"params":[{"type":{"names":["number","Pattern"]},"name":"sweep"}],"examples":["n(run(8)).scale(\\"D:pentatonic\\").s(\\"pulse\\").pw(\\"0.5\\").pwrate(\\"<5 .1 25>\\").pwsweep(\\"<0.3 .8>\\")"],"longname":"pwsweep","kind":"member","scope":"global"},{"comment":"/**\\n * Phaser audio effect that approximates popular guitar pedals.\\n *\\n * @name phaser\\n * @tags superdough\\n * @synonyms ph\\n * @param {number | Pattern} speed speed of modulation\\n * @example\\n * n(run(8)).scale(\\"D:pentatonic\\").s(\\"sawtooth\\").release(0.5)\\n * .phaser(\\"<1 2 4 8>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1209,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Phaser audio effect that approximates popular guitar pedals.</p>","name":"phaser","tags":["superdough"],"synonyms_text":"ph","synonyms":["ph"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>speed of modulation</p>","name":"speed"}],"examples":["n(run(8)).scale(\\"D:pentatonic\\").s(\\"sawtooth\\").release(0.5)\\n.phaser(\\"<1 2 4 8>\\")"],"longname":"phaser","kind":"member","scope":"global"},{"comment":"/**\\n * The frequency sweep range of the lfo for the phaser effect. Defaults to 2000\\n *\\n * @name phasersweep\\n * @tags superdough, lfo\\n * @synonyms phs\\n * @param {number | Pattern} phasersweep most useful values are between 0 and 4000\\n * @example\\n * n(run(8)).scale(\\"D:pentatonic\\").s(\\"sawtooth\\").release(0.5)\\n * .phaser(2).phasersweep(\\"<800 2000 4000>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1227,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>The frequency sweep range of the lfo for the phaser effect. Defaults to 2000</p>","name":"phasersweep","tags":["superdough","lfo"],"synonyms_text":"phs","synonyms":["phs"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>most useful values are between 0 and 4000</p>","name":"phasersweep"}],"examples":["n(run(8)).scale(\\"D:pentatonic\\").s(\\"sawtooth\\").release(0.5)\\n.phaser(2).phasersweep(\\"<800 2000 4000>\\")"],"longname":"phasersweep","kind":"member","scope":"global"},{"comment":"/**\\n * The center frequency of the phaser in HZ. Defaults to 1000\\n *\\n * @name phasercenter\\n * @tags superdough\\n * @synonyms phc\\n * @param {number | Pattern} centerfrequency in HZ\\n * @example\\n * n(run(8)).scale(\\"D:pentatonic\\").s(\\"sawtooth\\").release(0.5)\\n * .phaser(2).phasercenter(\\"<800 2000 4000>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1241,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>The center frequency of the phaser in HZ. Defaults to 1000</p>","name":"phasercenter","tags":["superdough"],"synonyms_text":"phc","synonyms":["phc"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>in HZ</p>","name":"centerfrequency"}],"examples":["n(run(8)).scale(\\"D:pentatonic\\").s(\\"sawtooth\\").release(0.5)\\n.phaser(2).phasercenter(\\"<800 2000 4000>\\")"],"longname":"phasercenter","kind":"member","scope":"global"},{"comment":"/**\\n * The amount the signal is affected by the phaser effect. Defaults to 0.75\\n *\\n * @name phaserdepth\\n * @tags superdough, superdirt\\n * @synonyms phd, phasdp\\n * @param {number | Pattern} depth number between 0 and 1\\n * @example\\n * n(run(8)).scale(\\"D:pentatonic\\").s(\\"sawtooth\\").release(0.5)\\n * .phaser(2).phaserdepth(\\"<0 .5 .75 1>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1256,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>The amount the signal is affected by the phaser effect. Defaults to 0.75</p>","name":"phaserdepth","tags":["superdough","superdirt"],"synonyms_text":"phd, phasdp","synonyms":["phd","phasdp"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>number between 0 and 1</p>","name":"depth"}],"examples":["n(run(8)).scale(\\"D:pentatonic\\").s(\\"sawtooth\\").release(0.5)\\n.phaser(2).phaserdepth(\\"<0 .5 .75 1>\\")"],"longname":"phaserdepth","kind":"member","scope":"global"},{"comment":"/**\\n * Choose the channel the pattern is sent to\\n *\\n * @name channel\\n * @tags superdough\\n * @param {number | Pattern} channel channel number\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1271,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Choose the channel the pattern is sent to</p>","name":"channel","tags":["superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>channel number</p>","name":"channel"}],"longname":"channel","kind":"member","scope":"global"},{"comment":"/**\\n * In the style of classic drum-machines, \`cut\` will stop a playing sample as soon as another samples with in same cutgroup is to be played. An example would be an open hi-hat followed by a closed one, essentially muting the open.\\n *\\n * @name cut\\n * @tags superdough\\n * @param {number | Pattern} group cut group number\\n * @example\\n * s(\\"[oh hh]*4\\").cut(1)\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1280,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>In the style of classic drum-machines, <code>cut</code> will stop a playing sample as soon as another samples with in same cutgroup is to be played. An example would be an open hi-hat followed by a closed one, essentially muting the open.</p>","name":"cut","tags":["superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>cut group number</p>","name":"group"}],"examples":["s(\\"[oh hh]*4\\").cut(1)"],"longname":"cut","kind":"member","scope":"global"},{"comment":"/**\\n * Applies the cutoff frequency of the **l**ow-**p**ass **f**ilter.\\n *\\n * When using mininotation, you can also optionally add the 'lpq' parameter, separated by ':'.\\n *\\n * @name lpf\\n * @tags filter, superdough, supradough\\n * @param {number | Pattern} frequency audible between 0 and 20000\\n * @synonyms cutoff, ctf, lp\\n * @example\\n * s(\\"bd sd [~ bd] sd,hh*6\\").lpf(\\"<4000 2000 1000 500 200 100>\\")\\n * @example\\n * s(\\"bd*16\\").lpf(\\"1000:0 1000:10 1000:20 1000:30\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1291,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Applies the cutoff frequency of the <strong>l</strong>ow-<strong>p</strong>ass <strong>f</strong>ilter.</p>\\n<p>When using mininotation, you can also optionally add the 'lpq' parameter, separated by ':'.</p>","name":"lpf","tags":["filter","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>audible between 0 and 20000</p>","name":"frequency"}],"synonyms_text":"cutoff, ctf, lp","synonyms":["cutoff","ctf","lp"],"examples":["s(\\"bd sd [~ bd] sd,hh*6\\").lpf(\\"<4000 2000 1000 500 200 100>\\")","s(\\"bd*16\\").lpf(\\"1000:0 1000:10 1000:20 1000:30\\")"],"longname":"lpf","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the lowpass filter envelope modulation depth.\\n * @name lpenv\\n * @tags filter, envelope, superdough, supradough\\n * @param {number | Pattern} modulation depth of the lowpass filter envelope between 0 and _n_\\n * @synonyms lpe\\n * @example\\n * note(\\"c2 e2 f2 g2\\")\\n * .sound('sawtooth')\\n * .lpf(300)\\n * .lpa(.5)\\n * .lpenv(\\"<4 2 1 0 -1 -2 -4>/4\\")\\n */","meta":{"filename":"controls.mjs","lineno":1308,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the lowpass filter envelope modulation depth.</p>","name":"lpenv","tags":["filter","envelope","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>depth of the lowpass filter envelope between 0 and <em>n</em></p>","name":"modulation"}],"synonyms_text":"lpe","synonyms":["lpe"],"examples":["note(\\"c2 e2 f2 g2\\")\\n.sound('sawtooth')\\n.lpf(300)\\n.lpa(.5)\\n.lpenv(\\"<4 2 1 0 -1 -2 -4>/4\\")"],"longname":"lpenv","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the highpass filter envelope modulation depth.\\n * @name hpenv\\n * @tags filter, envelope, superdough, supradough\\n * @param {number | Pattern} modulation depth of the highpass filter envelope between 0 and _n_\\n * @synonyms hpe\\n * @example\\n * note(\\"c2 e2 f2 g2\\")\\n * .sound('sawtooth')\\n * .hpf(500)\\n * .hpa(.5)\\n * .hpenv(\\"<4 2 1 0 -1 -2 -4>/4\\")\\n */","meta":{"filename":"controls.mjs","lineno":1322,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the highpass filter envelope modulation depth.</p>","name":"hpenv","tags":["filter","envelope","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>depth of the highpass filter envelope between 0 and <em>n</em></p>","name":"modulation"}],"synonyms_text":"hpe","synonyms":["hpe"],"examples":["note(\\"c2 e2 f2 g2\\")\\n.sound('sawtooth')\\n.hpf(500)\\n.hpa(.5)\\n.hpenv(\\"<4 2 1 0 -1 -2 -4>/4\\")"],"longname":"hpenv","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the bandpass filter envelope modulation depth.\\n * @name bpenv\\n * @tags filter, envelope, superdough, supradough\\n * @param {number | Pattern} modulation depth of the bandpass filter envelope between 0 and _n_\\n * @synonyms bpe\\n * @example\\n * note(\\"c2 e2 f2 g2\\")\\n * .sound('sawtooth')\\n * .bpf(500)\\n * .bpa(.5)\\n * .bpenv(\\"<4 2 1 0 -1 -2 -4>/4\\")\\n */","meta":{"filename":"controls.mjs","lineno":1336,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the bandpass filter envelope modulation depth.</p>","name":"bpenv","tags":["filter","envelope","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>depth of the bandpass filter envelope between 0 and <em>n</em></p>","name":"modulation"}],"synonyms_text":"bpe","synonyms":["bpe"],"examples":["note(\\"c2 e2 f2 g2\\")\\n.sound('sawtooth')\\n.bpf(500)\\n.bpa(.5)\\n.bpenv(\\"<4 2 1 0 -1 -2 -4>/4\\")"],"longname":"bpenv","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the attack duration for the lowpass filter envelope.\\n * @name lpattack\\n * @tags filter, envelope, superdough, supradough\\n * @param {number | Pattern} attack time of the filter envelope\\n * @synonyms lpa\\n * @example\\n * note(\\"c2 e2 f2 g2\\")\\n * .sound('sawtooth')\\n * .lpf(300)\\n * .lpa(\\"<.5 .25 .1 .01>/4\\")\\n * .lpenv(4)\\n */","meta":{"filename":"controls.mjs","lineno":1350,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the attack duration for the lowpass filter envelope.</p>","name":"lpattack","tags":["filter","envelope","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>time of the filter envelope</p>","name":"attack"}],"synonyms_text":"lpa","synonyms":["lpa"],"examples":["note(\\"c2 e2 f2 g2\\")\\n.sound('sawtooth')\\n.lpf(300)\\n.lpa(\\"<.5 .25 .1 .01>/4\\")\\n.lpenv(4)"],"longname":"lpattack","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the attack duration for the highpass filter envelope.\\n * @name hpattack\\n * @tags filter, envelope, superdough, supradough\\n * @param {number | Pattern} attack time of the highpass filter envelope\\n * @synonyms hpa\\n * @example\\n * note(\\"c2 e2 f2 g2\\")\\n * .sound('sawtooth')\\n * .hpf(500)\\n * .hpa(\\"<.5 .25 .1 .01>/4\\")\\n * .hpenv(4)\\n */","meta":{"filename":"controls.mjs","lineno":1364,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the attack duration for the highpass filter envelope.</p>","name":"hpattack","tags":["filter","envelope","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>time of the highpass filter envelope</p>","name":"attack"}],"synonyms_text":"hpa","synonyms":["hpa"],"examples":["note(\\"c2 e2 f2 g2\\")\\n.sound('sawtooth')\\n.hpf(500)\\n.hpa(\\"<.5 .25 .1 .01>/4\\")\\n.hpenv(4)"],"longname":"hpattack","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the attack duration for the bandpass filter envelope.\\n * @name bpattack\\n * @tags filter, envelope, superdough, supradough\\n * @param {number | Pattern} attack time of the bandpass filter envelope\\n * @synonyms bpa\\n * @example\\n * note(\\"c2 e2 f2 g2\\")\\n * .sound('sawtooth')\\n * .bpf(500)\\n * .bpa(\\"<.5 .25 .1 .01>/4\\")\\n * .bpenv(4)\\n */","meta":{"filename":"controls.mjs","lineno":1378,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the attack duration for the bandpass filter envelope.</p>","name":"bpattack","tags":["filter","envelope","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>time of the bandpass filter envelope</p>","name":"attack"}],"synonyms_text":"bpa","synonyms":["bpa"],"examples":["note(\\"c2 e2 f2 g2\\")\\n.sound('sawtooth')\\n.bpf(500)\\n.bpa(\\"<.5 .25 .1 .01>/4\\")\\n.bpenv(4)"],"longname":"bpattack","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the decay duration for the lowpass filter envelope.\\n * @name lpdecay\\n * @tags filter, envelope, superdough, supradough\\n * @param {number | Pattern} decay time of the filter envelope\\n * @synonyms lpd\\n * @example\\n * note(\\"c2 e2 f2 g2\\")\\n * .sound('sawtooth')\\n * .lpf(300)\\n * .lpd(\\"<.5 .25 .1 0>/4\\")\\n * .lpenv(4)\\n */","meta":{"filename":"controls.mjs","lineno":1392,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the decay duration for the lowpass filter envelope.</p>","name":"lpdecay","tags":["filter","envelope","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>time of the filter envelope</p>","name":"decay"}],"synonyms_text":"lpd","synonyms":["lpd"],"examples":["note(\\"c2 e2 f2 g2\\")\\n.sound('sawtooth')\\n.lpf(300)\\n.lpd(\\"<.5 .25 .1 0>/4\\")\\n.lpenv(4)"],"longname":"lpdecay","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the decay duration for the highpass filter envelope.\\n * @name hpdecay\\n * @tags filter, envelope, superdough, supradough\\n * @param {number | Pattern} decay time of the highpass filter envelope\\n * @synonyms hpd\\n * @example\\n * note(\\"c2 e2 f2 g2\\")\\n * .sound('sawtooth')\\n * .hpf(500)\\n * .hpd(\\"<.5 .25 .1 0>/4\\")\\n * .hps(0.2)\\n * .hpenv(4)\\n */","meta":{"filename":"controls.mjs","lineno":1406,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the decay duration for the highpass filter envelope.</p>","name":"hpdecay","tags":["filter","envelope","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>time of the highpass filter envelope</p>","name":"decay"}],"synonyms_text":"hpd","synonyms":["hpd"],"examples":["note(\\"c2 e2 f2 g2\\")\\n.sound('sawtooth')\\n.hpf(500)\\n.hpd(\\"<.5 .25 .1 0>/4\\")\\n.hps(0.2)\\n.hpenv(4)"],"longname":"hpdecay","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the decay duration for the bandpass filter envelope.\\n * @name bpdecay\\n * @tags filter, envelope, superdough, supradough\\n * @param {number | Pattern} decay time of the bandpass filter envelope\\n * @synonyms bpd\\n * @example\\n * note(\\"c2 e2 f2 g2\\")\\n * .sound('sawtooth')\\n * .bpf(500)\\n * .bpd(\\"<.5 .25 .1 0>/4\\")\\n * .bps(0.2)\\n * .bpenv(4)\\n */","meta":{"filename":"controls.mjs","lineno":1421,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the decay duration for the bandpass filter envelope.</p>","name":"bpdecay","tags":["filter","envelope","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>time of the bandpass filter envelope</p>","name":"decay"}],"synonyms_text":"bpd","synonyms":["bpd"],"examples":["note(\\"c2 e2 f2 g2\\")\\n.sound('sawtooth')\\n.bpf(500)\\n.bpd(\\"<.5 .25 .1 0>/4\\")\\n.bps(0.2)\\n.bpenv(4)"],"longname":"bpdecay","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the sustain amplitude for the lowpass filter envelope.\\n * @name lpsustain\\n * @tags filter, envelope, superdough, supradough\\n * @param {number | Pattern} sustain amplitude of the lowpass filter envelope\\n * @synonyms lps\\n * @example\\n * note(\\"c2 e2 f2 g2\\")\\n * .sound('sawtooth')\\n * .lpf(300)\\n * .lpd(.5)\\n * .lps(\\"<0 .25 .5 1>/4\\")\\n * .lpenv(4)\\n */","meta":{"filename":"controls.mjs","lineno":1436,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the sustain amplitude for the lowpass filter envelope.</p>","name":"lpsustain","tags":["filter","envelope","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>amplitude of the lowpass filter envelope</p>","name":"sustain"}],"synonyms_text":"lps","synonyms":["lps"],"examples":["note(\\"c2 e2 f2 g2\\")\\n.sound('sawtooth')\\n.lpf(300)\\n.lpd(.5)\\n.lps(\\"<0 .25 .5 1>/4\\")\\n.lpenv(4)"],"longname":"lpsustain","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the sustain amplitude for the highpass filter envelope.\\n * @name hpsustain\\n * @tags filter, envelope, superdough, supradough\\n * @param {number | Pattern} sustain amplitude of the highpass filter envelope\\n * @synonyms hps\\n * @example\\n * note(\\"c2 e2 f2 g2\\")\\n * .sound('sawtooth')\\n * .hpf(500)\\n * .hpd(.5)\\n * .hps(\\"<0 .25 .5 1>/4\\")\\n * .hpenv(4)\\n */","meta":{"filename":"controls.mjs","lineno":1451,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the sustain amplitude for the highpass filter envelope.</p>","name":"hpsustain","tags":["filter","envelope","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>amplitude of the highpass filter envelope</p>","name":"sustain"}],"synonyms_text":"hps","synonyms":["hps"],"examples":["note(\\"c2 e2 f2 g2\\")\\n.sound('sawtooth')\\n.hpf(500)\\n.hpd(.5)\\n.hps(\\"<0 .25 .5 1>/4\\")\\n.hpenv(4)"],"longname":"hpsustain","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the sustain amplitude for the bandpass filter envelope.\\n * @name bpsustain\\n * @tags filter, envelope, superdough, supradough\\n * @param {number | Pattern} sustain amplitude of the bandpass filter envelope\\n * @synonyms bps\\n * @example\\n * note(\\"c2 e2 f2 g2\\")\\n * .sound('sawtooth')\\n * .bpf(500)\\n * .bpd(.5)\\n * .bps(\\"<0 .25 .5 1>/4\\")\\n * .bpenv(4)\\n */","meta":{"filename":"controls.mjs","lineno":1466,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the sustain amplitude for the bandpass filter envelope.</p>","name":"bpsustain","tags":["filter","envelope","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>amplitude of the bandpass filter envelope</p>","name":"sustain"}],"synonyms_text":"bps","synonyms":["bps"],"examples":["note(\\"c2 e2 f2 g2\\")\\n.sound('sawtooth')\\n.bpf(500)\\n.bpd(.5)\\n.bps(\\"<0 .25 .5 1>/4\\")\\n.bpenv(4)"],"longname":"bpsustain","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the release time for the lowpass filter envelope.\\n * @name lprelease\\n * @tags filter, envelope, superdough, supradough\\n * @param {number | Pattern} release time of the filter envelope\\n * @synonyms lpr\\n * @example\\n * note(\\"c2 e2 f2 g2\\")\\n * .sound('sawtooth')\\n * .clip(.5)\\n * .lpf(300)\\n * .lpenv(4)\\n * .lpr(\\"<.5 .25 .1 0>/4\\")\\n * .release(.5)\\n */","meta":{"filename":"controls.mjs","lineno":1481,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the release time for the lowpass filter envelope.</p>","name":"lprelease","tags":["filter","envelope","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>time of the filter envelope</p>","name":"release"}],"synonyms_text":"lpr","synonyms":["lpr"],"examples":["note(\\"c2 e2 f2 g2\\")\\n.sound('sawtooth')\\n.clip(.5)\\n.lpf(300)\\n.lpenv(4)\\n.lpr(\\"<.5 .25 .1 0>/4\\")\\n.release(.5)"],"longname":"lprelease","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the release time for the highpass filter envelope.\\n * @name hprelease\\n * @tags filter, envelope, superdough, supradough\\n * @param {number | Pattern} release time of the highpass filter envelope\\n * @synonyms hpr\\n * @example\\n * note(\\"c2 e2 f2 g2\\")\\n * .sound('sawtooth')\\n * .clip(.5)\\n * .hpf(500)\\n * .hpenv(4)\\n * .hpr(\\"<.5 .25 .1 0>/4\\")\\n * .release(.5)\\n */","meta":{"filename":"controls.mjs","lineno":1497,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the release time for the highpass filter envelope.</p>","name":"hprelease","tags":["filter","envelope","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>time of the highpass filter envelope</p>","name":"release"}],"synonyms_text":"hpr","synonyms":["hpr"],"examples":["note(\\"c2 e2 f2 g2\\")\\n.sound('sawtooth')\\n.clip(.5)\\n.hpf(500)\\n.hpenv(4)\\n.hpr(\\"<.5 .25 .1 0>/4\\")\\n.release(.5)"],"longname":"hprelease","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the release time for the bandpass filter envelope.\\n * @name bprelease\\n * @tags filter, envelope, superdough, supradough\\n * @param {number | Pattern} release time of the bandpass filter envelope\\n * @synonyms bpr\\n * @example\\n * note(\\"c2 e2 f2 g2\\")\\n * .sound('sawtooth')\\n * .clip(.5)\\n * .bpf(500)\\n * .bpenv(4)\\n * .bpr(\\"<.5 .25 .1 0>/4\\")\\n * .release(.5)\\n */","meta":{"filename":"controls.mjs","lineno":1513,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the release time for the bandpass filter envelope.</p>","name":"bprelease","tags":["filter","envelope","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>time of the bandpass filter envelope</p>","name":"release"}],"synonyms_text":"bpr","synonyms":["bpr"],"examples":["note(\\"c2 e2 f2 g2\\")\\n.sound('sawtooth')\\n.clip(.5)\\n.bpf(500)\\n.bpenv(4)\\n.bpr(\\"<.5 .25 .1 0>/4\\")\\n.release(.5)"],"longname":"bprelease","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the filter type. The ladder filter is more aggressive. More types might be added in the future.\\n * @name ftype\\n * @tags filter, superdough\\n * @param {number | Pattern} type 12db (0), ladder (1), or 24db (2)\\n * @example\\n * note(\\"{f g g c d a a#}%8\\").s(\\"sawtooth\\").lpenv(4).lpf(500).ftype(\\"<0 1 2>\\").lpq(1)\\n * @example\\n * note(\\"c f g g a c d4\\").fast(2)\\n * .sound('sawtooth')\\n * .lpf(200).fanchor(0)\\n * .lpenv(3).lpq(1)\\n * .ftype(\\"<ladder 12db 24db>\\")\\n */","meta":{"filename":"controls.mjs","lineno":1529,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the filter type. The ladder filter is more aggressive. More types might be added in the future.</p>","name":"ftype","tags":["filter","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>12db (0), ladder (1), or 24db (2)</p>","name":"type"}],"examples":["note(\\"{f g g c d a a#}%8\\").s(\\"sawtooth\\").lpenv(4).lpf(500).ftype(\\"<0 1 2>\\").lpq(1)","note(\\"c f g g a c d4\\").fast(2)\\n.sound('sawtooth')\\n.lpf(200).fanchor(0)\\n.lpenv(3).lpq(1)\\n.ftype(\\"<ladder 12db 24db>\\")"],"longname":"ftype","kind":"member","scope":"global"},{"comment":"/**\\n * controls the center of the filter envelope. 0 is unipolar positive, .5 is bipolar, 1 is unipolar negative\\n * @name fanchor\\n * @tags filter, envelope, superdough\\n * @param {number | Pattern} center 0 to 1\\n * @example\\n * note(\\"{f g g c d a a#}%8\\").s(\\"sawtooth\\").lpf(\\"{1000}%2\\")\\n * .lpenv(8).fanchor(\\"<0 .5 1>\\")\\n */","meta":{"filename":"controls.mjs","lineno":1545,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>controls the center of the filter envelope. 0 is unipolar positive, .5 is bipolar, 1 is unipolar negative</p>","name":"fanchor","tags":["filter","envelope","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>0 to 1</p>","name":"center"}],"examples":["note(\\"{f g g c d a a#}%8\\").s(\\"sawtooth\\").lpf(\\"{1000}%2\\")\\n.lpenv(8).fanchor(\\"<0 .5 1>\\")"],"longname":"fanchor","kind":"member","scope":"global"},{"comment":"/**\\n * Applies the cutoff frequency of the **h**igh-**p**ass **f**ilter.\\n *\\n * When using mininotation, you can also optionally add the 'hpq' parameter, separated by ':'.\\n *\\n * @name hpf\\n * @tags filter, superdough, supradough\\n * @param {number | Pattern} frequency audible between 0 and 20000\\n * @synonyms hp, hcutoff\\n * @example\\n * s(\\"bd sd [~ bd] sd,hh*8\\").hpf(\\"<4000 2000 1000 500 200 100>\\")\\n * @example\\n * s(\\"bd sd [~ bd] sd,hh*8\\").hpf(\\"<2000 2000:25>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1555,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Applies the cutoff frequency of the <strong>h</strong>igh-<strong>p</strong>ass <strong>f</strong>ilter.</p>\\n<p>When using mininotation, you can also optionally add the 'hpq' parameter, separated by ':'.</p>","name":"hpf","tags":["filter","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>audible between 0 and 20000</p>","name":"frequency"}],"synonyms_text":"hp, hcutoff","synonyms":["hp","hcutoff"],"examples":["s(\\"bd sd [~ bd] sd,hh*8\\").hpf(\\"<4000 2000 1000 500 200 100>\\")","s(\\"bd sd [~ bd] sd,hh*8\\").hpf(\\"<2000 2000:25>\\")"],"longname":"hpf","kind":"member","scope":"global"},{"comment":"/**\\n * Rate of the LFO for the lowpass filter\\n *\\n * @name lprate\\n * @tags filter, lfo, superdough\\n * @param {number | Pattern} rate rate in hertz\\n * @example\\n * note(\\"<c c c# c c c4>*16\\").s(\\"sawtooth\\").lpf(600).lprate(\\"<4 8 2 1>\\")\\n */","meta":{"filename":"controls.mjs","lineno":1573,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Rate of the LFO for the lowpass filter</p>","name":"lprate","tags":["filter","lfo","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>rate in hertz</p>","name":"rate"}],"examples":["note(\\"<c c c# c c c4>*16\\").s(\\"sawtooth\\").lpf(600).lprate(\\"<4 8 2 1>\\")"],"longname":"lprate","kind":"member","scope":"global"},{"comment":"/**\\n * Cycle-synced rate of the LFO for the lowpass filter\\n *\\n * @name lpsync\\n * @tags filter, lfo, superdough\\n * @param {number | Pattern} rate rate in cycles\\n * @example\\n * note(\\"<c c c# c c c4>*16\\").s(\\"sawtooth\\").lpf(600).lpsync(\\"<4 8 2 1>\\")\\n */","meta":{"filename":"controls.mjs","lineno":1584,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Cycle-synced rate of the LFO for the lowpass filter</p>","name":"lpsync","tags":["filter","lfo","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>rate in cycles</p>","name":"rate"}],"examples":["note(\\"<c c c# c c c4>*16\\").s(\\"sawtooth\\").lpf(600).lpsync(\\"<4 8 2 1>\\")"],"longname":"lpsync","kind":"member","scope":"global"},{"comment":"/**\\n * Depth of the LFO for the lowpass filter\\n *\\n * @name lpdepth\\n * @tags filter, lfo, superdough\\n * @param {number | Pattern} depth depth of modulation\\n * @example\\n * note(\\"<c c c# c c c4>*16\\").s(\\"sawtooth\\").lpf(600).lpdepth(\\"<1 .5 1.8 0>\\")\\n */","meta":{"filename":"controls.mjs","lineno":1595,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Depth of the LFO for the lowpass filter</p>","name":"lpdepth","tags":["filter","lfo","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>depth of modulation</p>","name":"depth"}],"examples":["note(\\"<c c c# c c c4>*16\\").s(\\"sawtooth\\").lpf(600).lpdepth(\\"<1 .5 1.8 0>\\")"],"longname":"lpdepth","kind":"member","scope":"global"},{"comment":"/**\\n * Depth of the LFO for the lowpass filter, in HZ\\n *\\n * @name lpdepthfrequency\\n * @tags filter, lfo, superdough\\n * @synonyms lpdepthfreq\\n * @param {number | Pattern} depth depth of modulation\\n * @example\\n * note(\\"<c c c# c c c4>*16\\").s(\\"sawtooth\\").lpf(600).lpdepthfrequency(\\"<200 500 100 0>\\")\\n */","meta":{"filename":"controls.mjs","lineno":1606,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Depth of the LFO for the lowpass filter, in HZ</p>","name":"lpdepthfrequency","tags":["filter","lfo","superdough"],"synonyms_text":"lpdepthfreq","synonyms":["lpdepthfreq"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>depth of modulation</p>","name":"depth"}],"examples":["note(\\"<c c c# c c c4>*16\\").s(\\"sawtooth\\").lpf(600).lpdepthfrequency(\\"<200 500 100 0>\\")"],"longname":"lpdepthfrequency","kind":"member","scope":"global"},{"comment":"/**\\n * Shape of the LFO for the lowpass filter\\n *\\n * @name lpshape\\n * @tags filter, lfo, superdough\\n * @param {number | Pattern} shape Shape of the lfo (0, 1, 2, ..)\\n */","meta":{"filename":"controls.mjs","lineno":1619,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Shape of the LFO for the lowpass filter</p>","name":"lpshape","tags":["filter","lfo","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>Shape of the lfo (0, 1, 2, ..)</p>","name":"shape"}],"longname":"lpshape","kind":"member","scope":"global"},{"comment":"/**\\n * DC offset of the LFO for the lowpass filter\\n *\\n * @name lpdc\\n * @tags filter, lfo, superdough\\n * @param {number | Pattern} dcoffset dc offset. set to 0 for unipolar\\n */","meta":{"filename":"controls.mjs","lineno":1628,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>DC offset of the LFO for the lowpass filter</p>","name":"lpdc","tags":["filter","lfo","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>dc offset. set to 0 for unipolar</p>","name":"dcoffset"}],"longname":"lpdc","kind":"member","scope":"global"},{"comment":"/**\\n * Skew of the LFO for the lowpass filter\\n *\\n * @name lpskew\\n * @tags filter, lfo, superdough\\n * @param {number | Pattern} skew How much to bend the LFO shape\\n */","meta":{"filename":"controls.mjs","lineno":1637,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Skew of the LFO for the lowpass filter</p>","name":"lpskew","tags":["filter","lfo","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>How much to bend the LFO shape</p>","name":"skew"}],"longname":"lpskew","kind":"member","scope":"global"},{"comment":"/**\\n * Rate of the LFO for the bandpass filter\\n *\\n * @name bprate\\n * @tags filter, lfo, superdough\\n * @param {number | Pattern} rate rate in hertz\\n */","meta":{"filename":"controls.mjs","lineno":1646,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Rate of the LFO for the bandpass filter</p>","name":"bprate","tags":["filter","lfo","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>rate in hertz</p>","name":"rate"}],"longname":"bprate","kind":"member","scope":"global"},{"comment":"/**\\n * Cycle-synced rate of the LFO for the bandpass filter\\n *\\n * @name bpsync\\n * @tags filter, lfo, superdough\\n * @param {number | Pattern} rate rate in cycles\\n */","meta":{"filename":"controls.mjs","lineno":1655,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Cycle-synced rate of the LFO for the bandpass filter</p>","name":"bpsync","tags":["filter","lfo","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>rate in cycles</p>","name":"rate"}],"longname":"bpsync","kind":"member","scope":"global"},{"comment":"/**\\n * Depth of the LFO for the bandpass filter\\n *\\n * @name bpdepth\\n * @tags filter, lfo, superdough\\n * @param {number | Pattern} depth depth of modulation\\n */","meta":{"filename":"controls.mjs","lineno":1664,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Depth of the LFO for the bandpass filter</p>","name":"bpdepth","tags":["filter","lfo","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>depth of modulation</p>","name":"depth"}],"longname":"bpdepth","kind":"member","scope":"global"},{"comment":"/**\\n * Depth of the LFO for the bandpass filter, in HZ\\n *\\n * @name bpdepthfrequency\\n * @tags filter, lfo, superdough\\n * @synonyms bpdepthfreq\\n * @param {number | Pattern} depth depth of modulation\\n * @example\\n * note(\\"<c c c# c c c4>*16\\").s(\\"sawtooth\\").lpf(600).bpdepthfrequency(\\"<200 500 100 0>\\")\\n */","meta":{"filename":"controls.mjs","lineno":1673,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Depth of the LFO for the bandpass filter, in HZ</p>","name":"bpdepthfrequency","tags":["filter","lfo","superdough"],"synonyms_text":"bpdepthfreq","synonyms":["bpdepthfreq"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>depth of modulation</p>","name":"depth"}],"examples":["note(\\"<c c c# c c c4>*16\\").s(\\"sawtooth\\").lpf(600).bpdepthfrequency(\\"<200 500 100 0>\\")"],"longname":"bpdepthfrequency","kind":"member","scope":"global"},{"comment":"/**\\n * Shape of the LFO for the bandpass filter\\n *\\n * @name bpshape\\n * @tags filter, lfo, superdough\\n * @param {number | Pattern} shape Shape of the lfo (0, 1, 2, ..)\\n */","meta":{"filename":"controls.mjs","lineno":1686,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Shape of the LFO for the bandpass filter</p>","name":"bpshape","tags":["filter","lfo","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>Shape of the lfo (0, 1, 2, ..)</p>","name":"shape"}],"longname":"bpshape","kind":"member","scope":"global"},{"comment":"/**\\n * DC offset of the LFO for the bandpass filter\\n *\\n * @name bpdc\\n * @tags filter, lfo, superdough\\n * @param {number | Pattern} dcoffset dc offset. set to 0 for unipolar\\n */","meta":{"filename":"controls.mjs","lineno":1695,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>DC offset of the LFO for the bandpass filter</p>","name":"bpdc","tags":["filter","lfo","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>dc offset. set to 0 for unipolar</p>","name":"dcoffset"}],"longname":"bpdc","kind":"member","scope":"global"},{"comment":"/**\\n * Skew of the LFO for the bandpass filter\\n *\\n * @name bpskew\\n * @tags filter, lfo, superdough\\n * @param {number | Pattern} skew How much to bend the LFO shape\\n */","meta":{"filename":"controls.mjs","lineno":1704,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Skew of the LFO for the bandpass filter</p>","name":"bpskew","tags":["filter","lfo","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>How much to bend the LFO shape</p>","name":"skew"}],"longname":"bpskew","kind":"member","scope":"global"},{"comment":"/**\\n * Rate of the LFO for the highpass filter\\n *\\n * @name hprate\\n * @tags filter, lfo, superdough\\n * @param {number | Pattern} rate rate in hertz\\n */","meta":{"filename":"controls.mjs","lineno":1713,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Rate of the LFO for the highpass filter</p>","name":"hprate","tags":["filter","lfo","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>rate in hertz</p>","name":"rate"}],"longname":"hprate","kind":"member","scope":"global"},{"comment":"/**\\n * Cycle-synced rate of the LFO for the highpass filter\\n *\\n * @name hpsync\\n * @tags filter, lfo, superdough\\n * @param {number | Pattern} rate rate in cycles\\n */","meta":{"filename":"controls.mjs","lineno":1722,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Cycle-synced rate of the LFO for the highpass filter</p>","name":"hpsync","tags":["filter","lfo","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>rate in cycles</p>","name":"rate"}],"longname":"hpsync","kind":"member","scope":"global"},{"comment":"/**\\n * Depth of the LFO for the highpass filter\\n *\\n * @name hpdepth\\n * @tags filter, lfo, superdough\\n * @param {number | Pattern} depth depth of modulation\\n */","meta":{"filename":"controls.mjs","lineno":1731,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Depth of the LFO for the highpass filter</p>","name":"hpdepth","tags":["filter","lfo","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>depth of modulation</p>","name":"depth"}],"longname":"hpdepth","kind":"member","scope":"global"},{"comment":"/**\\n * Depth of the LFO for the hipass filter, in hz\\n *\\n * @name hpdepthfrequency\\n * @tags filter, lfo, superdough\\n * @synonyms hpdepthfreq\\n * @param {number | Pattern} depth depth of modulation\\n * @example\\n * note(\\"<c c c# c c c4>*16\\").s(\\"sawtooth\\").lpf(600).hpdepthfrequency(\\"<200 500 100 0>\\")\\n */","meta":{"filename":"controls.mjs","lineno":1740,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Depth of the LFO for the hipass filter, in hz</p>","name":"hpdepthfrequency","tags":["filter","lfo","superdough"],"synonyms_text":"hpdepthfreq","synonyms":["hpdepthfreq"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>depth of modulation</p>","name":"depth"}],"examples":["note(\\"<c c c# c c c4>*16\\").s(\\"sawtooth\\").lpf(600).hpdepthfrequency(\\"<200 500 100 0>\\")"],"longname":"hpdepthfrequency","kind":"member","scope":"global"},{"comment":"/**\\n * Shape of the LFO for the highpass filter\\n *\\n * @name hpshape\\n * @tags filter, lfo, superdough\\n * @param {number | Pattern} shape Shape of the lfo (0, 1, 2, ..)\\n */","meta":{"filename":"controls.mjs","lineno":1753,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Shape of the LFO for the highpass filter</p>","name":"hpshape","tags":["filter","lfo","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>Shape of the lfo (0, 1, 2, ..)</p>","name":"shape"}],"longname":"hpshape","kind":"member","scope":"global"},{"comment":"/**\\n * DC offset of the LFO for the highpass filter\\n *\\n * @name hpdc\\n * @tags filter, lfo, superdough\\n * @param {number | Pattern} dcoffset dc offset. set to 0 for unipolar\\n */","meta":{"filename":"controls.mjs","lineno":1762,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>DC offset of the LFO for the highpass filter</p>","name":"hpdc","tags":["filter","lfo","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>dc offset. set to 0 for unipolar</p>","name":"dcoffset"}],"longname":"hpdc","kind":"member","scope":"global"},{"comment":"/**\\n * Skew of the LFO for the highpass filter\\n *\\n * @name hpskew\\n * @tags filter, lfo, superdough\\n * @param {number | Pattern} skew How much to bend the LFO shape\\n */","meta":{"filename":"controls.mjs","lineno":1771,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Skew of the LFO for the highpass filter</p>","name":"hpskew","tags":["filter","lfo","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>How much to bend the LFO shape</p>","name":"skew"}],"longname":"hpskew","kind":"member","scope":"global"},{"comment":"/**\\n * Applies a vibrato to the frequency of the oscillator.\\n *\\n * @name vib\\n * @tags pitch, lfo, superdough, supradough\\n * @synonyms vibrato, v\\n * @param {number | Pattern} frequency of the vibrato in hertz\\n * @example\\n * note(\\"a e\\")\\n * .vib(\\"<.5 1 2 4 8 16>\\")\\n * ._scope()\\n * @example\\n * // change the modulation depth with \\":\\"\\n * note(\\"a e\\")\\n * .vib(\\"<.5 1 2 4 8 16>:12\\")\\n * ._scope()\\n */","meta":{"filename":"controls.mjs","lineno":1780,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Applies a vibrato to the frequency of the oscillator.</p>","name":"vib","tags":["pitch","lfo","superdough","supradough"],"synonyms_text":"vibrato, v","synonyms":["vibrato","v"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>of the vibrato in hertz</p>","name":"frequency"}],"examples":["note(\\"a e\\")\\n.vib(\\"<.5 1 2 4 8 16>\\")\\n._scope()","// change the modulation depth with \\":\\"\\nnote(\\"a e\\")\\n.vib(\\"<.5 1 2 4 8 16>:12\\")\\n._scope()"],"longname":"vib","kind":"member","scope":"global"},{"comment":"/**\\n * Adds pink noise to the mix\\n *\\n * @name noise\\n * @tags generators, superdough, supradough\\n * @param {number | Pattern} wet wet amount\\n * @example\\n * sound(\\"<white pink brown>/2\\")\\n */","meta":{"filename":"controls.mjs","lineno":1798,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Adds pink noise to the mix</p>","name":"noise","tags":["generators","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>wet amount</p>","name":"wet"}],"examples":["sound(\\"<white pink brown>/2\\")"],"longname":"noise","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the vibrato depth in semitones. Only has an effect if \`vibrato\` | \`vib\` | \`v\` is is also set\\n *\\n * @name vibmod\\n * @tags pitch, lfo, superdough, supradough\\n * @synonyms vmod\\n * @param {number | Pattern} depth of vibrato (in semitones)\\n * @example\\n * note(\\"a e\\").vib(4)\\n * .vibmod(\\"<.25 .5 1 2 12>\\")\\n * ._scope()\\n * @example\\n * // change the vibrato frequency with \\":\\"\\n * note(\\"a e\\")\\n * .vibmod(\\"<.25 .5 1 2 12>:8\\")\\n * ._scope()\\n */","meta":{"filename":"controls.mjs","lineno":1808,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the vibrato depth in semitones. Only has an effect if <code>vibrato</code> | <code>vib</code> | <code>v</code> is is also set</p>","name":"vibmod","tags":["pitch","lfo","superdough","supradough"],"synonyms_text":"vmod","synonyms":["vmod"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>of vibrato (in semitones)</p>","name":"depth"}],"examples":["note(\\"a e\\").vib(4)\\n.vibmod(\\"<.25 .5 1 2 12>\\")\\n._scope()","// change the vibrato frequency with \\":\\"\\nnote(\\"a e\\")\\n.vibmod(\\"<.25 .5 1 2 12>:8\\")\\n._scope()"],"longname":"vibmod","kind":"member","scope":"global"},{"comment":"/**\\n * Controls the **h**igh-**p**ass **q**-value.\\n *\\n * @name hpq\\n * @tags filter, superdough, supradough\\n * @param {number | Pattern} q resonance factor between 0 and 50\\n * @synonyms hresonance\\n * @example\\n * s(\\"bd sd [~ bd] sd,hh*8\\").hpf(2000).hpq(\\"<0 10 20 30>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1827,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Controls the <strong>h</strong>igh-<strong>p</strong>ass <strong>q</strong>-value.</p>","name":"hpq","tags":["filter","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>resonance factor between 0 and 50</p>","name":"q"}],"synonyms_text":"hresonance","synonyms":["hresonance"],"examples":["s(\\"bd sd [~ bd] sd,hh*8\\").hpf(2000).hpq(\\"<0 10 20 30>\\")"],"longname":"hpq","kind":"member","scope":"global"},{"comment":"/**\\n * Controls the **l**ow-**p**ass **q**-value.\\n *\\n * @name lpq\\n * @tags filter, superdough, supradough\\n * @param {number | Pattern} q resonance factor between 0 and 50\\n * @synonyms resonance\\n * @example\\n * s(\\"bd sd [~ bd] sd,hh*8\\").lpf(2000).lpq(\\"<0 10 20 30>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1839,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Controls the <strong>l</strong>ow-<strong>p</strong>ass <strong>q</strong>-value.</p>","name":"lpq","tags":["filter","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>resonance factor between 0 and 50</p>","name":"q"}],"synonyms_text":"resonance","synonyms":["resonance"],"examples":["s(\\"bd sd [~ bd] sd,hh*8\\").lpf(2000).lpq(\\"<0 10 20 30>\\")"],"longname":"lpq","kind":"member","scope":"global"},{"comment":"/**\\n * DJ filter, below 0.5 is low pass filter, above is high pass filter.\\n *\\n * @name djf\\n * @tags filter, superdough\\n * @param {number | Pattern} cutoff below 0.5 is low pass filter, above is high pass filter\\n * @example\\n * n(irand(16).seg(8)).scale(\\"d:phrygian\\").s(\\"supersaw\\").djf(\\"<.5 .3 .2 .75>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1852,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>DJ filter, below 0.5 is low pass filter, above is high pass filter.</p>","name":"djf","tags":["filter","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>below 0.5 is low pass filter, above is high pass filter</p>","name":"cutoff"}],"examples":["n(irand(16).seg(8)).scale(\\"d:phrygian\\").s(\\"supersaw\\").djf(\\"<.5 .3 .2 .75>\\")"],"longname":"djf","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the level of the delay signal.\\n *\\n * When using mininotation, you can also optionally add the 'delaytime' and 'delayfeedback' parameter,\\n * separated by ':'.\\n *\\n *\\n * @name delay\\n * @tags orbit, superdough, supradough\\n * @param {number | Pattern} level between 0 and 1\\n * @example\\n * s(\\"bd bd\\").delay(\\"<0 .25 .5 1>\\")\\n * @example\\n * s(\\"bd bd\\").delay(\\"0.65:0.25:0.9 0.65:0.125:0.7\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1865,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the level of the delay signal.</p>\\n<p>When using mininotation, you can also optionally add the 'delaytime' and 'delayfeedback' parameter,\\nseparated by ':'.</p>","name":"delay","tags":["orbit","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>between 0 and 1</p>","name":"level"}],"examples":["s(\\"bd bd\\").delay(\\"<0 .25 .5 1>\\")","s(\\"bd bd\\").delay(\\"0.65:0.25:0.9 0.65:0.125:0.7\\")"],"longname":"delay","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the level of the signal that is fed back into the delay.\\n * Caution: Values >= 1 will result in a signal that gets louder and louder! Don't do it\\n *\\n * @name delayfeedback\\n * @tags orbit, superdough, supradough\\n * @param {number | Pattern} feedback between 0 and 1\\n * @synonyms delayfb, dfb\\n * @example\\n * s(\\"bd\\").delay(.25).delayfeedback(\\"<.25 .5 .75 1>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1882,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the level of the signal that is fed back into the delay.\\nCaution: Values >= 1 will result in a signal that gets louder and louder! Don't do it</p>","name":"delayfeedback","tags":["orbit","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>between 0 and 1</p>","name":"feedback"}],"synonyms_text":"delayfb, dfb","synonyms":["delayfb","dfb"],"examples":["s(\\"bd\\").delay(.25).delayfeedback(\\"<.25 .5 .75 1>\\")"],"longname":"delayfeedback","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the time of the delay effect.\\n *\\n * @name delayspeed\\n * @tags supradough\\n * @param {number | Pattern} delayspeed controls the pitch of the delay feedback\\n * @synonyms delayt, dt\\n * @example\\n * note(\\"d d a# a\\".fast(2)).s(\\"sawtooth\\").delay(.8).delaytime(1/2).delayspeed(\\"<2 .5 -1 -2>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1896,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the time of the delay effect.</p>","name":"delayspeed","tags":["supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>controls the pitch of the delay feedback</p>","name":"delayspeed"}],"synonyms_text":"delayt, dt","synonyms":["delayt","dt"],"examples":["note(\\"d d a# a\\".fast(2)).s(\\"sawtooth\\").delay(.8).delaytime(1/2).delayspeed(\\"<2 .5 -1 -2>\\")"],"longname":"delayspeed","kind":"member","scope":"global"},{"comment":"/**\\n * @name delaytime\\n * @tags orbit, superdough, supradough\\n * @param {number | Pattern} delaytime sets the time of the delay effect.\\n * @synonyms delayt, dt\\n * @example\\n * note(\\"d d a# a\\".fast(2)).s(\\"sawtooth\\").delay(.8).delaytime(1/2).delayspeed(\\"<2 .5 -1 -2>\\")\\n */","meta":{"filename":"controls.mjs","lineno":1909,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"name":"delaytime","tags":["orbit","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>sets the time of the delay effect.</p>","name":"delaytime"}],"synonyms_text":"delayt, dt","synonyms":["delayt","dt"],"examples":["note(\\"d d a# a\\".fast(2)).s(\\"sawtooth\\").delay(.8).delaytime(1/2).delayspeed(\\"<2 .5 -1 -2>\\")"],"longname":"delaytime","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the time of the delay effect in cycles.\\n *\\n * @name delaysync\\n * @tags orbit, superdough\\n * @param {number | Pattern} cycles delay length in cycles\\n * @synonyms delays, ds\\n * @example\\n * s(\\"bd bd\\").delay(.25).delaysync(\\"<1 2 3 5>\\".div(8))\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1919,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the time of the delay effect in cycles.</p>","name":"delaysync","tags":["orbit","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>delay length in cycles</p>","name":"cycles"}],"synonyms_text":"delays, ds","synonyms":["delays","ds"],"examples":["s(\\"bd bd\\").delay(.25).delaysync(\\"<1 2 3 5>\\".div(8))"],"longname":"delaysync","kind":"member","scope":"global"},{"comment":"/**\\n * Specifies whether delaytime is calculated relative to cps.\\n *\\n * @name lock\\n * @tags superdirt\\n * @param {number | Pattern} enable When set to 1, delaytime is a direct multiple of a cycle.\\n * @superdirtOnly\\n * @example\\n * s(\\"sd\\").delay().lock(1).osc()\\n *\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1932,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Specifies whether delaytime is calculated relative to cps.</p>","name":"lock","tags":["superdirt",{"originalTitle":"superdirtOnly","title":"superdirtonly","text":""}],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>When set to 1, delaytime is a direct multiple of a cycle.</p>","name":"enable"}],"examples":["s(\\"sd\\").delay().lock(1).osc()"],"longname":"lock","kind":"member","scope":"global"},{"comment":"/**\\n * Set detune for stacked voices of supported oscillators.\\n *\\n * @name detune\\n * @tags pitch, superdough\\n * @param {number | Pattern} amount\\n * @synonyms det\\n * @example\\n * note(\\"d f a a# a d3\\").fast(2).s(\\"supersaw\\").detune(\\"<.1 .2 .5 24.1>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1946,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Set detune for stacked voices of supported oscillators.</p>","name":"detune","tags":["pitch","superdough"],"params":[{"type":{"names":["number","Pattern"]},"name":"amount"}],"synonyms_text":"det","synonyms":["det"],"examples":["note(\\"d f a a# a d3\\").fast(2).s(\\"supersaw\\").detune(\\"<.1 .2 .5 24.1>\\")"],"longname":"detune","kind":"member","scope":"global"},{"comment":"/**\\n * Set number of stacked voices for supported oscillators.\\n *\\n * @name unison\\n * @tags superdough\\n * @param {number | Pattern} numvoices\\n * @example\\n * note(\\"d f a a# a d3\\").fast(2).s(\\"supersaw\\").unison(\\"<1 2 7>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1958,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Set number of stacked voices for supported oscillators.</p>","name":"unison","tags":["superdough"],"params":[{"type":{"names":["number","Pattern"]},"name":"numvoices"}],"examples":["note(\\"d f a a# a d3\\").fast(2).s(\\"supersaw\\").unison(\\"<1 2 7>\\")"],"longname":"unison","kind":"member","scope":"global"},{"comment":"/**\\n * Set the stereo pan spread for supported oscillators\\n *\\n * @name spread\\n * @tags superdough\\n * @param {number | Pattern} spread between 0 and 1\\n * @example\\n * note(\\"d f a a# a d3\\").fast(2).s(\\"supersaw\\").spread(\\"<0 .3 1>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1970,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Set the stereo pan spread for supported oscillators</p>","name":"spread","tags":["superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>between 0 and 1</p>","name":"spread"}],"examples":["note(\\"d f a a# a d3\\").fast(2).s(\\"supersaw\\").spread(\\"<0 .3 1>\\")"],"longname":"spread","kind":"member","scope":"global"},{"comment":"/**\\n * Set dryness of reverb. See \`room\` and \`size\` for more information about reverb.\\n *\\n * @name dry\\n * @tags superdirt\\n * @param {number | Pattern} dry 0 = wet, 1 = dry\\n * @example\\n * n(\\"[0,3,7](3,8)\\").s(\\"superpiano\\").room(.7).dry(\\"<0 .5 .75 1>\\").osc()\\n * @superdirtOnly\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1981,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Set dryness of reverb. See <code>room</code> and <code>size</code> for more information about reverb.</p>","name":"dry","tags":["superdirt",{"originalTitle":"superdirtOnly","title":"superdirtonly","text":""}],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>0 = wet, 1 = dry</p>","name":"dry"}],"examples":["n(\\"[0,3,7](3,8)\\").s(\\"superpiano\\").room(.7).dry(\\"<0 .5 .75 1>\\").osc()"],"longname":"dry","kind":"member","scope":"global"},{"comment":"/**\\n * Used when using \`begin\`/\`end\` or \`chop\`/\`striate\` and friends, to change the fade out time of the 'grain' envelope.\\n *\\n * @name fadeTime\\n * @tags superdirt\\n * @synonyms fadeOutTime\\n * @param {number | Pattern} time between 0 and 1\\n * @example\\n * s(\\"oh*4\\").end(.1).fadeTime(\\"<0 .2 .4 .8>\\").osc()\\n *\\n */","meta":{"filename":"controls.mjs","lineno":1993,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Used when using <code>begin</code>/<code>end</code> or <code>chop</code>/<code>striate</code> and friends, to change the fade out time of the 'grain' envelope.</p>","name":"fadeTime","tags":["superdirt"],"synonyms_text":"fadeOutTime","synonyms":["fadeOutTime"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>between 0 and 1</p>","name":"time"}],"examples":["s(\\"oh*4\\").end(.1).fadeTime(\\"<0 .2 .4 .8>\\").osc()"],"longname":"fadeTime","kind":"member","scope":"global"},{"comment":"/**\\n * Set frequency of sound.\\n *\\n * @name freq\\n * @tags pitch, superdough\\n * @param {number | Pattern} frequency in Hz. the audible range is between 20 and 20000 Hz\\n * @example\\n * freq(\\"220 110 440 110\\").s(\\"superzow\\").osc()\\n * @example\\n * freq(\\"110\\".mul.out(\\".5 1.5 .6 [2 3]\\")).s(\\"superzow\\").osc()\\n *\\n */","meta":{"filename":"controls.mjs","lineno":2006,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Set frequency of sound.</p>","name":"freq","tags":["pitch","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>in Hz. the audible range is between 20 and 20000 Hz</p>","name":"frequency"}],"examples":["freq(\\"220 110 440 110\\").s(\\"superzow\\").osc()","freq(\\"110\\".mul.out(\\".5 1.5 .6 [2 3]\\")).s(\\"superzow\\").osc()"],"longname":"freq","kind":"member","scope":"global"},{"comment":"/**\\n * Attack time of pitch envelope.\\n *\\n * @name pattack\\n * @tags pitch, envelope, superdough, supradough\\n * @synonyms patt\\n * @param {number | Pattern} time time in seconds\\n * @example\\n * note(\\"c eb g bb\\").pattack(\\"0 .1 .25 .5\\").slow(2)\\n *\\n */","meta":{"filename":"controls.mjs","lineno":2020,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Attack time of pitch envelope.</p>","name":"pattack","tags":["pitch","envelope","superdough","supradough"],"synonyms_text":"patt","synonyms":["patt"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>time in seconds</p>","name":"time"}],"examples":["note(\\"c eb g bb\\").pattack(\\"0 .1 .25 .5\\").slow(2)"],"longname":"pattack","kind":"member","scope":"global"},{"comment":"/**\\n * Decay time of pitch envelope.\\n *\\n * @name pdecay\\n * @tags pitch, envelope, superdough, supradough\\n * @synonyms pdec\\n * @param {number | Pattern} time time in seconds\\n * @example\\n * note(\\"<c eb g bb>\\").pdecay(\\"<0 .1 .25 .5>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":2032,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Decay time of pitch envelope.</p>","name":"pdecay","tags":["pitch","envelope","superdough","supradough"],"synonyms_text":"pdec","synonyms":["pdec"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>time in seconds</p>","name":"time"}],"examples":["note(\\"<c eb g bb>\\").pdecay(\\"<0 .1 .25 .5>\\")"],"longname":"pdecay","kind":"member","scope":"global"},{"comment":"/**\\n * Release time of pitch envelope\\n *\\n * @name prelease\\n * @tags pitch, envelope, superdough, supradough\\n * @synonyms prel\\n * @param {number | Pattern} time time in seconds\\n * @example\\n * note(\\"<c eb g bb> ~\\")\\n * .release(.5) // to hear the pitch release\\n * .prelease(\\"<0 .1 .25 .5>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":2046,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Release time of pitch envelope</p>","name":"prelease","tags":["pitch","envelope","superdough","supradough"],"synonyms_text":"prel","synonyms":["prel"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>time in seconds</p>","name":"time"}],"examples":["note(\\"<c eb g bb> ~\\")\\n.release(.5) // to hear the pitch release\\n.prelease(\\"<0 .1 .25 .5>\\")"],"longname":"prelease","kind":"member","scope":"global"},{"comment":"/**\\n * Amount of pitch envelope. Negative values will flip the envelope.\\n * If you don't set other pitch envelope controls, \`pattack:.2\` will be the default.\\n *\\n * @name penv\\n * @tags pitch, envelope, superdough, supradough\\n * @param {number | Pattern} semitones change in semitones\\n * @example\\n * note(\\"c\\")\\n * .penv(\\"<12 7 1 .5 0 -1 -7 -12>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":2060,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Amount of pitch envelope. Negative values will flip the envelope.\\nIf you don't set other pitch envelope controls, <code>pattack:.2</code> will be the default.</p>","name":"penv","tags":["pitch","envelope","superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>change in semitones</p>","name":"semitones"}],"examples":["note(\\"c\\")\\n.penv(\\"<12 7 1 .5 0 -1 -7 -12>\\")"],"longname":"penv","kind":"member","scope":"global"},{"comment":"/**\\n * Curve of envelope. Defaults to linear. exponential is good for kicks\\n *\\n * @name pcurve\\n * @tags pitch, envelope, superdough\\n * @param {number | Pattern} type 0 = linear, 1 = exponential\\n * @example\\n * note(\\"g1*4\\")\\n * .s(\\"sine\\").pdec(.5)\\n * .penv(32)\\n * .pcurve(\\"<0 1>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":2073,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Curve of envelope. Defaults to linear. exponential is good for kicks</p>","name":"pcurve","tags":["pitch","envelope","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>0 = linear, 1 = exponential</p>","name":"type"}],"examples":["note(\\"g1*4\\")\\n.s(\\"sine\\").pdec(.5)\\n.penv(32)\\n.pcurve(\\"<0 1>\\")"],"longname":"pcurve","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the range anchor of the envelope:\\n * - anchor 0: range = [note, note + penv]\\n * - anchor 1: range = [note - penv, note]\\n * If you don't set an anchor, the value will default to the psustain value.\\n *\\n * @name panchor\\n * @tags pitch, envelope, superdough\\n * @param {number | Pattern} anchor anchor offset\\n * @example\\n * note(\\"c c4\\").penv(12).panchor(\\"<0 .5 1 .5>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":2087,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the range anchor of the envelope:</p>\\n<ul>\\n<li>anchor 0: range = [note, note + penv]</li>\\n<li>anchor 1: range = [note - penv, note]\\nIf you don't set an anchor, the value will default to the psustain value.</li>\\n</ul>","name":"panchor","tags":["pitch","envelope","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>anchor offset</p>","name":"anchor"}],"examples":["note(\\"c c4\\").penv(12).panchor(\\"<0 .5 1 .5>\\")"],"longname":"panchor","kind":"member","scope":"global"},{"comment":"/**\\n * Emulation of a Leslie speaker: speakers rotating in a wooden amplified cabinet.\\n *\\n * @name leslie\\n * @tags superdirt\\n * @param {number | Pattern} wet between 0 and 1\\n * @example\\n * n(\\"0,4,7\\").s(\\"supersquare\\").leslie(\\"<0 .4 .6 1>\\").osc()\\n * @superdirtOnly\\n *\\n */","meta":{"filename":"controls.mjs","lineno":2112,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Emulation of a Leslie speaker: speakers rotating in a wooden amplified cabinet.</p>","name":"leslie","tags":["superdirt",{"originalTitle":"superdirtOnly","title":"superdirtonly","text":""}],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>between 0 and 1</p>","name":"wet"}],"examples":["n(\\"0,4,7\\").s(\\"supersquare\\").leslie(\\"<0 .4 .6 1>\\").osc()"],"longname":"leslie","kind":"member","scope":"global"},{"comment":"/**\\n * Rate of modulation / rotation for leslie effect\\n *\\n * @name lrate\\n * @tags superdirt\\n * @param {number | Pattern} rate 6.7 for fast, 0.7 for slow\\n * @example\\n * n(\\"0,4,7\\").s(\\"supersquare\\").leslie(1).lrate(\\"<1 2 4 8>\\").osc()\\n * @superdirtOnly\\n *\\n */","meta":{"filename":"controls.mjs","lineno":2124,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Rate of modulation / rotation for leslie effect</p>","name":"lrate","tags":["superdirt",{"originalTitle":"superdirtOnly","title":"superdirtonly","text":""}],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>6.7 for fast, 0.7 for slow</p>","name":"rate"}],"examples":["n(\\"0,4,7\\").s(\\"supersquare\\").leslie(1).lrate(\\"<1 2 4 8>\\").osc()"],"longname":"lrate","kind":"member","scope":"global"},{"comment":"/**\\n * Physical size of the cabinet in meters. Be careful, it might be slightly larger than your computer. Affects the Doppler amount (pitch warble)\\n *\\n * @name lsize\\n * @tags superdirt\\n * @param {number | Pattern} meters somewhere between 0 and 1\\n * @example\\n * n(\\"0,4,7\\").s(\\"supersquare\\").leslie(1).lrate(2).lsize(\\"<.1 .5 1>\\").osc()\\n * @superdirtOnly\\n *\\n */","meta":{"filename":"controls.mjs","lineno":2137,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Physical size of the cabinet in meters. Be careful, it might be slightly larger than your computer. Affects the Doppler amount (pitch warble)</p>","name":"lsize","tags":["superdirt",{"originalTitle":"superdirtOnly","title":"superdirtonly","text":""}],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>somewhere between 0 and 1</p>","name":"meters"}],"examples":["n(\\"0,4,7\\").s(\\"supersquare\\").leslie(1).lrate(2).lsize(\\"<.1 .5 1>\\").osc()"],"longname":"lsize","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the displayed text for an event on the pianoroll\\n *\\n * @name label\\n * @tags visualization\\n * @param {string} label text to display\\n */","meta":{"filename":"controls.mjs","lineno":2149,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the displayed text for an event on the pianoroll</p>","name":"label","tags":["visualization"],"params":[{"type":{"names":["string"]},"description":"<p>text to display</p>","name":"label"}],"longname":"label","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the default octave of a synth.\\n *\\n * @name octave\\n * @tags superdirt\\n * @synonyms oct\\n * @param {number | Pattern} octave octave number\\n * @example\\n * n(\\"0,4,7\\").scale(\\"F:minor\\").s('supersaw').octave(\\"<0 1 2 3>\\")\\n */","meta":{"filename":"controls.mjs","lineno":2186,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the default octave of a synth.</p>","name":"octave","tags":["superdirt"],"synonyms_text":"oct","synonyms":["oct"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>octave number</p>","name":"octave"}],"examples":["n(\\"0,4,7\\").scale(\\"F:minor\\").s('supersaw').octave(\\"<0 1 2 3>\\")"],"longname":"octave","kind":"member","scope":"global"},{"comment":"/**\\n * An \`orbit\` is a global parameter context for patterns. Patterns with the same orbit will share the same global effects.\\n *\\n * @name orbit\\n * @tags superdough\\n * @synonyms o\\n * @param {number | Pattern} number\\n * @example\\n * stack(\\n * s(\\"hh*6\\").delay(.5).delaytime(.25).orbit(1),\\n * s(\\"~ sd ~ sd\\").delay(.5).delaytime(.125).orbit(2)\\n * )\\n */","meta":{"filename":"controls.mjs","lineno":2200,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>An <code>orbit</code> is a global parameter context for patterns. Patterns with the same orbit will share the same global effects.</p>","name":"orbit","tags":["superdough"],"synonyms_text":"o","synonyms":["o"],"params":[{"type":{"names":["number","Pattern"]},"name":"number"}],"examples":["stack(\\n s(\\"hh*6\\").delay(.5).delaytime(.25).orbit(1),\\n s(\\"~ sd ~ sd\\").delay(.5).delaytime(.125).orbit(2)\\n)"],"longname":"orbit","kind":"member","scope":"global"},{"comment":"/**\\n * A \`bus\` is a send which can be used for mixing patterns. It combines with..\\n * s(\\"bus\\") to play that bus through another pattern (for, say, applying non-linear\\n * effects like distortion to multiple signals)\\n *\\n * otherPat.bmod(..) (to modulate another pattern with the bus)\\n *\\n * @name bus\\n * @tags superdirt\\n * @param {number | Pattern} number\\n */","meta":{"filename":"controls.mjs","lineno":2215,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>A <code>bus</code> is a send which can be used for mixing patterns. It combines with..\\ns("bus") to play that bus through another pattern (for, say, applying non-linear\\neffects like distortion to multiple signals)</p>\\n<p>otherPat.bmod(..) (to modulate another pattern with the bus)</p>","name":"bus","tags":["superdirt"],"params":[{"type":{"names":["number","Pattern"]},"name":"number"}],"longname":"bus","kind":"member","scope":"global"},{"comment":"/**\\n * Postgain multiplier prior to sending the signal to the audio bus.\\n *\\n * @name busgain\\n * @tags superdirt\\n * @synonyms bgain\\n * @param {number | Pattern} number\\n */","meta":{"filename":"controls.mjs","lineno":2228,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Postgain multiplier prior to sending the signal to the audio bus.</p>","name":"busgain","tags":["superdirt"],"synonyms_text":"bgain","synonyms":["bgain"],"params":[{"type":{"names":["number","Pattern"]},"name":"number"}],"longname":"busgain","kind":"member","scope":"global"},{"comment":"/**\\n * Sets position in stereo.\\n *\\n * @name pan\\n * @tags superdough, supradough\\n * @param {number | Pattern} pan between 0 and 1, from left to right (assuming stereo), once round a circle (assuming multichannel)\\n * @example\\n * s(\\"[bd hh]*2\\").pan(\\"<.5 1 .5 0>\\")\\n * @example\\n * s(\\"bd rim sd rim bd ~ cp rim\\").pan(sine.slow(2))\\n *\\n */","meta":{"filename":"controls.mjs","lineno":2242,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets position in stereo.</p>","name":"pan","tags":["superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>between 0 and 1, from left to right (assuming stereo), once round a circle (assuming multichannel)</p>","name":"pan"}],"examples":["s(\\"[bd hh]*2\\").pan(\\"<.5 1 .5 0>\\")","s(\\"bd rim sd rim bd ~ cp rim\\").pan(sine.slow(2))"],"longname":"pan","kind":"member","scope":"global"},{"comment":"/**\\n * Controls how much multichannel output is fanned out\\n *\\n * @name panspan\\n * @tags superdirt\\n * @param {number | Pattern} span between -inf and inf, negative is backwards ordering\\n * @example\\n * s(\\"[bd hh]*2\\").pan(\\"<.5 1 .5 0>\\").panspan(\\"<0 .5 1>\\").osc()\\n *\\n */","meta":{"filename":"controls.mjs","lineno":2255,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Controls how much multichannel output is fanned out</p>","name":"panspan","tags":["superdirt"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>between -inf and inf, negative is backwards ordering</p>","name":"span"}],"examples":["s(\\"[bd hh]*2\\").pan(\\"<.5 1 .5 0>\\").panspan(\\"<0 .5 1>\\").osc()"],"longname":"panspan","kind":"member","scope":"global"},{"comment":"/**\\n * Controls how much multichannel output is spread\\n *\\n * @name pansplay\\n * @tags superdirt\\n * @param {number | Pattern} spread between 0 and 1\\n * @example\\n * s(\\"[bd hh]*2\\").pan(\\"<.5 1 .5 0>\\").pansplay(\\"<0 .5 1>\\").osc()\\n *\\n */","meta":{"filename":"controls.mjs","lineno":2266,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Controls how much multichannel output is spread</p>","name":"pansplay","tags":["superdirt"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>between 0 and 1</p>","name":"spread"}],"examples":["s(\\"[bd hh]*2\\").pan(\\"<.5 1 .5 0>\\").pansplay(\\"<0 .5 1>\\").osc()"],"longname":"pansplay","kind":"member","scope":"global"},{"comment":"/**\\n * The chord to voice\\n * @name chord\\n * @tags tonal\\n * @param {string | Pattern} symbols chord symbols to voice e.g., C, Eb, Fm7, G7. The symbols can be defined via addVoicings\\n * @example\\n * chord(\\"<Am C D F Am E Am E>\\").voicing()\\n **/","meta":{"filename":"controls.mjs","lineno":2292,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>The chord to voice</p>","name":"chord","tags":["tonal"],"params":[{"type":{"names":["string","Pattern"]},"description":"<p>chord symbols to voice e.g., C, Eb, Fm7, G7. The symbols can be defined via addVoicings</p>","name":"symbols"}],"examples":["chord(\\"<Am C D F Am E Am E>\\").voicing()"],"longname":"chord","kind":"member","scope":"global"},{"comment":"/**\\n * Which dictionary to use for the voicings. This falls back to the default dictionary if not provided\\n *\\n * @name dictionary\\n * @tags tonal\\n * @param {string} dictionaryName which dictionary (having been defined with \`addVoicings\`) to use\\n * @example\\n * addVoicings('house', {\\n'': ['7 12 16', '0 7 16', '4 7 12'],\\n'm': ['0 3 7']\\n})\\nchord(\\"<Am C D F Am E Am E>\\")\\n.dict('house').anchor(66)\\n.voicing().room(.5)\\n **/","meta":{"filename":"controls.mjs","lineno":2301,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Which dictionary to use for the voicings. This falls back to the default dictionary if not provided</p>","name":"dictionary","tags":["tonal"],"params":[{"type":{"names":["string"]},"description":"<p>which dictionary (having been defined with <code>addVoicings</code>) to use</p>","name":"dictionaryName"}],"examples":["addVoicings('house', {\\n'': ['7 12 16', '0 7 16', '4 7 12'],\\n'm': ['0 3 7']\\n})\\nchord(\\"<Am C D F Am E Am E>\\")\\n.dict('house').anchor(66)\\n.voicing().room(.5)"],"longname":"dictionary","kind":"member","scope":"global"},{"comment":"/** The top note to align the voicing to. Defaults to c5\\n *\\n * @name anchor\\n * @tags tonal\\n * @param {string | Pattern} anchorNote the note to align the voicing or scale to\\n * @example\\n * anchor(\\"<c4 g4 c5 g5>\\").chord(\\"C\\").voicing()\\n * @example\\n * n(\\"0 .. 7\\").anchor(\\"<c4 g4 c5 g5>\\").scale(\\"<C:major F:minor>\\")\\n **/","meta":{"filename":"controls.mjs","lineno":2317,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>The top note to align the voicing to. Defaults to c5</p>","name":"anchor","tags":["tonal"],"params":[{"type":{"names":["string","Pattern"]},"description":"<p>the note to align the voicing or scale to</p>","name":"anchorNote"}],"examples":["anchor(\\"<c4 g4 c5 g5>\\").chord(\\"C\\").voicing()","n(\\"0 .. 7\\").anchor(\\"<c4 g4 c5 g5>\\").scale(\\"<C:major F:minor>\\")"],"longname":"anchor","kind":"member","scope":"global"},{"comment":"/**\\n * Sets how the voicing is offset from the anchored position\\n *\\n * @name offset\\n * @tags tonal\\n * @param {number | Pattern} shift the amount to shift the voicing up or down\\n * @example\\n * chord(\\"<Am C D F Am E Am E>\\").offset(\\"<0 1 2 3 4 5>\\") // alter the voicing each time\\n **/","meta":{"filename":"controls.mjs","lineno":2328,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets how the voicing is offset from the anchored position</p>","name":"offset","tags":["tonal"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>the amount to shift the voicing up or down</p>","name":"shift"}],"examples":["chord(\\"<Am C D F Am E Am E>\\").offset(\\"<0 1 2 3 4 5>\\") // alter the voicing each time"],"longname":"offset","kind":"member","scope":"global"},{"comment":"/**\\n * How many octaves are voicing steps spread apart, defaults to 1\\n *\\n * @name octaves\\n * @tags tonal\\n * @param {number | Pattern} count the number of octaves\\n * @example\\n * chord(\\"<Am C D F Am E Am E>\\").octaves(\\"<2 4>\\").voicing()\\n **/","meta":{"filename":"controls.mjs","lineno":2338,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>How many octaves are voicing steps spread apart, defaults to 1</p>","name":"octaves","tags":["tonal"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>the number of octaves</p>","name":"count"}],"examples":["chord(\\"<Am C D F Am E Am E>\\").octaves(\\"<2 4>\\").voicing()"],"longname":"octaves","kind":"member","scope":"global"},{"comment":"/**\\n * Remove anchor note from the voicing. Useful for melody harmonization\\n *\\n * @name mode\\n * @tags tonal\\n * @param {string | Pattern} modeName one of {below | above | duck | root}\\n * @example\\n * mode(\\"<below above duck root>\\").chord(\\"C\\").voicing()\\n *\\n **/","meta":{"filename":"controls.mjs","lineno":2348,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Remove anchor note from the voicing. Useful for melody harmonization</p>","name":"mode","tags":["tonal"],"params":[{"type":{"names":["string","Pattern"]},"description":"<p>one of {below | above | duck | root}</p>","name":"modeName"}],"examples":["mode(\\"<below above duck root>\\").chord(\\"C\\").voicing()"],"longname":"mode","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the level of reverb.\\n *\\n * When using mininotation, you can also optionally add the 'size' parameter, separated by ':'.\\n *\\n * @name room\\n * @tags orbit, superdough\\n * @param {number | Pattern} level between 0 and 1\\n * @example\\n * s(\\"bd sd [~ bd] sd\\").room(\\"<0 .2 .4 .6 .8 1>\\")\\n * @example\\n * s(\\"bd sd [~ bd] sd\\").room(\\"<0.9:1 0.9:4>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":2360,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the level of reverb.</p>\\n<p>When using mininotation, you can also optionally add the 'size' parameter, separated by ':'.</p>","name":"room","tags":["orbit","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>between 0 and 1</p>","name":"level"}],"examples":["s(\\"bd sd [~ bd] sd\\").room(\\"<0 .2 .4 .6 .8 1>\\")","s(\\"bd sd [~ bd] sd\\").room(\\"<0.9:1 0.9:4>\\")"],"longname":"room","kind":"member","scope":"global"},{"comment":"/**\\n * Reverb lowpass starting frequency (in hertz).\\n * When this property is changed, the reverb will be recaculated, so only change this sparsely..\\n *\\n * @name roomlp\\n * @tags orbit, superdough\\n * @synonyms rlp\\n * @param {number} frequency between 0 and 20000hz\\n * @example\\n * s(\\"bd sd [~ bd] sd\\").room(0.5).rlp(10000)\\n * @example\\n * s(\\"bd sd [~ bd] sd\\").room(0.5).rlp(5000)\\n */","meta":{"filename":"controls.mjs","lineno":2375,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Reverb lowpass starting frequency (in hertz).\\nWhen this property is changed, the reverb will be recaculated, so only change this sparsely..</p>","name":"roomlp","tags":["orbit","superdough"],"synonyms_text":"rlp","synonyms":["rlp"],"params":[{"type":{"names":["number"]},"description":"<p>between 0 and 20000hz</p>","name":"frequency"}],"examples":["s(\\"bd sd [~ bd] sd\\").room(0.5).rlp(10000)","s(\\"bd sd [~ bd] sd\\").room(0.5).rlp(5000)"],"longname":"roomlp","kind":"member","scope":"global"},{"comment":"/**\\n * Reverb lowpass frequency at -60dB (in hertz).\\n * When this property is changed, the reverb will be recaculated, so only change this sparsely..\\n *\\n * @name roomdim\\n * @tags orbit, superdough\\n * @synonyms rdim\\n * @param {number} frequency between 0 and 20000hz\\n * @example\\n * s(\\"bd sd [~ bd] sd\\").room(0.5).rlp(10000).rdim(8000)\\n * @example\\n * s(\\"bd sd [~ bd] sd\\").room(0.5).rlp(5000).rdim(400)\\n *\\n */","meta":{"filename":"controls.mjs","lineno":2389,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Reverb lowpass frequency at -60dB (in hertz).\\nWhen this property is changed, the reverb will be recaculated, so only change this sparsely..</p>","name":"roomdim","tags":["orbit","superdough"],"synonyms_text":"rdim","synonyms":["rdim"],"params":[{"type":{"names":["number"]},"description":"<p>between 0 and 20000hz</p>","name":"frequency"}],"examples":["s(\\"bd sd [~ bd] sd\\").room(0.5).rlp(10000).rdim(8000)","s(\\"bd sd [~ bd] sd\\").room(0.5).rlp(5000).rdim(400)"],"longname":"roomdim","kind":"member","scope":"global"},{"comment":"/**\\n * Reverb fade time (in seconds).\\n * When this property is changed, the reverb will be recaculated, so only change this sparsely..\\n *\\n * @name roomfade\\n * @tags orbit, superdough\\n * @synonyms rfade\\n * @param {number} seconds for the reverb to fade\\n * @example\\n * s(\\"bd sd [~ bd] sd\\").room(0.5).rlp(10000).rfade(0.5)\\n * @example\\n * s(\\"bd sd [~ bd] sd\\").room(0.5).rlp(5000).rfade(4)\\n *\\n */","meta":{"filename":"controls.mjs","lineno":2404,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Reverb fade time (in seconds).\\nWhen this property is changed, the reverb will be recaculated, so only change this sparsely..</p>","name":"roomfade","tags":["orbit","superdough"],"synonyms_text":"rfade","synonyms":["rfade"],"params":[{"type":{"names":["number"]},"description":"<p>for the reverb to fade</p>","name":"seconds"}],"examples":["s(\\"bd sd [~ bd] sd\\").room(0.5).rlp(10000).rfade(0.5)","s(\\"bd sd [~ bd] sd\\").room(0.5).rlp(5000).rfade(4)"],"longname":"roomfade","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the sample to use as an impulse response for the reverb.\\n * @name iresponse\\n * @tags orbit, superdough\\n * @param {string | Pattern} sample to use as an impulse response\\n * @synonyms ir\\n * @example\\n * s(\\"bd sd [~ bd] sd\\").room(.8).ir(\\"<shaker_large:0 shaker_large:2>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":2419,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the sample to use as an impulse response for the reverb.</p>","name":"iresponse","tags":["orbit","superdough"],"params":[{"type":{"names":["string","Pattern"]},"description":"<p>to use as an impulse response</p>","name":"sample"}],"synonyms_text":"ir","synonyms":["ir"],"examples":["s(\\"bd sd [~ bd] sd\\").room(.8).ir(\\"<shaker_large:0 shaker_large:2>\\")"],"longname":"iresponse","kind":"member","scope":"global"},{"comment":"/**\\n * Sets speed of the sample for the impulse response.\\n * @name irspeed\\n * @tags orbit, superdough\\n * @param {string | Pattern} speed\\n * @example\\n * samples('github:switchangel/pad')\\n * $: s(\\"brk/2\\").fit().scrub(irand(16).div(16).seg(8)).ir(\\"swpad:4\\").room(.2).irspeed(\\"<2 1 .5>/2\\").irbegin(.5).roomsize(.5)\\n *\\n */","meta":{"filename":"controls.mjs","lineno":2431,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets speed of the sample for the impulse response.</p>","name":"irspeed","tags":["orbit","superdough"],"params":[{"type":{"names":["string","Pattern"]},"name":"speed"}],"examples":["samples('github:switchangel/pad')\\n$: s(\\"brk/2\\").fit().scrub(irand(16).div(16).seg(8)).ir(\\"swpad:4\\").room(.2).irspeed(\\"<2 1 .5>/2\\").irbegin(.5).roomsize(.5)"],"longname":"irspeed","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the beginning of the IR response sample\\n * @name irbegin\\n * @tags orbit, superdough\\n * @param {string | Pattern} begin between 0 and 1\\n * @synonyms ir\\n * @example\\n * samples('github:switchangel/pad')\\n * $: s(\\"brk/2\\").fit().scrub(irand(16).div(16).seg(8)).ir(\\"swpad:4\\").room(.65).irspeed(\\"-2\\").irbegin(\\"<0 .5 .75>/2\\").roomsize(.6)\\n *\\n */","meta":{"filename":"controls.mjs","lineno":2443,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the beginning of the IR response sample</p>","name":"irbegin","tags":["orbit","superdough"],"params":[{"type":{"names":["string","Pattern"]},"description":"<p>between 0 and 1</p>","name":"begin"}],"synonyms_text":"ir","synonyms":["ir"],"examples":["samples('github:switchangel/pad')\\n$: s(\\"brk/2\\").fit().scrub(irand(16).div(16).seg(8)).ir(\\"swpad:4\\").room(.65).irspeed(\\"-2\\").irbegin(\\"<0 .5 .75>/2\\").roomsize(.6)"],"longname":"irbegin","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the room size of the reverb, see \`room\`.\\n * When this property is changed, the reverb will be recaculated, so only change this sparsely..\\n *\\n * @name roomsize\\n * @tags orbit, superdough\\n * @param {number | Pattern} size between 0 and 10\\n * @synonyms rsize, sz, size\\n * @example\\n * s(\\"bd sd [~ bd] sd\\").room(.8).rsize(1)\\n * @example\\n * s(\\"bd sd [~ bd] sd\\").room(.8).rsize(4)\\n *\\n */","meta":{"filename":"controls.mjs","lineno":2455,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the room size of the reverb, see <code>room</code>.\\nWhen this property is changed, the reverb will be recaculated, so only change this sparsely..</p>","name":"roomsize","tags":["orbit","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>between 0 and 10</p>","name":"size"}],"synonyms_text":"rsize, sz, size","synonyms":["rsize","sz","size"],"examples":["s(\\"bd sd [~ bd] sd\\").room(.8).rsize(1)","s(\\"bd sd [~ bd] sd\\").room(.8).rsize(4)"],"longname":"roomsize","kind":"member","scope":"global"},{"comment":"/**\\n * (Deprecated) Wave shaping distortion. WARNING: can suddenly get unpredictably loud.\\n * Please use distort instead, which has a more predictable response curve\\n * second option in optional array syntax (ex: \\".9:.5\\") applies a postgain to the output\\n *\\n *\\n * @name shape\\n * @tags distortion, superdough\\n * @param {number | Pattern} distortion between 0 and 1\\n * @example\\n * s(\\"bd sd [~ bd] sd,hh*8\\").shape(\\"<0 .2 .4 .6 .8>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":2477,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>(Deprecated) Wave shaping distortion. WARNING: can suddenly get unpredictably loud.\\nPlease use distort instead, which has a more predictable response curve\\nsecond option in optional array syntax (ex: ".9:.5") applies a postgain to the output</p>","name":"shape","tags":["distortion","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>between 0 and 1</p>","name":"distortion"}],"examples":["s(\\"bd sd [~ bd] sd,hh*8\\").shape(\\"<0 .2 .4 .6 .8>\\")"],"longname":"shape","kind":"member","scope":"global"},{"comment":"/**\\n * Wave shaping distortion. CAUTION: it can get loud.\\n * Second option in optional array syntax (ex: \\".9:.5\\") applies a postgain to the output. Third option sets the waveshaping type.\\n * Most useful values are usually between 0 and 10 (depending on source gain). If you are feeling adventurous, you can turn it up to 11 and beyond ;)\\n *\\n * @name distort\\n * @tags distortion, superdough, supradough\\n * @synonyms dist\\n * @param {number | Pattern} distortion amount of distortion to apply\\n * @param {number | Pattern} volume linear postgain of the distortion\\n * @param {number | string | Pattern} type type of distortion to apply\\n * @example\\n * s(\\"bd sd [~ bd] sd,hh*8\\").distort(\\"<0 2 3 10:.5>\\")\\n * @example\\n * note(\\"d1!8\\").s(\\"sine\\").penv(36).pdecay(.12).decay(.23).distort(\\"8:.4\\")\\n * @example\\n * s(\\"bd:4*4\\").bank(\\"tr808\\").distort(\\"3:0.5:diode\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":2491,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Wave shaping distortion. CAUTION: it can get loud.\\nSecond option in optional array syntax (ex: ".9:.5") applies a postgain to the output. Third option sets the waveshaping type.\\nMost useful values are usually between 0 and 10 (depending on source gain). If you are feeling adventurous, you can turn it up to 11 and beyond ;)</p>","name":"distort","tags":["distortion","superdough","supradough"],"synonyms_text":"dist","synonyms":["dist"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>amount of distortion to apply</p>","name":"distortion"},{"type":{"names":["number","Pattern"]},"description":"<p>linear postgain of the distortion</p>","name":"volume"},{"type":{"names":["number","string","Pattern"]},"description":"<p>type of distortion to apply</p>","name":"type"}],"examples":["s(\\"bd sd [~ bd] sd,hh*8\\").distort(\\"<0 2 3 10:.5>\\")","note(\\"d1!8\\").s(\\"sine\\").penv(36).pdecay(.12).decay(.23).distort(\\"8:.4\\")","s(\\"bd:4*4\\").bank(\\"tr808\\").distort(\\"3:0.5:diode\\")"],"longname":"distort","kind":"member","scope":"global"},{"comment":"/**\\n * Postgain for waveshaping distortion.\\n *\\n * @name distortvol\\n * @synonyms distortion, distvol\\n * @tags superdough, supradough\\n * @param {number | Pattern} volume linear postgain of the distortion\\n * @example\\n * s(\\"bd*4\\").bank(\\"tr909\\").distort(2).distortvol(0.8)\\n */","meta":{"filename":"controls.mjs","lineno":2512,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Postgain for waveshaping distortion.</p>","name":"distortvol","synonyms_text":"distortion, distvol","synonyms":["distortion","distvol"],"tags":["superdough","supradough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>linear postgain of the distortion</p>","name":"volume"}],"examples":["s(\\"bd*4\\").bank(\\"tr909\\").distort(2).distortvol(0.8)"],"longname":"distortvol","kind":"member","scope":"global"},{"comment":"/**\\n * Type of waveshaping distortion to apply.\\n *\\n * @name distorttype\\n * @tags distortion, superdough, supradough\\n * @synonyms disttype\\n * @param {number | string | Pattern} type type of distortion to apply\\n * @example\\n * s(\\"bd*4\\").bank(\\"tr909\\").distort(2).distorttype(\\"<0 1 2>\\")\\n *\\n * @example\\n * s(\\"sine\\").note(\\"F1*2\\").release(1)\\n * .penv(24).pdecay(0.05)\\n * .distort(rand.range(1, 8))\\n * .distorttype(\\"<fold chebyshev scurve diode asym sinefold>\\")\\n */","meta":{"filename":"controls.mjs","lineno":2524,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Type of waveshaping distortion to apply.</p>","name":"distorttype","tags":["distortion","superdough","supradough"],"synonyms_text":"disttype","synonyms":["disttype"],"params":[{"type":{"names":["number","string","Pattern"]},"description":"<p>type of distortion to apply</p>","name":"type"}],"examples":["s(\\"bd*4\\").bank(\\"tr909\\").distort(2).distorttype(\\"<0 1 2>\\")","s(\\"sine\\").note(\\"F1*2\\").release(1)\\n .penv(24).pdecay(0.05)\\n .distort(rand.range(1, 8))\\n .distorttype(\\"<fold chebyshev scurve diode asym sinefold>\\")"],"longname":"distorttype","kind":"member","scope":"global"},{"comment":"/**\\n * Dynamics Compressor. The params are \`compressor(\\"threshold:ratio:knee:attack:release\\")\`\\n * More info [here](https://developer.mozilla.org/en-US/docs/Web/API/DynamicsCompressorNode?retiredLocale=de#instance_properties)\\n *\\n * @name compressor\\n * @tags superdough\\n * @example\\n * s(\\"bd sd [~ bd] sd,hh*8\\")\\n * .compressor(\\"-20:20:10:.002:.02\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":2542,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Dynamics Compressor. The params are <code>compressor("threshold:ratio:knee:attack:release")</code>\\nMore info <a href=\\"https://developer.mozilla.org/en-US/docs/Web/API/DynamicsCompressorNode?retiredLocale=de#instance_properties\\">here</a></p>","name":"compressor","tags":["superdough"],"examples":["s(\\"bd sd [~ bd] sd,hh*8\\")\\n.compressor(\\"-20:20:10:.002:.02\\")"],"longname":"compressor","kind":"member","scope":"global"},{"comment":"/**\\n * Changes the speed of sample playback, i.e. a cheap way of changing pitch.\\n *\\n * @name speed\\n * @tags pitch, samples\\n * @param {number | Pattern} speed -inf to inf, negative numbers play the sample backwards.\\n * @example\\n * s(\\"bd*6\\").speed(\\"1 2 4 1 -2 -4\\")\\n * @example\\n * speed(\\"1 1.5*2 [2 1.1]\\").s(\\"piano\\").clip(1)\\n *\\n */","meta":{"filename":"controls.mjs","lineno":2564,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Changes the speed of sample playback, i.e. a cheap way of changing pitch.</p>","name":"speed","tags":["pitch","samples"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>inf to inf, negative numbers play the sample backwards.</p>","name":"speed"}],"examples":["s(\\"bd*6\\").speed(\\"1 2 4 1 -2 -4\\")","speed(\\"1 1.5*2 [2 1.1]\\").s(\\"piano\\").clip(1)"],"longname":"speed","kind":"member","scope":"global"},{"comment":"/**\\n * Changes the speed of sample playback, i.e. a cheap way of changing pitch.\\n *\\n * @name stretch\\n * @tags pitch, samples\\n * @param {number | Pattern} factor -inf to inf, negative numbers play the sample backwards.\\n * @example\\n * s(\\"gm_flute\\").stretch(\\"1 2 .5\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":2578,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Changes the speed of sample playback, i.e. a cheap way of changing pitch.</p>","name":"stretch","tags":["pitch","samples"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>inf to inf, negative numbers play the sample backwards.</p>","name":"factor"}],"examples":["s(\\"gm_flute\\").stretch(\\"1 2 .5\\")"],"longname":"stretch","kind":"member","scope":"global"},{"comment":"/**\\n * Used in conjunction with \`speed\`, accepts values of \\"r\\" (rate, default behavior), \\"c\\" (cycles), or \\"s\\" (seconds). Using \`unit \\"c\\"\` means \`speed\` will be interpreted in units of cycles, e.g. \`speed \\"1\\"\` means samples will be stretched to fill a cycle. Using \`unit \\"s\\"\` means the playback speed will be adjusted so that the duration is the number of seconds specified by \`speed\`.\\n *\\n * @name unit\\n * @tags superdirt\\n * @param {number | string | Pattern} unit see description above\\n * @example\\n * speed(\\"1 2 .5 3\\").s(\\"bd\\").unit(\\"c\\").osc()\\n * @superdirtOnly\\n *\\n */","meta":{"filename":"controls.mjs","lineno":2589,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Used in conjunction with <code>speed</code>, accepts values of "r" (rate, default behavior), "c" (cycles), or "s" (seconds). Using <code>unit "c"</code> means <code>speed</code> will be interpreted in units of cycles, e.g. <code>speed "1"</code> means samples will be stretched to fill a cycle. Using <code>unit "s"</code> means the playback speed will be adjusted so that the duration is the number of seconds specified by <code>speed</code>.</p>","name":"unit","tags":["superdirt",{"originalTitle":"superdirtOnly","title":"superdirtonly","text":""}],"params":[{"type":{"names":["number","string","Pattern"]},"description":"<p>see description above</p>","name":"unit"}],"examples":["speed(\\"1 2 .5 3\\").s(\\"bd\\").unit(\\"c\\").osc()"],"longname":"unit","kind":"member","scope":"global"},{"comment":"/**\\n * Made by Calum Gunn. Reminiscent of some weird mixture of filter, ring-modulator and pitch-shifter. The SuperCollider manual defines Squiz as:\\n *\\n * \\"A simplistic pitch-raising algorithm. It's not meant to sound natural; its sound is reminiscent of some weird mixture of filter, ring-modulator and pitch-shifter, depending on the input. The algorithm works by cutting the signal into fragments (delimited by upwards-going zero-crossings) and squeezing those fragments in the time domain (i.e. simply playing them back faster than they came in), leaving silences inbetween. All the parameters apart from memlen can be modulated.\\"\\n *\\n * @name squiz\\n * @tags superdirt\\n * @param {number | Pattern} squiz Try passing multiples of 2 to it - 2, 4, 8 etc.\\n * @example\\n * squiz(\\"2 4/2 6 [8 16]\\").s(\\"bd\\").osc()\\n * @superdirtOnly\\n *\\n */","meta":{"filename":"controls.mjs","lineno":2602,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Made by Calum Gunn. Reminiscent of some weird mixture of filter, ring-modulator and pitch-shifter. The SuperCollider manual defines Squiz as:</p>\\n<p>"A simplistic pitch-raising algorithm. It's not meant to sound natural; its sound is reminiscent of some weird mixture of filter, ring-modulator and pitch-shifter, depending on the input. The algorithm works by cutting the signal into fragments (delimited by upwards-going zero-crossings) and squeezing those fragments in the time domain (i.e. simply playing them back faster than they came in), leaving silences inbetween. All the parameters apart from memlen can be modulated."</p>","name":"squiz","tags":["superdirt",{"originalTitle":"superdirtOnly","title":"superdirtonly","text":""}],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>Try passing multiples of 2 to it - 2, 4, 8 etc.</p>","name":"squiz"}],"examples":["squiz(\\"2 4/2 6 [8 16]\\").s(\\"bd\\").osc()"],"longname":"squiz","kind":"member","scope":"global"},{"comment":"/**\\n *\\n * Formant filter to make things sound like vowels.\\n *\\n * @name vowel\\n * @tags superdough\\n * @param {string | Pattern} vowel You can use a e i o u ae aa oe ue y uh un en an on, corresponding to [a] [e] [i] [o] [u] [æ] [ɑ] [ø] [y] [ɯ] [ʌ] [œ̃] [ɛ̃] [ɑ̃] [ɔ̃]. Aliases: aa = å = ɑ, oe = ø = ö, y = ı, ae = æ.\\n * @example\\n * note(\\"[c2 <eb2 <g2 g1>>]*2\\").s('sawtooth')\\n * .vowel(\\"<a e i <o u>>\\")\\n * @example\\n * s(\\"bd sd mt ht bd [~ cp] ht lt\\").vowel(\\"[a|e|i|o|u]\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":2628,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Formant filter to make things sound like vowels.</p>","name":"vowel","tags":["superdough"],"params":[{"type":{"names":["string","Pattern"]},"description":"<p>You can use a e i o u ae aa oe ue y uh un en an on, corresponding to [a] [e] [i] [o] [u] [æ] [ɑ] [ø] [y] [ɯ] [ʌ] [œ̃] [ɛ̃] [ɑ̃] [ɔ̃]. Aliases: aa = å = ɑ, oe = ø = ö, y = ı, ae = æ.</p>","name":"vowel"}],"examples":["note(\\"[c2 <eb2 <g2 g1>>]*2\\").s('sawtooth')\\n.vowel(\\"<a e i <o u>>\\")","s(\\"bd sd mt ht bd [~ cp] ht lt\\").vowel(\\"[a|e|i|o|u]\\")"],"longname":"vowel","kind":"member","scope":"global"},{"comment":"/**\\n * crackle noise density\\n *\\n * @name density\\n * @tags superdough\\n * @param {number | Pattern} density between 0 and x\\n * @example\\n * s(\\"crackle*4\\").density(\\"<0.01 0.04 0.2 0.5>\\".slow(4))\\n *\\n */","meta":{"filename":"controls.mjs","lineno":2654,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>crackle noise density</p>","name":"density","tags":["superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>between 0 and x</p>","name":"density"}],"examples":["s(\\"crackle*4\\").density(\\"<0.01 0.04 0.2 0.5>\\".slow(4))"],"longname":"density","kind":"member","scope":"global"},{"comment":"/**\\n * Multiplies the duration with the given number. Also cuts samples off at the end if they exceed the duration.\\n *\\n * @name clip\\n * @tags superdough\\n * @synonyms legato\\n * @param {number | Pattern} factor >= 0\\n * @example\\n * note(\\"c a f e\\").s(\\"piano\\").clip(\\"<.5 1 2>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":2704,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Multiplies the duration with the given number. Also cuts samples off at the end if they exceed the duration.</p>","name":"clip","tags":["superdough"],"synonyms_text":"legato","synonyms":["legato"],"params":[{"type":{"names":["number","Pattern"]},"description":"<blockquote>\\n<p>= 0</p>\\n</blockquote>","name":"factor"}],"examples":["note(\\"c a f e\\").s(\\"piano\\").clip(\\"<.5 1 2>\\")"],"longname":"clip","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the duration of the event in cycles. Similar to clip / legato, it also cuts samples off at the end if they exceed the duration.\\n *\\n * @name duration\\n * @tags superdough\\n * @synonyms dur\\n * @param {number | Pattern} seconds >= 0\\n * @example\\n * note(\\"c a f e\\").s(\\"piano\\").dur(\\"<.5 1 2>\\")\\n *\\n */","meta":{"filename":"controls.mjs","lineno":2717,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the duration of the event in cycles. Similar to clip / legato, it also cuts samples off at the end if they exceed the duration.</p>","name":"duration","tags":["superdough"],"synonyms_text":"dur","synonyms":["dur"],"params":[{"type":{"names":["number","Pattern"]},"description":"<blockquote>\\n<p>= 0</p>\\n</blockquote>","name":"seconds"}],"examples":["note(\\"c a f e\\").s(\\"piano\\").dur(\\"<.5 1 2>\\")"],"longname":"duration","kind":"member","scope":"global"},{"comment":"/**\\n * Sets the color of the hap in visualizations like pianoroll or highlighting.\\n * @name color\\n * @tags visualization\\n * @synonyms colour\\n * @param {string} color Hexadecimal or CSS color name\\n */","meta":{"filename":"controls.mjs","lineno":2746,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets the color of the hap in visualizations like pianoroll or highlighting.</p>","name":"color","tags":["visualization"],"synonyms_text":"colour","synonyms":["colour"],"params":[{"type":{"names":["string"]},"description":"<p>Hexadecimal or CSS color name</p>","name":"color"}],"longname":"color","kind":"member","scope":"global"},{"comment":"/**\\n * ADSR envelope: Combination of Attack, Decay, Sustain, and Release.\\n *\\n * @name adsr\\n * @tags envelope, amplitude\\n * @param {number | Pattern} time attack time in seconds\\n * @param {number | Pattern} time decay time in seconds\\n * @param {number | Pattern} gain sustain level (0 to 1)\\n * @param {number | Pattern} time release time in seconds\\n * @example\\n * note(\\"[c3 bb2 f3 eb3]*2\\").sound(\\"sawtooth\\").lpf(600).adsr(\\".1:.1:.5:.2\\")\\n */","meta":{"filename":"controls.mjs","lineno":2760,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>ADSR envelope: Combination of Attack, Decay, Sustain, and Release.</p>","name":"adsr","tags":["envelope","amplitude"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>attack time in seconds</p>","name":"time"},{"type":{"names":["number","Pattern"]},"description":"<p>decay time in seconds</p>","name":"time"},{"type":{"names":["number","Pattern"]},"description":"<p>sustain level (0 to 1)</p>","name":"gain"},{"type":{"names":["number","Pattern"]},"description":"<p>release time in seconds</p>","name":"time"}],"examples":["note(\\"[c3 bb2 f3 eb3]*2\\").sound(\\"sawtooth\\").lpf(600).adsr(\\".1:.1:.5:.2\\")"],"longname":"adsr","kind":"member","scope":"global"},{"comment":"/**\\n * MIDI channel: Sets the MIDI channel for the event.\\n *\\n * @name midichan\\n * @tags external_io, midi\\n * @param {number | Pattern} channel MIDI channel number (0-15)\\n * @example\\n * note(\\"c4\\").midichan(1).midi()\\n */","meta":{"filename":"controls.mjs","lineno":2795,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>MIDI channel: Sets the MIDI channel for the event.</p>","name":"midichan","tags":["external_io","midi"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>MIDI channel number (0-15)</p>","name":"channel"}],"examples":["note(\\"c4\\").midichan(1).midi()"],"longname":"midichan","kind":"member","scope":"global"},{"comment":"/**\\n * MIDI port: Sets the MIDI port for the event.\\n *\\n * @name midiport\\n * @tags external_io, midi\\n * @param {number | Pattern} port MIDI port\\n * @example\\n * note(\\"c a f e\\").midiport(\\"<0 1 2 3>\\").midi()\\n */","meta":{"filename":"controls.mjs","lineno":2808,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>MIDI port: Sets the MIDI port for the event.</p>","name":"midiport","tags":["external_io","midi"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>MIDI port</p>","name":"port"}],"examples":["note(\\"c a f e\\").midiport(\\"<0 1 2 3>\\").midi()"],"longname":"midiport","kind":"member","scope":"global"},{"comment":"/**\\n * MIDI command: Sends a MIDI command message.\\n *\\n * @name midicmd\\n * @tags external_io, midi\\n * @param {number | Pattern} command MIDI command\\n * @example\\n * midicmd(\\"clock*48,<start stop>/2\\").midi()\\n */","meta":{"filename":"controls.mjs","lineno":2819,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>MIDI command: Sends a MIDI command message.</p>","name":"midicmd","tags":["external_io","midi"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>MIDI command</p>","name":"command"}],"examples":["midicmd(\\"clock*48,<start stop>/2\\").midi()"],"longname":"midicmd","kind":"member","scope":"global"},{"comment":"/**\\n * MIDI control: Sends a MIDI control change message.\\n *\\n * @name control\\n * @tags external_io, midi\\n * @param {number | Pattern} MIDI control number (0-127)\\n * @param {number | Pattern} MIDI controller value (0-127)\\n */","meta":{"filename":"controls.mjs","lineno":2830,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>MIDI control: Sends a MIDI control change message.</p>","name":"control","tags":["external_io","midi"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>control number (0-127)</p>","name":"MIDI"},{"type":{"names":["number","Pattern"]},"description":"<p>controller value (0-127)</p>","name":"MIDI"}],"longname":"control","kind":"member","scope":"global"},{"comment":"/**\\n * MIDI control number: Sends a MIDI control change message.\\n *\\n * @name ccn\\n * @tags external_io, midi\\n * @param {number | Pattern} MIDI control number (0-127)\\n */","meta":{"filename":"controls.mjs","lineno":2846,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>MIDI control number: Sends a MIDI control change message.</p>","name":"ccn","tags":["external_io","midi"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>control number (0-127)</p>","name":"MIDI"}],"longname":"ccn","kind":"member","scope":"global"},{"comment":"/**\\n * MIDI control value: Sends a MIDI control change message.\\n *\\n * @name ccv\\n * @tags external_io, midi\\n * @param {number | Pattern} MIDI control value (0-127)\\n */","meta":{"filename":"controls.mjs","lineno":2854,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>MIDI control value: Sends a MIDI control change message.</p>","name":"ccv","tags":["external_io","midi"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>control value (0-127)</p>","name":"MIDI"}],"longname":"ccv","kind":"member","scope":"global"},{"comment":"/**\\n * MIDI NRPN non-registered parameter number: Sends a MIDI NRPN non-registered parameter number message.\\n * @name nrpnn\\n * @tags external_io, midi\\n * @param {number | Pattern} nrpnn MIDI NRPN non-registered parameter number (0-127)\\n * @example\\n * note(\\"c4\\").nrpnn(\\"1:8\\").nrpv(\\"123\\").midichan(1).midi()\\n */","meta":{"filename":"controls.mjs","lineno":2865,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>MIDI NRPN non-registered parameter number: Sends a MIDI NRPN non-registered parameter number message.</p>","name":"nrpnn","tags":["external_io","midi"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>MIDI NRPN non-registered parameter number (0-127)</p>","name":"nrpnn"}],"examples":["note(\\"c4\\").nrpnn(\\"1:8\\").nrpv(\\"123\\").midichan(1).midi()"],"longname":"nrpnn","kind":"member","scope":"global"},{"comment":"/**\\n * MIDI NRPN non-registered parameter value: Sends a MIDI NRPN non-registered parameter value message.\\n * @name nrpv\\n * @tags external_io, midi\\n * @param {number | Pattern} nrpv MIDI NRPN non-registered parameter value (0-127)\\n * @example\\n * note(\\"c4\\").nrpnn(\\"1:8\\").nrpv(\\"123\\").midichan(1).midi()\\n */","meta":{"filename":"controls.mjs","lineno":2874,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>MIDI NRPN non-registered parameter value: Sends a MIDI NRPN non-registered parameter value message.</p>","name":"nrpv","tags":["external_io","midi"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>MIDI NRPN non-registered parameter value (0-127)</p>","name":"nrpv"}],"examples":["note(\\"c4\\").nrpnn(\\"1:8\\").nrpv(\\"123\\").midichan(1).midi()"],"longname":"nrpv","kind":"member","scope":"global"},{"comment":"/**\\n * MIDI program number: Sends a MIDI program change message.\\n *\\n * @name progNum\\n * @tags external_io\\n * @param {number | Pattern} program MIDI program number (0-127)\\n * @example\\n * note(\\"c4\\").progNum(10).midichan(1).midi()\\n */","meta":{"filename":"controls.mjs","lineno":2884,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>MIDI program number: Sends a MIDI program change message.</p>","name":"progNum","tags":["external_io"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>MIDI program number (0-127)</p>","name":"program"}],"examples":["note(\\"c4\\").progNum(10).midichan(1).midi()"],"longname":"progNum","kind":"member","scope":"global"},{"comment":"/**\\n * MIDI sysex: Sends a MIDI sysex message.\\n * @name sysex\\n * @tags external_io, midi\\n * @param {number | Pattern} id Sysex ID\\n * @param {number | Pattern} data Sysex data\\n * @example\\n * note(\\"c4\\").sysex([\\"0x77\\", \\"0x01:0x02:0x03:0x04\\"]).midichan(1).midi()\\n */","meta":{"filename":"controls.mjs","lineno":2895,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>MIDI sysex: Sends a MIDI sysex message.</p>","name":"sysex","tags":["external_io","midi"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>Sysex ID</p>","name":"id"},{"type":{"names":["number","Pattern"]},"description":"<p>Sysex data</p>","name":"data"}],"examples":["note(\\"c4\\").sysex([\\"0x77\\", \\"0x01:0x02:0x03:0x04\\"]).midichan(1).midi()"],"longname":"sysex","kind":"member","scope":"global"},{"comment":"/**\\n * MIDI sysex ID: Sends a MIDI sysex identifier message.\\n * @name sysexid\\n * @tags external_io, midi\\n * @param {number | Pattern} id Sysex ID\\n * @example\\n * note(\\"c4\\").sysexid(\\"0x77\\").sysexdata(\\"0x01:0x02:0x03:0x04\\").midichan(1).midi()\\n */","meta":{"filename":"controls.mjs","lineno":2911,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>MIDI sysex ID: Sends a MIDI sysex identifier message.</p>","name":"sysexid","tags":["external_io","midi"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>Sysex ID</p>","name":"id"}],"examples":["note(\\"c4\\").sysexid(\\"0x77\\").sysexdata(\\"0x01:0x02:0x03:0x04\\").midichan(1).midi()"],"longname":"sysexid","kind":"member","scope":"global"},{"comment":"/**\\n * MIDI sysex data: Sends a MIDI sysex message.\\n * @name sysexdata\\n * @tags external_io, midi\\n * @param {number | Pattern} data Sysex data\\n * @example\\n * note(\\"c4\\").sysexid(\\"0x77\\").sysexdata(\\"0x01:0x02:0x03:0x04\\").midichan(1).midi()\\n */","meta":{"filename":"controls.mjs","lineno":2920,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>MIDI sysex data: Sends a MIDI sysex message.</p>","name":"sysexdata","tags":["external_io","midi"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>Sysex data</p>","name":"data"}],"examples":["note(\\"c4\\").sysexid(\\"0x77\\").sysexdata(\\"0x01:0x02:0x03:0x04\\").midichan(1).midi()"],"longname":"sysexdata","kind":"member","scope":"global"},{"comment":"/**\\n * MIDI pitch bend: Sends a MIDI pitch bend message.\\n * @name midibend\\n * @tags external_io, midi\\n * @param {number | Pattern} midibend MIDI pitch bend (-1 - 1)\\n * @example\\n * note(\\"c4\\").midibend(sine.slow(4).range(-0.4,0.4)).midi()\\n */","meta":{"filename":"controls.mjs","lineno":2930,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>MIDI pitch bend: Sends a MIDI pitch bend message.</p>","name":"midibend","tags":["external_io","midi"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>MIDI pitch bend (-1 - 1)</p>","name":"midibend"}],"examples":["note(\\"c4\\").midibend(sine.slow(4).range(-0.4,0.4)).midi()"],"longname":"midibend","kind":"member","scope":"global"},{"comment":"/**\\n * MIDI key after touch: Sends a MIDI key after touch message.\\n * @name miditouch\\n * @tags external_io, midi\\n * @param {number | Pattern} miditouch MIDI key after touch (0-1)\\n * @example\\n * note(\\"c4\\").miditouch(sine.slow(4).range(0,1)).midi()\\n */","meta":{"filename":"controls.mjs","lineno":2939,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>MIDI key after touch: Sends a MIDI key after touch message.</p>","name":"miditouch","tags":["external_io","midi"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>MIDI key after touch (0-1)</p>","name":"miditouch"}],"examples":["note(\\"c4\\").miditouch(sine.slow(4).range(0,1)).midi()"],"longname":"miditouch","kind":"member","scope":"global"},{"comment":"/**\\n * The host to send open sound control messages to. Requires running the OSC bridge.\\n * @name oschost\\n * @tags external_io\\n * @param {string | Pattern} oschost e.g. 'localhost'\\n * @example\\n * note(\\"c4\\").oschost('127.0.0.1').oscport(57120).osc();\\n */","meta":{"filename":"controls.mjs","lineno":2952,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>The host to send open sound control messages to. Requires running the OSC bridge.</p>","name":"oschost","tags":["external_io"],"params":[{"type":{"names":["string","Pattern"]},"description":"<p>e.g. 'localhost'</p>","name":"oschost"}],"examples":["note(\\"c4\\").oschost('127.0.0.1').oscport(57120).osc();"],"longname":"oschost","kind":"member","scope":"global"},{"comment":"/**\\n * The port to send open sound control messages to. Requires running the OSC bridge.\\n * @name oscport\\n * @tags external_io\\n * @param {number | Pattern} oscport e.g. 57120\\n * @example\\n * note(\\"c4\\").oschost('127.0.0.1').oscport(57120).osc();\\n */","meta":{"filename":"controls.mjs","lineno":2962,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>The port to send open sound control messages to. Requires running the OSC bridge.</p>","name":"oscport","tags":["external_io"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>e.g. 57120</p>","name":"oscport"}],"examples":["note(\\"c4\\").oschost('127.0.0.1').oscport(57120).osc();"],"longname":"oscport","kind":"member","scope":"global"},{"comment":"/**\\n * Sets properties in a batch.\\n *\\n * @name as\\n * @tags combiners\\n * @param {String | Array} mapping the control names that are set\\n * @example\\n * \\"c:.5 a:1 f:.25 e:.8\\".as(\\"note:clip\\")\\n * @example\\n * \\"{0@2 0.25 0 0.5 .3 .5}%8\\".as(\\"begin\\").s(\\"sax_vib\\").clip(1)\\n */","meta":{"filename":"controls.mjs","lineno":2979,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets properties in a batch.</p>","name":"as","tags":["combiners"],"params":[{"type":{"names":["String","Array"]},"description":"<p>the control names that are set</p>","name":"mapping"}],"examples":["\\"c:.5 a:1 f:.25 e:.8\\".as(\\"note:clip\\")","\\"{0@2 0.25 0 0.5 .3 .5}%8\\".as(\\"begin\\").s(\\"sax_vib\\").clip(1)"],"longname":"as","kind":"member","scope":"global"},{"comment":"/**\\n * Allows you to scrub an audio file like a tape loop by passing values that represents the position in the audio file\\n * in the optional array syntax ex: \\"0.5:2\\", the second value controls the speed of playback\\n * @name scrub\\n * @tags samples\\n * @memberof Pattern\\n * @returns Pattern\\n * @example\\n * samples('github:switchangel/pad')\\n * s(\\"swpad:0\\").scrub(\\"{0.1!2 .25@3 0.7!2 <0.8:1.5>}%8\\")\\n * @example\\n * samples('github:yaxu/clean-breaks/main');\\n * s(\\"amen/4\\").fit().scrub(\\"{0@3 0@2 4@3}%8\\".div(16))\\n */","meta":{"filename":"controls.mjs","lineno":3004,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Allows you to scrub an audio file like a tape loop by passing values that represents the position in the audio file\\nin the optional array syntax ex: "0.5:2", the second value controls the speed of playback</p>","name":"scrub","tags":["samples"],"memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"examples":["samples('github:switchangel/pad')\\ns(\\"swpad:0\\").scrub(\\"{0.1!2 .25@3 0.7!2 <0.8:1.5>}%8\\")","samples('github:yaxu/clean-breaks/main');\\ns(\\"amen/4\\").fit().scrub(\\"{0@3 0@2 4@3}%8\\".div(16))"],"scope":"static","longname":"Pattern.scrub","kind":"member"},{"comment":"/**\\n * Configures an LFO. Can be called in sequence like pat.lfo(...).lfo(...) to set up multiple LFOs.\\n * There are two ways to declare which control will be modulated:\\n * 1. Explicitly put \`control\` in the config (e.g. \`lfo({ c: \\"lpf\\" })\`)\\n * 2. If the control parameter is absent, the control _immediately before_ the \`lfo\` call will be used\\n * (e.g. \`s(\\"saw\\").lpf(500).lfo()\` to modulate \`lpf\`)\\n *\\n * Modulators can be referred to by \`id\` so that they can be updated later e.g. inside\\n * a \`sometimes\`. See example below.\\n *\\n * @name lfo\\n * @tags lfo, superdough\\n * @param {Object} config LFO configuration.\\n * @param {string | Pattern} [config.control] Node to modulate. Aliases: c\\n * @param {string | Pattern} [config.subControl] Sub-control name to append to the control key. Aliases: sc\\n * @param {number | Pattern} [config.rate] Modulation rate. Aliases: r\\n * @param {number | Pattern} [config.sync] Tempo-synced modulation rate. Aliases: s\\n * @param {number | Pattern} [config.depth] Relative modulation depth. Aliases: dep, dr\\n * @param {number | Pattern} [config.depthabs] Absolute modulation depth. Aliases: da\\n * @param {number | Pattern} [config.dcoffset] DC offset / bias for the waveform. Aliases: dc\\n * @param {number | Pattern} [config.shape] Shape index. Aliases: sh\\n * @param {number | Pattern} [config.skew] Skew amount. Aliases: sk\\n * @param {number | Pattern} [config.curve] Exponential curve amount. Aliases: cu\\n * @param {number | Pattern} [config.retrig] If > 0.5, the LFO will retrigger on each event. Aliases: rt\\n * @param {number | Pattern} [config.fxi] FX index to target\\n * @param {string | Pattern} id ID to use for this modulator\\n * @returns Pattern\\n *\\n * @example\\n * s(\\"saw\\").note(\\"F1\\").lpf(500).lfo()\\n *\\n * @example\\n * s(\\"saw\\").lfo().lpf(500).lfo({ s: 0.3 })\\n *\\n * @example\\n * s(\\"saw\\").lpf(500).diode(0.3)\\n * .lfo({ c: \\"lpf\\" })\\n *\\n * @example\\n * s(\\"pulse\\").lpf(500).lfo()\\n * .lfo({ c: \\"s\\" })\\n * .diode(0.3)\\n * .sometimes(x => x.lfo({ s: \\"8\\" }, 1)) // lfo #1 (0-indexed)\\n *\\n * @example\\n * s(\\"pulse\\").lpf(500).lfo({ depth: 4 }, 'lpf_mod')\\n * .lfo({ c: \\"s\\" })\\n * .diode(0.3)\\n * .sometimes(x => x.lfo({ s: \\"8\\" }, 'lpf_mod'))\\n */","meta":{"filename":"controls.mjs","lineno":3138,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Configures an LFO. Can be called in sequence like pat.lfo(...).lfo(...) to set up multiple LFOs.\\nThere are two ways to declare which control will be modulated:</p>\\n<ol>\\n<li>Explicitly put <code>control</code> in the config (e.g. <code>lfo({ c: "lpf" })</code>)</li>\\n<li>If the control parameter is absent, the control <em>immediately before</em> the <code>lfo</code> call will be used\\n(e.g. <code>s("saw").lpf(500).lfo()</code> to modulate <code>lpf</code>)</li>\\n</ol>\\n<p>Modulators can be referred to by <code>id</code> so that they can be updated later e.g. inside\\na <code>sometimes</code>. See example below.</p>","name":"lfo","tags":["lfo","superdough"],"params":[{"type":{"names":["Object"]},"description":"<p>LFO configuration.</p>","name":"config"},{"type":{"names":["string","Pattern"]},"optional":true,"description":"<p>Node to modulate. Aliases: c</p>","name":"config.control"},{"type":{"names":["string","Pattern"]},"optional":true,"description":"<p>Sub-control name to append to the control key. Aliases: sc</p>","name":"config.subControl"},{"type":{"names":["number","Pattern"]},"optional":true,"description":"<p>Modulation rate. Aliases: r</p>","name":"config.rate"},{"type":{"names":["number","Pattern"]},"optional":true,"description":"<p>Tempo-synced modulation rate. Aliases: s</p>","name":"config.sync"},{"type":{"names":["number","Pattern"]},"optional":true,"description":"<p>Relative modulation depth. Aliases: dep, dr</p>","name":"config.depth"},{"type":{"names":["number","Pattern"]},"optional":true,"description":"<p>Absolute modulation depth. Aliases: da</p>","name":"config.depthabs"},{"type":{"names":["number","Pattern"]},"optional":true,"description":"<p>DC offset / bias for the waveform. Aliases: dc</p>","name":"config.dcoffset"},{"type":{"names":["number","Pattern"]},"optional":true,"description":"<p>Shape index. Aliases: sh</p>","name":"config.shape"},{"type":{"names":["number","Pattern"]},"optional":true,"description":"<p>Skew amount. Aliases: sk</p>","name":"config.skew"},{"type":{"names":["number","Pattern"]},"optional":true,"description":"<p>Exponential curve amount. Aliases: cu</p>","name":"config.curve"},{"type":{"names":["number","Pattern"]},"optional":true,"description":"<p>If > 0.5, the LFO will retrigger on each event. Aliases: rt</p>","name":"config.retrig"},{"type":{"names":["number","Pattern"]},"optional":true,"description":"<p>FX index to target</p>","name":"config.fxi"},{"type":{"names":["string","Pattern"]},"description":"<p>ID to use for this modulator</p>","name":"id"}],"returns":[{"description":"<p>Pattern</p>"}],"examples":["s(\\"saw\\").note(\\"F1\\").lpf(500).lfo()","s(\\"saw\\").lfo().lpf(500).lfo({ s: 0.3 })","s(\\"saw\\").lpf(500).diode(0.3)\\n .lfo({ c: \\"lpf\\" })","s(\\"pulse\\").lpf(500).lfo()\\n .lfo({ c: \\"s\\" })\\n .diode(0.3)\\n .sometimes(x => x.lfo({ s: \\"8\\" }, 1)) // lfo #1 (0-indexed)","s(\\"pulse\\").lpf(500).lfo({ depth: 4 }, 'lpf_mod')\\n .lfo({ c: \\"s\\" })\\n .diode(0.3)\\n .sometimes(x => x.lfo({ s: \\"8\\" }, 'lpf_mod'))"],"longname":"lfo","kind":"member","scope":"global"},{"comment":"/**\\n * Configures an envelope. Can be called in sequence like pat.env(...).env(...) to set up multiple envelopes\\n * There are two ways to declare which control will be modulated:\\n * 1. Explicitly put \`control\` in the config (e.g. \`env({ c: \\"lpf\\" })\`)\\n * 2. If the control parameter is absent, the control _immediately before_ the \`env\` call will be used\\n * (e.g. \`s(\\"saw\\").lpf(500).env({ a: 1 })\` to modulate \`lpf\`)\\n *\\n * Modulators can be referred to by \`id\` so that they can be updated later e.g. inside\\n * a \`sometimes\`. See example below.\\n *\\n * @name env\\n * @tags envelope, superdough\\n * @param {Object} config Envelope configuration.\\n * @param {string | Pattern} [config.control] Node to modulate. Aliases: c\\n * @param {string | Pattern} [config.subControl] Sub-control name to append to the control key. Aliases: sc\\n * @param {number | Pattern} [config.depth] Relative modulation depth. Aliases: dep, dr\\n * @param {number | Pattern} [config.depthabs] Absolute modulation depth. Aliases: da\\n * @param {number | Pattern} [config.attack] Time to reach depth. Aliases: att, a\\n * @param {number | Pattern} [config.decay] Time to reach sustain. Aliases: dec, d\\n * @param {number | Pattern} [config.sustain] Sustain depth. Aliases: sus, s\\n * @param {number | Pattern} [config.release] Time to return to nominal value. Aliases: rel, r\\n * @param {number | Pattern} [config.acurve] Snappiness of attack curve (-1 = relaxed, 1 = snappy). Aliases: ac\\n * @param {number | Pattern} [config.dcurve] Snappiness of decay curve (-1 = relaxed, 1 = snappy). Aliases: dc\\n * @param {number | Pattern} [config.rcurve] Snappiness of release curve (-1 = relaxed, 1 = snappy). Aliases: rc\\n * @param {number | Pattern} [config.fxi] FX index to target\\n * @param {string | Pattern} id ID to use for this modulator\\n * @returns Pattern\\n *\\n * @example\\n * s(\\"saw\\").note(\\"F1\\").lpf(500).env({ a: 1 })\\n *\\n * @example\\n * s(\\"saw\\").env({ d: 1 }).note(\\"F1\\")\\n * .lpq(4).lpf(50)\\n * .env({ a: 0.1, d: 1, ac: 0.8, dc: 0.3, depth: 50 })\\n *\\n * @example\\n * s(\\"saw\\").lpf(500).diode(0.3)\\n * .env({ c: \\"lpf\\", a: 0.5, d: 0.5 })\\n *\\n * @example\\n * s(\\"pulse\\").lpf(500).env({ a: 1 })\\n * .env({ c: \\"s\\", a: 1 })\\n * .diode(0.3)\\n * .sometimes(x => x.env({ a: \\"0.5\\" }, 1)) // envelope #1 (0-indexed)\\n *\\n * @example\\n * s(\\"pulse\\").lpf(500).env({ a: 1 }, 'lpf_mod')\\n * .env({ c: \\"s\\", a: 1 })\\n * .diode(0.3)\\n * .sometimes(x => x.env({ a: \\"0.5\\" }, 'lpf_mod'))\\n */","meta":{"filename":"controls.mjs","lineno":3193,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Configures an envelope. Can be called in sequence like pat.env(...).env(...) to set up multiple envelopes\\nThere are two ways to declare which control will be modulated:</p>\\n<ol>\\n<li>Explicitly put <code>control</code> in the config (e.g. <code>env({ c: "lpf" })</code>)</li>\\n<li>If the control parameter is absent, the control <em>immediately before</em> the <code>env</code> call will be used\\n(e.g. <code>s("saw").lpf(500).env({ a: 1 })</code> to modulate <code>lpf</code>)</li>\\n</ol>\\n<p>Modulators can be referred to by <code>id</code> so that they can be updated later e.g. inside\\na <code>sometimes</code>. See example below.</p>","name":"env","tags":["envelope","superdough"],"params":[{"type":{"names":["Object"]},"description":"<p>Envelope configuration.</p>","name":"config"},{"type":{"names":["string","Pattern"]},"optional":true,"description":"<p>Node to modulate. Aliases: c</p>","name":"config.control"},{"type":{"names":["string","Pattern"]},"optional":true,"description":"<p>Sub-control name to append to the control key. Aliases: sc</p>","name":"config.subControl"},{"type":{"names":["number","Pattern"]},"optional":true,"description":"<p>Relative modulation depth. Aliases: dep, dr</p>","name":"config.depth"},{"type":{"names":["number","Pattern"]},"optional":true,"description":"<p>Absolute modulation depth. Aliases: da</p>","name":"config.depthabs"},{"type":{"names":["number","Pattern"]},"optional":true,"description":"<p>Time to reach depth. Aliases: att, a</p>","name":"config.attack"},{"type":{"names":["number","Pattern"]},"optional":true,"description":"<p>Time to reach sustain. Aliases: dec, d</p>","name":"config.decay"},{"type":{"names":["number","Pattern"]},"optional":true,"description":"<p>Sustain depth. Aliases: sus, s</p>","name":"config.sustain"},{"type":{"names":["number","Pattern"]},"optional":true,"description":"<p>Time to return to nominal value. Aliases: rel, r</p>","name":"config.release"},{"type":{"names":["number","Pattern"]},"optional":true,"description":"<p>Snappiness of attack curve (-1 = relaxed, 1 = snappy). Aliases: ac</p>","name":"config.acurve"},{"type":{"names":["number","Pattern"]},"optional":true,"description":"<p>Snappiness of decay curve (-1 = relaxed, 1 = snappy). Aliases: dc</p>","name":"config.dcurve"},{"type":{"names":["number","Pattern"]},"optional":true,"description":"<p>Snappiness of release curve (-1 = relaxed, 1 = snappy). Aliases: rc</p>","name":"config.rcurve"},{"type":{"names":["number","Pattern"]},"optional":true,"description":"<p>FX index to target</p>","name":"config.fxi"},{"type":{"names":["string","Pattern"]},"description":"<p>ID to use for this modulator</p>","name":"id"}],"returns":[{"description":"<p>Pattern</p>"}],"examples":["s(\\"saw\\").note(\\"F1\\").lpf(500).env({ a: 1 })","s(\\"saw\\").env({ d: 1 }).note(\\"F1\\")\\n .lpq(4).lpf(50)\\n .env({ a: 0.1, d: 1, ac: 0.8, dc: 0.3, depth: 50 })","s(\\"saw\\").lpf(500).diode(0.3)\\n .env({ c: \\"lpf\\", a: 0.5, d: 0.5 })","s(\\"pulse\\").lpf(500).env({ a: 1 })\\n .env({ c: \\"s\\", a: 1 })\\n .diode(0.3)\\n .sometimes(x => x.env({ a: \\"0.5\\" }, 1)) // envelope #1 (0-indexed)","s(\\"pulse\\").lpf(500).env({ a: 1 }, 'lpf_mod')\\n .env({ c: \\"s\\", a: 1 })\\n .diode(0.3)\\n .sometimes(x => x.env({ a: \\"0.5\\" }, 'lpf_mod'))"],"longname":"env","kind":"member","scope":"global"},{"comment":"/**\\n * Modulates with the output from a given \`bus\`.\\n * Can be called in sequence like pat.bmod(...).bmod(...) to set up multiple modulators\\n *\\n * Send to an audio bus with \`otherPat.bus(..)\`.\\n *\\n * There are two ways to declare which control will be modulated:\\n * 1. Explicitly put \`control\` in the config (e.g. \`bmod({ id: 2, c: \\"lpf\\" })\`)\\n * 2. If the control parameter is absent, the control _immediately before_ the \`bmod\` call will be used\\n * (e.g. \`s(\\"saw\\").lpf(500).bmod({ id: 2 })\` to modulate \`lpf\`)\\n *\\n * Modulators can be referred to by \`id\` so that they can be updated later e.g. inside\\n * a \`sometimes\`. See example below.\\n *\\n * @name bmod\\n * @tags superdough\\n * @param {Object} config Bus modulation configuration.\\n * @param {string | Pattern} [config.bus] Bus to get modulation signal from\\n * @param {string | Pattern} [config.control] Node to modulate. Aliases: c\\n * @param {string | Pattern} [config.subControl] Sub-control name to append to the control key. Aliases: sc\\n * @param {number | Pattern} [config.depth] Relative modulation depth. Aliases: dep, dr\\n * @param {number | Pattern} [config.depthabs] Absolute modulation depth. Aliases: da\\n * @param {number | Pattern} [config.dc] DC offset prior to application\\n * @param {number | Pattern} [config.fxi] FX index to target\\n * @param {string | Pattern} id ID to use for this modulator\\n * @returns Pattern\\n *\\n * @example\\n * modulator: s(\\"one\\").seg(64).gain(slider(0, 0, 1)).bus(1).dry(0)\\n * carrier: s(\\"saw\\").bmod({ b: 1 })\\n *\\n */","meta":{"filename":"controls.mjs","lineno":3250,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Modulates with the output from a given <code>bus</code>.\\nCan be called in sequence like pat.bmod(...).bmod(...) to set up multiple modulators</p>\\n<p>Send to an audio bus with <code>otherPat.bus(..)</code>.</p>\\n<p>There are two ways to declare which control will be modulated:</p>\\n<ol>\\n<li>Explicitly put <code>control</code> in the config (e.g. <code>bmod({ id: 2, c: "lpf" })</code>)</li>\\n<li>If the control parameter is absent, the control <em>immediately before</em> the <code>bmod</code> call will be used\\n(e.g. <code>s("saw").lpf(500).bmod({ id: 2 })</code> to modulate <code>lpf</code>)</li>\\n</ol>\\n<p>Modulators can be referred to by <code>id</code> so that they can be updated later e.g. inside\\na <code>sometimes</code>. See example below.</p>","name":"bmod","tags":["superdough"],"params":[{"type":{"names":["Object"]},"description":"<p>Bus modulation configuration.</p>","name":"config"},{"type":{"names":["string","Pattern"]},"optional":true,"description":"<p>Bus to get modulation signal from</p>","name":"config.bus"},{"type":{"names":["string","Pattern"]},"optional":true,"description":"<p>Node to modulate. Aliases: c</p>","name":"config.control"},{"type":{"names":["string","Pattern"]},"optional":true,"description":"<p>Sub-control name to append to the control key. Aliases: sc</p>","name":"config.subControl"},{"type":{"names":["number","Pattern"]},"optional":true,"description":"<p>Relative modulation depth. Aliases: dep, dr</p>","name":"config.depth"},{"type":{"names":["number","Pattern"]},"optional":true,"description":"<p>Absolute modulation depth. Aliases: da</p>","name":"config.depthabs"},{"type":{"names":["number","Pattern"]},"optional":true,"description":"<p>DC offset prior to application</p>","name":"config.dc"},{"type":{"names":["number","Pattern"]},"optional":true,"description":"<p>FX index to target</p>","name":"config.fxi"},{"type":{"names":["string","Pattern"]},"description":"<p>ID to use for this modulator</p>","name":"id"}],"returns":[{"description":"<p>Pattern</p>"}],"examples":["modulator: s(\\"one\\").seg(64).gain(slider(0, 0, 1)).bus(1).dry(0)\\ncarrier: s(\\"saw\\").bmod({ b: 1 })"],"longname":"bmod","kind":"member","scope":"global"},{"comment":"/**\\n * Transient shaper. Gives independent control over the emphasis on transients\\n * and sustains\\n *\\n * @name transient\\n * @tags superdough\\n * @param {number | Pattern} attack Emphasis on transients; between -1 (deaccentuate) and 1 (accentuate)\\n * @param {number | Pattern} sustain Emphasis on the sustains; between -1 (deaccentuate) and 1 (accentuate)\\n * @example\\n * s(\\"bd\\").transient(\\"<-1 -0.5 0 0.5 1>\\")\\n * @example\\n * s(\\"hh*16\\").bank(\\"tr909\\").transient(\\"<-1:1 1:-1>\\")\\n */","meta":{"filename":"controls.mjs","lineno":3287,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Transient shaper. Gives independent control over the emphasis on transients\\nand sustains</p>","name":"transient","tags":["superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>Emphasis on transients; between -1 (deaccentuate) and 1 (accentuate)</p>","name":"attack"},{"type":{"names":["number","Pattern"]},"description":"<p>Emphasis on the sustains; between -1 (deaccentuate) and 1 (accentuate)</p>","name":"sustain"}],"examples":["s(\\"bd\\").transient(\\"<-1 -0.5 0 0.5 1>\\")","s(\\"hh*16\\").bank(\\"tr909\\").transient(\\"<-1:1 1:-1>\\")"],"longname":"transient","kind":"member","scope":"global"},{"comment":"/**\\n * Intended for a debugging, drawLine renders the pattern as a string, where each character represents the same time span.\\n * Should only be used with single characters as values, otherwise the character slots will be messed up.\\n * Character legend:\\n *\\n * - \\"|\\" cycle separator\\n * - \\"-\\" hold previous value\\n * - \\".\\" silence\\n *\\n * @tags visualization\\n * @param {Pattern} pattern the pattern to use\\n * @param {number} chars max number of characters (approximately)\\n * @returns string\\n * @example\\n * const line = drawLine(\\"0 [1 2 3]\\", 10); // |0--123|0--123\\n * console.log(line);\\n * silence;\\n */","meta":{"range":[1449,2819],"filename":"drawLine.mjs","lineno":27,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100026241","name":"drawLine","type":"FunctionDeclaration","paramnames":["pat","chars"]},"vars":{"cycle":"drawLine~cycle","pos":"drawLine~pos","lines":"drawLine~lines","emptyLine":"drawLine~emptyLine","haps":"drawLine~haps","durations":"drawLine~durations","":null,"charFraction":"drawLine~charFraction","totalSlots":"drawLine~totalSlots","i":"drawLine~i","undefined":null,"matches":"drawLine~matches","missingLines":"drawLine~missingLines"}},"description":"<p>Intended for a debugging, drawLine renders the pattern as a string, where each character represents the same time span.\\nShould only be used with single characters as values, otherwise the character slots will be messed up.\\nCharacter legend:</p>\\n<ul>\\n<li>"|" cycle separator</li>\\n<li>"-" hold previous value</li>\\n<li>"." silence</li>\\n</ul>","tags":["visualization"],"params":[{"type":{"names":["Pattern"]},"description":"<p>the pattern to use</p>","name":"pattern"},{"type":{"names":["number"]},"description":"<p>max number of characters (approximately)</p>","name":"chars"}],"returns":[{"description":"<p>string</p>"}],"examples":["const line = drawLine(\\"0 [1 2 3]\\", 10); // |0--123|0--123\\nconsole.log(line);\\nsilence;"],"name":"drawLine","longname":"drawLine","kind":"function","scope":"global"},{"comment":"/**\\n * Changes the structure of the pattern to form an Euclidean rhythm.\\n * Euclidean rhythms are rhythms obtained using the greatest common\\n * divisor of two numbers. They were described in 2004 by Godfried\\n * Toussaint, a Canadian computer scientist. Euclidean rhythms are\\n * really useful for computer/algorithmic music because they can\\n * describe a large number of rhythms with a couple of numbers.\\n *\\n * @memberof Pattern\\n * @name euclid\\n * @tags temporal\\n * @param {number} pulses the number of onsets/beats\\n * @param {number} steps the number of steps to fill\\n * @returns Pattern\\n * @example\\n * // The Cuban tresillo pattern.\\n * note(\\"c3\\").euclid(3,8)\\n */","meta":{"filename":"euclid.mjs","lineno":54,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Changes the structure of the pattern to form an Euclidean rhythm.\\nEuclidean rhythms are rhythms obtained using the greatest common\\ndivisor of two numbers. They were described in 2004 by Godfried\\nToussaint, a Canadian computer scientist. Euclidean rhythms are\\nreally useful for computer/algorithmic music because they can\\ndescribe a large number of rhythms with a couple of numbers.</p>","memberof":"Pattern","name":"euclid","tags":["temporal"],"params":[{"type":{"names":["number"]},"description":"<p>the number of onsets/beats</p>","name":"pulses"},{"type":{"names":["number"]},"description":"<p>the number of steps to fill</p>","name":"steps"}],"returns":[{"description":"<p>Pattern</p>"}],"examples":["// The Cuban tresillo pattern.\\nnote(\\"c3\\").euclid(3,8)"],"scope":"static","longname":"Pattern.euclid","kind":"member"},{"comment":"/**\\n * Like \`euclid\`, but has an additional parameter for 'rotating' the resulting sequence.\\n * @memberof Pattern\\n * @name euclidRot\\n * @tags temporal\\n * @param {number} pulses the number of onsets/beats\\n * @param {number} steps the number of steps to fill\\n * @param {number} rotation offset in steps\\n * @returns Pattern\\n * @example\\n * // A Samba rhythm necklace from Brazil\\n * note(\\"c3\\").euclidRot(3,16,14)\\n */","meta":{"filename":"euclid.mjs","lineno":73,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Like <code>euclid</code>, but has an additional parameter for 'rotating' the resulting sequence.</p>","memberof":"Pattern","name":"euclidRot","tags":["temporal"],"params":[{"type":{"names":["number"]},"description":"<p>the number of onsets/beats</p>","name":"pulses"},{"type":{"names":["number"]},"description":"<p>the number of steps to fill</p>","name":"steps"},{"type":{"names":["number"]},"description":"<p>offset in steps</p>","name":"rotation"}],"returns":[{"description":"<p>Pattern</p>"}],"examples":["// A Samba rhythm necklace from Brazil\\nnote(\\"c3\\").euclidRot(3,16,14)"],"scope":"static","longname":"Pattern.euclidRot","kind":"member"},{"comment":"/**\\n * @example // A thirteenth-century Persian rhythm called Khafif-e-ramal.\\n * note(\\"c3\\").euclid(2,5)\\n * @example // The archetypal pattern of the Cumbia from Colombia, as well as a Calypso rhythm from Trinidad.\\n * note(\\"c3\\").euclid(3,4)\\n * @example // Another thirteenth century Persian rhythm by the name of Khafif-e-ramal, as well as a Rumanian folk-dance rhythm.\\n * note(\\"c3\\").euclidRot(3,5,2)\\n * @example // A Ruchenitza rhythm used in a Bulgarian folk dance.\\n * note(\\"c3\\").euclid(3,7)\\n * @example // The Cuban tresillo pattern.\\n * note(\\"c3\\").euclid(3,8)\\n * @example // Another Ruchenitza Bulgarian folk-dance rhythm.\\n * note(\\"c3\\").euclid(4,7)\\n * @example // The Aksak rhythm of Turkey.\\n * note(\\"c3\\").euclid(4,9)\\n * @example // The metric pattern used by Frank Zappa in his piece titled Outside Now.\\n * note(\\"c3\\").euclid(4,11)\\n * @example // Yields the York-Samai pattern, a popular Arab rhythm.\\n * note(\\"c3\\").euclid(5,6)\\n * @example // The Nawakhat pattern, another popular Arab rhythm.\\n * note(\\"c3\\").euclid(5,7)\\n * @example // The Cuban cinquillo pattern.\\n * note(\\"c3\\").euclid(5,8)\\n * @example // A popular Arab rhythm called Agsag-Samai.\\n * note(\\"c3\\").euclid(5,9)\\n * @example // The metric pattern used by Moussorgsky in Pictures at an Exhibition.\\n * note(\\"c3\\").euclid(5,11)\\n * @example // The Venda clapping pattern of a South African children’s song.\\n * note(\\"c3\\").euclid(5,12)\\n * @example // The Bossa-Nova rhythm necklace of Brazil.\\n * note(\\"c3\\").euclid(5,16)\\n * @example // A typical rhythm played on the Bendir (frame drum).\\n * note(\\"c3\\").euclid(7,8)\\n * @example // A common West African bell pattern.\\n * note(\\"c3\\").euclid(7,12)\\n * @example // A Samba rhythm necklace from Brazil.\\n * note(\\"c3\\").euclidRot(7,16,14)\\n * @example // A rhythm necklace used in the Central African Republic.\\n * note(\\"c3\\").euclid(9,16)\\n * @example // A rhythm necklace of the Aka Pygmies of Central Africa.\\n * note(\\"c3\\").euclidRot(11,24,14)\\n * @example // Another rhythm necklace of the Aka Pygmies of the upper Sangha.\\n * note(\\"c3\\").euclidRot(13,24,5)\\n */","meta":{"range":[5359,5515],"filename":"euclid.mjs","lineno":132,"columnno":6,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100026746","name":"_euclidRot","type":"FunctionExpression"},"vars":{"b":"_euclidRot~b"}},"examples":["// A thirteenth-century Persian rhythm called Khafif-e-ramal.\\nnote(\\"c3\\").euclid(2,5)","// The archetypal pattern of the Cumbia from Colombia, as well as a Calypso rhythm from Trinidad.\\nnote(\\"c3\\").euclid(3,4)","// Another thirteenth century Persian rhythm by the name of Khafif-e-ramal, as well as a Rumanian folk-dance rhythm.\\nnote(\\"c3\\").euclidRot(3,5,2)","// A Ruchenitza rhythm used in a Bulgarian folk dance.\\nnote(\\"c3\\").euclid(3,7)","// The Cuban tresillo pattern.\\nnote(\\"c3\\").euclid(3,8)","// Another Ruchenitza Bulgarian folk-dance rhythm.\\nnote(\\"c3\\").euclid(4,7)","// The Aksak rhythm of Turkey.\\nnote(\\"c3\\").euclid(4,9)","// The metric pattern used by Frank Zappa in his piece titled Outside Now.\\nnote(\\"c3\\").euclid(4,11)","// Yields the York-Samai pattern, a popular Arab rhythm.\\nnote(\\"c3\\").euclid(5,6)","// The Nawakhat pattern, another popular Arab rhythm.\\nnote(\\"c3\\").euclid(5,7)","// The Cuban cinquillo pattern.\\nnote(\\"c3\\").euclid(5,8)","// A popular Arab rhythm called Agsag-Samai.\\nnote(\\"c3\\").euclid(5,9)","// The metric pattern used by Moussorgsky in Pictures at an Exhibition.\\nnote(\\"c3\\").euclid(5,11)","// The Venda clapping pattern of a South African children’s song.\\nnote(\\"c3\\").euclid(5,12)","// The Bossa-Nova rhythm necklace of Brazil.\\nnote(\\"c3\\").euclid(5,16)","// A typical rhythm played on the Bendir (frame drum).\\nnote(\\"c3\\").euclid(7,8)","// A common West African bell pattern.\\nnote(\\"c3\\").euclid(7,12)","// A Samba rhythm necklace from Brazil.\\nnote(\\"c3\\").euclidRot(7,16,14)","// A rhythm necklace used in the Central African Republic.\\nnote(\\"c3\\").euclid(9,16)","// A rhythm necklace of the Aka Pygmies of Central Africa.\\nnote(\\"c3\\").euclidRot(11,24,14)","// Another rhythm necklace of the Aka Pygmies of the upper Sangha.\\nnote(\\"c3\\").euclidRot(13,24,5)"],"name":"_euclidRot","longname":"_euclidRot","kind":"function","scope":"global","params":[]},{"comment":"/**\\n * Similar to \`euclid\`, but each pulse is held until the next pulse,\\n * so there will be no gaps.\\n * @name euclidLegato\\n * @memberof Pattern\\n * @tags temporal\\n * @param {number} pulses the number of onsets/beats\\n * @param {number} steps the number of steps to fill\\n * @param rotation offset in steps\\n * @param pat\\n * @example\\n * note(\\"c3\\").euclidLegato(3,8)\\n */","meta":{"filename":"euclid.mjs","lineno":156,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Similar to <code>euclid</code>, but each pulse is held until the next pulse,\\nso there will be no gaps.</p>","name":"euclidLegato","memberof":"Pattern","tags":["temporal"],"params":[{"type":{"names":["number"]},"description":"<p>the number of onsets/beats</p>","name":"pulses"},{"type":{"names":["number"]},"description":"<p>the number of steps to fill</p>","name":"steps"},{"description":"<p>offset in steps</p>","name":"rotation"},{"name":"pat"}],"examples":["note(\\"c3\\").euclidLegato(3,8)"],"scope":"static","longname":"Pattern.euclidLegato","kind":"member"},{"comment":"/**\\n * Similar to \`euclid\`, but each pulse is held until the next pulse,\\n * so there will be no gaps, and has an additional parameter for 'rotating'\\n * the resulting sequence\\n * @name euclidLegatoRot\\n * @memberof Pattern\\n * @tags temporal\\n * @param {number} pulses the number of onsets/beats\\n * @param {number} steps the number of steps to fill\\n * @param {number} rotation offset in steps\\n * @example\\n * note(\\"c3\\").euclidLegatoRot(3,5,2)\\n */","meta":{"filename":"euclid.mjs","lineno":187,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Similar to <code>euclid</code>, but each pulse is held until the next pulse,\\nso there will be no gaps, and has an additional parameter for 'rotating'\\nthe resulting sequence</p>","name":"euclidLegatoRot","memberof":"Pattern","tags":["temporal"],"params":[{"type":{"names":["number"]},"description":"<p>the number of onsets/beats</p>","name":"pulses"},{"type":{"names":["number"]},"description":"<p>the number of steps to fill</p>","name":"steps"},{"type":{"names":["number"]},"description":"<p>offset in steps</p>","name":"rotation"}],"examples":["note(\\"c3\\").euclidLegatoRot(3,5,2)"],"scope":"static","longname":"Pattern.euclidLegatoRot","kind":"member"},{"comment":"/**\\n * A 'euclid' variant with an additional parameter that morphs the resulting\\n * rhythm from 0 (no morphing) to 1 (completely 'even'). For example\\n * \`sound(\\"bd\\").euclidish(3,8,0)\` would be the same as\\n * \`sound(\\"bd\\").euclid(3,8)\`, and \`sound(\\"bd\\").euclidish(3,8,1)\` would be the\\n * same as \`sound(\\"bd bd bd\\")\`. \`sound(\\"bd\\").euclidish(3,8,0.5)\` would have a\\n * groove somewhere between.\\n * Inspired by the work of Malcom Braff.\\n * @name euclidish\\n * @synonyms eish\\n * @memberof Pattern\\n * @tags temporal\\n * @param {number} pulses the number of onsets\\n * @param {number} steps the number of steps to fill\\n * @param {number} groove exists between the extremes of 0 (straight euclidian) and 1 (straight pulse)\\n * @example\\n * sound(\\"hh\\").euclidish(7,12,sine.slow(8))\\n * .pan(sine.slow(8))\\n */","meta":{"filename":"euclid.mjs","lineno":204,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>A 'euclid' variant with an additional parameter that morphs the resulting\\nrhythm from 0 (no morphing) to 1 (completely 'even'). For example\\n<code>sound("bd").euclidish(3,8,0)</code> would be the same as\\n<code>sound("bd").euclid(3,8)</code>, and <code>sound("bd").euclidish(3,8,1)</code> would be the\\nsame as <code>sound("bd bd bd")</code>. <code>sound("bd").euclidish(3,8,0.5)</code> would have a\\ngroove somewhere between.\\nInspired by the work of Malcom Braff.</p>","name":"euclidish","synonyms_text":"eish","synonyms":["eish"],"memberof":"Pattern","tags":["temporal"],"params":[{"type":{"names":["number"]},"description":"<p>the number of onsets</p>","name":"pulses"},{"type":{"names":["number"]},"description":"<p>the number of steps to fill</p>","name":"steps"},{"type":{"names":["number"]},"description":"<p>exists between the extremes of 0 (straight euclidian) and 1 (straight pulse)</p>","name":"groove"}],"examples":["sound(\\"hh\\").euclidish(7,12,sine.slow(8))\\n.pan(sine.slow(8))"],"scope":"static","longname":"Pattern.euclidish","kind":"member"},{"comment":"/**\\n * Clears all user-defined variables and functions from the scope.\\n * This removes variables created during block-based evaluation.\\n * @name clearScope\\n * @example\\n * // After defining variables in blocks:\\n * // let myVar = 5\\n * // function myFunc() { return 10; }\\n * clearScope() // removes myVar and myFunc from scope\\n */","meta":{"filename":"evaluate.mjs","lineno":15,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Clears all user-defined variables and functions from the scope.\\nThis removes variables created during block-based evaluation.</p>","name":"clearScope","examples":["// After defining variables in blocks:\\n// let myVar = 5\\n// function myFunc() { return 10; }\\nclearScope() // removes myVar and myFunc from scope"],"longname":"clearScope","kind":"member","scope":"global"},{"comment":"/** @class Class representing a pattern. */","meta":{"range":[1773,29004],"filename":"pattern.mjs","lineno":45,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100029634","name":"exports.Pattern","type":"ClassDeclaration"}},"name":"Pattern","longname":"Pattern","kind":"class","classdesc":"<p>Class representing a pattern.</p>","scope":"global","description":"<p>Create a pattern. As an end user, you will most likely not create a Pattern directly.</p>","tags":[{"originalTitle":"noAutocomplete","title":"noautocomplete","text":""}],"memberof":"Pattern","params":[{"type":{"names":["function"]},"description":"<p>The function that maps a <code>State</code> to an array of <code>Hap</code>.</p>","name":"query"}]},{"comment":"/**\\n * Returns a new pattern, with the function applied to the value of\\n * each hap. It has the alias \`fmap\`.\\n * @tags functional\\n * @synonyms fmap\\n * @param {Function} func to to apply to the value\\n * @returns Pattern\\n * @example\\n * \\"0 1 2\\".withValue(v => v + 10).log()\\n */","meta":{"range":[3102,3271],"filename":"pattern.mjs","lineno":95,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100029742","name":"Pattern#withValue","type":"MethodDefinition","paramnames":["func"]},"vars":{"":null}},"description":"<p>Returns a new pattern, with the function applied to the value of\\neach hap. It has the alias <code>fmap</code>.</p>","tags":["functional"],"synonyms_text":"fmap","synonyms":["fmap"],"params":[{"type":{"names":["function"]},"description":"<p>to to apply to the value</p>","name":"func"}],"returns":[{"description":"<p>Pattern</p>"}],"examples":["\\"0 1 2\\".withValue(v => v + 10).log()"],"name":"withValue","longname":"Pattern#withValue","kind":"function","memberof":"Pattern","scope":"instance"},{"comment":"/**\\n * see \`withValue\`\\n * @noAutocomplete\\n */","meta":{"range":[3444,3493],"filename":"pattern.mjs","lineno":110,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100029796","name":"Pattern#fmap","type":"MethodDefinition","paramnames":["func"]},"vars":{"":null}},"description":"<p>see <code>withValue</code></p>","tags":[{"originalTitle":"noAutocomplete","title":"noautocomplete","text":""}],"name":"fmap","longname":"Pattern#fmap","kind":"function","memberof":"Pattern","scope":"instance","params":[]},{"comment":"/**\\n * Assumes 'this' is a pattern of functions, and given a function to\\n * resolve wholes, applies a given pattern of values to that\\n * pattern of functions.\\n * @tags functional\\n * @param {Function} whole_func\\n * @param {Function} func\\n * @noAutocomplete\\n * @returns Pattern\\n */","meta":{"range":[3797,4539],"filename":"pattern.mjs","lineno":124,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100029807","name":"Pattern#appWhole","type":"MethodDefinition","paramnames":["whole_func","pat_val"]},"vars":{"":null}},"description":"<p>Assumes 'this' is a pattern of functions, and given a function to\\nresolve wholes, applies a given pattern of values to that\\npattern of functions.</p>","tags":["functional",{"originalTitle":"noAutocomplete","title":"noautocomplete","text":""}],"params":[{"type":{"names":["function"]},"name":"whole_func"},{"type":{"names":["function"]},"name":"func"}],"returns":[{"description":"<p>Pattern</p>"}],"name":"appWhole","longname":"Pattern#appWhole","kind":"function","memberof":"Pattern","scope":"instance"},{"comment":"/**\\n * When this method is called on a pattern of functions, it matches its haps\\n * with those in the given pattern of values. A new pattern is returned, with\\n * each matching value applied to the corresponding function.\\n *\\n * In this \`_appBoth\` variant, where timespans of the function and value haps\\n * are not the same but do intersect, the resulting hap has a timespan of the\\n * intersection. This applies to both the part and the whole timespan.\\n * @tags functional\\n * @param {Pattern} pat_val\\n * @noAutocomplete\\n * @returns Pattern\\n */","meta":{"range":[5112,5536],"filename":"pattern.mjs","lineno":161,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100029914","name":"Pattern#appBoth","type":"MethodDefinition","paramnames":["pat_val"]},"vars":{"":null}},"description":"<p>When this method is called on a pattern of functions, it matches its haps\\nwith those in the given pattern of values. A new pattern is returned, with\\neach matching value applied to the corresponding function.</p>\\n<p>In this <code>_appBoth</code> variant, where timespans of the function and value haps\\nare not the same but do intersect, the resulting hap has a timespan of the\\nintersection. This applies to both the part and the whole timespan.</p>","tags":["functional",{"originalTitle":"noAutocomplete","title":"noautocomplete","text":""}],"params":[{"type":{"names":["Pattern"]},"name":"pat_val"}],"returns":[{"description":"<p>Pattern</p>"}],"name":"appBoth","longname":"Pattern#appBoth","kind":"function","memberof":"Pattern","scope":"instance"},{"comment":"/**\\n * As with \`appBoth\`, but the \`whole\` timespan is not the intersection,\\n * but the timespan from the function of patterns that this method is called\\n * on. In practice, this means that the pattern structure, including onsets,\\n * are preserved from the pattern of functions (often referred to as the left\\n * hand or inner pattern).\\n * @tags functional\\n * @param {Pattern} pat_val\\n * @noAutocomplete\\n * @returns Pattern\\n */","meta":{"range":[5988,6792],"filename":"pattern.mjs","lineno":189,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100029974","name":"Pattern#appLeft","type":"MethodDefinition","paramnames":["pat_val"]},"vars":{"":null}},"description":"<p>As with <code>appBoth</code>, but the <code>whole</code> timespan is not the intersection,\\nbut the timespan from the function of patterns that this method is called\\non. In practice, this means that the pattern structure, including onsets,\\nare preserved from the pattern of functions (often referred to as the left\\nhand or inner pattern).</p>","tags":["functional",{"originalTitle":"noAutocomplete","title":"noautocomplete","text":""}],"params":[{"type":{"names":["Pattern"]},"name":"pat_val"}],"returns":[{"description":"<p>Pattern</p>"}],"name":"appLeft","longname":"Pattern#appLeft","kind":"function","memberof":"Pattern","scope":"instance"},{"comment":"/**\\n * As with \`appLeft\`, but \`whole\` timespans are instead taken from the\\n * pattern of values, i.e. structure is preserved from the right hand/outer\\n * pattern.\\n * @tags functional\\n * @param {Pattern} pat_val\\n * @noAutocomplete\\n * @returns Pattern\\n */","meta":{"range":[7068,7876],"filename":"pattern.mjs","lineno":223,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100030096","name":"Pattern#appRight","type":"MethodDefinition","paramnames":["pat_val"]},"vars":{"":null}},"description":"<p>As with <code>appLeft</code>, but <code>whole</code> timespans are instead taken from the\\npattern of values, i.e. structure is preserved from the right hand/outer\\npattern.</p>","tags":["functional",{"originalTitle":"noAutocomplete","title":"noautocomplete","text":""}],"params":[{"type":{"names":["Pattern"]},"name":"pat_val"}],"returns":[{"description":"<p>Pattern</p>"}],"name":"appRight","longname":"Pattern#appRight","kind":"function","memberof":"Pattern","scope":"instance"},{"comment":"/**\\n * Query haps inside the given time span.\\n *\\n * @tags internals\\n * @param {Fraction | number} begin from time\\n * @param {Fraction | number} end to time\\n * @returns Hap[]\\n * @example\\n * const pattern = sequence('a', ['b', 'c'])\\n * const haps = pattern.queryArc(0, 1)\\n * console.log(haps)\\n * silence\\n * @noAutocomplete\\n */","meta":{"range":[13533,13732],"filename":"pattern.mjs","lineno":420,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100030776","name":"Pattern#queryArc","type":"MethodDefinition","paramnames":["begin","end","controls"]},"vars":{"":null}},"description":"<p>Query haps inside the given time span.</p>","tags":["internals",{"originalTitle":"noAutocomplete","title":"noautocomplete","text":""}],"params":[{"type":{"names":["Fraction","number"]},"description":"<p>from time</p>","name":"begin"},{"type":{"names":["Fraction","number"]},"description":"<p>to time</p>","name":"end"}],"returns":[{"description":"<p>Hap[]</p>"}],"examples":["const pattern = sequence('a', ['b', 'c'])\\nconst haps = pattern.queryArc(0, 1)\\nconsole.log(haps)\\nsilence"],"name":"queryArc","longname":"Pattern#queryArc","kind":"function","memberof":"Pattern","scope":"instance"},{"comment":"/**\\n * Returns a new pattern, with queries split at cycle boundaries. This makes\\n * some calculations easier to express, as all haps are then constrained to\\n * happen within a cycle.\\n * @tags internals\\n * @returns Pattern\\n * @noAutocomplete\\n */","meta":{"range":[13997,14197],"filename":"pattern.mjs","lineno":437,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100030807","name":"Pattern#splitQueries","type":"MethodDefinition","paramnames":[]},"vars":{"":null}},"description":"<p>Returns a new pattern, with queries split at cycle boundaries. This makes\\nsome calculations easier to express, as all haps are then constrained to\\nhappen within a cycle.</p>","tags":["internals",{"originalTitle":"noAutocomplete","title":"noautocomplete","text":""}],"returns":[{"description":"<p>Pattern</p>"}],"name":"splitQueries","longname":"Pattern#splitQueries","kind":"function","memberof":"Pattern","scope":"instance","params":[]},{"comment":"/**\\n * Returns a new pattern, where the given function is applied to the query\\n * timespan before passing it to the original pattern.\\n * @tags internals\\n * @param {Function} func the function to apply\\n * @returns Pattern\\n * @noAutocomplete\\n */","meta":{"range":[14461,14555],"filename":"pattern.mjs","lineno":453,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100030847","name":"Pattern#withQuerySpan","type":"MethodDefinition","paramnames":["func"]},"vars":{"":null}},"description":"<p>Returns a new pattern, where the given function is applied to the query\\ntimespan before passing it to the original pattern.</p>","tags":["internals",{"originalTitle":"noAutocomplete","title":"noautocomplete","text":""}],"params":[{"type":{"names":["function"]},"description":"<p>the function to apply</p>","name":"func"}],"returns":[{"description":"<p>Pattern</p>"}],"name":"withQuerySpan","longname":"Pattern#withQuerySpan","kind":"function","memberof":"Pattern","scope":"instance"},{"comment":"/**\\n * As with \`withQuerySpan\`, but the function is applied to both the\\n * begin and end time of the query timespan.\\n * @tags internals\\n * @param {Function} func the function to apply\\n * @returns Pattern\\n * @noAutocomplete\\n */","meta":{"range":[15036,15155],"filename":"pattern.mjs","lineno":476,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100030903","name":"Pattern#withQueryTime","type":"MethodDefinition","paramnames":["func"]},"vars":{"":null}},"description":"<p>As with <code>withQuerySpan</code>, but the function is applied to both the\\nbegin and end time of the query timespan.</p>","tags":["internals",{"originalTitle":"noAutocomplete","title":"noautocomplete","text":""}],"params":[{"type":{"names":["function"]},"description":"<p>the function to apply</p>","name":"func"}],"returns":[{"description":"<p>Pattern</p>"}],"name":"withQueryTime","longname":"Pattern#withQueryTime","kind":"function","memberof":"Pattern","scope":"instance"},{"comment":"/**\\n * Similar to \`withQuerySpan\`, but the function is applied to the timespans\\n * of all haps returned by pattern queries (both \`part\` timespans, and where\\n * present, \`whole\` timespans).\\n * @tags internals\\n * @param {Function} func\\n * @returns Pattern\\n * @noAutocomplete\\n */","meta":{"range":[15454,15564],"filename":"pattern.mjs","lineno":489,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100030928","name":"Pattern#withHapSpan","type":"MethodDefinition","paramnames":["func"]},"vars":{"":null}},"description":"<p>Similar to <code>withQuerySpan</code>, but the function is applied to the timespans\\nof all haps returned by pattern queries (both <code>part</code> timespans, and where\\npresent, <code>whole</code> timespans).</p>","tags":["internals",{"originalTitle":"noAutocomplete","title":"noautocomplete","text":""}],"params":[{"type":{"names":["function"]},"name":"func"}],"returns":[{"description":"<p>Pattern</p>"}],"name":"withHapSpan","longname":"Pattern#withHapSpan","kind":"function","memberof":"Pattern","scope":"instance"},{"comment":"/**\\n * As with \`withHapSpan\`, but the function is applied to both the\\n * begin and end time of the hap timespans.\\n * @tags internals\\n * @param {Function} func the function to apply\\n * @returns Pattern\\n * @noAutocomplete\\n */","meta":{"range":[15808,15891],"filename":"pattern.mjs","lineno":501,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100030953","name":"Pattern#withHapTime","type":"MethodDefinition","paramnames":["func"]},"vars":{"":null}},"description":"<p>As with <code>withHapSpan</code>, but the function is applied to both the\\nbegin and end time of the hap timespans.</p>","tags":["internals",{"originalTitle":"noAutocomplete","title":"noautocomplete","text":""}],"params":[{"type":{"names":["function"]},"description":"<p>the function to apply</p>","name":"func"}],"returns":[{"description":"<p>Pattern</p>"}],"name":"withHapTime","longname":"Pattern#withHapTime","kind":"function","memberof":"Pattern","scope":"instance"},{"comment":"/**\\n * Returns a new pattern with the given function applied to the list of haps returned by every query.\\n * @tags internals\\n * @param {Function} func\\n * @returns Pattern\\n * @noAutocomplete\\n */","meta":{"range":[16103,16250],"filename":"pattern.mjs","lineno":512,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100030970","name":"Pattern#withHaps","type":"MethodDefinition","paramnames":["func"]},"vars":{"":null}},"description":"<p>Returns a new pattern with the given function applied to the list of haps returned by every query.</p>","tags":["internals",{"originalTitle":"noAutocomplete","title":"noautocomplete","text":""}],"params":[{"type":{"names":["function"]},"name":"func"}],"returns":[{"description":"<p>Pattern</p>"}],"name":"withHaps","longname":"Pattern#withHaps","kind":"function","memberof":"Pattern","scope":"instance"},{"comment":"/**\\n * As with \`withHaps\`, but applies the function to every hap, rather than every list of haps.\\n * @tags internals\\n * @param {Function} func\\n * @returns Pattern\\n * @noAutocomplete\\n */","meta":{"range":[16454,16525],"filename":"pattern.mjs","lineno":525,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100031000","name":"Pattern#withHap","type":"MethodDefinition","paramnames":["func"]},"vars":{"":null}},"description":"<p>As with <code>withHaps</code>, but applies the function to every hap, rather than every list of haps.</p>","tags":["internals",{"originalTitle":"noAutocomplete","title":"noautocomplete","text":""}],"params":[{"type":{"names":["function"]},"name":"func"}],"returns":[{"description":"<p>Pattern</p>"}],"name":"withHap","longname":"Pattern#withHap","kind":"function","memberof":"Pattern","scope":"instance"},{"comment":"/**\\n * Returns a new pattern with the context field set to every hap set to the given value.\\n * @tags internals\\n * @param {*} context\\n * @returns Pattern\\n * @noAutocomplete\\n */","meta":{"range":[16720,16804],"filename":"pattern.mjs","lineno":536,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100031017","name":"Pattern#setContext","type":"MethodDefinition","paramnames":["context"]},"vars":{"":null}},"description":"<p>Returns a new pattern with the context field set to every hap set to the given value.</p>","tags":["internals",{"originalTitle":"noAutocomplete","title":"noautocomplete","text":""}],"params":[{"type":{"names":["*"]},"name":"context"}],"returns":[{"description":"<p>Pattern</p>"}],"name":"setContext","longname":"Pattern#setContext","kind":"function","memberof":"Pattern","scope":"instance"},{"comment":"/**\\n * Returns a new pattern with the given function applied to the context field of every hap.\\n * @tags internals\\n * @param {Function} func\\n * @returns Pattern\\n * @noAutocomplete\\n */","meta":{"range":[17006,17246],"filename":"pattern.mjs","lineno":547,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100031034","name":"Pattern#withContext","type":"MethodDefinition","paramnames":["func"]},"vars":{"":null}},"description":"<p>Returns a new pattern with the given function applied to the context field of every hap.</p>","tags":["internals",{"originalTitle":"noAutocomplete","title":"noautocomplete","text":""}],"params":[{"type":{"names":["function"]},"name":"func"}],"returns":[{"description":"<p>Pattern</p>"}],"name":"withContext","longname":"Pattern#withContext","kind":"function","memberof":"Pattern","scope":"instance"},{"comment":"/**\\n * Returns a new pattern with the context field of every hap set to an empty object.\\n * @tags internals\\n * @returns Pattern\\n * @noAutocomplete\\n */","meta":{"range":[17413,17487],"filename":"pattern.mjs","lineno":562,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100031082","name":"Pattern#stripContext","type":"MethodDefinition","paramnames":[]},"vars":{"":null}},"description":"<p>Returns a new pattern with the context field of every hap set to an empty object.</p>","tags":["internals",{"originalTitle":"noAutocomplete","title":"noautocomplete","text":""}],"returns":[{"description":"<p>Pattern</p>"}],"name":"stripContext","longname":"Pattern#stripContext","kind":"function","memberof":"Pattern","scope":"instance","params":[]},{"comment":"/**\\n * Returns a new pattern with the given location information added to the\\n * context of every hap.\\n * @tags internals\\n * @param {Number} start start offset\\n * @param {Number} end end offset\\n * @returns Pattern\\n * @noAutocomplete\\n */","meta":{"range":[17746,18113],"filename":"pattern.mjs","lineno":575,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100031098","name":"Pattern#withLoc","type":"MethodDefinition","paramnames":["start","end"]},"vars":{"":null}},"description":"<p>Returns a new pattern with the given location information added to the\\ncontext of every hap.</p>","tags":["internals",{"originalTitle":"noAutocomplete","title":"noautocomplete","text":""}],"params":[{"type":{"names":["Number"]},"description":"<p>start offset</p>","name":"start"},{"type":{"names":["Number"]},"description":"<p>end offset</p>","name":"end"}],"returns":[{"description":"<p>Pattern</p>"}],"name":"withLoc","longname":"Pattern#withLoc","kind":"function","memberof":"Pattern","scope":"instance"},{"comment":"/**\\n * Returns a new Pattern, which only returns haps that meet the given test.\\n * @tags internals\\n * @param {Function} hap_test - a function which returns false for haps to be removed from the pattern\\n * @returns Pattern\\n * @example\\n * s(\\"bd*8\\").velocity(rand).filterHaps((h) => (h.whole.begin % 1) < h.value.velocity)\\n */","meta":{"range":[18457,18554],"filename":"pattern.mjs","lineno":599,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100031162","name":"Pattern#filterHaps","type":"MethodDefinition","paramnames":["hap_test"]},"vars":{"":null}},"description":"<p>Returns a new Pattern, which only returns haps that meet the given test.</p>","tags":["internals"],"params":[{"type":{"names":["function"]},"description":"<p>a function which returns false for haps to be removed from the pattern</p>","name":"hap_test"}],"returns":[{"description":"<p>Pattern</p>"}],"examples":["s(\\"bd*8\\").velocity(rand).filterHaps((h) => (h.whole.begin % 1) < h.value.velocity)"],"name":"filterHaps","longname":"Pattern#filterHaps","kind":"function","memberof":"Pattern","scope":"instance"},{"comment":"/**\\n * As with \`filterHaps\`, but the function is applied to values\\n * inside haps.\\n * @tags internals\\n * @param {Function} value_test\\n * @returns Pattern\\n * @example\\n * const drums = s(\\"bd sd bd sd\\")\\n * kick: drums.filterValues((v) => v.s === 'bd').duck(2)\\n * snare: drums.filterValues((v) => v.s === 'sd')\\n * bass: s(\\"saw!4\\").note(\\"G#1\\").lpf(80).lpenv(4).orbit(2)\\n */","meta":{"range":[18951,19096],"filename":"pattern.mjs","lineno":615,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100031181","name":"Pattern#filterValues","type":"MethodDefinition","paramnames":["value_test"]},"vars":{"":null}},"description":"<p>As with <code>filterHaps</code>, but the function is applied to values\\ninside haps.</p>","tags":["internals"],"params":[{"type":{"names":["function"]},"name":"value_test"}],"returns":[{"description":"<p>Pattern</p>"}],"examples":["const drums = s(\\"bd sd bd sd\\")\\nkick: drums.filterValues((v) => v.s === 'bd').duck(2)\\nsnare: drums.filterValues((v) => v.s === 'sd')\\nbass: s(\\"saw!4\\").note(\\"G#1\\").lpf(80).lpenv(4).orbit(2)"],"name":"filterValues","longname":"Pattern#filterValues","kind":"function","memberof":"Pattern","scope":"instance"},{"comment":"/**\\n * Returns a new pattern, with haps containing undefined values removed from\\n * query results.\\n * @tags internals\\n * @returns Pattern\\n * @noAutocomplete\\n */","meta":{"range":[19275,19356],"filename":"pattern.mjs","lineno":626,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100031212","name":"Pattern#removeUndefineds","type":"MethodDefinition","paramnames":[]},"vars":{"":null}},"description":"<p>Returns a new pattern, with haps containing undefined values removed from\\nquery results.</p>","tags":["internals",{"originalTitle":"noAutocomplete","title":"noautocomplete","text":""}],"returns":[{"description":"<p>Pattern</p>"}],"name":"removeUndefineds","longname":"Pattern#removeUndefineds","kind":"function","memberof":"Pattern","scope":"instance","params":[]},{"comment":"/**\\n * Returns a new pattern, with all haps without onsets filtered out. A hap\\n * with an onset is one with a \`whole\` timespan that begins at the same time\\n * as its \`part\` timespan.\\n * @tags internals\\n * @returns Pattern\\n * @noAutocomplete\\n */","meta":{"range":[19621,19886],"filename":"pattern.mjs","lineno":638,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100031226","name":"Pattern#onsetsOnly","type":"MethodDefinition","paramnames":[]},"vars":{"":null}},"description":"<p>Returns a new pattern, with all haps without onsets filtered out. A hap\\nwith an onset is one with a <code>whole</code> timespan that begins at the same time\\nas its <code>part</code> timespan.</p>","tags":["internals",{"originalTitle":"noAutocomplete","title":"noautocomplete","text":""}],"returns":[{"description":"<p>Pattern</p>"}],"name":"onsetsOnly","longname":"Pattern#onsetsOnly","kind":"function","memberof":"Pattern","scope":"instance","params":[]},{"comment":"/**\\n * Returns a new pattern, with 'continuous' haps (those without 'whole'\\n * timespans) removed from query results.\\n * @tags internals\\n * @returns Pattern\\n * @noAutocomplete\\n */","meta":{"range":[20084,20218],"filename":"pattern.mjs","lineno":652,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100031241","name":"Pattern#discreteOnly","type":"MethodDefinition","paramnames":[]},"vars":{"":null}},"description":"<p>Returns a new pattern, with 'continuous' haps (those without 'whole'\\ntimespans) removed from query results.</p>","tags":["internals",{"originalTitle":"noAutocomplete","title":"noautocomplete","text":""}],"returns":[{"description":"<p>Pattern</p>"}],"name":"discreteOnly","longname":"Pattern#discreteOnly","kind":"function","memberof":"Pattern","scope":"instance","params":[]},{"comment":"/**\\n * Combines adjacent haps with the same value and whole. Only\\n * intended for use in tests.\\n * @tags internals\\n * @noAutocomplete\\n */","meta":{"range":[20373,21818],"filename":"pattern.mjs","lineno":663,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100031255","name":"Pattern#defragmentHaps","type":"MethodDefinition","paramnames":[]},"vars":{"":null}},"description":"<p>Combines adjacent haps with the same value and whole. Only\\nintended for use in tests.</p>","tags":["internals",{"originalTitle":"noAutocomplete","title":"noautocomplete","text":""}],"name":"defragmentHaps","longname":"Pattern#defragmentHaps","kind":"function","memberof":"Pattern","scope":"instance","params":[]},{"comment":"/**\\n * Queries the pattern for the first cycle, returning Haps. Mainly of use when\\n * debugging a pattern.\\n * @tags internals\\n * @param {Boolean} with_context - set to true, otherwise the context field\\n * will be stripped from the resulting haps.\\n * @returns [Hap]\\n * @noAutocomplete\\n */","meta":{"range":[22128,22326],"filename":"pattern.mjs","lineno":719,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100031486","name":"Pattern#firstCycle","type":"MethodDefinition","paramnames":["with_context"]},"vars":{"":null}},"description":"<p>Queries the pattern for the first cycle, returning Haps. Mainly of use when\\ndebugging a pattern.</p>","tags":["internals",{"originalTitle":"noAutocomplete","title":"noautocomplete","text":""}],"params":[{"type":{"names":["Boolean"]},"description":"<p>set to true, otherwise the context field\\nwill be stripped from the resulting haps.</p>","name":"with_context","defaultvalue":false}],"returns":[{"description":"<p>[Hap]</p>"}],"name":"firstCycle","longname":"Pattern#firstCycle","kind":"function","memberof":"Pattern","scope":"instance"},{"comment":"/**\\n * Accessor for a list of values returned by querying the first cycle.\\n * @tags internals\\n * @noAutocomplete\\n */","meta":{"range":[22457,22539],"filename":"pattern.mjs","lineno":732,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100031523","name":"Pattern#firstCycleValues","type":"MethodDefinition","paramnames":[]},"vars":{"":null}},"description":"<p>Accessor for a list of values returned by querying the first cycle.</p>","tags":["internals",{"originalTitle":"noAutocomplete","title":"noautocomplete","text":""}],"name":"firstCycleValues","longname":"Pattern#firstCycleValues","kind":"member","memberof":"Pattern","scope":"instance","params":[]},{"comment":"/**\\n * More human-readable version of the \`firstCycleValues\` accessor.\\n * @tags internals\\n * @noAutocomplete\\n */","meta":{"range":[22666,22829],"filename":"pattern.mjs","lineno":741,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100031540","name":"Pattern#showFirstCycle","type":"MethodDefinition","paramnames":[]},"vars":{"":null}},"description":"<p>More human-readable version of the <code>firstCycleValues</code> accessor.</p>","tags":["internals",{"originalTitle":"noAutocomplete","title":"noautocomplete","text":""}],"name":"showFirstCycle","longname":"Pattern#showFirstCycle","kind":"member","memberof":"Pattern","scope":"instance","params":[]},{"comment":"/**\\n * Returns a new pattern, which returns haps sorted in temporal order. Mainly\\n * of use when comparing two patterns for equality, in tests.\\n * @tags internals\\n * @returns Pattern\\n * @noAutocomplete\\n */","meta":{"range":[23053,23326],"filename":"pattern.mjs","lineno":754,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100031578","name":"Pattern#sortHapsByPart","type":"MethodDefinition","paramnames":[]},"vars":{"":null}},"description":"<p>Returns a new pattern, which returns haps sorted in temporal order. Mainly\\nof use when comparing two patterns for equality, in tests.</p>","tags":["internals",{"originalTitle":"noAutocomplete","title":"noautocomplete","text":""}],"returns":[{"description":"<p>Pattern</p>"}],"name":"sortHapsByPart","longname":"Pattern#sortHapsByPart","kind":"function","memberof":"Pattern","scope":"instance","params":[]},{"comment":"/**\\n * Returns a new pattern with all values parsed as numerals.\\n * @tags internals\\n */","meta":{"range":[23426,23478],"filename":"pattern.mjs","lineno":769,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100031657","name":"Pattern#asNumber","type":"MethodDefinition","paramnames":[]},"vars":{"":null}},"description":"<p>Returns a new pattern with all values parsed as numerals.</p>","tags":["internals"],"name":"asNumber","longname":"Pattern#asNumber","kind":"function","memberof":"Pattern","scope":"instance","params":[]},{"comment":"/**\\n * Layers the result of the given function(s). Like \`superimpose\`, but without the original pattern:\\n * @name layer\\n * @tags combiners\\n * @memberof Pattern\\n * @returns Pattern\\n * @example\\n * \\"<0 2 4 6 ~ 4 ~ 2 0!3 ~!5>*8\\"\\n * .layer(x=>x.add(\\"0,2\\"))\\n * .scale('C minor').note()\\n */","meta":{"filename":"pattern.mjs","lineno":816,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Layers the result of the given function(s). Like <code>superimpose</code>, but without the original pattern:</p>","name":"layer","tags":["combiners"],"memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"examples":["\\"<0 2 4 6 ~ 4 ~ 2 0!3 ~!5>*8\\"\\n .layer(x=>x.add(\\"0,2\\"))\\n .scale('C minor').note()"],"scope":"static","longname":"Pattern.layer","kind":"member"},{"comment":"/**\\n * Superimposes the result of the given function(s) on top of the original pattern:\\n * @name superimpose\\n * @tags combiners\\n * @memberof Pattern\\n * @returns Pattern\\n * @example\\n * \\"<0 2 4 6 ~ 4 ~ 2 0!3 ~!5>*8\\"\\n * .superimpose(x=>x.add(2))\\n * .scale('C minor').note()\\n */","meta":{"filename":"pattern.mjs","lineno":831,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Superimposes the result of the given function(s) on top of the original pattern:</p>","name":"superimpose","tags":["combiners"],"memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"examples":["\\"<0 2 4 6 ~ 4 ~ 2 0!3 ~!5>*8\\"\\n .superimpose(x=>x.add(2))\\n .scale('C minor').note()"],"scope":"static","longname":"Pattern.superimpose","kind":"member"},{"comment":"/**\\n * Writes the content of the current event to the console (visible in the side menu).\\n * @tags visualization\\n * @name log\\n * @memberof Pattern\\n * @example\\n * s(\\"bd sd\\").log()\\n */","meta":{"filename":"pattern.mjs","lineno":892,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Writes the content of the current event to the console (visible in the side menu).</p>","tags":["visualization"],"name":"log","memberof":"Pattern","examples":["s(\\"bd sd\\").log()"],"scope":"static","longname":"Pattern.log","kind":"member"},{"comment":"/**\\n * A simplified version of \`log\` which writes all \\"values\\" (various configurable parameters)\\n * within the event to the console (visible in the side menu).\\n * @tags visualization\\n * @name logValues\\n * @memberof Pattern\\n * @example\\n * s(\\"bd sd\\").gain(\\"0.25 0.5 1\\").n(\\"2 1 0\\").logValues()\\n */","meta":{"filename":"pattern.mjs","lineno":906,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>A simplified version of <code>log</code> which writes all "values" (various configurable parameters)\\nwithin the event to the console (visible in the side menu).</p>","tags":["visualization"],"name":"logValues","memberof":"Pattern","examples":["s(\\"bd sd\\").gain(\\"0.25 0.5 1\\").n(\\"2 1 0\\").logValues()"],"scope":"static","longname":"Pattern.logValues","kind":"member"},{"comment":"/**\\n * Breaks a pattern into pieces according to the structure of a given pattern.\\n * True values in the given pattern cause the corresponding subcycle of the\\n * source pattern to be looped, and for an (optional) given function to be\\n * applied. False values result in the corresponding part of the source pattern\\n * to be played unchanged.\\n * @tags temporal\\n * @name into\\n * @memberof Pattern\\n * @example\\n * sound(\\"bd sd ht lt\\").into(\\"1 0\\", hurry(2))\\n */","meta":{"filename":"pattern.mjs","lineno":937,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Breaks a pattern into pieces according to the structure of a given pattern.\\nTrue values in the given pattern cause the corresponding subcycle of the\\nsource pattern to be looped, and for an (optional) given function to be\\napplied. False values result in the corresponding part of the source pattern\\nto be played unchanged.</p>","tags":["temporal"],"name":"into","memberof":"Pattern","examples":["sound(\\"bd sd ht lt\\").into(\\"1 0\\", hurry(2))"],"scope":"static","longname":"Pattern.into","kind":"member"},{"comment":"/**\\n * Selects indices in in stacked notes.\\n * @tags temporal\\n * @example\\n * note(\\"<[c,eb,g]!2 [c,f,ab] [d,f,ab]>\\")\\n * .arpWith(haps => haps[2])\\n * */","meta":{"range":[29992,30222],"filename":"pattern.mjs","lineno":988,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100032292","name":"exports.arpWith","type":"VariableDeclaration"}},"description":"<p>Selects indices in in stacked notes.</p>","tags":["temporal"],"examples":["note(\\"<[c,eb,g]!2 [c,f,ab] [d,f,ab]>\\")\\n.arpWith(haps => haps[2])"],"name":"arpWith","longname":"arpWith","kind":"constant","scope":"global"},{"comment":"/**\\n * Selects indices in in stacked notes.\\n * @tags temporal\\n * @example\\n * note(\\"<[c,eb,g]!2 [c,f,ab] [d,f,ab]>\\")\\n * .arp(\\"0 [0,2] 1 [0,2]\\")\\n * */","meta":{"range":[30373,30516],"filename":"pattern.mjs","lineno":1003,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100032346","name":"exports.arp","type":"VariableDeclaration"}},"description":"<p>Selects indices in in stacked notes.</p>","tags":["temporal"],"examples":["note(\\"<[c,eb,g]!2 [c,f,ab] [d,f,ab]>\\")\\n.arp(\\"0 [0,2] 1 [0,2]\\")"],"name":"arp","longname":"arp","kind":"constant","scope":"global"},{"comment":"/**\\n * When called on a pattern \`a\`, with a input pattern \`b\` (\`a.set(b)\`),\\n * combines \`a\` and \`b\` such that anything defined in \`b\`\\n * and anything defined in \`a\` that is *not* defined in \`b\`\\n * will be in the resulting pattern.\\n *\\n * The structure is maintained from \`a\`,\\n * because the default pattern alignment is \`in\`,\\n * see the section on \`Pattern Alignment\`\\n * in the technical manual in the docs\\n *\\n * This is the inverse of \`keep\`\\n *\\n * See examples below\\n * @name set\\n * @param {Pattern} pat\\n * @returns {Pattern}\\n * @memberof Pattern\\n * @tags internal, combiners\\n * @example\\n * // because input pattern has \`s\` set,\\n * // it overrides the \\"sine\\" declared earlier\\n * note(\\"c a f e\\").s(\\"sine\\").set(s(\\"triangle\\"))\\n */","meta":{"filename":"pattern.mjs","lineno":1059,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>When called on a pattern <code>a</code>, with a input pattern <code>b</code> (<code>a.set(b)</code>),\\ncombines <code>a</code> and <code>b</code> such that anything defined in <code>b</code>\\nand anything defined in <code>a</code> that is <em>not</em> defined in <code>b</code>\\nwill be in the resulting pattern.</p>\\n<p>The structure is maintained from <code>a</code>,\\nbecause the default pattern alignment is <code>in</code>,\\nsee the section on <code>Pattern Alignment</code>\\nin the technical manual in the docs</p>\\n<p>This is the inverse of <code>keep</code></p>\\n<p>See examples below</p>","name":"set","params":[{"type":{"names":["Pattern"]},"name":"pat"}],"returns":[{"type":{"names":["Pattern"]}}],"memberof":"Pattern","tags":["internal","combiners"],"examples":["// because input pattern has \`s\` set,\\n// it overrides the \\"sine\\" declared earlier\\nnote(\\"c a f e\\").s(\\"sine\\").set(s(\\"triangle\\"))"],"scope":"static","longname":"Pattern.set","kind":"member"},{"comment":"/**\\n * When called on a pattern \`a\`, with a input pattern \`b\` (\`a.keep(b)\`),\\n * combines \`a\` and \`b\` such that anything defined in \`a\`,\\n * and anything defined in \`b\` that is *not* defined in \`a\`\\n * will be in the resulting pattern\\n *\\n * The structure is maintained from \`a\`,\\n * because the default pattern alignment is \`in\`,\\n * see the section on \`Pattern Alignment\`\\n * in the technical manual in the docs\\n *\\n * This is the inverse of \`set\`\\n *\\n * See examples below\\n * @name keep\\n * @param {Pattern} pat\\n * @memberof Pattern\\n * @returns {Pattern}\\n * @tags internal, combiners\\n * @example\\n * // notes, already defined, will stay \\"c a f e\\",\\n * // while \\"s\\", not defined, will be set to \\"piano\\"\\n * note(\\"c a f e\\").keep(note(\\"e f a c\\").s(\\"piano\\"))\\n */","meta":{"filename":"pattern.mjs","lineno":1084,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>When called on a pattern <code>a</code>, with a input pattern <code>b</code> (<code>a.keep(b)</code>),\\ncombines <code>a</code> and <code>b</code> such that anything defined in <code>a</code>,\\nand anything defined in <code>b</code> that is <em>not</em> defined in <code>a</code>\\nwill be in the resulting pattern</p>\\n<p>The structure is maintained from <code>a</code>,\\nbecause the default pattern alignment is <code>in</code>,\\nsee the section on <code>Pattern Alignment</code>\\nin the technical manual in the docs</p>\\n<p>This is the inverse of <code>set</code></p>\\n<p>See examples below</p>","name":"keep","params":[{"type":{"names":["Pattern"]},"name":"pat"}],"memberof":"Pattern","returns":[{"type":{"names":["Pattern"]}}],"tags":["internal","combiners"],"examples":["// notes, already defined, will stay \\"c a f e\\",\\n// while \\"s\\", not defined, will be set to \\"piano\\"\\nnote(\\"c a f e\\").keep(note(\\"e f a c\\").s(\\"piano\\"))"],"scope":"static","longname":"Pattern.keep","kind":"member"},{"comment":"/**\\n *\\n * Assumes a pattern of numbers. Adds the given number to each item in the pattern.\\n * @name add\\n * @memberof Pattern\\n * @tags math\\n * @example\\n * // Here, the triad 0, 2, 4 is shifted by different amounts\\n * n(\\"0 2 4\\".add(\\"<0 3 4 0>\\")).scale(\\"C:major\\")\\n * // Without add, the equivalent would be:\\n * // n(\\"<[0 2 4] [3 5 7] [4 6 8] [0 2 4]>\\").scale(\\"C:major\\")\\n * @example\\n * // You can also use add with notes:\\n * note(\\"c3 e3 g3\\".add(\\"<0 5 7 0>\\"))\\n * // Behind the scenes, the notes are converted to midi numbers:\\n * // note(\\"48 52 55\\".add(\\"<0 5 7 0>\\"))\\n */","meta":{"filename":"pattern.mjs","lineno":1112,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Assumes a pattern of numbers. Adds the given number to each item in the pattern.</p>","name":"add","memberof":"Pattern","tags":["math"],"examples":["// Here, the triad 0, 2, 4 is shifted by different amounts\\nn(\\"0 2 4\\".add(\\"<0 3 4 0>\\")).scale(\\"C:major\\")\\n// Without add, the equivalent would be:\\n// n(\\"<[0 2 4] [3 5 7] [4 6 8] [0 2 4]>\\").scale(\\"C:major\\")","// You can also use add with notes:\\nnote(\\"c3 e3 g3\\".add(\\"<0 5 7 0>\\"))\\n// Behind the scenes, the notes are converted to midi numbers:\\n// note(\\"48 52 55\\".add(\\"<0 5 7 0>\\"))"],"scope":"static","longname":"Pattern.add","kind":"member"},{"comment":"/**\\n *\\n * Like add, but the given numbers are subtracted.\\n * @name sub\\n * @memberof Pattern\\n * @tags math\\n * @example\\n * n(\\"0 2 4\\".sub(\\"<0 1 2 3>\\")).scale(\\"C4:minor\\")\\n * // See add for more information.\\n */","meta":{"filename":"pattern.mjs","lineno":1130,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Like add, but the given numbers are subtracted.</p>","name":"sub","memberof":"Pattern","tags":["math"],"examples":["n(\\"0 2 4\\".sub(\\"<0 1 2 3>\\")).scale(\\"C4:minor\\")\\n// See add for more information."],"scope":"static","longname":"Pattern.sub","kind":"member"},{"comment":"/**\\n *\\n * Multiplies each number by the given factor.\\n * @name mul\\n * @memberof Pattern\\n * @tags math\\n * @example\\n * \\"<1 1.5 [1.66, <2 2.33>]>*4\\".mul(150).freq()\\n */","meta":{"filename":"pattern.mjs","lineno":1141,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Multiplies each number by the given factor.</p>","name":"mul","memberof":"Pattern","tags":["math"],"examples":["\\"<1 1.5 [1.66, <2 2.33>]>*4\\".mul(150).freq()"],"scope":"static","longname":"Pattern.mul","kind":"member"},{"comment":"/**\\n *\\n * Divides each number by the given factor.\\n * @name div\\n * @memberof Pattern\\n * @tags math\\n */","meta":{"filename":"pattern.mjs","lineno":1151,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Divides each number by the given factor.</p>","name":"div","memberof":"Pattern","tags":["math"],"scope":"static","longname":"Pattern.div","kind":"member"},{"comment":"/**\\n * Applies the given structure to the pattern:\\n *\\n * @tags temporal\\n * @example\\n * note(\\"c,eb,g\\")\\n * .struct(\\"x ~ x ~ ~ x ~ x ~ ~ ~ x ~ x ~ ~\\")\\n * .slow(2)\\n */","meta":{"range":[38160,38248],"filename":"pattern.mjs","lineno":1257,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100032911","name":"Pattern.prototype.struct","type":"FunctionExpression","paramnames":["args"]}},"description":"<p>Applies the given structure to the pattern:</p>","tags":["temporal"],"examples":["note(\\"c,eb,g\\")\\n .struct(\\"x ~ x ~ ~ x ~ x ~ ~ ~ x ~ x ~ ~\\")\\n .slow(2)"],"name":"struct","longname":"Pattern#struct","kind":"function","memberof":"Pattern","scope":"instance"},{"comment":"/**\\n * Returns silence when mask is 0 or \\"~\\"\\n *\\n * @tags temporal\\n * @example\\n * note(\\"c [eb,g] d [eb,g]\\").mask(\\"<1 [0 1]>\\")\\n */","meta":{"range":[38488,38573],"filename":"pattern.mjs","lineno":1270,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100032951","name":"Pattern.prototype.mask","type":"FunctionExpression","paramnames":["args"]}},"description":"<p>Returns silence when mask is 0 or "~"</p>","tags":["temporal"],"examples":["note(\\"c [eb,g] d [eb,g]\\").mask(\\"<1 [0 1]>\\")"],"name":"mask","longname":"Pattern#mask","kind":"function","memberof":"Pattern","scope":"instance"},{"comment":"/**\\n * Resets the pattern to the start of the cycle for each onset of the reset pattern.\\n *\\n * @tags temporal\\n * @example\\n * s(\\"[<bd lt> sd]*2, hh*8\\").reset(\\"<x@3 x(5,8)>\\")\\n */","meta":{"range":[38858,38947],"filename":"pattern.mjs","lineno":1283,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100032991","name":"Pattern.prototype.reset","type":"FunctionExpression","paramnames":["args"]}},"description":"<p>Resets the pattern to the start of the cycle for each onset of the reset pattern.</p>","tags":["temporal"],"examples":["s(\\"[<bd lt> sd]*2, hh*8\\").reset(\\"<x@3 x(5,8)>\\")"],"name":"reset","longname":"Pattern#reset","kind":"function","memberof":"Pattern","scope":"instance"},{"comment":"/**\\n * Restarts the pattern for each onset of the restart pattern.\\n * While reset will only reset the current cycle, restart will start from cycle 0.\\n *\\n * @tags temporal\\n * @example\\n * s(\\"[<bd lt> sd]*2, hh*8\\").restart(\\"<x@3 x(5,8)>\\")\\n */","meta":{"range":[39301,39394],"filename":"pattern.mjs","lineno":1297,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100033031","name":"Pattern.prototype.restart","type":"FunctionExpression","paramnames":["args"]}},"description":"<p>Restarts the pattern for each onset of the restart pattern.\\nWhile reset will only reset the current cycle, restart will start from cycle 0.</p>","tags":["temporal"],"examples":["s(\\"[<bd lt> sd]*2, hh*8\\").restart(\\"<x@3 x(5,8)>\\")"],"name":"restart","longname":"Pattern#restart","kind":"function","memberof":"Pattern","scope":"instance"},{"comment":"/**\\n * Sets the default method of combining events from two patterns (aka [alignment](https://strudel.cc/technical-manual/alignment/)) in Strudel.\\n * The default method is 'in', meaning that patterns to the left will (typically) dictate the event timings when combined with patterns to the right.\\n * By changing alignment to 'out', the opposite will happen. With 'mix', they will combine their event timings.\\n *\\n * Note that we say the _default_ method, because alignments can also be set explicitly with calls like\\n * 'add.mix', 'set.squeeze', etc.\\n *\\n * @param {string} method Default join method to use. Options: 'in', 'out', 'mix', 'squeeze', 'squeezeout', 'reset', 'restart', 'poly'\\n * @tags combiners\\n * @example\\n * setDefaultJoin('mix') // also try 'in', 'out', 'squeeze', etc.\\n * s(\\"saw\\").vel(\\"1 0.5\\").note(\\"F A C E\\").delay(\\"0 0.2 0.3\\")\\n */","meta":{"range":[40350,40581],"filename":"pattern.mjs","lineno":1319,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100033070","name":"exports.setDefaultJoin","type":"VariableDeclaration"}},"description":"<p>Sets the default method of combining events from two patterns (aka <a href=\\"https://strudel.cc/technical-manual/alignment/\\">alignment</a>) in Strudel.\\nThe default method is 'in', meaning that patterns to the left will (typically) dictate the event timings when combined with patterns to the right.\\nBy changing alignment to 'out', the opposite will happen. With 'mix', they will combine their event timings.</p>\\n<p>Note that we say the <em>default</em> method, because alignments can also be set explicitly with calls like\\n'add.mix', 'set.squeeze', etc.</p>","params":[{"type":{"names":["string"]},"description":"<p>Default join method to use. Options: 'in', 'out', 'mix', 'squeeze', 'squeezeout', 'reset', 'restart', 'poly'</p>","name":"method"}],"tags":["combiners"],"examples":["setDefaultJoin('mix') // also try 'in', 'out', 'squeeze', etc.\\ns(\\"saw\\").vel(\\"1 0.5\\").note(\\"F A C E\\").delay(\\"0 0.2 0.3\\")"],"name":"setDefaultJoin","longname":"setDefaultJoin","kind":"constant","scope":"global"},{"comment":"/**\\n * Does absolutely nothing, but with a given metrical 'steps'\\n * @name gap\\n * @tags generators\\n * @param {number} steps\\n * @example\\n * gap(3) // \\"~@3\\"\\n */","meta":{"filename":"pattern.mjs","lineno":1353,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Does absolutely nothing, but with a given metrical 'steps'</p>","name":"gap","tags":["generators"],"params":[{"type":{"names":["number"]},"name":"steps"}],"examples":["gap(3) // \\"~@3\\""],"longname":"gap","kind":"member","scope":"global"},{"comment":"/**\\n * Does absolutely nothing..\\n * @name silence\\n * @tags generators\\n * @example\\n * silence // \\"~\\"\\n */","meta":{"filename":"pattern.mjs","lineno":1363,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Does absolutely nothing..</p>","name":"silence","tags":["generators"],"examples":["silence // \\"~\\""],"longname":"silence","kind":"member","scope":"global"},{"comment":"/**\\n * A discrete value that repeats once per cycle.\\n *\\n * @tags generators\\n * @returns {Pattern}\\n * @example\\n * pure('e4') // \\"e4\\"\\n * @noAutocomplete\\n */","meta":{"range":[41787,42044],"filename":"pattern.mjs","lineno":1384,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100033139","name":"exports.pure","type":"FunctionDeclaration","paramnames":["value"]}},"description":"<p>A discrete value that repeats once per cycle.</p>","tags":["generators",{"originalTitle":"noAutocomplete","title":"noautocomplete","text":""}],"returns":[{"type":{"names":["Pattern"]}}],"examples":["pure('e4') // \\"e4\\""],"name":"pure","longname":"pure","kind":"function","scope":"global"},{"comment":"/**\\n * Takes a list of patterns, and returns a pattern of lists.\\n *\\n * @tags temporal\\n */","meta":{"range":[43073,43253],"filename":"pattern.mjs","lineno":1425,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100033229","name":"exports.sequenceP","type":"FunctionDeclaration","paramnames":["pats"]}},"description":"<p>Takes a list of patterns, and returns a pattern of lists.</p>","tags":["temporal"],"name":"sequenceP","longname":"sequenceP","kind":"function","scope":"global"},{"comment":"/**\\n * The given items are played at the same time at the same length.\\n *\\n * @tags temporal\\n * @return {Pattern}\\n * @synonyms polyrhythm, pr\\n * @example\\n * stack(\\"g3\\", \\"b3\\", [\\"e4\\", \\"d4\\"]).note()\\n * // \\"g3,b3,[e4 d4]\\".note()\\n *\\n * @example\\n * // As a chained function:\\n * s(\\"hh*4\\").stack(\\n * note(\\"c4(5,8)\\")\\n * )\\n */","meta":{"range":[43573,43951],"filename":"pattern.mjs","lineno":1449,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100033269","name":"exports.stack","type":"FunctionDeclaration","paramnames":["pats"]}},"description":"<p>The given items are played at the same time at the same length.</p>","tags":["temporal"],"returns":[{"type":{"names":["Pattern"]}}],"synonyms_text":"polyrhythm, pr","synonyms":["polyrhythm","pr"],"examples":["stack(\\"g3\\", \\"b3\\", [\\"e4\\", \\"d4\\"]).note()\\n// \\"g3,b3,[e4 d4]\\".note()","// As a chained function:\\ns(\\"hh*4\\").stack(\\n note(\\"c4(5,8)\\")\\n)"],"name":"stack","longname":"stack","kind":"function","scope":"global"},{"comment":"/**\\n * Concatenation: combines a list of patterns, switching between them successively, one per cycle.\\n *\\n * @tags combiners\\n * @return {Pattern}\\n * @synonyms cat\\n * @example\\n * slowcat(\\"e5\\", \\"b4\\", [\\"d5\\", \\"c5\\"])\\n *\\n */","meta":{"range":[45638,46688],"filename":"pattern.mjs","lineno":1528,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100033633","name":"exports.slowcat","type":"FunctionDeclaration","paramnames":["pats"]}},"description":"<p>Concatenation: combines a list of patterns, switching between them successively, one per cycle.</p>","tags":["combiners"],"returns":[{"type":{"names":["Pattern"]}}],"synonyms_text":"cat","synonyms":["cat"],"examples":["slowcat(\\"e5\\", \\"b4\\", [\\"d5\\", \\"c5\\"])"],"name":"slowcat","longname":"slowcat","kind":"function","scope":"global"},{"comment":"/** Concatenation: combines a list of patterns, switching between them successively, one per cycle. Unlike slowcat, this version will skip cycles.\\n * @tags combiners\\n * @param {...any} items - The items to concatenate\\n * @return {Pattern}\\n */","meta":{"range":[46933,47306],"filename":"pattern.mjs","lineno":1559,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100033793","name":"exports.slowcatPrime","type":"FunctionDeclaration","paramnames":["pats"]}},"description":"<p>Concatenation: combines a list of patterns, switching between them successively, one per cycle. Unlike slowcat, this version will skip cycles.</p>","tags":["combiners"],"params":[{"type":{"names":["any"]},"variable":true,"description":"<p>The items to concatenate</p>","name":"items"}],"returns":[{"type":{"names":["Pattern"]}}],"name":"slowcatPrime","longname":"slowcatPrime","kind":"function","scope":"global"},{"comment":"/** The given items are con**cat**enated, where each one takes one cycle.\\n *\\n * @tags combiners\\n * @param {...any} items - The items to concatenate\\n * @synonyms slowcat\\n * @return {Pattern}\\n * @example\\n * cat(\\"e5\\", \\"b4\\", [\\"d5\\", \\"c5\\"]).note()\\n * // \\"<e5 b4 [d5 c5]>\\".note()\\n *\\n * @example\\n * // As a chained function:\\n * s(\\"hh*4\\").cat(\\n * note(\\"c4(5,8)\\")\\n * )\\n */","meta":{"range":[47674,47733],"filename":"pattern.mjs","lineno":1585,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100033846","name":"exports.cat","type":"FunctionDeclaration","paramnames":["pats"]}},"description":"<p>The given items are con<strong>cat</strong>enated, where each one takes one cycle.</p>","tags":["combiners"],"params":[{"type":{"names":["any"]},"variable":true,"description":"<p>The items to concatenate</p>","name":"items"}],"synonyms_text":"slowcat","synonyms":["slowcat"],"returns":[{"type":{"names":["Pattern"]}}],"examples":["cat(\\"e5\\", \\"b4\\", [\\"d5\\", \\"c5\\"]).note()\\n// \\"<e5 b4 [d5 c5]>\\".note()","// As a chained function:\\ns(\\"hh*4\\").cat(\\n note(\\"c4(5,8)\\")\\n)"],"name":"cat","longname":"cat","kind":"function","scope":"global"},{"comment":"/**\\n * Allows to arrange multiple patterns together over multiple cycles.\\n * Takes a variable number of arrays with two elements specifying the number of cycles and the pattern to use.\\n *\\n * @tags combiners\\n * @return {Pattern}\\n * @example\\n * arrange(\\n * [4, \\"<c a f e>(3,8)\\"],\\n * [2, \\"<g a>(5,8)\\"]\\n * ).note()\\n */","meta":{"range":[48054,48288],"filename":"pattern.mjs","lineno":1601,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100033857","name":"exports.arrange","type":"FunctionDeclaration","paramnames":["sections"]}},"description":"<p>Allows to arrange multiple patterns together over multiple cycles.\\nTakes a variable number of arrays with two elements specifying the number of cycles and the pattern to use.</p>","tags":["combiners"],"returns":[{"type":{"names":["Pattern"]}}],"examples":["arrange(\\n [4, \\"<c a f e>(3,8)\\"],\\n [2, \\"<g a>(5,8)\\"]\\n).note()"],"name":"arrange","longname":"arrange","kind":"function","scope":"global"},{"comment":"/**\\n * Similarly to \`arrange\`, allows you to arrange multiple patterns together over multiple cycles.\\n * Unlike \`arrange\`, you specify a start and stop time for each pattern rather than duration, which\\n * means that patterns can overlap.\\n * @tags combiners\\n * @return {Pattern}\\n * @example\\nseqPLoop(\\n [0, 2, \\"bd(3,8)\\"],\\n [1, 3, \\"cp(3,8)\\"]\\n).sound()\\n */","meta":{"range":[48645,49069],"filename":"pattern.mjs","lineno":1619,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100033902","name":"exports.seqPLoop","type":"FunctionDeclaration","paramnames":["parts"]}},"description":"<p>Similarly to <code>arrange</code>, allows you to arrange multiple patterns together over multiple cycles.\\nUnlike <code>arrange</code>, you specify a start and stop time for each pattern rather than duration, which\\nmeans that patterns can overlap.</p>","tags":["combiners"],"returns":[{"type":{"names":["Pattern"]}}],"examples":["seqPLoop(\\n [0, 2, \\"bd(3,8)\\"],\\n [1, 3, \\"cp(3,8)\\"]\\n).sound()"],"name":"seqPLoop","longname":"seqPLoop","kind":"function","scope":"global"},{"comment":"/** See \`fastcat\`\\n * @name sequence\\n * @tags combiners\\n */","meta":{"filename":"pattern.mjs","lineno":1650,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>See <code>fastcat</code></p>","name":"sequence","tags":["combiners"],"longname":"sequence","kind":"member","scope":"global"},{"comment":"/** Like **cat**, but the items are crammed into one cycle.\\n * @tags combiners\\n * @synonyms fastcat\\n * @example\\n * seq(\\"e5\\", \\"b4\\", [\\"d5\\", \\"c5\\"]).note()\\n * // \\"e5 b4 [d5 c5]\\".note()\\n *\\n * @example\\n * // As a chained function:\\n * s(\\"hh*4\\").seq(\\n * note(\\"c4(5,8)\\")\\n * )\\n */","meta":{"range":[49750,49809],"filename":"pattern.mjs","lineno":1672,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100034056","name":"exports.seq","type":"FunctionDeclaration","paramnames":["pats"]}},"description":"<p>Like <strong>cat</strong>, but the items are crammed into one cycle.</p>","tags":["combiners"],"synonyms_text":"fastcat","synonyms":["fastcat"],"examples":["seq(\\"e5\\", \\"b4\\", [\\"d5\\", \\"c5\\"]).note()\\n// \\"e5 b4 [d5 c5]\\".note()","// As a chained function:\\ns(\\"hh*4\\").seq(\\n note(\\"c4(5,8)\\")\\n)"],"name":"seq","longname":"seq","kind":"function","scope":"global"},{"comment":"/**\\n * Registers a new pattern method. The method is added to the Pattern class + the standalone function is returned from register.\\n *\\n * @tags functional\\n * @param {string | string[]} name name of the function, or an array of names to be used as synonyms\\n * @param {function} func function with 1 or more params, where last is the current pattern\\n * @param {bool} patternify defaults to true; if set to false, you will have more control over the arguments to \`func\` as they will be\\n * in their raw form and it will be up to you to patternify them and/or query them for values\\n * @example\\n * const vlpf = register('vlpf', (freq, pat) => {\\n * return pat.fmap((v) => ({...v, cutoff: freq * (v.velocity ?? 1) }));\\n * })\\n * s(\\"saw\\").seg(8).velocity(rand).vlpf(800)\\n *\\n */","meta":{"range":[52857,55592],"filename":"pattern.mjs","lineno":1743,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100034688","name":"exports.register","type":"FunctionDeclaration","paramnames":["name","func","patternify","preserveSteps","join"]}},"description":"<p>Registers a new pattern method. The method is added to the Pattern class + the standalone function is returned from register.</p>","tags":["functional"],"params":[{"type":{"names":["string","Array.<string>"]},"description":"<p>name of the function, or an array of names to be used as synonyms</p>","name":"name"},{"type":{"names":["function"]},"description":"<p>function with 1 or more params, where last is the current pattern</p>","name":"func"},{"type":{"names":["bool"]},"description":"<p>defaults to true; if set to false, you will have more control over the arguments to <code>func</code> as they will be\\nin their raw form and it will be up to you to patternify them and/or query them for values</p>","name":"patternify"}],"examples":["const vlpf = register('vlpf', (freq, pat) => {\\n return pat.fmap((v) => ({...v, cutoff: freq * (v.velocity ?? 1) }));\\n})\\ns(\\"saw\\").seg(8).velocity(rand).vlpf(800)"],"name":"register","longname":"register","kind":"function","scope":"global"},{"comment":"/**\\n * Assumes a numerical pattern. Returns a new pattern with all values rounded\\n * to the nearest integer.\\n * @name round\\n * @tags math\\n * @memberof Pattern\\n * @returns Pattern\\n * @example\\n * n(\\"0.5 1.5 2.5\\".round()).scale(\\"C:major\\")\\n */","meta":{"filename":"pattern.mjs","lineno":1838,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Assumes a numerical pattern. Returns a new pattern with all values rounded\\nto the nearest integer.</p>","name":"round","tags":["math"],"memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"examples":["n(\\"0.5 1.5 2.5\\".round()).scale(\\"C:major\\")"],"scope":"static","longname":"Pattern.round","kind":"member"},{"comment":"/**\\n * Assumes a numerical pattern. Returns a new pattern with all values set to\\n * their mathematical floor. E.g. \`3.7\` replaced with to \`3\`, and \`-4.2\`\\n * replaced with \`-5\`.\\n * @name floor\\n * @memberof Pattern\\n * @tags math\\n * @returns Pattern\\n * @example\\n * note(\\"42 42.1 42.5 43\\".floor())\\n */","meta":{"filename":"pattern.mjs","lineno":1851,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Assumes a numerical pattern. Returns a new pattern with all values set to\\ntheir mathematical floor. E.g. <code>3.7</code> replaced with to <code>3</code>, and <code>-4.2</code>\\nreplaced with <code>-5</code>.</p>","name":"floor","memberof":"Pattern","tags":["math"],"returns":[{"description":"<p>Pattern</p>"}],"examples":["note(\\"42 42.1 42.5 43\\".floor())"],"scope":"static","longname":"Pattern.floor","kind":"member"},{"comment":"/**\\n * Assumes a numerical pattern. Returns a new pattern with all values set to\\n * their mathematical ceiling. E.g. \`3.2\` replaced with \`4\`, and \`-4.2\`\\n * replaced with \`-4\`.\\n * @name ceil\\n * @memberof Pattern\\n * @tags math\\n * @returns Pattern\\n * @example\\n * note(\\"42 42.1 42.5 43\\".ceil())\\n */","meta":{"filename":"pattern.mjs","lineno":1868,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Assumes a numerical pattern. Returns a new pattern with all values set to\\ntheir mathematical ceiling. E.g. <code>3.2</code> replaced with <code>4</code>, and <code>-4.2</code>\\nreplaced with <code>-4</code>.</p>","name":"ceil","memberof":"Pattern","tags":["math"],"returns":[{"description":"<p>Pattern</p>"}],"examples":["note(\\"42 42.1 42.5 43\\".ceil())"],"scope":"static","longname":"Pattern.ceil","kind":"member"},{"comment":"/**\\n * Assumes a numerical pattern, containing unipolar values in the range 0 ..\\n * 1. Returns a new pattern with values scaled to the bipolar range -1 .. 1\\n * @tags math\\n * @returns Pattern\\n * @noAutocomplete\\n */","meta":{"range":[57382,57486],"filename":"pattern.mjs","lineno":1889,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100035237","name":"exports.toBipolar","type":"VariableDeclaration"}},"description":"<p>Assumes a numerical pattern, containing unipolar values in the range 0 ..</p>\\n<ol>\\n<li>Returns a new pattern with values scaled to the bipolar range -1 .. 1</li>\\n</ol>","tags":["math",{"originalTitle":"noAutocomplete","title":"noautocomplete","text":""}],"returns":[{"description":"<p>Pattern</p>"}],"name":"toBipolar","longname":"toBipolar","kind":"constant","scope":"global"},{"comment":"/**\\n * Assumes a numerical pattern, containing bipolar values in the range -1 .. 1\\n * Returns a new pattern with values scaled to the unipolar range 0 .. 1\\n * @tags math\\n * @returns Pattern\\n * @noAutocomplete\\n */","meta":{"range":[57701,57811],"filename":"pattern.mjs","lineno":1900,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100035259","name":"exports.fromBipolar","type":"VariableDeclaration"}},"description":"<p>Assumes a numerical pattern, containing bipolar values in the range -1 .. 1\\nReturns a new pattern with values scaled to the unipolar range 0 .. 1</p>","tags":["math",{"originalTitle":"noAutocomplete","title":"noautocomplete","text":""}],"returns":[{"description":"<p>Pattern</p>"}],"name":"fromBipolar","longname":"fromBipolar","kind":"constant","scope":"global"},{"comment":"/**\\n * Assumes a numerical pattern, containing unipolar values in the range 0 .. 1.\\n * Returns a new pattern with values scaled to the given min/max range.\\n * Most useful in combination with continuous patterns.\\n * @name range\\n * @memberof Pattern\\n * @tags math\\n * @returns Pattern\\n * @example\\n * s(\\"[bd sd]*2,hh*8\\")\\n * .cutoff(sine.range(500,4000))\\n */","meta":{"filename":"pattern.mjs","lineno":1904,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Assumes a numerical pattern, containing unipolar values in the range 0 .. 1.\\nReturns a new pattern with values scaled to the given min/max range.\\nMost useful in combination with continuous patterns.</p>","name":"range","memberof":"Pattern","tags":["math"],"returns":[{"description":"<p>Pattern</p>"}],"examples":["s(\\"[bd sd]*2,hh*8\\")\\n.cutoff(sine.range(500,4000))"],"scope":"static","longname":"Pattern.range","kind":"member"},{"comment":"/**\\n * Assumes a numerical pattern, containing unipolar values in the range 0 .. 1\\n * Returns a new pattern with values scaled to the given min/max range,\\n * following an exponential curve.\\n * @name rangex\\n * @memberof Pattern\\n * @tags math\\n * @returns Pattern\\n * @example\\n * s(\\"[bd sd]*2,hh*8\\")\\n * .cutoff(sine.rangex(500,4000))\\n */","meta":{"filename":"pattern.mjs","lineno":1920,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Assumes a numerical pattern, containing unipolar values in the range 0 .. 1\\nReturns a new pattern with values scaled to the given min/max range,\\nfollowing an exponential curve.</p>","name":"rangex","memberof":"Pattern","tags":["math"],"returns":[{"description":"<p>Pattern</p>"}],"examples":["s(\\"[bd sd]*2,hh*8\\")\\n.cutoff(sine.rangex(500,4000))"],"scope":"static","longname":"Pattern.rangex","kind":"member"},{"comment":"/**\\n * Assumes a numerical pattern, containing bipolar values in the range -1 .. 1\\n * Returns a new pattern with values scaled to the given min/max range.\\n * @name range2\\n * @memberof Pattern\\n * @tags math\\n * @returns Pattern\\n * @example\\n * s(\\"[bd sd]*2,hh*8\\")\\n * .cutoff(sine2.range2(500,4000))\\n */","meta":{"filename":"pattern.mjs","lineno":1936,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Assumes a numerical pattern, containing bipolar values in the range -1 .. 1\\nReturns a new pattern with values scaled to the given min/max range.</p>","name":"range2","memberof":"Pattern","tags":["math"],"returns":[{"description":"<p>Pattern</p>"}],"examples":["s(\\"[bd sd]*2,hh*8\\")\\n.cutoff(sine2.range2(500,4000))"],"scope":"static","longname":"Pattern.range2","kind":"member"},{"comment":"/**\\n * Allows dividing numbers via list notation using \\":\\".\\n * Returns a new pattern with just numbers.\\n * @name ratio\\n * @memberof Pattern\\n * @tags math\\n * @returns Pattern\\n * @example\\n * ratio(\\"1, 5:4, 3:2\\").mul(110)\\n * .freq().s(\\"piano\\")\\n */","meta":{"filename":"pattern.mjs","lineno":1951,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Allows dividing numbers via list notation using ":".\\nReturns a new pattern with just numbers.</p>","name":"ratio","memberof":"Pattern","tags":["math"],"returns":[{"description":"<p>Pattern</p>"}],"examples":["ratio(\\"1, 5:4, 3:2\\").mul(110)\\n.freq().s(\\"piano\\")"],"scope":"static","longname":"Pattern.ratio","kind":"member"},{"comment":"/** Compress each cycle into the given timespan, leaving a gap\\n * @tags temporal\\n * @example\\n * cat(\\n * s(\\"bd sd\\").compress(.25,.75),\\n * s(\\"~ bd sd ~\\")\\n * )\\n */","meta":{"range":[59878,60131],"filename":"pattern.mjs","lineno":1982,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100035404","name":"exports.compress","type":"VariableDeclaration"}},"description":"<p>Compress each cycle into the given timespan, leaving a gap</p>","tags":["temporal"],"examples":["cat(\\n s(\\"bd sd\\").compress(.25,.75),\\n s(\\"~ bd sd ~\\")\\n)"],"name":"compress","longname":"compress","kind":"constant","scope":"global"},{"comment":"/**\\n * speeds up a pattern like fast, but rather than it playing multiple times as fast would it instead leaves a gap in the remaining space of the cycle. For example, the following will play the sound pattern \\"bd sn\\" only once but compressed into the first half of the cycle, i.e. twice as fast.\\n * @tags temporal\\n * @name fastGap\\n * @synonyms fastgap\\n * @example\\n * s(\\"bd sd\\").fastGap(2)\\n */","meta":{"filename":"pattern.mjs","lineno":1995,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>speeds up a pattern like fast, but rather than it playing multiple times as fast would it instead leaves a gap in the remaining space of the cycle. For example, the following will play the sound pattern "bd sn" only once but compressed into the first half of the cycle, i.e. twice as fast.</p>","tags":["temporal"],"name":"fastGap","synonyms_text":"fastgap","synonyms":["fastgap"],"examples":["s(\\"bd sd\\").fastGap(2)"],"longname":"fastGap","kind":"member","scope":"global"},{"comment":"/**\\n * Similar to \`compress\`, but doesn't leave gaps, and the 'focus' can be bigger than a cycle\\n * @tags temporal\\n * @example\\n * s(\\"bd hh sd hh\\").focus(1/4, 3/4)\\n */","meta":{"range":[62058,62248],"filename":"pattern.mjs","lineno":2039,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100035746","name":"exports.focus","type":"VariableDeclaration"}},"description":"<p>Similar to <code>compress</code>, but doesn't leave gaps, and the 'focus' can be bigger than a cycle</p>","tags":["temporal"],"examples":["s(\\"bd hh sd hh\\").focus(1/4, 3/4)"],"name":"focus","longname":"focus","kind":"constant","scope":"global"},{"comment":"/** The ply function repeats each event the given number of times.\\n * @tags temporal\\n * @example\\n * s(\\"bd ~ sd cp\\").ply(\\"<1 2 3>\\")\\n */","meta":{"range":[62533,62764],"filename":"pattern.mjs","lineno":2057,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100035825","name":"exports.ply","type":"VariableDeclaration"}},"description":"<p>The ply function repeats each event the given number of times.</p>","tags":["temporal"],"examples":["s(\\"bd ~ sd cp\\").ply(\\"<1 2 3>\\")"],"name":"ply","longname":"ply","kind":"constant","scope":"global"},{"comment":"/**\\n * Speed up a pattern by the given factor. Used by \\"*\\" in mini notation.\\n *\\n * @tags temporal\\n * @name fast\\n * @synonyms density\\n * @memberof Pattern\\n * @param {number | Pattern} factor speed up factor\\n * @returns Pattern\\n * @example\\n * s(\\"bd hh sd hh\\").fast(2) // s(\\"[bd hh sd hh]*2\\")\\n */","meta":{"filename":"pattern.mjs","lineno":2065,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Speed up a pattern by the given factor. Used by "*" in mini notation.</p>","tags":["temporal"],"name":"fast","synonyms_text":"density","synonyms":["density"],"memberof":"Pattern","params":[{"type":{"names":["number","Pattern"]},"description":"<p>speed up factor</p>","name":"factor"}],"returns":[{"description":"<p>Pattern</p>"}],"examples":["s(\\"bd hh sd hh\\").fast(2) // s(\\"[bd hh sd hh]*2\\")"],"scope":"static","longname":"Pattern.fast","kind":"member"},{"comment":"/**\\n * Both speeds up the pattern (like 'fast') and the sample playback (like 'speed').\\n * @tags temporal\\n * @example\\n * s(\\"bd sd:2\\").hurry(\\"<1 2 4 3>\\").slow(1.5)\\n */","meta":{"range":[63568,63677],"filename":"pattern.mjs","lineno":2097,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100035938","name":"exports.hurry","type":"VariableDeclaration"}},"description":"<p>Both speeds up the pattern (like 'fast') and the sample playback (like 'speed').</p>","tags":["temporal"],"examples":["s(\\"bd sd:2\\").hurry(\\"<1 2 4 3>\\").slow(1.5)"],"name":"hurry","longname":"hurry","kind":"constant","scope":"global"},{"comment":"/**\\n * Slow down a pattern over the given number of cycles. Like the \\"/\\" operator in mini notation.\\n *\\n * @tags temporal\\n * @name slow\\n * @synonyms sparsity\\n * @memberof Pattern\\n * @param {number | Pattern} factor slow down factor\\n * @returns Pattern\\n * @example\\n * s(\\"bd hh sd hh\\").slow(2) // s(\\"[bd hh sd hh]/2\\")\\n */","meta":{"filename":"pattern.mjs","lineno":2101,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Slow down a pattern over the given number of cycles. Like the "/" operator in mini notation.</p>","tags":["temporal"],"name":"slow","synonyms_text":"sparsity","synonyms":["sparsity"],"memberof":"Pattern","params":[{"type":{"names":["number","Pattern"]},"description":"<p>slow down factor</p>","name":"factor"}],"returns":[{"description":"<p>Pattern</p>"}],"examples":["s(\\"bd hh sd hh\\").slow(2) // s(\\"[bd hh sd hh]/2\\")"],"scope":"static","longname":"Pattern.slow","kind":"member"},{"comment":"/**\\n * Carries out an operation 'inside' a cycle.\\n * @tags temporal\\n * @example\\n * \\"0 1 2 3 4 3 2 1\\".inside(4, rev).scale('C major').note()\\n * // \\"0 1 2 3 4 3 2 1\\".slow(4).rev().fast(4).scale('C major').note()\\n */","meta":{"range":[64398,64515],"filename":"pattern.mjs","lineno":2127,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100035999","name":"exports.inside","type":"VariableDeclaration"}},"description":"<p>Carries out an operation 'inside' a cycle.</p>","tags":["temporal"],"examples":["\\"0 1 2 3 4 3 2 1\\".inside(4, rev).scale('C major').note()\\n// \\"0 1 2 3 4 3 2 1\\".slow(4).rev().fast(4).scale('C major').note()"],"name":"inside","longname":"inside","kind":"constant","scope":"global"},{"comment":"/**\\n * Carries out an operation 'outside' a cycle.\\n * @tags temporal\\n * @example\\n * \\"<[0 1] 2 [3 4] 5>\\".outside(4, rev).scale('C major').note()\\n * // \\"<[0 1] 2 [3 4] 5>\\".fast(4).rev().slow(4).scale('C major').note()\\n */","meta":{"range":[64737,64856],"filename":"pattern.mjs","lineno":2138,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100036023","name":"exports.outside","type":"VariableDeclaration"}},"description":"<p>Carries out an operation 'outside' a cycle.</p>","tags":["temporal"],"examples":["\\"<[0 1] 2 [3 4] 5>\\".outside(4, rev).scale('C major').note()\\n// \\"<[0 1] 2 [3 4] 5>\\".fast(4).rev().slow(4).scale('C major').note()"],"name":"outside","longname":"outside","kind":"constant","scope":"global"},{"comment":"/**\\n * Applies the given function every n cycles, starting from the last cycle.\\n * @tags temporal\\n * @name lastOf\\n * @memberof Pattern\\n * @param {number} n how many cycles\\n * @param {function} func function to apply\\n * @returns Pattern\\n * @example\\n * note(\\"c3 d3 e3 g3\\").lastOf(4, x=>x.rev())\\n */","meta":{"filename":"pattern.mjs","lineno":2142,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Applies the given function every n cycles, starting from the last cycle.</p>","tags":["temporal"],"name":"lastOf","memberof":"Pattern","params":[{"type":{"names":["number"]},"description":"<p>how many cycles</p>","name":"n"},{"type":{"names":["function"]},"description":"<p>function to apply</p>","name":"func"}],"returns":[{"description":"<p>Pattern</p>"}],"examples":["note(\\"c3 d3 e3 g3\\").lastOf(4, x=>x.rev())"],"scope":"static","longname":"Pattern.lastOf","kind":"member"},{"comment":"/**\\n * Applies the given function every n cycles, starting from the first cycle.\\n * @tags temporal\\n * @name firstOf\\n * @memberof Pattern\\n * @param {number} n how many cycles\\n * @param {function} func function to apply\\n * @returns Pattern\\n * @example\\n * note(\\"c3 d3 e3 g3\\").firstOf(4, x=>x.rev())\\n */","meta":{"filename":"pattern.mjs","lineno":2159,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Applies the given function every n cycles, starting from the first cycle.</p>","tags":["temporal"],"name":"firstOf","memberof":"Pattern","params":[{"type":{"names":["number"]},"description":"<p>how many cycles</p>","name":"n"},{"type":{"names":["function"]},"description":"<p>function to apply</p>","name":"func"}],"returns":[{"description":"<p>Pattern</p>"}],"examples":["note(\\"c3 d3 e3 g3\\").firstOf(4, x=>x.rev())"],"scope":"static","longname":"Pattern.firstOf","kind":"member"},{"comment":"/**\\n * An alias for \`firstOf\`\\n * @tags temporal\\n * @name every\\n * @memberof Pattern\\n * @param {number} n how many cycles\\n * @param {function} func function to apply\\n * @returns Pattern\\n * @example\\n * note(\\"c3 d3 e3 g3\\").every(4, x=>x.rev())\\n */","meta":{"filename":"pattern.mjs","lineno":2171,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>An alias for <code>firstOf</code></p>","tags":["temporal"],"name":"every","memberof":"Pattern","params":[{"type":{"names":["number"]},"description":"<p>how many cycles</p>","name":"n"},{"type":{"names":["function"]},"description":"<p>function to apply</p>","name":"func"}],"returns":[{"description":"<p>Pattern</p>"}],"examples":["note(\\"c3 d3 e3 g3\\").every(4, x=>x.rev())"],"scope":"static","longname":"Pattern.every","kind":"member"},{"comment":"/**\\n * Applies the given function to the pattern. Like layer, but with a single function:\\n * @tags combiners\\n * @name apply\\n * @example\\n * \\"<c3 eb3 g3>\\".scale('C minor').apply(scaleTranspose(\\"0,2,4\\")).note()\\n */","meta":{"filename":"pattern.mjs","lineno":2188,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Applies the given function to the pattern. Like layer, but with a single function:</p>","tags":["combiners"],"name":"apply","examples":["\\"<c3 eb3 g3>\\".scale('C minor').apply(scaleTranspose(\\"0,2,4\\")).note()"],"longname":"apply","kind":"member","scope":"global"},{"comment":"/**\\n * Plays the pattern at the given cycles per minute.\\n * @tags temporal\\n * @deprecated\\n * @example\\n * s(\\"<bd sd>,hh*2\\").cpm(90) // = 90 bpm\\n */","meta":{"range":[66575,66669],"filename":"pattern.mjs","lineno":2207,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100036142","name":"exports.cpm","type":"VariableDeclaration"}},"description":"<p>Plays the pattern at the given cycles per minute.</p>","tags":["temporal"],"deprecated":true,"examples":["s(\\"<bd sd>,hh*2\\").cpm(90) // = 90 bpm"],"name":"cpm","longname":"cpm","kind":"constant","scope":"global"},{"comment":"/**\\n * Nudge a pattern to start earlier in time. Equivalent of Tidal's <~ operator\\n *\\n * @tags temporal\\n * @name early\\n * @memberof Pattern\\n * @param {number | Pattern} cycles number of cycles to nudge left\\n * @returns Pattern\\n * @example\\n * \\"bd ~\\".stack(\\"hh ~\\".early(.1)).s()\\n */","meta":{"filename":"pattern.mjs","lineno":2211,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Nudge a pattern to start earlier in time. Equivalent of Tidal's <~ operator</p>","tags":["temporal"],"name":"early","memberof":"Pattern","params":[{"type":{"names":["number","Pattern"]},"description":"<p>number of cycles to nudge left</p>","name":"cycles"}],"returns":[{"description":"<p>Pattern</p>"}],"examples":["\\"bd ~\\".stack(\\"hh ~\\".early(.1)).s()"],"scope":"static","longname":"Pattern.early","kind":"member"},{"comment":"/**\\n * Nudge a pattern to start later in time. Equivalent of Tidal's ~> operator\\n *\\n * @tags temporal\\n * @name late\\n * @memberof Pattern\\n * @param {number | Pattern} cycles number of cycles to nudge right\\n * @returns Pattern\\n * @example\\n * \\"bd ~\\".stack(\\"hh ~\\".late(.1)).s()\\n */","meta":{"filename":"pattern.mjs","lineno":2232,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Nudge a pattern to start later in time. Equivalent of Tidal's ~> operator</p>","tags":["temporal"],"name":"late","memberof":"Pattern","params":[{"type":{"names":["number","Pattern"]},"description":"<p>number of cycles to nudge right</p>","name":"cycles"}],"returns":[{"description":"<p>Pattern</p>"}],"examples":["\\"bd ~\\".stack(\\"hh ~\\".late(.1)).s()"],"scope":"static","longname":"Pattern.late","kind":"member"},{"comment":"/**\\n * Plays a portion of a pattern, specified by the beginning and end of a time span. The new resulting pattern is played over the time period of the original pattern:\\n *\\n * @tags temporal\\n * @example\\n * s(\\"bd*2 hh*3 [sd bd]*2 perc\\").zoom(0.25, 0.75)\\n * // s(\\"hh*3 [sd bd]*2\\") // equivalent\\n */","meta":{"range":[67909,68328],"filename":"pattern.mjs","lineno":2261,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100036235","name":"exports.zoom","type":"VariableDeclaration"}},"description":"<p>Plays a portion of a pattern, specified by the beginning and end of a time span. The new resulting pattern is played over the time period of the original pattern:</p>","tags":["temporal"],"examples":["s(\\"bd*2 hh*3 [sd bd]*2 perc\\").zoom(0.25, 0.75)\\n// s(\\"hh*3 [sd bd]*2\\") // equivalent"],"name":"zoom","longname":"zoom","kind":"constant","scope":"global"},{"comment":"/**\\n * Splits a pattern into the given number of slices, and plays them according to a pattern of slice numbers.\\n * Similar to \`slice\`, but slices up patterns rather than sound samples.\\n * @tags temporal\\n * @param {number} number of slices\\n * @param {number} slices to play\\n * @example\\n * note(\\"0 1 2 3 4 5 6 7\\".scale('c:mixolydian'))\\n *.bite(4, \\"3 2 1 0\\")\\n * @example\\n * sound(\\"bd - bd bd*2, - sd:6 - sd:5 sd:1 - [- sd:2] -, hh [- cp:7]\\")\\n .bank(\\"RolandTR909\\").speed(1.2)\\n .bite(4, \\"0 0 [1 2] <3 2> 0 0 [2 1] 3\\")\\n */","meta":{"range":[68979,69277],"filename":"pattern.mjs","lineno":2294,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100036360","name":"exports.bite","type":"VariableDeclaration"}},"description":"<p>Splits a pattern into the given number of slices, and plays them according to a pattern of slice numbers.\\nSimilar to <code>slice</code>, but slices up patterns rather than sound samples.</p>","tags":["temporal"],"params":[{"type":{"names":["number"]},"description":"<p>of slices</p>","name":"number"},{"type":{"names":["number"]},"description":"<p>to play</p>","name":"slices"}],"examples":["note(\\"0 1 2 3 4 5 6 7\\".scale('c:mixolydian'))\\n.bite(4, \\"3 2 1 0\\")","sound(\\"bd - bd bd*2, - sd:6 - sd:5 sd:1 - [- sd:2] -, hh [- cp:7]\\")\\n .bank(\\"RolandTR909\\").speed(1.2)\\n .bite(4, \\"0 0 [1 2] <3 2> 0 0 [2 1] 3\\")"],"name":"bite","longname":"bite","kind":"constant","scope":"global"},{"comment":"/**\\n * Selects the given fraction of the pattern and repeats that part to fill the remainder of the cycle.\\n * @tags temporal\\n * @param {number} fraction fraction to select\\n * @example\\n * s(\\"lt ht mt cp, [hh oh]*2\\").linger(\\"<1 .5 .25 .125>\\")\\n */","meta":{"range":[69524,69766],"filename":"pattern.mjs","lineno":2316,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100036425","name":"exports.linger","type":"VariableDeclaration"}},"description":"<p>Selects the given fraction of the pattern and repeats that part to fill the remainder of the cycle.</p>","tags":["temporal"],"params":[{"type":{"names":["number"]},"description":"<p>fraction to select</p>","name":"fraction"}],"examples":["s(\\"lt ht mt cp, [hh oh]*2\\").linger(\\"<1 .5 .25 .125>\\")"],"name":"linger","longname":"linger","kind":"constant","scope":"global"},{"comment":"/**\\n * Samples the pattern at a rate of n events per cycle. Useful for turning a continuous pattern into a discrete one.\\n * @tags temporal\\n * @name segment\\n * @synonyms seg\\n * @param {number} segments number of segments per cycle\\n * @example\\n * note(saw.range(40,52).segment(24))\\n */","meta":{"filename":"pattern.mjs","lineno":2330,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Samples the pattern at a rate of n events per cycle. Useful for turning a continuous pattern into a discrete one.</p>","tags":["temporal"],"name":"segment","synonyms_text":"seg","synonyms":["seg"],"params":[{"type":{"names":["number"]},"description":"<p>number of segments per cycle</p>","name":"segments"}],"examples":["note(saw.range(40,52).segment(24))"],"longname":"segment","kind":"member","scope":"global"},{"comment":"/**\\n * The function \`swingBy x n\` breaks each cycle into \`n\` slices, and then delays events in the second half of each slice by the amount \`x\`, which is relative to the size of the (half) slice. So if \`x\` is 0 it does nothing, \`0.5\` delays for half the note duration, and 1 will wrap around to doing nothing again. The end result is a shuffle or swing-like rhythm\\n * @tags temporal\\n * @param {number} subdivision\\n * @param {number} offset\\n * @example\\n * s(\\"hh*8\\").swingBy(1/3, 4)\\n */","meta":{"range":[70685,70787],"filename":"pattern.mjs","lineno":2351,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100036509","name":"exports.swingBy","type":"VariableDeclaration"}},"description":"<p>The function <code>swingBy x n</code> breaks each cycle into <code>n</code> slices, and then delays events in the second half of each slice by the amount <code>x</code>, which is relative to the size of the (half) slice. So if <code>x</code> is 0 it does nothing, <code>0.5</code> delays for half the note duration, and 1 will wrap around to doing nothing again. The end result is a shuffle or swing-like rhythm</p>","tags":["temporal"],"params":[{"type":{"names":["number"]},"name":"subdivision"},{"type":{"names":["number"]},"name":"offset"}],"examples":["s(\\"hh*8\\").swingBy(1/3, 4)"],"name":"swingBy","longname":"swingBy","kind":"constant","scope":"global"},{"comment":"/**\\n * Shorthand for swingBy with 1/3:\\n * @tags temporal\\n * @param {number} subdivision\\n * @example\\n * s(\\"hh*8\\").swing(4)\\n * // s(\\"hh*8\\").swingBy(1/3, 4)\\n */","meta":{"range":[70947,71021],"filename":"pattern.mjs","lineno":2361,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100036533","name":"exports.swing","type":"VariableDeclaration"}},"description":"<p>Shorthand for swingBy with 1/3:</p>","tags":["temporal"],"params":[{"type":{"names":["number"]},"name":"subdivision"}],"examples":["s(\\"hh*8\\").swing(4)\\n// s(\\"hh*8\\").swingBy(1/3, 4)"],"name":"swing","longname":"swing","kind":"constant","scope":"global"},{"comment":"/**\\n * Swaps 1s and 0s in a binary pattern.\\n * @tags temporal\\n * @name invert\\n * @synonyms inv\\n * @example\\n * s(\\"bd\\").struct(\\"1 0 0 1 0 0 1 0\\".lastOf(4, invert))\\n */","meta":{"filename":"pattern.mjs","lineno":2363,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Swaps 1s and 0s in a binary pattern.</p>","tags":["temporal"],"name":"invert","synonyms_text":"inv","synonyms":["inv"],"examples":["s(\\"bd\\").struct(\\"1 0 0 1 0 0 1 0\\".lastOf(4, invert))"],"longname":"invert","kind":"member","scope":"global"},{"comment":"/**\\n * Applies the given function whenever the given pattern is in a true state.\\n * @tags temporal\\n * @name when\\n * @memberof Pattern\\n * @param {Pattern} binary_pat\\n * @param {function} func\\n * @returns Pattern\\n * @example\\n * \\"c3 eb3 g3\\".when(\\"<0 1>/2\\", x=>x.sub(\\"5\\")).note()\\n */","meta":{"filename":"pattern.mjs","lineno":2381,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Applies the given function whenever the given pattern is in a true state.</p>","tags":["temporal"],"name":"when","memberof":"Pattern","params":[{"type":{"names":["Pattern"]},"name":"binary_pat"},{"type":{"names":["function"]},"name":"func"}],"returns":[{"description":"<p>Pattern</p>"}],"examples":["\\"c3 eb3 g3\\".when(\\"<0 1>/2\\", x=>x.sub(\\"5\\")).note()"],"scope":"static","longname":"Pattern.when","kind":"member"},{"comment":"/**\\n * Superimposes the function result on top of the original pattern, delayed by the given time.\\n * @tags temporal\\n * @name off\\n * @memberof Pattern\\n * @param {Pattern | number} time offset time\\n * @param {function} func function to apply\\n * @returns Pattern\\n * @example\\n * \\"c3 eb3 g3\\".off(1/8, x=>x.add(7)).note()\\n */","meta":{"filename":"pattern.mjs","lineno":2396,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Superimposes the function result on top of the original pattern, delayed by the given time.</p>","tags":["temporal"],"name":"off","memberof":"Pattern","params":[{"type":{"names":["Pattern","number"]},"description":"<p>offset time</p>","name":"time"},{"type":{"names":["function"]},"description":"<p>function to apply</p>","name":"func"}],"returns":[{"description":"<p>Pattern</p>"}],"examples":["\\"c3 eb3 g3\\".off(1/8, x=>x.add(7)).note()"],"scope":"static","longname":"Pattern.off","kind":"member"},{"comment":"/**\\n * Returns a new pattern where every other cycle is played once, twice as\\n * fast, and offset in time by one quarter of a cycle. Creates a kind of\\n * breakbeat feel.\\n * @tags temporal\\n * @returns Pattern\\n */","meta":{"range":[72403,72541],"filename":"pattern.mjs","lineno":2418,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100036620","name":"exports.brak","type":"VariableDeclaration"}},"description":"<p>Returns a new pattern where every other cycle is played once, twice as\\nfast, and offset in time by one quarter of a cycle. Creates a kind of\\nbreakbeat feel.</p>","tags":["temporal"],"returns":[{"description":"<p>Pattern</p>"}],"name":"brak","longname":"brak","kind":"constant","scope":"global"},{"comment":"/**\\n * Reverse all cycles in a pattern. See also \`revv\` for reversing a whole pattern.\\n *\\n * @tags temporal\\n * @name rev\\n * @memberof Pattern\\n * @returns Pattern\\n * @example\\n * note(\\"c d e g\\").rev()\\n */","meta":{"filename":"pattern.mjs","lineno":2422,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Reverse all cycles in a pattern. See also <code>revv</code> for reversing a whole pattern.</p>","tags":["temporal"],"name":"rev","memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"examples":["note(\\"c d e g\\").rev()"],"scope":"static","longname":"Pattern.rev","kind":"member"},{"comment":"/**\\n * Reverse a whole pattern. See also \`rev\` for reversing each cycle.\\n *\\n * @name revv\\n * @tags temporal\\n * @memberof Pattern\\n * @returns Pattern\\n * @example\\n * // This is the same as \`<[g e] [d c]>\`. If \`rev()\` is used, you get\\n * // the same as \`<[d c] [g e]>\`, where each cycle reverses, but the order of\\n * // cycles stays the same.\\n * note(\\"<[c d] [e g]>\\").revv()\\n */","meta":{"filename":"pattern.mjs","lineno":2456,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Reverse a whole pattern. See also <code>rev</code> for reversing each cycle.</p>","name":"revv","tags":["temporal"],"memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"examples":["// This is the same as \`<[g e] [d c]>\`. If \`rev()\` is used, you get\\n// the same as \`<[d c] [g e]>\`, where each cycle reverses, but the order of\\n// cycles stays the same.\\nnote(\\"<[c d] [e g]>\\").revv()"],"scope":"static","longname":"Pattern.revv","kind":"member"},{"comment":"/** Like press, but allows you to specify the amount by which each\\n * event is shifted. pressBy(0.5) is the same as press, while\\n * pressBy(1/3) shifts each event by a third of its timespan.\\n * @tags temporal\\n * @example\\n * stack(s(\\"hh*4\\"),\\n * s(\\"bd mt sd ht\\").pressBy(\\"<0 0.5 0.25>\\")\\n * ).slow(2)\\n */","meta":{"range":[74435,74565],"filename":"pattern.mjs","lineno":2483,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100036815","name":"exports.pressBy","type":"VariableDeclaration"}},"description":"<p>Like press, but allows you to specify the amount by which each\\nevent is shifted. pressBy(0.5) is the same as press, while\\npressBy(1/3) shifts each event by a third of its timespan.</p>","tags":["temporal"],"examples":["stack(s(\\"hh*4\\"),\\n s(\\"bd mt sd ht\\").pressBy(\\"<0 0.5 0.25>\\")\\n ).slow(2)"],"name":"pressBy","longname":"pressBy","kind":"constant","scope":"global"},{"comment":"/**\\n * Syncopates a rhythm, by shifting each event halfway into its timespan.\\n * @tags temporal\\n * @example\\n * stack(s(\\"hh*4\\"),\\n * s(\\"bd mt sd ht\\").every(4, press)\\n * ).slow(2)\\n */","meta":{"range":[74759,74846],"filename":"pattern.mjs","lineno":2495,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100036844","name":"exports.press","type":"VariableDeclaration"}},"description":"<p>Syncopates a rhythm, by shifting each event halfway into its timespan.</p>","tags":["temporal"],"examples":["stack(s(\\"hh*4\\"),\\n s(\\"bd mt sd ht\\").every(4, press)\\n ).slow(2)"],"name":"press","longname":"press","kind":"constant","scope":"global"},{"comment":"/**\\n * Silences a pattern.\\n * @tags temporal\\n * @example\\n * stack(\\n * s(\\"bd\\").hush(),\\n * s(\\"hh*3\\")\\n * )\\n */","meta":{"range":[74960,75018],"filename":"pattern.mjs","lineno":2508,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100036861","name":"Pattern.prototype.hush","type":"FunctionExpression","paramnames":[]}},"description":"<p>Silences a pattern.</p>","tags":["temporal"],"examples":["stack(\\n s(\\"bd\\").hush(),\\n s(\\"hh*3\\")\\n)"],"name":"hush","longname":"Pattern#hush","kind":"function","memberof":"Pattern","scope":"instance"},{"comment":"/**\\n * Applies \`rev\` to a pattern every other cycle, so that the pattern alternates between forwards and backwards.\\n * @tags temporal\\n * @example\\n * note(\\"c d e g\\").palindrome()\\n */","meta":{"range":[75203,75328],"filename":"pattern.mjs","lineno":2518,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100036871","name":"exports.palindrome","type":"VariableDeclaration"}},"description":"<p>Applies <code>rev</code> to a pattern every other cycle, so that the pattern alternates between forwards and backwards.</p>","tags":["temporal"],"examples":["note(\\"c d e g\\").palindrome()"],"name":"palindrome","longname":"palindrome","kind":"constant","scope":"global"},{"comment":"/**\\n * Jux with adjustable stereo width. 0 = mono, 1 = full stereo.\\n * @tags temporal\\n * @name juxBy\\n * @synonyms juxby\\n * @example\\n * s(\\"bd lt [~ ht] mt cp ~ bd hh\\").juxBy(\\"<0 .5 1>/2\\", rev)\\n */","meta":{"filename":"pattern.mjs","lineno":2527,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Jux with adjustable stereo width. 0 = mono, 1 = full stereo.</p>","tags":["temporal"],"name":"juxBy","synonyms_text":"juxby","synonyms":["juxby"],"examples":["s(\\"bd lt [~ ht] mt cp ~ bd hh\\").juxBy(\\"<0 .5 1>/2\\", rev)"],"longname":"juxBy","kind":"member","scope":"global"},{"comment":"/**\\n * The jux function creates strange stereo effects, by applying a function to a pattern, but only in the right-hand channel.\\n * @tags temporal, superdough\\n * @example\\n * s(\\"bd lt [~ ht] mt cp ~ bd hh\\").jux(rev)\\n * @example\\n * s(\\"bd lt [~ ht] mt cp ~ bd hh\\").jux(press)\\n * @example\\n * s(\\"bd lt [~ ht] mt cp ~ bd hh\\").jux(iter(4))\\n */","meta":{"range":[76395,76491],"filename":"pattern.mjs","lineno":2559,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100037000","name":"exports.jux","type":"VariableDeclaration"}},"description":"<p>The jux function creates strange stereo effects, by applying a function to a pattern, but only in the right-hand channel.</p>","tags":["temporal","superdough"],"examples":["s(\\"bd lt [~ ht] mt cp ~ bd hh\\").jux(rev)","s(\\"bd lt [~ ht] mt cp ~ bd hh\\").jux(press)","s(\\"bd lt [~ ht] mt cp ~ bd hh\\").jux(iter(4))"],"name":"jux","longname":"jux","kind":"constant","scope":"global"},{"comment":"/**\\n * Superimpose and offset multiple times, applying the given function each time.\\n * @tags temporal, functional\\n * @name echoWith\\n * @synonyms echowith, stutWith, stutwith\\n * @param {number} times how many times to repeat\\n * @param {number} time cycle offset between iterations\\n * @param {function} func function to apply, given the pattern and the iteration index\\n * @example\\n * \\"<0 [2 4]>\\"\\n * .echoWith(4, 1/8, (p,n) => p.add(n*2))\\n * .scale(\\"C:minor\\").note()\\n */","meta":{"filename":"pattern.mjs","lineno":2563,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Superimpose and offset multiple times, applying the given function each time.</p>","tags":["temporal","functional"],"name":"echoWith","synonyms_text":"echowith, stutWith, stutwith","synonyms":["echowith","stutWith","stutwith"],"params":[{"type":{"names":["number"]},"description":"<p>how many times to repeat</p>","name":"times"},{"type":{"names":["number"]},"description":"<p>cycle offset between iterations</p>","name":"time"},{"type":{"names":["function"]},"description":"<p>function to apply, given the pattern and the iteration index</p>","name":"func"}],"examples":["\\"<0 [2 4]>\\"\\n.echoWith(4, 1/8, (p,n) => p.add(n*2))\\n.scale(\\"C:minor\\").note()"],"longname":"echoWith","kind":"member","scope":"global"},{"comment":"/**\\n * Superimpose and offset multiple times, gradually decreasing the velocity\\n * @tags temporal\\n * @name echo\\n * @memberof Pattern\\n * @returns Pattern\\n * @param {number} times how many times to repeat\\n * @param {number} time cycle offset between iterations\\n * @param {number} feedback velocity multiplicator for each iteration\\n * @example\\n * s(\\"bd sd\\").echo(3, 1/6, .8)\\n */","meta":{"filename":"pattern.mjs","lineno":2583,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Superimpose and offset multiple times, gradually decreasing the velocity</p>","tags":["temporal"],"name":"echo","memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"params":[{"type":{"names":["number"]},"description":"<p>how many times to repeat</p>","name":"times"},{"type":{"names":["number"]},"description":"<p>cycle offset between iterations</p>","name":"time"},{"type":{"names":["number"]},"description":"<p>velocity multiplicator for each iteration</p>","name":"feedback"}],"examples":["s(\\"bd sd\\").echo(3, 1/6, .8)"],"scope":"static","longname":"Pattern.echo","kind":"member"},{"comment":"/**\\n * Deprecated. Like echo, but the last 2 parameters are flipped.\\n * @tags temporal\\n * @name stut\\n * @param {number} times how many times to repeat\\n * @param {number} feedback velocity multiplicator for each iteration\\n * @param {number} time cycle offset between iterations\\n * @example\\n * s(\\"bd sd\\").stut(3, .8, 1/6)\\n */","meta":{"filename":"pattern.mjs","lineno":2599,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Deprecated. Like echo, but the last 2 parameters are flipped.</p>","tags":["temporal"],"name":"stut","params":[{"type":{"names":["number"]},"description":"<p>how many times to repeat</p>","name":"times"},{"type":{"names":["number"]},"description":"<p>velocity multiplicator for each iteration</p>","name":"feedback"},{"type":{"names":["number"]},"description":"<p>cycle offset between iterations</p>","name":"time"}],"examples":["s(\\"bd sd\\").stut(3, .8, 1/6)"],"longname":"stut","kind":"member","scope":"global"},{"comment":"/**\\n * The plyWith function repeats each event the given number of times, applying the given function to each event.\\\\n\\n * @tags temporal\\n * @name plyWith\\n * @synonyms plywith\\n * @param {number} factor how many times to repeat\\n * @param {function} func function to apply, given the pattern\\n * @example\\n * \\"<0 [2 4]>\\"\\n * .plyWith(4, (p) => p.add(2))\\n * .scale(\\"C:minor\\").note()\\n */","meta":{"filename":"pattern.mjs","lineno":2621,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>The plyWith function repeats each event the given number of times, applying the given function to each event.\\\\n</p>","tags":["temporal"],"name":"plyWith","synonyms_text":"plywith","synonyms":["plywith"],"params":[{"type":{"names":["number"]},"description":"<p>how many times to repeat</p>","name":"factor"},{"type":{"names":["function"]},"description":"<p>function to apply, given the pattern</p>","name":"func"}],"examples":["\\"<0 [2 4]>\\"\\n.plyWith(4, (p) => p.add(2))\\n.scale(\\"C:minor\\").note()"],"longname":"plyWith","kind":"member","scope":"global"},{"comment":"/**\\n * The plyForEach function repeats each event the given number of times, applying the given function to each event.\\n * This version of ply uses the iteration index as an argument to the function, similar to echoWith.\\n * @tags temporal\\n * @name plyForEach\\n * @synonyms plyforeach\\n * @param {number} factor how many times to repeat\\n * @param {function} func function to apply, given the pattern and the iteration index\\n * @example\\n * \\"<0 [2 4]>\\"\\n * .plyForEach(4, (p,n) => p.add(n*2))\\n * .scale(\\"C:minor\\").note()\\n */","meta":{"filename":"pattern.mjs","lineno":2643,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>The plyForEach function repeats each event the given number of times, applying the given function to each event.\\nThis version of ply uses the iteration index as an argument to the function, similar to echoWith.</p>","tags":["temporal"],"name":"plyForEach","synonyms_text":"plyforeach","synonyms":["plyforeach"],"params":[{"type":{"names":["number"]},"description":"<p>how many times to repeat</p>","name":"factor"},{"type":{"names":["function"]},"description":"<p>function to apply, given the pattern and the iteration index</p>","name":"func"}],"examples":["\\"<0 [2 4]>\\"\\n.plyForEach(4, (p,n) => p.add(n*2))\\n.scale(\\"C:minor\\").note()"],"longname":"plyForEach","kind":"member","scope":"global"},{"comment":"/**\\n * Divides a pattern into a given number of subdivisions, plays the subdivisions in order, but increments the starting subdivision each cycle. The pattern wraps to the first subdivision after the last subdivision is played.\\n * @tags temporal\\n * @name iter\\n * @memberof Pattern\\n * @returns Pattern\\n * @example\\n * note(\\"0 1 2 3\\".scale('A minor')).iter(4)\\n */","meta":{"filename":"pattern.mjs","lineno":2666,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Divides a pattern into a given number of subdivisions, plays the subdivisions in order, but increments the starting subdivision each cycle. The pattern wraps to the first subdivision after the last subdivision is played.</p>","tags":["temporal"],"name":"iter","memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"examples":["note(\\"0 1 2 3\\".scale('A minor')).iter(4)"],"scope":"static","longname":"Pattern.iter","kind":"member"},{"comment":"/**\\n * Like \`iter\`, but plays the subdivisions in reverse order. Known as iter' in tidalcycles\\n * @tags temporal\\n * @name iterBack\\n * @synonyms iterback\\n * @memberof Pattern\\n * @returns Pattern\\n * @example\\n * note(\\"0 1 2 3\\".scale('A minor')).iterBack(4)\\n */","meta":{"filename":"pattern.mjs","lineno":2694,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Like <code>iter</code>, but plays the subdivisions in reverse order. Known as iter' in tidalcycles</p>","tags":["temporal"],"name":"iterBack","synonyms_text":"iterback","synonyms":["iterback"],"memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"examples":["note(\\"0 1 2 3\\".scale('A minor')).iterBack(4)"],"scope":"static","longname":"Pattern.iterBack","kind":"member"},{"comment":"/**\\n * Repeats each cycle the given number of times.\\n * @tags temporal\\n * @name repeatCycles\\n * @memberof Pattern\\n * @returns Pattern\\n * @example\\n * note(irand(12).add(34)).segment(4).repeatCycles(2).s(\\"gm_acoustic_guitar_nylon\\")\\n */","meta":{"filename":"pattern.mjs","lineno":2713,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Repeats each cycle the given number of times.</p>","tags":["temporal"],"name":"repeatCycles","memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"examples":["note(irand(12).add(34)).segment(4).repeatCycles(2).s(\\"gm_acoustic_guitar_nylon\\")"],"scope":"static","longname":"Pattern.repeatCycles","kind":"member"},{"comment":"/**\\n * Divides a pattern into a given number of parts, then cycles through those parts in turn, applying the given function to each part in turn (one part per cycle).\\n * @tags temporal, functional\\n * @name chunk\\n * @synonyms slowChunk, slowchunk\\n * @memberof Pattern\\n * @returns Pattern\\n * @example\\n * \\"0 1 2 3\\".chunk(4, x=>x.add(7))\\n * .scale(\\"A:minor\\").note()\\n */","meta":{"filename":"pattern.mjs","lineno":2737,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Divides a pattern into a given number of parts, then cycles through those parts in turn, applying the given function to each part in turn (one part per cycle).</p>","tags":["temporal","functional"],"name":"chunk","synonyms_text":"slowChunk, slowchunk","synonyms":["slowChunk","slowchunk"],"memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"examples":["\\"0 1 2 3\\".chunk(4, x=>x.add(7))\\n.scale(\\"A:minor\\").note()"],"scope":"static","longname":"Pattern.chunk","kind":"member"},{"comment":"/**\\n * Like \`chunk\`, but cycles through the parts in reverse order. Known as chunk' in tidalcycles\\n * @tags temporal\\n * @name chunkBack\\n * @synonyms chunkback\\n * @memberof Pattern\\n * @returns Pattern\\n * @example\\n * \\"0 1 2 3\\".chunkBack(4, x=>x.add(7))\\n * .scale(\\"A:minor\\").note()\\n */","meta":{"filename":"pattern.mjs","lineno":2769,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Like <code>chunk</code>, but cycles through the parts in reverse order. Known as chunk' in tidalcycles</p>","tags":["temporal"],"name":"chunkBack","synonyms_text":"chunkback","synonyms":["chunkback"],"memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"examples":["\\"0 1 2 3\\".chunkBack(4, x=>x.add(7))\\n.scale(\\"A:minor\\").note()"],"scope":"static","longname":"Pattern.chunkBack","kind":"member"},{"comment":"/**\\n * Like \`chunk\`, but the cycles of the source pattern aren't repeated\\n * for each set of chunks.\\n * @tags temporal\\n * @name fastChunk\\n * @synonyms fastchunk\\n * @memberof Pattern\\n * @returns Pattern\\n * @example\\n * \\"<0 8> 1 2 3 4 5 6 7\\"\\n * .scale(\\"C2:major\\").note()\\n * .fastChunk(4, x => x.color('red')).slow(2)\\n */","meta":{"filename":"pattern.mjs","lineno":2789,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Like <code>chunk</code>, but the cycles of the source pattern aren't repeated\\nfor each set of chunks.</p>","tags":["temporal"],"name":"fastChunk","synonyms_text":"fastchunk","synonyms":["fastchunk"],"memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"examples":["\\"<0 8> 1 2 3 4 5 6 7\\"\\n.scale(\\"C2:major\\").note()\\n.fastChunk(4, x => x.color('red')).slow(2)"],"scope":"static","longname":"Pattern.fastChunk","kind":"member"},{"comment":"/**\\n * Like \`chunk\`, but the function is applied to a looped subcycle of the source pattern.\\n * @tags temporal\\n * @name chunkInto\\n * @synonyms chunkinto\\n * @memberof Pattern\\n * @example\\n * sound(\\"bd sd ht lt bd - cp lt\\").chunkInto(4, hurry(2))\\n * .bank(\\"tr909\\")\\n */","meta":{"filename":"pattern.mjs","lineno":2811,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Like <code>chunk</code>, but the function is applied to a looped subcycle of the source pattern.</p>","tags":["temporal"],"name":"chunkInto","synonyms_text":"chunkinto","synonyms":["chunkinto"],"memberof":"Pattern","examples":["sound(\\"bd sd ht lt bd - cp lt\\").chunkInto(4, hurry(2))\\n .bank(\\"tr909\\")"],"scope":"static","longname":"Pattern.chunkInto","kind":"member"},{"comment":"/**\\n * Like \`chunkInto\`, but moves backwards through the chunks.\\n * @tags temporal\\n * @name chunkBackInto\\n * @synonyms chunkbackinto\\n * @memberof Pattern\\n * @example\\n * sound(\\"bd sd ht lt bd - cp lt\\").chunkInto(4, hurry(2))\\n * .bank(\\"tr909\\")\\n */","meta":{"filename":"pattern.mjs","lineno":2825,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Like <code>chunkInto</code>, but moves backwards through the chunks.</p>","tags":["temporal"],"name":"chunkBackInto","synonyms_text":"chunkbackinto","synonyms":["chunkbackinto"],"memberof":"Pattern","examples":["sound(\\"bd sd ht lt bd - cp lt\\").chunkInto(4, hurry(2))\\n .bank(\\"tr909\\")"],"scope":"static","longname":"Pattern.chunkBackInto","kind":"member"},{"comment":"/**\\n * Loops the pattern inside an \`offset\` for \`cycles\`.\\n * If you think of the entire span of time in cycles as a ribbon, you can cut a single piece and loop it.\\n * @tags temporal\\n * @name ribbon\\n * @synonyms rib\\n * @param {number} offset start point of loop in cycles\\n * @param {number} cycles loop length in cycles\\n * @example\\n * note(\\"<c d e f>\\").ribbon(1, 2)\\n * @example\\n * // Looping a portion of randomness\\n * n(irand(8).segment(4)).scale(\\"c:pentatonic\\").ribbon(1337, 2)\\n * @example\\n * // rhythm generator\\n * s(\\"bd!16?\\").ribbon(29,.5)\\n */","meta":{"filename":"pattern.mjs","lineno":2855,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Loops the pattern inside an <code>offset</code> for <code>cycles</code>.\\nIf you think of the entire span of time in cycles as a ribbon, you can cut a single piece and loop it.</p>","tags":["temporal"],"name":"ribbon","synonyms_text":"rib","synonyms":["rib"],"params":[{"type":{"names":["number"]},"description":"<p>start point of loop in cycles</p>","name":"offset"},{"type":{"names":["number"]},"description":"<p>loop length in cycles</p>","name":"cycles"}],"examples":["note(\\"<c d e f>\\").ribbon(1, 2)","// Looping a portion of randomness\\nn(irand(8).segment(4)).scale(\\"c:pentatonic\\").ribbon(1337, 2)","// rhythm generator\\ns(\\"bd!16?\\").ribbon(29,.5)"],"longname":"ribbon","kind":"member","scope":"global"},{"comment":"/**\\n * Tags each Hap with an identifier. Good for filtering. The function populates Hap.context.tags (Array).\\n * @name tag\\n * @tags temporal\\n * @param {string} tag anything unique\\n * @example\\n * s(\\"saw!16\\").note(\\"F1\\")\\n * .lpf(tri.range(40, 80).slow(4)).lpenv(5).lpq(4).lpd(0.15)\\n * .when(rand.late(0.1).gte(0.5), x => x.transpose(\\"12\\").tag('altered'))\\n * .when(rand.late(0.2).gte(0.5), x => x.s(\\"square\\").tag('altered'))\\n * .when(\\"<0 1>\\", x => x.filter((hap) => hap.hasTag('altered')))\\n */","meta":{"filename":"pattern.mjs","lineno":2884,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Tags each Hap with an identifier. Good for filtering. The function populates Hap.context.tags (Array).</p>","name":"tag","tags":["temporal"],"params":[{"type":{"names":["string"]},"description":"<p>anything unique</p>","name":"tag"}],"examples":["s(\\"saw!16\\").note(\\"F1\\")\\n .lpf(tri.range(40, 80).slow(4)).lpenv(5).lpq(4).lpd(0.15)\\n .when(rand.late(0.1).gte(0.5), x => x.transpose(\\"12\\").tag('altered'))\\n .when(rand.late(0.2).gte(0.5), x => x.s(\\"square\\").tag('altered'))\\n .when(\\"<0 1>\\", x => x.filter((hap) => hap.hasTag('altered')))"],"longname":"tag","kind":"member","scope":"global"},{"comment":"/**\\n * Filters haps using the given function\\n * @name filter\\n * @tags temporal, functional\\n * @param {Function} test function to test Hap\\n * @example\\n * s(\\"hh!7 oh\\").filter(hap => hap.value.s === 'hh')\\n */","meta":{"filename":"pattern.mjs","lineno":2900,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Filters haps using the given function</p>","name":"filter","tags":["temporal","functional"],"params":[{"type":{"names":["function"]},"description":"<p>function to test Hap</p>","name":"test"}],"examples":["s(\\"hh!7 oh\\").filter(hap => hap.value.s === 'hh')"],"longname":"filter","kind":"member","scope":"global"},{"comment":"/**\\n * Filters haps by their begin time\\n * @name filterWhen\\n * @tags temporal, functional\\n * @param {Function} test function to test Hap.whole.begin\\n * @example\\n * oneCycle: s(\\"bd*4\\").filterWhen((t) => t < 1)\\n */","meta":{"filename":"pattern.mjs","lineno":2910,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Filters haps by their begin time</p>","name":"filterWhen","tags":["temporal","functional"],"params":[{"type":{"names":["function"]},"description":"<p>function to test Hap.whole.begin</p>","name":"test"}],"examples":["oneCycle: s(\\"bd*4\\").filterWhen((t) => t < 1)"],"longname":"filterWhen","kind":"member","scope":"global"},{"comment":"/**\\n * Use within to apply a function to only a part of a pattern.\\n * @name within\\n * @tags temporal, functional\\n * @param {number} start start within cycle (0 - 1)\\n * @param {number} end end within cycle (0 - 1). Must be > start\\n * @param {Function} func function to be applied to the sub-pattern\\n */","meta":{"filename":"pattern.mjs","lineno":2920,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Use within to apply a function to only a part of a pattern.</p>","name":"within","tags":["temporal","functional"],"params":[{"type":{"names":["number"]},"description":"<p>start within cycle (0 - 1)</p>","name":"start"},{"type":{"names":["number"]},"description":"<p>end within cycle (0 - 1). Must be > start</p>","name":"end"},{"type":{"names":["function"]},"description":"<p>function to be applied to the sub-pattern</p>","name":"func"}],"longname":"within","kind":"member","scope":"global"},{"comment":"/**\\n * *Experimental*\\n *\\n * Speeds a pattern up or down, to fit to the given number of steps per cycle.\\n * @tags stepwise\\n * @example\\n * sound(\\"bd sd cp\\").pace(4)\\n * // The same as sound(\\"{bd sd cp}%4\\") or sound(\\"<bd sd cp>*4\\")\\n */","meta":{"range":[89957,90252],"filename":"pattern.mjs","lineno":3003,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100038380","name":"exports.pace","type":"VariableDeclaration"}},"description":"<p><em>Experimental</em></p>\\n<p>Speeds a pattern up or down, to fit to the given number of steps per cycle.</p>","tags":["stepwise"],"examples":["sound(\\"bd sd cp\\").pace(4)\\n// The same as sound(\\"{bd sd cp}%4\\") or sound(\\"<bd sd cp>*4\\")"],"name":"pace","longname":"pace","kind":"constant","scope":"global"},{"comment":"/**\\n * *Experimental*\\n *\\n * Aligns the steps of the patterns, creating polymeters. The patterns are repeated until they all fit the cycle. For example, in the below the first pattern is repeated twice, and the second is repeated three times, to fit the lowest common multiple of six steps.\\n * @tags stepwise\\n * @synonyms pm\\n * @example\\n * // The same as note(\\"{c eb g, c2 g2}%6\\")\\n * polymeter(\\"c eb g\\", \\"c2 g2\\").note()\\n *\\n */","meta":{"range":[91148,91656],"filename":"pattern.mjs","lineno":3047,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100038533","name":"exports.polymeter","type":"FunctionDeclaration","paramnames":["args"]}},"description":"<p><em>Experimental</em></p>\\n<p>Aligns the steps of the patterns, creating polymeters. The patterns are repeated until they all fit the cycle. For example, in the below the first pattern is repeated twice, and the second is repeated three times, to fit the lowest common multiple of six steps.</p>","tags":["stepwise"],"synonyms_text":"pm","synonyms":["pm"],"examples":["// The same as note(\\"{c eb g, c2 g2}%6\\")\\npolymeter(\\"c eb g\\", \\"c2 g2\\").note()"],"name":"polymeter","longname":"polymeter","kind":"function","scope":"global"},{"comment":"/** 'Concatenates' patterns like \`fastcat\`, but proportional to a number of steps per cycle.\\n * The steps can either be inferred from the pattern, or provided as a [length, pattern] pair.\\n * Has the alias \`timecat\`.\\n * @name stepcat\\n * @tags stepwise\\n * @synonyms timeCat, timecat\\n * @return {Pattern}\\n * @example\\n * stepcat([3,\\"e3\\"],[1, \\"g3\\"]).note()\\n * // the same as \\"e3@3 g3\\".note()\\n * @example\\n * stepcat(\\"bd sd cp\\",\\"hh hh\\").sound()\\n * // the same as \\"bd sd cp hh hh\\".sound()\\n */","meta":{"filename":"pattern.mjs","lineno":3069,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>'Concatenates' patterns like <code>fastcat</code>, but proportional to a number of steps per cycle.\\nThe steps can either be inferred from the pattern, or provided as a [length, pattern] pair.\\nHas the alias <code>timecat</code>.</p>","name":"stepcat","tags":["stepwise"],"synonyms_text":"timeCat, timecat","synonyms":["timeCat","timecat"],"returns":[{"type":{"names":["Pattern"]}}],"examples":["stepcat([3,\\"e3\\"],[1, \\"g3\\"]).note()\\n// the same as \\"e3@3 g3\\".note()","stepcat(\\"bd sd cp\\",\\"hh hh\\").sound()\\n// the same as \\"bd sd cp hh hh\\".sound()"],"longname":"stepcat","kind":"member","scope":"global"},{"comment":"/**\\n * *Experimental*\\n *\\n * Concatenates patterns stepwise, according to an inferred 'steps per cycle'.\\n * Similar to \`stepcat\`, but if an argument is a list, the whole pattern will alternate between the elements in the list.\\n *\\n * @tags stepwise\\n * @return {Pattern}\\n * @example\\n * stepalt([\\"bd cp\\", \\"mt\\"], \\"bd\\").sound()\\n * // The same as \\"bd cp bd mt bd\\".sound()\\n */","meta":{"range":[93756,94303],"filename":"pattern.mjs","lineno":3137,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100038904","name":"exports.stepalt","type":"FunctionDeclaration","paramnames":["groups"]}},"description":"<p><em>Experimental</em></p>\\n<p>Concatenates patterns stepwise, according to an inferred 'steps per cycle'.\\nSimilar to <code>stepcat</code>, but if an argument is a list, the whole pattern will alternate between the elements in the list.</p>","tags":["stepwise"],"returns":[{"type":{"names":["Pattern"]}}],"examples":["stepalt([\\"bd cp\\", \\"mt\\"], \\"bd\\").sound()\\n// The same as \\"bd cp bd mt bd\\".sound()"],"name":"stepalt","longname":"stepalt","kind":"function","scope":"global"},{"comment":"/**\\n * *Experimental*\\n *\\n * Takes the given number of steps from a pattern (dropping the rest).\\n * A positive number will take steps from the start of a pattern, and a negative number from the end.\\n * @tags stepwise\\n * @return {Pattern}\\n * @example\\n * \\"bd cp ht mt\\".take(\\"2\\").sound()\\n * // The same as \\"bd cp\\".sound()\\n * @example\\n * \\"bd cp ht mt\\".take(\\"1 2 3\\").sound()\\n * // The same as \\"bd bd cp bd cp ht\\".sound()\\n * @example\\n * \\"bd cp ht mt\\".take(\\"-1 -2 -3\\").sound()\\n * // The same as \\"mt ht mt cp ht mt\\".sound()\\n */","meta":{"range":[94824,95316],"filename":"pattern.mjs","lineno":3170,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100039045","name":"exports.take","type":"VariableDeclaration"}},"description":"<p><em>Experimental</em></p>\\n<p>Takes the given number of steps from a pattern (dropping the rest).\\nA positive number will take steps from the start of a pattern, and a negative number from the end.</p>","tags":["stepwise"],"returns":[{"type":{"names":["Pattern"]}}],"examples":["\\"bd cp ht mt\\".take(\\"2\\").sound()\\n// The same as \\"bd cp\\".sound()","\\"bd cp ht mt\\".take(\\"1 2 3\\").sound()\\n// The same as \\"bd bd cp bd cp ht\\".sound()","\\"bd cp ht mt\\".take(\\"-1 -2 -3\\").sound()\\n// The same as \\"mt ht mt cp ht mt\\".sound()"],"name":"take","longname":"take","kind":"constant","scope":"global"},{"comment":"/**\\n * *Experimental*\\n *\\n * Drops the given number of steps from a pattern.\\n * A positive number will drop steps from the start of a pattern, and a negative number from the end.\\n * @tags stepwise\\n * @return {Pattern}\\n * @example\\n * \\"tha dhi thom nam\\".drop(\\"1\\").sound().bank(\\"mridangam\\")\\n * @example\\n * \\"tha dhi thom nam\\".drop(\\"-1\\").sound().bank(\\"mridangam\\")\\n * @example\\n * \\"tha dhi thom nam\\".drop(\\"0 1 2 3\\").sound().bank(\\"mridangam\\")\\n * @example\\n * \\"tha dhi thom nam\\".drop(\\"0 -1 -2 -3\\").sound().bank(\\"mridangam\\")\\n */","meta":{"range":[95835,96082],"filename":"pattern.mjs","lineno":3214,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100039157","name":"exports.drop","type":"VariableDeclaration"}},"description":"<p><em>Experimental</em></p>\\n<p>Drops the given number of steps from a pattern.\\nA positive number will drop steps from the start of a pattern, and a negative number from the end.</p>","tags":["stepwise"],"returns":[{"type":{"names":["Pattern"]}}],"examples":["\\"tha dhi thom nam\\".drop(\\"1\\").sound().bank(\\"mridangam\\")","\\"tha dhi thom nam\\".drop(\\"-1\\").sound().bank(\\"mridangam\\")","\\"tha dhi thom nam\\".drop(\\"0 1 2 3\\").sound().bank(\\"mridangam\\")","\\"tha dhi thom nam\\".drop(\\"0 -1 -2 -3\\").sound().bank(\\"mridangam\\")"],"name":"drop","longname":"drop","kind":"constant","scope":"global"},{"comment":"/**\\n * *Experimental*\\n *\\n * \`extend\` is similar to \`fast\` in that it increases its density, but it also increases the step count\\n * accordingly. So \`stepcat(\\"a b\\".extend(2), \\"c d\\")\` would be the same as \`\\"a b a b c d\\"\`, whereas\\n * \`stepcat(\\"a b\\".fast(2), \\"c d\\")\` would be the same as \`\\"[a b] [a b] c d\\"\`.\\n * @tags stepwise\\n * @example\\n * stepcat(\\n * sound(\\"bd bd - cp\\").extend(2),\\n * sound(\\"bd - sd -\\")\\n * ).pace(8)\\n */","meta":{"range":[96508,96623],"filename":"pattern.mjs","lineno":3239,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100039219","name":"exports.extend","type":"VariableDeclaration"}},"description":"<p><em>Experimental</em></p>\\n<p><code>extend</code> is similar to <code>fast</code> in that it increases its density, but it also increases the step count\\naccordingly. So <code>stepcat("a b".extend(2), "c d")</code> would be the same as <code>"a b a b c d"</code>, whereas\\n<code>stepcat("a b".fast(2), "c d")</code> would be the same as <code>"[a b] [a b] c d"</code>.</p>","tags":["stepwise"],"examples":["stepcat(\\n sound(\\"bd bd - cp\\").extend(2),\\n sound(\\"bd - sd -\\")\\n).pace(8)"],"name":"extend","longname":"extend","kind":"constant","scope":"global"},{"comment":"/**\\n * *Experimental*\\n *\\n * \`replicate\` is similar to \`fast\` in that it increases its density, but it also increases the step count\\n * accordingly. So \`stepcat(\\"a b\\".replicate(2), \\"c d\\")\` would be the same as \`\\"a b a b c d\\"\`, whereas\\n * \`stepcat(\\"a b\\".fast(2), \\"c d\\")\` would be the same as \`\\"[a b] [a b] c d\\"\`.\\n *\\n * TODO: find out how this function differs from extend\\n * @tags stepwise\\n * @example\\n * stepcat(\\n * sound(\\"bd bd - cp\\").replicate(2),\\n * sound(\\"bd - sd -\\")\\n * ).pace(8)\\n */","meta":{"range":[97117,97259],"filename":"pattern.mjs","lineno":3258,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100039240","name":"exports.replicate","type":"VariableDeclaration"}},"description":"<p><em>Experimental</em></p>\\n<p><code>replicate</code> is similar to <code>fast</code> in that it increases its density, but it also increases the step count\\naccordingly. So <code>stepcat("a b".replicate(2), "c d")</code> would be the same as <code>"a b a b c d"</code>, whereas\\n<code>stepcat("a b".fast(2), "c d")</code> would be the same as <code>"[a b] [a b] c d"</code>.</p>\\n<p>TODO: find out how this function differs from extend</p>","tags":["stepwise"],"examples":["stepcat(\\n sound(\\"bd bd - cp\\").replicate(2),\\n sound(\\"bd - sd -\\")\\n).pace(8)"],"name":"replicate","longname":"replicate","kind":"constant","scope":"global"},{"comment":"/**\\n * *Experimental*\\n *\\n * Expands the step size of the pattern by the given factor.\\n * @tags stepwise\\n * @example\\n * sound(\\"tha dhi thom nam\\").bank(\\"mridangam\\").expand(\\"3 2 1 1 2 3\\").pace(8)\\n */","meta":{"range":[97458,97587],"filename":"pattern.mjs","lineno":3270,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100039265","name":"exports.expand","type":"VariableDeclaration"}},"description":"<p><em>Experimental</em></p>\\n<p>Expands the step size of the pattern by the given factor.</p>","tags":["stepwise"],"examples":["sound(\\"tha dhi thom nam\\").bank(\\"mridangam\\").expand(\\"3 2 1 1 2 3\\").pace(8)"],"name":"expand","longname":"expand","kind":"constant","scope":"global"},{"comment":"/**\\n * *Experimental*\\n *\\n * Contracts the step size of the pattern by the given factor. See also \`expand\`.\\n * @tags stepwise\\n * @example\\n * sound(\\"tha dhi thom nam\\").bank(\\"mridangam\\").contract(\\"3 2 1 1 2 3\\").pace(8)\\n */","meta":{"range":[97809,97942],"filename":"pattern.mjs","lineno":3282,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100039290","name":"exports.contract","type":"VariableDeclaration"}},"description":"<p><em>Experimental</em></p>\\n<p>Contracts the step size of the pattern by the given factor. See also <code>expand</code>.</p>","tags":["stepwise"],"examples":["sound(\\"tha dhi thom nam\\").bank(\\"mridangam\\").contract(\\"3 2 1 1 2 3\\").pace(8)"],"name":"contract","longname":"contract","kind":"constant","scope":"global"},{"comment":"/**\\n * *Experimental*\\n *\\n * Progressively shrinks the pattern by 'n' steps until there's nothing left, or if a second value is given (using mininotation list syntax with \`:\`),\\n * that number of times.\\n * A positive number will progressively drop steps from the start of a pattern, and a negative number from the end.\\n * @tags stepwise\\n * @return {Pattern}\\n * @example\\n * \\"tha dhi thom nam\\".shrink(\\"1\\").sound()\\n * .bank(\\"mridangam\\")\\n * @example\\n * \\"tha dhi thom nam\\".shrink(\\"-1\\").sound()\\n * .bank(\\"mridangam\\")\\n * @example\\n * \\"tha dhi thom nam\\".shrink(\\"1 -1\\").sound().bank(\\"mridangam\\").pace(4)\\n * @example\\n * note(\\"0 1 2 3 4 5 6 7\\".scale(\\"C:ritusen\\")).sound(\\"folkharp\\")\\n .shrink(\\"1 -1\\").pace(8)\\n\\n */","meta":{"range":[99609,99991],"filename":"pattern.mjs","lineno":3349,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100039530","name":"exports.shrink","type":"VariableDeclaration"}},"description":"<p><em>Experimental</em></p>\\n<p>Progressively shrinks the pattern by 'n' steps until there's nothing left, or if a second value is given (using mininotation list syntax with <code>:</code>),\\nthat number of times.\\nA positive number will progressively drop steps from the start of a pattern, and a negative number from the end.</p>","tags":["stepwise"],"returns":[{"type":{"names":["Pattern"]}}],"examples":["\\"tha dhi thom nam\\".shrink(\\"1\\").sound()\\n.bank(\\"mridangam\\")","\\"tha dhi thom nam\\".shrink(\\"-1\\").sound()\\n.bank(\\"mridangam\\")","\\"tha dhi thom nam\\".shrink(\\"1 -1\\").sound().bank(\\"mridangam\\").pace(4)","note(\\"0 1 2 3 4 5 6 7\\".scale(\\"C:ritusen\\")).sound(\\"folkharp\\")\\n .shrink(\\"1 -1\\").pace(8)"],"name":"shrink","longname":"shrink","kind":"constant","scope":"global"},{"comment":"/**\\n * *Experimental*\\n *\\n * Progressively grows the pattern by 'n' steps until the full pattern is played, or if a second value is given (using mininotation list syntax with \`:\`),\\n * that number of times.\\n * A positive number will progressively grow steps from the start of a pattern, and a negative number from the end.\\n * @tags stepwise\\n * @return {Pattern}\\n * @example\\n * \\"tha dhi thom nam\\".grow(\\"1\\").sound()\\n * .bank(\\"mridangam\\")\\n * @example\\n * \\"tha dhi thom nam\\".grow(\\"-1\\").sound()\\n * .bank(\\"mridangam\\")\\n * @example\\n * \\"tha dhi thom nam\\".grow(\\"1 -1\\").sound().bank(\\"mridangam\\").pace(4)\\n * @example\\n * note(\\"0 1 2 3 4 5 6 7\\".scale(\\"C:ritusen\\")).sound(\\"folkharp\\")\\n .grow(\\"1 -1\\").pace(8)\\n */","meta":{"range":[100689,101104],"filename":"pattern.mjs","lineno":3388,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100039596","name":"exports.grow","type":"VariableDeclaration"}},"description":"<p><em>Experimental</em></p>\\n<p>Progressively grows the pattern by 'n' steps until the full pattern is played, or if a second value is given (using mininotation list syntax with <code>:</code>),\\nthat number of times.\\nA positive number will progressively grow steps from the start of a pattern, and a negative number from the end.</p>","tags":["stepwise"],"returns":[{"type":{"names":["Pattern"]}}],"examples":["\\"tha dhi thom nam\\".grow(\\"1\\").sound()\\n.bank(\\"mridangam\\")","\\"tha dhi thom nam\\".grow(\\"-1\\").sound()\\n.bank(\\"mridangam\\")","\\"tha dhi thom nam\\".grow(\\"1 -1\\").sound().bank(\\"mridangam\\").pace(4)","note(\\"0 1 2 3 4 5 6 7\\".scale(\\"C:ritusen\\")).sound(\\"folkharp\\")\\n .grow(\\"1 -1\\").pace(8)"],"name":"grow","longname":"grow","kind":"constant","scope":"global"},{"comment":"/**\\n * *Experimental*\\n * \\n * Inserts a pattern into a list of patterns. On the first repetition it will be inserted at the end of the list, then moved backwards through the list \\n * on successive repetitions. The patterns are added together stepwise, with all repetitions taking place over a single cycle. Using \`pace\` to set the \\n * number of steps per cycle is therefore usually recommended.\\n *\\n * @tags stepwise\\n * @return {Pattern}\\n * @example\\n * \\"[c g]\\".tour(\\"e f\\", \\"e f g\\", \\"g f e c\\").note()\\n .sound(\\"folkharp\\")\\n .pace(8)\\n */","meta":{"range":[101642,101718],"filename":"pattern.mjs","lineno":3421,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100039673","name":"exports.tour","type":"VariableDeclaration"}},"description":"<p><em>Experimental</em></p>\\n<p>Inserts a pattern into a list of patterns. On the first repetition it will be inserted at the end of the list, then moved backwards through the list\\non successive repetitions. The patterns are added together stepwise, with all repetitions taking place over a single cycle. Using <code>pace</code> to set the\\nnumber of steps per cycle is therefore usually recommended.</p>","tags":["stepwise"],"returns":[{"type":{"names":["Pattern"]}}],"examples":["\\"[c g]\\".tour(\\"e f\\", \\"e f g\\", \\"g f e c\\").note()\\n .sound(\\"folkharp\\")\\n .pace(8)"],"name":"tour","longname":"tour","kind":"constant","scope":"global"},{"comment":"/**\\n * *Experimental*\\n * \\n * 'zips' together the steps of the provided patterns. This can create a long repetition, taking place over a single, dense cycle. \\n * Using \`pace\` to set the number of steps per cycle is therefore usually recommended.\\n * \\n * @tags stepwise\\n * @returns {Pattern}\\n * @example\\n * zip(\\"e f\\", \\"e f g\\", \\"g [f e] a f4 c\\").note()\\n .sound(\\"folkharp\\")\\n .pace(8)\\n */","meta":{"range":[102336,102591],"filename":"pattern.mjs","lineno":3448,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100039742","name":"exports.zip","type":"VariableDeclaration"}},"description":"<p><em>Experimental</em></p>\\n<p>'zips' together the steps of the provided patterns. This can create a long repetition, taking place over a single, dense cycle.\\nUsing <code>pace</code> to set the number of steps per cycle is therefore usually recommended.</p>","tags":["stepwise"],"returns":[{"type":{"names":["Pattern"]}}],"examples":["zip(\\"e f\\", \\"e f g\\", \\"g [f e] a f4 c\\").note()\\n .sound(\\"folkharp\\")\\n .pace(8)"],"name":"zip","longname":"zip","kind":"constant","scope":"global"},{"comment":"/** Aliases for \`stepcat\` */","meta":{"range":[102622,102653],"filename":"pattern.mjs","lineno":3456,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100039806","name":"exports.timecat","type":"VariableDeclaration"}},"description":"<p>Aliases for <code>stepcat</code></p>","name":"timecat","longname":"timecat","kind":"constant","scope":"global"},{"comment":"/**\\n * Cuts each sample into the given number of parts, allowing you to explore a technique known as 'granular synthesis'.\\n * It turns a pattern of samples into a pattern of parts of samples.\\n * @name chop\\n * @tags samples\\n * @memberof Pattern\\n * @returns Pattern\\n * @example\\n * samples({ rhodes: 'https://cdn.freesound.org/previews/132/132051_316502-lq.mp3' })\\n * s(\\"rhodes\\")\\n * .chop(4)\\n * .rev() // reverse order of chops\\n * .loopAt(2) // fit sample into 2 cycles\\n *\\n */","meta":{"filename":"pattern.mjs","lineno":3489,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Cuts each sample into the given number of parts, allowing you to explore a technique known as 'granular synthesis'.\\nIt turns a pattern of samples into a pattern of parts of samples.</p>","name":"chop","tags":["samples"],"memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"examples":["samples({ rhodes: 'https://cdn.freesound.org/previews/132/132051_316502-lq.mp3' })\\ns(\\"rhodes\\")\\n .chop(4)\\n .rev() // reverse order of chops\\n .loopAt(2) // fit sample into 2 cycles"],"scope":"static","longname":"Pattern.chop","kind":"member"},{"comment":"/**\\n * Cuts each sample into the given number of parts, triggering progressive portions of each sample at each loop.\\n * @name striate\\n * @tags samples\\n * @memberof Pattern\\n * @returns Pattern\\n * @example\\n * s(\\"numbers:0 numbers:1 numbers:2\\").striate(6).slow(3)\\n */","meta":{"filename":"pattern.mjs","lineno":3521,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Cuts each sample into the given number of parts, triggering progressive portions of each sample at each loop.</p>","name":"striate","tags":["samples"],"memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"examples":["s(\\"numbers:0 numbers:1 numbers:2\\").striate(6).slow(3)"],"scope":"static","longname":"Pattern.striate","kind":"member"},{"comment":"/**\\n * Makes the sample fit the given number of cycles by changing the speed.\\n * @name loopAt\\n * @tags samples, pitch\\n * @memberof Pattern\\n * @returns Pattern\\n * @example\\n * samples({ rhodes: 'https://cdn.freesound.org/previews/132/132051_316502-lq.mp3' })\\n * s(\\"rhodes\\").loopAt(2)\\n */","meta":{"filename":"pattern.mjs","lineno":3540,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Makes the sample fit the given number of cycles by changing the speed.</p>","name":"loopAt","tags":["samples","pitch"],"memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"examples":["samples({ rhodes: 'https://cdn.freesound.org/previews/132/132051_316502-lq.mp3' })\\ns(\\"rhodes\\").loopAt(2)"],"scope":"static","longname":"Pattern.loopAt","kind":"member"},{"comment":"/**\\n * Chops samples into the given number of slices, triggering those slices with a given pattern of slice numbers.\\n * Instead of a number, it also accepts a list of numbers from 0 to 1 to slice at specific points.\\n * @name slice\\n * @tags samples\\n * @memberof Pattern\\n * @returns Pattern\\n * @example\\n * samples('github:tidalcycles/dirt-samples')\\n * s(\\"breaks165\\").slice(8, \\"0 1 <2 2*2> 3 [4 0] 5 6 7\\".every(3, rev)).slow(0.75)\\n * @example\\n * samples('github:tidalcycles/dirt-samples')\\n * s(\\"breaks125\\").fit().slice([0,.25,.5,.75], \\"0 1 1 <2 3>\\")\\n */","meta":{"filename":"pattern.mjs","lineno":3562,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Chops samples into the given number of slices, triggering those slices with a given pattern of slice numbers.\\nInstead of a number, it also accepts a list of numbers from 0 to 1 to slice at specific points.</p>","name":"slice","tags":["samples"],"memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"examples":["samples('github:tidalcycles/dirt-samples')\\ns(\\"breaks165\\").slice(8, \\"0 1 <2 2*2> 3 [4 0] 5 6 7\\".every(3, rev)).slow(0.75)","samples('github:tidalcycles/dirt-samples')\\ns(\\"breaks125\\").fit().slice([0,.25,.5,.75], \\"0 1 1 <2 3>\\")"],"scope":"static","longname":"Pattern.slice","kind":"member"},{"comment":"/**\\n *\\n * make something happen on event time\\n * uses browser timeout which is innacurate for audio tasks\\n * @name onTriggerTime\\n * @tags external_io\\n * @memberof Pattern\\n * @returns Pattern\\n * @example\\n * s(\\"bd!8\\").onTriggerTime((hap) => {console.log(hap)})\\n */","meta":{"filename":"pattern.mjs","lineno":3597,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>make something happen on event time\\nuses browser timeout which is innacurate for audio tasks</p>","name":"onTriggerTime","tags":["external_io"],"memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"examples":["s(\\"bd!8\\").onTriggerTime((hap) => {console.log(hap)})"],"scope":"static","longname":"Pattern.onTriggerTime","kind":"member"},{"comment":"/**\\n * Works the same as slice, but changes the playback speed of each slice to match the duration of its step.\\n * @name splice\\n * @tags samples, pitch\\n * @example\\n * samples('github:tidalcycles/dirt-samples')\\n * s(\\"breaks165\\")\\n * .splice(8, \\"0 1 [2 3 0]@2 3 0@2 7\\")\\n */","meta":{"filename":"pattern.mjs","lineno":3617,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Works the same as slice, but changes the playback speed of each slice to match the duration of its step.</p>","name":"splice","tags":["samples","pitch"],"examples":["samples('github:tidalcycles/dirt-samples')\\ns(\\"breaks165\\")\\n.splice(8, \\"0 1 [2 3 0]@2 3 0@2 7\\")"],"longname":"splice","kind":"member","scope":"global"},{"comment":"/**\\n * Makes the sample fit its event duration. Good for rhythmical loops like drum breaks.\\n * Similar to \`loopAt\`.\\n * @name fit\\n * @tags samples, pitch\\n * @example\\n * samples({ rhodes: 'https://cdn.freesound.org/previews/132/132051_316502-lq.mp3' })\\n * s(\\"rhodes/2\\").fit()\\n */","meta":{"filename":"pattern.mjs","lineno":3649,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Makes the sample fit its event duration. Good for rhythmical loops like drum breaks.\\nSimilar to <code>loopAt</code>.</p>","name":"fit","tags":["samples","pitch"],"examples":["samples({ rhodes: 'https://cdn.freesound.org/previews/132/132051_316502-lq.mp3' })\\ns(\\"rhodes/2\\").fit()"],"longname":"fit","kind":"member","scope":"global"},{"comment":"/**\\n * Makes the sample fit the given number of cycles and cps value, by\\n * changing the speed. deprecated: use loopAt or fit instead, together with setCps / setCpm.\\n * @name loopAtCps\\n * @tags samples, pitch\\n * @memberof Pattern\\n * @deprecated\\n * @returns Pattern\\n * @example\\n * samples({ rhodes: 'https://cdn.freesound.org/previews/132/132051_316502-lq.mp3' })\\n * s(\\"rhodes\\").loopAtCps(4,1.5).cps(1.5)\\n */","meta":{"filename":"pattern.mjs","lineno":3673,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Makes the sample fit the given number of cycles and cps value, by\\nchanging the speed. deprecated: use loopAt or fit instead, together with setCps / setCpm.</p>","name":"loopAtCps","tags":["samples","pitch"],"memberof":"Pattern","deprecated":true,"returns":[{"description":"<p>Pattern</p>"}],"examples":["samples({ rhodes: 'https://cdn.freesound.org/previews/132/132051_316502-lq.mp3' })\\ns(\\"rhodes\\").loopAtCps(4,1.5).cps(1.5)"],"scope":"static","longname":"Pattern.loopAtCps","kind":"member"},{"comment":"/** exposes a custom value at query time. basically allows mutating state without evaluation\\n * @tags internals\\n */","meta":{"range":[110223,110323],"filename":"pattern.mjs","lineno":3692,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100040646","name":"exports.ref","type":"VariableDeclaration"}},"description":"<p>exposes a custom value at query time. basically allows mutating state without evaluation</p>","tags":["internals"],"name":"ref","longname":"ref","kind":"constant","scope":"global"},{"comment":"/**\\n * Cross-fades between left and right from 0 to 1:\\n * - 0 = (full left, no right)\\n * - .5 = (both equal)\\n * - 1 = (no left, full right)\\n *\\n * @name xfade\\n * @tags amplitude\\n * @example\\n * xfade(s(\\"bd*2\\"), \\"<0 .25 .5 .75 1>\\", s(\\"hh*8\\"))\\n */","meta":{"filename":"pattern.mjs","lineno":3699,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Cross-fades between left and right from 0 to 1:</p>\\n<ul>\\n<li>0 = (full left, no right)</li>\\n<li>.5 = (both equal)</li>\\n<li>1 = (no left, full right)</li>\\n</ul>","name":"xfade","tags":["amplitude"],"examples":["xfade(s(\\"bd*2\\"), \\"<0 .25 .5 .75 1>\\", s(\\"hh*8\\"))"],"longname":"xfade","kind":"member","scope":"global"},{"comment":"/**\\n * creates a structure pattern from divisions of a cycle\\n * especially useful for creating rhythms\\n * @name beat\\n * @tags temporal\\n * @example\\n * s(\\"bd\\").beat(\\"0,7,10\\", 16)\\n * @example\\n * s(\\"sd\\").beat(\\"4,12\\", 16)\\n */","meta":{"filename":"pattern.mjs","lineno":3724,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>creates a structure pattern from divisions of a cycle\\nespecially useful for creating rhythms</p>","name":"beat","tags":["temporal"],"examples":["s(\\"bd\\").beat(\\"0,7,10\\", 16)","s(\\"sd\\").beat(\\"4,12\\", 16)"],"longname":"beat","kind":"member","scope":"global"},{"comment":"/**\\n * Takes two binary rhythms represented as lists of 1s and 0s, and a number\\n * between 0 and 1 that morphs between them. The two lists should contain the same\\n * number of true values.\\n * @example\\n * sound(\\"hh\\").struct(morph([1,0,1,0,1,0,1,0], // straight rhythm\\n * [1,1,0,1,0,1,0], // wonky rhythm\\n * 0.25 // creates a slightly wonky rhythm\\n * )\\n * )\\n * @example\\n * sound(\\"hh\\").struct(morph(\\"1:0:1:0:1:0:1:0\\", // straight rhythm\\n * \\"1:1:0:1:0:1:0\\", // wonky rhythm\\n * sine.slow(8) // slowly morph between the rhythms\\n * )\\n * )\\n * @tags temporal\\n */","meta":{"range":[113352,113590],"filename":"pattern.mjs","lineno":3807,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100041046","name":"exports.morph","type":"VariableDeclaration"}},"description":"<p>Takes two binary rhythms represented as lists of 1s and 0s, and a number\\nbetween 0 and 1 that morphs between them. The two lists should contain the same\\nnumber of true values.</p>","examples":["sound(\\"hh\\").struct(morph([1,0,1,0,1,0,1,0], // straight rhythm\\n [1,1,0,1,0,1,0], // wonky rhythm\\n 0.25 // creates a slightly wonky rhythm\\n )\\n )","sound(\\"hh\\").struct(morph(\\"1:0:1:0:1:0:1:0\\", // straight rhythm\\n \\"1:1:0:1:0:1:0\\", // wonky rhythm\\n sine.slow(8) // slowly morph between the rhythms\\n )\\n )"],"tags":["temporal"],"name":"morph","longname":"morph","kind":"constant","scope":"global"},{"comment":"/**\\n * Soft-clipping distortion\\n *\\n * @name soft\\n * @tags distortion, superdough\\n * @param {number | Pattern} distortion amount of distortion to apply\\n * @param {number | Pattern} volume linear postgain of the distortion\\n *\\n */","meta":{"filename":"pattern.mjs","lineno":3828,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Soft-clipping distortion</p>","name":"soft","tags":["distortion","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>amount of distortion to apply</p>","name":"distortion"},{"type":{"names":["number","Pattern"]},"description":"<p>linear postgain of the distortion</p>","name":"volume"}],"longname":"soft","kind":"member","scope":"global"},{"comment":"/**\\n * Hard-clipping distortion\\n *\\n * @name hard\\n * @tags distortion, superdough\\n * @param {number | Pattern} distortion amount of distortion to apply\\n * @param {number | Pattern} volume linear postgain of the distortion\\n *\\n */","meta":{"filename":"pattern.mjs","lineno":3839,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Hard-clipping distortion</p>","name":"hard","tags":["distortion","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>amount of distortion to apply</p>","name":"distortion"},{"type":{"names":["number","Pattern"]},"description":"<p>linear postgain of the distortion</p>","name":"volume"}],"longname":"hard","kind":"member","scope":"global"},{"comment":"/**\\n * Cubic polynomial distortion\\n *\\n * @name cubic\\n * @tags distortion, superdough\\n * @param {number | Pattern} distortion amount of distortion to apply\\n * @param {number | Pattern} volume linear postgain of the distortion\\n *\\n */","meta":{"filename":"pattern.mjs","lineno":3850,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Cubic polynomial distortion</p>","name":"cubic","tags":["distortion","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>amount of distortion to apply</p>","name":"distortion"},{"type":{"names":["number","Pattern"]},"description":"<p>linear postgain of the distortion</p>","name":"volume"}],"longname":"cubic","kind":"member","scope":"global"},{"comment":"/**\\n * Diode-emulating distortion\\n *\\n * @name diode\\n * @tags distortion, superdough\\n * @param {number | Pattern} distortion amount of distortion to apply\\n * @param {number | Pattern} volume linear postgain of the distortion\\n *\\n */","meta":{"filename":"pattern.mjs","lineno":3861,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Diode-emulating distortion</p>","name":"diode","tags":["distortion","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>amount of distortion to apply</p>","name":"distortion"},{"type":{"names":["number","Pattern"]},"description":"<p>linear postgain of the distortion</p>","name":"volume"}],"longname":"diode","kind":"member","scope":"global"},{"comment":"/**\\n * Asymmetrical diode distortion\\n *\\n * @name asym\\n * @tags distortion, superdough\\n * @param {number | Pattern} distortion amount of distortion to apply\\n * @param {number | Pattern} volume linear postgain of the distortion\\n *\\n */","meta":{"filename":"pattern.mjs","lineno":3872,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Asymmetrical diode distortion</p>","name":"asym","tags":["distortion","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>amount of distortion to apply</p>","name":"distortion"},{"type":{"names":["number","Pattern"]},"description":"<p>linear postgain of the distortion</p>","name":"volume"}],"longname":"asym","kind":"member","scope":"global"},{"comment":"/**\\n * Wavefolding distortion\\n *\\n * @name fold\\n * @tags distortion, superdough\\n * @param {number | Pattern} distortion amount of distortion to apply\\n * @param {number | Pattern} volume linear postgain of the distortion\\n *\\n */","meta":{"filename":"pattern.mjs","lineno":3883,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Wavefolding distortion</p>","name":"fold","tags":["distortion","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>amount of distortion to apply</p>","name":"distortion"},{"type":{"names":["number","Pattern"]},"description":"<p>linear postgain of the distortion</p>","name":"volume"}],"longname":"fold","kind":"member","scope":"global"},{"comment":"/**\\n * Wavefolding distortion composed with sinusoid\\n *\\n * @name sinefold\\n * @tags distortion, superdough\\n * @param {number | Pattern} distortion amount of distortion to apply\\n * @param {number | Pattern} volume linear postgain of the distortion\\n *\\n */","meta":{"filename":"pattern.mjs","lineno":3894,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Wavefolding distortion composed with sinusoid</p>","name":"sinefold","tags":["distortion","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>amount of distortion to apply</p>","name":"distortion"},{"type":{"names":["number","Pattern"]},"description":"<p>linear postgain of the distortion</p>","name":"volume"}],"longname":"sinefold","kind":"member","scope":"global"},{"comment":"/**\\n * Distortion via Chebyshev polynomials\\n *\\n * @name chebyshev\\n * @tags distortion, superdough\\n * @param {number | Pattern} distortion amount of distortion to apply\\n * @param {number | Pattern} volume linear postgain of the distortion\\n *\\n */","meta":{"filename":"pattern.mjs","lineno":3905,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Distortion via Chebyshev polynomials</p>","name":"chebyshev","tags":["distortion","superdough"],"params":[{"type":{"names":["number","Pattern"]},"description":"<p>amount of distortion to apply</p>","name":"distortion"},{"type":{"names":["number","Pattern"]},"description":"<p>linear postgain of the distortion</p>","name":"volume"}],"longname":"chebyshev","kind":"member","scope":"global"},{"comment":"/**\\n * Turns a list of patterns into a single pattern which outputs list-values\\n *\\n * @name parray\\n * @tags combiners\\n * @returns Pattern\\n */","meta":{"filename":"pattern.mjs","lineno":3916,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Turns a list of patterns into a single pattern which outputs list-values</p>","name":"parray","tags":["combiners"],"returns":[{"description":"<p>Pattern</p>"}],"longname":"parray","kind":"member","scope":"global"},{"comment":"/**\\n * Scale the magnitude of the harmonics of one of the core synths ('sine', 'tri', 'saw', ..)\\n *\\n * Can also be used to create a new synth via \`s('user').partials(...)\`\\n *\\n * @name partials\\n * @tags superdough\\n * @param {number[] | Pattern} magnitudes List of [0, 1] magnitudes for partials. 0th entry is the fundamental harmonic (i.e. DC offset is skipped)\\n * @example\\n * s(\\"user\\").seg(16).n(irand(8)).scale(\\"A:major\\")\\n * .partials([1, 0, 1, 0, 0, 1])\\n * @example\\n * s(\\"saw\\").seg(8).n(irand(12)).scale(\\"G#:minor\\")\\n * .partials(binaryL(irand(256).add(\\"1\\")))\\n */","meta":{"filename":"pattern.mjs","lineno":3937,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Scale the magnitude of the harmonics of one of the core synths ('sine', 'tri', 'saw', ..)</p>\\n<p>Can also be used to create a new synth via <code>s('user').partials(...)</code></p>","name":"partials","tags":["superdough"],"params":[{"type":{"names":["Array.<number>","Pattern"]},"description":"<p>List of [0, 1] magnitudes for partials. 0th entry is the fundamental harmonic (i.e. DC offset is skipped)</p>","name":"magnitudes"}],"examples":["s(\\"user\\").seg(16).n(irand(8)).scale(\\"A:major\\")\\n .partials([1, 0, 1, 0, 0, 1])","s(\\"saw\\").seg(8).n(irand(12)).scale(\\"G#:minor\\")\\n .partials(binaryL(irand(256).add(\\"1\\")))"],"longname":"partials","kind":"member","scope":"global"},{"comment":"/**\\n * Rotates the harmonics of one of the core synths ('sine', 'tri', 'saw', 'user', ..) by a list of phases\\n *\\n * @name phases\\n * @tags superdough\\n * @param {number[] | Pattern} phases List of [0, 1) phases for partials. 0th entry is the fundamental phase (i.e. DC offset is skipped)\\n * @example\\n * // Phase cancellation\\n * s(\\"saw\\").seg(8).n(irand(12)).scale(\\"G#1:minor\\")\\n * .partials(partials([1, 1, 1]))\\n * .superimpose(x => x.phases([0.5, 0.5, 0.5]))\\n */","meta":{"filename":"pattern.mjs","lineno":3961,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Rotates the harmonics of one of the core synths ('sine', 'tri', 'saw', 'user', ..) by a list of phases</p>","name":"phases","tags":["superdough"],"params":[{"type":{"names":["Array.<number>","Pattern"]},"description":"<p>List of [0, 1) phases for partials. 0th entry is the fundamental phase (i.e. DC offset is skipped)</p>","name":"phases"}],"examples":["// Phase cancellation\\ns(\\"saw\\").seg(8).n(irand(12)).scale(\\"G#1:minor\\")\\n .partials(partials([1, 1, 1]))\\n .superimpose(x => x.phases([0.5, 0.5, 0.5]))"],"longname":"phases","kind":"member","scope":"global"},{"comment":"/**\\n * Establishes an FX chain. Can be called by chaining .FX(fx1).FX(fx2)..\\n * calls and/or in a single .FX(fx1, fx2, ..) call. The fx1, .. are _patterns_ which\\n * establish the controls of the given effect. See examples.\\n * @name FX\\n * @tags superdough\\n * @memberof Pattern\\n * @returns Pattern\\n * @example\\n * $: s(\\"[sbd <hh [bd | lt | oh]>]*4\\").dec(.4)\\n * .FX(\\n * phaser(0.5).gain(2),\\n * bpf(800),\\n * distort(1.3),\\n * room(0.2),\\n * delay(0.5).gain(1.25),\\n * distort(0.3),\\n * ).fxr(1.7) // sets release time of effects (like delay)\\n * @example\\n * $: s(\\"saw\\").fm(0.5)\\n * .delay(0.3) // outer effects are applied *last*\\n * .FX(coarse(4)) // first coarse\\n * .FX(lpf(500).lpe(4).lpa(1).lpd(2)) // then lpf\\n * .FX(distort(1)) // then distort\\n */","meta":{"filename":"pattern.mjs","lineno":3982,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Establishes an FX chain. Can be called by chaining .FX(fx1).FX(fx2)..\\ncalls and/or in a single .FX(fx1, fx2, ..) call. The fx1, .. are <em>patterns</em> which\\nestablish the controls of the given effect. See examples.</p>","name":"FX","tags":["superdough"],"memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"examples":["$: s(\\"[sbd <hh [bd | lt | oh]>]*4\\").dec(.4)\\n .FX(\\n phaser(0.5).gain(2),\\n bpf(800),\\n distort(1.3),\\n room(0.2),\\n delay(0.5).gain(1.25),\\n distort(0.3),\\n ).fxr(1.7) // sets release time of effects (like delay)","$: s(\\"saw\\").fm(0.5)\\n .delay(0.3) // outer effects are applied *last*\\n .FX(coarse(4)) // first coarse\\n .FX(lpf(500).lpe(4).lpa(1).lpd(2)) // then lpf\\n .FX(distort(1)) // then distort"],"scope":"static","longname":"Pattern.FX","kind":"member"},{"comment":"/**\\n * Produces a [Kabelsalat](https://kabel.salat.dev/) modular sound engine.\\n * This can be used as either an effect (by including \`audioin()\` at the beginning\\n * of your kabel expression) or as a sound source (via any expression which doesn't\\n * start with \`audioin()\`).\\n *\\n * Some helpers you have available to you:\\n * * Strudel mini notation works fine in K(..) via \\"\\" or \`\`\\n * * More complex Strudel expressions (like \\"0 1 2\\".fast(4) or irand(24)) can be\\n * written by wrapping them in \`S(..)\` inside your Kabel code\\n * * We expose Strudel's note frequency under \`sFreq\` and Strudel's gate\\n * information under \`sGate\`\\n * * You can use more complex multi-line expressions (like \`let x = a; let y = b; x.lpf(y);\`)\\n * by wrapping them inside a function in K (see example).\\n *\\n * @name K\\n * @tags generators, superdough\\n * @param {KabelsalatExpression | Function} expr Kabelsalat graph definition\\n * @memberof Pattern\\n * @returns Pattern\\n *\\n * @example\\n * note(\\"A c e\\".fast(4)).transpose(\\"<0 2 4 6 8>\\")\\n * .scale(\\"F:minor\\").transpose(\\"12\\")\\n * .s(\\"saw\\")\\n * .K(\\n * // audioin().mul(sGate.adsr(0.001, 0.3, 0, 0.2)) // as effect\\n * saw(saw(sFreq / \\"2!3 16\\").mul(8).add(sFreq).lag(\\"0!3 0.1\\")).mul(0.3) // as source\\n * .mul(sGate.adsr(0, 0.15, 0.5, \\"0.1!3 1\\"))\\n * .lpf(sGate.adsr(0, 0.2, 0.3, 0.2).mul(1).add(0))\\n * .add(x => x.delay(S(\\"0.3 0.2\\".fast(2))).mul(0.7))\\n * .add(x => x.delay(\\"0.03 [0.08 0.01] 0.01 0.013\\").mul(0.77)).mul(0.7)\\n * .add(x => x.delay(.13).mul(0.7))\\n * .out()\\n * )\\n *\\n * @example\\n * n(\\"<0 1 <2 3 2 4>>*16\\")\\n * .scale(\\"G#2:minor\\").sometimes(x => x.transpose(\\"12 | 24\\"))\\n * .K(() => {\\n * const att = S(rand.range(0, 0.05))\\n * const dec = S(rand.range(0.05, 0.2))\\n * let f = n(sFreq);\\n * const mod = sine(f).mul(\\"0.1 | 0.2 | 0.3\\")\\n * .add(\\"[[1.5 1] | 1 | 2 | 4 | [6 4@3]]*2\\")\\n * saw(f.mul(mod))\\n * .mul(sGate.ad(att, dec))\\n * .add(x => x.delay(0.4).mul(0.3))\\n * .out()\\n * }).fxr(1).room(0.3)\\n */","meta":{"filename":"pattern.mjs","lineno":4022,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Produces a <a href=\\"https://kabel.salat.dev/\\">Kabelsalat</a> modular sound engine.\\nThis can be used as either an effect (by including <code>audioin()</code> at the beginning\\nof your kabel expression) or as a sound source (via any expression which doesn't\\nstart with <code>audioin()</code>).</p>\\n<p>Some helpers you have available to you:</p>\\n<ul>\\n<li>Strudel mini notation works fine in K(..) via "" or \`\`</li>\\n<li>More complex Strudel expressions (like "0 1 2".fast(4) or irand(24)) can be\\nwritten by wrapping them in <code>S(..)</code> inside your Kabel code</li>\\n<li>We expose Strudel's note frequency under <code>sFreq</code> and Strudel's gate\\ninformation under <code>sGate</code></li>\\n<li>You can use more complex multi-line expressions (like <code>let x = a; let y = b; x.lpf(y);</code>)\\nby wrapping them inside a function in K (see example).</li>\\n</ul>","name":"K","tags":["generators","superdough"],"params":[{"type":{"names":["KabelsalatExpression","function"]},"description":"<p>Kabelsalat graph definition</p>","name":"expr"}],"memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"examples":["note(\\"A c e\\".fast(4)).transpose(\\"<0 2 4 6 8>\\")\\n .scale(\\"F:minor\\").transpose(\\"12\\")\\n .s(\\"saw\\")\\n .K(\\n // audioin().mul(sGate.adsr(0.001, 0.3, 0, 0.2)) // as effect\\n saw(saw(sFreq / \\"2!3 16\\").mul(8).add(sFreq).lag(\\"0!3 0.1\\")).mul(0.3) // as source\\n .mul(sGate.adsr(0, 0.15, 0.5, \\"0.1!3 1\\"))\\n .lpf(sGate.adsr(0, 0.2, 0.3, 0.2).mul(1).add(0))\\n .add(x => x.delay(S(\\"0.3 0.2\\".fast(2))).mul(0.7))\\n .add(x => x.delay(\\"0.03 [0.08 0.01] 0.01 0.013\\").mul(0.77)).mul(0.7)\\n .add(x => x.delay(.13).mul(0.7))\\n .out()\\n )","n(\\"<0 1 <2 3 2 4>>*16\\")\\n .scale(\\"G#2:minor\\").sometimes(x => x.transpose(\\"12 | 24\\"))\\n .K(() => {\\n const att = S(rand.range(0, 0.05))\\n const dec = S(rand.range(0.05, 0.2))\\n let f = n(sFreq);\\n const mod = sine(f).mul(\\"0.1 | 0.2 | 0.3\\")\\n .add(\\"[[1.5 1] | 1 | 2 | 4 | [6 4@3]]*2\\")\\n saw(f.mul(mod))\\n .mul(sGate.ad(att, dec))\\n .add(x => x.delay(0.4).mul(0.3))\\n .out()\\n }).fxr(1).room(0.3)"],"scope":"static","longname":"Pattern.K","kind":"member"},{"comment":"/**\\n * Creates a worklet effect. Typically derived by writing K(...) in the REPL which will parse\\n * Kabelsalat code.\\n *\\n * @name worklet\\n * @param {string} src Source code of the worklet update function\\n * @param {...number | ...Pattern} inputs Worklet inputs\\n * @memberof Pattern\\n * @returns Pattern\\n * @noAutocomplete\\n */","meta":{"filename":"pattern.mjs","lineno":4073,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Creates a worklet effect. Typically derived by writing K(...) in the REPL which will parse\\nKabelsalat code.</p>","name":"worklet","params":[{"type":{"names":["string"]},"description":"<p>Source code of the worklet update function</p>","name":"src"},{"type":{"names":["number","Pattern"]},"description":"<p>Worklet inputs</p>","name":"inputs"}],"memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"tags":[{"originalTitle":"noAutocomplete","title":"noautocomplete","text":""}],"scope":"static","longname":"Pattern.worklet","kind":"member"},{"comment":"/** * Picks patterns (or plain values) either from a list (by index) or a lookup table (by name).\\n * Similar to \`inhabit\`, but maintains the structure of the original patterns.\\n * @tags combiners\\n * @param {Pattern} pat\\n * @param {*} xs\\n * @returns {Pattern}\\n * @example\\n * note(\\"<0 1 2!2 3>\\".pick([\\"g a\\", \\"e f\\", \\"f g f g\\" , \\"g c d\\"]))\\n * @example\\n * sound(\\"<0 1 [2,0]>\\".pick([\\"bd sd\\", \\"cp cp\\", \\"hh hh\\"]))\\n * @example\\n * sound(\\"<0!2 [0,1] 1>\\".pick([\\"bd(3,8)\\", \\"sd sd\\"]))\\n * @example\\n * s(\\"<a!2 [a,b] b>\\".pick({a: \\"bd(3,8)\\", b: \\"sd sd\\"}))\\n */","meta":{"range":[1911,2113],"filename":"pick.mjs","lineno":45,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100041652","name":"exports.pick","type":"VariableDeclaration"}},"description":"<p>Picks patterns (or plain values) either from a list (by index) or a lookup table (by name).\\nSimilar to <code>inhabit</code>, but maintains the structure of the original patterns.</p>","tags":["combiners"],"params":[{"type":{"names":["Pattern"]},"name":"pat"},{"type":{"names":["*"]},"name":"xs"}],"returns":[{"type":{"names":["Pattern"]}}],"examples":["note(\\"<0 1 2!2 3>\\".pick([\\"g a\\", \\"e f\\", \\"f g f g\\" , \\"g c d\\"]))","sound(\\"<0 1 [2,0]>\\".pick([\\"bd sd\\", \\"cp cp\\", \\"hh hh\\"]))","sound(\\"<0!2 [0,1] 1>\\".pick([\\"bd(3,8)\\", \\"sd sd\\"]))","s(\\"<a!2 [a,b] b>\\".pick({a: \\"bd(3,8)\\", b: \\"sd sd\\"}))"],"name":"pick","longname":"pick","kind":"constant","scope":"global"},{"comment":"/** * The same as \`pick\`, but if you pick a number greater than the size of the list,\\n * it wraps around, rather than sticking at the maximum value.\\n * For example, if you pick the fifth pattern of a list of three, you'll get the\\n * second one.\\n * @tags combiners\\n * @param {Pattern} pat\\n * @param {*} xs\\n * @returns {Pattern}\\n */","meta":{"range":[2557,2675],"filename":"pick.mjs","lineno":67,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100041697","name":"exports.pickmod","type":"VariableDeclaration"}},"description":"<p>The same as <code>pick</code>, but if you pick a number greater than the size of the list,\\nit wraps around, rather than sticking at the maximum value.\\nFor example, if you pick the fifth pattern of a list of three, you'll get the\\nsecond one.</p>","tags":["combiners"],"params":[{"type":{"names":["Pattern"]},"name":"pat"},{"type":{"names":["*"]},"name":"xs"}],"returns":[{"type":{"names":["Pattern"]}}],"name":"pickmod","longname":"pickmod","kind":"constant","scope":"global"},{"comment":"/** * pickF lets you use a pattern of numbers to pick which function to apply to another pattern.\\n * @tags combiners, functional\\n * @param {Pattern} pat\\n * @param {Pattern} lookup a pattern of indices or names\\n * @param {function[] | object} lookup the array or lookup object of functions from which to pull\\n * @returns {Pattern}\\n * @example\\n * s(\\"bd [rim hh]\\").pickF(\\"<0 1 2>\\", [rev,jux(rev),fast(2)])\\n * @example\\n * note(\\"<c2 d2>(3,8)\\").s(\\"square\\")\\n * .pickF(\\"<0 2> 1\\", [jux(rev), fast(2), x=>x.lpf(800)])\\n * @example\\n * note(\\"<c2 d2>(3,8)\\").s(\\"square\\")\\n * .pickF(\\"<jr l> f\\", { jr:jux(rev), f:fast(2), l:x=>x.lpf(800) })\\n */","meta":{"range":[3304,3431],"filename":"pick.mjs","lineno":86,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100041717","name":"exports.pickF","type":"VariableDeclaration"}},"description":"<p>pickF lets you use a pattern of numbers to pick which function to apply to another pattern.</p>","tags":["combiners","functional"],"params":[{"type":{"names":["Pattern"]},"name":"pat"},{"type":{"names":["Pattern"]},"description":"<p>a pattern of indices or names</p>","name":"lookup"},{"type":{"names":["Array.<function()>","object"]},"description":"<p>the array or lookup object of functions from which to pull</p>","name":"lookup"}],"returns":[{"type":{"names":["Pattern"]}}],"examples":["s(\\"bd [rim hh]\\").pickF(\\"<0 1 2>\\", [rev,jux(rev),fast(2)])","note(\\"<c2 d2>(3,8)\\").s(\\"square\\")\\n.pickF(\\"<0 2> 1\\", [jux(rev), fast(2), x=>x.lpf(800)])","note(\\"<c2 d2>(3,8)\\").s(\\"square\\")\\n.pickF(\\"<jr l> f\\", { jr:jux(rev), f:fast(2), l:x=>x.lpf(800) })"],"name":"pickF","longname":"pickF","kind":"constant","scope":"global"},{"comment":"/** * The same as \`pickF\`, but if you pick a number greater than the size of the functions list,\\n * it wraps around, rather than sticking at the maximum value.\\n * @tags combiners\\n * @param {Pattern} pat\\n * @param {Pattern} lookup a pattern of indices or names\\n * @param {function[] | object} lookup the array or lookup object of functions from which to pull\\n * @returns {Pattern}\\n */","meta":{"range":[3817,3953],"filename":"pick.mjs","lineno":98,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100041738","name":"exports.pickmodF","type":"VariableDeclaration"}},"description":"<p>The same as <code>pickF</code>, but if you pick a number greater than the size of the functions list,\\nit wraps around, rather than sticking at the maximum value.</p>","tags":["combiners"],"params":[{"type":{"names":["Pattern"]},"name":"pat"},{"type":{"names":["Pattern"]},"description":"<p>a pattern of indices or names</p>","name":"lookup"},{"type":{"names":["Array.<function()>","object"]},"description":"<p>the array or lookup object of functions from which to pull</p>","name":"lookup"}],"returns":[{"type":{"names":["Pattern"]}}],"name":"pickmodF","longname":"pickmodF","kind":"constant","scope":"global"},{"comment":"/** * Similar to \`pick\`, but it applies an outerJoin instead of an innerJoin.\\n * @tags combiners\\n * @param {Pattern} pat\\n * @param {*} xs\\n * @returns {Pattern}\\n */","meta":{"range":[4119,4238],"filename":"pick.mjs","lineno":108,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100041759","name":"exports.pickOut","type":"VariableDeclaration"}},"description":"<p>Similar to <code>pick</code>, but it applies an outerJoin instead of an innerJoin.</p>","tags":["combiners"],"params":[{"type":{"names":["Pattern"]},"name":"pat"},{"type":{"names":["*"]},"name":"xs"}],"returns":[{"type":{"names":["Pattern"]}}],"name":"pickOut","longname":"pickOut","kind":"constant","scope":"global"},{"comment":"/** * The same as \`pickOut\`, but if you pick a number greater than the size of the list,\\n * it wraps around, rather than sticking at the maximum value.\\n * @tags combiners\\n * @param {Pattern} pat\\n * @param {*} xs\\n * @returns {Pattern}\\n */","meta":{"range":[4478,4602],"filename":"pick.mjs","lineno":119,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100041779","name":"exports.pickmodOut","type":"VariableDeclaration"}},"description":"<p>The same as <code>pickOut</code>, but if you pick a number greater than the size of the list,\\nit wraps around, rather than sticking at the maximum value.</p>","tags":["combiners"],"params":[{"type":{"names":["Pattern"]},"name":"pat"},{"type":{"names":["*"]},"name":"xs"}],"returns":[{"type":{"names":["Pattern"]}}],"name":"pickmodOut","longname":"pickmodOut","kind":"constant","scope":"global"},{"comment":"/** * Similar to \`pick\`, but the choosen pattern is restarted when its index is triggered.\\n * @tags combiners\\n * @param {Pattern} pat\\n * @param {*} xs\\n * @returns {Pattern}\\n */","meta":{"range":[4781,4910],"filename":"pick.mjs","lineno":129,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100041799","name":"exports.pickRestart","type":"VariableDeclaration"}},"description":"<p>Similar to <code>pick</code>, but the choosen pattern is restarted when its index is triggered.</p>","tags":["combiners"],"params":[{"type":{"names":["Pattern"]},"name":"pat"},{"type":{"names":["*"]},"name":"xs"}],"returns":[{"type":{"names":["Pattern"]}}],"name":"pickRestart","longname":"pickRestart","kind":"constant","scope":"global"},{"comment":"/** * The same as \`pickRestart\`, but if you pick a number greater than the size of the list,\\n * it wraps around, rather than sticking at the maximum value.\\n * @tags combiners\\n * @param {Pattern} pat\\n * @param {*} xs\\n * @returns {Pattern}\\n * @example\\n * \\"<a@2 b@2 c@2 d@2>\\".pickRestart({\\n a: n(\\"0 1 2 0\\"),\\n b: n(\\"2 3 4 ~\\"),\\n c: n(\\"[4 5] [4 3] 2 0\\"),\\n d: n(\\"0 -3 0 ~\\")\\n }).scale(\\"C:major\\").s(\\"piano\\")\\n */","meta":{"range":[5364,5498],"filename":"pick.mjs","lineno":147,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100041819","name":"exports.pickmodRestart","type":"VariableDeclaration"}},"description":"<p>The same as <code>pickRestart</code>, but if you pick a number greater than the size of the list,\\nit wraps around, rather than sticking at the maximum value.</p>","tags":["combiners"],"params":[{"type":{"names":["Pattern"]},"name":"pat"},{"type":{"names":["*"]},"name":"xs"}],"returns":[{"type":{"names":["Pattern"]}}],"examples":["\\"<a@2 b@2 c@2 d@2>\\".pickRestart({\\n a: n(\\"0 1 2 0\\"),\\n b: n(\\"2 3 4 ~\\"),\\n c: n(\\"[4 5] [4 3] 2 0\\"),\\n d: n(\\"0 -3 0 ~\\")\\n }).scale(\\"C:major\\").s(\\"piano\\")"],"name":"pickmodRestart","longname":"pickmodRestart","kind":"constant","scope":"global"},{"comment":"/** * Similar to \`pick\`, but the choosen pattern is reset when its index is triggered.\\n * @tags combiners\\n * @param {Pattern} pat\\n * @param {*} xs\\n * @returns {Pattern}\\n */","meta":{"range":[5673,5796],"filename":"pick.mjs","lineno":157,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100041839","name":"exports.pickReset","type":"VariableDeclaration"}},"description":"<p>Similar to <code>pick</code>, but the choosen pattern is reset when its index is triggered.</p>","tags":["combiners"],"params":[{"type":{"names":["Pattern"]},"name":"pat"},{"type":{"names":["*"]},"name":"xs"}],"returns":[{"type":{"names":["Pattern"]}}],"name":"pickReset","longname":"pickReset","kind":"constant","scope":"global"},{"comment":"/** * The same as \`pickReset\`, but if you pick a number greater than the size of the list,\\n * it wraps around, rather than sticking at the maximum value.\\n * @tags combiners\\n * @param {Pattern} pat\\n * @param {*} xs\\n * @returns {Pattern}\\n */","meta":{"range":[6038,6166],"filename":"pick.mjs","lineno":168,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100041859","name":"exports.pickmodReset","type":"VariableDeclaration"}},"description":"<p>The same as <code>pickReset</code>, but if you pick a number greater than the size of the list,\\nit wraps around, rather than sticking at the maximum value.</p>","tags":["combiners"],"params":[{"type":{"names":["Pattern"]},"name":"pat"},{"type":{"names":["*"]},"name":"xs"}],"returns":[{"type":{"names":["Pattern"]}}],"name":"pickmodReset","longname":"pickmodReset","kind":"constant","scope":"global"},{"comment":"/** Picks patterns (or plain values) either from a list (by index) or a lookup table (by name).\\n * Similar to \`pick\`, but cycles are squeezed into the target ('inhabited') pattern.\\n * @name inhabit\\n * @tags combiners\\n * @synonyms pickSqueeze\\n * @param {Pattern} pat\\n * @param {*} xs\\n * @returns {Pattern}\\n * @example\\n * let a = s(\\"bd(3,8)\\")\\n * let b = s(\\"cp sd\\")\\n * \\"<a b [a,b]>\\".inhabit({ a, b })\\n * @example\\n * s(\\"a@2 [a b] a\\"\\n * .inhabit({a: \\"bd(3,8)\\", b: \\"sd sd\\"}))\\n * .slow(4)\\n */","meta":{"filename":"pick.mjs","lineno":172,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Picks patterns (or plain values) either from a list (by index) or a lookup table (by name).\\nSimilar to <code>pick</code>, but cycles are squeezed into the target ('inhabited') pattern.</p>","name":"inhabit","tags":["combiners"],"synonyms_text":"pickSqueeze","synonyms":["pickSqueeze"],"params":[{"type":{"names":["Pattern"]},"name":"pat"},{"type":{"names":["*"]},"name":"xs"}],"returns":[{"type":{"names":["Pattern"]}}],"examples":["let a = s(\\"bd(3,8)\\")\\nlet b = s(\\"cp sd\\")\\n\\"<a b [a,b]>\\".inhabit({ a, b })","s(\\"a@2 [a b] a\\"\\n.inhabit({a: \\"bd(3,8)\\", b: \\"sd sd\\"}))\\n.slow(4)"],"longname":"inhabit","kind":"member","scope":"global"},{"comment":"/** * The same as \`inhabit\`, but if you pick a number greater than the size of the list,\\n * it wraps around, rather than sticking at the maximum value.\\n * For example, if you pick the fifth pattern of a list of three, you'll get the\\n * second one.\\n * @name inhabitmod\\n * @synonyms pickmodSqueeze\\n * @tags combiners\\n * @param {Pattern} pat\\n * @param {*} xs\\n * @returns {Pattern}\\n */","meta":{"filename":"pick.mjs","lineno":193,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>The same as <code>inhabit</code>, but if you pick a number greater than the size of the list,\\nit wraps around, rather than sticking at the maximum value.\\nFor example, if you pick the fifth pattern of a list of three, you'll get the\\nsecond one.</p>","name":"inhabitmod","synonyms_text":"pickmodSqueeze","synonyms":["pickmodSqueeze"],"tags":["combiners"],"params":[{"type":{"names":["Pattern"]},"name":"pat"},{"type":{"names":["*"]},"name":"xs"}],"returns":[{"type":{"names":["Pattern"]}}],"longname":"inhabitmod","kind":"member","scope":"global"},{"comment":"/**\\n * Pick from the list of values (or patterns of values) via the index using the given\\n * pattern of integers. The selected pattern will be compressed to fit the duration of the selecting event\\n * @tags combiners\\n * @param {Pattern} pat\\n * @param {*} xs\\n * @returns {Pattern}\\n * @example\\n * note(squeeze(\\"<0@2 [1!2] 2>\\", [\\"g a\\", \\"f g f g\\" , \\"g a c d\\"]))\\n */","meta":{"range":[7724,7965],"filename":"pick.mjs","lineno":220,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100041931","name":"exports.squeeze","type":"VariableDeclaration"}},"description":"<p>Pick from the list of values (or patterns of values) via the index using the given\\npattern of integers. The selected pattern will be compressed to fit the duration of the selecting event</p>","tags":["combiners"],"params":[{"type":{"names":["Pattern"]},"name":"pat"},{"type":{"names":["*"]},"name":"xs"}],"returns":[{"type":{"names":["Pattern"]}}],"examples":["note(squeeze(\\"<0@2 [1!2] 2>\\", [\\"g a\\", \\"f g f g\\" , \\"g a c d\\"]))"],"name":"squeeze","longname":"squeeze","kind":"constant","scope":"global"},{"comment":"/**\\n * Changes the global tempo to the given cycles per minute\\n *\\n * @name setcpm\\n * @tags temporal\\n * @alias setCpm\\n * @param {number} cpm cycles per minute\\n * @example\\n * setcpm(140/4) // =140 bpm in 4/4\\n * $: s(\\"bd*4,[- sd]*2\\").bank('tr707')\\n */","meta":{"filename":"repl.mjs","lineno":290,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Changes the global tempo to the given cycles per minute</p>","name":"setcpm","tags":["temporal"],"alias":"setCpm","params":[{"type":{"names":["number"]},"description":"<p>cycles per minute</p>","name":"cpm"}],"examples":["setcpm(140/4) // =140 bpm in 4/4\\n$: s(\\"bd*4,[- sd]*2\\").bank('tr707')"],"longname":"setcpm","kind":"member","scope":"global"},{"comment":"/**\\n * Applies a function to all the running patterns. Note that the patterns are groups together into a single \`stack\` before the function is applied. This is probably what you want, but see \`each\` for\\n * a version that applies the function to each pattern separately.\\n * \`\`\`\\n * $: sound(\\"bd - cp sd\\")\\n * $: sound(\\"hh*8\\")\\n * all(fast(\\"<2 3>\\"))\\n * \`\`\`\\n * \`\`\`\\n * $: sound(\\"bd - cp sd\\")\\n * $: sound(\\"hh*8\\")\\n * all(x => x.pianoroll())\\n * \`\`\`\\n *\\n * @tags combiners\\n */","meta":{"range":[9947,10034],"filename":"repl.mjs","lineno":325,"columnno":8,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100043031","name":"all","type":"FunctionExpression"}},"description":"<p>Applies a function to all the running patterns. Note that the patterns are groups together into a single <code>stack</code> before the function is applied. This is probably what you want, but see <code>each</code> for\\na version that applies the function to each pattern separately.</p>\\n<pre class=\\"prettyprint source\\"><code>$: sound("bd - cp sd")\\n$: sound("hh*8")\\nall(fast("<2 3>"))\\n</code></pre>\\n<pre class=\\"prettyprint source\\"><code>$: sound("bd - cp sd")\\n$: sound("hh*8")\\nall(x => x.pianoroll())\\n</code></pre>","tags":["combiners"],"name":"all","longname":"repl~all","kind":"function","memberof":"repl","scope":"inner","params":[]},{"comment":"/** Applies a function to each of the running patterns separately. This is intended for future use with upcoming 'stepwise' features. See \`all\` for a version that applies the function to all the patterns stacked together into a single pattern.\\n *\\n * \`\`\`\\n * $: sound(\\"bd - cp sd\\")\\n * $: sound(\\"hh*8\\")\\n * each(fast(\\"<2 3>\\"))\\n * \`\`\`\\n * @tags combiners\\n */","meta":{"range":[10415,10499],"filename":"repl.mjs","lineno":338,"columnno":8,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100043045","name":"each","type":"FunctionExpression"},"vars":{"eachTransform":"repl~each~eachTransform"}},"description":"<p>Applies a function to each of the running patterns separately. This is intended for future use with upcoming 'stepwise' features. See <code>all</code> for a version that applies the function to all the patterns stacked together into a single pattern.</p>\\n<pre class=\\"prettyprint source\\"><code>$: sound("bd - cp sd")\\n$: sound("hh*8")\\neach(fast("<2 3>"))\\n</code></pre>","tags":["combiners"],"name":"each","longname":"repl~each","kind":"function","memberof":"repl","scope":"inner","params":[]},{"comment":"/**\\n * A sawtooth signal between 0 and 1.\\n *\\n * @return {Pattern}\\n * @tags generators\\n * @example\\n * note(\\"<c3 [eb3,g3] g2 [g3,bb3]>*8\\")\\n * .clip(saw.slow(2))\\n * @example\\n * n(saw.range(0,8).segment(8))\\n * .scale('C major')\\n *\\n */","meta":{"range":[1569,1609],"filename":"signal.mjs","lineno":36,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100044036","name":"exports.saw","type":"VariableDeclaration"}},"description":"<p>A sawtooth signal between 0 and 1.</p>","returns":[{"type":{"names":["Pattern"]}}],"tags":["generators"],"examples":["note(\\"<c3 [eb3,g3] g2 [g3,bb3]>*8\\")\\n.clip(saw.slow(2))","n(saw.range(0,8).segment(8))\\n.scale('C major')"],"name":"saw","longname":"saw","kind":"constant","scope":"global"},{"comment":"/**\\n * A sawtooth signal between -1 and 1 (like \`saw\`, but bipolar).\\n *\\n * @return {Pattern}\\n * @tags generators\\n */","meta":{"range":[1729,1765],"filename":"signal.mjs","lineno":44,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100044047","name":"exports.saw2","type":"VariableDeclaration"}},"description":"<p>A sawtooth signal between -1 and 1 (like <code>saw</code>, but bipolar).</p>","returns":[{"type":{"names":["Pattern"]}}],"tags":["generators"],"name":"saw2","longname":"saw2","kind":"constant","scope":"global"},{"comment":"/**\\n * A sawtooth signal between 1 and 0 (like \`saw\`, but flipped).\\n *\\n * @return {Pattern}\\n * @tags generators\\n * @example\\n * note(\\"<c3 [eb3,g3] g2 [g3,bb3]>*8\\")\\n * .clip(isaw.slow(2))\\n * @example\\n * n(isaw.range(0,8).segment(8))\\n * .scale('C major')\\n *\\n */","meta":{"range":[2027,2074],"filename":"signal.mjs","lineno":59,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100044055","name":"exports.isaw","type":"VariableDeclaration"}},"description":"<p>A sawtooth signal between 1 and 0 (like <code>saw</code>, but flipped).</p>","returns":[{"type":{"names":["Pattern"]}}],"tags":["generators"],"examples":["note(\\"<c3 [eb3,g3] g2 [g3,bb3]>*8\\")\\n.clip(isaw.slow(2))","n(isaw.range(0,8).segment(8))\\n.scale('C major')"],"name":"isaw","longname":"isaw","kind":"constant","scope":"global"},{"comment":"/**\\n * A sawtooth signal between 1 and -1 (like \`saw2\`, but flipped).\\n *\\n * @return {Pattern}\\n * @tags generators\\n */","meta":{"range":[2195,2233],"filename":"signal.mjs","lineno":67,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100044068","name":"exports.isaw2","type":"VariableDeclaration"}},"description":"<p>A sawtooth signal between 1 and -1 (like <code>saw2</code>, but flipped).</p>","returns":[{"type":{"names":["Pattern"]}}],"tags":["generators"],"name":"isaw2","longname":"isaw2","kind":"constant","scope":"global"},{"comment":"/**\\n * A sine signal between -1 and 1 (like \`sine\`, but bipolar).\\n *\\n * @return {Pattern}\\n * @tags generators\\n */","meta":{"range":[2350,2412],"filename":"signal.mjs","lineno":75,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100044076","name":"exports.sine2","type":"VariableDeclaration"}},"description":"<p>A sine signal between -1 and 1 (like <code>sine</code>, but bipolar).</p>","returns":[{"type":{"names":["Pattern"]}}],"tags":["generators"],"name":"sine2","longname":"sine2","kind":"constant","scope":"global"},{"comment":"/**\\n * A sine signal between 0 and 1.\\n * @return {Pattern}\\n * @tags generators\\n * @example\\n * n(sine.segment(16).range(0,15))\\n * .scale(\\"C:minor\\")\\n *\\n */","meta":{"range":[2569,2609],"filename":"signal.mjs","lineno":86,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100044095","name":"exports.sine","type":"VariableDeclaration"}},"description":"<p>A sine signal between 0 and 1.</p>","returns":[{"type":{"names":["Pattern"]}}],"tags":["generators"],"examples":["n(sine.segment(16).range(0,15))\\n.scale(\\"C:minor\\")"],"name":"sine","longname":"sine","kind":"constant","scope":"global"},{"comment":"/**\\n * A cosine signal between 0 and 1.\\n *\\n * @return {Pattern}\\n * @tags generators\\n * @example\\n * n(stack(sine,cosine).segment(16).range(0,15))\\n * .scale(\\"C:minor\\")\\n *\\n */","meta":{"range":[2785,2839],"filename":"signal.mjs","lineno":98,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100044103","name":"exports.cosine","type":"VariableDeclaration"}},"description":"<p>A cosine signal between 0 and 1.</p>","returns":[{"type":{"names":["Pattern"]}}],"tags":["generators"],"examples":["n(stack(sine,cosine).segment(16).range(0,15))\\n.scale(\\"C:minor\\")"],"name":"cosine","longname":"cosine","kind":"constant","scope":"global"},{"comment":"/**\\n * A cosine signal between -1 and 1 (like \`cosine\`, but bipolar).\\n *\\n * @return {Pattern}\\n * @tags generators\\n */","meta":{"range":[2960,3016],"filename":"signal.mjs","lineno":106,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100044118","name":"exports.cosine2","type":"VariableDeclaration"}},"description":"<p>A cosine signal between -1 and 1 (like <code>cosine</code>, but bipolar).</p>","returns":[{"type":{"names":["Pattern"]}}],"tags":["generators"],"name":"cosine2","longname":"cosine2","kind":"constant","scope":"global"},{"comment":"/**\\n * A square signal between 0 and 1.\\n * @return {Pattern}\\n * @tags generators\\n * @example\\n * n(square.segment(4).range(0,7)).scale(\\"C:minor\\")\\n *\\n */","meta":{"range":[3171,3232],"filename":"signal.mjs","lineno":116,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100044133","name":"exports.square","type":"VariableDeclaration"}},"description":"<p>A square signal between 0 and 1.</p>","returns":[{"type":{"names":["Pattern"]}}],"tags":["generators"],"examples":["n(square.segment(4).range(0,7)).scale(\\"C:minor\\")"],"name":"square","longname":"square","kind":"constant","scope":"global"},{"comment":"/**\\n * A square signal between -1 and 1 (like \`square\`, but bipolar).\\n *\\n * @return {Pattern}\\n * @tags generators\\n */","meta":{"range":[3353,3395],"filename":"signal.mjs","lineno":124,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100044150","name":"exports.square2","type":"VariableDeclaration"}},"description":"<p>A square signal between -1 and 1 (like <code>square</code>, but bipolar).</p>","returns":[{"type":{"names":["Pattern"]}}],"tags":["generators"],"name":"square2","longname":"square2","kind":"constant","scope":"global"},{"comment":"/**\\n * A triangle signal between 0 and 1.\\n *\\n * @return {Pattern}\\n * @tags generators\\n * @example\\n * n(tri.segment(8).range(0,7)).scale(\\"C:minor\\")\\n *\\n */","meta":{"range":[3552,3590],"filename":"signal.mjs","lineno":135,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100044158","name":"exports.tri","type":"VariableDeclaration"}},"description":"<p>A triangle signal between 0 and 1.</p>","returns":[{"type":{"names":["Pattern"]}}],"tags":["generators"],"examples":["n(tri.segment(8).range(0,7)).scale(\\"C:minor\\")"],"name":"tri","longname":"tri","kind":"constant","scope":"global"},{"comment":"/**\\n * A triangle signal between -1 and 1 (like \`tri\`, but bipolar).\\n *\\n * @return {Pattern}\\n * @tags generators\\n */","meta":{"range":[3710,3751],"filename":"signal.mjs","lineno":143,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100044166","name":"exports.tri2","type":"VariableDeclaration"}},"description":"<p>A triangle signal between -1 and 1 (like <code>tri</code>, but bipolar).</p>","returns":[{"type":{"names":["Pattern"]}}],"tags":["generators"],"name":"tri2","longname":"tri2","kind":"constant","scope":"global"},{"comment":"/**\\n * An inverted triangle signal between 1 and 0 (like \`tri\`, but flipped).\\n *\\n * @return {Pattern}\\n * @tags generators\\n * @example\\n * n(itri.segment(8).range(0,7)).scale(\\"C:minor\\")\\n *\\n */","meta":{"range":[3945,3984],"filename":"signal.mjs","lineno":154,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100044174","name":"exports.itri","type":"VariableDeclaration"}},"description":"<p>An inverted triangle signal between 1 and 0 (like <code>tri</code>, but flipped).</p>","returns":[{"type":{"names":["Pattern"]}}],"tags":["generators"],"examples":["n(itri.segment(8).range(0,7)).scale(\\"C:minor\\")"],"name":"itri","longname":"itri","kind":"constant","scope":"global"},{"comment":"/**\\n * An inverted triangle signal between -1 and 1 (like \`itri\`, but bipolar).\\n *\\n * @return {Pattern}\\n * @tags generators\\n */","meta":{"range":[4115,4157],"filename":"signal.mjs","lineno":162,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100044182","name":"exports.itri2","type":"VariableDeclaration"}},"description":"<p>An inverted triangle signal between -1 and 1 (like <code>itri</code>, but bipolar).</p>","returns":[{"type":{"names":["Pattern"]}}],"tags":["generators"],"name":"itri2","longname":"itri2","kind":"constant","scope":"global"},{"comment":"/**\\n * A signal representing the cycle time.\\n *\\n * @return {Pattern}\\n * @tags generators\\n */","meta":{"range":[4253,4284],"filename":"signal.mjs","lineno":170,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100044190","name":"exports.time","type":"VariableDeclaration"}},"description":"<p>A signal representing the cycle time.</p>","returns":[{"type":{"names":["Pattern"]}}],"tags":["generators"],"name":"time","longname":"time","kind":"constant","scope":"global"},{"comment":"/**\\n * The mouse's x position value ranges from 0 to 1.\\n * @name mousex\\n * @return {Pattern}\\n * @tags external_io\\n * @example\\n * n(mousex.segment(4).range(0,7)).scale(\\"C:minor\\")\\n *\\n */","meta":{"filename":"signal.mjs","lineno":172,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>The mouse's x position value ranges from 0 to 1.</p>","name":"mousex","returns":[{"type":{"names":["Pattern"]}}],"tags":["external_io"],"examples":["n(mousex.segment(4).range(0,7)).scale(\\"C:minor\\")"],"longname":"mousex","kind":"member","scope":"global"},{"comment":"/**\\n * The mouse's y position value ranges from 0 to 1.\\n * @name mousey\\n * @return {Pattern}\\n * @tags external_io\\n * @example\\n * n(mousey.segment(4).range(0,7)).scale(\\"C:minor\\")\\n *\\n */","meta":{"filename":"signal.mjs","lineno":182,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>The mouse's y position value ranges from 0 to 1.</p>","name":"mousey","returns":[{"type":{"names":["Pattern"]}}],"tags":["external_io"],"examples":["n(mousey.segment(4).range(0,7)).scale(\\"C:minor\\")"],"longname":"mousey","kind":"member","scope":"global"},{"comment":"/**\\n * Sets which random number generator to use. Historically Strudel would\\n * use \`useRNG('legacy')\`, which remains the default. To use a new more statistically\\n * precise RNG, try \`useRNG('precise')\`.\\n *\\n * @name useRNG\\n * @tags generators, math\\n * @param {string} mod - Mode. One of 'legacy', 'precise'\\n * @example\\n * useRNG('legacy')\\n * // Repeats every 300 cycles\\n * $: n(irand(50)).seg(16).scale(\\"C:minor\\").ribbon(88, 32)\\n * $: n(irand(50)).seg(16).scale(\\"C:minor\\").ribbon(388, 32)\\n */","meta":{"filename":"signal.mjs","lineno":283,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Sets which random number generator to use. Historically Strudel would\\nuse <code>useRNG('legacy')</code>, which remains the default. To use a new more statistically\\nprecise RNG, try <code>useRNG('precise')</code>.</p>","name":"useRNG","tags":["generators","math"],"params":[{"type":{"names":["string"]},"description":"<p>Mode. One of 'legacy', 'precise'</p>","name":"mod"}],"examples":["useRNG('legacy')\\n// Repeats every 300 cycles\\n$: n(irand(50)).seg(16).scale(\\"C:minor\\").ribbon(88, 32)\\n$: n(irand(50)).seg(16).scale(\\"C:minor\\").ribbon(388, 32)"],"longname":"useRNG","kind":"member","scope":"global"},{"comment":"/**\\n * A discrete pattern of numbers from 0 to n-1\\n * @tags generators\\n * @example\\n * n(run(4)).scale(\\"C4:pentatonic\\")\\n * // n(\\"0 1 2 3\\").scale(\\"C4:pentatonic\\")\\n */","meta":{"range":[8213,8274],"filename":"signal.mjs","lineno":306,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100044662","name":"exports.run","type":"VariableDeclaration"}},"description":"<p>A discrete pattern of numbers from 0 to n-1</p>","tags":["generators"],"examples":["n(run(4)).scale(\\"C4:pentatonic\\")\\n// n(\\"0 1 2 3\\").scale(\\"C4:pentatonic\\")"],"name":"run","longname":"run","kind":"constant","scope":"global"},{"comment":"/**\\n * Creates a binary pattern from a number.\\n *\\n * @name binary\\n * @tags generators\\n * @param {number} n - input number to convert to binary\\n * @example\\n * \\"hh\\".s().struct(binary(5))\\n * // \\"hh\\".s().struct(\\"1 0 1\\")\\n */","meta":{"filename":"signal.mjs","lineno":308,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Creates a binary pattern from a number.</p>","name":"binary","tags":["generators"],"params":[{"type":{"names":["number"]},"description":"<p>input number to convert to binary</p>","name":"n"}],"examples":["\\"hh\\".s().struct(binary(5))\\n// \\"hh\\".s().struct(\\"1 0 1\\")"],"longname":"binary","kind":"member","scope":"global"},{"comment":"/**\\n * Creates a binary pattern from a number, padded to n bits long.\\n *\\n * @name binaryN\\n * @tags generators\\n * @param {number} n - input number to convert to binary\\n * @param {number} nBits - pattern length, defaults to 16\\n * @example\\n * \\"hh\\".s().struct(binaryN(55532, 16))\\n * // \\"hh\\".s().struct(\\"1 1 0 1 1 0 0 0 1 1 1 0 1 1 0 0\\")\\n */","meta":{"filename":"signal.mjs","lineno":323,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Creates a binary pattern from a number, padded to n bits long.</p>","name":"binaryN","tags":["generators"],"params":[{"type":{"names":["number"]},"description":"<p>input number to convert to binary</p>","name":"n"},{"type":{"names":["number"]},"description":"<p>pattern length, defaults to 16</p>","name":"nBits"}],"examples":["\\"hh\\".s().struct(binaryN(55532, 16))\\n// \\"hh\\".s().struct(\\"1 1 0 1 1 0 0 0 1 1 1 0 1 1 0 0\\")"],"longname":"binaryN","kind":"member","scope":"global"},{"comment":"/**\\n * Creates a binary list pattern from a number.\\n *\\n * @name binaryL\\n * @tags generators\\n * @param {number} n - input number to convert to binary\\n * s(\\"saw\\").seg(8)\\n * .partials(binaryL(irand(4096).add(1)))\\n */","meta":{"filename":"signal.mjs","lineno":341,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Creates a binary list pattern from a number.</p>","name":"binaryL","tags":["generators"],"params":[{"type":{"names":["number"]},"description":"<p>input number to convert to binary\\ns("saw").seg(8)\\n.partials(binaryL(irand(4096).add(1)))</p>","name":"n"}],"longname":"binaryL","kind":"member","scope":"global"},{"comment":"/**\\n * Creates a binary list pattern from a number, padded to n bits long.\\n *\\n * @name binaryNL\\n * @tags generators\\n * @param {number} n - input number to convert to binary\\n * @param {number} nBits - pattern length, defaults to 16\\n */","meta":{"filename":"signal.mjs","lineno":355,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Creates a binary list pattern from a number, padded to n bits long.</p>","name":"binaryNL","tags":["generators"],"params":[{"type":{"names":["number"]},"description":"<p>input number to convert to binary</p>","name":"n"},{"type":{"names":["number"]},"description":"<p>pattern length, defaults to 16</p>","name":"nBits"}],"longname":"binaryNL","kind":"member","scope":"global"},{"comment":"/**\\n * Creates a list of random numbers of the given length\\n *\\n * @name randL\\n * @tags generators\\n * @param {number} n Number of random numbers to sample\\n * @example\\n * s(\\"saw\\").seg(16).n(irand(12)).scale(\\"F1:minor\\")\\n * .partials(randL(8))\\n */","meta":{"filename":"signal.mjs","lineno":375,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Creates a list of random numbers of the given length</p>","name":"randL","tags":["generators"],"params":[{"type":{"names":["number"]},"description":"<p>Number of random numbers to sample</p>","name":"n"}],"examples":["s(\\"saw\\").seg(16).n(irand(12)).scale(\\"F1:minor\\")\\n .partials(randL(8))"],"longname":"randL","kind":"member","scope":"global"},{"comment":"/**\\n * Slices a pattern into the given number of parts, then plays those parts in random order.\\n * Each part will be played exactly once per cycle.\\n * @name shuffle\\n * @tags temporal\\n * @example\\n * note(\\"c d e f\\").sound(\\"piano\\").shuffle(4)\\n * @example\\n * seq(\\"c d e f\\".shuffle(4), \\"g\\").note().sound(\\"piano\\")\\n */","meta":{"filename":"signal.mjs","lineno":409,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Slices a pattern into the given number of parts, then plays those parts in random order.\\nEach part will be played exactly once per cycle.</p>","name":"shuffle","tags":["temporal"],"examples":["note(\\"c d e f\\").sound(\\"piano\\").shuffle(4)","seq(\\"c d e f\\".shuffle(4), \\"g\\").note().sound(\\"piano\\")"],"longname":"shuffle","kind":"member","scope":"global"},{"comment":"/**\\n * Slices a pattern into the given number of parts, then plays those parts at random. Similar to \`shuffle\`,\\n * but parts might be played more than once, or not at all, per cycle.\\n * @name scramble\\n * @tags temporal\\n * @example\\n * note(\\"c d e f\\").sound(\\"piano\\").scramble(4)\\n * @example\\n * seq(\\"c d e f\\".scramble(4), \\"g\\").note().sound(\\"piano\\")\\n */","meta":{"filename":"signal.mjs","lineno":423,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Slices a pattern into the given number of parts, then plays those parts at random. Similar to <code>shuffle</code>,\\nbut parts might be played more than once, or not at all, per cycle.</p>","name":"scramble","tags":["temporal"],"examples":["note(\\"c d e f\\").sound(\\"piano\\").scramble(4)","seq(\\"c d e f\\".scramble(4), \\"g\\").note().sound(\\"piano\\")"],"longname":"scramble","kind":"member","scope":"global"},{"comment":"/**\\n * Modify a pattern by applying a function to the \`randomSeed\` control if present\\n *\\n * @tags math\\n * @param {Function} func Function from seed (or undefined) to seed (or undefined)\\n * @param {Pattern} pat Pattern to update\\n * @returns Pattern\\n */","meta":{"range":[12244,12490],"filename":"signal.mjs","lineno":445,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100045093","name":"exports.withSeed","type":"VariableDeclaration"}},"description":"<p>Modify a pattern by applying a function to the <code>randomSeed</code> control if present</p>","tags":["math"],"params":[{"type":{"names":["function"]},"description":"<p>Function from seed (or undefined) to seed (or undefined)</p>","name":"func"},{"type":{"names":["Pattern"]},"description":"<p>Pattern to update</p>","name":"pat"}],"returns":[{"description":"<p>Pattern</p>"}],"name":"withSeed","longname":"withSeed","kind":"constant","scope":"global"},{"comment":"/**\\n * Change the seed for random signals. Normally, random signals depend on time,\\n * so two patterns at the same time will have the same random values. Specifying\\n * a new seed changes the signal output by \`rand\`. This also affects other functions\\n * that use randomness, like \`shuffle\` and \`sometimes\`.\\n *\\n * @name seed\\n * @tags math\\n * @param {number} n A new seed. Can be any number.\\n * @example\\n * $: s(\\"hh*4\\").degrade();\\n * $: s(\\"bd*4\\").degrade().seed(1); // Will degrade different events from the hi-hat\\n */","meta":{"filename":"signal.mjs","lineno":453,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Change the seed for random signals. Normally, random signals depend on time,\\nso two patterns at the same time will have the same random values. Specifying\\na new seed changes the signal output by <code>rand</code>. This also affects other functions\\nthat use randomness, like <code>shuffle</code> and <code>sometimes</code>.</p>","name":"seed","tags":["math"],"params":[{"type":{"names":["number"]},"description":"<p>A new seed. Can be any number.</p>","name":"n"}],"examples":["$: s(\\"hh*4\\").degrade();\\n$: s(\\"bd*4\\").degrade().seed(1); // Will degrade different events from the hi-hat"],"longname":"seed","kind":"member","scope":"global"},{"comment":"/**\\n * A continuous pattern of random numbers, between 0 and 1.\\n *\\n * @name rand\\n * @tags generators\\n * @example\\n * // randomly change the cutoff\\n * s(\\"bd*4,hh*8\\").cutoff(rand.range(500,8000))\\n *\\n */","meta":{"filename":"signal.mjs","lineno":470,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>A continuous pattern of random numbers, between 0 and 1.</p>","name":"rand","tags":["generators"],"examples":["// randomly change the cutoff\\ns(\\"bd*4,hh*8\\").cutoff(rand.range(500,8000))"],"longname":"rand","kind":"member","scope":"global"},{"comment":"/**\\n * A continuous pattern of random numbers, between -1 and 1\\n * @tags generators\\n */","meta":{"range":[13471,13509],"filename":"signal.mjs","lineno":485,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100045173","name":"exports.rand2","type":"VariableDeclaration"}},"description":"<p>A continuous pattern of random numbers, between -1 and 1</p>","tags":["generators"],"name":"rand2","longname":"rand2","kind":"constant","scope":"global"},{"comment":"/**\\n * A continuous pattern of 0 or 1 (binary random), with a probability for the value being 1\\n *\\n * @name brandBy\\n * @tags generators\\n * @param {number} probability - a number between 0 and 1\\n * @example\\n * s(\\"hh*10\\").pan(brandBy(0.2))\\n */","meta":{"filename":"signal.mjs","lineno":489,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>A continuous pattern of 0 or 1 (binary random), with a probability for the value being 1</p>","name":"brandBy","tags":["generators"],"params":[{"type":{"names":["number"]},"description":"<p>a number between 0 and 1</p>","name":"probability"}],"examples":["s(\\"hh*10\\").pan(brandBy(0.2))"],"longname":"brandBy","kind":"member","scope":"global"},{"comment":"/**\\n * A continuous pattern of 0 or 1 (binary random)\\n *\\n * @name brand\\n * @tags generators\\n * @example\\n * s(\\"hh*10\\").pan(brand)\\n */","meta":{"filename":"signal.mjs","lineno":500,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>A continuous pattern of 0 or 1 (binary random)</p>","name":"brand","tags":["generators"],"examples":["s(\\"hh*10\\").pan(brand)"],"longname":"brand","kind":"member","scope":"global"},{"comment":"/**\\n * A continuous pattern of random integers, between 0 and n-1.\\n *\\n * @name irand\\n * @tags generators\\n * @param {number} n max value (exclusive)\\n * @example\\n * // randomly select scale notes from 0 - 7 (= C to C)\\n * n(irand(8)).struct(\\"x x*2 x x*3\\").scale(\\"C:minor\\")\\n *\\n */","meta":{"filename":"signal.mjs","lineno":512,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>A continuous pattern of random integers, between 0 and n-1.</p>","name":"irand","tags":["generators"],"params":[{"type":{"names":["number"]},"description":"<p>max value (exclusive)</p>","name":"n"}],"examples":["// randomly select scale notes from 0 - 7 (= C to C)\\nn(irand(8)).struct(\\"x x*2 x x*3\\").scale(\\"C:minor\\")"],"longname":"irand","kind":"member","scope":"global"},{"comment":"/**\\n * Choose from the list of values (or patterns of values) using the given\\n * pattern of numbers, which should be in the range of 0..1\\n * @tags temporal\\n * @param {Pattern} pat\\n * @param {*} xs\\n * @returns {Pattern}\\n * @example\\n * note(\\"c2 g2!2 d2 f1\\").s(chooseWith(sine.fast(2), [\\"sawtooth\\", \\"triangle\\", \\"bd:6\\"]))\\n */","meta":{"range":[15049,15136],"filename":"signal.mjs","lineno":546,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100045320","name":"exports.chooseWith","type":"VariableDeclaration"}},"description":"<p>Choose from the list of values (or patterns of values) using the given\\npattern of numbers, which should be in the range of 0..1</p>","tags":["temporal"],"params":[{"type":{"names":["Pattern"]},"name":"pat"},{"type":{"names":["*"]},"name":"xs"}],"returns":[{"type":{"names":["Pattern"]}}],"examples":["note(\\"c2 g2!2 d2 f1\\").s(chooseWith(sine.fast(2), [\\"sawtooth\\", \\"triangle\\", \\"bd:6\\"]))"],"name":"chooseWith","longname":"chooseWith","kind":"constant","scope":"global"},{"comment":"/**\\n * As with {chooseWith}, but the structure comes from the chosen values, rather\\n * than the pattern you're using to choose with.\\n * @tags temporal\\n * @param {Pattern} pat\\n * @param {*} xs\\n * @returns {Pattern}\\n */","meta":{"range":[15356,15445],"filename":"signal.mjs","lineno":558,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100045336","name":"exports.chooseInWith","type":"VariableDeclaration"}},"description":"<p>As with {chooseWith}, but the structure comes from the chosen values, rather\\nthan the pattern you're using to choose with.</p>","tags":["temporal"],"params":[{"type":{"names":["Pattern"]},"name":"pat"},{"type":{"names":["*"]},"name":"xs"}],"returns":[{"type":{"names":["Pattern"]}}],"name":"chooseInWith","longname":"chooseInWith","kind":"constant","scope":"global"},{"comment":"/**\\n * Chooses randomly from the given list of elements.\\n * @tags temporal\\n * @param {...any} xs values / patterns to choose from.\\n * @returns {Pattern} - a continuous pattern.\\n * @example\\n * note(\\"c2 g2!2 d2 f1\\").s(choose(\\"sine\\", \\"triangle\\", \\"bd:6\\"))\\n */","meta":{"range":[15704,15758],"filename":"signal.mjs","lineno":570,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100045352","name":"exports.choose","type":"VariableDeclaration"}},"description":"<p>Chooses randomly from the given list of elements.</p>","tags":["temporal"],"params":[{"type":{"names":["any"]},"variable":true,"description":"<p>values / patterns to choose from.</p>","name":"xs"}],"returns":[{"type":{"names":["Pattern"]},"description":"<ul>\\n<li>a continuous pattern.</li>\\n</ul>"}],"examples":["note(\\"c2 g2!2 d2 f1\\").s(choose(\\"sine\\", \\"triangle\\", \\"bd:6\\"))"],"name":"choose","longname":"choose","kind":"constant","scope":"global"},{"comment":"/**\\n * Chooses from the given list of values (or patterns of values), according\\n * to the pattern that the method is called on. The pattern should be in\\n * the range 0 .. 1.\\n * @tags temporal\\n * @param {...any} xs\\n * @returns {Pattern}\\n */","meta":{"range":[16107,16185],"filename":"signal.mjs","lineno":584,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100045380","name":"Pattern.prototype.choose","type":"FunctionExpression","paramnames":["xs"]}},"description":"<p>Chooses from the given list of values (or patterns of values), according\\nto the pattern that the method is called on. The pattern should be in\\nthe range 0 .. 1.</p>","tags":["temporal"],"params":[{"type":{"names":["any"]},"variable":true,"name":"xs"}],"returns":[{"type":{"names":["Pattern"]}}],"name":"choose","longname":"Pattern#choose","kind":"function","memberof":"Pattern","scope":"instance"},{"comment":"/**\\n * As with choose, but the pattern that this method is called on should be\\n * in the range -1 .. 1\\n * @tags temporal\\n * @param {...any} xs\\n * @returns {Pattern}\\n */","meta":{"range":[16358,16451],"filename":"signal.mjs","lineno":595,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100045396","name":"Pattern.prototype.choose2","type":"FunctionExpression","paramnames":["xs"]}},"description":"<p>As with choose, but the pattern that this method is called on should be\\nin the range -1 .. 1</p>","tags":["temporal"],"params":[{"type":{"names":["any"]},"variable":true,"name":"xs"}],"returns":[{"type":{"names":["Pattern"]}}],"name":"choose2","longname":"Pattern#choose2","kind":"function","memberof":"Pattern","scope":"instance"},{"comment":"/**\\n * Picks one of the elements at random each cycle.\\n * @tags temporal\\n * @synonyms randcat\\n * @returns {Pattern}\\n * @example\\n * chooseCycles(\\"bd\\", \\"hh\\", \\"sd\\").s().fast(8)\\n * @example\\n * s(\\"bd | hh | sd\\").fast(8)\\n */","meta":{"range":[16673,16746],"filename":"signal.mjs","lineno":609,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100045414","name":"exports.chooseCycles","type":"VariableDeclaration"}},"description":"<p>Picks one of the elements at random each cycle.</p>","tags":["temporal"],"synonyms_text":"randcat","synonyms":["randcat"],"returns":[{"type":{"names":["Pattern"]}}],"examples":["chooseCycles(\\"bd\\", \\"hh\\", \\"sd\\").s().fast(8)","s(\\"bd | hh | sd\\").fast(8)"],"name":"chooseCycles","longname":"chooseCycles","kind":"constant","scope":"global"},{"comment":"/**\\n * Chooses randomly from the given list of elements by giving a probability to each element\\n * @tags temporal\\n * @param {...any} pairs arrays of value and weight\\n * @returns {Pattern} - a continuous pattern.\\n * @example\\n * note(\\"c2 g2!2 d2 f1\\").s(wchoose([\\"sine\\",10], [\\"triangle\\",1], [\\"bd:6\\",1]))\\n */","meta":{"range":[18056,18121],"filename":"signal.mjs","lineno":650,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100045552","name":"exports.wchoose","type":"VariableDeclaration"}},"description":"<p>Chooses randomly from the given list of elements by giving a probability to each element</p>","tags":["temporal"],"params":[{"type":{"names":["any"]},"variable":true,"description":"<p>arrays of value and weight</p>","name":"pairs"}],"returns":[{"type":{"names":["Pattern"]},"description":"<ul>\\n<li>a continuous pattern.</li>\\n</ul>"}],"examples":["note(\\"c2 g2!2 d2 f1\\").s(wchoose([\\"sine\\",10], [\\"triangle\\",1], [\\"bd:6\\",1]))"],"name":"wchoose","longname":"wchoose","kind":"constant","scope":"global"},{"comment":"/**\\n * Picks one of the elements at random each cycle by giving a probability to each element\\n * @tags temporal\\n * @synonyms wrandcat\\n * @returns {Pattern}\\n * @example\\n * wchooseCycles([\\"bd\\",10], [\\"hh\\",1], [\\"sd\\",1]).s().fast(8)\\n * @example\\n * wchooseCycles([\\"c c c\\",5], [\\"a a a\\",3], [\\"f f f\\",1]).fast(4).note()\\n * @example\\n * // The probability can itself be a pattern\\n * wchooseCycles([\\"bd(3,8)\\",\\"<5 0>\\"], [\\"hh hh hh\\",3]).fast(4).s()\\n */","meta":{"range":[18562,18657],"filename":"signal.mjs","lineno":665,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100045564","name":"exports.wchooseCycles","type":"VariableDeclaration"}},"description":"<p>Picks one of the elements at random each cycle by giving a probability to each element</p>","tags":["temporal"],"synonyms_text":"wrandcat","synonyms":["wrandcat"],"returns":[{"type":{"names":["Pattern"]}}],"examples":["wchooseCycles([\\"bd\\",10], [\\"hh\\",1], [\\"sd\\",1]).s().fast(8)","wchooseCycles([\\"c c c\\",5], [\\"a a a\\",3], [\\"f f f\\",1]).fast(4).note()","// The probability can itself be a pattern\\nwchooseCycles([\\"bd(3,8)\\",\\"<5 0>\\"], [\\"hh hh hh\\",3]).fast(4).s()"],"name":"wchooseCycles","longname":"wchooseCycles","kind":"constant","scope":"global"},{"comment":"/**\\n * Generates a continuous pattern of [perlin noise](https://en.wikipedia.org/wiki/Perlin_noise), in the range 0..1.\\n *\\n * @tags generators\\n * @name perlin\\n * @example\\n * // randomly change the cutoff\\n * s(\\"bd*4,hh*8\\").cutoff(perlin.range(500,8000))\\n *\\n */","meta":{"filename":"signal.mjs","lineno":695,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Generates a continuous pattern of <a href=\\"https://en.wikipedia.org/wiki/Perlin_noise\\">perlin noise</a>, in the range 0..1.</p>","tags":["generators"],"name":"perlin","examples":["// randomly change the cutoff\\ns(\\"bd*4,hh*8\\").cutoff(perlin.range(500,8000))"],"longname":"perlin","kind":"member","scope":"global"},{"comment":"/**\\n * Generates a continuous pattern of [berlin noise](conceived by Jame Coyne and Jade Rowland as a joke but turned out to be surprisingly cool and useful,\\n * like perlin noise but with sawtooth waves), in the range 0..1.\\n *\\n * @tags generators\\n * @name berlin\\n * @example\\n * // ascending arpeggios\\n * n(\\"0!16\\".add(berlin.fast(4).mul(14))).scale(\\"d:minor\\")\\n *\\n */","meta":{"filename":"signal.mjs","lineno":707,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Generates a continuous pattern of [berlin noise](conceived by Jame Coyne and Jade Rowland as a joke but turned out to be surprisingly cool and useful,\\nlike perlin noise but with sawtooth waves), in the range 0..1.</p>","tags":["generators"],"name":"berlin","examples":["// ascending arpeggios\\nn(\\"0!16\\".add(berlin.fast(4).mul(14))).scale(\\"d:minor\\")"],"longname":"berlin","kind":"member","scope":"global"},{"comment":"/**\\n * Randomly removes events from the pattern by a given amount.\\n * 0 = 0% chance of removal\\n * 1 = 100% chance of removal\\n *\\n * @tags temporal\\n * @name degradeBy\\n * @memberof Pattern\\n * @param {number} amount - a number between 0 and 1\\n * @returns Pattern\\n * @example\\n * s(\\"hh*8\\").degradeBy(0.2)\\n * @example\\n * s(\\"[hh?0.2]*8\\")\\n * @example\\n * //beat generator\\n * s(\\"bd\\").segment(16).degradeBy(.5).ribbon(16,1)\\n */","meta":{"filename":"signal.mjs","lineno":727,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Randomly removes events from the pattern by a given amount.\\n0 = 0% chance of removal\\n1 = 100% chance of removal</p>","tags":["temporal"],"name":"degradeBy","memberof":"Pattern","params":[{"type":{"names":["number"]},"description":"<p>a number between 0 and 1</p>","name":"amount"}],"returns":[{"description":"<p>Pattern</p>"}],"examples":["s(\\"hh*8\\").degradeBy(0.2)","s(\\"[hh?0.2]*8\\")","//beat generator\\ns(\\"bd\\").segment(16).degradeBy(.5).ribbon(16,1)"],"scope":"static","longname":"Pattern.degradeBy","kind":"member"},{"comment":"/**\\n *\\n * Randomly removes 50% of events from the pattern. Shorthand for \`.degradeBy(0.5)\`\\n *\\n * @tags temporal\\n * @name degrade\\n * @memberof Pattern\\n * @returns Pattern\\n * @example\\n * s(\\"hh*8\\").degrade()\\n * @example\\n * s(\\"[hh?]*8\\")\\n */","meta":{"filename":"signal.mjs","lineno":754,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Randomly removes 50% of events from the pattern. Shorthand for <code>.degradeBy(0.5)</code></p>","tags":["temporal"],"name":"degrade","memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"examples":["s(\\"hh*8\\").degrade()","s(\\"[hh?]*8\\")"],"scope":"static","longname":"Pattern.degrade","kind":"member"},{"comment":"/**\\n * Inverse of \`degradeBy\`: Randomly removes events from the pattern by a given amount.\\n * 0 = 100% chance of removal\\n * 1 = 0% chance of removal\\n * Events that would be removed by degradeBy are let through by undegradeBy and vice versa (see second example).\\n *\\n * @tags temporal\\n * @name undegradeBy\\n * @memberof Pattern\\n * @param {number} amount - a number between 0 and 1\\n * @returns Pattern\\n * @example\\n * s(\\"hh*8\\").undegradeBy(0.2)\\n * @example\\n * s(\\"hh*10\\").layer(\\n * x => x.degradeBy(0.2).pan(0),\\n * x => x.undegradeBy(0.8).pan(1)\\n * )\\n */","meta":{"filename":"signal.mjs","lineno":769,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Inverse of <code>degradeBy</code>: Randomly removes events from the pattern by a given amount.\\n0 = 100% chance of removal\\n1 = 0% chance of removal\\nEvents that would be removed by degradeBy are let through by undegradeBy and vice versa (see second example).</p>","tags":["temporal"],"name":"undegradeBy","memberof":"Pattern","params":[{"type":{"names":["number"]},"description":"<p>a number between 0 and 1</p>","name":"amount"}],"returns":[{"description":"<p>Pattern</p>"}],"examples":["s(\\"hh*8\\").undegradeBy(0.2)","s(\\"hh*10\\").layer(\\n x => x.degradeBy(0.2).pan(0),\\n x => x.undegradeBy(0.8).pan(1)\\n)"],"scope":"static","longname":"Pattern.undegradeBy","kind":"member"},{"comment":"/**\\n * Inverse of \`degrade\`: Randomly removes 50% of events from the pattern. Shorthand for \`.undegradeBy(0.5)\`\\n * Events that would be removed by degrade are let through by undegrade and vice versa (see second example).\\n *\\n * @tags temporal\\n * @name undegrade\\n * @memberof Pattern\\n * @returns Pattern\\n * @example\\n * s(\\"hh*8\\").undegrade()\\n * @example\\n * s(\\"hh*10\\").layer(\\n * x => x.degrade().pan(0),\\n * x => x.undegrade().pan(1)\\n * )\\n */","meta":{"filename":"signal.mjs","lineno":800,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Inverse of <code>degrade</code>: Randomly removes 50% of events from the pattern. Shorthand for <code>.undegradeBy(0.5)</code>\\nEvents that would be removed by degrade are let through by undegrade and vice versa (see second example).</p>","tags":["temporal"],"name":"undegrade","memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"examples":["s(\\"hh*8\\").undegrade()","s(\\"hh*10\\").layer(\\n x => x.degrade().pan(0),\\n x => x.undegrade().pan(1)\\n)"],"scope":"static","longname":"Pattern.undegrade","kind":"member"},{"comment":"/**\\n *\\n * Randomly applies the given function by the given probability.\\n * Similar to \`someCyclesBy\`\\n *\\n * @tags temporal\\n * @name sometimesBy\\n * @memberof Pattern\\n * @param {number | Pattern} probability - a number between 0 and 1\\n * @param {function} function - the transformation to apply\\n * @returns Pattern\\n * @example\\n * s(\\"hh*8\\").sometimesBy(.4, x=>x.speed(\\"0.5\\"))\\n */","meta":{"filename":"signal.mjs","lineno":818,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Randomly applies the given function by the given probability.\\nSimilar to <code>someCyclesBy</code></p>","tags":["temporal"],"name":"sometimesBy","memberof":"Pattern","params":[{"type":{"names":["number","Pattern"]},"description":"<p>a number between 0 and 1</p>","name":"probability"},{"type":{"names":["function"]},"description":"<p>the transformation to apply</p>","name":"function"}],"returns":[{"description":"<p>Pattern</p>"}],"examples":["s(\\"hh*8\\").sometimesBy(.4, x=>x.speed(\\"0.5\\"))"],"scope":"static","longname":"Pattern.sometimesBy","kind":"member"},{"comment":"/**\\n *\\n * Applies the given function with a 50% chance\\n *\\n * @tags temporal\\n * @name sometimes\\n * @memberof Pattern\\n * @param {function} function - the transformation to apply\\n * @returns Pattern\\n * @example\\n * s(\\"hh*8\\").sometimes(x=>x.speed(\\"0.5\\"))\\n */","meta":{"filename":"signal.mjs","lineno":839,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Applies the given function with a 50% chance</p>","tags":["temporal"],"name":"sometimes","memberof":"Pattern","params":[{"type":{"names":["function"]},"description":"<p>the transformation to apply</p>","name":"function"}],"returns":[{"description":"<p>Pattern</p>"}],"examples":["s(\\"hh*8\\").sometimes(x=>x.speed(\\"0.5\\"))"],"scope":"static","longname":"Pattern.sometimes","kind":"member"},{"comment":"/**\\n *\\n * Randomly applies the given function by the given probability on a cycle by cycle basis.\\n * Similar to \`sometimesBy\`\\n *\\n * @name someCyclesBy\\n * @memberof Pattern\\n * @param {number | Pattern} probability - a number between 0 and 1\\n * @param {function} function - the transformation to apply\\n * @returns Pattern\\n * @tags temporal\\n * @example\\n * s(\\"bd,hh*8\\").someCyclesBy(.3, x=>x.speed(\\"0.5\\"))\\n */","meta":{"filename":"signal.mjs","lineno":855,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Randomly applies the given function by the given probability on a cycle by cycle basis.\\nSimilar to <code>sometimesBy</code></p>","name":"someCyclesBy","memberof":"Pattern","params":[{"type":{"names":["number","Pattern"]},"description":"<p>a number between 0 and 1</p>","name":"probability"},{"type":{"names":["function"]},"description":"<p>the transformation to apply</p>","name":"function"}],"returns":[{"description":"<p>Pattern</p>"}],"tags":["temporal"],"examples":["s(\\"bd,hh*8\\").someCyclesBy(.3, x=>x.speed(\\"0.5\\"))"],"scope":"static","longname":"Pattern.someCyclesBy","kind":"member"},{"comment":"/**\\n *\\n * Shorthand for \`.someCyclesBy(0.5, fn)\`\\n *\\n * @name someCycles\\n * @memberof Pattern\\n * @returns Pattern\\n * @tags temporal\\n * @example\\n * s(\\"bd,hh*8\\").someCycles(x=>x.speed(\\"0.5\\"))\\n */","meta":{"filename":"signal.mjs","lineno":881,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Shorthand for <code>.someCyclesBy(0.5, fn)</code></p>","name":"someCycles","memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"tags":["temporal"],"examples":["s(\\"bd,hh*8\\").someCycles(x=>x.speed(\\"0.5\\"))"],"scope":"static","longname":"Pattern.someCycles","kind":"member"},{"comment":"/**\\n *\\n * Shorthand for \`.sometimesBy(0.75, fn)\`\\n *\\n * @name often\\n * @memberof Pattern\\n * @returns Pattern\\n * @tags temporal\\n * @example\\n * s(\\"hh*8\\").often(x=>x.speed(\\"0.5\\"))\\n */","meta":{"filename":"signal.mjs","lineno":896,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Shorthand for <code>.sometimesBy(0.75, fn)</code></p>","name":"often","memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"tags":["temporal"],"examples":["s(\\"hh*8\\").often(x=>x.speed(\\"0.5\\"))"],"scope":"static","longname":"Pattern.often","kind":"member"},{"comment":"/**\\n *\\n * Shorthand for \`.sometimesBy(0.25, fn)\`\\n *\\n * @name rarely\\n * @memberof Pattern\\n * @returns Pattern\\n * @tags temporal\\n * @example\\n * s(\\"hh*8\\").rarely(x=>x.speed(\\"0.5\\"))\\n */","meta":{"filename":"signal.mjs","lineno":911,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Shorthand for <code>.sometimesBy(0.25, fn)</code></p>","name":"rarely","memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"tags":["temporal"],"examples":["s(\\"hh*8\\").rarely(x=>x.speed(\\"0.5\\"))"],"scope":"static","longname":"Pattern.rarely","kind":"member"},{"comment":"/**\\n *\\n * Shorthand for \`.sometimesBy(0.1, fn)\`\\n *\\n * @tags temporal\\n * @name almostNever\\n * @memberof Pattern\\n * @returns Pattern\\n * @example\\n * s(\\"hh*8\\").almostNever(x=>x.speed(\\"0.5\\"))\\n */","meta":{"filename":"signal.mjs","lineno":926,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Shorthand for <code>.sometimesBy(0.1, fn)</code></p>","tags":["temporal"],"name":"almostNever","memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"examples":["s(\\"hh*8\\").almostNever(x=>x.speed(\\"0.5\\"))"],"scope":"static","longname":"Pattern.almostNever","kind":"member"},{"comment":"/**\\n *\\n * Shorthand for \`.sometimesBy(0.9, fn)\`\\n *\\n * @tags temporal\\n * @name almostAlways\\n * @memberof Pattern\\n * @returns Pattern\\n * @example\\n * s(\\"hh*8\\").almostAlways(x=>x.speed(\\"0.5\\"))\\n */","meta":{"filename":"signal.mjs","lineno":941,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Shorthand for <code>.sometimesBy(0.9, fn)</code></p>","tags":["temporal"],"name":"almostAlways","memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"examples":["s(\\"hh*8\\").almostAlways(x=>x.speed(\\"0.5\\"))"],"scope":"static","longname":"Pattern.almostAlways","kind":"member"},{"comment":"/**\\n *\\n * Shorthand for \`.sometimesBy(0, fn)\` (never calls fn)\\n *\\n * @tags temporal\\n * @name never\\n * @memberof Pattern\\n * @returns Pattern\\n * @example\\n * s(\\"hh*8\\").never(x=>x.speed(\\"0.5\\"))\\n */","meta":{"filename":"signal.mjs","lineno":956,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Shorthand for <code>.sometimesBy(0, fn)</code> (never calls fn)</p>","tags":["temporal"],"name":"never","memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"examples":["s(\\"hh*8\\").never(x=>x.speed(\\"0.5\\"))"],"scope":"static","longname":"Pattern.never","kind":"member"},{"comment":"/**\\n *\\n * Shorthand for \`.sometimesBy(1, fn)\` (always calls fn)\\n *\\n * @tags temporal\\n * @name always\\n * @memberof Pattern\\n * @returns Pattern\\n * @example\\n * s(\\"hh*8\\").always(x=>x.speed(\\"0.5\\"))\\n */","meta":{"filename":"signal.mjs","lineno":971,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Shorthand for <code>.sometimesBy(1, fn)</code> (always calls fn)</p>","tags":["temporal"],"name":"always","memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"examples":["s(\\"hh*8\\").always(x=>x.speed(\\"0.5\\"))"],"scope":"static","longname":"Pattern.always","kind":"member"},{"comment":"/**\\n *\\n * Do something on a keypress, or array of keypresses\\n * [Key name reference](https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values)\\n *\\n * @tags external_io\\n * @name whenKey\\n * @memberof Pattern\\n * @returns Pattern\\n * @example\\n * s(\\"bd(5,8)\\").whenKey(\\"Control:j\\", x => x.segment(16).color(\\"red\\")).whenKey(\\"Control:i\\", x => x.fast(2).color(\\"blue\\"))\\n */","meta":{"filename":"signal.mjs","lineno":999,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>Do something on a keypress, or array of keypresses\\n<a href=\\"https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values\\">Key name reference</a></p>","tags":["external_io"],"name":"whenKey","memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"examples":["s(\\"bd(5,8)\\").whenKey(\\"Control:j\\", x => x.segment(16).color(\\"red\\")).whenKey(\\"Control:i\\", x => x.fast(2).color(\\"blue\\"))"],"scope":"static","longname":"Pattern.whenKey","kind":"member"},{"comment":"/**\\n *\\n * returns true when a key or array of keys is held\\n * [Key name reference](https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values)\\n *\\n * @tags external_io\\n * @name keyDown\\n * @memberof Pattern\\n * @returns Pattern\\n * @example\\n * keyDown(\\"Control:j\\").pick([s(\\"bd(5,8)\\"), s(\\"cp(3,8)\\")])\\n */","meta":{"filename":"signal.mjs","lineno":1016,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{}},"description":"<p>returns true when a key or array of keys is held\\n<a href=\\"https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values\\">Key name reference</a></p>","tags":["external_io"],"name":"keyDown","memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"examples":["keyDown(\\"Control:j\\").pick([s(\\"bd(5,8)\\"), s(\\"cp(3,8)\\")])"],"scope":"static","longname":"Pattern.keyDown","kind":"member"},{"comment":"/**\\n * A pattern measuring the duration of events,\\n * in cycles per event. \`cyclesPer\` doesn't have structure itself, but takes structure, and therefore\\n * event durations, from the pattern that it is combined with.\\n * For example \`cyclesPer.struct(\\"1 1 [1 1] 1\\")\` would give the same as \`\\"0.25 0.25 [0.125 0.125] 0.25\\"\`.\\n * See also its reciprocal, \`per\`, also known as \`perCycle\`.\\n *\\n * @tags temporal\\n * @example\\n * // Shorter events are lower in pitch\\n * sound(\\"saw saw [saw saw] saw\\")\\n * .note(cyclesPer.range(50, 100))\\n * @example\\n * sound(\\"bd sd [bd bd] sd*4 [- sd] [bd [bd bd]]\\")\\n * .note(cyclesPer.add(20))\\n */","meta":{"range":[28401,28524],"filename":"signal.mjs","lineno":1049,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100046217","name":"exports.cyclesPer","type":"VariableDeclaration"}},"description":"<p>A pattern measuring the duration of events,\\nin cycles per event. <code>cyclesPer</code> doesn't have structure itself, but takes structure, and therefore\\nevent durations, from the pattern that it is combined with.\\nFor example <code>cyclesPer.struct("1 1 [1 1] 1")</code> would give the same as <code>"0.25 0.25 [0.125 0.125] 0.25"</code>.\\nSee also its reciprocal, <code>per</code>, also known as <code>perCycle</code>.</p>","tags":["temporal"],"examples":["// Shorter events are lower in pitch\\nsound(\\"saw saw [saw saw] saw\\")\\n .note(cyclesPer.range(50, 100))","sound(\\"bd sd [bd bd] sd*4 [- sd] [bd [bd bd]]\\")\\n .note(cyclesPer.add(20))"],"name":"cyclesPer","longname":"cyclesPer","kind":"constant","scope":"global"},{"comment":"/**\\n * A pattern measuring the 'shortness' of events, or in other words, the duration of pattern events,\\n * in events per cycle. \`per\` doesn't have structure itself, but takes structure, and therefore\\n * event durations, from the pattern that it is combined with.\\n * For example \`per.struct(\\"1 1 [1 1] 1\\")\` would give the same as \`\\"4 4 [8 8] 4\\"\`.\\n * See also its reciprocal, \`cyclesPer\`.\\n * @tags temporal\\n * @synonyms perCycle\\n * @example\\n * // Shorter events are more distorted\\n * n(\\"0 0*2 0 0*2 0 [0 0 0]@2\\").sound(\\"bd\\")\\n * .distort(per.div(2))\\n */","meta":{"range":[29079,29213],"filename":"signal.mjs","lineno":1066,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100046239","name":"exports.per","type":"VariableDeclaration"}},"description":"<p>A pattern measuring the 'shortness' of events, or in other words, the duration of pattern events,\\nin events per cycle. <code>per</code> doesn't have structure itself, but takes structure, and therefore\\nevent durations, from the pattern that it is combined with.\\nFor example <code>per.struct("1 1 [1 1] 1")</code> would give the same as <code>"4 4 [8 8] 4"</code>.\\nSee also its reciprocal, <code>cyclesPer</code>.</p>","tags":["temporal"],"synonyms_text":"perCycle","synonyms":["perCycle"],"examples":["// Shorter events are more distorted\\nn(\\"0 0*2 0 0*2 0 [0 0 0]@2\\").sound(\\"bd\\")\\n .distort(per.div(2))"],"name":"per","longname":"per","kind":"constant","scope":"global"},{"comment":"/**\\n * Like \`per\` but measures the shortness of events according to an exponential curve. In\\n * particular, where the event duration halves, the\\n * returned value increases by one. \`perx.struct(\\"1 1 [1 [1 1]] 1\\")\` would therefore be\\n * the same as \`\\"3 3 [4 [5 5]] 3\\"\`.\\n * @tags temporal\\n */","meta":{"range":[29536,29714],"filename":"signal.mjs","lineno":1079,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100046272","name":"exports.perx","type":"VariableDeclaration"}},"description":"<p>Like <code>per</code> but measures the shortness of events according to an exponential curve. In\\nparticular, where the event duration halves, the\\nreturned value increases by one. <code>perx.struct("1 1 [1 [1 1]] 1")</code> would therefore be\\nthe same as <code>"3 3 [4 [5 5]] 3"</code>.</p>","tags":["temporal"],"name":"perx","longname":"perx","kind":"constant","scope":"global"},{"comment":"/**\\n * @deprecated does not appear to be referenced or invoked anywhere in the codebase\\n * @noAutocomplete\\n */","meta":{"range":[2921,3088],"filename":"util.mjs","lineno":77,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100059846","name":"exports.getFreq","type":"VariableDeclaration"}},"deprecated":"does not appear to be referenced or invoked anywhere in the codebase","tags":[{"originalTitle":"noAutocomplete","title":"noautocomplete","text":""}],"name":"getFreq","longname":"getFreq","kind":"constant","scope":"global"},{"comment":"/**\\n * @deprecated only used in workshop (first-notes)\\n * @noAutocomplete\\n */","meta":{"range":[3247,3366],"filename":"util.mjs","lineno":89,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/core","code":{"id":"astnode100059885","name":"exports.midi2note","type":"VariableDeclaration"}},"deprecated":"only used in workshop (first-notes)","tags":[{"originalTitle":"noAutocomplete","title":"noautocomplete","text":""}],"name":"midi2note","longname":"midi2note","kind":"constant","scope":"global"},{"comment":"/**\\n * Sends notes to Csound for rendering with MIDI semantics. The hap value is\\n * translated to these Csound pfields:\\n *\\n * p1 -- Csound instrument either as a number (1-based, can be a fraction),\\n * or as a string name.\\n * p2 -- time in beats (usually seconds) from start of performance.\\n * p3 -- duration in beats (usually seconds).\\n * p4 -- MIDI key number (as a real number, not an integer but in [0, 127].\\n * p5 -- MIDI velocity (as a real number, not an integer but in [0, 127].\\n * p6 -- Strudel controls, as a string.\\n *\\n * @tags external_io\\n */","meta":{"range":[4703,6087],"filename":"index.mjs","lineno":141,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/csound","code":{"id":"astnode100062524","name":"exports.csoundm","type":"VariableDeclaration"}},"description":"<p>Sends notes to Csound for rendering with MIDI semantics. The hap value is\\ntranslated to these Csound pfields:</p>\\n<p>p1 -- Csound instrument either as a number (1-based, can be a fraction),\\nor as a string name.\\np2 -- time in beats (usually seconds) from start of performance.\\np3 -- duration in beats (usually seconds).\\np4 -- MIDI key number (as a real number, not an integer but in [0, 127].\\np5 -- MIDI velocity (as a real number, not an integer but in [0, 127].\\np6 -- Strudel controls, as a string.</p>","tags":["external_io"],"name":"csoundm","longname":"csoundm","kind":"constant","scope":"global"},{"comment":"/**\\n * Visualises a pattern as a scrolling 'pianoroll', displayed in the background of the editor. To show a pianoroll for all running patterns, use \`all(pianoroll)\`. To have a pianoroll appear below\\n * a pattern instead, prefix with \`_\`, e.g.: \`sound(\\"bd sd\\")._pianoroll()\`.\\n *\\n * @name pianoroll\\n * @synonyms punchcard\\n * @tags visualization\\n * @param {Object} options Object containing all the optional following parameters as key value pairs:\\n * @param {integer} cycles number of cycles to be displayed at the same time - defaults to 4\\n * @param {number} playhead location of the active notes on the time axis - 0 to 1, defaults to 0.5\\n * @param {boolean} vertical displays the roll vertically - 0 by default\\n * @param {boolean} labels displays labels on individual notes (see the label function) - 0 by default\\n * @param {boolean} flipTime reverse the direction of the roll - 0 by default\\n * @param {boolean} flipValues reverse the relative location of notes on the value axis - 0 by default\\n * @param {number} overscan lookup X cycles outside of the cycles window to display notes in advance - 1 by default\\n * @param {boolean} hideNegative hide notes with negative time (before starting playing the pattern) - 0 by default\\n * @param {boolean} smear notes leave a solid trace - 0 by default\\n * @param {boolean} fold notes takes the full value axis width - 0 by default\\n * @param {string} active hexadecimal or CSS color of the active notes - defaults to #FFCA28\\n * @param {string} inactive hexadecimal or CSS color of the inactive notes - defaults to #7491D2\\n * @param {string} background hexadecimal or CSS color of the background - defaults to transparent\\n * @param {string} playheadColor hexadecimal or CSS color of the line representing the play head - defaults to white\\n * @param {boolean} fill notes are filled with color (otherwise only the label is displayed) - 0 by default\\n * @param {boolean} fillActive active notes are filled with color - 0 by default\\n * @param {boolean} stroke notes are shown with colored borders - 0 by default\\n * @param {boolean} strokeActive active notes are shown with colored borders - 0 by default\\n * @param {boolean} hideInactive only active notes are shown - 0 by default\\n * @param {boolean} colorizeInactive use note color for inactive notes - 1 by default\\n * @param {string} fontFamily define the font used by notes labels - defaults to 'monospace'\\n * @param {integer} minMidi minimum note value to display on the value axis - defaults to 10\\n * @param {integer} maxMidi maximum note value to display on the value axis - defaults to 90\\n * @param {boolean} autorange automatically calculate the minMidi and maxMidi parameters - 0 by default\\n * @see _pianoroll\\n * @example\\n * note(\\"c2 a2 eb2\\")\\n * .euclid(5,8)\\n * .s('sawtooth')\\n * .lpenv(4).lpf(300)\\n * .pianoroll({ labels: 1 })\\n */","meta":{"filename":"pianoroll.mjs","lineno":39,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/draw","code":{}},"description":"<p>Visualises a pattern as a scrolling 'pianoroll', displayed in the background of the editor. To show a pianoroll for all running patterns, use <code>all(pianoroll)</code>. To have a pianoroll appear below\\na pattern instead, prefix with <code>_</code>, e.g.: <code>sound("bd sd")._pianoroll()</code>.</p>","name":"pianoroll","synonyms_text":"punchcard","synonyms":["punchcard"],"tags":["visualization"],"params":[{"type":{"names":["Object"]},"description":"<p>Object containing all the optional following parameters as key value pairs:</p>","name":"options"},{"type":{"names":["integer"]},"description":"<p>number of cycles to be displayed at the same time - defaults to 4</p>","name":"cycles"},{"type":{"names":["number"]},"description":"<p>location of the active notes on the time axis - 0 to 1, defaults to 0.5</p>","name":"playhead"},{"type":{"names":["boolean"]},"description":"<p>displays the roll vertically - 0 by default</p>","name":"vertical"},{"type":{"names":["boolean"]},"description":"<p>displays labels on individual notes (see the label function) - 0 by default</p>","name":"labels"},{"type":{"names":["boolean"]},"description":"<p>reverse the direction of the roll - 0 by default</p>","name":"flipTime"},{"type":{"names":["boolean"]},"description":"<p>reverse the relative location of notes on the value axis - 0 by default</p>","name":"flipValues"},{"type":{"names":["number"]},"description":"<p>lookup X cycles outside of the cycles window to display notes in advance - 1 by default</p>","name":"overscan"},{"type":{"names":["boolean"]},"description":"<p>hide notes with negative time (before starting playing the pattern) - 0 by default</p>","name":"hideNegative"},{"type":{"names":["boolean"]},"description":"<p>notes leave a solid trace - 0 by default</p>","name":"smear"},{"type":{"names":["boolean"]},"description":"<p>notes takes the full value axis width - 0 by default</p>","name":"fold"},{"type":{"names":["string"]},"description":"<p>hexadecimal or CSS color of the active notes - defaults to #FFCA28</p>","name":"active"},{"type":{"names":["string"]},"description":"<p>hexadecimal or CSS color of the inactive notes - defaults to #7491D2</p>","name":"inactive"},{"type":{"names":["string"]},"description":"<p>hexadecimal or CSS color of the background - defaults to transparent</p>","name":"background"},{"type":{"names":["string"]},"description":"<p>hexadecimal or CSS color of the line representing the play head - defaults to white</p>","name":"playheadColor"},{"type":{"names":["boolean"]},"description":"<p>notes are filled with color (otherwise only the label is displayed) - 0 by default</p>","name":"fill"},{"type":{"names":["boolean"]},"description":"<p>active notes are filled with color - 0 by default</p>","name":"fillActive"},{"type":{"names":["boolean"]},"description":"<p>notes are shown with colored borders - 0 by default</p>","name":"stroke"},{"type":{"names":["boolean"]},"description":"<p>active notes are shown with colored borders - 0 by default</p>","name":"strokeActive"},{"type":{"names":["boolean"]},"description":"<p>only active notes are shown - 0 by default</p>","name":"hideInactive"},{"type":{"names":["boolean"]},"description":"<p>use note color for inactive notes - 1 by default</p>","name":"colorizeInactive"},{"type":{"names":["string"]},"description":"<p>define the font used by notes labels - defaults to 'monospace'</p>","name":"fontFamily"},{"type":{"names":["integer"]},"description":"<p>minimum note value to display on the value axis - defaults to 10</p>","name":"minMidi"},{"type":{"names":["integer"]},"description":"<p>maximum note value to display on the value axis - defaults to 90</p>","name":"maxMidi"},{"type":{"names":["boolean"]},"description":"<p>automatically calculate the minMidi and maxMidi parameters - 0 by default</p>","name":"autorange"}],"see":["_pianoroll"],"examples":["note(\\"c2 a2 eb2\\")\\n.euclid(5,8)\\n.s('sawtooth')\\n.lpenv(4).lpf(300)\\n.pianoroll({ labels: 1 })"],"longname":"pianoroll","kind":"member","scope":"global"},{"comment":"/**\\n * Displays a vertical pianoroll with event labels.\\n * Supports all the same options as pianoroll.\\n *\\n * @name wordfall\\n * @tags visualization\\n */","meta":{"filename":"pianoroll.mjs","lineno":298,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/draw","code":{}},"description":"<p>Displays a vertical pianoroll with event labels.\\nSupports all the same options as pianoroll.</p>","name":"wordfall","tags":["visualization"],"longname":"wordfall","kind":"member","scope":"global"},{"comment":"/**\\n * Renders a pitch circle to visualize frequencies within one octave\\n * @name pitchwheel\\n * @tags visualization\\n * @param {number} hapcircles\\n * @param {number} circle\\n * @param {number} edo\\n * @param {string} root\\n * @param {number} thickness\\n * @param {number} hapRadius\\n * @param {string} mode\\n * @param {number} margin\\n * @example\\n * n(\\"0 .. 12\\").scale(\\"C:chromatic\\")\\n * .s(\\"sawtooth\\")\\n * .lpf(500)\\n * ._pitchwheel()\\n */","meta":{"filename":"pitchwheel.mjs","lineno":147,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/draw","code":{}},"description":"<p>Renders a pitch circle to visualize frequencies within one octave</p>","name":"pitchwheel","tags":["visualization"],"params":[{"type":{"names":["number"]},"name":"hapcircles"},{"type":{"names":["number"]},"name":"circle"},{"type":{"names":["number"]},"name":"edo"},{"type":{"names":["string"]},"name":"root"},{"type":{"names":["number"]},"name":"thickness"},{"type":{"names":["number"]},"name":"hapRadius"},{"type":{"names":["string"]},"name":"mode"},{"type":{"names":["number"]},"name":"margin"}],"examples":["n(\\"0 .. 12\\").scale(\\"C:chromatic\\")\\n.s(\\"sawtooth\\")\\n.lpf(500)\\n._pitchwheel()"],"longname":"pitchwheel","kind":"member","scope":"global"},{"comment":"/**\\n * Displays a spiral visual.\\n *\\n * @name spiral\\n * @tags visualization\\n * @param {Object} options Object containing all the optional following parameters as key value pairs:\\n * @param {number} stretch controls the rotations per cycle ratio, where 1 = 1 cycle / 360 degrees\\n * @param {number} size the diameter of the spiral\\n * @param {number} thickness line thickness\\n * @param {string} cap style of line ends: butt (default), round, square\\n * @param {string} inset number of rotations before spiral starts (default 3)\\n * @param {string} playheadColor color of playhead, defaults to white\\n * @param {number} playheadLength length of playhead in rotations, defaults to 0.02\\n * @param {number} playheadThickness thickness of playheadrotations, defaults to thickness\\n * @param {number} padding space around spiral\\n * @param {number} steady steadyness of spiral vs playhead. 1 = spiral doesn't move, playhead does.\\n * @param {number} activeColor color of active segment. defaults to foreground of theme\\n * @param {number} inactiveColor color of inactive segments. defaults to gutterForeground of theme\\n * @param {boolean} colorizeInactive wether or not to colorize inactive segments, defaults to 0\\n * @param {boolean} fade wether or not past and future should fade out. defaults to 1\\n * @param {boolean} logSpiral wether or not the spiral should be logarithmic. defaults to 0\\n * @example\\n * note(\\"c2 a2 eb2\\")\\n * .euclid(5,8)\\n * .s('sawtooth')\\n * .lpenv(4).lpf(300)\\n * ._spiral({ steady: .96 })\\n */","meta":{"filename":"spiral.mjs","lineno":128,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/draw","code":{}},"description":"<p>Displays a spiral visual.</p>","name":"spiral","tags":["visualization"],"params":[{"type":{"names":["Object"]},"description":"<p>Object containing all the optional following parameters as key value pairs:</p>","name":"options"},{"type":{"names":["number"]},"description":"<p>controls the rotations per cycle ratio, where 1 = 1 cycle / 360 degrees</p>","name":"stretch"},{"type":{"names":["number"]},"description":"<p>the diameter of the spiral</p>","name":"size"},{"type":{"names":["number"]},"description":"<p>line thickness</p>","name":"thickness"},{"type":{"names":["string"]},"description":"<p>style of line ends: butt (default), round, square</p>","name":"cap"},{"type":{"names":["string"]},"description":"<p>number of rotations before spiral starts (default 3)</p>","name":"inset"},{"type":{"names":["string"]},"description":"<p>color of playhead, defaults to white</p>","name":"playheadColor"},{"type":{"names":["number"]},"description":"<p>length of playhead in rotations, defaults to 0.02</p>","name":"playheadLength"},{"type":{"names":["number"]},"description":"<p>thickness of playheadrotations, defaults to thickness</p>","name":"playheadThickness"},{"type":{"names":["number"]},"description":"<p>space around spiral</p>","name":"padding"},{"type":{"names":["number"]},"description":"<p>steadyness of spiral vs playhead. 1 = spiral doesn't move, playhead does.</p>","name":"steady"},{"type":{"names":["number"]},"description":"<p>color of active segment. defaults to foreground of theme</p>","name":"activeColor"},{"type":{"names":["number"]},"description":"<p>color of inactive segments. defaults to gutterForeground of theme</p>","name":"inactiveColor"},{"type":{"names":["boolean"]},"description":"<p>wether or not to colorize inactive segments, defaults to 0</p>","name":"colorizeInactive"},{"type":{"names":["boolean"]},"description":"<p>wether or not past and future should fade out. defaults to 1</p>","name":"fade"},{"type":{"names":["boolean"]},"description":"<p>wether or not the spiral should be logarithmic. defaults to 0</p>","name":"logSpiral"}],"examples":["note(\\"c2 a2 eb2\\")\\n.euclid(5,8)\\n.s('sawtooth')\\n.lpenv(4).lpf(300)\\n._spiral({ steady: .96 })"],"longname":"spiral","kind":"member","scope":"global"},{"comment":"/**\\n * Turns numbers into notes in the given EDO scale (zero indexed).\\n *\\n * An EDO scale definition looks like this:\\n *\\n * e.g. C:LLsLLLs:2:1 <- this is the C major scale, 12 EDO\\n *\\n * e.g. C:LLsLLL:3:1 <- this is the Gorgo 6 note scale, 16 EDO\\n *\\n * An EDO scale, e.g. C:LLsLLLs:2:1, consists of a root note (e.g. C)\\n * followed by semicolon (':')\\n * and then a [Large/small step notation sequence](https://en.xen.wiki/w/MOS_scale)\\n * (e.g. LLsLLLs)\\n * followed by semicolon, then the large step size (e.g. 2)\\n * followed by semicolon, then the small step size (e.g. 1).\\n *\\n * The number of divisions of the octave is calculated as the sum\\n * of the steps in the EDO scale definition.\\n *\\n * e.g. C:LLsLLLs:2:1 is 2+2+1+2+2+2+1 = 12 EDO, 7 note scale\\n *\\n * e.g. C:LLsLLL:3:1 is 3+3+1+3+3+3 = 16 EDO, 6 note scale\\n *\\n * The root note defaults to octave 3, if no octave number is given.\\n *\\n * @name edoScale\\n * @param {string} scale Definition of EDO scale.\\n * @returns Pattern\\n * @example\\n * n(\\"0 2 4 6 4 2\\").edoScale(\\"C:LLsLLLs:2:1\\")\\n * @example\\n * n(\\"[0,7] 4 [2,7] 4\\")\\n * .edoScale(\\"G2:<LLsLLL LLLLsL>:3:1\\")\\n * .s(\\"piano\\")._pitchwheel()\\n * @example\\n * n(rand.range(0,5).segment(6))\\n * .edoScale(\\"<G2 C3>:LLsLL:3:1\\")\\n * .s(\\"piano\\")._pitchwheel()\\n */","meta":{"filename":"edo.mjs","lineno":14,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/edo","code":{}},"description":"<p>Turns numbers into notes in the given EDO scale (zero indexed).</p>\\n<p>An EDO scale definition looks like this:</p>\\n<p>e.g. C:LLsLLLs:2:1 <- this is the C major scale, 12 EDO</p>\\n<p>e.g. C:LLsLLL:3:1 <- this is the Gorgo 6 note scale, 16 EDO</p>\\n<p>An EDO scale, e.g. C:LLsLLLs:2:1, consists of a root note (e.g. C)\\nfollowed by semicolon (':')\\nand then a <a href=\\"https://en.xen.wiki/w/MOS_scale\\">Large/small step notation sequence</a>\\n(e.g. LLsLLLs)\\nfollowed by semicolon, then the large step size (e.g. 2)\\nfollowed by semicolon, then the small step size (e.g. 1).</p>\\n<p>The number of divisions of the octave is calculated as the sum\\nof the steps in the EDO scale definition.</p>\\n<p>e.g. C:LLsLLLs:2:1 is 2+2+1+2+2+2+1 = 12 EDO, 7 note scale</p>\\n<p>e.g. C:LLsLLL:3:1 is 3+3+1+3+3+3 = 16 EDO, 6 note scale</p>\\n<p>The root note defaults to octave 3, if no octave number is given.</p>","name":"edoScale","params":[{"type":{"names":["string"]},"description":"<p>Definition of EDO scale.</p>","name":"scale"}],"returns":[{"description":"<p>Pattern</p>"}],"examples":["n(\\"0 2 4 6 4 2\\").edoScale(\\"C:LLsLLLs:2:1\\")","n(\\"[0,7] 4 [2,7] 4\\")\\n.edoScale(\\"G2:<LLsLLL LLLLsL>:3:1\\")\\n.s(\\"piano\\")._pitchwheel()","n(rand.range(0,5).segment(6))\\n.edoScale(\\"<G2 C3>:LLsLL:3:1\\")\\n.s(\\"piano\\")._pitchwheel()"],"longname":"edoScale","kind":"member","scope":"global"},{"comment":"/**\\n * MIDI input device wrapper that manages connection and reconnection, tracks\\n * persisted CC states, etc. These instances are long-lived and are maintained as singletons\\n * (keyed globally by input string/number).\\n */","meta":{"range":[1134,6047],"filename":"input.mjs","lineno":16,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/midi","code":{"id":"astnode100073800","name":"exports.MidiInput","type":"ClassDeclaration"}},"name":"MidiInput","longname":"MidiInput","kind":"class","classdesc":"<p>MIDI input device wrapper that manages connection and reconnection, tracks\\npersisted CC states, etc. These instances are long-lived and are maintained as singletons\\n(keyed globally by input string/number).</p>","scope":"global","memberof":"MidiInput","params":[{"type":{"names":["string","number"]},"description":"<p>MIDI device name or index defaulting to 0</p>","name":"input"}]},{"comment":"/**\\n * Implementation for the cc() factory function tied to this specific input.\\n * @param {number} cc MIDI CC number\\n * @param {number | undefined} chan MIDI channel (1-16) or undefined for all channels\\n */","meta":{"range":[1780,2053],"filename":"input.mjs","lineno":38,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/midi","code":{"id":"astnode100073853","name":"MidiInput#createCC","type":"MethodDefinition","paramnames":["cc","chan"]},"vars":{"":null}},"description":"<p>Implementation for the cc() factory function tied to this specific input.</p>","params":[{"type":{"names":["number"]},"description":"<p>MIDI CC number</p>","name":"cc"},{"type":{"names":["number","undefined"]},"description":"<p>MIDI channel (1-16) or undefined for all channels</p>","name":"chan"}],"name":"createCC","longname":"MidiInput#createCC","kind":"function","memberof":"MidiInput","scope":"instance"},{"comment":"/**\\n * configures the default midimap, which is used when no \\"midimap\\" port is set\\n * @tags external_io, midi\\n * @example\\n * defaultmidimap({ lpf: 74 })\\n * $: note(\\"c a f e\\").midi();\\n * $: lpf(sine.slow(4).segment(16)).midi();\\n */","meta":{"range":[3912,4011],"filename":"midi.mjs","lineno":122,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/midi","code":{"id":"astnode100074776","name":"exports.defaultmidimap","type":"FunctionDeclaration","paramnames":["mapping"]}},"description":"<p>configures the default midimap, which is used when no "midimap" port is set</p>","tags":["external_io","midi"],"examples":["defaultmidimap({ lpf: 74 })\\n$: note(\\"c a f e\\").midi();\\n$: lpf(sine.slow(4).segment(16)).midi();"],"name":"defaultmidimap","longname":"defaultmidimap","kind":"function","scope":"global"},{"comment":"/**\\n * Adds midimaps to the registry. Inside each midimap, control names (e.g. lpf) are mapped to cc numbers.\\n * @tags external_io, midi\\n * @example\\n * midimaps({ mymap: { lpf: 74 } })\\n * $: note(\\"c a f e\\")\\n * .lpf(sine.slow(4))\\n * .midimap('mymap')\\n * .midi()\\n * @example\\n * midimaps({ mymap: {\\n * lpf: { ccn: 74, min: 0, max: 20000, exp: 0.5 }\\n * }})\\n * $: note(\\"c a f e\\")\\n * .lpf(sine.slow(2).range(400,2000))\\n * .midimap('mymap')\\n * .midi()\\n */","meta":{"range":[4485,4915],"filename":"midi.mjs","lineno":146,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/midi","code":{"id":"astnode100074794","name":"exports.midimaps","type":"FunctionDeclaration","paramnames":["map"]}},"description":"<p>Adds midimaps to the registry. Inside each midimap, control names (e.g. lpf) are mapped to cc numbers.</p>","tags":["external_io","midi"],"examples":["midimaps({ mymap: { lpf: 74 } })\\n$: note(\\"c a f e\\")\\n.lpf(sine.slow(4))\\n.midimap('mymap')\\n.midi()","midimaps({ mymap: {\\n lpf: { ccn: 74, min: 0, max: 20000, exp: 0.5 }\\n}})\\n$: note(\\"c a f e\\")\\n.lpf(sine.slow(2).range(400,2000))\\n.midimap('mymap')\\n.midi()"],"name":"midimaps","longname":"midimaps","kind":"function","scope":"global"},{"comment":"/**\\n * MIDI output: Opens a MIDI output port.\\n * @tags external_io\\n * @param {string | number} midiport MIDI device name or index defaulting to 0\\n * @param {object} options Additional MIDI configuration options\\n * @example\\n * note(\\"c4\\").midichan(1).midi('IAC Driver Bus 1')\\n * @example\\n * note(\\"c4\\").midichan(1).midi('IAC Driver Bus 1', { controller: true, latency: 50 })\\n */","meta":{"range":[9957,15728],"filename":"midi.mjs","lineno":294,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/midi","code":{"id":"astnode100075466","name":"Pattern.prototype.midi","type":"FunctionExpression","paramnames":["midiport","options"]},"vars":{"undefined":null,"options":"Pattern#midi~options","midiport":"Pattern#midi~midiport","midiConfig":"Pattern#midi~midiConfig","":null}},"description":"<p>MIDI output: Opens a MIDI output port.</p>","tags":["external_io"],"params":[{"type":{"names":["string","number"]},"description":"<p>MIDI device name or index defaulting to 0</p>","name":"midiport"},{"type":{"names":["object"]},"description":"<p>Additional MIDI configuration options</p>","name":"options"}],"examples":["note(\\"c4\\").midichan(1).midi('IAC Driver Bus 1')","note(\\"c4\\").midichan(1).midi('IAC Driver Bus 1', { controller: true, latency: 50 })"],"name":"midi","longname":"Pattern#midi","kind":"function","memberof":"Pattern","scope":"instance"},{"comment":"/**\\n * Initialize a midi input device\\n */","meta":{"range":[15773,16730],"filename":"midi.mjs","lineno":475,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/midi","code":{"id":"astnode100076102","name":"_initializeInput","type":"FunctionDeclaration","paramnames":["input"]},"vars":{"initial":"_initializeInput~initial","instance":"_initializeInput~instance","midiInputs[undefined]":null,"device":"_initializeInput~device","otherInputs":"_initializeInput~otherInputs","":null}},"description":"<p>Initialize a midi input device</p>","name":"_initializeInput","longname":"_initializeInput","kind":"function","scope":"global","params":[],"async":true},{"comment":"/**\\n * MIDI input: Opens a MIDI input port to receive MIDI control change messages.\\n *\\n * The output is a function that accepts a midi cc value to query as well as (optionally) a midi channel\\n *\\n * @name midin\\n * @tags external_io, midi\\n * @param {string | number} input MIDI device name or index defaulting to 0\\n * @returns {function(number, number=): Pattern} A function from (cc, channel?) to a pattern.\\n * When queried, the pattern will produces the most recently received midi value (normalized to 0 to 1)\\n * that came through that cc number (and channel, if provided)\\n * @example\\n * const cc = await midin('IAC Driver Bus 1')\\n * note(\\"c a f e\\").lpf(cc(0).range(0, 1000)).lpq(cc(1).range(0, 10)).sound(\\"sawtooth\\")\\n * @example\\n * const allCC = await midin('IAC Driver Bus 1')\\n * const cc = (ccNum) => allCC(ccNum, 2) // just channel 2\\n * note(\\"c a f e\\").s(\\"saw\\")\\n * .when(cc(0).gt(0), x => x.postgain(0))\\n */","meta":{"filename":"midi.mjs","lineno":508,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/midi","code":{}},"description":"<p>MIDI input: Opens a MIDI input port to receive MIDI control change messages.</p>\\n<p>The output is a function that accepts a midi cc value to query as well as (optionally) a midi channel</p>","name":"midin","tags":["external_io","midi"],"params":[{"type":{"names":["string","number"]},"description":"<p>MIDI device name or index defaulting to 0</p>","name":"input"}],"returns":[{"type":{"names":["function"]},"description":"<p>A function from (cc, channel?) to a pattern.\\nWhen queried, the pattern will produces the most recently received midi value (normalized to 0 to 1)\\nthat came through that cc number (and channel, if provided)</p>"}],"examples":["const cc = await midin('IAC Driver Bus 1')\\nnote(\\"c a f e\\").lpf(cc(0).range(0, 1000)).lpq(cc(1).range(0, 10)).sound(\\"sawtooth\\")","const allCC = await midin('IAC Driver Bus 1')\\nconst cc = (ccNum) => allCC(ccNum, 2) // just channel 2\\nnote(\\"c a f e\\").s(\\"saw\\")\\n .when(cc(0).gt(0), x => x.postgain(0))"],"longname":"midin","kind":"member","scope":"global"},{"comment":"/**\\n * MIDI keyboard: Opens a MIDI input port to receive MIDI keyboard messages.\\n *\\n * The note length is fixed as Superdough is not currently set up for undetermined\\n * note durations\\n *\\n * @name midikeys\\n * @tags external_io, midi\\n * @param {string | number} input MIDI device name or index defaulting to 0\\n * @returns {function((number | Pattern)=): Pattern} A function that produces a pattern.\\n * When queried, the pattern will produces the most recently played midi notes and velocities,\\n * lasting for the specified duration\\n * @example\\n * const kb = await midikeys('Arturia KeyStep 32')\\n * kb().s(\\"tri\\").lpf(80).lpe(6).lpd(0.1).room(2).delay(0.35)\\n * @example\\n * const kb = await midikeys('Arturia KeyStep 32')\\n * kb(\\"0.5 1\\")\\n * .s(\\"saw\\")\\n * .add(note(rand.mul(0.3)))\\n * .lpf(1000).lpe(2).room(0.5)\\n */","meta":{"filename":"midi.mjs","lineno":534,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/midi","code":{}},"description":"<p>MIDI keyboard: Opens a MIDI input port to receive MIDI keyboard messages.</p>\\n<p>The note length is fixed as Superdough is not currently set up for undetermined\\nnote durations</p>","name":"midikeys","tags":["external_io","midi"],"params":[{"type":{"names":["string","number"]},"description":"<p>MIDI device name or index defaulting to 0</p>","name":"input"}],"returns":[{"type":{"names":["function"]},"description":"<p>A function that produces a pattern.\\nWhen queried, the pattern will produces the most recently played midi notes and velocities,\\nlasting for the specified duration</p>"}],"examples":["const kb = await midikeys('Arturia KeyStep 32')\\nkb().s(\\"tri\\").lpf(80).lpe(6).lpd(0.1).room(2).delay(0.35)","const kb = await midikeys('Arturia KeyStep 32')\\nkb(\\"0.5 1\\")\\n .s(\\"saw\\")\\n .add(note(rand.mul(0.3)))\\n .lpf(1000).lpe(2).room(0.5)"],"longname":"midikeys","kind":"member","scope":"global"},{"comment":"/**\\n * Get a string listing device names for error messages.\\n * @param {Input[] | Output[]} devices\\n * @returns {string}\\n */","meta":{"range":[960,1069],"filename":"util.mjs","lineno":14,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/midi","code":{"id":"astnode100076760","name":"exports.getMidiDeviceNamesString","type":"FunctionDeclaration","paramnames":["devices"]}},"description":"<p>Get a string listing device names for error messages.</p>","params":[{"type":{"names":["Array.<Input>","Array.<Output>"]},"name":"devices"}],"returns":[{"type":{"names":["string"]}}],"name":"getMidiDeviceNamesString","longname":"getMidiDeviceNamesString","kind":"function","scope":"global"},{"comment":"/**\\n * Look up a device by index or name. Otherwise return a default device, or fail if none are connected.\\n *\\n * @param {string | number} indexOrName\\n * @param {Input[] | Output[]} devices\\n * @returns {Input | Output | undefined}\\n */","meta":{"range":[1306,2004],"filename":"util.mjs","lineno":25,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/midi","code":{"id":"astnode100076782","name":"exports.getDevice","type":"FunctionDeclaration","paramnames":["indexOrName","devices"]}},"description":"<p>Look up a device by index or name. Otherwise return a default device, or fail if none are connected.</p>","params":[{"type":{"names":["string","number"]},"name":"indexOrName"},{"type":{"names":["Array.<Input>","Array.<Output>"]},"name":"devices"}],"returns":[{"type":{"names":["Input","Output","undefined"]}}],"name":"getDevice","longname":"getDevice","kind":"function","scope":"global"},{"comment":"/**\\n * The accelerometer's x-axis value ranges from 0 to 1.\\n * @name accelerationX\\n * @return {Pattern}\\n * @synonyms accX\\n * @tags external_io\\n * @example\\n * n(accelerationX.segment(4).range(0,7)).scale(\\"C:minor\\")\\n *\\n */","meta":{"filename":"motion.mjs","lineno":5,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/motion","code":{}},"description":"<p>The accelerometer's x-axis value ranges from 0 to 1.</p>","name":"accelerationX","returns":[{"type":{"names":["Pattern"]}}],"synonyms_text":"accX","synonyms":["accX"],"tags":["external_io"],"examples":["n(accelerationX.segment(4).range(0,7)).scale(\\"C:minor\\")"],"longname":"accelerationX","kind":"member","scope":"global"},{"comment":"/**\\n * The accelerometer's y-axis value ranges from 0 to 1.\\n * @name accelerationY\\n * @return {Pattern}\\n * @synonyms accY\\n * @tags external_io\\n * @example\\n * n(accelerationY.segment(4).range(0,7)).scale(\\"C:minor\\")\\n *\\n */","meta":{"filename":"motion.mjs","lineno":16,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/motion","code":{}},"description":"<p>The accelerometer's y-axis value ranges from 0 to 1.</p>","name":"accelerationY","returns":[{"type":{"names":["Pattern"]}}],"synonyms_text":"accY","synonyms":["accY"],"tags":["external_io"],"examples":["n(accelerationY.segment(4).range(0,7)).scale(\\"C:minor\\")"],"longname":"accelerationY","kind":"member","scope":"global"},{"comment":"/**\\n * The accelerometer's z-axis value ranges from 0 to 1.\\n * @name accelerationZ\\n * @return {Pattern}\\n * @synonyms accZ\\n * @tags external_io\\n * @example\\n * n(accelerationZ.segment(4).range(0,7)).scale(\\"C:minor\\")\\n *\\n */","meta":{"filename":"motion.mjs","lineno":27,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/motion","code":{}},"description":"<p>The accelerometer's z-axis value ranges from 0 to 1.</p>","name":"accelerationZ","returns":[{"type":{"names":["Pattern"]}}],"synonyms_text":"accZ","synonyms":["accZ"],"tags":["external_io"],"examples":["n(accelerationZ.segment(4).range(0,7)).scale(\\"C:minor\\")"],"longname":"accelerationZ","kind":"member","scope":"global"},{"comment":"/**\\n * The device's gravity x-axis value ranges from 0 to 1.\\n * @name gravityX\\n * @return {Pattern}\\n * @synonyms gravX\\n * @tags external_io\\n * @example\\n * n(gravityX.segment(4).range(0,7)).scale(\\"C:minor\\")\\n *\\n */","meta":{"filename":"motion.mjs","lineno":38,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/motion","code":{}},"description":"<p>The device's gravity x-axis value ranges from 0 to 1.</p>","name":"gravityX","returns":[{"type":{"names":["Pattern"]}}],"synonyms_text":"gravX","synonyms":["gravX"],"tags":["external_io"],"examples":["n(gravityX.segment(4).range(0,7)).scale(\\"C:minor\\")"],"longname":"gravityX","kind":"member","scope":"global"},{"comment":"/**\\n * The device's gravity y-axis value ranges from 0 to 1.\\n * @name gravityY\\n * @return {Pattern}\\n * @synonyms gravY\\n * @tags external_io\\n * @example\\n * n(gravityY.segment(4).range(0,7)).scale(\\"C:minor\\")\\n *\\n */","meta":{"filename":"motion.mjs","lineno":49,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/motion","code":{}},"description":"<p>The device's gravity y-axis value ranges from 0 to 1.</p>","name":"gravityY","returns":[{"type":{"names":["Pattern"]}}],"synonyms_text":"gravY","synonyms":["gravY"],"tags":["external_io"],"examples":["n(gravityY.segment(4).range(0,7)).scale(\\"C:minor\\")"],"longname":"gravityY","kind":"member","scope":"global"},{"comment":"/**\\n * The device's gravity z-axis value ranges from 0 to 1.\\n * @name gravityZ\\n * @return {Pattern}\\n * @synonyms gravZ\\n * @tags external_io\\n * @example\\n * n(gravityZ.segment(4).range(0,7)).scale(\\"C:minor\\")\\n *\\n */","meta":{"filename":"motion.mjs","lineno":60,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/motion","code":{}},"description":"<p>The device's gravity z-axis value ranges from 0 to 1.</p>","name":"gravityZ","returns":[{"type":{"names":["Pattern"]}}],"synonyms_text":"gravZ","synonyms":["gravZ"],"tags":["external_io"],"examples":["n(gravityZ.segment(4).range(0,7)).scale(\\"C:minor\\")"],"longname":"gravityZ","kind":"member","scope":"global"},{"comment":"/**\\n * The device's rotation around the alpha-axis value ranges from 0 to 1.\\n * @name rotationAlpha\\n * @return {Pattern}\\n * @synonyms rotA, rotZ, rotationZ\\n * @tags external_io\\n * @example\\n * n(rotationAlpha.segment(4).range(0,7)).scale(\\"C:minor\\")\\n *\\n */","meta":{"filename":"motion.mjs","lineno":71,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/motion","code":{}},"description":"<p>The device's rotation around the alpha-axis value ranges from 0 to 1.</p>","name":"rotationAlpha","returns":[{"type":{"names":["Pattern"]}}],"synonyms_text":"rotA, rotZ, rotationZ","synonyms":["rotA","rotZ","rotationZ"],"tags":["external_io"],"examples":["n(rotationAlpha.segment(4).range(0,7)).scale(\\"C:minor\\")"],"longname":"rotationAlpha","kind":"member","scope":"global"},{"comment":"/**\\n * The device's rotation around the beta-axis value ranges from 0 to 1.\\n * @name rotationBeta\\n * @return {Pattern}\\n * @synonyms rotB, rotX, rotationX\\n * @tags external_io\\n * @example\\n * n(rotationBeta.segment(4).range(0,7)).scale(\\"C:minor\\")\\n *\\n */","meta":{"filename":"motion.mjs","lineno":82,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/motion","code":{}},"description":"<p>The device's rotation around the beta-axis value ranges from 0 to 1.</p>","name":"rotationBeta","returns":[{"type":{"names":["Pattern"]}}],"synonyms_text":"rotB, rotX, rotationX","synonyms":["rotB","rotX","rotationX"],"tags":["external_io"],"examples":["n(rotationBeta.segment(4).range(0,7)).scale(\\"C:minor\\")"],"longname":"rotationBeta","kind":"member","scope":"global"},{"comment":"/**\\n * The device's rotation around the gamma-axis value ranges from 0 to 1.\\n * @name rotationGamma\\n * @return {Pattern}\\n * @synonyms rotG, rotY, rotationY\\n * @tags external_io\\n * @example\\n * n(rotationGamma.segment(4).range(0,7)).scale(\\"C:minor\\")\\n *\\n */","meta":{"filename":"motion.mjs","lineno":93,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/motion","code":{}},"description":"<p>The device's rotation around the gamma-axis value ranges from 0 to 1.</p>","name":"rotationGamma","returns":[{"type":{"names":["Pattern"]}}],"synonyms_text":"rotG, rotY, rotationY","synonyms":["rotG","rotY","rotationY"],"tags":["external_io"],"examples":["n(rotationGamma.segment(4).range(0,7)).scale(\\"C:minor\\")"],"longname":"rotationGamma","kind":"member","scope":"global"},{"comment":"/**\\n * The device's orientation alpha value ranges from 0 to 1.\\n * @name orientationAlpha\\n * @return {Pattern}\\n * @synonyms oriA, oriZ, orientationZ\\n * @tags external_io\\n * @example\\n * n(orientationAlpha.segment(4).range(0,7)).scale(\\"C:minor\\")\\n *\\n */","meta":{"filename":"motion.mjs","lineno":104,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/motion","code":{}},"description":"<p>The device's orientation alpha value ranges from 0 to 1.</p>","name":"orientationAlpha","returns":[{"type":{"names":["Pattern"]}}],"synonyms_text":"oriA, oriZ, orientationZ","synonyms":["oriA","oriZ","orientationZ"],"tags":["external_io"],"examples":["n(orientationAlpha.segment(4).range(0,7)).scale(\\"C:minor\\")"],"longname":"orientationAlpha","kind":"member","scope":"global"},{"comment":"/**\\n * The device's orientation beta value ranges from 0 to 1.\\n * @name orientationBeta\\n * @return {Pattern}\\n * @synonyms oriB, oriX, orientationX\\n * @tags external_io\\n * @example\\n * n(orientationBeta.segment(4).range(0,7)).scale(\\"C:minor\\")\\n *\\n */","meta":{"filename":"motion.mjs","lineno":115,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/motion","code":{}},"description":"<p>The device's orientation beta value ranges from 0 to 1.</p>","name":"orientationBeta","returns":[{"type":{"names":["Pattern"]}}],"synonyms_text":"oriB, oriX, orientationX","synonyms":["oriB","oriX","orientationX"],"tags":["external_io"],"examples":["n(orientationBeta.segment(4).range(0,7)).scale(\\"C:minor\\")"],"longname":"orientationBeta","kind":"member","scope":"global"},{"comment":"/**\\n * The device's orientation gamma value ranges from 0 to 1.\\n * @name orientationGamma\\n * @return {Pattern}\\n * @synonyms oriG, oriY, orientationY\\n * @tags external_io\\n * @example\\n * n(orientationGamma.segment(4).range(0,7)).scale(\\"C:minor\\")\\n *\\n */","meta":{"filename":"motion.mjs","lineno":126,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/motion","code":{}},"description":"<p>The device's orientation gamma value ranges from 0 to 1.</p>","name":"orientationGamma","returns":[{"type":{"names":["Pattern"]}}],"synonyms_text":"oriG, oriY, orientationY","synonyms":["oriG","oriY","orientationY"],"tags":["external_io"],"examples":["n(orientationGamma.segment(4).range(0,7)).scale(\\"C:minor\\")"],"longname":"orientationGamma","kind":"member","scope":"global"},{"comment":"/**\\n * The device's absolute orientation alpha value ranges from 0 to 1.\\n * @name absoluteOrientationAlpha\\n * @return {Pattern}\\n * @synonyms absOriA, absOriZ, absoluteOrientationZ\\n * @tags external_io\\n * @example\\n * n(absoluteOrientationAlpha.segment(4).range(0,7)).scale(\\"C:minor\\")\\n *\\n */","meta":{"filename":"motion.mjs","lineno":137,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/motion","code":{}},"description":"<p>The device's absolute orientation alpha value ranges from 0 to 1.</p>","name":"absoluteOrientationAlpha","returns":[{"type":{"names":["Pattern"]}}],"synonyms_text":"absOriA, absOriZ, absoluteOrientationZ","synonyms":["absOriA","absOriZ","absoluteOrientationZ"],"tags":["external_io"],"examples":["n(absoluteOrientationAlpha.segment(4).range(0,7)).scale(\\"C:minor\\")"],"longname":"absoluteOrientationAlpha","kind":"member","scope":"global"},{"comment":"/**\\n * The device's absolute orientation beta value ranges from 0 to 1.\\n * @name absoluteOrientationBeta\\n * @return {Pattern}\\n * @synonyms absOriB, absOriX, absoluteOrientationX\\n * @tags external_io\\n * @example\\n * n(absoluteOrientationBeta.segment(4).range(0,7)).scale(\\"C:minor\\")\\n *\\n */","meta":{"filename":"motion.mjs","lineno":148,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/motion","code":{}},"description":"<p>The device's absolute orientation beta value ranges from 0 to 1.</p>","name":"absoluteOrientationBeta","returns":[{"type":{"names":["Pattern"]}}],"synonyms_text":"absOriB, absOriX, absoluteOrientationX","synonyms":["absOriB","absOriX","absoluteOrientationX"],"tags":["external_io"],"examples":["n(absoluteOrientationBeta.segment(4).range(0,7)).scale(\\"C:minor\\")"],"longname":"absoluteOrientationBeta","kind":"member","scope":"global"},{"comment":"/**\\n * The device's absolute orientation gamma value ranges from 0 to 1.\\n * @name absoluteOrientationGamma\\n * @return {Pattern}\\n * @synonyms absOriG, absOriY, absoluteOrientationY\\n * @tags external_io\\n * @example\\n * n(absoluteOrientationGamma.segment(4).range(0,7)).scale(\\"C:minor\\")\\n *\\n */","meta":{"filename":"motion.mjs","lineno":159,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/motion","code":{}},"description":"<p>The device's absolute orientation gamma value ranges from 0 to 1.</p>","name":"absoluteOrientationGamma","returns":[{"type":{"names":["Pattern"]}}],"synonyms_text":"absOriG, absOriY, absoluteOrientationY","synonyms":["absOriG","absOriY","absoluteOrientationY"],"tags":["external_io"],"examples":["n(absoluteOrientationGamma.segment(4).range(0,7)).scale(\\"C:minor\\")"],"longname":"absoluteOrientationGamma","kind":"member","scope":"global"},{"comment":"/**\\n *\\n * Sends each hap as an OSC message, which can be picked up by SuperCollider or any other OSC-enabled software.\\n * For more info, read [MIDI & OSC in the docs](https://strudel.cc/learn/input-output/)\\n *\\n * @name osc\\n * @tags external_io\\n * @memberof Pattern\\n * @returns Pattern\\n */","meta":{"filename":"osc.mjs","lineno":76,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/osc","code":{}},"description":"<p>Sends each hap as an OSC message, which can be picked up by SuperCollider or any other OSC-enabled software.\\nFor more info, read <a href=\\"https://strudel.cc/learn/input-output/\\">MIDI & OSC in the docs</a></p>","name":"osc","tags":["external_io"],"memberof":"Pattern","returns":[{"description":"<p>Pattern</p>"}],"scope":"static","longname":"Pattern.osc","kind":"member"},{"comment":"/** Overlap-Add Node */","meta":{"range":[150,6686],"filename":"ola-processor.js","lineno":7,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough","code":{"id":"astnode100115686","name":"OLAProcessor","type":"ClassDeclaration","paramnames":["options"]}},"name":"OLAProcessor","longname":"OLAProcessor","kind":"class","classdesc":"<p>Overlap-Add Node</p>","scope":"global"},{"comment":"/** Handles dynamic reallocation of input/output channels buffer\\n * (channel numbers may vary during lifecycle)\\n * @tags internals\\n **/","meta":{"range":[1453,1921],"filename":"ola-processor.js","lineno":41,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough","code":{"id":"astnode100115839","name":"OLAProcessor#reallocateChannelsIfNeeded","type":"MethodDefinition","paramnames":["inputs","outputs"]},"vars":{"":null}},"description":"<p>Handles dynamic reallocation of input/output channels buffer\\n(channel numbers may vary during lifecycle)</p>","tags":["internals"],"name":"reallocateChannelsIfNeeded","longname":"OLAProcessor#reallocateChannelsIfNeeded","kind":"function","memberof":"OLAProcessor","scope":"instance","params":[]},{"comment":"/**\\n * Read next web audio block to input buffers\\n * @tags internals\\n **/","meta":{"range":[3587,4175],"filename":"ola-processor.js","lineno":97,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough","code":{"id":"astnode100116146","name":"OLAProcessor#readInputs","type":"MethodDefinition","paramnames":["inputs"]},"vars":{"":null}},"description":"<p>Read next web audio block to input buffers</p>","tags":["internals"],"name":"readInputs","longname":"OLAProcessor#readInputs","kind":"function","memberof":"OLAProcessor","scope":"instance","params":[]},{"comment":"/** Write next web audio block from output buffers\\n * @tags internals\\n **/","meta":{"range":[4260,4538],"filename":"ola-processor.js","lineno":119,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough","code":{"id":"astnode100116267","name":"OLAProcessor#writeOutputs","type":"MethodDefinition","paramnames":["outputs"]},"vars":{"":null}},"description":"<p>Write next web audio block from output buffers</p>","tags":["internals"],"name":"writeOutputs","longname":"OLAProcessor#writeOutputs","kind":"function","memberof":"OLAProcessor","scope":"instance","params":[]},{"comment":"/** Shift left content of input buffers to receive new web audio block\\n * @tags internals\\n **/","meta":{"range":[4643,4858],"filename":"ola-processor.js","lineno":131,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough","code":{"id":"astnode100116327","name":"OLAProcessor#shiftInputBuffers","type":"MethodDefinition","paramnames":[]},"vars":{"":null}},"description":"<p>Shift left content of input buffers to receive new web audio block</p>","tags":["internals"],"name":"shiftInputBuffers","longname":"OLAProcessor#shiftInputBuffers","kind":"function","memberof":"OLAProcessor","scope":"instance","params":[]},{"comment":"/** Shift left content of output buffers to receive new web audio block\\n * @tags internals\\n **/","meta":{"range":[4964,5272],"filename":"ola-processor.js","lineno":142,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough","code":{"id":"astnode100116374","name":"OLAProcessor#shiftOutputBuffers","type":"MethodDefinition","paramnames":[]},"vars":{"":null}},"description":"<p>Shift left content of output buffers to receive new web audio block</p>","tags":["internals"],"name":"shiftOutputBuffers","longname":"OLAProcessor#shiftOutputBuffers","kind":"function","memberof":"OLAProcessor","scope":"instance","params":[]},{"comment":"/** Copy contents of input buffers to buffer actually sent to process\\n * @tags internals\\n **/","meta":{"range":[5376,5603],"filename":"ola-processor.js","lineno":154,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough","code":{"id":"astnode100116441","name":"OLAProcessor#prepareInputBuffersToSend","type":"MethodDefinition","paramnames":[]},"vars":{"":null}},"description":"<p>Copy contents of input buffers to buffer actually sent to process</p>","tags":["internals"],"name":"prepareInputBuffersToSend","longname":"OLAProcessor#prepareInputBuffersToSend","kind":"function","memberof":"OLAProcessor","scope":"instance","params":[]},{"comment":"/** Add contents of output buffers just processed to output buffers\\n * @tags internals\\n **/","meta":{"range":[5705,6025],"filename":"ola-processor.js","lineno":165,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough","code":{"id":"astnode100116493","name":"OLAProcessor#handleOutputBuffersToRetrieve","type":"MethodDefinition","paramnames":[]},"vars":{"":null}},"description":"<p>Add contents of output buffers just processed to output buffers</p>","tags":["internals"],"name":"handleOutputBuffersToRetrieve","longname":"OLAProcessor#handleOutputBuffersToRetrieve","kind":"function","memberof":"OLAProcessor","scope":"instance","params":[]},{"comment":"/** Generates a reverb impulse response.\\n\\n @tags internals\\n @param {!Object} params TODO: Document the properties.\\n @param {!function(!AudioBuffer)} callback Function to call when\\n the impulse response has been generated. The impulse response\\n is passed to this function as its parameter. May be called\\n immediately within the current execution context, or later. */","meta":{"range":[1037,2206],"filename":"reverbGen.mjs","lineno":27,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough","code":{"id":"astnode100116982","name":"reverbGen.generateReverb","type":"FunctionExpression","paramnames":["params","callback"]},"vars":{"audioContext":"reverbGen.generateReverb~audioContext","sampleRate":"reverbGen.generateReverb~sampleRate","numChannels":"reverbGen.generateReverb~numChannels","totalTime":"reverbGen.generateReverb~totalTime","decaySampleFrames":"reverbGen.generateReverb~decaySampleFrames","numSampleFrames":"reverbGen.generateReverb~numSampleFrames","fadeInSampleFrames":"reverbGen.generateReverb~fadeInSampleFrames","decayBase":"reverbGen.generateReverb~decayBase","reverbIR":"reverbGen.generateReverb~reverbIR","i":"reverbGen.generateReverb~i","chan":"reverbGen.generateReverb~chan","j":"reverbGen.generateReverb~j","chan[undefined]":"reverbGen.generateReverb~chan.undefined]"}},"description":"<p>Generates a reverb impulse response.</p>","tags":["internals"],"params":[{"type":{"names":["Object"]},"nullable":false,"description":"<p>TODO: Document the properties.</p>","name":"params"},{"type":{"names":["function"]},"nullable":false,"description":"<p>Function to call when\\nthe impulse response has been generated. The impulse response\\nis passed to this function as its parameter. May be called\\nimmediately within the current execution context, or later.</p>","name":"callback"}],"name":"generateReverb","longname":"reverbGen.generateReverb","kind":"function","memberof":"reverbGen","scope":"static"},{"comment":"/** Creates a canvas element showing a graph of the given data.\\n\\n @tags internals\\n @param {!Float32Array} data An array of numbers, or a Float32Array.\\n @param {number} width Width in pixels of the canvas.\\n @param {number} height Height in pixels of the canvas.\\n @param {number} min Minimum value of data for the graph (lower edge).\\n @param {number} max Maximum value of data in the graph (upper edge).\\n @return {!CanvasElement} The generated canvas element. */","meta":{"range":[2670,3181],"filename":"reverbGen.mjs","lineno":61,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough","code":{"id":"astnode100117162","name":"reverbGen.generateGraph","type":"FunctionExpression","paramnames":["data","width","height","min","max"]},"vars":{"canvas":"reverbGen.generateGraph~canvas","canvas.width":"reverbGen.generateGraph~canvas.width","canvas.height":"reverbGen.generateGraph~canvas.height","gc":"reverbGen.generateGraph~gc","gc.fillStyle":"reverbGen.generateGraph~gc.fillStyle","xscale":"reverbGen.generateGraph~xscale","yscale":"reverbGen.generateGraph~yscale","i":"reverbGen.generateGraph~i"}},"description":"<p>Creates a canvas element showing a graph of the given data.</p>","tags":["internals"],"params":[{"type":{"names":["Float32Array"]},"nullable":false,"description":"<p>An array of numbers, or a Float32Array.</p>","name":"data"},{"type":{"names":["number"]},"description":"<p>Width in pixels of the canvas.</p>","name":"width"},{"type":{"names":["number"]},"description":"<p>Height in pixels of the canvas.</p>","name":"height"},{"type":{"names":["number"]},"description":"<p>Minimum value of data for the graph (lower edge).</p>","name":"min"},{"type":{"names":["number"]},"description":"<p>Maximum value of data in the graph (upper edge).</p>","name":"max"}],"returns":[{"type":{"names":["CanvasElement"]},"nullable":false,"description":"<p>The generated canvas element.</p>"}],"name":"generateGraph","longname":"reverbGen.generateGraph","kind":"function","memberof":"reverbGen","scope":"static"},{"comment":"/** Applies a constantly changing lowpass filter to the given sound.\\n\\n @private\\n @param {!AudioBuffer} input\\n @param {number} lpFreqStart\\n @param {number} lpFreqEnd\\n @param {number} lpFreqEndAt\\n @param {!function(!AudioBuffer)} callback May be called\\n immediately within the current execution context, or later.\\n @tags internals\\n */","meta":{"range":[3523,4521],"filename":"reverbGen.mjs","lineno":88,"columnno":4,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough","code":{"id":"astnode100117277","name":"applyGradualLowpass","type":"FunctionExpression"},"vars":{"channelData":"applyGradualLowpass~channelData","context":"applyGradualLowpass~context","player":"applyGradualLowpass~player","player.buffer":"applyGradualLowpass~player.buffer","filter":"applyGradualLowpass~filter","lpFreqStart":"applyGradualLowpass~lpFreqStart","lpFreqEnd":"applyGradualLowpass~lpFreqEnd","filter.type":"applyGradualLowpass~filter.type","filter.Q.value":"applyGradualLowpass~filter.Q.value","context.oncomplete":"applyGradualLowpass~context.oncomplete","":null,"window.filterNode":"window.filterNode"}},"description":"<p>Applies a constantly changing lowpass filter to the given sound.</p>","access":"private","params":[{"type":{"names":["AudioBuffer"]},"nullable":false,"name":"input"},{"type":{"names":["number"]},"name":"lpFreqStart"},{"type":{"names":["number"]},"name":"lpFreqEnd"},{"type":{"names":["number"]},"name":"lpFreqEndAt"},{"type":{"names":["function"]},"nullable":false,"description":"<p>May be called\\nimmediately within the current execution context, or later.</p>","name":"callback"}],"tags":["internals"],"name":"applyGradualLowpass","longname":"applyGradualLowpass","kind":"function","scope":"global"},{"comment":"/** @private\\n @param {!AudioBuffer} buffer\\n @return {!Array.<!Float32Array>} An array containing the Float32Array of each channel's samples. */","meta":{"range":[4672,4855],"filename":"reverbGen.mjs","lineno":123,"columnno":4,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough","code":{"id":"astnode100117449","name":"getAllChannelData","type":"FunctionExpression"},"vars":{"channels":"getAllChannelData~channels","i":"getAllChannelData~i","channels[undefined]":"getAllChannelData~channels.undefined]"}},"access":"private","params":[{"type":{"names":["AudioBuffer"]},"nullable":false,"name":"buffer"}],"returns":[{"type":{"names":["Array.<!Float32Array>"]},"nullable":false,"description":"<p>An array containing the Float32Array of each channel's samples.</p>"}],"name":"getAllChannelData","longname":"getAllChannelData","kind":"function","scope":"global"},{"comment":"/** @private\\n @return {number} A random number from -1 to 1. */","meta":{"range":[4926,4988],"filename":"reverbGen.mjs","lineno":133,"columnno":4,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough","code":{"id":"astnode100117484","name":"randomSample","type":"FunctionExpression"}},"access":"private","returns":[{"type":{"names":["number"]},"description":"<p>A random number from -1 to 1.</p>"}],"name":"randomSample","longname":"randomSample","kind":"function","scope":"global","params":[]},{"comment":"/**\\n * Loads a collection of samples to use with \`s\`\\n * @tags samples\\n * @example\\n * samples('github:tidalcycles/dirt-samples');\\n * s(\\"[bd ~]*2, [~ hh]*2, ~ sd\\")\\n * @example\\n * samples({\\n * bd: '808bd/BD0000.WAV',\\n * sd: '808sd/SD0010.WAV'\\n * }, 'https://raw.githubusercontent.com/tidalcycles/Dirt-Samples/master/');\\n * s(\\"[bd ~]*2, [~ hh]*2, ~ sd\\")\\n */","meta":{"range":[8197,8629],"filename":"sampler.mjs","lineno":250,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough","code":{"id":"astnode100118651","name":"exports.samples","type":"VariableDeclaration"}},"description":"<p>Loads a collection of samples to use with <code>s</code></p>","tags":["samples"],"examples":["samples('github:tidalcycles/dirt-samples');\\ns(\\"[bd ~]*2, [~ hh]*2, ~ sd\\")","samples({\\n bd: '808bd/BD0000.WAV',\\n sd: '808sd/SD0010.WAV'\\n }, 'https://raw.githubusercontent.com/tidalcycles/Dirt-Samples/master/');\\ns(\\"[bd ~]*2, [~ hh]*2, ~ sd\\")"],"name":"samples","longname":"samples","kind":"constant","scope":"global"},{"comment":"/**\\n * Set the max polyphony. If notes are ringing out via \`release\` then they will\\n * start to die out in first-in-first-out order once the max polyphony has been hit\\n *\\n * @name setMaxPolyphony\\n * @tags superdough\\n * @param {number} Max polyphony. Defaults to 128\\n * @example\\n * setMaxPolyphony(4)\\n * n(irand(24).seg(8)).scale(\\"C#3:minor\\").room(1).release(4).gain(0.5)\\n *\\n */","meta":{"filename":"superdough.mjs","lineno":38,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough","code":{}},"description":"<p>Set the max polyphony. If notes are ringing out via <code>release</code> then they will\\nstart to die out in first-in-first-out order once the max polyphony has been hit</p>","name":"setMaxPolyphony","tags":["superdough"],"params":[{"type":{"names":["number"]},"description":"<p>polyphony. Defaults to 128</p>","name":"Max"}],"examples":["setMaxPolyphony(4)\\nn(irand(24).seg(8)).scale(\\"C#3:minor\\").room(1).release(4).gain(0.5)"],"longname":"setMaxPolyphony","kind":"member","scope":"global"},{"comment":"/**\\n * Apply a function to all gains provided in patterns. Can be used to rescale gain to be\\n * quadratic, exponential, etc. rather than linear\\n *\\n * @name setGainCurve\\n * @tags amplitude, superdough\\n * @param {Function} function to apply to all gain values\\n * @example\\n * setGainCurve((x) => x * x) // quadratic gain\\n * s(\\"bd*4\\").gain(0.5) // equivalent to 0.25 gain normally\\n *\\n */","meta":{"filename":"superdough.mjs","lineno":72,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough","code":{}},"description":"<p>Apply a function to all gains provided in patterns. Can be used to rescale gain to be\\nquadratic, exponential, etc. rather than linear</p>","name":"setGainCurve","tags":["amplitude","superdough"],"params":[{"type":{"names":["function"]},"description":"<p>to apply to all gain values</p>","name":"function"}],"examples":["setGainCurve((x) => x * x) // quadratic gain\\ns(\\"bd*4\\").gain(0.5) // equivalent to 0.25 gain normally"],"longname":"setGainCurve","kind":"member","scope":"global"},{"comment":"/**\\n * Register an alias for a bank of sounds.\\n * Optionally accepts a single argument map of bank aliases.\\n * Optionally accepts a single argument string of a path to a JSON file containing bank aliases.\\n * @param {string} bank - The bank to alias\\n * @param {string} alias - The alias to use for the bank\\n *\\n * @tags samples\\n */","meta":{"range":[4719,5106],"filename":"superdough.mjs","lineno":136,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough","code":{"id":"astnode100119436","name":"exports.aliasBank","type":"FunctionDeclaration","paramnames":["args"]}},"description":"<p>Register an alias for a bank of sounds.\\nOptionally accepts a single argument map of bank aliases.\\nOptionally accepts a single argument string of a path to a JSON file containing bank aliases.</p>","params":[{"type":{"names":["string"]},"description":"<p>The bank to alias</p>","name":"bank"},{"type":{"names":["string"]},"description":"<p>The alias to use for the bank</p>","name":"alias"}],"tags":["samples"],"name":"aliasBank","longname":"aliasBank","kind":"function","scope":"global"},{"comment":"/**\\n * Register an alias for a sound.\\n * @tags samples\\n * @param {string} original - The original sound name\\n * @param {string} alias - The alias to use for the sound\\n */","meta":{"range":[5279,5476],"filename":"superdough.mjs","lineno":157,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough","code":{"id":"astnode100119488","name":"exports.soundAlias","type":"FunctionDeclaration","paramnames":["original","alias"]}},"description":"<p>Register an alias for a sound.</p>","tags":["samples"],"params":[{"type":{"names":["string"]},"description":"<p>The original sound name</p>","name":"original"},{"type":{"names":["string"]},"description":"<p>The alias to use for the sound</p>","name":"alias"}],"name":"soundAlias","longname":"soundAlias","kind":"function","scope":"global"},{"comment":"/** Selects entries from \`source\` and renames them via \`map\`\\n * @tags internals\\n */","meta":{"range":[3691,3843],"filename":"util.mjs","lineno":116,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough","code":{"id":"astnode100128077","name":"exports.pickAndRename","type":"VariableDeclaration"}},"description":"<p>Selects entries from <code>source</code> and renames them via <code>map</code></p>","tags":["internals"],"name":"pickAndRename","longname":"pickAndRename","kind":"constant","scope":"global"},{"comment":"/**\\n * Loads a collection of wavetables to use with \`s\`\\n *\\n * @name tables\\n * @tags wavetable\\n */","meta":{"filename":"wavetable.mjs","lineno":185,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough","code":{}},"description":"<p>Loads a collection of wavetables to use with <code>s</code></p>","name":"tables","tags":["wavetable"],"longname":"tables","kind":"member","scope":"global"},{"comment":"/** Apply Hann window in-place\\n * @tags internals\\n */","meta":{"range":[18188,18314],"filename":"worklets.mjs","lineno":652,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough","code":{"id":"astnode100133500","name":"PhaseVocoderProcessor#applyHannWindow","type":"MethodDefinition","paramnames":["input"]},"vars":{"":null}},"description":"<p>Apply Hann window in-place</p>","tags":["internals"],"name":"applyHannWindow","longname":"PhaseVocoderProcessor#applyHannWindow","kind":"function","memberof":"PhaseVocoderProcessor","scope":"instance","params":[]},{"comment":"/** Compute squared magnitudes for peak finding\\n * @tags internals\\n **/","meta":{"range":[18396,18712],"filename":"worklets.mjs","lineno":661,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough","code":{"id":"astnode100133530","name":"PhaseVocoderProcessor#computeMagnitudes","type":"MethodDefinition","paramnames":[]},"vars":{"":null}},"description":"<p>Compute squared magnitudes for peak finding</p>","tags":["internals"],"name":"computeMagnitudes","longname":"PhaseVocoderProcessor#computeMagnitudes","kind":"function","memberof":"PhaseVocoderProcessor","scope":"instance","params":[]},{"comment":"/** Find peaks in spectrum magnitudes\\n * @tags internals\\n **/","meta":{"range":[18784,19256],"filename":"worklets.mjs","lineno":677,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough","code":{"id":"astnode100133590","name":"PhaseVocoderProcessor#findPeaks","type":"MethodDefinition","paramnames":[]},"vars":{"":null}},"description":"<p>Find peaks in spectrum magnitudes</p>","tags":["internals"],"name":"findPeaks","longname":"PhaseVocoderProcessor#findPeaks","kind":"function","memberof":"PhaseVocoderProcessor","scope":"instance","params":[]},{"comment":"/** Shift peaks and regions of influence by pitchFactor into new specturm\\n * @tags internals\\n */","meta":{"range":[19363,21341],"filename":"worklets.mjs","lineno":700,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough","code":{"id":"astnode100133696","name":"PhaseVocoderProcessor#shiftPeaks","type":"MethodDefinition","paramnames":["pitchFactor"]},"vars":{"":null}},"description":"<p>Shift peaks and regions of influence by pitchFactor into new specturm</p>","tags":["internals"],"name":"shiftPeaks","longname":"PhaseVocoderProcessor#shiftPeaks","kind":"function","memberof":"PhaseVocoderProcessor","scope":"instance","params":[]},{"comment":"/** BYTE BEATS\\n * @tags internals\\n */","meta":{"range":[24326,25214],"filename":"worklets.mjs","lineno":855,"columnno":6,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough","code":{"id":"astnode100134370","name":"chyx","type":"ObjectExpression","value":"{\\"bitC\\":\\"\\",\\"br\\":\\"\\",\\"sinf\\":\\"\\",\\"cosf\\":\\"\\",\\"tanf\\":\\"\\",\\"regG\\":\\"\\"}"}},"description":"<p>BYTE BEATS</p>","tags":["internals"],"name":"chyx","longname":"chyx","kind":"constant","scope":"global","params":[]},{"comment":"/**\\n * Equal Power Crossfade function.\\n * Smoothly transitions between signals A and B, maintaining consistent perceived loudness.\\n *\\n * @param {number} a - Signal A (can be a single value or an array value in buffer processing).\\n * @param {number} b - Signal B (can be a single value or an array value in buffer processing).\\n * @param {number} m - Crossfade parameter (0.0 = all A, 1.0 = all B, 0.5 = equal mix).\\n * @tags internals\\n * @returns {number} Crossfaded output value.\\n */","meta":{"range":[939,1098],"filename":"dough.mjs","lineno":25,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100140078","name":"crossfade","type":"FunctionDeclaration","paramnames":["a","b","m"]},"vars":{"aGain":"crossfade~aGain","bGain":"crossfade~bGain"}},"description":"<p>Equal Power Crossfade function.\\nSmoothly transitions between signals A and B, maintaining consistent perceived loudness.</p>","params":[{"type":{"names":["number"]},"description":"<p>Signal A (can be a single value or an array value in buffer processing).</p>","name":"a"},{"type":{"names":["number"]},"description":"<p>Signal B (can be a single value or an array value in buffer processing).</p>","name":"b"},{"type":{"names":["number"]},"description":"<p>Crossfade parameter (0.0 = all A, 1.0 = all B, 0.5 = equal mix).</p>","name":"m"}],"tags":["internals"],"returns":[{"type":{"names":["number"]},"description":"<p>Crossfaded output value.</p>"}],"name":"crossfade","longname":"crossfade","kind":"function","scope":"global"},{"comment":"/** @type {number} */","meta":{"range":[16977,16984],"filename":"dough.mjs","lineno":663,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143045","name":"id","type":"ClassProperty"}},"type":{"names":["number"]},"name":"id","longname":"DoughVoice#id","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number[]} */","meta":{"range":[17013,17026],"filename":"dough.mjs","lineno":665,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143047","name":"out","type":"ClassProperty"}},"type":{"names":["Array.<number>"]},"name":"out","longname":"DoughVoice#out","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[17066,17073],"filename":"dough.mjs","lineno":668,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143051","name":"attack","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"attack","longname":"DoughVoice#attack","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[17112,17118],"filename":"dough.mjs","lineno":670,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143052","name":"decay","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"decay","longname":"DoughVoice#decay","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[17157,17165],"filename":"dough.mjs","lineno":672,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143053","name":"sustain","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"sustain","longname":"DoughVoice#sustain","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number} */","meta":{"range":[17192,17200],"filename":"dough.mjs","lineno":674,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143054","name":"release","type":"ClassProperty"}},"type":{"names":["number"]},"name":"release","longname":"DoughVoice#release","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number} */","meta":{"range":[17227,17234],"filename":"dough.mjs","lineno":676,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143055","name":"_begin","type":"ClassProperty"}},"type":{"names":["number"]},"name":"_begin","longname":"DoughVoice#_begin","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number} */","meta":{"range":[17261,17271],"filename":"dough.mjs","lineno":678,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143056","name":"_duration","type":"ClassProperty"}},"type":{"names":["number"]},"name":"_duration","longname":"DoughVoice#_duration","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {any} */","meta":{"range":[17296,17303],"filename":"dough.mjs","lineno":681,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143057","name":"_sound","type":"ClassProperty"}},"type":{"names":["any"]},"name":"_sound","longname":"DoughVoice#_sound","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number} */","meta":{"range":[17330,17344],"filename":"dough.mjs","lineno":683,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143058","name":"_channels","type":"ClassProperty"}},"type":{"names":["number"]},"name":"_channels","longname":"DoughVoice#_channels","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {BufferPlayer[] | undefined} */","meta":{"range":[17391,17400],"filename":"dough.mjs","lineno":685,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143060","name":"_buffers","type":"ClassProperty"}},"type":{"names":["Array.<BufferPlayer>","undefined"]},"name":"_buffers","longname":"DoughVoice#_buffers","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {string | undefined} */","meta":{"range":[17439,17444],"filename":"dough.mjs","lineno":687,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143061","name":"unit","type":"ClassProperty"}},"type":{"names":["string","undefined"]},"name":"unit","longname":"DoughVoice#unit","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {ADSR | undefined} */","meta":{"range":[17482,17488],"filename":"dough.mjs","lineno":690,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143062","name":"_penv","type":"ClassProperty"}},"type":{"names":["ADSR","undefined"]},"name":"_penv","longname":"DoughVoice#_penv","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[17527,17532],"filename":"dough.mjs","lineno":692,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143063","name":"penv","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"penv","longname":"DoughVoice#penv","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[17571,17579],"filename":"dough.mjs","lineno":694,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143064","name":"pattack","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"pattack","longname":"DoughVoice#pattack","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[17618,17625],"filename":"dough.mjs","lineno":696,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143065","name":"pdecay","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"pdecay","longname":"DoughVoice#pdecay","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[17664,17673],"filename":"dough.mjs","lineno":698,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143066","name":"psustain","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"psustain","longname":"DoughVoice#psustain","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[17712,17721],"filename":"dough.mjs","lineno":700,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143067","name":"prelease","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"prelease","longname":"DoughVoice#prelease","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[17761,17765],"filename":"dough.mjs","lineno":703,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143068","name":"vib","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"vib","longname":"DoughVoice#vib","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[17813,17820],"filename":"dough.mjs","lineno":707,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143070","name":"vibmod","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"vibmod","longname":"DoughVoice#vibmod","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {SineOsc | undefined} */","meta":{"range":[17861,17865],"filename":"dough.mjs","lineno":710,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143071","name":"_fm","type":"ClassProperty"}},"type":{"names":["SineOsc","undefined"]},"name":"_fm","longname":"DoughVoice#_fm","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[17904,17908],"filename":"dough.mjs","lineno":712,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143072","name":"fmh","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"fmh","longname":"DoughVoice#fmh","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[17947,17951],"filename":"dough.mjs","lineno":714,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143073","name":"fmi","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"fmi","longname":"DoughVoice#fmi","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {ADSR | undefined} */","meta":{"range":[17989,17996],"filename":"dough.mjs","lineno":717,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143074","name":"_fmenv","type":"ClassProperty"}},"type":{"names":["ADSR","undefined"]},"name":"_fmenv","longname":"DoughVoice#_fmenv","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[18035,18044],"filename":"dough.mjs","lineno":719,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143075","name":"fmattack","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"fmattack","longname":"DoughVoice#fmattack","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[18083,18091],"filename":"dough.mjs","lineno":721,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143076","name":"fmdecay","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"fmdecay","longname":"DoughVoice#fmdecay","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[18130,18140],"filename":"dough.mjs","lineno":723,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143077","name":"fmsustain","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"fmsustain","longname":"DoughVoice#fmsustain","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[18179,18189],"filename":"dough.mjs","lineno":725,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143078","name":"fmrelease","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"fmrelease","longname":"DoughVoice#fmrelease","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {ADSR | undefined} */","meta":{"range":[18227,18234],"filename":"dough.mjs","lineno":728,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143079","name":"_lpenv","type":"ClassProperty"}},"type":{"names":["ADSR","undefined"]},"name":"_lpenv","longname":"DoughVoice#_lpenv","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[18282,18291],"filename":"dough.mjs","lineno":731,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143081","name":"lpattack","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"lpattack","longname":"DoughVoice#lpattack","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[18330,18338],"filename":"dough.mjs","lineno":733,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143082","name":"lpdecay","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"lpdecay","longname":"DoughVoice#lpdecay","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[18377,18387],"filename":"dough.mjs","lineno":735,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143083","name":"lpsustain","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"lpsustain","longname":"DoughVoice#lpsustain","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[18426,18436],"filename":"dough.mjs","lineno":737,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143084","name":"lprelease","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"lprelease","longname":"DoughVoice#lprelease","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {ADSR | undefined} */","meta":{"range":[18474,18481],"filename":"dough.mjs","lineno":740,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143085","name":"_hpenv","type":"ClassProperty"}},"type":{"names":["ADSR","undefined"]},"name":"_hpenv","longname":"DoughVoice#_hpenv","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[18520,18526],"filename":"dough.mjs","lineno":742,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143086","name":"hpenv","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"hpenv","longname":"DoughVoice#hpenv","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[18565,18574],"filename":"dough.mjs","lineno":744,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143087","name":"hpattack","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"hpattack","longname":"DoughVoice#hpattack","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[18613,18621],"filename":"dough.mjs","lineno":746,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143088","name":"hpdecay","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"hpdecay","longname":"DoughVoice#hpdecay","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[18660,18670],"filename":"dough.mjs","lineno":748,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143089","name":"hpsustain","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"hpsustain","longname":"DoughVoice#hpsustain","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[18709,18719],"filename":"dough.mjs","lineno":750,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143090","name":"hprelease","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"hprelease","longname":"DoughVoice#hprelease","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {ADSR | undefined} */","meta":{"range":[18757,18764],"filename":"dough.mjs","lineno":753,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143091","name":"_bpenv","type":"ClassProperty"}},"type":{"names":["ADSR","undefined"]},"name":"_bpenv","longname":"DoughVoice#_bpenv","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[18803,18809],"filename":"dough.mjs","lineno":755,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143092","name":"bpenv","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"bpenv","longname":"DoughVoice#bpenv","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[18848,18857],"filename":"dough.mjs","lineno":757,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143093","name":"bpattack","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"bpattack","longname":"DoughVoice#bpattack","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[18896,18904],"filename":"dough.mjs","lineno":759,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143094","name":"bpdecay","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"bpdecay","longname":"DoughVoice#bpdecay","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[18943,18953],"filename":"dough.mjs","lineno":761,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143095","name":"bpsustain","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"bpsustain","longname":"DoughVoice#bpsustain","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[18992,19002],"filename":"dough.mjs","lineno":763,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143096","name":"bprelease","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"bprelease","longname":"DoughVoice#bprelease","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[19042,19049],"filename":"dough.mjs","lineno":766,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143097","name":"cutoff","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"cutoff","longname":"DoughVoice#cutoff","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[19088,19096],"filename":"dough.mjs","lineno":768,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143098","name":"hcutoff","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"hcutoff","longname":"DoughVoice#hcutoff","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[19135,19141],"filename":"dough.mjs","lineno":770,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143099","name":"bandf","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"bandf","longname":"DoughVoice#bandf","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[19180,19187],"filename":"dough.mjs","lineno":772,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143100","name":"coarse","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"coarse","longname":"DoughVoice#coarse","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[19226,19232],"filename":"dough.mjs","lineno":774,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143101","name":"crush","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"crush","longname":"DoughVoice#crush","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number | undefined} */","meta":{"range":[19271,19279],"filename":"dough.mjs","lineno":776,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143102","name":"distort","type":"ClassProperty"}},"type":{"names":["number","undefined"]},"name":"distort","longname":"DoughVoice#distort","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {number} */","meta":{"range":[19307,19312],"filename":"dough.mjs","lineno":779,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143103","name":"freq","type":"ClassProperty"}},"type":{"names":["number"]},"name":"freq","longname":"DoughVoice#freq","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {string | undefined} */","meta":{"range":[19351,19356],"filename":"dough.mjs","lineno":781,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143104","name":"note","type":"ClassProperty"}},"type":{"names":["string","undefined"]},"name":"note","longname":"DoughVoice#note","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {TwoPoleFilter[] | null | undefined} */","meta":{"range":[19412,19417],"filename":"dough.mjs","lineno":784,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143105","name":"_lpf","type":"ClassProperty"}},"type":{"names":["Array.<TwoPoleFilter>","null","undefined"]},"name":"_lpf","longname":"DoughVoice#_lpf","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {TwoPoleFilter[] | null | undefined} */","meta":{"range":[19472,19477],"filename":"dough.mjs","lineno":786,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143106","name":"_hpf","type":"ClassProperty"}},"type":{"names":["Array.<TwoPoleFilter>","null","undefined"]},"name":"_hpf","longname":"DoughVoice#_hpf","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {TwoPoleFilter[] | null | undefined} */","meta":{"range":[19532,19537],"filename":"dough.mjs","lineno":788,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143107","name":"_bpf","type":"ClassProperty"}},"type":{"names":["Array.<TwoPoleFilter>","null","undefined"]},"name":"_bpf","longname":"DoughVoice#_bpf","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {Chorus[] | null | undefined} */","meta":{"range":[19585,19593],"filename":"dough.mjs","lineno":790,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143108","name":"_chorus","type":"ClassProperty"}},"type":{"names":["Array.<Chorus>","null","undefined"]},"name":"_chorus","longname":"DoughVoice#_chorus","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {Coarse[] | null | undefined} */","meta":{"range":[19641,19649],"filename":"dough.mjs","lineno":792,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143109","name":"_coarse","type":"ClassProperty"}},"type":{"names":["Array.<Coarse>","null","undefined"]},"name":"_coarse","longname":"DoughVoice#_coarse","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {Crush[] | null | undefined} */","meta":{"range":[19696,19703],"filename":"dough.mjs","lineno":794,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143110","name":"_crush","type":"ClassProperty"}},"type":{"names":["Array.<Crush>","null","undefined"]},"name":"_crush","longname":"DoughVoice#_crush","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/** @type {Distort[] | null | undefined} */","meta":{"range":[19752,19761],"filename":"dough.mjs","lineno":796,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143111","name":"_distort","type":"ClassProperty"}},"type":{"names":["Array.<Distort>","null","undefined"]},"name":"_distort","longname":"DoughVoice#_distort","kind":"member","memberof":"DoughVoice","scope":"instance"},{"comment":"/**\\n * @param {DoughVoice} value\\n */","meta":{"range":[19808,24297],"filename":"dough.mjs","lineno":801,"columnno":2,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough","code":{"id":"astnode100143112","name":"exports.DoughVoice","type":"MethodDefinition","paramnames":["value"]},"vars":{"":null}},"params":[{"type":{"names":["DoughVoice"]},"name":"value"}],"name":"DoughVoice","longname":"DoughVoice#DoughVoice","kind":"class","memberof":"DoughVoice","scope":"instance"},{"comment":"/**\\n * Change the pitch of each value by the given amount. Expects numbers or note strings as values.\\n * The amount can be given as a number of semitones or as a string in interval short notation.\\n * If you don't care about enharmonic correctness, just use numbers. Otherwise, pass the interval of\\n * the form: ST where S is the degree number and T the type of interval with\\n *\\n * - M = major\\n * - m = minor\\n * - P = perfect\\n * - A = augmented\\n * - d = diminished\\n *\\n * Examples intervals:\\n *\\n * - 1P = unison\\n * - 3M = major third\\n * - 3m = minor third\\n * - 4P = perfect fourth\\n * - 4A = augmented fourth\\n * - 5P = perfect fifth\\n * - 5d = diminished fifth\\n *\\n * @tags tonal\\n * @param {string | number} amount Either number of semitones or interval string.\\n * @returns Pattern\\n * @memberof Pattern\\n * @name transpose\\n * @synonyms trans\\n * @example\\n * \\"c2 c3\\".fast(2).transpose(\\"<0 -2 5 3>\\".slow(2)).note()\\n * @example\\n * \\"c2 c3\\".fast(2).transpose(\\"<1P -2M 4P 3m>\\".slow(2)).note()\\n */","meta":{"filename":"tonal.mjs","lineno":81,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/tonal","code":{}},"description":"<p>Change the pitch of each value by the given amount. Expects numbers or note strings as values.\\nThe amount can be given as a number of semitones or as a string in interval short notation.\\nIf you don't care about enharmonic correctness, just use numbers. Otherwise, pass the interval of\\nthe form: ST where S is the degree number and T the type of interval with</p>\\n<ul>\\n<li>M = major</li>\\n<li>m = minor</li>\\n<li>P = perfect</li>\\n<li>A = augmented</li>\\n<li>d = diminished</li>\\n</ul>\\n<p>Examples intervals:</p>\\n<ul>\\n<li>1P = unison</li>\\n<li>3M = major third</li>\\n<li>3m = minor third</li>\\n<li>4P = perfect fourth</li>\\n<li>4A = augmented fourth</li>\\n<li>5P = perfect fifth</li>\\n<li>5d = diminished fifth</li>\\n</ul>","tags":["tonal"],"params":[{"type":{"names":["string","number"]},"description":"<p>Either number of semitones or interval string.</p>","name":"amount"}],"returns":[{"description":"<p>Pattern</p>"}],"memberof":"Pattern","name":"transpose","synonyms_text":"trans","synonyms":["trans"],"examples":["\\"c2 c3\\".fast(2).transpose(\\"<0 -2 5 3>\\".slow(2)).note()","\\"c2 c3\\".fast(2).transpose(\\"<1P -2M 4P 3m>\\".slow(2)).note()"],"scope":"static","longname":"Pattern.transpose","kind":"member"},{"comment":"/**\\n * Transposes notes inside the scale by the number of steps.\\n * Expected to be called on a Pattern which already has a {@link Pattern#scale}\\n *\\n * @memberof Pattern\\n * @name scaleTranspose\\n * @tags tonal\\n * @param {offset} offset number of steps inside the scale\\n * @returns Pattern\\n * @synonyms scaleTrans, strans\\n * @example\\n * \\"-8 [2,4,6]\\"\\n * .scale('C4 bebop major')\\n * .scaleTranspose(\\"<0 -1 -2 -3 -4 -5 -6 -4>\\")\\n * .note()\\n */","meta":{"filename":"tonal.mjs","lineno":152,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/tonal","code":{}},"description":"<p>Transposes notes inside the scale by the number of steps.\\nExpected to be called on a Pattern which already has a {@link Pattern#scale}</p>","memberof":"Pattern","name":"scaleTranspose","tags":["tonal"],"params":[{"type":{"names":["offset"]},"description":"<p>number of steps inside the scale</p>","name":"offset"}],"returns":[{"description":"<p>Pattern</p>"}],"synonyms_text":"scaleTrans, strans","synonyms":["scaleTrans","strans"],"examples":["\\"-8 [2,4,6]\\"\\n.scale('C4 bebop major')\\n.scaleTranspose(\\"<0 -1 -2 -3 -4 -5 -6 -4>\\")\\n.note()"],"scope":"static","longname":"Pattern.scaleTranspose","kind":"member"},{"comment":"/**\\n * Turns numbers into notes in the scale (zero indexed) or quantizes notes to a scale.\\n *\\n * When describing notes via numbers, note that negative numbers can be used to wrap backwards\\n * in the scale as well as sharps or flats to produce notes outside of the scale.\\n *\\n * Also sets scale for other scale operations, like {@link Pattern#scaleTranspose}.\\n *\\n * A scale consists of a root note (e.g. \`c4\`, \`c\`, \`f#\`, \`bb4\`) followed by semicolon (':') and then a [scale type](https://github.com/tonaljs/tonal/blob/main/packages/scale-type/data.ts).\\n *\\n * The scale name must be written without spaces (because it would be interpreted as a multi-step pattern otherwise).\\n * If your scale name includes spaces, replace them with colons.\\n *\\n * The root note defaults to octave 3, if no octave number is given.\\n *\\n * @name scale\\n * @tags tonal\\n * @param {string} scale Name of scale\\n * @returns Pattern\\n * @example\\n * n(\\"0 2 4 6 4 2\\").scale(\\"C:major\\")\\n * @example\\n * n(\\"[0,7] 4 [2,7] 4\\")\\n * .scale(\\"C:<major minor>/2\\")\\n * .s(\\"piano\\")\\n * @example\\n * n(rand.range(0,12).segment(8))\\n * .scale(\\"C:ritusen\\")\\n * .s(\\"piano\\")\\n * @example\\n * n(\\"<[0,7b] [-4# -4] [-2,7##] 4 [0,7] [-4# -4b] [-2,7###] 4b>*4\\")\\n * .scale(\\"C:<major minor>/2\\")\\n * .s(\\"piano\\")\\n * @example\\n * note(\\"C1*16\\").transpose(irand(36)).scale('Cb2 major').scaleTranspose(3)\\n * @example\\n * n(\\"[0 0] [1 2] [3 4] [5 6]\\").scale(\\"C:major:blues\\")\\n */","meta":{"filename":"tonal.mjs","lineno":233,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/tonal","code":{}},"description":"<p>Turns numbers into notes in the scale (zero indexed) or quantizes notes to a scale.</p>\\n<p>When describing notes via numbers, note that negative numbers can be used to wrap backwards\\nin the scale as well as sharps or flats to produce notes outside of the scale.</p>\\n<p>Also sets scale for other scale operations, like {@link Pattern#scaleTranspose}.</p>\\n<p>A scale consists of a root note (e.g. <code>c4</code>, <code>c</code>, <code>f#</code>, <code>bb4</code>) followed by semicolon (':') and then a <a href=\\"https://github.com/tonaljs/tonal/blob/main/packages/scale-type/data.ts\\">scale type</a>.</p>\\n<p>The scale name must be written without spaces (because it would be interpreted as a multi-step pattern otherwise).\\nIf your scale name includes spaces, replace them with colons.</p>\\n<p>The root note defaults to octave 3, if no octave number is given.</p>","name":"scale","tags":["tonal"],"params":[{"type":{"names":["string"]},"description":"<p>Name of scale</p>","name":"scale"}],"returns":[{"description":"<p>Pattern</p>"}],"examples":["n(\\"0 2 4 6 4 2\\").scale(\\"C:major\\")","n(\\"[0,7] 4 [2,7] 4\\")\\n.scale(\\"C:<major minor>/2\\")\\n.s(\\"piano\\")","n(rand.range(0,12).segment(8))\\n.scale(\\"C:ritusen\\")\\n.s(\\"piano\\")","n(\\"<[0,7b] [-4# -4] [-2,7##] 4 [0,7] [-4# -4b] [-2,7###] 4b>*4\\")\\n.scale(\\"C:<major minor>/2\\")\\n.s(\\"piano\\")","note(\\"C1*16\\").transpose(irand(36)).scale('Cb2 major').scaleTranspose(3)","n(\\"[0 0] [1 2] [3 4] [5 6]\\").scale(\\"C:major:blues\\")"],"longname":"scale","kind":"member","scope":"global"},{"comment":"/**\\n * Adds a new custom voicing dictionary.\\n *\\n * @name addVoicings\\n * @tags tonal\\n * @memberof Pattern\\n * @param {string} name identifier for the voicing dictionary\\n * @param {Object} dictionary maps chord symbol to possible voicings\\n * @param {Array} range min, max note\\n * @returns Pattern\\n * @example\\n * addVoicings('cookie', {\\n * 7: ['3M 7m 9M 12P 15P', '7m 10M 13M 16M 19P'],\\n * '^7': ['3M 6M 9M 12P 14M', '7M 10M 13M 16M 19P'],\\n * m7: ['8P 11P 14m 17m 19P', '5P 8P 11P 14m 17m'],\\n * m7b5: ['3m 5d 8P 11P 14m', '5d 8P 11P 14m 17m'],\\n * o7: ['3m 6M 9M 11A 15P'],\\n * '7alt': ['3M 7m 10m 13m 15P'],\\n * '7#11': ['7m 10m 13m 15P 17m'],\\n * }, ['C3', 'C6'])\\n * \\"<C^7 A7 Dm7 G7>\\".voicings('cookie').note()\\n */","meta":{"filename":"voicings.mjs","lineno":89,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/tonal","code":{}},"description":"<p>Adds a new custom voicing dictionary.</p>","name":"addVoicings","tags":["tonal"],"memberof":"Pattern","params":[{"type":{"names":["string"]},"description":"<p>identifier for the voicing dictionary</p>","name":"name"},{"type":{"names":["Object"]},"description":"<p>maps chord symbol to possible voicings</p>","name":"dictionary"},{"type":{"names":["Array"]},"description":"<p>min, max note</p>","name":"range"}],"returns":[{"description":"<p>Pattern</p>"}],"examples":["addVoicings('cookie', {\\n 7: ['3M 7m 9M 12P 15P', '7m 10M 13M 16M 19P'],\\n '^7': ['3M 6M 9M 12P 14M', '7M 10M 13M 16M 19P'],\\n m7: ['8P 11P 14m 17m 19P', '5P 8P 11P 14m 17m'],\\n m7b5: ['3m 5d 8P 11P 14m', '5d 8P 11P 14m 17m'],\\n o7: ['3m 6M 9M 11A 15P'],\\n '7alt': ['3M 7m 10m 13m 15P'],\\n '7#11': ['7m 10m 13m 15P 17m'],\\n}, ['C3', 'C6'])\\n\\"<C^7 A7 Dm7 G7>\\".voicings('cookie').note()"],"scope":"static","longname":"Pattern.addVoicings","kind":"member"},{"comment":"/**\\n * DEPRECATED: still works, but it is recommended you use .voicing instead (without s).\\n * Turns chord symbols into voicings, using the smoothest voice leading possible.\\n * Uses [chord-voicings package](https://github.com/felixroos/chord-voicings#chord-voicings).\\n *\\n * @name voicings\\n * @tags tonal\\n * @memberof Pattern\\n * @param {string} dictionary which voicing dictionary to use.\\n * @returns Pattern\\n * @example\\n * stack(\\"<C^7 A7 Dm7 G7>\\".voicings('lefthand'), \\"<C3 A2 D3 G2>\\").note()\\n */","meta":{"filename":"voicings.mjs","lineno":131,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/tonal","code":{}},"description":"<p>DEPRECATED: still works, but it is recommended you use .voicing instead (without s).\\nTurns chord symbols into voicings, using the smoothest voice leading possible.\\nUses <a href=\\"https://github.com/felixroos/chord-voicings#chord-voicings\\">chord-voicings package</a>.</p>","name":"voicings","tags":["tonal"],"memberof":"Pattern","params":[{"type":{"names":["string"]},"description":"<p>which voicing dictionary to use.</p>","name":"dictionary"}],"returns":[{"description":"<p>Pattern</p>"}],"examples":["stack(\\"<C^7 A7 Dm7 G7>\\".voicings('lefthand'), \\"<C3 A2 D3 G2>\\").note()"],"scope":"static","longname":"Pattern.voicings","kind":"member"},{"comment":"/**\\n * Maps the chords of the incoming pattern to root notes in the given octave.\\n *\\n * @name rootNotes\\n * @tags tonal\\n * @memberof Pattern\\n * @param {octave} octave octave to use\\n * @returns Pattern\\n * @example\\n * \\"<C^7 A7 Dm7 G7>\\".rootNotes(2).note()\\n */","meta":{"filename":"voicings.mjs","lineno":158,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/tonal","code":{}},"description":"<p>Maps the chords of the incoming pattern to root notes in the given octave.</p>","name":"rootNotes","tags":["tonal"],"memberof":"Pattern","params":[{"type":{"names":["octave"]},"description":"<p>octave to use</p>","name":"octave"}],"returns":[{"description":"<p>Pattern</p>"}],"examples":["\\"<C^7 A7 Dm7 G7>\\".rootNotes(2).note()"],"scope":"static","longname":"Pattern.rootNotes","kind":"member"},{"comment":"/**\\n * Turns chord symbols into voicings. You can use the following control params:\\n *\\n * - \`chord\`: Note, followed by chord symbol, e.g. C Am G7 Bb^7\\n * - \`dict\`: voicing dictionary to use, falls back to default dictionary\\n * - \`anchor\`: the note that is used to align the chord\\n * - \`mode\`: how the voicing is aligned to the anchor\\n * - \`below\`: top note <= anchor\\n * - \`duck\`: top note <= anchor, anchor excluded\\n * - \`above\`: bottom note >= anchor\\n * - \`offset\`: whole number that shifts the voicing up or down to the next voicing\\n * - \`n\`: if set, the voicing is played like a scale. Overshooting numbers will be octaved\\n *\\n * All of the above controls are optional, except \`chord\`.\\n * If you pass a pattern of strings to voicing, they will be interpreted as chords.\\n *\\n * @name voicing\\n * @tags tonal\\n * @returns Pattern\\n * @example\\n * n(\\"0 1 2 3\\").chord(\\"<C Am F G>\\").voicing()\\n */","meta":{"filename":"voicings.mjs","lineno":178,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/tonal","code":{}},"description":"<p>Turns chord symbols into voicings. You can use the following control params:</p>\\n<ul>\\n<li><code>chord</code>: Note, followed by chord symbol, e.g. C Am G7 Bb^7</li>\\n<li><code>dict</code>: voicing dictionary to use, falls back to default dictionary</li>\\n<li><code>anchor</code>: the note that is used to align the chord</li>\\n<li><code>mode</code>: how the voicing is aligned to the anchor\\n<ul>\\n<li><code>below</code>: top note <= anchor</li>\\n<li><code>duck</code>: top note <= anchor, anchor excluded</li>\\n<li><code>above</code>: bottom note >= anchor</li>\\n</ul>\\n</li>\\n<li><code>offset</code>: whole number that shifts the voicing up or down to the next voicing</li>\\n<li><code>n</code>: if set, the voicing is played like a scale. Overshooting numbers will be octaved</li>\\n</ul>\\n<p>All of the above controls are optional, except <code>chord</code>.\\nIf you pass a pattern of strings to voicing, they will be interpreted as chords.</p>","name":"voicing","tags":["tonal"],"returns":[{"description":"<p>Pattern</p>"}],"examples":["n(\\"0 1 2 3\\").chord(\\"<C Am F G>\\").voicing()"],"longname":"voicing","kind":"member","scope":"global"},{"comment":"/**\\n * Renders an oscilloscope for the frequency domain of the audio signal.\\n * @name fscope\\n * @tags visualization\\n * @param {string} color line color as hex or color name. defaults to white.\\n * @param {number} scale scales the y-axis. Defaults to 0.25\\n * @param {number} pos y-position relative to screen height. 0 = top, 1 = bottom of screen\\n * @param {number} lean y-axis alignment where 0 = top and 1 = bottom\\n * @param {number} min min value\\n * @param {number} max max value\\n * @example\\n * s(\\"sawtooth\\").fscope()\\n */","meta":{"filename":"scope.mjs","lineno":98,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/webaudio","code":{}},"description":"<p>Renders an oscilloscope for the frequency domain of the audio signal.</p>","name":"fscope","tags":["visualization"],"params":[{"type":{"names":["string"]},"description":"<p>line color as hex or color name. defaults to white.</p>","name":"color"},{"type":{"names":["number"]},"description":"<p>scales the y-axis. Defaults to 0.25</p>","name":"scale"},{"type":{"names":["number"]},"description":"<p>y-position relative to screen height. 0 = top, 1 = bottom of screen</p>","name":"pos"},{"type":{"names":["number"]},"description":"<p>y-axis alignment where 0 = top and 1 = bottom</p>","name":"lean"},{"type":{"names":["number"]},"description":"<p>min value</p>","name":"min"},{"type":{"names":["number"]},"description":"<p>max value</p>","name":"max"}],"examples":["s(\\"sawtooth\\").fscope()"],"longname":"fscope","kind":"member","scope":"global"},{"comment":"/**\\n * Renders an oscilloscope for the time domain of the audio signal.\\n * @name scope\\n * @synonyms tscope\\n * @tags visualization\\n * @param {object} config optional config with options:\\n * @param {boolean} align if 1, the scope will be aligned to the first zero crossing. defaults to 1\\n * @param {string} color line color as hex or color name. defaults to white.\\n * @param {number} thickness line thickness. defaults to 3\\n * @param {number} scale scales the y-axis. Defaults to 0.25\\n * @param {number} pos y-position relative to screen height. 0 = top, 1 = bottom of screen\\n * @param {number} trigger amplitude value that is used to align the scope. defaults to 0.\\n * @example\\n * s(\\"sawtooth\\")._scope()\\n */","meta":{"filename":"scope.mjs","lineno":122,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/webaudio","code":{}},"description":"<p>Renders an oscilloscope for the time domain of the audio signal.</p>","name":"scope","synonyms_text":"tscope","synonyms":["tscope"],"tags":["visualization"],"params":[{"type":{"names":["object"]},"description":"<p>optional config with options:</p>","name":"config"},{"type":{"names":["boolean"]},"description":"<p>if 1, the scope will be aligned to the first zero crossing. defaults to 1</p>","name":"align"},{"type":{"names":["string"]},"description":"<p>line color as hex or color name. defaults to white.</p>","name":"color"},{"type":{"names":["number"]},"description":"<p>line thickness. defaults to 3</p>","name":"thickness"},{"type":{"names":["number"]},"description":"<p>scales the y-axis. Defaults to 0.25</p>","name":"scale"},{"type":{"names":["number"]},"description":"<p>y-position relative to screen height. 0 = top, 1 = bottom of screen</p>","name":"pos"},{"type":{"names":["number"]},"description":"<p>amplitude value that is used to align the scope. defaults to 0.</p>","name":"trigger"}],"examples":["s(\\"sawtooth\\")._scope()"],"longname":"scope","kind":"member","scope":"global"},{"comment":"/**\\n * Renders a spectrum analyzer for the incoming audio signal.\\n * @name spectrum\\n * @tags visualization\\n * @param {object} config optional config with options:\\n * @param {integer} thickness line thickness in px (default 3)\\n * @param {integer} speed scroll speed (default 1)\\n * @param {integer} min min db (default -80)\\n * @param {integer} max max db (default 0)\\n * @example\\n * n(\\"<0 4 <2 3> 1>*3\\")\\n * .off(1/8, add(n(5)))\\n * .off(1/5, add(n(7)))\\n * .scale(\\"d3:minor:pentatonic\\")\\n * .s('sine')\\n * .dec(.3).room(.5)\\n * ._spectrum()\\n */","meta":{"filename":"spectrum.mjs","lineno":5,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/webaudio","code":{}},"description":"<p>Renders a spectrum analyzer for the incoming audio signal.</p>","name":"spectrum","tags":["visualization"],"params":[{"type":{"names":["object"]},"description":"<p>optional config with options:</p>","name":"config"},{"type":{"names":["integer"]},"description":"<p>line thickness in px (default 3)</p>","name":"thickness"},{"type":{"names":["integer"]},"description":"<p>scroll speed (default 1)</p>","name":"speed"},{"type":{"names":["integer"]},"description":"<p>min db (default -80)</p>","name":"min"},{"type":{"names":["integer"]},"description":"<p>max db (default 0)</p>","name":"max"}],"examples":["n(\\"<0 4 <2 3> 1>*3\\")\\n.off(1/8, add(n(5)))\\n.off(1/5, add(n(7)))\\n.scale(\\"d3:minor:pentatonic\\")\\n.s('sine')\\n.dec(.3).room(.5)\\n._spectrum()"],"longname":"spectrum","kind":"member","scope":"global"},{"comment":"/**\\n * Assumes pattern contains numerical scale degrees on the \`i\` control (see examples below). Accepts a scale name or list of frequencies (see all available names at the link on the reference). Returns a new pattern with all values mapped to a frequency ratio. Similar to \`xen\`.\\n * @name tune\\n * @returns Pattern\\n * @memberof Pattern\\n * @param {(string | number[] )} scale\\n * @example\\n * i(\\"0 1 2 3 4 5\\").tune(\\"hexany15\\").mul(\\"220\\").freq()\\n * @example\\n * // You can set your root to be a\\n * // particular note with getFreq:\\n * i(\\"4 8 9 10 - - 5 7 9 11 - -\\").tune(\\"tranh3\\")\\n * .mul(getFreq('c3'))\\n * .freq().clip(.5).room(1)\\n * @example\\n * // You can also give tune a list of\\n * // frequencies to use as the scale:\\n * i(\\"0 1 2 3 4\\").tune([\\n * 261.6255653006,\\n * 302.72962012827,\\n * 350.29154279212,\\n * 405.32593044476,\\n * 469.00678383895,\\n * 523.2511306012\\n * ]).mul(220).freq();\\n *\\n * @tags tonal\\n */","meta":{"filename":"tune.mjs","lineno":10,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/xen","code":{}},"description":"<p>Assumes pattern contains numerical scale degrees on the <code>i</code> control (see examples below). Accepts a scale name or list of frequencies (see all available names at the link on the reference). Returns a new pattern with all values mapped to a frequency ratio. Similar to <code>xen</code>.</p>","name":"tune","returns":[{"description":"<p>Pattern</p>"}],"memberof":"Pattern","params":[{"type":{"names":["string","Array.<number>"]},"name":"scale"}],"examples":["i(\\"0 1 2 3 4 5\\").tune(\\"hexany15\\").mul(\\"220\\").freq()","// You can set your root to be a\\n// particular note with getFreq:\\ni(\\"4 8 9 10 - - 5 7 9 11 - -\\").tune(\\"tranh3\\")\\n .mul(getFreq('c3'))\\n .freq().clip(.5).room(1)","// You can also give tune a list of\\n// frequencies to use as the scale:\\ni(\\"0 1 2 3 4\\").tune([\\n 261.6255653006,\\n 302.72962012827,\\n 350.29154279212,\\n 405.32593044476,\\n 469.00678383895,\\n 523.2511306012\\n]).mul(220).freq();"],"tags":["tonal"],"scope":"static","longname":"Pattern.tune","kind":"member"},{"comment":"/**\\n * Assumes a numerical pattern of scale steps, and a scale. Scales accepted are all preset scale names of \`tune\`, arbitrary edos such as 31edo, or an array of frequency ratios. Assumes scales repeat at octave (2/1). Returns a new pattern with all values mapped to their associated frequency, assuming a base frequency of 220hz.\\n *\\n * @name xen\\n * @returns Pattern\\n * @memberof Pattern\\n * @param {(string | number[] )} scaleNameOrRatios\\n * @tags tonal\\n * @example\\n * // A minor triad in 31edo:\\n * i(\\"0 8 18\\").xen(\\"31edo\\").piano()\\n * @example\\n * // You can also use xen with frequency ratios.\\n * // This is equivalent to the above:\\n * i(\\"0 1 2\\").xen([\\n * Math.pow(2, 0/31),\\n * Math.pow(2, 8/31),\\n * Math.pow(2, 18/31),\\n * ]).piano()\\n * @example\\n * // xen also supports all scale names that\\n * // tune does:\\n * i(\\"0 1 2 3 4 5\\").xen(\\"hexany15\\")\\n * // equiv to:\\n * // \\"0 1 2 3 4 5\\".tune(\\"hexany15\\").mul(\\"220\\").freq()\\n * @example\\n * i(\\"0 1 2 3 4 5 6 7\\").xen(\\"<5edo 10edo 15edo hexany15>\\")\\n */","meta":{"filename":"xen.mjs","lineno":70,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/xen","code":{}},"description":"<p>Assumes a numerical pattern of scale steps, and a scale. Scales accepted are all preset scale names of <code>tune</code>, arbitrary edos such as 31edo, or an array of frequency ratios. Assumes scales repeat at octave (2/1). Returns a new pattern with all values mapped to their associated frequency, assuming a base frequency of 220hz.</p>","name":"xen","returns":[{"description":"<p>Pattern</p>"}],"memberof":"Pattern","params":[{"type":{"names":["string","Array.<number>"]},"name":"scaleNameOrRatios"}],"tags":["tonal"],"examples":["// A minor triad in 31edo:\\ni(\\"0 8 18\\").xen(\\"31edo\\").piano()","// You can also use xen with frequency ratios.\\n// This is equivalent to the above:\\ni(\\"0 1 2\\").xen([\\n Math.pow(2, 0/31),\\n Math.pow(2, 8/31),\\n Math.pow(2, 18/31),\\n]).piano()","// xen also supports all scale names that\\n// tune does:\\ni(\\"0 1 2 3 4 5\\").xen(\\"hexany15\\")\\n// equiv to:\\n// \\"0 1 2 3 4 5\\".tune(\\"hexany15\\").mul(\\"220\\").freq()","i(\\"0 1 2 3 4 5 6 7\\").xen(\\"<5edo 10edo 15edo hexany15>\\")"],"scope":"static","longname":"Pattern.xen","kind":"member"},{"comment":"/**\\n * Assumes pattern of frequencies tuned to some \`base\` frequency, such as the output of \`xen\`\\n * Because \`xen\` defaults to \`220Hz\`, so will \`withBase\`.\\n * but you can specify a different original base with the standard optional array syntax '\`:\`'\\n * @name withBase\\n * @param {number} base\\n * @param {number} (optional) originalBase\\n * @tags tonal\\n *\\n * @example\\n * i(\\"[0 1 2 3] [3 4] [4 3 2 1]\\").xen(\\"hexany23\\").withBase(\\"<220 [300 200]>\\")\\n * @example\\n * mini([1 / 1, 16 / 15, 9 / 8, 6 / 5, 5 / 4].join(' ')).withBase(\\"220:1\\")\\n * // mini([1 / 1, 16 / 15, 9 / 8, 6 / 5, 5 / 4].join(' ')).mul(220).freq()\\n *\\n * @returns Pattern\\n */","meta":{"filename":"xen.mjs","lineno":121,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/xen","code":{}},"description":"<p>Assumes pattern of frequencies tuned to some <code>base</code> frequency, such as the output of <code>xen</code>\\nBecause <code>xen</code> defaults to <code>220Hz</code>, so will <code>withBase</code>.\\nbut you can specify a different original base with the standard optional array syntax '<code>:</code>'</p>","name":"withBase","params":[{"type":{"names":["number"]},"name":"base"},{"type":{"names":["number"]},"description":"<p>originalBase</p>","name":"(optional)"}],"tags":["tonal"],"examples":["i(\\"[0 1 2 3] [3 4] [4 3 2 1]\\").xen(\\"hexany23\\").withBase(\\"<220 [300 200]>\\")","mini([1 / 1, 16 / 15, 9 / 8, 6 / 5, 5 / 4].join(' ')).withBase(\\"220:1\\")\\n// mini([1 / 1, 16 / 15, 9 / 8, 6 / 5, 5 / 4].join(' ')).mul(220).freq()"],"returns":[{"description":"<p>Pattern</p>"}],"longname":"withBase","kind":"member","scope":"global"},{"comment":"/**\\n * Frequency transpose. Assumes pattern either has \`freq\` set, or has values that can be interpreted as frequencies\\n * amt has optional \`edoSize\` param, defaults to 12.\\n * If haps have edoSize param set, such as from the output of \`xen(\\"31edo\\")\`,\\n * \`ftrans\` will fallback to that instead of 12 as the default.\\n *\\n * Transposes the frequency by \`amt\` edoSteps\\n * @name ftranspose\\n * @synonyms ftrans, fTrans, ftranspose, fTranspose\\n * @tags tonal\\n * @param {number} amt\\n * @param {number} edoSize (optional)\\n * @returns {Pattern}\\n *\\n * @example\\n * i(\\"0 1 2\\").xen(\\"12edo\\").ftrans(\\"7\\")\\n * // n(\\"0 1 2\\").scale(\\"A:chromatic\\").trans(\\"7\\")\\n * @example\\n * i(\\"0 8 18\\").xen(\\"31edo\\").ftrans(\\"<8 -8>\\")\\n * @example\\n * // to transpose by steps of an edo, use \\"step:edo\\" :\\n * i(\\"0 7 8 18\\").xen(\\"31edo\\").ftrans(\\"<0 1:31 1:12>\\")\\n * @example\\n * // it can also work with frequency values directly\\n * freq(\\"200 300 400\\").ftrans(\\"<0 7:31 7>\\")\\n */","meta":{"filename":"xen.mjs","lineno":160,"columnno":0,"path":"/home/teknari/lt_gitea/client-ndk/strudel/packages/xen","code":{}},"description":"<p>Frequency transpose. Assumes pattern either has <code>freq</code> set, or has values that can be interpreted as frequencies\\namt has optional <code>edoSize</code> param, defaults to 12.\\nIf haps have edoSize param set, such as from the output of <code>xen("31edo")</code>,\\n<code>ftrans</code> will fallback to that instead of 12 as the default.</p>\\n<p>Transposes the frequency by <code>amt</code> edoSteps</p>","name":"ftranspose","synonyms_text":"ftrans, fTrans, ftranspose, fTranspose","synonyms":["ftrans","fTrans","ftranspose","fTranspose"],"tags":["tonal"],"params":[{"type":{"names":["number"]},"name":"amt"},{"type":{"names":["number"]},"description":"<p>(optional)</p>","name":"edoSize"}],"returns":[{"type":{"names":["Pattern"]}}],"examples":["i(\\"0 1 2\\").xen(\\"12edo\\").ftrans(\\"7\\")\\n// n(\\"0 1 2\\").scale(\\"A:chromatic\\").trans(\\"7\\")","i(\\"0 8 18\\").xen(\\"31edo\\").ftrans(\\"<8 -8>\\")","// to transpose by steps of an edo, use \\"step:edo\\" :\\ni(\\"0 7 8 18\\").xen(\\"31edo\\").ftrans(\\"<0 1:31 1:12>\\")","// it can also work with frequency values directly\\nfreq(\\"200 300 400\\").ftrans(\\"<0 7:31 7>\\")"],"longname":"ftranspose","kind":"member","scope":"global"},{"kind":"package","longname":"package:undefined","files":["/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/autocomplete.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/basicSetup.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/block_utilities.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/codemirror.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/flash.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/highlight.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/html.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/index.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/keybindings.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/labelJump.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/slider.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/CutiePi.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/algoboy.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/androidstudio.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/archBtw.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/atomone.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/aura.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/bbedit.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/blackscreen.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/bluescreen.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/bluescreenlight.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/client-ndk.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/darcula.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/dracula.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/duotoneDark.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/duotoneLight.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/eclipse.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/fruitDaw.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/githubDark.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/githubLight.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/green-text.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/gruvboxDark.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/gruvboxLight.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/materialDark.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/materialLight.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/monokai.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/noctisLilac.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/nord.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/red-text.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/solarizedDark.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/solarizedLight.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/sonic-pink.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/strudel-theme.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/sublime.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/teletext.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/terminal.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/theme-helper.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/tokioNightStorm.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/tokyoNight.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/tokyoNightDay.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/vscodeDark.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/vscodeLight.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/whitescreen.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes/xcodeLight.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/themes.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/tooltip.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/vite.config.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/codemirror/widget.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/bench/pattern.bench.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/bench/signal.bench.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/clockworker.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/controls.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/cyclist.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/drawLine.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/euclid.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/evaluate.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/fraction.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/hap.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/impure.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/index.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/logger.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/neocyclist.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/pattern.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/pick.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/repl.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/schedulerState.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/signal.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/speak.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/state.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/test/controls.test.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/test/drawLine.test.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/test/euclid.test.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/test/fraction.test.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/test/pattern.test.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/test/signal.test.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/test/solmization.test.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/test/util.test.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/test/value.test.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/timespan.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/ui.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/util.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/value.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/vite.config.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/core/zyklus.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/csound/index.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/csound/vite.config.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/desktopbridge/index.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/desktopbridge/loggerbridge.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/desktopbridge/midibridge.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/desktopbridge/oscbridge.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/desktopbridge/utils.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/draw/animate.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/draw/color.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/draw/draw.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/draw/index.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/draw/pianoroll.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/draw/pitchwheel.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/draw/spiral.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/draw/vite.config.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/edo/edo.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/edo/edoscale.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/edo/index.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/edo/intervals.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/edo/pitches.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/edo/ratios.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/edo/test/edo.test.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/edo/test/edoscale.test.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/edo/test/ratios.test.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/edo/vite.config.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/embed/embed.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/gamepad/gamepad.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/gamepad/index.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/gamepad/vite.config.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/hs2js/src/hs2js.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/hs2js/src/index.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/hs2js/src/parser.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/hs2js/vite.config.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/hydra/hydra.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/hydra/vite.config.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/midi/index.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/midi/input.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/midi/midi.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/midi/util.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/midi/vite.config.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/mini/bench/mini.bench.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/mini/index.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/mini/krill-parser.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/mini/mini.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/mini/test/mini.test.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/mini/vite.config.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/mondo/mondo.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/mondo/test/mondo.test.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/mondo/vite.config.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/mondough/mondough.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/mondough/vite.config.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/motion/index.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/motion/motion.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/motion/vite.config.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/mqtt/mqtt.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/mqtt/vite.config.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/osc/osc.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/osc/server.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/osc/superdirtoutput.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/osc/tidal-sniffer.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/osc/vite.config.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/reference/index.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/reference/vite.config.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/repl/index.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/repl/prebake.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/repl/repl-component.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/repl/vite.config.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/sampler/sample-server.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/serial/serial.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/serial/vite.config.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/soundfonts/convert.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/soundfonts/fontloader.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/soundfonts/gm.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/soundfonts/index.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/soundfonts/list.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/soundfonts/sfumato.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/soundfonts/vite.config.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough/audioContext.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough/dspworklet.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough/feedbackdelay.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough/fft.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough/helpers.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough/index.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough/logger.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough/modulators.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough/nodePools.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough/noise.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough/ola-processor.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough/reverb.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough/reverbGen.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough/sampler.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough/superdough.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough/superdoughdata.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough/superdoughoutput.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough/synth.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough/util.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough/vite.config.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough/vowel.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough/wavetable.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough/worklets.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough/zzfx.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/superdough/zzfx_fork.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough/dough-export.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough/dough-worklet.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough/dough.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough/index.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/supradough/vite.config.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/tidal/tidal.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/tonal/index.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/tonal/ireal.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/tonal/test/tonal.test.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/tonal/test/tonleiter.test.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/tonal/tonal.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/tonal/tonleiter.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/tonal/vite.config.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/tonal/voicings.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/transpiler/index.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/transpiler/test/transpiler.test.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/transpiler/transpiler.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/transpiler/vite.config.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/vite-plugin-bundle-audioworklet/vite-plugin-bundle-audioworklet.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/web/vite.config.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/web/web.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/webaudio/index.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/webaudio/scope.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/webaudio/spectrum.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/webaudio/supradough.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/webaudio/vite.config.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/webaudio/webaudio.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/xen/index.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/xen/test/xen.test.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/xen/tune.mjs","/home/teknari/lt_gitea/client-ndk/strudel/packages/xen/tunejs.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/xen/vite.config.js","/home/teknari/lt_gitea/client-ndk/strudel/packages/xen/xen.mjs"]}]`),jsdoc={docs};let html=o=>{const e=document.createElement("template");return e.innerHTML=o.trim(),e.content.childNodes},parseChunk=o=>Array.isArray(o)?o.flat().join(""):o===void 0?"":o,h=(o,...e)=>{let l="";for(let d in o)l+=parseChunk(o[d]),l+=parseChunk(e[d]);return html(l)};function isNamedPitch$1(o){return o!==null&&typeof o=="object"&&"name"in o&&typeof o.name=="string"}function isPitch$1(o){return o!==null&&typeof o=="object"&&"step"in o&&typeof o.step=="number"&&"alt"in o&&typeof o.alt=="number"&&!isNaN(o.step)&&!isNaN(o.alt)}var FIFTHS$1=[0,2,4,-1,1,3,5],STEPS_TO_OCTS$1=FIFTHS$1.map(o=>Math.floor(o*7/12));function coordinates$1(o){const{step:e,alt:l,oct:d,dir:p=1}=o,b=FIFTHS$1[e]+7*l;if(d===void 0)return[p*b];const R=d-STEPS_TO_OCTS$1[e]-4*l;return[p*b,p*R]}var FIFTHS_TO_STEPS$1=[3,0,4,1,5,2,6];function pitch$1(o){const[e,l,d]=o,p=FIFTHS_TO_STEPS$1[unaltered$1(e)],b=Math.floor((e+1)/7);if(l===void 0)return{step:p,alt:b,dir:d};const R=l+4*b+STEPS_TO_OCTS$1[p];return{step:p,alt:b,oct:R,dir:d}}function unaltered$1(o){const e=(o+1)%7;return e<0?7+e:e}var fillStr$5=(o,e)=>Array(Math.abs(e)+1).join(o),NoInterval$1=Object.freeze({empty:!0,name:"",num:NaN,q:"",type:"",step:NaN,alt:NaN,dir:NaN,simple:NaN,semitones:NaN,chroma:NaN,coord:[],oct:NaN}),INTERVAL_TONAL_REGEX$1="([-+]?\\d+)(d{1,4}|m|M|P|A{1,4})",INTERVAL_SHORTHAND_REGEX$1="(AA|A|P|M|m|d|dd)([-+]?\\d+)",REGEX$8=new RegExp("^"+INTERVAL_TONAL_REGEX$1+"|"+INTERVAL_SHORTHAND_REGEX$1+"$");function tokenizeInterval$1(o){const e=REGEX$8.exec(`${o}`);return e===null?["",""]:e[1]?[e[1],e[2]]:[e[4],e[3]]}var cache$5={};function interval$1(o){return typeof o=="string"?cache$5[o]||(cache$5[o]=parse$5(o)):isPitch$1(o)?interval$1(pitchName$3(o)):isNamedPitch$1(o)?interval$1(o.name):NoInterval$1}var SIZES$2=[0,2,4,5,7,9,11],TYPES$1="PMMPPMM";function parse$5(o){const e=tokenizeInterval$1(o);if(e[0]==="")return NoInterval$1;const l=+e[0],d=e[1],p=(Math.abs(l)-1)%7,b=TYPES$1[p];if(b==="M"&&d==="P")return NoInterval$1;const R=b==="M"?"majorable":"perfectable",I=""+l+d,z=l<0?-1:1,se=l===8||l===-8?l:z*(p+1),le=qToAlt$1(R,d),tn=Math.floor((Math.abs(l)-1)/7),an=z*(SIZES$2[p]+le+12*tn),sn=(z*(SIZES$2[p]+le)%12+12)%12,ln=coordinates$1({step:p,alt:le,oct:tn,dir:z});return{empty:!1,name:I,num:l,q:d,step:p,alt:le,dir:z,type:R,simple:se,semitones:an,chroma:sn,coord:ln,oct:tn}}function coordToInterval$1(o,e){const[l,d=0]=o,p=l*7+d*12<0,b=e||p?[-l,-d,-1]:[l,d,1];return interval$1(pitch$1(b))}function qToAlt$1(o,e){return e==="M"&&o==="majorable"||e==="P"&&o==="perfectable"?0:e==="m"&&o==="majorable"?-1:/^A+$/.test(e)?e.length:/^d+$/.test(e)?-1*(o==="perfectable"?e.length:e.length+1):0}function pitchName$3(o){const{step:e,alt:l,oct:d=0,dir:p}=o;if(!p)return"";const b=e+1+7*d,R=b===0?e+1:b,I=p<0?"-":"",z=TYPES$1[e]==="M"?"majorable":"perfectable";return I+R+altToQ$1(z,l)}function altToQ$1(o,e){return e===0?o==="majorable"?"M":"P":e===-1&&o==="majorable"?"m":e>0?fillStr$5("A",e):fillStr$5("d",o==="perfectable"?e:e+1)}var fillStr$4=(o,e)=>Array(Math.abs(e)+1).join(o),NoNote$1=Object.freeze({empty:!0,name:"",letter:"",acc:"",pc:"",step:NaN,alt:NaN,chroma:NaN,height:NaN,coord:[],midi:null,freq:null}),cache$4=new Map,stepToLetter$1=o=>"CDEFGAB".charAt(o),altToAcc$1=o=>o<0?fillStr$4("b",-o):fillStr$4("#",o),accToAlt$1=o=>o[0]==="b"?-o.length:o.length;function note$1(o){const e=JSON.stringify(o),l=cache$4.get(e);if(l)return l;const d=typeof o=="string"?parse$4(o):isPitch$1(o)?note$1(pitchName$2(o)):isNamedPitch$1(o)?note$1(o.name):NoNote$1;return cache$4.set(e,d),d}var REGEX$7=/^([a-gA-G]?)(#{1,}|b{1,}|x{1,}|)(-?\d*)\s*(.*)$/;function tokenizeNote$1(o){const e=REGEX$7.exec(o);return e?[e[1].toUpperCase(),e[2].replace(/x/g,"##"),e[3],e[4]]:["","","",""]}function coordToNote$1(o){return note$1(pitch$1(o))}var mod$1=(o,e)=>(o%e+e)%e,SEMI$1=[0,2,4,5,7,9,11];function parse$4(o){const e=tokenizeNote$1(o);if(e[0]===""||e[3]!=="")return NoNote$1;const l=e[0],d=e[1],p=e[2],b=(l.charCodeAt(0)+3)%7,R=accToAlt$1(d),I=p.length?+p:void 0,z=coordinates$1({step:b,alt:R,oct:I}),se=l+d+p,le=l+d,tn=(SEMI$1[b]+R+120)%12,an=I===void 0?mod$1(SEMI$1[b]+R,12)-12*99:SEMI$1[b]+R+12*(I+1),sn=an>=0&&an<=127?an:null,ln=I===void 0?null:Math.pow(2,(an-69)/12)*440;return{empty:!1,acc:d,alt:R,chroma:tn,coord:z,freq:ln,height:an,letter:l,midi:sn,name:se,oct:I,pc:le,step:b}}function pitchName$2(o){const{step:e,alt:l,oct:d}=o,p=stepToLetter$1(e);if(!p)return"";const b=p+altToAcc$1(l);return d||d===0?b+d:b}function transpose$5(o,e){const l=note$1(o),d=Array.isArray(e)?e:interval$1(e).coord;if(l.empty||!d||d.length<2)return"";const p=l.coord,b=p.length===1?[p[0]+d[0]]:[p[0]+d[0],p[1]+d[1]];return coordToNote$1(b).name}function tonicIntervalsTransposer$1(o,e){const l=o.length;return d=>{if(!e)return"";const p=d<0?(l- -d%l)%l:d%l,b=Math.floor(d/l),R=transpose$5(e,[0,b]);return transpose$5(R,o[p])}}function distance$5(o,e){const l=note$1(o),d=note$1(e);if(l.empty||d.empty)return"";const p=l.coord,b=d.coord,R=b[0]-p[0],I=p.length===2&&b.length===2?b[1]-p[1]:-Math.floor(R*7/12),z=d.height===l.height&&d.midi!==null&&l.oct===d.oct&&l.step>d.step;return coordToInterval$1([R,I],z).name}var fillStr$3=(o,e)=>Array(e+1).join(o),REGEX$6=/^(_{1,}|=|\^{1,}|)([abcdefgABCDEFG])([,']*)$/;function tokenize$4(o){const e=REGEX$6.exec(o);return e?[e[1],e[2],e[3]]:["","",""]}function abcToScientificNotation(o){const[e,l,d]=tokenize$4(o);if(l==="")return"";let p=4;for(let R=0;R<d.length;R++)p+=d.charAt(R)===","?-1:1;const b=e[0]==="_"?e.replace(/_/g,"b"):e[0]==="^"?e.replace(/\^/g,"#"):"";return l.charCodeAt(0)>96?l.toUpperCase()+b+(p+1):l+b+p}function scientificToAbcNotation(o){const e=note$1(o);if(e.empty||!e.oct&&e.oct!==0)return"";const{letter:l,acc:d,oct:p}=e,b=d[0]==="b"?d.replace(/b/g,"_"):d.replace(/#/g,"^"),R=p>4?l.toLowerCase():l,I=p===5?"":p>4?fillStr$3("'",p-5):fillStr$3(",",4-p);return b+R+I}function transpose$4(o,e){return scientificToAbcNotation(transpose$5(abcToScientificNotation(o),e))}function distance$4(o,e){return distance$5(abcToScientificNotation(o),abcToScientificNotation(e))}var abc_notation_default={abcToScientificNotation,scientificToAbcNotation,tokenize:tokenize$4,transpose:transpose$4,distance:distance$4};function ascR$1(o,e){const l=[];for(;e--;l[e]=e+o);return l}function descR$1(o,e){const l=[];for(;e--;l[e]=o-e);return l}function range$1(o,e){return o<e?ascR$1(o,e-o+1):descR$1(o,o-e+1)}function rotate$1(o,e){const l=e.length,d=(o%l+l)%l;return e.slice(d,l).concat(e.slice(0,d))}function compact$1(o){return o.filter(e=>e===0||e)}function sortedNoteNames(o){return o.map(l=>note$1(l)).filter(l=>!l.empty).sort((l,d)=>l.height-d.height).map(l=>l.name)}function sortedUniqNoteNames(o){return sortedNoteNames(o).filter((e,l,d)=>l===0||e!==d[l-1])}function shuffle$1(o,e=Math.random){let l,d,p=o.length;for(;p;)l=Math.floor(e()*p--),d=o[p],o[p]=o[l],o[l]=d;return o}function permutations$1(o){return o.length===0?[[]]:permutations$1(o.slice(1)).reduce((e,l)=>e.concat(o.map((d,p)=>{const b=l.slice();return b.splice(p,0,o[0]),b})),[])}const index$a=Object.freeze(Object.defineProperty({__proto__:null,compact:compact$1,permutations:permutations$1,range:range$1,rotate:rotate$1,shuffle:shuffle$1,sortedNoteNames,sortedUniqNoteNames},Symbol.toStringTag,{value:"Module"}));function ascR(o,e){const l=[];for(;e--;l[e]=e+o);return l}function descR(o,e){const l=[];for(;e--;l[e]=o-e);return l}function range(o,e){return o<e?ascR(o,e-o+1):descR(o,o-e+1)}function rotate(o,e){const l=e.length,d=(o%l+l)%l;return e.slice(d,l).concat(e.slice(0,d))}function compact(o){return o.filter(e=>e===0||e)}function shuffle(o,e=Math.random){let l,d,p=o.length;for(;p;)l=Math.floor(e()*p--),d=o[p],o[p]=o[l],o[l]=d;return o}function permutations(o){return o.length===0?[[]]:permutations(o.slice(1)).reduce((e,l)=>e.concat(o.map((d,p)=>{const b=l.slice();return b.splice(p,0,o[0]),b})),[])}var collection_default={compact,permutations,range,rotate,shuffle},EmptyPcset={empty:!0,name:"",setNum:0,chroma:"000000000000",normalized:"000000000000",intervals:[]},setNumToChroma=o=>Number(o).toString(2).padStart(12,"0"),chromaToNumber=o=>parseInt(o,2),REGEX$5=/^[01]{12}$/;function isChroma(o){return REGEX$5.test(o)}var isPcsetNum=o=>typeof o=="number"&&o>=0&&o<=4095,isPcset=o=>o&&isChroma(o.chroma),cache$3={[EmptyPcset.chroma]:EmptyPcset};function get$b(o){const e=isChroma(o)?o:isPcsetNum(o)?setNumToChroma(o):Array.isArray(o)?listToChroma(o):isPcset(o)?o.chroma:EmptyPcset.chroma;return cache$3[e]=cache$3[e]||chromaToPcset(e)}var pcset$1=get$b,chroma$3=o=>get$b(o).chroma,intervals=o=>get$b(o).intervals,num$1=o=>get$b(o).setNum,IVLS=["1P","2m","2M","3m","3M","4P","5d","5P","6m","6M","7m","7M"];function chromaToIntervals(o){const e=[];for(let l=0;l<12;l++)o.charAt(l)==="1"&&e.push(IVLS[l]);return e}function notes$1(o){return get$b(o).intervals.map(e=>transpose$5("C",e))}function chromas(){return range(2048,4095).map(setNumToChroma)}function modes$1(o,e=!0){const d=get$b(o).chroma.split("");return compact(d.map((p,b)=>{const R=rotate(b,d);return e&&R[0]==="0"?null:R.join("")}))}function isEqual(o,e){return get$b(o).setNum===get$b(e).setNum}function isSubsetOf(o){const e=get$b(o).setNum;return l=>{const d=get$b(l).setNum;return e&&e!==d&&(d&e)===d}}function isSupersetOf(o){const e=get$b(o).setNum;return l=>{const d=get$b(l).setNum;return e&&e!==d&&(d|e)===d}}function isNoteIncludedIn(o){const e=get$b(o);return l=>{const d=note$1(l);return e&&!d.empty&&e.chroma.charAt(d.chroma)==="1"}}function filter(o){const e=isNoteIncludedIn(o);return l=>l.filter(e)}var pcset_default={get:get$b,chroma:chroma$3,num:num$1,intervals,chromas,isSupersetOf,isSubsetOf,isNoteIncludedIn,isEqual,filter,modes:modes$1,notes:notes$1,pcset:pcset$1};function chromaRotations(o){const e=o.split("");return e.map((l,d)=>rotate(d,e).join(""))}function chromaToPcset(o){const e=chromaToNumber(o),l=chromaRotations(o).map(chromaToNumber).filter(b=>b>=2048).sort()[0],d=setNumToChroma(l),p=chromaToIntervals(o);return{empty:!1,name:"",setNum:e,chroma:o,normalized:d,intervals:p}}function listToChroma(o){if(o.length===0)return EmptyPcset.chroma;let e;const l=[0,0,0,0,0,0,0,0,0,0,0,0];for(let d=0;d<o.length;d++)e=note$1(o[d]),e.empty&&(e=interval$1(o[d])),e.empty||(l[e.chroma]=1);return l.join("")}var CHORDS$1=[["1P 3M 5P","major","M ^ maj"],["1P 3M 5P 7M","major seventh","maj7 Δ ma7 M7 Maj7 ^7"],["1P 3M 5P 7M 9M","major ninth","maj9 Δ9 ^9"],["1P 3M 5P 7M 9M 13M","major thirteenth","maj13 Maj13 ^13"],["1P 3M 5P 6M","sixth","6 add6 add13 M6"],["1P 3M 5P 6M 9M","sixth added ninth","6add9 6/9 69 M69"],["1P 3M 6m 7M","major seventh flat sixth","M7b6 ^7b6"],["1P 3M 5P 7M 11A","major seventh sharp eleventh","maj#4 Δ#4 Δ#11 M7#11 ^7#11 maj7#11"],["1P 3m 5P","minor","m min -"],["1P 3m 5P 7m","minor seventh","m7 min7 mi7 -7"],["1P 3m 5P 7M","minor/major seventh","m/ma7 m/maj7 mM7 mMaj7 m/M7 -Δ7 mΔ -^7 -maj7"],["1P 3m 5P 6M","minor sixth","m6 -6"],["1P 3m 5P 7m 9M","minor ninth","m9 -9"],["1P 3m 5P 7M 9M","minor/major ninth","mM9 mMaj9 -^9"],["1P 3m 5P 7m 9M 11P","minor eleventh","m11 -11"],["1P 3m 5P 7m 9M 13M","minor thirteenth","m13 -13"],["1P 3m 5d","diminished","dim ° o"],["1P 3m 5d 7d","diminished seventh","dim7 °7 o7"],["1P 3m 5d 7m","half-diminished","m7b5 ø -7b5 h7 h"],["1P 3M 5P 7m","dominant seventh","7 dom"],["1P 3M 5P 7m 9M","dominant ninth","9"],["1P 3M 5P 7m 9M 13M","dominant thirteenth","13"],["1P 3M 5P 7m 11A","lydian dominant seventh","7#11 7#4"],["1P 3M 5P 7m 9m","dominant flat ninth","7b9"],["1P 3M 5P 7m 9A","dominant sharp ninth","7#9"],["1P 3M 7m 9m","altered","alt7"],["1P 4P 5P","suspended fourth","sus4 sus"],["1P 2M 5P","suspended second","sus2"],["1P 4P 5P 7m","suspended fourth seventh","7sus4 7sus"],["1P 5P 7m 9M 11P","eleventh","11"],["1P 4P 5P 7m 9m","suspended fourth flat ninth","b9sus phryg 7b9sus 7b9sus4"],["1P 5P","fifth","5"],["1P 3M 5A","augmented","aug + +5 ^#5"],["1P 3m 5A","minor augmented","m#5 -#5 m+"],["1P 3M 5A 7M","augmented seventh","maj7#5 maj7+5 +maj7 ^7#5"],["1P 3M 5P 7M 9M 11A","major sharp eleventh (lydian)","maj9#11 Δ9#11 ^9#11"],["1P 2M 4P 5P","","sus24 sus4add9"],["1P 3M 5A 7M 9M","","maj9#5 Maj9#5"],["1P 3M 5A 7m","","7#5 +7 7+ 7aug aug7"],["1P 3M 5A 7m 9A","","7#5#9 7#9#5 7alt"],["1P 3M 5A 7m 9M","","9#5 9+"],["1P 3M 5A 7m 9M 11A","","9#5#11"],["1P 3M 5A 7m 9m","","7#5b9 7b9#5"],["1P 3M 5A 7m 9m 11A","","7#5b9#11"],["1P 3M 5A 9A","","+add#9"],["1P 3M 5A 9M","","M#5add9 +add9"],["1P 3M 5P 6M 11A","","M6#11 M6b5 6#11 6b5"],["1P 3M 5P 6M 7M 9M","","M7add13"],["1P 3M 5P 6M 9M 11A","","69#11"],["1P 3m 5P 6M 9M","","m69 -69"],["1P 3M 5P 6m 7m","","7b6"],["1P 3M 5P 7M 9A 11A","","maj7#9#11"],["1P 3M 5P 7M 9M 11A 13M","","M13#11 maj13#11 M13+4 M13#4"],["1P 3M 5P 7M 9m","","M7b9"],["1P 3M 5P 7m 11A 13m","","7#11b13 7b5b13"],["1P 3M 5P 7m 13M","","7add6 67 7add13"],["1P 3M 5P 7m 9A 11A","","7#9#11 7b5#9 7#9b5"],["1P 3M 5P 7m 9A 11A 13M","","13#9#11"],["1P 3M 5P 7m 9A 11A 13m","","7#9#11b13"],["1P 3M 5P 7m 9A 13M","","13#9"],["1P 3M 5P 7m 9A 13m","","7#9b13"],["1P 3M 5P 7m 9M 11A","","9#11 9+4 9#4"],["1P 3M 5P 7m 9M 11A 13M","","13#11 13+4 13#4"],["1P 3M 5P 7m 9M 11A 13m","","9#11b13 9b5b13"],["1P 3M 5P 7m 9m 11A","","7b9#11 7b5b9 7b9b5"],["1P 3M 5P 7m 9m 11A 13M","","13b9#11"],["1P 3M 5P 7m 9m 11A 13m","","7b9b13#11 7b9#11b13 7b5b9b13"],["1P 3M 5P 7m 9m 13M","","13b9"],["1P 3M 5P 7m 9m 13m","","7b9b13"],["1P 3M 5P 7m 9m 9A","","7b9#9"],["1P 3M 5P 9M","","Madd9 2 add9 add2"],["1P 3M 5P 9m","","Maddb9"],["1P 3M 5d","","Mb5"],["1P 3M 5d 6M 7m 9M","","13b5"],["1P 3M 5d 7M","","M7b5"],["1P 3M 5d 7M 9M","","M9b5"],["1P 3M 5d 7m","","7b5"],["1P 3M 5d 7m 9M","","9b5"],["1P 3M 7m","","7no5"],["1P 3M 7m 13m","","7b13"],["1P 3M 7m 9M","","9no5"],["1P 3M 7m 9M 13M","","13no5"],["1P 3M 7m 9M 13m","","9b13"],["1P 3m 4P 5P","","madd4"],["1P 3m 5P 6m 7M","","mMaj7b6"],["1P 3m 5P 6m 7M 9M","","mMaj9b6"],["1P 3m 5P 7m 11P","","m7add11 m7add4"],["1P 3m 5P 9M","","madd9"],["1P 3m 5d 6M 7M","","o7M7"],["1P 3m 5d 7M","","oM7"],["1P 3m 6m 7M","","mb6M7"],["1P 3m 6m 7m","","m7#5"],["1P 3m 6m 7m 9M","","m9#5"],["1P 3m 5A 7m 9M 11P","","m11A"],["1P 3m 6m 9m","","mb6b9"],["1P 2M 3m 5d 7m","","m9b5"],["1P 4P 5A 7M","","M7#5sus4"],["1P 4P 5A 7M 9M","","M9#5sus4"],["1P 4P 5A 7m","","7#5sus4"],["1P 4P 5P 7M","","M7sus4"],["1P 4P 5P 7M 9M","","M9sus4"],["1P 4P 5P 7m 9M","","9sus4 9sus"],["1P 4P 5P 7m 9M 13M","","13sus4 13sus"],["1P 4P 5P 7m 9m 13m","","7sus4b9b13 7b9b13sus4"],["1P 4P 7m 10m","","4 quartal"],["1P 5P 7m 9m 11P","","11b9"]],data_default$3=CHORDS$1;({...EmptyPcset});var dictionary$2=[],index$9={};function all$3(){return dictionary$2.slice()}function add$6(o,e,l){const d=getQuality$1(o),p={...get$b(o),name:l||"",quality:d,intervals:o,aliases:e};dictionary$2.push(p),p.name&&(index$9[p.name]=p),index$9[p.setNum]=p,index$9[p.chroma]=p,p.aliases.forEach(b=>addAlias$2(p,b))}function addAlias$2(o,e){index$9[e]=o}function getQuality$1(o){const e=l=>o.indexOf(l)!==-1;return e("5A")?"Augmented":e("3M")?"Major":e("5d")?"Diminished":e("3m")?"Minor":"Unknown"}data_default$3.forEach(([o,e,l])=>add$6(o.split(" "),l.split(" "),e)),dictionary$2.sort((o,e)=>o.setNum-e.setNum);var namedSet=o=>{const e=o.reduce((l,d)=>{const p=note$1(d).chroma;return p!==void 0&&(l[p]=l[p]||note$1(d).name),l},{});return l=>e[l]};function detect$1(o,e={}){const l=o.map(p=>note$1(p).pc).filter(p=>p);return note$1.length===0?[]:findMatches(l,1,e).filter(p=>p.weight).sort((p,b)=>b.weight-p.weight).map(p=>p.name)}var BITMASK={anyThirds:384,perfectFifth:16,nonPerfectFifths:40,anySeventh:3},testChromaNumber=o=>e=>!!(e&o),hasAnyThird=testChromaNumber(BITMASK.anyThirds),hasPerfectFifth=testChromaNumber(BITMASK.perfectFifth),hasAnySeventh=testChromaNumber(BITMASK.anySeventh),hasNonPerfectFifth=testChromaNumber(BITMASK.nonPerfectFifths);function hasAnyThirdAndPerfectFifthAndAnySeventh(o){const e=parseInt(o.chroma,2);return hasAnyThird(e)&&hasPerfectFifth(e)&&hasAnySeventh(e)}function withPerfectFifth(o){const e=parseInt(o,2);return hasNonPerfectFifth(e)?o:(e|16).toString(2)}function findMatches(o,e,l){const d=o[0],p=note$1(d).chroma,b=namedSet(o),R=modes$1(o,!1),I=[];return R.forEach((z,se)=>{const le=l.assumePerfectFifth&&withPerfectFifth(z);all$3().filter(an=>l.assumePerfectFifth&&hasAnyThirdAndPerfectFifthAndAnySeventh(an)?an.chroma===le:an.chroma===z).forEach(an=>{const sn=an.aliases[0],ln=b(se);se!==p?I.push({weight:.5*e,name:`${ln}${sn}/${d}`}):I.push({weight:1*e,name:`${ln}${sn}`})})}),I}function isNamedPitch(o){return o!==null&&typeof o=="object"&&"name"in o&&typeof o.name=="string"}var SIZES$1=[0,2,4,5,7,9,11],chroma$2=({step:o,alt:e})=>(SIZES$1[o]+e+120)%12,height=({step:o,alt:e,oct:l,dir:d=1})=>d*(SIZES$1[o]+e+12*(l===void 0?-100:l)),midi$2=o=>{const e=height(o);return o.oct!==void 0&&e>=-12&&e<=115?e+12:null};function isPitch(o){return o!==null&&typeof o=="object"&&"step"in o&&typeof o.step=="number"&&"alt"in o&&typeof o.alt=="number"}var FIFTHS=[0,2,4,-1,1,3,5],STEPS_TO_OCTS=FIFTHS.map(o=>Math.floor(o*7/12));function coordinates(o){const{step:e,alt:l,oct:d,dir:p=1}=o,b=FIFTHS[e]+7*l;if(d===void 0)return[p*b];const R=d-STEPS_TO_OCTS[e]-4*l;return[p*b,p*R]}var FIFTHS_TO_STEPS=[3,0,4,1,5,2,6];function pitch(o){const[e,l,d]=o,p=FIFTHS_TO_STEPS[unaltered(e)],b=Math.floor((e+1)/7);if(l===void 0)return{step:p,alt:b,dir:d};const R=l+4*b+STEPS_TO_OCTS[p];return{step:p,alt:b,oct:R,dir:d}}function unaltered(o){const e=(o+1)%7;return e<0?7+e:e}var fillStr$2=(o,e)=>Array(Math.abs(e)+1).join(o),NoInterval={empty:!0,name:"",acc:""},INTERVAL_TONAL_REGEX="([-+]?\\d+)(d{1,4}|m|M|P|A{1,4})",INTERVAL_SHORTHAND_REGEX="(AA|A|P|M|m|d|dd)([-+]?\\d+)",REGEX$4=new RegExp("^"+INTERVAL_TONAL_REGEX+"|"+INTERVAL_SHORTHAND_REGEX+"$");function tokenizeInterval(o){const e=REGEX$4.exec(`${o}`);return e===null?["",""]:e[1]?[e[1],e[2]]:[e[4],e[3]]}var cache$2={};function interval(o){return typeof o=="string"?cache$2[o]||(cache$2[o]=parse$3(o)):isPitch(o)?interval(pitchName$1(o)):isNamedPitch(o)?interval(o.name):NoInterval}var SIZES=[0,2,4,5,7,9,11],TYPES="PMMPPMM";function parse$3(o){const e=tokenizeInterval(o);if(e[0]==="")return NoInterval;const l=+e[0],d=e[1],p=(Math.abs(l)-1)%7,b=TYPES[p];if(b==="M"&&d==="P")return NoInterval;const R=b==="M"?"majorable":"perfectable",I=""+l+d,z=l<0?-1:1,se=l===8||l===-8?l:z*(p+1),le=qToAlt(R,d),tn=Math.floor((Math.abs(l)-1)/7),an=z*(SIZES[p]+le+12*tn),sn=(z*(SIZES[p]+le)%12+12)%12,ln=coordinates({step:p,alt:le,oct:tn,dir:z});return{empty:!1,name:I,num:l,q:d,step:p,alt:le,dir:z,type:R,simple:se,semitones:an,chroma:sn,coord:ln,oct:tn}}function coordToInterval(o,e){const[l,d=0]=o,p=l*7+d*12<0,b=e||p?[-l,-d,-1]:[l,d,1];return interval(pitch(b))}function qToAlt(o,e){return e==="M"&&o==="majorable"||e==="P"&&o==="perfectable"?0:e==="m"&&o==="majorable"?-1:/^A+$/.test(e)?e.length:/^d+$/.test(e)?-1*(o==="perfectable"?e.length:e.length+1):0}function pitchName$1(o){const{step:e,alt:l,oct:d=0,dir:p}=o;if(!p)return"";const b=e+1+7*d,R=b===0?e+1:b,I=p<0?"-":"",z=TYPES[e]==="M"?"majorable":"perfectable";return I+R+altToQ(z,l)}function altToQ(o,e){return e===0?o==="majorable"?"M":"P":e===-1&&o==="majorable"?"m":e>0?fillStr$2("A",e):fillStr$2("d",o==="perfectable"?e:e+1)}var fillStr$1=(o,e)=>Array(Math.abs(e)+1).join(o),NoNote={empty:!0,name:"",pc:"",acc:""},cache$1=new Map,stepToLetter=o=>"CDEFGAB".charAt(o),altToAcc=o=>o<0?fillStr$1("b",-o):fillStr$1("#",o),accToAlt=o=>o[0]==="b"?-o.length:o.length;function note(o){const e=JSON.stringify(o),l=cache$1.get(e);if(l)return l;const d=typeof o=="string"?parse$2(o):isPitch(o)?note(pitchName(o)):isNamedPitch(o)?note(o.name):NoNote;return cache$1.set(e,d),d}var REGEX$3=/^([a-gA-G]?)(#{1,}|b{1,}|x{1,}|)(-?\d*)\s*(.*)$/;function tokenizeNote(o){const e=REGEX$3.exec(o);return e?[e[1].toUpperCase(),e[2].replace(/x/g,"##"),e[3],e[4]]:["","","",""]}function coordToNote(o){return note(pitch(o))}var mod=(o,e)=>(o%e+e)%e,SEMI=[0,2,4,5,7,9,11];function parse$2(o){const e=tokenizeNote(o);if(e[0]===""||e[3]!=="")return NoNote;const l=e[0],d=e[1],p=e[2],b=(l.charCodeAt(0)+3)%7,R=accToAlt(d),I=p.length?+p:void 0,z=coordinates({step:b,alt:R,oct:I}),se=l+d+p,le=l+d,tn=(SEMI[b]+R+120)%12,an=I===void 0?mod(SEMI[b]+R,12)-12*99:SEMI[b]+R+12*(I+1),sn=an>=0&&an<=127?an:null,ln=I===void 0?null:Math.pow(2,(an-69)/12)*440;return{empty:!1,acc:d,alt:R,chroma:tn,coord:z,freq:ln,height:an,letter:l,midi:sn,name:se,oct:I,pc:le,step:b}}function pitchName(o){const{step:e,alt:l,oct:d}=o,p=stepToLetter(e);if(!p)return"";const b=p+altToAcc(l);return d||d===0?b+d:b}function transpose$3(o,e){const l=note(o),d=Array.isArray(e)?e:interval(e).coord;if(l.empty||!d||d.length<2)return"";const p=l.coord,b=p.length===1?[p[0]+d[0]]:[p[0]+d[0],p[1]+d[1]];return coordToNote(b).name}function tonicIntervalsTransposer(o,e){const l=o.length;return d=>{if(!e)return"";const p=d<0?(l- -d%l)%l:d%l,b=Math.floor(d/l),R=transpose$3(e,[0,b]);return transpose$3(R,o[p])}}function distance$3(o,e){const l=note(o),d=note(e);if(l.empty||d.empty)return"";const p=l.coord,b=d.coord,R=b[0]-p[0],I=p.length===2&&b.length===2?b[1]-p[1]:-Math.floor(R*7/12),z=d.height===l.height&&d.midi!==null&&l.midi!==null&&l.step>d.step;return coordToInterval([R,I],z).name}var fillStr=(o,e)=>Array(Math.abs(e)+1).join(o);function deprecate(o,e,l){return function(...d){return console.warn(`${o} is deprecated. Use ${e}.`),l.apply(this,d)}}var isNamed=deprecate("isNamed","isNamedPitch",isNamedPitch);const Core=Object.freeze(Object.defineProperty({__proto__:null,accToAlt,altToAcc,chroma:chroma$2,coordToInterval,coordToNote,coordinates,deprecate,distance:distance$3,fillStr,height,interval,isNamed,isNamedPitch,isPitch,midi:midi$2,note,pitch,stepToLetter,tokenizeInterval,tokenizeNote,tonicIntervalsTransposer,transpose:transpose$3},Symbol.toStringTag,{value:"Module"}));var CHORDS=[["1P 3M 5P","major","M ^ maj"],["1P 3M 5P 7M","major seventh","maj7 Δ ma7 M7 Maj7 ^7"],["1P 3M 5P 7M 9M","major ninth","maj9 Δ9 ^9"],["1P 3M 5P 7M 9M 13M","major thirteenth","maj13 Maj13 ^13"],["1P 3M 5P 6M","sixth","6 add6 add13 M6"],["1P 3M 5P 6M 9M","sixth added ninth","6add9 6/9 69 M69"],["1P 3M 6m 7M","major seventh flat sixth","M7b6 ^7b6"],["1P 3M 5P 7M 11A","major seventh sharp eleventh","maj#4 Δ#4 Δ#11 M7#11 ^7#11 maj7#11"],["1P 3m 5P","minor","m min -"],["1P 3m 5P 7m","minor seventh","m7 min7 mi7 -7"],["1P 3m 5P 7M","minor/major seventh","m/ma7 m/maj7 mM7 mMaj7 m/M7 -Δ7 mΔ -^7"],["1P 3m 5P 6M","minor sixth","m6 -6"],["1P 3m 5P 7m 9M","minor ninth","m9 -9"],["1P 3m 5P 7M 9M","minor/major ninth","mM9 mMaj9 -^9"],["1P 3m 5P 7m 9M 11P","minor eleventh","m11 -11"],["1P 3m 5P 7m 9M 13M","minor thirteenth","m13 -13"],["1P 3m 5d","diminished","dim ° o"],["1P 3m 5d 7d","diminished seventh","dim7 °7 o7"],["1P 3m 5d 7m","half-diminished","m7b5 ø -7b5 h7 h"],["1P 3M 5P 7m","dominant seventh","7 dom"],["1P 3M 5P 7m 9M","dominant ninth","9"],["1P 3M 5P 7m 9M 13M","dominant thirteenth","13"],["1P 3M 5P 7m 11A","lydian dominant seventh","7#11 7#4"],["1P 3M 5P 7m 9m","dominant flat ninth","7b9"],["1P 3M 5P 7m 9A","dominant sharp ninth","7#9"],["1P 3M 7m 9m","altered","alt7"],["1P 4P 5P","suspended fourth","sus4 sus"],["1P 2M 5P","suspended second","sus2"],["1P 4P 5P 7m","suspended fourth seventh","7sus4 7sus"],["1P 5P 7m 9M 11P","eleventh","11"],["1P 4P 5P 7m 9m","suspended fourth flat ninth","b9sus phryg 7b9sus 7b9sus4"],["1P 5P","fifth","5"],["1P 3M 5A","augmented","aug + +5 ^#5"],["1P 3m 5A","minor augmented","m#5 -#5 m+"],["1P 3M 5A 7M","augmented seventh","maj7#5 maj7+5 +maj7 ^7#5"],["1P 3M 5P 7M 9M 11A","major sharp eleventh (lydian)","maj9#11 Δ9#11 ^9#11"],["1P 2M 4P 5P","","sus24 sus4add9"],["1P 3M 5A 7M 9M","","maj9#5 Maj9#5"],["1P 3M 5A 7m","","7#5 +7 7+ 7aug aug7"],["1P 3M 5A 7m 9A","","7#5#9 7#9#5 7alt"],["1P 3M 5A 7m 9M","","9#5 9+"],["1P 3M 5A 7m 9M 11A","","9#5#11"],["1P 3M 5A 7m 9m","","7#5b9 7b9#5"],["1P 3M 5A 7m 9m 11A","","7#5b9#11"],["1P 3M 5A 9A","","+add#9"],["1P 3M 5A 9M","","M#5add9 +add9"],["1P 3M 5P 6M 11A","","M6#11 M6b5 6#11 6b5"],["1P 3M 5P 6M 7M 9M","","M7add13"],["1P 3M 5P 6M 9M 11A","","69#11"],["1P 3m 5P 6M 9M","","m69 -69"],["1P 3M 5P 6m 7m","","7b6"],["1P 3M 5P 7M 9A 11A","","maj7#9#11"],["1P 3M 5P 7M 9M 11A 13M","","M13#11 maj13#11 M13+4 M13#4"],["1P 3M 5P 7M 9m","","M7b9"],["1P 3M 5P 7m 11A 13m","","7#11b13 7b5b13"],["1P 3M 5P 7m 13M","","7add6 67 7add13"],["1P 3M 5P 7m 9A 11A","","7#9#11 7b5#9 7#9b5"],["1P 3M 5P 7m 9A 11A 13M","","13#9#11"],["1P 3M 5P 7m 9A 11A 13m","","7#9#11b13"],["1P 3M 5P 7m 9A 13M","","13#9"],["1P 3M 5P 7m 9A 13m","","7#9b13"],["1P 3M 5P 7m 9M 11A","","9#11 9+4 9#4"],["1P 3M 5P 7m 9M 11A 13M","","13#11 13+4 13#4"],["1P 3M 5P 7m 9M 11A 13m","","9#11b13 9b5b13"],["1P 3M 5P 7m 9m 11A","","7b9#11 7b5b9 7b9b5"],["1P 3M 5P 7m 9m 11A 13M","","13b9#11"],["1P 3M 5P 7m 9m 11A 13m","","7b9b13#11 7b9#11b13 7b5b9b13"],["1P 3M 5P 7m 9m 13M","","13b9"],["1P 3M 5P 7m 9m 13m","","7b9b13"],["1P 3M 5P 7m 9m 9A","","7b9#9"],["1P 3M 5P 9M","","Madd9 2 add9 add2"],["1P 3M 5P 9m","","Maddb9"],["1P 3M 5d","","Mb5"],["1P 3M 5d 6M 7m 9M","","13b5"],["1P 3M 5d 7M","","M7b5"],["1P 3M 5d 7M 9M","","M9b5"],["1P 3M 5d 7m","","7b5"],["1P 3M 5d 7m 9M","","9b5"],["1P 3M 7m","","7no5"],["1P 3M 7m 13m","","7b13"],["1P 3M 7m 9M","","9no5"],["1P 3M 7m 9M 13M","","13no5"],["1P 3M 7m 9M 13m","","9b13"],["1P 3m 4P 5P","","madd4"],["1P 3m 5P 6m 7M","","mMaj7b6"],["1P 3m 5P 6m 7M 9M","","mMaj9b6"],["1P 3m 5P 7m 11P","","m7add11 m7add4"],["1P 3m 5P 9M","","madd9"],["1P 3m 5d 6M 7M","","o7M7"],["1P 3m 5d 7M","","oM7"],["1P 3m 6m 7M","","mb6M7"],["1P 3m 6m 7m","","m7#5"],["1P 3m 6m 7m 9M","","m9#5"],["1P 3m 5A 7m 9M 11P","","m11A"],["1P 3m 6m 9m","","mb6b9"],["1P 2M 3m 5d 7m","","m9b5"],["1P 4P 5A 7M","","M7#5sus4"],["1P 4P 5A 7M 9M","","M9#5sus4"],["1P 4P 5A 7m","","7#5sus4"],["1P 4P 5P 7M","","M7sus4"],["1P 4P 5P 7M 9M","","M9sus4"],["1P 4P 5P 7m 9M","","9sus4 9sus"],["1P 4P 5P 7m 9M 13M","","13sus4 13sus"],["1P 4P 5P 7m 9m 13m","","7sus4b9b13 7b9b13sus4"],["1P 4P 7m 10m","","4 quartal"],["1P 5P 7m 9m 11P","","11b9"]],data_default$2=CHORDS,NoChordType={...EmptyPcset,name:"",quality:"Unknown",intervals:[],aliases:[]},dictionary$1=[],index$8={};function get$a(o){return index$8[o]||NoChordType}var chordType=deprecate("ChordType.chordType","ChordType.get",get$a);function names$8(){return dictionary$1.map(o=>o.name).filter(o=>o)}function symbols(){return dictionary$1.map(o=>o.aliases[0]).filter(o=>o)}function keys$2(){return Object.keys(index$8)}function all$2(){return dictionary$1.slice()}var entries$2=deprecate("ChordType.entries","ChordType.all",all$2);function removeAll$1(){dictionary$1=[],index$8={}}function add$5(o,e,l){const d=getQuality(o),p={...get$b(o),name:l||"",quality:d,intervals:o,aliases:e};dictionary$1.push(p),p.name&&(index$8[p.name]=p),index$8[p.setNum]=p,index$8[p.chroma]=p,p.aliases.forEach(b=>addAlias$1(p,b))}function addAlias$1(o,e){index$8[e]=o}function getQuality(o){const e=l=>o.indexOf(l)!==-1;return e("5A")?"Augmented":e("3M")?"Major":e("5d")?"Diminished":e("3m")?"Minor":"Unknown"}data_default$2.forEach(([o,e,l])=>add$5(o.split(" "),l.split(" "),e)),dictionary$1.sort((o,e)=>o.setNum-e.setNum);var chord_type_default={names:names$8,symbols,get:get$a,all:all$2,add:add$5,removeAll:removeAll$1,keys:keys$2,entries:entries$2,chordType},SCALES=[["1P 2M 3M 5P 6M","major pentatonic","pentatonic"],["1P 2M 3M 4P 5P 6M 7M","major","ionian"],["1P 2M 3m 4P 5P 6m 7m","minor","aeolian"],["1P 2M 3m 3M 5P 6M","major blues"],["1P 3m 4P 5d 5P 7m","minor blues","blues"],["1P 2M 3m 4P 5P 6M 7M","melodic minor"],["1P 2M 3m 4P 5P 6m 7M","harmonic minor"],["1P 2M 3M 4P 5P 6M 7m 7M","bebop"],["1P 2M 3m 4P 5d 6m 6M 7M","diminished","whole-half diminished"],["1P 2M 3m 4P 5P 6M 7m","dorian"],["1P 2M 3M 4A 5P 6M 7M","lydian"],["1P 2M 3M 4P 5P 6M 7m","mixolydian","dominant"],["1P 2m 3m 4P 5P 6m 7m","phrygian"],["1P 2m 3m 4P 5d 6m 7m","locrian"],["1P 3M 4P 5P 7M","ionian pentatonic"],["1P 3M 4P 5P 7m","mixolydian pentatonic","indian"],["1P 2M 4P 5P 6M","ritusen"],["1P 2M 4P 5P 7m","egyptian"],["1P 3M 4P 5d 7m","neopolitan major pentatonic"],["1P 3m 4P 5P 6m","vietnamese 1"],["1P 2m 3m 5P 6m","pelog"],["1P 2m 4P 5P 6m","kumoijoshi"],["1P 2M 3m 5P 6m","hirajoshi"],["1P 2m 4P 5d 7m","iwato"],["1P 2m 4P 5P 7m","in-sen"],["1P 3M 4A 5P 7M","lydian pentatonic","chinese"],["1P 3m 4P 6m 7m","malkos raga"],["1P 3m 4P 5d 7m","locrian pentatonic","minor seven flat five pentatonic"],["1P 3m 4P 5P 7m","minor pentatonic","vietnamese 2"],["1P 3m 4P 5P 6M","minor six pentatonic"],["1P 2M 3m 5P 6M","flat three pentatonic","kumoi"],["1P 2M 3M 5P 6m","flat six pentatonic"],["1P 2m 3M 5P 6M","scriabin"],["1P 3M 5d 6m 7m","whole tone pentatonic"],["1P 3M 4A 5A 7M","lydian #5P pentatonic"],["1P 3M 4A 5P 7m","lydian dominant pentatonic"],["1P 3m 4P 5P 7M","minor #7M pentatonic"],["1P 3m 4d 5d 7m","super locrian pentatonic"],["1P 2M 3m 4P 5P 7M","minor hexatonic"],["1P 2A 3M 5P 5A 7M","augmented"],["1P 2M 4P 5P 6M 7m","piongio"],["1P 2m 3M 4A 6M 7m","prometheus neopolitan"],["1P 2M 3M 4A 6M 7m","prometheus"],["1P 2m 3M 5d 6m 7m","mystery #1"],["1P 2m 3M 4P 5A 6M","six tone symmetric"],["1P 2M 3M 4A 5A 6A","whole tone","messiaen's mode #1"],["1P 2m 4P 4A 5P 7M","messiaen's mode #5"],["1P 2M 3M 4P 5d 6m 7m","locrian major","arabian"],["1P 2m 3M 4A 5P 6m 7M","double harmonic lydian"],["1P 2m 2A 3M 4A 6m 7m","altered","super locrian","diminished whole tone","pomeroy"],["1P 2M 3m 4P 5d 6m 7m","locrian #2","half-diminished","aeolian b5"],["1P 2M 3M 4P 5P 6m 7m","mixolydian b6","melodic minor fifth mode","hindu"],["1P 2M 3M 4A 5P 6M 7m","lydian dominant","lydian b7","overtone"],["1P 2M 3M 4A 5A 6M 7M","lydian augmented"],["1P 2m 3m 4P 5P 6M 7m","dorian b2","phrygian #6","melodic minor second mode"],["1P 2m 3m 4d 5d 6m 7d","ultralocrian","superlocrian bb7","superlocrian diminished"],["1P 2m 3m 4P 5d 6M 7m","locrian 6","locrian natural 6","locrian sharp 6"],["1P 2A 3M 4P 5P 5A 7M","augmented heptatonic"],["1P 2M 3m 4A 5P 6M 7m","dorian #4","ukrainian dorian","romanian minor","altered dorian"],["1P 2M 3m 4A 5P 6M 7M","lydian diminished"],["1P 2M 3M 4A 5A 7m 7M","leading whole tone"],["1P 2M 3M 4A 5P 6m 7m","lydian minor"],["1P 2m 3M 4P 5P 6m 7m","phrygian dominant","spanish","phrygian major"],["1P 2m 3m 4P 5P 6m 7M","balinese"],["1P 2m 3m 4P 5P 6M 7M","neopolitan major"],["1P 2M 3M 4P 5P 6m 7M","harmonic major"],["1P 2m 3M 4P 5P 6m 7M","double harmonic major","gypsy"],["1P 2M 3m 4A 5P 6m 7M","hungarian minor"],["1P 2A 3M 4A 5P 6M 7m","hungarian major"],["1P 2m 3M 4P 5d 6M 7m","oriental"],["1P 2m 3m 3M 4A 5P 7m","flamenco"],["1P 2m 3m 4A 5P 6m 7M","todi raga"],["1P 2m 3M 4P 5d 6m 7M","persian"],["1P 2m 3M 5d 6m 7m 7M","enigmatic"],["1P 2M 3M 4P 5A 6M 7M","major augmented","major #5","ionian augmented","ionian #5"],["1P 2A 3M 4A 5P 6M 7M","lydian #9"],["1P 2m 2M 4P 4A 5P 6m 7M","messiaen's mode #4"],["1P 2m 3M 4P 4A 5P 6m 7M","purvi raga"],["1P 2m 3m 3M 4P 5P 6m 7m","spanish heptatonic"],["1P 2M 3m 3M 4P 5P 6M 7m","bebop minor"],["1P 2M 3M 4P 5P 5A 6M 7M","bebop major"],["1P 2m 3m 4P 5d 5P 6m 7m","bebop locrian"],["1P 2M 3m 4P 5P 6m 7m 7M","minor bebop"],["1P 2M 3M 4P 5d 5P 6M 7M","ichikosucho"],["1P 2M 3m 4P 5P 6m 6M 7M","minor six diminished"],["1P 2m 3m 3M 4A 5P 6M 7m","half-whole diminished","dominant diminished","messiaen's mode #2"],["1P 3m 3M 4P 5P 6M 7m 7M","kafi raga"],["1P 2M 3M 4P 4A 5A 6A 7M","messiaen's mode #6"],["1P 2M 3m 3M 4P 5d 5P 6M 7m","composite blues"],["1P 2M 3m 3M 4A 5P 6m 7m 7M","messiaen's mode #3"],["1P 2m 2M 3m 4P 4A 5P 6m 6M 7M","messiaen's mode #7"],["1P 2m 2M 3m 3M 4P 5d 5P 6m 6M 7m 7M","chromatic"]],data_default$1=SCALES,NoScaleType={...EmptyPcset,intervals:[],aliases:[]},dictionary=[],index$7={};function names$7(){return dictionary.map(o=>o.name)}function get$9(o){return index$7[o]||NoScaleType}var scaleType=get$9;function all$1(){return dictionary.slice()}var entries$1=all$1;function keys$1(){return Object.keys(index$7)}function removeAll(){dictionary=[],index$7={}}function add$4(o,e,l=[]){const d={...get$b(o),name:e,intervals:o,aliases:l};return dictionary.push(d),index$7[d.name]=d,index$7[d.setNum]=d,index$7[d.chroma]=d,d.aliases.forEach(p=>addAlias(d,p)),d}function addAlias(o,e){index$7[e]=o}data_default$1.forEach(([o,e,...l])=>add$4(o.split(" "),e,l));var scale_type_default={names:names$7,get:get$9,all:all$1,add:add$4,removeAll,keys:keys$1,entries:entries$1,scaleType},NoChord={empty:!0,name:"",symbol:"",root:"",rootDegree:0,type:"",tonic:null,setNum:NaN,quality:"Unknown",chroma:"",normalized:"",aliases:[],notes:[],intervals:[]};function tokenize$3(o){const[e,l,d,p]=tokenizeNote(o);return e===""?["",o]:e==="A"&&p==="ug"?["","aug"]:[e+l,d+p]}function get$8(o){if(o==="")return NoChord;if(Array.isArray(o)&&o.length===2)return getChord(o[1],o[0]);{const[e,l]=tokenize$3(o),d=getChord(l,e);return d.empty?getChord(o):d}}function getChord(o,e,l){const d=get$a(o),p=note(e||""),b=note(l||"");if(d.empty||e&&p.empty||l&&b.empty)return NoChord;const R=distance$3(p.pc,b.pc),I=d.intervals.indexOf(R)+1;if(!b.empty&&!I)return NoChord;const z=Array.from(d.intervals);for(let an=1;an<I;an++){const sn=z[0][0],ln=z[0][1],un=parseInt(sn,10)+7;z.push(`${un}${ln}`),z.shift()}const se=p.empty?[]:z.map(an=>transpose$3(p,an));o=d.aliases.indexOf(o)!==-1?o:d.aliases[0];const le=`${p.empty?"":p.pc}${o}${b.empty||I<=1?"":"/"+b.pc}`,tn=`${e?p.pc+" ":""}${d.name}${I>1&&l?" over "+b.pc:""}`;return{...d,name:tn,symbol:le,type:d.name,root:b.name,intervals:z,rootDegree:I,tonic:p.name,notes:se}}var chord=deprecate("Chord.chord","Chord.get",get$8);function transpose$2(o,e){const[l,d]=tokenize$3(o);return l?transpose$3(l,e)+d:o}function chordScales(o){const e=get$8(o),l=isSupersetOf(e.chroma);return all$1().filter(d=>l(d.chroma)).map(d=>d.name)}function extended$1(o){const e=get$8(o),l=isSupersetOf(e.chroma);return all$2().filter(d=>l(d.chroma)).map(d=>e.tonic+d.aliases[0])}function reduced$1(o){const e=get$8(o),l=isSubsetOf(e.chroma);return all$2().filter(d=>l(d.chroma)).map(d=>e.tonic+d.aliases[0])}function degrees$1(o){const{intervals:e,tonic:l}=get$8(o),d=tonicIntervalsTransposer(e,l);return p=>p?d(p>0?p-1:p):""}function steps$1(o){const{intervals:e,tonic:l}=get$8(o);return tonicIntervalsTransposer(e,l)}var chord_default={getChord,get:get$8,detect:detect$1,chordScales,extended:extended$1,reduced:reduced$1,tokenize:tokenize$3,transpose:transpose$2,degrees:degrees$1,steps:steps$1,chord},DATA=[[.125,"dl",["large","duplex longa","maxima","octuple","octuple whole"]],[.25,"l",["long","longa"]],[.5,"d",["double whole","double","breve"]],[1,"w",["whole","semibreve"]],[2,"h",["half","minim"]],[4,"q",["quarter","crotchet"]],[8,"e",["eighth","quaver"]],[16,"s",["sixteenth","semiquaver"]],[32,"t",["thirty-second","demisemiquaver"]],[64,"sf",["sixty-fourth","hemidemisemiquaver"]],[128,"h",["hundred twenty-eighth"]],[256,"th",["two hundred fifty-sixth"]]],data_default=DATA,VALUES=[];data_default.forEach(([o,e,l])=>add$3(o,e,l));var NoDuration={empty:!0,name:"",value:0,fraction:[0,0],shorthand:"",dots:"",names:[]};function names$6(){return VALUES.reduce((o,e)=>(e.names.forEach(l=>o.push(l)),o),[])}function shorthands(){return VALUES.map(o=>o.shorthand)}var REGEX$2=/^([^.]+)(\.*)$/;function get$7(o){const[e,l,d]=REGEX$2.exec(o)||[],p=VALUES.find(I=>I.shorthand===l||I.names.includes(l));if(!p)return NoDuration;const b=calcDots(p.fraction,d.length),R=b[0]/b[1];return{...p,name:o,dots:d,value:R,fraction:b}}var value=o=>get$7(o).value,fraction=o=>get$7(o).fraction,duration_value_default={names:names$6,shorthands,get:get$7,value,fraction};function add$3(o,e,l){VALUES.push({empty:!1,dots:"",name:"",value:1/o,fraction:o<1?[1/o,1]:[1,o],shorthand:e,names:l})}function calcDots(o,e){const l=Math.pow(2,e);let d=o[0]*l,p=o[1]*l;const b=d;for(let R=0;R<e;R++)d+=b/Math.pow(2,R+1);for(;d%2===0&&p%2===0;)d/=2,p/=2;return[d,p]}function names$5(){return"1P 2M 3M 4P 5P 6m 7m".split(" ")}var get$6=interval,name$1=o=>interval(o).name,semitones=o=>interval(o).semitones,quality=o=>interval(o).q,num=o=>interval(o).num;function simplify$2(o){const e=interval(o);return e.empty?"":e.simple+e.q}function invert(o){const e=interval(o);if(e.empty)return"";const l=(7-e.step)%7,d=e.type==="perfectable"?-e.alt:-(e.alt+1);return interval({step:l,alt:d,oct:e.oct,dir:e.dir}).name}var IN=[1,2,2,3,3,4,5,5,6,6,7,7],IQ="P m M m M P d P m M m M".split(" ");function fromSemitones(o){const e=o<0?-1:1,l=Math.abs(o),d=l%12,p=Math.floor(l/12);return e*(IN[d]+7*p)+IQ[d]}var distance$2=distance$5,add$2=combinator((o,e)=>[o[0]+e[0],o[1]+e[1]]),addTo=o=>e=>add$2(o,e),substract=combinator((o,e)=>[o[0]-e[0],o[1]-e[1]]);function transposeFifths$2(o,e){const l=get$6(o);if(l.empty)return"";const[d,p,b]=l.coord;return coordToInterval([d+e,p,b]).name}var interval_default={names:names$5,get:get$6,name:name$1,num,semitones,quality,fromSemitones,distance:distance$2,invert,simplify:simplify$2,add:add$2,addTo,substract,transposeFifths:transposeFifths$2};function combinator(o){return(e,l)=>{const d=interval(e).coord,p=interval(l).coord;if(d&&p){const b=o(d,p);return coordToInterval(b).name}}}function isMidi(o){return+o>=0&&+o<=127}function toMidi(o){if(isMidi(o))return+o;const e=note$1(o);return e.empty?null:e.midi}function midiToFreq(o,e=440){return Math.pow(2,(o-69)/12)*e}var L2=Math.log(2),L440=Math.log(440);function freqToMidi(o){const e=12*(Math.log(o)-L440)/L2+69;return Math.round(e*100)/100}var SHARPS="C C# D D# E F F# G G# A A# B".split(" "),FLATS="C Db D Eb E F Gb G Ab A Bb B".split(" ");function midiToNoteName(o,e={}){if(isNaN(o)||o===-1/0||o===1/0)return"";o=Math.round(o);const d=(e.sharps===!0?SHARPS:FLATS)[o%12];if(e.pitchClass)return d;const p=Math.floor(o/12)-1;return d+p}function chroma$1(o){return o%12}function pcsetFromChroma(o){return o.split("").reduce((e,l,d)=>(d<12&&l==="1"&&e.push(d),e),[])}function pcsetFromMidi(o){return o.map(chroma$1).sort((e,l)=>e-l).filter((e,l,d)=>l===0||e!==d[l-1])}function pcset(o){return Array.isArray(o)?pcsetFromMidi(o):pcsetFromChroma(o)}function pcsetNearest(o){const e=pcset(o);return l=>{const d=chroma$1(l);for(let p=0;p<12;p++){if(e.includes(d+p))return l+p;if(e.includes(d-p))return l-p}}}function pcsetSteps(o,e){const l=pcset(o),d=l.length;return p=>{const b=p<0?(d- -p%d)%d:p%d,R=Math.floor(p/d);return l[b]+R*12+e}}function pcsetDegrees(o,e){const l=pcsetSteps(o,e);return d=>{if(d!==0)return l(d>0?d-1:d)}}var midi_default={chroma:chroma$1,freqToMidi,isMidi,midiToFreq,midiToNoteName,pcsetNearest,pcset,pcsetDegrees,pcsetSteps,toMidi},NAMES$2=["C","D","E","F","G","A","B"],toName=o=>o.name,onlyNotes=o=>o.map(note$1).filter(e=>!e.empty);function names$4(o){return o===void 0?NAMES$2.slice():Array.isArray(o)?onlyNotes(o).map(toName):[]}var get$5=note$1,name=o=>get$5(o).name,pitchClass=o=>get$5(o).pc,accidentals=o=>get$5(o).acc,octave=o=>get$5(o).oct,midi$1=o=>get$5(o).midi,freq=o=>get$5(o).freq,chroma=o=>get$5(o).chroma;function fromMidi(o){return midiToNoteName(o)}function fromFreq(o){return midiToNoteName(freqToMidi(o))}function fromFreqSharps(o){return midiToNoteName(freqToMidi(o),{sharps:!0})}function fromMidiSharps(o){return midiToNoteName(o,{sharps:!0})}var distance$1=distance$5,transpose$1=transpose$5,tr=transpose$5,transposeBy=o=>e=>transpose$1(e,o),trBy=transposeBy,transposeFrom=o=>e=>transpose$1(o,e),trFrom=transposeFrom;function transposeFifths$1(o,e){return transpose$1(o,[e,0])}var trFifths=transposeFifths$1;function transposeOctaves(o,e){return transpose$1(o,[0,e])}var ascending=(o,e)=>o.height-e.height,descending=(o,e)=>e.height-o.height;function sortedNames(o,e){return e=e||ascending,onlyNotes(o).sort(e).map(toName)}function sortedUniqNames(o){return sortedNames(o,ascending).filter((e,l,d)=>l===0||e!==d[l-1])}var simplify$1=o=>{const e=get$5(o);return e.empty?"":midiToNoteName(e.midi||e.chroma,{sharps:e.alt>0,pitchClass:e.midi===null})};function enharmonic(o,e){const l=get$5(o);if(l.empty)return"";const d=get$5(e||midiToNoteName(l.midi||l.chroma,{sharps:l.alt<0,pitchClass:!0}));if(d.empty||d.chroma!==l.chroma)return"";if(l.oct===void 0)return d.pc;const p=l.chroma-l.alt,b=d.chroma-d.alt,R=p>11||b<0?-1:p<0||b>11?1:0,I=l.oct+R;return d.pc+I}var note_default={names:names$4,get:get$5,name,pitchClass,accidentals,octave,midi:midi$1,ascending,descending,distance:distance$1,sortedNames,sortedUniqNames,fromMidi,fromMidiSharps,freq,fromFreq,fromFreqSharps,chroma,transpose:transpose$1,tr,transposeBy,trBy,transposeFrom,trFrom,transposeFifths:transposeFifths$1,transposeOctaves,trFifths,simplify:simplify$1,enharmonic},NoRomanNumeral={empty:!0,name:"",chordType:""},cache={};function get$4(o){return typeof o=="string"?cache[o]||(cache[o]=parse$1(o)):typeof o=="number"?get$4(NAMES$1[o]||""):isPitch$1(o)?fromPitch(o):isNamedPitch$1(o)?get$4(o.name):NoRomanNumeral}var romanNumeral=get$4;function names$3(o=!0){return(o?NAMES$1:NAMES_MINOR).slice()}function fromPitch(o){return get$4(altToAcc$1(o.alt)+NAMES$1[o.step])}var REGEX$1=/^(#{1,}|b{1,}|x{1,}|)(IV|I{1,3}|VI{0,2}|iv|i{1,3}|vi{0,2})([^IViv]*)$/;function tokenize$2(o){return REGEX$1.exec(o)||["","","",""]}var ROMANS="I II III IV V VI VII",NAMES$1=ROMANS.split(" "),NAMES_MINOR=ROMANS.toLowerCase().split(" ");function parse$1(o){const[e,l,d,p]=tokenize$2(o);if(!d)return NoRomanNumeral;const b=d.toUpperCase(),R=NAMES$1.indexOf(b),I=accToAlt$1(l),z=1;return{empty:!1,name:e,roman:d,interval:interval$1({step:R,alt:I,dir:z}).name,acc:l,chordType:p,alt:I,step:R,major:d===b,oct:0,dir:z}}var roman_numeral_default={names:names$3,get:get$4,romanNumeral},Empty=Object.freeze([]),NoKey={type:"major",tonic:"",alteration:0,keySignature:""},NoKeyScale={tonic:"",grades:Empty,intervals:Empty,scale:Empty,triads:Empty,chords:Empty,chordsHarmonicFunction:Empty,chordScales:Empty,secondaryDominants:Empty,secondaryDominantSupertonics:Empty,substituteDominantsMinorRelative:Empty,substituteDominants:Empty,substituteDominantSupertonics:Empty,secondaryDominantsMinorRelative:Empty},NoMajorKey={...NoKey,...NoKeyScale,type:"major",minorRelative:"",scale:Empty,substituteDominants:Empty,secondaryDominantSupertonics:Empty,substituteDominantsMinorRelative:Empty},NoMinorKey={...NoKey,type:"minor",relativeMajor:"",natural:NoKeyScale,harmonic:NoKeyScale,melodic:NoKeyScale},mapScaleToType=(o,e,l="")=>e.map((d,p)=>`${o[p]}${l}${d}`);function keyScale(o,e,l,d,p){return b=>{const R=o.map(sn=>get$4(sn).interval||""),I=R.map(sn=>transpose$1(b,sn)),z=mapScaleToType(I,l),se=I.map(sn=>transpose$1(sn,"5P")).map(sn=>I.includes(sn)&&!z.includes(sn+"7")?sn+"7":""),le=supertonics(se,e),tn=se.map(sn=>{if(!sn)return"";const ln=sn.slice(0,-1);return transpose$1(ln,"5d")+"7"}),an=supertonics(tn,e);return{tonic:b,grades:o,intervals:R,scale:I,triads:mapScaleToType(I,e),chords:z,chordsHarmonicFunction:d.slice(),chordScales:mapScaleToType(I,p," "),secondaryDominants:se,secondaryDominantSupertonics:le,substituteDominants:tn,substituteDominantSupertonics:an,secondaryDominantsMinorRelative:le,substituteDominantsMinorRelative:an}}}var supertonics=(o,e)=>o.map((l,d)=>{if(!l)return"";const p=l.slice(0,-1),b=transpose$1(p,"5P");return e[d].endsWith("m")?b+"m7":b+"m7b5"}),distInFifths=(o,e)=>{const l=note$1(o),d=note$1(e);return l.empty||d.empty?0:d.coord[0]-l.coord[0]},MajorScale=keyScale("I II III IV V VI VII".split(" ")," m m m dim".split(" "),"maj7 m7 m7 maj7 7 m7 m7b5".split(" "),"T SD T SD D T D".split(" "),"major,dorian,phrygian,lydian,mixolydian,minor,locrian".split(",")),NaturalScale=keyScale("I II bIII IV V bVI bVII".split(" "),"m dim m m ".split(" "),"m7 m7b5 maj7 m7 m7 maj7 7".split(" "),"T SD T SD D SD SD".split(" "),"minor,locrian,major,dorian,phrygian,lydian,mixolydian".split(",")),HarmonicScale=keyScale("I II bIII IV V bVI VII".split(" "),"m dim aug m dim".split(" "),"mMaj7 m7b5 +maj7 m7 7 maj7 o7".split(" "),"T SD T SD D SD D".split(" "),"harmonic minor,locrian 6,major augmented,lydian diminished,phrygian dominant,lydian #9,ultralocrian".split(",")),MelodicScale=keyScale("I II bIII IV V VI VII".split(" "),"m m aug dim dim".split(" "),"m6 m7 +maj7 7 7 m7b5 m7b5".split(" "),"T SD T SD D ".split(" "),"melodic minor,dorian b2,lydian augmented,lydian dominant,mixolydian b6,locrian #2,altered".split(","));function majorKey(o){const e=note$1(o).pc;if(!e)return NoMajorKey;const l=MajorScale(e),d=distInFifths("C",e);return{...l,type:"major",minorRelative:transpose$1(e,"-3m"),alteration:d,keySignature:altToAcc$1(d)}}function minorKey(o){const e=note$1(o).pc;if(!e)return NoMinorKey;const l=distInFifths("C",e)-3;return{type:"minor",tonic:e,relativeMajor:transpose$1(e,"3m"),alteration:l,keySignature:altToAcc$1(l),natural:NaturalScale(e),harmonic:HarmonicScale(e),melodic:MelodicScale(e)}}function majorTonicFromKeySignature(o){return typeof o=="number"?transposeFifths$1("C",o):typeof o=="string"&&/^b+|#+$/.test(o)?transposeFifths$1("C",accToAlt$1(o)):null}var key_default={majorKey,majorTonicFromKeySignature,minorKey},get$3=interval$1;function simplify(o){const e=interval$1(o);return e.empty?"":e.simple+e.q}function transposeFifths(o,e){const l=get$3(o);if(l.empty)return"";const[d,p,b]=l.coord;return coordToInterval$1([d+e,p,b]).name}var MODES=[[0,2773,0,"ionian","","Maj7","major"],[1,2902,2,"dorian","m","m7"],[2,3418,4,"phrygian","m","m7"],[3,2741,-1,"lydian","","Maj7"],[4,2774,1,"mixolydian","","7"],[5,2906,3,"aeolian","m","m7","minor"],[6,3434,5,"locrian","dim","m7b5"]],NoMode={...EmptyPcset,name:"",alt:0,modeNum:NaN,triad:"",seventh:"",aliases:[]},modes=MODES.map(toMode),index$6={};modes.forEach(o=>{index$6[o.name]=o,o.aliases.forEach(e=>{index$6[e]=o})});function get$2(o){return typeof o=="string"?index$6[o.toLowerCase()]||NoMode:o&&o.name?get$2(o.name):NoMode}var mode=get$2;function all(){return modes.slice()}var entries=all;function names$2(){return modes.map(o=>o.name)}function toMode(o){const[e,l,d,p,b,R,I]=o,z=I?[I]:[],se=Number(l).toString(2);return{empty:!1,intervals:get$9(p).intervals,modeNum:e,chroma:se,normalized:se,name:p,setNum:l,alt:d,triad:b,seventh:R,aliases:z}}function notes(o,e){return get$2(o).intervals.map(l=>transpose$5(e,l))}function chords(o){return(e,l)=>{const d=get$2(e);if(d.empty)return[];const p=rotate(d.modeNum,o),b=d.intervals.map(R=>transpose$5(l,R));return p.map((R,I)=>b[I]+R)}}var triads$1=chords(MODES.map(o=>o[4])),seventhChords=chords(MODES.map(o=>o[5]));function distance(o,e){const l=get$2(e),d=get$2(o);return l.empty||d.empty?"":simplify(transposeFifths("1P",d.alt-l.alt))}function relativeTonic(o,e,l){return transpose$5(l,distance(o,e))}var mode_default={get:get$2,names:names$2,all,distance,relativeTonic,notes,triads:triads$1,seventhChords,entries,mode};function tokenize$1(o){const[e,l,d,p]=tokenizeNote$1(o);return e===""?tokenizeBass("",o):e==="A"&&p==="ug"?tokenizeBass("","aug"):tokenizeBass(e+l,d+p)}function tokenizeBass(o,e){const l=e.split("/");if(l.length===1)return[o,l[0],""];const[d,p,b,R]=tokenizeNote$1(l[1]);return d!==""&&b===""&&R===""?[o,l[0],d+p]:[o,e,""]}function fromRomanNumerals(o,e){return e.map(get$4).map(d=>transpose$5(o,interval$1(d))+d.chordType)}function toRomanNumerals(o,e){return e.map(l=>{const[d,p]=tokenize$1(l),b=distance$5(o,d);return get$4(interval$1(b)).name+p})}var progression_default={fromRomanNumerals,toRomanNumerals};function numeric(o){const e=compact(o.map(l=>typeof l=="number"?l:toMidi(l)));return!o.length||e.length!==o.length?[]:e.reduce((l,d)=>{const p=l[l.length-1];return l.concat(range(p,d).slice(1))},[e[0]])}function chromatic(o,e){return numeric(o).map(l=>midiToNoteName(l,e))}var range_default={numeric,chromatic},NoScale={empty:!0,name:"",type:"",tonic:null,setNum:NaN,chroma:"",normalized:"",aliases:[],notes:[],intervals:[]};function tokenize(o){if(typeof o!="string")return["",""];const e=o.indexOf(" "),l=note$1(o.substring(0,e));if(l.empty){const p=note$1(o);return p.empty?["",o]:[p.name,""]}const d=o.substring(l.name.length+1).toLowerCase();return[l.name,d.length?d:""]}var names$1=names$7;function get$1(o){const e=Array.isArray(o)?o:tokenize(o),l=note$1(e[0]).name,d=get$9(e[1]);if(d.empty)return NoScale;const p=d.name,b=l?d.intervals.map(I=>transpose$5(l,I)):[],R=l?l+" "+p:p;return{...d,name:R,type:p,tonic:l,notes:b}}var scale$1=get$1;function detect(o,e={}){const l=chroma$3(o),d=note$1(e.tonic??o[0]??""),p=d.chroma;if(p===void 0)return[];const b=l.split("");b[p]="1";const R=rotate(p,b).join(""),I=all$1().find(se=>se.chroma===R),z=[];return I&&z.push(d.name+" "+I.name),e.match==="exact"||extended(R).forEach(se=>{z.push(d.name+" "+se)}),z}function scaleChords(o){const e=get$1(o),l=isSubsetOf(e.chroma);return all$3().filter(d=>l(d.chroma)).map(d=>d.aliases[0])}function extended(o){const e=isChroma(o)?o:get$1(o).chroma,l=isSupersetOf(e);return all$1().filter(d=>l(d.chroma)).map(d=>d.name)}function reduced(o){const e=isSubsetOf(get$1(o).chroma);return all$1().filter(l=>e(l.chroma)).map(l=>l.name)}function scaleNotes(o){const e=o.map(p=>note$1(p).pc).filter(p=>p),l=e[0],d=sortedUniqNames(e);return rotate(d.indexOf(l),d)}function modeNames(o){const e=get$1(o);if(e.empty)return[];const l=e.tonic?e.notes:e.intervals;return modes$1(e.chroma).map((d,p)=>{const b=get$1(d).name;return b?[l[p],b]:["",""]}).filter(d=>d[0])}function getNoteNameOf(o){const e=Array.isArray(o)?scaleNotes(o):get$1(o).notes,l=e.map(d=>note$1(d).chroma);return d=>{const p=note$1(typeof d=="number"?fromMidi(d):d),b=p.height;if(b===void 0)return;const R=b%12,I=l.indexOf(R);if(I!==-1)return enharmonic(p.name,e[I])}}function rangeOf(o){const e=getNoteNameOf(o);return(l,d)=>{const p=note$1(l).height,b=note$1(d).height;return p===void 0||b===void 0?[]:range(p,b).map(e).filter(R=>R)}}function degrees(o){const{intervals:e,tonic:l}=get$1(o),d=tonicIntervalsTransposer$1(e,l);return p=>p?d(p>0?p-1:p):""}function steps(o){const{intervals:e,tonic:l}=get$1(o);return tonicIntervalsTransposer$1(e,l)}var scale_default={degrees,detect,extended,get:get$1,modeNames,names:names$1,rangeOf,reduced,scaleChords,scaleNotes,steps,tokenize,scale:scale$1},NONE={empty:!0,name:"",upper:void 0,lower:void 0,type:void 0,additive:[]},NAMES=["4/4","3/4","2/4","2/2","12/8","9/8","6/8","3/8"];function names(){return NAMES.slice()}var REGEX=/^(\d*\d(?:\+\d)*)\/(\d+)$/,CACHE=new Map;function get(o){const e=JSON.stringify(o),l=CACHE.get(e);if(l)return l;const d=build(parse(o));return CACHE.set(e,d),d}function parse(o){if(typeof o=="string"){const[b,R,I]=REGEX.exec(o)||[];return parse([R,I])}const[e,l]=o,d=+l;if(typeof e=="number")return[e,d];const p=e.split("+").map(b=>+b);return p.length===1?[p[0],d]:[p,d]}var time_signature_default={names,parse,get},isPowerOfTwo=o=>Math.log(o)/Math.log(2)%1===0;function build([o,e]){const l=Array.isArray(o)?o.reduce((I,z)=>I+z,0):o,d=e;if(l===0||d===0)return NONE;const p=Array.isArray(o)?`${o.join("+")}/${e}`:`${o}/${e}`,b=Array.isArray(o)?o:[],R=d===4||d===2?"simple":d===8&&l%3===0?"compound":isPowerOfTwo(d)?"irregular":"irrational";return{empty:!1,name:p,type:R,upper:l,lower:d,additive:b}}var Tonal=Core,PcSet=pcset_default,ChordDictionary=chord_type_default,ScaleDictionary=scale_type_default;const dist$1=Object.freeze(Object.defineProperty({__proto__:null,AbcNotation:abc_notation_default,Array:index$a,Chord:chord_default,ChordDictionary,ChordType:chord_type_default,Collection:collection_default,Core,DurationValue:duration_value_default,Interval:interval_default,Key:key_default,Midi:midi_default,Mode:mode_default,Note:note_default,PcSet,Pcset:pcset_default,Progression:progression_default,Range:range_default,RomanNumeral:roman_numeral_default,Scale:scale_default,ScaleDictionary,ScaleType:scale_type_default,TimeSignature:time_signature_default,Tonal,accToAlt,altToAcc,chroma:chroma$2,coordToInterval,coordToNote,coordinates,deprecate,distance:distance$3,fillStr,height,interval,isNamed,isNamedPitch,isPitch,midi:midi$2,note,pitch,stepToLetter,tokenizeInterval,tokenizeNote,tonicIntervalsTransposer,transpose:transpose$3},Symbol.toStringTag,{value:"Module"})),flats=["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"],pcs=["c","db","d","eb","e","f","gb","g","ab","a","bb","b"],sharps=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],accs={b:-1,"#":1},pc2chroma=o=>{const[e,...l]=o.split("");return pcs.indexOf(e.toLowerCase())+l.reduce((d,p)=>d+accs[p],0)};function tokenizeChord$1(o){const e=(o||"").match(/^([A-G][b#]*)([^/]*)[/]?([A-G][b#]*)?$/);return e?e.slice(1):[]}const midi2chroma=o=>o%12,step2semitones=o=>{let e=Number(o);return isNaN(e)?interval_default.semitones(o):e},x2midi=(o,e)=>{if(typeof o=="number")return o;if(typeof o=="string")return noteToMidi$1(o,e)},midi2note=(o,e=!1)=>{const l=Math.floor(o/12)-1;return(e?sharps:flats)[o%12]+l};function scaleStep$1(o,e,l=1){o=o.map(p=>typeof p=="string"?noteToMidi$1(p):p);const d=Math.floor(e/o.length)*l*12;return e=_mod$2(e,o.length),o[e]+d}function nearestNumberIndex(o,e,l){let d=0,p=1/0;return e.forEach((b,R)=>{const I=Math.abs(b-o);(!l&&I<p||l&&I<=p)&&(d=R,p=I)}),d}let scaleSteps={};function stepInNamedScale(o,e,l,d){const[p,b]=scale_default.tokenize(e),R=x2midi(p),I=midi2chroma(R);if(!scaleSteps[b]){const{intervals:an}=scale_default.get(`C ${b}`);scaleSteps[b]=an.map(step2semitones)}const z=scaleSteps[b];if(!z)return null;let se=R;if(l){l=x2midi(l,3);const an=midi2chroma(l),sn=_mod$2(an-I,12),ln=nearestNumberIndex(sn,z,d);o=o+ln,se=l-sn}const le=Math.floor(o/z.length)*12;return o=_mod$2(o,z.length),z[o]+se+le}let modeTarget={below:o=>o.slice(-1)[0],duck:o=>o.slice(-1)[0],above:o=>o[0],root:o=>o[0]};function renderVoicing({chord:o,dictionary:e,offset:l=0,n:d,mode:p="below",anchor:b="c5",octaves:R=1}){const[I,z]=tokenizeChord$1(o),se=pc2chroma(I);b=x2midi(b?.note||b,4);const le=midi2chroma(b),tn=e[z].map(Sn=>(typeof Sn=="string"?Sn.split(" "):Sn).map(step2semitones));let an,sn,ln=tn.map((Sn,An)=>{const Dn=modeTarget[p](Sn),Bn=_mod$2(le-Dn-se,12);return(an===void 0||Bn<an)&&(an=Bn,sn=An),Bn});p==="root"&&(sn=0);const un=Math.ceil(l/tn.length)*12,pn=_mod$2(sn+l,tn.length),yn=tn[pn],_n=modeTarget[p](yn),Pn=b-ln[pn]+un,vn=yn.map(Sn=>Pn-_n+Sn);let bn=vn.map(Sn=>midi2note(Sn));return p==="duck"&&(bn=bn.filter((Sn,An)=>vn[An]!==b)),d!==void 0?[scaleStep$1(bn,d,R)]:bn}const octavesInterval=o=>(o<=0?-1:1)+o*7+"P";function getScale(o){o=o.replaceAll(":"," ");const e=scale_default.get(o),{tonic:l,empty:d}=e;if(d&&isNote(o)||d&&!l)throw new Error(`Scale name ${o} is incomplete. Make sure to use ":" instead of spaces, example: .scale("C:major")`);if(d)throw new Error(`Invalid scale name "${o}"`);return e}function scaleStep(o,e){o=Math.ceil(o);let{intervals:l,tonic:d}=getScale(e);d=d||"C";const{pc:p,oct:b=3}=note_default.get(d),R=Math.floor(o/l.length),I=_mod$2(o,l.length),z=interval_default.add(l[I],octavesInterval(R));return note_default.transpose(p+b,z)}function scaleOffset(o,e,l){let{notes:d}=getScale(o);if(d=d.map(tn=>note_default.get(tn).pc),e=Number(e),isNaN(e))throw new Error(`scale offset "${e}" not a number`);const{pc:p,oct:b=3}=note_default.get(l),R=d.indexOf(p);if(R===-1)throw new Error(`note "${l}" is not in scale "${o}"`);let I=R,z=b,se=p;const le=Math.sign(e);for(;Math.abs(I-R)<Math.abs(e);){I+=le;const tn=_mod$2(I,d.length);le<0&&se[0]==="C"&&(z+=le),se=d[tn],le>0&&se[0]==="C"&&(z+=le)}return se+z}const{transpose,trans}=register(["transpose","trans"],function(e,l){return l.withHap(d=>{const p=d.value.note??d.value;if(typeof p=="number"){let I;typeof e=="number"?I=e:typeof e=="string"&&(I=interval_default.semitones(e)||0);const z=p+I;return typeof d.value=="object"?d.withValue(()=>({...d.value,note:z})):d.withValue(()=>z)}if(typeof p!="string"||!isNote(p))return logger$2(`[tonal] transpose: not a note "${p}"`,"warning"),d;const b=isNaN(Number(e))?String(e):interval_default.fromSemitones(e),R=note_default.transpose(p,b);return typeof d.value=="object"?d.withValue(()=>({...d.value,note:R})):d.withValue(()=>R)})}),{scaleTranspose,scaleTrans,strans}=register(["scaleTranspose","scaleTrans","strans"],function(o,e){return e.withHap(l=>{if(!l.context.scale)throw new Error("can only use scaleTranspose after .scale");if(typeof l.value=="object")return l.withValue(()=>({...l.value,note:scaleOffset(l.context.scale,Number(o),l.value.note)}));if(typeof l.value!="string")throw new Error("can only use scaleTranspose with notes");return l.withValue(()=>scaleOffset(l.context.scale,Number(o),l.value))})});function _convertStepToNumberAndOffset(o){let e=Number(o),l=0;if(isNaN(e)){o=String(o);const d=/^(-?\d+)([#bsf]*)$/.exec(o);if(!d)throw new Error(`invalid scale step "${o}", expected number or integer with optional # b suffixes`);e=Number(d[1]);const p=d[2]||"";l=getAccidentalsOffset$1(p)}return[e,l]}let scaleToMidisAndNotes={};function _getNearestScaleNote(o,e,l=!0){let d=typeof e=="string"?noteToMidi$1(e):e;if(scaleToMidisAndNotes[o]===void 0){const{intervals:tn,tonic:an}=getScale(o),{pc:sn}=note_default.get(an),un=tn.concat("8P").map(yn=>note_default.transpose(sn+"0",yn)),pn=un.map(noteToMidi$1);scaleToMidisAndNotes[o]=[pn,un]}const[p,b]=scaleToMidisAndNotes[o],R=p[0],I=Math.floor((d-R)/12),z=p.map(tn=>tn+12*I),se=nearestNumberIndex(d,z,l),le=b[se];return note_default.transpose(le,interval_default.fromSemitones(12*I))}const scale=register("scale",function(o,e){return Array.isArray(o)&&(o=o.flat().join(" ")),e.withHaps(l=>(l=l.map(d=>{let p=d.value;const b=typeof p=="object";p=b?p:{n:p};const{note:R,n:I,value:z,...se}=p,le=R??I??z;if(le===void 0)return logger$2(`[tonal] Invalid value format for 'scale'. Value must contain n, note, or value but received keys [${Object.keys(p).join(", ")}]`,"error"),d;let tn;if(isNote(le))tn=_getNearestScaleNote(o,le),d.value={...se,note:tn};else try{const[an,sn]=_convertStepToNumberAndOffset(le);se.anchor?tn=stepInNamedScale(an,o,se.anchor):tn=scaleStep(an,o),sn!=0&&(tn=note_default.transpose(tn,interval_default.fromSemitones(sn)))}catch(an){errorLogger$1(an,"tonal");return}return d.value=b?{...se,note:tn}:tn,d.setContext({...d.context,scale:o})}),removeUndefineds(l)))},!0,!0);var dist={},dictionaryVoicing$1={},getBestVoicing={},hasRequiredGetBestVoicing;function requireGetBestVoicing(){if(hasRequiredGetBestVoicing)return getBestVoicing;hasRequiredGetBestVoicing=1,getBestVoicing.__esModule=!0,getBestVoicing.getBestVoicing=void 0;function o(e){var l=e.chord,d=e.range,p=e.finder,b=e.picker,R=e.lastVoicing,I=p(l,d);return I.length?b(I,R):[]}return getBestVoicing.getBestVoicing=o,getBestVoicing}var voicingsInRange={};const require$$0=getAugmentedNamespace(dist$1);var tokenizeChord={},hasRequiredTokenizeChord;function requireTokenizeChord(){if(hasRequiredTokenizeChord)return tokenizeChord;hasRequiredTokenizeChord=1,tokenizeChord.__esModule=!0,tokenizeChord.tokenizeChord=void 0;function o(e){var l=(e||"").match(/^([A-G][b#]*)([^\/]*)[\/]?([A-G][b#]*)?$/);return l?l.slice(1):[]}return tokenizeChord.tokenizeChord=o,tokenizeChord}var hasRequiredVoicingsInRange;function requireVoicingsInRange(){if(hasRequiredVoicingsInRange)return voicingsInRange;hasRequiredVoicingsInRange=1,voicingsInRange.__esModule=!0,voicingsInRange.voicingsInRange=void 0;var o=require$$0,e=requireDictionaryVoicing(),l=requireTokenizeChord();function d(p,b,R){b===void 0&&(b=e.lefthand),R===void 0&&(R=["D3","A4"]);var I=(0,l.tokenizeChord)(p),z=I[0],se=I[1];if(!b[se])return[];var le=b[se].map(function(an){return an.split(" ")}),tn=o.Range.chromatic(R);return le.reduce(function(an,sn){var ln=sn.map(function(_n){return o.Interval.substract(_n,sn[0])}),un=o.Note.transpose(z,sn[0]),pn=tn.filter(function(_n){return o.Note.chroma(_n)===o.Note.chroma(un)}).filter(function(_n){return o.Note.midi(o.Note.transpose(_n,ln[ln.length-1]))<=o.Note.midi(R[1])}).map(function(_n){return o.Note.enharmonic(_n,un)}),yn=pn.map(function(_n){return ln.map(function(Pn){return o.Note.transpose(_n,Pn)})});return an.concat(yn)},[])}return voicingsInRange.voicingsInRange=d,voicingsInRange}var hasRequiredDictionaryVoicing;function requireDictionaryVoicing(){return hasRequiredDictionaryVoicing||(hasRequiredDictionaryVoicing=1,function(o){var e=dictionaryVoicing$1.__assign||function(){return e=Object.assign||function(I){for(var z,se=1,le=arguments.length;se<le;se++){z=arguments[se];for(var tn in z)Object.prototype.hasOwnProperty.call(z,tn)&&(I[tn]=z[tn])}return I},e.apply(this,arguments)},l=dictionaryVoicing$1.__rest||function(I,z){var se={};for(var le in I)Object.prototype.hasOwnProperty.call(I,le)&&z.indexOf(le)<0&&(se[le]=I[le]);if(I!=null&&typeof Object.getOwnPropertySymbols=="function")for(var tn=0,le=Object.getOwnPropertySymbols(I);tn<le.length;tn++)z.indexOf(le[tn])<0&&Object.prototype.propertyIsEnumerable.call(I,le[tn])&&(se[le[tn]]=I[le[tn]]);return se};o.__esModule=!0,o.dictionaryVoicing=o.dictionaryVoicingFinder=o.triads=o.guidetones=o.lefthand=void 0;var d=requireGetBestVoicing(),p=requireVoicingsInRange();o.lefthand={m7:["3m 5P 7m 9M","7m 9M 10m 12P"],7:["3M 6M 7m 9M","7m 9M 10M 13M"],"^7":["3M 5P 7M 9M","7M 9M 10M 12P"],69:["3M 5P 6A 9M"],m7b5:["3m 5d 7m 8P","7m 8P 10m 12d"],"7b9":["3M 6m 7m 9m","7m 9m 10M 13m"],"7b13":["3M 6m 7m 9m","7m 9m 10M 13m"],o7:["1P 3m 5d 6M","5d 6M 8P 10m"],"7#11":["7m 9M 11A 13A"],"7#9":["3M 7m 9A"],mM7:["3m 5P 7M 9M","7M 9M 10m 12P"],m6:["3m 5P 6M 9M","6M 9M 10m 12P"]},o.guidetones={m7:["3m 7m","7m 10m"],m9:["3m 7m","7m 10m"],7:["3M 7m","7m 10M"],"^7":["3M 7M","7M 10M"],"^9":["3M 7M","7M 10M"],69:["3M 6M"],6:["3M 6M","6M 10M"],m7b5:["3m 7m","7m 10m"],"7b9":["3M 7m","7m 10M"],"7b13":["3M 7m","7m 10M"],o7:["3m 6M","6M 10m"],"7#11":["3M 7m","7m 10M"],"7#9":["3M 7m","7m 10M"],mM7:["3m 7M","7M 10m"],m6:["3m 6M","6M 10m"]},o.triads={M:["1P 3M 5P","3M 5P 8P","5P 8P 10M"],m:["1P 3m 5P","3m 5P 8P","5P 8P 10m"],o:["1P 3m 5d","3m 5d 8P","5d 8P 10m"],aug:["1P 3m 5A","3m 5A 8P","5A 8P 10m"]};var b=function(I){return function(z,se){return(0,p.voicingsInRange)(z,I,se)}};o.dictionaryVoicingFinder=b;var R=function(I){var z=I.dictionary,se=I.range,le=l(I,["dictionary","range"]);return(0,d.getBestVoicing)(e(e({},le),{range:se,finder:(0,o.dictionaryVoicingFinder)(z)}))};o.dictionaryVoicing=R}(dictionaryVoicing$1)),dictionaryVoicing$1}var minTopNoteDiff$1={},hasRequiredMinTopNoteDiff;function requireMinTopNoteDiff(){if(hasRequiredMinTopNoteDiff)return minTopNoteDiff$1;hasRequiredMinTopNoteDiff=1,minTopNoteDiff$1.__esModule=!0,minTopNoteDiff$1.minTopNoteDiff=void 0;var o=require$$0;function e(l,d){if(!d)return l[0];var p=function(b){return Math.abs(o.Note.midi(d[d.length-1])-o.Note.midi(b[b.length-1]))};return l.reduce(function(b,R){return p(R)<p(b)?R:b},l[0])}return minTopNoteDiff$1.minTopNoteDiff=e,minTopNoteDiff$1}var hasRequiredDist;function requireDist(){return hasRequiredDist||(hasRequiredDist=1,function(o){o.__esModule=!0;var e=requireDictionaryVoicing(),l=requireMinTopNoteDiff(),d=requireGetBestVoicing(),p=requireTokenizeChord();o.default={tokenizeChord:p.tokenizeChord,getBestVoicing:d.getBestVoicing,dictionaryVoicing:e.dictionaryVoicing,dictionaryVoicingFinder:e.dictionaryVoicingFinder,lefthand:e.lefthand,guidetones:e.guidetones,triads:e.triads,minTopNoteDiff:l.minTopNoteDiff}}(dist)),dist}var distExports=requireDist();const _voicings=getDefaultExportFromCjs(distExports),simple={2:["1P 5P 8P 9M","1P 5P 8P 9M 12P","5P 8P 9M 12P"],5:["1P 5P 8P 12P","5P 8P 12P 15P"],6:["1P 5P 6M 8P 10M","1P 5P 8P 10M 13M","3M 5P 8P 10M 13M","5P 8P 10M 12P 13M"],7:["1P 5P 7m 8P 10M","1P 7m 8P 10M 12P","3M 7m 8P 10M 12P","3M 7m 8P 10M 14m","3M 7m 10M 12P 15P","7m 10M 12P 14m 15P","7m 10M 12P 15P 17M"],9:["1P 5P 7m 9M 10M","1P 7m 9M 10M 12P","3M 7m 8P 9M 12P","7m 9M 10M 14m 15P","3M 7m 8P 12P 16M","7m 10M 12P 15P 16M"],11:["1P 5P 7m 9M 11P","5P 7m 8P 9M 11P","7m 8P 9M 11P 12P","7m 8P 11P 12P 16M"],13:["1P 6M 7m 9M 10M","1P 7m 9M 10M 13M","3M 7m 8P 9M 13M","7m 8P 9M 10M 13M","7m 9M 10M 13M 15P"],69:["1P 5P 6M 9M 10M","1P 5P 9M 10M 13M","3M 5P 8P 9M 13M","5P 8P 9M 10M 13M"],add9:["1P 5P 8P 9M 10M","1P 5P 9M 10M 12P","3M 8P 9M 10M 12P","3M 8P 9M 12P 15P","5P 8P 9M 12P 17M"],"+":["1P 3M 6m 8P 10M","1P 6m 8P 10M 13m","3M 6m 8P 10M 13m","3M 8P 10M 13m 15P","6m 8P 10M 13m 15P","6m 10M 13m 15P 17M"],o:["1P 5d 8P 10m 12d","3m 8P 10m 12d 15P","5d 8P 10m 12d 15P"],h:["3m 5d 7m 8P 10m","1P 5d 7m 10m 12d","3m 7m 8P 10m 12d","3m 7m 8P 12d 14m","5d 7m 8P 10m 14m","5d 8P 10m 12d 14m","7m 10m 12d 14m 15P","5d 8P 10m 14m 17m"],sus:["1P 4P 5P 8P","1P 4P 5P 8P 11P","5P 8P 11P 12P","5P 8P 11P 12P 15P"],"^":["1P 5P 8P 10M","1P 5P 8P 10M 12P","3M 5P 8P 10M 12P","3M 8P 10M 12P 15P","5P 8P 10M 12P 15P"],"-":["1P 3m 5P 8P 10m","1P 5P 8P 10m 12P","3m 5P 8P 10m 12P","5P 8P 10m 12P 15P"],"^7":["1P 5P 7M 10M 12P","1P 10M 12P 14M","3M 8P 10M 12P 14M","5P 8P 10M 12P 14M","5P 8P 10M 14M 17M"],"-7":["1P 3m 5P 7m 10m","1P 5P 7m 10m 12P","3m 7m 8P 10m 12P","3m 7m 8P 10m 14m","5P 7m 8P 10m 14m","7m 10m 12P 14m 15P","5P 8P 10m 14m 17m","7m 10m 12P 15P 17m"],"7sus":["1P 5P 7m 8P 11P","5P 8P 11P 12P 14m","7m 8P 11P 12P 14m","7m 11P 12P 14m 18P"],h7:["3m 5d 7m 8P 10m","1P 5d 7m 10m 12d","1P 7m 10m 12d","3m 7m 8P 10m 12d","3m 7m 8P 12d 14m","5d 7m 8P 10m 14m","5d 8P 10m 12d 14m","7m 10m 12d 14m 15P","5d 8P 10m 14m 17m"],o7:["1P 6M 8P 10m 12d","1P 6M 10m 12d 13M","3m 8P 10m 12d 13M","3m 8P 12d 13M 15P","5d 10m 12d 13M 15P","5d 10m 13M 15P 17m","6M 12d 13M 15P 17m","6M 12d 15P 17m 19d"],"^9":["1P 5P 7M 9M 10M","1P 7M 9M 10M 12P","3M 7M 8P 9M 12P","3M 7M 8P 12P 16M","5P 8P 10M 14M 16M","7M 8P 10M 12P 16M"],"^13":["1P 6M 7M 9M 10M","1P 7M 9M 10M 13M","3M 7M 8P 9M 13M","3M 7M 8P 13M 16M","7M 8P 10M 13M 16M"],"^7#11":["1P 5P 7M 10M 12d","3M 7M 8P 10M 12d","1P 7M 10M 12d 14M","3M 7M 8P 12d 14M","5P 8P 10M 12d 14M"],"^9#11":["1P 3M 5d 7M 9M","1P 7M 9M 10M 12d","3M 7M 8P 9M 12d","3M 8P 9M 12d 14M"],"^7#5":["1P 6m 7M 10M 13m","3M 7M 8P 10M 13m","6m 7M 8P 10M 13m"],"-6":["1P 3m 5P 6M 8P","1P 5P 6M 8P 10m","3m 5P 6M 8P 10m","1P 5P 8P 10m 13M","3m 5P 8P 10m 13M","5P 8P 10m 12P 13M","5P 8P 10m 13M 15P"],"-69":["1P 3m 5P 6M 9M","3m 5P 6M 8P 9M","3m 6M 9M 10m 12P","1P 5P 9M 10m 13M","3m 5P 8P 9M 13M","5P 8P 9M 10m 13M","5P 8P 10m 13M 16M"],"-^7":["1P 3m 5P 7M 10m","1P 5P 7M 10m 12P","3m 7M 8P 10m 12P","5P 7M 8P 10m 14M","5P 8P 10m 14M 17m"],"-^9":["1P 3m 5P 7M 9M","1P 7M 9M 10m 12P","3m 7M 8P 9M 12P","5P 8P 9M 10m 14M"],"-9":["1P 3m 5P 7m 9M","3m 5P 7m 8P 9M","3m 7m 8P 9M 12P","5P 8P 9M 10m 14m","3m 7m 9M 12P 15P","7m 10m 12P 15P 16M"],"-add9":["1P 2M 3m 5P 8P","1P 3m 5P 9M","3m 5P 8P 9M 12P","5P 8P 9M 10m 12P"],"-11":["1P 3m 7m 9M 11P","3m 7m 8P 9M 11P","1P 4P 7m 10m 12P","5P 8P 11P 14m","3m 7m 9M 11P 15P","5P 8P 11P 14m 16M","7m 10m 12P 15P 18P"],"-7b5":["3m 5d 7m 8P 10m","1P 7m 10m 12d","1P 5d 7m 10m 12d","3m 7m 8P 10m 12d","3m 7m 8P 12d 14m","5d 7m 8P 10m 14m","5d 8P 10m 12d 14m","7m 10m 12d 14m 15P","5d 8P 10m 14m 17m"],h9:["1P 7m 9M 10m 12d","3m 7m 8P 9M 12d","5d 8P 9M 10m 14m","7m 10m 12d 15P 16M"],"-b6":["1P 5P 6m 8P 10m","1P 5P 8P 10m 13m","3m 5P 8P 10m 13m","5P 8P 10m 13m","5P 8P 10m 13m 15P"],"-#5":["1P 6m 8P 10m 13m","3m 6m 8P 10m 13m","6m 8P 10m 13m 15P"],"7b9":["1P 3M 7m 9m 10M","3M 7m 8P 9m 10M","3M 7m 8P 9m 14m","7m 9m 10M 14m 15P"],"7#9":["1P 3M 7m 10m","3M 7m 8P 10m 14m","7m 10m 10M 14m 15P"],"7#11":["1P 3M 7m 10M 12d","3M 7m 8P 10M 12d","7m 10M 12d 14m 15P"],"7b5":["1P 3M 7m 10M 12d","3M 7m 8P 10M 12d","7m 10M 12d 14m 15P"],"7#5":["1P 3M 7m 10M 13m","3M 7m 8P 10M 13m","3M 7m 8P 13m 14m","7m 10M 13m 14m 15P"],"9#11":["1P 7m 9M 10M 12d","3M 7m 8P 9M 12d","7m 10M 12d 15P 16M"],"9b5":["1P 7m 9M 10M 12d","3M 7m 8P 9M 12d","7m 10M 12d 15P 16M"],"9#5":["1P 7m 9M 10M 13m","3M 7m 9M 10M 13m","3M 7m 9M 13m 14m","7m 10M 13m 14m 16M","7m 10M 13m 16M 17M"],"7b13":["1P 3M 7m 10M 13m","3M 7m 8P 10M 13m","3M 7m 8P 13m 14m","7m 10M 13m 14m 15P"],"7#9#5":["1P 3M 7m 10m 13m","3M 7m 10m 13m 15P","7m 10M 13m 15P 17m"],"7#9b5":["1P 3M 7m 10m 12d","3M 7m 10m 12d 15P","7m 10M 12d 15P 17m"],"7#9#11":["1P 3M 7m 10m 12d","3M 7m 10m 12d 15P","7m 10M 12d 15P 17m"],"7b9#11":["1P 7m 9m 10M 12d","3M 7m 8P 9m 12d","7m 8P 10M 12d 16m"],"7b9b5":["1P 7m 9m 10M 12d","3M 7m 8P 9m 12d","7m 8P 10M 12d 16m"],"7b9#5":["1P 7m 9m 10M 13m","3M 7m 8P 9m 13m","7m 9m 10M 13m 15P"],"7b9#9":["1P 3M 7m 9m 10m","3M 7m 8P 9m 10m","7m 8P 10M 16m 17m"],"7b9b13":["1P 7m 9m 10M 13m","3M 7m 8P 9m 13m","7m 9m 10M 13m 15P"],"7alt":["3M 7m 8P 9m 12d","1P 7m 10m 10M 13m","3M 7m 8P 10m 13m","3M 7m 9m 12d 15P","3M 7m 10m 13m 15P","7m 10M 12d 15P 17m","7m 10M 13m 15P 17m"],"13#11":["1P 6M 7m 10M 12d","3M 7m 9M 12d 13M","7m 10M 12d 13M 16M"],"13b9":["1P 3M 6M 7m 9m","1P 6M 7m 9m 10M","3M 7m 9m 10M 13M","3M 7m 10M 13M 16m","7m 10M 13M 16m 17M"],"13#9":["1P 3M 6M 7m 10m","3M 7m 8P 10m 13M","7m 10M 13M 14m 17m"],"7b9sus":["1P 5P 7m 9m 11P","5P 7m 8P 9m 11P","7m 8P 11P 14m 16m"],"7susadd3":["1P 4P 5P 7m 10M","5P 8P 10M 11P 14m","7m 11P 12P 15P 17M"],"9sus":["1P 5P 7m 9M 11P","5P 7m 8P 9M 11P","7m 8P 9M 11P 12P","7m 8P 11P 12P 16M"],"13sus":["1P 4P 6M 7m 9M","1P 7m 9M 11P 13M","5P 7m 9M 11P 13M","7m 9M 11P 13M 15P"],"7b13sus":["1P 5P 7m 11P 13m","5P 7m 8P 11P 13m","7m 11P 13m 14m 15P"]},complex={2:["1P 5P 6M 8P 9M","1P 5P 8P 9M 12P","5P 8P 9M 12P 13M","5P 8P 9M 12P 15P"],5:["1P 5P 8P 12P","1P 5P 8P 9M 12P","5P 8P 12P 15P","5P 8P 12P 15P 16M"],6:["1P 5P 6M 9M 10M","1P 5P 9M 10M 13M","3M 5P 9M 10M 13M","5P 8P 9M 10M 13M","3M 6M 9M 12P 15P"],7:["1P 5P 7m 8P 10M","1P 7m 8P 10M 12P","3M 7m 8P 10M 12P","3M 7m 8P 10M 14m","3M 7m 10M 12P 15P","7m 10M 12P 14m 15P","7m 10M 12P 15P 17M","7m 10M 14m 17M 19P"],9:["1P 6M 7m 9M 10M","3M 7m 9M 10M 12P","1P 7m 9M 10M 13M","3M 7m 9M 10M 13M","3M 7m 9M 12P 15P","7m 10M 12P 13M 16M","7m 10M 13M 16M 17M","7m 10M 13M 16M 19P"],11:["1P 4P 6M 7m 9M","1P 5P 7m 9M 11P","4P 6M 7m 9M 11P","5P 8P 9M 11P 14m","7m 9M 11P 13M 15P","7m 11P 12P 14m 18P"],13:["3M 7m 9M 10M 13M","3M 7m 9M 13M 15P","3M 7m 10M 13M 16M","7m 10M 12P 13M 16M","7m 10M 13M 16M 17M","7m 10M 13M 16M 19P"],69:["1P 5P 6M 9M 10M","1P 5P 9M 10M 13M","3M 5P 9M 10M 13M","5P 8P 9M 10M 13M","3M 6M 9M 12P 15P"],add9:["1P 5P 8P 9M 10M","1P 5P 9M 10M 12P","3M 8P 9M 10M 12P","3M 8P 9M 12P 15P","5P 8P 9M 10M 15P","5P 8P 9M 12P 17M"],"+":["1P 6m 8P 9M 10M","1P 6m 8P 10M 13m","3M 8P 9M 10M 13m","3M 8P 10M 13m 15P","6m 10M 13m 15P 16M","6m 10M 13m 15P 17M"],o:["1P 6M 8P 10m 12d","1P 6M 10m 12d 13M","3m 8P 10m 12d 13M","3m 8P 12d 13M 15P","5d 10m 12d 13M 15P","5d 10m 13M 15P 17m","6M 12d 13M 15P 17m","6M 12d 15P 17m 19d"],h:["1P 5d 7m 10m 11P","3m 5d 7m 8P 11P","5d 7m 8P 10m 11P","1P 7m 10m 12d","3m 7m 8P 12d 14m","5d 8P 10m 11P 14m","7m 10m 11P 12d 14m","7m 10m 12d 14m 15P","5d 8P 10m 14m 17m"],sus:["1P 4P 5P 8P 9M","1P 4P 5P 8P 11P","1P 5P 8P 9M 11P","5P 8P 9M 11P 12P","5P 8P 11P 12P 13M","5P 8P 11P 13M 15P"],"^":["1P 3M 5P 6M 9M","1P 5P 8P 10M 12P","3M 5P 9M 10M 12P","1P 5P 8P 10M 13M","3M 8P 10M 13M 15P","5P 9M 10M 12P 15P"],"-":["1P 3m 5P 8P 10m","1P 3m 5P 9M 11P","3m 5P 8P 9M 11P","5P 8P 9M 10m 11P","1P 5P 9M 10m 12P","3m 5P 8P 10m 12P","5P 8P 10m 12P 15P"],"^7":["1P 6M 7M 9M 10M","3M 7M 9M 10M 12P","1P 7M 9M 10M 13M","3M 7M 9M 10M 13M","3M 7M 9M 12P 13M","3M 7M 9M 13M 14M","3M 7M 10M 13M 16M","7M 10M 13M 14M 16M","7M 10M 13M 16M 17M","7M 10M 13M 16M 19P"],"-7":["1P 3m 5P 7m 9M","1P 3m 5P 7m 10m","1P 5P 7m 10m 11P","3m 7m 8P 10m 11P","1P 5P 7m 10m 12P","3m 7m 9M 10m 12P","3m 7m 8P 10m 14m","5P 7m 9M 10m 14m","7m 10m 11P 14m 15P","7m 10m 12P 15P 16M","5P 8P 11P 14m 17m","7m 10m 12P 15P 17m"],"7sus":["1P 4P 6M 7m 9M","1P 5P 7m 9M 11P","4P 6M 7m 9M 11P","5P 8P 9M 11P 14m","7m 9M 11P 13M 15P","7m 11P 12P 14m 18P"],h7:["1P 5d 7m 10m 11P","3m 5d 7m 8P 11P","5d 7m 8P 10m 11P","1P 7m 10m 12d","3m 7m 8P 10m 12d","3m 7m 8P 12d 14m","5d 8P 10m 11P 14m","7m 10m 11P 12d 14m","7m 10m 12d 14m 15P","5d 8P 10m 14m 17m"],o7:["1P 6M 8P 10m 12d","1P 6M 10m 12d 13M","3m 8P 10m 12d 13M","3m 8P 12d 13M 15P","5d 10m 12d 13M 15P","5d 10m 13M 15P 17m","6M 12d 13M 15P 17m","6M 12d 15P 17m 19d"],"^9":["1P 6M 7M 9M 10M","1P 7M 9M 10M 13M","3M 7M 9M 10M 13M","3M 7M 9M 12P 13M","3M 7M 8P 9M 13M","3M 7M 9M 13M 14M","3M 7M 10M 13M 16M","7M 10M 13M 14M 16M","7M 10M 13M 16M 17M","7M 10M 13M 16M 19P"],"^13":["1P 6M 7M 9M 10M","1P 7M 9M 10M 13M","3M 7M 9M 12P 13M","3M 7M 9M 10M 13M","3M 7M 8P 9M 13M","3M 7M 9M 13M 14M","3M 7M 10M 13M 16M","7M 10M 13M 14M 16M","7M 10M 13M 16M 17M","7M 10M 13M 16M 19P"],"^7#11":["1P 3M 5d 7M 9M","1P 7M 9M 10M 12d","3M 7M 9M 10M 12d","3M 7M 9M 12d 13M","3M 7M 10M 12d 14M","7M 10M 12d 13M 14M","7M 10M 12d 13M 16M","7M 10M 12d 14M 17M"],"^9#11":["1P 3M 5d 7M 9M","1P 7M 9M 10M 12d","3M 7M 9M 10M 12d","3M 7M 9M 12d 13M","3M 7M 9M 12d 14M","7M 10M 12d 14M 16M","7M 10M 12d 13M 16M"],"^7#5":["1P 6m 7M 10M 13m","3M 7M 9M 10M 13m","3M 7M 10M 13m 14M","7M 10M 13m 14M 16M","7M 10M 13m 14M 17M"],"-6":["1P 3m 5P 6M 9M","3m 5P 6M 8P 9M","1P 5P 6M 10m 11P","3m 5P 6M 8P 11P","1P 5P 9M 10m 13M","3m 5P 8P 9M 13M","5P 8P 10m 11P 13M","5P 8P 10m 13M 16M"],"-69":["1P 3m 5P 6M 9M","3m 5P 6M 8P 9M","3m 6M 9M 10m 12P","1P 5P 9M 10m 13M","3m 5P 8P 9M 13M","5P 8P 9M 10m 13M","5P 8P 10m 13M 16M"],"-^7":["1P 3m 5P 7M 9M","1P 5P 7M 10m 11P","3m 7M 9M 10m 11P","3m 7M 9M 10m 12P","3m 7M 9M 12P 14M","7M 10m 11P 12P 14M","7M 10m 12P 14M 16M"],"-^9":["1P 3m 5P 7M 9M","1P 5P 7M 10m 11P","3m 7M 9M 10m 11P","3m 7M 9M 10m 12P","3m 7M 9M 12P 14M","7M 10m 11P 12P 14M","7M 10m 12P 14M 16M"],"-9":["1P 3m 5P 7m 9M","1P 3m 7m 9M 11P","3m 7m 9M 10m 11P","3m 7m 9M 10m 12P","3m 7m 9M 10m 14m","3m 7m 9M 12P 15P","7m 10m 11P 14m 16M","7m 10m 12P 16M 18P"],"-add9":["1P 2M 3m 5P 8P","1P 3m 5P 9M","3m 5P 8P 9M 12P","5P 8P 9M 10m 12P"],"-11":["3m 5P 7m 9M 11P","7m 9M 10m 11P","1P 4P 7m 10m 12P","3m 7m 9M 11P 12P","7m 9M 10m 11P 12P","3m 7m 9M 11P 14m","4P 10m 12P 14m","5P 8P 11P 14m","5P 8P 11P 14m 16M","7m 10m 12P 16M 18P","7m 10m 11P 16M 21m"],"-7b5":["1P 5d 7m 10m 11P","3m 5d 7m 8P 11P","5d 7m 8P 10m 11P","1P 7m 10m 12d","3m 7m 8P 10m 12d","3m 7m 8P 12d 14m","5d 8P 10m 11P 14m","7m 10m 11P 12d 14m","7m 10m 12d 14m 15P","5d 8P 10m 14m 17m"],h9:["3m 5d 7m 9M 11P","1P 7m 9M 10m 12d","3m 7m 9M 12d 14m","5d 8P 9M 10m 14m","7m 10m 11P 12d 14m","7m 10m 12d 14m 16M"],"-b6":["1P 3m 5P 6m 8P","3m 5P 8P 11P 13m","5P 8P 10m 11P 13m"],"-#5":["1P 6m 8P 10m 13m","3m 6m 8P 11P 13m","6m 8P 10m 13m 15P"],"7b9":["1P 3M 7m 9m 10M","3M 7m 8P 9m 10M","3M 7m 8P 9m 14m","7m 9m 10M 14m 15P"],"7#9":["1P 3M 7m 10m","3M 7m 10m 10M 12P","3M 7m 10m 12P 14m","7m 10M 12P 14m 17m"],"7#11":["1P 3M 7m 9M 12d","3M 7m 9M 12d 13M","7m 10M 12d 13M 16M"],"7b5":["1P 3M 7m 9M 12d","3M 7m 9M 12d 13M","7m 10M 12d 13M 16M"],"7#5":["1P 3M 7m 10M 13m","3M 7m 8P 10M 13m","3M 7m 8P 13m 14m","7m 10M 13m 14m 15P","7m 10M 13m 14m 17M"],"9#11":["1P 7m 9M 10M 12d","3M 7m 8P 9M 12d","7m 10M 12d 15P 16M"],"9b5":["1P 7m 9M 10M 12d","3M 7m 8P 9M 12d","7m 10M 12d 15P 16M"],"9#5":["1P 7m 9M 10M 13m","3M 7m 9M 10M 13m","3M 7m 9M 13m 14m","7m 10M 13m 14m 16M","7m 10M 13m 16M 17M"],"7b13":["1P 3M 7m 10M 13m","3M 7m 8P 10M 13m","3M 7m 8P 13m 14m","7m 10M 13m 14m 15P","7m 10M 13m 14m 17M"],"7#9#5":["3M 7m 10m 10M 13m","3M 7m 10m 13m 14m","7m 10M 13m 14m 17m"],"7#9b5":["3M 7m 10m 10M 12d","3M 7m 10m 12d 14m","7m 10M 12d 14m 17m"],"7#9#11":["3M 7m 10m 10M 12d","3M 7m 10m 12d 14m","7m 10M 12d 14m 17m"],"7b9#11":["3M 7m 9m 10M 12d","3M 7m 9m 12d 14m","7m 8P 10M 12d 16m","7m 10M 12d 14m 16m"],"7b9b5":["3M 7m 9m 10M 12d","3M 7m 9m 12d 14m","7m 8P 10M 12d 16m","7m 10M 12d 14m 16m"],"7b9#5":["1P 7m 9m 10M 13m","3M 7m 9m 10M 13m","3M 7m 10M 13m 16m","7m 10M 13m 14m 16m","7m 10M 13m 16m 17M"],"7b9#9":["1P 3M 7m 9m 10m","3M 7m 10m 13m 16m","7m 10M 13m 16m 17m"],"7b9b13":["1P 7m 9m 10M 13m","3M 7m 9m 10M 13m","3M 7m 10M 13m 16m","7m 10M 13m 14m 16m","7m 10M 13m 16m 17M"],"7alt":["3M 7m 8P 10m 13m","3M 7m 9m 12d 13m","3M 7m 9m 10m 13m","3M 7m 10m 13m 14m","3M 7m 9m 12d 14m","3M 7m 10m 13m 15P","3M 7m 10m 13m 16m","7m 10M 12d 14m 16m","7m 10M 12d 13m 16m","7m 10M 13m 15P 17m","7m 10M 13m 16m 17m","7m 10M 13m 16m 19d"],"13#11":["3M 7m 9M 12d 13M","7m 10M 12d 13M 16M"],"13b9":["3M 7m 9m 10M 13M","3M 7m 10M 13M 16m","7m 10M 13M 16m 17M"],"13#9":["3M 7m 10m 10M 13M","7m 10M 13M 14m 17m"],"7b9sus":["1P 5P 7m 9m 11P","5P 7m 8P 9m 11P","7m 8P 11P 14m 16m"],"7susadd3":["1P 4P 5P 7m 10M","5P 8P 10M 11P 14m","7m 11P 12P 15P 17M"],"9sus":["1P 4P 6M 7m 9M","1P 5P 7m 9M 11P","4P 6M 7m 9M 11P","5P 8P 9M 11P 14m","7m 9M 11P 13M 15P","7m 11P 12P 14m 18P"],"13sus":["1P 4P 6M 7m 9M","1P 7m 9M 11P 13M","4P 7m 9M 11P 13M","7m 9M 11P 13M 15P","7m 11P 13M 14m 16M","7m 11P 13M 16M 18P"],"7b13sus":["1P 5P 7m 11P 13m","5P 7m 8P 11P 13m","7m 11P 13m 14m 15P"]},{dictionaryVoicing,minTopNoteDiff}=_voicings.default||_voicings,lefthand={m7:["3m 5P 7m 9M","7m 9M 10m 12P"],7:["3M 6M 7m 9M","7m 9M 10M 13M"],"^7":["3M 5P 7M 9M","7M 9M 10M 12P"],69:["3M 5P 6A 9M"],m7b5:["3m 5d 7m 8P","7m 8P 10m 12d"],"7b9":["3M 6m 7m 9m","7m 9m 10M 13m"],"7b13":["3M 6m 7m 9m","7m 9m 10M 13m"],o7:["1P 3m 5d 6M","5d 6M 8P 10m"],"7#11":["7m 9M 11A 13A"],"7#9":["3M 7m 9A"],mM7:["3m 5P 7M 9M","7M 9M 10m 12P"],m6:["3m 5P 6M 9M","6M 9M 10m 12P"]},guidetones={m7:["3m 7m","7m 10m"],m9:["3m 7m","7m 10m"],7:["3M 7m","7m 10M"],"^7":["3M 7M","7M 10M"],"^9":["3M 7M","7M 10M"],69:["3M 6M"],6:["3M 6M","6M 10M"],m7b5:["3m 7m","7m 10m"],"7b9":["3M 7m","7m 10M"],"7b13":["3M 7m","7m 10M"],o7:["3m 6M","6M 10m"],"7#11":["3M 7m","7m 10M"],"7#9":["3M 7m","7m 10M"],mM7:["3m 7M","7M 10m"],m6:["3m 6M","6M 10m"]},triads={"":["1P 3M 5P","3M 5P 8P","5P 8P 10M"],M:["1P 3M 5P","3M 5P 8P","5P 8P 10M"],m:["1P 3m 5P","3m 5P 8P","5P 8P 10m"],o:["1P 3m 5d","3m 5d 8P","5d 8P 10m"],aug:["1P 3m 5A","3m 5A 8P","5A 8P 10m"]},defaultDictionary={"":["1P 3M 5P","3M 5P 8P","5P 8P 10M"],M:["1P 3M 5P","3M 5P 8P","5P 8P 10M"],m:["1P 3m 5P","3m 5P 8P","5P 8P 10m"],o:["1P 3m 5d","3m 5d 8P","5d 8P 10m"],aug:["1P 3m 5A","3m 5A 8P","5A 8P 10m"],m7:["3m 5P 7m 9M","7m 9M 10m 12P"],7:["3M 6M 7m 9M","7m 9M 10M 13M"],"^7":["3M 5P 7M 9M","7M 9M 10M 12P"],69:["3M 5P 6A 9M"],m7b5:["3m 5d 7m 8P","7m 8P 10m 12d"],"7b9":["3M 6m 7m 9m","7m 9m 10M 13m"],"7b13":["3M 6m 7m 9m","7m 9m 10M 13m"],o7:["1P 3m 5d 6M","5d 6M 8P 10m"],"7#11":["7m 9M 11A 13A"],"7#9":["3M 7m 9A"],mM7:["3m 5P 7M 9M","7M 9M 10m 12P"],m6:["3m 5P 6M 9M","6M 9M 10m 12P"]},voicingRegistry={lefthand:{dictionary:lefthand,range:["F3","A4"],mode:"below",anchor:"a4"},triads:{dictionary:triads,mode:"below",anchor:"a4"},guidetones:{dictionary:guidetones,mode:"above",anchor:"a4"},legacy:{dictionary:defaultDictionary,mode:"below",anchor:"a4"}};let defaultDict="ireal";const setDefaultVoicings=o=>defaultDict=o,setVoicingRange=(o,e)=>addVoicings(o,voicingRegistry[o].dictionary,e),addVoicings=(o,e,l=["F3","A4"])=>{Object.assign(voicingRegistry,{[o]:{dictionary:e,range:l}})},registerVoicings=(o,e,l={})=>{Object.assign(voicingRegistry,{[o]:{dictionary:e,...l}})},getVoicing=(o,e,l)=>{const{dictionary:d,range:p}=voicingRegistry[e];return dictionaryVoicing({chord:o,dictionary:d,range:p,picker:minTopNoteDiff,lastVoicing:l})};let lastVoicing;const voicings=register("voicings",function(o,e){return e.fmap(l=>(lastVoicing=getVoicing(l,o,lastVoicing),stack(...lastVoicing))).outerJoin()}),rootNotes=register("rootNotes",function(o,e){return e.fmap(l=>{const b=(l.chord||l).match(/^([a-gA-G][b#]?).*$/)[1]+o;return l.chord?{note:b}:b})}),voicing=register("voicing",function(o){return o.fmap(e=>{e=typeof e=="string"?{chord:e}:e;let{dictionary:l=defaultDict,chord:d,anchor:p,offset:b,mode:R,n:I,octaves:z,...se}=e;l=typeof l=="string"?voicingRegistry[l]:{dictionary:l,mode:"below",anchor:"c5"};try{let le=renderVoicing({...l,chord:d,anchor:p,offset:b,mode:R,n:I,octaves:z});return stack(...le).note().set(se)}catch{return logger$2(`[voicing]: unknown chord "${d}"`),silence}}).outerJoin()});function voicingAlias(o,e,l){l=Array.isArray(l)?l:[l],l.forEach(d=>{d[e]=d[o]})}voicingAlias("^","",[simple,complex]),Object.keys(simple).forEach(o=>{if(o.includes("-")){let e=o.replace("-","m");voicingAlias(o,e,[complex,simple])}if(o.includes("^")){let e=o.replace("^","M");voicingAlias(o,e,[complex,simple])}if(o.includes("+")){let e=o.replace("+","aug");voicingAlias(o,e,[complex,simple])}}),registerVoicings("ireal",simple),registerVoicings("ireal-ext",complex);function resetVoicings(){lastVoicing=void 0,setDefaultVoicings("ireal")}const packageName$1="@strudel/tonal",index$5=Object.freeze(Object.defineProperty({__proto__:null,addVoicings,complex,packageName:packageName$1,registerVoicings,resetVoicings,rootNotes,scale,scaleTrans,scaleTranspose,setDefaultVoicings,setVoicingRange,simple,strans,trans,transpose,voicing,voicingAlias,voicingRegistry,voicings},Symbol.toStringTag,{value:"Module"})),escapeHtml=o=>{const e=document.createElement("div");return e.innerText=o,e.innerHTML},stripHtml=o=>{const e=document.createElement("div");return e.innerHTML=o,e.textContent||e.innerText||""},getDocLabel$1=o=>o.name||o.longname,buildParamsList=o=>o?.length?`
|
||
<div class="autocomplete-info-params-section">
|
||
<h4 class="autocomplete-info-section-title">Parameters</h4>
|
||
<ul class="autocomplete-info-params-list">
|
||
${o.map(({name:e,type:l,description:d})=>`
|
||
<li class="autocomplete-info-param-item">
|
||
<span class="autocomplete-info-param-name">${e}</span>
|
||
<span class="autocomplete-info-param-type">${l.names?.join(" | ")}</span>
|
||
${d?`<div class="autocomplete-info-param-desc">${stripHtml(d)}</div>`:""}
|
||
</li>
|
||
`).join("")}
|
||
</ul>
|
||
</div>
|
||
`:"",buildExamples=o=>o?.length?`
|
||
<div class="autocomplete-info-examples-section">
|
||
<h4 class="autocomplete-info-section-title">Examples</h4>
|
||
${o.map(e=>`
|
||
<pre class="autocomplete-info-example-code">${escapeHtml(e)}</pre>
|
||
`).join("")}
|
||
</div>
|
||
`:"",Autocomplete=o=>h`
|
||
<div class="autocomplete-info-container">
|
||
<div class="autocomplete-info-tooltip">
|
||
<h3 class="autocomplete-info-function-name">${getDocLabel$1(o)}</h3>
|
||
${o.synonyms_text?`<div class="autocomplete-info-function-synonyms">Synonyms: ${o.synonyms_text}</div>`:""}
|
||
${o.description?`<div class="autocomplete-info-function-description">${o.description}</div>`:""}
|
||
${buildParamsList(o.params)}
|
||
${buildExamples(o.examples)}
|
||
</div>
|
||
</div>
|
||
`[0],isValidDoc=o=>{const e=getDocLabel$1(o);return e&&!e.startsWith("_")&&!["package"].includes(o.kind)},hasExcludedTags=o=>["superdirtOnly","noAutocomplete"].some(e=>o.tags?.find(l=>l.originalTitle===e));function bankCompletions(){const o={},e=new Set;for(const l of Object.keys(o)){const[d,p]=l.split("_");p&&d&&e.add(d)}return Array.from(e).sort().map(l=>({label:l,type:"bank"}))}let scaleCompletions=[];const modeCompletions=[{label:"below",type:"mode"},{label:"above",type:"mode"},{label:"duck",type:"mode"},{label:"root",type:"mode"}],chordSymbols=["",...Object.keys(complex)].sort(),chordSymbolCompletions=chordSymbols.map(o=>o===""?{label:"major",apply:"",type:"chord-symbol"}:{label:o,apply:o,type:"chord-symbol"}),getSynonymDoc=(o,e)=>{const l=o.synonyms||[],p=[getDocLabel$1(o),...l].filter(b=>b&&b!==e);return{...o,name:e,longname:e,synonyms:p,synonyms_text:p.join(", ")}},jsdocCompletions=(()=>{const o=new Set,e=[];for(const l of jsdoc.docs){if(!isValidDoc(l)||hasExcludedTags(l))continue;const d=getDocLabel$1(l),p=l.synonyms||[];let b=[d,...p];for(const R of b)R&&!o.has(R)&&(o.add(R),e.push({label:R,info:()=>Autocomplete(getSynonymDoc(l,R)),type:"function"}))}return e})(),pitchNames=["C","C#","Db","D","D#","Eb","E","E#","Fb","F","F#","Gb","G","G#","Ab","A","A#","Bb","B","B#","Cb"],SCALE_NO_QUOTES_REGEX=/scale\(\s*$/,SCALE_AFTER_COLON_REGEX=/scale\(\s*['"][^'"]*:[^'"]*$/,SCALE_PRE_COLON_REGEX=/scale\(\s*['"][^'"]*$/,SCALE_PITCH_MATCH_REGEX=/([A-Ga-g][#b]*)?$/,SCALE_SPACES_TO_COLON_REGEX=/\s+/g;function scaleHandler(o){let e=o.matchBefore(SCALE_NO_QUOTES_REGEX);if(e)return{from:e.to,options:[]};let l=o.matchBefore(SCALE_AFTER_COLON_REGEX);if(l){const p=l.text,b=p.lastIndexOf(":");if(b!==-1){const R=p.slice(b+1),z=scaleCompletions.filter(le=>le.label.startsWith(R)).map(le=>({...le,apply:le.label.replace(SCALE_SPACES_TO_COLON_REGEX,":")}));return{from:l.from+b+1,options:z}}}let d=o.matchBefore(SCALE_PRE_COLON_REGEX);if(d&&!d.text.includes(":"))if(o.explicit){const b=d.text.match(SCALE_PITCH_MATCH_REGEX),R=b?b[0]:"",I=pitchNames.filter(le=>le.toLowerCase().startsWith(R.toLowerCase())),z=d.to-R.length,se=I.map(le=>({label:le,type:"pitch"}));return{from:z,options:se}}else return{from:d.to,options:[]};return null}const SOUND_NO_QUOTES_REGEX=/(s|sound)\(\s*$/,SOUND_WITH_QUOTES_REGEX=/(s|sound)\(\s*['"][^'"]*$/,SOUND_FRAGMENT_MATCH_REGEX=/(?:[\s[{(<])([\w]*)$/;function soundHandler(o){let e=o.matchBefore(SOUND_NO_QUOTES_REGEX);if(e)return{from:e.to,options:[]};let l=o.matchBefore(SOUND_WITH_QUOTES_REGEX);if(!l)return null;const d=l.text,p=Math.max(d.lastIndexOf('"'),d.lastIndexOf("'"));if(p===-1)return null;const b=d.slice(p+1),R=b.match(SOUND_FRAGMENT_MATCH_REGEX),I=R?R[1]:b;let le=Object.keys({}).sort().filter(an=>an.includes(I)).map(an=>({label:an,type:"sound"}));return{from:l.to-I.length,options:le}}const BANK_NO_QUOTES_REGEX=/bank\(\s*$/,BANK_WITH_QUOTES_REGEX=/bank\(\s*['"][^'"]*$/;function bankHandler(o){let e=o.matchBefore(BANK_NO_QUOTES_REGEX);if(e)return{from:e.to,options:[]};let l=o.matchBefore(BANK_WITH_QUOTES_REGEX);if(!l)return null;const d=l.text,p=Math.max(d.lastIndexOf('"'),d.lastIndexOf("'"));if(p===-1)return null;const R=d.slice(p+1),z=bankCompletions().filter(le=>le.label.startsWith(R));return{from:l.to-R.length,options:z}}const MODE_NO_QUOTES_REGEX=/mode\(\s*$/,MODE_AFTER_COLON_REGEX=/mode\(\s*['"][^'"]*:[^'"]*$/,MODE_PRE_COLON_REGEX=/mode\(\s*['"][^'"]*$/,MODE_FRAGMENT_MATCH_REGEX=/(?:[\s[{(<])([\w:]*)$/;function modeHandler(o){let e=o.matchBefore(MODE_NO_QUOTES_REGEX);if(e)return{from:e.to,options:[]};let l=o.matchBefore(MODE_AFTER_COLON_REGEX);if(l){const tn=l.text,an=tn.lastIndexOf(":");if(an!==-1){const sn=tn.slice(an+1),un=pitchNames.filter(yn=>yn.toLowerCase().startsWith(sn.toLowerCase())).map(yn=>({label:yn,type:"pitch"}));return{from:l.from+an+1,options:un}}}let d=o.matchBefore(MODE_PRE_COLON_REGEX);if(!d)return null;const p=d.text,b=Math.max(p.lastIndexOf('"'),p.lastIndexOf("'"));if(b===-1)return null;const R=p.slice(b+1),I=R.match(MODE_FRAGMENT_MATCH_REGEX),z=I?I[1]:R,se=modeCompletions.filter(tn=>tn.label.startsWith(z));return{from:d.to-z.length,options:se}}const CHORD_NO_QUOTES_REGEX=/chord\(\s*$/,CHORD_WITH_QUOTES_REGEX=/chord\(\s*['"][^'"]*$/,CHORD_FRAGMENT_MATCH_REGEX=/(?:[\s[{(<])([\w#b+^:-]*)$/;function chordHandler(o){let e=o.matchBefore(CHORD_NO_QUOTES_REGEX);if(e)return{from:e.to,options:[]};let l=o.matchBefore(CHORD_WITH_QUOTES_REGEX);if(!l)return null;const d=l.text,p=Math.max(d.lastIndexOf('"'),d.lastIndexOf("'"));if(p===-1)return null;const b=d.slice(p+1),R=b.match(CHORD_FRAGMENT_MATCH_REGEX),I=R?R[1]:b;let z=null,se=I;for(const le of pitchNames)if(I.toLowerCase().startsWith(le.toLowerCase())){z=le,se=I.slice(le.length);break}if(z){const tn=chordSymbolCompletions.filter(sn=>sn.label.toLowerCase().startsWith(se.toLowerCase()));return{from:l.to-se.length,options:tn}}else{const tn=pitchNames.filter(sn=>sn.toLowerCase().startsWith(I.toLowerCase())).map(sn=>({label:sn,type:"pitch"}));return{from:l.to-I.length,options:tn}}}const FALLBACK_WORD_REGEX=/\w*/;function fallbackHandler(o){const e=o.matchBefore(FALLBACK_WORD_REGEX);return e&&e.from===e.to&&!o.explicit?null:e?{from:e.from,options:jsdocCompletions}:null}const handlers=[soundHandler,bankHandler,chordHandler,scaleHandler,modeHandler,fallbackHandler],strudelAutocomplete=o=>{for(const e of handlers){const l=e(o);if(l)return l}return null},isAutoCompletionEnabled=o=>o?[autocompletion({override:[strudelAutocomplete],closeOnBlur:!1})]:[];function crelt(){var o=arguments[0];typeof o=="string"&&(o=document.createElement(o));var e=1,l=arguments[1];if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){for(var d in l)if(Object.prototype.hasOwnProperty.call(l,d)){var p=l[d];typeof p=="string"?o.setAttribute(d,p):p!=null&&(o[d]=p)}e++}for(;e<arguments.length;e++)add$1(o,arguments[e]);return o}function add$1(o,e){if(typeof e=="string")o.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)o.appendChild(e);else if(Array.isArray(e))for(var l=0;l<e.length;l++)add$1(o,e[l]);else throw new RangeError("Unsupported child node: "+e)}const basicNormalize=typeof String.prototype.normalize=="function"?o=>o.normalize("NFKD"):o=>o;class SearchCursor{constructor(e,l,d=0,p=e.length,b,R){this.test=R,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(d,p),this.bufferStart=d,this.normalize=b?I=>b(basicNormalize(I)):basicNormalize,this.query=this.normalize(l)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return codePointAt(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let l=fromCodePoint(e),d=this.bufferStart+this.bufferPos;this.bufferPos+=codePointSize(e);let p=this.normalize(l);if(p.length)for(let b=0,R=d;;b++){let I=p.charCodeAt(b),z=this.match(I,R,this.bufferPos+this.bufferStart);if(b==p.length-1){if(z)return this.value=z,this;break}R==d&&b<l.length&&l.charCodeAt(b)==I&&R++}}}match(e,l,d){let p=null;for(let b=0;b<this.matches.length;b+=2){let R=this.matches[b],I=!1;this.query.charCodeAt(R)==e&&(R==this.query.length-1?p={from:this.matches[b+1],to:d}:(this.matches[b]++,I=!0)),I||(this.matches.splice(b,2),b-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?p={from:l,to:d}:this.matches.push(1,l)),p&&this.test&&!this.test(p.from,p.to,this.buffer,this.bufferStart)&&(p=null),p}}typeof Symbol<"u"&&(SearchCursor.prototype[Symbol.iterator]=function(){return this});const empty={from:-1,to:-1,match:/.*/.exec("")},baseFlags="gm"+(/x/.unicode==null?"":"u");class RegExpCursor{constructor(e,l,d,p=0,b=e.length){if(this.text=e,this.to=b,this.curLine="",this.done=!1,this.value=empty,/\\[sWDnr]|\n|\r|\[\^/.test(l))return new MultilineRegExpCursor(e,l,d,p,b);this.re=new RegExp(l,baseFlags+(d?.ignoreCase?"i":"")),this.test=d?.test,this.iter=e.iter();let R=e.lineAt(p);this.curLineStart=R.from,this.matchPos=toCharEnd(e,p),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let l=this.matchPos<=this.to&&this.re.exec(this.curLine);if(l){let d=this.curLineStart+l.index,p=d+l[0].length;if(this.matchPos=toCharEnd(this.text,p+(d==p?1:0)),d==this.curLineStart+this.curLine.length&&this.nextLine(),(d<p||d>this.value.to)&&(!this.test||this.test(d,p,l)))return this.value={from:d,to:p,match:l},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const flattened=new WeakMap;class FlattenedDoc{constructor(e,l){this.from=e,this.text=l}get to(){return this.from+this.text.length}static get(e,l,d){let p=flattened.get(e);if(!p||p.from>=d||p.to<=l){let I=new FlattenedDoc(l,e.sliceString(l,d));return flattened.set(e,I),I}if(p.from==l&&p.to==d)return p;let{text:b,from:R}=p;return R>l&&(b=e.sliceString(l,R)+b,R=l),p.to<d&&(b+=e.sliceString(p.to,d)),flattened.set(e,new FlattenedDoc(R,b)),new FlattenedDoc(l,b.slice(l-R,d-R))}}class MultilineRegExpCursor{constructor(e,l,d,p,b){this.text=e,this.to=b,this.done=!1,this.value=empty,this.matchPos=toCharEnd(e,p),this.re=new RegExp(l,baseFlags+(d?.ignoreCase?"i":"")),this.test=d?.test,this.flat=FlattenedDoc.get(e,p,this.chunkEnd(p+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,l=this.re.exec(this.flat.text);if(l&&!l[0]&&l.index==e&&(this.re.lastIndex=e+1,l=this.re.exec(this.flat.text)),l){let d=this.flat.from+l.index,p=d+l[0].length;if((this.flat.to>=this.to||l.index+l[0].length<=this.flat.text.length-10)&&(!this.test||this.test(d,p,l)))return this.value={from:d,to:p,match:l},this.matchPos=toCharEnd(this.text,p+(d==p?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=FlattenedDoc.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(RegExpCursor.prototype[Symbol.iterator]=MultilineRegExpCursor.prototype[Symbol.iterator]=function(){return this});function validRegExp(o){try{return new RegExp(o,baseFlags),!0}catch{return!1}}function toCharEnd(o,e){if(e>=o.length)return e;let l=o.lineAt(e),d;for(;e<l.to&&(d=l.text.charCodeAt(e-l.from))>=56320&&d<57344;)e++;return e}function createLineDialog(o){let e=String(o.state.doc.lineAt(o.state.selection.main.head).number),l=crelt("input",{class:"cm-textfield",name:"line",value:e}),d=crelt("form",{class:"cm-gotoLine",onkeydown:b=>{b.keyCode==27?(b.preventDefault(),o.dispatch({effects:dialogEffect.of(!1)}),o.focus()):b.keyCode==13&&(b.preventDefault(),p())},onsubmit:b=>{b.preventDefault(),p()}},crelt("label",o.state.phrase("Go to line"),": ",l)," ",crelt("button",{class:"cm-button",type:"submit"},o.state.phrase("go")));function p(){let b=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(l.value);if(!b)return;let{state:R}=o,I=R.doc.lineAt(R.selection.main.head),[,z,se,le,tn]=b,an=le?+le.slice(1):0,sn=se?+se:I.number;if(se&&tn){let pn=sn/100;z&&(pn=pn*(z=="-"?-1:1)+I.number/R.doc.lines),sn=Math.round(R.doc.lines*pn)}else se&&z&&(sn=sn*(z=="-"?-1:1)+I.number);let ln=R.doc.line(Math.max(1,Math.min(R.doc.lines,sn))),un=EditorSelection.cursor(ln.from+Math.max(0,Math.min(an,ln.length)));o.dispatch({effects:[dialogEffect.of(!1),EditorView.scrollIntoView(un.from,{y:"center"})],selection:un}),o.focus()}return{dom:d}}const dialogEffect=StateEffect.define(),dialogField=StateField.define({create(){return!0},update(o,e){for(let l of e.effects)l.is(dialogEffect)&&(o=l.value);return o},provide:o=>showPanel.from(o,e=>e?createLineDialog:null)}),gotoLine=o=>{let e=getPanel(o,createLineDialog);if(!e){let l=[dialogEffect.of(!0)];o.state.field(dialogField,!1)==null&&l.push(StateEffect.appendConfig.of([dialogField,baseTheme$1])),o.dispatch({effects:l}),e=getPanel(o,createLineDialog)}return e&&e.dom.querySelector("input").select(),!0},baseTheme$1=EditorView.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),selectWord=({state:o,dispatch:e})=>{let{selection:l}=o,d=EditorSelection.create(l.ranges.map(p=>o.wordAt(p.head)||EditorSelection.cursor(p.head)),l.mainIndex);return d.eq(l)?!1:(e(o.update({selection:d})),!0)};function findNextOccurrence(o,e){let{main:l,ranges:d}=o.selection,p=o.wordAt(l.head),b=p&&p.from==l.from&&p.to==l.to;for(let R=!1,I=new SearchCursor(o.doc,e,d[d.length-1].to);;)if(I.next(),I.done){if(R)return null;I=new SearchCursor(o.doc,e,0,Math.max(0,d[d.length-1].from-1)),R=!0}else{if(R&&d.some(z=>z.from==I.value.from))continue;if(b){let z=o.wordAt(I.value.from);if(!z||z.from!=I.value.from||z.to!=I.value.to)continue}return I.value}}const selectNextOccurrence=({state:o,dispatch:e})=>{let{ranges:l}=o.selection;if(l.some(b=>b.from===b.to))return selectWord({state:o,dispatch:e});let d=o.sliceDoc(l[0].from,l[0].to);if(o.selection.ranges.some(b=>o.sliceDoc(b.from,b.to)!=d))return!1;let p=findNextOccurrence(o,d);return p?(e(o.update({selection:o.selection.addRange(EditorSelection.range(p.from,p.to),!1),effects:EditorView.scrollIntoView(p.to)})),!0):!1},searchConfigFacet=Facet.define({combine(o){return combineConfig(o,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new SearchPanel(e),scrollToMatch:e=>EditorView.scrollIntoView(e)})}});class SearchQuery{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||validRegExp(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(l,d)=>d=="n"?`
|
||
`:d=="r"?"\r":d=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new RegExpQuery(this):new StringQuery(this)}getCursor(e,l=0,d){let p=e.doc?e:EditorState.create({doc:e});return d==null&&(d=p.doc.length),this.regexp?regexpCursor(this,p,l,d):stringCursor(this,p,l,d)}}class QueryType{constructor(e){this.spec=e}}function stringCursor(o,e,l,d){return new SearchCursor(e.doc,o.unquoted,l,d,o.caseSensitive?void 0:p=>p.toLowerCase(),o.wholeWord?stringWordTest(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function stringWordTest(o,e){return(l,d,p,b)=>((b>l||b+p.length<d)&&(b=Math.max(0,l-2),p=o.sliceString(b,Math.min(o.length,d+2))),(e(charBefore(p,l-b))!=CharCategory.Word||e(charAfter(p,l-b))!=CharCategory.Word)&&(e(charAfter(p,d-b))!=CharCategory.Word||e(charBefore(p,d-b))!=CharCategory.Word))}class StringQuery extends QueryType{constructor(e){super(e)}nextMatch(e,l,d){let p=stringCursor(this.spec,e,d,e.doc.length).nextOverlapping();if(p.done){let b=Math.min(e.doc.length,l+this.spec.unquoted.length);p=stringCursor(this.spec,e,0,b).nextOverlapping()}return p.done||p.value.from==l&&p.value.to==d?null:p.value}prevMatchInRange(e,l,d){for(let p=d;;){let b=Math.max(l,p-1e4-this.spec.unquoted.length),R=stringCursor(this.spec,e,b,p),I=null;for(;!R.nextOverlapping().done;)I=R.value;if(I)return I;if(b==l)return null;p-=1e4}}prevMatch(e,l,d){let p=this.prevMatchInRange(e,0,l);return p||(p=this.prevMatchInRange(e,Math.max(0,d-this.spec.unquoted.length),e.doc.length)),p&&(p.from!=l||p.to!=d)?p:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,l){let d=stringCursor(this.spec,e,0,e.doc.length),p=[];for(;!d.next().done;){if(p.length>=l)return null;p.push(d.value)}return p}highlight(e,l,d,p){let b=stringCursor(this.spec,e,Math.max(0,l-this.spec.unquoted.length),Math.min(d+this.spec.unquoted.length,e.doc.length));for(;!b.next().done;)p(b.value.from,b.value.to)}}function regexpCursor(o,e,l,d){return new RegExpCursor(e.doc,o.search,{ignoreCase:!o.caseSensitive,test:o.wholeWord?regexpWordTest(e.charCategorizer(e.selection.main.head)):void 0},l,d)}function charBefore(o,e){return o.slice(findClusterBreak(o,e,!1),e)}function charAfter(o,e){return o.slice(e,findClusterBreak(o,e))}function regexpWordTest(o){return(e,l,d)=>!d[0].length||(o(charBefore(d.input,d.index))!=CharCategory.Word||o(charAfter(d.input,d.index))!=CharCategory.Word)&&(o(charAfter(d.input,d.index+d[0].length))!=CharCategory.Word||o(charBefore(d.input,d.index+d[0].length))!=CharCategory.Word)}class RegExpQuery extends QueryType{nextMatch(e,l,d){let p=regexpCursor(this.spec,e,d,e.doc.length).next();return p.done&&(p=regexpCursor(this.spec,e,0,l).next()),p.done?null:p.value}prevMatchInRange(e,l,d){for(let p=1;;p++){let b=Math.max(l,d-p*1e4),R=regexpCursor(this.spec,e,b,d),I=null;for(;!R.next().done;)I=R.value;if(I&&(b==l||I.from>b+10))return I;if(b==l)return null}}prevMatch(e,l,d){return this.prevMatchInRange(e,0,l)||this.prevMatchInRange(e,d,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(l,d)=>d=="$"?"$":d=="&"?e.match[0]:d!="0"&&+d<e.match.length?e.match[d]:l)}matchAll(e,l){let d=regexpCursor(this.spec,e,0,e.doc.length),p=[];for(;!d.next().done;){if(p.length>=l)return null;p.push(d.value)}return p}highlight(e,l,d,p){let b=regexpCursor(this.spec,e,Math.max(0,l-250),Math.min(d+250,e.doc.length));for(;!b.next().done;)p(b.value.from,b.value.to)}}const setSearchQuery=StateEffect.define(),togglePanel$1=StateEffect.define(),searchState=StateField.define({create(o){return new SearchState(defaultQuery(o).create(),null)},update(o,e){for(let l of e.effects)l.is(setSearchQuery)?o=new SearchState(l.value.create(),o.panel):l.is(togglePanel$1)&&(o=new SearchState(o.query,l.value?createSearchPanel:null));return o},provide:o=>showPanel.from(o,e=>e.panel)});class SearchState{constructor(e,l){this.query=e,this.panel=l}}const matchMark$1=Decoration.mark({class:"cm-searchMatch"}),selectedMatchMark=Decoration.mark({class:"cm-searchMatch cm-searchMatch-selected"}),searchHighlighter=ViewPlugin.fromClass(class{constructor(o){this.view=o,this.decorations=this.highlight(o.state.field(searchState))}update(o){let e=o.state.field(searchState);(e!=o.startState.field(searchState)||o.docChanged||o.selectionSet||o.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:o,panel:e}){if(!e||!o.spec.valid)return Decoration.none;let{view:l}=this,d=new RangeSetBuilder;for(let p=0,b=l.visibleRanges,R=b.length;p<R;p++){let{from:I,to:z}=b[p];for(;p<R-1&&z>b[p+1].from-2*250;)z=b[++p].to;o.highlight(l.state,I,z,(se,le)=>{let tn=l.state.selection.ranges.some(an=>an.from==se&&an.to==le);d.add(se,le,tn?selectedMatchMark:matchMark$1)})}return d.finish()}},{decorations:o=>o.decorations});function searchCommand(o){return e=>{let l=e.state.field(searchState,!1);return l&&l.query.spec.valid?o(e,l):openSearchPanel(e)}}const findNext=searchCommand((o,{query:e})=>{let{to:l}=o.state.selection.main,d=e.nextMatch(o.state,l,l);if(!d)return!1;let p=EditorSelection.single(d.from,d.to),b=o.state.facet(searchConfigFacet);return o.dispatch({selection:p,effects:[announceMatch(o,d),b.scrollToMatch(p.main,o)],userEvent:"select.search"}),selectSearchInput(o),!0}),findPrevious=searchCommand((o,{query:e})=>{let{state:l}=o,{from:d}=l.selection.main,p=e.prevMatch(l,d,d);if(!p)return!1;let b=EditorSelection.single(p.from,p.to),R=o.state.facet(searchConfigFacet);return o.dispatch({selection:b,effects:[announceMatch(o,p),R.scrollToMatch(b.main,o)],userEvent:"select.search"}),selectSearchInput(o),!0}),selectMatches=searchCommand((o,{query:e})=>{let l=e.matchAll(o.state,1e3);return!l||!l.length?!1:(o.dispatch({selection:EditorSelection.create(l.map(d=>EditorSelection.range(d.from,d.to))),userEvent:"select.search.matches"}),!0)}),selectSelectionMatches=({state:o,dispatch:e})=>{let l=o.selection;if(l.ranges.length>1||l.main.empty)return!1;let{from:d,to:p}=l.main,b=[],R=0;for(let I=new SearchCursor(o.doc,o.sliceDoc(d,p));!I.next().done;){if(b.length>1e3)return!1;I.value.from==d&&(R=b.length),b.push(EditorSelection.range(I.value.from,I.value.to))}return e(o.update({selection:EditorSelection.create(b,R),userEvent:"select.search.matches"})),!0},replaceNext=searchCommand((o,{query:e})=>{let{state:l}=o,{from:d,to:p}=l.selection.main;if(l.readOnly)return!1;let b=e.nextMatch(l,d,d);if(!b)return!1;let R=b,I=[],z,se,le=[];if(R.from==d&&R.to==p&&(se=l.toText(e.getReplacement(R)),I.push({from:R.from,to:R.to,insert:se}),R=e.nextMatch(l,R.from,R.to),le.push(EditorView.announce.of(l.phrase("replaced match on line $",l.doc.lineAt(d).number)+"."))),R){let tn=I.length==0||I[0].from>=b.to?0:b.to-b.from-se.length;z=EditorSelection.single(R.from-tn,R.to-tn),le.push(announceMatch(o,R)),le.push(l.facet(searchConfigFacet).scrollToMatch(z.main,o))}return o.dispatch({changes:I,selection:z,effects:le,userEvent:"input.replace"}),!0}),replaceAll=searchCommand((o,{query:e})=>{if(o.state.readOnly)return!1;let l=e.matchAll(o.state,1e9).map(p=>{let{from:b,to:R}=p;return{from:b,to:R,insert:e.getReplacement(p)}});if(!l.length)return!1;let d=o.state.phrase("replaced $ matches",l.length)+".";return o.dispatch({changes:l,effects:EditorView.announce.of(d),userEvent:"input.replace.all"}),!0});function createSearchPanel(o){return o.state.facet(searchConfigFacet).createPanel(o)}function defaultQuery(o,e){var l,d,p,b,R;let I=o.selection.main,z=I.empty||I.to>I.from+100?"":o.sliceDoc(I.from,I.to);if(e&&!z)return e;let se=o.facet(searchConfigFacet);return new SearchQuery({search:((l=e?.literal)!==null&&l!==void 0?l:se.literal)?z:z.replace(/\n/g,"\\n"),caseSensitive:(d=e?.caseSensitive)!==null&&d!==void 0?d:se.caseSensitive,literal:(p=e?.literal)!==null&&p!==void 0?p:se.literal,regexp:(b=e?.regexp)!==null&&b!==void 0?b:se.regexp,wholeWord:(R=e?.wholeWord)!==null&&R!==void 0?R:se.wholeWord})}function getSearchInput(o){let e=getPanel(o,createSearchPanel);return e&&e.dom.querySelector("[main-field]")}function selectSearchInput(o){let e=getSearchInput(o);e&&e==o.root.activeElement&&e.select()}const openSearchPanel=o=>{let e=o.state.field(searchState,!1);if(e&&e.panel){let l=getSearchInput(o);if(l&&l!=o.root.activeElement){let d=defaultQuery(o.state,e.query.spec);d.valid&&o.dispatch({effects:setSearchQuery.of(d)}),l.focus(),l.select()}}else o.dispatch({effects:[togglePanel$1.of(!0),e?setSearchQuery.of(defaultQuery(o.state,e.query.spec)):StateEffect.appendConfig.of(searchExtensions)]});return!0},closeSearchPanel=o=>{let e=o.state.field(searchState,!1);if(!e||!e.panel)return!1;let l=getPanel(o,createSearchPanel);return l&&l.dom.contains(o.root.activeElement)&&o.focus(),o.dispatch({effects:togglePanel$1.of(!1)}),!0};class SearchPanel{constructor(e){this.view=e;let l=this.query=e.state.field(searchState).query.spec;this.commit=this.commit.bind(this),this.searchField=crelt("input",{value:l.search,placeholder:phrase(e,"Find"),"aria-label":phrase(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=crelt("input",{value:l.replace,placeholder:phrase(e,"Replace"),"aria-label":phrase(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=crelt("input",{type:"checkbox",name:"case",form:"",checked:l.caseSensitive,onchange:this.commit}),this.reField=crelt("input",{type:"checkbox",name:"re",form:"",checked:l.regexp,onchange:this.commit}),this.wordField=crelt("input",{type:"checkbox",name:"word",form:"",checked:l.wholeWord,onchange:this.commit});function d(p,b,R){return crelt("button",{class:"cm-button",name:p,onclick:b,type:"button"},R)}this.dom=crelt("div",{onkeydown:p=>this.keydown(p),class:"cm-search"},[this.searchField,d("next",()=>findNext(e),[phrase(e,"next")]),d("prev",()=>findPrevious(e),[phrase(e,"previous")]),d("select",()=>selectMatches(e),[phrase(e,"all")]),crelt("label",null,[this.caseField,phrase(e,"match case")]),crelt("label",null,[this.reField,phrase(e,"regexp")]),crelt("label",null,[this.wordField,phrase(e,"by word")]),...e.state.readOnly?[]:[crelt("br"),this.replaceField,d("replace",()=>replaceNext(e),[phrase(e,"replace")]),d("replaceAll",()=>replaceAll(e),[phrase(e,"replace all")])],crelt("button",{name:"close",onclick:()=>closeSearchPanel(e),"aria-label":phrase(e,"close"),type:"button"},["×"])])}commit(){let e=new SearchQuery({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:setSearchQuery.of(e)}))}keydown(e){runScopeHandlers(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?findPrevious:findNext)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),replaceNext(this.view))}update(e){for(let l of e.transactions)for(let d of l.effects)d.is(setSearchQuery)&&!d.value.eq(this.query)&&this.setQuery(d.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(searchConfigFacet).top}}function phrase(o,e){return o.state.phrase(e)}const AnnounceMargin=30,Break=/[\s\.,:;?!]/;function announceMatch(o,{from:e,to:l}){let d=o.state.doc.lineAt(e),p=o.state.doc.lineAt(l).to,b=Math.max(d.from,e-AnnounceMargin),R=Math.min(p,l+AnnounceMargin),I=o.state.sliceDoc(b,R);if(b!=d.from){for(let z=0;z<AnnounceMargin;z++)if(!Break.test(I[z+1])&&Break.test(I[z])){I=I.slice(z);break}}if(R!=p){for(let z=I.length-1;z>I.length-AnnounceMargin;z--)if(!Break.test(I[z-1])&&Break.test(I[z])){I=I.slice(0,z);break}}return EditorView.announce.of(`${o.state.phrase("current match")}. ${I} ${o.state.phrase("on line")} ${d.number}.`)}const baseTheme$2=EditorView.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),searchExtensions=[searchState,Prec.low(searchHighlighter),baseTheme$2],basicSetup=[highlightSpecialChars(),history(),dropCursor(),rectangularSelection(),crosshairCursor(),keymap.of([...closeBracketsKeymap,...defaultKeymap,...historyKeymap])],minimalSetup=[highlightSpecialChars(),history(),drawSelection(),syntaxHighlighting(defaultHighlightStyle,{fallback:!0}),keymap.of([...defaultKeymap,...historyKeymap])];function getBlockRegions(o){const e=o.split("");let l=0,d=[],p=0,b=[];for(;l<e.length;)e[l]===`
|
||
`?d.push(l):e[l].trim()!==""&&(d.length>1&&(b.push([p,d[0]]),p=l),d=[]),l++;return b.push([p,d.length?d[0]:l]),b}function getBlockAt(o,e){const l=getBlockRegions(o);for(const[d,p]of l)if(e>=d&&e<=p)return[d,p];return null}const evalBlock=o=>{const{state:e}=o.editor,l=e.doc.toString(),d=e.selection.main.head,p=getBlockAt(l,d);if(p){const[b,R]=p,I=l.slice(b,R);I&&(o.flash(200,{from:b,to:R}),o.repl.evaluateBlock(I,!0,{range:p}))}return!0},setFlash=StateEffect.define(),flashField=StateField.define({create(){return Decoration.none},update(o,e){try{for(let l of e.effects)if(l.is(setFlash))if(l.value&&e.newDoc.length>0){const d=Decoration.mark({attributes:{style:"background-color: rgba(255,255,255, .4); filter: invert(10%)"}}),p=l.value.range||{from:0,to:e.newDoc.length};o=Decoration.set([d.range(p.from,p.to)])}else o=Decoration.set([]);return o}catch(l){return console.warn("flash error",l),o}},provide:o=>EditorView.decorations.from(o)}),flash=(o,e=200,l)=>{const d=l?{range:l}:!0;o.dispatch({effects:setFlash.of(d)}),setTimeout(()=>{o.dispatch({effects:setFlash.of(!1)})},e)},isFlashEnabled=o=>o?flashField:[],setMiniLocations=StateEffect.define(),showMiniLocations=StateEffect.define(),displayMiniLocations=StateEffect.define(),updateMiniLocations=(o,e,l=null)=>{o.dispatch({effects:setMiniLocations.of({locations:e,range:l})})},highlightMiniLocations=(o,e,l)=>{o.dispatch({effects:showMiniLocations.of({atTime:e,haps:l})})},miniLocations=StateField.define({create(){return Decoration.none},update(o,e){e.docChanged&&(o=o.map(e.changes));for(let l of e.effects)if(l.is(setMiniLocations))if(l.value.range){const d=getMiniLocationsFromDecorations(o),p=l.value.locations.filter(([z])=>z<e.newDoc.length).map(([z,se])=>[z,Math.min(se,e.newDoc.length)]),b=new Set(p.map(z=>z.join(":"))),R=p.map(z=>{const se=z.join(":");return Decoration.mark({id:se,attributes:{style:"background-color: #00CA2880"}}).range(...z)}),I=d.filter(({id:z})=>!b.has(z)).map(({from:z,to:se,id:le})=>Decoration.mark({id:le,attributes:{style:"background-color: #00CA2880"}}).range(z,se));o=Decoration.set(I.concat(R),!0)}else{const d=l.value.locations.filter(([p])=>p<e.newDoc.length).map(([p,b])=>[p,Math.min(b,e.newDoc.length)]).map(p=>Decoration.mark({id:p.join(":"),attributes:{style:"background-color: #00CA2880"}}).range(...p));o=Decoration.set(d,!0)}return o}}),visibleMiniLocations=StateField.define({create(){return{atTime:0,haps:new Map}},update(o,e){for(let l of e.effects)if(l.is(showMiniLocations)){const d=new Map;for(let p of l.value.haps)if(!(!p.context?.locations||!p.whole))for(let{start:b,end:R}of p.context.locations){let I=`${b}:${R}`;(!d.has(I)||d.get(I).whole.begin.lt(p.whole.begin))&&d.set(I,p)}o={atTime:l.value.atTime,haps:d}}return o}}),displayMiniLocationsState=StateField.define({create(){return!0},update(o,e){for(let l of e.effects)l.is(displayMiniLocations)&&(o=l.value);return o}}),miniLocationHighlights=EditorView.decorations.compute([miniLocations,visibleMiniLocations,displayMiniLocationsState],o=>{if(!o.field(displayMiniLocationsState))return Decoration.none;const l=o.field(miniLocations).iter(),{haps:d}=o.field(visibleMiniLocations),p=new RangeSetBuilder;for(;l.value;){const{from:b,to:R,value:{spec:{id:I}}}=l;if(d.has(I)){const z=d.get(I),se=z.value?.color??"var(--foreground)",le=z.value?.markcss||`outline: solid 2px ${se}`;p.add(b,R,Decoration.mark({attributes:{style:le}}))}l.next()}return p.finish()}),getMiniLocationsFromDecorations=o=>{const e=o.iter(),l=[];for(;e.value;){const{from:d,to:p,value:{spec:{id:b}}}=e;l.push({from:d,to:p,id:b}),e.next()}return l},getMiniLocations=o=>{const e=o.field(miniLocations);return getMiniLocationsFromDecorations(e)},getActiveMiniLocations=o=>{const e=getMiniLocations(o),{haps:l}=o.field(visibleMiniLocations);return e.filter(p=>l.has(p.id))},highlightExtension=[miniLocations,visibleMiniLocations,displayMiniLocationsState,miniLocationHighlights],isPatternHighlightingEnabled=(o,e)=>(e&&e.editor.dispatch({effects:displayMiniLocations.of(o)}),Prec.highest(highlightExtension));let getDrawSelectionConfig$1=getDrawSelectionConfig$2,Piece$1=class{constructor(e,l,d,p,b,R,I,z,se,le){this.left=e,this.top=l,this.height=d,this.fontFamily=p,this.fontSize=b,this.fontWeight=R,this.color=I,this.className=z,this.letter=se,this.partial=le}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",e.style.height=this.height+"px",e.style.lineHeight=this.height+"px",e.style.fontFamily=this.fontFamily,e.style.fontSize=this.fontSize,e.style.fontWeight=this.fontWeight,e.style.color=this.partial?"transparent":this.color,e.className=this.className,e.textContent=this.letter}eq(e){return this.left==e.left&&this.top==e.top&&this.height==e.height&&this.fontFamily==e.fontFamily&&this.fontSize==e.fontSize&&this.fontWeight==e.fontWeight&&this.color==e.color&&this.className==e.className&&this.letter==e.letter}},BlockCursorPlugin$1=class{constructor(e,l){this.view=e,this.rangePieces=[],this.cursors=[],this.em=l,this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.cursorLayer=e.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className="cm-cursorLayer cm-vimCursorLayer",this.cursorLayer.setAttribute("aria-hidden","true"),e.requestMeasure(this.measureReq),this.setBlinkRate()}setBlinkRate(){let l=getDrawSelectionConfig$1(this.view.state).cursorBlinkRate;this.cursorLayer.style.animationDuration=l+"ms"}update(e){(e.selectionSet||e.geometryChanged||e.viewportChanged)&&(this.view.requestMeasure(this.measureReq),this.cursorLayer.style.animationName=this.cursorLayer.style.animationName=="cm-blink"?"cm-blink2":"cm-blink"),configChanged$1(e)&&this.setBlinkRate()}scheduleRedraw(){this.view.requestMeasure(this.measureReq)}readPos(){let{state:e}=this.view,l=[];for(let d of e.selection.ranges){let p=d==e.selection.main,b=measureCursor$1(this.em,this.view,d,p);b&&l.push(b)}return{cursors:l}}drawSel({cursors:e}){if(e.length!=this.cursors.length||e.some((l,d)=>!l.eq(this.cursors[d]))){let l=this.cursorLayer.children;if(l.length!==e.length){this.cursorLayer.textContent="";for(const d of e)this.cursorLayer.appendChild(d.draw())}else e.forEach((d,p)=>d.adjust(l[p]));this.cursors=e}}destroy(){this.cursorLayer.remove()}};function configChanged$1(o){return getDrawSelectionConfig$1(o.startState)!=getDrawSelectionConfig$1(o.state)}const themeSpec$1={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-fat-cursor":{position:"absolute",background:"#ff9696",border:"none",whiteSpace:"pre"},"&:not(.cm-focused) .cm-fat-cursor":{background:"none",outline:"solid 1px #ff9696",color:"transparent !important"}},hideNativeSelection$1=Prec.highest(EditorView.theme(themeSpec$1));function getBase$1(o){let e=o.scrollDOM.getBoundingClientRect();return{left:(o.textDirection==Direction.LTR?e.left:e.right-o.scrollDOM.clientWidth)-o.scrollDOM.scrollLeft,top:e.top-o.scrollDOM.scrollTop}}function measureCursor$1(o,e,l,d){var p,b;let R=l.head,I=1;(o.$data.count||o.$data.keyChain)&&(I=.5);{let se=R<e.state.doc.length&&e.state.sliceDoc(R,R+1);se&&/[\uDC00-\uDFFF]/.test(se)&&R>1&&(R--,se=e.state.sliceDoc(R,R+1));let le=e.coordsAtPos(R,1);if(!le)return null;let tn=getBase$1(e),an=e.domAtPos(R),sn=an?an.node:e.contentDOM;for(;an&&an.node instanceof HTMLElement;)sn=an.node,an={node:an.node.childNodes[an.offset],offset:0};if(!(sn instanceof HTMLElement)){if(!sn.parentNode)return null;sn=sn.parentNode}let ln=getComputedStyle(sn),un=le.left,pn=(b=(p=e).coordsForChar)===null||b===void 0?void 0:b.call(p,R);if(pn&&(un=pn.left),!se||se==`
|
||
`||se=="\r")se=" ";else if(se==" "){se=" ";var z=e.coordsAtPos(R+1,-1);z&&(un=z.left-(z.left-le.left)/parseInt(ln.tabSize))}else/[\uD800-\uDBFF]/.test(se)&&R<e.state.doc.length-1&&(se+=e.state.sliceDoc(R+1,R+2));let yn=le.bottom-le.top;return new Piece$1(un-tn.left,le.top-tn.top+yn*(1-I),yn*I,ln.fontFamily,ln.fontSize,ln.fontWeight,ln.color,d?"cm-fat-cursor cm-cursor-primary":"cm-fat-cursor cm-cursor-secondary",se,I!=1)}}const emacsStyle=EditorView.theme({".cm-emacsMode .cm-cursorLayer:not(.cm-vimCursorLayer)":{display:"none"},".cm-vim-panel":{padding:"5px 10px",backgroundColor:"#fffa8f",fontFamily:"monospace"},".cm-vim-panel input":{border:"none",outline:"none",backgroundColor:"#fffa8f"}}),emacsPlugin=ViewPlugin.fromClass(class{constructor(o){this.status="",this.view=o,this.em=new EmacsHandler(o),this.blockCursor=new BlockCursorPlugin$1(o,this.em),this.view.scrollDOM.classList.add("cm-emacsMode")}update(o){o.docChanged&&(this.em.$emacsMark=null,this.em.updateMarksOnChange(o.changes)),this.blockCursor.update(o)}destroy(){this.view.scrollDOM.classList.remove("cm-emacsMode"),this.blockCursor.destroy()}},{eventHandlers:{keydown:function(o,e){var l=this.em.handleKeyboard(o);return l&&this.blockCursor.scheduleRedraw(),!!l},mousedown:function(){this.em.$emacsMark=null}}}),showVimPanel$1=StateEffect.define(),vimPanelState$1=StateField.define({create:()=>!1,update(o,e){for(let l of e.effects)l.is(showVimPanel$1)&&(o=l.value);return o},provide:o=>showPanel.from(o,e=>e?createVimPanel$1:null)});function createVimPanel$1(o){let e=document.createElement("div");return e.className="cm-vim-panel",{top:!1,dom:e}}function emacs(o={}){return[emacsStyle,emacsPlugin,hideNativeSelection$1,vimPanelState$1]}var specialKey={Return:"Return",Escape:"Esc",Insert:"Ins",ArrowLeft:"Left",ArrowRight:"Right",ArrowUp:"Up",ArrowDown:"Down",Enter:"Return",Divide:"/",Slash:"/",Multiply:"*",Subtract:"-",Minus:"-",Equal:"="},ignoredKeys={Shift:1,Alt:1,Command:1,Control:1,CapsLock:1};const commandKeyBinding={};class EmacsHandler{constructor(e){this.view=e,this.$data={count:0,keyChain:"",lastCommand:""},this.$emacsMarkRing=[],this.$emacsMark=null}static bindKey(e,l){e.split("|").forEach(function(d){let p="",b=d.split(/\s+/);b.forEach(function(R,I){let z=R.split(/-(?=.)/),se=z.pop();z.length&&(p+=z.sort().join("-")+"-"),p+=se,I===b.length-1?commandKeyBinding[p]=l:(commandKeyBinding[p]="null",p+=" ")})})}static getKey(e){var l=e.code,d=e.key;if(ignoredKeys[d])return["","",""];l.length>1&&(l[0]=="N"&&(l=l.replace(/^Numpad/,"")),l[0]=="K"&&(l=l.replace(/^Key/,""))),l=specialKey[l]||l,l.length==1&&(l=l.toLowerCase());var p="";return e.ctrlKey&&(p+="C-"),e.metaKey&&(p+="CMD-"),e.altKey&&(p+="M-"),e.shiftKey&&(p+="S-"),[l,p,d]}static addCommands(e){Object.keys(e).forEach(function(l){var d=e[l];typeof d=="function"&&(d={exec:d}),EmacsHandler.commands[l]=d})}static execCommand(e,l,d,p=1){var b=void 0;if(p<0&&(p=-p),typeof e=="function")for(var R=0;R<p;R++)e(l.view);else if(e!=="null")if(e.exec){p>1&&e.handlesCount&&(d||(d={}),typeof d=="object"&&(d.count=p),p=1);for(var R=0;R<p;R++)b=e.exec(l,d||{})}else throw new Error("missformed command");return b}handleKeyboard(e){var l=EmacsHandler.getKey(e),d=this.findCommand(l);if(!(/Up|Down/.test(l?.[0])&&completionStatus(this.view.state))){if(d&&d.command){var p=EmacsHandler.execCommand(d.command,this,d.args,d.count);if(p===!1)return}return d}}findCommand([e,l,d]){if(e){var p=this,b=this.$data;if(!l&&e.length==1&&(p.pushEmacsMark(),b.count)){var R=new Array(b.count+1).join(d);return b.count=null,{command:"insertstring",args:R}}if(l=="C-"||b.count){var se=parseInt(e[e.length-1]);if(typeof se=="number"&&!isNaN(se))return b.count=Math.max(b.count||0,0),b.count=10*b.count+se,{command:"null"}}l&&(e=l+e),b.keyChain&&(e=b.keyChain+=" "+e);var I=commandKeyBinding[e];if(b.keyChain=I=="null"?e:"",!!I){if(I==="null")return{command:"null"};if(I==="universalArgument")return b.count=-4,{command:"null"};var z;if(typeof I!="string"&&(z=I.args,I.command&&(I=I.command)),(I==="insertstring"||I===splitLine||I===toggleComment)&&p.pushEmacsMark(),!(typeof I=="string"&&(I=EmacsHandler.commands[I],!I))){!I.readOnly&&!I.keepLastCommand&&(b.lastCommand=null);var se=b.count||1;return b.count&&(b.count=0),{command:I,args:z,count:se}}}}}showCommandLine(e){console.error("TODO")}updateMarksOnChange(e){this.$emacsMark&&(this.$emacsMark=this.updateMark(this.$emacsMark,e)),this.$emacsMarkRing=this.$emacsMarkRing.map(l=>this.updateMark(l,e)).filter(Boolean)}updateMark(e,l){if(e){var d=e.map(function(p){return l.mapPos(p,1,MapMode.TrackDel)}).filter(p=>p!=null);return d.length==0?null:d}}emacsMark(){return this.$emacsMark}setEmacsMark(e){this.$emacsMark=e}pushEmacsMark(e,l){var d=this.$emacsMark;d&&pushUnique(this.$emacsMarkRing,d),!e||l?this.setEmacsMark(e):pushUnique(this.$emacsMarkRing,e)}popEmacsMark(){var e=this.emacsMark();return e?(this.setEmacsMark(null),e):this.$emacsMarkRing.pop()}getLastEmacsMark(){return this.$emacsMark||this.$emacsMarkRing.slice(-1)[0]}getCopyText(){var e=this.view.state;return e.selection.ranges.map(l=>e.sliceDoc(l.from,l.to)).join(`
|
||
`)}clearSelection(){var e=this.view,l=e.state.selection,d=!l.ranges.some(b=>b.from!=b.to);if(d)return!1;var p=l.ranges.map(b=>EditorSelection.range(b.head,b.head));return e.dispatch({selection:EditorSelection.create(p,l.mainIndex)}),!0}onPaste(e){var l=this.view,d=l.state.selection,p;if(d.ranges.length>1){var b=e.split(`
|
||
`);b.length==d.ranges.length&&(p=b)}var R=0,I=l.state.changeByRange(z=>{var se=p?p[R]:e;return R++,{changes:{from:z.from,to:z.to,insert:se},range:EditorSelection.cursor(z.from+se.length)}});l.dispatch(I)}selectionToEmacsMark(){var e=this.view.state.selection;return e.ranges.map(l=>l.head)}}EmacsHandler.commands={};function pushUnique(o,e){o.length&&o[o.length-1]+""==e+""||o.push(e)}function initVim(o){var e=o.Pos;function l(nn,rn,cn){if(rn.line===cn.line&&rn.ch>=cn.ch-1){var dn=nn.getLine(rn.line),fn=dn.charCodeAt(rn.ch);55296<=fn&&fn<=55551&&(cn.ch+=1)}return{start:rn,end:cn}}var d=[{keys:"<Left>",type:"keyToKey",toKeys:"h"},{keys:"<Right>",type:"keyToKey",toKeys:"l"},{keys:"<Up>",type:"keyToKey",toKeys:"k"},{keys:"<Down>",type:"keyToKey",toKeys:"j"},{keys:"g<Up>",type:"keyToKey",toKeys:"gk"},{keys:"g<Down>",type:"keyToKey",toKeys:"gj"},{keys:"<Space>",type:"keyToKey",toKeys:"l"},{keys:"<BS>",type:"keyToKey",toKeys:"h"},{keys:"<Del>",type:"keyToKey",toKeys:"x"},{keys:"<C-Space>",type:"keyToKey",toKeys:"W"},{keys:"<C-BS>",type:"keyToKey",toKeys:"B"},{keys:"<S-Space>",type:"keyToKey",toKeys:"w"},{keys:"<S-BS>",type:"keyToKey",toKeys:"b"},{keys:"<C-n>",type:"keyToKey",toKeys:"j"},{keys:"<C-p>",type:"keyToKey",toKeys:"k"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-Esc>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-Esc>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"<Home>",type:"keyToKey",toKeys:"0"},{keys:"<End>",type:"keyToKey",toKeys:"$"},{keys:"<PageUp>",type:"keyToKey",toKeys:"<C-b>"},{keys:"<PageDown>",type:"keyToKey",toKeys:"<C-f>"},{keys:"<CR>",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"<Ins>",type:"keyToKey",toKeys:"i",context:"normal"},{keys:"<Ins>",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"(",type:"motion",motion:"moveBySentence",motionArgs:{forward:!1}},{keys:")",type:"motion",motion:"moveBySentence",motionArgs:{forward:!0}},{keys:"<C-f>",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"<C-b>",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"<C-d>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"<C-u>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"g$",type:"motion",motion:"moveToEndOfDisplayLine"},{keys:"g^",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"g0",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:"f<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'<register>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`<register>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:"=",type:"operator",operator:"indentAuto"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"gn",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!0}},{keys:"gN",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!1}},{keys:"gq",type:"operator",operator:"hardWrap"},{keys:"gw",type:"operator",operator:"hardWrap",operatorArgs:{keepCursor:!0}},{keys:"g?",type:"operator",operator:"rot13"},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"expandToLine",motionArgs:{linewise:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"<C-u>",type:"operatorMotion",operator:"delete",motion:"moveToStartOfLine",context:"insert"},{keys:"<C-w>",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"<C-w>",type:"idle",context:"normal"},{keys:"<C-i>",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"<C-o>",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"<C-e>",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"<C-y>",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"gi",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"lastEdit"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"gI",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"bol"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"<C-v>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"<C-q>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"gJ",type:"action",action:"joinLines",actionArgs:{keepSpaces:!0},isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r<character>",type:"action",action:"replace",isEdit:!0},{keys:"@<register>",type:"action",action:"replayMacro"},{keys:"q<register>",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0},context:"normal"},{keys:"R",type:"operator",operator:"change",operatorArgs:{linewise:!0,fullLine:!0},context:"visual",exitVisualBlock:!0},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual",isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"<C-r>",type:"action",action:"redo"},{keys:"m<register>",type:"action",action:"setMark"},{keys:'"<register>',type:"action",action:"setRegister"},{keys:"<C-r><register>",type:"action",action:"insertRegister",context:"insert",isEdit:!0},{keys:"<C-o>",type:"action",action:"oneNormalCommand",context:"insert"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z<CR>",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"<C-a>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"<C-x>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"<C-t>",type:"action",action:"indent",actionArgs:{indentRight:!0},context:"insert"},{keys:"<C-d>",type:"action",action:"indent",actionArgs:{indentRight:!1},context:"insert"},{keys:"a<register>",type:"motion",motion:"textObjectManipulation"},{keys:"i<register>",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],p=Object.create(null),b=d.length,R=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"omap",shortName:"om"},{name:"noremap",shortName:"no"},{name:"nnoremap",shortName:"nn"},{name:"vnoremap",shortName:"vn"},{name:"inoremap",shortName:"ino"},{name:"onoremap",shortName:"ono"},{name:"unmap"},{name:"mapclear",shortName:"mapc"},{name:"nmapclear",shortName:"nmapc"},{name:"vmapclear",shortName:"vmapc"},{name:"imapclear",shortName:"imapc"},{name:"omapclear",shortName:"omapc"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"startinsert",shortName:"start"},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"delmarks",shortName:"delm"},{name:"marks",excludeFromCommandHistory:!0},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"vglobal",shortName:"v"},{name:"delete",shortName:"d"},{name:"join",shortName:"j"},{name:"normal",shortName:"norm"},{name:"global",shortName:"g"}],I=ga("");function z(nn){nn.setOption("disableInput",!0),nn.setOption("showCursorWhenSelecting",!1),o.signal(nn,"vim-mode-change",{mode:"normal"}),nn.on("cursorActivity",_r),aa(nn),o.on(nn.getInputField(),"paste",le(nn))}function se(nn){nn.setOption("disableInput",!1),nn.off("cursorActivity",_r),o.off(nn.getInputField(),"paste",le(nn)),nn.state.vim=null,Ns&&clearTimeout(Ns)}function le(nn){var rn=nn.state.vim;return rn.onPasteFn||(rn.onPasteFn=function(){rn.insertMode||(nn.setCursor(Ka(nn.getCursor(),0,1)),ca.enterInsertMode(nn,{},rn))}),rn.onPasteFn}var tn=/[\d]/,an=[o.isWordChar,function(nn){return nn&&!o.isWordChar(nn)&&!/\s/.test(nn)}],sn=[function(nn){return/\S/.test(nn)}],ln=["<",">"],un=["-",'"',".",":","_","/","+"],pn=/^\w$/,yn=/^[A-Z]$/;try{yn=new RegExp("^[\\p{Lu}]$","u")}catch{}function _n(nn,rn){return rn>=nn.firstLine()&&rn<=nn.lastLine()}function Pn(nn){return/^[a-z]$/.test(nn)}function vn(nn){return"()[]{}".indexOf(nn)!=-1}function bn(nn){return tn.test(nn)}function Sn(nn){return yn.test(nn)}function An(nn){return/^\s*$/.test(nn)}function Dn(nn){return".?!".indexOf(nn)!=-1}function Bn(nn,rn){for(var cn=0;cn<rn.length;cn++)if(rn[cn]==nn)return!0;return!1}var Nn={};function Qn(nn,rn,cn,dn,fn){if(rn===void 0&&!fn)throw Error("defaultValue is required unless callback is provided");if(cn||(cn="string"),Nn[nn]={type:cn,defaultValue:rn,callback:fn},dn)for(var gn=0;gn<dn.length;gn++)Nn[dn[gn]]=Nn[nn];rn&&Zn(nn,rn)}function Zn(nn,rn,cn,dn){var fn=Nn[nn];dn=dn||{};var gn=dn.scope;if(!fn)return new Error("Unknown option: "+nn);if(fn.type=="boolean"){if(rn&&rn!==!0)return new Error("Invalid argument: "+nn+"="+rn);rn!==!1&&(rn=!0)}fn.callback?(gn!=="local"&&fn.callback(rn,void 0),gn!=="global"&&cn&&fn.callback(rn,cn)):(gn!=="local"&&(fn.value=fn.type=="boolean"?!!rn:rn),gn!=="global"&&cn&&(cn.state.vim.options[nn]={value:rn}))}function Vn(nn,rn,cn){var dn=Nn[nn];cn=cn||{};var fn=cn.scope;if(!dn)return new Error("Unknown option: "+nn);if(dn.callback){let gn=rn&&dn.callback(void 0,rn);return fn!=="global"&&gn!==void 0?gn:fn!=="local"?dn.callback():void 0}else return(fn!=="global"&&rn&&rn.state.vim.options[nn]||fn!=="local"&&dn||{}).value}Qn("filetype",void 0,"string",["ft"],function(nn,rn){if(rn!==void 0)if(nn===void 0){let cn=rn.getOption("mode");return cn=="null"?"":cn}else{let cn=nn==""?"null":nn;rn.setOption("mode",cn)}}),Qn("textwidth",80,"number",["tw"],function(nn,rn){if(rn!==void 0)if(nn===void 0){var cn=rn.getOption("textwidth");return cn}else{var dn=Math.round(nn);dn>1&&rn.setOption("textwidth",dn)}});var qn=function(){var nn=100,rn=-1,cn=0,dn=0,fn=new Array(nn);function gn(En,Rn,Ln){var Xn=rn%nn,In=fn[Xn];function Wn(ea){var na=++rn%nn,ma=fn[na];ma&&ma.clear(),fn[na]=En.setBookmark(ea)}if(In){var $n=In.find();$n&&!Ia($n,Rn)&&Wn(Rn)}else Wn(Rn);Wn(Ln),cn=rn,dn=rn-nn+1,dn<0&&(dn=0)}function On(En,Rn){rn+=Rn,rn>cn?rn=cn:rn<dn&&(rn=dn);var Ln=fn[(nn+rn)%nn];if(Ln&&!Ln.find()){var Xn=Rn>0?1:-1,In,Wn=En.getCursor();do if(rn+=Xn,Ln=fn[(nn+rn)%nn],Ln&&(In=Ln.find())&&!Ia(Wn,In))break;while(rn<cn&&rn>dn)}return Ln}function Cn(En,Rn){var Ln=rn,Xn=On(En,Rn);return rn=Ln,Xn&&Xn.find()}return{cachedCursor:void 0,add:gn,find:Cn,move:On}},ia=function(nn){return nn?{changes:nn.changes,expectCursorActivityForChange:nn.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};class ra{constructor(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=ia()}exitMacroRecordMode(){var rn=jn.macroModeState;rn.onRecordingDone&&rn.onRecordingDone(),rn.onRecordingDone=void 0,rn.isRecording=!1}enterMacroRecordMode(rn,cn){var dn=jn.registerController.getRegister(cn);if(dn){if(dn.clear(),this.latestRegister=cn,rn.openDialog){var fn=xs("span",{class:"cm-vim-message"},"recording @"+cn);this.onRecordingDone=rn.openDialog(fn,function(){},{bottom:!0})}this.isRecording=!0}}}function aa(nn){return nn.state.vim||(nn.state.vim={inputState:new _i,lastEditInputState:void 0,lastEditActionCommand:void 0,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},insertMode:!1,insertModeReturn:!1,insertModeRepeat:void 0,visualMode:!1,visualLine:!1,visualBlock:!1,lastSelection:null,lastPastedText:void 0,sel:{anchor:new e(0,0),head:new e(0,0)},options:{},expectLiteralNext:!1,status:""}),nn.state.vim}var jn;function ka(){jn={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:qn(),macroModeState:new ra,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new Ha({}),searchHistoryController:new ls,exCommandHistoryController:new ls};for(var nn in Nn){var rn=Nn[nn];rn.value=rn.defaultValue}}class Aa{constructor(rn,cn){this.keyName=rn,this.key=cn.key,this.ctrlKey=cn.ctrlKey,this.altKey=cn.altKey,this.metaKey=cn.metaKey,this.shiftKey=cn.shiftKey}}var Na,Kn={enterVimMode:z,leaveVimMode:se,buildKeyMap:function(){},getRegisterController:function(){return jn.registerController},resetVimGlobalState_:ka,getVimGlobalState_:function(){return jn},maybeInitVimState_:aa,suppressErrorLogging:!1,InsertModeKey:Aa,map:function(nn,rn,cn){fs.map(nn,rn,cn)},unmap:function(nn,rn){return fs.unmap(nn,rn)},noremap:function(nn,rn,cn){fs.map(nn,rn,cn,!0)},mapclear:function(nn){var rn=d.length,cn=b,dn=d.slice(0,rn-cn);if(d=d.slice(rn-cn),nn)for(var fn=dn.length-1;fn>=0;fn--){var gn=dn[fn];if(nn!==gn.context)if(gn.context)this._mapCommand(gn);else{var On=["normal","insert","visual"];for(var Cn in On)if(On[Cn]!==nn){var En=Object.assign({},gn);En.context=On[Cn],this._mapCommand(En)}}}},langmap:Jn,vimKeyFromEvent:ua,setOption:Zn,getOption:Vn,defineOption:Qn,defineEx:function(nn,rn,cn){if(!rn)rn=nn;else if(nn.indexOf(rn)!==0)throw new Error('(Vim.defineEx) "'+rn+'" is not a prefix of "'+nn+'", command not registered');Ts[nn]=cn,fs.commandMap_[rn]={name:nn,shortName:rn,type:"api"}},handleKey:function(nn,rn,cn){var dn=this.findKey(nn,rn,cn);if(typeof dn=="function")return dn()},multiSelectHandleKey:Vr,findKey:function(nn,rn,cn){var dn=aa(nn),fn=nn;function gn(){var Ln=jn.macroModeState;if(Ln.isRecording){if(rn=="q")return Ln.exitMacroRecordMode(),Un(fn),!0;cn!="mapping"&&ba(Ln,rn)}}function On(){if(rn=="<Esc>"){if(dn.visualMode)za(fn);else if(dn.insertMode)Da(fn);else return;return Un(fn),!0}}function Cn(){if(On())return!0;dn.inputState.keyBuffer.push(rn);var Ln=dn.inputState.keyBuffer.join(""),Xn=rn.length==1,In=ns.matchCommand(Ln,d,dn.inputState,"insert"),Wn=dn.inputState.changeQueue;if(In.type=="none")return Un(fn),!1;if(In.type=="partial"){if(In.expectLiteralNext&&(dn.expectLiteralNext=!0),Na&&window.clearTimeout(Na),Na=Xn&&window.setTimeout(function(){dn.insertMode&&dn.inputState.keyBuffer.length&&Un(fn)},Vn("insertModeEscKeysTimeout")),Xn){var $n=fn.listSelections();(!Wn||Wn.removed.length!=$n.length)&&(Wn=dn.inputState.changeQueue=new ha),Wn.inserted+=rn;for(var ea=0;ea<$n.length;ea++){var na=Ca($n[ea].anchor,$n[ea].head),ma=is($n[ea].anchor,$n[ea].head),oa=fn.getRange(na,fn.state.overwrite?Ka(ma,0,1):ma);Wn.removed[ea]=(Wn.removed[ea]||"")+oa}}return!Xn}else In.type=="full"&&(dn.inputState.keyBuffer.length=0);if(dn.expectLiteralNext=!1,Na&&window.clearTimeout(Na),In.command&&Wn){for(var $n=fn.listSelections(),ea=0;ea<$n.length;ea++){var Pa=$n[ea].head;fn.replaceRange(Wn.removed[ea]||"",Ka(Pa,0,-Wn.inserted.length),Pa,"+input")}jn.macroModeState.lastInsertModeChanges.changes.pop()}return In.command||Un(fn),In.command}function En(){if(gn()||On())return!0;dn.inputState.keyBuffer.push(rn);var Ln=dn.inputState.keyBuffer.join("");if(/^[1-9]\d*$/.test(Ln))return!0;var Xn=/^(\d*)(.*)$/.exec(Ln);if(!Xn)return Un(fn),!1;var In=dn.visualMode?"visual":"normal",Wn=Xn[2]||Xn[1];dn.inputState.operatorShortcut&&dn.inputState.operatorShortcut.slice(-1)==Wn&&(Wn=dn.inputState.operatorShortcut);var $n=ns.matchCommand(Wn,d,dn.inputState,In);return $n.type=="none"?(Un(fn),!1):$n.type=="partial"?($n.expectLiteralNext&&(dn.expectLiteralNext=!0),!0):$n.type=="clear"?(Un(fn),!0):(dn.expectLiteralNext=!1,dn.inputState.keyBuffer.length=0,Xn=/^(\d*)(.*)$/.exec(Ln),Xn&&Xn[1]&&Xn[1]!="0"&&dn.inputState.pushRepeatDigit(Xn[1]),$n.command)}var Rn=dn.insertMode?Cn():En();if(Rn===!1)return!dn.insertMode&&(rn.length===1||o.isMac&&/<A-.>/.test(rn))?function(){return!0}:void 0;if(Rn===!0)return function(){return!0};if(Rn)return function(){return fn.operation(function(){fn.curOp.isVimOp=!0;try{if(typeof Rn!="object")return;Rn.type=="keyToKey"?Va(fn,Rn.toKeys,Rn):ns.processCommand(fn,dn,Rn)}catch(Ln){throw fn.state.vim=void 0,aa(fn),Kn.suppressErrorLogging||console.log(Ln),Ln}return!0})}},handleEx:function(nn,rn){fs.processCommand(nn,rn)},defineMotion:rs,defineAction:es,defineOperator:Za,mapCommand:yr,_mapCommand:ws,defineRegister:Ga,exitVisualMode:za,exitInsertMode:Da},Ea=[],qa=!1,va;function Oa(nn){if(!va)throw new Error("No prompt to send key to");if(nn[0]=="<"){var rn=nn.toLowerCase().slice(1,-1),cn=rn.split("-");if(rn=cn.pop()||"",rn=="lt")nn="<";else if(rn=="space")nn=" ";else if(rn=="cr")nn=`
|
||
`;else if(ss[rn]){var dn=va.value||"",fn={key:ss[rn],target:{value:dn,selectionEnd:dn.length,selectionStart:dn.length}};va.onKeyDown&&va.onKeyDown(fn,va.value,On),va&&va.onKeyUp&&va.onKeyUp(fn,va.value,On);return}}if(nn==`
|
||
`){var gn=va;va=null,gn.onClose&&gn.onClose(gn.value)}else va.value=(va.value||"")+nn;function On(Cn){va&&(typeof Cn=="string"?va.value=Cn:va=null)}}function Va(nn,rn,cn){var dn=qa;if(cn){if(Ea.indexOf(cn)!=-1)return;Ea.push(cn),qa=cn.noremap!=!1}try{for(var fn=aa(nn),gn=/<(?:[CSMA]-)*\w+>|./gi,On;On=gn.exec(rn);){var Cn=On[0],En=fn.insertMode;if(va){Oa(Cn);continue}var Rn=Kn.handleKey(nn,Cn,"mapping");if(!Rn&&En&&fn.insertMode){if(Cn[0]=="<"){var Ln=Cn.toLowerCase().slice(1,-1),Xn=Ln.split("-");if(Ln=Xn.pop()||"",Ln=="lt")Cn="<";else if(Ln=="space")Cn=" ";else if(Ln=="cr")Cn=`
|
||
`;else if(ss.hasOwnProperty(Ln)){Cn=ss[Ln],wr(nn,Cn);continue}else Cn=Cn[0],gn.lastIndex=On.index+1}nn.replaceSelection(Cn)}}}finally{if(Ea.pop(),qa=Ea.length?dn:!1,!Ea.length&&va){var In=va;va=null,Zs(nn,In)}}}var $a={Return:"CR",Backspace:"BS",Delete:"Del",Escape:"Esc",Insert:"Ins",ArrowLeft:"Left",ArrowRight:"Right",ArrowUp:"Up",ArrowDown:"Down",Enter:"CR"," ":"Space"},Ua={Shift:1,Alt:1,Command:1,Control:1,CapsLock:1,AltGraph:1,Dead:1,Unidentified:1},ss={};"Left|Right|Up|Down|End|Home".split("|").concat(Object.keys($a)).forEach(function(nn){ss[($a[nn]||"").toLowerCase()]=ss[nn.toLowerCase()]=nn});function ua(nn,rn){var cn=nn.key;if(!Ua[cn]){cn.length>1&&cn[0]=="n"&&(cn=cn.replace("Numpad","")),cn=$a[cn]||cn;var dn="";if(nn.ctrlKey&&(dn+="C-"),nn.altKey&&(dn+="A-"),nn.metaKey&&(dn+="M-"),o.isMac&&dn=="A-"&&cn.length==1&&(dn=dn.slice(2)),(dn||cn.length>1)&&nn.shiftKey&&(dn+="S-"),rn&&!rn.expectLiteralNext&&cn.length==1){if(I.keymap&&cn in I.keymap)(I.remapCtrl!=!1||!dn)&&(cn=I.keymap[cn]);else if(cn.charCodeAt(0)>128&&!p[cn]){var fn=nn.code?.slice(-1)||"";nn.shiftKey||(fn=fn.toLowerCase()),fn&&(cn=fn,!dn&&nn.altKey&&(dn="A-"))}}return dn+=cn,dn.length>1&&(dn="<"+dn+">"),dn}}function Jn(nn,rn){I.string!==nn&&(I=ga(nn)),I.remapCtrl=rn}function ga(nn){let rn={};if(!nn)return{keymap:rn,string:""};function cn(dn){return dn.split(/\\?(.)/).filter(Boolean)}return nn.split(/((?:[^\\,]|\\.)+),/).map(dn=>{if(!dn)return;const fn=dn.split(/((?:[^\\;]|\\.)+);/);if(fn.length==3){const gn=cn(fn[1]),On=cn(fn[2]);if(gn.length!==On.length)return;for(let Cn=0;Cn<gn.length;++Cn)rn[gn[Cn]]=On[Cn]}else if(fn.length==1){const gn=cn(dn);if(gn.length%2!==0)return;for(let On=0;On<gn.length;On+=2)rn[gn[On]]=gn[On+1]}}),{keymap:rn,string:nn}}Qn("langmap",void 0,"string",["lmap"],function(nn,rn){if(nn===void 0)return I.string;Jn(nn)});class _i{constructor(){this.prefixRepeat=[],this.motionRepeat=[],this.operator=null,this.operatorArgs=null,this.motion=null,this.motionArgs=null,this.keyBuffer=[],this.registerName=void 0,this.changeQueue=null}pushRepeatDigit(rn){this.operator?this.motionRepeat=this.motionRepeat.concat(rn):this.prefixRepeat=this.prefixRepeat.concat(rn)}getRepeat(){var rn=0;return(this.prefixRepeat.length>0||this.motionRepeat.length>0)&&(rn=1,this.prefixRepeat.length>0&&(rn*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(rn*=parseInt(this.motionRepeat.join(""),10))),rn}}function Un(nn,rn){nn.state.vim.inputState=new _i,nn.state.vim.expectLiteralNext=!1,o.signal(nn,"vim-command-done",rn)}function ha(){this.removed=[],this.inserted=""}class sa{constructor(rn,cn,dn){this.clear(),this.keyBuffer=[rn||""],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!!cn,this.blockwise=!!dn}setText(rn,cn,dn){this.keyBuffer=[rn||""],this.linewise=!!cn,this.blockwise=!!dn}pushText(rn,cn){cn&&(this.linewise||this.keyBuffer.push(`
|
||
`),this.linewise=!0),this.keyBuffer.push(rn)}pushInsertModeChanges(rn){this.insertModeChanges.push(ia(rn))}pushSearchQuery(rn){this.searchQueries.push(rn)}clear(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1}toString(){return this.keyBuffer.join("")}}function Ga(nn,rn){var cn=jn.registerController.registers;if(!nn||nn.length!=1)throw Error("Register name must be 1 character");if(cn[nn])throw Error("Register already defined "+nn);cn[nn]=rn,un.push(nn)}class Ha{constructor(rn){this.registers=rn,this.unnamedRegister=rn['"']=new sa,rn["."]=new sa,rn[":"]=new sa,rn["/"]=new sa,rn["+"]=new sa}pushText(rn,cn,dn,fn,gn){if(rn!=="_"){fn&&dn.charAt(dn.length-1)!==`
|
||
`&&(dn+=`
|
||
`);var On=this.isValidRegister(rn)?this.getRegister(rn):null;if(!On||!rn){switch(cn){case"yank":this.registers[0]=new sa(dn,fn,gn);break;case"delete":case"change":dn.indexOf(`
|
||
`)==-1?this.registers["-"]=new sa(dn,fn):(this.shiftNumericRegisters_(),this.registers[1]=new sa(dn,fn));break}this.unnamedRegister.setText(dn,fn,gn);return}var Cn=Sn(rn);Cn?On.pushText(dn,fn):On.setText(dn,fn,gn),rn==="+"&&navigator.clipboard.writeText(dn),this.unnamedRegister.setText(On.toString(),fn)}}getRegister(rn){return this.isValidRegister(rn)?(rn=rn.toLowerCase(),this.registers[rn]||(this.registers[rn]=new sa),this.registers[rn]):this.unnamedRegister}isValidRegister(rn){return rn&&(Bn(rn,un)||pn.test(rn))}shiftNumericRegisters_(){for(var rn=9;rn>=2;rn--)this.registers[rn]=this.getRegister(""+(rn-1))}}class ls{constructor(){this.historyBuffer=[],this.iterator=0,this.initialPrefix=null}nextMatch(rn,cn){var dn=this.historyBuffer,fn=cn?-1:1;this.initialPrefix===null&&(this.initialPrefix=rn);for(var gn=this.iterator+fn;cn?gn>=0:gn<dn.length;gn+=fn)for(var On=dn[gn],Cn=0;Cn<=On.length;Cn++)if(this.initialPrefix==On.substring(0,Cn))return this.iterator=gn,On;if(gn>=dn.length)return this.iterator=dn.length,this.initialPrefix;if(gn<0)return rn}pushInput(rn){var cn=this.historyBuffer.indexOf(rn);cn>-1&&this.historyBuffer.splice(cn,1),rn.length&&this.historyBuffer.push(rn)}reset(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}}var ns={matchCommand:function(nn,rn,cn,dn){var fn=cs(nn,rn,dn,cn),gn=fn.full[0];if(!gn)return fn.partial.length?{type:"partial",expectLiteralNext:fn.partial.length==1&&fn.partial[0].keys.slice(-11)=="<character>"}:{type:"none"};if(gn.keys.slice(-11)=="<character>"||gn.keys.slice(-10)=="<register>"){var On=ya(nn);if(!On||On.length>1)return{type:"clear"};cn.selectedCharacter=On}return{type:"full",command:gn}},processCommand:function(nn,rn,cn){switch(rn.inputState.repeatOverride=cn.repeatOverride,cn.type){case"motion":this.processMotion(nn,rn,cn);break;case"operator":this.processOperator(nn,rn,cn);break;case"operatorMotion":this.processOperatorMotion(nn,rn,cn);break;case"action":this.processAction(nn,rn,cn);break;case"search":this.processSearch(nn,rn,cn);break;case"ex":case"keyToEx":this.processEx(nn,rn,cn);break}},processMotion:function(nn,rn,cn){rn.inputState.motion=cn.motion,rn.inputState.motionArgs=Os(cn.motionArgs),this.evalInput(nn,rn)},processOperator:function(nn,rn,cn){var dn=rn.inputState;if(dn.operator)if(dn.operator==cn.operator){dn.motion="expandToLine",dn.motionArgs={linewise:!0,repeat:1},this.evalInput(nn,rn);return}else Un(nn);dn.operator=cn.operator,dn.operatorArgs=Os(cn.operatorArgs),cn.keys.length>1&&(dn.operatorShortcut=cn.keys),cn.exitVisualBlock&&(rn.visualBlock=!1,ta(nn)),rn.visualMode&&this.evalInput(nn,rn)},processOperatorMotion:function(nn,rn,cn){var dn=rn.visualMode,fn=Os(cn.operatorMotionArgs);fn&&dn&&fn.visualLine&&(rn.visualLine=!0),this.processOperator(nn,rn,cn),dn||this.processMotion(nn,rn,cn)},processAction:function(nn,rn,cn){var dn=rn.inputState,fn=dn.getRepeat(),gn=!!fn,On=Os(cn.actionArgs)||{repeat:1};dn.selectedCharacter&&(On.selectedCharacter=dn.selectedCharacter),cn.operator&&this.processOperator(nn,rn,cn),cn.motion&&this.processMotion(nn,rn,cn),(cn.motion||cn.operator)&&this.evalInput(nn,rn),On.repeat=fn||1,On.repeatIsExplicit=gn,On.registerName=dn.registerName,Un(nn),rn.lastMotion=null,cn.isEdit&&this.recordLastEdit(rn,dn,cn),ca[cn.action](nn,On,rn)},processSearch:function(nn,rn,cn){if(!nn.getSearchCursor)return;var dn=cn.searchArgs.forward,fn=cn.searchArgs.wholeWordOnly;vs(nn).setReversed(!dn);var gn=dn?"/":"?",On=vs(nn).getQuery(),Cn=nn.getScrollInfo(),En="";function Rn(oa,Pa,Ra){jn.searchHistoryController.pushInput(oa),jn.searchHistoryController.reset();try{Rs(nn,oa,Pa,Ra)}catch{Qa(nn,"Invalid regex: "+oa),Un(nn);return}ns.processMotion(nn,rn,{keys:"",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:cn.searchArgs.toJumplist}})}function Ln(oa){nn.scrollTo(Cn.left,Cn.top),Rn(oa,!0,!0);var Pa=jn.macroModeState;Pa.isRecording&&br(Pa,oa)}function Xn(){return Vn("pcre")?"(JavaScript regexp: set pcre)":"(Vim regexp: set nopcre)"}function In(oa,Pa,Ra){var La=ua(oa),Ya,ja;La=="<Up>"||La=="<Down>"?(Ya=La=="<Up>",ja=oa.target?oa.target.selectionEnd:0,Pa=jn.searchHistoryController.nextMatch(Pa,Ya)||"",Ra(Pa),ja&&oa.target&&(oa.target.selectionEnd=oa.target.selectionStart=Math.min(ja,oa.target.value.length))):La&&La!="<Left>"&&La!="<Right>"&&jn.searchHistoryController.reset(),En=Pa,Wn()}function Wn(){var oa;try{oa=Rs(nn,En,!0,!0)}catch{}oa?nn.scrollIntoView(fr(nn,!dn,oa),30):(Fn(nn),nn.scrollTo(Cn.left,Cn.top))}function $n(oa,Pa,Ra){var La=ua(oa);La=="<Esc>"||La=="<C-c>"||La=="<C-[>"||La=="<BS>"&&Pa==""?(jn.searchHistoryController.pushInput(Pa),jn.searchHistoryController.reset(),Rs(nn,On?.source||""),Fn(nn),nn.scrollTo(Cn.left,Cn.top),o.e_stop(oa),Un(nn),Ra(),nn.focus()):La=="<Up>"||La=="<Down>"?o.e_stop(oa):La=="<C-u>"&&(o.e_stop(oa),Ra(""))}switch(cn.searchArgs.querySrc){case"prompt":var ea=jn.macroModeState;if(ea.isPlaying){let Pa=ea.replaySearchQueries.shift();Rn(Pa||"",!0,!1)}else Zs(nn,{onClose:Ln,prefix:gn,desc:xs("span",{$cursor:"pointer",onmousedown:function(Pa){Pa.preventDefault(),Zn("pcre",!Vn("pcre")),this.textContent=Xn(),Wn()}},Xn()),onKeyUp:In,onKeyDown:$n});break;case"wordUnderCursor":var na=Ds(nn,{noSymbol:!0}),ma=!0;if(na||(na=Ds(nn,{noSymbol:!1}),ma=!1),!na){Qa(nn,"No word under cursor"),Un(nn);return}let oa=nn.getLine(na.start.line).substring(na.start.ch,na.end.ch);ma&&fn?oa="\\b"+oa+"\\b":oa=Vs(oa),jn.jumpList.cachedCursor=nn.getCursor(),nn.setCursor(na.start),Rn(oa,!0,!1);break}},processEx:function(nn,rn,cn){function dn(Cn){jn.exCommandHistoryController.pushInput(Cn),jn.exCommandHistoryController.reset(),fs.processCommand(nn,Cn),nn.state.vim&&Un(nn),Fn(nn)}function fn(Cn,En,Rn){var Ln=ua(Cn),Xn,In;(Ln=="<Esc>"||Ln=="<C-c>"||Ln=="<C-[>"||Ln=="<BS>"&&En=="")&&(jn.exCommandHistoryController.pushInput(En),jn.exCommandHistoryController.reset(),o.e_stop(Cn),Un(nn),Fn(nn),Rn(),nn.focus()),Ln=="<Up>"||Ln=="<Down>"?(o.e_stop(Cn),Xn=Ln=="<Up>",In=Cn.target?Cn.target.selectionEnd:0,En=jn.exCommandHistoryController.nextMatch(En,Xn)||"",Rn(En),In&&Cn.target&&(Cn.target.selectionEnd=Cn.target.selectionStart=Math.min(In,Cn.target.value.length))):Ln=="<C-u>"?(o.e_stop(Cn),Rn("")):Ln&&Ln!="<Left>"&&Ln!="<Right>"&&jn.exCommandHistoryController.reset()}function gn(Cn,En){var Rn=new o.StringStream(En),Ln={};try{if(fs.parseInput_(nn,Rn,Ln),Ln.commandName!="s"){Fn(nn);return}var Xn=fs.matchCommand_(Ln.commandName);if(!Xn||(fs.parseCommandArgs_(Rn,Ln,Xn),!Ln.argString))return;var In=hr(Ln.argString.slice(1),!0,!0);In&&Qs(nn,In)}catch{}}if(cn.type=="keyToEx")fs.processCommand(nn,cn.exArgs.input);else{var On={onClose:dn,onKeyDown:fn,onKeyUp:gn,prefix:":"};rn.visualMode&&(On.value="'<,'>",On.selectValueOnOpen=!1),Zs(nn,On)}},evalInput:function(nn,rn){var cn=rn.inputState,dn=cn.motion,fn=cn.motionArgs||{repeat:1},gn=cn.operator,On=cn.operatorArgs||{},Cn=cn.registerName,En=rn.sel,Rn=wa(rn.visualMode?Ta(nn,En.head):nn.getCursor("head")),Ln=wa(rn.visualMode?Ta(nn,En.anchor):nn.getCursor("anchor")),Xn=wa(Rn),In=wa(Ln),Wn,$n,ea;if(gn&&this.recordLastEdit(rn,cn),cn.repeatOverride!==void 0?ea=cn.repeatOverride:ea=cn.getRepeat(),ea>0&&fn.explicitRepeat?fn.repeatIsExplicit=!0:(fn.noRepeat||!fn.explicitRepeat&&ea===0)&&(ea=1,fn.repeatIsExplicit=!1),cn.selectedCharacter&&(fn.selectedCharacter=On.selectedCharacter=cn.selectedCharacter),fn.repeat=ea,Un(nn),dn){var na=Ba[dn](nn,Rn,fn,rn,cn);if(rn.lastMotion=Ba[dn],!na)return;if(fn.toJumplist){var ma=jn.jumpList,oa=ma.cachedCursor;oa?(Ys(nn,oa,na),delete ma.cachedCursor):Ys(nn,Rn,na)}na instanceof Array?($n=na[0],Wn=na[1]):Wn=na,Wn||(Wn=wa(Rn)),rn.visualMode?(rn.visualBlock&&Wn.ch===1/0||(Wn=Ta(nn,Wn,Xn)),$n&&($n=Ta(nn,$n)),$n=$n||In,En.anchor=$n,En.head=Wn,ta(nn),Ps(nn,rn,"<",da($n,Wn)?$n:Wn),Ps(nn,rn,">",da($n,Wn)?Wn:$n)):gn||(Wn=Ta(nn,Wn,Xn),nn.setCursor(Wn.line,Wn.ch))}if(gn){if(On.lastSel){$n=In;var Pa=On.lastSel,Ra=Math.abs(Pa.head.line-Pa.anchor.line),La=Math.abs(Pa.head.ch-Pa.anchor.ch);Pa.visualLine?Wn=new e(In.line+Ra,In.ch):Pa.visualBlock?Wn=new e(In.line+Ra,In.ch+La):Pa.head.line==Pa.anchor.line?Wn=new e(In.line,In.ch+La):Wn=new e(In.line+Ra,In.ch),rn.visualMode=!0,rn.visualLine=Pa.visualLine,rn.visualBlock=Pa.visualBlock,En=rn.sel={anchor:$n,head:Wn},ta(nn)}else rn.visualMode&&(On.lastSel={anchor:wa(En.anchor),head:wa(En.head),visualBlock:rn.visualBlock,visualLine:rn.visualLine});var Ya,ja,Wa,Sa,Ja;if(rn.visualMode){Ya=Ca(En.head,En.anchor),ja=is(En.head,En.anchor),Wa=rn.visualLine||On.linewise,Sa=rn.visualBlock?"block":Wa?"line":"char";var ys=l(nn,Ya,ja);if(Ja=la(nn,{anchor:ys.start,head:ys.end},Sa),Wa){var us=Ja.ranges;if(Sa=="block")for(var ks=0;ks<us.length;ks++)us[ks].head.ch=os(nn,us[ks].head.line);else Sa=="line"&&(us[0].head=new e(us[0].head.line+1,0))}}else{if(Ya=wa($n||In),ja=wa(Wn||Xn),da(ja,Ya)){var Fs=Ya;Ya=ja,ja=Fs}Wa=fn.linewise||On.linewise,Wa?Es(nn,Ya,ja):fn.forward&&Cs(nn,Ya,ja),Sa="char";var Wr=!fn.inclusive||Wa,ys=l(nn,Ya,ja);Ja=la(nn,{anchor:ys.start,head:ys.end},Sa,Wr)}nn.setSelections(Ja.ranges,Ja.primary),rn.lastMotion=null,On.repeat=ea,On.registerName=Cn,On.linewise=Wa;var Hs=Fa[gn](nn,On,Ja.ranges,In,Wn);rn.visualMode&&za(nn,Hs!=null),Hs&&nn.setCursor(Hs)}},recordLastEdit:function(nn,rn,cn){var dn=jn.macroModeState;dn.isPlaying||(nn.lastEditInputState=rn,nn.lastEditActionCommand=cn,dn.lastInsertModeChanges.changes=[],dn.lastInsertModeChanges.expectCursorActivityForChange=!1,dn.lastInsertModeChanges.visualBlock=nn.visualBlock?nn.sel.head.line-nn.sel.anchor.line:0)}},Ba={moveToTopLine:function(nn,rn,cn){var dn=Gs(nn).top+cn.repeat-1;return new e(dn,gs(nn.getLine(dn)))},moveToMiddleLine:function(nn){var rn=Gs(nn),cn=Math.floor((rn.top+rn.bottom)*.5);return new e(cn,gs(nn.getLine(cn)))},moveToBottomLine:function(nn,rn,cn){var dn=Gs(nn).bottom-cn.repeat+1;return new e(dn,gs(nn.getLine(dn)))},expandToLine:function(nn,rn,cn){var dn=rn;return new e(dn.line+cn.repeat-1,1/0)},findNext:function(nn,rn,cn){var dn=vs(nn),fn=dn.getQuery();if(fn){var gn=!cn.forward;gn=dn.isReversed()?!gn:gn,Qs(nn,fn);var On=fr(nn,gn,fn,cn.repeat);return On||Qa(nn,"No match found "+fn+(Vn("pcre")?" (set nopcre to use Vim regexps)":"")),On}},findAndSelectNextInclusive:function(nn,rn,cn,dn,fn){var gn=vs(nn),On=gn.getQuery();if(On){var Cn=!cn.forward;Cn=gn.isReversed()?!Cn:Cn;var En=Zr(nn,Cn,On,cn.repeat,dn);if(En){if(fn.operator)return En;var Rn=En[0],Ln=new e(En[1].line,En[1].ch-1);if(dn.visualMode){(dn.visualLine||dn.visualBlock)&&(dn.visualLine=!1,dn.visualBlock=!1,o.signal(nn,"vim-mode-change",{mode:"visual",subMode:""}));var Xn=dn.sel.anchor;if(Xn)return gn.isReversed()?cn.forward?[Xn,Rn]:[Xn,Ln]:cn.forward?[Xn,Ln]:[Xn,Rn]}else dn.visualMode=!0,dn.visualLine=!1,dn.visualBlock=!1,o.signal(nn,"vim-mode-change",{mode:"visual",subMode:""});return Cn?[Ln,Rn]:[Rn,Ln]}}},goToMark:function(nn,rn,cn,dn){var fn=ms(nn,dn,cn.selectedCharacter||"");return fn?cn.linewise?{line:fn.line,ch:gs(nn.getLine(fn.line))}:fn:null},moveToOtherHighlightedEnd:function(nn,rn,cn,dn){var fn=dn.sel;return dn.visualBlock&&cn.sameLine?[Ta(nn,new e(fn.anchor.line,fn.head.ch)),Ta(nn,new e(fn.head.line,fn.anchor.ch))]:[fn.head,fn.anchor]},jumpToMark:function(nn,rn,cn,dn){for(var fn=rn,gn=0;gn<cn.repeat;gn++){var On=fn;for(var Cn in dn.marks)if(Pn(Cn)){var En=dn.marks[Cn].find(),Rn=cn.forward?da(En,On):da(On,En);if(!Rn&&!(cn.linewise&&En.line==On.line)){var Ln=Ia(On,fn),Xn=cn.forward?hs(On,En,fn):hs(fn,En,On);(Ln||Xn)&&(fn=En)}}}return cn.linewise&&(fn=new e(fn.line,gs(nn.getLine(fn.line)))),fn},moveByCharacters:function(nn,rn,cn){var dn=rn,fn=cn.repeat,gn=cn.forward?dn.ch+fn:dn.ch-fn;return new e(dn.line,gn)},moveByLines:function(nn,rn,cn,dn){var fn=rn,gn=fn.ch;switch(dn.lastMotion){case this.moveByLines:case this.moveByDisplayLines:case this.moveByScroll:case this.moveToColumn:case this.moveToEol:gn=dn.lastHPos;break;default:dn.lastHPos=gn}var On=cn.repeat+(cn.repeatOffset||0),Cn=cn.forward?fn.line+On:fn.line-On,En=nn.firstLine(),Rn=nn.lastLine(),Ln=nn.findPosV(fn,cn.forward?On:-On,"line",dn.lastHSPos),Xn=cn.forward?Ln.line>Cn:Ln.line<Cn;return Xn&&(Cn=Ln.line,gn=Ln.ch),Cn<En&&fn.line==En?this.moveToStartOfLine(nn,rn,cn,dn):Cn>Rn&&fn.line==Rn?er(nn,rn,cn,dn,!0):(cn.toFirstChar&&(gn=gs(nn.getLine(Cn)),dn.lastHPos=gn),dn.lastHSPos=nn.charCoords(new e(Cn,gn),"div").left,new e(Cn,gn))},moveByDisplayLines:function(nn,rn,cn,dn){var fn=rn;switch(dn.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:dn.lastHSPos=nn.charCoords(fn,"div").left}var gn=cn.repeat,On=nn.findPosV(fn,cn.forward?gn:-gn,"line",dn.lastHSPos);if(On.hitSide)if(cn.forward){var Cn=nn.charCoords(On,"div"),En={top:Cn.top+8,left:dn.lastHSPos};On=nn.coordsChar(En,"div")}else{var Rn=nn.charCoords(new e(nn.firstLine(),0),"div");Rn.left=dn.lastHSPos,On=nn.coordsChar(Rn,"div")}return dn.lastHPos=On.ch,On},moveByPage:function(nn,rn,cn){var dn=rn,fn=cn.repeat;return nn.findPosV(dn,cn.forward?fn:-fn,"page")},moveByParagraph:function(nn,rn,cn){var dn=cn.forward?1:-1;return nr(nn,rn,cn.repeat,dn).start},moveBySentence:function(nn,rn,cn){var dn=cn.forward?1:-1;return Er(nn,rn,cn.repeat,dn)},moveByScroll:function(nn,rn,cn,dn){var fn=nn.getScrollInfo(),gn=null,On=cn.repeat;On||(On=fn.clientHeight/(2*nn.defaultTextHeight()));var Cn=nn.charCoords(rn,"local");if(cn.repeat=On,gn=Ba.moveByDisplayLines(nn,rn,cn,dn),!gn)return null;var En=nn.charCoords(gn,"local");return nn.scrollTo(null,fn.top+En.top-Cn.top),gn},moveByWords:function(nn,rn,cn){return Pr(nn,rn,cn.repeat,!!cn.forward,!!cn.wordEnd,!!cn.bigWord)},moveTillCharacter:function(nn,rn,cn){var dn=cn.repeat,fn=Ws(nn,dn,cn.forward,cn.selectedCharacter,rn),gn=cn.forward?-1:1;return qs(gn,cn),fn?(fn.ch+=gn,fn):null},moveToCharacter:function(nn,rn,cn){var dn=cn.repeat;return qs(0,cn),Ws(nn,dn,cn.forward,cn.selectedCharacter,rn)||rn},moveToSymbol:function(nn,rn,cn){var dn=cn.repeat;return cn.selectedCharacter&&Cr(nn,dn,cn.forward,cn.selectedCharacter)||rn},moveToColumn:function(nn,rn,cn,dn){var fn=cn.repeat;return dn.lastHPos=fn-1,dn.lastHSPos=nn.charCoords(rn,"div").left,Mr(nn,fn)},moveToEol:function(nn,rn,cn,dn){return er(nn,rn,cn,dn,!1)},moveToFirstNonWhiteSpaceCharacter:function(nn,rn){var cn=rn;return new e(cn.line,gs(nn.getLine(cn.line)))},moveToMatchedSymbol:function(nn,rn){for(var cn=rn,dn=cn.line,fn=cn.ch,gn=nn.getLine(dn),On;fn<gn.length;fn++)if(On=gn.charAt(fn),On&&vn(On)){var Cn=nn.getTokenTypeAt(new e(dn,fn+1));if(Cn!=="string"&&Cn!=="comment")break}if(fn<gn.length){var En=On==="<"||On===">"?/[(){}[\]<>]/:/[(){}[\]]/,Rn=nn.findMatchingBracket(new e(dn,fn),{bracketRegex:En});return Rn.to}else return cn},moveToStartOfLine:function(nn,rn){return new e(rn.line,0)},moveToLineOrEdgeOfDocument:function(nn,rn,cn){var dn=cn.forward?nn.lastLine():nn.firstLine();return cn.repeatIsExplicit&&(dn=cn.repeat-nn.getOption("firstLineNumber")),new e(dn,gs(nn.getLine(dn)))},moveToStartOfDisplayLine:function(nn){return nn.execCommand("goLineLeft"),nn.getCursor()},moveToEndOfDisplayLine:function(nn){nn.execCommand("goLineRight");var rn=nn.getCursor();return rn.sticky=="before"&&rn.ch--,rn},textObjectManipulation:function(nn,rn,cn,dn){var fn={"(":")",")":"(","{":"}","}":"{","[":"]","]":"[","<":">",">":"<"},gn={"'":!0,'"':!0,"`":!0},On=cn.selectedCharacter||"";On=="b"?On="(":On=="B"&&(On="{");var Cn=!cn.textObjectInner,En,Rn;if(fn[On]){if(Rn=!0,En=rr(nn,rn,On,Cn),!En){var Ln=nn.getSearchCursor(new RegExp("\\"+On,"g"),rn);Ln.find()&&(En=rr(nn,Ln.from(),On,Cn))}}else if(gn[On])Rn=!0,En=Gr(nn,rn,On,Cn);else if(On==="W"||On==="w")for(var Xn=cn.repeat||1;Xn-- >0;){var In=Ds(nn,{inclusive:Cn,innerWord:!Cn,bigWord:On==="W",noSymbol:On==="W",multiline:!0},En&&En.end);In&&(En||(En=In),En.end=In.end)}else if(On==="p")if(En=nr(nn,rn,cn.repeat,0,Cn),cn.linewise=!0,dn.visualMode)dn.visualLine||(dn.visualLine=!0);else{var Wn=dn.inputState.operatorArgs;Wn&&(Wn.linewise=!0),En.end.line--}else if(On==="t")En=_s(nn,rn,Cn);else if(On==="s"){var $n=nn.getLine(rn.line);rn.ch>0&&Dn($n[rn.ch])&&(rn.ch-=1);var ea=sr(nn,rn,cn.repeat,1,Cn),na=sr(nn,rn,cn.repeat,-1,Cn);An(nn.getLine(na.line)[na.ch])&&An(nn.getLine(ea.line)[ea.ch-1])&&(na={line:na.line,ch:na.ch+1}),En={start:na,end:ea}}return En?nn.state.vim.visualMode?Yn(nn,En.start,En.end,Rn):[En.start,En.end]:null},repeatLastCharacterSearch:function(nn,rn,cn){var dn=jn.lastCharacterSearch,fn=cn.repeat,gn=cn.forward===dn.forward,On=(dn.increment?1:0)*(gn?-1:1);nn.moveH(-On,"char"),cn.inclusive=!!gn;var Cn=Ws(nn,fn,gn,dn.selectedCharacter);return Cn?(Cn.ch+=On,Cn):(nn.moveH(On,"char"),rn)}};function rs(nn,rn){Ba[nn]=rn}function bs(nn,rn){for(var cn=[],dn=0;dn<rn;dn++)cn.push(nn);return cn}var Fa={change:function(nn,rn,cn){var dn,fn,gn=nn.state.vim,On=cn[0].anchor,Cn=cn[0].head;if(gn.visualMode)if(rn.fullLine)Cn.ch=Number.MAX_VALUE,Cn.line--,nn.setSelection(On,Cn),fn=nn.getSelection(),nn.replaceSelection(""),dn=On;else{fn=nn.getSelection();var Ln=bs("",cn.length);nn.replaceSelections(Ln),dn=Ca(cn[0].head,cn[0].anchor)}else{fn=nn.getRange(On,Cn);var En=gn.lastEditInputState;if(En?.motion=="moveByWords"&&!An(fn)){var Rn=/\s+$/.exec(fn);Rn&&En.motionArgs&&En.motionArgs.forward&&(Cn=Ka(Cn,0,-Rn[0].length),fn=fn.slice(0,-Rn[0].length))}rn.linewise&&(On=new e(On.line,gs(nn.getLine(On.line))),Cn.line>On.line&&(Cn=new e(Cn.line-1,Number.MAX_VALUE))),nn.replaceRange("",On,Cn),dn=On}jn.registerController.pushText(rn.registerName,"change",fn,rn.linewise,cn.length>1),ca.enterInsertMode(nn,{head:dn},nn.state.vim)},delete:function(nn,rn,cn){var dn,fn,gn=nn.state.vim;if(gn.visualBlock){fn=nn.getSelection();var En=bs("",cn.length);nn.replaceSelections(En),dn=Ca(cn[0].head,cn[0].anchor)}else{var On=cn[0].anchor,Cn=cn[0].head;rn.linewise&&Cn.line!=nn.firstLine()&&On.line==nn.lastLine()&&On.line==Cn.line-1&&(On.line==nn.firstLine()?On.ch=0:On=new e(On.line-1,os(nn,On.line-1))),fn=nn.getRange(On,Cn),nn.replaceRange("",On,Cn),dn=On,rn.linewise&&(dn=Ba.moveToFirstNonWhiteSpaceCharacter(nn,On))}return jn.registerController.pushText(rn.registerName,"delete",fn,rn.linewise,gn.visualBlock),Ta(nn,dn)},indent:function(nn,rn,cn){var dn=nn.state.vim,fn=dn.visualMode&&rn.repeat||1;if(dn.visualBlock){for(var gn=nn.getOption("tabSize"),On=nn.getOption("indentWithTabs")?" ":" ".repeat(gn),Cn,En=cn.length-1;En>=0;En--)if(Cn=Ca(cn[En].anchor,cn[En].head),rn.indentRight)nn.replaceRange(On.repeat(fn),Cn,Cn);else{for(var Rn=nn.getLine(Cn.line),Ln=0,Xn=0;Xn<fn;Xn++){var In=Rn[Cn.ch+Ln];if(In==" ")Ln++;else if(In==" "){Ln++;for(var Wn=1;Wn<On.length&&(In=Rn[Cn.ch+Ln],In===" ");Wn++)Ln++}else break}nn.replaceRange("",Cn,Ka(Cn,0,Ln))}return Cn}else if(nn.indentMore)for(var Xn=0;Xn<fn;Xn++)rn.indentRight?nn.indentMore():nn.indentLess();else{var $n=cn[0].anchor.line,ea=dn.visualBlock?cn[cn.length-1].anchor.line:cn[0].head.line;rn.linewise&&ea--;for(var En=$n;En<=ea;En++)for(var Xn=0;Xn<fn;Xn++)nn.indentLine(En,rn.indentRight)}return Ba.moveToFirstNonWhiteSpaceCharacter(nn,cn[0].anchor)},indentAuto:function(nn,rn,cn){return nn.execCommand("indentAuto"),Ba.moveToFirstNonWhiteSpaceCharacter(nn,cn[0].anchor)},hardWrap:function(nn,rn,cn,dn){if(nn.hardWrap){var fn=cn[0].anchor.line,gn=cn[0].head.line;rn.linewise&&gn--;var On=nn.hardWrap({from:fn,to:gn});return On>fn&&rn.linewise&&On--,rn.keepCursor?dn:new e(On,0)}},changeCase:function(nn,rn,cn,dn,fn){for(var gn=nn.getSelections(),On=[],Cn=rn.toLower,En=0;En<gn.length;En++){var Rn=gn[En],Ln="";if(Cn===!0)Ln=Rn.toLowerCase();else if(Cn===!1)Ln=Rn.toUpperCase();else for(var Xn=0;Xn<Rn.length;Xn++){var In=Rn.charAt(Xn);Ln+=Sn(In)?In.toLowerCase():In.toUpperCase()}On.push(Ln)}return nn.replaceSelections(On),rn.shouldMoveCursor?fn:!nn.state.vim.visualMode&&rn.linewise&&cn[0].anchor.line+1==cn[0].head.line?Ba.moveToFirstNonWhiteSpaceCharacter(nn,dn):rn.linewise?dn:Ca(cn[0].anchor,cn[0].head)},yank:function(nn,rn,cn,dn){var fn=nn.state.vim,gn=nn.getSelection(),On=fn.visualMode?Ca(fn.sel.anchor,fn.sel.head,cn[0].head,cn[0].anchor):dn;return jn.registerController.pushText(rn.registerName,"yank",gn,rn.linewise,fn.visualBlock),On},rot13:function(nn,rn,cn,dn,fn){for(var gn=nn.getSelections(),On=[],Cn=0;Cn<gn.length;Cn++){const En=gn[Cn].split("").map(Rn=>{const Ln=Rn.charCodeAt(0);return Ln>=65&&Ln<=90?String.fromCharCode(65+(Ln-65+13)%26):Ln>=97&&Ln<=122?String.fromCharCode(97+(Ln-97+13)%26):Rn}).join("");On.push(En)}return nn.replaceSelections(On),rn.shouldMoveCursor?fn:!nn.state.vim.visualMode&&rn.linewise&&cn[0].anchor.line+1==cn[0].head.line?Ba.moveToFirstNonWhiteSpaceCharacter(nn,dn):rn.linewise?dn:Ca(cn[0].anchor,cn[0].head)}};function Za(nn,rn){Fa[nn]=rn}var ca={jumpListWalk:function(nn,rn,cn){if(!cn.visualMode){var dn=rn.repeat||1,fn=rn.forward,gn=jn.jumpList,On=gn.move(nn,fn?dn:-dn),Cn=On?On.find():void 0;Cn=Cn||nn.getCursor(),nn.setCursor(Cn)}},scroll:function(nn,rn,cn){if(!cn.visualMode){var dn=rn.repeat||1,fn=nn.defaultTextHeight(),gn=nn.getScrollInfo().top,On=fn*dn,Cn=rn.forward?gn+On:gn-On,En=wa(nn.getCursor()),Rn=nn.charCoords(En,"local");if(rn.forward)Cn>Rn.top?(En.line+=(Cn-Rn.top)/fn,En.line=Math.ceil(En.line),nn.setCursor(En),Rn=nn.charCoords(En,"local"),nn.scrollTo(null,Rn.top)):nn.scrollTo(null,Cn);else{var Ln=Cn+nn.getScrollInfo().clientHeight;Ln<Rn.bottom?(En.line-=(Rn.bottom-Ln)/fn,En.line=Math.floor(En.line),nn.setCursor(En),Rn=nn.charCoords(En,"local"),nn.scrollTo(null,Rn.bottom-nn.getScrollInfo().clientHeight)):nn.scrollTo(null,Cn)}}},scrollToCursor:function(nn,rn){var cn=nn.getCursor().line,dn=nn.charCoords(new e(cn,0),"local"),fn=nn.getScrollInfo().clientHeight,gn=dn.top;switch(rn.position){case"center":gn=dn.bottom-fn/2;break;case"bottom":var On=new e(cn,nn.getLine(cn).length-1),Cn=nn.charCoords(On,"local"),En=Cn.bottom-gn;gn=gn-fn+En;break}nn.scrollTo(null,gn)},replayMacro:function(nn,rn,cn){var dn=rn.selectedCharacter||"",fn=rn.repeat||1,gn=jn.macroModeState;for(dn=="@"?dn=gn.latestRegister||"":gn.latestRegister=dn;fn--;)js(nn,cn,gn,dn)},enterMacroRecordMode:function(nn,rn){var cn=jn.macroModeState,dn=rn.selectedCharacter;jn.registerController.isValidRegister(dn)&&cn.enterMacroRecordMode(nn,dn)},toggleOverwrite:function(nn){nn.state.overwrite?(nn.toggleOverwrite(!1),nn.setOption("keyMap","vim-insert"),o.signal(nn,"vim-mode-change",{mode:"insert"})):(nn.toggleOverwrite(!0),nn.setOption("keyMap","vim-replace"),o.signal(nn,"vim-mode-change",{mode:"replace"}))},enterInsertMode:function(nn,rn,cn){if(!nn.getOption("readOnly")){cn.insertMode=!0,cn.insertModeRepeat=rn&&rn.repeat||1;var dn=rn?rn.insertAt:null,fn=cn.sel,gn=rn.head||nn.getCursor("head"),On=nn.listSelections().length;if(dn=="eol")gn=new e(gn.line,os(nn,gn.line));else if(dn=="bol")gn=new e(gn.line,0);else if(dn=="charAfter"){var Cn=l(nn,gn,Ka(gn,0,1));gn=Cn.end}else if(dn=="firstNonBlank"){var Cn=l(nn,gn,Ba.moveToFirstNonWhiteSpaceCharacter(nn,gn));gn=Cn.end}else if(dn=="startOfSelectedArea"){if(!cn.visualMode)return;cn.visualBlock?(gn=new e(Math.min(fn.head.line,fn.anchor.line),Math.min(fn.head.ch,fn.anchor.ch)),On=Math.abs(fn.head.line-fn.anchor.line)+1):fn.head.line<fn.anchor.line?gn=fn.head:gn=new e(fn.anchor.line,0)}else if(dn=="endOfSelectedArea"){if(!cn.visualMode)return;cn.visualBlock?(gn=new e(Math.min(fn.head.line,fn.anchor.line),Math.max(fn.head.ch,fn.anchor.ch)+1),On=Math.abs(fn.head.line-fn.anchor.line)+1):fn.head.line>=fn.anchor.line?gn=Ka(fn.head,0,1):gn=new e(fn.anchor.line,0)}else if(dn=="inplace"){if(cn.visualMode)return}else dn=="lastEdit"&&(gn=$s(nn)||gn);nn.setOption("disableInput",!1),rn&&rn.replace?(nn.toggleOverwrite(!0),nn.setOption("keyMap","vim-replace"),o.signal(nn,"vim-mode-change",{mode:"replace"})):(nn.toggleOverwrite(!1),nn.setOption("keyMap","vim-insert"),o.signal(nn,"vim-mode-change",{mode:"insert"})),jn.macroModeState.isPlaying||(nn.on("change",Ss),cn.insertEnd&&cn.insertEnd.clear(),cn.insertEnd=nn.setBookmark(gn,{insertLeft:!0}),o.on(nn.getInputField(),"keydown",vr)),cn.visualMode&&za(nn),kn(nn,gn,On)}},toggleVisualMode:function(nn,rn,cn){var dn=rn.repeat,fn=nn.getCursor(),gn;if(cn.visualMode)cn.visualLine!=!!rn.linewise||cn.visualBlock!=!!rn.blockwise?(cn.visualLine=!!rn.linewise,cn.visualBlock=!!rn.blockwise,o.signal(nn,"vim-mode-change",{mode:"visual",subMode:cn.visualLine?"linewise":cn.visualBlock?"blockwise":""}),ta(nn)):za(nn);else{cn.visualMode=!0,cn.visualLine=!!rn.linewise,cn.visualBlock=!!rn.blockwise,gn=Ta(nn,new e(fn.line,fn.ch+dn-1));var On=l(nn,fn,gn);cn.sel={anchor:On.start,head:On.end},o.signal(nn,"vim-mode-change",{mode:"visual",subMode:cn.visualLine?"linewise":cn.visualBlock?"blockwise":""}),ta(nn),Ps(nn,cn,"<",Ca(fn,gn)),Ps(nn,cn,">",is(fn,gn))}},reselectLastSelection:function(nn,rn,cn){var dn=cn.lastSelection;if(cn.visualMode&&zn(nn,cn),dn){var fn=dn.anchorMark.find(),gn=dn.headMark.find();if(!fn||!gn)return;cn.sel={anchor:fn,head:gn},cn.visualMode=!0,cn.visualLine=dn.visualLine,cn.visualBlock=dn.visualBlock,ta(nn),Ps(nn,cn,"<",Ca(fn,gn)),Ps(nn,cn,">",is(fn,gn)),o.signal(nn,"vim-mode-change",{mode:"visual",subMode:cn.visualLine?"linewise":cn.visualBlock?"blockwise":""})}},joinLines:function(nn,rn,cn){var dn,fn;if(cn.visualMode){if(dn=nn.getCursor("anchor"),fn=nn.getCursor("head"),da(fn,dn)){var gn=fn;fn=dn,dn=gn}fn.ch=os(nn,fn.line)-1}else{var On=Math.max(rn.repeat,2);dn=nn.getCursor(),fn=Ta(nn,new e(dn.line+On-1,1/0))}for(var Cn=0,En=dn.line;En<fn.line;En++){Cn=os(nn,dn.line);var Rn="",Ln=0;if(!rn.keepSpaces){var Xn=nn.getLine(dn.line+1);Ln=Xn.search(/\S/),Ln==-1?Ln=Xn.length:Rn=" "}nn.replaceRange(Rn,new e(dn.line,Cn),new e(dn.line+1,Ln))}var In=Ta(nn,new e(dn.line,Cn));cn.visualMode&&za(nn,!1),nn.setCursor(In)},newLineAndEnterInsertMode:function(nn,rn,cn){cn.insertMode=!0;var dn=wa(nn.getCursor());if(dn.line===nn.firstLine()&&!rn.after)nn.replaceRange(`
|
||
`,new e(nn.firstLine(),0)),nn.setCursor(nn.firstLine(),0);else{dn.line=rn.after?dn.line:dn.line-1,dn.ch=os(nn,dn.line),nn.setCursor(dn);var fn=o.commands.newlineAndIndentContinueComment||o.commands.newlineAndIndent;fn(nn)}this.enterInsertMode(nn,{repeat:rn.repeat},cn)},paste:function(nn,rn,cn){var dn=jn.registerController.getRegister(rn.registerName);if(rn.registerName==="+")navigator.clipboard.readText().then(gn=>{this.continuePaste(nn,rn,cn,gn,dn)});else{var fn=dn.toString();this.continuePaste(nn,rn,cn,fn,dn)}},continuePaste:function(nn,rn,cn,dn,fn){var gn=wa(nn.getCursor());if(dn){if(rn.matchIndent){var On=nn.getOption("tabSize"),Cn=function(us){var ks=us.split(" ").length-1,Fs=us.split(" ").length-1;return ks*On+Fs*1},En=nn.getLine(nn.getCursor().line),Rn=Cn(En.match(/^\s*/)[0]),Ln=dn.replace(/\n$/,""),Xn=dn!==Ln,In=Cn(dn.match(/^\s*/)[0]),dn=Ln.replace(/^\s*/gm,function(us){var ks=Rn+(Cn(us)-In);if(ks<0)return"";if(nn.getOption("indentWithTabs")){var Fs=Math.floor(ks/On);return Array(Fs+1).join(" ")}else return Array(ks+1).join(" ")});dn+=Xn?`
|
||
`:""}rn.repeat>1&&(dn=Array(rn.repeat+1).join(dn));var Wn=fn.linewise,$n=fn.blockwise,ea=$n?dn.split(`
|
||
`):void 0;if(ea){Wn&&ea.pop();for(var na=0;na<ea.length;na++)ea[na]=ea[na]==""?" ":ea[na];gn.ch+=rn.after?1:0,gn.ch=Math.min(os(nn,gn.line),gn.ch)}else Wn?cn.visualMode?dn=cn.visualLine?dn.slice(0,-1):`
|
||
`+dn.slice(0,dn.length-1)+`
|
||
`:rn.after?(dn=`
|
||
`+dn.slice(0,dn.length-1),gn.ch=os(nn,gn.line)):gn.ch=0:gn.ch+=rn.after?1:0;var ma;if(cn.visualMode){cn.lastPastedText=dn;var oa,Pa=Gn(nn),Ra=Pa[0],La=Pa[1],Ya=nn.getSelection(),ja=nn.listSelections(),Wa=new Array(ja.length).join("1").split("1");cn.lastSelection&&(oa=cn.lastSelection.headMark.find()),jn.registerController.unnamedRegister.setText(Ya),$n?(nn.replaceSelections(Wa),La=new e(Ra.line+dn.length-1,Ra.ch),nn.setCursor(Ra),xn(nn,La),nn.replaceSelections(dn),ma=Ra):cn.visualBlock?(nn.replaceSelections(Wa),nn.setCursor(Ra),nn.replaceRange(dn,Ra,Ra),ma=Ra):(nn.replaceRange(dn,Ra,La),ma=nn.posFromIndex(nn.indexFromPos(Ra)+dn.length-1)),oa&&(cn.lastSelection.headMark=nn.setBookmark(oa)),Wn&&(ma.ch=0)}else if($n&&ea){nn.setCursor(gn);for(var na=0;na<ea.length;na++){var Sa=gn.line+na;Sa>nn.lastLine()&&nn.replaceRange(`
|
||
`,new e(Sa,0));var Ja=os(nn,Sa);Ja<gn.ch&&hn(nn,Sa,gn.ch)}nn.setCursor(gn),xn(nn,new e(gn.line+ea.length-1,gn.ch)),nn.replaceSelections(ea),ma=gn}else if(nn.replaceRange(dn,gn),Wn){var Sa=rn.after?gn.line+1:gn.line;ma=new e(Sa,gs(nn.getLine(Sa)))}else ma=wa(gn),/\n/.test(dn)||(ma.ch+=dn.length-(rn.after?1:0));cn.visualMode&&za(nn,!1),nn.setCursor(ma)}},undo:function(nn,rn){nn.operation(function(){xa(nn,o.commands.undo,rn.repeat)(),nn.setCursor(Ta(nn,nn.getCursor("start")))})},redo:function(nn,rn){xa(nn,o.commands.redo,rn.repeat)()},setRegister:function(nn,rn,cn){cn.inputState.registerName=rn.selectedCharacter},insertRegister:function(nn,rn,cn){var dn=rn.selectedCharacter,fn=jn.registerController.getRegister(dn),gn=fn&&fn.toString();gn&&nn.replaceSelection(gn)},oneNormalCommand:function(nn,rn,cn){Da(nn,!0),cn.insertModeReturn=!0,o.on(nn,"vim-command-done",function dn(){cn.visualMode||(cn.insertModeReturn&&(cn.insertModeReturn=!1,cn.insertMode||ca.enterInsertMode(nn,{},cn)),o.off(nn,"vim-command-done",dn))})},setMark:function(nn,rn,cn){var dn=rn.selectedCharacter;dn&&Ps(nn,cn,dn,nn.getCursor())},replace:function(nn,rn,cn){var dn=rn.selectedCharacter||"",fn=nn.getCursor(),gn,On,Cn=nn.listSelections();if(cn.visualMode)fn=nn.getCursor("start"),On=nn.getCursor("end");else{var En=nn.getLine(fn.line);gn=fn.ch+rn.repeat,gn>En.length&&(gn=En.length),On=new e(fn.line,gn)}var Rn=l(nn,fn,On);if(fn=Rn.start,On=Rn.end,dn==`
|
||
`)cn.visualMode||nn.replaceRange("",fn,On),(o.commands.newlineAndIndentContinueComment||o.commands.newlineAndIndent)(nn);else{var Ln=nn.getRange(fn,On);if(Ln=Ln.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,dn),Ln=Ln.replace(/[^\n]/g,dn),cn.visualBlock){var Xn=new Array(nn.getOption("tabSize")+1).join(" ");Ln=nn.getSelection(),Ln=Ln.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,dn);var In=Ln.replace(/\t/g,Xn).replace(/[^\n]/g,dn).split(`
|
||
`);nn.replaceSelections(In)}else nn.replaceRange(Ln,fn,On);cn.visualMode?(fn=da(Cn[0].anchor,Cn[0].head)?Cn[0].anchor:Cn[0].head,nn.setCursor(fn),za(nn,!1)):nn.setCursor(Ka(On,0,-1))}},incrementNumberToken:function(nn,rn){for(var cn=nn.getCursor(),dn=nn.getLine(cn.line),fn=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi,gn,On,Cn,En;(gn=fn.exec(dn))!==null&&(On=gn.index,Cn=On+gn[0].length,!(cn.ch<Cn)););if(!(!rn.backtrack&&Cn<=cn.ch)){if(gn){var Rn=gn[2]||gn[4],Ln=gn[3]||gn[5],Xn=rn.increase?1:-1,In={"0b":2,0:8,"":10,"0x":16}[Rn.toLowerCase()],Wn=parseInt(gn[1]+Ln,In)+Xn*rn.repeat;En=Wn.toString(In);var $n=Rn?new Array(Ln.length-En.length+1+gn[1].length).join("0"):"";En.charAt(0)==="-"?En="-"+Rn+$n+En.substr(1):En=Rn+$n+En;var ea=new e(cn.line,On),na=new e(cn.line,Cn);nn.replaceRange(En,ea,na)}else return;nn.setCursor(new e(cn.line,On+En.length-1))}},repeatLastEdit:function(nn,rn,cn){var dn=cn.lastEditInputState;if(dn){var fn=rn.repeat;fn&&rn.repeatIsExplicit?dn.repeatOverride=fn:fn=dn.repeatOverride||fn,xr(nn,cn,fn,!1)}},indent:function(nn,rn){nn.indentLine(nn.getCursor().line,rn.indentRight)},exitInsertMode:function(nn,rn){Da(nn)}};function es(nn,rn){ca[nn]=rn}function Ta(nn,rn,cn){var dn=nn.state.vim,fn=dn.insertMode||dn.visualMode,gn=Math.min(Math.max(nn.firstLine(),rn.line),nn.lastLine()),On=nn.getLine(gn),Cn=On.length-1+ +!!fn,En=Math.min(Math.max(0,rn.ch),Cn),Rn=On.charCodeAt(En);if(56320<=Rn&&Rn<=57343){var Ln=1;cn&&cn.line==gn&&cn.ch>En&&(Ln=-1),En+=Ln,En>Cn&&(En-=2)}return new e(gn,En)}function Os(nn){var rn={};for(var cn in nn)Object.prototype.hasOwnProperty.call(nn,cn)&&(rn[cn]=nn[cn]);return rn}function Ka(nn,rn,cn){return typeof rn=="object"&&(cn=rn.ch,rn=rn.line),new e(nn.line+rn,nn.ch+cn)}function cs(nn,rn,cn,dn){dn.operator&&(cn="operatorPending");for(var fn,gn=[],On=[],Cn=qa?rn.length-b:0,En=Cn;En<rn.length;En++){var Rn=rn[En];cn=="insert"&&Rn.context!="insert"||Rn.context&&Rn.context!=cn||dn.operator&&Rn.type=="action"||!(fn=As(nn,Rn.keys))||(fn=="partial"&&gn.push(Rn),fn=="full"&&On.push(Rn))}return{partial:gn,full:On}}function As(nn,rn){const cn=rn.slice(-11)=="<character>",dn=rn.slice(-10)=="<register>";if(cn||dn){var fn=rn.length-(cn?11:10),gn=nn.slice(0,fn),On=rn.slice(0,fn);return gn==On&&nn.length>fn?"full":On.indexOf(gn)==0?"partial":!1}else return nn==rn?"full":rn.indexOf(nn)==0?"partial":!1}function ya(nn){var rn=/^.*(<[^>]+>)$/.exec(nn),cn=rn?rn[1]:nn.slice(-1);if(cn.length>1)switch(cn){case"<CR>":case"<S-CR>":cn=`
|
||
`;break;case"<Space>":case"<S-Space>":cn=" ";break;default:cn="";break}return cn}function xa(nn,rn,cn){return function(){for(var dn=0;dn<cn;dn++)rn(nn)}}function wa(nn){return new e(nn.line,nn.ch)}function Ia(nn,rn){return nn.ch==rn.ch&&nn.line==rn.line}function da(nn,rn){return nn.line<rn.line||nn.line==rn.line&&nn.ch<rn.ch}function Ca(nn,rn){return arguments.length>2&&(rn=Ca.apply(void 0,Array.prototype.slice.call(arguments,1))),da(nn,rn)?nn:rn}function is(nn,rn){return arguments.length>2&&(rn=is.apply(void 0,Array.prototype.slice.call(arguments,1))),da(nn,rn)?rn:nn}function hs(nn,rn,cn){var dn=da(nn,rn),fn=da(rn,cn);return dn&&fn}function os(nn,rn){return nn.getLine(rn).length}function Ls(nn){return nn.trim?nn.trim():nn.replace(/^\s+|\s+$/g,"")}function Vs(nn){return nn.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function hn(nn,rn,cn){var dn=os(nn,rn),fn=new Array(cn-dn+1).join(" ");nn.setCursor(new e(rn,dn)),nn.replaceRange(fn,nn.getCursor())}function xn(nn,rn){var cn=[],dn=nn.listSelections(),fn=wa(nn.clipPos(rn)),gn=!Ia(rn,fn),On=nn.getCursor("head"),Cn=wn(dn,On),En=Ia(dn[Cn].head,dn[Cn].anchor),Rn=dn.length-1,Ln=Rn-Cn>Cn?Rn:0,Xn=dn[Ln].anchor,In=Math.min(Xn.line,fn.line),Wn=Math.max(Xn.line,fn.line),$n=Xn.ch,ea=fn.ch,na=dn[Ln].head.ch-$n,ma=ea-$n;na>0&&ma<=0?($n++,gn||ea--):na<0&&ma>=0?($n--,En||ea++):na<0&&ma==-1&&($n--,ea++);for(var oa=In;oa<=Wn;oa++){var Pa={anchor:new e(oa,$n),head:new e(oa,ea)};cn.push(Pa)}return nn.setSelections(cn),rn.ch=ea,Xn.ch=$n,Xn}function kn(nn,rn,cn){for(var dn=[],fn=0;fn<cn;fn++){var gn=Ka(rn,fn,0);dn.push({anchor:gn,head:gn})}nn.setSelections(dn,0)}function wn(nn,rn,cn){for(var dn=0;dn<nn.length;dn++){var fn=Ia(nn[dn].anchor,rn),gn=Ia(nn[dn].head,rn);if(fn||gn)return dn}return-1}function Gn(nn,rn){var cn=nn.listSelections(),dn=cn[0],fn=cn[cn.length-1],gn=da(dn.anchor,dn.head)?dn.anchor:dn.head,On=da(fn.anchor,fn.head)?fn.head:fn.anchor;return[gn,On]}function zn(nn,rn){var cn=rn.sel.anchor,dn=rn.sel.head;rn.lastPastedText&&(dn=nn.posFromIndex(nn.indexFromPos(cn)+rn.lastPastedText.length),rn.lastPastedText=void 0),rn.lastSelection={anchorMark:nn.setBookmark(cn),headMark:nn.setBookmark(dn),anchor:wa(cn),head:wa(dn),visualMode:rn.visualMode,visualLine:rn.visualLine,visualBlock:rn.visualBlock}}function Yn(nn,rn,cn,dn){var fn=nn.state.vim.sel,gn=dn?rn:fn.head,On=dn?rn:fn.anchor,Cn;return da(cn,rn)&&(Cn=cn,cn=rn,rn=Cn),da(gn,On)?(gn=Ca(rn,gn),On=is(On,cn)):(On=Ca(rn,On),gn=is(gn,cn),gn=Ka(gn,0,-1),gn.ch==-1&&gn.line!=nn.firstLine()&&(gn=new e(gn.line-1,os(nn,gn.line-1)))),[On,gn]}function ta(nn,rn,cn){var dn=nn.state.vim;rn=rn||dn.sel,cn||(cn=dn.visualLine?"line":dn.visualBlock?"block":"char");var fn=la(nn,rn,cn);nn.setSelections(fn.ranges,fn.primary)}function la(nn,rn,cn,dn){var fn=wa(rn.head),gn=wa(rn.anchor);if(cn=="char"){var On=!dn&&!da(rn.head,rn.anchor)?1:0,Cn=da(rn.head,rn.anchor)?1:0;return fn=Ka(rn.head,0,On),gn=Ka(rn.anchor,0,Cn),{ranges:[{anchor:gn,head:fn}],primary:0}}else if(cn=="line"){if(da(rn.head,rn.anchor))fn.ch=0,gn.ch=os(nn,gn.line);else{gn.ch=0;var En=nn.lastLine();fn.line>En&&(fn.line=En),fn.ch=os(nn,fn.line)}return{ranges:[{anchor:gn,head:fn}],primary:0}}else if(cn=="block"){var Rn=Math.min(gn.line,fn.line),Ln=gn.ch,Xn=Math.max(gn.line,fn.line),In=fn.ch;Ln<In?In+=1:Ln+=1;for(var Wn=Xn-Rn+1,$n=fn.line==Rn?0:Wn-1,ea=[],na=0;na<Wn;na++)ea.push({anchor:new e(Rn+na,Ln),head:new e(Rn+na,In)});return{ranges:ea,primary:$n}}throw"never happens"}function Xa(nn){var rn=nn.getCursor("head");return nn.getSelection().length==1&&(rn=Ca(rn,nn.getCursor("anchor"))),rn}function za(nn,rn){var cn=nn.state.vim;rn!==!1&&nn.setCursor(Ta(nn,cn.sel.head)),zn(nn,cn),cn.visualMode=!1,cn.visualLine=!1,cn.visualBlock=!1,cn.insertMode||o.signal(nn,"vim-mode-change",{mode:"normal"})}function Cs(nn,rn,cn){var dn=nn.getRange(rn,cn);if(/\n\s*$/.test(dn)){var fn=dn.split(`
|
||
`);fn.pop();for(var gn=fn.pop();fn.length>0&&gn&&An(gn);gn=fn.pop())cn.line--,cn.ch=0;gn?(cn.line--,cn.ch=os(nn,cn.line)):cn.ch=0}}function Es(nn,rn,cn){rn.ch=0,cn.ch=0,cn.line++}function gs(nn){if(!nn)return 0;var rn=nn.search(/\S/);return rn==-1?nn.length:rn}function Ds(nn,{inclusive:rn,innerWord:cn,bigWord:dn,noSymbol:fn,multiline:gn},On){var Cn=On||Xa(nn),En=nn.getLine(Cn.line),Rn=En,Ln=Cn.line,Xn=Ln,In=Cn.ch,Wn,$n=fn?an[0]:sn[0];if(cn&&/\s/.test(En.charAt(In)))$n=function(Ra){return/\s/.test(Ra)};else{for(;!$n(En.charAt(In));)if(In++,In>=En.length){if(!gn)return null;In--,Wn=Js(nn,Cn,!0,dn,!0);break}dn?$n=sn[0]:($n=an[0],$n(En.charAt(In))||($n=an[1]))}for(var ea=In,na=In;$n(En.charAt(na))&&na>=0;)na--;if(na++,Wn)ea=Wn.to,Xn=Wn.line,Rn=nn.getLine(Xn),!Rn&&ea==0&&ea++;else for(;$n(En.charAt(ea))&&ea<En.length;)ea++;if(rn){var ma=ea,oa=Cn.ch<=na&&/\s/.test(En.charAt(Cn.ch));if(!oa)for(;/\s/.test(Rn.charAt(ea))&&ea<Rn.length;)ea++;if(ma==ea||oa){for(var Pa=na;/\s/.test(En.charAt(na-1))&&na>0;)na--;!na&&!oa&&(na=Pa)}}return{start:new e(Ln,na),end:new e(Xn,ea)}}function _s(nn,rn,cn){var dn=rn;if(!o.findMatchingTag||!o.findEnclosingTag)return{start:dn,end:dn};var fn=o.findMatchingTag(nn,rn)||o.findEnclosingTag(nn,rn);return!fn||!fn.open||!fn.close?{start:dn,end:dn}:cn?{start:fn.open.from,end:fn.close.to}:{start:fn.open.to,end:fn.close.from}}function Ys(nn,rn,cn){Ia(rn,cn)||jn.jumpList.add(nn,rn,cn)}function qs(nn,rn){jn.lastCharacterSearch.increment=nn,jn.lastCharacterSearch.forward=rn.forward,jn.lastCharacterSearch.selectedCharacter=rn.selectedCharacter}var Sr={"(":"bracket",")":"bracket","{":"bracket","}":"bracket","[":"section","]":"section","*":"comment","/":"comment",m:"method",M:"method","#":"preprocess"},Ks={bracket:{isComplete:function(nn){if(nn.nextCh===nn.symb){if(nn.depth++,nn.depth>=1)return!0}else nn.nextCh===nn.reverseSymb&&nn.depth--;return!1}},section:{init:function(nn){nn.curMoveThrough=!0,nn.symb=(nn.forward?"]":"[")===nn.symb?"{":"}"},isComplete:function(nn){return nn.index===0&&nn.nextCh===nn.symb}},comment:{isComplete:function(nn){var rn=nn.lastCh==="*"&&nn.nextCh==="/";return nn.lastCh=nn.nextCh,rn}},method:{init:function(nn){nn.symb=nn.symb==="m"?"{":"}",nn.reverseSymb=nn.symb==="{"?"}":"{"},isComplete:function(nn){return nn.nextCh===nn.symb}},preprocess:{init:function(nn){nn.index=0},isComplete:function(nn){if(nn.nextCh==="#"){var rn=nn.lineText.match(/^#(\w+)/)?.[1];if(rn==="endif"){if(nn.forward&&nn.depth===0)return!0;nn.depth++}else if(rn==="if"){if(!nn.forward&&nn.depth===0)return!0;nn.depth--}if(rn==="else"&&nn.depth===0)return!0}return!1}}};function Cr(nn,rn,cn,dn){var fn=wa(nn.getCursor()),gn=cn?1:-1,On=cn?nn.lineCount():-1,Cn=fn.ch,En=fn.line,Rn=nn.getLine(En),Ln={lineText:Rn,nextCh:Rn.charAt(Cn),lastCh:null,index:Cn,symb:dn,reverseSymb:(cn?{")":"(","}":"{"}:{"(":")","{":"}"})[dn],forward:cn,depth:0,curMoveThrough:!1},Xn=Sr[dn];if(!Xn)return fn;var In=Ks[Xn].init,Wn=Ks[Xn].isComplete;for(In&&In(Ln);En!==On&&rn;){if(Ln.index+=gn,Ln.nextCh=Ln.lineText.charAt(Ln.index),!Ln.nextCh){if(En+=gn,Ln.lineText=nn.getLine(En)||"",gn>0)Ln.index=0;else{var $n=Ln.lineText.length;Ln.index=$n>0?$n-1:0}Ln.nextCh=Ln.lineText.charAt(Ln.index)}Wn(Ln)&&(fn.line=En,fn.ch=Ln.index,rn--)}return Ln.nextCh||Ln.curMoveThrough?new e(En,Ln.index):fn}function Js(nn,rn,cn,dn,fn){var gn=rn.line,On=rn.ch,Cn=nn.getLine(gn),En=cn?1:-1,Rn=dn?sn:an;if(fn&&Cn==""){if(gn+=En,Cn=nn.getLine(gn),!_n(nn,gn))return null;On=cn?0:Cn.length}for(;;){if(fn&&Cn=="")return{from:0,to:0,line:gn};for(var Ln=En>0?Cn.length:-1,Xn=Ln,In=Ln;On!=Ln;){for(var Wn=!1,$n=0;$n<Rn.length&&!Wn;++$n)if(Rn[$n](Cn.charAt(On))){for(Xn=On;On!=Ln&&Rn[$n](Cn.charAt(On));)On+=En;if(In=On,Wn=Xn!=In,Xn==rn.ch&&gn==rn.line&&In==Xn+En)continue;return{from:Math.min(Xn,In+1),to:Math.max(Xn,In),line:gn}}Wn||(On+=En)}if(gn+=En,!_n(nn,gn))return null;Cn=nn.getLine(gn),On=En>0?0:Cn.length}}function Pr(nn,rn,cn,dn,fn,gn){var On=wa(rn),Cn=[];(dn&&!fn||!dn&&fn)&&cn++;for(var En=!(dn&&fn),Rn=0;Rn<cn;Rn++){var Ln=Js(nn,rn,dn,gn,En);if(!Ln){var Xn=os(nn,nn.lastLine());Cn.push(dn?{line:nn.lastLine(),from:Xn,to:Xn}:{line:0,from:0,to:0});break}Cn.push(Ln),rn=new e(Ln.line,dn?Ln.to-1:Ln.from)}var In=Cn.length!=cn,Wn=Cn[0],$n=Cn.pop();return dn&&!fn?(!In&&(Wn.from!=On.ch||Wn.line!=On.line)&&($n=Cn.pop()),$n&&new e($n.line,$n.from)):dn&&fn?$n&&new e($n.line,$n.to-1):!dn&&fn?(!In&&(Wn.to!=On.ch||Wn.line!=On.line)&&($n=Cn.pop()),$n&&new e($n.line,$n.to)):$n&&new e($n.line,$n.from)}function er(nn,rn,cn,dn,fn){var gn=rn,On=new e(gn.line+cn.repeat-1,1/0),Cn=nn.clipPos(On);return Cn.ch--,fn||(dn.lastHPos=1/0,dn.lastHSPos=nn.charCoords(Cn,"div").left),On}function Ws(nn,rn,cn,dn,fn){if(dn){for(var gn=fn||nn.getCursor(),On=gn.ch,Cn,En=0;En<rn;En++){var Rn=nn.getLine(gn.line);if(Cn=Ar(On,Rn,dn,cn),Cn==-1)return;On=Cn}if(Cn!=null)return new e(nn.getCursor().line,Cn)}}function Mr(nn,rn){var cn=nn.getCursor().line;return Ta(nn,new e(cn,rn-1))}function Ps(nn,rn,cn,dn){!Bn(cn,ln)&&!pn.test(cn)||(rn.marks[cn]&&rn.marks[cn].clear(),rn.marks[cn]=nn.setBookmark(dn))}function Ar(nn,rn,cn,dn,fn){var gn;return dn?gn=rn.indexOf(cn,nn+1):gn=rn.lastIndexOf(cn,nn-1),gn}function nr(nn,rn,cn,dn,fn){var gn=rn.line,On=nn.firstLine(),Cn=nn.lastLine(),En,Rn,Ln=gn;function Xn(na){return!nn.getLine(na)}function In(na,ma,oa){return oa?Xn(na)!=Xn(na+ma):!Xn(na)&&Xn(na+ma)}if(dn){for(;On<=Ln&&Ln<=Cn&&cn>0;)In(Ln,dn)&&cn--,Ln+=dn;return{start:new e(Ln,0),end:rn}}var Wn=nn.state.vim;if(Wn.visualLine&&In(gn,1,!0)){var $n=Wn.sel.anchor;In($n.line,-1,!0)&&(!fn||$n.line!=gn)&&(gn+=1)}var ea=Xn(gn);for(Ln=gn;Ln<=Cn&&cn;Ln++)In(Ln,1,!0)&&(!fn||Xn(Ln)!=ea)&&cn--;for(Rn=new e(Ln,0),Ln>Cn&&!ea?ea=!0:fn=!1,Ln=gn;Ln>On&&!((!fn||Xn(Ln)==ea||Ln==gn)&&In(Ln,-1,!0));Ln--);return En=new e(Ln,0),{start:En,end:Rn}}function sr(nn,rn,cn,dn,fn){function gn(Rn){Rn.line!==null&&(Rn.pos+Rn.dir<0||Rn.pos+Rn.dir>=Rn.line.length?Rn.line=null:Rn.pos+=Rn.dir)}function On(Rn,Ln,Xn,In){var Wn=Rn.getLine(Ln),$n={line:Wn,ln:Ln,pos:Xn,dir:In};if($n.line==="")return{ln:$n.ln,pos:$n.pos};var ea=$n.pos;for(gn($n);$n.line!==null;){if(ea=$n.pos,Dn($n.line[$n.pos]))if(fn){for(gn($n);$n.line!==null&&An($n.line[$n.pos]);)ea=$n.pos,gn($n);return{ln:$n.ln,pos:ea+1}}else return{ln:$n.ln,pos:$n.pos+1};gn($n)}return{ln:$n.ln,pos:ea+1}}function Cn(Rn,Ln,Xn,In){var Wn=Rn.getLine(Ln),$n={line:Wn,ln:Ln,pos:Xn,dir:In};if($n.line==="")return{ln:$n.ln,pos:$n.pos};var ea=$n.pos;for(gn($n);$n.line!==null;){if(!An($n.line[$n.pos])&&!Dn($n.line[$n.pos]))ea=$n.pos;else if(Dn($n.line[$n.pos]))return fn?An($n.line[$n.pos+1])?{ln:$n.ln,pos:$n.pos+1}:{ln:$n.ln,pos:ea}:{ln:$n.ln,pos:ea};gn($n)}return $n.line=Wn,fn&&An($n.line[$n.pos])?{ln:$n.ln,pos:$n.pos}:{ln:$n.ln,pos:ea}}for(var En={ln:rn.line,pos:rn.ch};cn>0;)dn<0?En=Cn(nn,En.ln,En.pos,dn):En=On(nn,En.ln,En.pos,dn),cn--;return new e(En.ln,En.pos)}function Er(nn,rn,cn,dn){function fn(En,Rn){if(Rn.line!==null)if(Rn.pos+Rn.dir<0||Rn.pos+Rn.dir>=Rn.line.length){if(Rn.ln+=Rn.dir,!_n(En,Rn.ln)){Rn.line=null;return}Rn.line=En.getLine(Rn.ln),Rn.pos=Rn.dir>0?0:Rn.line.length-1}else Rn.pos+=Rn.dir}function gn(En,Rn,Ln,Xn){var na=En.getLine(Rn),In=na==="",Wn={line:na,ln:Rn,pos:Ln,dir:Xn},$n={ln:Wn.ln,pos:Wn.pos},ea=Wn.line==="";for(fn(En,Wn);Wn.line!==null;){if($n.ln=Wn.ln,$n.pos=Wn.pos,Wn.line===""&&!ea)return{ln:Wn.ln,pos:Wn.pos};if(In&&Wn.line!==""&&!An(Wn.line[Wn.pos]))return{ln:Wn.ln,pos:Wn.pos};Dn(Wn.line[Wn.pos])&&!In&&(Wn.pos===Wn.line.length-1||An(Wn.line[Wn.pos+1]))&&(In=!0),fn(En,Wn)}var na=En.getLine($n.ln);$n.pos=0;for(var ma=na.length-1;ma>=0;--ma)if(!An(na[ma])){$n.pos=ma;break}return $n}function On(En,Rn,Ln,Xn){var na=En.getLine(Rn),In={line:na,ln:Rn,pos:Ln,dir:Xn},Wn=In.ln,$n=null,ea=In.line==="";for(fn(En,In);In.line!==null;){if(In.line===""&&!ea)return $n!==null?{ln:Wn,pos:$n}:{ln:In.ln,pos:In.pos};if(Dn(In.line[In.pos])&&$n!==null&&!(In.ln===Wn&&In.pos+1===$n))return{ln:Wn,pos:$n};In.line!==""&&!An(In.line[In.pos])&&(ea=!1,Wn=In.ln,$n=In.pos),fn(En,In)}var na=En.getLine(Wn);$n=0;for(var ma=0;ma<na.length;++ma)if(!An(na[ma])){$n=ma;break}return{ln:Wn,pos:$n}}for(var Cn={ln:rn.line,pos:rn.ch};cn>0;)dn<0?Cn=On(nn,Cn.ln,Cn.pos,dn):Cn=gn(nn,Cn.ln,Cn.pos,dn),cn--;return new e(Cn.ln,Cn.pos)}function rr(nn,rn,cn,dn){var fn=rn,gn={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/,"<":/[<>]/,">":/[<>]/}[cn],On={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{","<":"<",">":"<"}[cn],Cn=nn.getLine(fn.line).charAt(fn.ch),En=Cn===On?1:0,Rn=nn.scanForBracket(new e(fn.line,fn.ch+En),-1,void 0,{bracketRegex:gn}),Ln=nn.scanForBracket(new e(fn.line,fn.ch+En),1,void 0,{bracketRegex:gn});if(!Rn||!Ln)return null;var Xn=Rn.pos,In=Ln.pos;if(Xn.line==In.line&&Xn.ch>In.ch||Xn.line>In.line){var Wn=Xn;Xn=In,In=Wn}return dn?In.ch+=1:Xn.ch+=1,{start:Xn,end:In}}function Gr(nn,rn,cn,dn){var fn=wa(rn),gn=nn.getLine(fn.line),On=gn.split(""),Cn,En,Rn,Ln,Xn=On.indexOf(cn);if(fn.ch<Xn)fn.ch=Xn;else if(Xn<fn.ch&&On[fn.ch]==cn){var In=/string/.test(nn.getTokenTypeAt(Ka(rn,0,1))),Wn=/string/.test(nn.getTokenTypeAt(rn)),$n=In&&!Wn;$n||(En=fn.ch,--fn.ch)}if(On[fn.ch]==cn&&!En)Cn=fn.ch+1;else for(Rn=fn.ch;Rn>-1&&!Cn;Rn--)On[Rn]==cn&&(Cn=Rn+1);if(Cn&&!En)for(Rn=Cn,Ln=On.length;Rn<Ln&&!En;Rn++)On[Rn]==cn&&(En=Rn);return!Cn||!En?{start:fn,end:fn}:(dn&&(--Cn,++En),{start:new e(fn.line,Cn),end:new e(fn.line,En)})}Qn("pcre",!0,"boolean");class Fr{constructor(){this.highlightTimeout}getQuery(){return jn.query}setQuery(rn){jn.query=rn}getOverlay(){return this.searchOverlay}setOverlay(rn){this.searchOverlay=rn}isReversed(){return jn.isReversed}setReversed(rn){jn.isReversed=rn}getScrollbarAnnotate(){return this.annotate}setScrollbarAnnotate(rn){this.annotate=rn}}function vs(nn){var rn=nn.state.vim;return rn.searchState_||(rn.searchState_=new Fr)}function Dr(nn){return lr(nn,"/")}function Tr(nn){return cr(nn,"/")}function lr(nn,rn){var cn=cr(nn,rn);if(!cn.length)return[];var dn=[];if(cn[0]===0){for(var fn=0;fn<cn.length;fn++)typeof cn[fn]=="number"&&dn.push(nn.substring(cn[fn]+1,cn[fn+1]));return dn}}function cr(nn,rn){rn||(rn="/");for(var cn=!1,dn=[],fn=0;fn<nn.length;fn++){var gn=nn.charAt(fn);!cn&&gn==rn&&dn.push(fn),cn=!cn&&gn=="\\"}return dn}function Lr(nn){var rn={V:"|(){+?*.[$^",M:"|(){+?*.[",m:"|(){+?",v:"<>"},cn={">":"(?<=[\\w])(?=[^\\w]|$)","<":"(?<=[^\\w]|^)(?=[\\w])"},dn=rn.m,fn=nn.replace(/\\.|[\[|(){+*?.$^<>]/g,function(On){if(On[0]==="\\"){var Cn=On[1];return Cn==="}"||dn.indexOf(Cn)!=-1?Cn:Cn in rn?(dn=rn[Cn],""):Cn in cn?cn[Cn]:On}else return dn.indexOf(On)!=-1?cn[On]||"\\"+On:On}),gn=fn.indexOf("\\zs");return gn!=-1&&(fn="(?<="+fn.slice(0,gn)+")"+fn.slice(gn+3)),gn=fn.indexOf("\\ze"),gn!=-1&&(fn=fn.slice(0,gn)+"(?="+fn.slice(gn+3)+")"),fn}var ur={"\\n":`
|
||
`,"\\r":"\r","\\t":" "};function Rr(nn){for(var rn=!1,cn=[],dn=-1;dn<nn.length;dn++){var fn=nn.charAt(dn)||"",gn=nn.charAt(dn+1)||"";ur[fn+gn]?(cn.push(ur[fn+gn]),dn++):rn?(cn.push(fn),rn=!1):fn==="\\"?(rn=!0,bn(gn)||gn==="$"?cn.push("$"):gn!=="/"&&gn!=="\\"&&cn.push("\\")):(fn==="$"&&cn.push("$"),cn.push(fn),gn==="/"&&cn.push("\\"))}return cn.join("")}var dr={"\\/":"/","\\\\":"\\","\\n":`
|
||
`,"\\r":"\r","\\t":" ","\\&":"&"};function Nr(nn){for(var rn=new o.StringStream(nn),cn=[];!rn.eol();){for(;rn.peek()&&rn.peek()!="\\";)cn.push(rn.next());var dn=!1;for(var fn in dr)if(rn.match(fn,!0)){dn=!0,cn.push(dr[fn]);break}dn||cn.push(rn.next())}return cn.join("")}function hr(nn,rn,cn){var dn=jn.registerController.getRegister("/");dn.setText(nn);var fn=Tr(nn),gn,On;if(!fn.length)gn=nn;else{gn=nn.substring(0,fn[0]);var Cn=nn.substring(fn[0]);On=Cn.indexOf("i")!=-1}if(!gn)return null;Vn("pcre")||(gn=Lr(gn)),cn&&(rn=/^[^A-Z]*$/.test(gn));var En=new RegExp(gn,rn||On?"im":"m");return En}function xs(nn){typeof nn=="string"&&(nn=document.createElement(nn));for(var rn=1;rn<arguments.length;rn++){var cn=arguments[rn];if(cn)if(typeof cn!="object"&&(cn=document.createTextNode(cn)),cn.nodeType)nn.appendChild(cn);else for(var dn in cn)Object.prototype.hasOwnProperty.call(cn,dn)&&(dn[0]==="$"?nn.style[dn.slice(1)]=cn[dn]:typeof cn[dn]=="function"?nn[dn]=cn[dn]:nn.setAttribute(dn,cn[dn]))}return nn}function Qa(nn,rn,cn){var dn=xs("div",{$color:"red",$whiteSpace:"pre",class:"cm-vim-message"},rn);nn.openNotification?cn?(dn=xs("div",{},dn,xs("div",{},"Press ENTER or type command to continue")),nn.state.closeVimNotification&&nn.state.closeVimNotification(),nn.state.closeVimNotification=nn.openNotification(dn,{bottom:!0,duration:0})):nn.openNotification(dn,{bottom:!0,duration:15e3}):alert(dn.innerText)}function mr(nn,rn){return xs("div",{$display:"flex",$flex:1},xs("span",{$fontFamily:"monospace",$whiteSpace:"pre",$flex:1,$display:"flex"},nn,xs("input",{type:"text",autocorrect:"off",autocapitalize:"off",spellcheck:"false",$flex:1})),rn&&xs("span",{$color:"#888"},rn))}function Zs(nn,rn){if(Ea.length){rn.value||(rn.value=""),va=rn;return}var cn=mr(rn.prefix,rn.desc);if(nn.openDialog)nn.openDialog(cn,rn.onClose,{onKeyDown:rn.onKeyDown,onKeyUp:rn.onKeyUp,bottom:!0,selectValueOnOpen:!1,value:rn.value});else{var dn="";typeof rn.prefix!="string"&&rn.prefix&&(dn+=rn.prefix.textContent),rn.desc&&(dn+=" "+rn.desc),rn.onClose?.(prompt(dn,""))}}function $r(nn,rn){return nn instanceof RegExp&&rn instanceof RegExp?nn.flags==rn.flags&&nn.source==rn.source:!1}function Rs(nn,rn,cn,dn){if(rn){var fn=vs(nn),gn=hr(rn,!!cn,!!dn);if(gn)return Qs(nn,gn),$r(gn,fn.getQuery())||fn.setQuery(gn),gn}}function Br(nn){if(nn.source.charAt(0)=="^")var rn=!0;return{token:function(cn){if(rn&&!cn.sol()){cn.skipToEnd();return}var dn=cn.match(nn,!1);if(dn)return dn[0].length==0?(cn.next(),"searching"):!cn.sol()&&(cn.backUp(1),!nn.exec(cn.next()+dn[0]))?(cn.next(),null):(cn.match(nn),"searching");for(;!cn.eol()&&(cn.next(),!cn.match(nn,!1)););},query:nn}}var Ns=0;function Qs(nn,rn){clearTimeout(Ns);var cn=vs(nn);cn.highlightTimeout=Ns,Ns=setTimeout(function(){if(nn.state.vim){var dn=vs(nn);dn.highlightTimeout=void 0;var fn=dn.getOverlay();(!fn||rn!=fn.query)&&(fn&&nn.removeOverlay(fn),fn=Br(rn),nn.addOverlay(fn),nn.showMatchesOnScrollbar&&(dn.getScrollbarAnnotate()&&dn.getScrollbarAnnotate().clear(),dn.setScrollbarAnnotate(nn.showMatchesOnScrollbar(rn))),dn.setOverlay(fn))}},50)}function fr(nn,rn,cn,dn){return nn.operation(function(){dn===void 0&&(dn=1);for(var fn=nn.getCursor(),gn=nn.getSearchCursor(cn,fn),On=0;On<dn;On++){var Cn=gn.find(rn);if(On==0&&Cn&&Ia(gn.from(),fn)){var En=rn?gn.from():gn.to();Cn=gn.find(rn),Cn&&!Cn[0]&&Ia(gn.from(),En)&&nn.getLine(En.line).length==En.ch&&(Cn=gn.find(rn))}if(!Cn&&(gn=nn.getSearchCursor(cn,rn?new e(nn.lastLine()):new e(nn.firstLine(),0)),!gn.find(rn)))return}return gn.from()})}function Zr(nn,rn,cn,dn,fn){return nn.operation(function(){dn===void 0&&(dn=1);var gn=nn.getCursor(),On=nn.getSearchCursor(cn,gn),Cn=On.find(!rn);!fn.visualMode&&Cn&&Ia(On.from(),gn)&&On.find(!rn);for(var En=0;En<dn;En++)if(Cn=On.find(rn),!Cn&&(On=nn.getSearchCursor(cn,rn?new e(nn.lastLine()):new e(nn.firstLine(),0)),!On.find(rn)))return;var Rn=On.from(),Ln=On.to();return Rn&&Ln&&[Rn,Ln]})}function Fn(nn){var rn=vs(nn);rn.highlightTimeout&&(clearTimeout(rn.highlightTimeout),rn.highlightTimeout=void 0),nn.removeOverlay(vs(nn).getOverlay()),rn.setOverlay(null),rn.getScrollbarAnnotate()&&(rn.getScrollbarAnnotate().clear(),rn.setScrollbarAnnotate(null))}function Ma(nn,rn,cn){return typeof nn!="number"&&(nn=nn.line),rn instanceof Array?Bn(nn,rn):typeof cn=="number"?nn>=rn&&nn<=cn:nn==rn}function Gs(nn){var rn=nn.getScrollInfo(),cn=6,dn=10,fn=nn.coordsChar({left:0,top:cn+rn.top},"local"),gn=rn.clientHeight-dn+rn.top,On=nn.coordsChar({left:0,top:gn},"local");return{top:fn.line,bottom:On.line}}function ms(nn,rn,cn){if(cn=="'"||cn=="`")return jn.jumpList.find(nn,-1)||new e(0,0);if(cn==".")return $s(nn);var dn=rn.marks[cn];return dn&&dn.find()}function $s(nn){if(nn.getLastEditEnd)return nn.getLastEditEnd();for(var rn=nn.doc.history.done,cn=rn.length;cn--;)if(rn[cn].changes)return wa(rn[cn].changes[0].to)}class pa{constructor(){this.commandMap_,this.buildCommandMap_()}processCommand(rn,cn,dn){var fn=this;rn.operation(function(){rn.curOp&&(rn.curOp.isVimOp=!0),fn._processCommand(rn,cn,dn)})}_processCommand(rn,cn,dn){var fn=rn.state.vim,gn=jn.registerController.getRegister(":"),On=gn.toString(),Cn=new o.StringStream(cn);gn.setText(cn);var En=dn||{};En.input=cn;try{this.parseInput_(rn,Cn,En)}catch(Xn){throw Qa(rn,Xn+""),Xn}fn.visualMode&&za(rn);var Rn,Ln;if(!En.commandName)En.line!==void 0&&(Ln="move");else if(Rn=this.matchCommand_(En.commandName),Rn){if(Ln=Rn.name,Rn.excludeFromCommandHistory&&gn.setText(On),this.parseCommandArgs_(Cn,En,Rn),Rn.type=="exToKey"){Va(rn,Rn.toKeys||"",Rn);return}else if(Rn.type=="exToEx"){this.processCommand(rn,Rn.toInput||"");return}}if(!Ln){Qa(rn,'Not an editor command ":'+cn+'"');return}try{Ts[Ln](rn,En),(!Rn||!Rn.possiblyAsync)&&En.callback&&En.callback()}catch(Xn){throw Qa(rn,Xn+""),Xn}}parseInput_(rn,cn,dn){cn.eatWhile(":"),cn.eat("%")?(dn.line=rn.firstLine(),dn.lineEnd=rn.lastLine()):(dn.line=this.parseLineSpec_(rn,cn),dn.line!==void 0&&cn.eat(",")&&(dn.lineEnd=this.parseLineSpec_(rn,cn))),dn.line==null?rn.state.vim.visualMode?(dn.selectionLine=ms(rn,rn.state.vim,"<")?.line,dn.selectionLineEnd=ms(rn,rn.state.vim,">")?.line):dn.selectionLine=rn.getCursor().line:(dn.selectionLine=dn.line,dn.selectionLineEnd=dn.lineEnd);var fn=cn.match(/^(\w+|!!|@@|[!#&*<=>@~])/);return fn?dn.commandName=fn[1]:dn.commandName=(cn.match(/.*/)||[""])[0],dn}parseLineSpec_(rn,cn){var dn=cn.match(/^(\d+)/);if(dn)return parseInt(dn[1],10)-1;switch(cn.next()){case".":return this.parseLineSpecOffset_(cn,rn.getCursor().line);case"$":return this.parseLineSpecOffset_(cn,rn.lastLine());case"'":var fn=cn.next()||"",gn=ms(rn,rn.state.vim,fn);if(!gn)throw new Error("Mark not set");return this.parseLineSpecOffset_(cn,gn.line);case"-":case"+":return cn.backUp(1),this.parseLineSpecOffset_(cn,rn.getCursor().line);default:cn.backUp(1);return}}parseLineSpecOffset_(rn,cn){var dn=rn.match(/^([+-])?(\d+)/);if(dn){var fn=parseInt(dn[2],10);dn[1]=="-"?cn-=fn:cn+=fn}return cn}parseCommandArgs_(rn,cn,dn){if(!rn.eol()){cn.argString=rn.match(/.*/)?.[0];var fn=dn.argDelimiter||/\s+/,gn=Ls(cn.argString||"").split(fn);gn.length&&gn[0]&&(cn.args=gn)}}matchCommand_(rn){for(var cn=rn.length;cn>0;cn--){var dn=rn.substring(0,cn);if(this.commandMap_[dn]){var fn=this.commandMap_[dn];if(fn.name.indexOf(rn)===0)return fn}}}buildCommandMap_(){this.commandMap_={};for(var rn=0;rn<R.length;rn++){var cn=R[rn],dn=cn.shortName||cn.name;this.commandMap_[dn]=cn}}map(rn,cn,dn,fn){if(rn!=":"&&rn.charAt(0)==":"){if(dn)throw Error("Mode not supported for ex mappings");var gn=rn.substring(1);cn!=":"&&cn.charAt(0)==":"?this.commandMap_[gn]={name:gn,type:"exToEx",toInput:cn.substring(1),user:!0}:this.commandMap_[gn]={name:gn,type:"exToKey",toKeys:cn,user:!0}}else{var On={keys:rn,type:"keyToKey",toKeys:cn,noremap:!!fn};dn&&(On.context=dn),ws(On)}}unmap(rn,cn){if(rn!=":"&&rn.charAt(0)==":"){if(cn)throw Error("Mode not supported for ex mappings");var dn=rn.substring(1);if(this.commandMap_[dn]&&this.commandMap_[dn].user)return delete this.commandMap_[dn],!0}else for(var fn=rn,gn=0;gn<d.length;gn++)if(fn==d[gn].keys&&d[gn].context===cn)return d.splice(gn,1),zs(fn),!0}}var Ts={colorscheme:function(nn,rn){if(!rn.args||rn.args.length<1){Qa(nn,nn.getOption("theme"));return}nn.setOption("theme",rn.args[0])},map:function(nn,rn,cn,dn){var fn=rn.args;if(!fn||fn.length<2){nn&&Qa(nn,"Invalid mapping: "+rn.input);return}fs.map(fn[0],fn[1],cn,dn)},imap:function(nn,rn){this.map(nn,rn,"insert")},nmap:function(nn,rn){this.map(nn,rn,"normal")},vmap:function(nn,rn){this.map(nn,rn,"visual")},omap:function(nn,rn){this.map(nn,rn,"operatorPending")},noremap:function(nn,rn){this.map(nn,rn,void 0,!0)},inoremap:function(nn,rn){this.map(nn,rn,"insert",!0)},nnoremap:function(nn,rn){this.map(nn,rn,"normal",!0)},vnoremap:function(nn,rn){this.map(nn,rn,"visual",!0)},onoremap:function(nn,rn){this.map(nn,rn,"operatorPending",!0)},unmap:function(nn,rn,cn){var dn=rn.args;(!dn||dn.length<1||!fs.unmap(dn[0],cn))&&nn&&Qa(nn,"No such mapping: "+rn.input)},mapclear:function(nn,rn){Kn.mapclear()},imapclear:function(nn,rn){Kn.mapclear("insert")},nmapclear:function(nn,rn){Kn.mapclear("normal")},vmapclear:function(nn,rn){Kn.mapclear("visual")},omapclear:function(nn,rn){Kn.mapclear("operatorPending")},move:function(nn,rn){ns.processCommand(nn,nn.state.vim,{keys:"",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0},repeatOverride:rn.line+1})},set:function(nn,rn){var cn=rn.args,dn=rn.setCfg||{};if(!cn||cn.length<1){nn&&Qa(nn,"Invalid mapping: "+rn.input);return}var fn=cn[0].split("="),gn=fn.shift()||"",On=fn.length>0?fn.join("="):void 0,Cn=!1,En=!1;if(gn.charAt(gn.length-1)=="?"){if(On)throw Error("Trailing characters: "+rn.argString);gn=gn.substring(0,gn.length-1),Cn=!0}else gn.charAt(gn.length-1)=="!"&&(gn=gn.substring(0,gn.length-1),En=!0);On===void 0&&gn.substring(0,2)=="no"&&(gn=gn.substring(2),On=!1);var Rn=Nn[gn]&&Nn[gn].type=="boolean";if(Rn&&(En?On=!Vn(gn,nn,dn):On==null&&(On=!0)),!Rn&&On===void 0||Cn){var Ln=Vn(gn,nn,dn);Ln instanceof Error?Qa(nn,Ln.message):Ln===!0||Ln===!1?Qa(nn," "+(Ln?"":"no")+gn):Qa(nn," "+gn+"="+Ln)}else{var Xn=Zn(gn,On,nn,dn);Xn instanceof Error&&Qa(nn,Xn.message)}},setlocal:function(nn,rn){rn.setCfg={scope:"local"},this.set(nn,rn)},setglobal:function(nn,rn){rn.setCfg={scope:"global"},this.set(nn,rn)},registers:function(nn,rn){var cn=rn.args,dn=jn.registerController.registers,fn=`----------Registers----------
|
||
|
||
`;if(cn)for(var Cn=cn.join(""),En=0;En<Cn.length;En++){var gn=Cn.charAt(En);if(jn.registerController.isValidRegister(gn)){var Rn=dn[gn]||new sa;fn+='"'+gn+" "+Rn.toString()+`
|
||
`}}else for(var gn in dn){var On=dn[gn].toString();On.length&&(fn+='"'+gn+" "+On+`
|
||
`)}Qa(nn,fn,!0)},marks:function(nn,rn){var cn=rn.args,dn=nn.state.vim.marks,fn=`-----------Marks-----------
|
||
mark line col
|
||
|
||
`;if(cn)for(var Cn=cn.join(""),En=0;En<Cn.length;En++){var gn=Cn.charAt(En),On=dn[gn]&&dn[gn].find();On&&(fn+=gn+" "+On.line+" "+On.ch+`
|
||
`)}else for(var gn in dn){var On=dn[gn]&&dn[gn].find();On&&(fn+=gn+" "+On.line+" "+On.ch+`
|
||
`)}Qa(nn,fn,!0)},sort:function(nn,rn){var cn,dn,fn,gn,On;function Cn(){if(rn.argString){var Wa=new o.StringStream(rn.argString);if(Wa.eat("!")&&(cn=!0),Wa.eol())return;if(!Wa.eatSpace())return"Invalid arguments";var Sa=Wa.match(/([dinuox]+)?\s*(\/.+\/)?\s*/);if(!Sa||!Wa.eol())return"Invalid arguments";if(Sa[1]){dn=Sa[1].indexOf("i")!=-1,fn=Sa[1].indexOf("u")!=-1;var Ja=Sa[1].indexOf("d")!=-1||Sa[1].indexOf("n")!=-1,ys=Sa[1].indexOf("x")!=-1,us=Sa[1].indexOf("o")!=-1;if(Number(Ja)+Number(ys)+Number(us)>1)return"Invalid arguments";gn=Ja&&"decimal"||ys&&"hex"||us&&"octal"}Sa[2]&&(On=new RegExp(Sa[2].substr(1,Sa[2].length-2),dn?"i":""))}}var En=Cn();if(En){Qa(nn,En+": "+rn.argString);return}var Rn=rn.line||nn.firstLine(),Ln=rn.lineEnd||rn.line||nn.lastLine();if(Rn==Ln)return;var Xn=new e(Rn,0),In=new e(Ln,os(nn,Ln)),Wn=nn.getRange(Xn,In).split(`
|
||
`),$n=gn=="decimal"?/(-?)([\d]+)/:gn=="hex"?/(-?)(?:0x)?([0-9a-f]+)/i:gn=="octal"?/([0-7]+)/:null,ea=gn=="decimal"?10:gn=="hex"?16:gn=="octal"?8:void 0,na=[],ma=[];if(gn||On)for(var oa=0;oa<Wn.length;oa++){var Pa=On?Wn[oa].match(On):null;Pa&&Pa[0]!=""?na.push(Pa):$n&&$n.exec(Wn[oa])?na.push(Wn[oa]):ma.push(Wn[oa])}else ma=Wn;function Ra(Wa,Sa){if(cn){var Ja;Ja=Wa,Wa=Sa,Sa=Ja}dn&&(Wa=Wa.toLowerCase(),Sa=Sa.toLowerCase());var ys=$n&&$n.exec(Wa),us=$n&&$n.exec(Sa);if(!ys||!us)return Wa<Sa?-1:1;var ks=parseInt((ys[1]+ys[2]).toLowerCase(),ea),Fs=parseInt((us[1]+us[2]).toLowerCase(),ea);return ks-Fs}function La(Wa,Sa){if(cn){var Ja;Ja=Wa,Wa=Sa,Sa=Ja}return dn&&(Wa[0]=Wa[0].toLowerCase(),Sa[0]=Sa[0].toLowerCase()),Wa[0]<Sa[0]?-1:1}if(na.sort(On?La:Ra),On)for(var oa=0;oa<na.length;oa++)na[oa]=na[oa].input;else gn||ma.sort(Ra);if(Wn=cn?na.concat(ma):ma.concat(na),fn){var Ya=Wn,ja;Wn=[];for(var oa=0;oa<Ya.length;oa++)Ya[oa]!=ja&&Wn.push(Ya[oa]),ja=Ya[oa]}nn.replaceRange(Wn.join(`
|
||
`),Xn,In)},vglobal:function(nn,rn){this.global(nn,rn)},normal:function(nn,rn){var cn=!1,dn=rn.argString;if(dn&&dn[0]=="!"&&(dn=dn.slice(1),cn=!0),dn=dn.trimStart(),!dn){Qa(nn,"Argument is required.");return}var fn=rn.line;if(typeof fn=="number")for(var gn=isNaN(rn.lineEnd)?fn:rn.lineEnd,On=fn;On<=gn;On++)nn.setCursor(On,0),Va(nn,rn.argString.trimStart(),{noremap:cn}),nn.state.vim.insertMode&&Da(nn,!0);else Va(nn,rn.argString.trimStart(),{noremap:cn}),nn.state.vim.insertMode&&Da(nn,!0)},global:function(nn,rn){var cn=rn.argString;if(!cn){Qa(nn,"Regular Expression missing from global");return}var dn=rn.commandName[0]==="v";cn[0]==="!"&&rn.commandName[0]==="g"&&(dn=!0,cn=cn.slice(1));var fn=rn.line!==void 0?rn.line:nn.firstLine(),gn=rn.lineEnd||rn.line||nn.lastLine(),On=Dr(cn),Cn=cn,En="";if(On&&On.length&&(Cn=On[0],En=On.slice(1,On.length).join("/")),Cn)try{Rs(nn,Cn,!0,!0)}catch{Qa(nn,"Invalid regex: "+Cn);return}for(var Rn=vs(nn).getQuery(),Ln=[],Xn=fn;Xn<=gn;Xn++){var In=nn.getLine(Xn),Wn=Rn.test(In);Wn!==dn&&Ln.push(En?nn.getLineHandle(Xn):In)}if(!En){Qa(nn,Ln.join(`
|
||
`));return}var $n=0,ea=function(){if($n<Ln.length){var na=Ln[$n++],ma=nn.getLineNumber(na);if(ma==null){ea();return}var oa=ma+1+En;fs.processCommand(nn,oa,{callback:ea})}else nn.releaseLineHandles&&nn.releaseLineHandles()};ea()},substitute:function(nn,rn){if(!nn.getSearchCursor)throw new Error("Search feature not available. Requires searchcursor.js or any other getSearchCursor implementation.");var cn=rn.argString,dn=cn?lr(cn,cn[0]):[],fn="",gn="",On,Cn,En,Rn=!1,Ln=!1;if(dn&&dn.length)fn=dn[0],Vn("pcre")&&fn!==""&&(fn=new RegExp(fn).source),gn=dn[1],gn!==void 0&&(Vn("pcre")?gn=Nr(gn.replace(/([^\\])&/g,"$1$$&")):gn=Rr(gn),jn.lastSubstituteReplacePart=gn),On=dn[2]?dn[2].split(" "):[];else if(cn&&cn.length){Qa(nn,"Substitutions should be of the form :s/pattern/replace/");return}if(On&&(Cn=On[0],En=parseInt(On[1]),Cn&&(Cn.indexOf("c")!=-1&&(Rn=!0),Cn.indexOf("g")!=-1&&(Ln=!0),Vn("pcre")?fn=fn+"/"+Cn:fn=fn.replace(/\//g,"\\/")+"/"+Cn)),fn)try{Rs(nn,fn,!0,!0)}catch{Qa(nn,"Invalid regex: "+fn);return}if(gn=gn||jn.lastSubstituteReplacePart,gn===void 0){Qa(nn,"No previous substitute regular expression");return}var Xn=vs(nn),In=Xn.getQuery(),Wn=rn.line!==void 0?rn.line:nn.getCursor().line,$n=rn.lineEnd||Wn;Wn==nn.firstLine()&&$n==nn.lastLine()&&($n=1/0),En&&(Wn=$n,$n=Wn+En-1);var ea=Ta(nn,new e(Wn,0)),na=nn.getSearchCursor(In,ea);gr(nn,Rn,Ln,Wn,$n,na,In,gn,rn.callback)},startinsert:function(nn,rn){Va(nn,rn.argString=="!"?"A":"i",{})},redo:o.commands.redo,undo:o.commands.undo,write:function(nn){o.commands.save?o.commands.save(nn):nn.save&&nn.save()},nohlsearch:function(nn){Fn(nn)},yank:function(nn){var rn=wa(nn.getCursor()),cn=rn.line,dn=nn.getLine(cn);jn.registerController.pushText("0","yank",dn,!0,!0)},delete:function(nn,rn){var cn=rn.selectionLine,dn=isNaN(rn.selectionLineEnd)?cn:rn.selectionLineEnd;Fa.delete(nn,{linewise:!0},[{anchor:new e(cn,0),head:new e(dn+1,0)}])},join:function(nn,rn){var cn=rn.selectionLine,dn=isNaN(rn.selectionLineEnd)?cn:rn.selectionLineEnd;nn.setCursor(new e(cn,0)),ca.joinLines(nn,{repeat:dn-cn},nn.state.vim)},delmarks:function(nn,rn){if(!rn.argString||!Ls(rn.argString)){Qa(nn,"Argument required");return}for(var cn=nn.state.vim,dn=new o.StringStream(Ls(rn.argString));!dn.eol();){dn.eatSpace();var fn=dn.pos;if(!dn.match(/[a-zA-Z]/,!1)){Qa(nn,"Invalid argument: "+rn.argString.substring(fn));return}var gn=dn.next();if(dn.match("-",!0)){if(!dn.match(/[a-zA-Z]/,!1)){Qa(nn,"Invalid argument: "+rn.argString.substring(fn));return}var On=gn,Cn=dn.next();if(On&&Cn&&Pn(On)==Pn(Cn)){var En=On.charCodeAt(0),Rn=Cn.charCodeAt(0);if(En>=Rn){Qa(nn,"Invalid argument: "+rn.argString.substring(fn));return}for(var Ln=0;Ln<=Rn-En;Ln++){var Xn=String.fromCharCode(En+Ln);delete cn.marks[Xn]}}else{Qa(nn,"Invalid argument: "+On+"-");return}}else gn&&delete cn.marks[gn]}}},fs=new pa;Kn.defineEx("version","ve",nn=>{Qa(nn,"Codemirror-vim version: 6.3.0")});function gr(nn,rn,cn,dn,fn,gn,On,Cn,En){nn.state.vim.exMode=!0;var Rn=!1,Ln=0,Xn,In,Wn;function $n(){nn.operation(function(){for(;!Rn;)ea(),ma();oa()})}function ea(){var Ra="",La=gn.match||gn.pos&&gn.pos.match;if(La)Ra=Cn.replace(/\$(\d{1,3}|[$&])/g,function(Wa,Sa){if(Sa=="$")return"$";if(Sa=="&")return La[0];for(var Ja=Sa;parseInt(Ja)>=La.length&&Ja.length>0;)Ja=Ja.slice(0,Ja.length-1);return Ja?La[Ja]+Sa.slice(Ja.length,Sa.length):Wa});else{var Ya=nn.getRange(gn.from(),gn.to());Ra=Ya.replace(On,Cn)}var ja=gn.to().line;gn.replace(Ra),In=gn.to().line,fn+=In-ja,Wn=In<ja}function na(){var Ra=Xn&&wa(gn.to()),La=gn.findNext();return La&&!La[0]&&Ra&&Ia(gn.from(),Ra)&&(La=gn.findNext()),La&&Ln++,La}function ma(){for(;na()&&Ma(gn.from(),dn,fn);)if(!(!cn&&gn.from().line==In&&!Wn)){nn.scrollIntoView(gn.from(),30),nn.setSelection(gn.from(),gn.to()),Xn=gn.from(),Rn=!1;return}Rn=!0}function oa(Ra){if(Ra&&Ra(),nn.focus(),Xn){nn.setCursor(Xn);var La=nn.state.vim;La.exMode=!1,La.lastHPos=La.lastHSPos=Xn.ch}En?En():Rn&&Qa(nn,(Ln?"Found "+Ln+" matches":"No matches found")+" for pattern: "+On+(Vn("pcre")?" (set nopcre to use Vim regexps)":""))}function Pa(Ra,La,Ya){o.e_stop(Ra);var ja=ua(Ra);switch(ja){case"y":ea(),ma();break;case"n":ma();break;case"a":var Wa=En;En=void 0,nn.operation($n),En=Wa;break;case"l":ea();case"q":case"<Esc>":case"<C-c>":case"<C-[>":oa(Ya);break}return Rn&&oa(Ya),!0}if(ma(),Rn){Qa(nn,"No matches for "+On+(Vn("pcre")?" (set nopcre to use vim regexps)":""));return}if(!rn){$n(),En&&En();return}Zs(nn,{prefix:xs("span","replace with ",xs("strong",Cn)," (y/n/a/q/l)"),onKeyDown:Pa})}function Da(nn,rn){var cn=nn.state.vim,dn=jn.macroModeState,fn=jn.registerController.getRegister("."),gn=dn.isPlaying,On=dn.lastInsertModeChanges;gn||(nn.off("change",Ss),cn.insertEnd&&cn.insertEnd.clear(),cn.insertEnd=void 0,o.off(nn.getInputField(),"keydown",vr)),!gn&&cn.insertModeRepeat&&cn.insertModeRepeat>1&&(xr(nn,cn,cn.insertModeRepeat-1,!0),cn.lastEditInputState.repeatOverride=cn.insertModeRepeat),delete cn.insertModeRepeat,cn.insertMode=!1,rn||nn.setCursor(nn.getCursor().line,nn.getCursor().ch-1),nn.setOption("keyMap","vim"),nn.setOption("disableInput",!0),nn.toggleOverwrite(!1),fn.setText(On.changes.join("")),o.signal(nn,"vim-mode-change",{mode:"normal"}),dn.isRecording&&Xr(dn)}function ws(nn){d.unshift(nn),nn.keys&&Ir(nn.keys)}function Ir(nn){nn.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(rn){rn&&(p[rn]||(p[rn]=0),p[rn]++)})}function zs(nn){nn.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(rn){p[rn]&&p[rn]--})}function yr(nn,rn,cn,dn,fn){var gn={keys:nn,type:rn};gn[rn]=cn,gn[rn+"Args"]=dn;for(var On in fn)gn[On]=fn[On];ws(gn)}Qn("insertModeEscKeysTimeout",200,"number");function js(nn,rn,cn,dn){var fn=jn.registerController.getRegister(dn);if(dn==":"){fn.keyBuffer[0]&&fs.processCommand(nn,fn.keyBuffer[0]),cn.isPlaying=!1;return}var gn=fn.keyBuffer,On=0;cn.isPlaying=!0,cn.replaySearchQueries=fn.searchQueries.slice(0);for(var Cn=0;Cn<gn.length;Cn++)for(var En=gn[Cn],Rn,Ln,Xn=/<(?:[CSMA]-)*\w+>|./gi;Rn=Xn.exec(En);)if(Ln=Rn[0],Kn.handleKey(nn,Ln,"macro"),rn.insertMode){var In=fn.insertModeChanges[On++].changes;jn.macroModeState.lastInsertModeChanges.changes=In,Bs(nn,In,1),Da(nn)}cn.isPlaying=!1}function ba(nn,rn){if(!nn.isPlaying){var cn=nn.latestRegister,dn=jn.registerController.getRegister(cn);dn&&dn.pushText(rn)}}function Xr(nn){if(!nn.isPlaying){var rn=nn.latestRegister,cn=jn.registerController.getRegister(rn);cn&&cn.pushInsertModeChanges&&cn.pushInsertModeChanges(nn.lastInsertModeChanges)}}function br(nn,rn){if(!nn.isPlaying){var cn=nn.latestRegister,dn=jn.registerController.getRegister(cn);dn&&dn.pushSearchQuery&&dn.pushSearchQuery(rn)}}function Ss(nn,rn){var cn=jn.macroModeState,dn=cn.lastInsertModeChanges;if(!cn.isPlaying)for(var fn=nn.state.vim;rn;){if(dn.expectCursorActivityForChange=!0,dn.ignoreCount>1)dn.ignoreCount--;else if(rn.origin=="+input"||rn.origin=="paste"||rn.origin===void 0){var gn=nn.listSelections().length;gn>1&&(dn.ignoreCount=gn);var On=rn.text.join(`
|
||
`);if(dn.maybeReset&&(dn.changes=[],dn.maybeReset=!1),On)if(nn.state.overwrite&&!/\n/.test(On))dn.changes.push([On]);else{if(On.length>1){var Cn=fn&&fn.insertEnd&&fn.insertEnd.find(),En=nn.getCursor();if(Cn&&Cn.line==En.line){var Rn=Cn.ch-En.ch;Rn>0&&Rn<On.length&&(dn.changes.push([On,Rn]),On="")}}On&&dn.changes.push(On)}}rn=rn.next}}function _r(nn){var rn=nn.state.vim;if(rn.insertMode){var cn=jn.macroModeState;if(cn.isPlaying)return;var dn=cn.lastInsertModeChanges;dn.expectCursorActivityForChange?dn.expectCursorActivityForChange=!1:(dn.maybeReset=!0,rn.insertEnd&&rn.insertEnd.clear(),rn.insertEnd=nn.setBookmark(nn.getCursor(),{insertLeft:!0}))}else nn.curOp?.isVimOp||kr(nn,rn)}function kr(nn,rn){var cn=nn.getCursor("anchor"),dn=nn.getCursor("head");if(rn.visualMode&&!nn.somethingSelected()?za(nn,!1):!rn.visualMode&&!rn.insertMode&&nn.somethingSelected()&&(rn.visualMode=!0,rn.visualLine=!1,o.signal(nn,"vim-mode-change",{mode:"visual"})),rn.visualMode){var fn=da(dn,cn)?0:-1,gn=da(dn,cn)?-1:0;dn=Ka(dn,0,fn),cn=Ka(cn,0,gn),rn.sel={anchor:cn,head:dn},Ps(nn,rn,"<",Ca(dn,cn)),Ps(nn,rn,">",is(dn,cn))}else rn.insertMode||(rn.lastHPos=nn.getCursor().ch)}function vr(nn){var rn=jn.macroModeState,cn=rn.lastInsertModeChanges,dn=o.keyName?o.keyName(nn):nn.key;dn&&(dn.indexOf("Delete")!=-1||dn.indexOf("Backspace")!=-1)&&(cn.maybeReset&&(cn.changes=[],cn.maybeReset=!1),cn.changes.push(new Aa(dn,nn)))}function xr(nn,rn,cn,dn){var fn=jn.macroModeState;fn.isPlaying=!0;var gn=rn.lastEditActionCommand,On=rn.inputState;function Cn(){gn?ns.processAction(nn,rn,gn):ns.evalInput(nn,rn)}function En(Ln){if(fn.lastInsertModeChanges.changes.length>0){Ln=rn.lastEditActionCommand?Ln:1;var Xn=fn.lastInsertModeChanges;Bs(nn,Xn.changes,Ln)}}if(rn.inputState=rn.lastEditInputState,gn&&gn.interlaceInsertRepeat)for(var Rn=0;Rn<cn;Rn++)Cn(),En(1);else dn||Cn(),En(cn);rn.inputState=On,rn.insertMode&&!dn&&Da(nn),fn.isPlaying=!1}function wr(nn,rn){o.lookupKey(rn,"vim-insert",function(dn){return typeof dn=="string"?o.commands[dn](nn):dn(nn),!0})}function Bs(nn,rn,cn){var dn=nn.getCursor("head"),fn=jn.macroModeState.lastInsertModeChanges.visualBlock;fn&&(kn(nn,dn,fn+1),cn=nn.listSelections().length,nn.setCursor(dn));for(var gn=0;gn<cn;gn++){fn&&nn.setCursor(Ka(dn,gn,0));for(var On=0;On<rn.length;On++){var Cn=rn[On];if(Cn instanceof Aa)wr(nn,Cn.keyName);else if(typeof Cn=="string")nn.replaceSelection(Cn);else{var En=nn.getCursor(),Rn=Ka(En,0,Cn[0].length-(Cn[1]||0));nn.replaceRange(Cn[0],En,Cn[1]?En:Rn),nn.setCursor(Rn)}}}fn&&nn.setCursor(Ka(dn,0,1))}function Us(nn){var rn=new nn.constructor;return Object.keys(nn).forEach(function(cn){if(cn!="insertEnd"){var dn=nn[cn];Array.isArray(dn)?dn=dn.slice():dn&&typeof dn=="object"&&dn.constructor!=Object&&(dn=Us(dn)),rn[cn]=dn}}),nn.sel&&(rn.sel={head:nn.sel.head&&wa(nn.sel.head),anchor:nn.sel.anchor&&wa(nn.sel.anchor)}),rn}function Vr(nn,rn,cn){var gn=aa(nn),dn=nn,fn=!1,gn=Kn.maybeInitVimState_(dn),On=gn.visualBlock||gn.wasInVisualBlock;if(dn.state.closeVimNotification){var Cn=dn.state.closeVimNotification;if(dn.state.closeVimNotification=null,Cn(),rn=="<CR>")return Un(dn),!0}var En=dn.isInMultiSelectMode();if(gn.wasInVisualBlock&&!En?gn.wasInVisualBlock=!1:En&&gn.visualBlock&&(gn.wasInVisualBlock=!0),rn=="<Esc>"&&!gn.insertMode&&!gn.visualMode&&En&&gn.status=="<Esc>")Un(dn);else if(On||!En||dn.inVirtualSelectionMode)fn=Kn.handleKey(dn,rn,cn);else{var Rn=Us(gn),Ln=gn.inputState.changeQueueList||[];dn.operation(function(){dn.curOp&&(dn.curOp.isVimOp=!0);var Xn=0;dn.forEachSelection(function(){dn.state.vim.inputState.changeQueue=Ln[Xn];var In=dn.getCursor("head"),Wn=dn.getCursor("anchor"),$n=da(In,Wn)?0:-1,ea=da(In,Wn)?-1:0;In=Ka(In,0,$n),Wn=Ka(Wn,0,ea),dn.state.vim.sel.head=In,dn.state.vim.sel.anchor=Wn,fn=Kn.handleKey(dn,rn,cn),dn.virtualSelection&&(Ln[Xn]=dn.state.vim.inputState.changeQueue,dn.state.vim=Us(Rn)),Xn++}),dn.curOp?.cursorActivity&&!fn&&(dn.curOp.cursorActivity=!1),dn.state.vim=gn,gn.inputState.changeQueueList=Ln,gn.inputState.changeQueue=null},!0)}return fn&&!gn.visualMode&&!gn.insertMode&&gn.visualMode!=dn.somethingSelected()&&kr(dn,gn),fn}return ka(),Kn}function indexFromPos(o,e){var l=e.ch,d=e.line+1;d<1&&(d=1,l=0),d>o.lines&&(d=o.lines,l=Number.MAX_VALUE);var p=o.line(d);return Math.min(p.from+Math.max(0,l),p.to)}function posFromIndex(o,e){let l=o.lineAt(e);return{line:l.number-1,ch:e-l.from}}class Pos{constructor(e,l){this.line=e,this.ch=l}}function on(o,e,l){if(o.addEventListener)o.addEventListener(e,l,!1);else{var d=o._handlers||(o._handlers={});d[e]=(d[e]||[]).concat(l)}}function off(o,e,l){if(o.removeEventListener)o.removeEventListener(e,l,!1);else{var d=o._handlers,p=d&&d[e];if(p){var b=p.indexOf(l);b>-1&&(d[e]=p.slice(0,b).concat(p.slice(b+1)))}}}function signal(o,e,...l){var d,p=(d=o._handlers)===null||d===void 0?void 0:d[e];if(p)for(var b=0;b<p.length;++b)p[b](...l)}function signalTo(o,...e){if(o)for(var l=0;l<o.length;++l)o[l](...e)}let wordChar;try{wordChar=new RegExp("[\\w\\p{Alphabetic}\\p{Number}_]","u")}catch(o){wordChar=/[\w]/}function dispatchChange(o,e){var l=o.cm6;if(!l.state.readOnly){var d="input.type.compose";if(o.curOp&&(o.curOp.lastChange||(d="input.type.compose.start")),e.annotations)try{e.annotations.some(function(p){p.value=="input"&&(p.value=d)})}catch(p){console.error(p)}else e.userEvent=d;return l.dispatch(e)}}function runHistoryCommand(o,e){var l;o.curOp&&(o.curOp.$changeStart=void 0),(e?undo:redo)(o.cm6);let d=(l=o.curOp)===null||l===void 0?void 0:l.$changeStart;d!=null&&o.cm6.dispatch({selection:{anchor:d}})}var keys={Left:o=>runScopeHandlers(o.cm6,{key:"Left"},"editor"),Right:o=>runScopeHandlers(o.cm6,{key:"Right"},"editor"),Up:o=>runScopeHandlers(o.cm6,{key:"Up"},"editor"),Down:o=>runScopeHandlers(o.cm6,{key:"Down"},"editor"),Backspace:o=>runScopeHandlers(o.cm6,{key:"Backspace"},"editor"),Delete:o=>runScopeHandlers(o.cm6,{key:"Delete"},"editor")};class CodeMirror{openDialog(e,l,d){return openDialog(this,e,l,d)}openNotification(e,l){return openNotification(this,e,l)}constructor(e){this.state={},this.marks=Object.create(null),this.$mid=0,this.options={},this._handlers={},this.$lastChangeEndOffset=0,this.virtualSelection=null,this.cm6=e,this.onChange=this.onChange.bind(this),this.onSelectionChange=this.onSelectionChange.bind(this)}on(e,l){on(this,e,l)}off(e,l){off(this,e,l)}signal(e,l,d){signal(this,e,l,d)}indexFromPos(e){return indexFromPos(this.cm6.state.doc,e)}posFromIndex(e){return posFromIndex(this.cm6.state.doc,e)}foldCode(e){let l=this.cm6,d=l.state.selection.ranges,p=this.cm6.state.doc,b=indexFromPos(p,e),R=EditorSelection.create([EditorSelection.range(b,b)],0).ranges;l.state.selection.ranges=R,foldCode(l),l.state.selection.ranges=d}firstLine(){return 0}lastLine(){return this.cm6.state.doc.lines-1}lineCount(){return this.cm6.state.doc.lines}setCursor(e,l){typeof e=="object"&&(l=e.ch,e=e.line);var d=indexFromPos(this.cm6.state.doc,{line:e,ch:l||0});this.cm6.dispatch({selection:{anchor:d}},{scrollIntoView:!this.curOp}),this.curOp&&!this.curOp.isVimOp&&this.onBeforeEndOperation()}getCursor(e){var l=this.cm6.state.selection.main,d=e=="head"||!e?l.head:e=="anchor"?l.anchor:e=="start"?l.from:e=="end"?l.to:null;if(d==null)throw new Error("Invalid cursor type");return this.posFromIndex(d)}listSelections(){var e=this.cm6.state.doc;return this.cm6.state.selection.ranges.map(l=>({anchor:posFromIndex(e,l.anchor),head:posFromIndex(e,l.head)}))}setSelections(e,l){var d=this.cm6.state.doc,p=e.map(b=>{var R=indexFromPos(d,b.head),I=indexFromPos(d,b.anchor);return R==I?EditorSelection.cursor(R,1):EditorSelection.range(I,R)});this.cm6.dispatch({selection:EditorSelection.create(p,l)})}setSelection(e,l,d){this.setSelections([{anchor:e,head:l}],0),d&&d.origin=="*mouse"&&this.onBeforeEndOperation()}getLine(e){var l=this.cm6.state.doc;return e<0||e>=l.lines?"":this.cm6.state.doc.line(e+1).text}getLineHandle(e){return this.$lineHandleChanges||(this.$lineHandleChanges=[]),{row:e,index:this.indexFromPos(new Pos(e,0))}}getLineNumber(e){var l=this.$lineHandleChanges;if(!l)return null;for(var d=e.index,p=0;p<l.length;p++)if(d=l[p].changes.mapPos(d,1,MapMode.TrackAfter),d==null)return null;var b=this.posFromIndex(d);return b.ch==0?b.line:null}releaseLineHandles(){this.$lineHandleChanges=void 0}getRange(e,l){var d=this.cm6.state.doc;return this.cm6.state.sliceDoc(indexFromPos(d,e),indexFromPos(d,l))}replaceRange(e,l,d,p){d||(d=l);var b=this.cm6.state.doc,R=indexFromPos(b,l),I=indexFromPos(b,d);dispatchChange(this,{changes:{from:R,to:I,insert:e}})}replaceSelection(e){dispatchChange(this,this.cm6.state.replaceSelection(e))}replaceSelections(e){var l=this.cm6.state.selection.ranges,d=l.map((p,b)=>({from:p.from,to:p.to,insert:e[b]||""}));dispatchChange(this,{changes:d})}getSelection(){return this.getSelections().join(`
|
||
`)}getSelections(){var e=this.cm6;return e.state.selection.ranges.map(l=>e.state.sliceDoc(l.from,l.to))}somethingSelected(){return this.cm6.state.selection.ranges.some(e=>!e.empty)}getInputField(){return this.cm6.contentDOM}clipPos(e){var l=this.cm6.state.doc,d=e.ch,p=e.line+1;p<1&&(p=1,d=0),p>l.lines&&(p=l.lines,d=Number.MAX_VALUE);var b=l.line(p);return d=Math.min(Math.max(0,d),b.to-b.from),new Pos(p-1,d)}getValue(){return this.cm6.state.doc.toString()}setValue(e){var l=this.cm6;return l.dispatch({changes:{from:0,to:l.state.doc.length,insert:e},selection:EditorSelection.range(0,0)})}focus(){return this.cm6.focus()}blur(){return this.cm6.contentDOM.blur()}defaultTextHeight(){return this.cm6.defaultLineHeight}findMatchingBracket(e,l){var d=this.cm6.state,p=indexFromPos(d.doc,e),b=matchBrackets(d,p+1,-1);return b&&b.end?{to:posFromIndex(d.doc,b.end.from)}:(b=matchBrackets(d,p,1),b&&b.end?{to:posFromIndex(d.doc,b.end.from)}:{to:void 0})}scanForBracket(e,l,d,p){return scanForBracket(this,e,l,d,p)}indentLine(e,l){l?this.indentMore():this.indentLess()}indentMore(){indentMore(this.cm6)}indentLess(){indentLess(this.cm6)}execCommand(e){if(e=="indentAuto")CodeMirror.commands.indentAuto(this);else if(e=="goLineLeft")cursorLineBoundaryBackward(this.cm6);else if(e=="goLineRight"){cursorLineBoundaryForward(this.cm6);let l=this.cm6.state,d=l.selection.main.head;d<l.doc.length&&l.sliceDoc(d,d+1)!==`
|
||
`&&cursorCharBackward(this.cm6)}else console.log(e+" is not implemented")}setBookmark(e,l){var d=l?.insertLeft?1:-1,p=this.indexFromPos(e),b=new Marker(this,p,d);return b}addOverlay({query:e}){let l=new SearchQuery({regexp:!0,search:e.source,caseSensitive:!/i/.test(e.flags)});if(l.valid){l.forVim=!0,this.cm6Query=l;let d=setSearchQuery.of(l);return this.cm6.dispatch({effects:d}),l}}removeOverlay(e){if(!this.cm6Query)return;this.cm6Query.forVim=!1;let l=setSearchQuery.of(this.cm6Query);this.cm6.dispatch({effects:l})}getSearchCursor(e,l){var d=this,p=null,b=null,R=!1;l.ch==null&&(l.ch=Number.MAX_VALUE);var I=indexFromPos(d.cm6.state.doc,l),z=e.source.replace(/(\\.|{(?:\d+(?:,\d*)?|,\d+)})|[{}]/g,function(sn,ln){return ln||"\\"+sn});function se(sn,ln=0,un=sn.length){return new RegExpCursor(sn,z,{ignoreCase:e.ignoreCase},ln,un)}function le(sn){var ln=d.cm6.state.doc;if(sn>ln.length)return null;let un=se(ln,sn).next();return un.done?null:un.value}var tn=1e4;function an(sn,ln){var un=d.cm6.state.doc;for(let pn=1;;pn++){let yn=Math.max(sn,ln-pn*tn),_n=se(un,yn,ln),Pn=null;for(;!_n.next().done;)Pn=_n.value;if(Pn&&(yn==sn||Pn.from>yn+10))return Pn;if(yn==sn)return null}}return{findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(sn){var ln=d.cm6.state.doc;if(sn){let un=p?R?p.to-1:p.from:I;p=an(0,un)}else{let un=p?R?p.to+1:p.to:I;p=le(un)}return b=p&&{from:posFromIndex(ln,p.from),to:posFromIndex(ln,p.to),match:p.match},R=p?p.from==p.to:!1,p&&p.match},from:function(){return b?.from},to:function(){return b?.to},replace:function(sn){p&&(dispatchChange(d,{changes:{from:p.from,to:p.to,insert:sn}}),p.to=p.from+sn.length,b&&(b.to=posFromIndex(d.cm6.state.doc,p.to)))},get match(){return b&&b.match}}}findPosV(e,l,d,p){let{cm6:b}=this;const R=b.state.doc;let I=d=="page"?b.dom.clientHeight:0;const z=indexFromPos(R,e);let se=EditorSelection.cursor(z,1,void 0,p),le=Math.round(Math.abs(l));for(let an=0;an<le;an++)d=="page"?se=b.moveVertically(se,l>0,I):d=="line"&&(se=b.moveVertically(se,l>0));let tn=posFromIndex(R,se.head);return(l<0&&se.head==0&&p!=0&&e.line==0&&e.ch!=0||l>0&&se.head==R.length&&tn.ch!=p&&e.line==tn.line)&&(tn.hitSide=!0),tn}charCoords(e,l){var d=this.cm6.contentDOM.getBoundingClientRect(),p=indexFromPos(this.cm6.state.doc,e),b=this.cm6.coordsAtPos(p),R=-d.top;return{left:(b?.left||0)-d.left,top:(b?.top||0)+R,bottom:(b?.bottom||0)+R}}coordsChar(e,l){var d=this.cm6.contentDOM.getBoundingClientRect(),p=this.cm6.posAtCoords({x:e.left+d.left,y:e.top+d.top})||0;return posFromIndex(this.cm6.state.doc,p)}getScrollInfo(){var e=this.cm6.scrollDOM;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight,width:e.scrollWidth,clientHeight:e.clientHeight,clientWidth:e.clientWidth}}scrollTo(e,l){e!=null&&(this.cm6.scrollDOM.scrollLeft=e),l!=null&&(this.cm6.scrollDOM.scrollTop=l)}scrollIntoView(e,l){if(e){var d=this.indexFromPos(e);this.cm6.dispatch({effects:EditorView.scrollIntoView(d)})}else this.cm6.dispatch({scrollIntoView:!0,userEvent:"scroll"})}getWrapperElement(){return this.cm6.dom}getMode(){return{name:this.getOption("mode")}}setSize(e,l){this.cm6.dom.style.width=e+4+"px",this.cm6.dom.style.height=l+"px",this.refresh()}refresh(){this.cm6.measure()}destroy(){this.removeOverlay()}getLastEditEnd(){return this.posFromIndex(this.$lastChangeEndOffset)}onChange(e){this.$lineHandleChanges&&this.$lineHandleChanges.push(e);for(let d in this.marks)this.marks[d].update(e.changes);this.virtualSelection&&(this.virtualSelection.ranges=this.virtualSelection.ranges.map(d=>d.map(e.changes)));var l=this.curOp=this.curOp||{};e.changes.iterChanges((d,p,b,R,I)=>{(l.$changeStart==null||l.$changeStart>b)&&(l.$changeStart=b),this.$lastChangeEndOffset=R;var z={text:I.toJSON()};l.lastChange?l.lastChange.next=l.lastChange=z:l.lastChange=l.change=z},!0),l.changeHandlers||(l.changeHandlers=this._handlers.change&&this._handlers.change.slice())}onSelectionChange(){var e=this.curOp=this.curOp||{};e.cursorActivityHandlers||(e.cursorActivityHandlers=this._handlers.cursorActivity&&this._handlers.cursorActivity.slice()),this.curOp.cursorActivity=!0}operation(e,l){this.curOp||(this.curOp={$d:0}),this.curOp.$d++;try{var d=e()}finally{this.curOp&&(this.curOp.$d--,this.curOp.$d||this.onBeforeEndOperation())}return d}onBeforeEndOperation(){var e=this.curOp,l=!1;e&&(e.change&&signalTo(e.changeHandlers,this,e.change),e&&e.cursorActivity&&(signalTo(e.cursorActivityHandlers,this,null),e.isVimOp&&(l=!0)),this.curOp=null),l&&this.scrollIntoView()}moveH(e,l){if(l=="char"){var d=this.getCursor();this.setCursor(d.line,d.ch+e)}}setOption(e,l){switch(e){case"keyMap":this.state.keyMap=l;break;case"textwidth":this.state.textwidth=l;break}}getOption(e){switch(e){case"firstLineNumber":return 1;case"tabSize":return this.cm6.state.tabSize||4;case"readOnly":return this.cm6.state.readOnly;case"indentWithTabs":return this.cm6.state.facet(indentUnit)==" ";case"indentUnit":return this.cm6.state.facet(indentUnit).length||2;case"textwidth":return this.state.textwidth;case"keyMap":return this.state.keyMap||"vim"}}toggleOverwrite(e){this.state.overwrite=e}getTokenTypeAt(e){var l,d=this.indexFromPos(e),p=ensureSyntaxTree(this.cm6.state,d),b=p?.resolve(d),R=((l=b?.type)===null||l===void 0?void 0:l.name)||"";return/comment/i.test(R)?"comment":/string/i.test(R)?"string":""}overWriteSelection(e){var l=this.cm6.state.doc,d=this.cm6.state.selection,p=d.ranges.map(b=>{if(b.empty){var R=b.to<l.length?l.sliceString(b.from,b.to+1):"";if(R&&!/\n/.test(R))return EditorSelection.range(b.from,b.to+1)}return b});this.cm6.dispatch({selection:EditorSelection.create(p,d.mainIndex)}),this.replaceSelection(e)}isInMultiSelectMode(){return this.cm6.state.selection.ranges.length>1}virtualSelectionMode(){return!!this.virtualSelection}forEachSelection(e){var l=this.cm6.state.selection;this.virtualSelection=EditorSelection.create(l.ranges,l.mainIndex);for(var d=0;d<this.virtualSelection.ranges.length;d++){var p=this.virtualSelection.ranges[d];p&&(this.cm6.dispatch({selection:EditorSelection.create([p])}),e(),this.virtualSelection.ranges[d]=this.cm6.state.selection.ranges[0])}this.cm6.dispatch({selection:this.virtualSelection}),this.virtualSelection=null}hardWrap(e){return hardWrap(this,e)}}CodeMirror.isMac=typeof navigator<"u"&&/Mac/.test(navigator.platform),CodeMirror.Pos=Pos,CodeMirror.StringStream=StringStream,CodeMirror.commands={cursorCharLeft:function(o){cursorCharLeft(o.cm6)},redo:function(o){runHistoryCommand(o,!1)},undo:function(o){runHistoryCommand(o,!0)},newlineAndIndent:function(o){insertNewlineAndIndent({state:o.cm6.state,dispatch:e=>dispatchChange(o,e)})},indentAuto:function(o){indentSelection(o.cm6)},newlineAndIndentContinueComment:void 0,save:void 0},CodeMirror.isWordChar=function(o){return wordChar.test(o)},CodeMirror.keys=keys,CodeMirror.addClass=function(o,e){},CodeMirror.rmClass=function(o,e){},CodeMirror.e_preventDefault=function(o){o.preventDefault()},CodeMirror.e_stop=function(o){var e,l;(e=o?.stopPropagation)===null||e===void 0||e.call(o),(l=o?.preventDefault)===null||l===void 0||l.call(o)},CodeMirror.lookupKey=function(e,l,d){var p=CodeMirror.keys[e];!p&&/^Arrow/.test(e)&&(p=CodeMirror.keys[e.slice(5)]),p&&d(p)},CodeMirror.on=on,CodeMirror.off=off,CodeMirror.signal=signal,CodeMirror.findMatchingTag=findMatchingTag,CodeMirror.findEnclosingTag=findEnclosingTag,CodeMirror.keyName=void 0;function dialogDiv(o,e,l){var d=document.createElement("div");return d.appendChild(e),d}function closeNotification(o,e){o.state.currentNotificationClose&&o.state.currentNotificationClose(),o.state.currentNotificationClose=e}function openNotification(o,e,l){closeNotification(o,I);var d=dialogDiv(o,e,l&&l.bottom),p=!1,b,R=l&&typeof l.duration<"u"?l.duration:5e3;function I(){p||(p=!0,clearTimeout(b),d.remove(),hideDialog(o,d))}return d.onclick=function(z){z.preventDefault(),I()},showDialog(o,d),R&&(b=setTimeout(I,R)),I}function showDialog(o,e){var l=o.state.dialog;o.state.dialog=e,e.style.flex="1",e&&l!==e&&(l&&l.contains(document.activeElement)&&o.focus(),l&&l.parentElement?l.parentElement.replaceChild(e,l):l&&l.remove(),CodeMirror.signal(o,"dialog"))}function hideDialog(o,e){o.state.dialog==e&&(o.state.dialog=null,CodeMirror.signal(o,"dialog"))}function openDialog(o,e,l,d){d||(d={}),closeNotification(o,void 0);var p=dialogDiv(o,e,d.bottom),b=!1;showDialog(o,p);function R(z){if(typeof z=="string")I.value=z;else{if(b)return;b=!0,hideDialog(o,p),o.state.dialog||o.focus(),d.onClose&&d.onClose(p)}}var I=p.getElementsByTagName("input")[0];return I&&(d.value&&(I.value=d.value,d.selectValueOnOpen!==!1&&I.select()),d.onInput&&CodeMirror.on(I,"input",function(z){d.onInput(z,I.value,R)}),d.onKeyUp&&CodeMirror.on(I,"keyup",function(z){d.onKeyUp(z,I.value,R)}),CodeMirror.on(I,"keydown",function(z){d&&d.onKeyDown&&d.onKeyDown(z,I.value,R)||(z.keyCode==13&&l&&l(I.value),(z.keyCode==27||d.closeOnEnter!==!1&&z.keyCode==13)&&(I.blur(),CodeMirror.e_stop(z),R()))}),d.closeOnBlur!==!1&&CodeMirror.on(I,"blur",function(){setTimeout(function(){document.activeElement!==I&&R()})}),I.focus()),R}var matching={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function bracketRegex(o){return o&&o.bracketRegex||/[(){}[\]]/}function scanForBracket(o,e,l,d,p){for(var b=p&&p.maxScanLineLength||1e4,R=p&&p.maxScanLines||1e3,I=[],z=bracketRegex(p),se=l>0?Math.min(e.line+R,o.lastLine()+1):Math.max(o.firstLine()-1,e.line-R),le=e.line;le!=se;le+=l){var tn=o.getLine(le);if(tn){var an=l>0?0:tn.length-1,sn=l>0?tn.length:-1;if(!(tn.length>b))for(le==e.line&&(an=e.ch-(l<0?1:0));an!=sn;an+=l){var ln=tn.charAt(an);if(z.test(ln)){var un=matching[ln];if(un&&un.charAt(1)==">"==l>0)I.push(ln);else if(I.length)I.pop();else return{pos:new Pos(le,an),ch:ln}}}}}return le-l==(l>0?o.lastLine():o.firstLine())?!1:null}function findMatchingTag(o,e){return null}function findEnclosingTag(o,e){var l,d,p=o.cm6.state,b=o.indexFromPos(e);if(b<p.doc.length){var R=p.sliceDoc(b,b+1);R=="<"&&b++}for(var I=ensureSyntaxTree(p,b),z=I?.resolve(b)||null;z;){if(((l=z.firstChild)===null||l===void 0?void 0:l.type.name)=="OpenTag"&&((d=z.lastChild)===null||d===void 0?void 0:d.type.name)=="CloseTag")return{open:convertRange(p.doc,z.firstChild),close:convertRange(p.doc,z.lastChild)};z=z.parent}}function convertRange(o,e){return{from:posFromIndex(o,e.from),to:posFromIndex(o,e.to)}}class Marker{constructor(e,l,d){this.cm=e,this.id=e.$mid++,this.offset=l,this.assoc=d,e.marks[this.id]=this}clear(){delete this.cm.marks[this.id]}find(){return this.offset==null?null:this.cm.posFromIndex(this.offset)}update(e){this.offset!=null&&(this.offset=e.mapPos(this.offset,this.assoc,MapMode.TrackDel))}}function hardWrap(o,e){for(var l,d=e.column||o.getOption("textwidth")||80,p=e.allowMerge!=!1,b=Math.min(e.from,e.to),R=Math.max(e.from,e.to);b<=R;){var I=o.getLine(b);if(I.length>d){var z=ln(I,d,5);if(z){var se=(l=/^\s*/.exec(I))===null||l===void 0?void 0:l[0];o.replaceRange(`
|
||
`+se,new Pos(b,z.start),new Pos(b,z.end))}R++}else if(p&&/\S/.test(I)&&b!=R){var le=o.getLine(b+1);if(le&&/\S/.test(le)){var tn=I.replace(/\s+$/,""),an=le.replace(/^\s+/,""),sn=tn+" "+an,z=ln(sn,d,5);z&&z.start>tn.length||sn.length<d?(o.replaceRange(" ",new Pos(b,tn.length),new Pos(b+1,le.length-an.length)),b--,R--):tn.length<I.length&&o.replaceRange("",new Pos(b,tn.length),new Pos(b,I.length))}}b++}return b;function ln(un,pn,yn){if(!(un.length<pn)){var _n=un.slice(0,pn),Pn=un.slice(pn),vn=/^(?:(\s+)|(\S+)(\s+))/.exec(Pn),bn=/(?:(\s+)|(\s+)(\S+))$/.exec(_n),Sn=0,An=0;if(bn&&!bn[2]&&(Sn=pn-bn[1].length,An=pn),vn&&!vn[2]&&(Sn||(Sn=pn),An=pn+vn[1].length),Sn)return{start:Sn,end:An};if(bn&&bn[2]&&bn.index>yn)return{start:bn.index,end:bn.index+bn[2].length};if(vn&&vn[2])return Sn=pn+vn[2].length,{start:Sn,end:Sn+vn[3].length}}}}let getDrawSelectionConfig=getDrawSelectionConfig$2;class Piece{constructor(e,l,d,p,b,R,I,z,se,le){this.left=e,this.top=l,this.height=d,this.fontFamily=p,this.fontSize=b,this.fontWeight=R,this.color=I,this.className=z,this.letter=se,this.partial=le}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",e.style.height=this.height+"px",e.style.lineHeight=this.height+"px",e.style.fontFamily=this.fontFamily,e.style.fontSize=this.fontSize,e.style.fontWeight=this.fontWeight,e.style.color=this.partial?"transparent":this.color,e.className=this.className,e.textContent=this.letter}eq(e){return this.left==e.left&&this.top==e.top&&this.height==e.height&&this.fontFamily==e.fontFamily&&this.fontSize==e.fontSize&&this.fontWeight==e.fontWeight&&this.color==e.color&&this.className==e.className&&this.letter==e.letter}}class BlockCursorPlugin{constructor(e,l){this.view=e,this.rangePieces=[],this.cursors=[],this.cm=l,this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.cursorLayer=e.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className="cm-cursorLayer cm-vimCursorLayer",this.cursorLayer.setAttribute("aria-hidden","true"),e.requestMeasure(this.measureReq),this.setBlinkRate()}setBlinkRate(){let l=getDrawSelectionConfig(this.cm.cm6.state).cursorBlinkRate;this.cursorLayer.style.animationDuration=l+"ms"}update(e){(e.selectionSet||e.geometryChanged||e.viewportChanged)&&(this.view.requestMeasure(this.measureReq),this.cursorLayer.style.animationName=this.cursorLayer.style.animationName=="cm-blink"?"cm-blink2":"cm-blink"),configChanged(e)&&this.setBlinkRate()}scheduleRedraw(){this.view.requestMeasure(this.measureReq)}readPos(){let{state:e}=this.view,l=[];for(let d of e.selection.ranges){let p=d==e.selection.main,b=measureCursor(this.cm,this.view,d,p);b&&l.push(b)}return{cursors:l}}drawSel({cursors:e}){if(e.length!=this.cursors.length||e.some((l,d)=>!l.eq(this.cursors[d]))){let l=this.cursorLayer.children;if(l.length!==e.length){this.cursorLayer.textContent="";for(const d of e)this.cursorLayer.appendChild(d.draw())}else e.forEach((d,p)=>d.adjust(l[p]));this.cursors=e}}destroy(){this.cursorLayer.remove()}}function configChanged(o){return getDrawSelectionConfig(o.startState)!=getDrawSelectionConfig(o.state)}const themeSpec={".cm-vimMode .cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-fat-cursor":{position:"absolute",background:"#ff9696",border:"none",whiteSpace:"pre"},"&:not(.cm-focused) .cm-fat-cursor":{background:"none",outline:"solid 1px #ff9696",color:"transparent !important"}},hideNativeSelection=Prec.highest(EditorView.theme(themeSpec));function getBase(o){let e=o.scrollDOM.getBoundingClientRect();return{left:(o.textDirection==Direction.LTR?e.left:e.right-o.scrollDOM.clientWidth)-o.scrollDOM.scrollLeft*o.scaleX,top:e.top-o.scrollDOM.scrollTop*o.scaleY}}function measureCursor(o,e,l,d){var p,b,R,I;let z=l.head,se=!1,le=1,tn=o.state.vim;if(tn&&(!tn.insertMode||o.state.overwrite)){if(se=!0,tn.visualBlock&&!d)return null;l.anchor<l.head&&(z<e.state.doc.length&&e.state.sliceDoc(z,z+1))!=`
|
||
`&&z--,o.state.overwrite?le=.2:tn.status&&(le=.5)}if(se){let sn=z<e.state.doc.length&&e.state.sliceDoc(z,z+1);sn&&/[\uDC00-\uDFFF]/.test(sn)&&z>1&&(z--,sn=e.state.sliceDoc(z,z+1));let ln=e.coordsAtPos(z,1);if(!ln)return null;let un=getBase(e),pn=e.domAtPos(z),yn=pn?pn.node:e.contentDOM;for(yn instanceof Text&&pn.offset>=yn.data.length&&!((p=yn.parentElement)===null||p===void 0)&&p.nextSibling&&(yn=(b=yn.parentElement)===null||b===void 0?void 0:b.nextSibling,pn={node:yn,offset:0});pn&&pn.node instanceof HTMLElement;)yn=pn.node,pn={node:pn.node.childNodes[pn.offset],offset:0};if(!(yn instanceof HTMLElement)){if(!yn.parentNode)return null;yn=yn.parentNode}let _n=getComputedStyle(yn),Pn=ln.left,vn=(I=(R=e).coordsForChar)===null||I===void 0?void 0:I.call(R,z);if(vn&&(Pn=vn.left),!sn||sn==`
|
||
`||sn=="\r")sn=" ";else if(sn==" "){sn=" ";var an=e.coordsAtPos(z+1,-1);an&&(Pn=an.left-(an.left-ln.left)/parseInt(_n.tabSize))}else/[\uD800-\uDBFF]/.test(sn)&&z<e.state.doc.length-1&&(sn+=e.state.sliceDoc(z+1,z+2));let bn=ln.bottom-ln.top;return new Piece((Pn-un.left)/e.scaleX,(ln.top-un.top+bn*(1-le))/e.scaleY,bn*le/e.scaleY,_n.fontFamily,_n.fontSize,_n.fontWeight,_n.color,d?"cm-fat-cursor cm-cursor-primary":"cm-fat-cursor cm-cursor-secondary",sn,le!=1)}else return null}var FIREFOX_LINUX=typeof navigator<"u"&&/linux/i.test(navigator.platform)&&/ Gecko\/\d+/.exec(navigator.userAgent);const Vim=initVim(CodeMirror),HighlightMargin=250,vimStyle=EditorView.baseTheme({".cm-vimMode .cm-cursorLayer:not(.cm-vimCursorLayer)":{display:"none"},".cm-vim-panel":{padding:"0px 10px",fontFamily:"monospace",minHeight:"1.3em",display:"flex"},".cm-vim-panel input":{border:"none",outline:"none",backgroundColor:"inherit"},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"}}),vimPlugin=ViewPlugin.fromClass(class{constructor(o){this.status="",this.query=null,this.decorations=Decoration.none,this.waitForCopy=!1,this.lastKeydown="",this.useNextTextInput=!1,this.compositionText="",this.view=o;const e=this.cm=new CodeMirror(o);Vim.enterVimMode(this.cm),this.view.cm=this.cm,this.cm.state.vimPlugin=this,this.blockCursor=new BlockCursorPlugin(o,e),this.updateClass(),this.cm.on("vim-command-done",()=>{e.state.vim&&(e.state.vim.status=""),this.blockCursor.scheduleRedraw(),this.updateStatus()}),this.cm.on("vim-mode-change",l=>{e.state.vim&&(e.state.vim.mode=l.mode,l.subMode&&(e.state.vim.mode+=" block"),e.state.vim.status="",this.blockCursor.scheduleRedraw(),this.updateClass(),this.updateStatus())}),this.cm.on("dialog",()=>{this.cm.state.statusbar?this.updateStatus():o.dispatch({effects:showVimPanel.of(!!this.cm.state.dialog)})}),this.dom=document.createElement("span"),this.spacer=document.createElement("span"),this.spacer.style.flex="1",this.statusButton=document.createElement("span"),this.statusButton.onclick=l=>{Vim.handleKey(this.cm,"<Esc>","user"),this.cm.focus()},this.statusButton.style.cssText="cursor: pointer"}update(o){var e;if((o.viewportChanged||o.docChanged)&&this.query&&this.highlight(this.query),o.docChanged&&this.cm.onChange(o),o.selectionSet&&this.cm.onSelectionChange(),o.viewportChanged,this.cm.curOp&&!this.cm.curOp.isVimOp&&this.cm.onBeforeEndOperation(),o.transactions){for(let l of o.transactions)for(let d of l.effects)if(d.is(setSearchQuery))if(!((e=d.value)===null||e===void 0?void 0:e.forVim))this.highlight(null);else{let b=d.value.create();this.highlight(b)}}this.blockCursor.update(o)}updateClass(){const o=this.cm.state;!o.vim||o.vim.insertMode&&!o.overwrite?this.view.scrollDOM.classList.remove("cm-vimMode"):this.view.scrollDOM.classList.add("cm-vimMode")}updateStatus(){let o=this.cm.state.statusbar,e=this.cm.state.vim;if(!o||!e)return;let l=this.cm.state.dialog;if(l)l.parentElement!=o&&(o.textContent="",o.appendChild(l));else{o.textContent="";var d=(e.mode||"normal").toUpperCase();e.insertModeReturn&&(d+="(C-O)"),this.statusButton.textContent=`--${d}--`,o.appendChild(this.statusButton),o.appendChild(this.spacer)}this.dom.textContent=e.status,o.appendChild(this.dom)}destroy(){Vim.leaveVimMode(this.cm),this.updateClass(),this.blockCursor.destroy(),delete this.view.cm}highlight(o){if(this.query=o,!o)return this.decorations=Decoration.none;let{view:e}=this,l=new RangeSetBuilder;for(let d=0,p=e.visibleRanges,b=p.length;d<b;d++){let{from:R,to:I}=p[d];for(;d<b-1&&I>p[d+1].from-2*HighlightMargin;)I=p[++d].to;o.highlight(e.state,R,I,(z,se)=>{l.add(z,se,matchMark)})}return this.decorations=l.finish()}handleKey(o,e){const l=this.cm;let d=l.state.vim;if(!d)return;const p=Vim.vimKeyFromEvent(o,d);if(CodeMirror.signal(this.cm,"inputEvent",{type:"handleKey",key:p}),!p)return;if(p=="<Esc>"&&!d.insertMode&&!d.visualMode&&this.query){const I=d.searchState_;I&&(l.removeOverlay(I.getOverlay()),I.setOverlay(null))}if(p==="<C-c>"&&!CodeMirror.isMac&&l.somethingSelected())return this.waitForCopy=!0,!0;d.status=(d.status||"")+p;let R=Vim.multiSelectHandleKey(l,p,"user");return d=Vim.maybeInitVimState_(l),!R&&d.insertMode&&l.state.overwrite&&(o.key&&o.key.length==1&&!/\n/.test(o.key)?(R=!0,l.overWriteSelection(o.key)):o.key=="Backspace"&&(R=!0,CodeMirror.commands.cursorCharLeft(l))),R&&(CodeMirror.signal(this.cm,"vim-keypress",p),o.preventDefault(),o.stopPropagation(),this.blockCursor.scheduleRedraw()),this.updateStatus(),!!R}},{eventHandlers:{copy:function(o,e){this.waitForCopy&&(this.waitForCopy=!1,Promise.resolve().then(()=>{var l=this.cm,d=l.state.vim;d&&(d.insertMode?l.setSelection(l.getCursor(),l.getCursor()):l.operation(()=>{l.curOp&&(l.curOp.isVimOp=!0),Vim.handleKey(l,"<Esc>","user")}))}))},compositionstart:function(o,e){this.useNextTextInput=!0,CodeMirror.signal(this.cm,"inputEvent",o)},compositionupdate:function(o,e){CodeMirror.signal(this.cm,"inputEvent",o)},compositionend:function(o,e){CodeMirror.signal(this.cm,"inputEvent",o)},keypress:function(o,e){CodeMirror.signal(this.cm,"inputEvent",o),this.lastKeydown=="Dead"&&this.handleKey(o,e)},keydown:function(o,e){CodeMirror.signal(this.cm,"inputEvent",o),this.lastKeydown=o.key,this.lastKeydown=="Unidentified"||this.lastKeydown=="Process"||this.lastKeydown=="Dead"?this.useNextTextInput=!0:(this.useNextTextInput=!1,this.handleKey(o,e))}},provide:()=>[EditorView.inputHandler.of((o,e,l,d)=>{var p,b,R=getCM(o);if(!R)return!1;var I=(p=R.state)===null||p===void 0?void 0:p.vim,z=R.state.vimPlugin;if(I&&!I.insertMode&&!(!((b=R.curOp)===null||b===void 0)&&b.isVimOp)){if(d==="\0\0")return!0;if(CodeMirror.signal(R,"inputEvent",{type:"text",text:d,from:e,to:l}),d.length==1&&z.useNextTextInput){if(I.expectLiteralNext&&o.composing)return z.compositionText=d,!1;if(z.compositionText){var se=z.compositionText;z.compositionText="";var le=o.state.selection.main.head,tn=o.state.sliceDoc(le-se.length,le);if(se===tn){var an=R.getCursor();R.replaceRange("",R.posFromIndex(le-se.length),an)}}return z.handleKey({key:d,preventDefault:()=>{},stopPropagation:()=>{}}),forceEndComposition(o),!0}}return!1})],decorations:o=>o.decorations});function forceEndComposition(o){var e=o.scrollDOM.parentElement;if(e){if(FIREFOX_LINUX){o.contentDOM.textContent="\0\0",o.contentDOM.dispatchEvent(new CustomEvent("compositionend"));return}var l=o.scrollDOM.nextSibling,d=window.getSelection(),p=d&&{anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset};o.scrollDOM.remove(),e.insertBefore(o.scrollDOM,l);try{p&&d&&(d.setPosition(p.anchorNode,p.anchorOffset),p.focusNode&&d.extend(p.focusNode,p.focusOffset))}catch(b){console.error(b)}o.focus(),o.contentDOM.dispatchEvent(new CustomEvent("compositionend"))}}const matchMark=Decoration.mark({class:"cm-searchMatch"}),showVimPanel=StateEffect.define(),vimPanelState=StateField.define({create:()=>!1,update(o,e){for(let l of e.effects)l.is(showVimPanel)&&(o=l.value);return o},provide:o=>showPanel.from(o,e=>e?createVimPanel:null)});function createVimPanel(o){let e=document.createElement("div");e.className="cm-vim-panel";let l=o.cm;return l.state.dialog&&e.appendChild(l.state.dialog),{top:!1,dom:e}}function statusPanel$1(o){let e=document.createElement("div");e.className="cm-vim-panel";let l=o.cm;return l.state.statusbar=e,l.state.vimPlugin.updateStatus(),{dom:e}}function vim(o={}){return[vimStyle,vimPlugin,hideNativeSelection,o.status?showPanel.of(statusPanel$1):vimPanelState]}function getCM(o){return o.cm||null}class SelectedDiagnostic{constructor(e,l,d){this.from=e,this.to=l,this.diagnostic=d}}class LintState{constructor(e,l,d){this.diagnostics=e,this.panel=l,this.selected=d}static init(e,l,d){let p=e,b=d.facet(lintConfig).markerFilter;b&&(p=b(p,d));let R=e.slice().sort((tn,an)=>tn.from-an.from||tn.to-an.to),I=new RangeSetBuilder,z=[],se=0;for(let tn=0;;){let an=tn==R.length?null:R[tn];if(!an&&!z.length)break;let sn,ln;for(z.length?(sn=se,ln=z.reduce((pn,yn)=>Math.min(pn,yn.to),an&&an.from>sn?an.from:1e8)):(sn=an.from,ln=an.to,z.push(an),tn++);tn<R.length;){let pn=R[tn];if(pn.from==sn&&(pn.to>pn.from||pn.to==sn))z.push(pn),tn++,ln=Math.min(pn.to,ln);else{ln=Math.min(pn.from,ln);break}}let un=maxSeverity(z);if(z.some(pn=>pn.from==pn.to||pn.from==pn.to-1&&d.doc.lineAt(pn.from).to==pn.from))I.add(sn,sn,Decoration.widget({widget:new DiagnosticWidget(un),diagnostics:z.slice()}));else{let pn=z.reduce((yn,_n)=>_n.markClass?yn+" "+_n.markClass:yn,"");I.add(sn,ln,Decoration.mark({class:"cm-lintRange cm-lintRange-"+un+pn,diagnostics:z.slice(),inclusiveEnd:z.some(yn=>yn.to>ln)}))}se=ln;for(let pn=0;pn<z.length;pn++)z[pn].to<=se&&z.splice(pn--,1)}let le=I.finish();return new LintState(le,l,findDiagnostic(le))}}function findDiagnostic(o,e=null,l=0){let d=null;return o.between(l,1e9,(p,b,{spec:R})=>{if(!(e&&R.diagnostics.indexOf(e)<0))if(!d)d=new SelectedDiagnostic(p,b,e||R.diagnostics[0]);else{if(R.diagnostics.indexOf(d.diagnostic)<0)return!1;d=new SelectedDiagnostic(d.from,b,d.diagnostic)}}),d}function hideTooltip(o,e){let l=e.pos,d=e.end||l,p=o.state.facet(lintConfig).hideOn(o,l,d);if(p!=null)return p;let b=o.startState.doc.lineAt(e.pos);return!!(o.effects.some(R=>R.is(setDiagnosticsEffect))||o.changes.touchesRange(b.from,Math.max(b.to,d)))}function maybeEnableLint(o,e){return o.field(lintState,!1)?e:e.concat(StateEffect.appendConfig.of(lintExtensions))}const setDiagnosticsEffect=StateEffect.define(),togglePanel=StateEffect.define(),movePanelSelection=StateEffect.define(),lintState=StateField.define({create(){return new LintState(Decoration.none,null,null)},update(o,e){if(e.docChanged&&o.diagnostics.size){let l=o.diagnostics.map(e.changes),d=null,p=o.panel;if(o.selected){let b=e.changes.mapPos(o.selected.from,1);d=findDiagnostic(l,o.selected.diagnostic,b)||findDiagnostic(l,null,b)}!l.size&&p&&e.state.facet(lintConfig).autoPanel&&(p=null),o=new LintState(l,p,d)}for(let l of e.effects)if(l.is(setDiagnosticsEffect)){let d=e.state.facet(lintConfig).autoPanel?l.value.length?LintPanel.open:null:o.panel;o=LintState.init(l.value,d,e.state)}else l.is(togglePanel)?o=new LintState(o.diagnostics,l.value?LintPanel.open:null,o.selected):l.is(movePanelSelection)&&(o=new LintState(o.diagnostics,o.panel,l.value));return o},provide:o=>[showPanel.from(o,e=>e.panel),EditorView.decorations.from(o,e=>e.diagnostics)]}),activeMark=Decoration.mark({class:"cm-lintRange cm-lintRange-active"});function lintTooltip(o,e,l){let{diagnostics:d}=o.state.field(lintState),p,b=-1,R=-1;d.between(e-(l<0?1:0),e+(l>0?1:0),(z,se,{spec:le})=>{if(e>=z&&e<=se&&(z==se||(e>z||l>0)&&(e<se||l<0)))return p=le.diagnostics,b=z,R=se,!1});let I=o.state.facet(lintConfig).tooltipFilter;return p&&I&&(p=I(p,o.state)),p?{pos:b,end:R,above:o.state.doc.lineAt(b).to<R,create(){return{dom:diagnosticsTooltip(o,p)}}}:null}function diagnosticsTooltip(o,e){return crelt("ul",{class:"cm-tooltip-lint"},e.map(l=>renderDiagnostic(o,l,!1)))}const openLintPanel=o=>{let e=o.state.field(lintState,!1);(!e||!e.panel)&&o.dispatch({effects:maybeEnableLint(o.state,[togglePanel.of(!0)])});let l=getPanel(o,LintPanel.open);return l&&l.dom.querySelector(".cm-panel-lint ul").focus(),!0},closeLintPanel=o=>{let e=o.state.field(lintState,!1);return!e||!e.panel?!1:(o.dispatch({effects:togglePanel.of(!1)}),!0)},nextDiagnostic=o=>{let e=o.state.field(lintState,!1);if(!e)return!1;let l=o.state.selection.main,d=e.diagnostics.iter(l.to+1);return!d.value&&(d=e.diagnostics.iter(0),!d.value||d.from==l.from&&d.to==l.to)?!1:(o.dispatch({selection:{anchor:d.from,head:d.to},scrollIntoView:!0}),!0)},lintConfig=Facet.define({combine(o){return Object.assign({sources:o.map(e=>e.source).filter(e=>e!=null)},combineConfig(o.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,l)=>e?l?d=>e(d)||l(d):e:l}))}});function assignKeys(o){let e=[];if(o)e:for(let{name:l}of o){for(let d=0;d<l.length;d++){let p=l[d];if(/[a-zA-Z]/.test(p)&&!e.some(b=>b.toLowerCase()==p.toLowerCase())){e.push(p);continue e}}e.push("")}return e}function renderDiagnostic(o,e,l){var d;let p=l?assignKeys(e.actions):[];return crelt("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},crelt("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(o):e.message),(d=e.actions)===null||d===void 0?void 0:d.map((b,R)=>{let I=!1,z=an=>{if(an.preventDefault(),I)return;I=!0;let sn=findDiagnostic(o.state.field(lintState).diagnostics,e);sn&&b.apply(o,sn.from,sn.to)},{name:se}=b,le=p[R]?se.indexOf(p[R]):-1,tn=le<0?se:[se.slice(0,le),crelt("u",se.slice(le,le+1)),se.slice(le+1)];return crelt("button",{type:"button",class:"cm-diagnosticAction",onclick:z,onmousedown:z,"aria-label":` Action: ${se}${le<0?"":` (access key "${p[R]})"`}.`},tn)}),e.source&&crelt("div",{class:"cm-diagnosticSource"},e.source))}class DiagnosticWidget extends WidgetType{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return crelt("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class PanelItem{constructor(e,l){this.diagnostic=l,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=renderDiagnostic(e,l,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class LintPanel{constructor(e){this.view=e,this.items=[];let l=p=>{if(p.keyCode==27)closeLintPanel(this.view),this.view.focus();else if(p.keyCode==38||p.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(p.keyCode==40||p.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(p.keyCode==36)this.moveSelection(0);else if(p.keyCode==35)this.moveSelection(this.items.length-1);else if(p.keyCode==13)this.view.focus();else if(p.keyCode>=65&&p.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:b}=this.items[this.selectedIndex],R=assignKeys(b.actions);for(let I=0;I<R.length;I++)if(R[I].toUpperCase().charCodeAt(0)==p.keyCode){let z=findDiagnostic(this.view.state.field(lintState).diagnostics,b);z&&b.actions[I].apply(e,z.from,z.to)}}else return;p.preventDefault()},d=p=>{for(let b=0;b<this.items.length;b++)this.items[b].dom.contains(p.target)&&this.moveSelection(b)};this.list=crelt("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:l,onclick:d}),this.dom=crelt("div",{class:"cm-panel-lint"},this.list,crelt("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>closeLintPanel(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(lintState).selected;if(!e)return-1;for(let l=0;l<this.items.length;l++)if(this.items[l].diagnostic==e.diagnostic)return l;return-1}update(){let{diagnostics:e,selected:l}=this.view.state.field(lintState),d=0,p=!1,b=null,R=new Set;for(e.between(0,this.view.state.doc.length,(I,z,{spec:se})=>{for(let le of se.diagnostics){if(R.has(le))continue;R.add(le);let tn=-1,an;for(let sn=d;sn<this.items.length;sn++)if(this.items[sn].diagnostic==le){tn=sn;break}tn<0?(an=new PanelItem(this.view,le),this.items.splice(d,0,an),p=!0):(an=this.items[tn],tn>d&&(this.items.splice(d,tn-d),p=!0)),l&&an.diagnostic==l.diagnostic?an.dom.hasAttribute("aria-selected")||(an.dom.setAttribute("aria-selected","true"),b=an):an.dom.hasAttribute("aria-selected")&&an.dom.removeAttribute("aria-selected"),d++}});d<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)p=!0,this.items.pop();this.items.length==0&&(this.items.push(new PanelItem(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),p=!0),b?(this.list.setAttribute("aria-activedescendant",b.id),this.view.requestMeasure({key:this,read:()=>({sel:b.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:I,panel:z})=>{let se=z.height/this.list.offsetHeight;I.top<z.top?this.list.scrollTop-=(z.top-I.top)/se:I.bottom>z.bottom&&(this.list.scrollTop+=(I.bottom-z.bottom)/se)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),p&&this.sync()}sync(){let e=this.list.firstChild;function l(){let d=e;e=d.nextSibling,d.remove()}for(let d of this.items)if(d.dom.parentNode==this.list){for(;e!=d.dom;)l();e=d.dom.nextSibling}else this.list.insertBefore(d.dom,e);for(;e;)l()}moveSelection(e){if(this.selectedIndex<0)return;let l=this.view.state.field(lintState),d=findDiagnostic(l.diagnostics,this.items[e].diagnostic);d&&this.view.dispatch({selection:{anchor:d.from,head:d.to},scrollIntoView:!0,effects:movePanelSelection.of(d)})}static open(e){return new LintPanel(e)}}function svg(o,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(o)}</svg>')`}function underline(o){return svg(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${o}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const baseTheme=EditorView.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:underline("#d11")},".cm-lintRange-warning":{backgroundImage:underline("orange")},".cm-lintRange-info":{backgroundImage:underline("#999")},".cm-lintRange-hint":{backgroundImage:underline("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function severityWeight(o){return o=="error"?4:o=="warning"?3:o=="info"?2:1}function maxSeverity(o){let e="hint",l=1;for(let d of o){let p=severityWeight(d.severity);p>l&&(l=p,e=d.severity)}return e}const lintExtensions=[lintState,EditorView.decorations.compute([lintState],o=>{let{selected:e,panel:l}=o.field(lintState);return!e||!l||e.from==e.to?Decoration.none:Decoration.set([activeMark.range(e.from,e.to)])}),hoverTooltip(lintTooltip,{hideOn:hideTooltip}),baseTheme],createAddCursor=o=>e=>{const l=o==="down";let d=e.state.selection;for(const p of d.ranges)d=d.addRange(e.moveVertically(p,l));return e.dispatch({selection:d}),!0},addCursorUp=createAddCursor("up"),addCursorDown=createAddCursor("down"),addCursorAtEachSelectionLine=o=>{let e=null;for(const l of o.state.selection.ranges)if(!l.empty)for(let d=l.from;d<=l.to;){const p=o.state.doc.lineAt(d),b=Math.min(p.to,l.to);e?e=e.addRange(EditorSelection.range(b,b)):e=EditorSelection.single(b),d=p.to+1}return e?(o.dispatch({selection:e}),!0):!1},vscodeKeymap=[{key:"Ctrl-Space",run:startCompletion},{key:"Escape",run:closeCompletion},{key:"ArrowDown",run:moveCompletionSelection(!0)},{key:"ArrowUp",run:moveCompletionSelection(!1)},{key:"PageDown",run:moveCompletionSelection(!0,"page")},{key:"PageUp",run:moveCompletionSelection(!1,"page")},{key:"Enter",run:acceptCompletion},{key:"Tab",run:acceptCompletion},{key:"Mod-f",run:openSearchPanel,scope:"editor search-panel"},{key:"Escape",run:closeSearchPanel,scope:"editor search-panel"},{key:"Alt-Enter",run:selectMatches,scope:"editor search-panel"},{key:"Mod-Alt-Enter",run:replaceAll,scope:"editor search-panel"},{key:"Ctrl-g",run:gotoLine},{key:"Mod-d",run:selectNextOccurrence,preventDefault:!0},{key:"Shift-Mod-l",run:selectSelectionMatches},{key:"Enter",run:insertNewlineAndIndent,shift:insertNewlineAndIndent},{key:"ArrowLeft",run:cursorCharLeft,shift:selectCharLeft,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:cursorGroupLeft,shift:selectGroupLeft},{key:"ArrowRight",run:cursorCharRight,shift:selectCharRight,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:cursorGroupRight,shift:selectGroupRight},{key:"ArrowUp",run:cursorLineUp,shift:selectLineUp,preventDefault:!0},{key:"ArrowDown",run:cursorLineDown,shift:selectLineDown,preventDefault:!0},{key:"Home",run:cursorLineBoundaryBackward,shift:selectLineBoundaryBackward},{mac:"Cmd-ArrowLeft",run:cursorLineBoundaryBackward,shift:selectLineBoundaryBackward},{key:"Mod-Home",run:cursorDocStart,shift:selectDocStart},{mac:"Cmd-ArrowUp",run:cursorDocStart,shift:selectDocStart},{key:"PageUp",run:cursorPageUp,shift:selectPageUp},{mac:"Ctrl-ArrowUp",run:cursorPageUp,shift:selectPageUp},{key:"PageDown",run:cursorPageDown,shift:selectPageDown},{mac:"Ctrl-ArrowDown",run:cursorPageDown,shift:selectPageDown},{key:"End",run:cursorLineBoundaryForward,shift:selectLineBoundaryForward},{mac:"Cmd-ArrowRight",run:cursorLineBoundaryForward,shift:selectLineBoundaryForward},{key:"Mod-Alt-ArrowUp",linux:"Shift-Alt-ArrowUp",run:addCursorUp,preventDefault:!0},{key:"Mod-Alt-ArrowDown",linux:"Shift-Alt-ArrowDown",run:addCursorDown,preventDefault:!0},{key:"Shift-Alt-i",run:addCursorAtEachSelectionLine},{key:"Mod-End",run:cursorDocEnd,shift:selectDocEnd},{mac:"Cmd-ArrowDown",run:cursorDocEnd,shift:selectDocEnd},{key:"Mod-a",run:selectAll},{key:"Backspace",run:deleteBracketPair},{key:"Backspace",run:deleteCharBackward,shift:deleteCharBackward},{key:"Delete",run:deleteCharForward},{key:"Mod-Backspace",mac:"Alt-Backspace",run:deleteGroupBackward},{key:"Mod-Delete",mac:"Alt-Delete",run:deleteGroupForward},{mac:"Mod-Backspace",run:deleteToLineStart},{mac:"Mod-Delete",run:deleteToLineEnd},{mac:"Ctrl-b",run:cursorCharLeft,shift:selectCharLeft,preventDefault:!0},{mac:"Ctrl-f",run:cursorCharRight,shift:selectCharRight},{mac:"Ctrl-p",run:cursorLineUp,shift:selectLineUp},{mac:"Ctrl-n",run:cursorLineDown,shift:selectLineDown},{mac:"Ctrl-a",run:cursorLineStart,shift:selectLineStart},{mac:"Ctrl-e",run:cursorLineEnd,shift:selectLineEnd},{mac:"Ctrl-d",run:deleteCharForward},{mac:"Ctrl-h",run:deleteCharBackward},{mac:"Ctrl-k",run:deleteToLineEnd},{mac:"Ctrl-Alt-h",run:deleteGroupBackward},{mac:"Ctrl-o",run:splitLine},{mac:"Ctrl-t",run:transposeChars},{mac:"Ctrl-v",run:cursorPageDown},{mac:"Alt-v",run:cursorPageUp},{key:"Shift-Mod-k",run:deleteLine},{key:"Alt-ArrowDown",run:moveLineDown},{key:"Alt-ArrowUp",run:moveLineUp},{win:"Shift-Alt-ArrowDown",mac:"Shift-Alt-ArrowDown",run:copyLineDown},{win:"Shift-Alt-ArrowUp",mac:"Shift-Alt-ArrowUp",run:copyLineUp},{key:"Mod-l",run:selectLine,preventDefault:!0},{key:"Shift-Mod-\\",run:cursorMatchingBracket},{key:"Tab",run:indentMore,shift:indentLess,preventDefault:!0},{key:"Mod-[",run:indentLess},{key:"Mod-]",run:indentMore},{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:foldCode},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:unfoldCode},{key:"Mod-k Mod-0",run:foldAll},{key:"Mod-k Mod-j",run:unfoldAll},{key:"Mod-k Mod-c",run:lineComment},{key:"Mod-k Mod-u",run:lineUncomment},{key:"Mod-/",run:toggleComment},{key:"Shift-Alt-a",run:toggleBlockComment},{key:"Mod-z",run:undo,preventDefault:!0},{key:"Mod-y",run:redo,preventDefault:!0},{key:"Mod-Shift-z",run:redo,preventDefault:!0},{key:"Mod-u",run:undoSelection,preventDefault:!0},{key:"Mod-Shift-m",run:openLintPanel},{key:"F8",run:nextDiagnostic}];var modeEffect=StateEffect.define(),modeField=StateField.define({create(){return{type:0,minor:2}},update(o,e){for(const l of e.effects)l.is(modeEffect)&&(o=l.value);return o}});function resetMode(o,e){return modeEffect.of({type:o.type,minor:o.minor,...e})}function overwriteMode(o,e){return modeEffect.of({...o,...e})}function sameMode(o,e){return o.type===e.type&&o.minor===e.minor}function sameModeState(o,e){return sameMode(o,e)&&o.count===e.count&&o.register===e.register&&o.expecting===e.expecting}function modeStatus(o){let e="";return o.type!==1&&(o.count&&(e+=o.count),e+=minorModeStr(o.minor)),o.expecting&&(e+=o.expecting.minor),e}function minorModeStr(o){switch(o){case 2:return"";case 3:return"g";case 5:return"m";case 6:return"<space>";case 7:return"[";case 8:return"]"}}var yankEffect=StateEffect.define();function readRegister(o,e){switch(e){case"#":return o.selection.ranges.map((l,d)=>String(d+1));case"_":return[];case".":return o.selection.ranges.map(l=>o.sliceDoc(l.from,l.to));case"%":{const l=o.facet(pathRegister);return l!=null?[l]:[]}default:return o.field(registersField)[e??'"']}}async function readClipboard(o){const e=readRegister(o,"+"),l=await navigator.clipboard.readText();return e?.map(d=>d.toString()).join(`
|
||
`)===l?e:[l]}var registersField=StateField.define({create(){return{}},update(o,e){for(const l of e.effects)if(l.is(yankEffect)){if(!Array.isArray(l.value)){o=l.value.reset.values;continue}const[d]=l.value;let[,p]=l.value;switch(d){case"_":case"%":case".":case"#":return o;case":":{p=p.length?[p[0]]:[];break}case"+":{navigator.clipboard.writeText(p.map(b=>b.toString()).join(`
|
||
`));break}}if(p.length===0){const{[d]:b,...R}=o;o=R}else o={...o,[d]:p}}return o}}),registersHistoryField=StateField.define({create(){return{}},update(o,e){for(const l of e.effects)if(l.is(yankEffect)){if(!Array.isArray(l.value)){o=l.value.reset.history;continue}const[d]=l.value;let[,p]=l.value;switch(d){case":":{p=p.length?[p[0]]:[];break}case"/":break;default:continue}if(p.length===0)continue;const{[d]:b,...R}=o;o={[d]:[...b??[],p[0]],...R}}return o}}),historyEffect=StateEffect.define(),historyField=StateField.define({create(){return{checkpoints:[],cursor:-1,pending:null,head:null}},update(o,e){for(const l of e.effects)if(l.is(historyEffect)){const d=l.value;switch(d.type){case"move":{const p=o.cursor+d.offset;o={checkpoints:o.checkpoints,pending:null,cursor:p,head:o.head??d.head??null};break}case"add":{const p=o.cursor===-1?o.checkpoints:o.checkpoints.slice(o.cursor+1);o=d.temp?{checkpoints:o.checkpoints,cursor:o.cursor,pending:d.state,head:o.head}:{checkpoints:[d.state,...p],cursor:-1,pending:null,head:null};break}case"commit":{if(d.state.doc.eq(o.pending.doc)){o={...o,pending:null};break}const p=o.cursor===-1?o.checkpoints:o.checkpoints.slice(o.cursor+1);o={checkpoints:[o.pending,...p],cursor:-1,pending:null,head:null};break}}}return o}}),syntaxHistoryEffect=StateEffect.define(),syntaxHistoryField=StateField.define({create(){return{selections:[],cursor:0,head:null,frozen:!1}},update(o,e){for(const l of e.effects)if(l.is(syntaxHistoryEffect))switch(l.value.type){case"freeze":{o={...o,frozen:l.value.frozen??!0};break}case"add":{o={selections:[...o.selections,l.value.prev],cursor:o.cursor+1,head:l.value.next,frozen:!1};break}case"move":{o={...o,cursor:o.cursor+l.value.offset};break}case"reset":o.frozen||(o={frozen:!1,selections:[],cursor:0,head:null})}return o}});function expandSyntaxHistory(o,e,l){const d=o.field(syntaxHistoryField);if(d.cursor<d.selections.length){l({selection:d.cursor===d.selections.length-1?d.head:d.selections[d.cursor+1],effects:syntaxHistoryEffect.of({type:"move",offset:1})});return}e({effects:syntaxHistoryEffect.of({type:"freeze"})},p=>{l(p.selection?.eq(o.selection)?{effects:syntaxHistoryEffect.of({type:"freeze",frozen:!1})}:{selection:p.selection,changes:p.changes,scrollIntoView:p.scrollIntoView,effects:[...p.effects,syntaxHistoryEffect.of({type:"add",prev:o.selection,next:p.newSelection})]})})}function undoSyntaxHistory(o){const e=o.field(syntaxHistoryField);if(e.cursor>0)return{selection:e.selections[e.cursor-1],effects:syntaxHistoryEffect.of({type:"move",offset:-1})}}var themeCompartment=new Compartment,themeEffect=StateEffect.define(),themeField=StateField.define({create(){return{}},update(o,e){for(const l of e.effects)l.is(themeEffect)&&(o={...o,current:l.value});return o}}),MOUNT_EVENT="cm-hx-input-mounted",panelStyles=EditorView.theme({".cm-hx-status-panel":{display:"flex","justify-content":"space-between","font-family":"monospace"},".cm-hx-command-panel":{fontFamily:"monospace",minHeight:"18px",background:"inherit"},".cm-hx-command-panel-flex":{display:"flex",justifyContent:"space-between",background:"inherit"},".cm-hx-command-input":{"flex-grow":100,fontFamily:"monospace",fontSize:"inherit",border:"none",outline:"none",padding:"0",margin:"0",background:"inherit",color:"inherit"},".cm-hx-command-autocomplete":{display:"grid","grid-template-columns":"repeat(auto-fill, minmax(10em, 1fr))",gap:"1px 0px"},".cm-hx-command-popup-wrapper":{width:"100%",background:"inherit",position:"relative"},".cm-hx-command-popup":{position:"absolute",background:"inherit",width:"inherit"},".cm-hx-command-help":{border:"1px solid #777","line-height":"1.5",background:"inherit",padding:"4px 8px",whiteSpace:"preserve"}}),panelTheme={light:EditorView.theme({".cm-hx-selected-option":{background:"#ccc"}}),dark:EditorView.theme({".cm-hx-selected-option":{background:"#777"}})},CommandPanel=class{constructor(o,e,l){this.view=o,this.commandFacet=e,this.startSearch=l,this.dom=$el("div");const d=$el("div");d.classList.add("cm-hx-command-popup-wrapper");const p=$el("div");p.classList.add("cm-hx-command-panel-flex"),this.minorCommand=$el("span"),this.inputContainer=$el("span"),this.commandPopup=$el("div"),d.append(this.commandPopup),p.append(this.inputContainer),p.append(this.minorCommand),this.dom.append(p),this.dom.append(d),this.dom.classList.add("cm-hx-command-panel"),$style(this.inputContainer,{visibility:"hidden",flexGrow:"1",display:"flex"}),this.label=$el("span"),this.inputContainer.append(this.label),this.commandPopup.classList.add("cm-hx-command-popup"),this.help=$el("div"),this.autocomplete=$el("div"),this.help.hidden=!0,this.help.classList.add("cm-hx-command-help"),this.autocomplete.classList.add("cm-hx-command-autocomplete"),this.commandPopup.append(this.help),this.commandPopup.append(this.autocomplete),$style(this.minorCommand,{minWidth:"8em",textAlign:"center "})}dom;minorCommand;inputContainer;label;message=!1;commandPopup;autocomplete;help;popupRequest;showSearchInput(o=0){const e=this.searchInput(o);this.showInput(e,o===1?"global-search:":"search:")}showCommandInput(){const o=this.commandInput();this.showInput(o,":")}showMinor(o){this.minorCommand.textContent=modeStatus(o)}showInput(o,e){this.label.textContent=e,$style(this.label,{color:""}),this.inputContainer.append(o),$style(this.inputContainer,{visibility:""}),o.dispatchEvent(new Event(MOUNT_EVENT)),o.focus()}createInput({onInput:o,onClose:e,placeholder:l,onKeyDown:d,getPopup:p,getHistory:b,accept:R}){const I=$el("input");let z,se,le=-1;d&&I.addEventListener("keydown",d),I.addEventListener(MOUNT_EVENT,()=>{z=p(I.value),this.showPopup(z.options,z.help,void 0)}),l&&(I.placeholder=l),I.classList.add("cm-hx-command-input"),I.type="text";let tn=!0;return I.addEventListener("blur",()=>{tn&&(this.hidePopup(),se=void 0,e(!1,I.value))}),I.addEventListener("input",()=>{se=void 0,z=p(I.value),this.showPopup(z.options,z.help,void 0),o(I.value)}),I.addEventListener("keydown",an=>{if(an.isComposing)return;const sn=an.key==="Enter";if(sn||an.key==="Escape")tn=!1,this.hidePopup(),se=void 0,e(sn,I.value);else if(an.key==="Tab"&&z?.options.length){an.preventDefault();const ln=!an.shiftKey,un=se;if(se!=null?se=(se+(ln?1:-1)+z.options.length)%z.options.length:se=ln?0:z.options.length-1,un!==se){const pn=z.options[se];z={...p(pn),options:z.options},this.showPopup(z.options,z.help,se),I.value=R?.(pn)??pn}o(I.value)}else if(an.key==="ArrowUp"||an.key==="ArrowDown"){an.preventDefault();const ln=b()??[],un=le+(an.key==="ArrowUp"?1:-1);if(un>=0&&un<ln.length){le=un;const pn=ln[ln.length-1-le].toString();z=p(pn),this.showPopup(z.options,z.help,se),I.value=pn,I.selectionStart=pn.length}}}),I}commandInput(){const{view:o}=this,e=o.state.selection,l=o.scrollSnapshot(),d=R=>/^\d+$/.test(R);let p=!1;const b=this.createInput({placeholder:readRegister(o.state,":")?.at(0)?.toString(),getHistory:()=>this.view.state.field(registersHistoryField)[":"],onKeyDown(R){if(!R.isComposing){if(R.key==="r"&&R.ctrlKey)p=!0;else if(p&&R.key==="Escape")p=!1;else if(p&&R.key.length===1)p=!1,b.value+=readRegister(o.state,R.key)?.at(0)?.toString()??"";else if(!p)return;R.stopPropagation(),R.preventDefault()}},onClose:(R,I)=>{R&&I?o.dispatch({effects:yankEffect.of([":",[I]])}):R&&(I=readRegister(o.state,":")?.at(0)?.toString()??"");const[z,...se]=I.trimEnd().split(/ +/);if(R&&z){const tn=o.state.facet(this.commandFacet).find(sn=>sn.name===z||sn.aliases?.some(ln=>ln===z)),an=tn?tn.handler(o,se):{message:`no such command: '${z}'`,error:!0};if(an){this.showMessageAndCloseInput(an);return}}else!R&&d(z)&&(o.dispatch({selection:e}),setTimeout(()=>{o.dispatch({effects:l})}));this.closeInput()},onInput:R=>{const z=R.split(/ +/).at(0);if(z&&d(z)){const se=Number(z);if(se>=1&&se<=o.state.doc.lines){const le=o.state.doc.line(se);o.dispatch({selection:EditorSelection.cursor(le.from),effects:EditorView.scrollIntoView(le.from,{y:"center"})})}return}},getPopup:R=>{const I=R.split(/ +/),z=I.at(0);if(z==null)return{options:[]};const le=o.state.facet(this.commandFacet).filter(ln=>ln.name.startsWith(z)||ln.aliases?.some(un=>un.startsWith(z))),tn=le.find(ln=>ln.name===z||ln.aliases?.includes(z));function an(ln){let un="";return ln&&(un=`${ln.help}`,ln.aliases&&ln.aliases.length>0&&(un+=`
|
||
Aliases: ${ln.aliases.join(", ")}`)),un}const sn=tn!=null?an(tn):void 0;return I[1]!=null&&tn&&tn.autocomplete?{options:tn.autocomplete(I.slice(1)),help:sn}:{options:le.map(ln=>ln.name),help:sn}},accept(R){const I=b.value.split(/ +/).at(-1);if(I!=null)return b.value.slice(0,b.value.length-I.length)+`${R}`}});return b}showError(o){this.showMessage({message:o,error:!0})}showMessage(o){if(o==null)return;const[e,l]=typeof o=="string"?[o,!1]:[o.message,o.error];$style(this.inputContainer,{visibility:""}),this.message=!0,$style(this.label,{color:l?"red":""}),this.label.textContent=e}showMessageAndCloseInput(o){this.showMessage(o),this.closeInput(!o)}hasMessage(){return this.message}clearMessage(){this.message&&(this.message=!1,this.label.textContent="",$style(this.inputContainer,{visibility:"hidden"}))}showPopup(o,e,l){if(o.length===0){this.hidePopup();return}for(this.commandPopup.hidden=!1,this.help.hidden=!e,this.help.textContent=e??"";o.length>this.autocomplete.childNodes.length;){const p=$el("span");$style(p,{marginRight:"1em"}),this.autocomplete.append(p)}for(const[p,b]of this.autocomplete.childNodes.entries()){const R=o[p];if(R)b.textContent=R,b.style.order="";else break}for(;this.autocomplete.childNodes.length>o.length;)this.autocomplete.lastChild?.remove();this.autocomplete.querySelector(".cm-hx-selected-option")?.classList.remove("cm-hx-selected-option"),l!=null&&this.autocomplete.children[l].classList.add("cm-hx-selected-option"),this.popupRequest==null&&(this.popupRequest=requestAnimationFrame(()=>this.positionPopup()))}hidePopup(){this.commandPopup.hidden=!0}positionPopup(){if(this.popupRequest=void 0,this.commandPopup.hidden)return;const o=this.inputContainer.getBoundingClientRect(),e=this.commandPopup.parentElement.getBoundingClientRect();$style(this.commandPopup,{bottom:`${e.top-o.top}px`,left:"0px"});let l=-1;const d=this.autocomplete.children.item(0).getBoundingClientRect().x;for(let R=1;R<this.autocomplete.children.length;R++)if(this.autocomplete.children.item(R).getBoundingClientRect().x===d){l=R;break}const p=l<0?1:l;let b=0;for(let R=0;R<p;R++)for(let I=R;I<this.autocomplete.children.length;I+=p)this.autocomplete.children.item(b).style.order=String(I),b++}searchInput(o){const e=this.startSearch(o);return this.createInput({placeholder:e.init,getHistory:()=>this.view.state.field(registersHistoryField)["/"],onClose:l=>{this.showMessageAndCloseInput(e.onClose(l))},onInput:l=>{e.onInput(l)},getPopup:l=>{const p=(this.view.state.field(registersHistoryField)["/"]??[]).flatMap(b=>{const R=b.toString();return R.startsWith(l)?[R]:[]});return p.sort(),{options:p}}})}closeInput(o=!0){this.inputContainer.removeChild(this.inputContainer.lastChild),o&&$style(this.inputContainer,{visibility:"hidden"}),requestAnimationFrame(()=>{this.view.focus()})}};function statusPanel(o){const e=$el("div");e.classList.add("cm-hx-status-panel");const l=$el("span");l.textContent="NOR",e.append(l);const d=$el("span");e.append(d);const p=$el("span");e.append(p);function b(){const{line:R,column:I}=lineCol(o);p.textContent=`${R}:${I}`}return b(),{dom:e,setMode(R,I){l.textContent=R,d.textContent=I?`reg=${I}`:""},setLineCol:b}}function lineCol(o){const e=o.state.selection.main.head,l=o.state.doc.lineAt(e),d=l.number,p=e-l.from+1;return{line:d,column:p}}function $el(o){return document.createElement(o)}function $style(o,e){Object.assign(o.style,e)}var MODE_EFF={NORMAL:modeEffect.of({type:0,minor:2}),SELECT:modeEffect.of({type:4,minor:2}),INSERT:modeEffect.of({type:1})};function moveByChar(o,e,l){const p=e.type===4?selectByChar(o,e,l):cursorByChar(o,e,l);return o.state.selection.eq(p)?!1:(o.dispatch({selection:p,effects:resetCount(e),scrollIntoView:!0}),!0)}function withHelixSelection(o,e){o.dispatch({selection:mapSel(o.state.selection,d=>cmSelToInternal(d,o.state.doc))});const l=e(o);return o.dispatch({selection:mapSel(o.state.selection,d=>internalSelToCM(d,o.state.doc))}),l}function cmSelToInternal(o,e){if(o.empty)return o;const l=nextClusterBreak(e,o.to,!1),[d,p]=rangeIsForward(o)?[o.from,l]:[l,o.from];return EditorSelection.range(d,p,o.goalColumn,o.bidiLevel??void 0)}function removeText(o,{yank:e,edit:l}={}){const d=[];e??=!0,e&&d.push(yankEffect.of(['"',o.state.selection.ranges.map(p=>o.state.doc.slice(p.from,p.to))])),l&&d.push(MODE_EFF.INSERT),o.dispatch({effects:d,changes:o.state.selection.ranges.map(p=>({from:p.from,to:p.to,insert:""}))}),!l&&o.state.selection.ranges.some(p=>p.empty)&&o.dispatch({selection:mapSel(o.state.selection,p=>internalSelToCM(p,o.state.doc))})}function internalSelToCM(o,e){const l=nextClusterBreak(e,o.to,!0),[d,p]=rangeIsForward(o)?[o.from,l]:[l,o.from];return EditorSelection.range(d,p,o.goalColumn,o.bidiLevel??void 0)}function cursorToLineStart(o,e){const l=e.type===0;withHelixSelection(o,d=>l?cursorLineStart(d):selectLineStart(d)),o.dispatch({effects:l?MODE_EFF.NORMAL:MODE_EFF.SELECT})}function cursorToLineEndRange(o,e,l){const d=cmSelToInternal(o,e.state.doc),p=e.state.doc.lineAt(d.head);if(p.length===0)return d;const b=l===1?p.to:nextClusterBreak(e.state.doc,p.to,!1);return l===4?EditorSelection.range(d.anchor,b,d.goalColumn):EditorSelection.cursor(b,void 0,void 0,d.goalColumn)}function cursorToLineEnd(o,e,l){const d=e.type===4;return o.dispatch({selection:mapSel(o.state.selection,p=>{const b=cursorToLineEndRange(p,o,l?1:e.type);return l?b:internalSelToCM(b,o.state.doc)}),effects:l?MODE_EFF.INSERT:d?MODE_EFF.SELECT:MODE_EFF.NORMAL}),!0}function cursorByChar(o,e,l){const d=o.state.doc,p=cmdCount(e);return mapSel(o.state.selection,b=>{let R=p;const I=p>1?()=>()=>(R--,R>0):void 0,z=cmSelToInternal(b,d).head,se=o.moveByChar(EditorSelection.cursor(z),l,I);return internalSelToCM(EditorSelection.cursor(se.head),d)})}function selectByChar(o,e,l){const d=o.state.doc,p=cmdCount(e);return mapSel(o.state.selection,b=>{const R=cmSelToInternal(b,d);let I=p;const z=p>1?()=>()=>(I--,I>0):void 0,se=o.moveByChar(EditorSelection.cursor(R.head),l,z);return internalSelToCM(EditorSelection.range(R.anchor,se.head),d)})}function selectByLine(o,e,l){const d=o.state.doc,p=cmdCount(e);return mapSel(o.state.selection,b=>{const R=cmSelToInternal(b,d);let I=R;for(let z=0;z<p;z++)I=o.moveVertically(EditorSelection.cursor(I.head,void 0,void 0,I.goalColumn),l);return internalSelToCM(EditorSelection.range(R.anchor,I.head,I.goalColumn),d)})}function cursorByLine(o,e,l){const d=o.state.doc,p=cmdCount(e);return mapSel(o.state.selection,b=>{const R=cmSelToInternal(b,d);let I=R.head,z=R.goalColumn;for(let se=0;se<p;se++){const le=d.lineAt(I).number;if(l&&le===d.lines||!l&&le===1)break;const tn=o.moveVertically(EditorSelection.cursor(I,void 0,void 0,z),l);I=tn.to,z=tn.goalColumn}return internalSelToCM(EditorSelection.cursor(I,void 0,void 0,z),d)})}function moveByHalfPage(o,e,l){const p=e.type===4?selectByHalfPage(o,l):cursorByHalfPage(o,l);if(p.eq(o.state.selection))return!1;o.dispatch({selection:p,scrollIntoView:!0})}function cursorByHalfPage(o,e){return mapSel(o.state.selection,l=>{const d=o.state.doc,p=cmSelToInternal(l,d),b=o.lineBlockAt(d.lineAt(p.head).from),R=o.lineBlockAt(e?d.length:0),I=Math.min(o.scrollDOM.clientHeight/2,Math.abs(b.top-R.top));if(I<1)return l;const z=o.moveVertically(EditorSelection.cursor(p.head,void 0,void 0,p.goalColumn),e,I);return internalSelToCM(z,d)})}function selectByHalfPage(o,e){return mapSel(o.state.selection,l=>{const d=o.state.doc,p=cmSelToInternal(l,d),b=o.lineBlockAt(d.lineAt(p.head).from),R=o.lineBlockAt(e?d.length:0),I=Math.min(o.scrollDOM.clientHeight/2,Math.abs(b.top-R.top));if(I<1)return l;const z=o.moveVertically(EditorSelection.cursor(p.head,void 0,void 0,p.goalColumn),e,I);return internalSelToCM(EditorSelection.range(p.anchor,z.head,z.goalColumn),d)})}function moveByLine(o,e,l){const p=e.type===4?selectByLine(o,e,l):cursorByLine(o,e,l);return o.state.selection.eq(p)?!1:(o.dispatch({selection:p,effects:resetCount(e),scrollIntoView:!0}),!0)}function moveDown(o,e){return moveByLine(o,e,!0)}function moveUp(o,e){return moveByLine(o,e,!1)}function moveLeft(o,e){moveByChar(o,e,!1)}function moveRight(o,e){moveByChar(o,e,!0)}function setFindMode(o,e,l,d){const p=modeEffect.of({type:l.type,minor:2,count:l.count,expecting:{minor:e,callback:findText,metadata:d}});o.dispatch({effects:p})}function findText(o,e,{inclusive:l,forward:d}){const p=o.state.field(modeField),b=p.type===4,R=b?MODE_EFF.SELECT:MODE_EFF.NORMAL,I=p.type===1?1:cmdCount(p),z=mapSel(o.state.selection,se=>{const le=cmSelToInternal(se,o.state.doc),tn=o.state.doc,an=le.head,sn=tn.sliceString(0);let ln=an;for(let yn=0;yn<I;yn++){if(!d&&ln===0){ln=-1;break}if(ln=d?sn.indexOf(e,ln+1):sn.lastIndexOf(e,ln-1),ln<0)break}if(ln===-1)return se;const un=l?ln:d?ln-1:ln+1,pn=b?EditorSelection.range(le.anchor,un):EditorSelection.range(le.head,un);return internalSelToCM(pn,tn)});o.dispatch({effects:R,selection:z})}function moveToSibling(o,e){const l=syntaxTree(o.state),d=o.state.selection.main;let p=l.resolveStack(d.from,1),b=null;for(;;){const R=p.node;if(R&&R.from<=d.from&&R.to>=d.to&&(b=e?R?.nextSibling:R?.prevSibling,b))break;if(p.next)p=p.next;else break}if(!b){o.dispatch({selection:EditorSelection.range(0,o.state.doc.length),scrollIntoView:!0});return}o.dispatch({selection:EditorSelection.range(b.from,b.to),scrollIntoView:!0})}var PAIRS={"(":["(",")",!0],")":["(",")",!1],"{":["{","}",!0],"}":["{","}",!1],"[":["[","]",!0],"]":["[","]",!1],"<":["<",">",!0],">":["<",">",!1]},MATCHEABLE=new Set([...Object.keys(PAIRS),'"',"'"]);function matchBracket(o){return o.state.selection.ranges.map(e=>{const l=cmSelToInternal(e,o.state.doc),d=internalSelToCM(EditorSelection.range(l.head,l.head),o.state.doc),p=o.state.doc.sliceString(d.from,d.to);if(!MATCHEABLE.has(p))return null;const b=PAIRS[p]?.[2]??!1,R=matchBrackets(o.state,d.head+(b?0:1),b?1:-1);if(R)return R.end})}function surround(o,e){const l=PAIRS[e],d=l?.[0]??e,p=l?.[1]??e,b=d.length+p.length,R=o.state.changeByRange(I=>{const[z,se]=rangeIsForward(I)||I.empty?[I.anchor,I.head+b]:[I.anchor+b,I.head];return{range:EditorSelection.range(z,se),changes:[{from:I.from,insert:d},{from:I.to,insert:p}]}});o.dispatch(R,{effects:MODE_EFF.NORMAL})}function extendToDelimiters(o,e,l){const d=o.state.field(modeField),p=PAIRS[e],b=p?.[0]??e,R=p?.[1]??e,I=new SearchQuery({search:`${escape(b)}|${escape(R)}`,regexp:!0}),z=o.state.selection.ranges.map(se=>{const le=I.getCursor(o.state,se.head);let tn=1,an=le.next();if(an.done)return se;if(b!==R&&o.state.sliceDoc(an.value.from,an.value.to)===b){const _n=I.getCursor(o.state,0,se.head);let Pn;for(;;){const vn=_n.next();if(vn.done)break;Pn={done:!1,value:vn.value}}if(!Pn||Pn?.done||o.state.sliceDoc(Pn.value.from,Pn.value.to)===R)return se;tn=-1,an=Pn}const sn=matchBrackets(o.state,tn>0?an.value.to:an.value.from,-tn);if(!sn?.end)return se;let[ln,un]=tn>0?[sn.end,an.value]:[an.value,sn.end];if(!l){const _n=nextClusterBreak(o.state.doc,ln.to,!0);ln={from:ln.to,to:_n},un={from:nextClusterBreak(o.state.doc,un.from,!1),to:un.from}}const[pn,yn]=rangeIsForward(se)||rangeIsAtomic(se,o.state.doc)?[ln.from,un.to]:[un.to,ln.from];return EditorSelection.range(pn,yn)});o.dispatch({selection:EditorSelection.create(z,o.state.selection.mainIndex),effects:d.type===0?MODE_EFF.NORMAL:MODE_EFF.SELECT})}function replaceWithChar(o,e,l){const d=l.state.selection.main,p=l.state.doc.sliceString(d.from,d.to);let b=0,R=0;for(;;){const I=findClusterBreak(p,R,!0);if(I===R)break;R=I,b++}l.dispatch({changes:{from:d.from,to:d.to,insert:e.repeat(b)},effects:MODE_EFF.NORMAL})}function changeCase(o,e){o.dispatch(o.state.changeByRange(l=>{const d=o.state.doc.sliceString(l.from,l.to);let p;return e==null?p=[...d].map(b=>{let R=b.toUpperCase();return R===b?b.toLowerCase():R}).join(""):e?p=d.toUpperCase():p=d.toLowerCase(),{range:l,changes:{from:l.from,to:l.to,insert:p}}}))}function yanksForSelection(o,e){if(o.ranges.length===e.length)return e;if(o.ranges.length<e.length)return e.slice(0,o.ranges.length);const l=e.at(-1)??"",d=[...e];for(let p=e.length;p<o.ranges.length;p++)d[p]=l;return d}function yank(o,e,l){const{selection:d}=o.state;l??=e.register??'"',o.dispatch({effects:[yankEffect.of([l,d.ranges.map(b=>o.state.doc.slice(b.from,b.to))]),MODE_EFF.NORMAL]});const p=d.ranges.length;return`yanked ${p===1?"1 selection":`${p} selections`} to register ${l}`}function paste(o,e,l,d,{reset:p=!0,select:b=!0}={}){const{selection:R}=o.state;e??=[""];const I=yanksForSelection(R,e),z=I.map((tn,an)=>({from:l?R.ranges[an].from:R.ranges[an].to,insert:tn.toString().repeat(d)})),{ranges:se}=I.reduce((tn,an,sn)=>{let ln=an.length,un=R.ranges[sn];const pn=(l?un.from:un.to)+tn.offset;return tn.ranges.push(b?EditorSelection.range(pn,pn+ln):EditorSelection.cursor(pn+ln)),tn.offset+=ln,tn},{ranges:[],offset:0}),le=o.state.changes(z);o.dispatch({changes:le},{selection:EditorSelection.create(se,R.mainIndex),sequential:!0},p?{effects:MODE_EFF.NORMAL}:{})}function changeNumber(o,e){const l=/-?\d+/;o.dispatch(o.state.changeByRange(d=>{const p=o.state.doc.sliceString(d.from,d.to);if(!l.test(p))return{range:d};const b=Number(p),R=String(b+(e?1:-1));return{range:R.length===p.length?d:EditorSelection.range(d.from,d.from+R.length),changes:{from:d.from,to:d.to,insert:R}}}))}function openLine(o,e){let l,d;const p=cmSelToInternal(o.state.selection.main,o.state.doc);e?(l=o.state.doc.lineAt(p.to).to,d=l+o.state.lineBreak.length):(l=o.state.doc.lineAt(p.from).from,d=l),o.dispatch({changes:{from:l,insert:o.state.lineBreak},selection:EditorSelection.cursor(d),effects:MODE_EFF.INSERT})}var countCommands=Object.fromEntries(Array.from({length:10},(o,e)=>[String(e),(l,d)=>{const p=d.count!=null?d.count*10+e:e;p!==0&&l.dispatch({effects:modeEffect.of({...d,count:p})})}]));function insertLine(o,e){const l=o.state.field(modeField),d=l.type===1?1:cmdCount(l),p=l.type===4,b=o.state.selection.main,R=o.state.doc.lineAt(e?b.to:b.from),I={from:e?R.to:R.from,insert:o.state.lineBreak.repeat(d)},z=p?MODE_EFF.SELECT:MODE_EFF.NORMAL;o.dispatch({changes:I,effects:z})}function rotateSelection(o,e){const{selection:l}=o.state;if(l.ranges.length===1)return!0;const d=(l.mainIndex+(e?1:-1))%l.ranges.length;o.dispatch({selection:EditorSelection.create(l.ranges,d+(d<0?l.ranges.length:0))})}function cmdCount(o){return o.count??1}function resetCount(o){const{count:e,...l}=o;return modeEffect.of(l)}function rangeIsForward(o){return o.head>o.from}function rangeIsAtomic(o,e){const l=o.to-o.from;if(l<=1)return!0;if(l===2){const d=e.sliceString(o.from,o.to).charCodeAt(0);return d>=55296&&d<=57343}else return!1}function nextClusterBreak(o,e,l){if(e===(l?o.length:0))return e;const d=o.lineAt(e);return l&&d.to===e?e+1:!l&&d.from===e?e-1:findClusterBreak(d.text,e-d.from,l)+d.from}function mapSel(o,e){if(o.ranges.length===1){const l=e(o.main);return EditorSelection.single(l.anchor,l.head)}return EditorSelection.create(o.ranges.map(e),o.mainIndex)}function escape(o){return RegExp.escape(o)}function backwardsSearch(o,e,l,d){const p=e.getCursor(o),b=o.selection.main,R=cmdCount(l),I=new Ring(R),z=peekable(cloned(p)),se=peekingUntil(z,ln=>ln.to>=b.from);for(const ln of{[Symbol.iterator](){return se}})I.push(ln);if(I.length===R){d(I.first);return}const le=new Ring(R-I.length);for(const ln of{[Symbol.iterator](){return z}})le.push(ln);const tn=le.length+I.length;if(tn===0)return{match:!1};if(tn===R)return d(le.first),{wrapped:!0};const an=[...I,...le],sn=R%tn;return d(an[an.length-sn-1]),{wrapped:!0}}var Ring=class{items;head;length;maxLength;constructor(o){this.items=Array.from({length:o}),this.maxLength=o,this.head=0,this.length=0}get first(){return this.items[this.start]}push(o){this.items[this.head]=o,this.head+=1,this.length+=1,this.head%=this.maxLength,this.length=Math.min(this.maxLength,this.length)}merge(o){for(let e=0;e<o.length;e++){const l=o.items[(o.start+e)%o.maxLength];this.push(l)}}*[Symbol.iterator](){for(let o=0;o<this.length;o++)yield this.items[(this.start+o)%this.maxLength]}get start(){return this.length<this.maxLength?0:(this.head+1)%this.maxLength}};function peekingUntil(o,e){return{next(){const l=o.peek();return l.done?l:e(l.value)?{value:void 0,done:!0}:o.next()}}}function peekable(o){let e=o.next();return{next(){const d=e;return d.done||(e=o.next()),d},peek(){return e}}}function cloned(o){return{next(){return{...o.next()}}}}function startSearch(o,e){const l=o.scrollSnapshot(),d=o.state.selection;let p="",b=null;function R(){o.dispatch({selection:d}),resetScroll(o,l)}return{init:o.state.field(registersField)["/"]?.toString()??"",onInput(I){if(p!==I)p=I,b=searchQuery(p);else return;if(!b?.valid&&e!==2||e===1)return;if(e===2){if(!b.valid){p||o.dispatch({selection:d});return}const se=[];for(const an of d.ranges){const sn=b.getCursor(o.state,an.from,an.to);for(const ln of{[Symbol.iterator](){return sn}})se.push(ln)}const le=se.map(an=>EditorSelection.range(an.from,an.to)),tn=le.length===0?d:EditorSelection.create(le,0);o.dispatch({selection:tn});return}let z=b.getCursor(o.state,d.main.to).next();if(z.done&&(z=b.getCursor(o.state).next()),z.done)R();else{const se=EditorSelection.range(z.value.from,z.value.to);o.dispatch({selection:se,effects:EditorView.scrollIntoView(se,{y:"center"})})}},onClose(I){if(!I){R();return}if(p!=null&&o.dispatch({effects:yankEffect.of(["/",[p]])}),e===1){const z=o.state.facet(externalCommandsFacet),se=p||readRegister(o.state,"/");if(se)return z.global_search?.(se.toString())}}}}function searchQuery(o){return new SearchQuery({search:o,regexp:!0,caseSensitive:/[A-Z]/.test(o)})}var searchFacet=Facet.define({combine(o){const e=o[0];return e?searchQuery(e):void 0}}),helixCommandBindings={insert:{Backspace(o){deleteCharBackward(o)},Delete(o){deleteCharForward(o)},Enter(o){insertNewlineAndIndent(o)},ArrowLeft:cursorCharLeft,ArrowRight:cursorCharRight,Escape(o,e){if(e.expecting)return o.dispatch({effects:MODE_EFF.INSERT}),!0;o.dispatch({effects:[MODE_EFF.NORMAL,historyEffect.of({type:"commit",state:o.state})],selection:mapSel(o.state.selection,l=>l.empty?internalSelToCM(l,o.state.doc):l)})},"Ctrl-r"(o){o.dispatch({effects:modeEffect.of({type:1,expecting:{minor:"<C-r>",callback(e,l,d){const p=readRegister(e.state,l);paste(e,p,!1,1,{select:!1,reset:!1}),e.dispatch({effects:MODE_EFF.INSERT})},metadata:void 0}})})},Tab:indentMore,"Shift-Tab":indentLess},normal:{Escape(o,e){const l=e;if(l.type===0&&l.minor===2&&l.expecting==null&&l.register==null&&l.count==null)return!0;o.dispatch({effects:[MODE_EFF.NORMAL]})},"/"(o){getCommandPanel(o).showSearchInput()},s(o){getCommandPanel(o).showSearchInput(2)},"Alt-s"(o){const e=[],l=new Set;for(const d of o.state.selection.ranges){const p=o.state.doc.lineAt(d.from).number,b=o.state.doc.lineAt(d.to),R=b.from===d.to?b.number-1:b.number;for(let I=p;I<=R;I++){const z=o.state.doc.line(I);l.has(z.number)||(l.add(z.number),e.push(EditorSelection.range(z.from,z.to)))}}o.dispatch({selection:EditorSelection.create(e,0)})},","(o){if(o.state.selection.ranges.length===1)return!0;o.dispatch({selection:o.state.selection.asSingle()})},"("(o){rotateSelection(o,!1)},")"(o){rotateSelection(o,!0)},...countCommands,":"(o,e){o.dispatch({effects:resetMode(e)}),getCommandPanel(o).showCommandInput()},y(o,e){getCommandPanel(o).showMessage(yank(o,e))},a:{checkpoint:"temp",command(o){o.dispatch({effects:MODE_EFF.INSERT,selection:mapSel(o.state.selection,e=>EditorSelection.range(e.to,e.to))})}},A:{checkpoint:"temp",command(o,e){cursorToLineEnd(o,e,!0)}},I:{checkpoint:"temp",command(o){o.dispatch({effects:MODE_EFF.INSERT,selection:mapSel(o.state.selection,e=>{const l=o.state.doc.lineAt(e.from).from;return EditorSelection.cursor(l)})})}},c:{checkpoint:"temp",command(o){removeText(o,{edit:!0})}},d:{checkpoint:!0,command(o){removeText(o)}},"Alt-c":{checkpoint:"temp",command(o){removeText(o,{yank:!1,edit:!0})}},"Alt-d":{checkpoint:!0,command(o){removeText(o,{yank:!1})}},P:{checkpoint:!0,command(o,e){const l=readRegister(o.state,e.register);paste(o,l,!0,cmdCount(e))}},p:{checkpoint:!0,command(o,e){const l=readRegister(o.state,e.register);paste(o,l,!1,cmdCount(e))}},R:{checkpoint:!0,command(o,e){const l=readRegister(o.state,e.register);if(!l)return!0;const d=cmdCount(e),p=yanksForSelection(o.state.selection,l),b=d===1?p:p.map(z=>z.toString().repeat(d)),R=new Map(o.state.selection.ranges.map((z,se)=>[z,se])),I=o.state.changeByRange(z=>{const se=b[R.get(z)];return se?{range:EditorSelection.range(z.from,z.from+se.length),changes:{from:z.from,to:z.to,insert:se}}:{range:z}});o.dispatch({...I,effects:[...I.effects,MODE_EFF.NORMAL]})}},r:{checkpoint:!0,command(o,e){o.dispatch({effects:modeEffect.of({...e,expecting:{minor:"r",callback:replaceWithChar,metadata:o}})})}},w(o,e){moveByGroup(o,e,!0)},e(o,e){moveByGroup(o,e,!0)},b(o,e){moveByGroup(o,e,!1)},v(o,e){o.dispatch({effects:e.type===0?MODE_EFF.SELECT:MODE_EFF.NORMAL})},g(o,e){o.dispatch({effects:overwriteMode(e,{minor:3})})},Space(o,e){o.dispatch({effects:overwriteMode(e,{minor:6})})},m(o,e){o.dispatch({effects:overwriteMode(e,{minor:5})})},i:{checkpoint:"temp",command(o){o.dispatch({effects:MODE_EFF.INSERT,selection:mapSel(o.state.selection,e=>EditorSelection.range(e.from,e.from))})}},h(o,e){return moveLeft(o,e)},j:moveDown,ArrowDown:"j",ArrowUp:"k",k:moveUp,ArrowRight:"l",ArrowLeft:"h",l(o,e){return moveRight(o,e)},"%"(o){return selectAll(o)},o:{checkpoint:"temp",command(o){openLine(o,!0)}},O:{checkpoint:"temp",command(o){openLine(o,!1)}},f(o,e){setFindMode(o,"f",e,{inclusive:!0,forward:!0})},F(o,e){setFindMode(o,"F",e,{inclusive:!0,forward:!1})},t(o,e){setFindMode(o,"t",e,{inclusive:!1,forward:!0})},T(o,e){setFindMode(o,"T",e,{inclusive:!1,forward:!1})},u(o,e){const{checkpoints:l,cursor:d}=o.state.field(historyField),p=d+cmdCount(e),b=l[p];if(!b)return!0;o.dispatch({changes:{from:0,to:o.state.doc.length,insert:b.doc},selection:b.selection,effects:[historyEffect.of({type:"move",offset:cmdCount(e),head:o.state}),resetCount(e)],scrollIntoView:!0})},U(o,e){const{checkpoints:l,cursor:d,head:p}=o.state.field(historyField),b=d-cmdCount(e),R=b===-1?p:l[b];if(!R)return!0;o.dispatch({changes:{from:0,to:o.state.doc.length,insert:R.doc},selection:R.selection,effects:[historyEffect.of({type:"move",offset:-cmdCount(e)}),resetCount(e)],scrollIntoView:!0})},x(o,e){function l(d){const p=o.state.doc.lineAt(d.from);let b=o.state.doc.lineAt(d.to);!d.empty&&d.to===b.from&&(b=o.state.doc.line(b.number-1));const R=EditorSelection.range(p.from,Math.min(o.state.doc.length,b.to+o.state.lineBreak.length));if(R.from===d.from&&R.to===d.to||e.count){const z=Math.min(b.number+cmdCount(e),o.state.doc.lines),se=o.state.doc.line(z);return EditorSelection.range(p.from,Math.min(o.state.doc.length,se.to+o.state.lineBreak.length))}else return R}return o.dispatch({selection:mapSel(o.state.selection,l),effects:resetCount(e)}),!0},n(o,e){const l=o.state.facet(searchFacet);if(!l?.valid)return l&&showSearchError(o,l),o.dispatch({effects:resetCount(e)}),!0;let d=l.getCursor(o.state,o.state.selection.main.to),p,b=!1,R=!1;for(let se=0;se<cmdCount(e);se++)if(p=d.next(),b||=!p.done,p.done&&(d=l.getCursor(o.state),R=!0,p=d.next(),b||=!p.done),!b){getCommandPanel(o).showError("No more matches");return}const I=EditorSelection.range(p.value.from,p.value.to);let z=I;e.type===4&&(z=o.state.selection.addRange(I)),o.dispatch({selection:z,scrollIntoView:!0}),R&&getCommandPanel(o).showMessage("Wrapped around document")},N(o,e){const l=o.state.facet(searchFacet);if(!l?.valid)return l&&showSearchError(o,l),o.dispatch({effects:resetCount(e)}),!0;const d=backwardsSearch(o.state,l,e,p=>{const b=EditorSelection.range(p.from,p.to);o.dispatch({selection:b,effects:EditorView.scrollIntoView(b,{y:"center"})})});d?.wrapped?getCommandPanel(o).showMessage("Wrapped around document"):d?.match===!1&&getCommandPanel(o).showError("No more matches"),o.dispatch({effects:resetCount(e)})},"Ctrl-a":{checkpoint:!0,command(o){changeNumber(o,!0)}},"Ctrl-x":{checkpoint:!0,command(o){changeNumber(o,!1)}},"Ctrl-d"(o,e){moveByHalfPage(o,e,!0)},PageDown:"Ctrl-d",PageUp:"Ctrl-u","Ctrl-u"(o,e){moveByHalfPage(o,e,!1)},";"(o){withHelixSelection(o,()=>(o.dispatch({selection:mapSel(o.state.selection,e=>EditorSelection.cursor(e.head)),scrollIntoView:!0}),!0))},"Alt-;"(o){o.dispatch({selection:mapSel(o.state.selection,e=>rangeIsAtomic(e,o.state.doc)?e:EditorSelection.range(e.head,e.anchor)),scrollIntoView:!0})},"Alt-:"(o){o.dispatch({selection:mapSel(o.state.selection,e=>rangeIsAtomic(e,o.state.doc)?e:EditorSelection.range(e.from,e.to))})},"Alt-ArrowUp"(o){expandSyntaxHistory(o.state,(e,l)=>{o.dispatch(e),selectParentSyntax({state:o.state,dispatch:l})},e=>o.dispatch(e))},"Alt-o":"Alt-ArrowUp","Alt-i":"Alt-ArrowDown","Alt-ArrowDown"(o){const e=undoSyntaxHistory(o.state);e&&o.dispatch(e)},"Alt-ArrowRight"(o){moveToSibling(o,!0)},"Alt-n":"Alt-ArrowRight","Alt-ArrowLeft"(o){moveToSibling(o,!1)},"Alt-p":"Alt-ArrowLeft","Ctrl-c":{checkpoint:!0,command(o){toggleComment(o),o.original.dispatch({effects:MODE_EFF.NORMAL})}},">":{checkpoint:!0,command(o){return indentMore(o)}},"<":{checkpoint:!0,command(o){return indentLess(o)}},"`":{checkpoint:!0,command(o){changeCase(o,!1)}},"Alt-`":{checkpoint:!0,command(o){changeCase(o,!0)}},"~":{checkpoint:!0,command(o){changeCase(o)}},"*"(o){const l=[...new Set(o.state.selection.ranges.map(d=>escapeRegex(o.state.doc.sliceString(d.from,d.to))))].join("|");o.dispatch({effects:yankEffect.of(["/",[l]])}),getCommandPanel(o).showMessage(`register '/' set to '${l}'`)},_(o){o.dispatch({selection:mapSel(o.state.selection,e=>{const l=o.state.doc.slice(e.from,e.to).toString(),d=l.trim();if(d===l)return e;const p=l.indexOf(d),b=l.length-d.length-p,R=e.anchor===e.from?e.anchor+p:e.anchor-b,I=e.head===e.to?e.head-b:e.head+p;return EditorSelection.range(R,I)})})},Home:cursorToLineStart,End:cursorToLineEnd,J:{checkpoint:!0,command(o){const e=o.state.selection.main,{doc:l}=o.state,d=l.lineAt(e.from);if(d.number>=l.lines)return;let p=l.lineAt(e.to);const b=p.number===d.number;b&&(p=l.line(d.number+1));let R="",I=0;for(let se=d.number;se<=p.number;se++){let le=d.text;if(se>d.number){const tn=l.line(se).text;le=tn.trimStart();let an=tn.length-le.length;!b&&se===p.number&&e.to-p.from<an&&(an=e.to-p.from),I+=an}R+=le,R+=se===p.number?"":" "}const z=b?e.to:e.to-I-(p.number-d.number)*(o.state.lineBreak.length-1);o.dispatch({changes:{from:d.from,to:p.to,insert:R},selection:e.anchor>e.head?EditorSelection.range(z,e.from):EditorSelection.range(e.from,z)})}},"["(o,e){o.dispatch({effects:overwriteMode(e,{minor:7})})},"]"(o,e){o.dispatch({effects:overwriteMode(e,{minor:8})})},'"'(o,e){o.dispatch({effects:overwriteMode(e,{expecting:{minor:'"',metadata:void 0,callback(l,d,p){l.dispatch({effects:modeEffect.of({...e,register:d})})}}})})},Tab(){},"Shift-Tab"(){}},goto:{g(o,e){const l=e.type===0;withHelixSelection(o,()=>l?cursorDocStart(o):selectDocStart(o)),o.dispatch({effects:l?MODE_EFF.NORMAL:MODE_EFF.SELECT})},e(o,e){const l=e.type===0,d=o.state.selection.ranges[0].from,p=o.state.doc.line(o.state.doc.lines),R=(p.text||o.state.doc.lines===1?p:o.state.doc.line(o.state.doc.lines-1)).from;o.dispatch({selection:internalSelToCM(l?EditorSelection.cursor(R):EditorSelection.range(d,R),o.state.doc),effects:l?MODE_EFF.NORMAL:MODE_EFF.SELECT,scrollIntoView:!0})},h:cursorToLineStart,j(o,e){const l=e.type===0;moveDown(o,e),o.dispatch({effects:l?MODE_EFF.NORMAL:MODE_EFF.SELECT})},k(o,e){const l=e.type===0;moveUp(o,e),o.dispatch({effects:l?MODE_EFF.NORMAL:MODE_EFF.SELECT})},l:cursorToLineEnd,n(o,e){const d=o.state.facet(externalCommandsFacet)[":buffer-next"]?.();getCommandPanel(o).showMessage(d),o.dispatch({effects:e.type===0?MODE_EFF.NORMAL:MODE_EFF.SELECT})},p(o,e){const d=o.state.facet(externalCommandsFacet)[":buffer-previous"]?.();getCommandPanel(o).showMessage(d),o.dispatch({effects:e.type===0?MODE_EFF.NORMAL:MODE_EFF.SELECT})}},match:{s:{checkpoint:!0,command(o,e){o.dispatch({effects:modeEffect.of({type:e.type,minor:5,expecting:{minor:"s",callback:surround,metadata:o}})})}},m(o,e){const l=matchBracket(o)??void 0,d=e.type===0,p=l.map(b=>{if(b==null)return;let R=EditorSelection.range(b.from,b.to);if(!d){const I=b.from,z=cmSelToInternal(o.state.selection.main,o.state.doc);R=internalSelToCM(EditorSelection.range(z.anchor,I),o.state.doc)}return R});o.dispatch({selection:EditorSelection.create(o.state.selection.ranges.map((b,R)=>p[R]??b),o.state.selection.mainIndex),effects:d?MODE_EFF.NORMAL:MODE_EFF.SELECT,scrollIntoView:!0})},a(o,e){o.dispatch({effects:modeEffect.of({type:e.type,minor:5,expecting:{minor:"a",callback:extendToDelimiters,metadata:!0}})})},i(o,e){o.dispatch({effects:modeEffect.of({type:e.type,minor:5,expecting:{minor:"i",callback:extendToDelimiters,metadata:!1}})})}},space:{y(o,e){getCommandPanel(o).showMessage(yank(o,e,"+"))},p:{checkpoint:!0,command(o){o.dispatch({effects:MODE_EFF.NORMAL}),readClipboard(o.state).then(e=>paste(o,e,!1,1,{reset:!1}))}},P:{checkpoint:!0,command(o){o.dispatch({effects:MODE_EFF.NORMAL}),readClipboard(o.state).then(e=>paste(o,e,!0,1,{reset:!1}))}},R:{checkpoint:!0,command(o){o.dispatch({effects:MODE_EFF.NORMAL}),readClipboard(o.state).then(e=>{const l=o.state.replaceSelection(e[0]);o.dispatch(l)})}},f(o,e){const d=o.state.facet(externalCommandsFacet).file_picker?.();getCommandPanel(o).showMessage(d),o.dispatch({effects:e.type===0?MODE_EFF.NORMAL:MODE_EFF.SELECT})},b(o,e){const d=o.state.facet(externalCommandsFacet).buffer_picker?.();getCommandPanel(o).showMessage(d),o.dispatch({effects:e.type===0?MODE_EFF.NORMAL:MODE_EFF.SELECT})},"/"(o,e){o.state.facet(externalCommandsFacet).global_search!=null&&getCommandPanel(o).showSearchInput(1),o.dispatch({effects:e.type===0?MODE_EFF.NORMAL:MODE_EFF.SELECT})}},leftBracket:{...countCommands,Space:{checkpoint:!0,command(o){insertLine(o,!1)}}},rightBracket:{...countCommands,Space:{checkpoint:!0,command(o){insertLine(o,!0)}}}};function moveByGroup(o,e,l){const d=e.type===0,p=o.state.changeByRange(b=>{const R=rangeIsForward(b),[I,z]=rangeIsAtomic(b,o.state.doc)?[b,b]:[EditorSelection.range(nextClusterBreak(o.state.doc,b.head,!R),b.head),EditorSelection.range(b.anchor,nextClusterBreak(o.state.doc,b.anchor,R))];let se=l?I.from:I.to,le=o.moveByGroup(EditorSelection.cursor(se),l).head;const tn=l?I.to:I.from;le===tn&&(se=le,le=o.moveByGroup(EditorSelection.cursor(se),l).head);const an=EditorSelection.range(se,le);if(!d){const sn=rangeIsAtomic(an,o.state.doc)?an:EditorSelection.range(nextClusterBreak(o.state.doc,an.head,!l),an.head);return[se,le]=sn.to<z.from?[z.to,sn.from]:[z.from,sn.to],{range:EditorSelection.range(se,le)}}return{range:an}});o.dispatch(p)}function toCodemirrorKeymap(o){const e=[...new Set(Object.values(o).flat().flatMap(b=>Object.keys(b)))];function l(b,R,I){if(typeof b=="function")return b(R,I);{const z=b.checkpoint==="temp";return b.command({original:R,dispatch(...se){R.dispatch(commitToHistory(R,z),...se)},get state(){return R.state}},I)}}function d(b,R){for(;;){const I=R[b];if(typeof I=="string"){b=I;continue}return I}}const p=[];for(const b of e){const R=d(b,o.insert),I=d(b,o.normal),z=d(b,o.goto),se=d(b,o.match),le=d(b,o.space),tn=d(b,o.leftBracket),an=d(b,o.rightBracket),sn=b==="Escape",ln=b.length===1||b==="Space",un=pn=>{const yn=pn.state.field(modeField);if(yn.type===1)return R?R(pn,yn)??!0:!1;if(yn.expecting&&ln)return!1;let _n;if(sn||yn.minor===2&&I)_n=l(I,pn,yn);else if(yn.minor===3&&z)_n=l(z,pn,yn);else if(yn.minor===5&&se)_n=l(se,pn,yn);else if(yn.minor===6&&le)_n=l(le,pn,yn);else if(yn.minor===7&&tn)_n=l(tn,pn,yn);else if(yn.minor===8&&an)_n=l(an,pn,yn);else return!1;return _n??!0};p.push({key:b,run:un})}return p}var EndLineCursor=class extends WidgetType{toDOM(){const o=document.createElement("span");return o.classList.add("cm-hx-cursor"),o.classList.add("cm-hx-cursor-endline"),o.textContent=" ",o}},cursorMark=Decoration.mark({class:"cm-hx-cursor"}),endlineCursorWidget=Decoration.widget({widget:new EndLineCursor,side:1});function drawCursorMark(o,e){const l=o.ranges.map(p=>internalSelToCM(EditorSelection.cursor(cmSelToInternal(p,e).head),e)),d=[];for(const p of l){const b=e.lineAt(p.head);p.from===e.length||b.to===p.from?d.push(endlineCursorWidget.range(p.from,p.from)):d.push(cursorMark.range(p.head,p.anchor))}return Decoration.set(d)}function letThrough(o){return o}var selectByClickFilter=EditorState.transactionFilter.from(modeField,o=>o.type===1?letThrough:e=>{if(e.annotation(Transaction.userEvent)!=="select.pointer")return e;const d=e.newSelection.main;return d.empty?[e,{selection:internalSelToCM(d,e.newDoc)}]:e}),unhandledCommandsFilter=EditorState.transactionFilter.from(modeField,o=>o.type===1?letThrough:e=>{const l=e.annotation(Transaction.userEvent);return l==null?e:l==="input.drop"||l==="move.drop"?[]:!l.startsWith("input")||!l.startsWith("input.type")?e:o.minor!==2?{effects:o.type===0?MODE_EFF.NORMAL:MODE_EFF.SELECT}:[]}),expectingInputHandler=EditorView.inputHandler.from(modeField,o=>(e,l,d,p)=>o.expecting?(o.expecting.callback(e,p,o.expecting.metadata),!0):!1),modeUpdateListener=EditorView.updateListener.of(o=>{const{state:e,startState:l}=o,d=getPanel(o.view,statusPanel),p=e.field(modeField),b=l.field(modeField,!1);if(p!==b){const R=b?toExternalMode(b):void 0,I=toExternalMode(p);(R!==I||p.register!==b?.register)&&d.setMode(I,p.register)}d.setLineCol()}),helixKeymap=keymap.of(toCodemirrorKeymap(helixCommandBindings)),externalCommandsFacet=Facet.define({combine(o){const e=[...o];return e.reverse(),e.reduce((l,d)=>({...l,...d}),{})}}),pathRegister=Facet.define({combine(o){return o.at(-1)}}),commands=Facet.define({combine(o){return o.flat().sort((l,d)=>l.name<d.name?-1:l.name>d.name?1:0)}}),themeFacet=Facet.define({static:!0});function changeTheme(o,e,l=!0){const{themes:d}=o.state.field(themeField),p=d.find(I=>I.name===e);if(!p)return{message:`'theme': Could not load theme: ${e}`,error:!0};const b=themeCompartment.get(o.state);if(Array.isArray(b)&&b.includes(p.extension))return;(typeof p.extension=="function"?p.extension():Promise.resolve(p.extension)).then(I=>{o.dispatch({effects:[themeCompartment.reconfigure([I,p.dark?panelTheme.dark:panelTheme.light]),themeEffect.of(e)]}),l&&o.state.facet(themeFacet).forEach(z=>z(p))})}function helix(o={}){const e=o?.config?.["editor.cursor-shape.insert"]??"block",l=o.globalInit??o.init,d=l instanceof EditorState?l.field(registersField):l?l.registers:void 0,p=o.init instanceof EditorState?o.init.field(historyField):o.init?o.init.history:void 0,b=l instanceof EditorState?l.field(registersHistoryField):l?l.registersHistory:void 0,R=l instanceof EditorState?l.field(themeField,!1)?.current:l?l.theme:o.config?.theme;if(R!=null&&!o.themes?.length)throw new Error("options.config.theme only takes effect if options.themes was provided.");const I=R?o.themes?.find(le=>le.name===R):o.themes?.[0];if(R&&!I)throw new Error(`Unknown theme ${R}`);const z=typeof I?.extension=="function"?void 0:I?.extension,se=I?[themeField.init(()=>({current:I.name,themes:o.themes}))]:[panelTheme.light];return z?se.push(themeCompartment.of([z,I.dark?panelTheme.dark:panelTheme.light])):I&&se.push([themeCompartment.of([panelTheme.light]),ViewPlugin.define(le=>(changeTheme(le,I.name,!1),{}))]),[...se,EditorView.theme({".cm-hx-block-cursor .cm-cursor":{display:"none !important"},".cm-hx-block-cursor .cm-hx-cursor":{background:"#ccc"}}),panelStyles,drawSelection({cursorBlinkRate:0,drawRangeCursor:e==="bar"}),helixKeymap,modeField,p?historyField.init(()=>p):historyField,d?registersField.init(()=>d):registersField,b?registersHistoryField.init(()=>b):registersHistoryField,searchFacet.from(registersField,le=>le["/"]?.toString()),unhandledCommandsFilter,selectByClickFilter,expectingInputHandler,EditorState.allowMultipleSelections.of(!0),EditorState.transactionFilter.from(syntaxHistoryField,({selections:le})=>le.length===0?letThrough:tn=>{for(const an of tn.effects)if(an.is(syntaxHistoryEffect))return tn;return[tn,{effects:syntaxHistoryEffect.of({type:"reset"})}]}),EditorView.decorations.compute(["selection","doc",modeField],le=>e==="bar"&&le.field(modeField).type===1?Decoration.set([]):drawCursorMark(le.selection,le.doc)),modeUpdateListener,showPanel.of(statusPanel),showPanel.of(commandPanel),syntaxHistoryField,ViewPlugin.define(le=>(le.scrollDOM.classList.add("cm-hx-block-cursor"),le.state.doc.length!==0&&setTimeout(()=>{le.dispatch({selection:EditorSelection.range(1,0)})}),{update(tn){const an=tn.state.field(modeField),sn=tn.startState.field(modeField),ln=getCommandPanel(le);(ln.hasMessage()&&tn.docChanged||tn.selectionSet)&&ln.clearMessage();const un=!sameMode(an,sn);(un||!sameModeState(an,sn))&&ln.showMinor(an),un&&e==="bar"&&le.scrollDOM.classList.toggle("cm-hx-block-cursor",an.type!==1)}})),commands.of([{name:"goto",aliases:["g"],help:"Goto line number",handler(le,tn){if(tn.length===0)return{message:"Line number required",error:!0};const an=Number(tn[0]);if(!Number.isFinite(an)||an<=0)return{message:"Invalid line number",error:!0};const sn=Math.min(an,le.state.doc.lines),ln=le.state.doc.line(sn);le.dispatch({selection:EditorSelection.cursor(ln.from),scrollIntoView:!0})}},{name:"clipboard-yank",help:"Yank main selection into system clipboard",handler(le){const tn=le.state.selection.main;return navigator.clipboard.writeText(le.state.doc.slice(tn.from,tn.to).toString()),{message:"Yanked main selection to + register"}}},{name:"clear-register",help:"Clear given register. If no argument is provided, clear all registers",handler(le,tn){if(tn.length>1)return{message:`Expected at most 1 argument, got ${tn.length}`,error:!0};if(tn.length===0){const an=le.state.field(registersField);le.dispatch({effects:Object.keys(an).map(sn=>yankEffect.of([sn,[]]))})}else{if(tn[0].length>1)return{message:`invalid register ${tn[0]}`,error:!0};le.dispatch({effects:yankEffect.of([tn[0],[]])})}}},{name:"echo",help:"Prints the given argumens to the statusline.",handler(le,tn){return{message:tn.join(" ")}}},...o.themes!=null&&o.themes.length>0?[{name:"theme",help:"Change the editor theme (or show the current them if none specified)",autocomplete([le,tn]){return tn?[]:o.themes?.flatMap(an=>an.name.startsWith(le)?[an.name]:[])??[]},handler(le,tn){return tn.length>1?{message:`Expected at most 1 argument, got ${tn.length}`,error:!0}:tn.length===0?{message:le.state.field(themeField).current}:changeTheme(le,tn[0])}}]:[]]),commands.compute([externalCommandsFacet],le=>{const tn=le.facet(externalCommandsFacet),an=[[":buffer-next","Goto next buffer",["bn","bnext"]],[":buffer-previous","Goto previous buffer",["bp","bprev"]]],sn=tn[":buffer-close"]?{name:"buffer-close",aliases:["bc","bclose"],help:"Close the current buffer",autocomplete:tn[":buffer-close"].autocomplete,handler(ln,un){return ln.state.facet(externalCommandsFacet)[":buffer-close"]?.handler(un)}}:void 0;return[...an.filter(([ln])=>!!tn[ln]).map(([ln,un,pn])=>({name:ln.slice(1),aliases:pn,help:un,handler(yn){return yn.state.facet(externalCommandsFacet)[ln]?.()}})),...sn?[sn]:[]]})]}function commandPanel(o){return new CommandPanel(o,commands,e=>startSearch(o,e))}function getCommandPanel(o){return getPanel(o,commandPanel)}function toExternalMode(o){switch(o.type){case 0:return"NOR";case 4:return"SEL";case 1:return"INS"}}function commitToHistory(o,e=!1){return{effects:historyEffect.of({type:"add",state:o.state,temp:e})}}function showSearchError(o,e){let l="";try{e.getCursor(o.state)}catch(d){l=d?.message}getCommandPanel(o).showError(`Invalid regex /${e.search}/: ${l}`)}function resetScroll(o,e){requestAnimationFrame(()=>requestAnimationFrame(()=>{o.dispatch({effects:e})}))}function escapeRegex(o){return o.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const vscodePlugin=ViewPlugin.fromClass(class{constructor(){}},{provide:()=>Prec.highest(keymap.of([...vscodeKeymap]))}),vscodeExtension=o=>[vscodePlugin].concat(o??[]);function replEval(o){try{let e=!1;try{const d=new CustomEvent("repl-evaluate",{detail:{source:"vim",view:o},cancelable:!0});e=document.dispatchEvent(d)===!1}catch(d){console.error("Error dispatching repl-evaluate event",d)}if(e)return;const l=new KeyboardEvent("keydown",{key:"Enter",code:"Enter",ctrlKey:!0,bubbles:!0,cancelable:!0});if(o?.dom?.dispatchEvent?.(l),!l.defaultPrevented){const d=new KeyboardEvent("keydown",{key:"Enter",code:"Enter",altKey:!0,bubbles:!0,cancelable:!0});o?.dom?.dispatchEvent?.(d)}}catch(e){console.error("Error dispatching repl evaluation event",e)}}function replStop(o){try{let e=!1;try{const l=new CustomEvent("repl-stop",{detail:{source:"vim",view:o},cancelable:!0});e=document.dispatchEvent(l)===!1}catch(l){console.error("Error dispatching repl-stop event",l)}if(!e){const l=new KeyboardEvent("keydown",{key:".",code:"Period",altKey:!0,bubbles:!0,cancelable:!0});o?.dom?.dispatchEvent?.(l)}}catch(e){console.error("Error dispatching repl stop event",e)}}try{if(Vim&&typeof Vim.defineEx=="function"){try{Vim.defineAction("strudelToggleComment",o=>{const e=o.cm6;try{const l=new CustomEvent("repl-toggle-comment",{detail:{source:"vim",view:e},cancelable:!0});document.dispatchEvent(l)}catch(l){console.error("strudelToggleComment dispatch failed",l)}}),Vim.mapCommand("gc","action","strudelToggleComment",{},{context:"normal"}),Vim.mapCommand("gc","action","strudelToggleComment",{},{context:"visual"})}catch(o){console.error("Vim gc mapping failed",o)}Vim.defineEx("quit","q",o=>{const e=o.cm6;logger$2("[vim] :q — stopping repl"),replStop(e)}),Vim.defineEx("write","w",o=>{const e=o.cm6;try{e.focus?.();try{logger$2("[vim] :w — evaluating code")}catch(l){console.error("Error logging Vim :w evaluation",l)}replEval(e)}catch(l){console.error("Error dispatching :w evaluation event",l)}})}}catch(o){console.error("Vim ex command setup failed (defineEx missing or Vim unavailable)",o)}const helixCommands=commands.of([{name:"write",aliases:["w"],help:"Repl-eval",handler(o,e){try{o?.focus?.(),logger$2("[helix] :w — evaluating code"),replEval(o)}catch(l){console.error("Error dispatching helix :w evaluation event",l)}}},{name:"quit",aliases:["q"],help:"Repl-stop",handler(o,e){try{o?.focus?.(),logger$2("[helix] :q — stopping repl"),replStop(o)}catch(l){console.error("Error dispatching helix :q stop event",l)}}}]),keymaps={vim,emacs,codemirror:()=>keymap.of(defaultKeymap),vscode:vscodeExtension,helix:()=>[helix(),helixCommands]};function keybindings(o){const e=keymaps[o],l=e?[Prec.high(e())]:[];return o==="vim"&&l.push(EditorState.allowMultipleSelections.of(!0)),l}function jumpToCharacter(o,e,l=1){const{state:d,dispatch:p}=o,b=d.selection.main.head,R=new SearchCursor(d.doc,e);let I=[],z;for(;!R.next().done;)I.push(R.value.to);return!I.length||(l>0?z=I.find(se=>se>b+1)??I.at(0):z=I.reverse().find(se=>se<b+1)??I.at(0),z==null)?!1:(p({selection:EditorSelection.cursor(z-1),scrollIntoView:!0}),!0)}let sliderValues={};class SliderWidget extends WidgetType{constructor(e,l,d,p,b,R,I,z){super(),this.value=e,this.min=l,this.max=d,this.from=p,this.originalFrom=p,this.to=b,this.step=R,this.view=I,this.id=z||`${p}:${b}`}eq(e){return e instanceof SliderWidget?this.id===e.id&&this.from===e.from&&this.to===e.to&&this.value===e.value&&this.min===e.min&&this.max===e.max:!1}toDOM(){let e=document.createElement("span");e.setAttribute("aria-hidden","true"),e.className="cm-slider";let l=e.appendChild(document.createElement("input"));return l.type="range",l.min=this.min,l.max=this.max,l.step=this.step??(this.max-this.min)/1e3,l.originalValue=this.value,l.value=l.originalValue,l.from=this.from,l.originalFrom=this.originalFrom,l.to=this.to,l.id=this.id,l.style="width:64px;margin-right:4px;transform:translateY(4px)",this.slider=l,l.addEventListener("input",d=>{const p=d.target.value;let b=p;const R=l.from+l.originalValue.length;let I={from:l.from,to:R,insert:b};l.originalValue=b,l.value=b,this.view.dispatch({changes:I});const z=l.id;window.postMessage({type:"cm-slider",value:Number(p),id:z})}),e}ignoreEvent(e){return!0}}const setSliderWidgets=StateEffect.define(),setSliderWidgetsInRange=StateEffect.define(),updateSliderWidgets=(o,e,l=null)=>{l?o.dispatch({effects:setSliderWidgetsInRange.of({widgets:e,range:l})}):o.dispatch({effects:setSliderWidgets.of(e)})};function getSliders(o,e){return o.filter(l=>l.type==="slider").filter((l,d,p)=>d===p.findIndex(b=>b.from===l.from&&b.to===l.to)).sort((l,d)=>l.from-d.from).map(({from:l,to:d,value:p,min:b,max:R,step:I,id:z})=>Decoration.widget({widget:new SliderWidget(p,b,R,l,d,I,e,z),side:0}).range(l))}function getSliderWidgets(o){if(!o||!o.state)return[];const e=o.plugin(sliderPlugin);if(!e||!e.decorations)return[];const l=[];return e.decorations.between(0,o.state.doc.length,(d,p,b)=>{b.widget instanceof SliderWidget&&l.push({type:"slider",from:b.widget.from,to:b.widget.to,value:b.widget.value,min:b.widget.min,max:b.widget.max,step:b.widget.step})}),l}const sliderPlugin=ViewPlugin.fromClass(class{decorations;constructor(o){this.decorations=Decoration.set([])}update(o){o.transactions.forEach(e=>{if(e.docChanged){this.decorations=this.decorations.map(e.changes);const l=this.decorations.iter();for(;l.value;)l.value?.widget?.slider&&(l.value.widget.slider.from=l.from,l.value.widget.slider.to=l.to),l.next()}for(let l of e.effects)if(l.is(setSliderWidgetsInRange)){const{widgets:d,range:p}=l.value,[b,R]=p,I=[];this.decorations.between(0,o.view.state.doc.length,(se,le,tn)=>{tn.widget instanceof SliderWidget&&(se<b||se>R)&&I.push({from:se,to:le,value:tn.widget.value,min:tn.widget.min,max:tn.widget.max,step:tn.widget.step,id:tn.widget.id||`${se}:${le}`,type:"slider"})});const z=[...I,...d].filter((se,le,tn)=>le===tn.findIndex(an=>an.type==="slider"&&an.id===se.id)).sort((se,le)=>se.from-le.from);this.decorations=Decoration.set(getSliders(z,o.view))}else l.is(setSliderWidgets)&&(this.decorations=Decoration.set(getSliders(l.value,o.view)))})}},{decorations:o=>o.decorations});let slider=o=>(console.warn("slider will only work when the transpiler is used... passing value as is"),pure(o)),sliderWithID=(o,e,l,d)=>(sliderValues[o]=e,ref$1(()=>sliderValues[o]));typeof window<"u"&&window.addEventListener("message",o=>{o.data.type==="cm-slider"&&(sliderValues[o.data.id]!==void 0?sliderValues[o.data.id]=o.data.value:console.error(`slider with id "${o.data.id}" is not registered. Only ${Object.keys(sliderValues)}`))});const createTheme=({theme:o,settings:e,styles:l})=>{const d=EditorView.theme({"&":{color:e.foreground,backgroundColor:e.background},".cm-gutters":{backgroundColor:e.gutterBackground,color:e.gutterForeground},".cm-content":{caretColor:e.caret},".cm-cursor, .cm-dropCursor":{borderLeftColor:e.caret},".cm-activeLineGutter":{backgroundColor:e.lineHighlight},".cm-activeLine":{backgroundColor:e.lineHighlight},"&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection":{background:e.selection+" !important"},"& .cm-selectionMatch":{backgroundColor:e.selectionMatch}},{dark:o==="dark"}),p=HighlightStyle.define(l);return[d,syntaxHighlighting(p)]},settings$E={background:"#222",lineBackground:"#22222299",foreground:"#fff",muted:"#8a919966",caret:"#ffcc00",selection:"rgba(128, 203, 196, 0.5)",selectionMatch:"#036dd626",lineHighlight:"#00000050",gutterBackground:"transparent",gutterForeground:"#8a919966"},strudelTheme=createTheme({theme:"dark",settings:settings$E,styles:[{tag:[tags.atom,tags.bool,tags.special(tags.variableName)],color:"#89ddff"},{tag:tags.labelName,color:"#89ddff"},{tag:tags.keyword,color:"#c792ea"},{tag:tags.operator,color:"#89ddff"},{tag:tags.special(tags.variableName),color:"#eeffff"},{tag:tags.typeName,color:"#c3e88d"},{tag:tags.atom,color:"#f78c6c"},{tag:tags.number,color:"#c3e88d"},{tag:tags.definition(tags.variableName),color:"#82aaff"},{tag:tags.string,color:"#c3e88d"},{tag:tags.special(tags.string),color:"#c3e88d"},{tag:tags.comment,color:"#7d8799"},{tag:tags.variableName,color:"#c792ea"},{tag:tags.tagName,color:"#c3e88d"},{tag:tags.bracket,color:"#525154"},{tag:tags.meta,color:"#ffcb6b"},{tag:tags.attributeName,color:"#c792ea"},{tag:tags.propertyName,color:"#c792ea"},{tag:tags.className,color:"#decb6b"},{tag:tags.invalid,color:"#ffffff"},{tag:[tags.unit,tags.punctuation],color:"#82aaff"}]}),settings$D={background:"var(--secondary-color, #222)",lineBackground:"var(--secondary-color, #222)",foreground:"var(--primary-color, #fff)",muted:"var(--muted-color, #666)",caret:"var(--accent-color, #ffcc00)",selection:"color-mix(in srgb, var(--accent-color, #ffcc00) 30%, transparent)",selectionMatch:"color-mix(in srgb, var(--accent-color, #ffcc00) 20%, transparent)",lineHighlight:"color-mix(in srgb, var(--primary-color, #fff) 5%, transparent)",gutterBackground:"transparent",gutterForeground:"var(--muted-color, #666)",customStyle:!0},clientNdk=createTheme({theme:"dark",settings:settings$D,styles:[{tag:tags.keyword,color:"var(--primary-color, #fff)"},{tag:tags.string,color:"var(--accent-color, #ffcc00)"},{tag:tags.special(tags.string),color:"var(--accent-color, #ffcc00)"},{tag:tags.number,color:"var(--accent-color, #ffcc00)"},{tag:tags.atom,color:"var(--accent-color, #ffcc00)"},{tag:tags.comment,color:"var(--muted-color, #666)"},{tag:tags.function(tags.variableName),color:"var(--accent-color, #ffcc00)"},{tag:tags.variableName,color:"var(--primary-color, #fff)"},{tag:tags.definition(tags.variableName),color:"var(--primary-color, #fff)"},{tag:tags.operator,color:"var(--accent-color, #ffcc00)"},{tag:tags.propertyName,color:"var(--primary-color, #fff)"},{tag:tags.attributeName,color:"var(--primary-color, #fff)"},{tag:tags.typeName,color:"var(--accent-color, #ffcc00)"},{tag:tags.bracket,color:"var(--muted-color, #666)"},{tag:[tags.unit,tags.punctuation],color:"var(--muted-color, #666)"},{tag:[tags.atom,tags.bool,tags.special(tags.variableName)],color:"var(--primary-color, #fff)"},{tag:tags.labelName,color:"var(--primary-color, #fff)"},{tag:tags.tagName,color:"var(--accent-color, #ffcc00)"},{tag:tags.className,color:"var(--accent-color, #ffcc00)"},{tag:tags.meta,color:"var(--muted-color, #666)"},{tag:tags.invalid,color:"var(--accent-color, #ffcc00)"}]}),settings$C={background:"#051DB5",lineBackground:"#051DB550",foreground:"white",muted:"#ffffff50",caret:"white",selection:"rgba(128, 203, 196, 0.5)",selectionMatch:"#036dd626",lineHighlight:"#00000050",gutterBackground:"transparent",gutterForeground:"#8a919966"},bluescreen=createTheme({theme:"dark",settings:settings$C,styles:[{tag:tags.labelName,color:"inherit"},{tag:tags.keyword,color:"inherit"},{tag:tags.operator,color:"inherit"},{tag:tags.special(tags.variableName),color:"inherit"},{tag:tags.typeName,color:"inherit"},{tag:tags.atom,color:"inherit"},{tag:tags.number,color:"inherit"},{tag:tags.definition(tags.variableName),color:"inherit"},{tag:tags.string,color:"inherit"},{tag:tags.special(tags.string),color:"inherit"},{tag:tags.comment,color:"inherit"},{tag:tags.variableName,color:"inherit"},{tag:tags.tagName,color:"inherit"},{tag:tags.bracket,color:"inherit"},{tag:tags.meta,color:"inherit"},{tag:tags.attributeName,color:"inherit"},{tag:tags.propertyName,color:"inherit"},{tag:tags.className,color:"inherit"},{tag:tags.invalid,color:"inherit"},{tag:[tags.unit,tags.punctuation],color:"inherit"}]}),settings$B={background:"black",foreground:"white",muted:"#ffffff50",caret:"white",selection:"#ffffff20",selectionMatch:"#036dd626",lineHighlight:"#ffffff10",lineBackground:"#00000050",gutterBackground:"transparent",gutterForeground:"#8a919966"},blackscreen=createTheme({theme:"dark",settings:settings$B,styles:[{tag:tags.labelName,color:"inherit"},{tag:tags.keyword,color:"inherit"},{tag:tags.operator,color:"inherit"},{tag:tags.special(tags.variableName),color:"inherit"},{tag:tags.typeName,color:"inherit"},{tag:tags.atom,color:"inherit"},{tag:tags.number,color:"inherit"},{tag:tags.definition(tags.variableName),color:"inherit"},{tag:tags.string,color:"inherit"},{tag:tags.special(tags.string),color:"inherit"},{tag:tags.comment,color:"inherit"},{tag:tags.variableName,color:"inherit"},{tag:tags.tagName,color:"inherit"},{tag:tags.bracket,color:"inherit"},{tag:tags.meta,color:"inherit"},{tag:tags.attributeName,color:"inherit"},{tag:tags.propertyName,color:"inherit"},{tag:tags.className,color:"inherit"},{tag:tags.invalid,color:"inherit"},{tag:[tags.unit,tags.punctuation],color:"inherit"}]}),settings$A={background:"white",foreground:"black",muted:"#00000050",caret:"black",selection:"rgba(128, 203, 196, 0.5)",selectionMatch:"#ffffff26",lineHighlight:"#cccccc50",lineBackground:"#ffffff50",gutterBackground:"transparent",gutterForeground:"black",light:!0},whitescreen=createTheme({theme:"light",settings:settings$A,styles:[{tag:tags.labelName,color:"inherit"},{tag:tags.keyword,color:"inherit"},{tag:tags.operator,color:"inherit"},{tag:tags.special(tags.variableName),color:"inherit"},{tag:tags.typeName,color:"inherit"},{tag:tags.atom,color:"inherit"},{tag:tags.number,color:"inherit"},{tag:tags.definition(tags.variableName),color:"inherit"},{tag:tags.string,color:"inherit"},{tag:tags.special(tags.string),color:"inherit"},{tag:tags.comment,color:"inherit"},{tag:tags.variableName,color:"inherit"},{tag:tags.tagName,color:"inherit"},{tag:tags.bracket,color:"inherit"},{tag:tags.meta,color:"inherit"},{tag:tags.attributeName,color:"inherit"},{tag:tags.propertyName,color:"inherit"},{tag:tags.className,color:"inherit"},{tag:tags.invalid,color:"inherit"}]});let colorA="#6edee4",colorB="white",colorC="red",colorD="#f8fc55";const settings$z={background:"#000000",foreground:colorA,muted:colorA+"50",caret:colorC,selection:colorD,selectionMatch:colorA,lineHighlight:"#6edee440",lineBackground:"#00000040",gutterBackground:"transparent",gutterForeground:"#8a919966"};let punctuation=colorD,mini=colorB;const teletext=createTheme({theme:"dark",settings:settings$z,styles:[{tag:tags.labelName,color:colorB},{tag:tags.keyword,color:colorA},{tag:tags.operator,color:mini},{tag:tags.special(tags.variableName),color:colorA},{tag:tags.typeName,color:colorA},{tag:tags.atom,color:colorA},{tag:tags.number,color:mini},{tag:tags.definition(tags.variableName),color:colorA},{tag:tags.string,color:mini},{tag:tags.special(tags.string),color:mini},{tag:tags.comment,color:punctuation},{tag:tags.variableName,color:colorA},{tag:tags.tagName,color:colorA},{tag:tags.bracket,color:punctuation},{tag:tags.meta,color:colorA},{tag:tags.attributeName,color:colorA},{tag:tags.propertyName,color:colorA},{tag:tags.className,color:colorA},{tag:tags.invalid,color:colorC},{tag:[tags.unit,tags.punctuation],color:punctuation}]}),palettes={"Central Florida A":["#FFF630","#B3AC22","#666213","#191905"],"Central Florida B":["#38CEBA","#279082","#16524A","#061513"],"Central Florida C":["#FF8836","#B35F26","#663616","#190E05"],"Central Florida D":["#E07070","#9D4E4E","#5A2D2D","#160B0B"],"Central Florida E":["#7AA4CB","#55738E","#314251","#0C1014"],"Feminine Energy A":["#DC5686","#9A415E","#582536","#16090D"],"Feminine Energy B":["#D0463C","#92312A","#531c18","#150706"],"Feminine Energy C":["#D86918","#974A11","#562A0A","#160A02"],"Feminine Energy D":["#EFC54F","#A78A36","#604F20","#181408"],"Feminine Energy E":["#866399","#5e456b","#36283d","#0d0a0f"],"Sour Watermelon A":["#993366","#6B2447","#3D1429","#0F050A"],"Sour Watermelon B":["#996666","#6B4747","#3D2929","#0F0A0A"],"Sour Watermelon C":["#999966","#686B47","#3d3d29","#0f0f0A"],"Sour Watermelon D":["#99cc66","#6b8f47","#3d5229","#0f140a"],"Sour Watermelon E":["#99ff66","#6bb347","#3d6629","#0f190a"],"Peri Peaceful A":["#909BE9","#656DA3","#3A3E5D","#0e0f17"],"Peri Peaceful B":["#68628d","#494563","#2a2738","#0a0a0e"],"Peri Peaceful E":["#b5a0a9","#7f7076","#484044","#121011"],"Hichem Palette B":["#4fa3a5","#377273","#204142","#081010"],"Hichem Palette C":["#Fe6f9b","#b24e6d","#662c3e","#190b0f"],"Hichem Palette D":["#ffbb5a","#b3833f","#664b24","#191309"],"JSR2 A":["#E0EFC0","#9da786","#5a604d","#161813"]},palette=palettes["Sour Watermelon B"],settings$y={background:palette[3],foreground:palette[1],muted:palette[1]+"50",caret:palette[0],selection:palette[0],selectionMatch:palette[1],lineHighlight:palette[3],lineBackground:palette[3]+"90",gutterBackground:"transparent",gutterForeground:palette[0],light:!1},algoboy=createTheme({theme:"dark",settings:settings$y,styles:[{tag:tags.comment,color:palette[2]},{tag:tags.string,color:palette[1]},{tag:[tags.atom,tags.number],color:palette[1]},{tag:[tags.meta,tags.labelName,tags.variableName],color:palette[0]},{tag:[tags.keyword,tags.tagName,tags.arithmeticOperator],color:palette[1]},{tag:[tags.atom,tags.bool,tags.special(tags.variableName)],color:palette[0]},{tag:[tags.function(tags.variableName),tags.propertyName],color:palette[0]},{tag:tags.atom,color:palette[1]}]}),deepPurple="#5c019a",yellowPink="#fbeffc",grey="#272C35",pinkAccent="#fee1ff",lightGrey="#465063",bratGreen="#9acd3f",lighterGrey="#97a1b7",pink="#f6a6fd",settings$x={background:"white",lineBackground:"transparent",foreground:deepPurple,muted:deepPurple+"50",caret:"#797977",selection:yellowPink,selectionMatch:"#2B323D",gutterBackground:pinkAccent,gutterForeground:lightGrey,gutterBorder:"transparent",lineHighlight:pinkAccent,light:!0},CutiePi=createTheme({theme:"light",settings:settings$x,styles:[{tag:[tags.function(tags.variableName),tags.function(tags.propertyName),tags.url,tags.processingInstruction],color:deepPurple},{tag:[tags.tagName,tags.heading],color:settings$x.foreground},{tag:tags.comment,color:lighterGrey},{tag:[tags.variableName,tags.propertyName,tags.labelName],color:pink},{tag:[tags.attributeName,tags.number],color:"#d19a66"},{tag:tags.className,color:grey},{tag:tags.keyword,color:deepPurple},{tag:[tags.string,tags.regexp,tags.special(tags.propertyName)],color:bratGreen}]}),hex$5=["#1e1e1e","#fbde2d","#ff1493","#4c83ff","#ededed","#cccccc","#ffffff30","#dc2f8c"],settings$w={background:"#000000",lineBackground:"transparent",foreground:hex$5[4],muted:hex$5[6],selection:hex$5[6],gutterBackground:hex$5[0],gutterForeground:hex$5[5],gutterBorder:"transparent",lineHighlight:hex$5[0]},sonicPink=createTheme({theme:"dark",settings:settings$w,styles:[{tag:[tags.function(tags.variableName),tags.function(tags.propertyName),tags.url,tags.processingInstruction],color:hex$5[4]},{tag:[tags.atom,tags.bool,tags.special(tags.variableName)],color:hex$5[3]},{tag:tags.comment,color:"#54636D"},{tag:[tags.variableName,tags.propertyName,tags.labelName],color:hex$5[4]},{tag:[tags.attributeName,tags.number],color:hex$5[3]},{tag:tags.keyword,color:hex$5[1]},{tag:[tags.string,tags.regexp,tags.special(tags.propertyName)],color:hex$5[2]}]}),hex$4=["#000000","#ff5356","#bd312a","#54636D","#171717"],settings$v={background:hex$4[0],lineBackground:"transparent",foreground:hex$4[2],muted:hex$4[2]+"50",selection:hex$4[4],selectionMatch:hex$4[0],gutterBackground:hex$4[0],gutterForeground:hex$4[3],gutterBorder:"transparent",lineHighlight:hex$4[0]},redText=createTheme({theme:"dark",settings:settings$v,styles:[{tag:[tags.function(tags.variableName),tags.function(tags.propertyName),tags.url,tags.processingInstruction],color:hex$4[2]},{tag:[tags.atom,tags.bool,tags.special(tags.variableName)],color:hex$4[1]},{tag:tags.comment,color:hex$4[3]},{tag:[tags.variableName,tags.propertyName,tags.labelName],color:hex$4[2]},{tag:[tags.attributeName,tags.number],color:hex$4[1]},{tag:tags.keyword,color:hex$4[2]},{tag:[tags.string,tags.regexp,tags.special(tags.propertyName)],color:hex$4[1]}]}),hex$3=["#000000","#8ed675","#56bd2a","#54636D","#171717"],settings$u={background:hex$3[0],lineBackground:"transparent",foreground:hex$3[2],muted:hex$3[2]+"50",selection:hex$3[4],selectionMatch:hex$3[0],gutterBackground:hex$3[0],gutterForeground:hex$3[3],gutterBorder:"transparent",lineHighlight:hex$3[0]},greenText=createTheme({theme:"dark",settings:settings$u,styles:[{tag:[tags.function(tags.variableName),tags.function(tags.propertyName),tags.url,tags.processingInstruction],color:hex$3[2]},{tag:[tags.atom,tags.bool,tags.special(tags.variableName)],color:hex$3[1]},{tag:tags.comment,color:hex$3[3]},{tag:[tags.variableName,tags.propertyName,tags.labelName],color:hex$3[2]},{tag:[tags.attributeName,tags.number],color:hex$3[1]},{tag:tags.keyword,color:hex$3[2]},{tag:[tags.string,tags.regexp,tags.special(tags.propertyName)],color:hex$3[1]}]}),hex$2=["rgb(0, 0, 0)","rgb(82, 208, 250)","rgba(113, 208, 250, .4)","rgba(113, 208, 250, .15)"],settings$t={background:hex$2[0],lineBackground:"transparent",foreground:hex$2[1],muted:hex$2[2],selection:hex$2[2],selectionMatch:hex$2[0],gutterBackground:hex$2[0],gutterForeground:hex$2[2],gutterBorder:"transparent",lineHighlight:hex$2[0]},archBtw=createTheme({theme:"dark",settings:settings$t,styles:[{tag:[tags.function(tags.variableName),tags.function(tags.propertyName),tags.url,tags.processingInstruction],color:hex$2[1]},{tag:[tags.atom,tags.bool,tags.special(tags.variableName)],color:hex$2[1]},{tag:[tags.comment,tags.brace,tags.bracket],color:hex$2[2]},{tag:[tags.variableName,tags.propertyName,tags.labelName],color:hex$2[1]},{tag:[tags.attributeName,tags.number],color:hex$2[1]},{tag:tags.keyword,color:hex$2[1]},{tag:[tags.string,tags.regexp,tags.special(tags.propertyName)],color:hex$2[1]}]}),hex$1=["rgb(84, 93, 98)","rgb(255, 255, 255)","rgba(255, 255, 255, .25)","rgb(67, 76, 81)","rgb(186, 230, 115)","rgb(252, 184, 67)","rgb(124, 206, 254)","rgb(83, 101, 102)","rgba(46, 62, 72,.5)","rgb(94, 100, 108)","rgb(167, 216, 177)"],settings$s={background:hex$1[0],lineBackground:"transparent",foreground:hex$1[10],muted:hex$1[7],selection:hex$1[8],selectionMatch:hex$1[0],gutterBackground:hex$1[3],gutterForeground:hex$1[2],gutterBorder:"transparent",lineHighlight:hex$1[3]},fruitDaw=createTheme({theme:"dark",settings:settings$s,styles:[{tag:[tags.function(tags.variableName),tags.function(tags.propertyName),tags.url,tags.processingInstruction],color:hex$1[1]},{tag:[tags.bool,tags.special(tags.variableName)],color:hex$1[1]},{tag:[tags.comment,tags.brace,tags.bracket],color:hex$1[2]},{tag:[tags.variableName],color:hex$1[1]},{tag:[tags.labelName,tags.propertyName,tags.self,tags.atom],color:hex$1[5]},{tag:[tags.attributeName,tags.number],color:hex$1[6]},{tag:tags.keyword,color:hex$1[5]},{tag:[tags.string,tags.regexp,tags.special(tags.propertyName)],color:hex$1[4]}]}),hex=["rgb(75, 130, 247)","rgb(47, 108, 246)","rgb(255, 255, 255)","rgba(255, 255, 255,.3)"],settings$r={background:hex[0],lineBackground:"transparent",foreground:hex[2],muted:hex[3],selection:hex[3],selectionMatch:hex[0],gutterBackground:hex[0],gutterForeground:hex[2],gutterBorder:"transparent",lineHighlight:hex[1]},bluescreenlight=createTheme({theme:"dark",settings:settings$r,styles:[{tag:[tags.function(tags.variableName),tags.function(tags.propertyName),tags.url,tags.processingInstruction],color:hex[2]},{tag:[tags.atom,tags.bool,tags.special(tags.variableName)],color:hex[2]},{tag:[tags.comment,tags.bracket,tags.brace,tags.compareOperator],color:hex[3]},{tag:[tags.variableName,tags.propertyName,tags.labelName],color:hex[2]},{tag:[tags.attributeName,tags.number],color:hex[2]},{tag:tags.keyword,color:hex[2]},{tag:[tags.string,tags.regexp,tags.special(tags.propertyName)],color:hex[2]}]}),settings$q={background:"#282b2e",lineBackground:"#282b2e99",foreground:"#a9b7c6",muted:"#a9b7c650",caret:"#00FF00",selection:"#343739",selectionMatch:"#343739",lineHighlight:"#343739"},androidstudio=createTheme({theme:"dark",settings:{background:"#282b2e",foreground:"#a9b7c6",muted:"#a9b7c650",caret:"#00FF00",selection:"#4e5254",selectionMatch:"#4e5254",gutterForeground:"#cccccc50",lineHighlight:"#7f85891f"},styles:[{tag:tags.labelName,color:"inherit"},{tag:[tags.keyword,tags.deleted,tags.className],color:"#a9b7c6"},{tag:[tags.number,tags.literal],color:"#6897bb"},{tag:[tags.link,tags.variableName],color:"#a9b7c6"},{tag:[tags.comment,tags.quote],color:"grey"},{tag:[tags.meta,tags.documentMeta],color:"#bbb529"},{tag:[tags.propertyName,tags.attributeValue],color:"#a9b7c6"},{tag:[tags.string],color:"#6a8759"},{tag:[tags.heading,tags.typeName],color:"#ffc66d"},{tag:[tags.attributeName],color:"#a9b7c6"},{tag:[tags.emphasis],fontStyle:"italic"}]}),settings$p={background:"#272C35",lineBackground:"#272C3599",foreground:"hsl(220, 14%, 71%)",muted:"hsl(220, 14%, 41%)",caret:"#797977",selection:"#ffffff30",selectionMatch:"#2B323D",gutterBackground:"#272C35",gutterForeground:"#465063",gutterBorder:"transparent",lineHighlight:"#2B323D"},atomone=createTheme({theme:"dark",settings:{background:"#272C35",foreground:"#9d9b97",muted:"hsl(220, 14%, 41%)",caret:"#797977",selection:"#3d4c64",selectionMatch:"#3d4c64",gutterBackground:"#272C35",gutterForeground:"#465063",gutterBorder:"transparent",lineHighlight:"#2e3f5940"},styles:[{tag:[tags.function(tags.variableName),tags.function(tags.propertyName),tags.url,tags.processingInstruction],color:"hsl(207, 82%, 66%)"},{tag:[tags.atom,tags.bool,tags.special(tags.variableName)],color:"hsl( 29, 54%, 61%)"},{tag:[tags.tagName,tags.heading],color:"#e06c75"},{tag:tags.comment,color:"#54636D"},{tag:[tags.variableName,tags.propertyName,tags.labelName],color:"hsl(220, 14%, 71%)"},{tag:[tags.attributeName,tags.number],color:"hsl( 29, 54%, 61%)"},{tag:tags.className,color:"hsl( 39, 67%, 69%)"},{tag:tags.keyword,color:"hsl(286, 60%, 67%)"},{tag:[tags.string,tags.regexp,tags.special(tags.propertyName)],color:"#98c379"}]}),settings$o={background:"#21202e",lineBackground:"#21202e99",foreground:"#edecee",muted:"#edecee50",caret:"#a277ff",selection:"#3d375e7f",selectionMatch:"#3d375e7f",gutterBackground:"#21202e",gutterForeground:"#edecee",gutterBorder:"transparent",lineHighlight:"#a394f033"},aura=createTheme({theme:"dark",settings:{background:"#21202e",foreground:"#edecee",muted:"#edecee50",caret:"#a277ff",selection:"#5a51898f",selectionMatch:"#5a51898f",gutterBackground:"#21202e",gutterForeground:"#edecee",gutterBorder:"transparent",lineHighlight:"#a394f033"},styles:[{tag:tags.keyword,color:"#a277ff"},{tag:[tags.name,tags.deleted,tags.character,tags.macroName],color:"#edecee"},{tag:[tags.propertyName],color:"#ffca85"},{tag:[tags.processingInstruction,tags.string,tags.inserted,tags.special(tags.string)],color:"#61ffca"},{tag:[tags.function(tags.variableName),tags.labelName],color:"#ffca85"},{tag:[tags.color,tags.constant(tags.name),tags.standard(tags.name)],color:"#61ffca"},{tag:[tags.definition(tags.name),tags.separator],color:"#edecee"},{tag:[tags.className],color:"#82e2ff"},{tag:[tags.number,tags.changed,tags.annotation,tags.modifier,tags.self,tags.namespace],color:"#61ffca"},{tag:[tags.typeName],color:"#82e2ff"},{tag:[tags.operator,tags.operatorKeyword],color:"#a277ff"},{tag:[tags.url,tags.escape,tags.regexp,tags.link],color:"#61ffca"},{tag:[tags.meta,tags.comment],color:"#6d6d6d"},{tag:tags.strong,fontWeight:"bold"},{tag:tags.emphasis,fontStyle:"italic"},{tag:tags.link,textDecoration:"underline"},{tag:tags.heading,fontWeight:"bold",color:"#a277ff"},{tag:[tags.atom,tags.bool,tags.special(tags.variableName)],color:"#edecee"},{tag:tags.invalid,color:"#ff6767"},{tag:tags.strikethrough,textDecoration:"line-through"}]}),settings$n={background:"#242424",lineBackground:"#24242499",foreground:"#f8f8f2",muted:"#f8f8f250",caret:"#FFFFFF",selection:"rgba(255, 255, 255, 0.1)",selectionMatch:"rgba(255, 255, 255, 0.2)",gutterBackground:"rgba(255, 255, 255, 0.1)",gutterForeground:"#999",gutterBorder:"transparent",lineHighlight:"rgba(255, 255, 255, 0.1)"},darcula=createTheme({theme:"dark",settings:{background:"#242424",foreground:"#f8f8f2",muted:"#f8f8f250",caret:"#FFFFFF",selection:"rgba(255, 255, 255, 0.1)",selectionMatch:"rgba(255, 255, 255, 0.2)",gutterBackground:"transparent",gutterForeground:"#999",gutterBorder:"transparent",lineHighlight:"rgba(255, 255, 255, 0.1)"},styles:[{tag:tags.labelName,color:"#CCCCCC"},{tag:[tags.atom,tags.number],color:"#7A9EC2"},{tag:[tags.comment],color:"#707070"},{tag:[tags.string],color:"#6A8759"},{tag:[tags.variableName,tags.operator],color:"#CCCCCC"},{tag:[tags.function(tags.variableName),tags.propertyName],color:"#FFC66D"},{tag:[tags.meta,tags.className],color:"#FFC66D"},{tag:[tags.propertyName],color:"#FFC66D"},{tag:[tags.keyword],color:"#CC7832"},{tag:[tags.tagName],color:"#ff79c6"},{tag:[tags.typeName],color:"#ffb86c"}]}),settings$m={background:"#282a36",lineBackground:"#282a3699",foreground:"#f8f8f2",muted:"#f8f8f250",caret:"#f8f8f0",selection:"rgba(255, 255, 255, 0.1)",selectionMatch:"rgba(255, 255, 255, 0.2)",gutterBackground:"#282a36",gutterForeground:"#6272a4",gutterBorder:"transparent",lineHighlight:"rgba(255, 255, 255, 0.1)"},purple="#BD93F9",dracula=createTheme({theme:"dark",settings:{background:"#282a36",foreground:"#f8f8f2",muted:"#f8f8f250",caret:"#f8f8f0",selection:"rgba(255, 255, 255, 0.1)",selectionMatch:"rgba(255, 255, 255, 0.2)",gutterBackground:"#282a36",gutterForeground:"#6272a4",gutterBorder:"transparent",lineHighlight:"rgba(255, 255, 255, 0.1)"},styles:[{tag:tags.comment,color:"#6272a4"},{tag:tags.string,color:"#f1fa8c"},{tag:[tags.atom,tags.number],color:purple},{tag:[tags.meta,tags.labelName,tags.variableName],color:"#f8f8f2"},{tag:[tags.keyword,tags.tagName,tags.arithmeticOperator],color:"#ff79c6"},{tag:[tags.function(tags.variableName),tags.propertyName],color:"#50fa7b"},{tag:tags.atom,color:"#bd93f9"}]}),settings$l={background:"#2a2734",lineBackground:"#2a273499",foreground:"#eeebff",muted:"#eeebff50",caret:"#ffad5c",selection:"rgba(255, 255, 255, 0.1)",gutterBackground:"#2a2734",gutterForeground:"#545167",lineHighlight:"#36334280"},duotoneDark=createTheme({theme:"dark",settings:{background:"#2a2734",foreground:"#6c6783",muted:"#eeebff50",caret:"#ffad5c",selection:"#9a86fd",selectionMatch:"#9a86fd",gutterBackground:"#2a2734",gutterForeground:"#545167",lineHighlight:"#36334280"},styles:[{tag:[tags.comment,tags.bracket,tags.operator],color:"#6c6783"},{tag:[tags.atom,tags.number,tags.keyword,tags.link,tags.attributeName,tags.quote],color:"#ffcc99"},{tag:[tags.emphasis,tags.heading,tags.tagName,tags.propertyName,tags.className,tags.variableName],color:"#eeebff"},{tag:[tags.typeName,tags.url],color:"#eeebff"},{tag:tags.string,color:"#ffb870"},{tag:[tags.propertyName],color:"#eeebff"},{tag:tags.labelName,color:"#eeebff"}]}),settings$k={light:!0,background:"#fff",lineBackground:"#ffffff99",foreground:"#000",muted:"#00000050",caret:"#FFFFFF",selection:"#d7d4f0",selectionMatch:"#d7d4f0",gutterBackground:"#f7f7f7",gutterForeground:"#999",lineHighlight:"#e8f2ff",gutterBorder:"transparent"},eclipse=createTheme({theme:"light",settings:{background:"#fff",foreground:"#000",muted:"#00000050",caret:"#FFFFFF",selection:"#d7d4f0",selectionMatch:"#d7d4f0",gutterBackground:"#f7f7f7",gutterForeground:"#999",lineHighlight:"#006fff1c",gutterBorder:"transparent"},styles:[{tag:[tags.comment],color:"#3F7F5F"},{tag:[tags.documentMeta],color:"#FF1717"},{tag:tags.keyword,color:"#7F0055",fontWeight:"bold"},{tag:tags.atom,color:"#00f"},{tag:tags.number,color:"#164"},{tag:tags.propertyName,color:"#164"},{tag:[tags.variableName,tags.definition(tags.variableName)],color:"#0000C0"},{tag:tags.function(tags.variableName),color:"#0000C0"},{tag:tags.string,color:"#2A00FF"},{tag:tags.operator,color:"black"},{tag:tags.tagName,color:"#170"},{tag:tags.attributeName,color:"#00c"},{tag:tags.link,color:"#219"}]}),settings$j={background:"#0d1117",lineBackground:"#0d111799",foreground:"#c9d1d9",muted:"#c9d1d950",caret:"#c9d1d9",selection:"#003d73",selectionMatch:"#003d73",lineHighlight:"#36334280"},githubDark=createTheme({theme:"dark",settings:{background:"#0d1117",foreground:"#c9d1d9",muted:"#c9d1d950",caret:"#c9d1d9",selection:"#003d73",selectionMatch:"#003d73",lineHighlight:"#36334280"},styles:[{tag:tags.labelName,color:"#d2a8ff"},{tag:[tags.standard(tags.tagName),tags.tagName],color:"#7ee787"},{tag:[tags.comment,tags.bracket],color:"#8b949e"},{tag:[tags.className,tags.propertyName],color:"#d2a8ff"},{tag:[tags.variableName,tags.attributeName],color:"#d2a8ff"},{tag:[tags.number,tags.operator],color:"#79c0ff"},{tag:[tags.keyword,tags.typeName,tags.typeOperator,tags.typeName],color:"#ff7b72"},{tag:[tags.string,tags.meta,tags.regexp],color:"#a5d6ff"},{tag:[tags.name,tags.quote],color:"#7ee787"},{tag:[tags.heading,tags.strong],color:"#d2a8ff",fontWeight:"bold"},{tag:[tags.emphasis],color:"#d2a8ff",fontStyle:"italic"},{tag:[tags.deleted],color:"#ffdcd7",backgroundColor:"ffeef0"},{tag:[tags.atom,tags.bool,tags.special(tags.variableName)],color:"#ffab70"},{tag:tags.link,textDecoration:"underline"},{tag:tags.strikethrough,textDecoration:"line-through"},{tag:tags.invalid,color:"#f97583"}]}),settings$i={light:!0,background:"#fff",lineBackground:"#ffffff99",foreground:"#24292e",muted:"#24292e50",selection:"#BBDFFF",selectionMatch:"#BBDFFF",gutterBackground:"#fff",gutterForeground:"#6e7781"},githubLight=createTheme({theme:"light",settings:{background:"#fff",foreground:"#24292e",muted:"#24292e50",selection:"#BBDFFF",selectionMatch:"#BBDFFF",gutterBackground:"#fff",gutterForeground:"#6e7781"},styles:[{tag:[tags.standard(tags.tagName),tags.tagName],color:"#116329"},{tag:[tags.comment,tags.bracket],color:"#6a737d"},{tag:[tags.className,tags.propertyName],color:"#6f42c1"},{tag:[tags.variableName,tags.attributeName,tags.number,tags.operator],color:"#005cc5"},{tag:[tags.keyword,tags.typeName,tags.typeOperator,tags.typeName],color:"#d73a49"},{tag:[tags.string,tags.meta,tags.regexp],color:"#032f62"},{tag:[tags.name,tags.quote],color:"#22863a"},{tag:[tags.heading,tags.strong],color:"#24292e",fontWeight:"bold"},{tag:[tags.emphasis],color:"#24292e",fontStyle:"italic"},{tag:[tags.deleted],color:"#b31d28",backgroundColor:"ffeef0"},{tag:[tags.atom,tags.bool,tags.special(tags.variableName)],color:"#e36209"},{tag:[tags.url,tags.escape,tags.regexp,tags.link],color:"#032f62"},{tag:tags.link,textDecoration:"underline"},{tag:tags.strikethrough,textDecoration:"line-through"},{tag:tags.invalid,color:"#cb2431"}]}),settings$h={background:"#282828",lineBackground:"#28282899",foreground:"#ebdbb2",muted:"#ebdbb250",caret:"#ebdbb2",selection:"#bdae93",selectionMatch:"#bdae93",lineHighlight:"#3c3836",gutterBackground:"#282828",gutterForeground:"#7c6f64"},gruvboxDark=createTheme({theme:"dark",settings:{background:"#282828",foreground:"#ebdbb2",muted:"#ebdbb250",caret:"#ebdbb2",selection:"#b99d555c",selectionMatch:"#b99d555c",lineHighlight:"#baa1602b",gutterBackground:"#282828",gutterForeground:"#7c6f64"},styles:[{tag:tags.keyword,color:"#fb4934"},{tag:[tags.name,tags.deleted,tags.character,tags.propertyName,tags.macroName],color:"#8ec07c"},{tag:[tags.variableName],color:"#83a598"},{tag:[tags.function(tags.variableName)],color:"#8ec07c",fontStyle:"bold"},{tag:[tags.labelName],color:"#ebdbb2"},{tag:[tags.color,tags.constant(tags.name),tags.standard(tags.name)],color:"#d3869b"},{tag:[tags.definition(tags.name),tags.separator],color:"#ebdbb2"},{tag:[tags.brace],color:"#ebdbb2"},{tag:[tags.annotation],color:"#fb4934d"},{tag:[tags.number,tags.changed,tags.annotation,tags.modifier,tags.self,tags.namespace],color:"#d3869b"},{tag:[tags.typeName,tags.className],color:"#fabd2f"},{tag:[tags.operatorKeyword],color:"#fb4934"},{tag:[tags.tagName],color:"#8ec07c",fontStyle:"bold"},{tag:[tags.squareBracket],color:"#fe8019"},{tag:[tags.angleBracket],color:"#83a598"},{tag:[tags.attributeName],color:"#8ec07c"},{tag:[tags.regexp],color:"#8ec07c"},{tag:[tags.quote],color:"#928374"},{tag:[tags.string],color:"#ebdbb2"},{tag:tags.link,color:"#a89984",textDecoration:"underline",textUnderlinePosition:"under"},{tag:[tags.url,tags.escape,tags.special(tags.string)],color:"#d3869b"},{tag:[tags.meta],color:"#fabd2f"},{tag:[tags.comment],color:"#928374",fontStyle:"italic"},{tag:tags.strong,fontWeight:"bold",color:"#fe8019"},{tag:tags.emphasis,fontStyle:"italic",color:"#b8bb26"},{tag:tags.strikethrough,textDecoration:"line-through"},{tag:tags.heading,fontWeight:"bold",color:"#b8bb26"},{tag:[tags.heading1,tags.heading2],fontWeight:"bold",color:"#b8bb26"},{tag:[tags.heading3,tags.heading4],fontWeight:"bold",color:"#fabd2f"},{tag:[tags.heading5,tags.heading6],color:"#fabd2f"},{tag:[tags.atom,tags.bool,tags.special(tags.variableName)],color:"#d3869b"},{tag:[tags.processingInstruction,tags.inserted],color:"#83a598"},{tag:[tags.contentSeparator],color:"#fb4934"},{tag:tags.invalid,color:"#fe8019",borderBottom:"1px dotted #fb4934d"}]}),settings$g={light:!0,background:"#fbf1c7",lineBackground:"#fbf1c799",foreground:"#3c3836",muted:"#3c383650",caret:"#af3a03",selection:"#ebdbb2",selectionMatch:"#bdae93",lineHighlight:"#ebdbb2",gutterBackground:"#ebdbb2",gutterForeground:"#665c54",gutterBorder:"transparent"},gruvboxLight=createTheme({theme:"light",settings:{background:"#fbf1c7",foreground:"#3c3836",muted:"#3c383650",caret:"#af3a03",selection:"#bdae9391",selectionMatch:"#bdae9391",lineHighlight:"#a37f2238",gutterBackground:"#ebdbb2",gutterForeground:"#665c54",gutterBorder:"transparent"},styles:[{tag:tags.keyword,color:"#9d0006"},{tag:[tags.name,tags.deleted,tags.character,tags.propertyName,tags.macroName],color:"#427b58"},{tag:[tags.variableName],color:"#076678"},{tag:[tags.function(tags.variableName)],color:"#79740e",fontStyle:"bold"},{tag:[tags.labelName],color:"#3c3836"},{tag:[tags.color,tags.constant(tags.name),tags.standard(tags.name)],color:"#8f3f71"},{tag:[tags.definition(tags.name),tags.separator],color:"#3c3836"},{tag:[tags.brace],color:"#3c3836"},{tag:[tags.annotation],color:"#9d0006"},{tag:[tags.number,tags.changed,tags.annotation,tags.modifier,tags.self,tags.namespace],color:"#8f3f71"},{tag:[tags.typeName,tags.className],color:"#b57614"},{tag:[tags.operator,tags.operatorKeyword],color:"#9d0006"},{tag:[tags.tagName],color:"#427b58",fontStyle:"bold"},{tag:[tags.squareBracket],color:"#af3a03"},{tag:[tags.angleBracket],color:"#076678"},{tag:[tags.attributeName],color:"#427b58"},{tag:[tags.regexp],color:"#427b58"},{tag:[tags.quote],color:"#928374"},{tag:[tags.string],color:"#3c3836"},{tag:tags.link,color:"#7c6f64",textDecoration:"underline",textUnderlinePosition:"under"},{tag:[tags.url,tags.escape,tags.special(tags.string)],color:"#8f3f71"},{tag:[tags.meta],color:"#b57614"},{tag:[tags.comment],color:"#928374",fontStyle:"italic"},{tag:tags.strong,fontWeight:"bold",color:"#af3a03"},{tag:tags.emphasis,fontStyle:"italic",color:"#79740e"},{tag:tags.strikethrough,textDecoration:"line-through"},{tag:tags.heading,fontWeight:"bold",color:"#79740e"},{tag:[tags.heading1,tags.heading2],fontWeight:"bold",color:"#79740e"},{tag:[tags.heading3,tags.heading4],fontWeight:"bold",color:"#b57614"},{tag:[tags.heading5,tags.heading6],color:"#b57614"},{tag:[tags.atom,tags.bool,tags.special(tags.variableName)],color:"#8f3f71"},{tag:[tags.processingInstruction,tags.inserted],color:"#076678"},{tag:[tags.contentSeparator],color:"#9d0006"},{tag:tags.invalid,color:"#af3a03",borderBottom:"1px dotted #9d0006"}]}),settings$f={background:"#212121",lineBackground:"#21212199",foreground:"#bdbdbd",muted:"#bdbdbd50",caret:"#a0a4ae",selection:"#d7d4f0",selectionMatch:"#d7d4f0",gutterBackground:"#212121",gutterForeground:"#999",gutterActiveForeground:"#4f5b66",lineHighlight:"#111111"},materialDark=createTheme({theme:"dark",settings:{background:"#212121",foreground:"#bdbdbd",muted:"#bdbdbd50",caret:"#a0a4ae",selection:"#d7d4f063",selectionMatch:"#d7d4f063",gutterBackground:"#212121",gutterForeground:"#999",gutterActiveForeground:"#4f5b66",lineHighlight:"#333333"},styles:[{tag:tags.keyword,color:"#cf6edf"},{tag:[tags.name,tags.deleted,tags.character,tags.macroName],color:"#56c8d8"},{tag:[tags.propertyName],color:"#82AAFF"},{tag:[tags.variableName],color:"#bdbdbd"},{tag:[tags.function(tags.variableName)],color:"#82AAFF"},{tag:[tags.labelName],color:"#cf6edf"},{tag:[tags.color,tags.constant(tags.name),tags.standard(tags.name)],color:"#facf4e"},{tag:[tags.definition(tags.name),tags.separator],color:"#56c8d8"},{tag:[tags.brace],color:"#cf6edf"},{tag:[tags.annotation],color:"#f07178"},{tag:[tags.number,tags.changed,tags.annotation,tags.modifier,tags.self,tags.namespace],color:"#f07178"},{tag:[tags.typeName,tags.className],color:"#f07178"},{tag:[tags.operator,tags.operatorKeyword],color:"#82AAFF"},{tag:[tags.tagName],color:"#99d066"},{tag:[tags.squareBracket],color:"#f07178"},{tag:[tags.angleBracket],color:"#606f7a"},{tag:[tags.attributeName],color:"#bdbdbd"},{tag:[tags.regexp],color:"#f07178"},{tag:[tags.quote],color:"#6abf69"},{tag:[tags.string],color:"#99d066"},{tag:tags.link,color:"#56c8d8",textDecoration:"underline",textUnderlinePosition:"under"},{tag:[tags.url,tags.escape,tags.special(tags.string)],color:"#facf4e"},{tag:[tags.meta],color:"#707d8b"},{tag:[tags.comment],color:"#707d8b",fontStyle:"italic"},{tag:tags.monospace,color:"#bdbdbd"},{tag:tags.strong,fontWeight:"bold",color:"#f07178"},{tag:tags.emphasis,fontStyle:"italic",color:"#99d066"},{tag:tags.strikethrough,textDecoration:"line-through"},{tag:tags.heading,fontWeight:"bold",color:"#facf4e"},{tag:tags.heading1,fontWeight:"bold",color:"#facf4e"},{tag:[tags.heading2,tags.heading3,tags.heading4],fontWeight:"bold",color:"#facf4e"},{tag:[tags.heading5,tags.heading6],color:"#facf4e"},{tag:[tags.atom,tags.bool,tags.special(tags.variableName)],color:"#56c8d8"},{tag:[tags.processingInstruction,tags.inserted],color:"#f07178"},{tag:[tags.contentSeparator],color:"#56c8d8"},{tag:tags.invalid,color:"#606f7a",borderBottom:"1px dotted #f07178"}]}),settings$e={light:!0,background:"#FAFAFA",lineBackground:"#FAFAFA99",foreground:"#6182B8",muted:"#6182B850",caret:"#272727",selection:"#80CBC440",selectionMatch:"#FAFAFA",gutterBackground:"#FAFAFA",gutterForeground:"#90A4AE",gutterBorder:"transparent",lineHighlight:"#CCD7DA50"},materialLight=createTheme({theme:"light",settings:{background:"#FAFAFA",foreground:"#90A4AE",muted:"#6182B850",caret:"#272727",selection:"#80CBC440",selectionMatch:"#80CBC440",gutterBackground:"#FAFAFA",gutterForeground:"#90A4AE",gutterBorder:"transparent",lineHighlight:"#CCD7DA50"},styles:[{tag:tags.keyword,color:"#39ADB5"},{tag:[tags.name,tags.deleted,tags.character,tags.macroName],color:"#90A4AE"},{tag:[tags.propertyName],color:"#6182B8"},{tag:[tags.processingInstruction,tags.string,tags.inserted,tags.special(tags.string)],color:"#91B859"},{tag:[tags.function(tags.variableName),tags.labelName],color:"#6182B8"},{tag:[tags.color,tags.constant(tags.name),tags.standard(tags.name)],color:"#39ADB5"},{tag:[tags.definition(tags.name),tags.separator],color:"#90A4AE"},{tag:[tags.className],color:"#E2931D"},{tag:[tags.number,tags.changed,tags.annotation,tags.modifier,tags.self,tags.namespace],color:"#F76D47"},{tag:[tags.typeName],color:"#E2931D",fontStyle:"#E2931D"},{tag:[tags.operator,tags.operatorKeyword],color:"#39ADB5"},{tag:[tags.url,tags.escape,tags.regexp,tags.link],color:"#91B859"},{tag:[tags.meta,tags.comment],color:"#90A4AE"},{tag:tags.strong,fontWeight:"bold"},{tag:tags.emphasis,fontStyle:"italic"},{tag:tags.link,textDecoration:"underline"},{tag:tags.heading,fontWeight:"bold",color:"#39ADB5"},{tag:[tags.atom,tags.bool,tags.special(tags.variableName)],color:"#90A4AE"},{tag:tags.invalid,color:"#E5393570"},{tag:tags.strikethrough,textDecoration:"line-through"}]}),settings$d={background:"#2e3440",lineBackground:"#2e344099",foreground:"#FFFFFF",muted:"#FFFFFF50",caret:"#FFFFFF",selection:"#3b4252",selectionMatch:"#e5e9f0",gutterBackground:"#2e3440",gutterForeground:"#4c566a",gutterActiveForeground:"#d8dee9",lineHighlight:"#4c566a"},nord=createTheme({theme:"dark",settings:{background:"#2e3440",foreground:"#FFFFFF",muted:"#FFFFFF50",caret:"#FFFFFF",selection:"#00000073",selectionMatch:"#00000073",gutterBackground:"#2e3440",gutterForeground:"#4c566a",gutterActiveForeground:"#d8dee9",lineHighlight:"#4c566a29"},styles:[{tag:tags.keyword,color:"#5e81ac"},{tag:[tags.name,tags.deleted,tags.character,tags.propertyName,tags.macroName],color:"#88c0d0"},{tag:[tags.variableName],color:"#8fbcbb"},{tag:[tags.function(tags.variableName)],color:"#8fbcbb"},{tag:[tags.labelName],color:"#81a1c1"},{tag:[tags.color,tags.constant(tags.name),tags.standard(tags.name)],color:"#5e81ac"},{tag:[tags.definition(tags.name),tags.separator],color:"#a3be8c"},{tag:[tags.brace],color:"#8fbcbb"},{tag:[tags.annotation],color:"#d30102"},{tag:[tags.number,tags.changed,tags.annotation,tags.modifier,tags.self,tags.namespace],color:"#b48ead"},{tag:[tags.typeName,tags.className],color:"#ebcb8b"},{tag:[tags.operator,tags.operatorKeyword],color:"#a3be8c"},{tag:[tags.tagName],color:"#b48ead"},{tag:[tags.squareBracket],color:"#bf616a"},{tag:[tags.angleBracket],color:"#d08770"},{tag:[tags.attributeName],color:"#ebcb8b"},{tag:[tags.regexp],color:"#5e81ac"},{tag:[tags.quote],color:"#b48ead"},{tag:[tags.string],color:"#a3be8c"},{tag:tags.link,color:"#a3be8c",textDecoration:"underline",textUnderlinePosition:"under"},{tag:[tags.url,tags.escape,tags.special(tags.string)],color:"#8fbcbb"},{tag:[tags.meta],color:"#88c0d0"},{tag:[tags.monospace],color:"#d8dee9",fontStyle:"italic"},{tag:[tags.comment],color:"#4c566a",fontStyle:"italic"},{tag:tags.strong,fontWeight:"bold",color:"#5e81ac"},{tag:tags.emphasis,fontStyle:"italic",color:"#5e81ac"},{tag:tags.strikethrough,textDecoration:"line-through"},{tag:tags.heading,fontWeight:"bold",color:"#5e81ac"},{tag:tags.special(tags.heading1),fontWeight:"bold",color:"#5e81ac"},{tag:tags.heading1,fontWeight:"bold",color:"#5e81ac"},{tag:[tags.heading2,tags.heading3,tags.heading4],fontWeight:"bold",color:"#5e81ac"},{tag:[tags.heading5,tags.heading6],color:"#5e81ac"},{tag:[tags.atom,tags.bool,tags.special(tags.variableName)],color:"#d08770"},{tag:[tags.processingInstruction,tags.inserted],color:"#8fbcbb"},{tag:[tags.contentSeparator],color:"#ebcb8b"},{tag:tags.invalid,color:"#434c5e",borderBottom:"1px dotted #d30102"}]}),settings$c={background:"#272822",lineBackground:"#27282299",foreground:"#FFFFFF",muted:"#FFFFFF50",caret:"#FFFFFF",selection:"#49483E",selectionMatch:"#49483E",gutterBackground:"#272822",gutterForeground:"#FFFFFF70",lineHighlight:"#00000059"},monokai=createTheme({theme:"dark",settings:{background:"#272822",foreground:"#FFFFFF",muted:"#FFFFFF50",caret:"#FFFFFF",selection:"#49483E",selectionMatch:"#49483E",gutterBackground:"#272822",gutterForeground:"#FFFFFF70",lineHighlight:"#0000003b"},styles:[{tag:tags.labelName,color:"#bababa"},{tag:[tags.comment,tags.documentMeta],color:"#8292a2"},{tag:[tags.number,tags.bool,tags.null,tags.atom],color:"#ae81ff"},{tag:[tags.attributeValue,tags.className,tags.name],color:"#e6db74"},{tag:[tags.propertyName,tags.attributeName],color:"#a6e22e"},{tag:[tags.variableName],color:"#9effff"},{tag:[tags.squareBracket],color:"#bababa"},{tag:[tags.string,tags.special(tags.brace)],color:"#e6db74"},{tag:[tags.regexp,tags.className,tags.typeName,tags.definition(tags.typeName)],color:"#66d9ef"},{tag:[tags.definition(tags.variableName),tags.definition(tags.propertyName),tags.function(tags.variableName)],color:"#a6e22e"},{tag:[tags.keyword,tags.definitionKeyword,tags.modifier,tags.tagName,tags.angleBracket],color:"#f92672"}]}),settings$b={background:"#002b36",lineBackground:"#002b3699",foreground:"#93a1a1",muted:"#93a1a150",caret:"#839496",selection:"#173541",selectionMatch:"#aafe661a",gutterBackground:"#00252f",gutterForeground:"#839496",lineHighlight:"#173541"},c$2={background:"#002B36",foreground:"#839496",selection:"#004454AA",selectionMatch:"#005A6FAA",cursor:"#D30102",dropdownBackground:"#00212B",dropdownBorder:"#2AA19899",activeLine:"#00cafe11",matchingBracket:"#073642",keyword:"#859900",storage:"#93A1A1",variable:"#268BD2",parameter:"#268BD2",function:"#268BD2",string:"#2AA198",constant:"#CB4B16",type:"#859900",class:"#268BD2",number:"#D33682",comment:"#586E75",heading:"#268BD2",invalid:"#DC322F",regexp:"#DC322F",tag:"#268BD2"},solarizedDark=createTheme({theme:"dark",settings:{background:c$2.background,foreground:c$2.foreground,muted:c$2.muted,caret:c$2.cursor,selection:c$2.selection,selectionMatch:c$2.selection,gutterBackground:c$2.background,gutterForeground:c$2.foreground,gutterBorder:"transparent",lineHighlight:c$2.activeLine},styles:[{tag:tags.keyword,color:c$2.keyword},{tag:[tags.name,tags.deleted,tags.character,tags.macroName],color:c$2.variable},{tag:[tags.propertyName],color:c$2.function},{tag:[tags.processingInstruction,tags.string,tags.inserted,tags.special(tags.string)],color:c$2.string},{tag:[tags.function(tags.variableName),tags.labelName],color:c$2.function},{tag:[tags.color,tags.constant(tags.name),tags.standard(tags.name)],color:c$2.constant},{tag:[tags.definition(tags.name),tags.separator],color:c$2.variable},{tag:[tags.className],color:c$2.class},{tag:[tags.number,tags.changed,tags.annotation,tags.modifier,tags.self,tags.namespace],color:c$2.number},{tag:[tags.typeName],color:c$2.type,fontStyle:c$2.type},{tag:[tags.operator,tags.operatorKeyword],color:c$2.keyword},{tag:[tags.url,tags.escape,tags.regexp,tags.link],color:c$2.regexp},{tag:[tags.meta,tags.comment],color:c$2.comment},{tag:tags.tagName,color:c$2.tag},{tag:tags.strong,fontWeight:"bold"},{tag:tags.emphasis,fontStyle:"italic"},{tag:tags.link,textDecoration:"underline"},{tag:tags.heading,fontWeight:"bold",color:c$2.heading},{tag:[tags.atom,tags.bool,tags.special(tags.variableName)],color:c$2.variable},{tag:tags.invalid,color:c$2.invalid},{tag:tags.strikethrough,textDecoration:"line-through"}]}),settings$a={light:!0,background:"#fdf6e3",lineBackground:"#fdf6e399",foreground:"#657b83",muted:"#657b8350",caret:"#586e75",selection:"#dfd9c8",selectionMatch:"#dfd9c8",gutterBackground:"#00000010",gutterForeground:"#657b83",lineHighlight:"#dfd9c8"},c$1={background:"#FDF6E3",foreground:"#657B83",muted:"#657b8350",selection:"#EEE8D5",selectionMatch:"#EEE8D5",cursor:"#657B83",dropdownBackground:"#EEE8D5",dropdownBorder:"#D3AF86",activeLine:"#3d392d11",matchingBracket:"#EEE8D5",keyword:"#859900",storage:"#586E75",variable:"#268BD2",parameter:"#268BD2",function:"#268BD2",string:"#2AA198",constant:"#CB4B16",type:"#859900",class:"#268BD2",number:"#D33682",comment:"#93A1A1",heading:"#268BD2",invalid:"#DC322F",regexp:"#DC322F",tag:"#268BD2"},solarizedLight=createTheme({theme:"light",settings:{background:c$1.background,foreground:c$1.foreground,caret:c$1.cursor,selection:c$1.selection,selectionMatch:c$1.selectionMatch,gutterBackground:c$1.background,gutterForeground:c$1.foreground,gutterBorder:"transparent",lineHighlight:c$1.activeLine},styles:[{tag:tags.keyword,color:c$1.keyword},{tag:[tags.name,tags.deleted,tags.character,tags.macroName],color:c$1.variable},{tag:[tags.propertyName],color:c$1.function},{tag:[tags.processingInstruction,tags.string,tags.inserted,tags.special(tags.string)],color:c$1.string},{tag:[tags.function(tags.variableName),tags.labelName],color:c$1.function},{tag:[tags.color,tags.constant(tags.name),tags.standard(tags.name)],color:c$1.constant},{tag:[tags.definition(tags.name),tags.separator],color:c$1.variable},{tag:[tags.className],color:c$1.class},{tag:[tags.number,tags.changed,tags.annotation,tags.modifier,tags.self,tags.namespace],color:c$1.number},{tag:[tags.typeName],color:c$1.type,fontStyle:c$1.type},{tag:[tags.operator,tags.operatorKeyword],color:c$1.keyword},{tag:[tags.url,tags.escape,tags.regexp,tags.link],color:c$1.regexp},{tag:[tags.meta,tags.comment],color:c$1.comment},{tag:tags.tagName,color:c$1.tag},{tag:tags.strong,fontWeight:"bold"},{tag:tags.emphasis,fontStyle:"italic"},{tag:tags.link,textDecoration:"underline"},{tag:tags.heading,fontWeight:"bold",color:c$1.heading},{tag:[tags.atom,tags.bool,tags.special(tags.variableName)],color:c$1.variable},{tag:tags.invalid,color:c$1.invalid},{tag:tags.strikethrough,textDecoration:"line-through"}]}),settings$9={background:"#303841",lineBackground:"#30384199",foreground:"#FFFFFF",muted:"#FFFFFF50",caret:"#FBAC52",selection:"#4C5964",selectionMatch:"#3A546E",gutterBackground:"#303841",gutterForeground:"#FFFFFF70",lineHighlight:"#00000059"},sublime=createTheme({theme:"dark",settings:{background:"#303841",foreground:"#FFFFFF",muted:"#FFFFFF50",caret:"#FBAC52",selection:"#4C5964",selectionMatch:"#3A546E",gutterBackground:"#303841",gutterForeground:"#FFFFFF70",lineHighlight:"#00000059"},styles:[{tag:tags.labelName,color:"#A2A9B5"},{tag:[tags.meta,tags.comment],color:"#A2A9B5"},{tag:[tags.attributeName,tags.keyword],color:"#B78FBA"},{tag:tags.function(tags.variableName),color:"#5AB0B0"},{tag:[tags.string,tags.regexp,tags.attributeValue],color:"#99C592"},{tag:tags.operator,color:"#f47954"},{tag:[tags.tagName,tags.modifier],color:"#E35F63"},{tag:[tags.number,tags.definition(tags.tagName),tags.className,tags.definition(tags.variableName)],color:"#fbac52"},{tag:[tags.atom,tags.bool,tags.special(tags.variableName)],color:"#E35F63"},{tag:tags.variableName,color:"#539ac4"},{tag:[tags.propertyName,tags.typeName],color:"#629ccd"},{tag:tags.propertyName,color:"#36b7b5"}]}),settings$8={background:"#1a1b26",lineBackground:"#1a1b2699",foreground:"#f8fcf9",muted:"#f8fcf950",caret:"#c0caf5",selection:"#515c7e40",selectionMatch:"#16161e",gutterBackground:"#1a1b26",gutterForeground:"#787c99",gutterBorder:"transparent",lineHighlight:"#1e202e"},tokyoNight=createTheme({theme:"dark",settings:{background:"#1a1b26",foreground:"#f8fcf9",muted:"#f8fcf950",caret:"#c0caf5",selection:"#515c7e40",selectionMatch:"#16161e",gutterBackground:"#1a1b26",gutterForeground:"#787c99",gutterBorder:"transparent",lineHighlight:"#474b6611"},styles:[{tag:tags.keyword,color:"#bb9af7"},{tag:[tags.name,tags.deleted,tags.character,tags.macroName],color:"#c0caf5"},{tag:[tags.propertyName],color:"#7aa2f7"},{tag:[tags.processingInstruction,tags.string,tags.inserted,tags.special(tags.string)],color:"#9ece6a"},{tag:[tags.function(tags.variableName),tags.labelName],color:"#7aa2f7"},{tag:[tags.color,tags.constant(tags.name),tags.standard(tags.name)],color:"#bb9af7"},{tag:[tags.definition(tags.name),tags.separator],color:"#c0caf5"},{tag:[tags.className],color:"#c0caf5"},{tag:[tags.number,tags.changed,tags.annotation,tags.modifier,tags.self,tags.namespace],color:"#ff9e64"},{tag:[tags.typeName],color:"#0db9d7"},{tag:[tags.operator,tags.operatorKeyword],color:"#bb9af7"},{tag:[tags.url,tags.escape,tags.regexp,tags.link],color:"#b4f9f8"},{tag:[tags.meta,tags.comment],color:"#444b6a"},{tag:tags.strong,fontWeight:"bold"},{tag:tags.emphasis,fontStyle:"italic"},{tag:tags.link,textDecoration:"underline"},{tag:tags.heading,fontWeight:"bold",color:"#89ddff"},{tag:[tags.atom,tags.bool,tags.special(tags.variableName)],color:"#c0caf5"},{tag:tags.invalid,color:"#ff5370"},{tag:tags.strikethrough,textDecoration:"line-through"}]}),settings$7={background:"#24283b",lineBackground:"#24283b99",foreground:"#f9f2f9",muted:"#f9f2f950",caret:"#c0caf5",selection:"#6f7bb630",selectionMatch:"#1f2335",gutterBackground:"#24283b",gutterForeground:"#7982a9",gutterBorder:"transparent",lineHighlight:"#292e42"},tokyoNightStorm=createTheme({theme:"dark",settings:{background:"#24283b",foreground:"#f9f2f9",muted:"#f9f2f950",caret:"#c0caf5",selection:"#6f7bb630",selectionMatch:"#343b5f",gutterBackground:"#24283b",gutterForeground:"#7982a9",gutterBorder:"transparent",lineHighlight:"#292e427a"},styles:[{tag:tags.keyword,color:"#bb9af7"},{tag:[tags.name,tags.deleted,tags.character,tags.macroName],color:"#c0caf5"},{tag:[tags.propertyName],color:"#7aa2f7"},{tag:[tags.processingInstruction,tags.string,tags.inserted,tags.special(tags.string)],color:"#9ece6a"},{tag:[tags.function(tags.variableName),tags.labelName],color:"#7aa2f7"},{tag:[tags.color,tags.constant(tags.name),tags.standard(tags.name)],color:"#bb9af7"},{tag:[tags.definition(tags.name),tags.separator],color:"#c0caf5"},{tag:[tags.className],color:"#c0caf5"},{tag:[tags.number,tags.changed,tags.annotation,tags.modifier,tags.self,tags.namespace],color:"#ff9e64"},{tag:[tags.typeName],color:"#2ac3de",fontStyle:"#2ac3de"},{tag:[tags.operator,tags.operatorKeyword],color:"#bb9af7"},{tag:[tags.url,tags.escape,tags.regexp,tags.link],color:"#b4f9f8"},{tag:[tags.meta,tags.comment],color:"#565f89"},{tag:tags.strong,fontWeight:"bold"},{tag:tags.emphasis,fontStyle:"italic"},{tag:tags.link,textDecoration:"underline"},{tag:tags.heading,fontWeight:"bold",color:"#89ddff"},{tag:[tags.atom,tags.bool,tags.special(tags.variableName)],color:"#c0caf5"},{tag:tags.invalid,color:"#ff5370"},{tag:tags.strikethrough,textDecoration:"line-through"}]}),settings$6={light:!0,background:"#e1e2e7",lineBackground:"#e1e2e799",foreground:"#3760bf",muted:"#3760bf50",caret:"#3760bf",selection:"#99a7df",selectionMatch:"#99a7df",gutterBackground:"#e1e2e7",gutterForeground:"#3760bf",gutterBorder:"transparent",lineHighlight:"#5f5faf11"},tokyoNightDay=createTheme({theme:"light",settings:{background:"#e1e2e7",foreground:"#3760bf",muted:"#3760bf50",caret:"#3760bf",selection:"#99a7df",selectionMatch:"#99a7df",gutterBackground:"#e1e2e7",gutterForeground:"#3760bf",gutterBorder:"transparent",lineHighlight:"#5f5faf11"},styles:[{tag:tags.keyword,color:"#007197"},{tag:[tags.name,tags.deleted,tags.character,tags.macroName],color:"#3760bf"},{tag:[tags.propertyName],color:"#3760bf"},{tag:[tags.processingInstruction,tags.string,tags.inserted,tags.special(tags.string)],color:"#587539"},{tag:[tags.function(tags.variableName),tags.labelName],color:"#3760bf"},{tag:[tags.color,tags.constant(tags.name),tags.standard(tags.name)],color:"#3760bf"},{tag:[tags.definition(tags.name),tags.separator],color:"#3760bf"},{tag:[tags.className],color:"#3760bf"},{tag:[tags.number,tags.changed,tags.annotation,tags.modifier,tags.self,tags.namespace],color:"#b15c00"},{tag:[tags.typeName],color:"#007197",fontStyle:"#007197"},{tag:[tags.operator,tags.operatorKeyword],color:"#007197"},{tag:[tags.url,tags.escape,tags.regexp,tags.link],color:"#587539"},{tag:[tags.meta,tags.comment],color:"#848cb5"},{tag:tags.strong,fontWeight:"bold"},{tag:tags.emphasis,fontStyle:"italic"},{tag:tags.link,textDecoration:"underline"},{tag:tags.heading,fontWeight:"bold",color:"#b15c00"},{tag:[tags.atom,tags.bool,tags.special(tags.variableName)],color:"#3760bf"},{tag:tags.invalid,color:"#f52a65"},{tag:tags.strikethrough,textDecoration:"line-through"}]}),settings$5={background:"#1e1e1e",lineBackground:"#1e1e1e99",foreground:"#fff",muted:"#ffffff50",caret:"#c6c6c6",selection:"#6199ff2f",selectionMatch:"#72a1ff59",lineHighlight:"#ffffff0f",gutterBackground:"#1e1e1e",gutterForeground:"#838383",gutterActiveForeground:"#fff"},vscodeDark=createTheme({theme:"dark",settings:{background:"#1e1e1e",foreground:"#fff",muted:"#ffffff50",caret:"#c6c6c6",selection:"#6199ff2f",selectionMatch:"#72a1ff59",lineHighlight:"#ffffff0f",gutterBackground:"#1e1e1e",gutterForeground:"#838383",gutterActiveForeground:"#fff",fontFamily:'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace'},styles:[{tag:[tags.keyword,tags.operatorKeyword,tags.modifier,tags.color,tags.constant(tags.name),tags.standard(tags.name),tags.standard(tags.tagName),tags.special(tags.brace),tags.atom,tags.bool,tags.special(tags.variableName)],color:"#569cd6"},{tag:[tags.controlKeyword,tags.moduleKeyword],color:"#c586c0"},{tag:[tags.name,tags.deleted,tags.character,tags.macroName,tags.propertyName,tags.variableName,tags.labelName,tags.definition(tags.name)],color:"#9cdcfe"},{tag:tags.heading,fontWeight:"bold",color:"#9cdcfe"},{tag:[tags.typeName,tags.className,tags.tagName,tags.number,tags.changed,tags.annotation,tags.self,tags.namespace],color:"#4ec9b0"},{tag:[tags.function(tags.variableName),tags.function(tags.propertyName)],color:"#dcdcaa"},{tag:[tags.number],color:"#b5cea8"},{tag:[tags.operator,tags.punctuation,tags.separator,tags.url,tags.escape,tags.regexp],color:"#d4d4d4"},{tag:[tags.regexp],color:"#d16969"},{tag:[tags.special(tags.string),tags.processingInstruction,tags.string,tags.inserted],color:"#ce9178"},{tag:[tags.angleBracket],color:"#808080"},{tag:tags.strong,fontWeight:"bold"},{tag:tags.emphasis,fontStyle:"italic"},{tag:tags.strikethrough,textDecoration:"line-through"},{tag:[tags.meta,tags.comment],color:"#6a9955"},{tag:tags.link,color:"#6a9955",textDecoration:"underline"},{tag:tags.invalid,color:"#ff0000"}]}),settings$4={background:"#ffffff",lineBackground:"#ffffff50",foreground:"#383a42",muted:"#383a4250",caret:"#000",selection:"#add6ff",selectionMatch:"#a8ac94",lineHighlight:"#99999926",gutterBackground:"#fff",gutterForeground:"#237893",gutterActiveForeground:"#0b216f",fontFamily:'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace'},vscodeLight=createTheme({theme:"light",settings:{background:"#ffffff",foreground:"#383a42",muted:"#383a4250",caret:"#000",selection:"#add6ff",selectionMatch:"#a8ac94",lineHighlight:"#99999926",gutterBackground:"#fff",gutterForeground:"#237893",gutterActiveForeground:"#0b216f",fontFamily:'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace'},styles:[{tag:[tags.keyword,tags.operatorKeyword,tags.modifier,tags.color,tags.constant(tags.name),tags.standard(tags.name),tags.standard(tags.tagName),tags.special(tags.brace),tags.atom,tags.bool,tags.special(tags.variableName)],color:"#0000ff"},{tag:[tags.moduleKeyword,tags.controlKeyword],color:"#af00db"},{tag:[tags.name,tags.deleted,tags.character,tags.macroName,tags.propertyName,tags.variableName,tags.labelName,tags.definition(tags.name)],color:"#0070c1"},{tag:tags.heading,fontWeight:"bold",color:"#0070c1"},{tag:[tags.typeName,tags.className,tags.tagName,tags.number,tags.changed,tags.annotation,tags.self,tags.namespace],color:"#267f99"},{tag:[tags.function(tags.variableName),tags.function(tags.propertyName)],color:"#795e26"},{tag:[tags.number],color:"#098658"},{tag:[tags.operator,tags.punctuation,tags.separator,tags.url,tags.escape,tags.regexp],color:"#383a42"},{tag:[tags.regexp],color:"#af00db"},{tag:[tags.special(tags.string),tags.processingInstruction,tags.string,tags.inserted],color:"#a31515"},{tag:[tags.angleBracket],color:"#383a42"},{tag:tags.strong,fontWeight:"bold"},{tag:tags.emphasis,fontStyle:"italic"},{tag:tags.strikethrough,textDecoration:"line-through"},{tag:[tags.meta,tags.comment],color:"#008000"},{tag:tags.link,color:"#4078f2",textDecoration:"underline"},{tag:tags.invalid,color:"#e45649"}]}),settings$3={light:!0,background:"#fff",lineBackground:"#ffffff99",foreground:"#3D3D3D",muted:"#3D3D3D50",selection:"#BBDFFF",selectionMatch:"#BBDFFF",gutterBackground:"#fff",gutterForeground:"#AFAFAF",lineHighlight:"#EDF4FF"},xcodeLight=createTheme({theme:"light",settings:{background:"#fff",foreground:"#3D3D3D",muted:"#3D3D3D50",selection:"#BBDFFF",selectionMatch:"#BBDFFF",gutterBackground:"#fff",gutterForeground:"#AFAFAF",lineHighlight:"#d5e6ff69"},styles:[{tag:[tags.comment,tags.quote],color:"#707F8D"},{tag:[tags.typeName,tags.typeOperator],color:"#aa0d91"},{tag:[tags.keyword],color:"#aa0d91",fontWeight:"bold"},{tag:[tags.string,tags.meta],color:"#D23423"},{tag:[tags.name],color:"#032f62"},{tag:[tags.typeName],color:"#522BB2"},{tag:[tags.variableName],color:"#23575C"},{tag:[tags.definition(tags.variableName)],color:"#327A9E"},{tag:[tags.regexp,tags.link],color:"#0e0eff"}]}),settings$2={light:!0,background:"#FFFFFF",lineBackground:"#FFFFFF99",foreground:"#000000",muted:"#00000050",caret:"#FBAC52",selection:"#FFD420",selectionMatch:"#FFD420",gutterBackground:"#f5f5f5",gutterForeground:"#4D4D4C",gutterBorder:"transparent",lineHighlight:"#00000012"},bbedit=createTheme({theme:"light",settings:{background:"#FFFFFF",foreground:"#000000",muted:"#00000050",caret:"#FBAC52",selection:"#FFD420",selectionMatch:"#FFD420",gutterBackground:"#f5f5f5",gutterForeground:"#4D4D4C",gutterBorder:"transparent",lineHighlight:"#00000012"},styles:[{tag:[tags.meta,tags.comment],color:"#804000"},{tag:[tags.keyword,tags.strong],color:"#0000FF"},{tag:[tags.number],color:"#FF0080"},{tag:[tags.string],color:"#FF0080"},{tag:[tags.variableName],color:"#006600"},{tag:[tags.escape],color:"#33CC33"},{tag:[tags.tagName],color:"#1C02FF"},{tag:[tags.heading],color:"#0C07FF"},{tag:[tags.quote],color:"#000000"},{tag:[tags.list],color:"#B90690"},{tag:[tags.documentMeta],color:"#888888"},{tag:[tags.function(tags.variableName)],color:"#0000A2"},{tag:[tags.definition(tags.typeName),tags.typeName],color:"#6D79DE"}]}),settings$1={light:!0,background:"#f2f1f8",lineBackground:"#f2f1f899",foreground:"#0c006b",muted:"#0c006b50",caret:"#5c49e9",selection:"#d5d1f2",selectionMatch:"#d5d1f2",gutterBackground:"#f2f1f8",gutterForeground:"#0c006b70",lineHighlight:"#e1def3"},noctisLilac=createTheme({theme:"light",settings:{background:"#f2f1f8",foreground:"#0c006b",muted:"#0c006b50",caret:"#5c49e9",selection:"#d5d1f2",selectionMatch:"#d5d1f2",gutterBackground:"#f2f1f8",gutterForeground:"#0c006b70",lineHighlight:"#16067911"},styles:[{tag:tags.comment,color:"#9995b7"},{tag:tags.keyword,color:"#ff5792",fontWeight:"bold"},{tag:[tags.definitionKeyword,tags.modifier],color:"#ff5792"},{tag:[tags.className,tags.tagName,tags.definition(tags.typeName)],color:"#0094f0"},{tag:[tags.number,tags.bool,tags.null,tags.special(tags.brace)],color:"#5842ff"},{tag:[tags.definition(tags.propertyName),tags.function(tags.variableName)],color:"#0095a8"},{tag:tags.typeName,color:"#b3694d"},{tag:[tags.propertyName,tags.variableName],color:"#fa8900"},{tag:tags.operator,color:"#ff5792"},{tag:tags.self,color:"#e64100"},{tag:[tags.string,tags.regexp],color:"#00b368"},{tag:[tags.paren,tags.bracket],color:"#0431fa"},{tag:tags.labelName,color:"#00bdd6"},{tag:tags.attributeName,color:"#e64100"},{tag:tags.angleBracket,color:"#9995b7"}]}),themes={strudelTheme,clientNdk,algoboy,archBtw,androidstudio,atomone,aura,bbedit,blackscreen,bluescreen,bluescreenlight,CutiePi,darcula,dracula,duotoneDark,eclipse,fruitDaw,githubDark,githubLight,greenText,gruvboxDark,gruvboxLight,sonicPink,materialDark,materialLight,monokai,noctisLilac,nord,redText,solarizedDark,solarizedLight,sublime,teletext,tokyoNight,tokyoNightDay,tokyoNightStorm,vscodeDark,vscodeLight,whitescreen,xcodeLight},settings={strudelTheme:settings$E,clientNdk:settings$D,bluescreen:settings$C,bluescreenlight:settings$r,blackscreen:settings$B,whitescreen:settings$A,teletext:settings$z,algoboy:settings$y,archBtw:settings$t,androidstudio:settings$q,atomone:settings$p,aura:settings$o,bbedit:settings$2,darcula:settings$n,dracula:settings$m,duotoneDark:settings$l,eclipse:settings$k,CutiePi:settings$x,sonicPink:settings$w,fruitDaw:settings$s,githubLight:settings$i,githubDark:settings$j,greenText:settings$u,gruvboxDark:settings$h,gruvboxLight:settings$g,materialDark:settings$f,materialLight:settings$e,noctisLilac:settings$1,nord:settings$d,monokai:settings$c,redText:settings$v,solarizedLight:settings$a,solarizedDark:settings$b,sublime:settings$9,tokyoNight:settings$8,tokyoNightStorm:settings$7,vscodeDark:settings$5,vscodeLight:settings$4,xcodeLight:settings$3,tokyoNightDay:settings$6};function getColors(o){const e=/#([0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})/g,l=[];let d;for(;(d=e.exec(o))!==null;){const p=d[0];l.includes(p)||l.push(p)}return l}function themeColors(o){return getColors(stringifySafe(o))}function getCircularReplacer(){const o=new WeakSet;return(e,l)=>{if(typeof l=="object"&&l!==null){if(o.has(l))return;o.add(l)}return l}}function stringifySafe(o){return JSON.stringify(o,getCircularReplacer())}const theme=o=>themes[o]||themes.strudelTheme;function injectStyle(o){const e=document.createElement("style");document.head.appendChild(e);const l=e.sheet,d=l.insertRule(o,0);return()=>l.deleteRule(d)}let currentTheme,resetThemeStyle,themeStyle,styleID="strudel-theme-vars";function initTheme(o){document.getElementById(styleID)||(themeStyle=document.createElement("style"),themeStyle.id=styleID,document.head.append(themeStyle)),activateTheme(o)}function activateTheme(o){if(currentTheme===o)return;currentTheme=o,settings[o]||console.warn("theme",o,"has no settings.. defaulting to strudelTheme settings");const e=settings[o]||settings.strudelTheme;themeStyle.innerHTML=`:root {
|
||
color-scheme: ${e.light?"light":"dark"};
|
||
${Object.entries(e).map(([l,d])=>`--${l}: ${d} !important;`).join(`
|
||
`)}
|
||
}`,setTheme(e),e.light?document.documentElement.classList.remove("dark"):document.documentElement.classList.add("dark"),resetThemeStyle?.(),resetThemeStyle=void 0,e.customStyle&&(resetThemeStyle=injectStyle(e.customStyle))}const getDocLabel=o=>o.name||o.longname;let ctrlDown=!1;typeof window<"u"&&(window.addEventListener("keyup",function(o){o.key=="Control"&&(ctrlDown=!1)},!0),window.addEventListener("keydown",function(o){o.key=="Control"&&(ctrlDown=!0)},!0));const strudelTooltip=hoverTooltip((o,e,l)=>{if(!ctrlDown)return null;let{from:d,to:p,text:b}=o.state.doc.lineAt(e),R=e,I=e;for(;R>d&&/\w/.test(b[R-d-1]);)R--;for(;I<p&&/\w/.test(b[I-d]);)I++;if(R==e&&l<0||I==e&&l>0)return null;let z=b.slice(R-d,I-d),se=jsdoc.docs.filter(le=>getDocLabel(le)===z)[0];if(!se){const le=jsdoc.docs.filter(tn=>tn.synonyms&&tn.synonyms.includes(z))[0];if(!le)return null;se=getSynonymDoc(le,z)}return{pos:R,end:I,above:!1,arrow:!0,create(le){let tn=document.createElement("div");tn.className="strudel-tooltip";const an=Autocomplete(se);return tn.appendChild(an),{dom:tn}}}},{hoverTime:10}),isTooltipEnabled=o=>o?strudelTooltip:[],setWidgets=StateEffect.define(),setWidgetsInRange=StateEffect.define(),updateWidgets=(o,e,l=null)=>{l?o.dispatch({effects:setWidgetsInRange.of({widgets:e,range:l})}):o.dispatch({effects:setWidgets.of(e)})};function getWidgets(o,e){return o.filter(d=>d&&d.type&&d.type!=="slider").filter((d,p,b)=>p===b.findIndex(R=>R.type===d.type&&R.id===d.id)).sort((d,p)=>(d.to||0)-(p.to||0)).map(d=>{try{return Decoration.widget({widget:new BlockWidget(d,e),side:0}).range(d.to||d.from||0)}catch(p){return console.error("error creating widget",p),null}}).filter(Boolean)}const widgetPlugin=ViewPlugin.fromClass(class{decorations;constructor(o){this.decorations=Decoration.set([])}update(o){o.transactions.forEach(e=>{if(e.docChanged){this.decorations=this.decorations.map(e.changes);const l=this.decorations.iter();for(;l.value;)l.value?.widget instanceof BlockWidget&&(l.value.widget.from=l.from,l.value.widget.to=l.to),l.next()}for(let l of e.effects)if(l.is(setWidgetsInRange)){const{widgets:d,range:p}=l.value,[b,R]=p,I=[];this.decorations.between(0,o.view.state.doc.length,(se,le,tn)=>{tn.widget instanceof BlockWidget&&(se<b||se>R)&&I.push({from:tn.widget.from,to:tn.widget.to,type:tn.widget.type,index:tn.widget.index,id:tn.widget.id})});const z=[...I,...d].filter((se,le,tn)=>le===tn.findIndex(an=>an.type===se.type&&an.id===se.id));this.decorations=Decoration.set(getWidgets(z,o.view))}else l.is(setWidgets)&&(this.decorations=Decoration.set(getWidgets(l.value,o.view)))})}},{decorations:o=>o.decorations}),widgetElements={};function setWidget(o,e){widgetElements[o]=e,e.id=o}class BlockWidget extends WidgetType{constructor(e,l){super(),(!e||typeof e!="object")&&(e={type:"unknown",from:0,to:0}),this.from=e.from||0,this.originalFrom=e.from||0,this.to=e.to||this.from,this.originalTo=e.to||this.from,this.type=e.type||"unknown",this.index=e.index||0,this.view=l,this.id=e.id||getWidgetID?.(e),this.widgetConfig=e}eq(e){return e instanceof BlockWidget?this.id===e.id&&this.from===e.from&&this.to===e.to&&this.type===e.type&&this.index===e.index:!1}toDOM(){let e=document.createElement("span");e.setAttribute("aria-hidden","true"),e.className="cm-widget-container";let l=widgetElements[this.id];if(l)l.id=this.id,e.appendChild(l);else{const d=document.createElement("span");d.setAttribute("aria-hidden","true"),d.className="cm-widget-placeholder",d.style.cssText="display: none;",d.id=this.id,e.appendChild(d)}return e}ignoreEvent(e){return!0}}function getActiveWidgets(o){if(!o||!o.state)return[];const e=o.plugin(widgetPlugin);if(!e||!e.decorations)return[];const l=[];return e.decorations.between(0,o.state.doc.length,(d,p,b)=>{b.widget instanceof BlockWidget&&l.push({type:b.widget.type,from:b.widget.from,to:b.widget.to,index:b.widget.index,id:b.widget.id})}),l}function getAllWidgetIds(o){if(!o||!o.state)return[];const e=o.plugin(widgetPlugin);if(!e||!e.decorations)return[];const l=[];return e.decorations.between(0,o.state.doc.length,(d,p,b)=>{b.widget instanceof BlockWidget&&l.push(b.widget.id)}),l}function registerWidget(o,e){registerWidgetType(o),e&&(Pattern$1.prototype[o]=function(l,d={fold:1}){return e(l,d,this)})}function getCanvasWidget(o,e={}){const{width:l=500,height:d=60,pixelRatio:p=window.devicePixelRatio}=e;let b=document.getElementById(o)||document.createElement("canvas");return b.width=l*p,b.height=d*p,b.style.width=l+"px",b.style.height=d+"px",setWidget(o,b),b}registerWidget("_pianoroll",(o,e={},l)=>{const d=getCanvasWidget(o,e).getContext("2d");return l.tag(o).pianoroll({fold:1,...e,ctx:d,id:o})}),registerWidget("_punchcard",(o,e={},l)=>{const d=getCanvasWidget(o,e).getContext("2d");return l.tag(o).punchcard({fold:1,...e,ctx:d,id:o})}),registerWidget("_spiral",(o,e={},l)=>{let d=e.size||275;e={width:d,height:d,...e,size:d/5};const p=getCanvasWidget(o,e).getContext("2d");return l.tag(o).spiral({...e,ctx:p,id:o})}),registerWidget("_scope",(o,e={},l)=>{e={width:500,height:60,pos:.5,scale:1,...e};const d=getCanvasWidget(o,e).getContext("2d");return l.tag(o).scope({...e,ctx:d,id:o})}),registerWidget("_pitchwheel",(o,e={},l)=>{let d=e.size||200;e={width:d,height:d,...e,size:d/5};const p=getCanvasWidget(o,e).getContext("2d");return l.pitchwheel({...e,ctx:p,id:o})}),registerWidget("_spectrum",(o,e={},l)=>{let d=e.size||200;e={width:d,height:d,...e,size:d/5};const p=getCanvasWidget(o,e).getContext("2d");return l.spectrum({...e,ctx:p,id:o})});const extensions={isLineWrappingEnabled:o=>o?EditorView.lineWrapping:[],isBracketMatchingEnabled:o=>o?bracketMatching({brackets:"()[]{}<>"}):[],isBracketClosingEnabled:o=>o?closeBrackets():[],isLineNumbersDisplayed:o=>o?lineNumbers():[],theme,isAutoCompletionEnabled,isTooltipEnabled,isPatternHighlightingEnabled,isActiveLineHighlighted:o=>o?[highlightActiveLine(),highlightActiveLineGutter()]:[],isFlashEnabled,keybindings,isTabIndentationEnabled:o=>o?keymap.of([indentWithTab]):[],isMultiCursorEnabled:o=>o?[EditorState.allowMultipleSelections.of(!0),EditorView.clickAddsSelectionRange.of(e=>e.metaKey||e.ctrlKey)]:[]},compartments=Object.fromEntries(Object.keys(extensions).map(o=>[o,new Compartment])),defaultSettings={keybindings:"codemirror",isBracketMatchingEnabled:!1,isBracketClosingEnabled:!0,isLineNumbersDisplayed:!0,isActiveLineHighlighted:!1,isAutoCompletionEnabled:!1,isPatternHighlightingEnabled:!0,isFlashEnabled:!0,isTooltipEnabled:!1,isLineWrappingEnabled:!1,isTabIndentationEnabled:!1,isMultiCursorEnabled:!1,isBlockBasedEvalEnabled:!1,theme:"strudelTheme",fontFamily:"monospace",fontSize:18},codemirrorSettings=persistentAtom("codemirror-settings",defaultSettings,{encode:JSON.stringify,decode:JSON.parse});function initEditor({initialCode:o="",onChange:e,onEvaluate:l,onStop:d,root:p,mondo:b,strudelMirror:R}){const I=codemirrorSettings.get(),z=Object.keys(compartments).map(le=>compartments[le].of(extensions[le](parseBooleans(I[le]))));initTheme(I.theme);let se=EditorState.create({doc:o,extensions:[...z,basicSetup,b?[]:javascript(),javascriptLanguage.data.of({closeBrackets:{brackets:["(","[","{","'",'"',"<"]},bracketMatching:{brackets:["(","[","{","'",'"',"<"]}}),sliderPlugin,widgetPlugin,syntaxHighlighting(defaultHighlightStyle),EditorView.updateListener.of(le=>e(le)),drawSelection({cursorBlinkRate:0}),Prec.highest(keymap.of([{key:"Ctrl-Enter",run:()=>R?.isBlockBasedEvalEnabled?(evalBlock(R),!0):l?.()},{key:"Alt-Enter",run:()=>R?.isBlockBasedEvalEnabled?(evalBlock(R),!0):l?.()},{key:"Ctrl-.",run:()=>d?.()},{key:"Alt-.",preventDefault:!0,run:()=>d?.()},{key:"Alt-w",run:le=>jumpToCharacter(le,"$",1)},{key:"Alt-q",run:le=>jumpToCharacter(le,"$",-1)}]))]});return new EditorView({state:se,parent:p})}class StrudelMirror{constructor(e){const{root:l,id:d,initialCode:p="",onDraw:b,drawContext:R,drawTime:I=[0,0],autodraw:z,prebake:se,bgFill:le=!0,solo:tn=!0,...an}=e;this.code=p,this.root=l,this.miniLocations=[],this.widgets=[],this.drawTime=I,this.drawContext=R,this.onDraw=b||this.draw,this.id=d||s4(),this.solo=tn,this.isBlockBasedEvalEnabled=!1,this.drawer=new Drawer((un,pn,yn,_n)=>{const Pn=un.filter(vn=>vn.isActive(pn));this.highlight(Pn,pn),this.onDraw(un,pn,_n)},I),this.prebaked=se(),z&&this.drawFirstFrame(),this.repl=repl$1({...an,id:d,onToggle:un=>{an?.onToggle?.(un),un?(this.drawer.start(this.repl.scheduler),this.solo&&document.dispatchEvent(new CustomEvent("start-repl",{detail:this.id}))):(this.drawer.stop(),updateMiniLocations(this.editor,[]),cleanupDraw(!0,d))},beforeEval:async({blockBased:un}={})=>{un||cleanupDraw(!0,d),await this.prebaked,await an?.beforeEval?.()},afterEval:un=>{this.miniLocations=un.meta?.miniLocations||[],this.widgets=un.meta?.widgets;const pn=this.widgets.filter(vn=>vn.type==="slider"),yn=this.widgets.filter(vn=>vn.type!=="slider"),_n=un.range&&un.range.length>=2?un.range:null;updateSliderWidgets(this.editor,pn,_n),updateWidgets(this.editor,yn,_n),updateMiniLocations(this.editor,this.miniLocations,_n),an?.afterEval?.(un);const Pn=un.pattern.getPainters().length?this.drawTime:[0,0];this.drawer.setDrawTime(Pn),this.drawer.invalidate(this.repl.scheduler),un.widgetRemoved&&cleanupDrawContext(d)}}),this.cleanupDrawContext=()=>cleanupDrawContext(d),this.editor=initEditor({root:l,initialCode:p,onChange:un=>{un.docChanged&&(this.code=un.state.doc.toString(),this.repl.setCode?.(this.code))},onEvaluate:()=>this.evaluate(),onStop:()=>this.stop(),mondo:an.mondo,strudelMirror:this});const sn=this.root.querySelector(".cm-editor");sn&&(this.root.style.display="block",le&&(this.root.style.backgroundColor="var(--background)"),sn.style.backgroundColor="transparent");const ln=codemirrorSettings.get();this.setFontSize(ln.fontSize),this.setFontFamily(ln.fontFamily),this.onStartRepl=un=>{this.solo&&un.detail!==this.id&&this.stop()},document.addEventListener("start-repl",this.onStartRepl),this.onEvaluateRequest=un=>{try{if(un.detail.view!==this.editor)return;logger$2("[repl] evaluate via event"),this.evaluate(),un?.cancelable&&un.preventDefault?.()}catch(pn){console.error("Error handling repl-evaluate event",pn)}},document.addEventListener("repl-evaluate",this.onEvaluateRequest),document.addEventListener("repl-stop",this.onStopRequest),this.onToggleComment=un=>{try{if(un.detail.view!==this.editor)return;toggleLineComment(this.editor),un?.cancelable&&un.preventDefault?.()}catch(pn){console.error("Error handling repl-toggle-comment event",pn)}},document.addEventListener("repl-toggle-comment",this.onToggleComment)}draw(e,l,d){d?.forEach(p=>p(this.drawContext,l,e,this.drawTime))}async drawFirstFrame(){if(this.onDraw){await this.prebaked;try{await this.repl.evaluate(this.code,!1),this.drawer.invalidate(this.repl.scheduler,-.001),this.onDraw?.(this.drawer.visibleHaps,-.001,this.drawer.painters)}catch{console.warn("first frame could not be painted")}}}async evaluate(e=!0){this.flash(),await this.repl.evaluate(this.code,e)}async stop(){this.repl.stop()}onStopRequest=e=>{try{if(e.detail.view!==this.editor)return;this.stop(),e?.cancelable&&e.preventDefault?.()}catch(l){console.error("Error handling repl-stop event",l)}};async toggle(){this.repl.scheduler.started?this.repl.stop():this.evaluate()}flash(e,l){flash(this.editor,e,l)}highlight(e,l){highlightMiniLocations(this.editor,l,e)}setFontSize(e){this.root.style.fontSize=e+"px"}setFontFamily(e){this.root.style.fontFamily=e;const l=this.root.querySelector(".cm-scroller");l&&(l.style.fontFamily=e)}reconfigureExtension(e,l){if(!extensions[e]){console.warn(`extension ${e} is not known`);return}l=parseBooleans(l);const d=extensions[e](l,this);this.editor.dispatch({effects:compartments[e].reconfigure(d)}),e==="theme"&&activateTheme(l)}setLineWrappingEnabled(e){this.reconfigureExtension("isLineWrappingEnabled",e)}setBlockBasedEvalEnabled(e){this.reconfigureExtension("isBlockBasedEvalEnabled",e)}setBracketMatchingEnabled(e){this.reconfigureExtension("isBracketMatchingEnabled",e)}setLineNumbersDisplayed(e){this.reconfigureExtension("isLineNumbersDisplayed",e)}setBracketClosingEnabled(e){this.reconfigureExtension("isBracketClosingEnabled",e)}setTheme(e){this.reconfigureExtension("theme",e)}setAutocompletionEnabled(e){this.reconfigureExtension("isAutoCompletionEnabled",e)}updateSettings(e){this.setFontSize(e.fontSize),this.setFontFamily(e.fontFamily);for(let d in extensions)this.reconfigureExtension(d,e[d]);e.isBlockBasedEvalEnabled!==void 0&&(this.isBlockBasedEvalEnabled=parseBooleans(e.isBlockBasedEvalEnabled));const l={...codemirrorSettings.get(),...e};codemirrorSettings.set(l)}changeSetting(e,l){if(extensions[e]){this.reconfigureExtension(e,l);return}else e==="fontFamily"?this.setFontFamily(l):e==="fontSize"&&this.setFontSize(l)}setCode(e){const l={from:0,to:this.editor.state.doc.length,insert:e};this.editor.dispatch({changes:l})}getActiveWidgets(){return getActiveWidgets(this.editor)}getSliderWidgets(){return getSliderWidgets(this.editor)}getMiniLocations(){return this.miniLocations}clear(){this.onStartRepl&&document.removeEventListener("start-repl",this.onStartRepl),this.onEvaluateRequest&&document.removeEventListener("repl-evaluate",this.onEvaluateRequest),this.onStopRequest&&document.removeEventListener("repl-stop",this.onStopRequest),this.onToggleComment&&document.removeEventListener("repl-toggle-comment",this.onToggleComment)}getCursorLocation(){return this.editor.state.selection.main.head}setCursorLocation(e){return this.editor.dispatch({selection:{anchor:e}})}appendCode(e){const l=this.getCursorLocation();this.setCode(this.code+e),this.setCursorLocation(l)}}function parseBooleans(o){return{true:!0,false:!1}[o]??o}function s4(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}const markcss=registerControl("markcss"),index$4=Object.freeze(Object.defineProperty({__proto__:null,BlockWidget,SliderWidget,StrudelMirror,Vim,activateTheme,basicSetup,codemirrorSettings,compartments,defaultSettings,displayMiniLocations,extensions,flash,flashField,getActiveMiniLocations,getActiveWidgets,getAllWidgetIds,getMiniLocations,getSliderWidgets,highlightExtension,highlightMiniLocations,initEditor,initTheme,injectStyle,isFlashEnabled,isPatternHighlightingEnabled,markcss,minimalSetup,parseBooleans,registerWidget,setFlash,setMiniLocations,setSliderWidgets,setSliderWidgetsInRange,setWidget,setWidgets,setWidgetsInRange,settings,showMiniLocations,slider,sliderPlugin,sliderValues,sliderWithID,theme,themeColors,themes,toggleBlockComment,toggleBlockCommentByLine,toggleComment,toggleLineComment,updateMiniLocations,updateSliderWidgets,updateWidgets,widgetPlugin},Symbol.toStringTag,{value:"Module"}));async function prebake(){const o=evalScope(core,Promise.resolve().then(()=>index$d),Promise.resolve().then(()=>index$c),Promise.resolve().then(()=>index$2),Promise.resolve().then(()=>index$5),Promise.resolve().then(()=>index$b),Promise.resolve().then(()=>index$4),Promise.resolve().then(()=>hydra$1),Promise.resolve().then(()=>index$1),Promise.resolve().then(()=>index)),e="https://raw.githubusercontent.com/felixroos/dough-samples/main",l="https://raw.githubusercontent.com/todepond/samples/main";await Promise.all([o,registerSynthSounds(),registerZZFXSounds(),Promise.resolve().then(()=>index$1).then(({registerSoundfonts:p})=>p()),samples(`${e}/tidal-drum-machines.json`),samples(`${e}/piano.json`),samples(`${e}/Dirt-Samples.json`),samples(`${e}/vcsl.json`),samples(`${e}/mridangam.json`),samples("https://raw.githubusercontent.com/tidalcycles/uzu-drumkit/main/strudel.json")]),aliasBank(`${l}/tidal-drum-machines-alias.json`)}const maxPan=noteToMidi$1("C8"),panwidth=(o,e)=>o*e+(1-e)/2;if(Pattern$1.prototype.piano=function(){return this.fmap(o=>({...o,clip:o.clip??1})).s("piano").release(.1).fmap(o=>{const e=valueToMidi$1(o),l=panwidth(Math.min(Math.round(e)/maxPan,1),.5);return{...o,pan:(o.pan||1)*l}})},typeof HTMLElement<"u"){initAudioOnFirstClick();class o extends HTMLElement{static observedAttributes=["code"];settings=codemirrorSettings.get();editor=null;sync=!1;solo=!0;constructor(){super()}attributeChangedCallback(l,d,p){l==="code"&&(this.code=p,this.editor?.setCode(p))}connectedCallback(){setTimeout(()=>{const b=(this.innerHTML+"").replace("<!--","").replace("-->","").trim();b&&this.setAttribute("code",b)});const l=document.createElement("div");this.parentElement.insertBefore(l,this.nextSibling);const d=getDrawContext(),p=[-2,2];this.editor=new StrudelMirror({defaultOutput:webaudioOutput,getTime:()=>getAudioContext().currentTime,transpiler,root:l,initialCode:"// LOADING",pattern:silence,drawTime:p,drawContext:d,prebake,onUpdateState:b=>{const R=new CustomEvent("update",{detail:b});this.dispatchEvent(R)},solo:this.solo,sync:this.sync}),this.editor.updateSettings(this.settings),this.editor.setCode(this.code)}}customElements.define("strudel-editor",o)}function W$1(o,e){if(e||(e="assertion failed"),!o)throw new Error(e)}class c{constructor(e,l){this.type=e,l!==void 0&&(this.value=l),this.ins=[]}static parseInput(e,l){if(typeof e=="function"){if(!l)throw new Error("tried to parse function input without without passing node..");return e(l)}return typeof e=="object"?e:typeof e=="number"&&!isNaN(e)||typeof e=="string"?f(e):(console.log(`invalid input type "${typeof e}" for node of type "${l.type}", falling back to 0. The input was:`,e),0)}}const x$1=(o,e)=>new c(o,e);let y=new Map;const Z="poly",Y$1="exit";c.prototype.inherit=function(o){return o.inputOf&&(this.inputOf=o.inputOf),o.outputOf&&(this.outputOf=o.outputOf),this},c.prototype.toObject=function(){return JSON.parse(JSON.stringify(this))},c.prototype.stringify=function(){return JSON.stringify(this,null,2).replaceAll('"',"'")};function F(o,...e){let l=1;if(e=e.map(p=>{if(Array.isArray(p)){if(p.length===1)return p[0];p=new c(Z).withIns(...p)}if(typeof p=="function"){const b=p(new c("peek"));b.type===Z&&(l=Math.max(b.ins.length,l))}return p.type===Z&&(l=Math.max(p.ins.length,l)),p}),l===1){const p=x$1(o);return p.withIns(...e.map(b=>c.parseInput(b,p)))}if(o===Y$1){const p=e.map(b=>b.type===Z?b.ins.map(R=>c.parseInput(R).inherit(R)):b).flat();return x$1(Y$1).withIns(...p)}const d=Array.from({length:l},(p,b)=>{const R=new c(o),I=e.map(z=>z.type===Z?c.parseInput(z.ins[b%z.ins.length],R).inherit(z):(z=c.parseInput(z,R),z.type===Z&&(z=z.ins[b]),z));return R.withIns(...I)});return new c(Z).withIns(...d)}function oe(o,e){const l=y.get(o);return l?.ins?.[e]?l.ins[e].name:""}let a=(o,e)=>u(o,(...l)=>F(o,...l),e);y.set("register",{tags:["meta"],graph:!1,description:"Registers a new Node function. Sets it on the prototype + returns the function itself. Like `module` but doesn't hide complexity in graph viz.",examples:[`let kick = register('kick', gate => gate.adsr(0,.11,0,.11)
|
||
.apply(env => env.mul(env)
|
||
.mul(158)
|
||
.sine(env)
|
||
.distort(.85)
|
||
))
|
||
impulse(2).kick().out()`]});let u=(o,e,l)=>(l&&y.set(o,l),c.prototype[o]=function(...d){return e(this,...d)},c.prototype["_"+o]=function(){return this},e);y.set("module",{tags:["meta"],graph:!0,description:"Creates a module. Like `register`, but the graph viz will hide the internal complexity of the module.",examples:[`let kick = module('kick', gate => gate.adsr(0,.11,0,.11)
|
||
.apply(env => env.mul(env)
|
||
.mul(158)
|
||
.sine(env)
|
||
.distort(.85)
|
||
))
|
||
impulse(2).kick().out()`]});let de=0;function g(o,e,l){return u(o,(...d)=>{const p=de++;return d=d.map((b,R)=>c.parseInput(b).asModuleInput?.(o,p,R)),e(...d).asModuleOutput?.(o,p)},l)}y.set("n",{tags:["math"],description:"Constant value node. Turns a number into a Node.",ins:[{name:"value",default:0}]});function f(o){return Array.isArray(o)?poly(...o.map(e=>f(e))):typeof o=="object"?o:x$1("n",o)}y.set("out",{tags:["meta"],description:"Sends the node to the audio output"}),y.set("withIns",{internal:!0,tags:["innards"],description:"Sets the inputs of a node. Returns the node itself",ins:[{name:"in",dynamic:!0}]}),c.prototype.withIns=function(...o){return this.ins=o,this},y.set("flatten",{internal:!0,tags:["innards"],description:"Flattens the node to a list of all nodes in the graph, where each Node's ins are now indices"}),c.prototype.flatten=function(){return pe(this)},y.set("apply",{graph:!0,tags:["meta"],description:"Applies the given function to the Node. Useful when a node has to be used multiple times.",examples:[`impulse(4)
|
||
.apply(imp=>imp
|
||
.seq(110,220,330,440)
|
||
.sine()
|
||
.mul( imp.ad(.1,.1) )
|
||
).out()`]}),c.prototype.apply=function(o){return o(this)},y.set("clone",{internal:!0,tags:["innards"],description:"Clones the node"}),c.prototype.clone=function(){return new c(this.type,this.value).withIns(...this.ins)},y.set("map",{tags:["meta"],description:"Applies the given function to all ins if it's poly node. Otherwise it applies the function to itself.",examples:[`n([110,220,330])
|
||
.map( freq=>freq.mul([1,1.007]).saw().mix() )
|
||
.mix(2).mul(.5).out()`]}),c.prototype.map=function(o){return this.type!=="poly"?o(this):poly(...this.ins.map(o))},c.prototype.channel=function(o){return this.type!=="poly"?this:this.ins[o%this.ins.length]},y.set("select",{tags:["meta"],graph:!0,description:"Find the first occurence of the given type up in the graph and returns the match. Useful to exit a feedback loop at another point.",examples:[`sine(220).mul(impulse(1).ad(.001,.2))
|
||
.add( x=>x.delay(.2).mul(.8) )
|
||
.select('delay').out()
|
||
`]}),c.prototype.select=function(o){for(let e of this.ins){if(e.type===o)return e;const l=e.select(o);if(l)return l}},y.set("debug",{tags:["meta"],description:"Logs the node to the console"}),c.prototype.debug=function(o=e=>e){return console.log(o(this)),this};function ce$1(o){const e=modules.get(o),l=Array.from({length:e.length},(p,b)=>x$1(`$INPUT${b}`)),d=e(...l);return JSON.stringify(d,null,2)}function pe(o){const e=[];return S$1(o,l=>(e.push(l),l)),e.map(l=>{let d={...l,type:l.type,ins:l.ins.map(p=>e.indexOf(p)+"")};return l.value!==void 0&&(d.value=l.value),l.to!==void 0&&(d.to=e.indexOf(l.to)),d})}let J$1=a("exit",{internal:!0});function j(o,e){let l=[];const d=u("out",function(p,b=[0,1]){return l.push(p.output(b)),p});return e?(e.out=d,Function(...Object.keys(e),o)(...Object.values(e))):(globalThis.out=d,Function(o)()),J$1(...l)}c.prototype.over=function(o){return this.apply(e=>add(e,o(e)))},c.prototype.dfs=function(o,e){return this.apply(l=>S$1(l,o,e))},c.prototype.apply2=function(o){return o(this,this)};let S$1=(o,e,l=[])=>(o=e(o,l),l.push(o),o.ins=o.ins.map(d=>l.includes(d)?d:S$1(d,e,l)),o);c.prototype.asModuleInput=function(o,e,l){return this.inputOf=this.inputOf||[],this.inputOf.push([o,e,l]),this},c.prototype.asModuleOutput=function(o,e){return this.outputOf=[o,e],this};function T$1(o,e={}){const{log:l=!1,lang:d="js",fallbackType:p="thru",constType:b="n",getRegister:R=ln=>`r[${ln}]`,getOutput:I=ln=>`o[${ln}]`,getSource:z=ln=>`s[${ln}]`}=e;l&&console.log("compile",o);const se=ue(o);let le=[],tn=ln=>se[ln].type!==b?R(ln):typeof se[ln].value=="string"?`"${se[ln].value}"`:se[ln].value;const an=[];for(let ln in se){const un=se[ln],pn=se[ln].ins.map(vn=>tn(se.indexOf(vn))),yn=an.length;let _n=y.get(un.type);_n||(console.warn(`unhandled node type "${se[ln].type}". falling back to "${p}"`),_n=y.get(p));const Pn={vars:pn,node:un,nodes:se,id:ln,ugenIndex:yn,ugen:_n.ugen,name:tn(ln),lang:d,getRegister:R,getOutput:I,getSource:z};_n.compile&&le.push(_n.compile(Pn)),_n.ugen&&an.push({type:_n.ugen,inputs:pn})}const sn=le.join(`
|
||
`);return l&&(console.log("compiled code:"),console.log(sn)),{src:sn,ugens:an,registers:se.length}}c.prototype.compile=function(o){return T$1(this,o)};function ue(o){const e=[],l=new Set;function d(p){if(!(typeof p!="object"||l.has(p))){l.add(p);for(let b in p.ins)d(p.ins[b]);e.push(p)}}return d(o),e}const U=Object.freeze(Object.defineProperty({__proto__:null,compile:T$1},Symbol.toStringTag,{value:"Module"}));let Q$1=class{constructor(){this._events={}}on(e,l){this._events[e]||(this._events[e]=[]);let d=this._events[e];W$1(d.indexOf(l)==-1),d.push(l)}removeListener(e,l){let d=this._events[e],p=d.indexOf(l);p!=-1&&d.splice(p,1)}trigger(e,...l){let d=this._events[e]||[];for(let p=0;p<d.length;p++)d[p].apply(null,l)}};class me extends Q$1{constructor(e=navigator){super(),this.midiAccess=null,this.getMIDIAccess(e)}async getMIDIAccess(e){if("requestMIDIAccess"in e){this.midiAccess=await e.requestMIDIAccess({sysex:!1}),console.log("got MIDI access");for(let l of this.midiAccess.inputs.values())l.state=="connected"&&(l.onmidimessage=d=>this.trigger("midimessage",l.id,d.data));this.midiAccess.onstatechange=l=>{l.port.type=="input"&&l.port.state=="connected"&&(console.log("MIDI device connected:",l.port.name,"PORT:",l.port.id),l.port.onmidimessage=d=>this.trigger("midimessage",l.port.id,d.data))}}}broadcast(e,l){if(midi)for(let d of this.midiAccess.outputs.values())d.send(e,l)}}function re(o){let e=o[0]&240,l=(o[0]&15)+1;if(e==176&&o.length==3){let d=o[1],p=o[2]/127*2-1;return{type:"CC",channel:l,cc:d,value:p}}if(e==224&&o.length==3){let d=o[1],p=(o[2]<<7|d)/16383*2-1;return{type:"PITCHBEND",channel:l,value:p}}if(e==144&&o.length==3){let d=o[1],p=o[2]/127;return{type:"NOTE_ON",channel:l,note:d,velocity:p}}if(e==128&&o.length==3){let d=o[1];return{type:"NOTE_ON",channel:l,note:d,velocity:0}}}class he extends Q$1{constructor(){super(),this.attach()}attach(){typeof window<"u"&&(this.handleMouseMove=e=>{const l=e.clientX/document.body.clientWidth*2-1,d=e.clientY/document.body.clientHeight*2-1;this.trigger("move",l,d)},document.addEventListener("mousemove",this.handleMouseMove))}detach(){typeof window<"u"&&document.removeEventListener("mousemove",this.handleMouseMove)}}const Ge="data:text/javascript;base64,KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Z1bmN0aW9uIGcoaCx0KXtpZih0fHwodD0iYXNzZXJ0aW9uIGZhaWxlZCIpLCFoKXRocm93IG5ldyBFcnJvcih0KX1mdW5jdGlvbiBTKGgsdCxzKXtyZXR1cm4gaDw9MD90Omg+PTE/czp0K2gqKHMtdCl9ZnVuY3Rpb24gUChoLHQscyl7cmV0dXJuIGg8PXQ/MDpoPj1zPzE6cz09PXQ/MDooaC10KS8ocy10KX1mdW5jdGlvbiBFKGgsdCl7cmV0dXJuIGg8dD8oaC89dCxoK2gtaCpoLTEpOmg+MS10PyhoPShoLTEpL3QsaCpoK2graCsxKTowfWZ1bmN0aW9uIFUoaCl7cmV0dXJuIE1hdGguZmxvb3IoaCk9PT1ofWZ1bmN0aW9uIF8oaCl7cmV0dXJuIFUoaCkmJmg+MH1mdW5jdGlvbiBrKGgsdCl7dD1NYXRoLm1pbihNYXRoLm1heCh0LDApLDEpLHQtPS4wMTt2YXIgcz0yKnQvKDEtdCksZT0oMStzKSpoLygxK3MqTWF0aC5hYnMoaCkpO3JldHVybiBlfWZ1bmN0aW9uIHcoaCx0LHMpe3JldHVybiBoPj0xP3M6dCtoKihzLXQpfWZ1bmN0aW9uIFQoKXt0aGlzLnN0YXRlPSJvZmYiLHRoaXMuc3RhcnRUaW1lPTAsdGhpcy5zdGFydFZhbD0wfVQucHJvdG90eXBlLmV2YWw9ZnVuY3Rpb24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,0,"RIFF"),le.setUint32(4,36+b*R,!0),V(le,8,"WAVE"),V(le,12,"fmt "),le.setUint32(16,16,!0),le.setUint16(20,d,!0),le.setUint16(22,l,!0),le.setUint32(24,e,!0),le.setUint32(28,e*I,!0),le.setUint16(32,I,!0),le.setUint16(34,p,!0),V(le,36,"data"),le.setUint32(40,b*R,!0);let tn=44;for(const an of o)ge(le,tn,an),tn+=an.length*R;return se}function V(o,e,l){for(let d=0;d<l.length;d++)o.setUint8(e+d,l.charCodeAt(d))}function ge(o,e,l){for(var d=0;d<l.length;d++,e+=4)o.setFloat32(e,l[d],!0)}const k=Object.freeze(Object.defineProperty({__proto__:null,Node:c,compile:T$1,evaluate:j,exit:J$1,exportModule:ce$1,getInletName:oe,getNode:F,module:g,n:f,node:x$1,nodeRegistry:y,outputType:Y$1,polyType:Z,register:u,registerNode:a},Symbol.toStringTag,{value:"Module"}));let Xe=o=>`Math.sin(${o})`,Ze=o=>`Math.cos(${o})`,be=o=>`Math.tan(${o})`,xe=o=>`Math.asin(${o})`,Re=o=>`Math.acos(${o})`,Le=o=>`Math.atan(${o})`,B=(o,e,l)=>`${o} = ${e};${l?` /* ${l} */`:""}`,w=(o,...e)=>B(o.name,`nodes[${o.ugenIndex}].update(${e.join(",")})`,o.node.type),Me=o=>`(2 ** ((${o} - 69) / 12) * 440)`,ze=(o,e)=>`${o} ** ${e}`,Ve=o=>`Math.exp(${o})`,We=o=>`Math.log(${o})`,Ye=(o,e)=>`${o}%${e}`,Ne=o=>`Math.abs(${o})`,He=o=>`Math.round(${o})`,Se=o=>`Math.floor(${o})`,Te=o=>`Math.sign(${o})`,we=o=>`Math.ceil(${o})`,Ke=(o,e)=>`Math.min(${o}, ${e})`,Ce=(o,e)=>`Math.max(${o}, ${e})`,ve=(o,e)=>`[${o}, ${e}]`,L$1=o=>`${o}[0]`,Ie=o=>`${o}[1]`,Ue=(o,e)=>`(${L$1(o)} < ${L$1(e)} ? ${o} : ${e})`,ke=(o,e)=>`(${L$1(o)} > ${L$1(e)} ? ${o} : ${e})`;const Pe=Object.freeze(Object.defineProperty({__proto__:null,abs:Ne,ceil:we,def:B,defAcos:Re,defAsin:xe,defAtan:Le,defCos:Ze,defSin:Xe,defTan:be,defUgen:w,exp:Ve,floor:Se,log:We,max:Ce,midinote:Me,min:Ke,mod:Ye,pair_a:L$1,pair_a_max:ke,pair_a_min:Ue,pair_b:Ie,pair_make:ve,pow:ze,round:He,sign:Te},Symbol.toStringTag,{value:"Module"}));class Fe{constructor(e=null){this.ugens=new Map,this.outputNode=e}async spawn(e,l){this.graph=e;const{src:d,ugens:p,registers:b}=e.compile({log:!1});!this.mouse&&d.includes("mouse")&&this.initMouse(),!this.midiInited&&p.some(R=>R.type.startsWith("Midi"))&&this.initMidi(),!this.audioIn&&p.some(R=>R.type==="AudioIn")&&await this.initAudioIn(),this.sendCustomUgens(),this.send({type:"SPAWN_UNIT",unit:{src:d,ugens:p,registers:b},duration:l})}registerUgen(e){this.ugens.set(e.name,e)}sendCustomUgens(){if(!this.ugens.size)return;let e=[];for(let[l,d]of this.ugens)e.push({type:"SET_UGEN",className:l,ugen:d+""});this.send({type:"BATCH_MSG",messages:e})}scheduleMessage(e,l){this.send({type:"SCHEDULE_MSG",msg:e,time:l})}setControl(e,l,d){const p={type:"SET_CONTROL",id:e,value:l};d?this.send({type:"SCHEDULE_MSG",time:d,msg:p}):this.send(p)}setControls(e){const l={type:"BATCH_MSG",messages:e.map(d=>{const p={type:"SET_CONTROL",id:d.id,value:d.value};return d.time===void 0?p:{type:"SCHEDULE_MSG",time:d.time,msg:p}})};this.send(l)}async initAudioIn(){console.log("init audio input...");const e=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!1,noiseSuppression:!1,autoGainControl:!1}});this.audioCtx.createMediaStreamSource(e).connect(this.audioWorklet)}initMidi(){console.log("init midi input..."),this.midiInited=!0,new me().on("midimessage",(e,l)=>{const d=re(l);d&&this.send(d)})}initMouse(){console.log("init mouse"),this.mouse=new he,this.mouse.on("move",(e,l)=>{this.setControl("mouseX",e),this.setControl("mouseY",l)})}send(e){W$1(e instanceof Object),this.audioWorklet&&this.audioWorklet.port.postMessage(e)}async init(){if(!this.audioCtx){if(W$1(!this.audioCtx),this.audioCtx=this.outputNode?.context||new AudioContext({latencyHint:"interactive",sampleRate:48e3}),await this.audioCtx.resume(),!this.audioCtx.audioWorklet)throw new Error("Audio cannot be loaded: non-secure origin? (AudioContext.audioWorklet is undefined)");await this.audioCtx.audioWorklet.addModule(Ge),await this.audioCtx.audioWorklet.addModule(ye),this.audioWorklet=new AudioWorkletNode(this.audioCtx,"sample-generator",{outputChannelCount:[2]}),this.audioWorklet.port.onmessage=e=>{const{id:l,time:d,type:p}=e.data;p==="SIGNAL_TRIGGER"?this.graph.dfs(b=>{if(b.type==="signal"&&b.id===l){const R=b.callback(d,l);isNaN(R)?R!==void 0&&console.warn(`expected number from "on" callback with id "${l}", got "${R}" instead.`):window.postMessage({type:"KABELSALAT_SET_CONTROL",value:R,id:l})}return b}):p==="STOP"?setTimeout(()=>this.destroy(),e.data.fadeTime*1e3+200):p==="SEND_SAMPLES"&&this.graph.dfs(b=>(b.type!=="scope"||b.ins.length<2||b.ins[1].value!==l||window.postMessage({type:"KABELSALAT_UPDATE_SCOPE",samples:e.data.samples,channels:e.data.channels,channel:e.data.channel,id:l}),b))},this.recorder=new window.AudioWorkletNode(this.audioCtx,"recorder"),this.audioWorklet.connect(this.recorder),this.sendCustomUgens(),this.recorder.connect(this.outputNode||this.audioCtx.destination),this.recorder.port.onmessage=e=>{if(e.data.eventType==="data"&&this.recordedBuffers.push(e.data.audioBuffer),e.data.eventType==="stop"){console.log("recording stopped");const l=fe(this.recordedBuffers,this.audioCtx.sampleRate,2);Je(l,"kabelsalat.wav","audio/wav"),this.recordedBuffers=[]}},this.recordOnPlay&&this.record()}}destroy(){this.audioWorklet?.disconnect(),this.audioWorklet=null,this.recorder?.disconnect(),this.recorder=null,!this.outputNode&&this.audioCtx?.close(),this.audioCtx=null}stop(){this.audioCtx&&this.send({type:"STOP"}),this.mouse?.detach()}record(){if(!this.audioCtx){this.recordOnPlay=!0;return}this.recordedBuffers=[],this.recorder.parameters.get("isRecording").setValueAtTime(1,0),console.log("recording started")}stopRecording(){this.recordOnPlay=!1,this.audioCtx&&this.recorder.parameters.get("isRecording").setValueAtTime(0,0)}set fadeTime(e){this.send({type:"FADE_TIME",fadeTime:e})}set maxUnits(e){this.send({type:"MAX_UNITS",maxUnits:e})}}function Je(o,e,l){const d=new Blob([o],{type:l}),p=document.createElement("a");p.href=window.URL.createObjectURL(d),p.download=e,p.click()}let je=0;u("signal",(o,e)=>{const l=je++,d=getNode("signal",o,l);return d.callback=e,d.id=l,d},{ugen:"Signal",compile:({vars:[o,e],...l})=>w(l,o,e,"time")});let Qe=o=>`sin(${o})`,Be=o=>`cos(${o})`,Ee=o=>`tan(${o})`,Oe=o=>`asin(${o})`,$e=o=>`acos(${o})`,De=o=>`atan(${o})`,N=(o,e,l)=>`${o} = ${e};${l?` /* ${l} */`:""}`,Ae=(o,...e)=>{if(e.unshift(`nodes[${o.ugenIndex}]`),o.ugen==="Sequence"||o.ugen==="Pick"){const l=e.length-2,d=`(float[${l}]){${e.slice(2).join(",")}}`;return N(o.name,`${o.ugen}_update(${e[0]}, ${e[1]}, ${l}, ${d})`,o.ugen)}return N(o.name,`${o.ugen}_update(${e.join(",")})`,o.ugen)},qe=o=>`pow(2.0, ((${o} - 69.0) / 12.0)) * 440.0`,_e=(o,e)=>`pow(${o}, ${e})`,et=o=>`exp(${o})`,tt=o=>`log(${o})`,it=(o,e)=>`${o}>=${e}?${o}-${e}:${o}`,nt=o=>`fabs(${o})`,st=(o,e)=>`fmin(${o}, ${e})`,lt=(o,e)=>`fmax(${o}, ${e})`,at=o=>`fround(${o})`,ot=o=>`floor(${o})`,dt=o=>`ceil(${o})`,ct=(o,e)=>`((pair) {${o}, ${e}})`,M$1=o=>`${o}.a`,pt=o=>`${o}.b`,ut=(o,e)=>`(${M$1(o)} < ${M$1(e)} ? ${o} : ${e})`,mt=(o,e)=>`(${M$1(o)} > ${M$1(e)} ? ${o} : ${e})`;const rt=Object.freeze(Object.defineProperty({__proto__:null,abs:nt,ceil:dt,def:N,defAcos:$e,defAsin:Oe,defAtan:De,defCos:Be,defSin:Qe,defTan:Ee,defUgen:Ae,exp:et,floor:ot,log:tt,max:lt,midinote:qe,min:st,mod:it,pair_a:M$1,pair_a_max:mt,pair_a_min:ut,pair_b:pt,pair_make:ct,pow:_e,round:at},Symbol.toStringTag,{value:"Module"})),s={js:Pe,c:rt},E=(o,e)=>a(o,{ugen:e,compile:({vars:l,...d})=>s[d.lang].defUgen(d,...l)});let ht=u("time",o=>new c("time",o),{tags:["meta"],description:"Returns elapsed time in seconds",compile:({name:o,lang:e})=>s[e].def(o,"time")}),Gt=u("raw",(o,e)=>new c("raw",e).withIns(f(o)),{ins:[{name:"in"},{name:"code",description:"expression with variable `t` being the elapsed time and `$input` the input."}],tags:["meta"],description:"Raw code node, expects floats between -1 and 1",compile:({vars:o,node:e,name:l})=>`let $input = ${o[0]};
|
||
const ${l} = (${e.value}); // raw`,examples:[`sine(4).range(.5,1)
|
||
.raw("(time*110%1*2-1)*$input")
|
||
.out()`]}),yt=u("bytebeat",(o,e)=>new c("bytebeat",e).withIns(f(o)),{ins:[{name:"t",description:"time in samples"},{name:"code",description:"bytebeat code with variable `t`"}],tags:["meta"],description:"Bytebeat node, expects numbers from 0 to 255",examples:[`time().mul(8000).bytebeat\`
|
||
// Fractalized Past
|
||
// by: lhphr
|
||
// from: https://dollchan.net/btb/res/3.html#69
|
||
|
||
(t>>10^t>>11)%5*((t>>14&3^t>>15&1)+1)*t%99+((3+(t>>14&3)-(t>>16&1))/3*t%99&64)
|
||
\`.out()`],compile:({vars:o,node:e,name:l})=>`let t = ${o[0]};
|
||
const ${l} = ((${e.value}) & 255) / 127.5 - 1; // bytebeat`}),ft=u("floatbeat",(o,e)=>new c("bytebeat",e).withIns(f(o)),{ins:[{name:"t",description:"time in samples"},{name:"code",description:"floatbeat code with variable `t`"}],tags:["meta"],description:"Raw code node, expects numbers from -1 to 1",compile:({vars:o,node:e,name:l})=>`let t = ${o[0]}; const ${l} = (${e.value}); // floatbeat`}),gt=a("adsr",{ugen:"ADSRNode",tags:["envelope"],description:"ADSR envelope",examples:[`impulse(1).perc(.5)
|
||
.adsr(.01, .1, .5, .1)
|
||
.mul(sine(220)).out()`],ins:[{name:"gate",default:0,description:"gate input"},{name:"att",default:.02,description:"attack time"},{name:"dec",default:.1,description:"decay time"},{name:"sus",default:.2,description:"sustain level"},{name:"rel",default:.1,description:"release time"}],compile:({vars:[o=0,e=.02,l=.1,d=.2,p=.1],...b})=>s[b.lang].defUgen(b,"time",o,e,l,d,p)}),Xt=g("ar",(o=0,e=.02,l=.1)=>o.adsr(e,0,1,l),{tags:["envelope"],description:"AR envelope",examples:["impulse(1).ad(.01, .1).mul(sine(220)).out()"],ins:[{name:"trig",default:0,description:"gate input"},{name:"att",default:.02,description:"attack time"},{name:"rel",default:.1,description:"release time"}]}),Zt=g("ad",(o=0,e=.02,l=.1)=>o.adsr(e,l,0,l),{tags:["envelope"],description:"AD envelope",examples:["impulse(1).ad(.01, .1).mul(sine(220)).out()"],ins:[{name:"trig",default:0,description:"gate input"},{name:"att",default:.02,description:"attack time"},{name:"dec",default:.1,description:"decay time"}]}),bt=a("clock",{ugen:"Clock",internal:!0,tags:["regular","clock"],description:"Clock source, with tempo in BPM",examples:["clock(120).clockdiv(16).mul(sine(220)).out()"],ins:[{name:"bpm",default:120,description:"clock tempo in bpm (beats per minute)"}],compile:({vars:[o=120],...e})=>s[e.lang].defUgen(e,o)}),xt=a("clockdiv",{ugen:"ClockDiv",tags:["clock","trigger"],description:"Clock signal divider",examples:["impulse(8).clockdiv(2).ad(.1,.1).mul(sine(220)).out()"],ins:[{name:"clock",default:0,description:"clock input"},{name:"divisor",default:2,description:"tempo divisor"}],compile:({vars:[o=0,e=2],...l})=>s[l.lang].defUgen(l,o,e)}),Rt=a("distort",{ugen:"Distort",tags:["fx","distortion"],description:"Overdrive-style distortion",examples:[`sine(220)
|
||
.distort( saw(.5).range(0,1) )
|
||
.out()`],ins:[{name:"in",default:0},{name:"amt",default:0,description:"distortion amount"}],compile:({vars:[o=0,e=0],...l})=>s[l.lang].defUgen(l,o,e)}),O=a("noise",{ugen:"NoiseOsc",tags:["source","noise"],description:"White noise source",examples:["noise().mul(.25).out()"],ins:[{name:"next",default:1,description:"if 0, the noise will hold the previous value. defaults to 1."}],compile:({lang:o,vars:[e=1],...l})=>s[o].defUgen(l,e)}),Lt=a("lcgnoise",{ugen:"LcgNoise",tags:["source","noise"],description:"Lcg white noise source.",examples:["lcgnoise().mul(.25).out()"],ins:[{name:"next",default:1,description:"if 0, the noise will hold the previous value. defaults to 1."},{name:"reset",default:0,description:"if 1, the random number generator sequence will reset."}],compile:({lang:o,vars:[e=1,l=0],...d})=>s[o].defUgen(d,e,l)}),Mt=a("pink",{ugen:"PinkNoise",tags:["source","noise"],description:"Pink noise source",examples:["pink().mul(.5).out()"],ins:[],compile:({lang:o,...e})=>s[o].defUgen(e)}),zt=a("brown",{ugen:"BrownNoiseOsc",tags:["source","noise"],description:"Brown noise source",examples:["brown().out()"],ins:[],compile:({lang:o,...e})=>s[o].defUgen(e)}),Vt=a("dust",{ugen:"DustOsc",tags:["trigger","noise","source"],description:"Generates random impulses from 0 to +1.",examples:["dust(200).out()"],ins:[{name:"density",default:0,description:"average impulses per second"}],compile:({vars:[o=0],...e})=>s[e.lang].defUgen(e,o)}),$=a("impulse",{ugen:"ImpulseOsc",tags:["regular","trigger"],description:"Regular single sample impulses (0 - 1)",examples:["impulse(10).out()"],ins:[{name:"freq",default:0},{name:"phase",default:0}],compile:({vars:[o=0,e=0],...l})=>s[l.lang].defUgen(l,o,e)}),Wt=a("saw",{ugen:"SawOsc",tags:["regular","waveform","source"],description:"Sawtooth wave oscillator with anti aliasing",examples:["saw(110).mul(.5).out()"],ins:[{name:"freq",default:0}],compile:({vars:[o=0],...e})=>s[e.lang].defUgen(e,o)}),Yt=a("zaw",{ugen:"ZawOsc",tags:["regular","waveform","source"],description:"Sawtooth wave oscillator with sharp edges. Use saw for anti aliased variant.",examples:["zaw(110).mul(.5).out()"],ins:[{name:"freq",default:0}],compile:({vars:[o=0],...e})=>s[e.lang].defUgen(e,o)}),Nt=a("sine",{tags:["regular","waveform","source"],ugen:"SineOsc",description:"Sine wave oscillator",examples:["sine(220).out()"],ins:[{name:"freq",default:0},{name:"sync",default:0,description:"sync input"},{name:"phase",default:0,description:"phase offset"}],compile:({vars:[o=0,e=0,l=0],...d})=>s[d.lang].defUgen(d,o,e,l)}),Ht=a("tri",{ugen:"TriOsc",tags:["regular","waveform","source"],description:"Triangle wave oscillator",examples:["tri(220).out()"],ins:[{name:"freq",default:0}],compile:({vars:[o=0],...e})=>s[e.lang].defUgen(e,o)}),St=a("pulse",{ugen:"PulseOsc",tags:["regular","waveform","source"],description:"Pulse wave oscillator",examples:["pulse(220, sine(.1).range(.1,.5)).mul(.5).out()"],ins:[{name:"freq",default:0},{name:"pw",default:.5,description:"pulse width 0 - 1"}],compile:({vars:[o=0,e=.5],...l})=>s[l.lang].defUgen(l,o,e)}),Tt=a("slide",{ugen:"Slide",tags:["fx"],internal:!0,description:"Slide/portamento node",examples:[`impulse(2).seq(55,110,220,330)
|
||
.slide(4).sine().out()`],ins:[{name:"in",default:0},{name:"rate",default:1}],compile:({vars:[o=0,e=1],...l})=>s[l.lang].defUgen(l,o,e)}),wt=a("lag",{ugen:"Lag",tags:["fx"],description:"Smoothes a signal. Good for slide / portamento effects.",examples:[`impulse(2).seq(220,330,440,550)
|
||
.lag(.4).sine().out()`],ins:[{name:"in",default:0},{name:"rate",default:1,description:"60 dB lag time in seconds"}],compile:({vars:[o=0,e=1],...l})=>s[l.lang].defUgen(l,o,e)}),Kt=a("slew",{ugen:"Slew",tags:["fx"],description:"Limits the slope of an input signal. The slope is expressed in units per second.",examples:["pulse(800).slew(4000, 4000).out()"],ins:[{name:"in",default:0},{name:"up",default:1,description:"Maximum upward slope in units per second"},{name:"dn",default:1,description:"Maximum downward slope in units per second"}],compile:({vars:[o=0,e=1,l=1],...d})=>s[d.lang].defUgen(d,o,e,l)}),D$1=a("filter",{ugen:"Filter",tags:["fx","filter"],internal:!0,description:"Two-pole low-pass filter",examples:["saw(55).lpf( sine(1).range(.4,.8) ).out()"],ins:[{name:"in",default:0},{name:"cutoff",default:1},{name:"reso",default:0}],compile:({vars:[o=0,e=1,l=0],...d})=>s[d.lang].defUgen(d,o,e,l)}),Ct=a("fold",{ugen:"Fold",tags:["fx","distortion","limiter"],description:'Distort incoming audio signal by "folding"',examples:[`sine(55)
|
||
.fold( sine(.5).range(0.2,4) )
|
||
.out()`],ins:[{name:"in",default:0},{name:"rate",default:0}],compile:({vars:[o=0,e=0],...l})=>s[l.lang].defUgen(l,o,e)}),vt=a("seq",{ugen:"Sequence",tags:["sequencer"],description:"Trigger controlled sequencer",examples:[`impulse(2).seq(220,330,440,550)
|
||
.sine().out()`],ins:[{name:"trig",default:0},{name:"step",default:0,dynamic:!0,description:"step inputs"}],compile:({vars:o,...e})=>s[e.lang].defUgen(e,...o)}),It=a("delay",{ugen:"Delay",tags:["fx"],description:"Delay line node",examples:[`impulse(1).ad(.01,.2).mul(sine(220))
|
||
.add(x=>x.delay(.1).mul(.8)).out()`],ins:[{name:"in",default:0},{name:"time",default:0}],compile:({vars:[o=0,e=0],...l})=>s[l.lang].defUgen(l,o,e)}),Ut=a("hold",{ugen:"Hold",tags:["fx"],description:"Sample and hold",examples:[`noise().hold(impulse(2))
|
||
.range(220,880).sine().out()`],ins:[{name:"in",default:0},{name:"trig",default:0}],compile:({vars:[o=0,e=0],...l})=>s[l.lang].defUgen(l,o,e)}),kt=a("midifreq",{ugen:"MidiFreq",tags:["external","midi"],description:"Outputs frequency of midi note in. Multiple instances will do voice allocation",examples:["midifreq().sine().out()"],ins:[{name:"channel",default:-1,description:"Channel filter. Defaults to all channels"}],compile:({vars:[o=-1],...e})=>s[e.lang].defUgen(e,o)}),Pt=a("midigate",{ugen:"MidiGate",tags:["external","midi"],description:"outputs gate of midi note in. Multiple instances will do voice allocation",examples:["midigate().lag(1).mul(sine(220)).out()"],ins:[{name:"channel",default:-1}],compile:({vars:[o=-1],...e})=>s[e.lang].defUgen(e,o)}),Ft=a("midivel",{ugen:"MidiVel",tags:["external","midi"],description:"outputs velocity of midi note in. Multiple instances will do voice allocation",examples:["midigate().ar(0.01,0.2).mul(saw(midifreq())).mul(midivel()).mul(.8).out()"],ins:[{name:"channel",default:-1}],compile:({vars:[o=-1],...e})=>s[e.lang].defUgen(e,o)}),Jt=a("midicc",{ugen:"MidiCC",tags:["external","midi"],description:"Outputs bipolar value of given midi cc number. initValue can be set to be the output before getting first cc message.",examples:["midicc(74).range(100,200).sine().out()"],ins:[{name:"ccnumber",default:-1},{name:"channel",default:-1},{name:"initValue",default:-1}],compile:({vars:[o=-1,e=-1],...l})=>s[l.lang].defUgen(l,o,e)}),K=a("cc",{ugen:"CC",tags:["external"],description:"CC control",ins:[{name:"id",default:0},{name:"value",default:0}],compile:({vars:[o],...e})=>s[e.lang].defUgen(e,o)}),jt=a("audioin",{ugen:"AudioIn",tags:["source","external"],description:"External Audio Input, depends on your system input",examples:["audioin().add(x=>x.delay(.1).mul(.8)).out()"],ins:[],compile:o=>s[o.lang].defUgen(o,"input")}),H$1=a("log",{tags:["math"],description:"calculates the logarithm (base 10) of the input signal",ins:[{name:"in"}],compile:({vars:[o=0],name:e,lang:l})=>s[l].def(e,s[l].log(o))}),A=a("exp",{tags:["math"],description:"raises e to the power of the input signal",ins:[{name:"in"}],compile:({vars:[o=0],name:e,lang:l})=>s[l].def(e,s[l].exp(o))}),Qt=a("pow",{tags:["math"],description:"raises the input to the given power",ins:[{name:"in"},{name:"power"}],compile:({vars:[o=0,e=1],name:l,lang:d})=>s[d].def(l,s[d].pow(o,e))}),q=a("sin",{tags:["math"],description:"calculates the sine of the input signal",ins:[{name:"in"}],compile:({vars:[o=0],name:e,lang:l})=>s[l].def(e,s[l].defSin(o))}),_=a("cos",{tags:["math"],description:"calculates the cosine of the input signal",ins:[{name:"in"}],compile:({vars:[o=0],name:e,lang:l})=>s[l].def(e,s[l].defCos(o))}),Bt=a("tan",{tags:["math"],description:"calculates the tan of the input signal",ins:[{name:"in"}],compile:({vars:[o=0],name:e,lang:l})=>s[l].def(e,s[l].defTan(o))}),Et=a("acos",{tags:["math"],description:"calculates the acos of the input signal",ins:[{name:"in"}],compile:({vars:[o=0],name:e,lang:l})=>s[l].def(e,s[l].defAcos(o))}),Ot=a("asin",{tags:["math"],description:"calculates the asin of the input signal",ins:[{name:"in"}],compile:({vars:[o=0],name:e,lang:l})=>s[l].def(e,s[l].defAsin(o))}),$t=a("atan",{tags:["math"],description:"calculates the atan of the input signal",ins:[{name:"in"}],compile:({vars:[o=0],name:e,lang:l})=>s[l].def(e,s[l].defAtan(o))}),Dt=a("mul",{tags:["math"],description:"Multiplies the given signals.",examples:["sine(220).mul( sine(4).range(.25,1) ).out()"],ins:[{name:"in",dynamic:!0}],compile:({vars:o,name:e,lang:l})=>s[l].def(e,o.join(" * ")||0)}),C$1=a("add",{tags:["math"],description:"sums the given signals",examples:["n([0,3,7,10]).add(60).midinote().sine().mix(2).out()"],ins:[{name:"in",dynamic:!0}],compile:({vars:o,name:e,lang:l})=>s[l].def(e,o.join(" + ")||0)}),At=a("div",{tags:["math"],description:"adds the given signals",ins:[{name:"in",dynamic:!0}],compile:({vars:o,name:e,lang:l})=>s[l].def(e,o.join(" / ")||0)}),qt=a("sub",{tags:["math"],description:"subtracts the given signals",ins:[{name:"in",dynamic:!0}],compile:({vars:o,name:e,lang:l})=>s[l].def(e,o.join(" - ")||0)}),_t=a("mod",{tags:["math"],description:"calculates the modulo",examples:["add(x=>x.add(.003).mod(1)).out()"],ins:[{name:"in"},{name:"modulo"}],compile:({vars:o,name:e,lang:l})=>s[l].def(e,s[l].mod(...o)||0)}),ei=a("abs",{tags:["math"],description:"returns the absolute value of the signal",ins:[{name:"in"}],examples:["sine(440).abs().out()"],compile:({vars:[o=0],name:e,lang:l})=>s[l].def(e,s[l].abs(o))}),ti=a("round",{tags:["math"],description:"Rounds the signal to the nearest integer",ins:[{name:"in"}],examples:["sine(440.5).round().out()"],compile:({vars:[o=0],name:e,lang:l})=>s[l].def(e,s[l].round(o))}),ii=a("clamp",{tags:["math"],description:"Clamps the signal to stay within the given range",ins:[{name:"in"},{name:"min"},{name:"max"}],examples:["sine(440.5).clamp(-.6,.6).out()"],compile:({vars:[o=0,e=-1,l=1],name:d,lang:p})=>{const b=s[p].min(e,l),R=s[p].max(e,l),I=s[p].min(s[p].max(o,b),R);return s[p].def(d,I)}}),ni=a("floor",{tags:["math"],description:"Rounds the signal down",ins:[{name:"in"}],examples:["sine(440.5).floor().out()"],compile:({vars:[o=0],name:e,lang:l})=>s[l].def(e,s[l].floor(o))}),si=a("ceil",{tags:["math"],description:"Rounds the signal up",ins:[{name:"in"}],examples:["sine(440.5).ceil().out()"],compile:({vars:[o=0],name:e,lang:l})=>s[l].def(e,s[l].ceil(o))}),li=a("sign",{tags:["math"],description:"Returns 1 if positive and -1 if negative. uses Math.sign",ins:[{name:"in"}],examples:["sine(440.5).ceil().out()"],compile:({vars:[o=0],name:e,lang:l})=>s[l].def(e,s[l].sign(o))}),ai=a("min",{tags:["math"],description:"returns the minimum of the given signals",examples:["impulse(4).apply(x => min(x.seq(0,3,2), x.seq(0,7,0,5,0)).add(48).midinote().sine()).out()"],ins:[{name:"in",dynamic:!0}],compile:({vars:o,name:e,lang:l})=>s[l].def(e,o.reduce(s[l].min)||0)}),oi=a("max",{tags:["math"],description:"returns the maximum of the given signals",examples:["impulse(4).apply(x => max(x.seq(0,3,2), x.seq(0,7,0,5,0)).add(48).midinote().sine()).out()"],ins:[{name:"in",dynamic:!0}],compile:({vars:o,name:e,lang:l})=>s[l].def(e,o.reduce(s[l].max)||0)}),di=a("argmin",{tags:["math"],description:"returns the index of the minimum of the given signals",examples:["argmin(saw(1), saw(3), saw(5)).mul(12).add(48).midinote().sine().out()"],ins:[{name:"in",dynamic:!0}],compile:({vars:o,name:e,lang:l})=>s[l].def(e,s[l].pair_b(o.map(s[l].pair_make).reduce(s[l].pair_a_min))||0)}),ci=a("argmax",{tags:["math"],description:"returns the index of the maximum of the given signals",examples:["argmax(saw(1), saw(3), saw(5)).mul(12).add(48).midinote().sine().out()"],ins:[{name:"in",dynamic:!0}],compile:({vars:o,name:e,lang:l})=>s[l].def(e,s[l].pair_b(o.map(s[l].pair_make).reduce(s[l].pair_a_max))||0)}),ee=a("greater",{tags:["logic"],description:"returns 1 if input is greater then threshold",ins:[{name:"in"},{name:"threshold"}],examples:[`greater(sine(1),0)
|
||
.bipolar().range(100,200)
|
||
.sine().out()`],compile:({vars:[o=0,e=0],name:l,lang:d})=>s[d].def(l,`${o} > ${e}`)}),te=a("lower",{tags:["logic"],description:"returns 1 if input is lower then threshold",ins:[{name:"in"},{name:"threshold"}],examples:[`lower(sine(1),0)
|
||
.bipolar().range(100,200)
|
||
.sine().out()`],compile:({vars:[o=0,e=0],name:l,lang:d})=>s[d].def(l,`${o} < ${e}`)}),pi=ee,ui=te,mi=a("xor",{tags:["logic"],description:"returns 1 if exactly one of the inputs is 1",ins:[{name:"a"},{name:"b"}],compile:({vars:[o=0,e=0],name:l,lang:d})=>s[d].def(l,`${o} != ${e} ? 1 : 0`)}),ri=a("and",{tags:["logic"],description:"returns 1 if both inputs are 1",ins:[{name:"a"},{name:"b"}],compile:({vars:[o=0,e=0],name:l,lang:d})=>s[d].def(l,`${o} && ${e} ? 1 : 0`)}),hi=a("or",{tags:["logic"],description:"returns 1 if one or both inputs are 1",ins:[{name:"a"},{name:"b"}],compile:({vars:[o=0,e=0],name:l,lang:d})=>s[d].def(l,`${o} || ${e} ? 1 : 0`)}),Gi=a("not",{tags:["logic"],description:"returns 1 if input is 0, otherwise 0",ins:[{name:"in"}],compile:({vars:[o=0],name:e,lang:l})=>s[l].def(e,`(${o} === 0 ? 1 : 0)`)}),yi=a("bool",{tags:["logic"],description:"returns 1 signal is non zero. inspired by genish",ins:[{name:"a"}],compile:({vars:[o=0],name:e,lang:l})=>s[l].def(e,`(${o} === 0 ? 0 : 1)`)}),fi=a("ifelse",{tags:["logic"],description:"if control is 1, a is returned, otherwise b",ins:[{name:"control"},{name:"a"},{name:"b"}],compile:({vars:[o=0,e=0,l=0],name:d,lang:p})=>s[p].def(d,`(${o} === 1 ? ${e} : ${l})`),examples:["ifelse(pulse(1), sine(220), sine(330)).out()"]}),gi=a("range",{tags:["math"],description:"Scales the incoming bipolar value to the given range.",examples:["sine(.5).range(.25,1).mul(sine(440)).out()"],ins:[{name:"in"},{name:"min"},{name:"max"}],compile:({vars:o,name:e,lang:l})=>{const[d,p,b,R=1]=o,I=`((${d} + 1) * 0.5)`,z=R===1?I:s[l].pow(I,R);return s[l].def(e,`${z} * (${b} - ${p}) + ${p}`)}}),Xi=a("remap",{ugen:"Remap",tags:["math"],description:"Remaps input from one value range to another",ins:[{name:"in"},{name:"inmin"},{name:"inmax"},{name:"outmin"},{name:"outmax"}],compile:({vars:[o=0,e=-1,l=1,d=-1,p=1],...b})=>s[b.lang].defUgen(b,o,e,l,d,p)}),Zi=a("thru",{compile:({name:o,vars:e,lang:l})=>s[l].def(o,e[0],"thru")}),bi=g("rangex",(o,e,l)=>{let d=H$1(e),p=H$1(l).sub(d),b=o.unipolar().mul(p).add(d);return A(b)},{tags:["math"],description:"exponential range",ins:[{name:"in"},{name:"min"},{name:"max"}],examples:["sine([1,3]).rangex(100, 2e3).sine().out()"]}),xi=a("midinote",{compile:({vars:[o],name:e,lang:l})=>s[l].def(e,s[l].midinote(o)),tags:["math"],description:"convert midi number to frequency",ins:[{name:"midi"}],examples:[`impulse(4).seq(0,3,7,12).add(60)
|
||
.midinote().sine().out()`]}),Ri=a("src",{internal:!0,compile:({vars:[o=0],name:e,lang:l,...d})=>s[l].def(e,d.getSource(o),`read source ${o}`)}),Li=a("output",{internal:!0,ugen:"Output",compile:({vars:[o,e=0],name:l,lang:d,...p})=>{const b=p.getOutput(e),R=p.getSource(e);return[s[d].def(b,[b,o].join(" + "),`+ output ${e}`),s[d].def(R,b,`write source ${e}`)].join(`
|
||
`)}}),ie=a("poly"),ne=f(Math.PI),Mi=u("fork",(o,e=1)=>ie(...Array.from({length:e},()=>o.clone())),{ins:[{name:"in"},{name:"times"}],tags:["multi-channel"],description:"split the signal into n channels",examples:["dust(4).fork(2).adsr(.1).mul(sine(220)).out()"]}),zi=g("perc",(o,e)=>o.adsr(0,0,1,e),{tags:["envelope"],description:"percussive envelope. usable with triggers or gates",ins:[{name:"gate"},{name:"release"}],examples:["impulse(4).perc(.1).mul( pink() ).out()"]}),Vi=g("hpf",(o,e,l=0)=>o.sub(o.lpf(e,l)),{ins:[{name:"in"},{name:"cutoff"},{name:"reso"}],description:"high pass filter",tags:["fx","filter"],examples:["tri([220,331,442]).mix().hpf(sine(.5).range(0,.9)).out()"]}),Wi=g("lpf",D$1,{ins:[{name:"in"},{name:"cutoff"},{name:"reso"}],description:"low pass filter",tags:["fx","filter"],examples:["saw(55).lpf( sine(1).range(.4,.8) ).out()"]}),Yi=a("bpf",{ugen:"BPF",ins:[{name:"in"},{name:"cutoff"},{name:"reso"}],description:"high pass filter",tags:["fx","filter"],compile:({vars:[o=0,e=1,l=0],...d})=>s[d.lang].defUgen(d,o,e,l)}),Ni=g("lfnoise",o=>O().hold($(o)),{ins:[{name:"freq"}],description:"low frequency stepped noise.",tags:["regular","noise"],examples:["lfnoise(4).range(200,800).sine().out()"]}),Hi=g("bipolar",o=>f(o).mul(2).sub(1),{ins:[{name:"in"}],description:"convert unipolar [0,1] signal to bipolar [-1,1]",tags:["math"]}),Si=g("unipolar",o=>f(o).add(1).div(2),{ins:[{name:"in"}],description:"convert bipolar [-1,1] signal to unipolar [0,1]",tags:["math"]}),Ti=g("pan",(o,e)=>(e=f(e).add(1).mul(ne,.25),o.mul([_(e),q(e)])),{ins:[{name:"in"},{name:"pos",description:"bipolar position: -1 = left, 0 = center, 1 = right"}],description:"pans signal to stereo position. splits signal path in 2",tags:["multi-channel"],examples:["sine(220).pan(sine(.25)).out()"]}),wi=a("pick",{tags:["multi-channel"],ugen:"Pick",description:"Pick",ins:[{name:"index"},{name:"inputs",dynamic:!0}],description:"picks input of given index",examples:[`sine(.25).range(0,2).round()
|
||
.pick(...sine([220,330,440]).ins)
|
||
.out()`],compile:({vars:o,...e})=>s[e.lang].defUgen(e,...o)}),Ki=a("clip",{tags:["fx"],ugen:"Clip",description:"Hard limits the signal between lo and hi.",ins:[{name:"input"},{name:"lo"},{name:"hi"}],compile:({vars:[o=0,e=-1,l=1],...d})=>s[d.lang].defUgen(d,o,e,l)}),Ci=a("trig",{tags:["trigger"],ugen:"Trig",description:"Emits a trigger impulse whenever the signal becomes positive. Useful to turn gates into triggers.",ins:[{name:"input",default:0},{name:"lo",default:-1},{name:"hi",default:1}],compile:({vars:[o=0,e=-1,l=1],...d})=>s[d.lang].defUgen(d,o,e,l),examples:[`pulse(2)
|
||
.trig() // comment out to hear difference
|
||
.ar(.01,.2)
|
||
.mul(sine(200)).out()`]}),vi=a("qf",{tags:["fx","filter"],ugen:"BiquadFilter",description:"biQuad Filter.",ins:[{name:"input",default:0},{name:"type",default:0,description:"filter type: 0 = lowpass, 1 = highpass, 2 = band pass, 3 = notch, 4 = allpass, 5 = peaking, 6 = lowshelf, 7 = highshelf"},{name:"freq",default:500,description:"filter cutoff in Hz"},{name:"q",default:1,description:"q factor"},{name:"gain",default:1}],compile:({vars:o,...e})=>s[e.lang].defUgen(e,...o),examples:[`pink()
|
||
.qf(
|
||
impulse(.5).seq(0,1,2,3,4,5,6,7), // type
|
||
tri(0.5).rangex(100, 8000), // freq
|
||
10, // Q
|
||
1, // gain (only relevant for types 5-7)
|
||
).div(4).out();`]}),Ii=u("qlpf",(o,e,l=10)=>o.qf(0,e,l),{description:"biQuad Low Pass Filter",ins:[{name:"input"},{name:"freq"},{name:"q",description:"resonance"}],tags:["fx","filter"],examples:[`pink().qlpf(
|
||
tri(0.5).rangex(100, 8000), // cutoff freq
|
||
10 // Q
|
||
).out()`]}),Ui=u("qhpf",(o,e,l=10)=>o.qf(1,e,l),{description:"biQuad High pass filter",ins:[{name:"input"},{name:"freq"},{name:"q",description:"resonance"}],tags:["fx","filter"],examples:[`pink().qhpf(
|
||
tri(0.5).rangex(100, 8000), // cutoff freq
|
||
10 // Q
|
||
).out()`]}),ki=u("qbpf",(o,e,l=10)=>o.qf(2,e,l),{description:"biQuad Band Pass Filter",ins:[{name:"input"},{name:"freq"},{name:"q",description:"resonance"}],tags:["fx","filter"],examples:[`pink().qbpf(
|
||
tri(0.5).rangex(100, 8000), // cutoff freq
|
||
10 // Q
|
||
).out()`]}),Pi=u("qnf",(o,e,l=10)=>o.qf(3,e,l),{description:"biQuad Notch Filter",ins:[{name:"input"},{name:"freq"},{name:"q",description:"resonance"}],tags:["fx","filter"],examples:[`pink().qnf(
|
||
tri(0.5).rangex(100, 8000), // cutoff freq
|
||
10 // Q
|
||
).out()`]}),Fi=u("qapf",(o,e,l=10)=>o.qf(3,e,l),{description:"biQuad All Pass Filter",ins:[{name:"input"},{name:"freq"},{name:"q",description:"resonance"}],tags:["fx","filter"],examples:[`impulse(1).qapf(
|
||
tri(0.5).rangex(100, 8000), // cutoff freq
|
||
10 // Q
|
||
).out()`]}),Ji=u("split",(o,e)=>o.type!=="poly"?e([o]):e(o.ins),{ins:[{name:"input"},{name:"fn"}],tags:["multi-channel"],description:"apply fn to an array of signals, one for each channel in input",examples:["sine([220,330,550]).split(chs => add(...chs)).out()"]}),ji=u("mix",(o,e=1)=>{if([1,2].includes(e)||(e=2,console.warn("mix only supports 1 or 2 channels atm.. falling back to 2")),o.type!=="poly")return o;if(e===2){const l=o.ins.map((d,p,b)=>{const R=(p/(b.length-1)*2-1+1)*Math.PI/4;return d.mul([Math.cos(R),Math.sin(R)]).inherit(o)});return C$1(...l)}return o.ins=o.ins.map(l=>l.inherit(o)),x$1("mix").withIns(...o.ins)},{compile:({vars:o,name:e,lang:l})=>s[l].def(e,`(${o.join(" + ")})`),description:`mixes down multiple channels. Useful to make sure you get a mono or stereo signal out at the end.
|
||
When mixing down to 2 channels, the input channels are equally distributed over the stereo image, e.g. 3 channels are panned [-1,0,1]`,ins:[{name:"in"},{name:"channels",default:1,description:"how many channels to mix down to. Only supports 1 and 2"}],tags:["multi-channel"],examples:["sine([220,330,440]).mix(2).out()"]});c.prototype.feedback=function(o){return this.add(o)};let Qi=o=>C$1(o),Bi=f,Ei=f,Oi=g("mouseX",()=>K("mouseX"),{ins:[],description:"X position of mouse, bipolar range",tags:["external"],examples:["mouseX.range(100,800).sine().out()"]}),$i=Oi(),Di=g("mouseY",()=>K("mouseY"),{ins:[],description:"Y position of mouse, bipolar range",tags:["external"],examples:["mouseY.range(800,100).sine().out()"]}),Ai=Di(),qi=u("scope",(o,e)=>{let l=1;o.type==="poly"&&(l=o.ins.length);const d=getNode("scope",o,e,l);return d.type!=="poly"?(d.ins.push({type:"n",value:0,ins:[]}),d):(d.ins.forEach((p,b)=>p.ins.push({type:"n",value:b,ins:[]})),d)},{ugen:"Scope",description:"renders an an oscilloscope of the current point in the graph. expects values between -1 and 1. warning: this feature is still experimental! when using it, make sure to not switch tabs, as it might fry your browser.",compile:({vars:[o,e,l,d],...p})=>w(p,o,e,l,d)});const P=Object.freeze(Object.defineProperty({__proto__:null,B:Bi,PI:ne,_:Ei,abs:ei,acos:Et,ad:Zt,add:C$1,adsr:gt,and:ri,ar:Xt,argmax:ci,argmin:di,asin:Ot,atan:$t,audioin:jt,bipolar:Hi,bool:yi,bpf:Yi,brown:zt,bytebeat:yt,cc:K,ceil:si,clamp:ii,clip:Ki,clock:bt,clockdiv:xt,cos:_,delay:It,distort:Rt,div:At,dust:Vt,exp:A,feedback:Qi,filter:D$1,floatbeat:ft,floor:ni,fold:Ct,fork:Mi,greater:ee,gt:pi,hold:Ut,hpf:Vi,ifelse:fi,impulse:$,lag:wt,lfnoise:Ni,log:H$1,lower:te,lpf:Wi,lt:ui,max:oi,midicc:Jt,midifreq:kt,midigate:Pt,midinote:xi,midivel:Ft,min:ai,mix:ji,mod:_t,mouseX:$i,mouseY:Ai,mul:Dt,noise:O,not:Gi,or:hi,output:Li,pan:Ti,perc:zi,pick:wi,pink:Mt,poly:ie,pow:Qt,pulse:St,qapf:Fi,qbpf:ki,qf:vi,qhpf:Ui,qlpf:Ii,qnf:Pi,range:gi,rangex:bi,raw:Gt,registerUgen:E,remap:Xi,rng:Lt,round:ti,saw:Wt,scope:qi,seq:vt,sign:li,sin:q,sine:Nt,slew:Kt,slide:Tt,split:Ji,src:Ri,sub:qt,tan:Bt,thru:Zi,time:ht,tri:Ht,trig:Ci,unipolar:Si,xor:mi,zaw:Yt},Symbol.toStringTag,{value:"Module"}));class en{constructor({onToggle:e,onToggleRecording:l,beforeEval:d,transpiler:p,localScope:b=!1,outputNode:R=null}={}){this.outputNode=R,this.audio=new Fe(this.outputNode),this.onToggle=e,this.transpiler=p,this.onToggleRecording=l,this.beforeEval=d,this.localScope=b,typeof window<"u"&&(b||(Object.assign(globalThis,k),Object.assign(globalThis,P),Object.assign(globalThis,U),Object.assign(globalThis,{repl:this})),window.addEventListener("message",z=>{z.data.type==="KABELSALAT_SET_CONTROL"&&this.audio.setControl(z.data.id,z.data.value)}));const I=this;c.prototype.spawn=function(z=[0,1],se){I.audio.spawn(this.output(z).exit(),se)}}registerUgen(e,l){return this.audio.registerUgen(l),E(e,l.name)}evaluate(e){this.localScope||(Object.assign(globalThis,{audio:this.audio}),Object.assign(globalThis,{addUgen:this.registerUgen.bind(this)}));let l;this.transpiler?l=this.transpiler(e):l={output:e},this.beforeEval?.(l);let d;return this.localScope&&(d={...k,...P,...U,audio:this.audio,addUgen:this.registerUgen.bind(this),repl:this}),j(l.output,d)}async play(e){await this.audio.init(),e.ins.length&&this.audio.spawn(e),this.onToggle?.(!0)}run(e){const l=this.evaluate(e);this.play(l)}stop(){this.stopRecording(),this.audio.stop(),this.onToggle?.(!1)}record(){this.audio.record(),this.onToggleRecording?.(!0)}stopRecording(){this.audio.stopRecording(),this.onToggleRecording?.(!1)}}const index$3=Object.freeze(Object.defineProperty({__proto__:null,AudioView:Fe,B:Bi,Node:c,PI:ne,SalatRepl:en,_:Ei,abs:ei,acos:Et,ad:Zt,add:C$1,adsr:gt,and:ri,ar:Xt,argmax:ci,argmin:di,asin:Ot,atan:$t,audioin:jt,bipolar:Hi,bool:yi,bpf:Yi,brown:zt,bytebeat:yt,cc:K,ceil:si,clamp:ii,clip:Ki,clock:bt,clockdiv:xt,compile:T$1,cos:_,delay:It,distort:Rt,div:At,dust:Vt,evaluate:j,exit:J$1,exp:A,exportModule:ce$1,feedback:Qi,filter:D$1,floatbeat:ft,floor:ni,fold:Ct,fork:Mi,getInletName:oe,getNode:F,greater:ee,gt:pi,hold:Ut,hpf:Vi,ifelse:fi,impulse:$,lag:wt,lfnoise:Ni,log:H$1,lower:te,lpf:Wi,lt:ui,max:oi,midicc:Jt,midifreq:kt,midigate:Pt,midinote:xi,midivel:Ft,min:ai,mix:ji,mod:_t,module:g,mouseX:$i,mouseY:Ai,mul:Dt,n:f,node:x$1,nodeRegistry:y,noise:O,not:Gi,or:hi,output:Li,outputType:Y$1,pan:Ti,perc:zi,pick:wi,pink:Mt,poly:ie,polyType:Z,pow:Qt,pulse:St,qapf:Fi,qbpf:ki,qf:vi,qhpf:Ui,qlpf:Ii,qnf:Pi,range:gi,rangex:bi,raw:Gt,register:u,registerNode:a,registerUgen:E,remap:Xi,rng:Lt,round:ti,saw:Wt,scope:qi,seq:vt,sign:li,sin:q,sine:Nt,slew:Kt,slide:Tt,split:Ji,src:Ri,sub:qt,tan:Bt,thru:Zi,time:ht,tri:Ht,trig:Ci,unipolar:Si,xor:mi,zaw:Yt},Symbol.toStringTag,{value:"Module"})),M=2,L=1,S=0,LABELS=["s","L","M"];class EdoScale{constructor(e,l,d,p){this.stepbackup=[L,L,S,L,L,L,S,L,L,L,S,L,L,L,S,L],this.large=e,this.medium=p||e,this.small=l,this.divisions=[],this.edivisions=null,this.sequence=null,this.tonic=1,this.mode=1,this.max_steps=12,this.min_steps=3,this.setSequence(d)}hasMedium(){return this.step.some((e,l)=>this.step[this.offset(l)]===M)}stepSize(e){return LABELS[this.step[this.offset(e)]]}sequence(){return this.step.map((e,l)=>this.stepSize(l)).join("")}stepValue(e){const l=this.step[this.offset(e)];return l===L?this.large:l===M?this.medium:this.small}offset(e){if(this.mode===1)return e;{const l=(this.mode-1+e)%this.length;return l===0?this.length:l}}static setMaxSteps(e){this.max_steps=e}static setMinSteps(e){this.min_steps=e}setSequence(e){if(this.sequence!==e){this.sequence=e,this.length=e.length,this.step=[];for(let l=0;l<e.length;l++){const d=e[l];this.step[l]=d==="L"?L:d==="M"?M:S}this.updateEdo()}else return!1}setLarge(e){if(this.large!==e)this.large=e,this.updateEdo();else return!1}setMedium(e){if(this.medium!==e)this.medium=e,this.updateEdo();else return!1}setSmall(e){if(this.small!==e)this.small=e,this.updateEdo();else return!1}setMode(e){this.mode=e}setTonic(e){this.tonic=e}changeMode(e){const l=this.mode;return this.mode=Math.max(1,Math.min(this.mode+e,this.length)),l!==this.mode}changeTonic(e){const l=this.tonic;return this.tonic=Math.max(1,Math.min(this.tonic+e,this.edivisions)),l!==this.tonic}updateEdo(){const e=this.edivisions;this.edivisions=this.step.reduce((d,p,b)=>(this.divisions[b]=d,d+this.stepValue(b)),0);const l=e!==this.edivisions;return l&&(this.tonic=Math.max(1,Math.min(this.tonic,this.edivisions))),l}changeStep(e,l){const d=this.offset(l),p=this.step[d];this.step[d]=Math.max(S,Math.min(this.step[d]+e,M)),this.stepbackup[d]=this.step[d];const b=p!==this.step[d];return b&&this.updateEdo(),b}changeLarge(e){const l=this.large;this.setLarge(Math.max(this.small+1,Math.min(this.large+e,this.large+1)));const d=this.large!==l;return d&&(this.large<=this.medium&&this.setMedium(Math.max(this.small+1,Math.min(this.large-1,this.large))),this.updateEdo()),d}changeMedium(e){const l=this.medium;this.setMedium(Math.max(this.small+1,Math.min(this.medium+e,this.large-1)));const d=this.medium!==l;return d&&this.updateEdo(),d}changeSmall(e){const l=this.small,d=this.small+e;this.hasMedium()?this.setSmall(Math.max(1,Math.min(d,this.medium-1))):this.setSmall(Math.max(1,Math.min(d,this.large-1)));const p=this.small!==l;return p&&(this.small>=this.medium&&this.setMedium(Math.max(this.small+1,Math.min(this.large))),this.updateEdo()),p}changeLength(e){const l=this.length;e===1?this.length=Math.min(this.length+1,this.max_steps):e===-1&&(this.length=Math.max(this.length-1,this.min_steps));const d=this.length!==l;return d&&(this.mode=1,e===1?this.step[this.length]=this.stepbackup[this.length]||L:e===-1&&this.length>=this.min_steps&&this.step.pop(),this.updateEdo()),d}}const ratiointervals={};ratiointervals.list=new Map([[1,["P1","P1","P1",1,1]],[1.0666666666666667,["m2","m2","m2_5",16,15]],[1.0714285714285714,["A1","A1","A1^5_7",15,14]],[1.0833333333333333,["t2","m2","m2^13",13,12]],[1.0909090909090908,["N2","M2","M2_11",12,11]],[1.1,["n2","m2","m2^11_5",11,10]],[1.1111111111111112,["T2","M2","M2^5",10,9]],[1.125,["M2","M2","M2",9,8]],[1.1428571428571428,["S2","M2","M2_7",8,7]],[1.1666666666666667,["s3","m3","m3^7",7,6]],[1.1875,["o3","m3","m3^19",19,16]],[1.2,["m3","m3","m3_5",6,5]],[1.2142857142857142,["t3","m3","m3^17_7",17,14]],[1.2222222222222223,["n3","m3","m3^11",11,9]],[1.25,["M3","M3","M3^5",5,4]],[1.2857142857142858,["S3","M3","M3_7",9,7]],[1.3,["d4","d4","d4^13_5",13,10]],[1.3333333333333333,["P4","P4","P4",4,3]],[1.3571428571428572,["N4","P4","P4^19_7",19,14]],[1.375,["n4","P4","P4^11",11,8]],[1.3888888888888888,["a4","A4","A4^5,5",25,18]],[1.4,["sT","d5","d5^7_5",7,5]],[1.40625,["A4","A4","A4^5",45,32]],[1.4166666666666667,["d5","d5","d5^17",17,12]],[1.4285714285714286,["ST","A4","A4^5_7",10,7]],[1.4444444444444444,["t5","d5","d5^13",13,9]],[1.5,["P5","P5","P5",3,2]],[1.5555555555555556,["s6","M6","m6^7",14,9]],[1.5625,["a5","A5","A5^5,5",25,16]],[1.5714285714285714,["A5","P5","P5^11_7",11,7]],[1.6,["m6","m6","m6_5",8,5]],[1.625,["N6","m6","m6^13",13,8]],[1.6363636363636365,["n6","M6","M6_11",18,11]],[1.6666666666666667,["M6","M6","M6^5",5,3]],[1.7066666666666668,["d7","d7","d7_5,5",128,75]],[1.7,["T6","d7","d7^17_5",17,10]],[1.7142857142857142,["S6","M6","M6_7",12,7]],[1.75,["s7","m7","m7^7",7,4]],[1.7777777777777777,["m7","m7","m7",16,9]],[1.8,["g7","m7","m7_5",9,5]],[1.8333333333333333,["n7","m7","m7^11",11,6]],[1.8571428571428572,["N7","m7","m7^13_7",13,7]],[1.875,["M7","M7","M7^5",15,8]],[1.8888888888888888,["T7","d8","d8^17",17,9]],[1.9,["d8","d8","d8^19_5",19,10]],[2,["P8","P8","P8",2,1]]]),ratiointervals.key=function(o){return o==null?"":ratiointervals.list.get(o)?.[0]||""},ratiointervals.label=function(o){return o==null?"":ratiointervals.list.get(o)?.[1]||""},ratiointervals.fjs=function(o){return o==null?"":ratiointervals.list.get(o)?.[2]||""},ratiointervals.nom=function(o){return o==null?null:ratiointervals.list.get(o)?.[3]||null},ratiointervals.denom=function(o){return o==null?null:ratiointervals.list.get(o)?.[4]||null},ratiointervals.nearestInterval=function(o){let e=1,l=null;for(const[d,p]of ratiointervals.list){const b=Math.abs((d-o)/d);b<e&&(e=b,l=d)}return e<.01?[e,l]:[null,null]};function ratio$1(o,e){return o===0?1:Math.pow(2,o/e)}class Intervals{constructor(e){this.scale=e,this.intLabels=[],this.intNoms=[],this.intRatios=[],this.uniqLabels=[],this.intErrors=[],this.ratios=[];const l="";let d=0;const p={},b={};this.ratios[0]=1;for(let R=0;R<e.length;R++)if(d+=e.stepValue(R),this.ratios[R+1]=ratio$1(d,e.edivisions),R<e.length){const I=ratiointervals.nearestInterval(this.ratios[R+1]),z=I[0],se=I[1],le=ratiointervals.key(se);this.intLabels[R+1]=le,this.intErrors[R+1]=z,this.intNoms[R+1]=se?ratiointervals.nom(se):0,this.intRatios[R+1]=se?`${ratiointervals.nom(se)}/${ratiointervals.denom(se)}`:"",this.uniqLabels[R+1]=l,le&&le!=="P1"&&le!=="P8"&&(p[le]?z<p[le]&&(this.uniqLabels[b[le]]=l,this.uniqLabels[R+1]=le,b[le]=R+1,p[le]=z):(this.uniqLabels[R+1]=le,b[le]=R+1,p[le]=z))}}ratio(e){return this.ratios[e]}intervalLabel(e){return this.intLabels[e]}intervalNominator(e){return this.intNoms[e]}intervalRatio(e){return this.intRatios[e]}uniqIntervalLabel(e){return this.uniqLabels[e]}intervalError(e){return this.intErrors[e]}nearestDegreeTo(e,l){let d=1,p=null;for(const[b,R]of Object.entries(this.ratios)){const I=Math.abs((e-R)/e);I<d&&(d=I,p=parseInt(b,10))}return l==null||d<l?p:1}}function ratio(o,e){return o===0?1:Math.pow(2,o/e)}function get_freq(o,e,l,d,p){let b=o*ratio(l-1,e);return d<p?b/=Math.pow(2,p-d):d>p&&(b*=Math.pow(2,d-p)),b}function midi_to_hz(o,e){return e*Math.pow(2,(o-69)/12)}const denom=Math.log(2);function hz_to_midi(o,e){return 12*(Math.log(o/e)/denom)+69}class Pitches{constructor(e,l,d,p,b){this.scale=e,this.intervals=l,this.base_freq=midi_to_hz(p,d),this.root_octave=b,this.freqs={},this.midis={},this.degrees={},this.octdegfreqs={},this.octdegmidis={};let R=0,I=null;for(let z=0;z<=8;z++){this.octdegfreqs[z]={},this.octdegmidis[z]={},I=get_freq(this.base_freq,e.edivisions,e.tonic,z,this.root_octave);for(let se=0;se<e.length;se++)R=R+1,this.freqs[R]=parseFloat((I*l.ratio(se)).toFixed(3)),this.midis[R]=parseFloat(hz_to_midi(I*l.ratio(se),d).toFixed(4)),this.degrees[R]=se,this.octdegfreqs[z][se+1]=this.freqs[R],this.octdegmidis[z][se+1]=this.midis[R]}this.base_freq=parseFloat(this.base_freq).toFixed(4)}base_freq(){return this.base_freq}degree(e){return this.degrees[e]}freq(e){return this.freqs[e]}octdeg(e){const l=e>this.scale.length,d=this.root_octave+(l?Math.floor((e-1)/this.scale.length):0),p=l?e%this.scale.length===0?this.scale.length:e%this.scale.length:e;return[d,p]}octdegfreq(e,l){return this.octdegfreqs[e]?this.octdegfreqs[e][l]:null}octdegmidi(e,l){return this.octdegmidis[e]?this.octdegmidis[e][l]:null}}const pitchesCache=new Map,edoScale=register("edoScale",function(o,e){const l=o.flat().join(":");let d;if(pitchesCache.has(l))d=pitchesCache.get(l);else{const[p,b,R,I]=o,z=tokenizeNote$3(p)[2]||3,se=new EdoScale(R,I,b),le=new Intervals(se);d=new Pitches(se,le,440,noteToMidi$1(p),z),pitchesCache.set(l,d)}return e.fmap(p=>{const b=typeof p=="object",R=b?p.n:p;if(b&&delete p.n,isNote(R))return pure(R);const I=(typeof R=="string"?parseInt(R,10):Number.isInteger(R)?R:Math.round(R))+1,[z,se]=d.octdeg(I),le=d.octdegfreq(z,se),tn=d.octdegmidi(z,se),an=d.scale.edivisions,sn=d.base_freq,ln=d.scale.divisions,un=d.intervals.intLabels;return p=pure(b?{...p,degree:se,degreeIndexes:ln,intLabels:un,root:sn,freq:le,edo:an}:tn),p}).outerJoin().withHap(p=>p.setContext({...p.context,scaleDefinition:o}))},!0,!0),packageName="@strudel/edo",index$2=Object.freeze(Object.defineProperty({__proto__:null,edoScale,packageName},Symbol.toStringTag,{value:"Module"}));let latestOptions,hydra;async function initHydra(o={}){if(latestOptions&&JSON.stringify(latestOptions)!==JSON.stringify(o)&&document.getElementById("hydra-canvas")?.remove(),latestOptions=o,!document.getElementById("hydra-canvas")){const{src:e="https://unpkg.com/hydra-synth",feedStrudel:l=!1,contextType:d="webgl",pixelRatio:p=1,pixelated:b=!0,...R}={detectAudio:!1,...o},{canvas:I}=getDrawContext("hydra-canvas",{contextType:d,pixelRatio:p,pixelated:b});if(R.canvas=I,await import(e),hydra=new Hydra(R),l){const{canvas:z}=getDrawContext();z.style.display="none",hydra.synth.s0.init({src:z})}}return hydra}function clearHydra(){hydra&&hydra.hush(),globalThis.s0?.clear(),document.getElementById("hydra-canvas")?.remove(),globalThis.speed=speed,globalThis.shape=shape}const H=o=>()=>reify(o).queryArc(getTime(),getTime())[0].value,hydra$1=Object.freeze(Object.defineProperty({__proto__:null,H,clearHydra,initHydra},Symbol.toStringTag,{value:"Module"})),gm={gm_piano:["0000_JCLive_sf2_file","0000_FluidR3_GM_sf2_file","0000_Aspirin_sf2_file","0000_Chaos_sf2_file","0000_GeneralUserGS_sf2_file","0001_FluidR3_GM_sf2_file","0001_GeneralUserGS_sf2_file","0010_Aspirin_sf2_file","0010_Chaos_sf2_file","0010_FluidR3_GM_sf2_file","0010_GeneralUserGS_sf2_file","0010_JCLive_sf2_file","0011_Aspirin_sf2_file","0011_FluidR3_GM_sf2_file","0011_GeneralUserGS_sf2_file","0012_GeneralUserGS_sf2_file","0020_Aspirin_sf2_file","0020_Chaos_sf2_file","0020_FluidR3_GM_sf2_file","0020_GeneralUserGS_sf2_file","0020_JCLive_sf2_file","0021_Aspirin_sf2_file","0021_GeneralUserGS_sf2_file","0022_Aspirin_sf2_file","0030_Aspirin_sf2_file","0030_Chaos_sf2_file","0030_FluidR3_GM_sf2_file","0030_GeneralUserGS_sf2_file","0030_JCLive_sf2_file","0031_Aspirin_sf2_file","0031_FluidR3_GM_sf2_file","0031_GeneralUserGS_sf2_file"],gm_epiano1:["0040_JCLive_sf2_file","0040_FluidR3_GM_sf2_file","0040_Aspirin_sf2_file","0040_Chaos_sf2_file","0040_GeneralUserGS_sf2_file","0041_FluidR3_GM_sf2_file","0041_GeneralUserGS_sf2_file","0042_GeneralUserGS_sf2_file","0043_GeneralUserGS_sf2_file","0044_GeneralUserGS_sf2_file","0046_GeneralUserGS_sf2_file"],gm_epiano2:["0050_JCLive_sf2_file","0050_FluidR3_GM_sf2_file","0050_Aspirin_sf2_file","0050_Chaos_sf2_file","0050_GeneralUserGS_sf2_file","0051_FluidR3_GM_sf2_file","0051_GeneralUserGS_sf2_file","0053_GeneralUserGS_sf2_file","0054_GeneralUserGS_sf2_file"],gm_harpsichord:["0060_JCLive_sf2_file","0060_FluidR3_GM_sf2_file","0060_Aspirin_sf2_file","0060_Chaos_sf2_file","0060_GeneralUserGS_sf2_file","0061_Aspirin_sf2_file","0061_GeneralUserGS_sf2_file","0062_GeneralUserGS_sf2_file"],gm_clavinet:["0070_JCLive_sf2_file","0070_FluidR3_GM_sf2_file","0070_Aspirin_sf2_file","0070_Chaos_sf2_file"],gm_celesta:["0080_JCLive_sf2_file","0080_Aspirin_sf2_file","0080_Chaos_sf2_file","0080_FluidR3_GM_sf2_file","0080_GeneralUserGS_sf2_file","0081_FluidR3_GM_sf2_file"],gm_glockenspiel:["0090_JCLive_sf2_file","0090_Aspirin_sf2_file","0090_Chaos_sf2_file","0090_FluidR3_GM_sf2_file","0090_GeneralUserGS_sf2_file"],gm_music_box:["0100_JCLive_sf2_file","0100_Aspirin_sf2_file","0100_Chaos_sf2_file","0100_FluidR3_GM_sf2_file","0100_GeneralUserGS_sf2_file"],gm_vibraphone:["0110_JCLive_sf2_file","0110_Aspirin_sf2_file","0110_Chaos_sf2_file","0110_FluidR3_GM_sf2_file","0110_GeneralUserGS_sf2_file","0111_FluidR3_GM_sf2_file"],gm_marimba:["0120_JCLive_sf2_file","0120_Aspirin_sf2_file","0120_Chaos_sf2_file","0120_FluidR3_GM_sf2_file","0120_GeneralUserGS_sf2_file","0121_FluidR3_GM_sf2_file","0121_GeneralUserGS_sf2_file"],gm_xylophone:["0130_JCLive_sf2_file","0130_Aspirin_sf2_file","0130_Chaos_sf2_file","0130_FluidR3_GM_sf2_file","0130_GeneralUserGS_sf2_file","0131_FluidR3_GM_sf2_file"],gm_tubular_bells:["0140_JCLive_sf2_file","0140_Aspirin_sf2_file","0140_FluidR3_GM_sf2_file","0140_GeneralUserGS_sf2_file","0141_FluidR3_GM_sf2_file","0142_GeneralUserGS_sf2_file"],gm_dulcimer:["0150_Aspirin_sf2_file","0150_Chaos_sf2_file","0150_FluidR3_GM_sf2_file","0150_GeneralUserGS_sf2_file","0151_FluidR3_GM_sf2_file"],gm_drawbar_organ:["0160_JCLive_sf2_file","0160_Aspirin_sf2_file","0160_Chaos_sf2_file","0160_FluidR3_GM_sf2_file","0160_GeneralUserGS_sf2_file","0161_Aspirin_sf2_file","0161_FluidR3_GM_sf2_file"],gm_percussive_organ:["0170_JCLive_sf2_file","0170_Aspirin_sf2_file","0170_Chaos_sf2_file","0170_FluidR3_GM_sf2_file","0171_FluidR3_GM_sf2_file","0172_FluidR3_GM_sf2_file"],gm_rock_organ:["0180_JCLive_sf2_file","0180_Aspirin_sf2_file","0180_Chaos_sf2_file","0180_FluidR3_GM_sf2_file","0180_GeneralUserGS_sf2_file"],gm_church_organ:["0190_JCLive_sf2_file","0190_Aspirin_sf2_file","0190_Chaos_sf2_file","0190_FluidR3_GM_sf2_file","0190_GeneralUserGS_sf2_file"],gm_reed_organ:["0200_JCLive_sf2_file","0200_Aspirin_sf2_file","0200_Chaos_sf2_file","0200_FluidR3_GM_sf2_file","0200_GeneralUserGS_sf2_file","0201_Aspirin_sf2_file","0201_FluidR3_GM_sf2_file","0201_GeneralUserGS_sf2_file"],gm_accordion:["0210_JCLive_sf2_file","0210_FluidR3_GM_sf2_file","0210_GeneralUserGS_sf2_file","0211_Aspirin_sf2_file","0211_FluidR3_GM_sf2_file","0211_GeneralUserGS_sf2_file","0212_GeneralUserGS_sf2_file"],gm_harmonica:["0220_FluidR3_GM_sf2_file","0220_JCLive_sf2_file","0220_Aspirin_sf2_file","0220_Chaos_sf2_file","0220_GeneralUserGS_sf2_file","0221_FluidR3_GM_sf2_file"],gm_bandoneon:["0230_Aspirin_sf2_file","0230_JCLive_sf2_file","0230_Chaos_sf2_file","0230_FluidR3_GM_sf2_file","0230_GeneralUserGS_sf2_file","0231_FluidR3_GM_sf2_file","0231_GeneralUserGS_sf2_file","0231_JCLive_sf2_file","0232_FluidR3_GM_sf2_file","0233_FluidR3_GM_sf2_file"],gm_acoustic_guitar_nylon:["0240_JCLive_sf2_file","0240_Aspirin_sf2_file","0240_Chaos_sf2_file","0240_FluidR3_GM_sf2_file","0240_GeneralUserGS_sf2_file","0240_LK_Godin_Nylon_SF2_file","0241_JCLive_sf2_file","0242_JCLive_sf2_file","0243_JCLive_sf2_file"],gm_acoustic_guitar_steel:["0253_Acoustic_Guitar_sf2_file","0250_Aspirin_sf2_file","0250_Chaos_sf2_file","0250_FluidR3_GM_sf2_file","0250_GeneralUserGS_sf2_file","0250_LK_AcousticSteel_SF2_file","0253_Acoustic_Guitar_sf2_file","0253_GeneralUserGS_sf2_file","0254_Acoustic_Guitar_sf2_file","0254_GeneralUserGS_sf2_file"],gm_electric_guitar_jazz:["0260_JCLive_sf2_file","0260_Aspirin_sf2_file","0260_Chaos_sf2_file","0260_FluidR3_GM_sf2_file","0260_GeneralUserGS_sf2_file","0260_Stratocaster_sf2_file","0261_GeneralUserGS_sf2_file","0261_Stratocaster_sf2_file","0262_Stratocaster_sf2_file"],gm_electric_guitar_clean:["0270_Aspirin_sf2_file","0270_Chaos_sf2_file","0270_FluidR3_GM_sf2_file","0270_GeneralUserGS_sf2_file","0270_SBAWE32_sf2_file","0270_Stratocaster_sf2_file","0271_GeneralUserGS_sf2_file","0271_Stratocaster_sf2_file","0272_Stratocaster_sf2_file"],gm_electric_guitar_muted:["0280_Aspirin_sf2_file","0280_Chaos_sf2_file","0280_GeneralUserGS_sf2_file","0280_JCLive_sf2_file","0280_LesPaul_sf2_file","0280_SBAWE32_sf2_file","0281_Aspirin_sf2_file","0281_FluidR3_GM_sf2_file","0281_GeneralUserGS_sf2_file","0282_FluidR3_GM_sf2_file"],gm_overdriven_guitar:["0290_FluidR3_GM_sf2_file","0290_Aspirin_sf2_file","0290_Chaos_sf2_file","0290_GeneralUserGS_sf2_file","0290_LesPaul_sf2_file","0290_SBAWE32_sf2_file","0291_LesPaul_sf2_file","0291_SBAWE32_sf2_file","0292_Aspirin_sf2_file","0292_LesPaul_sf2_file"],gm_distortion_guitar:["0300_FluidR3_GM_sf2_file","0300_Aspirin_sf2_file","0300_Chaos_sf2_file","0300_GeneralUserGS_sf2_file","0300_LesPaul_sf2_file","0302_Aspirin_sf2_file","0304_Aspirin_sf2_file"],gm_guitar_harmonics:["0310_Aspirin_sf2_file","0310_FluidR3_GM_sf2_file","0310_Chaos_sf2_file"],gm_acoustic_bass:["0320_JCLive_sf2_file","0320_FluidR3_GM_sf2_file","0320_Aspirin_sf2_file","0320_Chaos_sf2_file"],gm_electric_bass_finger:["0330_JCLive_sf2_file","0330_FluidR3_GM_sf2_fible","0330_Aspirin_sf2_file","0330_GeneralUserGS_sf2_file"],gm_electric_bass_pick:["0340_JCLive_sf2_file","0340_FluidR3_GM_sf2_file","0340_Aspirin_sf2_file","0340_GeneralUserGS_sf2_file","0341_Aspirin_sf2_file"],gm_fretless_bass:["0350_Aspirin_sf2_file","0350_JCLive_sf2_file"],gm_slap_bass_1:["0360_Aspirin_sf2_file","0360_JCLive_sf2_file","0360_FluidR3_GM_sf2_file","0360_Chaos_sf2_file"],gm_slap_bass_2:["0370_Aspirin_sf2_file","0370_FluidR3_GM_sf2_file","0370_GeneralUserGS_sf2_fil e","0370_JCLive_sf2_file"],gm_synth_bass_1:["0380_Chaos_sf2_file","0380_FluidR3_GM_sf2_file","0380_JCLive_sf2_file","0381_FluidR3_GM_sf2_file","0381_GeneralUserGS_sf2_file","0382_GeneralUserGS_sf2_file","0383_GeneralUserGS_sf2_file","0384_GeneralUserGS_sf2_file","0387_GeneralUserGS_sf2_file"],gm_synth_bass_2:["0390_Aspirin_sf2_file","0390_FluidR3_GM_sf2_file","0390_GeneralUserGS_sf2_file","0390_JCLive_sf2_file","0391_FluidR3_GM_sf2_file","0392_FluidR3_GM_sf2_file","0393_GeneralUserGS_sf2_file"],gm_violin:["0400_Aspirin_sf2_file","0400_Chaos_sf2_file","0400_JCLive_sf2_file","0400_FluidR3_GM_sf2_file","0400_GeneralUserGS_sf2_file","0401_Aspirin_sf2_file","0401_FluidR3_GM_sf2_file","0401_GeneralUserGS_sf2_file","0402_GeneralUserGS_sf2_file"],gm_viola:["0410_Aspirin_sf2_file","0410_FluidR3_GM_sf2_file","0410_GeneralUserGS_sf2_file","0410_JCLive_sf2_file","0411_FluidR3_GM_sf2_file"],gm_cello:["0420_Aspirin_sf2_file","0420_FluidR3_GM_sf2_file","0420_GeneralUserGS_sf2_file","0420_JCLive_sf2_file","0421_FluidR3_GM_sf2_file","0421_GeneralUserGS_sf2_file"],gm_contrabass:["0430_Aspirin_sf2_file","0430_Chaos_sf2_file","0430_GeneralUserGS_sf2_file"],gm_tremolo_strings:["0440_Aspirin_sf2_file","0440_Chaos_sf2_file","0440_GeneralUserGS_sf2_file","0440_JCLive_sf2_file","0441_GeneralUserGS_sf2_file","0442_GeneralUserGS_sf2_file"],gm_pizzicato_strings:["0450_Aspirin_sf2_file","0450_Chaos_sf2_file","0450_FluidR3_GM_sf2_file","0450_GeneralUserGS_sf2_file","0450_JCLive_sf2_file","0451_FluidR3_GM_sf2_file"],gm_orchestral_harp:["0460_Aspirin_sf2_file","0460_FluidR3_GM_sf2_file","0460_GeneralUserGS_sf2_file","0460_JCLive_sf2_file","0461_FluidR3_GM_sf2_file"],gm_timpani:["0470_Aspirin_sf2_file","0470_Chaos_sf2_file","0470_FluidR3_GM_sf2_file","0470_GeneralUserGS_sf2_file","0471_FluidR3_GM_sf2_file","0471_GeneralUserGS_sf2_file"],gm_string_ensemble_1:["0480_Aspirin_sf2_file","0480_Chaos_sf2_file","0480_FluidR3_GM_sf2_file","0480_GeneralUserGS_sf2_file","0480_JCLive_sf2_file","0481_Aspirin_sf2_file","0481_FluidR3_GM_sf2_file","0481_GeneralUserGS_sf2_file","0482_Aspirin_sf2_file","0482_GeneralUserGS_sf2_file","0483_GeneralUserGS_sf2_file"],gm_string_ensemble_2:["0490_Aspirin_sf2_file","0490_Chaos_sf2_file","0490_FluidR3_GM_sf2_file","0490_GeneralUserGS_sf2_file","0490_JCLive_sf2_file","0491_GeneralUserGS_sf2_file","0492_GeneralUserGS_sf2_file"],gm_synth_strings_1:["0500_Aspirin_sf2_file","0500_GeneralUserGS_sf2_file","0500_JCLive_sf2_file","0501_FluidR3_GM_sf2_file","0502_GeneralUserGS_sf2_file","0503_FluidR3_GM_sf2_file","0505_FluidR3_GM_sf2_file"],gm_synth_strings_2:["0510_Aspirin_sf2_file","0510_Chaos_sf2_file","0510_GeneralUserGS_sf2_file","0511_GeneralUserGS_sf2_file"],gm_choir_aahs:["0520_Aspirin_sf2_file","0520_Chaos_sf2_file","0520_FluidR3_GM_sf2_file","0520_GeneralUserGS_sf2_file","0520_JCLive_sf2_file","0520_Soul_Ahhs_sf2_file","0521_FluidR3_GM_sf2_file","0521_Soul_Ahhs_sf2_file","0522_Soul_Ahhs_sf2_file"],gm_voice_oohs:["0530_Aspirin_sf2_file","0530_Chaos_sf2_file","0530_FluidR3_GM_sf2_file","0530_GeneralUserGS_sf2_file","0531_FluidR3_GM_sf2_file","0531_JCLive_sf2_file"],gm_synth_choir:["0540_Aspirin_sf2_file","0540_Chaos_sf2_file","0540_FluidR3_GM_sf2_file","0540_GeneralUserGS_sf2_file","0541_FluidR3_GM_sf2_file"],gm_orchestra_hit:["0550_Aspirin_sf2_file","0550_Chaos_sf2_file","0550_FluidR3_GM_sf2_file","0550_GeneralUserGS_sf2_file","0551_FluidR3_GM_sf2_file"],gm_trumpet:["0560_FluidR3_GM_sf2_file","0560_JCLive_sf2_file","0560_Aspirin_sf2_file","0560_Chaos_sf2_file"],gm_trombone:["0570_Aspirin_sf2_file","0570_Chaos_sf2_file","0570_FluidR3_GM_sf2_file","0570_GeneralUserGS_sf2_file","0571_GeneralUserGS_sf2_file"],gm_tuba:["0580_FluidR3_GM_sf2_file","0580_Aspirin_sf2_file","0580_Chaos_sf2_file","0580_GeneralUserGS_sf2_file"],gm_muted_trumpet:["0590_JCLive_sf2_file","0590_Aspirin_sf2_file","0590_Chaos_sf2_file","0590_FluidR3_GM_sf2_file","0590_GeneralUserGS_sf2_file"],gm_french_horn:["0600_Aspirin_sf2_file","0600_FluidR3_GM_sf2_file","0600_GeneralUserGS_sf2_file","0600_JCLive_sf2_file","0601_FluidR3_GM_sf2_file"],gm_brass_section:["0610_JCLive_sf2_file","0610_Aspirin_sf2_file","0610_Chaos_sf2_file","0610_FluidR3_GM_sf2_file","0610_GeneralUserGS_sf2_file"],gm_synth_brass_1:["0620_Aspirin_sf2_file","0620_FluidR3_GM_sf2_file","0621_Aspirin_sf2_file","0621_FluidR3_GM_sf2_file"],gm_synth_brass_2:["0630_Aspirin_sf2_file","0630_Chaos_sf2_file","0630_FluidR3_GM_sf2_file","0630_JCLive_sf2_file","0631_FluidR3_GM_sf2_file","0632_FluidR3_GM_sf2_file","0633_FluidR3_GM_sf2_file"],gm_soprano_sax:["0640_JCLive_sf2_file","0640_Aspirin_sf2_file","0640_Chaos_sf2_file","0640_FluidR3_GM_sf2_file","0641_FluidR3_GM_sf2_file"],gm_alto_sax:["0650_JCLive_sf2_file","0650_Chaos_sf2_file","0650_FluidR3_GM_sf2_file","0650_GeneralUserGS_sf2_file","0651_Aspirin_sf2_file","0651_FluidR3_GM_sf2_file"],gm_tenor_sax:["0660_JCLive_sf2_file","0660_Aspirin_sf2_file","0660_Chaos_sf2_file","0660_GeneralUserGS_sf2_file"],gm_baritone_sax:["0670_JCLive_sf2_file","0670_Aspirin_sf2_file","0670_Chaos_sf2_file","0670_FluidR3_GM_sf2_file","0670_GeneralUserGS_sf2_file","0671_FluidR3_GM_sf2_file"],gm_oboe:["0680_JCLive_sf2_file","0680_Chaos_sf2_file","0680_FluidR3_GM_sf2_file","0680_GeneralUserGS_sf2_file","0681_FluidR3_GM_sf2_file"],gm_english_horn:["0690_JCLive_sf2_file","0690_Aspirin_sf2_file","0690_FluidR3_GM_sf2_file","0691_FluidR3_GM_sf2_file"],gm_bassoon:["0700_JCLive_sf2_file","0700_FluidR3_GM_sf2_file","0700_GeneralUserGS_sf2_file","0701_FluidR3_GM_sf2_file"],gm_clarinet:["0710_JCLive_sf2_file","0710_Aspirin_sf2_file","0710_Chaos_sf2_file","0710_FluidR3_GM_sf2_file","0710_GeneralUserGS_sf2_file","0711_FluidR3_GM_sf2_file"],gm_piccolo:["0720_JCLive_sf2_file","0720_Aspirin_sf2_file","0720_FluidR3_GM_sf2_file","0720_GeneralUserGS_sf2_file","0721_FluidR3_GM_sf2_file"],gm_flute:["0730_JCLive_sf2_file","0730_Aspirin_sf2_file","0730_FluidR3_GM_sf2_file","0730_GeneralUserGS_sf2_file","0731_FluidR3_GM_sf2_file"],gm_recorder:["0740_JCLive_sf2_file","0740_Aspirin_sf2_file","0740_Chaos_sf2_file","0740_FluidR3_GM_sf2_file","0740_GeneralUserGS_sf2_file"],gm_pan_flute:["0750_JCLive_sf2_file","0750_FluidR3_GM_sf2_file","0750_Aspirin_sf2_file","0750_Chaos_sf2_file","0750_GeneralUserGS_sf2_file","0751_Aspirin_sf2_file","0751_FluidR3_GM_sf2_file","0751_GeneralUserGS_sf2_file"],gm_blown_bottle:["0760_FluidR3_GM_sf2_file","0760_JCLive_sf2_file","0760_Chaos_sf2_file","0760_GeneralUserGS_sf2_file","0761_FluidR3_GM_sf2_file"],gm_shakuhachi:["0770_JCLive_sf2_file","0771_FluidR3_GM_sf2_file","0770_Aspirin_sf2_file","0770_FluidR3_GM_sf2_file","0770_GeneralUserGS_sf2_file"],gm_whistle:["0780_FluidR3_GM_sf2_file","0780_JCLive_sf2_file","0780_Aspirin_sf2_file","0780_Chaos_sf2_file"],gm_ocarina:["0790_FluidR3_GM_sf2_file","0790_JCLive_sf2_file","0790_Aspirin_sf2_file","0790_GeneralUserGS_sf2_file"],gm_lead_1_square:["0800_Aspirin_sf2_file","0800_Chaos_sf2_file","0800_FluidR3_GM_sf2_file"],gm_lead_2_sawtooth:["0810_JCLive_sf2_file","0810_Aspirin_sf2_file","0810_Chaos_sf2_file","0810_FluidR3_GM_sf2_file","0810_GeneralUserGS_sf2_file","0811_Aspirin_sf2_file","0811_GeneralUserGS_sf2_file"],gm_lead_3_calliope:["0820_JCLive_sf2_file","0820_Aspirin_sf2_file","0820_Chaos_sf2_file","0820_FluidR3_GM_sf2_file","0820_GeneralUserGS_sf2_file","0821_FluidR3_GM_sf2_file","0821_GeneralUserGS_sf2_file"],gm_lead_4_chiff:["0830_JCLive_sf2_file","0830_Aspirin_sf2_file","0830_FluidR3_GM_sf2_file","0830_GeneralUserGS_sf2_file","0831_FluidR3_GM_sf2_file","0831_GeneralUserGS_sf2_file"],gm_lead_5_charang:["0840_JCLive_sf2_file","0840_FluidR3_GM_sf2_file","0840_Aspirin_sf2_file","0840_Chaos_sf2_file","0840_GeneralUserGS_sf2_file","0841_Aspirin_sf2_file","0841_Chaos_sf2_file","0841_FluidR3_GM_sf2_file","0841_GeneralUserGS_sf2_file","0842_FluidR3_GM_sf2_file"],gm_lead_6_voice:["0850_JCLive_sf2_file","0850_Aspirin_sf2_file","0850_FluidR3_GM_sf2_file","0851_FluidR3_GM_sf2_file","0851_GeneralUserGS_sf2_file","0851_JCLive_sf2_file"],gm_lead_7_fifths:["0860_JCLive_sf2_file","0860_Aspirin_sf2_file","0860_Chaos_sf2_file","0860_GeneralUserGS_sf2_file","0861_Aspirin_sf2_file"],gm_lead_8_bass_lead:["0870_JCLive_sf2_file","0870_Aspirin_sf2_file","0870_Chaos_sf2_file","0870_FluidR3_GM_sf2_file","0870_GeneralUserGS_sf2_file"],gm_pad_new_age:["0880_JCLive_sf2_file","0880_Aspirin_sf2_file","0880_Chaos_sf2_file","0880_FluidR3_GM_sf2_file","0880_GeneralUserGS_sf2_file","0881_Aspirin_sf2_file","0881_FluidR3_GM_sf2_file","0881_GeneralUserGS_sf2_file","0882_Aspirin_sf2_file","0882_GeneralUserGS_sf2_file","0885_GeneralUserGS_sf2_file","0887_GeneralUserGS_sf2_file"],gm_pad_warm:["0890_JCLive_sf2_file","0890_Aspirin_sf2_file","0890_Chaos_sf2_file","0890_FluidR3_GM_sf2_file","0890_GeneralUserGS_sf2_file","0891_Aspirin_sf2_file","0891_FluidR3_GM_sf2_file"],gm_pad_poly:["0900_JCLive_sf2_file","0900_Chaos_sf2_file","0900_FluidR3_GM_sf2_file","0900_GeneralUserGS_sf2_file","0901_Aspirin_sf2_file","0901_FluidR3_GM_sf2_file","0901_GeneralUserGS_sf2_file"],gm_pad_choir:["0910_FluidR3_GM_sf2_file","0910_JCLive_sf2_file","0910_Aspirin_sf2_file","0910_GeneralUserGS_sf2_file","0911_GeneralUserGS_sf2_file","0911_JCLive_sf2_file"],gm_pad_bowed:["0920_JCLive_sf2_file","0920_Aspirin_sf2_file","0920_GeneralUserGS_sf2_file","0921_Aspirin_sf2_file","0921_GeneralUserGS_sf2_file"],gm_pad_metallic:["0930_Aspirin_sf2_file","0930_Chaos_sf2_file","0930_FluidR3_GM_sf2_file","0930_GeneralUserGS_sf2_file","0931_Aspirin_sf2_file","0931_FluidR3_GM_sf2_file","0931_GeneralUserGS_sf2_file"],gm_pad_halo:["0940_Chaos_sf2_file","0940_FluidR3_GM_sf2_file","0940_GeneralUserGS_sf2_file","0940_JCLive_sf2_file","0941_Aspirin_sf2_file","0941_FluidR3_GM_sf2_file","0941_GeneralUserGS_sf2_file","0941_JCLive_sf2_file"],gm_pad_sweep:["0950_Aspirin_sf2_file","0950_Chaos_sf2_file","0950_FluidR3_GM_sf2_file","0950_GeneralUserGS_sf2_file","0950_JCLive_sf2_file","0951_FluidR3_GM_sf2_file","0951_GeneralUserGS_sf2_file"],gm_fx_rain:["0960_FluidR3_GM_sf2_file","0960_Chaos_sf2_file","0960_GeneralUserGS_sf2_file","0961_Aspirin_sf2_file","0961_FluidR3_GM_sf2_file","0962_GeneralUserGS_sf2_file"],gm_fx_soundtrack:["0970_FluidR3_GM_sf2_file","0970_Aspirin_sf2_file","0970_GeneralUserGS_sf2_file","0971_FluidR3_GM_sf2_file","0971_GeneralUserGS_sf2_file"],gm_fx_crystal:["0980_Aspirin_sf2_file","0980_JCLive_sf2_file","0980_Chaos_sf2_file","0980_GeneralUserGS_sf2_file","0981_FluidR3_GM_sf2_file","0981_Aspirin_sf2_file","0981_GeneralUserGS_sf2_file","0982_GeneralUserGS_sf2_file","0983_GeneralUserGS_sf2_file","0984_GeneralUserGS_sf2_file"],gm_fx_atmosphere:["0990_JCLive_sf2_file","0990_Aspirin_sf2_file","0990_Chaos_sf2_file","0990_FluidR3_GM_sf2_file","0990_GeneralUserGS_sf2_file","0991_Aspirin_sf2_file","0991_FluidR3_GM_sf2_file","0991_GeneralUserGS_sf2_file","0991_JCLive_sf2_file","0992_FluidR3_GM_sf2_file","0992_JCLive_sf2_file","0993_JCLive_sf2_file","0994_JCLive_sf2_file"],gm_fx_brightness:["1000_JCLive_sf2_file","1000_Aspirin_sf2_file","1000_Chaos_sf2_file","1000_FluidR3_GM_sf2_file","1000_GeneralUserGS_sf2_file","1001_Aspirin_sf2_file","1001_FluidR3_GM_sf2_file","1001_GeneralUserGS_sf2_file","1001_JCLive_sf2_file","1002_Aspirin_sf2_file","1002_FluidR3_GM_sf2_file","1002_GeneralUserGS_sf2_file"],gm_fx_goblins:["1010_FluidR3_GM_sf2_file","1010_JCLive_sf2_file","1010_Aspirin_sf2_file","1010_Chaos_sf2_file","1010_GeneralUserGS_sf2_file","1011_Aspirin_sf2_file","1011_FluidR3_GM_sf2_file","1011_JCLive_sf2_file","1012_Aspirin_sf2_file"],gm_fx_echoes:["1020_FluidR3_GM_sf2_file","1020_JCLive_sf2_file","1020_Aspirin_sf2_file","1020_Chaos_sf2_file","1020_GeneralUserGS_sf2_file","1021_Aspirin_sf2_file","1021_FluidR3_GM_sf2_file","1021_GeneralUserGS_sf2_file","1021_JCLive_sf2_file","1022_GeneralUserGS_sf2_file"],gm_fx_sci_fi:["1030_FluidR3_GM_sf2_file","1030_Aspirin_sf2_file","1030_Chaos_sf2_file","1030_GeneralUserGS_sf2_file","1030_JCLive_sf2_file","1031_Aspirin_sf2_file","1031_FluidR3_GM_sf2_file","1031_GeneralUserGS_sf2_file","1032_FluidR3_GM_sf2_file"],gm_sitar:["1040_Aspirin_sf2_file","1040_FluidR3_GM_sf2_file","1040_JCLive_sf2_file","1040_Chaos_sf2_file","1040_GeneralUserGS_sf2_file","1041_FluidR3_GM_sf2_file","1041_GeneralUserGS_sf2_file"],gm_banjo:["1050_FluidR3_GM_sf2_file","1050_JCLive_sf2_file","1050_Aspirin_sf2_file","1050_Chaos_sf2_file","1050_GeneralUserGS_sf2_file","1051_GeneralUserGS_sf2_file"],gm_shamisen:["1060_JCLive_sf2_file","1060_FluidR3_GM_sf2_file","1060_Aspirin_sf2_file","1060_Chaos_sf2_file","1060_GeneralUserGS_sf2_file","1061_FluidR3_GM_sf2_file","1061_GeneralUserGS_sf2_file"],gm_koto:["1070_FluidR3_GM_sf2_file","1070_JCLive_sf2_file","1070_Aspirin_sf2_file","1070_Chaos_sf2_file","1070_GeneralUserGS_sf2_file","1071_FluidR3_GM_sf2_file","1071_GeneralUserGS_sf2_file","1072_GeneralUserGS_sf2_file","1073_GeneralUserGS_sf2_file"],gm_kalimba:["1080_JCLive_sf2_file","1080_FluidR3_GM_sf2_file","1080_Aspirin_sf2_file","1080_Chaos_sf2_file","1080_GeneralUserGS_sf2_file"],gm_bagpipe:["1090_Aspirin_sf2_file"],gm_fiddle:["1100_JCLive_sf2_file","1100_Aspirin_sf2_file","1100_Chaos_sf2_file","1100_FluidR3_GM_sf2_file","1100_GeneralUserGS_sf2_file","1101_Aspirin_sf2_file","1101_FluidR3_GM_sf2_file","1101_GeneralUserGS_sf2_file","1102_GeneralUserGS_sf2_file"],gm_shanai:["1110_Aspirin_sf2_file","1110_FluidR3_GM_sf2_file","1110_JCLive_sf2_file","1110_Chaos_sf2_file","1110_GeneralUserGS_sf2_file"],gm_tinkle_bell:["1120_Aspirin_sf2_file"],gm_agogo:["1130_JCLive_sf2_file","1130_Aspirin_sf2_file","1130_Chaos_sf2_file","1130_FluidR3_GM_sf2_file","1130_GeneralUserGS_sf2_file","1131_FluidR3_GM_sf2_file"],gm_steel_drums:["1140_FluidR3_GM_sf2_file","1140_Aspirin_sf2_file","1140_JCLive_sf2_file","1140_Chaos_sf2_file","1140_GeneralUserGS_sf2_file","1141_FluidR3_GM_sf2_file"],gm_woodblock:["1150_JCLive_sf2_file","1150_Aspirin_sf2_file","1150_Chaos_sf2_file","1150_FluidR3_GM_sf2_file","1150_GeneralUserGS_sf2_file","1151_FluidR3_GM_sf2_file","1151_GeneralUserGS_sf2_file","1152_FluidR3_GM_sf2_file","1152_GeneralUserGS_sf2_file"],gm_taiko_drum:["1160_JCLive_sf2_file","1160_FluidR3_GM_sf2_file","1160_Aspirin_sf2_file","1160_Chaos_sf2_file","1160_GeneralUserGS_sf2_file","1161_FluidR3_GM_sf2_file","1161_GeneralUserGS_sf2_file","1162_FluidR3_GM_sf2_file","1162_GeneralUserGS_sf2_file","1163_FluidR3_GM_sf2_file"],gm_melodic_tom:["1170_JCLive_sf2_file","1170_Aspirin_sf2_file","1170_Chaos_sf2_file","1170_FluidR3_GM_sf2_file","1170_GeneralUserGS_sf2_file","1171_FluidR3_GM_sf2_file","1171_GeneralUserGS_sf2_file","1172_FluidR3_GM_sf2_file","1173_FluidR3_GM_sf2_file"],gm_synth_drum:["1180_JCLive_sf2_file","1180_Aspirin_sf2_file","1180_Chaos_sf2_file","1180_FluidR3_GM_sf2_file","1180_GeneralUserGS_sf2_file","1181_FluidR3_GM_sf2_file","1181_GeneralUserGS_sf2_file"],gm_reverse_cymbal:["1190_JCLive_sf2_file","1190_Aspirin_sf2_file","1190_Chaos_sf2_file","1190_FluidR3_GM_sf2_file","1190_GeneralUserGS_sf2_file","1191_GeneralUserGS_sf2_file","1192_GeneralUserGS_sf2_file","1193_GeneralUserGS_sf2_file","1194_GeneralUserGS_sf2_file"],gm_guitar_fret_noise:["1200_JCLive_sf2_file","1200_Aspirin_sf2_file","1200_Chaos_sf2_file","1200_FluidR3_GM_sf2_file","1200_GeneralUserGS_sf2_file","1201_Aspirin_sf2_file","1201_GeneralUserGS_sf2_file","1202_GeneralUserGS_sf2_file"],gm_breath_noise:["1210_FluidR3_GM_sf2_file","1210_JCLive_sf2_file","1210_Aspirin_sf2_file","1210_Chaos_sf2_file","1210_GeneralUserGS_sf2_file","1211_Aspirin_sf2_file","1211_GeneralUserGS_sf2_file","1212_GeneralUserGS_sf2_file"],gm_seashore:["1220_JCLive_sf2_file","1220_Aspirin_sf2_file","1220_Chaos_sf2_file","1220_FluidR3_GM_sf2_file","1220_GeneralUserGS_sf2_file","1221_Aspirin_sf2_file","1221_GeneralUserGS_sf2_file","1221_JCLive_sf2_file","1222_Aspirin_sf2_file","1222_GeneralUserGS_sf2_file","1223_Aspirin_sf2_file","1223_GeneralUserGS_sf2_file","1224_Aspirin_sf2_file","1224_GeneralUserGS_sf2_file","1225_GeneralUserGS_sf2_file","1226_GeneralUserGS_sf2_file"],gm_bird_tweet:["1230_FluidR3_GM_sf2_file","1230_JCLive_sf2_file","1230_Aspirin_sf2_file","1230_GeneralUserGS_sf2_file","1231_GeneralUserGS_sf2_file","1232_GeneralUserGS_sf2_file","1234_GeneralUserGS_sf2_file"],gm_telephone:["1240_JCLive_sf2_file","1240_Aspirin_sf2_file","1240_Chaos_sf2_file","1240_FluidR3_GM_sf2_file","1241_Aspirin_sf2_file","1242_GeneralUserGS_sf2_file","1243_Aspirin_sf2_file","1243_GeneralUserGS_sf2_file","1244_Aspirin_sf2_file","1244_GeneralUserGS_sf2_file"],gm_helicopter:["1250_JCLive_sf2_file","1250_Aspirin_sf2_file","1250_FluidR3_GM_sf2_file","1250_GeneralUserGS_sf2_file","1251_FluidR3_GM_sf2_file","1251_GeneralUserGS_sf2_file","1252_Aspirin_sf2_file","1252_FluidR3_GM_sf2_file","1252_GeneralUserGS_sf2_file","1253_GeneralUserGS_sf2_file","1254_GeneralUserGS_sf2_file","1255_GeneralUserGS_sf2_file","1256_GeneralUserGS_sf2_file","1257_GeneralUserGS_sf2_file","1258_GeneralUserGS_sf2_file","1259_GeneralUserGS_sf2_file"],gm_applause:["1260_JCLive_sf2_file","1260_Aspirin_sf2_file","1260_Chaos_sf2_file","1260_FluidR3_GM_sf2_file","1260_GeneralUserGS_sf2_file","1261_Aspirin_sf2_file","1261_GeneralUserGS_sf2_file","1262_Aspirin_sf2_file","1262_GeneralUserGS_sf2_file","1263_Aspirin_sf2_file","1263_GeneralUserGS_sf2_file","1264_Aspirin_sf2_file","1264_GeneralUserGS_sf2_file","1265_Aspirin_sf2_file","1265_GeneralUserGS_sf2_file"],gm_gunshot:["1270_JCLive_sf2_file","1270_Aspirin_sf2_file","1270_Chaos_sf2_file","1270_FluidR3_GM_sf2_file","1270_GeneralUserGS_sf2_file","1271_Aspirin_sf2_file","1271_GeneralUserGS_sf2_file","1272_Aspirin_sf2_file","1272_GeneralUserGS_sf2_file","1273_GeneralUserGS_sf2_file","1274_GeneralUserGS_sf2_file",""]};let defaultSoundfontUrl="https://felixroos.github.io/webaudiofontdata/sound",soundfontUrl=defaultSoundfontUrl;function setSoundfontUrl(o){soundfontUrl=o}let loadCache$1={};async function loadFont(name){if(loadCache$1[name])return loadCache$1[name];const load=async()=>{const url=`${soundfontUrl}/${name}.js`,preset=await fetch(url).then(o=>o.text());let[_,data]=preset.split("={");return eval("{"+data)};return loadCache$1[name]=load(),loadCache$1[name]}async function getFontBufferSource(o,e,l){let{note:d="c3",freq:p}=e,b;if(p)b=freqToMidi$2(p);else if(typeof d=="string")b=noteToMidi$1(d);else if(typeof d=="number")b=d;else throw new Error(`unexpected "note" type "${typeof d}"`);const{buffer:R,zone:I}=await getFontPitch(o,b,l),z=l.createBufferSource();z.buffer=R;const se=I.originalPitch-100*I.coarseTune-I.fineTune,le=1*Math.pow(2,(100*b-se)/1200);return z.playbackRate.value=le,I.loopStart>1&&I.loopStart<I.loopEnd&&(z.loop=!0,z.loopStart=I.loopStart/I.sampleRate,z.loopEnd=I.loopEnd/I.sampleRate),z}let bufferCache={};async function getFontPitch(o,e,l){const d=`${o}:::${e}`;if(bufferCache[d])return bufferCache[d];const p=async()=>{const b=await loadFont(o);if(!b)throw new Error(`Could not load soundfont ${o}`);const R=findZone(b,e);if(!R)throw new Error("no soundfont zone found for preset ",o,"pitch",e);const I=await getBuffer(R,l);if(!I)throw new Error(`no soundfont buffer found for preset ${o}, pitch: ${e}`);return{buffer:I,zone:R}};return bufferCache[d]=p(),bufferCache[d]}function findZone(o,e){return o.find(l=>l.keyRangeLow<=e&&l.keyRangeHigh+1>=e)}async function getBuffer(o,e){if(o.sample){console.warn("zone.sample untested!");const d=atob(o.sample);o.buffer=e.createBuffer(1,d.length/2,o.sampleRate);const p=o.buffer.getChannelData(0);let b,R,I;for(var l=0;l<d.length/2;l++)b=d.charCodeAt(l*2),R=d.charCodeAt(l*2+1),b<0&&(b=256+b),R<0&&(R=256+R),I=R*256+b,I>=32768&&(I=I-65536),p[l]=I/65536}else if(o.file){const d=o.file.length,p=new ArrayBuffer(d),b=new Uint8Array(p),R=atob(o.file);let I;for(let z=0;z<R.length;z++)I=R.charCodeAt(z),b[z]=I;return new Promise(z=>e.decodeAudioData(p,z))}}function registerSoundfonts(){Object.entries(gm).forEach(([o,e])=>{registerSound(o,async(l,d,p)=>{const[b,R,I,z]=getADSRValues([d.attack,d.decay,d.sustain,d.release]),{duration:se}=d,le=getSoundIndex$1(d.n,e.length),tn=e[le],an=getAudioContext(),sn=await getFontBufferSource(tn,d,an);sn.start(l);const ln=an.createGain(),un=sn.connect(ln),pn=l+se;getParamADSR(un.gain,b,R,I,z,0,.3,l,pn,"linear");let yn=pn+z+.01;const _n=getVibratoOscillator(sn.detune,d,l);getPitchEnvelope(sn.detune,d,l,pn),sn.stop(yn);const Pn=vn=>{};return onceEnded(sn,()=>{releaseAudioNode(sn),_n?.stop(),p()}),{node:un,stop:Pn,nodes:{source:[sn],..._n?.nodes}}},{type:"soundfont",prebake:!0,fonts:e})})}const instruments=["0000_JCLive_sf2_file","0000_Aspirin_sf2_file","0000_Chaos_sf2_file","0000_FluidR3_GM_sf2_file","0000_GeneralUserGS_sf2_file","0001_FluidR3_GM_sf2_file","0001_GeneralUserGS_sf2_file","0010_Aspirin_sf2_file","0010_Chaos_sf2_file","0010_FluidR3_GM_sf2_file","0010_GeneralUserGS_sf2_file","0010_JCLive_sf2_file","0011_Aspirin_sf2_file","0011_FluidR3_GM_sf2_file","0011_GeneralUserGS_sf2_file","0012_GeneralUserGS_sf2_file","0020_Aspirin_sf2_file","0020_Chaos_sf2_file","0020_FluidR3_GM_sf2_file","0020_GeneralUserGS_sf2_file","0020_JCLive_sf2_file","0021_Aspirin_sf2_file","0021_GeneralUserGS_sf2_file","0022_Aspirin_sf2_file","0030_Aspirin_sf2_file","0030_Chaos_sf2_file","0030_FluidR3_GM_sf2_file","0030_GeneralUserGS_sf2_file","0030_JCLive_sf2_file","0031_Aspirin_sf2_file","0031_FluidR3_GM_sf2_file","0031_GeneralUserGS_sf2_file","0040_Aspirin_sf2_file","0040_Chaos_sf2_file","0040_FluidR3_GM_sf2_file","0040_GeneralUserGS_sf2_file","0040_JCLive_sf2_file","0041_FluidR3_GM_sf2_file","0041_GeneralUserGS_sf2_file","0042_GeneralUserGS_sf2_file","0043_GeneralUserGS_sf2_file","0044_GeneralUserGS_sf2_file","0046_GeneralUserGS_sf2_file","0050_Aspirin_sf2_file","0050_Chaos_sf2_file","0050_FluidR3_GM_sf2_file","0050_GeneralUserGS_sf2_file","0050_JCLive_sf2_file","0051_FluidR3_GM_sf2_file","0051_GeneralUserGS_sf2_file","0053_GeneralUserGS_sf2_file","0054_GeneralUserGS_sf2_file","0060_Aspirin_sf2_file","0060_Chaos_sf2_file","0060_FluidR3_GM_sf2_file","0060_GeneralUserGS_sf2_file","0060_JCLive_sf2_file","0061_Aspirin_sf2_file","0061_GeneralUserGS_sf2_file","0062_GeneralUserGS_sf2_file","0070_Aspirin_sf2_file","0070_Chaos_sf2_file","0070_FluidR3_GM_sf2_file","0070_JCLive_sf2_file","0080_Aspirin_sf2_file","0080_Chaos_sf2_file","0080_FluidR3_GM_sf2_file","0080_GeneralUserGS_sf2_file","0080_JCLive_sf2_file","0081_FluidR3_GM_sf2_file","0090_Aspirin_sf2_file","0090_Chaos_sf2_file","0090_FluidR3_GM_sf2_file","0090_GeneralUserGS_sf2_file","0090_JCLive_sf2_file","0100_Aspirin_sf2_file","0100_Chaos_sf2_file","0100_FluidR3_GM_sf2_file","0100_GeneralUserGS_sf2_file","0100_JCLive_sf2_file","0110_Aspirin_sf2_file","0110_Chaos_sf2_file","0110_FluidR3_GM_sf2_file","0110_GeneralUserGS_sf2_file","0110_JCLive_sf2_file","0111_FluidR3_GM_sf2_file","0120_Aspirin_sf2_file","0120_Chaos_sf2_file","0120_FluidR3_GM_sf2_file","0120_GeneralUserGS_sf2_file","0120_JCLive_sf2_file","0121_FluidR3_GM_sf2_file","0121_GeneralUserGS_sf2_file","0130_Aspirin_sf2_file","0130_Chaos_sf2_file","0130_FluidR3_GM_sf2_file","0130_GeneralUserGS_sf2_file","0130_JCLive_sf2_file","0131_FluidR3_GM_sf2_file","0140_Aspirin_sf2_file","0140_FluidR3_GM_sf2_file","0140_GeneralUserGS_sf2_file","0140_JCLive_sf2_file","0141_FluidR3_GM_sf2_file","0142_GeneralUserGS_sf2_file","0150_Aspirin_sf2_file","0150_Chaos_sf2_file","0150_FluidR3_GM_sf2_file","0150_GeneralUserGS_sf2_file","0151_FluidR3_GM_sf2_file","0160_Aspirin_sf2_file","0160_Chaos_sf2_file","0160_FluidR3_GM_sf2_file","0160_GeneralUserGS_sf2_file","0160_JCLive_sf2_file","0161_Aspirin_sf2_file","0161_FluidR3_GM_sf2_file","0170_Aspirin_sf2_file","0170_Chaos_sf2_file","0170_FluidR3_GM_sf2_file","0170_JCLive_sf2_file","0171_FluidR3_GM_sf2_file","0172_FluidR3_GM_sf2_file","0180_Aspirin_sf2_file","0180_Chaos_sf2_file","0180_FluidR3_GM_sf2_file","0180_GeneralUserGS_sf2_file","0180_JCLive_sf2_file","0190_Aspirin_sf2_file","0190_Chaos_sf2_file","0190_FluidR3_GM_sf2_file","0190_GeneralUserGS_sf2_file","0190_JCLive_sf2_file","0200_Aspirin_sf2_file","0200_Chaos_sf2_file","0200_FluidR3_GM_sf2_file","0200_GeneralUserGS_sf2_file","0200_JCLive_sf2_file","0201_Aspirin_sf2_file","0201_FluidR3_GM_sf2_file","0201_GeneralUserGS_sf2_file","0210_FluidR3_GM_sf2_file","0210_GeneralUserGS_sf2_file","0210_JCLive_sf2_file","0211_Aspirin_sf2_file","0211_FluidR3_GM_sf2_file","0211_GeneralUserGS_sf2_file","0212_GeneralUserGS_sf2_file","0220_Aspirin_sf2_file","0220_Chaos_sf2_file","0220_FluidR3_GM_sf2_file","0220_GeneralUserGS_sf2_file","0220_JCLive_sf2_file","0221_FluidR3_GM_sf2_file","0230_Aspirin_sf2_file","0230_Chaos_sf2_file","0230_FluidR3_GM_sf2_file","0230_GeneralUserGS_sf2_file","0230_JCLive_sf2_file","0231_FluidR3_GM_sf2_file","0231_GeneralUserGS_sf2_file","0231_JCLive_sf2_file","0232_FluidR3_GM_sf2_file","0233_FluidR3_GM_sf2_file","0240_Aspirin_sf2_file","0240_Chaos_sf2_file","0240_FluidR3_GM_sf2_file","0240_GeneralUserGS_sf2_file","0240_JCLive_sf2_file","0240_LK_Godin_Nylon_SF2_file","0241_JCLive_sf2_file","0242_JCLive_sf2_file","0243_JCLive_sf2_file","0253_Acoustic_Guitar_sf2_file","0250_Aspirin_sf2_file","0250_Chaos_sf2_file","0250_FluidR3_GM_sf2_file","0250_GeneralUserGS_sf2_file","0250_LK_AcousticSteel_SF2_file","0253_Acoustic_Guitar_sf2_file","0253_GeneralUserGS_sf2_file","0254_Acoustic_Guitar_sf2_file","0254_GeneralUserGS_sf2_file","0260_Aspirin_sf2_file","0260_Chaos_sf2_file","0260_FluidR3_GM_sf2_file","0260_GeneralUserGS_sf2_file","0260_JCLive_sf2_file","0260_Stratocaster_sf2_file","0261_GeneralUserGS_sf2_file","0261_Stratocaster_sf2_file","0262_Stratocaster_sf2_file","0270_Aspirin_sf2_file","0270_Chaos_sf2_file","0270_FluidR3_GM_sf2_file","0270_GeneralUserGS_sf2_file","0270_SBAWE32_sf2_file","0270_Stratocaster_sf2_file","0271_GeneralUserGS_sf2_file","0271_Stratocaster_sf2_file","0272_Stratocaster_sf2_file","0280_Aspirin_sf2_file","0280_Chaos_sf2_file","0280_GeneralUserGS_sf2_file","0280_JCLive_sf2_file","0280_LesPaul_sf2_file","0280_SBAWE32_sf2_file","0281_Aspirin_sf2_file","0281_FluidR3_GM_sf2_file","0281_GeneralUserGS_sf2_file","0282_FluidR3_GM_sf2_file","0290_Aspirin_sf2_file","0290_Chaos_sf2_file","0290_FluidR3_GM_sf2_file","0290_GeneralUserGS_sf2_file","0290_LesPaul_sf2_file","0290_SBAWE32_sf2_file","0291_LesPaul_sf2_file","0291_SBAWE32_sf2_file","0292_Aspirin_sf2_file","0292_LesPaul_sf2_file","0300_Aspirin_sf2_file","0300_Chaos_sf2_file","0300_FluidR3_GM_sf2_file","0300_GeneralUserGS_sf2_file","0300_LesPaul_sf2_file","0302_Aspirin_sf2_file","0304_Aspirin_sf2_file","0310_Aspirin_sf2_file","0310_Chaos_sf2_file","0310_FluidR3_GM_sf2_file","0320_Aspirin_sf2_file","0320_Chaos_sf2_file","0320_FluidR3_GM_sf2_file","0320_JCLive_sf2_file","0330_Aspirin_sf2_file","0330_FluidR3_GM_sf2_file","0330_GeneralUserGS_sf2_file","0330_JCLive_sf2_file","0340_Aspirin_sf2_file","0340_FluidR3_GM_sf2_file","0340_GeneralUserGS_sf2_file","0340_JCLive_sf2_file","0341_Aspirin_sf2_file","0350_Aspirin_sf2_file","0350_JCLive_sf2_file","0360_Aspirin_sf2_file","0360_Chaos_sf2_file","0360_FluidR3_GM_sf2_file","0360_JCLive_sf2_file","0370_Aspirin_sf2_file","0370_FluidR3_GM_sf2_file","0370_GeneralUserGS_sf2_file","0370_JCLive_sf2_file","0380_Aspirin_sf2_file","0380_Chaos_sf2_file","0380_FluidR3_GM_sf2_file","0380_JCLive_sf2_file","0381_FluidR3_GM_sf2_file","0381_GeneralUserGS_sf2_file","0382_GeneralUserGS_sf2_file","0383_GeneralUserGS_sf2_file","0384_GeneralUserGS_sf2_file","0387_GeneralUserGS_sf2_file","0390_Aspirin_sf2_file","0390_FluidR3_GM_sf2_file","0390_GeneralUserGS_sf2_file","0390_JCLive_sf2_file","0391_FluidR3_GM_sf2_file","0392_FluidR3_GM_sf2_file","0393_GeneralUserGS_sf2_file","0400_Aspirin_sf2_file","0400_Chaos_sf2_file","0400_FluidR3_GM_sf2_file","0400_GeneralUserGS_sf2_file","0400_JCLive_sf2_file","0401_Aspirin_sf2_file","0401_FluidR3_GM_sf2_file","0401_GeneralUserGS_sf2_file","0402_GeneralUserGS_sf2_file","0410_Aspirin_sf2_file","0410_FluidR3_GM_sf2_file","0410_GeneralUserGS_sf2_file","0410_JCLive_sf2_file","0411_FluidR3_GM_sf2_file","0420_Aspirin_sf2_file","0420_FluidR3_GM_sf2_file","0420_GeneralUserGS_sf2_file","0420_JCLive_sf2_file","0421_FluidR3_GM_sf2_file","0421_GeneralUserGS_sf2_file","0430_Aspirin_sf2_file","0430_Chaos_sf2_file","0430_GeneralUserGS_sf2_file","0440_Aspirin_sf2_file","0440_Chaos_sf2_file","0440_GeneralUserGS_sf2_file","0440_JCLive_sf2_file","0441_GeneralUserGS_sf2_file","0442_GeneralUserGS_sf2_file","0450_Aspirin_sf2_file","0450_Chaos_sf2_file","0450_FluidR3_GM_sf2_file","0450_GeneralUserGS_sf2_file","0450_JCLive_sf2_file","0451_FluidR3_GM_sf2_file","0460_Aspirin_sf2_file","0460_FluidR3_GM_sf2_file","0460_GeneralUserGS_sf2_file","0460_JCLive_sf2_file","0461_FluidR3_GM_sf2_file","0470_Aspirin_sf2_file","0470_Chaos_sf2_file","0470_FluidR3_GM_sf2_file","0470_GeneralUserGS_sf2_file","0471_FluidR3_GM_sf2_file","0471_GeneralUserGS_sf2_file","0480_Aspirin_sf2_file","0480_Chaos_sf2_file","0480_FluidR3_GM_sf2_file","0480_GeneralUserGS_sf2_file","0480_JCLive_sf2_file","0481_Aspirin_sf2_file","0481_FluidR3_GM_sf2_file","0481_GeneralUserGS_sf2_file","0482_Aspirin_sf2_file","0482_GeneralUserGS_sf2_file","0483_GeneralUserGS_sf2_file","0490_Aspirin_sf2_file","0490_Chaos_sf2_file","0490_FluidR3_GM_sf2_file","0490_GeneralUserGS_sf2_file","0490_JCLive_sf2_file","0491_GeneralUserGS_sf2_file","0492_GeneralUserGS_sf2_file","0500_Aspirin_sf2_file","0500_GeneralUserGS_sf2_file","0500_JCLive_sf2_file","0501_FluidR3_GM_sf2_file","0502_GeneralUserGS_sf2_file","0503_FluidR3_GM_sf2_file","0505_FluidR3_GM_sf2_file","0510_Aspirin_sf2_file","0510_Chaos_sf2_file","0510_GeneralUserGS_sf2_file","0511_GeneralUserGS_sf2_file","0520_Aspirin_sf2_file","0520_Chaos_sf2_file","0520_FluidR3_GM_sf2_file","0520_GeneralUserGS_sf2_file","0520_JCLive_sf2_file","0520_Soul_Ahhs_sf2_file","0521_FluidR3_GM_sf2_file","0521_Soul_Ahhs_sf2_file","0522_Soul_Ahhs_sf2_file","0530_Aspirin_sf2_file","0530_Chaos_sf2_file","0530_FluidR3_GM_sf2_file","0530_GeneralUserGS_sf2_file","0531_FluidR3_GM_sf2_file","0531_JCLive_sf2_file","0540_Aspirin_sf2_file","0540_Chaos_sf2_file","0540_FluidR3_GM_sf2_file","0540_GeneralUserGS_sf2_file","0541_FluidR3_GM_sf2_file","0550_Aspirin_sf2_file","0550_Chaos_sf2_file","0550_FluidR3_GM_sf2_file","0550_GeneralUserGS_sf2_file","0551_FluidR3_GM_sf2_file","0560_Aspirin_sf2_file","0560_Chaos_sf2_file","0560_FluidR3_GM_sf2_file","0560_JCLive_sf2_file","0570_Aspirin_sf2_file","0570_Chaos_sf2_file","0570_FluidR3_GM_sf2_file","0570_GeneralUserGS_sf2_file","0571_GeneralUserGS_sf2_file","0580_Aspirin_sf2_file","0580_Chaos_sf2_file","0580_FluidR3_GM_sf2_file","0580_GeneralUserGS_sf2_file","0590_Aspirin_sf2_file","0590_Chaos_sf2_file","0590_FluidR3_GM_sf2_file","0590_GeneralUserGS_sf2_file","0590_JCLive_sf2_file","0600_Aspirin_sf2_file","0600_FluidR3_GM_sf2_file","0600_GeneralUserGS_sf2_file","0600_JCLive_sf2_file","0601_FluidR3_GM_sf2_file","0610_Aspirin_sf2_file","0610_Chaos_sf2_file","0610_FluidR3_GM_sf2_file","0610_GeneralUserGS_sf2_file","0610_JCLive_sf2_file","0620_Aspirin_sf2_file","0620_FluidR3_GM_sf2_file","0621_Aspirin_sf2_file","0621_FluidR3_GM_sf2_file","0630_Aspirin_sf2_file","0630_Chaos_sf2_file","0630_FluidR3_GM_sf2_file","0630_JCLive_sf2_file","0631_FluidR3_GM_sf2_file","0632_FluidR3_GM_sf2_file","0633_FluidR3_GM_sf2_file","0640_Aspirin_sf2_file","0640_Chaos_sf2_file","0640_FluidR3_GM_sf2_file","0640_JCLive_sf2_file","0641_FluidR3_GM_sf2_file","0650_Chaos_sf2_file","0650_FluidR3_GM_sf2_file","0650_GeneralUserGS_sf2_file","0650_JCLive_sf2_file","0651_Aspirin_sf2_file","0651_FluidR3_GM_sf2_file","0660_Aspirin_sf2_file","0660_Chaos_sf2_file","0660_GeneralUserGS_sf2_file","0660_JCLive_sf2_file","0670_Aspirin_sf2_file","0670_Chaos_sf2_file","0670_FluidR3_GM_sf2_file","0670_GeneralUserGS_sf2_file","0670_JCLive_sf2_file","0671_FluidR3_GM_sf2_file","0680_Chaos_sf2_file","0680_FluidR3_GM_sf2_file","0680_GeneralUserGS_sf2_file","0680_JCLive_sf2_file","0681_FluidR3_GM_sf2_file","0690_Aspirin_sf2_file","0690_FluidR3_GM_sf2_file","0690_JCLive_sf2_file","0691_FluidR3_GM_sf2_file","0700_FluidR3_GM_sf2_file","0700_GeneralUserGS_sf2_file","0700_JCLive_sf2_file","0701_FluidR3_GM_sf2_file","0710_Aspirin_sf2_file","0710_Chaos_sf2_file","0710_FluidR3_GM_sf2_file","0710_GeneralUserGS_sf2_file","0710_JCLive_sf2_file","0711_FluidR3_GM_sf2_file","0720_Aspirin_sf2_file","0720_FluidR3_GM_sf2_file","0720_GeneralUserGS_sf2_file","0720_JCLive_sf2_file","0721_FluidR3_GM_sf2_file","0730_Aspirin_sf2_file","0730_FluidR3_GM_sf2_file","0730_GeneralUserGS_sf2_file","0730_JCLive_sf2_file","0731_FluidR3_GM_sf2_file","0740_Aspirin_sf2_file","0740_Chaos_sf2_file","0740_FluidR3_GM_sf2_file","0740_GeneralUserGS_sf2_file","0740_JCLive_sf2_file","0750_Aspirin_sf2_file","0750_Chaos_sf2_file","0750_FluidR3_GM_sf2_file","0750_GeneralUserGS_sf2_file","0750_JCLive_sf2_file","0751_Aspirin_sf2_file","0751_FluidR3_GM_sf2_file","0751_GeneralUserGS_sf2_file","0760_Chaos_sf2_file","0760_FluidR3_GM_sf2_file","0760_GeneralUserGS_sf2_file","0760_JCLive_sf2_file","0761_FluidR3_GM_sf2_file","0770_Aspirin_sf2_file","0770_FluidR3_GM_sf2_file","0770_GeneralUserGS_sf2_file","0770_JCLive_sf2_file","0771_FluidR3_GM_sf2_file","0780_Aspirin_sf2_file","0780_Chaos_sf2_file","0780_FluidR3_GM_sf2_file","0780_JCLive_sf2_file","0790_Aspirin_sf2_file","0790_FluidR3_GM_sf2_file","0790_GeneralUserGS_sf2_file","0790_JCLive_sf2_file","0800_Aspirin_sf2_file","0800_Chaos_sf2_file","0800_FluidR3_GM_sf2_file","0810_Aspirin_sf2_file","0810_Chaos_sf2_file","0810_FluidR3_GM_sf2_file","0810_GeneralUserGS_sf2_file","0810_JCLive_sf2_file","0811_Aspirin_sf2_file","0811_GeneralUserGS_sf2_file","0820_Aspirin_sf2_file","0820_Chaos_sf2_file","0820_FluidR3_GM_sf2_file","0820_GeneralUserGS_sf2_file","0820_JCLive_sf2_file","0821_FluidR3_GM_sf2_file","0821_GeneralUserGS_sf2_file","0830_Aspirin_sf2_file","0830_FluidR3_GM_sf2_file","0830_GeneralUserGS_sf2_file","0830_JCLive_sf2_file","0831_FluidR3_GM_sf2_file","0831_GeneralUserGS_sf2_file","0840_Aspirin_sf2_file","0840_Chaos_sf2_file","0840_FluidR3_GM_sf2_file","0840_GeneralUserGS_sf2_file","0840_JCLive_sf2_file","0841_Aspirin_sf2_file","0841_Chaos_sf2_file","0841_FluidR3_GM_sf2_file","0841_GeneralUserGS_sf2_file","0842_FluidR3_GM_sf2_file","0850_Aspirin_sf2_file","0850_FluidR3_GM_sf2_file","0850_JCLive_sf2_file","0851_FluidR3_GM_sf2_file","0851_GeneralUserGS_sf2_file","0851_JCLive_sf2_file","0860_Aspirin_sf2_file","0860_Chaos_sf2_file","0860_GeneralUserGS_sf2_file","0860_JCLive_sf2_file","0861_Aspirin_sf2_file","0870_Aspirin_sf2_file","0870_Chaos_sf2_file","0870_FluidR3_GM_sf2_file","0870_GeneralUserGS_sf2_file","0870_JCLive_sf2_file","0880_Aspirin_sf2_file","0880_Chaos_sf2_file","0880_FluidR3_GM_sf2_file","0880_GeneralUserGS_sf2_file","0880_JCLive_sf2_file","0881_Aspirin_sf2_file","0881_FluidR3_GM_sf2_file","0881_GeneralUserGS_sf2_file","0882_Aspirin_sf2_file","0882_GeneralUserGS_sf2_file","0885_GeneralUserGS_sf2_file","0887_GeneralUserGS_sf2_file","0890_Aspirin_sf2_file","0890_Chaos_sf2_file","0890_FluidR3_GM_sf2_file","0890_GeneralUserGS_sf2_file","0890_JCLive_sf2_file","0891_Aspirin_sf2_file","0891_FluidR3_GM_sf2_file","0900_Chaos_sf2_file","0900_FluidR3_GM_sf2_file","0900_GeneralUserGS_sf2_file","0900_JCLive_sf2_file","0901_Aspirin_sf2_file","0901_FluidR3_GM_sf2_file","0901_GeneralUserGS_sf2_file","0910_Aspirin_sf2_file","0910_FluidR3_GM_sf2_file","0910_GeneralUserGS_sf2_file","0910_JCLive_sf2_file","0911_GeneralUserGS_sf2_file","0911_JCLive_sf2_file","0920_Aspirin_sf2_file","0920_GeneralUserGS_sf2_file","0920_JCLive_sf2_file","0921_Aspirin_sf2_file","0921_GeneralUserGS_sf2_file","0930_Aspirin_sf2_file","0930_Chaos_sf2_file","0930_FluidR3_GM_sf2_file","0930_GeneralUserGS_sf2_file","0931_Aspirin_sf2_file","0931_FluidR3_GM_sf2_file","0931_GeneralUserGS_sf2_file","0940_Chaos_sf2_file","0940_FluidR3_GM_sf2_file","0940_GeneralUserGS_sf2_file","0940_JCLive_sf2_file","0941_Aspirin_sf2_file","0941_FluidR3_GM_sf2_file","0941_GeneralUserGS_sf2_file","0941_JCLive_sf2_file","0950_Aspirin_sf2_file","0950_Chaos_sf2_file","0950_FluidR3_GM_sf2_file","0950_GeneralUserGS_sf2_file","0950_JCLive_sf2_file","0951_FluidR3_GM_sf2_file","0951_GeneralUserGS_sf2_file","0960_Chaos_sf2_file","0960_FluidR3_GM_sf2_file","0960_GeneralUserGS_sf2_file","0961_Aspirin_sf2_file","0961_FluidR3_GM_sf2_file","0962_GeneralUserGS_sf2_file","0970_Aspirin_sf2_file","0970_FluidR3_GM_sf2_file","0970_GeneralUserGS_sf2_file","0971_FluidR3_GM_sf2_file","0971_GeneralUserGS_sf2_file","0980_Aspirin_sf2_file","0980_Chaos_sf2_file","0980_GeneralUserGS_sf2_file","0980_JCLive_sf2_file","0981_Aspirin_sf2_file","0981_FluidR3_GM_sf2_file","0981_GeneralUserGS_sf2_file","0982_GeneralUserGS_sf2_file","0983_GeneralUserGS_sf2_file","0984_GeneralUserGS_sf2_file","0990_Aspirin_sf2_file","0990_Chaos_sf2_file","0990_FluidR3_GM_sf2_file","0990_GeneralUserGS_sf2_file","0990_JCLive_sf2_file","0991_Aspirin_sf2_file","0991_FluidR3_GM_sf2_file","0991_GeneralUserGS_sf2_file","0991_JCLive_sf2_file","0992_FluidR3_GM_sf2_file","0992_JCLive_sf2_file","0993_JCLive_sf2_file","0994_JCLive_sf2_file","1000_Aspirin_sf2_file","1000_Chaos_sf2_file","1000_FluidR3_GM_sf2_file","1000_GeneralUserGS_sf2_file","1000_JCLive_sf2_file","1001_Aspirin_sf2_file","1001_FluidR3_GM_sf2_file","1001_GeneralUserGS_sf2_file","1001_JCLive_sf2_file","1002_Aspirin_sf2_file","1002_FluidR3_GM_sf2_file","1002_GeneralUserGS_sf2_file","1010_Aspirin_sf2_file","1010_Chaos_sf2_file","1010_FluidR3_GM_sf2_file","1010_GeneralUserGS_sf2_file","1010_JCLive_sf2_file","1011_Aspirin_sf2_file","1011_FluidR3_GM_sf2_file","1011_JCLive_sf2_file","1012_Aspirin_sf2_file","1020_Aspirin_sf2_file","1020_Chaos_sf2_file","1020_FluidR3_GM_sf2_file","1020_GeneralUserGS_sf2_file","1020_JCLive_sf2_file","1021_Aspirin_sf2_file","1021_FluidR3_GM_sf2_file","1021_GeneralUserGS_sf2_file","1021_JCLive_sf2_file","1022_GeneralUserGS_sf2_file","1030_Aspirin_sf2_file","1030_Chaos_sf2_file","1030_FluidR3_GM_sf2_file","1030_GeneralUserGS_sf2_file","1030_JCLive_sf2_file","1031_Aspirin_sf2_file","1031_FluidR3_GM_sf2_file","1031_GeneralUserGS_sf2_file","1032_FluidR3_GM_sf2_file","1040_Aspirin_sf2_file","1040_Chaos_sf2_file","1040_FluidR3_GM_sf2_file","1040_GeneralUserGS_sf2_file","1040_JCLive_sf2_file","1041_FluidR3_GM_sf2_file","1041_GeneralUserGS_sf2_file","1050_Aspirin_sf2_file","1050_Chaos_sf2_file","1050_FluidR3_GM_sf2_file","1050_GeneralUserGS_sf2_file","1050_JCLive_sf2_file","1051_GeneralUserGS_sf2_file","1060_Aspirin_sf2_file","1060_Chaos_sf2_file","1060_FluidR3_GM_sf2_file","1060_GeneralUserGS_sf2_file","1060_JCLive_sf2_file","1061_FluidR3_GM_sf2_file","1061_GeneralUserGS_sf2_file","1070_Aspirin_sf2_file","1070_Chaos_sf2_file","1070_FluidR3_GM_sf2_file","1070_GeneralUserGS_sf2_file","1070_JCLive_sf2_file","1071_FluidR3_GM_sf2_file","1071_GeneralUserGS_sf2_file","1072_GeneralUserGS_sf2_file","1073_GeneralUserGS_sf2_file","1080_Aspirin_sf2_file","1080_Chaos_sf2_file","1080_FluidR3_GM_sf2_file","1080_GeneralUserGS_sf2_file","1080_JCLive_sf2_file","1090_Aspirin_sf2_file","1090_Chaos_sf2_file","1090_FluidR3_GM_sf2_file","1090_GeneralUserGS_sf2_file","1090_JCLive_sf2_file","1100_Aspirin_sf2_file","1100_Chaos_sf2_file","1100_FluidR3_GM_sf2_file","1100_GeneralUserGS_sf2_file","1100_JCLive_sf2_file","1101_Aspirin_sf2_file","1101_FluidR3_GM_sf2_file","1101_GeneralUserGS_sf2_file","1102_GeneralUserGS_sf2_file","1110_Aspirin_sf2_file","1110_Chaos_sf2_file","1110_FluidR3_GM_sf2_file","1110_GeneralUserGS_sf2_file","1110_JCLive_sf2_file","1120_Aspirin_sf2_file","1120_Chaos_sf2_file","1120_FluidR3_GM_sf2_file","1120_GeneralUserGS_sf2_file","1120_JCLive_sf2_file","1130_Aspirin_sf2_file","1130_Chaos_sf2_file","1130_FluidR3_GM_sf2_file","1130_GeneralUserGS_sf2_file","1130_JCLive_sf2_file","1131_FluidR3_GM_sf2_file","1140_Aspirin_sf2_file","1140_Chaos_sf2_file","1140_FluidR3_GM_sf2_file","1140_GeneralUserGS_sf2_file","1140_JCLive_sf2_file","1141_FluidR3_GM_sf2_file","1150_Aspirin_sf2_file","1150_Chaos_sf2_file","1150_FluidR3_GM_sf2_file","1150_GeneralUserGS_sf2_file","1150_JCLive_sf2_file","1151_FluidR3_GM_sf2_file","1151_GeneralUserGS_sf2_file","1152_FluidR3_GM_sf2_file","1152_GeneralUserGS_sf2_file","1160_Aspirin_sf2_file","1160_Chaos_sf2_file","1160_FluidR3_GM_sf2_file","1160_GeneralUserGS_sf2_file","1160_JCLive_sf2_file","1161_FluidR3_GM_sf2_file","1161_GeneralUserGS_sf2_file","1162_FluidR3_GM_sf2_file","1162_GeneralUserGS_sf2_file","1163_FluidR3_GM_sf2_file","1170_Aspirin_sf2_file","1170_Chaos_sf2_file","1170_FluidR3_GM_sf2_file","1170_GeneralUserGS_sf2_file","1170_JCLive_sf2_file","1171_FluidR3_GM_sf2_file","1171_GeneralUserGS_sf2_file","1172_FluidR3_GM_sf2_file","1173_FluidR3_GM_sf2_file","1180_Aspirin_sf2_file","1180_Chaos_sf2_file","1180_FluidR3_GM_sf2_file","1180_GeneralUserGS_sf2_file","1180_JCLive_sf2_file","1181_FluidR3_GM_sf2_file","1181_GeneralUserGS_sf2_file","1190_Aspirin_sf2_file","1190_Chaos_sf2_file","1190_FluidR3_GM_sf2_file","1190_GeneralUserGS_sf2_file","1190_JCLive_sf2_file","1191_GeneralUserGS_sf2_file","1192_GeneralUserGS_sf2_file","1193_GeneralUserGS_sf2_file","1194_GeneralUserGS_sf2_file","1200_Aspirin_sf2_file","1200_Chaos_sf2_file","1200_FluidR3_GM_sf2_file","1200_GeneralUserGS_sf2_file","1200_JCLive_sf2_file","1201_Aspirin_sf2_file","1201_GeneralUserGS_sf2_file","1202_GeneralUserGS_sf2_file","1210_Aspirin_sf2_file","1210_Chaos_sf2_file","1210_FluidR3_GM_sf2_file","1210_GeneralUserGS_sf2_file","1210_JCLive_sf2_file","1211_Aspirin_sf2_file","1211_GeneralUserGS_sf2_file","1212_GeneralUserGS_sf2_file","1220_Aspirin_sf2_file","1220_Chaos_sf2_file","1220_FluidR3_GM_sf2_file","1220_GeneralUserGS_sf2_file","1220_JCLive_sf2_file","1221_Aspirin_sf2_file","1221_GeneralUserGS_sf2_file","1221_JCLive_sf2_file","1222_Aspirin_sf2_file","1222_GeneralUserGS_sf2_file","1223_Aspirin_sf2_file","1223_GeneralUserGS_sf2_file","1224_Aspirin_sf2_file","1224_GeneralUserGS_sf2_file","1225_GeneralUserGS_sf2_file","1226_GeneralUserGS_sf2_file","1230_Aspirin_sf2_file","1230_Chaos_sf2_file","1230_FluidR3_GM_sf2_file","1230_GeneralUserGS_sf2_file","1230_JCLive_sf2_file","1231_Aspirin_sf2_file","1231_GeneralUserGS_sf2_file","1232_Aspirin_sf2_file","1232_GeneralUserGS_sf2_file","1233_GeneralUserGS_sf2_file","1234_GeneralUserGS_sf2_file","1240_Aspirin_sf2_file","1240_Chaos_sf2_file","1240_FluidR3_GM_sf2_file","1240_GeneralUserGS_sf2_file","1240_JCLive_sf2_file","1241_Aspirin_sf2_file","1241_GeneralUserGS_sf2_file","1242_Aspirin_sf2_file","1242_GeneralUserGS_sf2_file","1243_Aspirin_sf2_file","1243_GeneralUserGS_sf2_file","1244_Aspirin_sf2_file","1244_GeneralUserGS_sf2_file","1250_Aspirin_sf2_file","1250_Chaos_sf2_file","1250_FluidR3_GM_sf2_file","1250_GeneralUserGS_sf2_file","1250_JCLive_sf2_file","1251_Aspirin_sf2_file","1251_FluidR3_GM_sf2_file","1251_GeneralUserGS_sf2_file","1252_Aspirin_sf2_file","1252_FluidR3_GM_sf2_file","1252_GeneralUserGS_sf2_file","1253_Aspirin_sf2_file","1253_GeneralUserGS_sf2_file","1254_Aspirin_sf2_file","1254_GeneralUserGS_sf2_file","1255_Aspirin_sf2_file","1255_GeneralUserGS_sf2_file","1256_Aspirin_sf2_file","1256_GeneralUserGS_sf2_file","1257_Aspirin_sf2_file","1257_GeneralUserGS_sf2_file","1258_Aspirin_sf2_file","1258_GeneralUserGS_sf2_file","1259_GeneralUserGS_sf2_file","1260_Aspirin_sf2_file","1260_Chaos_sf2_file","1260_FluidR3_GM_sf2_file","1260_GeneralUserGS_sf2_file","1260_JCLive_sf2_file","1261_Aspirin_sf2_file","1261_GeneralUserGS_sf2_file","1262_Aspirin_sf2_file","1262_GeneralUserGS_sf2_file","1263_Aspirin_sf2_file","1263_GeneralUserGS_sf2_file","1264_Aspirin_sf2_file","1264_GeneralUserGS_sf2_file","1265_Aspirin_sf2_file","1265_GeneralUserGS_sf2_file","1270_Aspirin_sf2_file","1270_Chaos_sf2_file","1270_FluidR3_GM_sf2_file","1270_GeneralUserGS_sf2_file","1270_JCLive_sf2_file","1271_Aspirin_sf2_file","1271_GeneralUserGS_sf2_file","1272_Aspirin_sf2_file","1272_GeneralUserGS_sf2_file","1273_GeneralUserGS_sf2_file","1274_GeneralUserGS_sf2_file"],drums=["35_0_Chaos_sf2_file","35_12_JCLive_sf2_file","35_16_JCLive_sf2_file","35_18_JCLive_sf2_file","35_4_Chaos_sf2_file","36_12_JCLive_sf2_file","36_16_JCLive_sf2_file","36_18_JCLive_sf2_file","36_4_Chaos_sf2_file","37_12_JCLive_sf2_file","37_16_JCLive_sf2_file","37_18_JCLive_sf2_file","37_4_Chaos_sf2_file","38_12_JCLive_sf2_file","38_16_JCLive_sf2_file","38_18_JCLive_sf2_file","38_4_Chaos_sf2_file","39_12_JCLive_sf2_file","39_16_JCLive_sf2_file","39_18_JCLive_sf2_file","39_4_Chaos_sf2_file","40_12_JCLive_sf2_file","40_16_JCLive_sf2_file","40_18_JCLive_sf2_file","40_4_Chaos_sf2_file","41_12_JCLive_sf2_file","41_16_JCLive_sf2_file","41_18_JCLive_sf2_file","41_4_Chaos_sf2_file","42_12_JCLive_sf2_file","42_16_JCLive_sf2_file","42_18_JCLive_sf2_file","42_4_Chaos_sf2_file","43_12_JCLive_sf2_file","43_16_JCLive_sf2_file","43_18_JCLive_sf2_file","43_4_Chaos_sf2_file","44_12_JCLive_sf2_file","44_16_JCLive_sf2_file","44_18_JCLive_sf2_file","44_4_Chaos_sf2_file","45_12_JCLive_sf2_file","45_16_JCLive_sf2_file","45_18_JCLive_sf2_file","45_4_Chaos_sf2_file","46_12_JCLive_sf2_file","46_16_JCLive_sf2_file","46_18_JCLive_sf2_file","46_4_Chaos_sf2_file","47_12_JCLive_sf2_file","47_16_JCLive_sf2_file","47_18_JCLive_sf2_file","47_4_Chaos_sf2_file","48_12_JCLive_sf2_file","48_16_JCLive_sf2_file","48_18_JCLive_sf2_file","48_4_Chaos_sf2_file","49_12_JCLive_sf2_file","49_16_JCLive_sf2_file","49_18_JCLive_sf2_file","49_4_Chaos_sf2_file","50_12_JCLive_sf2_file","50_16_JCLive_sf2_file","50_18_JCLive_sf2_file","50_4_Chaos_sf2_file","51_12_JCLive_sf2_file","51_16_JCLive_sf2_file","51_18_JCLive_sf2_file","51_4_Chaos_sf2_file","52_12_JCLive_sf2_file","52_16_JCLive_sf2_file","52_18_JCLive_sf2_file","52_4_Chaos_sf2_file","53_12_JCLive_sf2_file","53_16_JCLive_sf2_file","53_18_JCLive_sf2_file","53_4_Chaos_sf2_file","54_12_JCLive_sf2_file","54_16_JCLive_sf2_file","54_18_JCLive_sf2_file","54_4_Chaos_sf2_file","55_12_JCLive_sf2_file","55_16_JCLive_sf2_file","55_18_JCLive_sf2_file","55_4_Chaos_sf2_file","56_12_JCLive_sf2_file","56_16_JCLive_sf2_file","56_18_JCLive_sf2_file","56_4_Chaos_sf2_file","57_12_JCLive_sf2_file","57_16_JCLive_sf2_file","57_18_JCLive_sf2_file","57_4_Chaos_sf2_file","58_12_JCLive_sf2_file","58_16_JCLive_sf2_file","58_18_JCLive_sf2_file","58_4_Chaos_sf2_file","59_12_JCLive_sf2_file","59_16_JCLive_sf2_file","59_18_JCLive_sf2_file","59_4_Chaos_sf2_file","60_12_JCLive_sf2_file","60_16_JCLive_sf2_file","60_18_JCLive_sf2_file","60_4_Chaos_sf2_file","61_12_JCLive_sf2_file","61_16_JCLive_sf2_file","61_18_JCLive_sf2_file","61_4_Chaos_sf2_file","62_12_JCLive_sf2_file","62_16_JCLive_sf2_file","62_18_JCLive_sf2_file","62_4_Chaos_sf2_file","63_12_JCLive_sf2_file","63_16_JCLive_sf2_file","63_18_JCLive_sf2_file","63_4_Chaos_sf2_file","64_12_JCLive_sf2_file","64_16_JCLive_sf2_file","64_18_JCLive_sf2_file","64_4_Chaos_sf2_file","65_12_JCLive_sf2_file","65_16_JCLive_sf2_file","65_18_JCLive_sf2_file","65_4_Chaos_sf2_file","66_12_JCLive_sf2_file","66_16_JCLive_sf2_file","66_18_JCLive_sf2_file","66_4_Chaos_sf2_file","67_12_JCLive_sf2_file","67_16_JCLive_sf2_file","67_18_JCLive_sf2_file","67_4_Chaos_sf2_file","68_12_JCLive_sf2_file","68_16_JCLive_sf2_file","68_18_JCLive_sf2_file","68_4_Chaos_sf2_file","69_12_JCLive_sf2_file","69_16_JCLive_sf2_file","69_18_JCLive_sf2_file","69_4_Chaos_sf2_file","70_12_JCLive_sf2_file","70_16_JCLive_sf2_file","70_18_JCLive_sf2_file","70_4_Chaos_sf2_file","71_12_JCLive_sf2_file","71_16_JCLive_sf2_file","71_18_JCLive_sf2_file","71_4_Chaos_sf2_file","72_12_JCLive_sf2_file","72_16_JCLive_sf2_file","72_18_JCLive_sf2_file","72_4_Chaos_sf2_file","73_12_JCLive_sf2_file","73_16_JCLive_sf2_file","73_18_JCLive_sf2_file","73_4_Chaos_sf2_file","74_12_JCLive_sf2_file","74_16_JCLive_sf2_file","74_18_JCLive_sf2_file","74_4_Chaos_sf2_file","75_12_JCLive_sf2_file","75_16_JCLive_sf2_file","75_18_JCLive_sf2_file","75_4_Chaos_sf2_file","76_12_JCLive_sf2_file","76_16_JCLive_sf2_file","76_18_JCLive_sf2_file","76_4_Chaos_sf2_file","77_12_JCLive_sf2_file","77_16_JCLive_sf2_file","77_18_JCLive_sf2_file","77_4_Chaos_sf2_file","78_12_JCLive_sf2_file","78_16_JCLive_sf2_file","78_18_JCLive_sf2_file","78_4_Chaos_sf2_file","79_12_JCLive_sf2_file","79_16_JCLive_sf2_file","79_18_JCLive_sf2_file","79_4_Chaos_sf2_file","80_12_JCLive_sf2_file","80_16_JCLive_sf2_file","80_18_JCLive_sf2_file","80_4_Chaos_sf2_file","81_12_JCLive_sf2_file","81_16_JCLive_sf2_file","81_18_JCLive_sf2_file","81_4_Chaos_sf2_file"],instrumentNames=[];instrumentNames[0]="Acoustic Grand Piano: Piano",instrumentNames[1]="Bright Acoustic Piano: Piano",instrumentNames[2]="Electric Grand Piano: Piano",instrumentNames[3]="Honky-tonk Piano: Piano",instrumentNames[4]="Electric Piano 1: Piano",instrumentNames[5]="Electric Piano 2: Piano",instrumentNames[6]="Harpsichord: Piano",instrumentNames[7]="Clavinet: Piano",instrumentNames[8]="Celesta: Chromatic Percussion",instrumentNames[9]="Glockenspiel: Chromatic Percussion",instrumentNames[10]="Music Box: Chromatic Percussion",instrumentNames[11]="Vibraphone: Chromatic Percussion",instrumentNames[12]="Marimba: Chromatic Percussion",instrumentNames[13]="Xylophone: Chromatic Percussion",instrumentNames[14]="Tubular Bells: Chromatic Percussion",instrumentNames[15]="Dulcimer: Chromatic Percussion",instrumentNames[16]="Drawbar Organ: Organ",instrumentNames[17]="Percussive Organ: Organ",instrumentNames[18]="Rock Organ: Organ",instrumentNames[19]="Church Organ: Organ",instrumentNames[20]="Reed Organ: Organ",instrumentNames[21]="Accordion: Organ",instrumentNames[22]="Harmonica: Organ",instrumentNames[23]="Tango Accordion: Organ",instrumentNames[24]="Acoustic Guitar (nylon): Guitar",instrumentNames[25]="Acoustic Guitar (steel): Guitar",instrumentNames[26]="Electric Guitar (jazz): Guitar",instrumentNames[27]="Electric Guitar (clean): Guitar",instrumentNames[28]="Electric Guitar (muted): Guitar",instrumentNames[29]="Overdriven Guitar: Guitar",instrumentNames[30]="Distortion Guitar: Guitar",instrumentNames[31]="Guitar Harmonics: Guitar",instrumentNames[32]="Acoustic Bass: Bass",instrumentNames[33]="Electric Bass (finger): Bass",instrumentNames[34]="Electric Bass (pick): Bass",instrumentNames[35]="Fretless Bass: Bass",instrumentNames[36]="Slap Bass 1: Bass",instrumentNames[37]="Slap Bass 2: Bass",instrumentNames[38]="Synth Bass 1: Bass",instrumentNames[39]="Synth Bass 2: Bass",instrumentNames[40]="Violin: Strings",instrumentNames[41]="Viola: Strings",instrumentNames[42]="Cello: Strings",instrumentNames[43]="Contrabass: Strings",instrumentNames[44]="Tremolo Strings: Strings",instrumentNames[45]="Pizzicato Strings: Strings",instrumentNames[46]="Orchestral Harp: Strings",instrumentNames[47]="Timpani: Strings",instrumentNames[48]="String Ensemble 1: Ensemble",instrumentNames[49]="String Ensemble 2: Ensemble",instrumentNames[50]="Synth Strings 1: Ensemble",instrumentNames[51]="Synth Strings 2: Ensemble",instrumentNames[52]="Choir Aahs: Ensemble",instrumentNames[53]="Voice Oohs: Ensemble",instrumentNames[54]="Synth Choir: Ensemble",instrumentNames[55]="Orchestra Hit: Ensemble",instrumentNames[56]="Trumpet: Brass",instrumentNames[57]="Trombone: Brass",instrumentNames[58]="Tuba: Brass",instrumentNames[59]="Muted Trumpet: Brass",instrumentNames[60]="French Horn: Brass",instrumentNames[61]="Brass Section: Brass",instrumentNames[62]="Synth Brass 1: Brass",instrumentNames[63]="Synth Brass 2: Brass",instrumentNames[64]="Soprano Sax: Reed",instrumentNames[65]="Alto Sax: Reed",instrumentNames[66]="Tenor Sax: Reed",instrumentNames[67]="Baritone Sax: Reed",instrumentNames[68]="Oboe: Reed",instrumentNames[69]="English Horn: Reed",instrumentNames[70]="Bassoon: Reed",instrumentNames[71]="Clarinet: Reed",instrumentNames[72]="Piccolo: Pipe",instrumentNames[73]="Flute: Pipe",instrumentNames[74]="Recorder: Pipe",instrumentNames[75]="Pan Flute: Pipe",instrumentNames[76]="Blown bottle: Pipe",instrumentNames[77]="Shakuhachi: Pipe",instrumentNames[78]="Whistle: Pipe",instrumentNames[79]="Ocarina: Pipe",instrumentNames[80]="Lead 1 (square): Synth Lead",instrumentNames[81]="Lead 2 (sawtooth): Synth Lead",instrumentNames[82]="Lead 3 (calliope): Synth Lead",instrumentNames[83]="Lead 4 (chiff): Synth Lead",instrumentNames[84]="Lead 5 (charang): Synth Lead",instrumentNames[85]="Lead 6 (voice): Synth Lead",instrumentNames[86]="Lead 7 (fifths): Synth Lead",instrumentNames[87]="Lead 8 (bass + lead): Synth Lead",instrumentNames[88]="Pad 1 (new age): Synth Pad",instrumentNames[89]="Pad 2 (warm): Synth Pad",instrumentNames[90]="Pad 3 (polysynth): Synth Pad",instrumentNames[91]="Pad 4 (choir): Synth Pad",instrumentNames[92]="Pad 5 (bowed): Synth Pad",instrumentNames[93]="Pad 6 (metallic): Synth Pad",instrumentNames[94]="Pad 7 (halo): Synth Pad",instrumentNames[95]="Pad 8 (sweep): Synth Pad",instrumentNames[96]="FX 1 (rain): Synth Effects",instrumentNames[97]="FX 2 (soundtrack): Synth Effects",instrumentNames[98]="FX 3 (crystal): Synth Effects",instrumentNames[99]="FX 4 (atmosphere): Synth Effects",instrumentNames[100]="FX 5 (brightness): Synth Effects",instrumentNames[101]="FX 6 (goblins): Synth Effects",instrumentNames[102]="FX 7 (echoes): Synth Effects",instrumentNames[103]="FX 8 (sci-fi): Synth Effects",instrumentNames[104]="Sitar: Ethnic",instrumentNames[105]="Banjo: Ethnic",instrumentNames[106]="Shamisen: Ethnic",instrumentNames[107]="Koto: Ethnic",instrumentNames[108]="Kalimba: Ethnic",instrumentNames[109]="Bagpipe: Ethnic",instrumentNames[110]="Fiddle: Ethnic",instrumentNames[111]="Shanai: Ethnic",instrumentNames[112]="Tinkle Bell: Percussive",instrumentNames[113]="Agogo: Percussive",instrumentNames[114]="Steel Drums: Percussive",instrumentNames[115]="Woodblock: Percussive",instrumentNames[116]="Taiko Drum: Percussive",instrumentNames[117]="Melodic Tom: Percussive",instrumentNames[118]="Synth Drum: Percussive",instrumentNames[119]="Reverse Cymbal: Percussive",instrumentNames[120]="Guitar Fret Noise: Sound effects",instrumentNames[121]="Breath Noise: Sound effects",instrumentNames[122]="Seashore: Sound effects",instrumentNames[123]="Bird Tweet: Sound effects",instrumentNames[124]="Telephone Ring: Sound effects",instrumentNames[125]="Helicopter: Sound effects",instrumentNames[126]="Applause: Sound effects",instrumentNames[127]="Gunshot: Sound effects";const list=Object.freeze(Object.defineProperty({__proto__:null,drums,instrumentNames,instruments},Symbol.toStringTag,{value:"Module"}));var SoundFont2={exports:{}},hasRequiredSoundFont2;function requireSoundFont2(){return hasRequiredSoundFont2||(hasRequiredSoundFont2=1,function(o,e){(function(l,d){o.exports=d()})(window,function(){return function(l){var d={};function p(b){if(d[b])return d[b].exports;var R=d[b]={i:b,l:!1,exports:{}};return l[b].call(R.exports,R,R.exports,p),R.l=!0,R.exports}return p.m=l,p.c=d,p.d=function(b,R,I){p.o(b,R)||Object.defineProperty(b,R,{enumerable:!0,get:I})},p.r=function(b){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(b,"__esModule",{value:!0})},p.t=function(b,R){if(1&R&&(b=p(b)),8&R||4&R&&typeof b=="object"&&b&&b.__esModule)return b;var I=Object.create(null);if(p.r(I),Object.defineProperty(I,"default",{enumerable:!0,value:b}),2&R&&typeof b!="string")for(var z in b)p.d(I,z,function(se){return b[se]}.bind(null,z));return I},p.n=function(b){var R=b&&b.__esModule?function(){return b.default}:function(){return b};return p.d(R,"a",R),R},p.o=function(b,R){return Object.prototype.hasOwnProperty.call(b,R)},p.p="",p(p.s="./src/index.ts")}({"./src/chunk.ts":function(l,d,p){p.r(d),p.d(d,"SF2Chunk",function(){return sn});var b=p("./src/riff/index.ts"),R=p("./src/constants.ts"),I=p("./src/chunks/index.ts");function z(ln){return(z=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(un){return typeof un}:function(un){return un&&typeof Symbol=="function"&&un.constructor===Symbol&&un!==Symbol.prototype?"symbol":typeof un})(ln)}function se(ln,un){for(var pn=0;pn<un.length;pn++){var yn=un[pn];yn.enumerable=yn.enumerable||!1,yn.configurable=!0,"value"in yn&&(yn.writable=!0),Object.defineProperty(ln,yn.key,yn)}}function le(ln){return(le=Object.setPrototypeOf?Object.getPrototypeOf:function(un){return un.__proto__||Object.getPrototypeOf(un)})(ln)}function tn(ln,un){return(tn=Object.setPrototypeOf||function(pn,yn){return pn.__proto__=yn,pn})(ln,un)}function an(ln){if(ln===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ln}var sn=function(ln){function un(_n){var Pn,vn,bn,Sn,An,Dn;return function(Bn,Nn){if(!(Bn instanceof Nn))throw new TypeError("Cannot call a class as a function")}(this,un),vn=this,Pn=!(bn=le(un).call(this,_n.id,_n.length,_n.buffer,_n.subChunks))||z(bn)!=="object"&&typeof bn!="function"?an(vn):bn,Sn=an(an(Pn)),Dn=void 0,(An="subChunks")in Sn?Object.defineProperty(Sn,An,{value:Dn,enumerable:!0,configurable:!0,writable:!0}):Sn[An]=Dn,Pn.subChunks=_n.subChunks.map(function(Bn){return new un(Bn)}),Pn}var pn,yn;return function(_n,Pn){if(typeof Pn!="function"&&Pn!==null)throw new TypeError("Super expression must either be null or a function");_n.prototype=Object.create(Pn&&Pn.prototype,{constructor:{value:_n,writable:!0,configurable:!0}}),Pn&&tn(_n,Pn)}(un,b.RIFFChunk),pn=un,(yn=[{key:"getMetaData",value:function(){if(this.id!=="LIST")throw new b.ParseError("Unexpected chunk ID","'LIST'","'".concat(this.id,"'"));var _n=this.subChunks.reduce(function(Pn,vn){if(vn.id==="ifil"||vn.id==="iver"){if(vn.length!==R.SF_VERSION_LENGTH)throw new b.ParseError("Invalid size for the '".concat(vn.id,"' sub-chunk"));Pn[vn.id]="".concat(vn.getInt16(),".").concat(vn.getInt16(2))}else Pn[vn.id]=vn.getString();return Pn},{});if(!_n.ifil)throw new b.ParseError("Missing required 'ifil' sub-chunk");if(!_n.INAM)throw new b.ParseError("Missing required 'INAM' sub-chunk");return{version:_n.ifil,soundEngine:_n.isng||"EMU8000",name:_n.INAM,rom:_n.irom,romVersion:_n.iver,creationDate:_n.ICRD,author:_n.IENG,product:_n.IPRD,copyright:_n.ICOP,comments:_n.ICMT,createdBy:_n.ISFT}}},{key:"getSampleData",value:function(){if(this.id!=="LIST")throw new b.ParseError("Unexpected chunk ID","'LIST'","'".concat(this.id,"'"));var _n=this.subChunks[0];if(_n.id!=="smpl")throw new b.ParseError("Invalid chunk signature","'smpl'","'".concat(_n.id,"'"));return _n.buffer}},{key:"getPresetData",value:function(){if(this.id!=="LIST")throw new b.ParseError("Unexpected chunk ID","'LIST'","'".concat(this.id,"'"));return{presetHeaders:Object(I.getPresetHeaders)(this.subChunks[0]),presetZones:Object(I.getZones)(this.subChunks[1],"pbag"),presetModulators:Object(I.getModulators)(this.subChunks[2],"pmod"),presetGenerators:Object(I.getGenerators)(this.subChunks[3],"pgen"),instrumentHeaders:Object(I.getInstrumentHeaders)(this.subChunks[4]),instrumentZones:Object(I.getZones)(this.subChunks[5],"ibag"),instrumentModulators:Object(I.getModulators)(this.subChunks[6],"imod"),instrumentGenerators:Object(I.getGenerators)(this.subChunks[7],"igen"),sampleHeaders:Object(I.getSampleHeaders)(this.subChunks[8])}}}])&&se(pn.prototype,yn),un}()},"./src/chunks/generators.ts":function(l,d,p){p.r(d),p.d(d,"getGenerators",function(){return tn});var b=p("./src/riff/index.ts"),R=p("./src/types/index.ts"),I=p("./src/constants.ts"),z=[R.GeneratorType.StartAddrsOffset,R.GeneratorType.EndAddrsOffset,R.GeneratorType.StartLoopAddrsOffset,R.GeneratorType.EndLoopAddrsOffset,R.GeneratorType.StartAddrsCoarseOffset,R.GeneratorType.EndAddrsCoarseOffset,R.GeneratorType.StartLoopAddrsCoarseOffset,R.GeneratorType.KeyNum,R.GeneratorType.Velocity,R.GeneratorType.EndLoopAddrsCoarseOffset,R.GeneratorType.SampleModes,R.GeneratorType.ExclusiveClass,R.GeneratorType.OverridingRootKey],se=[R.GeneratorType.Unused1,R.GeneratorType.Unused2,R.GeneratorType.Unused3,R.GeneratorType.Unused4,R.GeneratorType.Reserved1,R.GeneratorType.Reserved2,R.GeneratorType.Reserved3],le=[R.GeneratorType.KeyRange,R.GeneratorType.VelRange],tn=function(an,sn){if(an.id!==sn)throw new b.ParseError("Unexpected chunk ID","'".concat(sn,"'"),"'".concat(an.id,"'"));if(an.length%I.SF_GENERATOR_SIZE)throw new b.ParseError("Invalid size for the '".concat(sn,"' sub-chunk"));return an.iterate(function(ln){var un=ln.getInt16();return R.GeneratorType[un]?sn==="pgen"&&z.includes(un)||sn==="igen"&&se.includes(un)?null:le.includes(un)?{id:un,range:{lo:ln.getByte(),hi:ln.getByte()}}:{id:un,value:ln.getInt16BE()}:null})}},"./src/chunks/index.ts":function(l,d,p){p.r(d);var b=p("./src/chunks/instruments/index.ts");p.d(d,"getInstrumentHeaders",function(){return b.getInstrumentHeaders});var R=p("./src/chunks/presets/index.ts");p.d(d,"getPresetHeaders",function(){return R.getPresetHeaders});var I=p("./src/chunks/samples/index.ts");p.d(d,"getSampleHeaders",function(){return I.getSampleHeaders});var z=p("./src/chunks/generators.ts");p.d(d,"getGenerators",function(){return z.getGenerators});var se=p("./src/chunks/modulators.ts");p.d(d,"getModulators",function(){return se.getModulators});var le=p("./src/chunks/zones.ts");p.d(d,"getZones",function(){return le.getZones}),p.d(d,"getItemsInZone",function(){return le.getItemsInZone})},"./src/chunks/instruments/headers.ts":function(l,d,p){p.r(d),p.d(d,"getInstrumentHeaders",function(){return I});var b=p("./src/riff/index.ts"),R=p("./src/constants.ts"),I=function(z){if(z.id!=="inst")throw new b.ParseError("Unexpected chunk ID","'inst'","'".concat(z.id,"'"));if(z.length%R.SF_INSTRUMENT_HEADER_SIZE)throw new b.ParseError("Invalid size for the 'inst' sub-chunk");return z.iterate(function(se){return{name:se.getString(),bagIndex:se.getInt16()}})}},"./src/chunks/instruments/index.ts":function(l,d,p){p.r(d);var b=p("./src/chunks/instruments/headers.ts");p.d(d,"getInstrumentHeaders",function(){return b.getInstrumentHeaders})},"./src/chunks/modulators.ts":function(l,d,p){p.r(d),p.d(d,"getModulators",function(){return z});var b=p("./src/riff/index.ts"),R=p("./src/constants.ts"),I=function(se){return{type:se>>10&63,polarity:se>>9&1,direction:se>>8&1,palette:se>>7&1,index:127&se}},z=function(se,le){if(se.id!==le)throw new b.ParseError("Unexpected chunk ID","'".concat(le,"'"),"'".concat(se.id,"'"));if(se.length%R.SF_MODULATOR_SIZE)throw new b.ParseError("Invalid size for the '".concat(le,"' sub-chunk"));return se.iterate(function(tn){return{source:I(tn.getInt16BE()),id:tn.getInt16BE(),value:tn.getInt16BE(),valueSource:I(tn.getInt16BE()),transform:tn.getInt16BE()}})}},"./src/chunks/presets/headers.ts":function(l,d,p){p.r(d),p.d(d,"getPresetHeaders",function(){return I});var b=p("./src/riff/index.ts"),R=p("./src/constants.ts"),I=function(z){if(z.id!=="phdr")throw new b.ParseError("Invalid chunk ID","'phdr'","'".concat(z.id,"'"));if(z.length%R.SF_PRESET_HEADER_SIZE)throw new b.ParseError("Invalid size for the 'phdr' sub-chunk");return z.iterate(function(se){return{name:se.getString(),preset:se.getInt16(),bank:se.getInt16(),bagIndex:se.getInt16(),library:se.getUInt32(),genre:se.getUInt32(),morphology:se.getUInt32()}})}},"./src/chunks/presets/index.ts":function(l,d,p){p.r(d);var b=p("./src/chunks/presets/headers.ts");p.d(d,"getPresetHeaders",function(){return b.getPresetHeaders})},"./src/chunks/samples/headers.ts":function(l,d,p){p.r(d),p.d(d,"getSampleHeaders",function(){return I});var b=p("./src/riff/index.ts"),R=p("./src/constants.ts"),I=function(z){if(z.id!=="shdr")throw new b.ParseError("Unexpected chunk ID","'shdr'","'".concat(z.id,"'"));if(z.length%R.SF_SAMPLE_HEADER_SIZE)throw new b.ParseError("Invalid size for the 'shdr' sub-chunk");return z.iterate(function(se){return{name:se.getString(),start:se.getUInt32(),end:se.getUInt32(),startLoop:se.getUInt32(),endLoop:se.getUInt32(),sampleRate:se.getUInt32(),originalPitch:se.getByte(),pitchCorrection:se.getChar(),link:se.getInt16(),type:se.getInt16()}})}},"./src/chunks/samples/index.ts":function(l,d,p){p.r(d);var b=p("./src/chunks/samples/headers.ts");p.d(d,"getSampleHeaders",function(){return b.getSampleHeaders})},"./src/chunks/zones.ts":function(l,d,p){p.r(d),p.d(d,"getZones",function(){return z}),p.d(d,"getItemsInZone",function(){return se});var b=p("./src/riff/index.ts"),R=p("./src/constants.ts"),I=p("./src/types/index.ts"),z=function(sn,ln){if(sn.id!==ln)throw new b.ParseError("Unexpected chunk ID","'".concat(ln,"'"),"'".concat(sn.id,"'"));if(sn.length%R.SF_BAG_SIZE)throw new b.ParseError("Invalid size for the '".concat(ln,"' sub-chunk"));return sn.iterate(function(un){return{generatorIndex:un.getInt16(),modulatorIndex:un.getInt16()}})},se=function(sn,ln,un,pn,yn,_n){for(var Pn=[],vn=0;vn<sn.length;vn++){for(var bn=sn[vn],Sn=sn[vn+1],An=bn.bagIndex,Dn=Sn?Sn.bagIndex:ln.length,Bn=[],Nn=void 0,Qn=An;Qn<Dn;Qn++){var Zn=le(Qn,ln,un),Vn=tn(Qn,ln,pn),qn=Vn[I.GeneratorType.KeyRange]&&Vn[I.GeneratorType.KeyRange].range,ia=Vn[_n];if(ia){var ra=yn[ia.value];ra&&Bn.push({keyRange:qn,modulators:Zn,generators:Vn,reference:ra})}else Qn-An==0&&(Nn={keyRange:qn,modulators:Zn,generators:Vn})}Pn.push({header:bn,globalZone:Nn,zones:Bn})}return Pn},le=function(sn,ln,un){var pn=ln[sn],yn=ln[sn+1],_n=pn.modulatorIndex,Pn=yn?yn.modulatorIndex:ln.length;return an(_n,Pn,un)},tn=function(sn,ln,un){var pn=ln[sn],yn=ln[sn+1],_n=pn.generatorIndex,Pn=yn?yn.generatorIndex:ln.length;return an(_n,Pn,un)},an=function(sn,ln,un){for(var pn={},yn=sn;yn<ln;yn++){var _n=un[yn];_n&&(pn[_n.id]=_n)}return pn}},"./src/constants.ts":function(l,d,p){p.r(d),p.d(d,"SF_VERSION_LENGTH",function(){return b}),p.d(d,"SF_PRESET_HEADER_SIZE",function(){return R}),p.d(d,"SF_BAG_SIZE",function(){return I}),p.d(d,"SF_MODULATOR_SIZE",function(){return z}),p.d(d,"SF_GENERATOR_SIZE",function(){return se}),p.d(d,"SF_INSTRUMENT_HEADER_SIZE",function(){return le}),p.d(d,"SF_SAMPLE_HEADER_SIZE",function(){return tn}),p.d(d,"DEFAULT_SAMPLE_RATE",function(){return an});var b=4,R=38,I=4,z=10,se=4,le=22,tn=46,an=22050},"./src/index.ts":function(l,d,p){p.r(d);var b=p("./src/types/index.ts");for(var R in b)R!=="default"&&function(le){p.d(d,le,function(){return b[le]})}(R);var I=p("./src/chunk.ts");p.d(d,"SF2Chunk",function(){return I.SF2Chunk});var z=p("./src/constants.ts");p.d(d,"SF_VERSION_LENGTH",function(){return z.SF_VERSION_LENGTH}),p.d(d,"SF_PRESET_HEADER_SIZE",function(){return z.SF_PRESET_HEADER_SIZE}),p.d(d,"SF_BAG_SIZE",function(){return z.SF_BAG_SIZE}),p.d(d,"SF_MODULATOR_SIZE",function(){return z.SF_MODULATOR_SIZE}),p.d(d,"SF_GENERATOR_SIZE",function(){return z.SF_GENERATOR_SIZE}),p.d(d,"SF_INSTRUMENT_HEADER_SIZE",function(){return z.SF_INSTRUMENT_HEADER_SIZE}),p.d(d,"SF_SAMPLE_HEADER_SIZE",function(){return z.SF_SAMPLE_HEADER_SIZE}),p.d(d,"DEFAULT_SAMPLE_RATE",function(){return z.DEFAULT_SAMPLE_RATE});var se=p("./src/soundFont2.ts");p.d(d,"SoundFont2",function(){return se.SoundFont2})},"./src/riff/chunkIterator.ts":function(l,d,p){p.r(d),p.d(d,"ChunkIterator",function(){return z});var b=p("./src/utils/index.ts");function R(se,le){for(var tn=0;tn<le.length;tn++){var an=le[tn];an.enumerable=an.enumerable||!1,an.configurable=!0,"value"in an&&(an.writable=!0),Object.defineProperty(se,an.key,an)}}function I(se,le,tn){return le in se?Object.defineProperty(se,le,{value:tn,enumerable:!0,configurable:!0,writable:!0}):se[le]=tn,se}var z=function(){function se(an){var sn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;(function(ln,un){if(!(ln instanceof un))throw new TypeError("Cannot call a class as a function")})(this,se),I(this,"target",[]),I(this,"chunk",void 0),I(this,"position",0),this.chunk=an,this.position=sn}var le,tn;return le=se,(tn=[{key:"iterate",value:function(an){for(;this.position<this.chunk.length;){var sn=an(this);sn&&this.target.push(sn)}}},{key:"getString",value:function(){var an=arguments.length>0&&arguments[0]!==void 0?arguments[0]:20,sn=Object(b.getStringFromBuffer)(this.getBuffer(this.position,an));return this.position+=an,sn}},{key:"getInt16",value:function(){return this.chunk.buffer[this.position++]|this.chunk.buffer[this.position++]<<8}},{key:"getInt16BE",value:function(){return this.getInt16()<<16>>16}},{key:"getUInt32",value:function(){return(this.chunk.buffer[this.position++]|this.chunk.buffer[this.position++]<<8|this.chunk.buffer[this.position++]<<16|this.chunk.buffer[this.position++]<<24)>>>0}},{key:"getByte",value:function(){return this.chunk.buffer[this.position++]}},{key:"getChar",value:function(){return this.chunk.buffer[this.position++]<<24>>24}},{key:"skip",value:function(an){this.position+=an}},{key:"getBuffer",value:function(an,sn){return this.chunk.buffer.subarray(an,an+sn)}},{key:"currentPosition",get:function(){return this.position}}])&&R(le.prototype,tn),se}()},"./src/riff/index.ts":function(l,d,p){p.r(d);var b=p("./src/riff/chunkIterator.ts");p.d(d,"ChunkIterator",function(){return b.ChunkIterator});var R=p("./src/riff/parseError.ts");p.d(d,"ParseError",function(){return R.ParseError});var I=p("./src/riff/parser.ts");p.d(d,"parseBuffer",function(){return I.parseBuffer}),p.d(d,"getChunk",function(){return I.getChunk}),p.d(d,"getChunkLength",function(){return I.getChunkLength}),p.d(d,"getSubChunks",function(){return I.getSubChunks}),p.d(d,"getChunkId",function(){return I.getChunkId});var z=p("./src/riff/riffChunk.ts");p.d(d,"RIFFChunk",function(){return z.RIFFChunk})},"./src/riff/parseError.ts":function(l,d,p){function b(an){return(b=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(sn){return typeof sn}:function(sn){return sn&&typeof Symbol=="function"&&sn.constructor===Symbol&&sn!==Symbol.prototype?"symbol":typeof sn})(an)}function R(an,sn){return!sn||b(sn)!=="object"&&typeof sn!="function"?function(ln){if(ln===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ln}(an):sn}function I(an){var sn=typeof Map=="function"?new Map:void 0;return(I=function(ln){if(ln===null||(un=ln,Function.toString.call(un).indexOf("[native code]")===-1))return ln;var un;if(typeof ln!="function")throw new TypeError("Super expression must either be null or a function");if(sn!==void 0){if(sn.has(ln))return sn.get(ln);sn.set(ln,pn)}function pn(){return z(ln,arguments,le(this).constructor)}return pn.prototype=Object.create(ln.prototype,{constructor:{value:pn,enumerable:!1,writable:!0,configurable:!0}}),se(pn,ln)})(an)}function z(an,sn,ln){return(z=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}()?Reflect.construct:function(un,pn,yn){var _n=[null];_n.push.apply(_n,pn);var Pn=new(Function.bind.apply(un,_n));return yn&&se(Pn,yn.prototype),Pn}).apply(null,arguments)}function se(an,sn){return(se=Object.setPrototypeOf||function(ln,un){return ln.__proto__=un,ln})(an,sn)}function le(an){return(le=Object.setPrototypeOf?Object.getPrototypeOf:function(sn){return sn.__proto__||Object.getPrototypeOf(sn)})(an)}p.r(d),p.d(d,"ParseError",function(){return tn});var tn=function(an){function sn(ln,un,pn){return function(yn,_n){if(!(yn instanceof _n))throw new TypeError("Cannot call a class as a function")}(this,sn),R(this,le(sn).call(this,"".concat(ln).concat(un&&pn?", expected ".concat(un,", received ").concat(pn):"")))}return function(ln,un){if(typeof un!="function"&&un!==null)throw new TypeError("Super expression must either be null or a function");ln.prototype=Object.create(un&&un.prototype,{constructor:{value:ln,writable:!0,configurable:!0}}),un&&se(ln,un)}(sn,I(Error)),sn}()},"./src/riff/parser.ts":function(l,d,p){p.r(d),p.d(d,"parseBuffer",function(){return z}),p.d(d,"getChunk",function(){return se}),p.d(d,"getChunkLength",function(){return le}),p.d(d,"getSubChunks",function(){return tn}),p.d(d,"getChunkId",function(){return an});var b=p("./src/riff/parseError.ts"),R=p("./src/utils/buffer.ts"),I=p("./src/riff/riffChunk.ts"),z=function(sn){var ln=an(sn);if(ln!=="RIFF")throw new b.ParseError("Invalid file format","RIFF",ln);var un=an(sn,8);if(un!=="sfbk")throw new b.ParseError("Invalid signature","sfbk",un);var pn=sn.subarray(8),yn=tn(pn.subarray(4));return new I.RIFFChunk(ln,pn.length,pn,yn)},se=function(sn,ln){var un=an(sn,ln),pn=le(sn,ln+4),yn=[];return un!=="RIFF"&&un!=="LIST"||(yn=tn(sn.subarray(ln+12))),new I.RIFFChunk(un,pn,sn.subarray(ln+8),yn)},le=function(sn,ln){return((sn=sn.subarray(ln,ln+4))[0]|sn[1]<<8|sn[2]<<16|sn[3]<<24)>>>0},tn=function(sn){for(var ln=[],un=0;un<=sn.length-8;){var pn=se(sn,un);ln.push(pn),un=(un+=8+pn.length)%2?un+1:un}return ln},an=function(sn){var ln=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Object(R.getStringFromBuffer)(sn.subarray(ln,ln+4))}},"./src/riff/riffChunk.ts":function(l,d,p){p.r(d),p.d(d,"RIFFChunk",function(){return se});var b=p("./src/riff/chunkIterator.ts"),R=p("./src/utils/index.ts");function I(le,tn){for(var an=0;an<tn.length;an++){var sn=tn[an];sn.enumerable=sn.enumerable||!1,sn.configurable=!0,"value"in sn&&(sn.writable=!0),Object.defineProperty(le,sn.key,sn)}}function z(le,tn,an){return tn in le?Object.defineProperty(le,tn,{value:an,enumerable:!0,configurable:!0,writable:!0}):le[tn]=an,le}var se=function(){function le(sn,ln,un,pn){(function(yn,_n){if(!(yn instanceof _n))throw new TypeError("Cannot call a class as a function")})(this,le),z(this,"id",void 0),z(this,"length",void 0),z(this,"buffer",void 0),z(this,"subChunks",void 0),this.id=sn,this.length=ln,this.buffer=un,this.subChunks=pn}var tn,an;return tn=le,(an=[{key:"getString",value:function(){var sn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,ln=arguments.length>1?arguments[1]:void 0;return Object(R.getStringFromBuffer)(this.getBuffer(sn,ln||this.length-sn))}},{key:"getInt16",value:function(){var sn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.buffer[sn++]|this.buffer[sn]<<8}},{key:"getUInt32",value:function(){var sn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return(this.buffer[sn++]|this.buffer[sn++]<<8|this.buffer[sn++]<<16|this.buffer[sn]<<24)>>>0}},{key:"getByte",value:function(){var sn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.buffer[sn]}},{key:"getChar",value:function(){var sn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.buffer[sn]<<24>>24}},{key:"iterator",value:function(){var sn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return new b.ChunkIterator(this,sn)}},{key:"iterate",value:function(sn){var ln=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,un=new b.ChunkIterator(this,ln);return un.iterate(sn),un.target}},{key:"getBuffer",value:function(sn,ln){return this.buffer.subarray(sn,sn+ln)}}])&&I(tn.prototype,an),le}()},"./src/soundFont2.ts":function(l,d,p){p.r(d),p.d(d,"SoundFont2",function(){return ln});var b=p("./src/types/index.ts"),R=p("./src/chunk.ts"),I=p("./src/riff/index.ts"),z=p("./src/chunks/index.ts"),se=p("./src/utils/index.ts");function le(un){for(var pn=1;pn<arguments.length;pn++){var yn=arguments[pn]!=null?arguments[pn]:{},_n=Object.keys(yn);typeof Object.getOwnPropertySymbols=="function"&&(_n=_n.concat(Object.getOwnPropertySymbols(yn).filter(function(Pn){return Object.getOwnPropertyDescriptor(yn,Pn).enumerable}))),_n.forEach(function(Pn){sn(un,Pn,yn[Pn])})}return un}function tn(un,pn){for(var yn=0;yn<pn.length;yn++){var _n=pn[yn];_n.enumerable=_n.enumerable||!1,_n.configurable=!0,"value"in _n&&(_n.writable=!0),Object.defineProperty(un,_n.key,_n)}}function an(un,pn,yn){return pn&&tn(un.prototype,pn),yn&&tn(un,yn),un}function sn(un,pn,yn){return pn in un?Object.defineProperty(un,pn,{value:yn,enumerable:!0,configurable:!0,writable:!0}):un[pn]=yn,un}var ln=function(){function un(pn){if(function(_n,Pn){if(!(_n instanceof Pn))throw new TypeError("Cannot call a class as a function")}(this,un),sn(this,"chunk",void 0),sn(this,"metaData",void 0),sn(this,"sampleData",void 0),sn(this,"samples",void 0),sn(this,"presetData",void 0),sn(this,"instruments",void 0),sn(this,"presets",void 0),sn(this,"banks",void 0),!(pn instanceof R.SF2Chunk)){var yn=Object(I.parseBuffer)(pn);pn=new R.SF2Chunk(yn)}if(pn.subChunks.length!==3)throw new I.ParseError("Invalid sfbk structure","3 chunks","".concat(pn.subChunks.length," chunks"));this.chunk=pn,this.metaData=pn.subChunks[0].getMetaData(),this.sampleData=pn.subChunks[1].getSampleData(),this.presetData=pn.subChunks[2].getPresetData(),this.samples=this.getSamples(),this.instruments=this.getInstruments(),this.presets=this.getPresets(),this.banks=this.getBanks()}return an(un,null,[{key:"from",value:function(pn){return new un(pn)}}]),an(un,[{key:"getKeyData",value:function(pn){var yn=this,_n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Pn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return Object(se.memoize)(function(vn,bn,Sn){var An=yn.banks[bn];if(An){var Dn=An.presets[Sn];if(Dn){var Bn=Dn.zones.find(function(ia){return yn.isKeyInRange(ia,vn)});if(Bn){var Nn=Bn.instrument,Qn=Nn.zones.find(function(ia){return yn.isKeyInRange(ia,vn)});if(Qn){var Zn=Qn.sample,Vn=le({},Bn.generators,Qn.generators),qn=le({},Bn.modulators,Qn.modulators);return{keyNumber:vn,preset:Dn,instrument:Nn,sample:Zn,generators:Vn,modulators:qn}}}}}return null})(pn,_n,Pn)}},{key:"isKeyInRange",value:function(pn,yn){return pn.keyRange===void 0||pn.keyRange.lo<=yn&&pn.keyRange.hi>=yn}},{key:"getBanks",value:function(){return this.presets.reduce(function(pn,yn){var _n=yn.header.bank;return pn[_n]||(pn[_n]={presets:[]}),pn[_n].presets[yn.header.preset]=yn,pn},[])}},{key:"getPresets",value:function(){var pn=this.presetData,yn=pn.presetHeaders,_n=pn.presetZones,Pn=pn.presetGenerators,vn=pn.presetModulators;return Object(z.getItemsInZone)(yn,_n,vn,Pn,this.instruments,b.GeneratorType.Instrument).filter(function(bn){return bn.header.name!=="EOP"}).map(function(bn){return{header:bn.header,globalZone:bn.globalZone,zones:bn.zones.map(function(Sn){return{keyRange:Sn.keyRange,generators:Sn.generators,modulators:Sn.modulators,instrument:Sn.reference}})}})}},{key:"getInstruments",value:function(){var pn=this.presetData,yn=pn.instrumentHeaders,_n=pn.instrumentZones,Pn=pn.instrumentModulators,vn=pn.instrumentGenerators;return Object(z.getItemsInZone)(yn,_n,Pn,vn,this.samples,b.GeneratorType.SampleId).filter(function(bn){return bn.header.name!=="EOI"}).map(function(bn){return{header:bn.header,globalZone:bn.globalZone,zones:bn.zones.map(function(Sn){return{keyRange:Sn.keyRange,generators:Sn.generators,modulators:Sn.modulators,sample:Sn.reference}})}})}},{key:"getSamples",value:function(){var pn=this;return this.presetData.sampleHeaders.filter(function(yn){return yn.name!=="EOS"}).map(function(yn){if(yn.name!=="EOS"&&yn.sampleRate<=0)throw new Error("Illegal sample rate of ".concat(yn.sampleRate," hz in sample '").concat(yn.name,"'"));return yn.originalPitch>=128&&yn.originalPitch<=254&&(yn.originalPitch=60),yn.startLoop-=yn.start,yn.endLoop-=yn.start,{header:yn,data:new Int16Array(new Uint8Array(pn.sampleData.subarray(2*yn.start,2*yn.end)).buffer)}})}}]),un}()},"./src/types/bank.ts":function(l,d){},"./src/types/generator.ts":function(l,d,p){var b,R;function I(se,le,tn){return le in se?Object.defineProperty(se,le,{value:tn,enumerable:!0,configurable:!0,writable:!0}):se[le]=tn,se}p.r(d),p.d(d,"GeneratorType",function(){return R}),p.d(d,"DEFAULT_GENERATOR_VALUES",function(){return z}),function(se){se[se.StartAddrsOffset=0]="StartAddrsOffset",se[se.EndAddrsOffset=1]="EndAddrsOffset",se[se.StartLoopAddrsOffset=2]="StartLoopAddrsOffset",se[se.EndLoopAddrsOffset=3]="EndLoopAddrsOffset",se[se.StartAddrsCoarseOffset=4]="StartAddrsCoarseOffset",se[se.ModLFOToPitch=5]="ModLFOToPitch",se[se.VibLFOToPitch=6]="VibLFOToPitch",se[se.ModEnvToPitch=7]="ModEnvToPitch",se[se.InitialFilterFc=8]="InitialFilterFc",se[se.InitialFilterQ=9]="InitialFilterQ",se[se.ModLFOToFilterFc=10]="ModLFOToFilterFc",se[se.ModEnvToFilterFc=11]="ModEnvToFilterFc",se[se.EndAddrsCoarseOffset=12]="EndAddrsCoarseOffset",se[se.ModLFOToVolume=13]="ModLFOToVolume",se[se.Unused1=14]="Unused1",se[se.ChorusEffectsSend=15]="ChorusEffectsSend",se[se.ReverbEffectsSend=16]="ReverbEffectsSend",se[se.Pan=17]="Pan",se[se.Unused2=18]="Unused2",se[se.Unused3=19]="Unused3",se[se.Unused4=20]="Unused4",se[se.DelayModLFO=21]="DelayModLFO",se[se.FreqModLFO=22]="FreqModLFO",se[se.DelayVibLFO=23]="DelayVibLFO",se[se.FreqVibLFO=24]="FreqVibLFO",se[se.DelayModEnv=25]="DelayModEnv",se[se.AttackModEnv=26]="AttackModEnv",se[se.HoldModEnv=27]="HoldModEnv",se[se.DecayModEnv=28]="DecayModEnv",se[se.SustainModEnv=29]="SustainModEnv",se[se.ReleaseModEnv=30]="ReleaseModEnv",se[se.KeyNumToModEnvHold=31]="KeyNumToModEnvHold",se[se.KeyNumToModEnvDecay=32]="KeyNumToModEnvDecay",se[se.DelayVolEnv=33]="DelayVolEnv",se[se.AttackVolEnv=34]="AttackVolEnv",se[se.HoldVolEnv=35]="HoldVolEnv",se[se.DecayVolEnv=36]="DecayVolEnv",se[se.SustainVolEnv=37]="SustainVolEnv",se[se.ReleaseVolEnv=38]="ReleaseVolEnv",se[se.KeyNumToVolEnvHold=39]="KeyNumToVolEnvHold",se[se.KeyNumToVolEnvDecay=40]="KeyNumToVolEnvDecay",se[se.Instrument=41]="Instrument",se[se.Reserved1=42]="Reserved1",se[se.KeyRange=43]="KeyRange",se[se.VelRange=44]="VelRange",se[se.StartLoopAddrsCoarseOffset=45]="StartLoopAddrsCoarseOffset",se[se.KeyNum=46]="KeyNum",se[se.Velocity=47]="Velocity",se[se.InitialAttenuation=48]="InitialAttenuation",se[se.Reserved2=49]="Reserved2",se[se.EndLoopAddrsCoarseOffset=50]="EndLoopAddrsCoarseOffset",se[se.CoarseTune=51]="CoarseTune",se[se.FineTune=52]="FineTune",se[se.SampleId=53]="SampleId",se[se.SampleModes=54]="SampleModes",se[se.Reserved3=55]="Reserved3",se[se.ScaleTuning=56]="ScaleTuning",se[se.ExclusiveClass=57]="ExclusiveClass",se[se.OverridingRootKey=58]="OverridingRootKey",se[se.Unused5=59]="Unused5",se[se.EndOper=60]="EndOper"}(R||(R={}));var z=(I(b={},R.StartAddrsOffset,0),I(b,R.EndAddrsOffset,0),I(b,R.StartLoopAddrsOffset,0),I(b,R.EndLoopAddrsOffset,0),I(b,R.StartAddrsCoarseOffset,0),I(b,R.ModLFOToPitch,0),I(b,R.VibLFOToPitch,0),I(b,R.ModEnvToPitch,0),I(b,R.InitialFilterFc,13500),I(b,R.InitialFilterQ,0),I(b,R.ModLFOToFilterFc,0),I(b,R.ModEnvToFilterFc,0),I(b,R.EndAddrsCoarseOffset,0),I(b,R.ModLFOToVolume,0),I(b,R.ChorusEffectsSend,0),I(b,R.ReverbEffectsSend,0),I(b,R.Pan,0),I(b,R.DelayModLFO,-12e3),I(b,R.FreqModLFO,0),I(b,R.DelayVibLFO,-12e3),I(b,R.FreqVibLFO,0),I(b,R.DelayModEnv,-12e3),I(b,R.AttackModEnv,-12e3),I(b,R.HoldModEnv,-12e3),I(b,R.DecayModEnv,-12e3),I(b,R.SustainModEnv,0),I(b,R.ReleaseModEnv,-12e3),I(b,R.KeyNumToModEnvHold,0),I(b,R.KeyNumToModEnvDecay,0),I(b,R.DelayVolEnv,-12e3),I(b,R.AttackVolEnv,-12e3),I(b,R.HoldVolEnv,-12e3),I(b,R.DecayVolEnv,-12e3),I(b,R.SustainVolEnv,0),I(b,R.ReleaseVolEnv,-12e3),I(b,R.KeyNumToVolEnvHold,0),I(b,R.KeyNumToVolEnvDecay,0),I(b,R.StartLoopAddrsCoarseOffset,0),I(b,R.KeyNum,-1),I(b,R.Velocity,-1),I(b,R.InitialAttenuation,0),I(b,R.EndLoopAddrsCoarseOffset,0),I(b,R.CoarseTune,0),I(b,R.FineTune,0),I(b,R.SampleModes,0),I(b,R.ScaleTuning,100),I(b,R.ExclusiveClass,0),I(b,R.OverridingRootKey,-1),b)},"./src/types/index.ts":function(l,d,p){p.r(d);var b=p("./src/types/bank.ts");for(var R in b)R!=="default"&&function(pn){p.d(d,pn,function(){return b[pn]})}(R);var I=p("./src/types/generator.ts");p.d(d,"GeneratorType",function(){return I.GeneratorType}),p.d(d,"DEFAULT_GENERATOR_VALUES",function(){return I.DEFAULT_GENERATOR_VALUES});var z=p("./src/types/instrument.ts");for(var R in z)["GeneratorType","DEFAULT_GENERATOR_VALUES","default"].indexOf(R)<0&&function(yn){p.d(d,yn,function(){return z[yn]})}(R);var se=p("./src/types/key.ts");for(var R in se)["GeneratorType","DEFAULT_GENERATOR_VALUES","default"].indexOf(R)<0&&function(yn){p.d(d,yn,function(){return se[yn]})}(R);var le=p("./src/types/metaData.ts");for(var R in le)["GeneratorType","DEFAULT_GENERATOR_VALUES","default"].indexOf(R)<0&&function(yn){p.d(d,yn,function(){return le[yn]})}(R);var tn=p("./src/types/modulator.ts");p.d(d,"ControllerType",function(){return tn.ControllerType}),p.d(d,"ControllerPolarity",function(){return tn.ControllerPolarity}),p.d(d,"ControllerDirection",function(){return tn.ControllerDirection}),p.d(d,"ControllerPalette",function(){return tn.ControllerPalette}),p.d(d,"Controller",function(){return tn.Controller}),p.d(d,"TransformType",function(){return tn.TransformType}),p.d(d,"DEFAULT_INSTRUMENT_MODULATORS",function(){return tn.DEFAULT_INSTRUMENT_MODULATORS});var an=p("./src/types/preset.ts");for(var R in an)["GeneratorType","DEFAULT_GENERATOR_VALUES","ControllerType","ControllerPolarity","ControllerDirection","ControllerPalette","Controller","TransformType","DEFAULT_INSTRUMENT_MODULATORS","default"].indexOf(R)<0&&function(yn){p.d(d,yn,function(){return an[yn]})}(R);var sn=p("./src/types/presetData.ts");for(var R in sn)["GeneratorType","DEFAULT_GENERATOR_VALUES","ControllerType","ControllerPolarity","ControllerDirection","ControllerPalette","Controller","TransformType","DEFAULT_INSTRUMENT_MODULATORS","default"].indexOf(R)<0&&function(yn){p.d(d,yn,function(){return sn[yn]})}(R);var ln=p("./src/types/sample.ts");p.d(d,"SampleType",function(){return ln.SampleType});var un=p("./src/types/zone.ts");for(var R in un)["GeneratorType","DEFAULT_GENERATOR_VALUES","ControllerType","ControllerPolarity","ControllerDirection","ControllerPalette","Controller","TransformType","DEFAULT_INSTRUMENT_MODULATORS","SampleType","default"].indexOf(R)<0&&function(yn){p.d(d,yn,function(){return un[yn]})}(R)},"./src/types/instrument.ts":function(l,d){},"./src/types/key.ts":function(l,d){},"./src/types/metaData.ts":function(l,d){},"./src/types/modulator.ts":function(l,d,p){p.r(d),p.d(d,"ControllerType",function(){return b}),p.d(d,"ControllerPolarity",function(){return R}),p.d(d,"ControllerDirection",function(){return I}),p.d(d,"ControllerPalette",function(){return z}),p.d(d,"Controller",function(){return se}),p.d(d,"TransformType",function(){return le}),p.d(d,"DEFAULT_INSTRUMENT_MODULATORS",function(){return an});var b,R,I,z,se,le,tn=p("./src/types/generator.ts");(function(sn){sn[sn.Linear=0]="Linear",sn[sn.Concave=1]="Concave",sn[sn.Convex=2]="Convex",sn[sn.Switch=3]="Switch"})(b||(b={})),function(sn){sn[sn.Unipolar=0]="Unipolar",sn[sn.Bipolar=1]="Bipolar"}(R||(R={})),function(sn){sn[sn.Increasing=0]="Increasing",sn[sn.Decreasing=1]="Decreasing"}(I||(I={})),function(sn){sn[sn.GeneralController=0]="GeneralController",sn[sn.MidiController=1]="MidiController"}(z||(z={})),function(sn){sn[sn.NoController=0]="NoController",sn[sn.NoteOnVelocity=2]="NoteOnVelocity",sn[sn.NoteOnKeyNumber=3]="NoteOnKeyNumber",sn[sn.PolyPressure=10]="PolyPressure",sn[sn.ChannelPressure=13]="ChannelPressure",sn[sn.PitchWheel=14]="PitchWheel",sn[sn.PitchWheelSensitivity=16]="PitchWheelSensitivity",sn[sn.Link=127]="Link"}(se||(se={})),function(sn){sn[sn.Linear=0]="Linear",sn[sn.Absolute=2]="Absolute"}(le||(le={}));var an=[{id:tn.GeneratorType.InitialAttenuation,source:{type:b.Concave,polarity:R.Unipolar,direction:I.Decreasing,palette:z.GeneralController,index:se.NoteOnVelocity},value:960,valueSource:{type:b.Linear,polarity:R.Unipolar,direction:I.Increasing,palette:z.GeneralController,index:se.NoController},transform:le.Linear},{id:tn.GeneratorType.InitialFilterFc,source:{type:b.Linear,polarity:R.Unipolar,direction:I.Decreasing,palette:z.GeneralController,index:se.NoteOnVelocity},value:-2400,valueSource:{type:b.Linear,polarity:R.Unipolar,direction:I.Increasing,palette:z.GeneralController,index:se.NoController},transform:le.Linear},{id:tn.GeneratorType.VibLFOToPitch,source:{type:b.Linear,polarity:R.Unipolar,direction:I.Increasing,palette:z.GeneralController,index:se.ChannelPressure},value:50,valueSource:{type:b.Linear,polarity:R.Unipolar,direction:I.Increasing,palette:z.GeneralController,index:se.NoController},transform:le.Linear},{id:tn.GeneratorType.VibLFOToPitch,source:{type:b.Linear,polarity:R.Unipolar,direction:I.Increasing,palette:z.MidiController,index:1},value:50,valueSource:{type:b.Linear,polarity:R.Unipolar,direction:I.Increasing,palette:z.GeneralController,index:se.NoController},transform:le.Linear},{id:tn.GeneratorType.InitialAttenuation,source:{type:b.Concave,polarity:R.Unipolar,direction:I.Decreasing,palette:z.MidiController,index:7},value:960,valueSource:{type:b.Linear,polarity:R.Unipolar,direction:I.Increasing,palette:z.GeneralController,index:se.NoController},transform:le.Linear},{id:tn.GeneratorType.InitialAttenuation,source:{type:b.Linear,polarity:R.Bipolar,direction:I.Increasing,palette:z.MidiController,index:10},value:1e3,valueSource:{type:b.Linear,polarity:R.Unipolar,direction:I.Increasing,palette:z.GeneralController,index:se.NoController},transform:le.Linear},{id:tn.GeneratorType.InitialAttenuation,source:{type:b.Concave,polarity:R.Unipolar,direction:I.Decreasing,palette:z.MidiController,index:11},value:960,valueSource:{type:b.Linear,polarity:R.Unipolar,direction:I.Increasing,palette:z.GeneralController,index:se.NoController},transform:le.Linear},{id:tn.GeneratorType.ReverbEffectsSend,source:{type:b.Linear,polarity:R.Unipolar,direction:I.Increasing,palette:z.MidiController,index:91},value:200,valueSource:{type:b.Linear,polarity:R.Unipolar,direction:I.Increasing,palette:z.GeneralController,index:se.NoController},transform:le.Linear},{id:tn.GeneratorType.ChorusEffectsSend,source:{type:b.Linear,polarity:R.Unipolar,direction:I.Increasing,palette:z.MidiController,index:93},value:200,valueSource:{type:b.Linear,polarity:R.Unipolar,direction:I.Increasing,palette:z.GeneralController,index:se.NoController},transform:le.Linear},{id:tn.GeneratorType.CoarseTune,source:{type:b.Linear,polarity:R.Bipolar,direction:I.Increasing,palette:z.GeneralController,index:se.PitchWheel},value:12700,valueSource:{type:b.Linear,polarity:R.Unipolar,direction:I.Increasing,palette:z.GeneralController,index:se.PitchWheelSensitivity},transform:le.Linear}]},"./src/types/preset.ts":function(l,d){},"./src/types/presetData.ts":function(l,d){},"./src/types/sample.ts":function(l,d,p){var b;p.r(d),p.d(d,"SampleType",function(){return b}),function(R){R[R.EOS=0]="EOS",R[R.Mono=1]="Mono",R[R.Right=2]="Right",R[R.Left=4]="Left",R[R.Linked=8]="Linked",R[R.RomMono=32769]="RomMono",R[R.RomRight=32770]="RomRight",R[R.RomLeft=32772]="RomLeft",R[R.RomLinked=32776]="RomLinked"}(b||(b={}))},"./src/types/zone.ts":function(l,d){},"./src/utils/buffer.ts":function(l,d,p){p.r(d),p.d(d,"getStringFromBuffer",function(){return b});var b=function(R){return new TextDecoder("utf8").decode(R).split(/\0/)[0].trim()}},"./src/utils/index.ts":function(l,d,p){p.r(d);var b=p("./src/utils/buffer.ts");p.d(d,"getStringFromBuffer",function(){return b.getStringFromBuffer});var R=p("./src/utils/memoize.ts");p.d(d,"memoize",function(){return R.memoize})},"./src/utils/memoize.ts":function(l,d,p){p.r(d),p.d(d,"memoize",function(){return b});var b=function(R){var I={};return function(){for(var z=arguments.length,se=new Array(z),le=0;le<z;le++)se[le]=arguments[le];var tn=JSON.stringify(se);if(tn in I)return I[tn];var an=R.apply(void 0,se);return I[tn]=an,an}}}})})}(SoundFont2)),SoundFont2.exports}var SoundFont2Exports=requireSoundFont2();const m=o=>Math.pow(2,o/1200),Q=o=>o/1e3,G=(o,e)=>{const l=Math.pow(10,e);return Math.round(o*l)/l};typeof AudioParam<"u"&&(AudioParam.prototype.dahdsr=function(o,e,l,d,p,b,R,I,z){p=Math.max(G(p,4),.001),R=Math.max(G(R,4),.001),z=G(z,4),e=Math.max(e,.001);let se=o;return this.setValueAtTime(e,se),this.setValueAtTime(e,se+=d),this.exponentialRampToValueAtTime(l,se+=p),this.setValueAtTime(l,se+=b),this.exponentialRampToValueAtTime(Math.max(I*l,.001),se+=R),(le,tn)=>{this.cancelAndHoldAtTime(le);const an=Math.max(tn??e,.001);this.exponentialRampToValueAtTime(an,le+z)}});const T={0:"startAddrOffset",1:"endAddrOffset",2:"startloopAddrsOffset",3:"endloopAddrsOffset",4:"startAddrsCoarseOffset",5:"modLfoToPitch",6:"vibLfoToPitch",7:"modEnvToPitch",8:"initialFilterFc",9:"initialFilterQ",10:"modLfoToFilterFc",11:"modEnvToFilterFc",12:"endAddrsCoarseOffset",13:"modLfoToVolume",14:"unused1",15:"chorusEffectsSend",16:"reverbEffectsSend",17:"pan",18:"unused2",19:"unused3",20:"unused4",21:"delayModLFO",22:"freqModLFO",23:"delayVibLFO",24:"freqVibLFO",25:"delayModEnv",26:"attackModEnv",27:"holdModEnv",28:"decayModEnv",29:"sustainModEnv",30:"releaseModEnv",31:"keyNumToModEnvHold",32:"keyNumToModEnvDecay",33:"delayVolEnv",34:"attackVolEnv",35:"holdVolEnv",36:"decayVolEnv",37:"sustainVolEnv",38:"releaseVolEnv",39:"keyNumToVolEnvHold",40:"keyNumToVolEnvDecay",41:"instrument",42:"reserved1",43:"keyRange",44:"velRange",45:"startloopAddrsCoarseOffset",46:"keyNum",47:"velocity",48:"initialAttenuation",49:"reserved2",50:"endloopAddrsCoarseOffset",51:"coarseTune",52:"fineTune",53:"sampleID",54:"sampleModes",55:"reserved3",56:"scaleTuning",57:"exclusiveClass",58:"overridingRootKey",59:"unused5",60:"endOper"};Object.fromEntries(Object.entries(SoundFont2Exports.DEFAULT_GENERATOR_VALUES).map(([o,e])=>[T[o],e]));const D=(o,e,l,d,p)=>{var b,R,I,z,se,le,tn;const an=SoundFont2Exports.DEFAULT_GENERATOR_VALUES[o];if(typeof an!="number")throw new Error(`no default value found for generator with index ${o}`);const sn=e.generators[o],ln=(R=(b=l.globalZone)==null?void 0:b.generators)==null?void 0:R[o],un=(I=d?.generators)==null?void 0:I[o],pn=(se=(z=p.globalZone)==null?void 0:z.generators)==null?void 0:se[o],yn=sn&&"value"in sn?sn.value:void 0,_n=ln&&"value"in ln?ln.value:void 0,Pn=un&&"value"in un?un.value:void 0,vn=pn&&"value"in pn?pn.value:void 0,bn=(le=yn??_n)!=null?le:an,Sn=(tn=Pn??vn)!=null?tn:0;return bn+Sn},J=o=>SoundFont2Exports.DEFAULT_GENERATOR_VALUES[o]!==void 0,W=(o,e,l)=>{var d,p,b,R;return Object.fromEntries(Array.from(new Set([Object.keys((p=(d=l.globalZone)==null?void 0:d.generators)!=null?p:{}),Object.keys(e.generators),Object.keys((R=(b=e.instrument.globalZone)==null?void 0:b.generators)!=null?R:{}),Object.keys(o.generators)].flat())).filter(J).map(I=>[T[I],D(parseInt(I),o,e.instrument,e,l)]))};async function ae(o){const e=await fetch(o).then(d=>d.arrayBuffer()),l=new Uint8Array(e);return new SoundFont2Exports.SoundFont2(l)}function X(o,e,l){let{time:d=o.currentTime}=l;const{midi:p,start:b,velocity:R=.3,startLoop:I,endLoop:z,sampleRate:se,originalPitch:le,pitchCorrection:tn,type:an,sampleModes:sn=0,overridingRootKey:ln,fineTune:un=0,startloopAddrsOffset:pn=0,startloopAddrsCoarseOffset:yn=0,endloopAddrsOffset:_n=0,endloopAddrsCoarseOffset:Pn=0,delayVolEnv:vn=-12e3,attackVolEnv:bn=-12e3,holdVolEnv:Sn=-12e3,decayVolEnv:An=-12e3,sustainVolEnv:Dn=0,releaseVolEnv:Bn=-12e3,pan:Nn=0,...Qn}=l,Zn=100*(ln!==void 0&&ln!==-1?ln:le)+tn-un,Vn=p*100-Zn,qn=1*Math.pow(2,Vn/1200);e.playbackRate.value=qn;const ia=I+pn+yn*32768,ra=z+_n+Pn*32768;ra>ia&&sn===1?(e.loopStart=ia/se,e.loopEnd=ra/se,e.loop=!0):sn===3&&console.warn("unimplemented sampleMode 3 (play till end on note off)"),Object.keys(Qn).filter(Na=>!["name","instrument","keyRange","sampleID","end"].includes(Na)).length;const aa=o.createGain(),jn=[d,0,R,m(vn),m(bn),m(Sn),m(An),Dn>=960?0:1-Q(Dn),m(Bn)],ka=aa.gain.dahdsr(...jn),Aa=o.createStereoPanner();return Aa.pan.value=Nn/1e3,aa.connect(Aa),e.connect(aa),Aa.connect(o.destination),e.start(d),(Na=o.currentTime)=>{e.stop(Na+m(Bn)),ka(Na)}}function Y(o,e,l={}){const{header:d,data:p}=e,b=new Float32Array(p.length);for(let z=0;z<p.length;z++)b[z]=p[z]/32768;const R=o.createBuffer(1,b.length,d.sampleRate);R.getChannelData(0).set(b);const I=o.createBufferSource();return I.buffer=R,l={...d,...l},X(o,I,l)}const C=(o,e)=>!o.keyRange||o.keyRange.lo<=e&&e<=o.keyRange.hi,x=(o,e)=>o.zones.filter(l=>C(l,e)&&l.instrument).map(l=>l.instrument.zones.filter(d=>C(d,e)).map(d=>{const p=W(d,l,o);return{...d,mergedGenerators:p}})).flat(),ce=(o,e,l,d=o.currentTime)=>{const p=x(e,l).map(b=>Y(o,b.sample,{...b.mergedGenerators,midi:l,time:d}));return(b=o.currentTime)=>{p.forEach(R=>R(b))}};Pattern$1.prototype.soundfont=function(o,e=0){return this.onTrigger((l,d,p,b)=>{const R=getAudioContext(),I=getPlayableNoteValue(l),z=o.presets[e%o.presets.length],se=b,le=[R,z,noteToMidi$1(I),se];ce(...le)(se+l.duration)})};const soundfontCache=new Map;function loadSoundfont(o){if(soundfontCache.get(o))return soundfontCache.get(o);const e=ae(o);return soundfontCache.set(o,e),e}const index$1=Object.freeze(Object.defineProperty({__proto__:null,getFontBufferSource,loadSoundfont,registerSoundfonts,setSoundfontUrl,soundfontList:list,startPresetNote:ce},Symbol.toStringTag,{value:"Module"}));class EventEmitter{constructor(e=!1){this.eventMap={},this.eventsSuspended=e==!0}addListener(e,l,d={}){if(typeof e=="string"&&e.length<1||e instanceof String&&e.length<1||typeof e!="string"&&!(e instanceof String)&&e!==EventEmitter.ANY_EVENT)throw new TypeError("The 'event' parameter must be a string or EventEmitter.ANY_EVENT.");if(typeof l!="function")throw new TypeError("The callback must be a function.");const p=new Listener(e,this,l,d);return this.eventMap[e]||(this.eventMap[e]=[]),d.prepend?this.eventMap[e].unshift(p):this.eventMap[e].push(p),p}addOneTimeListener(e,l,d={}){d.remaining=1,this.addListener(e,l,d)}static get ANY_EVENT(){return Symbol.for("Any event")}hasListener(e,l){return e===void 0?this.eventMap[EventEmitter.ANY_EVENT]&&this.eventMap[EventEmitter.ANY_EVENT].length>0?!0:Object.entries(this.eventMap).some(([,d])=>d.length>0):this.eventMap[e]&&this.eventMap[e].length>0?l instanceof Listener?this.eventMap[e].filter(p=>p===l).length>0:typeof l=="function"?this.eventMap[e].filter(p=>p.callback===l).length>0:l==null:!1}get eventNames(){return Object.keys(this.eventMap)}getListeners(e){return this.eventMap[e]||[]}suspendEvent(e){this.getListeners(e).forEach(l=>{l.suspended=!0})}unsuspendEvent(e){this.getListeners(e).forEach(l=>{l.suspended=!1})}getListenerCount(e){return this.getListeners(e).length}emit(e,...l){if(typeof e!="string"&&!(e instanceof String))throw new TypeError("The 'event' parameter must be a string.");if(this.eventsSuspended)return;let d=[],p=this.eventMap[EventEmitter.ANY_EVENT]||[];return this.eventMap[e]&&(p=p.concat(this.eventMap[e])),p.forEach(b=>{if(b.suspended)return;let R=[...l];Array.isArray(b.arguments)&&(R=R.concat(b.arguments)),b.remaining>0&&(d.push(b.callback.apply(b.context,R)),b.count++),--b.remaining<1&&b.remove()}),d}removeListener(e,l,d={}){if(e===void 0){this.eventMap={};return}else if(!this.eventMap[e])return;let p=this.eventMap[e].filter(b=>l&&b.callback!==l||d.remaining&&d.remaining!==b.remaining||d.context&&d.context!==b.context);p.length?this.eventMap[e]=p:delete this.eventMap[e]}async waitFor(e,l={}){return l.duration=parseInt(l.duration),(isNaN(l.duration)||l.duration<=0)&&(l.duration=1/0),new Promise((d,p)=>{let b,R=this.addListener(e,()=>{clearTimeout(b),d()},{remaining:1});l.duration!==1/0&&(b=setTimeout(()=>{R.remove(),p("The duration expired before the event was emitted.")},l.duration))})}get eventCount(){return Object.keys(this.eventMap).length}}class Listener{constructor(e,l,d,p={}){if(typeof e!="string"&&!(e instanceof String)&&e!==EventEmitter.ANY_EVENT)throw new TypeError("The 'event' parameter must be a string or EventEmitter.ANY_EVENT.");if(!l)throw new ReferenceError("The 'target' parameter is mandatory.");if(typeof d!="function")throw new TypeError("The 'callback' must be a function.");p.arguments!==void 0&&!Array.isArray(p.arguments)&&(p.arguments=[p.arguments]),p=Object.assign({context:l,remaining:1/0,arguments:void 0,duration:1/0},p),p.duration!==1/0&&setTimeout(()=>this.remove(),p.duration),this.arguments=p.arguments,this.callback=d,this.context=p.context,this.count=0,this.event=e,this.remaining=parseInt(p.remaining)>=1?parseInt(p.remaining):1/0,this.suspended=!1,this.target=l}remove(){this.target.removeListener(this.event,this.callback,{context:this.context,remaining:this.remaining})}}/**
|
||
* The `Enumerations` class contains enumerations and arrays of elements used throughout the
|
||
* library. All its properties are static and should be referenced using the class name. For
|
||
* example: `Enumerations.CHANNEL_MESSAGES`.
|
||
*
|
||
* @license Apache-2.0
|
||
* @since 3.0.0
|
||
*/class Enumerations{static get MIDI_CHANNEL_MESSAGES(){return this.validation&&console.warn("The MIDI_CHANNEL_MESSAGES enum has been deprecated. Use the Enumerations.CHANNEL_MESSAGES enum instead."),Enumerations.CHANNEL_MESSAGES}static get CHANNEL_MESSAGES(){return{noteoff:8,noteon:9,keyaftertouch:10,controlchange:11,programchange:12,channelaftertouch:13,pitchbend:14}}static get CHANNEL_NUMBERS(){return[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]}static get MIDI_CHANNEL_NUMBERS(){return this.validation&&console.warn("The MIDI_CHANNEL_NUMBERS array has been deprecated. Use the Enumerations.CHANNEL_NUMBERS array instead."),[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]}static get CHANNEL_MODE_MESSAGES(){return{allsoundoff:120,resetallcontrollers:121,localcontrol:122,allnotesoff:123,omnimodeoff:124,omnimodeon:125,monomodeon:126,polymodeon:127}}static get MIDI_CHANNEL_MODE_MESSAGES(){return this.validation&&console.warn("The MIDI_CHANNEL_MODE_MESSAGES enum has been deprecated. Use the Enumerations.CHANNEL_MODE_MESSAGES enum instead."),Enumerations.CHANNEL_MODE_MESSAGES}static get MIDI_CONTROL_CHANGE_MESSAGES(){return this.validation&&console.warn("The MIDI_CONTROL_CHANGE_MESSAGES enum has been deprecated. Use the Enumerations.CONTROL_CHANGE_MESSAGES array instead."),{bankselectcoarse:0,modulationwheelcoarse:1,breathcontrollercoarse:2,controller3:3,footcontrollercoarse:4,portamentotimecoarse:5,dataentrycoarse:6,volumecoarse:7,balancecoarse:8,controller9:9,pancoarse:10,expressioncoarse:11,effectcontrol1coarse:12,effectcontrol2coarse:13,controller14:14,controller15:15,generalpurposeslider1:16,generalpurposeslider2:17,generalpurposeslider3:18,generalpurposeslider4:19,controller20:20,controller21:21,controller22:22,controller23:23,controller24:24,controller25:25,controller26:26,controller27:27,controller28:28,controller29:29,controller30:30,controller31:31,bankselectfine:32,modulationwheelfine:33,breathcontrollerfine:34,controller35:35,footcontrollerfine:36,portamentotimefine:37,dataentryfine:38,volumefine:39,balancefine:40,controller41:41,panfine:42,expressionfine:43,effectcontrol1fine:44,effectcontrol2fine:45,controller46:46,controller47:47,controller48:48,controller49:49,controller50:50,controller51:51,controller52:52,controller53:53,controller54:54,controller55:55,controller56:56,controller57:57,controller58:58,controller59:59,controller60:60,controller61:61,controller62:62,controller63:63,holdpedal:64,portamento:65,sustenutopedal:66,softpedal:67,legatopedal:68,hold2pedal:69,soundvariation:70,resonance:71,soundreleasetime:72,soundattacktime:73,brightness:74,soundcontrol6:75,soundcontrol7:76,soundcontrol8:77,soundcontrol9:78,soundcontrol10:79,generalpurposebutton1:80,generalpurposebutton2:81,generalpurposebutton3:82,generalpurposebutton4:83,controller84:84,controller85:85,controller86:86,controller87:87,controller88:88,controller89:89,controller90:90,reverblevel:91,tremololevel:92,choruslevel:93,celestelevel:94,phaserlevel:95,databuttonincrement:96,databuttondecrement:97,nonregisteredparametercoarse:98,nonregisteredparameterfine:99,registeredparametercoarse:100,registeredparameterfine:101,controller102:102,controller103:103,controller104:104,controller105:105,controller106:106,controller107:107,controller108:108,controller109:109,controller110:110,controller111:111,controller112:112,controller113:113,controller114:114,controller115:115,controller116:116,controller117:117,controller118:118,controller119:119,allsoundoff:120,resetallcontrollers:121,localcontrol:122,allnotesoff:123,omnimodeoff:124,omnimodeon:125,monomodeon:126,polymodeon:127}}static get CONTROL_CHANGE_MESSAGES(){return[{number:0,name:"bankselectcoarse",description:"Bank Select (Coarse)",position:"msb"},{number:1,name:"modulationwheelcoarse",description:"Modulation Wheel (Coarse)",position:"msb"},{number:2,name:"breathcontrollercoarse",description:"Breath Controller (Coarse)",position:"msb"},{number:3,name:"controller3",description:"Undefined",position:"msb"},{number:4,name:"footcontrollercoarse",description:"Foot Controller (Coarse)",position:"msb"},{number:5,name:"portamentotimecoarse",description:"Portamento Time (Coarse)",position:"msb"},{number:6,name:"dataentrycoarse",description:"Data Entry (Coarse)",position:"msb"},{number:7,name:"volumecoarse",description:"Channel Volume (Coarse)",position:"msb"},{number:8,name:"balancecoarse",description:"Balance (Coarse)",position:"msb"},{number:9,name:"controller9",description:"Controller 9 (Coarse)",position:"msb"},{number:10,name:"pancoarse",description:"Pan (Coarse)",position:"msb"},{number:11,name:"expressioncoarse",description:"Expression Controller (Coarse)",position:"msb"},{number:12,name:"effectcontrol1coarse",description:"Effect Control 1 (Coarse)",position:"msb"},{number:13,name:"effectcontrol2coarse",description:"Effect Control 2 (Coarse)",position:"msb"},{number:14,name:"controller14",description:"Undefined",position:"msb"},{number:15,name:"controller15",description:"Undefined",position:"msb"},{number:16,name:"generalpurposecontroller1",description:"General Purpose Controller 1 (Coarse)",position:"msb"},{number:17,name:"generalpurposecontroller2",description:"General Purpose Controller 2 (Coarse)",position:"msb"},{number:18,name:"generalpurposecontroller3",description:"General Purpose Controller 3 (Coarse)",position:"msb"},{number:19,name:"generalpurposecontroller4",description:"General Purpose Controller 4 (Coarse)",position:"msb"},{number:20,name:"controller20",description:"Undefined",position:"msb"},{number:21,name:"controller21",description:"Undefined",position:"msb"},{number:22,name:"controller22",description:"Undefined",position:"msb"},{number:23,name:"controller23",description:"Undefined",position:"msb"},{number:24,name:"controller24",description:"Undefined",position:"msb"},{number:25,name:"controller25",description:"Undefined",position:"msb"},{number:26,name:"controller26",description:"Undefined",position:"msb"},{number:27,name:"controller27",description:"Undefined",position:"msb"},{number:28,name:"controller28",description:"Undefined",position:"msb"},{number:29,name:"controller29",description:"Undefined",position:"msb"},{number:30,name:"controller30",description:"Undefined",position:"msb"},{number:31,name:"controller31",description:"Undefined",position:"msb"},{number:32,name:"bankselectfine",description:"Bank Select (Fine)",position:"lsb"},{number:33,name:"modulationwheelfine",description:"Modulation Wheel (Fine)",position:"lsb"},{number:34,name:"breathcontrollerfine",description:"Breath Controller (Fine)",position:"lsb"},{number:35,name:"controller35",description:"Undefined",position:"lsb"},{number:36,name:"footcontrollerfine",description:"Foot Controller (Fine)",position:"lsb"},{number:37,name:"portamentotimefine",description:"Portamento Time (Fine)",position:"lsb"},{number:38,name:"dataentryfine",description:"Data Entry (Fine)",position:"lsb"},{number:39,name:"channelvolumefine",description:"Channel Volume (Fine)",position:"lsb"},{number:40,name:"balancefine",description:"Balance (Fine)",position:"lsb"},{number:41,name:"controller41",description:"Undefined",position:"lsb"},{number:42,name:"panfine",description:"Pan (Fine)",position:"lsb"},{number:43,name:"expressionfine",description:"Expression Controller (Fine)",position:"lsb"},{number:44,name:"effectcontrol1fine",description:"Effect control 1 (Fine)",position:"lsb"},{number:45,name:"effectcontrol2fine",description:"Effect control 2 (Fine)",position:"lsb"},{number:46,name:"controller46",description:"Undefined",position:"lsb"},{number:47,name:"controller47",description:"Undefined",position:"lsb"},{number:48,name:"controller48",description:"General Purpose Controller 1 (Fine)",position:"lsb"},{number:49,name:"controller49",description:"General Purpose Controller 2 (Fine)",position:"lsb"},{number:50,name:"controller50",description:"General Purpose Controller 3 (Fine)",position:"lsb"},{number:51,name:"controller51",description:"General Purpose Controller 4 (Fine)",position:"lsb"},{number:52,name:"controller52",description:"Undefined",position:"lsb"},{number:53,name:"controller53",description:"Undefined",position:"lsb"},{number:54,name:"controller54",description:"Undefined",position:"lsb"},{number:55,name:"controller55",description:"Undefined",position:"lsb"},{number:56,name:"controller56",description:"Undefined",position:"lsb"},{number:57,name:"controller57",description:"Undefined",position:"lsb"},{number:58,name:"controller58",description:"Undefined",position:"lsb"},{number:59,name:"controller59",description:"Undefined",position:"lsb"},{number:60,name:"controller60",description:"Undefined",position:"lsb"},{number:61,name:"controller61",description:"Undefined",position:"lsb"},{number:62,name:"controller62",description:"Undefined",position:"lsb"},{number:63,name:"controller63",description:"Undefined",position:"lsb"},{number:64,name:"damperpedal",description:"Damper Pedal On/Off"},{number:65,name:"portamento",description:"Portamento On/Off"},{number:66,name:"sostenuto",description:"Sostenuto On/Off"},{number:67,name:"softpedal",description:"Soft Pedal On/Off"},{number:68,name:"legatopedal",description:"Legato Pedal On/Off"},{number:69,name:"hold2",description:"Hold 2 On/Off"},{number:70,name:"soundvariation",description:"Sound Variation",position:"lsb"},{number:71,name:"resonance",description:"Resonance",position:"lsb"},{number:72,name:"releasetime",description:"Release Time",position:"lsb"},{number:73,name:"attacktime",description:"Attack Time",position:"lsb"},{number:74,name:"brightness",description:"Brightness",position:"lsb"},{number:75,name:"decaytime",description:"Decay Time",position:"lsb"},{number:76,name:"vibratorate",description:"Vibrato Rate",position:"lsb"},{number:77,name:"vibratodepth",description:"Vibrato Depth",position:"lsb"},{number:78,name:"vibratodelay",description:"Vibrato Delay",position:"lsb"},{number:79,name:"controller79",description:"Undefined",position:"lsb"},{number:80,name:"generalpurposecontroller5",description:"General Purpose Controller 5",position:"lsb"},{number:81,name:"generalpurposecontroller6",description:"General Purpose Controller 6",position:"lsb"},{number:82,name:"generalpurposecontroller7",description:"General Purpose Controller 7",position:"lsb"},{number:83,name:"generalpurposecontroller8",description:"General Purpose Controller 8",position:"lsb"},{number:84,name:"portamentocontrol",description:"Portamento Control",position:"lsb"},{number:85,name:"controller85",description:"Undefined"},{number:86,name:"controller86",description:"Undefined"},{number:87,name:"controller87",description:"Undefined"},{number:88,name:"highresolutionvelocityprefix",description:"High Resolution Velocity Prefix",position:"lsb"},{number:89,name:"controller89",description:"Undefined"},{number:90,name:"controller90",description:"Undefined"},{number:91,name:"effect1depth",description:"Effects 1 Depth (Reverb Send Level)"},{number:92,name:"effect2depth",description:"Effects 2 Depth"},{number:93,name:"effect3depth",description:"Effects 3 Depth (Chorus Send Level)"},{number:94,name:"effect4depth",description:"Effects 4 Depth"},{number:95,name:"effect5depth",description:"Effects 5 Depth"},{number:96,name:"dataincrement",description:"Data Increment"},{number:97,name:"datadecrement",description:"Data Decrement"},{number:98,name:"nonregisteredparameterfine",description:"Non-Registered Parameter Number (Fine)",position:"lsb"},{number:99,name:"nonregisteredparametercoarse",description:"Non-Registered Parameter Number (Coarse)",position:"msb"},{number:100,name:"registeredparameterfine",description:"Registered Parameter Number (Fine)",position:"lsb"},{number:101,name:"registeredparametercoarse",description:"Registered Parameter Number (Coarse)",position:"msb"},{number:102,name:"controller102",description:"Undefined"},{number:103,name:"controller103",description:"Undefined"},{number:104,name:"controller104",description:"Undefined"},{number:105,name:"controller105",description:"Undefined"},{number:106,name:"controller106",description:"Undefined"},{number:107,name:"controller107",description:"Undefined"},{number:108,name:"controller108",description:"Undefined"},{number:109,name:"controller109",description:"Undefined"},{number:110,name:"controller110",description:"Undefined"},{number:111,name:"controller111",description:"Undefined"},{number:112,name:"controller112",description:"Undefined"},{number:113,name:"controller113",description:"Undefined"},{number:114,name:"controller114",description:"Undefined"},{number:115,name:"controller115",description:"Undefined"},{number:116,name:"controller116",description:"Undefined"},{number:117,name:"controller117",description:"Undefined"},{number:118,name:"controller118",description:"Undefined"},{number:119,name:"controller119",description:"Undefined"},{number:120,name:"allsoundoff",description:"All Sound Off"},{number:121,name:"resetallcontrollers",description:"Reset All Controllers"},{number:122,name:"localcontrol",description:"Local Control On/Off"},{number:123,name:"allnotesoff",description:"All Notes Off"},{number:124,name:"omnimodeoff",description:"Omni Mode Off"},{number:125,name:"omnimodeon",description:"Omni Mode On"},{number:126,name:"monomodeon",description:"Mono Mode On"},{number:127,name:"polymodeon",description:"Poly Mode On"}]}static get REGISTERED_PARAMETERS(){return{pitchbendrange:[0,0],channelfinetuning:[0,1],channelcoarsetuning:[0,2],tuningprogram:[0,3],tuningbank:[0,4],modulationrange:[0,5],azimuthangle:[61,0],elevationangle:[61,1],gain:[61,2],distanceratio:[61,3],maximumdistance:[61,4],maximumdistancegain:[61,5],referencedistanceratio:[61,6],panspreadangle:[61,7],rollangle:[61,8]}}static get MIDI_REGISTERED_PARAMETERS(){return this.validation&&console.warn("The MIDI_REGISTERED_PARAMETERS enum has been deprecated. Use the Enumerations.REGISTERED_PARAMETERS enum instead."),Enumerations.MIDI_REGISTERED_PARAMETERS}static get SYSTEM_MESSAGES(){return{sysex:240,timecode:241,songposition:242,songselect:243,tunerequest:246,tuningrequest:246,sysexend:247,clock:248,start:250,continue:251,stop:252,activesensing:254,reset:255,midimessage:0,unknownsystemmessage:-1}}static get MIDI_SYSTEM_MESSAGES(){return this.validation&&console.warn("The MIDI_SYSTEM_MESSAGES enum has been deprecated. Use the Enumerations.SYSTEM_MESSAGES enum instead."),Enumerations.SYSTEM_MESSAGES}static get CHANNEL_EVENTS(){return["noteoff","controlchange","noteon","keyaftertouch","programchange","channelaftertouch","pitchbend","allnotesoff","allsoundoff","localcontrol","monomode","omnimode","resetallcontrollers","nrpn","nrpn-dataentrycoarse","nrpn-dataentryfine","nrpn-dataincrement","nrpn-datadecrement","rpn","rpn-dataentrycoarse","rpn-dataentryfine","rpn-dataincrement","rpn-datadecrement","nrpn-databuttonincrement","nrpn-databuttondecrement","rpn-databuttonincrement","rpn-databuttondecrement"]}}/**
|
||
* The `Note` class represents a single musical note such as `"D3"`, `"G#4"`, `"F-1"`, `"Gb7"`, etc.
|
||
*
|
||
* `Note` objects can be played back on a single channel by calling
|
||
* [`OutputChannel.playNote()`]{@link OutputChannel#playNote} or, on multiple channels of the same
|
||
* output, by calling [`Output.playNote()`]{@link Output#playNote}.
|
||
*
|
||
* The note has [`attack`](#attack) and [`release`](#release) velocities set at `0.5` by default.
|
||
* These can be changed by passing in the appropriate option. It is also possible to set a
|
||
* system-wide default for attack and release velocities by using the
|
||
* [`WebMidi.defaults`](WebMidi#defaults) property.
|
||
*
|
||
* If you prefer to work with raw MIDI values (`0` to `127`), you can use [`rawAttack`](#rawAttack) and
|
||
* [`rawRelease`](#rawRelease) to both get and set the values.
|
||
*
|
||
* The note may have a [`duration`](#duration). If it does, playback will be automatically stopped
|
||
* when the duration has elapsed by sending a `"noteoff"` event. By default, the duration is set to
|
||
* `Infinity`. In this case, it will never stop playing unless explicitly stopped by calling a
|
||
* method such as [`OutputChannel.stopNote()`]{@link OutputChannel#stopNote},
|
||
* [`Output.stopNote()`]{@link Output#stopNote} or similar.
|
||
*
|
||
* @license Apache-2.0
|
||
* @since 3.0.0
|
||
*/class Note{constructor(e,l={}){this.duration=wm.defaults.note.duration,this.attack=wm.defaults.note.attack,this.release=wm.defaults.note.release,l.duration!=null&&(this.duration=l.duration),l.attack!=null&&(this.attack=l.attack),l.rawAttack!=null&&(this.attack=Utilities.from7bitToFloat(l.rawAttack)),l.release!=null&&(this.release=l.release),l.rawRelease!=null&&(this.release=Utilities.from7bitToFloat(l.rawRelease)),Number.isInteger(e)?this.identifier=Utilities.toNoteIdentifier(e):this.identifier=e}get identifier(){return this._name+(this._accidental||"")+this._octave}set identifier(e){const l=Utilities.getNoteDetails(e);if(wm.validation&&!e)throw new Error("Invalid note identifier");this._name=l.name,this._accidental=l.accidental,this._octave=l.octave}get name(){return this._name}set name(e){if(wm.validation&&(e=e.toUpperCase(),!["C","D","E","F","G","A","B"].includes(e)))throw new Error("Invalid name value");this._name=e}get accidental(){return this._accidental}set accidental(e){if(wm.validation&&(e=e.toLowerCase(),!["#","##","b","bb"].includes(e)))throw new Error("Invalid accidental value");this._accidental=e}get octave(){return this._octave}set octave(e){if(wm.validation&&(e=parseInt(e),isNaN(e)))throw new Error("Invalid octave value");this._octave=e}get duration(){return this._duration}set duration(e){if(wm.validation&&(e=parseFloat(e),isNaN(e)||e===null||e<0))throw new RangeError("Invalid duration value.");this._duration=e}get attack(){return this._attack}set attack(e){if(wm.validation&&(e=parseFloat(e),isNaN(e)||!(e>=0&&e<=1)))throw new RangeError("Invalid attack value.");this._attack=e}get release(){return this._release}set release(e){if(wm.validation&&(e=parseFloat(e),isNaN(e)||!(e>=0&&e<=1)))throw new RangeError("Invalid release value.");this._release=e}get rawAttack(){return Utilities.fromFloatTo7Bit(this._attack)}set rawAttack(e){this._attack=Utilities.from7bitToFloat(e)}get rawRelease(){return Utilities.fromFloatTo7Bit(this._release)}set rawRelease(e){this._release=Utilities.from7bitToFloat(e)}get number(){return Utilities.toNoteNumber(this.identifier)}getOffsetNumber(e=0,l=0){return wm.validation&&(e=parseInt(e)||0,l=parseInt(l)||0),Math.min(Math.max(this.number+e*12+l,0),127)}}/**
|
||
* The `Utilities` class contains general-purpose utility methods. All methods are static and
|
||
* should be called using the class name. For example: `Utilities.getNoteDetails("C4")`.
|
||
*
|
||
* @license Apache-2.0
|
||
* @since 3.0.0
|
||
*/class Utilities{static toNoteNumber(e,l=0){if(l=l==null?0:parseInt(l),isNaN(l))throw new RangeError("Invalid 'octaveOffset' value");typeof e!="string"&&(e="");const d=this.getNoteDetails(e);if(!d)throw new TypeError("Invalid note identifier");const p={C:0,D:2,E:4,F:5,G:7,A:9,B:11};let b=(d.octave+1+l)*12;if(b+=p[d.name],d.accidental&&(d.accidental.startsWith("b")?b-=d.accidental.length:b+=d.accidental.length),b<0||b>127)throw new RangeError("Invalid octaveOffset value");return b}static getNoteDetails(e){Number.isInteger(e)&&(e=this.toNoteIdentifier(e));const l=e.match(/^([CDEFGAB])(#{0,2}|b{0,2})(-?\d+)$/i);if(!l)throw new TypeError("Invalid note identifier");const d=l[1].toUpperCase(),p=parseInt(l[3]);let b=l[2].toLowerCase();return b=b===""?void 0:b,{accidental:b,identifier:d+(b||"")+p,name:d,octave:p}}static sanitizeChannels(e){let l;if(wm.validation){if(e==="all")l=["all"];else if(e==="none")return[]}return Array.isArray(e)?l=e:l=[e],l.indexOf("all")>-1&&(l=Enumerations.MIDI_CHANNEL_NUMBERS),l.map(function(d){return parseInt(d)}).filter(function(d){return d>=1&&d<=16})}static toTimestamp(e){let l=!1;const d=parseFloat(e);return isNaN(d)?!1:(typeof e=="string"&&e.substring(0,1)==="+"?d>=0&&(l=wm.time+d):d>=0&&(l=d),l)}static guessNoteNumber(e,l){l=parseInt(l)||0;let d=!1;if(Number.isInteger(e)&&e>=0&&e<=127)d=parseInt(e);else if(parseInt(e)>=0&&parseInt(e)<=127)d=parseInt(e);else if(typeof e=="string"||e instanceof String)try{d=this.toNoteNumber(e.trim(),l)}catch{return!1}return d}static toNoteIdentifier(e,l){if(e=parseInt(e),isNaN(e)||e<0||e>127)throw new RangeError("Invalid note number");if(l=l==null?0:parseInt(l),isNaN(l))throw new RangeError("Invalid octaveOffset value");const d=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],p=Math.floor(e/12-1)+l;return d[e%12]+p.toString()}static buildNote(e,l={}){if(l.octaveOffset=parseInt(l.octaveOffset)||0,e instanceof Note)return e;let d=this.guessNoteNumber(e,l.octaveOffset);if(d===!1)throw new TypeError(`The input could not be parsed as a note (${e})`);return l.octaveOffset=void 0,new Note(d,l)}static buildNoteArray(e,l={}){let d=[];return Array.isArray(e)||(e=[e]),e.forEach(p=>{d.push(this.buildNote(p,l))}),d}static from7bitToFloat(e){return e===1/0&&(e=127),e=parseInt(e)||0,Math.min(Math.max(e/127,0),1)}static fromFloatTo7Bit(e){return e===1/0&&(e=1),e=parseFloat(e)||0,Math.min(Math.max(Math.round(e*127),0),127)}static fromMsbLsbToFloat(e,l=0){wm.validation&&(e=Math.min(Math.max(parseInt(e)||0,0),127),l=Math.min(Math.max(parseInt(l)||0,0),127));const d=((e<<7)+l)/16383;return Math.min(Math.max(d,0),1)}static fromFloatToMsbLsb(e){wm.validation&&(e=Math.min(Math.max(parseFloat(e)||0,0),1));const l=Math.round(e*16383);return{msb:l>>7,lsb:l&127}}static offsetNumber(e,l=0,d=0){if(wm.validation){if(e=parseInt(e),isNaN(e))throw new Error("Invalid note number");l=parseInt(l)||0,d=parseInt(d)||0}return Math.min(Math.max(e+l*12+d,0),127)}static getPropertyByValue(e,l){return Object.keys(e).find(d=>e[d]===l)}static getCcNameByNumber(e){if(!(wm.validation&&(e=parseInt(e),!(e>=0&&e<=127))))return Enumerations.CONTROL_CHANGE_MESSAGES[e].name}static getCcNumberByName(e){let l=Enumerations.CONTROL_CHANGE_MESSAGES.find(d=>d.name===e);return l?l.number:Enumerations.MIDI_CONTROL_CHANGE_MESSAGES[e]}static getChannelModeByNumber(e){if(!(e>=120&&e<=127))return!1;for(let l in Enumerations.CHANNEL_MODE_MESSAGES)if(Enumerations.CHANNEL_MODE_MESSAGES.hasOwnProperty(l)&&e===Enumerations.CHANNEL_MODE_MESSAGES[l])return l;return!1}static get isNode(){return typeof process<"u"&&process.versions!=null&&process.versions.node!=null}static get isBrowser(){return typeof window<"u"&&typeof window.document<"u"}}/**
|
||
* The `OutputChannel` class represents a single output MIDI channel. `OutputChannel` objects are
|
||
* provided by an [`Output`](Output) port which, itself, is made available by a device. The
|
||
* `OutputChannel` object is derived from the host's MIDI subsystem and should not be instantiated
|
||
* directly.
|
||
*
|
||
* All 16 `OutputChannel` objects can be found inside the parent output's
|
||
* [`channels`]{@link Output#channels} property.
|
||
*
|
||
* @param {Output} output The [`Output`](Output) this channel belongs to.
|
||
* @param {number} number The MIDI channel number (`1` - `16`).
|
||
*
|
||
* @extends EventEmitter
|
||
* @license Apache-2.0
|
||
* @since 3.0.0
|
||
*/class OutputChannel extends EventEmitter{constructor(e,l){super(),this._output=e,this._number=l,this._octaveOffset=0}destroy(){this._output=null,this._number=null,this._octaveOffset=0,this.removeListener()}send(e,l={time:0}){return this.output.send(e,l),this}sendKeyAftertouch(e,l,d={}){if(wm.validation){if(d.useRawValue&&(d.rawValue=d.useRawValue),isNaN(parseFloat(l)))throw new RangeError("Invalid key aftertouch value.");if(d.rawValue){if(!(l>=0&&l<=127&&Number.isInteger(l)))throw new RangeError("Key aftertouch raw value must be an integer between 0 and 127.")}else if(!(l>=0&&l<=1))throw new RangeError("Key aftertouch value must be a float between 0 and 1.")}d.rawValue||(l=Utilities.fromFloatTo7Bit(l));const p=wm.octaveOffset+this.output.octaveOffset+this.octaveOffset;return Array.isArray(e)||(e=[e]),Utilities.buildNoteArray(e).forEach(b=>{this.send([(Enumerations.CHANNEL_MESSAGES.keyaftertouch<<4)+(this.number-1),b.getOffsetNumber(p),l],{time:Utilities.toTimestamp(d.time)})}),this}sendControlChange(e,l,d={}){if(typeof e=="string"&&(e=Utilities.getCcNumberByName(e)),Array.isArray(l)||(l=[l]),wm.validation){if(e===void 0)throw new TypeError("Control change must be identified with a valid name or an integer between 0 and 127.");if(!Number.isInteger(e)||!(e>=0&&e<=127))throw new TypeError("Control change number must be an integer between 0 and 127.");if(l=l.map(p=>{const b=Math.min(Math.max(parseInt(p),0),127);if(isNaN(b))throw new TypeError("Values must be integers between 0 and 127");return b}),l.length===2&&e>=32)throw new TypeError("To use a value array, the controller must be between 0 and 31")}return l.forEach((p,b)=>{this.send([(Enumerations.CHANNEL_MESSAGES.controlchange<<4)+(this.number-1),e+b*32,l[b]],{time:Utilities.toTimestamp(d.time)})}),this}_selectNonRegisteredParameter(e,l={}){return this.sendControlChange(99,e[0],l),this.sendControlChange(98,e[1],l),this}_deselectRegisteredParameter(e={}){return this.sendControlChange(101,127,e),this.sendControlChange(100,127,e),this}_deselectNonRegisteredParameter(e={}){return this.sendControlChange(101,127,e),this.sendControlChange(100,127,e),this}_selectRegisteredParameter(e,l={}){return this.sendControlChange(101,e[0],l),this.sendControlChange(100,e[1],l),this}_setCurrentParameter(e,l={}){return e=[].concat(e),this.sendControlChange(6,e[0],l),e.length<2?this:(this.sendControlChange(38,e[1],l),this)}sendRpnDecrement(e,l={}){if(Array.isArray(e)||(e=Enumerations.REGISTERED_PARAMETERS[e]),wm.validation){if(e===void 0)throw new TypeError("The specified registered parameter is invalid.");let d=!1;if(Object.getOwnPropertyNames(Enumerations.REGISTERED_PARAMETERS).forEach(p=>{Enumerations.REGISTERED_PARAMETERS[p][0]===e[0]&&Enumerations.REGISTERED_PARAMETERS[p][1]===e[1]&&(d=!0)}),!d)throw new TypeError("The specified registered parameter is invalid.")}return this._selectRegisteredParameter(e,l),this.sendControlChange(97,0,l),this._deselectRegisteredParameter(l),this}sendRpnIncrement(e,l={}){if(Array.isArray(e)||(e=Enumerations.REGISTERED_PARAMETERS[e]),wm.validation){if(e===void 0)throw new TypeError("The specified registered parameter is invalid.");let d=!1;if(Object.getOwnPropertyNames(Enumerations.REGISTERED_PARAMETERS).forEach(p=>{Enumerations.REGISTERED_PARAMETERS[p][0]===e[0]&&Enumerations.REGISTERED_PARAMETERS[p][1]===e[1]&&(d=!0)}),!d)throw new TypeError("The specified registered parameter is invalid.")}return this._selectRegisteredParameter(e,l),this.sendControlChange(96,0,l),this._deselectRegisteredParameter(l),this}playNote(e,l={}){this.sendNoteOn(e,l);const d=Array.isArray(e)?e:[e];for(let p of d)if(parseInt(p.duration)>0){const b={time:(Utilities.toTimestamp(l.time)||wm.time)+parseInt(p.duration),release:p.release,rawRelease:p.rawRelease};this.sendNoteOff(p,b)}else if(parseInt(l.duration)>0){const b={time:(Utilities.toTimestamp(l.time)||wm.time)+parseInt(l.duration),release:l.release,rawRelease:l.rawRelease};this.sendNoteOff(p,b)}return this}sendNoteOff(e,l={}){if(wm.validation){if(l.rawRelease!=null&&!(l.rawRelease>=0&&l.rawRelease<=127))throw new RangeError("The 'rawRelease' option must be an integer between 0 and 127");if(l.release!=null&&!(l.release>=0&&l.release<=1))throw new RangeError("The 'release' option must be an number between 0 and 1");l.rawVelocity&&(l.rawRelease=l.velocity,console.warn("The 'rawVelocity' option is deprecated. Use 'rawRelease' instead.")),l.velocity&&(l.release=l.velocity,console.warn("The 'velocity' option is deprecated. Use 'attack' instead."))}let d=64;l.rawRelease!=null?d=l.rawRelease:isNaN(l.release)||(d=Math.round(l.release*127));const p=wm.octaveOffset+this.output.octaveOffset+this.octaveOffset;return Utilities.buildNoteArray(e,{rawRelease:parseInt(d)}).forEach(b=>{this.send([(Enumerations.CHANNEL_MESSAGES.noteoff<<4)+(this.number-1),b.getOffsetNumber(p),b.rawRelease],{time:Utilities.toTimestamp(l.time)})}),this}stopNote(e,l={}){return this.sendNoteOff(e,l)}sendNoteOn(e,l={}){if(wm.validation){if(l.rawAttack!=null&&!(l.rawAttack>=0&&l.rawAttack<=127))throw new RangeError("The 'rawAttack' option must be an integer between 0 and 127");if(l.attack!=null&&!(l.attack>=0&&l.attack<=1))throw new RangeError("The 'attack' option must be an number between 0 and 1");l.rawVelocity&&(l.rawAttack=l.velocity,l.rawRelease=l.release,console.warn("The 'rawVelocity' option is deprecated. Use 'rawAttack' or 'rawRelease'.")),l.velocity&&(l.attack=l.velocity,console.warn("The 'velocity' option is deprecated. Use 'attack' instead."))}let d=64;l.rawAttack!=null?d=l.rawAttack:isNaN(l.attack)||(d=Math.round(l.attack*127));const p=wm.octaveOffset+this.output.octaveOffset+this.octaveOffset;return Utilities.buildNoteArray(e,{rawAttack:d}).forEach(b=>{this.send([(Enumerations.CHANNEL_MESSAGES.noteon<<4)+(this.number-1),b.getOffsetNumber(p),b.rawAttack],{time:Utilities.toTimestamp(l.time)})}),this}sendChannelMode(e,l=0,d={}){if(typeof e=="string"&&(e=Enumerations.CHANNEL_MODE_MESSAGES[e]),wm.validation){if(e===void 0)throw new TypeError("Invalid channel mode message name or number.");if(isNaN(e)||!(e>=120&&e<=127))throw new TypeError("Invalid channel mode message number.");if(isNaN(parseInt(l))||l<0||l>127)throw new RangeError("Value must be an integer between 0 and 127.")}return this.send([(Enumerations.CHANNEL_MESSAGES.controlchange<<4)+(this.number-1),e,l],{time:Utilities.toTimestamp(d.time)}),this}sendOmniMode(e,l={}){return e===void 0||e?this.sendChannelMode("omnimodeon",0,l):this.sendChannelMode("omnimodeoff",0,l),this}sendChannelAftertouch(e,l={}){if(wm.validation){if(isNaN(parseFloat(e)))throw new RangeError("Invalid channel aftertouch value.");if(l.rawValue){if(!(e>=0&&e<=127&&Number.isInteger(e)))throw new RangeError("Channel aftertouch raw value must be an integer between 0 and 127.")}else if(!(e>=0&&e<=1))throw new RangeError("Channel aftertouch value must be a float between 0 and 1.")}return l.rawValue||(e=Utilities.fromFloatTo7Bit(e)),this.send([(Enumerations.CHANNEL_MESSAGES.channelaftertouch<<4)+(this.number-1),Math.round(e)],{time:Utilities.toTimestamp(l.time)}),this}sendMasterTuning(e,l={}){if(e=parseFloat(e)||0,wm.validation&&!(e>-65&&e<64))throw new RangeError("The value must be a decimal number larger than -65 and smaller than 64.");let d=Math.floor(e)+64,p=e-Math.floor(e);p=Math.round((p+1)/2*16383);let b=p>>7&127,R=p&127;return this.sendRpnValue("channelcoarsetuning",d,l),this.sendRpnValue("channelfinetuning",[b,R],l),this}sendModulationRange(e,l,d={}){if(wm.validation){if(!Number.isInteger(e)||!(e>=0&&e<=127))throw new RangeError("The semitones value must be an integer between 0 and 127.");if(l!=null&&(!Number.isInteger(l)||!(l>=0&&l<=127)))throw new RangeError("If specified, the cents value must be an integer between 0 and 127.")}return l>=0&&l<=127||(l=0),this.sendRpnValue("modulationrange",[e,l],d),this}sendNrpnValue(e,l,d={}){if(l=[].concat(l),wm.validation){if(!Array.isArray(e)||!Number.isInteger(e[0])||!Number.isInteger(e[1]))throw new TypeError("The specified NRPN is invalid.");if(!(e[0]>=0&&e[0]<=127))throw new RangeError("The first byte of the NRPN must be between 0 and 127.");if(!(e[1]>=0&&e[1]<=127))throw new RangeError("The second byte of the NRPN must be between 0 and 127.");l.forEach(p=>{if(!(p>=0&&p<=127))throw new RangeError("The data bytes of the NRPN must be between 0 and 127.")})}return this._selectNonRegisteredParameter(e,d),this._setCurrentParameter(l,d),this._deselectNonRegisteredParameter(d),this}sendPitchBend(e,l={}){if(wm.validation)if(l.rawValue&&Array.isArray(e)){if(!(e[0]>=0&&e[0]<=127))throw new RangeError("The pitch bend MSB must be an integer between 0 and 127.");if(!(e[1]>=0&&e[1]<=127))throw new RangeError("The pitch bend LSB must be an integer between 0 and 127.")}else if(l.rawValue&&!Array.isArray(e)){if(!(e>=0&&e<=127))throw new RangeError("The pitch bend MSB must be an integer between 0 and 127.")}else{if(isNaN(e)||e===null)throw new RangeError("Invalid pitch bend value.");if(!(e>=-1&&e<=1))throw new RangeError("The pitch bend value must be a float between -1 and 1.")}let d=0,p=0;if(l.rawValue&&Array.isArray(e))d=e[0],p=e[1];else if(l.rawValue&&!Array.isArray(e))d=e;else{const b=Utilities.fromFloatToMsbLsb((e+1)/2);d=b.msb,p=b.lsb}return this.send([(Enumerations.CHANNEL_MESSAGES.pitchbend<<4)+(this.number-1),p,d],{time:Utilities.toTimestamp(l.time)}),this}sendPitchBendRange(e,l,d={}){if(wm.validation){if(!Number.isInteger(e)||!(e>=0&&e<=127))throw new RangeError("The semitones value must be an integer between 0 and 127.");if(!Number.isInteger(l)||!(l>=0&&l<=127))throw new RangeError("The cents value must be an integer between 0 and 127.")}return this.sendRpnValue("pitchbendrange",[e,l],d),this}sendProgramChange(e,l={}){if(e=parseInt(e)||0,wm.validation&&!(e>=0&&e<=127))throw new RangeError("The program number must be between 0 and 127.");return this.send([(Enumerations.CHANNEL_MESSAGES.programchange<<4)+(this.number-1),e],{time:Utilities.toTimestamp(l.time)}),this}sendRpnValue(e,l,d={}){if(Array.isArray(e)||(e=Enumerations.REGISTERED_PARAMETERS[e]),wm.validation){if(!Number.isInteger(e[0])||!Number.isInteger(e[1]))throw new TypeError("The specified NRPN is invalid.");if(!(e[0]>=0&&e[0]<=127))throw new RangeError("The first byte of the RPN must be between 0 and 127.");if(!(e[1]>=0&&e[1]<=127))throw new RangeError("The second byte of the RPN must be between 0 and 127.");[].concat(l).forEach(p=>{if(!(p>=0&&p<=127))throw new RangeError("The data bytes of the RPN must be between 0 and 127.")})}return this._selectRegisteredParameter(e,d),this._setCurrentParameter(l,d),this._deselectRegisteredParameter(d),this}sendTuningBank(e,l={}){if(wm.validation&&(!Number.isInteger(e)||!(e>=0&&e<=127)))throw new RangeError("The tuning bank number must be between 0 and 127.");return this.sendRpnValue("tuningbank",e,l),this}sendTuningProgram(e,l={}){if(wm.validation&&(!Number.isInteger(e)||!(e>=0&&e<=127)))throw new RangeError("The tuning program number must be between 0 and 127.");return this.sendRpnValue("tuningprogram",e,l),this}sendLocalControl(e,l={}){return e?this.sendChannelMode("localcontrol",127,l):this.sendChannelMode("localcontrol",0,l)}sendAllNotesOff(e={}){return this.sendChannelMode("allnotesoff",0,e)}sendAllSoundOff(e={}){return this.sendChannelMode("allsoundoff",0,e)}sendResetAllControllers(e={}){return this.sendChannelMode("resetallcontrollers",0,e)}sendPolyphonicMode(e,l={}){return e==="mono"?this.sendChannelMode("monomodeon",0,l):this.sendChannelMode("polymodeon",0,l)}get octaveOffset(){return this._octaveOffset}set octaveOffset(e){if(this.validation&&(e=parseInt(e),isNaN(e)))throw new TypeError("The 'octaveOffset' property must be an integer.");this._octaveOffset=e}get output(){return this._output}get number(){return this._number}}/**
|
||
* The `Output` class represents a single MIDI output port (not to be confused with a MIDI channel).
|
||
* A port is made available by a MIDI device. A MIDI device can advertise several input and output
|
||
* ports. Each port has 16 MIDI channels which can be accessed via the [`channels`](#channels)
|
||
* property.
|
||
*
|
||
* The `Output` object is automatically instantiated by the library according to the host's MIDI
|
||
* subsystem and should not be directly instantiated.
|
||
*
|
||
* You can access all available `Output` objects by referring to the
|
||
* [`WebMidi.outputs`](WebMidi#outputs) array or by using methods such as
|
||
* [`WebMidi.getOutputByName()`](WebMidi#getOutputByName) or
|
||
* [`WebMidi.getOutputById()`](WebMidi#getOutputById).
|
||
*
|
||
* @fires Output#opened
|
||
* @fires Output#disconnected
|
||
* @fires Output#closed
|
||
*
|
||
* @extends EventEmitter
|
||
* @license Apache-2.0
|
||
*/class Output extends EventEmitter{constructor(e){super(),this._midiOutput=e,this._octaveOffset=0,this.channels=[];for(let l=1;l<=16;l++)this.channels[l]=new OutputChannel(this,l);this._midiOutput.onstatechange=this._onStateChange.bind(this)}async destroy(){this.removeListener(),this.channels.forEach(e=>e.destroy()),this.channels=[],this._midiOutput&&(this._midiOutput.onstatechange=null),await this.close(),this._midiOutput=null}_onStateChange(e){let l={timestamp:wm.time};e.port.connection==="open"?(l.type="opened",l.target=this,l.port=l.target,this.emit("opened",l)):e.port.connection==="closed"&&e.port.state==="connected"?(l.type="closed",l.target=this,l.port=l.target,this.emit("closed",l)):e.port.connection==="closed"&&e.port.state==="disconnected"?(l.type="disconnected",l.port={connection:e.port.connection,id:e.port.id,manufacturer:e.port.manufacturer,name:e.port.name,state:e.port.state,type:e.port.type},this.emit("disconnected",l)):e.port.connection==="pending"&&e.port.state==="disconnected"||console.warn("This statechange event was not caught:",e.port.connection,e.port.state)}async open(){try{return await this._midiOutput.open(),Promise.resolve(this)}catch(e){return Promise.reject(e)}}async close(){this._midiOutput?await this._midiOutput.close():await Promise.resolve()}send(e,l={time:0},d=0){if(e instanceof Message&&(e=Utilities.isNode?e.data:e.rawData),e instanceof Uint8Array&&Utilities.isNode&&(e=Array.from(e)),wm.validation){if(!Array.isArray(e)&&!(e instanceof Uint8Array)&&(e=[e],Array.isArray(l)&&(e=e.concat(l)),l=isNaN(d)?{time:0}:{time:d}),!(parseInt(e[0])>=128&&parseInt(e[0])<=255))throw new RangeError("The first byte (status) must be an integer between 128 and 255.");e.slice(1).forEach(p=>{if(p=parseInt(p),!(p>=0&&p<=255))throw new RangeError("Data bytes must be integers between 0 and 255.")}),l||(l={time:0})}return this._midiOutput.send(e,Utilities.toTimestamp(l.time)),this}sendSysex(e,l=[],d={}){if(e=[].concat(e),l instanceof Uint8Array){const p=new Uint8Array(1+e.length+l.length+1);p[0]=Enumerations.SYSTEM_MESSAGES.sysex,p.set(Uint8Array.from(e),1),p.set(l,1+e.length),p[p.length-1]=Enumerations.SYSTEM_MESSAGES.sysexend,this.send(p,{time:d.time})}else{const p=e.concat(l,Enumerations.SYSTEM_MESSAGES.sysexend);this.send([Enumerations.SYSTEM_MESSAGES.sysex].concat(p),{time:d.time})}return this}clear(){return this._midiOutput.clear?this._midiOutput.clear():wm.validation&&console.warn("The 'clear()' method has not yet been implemented in your environment."),this}sendTimecodeQuarterFrame(e,l={}){if(wm.validation&&(e=parseInt(e),isNaN(e)||!(e>=0&&e<=127)))throw new RangeError("The value must be an integer between 0 and 127.");return this.send([Enumerations.SYSTEM_MESSAGES.timecode,e],{time:l.time}),this}sendSongPosition(e=0,l={}){e=Math.floor(e)||0;var d=e>>7&127,p=e&127;return this.send([Enumerations.SYSTEM_MESSAGES.songposition,d,p],{time:l.time}),this}sendSongSelect(e=0,l={}){if(wm.validation&&(e=parseInt(e),isNaN(e)||!(e>=0&&e<=127)))throw new RangeError("The program value must be between 0 and 127");return this.send([Enumerations.SYSTEM_MESSAGES.songselect,e],{time:l.time}),this}sendTuneRequest(e={}){return this.send([Enumerations.SYSTEM_MESSAGES.tunerequest],{time:e.time}),this}sendClock(e={}){return this.send([Enumerations.SYSTEM_MESSAGES.clock],{time:e.time}),this}sendStart(e={}){return this.send([Enumerations.SYSTEM_MESSAGES.start],{time:e.time}),this}sendContinue(e={}){return this.send([Enumerations.SYSTEM_MESSAGES.continue],{time:e.time}),this}sendStop(e={}){return this.send([Enumerations.SYSTEM_MESSAGES.stop],{time:e.time}),this}sendActiveSensing(e={}){return this.send([Enumerations.SYSTEM_MESSAGES.activesensing],{time:e.time}),this}sendReset(e={}){return this.send([Enumerations.SYSTEM_MESSAGES.reset],{time:e.time}),this}sendTuningRequest(e={}){return wm.validation&&console.warn("The sendTuningRequest() method has been deprecated. Use sendTuningRequest() instead."),this.sendTuneRequest(e)}sendKeyAftertouch(e,l,d={}){return d.channels==null&&(d.channels=Enumerations.MIDI_CHANNEL_NUMBERS),Utilities.sanitizeChannels(d.channels).forEach(p=>{this.channels[p].sendKeyAftertouch(e,l,d)}),this}sendControlChange(e,l,d={},p={}){if(wm.validation&&(Array.isArray(d)||Number.isInteger(d)||d==="all")){const b=d;d=p,d.channels=b,d.channels==="all"&&(d.channels=Enumerations.MIDI_CHANNEL_NUMBERS)}return d.channels==null&&(d.channels=Enumerations.MIDI_CHANNEL_NUMBERS),Utilities.sanitizeChannels(d.channels).forEach(b=>{this.channels[b].sendControlChange(e,l,d)}),this}sendPitchBendRange(e=0,l=0,d={}){return d.channels==null&&(d.channels=Enumerations.MIDI_CHANNEL_NUMBERS),Utilities.sanitizeChannels(d.channels).forEach(p=>{this.channels[p].sendPitchBendRange(e,l,d)}),this}setPitchBendRange(e=0,l=0,d="all",p={}){return wm.validation&&(console.warn("The setPitchBendRange() method is deprecated. Use sendPitchBendRange() instead."),p.channels=d,p.channels==="all"&&(p.channels=Enumerations.MIDI_CHANNEL_NUMBERS)),this.sendPitchBendRange(e,l,p)}sendRpnValue(e,l,d={}){return d.channels==null&&(d.channels=Enumerations.MIDI_CHANNEL_NUMBERS),Utilities.sanitizeChannels(d.channels).forEach(p=>{this.channels[p].sendRpnValue(e,l,d)}),this}setRegisteredParameter(e,l=[],d="all",p={}){return wm.validation&&(console.warn("The setRegisteredParameter() method is deprecated. Use sendRpnValue() instead."),p.channels=d,p.channels==="all"&&(p.channels=Enumerations.MIDI_CHANNEL_NUMBERS)),this.sendRpnValue(e,l,p)}sendChannelAftertouch(e,l={},d={}){if(wm.validation&&(Array.isArray(l)||Number.isInteger(l)||l==="all")){const p=l;l=d,l.channels=p,l.channels==="all"&&(l.channels=Enumerations.MIDI_CHANNEL_NUMBERS)}return l.channels==null&&(l.channels=Enumerations.MIDI_CHANNEL_NUMBERS),Utilities.sanitizeChannels(l.channels).forEach(p=>{this.channels[p].sendChannelAftertouch(e,l)}),this}sendPitchBend(e,l={},d={}){if(wm.validation&&(Array.isArray(l)||Number.isInteger(l)||l==="all")){const p=l;l=d,l.channels=p,l.channels==="all"&&(l.channels=Enumerations.MIDI_CHANNEL_NUMBERS)}return l.channels==null&&(l.channels=Enumerations.MIDI_CHANNEL_NUMBERS),Utilities.sanitizeChannels(l.channels).forEach(p=>{this.channels[p].sendPitchBend(e,l)}),this}sendProgramChange(e=0,l={},d={}){if(wm.validation&&(Array.isArray(l)||Number.isInteger(l)||l==="all")){const p=l;l=d,l.channels=p,l.channels==="all"&&(l.channels=Enumerations.MIDI_CHANNEL_NUMBERS)}return l.channels==null&&(l.channels=Enumerations.MIDI_CHANNEL_NUMBERS),Utilities.sanitizeChannels(l.channels).forEach(p=>{this.channels[p].sendProgramChange(e,l)}),this}sendModulationRange(e,l,d={}){return d.channels==null&&(d.channels=Enumerations.MIDI_CHANNEL_NUMBERS),Utilities.sanitizeChannels(d.channels).forEach(p=>{this.channels[p].sendModulationRange(e,l,d)}),this}setModulationRange(e=0,l=0,d="all",p={}){return wm.validation&&(console.warn("The setModulationRange() method is deprecated. Use sendModulationRange() instead."),p.channels=d,p.channels==="all"&&(p.channels=Enumerations.MIDI_CHANNEL_NUMBERS)),this.sendModulationRange(e,l,p)}sendMasterTuning(e,l={}){return l.channels==null&&(l.channels=Enumerations.MIDI_CHANNEL_NUMBERS),Utilities.sanitizeChannels(l.channels).forEach(d=>{this.channels[d].sendMasterTuning(e,l)}),this}setMasterTuning(e,l={},d={}){return wm.validation&&(console.warn("The setMasterTuning() method is deprecated. Use sendMasterTuning() instead."),d.channels=l,d.channels==="all"&&(d.channels=Enumerations.MIDI_CHANNEL_NUMBERS)),this.sendMasterTuning(e,d)}sendTuningProgram(e,l={}){return l.channels==null&&(l.channels=Enumerations.MIDI_CHANNEL_NUMBERS),Utilities.sanitizeChannels(l.channels).forEach(d=>{this.channels[d].sendTuningProgram(e,l)}),this}setTuningProgram(e,l="all",d={}){return wm.validation&&(console.warn("The setTuningProgram() method is deprecated. Use sendTuningProgram() instead."),d.channels=l,d.channels==="all"&&(d.channels=Enumerations.MIDI_CHANNEL_NUMBERS)),this.sendTuningProgram(e,d)}sendTuningBank(e=0,l={}){return l.channels==null&&(l.channels=Enumerations.MIDI_CHANNEL_NUMBERS),Utilities.sanitizeChannels(l.channels).forEach(d=>{this.channels[d].sendTuningBank(e,l)}),this}setTuningBank(e,l="all",d={}){return wm.validation&&(console.warn("The setTuningBank() method is deprecated. Use sendTuningBank() instead."),d.channels=l,d.channels==="all"&&(d.channels=Enumerations.MIDI_CHANNEL_NUMBERS)),this.sendTuningBank(e,d)}sendChannelMode(e,l=0,d={},p={}){if(wm.validation&&(Array.isArray(d)||Number.isInteger(d)||d==="all")){const b=d;d=p,d.channels=b,d.channels==="all"&&(d.channels=Enumerations.MIDI_CHANNEL_NUMBERS)}return d.channels==null&&(d.channels=Enumerations.MIDI_CHANNEL_NUMBERS),Utilities.sanitizeChannels(d.channels).forEach(b=>{this.channels[b].sendChannelMode(e,l,d)}),this}sendAllSoundOff(e={}){return e.channels==null&&(e.channels=Enumerations.MIDI_CHANNEL_NUMBERS),Utilities.sanitizeChannels(e.channels).forEach(l=>{this.channels[l].sendAllSoundOff(e)}),this}sendAllNotesOff(e={}){return e.channels==null&&(e.channels=Enumerations.MIDI_CHANNEL_NUMBERS),Utilities.sanitizeChannels(e.channels).forEach(l=>{this.channels[l].sendAllNotesOff(e)}),this}sendResetAllControllers(e={},l={}){if(wm.validation&&(Array.isArray(e)||Number.isInteger(e)||e==="all")){const d=e;e=l,e.channels=d,e.channels==="all"&&(e.channels=Enumerations.MIDI_CHANNEL_NUMBERS)}return e.channels==null&&(e.channels=Enumerations.MIDI_CHANNEL_NUMBERS),Utilities.sanitizeChannels(e.channels).forEach(d=>{this.channels[d].sendResetAllControllers(e)}),this}sendPolyphonicMode(e,l={},d={}){if(wm.validation&&(Array.isArray(l)||Number.isInteger(l)||l==="all")){const p=l;l=d,l.channels=p,l.channels==="all"&&(l.channels=Enumerations.MIDI_CHANNEL_NUMBERS)}return l.channels==null&&(l.channels=Enumerations.MIDI_CHANNEL_NUMBERS),Utilities.sanitizeChannels(l.channels).forEach(p=>{this.channels[p].sendPolyphonicMode(e,l)}),this}sendLocalControl(e,l={},d={}){if(wm.validation&&(Array.isArray(l)||Number.isInteger(l)||l==="all")){const p=l;l=d,l.channels=p,l.channels==="all"&&(l.channels=Enumerations.MIDI_CHANNEL_NUMBERS)}return l.channels==null&&(l.channels=Enumerations.MIDI_CHANNEL_NUMBERS),Utilities.sanitizeChannels(l.channels).forEach(p=>{this.channels[p].sendLocalControl(e,l)}),this}sendOmniMode(e,l={},d={}){if(wm.validation&&(Array.isArray(l)||Number.isInteger(l)||l==="all")){const p=l;l=d,l.channels=p,l.channels==="all"&&(l.channels=Enumerations.MIDI_CHANNEL_NUMBERS)}return l.channels==null&&(l.channels=Enumerations.MIDI_CHANNEL_NUMBERS),Utilities.sanitizeChannels(l.channels).forEach(p=>{this.channels[p].sendOmniMode(e,l)}),this}sendNrpnValue(e,l,d={}){return d.channels==null&&(d.channels=Enumerations.MIDI_CHANNEL_NUMBERS),Utilities.sanitizeChannels(d.channels).forEach(p=>{this.channels[p].sendNrpnValue(e,l,d)}),this}setNonRegisteredParameter(e,l=[],d="all",p={}){return wm.validation&&(console.warn("The setNonRegisteredParameter() method is deprecated. Use sendNrpnValue() instead."),p.channels=d,p.channels==="all"&&(p.channels=Enumerations.MIDI_CHANNEL_NUMBERS)),this.sendNrpnValue(e,l,p)}sendRpnIncrement(e,l={}){return l.channels==null&&(l.channels=Enumerations.MIDI_CHANNEL_NUMBERS),Utilities.sanitizeChannels(l.channels).forEach(d=>{this.channels[d].sendRpnIncrement(e,l)}),this}incrementRegisteredParameter(e,l="all",d={}){return wm.validation&&(console.warn("The incrementRegisteredParameter() method is deprecated. Use sendRpnIncrement() instead."),d.channels=l,d.channels==="all"&&(d.channels=Enumerations.MIDI_CHANNEL_NUMBERS)),this.sendRpnIncrement(e,d)}sendRpnDecrement(e,l={}){return l.channels==null&&(l.channels=Enumerations.MIDI_CHANNEL_NUMBERS),Utilities.sanitizeChannels(l.channels).forEach(d=>{this.channels[d].sendRpnDecrement(e,l)}),this}decrementRegisteredParameter(e,l="all",d={}){return wm.validation&&(console.warn("The decrementRegisteredParameter() method is deprecated. Use sendRpnDecrement() instead."),d.channels=l,d.channels==="all"&&(d.channels=Enumerations.MIDI_CHANNEL_NUMBERS)),this.sendRpnDecrement(e,d)}sendNoteOff(e,l={},d={}){if(wm.validation&&(Array.isArray(l)||Number.isInteger(l)||l==="all")){const p=l;l=d,l.channels=p,l.channels==="all"&&(l.channels=Enumerations.MIDI_CHANNEL_NUMBERS)}return l.channels==null&&(l.channels=Enumerations.MIDI_CHANNEL_NUMBERS),Utilities.sanitizeChannels(l.channels).forEach(p=>{this.channels[p].sendNoteOff(e,l)}),this}stopNote(e,l){return this.sendNoteOff(e,l)}playNote(e,l={},d={}){if(wm.validation&&(l.rawVelocity&&console.warn("The 'rawVelocity' option is deprecated. Use 'rawAttack' instead."),l.velocity&&console.warn("The 'velocity' option is deprecated. Use 'velocity' instead."),Array.isArray(l)||Number.isInteger(l)||l==="all")){const p=l;l=d,l.channels=p,l.channels==="all"&&(l.channels=Enumerations.MIDI_CHANNEL_NUMBERS)}return l.channels==null&&(l.channels=Enumerations.MIDI_CHANNEL_NUMBERS),Utilities.sanitizeChannels(l.channels).forEach(p=>{this.channels[p].playNote(e,l)}),this}sendNoteOn(e,l={},d={}){if(wm.validation&&(Array.isArray(l)||Number.isInteger(l)||l==="all")){const p=l;l=d,l.channels=p,l.channels==="all"&&(l.channels=Enumerations.MIDI_CHANNEL_NUMBERS)}return l.channels==null&&(l.channels=Enumerations.MIDI_CHANNEL_NUMBERS),Utilities.sanitizeChannels(l.channels).forEach(p=>{this.channels[p].sendNoteOn(e,l)}),this}get name(){return this._midiOutput.name}get id(){return this._midiOutput.id}get connection(){return this._midiOutput.connection}get manufacturer(){return this._midiOutput.manufacturer}get state(){return this._midiOutput.state}get type(){return this._midiOutput.type}get octaveOffset(){return this._octaveOffset}set octaveOffset(e){if(this.validation&&(e=parseInt(e),isNaN(e)))throw new TypeError("The 'octaveOffset' property must be an integer.");this._octaveOffset=e}}/**
|
||
* The `Forwarder` class allows the forwarding of MIDI messages to predetermined outputs. When you
|
||
* call its [`forward()`](#forward) method, it will send the specified [`Message`](Message) object
|
||
* to all the outputs listed in its [`destinations`](#destinations) property.
|
||
*
|
||
* If specific channels or message types have been defined in the [`channels`](#channels) or
|
||
* [`types`](#types) properties, only messages matching the channels/types will be forwarded.
|
||
*
|
||
* While it can be manually instantiated, you are more likely to come across a `Forwarder` object as
|
||
* the return value of the [`Input.addForwarder()`](Input#addForwarder) method.
|
||
*
|
||
* @license Apache-2.0
|
||
* @since 3.0.0
|
||
*/class Forwarder{constructor(e=[],l={}){this.destinations=[],this.types=[...Object.keys(Enumerations.SYSTEM_MESSAGES),...Object.keys(Enumerations.CHANNEL_MESSAGES)],this.channels=Enumerations.MIDI_CHANNEL_NUMBERS,this.suspended=!1,Array.isArray(e)||(e=[e]),l.types&&!Array.isArray(l.types)&&(l.types=[l.types]),l.channels&&!Array.isArray(l.channels)&&(l.channels=[l.channels]),wm.validation&&(e.forEach(d=>{if(!(d instanceof Output))throw new TypeError("Destinations must be of type 'Output'.")}),l.types!==void 0&&l.types.forEach(d=>{if(!Enumerations.SYSTEM_MESSAGES.hasOwnProperty(d)&&!Enumerations.CHANNEL_MESSAGES.hasOwnProperty(d))throw new TypeError("Type must be a valid message type.")}),l.channels!==void 0&&l.channels.forEach(d=>{if(!Enumerations.MIDI_CHANNEL_NUMBERS.includes(d))throw new TypeError("MIDI channel must be between 1 and 16.")})),this.destinations=e,l.types&&(this.types=l.types),l.channels&&(this.channels=l.channels)}forward(e){this.suspended||this.types.includes(e.type)&&(e.channel&&!this.channels.includes(e.channel)||this.destinations.forEach(l=>{wm.validation&&!(l instanceof Output)||l.send(e)}))}}/**
|
||
* The `InputChannel` class represents a single MIDI input channel (1-16) from a single input
|
||
* device. This object is derived from the host's MIDI subsystem and should not be instantiated
|
||
* directly.
|
||
*
|
||
* All 16 `InputChannel` objects can be found inside the input's [`channels`](Input#channels)
|
||
* property.
|
||
*
|
||
* @fires InputChannel#midimessage
|
||
* @fires InputChannel#unknownmessage
|
||
*
|
||
* @fires InputChannel#noteoff
|
||
* @fires InputChannel#noteon
|
||
* @fires InputChannel#keyaftertouch
|
||
* @fires InputChannel#programchange
|
||
* @fires InputChannel#channelaftertouch
|
||
* @fires InputChannel#pitchbend
|
||
*
|
||
* @fires InputChannel#allnotesoff
|
||
* @fires InputChannel#allsoundoff
|
||
* @fires InputChannel#localcontrol
|
||
* @fires InputChannel#monomode
|
||
* @fires InputChannel#omnimode
|
||
* @fires InputChannel#resetallcontrollers
|
||
*
|
||
* @fires InputChannel#event:nrpn
|
||
* @fires InputChannel#event:nrpn-dataentrycoarse
|
||
* @fires InputChannel#event:nrpn-dataentryfine
|
||
* @fires InputChannel#event:nrpn-dataincrement
|
||
* @fires InputChannel#event:nrpn-datadecrement
|
||
* @fires InputChannel#event:rpn
|
||
* @fires InputChannel#event:rpn-dataentrycoarse
|
||
* @fires InputChannel#event:rpn-dataentryfine
|
||
* @fires InputChannel#event:rpn-dataincrement
|
||
* @fires InputChannel#event:rpn-datadecrement
|
||
*
|
||
* @fires InputChannel#controlchange
|
||
* @fires InputChannel#event:controlchange-controllerxxx
|
||
* @fires InputChannel#event:controlchange-bankselectcoarse
|
||
* @fires InputChannel#event:controlchange-modulationwheelcoarse
|
||
* @fires InputChannel#event:controlchange-breathcontrollercoarse
|
||
* @fires InputChannel#event:controlchange-footcontrollercoarse
|
||
* @fires InputChannel#event:controlchange-portamentotimecoarse
|
||
* @fires InputChannel#event:controlchange-dataentrycoarse
|
||
* @fires InputChannel#event:controlchange-volumecoarse
|
||
* @fires InputChannel#event:controlchange-balancecoarse
|
||
* @fires InputChannel#event:controlchange-pancoarse
|
||
* @fires InputChannel#event:controlchange-expressioncoarse
|
||
* @fires InputChannel#event:controlchange-effectcontrol1coarse
|
||
* @fires InputChannel#event:controlchange-effectcontrol2coarse
|
||
* @fires InputChannel#event:controlchange-generalpurposecontroller1
|
||
* @fires InputChannel#event:controlchange-generalpurposecontroller2
|
||
* @fires InputChannel#event:controlchange-generalpurposecontroller3
|
||
* @fires InputChannel#event:controlchange-generalpurposecontroller4
|
||
* @fires InputChannel#event:controlchange-bankselectfine
|
||
* @fires InputChannel#event:controlchange-modulationwheelfine
|
||
* @fires InputChannel#event:controlchange-breathcontrollerfine
|
||
* @fires InputChannel#event:controlchange-footcontrollerfine
|
||
* @fires InputChannel#event:controlchange-portamentotimefine
|
||
* @fires InputChannel#event:controlchange-dataentryfine
|
||
* @fires InputChannel#event:controlchange-channelvolumefine
|
||
* @fires InputChannel#event:controlchange-balancefine
|
||
* @fires InputChannel#event:controlchange-panfine
|
||
* @fires InputChannel#event:controlchange-expressionfine
|
||
* @fires InputChannel#event:controlchange-effectcontrol1fine
|
||
* @fires InputChannel#event:controlchange-effectcontrol2fine
|
||
* @fires InputChannel#event:controlchange-damperpedal
|
||
* @fires InputChannel#event:controlchange-portamento
|
||
* @fires InputChannel#event:controlchange-sostenuto
|
||
* @fires InputChannel#event:controlchange-softpedal
|
||
* @fires InputChannel#event:controlchange-legatopedal
|
||
* @fires InputChannel#event:controlchange-hold2
|
||
* @fires InputChannel#event:controlchange-soundvariation
|
||
* @fires InputChannel#event:controlchange-resonance
|
||
* @fires InputChannel#event:controlchange-releasetime
|
||
* @fires InputChannel#event:controlchange-attacktime
|
||
* @fires InputChannel#event:controlchange-brightness
|
||
* @fires InputChannel#event:controlchange-decaytime
|
||
* @fires InputChannel#event:controlchange-vibratorate
|
||
* @fires InputChannel#event:controlchange-vibratodepth
|
||
* @fires InputChannel#event:controlchange-vibratodelay
|
||
* @fires InputChannel#event:controlchange-generalpurposecontroller5
|
||
* @fires InputChannel#event:controlchange-generalpurposecontroller6
|
||
* @fires InputChannel#event:controlchange-generalpurposecontroller7
|
||
* @fires InputChannel#event:controlchange-generalpurposecontroller8
|
||
* @fires InputChannel#event:controlchange-portamentocontrol
|
||
* @fires InputChannel#event:controlchange-highresolutionvelocityprefix
|
||
* @fires InputChannel#event:controlchange-effect1depth
|
||
* @fires InputChannel#event:controlchange-effect2depth
|
||
* @fires InputChannel#event:controlchange-effect3depth
|
||
* @fires InputChannel#event:controlchange-effect4depth
|
||
* @fires InputChannel#event:controlchange-effect5depth
|
||
* @fires InputChannel#event:controlchange-dataincrement
|
||
* @fires InputChannel#event:controlchange-datadecrement
|
||
* @fires InputChannel#event:controlchange-nonregisteredparameterfine
|
||
* @fires InputChannel#event:controlchange-nonregisteredparametercoarse
|
||
* @fires InputChannel#event:controlchange-registeredparameterfine
|
||
* @fires InputChannel#event:controlchange-registeredparametercoarse
|
||
* @fires InputChannel#event:controlchange-allsoundoff
|
||
* @fires InputChannel#event:controlchange-resetallcontrollers
|
||
* @fires InputChannel#event:controlchange-localcontrol
|
||
* @fires InputChannel#event:controlchange-allnotesoff
|
||
* @fires InputChannel#event:controlchange-omnimodeoff
|
||
* @fires InputChannel#event:controlchange-omnimodeon
|
||
* @fires InputChannel#event:controlchange-monomodeon
|
||
* @fires InputChannel#event:controlchange-polymodeon
|
||
* @fires InputChannel#event:
|
||
*
|
||
* @extends EventEmitter
|
||
* @license Apache-2.0
|
||
* @since 3.0.0
|
||
*/class InputChannel extends EventEmitter{constructor(e,l){super(),this._input=e,this._number=l,this._octaveOffset=0,this._nrpnBuffer=[],this._rpnBuffer=[],this.parameterNumberEventsEnabled=!0,this.notesState=new Array(128).fill(!1)}destroy(){this._input=null,this._number=null,this._octaveOffset=0,this._nrpnBuffer=[],this.notesState=new Array(128).fill(!1),this.parameterNumberEventsEnabled=!1,this.removeListener()}_processMidiMessageEvent(e){const l=Object.assign({},e);l.port=this.input,l.target=this,l.type="midimessage",this.emit(l.type,l),this._parseEventForStandardMessages(l)}_parseEventForStandardMessages(e){const l=Object.assign({},e);l.type=l.message.type||"unknownmessage";const d=e.message.dataBytes[0],p=e.message.dataBytes[1];if(l.type==="noteoff"||l.type==="noteon"&&p===0)this.notesState[d]=!1,l.type="noteoff",l.note=new Note(Utilities.offsetNumber(d,this.octaveOffset+this.input.octaveOffset+wm.octaveOffset),{rawAttack:0,rawRelease:p}),l.value=Utilities.from7bitToFloat(p),l.rawValue=p,l.velocity=l.note.release,l.rawVelocity=l.note.rawRelease;else if(l.type==="noteon")this.notesState[d]=!0,l.note=new Note(Utilities.offsetNumber(d,this.octaveOffset+this.input.octaveOffset+wm.octaveOffset),{rawAttack:p}),l.value=Utilities.from7bitToFloat(p),l.rawValue=p,l.velocity=l.note.attack,l.rawVelocity=l.note.rawAttack;else if(l.type==="keyaftertouch")l.note=new Note(Utilities.offsetNumber(d,this.octaveOffset+this.input.octaveOffset+wm.octaveOffset)),l.value=Utilities.from7bitToFloat(p),l.rawValue=p,l.identifier=l.note.identifier,l.key=l.note.number,l.rawKey=d;else if(l.type==="controlchange"){l.controller={number:d,name:Enumerations.CONTROL_CHANGE_MESSAGES[d].name,description:Enumerations.CONTROL_CHANGE_MESSAGES[d].description,position:Enumerations.CONTROL_CHANGE_MESSAGES[d].position},l.subtype=l.controller.name||"controller"+d,l.value=Utilities.from7bitToFloat(p),l.rawValue=p;const b=Object.assign({},l);b.type=`${l.type}-controller${d}`,delete b.subtype,this.emit(b.type,b);const R=Object.assign({},l);R.type=`${l.type}-`+Enumerations.CONTROL_CHANGE_MESSAGES[d].name,delete R.subtype,R.type.indexOf("controller")!==0&&this.emit(R.type,R),l.message.dataBytes[0]>=120&&this._parseChannelModeMessage(l),this.parameterNumberEventsEnabled&&this._isRpnOrNrpnController(l.message.dataBytes[0])&&this._parseEventForParameterNumber(l)}else l.type==="programchange"?(l.value=d,l.rawValue=l.value):l.type==="channelaftertouch"?(l.value=Utilities.from7bitToFloat(d),l.rawValue=d):l.type==="pitchbend"?(l.value=((p<<7)+d-8192)/8192,l.rawValue=(p<<7)+d):l.type="unknownmessage";this.emit(l.type,l)}_parseChannelModeMessage(e){const l=Object.assign({},e);l.type=l.controller.name,l.type==="localcontrol"&&(l.value=l.message.data[2]===127,l.rawValue=l.message.data[2]),l.type==="omnimodeon"?(l.type="omnimode",l.value=!0,l.rawValue=l.message.data[2]):l.type==="omnimodeoff"&&(l.type="omnimode",l.value=!1,l.rawValue=l.message.data[2]),l.type==="monomodeon"?(l.type="monomode",l.value=!0,l.rawValue=l.message.data[2]):l.type==="polymodeon"&&(l.type="monomode",l.value=!1,l.rawValue=l.message.data[2]),this.emit(l.type,l)}_parseEventForParameterNumber(e){const l=e.message.dataBytes[0],d=e.message.dataBytes[1];l===99||l===101?(this._nrpnBuffer=[],this._rpnBuffer=[],l===99?this._nrpnBuffer=[e.message]:d!==127&&(this._rpnBuffer=[e.message])):l===98||l===100?l===98?(this._rpnBuffer=[],this._nrpnBuffer.length===1?this._nrpnBuffer.push(e.message):this._nrpnBuffer=[]):(this._nrpnBuffer=[],this._rpnBuffer.length===1&&d!==127?this._rpnBuffer.push(e.message):this._rpnBuffer=[]):(l===6||l===38||l===96||l===97)&&(this._rpnBuffer.length===2?this._dispatchParameterNumberEvent("rpn",this._rpnBuffer[0].dataBytes[1],this._rpnBuffer[1].dataBytes[1],e):this._nrpnBuffer.length===2?this._dispatchParameterNumberEvent("nrpn",this._nrpnBuffer[0].dataBytes[1],this._nrpnBuffer[1].dataBytes[1],e):(this._nrpnBuffer=[],this._rpnBuffer=[]))}_isRpnOrNrpnController(e){return e===6||e===38||e===96||e===97||e===98||e===99||e===100||e===101}_dispatchParameterNumberEvent(e,l,d,p){e=e==="nrpn"?"nrpn":"rpn";const b={target:p.target,timestamp:p.timestamp,message:p.message,parameterMsb:l,parameterLsb:d,value:Utilities.from7bitToFloat(p.message.dataBytes[1]),rawValue:p.message.dataBytes[1]};e==="rpn"?b.parameter=Object.keys(Enumerations.REGISTERED_PARAMETERS).find(z=>Enumerations.REGISTERED_PARAMETERS[z][0]===l&&Enumerations.REGISTERED_PARAMETERS[z][1]===d):b.parameter=(l<<7)+d;const R=Enumerations.CONTROL_CHANGE_MESSAGES[p.message.dataBytes[0]].name;b.type=`${e}-${R}`,this.emit(b.type,b);const I=Object.assign({},b);I.type==="nrpn-dataincrement"?I.type="nrpn-databuttonincrement":I.type==="nrpn-datadecrement"?I.type="nrpn-databuttondecrement":I.type==="rpn-dataincrement"?I.type="rpn-databuttonincrement":I.type==="rpn-datadecrement"&&(I.type="rpn-databuttondecrement"),this.emit(I.type,I),b.type=e,b.subtype=R,this.emit(b.type,b)}getChannelModeByNumber(e){return wm.validation&&(console.warn("The 'getChannelModeByNumber()' method has been moved to the 'Utilities' class."),e=Math.floor(e)),Utilities.getChannelModeByNumber(e)}getCcNameByNumber(e){if(wm.validation&&(console.warn("The 'getCcNameByNumber()' method has been moved to the 'Utilities' class."),e=parseInt(e),!(e>=0&&e<=127)))throw new RangeError("Invalid control change number.");return Utilities.getCcNameByNumber(e)}getNoteState(e){e instanceof Note&&(e=e.identifier);const l=Utilities.guessNoteNumber(e,wm.octaveOffset+this.input.octaveOffset+this.octaveOffset);return this.notesState[l]}get octaveOffset(){return this._octaveOffset}set octaveOffset(e){if(this.validation&&(e=parseInt(e),isNaN(e)))throw new TypeError("The 'octaveOffset' property must be an integer.");this._octaveOffset=e}get input(){return this._input}get number(){return this._number}get nrpnEventsEnabled(){return this.parameterNumberEventsEnabled}set nrpnEventsEnabled(e){this.validation&&(e=!!e),this.parameterNumberEventsEnabled=e}}/**
|
||
* The `Message` class represents a single MIDI message. It has several properties that make it
|
||
* easy to make sense of the binary data it contains.
|
||
*
|
||
* @license Apache-2.0
|
||
* @since 3.0.0
|
||
*/class Message{constructor(e){this.rawData=e,this.data=Array.from(this.rawData),this.statusByte=this.rawData[0],this.rawDataBytes=this.rawData.slice(1),this.dataBytes=this.data.slice(1),this.isChannelMessage=!1,this.isSystemMessage=!1,this.command=void 0,this.channel=void 0,this.manufacturerId=void 0,this.type=void 0,this.statusByte<240?(this.isChannelMessage=!0,this.command=this.statusByte>>4,this.channel=(this.statusByte&15)+1):(this.isSystemMessage=!0,this.command=this.statusByte),this.isChannelMessage?this.type=Utilities.getPropertyByValue(Enumerations.CHANNEL_MESSAGES,this.command):this.isSystemMessage&&(this.type=Utilities.getPropertyByValue(Enumerations.SYSTEM_MESSAGES,this.command)),this.statusByte===Enumerations.SYSTEM_MESSAGES.sysex&&(this.dataBytes[0]===0?(this.manufacturerId=this.dataBytes.slice(0,3),this.dataBytes=this.dataBytes.slice(3,this.rawDataBytes.length-1),this.rawDataBytes=this.rawDataBytes.slice(3,this.rawDataBytes.length-1)):(this.manufacturerId=[this.dataBytes[0]],this.dataBytes=this.dataBytes.slice(1,this.dataBytes.length-1),this.rawDataBytes=this.rawDataBytes.slice(1,this.rawDataBytes.length-1)))}}/**
|
||
* The `Input` class represents a single MIDI input port. This object is automatically instantiated
|
||
* by the library according to the host's MIDI subsystem and does not need to be directly
|
||
* instantiated. Instead, you can access all `Input` objects by referring to the
|
||
* [`WebMidi.inputs`](WebMidi#inputs) array. You can also retrieve inputs by using methods such as
|
||
* [`WebMidi.getInputByName()`](WebMidi#getInputByName) and
|
||
* [`WebMidi.getInputById()`](WebMidi#getInputById).
|
||
*
|
||
* Note that a single MIDI device may expose several inputs and/or outputs.
|
||
*
|
||
* **Important**: the `Input` class does not directly fire channel-specific MIDI messages
|
||
* (such as [`noteon`](InputChannel#event:noteon) or
|
||
* [`controlchange`](InputChannel#event:controlchange), etc.). The [`InputChannel`](InputChannel)
|
||
* object does that. However, you can still use the
|
||
* [`Input.addListener()`](#addListener) method to listen to channel-specific events on multiple
|
||
* [`InputChannel`](InputChannel) objects at once.
|
||
*
|
||
* @fires Input#opened
|
||
* @fires Input#disconnected
|
||
* @fires Input#closed
|
||
* @fires Input#midimessage
|
||
*
|
||
* @fires Input#sysex
|
||
* @fires Input#timecode
|
||
* @fires Input#songposition
|
||
* @fires Input#songselect
|
||
* @fires Input#tunerequest
|
||
* @fires Input#clock
|
||
* @fires Input#start
|
||
* @fires Input#continue
|
||
* @fires Input#stop
|
||
* @fires Input#activesensing
|
||
* @fires Input#reset
|
||
*
|
||
* @fires Input#unknownmidimessage
|
||
*
|
||
* @extends EventEmitter
|
||
* @license Apache-2.0
|
||
*/class Input extends EventEmitter{constructor(e){super(),this._midiInput=e,this._octaveOffset=0,this.channels=[];for(let l=1;l<=16;l++)this.channels[l]=new InputChannel(this,l);this._forwarders=[],this._midiInput.onstatechange=this._onStateChange.bind(this),this._midiInput.onmidimessage=this._onMidiMessage.bind(this)}async destroy(){this.removeListener(),this.channels.forEach(e=>e.destroy()),this.channels=[],this._forwarders=[],this._midiInput&&(this._midiInput.onstatechange=null,this._midiInput.onmidimessage=null),await this.close(),this._midiInput=null}_onStateChange(e){let l={timestamp:wm.time,target:this,port:this};e.port.connection==="open"?(l.type="opened",this.emit("opened",l)):e.port.connection==="closed"&&e.port.state==="connected"?(l.type="closed",this.emit("closed",l)):e.port.connection==="closed"&&e.port.state==="disconnected"?(l.type="disconnected",l.port={connection:e.port.connection,id:e.port.id,manufacturer:e.port.manufacturer,name:e.port.name,state:e.port.state,type:e.port.type},this.emit("disconnected",l)):e.port.connection==="pending"&&e.port.state==="disconnected"||console.warn("This statechange event was not caught: ",e.port.connection,e.port.state)}_onMidiMessage(e){const l=new Message(e.data),d={port:this,target:this,message:l,timestamp:e.timeStamp,type:"midimessage",data:l.data,rawData:l.data,statusByte:l.data[0],dataBytes:l.dataBytes};this.emit("midimessage",d),l.isSystemMessage?this._parseEvent(d):l.isChannelMessage&&this.channels[l.channel]._processMidiMessageEvent(d),this._forwarders.forEach(p=>p.forward(l))}_parseEvent(e){const l=Object.assign({},e);l.type=l.message.type||"unknownmidimessage",l.type==="songselect"&&(l.song=e.data[1]+1,l.value=e.data[1],l.rawValue=l.value),this.emit(l.type,l)}async open(){try{await this._midiInput.open()}catch(e){return Promise.reject(e)}return Promise.resolve(this)}async close(){if(!this._midiInput)return Promise.resolve(this);try{await this._midiInput.close()}catch(e){return Promise.reject(e)}return Promise.resolve(this)}getChannelModeByNumber(){wm.validation&&console.warn("The 'getChannelModeByNumber()' method has been moved to the 'Utilities' class.")}addListener(e,l,d={}){if(wm.validation&&typeof d=="function"){let p=l!=null?[].concat(l):void 0;l=d,d={channels:p}}if(Enumerations.CHANNEL_EVENTS.includes(e)){d.channels===void 0&&(d.channels=Enumerations.MIDI_CHANNEL_NUMBERS);let p=[];return Utilities.sanitizeChannels(d.channels).forEach(b=>{p.push(this.channels[b].addListener(e,l,d))}),p}else return super.addListener(e,l,d)}addOneTimeListener(e,l,d={}){return d.remaining=1,this.addListener(e,l,d)}on(e,l,d,p){return this.addListener(e,l,d,p)}hasListener(e,l,d={}){if(wm.validation&&typeof d=="function"){let p=[].concat(l);l=d,d={channels:p}}return Enumerations.CHANNEL_EVENTS.includes(e)?(d.channels===void 0&&(d.channels=Enumerations.MIDI_CHANNEL_NUMBERS),Utilities.sanitizeChannels(d.channels).every(p=>this.channels[p].hasListener(e,l))):super.hasListener(e,l)}removeListener(e,l,d={}){if(wm.validation&&typeof d=="function"){let p=[].concat(l);l=d,d={channels:p}}if(d.channels===void 0&&(d.channels=Enumerations.MIDI_CHANNEL_NUMBERS),e==null)return Utilities.sanitizeChannels(d.channels).forEach(p=>{this.channels[p]&&this.channels[p].removeListener()}),super.removeListener();Enumerations.CHANNEL_EVENTS.includes(e)?Utilities.sanitizeChannels(d.channels).forEach(p=>{this.channels[p].removeListener(e,l,d)}):super.removeListener(e,l,d)}addForwarder(e,l={}){let d;return e instanceof Forwarder?d=e:d=new Forwarder(e,l),this._forwarders.push(d),d}removeForwarder(e){this._forwarders=this._forwarders.filter(l=>l!==e)}hasForwarder(e){return this._forwarders.includes(e)}get name(){return this._midiInput.name}get id(){return this._midiInput.id}get connection(){return this._midiInput.connection}get manufacturer(){return this._midiInput.manufacturer}get octaveOffset(){return this._octaveOffset}set octaveOffset(e){if(this.validation&&(e=parseInt(e),isNaN(e)))throw new TypeError("The 'octaveOffset' property must be an integer.");this._octaveOffset=e}get state(){return this._midiInput.state}get type(){return this._midiInput.type}get nrpnEventsEnabled(){return wm.validation&&console.warn("The 'nrpnEventsEnabled' property has been moved to the 'InputChannel' class."),!1}}/**
|
||
* The `WebMidi` object makes it easier to work with the low-level Web MIDI API. Basically, it
|
||
* simplifies sending outgoing MIDI messages and reacting to incoming MIDI messages.
|
||
*
|
||
* When using the WebMidi.js library, you should know that the `WebMidi` class has already been
|
||
* instantiated. You cannot instantiate it yourself. If you use the **IIFE** version, you should
|
||
* simply use the global object called `WebMidi`. If you use the **CJS** (CommonJS) or **ESM** (ES6
|
||
* module) version, you get an already-instantiated object when you import the module.
|
||
*
|
||
* @fires WebMidi#connected
|
||
* @fires WebMidi#disabled
|
||
* @fires WebMidi#disconnected
|
||
* @fires WebMidi#enabled
|
||
* @fires WebMidi#error
|
||
* @fires WebMidi#midiaccessgranted
|
||
* @fires WebMidi#portschanged
|
||
*
|
||
* @extends EventEmitter
|
||
* @license Apache-2.0
|
||
*/let WebMidi$1=class extends EventEmitter{constructor(){super(),this.defaults={note:{attack:Utilities.from7bitToFloat(64),release:Utilities.from7bitToFloat(64),duration:1/0}},this.interface=null,this.validation=!0,this._inputs=[],this._disconnectedInputs=[],this._outputs=[],this._disconnectedOutputs=[],this._stateChangeQueue=[],this._octaveOffset=0}async enable(e={},l=!1){if(Utilities.isNode)try{window.navigator}catch{let I=await Object.getPrototypeOf(async function(){}).constructor(`
|
||
let jzz = await import("jzz");
|
||
return jzz.default;
|
||
`)();global.navigator||(global.navigator={}),Object.assign(global.navigator,I)}if(this.validation=e.validation!==!1,this.validation&&(typeof e=="function"&&(e={callback:e,sysex:l}),l&&(e.sysex=!0)),this.enabled)return typeof e.callback=="function"&&e.callback(),Promise.resolve();const d={timestamp:this.time,target:this,type:"error",error:void 0},p={timestamp:this.time,target:this,type:"midiaccessgranted"},b={timestamp:this.time,target:this,type:"enabled"};try{typeof e.requestMIDIAccessFunction=="function"?this.interface=await e.requestMIDIAccessFunction({sysex:e.sysex,software:e.software}):this.interface=await navigator.requestMIDIAccess({sysex:e.sysex,software:e.software})}catch(R){return d.error=R,this.emit("error",d),typeof e.callback=="function"&&e.callback(R),Promise.reject(R)}this.emit("midiaccessgranted",p),this.interface.onstatechange=this._onInterfaceStateChange.bind(this);try{await this._updateInputsAndOutputs()}catch(R){return d.error=R,this.emit("error",d),typeof e.callback=="function"&&e.callback(R),Promise.reject(R)}return this.emit("enabled",b),typeof e.callback=="function"&&e.callback(),Promise.resolve(this)}async disable(){return this.interface&&(this.interface.onstatechange=void 0),this._destroyInputsAndOutputs().then(()=>{navigator&&typeof navigator.close=="function"&&navigator.close(),this.interface=null;let e={timestamp:this.time,target:this,type:"disabled"};this.emit("disabled",e),this.removeListener()})}getInputById(e,l={disconnected:!1}){if(this.validation){if(!this.enabled)throw new Error("WebMidi is not enabled.");if(!e)return}if(l.disconnected){for(let d=0;d<this._disconnectedInputs.length;d++)if(this._disconnectedInputs[d].id===e.toString())return this._disconnectedInputs[d]}else for(let d=0;d<this.inputs.length;d++)if(this.inputs[d].id===e.toString())return this.inputs[d]}getInputByName(e,l={disconnected:!1}){if(this.validation){if(!this.enabled)throw new Error("WebMidi is not enabled.");if(!e)return;e=e.toString()}if(l.disconnected){for(let d=0;d<this._disconnectedInputs.length;d++)if(~this._disconnectedInputs[d].name.indexOf(e))return this._disconnectedInputs[d]}else for(let d=0;d<this.inputs.length;d++)if(~this.inputs[d].name.indexOf(e))return this.inputs[d]}getOutputByName(e,l={disconnected:!1}){if(this.validation){if(!this.enabled)throw new Error("WebMidi is not enabled.");if(!e)return;e=e.toString()}if(l.disconnected){for(let d=0;d<this._disconnectedOutputs.length;d++)if(~this._disconnectedOutputs[d].name.indexOf(e))return this._disconnectedOutputs[d]}else for(let d=0;d<this.outputs.length;d++)if(~this.outputs[d].name.indexOf(e))return this.outputs[d]}getOutputById(e,l={disconnected:!1}){if(this.validation){if(!this.enabled)throw new Error("WebMidi is not enabled.");if(!e)return}if(l.disconnected){for(let d=0;d<this._disconnectedOutputs.length;d++)if(this._disconnectedOutputs[d].id===e.toString())return this._disconnectedOutputs[d]}else for(let d=0;d<this.outputs.length;d++)if(this.outputs[d].id===e.toString())return this.outputs[d]}noteNameToNumber(e){return this.validation&&console.warn("The noteNameToNumber() method is deprecated. Use Utilities.toNoteNumber() instead."),Utilities.toNoteNumber(e,this.octaveOffset)}getOctave(e){return this.validation&&(console.warn("The getOctave()is deprecated. Use Utilities.getNoteDetails() instead"),e=parseInt(e)),!isNaN(e)&&e>=0&&e<=127?Utilities.getNoteDetails(Utilities.offsetNumber(e,this.octaveOffset)).octave:!1}sanitizeChannels(e){return this.validation&&console.warn("The sanitizeChannels() method has been moved to the utilities class."),Utilities.sanitizeChannels(e)}toMIDIChannels(e){return this.validation&&console.warn("The toMIDIChannels() method has been deprecated. Use Utilities.sanitizeChannels() instead."),Utilities.sanitizeChannels(e)}guessNoteNumber(e){return this.validation&&console.warn("The guessNoteNumber() method has been deprecated. Use Utilities.guessNoteNumber() instead."),Utilities.guessNoteNumber(e,this.octaveOffset)}getValidNoteArray(e,l={}){return this.validation&&console.warn("The getValidNoteArray() method has been moved to the Utilities.buildNoteArray()"),Utilities.buildNoteArray(e,l)}convertToTimestamp(e){return this.validation&&console.warn("The convertToTimestamp() method has been moved to Utilities.toTimestamp()."),Utilities.toTimestamp(e)}async _destroyInputsAndOutputs(){let e=[];return this.inputs.forEach(l=>e.push(l.destroy())),this.outputs.forEach(l=>e.push(l.destroy())),Promise.all(e).then(()=>{this._inputs=[],this._outputs=[]})}_onInterfaceStateChange(e){this._updateInputsAndOutputs();let l={timestamp:e.timeStamp,type:e.port.state,target:this};if(e.port.state==="connected"&&e.port.connection==="open"){e.port.type==="output"?l.port=this.getOutputById(e.port.id):e.port.type==="input"&&(l.port=this.getInputById(e.port.id)),this.emit(e.port.state,l);const d=Object.assign({},l);d.type="portschanged",this.emit(d.type,d)}else if(e.port.state==="disconnected"&&e.port.connection==="pending"){e.port.type==="input"?l.port=this.getInputById(e.port.id,{disconnected:!0}):e.port.type==="output"&&(l.port=this.getOutputById(e.port.id,{disconnected:!0})),this.emit(e.port.state,l);const d=Object.assign({},l);d.type="portschanged",this.emit(d.type,d)}}async _updateInputsAndOutputs(){return Promise.all([this._updateInputs(),this._updateOutputs()])}async _updateInputs(){if(!this.interface)return;for(let l=this._inputs.length-1;l>=0;l--){const d=this._inputs[l];Array.from(this.interface.inputs.values()).find(b=>b===d._midiInput)||(this._disconnectedInputs.push(d),this._inputs.splice(l,1))}let e=[];return this.interface.inputs.forEach(l=>{if(!this._inputs.find(d=>d._midiInput===l)){let d=this._disconnectedInputs.find(p=>p._midiInput===l);d||(d=new Input(l)),this._inputs.push(d),e.push(d.open())}}),Promise.all(e)}async _updateOutputs(){if(!this.interface)return;for(let l=this._outputs.length-1;l>=0;l--){const d=this._outputs[l];Array.from(this.interface.outputs.values()).find(b=>b===d._midiOutput)||(this._disconnectedOutputs.push(d),this._outputs.splice(l,1))}let e=[];return this.interface.outputs.forEach(l=>{if(!this._outputs.find(d=>d._midiOutput===l)){let d=this._disconnectedOutputs.find(p=>p._midiOutput===l);d||(d=new Output(l)),this._outputs.push(d),e.push(d.open())}}),Promise.all(e)}get enabled(){return this.interface!==null}get inputs(){return this._inputs}get isNode(){return this.validation&&console.warn("WebMidi.isNode has been deprecated. Use Utilities.isNode instead."),Utilities.isNode}get isBrowser(){return this.validation&&console.warn("WebMidi.isBrowser has been deprecated. Use Utilities.isBrowser instead."),Utilities.isBrowser}get octaveOffset(){return this._octaveOffset}set octaveOffset(e){if(this.validation&&(e=parseInt(e),isNaN(e)))throw new TypeError("The 'octaveOffset' property must be an integer.");this._octaveOffset=e}get outputs(){return this._outputs}get supported(){return typeof navigator<"u"&&!!navigator.requestMIDIAccess}get sysexEnabled(){return!!(this.interface&&this.interface.sysexEnabled)}get time(){return performance.now()}get version(){return"3.1.12"}get flavour(){return"esm"}get CHANNEL_EVENTS(){return this.validation&&console.warn("The CHANNEL_EVENTS enum has been moved to Enumerations.CHANNEL_EVENTS."),Enumerations.CHANNEL_EVENTS}get MIDI_SYSTEM_MESSAGES(){return this.validation&&console.warn("The MIDI_SYSTEM_MESSAGES enum has been moved to Enumerations.SYSTEM_MESSAGES."),Enumerations.SYSTEM_MESSAGES}get MIDI_CHANNEL_MODE_MESSAGES(){return this.validation&&console.warn("The MIDI_CHANNEL_MODE_MESSAGES enum has been moved to Enumerations.CHANNEL_MODE_MESSAGES."),Enumerations.CHANNEL_MODE_MESSAGES}get MIDI_CONTROL_CHANGE_MESSAGES(){return this.validation&&console.warn("The MIDI_CONTROL_CHANGE_MESSAGES enum has been replaced by the Enumerations.CONTROL_CHANGE_MESSAGES array."),Enumerations.MIDI_CONTROL_CHANGE_MESSAGES}get MIDI_REGISTERED_PARAMETER(){return this.validation&&console.warn("The MIDI_REGISTERED_PARAMETER enum has been moved to Enumerations.REGISTERED_PARAMETERS."),Enumerations.REGISTERED_PARAMETERS}get NOTES(){return this.validation&&console.warn("The NOTES enum has been deprecated."),["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"]}};const wm=new WebMidi$1;wm.constructor=null;const _WebMidi=Object.freeze(Object.defineProperty({__proto__:null,Enumerations,Forwarder,Input,InputChannel,Message,Note,Output,OutputChannel,Utilities,WebMidi:wm},Symbol.toStringTag,{value:"Module"}));function getMidiDeviceNamesString(o){return o.map(e=>`'${e.name}'`).join(" | ")}function getDevice(o,e){if(typeof o=="number")return e[o];const l=b=>e.find(R=>R.name.includes(b));if(typeof o=="string")return l(o);const p=l("IAC")??e[0];if(!p)throw e.length?new Error(`🔌 Default MIDI device not found. Use one of ${getMidiDeviceNamesString(e)}`):new Error("🔌 No MIDI devices found. Connect a device or enable IAC Driver.");return p}class MidiInput{constructor(e){this.input=e,this.stateKey=typeof e=="string"?e:void 0,this._refs={},this._refsByChan={},this._loadAllStates(),this.initialDevice=this._startDeviceListener()}createCC(e,l){const d=l===void 0?this._refs:this._refsByChan[l];if(!(e in d)){const p=this._loadState(l);d[e]=p[e]||0}return ref$1(()=>d[e])}_startDeviceListener(){const e=getDevice(this.input,wm.inputs);return(async()=>{const l=this._onMidiMessage.bind(this);let d=e;for(;;){d||(d=await this._waitForDevice()),await new Promise(p=>setTimeout(p,2e3));try{this._sendAllStates(d)}catch(p){console.error("midiin: failed to send last state on connect:",d.name,p)}d.addListener("midimessage",l),await this._waitForDeviceDisconnect(d),d.removeListener("midimessage",l),d=null}})(),e}_waitForDevice(){return new Promise(e=>{const l=()=>{const d=getDevice(this.input,wm.inputs);d&&(logger$2(`[midi] device reconnected: ${d.name}`),wm.removeListener("connected",l),e(d))};wm.addListener("connected",l)})}_waitForDeviceDisconnect(e){return new Promise(l=>{const d=p=>{p.port.name===e.name&&(logger$2(`[midi] device disconnected: ${e.name}`),wm.removeListener("disconnected",d),l())};wm.addListener("disconnected",d)})}_onMidiMessage(e){const l=e.dataBytes[0],d=e.dataBytes[1],p=e.message.channel,b=d/127;this._refs[l]=b,this._refsByChan[p]??={},this._refsByChan[p][l]=b,this._saveState(void 0,l,b),this._saveState(p,l,b)}_loadAllStates(){Object.assign(this._refs,this._loadState(void 0));for(let e=1;e<=16;e++)this._refsByChan[e]??={},Object.assign(this._refsByChan[e],this._loadState(e))}_loadState(e){if(!this.stateKey)return{};const l=localStorage.getItem(`strudel-midin-${this.stateKey}-chan${e!==void 0?e:"all"}`);if(!l)return{};try{return JSON.parse(l)}catch(d){return console.warn(`Failed to parse MIDI state from localStorage for input "${this.stateKey}" and channel "${e}"`,l,d),{}}}_saveState(e,l,d){if(!this.stateKey)return;const p=this._loadState(e);p[l]=d,localStorage.setItem(`strudel-midin-${this.stateKey}-chan${e!==void 0?e:"all"}`,JSON.stringify(p))}_sendAllStates(e){const l=wm.outputs.find(d=>d.name===e.name);if(l)for(const[d,p]of Object.entries(this._refsByChan)){const b=Number(d);for(const[R,I]of Object.entries(p)){const z=Number(R),se=Math.round(I*127);l.sendControlChange(z,se,b)}}}}const{WebMidi}=_WebMidi;function supportsMidi(){return typeof navigator.requestMIDIAccess=="function"}function enableWebMidi(o={}){const{onReady:e,onConnected:l,onDisconnected:d,onEnabled:p}=o;if(!WebMidi.enabled){if(!supportsMidi())throw new Error("Your Browser does not support WebMIDI.");return WebMidi.addListener("connected",()=>{l?.(WebMidi)}),WebMidi.addListener("enabled",()=>{p?.(WebMidi)}),WebMidi.addListener("disconnected",b=>{d?.(WebMidi,b)}),new Promise((b,R)=>{if(WebMidi.enabled){b(WebMidi);return}WebMidi.enable(I=>{I&&R(I),e?.(WebMidi),b(WebMidi)},{sysex:!0})})}}typeof window<"u"&&window.addEventListener("message",o=>{WebMidi?.enabled&&o.data==="strudel-stop"&&WebMidi.outputs.forEach(e=>e.sendStop())});const midicontrolMap=new Map;function unifyMapping(o){return Object.fromEntries(Object.entries(o).map(([e,l])=>(typeof l=="number"&&(l={ccn:l}),[getControlName(e),l])))}function githubPath(o,e=""){if(!o.startsWith("github:"))throw new Error('expected "github:" at the start of pseudoUrl');let[l,d]=o.split("github:");return d=d.endsWith("/")?d.slice(0,-1):d,d.split("/").length===2&&(d+="/main"),`https://raw.githubusercontent.com/${d}/${e}`}function defaultmidimap(o){midicontrolMap.set("default",unifyMapping(o))}let loadCache={};async function midimaps(o){typeof o=="string"&&(o.startsWith("github:")&&(o=githubPath(o,"midimap.json")),loadCache[o]||(loadCache[o]=fetch(o).then(e=>e.json())),o=await loadCache[o]),typeof o=="object"&&Object.entries(o).forEach(([e,l])=>midicontrolMap.set(e,unifyMapping(l)))}const midisoundMap=new Map;function normalize(o=0,e=0,l=1,d=1){if(e===l)throw new Error("min and max cannot be the same value");let p=(o-e)/(l-e);return p=Math.min(1,Math.max(0,p)),Math.pow(p,d)}function mapCC(o,e){return Object.keys(e).filter(l=>!!o[getControlName(l)]).map(l=>{const{ccn:d,min:p=0,max:b=1,exp:R=1}=o[l],I=normalize(e[l],p,b,R);return{ccn:d,ccv:I}})}function sendCC(o,e,l,d,p){if(typeof e!="number"||e<0||e>1)throw new Error("expected ccv to be a number between 0 and 1");if(!["string","number"].includes(typeof o))throw new Error("expected ccn to be a number or a string");const b=Math.round(e*127);scheduleAtTime(()=>{l.sendControlChange(o,b,d)},p)}function sendProgramChange(o,e,l,d){if(typeof o!="number"||o<0||o>127)throw new Error("expected progNum (program change) to be a number between 0 and 127");scheduleAtTime(()=>{e.sendProgramChange(o,l)},d)}function sendSysex(o,e,l,d){if(Array.isArray(o)){if(!o.every(p=>Number.isInteger(p)&&p>=0&&p<=255))throw new Error("all sysexid bytes must be integers between 0 and 255")}else if(!Number.isInteger(o)||o<0||o>255)throw new Error("A:sysexid must be an number between 0 and 255 or an array of such integers");if(!Array.isArray(e))throw new Error("expected sysex to be an array of numbers (0-255)");if(!e.every(p=>Number.isInteger(p)&&p>=0&&p<=255))throw new Error("all sysex bytes must be integers between 0 and 255");scheduleAtTime(()=>{l.sendSysex(o,e)},d)}function sendNRPN(o,e,l,d,p){if(Array.isArray(o)){if(!o.every(b=>Number.isInteger(b)&&b>=0&&b<=255))throw new Error("all nrpnn bytes must be integers between 0 and 255")}else if(!Number.isInteger(e)||e<0||e>255)throw new Error("A:sysexid must be an number between 0 and 255 or an array of such integers");scheduleAtTime(()=>{l.sendNRPN(o,e,d)},p)}function sendPitchBend(o,e,l,d){if(typeof o!="number"||o<-1||o>1)throw new Error("expected midibend to be a number between -1 and 1");scheduleAtTime(()=>{e.sendPitchBend(o,l)},d)}function sendAftertouch(o,e,l,d){if(typeof o!="number"||o<0||o>1)throw new Error("expected miditouch to be a number between 0 and 1");scheduleAtTime(()=>{e.sendChannelAftertouch(o,l)},d)}function sendNote(o,e,l,d,p,b){if(o==null||o==="")throw new Error("note cannot be null or empty");if(e!=null&&(typeof e!="number"||e<0||e>1))throw new Error("velocity must be a number between 0 and 1");if(l!=null&&(typeof l!="number"||l<0))throw new Error("duration must be a positive number");const R=typeof o=="number"?o:noteToMidi$1(o),I=new Note(R,{attack:e,duration:l});scheduleAtTime(()=>{d.playNote(I,p)},b)}Pattern$1.prototype.midi=function(o,e={}){if(isPattern(o))throw new Error(`.midi does not accept Pattern input for midiport. Make sure to pass device name with single quotes. Example: .midi('${WebMidi.outputs?.[0]?.name||"IAC Driver Bus 1"}')`);if(typeof o=="object"){const{port:d,isController:p=!1,...b}=o;e={isController:p,...b,...e},o=d}let l={isController:!1,noteOffsetMs:10,midichannel:1,velocity:.9,gain:1,midimap:"default",midiport:o,...e};return enableWebMidi({onEnabled:({outputs:d})=>{const p=getDevice(l.midiport,d),b=d.filter(R=>R.name!==p.name);logger$2(`Midi enabled! Using "${p.name}". ${b?.length?`Also available: ${getMidiDeviceNamesString(b)}`:""}`)},onDisconnected:({outputs:d})=>logger$2(`Midi device disconnected! Available: ${getMidiDeviceNamesString(d)}`)}),this.onTrigger((d,p,b,R)=>{if(!WebMidi.enabled){logger$2("Midi not enabled");return}d.ensureObjectValue();let{note:I,nrpnn:z,nrpv:se,ccn:le,ccv:tn,midichan:an=l.midichannel,midicmd:sn,midibend:ln,miditouch:un,polyTouch:pn,gain:yn=l.gain,velocity:_n=l.velocity,progNum:Pn,sysexid:vn,sysexdata:bn,midimap:Sn=l.midimap,midiport:An=l.midiport}=d.value;const Dn=getDevice(An,WebMidi.outputs);if(!Dn){logger$2(`[midi] midiport "${An}" not found! available: ${WebMidi.outputs.map(Bn=>`'${Bn.name}'`).join(", ")}`);return}if(_n=yn*_n,midicontrolMap.has(Sn)?mapCC(midicontrolMap.get(Sn),d.value).forEach(({ccn:Nn,ccv:Qn})=>sendCC(Nn,Qn,Dn,an,R)):Sn!=="default"&&logger$2(`[midi] midimap "${Sn}" not found! Available maps: ${[...midicontrolMap.keys()].join(", ")}`),I!==void 0&&!l.isController){const Bn=d.duration.valueOf()/b*1e3-l.noteOffsetMs;sendNote(I,_n,Bn,Dn,an,R)}if(Pn!==void 0&&sendProgramChange(Pn,Dn,an,R),vn!==void 0&&bn!==void 0&&sendSysex(vn,bn,Dn,R),tn!==void 0&&le!==void 0&&sendCC(le,tn,Dn,an,R),z!==void 0&&se!==void 0&&sendNRPN(z,se,Dn,an,R),ln!==void 0&&sendPitchBend(ln,Dn,an,R),un!==void 0&&sendAftertouch(un,Dn,an,R),d.whole.begin+0===0&&scheduleAtTime(()=>{Dn.sendStart()},R),["clock","midiClock"].includes(sn))scheduleAtTime(()=>{Dn.sendClock()},R);else if(["start"].includes(sn))scheduleAtTime(()=>{Dn.sendStart()},R);else if(["stop"].includes(sn))scheduleAtTime(()=>{Dn.sendStop()},R);else if(["continue"].includes(sn))scheduleAtTime(()=>{Dn.sendContinue()},R);else if(Array.isArray(sn)){if(sn[0]==="progNum")sendProgramChange(sn[1],Dn,an,R);else if(sn[0]==="cc")sn.length===2&&sendCC(sn[0],sn[1]/127,Dn,an,R);else if(sn[0]==="sysex"&&sn.length===3){const[Bn,Nn,Qn]=sn;sendSysex(Nn,Qn,Dn,R)}}})};async function _initializeInput(o){if(isPattern(o))throw new Error(`[midi] Midi input cannot be a pattern. Make sure to pass device name with single quotes. Example: midin('${WebMidi.outputs?.[0]?.name||"IAC Driver Bus 1"}')`);const e=await enableWebMidi(),l=midiInputs[o]||new MidiInput(o);if(midiInputs[o]=l,e){const d=l.initialDevice,p=WebMidi.inputs.filter(b=>b.name!==d.name);logger$2(d?`[midi] Midi enabled! Using "${d.name}". ${p?.length?`Also available: ${getMidiDeviceNamesString(p)}`:""}`:`[midi] Midi enabled! Waiting for device "${o}"... Currently connected devices: ${getMidiDeviceNamesString(WebMidi.inputs)}`)}return l}const midiInputs={};async function midin(o){const e=await _initializeInput(o);return e.createCC.bind(e)}const kHaps={},kListeners={};function _triggerKeyboard(o,e,l,d){const p=getPattern(),b=getTriggerFunc();if(!p||!b)return!1;const R=l+d,I=1e-6,se=p.queryArc(R-I,R+I,{_cps:e}).filter(tn=>tn.value?.midikey?.startsWith(`${o}_`)),le=getAudioContext().currentTime;return se.length?(se.forEach(tn=>{if(!tn.hasOnset())return;const an=le+(tn.whole.begin-l)/e,sn=tn.duration/e;b(tn,an-le,sn,e,an)}),!0):!1}async function midikeys(o){const l=(await _initializeInput(o)).initialDevice;if(!l)throw new Error(`[midi] Midi device "${o}" not found.. connected devices: ${getMidiDeviceNamesString(WebMidi.inputs)}`);return kHaps[o]||(kHaps[o]=[]),kListeners[o]&&l.removeListener("midimessage",kListeners[o]),kListeners[o]=p=>{const{dataBytes:b,message:R}=p,I=R.command===9;let z=R.command===8;if(!getIsStarted()||!I&&!z)return;const[tn,an]=b;z||=I&&an===0;const sn=`${o}_${tn}`,ln=getCps()??.5,un=!!(getPattern()&&getTriggerFunc()),pn=un?.01:.06,yn=getTime(),_n=yn+pn*ln,Pn=new TimeSpan(_n,_n);let vn={midikey:sn};z||(vn={...vn,note:Math.round(tn),velocity:an/127},kHaps[o].push(new Hap(Pn,Pn,vn,{})),!z&&un&&_triggerKeyboard(o,ln,yn,pn*ln)&&(kHaps[o]=[]))},l.addListener("midimessage",kListeners[o]),(p=.5)=>{const b=reify(p),R=I=>{const z=kHaps[o].flatMap(se=>b.query(I.setSpan(se.wholeOrPart())).map(tn=>{const an=tn.value??.5,sn=new TimeSpan(se.whole.begin,se.whole.begin.add(an)),ln=new TimeSpan(se.part.begin,se.part.begin.add(an)),un=se.combineContext(tn);return new Hap(sn,ln,se.value,un)}));return I.controls.cyclist&&(kHaps[o]=[]),z};return new Pattern$1(R)}}const index=Object.freeze(Object.defineProperty({__proto__:null,WebMidi,defaultmidimap,enableWebMidi,midicontrolMap,midikeys,midimaps,midin,midisoundMap},Symbol.toStringTag,{value:"Module"}));return exports.prebake=prebake,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),exports}({});
|