Skip to content

Instantly share code, notes, and snippets.

@lichin-lin
Created September 3, 2025 23:13
Show Gist options
  • Save lichin-lin/d99126cfd0b6ad5ed9e7612c99f4c4ad to your computer and use it in GitHub Desktop.
Save lichin-lin/d99126cfd0b6ad5ed9e7612c99f4c4ad to your computer and use it in GitHub Desktop.
strudel-repl.js
This file has been truncated, but you can view the full file.
var strudel=function(exports){"use strict";var _documentCurrentScript=typeof document<"u"?document.currentScript:null;typeof BigInt>"u"&&(BigInt=function(l){if(isNaN(l))throw new Error("");return l});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={s:C_ONE,n:C_ZERO,d:C_ONE};function assign(l,a){try{l=BigInt(l)}catch{throw InvalidParameter()}return l*a}function trunc(l){return typeof l=="bigint"?l:Math.floor(l)}function newFraction(l,a){if(a===C_ZERO)throw DivisionByZero();const o=Object.create(Fraction.prototype);o.s=l<C_ZERO?-C_ONE:C_ONE,l=l<C_ZERO?-l:l;const u=gcd$1(l,a);return o.n=l/u,o.d=a/u,o}function factorize(l){const a={};let o=l,u=C_TWO,d=C_FIVE-C_ONE;for(;d<=o;){for(;o%u===C_ZERO;)o/=u,a[u]=(a[u]||C_ZERO)+C_ONE;d+=C_ONE+C_TWO*u++}return o!==l?o>1&&(a[o]=(a[o]||C_ZERO)+C_ONE):a[l]=(a[l]||C_ZERO)+C_ONE,a}const parse$7=function(l,a){let o=C_ZERO,u=C_ONE,d=C_ONE;if(l!=null)if(a!==void 0){if(typeof l=="bigint")o=l;else{if(isNaN(l))throw InvalidParameter();if(l%1!==0)throw NonIntegerParameter();o=BigInt(l)}if(typeof a=="bigint")u=a;else{if(isNaN(a))throw InvalidParameter();if(a%1!==0)throw NonIntegerParameter();u=BigInt(a)}d=o*u}else if(typeof l=="object"){if("d"in l&&"n"in l)o=BigInt(l.n),u=BigInt(l.d),"s"in l&&(o*=BigInt(l.s));else if(0 in l)o=BigInt(l[0]),1 in l&&(u=BigInt(l[1]));else if(typeof l=="bigint")o=l;else throw InvalidParameter();d=o*u}else if(typeof l=="number"){if(isNaN(l))throw InvalidParameter();if(l<0&&(d=-C_ONE,l=-l),l%1===0)o=BigInt(l);else if(l>0){let f=1,p=0,g=1,b=1,O=1,S=1e7;for(l>=1&&(f=10**Math.floor(1+Math.log10(l)),l/=f);g<=S&&O<=S;){let A=(p+b)/(g+O);if(l===A){g+O<=S?(o=p+b,u=g+O):O>g?(o=b,u=O):(o=p,u=g);break}else l>A?(p+=b,g+=O):(b+=p,O+=g),g>S?(o=b,u=O):(o=p,u=g)}o=BigInt(o)*BigInt(f),u=BigInt(u)}}else if(typeof l=="string"){let f=0,p=C_ZERO,g=C_ZERO,b=C_ZERO,O=C_ONE,S=C_ONE,A=l.replace(/_/g,"").match(/\d+|./g);if(A===null)throw InvalidParameter();if(A[f]==="-"?(d=-C_ONE,f++):A[f]==="+"&&f++,A.length===f+1?g=assign(A[f++],d):A[f+1]==="."||A[f]==="."?(A[f]!=="."&&(p=assign(A[f++],d)),f++,(f+1===A.length||A[f+1]==="("&&A[f+3]===")"||A[f+1]==="'"&&A[f+3]==="'")&&(g=assign(A[f],d),O=C_TEN**BigInt(A[f].length),f++),(A[f]==="("&&A[f+2]===")"||A[f]==="'"&&A[f+2]==="'")&&(b=assign(A[f+1],d),S=C_TEN**BigInt(A[f+1].length)-C_ONE,f+=3)):A[f+1]==="/"||A[f+1]===":"?(g=assign(A[f],d),O=assign(A[f+2],C_ONE),f+=3):A[f+3]==="/"&&A[f+1]===" "&&(p=assign(A[f],d),g=assign(A[f+2],d),O=assign(A[f+4],C_ONE),f+=5),A.length<=f)u=O*S,d=o=b+u*p+S*g;else throw InvalidParameter()}else if(typeof l=="bigint")o=l,d=l,u=C_ONE;else throw InvalidParameter();if(u===C_ZERO)throw DivisionByZero();P.s=d<C_ZERO?-C_ONE:C_ONE,P.n=o<C_ZERO?-o:o,P.d=u<C_ZERO?-u:u};function modpow(l,a,o){let u=C_ONE;for(;a>C_ZERO;l=l*l%o,a>>=C_ONE)a&C_ONE&&(u=u*l%o);return u}function cycleLen(l,a){for(;a%C_TWO===C_ZERO;a/=C_TWO);for(;a%C_FIVE===C_ZERO;a/=C_FIVE);if(a===C_ONE)return C_ZERO;let o=C_TEN%a,u=1;for(;o!==C_ONE;u++)if(o=o*C_TEN%a,u>MAX_CYCLE_LEN)return C_ZERO;return BigInt(u)}function cycleStart(l,a,o){let u=C_ONE,d=modpow(C_TEN,o,a);for(let f=0;f<300;f++){if(u===d)return BigInt(f);u=u*C_TEN%a,d=d*C_TEN%a}return 0}function gcd$1(l,a){if(!l)return a;if(!a)return l;for(;;){if(l%=a,!l)return a;if(a%=l,!a)return l}}function Fraction(l,a){if(parse$7(l,a),this instanceof Fraction)l=gcd$1(P.d,P.n),this.s=P.s,this.n=P.n/l,this.d=P.d/l;else return newFraction(P.s*P.n,P.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(l,a){return parse$7(l,a),newFraction(this.s*this.n*P.d+P.s*this.d*P.n,this.d*P.d)},sub:function(l,a){return parse$7(l,a),newFraction(this.s*this.n*P.d-P.s*this.d*P.n,this.d*P.d)},mul:function(l,a){return parse$7(l,a),newFraction(this.s*P.s*this.n*P.n,this.d*P.d)},div:function(l,a){return parse$7(l,a),newFraction(this.s*P.s*this.n*P.d,this.d*P.n)},clone:function(){return newFraction(this.s*this.n,this.d)},mod:function(l,a){if(l===void 0)return newFraction(this.s*this.n%this.d,C_ONE);if(parse$7(l,a),C_ZERO===P.n*this.d)throw DivisionByZero();return newFraction(this.s*(P.d*this.n)%(P.n*this.d),P.d*this.d)},gcd:function(l,a){return parse$7(l,a),newFraction(gcd$1(P.n,this.n)*gcd$1(P.d,this.d),P.d*this.d)},lcm:function(l,a){return parse$7(l,a),P.n===C_ZERO&&this.n===C_ZERO?newFraction(C_ZERO,C_ONE):newFraction(P.n*this.n,gcd$1(P.n,this.n)*gcd$1(P.d,this.d))},inverse:function(){return newFraction(this.s*this.d,this.n)},pow:function(l,a){if(parse$7(l,a),P.d===C_ONE)return P.s<C_ZERO?newFraction((this.s*this.d)**P.n,this.n**P.n):newFraction((this.s*this.n)**P.n,this.d**P.n);if(this.s<C_ZERO)return null;let o=factorize(this.n),u=factorize(this.d),d=C_ONE,f=C_ONE;for(let p in o)if(p!=="1"){if(p==="0"){d=C_ZERO;break}if(o[p]*=P.n,o[p]%P.d===C_ZERO)o[p]/=P.d;else return null;d*=BigInt(p)**o[p]}for(let p in u)if(p!=="1"){if(u[p]*=P.n,u[p]%P.d===C_ZERO)u[p]/=P.d;else return null;f*=BigInt(p)**u[p]}return P.s<C_ZERO?newFraction(f,d):newFraction(d,f)},log:function(l,a){if(parse$7(l,a),this.s<=C_ZERO||P.s<=C_ZERO)return null;const o={},u=factorize(P.n),d=factorize(P.d),f=factorize(this.n),p=factorize(this.d);for(const O in d)u[O]=(u[O]||C_ZERO)-d[O];for(const O in p)f[O]=(f[O]||C_ZERO)-p[O];for(const O in u)O!=="1"&&(o[O]=!0);for(const O in f)O!=="1"&&(o[O]=!0);let g=null,b=null;for(const O in o){const S=u[O]||C_ZERO,A=f[O]||C_ZERO;if(S===C_ZERO){if(A!==C_ZERO)return null;continue}let M=A,E=S;const R=gcd$1(M,E);if(M/=R,E/=R,g===null&&b===null)g=M,b=E;else if(M*b!==g*E)return null}return g!==null&&b!==null?newFraction(g,b):null},equals:function(l,a){return parse$7(l,a),this.s*this.n*P.d===P.s*P.n*this.d},lt:function(l,a){return parse$7(l,a),this.s*this.n*P.d<P.s*P.n*this.d},lte:function(l,a){return parse$7(l,a),this.s*this.n*P.d<=P.s*P.n*this.d},gt:function(l,a){return parse$7(l,a),this.s*this.n*P.d>P.s*P.n*this.d},gte:function(l,a){return parse$7(l,a),this.s*this.n*P.d>=P.s*P.n*this.d},compare:function(l,a){parse$7(l,a);let o=this.s*this.n*P.d-P.s*P.n*this.d;return(C_ZERO<o)-(o<C_ZERO)},ceil:function(l){return l=C_TEN**BigInt(l||0),newFraction(trunc(this.s*l*this.n/this.d)+(l*this.n%this.d>C_ZERO&&this.s>=C_ZERO?C_ONE:C_ZERO),l)},floor:function(l){return l=C_TEN**BigInt(l||0),newFraction(trunc(this.s*l*this.n/this.d)-(l*this.n%this.d>C_ZERO&&this.s<C_ZERO?C_ONE:C_ZERO),l)},round:function(l){return l=C_TEN**BigInt(l||0),newFraction(trunc(this.s*l*this.n/this.d)+this.s*((this.s>=C_ZERO?C_ONE:C_ZERO)+C_TWO*(l*this.n%this.d)>this.d?C_ONE:C_ZERO),l)},roundTo:function(l,a){parse$7(l,a);const o=this.n*P.d,u=this.d*P.n,d=o%u;let f=trunc(o/u);return d+d>=u&&f++,newFraction(this.s*f*P.n,P.d)},divisible:function(l,a){return parse$7(l,a),!(!(P.n*this.d)||this.n*P.d%(P.n*this.d))},valueOf:function(){return Number(this.s*this.n)/Number(this.d)},toString:function(l){let a=this.n,o=this.d;l=l||15;let u=cycleLen(a,o),d=cycleStart(a,o,u),f=this.s<C_ZERO?"-":"";if(f+=trunc(a/o),a%=o,a*=C_TEN,a&&(f+="."),u){for(let p=d;p--;)f+=trunc(a/o),a%=o,a*=C_TEN;f+="(";for(let p=u;p--;)f+=trunc(a/o),a%=o,a*=C_TEN;f+=")"}else for(let p=l;a&&p--;)f+=trunc(a/o),a%=o,a*=C_TEN;return f},toFraction:function(l){let a=this.n,o=this.d,u=this.s<C_ZERO?"-":"";if(o===C_ONE)u+=a;else{let d=trunc(a/o);l&&d>C_ZERO&&(u+=d,u+=" ",a%=o),u+=a,u+="/",u+=o}return u},toLatex:function(l){let a=this.n,o=this.d,u=this.s<C_ZERO?"-":"";if(o===C_ONE)u+=a;else{let d=trunc(a/o);l&&d>C_ZERO&&(u+=d,a%=o),u+="\\frac{",u+=a,u+="}{",u+=o,u+="}"}return u},toContinued:function(){let l=this.n,a=this.d,o=[];do{o.push(trunc(l/a));let u=l%a;l=a,a=u}while(l!==C_ONE);return o},simplify:function(l){const a=BigInt(1/(l||.001)|0),o=this.abs(),u=o.toContinued();for(let d=1;d<u.length;d++){let f=newFraction(u[d-1],C_ONE);for(let g=d-2;g>=0;g--)f=f.inverse().add(u[g]);let p=f.sub(o);if(p.n*a<p.d)return f.mul(this.s)}return this}};const logKey="strudel.log";let debounce=1e3,lastMessage,lastTime;function errorLogger$1(l,a="cyclist"){logger$2(`[${a}] error: ${l.message}`)}function logger$2(l,a,o={}){let u=performance.now();lastMessage===l&&u-lastTime<debounce||(lastMessage=l,lastTime=u,console.log(`%c${l}`,"background-color: black;color:white;border-radius:15px"),typeof document<"u"&&typeof CustomEvent<"u"&&document.dispatchEvent(new CustomEvent(logKey,{detail:{message:l,type:a,data:o}})))}logger$2.key=logKey;const isNoteWithOctave=l=>/^[a-gA-G][#bs]*[0-9]$/.test(l),isNote=l=>/^[a-gA-G][#bsf]*[0-9]?$/.test(l),tokenizeNote$3=l=>{if(typeof l!="string")return[];const[a,o="",u]=l.match(/^([a-gA-G])([#bsf]*)([0-9]*)$/)?.slice(1)||[];return a?[a,o,u?Number(u):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},noteToMidi$1=(l,a=3)=>{const[o,u,d=a]=tokenizeNote$3(l);if(!o)throw new Error('not a note: "'+l+'"');const f=chromas$2[o.toLowerCase()],p=u?.split("").reduce((g,b)=>g+accs$2[b],0)||0;return(Number(d)+1)*12+f+p},midiToFreq$2=l=>Math.pow(2,(l-69)/12)*440,freqToMidi$2=l=>12*Math.log(l/440)/Math.LN2+69,valueToMidi$1=(l,a)=>{if(typeof l!="object")throw new Error("valueToMidi: expected object value");let{freq:o,note:u}=l;if(typeof o=="number")return freqToMidi$2(o);if(typeof u=="string")return noteToMidi$1(u);if(typeof u=="number")return u;if(!a)throw new Error("valueToMidi: expected freq or note to be set");return a},getEventOffsetMs=(l,a)=>(l-a)*1e3,getFreq=l=>midiToFreq$2(typeof l=="number"?l:noteToMidi$1(l)),pcs$1=["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"],midi2note$1=l=>{const a=Math.floor(l/12)-1;return pcs$1[l%12]+a},_mod$1=(l,a)=>(l%a+a)%a,averageArray=l=>l.reduce((a,o)=>a+o)/l.length;function nanFallback$1(l,a=0){return isNaN(Number(l))?(logger$2(`"${l}" is not a number, falling back to ${a}`,"warning"),a):l}const getSoundIndex$1=(l,a)=>_mod$1(Math.round(nanFallback$1(l??0,0)),a),getPlayableNoteValue=l=>{let{value:a,context:o}=l,u=a;if(typeof u=="object"&&!Array.isArray(u)&&(u=u.note||u.n||u.value,u===void 0))throw new Error(`cannot find a playable note for ${JSON.stringify(a)}`);if(typeof u=="number"&&o.type!=="frequency")u=midiToFreq$2(l.value);else if(typeof u=="number"&&o.type==="frequency")u=l.value;else if(typeof u!="string"||!isNote(u))throw new Error("not a note: "+JSON.stringify(u));return u},getFrequency=l=>{let{value:a,context:o}=l;if(typeof a=="object")return a.freq?a.freq:getFreq(a.note||a.n||a.value);if(typeof a=="number"&&o.type!=="frequency")a=midiToFreq$2(l.value);else if(typeof a=="string"&&isNote(a))a=midiToFreq$2(noteToMidi$1(l.value));else if(typeof a!="number")throw new Error("not a note or frequency: "+a);return a},rotate$2=(l,a)=>l.slice(a).concat(l.slice(0,a)),pipe=(...l)=>l.reduce((a,o)=>(...u)=>a(o(...u)),a=>a),compose=(...l)=>pipe(...l.reverse()),removeUndefineds=l=>l.filter(a=>a!=null),flatten$1=l=>[].concat(...l),id$1=l=>l,constant=(l,a)=>l,listRange=(l,a)=>Array.from({length:a-l+1},(o,u)=>u+l);function curry(l,a,o=l.length){const u=function d(...f){if(f.length>=o)return l.apply(this,f);{const p=function(...g){return d.apply(this,f.concat(g))};return a&&a(p,f),p}};return a&&a(u,[]),u}function parseNumeral(l){const a=Number(l);if(!isNaN(a))return a;if(isNote(l))return noteToMidi$1(l);throw new Error(`cannot parse as numeral: "${l}"`)}function mapArgs(l,a){return(...o)=>l(...o.map(a))}function numeralArgs(l){return mapArgs(l,parseNumeral)}function parseFractional(l){const a=Number(l);if(!isNaN(a))return a;const o={pi:Math.PI,w:1,h:.5,q:.25,e:.125,s:.0625,t:1/3,f:.2,x:1/6}[l];if(typeof o<"u")return o;throw new Error(`cannot parse as fractional: "${l}"`)}const fractionalArgs=l=>mapArgs(l,parseFractional),splitAt=function(l,a){return[a.slice(0,l),a.slice(l)]},zipWith=(l,a,o)=>a.map((u,d)=>l(u,o[d])),pairs=function(l){const a=[];for(let o=0;o<l.length-1;++o)a.push([l[o],l[o+1]]);return a},clamp$1=(l,a,o)=>Math.min(Math.max(l,a),o),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=(l,a="letters")=>{const u=(a==="solfeggio"?solfeggio:a==="indian"?indian:a==="german"?german:a==="byzantine"?byzantine:a==="japanese"?japanese:english)[l%12],d=Math.floor(l/12)-1;return u+d};function uniq(l){var a={};return l.filter(function(o){return a.hasOwn(o)?!1:a[o]=!0})}function uniqsort(l){return l.sort().filter(function(a,o,u){return!o||a!=u[o-1]})}function uniqsortr(l){return l.sort((a,o)=>a.compare(o)).filter(function(a,o,u){return!o||a.ne(u[o-1])})}function unicodeToBase64(l){const a=new TextEncoder().encode(l);return btoa(String.fromCharCode(...a))}function base64ToUnicode(l){const a=new Uint8Array(atob(l).split("").map(u=>u.charCodeAt(0)));return new TextDecoder().decode(a)}function code2hash(l){return encodeURIComponent(unicodeToBase64(l))}function hash2code(l){return base64ToUnicode(decodeURIComponent(l))}function objectMap(l,a){return Array.isArray(l)?l.map(a):Object.fromEntries(Object.entries(l).map(([o,u],d)=>[o,a(u,o,d)]))}function cycleToSeconds$1(l,a){return l/a}class ClockCollator{constructor({getTargetClockTime:a=getUnixTimeSeconds,weight:o=16,offsetDelta:u=.005,checkAfterTime:d=2,resetAfterTime:f=8}){this.offsetTime,this.timeAtPrevOffsetSample,this.prevOffsetTimes=[],this.getTargetClockTime=a,this.weight=o,this.offsetDelta=u,this.checkAfterTime=d,this.resetAfterTime=f,this.reset=()=>{this.prevOffsetTimes=[],this.offsetTime=null,this.timeAtPrevOffsetSample=null}}calculateOffset(a){const o=this.getTargetClockTime(),u=o-this.timeAtPrevOffsetSample,d=o-a;if(u>this.resetAfterTime&&this.reset(),this.offsetTime==null&&(this.offsetTime=d),this.prevOffsetTimes.push(d),this.prevOffsetTimes.length>this.weight&&this.prevOffsetTimes.shift(),this.timeAtPrevOffsetSample==null||u>this.checkAfterTime){this.timeAtPrevOffsetSample=o;const f=averageArray(this.prevOffsetTimes);Math.abs(f-this.offsetTime)>this.offsetDelta&&(this.offsetTime=f)}return this.offsetTime}calculateTimestamp(a,o){return this.calculateOffset(a)+o}}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",l=>{keyState[l.key]=!0}),window.addEventListener("keyup",l=>{keyState[l.key]=!1})}return{...keyState}}function stringifyValues(l,a=!1){return typeof l=="object"?a?JSON.stringify(l).slice(1,-1).replaceAll('"',"").replaceAll(","," "):JSON.stringify(l):l}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(l){return this.compare(l)<0},Fraction.prototype.gt=function(l){return this.compare(l)>0},Fraction.prototype.lte=function(l){return this.compare(l)<=0},Fraction.prototype.gte=function(l){return this.compare(l)>=0},Fraction.prototype.eq=function(l){return this.compare(l)==0},Fraction.prototype.ne=function(l){return this.compare(l)!=0},Fraction.prototype.max=function(l){return this.gt(l)?this:l},Fraction.prototype.maximum=function(...l){return l=l.map(a=>new Fraction(a)),l.reduce((a,o)=>o.max(a),this)},Fraction.prototype.min=function(l){return this.lt(l)?this:l},Fraction.prototype.mulmaybe=function(l){return l!==void 0?this.mul(l):void 0},Fraction.prototype.divmaybe=function(l){return l!==void 0?this.div(l):void 0},Fraction.prototype.addmaybe=function(l){return l!==void 0?this.add(l):void 0},Fraction.prototype.submaybe=function(l){return l!==void 0?this.sub(l):void 0},Fraction.prototype.show=function(){return this.s*this.n+"/"+this.d},Fraction.prototype.or=function(l){return this.eq(0)?l:this};const fraction$1=l=>Fraction(l),gcd=(...l)=>{if(l=removeUndefineds(l),l.length!==0)return l.reduce((a,o)=>a.gcd(o),fraction$1(1))},lcm=(...l)=>{if(l=removeUndefineds(l),l.length===0)return;const a=l.pop();return l.reduce((o,u)=>o===void 0||u===void 0?void 0:o.lcm(u),a)};fraction$1._original=Fraction;class TimeSpan{constructor(a,o){this.begin=fraction$1(a),this.end=fraction$1(o)}get spanCycles(){const a=[];var o=this.begin;const u=this.end,d=u.sam();if(o.equals(u))return[new TimeSpan(o,u)];for(;u.gt(o);){if(o.sam().equals(d)){a.push(new TimeSpan(o,this.end));break}const f=o.nextSam();a.push(new TimeSpan(o,f)),o=f}return a}get duration(){return this.end.sub(this.begin)}cycleArc(){const a=this.begin.cyclePos(),o=a.add(this.duration);return new TimeSpan(a,o)}withTime(a){return new TimeSpan(a(this.begin),a(this.end))}withEnd(a){return new TimeSpan(this.begin,a(this.end))}withCycle(a){const o=this.begin.sam(),u=o.add(a(this.begin.sub(o))),d=o.add(a(this.end.sub(o)));return new TimeSpan(u,d)}intersection(a){const o=this.begin.max(a.begin),u=this.end.min(a.end);if(!o.gt(u)&&!(o.equals(u)&&(o.equals(this.end)&&this.begin.lt(this.end)||o.equals(a.end)&&a.begin.lt(a.end))))return new TimeSpan(o,u)}intersection_e(a){const o=this.intersection(a);if(o==null)throw"TimeSpans do not intersect";return o}midpoint(){return this.begin.add(this.duration.div(fraction$1(2)))}equals(a){return this.begin.equals(a.begin)&&this.end.equals(a.end)}show(){return this.begin.show()+" → "+this.end.show()}}class Hap{constructor(a,o,u,d={},f=!1){this.whole=a,this.part=o,this.value=u,this.context=d,this.stateful=f,f&&console.assert(typeof this.value=="function","Stateful values must be functions")}get duration(){let a;return typeof this.value?.duration=="number"?a=fraction$1(this.value.duration):a=this.whole.end.sub(this.whole.begin),typeof this.value?.clip=="number"?a.mul(this.value.clip):a}get endClipped(){return this.whole.begin.add(this.duration)}isActive(a){return this.whole.begin<=a&&this.endClipped>=a}isInPast(a){return a>this.endClipped}isInNearPast(a,o){return o-a<=this.endClipped}isInFuture(a){return a<this.whole.begin}isInNearFuture(a,o){return o<this.whole.begin&&o>this.whole.begin-a}isWithinTime(a,o){return this.whole.begin<=o&&this.endClipped>=a}wholeOrPart(){return this.whole?this.whole:this.part}withSpan(a){const o=this.whole?a(this.whole):void 0;return new Hap(o,a(this.part),this.value,this.context)}withValue(a){return new Hap(this.whole,this.part,a(this.value),this.context)}hasOnset(){return this.whole!=null&&this.whole.begin.equals(this.part.begin)}hasTag(a){return this.context.tags?.includes(a)}resolveState(a){if(this.stateful&&this.hasOnset()){console.log("stateful");const o=this.value,[u,d]=o(a);return[u,new Hap(this.whole,this.part,d,this.context,!1)]}return[a,this]}spanEquals(a){return this.whole==null&&a.whole==null||this.whole.equals(a.whole)}equals(a){return this.spanEquals(a)&&this.part.equals(a.part)&&this.value===a.value}show(a=!1){const o=typeof this.value=="object"?a?JSON.stringify(this.value).slice(1,-1).replaceAll('"',"").replaceAll(","," "):JSON.stringify(this.value):this.value;var u="";if(this.whole==null)u="~"+this.part.show;else{var d=this.whole.begin.equals(this.part.begin)&&this.whole.end.equals(this.part.end);this.whole.begin.equals(this.part.begin)||(u=this.whole.begin.show()+" ⇜ "),d||(u+="("),u+=this.part.show(),d||(u+=")"),this.whole.end.equals(this.part.end)||(u+=" ⇝ "+this.whole.end.show())}return"[ "+u+" | "+o+" ]"}showWhole(a=!1){return`${this.whole==null?"~":this.whole.show()}: ${stringifyValues(this.value,a)}`}combineContext(a){const o=this;return{...o.context,...a.context,locations:(o.context.locations||[]).concat(a.context.locations||[])}}setContext(a){return new Hap(this.whole,this.part,this.value,a)}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(a,o={}){this.span=a,this.controls=o}setSpan(a){return new State(a,this.controls)}withSpan(a){return this.setSpan(a(this.span))}setControls(a){return new State(this.span,a)}}function unionWithObj(l,a,o){if(a?.value!==void 0&&Object.keys(a).length===1)return logger$2("[warn]: Can't do arithmetic on control pattern."),l;const u=Object.keys(l).filter(d=>Object.keys(a).includes(d));return Object.assign({},l,a,Object.fromEntries(u.map(d=>[d,o(l[d],a[d])])))}curry((l,a)=>l*a),curry((l,a)=>a.map(l));function drawLine(l,a=60){let o=0,u=fraction$1(0),d=[""],f="";for(;d[0].length<a;){const p=l.queryArc(o,o+1),g=p.filter(S=>S.hasOnset()).map(S=>S.duration),b=gcd(...g),O=b.inverse();d=d.map(S=>S+"|"),f+="|";for(let S=0;S<O;S++){const[A,M]=[u,u.add(b)],E=p.filter(L=>L.whole.begin.lte(A)&&L.whole.end.gte(M)),R=E.length-d.length;R>0&&(d=d.concat(Array(R).fill(f))),d=d.map((L,U)=>{const Z=E[U];if(Z){const he=Z.whole.begin.eq(A)?""+Z.value:"-";return L+he}return L+"."}),f+=".",u=u.add(b)}o++}return d.join(`
`)}let stringParser,__steps=!0;const calculateSteps=function(l){__steps=!!l},setStringParser=l=>stringParser=l;let Pattern$1=class Zt{constructor(a,o=void 0){this.query=a,this._Pattern=!0,this._steps=o}get _steps(){return this.__steps}set _steps(a){this.__steps=a===void 0?void 0:fraction$1(a)}setSteps(a){return this._steps=a,this}withSteps(a){return __steps?new Zt(this.query,this._steps===void 0?void 0:a(this._steps)):this}get hasSteps(){return this._steps!==void 0}withValue(a){const o=new Zt(u=>this.query(u).map(d=>d.withValue(a)));return o._steps=this._steps,o}withState(a){return this.withHaps((o,u)=>(a(u),o))}fmap(a){return this.withValue(a)}appWhole(a,o){const u=this,d=function(f){const p=u.query(f),g=o.query(f),b=function(O,S){const A=O.part.intersection(S.part);if(A!=null)return new Hap(a(O.whole,S.whole),A,O.value(S.value),S.combineContext(O))};return flatten$1(p.map(O=>removeUndefineds(g.map(S=>b(O,S)))))};return new Zt(d)}appBoth(a){const o=this,u=function(f,p){if(!(f==null||p==null))return f.intersection_e(p)},d=o.appWhole(u,a);return __steps&&(d._steps=lcm(a._steps,o._steps)),d}appLeft(a){const o=this,u=function(f){const p=[];for(const g of o.query(f)){const b=a.query(f.setSpan(g.wholeOrPart()));for(const O of b){const S=g.whole,A=g.part.intersection(O.part);if(A){const M=g.value(O.value),E=O.combineContext(g),R=new Hap(S,A,M,E);p.push(R)}}}return p},d=new Zt(u);return d._steps=this._steps,d}appRight(a){const o=this,u=function(f){const p=[];for(const g of a.query(f)){const b=o.query(f.setSpan(g.wholeOrPart()));for(const O of b){const S=g.whole,A=O.part.intersection(g.part);if(A){const M=O.value(g.value),E=g.combineContext(O),R=new Hap(S,A,M,E);p.push(R)}}}return p},d=new Zt(u);return d._steps=a._steps,d}bindWhole(a,o){const u=this,d=function(f){const p=function(b,O){return new Hap(a(b.whole,O.whole),O.part,O.value,Object.assign({},b.context,O.context,{locations:(b.context.locations||[]).concat(O.context.locations||[])}))},g=function(b){return o(b.value).query(f.setSpan(b.part)).map(O=>p(b,O))};return flatten$1(u.query(f).map(b=>g(b)))};return new Zt(d)}bind(a){const o=function(u,d){if(!(u==null||d==null))return u.intersection_e(d)};return this.bindWhole(o,a)}join(){return this.bind(id$1)}outerBind(a){return this.bindWhole(o=>o,a).setSteps(this._steps)}outerJoin(){return this.outerBind(id$1)}innerBind(a){return this.bindWhole((o,u)=>u,a)}innerJoin(){return this.innerBind(id$1)}resetJoin(a=!1){const o=this;return new Zt(u=>o.discreteOnly().query(u).map(d=>d.value.late(a?d.whole.begin:d.whole.begin.cyclePos()).query(u).map(f=>new Hap(f.whole?f.whole.intersection(d.whole):void 0,f.part.intersection(d.part),f.value).setContext(d.combineContext(f))).filter(f=>f.part)).flat())}restartJoin(){return this.resetJoin(!0)}squeezeJoin(){const a=this;function o(u){const d=a.discreteOnly().query(u);function f(g){const O=g.value._focusSpan(g.wholeOrPart()).query(u.setSpan(g.part));function S(A,M){let E;if(M.whole&&A.whole&&(E=M.whole.intersection(A.whole),!E))return;const R=M.part.intersection(A.part);if(!R)return;const L=M.combineContext(A);return new Hap(E,R,M.value,L)}return O.map(A=>S(g,A))}return flatten$1(d.map(f)).filter(g=>g)}return new Zt(o)}squeezeBind(a){return this.fmap(a).squeezeJoin()}polyJoin=function(){const a=this;return a.fmap(o=>o.extend(a._steps.div(o._steps))).outerJoin()};polyBind(a){return this.fmap(a).polyJoin()}queryArc(a,o,u={}){try{return this.query(new State(new TimeSpan(a,o),u))}catch(d){return logger$2(`[query]: ${d.message}`,"error"),[]}}splitQueries(){const a=this,o=u=>flatten$1(u.span.spanCycles.map(d=>a.query(u.setSpan(d))));return new Zt(o)}withQuerySpan(a){return new Zt(o=>this.query(o.withSpan(a)))}withQuerySpanMaybe(a){const o=this;return new Zt(u=>{const d=u.withSpan(a);return d.span?o.query(d):[]})}withQueryTime(a){return new Zt(o=>this.query(o.withSpan(u=>u.withTime(a))))}withHapSpan(a){return new Zt(o=>this.query(o).map(u=>u.withSpan(a)))}withHapTime(a){return this.withHapSpan(o=>o.withTime(a))}withHaps(a){const o=new Zt(u=>a(this.query(u),u));return o._steps=this._steps,o}withHap(a){return this.withHaps(o=>o.map(a))}setContext(a){return this.withHap(o=>o.setContext(a))}withContext(a){const o=this.withHap(u=>u.setContext(a(u.context)));return this.__pure!==void 0&&(o.__pure=this.__pure,o.__pure_loc=this.__pure_loc),o}stripContext(){return this.withHap(a=>a.setContext({}))}withLoc(a,o){const u={start:a,end:o},d=this.withContext(f=>{const p=(f.locations||[]).concat([u]);return{...f,locations:p}});return this.__pure&&(d.__pure=this.__pure,d.__pure_loc=u),d}filterHaps(a){return new Zt(o=>this.query(o).filter(a))}filterValues(a){return new Zt(o=>this.query(o).filter(u=>a(u.value))).setSteps(this._steps)}removeUndefineds(){return this.filterValues(a=>a!=null)}onsetsOnly(){return this.filterHaps(a=>a.hasOnset())}discreteOnly(){return this.filterHaps(a=>a.whole)}defragmentHaps(){return this.discreteOnly().withHaps(o=>{const u=[];for(var d=0;d<o.length;++d){for(var f=!0,p=o[d];f;){const O=JSON.stringify(o[d].value);for(var g=!1,b=d+1;b<o.length;b++){const S=o[b];if(p.whole.equals(S.whole)){if(p.part.begin.eq(S.part.end)){if(O===JSON.stringify(S.value)){p=new Hap(p.whole,new TimeSpan(S.part.begin,p.part.end),p.value),o.splice(b,1),g=!0;break}}else if(S.part.begin.eq(p.part.end)&&O==JSON.stringify(S.value)){p=new Hap(p.whole,new TimeSpan(p.part.begin,S.part.end),p.value),o.splice(b,1),g=!0;break}}}f=g}u.push(p)}return u})}firstCycle(a=!1){var o=this;return a||(o=o.stripContext()),o.query(new State(new TimeSpan(fraction$1(0),fraction$1(1))))}get firstCycleValues(){return this.firstCycle().map(a=>a.value)}get showFirstCycle(){return this.firstCycle().map(a=>`${a.value}: ${a.whole.begin.toFraction()} - ${a.whole.end.toFraction()}`)}sortHapsByPart(){return this.withHaps(a=>a.sort((o,u)=>o.part.begin.sub(u.part.begin).or(o.part.end.sub(u.part.end)).or(o.whole.begin.sub(u.whole.begin).or(o.whole.end.sub(u.whole.end)))))}asNumber(){return this.fmap(parseNumeral)}_opIn(a,o){return this.fmap(o).appLeft(reify(a))}_opOut(a,o){return this.fmap(o).appRight(reify(a))}_opMix(a,o){return this.fmap(o).appBoth(reify(a))}_opSqueeze(a,o){const u=reify(a);return this.fmap(d=>u.fmap(f=>o(d)(f))).squeezeJoin()}_opSqueezeOut(a,o){const u=this;return reify(a).fmap(f=>u.fmap(p=>o(p)(f))).squeezeJoin()}_opReset(a,o){return reify(a).fmap(d=>this.fmap(f=>o(f)(d))).resetJoin()}_opRestart(a,o){return reify(a).fmap(d=>this.fmap(f=>o(f)(d))).restartJoin()}_opPoly(a,o){const u=reify(a);return this.fmap(d=>u.fmap(f=>o(f)(d))).polyJoin()}layer(...a){return stack(...a.map(o=>o(this)))}superimpose(...a){return this.stack(...a.map(o=>o(this)))}stack(...a){return stack(this,...a)}sequence(...a){return sequence(this,...a)}seq(...a){return sequence(this,...a)}cat(...a){return cat(this,...a)}fastcat(...a){return fastcat(this,...a)}slowcat(...a){return slowcat(this,...a)}onTrigger(a,o=!0){return this.withHap(u=>u.setContext({...u.context,onTrigger:(...d)=>{u.context.onTrigger?.(...d),a(...d)},dominantTrigger:u.context.dominantTrigger||o}))}log(a=u=>`[hap] ${u.showWhole(!0)}`,o=u=>({hap:u})){return this.onTrigger((...u)=>{logger$2(a(...u),void 0,o(...u))},!1)}logValues(a=o=>`[hap] ${stringifyValues(o,!0)}`){return this.log(o=>a(o.value))}drawLine(){return console.log(drawLine(this)),this}unjoin(a,o=id$1){return a.withHap(u=>u.withValue(d=>d?o(this.ribbon(u.whole.begin,u.whole.duration)):this))}into(a,o){return this.unjoin(a,o).innerJoin()}};function groupHapsBy(l,a){let o=[];return a.forEach(u=>{const d=o.findIndex(([f])=>l(u,f));d===-1?o.push([u]):o[d].push(u)}),o}const congruent=(l,a)=>l.spanEquals(a);Pattern$1.prototype.collect=function(){return this.withHaps(l=>groupHapsBy(congruent,l).map(a=>new Hap(a[0].whole,a[0].part,a,{})))};const arpWith=register("arpWith",(l,a)=>a.collect().fmap(o=>reify(l(o))).innerJoin().withHap(o=>new Hap(o.whole,o.part,o.value.value,o.combineContext(o.value)))),arp=register("arp",(l,a)=>a.arpWith(o=>reify(l).fmap(u=>o[u%o.length])),!1);function _nonArrayObject(l){return!Array.isArray(l)&&typeof l=="object"}function _composeOp(l,a,o){return _nonArrayObject(l)||_nonArrayObject(a)?(_nonArrayObject(l)||(l={value:l}),_nonArrayObject(a)||(a={value:a}),unionWithObj(l,a,o)):o(l,a)}(function(){const l={set:[(o,u)=>u],keep:[o=>o],keepif:[(o,u)=>u?o:void 0],add:[numeralArgs((o,u)=>o+u)],sub:[numeralArgs((o,u)=>o-u)],mul:[numeralArgs((o,u)=>o*u)],div:[numeralArgs((o,u)=>o/u)],mod:[numeralArgs(_mod$1)],pow:[numeralArgs(Math.pow)],log2:[numeralArgs(Math.log2)],band:[numeralArgs((o,u)=>o&u)],bor:[numeralArgs((o,u)=>o|u)],bxor:[numeralArgs((o,u)=>o^u)],blshift:[numeralArgs((o,u)=>o<<u)],brshift:[numeralArgs((o,u)=>o>>u)],lt:[(o,u)=>o<u],gt:[(o,u)=>o>u],lte:[(o,u)=>o<=u],gte:[(o,u)=>o>=u],eq:[(o,u)=>o==u],eqt:[(o,u)=>o===u],ne:[(o,u)=>o!=u],net:[(o,u)=>o!==u],and:[(o,u)=>o&&u],or:[(o,u)=>o||u],func:[(o,u)=>u(o)]},a=["In","Out","Mix","Squeeze","SqueezeOut","Reset","Restart","Poly"];for(const[o,[u,d]]of Object.entries(l)){Pattern$1.prototype["_"+o]=function(f){return this.fmap(p=>u(p,f))},Object.defineProperty(Pattern$1.prototype,o,{get:function(){const f=this,p=(...g)=>f[o].in(...g);for(const g of a)p[g.toLowerCase()]=function(...b){var O=f;b=sequence(b),d&&(O=d(O),b=d(b));var S;return o==="keepif"?(S=O["_op"+g](b,A=>M=>u(A,M)),S=S.removeUndefineds()):S=O["_op"+g](b,A=>M=>_composeOp(A,M,u)),S};return p.squeezein=p.squeeze,p}});for(const f of a)Pattern$1.prototype[f.toLowerCase()]=function(...p){return this.set[f.toLowerCase()](p)}}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 polyrhythm=stack,pr=stack,pm=polymeter,gap=l=>new Pattern$1(()=>[],l),silence=gap(1),nothing=gap(0);function pure(l){function a(u){return u.span.spanCycles.map(d=>new Hap(fraction$1(d.begin).wholeCycle(),d,l))}const o=new Pattern$1(a,1);return o.__pure=l,o}function isPattern(l){return l instanceof Pattern$1||l?._Pattern}function reify(l){return isPattern(l)?l:stringParser&&typeof l=="string"?stringParser(l):pure(l)}function sequenceP(l){let a=pure([]);for(const o of l)a=a.bind(u=>o.fmap(d=>u.concat([d])));return a}function stack(...l){l=l.map(u=>Array.isArray(u)?sequence(...u):reify(u));const a=u=>flatten$1(l.map(d=>d.query(u))),o=new Pattern$1(a);return __steps&&(o._steps=lcm(...l.map(u=>u._steps))),o}function _stackWith(l,a){if(a=a.map(f=>Array.isArray(f)?sequence(...f):reify(f)),a.length===0)return silence;if(a.length===1)return a[0];const[o,...u]=a.map(f=>f._steps),d=__steps?o.maximum(...u):void 0;return stack(...l(d,a))}function stackLeft(...l){return _stackWith((a,o)=>o.map(u=>u._steps.eq(a)?u:stepcat(u,gap(a.sub(u._steps)))),l)}function stackRight(...l){return _stackWith((a,o)=>o.map(u=>u._steps.eq(a)?u:stepcat(gap(a.sub(u._steps)),u)),l)}function stackCentre(...l){return _stackWith((a,o)=>o.map(u=>{if(u._steps.eq(a))return u;const d=gap(a.sub(u._steps).div(2));return stepcat(d,u,d)}),l)}function stackBy(l,...a){const[o,...u]=a.map(p=>p._steps),d=o.maximum(...u),f={centre:stackCentre,left:stackLeft,right:stackRight,expand:stack,repeat:(...p)=>polymeter(...p).steps(d)};return l.inhabit(f).fmap(p=>p(...a)).innerJoin().setSteps(d)}function slowcat(...l){if(l=l.map(u=>Array.isArray(u)?fastcat(...u):reify(u)),l.length==1)return l[0];const a=function(u){const d=u.span,f=_mod$1(d.begin.sam(),l.length),p=l[f];if(!p)return[];const g=d.begin.floor().sub(d.begin.div(l.length).floor());return p.withHapTime(b=>b.add(g)).query(u.setSpan(d.withTime(b=>b.sub(g))))},o=__steps?lcm(...l.map(u=>u._steps)):void 0;return new Pattern$1(a).splitQueries().setSteps(o)}function slowcatPrime(...l){l=l.map(reify);const a=function(o){const u=Math.floor(o.span.begin)%l.length;return l[u]?.query(o)||[]};return new Pattern$1(a).splitQueries()}function cat(...l){return slowcat(...l)}function arrange(...l){const a=l.reduce((o,[u])=>o+u,0);return l=l.map(([o,u])=>[o,u.fast(o)]),stepcat(...l).slow(a)}function seqPLoop(...l){let a=fraction$1(0);for(let o of l)o.length==2&&o.unshift(a),a=o[1];return stack(...l.map(([o,u,d])=>pure(reify(d)).compress(fraction$1(o).div(a),fraction$1(u).div(a)))).slow(a).innerJoin()}function fastcat(...l){let a=slowcat(...l);return l.length>1&&(a=a._fast(l.length),a._steps=l.length),l.length==1&&l[0].__steps_source&&(l._steps=l[0]._steps),a}function sequence(...l){return fastcat(...l)}function seq(...l){return fastcat(...l)}function _sequenceCount(l){return Array.isArray(l)?l.length==0?[silence,0]:l.length==1?_sequenceCount(l[0]):[fastcat(...l.map(a=>_sequenceCount(a)[0])),l.length]:[reify(l),1]}const mask=curry((l,a)=>reify(a).mask(l)),struct=curry((l,a)=>reify(a).struct(l)),superimpose=curry((l,a)=>reify(a).superimpose(...l)),withValue=curry((l,a)=>reify(a).withValue(l)),bind=curry((l,a)=>reify(a).bind(l)),innerBind=curry((l,a)=>reify(a).innerBind(l)),outerBind=curry((l,a)=>reify(a).outerBind(l)),squeezeBind=curry((l,a)=>reify(a).squeezeBind(l)),stepBind=curry((l,a)=>reify(a).stepBind(l)),polyBind=curry((l,a)=>reify(a).polyBind(l)),set=curry((l,a)=>reify(a).set(l)),keep=curry((l,a)=>reify(a).keep(l)),keepif=curry((l,a)=>reify(a).keepif(l)),add$6=curry((l,a)=>reify(a).add(l)),sub=curry((l,a)=>reify(a).sub(l)),mul=curry((l,a)=>reify(a).mul(l)),div=curry((l,a)=>reify(a).div(l)),mod$3=curry((l,a)=>reify(a).mod(l)),pow=curry((l,a)=>reify(a).pow(l)),band=curry((l,a)=>reify(a).band(l)),bor=curry((l,a)=>reify(a).bor(l)),bxor=curry((l,a)=>reify(a).bxor(l)),blshift=curry((l,a)=>reify(a).blshift(l)),brshift=curry((l,a)=>reify(a).brshift(l)),lt$1=curry((l,a)=>reify(a).lt(l)),gt=curry((l,a)=>reify(a).gt(l)),lte=curry((l,a)=>reify(a).lte(l)),gte=curry((l,a)=>reify(a).gte(l)),eq=curry((l,a)=>reify(a).eq(l)),eqt=curry((l,a)=>reify(a).eqt(l)),ne=curry((l,a)=>reify(a).ne(l)),net=curry((l,a)=>reify(a).net(l)),and=curry((l,a)=>reify(a).and(l)),or=curry((l,a)=>reify(a).or(l)),func=curry((l,a)=>reify(a).func(l));function register(l,a,o=!0,u=!1,d=f=>f.innerJoin()){if(Array.isArray(l)){const g={};for(const b of l)g[b]=register(b,a,o,u,d);return g}const f=a.length;var p;return o?p=function(...g){g=g.map(reify);const b=g[g.length-1];let O;if(f===1)O=a(b);else{const S=g.slice(0,-1);if(S.every(A=>A.__pure!=null)){const A=S.map(E=>E.__pure),M=S.filter(E=>E.__pure_loc).map(E=>E.__pure_loc);O=a(...A,b),O=O.withContext(E=>{const R=(E.locations||[]).concat(M);return{...E,locations:R}})}else{const[A,...M]=S;let E=(...R)=>a(...R,b);E=curry(E,null,f-1),O=d(M.reduce((R,L)=>R.appLeft(L),A.fmap(E)))}}return u&&(O._steps=b._steps),O}:p=function(...g){g=g.map(reify);const b=a(...g);return u&&(b._steps=g[g.length-1]._steps),b},Pattern$1.prototype[l]=function(...g){if(f===2&&g.length!==1)g=[sequence(...g)];else if(f!==g.length+1)throw new Error(`.${l}() expects ${f-1} inputs but got ${g.length}.`);return g=g.map(reify),p(...g,this)},f>1&&(Pattern$1.prototype["_"+l]=function(...g){const b=a(...g,this);return u&&b.setSteps(this._steps),b}),curry(p,null,f)}function stepRegister(l,a,o=!0,u=!1,d=f=>f.stepJoin()){return register(l,a,o,u,d)}const round=register("round",function(l){return l.asNumber().fmap(a=>Math.round(a))}),floor=register("floor",function(l){return l.asNumber().fmap(a=>Math.floor(a))}),ceil=register("ceil",function(l){return l.asNumber().fmap(a=>Math.ceil(a))}),toBipolar=register("toBipolar",function(l){return l.fmap(a=>a*2-1)}),fromBipolar=register("fromBipolar",function(l){return l.fmap(a=>(a+1)/2)}),range$2=register("range",function(l,a,o){return o.mul(a-l).add(l)}),rangex=register("rangex",function(l,a,o){return o._range(Math.log(l),Math.log(a)).fmap(Math.exp)}),range2=register("range2",function(l,a,o){return o.fromBipolar()._range(l,a)}),ratio=register("ratio",l=>l.fmap(a=>Array.isArray(a)?a.slice(1).reduce((o,u)=>o/u,a[0]):a)),compress=register("compress",function(l,a,o){return l=fraction$1(l),a=fraction$1(a),l.gt(a)||l.gt(1)||a.gt(1)||l.lt(0)||a.lt(0)?silence:o._fastGap(fraction$1(1).div(a.sub(l)))._late(l)}),{compressSpan,compressspan}=register(["compressSpan","compressspan"],function(l,a){return a._compress(l.begin,l.end)}),{fastGap,fastgap}=register(["fastGap","fastgap"],function(l,a){const o=function(d){const f=d.begin.sam(),p=d.begin.sub(f).mul(l).min(1),g=d.end.sub(f).mul(l).min(1);if(!(p>=1))return new TimeSpan(f.add(p),f.add(g))},u=function(d){const f=d.part.begin,p=d.part.end,g=f.sam(),b=f.sub(g).div(l).min(1),O=p.sub(g).div(l).min(1),S=new TimeSpan(g.add(b),g.add(O)),A=d.whole?new TimeSpan(S.begin.sub(f.sub(d.whole.begin).div(l)),S.end.add(d.whole.end.sub(p).div(l))):void 0;return new Hap(A,S,d.value,d.context)};return a.withQuerySpanMaybe(o).withHap(u).splitQueries()}),focus=register("focus",function(l,a,o){return l=fraction$1(l),a=fraction$1(a),o._early(l.sam())._fast(fraction$1(1).div(a.sub(l)))._late(l)}),{focusSpan,focusspan}=register(["focusSpan","focusspan"],function(l,a){return a._focus(l.begin,l.end)}),ply=register("ply",function(l,a){const o=a.fmap(u=>pure(u)._fast(l)).squeezeJoin();return __steps&&(o._steps=fraction$1(l).mulmaybe(a._steps)),o}),{fast,density:density$1}=register(["fast","density"],function(l,a){return l===0?silence:(l=fraction$1(l),a.withQueryTime(u=>u.mul(l)).withHapTime(u=>u.div(l)).setSteps(a._steps))},!0,!0),hurry=register("hurry",function(l,a){return a._fast(l).mul(pure({speed:l}))}),{slow,sparsity}=register(["slow","sparsity"],function(l,a){return l===0?silence:a._fast(fraction$1(1).div(l))}),inside$1=register("inside",function(l,a,o){return a(o._slow(l))._fast(l)}),outside=register("outside",function(l,a,o){return a(o._fast(l))._slow(l)}),lastOf=register("lastOf",function(l,a,o){const u=Array(l-1).fill(o);return u.push(a(o)),slowcatPrime(...u)}),{firstOf,every}=register(["firstOf","every"],function(l,a,o){const u=Array(l-1).fill(o);return u.unshift(a(o)),slowcatPrime(...u)}),apply=register("apply",function(l,a){return l(a)}),cpm=register("cpm",function(l,a){return a._fast(l/60/1)}),early=register("early",function(l,a){return l=fraction$1(l),a.withQueryTime(o=>o.add(l)).withHapTime(o=>o.sub(l))},!0,!0),late=register("late",function(l,a){return l=fraction$1(l),a._early(fraction$1(0).sub(l))},!0,!0),zoom=register("zoom",function(l,a,o){if(a=fraction$1(a),l=fraction$1(l),l.gte(a))return nothing;const u=a.sub(l),d=__steps?o._steps?.mulmaybe(u):void 0;return o.withQuerySpan(f=>f.withCycle(p=>p.mul(u).add(l))).withHapSpan(f=>f.withCycle(p=>p.sub(l).div(u))).splitQueries().setSteps(d)}),{zoomArc,zoomarc}=register(["zoomArc","zoomarc"],function(l,a){return a.zoom(l.begin,l.end)}),bite=register("bite",(l,a,o)=>a.fmap(u=>d=>{const f=fraction$1(u).div(d).mod(1),p=f.add(fraction$1(1).div(d));return o.zoom(f,p)}).appLeft(l).squeezeJoin(),!1),linger=register("linger",function(l,a){return l==0?silence:l<0?a._zoom(l.add(1),1)._slow(l):a._zoom(0,l)._slow(l)},!0,!0),{segment,seg}=register(["segment","seg"],function(l,a){return a.struct(pure(!0)._fast(l)).setSteps(l)}),swingBy=register("swingBy",(l,a,o)=>o.inside(a,late(seq(0,l/2)))),swing=register("swing",(l,a)=>a.swingBy(1/3,l)),{invert:invert$1,inv}=register(["invert","inv"],function(l){return l.fmap(a=>!a)},!0,!0),when=register("when",function(l,a,o){return l?a(o):o}),off$1=register("off",function(l,a,o){return stack(o,a(o.late(l)))}),brak=register("brak",function(l){return l.when(slowcat(!1,!0),a=>fastcat(a,silence)._late(.25))}),rev=register("rev",function(l){const a=function(o){const u=o.span,d=u.begin.sam(),f=u.begin.nextSam(),p=function(b){const O=b.withTime(A=>d.add(f.sub(A))),S=O.begin;return O.begin=O.end,O.end=S,O};return l.query(o.setSpan(p(u))).map(b=>b.withSpan(p))};return new Pattern$1(a).splitQueries()},!1,!0),pressBy=register("pressBy",function(l,a){return a.fmap(o=>pure(o).compress(l,1)).squeezeJoin()}),press=register("press",function(l){return l._pressBy(.5)});Pattern$1.prototype.hush=function(){return silence};const palindrome=register("palindrome",function(l){return l.lastOf(2,rev)},!0,!0),{juxBy,juxby}=register(["juxBy","juxby"],function(l,a,o){l/=2;const u=function(p,g,b){return g in p?p[g]:b},d=o.withValue(p=>Object.assign({},p,{pan:u(p,"pan",.5)-l})),f=a(o.withValue(p=>Object.assign({},p,{pan:u(p,"pan",.5)+l})));return stack(d,f).setSteps(__steps?lcm(d._steps,f._steps):void 0)}),jux=register("jux",function(l,a){return a._juxBy(1,l,a)}),{echoWith,echowith,stutWith,stutwith}=register(["echoWith","echowith","stutWith","stutwith"],function(l,a,o,u){return stack(...listRange(0,l-1).map(d=>o(u.late(fraction$1(a).mul(d)),d)))}),echo=register("echo",function(l,a,o,u){return u._echoWith(l,a,(d,f)=>d.gain(Math.pow(o,f)))}),stut=register("stut",function(l,a,o,u){return u._echoWith(l,o,(d,f)=>d.gain(Math.pow(a,f)))}),_iter=function(l,a,o=!1){return l=fraction$1(l),slowcat(...listRange(0,l.sub(1)).map(u=>o?a.late(fraction$1(u).div(l)):a.early(fraction$1(u).div(l))))},iter=register("iter",function(l,a){return _iter(l,a,!1)},!0,!0),{iterBack,iterback}=register(["iterBack","iterback"],function(l,a){return _iter(l,a,!0)},!0,!0),{repeatCycles}=register("repeatCycles",function(l,a){return new Pattern$1(function(o){const u=o.span.begin.sam(),d=u.div(l).sam(),f=u.sub(d);return o=o.withSpan(p=>p.withTime(g=>g.sub(f))),a.query(o).map(p=>p.withSpan(g=>g.withTime(b=>b.add(f))))}).splitQueries()},!0,!0),_chunk=function(l,a,o,u=!1,d=!1){const f=Array(l-1).fill(!1);f.unshift(!0);const p=_iter(l,sequence(...f),!u);return d||(o=o.repeatCycles(l)),o.when(p,a)},{chunk,slowchunk,slowChunk}=register(["chunk","slowchunk","slowChunk"],function(l,a,o){return _chunk(l,a,o,!1,!1)},!0,!0),{chunkBack,chunkback}=register(["chunkBack","chunkback"],function(l,a,o){return _chunk(l,a,o,!0)},!0,!0),{fastchunk,fastChunk}=register(["fastchunk","fastChunk"],function(l,a,o){return _chunk(l,a,o,!1,!0)},!0,!0),{chunkinto,chunkInto}=register(["chunkinto","chunkInto"],function(l,a,o){return o.into(fastcat(!0,...Array(l-1).fill(!1))._iterback(l),a)}),{chunkbackinto,chunkBackInto}=register(["chunkbackinto","chunkBackInto"],function(l,a,o){return o.into(fastcat(!0,...Array(l-1).fill(!1))._iter(l)._early(1),a)}),bypass=register("bypass",function(l,a){return l=!!parseInt(l),l?silence:a},!0,!0),{ribbon,rib}=register(["ribbon","rib"],(l,a,o)=>o.early(l).restart(pure(1).slow(a))),hsla=register("hsla",(l,a,o,u,d)=>d.color(`hsla(${l}turn,${a*100}%,${o*100}%,${u})`)),hsl=register("hsl",(l,a,o,u)=>u.color(`hsl(${l}turn,${a*100}%,${o*100}%)`));Pattern$1.prototype.tag=function(l){return this.withContext(a=>({...a,tags:(a.tags||[]).concat([l])}))};const filter$1=register("filter",(l,a)=>a.withHaps(o=>o.filter(l))),filterWhen=register("filterWhen",(l,a)=>a.filter(o=>l(o.whole.begin))),within=register("within",(l,a,o,u)=>stack(o(u.filterWhen(d=>d.cyclePos()>=l&&d.cyclePos()<=a)),u.filterWhen(d=>d.cyclePos()<l||d.cyclePos()>a)));Pattern$1.prototype.stepJoin=function(){const l=this,a=stepcat(..._retime(_slices(l.queryArc(0,1))))._steps,o=function(u){const f=l.early(u.span.begin.sam()).query(u.setSpan(new TimeSpan(fraction$1(0),fraction$1(1))));return stepcat(..._retime(_slices(f))).query(u)};return new Pattern$1(o,a)},Pattern$1.prototype.stepBind=function(l){return this.fmap(l).stepJoin()};function _retime(l){const a=l.filter((f,p)=>p.hasSteps).reduce((f,p)=>f.add(p),fraction$1(0)),o=removeUndefineds(l.map((f,p)=>p._steps)).reduce((f,p)=>f.add(p),fraction$1(0)),u=a.eq(0)?void 0:o.div(a);function d(f,p){return p._steps===void 0?[f.mulmaybe(u),p]:[p._steps,p]}return l.map(f=>d(...f))}function _slices(l){const a=flatten$1(l.map(d=>[d.part.begin,d.part.end])),o=uniqsortr([fraction$1(0),fraction$1(1),...a]);return pairs(o).map(d=>[d[1].sub(d[0]),stack(..._fitslice(new TimeSpan(...d),l).map(f=>f.value.withHap(p=>p.setContext(p.combineContext(f)))))])}function _fitslice(l,a){return removeUndefineds(a.map(o=>_match(l,o)))}function _match(l,a){const o=l.intersection(a.part);if(o!=null)return new Hap(a.whole,o,a.value,a.context)}const pace=register("pace",function(l,a){return a._steps===void 0?a:a._steps.eq(fraction$1(0))?nothing:a._fast(fraction$1(l).div(a._steps)).setSteps(l)});function _polymeterListSteps(l,...a){const o=a.map(d=>_sequenceCount(d));if(o.length==0)return silence;l==0&&(l=o[0][1]);const u=[];for(const d of o)d[1]!=0&&(l==d[1]?u.push(d[0]):u.push(d[0]._fast(fraction$1(l).div(fraction$1(d[1])))));return stack(...u)}function polymeter(...l){if(Array.isArray(l[0]))return _polymeterListSteps(0,...l);if(l=l.filter(u=>u.hasSteps),l.length==0)return silence;const a=lcm(...l.map(u=>u._steps));if(a.eq(fraction$1(0)))return nothing;const o=stack(...l.map(u=>u.pace(a)));return o._steps=a,o}function stepcat(...l){if(l.length===0)return nothing;const a=p=>Array.isArray(p)?p:[p._steps??1,p];if(l=l.map(a),l.find(p=>p[0]===void 0)){const p=l.map(b=>b[0]).filter(b=>b!==void 0);if(p.length===0)return fastcat(...l.map(b=>b[1]));if(p.length===l.length)return nothing;const g=p.reduce((b,O)=>b.add(O),fraction$1(0)).div(p.length);for(let b of l)b[0]===void 0&&(b[0]=g)}if(l.length==1)return reify(l[0][1]).withSteps(g=>l[0][0]);const o=l.map(p=>p[0]).reduce((p,g)=>p.add(g),fraction$1(0));let u=fraction$1(0);const d=[];for(const[p,g]of l){if(fraction$1(p).eq(0))continue;const b=u.add(p);d.push(reify(g)._compress(u.div(o),b.div(o))),u=b}const f=stack(...d);return f._steps=o,f}function stepalt(...l){l=l.map(d=>Array.isArray(d)?d.map(reify):[reify(d)]);const a=lcm(...l.map(d=>fraction$1(d.length)));let o=[];for(let d=0;d<a;++d)o.push(...l.map(f=>f.length==0?silence:f[d%f.length]));o=o.filter(d=>d.hasSteps&&d._steps>0);const u=o.reduce((d,f)=>d.add(f._steps),fraction$1(0));return o=stepcat(...o),o._steps=u,o}const take=stepRegister("take",function(l,a){if(!a.hasSteps||a._steps.lte(0)||(l=fraction$1(l),l.eq(0)))return nothing;const o=l<0;o&&(l=l.abs());const u=l.div(a._steps);return u.lte(0)?nothing:u.gte(1)?a:o?a.zoom(fraction$1(1).sub(u),1):a.zoom(0,u)}),drop=stepRegister("drop",function(l,a){return a.hasSteps?(l=fraction$1(l),l.lt(0)?a.take(a._steps.add(l)):a.take(fraction$1(0).sub(a._steps.sub(l)))):nothing}),extend=stepRegister("extend",function(l,a){return a.fast(l).expand(l)}),expand=stepRegister("expand",function(l,a){return a.withSteps(o=>o.mul(fraction$1(l)))}),contract=stepRegister("contract",function(l,a){return a.withSteps(o=>o.div(fraction$1(l)))});Pattern$1.prototype.shrinklist=function(l){const a=this;if(!a.hasSteps)return[a];let[o,u]=Array.isArray(l)?l:[l,a._steps];if(o=fraction$1(o),u===0||o===0)return[a];const d=o>0,f=[];if(d){const p=fraction$1(1).div(a._steps).mul(o);for(let g=0;g<u;++g){const b=p.mul(g);if(b.gt(1))break;f.push([b,1])}}else{o=fraction$1(0).sub(o);const p=fraction$1(1).div(a._steps).mul(o);for(let g=0;g<u;++g){const b=fraction$1(1).sub(p.mul(g));if(b.lt(0))break;f.push([fraction$1(0),b])}}return f.map(p=>a.zoom(...p))};const shrinklist=(l,a)=>a.shrinklist(l),shrink=register("shrink",function(l,a){if(!a.hasSteps)return nothing;const o=a.shrinklist(l),u=stepcat(...o);return u._steps=o.reduce((d,f)=>d.add(f._steps),fraction$1(0)),u},!0,!1,l=>l.stepJoin()),grow=register("grow",function(l,a){if(!a.hasSteps)return nothing;const o=a.shrinklist(fraction$1(0).sub(l));o.reverse();const u=stepcat(...o);return u._steps=o.reduce((d,f)=>d.add(f._steps),fraction$1(0)),u},!0,!1,l=>l.stepJoin()),tour=function(l,...a){return l.tour(...a)};Pattern$1.prototype.tour=function(...l){return stepcat(...[].concat(...l.map((a,o)=>[...l.slice(0,l.length-o),this,...l.slice(l.length-o)]),this,...l))};const zip=function(...l){l=l.filter(u=>u.hasSteps);const a=slowcat(...l.map(u=>u._slow(u._steps))),o=lcm(...l.map(u=>u._steps));return a._fast(o).setSteps(o)},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(l,a){const u=Array.from({length:l},(p,g)=>g).map(p=>({begin:p/l,end:(p+1)/l})),d=function(p,g){if("begin"in p&&"end"in p&&p.begin!==void 0&&p.end!==void 0){const b=p.end-p.begin;g={begin:p.begin+g.begin*b,end:p.begin+g.end*b}}return Object.assign({},p,g)},f=function(p){return sequence(u.map(g=>d(p,g)))};return a.squeezeBind(f).setSteps(__steps?fraction$1(l).mulmaybe(a._steps):void 0)}),striate=register("striate",function(l,a){const u=Array.from({length:l},(f,p)=>p).map(f=>({begin:f/l,end:(f+1)/l})),d=slowcat(...u);return a.set(d)._fast(l).setSteps(__steps?fraction$1(l).mulmaybe(a._steps):void 0)}),_loopAt=function(l,a,o=.5){return a.speed(1/l*o).unit("c").slow(l)},slice=register("slice",function(l,a,o){return l.innerBind(u=>a.outerBind(d=>o.outerBind(f=>{f=f instanceof Object?f:{s:f};const p=Array.isArray(u)?u[d]:d/u,g=Array.isArray(u)?u[d+1]:(d+1)/u;return pure({begin:p,end:g,_slices:u,...f})}))).setSteps(a._steps)},!1);Pattern$1.prototype.onTriggerTime=function(l){return this.onTrigger((a,o,u,d)=>{const f=d-o;window.setTimeout(()=>{l(a)},f*1e3)},!1)};const splice=register("splice",function(l,a,o){const u=slice(l,a,o);return new Pattern$1(d=>{const f=d.controls._cps||1;return u.query(d).map(g=>g.withValue(b=>({speed:f/b._slices/g.whole.duration*(b.speed||1),unit:"c",...b})))}).setSteps(a._steps)},!1),{loopAt,loopat}=register(["loopAt","loopat"],function(l,a){const o=a._steps?a._steps.div(l):void 0;return new Pattern$1(u=>_loopAt(l,a,u.controls._cps).query(u),o)}),fit=register("fit",l=>l.withHaps((a,o)=>a.map(u=>u.withValue(d=>{const f=("end"in d?d.end:1)-("begin"in d?d.begin:0);return{...d,speed:(o.controls._cps||1)/u.whole.duration*f,unit:"c"}})))),{loopAtCps,loopatcps}=register(["loopAtCps","loopatcps"],function(l,a,o){return _loopAt(l,o,a)}),ref$1=l=>pure(1).withValue(()=>reify(l())).innerJoin();let fadeGain=l=>l<.5?1:1-(l-.5)/.5,xfade=(l,a,o)=>{a=reify(a),l=reify(l),o=reify(o);let u=a.fmap(f=>({gain:fadeGain(f)})),d=a.fmap(f=>({gain:fadeGain(1-f)}));return stack(l.mul(u),o.mul(d))};Pattern$1.prototype.xfade=function(l,a){return xfade(this,l,a)};const __beat=l=>(a,o,u)=>{a=fraction$1(a).mod(o),o=fraction$1(o);const d=a.div(o),f=a.add(1).div(o);return l(u.fmap(p=>pure(p)._compress(d,f)))},{beat}=register(["beat"],__beat(l=>l.innerJoin())),_morph=(l,a,o)=>{o=fraction$1(o);const u=fraction$1(1).div(l.length),d=g=>{const b=[];for(const[O,S]of g.entries())S&&b.push([fraction$1(O).div(g.length),S]);return b},f=zipWith(([g,b],[O,S])=>{const A=o.mul(O-g).add(g),M=A.add(u);return new TimeSpan(A,M)},d(l),d(a));function p(g){const b=g.span.begin.sam(),O=g.span.cycleArc(),S=[];for(const A of f){const M=A.intersection(O);M!==void 0&&S.push(new Hap(A.withTime(E=>E.add(b)),M.withTime(E=>E.add(b)),!0))}return S}return new Pattern$1(p).splitQueries()},morph=(l,a,o)=>(l=reify(l),a=reify(a),o=reify(o),l.innerBind(u=>a.innerBind(d=>o.innerBind(f=>_morph(u,d,f)))));function createParam(l){let a=Array.isArray(l);l=a?l:[l];const o=l[0],u=f=>{let p;if(typeof f=="object"&&f.value!==void 0&&(p={...f},f=f.value,delete p.value),a&&Array.isArray(f)){const g=p||{};return f.forEach((b,O)=>{O<l.length&&(g[l[O]]=b)}),g}else return p?(p[o]=f,p):{[o]:f}},d=function(f,p){return p?typeof f>"u"?p.fmap(u):p.set(reify(f).withValue(u)):reify(f).withValue(u)};return Pattern$1.prototype[o]=function(f){return d(f,this)},d}const controlAlias=new Map;function isControlName(l){return controlAlias.has(l)}function registerControl(l,...a){const o=Array.isArray(l)?l[0]:l;let u={};return u[o]=createParam(l),controlAlias.set(o,o),a.forEach(d=>{u[d]=u[o],controlAlias.set(d,o),Pattern$1.prototype[d]=Pattern$1.prototype[o]}),u}const{s,sound}=registerControl(["s","n","gain"],"sound"),{source,src}=registerControl("source","src"),{n}=registerControl("n"),{note:note$2}=registerControl(["note","n"]),{accelerate}=registerControl("accelerate"),{velocity}=registerControl("velocity"),{gain}=registerControl("gain"),{postgain}=registerControl("postgain"),{amp}=registerControl("amp"),{attack,att}=registerControl("attack","att"),{fmh}=registerControl(["fmh","fmi"],"fmh"),{fmi,fm:fm$1}=registerControl(["fmi","fmh"],"fm"),{fmenv}=registerControl("fmenv"),{fmattack}=registerControl("fmattack"),{fmwave}=registerControl("fmwave"),{fmdecay}=registerControl("fmdecay"),{fmsustain}=registerControl("fmsustain"),{fmrelease}=registerControl("fmrelease"),{fmvelocity}=registerControl("fmvelocity"),{bank}=registerControl("bank"),{analyze}=registerControl("analyze"),{fft}=registerControl("fft"),{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}=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"),{duck}=registerControl("duckorbit","duck"),{duckdepth}=registerControl("duckdepth"),{duckattack}=registerControl("duckattack","duckatt"),{drive}=registerControl("drive"),{byteBeatExpression,bbexpr}=registerControl("byteBeatExpression","bbexpr"),{byteBeatStartTime,bbst}=registerControl("byteBeatStartTime","bbst"),{channels,ch}=registerControl("channels","ch"),{pw}=registerControl(["pw","pwrate","pwsweep"]),{pwrate}=registerControl("pwrate"),{pwsweep}=registerControl("pwsweep"),{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"),{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"),{delaytime,delayt,dt}=registerControl("delaytime","delayt","dt"),{delaysync}=registerControl("delaysync"),{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}=registerControl("octave"),{orbit}=registerControl("orbit"),{overgain}=registerControl("overgain"),{overshape}=registerControl("overshape"),{pan}=registerControl("pan"),{panspan}=registerControl("panspan"),{pansplay}=registerControl("pansplay"),{panwidth:panwidth$1}=registerControl("panwidth"),{panorient}=registerControl("panorient"),{rate}=registerControl("rate"),{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"),{roomsize,size,sz,rsize}=registerControl("roomsize","size","sz","rsize"),{shape}=registerControl(["shape","shapevol"]),{distort,dist:dist$3}=registerControl(["distort","distortvol"],"dist"),{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"),{partials}=registerControl("partials"),{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"),{lfo,repeatTime}=registerControl("lfo","repeatTime"),{znoise}=registerControl("znoise"),{zmod}=registerControl("zmod"),{zcrush}=registerControl("zcrush"),{zdelay}=registerControl("zdelay"),{zzfx}=registerControl("zzfx"),{color,colour}=registerControl(["color","colour"]);let createParams=(...l)=>l.reduce((a,o)=>Object.assign(a,{[o]:createParam(o)}),{});const adsr=register("adsr",(l,a)=>{l=Array.isArray(l)?l:[l];const[o,u,d,f]=l;return a.set({attack:o,decay:u,sustain:d,release:f})}),ad=register("ad",(l,a)=>{l=Array.isArray(l)?l:[l];const[o,u=o]=l;return a.attack(o).decay(u)}),ds=register("ds",(l,a)=>{l=Array.isArray(l)?l:[l];const[o,u=0]=l;return a.set({decay:o,sustain:u})}),ar=register("ar",(l,a)=>{l=Array.isArray(l)?l:[l];const[o,u=o]=l;return a.set({attack:o,release:u})}),{midichan}=registerControl("midichan"),{midimap}=registerControl("midimap"),{midiport}=registerControl("midiport"),{midicmd}=registerControl("midicmd"),control=register("control",(l,a)=>{if(!Array.isArray(l))throw new Error("control expects an array of [ccn, ccv]");const[o,u]=l;return a.ccn(o).ccv(u)}),{ccn}=registerControl("ccn"),{ccv}=registerControl("ccv"),{ctlNum}=registerControl("ctlNum"),{nrpnn}=registerControl("nrpnn"),{nrpv}=registerControl("nrpv"),{progNum}=registerControl("progNum"),sysex=register("sysex",(l,a)=>{if(!Array.isArray(l))throw new Error("sysex expects an array of [id, data]");const[o,u]=l;return a.sysexid(o).sysexdata(u)}),{sysexid}=registerControl("sysexid"),{sysexdata}=registerControl("sysexdata"),{midibend}=registerControl("midibend"),{miditouch}=registerControl("miditouch"),{polyTouch}=registerControl("polyTouch"),getControlName=l=>controlAlias.has(l)?controlAlias.get(l):l,as=register("as",(l,a)=>(l=Array.isArray(l)?l:[l],a.fmap(o=>(o=Array.isArray(o)?o:[o],o=Object.fromEntries(l.map((u,d)=>[getControlName(u),o[d]])),o)))),scrub=register("scrub",(l,a)=>l.outerBind(o=>{Array.isArray(o)||(o=[o]);const[u,d=1]=o;return a.begin(u).mul(speed(d)).clip(1)}),!1),controls=Object.freeze(Object.defineProperty({__proto__:null,accelerate,activeLabel,ad,adsr,amp,analyze,anchor,ar,as,att,attack,bandf,bandq,bank,bbexpr,bbst,begin,binshift,bp,bpa,bpattack,bpd,bpdecay,bpe,bpenv,bpf,bpq,bpr,bprelease,bps,bpsustain,byteBeatExpression,byteBeatStartTime,ccn,ccv,ch,channel,channels,chord:chord$1,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,delaysync,delayt,delaytime,deltaSlide,density,det,detune,dfb,dict,dictionary:dictionary$3,dist:dist$3,distort,djf,drive,dry,ds,dt,duck,duckattack,duckdepth,dur,duration,end,enhance,expression,fadeInTime,fadeOutTime,fadeTime,fanchor,fft,fm:fm$1,fmattack,fmdecay,fmenv,fmh,fmi,fmrelease,fmsustain,fmvelocity,fmwave,frameRate,frames,freeze,freq:freq$1,fshift,fshiftnote,fshiftphase,ftype,gain,gat,gate,getControlName,harmonic,hbrick,hcutoff,hold,hours,hp,hpa,hpattack,hpd,hpdecay,hpe,hpenv,hpf,hpq,hpr,hprelease,hps,hpsustain,hresonance,imag,ir,iresponse,isControlName,kcutoff,krush,label,lbrick,legato,leslie,lfo,lock,loop,loopBegin,loopEnd,loopb,loope,lp,lpa,lpattack,lpd,lpdecay,lpe,lpenv,lpf,lpq,lpr,lprelease,lps,lpsustain,lrate,lsize,midibend,midichan,midicmd,midimap,midiport,miditouch,minutes,mode:mode$1,mtranspose,n,noise,note:note$2,nrpnn,nrpv,nudge,octave:octave$1,octaveR,octaves,octer,octersub,octersubsub,offset,orbit,overgain,overshape,pan,panchor,panorient,panspan,pansplay,panwidth:panwidth$1,partials,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,rate,rdim,real,registerControl,rel,release,repeatTime,resonance,rfade,ring,ringdf,ringf,rlp,room,roomdim,roomfade,roomlp,roomsize,rsize,s,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,tremolo,tremolodepth,tremolophase,tremoloshape,tremoloskew,tremolosync,triode,tsdelay,uid,unison,unit,v,val,velocity,vib,vibmod,vibrato,vmod,voice,vowel,waveloss,xsdelay,zcrush,zdelay,zmod,znoise,zrand,zzfx},Symbol.toStringTag,{value:"Module"})),left=function(l,a){const[o,u]=l,[d,f]=a,[p,g]=splitAt(u,d);return[[u,o-u],[zipWith((b,O)=>b.concat(O),p,f),g]]},right=function(l,a){const[o,u]=l,[d,f]=a,[p,g]=splitAt(o,f);return[[o,u-o],[zipWith((O,S)=>O.concat(S),d,p),g]]},_bjork=function(l,a){const[o,u]=l;return Math.min(o,u)<=1?[l,a]:_bjork(...o>u?left(l,a):right(l,a))},bjork=function(l,a){const o=l<0,u=Math.abs(l),d=a-u,f=Array(u).fill([1]),p=Array(d).fill([0]),g=_bjork([u,d],[f,p]),b=flatten$1(g[1][0]).concat(flatten$1(g[1][1]));return o?b.map(O=>1-O):b},_euclidRot=function(l,a,o){const u=bjork(l,a);return o?rotate$2(u,-o):u},euclid=register("euclid",function(l,a,o){return o.struct(_euclidRot(l,a,0))}),e=register("e",function(l,a){Array.isArray(l)||(l=[l]);const[o,u=o,d=0]=l;return a.struct(_euclidRot(o,u,d))}),{euclidrot,euclidRot}=register(["euclidrot","euclidRot"],function(l,a,o,u){return u.struct(_euclidRot(l,a,o))}),_euclidLegato=function(l,a,o,u){if(l<1)return silence;const f=_euclidRot(l,a,0).join("").split("1").slice(1).map(p=>[p.length+1,!0]);return u.struct(timeCat(...f)).late(fraction$1(o).div(a))},euclidLegato=register(["euclidLegato"],function(l,a,o){return _euclidLegato(l,a,0,o)}),euclidLegatoRot=register(["euclidLegatoRot"],function(l,a,o,u){return _euclidLegato(l,a,o,u)}),{euclidish,eish}=register(["euclidish","eish"],function(l,a,o,u){const d=_morph(bjork(l,a),new Array(l).fill(1),o);return u.struct(d).setSteps(a)});function createClock(l,a,o=.05,u=.1,d=.1,f=globalThis.setInterval,p=globalThis.clearInterval,g=!0){let b=0,O=0,S=10**4,A=.01;const M=se=>o=se(o);d=d||u/2;const E=()=>{const se=l(),ee=se+u+d;for(O===0&&(O=se+A);O<ee;)O=g?Math.round(O*S)/S:O,a(O,o,b,se),O+=o,b++};let R;const L=()=>{U(),E(),R=f(E,u*1e3)},U=()=>{R!==void 0&&p(R),R=void 0};return{setDuration:M,start:L,stop:()=>{b=0,O=0,U()},pause:()=>U(),duration:o,interval:u,getPhase:()=>O,minLatency:A}}function steady(l){return new Pattern$1(a=>[new Hap(void 0,a.span,l)])}const signal$1=l=>{const a=o=>[new Hap(void 0,o.span,l(o.span.begin))];return new Pattern$1(a)},saw=signal$1(l=>l%1),saw2=saw.toBipolar(),isaw=signal$1(l=>1-l%1),isaw2=isaw.toBipolar(),sine2=signal$1(l=>Math.sin(Math.PI*2*l)),sine=sine2.fromBipolar(),cosine=sine._early(fraction$1(1).div(4)),cosine2=sine2._early(fraction$1(1).div(4)),square=signal$1(l=>Math.floor(l*2%2)),square2=square.toBipolar(),tri=fastcat(saw,isaw),tri2=fastcat(saw2,isaw2),itri=fastcat(isaw,saw),itri2=fastcat(isaw2,saw2),time$1=signal$1(id$1);let _mouseY=0,_mouseX=0;typeof window<"u"&&document.addEventListener("mousemove",l=>{_mouseY=l.clientY/document.body.clientHeight,_mouseX=l.clientX/document.body.clientWidth});const mousey=signal$1(()=>_mouseY),mouseY=signal$1(()=>_mouseY),mousex=signal$1(()=>_mouseX),mouseX=signal$1(()=>_mouseX),xorwise=l=>{const a=l<<13^l,o=a>>17^a;return o<<5^o},_frac=l=>l-Math.trunc(l),timeToIntSeed=l=>xorwise(Math.trunc(_frac(l/300)*536870912)),intSeedToRand=l=>l%536870912/536870912,timeToRand=l=>Math.abs(intSeedToRand(timeToIntSeed(l))),timeToRandsPrime=(l,a)=>{const o=[];for(let u=0;u<a;++u)o.push(intSeedToRand(l)),l=xorwise(l);return o},timeToRands=(l,a)=>timeToRandsPrime(timeToIntSeed(l),a),run=l=>saw.range(0,l).round().segment(l),binary=l=>{const a=reify(l).log2(0).floor().add(1);return binaryN(l,a)},binaryN=(l,a=16)=>{a=reify(a);const o=run(a).mul(-1).add(a.sub(1));return reify(l).segment(a).brshift(o).band(pure(1))},randrun=l=>signal$1(a=>{const u=timeToRands(a.floor().add(.5),l).map((f,p)=>[f,p]).sort((f,p)=>(f[0]>p[0])-(f[0]<p[0])).map(f=>f[1]),d=a.cyclePos().mul(l).floor()%l;return u[d]})._segment(l),_rearrangeWith=(l,a,o)=>{const u=[...Array(a).keys()].map(d=>o.zoom(fraction$1(d).div(a),fraction$1(d+1).div(a)));return l.fmap(d=>u[d].repeatCycles(a)._fast(a)).innerJoin()},shuffle$2=register("shuffle",(l,a)=>_rearrangeWith(randrun(l),l,a)),scramble=register("scramble",(l,a)=>_rearrangeWith(_irand(l)._segment(l),l,a)),rand=signal$1(timeToRand),rand2=rand.toBipolar(),_brandBy=l=>rand.fmap(a=>a<l),brandBy=l=>reify(l).fmap(_brandBy).innerJoin(),brand=_brandBy(.5),_irand=l=>rand.fmap(a=>Math.trunc(a*l)),irand=l=>reify(l).fmap(_irand).innerJoin(),__chooseWith=(l,a)=>(a=a.map(reify),a.length==0?silence:l.range(0,a.length).fmap(o=>{const u=Math.min(Math.max(Math.floor(o),0),a.length-1);return a[u]})),chooseWith=(l,a)=>__chooseWith(l,a).outerJoin(),chooseInWith=(l,a)=>__chooseWith(l,a).innerJoin(),choose=(...l)=>chooseWith(rand,l),chooseIn=(...l)=>chooseInWith(rand,l),chooseOut=choose;Pattern$1.prototype.choose=function(...l){return chooseWith(this,l)},Pattern$1.prototype.choose2=function(...l){return chooseWith(this.fromBipolar(),l)};const chooseCycles=(...l)=>chooseInWith(rand.segment(1),l),randcat=chooseCycles,_wchooseWith=function(l,...a){const o=a.map(g=>reify(g[0])),u=[];let d=pure(0);for(const g of a)d=d.add(g[1]),u.push(d);const f=sequenceP(u),p=function(g){const b=d.mul(g);return f.fmap(O=>S=>o[O.findIndex(A=>A>S,O)]).appLeft(b)};return l.bind(p)},wchooseWith=(...l)=>_wchooseWith(...l).outerJoin(),wchoose=(...l)=>wchooseWith(rand,...l),wchooseCycles=(...l)=>_wchooseWith(rand.segment(1),...l).innerJoin(),wrandcat=wchooseCycles;function _perlin(l){let a=Math.floor(l),o=a+1;const u=p=>6*p**5-15*p**4+10*p**3;return(p=>g=>b=>g+u(p)*(b-g))(l-a)(timeToRand(a))(timeToRand(o))}const perlinWith=l=>l.fmap(_perlin);function _berlin(l){const a=Math.floor(l),o=a+1,u=timeToRand(a),d=timeToRand(o)+u,f=(l-a)/(o-a);return((g,b,O)=>g+(b-g)*O)(u,d,f)/2}const berlinWith=l=>l.fmap(_berlin),perlin=perlinWith(time$1.fmap(l=>Number(l))),berlin=berlinWith(time$1.fmap(l=>Number(l))),degradeByWith=register("degradeByWith",(l,a,o)=>o.fmap(u=>d=>u).appLeft(l.filterValues(u=>u>a)),!0,!0),degradeBy=register("degradeBy",function(l,a){return a._degradeByWith(rand,l)},!0,!0),degrade=register("degrade",l=>l._degradeBy(.5),!0,!0),undegradeBy=register("undegradeBy",function(l,a){return a._degradeByWith(rand.fmap(o=>1-o),l)},!0,!0),undegrade=register("undegrade",l=>l._undegradeBy(.5),!0,!0),sometimesBy=register("sometimesBy",function(l,a,o){return reify(l).fmap(u=>stack(o._degradeBy(u),a(o._undegradeBy(1-u)))).innerJoin()}),sometimes=register("sometimes",function(l,a){return a._sometimesBy(.5,l)}),someCyclesBy=register("someCyclesBy",function(l,a,o){return reify(l).fmap(u=>stack(o._degradeByWith(rand._segment(1),u),a(o._degradeByWith(rand.fmap(d=>1-d)._segment(1),1-u)))).innerJoin()}),someCycles=register("someCycles",function(l,a){return a._someCyclesBy(.5,l)}),often=register("often",function(l,a){return a.sometimesBy(.75,l)}),rarely=register("rarely",function(l,a){return a.sometimesBy(.25,l)}),almostNever=register("almostNever",function(l,a){return a.sometimesBy(.1,l)}),almostAlways=register("almostAlways",function(l,a){return a.sometimesBy(.9,l)}),never=register("never",function(l,a){return a}),always=register("always",function(l,a){return l(a)});function _keyDown(l){Array.isArray(l)===!1&&(l=[l]);const a=getCurrentKeyboardState();return l.every(o=>{const u=keyAlias.get(o)??o;return a[u]})}const whenKey=register("whenKey",function(l,a,o){return o.when(_keyDown(l),a)}),keyDown=register("keyDown",function(l){return l.fmap(_keyDown)}),_pick=function(l,a,o=!0){const u=Array.isArray(l),d=Object.keys(l).length;return l=objectMap(l,reify),d===0?silence:a.fmap(f=>{let p=f;return u&&(p=o?Math.round(p)%d:clamp$1(Math.round(p),0,l.length-1)),l[p]})},pick=function(l,a){return Array.isArray(a)&&([a,l]=[l,a]),__pick(l,a)},__pick=register("pick",function(l,a){return _pick(l,a,!1).innerJoin()}),pickmod=register("pickmod",function(l,a){return _pick(l,a,!0).innerJoin()}),pickF=register("pickF",function(l,a,o){return o.apply(pick(l,a))}),pickmodF=register("pickmodF",function(l,a,o){return o.apply(pickmod(l,a))}),pickOut=register("pickOut",function(l,a){return _pick(l,a,!1).outerJoin()}),pickmodOut=register("pickmodOut",function(l,a){return _pick(l,a,!0).outerJoin()}),pickRestart=register("pickRestart",function(l,a){return _pick(l,a,!1).restartJoin()}),pickmodRestart=register("pickmodRestart",function(l,a){return _pick(l,a,!0).restartJoin()}),pickReset=register("pickReset",function(l,a){return _pick(l,a,!1).resetJoin()}),pickmodReset=register("pickmodReset",function(l,a){return _pick(l,a,!0).resetJoin()}),{inhabit,pickSqueeze}=register(["inhabit","pickSqueeze"],function(l,a){return _pick(l,a,!1).squeezeJoin()}),{inhabitmod,pickmodSqueeze}=register(["inhabitmod","pickmodSqueeze"],function(l,a){return _pick(l,a,!0).squeezeJoin()}),squeeze=(l,a)=>(a=a.map(reify),a.length==0?silence:l.fmap(o=>{const u=_mod$1(Math.round(o),a.length);return a[u]}).squeezeJoin());let synth;try{synth=window?.speechSynthesis}catch(l){console.warn("cannot use window: not in browser?")}let allVoices=synth?.getVoices();function triggerSpeech(l,a,o){synth.cancel();const u=new SpeechSynthesisUtterance(l);u.lang=a,allVoices=synth.getVoices();const d=allVoices.filter(f=>f.lang.includes(a));typeof o=="number"?u.voice=d[o%d.length]:typeof o=="string"&&(u.voice=d.find(f=>f.name===f)),speechSynthesis.speak(u)}const speak=register("speak",function(l,a,o){return o.onTrigger(u=>{triggerSpeech(u.value,l,a)})}),strudelScope={},evalScope=async(...l)=>{const a=await Promise.allSettled(l),o=a.filter(u=>u.status==="fulfilled").map(u=>u.value);return a.forEach((u,d)=>{u.status==="rejected"&&console.warn(`evalScope: module with index ${d} could not be loaded:`,u.reason)}),o.forEach(u=>{Object.entries(u).forEach(([d,f])=>{globalThis[d]=f,strudelScope[d]=f})}),o};function safeEval(l,a={}){const{wrapExpression:o=!0,wrapAsync:u=!0}=a;o&&(l=`{${l}}`),u&&(l=`(async ()=>${l})()`);const d=`"use strict";return (${l})`;return Function(d)()}const evaluate=async(l,a,o)=>{let u={};if(a){const p=a(l,o);l=p.output,u=p}return{mode:"javascript",pattern:await safeEval(l,{wrapExpression:!!a}),meta:u}};class NeoCyclist{constructor({onTrigger:a,onToggle:o,getTime:u}){this.started=!1,this.cps=.5,this.getTime=u,this.time_at_last_tick_message=0,this.collator=new ClockCollator({getTargetClockTime:u}),this.onToggle=o,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 d=p=>{const{cps:g,begin:b,end:O,cycle:S,time:A}=p;this.cps=g,this.cycle=S;const M=this.collator.calculateOffset(A)+A;f(b,O,M),this.time_at_last_tick_message=M},f=(p,g,b)=>{if(this.started===!1)return;this.pattern.queryArc(p,g,{_cps:this.cps}).forEach(S=>{if(S.hasOnset()){const M=cycleToSeconds$1(S.whole.begin-this.cycle,this.cps)+b+this.latency,E=cycleToSeconds$1(S.duration,this.cps);a?.(S,0,E,this.cps,M)}})};this.channel.onmessage=p=>{if(!this.started)return;const{payload:g,type:b}=p.data;switch(b){case"tick":d(g)}}}sendMessage(a,o){this.worker.port.postMessage({type:a,payload:o,id:this.id})}now(){const a=(this.getTime()-this.time_at_last_tick_message)*this.cps;return this.cycle+a}setCps(a=1){this.sendMessage("cpschange",{cps:a})}setCycle(a){this.sendMessage("setcycle",{cycle:a})}setStarted(a){this.sendMessage("toggle",{started:a}),this.started=a,this.onToggle?.(a)}start(){logger$2("[cyclist] start"),this.setStarted(!0)}stop(){logger$2("[cyclist] stop"),this.collator.reset(),this.setStarted(!1)}setPattern(a,o=!1){this.pattern=a,o&&!this.started&&this.start()}log(a,o,u){const d=u.filter(f=>f.hasOnset());console.log(`${a.toFixed(4)} - ${o.toFixed(4)} ${Array(d.length).fill("I").join("")}`)}}class Cyclist{constructor({interval:a,onTrigger:o,onToggle:u,onError:d,getTime:f,latency:p=.1,setInterval:g,clearInterval:b,beforeStart:O}){this.started=!1,this.beforeStart=O,this.cps=.5,this.num_ticks_since_cps_change=0,this.lastTick=0,this.lastBegin=0,this.lastEnd=0,this.getTime=f,this.num_cycles_at_cps_change=0,this.seconds_at_cps_change,this.onToggle=u,this.latency=p,this.clock=createClock(f,(S,A,M,E)=>{this.num_ticks_since_cps_change===0&&(this.num_cycles_at_cps_change=this.lastEnd,this.seconds_at_cps_change=S),this.num_ticks_since_cps_change++;const L=this.num_ticks_since_cps_change*A*this.cps;try{const U=this.lastEnd;this.lastBegin=U;const Z=this.num_cycles_at_cps_change+L;if(this.lastEnd=Z,this.lastTick=S,S<E){console.log("skip query: too late");return}this.pattern.queryArc(U,Z,{_cps:this.cps}).forEach(he=>{if(he.hasOnset()){const se=(he.whole.begin-this.num_cycles_at_cps_change)/this.cps+this.seconds_at_cps_change+p,ee=he.duration/this.cps,oe=se-S;o?.(he,oe,ee,this.cps,se),he.value.cps!==void 0&&this.cps!=he.value.cps&&(this.cps=he.value.cps,this.num_ticks_since_cps_change=0)}})}catch(U){errorLogger$1(U),d?.(U)}},a,.1,.1,g,b)}now(){if(!this.started)return 0;const a=this.getTime()-this.lastTick-this.clock.duration;return this.lastBegin+a*this.cps}setStarted(a){this.started=a,this.onToggle?.(a)}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(a,o=!1){this.pattern=a,o&&!this.started&&await this.start()}setCps(a=.5){this.cps!==a&&(this.cps=a,this.num_ticks_since_cps_change=0)}log(a,o,u){const d=u.filter(f=>f.hasOnset());console.log(`${a.toFixed(4)} - ${o.toFixed(4)} ${Array(d.length).fill("I").join("")}`)}}let time;function getTime(){if(!time)throw new Error("no time set! use setTime to define a time source");return time()}function setTime(l){time=l}function repl$1({defaultOutput:l,onEvalError:a,beforeEval:o,beforeStart:u,afterEval:d,getTime:f,transpiler:p,onToggle:g,editPattern:b,onUpdateState:O,sync:S=!1,setInterval:A,clearInterval:M,id:E,mondo:R=!1}){const L={schedulerError:void 0,evalError:void 0,code:"// LOADING",activeCode:"// LOADING",pattern:void 0,miniLocations:[],widgets:[],pending:!1,started:!1},U={id:E},Z=Ve=>{Object.assign(L,Ve),L.isDirty=L.code!==L.activeCode,L.error=L.evalError||L.schedulerError,O?.(L)},re={onTrigger:getTrigger({defaultOutput:l,getTime:f}),getTime:f,onToggle:Ve=>{Z({started:Ve}),g?.(Ve)},setInterval:A,clearInterval:M,beforeStart:u},he=S&&typeof SharedWorker<"u"?new NeoCyclist(re):new Cyclist(re);let se={},ee=0,oe;const me=function(){return se={},ee=0,oe=void 0,silence},_e=async(Ve,$e=!0)=>(Ve=b?.(Ve)||Ve,await he.setPattern(Ve,$e),Ve);setTime(()=>he.now());const ke=()=>he.stop(),Oe=()=>he.start(),Te=()=>he.pause(),Ce=()=>he.toggle(),Ae=Ve=>he.setCps(Ve),Ge=Ve=>he.setCps(Ve/60);let Ne=[];const Qe=function(Ve){return Ne.push(Ve),silence},Ee=function(Ve){return oe=Ve,silence},je=()=>{Pattern$1.prototype.p=function($e){return typeof $e=="string"&&($e.startsWith("_")||$e.endsWith("_"))?silence:($e==="$"&&($e=`$${ee}`,ee++),se[$e]=this,this)},Pattern$1.prototype.q=function($e){return silence};try{for(let $e=1;$e<10;++$e)Object.defineProperty(Pattern$1.prototype,`d${$e}`,{get(){return this.p($e)},configurable:!0}),Object.defineProperty(Pattern$1.prototype,`p${$e}`,{get(){return this.p($e)},configurable:!0}),Pattern$1.prototype[`q${$e}`]=silence}catch($e){console.warn("injectPatternMethods: error:",$e)}const Ve=register("cpm",function($e,ze){return ze._fast($e/60/he.cps)});return evalScope({all:Qe,each:Ee,hush:me,cpm:Ve,setCps:Ae,setcps:Ae,setCpm:Ge,setcpm:Ge})};return{scheduler:he,evaluate:async(Ve,$e=!0,ze=!0)=>{if(!Ve)throw new Error("no code to evaluate");try{Z({code:Ve,pending:!0}),await je(),setTime(()=>he.now()),await o?.({code:Ve}),Ne=[],ze&&me(),R&&(Ve=`mondolang\`${Ve}\``);let{pattern:it,meta:mt}=await evaluate(Ve,p,U);if(Object.keys(se).length){let Je=Object.values(se);oe&&(Je=Je.map(xt=>oe(xt))),it=stack(...Je)}else oe&&(it=oe(it));if(Ne.length)for(let Je in Ne)it=Ne[Je](it);if(!isPattern(it)){const Je=`got "${typeof evaluated}" instead of pattern`;throw new Error(Je+(typeof evaluated=="function"?", did you forget to call a function?":"."))}return logger$2("[eval] code updated"),it=await _e(it,$e),Z({miniLocations:mt?.miniLocations||[],widgets:mt?.widgets||[],activeCode:Ve,pattern:it,evalError:void 0,schedulerError:void 0,pending:!1}),d?.({code:Ve,pattern:it,meta:mt}),it}catch(it){logger$2(`[eval] error: ${it.message}`,"error"),console.error(it),Z({evalError:it,pending:!1}),a?.(it)}},start:Oe,stop:ke,pause:Te,setCps:Ae,setPattern:_e,setCode:Ve=>Z({code:Ve}),toggle:Ce,state:L}}const getTrigger=({getTime:l,defaultOutput:a})=>async(o,u,d,f,p)=>{try{(!o.context.onTrigger||!o.context.dominantTrigger)&&await a(o,u,d,f,p),o.context.onTrigger&&await o.context.onTrigger(o,l(),f,p)}catch(g){errorLogger$1(g,"getTrigger")}},backgroundImage=function(l,a={}){const o=document.getElementById("code"),u="background-image:url("+l+");background-size:contain;";o.style=u;const{className:d}=o,f=(b,O)=>{({style:()=>o.style=u+";"+O,className:()=>o.className=O+" "+d})[b]()},p=Object.entries(a).filter(([b,O])=>typeof O=="function");Object.entries(a).filter(([b,O])=>typeof O=="string").forEach(([b,O])=>f(b,O)),p.length},cleanupUi=()=>{const l=document.getElementById("code");l&&(l.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,Fraction:fraction$1,Hap,Pattern:Pattern$1,State,TimeSpan,__chooseWith,_brandBy,_fitslice,_irand,_keyDown,_match,_mod:_mod$1,_morph,_polymeterListSteps,_retime,_slices,accelerate,activeLabel,ad,add:add$6,adsr,almostAlways,almostNever,always,amp,analyze,anchor,and,apply,ar,arp,arpWith,arrange,as,att,attack,averageArray,backgroundImage,band,bandf,bandq,bank,base64ToUnicode,bbexpr,bbst,beat,begin,berlin,berlinWith,binary,binaryN,bind,binshift,bite,bjork,blshift,bor,bp,bpa,bpattack,bpd,bpdecay,bpe,bpenv,bpf,bpq,bpr,bprelease,bps,bpsustain,brak,brand,brandBy,brshift,bxor,bypass,byteBeatExpression,byteBeatStartTime,calculateSteps,cat,ccn,ccv,ceil,ch,channel,channels,choose,chooseCycles,chooseIn,chooseInWith,chooseOut,chooseWith,chop,chord:chord$1,chunk,chunkBack,chunkBackInto,chunkInto,chunkback,chunkbackinto,chunkinto,clamp:clamp$1,cleanupUi,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,curry,curve,cut,cutoff,cycleToSeconds:cycleToSeconds$1,dec:dec$1,decay,degrade,degradeBy,degradeByWith,degree,delay,delayfb,delayfeedback,delaysync,delayt,delaytime,deltaSlide,det,detune,dfb,dict,dictionary:dictionary$3,dist:dist$3,distort,div,djf,drawLine,drive,drop,dry,ds,dt,duck,duckattack,duckdepth,dur,duration,e,early,echo,echoWith,echowith,eish,end,enhance,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,fmattack,fmdecay,fmenv,fmh,fmi,fmrelease,fmsustain,fmvelocity,fmwave,focus,focusSpan,focusspan,fractionalArgs,frameRate,frames,freeze,freq:freq$1,freqToMidi:freqToMidi$2,fromBipolar,fshift,fshiftnote,fshiftphase,ftype,func,gain,gap,gat,gate,getControlName,getCurrentKeyboardState,getEventOffsetMs,getFreq,getFrequency,getPerformanceTimeSeconds,getPlayableNoteValue,getSoundIndex:getSoundIndex$1,getTime,getTrigger,grow,gt,gte,harmonic,hash2code,hbrick,hcutoff,hold,hours,hp,hpa,hpattack,hpd,hpdecay,hpe,hpenv,hpf,hpq,hpr,hprelease,hps,hpsustain,hresonance,hsl,hsla,hurry,id:id$1,imag,inhabit,inhabitmod,innerBind,inside:inside$1,inv,invert:invert$1,ir,irand,iresponse,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,logKey,logger:logger$2,loop,loopAt,loopAtCps,loopBegin,loopEnd,loopat,loopatcps,loopb,loope,lp,lpa,lpattack,lpd,lpdecay,lpe,lpenv,lpf,lpq,lpr,lprelease,lps,lpsustain,lrate,lsize,lt:lt$1,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,net,never,noise,note:note$2,noteToMidi:noteToMidi$1,nothing,nrpnn,nrpv,nudge,numeralArgs,objectMap,octave:octave$1,octaveR,octaves,octer,octersub,octersubsub,off:off$1,offset,often,or,orbit,outerBind,outside,overgain,overshape,pace,pairs,palindrome,pan,panchor,panorient,panspan,pansplay,panwidth:panwidth$1,parseFractional,parseNumeral,partials,patt,pattack,pcurve,pdec,pdecay,penv,perlin,perlinWith,ph,phasdp,phaser,phasercenter,phaserdepth,phaserrate,phasersweep,phc,phd,phs,pick,pickF,pickOut,pickReset,pickRestart,pickSqueeze,pickmod,pickmodF,pickmodOut,pickmodReset,pickmodRestart,pickmodSqueeze,pipe,pitchJump,pitchJumpTime,ply,pm,polyBind,polyTouch,polymeter,polyrhythm,postgain,pow,pr,prel,prelease,press,pressBy,progNum,psus,psustain,pure,pw,pwrate,pwsweep,rand,rand2,randcat,randrun,range:range$2,range2,rangex,rarely,rate,ratio,rdim,real,ref:ref$1,register,registerControl,reify,rel,release,removeUndefineds,repeatCycles,repeatTime,repl:repl$1,resonance,rev,rfade,rib,ribbon,ring,ringdf,ringf,rlp,room,roomdim,roomfade,roomlp,roomsize,rotate:rotate$2,round,rsize,run,s,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,seg,segment,semitone,seq,seqPLoop,sequence,sequenceP,set,setStringParser,setTime,shape,shrink,shrinklist,shuffle:shuffle$2,signal:signal$1,silence,sine,sine2,size,slice,slide,slow,slowChunk,slowcat,slowcatPrime,slowchunk,smear:smear$1,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:time$1,timeCat,timecat,toBipolar,tokenizeNote:tokenizeNote$3,tour,tremolo,tremolodepth,tremolophase,tremoloshape,tremoloskew,tremolosync,tri,tri2,triode,tsdelay,uid,undegrade,undegradeBy,unicodeToBase64,uniq,uniqsort,uniqsortr,unison,unit,v,val,valueToMidi:valueToMidi$1,velocity,vib,vibmod,vibrato,vmod,voice,vowel,waveloss,wchoose,wchooseCycles,when,whenKey,withValue,within,wrandcat,xfade,xsdelay,zcrush,zdelay,zip,zipWith,zmod,znoise,zoom,zoomArc,zoomarc,zrand,zzfx},Symbol.toStringTag,{value:"Module"})),getDrawContext=(l="test-canvas",a)=>{let{contextType:o="2d",pixelated:u=!1,pixelRatio:d=window.devicePixelRatio}=a||{},f=document.querySelector("#"+l);if(!f){f=document.createElement("canvas"),f.id=l,f.width=window.innerWidth*d,f.height=window.innerHeight*d,f.style="pointer-events:none;width:100%;height:100%;position:fixed;top:0;left:0",u&&(f.style.imageRendering="pixelated"),document.body.prepend(f);let p;window.addEventListener("resize",()=>{p&&clearTimeout(p),p=setTimeout(()=>{f.width=window.innerWidth*d,f.height=window.innerHeight*d},200)})}return f.getContext(o,{willReadFrequently:!0})};let animationFrames={};function stopAnimationFrame(l){animationFrames[l]!==void 0&&(cancelAnimationFrame(animationFrames[l]),delete animationFrames[l])}function stopAllAnimations(l){Object.keys(animationFrames).forEach(a=>(!l||a.startsWith(l))&&stopAnimationFrame(a))}let memory={};Pattern$1.prototype.draw=function(l,a){if(typeof window>"u")return this;let{id:o=1,lookbehind:u=0,lookahead:d=0}=a,f=Math.max(getTime(),0);stopAnimationFrame(o),u=Math.abs(u),memory[o]=(memory[o]||[]).filter(O=>!O.isInFuture(f));let p=this.queryArc(f,f+d).filter(O=>O.hasOnset());memory[o]=memory[o].concat(p);let g;const b=()=>{const O=getTime(),S=O+d;memory[o]=memory[o].filter(E=>E.isInNearPast(u,O));let A=Math.max(g||S,S-1/10);const M=this.queryArc(A,S).filter(E=>E.hasOnset());memory[o]=memory[o].concat(M),g=S,l(memory[o],O,S,this),animationFrames[o]=requestAnimationFrame(b)};return animationFrames[o]=requestAnimationFrame(b),this};const cleanupDraw=(l=!0,a)=>{const o=getDrawContext();l&&o.clearRect(0,0,o.canvas.width,o.canvas.height),stopAllAnimations(a)};Pattern$1.prototype.onPaint=function(l){return this.withState(a=>{a.controls.painters||(a.controls.painters=[]),a.controls.painters.push(l)})},Pattern$1.prototype.getPainters=function(){let l=[];return this.queryArc(0,0,{painters:l}),l};class Framer{constructor(a,o){this.onFrame=a,this.onError=o}start(){const a=this;let o=requestAnimationFrame(function u(d){try{a.onFrame(d)}catch(f){a.onError(f)}o=requestAnimationFrame(u)});a.cancel=()=>{cancelAnimationFrame(o)}}stop(){this.cancel&&this.cancel()}}class Drawer{constructor(a,o){this.visibleHaps=[],this.lastFrame=null,this.drawTime=o,this.painters=[],this.framer=new Framer(()=>{if(!this.scheduler){console.warn("Drawer: no scheduler");return}const u=Math.abs(this.drawTime[0]),d=this.drawTime[1],f=this.scheduler.now()+d;if(this.lastFrame===null){this.lastFrame=f;return}const p=this.scheduler.pattern.queryArc(Math.max(this.lastFrame,f-1/10),f);this.lastFrame=f,this.visibleHaps=(this.visibleHaps||[]).filter(b=>b.whole&&b.endClipped>=f-u-d).concat(p.filter(b=>b.hasOnset()));const g=f-d;a(this.visibleHaps,g,this,this.painters)},u=>{console.warn("draw error",u)})}setDrawTime(a){this.drawTime=a}invalidate(a=this.scheduler,o){if(!a)return;o=o??a.now(),this.scheduler=a;let[u,d]=this.drawTime;const[f,p]=[Math.max(o,0),o+d+.1];this.visibleHaps=this.visibleHaps.filter(b=>b.whole?.begin<o),this.painters=[];const g=a.pattern.queryArc(f,p,{painters:this.painters});this.visibleHaps=this.visibleHaps.concat(g)}start(a){this.scheduler=a,this.invalidate(),this.framer.start()}stop(){this.framer&&this.framer.stop()}}function getComputedPropertyValue(l){return typeof window>"u"?"#fff":getComputedStyle(document.documentElement).getPropertyValue(l)}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(l){theme$2=l}let clearColor="#22222210";Pattern$1.prototype.animate=function({callback:l,sync:a=!1,smear:o=.5}={}){window.frame&&cancelAnimationFrame(window.frame);const u=getDrawContext();let{clientWidth:d,clientHeight:f}=u.canvas;d*=window.devicePixelRatio,f*=window.devicePixelRatio;let p=o===0?"99":Number((1-o)*100).toFixed(0);p=p.length===1?`0${p}`:p,clearColor=`#200010${p}`;const g=b=>{let O;b=Math.round(b),O=this.slow(1e3).queryArc(b,b),u.fillStyle=clearColor,u.fillRect(0,0,d,f),O.forEach(S=>{let{x:A,y:M,w:E,h:R,s:L,r:U,angle:Z=0,fill:re="darkseagreen"}=S.value;if(E*=d,R*=f,U!==void 0&&Z!==void 0){const se=Z*2*Math.PI,[ee,oe]=[(d-E)/2,(f-R)/2];A=ee+Math.cos(se)*U*ee,M=oe+Math.sin(se)*U*oe}else A*=d-E,M*=f-R;const he={...S.value,x:A,y:M,w:E,h:R};u.fillStyle=re,L==="rect"?u.fillRect(A,M,E,R):L==="ellipse"&&(u.beginPath(),u.ellipse(A+E/2,M+R/2,E/2,R/2,0,0,2*Math.PI),u.fill()),l&&l(u,he,S)}),window.frame=requestAnimationFrame(g)};return window.frame=requestAnimationFrame(g),silence};const{x:x$1,y,w,h:h$2,angle,r,fill,smear}=createParams("x","y","w","h","angle","r","fill","smear"),rescale=register("rescale",function(l,a){return a.mul(x$1(l).w(l).y(l).h(l))}),moveXY=register("moveXY",function(l,a,o){return o.add(x$1(l).y(a))}),zoomIn=register("zoomIn",function(l,a){const o=pure(1).sub(l).div(2);return a.rescale(l).move(o,o)}),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(l){return l=l.toLowerCase(),l[0]==="#"?convertHexToNumber(l):colorMap[l]!==void 0?convertHexToNumber(colorMap[l]):-1}function convertHexToNumber(l){return l=l.slice(1),parseInt(l,16)}const scale$2=(l,a,o)=>l*(o-a)+a,getValue=l=>{let{value:a}=l;typeof l.value!="object"&&(a={value:a});let{note:o,n:u,freq:d,s:f}=a;if(d)return freqToMidi$2(d);if(o=o??u,typeof o=="string")try{return noteToMidi$1(o)}catch{return 0}return typeof o=="number"?o:f?"_"+f:a};Pattern$1.prototype.pianoroll=function(l={}){let{cycles:a=4,playhead:o=.5,overscan:u=0,hideNegative:d=!1,ctx:f=getDrawContext(),id:p=1}=l,g=-a*o,b=a*(1-o);const O=(S,A)=>(!d||S.whole.begin>=0)&&S.isWithinTime(A+g,A+b);return this.draw((S,A)=>{__pianoroll({...l,time:A,ctx:f,haps:S.filter(M=>O(M,A))})},{lookbehind:g-u,lookahead:b+u,id:p}),this};function pianoroll(l){return isPattern(l)?l.pianoroll():a=>a.pianoroll(l)}function __pianoroll({time:l,haps:a,cycles:o=4,playhead:u=.5,flipTime:d=0,flipValues:f=0,hideNegative:p=!1,inactive:g=getTheme().foreground,active:b=getTheme().foreground,background:O="transparent",smear:S=0,playheadColor:A=getTheme().foreground,minMidi:M=10,maxMidi:E=90,autorange:R=0,timeframe:L,fold:U=1,vertical:Z=0,labels:re=!1,fill:he=1,fillActive:se=!1,strokeActive:ee=!0,stroke:oe,hideInactive:me=0,colorizeInactive:_e=1,fontFamily:ke,ctx:Oe,id:Te}={}){const Ce=Oe.canvas.width,Ae=Oe.canvas.height;let Ge=-o*u,Ne=o*(1-u);Te&&(a=a.filter(ot=>ot.hasTag(Te))),L&&(console.warn("timeframe is deprecated! use from/to instead"),Ge=0,Ne=L);const Qe=Z?Ae:Ce,Ee=Z?Ce:Ae;let je=Z?[Qe,0]:[0,Qe];const Ye=Ne-Ge,Ke=Z?[0,Ee]:[Ee,0];let Ve=E-M+1,$e=Ee/Ve,ze=[];d&&je.reverse(),f&&Ke.reverse();const{min:it,max:mt,values:Je}=a.reduce(({min:ot,max:kt,values:zt},Wt)=>{const vt=getValue(Wt);return{min:vt<ot?vt:ot,max:vt>kt?vt:kt,values:zt.includes(vt)?zt:[...zt,vt]}},{min:1/0,max:-1/0,values:[]});R&&(M=it,E=mt,Ve=E-M+1),ze=Je.sort((ot,kt)=>typeof ot=="number"&&typeof kt=="number"?ot-kt:typeof ot=="number"?1:String(ot).localeCompare(String(kt))),$e=U?Ee/ze.length:Ee/Ve,Oe.fillStyle=O,Oe.globalAlpha=1,S||(Oe.clearRect(0,0,Ce,Ae),Oe.fillRect(0,0,Ce,Ae)),a.forEach(ot=>{const kt=ot.whole.begin<=l&&ot.endClipped>l;let zt=oe??(ee&&kt),Wt=!kt&&he||kt&&se;if(me&&!kt)return;let vt=ot.value?.color;b=vt||b,g=_e&&vt||g,vt=kt?b:g,Oe.fillStyle=Wt?vt:"transparent",Oe.strokeStyle=vt;const{velocity:Pt=1,gain:At=1}=ot.value||{};Oe.globalAlpha=Pt*At;const Ft=(ot.whole.begin-(d?Ne:Ge))/Ye,Xt=scale$2(Ft,...je);let Yt=scale$2(ot.duration/Ye,0,Qe);const Jt=getValue(ot),qt=U?ze.indexOf(Jt)/ze.length:(Number(Jt)-M)/Ve,$t=scale$2(qt,...Ke);let an=0;const tn=scale$2(l/Ye,...je);let Lt;if(Z?Lt=[$t+1-(f?$e:0),Qe-tn+Xt+an+1-(d?0:Yt),$e-2,Yt-2]:Lt=[Xt-tn+an+1-(d?Yt:0),$t+1-(f?0:$e),Yt-2,$e-2],zt&&Oe.strokeRect(...Lt),Wt&&Oe.fillRect(...Lt),re){const ln=ot.value.note??ot.value.s+(ot.value.n?`:${ot.value.n}`:""),{label:rt,activeLabel:Ot}=ot.value,wt=(kt&&Ot||rt)??ln;let nt=Z?Yt:$e*.75;Oe.font=`${nt}px ${ke||"monospace"}`,Oe.fillStyle=Wt?"black":vt,Oe.textBaseline="top",Oe.fillText(wt,...Lt)}}),Oe.globalAlpha=1;const xt=scale$2(-Ge/Ye,...je);return Oe.strokeStyle=A,Oe.beginPath(),Z?(Oe.moveTo(0,xt),Oe.lineTo(Ee,xt)):(Oe.moveTo(xt,0),Oe.lineTo(xt,Ee)),Oe.stroke(),this}function getDrawOptions(l,a={}){let[o,u]=l;o=Math.abs(o);const d=u+o,f=d!==0?o/d:0;return{fold:1,...a,cycles:d,playhead:f}}const getPunchcardPainter=(l={})=>(a,o,u,d)=>__pianoroll({ctx:a,time:o,haps:u,...getDrawOptions(d,l)});Pattern$1.prototype.punchcard=function(l){return this.onPaint(getPunchcardPainter(l))},Pattern$1.prototype.wordfall=function(l){return this.punchcard({vertical:1,labels:1,stroke:0,fillActive:1,active:"white",...l})};function drawPianoroll(l){const{drawTime:a,...o}=l;__pianoroll({...getDrawOptions(a),...o})}function fromPolar(l,a,o,u){const d=(l-90)*Math.PI/180;return[o+Math.cos(d)*a,u+Math.sin(d)*a]}const xyOnSpiral=(l,a,o,u,d=0)=>fromPolar((l+d)*360,a*l,o,u);function spiralSegment(l){let{ctx:a,from:o=0,to:u=3,margin:d=50,cx:f=100,cy:p=100,rotate:g=0,thickness:b=d/2,color:O=getTheme().foreground,cap:S="round",stretch:A=1,fromOpacity:M=1,toOpacity:E=1}=l;o*=A,u*=A,g*=A,a.lineWidth=b,a.lineCap=S,a.strokeStyle=O,a.globalAlpha=M,a.beginPath();let[R,L]=xyOnSpiral(o,d,f,p,g);a.moveTo(R,L);const U=1/60;let Z=o;for(;Z<=u;){const[re,he]=xyOnSpiral(Z,d,f,p,g);a.globalAlpha=(Z-o)/(u-o)*E,a.lineTo(re,he),Z+=U}a.stroke()}function drawSpiral(l){let{stretch:a=1,size:o=80,thickness:u=o/2,cap:d="butt",inset:f=3,playheadColor:p="#ffffff",playheadLength:g=.02,playheadThickness:b=u,padding:O=0,steady:S=1,activeColor:A=getTheme().foreground,inactiveColor:M=getTheme().gutterForeground,colorizeInactive:E=0,fade:R=!0,ctx:L,time:U,haps:Z,drawTime:re,id:he}=l;he&&(Z=Z.filter(Ce=>Ce.hasTag(he)));const[se,ee]=[L.canvas.width,L.canvas.height];L.clearRect(0,0,se*2,ee*2);const[oe,me]=[se/2,ee/2],_e={margin:o/a,cx:oe,cy:me,stretch:a,cap:d,thickness:u},ke={..._e,thickness:b,from:f-g,to:f,color:p},[Oe]=re,Te=S*U;Z.forEach(Ce=>{const Ae=Ce.whole.begin<=U&&Ce.endClipped>U,Ge=Ce.whole.begin-U+f,Ne=Ce.endClipped-U+f-O,Qe=Ce.value?.color||A,Ee=E||Ae?Qe:M,je=R?1-Math.abs((Ce.whole.begin-U)/Oe):1;spiralSegment({ctx:L,..._e,from:Ge,to:Ne,rotate:Te,color:Ee,fromOpacity:je,toOpacity:je})}),spiralSegment({ctx:L,...ke,rotate:Te})}Pattern$1.prototype.spiral=function(l={}){return this.onPaint((a,o,u,d)=>drawSpiral({ctx:a,time:o,haps:u,drawTime:d,...l}))};const c$2=midiToFreq$2(36),circlePos=(l,a,o,u)=>{u=u*Math.PI*2;const d=Math.sin(u)*o+l,f=Math.cos(u)*o+a;return[d,f]},freq2angle=(l,a)=>.5-Math.log2(l/a)%1;function pitchwheel({haps:l,ctx:a,id:o,hapcircles:u=1,circle:d=0,edo:f=12,root:p=c$2,thickness:g=3,hapRadius:b=6,mode:O="flake",margin:S=10}={}){const A=O==="polygon",M=O==="flake",E=a.canvas.width,R=a.canvas.height;a.clearRect(0,0,E,R);const L=getTheme().foreground,Z=Math.min(E,R)/2-g/2-b-S,re=E/2,he=R/2;o&&(l=l.filter(ee=>ee.hasTag(o))),a.strokeStyle=L,a.fillStyle=L,a.globalAlpha=1,a.lineWidth=g,d&&(a.beginPath(),a.arc(re,he,Z,0,2*Math.PI),a.stroke()),f&&(Array.from({length:f},(ee,oe)=>{const me=freq2angle(p*Math.pow(2,oe/f),p),[_e,ke]=circlePos(re,he,Z,me);a.beginPath(),a.arc(_e,ke,b,0,2*Math.PI),a.fill()}),a.stroke());let se=[];a.lineWidth=b,l.forEach(ee=>{let oe;try{oe=getFrequency(ee)}catch{return}const me=freq2angle(oe,p),[_e,ke]=circlePos(re,he,Z,me),Oe=ee.value.color||L;a.strokeStyle=Oe,a.fillStyle=Oe;const{velocity:Te=1,gain:Ce=1}=ee.value||{},Ae=Te*Ce;a.globalAlpha=Ae,se.push([_e,ke,me,Oe,Ae]),a.beginPath(),u&&(a.moveTo(_e+b,ke),a.arc(_e,ke,b,0,2*Math.PI),a.fill()),M&&(a.moveTo(re,he),a.lineTo(_e,ke)),a.stroke()}),a.strokeStyle=L,a.globalAlpha=1,A&&se.length&&(se=se.sort((ee,oe)=>ee[2]-oe[2]),a.beginPath(),a.moveTo(se[0][0],se[0][1]),se.forEach(([ee,oe,me,_e,ke])=>{a.strokeStyle=_e,a.globalAlpha=ke,a.lineTo(ee,oe)}),a.lineTo(se[0][0],se[0][1]),a.stroke())}Pattern$1.prototype.pitchwheel=function(l={}){let{ctx:a=getDrawContext(),id:o=1}=l;return this.tag(o).onPaint((u,d,f)=>pitchwheel({...l,time:d,ctx:a,haps:f.filter(p=>p.isActive(d)),id:o}))};const index$b=Object.freeze(Object.defineProperty({__proto__:null,Drawer,Framer,__pianoroll,angle,cleanupDraw,colorMap,convertColorToNumber,convertHexToNumber,drawPianoroll,fill,getComputedPropertyValue,getDrawContext,getDrawOptions,getPunchcardPainter,getTheme,h:h$2,moveXY,pianoroll,pitchwheel,r,rescale,setTheme,smear,w,x:x$1,y,zoomIn},Symbol.toStringTag,{value:"Module"}));function peg$subclass(l,a){function o(){this.constructor=l}o.prototype=a.prototype,l.prototype=new o}function peg$SyntaxError(l,a,o,u){var d=Error.call(this,l);return Object.setPrototypeOf&&Object.setPrototypeOf(d,peg$SyntaxError.prototype),d.expected=a,d.found=o,d.location=u,d.name="SyntaxError",d}peg$subclass(peg$SyntaxError,Error);function peg$padEnd(l,a,o){return o=o||" ",l.length>a?l:(a-=l.length,o+=o.repeat(a),l+o.slice(0,a))}peg$SyntaxError.prototype.format=function(l){var a="Error: "+this.message;if(this.location){var o=null,u;for(u=0;u<l.length;u++)if(l[u].source===this.location.source){o=l[u].text.split(/\r\n|\n|\r/g);break}var d=this.location.start,f=this.location.source&&typeof this.location.source.offset=="function"?this.location.source.offset(d):d,p=this.location.source+":"+f.line+":"+f.column;if(o){var g=this.location.end,b=peg$padEnd("",f.line.toString().length," "),O=o[d.line-1],S=d.line===g.line?g.column:O.length+1,A=S-d.column||1;a+=`
--> `+p+`
`+b+` |
`+f.line+" | "+O+`
`+b+" | "+peg$padEnd("",d.column-1," ")+peg$padEnd("",A,"^")}else a+=`
at `+p}return a},peg$SyntaxError.buildMessage=function(l,a){var o={literal:function(O){return'"'+d(O.text)+'"'},class:function(O){var S=O.parts.map(function(A){return Array.isArray(A)?f(A[0])+"-"+f(A[1]):f(A)});return"["+(O.inverted?"^":"")+S.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(O){return O.description}};function u(O){return O.charCodeAt(0).toString(16).toUpperCase()}function d(O){return O.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(S){return"\\x0"+u(S)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(S){return"\\x"+u(S)})}function f(O){return O.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(S){return"\\x0"+u(S)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(S){return"\\x"+u(S)})}function p(O){return o[O.type](O)}function g(O){var S=O.map(p),A,M;if(S.sort(),S.length>0){for(A=1,M=1;A<S.length;A++)S[A-1]!==S[A]&&(S[M]=S[A],M++);S.length=M}switch(S.length){case 1:return S[0];case 2:return S[0]+" or "+S[1];default:return S.slice(0,-1).join(", ")+", or "+S[S.length-1]}}function b(O){return O?'"'+d(O)+'"':"end of input"}return"Expected "+g(l)+" but "+b(a)+" found."};function peg$parse(l,a){a=a!==void 0?a:{};var o={},u=a.grammarSource,d={start:Pn},f=Pn,p=".",g="-",b="0",O=",",S="|",A="[",M="]",E="{",R="}",L="%",U="<",Z=">",re="!",he="(",se=")",ee="/",oe="*",me="?",_e=":",ke="..",Oe="^",Te="struct",Ce="target",Ae="euclid",Ge="slow",Ne="rotL",Qe="rotR",Ee="fast",je="scale",Ye="//",Ke="cat",Ve="$",$e="setcps",ze="setbpm",it="hush",mt=/^[1-9]/,Je=/^[eE]/,xt=/^[+\-]/,ot=/^[0-9]/,kt=/^[ \n\r\t\xA0]/,zt=/^["']/,Wt=/^[#\--.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\u0A0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E-\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]/,vt=/^[@_]/,Pt=/^[^\n]/,At=$n("number"),Ft=ft(".",!1),Xt=dn([["1","9"]],!1,!1),Yt=dn(["e","E"],!1,!1),Jt=dn(["+","-"],!1,!1),qt=ft("-",!1),$t=ft("0",!1),an=dn([["0","9"]],!1,!1),tn=$n("whitespace"),Lt=dn([" ",`
`,"\r"," "," "],!1,!1),ln=ft(",",!1),rt=ft("|",!1),Ot=dn(['"',"'"],!1,!1),Ie=$n('a letter, a number, "-", "#", ".", "^", "_"'),wt=dn(["#",["-","."],["0","9"],["A","Z"],["^","_"],["a","z"],"~","ª","µ","º",["À","Ö"],["Ø","ö"],["ø","ˁ"],["ˆ","ˑ"],["ˠ","ˤ"],"ˬ","ˮ",["Ͱ","ʹ"],["Ͷ","ͷ"],["ͺ","ͽ"],"Ϳ","Ά",["Έ","Ί"],"Ό",["Ύ","Ρ"],["Σ","ϵ"],["Ϸ","ҁ"],["Ҋ","ԯ"],["Ա","Ֆ"],"ՙ",["ՠ","ֈ"],["א","ת"],["ׯ","ײ"],["ؠ","ي"],["ٮ","ٯ"],["ٱ","ۓ"],"ە",["ۥ","ۦ"],["ۮ","ۯ"],["ۺ","ۼ"],"ۿ","ܐ",["ܒ","ܯ"],["ݍ","ޥ"],"ޱ",["ߊ","ߪ"],["ߴ","ߵ"],"ߺ",["ࠀ","ࠕ"],"ࠚ","ࠤ","ࠨ",["ࡀ","ࡘ"],["ࡠ","ࡪ"],["ࢠ","ࢴ"],["ࢶ","ࢽ"],["ऄ","ह"],"ऽ","ॐ",["क़","ॡ"],["ॱ","ঀ"],["অ","ঌ"],["এ","ঐ"],["ও","ন"],["প","র"],"ল",["শ","হ"],"ঽ","ৎ",["ড়","ঢ়"],["য়","ৡ"],["ৰ","ৱ"],"ৼ",["ਅ","ਊ"],["ਏ","ਐ"],["ਓ","ਨ"],["ਪ","ਰ"],["ਲ","ਲ਼"],["ਵ","ਸ਼"],["ਸ","ਹ"],["ਖ਼","ੜ"],"ਫ਼",["ੲ","ੴ"],["અ","ઍ"],["એ","ઑ"],["ઓ","ન"],["પ","ર"],["લ","ળ"],["વ","હ"],"ઽ","ૐ",["ૠ","ૡ"],"ૹ",["ଅ","ଌ"],["ଏ","ଐ"],["ଓ","ନ"],["ପ","ର"],["ଲ","ଳ"],["ଵ","ହ"],"ଽ",["ଡ଼","ଢ଼"],["ୟ","ୡ"],"ୱ","ஃ",["அ","ஊ"],["எ","ஐ"],["ஒ","க"],["ங","ச"],"ஜ",["ஞ","ட"],["ண","த"],["ந","ப"],["ம","ஹ"],"ௐ",["అ","ఌ"],["ఎ","ఐ"],["ఒ","న"],["ప","హ"],"ఽ",["ౘ","ౚ"],["ౠ","ౡ"],"ಀ",["ಅ","ಌ"],["ಎ","ಐ"],["ಒ","ನ"],["ಪ","ಳ"],["ವ","ಹ"],"ಽ","ೞ",["ೠ","ೡ"],["ೱ","ೲ"],["അ","ഌ"],["എ","ഐ"],["ഒ","ഺ"],"ഽ","ൎ",["ൔ","ൖ"],["ൟ","ൡ"],["ൺ","ൿ"],["අ","ඖ"],["ක","න"],["ඳ","ර"],"ල",["ව","ෆ"],["ก","ะ"],["า","ำ"],["เ","ๆ"],["ກ","ຂ"],"ຄ",["ງ","ຈ"],"ຊ","ຍ",["ດ","ທ"],["ນ","ຟ"],["ມ","ຣ"],"ລ","ວ",["ສ","ຫ"],["ອ","ະ"],["າ","ຳ"],"ຽ",["ເ","ໄ"],"ໆ",["ໜ","ໟ"],"ༀ",["ཀ","ཇ"],["ཉ","ཬ"],["ྈ","ྌ"],["က","ဪ"],"ဿ",["ၐ","ၕ"],["ၚ","ၝ"],"ၡ",["ၥ","ၦ"],["ၮ","ၰ"],["ၵ","ႁ"],"ႎ",["Ⴀ","Ⴥ"],"Ⴧ","Ⴭ",["ა","ჺ"],["ჼ","ቈ"],["ቊ","ቍ"],["ቐ","ቖ"],"ቘ",["ቚ","ቝ"],["በ","ኈ"],["ኊ","ኍ"],["ነ","ኰ"],["ኲ","ኵ"],["ኸ","ኾ"],"ዀ",["ዂ","ዅ"],["ወ","ዖ"],["ዘ","ጐ"],["ጒ","ጕ"],["ጘ","ፚ"],["ᎀ","ᎏ"],["Ꭰ","Ᏽ"],["ᏸ","ᏽ"],["ᐁ","ᙬ"],["ᙯ","ᙿ"],["ᚁ","ᚚ"],["ᚠ","ᛪ"],["ᛮ","ᛸ"],["ᜀ","ᜌ"],["ᜎ","ᜑ"],["ᜠ","ᜱ"],["ᝀ","ᝑ"],["ᝠ","ᝬ"],["ᝮ","ᝰ"],["ក","ឳ"],"ៗ","ៜ",["ᠠ","ᡸ"],["ᢀ","ᢄ"],["ᢇ","ᢨ"],"ᢪ",["ᢰ","ᣵ"],["ᤀ","ᤞ"],["ᥐ","ᥭ"],["ᥰ","ᥴ"],["ᦀ","ᦫ"],["ᦰ","ᧉ"],["ᨀ","ᨖ"],["ᨠ","ᩔ"],"ᪧ",["ᬅ","ᬳ"],["ᭅ","ᭋ"],["ᮃ","ᮠ"],["ᮮ","ᮯ"],["ᮺ","ᯥ"],["ᰀ","ᰣ"],["ᱍ","ᱏ"],["ᱚ","ᱽ"],["ᲀ","ᲈ"],["Ა","Ჺ"],["Ჽ","Ჿ"],["ᳩ","ᳬ"],["ᳮ","ᳱ"],["ᳵ","ᳶ"],["ᴀ","ᶿ"],["Ḁ","ἕ"],["Ἐ","Ἕ"],["ἠ","ὅ"],["Ὀ","Ὅ"],["ὐ","ὗ"],"Ὑ","Ὓ","Ὕ",["Ὗ","ώ"],["ᾀ","ᾴ"],["ᾶ","ᾼ"],"ι",["ῂ","ῄ"],["ῆ","ῌ"],["ῐ","ΐ"],["ῖ","Ί"],["ῠ","Ῥ"],["ῲ","ῴ"],["ῶ","ῼ"],"ⁱ","ⁿ",["ₐ","ₜ"],"ℂ","ℇ",["ℊ","ℓ"],"ℕ",["ℙ","ℝ"],"ℤ","Ω","ℨ",["K","ℭ"],["ℯ","ℹ"],["ℼ","ℿ"],["ⅅ","ⅉ"],"ⅎ",["Ⅰ","ↈ"],["Ⰰ","Ⱞ"],["ⰰ","ⱞ"],["Ⱡ","ⳤ"],["Ⳬ","ⳮ"],["Ⳳ","ⳳ"],["ⴀ","ⴥ"],"ⴧ","ⴭ",["ⴰ","ⵧ"],"ⵯ",["ⶀ","ⶖ"],["ⶠ","ⶦ"],["ⶨ","ⶮ"],["ⶰ","ⶶ"],["ⶸ","ⶾ"],["ⷀ","ⷆ"],["ⷈ","ⷎ"],["ⷐ","ⷖ"],["ⷘ","ⷞ"],"ⸯ",["々","〇"],["〡","〩"],["〱","〵"],["〸","〼"],["ぁ","ゖ"],["ゝ","ゟ"],["ァ","ヺ"],["ー","ヿ"],["ㄅ","ㄯ"],["ㄱ","ㆎ"],["ㆠ","ㆺ"],["ㇰ","ㇿ"],["㐀","䶵"],["一","鿯"],["ꀀ","ꒌ"],["ꓐ","ꓽ"],["ꔀ","ꘌ"],["ꘐ","ꘟ"],["ꘪ","ꘫ"],["Ꙁ","ꙮ"],["ꙿ","ꚝ"],["ꚠ","ꛯ"],["ꜗ","ꜟ"],["Ꜣ","ꞈ"],["Ꞌ","ꞹ"],["ꟷ","ꠁ"],["ꠃ","ꠅ"],["ꠇ","ꠊ"],["ꠌ","ꠢ"],["ꡀ","ꡳ"],["ꢂ","ꢳ"],["ꣲ","ꣷ"],"ꣻ",["ꣽ","ꣾ"],["ꤊ","ꤥ"],["ꤰ","ꥆ"],["ꥠ","ꥼ"],["ꦄ","ꦲ"],"ꧏ",["ꧠ","ꧤ"],["ꧦ","ꧯ"],["ꧺ","ꧾ"],["ꨀ","ꨨ"],["ꩀ","ꩂ"],["ꩄ","ꩋ"],["ꩠ","ꩶ"],"ꩺ",["ꩾ","ꪯ"],"ꪱ",["ꪵ","ꪶ"],["ꪹ","ꪽ"],"ꫀ","ꫂ",["ꫛ","ꫝ"],["ꫠ","ꫪ"],["ꫲ","ꫴ"],["ꬁ","ꬆ"],["ꬉ","ꬎ"],["ꬑ","ꬖ"],["ꬠ","ꬦ"],["ꬨ","ꬮ"],["ꬰ","ꭚ"],["ꭜ","ꭥ"],["ꭰ","ꯢ"],["가","힣"],["ힰ","ퟆ"],["ퟋ","ퟻ"],["豈","舘"],["並","龎"],["ff","st"],["ﬓ","ﬗ"],"יִ",["ײַ","ﬨ"],["שׁ","זּ"],["טּ","לּ"],"מּ",["נּ","סּ"],["ףּ","פּ"],["צּ","ﮱ"],["ﯓ","ﴽ"],["ﵐ","ﶏ"],["ﶒ","ﷇ"],["ﷰ","ﷻ"],["ﹰ","ﹴ"],["ﹶ","ﻼ"],["A","Z"],["a","z"],["ヲ","ᄒ"],["ᅡ","ᅦ"],["ᅧ","ᅬ"],["ᅭ","ᅲ"],["ᅳ","ᅵ"]],!1,!1),nt=ft("[",!1),gn=ft("]",!1),_n=ft("{",!1),Ht=ft("}",!1),cn=ft("%",!1),ct=ft("<",!1),ut=ft(">",!1),bt=dn(["@","_"],!1,!1),Nt=ft("!",!1),pt=ft("(",!1),Rt=ft(")",!1),Ct=ft("/",!1),nn=ft("*",!1),bn=ft("?",!1),vn=ft(":",!1),yn=ft("..",!1),N=ft("^",!1),K=ft("struct",!1),q=ft("target",!1),z=ft("euclid",!1),fe=ft("slow",!1),we=ft("rotL",!1),De=ft("rotR",!1),Be=ft("fast",!1),Le=ft("scale",!1),st=ft("//",!1),St=dn([`
`],!0,!1),Xe=ft("cat",!1),Dt=ft("$",!1),It=ft("setcps",!1),jt=ft("setbpm",!1),Ut=ft("hush",!1),sr=function(){return parseFloat(pn())},Gn=function(j){const ue=j.join("");return ue==="."||ue==="_"},lr=function(j){return new Hr(j.join(""))},Ln=function(j){return j},cr=function(j,ue){return j.arguments_.stepsPerCycle=ue,j},Nn=function(j){return j},Dn=function(j){return j.arguments_.alignment="polymeter_slowcat",j},ur=function(j){return ue=>ue.options_.weight=(ue.options_.weight??1)+(j??2)-1},un=function(j){return ue=>{const ge=(ue.options_.reps??1)+(j??2)-1;ue.options_.reps=ge,ue.options_.ops=ue.options_.ops.filter(Fe=>Fe.type_!=="replicate"),ue.options_.ops.push({type_:"replicate",arguments_:{amount:ge}}),ue.options_.weight=ge}},dr=function(j,ue,ge){return Fe=>Fe.options_.ops.push({type_:"bjorklund",arguments_:{pulse:j,step:ue,rotation:ge}})},In=function(j){return ue=>ue.options_.ops.push({type_:"stretch",arguments_:{amount:j,type:"slow"}})},jn=function(j){return ue=>ue.options_.ops.push({type_:"stretch",arguments_:{amount:j,type:"fast"}})},fr=function(j){return ue=>ue.options_.ops.push({type_:"degradeBy",arguments_:{amount:j,seed:Er++}})},Qn=function(j){return ue=>ue.options_.ops.push({type_:"tail",arguments_:{element:j}})},hr=function(j){return ue=>ue.options_.ops.push({type_:"range",arguments_:{element:j}})},mr=function(j,ue){const ge=new Jr(j,{ops:[],weight:1,reps:1});for(const Fe of ue)Fe(ge);return ge},Kt=function(j,ue){return new rr(ue,"fastcat",void 0,!!j)},gr=function(j){return{alignment:"stack",list:j}},br=function(j){return{alignment:"rand",list:j,seed:Er++}},Un=function(j){return{alignment:"feet",list:j,seed:Er++}},Vn=function(j,ue){return ue&&ue.list.length>0?new rr([j,...ue.list],ue.alignment,ue.seed):j},yr=function(j,ue){return new rr(ue?[j,...ue.list]:[j],"polymeter")},Zn=function(j){return j},_r=function(j){return{name:"struct",args:{mini:j}}},Wn=function(j){return{name:"target",args:{name:j}}},vr=function(j,ue,ge){return{name:"bjorklund",args:{pulse:j,step:parseInt(ue)}}},Or=function(j){return{name:"stretch",args:{amount:j}}},hn=function(j){return{name:"shift",args:{amount:"-"+j}}},yt=function(j){return{name:"shift",args:{amount:j}}},wr=function(j){return{name:"stretch",args:{amount:"1/"+j}}},On=function(j){return{name:"scale",args:{scale:j.join("")}}},Xn=function(j,ue){return ue},wn=function(j,ue){return ue.unshift(j),new rr(ue,"slowcat")},Cr=function(j){return j},Cn=function(j,ue){return new Yr(j.name,j.args,ue)},qn=function(j){return j},zn=function(j){return j},Sr=function(j){return new Mr("setcps",{value:j})},Fn=function(j){return new Mr("setcps",{value:j/120/2})},xr=function(){return new Mr("hush")},pe=a.peg$currPos|0,et=pe,mn=[{line:1,column:1}],en=pe,Sn=a.peg$maxFailExpected||[],Ue=a.peg$silentFails|0,xn;if(a.startRule){if(!(a.startRule in d))throw new Error(`Can't start parsing from rule "`+a.startRule+'".');f=d[a.startRule]}function pn(){return l.substring(et,pe)}function Tn(){return kn(et,pe)}function ft(j,ue){return{type:"literal",text:j,ignoreCase:ue}}function dn(j,ue,ge){return{type:"class",parts:j,inverted:ue,ignoreCase:ge}}function kr(){return{type:"end"}}function $n(j){return{type:"other",description:j}}function Hn(j){var ue=mn[j],ge;if(ue)return ue;if(j>=mn.length)ge=mn.length-1;else for(ge=j;!mn[--ge];);for(ue=mn[ge],ue={line:ue.line,column:ue.column};ge<j;)l.charCodeAt(ge)===10?(ue.line++,ue.column=1):ue.column++,ge++;return mn[j]=ue,ue}function kn(j,ue,ge){var Fe=Hn(j),We=Hn(ue),Et={source:u,start:{offset:j,line:Fe.line,column:Fe.column},end:{offset:ue,line:We.line,column:We.column}};return Et}function qe(j){pe<en||(pe>en&&(en=pe,Sn=[]),Sn.push(j))}function Yn(j,ue,ge){return new peg$SyntaxError(peg$SyntaxError.buildMessage(j,ue),j,ue,ge)}function Pn(){var j;return j=zr(),j}function rn(){var j,ue;return Ue++,j=pe,F(),ue=k(),ue!==o?(Pr(),Rn(),et=j,j=sr()):(pe=j,j=o),Ue--,j===o&&Ue===0&&qe(At),j}function Jn(){var j;return l.charCodeAt(pe)===46?(j=p,pe++):(j=o,Ue===0&&qe(Ft)),j}function Kn(){var j;return j=l.charAt(pe),mt.test(j)?pe++:(j=o,Ue===0&&qe(Xt)),j}function er(){var j;return j=l.charAt(pe),Je.test(j)?pe++:(j=o,Ue===0&&qe(Yt)),j}function Rn(){var j,ue,ge,Fe,We;if(j=pe,ue=er(),ue!==o){if(ge=l.charAt(pe),xt.test(ge)?pe++:(ge=o,Ue===0&&qe(Jt)),ge===o&&(ge=null),Fe=[],We=B(),We!==o)for(;We!==o;)Fe.push(We),We=B();else Fe=o;Fe!==o?(ue=[ue,ge,Fe],j=ue):(pe=j,j=o)}else pe=j,j=o;return j}function Pr(){var j,ue,ge,Fe;if(j=pe,ue=Jn(),ue!==o){if(ge=[],Fe=B(),Fe!==o)for(;Fe!==o;)ge.push(Fe),Fe=B();else ge=o;ge!==o?(ue=[ue,ge],j=ue):(pe=j,j=o)}else pe=j,j=o;return j}function k(){var j,ue,ge,Fe;if(j=$(),j===o)if(j=pe,ue=Kn(),ue!==o){for(ge=[],Fe=B();Fe!==o;)ge.push(Fe),Fe=B();ue=[ue,ge],j=ue}else pe=j,j=o;return j}function F(){var j;return l.charCodeAt(pe)===45?(j=g,pe++):(j=o,Ue===0&&qe(qt)),j}function $(){var j;return l.charCodeAt(pe)===48?(j=b,pe++):(j=o,Ue===0&&qe($t)),j}function B(){var j;return j=l.charAt(pe),ot.test(j)?pe++:(j=o,Ue===0&&qe(an)),j}function I(){var j,ue;for(Ue++,j=[],ue=l.charAt(pe),kt.test(ue)?pe++:(ue=o,Ue===0&&qe(Lt));ue!==o;)j.push(ue),ue=l.charAt(pe),kt.test(ue)?pe++:(ue=o,Ue===0&&qe(Lt));return Ue--,ue=o,Ue===0&&qe(tn),j}function V(){var j,ue,ge,Fe;return j=pe,ue=I(),l.charCodeAt(pe)===44?(ge=O,pe++):(ge=o,Ue===0&&qe(ln)),ge!==o?(Fe=I(),ue=[ue,ge,Fe],j=ue):(pe=j,j=o),j}function te(){var j,ue,ge,Fe;return j=pe,ue=I(),l.charCodeAt(pe)===124?(ge=S,pe++):(ge=o,Ue===0&&qe(rt)),ge!==o?(Fe=I(),ue=[ue,ge,Fe],j=ue):(pe=j,j=o),j}function le(){var j,ue,ge,Fe;return j=pe,ue=I(),l.charCodeAt(pe)===46?(ge=p,pe++):(ge=o,Ue===0&&qe(Ft)),ge!==o?(Fe=I(),ue=[ue,ge,Fe],j=ue):(pe=j,j=o),j}function de(){var j;return j=l.charAt(pe),zt.test(j)?pe++:(j=o,Ue===0&&qe(Ot)),j}function be(){var j;return Ue++,j=l.charAt(pe),Wt.test(j)?pe++:(j=o,Ue===0&&qe(wt)),Ue--,j===o&&Ue===0&&qe(Ie),j}function ye(){var j,ue,ge,Fe;if(j=pe,I(),ue=[],ge=be(),ge!==o)for(;ge!==o;)ue.push(ge),ge=be();else ue=o;return ue!==o?(ge=I(),et=pe,Fe=Gn(ue),Fe?Fe=o:Fe=void 0,Fe!==o?(et=j,j=lr(ue)):(pe=j,j=o)):(pe=j,j=o),j}function xe(){var j,ue,ge,Fe;return j=pe,I(),l.charCodeAt(pe)===91?(ue=A,pe++):(ue=o,Ue===0&&qe(nt)),ue!==o?(I(),ge=An(),ge!==o?(I(),l.charCodeAt(pe)===93?(Fe=M,pe++):(Fe=o,Ue===0&&qe(gn)),Fe!==o?(I(),et=j,j=Ln(ge)):(pe=j,j=o)):(pe=j,j=o)):(pe=j,j=o),j}function Pe(){var j,ue,ge,Fe,We;return j=pe,I(),l.charCodeAt(pe)===123?(ue=E,pe++):(ue=o,Ue===0&&qe(_n)),ue!==o?(I(),ge=nr(),ge!==o?(I(),l.charCodeAt(pe)===125?(Fe=R,pe++):(Fe=o,Ue===0&&qe(Ht)),Fe!==o?(We=Se(),We===o&&(We=null),I(),et=j,j=cr(ge,We)):(pe=j,j=o)):(pe=j,j=o)):(pe=j,j=o),j}function Se(){var j,ue,ge;return j=pe,l.charCodeAt(pe)===37?(ue=L,pe++):(ue=o,Ue===0&&qe(cn)),ue!==o?(ge=Me(),ge!==o?(et=j,j=Nn(ge)):(pe=j,j=o)):(pe=j,j=o),j}function ve(){var j,ue,ge,Fe;return j=pe,I(),l.charCodeAt(pe)===60?(ue=U,pe++):(ue=o,Ue===0&&qe(ct)),ue!==o?(I(),ge=nr(),ge!==o?(I(),l.charCodeAt(pe)===62?(Fe=Z,pe++):(Fe=o,Ue===0&&qe(ut)),Fe!==o?(I(),et=j,j=Dn(ge)):(pe=j,j=o)):(pe=j,j=o)):(pe=j,j=o),j}function Me(){var j;return j=ye(),j===o&&(j=xe(),j===o&&(j=Pe(),j===o&&(j=ve()))),j}function Re(){var j;return j=He(),j===o&&(j=tt(),j===o&&(j=_t(),j===o&&(j=Vt(),j===o&&(j=Ze(),j===o&&(j=Tt(),j===o&&(j=Qt(),j===o&&(j=ht()))))))),j}function He(){var j,ue,ge;return j=pe,I(),ue=l.charAt(pe),vt.test(ue)?pe++:(ue=o,Ue===0&&qe(bt)),ue!==o?(ge=rn(),ge===o&&(ge=null),et=j,j=ur(ge)):(pe=j,j=o),j}function Ze(){var j,ue,ge;return j=pe,I(),l.charCodeAt(pe)===33?(ue=re,pe++):(ue=o,Ue===0&&qe(Nt)),ue!==o?(ge=rn(),ge===o&&(ge=null),et=j,j=un(ge)):(pe=j,j=o),j}function tt(){var j,ue,ge,Fe,We,Et,fn;return j=pe,l.charCodeAt(pe)===40?(ue=he,pe++):(ue=o,Ue===0&&qe(pt)),ue!==o?(I(),ge=at(),ge!==o?(I(),Fe=V(),Fe!==o?(I(),We=at(),We!==o?(I(),V(),I(),Et=at(),Et===o&&(Et=null),I(),l.charCodeAt(pe)===41?(fn=se,pe++):(fn=o,Ue===0&&qe(Rt)),fn!==o?(et=j,j=dr(ge,We,Et)):(pe=j,j=o)):(pe=j,j=o)):(pe=j,j=o)):(pe=j,j=o)):(pe=j,j=o),j}function _t(){var j,ue,ge;return j=pe,l.charCodeAt(pe)===47?(ue=ee,pe++):(ue=o,Ue===0&&qe(Ct)),ue!==o?(ge=Me(),ge!==o?(et=j,j=In(ge)):(pe=j,j=o)):(pe=j,j=o),j}function Vt(){var j,ue,ge;return j=pe,l.charCodeAt(pe)===42?(ue=oe,pe++):(ue=o,Ue===0&&qe(nn)),ue!==o?(ge=Me(),ge!==o?(et=j,j=jn(ge)):(pe=j,j=o)):(pe=j,j=o),j}function Tt(){var j,ue,ge;return j=pe,l.charCodeAt(pe)===63?(ue=me,pe++):(ue=o,Ue===0&&qe(bn)),ue!==o?(ge=rn(),ge===o&&(ge=null),et=j,j=fr(ge)):(pe=j,j=o),j}function Qt(){var j,ue,ge;return j=pe,l.charCodeAt(pe)===58?(ue=_e,pe++):(ue=o,Ue===0&&qe(vn)),ue!==o?(ge=Me(),ge!==o?(et=j,j=Qn(ge)):(pe=j,j=o)):(pe=j,j=o),j}function ht(){var j,ue,ge;return j=pe,l.substr(pe,2)===ke?(ue=ke,pe+=2):(ue=o,Ue===0&&qe(yn)),ue!==o?(ge=Me(),ge!==o?(et=j,j=hr(ge)):(pe=j,j=o)):(pe=j,j=o),j}function at(){var j,ue,ge,Fe;if(j=pe,ue=Me(),ue!==o){for(ge=[],Fe=Re();Fe!==o;)ge.push(Fe),Fe=Re();et=j,j=mr(ue,ge)}else pe=j,j=o;return j}function Mt(){var j,ue,ge,Fe;if(j=pe,l.charCodeAt(pe)===94?(ue=Oe,pe++):(ue=o,Ue===0&&qe(N)),ue===o&&(ue=null),ge=[],Fe=at(),Fe!==o)for(;Fe!==o;)ge.push(Fe),Fe=at();else ge=o;return ge!==o?(et=j,j=Kt(ue,ge)):(pe=j,j=o),j}function Bt(){var j,ue,ge,Fe,We;if(j=pe,ue=[],ge=pe,Fe=V(),Fe!==o?(We=Mt(),We!==o?ge=We:(pe=ge,ge=o)):(pe=ge,ge=o),ge!==o)for(;ge!==o;)ue.push(ge),ge=pe,Fe=V(),Fe!==o?(We=Mt(),We!==o?ge=We:(pe=ge,ge=o)):(pe=ge,ge=o);else ue=o;return ue!==o&&(et=j,ue=gr(ue)),j=ue,j}function Gt(){var j,ue,ge,Fe,We;if(j=pe,ue=[],ge=pe,Fe=te(),Fe!==o?(We=Mt(),We!==o?ge=We:(pe=ge,ge=o)):(pe=ge,ge=o),ge!==o)for(;ge!==o;)ue.push(ge),ge=pe,Fe=te(),Fe!==o?(We=Mt(),We!==o?ge=We:(pe=ge,ge=o)):(pe=ge,ge=o);else ue=o;return ue!==o&&(et=j,ue=br(ue)),j=ue,j}function sn(){var j,ue,ge,Fe,We;if(j=pe,ue=[],ge=pe,Fe=le(),Fe!==o?(We=Mt(),We!==o?ge=We:(pe=ge,ge=o)):(pe=ge,ge=o),ge!==o)for(;ge!==o;)ue.push(ge),ge=pe,Fe=le(),Fe!==o?(We=Mt(),We!==o?ge=We:(pe=ge,ge=o)):(pe=ge,ge=o);else ue=o;return ue!==o&&(et=j,ue=Un(ue)),j=ue,j}function An(){var j,ue,ge;return j=pe,ue=Mt(),ue!==o?(ge=Bt(),ge===o&&(ge=Gt(),ge===o&&(ge=sn())),ge===o&&(ge=null),et=j,j=Vn(ue,ge)):(pe=j,j=o),j}function nr(){var j,ue,ge;return j=pe,ue=Mt(),ue!==o?(ge=Bt(),ge===o&&(ge=null),et=j,j=yr(ue,ge)):(pe=j,j=o),j}function Bn(){var j,ue,ge,Fe;return j=pe,I(),ue=de(),ue!==o?(I(),ge=An(),ge!==o?(I(),Fe=de(),Fe!==o?(et=j,j=Zn(ge)):(pe=j,j=o)):(pe=j,j=o)):(pe=j,j=o),j}function Fr(){var j;return j=Ir(),j===o&&(j=Br(),j===o&&(j=Nr(),j===o&&(j=$r(),j===o&&(j=Rr(),j===o&&(j=Tr(),j===o&&(j=Lr(),j===o&&(j=Gr()))))))),j}function Tr(){var j,ue,ge;return j=pe,l.substr(pe,6)===Te?(ue=Te,pe+=6):(ue=o,Ue===0&&qe(K)),ue!==o?(I(),ge=Mn(),ge!==o?(et=j,j=_r(ge)):(pe=j,j=o)):(pe=j,j=o),j}function $r(){var j,ue,ge,Fe,We;return j=pe,l.substr(pe,6)===Ce?(ue=Ce,pe+=6):(ue=o,Ue===0&&qe(q)),ue!==o?(I(),ge=de(),ge!==o?(Fe=ye(),Fe!==o?(We=de(),We!==o?(et=j,j=Wn(Fe)):(pe=j,j=o)):(pe=j,j=o)):(pe=j,j=o)):(pe=j,j=o),j}function Rr(){var j,ue,ge,Fe;return j=pe,l.substr(pe,6)===Ae?(ue=Ae,pe+=6):(ue=o,Ue===0&&qe(z)),ue!==o?(I(),ge=k(),ge!==o?(I(),Fe=k(),Fe!==o?(I(),k(),et=j,j=vr(ge,Fe)):(pe=j,j=o)):(pe=j,j=o)):(pe=j,j=o),j}function Br(){var j,ue,ge;return j=pe,l.substr(pe,4)===Ge?(ue=Ge,pe+=4):(ue=o,Ue===0&&qe(fe)),ue!==o?(I(),ge=rn(),ge!==o?(et=j,j=Or(ge)):(pe=j,j=o)):(pe=j,j=o),j}function Gr(){var j,ue,ge;return j=pe,l.substr(pe,4)===Ne?(ue=Ne,pe+=4):(ue=o,Ue===0&&qe(we)),ue!==o?(I(),ge=rn(),ge!==o?(et=j,j=hn(ge)):(pe=j,j=o)):(pe=j,j=o),j}function Lr(){var j,ue,ge;return j=pe,l.substr(pe,4)===Qe?(ue=Qe,pe+=4):(ue=o,Ue===0&&qe(De)),ue!==o?(I(),ge=rn(),ge!==o?(et=j,j=yt(ge)):(pe=j,j=o)):(pe=j,j=o),j}function Nr(){var j,ue,ge;return j=pe,l.substr(pe,4)===Ee?(ue=Ee,pe+=4):(ue=o,Ue===0&&qe(Be)),ue!==o?(I(),ge=rn(),ge!==o?(et=j,j=wr(ge)):(pe=j,j=o)):(pe=j,j=o),j}function Ir(){var j,ue,ge,Fe,We;if(j=pe,l.substr(pe,5)===je?(ue=je,pe+=5):(ue=o,Ue===0&&qe(Le)),ue!==o)if(I(),ge=de(),ge!==o){if(Fe=[],We=be(),We!==o)for(;We!==o;)Fe.push(We),We=be();else Fe=o;Fe!==o?(We=de(),We!==o?(et=j,j=On(Fe)):(pe=j,j=o)):(pe=j,j=o)}else pe=j,j=o;else pe=j,j=o;return j}function Ar(){var j,ue,ge,Fe;if(j=pe,l.substr(pe,2)===Ye?(ue=Ye,pe+=2):(ue=o,Ue===0&&qe(st)),ue!==o){for(ge=[],Fe=l.charAt(pe),Pt.test(Fe)?pe++:(Fe=o,Ue===0&&qe(St));Fe!==o;)ge.push(Fe),Fe=l.charAt(pe),Pt.test(Fe)?pe++:(Fe=o,Ue===0&&qe(St));ue=[ue,ge],j=ue}else pe=j,j=o;return j}function jr(){var j,ue,ge,Fe,We,Et,fn,En;if(j=pe,l.substr(pe,3)===Ke?(ue=Ke,pe+=3):(ue=o,Ue===0&&qe(Xe)),ue!==o)if(I(),l.charCodeAt(pe)===91?(ge=A,pe++):(ge=o,Ue===0&&qe(nt)),ge!==o)if(I(),Fe=Mn(),Fe!==o){for(We=[],Et=pe,fn=V(),fn!==o?(En=Mn(),En!==o?(et=Et,Et=Xn(Fe,En)):(pe=Et,Et=o)):(pe=Et,Et=o);Et!==o;)We.push(Et),Et=pe,fn=V(),fn!==o?(En=Mn(),En!==o?(et=Et,Et=Xn(Fe,En)):(pe=Et,Et=o)):(pe=Et,Et=o);Et=I(),l.charCodeAt(pe)===93?(fn=M,pe++):(fn=o,Ue===0&&qe(gn)),fn!==o?(et=j,j=wn(Fe,We)):(pe=j,j=o)}else pe=j,j=o;else pe=j,j=o;else pe=j,j=o;return j}function Qr(){var j;return j=jr(),j===o&&(j=Bn()),j}function Mn(){var j,ue,ge,Fe,We;if(j=pe,ue=Qr(),ue!==o){for(I(),ge=[],Fe=Ar();Fe!==o;)ge.push(Fe),Fe=Ar();et=j,j=Cr(ue)}else pe=j,j=o;return j===o&&(j=pe,ue=Fr(),ue!==o?(I(),l.charCodeAt(pe)===36?(ge=Ve,pe++):(ge=o,Ue===0&&qe(Dt)),ge!==o?(Fe=I(),We=Mn(),We!==o?(et=j,j=Cn(ue,We)):(pe=j,j=o)):(pe=j,j=o)):(pe=j,j=o)),j}function Ur(){var j,ue;return j=pe,ue=Mn(),ue!==o&&(et=j,ue=qn(ue)),j=ue,j===o&&(j=Ar()),j}function Vr(){var j;return j=Ur(),j}function Zr(){var j,ue;return j=pe,I(),ue=Wr(),ue===o&&(ue=Xr(),ue===o&&(ue=qr())),ue!==o?(I(),et=j,j=zn(ue)):(pe=j,j=o),j}function Wr(){var j,ue,ge;return j=pe,l.substr(pe,6)===$e?(ue=$e,pe+=6):(ue=o,Ue===0&&qe(It)),ue!==o?(I(),ge=rn(),ge!==o?(et=j,j=Sr(ge)):(pe=j,j=o)):(pe=j,j=o),j}function Xr(){var j,ue,ge;return j=pe,l.substr(pe,6)===ze?(ue=ze,pe+=6):(ue=o,Ue===0&&qe(jt)),ue!==o?(I(),ge=rn(),ge!==o?(et=j,j=Fn(ge)):(pe=j,j=o)):(pe=j,j=o),j}function qr(){var j,ue;return j=pe,l.substr(pe,4)===it?(ue=it,pe+=4):(ue=o,Ue===0&&qe(Ut)),ue!==o&&(et=j,ue=xr()),j=ue,j}function zr(){var j;return j=Vr(),j===o&&(j=Zr()),j}var Hr=function(j){this.type_="atom",this.source_=j,this.location_=Tn()},rr=function(j,ue,ge,Fe){this.type_="pattern",this.arguments_={alignment:ue,_steps:Fe},ge!==void 0&&(this.arguments_.seed=ge),this.source_=j},Yr=function(j,ue,ge){this.type_=j,this.arguments_=ue,this.source_=ge},Jr=function(j,ue){this.type_="element",this.source_=j,this.options_=ue,this.location_=Tn()},Mr=function(j,ue){this.type_="command",this.name_=j,this.options_=ue},Er=0;if(xn=f(),a.peg$library)return{peg$result:xn,peg$currPos:pe,peg$FAILED:o,peg$maxFailExpected:Sn,peg$maxFailPos:en};if(xn!==o&&pe===l.length)return xn;throw xn!==o&&pe<l.length&&qe(kr()),Yn(Sn,en<l.length?l.charAt(en):null,en<l.length?kn(en,en+1):kn(en,en))}const peg$allowedStartRules=["start"],randOffset=3e-4,applyOptions=(l,a)=>(o,u)=>{const p=l.source_[u].options_?.ops,g=o.__steps_source;if(p)for(const b of p)switch(b.type_){case"stretch":{const O=["fast","slow"],{type:S,amount:A}=b.arguments_;if(!O.includes(S))throw new Error(`mini: stretch: type must be one of ${O.join("|")} but got ${S}`);o=reify(o)[S](a(A));break}case"replicate":{const{amount:O}=b.arguments_;o=reify(o),o=o._repeatCycles(O)._fast(O);break}case"bjorklund":{b.arguments_.rotation?o=o.euclidRot(a(b.arguments_.pulse),a(b.arguments_.step),a(b.arguments_.rotation)):o=o.euclid(a(b.arguments_.pulse),a(b.arguments_.step));break}case"degradeBy":{o=reify(o)._degradeByWith(rand.early(randOffset*b.arguments_.seed),b.arguments_.amount??.5);break}case"tail":{const O=a(b.arguments_.element);o=o.fmap(S=>A=>Array.isArray(S)?[...S,A]:[S,A]).appLeft(O);break}case"range":{const O=a(b.arguments_.element);o=reify(o);const S=(M,E,R=1)=>Array.from({length:Math.abs(E-M)/R+1},(L,U)=>M<E?M+U*R:M-U*R);o=((M,E)=>M.squeezeBind(R=>E.bind(L=>fastcat(...S(R,L)))))(o,O);break}default:console.warn(`operator "${b.type_}" not implemented`)}return o.__steps_source=o.__steps_source||g,o};function patternifyAST(l,a,o,u=0){o?.(l);const d=f=>patternifyAST(f,a,o,u);switch(l.type_){case"pattern":{const f=l.source_.map(O=>d(O)).map(applyOptions(l,d)),p=l.arguments_.alignment,g=f.filter(O=>O.__steps_source);let b;switch(p){case"stack":{b=stack(...f),g.length&&(b._steps=lcm(...g.map(O=>fraction$1(O._steps))));break}case"polymeter_slowcat":{b=stack(...f.map(O=>O._slow(O.__weight))),g.length&&(b._steps=lcm(...g.map(O=>fraction$1(O._steps))));break}case"polymeter":{const O=l.arguments_.stepsPerCycle?d(l.arguments_.stepsPerCycle).fmap(A=>fraction$1(A)):pure(fraction$1(f.length>0?f[0].__weight:1)),S=f.map(A=>A.fast(O.fmap(M=>M.div(A.__weight))));b=stack(...S);break}case"rand":{b=chooseInWith(rand.early(randOffset*l.arguments_.seed).segment(1),f),g.length&&(b._steps=lcm(...g.map(O=>fraction$1(O._steps))));break}case"feet":{b=fastcat(...f);break}default:{if(l.source_.some(S=>!!S.options_?.weight)){const S=l.source_.reduce((A,M)=>A.add(M.options_?.weight||fraction$1(1)),fraction$1(0));b=timeCat(...l.source_.map((A,M)=>[A.options_?.weight||fraction$1(1),f[M]])),b.__weight=S,b._steps=S,g.length&&(b._steps=b._steps.mul(lcm(...g.map(A=>fraction$1(A._steps)))))}else b=sequence(...f),b._steps=f.length;l.arguments_._steps&&(b.__steps_source=!0)}}return g.length&&(b.__steps_source=!0),b}case"element":return d(l.source_);case"atom":{if(l.source_==="~"||l.source_==="-")return silence;if(!l.location_)return console.warn("no location for",l),l.source_;const f=isNaN(Number(l.source_))?l.source_:Number(l.source_);if(u===-1)return pure(f);const[p,g]=getLeafLocation(a,l,u);return pure(f).withLoc(p,g)}case"stretch":return d(l.source_).slow(d(l.arguments_.amount));default:return console.warn(`node type "${l.type_}" not implemented -> returning silence`),silence}}const getLeafLocation=(l,a,o=0)=>{const{start:u,end:d}=a.location_,f=l?.split("").slice(u.offset,d.offset).join(""),[p=0,g=0]=f?f.split(a.source_).map(b=>b.split("").filter(O=>O===" ").length):[];return[u.offset+p+o,d.offset-g+o]},mini2ast=(l,a=0,o=l)=>{try{return peg$parse(l)}catch(u){const d=[u.location.start.offset+a,u.location.end.offset+a],f=o.slice(0,d[0]).split(`
`).length;throw new Error(`[mini] parse error at line ${f}: ${u.message}`)}},getLeaves=(l,a,o)=>{const u=mini2ast(l,a,o);let d=[];return patternifyAST(u,l,f=>{f.type_==="atom"&&d.push(f)},-1),d},getLeafLocations=(l,a=0,o)=>getLeaves(l,a,o).map(u=>getLeafLocation(l,u,a)),mini$1=(...l)=>{const a=l.map(o=>{const u=`"${o}"`,d=mini2ast(u);return patternifyAST(d,u)});return sequence(...a)},m$1=(l,a)=>{const o=`"${l}"`,u=mini2ast(o);return patternifyAST(u,o,null,a)},h$1=l=>{const a=mini2ast(l);return patternifyAST(a,l)};function minify(l){return typeof l=="string"?mini$1(l):reify(l)}function miniAllStrings(){setStringParser(mini$1)}const index$a=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(l,a){for(var o=65536,u=0;u<a.length;u+=2){if(o+=a[u],o>l)return!1;if(o+=a[u+1],o>=l)return!0}return!1}function isIdentifierStart(l,a){return l<65?l===36:l<91?!0:l<97?l===95:l<123?!0:l<=65535?l>=170&&nonASCIIidentifierStart.test(String.fromCharCode(l)):a===!1?!1:isInAstralSet(l,astralIdentifierStartCodes)}function isIdentifierChar(l,a){return l<48?l===36:l<58?!0:l<65?!1:l<91?!0:l<97?l===95:l<123?!0:l<=65535?l>=170&&nonASCIIidentifier.test(String.fromCharCode(l)):a===!1?!1:isInAstralSet(l,astralIdentifierStartCodes)||isInAstralSet(l,astralIdentifierCodes)}var TokenType=function(a,o){o===void 0&&(o={}),this.label=a,this.keyword=o.keyword,this.beforeExpr=!!o.beforeExpr,this.startsExpr=!!o.startsExpr,this.isLoop=!!o.isLoop,this.isAssign=!!o.isAssign,this.prefix=!!o.prefix,this.postfix=!!o.postfix,this.binop=o.binop||null,this.updateContext=null};function binop(l,a){return new TokenType(l,{beforeExpr:!0,binop:a})}var beforeExpr={beforeExpr:!0},startsExpr={startsExpr:!0},keywords$2={};function kw(l,a){return a===void 0&&(a={}),a.keyword=l,keywords$2[l]=new TokenType(l,a)}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(l){return l===10||l===13||l===8232||l===8233}function nextLineBreak(l,a,o){o===void 0&&(o=l.length);for(var u=a;u<o;u++){var d=l.charCodeAt(u);if(isNewLine(d))return u<o-1&&d===13&&l.charCodeAt(u+1)===10?u+2:u+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(l,a){return hasOwnProperty.call(l,a)},isArray=Array.isArray||function(l){return toString.call(l)==="[object Array]"},regexpCache=Object.create(null);function wordsRegexp(l){return regexpCache[l]||(regexpCache[l]=new RegExp("^(?:"+l.replace(/ /g,"|")+")$"))}function codePointToString(l){return l<=65535?String.fromCharCode(l):(l-=65536,String.fromCharCode((l>>10)+55296,(l&1023)+56320))}var loneSurrogate=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Position=function(a,o){this.line=a,this.column=o};Position.prototype.offset=function(a){return new Position(this.line,this.column+a)};var SourceLocation=function(a,o,u){this.start=o,this.end=u,a.sourceFile!==null&&(this.source=a.sourceFile)};function getLineInfo(l,a){for(var o=1,u=0;;){var d=nextLineBreak(l,u,a);if(d<0)return new Position(o,a-u);++o,u=d}}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(l){var a={};for(var o in defaultOptions)a[o]=l&&hasOwn(l,o)?l[o]:defaultOptions[o];if(a.ecmaVersion==="latest"?a.ecmaVersion=1e8:a.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.`)),a.ecmaVersion=11):a.ecmaVersion>=2015&&(a.ecmaVersion-=2009),a.allowReserved==null&&(a.allowReserved=a.ecmaVersion<5),(!l||l.allowHashBang==null)&&(a.allowHashBang=a.ecmaVersion>=14),isArray(a.onToken)){var u=a.onToken;a.onToken=function(d){return u.push(d)}}return isArray(a.onComment)&&(a.onComment=pushComment(a,a.onComment)),a}function pushComment(l,a){return function(o,u,d,f,p,g){var b={type:o?"Block":"Line",value:u,start:d,end:f};l.locations&&(b.loc=new SourceLocation(this,p,g)),l.ranges&&(b.range=[d,f]),a.push(b)}}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(l,a){return SCOPE_FUNCTION|(l?SCOPE_ASYNC:0)|(a?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(a,o,u){this.options=a=getOptions(a),this.sourceFile=a.sourceFile,this.keywords=wordsRegexp(keywords$1[a.ecmaVersion>=6?6:a.sourceType==="module"?"5module":5]);var d="";a.allowReserved!==!0&&(d=reservedWords[a.ecmaVersion>=6?6:a.ecmaVersion===5?5:3],a.sourceType==="module"&&(d+=" await")),this.reservedWords=wordsRegexp(d);var f=(d?d+" ":"")+reservedWords.strict;this.reservedWordsStrict=wordsRegexp(f),this.reservedWordsStrictBind=wordsRegexp(f+" "+reservedWords.strictBind),this.input=String(o),this.containsEsc=!1,u?(this.pos=u,this.lineStart=this.input.lastIndexOf(`
`,u-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=a.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&&a.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 a=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(a)},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 l=this.scopeStack.length-1;l>=0;l--){var a=this.scopeStack[l];if(a.inClassFieldInit||a.flags&SCOPE_CLASS_STATIC_BLOCK)return!1;if(a.flags&SCOPE_FUNCTION)return(a.flags&SCOPE_ASYNC)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},prototypeAccessors.allowSuper.get=function(){var l=this.currentThisScope(),a=l.flags,o=l.inClassFieldInit;return(a&SCOPE_SUPER)>0||o||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 l=this.currentThisScope(),a=l.flags,o=l.inClassFieldInit;return(a&(SCOPE_FUNCTION|SCOPE_CLASS_STATIC_BLOCK))>0||o},prototypeAccessors.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&SCOPE_CLASS_STATIC_BLOCK)>0},Parser$1.extend=function(){for(var a=[],o=arguments.length;o--;)a[o]=arguments[o];for(var u=this,d=0;d<a.length;d++)u=a[d](u);return u},Parser$1.parse=function(a,o){return new this(o,a).parse()},Parser$1.parseExpressionAt=function(a,o,u){var d=new this(u,a,o);return d.nextToken(),d.parseExpression()},Parser$1.tokenizer=function(a,o){return new this(o,a)},Object.defineProperties(Parser$1.prototype,prototypeAccessors);var pp$9=Parser$1.prototype,literal$1=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;pp$9.strictDirective=function(l){if(this.options.ecmaVersion<5)return!1;for(;;){skipWhiteSpace.lastIndex=l,l+=skipWhiteSpace.exec(this.input)[0].length;var a=literal$1.exec(this.input.slice(l));if(!a)return!1;if((a[1]||a[2])==="use strict"){skipWhiteSpace.lastIndex=l+a[0].length;var o=skipWhiteSpace.exec(this.input),u=o.index+o[0].length,d=this.input.charAt(u);return d===";"||d==="}"||lineBreak.test(o[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(d)||d==="!"&&this.input.charAt(u+1)==="=")}l+=a[0].length,skipWhiteSpace.lastIndex=l,l+=skipWhiteSpace.exec(this.input)[0].length,this.input[l]===";"&&l++}},pp$9.eat=function(l){return this.type===l?(this.next(),!0):!1},pp$9.isContextual=function(l){return this.type===types$1.name&&this.value===l&&!this.containsEsc},pp$9.eatContextual=function(l){return this.isContextual(l)?(this.next(),!0):!1},pp$9.expectContextual=function(l){this.eatContextual(l)||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(l,a){if(this.type===l)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),a||this.next(),!0},pp$9.expect=function(l){this.eat(l)||this.unexpected()},pp$9.unexpected=function(l){this.raise(l??this.start,"Unexpected token")};var DestructuringErrors=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};pp$9.checkPatternErrors=function(l,a){if(l){l.trailingComma>-1&&this.raiseRecoverable(l.trailingComma,"Comma is not permitted after the rest element");var o=a?l.parenthesizedAssign:l.parenthesizedBind;o>-1&&this.raiseRecoverable(o,a?"Assigning to rvalue":"Parenthesized pattern")}},pp$9.checkExpressionErrors=function(l,a){if(!l)return!1;var o=l.shorthandAssign,u=l.doubleProto;if(!a)return o>=0||u>=0;o>=0&&this.raise(o,"Shorthand property assignments are valid only in destructuring patterns"),u>=0&&this.raiseRecoverable(u,"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(l){return l.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(l.expression):l.type==="Identifier"||l.type==="MemberExpression"};var pp$8=Parser$1.prototype;pp$8.parseTopLevel=function(l){var a=Object.create(null);for(l.body||(l.body=[]);this.type!==types$1.eof;){var o=this.parseStatement(null,!0,a);l.body.push(o)}if(this.inModule)for(var u=0,d=Object.keys(this.undefinedExports);u<d.length;u+=1){var f=d[u];this.raiseRecoverable(this.undefinedExports[f].start,"Export '"+f+"' is not defined")}return this.adaptDirectivePrologue(l.body),this.next(),l.sourceType=this.options.sourceType,this.finishNode(l,"Program")};var loopLabel={kind:"loop"},switchLabel={kind:"switch"};pp$8.isLet=function(l){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;skipWhiteSpace.lastIndex=this.pos;var a=skipWhiteSpace.exec(this.input),o=this.pos+a[0].length,u=this.input.charCodeAt(o);if(u===91||u===92)return!0;if(l)return!1;if(u===123||u>55295&&u<56320)return!0;if(isIdentifierStart(u,!0)){for(var d=o+1;isIdentifierChar(u=this.input.charCodeAt(d),!0);)++d;if(u===92||u>55295&&u<56320)return!0;var f=this.input.slice(o,d);if(!keywordRelationalOperator.test(f))return!0}return!1},pp$8.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;skipWhiteSpace.lastIndex=this.pos;var l=skipWhiteSpace.exec(this.input),a=this.pos+l[0].length,o;return!lineBreak.test(this.input.slice(this.pos,a))&&this.input.slice(a,a+8)==="function"&&(a+8===this.input.length||!(isIdentifierChar(o=this.input.charCodeAt(a+8))||o>55295&&o<56320))},pp$8.parseStatement=function(l,a,o){var u=this.type,d=this.startNode(),f;switch(this.isLet(l)&&(u=types$1._var,f="let"),u){case types$1._break:case types$1._continue:return this.parseBreakContinueStatement(d,u.keyword);case types$1._debugger:return this.parseDebuggerStatement(d);case types$1._do:return this.parseDoStatement(d);case types$1._for:return this.parseForStatement(d);case types$1._function:return l&&(this.strict||l!=="if"&&l!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(d,!1,!l);case types$1._class:return l&&this.unexpected(),this.parseClass(d,!0);case types$1._if:return this.parseIfStatement(d);case types$1._return:return this.parseReturnStatement(d);case types$1._switch:return this.parseSwitchStatement(d);case types$1._throw:return this.parseThrowStatement(d);case types$1._try:return this.parseTryStatement(d);case types$1._const:case types$1._var:return f=f||this.value,l&&f!=="var"&&this.unexpected(),this.parseVarStatement(d,f);case types$1._while:return this.parseWhileStatement(d);case types$1._with:return this.parseWithStatement(d);case types$1.braceL:return this.parseBlock(!0,d);case types$1.semi:return this.parseEmptyStatement(d);case types$1._export:case types$1._import:if(this.options.ecmaVersion>10&&u===types$1._import){skipWhiteSpace.lastIndex=this.pos;var p=skipWhiteSpace.exec(this.input),g=this.pos+p[0].length,b=this.input.charCodeAt(g);if(b===40||b===46)return this.parseExpressionStatement(d,this.parseExpression())}return this.options.allowImportExportEverywhere||(a||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'")),u===types$1._import?this.parseImport(d):this.parseExport(d,o);default:if(this.isAsyncFunction())return l&&this.unexpected(),this.next(),this.parseFunctionStatement(d,!0,!l);var O=this.value,S=this.parseExpression();return u===types$1.name&&S.type==="Identifier"&&this.eat(types$1.colon)?this.parseLabeledStatement(d,O,S,l):this.parseExpressionStatement(d,S)}},pp$8.parseBreakContinueStatement=function(l,a){var o=a==="break";this.next(),this.eat(types$1.semi)||this.insertSemicolon()?l.label=null:this.type!==types$1.name?this.unexpected():(l.label=this.parseIdent(),this.semicolon());for(var u=0;u<this.labels.length;++u){var d=this.labels[u];if((l.label==null||d.name===l.label.name)&&(d.kind!=null&&(o||d.kind==="loop")||l.label&&o))break}return u===this.labels.length&&this.raise(l.start,"Unsyntactic "+a),this.finishNode(l,o?"BreakStatement":"ContinueStatement")},pp$8.parseDebuggerStatement=function(l){return this.next(),this.semicolon(),this.finishNode(l,"DebuggerStatement")},pp$8.parseDoStatement=function(l){return this.next(),this.labels.push(loopLabel),l.body=this.parseStatement("do"),this.labels.pop(),this.expect(types$1._while),l.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(types$1.semi):this.semicolon(),this.finishNode(l,"DoWhileStatement")},pp$8.parseForStatement=function(l){this.next();var a=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 a>-1&&this.unexpected(a),this.parseFor(l,null);var o=this.isLet();if(this.type===types$1._var||this.type===types$1._const||o){var u=this.startNode(),d=o?"let":this.value;return this.next(),this.parseVar(u,!0,d),this.finishNode(u,"VariableDeclaration"),(this.type===types$1._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&u.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===types$1._in?a>-1&&this.unexpected(a):l.await=a>-1),this.parseForIn(l,u)):(a>-1&&this.unexpected(a),this.parseFor(l,u))}var f=this.isContextual("let"),p=!1,g=this.containsEsc,b=new DestructuringErrors,O=this.start,S=a>-1?this.parseExprSubscripts(b,"await"):this.parseExpression(!0,b);return this.type===types$1._in||(p=this.options.ecmaVersion>=6&&this.isContextual("of"))?(a>-1?(this.type===types$1._in&&this.unexpected(a),l.await=!0):p&&this.options.ecmaVersion>=8&&(S.start===O&&!g&&S.type==="Identifier"&&S.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(l.await=!1)),f&&p&&this.raise(S.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(S,!1,b),this.checkLValPattern(S),this.parseForIn(l,S)):(this.checkExpressionErrors(b,!0),a>-1&&this.unexpected(a),this.parseFor(l,S))},pp$8.parseFunctionStatement=function(l,a,o){return this.next(),this.parseFunction(l,FUNC_STATEMENT|(o?0:FUNC_HANGING_STATEMENT),!1,a)},pp$8.parseIfStatement=function(l){return this.next(),l.test=this.parseParenExpression(),l.consequent=this.parseStatement("if"),l.alternate=this.eat(types$1._else)?this.parseStatement("if"):null,this.finishNode(l,"IfStatement")},pp$8.parseReturnStatement=function(l){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(types$1.semi)||this.insertSemicolon()?l.argument=null:(l.argument=this.parseExpression(),this.semicolon()),this.finishNode(l,"ReturnStatement")},pp$8.parseSwitchStatement=function(l){this.next(),l.discriminant=this.parseParenExpression(),l.cases=[],this.expect(types$1.braceL),this.labels.push(switchLabel),this.enterScope(0);for(var a,o=!1;this.type!==types$1.braceR;)if(this.type===types$1._case||this.type===types$1._default){var u=this.type===types$1._case;a&&this.finishNode(a,"SwitchCase"),l.cases.push(a=this.startNode()),a.consequent=[],this.next(),u?a.test=this.parseExpression():(o&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),o=!0,a.test=null),this.expect(types$1.colon)}else a||this.unexpected(),a.consequent.push(this.parseStatement(null));return this.exitScope(),a&&this.finishNode(a,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(l,"SwitchStatement")},pp$8.parseThrowStatement=function(l){return this.next(),lineBreak.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),l.argument=this.parseExpression(),this.semicolon(),this.finishNode(l,"ThrowStatement")};var empty$1=[];pp$8.parseCatchClauseParam=function(){var l=this.parseBindingAtom(),a=l.type==="Identifier";return this.enterScope(a?SCOPE_SIMPLE_CATCH:0),this.checkLValPattern(l,a?BIND_SIMPLE_CATCH:BIND_LEXICAL),this.expect(types$1.parenR),l},pp$8.parseTryStatement=function(l){if(this.next(),l.block=this.parseBlock(),l.handler=null,this.type===types$1._catch){var a=this.startNode();this.next(),this.eat(types$1.parenL)?a.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),a.param=null,this.enterScope(0)),a.body=this.parseBlock(!1),this.exitScope(),l.handler=this.finishNode(a,"CatchClause")}return l.finalizer=this.eat(types$1._finally)?this.parseBlock():null,!l.handler&&!l.finalizer&&this.raise(l.start,"Missing catch or finally clause"),this.finishNode(l,"TryStatement")},pp$8.parseVarStatement=function(l,a,o){return this.next(),this.parseVar(l,!1,a,o),this.semicolon(),this.finishNode(l,"VariableDeclaration")},pp$8.parseWhileStatement=function(l){return this.next(),l.test=this.parseParenExpression(),this.labels.push(loopLabel),l.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(l,"WhileStatement")},pp$8.parseWithStatement=function(l){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),l.object=this.parseParenExpression(),l.body=this.parseStatement("with"),this.finishNode(l,"WithStatement")},pp$8.parseEmptyStatement=function(l){return this.next(),this.finishNode(l,"EmptyStatement")},pp$8.parseLabeledStatement=function(l,a,o,u){for(var d=0,f=this.labels;d<f.length;d+=1){var p=f[d];p.name===a&&this.raise(o.start,"Label '"+a+"' is already declared")}for(var g=this.type.isLoop?"loop":this.type===types$1._switch?"switch":null,b=this.labels.length-1;b>=0;b--){var O=this.labels[b];if(O.statementStart===l.start)O.statementStart=this.start,O.kind=g;else break}return this.labels.push({name:a,kind:g,statementStart:this.start}),l.body=this.parseStatement(u?u.indexOf("label")===-1?u+"label":u:"label"),this.labels.pop(),l.label=o,this.finishNode(l,"LabeledStatement")},pp$8.parseExpressionStatement=function(l,a){return l.expression=a,this.semicolon(),this.finishNode(l,"ExpressionStatement")},pp$8.parseBlock=function(l,a,o){for(l===void 0&&(l=!0),a===void 0&&(a=this.startNode()),a.body=[],this.expect(types$1.braceL),l&&this.enterScope(0);this.type!==types$1.braceR;){var u=this.parseStatement(null);a.body.push(u)}return o&&(this.strict=!1),this.next(),l&&this.exitScope(),this.finishNode(a,"BlockStatement")},pp$8.parseFor=function(l,a){return l.init=a,this.expect(types$1.semi),l.test=this.type===types$1.semi?null:this.parseExpression(),this.expect(types$1.semi),l.update=this.type===types$1.parenR?null:this.parseExpression(),this.expect(types$1.parenR),l.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(l,"ForStatement")},pp$8.parseForIn=function(l,a){var o=this.type===types$1._in;return this.next(),a.type==="VariableDeclaration"&&a.declarations[0].init!=null&&(!o||this.options.ecmaVersion<8||this.strict||a.kind!=="var"||a.declarations[0].id.type!=="Identifier")&&this.raise(a.start,(o?"for-in":"for-of")+" loop variable declaration may not have an initializer"),l.left=a,l.right=o?this.parseExpression():this.parseMaybeAssign(),this.expect(types$1.parenR),l.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(l,o?"ForInStatement":"ForOfStatement")},pp$8.parseVar=function(l,a,o,u){for(l.declarations=[],l.kind=o;;){var d=this.startNode();if(this.parseVarId(d,o),this.eat(types$1.eq)?d.init=this.parseMaybeAssign(a):!u&&o==="const"&&!(this.type===types$1._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!u&&d.id.type!=="Identifier"&&!(a&&(this.type===types$1._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):d.init=null,l.declarations.push(this.finishNode(d,"VariableDeclarator")),!this.eat(types$1.comma))break}return l},pp$8.parseVarId=function(l,a){l.id=this.parseBindingAtom(),this.checkLValPattern(l.id,a==="var"?BIND_VAR:BIND_LEXICAL,!1)};var FUNC_STATEMENT=1,FUNC_HANGING_STATEMENT=2,FUNC_NULLABLE_ID=4;pp$8.parseFunction=function(l,a,o,u,d){this.initFunction(l),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!u)&&(this.type===types$1.star&&a&FUNC_HANGING_STATEMENT&&this.unexpected(),l.generator=this.eat(types$1.star)),this.options.ecmaVersion>=8&&(l.async=!!u),a&FUNC_STATEMENT&&(l.id=a&FUNC_NULLABLE_ID&&this.type!==types$1.name?null:this.parseIdent(),l.id&&!(a&FUNC_HANGING_STATEMENT)&&this.checkLValSimple(l.id,this.strict||l.generator||l.async?this.treatFunctionsAsVar?BIND_VAR:BIND_LEXICAL:BIND_FUNCTION));var f=this.yieldPos,p=this.awaitPos,g=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(functionFlags(l.async,l.generator)),a&FUNC_STATEMENT||(l.id=this.type===types$1.name?this.parseIdent():null),this.parseFunctionParams(l),this.parseFunctionBody(l,o,!1,d),this.yieldPos=f,this.awaitPos=p,this.awaitIdentPos=g,this.finishNode(l,a&FUNC_STATEMENT?"FunctionDeclaration":"FunctionExpression")},pp$8.parseFunctionParams=function(l){this.expect(types$1.parenL),l.params=this.parseBindingList(types$1.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},pp$8.parseClass=function(l,a){this.next();var o=this.strict;this.strict=!0,this.parseClassId(l,a),this.parseClassSuper(l);var u=this.enterClassBody(),d=this.startNode(),f=!1;for(d.body=[],this.expect(types$1.braceL);this.type!==types$1.braceR;){var p=this.parseClassElement(l.superClass!==null);p&&(d.body.push(p),p.type==="MethodDefinition"&&p.kind==="constructor"?(f&&this.raiseRecoverable(p.start,"Duplicate constructor in the same class"),f=!0):p.key&&p.key.type==="PrivateIdentifier"&&isPrivateNameConflicted(u,p)&&this.raiseRecoverable(p.key.start,"Identifier '#"+p.key.name+"' has already been declared"))}return this.strict=o,this.next(),l.body=this.finishNode(d,"ClassBody"),this.exitClassBody(),this.finishNode(l,a?"ClassDeclaration":"ClassExpression")},pp$8.parseClassElement=function(l){if(this.eat(types$1.semi))return null;var a=this.options.ecmaVersion,o=this.startNode(),u="",d=!1,f=!1,p="method",g=!1;if(this.eatContextual("static")){if(a>=13&&this.eat(types$1.braceL))return this.parseClassStaticBlock(o),o;this.isClassElementNameStart()||this.type===types$1.star?g=!0:u="static"}if(o.static=g,!u&&a>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===types$1.star)&&!this.canInsertSemicolon()?f=!0:u="async"),!u&&(a>=9||!f)&&this.eat(types$1.star)&&(d=!0),!u&&!f&&!d){var b=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?p=b:u=b)}if(u?(o.computed=!1,o.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),o.key.name=u,this.finishNode(o.key,"Identifier")):this.parseClassElementName(o),a<13||this.type===types$1.parenL||p!=="method"||d||f){var O=!o.static&&checkKeyName(o,"constructor"),S=O&&l;O&&p!=="method"&&this.raise(o.key.start,"Constructor can't have get/set modifier"),o.kind=O?"constructor":p,this.parseClassMethod(o,d,f,S)}else this.parseClassField(o);return o},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(l){this.type===types$1.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),l.computed=!1,l.key=this.parsePrivateIdent()):this.parsePropertyName(l)},pp$8.parseClassMethod=function(l,a,o,u){var d=l.key;l.kind==="constructor"?(a&&this.raise(d.start,"Constructor can't be a generator"),o&&this.raise(d.start,"Constructor can't be an async method")):l.static&&checkKeyName(l,"prototype")&&this.raise(d.start,"Classes may not have a static property named prototype");var f=l.value=this.parseMethod(a,o,u);return l.kind==="get"&&f.params.length!==0&&this.raiseRecoverable(f.start,"getter should have no params"),l.kind==="set"&&f.params.length!==1&&this.raiseRecoverable(f.start,"setter should have exactly one param"),l.kind==="set"&&f.params[0].type==="RestElement"&&this.raiseRecoverable(f.params[0].start,"Setter cannot use rest params"),this.finishNode(l,"MethodDefinition")},pp$8.parseClassField=function(l){if(checkKeyName(l,"constructor")?this.raise(l.key.start,"Classes can't have a field named 'constructor'"):l.static&&checkKeyName(l,"prototype")&&this.raise(l.key.start,"Classes can't have a static field named 'prototype'"),this.eat(types$1.eq)){var a=this.currentThisScope(),o=a.inClassFieldInit;a.inClassFieldInit=!0,l.value=this.parseMaybeAssign(),a.inClassFieldInit=o}else l.value=null;return this.semicolon(),this.finishNode(l,"PropertyDefinition")},pp$8.parseClassStaticBlock=function(l){l.body=[];var a=this.labels;for(this.labels=[],this.enterScope(SCOPE_CLASS_STATIC_BLOCK|SCOPE_SUPER);this.type!==types$1.braceR;){var o=this.parseStatement(null);l.body.push(o)}return this.next(),this.exitScope(),this.labels=a,this.finishNode(l,"StaticBlock")},pp$8.parseClassId=function(l,a){this.type===types$1.name?(l.id=this.parseIdent(),a&&this.checkLValSimple(l.id,BIND_LEXICAL,!1)):(a===!0&&this.unexpected(),l.id=null)},pp$8.parseClassSuper=function(l){l.superClass=this.eat(types$1._extends)?this.parseExprSubscripts(null,!1):null},pp$8.enterClassBody=function(){var l={declared:Object.create(null),used:[]};return this.privateNameStack.push(l),l.declared},pp$8.exitClassBody=function(){var l=this.privateNameStack.pop(),a=l.declared,o=l.used;if(this.options.checkPrivateFields)for(var u=this.privateNameStack.length,d=u===0?null:this.privateNameStack[u-1],f=0;f<o.length;++f){var p=o[f];hasOwn(a,p.name)||(d?d.used.push(p):this.raiseRecoverable(p.start,"Private field '#"+p.name+"' must be declared in an enclosing class"))}};function isPrivateNameConflicted(l,a){var o=a.key.name,u=l[o],d="true";return a.type==="MethodDefinition"&&(a.kind==="get"||a.kind==="set")&&(d=(a.static?"s":"i")+a.kind),u==="iget"&&d==="iset"||u==="iset"&&d==="iget"||u==="sget"&&d==="sset"||u==="sset"&&d==="sget"?(l[o]="true",!1):u?!0:(l[o]=d,!1)}function checkKeyName(l,a){var o=l.computed,u=l.key;return!o&&(u.type==="Identifier"&&u.name===a||u.type==="Literal"&&u.value===a)}pp$8.parseExportAllDeclaration=function(l,a){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(l.exported=this.parseModuleExportName(),this.checkExport(a,l.exported,this.lastTokStart)):l.exported=null),this.expectContextual("from"),this.type!==types$1.string&&this.unexpected(),l.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(l.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(l,"ExportAllDeclaration")},pp$8.parseExport=function(l,a){if(this.next(),this.eat(types$1.star))return this.parseExportAllDeclaration(l,a);if(this.eat(types$1._default))return this.checkExport(a,"default",this.lastTokStart),l.declaration=this.parseExportDefaultDeclaration(),this.finishNode(l,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())l.declaration=this.parseExportDeclaration(l),l.declaration.type==="VariableDeclaration"?this.checkVariableExport(a,l.declaration.declarations):this.checkExport(a,l.declaration.id,l.declaration.id.start),l.specifiers=[],l.source=null;else{if(l.declaration=null,l.specifiers=this.parseExportSpecifiers(a),this.eatContextual("from"))this.type!==types$1.string&&this.unexpected(),l.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(l.attributes=this.parseWithClause());else{for(var o=0,u=l.specifiers;o<u.length;o+=1){var d=u[o];this.checkUnreserved(d.local),this.checkLocalExport(d.local),d.local.type==="Literal"&&this.raise(d.local.start,"A string literal cannot be used as an exported binding without `from`.")}l.source=null}this.semicolon()}return this.finishNode(l,"ExportNamedDeclaration")},pp$8.parseExportDeclaration=function(l){return this.parseStatement(null)},pp$8.parseExportDefaultDeclaration=function(){var l;if(this.type===types$1._function||(l=this.isAsyncFunction())){var a=this.startNode();return this.next(),l&&this.next(),this.parseFunction(a,FUNC_STATEMENT|FUNC_NULLABLE_ID,!1,l)}else if(this.type===types$1._class){var o=this.startNode();return this.parseClass(o,"nullableID")}else{var u=this.parseMaybeAssign();return this.semicolon(),u}},pp$8.checkExport=function(l,a,o){l&&(typeof a!="string"&&(a=a.type==="Identifier"?a.name:a.value),hasOwn(l,a)&&this.raiseRecoverable(o,"Duplicate export '"+a+"'"),l[a]=!0)},pp$8.checkPatternExport=function(l,a){var o=a.type;if(o==="Identifier")this.checkExport(l,a,a.start);else if(o==="ObjectPattern")for(var u=0,d=a.properties;u<d.length;u+=1){var f=d[u];this.checkPatternExport(l,f)}else if(o==="ArrayPattern")for(var p=0,g=a.elements;p<g.length;p+=1){var b=g[p];b&&this.checkPatternExport(l,b)}else o==="Property"?this.checkPatternExport(l,a.value):o==="AssignmentPattern"?this.checkPatternExport(l,a.left):o==="RestElement"&&this.checkPatternExport(l,a.argument)},pp$8.checkVariableExport=function(l,a){if(l)for(var o=0,u=a;o<u.length;o+=1){var d=u[o];this.checkPatternExport(l,d.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(l){var a=this.startNode();return a.local=this.parseModuleExportName(),a.exported=this.eatContextual("as")?this.parseModuleExportName():a.local,this.checkExport(l,a.exported,a.exported.start),this.finishNode(a,"ExportSpecifier")},pp$8.parseExportSpecifiers=function(l){var a=[],o=!0;for(this.expect(types$1.braceL);!this.eat(types$1.braceR);){if(o)o=!1;else if(this.expect(types$1.comma),this.afterTrailingComma(types$1.braceR))break;a.push(this.parseExportSpecifier(l))}return a},pp$8.parseImport=function(l){return this.next(),this.type===types$1.string?(l.specifiers=empty$1,l.source=this.parseExprAtom()):(l.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),l.source=this.type===types$1.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(l.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(l,"ImportDeclaration")},pp$8.parseImportSpecifier=function(){var l=this.startNode();return l.imported=this.parseModuleExportName(),this.eatContextual("as")?l.local=this.parseIdent():(this.checkUnreserved(l.imported),l.local=l.imported),this.checkLValSimple(l.local,BIND_LEXICAL),this.finishNode(l,"ImportSpecifier")},pp$8.parseImportDefaultSpecifier=function(){var l=this.startNode();return l.local=this.parseIdent(),this.checkLValSimple(l.local,BIND_LEXICAL),this.finishNode(l,"ImportDefaultSpecifier")},pp$8.parseImportNamespaceSpecifier=function(){var l=this.startNode();return this.next(),this.expectContextual("as"),l.local=this.parseIdent(),this.checkLValSimple(l.local,BIND_LEXICAL),this.finishNode(l,"ImportNamespaceSpecifier")},pp$8.parseImportSpecifiers=function(){var l=[],a=!0;if(this.type===types$1.name&&(l.push(this.parseImportDefaultSpecifier()),!this.eat(types$1.comma)))return l;if(this.type===types$1.star)return l.push(this.parseImportNamespaceSpecifier()),l;for(this.expect(types$1.braceL);!this.eat(types$1.braceR);){if(a)a=!1;else if(this.expect(types$1.comma),this.afterTrailingComma(types$1.braceR))break;l.push(this.parseImportSpecifier())}return l},pp$8.parseWithClause=function(){var l=[];if(!this.eat(types$1._with))return l;this.expect(types$1.braceL);for(var a={},o=!0;!this.eat(types$1.braceR);){if(o)o=!1;else if(this.expect(types$1.comma),this.afterTrailingComma(types$1.braceR))break;var u=this.parseImportAttribute(),d=u.key.type==="Identifier"?u.key.name:u.key.value;hasOwn(a,d)&&this.raiseRecoverable(u.key.start,"Duplicate attribute key '"+d+"'"),a[d]=!0,l.push(u)}return l},pp$8.parseImportAttribute=function(){var l=this.startNode();return l.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(),l.value=this.parseExprAtom(),this.finishNode(l,"ImportAttribute")},pp$8.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===types$1.string){var l=this.parseLiteral(this.value);return loneSurrogate.test(l.value)&&this.raise(l.start,"An export name cannot include a lone surrogate."),l}return this.parseIdent(!0)},pp$8.adaptDirectivePrologue=function(l){for(var a=0;a<l.length&&this.isDirectiveCandidate(l[a]);++a)l[a].directive=l[a].expression.raw.slice(1,-1)},pp$8.isDirectiveCandidate=function(l){return this.options.ecmaVersion>=5&&l.type==="ExpressionStatement"&&l.expression.type==="Literal"&&typeof l.expression.value=="string"&&(this.input[l.start]==='"'||this.input[l.start]==="'")};var pp$7=Parser$1.prototype;pp$7.toAssignable=function(l,a,o){if(this.options.ecmaVersion>=6&&l)switch(l.type){case"Identifier":this.inAsync&&l.name==="await"&&this.raise(l.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":l.type="ObjectPattern",o&&this.checkPatternErrors(o,!0);for(var u=0,d=l.properties;u<d.length;u+=1){var f=d[u];this.toAssignable(f,a),f.type==="RestElement"&&(f.argument.type==="ArrayPattern"||f.argument.type==="ObjectPattern")&&this.raise(f.argument.start,"Unexpected token")}break;case"Property":l.kind!=="init"&&this.raise(l.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(l.value,a);break;case"ArrayExpression":l.type="ArrayPattern",o&&this.checkPatternErrors(o,!0),this.toAssignableList(l.elements,a);break;case"SpreadElement":l.type="RestElement",this.toAssignable(l.argument,a),l.argument.type==="AssignmentPattern"&&this.raise(l.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":l.operator!=="="&&this.raise(l.left.end,"Only '=' operator can be used for specifying default value."),l.type="AssignmentPattern",delete l.operator,this.toAssignable(l.left,a);break;case"ParenthesizedExpression":this.toAssignable(l.expression,a,o);break;case"ChainExpression":this.raiseRecoverable(l.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!a)break;default:this.raise(l.start,"Assigning to rvalue")}else o&&this.checkPatternErrors(o,!0);return l},pp$7.toAssignableList=function(l,a){for(var o=l.length,u=0;u<o;u++){var d=l[u];d&&this.toAssignable(d,a)}if(o){var f=l[o-1];this.options.ecmaVersion===6&&a&&f&&f.type==="RestElement"&&f.argument.type!=="Identifier"&&this.unexpected(f.argument.start)}return l},pp$7.parseSpread=function(l){var a=this.startNode();return this.next(),a.argument=this.parseMaybeAssign(!1,l),this.finishNode(a,"SpreadElement")},pp$7.parseRestBinding=function(){var l=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==types$1.name&&this.unexpected(),l.argument=this.parseBindingAtom(),this.finishNode(l,"RestElement")},pp$7.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case types$1.bracketL:var l=this.startNode();return this.next(),l.elements=this.parseBindingList(types$1.bracketR,!0,!0),this.finishNode(l,"ArrayPattern");case types$1.braceL:return this.parseObj(!0)}return this.parseIdent()},pp$7.parseBindingList=function(l,a,o,u){for(var d=[],f=!0;!this.eat(l);)if(f?f=!1:this.expect(types$1.comma),a&&this.type===types$1.comma)d.push(null);else{if(o&&this.afterTrailingComma(l))break;if(this.type===types$1.ellipsis){var p=this.parseRestBinding();this.parseBindingListItem(p),d.push(p),this.type===types$1.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(l);break}else d.push(this.parseAssignableListItem(u))}return d},pp$7.parseAssignableListItem=function(l){var a=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(a),a},pp$7.parseBindingListItem=function(l){return l},pp$7.parseMaybeDefault=function(l,a,o){if(o=o||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(types$1.eq))return o;var u=this.startNodeAt(l,a);return u.left=o,u.right=this.parseMaybeAssign(),this.finishNode(u,"AssignmentPattern")},pp$7.checkLValSimple=function(l,a,o){a===void 0&&(a=BIND_NONE);var u=a!==BIND_NONE;switch(l.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(l.name)&&this.raiseRecoverable(l.start,(u?"Binding ":"Assigning to ")+l.name+" in strict mode"),u&&(a===BIND_LEXICAL&&l.name==="let"&&this.raiseRecoverable(l.start,"let is disallowed as a lexically bound name"),o&&(hasOwn(o,l.name)&&this.raiseRecoverable(l.start,"Argument name clash"),o[l.name]=!0),a!==BIND_OUTSIDE&&this.declareName(l.name,a,l.start));break;case"ChainExpression":this.raiseRecoverable(l.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":u&&this.raiseRecoverable(l.start,"Binding member expression");break;case"ParenthesizedExpression":return u&&this.raiseRecoverable(l.start,"Binding parenthesized expression"),this.checkLValSimple(l.expression,a,o);default:this.raise(l.start,(u?"Binding":"Assigning to")+" rvalue")}},pp$7.checkLValPattern=function(l,a,o){switch(a===void 0&&(a=BIND_NONE),l.type){case"ObjectPattern":for(var u=0,d=l.properties;u<d.length;u+=1){var f=d[u];this.checkLValInnerPattern(f,a,o)}break;case"ArrayPattern":for(var p=0,g=l.elements;p<g.length;p+=1){var b=g[p];b&&this.checkLValInnerPattern(b,a,o)}break;default:this.checkLValSimple(l,a,o)}},pp$7.checkLValInnerPattern=function(l,a,o){switch(a===void 0&&(a=BIND_NONE),l.type){case"Property":this.checkLValInnerPattern(l.value,a,o);break;case"AssignmentPattern":this.checkLValPattern(l.left,a,o);break;case"RestElement":this.checkLValPattern(l.argument,a,o);break;default:this.checkLValPattern(l,a,o)}};var TokContext=function(a,o,u,d,f){this.token=a,this.isExpr=!!o,this.preserveSpace=!!u,this.override=d,this.generator=!!f},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(l){return l.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(l){var a=this.curContext();return a===types$2.f_expr||a===types$2.f_stat?!0:l===types$1.colon&&(a===types$2.b_stat||a===types$2.b_expr)?!a.isExpr:l===types$1._return||l===types$1.name&&this.exprAllowed?lineBreak.test(this.input.slice(this.lastTokEnd,this.start)):l===types$1._else||l===types$1.semi||l===types$1.eof||l===types$1.parenR||l===types$1.arrow?!0:l===types$1.braceL?a===types$2.b_stat:l===types$1._var||l===types$1._const||l===types$1.name?!1:!this.exprAllowed},pp$6.inGeneratorContext=function(){for(var l=this.context.length-1;l>=1;l--){var a=this.context[l];if(a.token==="function")return a.generator}return!1},pp$6.updateContext=function(l){var a,o=this.type;o.keyword&&l===types$1.dot?this.exprAllowed=!1:(a=o.updateContext)?a.call(this,l):this.exprAllowed=o.beforeExpr},pp$6.overrideContext=function(l){this.curContext()!==l&&(this.context[this.context.length-1]=l)},types$1.parenR.updateContext=types$1.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var l=this.context.pop();l===types$2.b_stat&&this.curContext().token==="function"&&(l=this.context.pop()),this.exprAllowed=!l.isExpr},types$1.braceL.updateContext=function(l){this.context.push(this.braceIsBlock(l)?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(l){var a=l===types$1._if||l===types$1._for||l===types$1._with||l===types$1._while;this.context.push(a?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(l){l.beforeExpr&&l!==types$1._else&&!(l===types$1.semi&&this.curContext()!==types$2.p_stat)&&!(l===types$1._return&&lineBreak.test(this.input.slice(this.lastTokEnd,this.start)))&&!((l===types$1.colon||l===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(l){if(l===types$1._function){var a=this.context.length-1;this.context[a]===types$2.f_expr?this.context[a]=types$2.f_expr_gen:this.context[a]=types$2.f_gen}this.exprAllowed=!0},types$1.name.updateContext=function(l){var a=!1;this.options.ecmaVersion>=6&&l!==types$1.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(a=!0),this.exprAllowed=a};var pp$5=Parser$1.prototype;pp$5.checkPropClash=function(l,a,o){if(!(this.options.ecmaVersion>=9&&l.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(l.computed||l.method||l.shorthand))){var u=l.key,d;switch(u.type){case"Identifier":d=u.name;break;case"Literal":d=String(u.value);break;default:return}var f=l.kind;if(this.options.ecmaVersion>=6){d==="__proto__"&&f==="init"&&(a.proto&&(o?o.doubleProto<0&&(o.doubleProto=u.start):this.raiseRecoverable(u.start,"Redefinition of __proto__ property")),a.proto=!0);return}d="$"+d;var p=a[d];if(p){var g;f==="init"?g=this.strict&&p.init||p.get||p.set:g=p.init||p[f],g&&this.raiseRecoverable(u.start,"Redefinition of property")}else p=a[d]={init:!1,get:!1,set:!1};p[f]=!0}},pp$5.parseExpression=function(l,a){var o=this.start,u=this.startLoc,d=this.parseMaybeAssign(l,a);if(this.type===types$1.comma){var f=this.startNodeAt(o,u);for(f.expressions=[d];this.eat(types$1.comma);)f.expressions.push(this.parseMaybeAssign(l,a));return this.finishNode(f,"SequenceExpression")}return d},pp$5.parseMaybeAssign=function(l,a,o){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(l);this.exprAllowed=!1}var u=!1,d=-1,f=-1,p=-1;a?(d=a.parenthesizedAssign,f=a.trailingComma,p=a.doubleProto,a.parenthesizedAssign=a.trailingComma=-1):(a=new DestructuringErrors,u=!0);var g=this.start,b=this.startLoc;(this.type===types$1.parenL||this.type===types$1.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=l==="await");var O=this.parseMaybeConditional(l,a);if(o&&(O=o.call(this,O,g,b)),this.type.isAssign){var S=this.startNodeAt(g,b);return S.operator=this.value,this.type===types$1.eq&&(O=this.toAssignable(O,!1,a)),u||(a.parenthesizedAssign=a.trailingComma=a.doubleProto=-1),a.shorthandAssign>=O.start&&(a.shorthandAssign=-1),this.type===types$1.eq?this.checkLValPattern(O):this.checkLValSimple(O),S.left=O,this.next(),S.right=this.parseMaybeAssign(l),p>-1&&(a.doubleProto=p),this.finishNode(S,"AssignmentExpression")}else u&&this.checkExpressionErrors(a,!0);return d>-1&&(a.parenthesizedAssign=d),f>-1&&(a.trailingComma=f),O},pp$5.parseMaybeConditional=function(l,a){var o=this.start,u=this.startLoc,d=this.parseExprOps(l,a);if(this.checkExpressionErrors(a))return d;if(this.eat(types$1.question)){var f=this.startNodeAt(o,u);return f.test=d,f.consequent=this.parseMaybeAssign(),this.expect(types$1.colon),f.alternate=this.parseMaybeAssign(l),this.finishNode(f,"ConditionalExpression")}return d},pp$5.parseExprOps=function(l,a){var o=this.start,u=this.startLoc,d=this.parseMaybeUnary(a,!1,!1,l);return this.checkExpressionErrors(a)||d.start===o&&d.type==="ArrowFunctionExpression"?d:this.parseExprOp(d,o,u,-1,l)},pp$5.parseExprOp=function(l,a,o,u,d){var f=this.type.binop;if(f!=null&&(!d||this.type!==types$1._in)&&f>u){var p=this.type===types$1.logicalOR||this.type===types$1.logicalAND,g=this.type===types$1.coalesce;g&&(f=types$1.logicalAND.binop);var b=this.value;this.next();var O=this.start,S=this.startLoc,A=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,d),O,S,f,d),M=this.buildBinary(a,o,l,A,b,p||g);return(p&&this.type===types$1.coalesce||g&&(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(M,a,o,u,d)}return l},pp$5.buildBinary=function(l,a,o,u,d,f){u.type==="PrivateIdentifier"&&this.raise(u.start,"Private identifier can only be left side of binary expression");var p=this.startNodeAt(l,a);return p.left=o,p.operator=d,p.right=u,this.finishNode(p,f?"LogicalExpression":"BinaryExpression")},pp$5.parseMaybeUnary=function(l,a,o,u){var d=this.start,f=this.startLoc,p;if(this.isContextual("await")&&this.canAwait)p=this.parseAwait(u),a=!0;else if(this.type.prefix){var g=this.startNode(),b=this.type===types$1.incDec;g.operator=this.value,g.prefix=!0,this.next(),g.argument=this.parseMaybeUnary(null,!0,b,u),this.checkExpressionErrors(l,!0),b?this.checkLValSimple(g.argument):this.strict&&g.operator==="delete"&&isLocalVariableAccess(g.argument)?this.raiseRecoverable(g.start,"Deleting local variable in strict mode"):g.operator==="delete"&&isPrivateFieldAccess(g.argument)?this.raiseRecoverable(g.start,"Private fields can not be deleted"):a=!0,p=this.finishNode(g,b?"UpdateExpression":"UnaryExpression")}else if(!a&&this.type===types$1.privateId)(u||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),p=this.parsePrivateIdent(),this.type!==types$1._in&&this.unexpected();else{if(p=this.parseExprSubscripts(l,u),this.checkExpressionErrors(l))return p;for(;this.type.postfix&&!this.canInsertSemicolon();){var O=this.startNodeAt(d,f);O.operator=this.value,O.prefix=!1,O.argument=p,this.checkLValSimple(p),this.next(),p=this.finishNode(O,"UpdateExpression")}}if(!o&&this.eat(types$1.starstar))if(a)this.unexpected(this.lastTokStart);else return this.buildBinary(d,f,p,this.parseMaybeUnary(null,!1,!1,u),"**",!1);else return p};function isLocalVariableAccess(l){return l.type==="Identifier"||l.type==="ParenthesizedExpression"&&isLocalVariableAccess(l.expression)}function isPrivateFieldAccess(l){return l.type==="MemberExpression"&&l.property.type==="PrivateIdentifier"||l.type==="ChainExpression"&&isPrivateFieldAccess(l.expression)||l.type==="ParenthesizedExpression"&&isPrivateFieldAccess(l.expression)}pp$5.parseExprSubscripts=function(l,a){var o=this.start,u=this.startLoc,d=this.parseExprAtom(l,a);if(d.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return d;var f=this.parseSubscripts(d,o,u,!1,a);return l&&f.type==="MemberExpression"&&(l.parenthesizedAssign>=f.start&&(l.parenthesizedAssign=-1),l.parenthesizedBind>=f.start&&(l.parenthesizedBind=-1),l.trailingComma>=f.start&&(l.trailingComma=-1)),f},pp$5.parseSubscripts=function(l,a,o,u,d){for(var f=this.options.ecmaVersion>=8&&l.type==="Identifier"&&l.name==="async"&&this.lastTokEnd===l.end&&!this.canInsertSemicolon()&&l.end-l.start===5&&this.potentialArrowAt===l.start,p=!1;;){var g=this.parseSubscript(l,a,o,u,f,p,d);if(g.optional&&(p=!0),g===l||g.type==="ArrowFunctionExpression"){if(p){var b=this.startNodeAt(a,o);b.expression=g,g=this.finishNode(b,"ChainExpression")}return g}l=g}},pp$5.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(types$1.arrow)},pp$5.parseSubscriptAsyncArrow=function(l,a,o,u){return this.parseArrowExpression(this.startNodeAt(l,a),o,!0,u)},pp$5.parseSubscript=function(l,a,o,u,d,f,p){var g=this.options.ecmaVersion>=11,b=g&&this.eat(types$1.questionDot);u&&b&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var O=this.eat(types$1.bracketL);if(O||b&&this.type!==types$1.parenL&&this.type!==types$1.backQuote||this.eat(types$1.dot)){var S=this.startNodeAt(a,o);S.object=l,O?(S.property=this.parseExpression(),this.expect(types$1.bracketR)):this.type===types$1.privateId&&l.type!=="Super"?S.property=this.parsePrivateIdent():S.property=this.parseIdent(this.options.allowReserved!=="never"),S.computed=!!O,g&&(S.optional=b),l=this.finishNode(S,"MemberExpression")}else if(!u&&this.eat(types$1.parenL)){var A=new DestructuringErrors,M=this.yieldPos,E=this.awaitPos,R=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var L=this.parseExprList(types$1.parenR,this.options.ecmaVersion>=8,!1,A);if(d&&!b&&this.shouldParseAsyncArrow())return this.checkPatternErrors(A,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=M,this.awaitPos=E,this.awaitIdentPos=R,this.parseSubscriptAsyncArrow(a,o,L,p);this.checkExpressionErrors(A,!0),this.yieldPos=M||this.yieldPos,this.awaitPos=E||this.awaitPos,this.awaitIdentPos=R||this.awaitIdentPos;var U=this.startNodeAt(a,o);U.callee=l,U.arguments=L,g&&(U.optional=b),l=this.finishNode(U,"CallExpression")}else if(this.type===types$1.backQuote){(b||f)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var Z=this.startNodeAt(a,o);Z.tag=l,Z.quasi=this.parseTemplate({isTagged:!0}),l=this.finishNode(Z,"TaggedTemplateExpression")}return l},pp$5.parseExprAtom=function(l,a,o){this.type===types$1.slash&&this.readRegexp();var u,d=this.potentialArrowAt===this.start;switch(this.type){case types$1._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),u=this.startNode(),this.next(),this.type===types$1.parenL&&!this.allowDirectSuper&&this.raise(u.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(u,"Super");case types$1._this:return u=this.startNode(),this.next(),this.finishNode(u,"ThisExpression");case types$1.name:var f=this.start,p=this.startLoc,g=this.containsEsc,b=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!g&&b.name==="async"&&!this.canInsertSemicolon()&&this.eat(types$1._function))return this.overrideContext(types$2.f_expr),this.parseFunction(this.startNodeAt(f,p),0,!1,!0,a);if(d&&!this.canInsertSemicolon()){if(this.eat(types$1.arrow))return this.parseArrowExpression(this.startNodeAt(f,p),[b],!1,a);if(this.options.ecmaVersion>=8&&b.name==="async"&&this.type===types$1.name&&!g&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return b=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(types$1.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(f,p),[b],!0,a)}return b;case types$1.regexp:var O=this.value;return u=this.parseLiteral(O.value),u.regex={pattern:O.pattern,flags:O.flags},u;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 u=this.startNode(),u.value=this.type===types$1._null?null:this.type===types$1._true,u.raw=this.type.keyword,this.next(),this.finishNode(u,"Literal");case types$1.parenL:var S=this.start,A=this.parseParenAndDistinguishExpression(d,a);return l&&(l.parenthesizedAssign<0&&!this.isSimpleAssignTarget(A)&&(l.parenthesizedAssign=S),l.parenthesizedBind<0&&(l.parenthesizedBind=S)),A;case types$1.bracketL:return u=this.startNode(),this.next(),u.elements=this.parseExprList(types$1.bracketR,!0,!0,l),this.finishNode(u,"ArrayExpression");case types$1.braceL:return this.overrideContext(types$2.b_expr),this.parseObj(!1,l);case types$1._function:return u=this.startNode(),this.next(),this.parseFunction(u,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(o):this.unexpected();default:return this.parseExprAtomDefault()}},pp$5.parseExprAtomDefault=function(){this.unexpected()},pp$5.parseExprImport=function(l){var a=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===types$1.parenL&&!l)return this.parseDynamicImport(a);if(this.type===types$1.dot){var o=this.startNodeAt(a.start,a.loc&&a.loc.start);return o.name="import",a.meta=this.finishNode(o,"Identifier"),this.parseImportMeta(a)}else this.unexpected()},pp$5.parseDynamicImport=function(l){if(this.next(),l.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(types$1.parenR)?l.options=null:(this.expect(types$1.comma),this.afterTrailingComma(types$1.parenR)?l.options=null:(l.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 a=this.start;this.eat(types$1.comma)&&this.eat(types$1.parenR)?this.raiseRecoverable(a,"Trailing comma is not allowed in import()"):this.unexpected(a)}return this.finishNode(l,"ImportExpression")},pp$5.parseImportMeta=function(l){this.next();var a=this.containsEsc;return l.property=this.parseIdent(!0),l.property.name!=="meta"&&this.raiseRecoverable(l.property.start,"The only valid meta property for import is 'import.meta'"),a&&this.raiseRecoverable(l.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(l.start,"Cannot use 'import.meta' outside a module"),this.finishNode(l,"MetaProperty")},pp$5.parseLiteral=function(l){var a=this.startNode();return a.value=l,a.raw=this.input.slice(this.start,this.end),a.raw.charCodeAt(a.raw.length-1)===110&&(a.bigint=a.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(a,"Literal")},pp$5.parseParenExpression=function(){this.expect(types$1.parenL);var l=this.parseExpression();return this.expect(types$1.parenR),l},pp$5.shouldParseArrow=function(l){return!this.canInsertSemicolon()},pp$5.parseParenAndDistinguishExpression=function(l,a){var o=this.start,u=this.startLoc,d,f=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var p=this.start,g=this.startLoc,b=[],O=!0,S=!1,A=new DestructuringErrors,M=this.yieldPos,E=this.awaitPos,R;for(this.yieldPos=0,this.awaitPos=0;this.type!==types$1.parenR;)if(O?O=!1:this.expect(types$1.comma),f&&this.afterTrailingComma(types$1.parenR,!0)){S=!0;break}else if(this.type===types$1.ellipsis){R=this.start,b.push(this.parseParenItem(this.parseRestBinding())),this.type===types$1.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else b.push(this.parseMaybeAssign(!1,A,this.parseParenItem));var L=this.lastTokEnd,U=this.lastTokEndLoc;if(this.expect(types$1.parenR),l&&this.shouldParseArrow(b)&&this.eat(types$1.arrow))return this.checkPatternErrors(A,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=M,this.awaitPos=E,this.parseParenArrowList(o,u,b,a);(!b.length||S)&&this.unexpected(this.lastTokStart),R&&this.unexpected(R),this.checkExpressionErrors(A,!0),this.yieldPos=M||this.yieldPos,this.awaitPos=E||this.awaitPos,b.length>1?(d=this.startNodeAt(p,g),d.expressions=b,this.finishNodeAt(d,"SequenceExpression",L,U)):d=b[0]}else d=this.parseParenExpression();if(this.options.preserveParens){var Z=this.startNodeAt(o,u);return Z.expression=d,this.finishNode(Z,"ParenthesizedExpression")}else return d},pp$5.parseParenItem=function(l){return l},pp$5.parseParenArrowList=function(l,a,o,u){return this.parseArrowExpression(this.startNodeAt(l,a),o,!1,u)};var empty$2=[];pp$5.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var l=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===types$1.dot){var a=this.startNodeAt(l.start,l.loc&&l.loc.start);a.name="new",l.meta=this.finishNode(a,"Identifier"),this.next();var o=this.containsEsc;return l.property=this.parseIdent(!0),l.property.name!=="target"&&this.raiseRecoverable(l.property.start,"The only valid meta property for new is 'new.target'"),o&&this.raiseRecoverable(l.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(l.start,"'new.target' can only be used in functions and class static block"),this.finishNode(l,"MetaProperty")}var u=this.start,d=this.startLoc;return l.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),u,d,!0,!1),this.eat(types$1.parenL)?l.arguments=this.parseExprList(types$1.parenR,this.options.ecmaVersion>=8,!1):l.arguments=empty$2,this.finishNode(l,"NewExpression")},pp$5.parseTemplateElement=function(l){var a=l.isTagged,o=this.startNode();return this.type===types$1.invalidTemplate?(a||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),o.value={raw:this.value.replace(/\r\n?/g,`
`),cooked:null}):o.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
`),cooked:this.value},this.next(),o.tail=this.type===types$1.backQuote,this.finishNode(o,"TemplateElement")},pp$5.parseTemplate=function(l){l===void 0&&(l={});var a=l.isTagged;a===void 0&&(a=!1);var o=this.startNode();this.next(),o.expressions=[];var u=this.parseTemplateElement({isTagged:a});for(o.quasis=[u];!u.tail;)this.type===types$1.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(types$1.dollarBraceL),o.expressions.push(this.parseExpression()),this.expect(types$1.braceR),o.quasis.push(u=this.parseTemplateElement({isTagged:a}));return this.next(),this.finishNode(o,"TemplateLiteral")},pp$5.isAsyncProp=function(l){return!l.computed&&l.key.type==="Identifier"&&l.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(l,a){var o=this.startNode(),u=!0,d={};for(o.properties=[],this.next();!this.eat(types$1.braceR);){if(u)u=!1;else if(this.expect(types$1.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(types$1.braceR))break;var f=this.parseProperty(l,a);l||this.checkPropClash(f,d,a),o.properties.push(f)}return this.finishNode(o,l?"ObjectPattern":"ObjectExpression")},pp$5.parseProperty=function(l,a){var o=this.startNode(),u,d,f,p;if(this.options.ecmaVersion>=9&&this.eat(types$1.ellipsis))return l?(o.argument=this.parseIdent(!1),this.type===types$1.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(o,"RestElement")):(o.argument=this.parseMaybeAssign(!1,a),this.type===types$1.comma&&a&&a.trailingComma<0&&(a.trailingComma=this.start),this.finishNode(o,"SpreadElement"));this.options.ecmaVersion>=6&&(o.method=!1,o.shorthand=!1,(l||a)&&(f=this.start,p=this.startLoc),l||(u=this.eat(types$1.star)));var g=this.containsEsc;return this.parsePropertyName(o),!l&&!g&&this.options.ecmaVersion>=8&&!u&&this.isAsyncProp(o)?(d=!0,u=this.options.ecmaVersion>=9&&this.eat(types$1.star),this.parsePropertyName(o)):d=!1,this.parsePropertyValue(o,l,u,d,f,p,a,g),this.finishNode(o,"Property")},pp$5.parseGetterSetter=function(l){l.kind=l.key.name,this.parsePropertyName(l),l.value=this.parseMethod(!1);var a=l.kind==="get"?0:1;if(l.value.params.length!==a){var o=l.value.start;l.kind==="get"?this.raiseRecoverable(o,"getter should have no params"):this.raiseRecoverable(o,"setter should have exactly one param")}else l.kind==="set"&&l.value.params[0].type==="RestElement"&&this.raiseRecoverable(l.value.params[0].start,"Setter cannot use rest params")},pp$5.parsePropertyValue=function(l,a,o,u,d,f,p,g){(o||u)&&this.type===types$1.colon&&this.unexpected(),this.eat(types$1.colon)?(l.value=a?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,p),l.kind="init"):this.options.ecmaVersion>=6&&this.type===types$1.parenL?(a&&this.unexpected(),l.kind="init",l.method=!0,l.value=this.parseMethod(o,u)):!a&&!g&&this.options.ecmaVersion>=5&&!l.computed&&l.key.type==="Identifier"&&(l.key.name==="get"||l.key.name==="set")&&this.type!==types$1.comma&&this.type!==types$1.braceR&&this.type!==types$1.eq?((o||u)&&this.unexpected(),this.parseGetterSetter(l)):this.options.ecmaVersion>=6&&!l.computed&&l.key.type==="Identifier"?((o||u)&&this.unexpected(),this.checkUnreserved(l.key),l.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=d),l.kind="init",a?l.value=this.parseMaybeDefault(d,f,this.copyNode(l.key)):this.type===types$1.eq&&p?(p.shorthandAssign<0&&(p.shorthandAssign=this.start),l.value=this.parseMaybeDefault(d,f,this.copyNode(l.key))):l.value=this.copyNode(l.key),l.shorthand=!0):this.unexpected()},pp$5.parsePropertyName=function(l){if(this.options.ecmaVersion>=6){if(this.eat(types$1.bracketL))return l.computed=!0,l.key=this.parseMaybeAssign(),this.expect(types$1.bracketR),l.key;l.computed=!1}return l.key=this.type===types$1.num||this.type===types$1.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")},pp$5.initFunction=function(l){l.id=null,this.options.ecmaVersion>=6&&(l.generator=l.expression=!1),this.options.ecmaVersion>=8&&(l.async=!1)},pp$5.parseMethod=function(l,a,o){var u=this.startNode(),d=this.yieldPos,f=this.awaitPos,p=this.awaitIdentPos;return this.initFunction(u),this.options.ecmaVersion>=6&&(u.generator=l),this.options.ecmaVersion>=8&&(u.async=!!a),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(functionFlags(a,u.generator)|SCOPE_SUPER|(o?SCOPE_DIRECT_SUPER:0)),this.expect(types$1.parenL),u.params=this.parseBindingList(types$1.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(u,!1,!0,!1),this.yieldPos=d,this.awaitPos=f,this.awaitIdentPos=p,this.finishNode(u,"FunctionExpression")},pp$5.parseArrowExpression=function(l,a,o,u){var d=this.yieldPos,f=this.awaitPos,p=this.awaitIdentPos;return this.enterScope(functionFlags(o,!1)|SCOPE_ARROW),this.initFunction(l),this.options.ecmaVersion>=8&&(l.async=!!o),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,l.params=this.toAssignableList(a,!0),this.parseFunctionBody(l,!0,!1,u),this.yieldPos=d,this.awaitPos=f,this.awaitIdentPos=p,this.finishNode(l,"ArrowFunctionExpression")},pp$5.parseFunctionBody=function(l,a,o,u){var d=a&&this.type!==types$1.braceL,f=this.strict,p=!1;if(d)l.body=this.parseMaybeAssign(u),l.expression=!0,this.checkParams(l,!1);else{var g=this.options.ecmaVersion>=7&&!this.isSimpleParamList(l.params);(!f||g)&&(p=this.strictDirective(this.end),p&&g&&this.raiseRecoverable(l.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var b=this.labels;this.labels=[],p&&(this.strict=!0),this.checkParams(l,!f&&!p&&!a&&!o&&this.isSimpleParamList(l.params)),this.strict&&l.id&&this.checkLValSimple(l.id,BIND_OUTSIDE),l.body=this.parseBlock(!1,void 0,p&&!f),l.expression=!1,this.adaptDirectivePrologue(l.body.body),this.labels=b}this.exitScope()},pp$5.isSimpleParamList=function(l){for(var a=0,o=l;a<o.length;a+=1){var u=o[a];if(u.type!=="Identifier")return!1}return!0},pp$5.checkParams=function(l,a){for(var o=Object.create(null),u=0,d=l.params;u<d.length;u+=1){var f=d[u];this.checkLValInnerPattern(f,BIND_VAR,a?null:o)}},pp$5.parseExprList=function(l,a,o,u){for(var d=[],f=!0;!this.eat(l);){if(f)f=!1;else if(this.expect(types$1.comma),a&&this.afterTrailingComma(l))break;var p=void 0;o&&this.type===types$1.comma?p=null:this.type===types$1.ellipsis?(p=this.parseSpread(u),u&&this.type===types$1.comma&&u.trailingComma<0&&(u.trailingComma=this.start)):p=this.parseMaybeAssign(!1,u),d.push(p)}return d},pp$5.checkUnreserved=function(l){var a=l.start,o=l.end,u=l.name;if(this.inGenerator&&u==="yield"&&this.raiseRecoverable(a,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&u==="await"&&this.raiseRecoverable(a,"Cannot use 'await' as identifier inside an async function"),this.currentThisScope().inClassFieldInit&&u==="arguments"&&this.raiseRecoverable(a,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(u==="arguments"||u==="await")&&this.raise(a,"Cannot use "+u+" in class static initialization block"),this.keywords.test(u)&&this.raise(a,"Unexpected keyword '"+u+"'"),!(this.options.ecmaVersion<6&&this.input.slice(a,o).indexOf("\\")!==-1)){var d=this.strict?this.reservedWordsStrict:this.reservedWords;d.test(u)&&(!this.inAsync&&u==="await"&&this.raiseRecoverable(a,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(a,"The keyword '"+u+"' is reserved"))}},pp$5.parseIdent=function(l){var a=this.parseIdentNode();return this.next(!!l),this.finishNode(a,"Identifier"),l||(this.checkUnreserved(a),a.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=a.start)),a},pp$5.parseIdentNode=function(){var l=this.startNode();return this.type===types$1.name?l.name=this.value:this.type.keyword?(l.name=this.type.keyword,(l.name==="class"||l.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=types$1.name):this.unexpected(),l},pp$5.parsePrivateIdent=function(){var l=this.startNode();return this.type===types$1.privateId?l.name=this.value:this.unexpected(),this.next(),this.finishNode(l,"PrivateIdentifier"),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(l.start,"Private field '#"+l.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(l)),l},pp$5.parseYield=function(l){this.yieldPos||(this.yieldPos=this.start);var a=this.startNode();return this.next(),this.type===types$1.semi||this.canInsertSemicolon()||this.type!==types$1.star&&!this.type.startsExpr?(a.delegate=!1,a.argument=null):(a.delegate=this.eat(types$1.star),a.argument=this.parseMaybeAssign(l)),this.finishNode(a,"YieldExpression")},pp$5.parseAwait=function(l){this.awaitPos||(this.awaitPos=this.start);var a=this.startNode();return this.next(),a.argument=this.parseMaybeUnary(null,!0,!1,l),this.finishNode(a,"AwaitExpression")};var pp$4=Parser$1.prototype;pp$4.raise=function(l,a){var o=getLineInfo(this.input,l);a+=" ("+o.line+":"+o.column+")";var u=new SyntaxError(a);throw u.pos=l,u.loc=o,u.raisedAt=this.pos,u},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(a){this.flags=a,this.var=[],this.lexical=[],this.functions=[],this.inClassFieldInit=!1};pp$3.enterScope=function(l){this.scopeStack.push(new Scope(l))},pp$3.exitScope=function(){this.scopeStack.pop()},pp$3.treatFunctionsAsVarInScope=function(l){return l.flags&SCOPE_FUNCTION||!this.inModule&&l.flags&SCOPE_TOP},pp$3.declareName=function(l,a,o){var u=!1;if(a===BIND_LEXICAL){var d=this.currentScope();u=d.lexical.indexOf(l)>-1||d.functions.indexOf(l)>-1||d.var.indexOf(l)>-1,d.lexical.push(l),this.inModule&&d.flags&SCOPE_TOP&&delete this.undefinedExports[l]}else if(a===BIND_SIMPLE_CATCH){var f=this.currentScope();f.lexical.push(l)}else if(a===BIND_FUNCTION){var p=this.currentScope();this.treatFunctionsAsVar?u=p.lexical.indexOf(l)>-1:u=p.lexical.indexOf(l)>-1||p.var.indexOf(l)>-1,p.functions.push(l)}else for(var g=this.scopeStack.length-1;g>=0;--g){var b=this.scopeStack[g];if(b.lexical.indexOf(l)>-1&&!(b.flags&SCOPE_SIMPLE_CATCH&&b.lexical[0]===l)||!this.treatFunctionsAsVarInScope(b)&&b.functions.indexOf(l)>-1){u=!0;break}if(b.var.push(l),this.inModule&&b.flags&SCOPE_TOP&&delete this.undefinedExports[l],b.flags&SCOPE_VAR)break}u&&this.raiseRecoverable(o,"Identifier '"+l+"' has already been declared")},pp$3.checkLocalExport=function(l){this.scopeStack[0].lexical.indexOf(l.name)===-1&&this.scopeStack[0].var.indexOf(l.name)===-1&&(this.undefinedExports[l.name]=l)},pp$3.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},pp$3.currentVarScope=function(){for(var l=this.scopeStack.length-1;;l--){var a=this.scopeStack[l];if(a.flags&SCOPE_VAR)return a}},pp$3.currentThisScope=function(){for(var l=this.scopeStack.length-1;;l--){var a=this.scopeStack[l];if(a.flags&SCOPE_VAR&&!(a.flags&SCOPE_ARROW))return a}};var Node=function(a,o,u){this.type="",this.start=o,this.end=0,a.options.locations&&(this.loc=new SourceLocation(a,u)),a.options.directSourceFile&&(this.sourceFile=a.options.directSourceFile),a.options.ranges&&(this.range=[o,0])},pp$2=Parser$1.prototype;pp$2.startNode=function(){return new Node(this,this.start,this.startLoc)},pp$2.startNodeAt=function(l,a){return new Node(this,l,a)};function finishNodeAt(l,a,o,u){return l.type=a,l.end=o,this.options.locations&&(l.loc.end=u),this.options.ranges&&(l.range[1]=o),l}pp$2.finishNode=function(l,a){return finishNodeAt.call(this,l,a,this.lastTokEnd,this.lastTokEndLoc)},pp$2.finishNodeAt=function(l,a,o,u){return finishNodeAt.call(this,l,a,o,u)},pp$2.copyNode=function(l){var a=new Node(this,l.start,this.startLoc);for(var o in l)a[o]=l[o];return a};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(l){var a=data[l]={binary:wordsRegexp(unicodeBinaryProperties[l]+" "+unicodeGeneralCategoryValues),binaryOfStrings:wordsRegexp(unicodeBinaryPropertiesOfStrings[l]),nonBinary:{General_Category:wordsRegexp(unicodeGeneralCategoryValues),Script:wordsRegexp(unicodeScriptValues[l])}};a.nonBinary.Script_Extensions=a.nonBinary.Script,a.nonBinary.gc=a.nonBinary.General_Category,a.nonBinary.sc=a.nonBinary.Script,a.nonBinary.scx=a.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(a,o){this.parent=a,this.base=o||this};BranchID.prototype.separatedFrom=function(a){for(var o=this;o;o=o.parent)for(var u=a;u;u=u.parent)if(o.base===u.base&&o!==u)return!0;return!1},BranchID.prototype.sibling=function(){return new BranchID(this.parent,this.base)};var RegExpValidationState=function(a){this.parser=a,this.validFlags="gim"+(a.options.ecmaVersion>=6?"uy":"")+(a.options.ecmaVersion>=9?"s":"")+(a.options.ecmaVersion>=13?"d":"")+(a.options.ecmaVersion>=15?"v":""),this.unicodeProperties=data[a.options.ecmaVersion>=14?14:a.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(a,o,u){var d=u.indexOf("v")!==-1,f=u.indexOf("u")!==-1;this.start=a|0,this.source=o+"",this.flags=u,d&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=f&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=f&&this.parser.options.ecmaVersion>=9)},RegExpValidationState.prototype.raise=function(a){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+a)},RegExpValidationState.prototype.at=function(a,o){o===void 0&&(o=!1);var u=this.source,d=u.length;if(a>=d)return-1;var f=u.charCodeAt(a);if(!(o||this.switchU)||f<=55295||f>=57344||a+1>=d)return f;var p=u.charCodeAt(a+1);return p>=56320&&p<=57343?(f<<10)+p-56613888:f},RegExpValidationState.prototype.nextIndex=function(a,o){o===void 0&&(o=!1);var u=this.source,d=u.length;if(a>=d)return d;var f=u.charCodeAt(a),p;return!(o||this.switchU)||f<=55295||f>=57344||a+1>=d||(p=u.charCodeAt(a+1))<56320||p>57343?a+1:a+2},RegExpValidationState.prototype.current=function(a){return a===void 0&&(a=!1),this.at(this.pos,a)},RegExpValidationState.prototype.lookahead=function(a){return a===void 0&&(a=!1),this.at(this.nextIndex(this.pos,a),a)},RegExpValidationState.prototype.advance=function(a){a===void 0&&(a=!1),this.pos=this.nextIndex(this.pos,a)},RegExpValidationState.prototype.eat=function(a,o){return o===void 0&&(o=!1),this.current(o)===a?(this.advance(o),!0):!1},RegExpValidationState.prototype.eatChars=function(a,o){o===void 0&&(o=!1);for(var u=this.pos,d=0,f=a;d<f.length;d+=1){var p=f[d],g=this.at(u,o);if(g===-1||g!==p)return!1;u=this.nextIndex(u,o)}return this.pos=u,!0},pp$1.validateRegExpFlags=function(l){for(var a=l.validFlags,o=l.flags,u=!1,d=!1,f=0;f<o.length;f++){var p=o.charAt(f);a.indexOf(p)===-1&&this.raise(l.start,"Invalid regular expression flag"),o.indexOf(p,f+1)>-1&&this.raise(l.start,"Duplicate regular expression flag"),p==="u"&&(u=!0),p==="v"&&(d=!0)}this.options.ecmaVersion>=15&&u&&d&&this.raise(l.start,"Invalid regular expression flag")};function hasProp(l){for(var a in l)return!0;return!1}pp$1.validateRegExpPattern=function(l){this.regexp_pattern(l),!l.switchN&&this.options.ecmaVersion>=9&&hasProp(l.groupNames)&&(l.switchN=!0,this.regexp_pattern(l))},pp$1.regexp_pattern=function(l){l.pos=0,l.lastIntValue=0,l.lastStringValue="",l.lastAssertionIsQuantifiable=!1,l.numCapturingParens=0,l.maxBackReference=0,l.groupNames=Object.create(null),l.backReferenceNames.length=0,l.branchID=null,this.regexp_disjunction(l),l.pos!==l.source.length&&(l.eat(41)&&l.raise("Unmatched ')'"),(l.eat(93)||l.eat(125))&&l.raise("Lone quantifier brackets")),l.maxBackReference>l.numCapturingParens&&l.raise("Invalid escape");for(var a=0,o=l.backReferenceNames;a<o.length;a+=1){var u=o[a];l.groupNames[u]||l.raise("Invalid named capture referenced")}},pp$1.regexp_disjunction=function(l){var a=this.options.ecmaVersion>=16;for(a&&(l.branchID=new BranchID(l.branchID,null)),this.regexp_alternative(l);l.eat(124);)a&&(l.branchID=l.branchID.sibling()),this.regexp_alternative(l);a&&(l.branchID=l.branchID.parent),this.regexp_eatQuantifier(l,!0)&&l.raise("Nothing to repeat"),l.eat(123)&&l.raise("Lone quantifier brackets")},pp$1.regexp_alternative=function(l){for(;l.pos<l.source.length&&this.regexp_eatTerm(l););},pp$1.regexp_eatTerm=function(l){return this.regexp_eatAssertion(l)?(l.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(l)&&l.switchU&&l.raise("Invalid quantifier"),!0):(l.switchU?this.regexp_eatAtom(l):this.regexp_eatExtendedAtom(l))?(this.regexp_eatQuantifier(l),!0):!1},pp$1.regexp_eatAssertion=function(l){var a=l.pos;if(l.lastAssertionIsQuantifiable=!1,l.eat(94)||l.eat(36))return!0;if(l.eat(92)){if(l.eat(66)||l.eat(98))return!0;l.pos=a}if(l.eat(40)&&l.eat(63)){var o=!1;if(this.options.ecmaVersion>=9&&(o=l.eat(60)),l.eat(61)||l.eat(33))return this.regexp_disjunction(l),l.eat(41)||l.raise("Unterminated group"),l.lastAssertionIsQuantifiable=!o,!0}return l.pos=a,!1},pp$1.regexp_eatQuantifier=function(l,a){return a===void 0&&(a=!1),this.regexp_eatQuantifierPrefix(l,a)?(l.eat(63),!0):!1},pp$1.regexp_eatQuantifierPrefix=function(l,a){return l.eat(42)||l.eat(43)||l.eat(63)||this.regexp_eatBracedQuantifier(l,a)},pp$1.regexp_eatBracedQuantifier=function(l,a){var o=l.pos;if(l.eat(123)){var u=0,d=-1;if(this.regexp_eatDecimalDigits(l)&&(u=l.lastIntValue,l.eat(44)&&this.regexp_eatDecimalDigits(l)&&(d=l.lastIntValue),l.eat(125)))return d!==-1&&d<u&&!a&&l.raise("numbers out of order in {} quantifier"),!0;l.switchU&&!a&&l.raise("Incomplete quantifier"),l.pos=o}return!1},pp$1.regexp_eatAtom=function(l){return this.regexp_eatPatternCharacters(l)||l.eat(46)||this.regexp_eatReverseSolidusAtomEscape(l)||this.regexp_eatCharacterClass(l)||this.regexp_eatUncapturingGroup(l)||this.regexp_eatCapturingGroup(l)},pp$1.regexp_eatReverseSolidusAtomEscape=function(l){var a=l.pos;if(l.eat(92)){if(this.regexp_eatAtomEscape(l))return!0;l.pos=a}return!1},pp$1.regexp_eatUncapturingGroup=function(l){var a=l.pos;if(l.eat(40)){if(l.eat(63)){if(this.options.ecmaVersion>=16){var o=this.regexp_eatModifiers(l),u=l.eat(45);if(o||u){for(var d=0;d<o.length;d++){var f=o.charAt(d);o.indexOf(f,d+1)>-1&&l.raise("Duplicate regular expression modifiers")}if(u){var p=this.regexp_eatModifiers(l);!o&&!p&&l.current()===58&&l.raise("Invalid regular expression modifiers");for(var g=0;g<p.length;g++){var b=p.charAt(g);(p.indexOf(b,g+1)>-1||o.indexOf(b)>-1)&&l.raise("Duplicate regular expression modifiers")}}}}if(l.eat(58)){if(this.regexp_disjunction(l),l.eat(41))return!0;l.raise("Unterminated group")}}l.pos=a}return!1},pp$1.regexp_eatCapturingGroup=function(l){if(l.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(l):l.current()===63&&l.raise("Invalid group"),this.regexp_disjunction(l),l.eat(41))return l.numCapturingParens+=1,!0;l.raise("Unterminated group")}return!1},pp$1.regexp_eatModifiers=function(l){for(var a="",o=0;(o=l.current())!==-1&&isRegularExpressionModifier(o);)a+=codePointToString(o),l.advance();return a};function isRegularExpressionModifier(l){return l===105||l===109||l===115}pp$1.regexp_eatExtendedAtom=function(l){return l.eat(46)||this.regexp_eatReverseSolidusAtomEscape(l)||this.regexp_eatCharacterClass(l)||this.regexp_eatUncapturingGroup(l)||this.regexp_eatCapturingGroup(l)||this.regexp_eatInvalidBracedQuantifier(l)||this.regexp_eatExtendedPatternCharacter(l)},pp$1.regexp_eatInvalidBracedQuantifier=function(l){return this.regexp_eatBracedQuantifier(l,!0)&&l.raise("Nothing to repeat"),!1},pp$1.regexp_eatSyntaxCharacter=function(l){var a=l.current();return isSyntaxCharacter(a)?(l.lastIntValue=a,l.advance(),!0):!1};function isSyntaxCharacter(l){return l===36||l>=40&&l<=43||l===46||l===63||l>=91&&l<=94||l>=123&&l<=125}pp$1.regexp_eatPatternCharacters=function(l){for(var a=l.pos,o=0;(o=l.current())!==-1&&!isSyntaxCharacter(o);)l.advance();return l.pos!==a},pp$1.regexp_eatExtendedPatternCharacter=function(l){var a=l.current();return a!==-1&&a!==36&&!(a>=40&&a<=43)&&a!==46&&a!==63&&a!==91&&a!==94&&a!==124?(l.advance(),!0):!1},pp$1.regexp_groupSpecifier=function(l){if(l.eat(63)){this.regexp_eatGroupName(l)||l.raise("Invalid group");var a=this.options.ecmaVersion>=16,o=l.groupNames[l.lastStringValue];if(o)if(a)for(var u=0,d=o;u<d.length;u+=1){var f=d[u];f.separatedFrom(l.branchID)||l.raise("Duplicate capture group name")}else l.raise("Duplicate capture group name");a?(o||(l.groupNames[l.lastStringValue]=[])).push(l.branchID):l.groupNames[l.lastStringValue]=!0}},pp$1.regexp_eatGroupName=function(l){if(l.lastStringValue="",l.eat(60)){if(this.regexp_eatRegExpIdentifierName(l)&&l.eat(62))return!0;l.raise("Invalid capture group name")}return!1},pp$1.regexp_eatRegExpIdentifierName=function(l){if(l.lastStringValue="",this.regexp_eatRegExpIdentifierStart(l)){for(l.lastStringValue+=codePointToString(l.lastIntValue);this.regexp_eatRegExpIdentifierPart(l);)l.lastStringValue+=codePointToString(l.lastIntValue);return!0}return!1},pp$1.regexp_eatRegExpIdentifierStart=function(l){var a=l.pos,o=this.options.ecmaVersion>=11,u=l.current(o);return l.advance(o),u===92&&this.regexp_eatRegExpUnicodeEscapeSequence(l,o)&&(u=l.lastIntValue),isRegExpIdentifierStart(u)?(l.lastIntValue=u,!0):(l.pos=a,!1)};function isRegExpIdentifierStart(l){return isIdentifierStart(l,!0)||l===36||l===95}pp$1.regexp_eatRegExpIdentifierPart=function(l){var a=l.pos,o=this.options.ecmaVersion>=11,u=l.current(o);return l.advance(o),u===92&&this.regexp_eatRegExpUnicodeEscapeSequence(l,o)&&(u=l.lastIntValue),isRegExpIdentifierPart(u)?(l.lastIntValue=u,!0):(l.pos=a,!1)};function isRegExpIdentifierPart(l){return isIdentifierChar(l,!0)||l===36||l===95||l===8204||l===8205}pp$1.regexp_eatAtomEscape=function(l){return this.regexp_eatBackReference(l)||this.regexp_eatCharacterClassEscape(l)||this.regexp_eatCharacterEscape(l)||l.switchN&&this.regexp_eatKGroupName(l)?!0:(l.switchU&&(l.current()===99&&l.raise("Invalid unicode escape"),l.raise("Invalid escape")),!1)},pp$1.regexp_eatBackReference=function(l){var a=l.pos;if(this.regexp_eatDecimalEscape(l)){var o=l.lastIntValue;if(l.switchU)return o>l.maxBackReference&&(l.maxBackReference=o),!0;if(o<=l.numCapturingParens)return!0;l.pos=a}return!1},pp$1.regexp_eatKGroupName=function(l){if(l.eat(107)){if(this.regexp_eatGroupName(l))return l.backReferenceNames.push(l.lastStringValue),!0;l.raise("Invalid named reference")}return!1},pp$1.regexp_eatCharacterEscape=function(l){return this.regexp_eatControlEscape(l)||this.regexp_eatCControlLetter(l)||this.regexp_eatZero(l)||this.regexp_eatHexEscapeSequence(l)||this.regexp_eatRegExpUnicodeEscapeSequence(l,!1)||!l.switchU&&this.regexp_eatLegacyOctalEscapeSequence(l)||this.regexp_eatIdentityEscape(l)},pp$1.regexp_eatCControlLetter=function(l){var a=l.pos;if(l.eat(99)){if(this.regexp_eatControlLetter(l))return!0;l.pos=a}return!1},pp$1.regexp_eatZero=function(l){return l.current()===48&&!isDecimalDigit(l.lookahead())?(l.lastIntValue=0,l.advance(),!0):!1},pp$1.regexp_eatControlEscape=function(l){var a=l.current();return a===116?(l.lastIntValue=9,l.advance(),!0):a===110?(l.lastIntValue=10,l.advance(),!0):a===118?(l.lastIntValue=11,l.advance(),!0):a===102?(l.lastIntValue=12,l.advance(),!0):a===114?(l.lastIntValue=13,l.advance(),!0):!1},pp$1.regexp_eatControlLetter=function(l){var a=l.current();return isControlLetter(a)?(l.lastIntValue=a%32,l.advance(),!0):!1};function isControlLetter(l){return l>=65&&l<=90||l>=97&&l<=122}pp$1.regexp_eatRegExpUnicodeEscapeSequence=function(l,a){a===void 0&&(a=!1);var o=l.pos,u=a||l.switchU;if(l.eat(117)){if(this.regexp_eatFixedHexDigits(l,4)){var d=l.lastIntValue;if(u&&d>=55296&&d<=56319){var f=l.pos;if(l.eat(92)&&l.eat(117)&&this.regexp_eatFixedHexDigits(l,4)){var p=l.lastIntValue;if(p>=56320&&p<=57343)return l.lastIntValue=(d-55296)*1024+(p-56320)+65536,!0}l.pos=f,l.lastIntValue=d}return!0}if(u&&l.eat(123)&&this.regexp_eatHexDigits(l)&&l.eat(125)&&isValidUnicode(l.lastIntValue))return!0;u&&l.raise("Invalid unicode escape"),l.pos=o}return!1};function isValidUnicode(l){return l>=0&&l<=1114111}pp$1.regexp_eatIdentityEscape=function(l){if(l.switchU)return this.regexp_eatSyntaxCharacter(l)?!0:l.eat(47)?(l.lastIntValue=47,!0):!1;var a=l.current();return a!==99&&(!l.switchN||a!==107)?(l.lastIntValue=a,l.advance(),!0):!1},pp$1.regexp_eatDecimalEscape=function(l){l.lastIntValue=0;var a=l.current();if(a>=49&&a<=57){do l.lastIntValue=10*l.lastIntValue+(a-48),l.advance();while((a=l.current())>=48&&a<=57);return!0}return!1};var CharSetNone=0,CharSetOk=1,CharSetString=2;pp$1.regexp_eatCharacterClassEscape=function(l){var a=l.current();if(isCharacterClassEscape(a))return l.lastIntValue=-1,l.advance(),CharSetOk;var o=!1;if(l.switchU&&this.options.ecmaVersion>=9&&((o=a===80)||a===112)){l.lastIntValue=-1,l.advance();var u;if(l.eat(123)&&(u=this.regexp_eatUnicodePropertyValueExpression(l))&&l.eat(125))return o&&u===CharSetString&&l.raise("Invalid property name"),u;l.raise("Invalid property name")}return CharSetNone};function isCharacterClassEscape(l){return l===100||l===68||l===115||l===83||l===119||l===87}pp$1.regexp_eatUnicodePropertyValueExpression=function(l){var a=l.pos;if(this.regexp_eatUnicodePropertyName(l)&&l.eat(61)){var o=l.lastStringValue;if(this.regexp_eatUnicodePropertyValue(l)){var u=l.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(l,o,u),CharSetOk}}if(l.pos=a,this.regexp_eatLoneUnicodePropertyNameOrValue(l)){var d=l.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(l,d)}return CharSetNone},pp$1.regexp_validateUnicodePropertyNameAndValue=function(l,a,o){hasOwn(l.unicodeProperties.nonBinary,a)||l.raise("Invalid property name"),l.unicodeProperties.nonBinary[a].test(o)||l.raise("Invalid property value")},pp$1.regexp_validateUnicodePropertyNameOrValue=function(l,a){if(l.unicodeProperties.binary.test(a))return CharSetOk;if(l.switchV&&l.unicodeProperties.binaryOfStrings.test(a))return CharSetString;l.raise("Invalid property name")},pp$1.regexp_eatUnicodePropertyName=function(l){var a=0;for(l.lastStringValue="";isUnicodePropertyNameCharacter(a=l.current());)l.lastStringValue+=codePointToString(a),l.advance();return l.lastStringValue!==""};function isUnicodePropertyNameCharacter(l){return isControlLetter(l)||l===95}pp$1.regexp_eatUnicodePropertyValue=function(l){var a=0;for(l.lastStringValue="";isUnicodePropertyValueCharacter(a=l.current());)l.lastStringValue+=codePointToString(a),l.advance();return l.lastStringValue!==""};function isUnicodePropertyValueCharacter(l){return isUnicodePropertyNameCharacter(l)||isDecimalDigit(l)}pp$1.regexp_eatLoneUnicodePropertyNameOrValue=function(l){return this.regexp_eatUnicodePropertyValue(l)},pp$1.regexp_eatCharacterClass=function(l){if(l.eat(91)){var a=l.eat(94),o=this.regexp_classContents(l);return l.eat(93)||l.raise("Unterminated character class"),a&&o===CharSetString&&l.raise("Negated character class may contain strings"),!0}return!1},pp$1.regexp_classContents=function(l){return l.current()===93?CharSetOk:l.switchV?this.regexp_classSetExpression(l):(this.regexp_nonEmptyClassRanges(l),CharSetOk)},pp$1.regexp_nonEmptyClassRanges=function(l){for(;this.regexp_eatClassAtom(l);){var a=l.lastIntValue;if(l.eat(45)&&this.regexp_eatClassAtom(l)){var o=l.lastIntValue;l.switchU&&(a===-1||o===-1)&&l.raise("Invalid character class"),a!==-1&&o!==-1&&a>o&&l.raise("Range out of order in character class")}}},pp$1.regexp_eatClassAtom=function(l){var a=l.pos;if(l.eat(92)){if(this.regexp_eatClassEscape(l))return!0;if(l.switchU){var o=l.current();(o===99||isOctalDigit(o))&&l.raise("Invalid class escape"),l.raise("Invalid escape")}l.pos=a}var u=l.current();return u!==93?(l.lastIntValue=u,l.advance(),!0):!1},pp$1.regexp_eatClassEscape=function(l){var a=l.pos;if(l.eat(98))return l.lastIntValue=8,!0;if(l.switchU&&l.eat(45))return l.lastIntValue=45,!0;if(!l.switchU&&l.eat(99)){if(this.regexp_eatClassControlLetter(l))return!0;l.pos=a}return this.regexp_eatCharacterClassEscape(l)||this.regexp_eatCharacterEscape(l)},pp$1.regexp_classSetExpression=function(l){var a=CharSetOk,o;if(!this.regexp_eatClassSetRange(l))if(o=this.regexp_eatClassSetOperand(l)){o===CharSetString&&(a=CharSetString);for(var u=l.pos;l.eatChars([38,38]);){if(l.current()!==38&&(o=this.regexp_eatClassSetOperand(l))){o!==CharSetString&&(a=CharSetOk);continue}l.raise("Invalid character in character class")}if(u!==l.pos)return a;for(;l.eatChars([45,45]);)this.regexp_eatClassSetOperand(l)||l.raise("Invalid character in character class");if(u!==l.pos)return a}else l.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(l)){if(o=this.regexp_eatClassSetOperand(l),!o)return a;o===CharSetString&&(a=CharSetString)}},pp$1.regexp_eatClassSetRange=function(l){var a=l.pos;if(this.regexp_eatClassSetCharacter(l)){var o=l.lastIntValue;if(l.eat(45)&&this.regexp_eatClassSetCharacter(l)){var u=l.lastIntValue;return o!==-1&&u!==-1&&o>u&&l.raise("Range out of order in character class"),!0}l.pos=a}return!1},pp$1.regexp_eatClassSetOperand=function(l){return this.regexp_eatClassSetCharacter(l)?CharSetOk:this.regexp_eatClassStringDisjunction(l)||this.regexp_eatNestedClass(l)},pp$1.regexp_eatNestedClass=function(l){var a=l.pos;if(l.eat(91)){var o=l.eat(94),u=this.regexp_classContents(l);if(l.eat(93))return o&&u===CharSetString&&l.raise("Negated character class may contain strings"),u;l.pos=a}if(l.eat(92)){var d=this.regexp_eatCharacterClassEscape(l);if(d)return d;l.pos=a}return null},pp$1.regexp_eatClassStringDisjunction=function(l){var a=l.pos;if(l.eatChars([92,113])){if(l.eat(123)){var o=this.regexp_classStringDisjunctionContents(l);if(l.eat(125))return o}else l.raise("Invalid escape");l.pos=a}return null},pp$1.regexp_classStringDisjunctionContents=function(l){for(var a=this.regexp_classString(l);l.eat(124);)this.regexp_classString(l)===CharSetString&&(a=CharSetString);return a},pp$1.regexp_classString=function(l){for(var a=0;this.regexp_eatClassSetCharacter(l);)a++;return a===1?CharSetOk:CharSetString},pp$1.regexp_eatClassSetCharacter=function(l){var a=l.pos;if(l.eat(92))return this.regexp_eatCharacterEscape(l)||this.regexp_eatClassSetReservedPunctuator(l)?!0:l.eat(98)?(l.lastIntValue=8,!0):(l.pos=a,!1);var o=l.current();return o<0||o===l.lookahead()&&isClassSetReservedDoublePunctuatorCharacter(o)||isClassSetSyntaxCharacter(o)?!1:(l.advance(),l.lastIntValue=o,!0)};function isClassSetReservedDoublePunctuatorCharacter(l){return l===33||l>=35&&l<=38||l>=42&&l<=44||l===46||l>=58&&l<=64||l===94||l===96||l===126}function isClassSetSyntaxCharacter(l){return l===40||l===41||l===45||l===47||l>=91&&l<=93||l>=123&&l<=125}pp$1.regexp_eatClassSetReservedPunctuator=function(l){var a=l.current();return isClassSetReservedPunctuator(a)?(l.lastIntValue=a,l.advance(),!0):!1};function isClassSetReservedPunctuator(l){return l===33||l===35||l===37||l===38||l===44||l===45||l>=58&&l<=62||l===64||l===96||l===126}pp$1.regexp_eatClassControlLetter=function(l){var a=l.current();return isDecimalDigit(a)||a===95?(l.lastIntValue=a%32,l.advance(),!0):!1},pp$1.regexp_eatHexEscapeSequence=function(l){var a=l.pos;if(l.eat(120)){if(this.regexp_eatFixedHexDigits(l,2))return!0;l.switchU&&l.raise("Invalid escape"),l.pos=a}return!1},pp$1.regexp_eatDecimalDigits=function(l){var a=l.pos,o=0;for(l.lastIntValue=0;isDecimalDigit(o=l.current());)l.lastIntValue=10*l.lastIntValue+(o-48),l.advance();return l.pos!==a};function isDecimalDigit(l){return l>=48&&l<=57}pp$1.regexp_eatHexDigits=function(l){var a=l.pos,o=0;for(l.lastIntValue=0;isHexDigit(o=l.current());)l.lastIntValue=16*l.lastIntValue+hexToInt(o),l.advance();return l.pos!==a};function isHexDigit(l){return l>=48&&l<=57||l>=65&&l<=70||l>=97&&l<=102}function hexToInt(l){return l>=65&&l<=70?10+(l-65):l>=97&&l<=102?10+(l-97):l-48}pp$1.regexp_eatLegacyOctalEscapeSequence=function(l){if(this.regexp_eatOctalDigit(l)){var a=l.lastIntValue;if(this.regexp_eatOctalDigit(l)){var o=l.lastIntValue;a<=3&&this.regexp_eatOctalDigit(l)?l.lastIntValue=a*64+o*8+l.lastIntValue:l.lastIntValue=a*8+o}else l.lastIntValue=a;return!0}return!1},pp$1.regexp_eatOctalDigit=function(l){var a=l.current();return isOctalDigit(a)?(l.lastIntValue=a-48,l.advance(),!0):(l.lastIntValue=0,!1)};function isOctalDigit(l){return l>=48&&l<=55}pp$1.regexp_eatFixedHexDigits=function(l,a){var o=l.pos;l.lastIntValue=0;for(var u=0;u<a;++u){var d=l.current();if(!isHexDigit(d))return l.pos=o,!1;l.lastIntValue=16*l.lastIntValue+hexToInt(d),l.advance()}return!0};var Token=function(a){this.type=a.type,this.value=a.value,this.start=a.start,this.end=a.end,a.options.locations&&(this.loc=new SourceLocation(a,a.startLoc,a.endLoc)),a.options.ranges&&(this.range=[a.start,a.end])},pp=Parser$1.prototype;pp.next=function(l){!l&&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 l=this;return{next:function(){var a=l.getToken();return{done:a.type===types$1.eof,value:a}}}}),pp.nextToken=function(){var l=this.curContext();if((!l||!l.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(l.override)return l.override(this);this.readToken(this.fullCharCodeAtPos())},pp.readToken=function(l){return isIdentifierStart(l,this.options.ecmaVersion>=6)||l===92?this.readWord():this.getTokenFromCode(l)},pp.fullCharCodeAtPos=function(){var l=this.input.charCodeAt(this.pos);if(l<=55295||l>=56320)return l;var a=this.input.charCodeAt(this.pos+1);return a<=56319||a>=57344?l:(l<<10)+a-56613888},pp.skipBlockComment=function(){var l=this.options.onComment&&this.curPosition(),a=this.pos,o=this.input.indexOf("*/",this.pos+=2);if(o===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=o+2,this.options.locations)for(var u=void 0,d=a;(u=nextLineBreak(this.input,d,this.pos))>-1;)++this.curLine,d=this.lineStart=u;this.options.onComment&&this.options.onComment(!0,this.input.slice(a+2,o),a,this.pos,l,this.curPosition())},pp.skipLineComment=function(l){for(var a=this.pos,o=this.options.onComment&&this.curPosition(),u=this.input.charCodeAt(this.pos+=l);this.pos<this.input.length&&!isNewLine(u);)u=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(a+l,this.pos),a,this.pos,o,this.curPosition())},pp.skipSpace=function(){e:for(;this.pos<this.input.length;){var l=this.input.charCodeAt(this.pos);switch(l){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(l>8&&l<14||l>=5760&&nonASCIIwhitespace.test(String.fromCharCode(l)))++this.pos;else break e}}},pp.finishToken=function(l,a){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var o=this.type;this.type=l,this.value=a,this.updateContext(o)},pp.readToken_dot=function(){var l=this.input.charCodeAt(this.pos+1);if(l>=48&&l<=57)return this.readNumber(!0);var a=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&l===46&&a===46?(this.pos+=3,this.finishToken(types$1.ellipsis)):(++this.pos,this.finishToken(types$1.dot))},pp.readToken_slash=function(){var l=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):l===61?this.finishOp(types$1.assign,2):this.finishOp(types$1.slash,1)},pp.readToken_mult_modulo_exp=function(l){var a=this.input.charCodeAt(this.pos+1),o=1,u=l===42?types$1.star:types$1.modulo;return this.options.ecmaVersion>=7&&l===42&&a===42&&(++o,u=types$1.starstar,a=this.input.charCodeAt(this.pos+2)),a===61?this.finishOp(types$1.assign,o+1):this.finishOp(u,o)},pp.readToken_pipe_amp=function(l){var a=this.input.charCodeAt(this.pos+1);if(a===l){if(this.options.ecmaVersion>=12){var o=this.input.charCodeAt(this.pos+2);if(o===61)return this.finishOp(types$1.assign,3)}return this.finishOp(l===124?types$1.logicalOR:types$1.logicalAND,2)}return a===61?this.finishOp(types$1.assign,2):this.finishOp(l===124?types$1.bitwiseOR:types$1.bitwiseAND,1)},pp.readToken_caret=function(){var l=this.input.charCodeAt(this.pos+1);return l===61?this.finishOp(types$1.assign,2):this.finishOp(types$1.bitwiseXOR,1)},pp.readToken_plus_min=function(l){var a=this.input.charCodeAt(this.pos+1);return a===l?a===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):a===61?this.finishOp(types$1.assign,2):this.finishOp(types$1.plusMin,1)},pp.readToken_lt_gt=function(l){var a=this.input.charCodeAt(this.pos+1),o=1;return a===l?(o=l===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+o)===61?this.finishOp(types$1.assign,o+1):this.finishOp(types$1.bitShift,o)):a===33&&l===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(a===61&&(o=2),this.finishOp(types$1.relational,o))},pp.readToken_eq_excl=function(l){var a=this.input.charCodeAt(this.pos+1);return a===61?this.finishOp(types$1.equality,this.input.charCodeAt(this.pos+2)===61?3:2):l===61&&a===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(types$1.arrow)):this.finishOp(l===61?types$1.eq:types$1.prefix,1)},pp.readToken_question=function(){var l=this.options.ecmaVersion;if(l>=11){var a=this.input.charCodeAt(this.pos+1);if(a===46){var o=this.input.charCodeAt(this.pos+2);if(o<48||o>57)return this.finishOp(types$1.questionDot,2)}if(a===63){if(l>=12){var u=this.input.charCodeAt(this.pos+2);if(u===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 l=this.options.ecmaVersion,a=35;if(l>=13&&(++this.pos,a=this.fullCharCodeAtPos(),isIdentifierStart(a,!0)||a===92))return this.finishToken(types$1.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+codePointToString(a)+"'")},pp.getTokenFromCode=function(l){switch(l){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 a=this.input.charCodeAt(this.pos+1);if(a===120||a===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(a===111||a===79)return this.readRadixNumber(8);if(a===98||a===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(l);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(l);case 124:case 38:return this.readToken_pipe_amp(l);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(l);case 60:case 62:return this.readToken_lt_gt(l);case 61:case 33:return this.readToken_eq_excl(l);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(l)+"'")},pp.finishOp=function(l,a){var o=this.input.slice(this.pos,this.pos+a);return this.pos+=a,this.finishToken(l,o)},pp.readRegexp=function(){for(var l,a,o=this.pos;;){this.pos>=this.input.length&&this.raise(o,"Unterminated regular expression");var u=this.input.charAt(this.pos);if(lineBreak.test(u)&&this.raise(o,"Unterminated regular expression"),l)l=!1;else{if(u==="[")a=!0;else if(u==="]"&&a)a=!1;else if(u==="/"&&!a)break;l=u==="\\"}++this.pos}var d=this.input.slice(o,this.pos);++this.pos;var f=this.pos,p=this.readWord1();this.containsEsc&&this.unexpected(f);var g=this.regexpState||(this.regexpState=new RegExpValidationState(this));g.reset(o,d,p),this.validateRegExpFlags(g),this.validateRegExpPattern(g);var b=null;try{b=new RegExp(d,p)}catch{}return this.finishToken(types$1.regexp,{pattern:d,flags:p,value:b})},pp.readInt=function(l,a,o){for(var u=this.options.ecmaVersion>=12&&a===void 0,d=o&&this.input.charCodeAt(this.pos)===48,f=this.pos,p=0,g=0,b=0,O=a??1/0;b<O;++b,++this.pos){var S=this.input.charCodeAt(this.pos),A=void 0;if(u&&S===95){d&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),g===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),b===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),g=S;continue}if(S>=97?A=S-97+10:S>=65?A=S-65+10:S>=48&&S<=57?A=S-48:A=1/0,A>=l)break;g=S,p=p*l+A}return u&&g===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===f||a!=null&&this.pos-f!==a?null:p};function stringToNumber(l,a){return a?parseInt(l,8):parseFloat(l.replace(/_/g,""))}function stringToBigInt(l){return typeof BigInt!="function"?null:BigInt(l.replace(/_/g,""))}pp.readRadixNumber=function(l){var a=this.pos;this.pos+=2;var o=this.readInt(l);return o==null&&this.raise(this.start+2,"Expected number in radix "+l),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(o=stringToBigInt(this.input.slice(a,this.pos)),++this.pos):isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(types$1.num,o)},pp.readNumber=function(l){var a=this.pos;!l&&this.readInt(10,void 0,!0)===null&&this.raise(a,"Invalid number");var o=this.pos-a>=2&&this.input.charCodeAt(a)===48;o&&this.strict&&this.raise(a,"Invalid number");var u=this.input.charCodeAt(this.pos);if(!o&&!l&&this.options.ecmaVersion>=11&&u===110){var d=stringToBigInt(this.input.slice(a,this.pos));return++this.pos,isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(types$1.num,d)}o&&/[89]/.test(this.input.slice(a,this.pos))&&(o=!1),u===46&&!o&&(++this.pos,this.readInt(10),u=this.input.charCodeAt(this.pos)),(u===69||u===101)&&!o&&(u=this.input.charCodeAt(++this.pos),(u===43||u===45)&&++this.pos,this.readInt(10)===null&&this.raise(a,"Invalid number")),isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var f=stringToNumber(this.input.slice(a,this.pos),o);return this.finishToken(types$1.num,f)},pp.readCodePoint=function(){var l=this.input.charCodeAt(this.pos),a;if(l===123){this.options.ecmaVersion<6&&this.unexpected();var o=++this.pos;a=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,a>1114111&&this.invalidStringToken(o,"Code point out of bounds")}else a=this.readHexChar(4);return a},pp.readString=function(l){for(var a="",o=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var u=this.input.charCodeAt(this.pos);if(u===l)break;u===92?(a+=this.input.slice(o,this.pos),a+=this.readEscapedChar(!1),o=this.pos):u===8232||u===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(isNewLine(u)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return a+=this.input.slice(o,this.pos++),this.finishToken(types$1.string,a)};var INVALID_TEMPLATE_ESCAPE_ERROR={};pp.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(l){if(l===INVALID_TEMPLATE_ESCAPE_ERROR)this.readInvalidTemplateToken();else throw l}this.inTemplateElement=!1},pp.invalidStringToken=function(l,a){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw INVALID_TEMPLATE_ESCAPE_ERROR;this.raise(l,a)},pp.readTmplToken=function(){for(var l="",a=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var o=this.input.charCodeAt(this.pos);if(o===96||o===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===types$1.template||this.type===types$1.invalidTemplate)?o===36?(this.pos+=2,this.finishToken(types$1.dollarBraceL)):(++this.pos,this.finishToken(types$1.backQuote)):(l+=this.input.slice(a,this.pos),this.finishToken(types$1.template,l));if(o===92)l+=this.input.slice(a,this.pos),l+=this.readEscapedChar(!0),a=this.pos;else if(isNewLine(o)){switch(l+=this.input.slice(a,this.pos),++this.pos,o){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:l+=`
`;break;default:l+=String.fromCharCode(o);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),a=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(l){var a=this.input.charCodeAt(++this.pos);switch(++this.pos,a){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"),l){var o=this.pos-1;this.invalidStringToken(o,"Invalid escape sequence in template string")}default:if(a>=48&&a<=55){var u=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],d=parseInt(u,8);return d>255&&(u=u.slice(0,-1),d=parseInt(u,8)),this.pos+=u.length-1,a=this.input.charCodeAt(this.pos),(u!=="0"||a===56||a===57)&&(this.strict||l)&&this.invalidStringToken(this.pos-1-u.length,l?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(d)}return isNewLine(a)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(a)}},pp.readHexChar=function(l){var a=this.pos,o=this.readInt(16,l);return o===null&&this.invalidStringToken(a,"Bad character escape sequence"),o},pp.readWord1=function(){this.containsEsc=!1;for(var l="",a=!0,o=this.pos,u=this.options.ecmaVersion>=6;this.pos<this.input.length;){var d=this.fullCharCodeAtPos();if(isIdentifierChar(d,u))this.pos+=d<=65535?1:2;else if(d===92){this.containsEsc=!0,l+=this.input.slice(o,this.pos);var f=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var p=this.readCodePoint();(a?isIdentifierStart:isIdentifierChar)(p,u)||this.invalidStringToken(f,"Invalid Unicode escape"),l+=codePointToString(p),o=this.pos}else break;a=!1}return l+this.input.slice(o,this.pos)},pp.readWord=function(){var l=this.readWord1(),a=types$1.name;return this.keywords.test(l)&&(a=keywords$2[l]),this.finishToken(a,l)};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(l,a){return Parser$1.parse(l,a)}var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}function getAugmentedNamespace(l){if(l.__esModule)return l;var a=l.default;if(typeof a=="function"){var o=function u(){return this instanceof u?Reflect.construct(a,arguments,this.constructor):a.apply(this,arguments)};o.prototype=a.prototype}else o={};return Object.defineProperty(o,"__esModule",{value:!0}),Object.keys(l).forEach(function(u){var d=Object.getOwnPropertyDescriptor(l,u);Object.defineProperty(o,u,d.get?d:{enumerable:!0,get:function(){return l[u]}})}),o}var escodegen$1={},estraverse={},hasRequiredEstraverse;function requireEstraverse(){return hasRequiredEstraverse||(hasRequiredEstraverse=1,function(l){(function a(o){var u,d,f,p,g,b;function O(ee){var oe={},me,_e;for(me in ee)ee.hasOwnProperty(me)&&(_e=ee[me],typeof _e=="object"&&_e!==null?oe[me]=O(_e):oe[me]=_e);return oe}function S(ee,oe){var me,_e,ke,Oe;for(_e=ee.length,ke=0;_e;)me=_e>>>1,Oe=ke+me,oe(ee[Oe])?_e=me:(ke=Oe+1,_e-=me+1);return ke}u={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"},f={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"]},p={},g={},b={},d={Break:p,Skip:g,Remove:b};function A(ee,oe){this.parent=ee,this.key=oe}A.prototype.replace=function(oe){this.parent[this.key]=oe},A.prototype.remove=function(){return Array.isArray(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)};function M(ee,oe,me,_e){this.node=ee,this.path=oe,this.wrap=me,this.ref=_e}function E(){}E.prototype.path=function(){var oe,me,_e,ke,Oe,Te;function Ce(Ae,Ge){if(Array.isArray(Ge))for(_e=0,ke=Ge.length;_e<ke;++_e)Ae.push(Ge[_e]);else Ae.push(Ge)}if(!this.__current.path)return null;for(Oe=[],oe=2,me=this.__leavelist.length;oe<me;++oe)Te=this.__leavelist[oe],Ce(Oe,Te.path);return Ce(Oe,this.__current.path),Oe},E.prototype.type=function(){var ee=this.current();return ee.type||this.__current.wrap},E.prototype.parents=function(){var oe,me,_e;for(_e=[],oe=1,me=this.__leavelist.length;oe<me;++oe)_e.push(this.__leavelist[oe].node);return _e},E.prototype.current=function(){return this.__current.node},E.prototype.__execute=function(oe,me){var _e,ke;return ke=void 0,_e=this.__current,this.__current=me,this.__state=null,oe&&(ke=oe.call(this,me.node,this.__leavelist[this.__leavelist.length-1].node)),this.__current=_e,ke},E.prototype.notify=function(oe){this.__state=oe},E.prototype.skip=function(){this.notify(g)},E.prototype.break=function(){this.notify(p)},E.prototype.remove=function(){this.notify(b)},E.prototype.__initialize=function(ee,oe){this.visitor=oe,this.root=ee,this.__worklist=[],this.__leavelist=[],this.__current=null,this.__state=null,this.__fallback=null,oe.fallback==="iteration"?this.__fallback=Object.keys:typeof oe.fallback=="function"&&(this.__fallback=oe.fallback),this.__keys=f,oe.keys&&(this.__keys=Object.assign(Object.create(this.__keys),oe.keys))};function R(ee){return ee==null?!1:typeof ee=="object"&&typeof ee.type=="string"}function L(ee,oe){return(ee===u.ObjectExpression||ee===u.ObjectPattern)&&oe==="properties"}function U(ee,oe){for(var me=ee.length-1;me>=0;--me)if(ee[me].node===oe)return!0;return!1}E.prototype.traverse=function(oe,me){var _e,ke,Oe,Te,Ce,Ae,Ge,Ne,Qe,Ee,je,Ye;for(this.__initialize(oe,me),Ye={},_e=this.__worklist,ke=this.__leavelist,_e.push(new M(oe,null,null,null)),ke.push(new M(null,null,null,null));_e.length;){if(Oe=_e.pop(),Oe===Ye){if(Oe=ke.pop(),Ae=this.__execute(me.leave,Oe),this.__state===p||Ae===p)return;continue}if(Oe.node){if(Ae=this.__execute(me.enter,Oe),this.__state===p||Ae===p)return;if(_e.push(Ye),ke.push(Oe),this.__state===g||Ae===g)continue;if(Te=Oe.node,Ce=Te.type||Oe.wrap,Ee=this.__keys[Ce],!Ee)if(this.__fallback)Ee=this.__fallback(Te);else throw new Error("Unknown node type "+Ce+".");for(Ne=Ee.length;(Ne-=1)>=0;)if(Ge=Ee[Ne],je=Te[Ge],!!je){if(Array.isArray(je)){for(Qe=je.length;(Qe-=1)>=0;)if(je[Qe]&&!U(ke,je[Qe])){if(L(Ce,Ee[Ne]))Oe=new M(je[Qe],[Ge,Qe],"Property",null);else if(R(je[Qe]))Oe=new M(je[Qe],[Ge,Qe],null,null);else continue;_e.push(Oe)}}else if(R(je)){if(U(ke,je))continue;_e.push(new M(je,Ge,null,null))}}}}},E.prototype.replace=function(oe,me){var _e,ke,Oe,Te,Ce,Ae,Ge,Ne,Qe,Ee,je,Ye,Ke;function Ve($e){var ze,it,mt,Je;if($e.ref.remove()){for(it=$e.ref.key,Je=$e.ref.parent,ze=_e.length;ze--;)if(mt=_e[ze],mt.ref&&mt.ref.parent===Je){if(mt.ref.key<it)break;--mt.ref.key}}}for(this.__initialize(oe,me),je={},_e=this.__worklist,ke=this.__leavelist,Ye={root:oe},Ae=new M(oe,null,null,new A(Ye,"root")),_e.push(Ae),ke.push(Ae);_e.length;){if(Ae=_e.pop(),Ae===je){if(Ae=ke.pop(),Ce=this.__execute(me.leave,Ae),Ce!==void 0&&Ce!==p&&Ce!==g&&Ce!==b&&Ae.ref.replace(Ce),(this.__state===b||Ce===b)&&Ve(Ae),this.__state===p||Ce===p)return Ye.root;continue}if(Ce=this.__execute(me.enter,Ae),Ce!==void 0&&Ce!==p&&Ce!==g&&Ce!==b&&(Ae.ref.replace(Ce),Ae.node=Ce),(this.__state===b||Ce===b)&&(Ve(Ae),Ae.node=null),this.__state===p||Ce===p)return Ye.root;if(Oe=Ae.node,!!Oe&&(_e.push(je),ke.push(Ae),!(this.__state===g||Ce===g))){if(Te=Oe.type||Ae.wrap,Qe=this.__keys[Te],!Qe)if(this.__fallback)Qe=this.__fallback(Oe);else throw new Error("Unknown node type "+Te+".");for(Ge=Qe.length;(Ge-=1)>=0;)if(Ke=Qe[Ge],Ee=Oe[Ke],!!Ee)if(Array.isArray(Ee)){for(Ne=Ee.length;(Ne-=1)>=0;)if(Ee[Ne]){if(L(Te,Qe[Ge]))Ae=new M(Ee[Ne],[Ke,Ne],"Property",new A(Ee,Ne));else if(R(Ee[Ne]))Ae=new M(Ee[Ne],[Ke,Ne],null,new A(Ee,Ne));else continue;_e.push(Ae)}}else R(Ee)&&_e.push(new M(Ee,Ke,null,new A(Oe,Ke)))}}return Ye.root};function Z(ee,oe){var me=new E;return me.traverse(ee,oe)}function re(ee,oe){var me=new E;return me.replace(ee,oe)}function he(ee,oe){var me;return me=S(oe,function(ke){return ke.range[0]>ee.range[0]}),ee.extendedRange=[ee.range[0],ee.range[1]],me!==oe.length&&(ee.extendedRange[1]=oe[me].range[0]),me-=1,me>=0&&(ee.extendedRange[0]=oe[me].range[1]),ee}function se(ee,oe,me){var _e=[],ke,Oe,Te,Ce;if(!ee.range)throw new Error("attachComments needs range information");if(!me.length){if(oe.length){for(Te=0,Oe=oe.length;Te<Oe;Te+=1)ke=O(oe[Te]),ke.extendedRange=[0,ee.range[0]],_e.push(ke);ee.leadingComments=_e}return ee}for(Te=0,Oe=oe.length;Te<Oe;Te+=1)_e.push(he(O(oe[Te]),me));return Ce=0,Z(ee,{enter:function(Ae){for(var Ge;Ce<_e.length&&(Ge=_e[Ce],!(Ge.extendedRange[1]>Ae.range[0]));)Ge.extendedRange[1]===Ae.range[0]?(Ae.leadingComments||(Ae.leadingComments=[]),Ae.leadingComments.push(Ge),_e.splice(Ce,1)):Ce+=1;if(Ce===_e.length)return d.Break;if(_e[Ce].extendedRange[0]>Ae.range[1])return d.Skip}}),Ce=0,Z(ee,{leave:function(Ae){for(var Ge;Ce<_e.length&&(Ge=_e[Ce],!(Ae.range[1]<Ge.extendedRange[0]));)Ae.range[1]===Ge.extendedRange[0]?(Ae.trailingComments||(Ae.trailingComments=[]),Ae.trailingComments.push(Ge),_e.splice(Ce,1)):Ce+=1;if(Ce===_e.length)return d.Break;if(_e[Ce].extendedRange[0]>Ae.range[1])return d.Skip}}),ee}return o.Syntax=u,o.traverse=Z,o.replace=re,o.attachComments=se,o.VisitorKeys=f,o.VisitorOption=d,o.Controller=E,o.cloneEnvironment=function(){return a({})},o})(l)}(estraverse)),estraverse}var utils={},ast={exports:{}},hasRequiredAst;function requireAst(){return hasRequiredAst||(hasRequiredAst=1,function(){function l(p){if(p==null)return!1;switch(p.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 a(p){if(p==null)return!1;switch(p.type){case"DoWhileStatement":case"ForInStatement":case"ForStatement":case"WhileStatement":return!0}return!1}function o(p){if(p==null)return!1;switch(p.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 u(p){return o(p)||p!=null&&p.type==="FunctionDeclaration"}function d(p){switch(p.type){case"IfStatement":return p.alternate!=null?p.alternate:p.consequent;case"LabeledStatement":case"ForStatement":case"ForInStatement":case"WhileStatement":case"WithStatement":return p.body}return null}function f(p){var g;if(p.type!=="IfStatement"||p.alternate==null)return!1;g=p.consequent;do{if(g.type==="IfStatement"&&g.alternate==null)return!0;g=d(g)}while(g);return!1}ast.exports={isExpression:l,isStatement:o,isIterationStatement:a,isSourceElement:u,isProblematicIfStatement:f,trailingStatement:d}}()),ast.exports}var code$1={exports:{}},hasRequiredCode;function requireCode(){return hasRequiredCode||(hasRequiredCode=1,function(){var l,a,o,u,d,f;a={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-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\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-\u0AB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81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\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\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]/},l={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-\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\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\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\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-\u0A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4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\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-\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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-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\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\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\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\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\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]|\uDB40[\uDD00-\uDDEF]/};function p(U){return 48<=U&&U<=57}function g(U){return 48<=U&&U<=57||97<=U&&U<=102||65<=U&&U<=70}function b(U){return U>=48&&U<=55}o=[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function O(U){return U===32||U===9||U===11||U===12||U===160||U>=5760&&o.indexOf(U)>=0}function S(U){return U===10||U===13||U===8232||U===8233}function A(U){if(U<=65535)return String.fromCharCode(U);var Z=String.fromCharCode(Math.floor((U-65536)/1024)+55296),re=String.fromCharCode((U-65536)%1024+56320);return Z+re}for(u=new Array(128),f=0;f<128;++f)u[f]=f>=97&&f<=122||f>=65&&f<=90||f===36||f===95;for(d=new Array(128),f=0;f<128;++f)d[f]=f>=97&&f<=122||f>=65&&f<=90||f>=48&&f<=57||f===36||f===95;function M(U){return U<128?u[U]:a.NonAsciiIdentifierStart.test(A(U))}function E(U){return U<128?d[U]:a.NonAsciiIdentifierPart.test(A(U))}function R(U){return U<128?u[U]:l.NonAsciiIdentifierStart.test(A(U))}function L(U){return U<128?d[U]:l.NonAsciiIdentifierPart.test(A(U))}code$1.exports={isDecimalDigit:p,isHexDigit:g,isOctalDigit:b,isWhiteSpace:O,isLineTerminator:S,isIdentifierStartES5:M,isIdentifierPartES5:E,isIdentifierStartES6:R,isIdentifierPartES6:L}}()),code$1.exports}var keyword$1={exports:{}},hasRequiredKeyword;function requireKeyword(){return hasRequiredKeyword||(hasRequiredKeyword=1,function(){var l=requireCode();function a(M){switch(M){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"let":return!0;default:return!1}}function o(M,E){return!E&&M==="yield"?!1:u(M,E)}function u(M,E){if(E&&a(M))return!0;switch(M.length){case 2:return M==="if"||M==="in"||M==="do";case 3:return M==="var"||M==="for"||M==="new"||M==="try";case 4:return M==="this"||M==="else"||M==="case"||M==="void"||M==="with"||M==="enum";case 5:return M==="while"||M==="break"||M==="catch"||M==="throw"||M==="const"||M==="yield"||M==="class"||M==="super";case 6:return M==="return"||M==="typeof"||M==="delete"||M==="switch"||M==="export"||M==="import";case 7:return M==="default"||M==="finally"||M==="extends";case 8:return M==="function"||M==="continue"||M==="debugger";case 10:return M==="instanceof";default:return!1}}function d(M,E){return M==="null"||M==="true"||M==="false"||o(M,E)}function f(M,E){return M==="null"||M==="true"||M==="false"||u(M,E)}function p(M){return M==="eval"||M==="arguments"}function g(M){var E,R,L;if(M.length===0||(L=M.charCodeAt(0),!l.isIdentifierStartES5(L)))return!1;for(E=1,R=M.length;E<R;++E)if(L=M.charCodeAt(E),!l.isIdentifierPartES5(L))return!1;return!0}function b(M,E){return(M-55296)*1024+(E-56320)+65536}function O(M){var E,R,L,U,Z;if(M.length===0)return!1;for(Z=l.isIdentifierStartES6,E=0,R=M.length;E<R;++E){if(L=M.charCodeAt(E),55296<=L&&L<=56319){if(++E,E>=R||(U=M.charCodeAt(E),!(56320<=U&&U<=57343)))return!1;L=b(L,U)}if(!Z(L))return!1;Z=l.isIdentifierPartES6}return!0}function S(M,E){return g(M)&&!d(M,E)}function A(M,E){return O(M)&&!f(M,E)}keyword$1.exports={isKeywordES5:o,isKeywordES6:u,isReservedWordES5:d,isReservedWordES6:f,isRestrictedWord:p,isIdentifierNameES5:g,isIdentifierNameES6:O,isIdentifierES5:S,isIdentifierES6:A}}()),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 l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");return base64.encode=function(a){if(0<=a&&a<l.length)return l[a];throw new TypeError("Must be between 0 and 63: "+a)},base64.decode=function(a){var o=65,u=90,d=97,f=122,p=48,g=57,b=43,O=47,S=26,A=52;return o<=a&&a<=u?a-o:d<=a&&a<=f?a-d+S:p<=a&&a<=g?a-p+A:a==b?62:a==O?63:-1},base64}var hasRequiredBase64Vlq;function requireBase64Vlq(){if(hasRequiredBase64Vlq)return base64Vlq;hasRequiredBase64Vlq=1;var l=requireBase64(),a=5,o=1<<a,u=o-1,d=o;function f(g){return g<0?(-g<<1)+1:(g<<1)+0}function p(g){var b=(g&1)===1,O=g>>1;return b?-O:O}return base64Vlq.encode=function(b){var O="",S,A=f(b);do S=A&u,A>>>=a,A>0&&(S|=d),O+=l.encode(S);while(A>0);return O},base64Vlq.decode=function(b,O,S){var A=b.length,M=0,E=0,R,L;do{if(O>=A)throw new Error("Expected more digits in base 64 VLQ value.");if(L=l.decode(b.charCodeAt(O++)),L===-1)throw new Error("Invalid base64 digit: "+b.charAt(O-1));R=!!(L&d),L&=u,M=M+(L<<E),E+=a}while(R);S.value=p(M),S.rest=O},base64Vlq}var util={},hasRequiredUtil;function requireUtil(){return hasRequiredUtil||(hasRequiredUtil=1,function(l){function a(se,ee,oe){if(ee in se)return se[ee];if(arguments.length===3)return oe;throw new Error('"'+ee+'" is a required argument.')}l.getArg=a;var o=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,u=/^data:.+\,.+$/;function d(se){var ee=se.match(o);return ee?{scheme:ee[1],auth:ee[2],host:ee[3],port:ee[4],path:ee[5]}:null}l.urlParse=d;function f(se){var ee="";return se.scheme&&(ee+=se.scheme+":"),ee+="//",se.auth&&(ee+=se.auth+"@"),se.host&&(ee+=se.host),se.port&&(ee+=":"+se.port),se.path&&(ee+=se.path),ee}l.urlGenerate=f;function p(se){var ee=se,oe=d(se);if(oe){if(!oe.path)return se;ee=oe.path}for(var me=l.isAbsolute(ee),_e=ee.split(/\/+/),ke,Oe=0,Te=_e.length-1;Te>=0;Te--)ke=_e[Te],ke==="."?_e.splice(Te,1):ke===".."?Oe++:Oe>0&&(ke===""?(_e.splice(Te+1,Oe),Oe=0):(_e.splice(Te,2),Oe--));return ee=_e.join("/"),ee===""&&(ee=me?"/":"."),oe?(oe.path=ee,f(oe)):ee}l.normalize=p;function g(se,ee){se===""&&(se="."),ee===""&&(ee=".");var oe=d(ee),me=d(se);if(me&&(se=me.path||"/"),oe&&!oe.scheme)return me&&(oe.scheme=me.scheme),f(oe);if(oe||ee.match(u))return ee;if(me&&!me.host&&!me.path)return me.host=ee,f(me);var _e=ee.charAt(0)==="/"?ee:p(se.replace(/\/+$/,"")+"/"+ee);return me?(me.path=_e,f(me)):_e}l.join=g,l.isAbsolute=function(se){return se.charAt(0)==="/"||o.test(se)};function b(se,ee){se===""&&(se="."),se=se.replace(/\/$/,"");for(var oe=0;ee.indexOf(se+"/")!==0;){var me=se.lastIndexOf("/");if(me<0||(se=se.slice(0,me),se.match(/^([^\/]+:\/)?\/*$/)))return ee;++oe}return Array(oe+1).join("../")+ee.substr(se.length+1)}l.relative=b;var O=function(){var se=Object.create(null);return!("__proto__"in se)}();function S(se){return se}function A(se){return E(se)?"$"+se:se}l.toSetString=O?S:A;function M(se){return E(se)?se.slice(1):se}l.fromSetString=O?S:M;function E(se){if(!se)return!1;var ee=se.length;if(ee<9||se.charCodeAt(ee-1)!==95||se.charCodeAt(ee-2)!==95||se.charCodeAt(ee-3)!==111||se.charCodeAt(ee-4)!==116||se.charCodeAt(ee-5)!==111||se.charCodeAt(ee-6)!==114||se.charCodeAt(ee-7)!==112||se.charCodeAt(ee-8)!==95||se.charCodeAt(ee-9)!==95)return!1;for(var oe=ee-10;oe>=0;oe--)if(se.charCodeAt(oe)!==36)return!1;return!0}function R(se,ee,oe){var me=U(se.source,ee.source);return me!==0||(me=se.originalLine-ee.originalLine,me!==0)||(me=se.originalColumn-ee.originalColumn,me!==0||oe)||(me=se.generatedColumn-ee.generatedColumn,me!==0)||(me=se.generatedLine-ee.generatedLine,me!==0)?me:U(se.name,ee.name)}l.compareByOriginalPositions=R;function L(se,ee,oe){var me=se.generatedLine-ee.generatedLine;return me!==0||(me=se.generatedColumn-ee.generatedColumn,me!==0||oe)||(me=U(se.source,ee.source),me!==0)||(me=se.originalLine-ee.originalLine,me!==0)||(me=se.originalColumn-ee.originalColumn,me!==0)?me:U(se.name,ee.name)}l.compareByGeneratedPositionsDeflated=L;function U(se,ee){return se===ee?0:se===null?1:ee===null?-1:se>ee?1:-1}function Z(se,ee){var oe=se.generatedLine-ee.generatedLine;return oe!==0||(oe=se.generatedColumn-ee.generatedColumn,oe!==0)||(oe=U(se.source,ee.source),oe!==0)||(oe=se.originalLine-ee.originalLine,oe!==0)||(oe=se.originalColumn-ee.originalColumn,oe!==0)?oe:U(se.name,ee.name)}l.compareByGeneratedPositionsInflated=Z;function re(se){return JSON.parse(se.replace(/^\)]}'[^\n]*\n/,""))}l.parseSourceMapInput=re;function he(se,ee,oe){if(ee=ee||"",se&&(se[se.length-1]!=="/"&&ee[0]!=="/"&&(se+="/"),ee=se+ee),oe){var me=d(oe);if(!me)throw new Error("sourceMapURL could not be parsed");if(me.path){var _e=me.path.lastIndexOf("/");_e>=0&&(me.path=me.path.substring(0,_e+1))}ee=g(f(me),ee)}return p(ee)}l.computeSourceURL=he}(util)),util}var arraySet={},hasRequiredArraySet;function requireArraySet(){if(hasRequiredArraySet)return arraySet;hasRequiredArraySet=1;var l=requireUtil(),a=Object.prototype.hasOwnProperty,o=typeof Map<"u";function u(){this._array=[],this._set=o?new Map:Object.create(null)}return u.fromArray=function(f,p){for(var g=new u,b=0,O=f.length;b<O;b++)g.add(f[b],p);return g},u.prototype.size=function(){return o?this._set.size:Object.getOwnPropertyNames(this._set).length},u.prototype.add=function(f,p){var g=o?f:l.toSetString(f),b=o?this.has(f):a.call(this._set,g),O=this._array.length;(!b||p)&&this._array.push(f),b||(o?this._set.set(f,O):this._set[g]=O)},u.prototype.has=function(f){if(o)return this._set.has(f);var p=l.toSetString(f);return a.call(this._set,p)},u.prototype.indexOf=function(f){if(o){var p=this._set.get(f);if(p>=0)return p}else{var g=l.toSetString(f);if(a.call(this._set,g))return this._set[g]}throw new Error('"'+f+'" is not in the set.')},u.prototype.at=function(f){if(f>=0&&f<this._array.length)return this._array[f];throw new Error("No element indexed by "+f)},u.prototype.toArray=function(){return this._array.slice()},arraySet.ArraySet=u,arraySet}var mappingList={},hasRequiredMappingList;function requireMappingList(){if(hasRequiredMappingList)return mappingList;hasRequiredMappingList=1;var l=requireUtil();function a(u,d){var f=u.generatedLine,p=d.generatedLine,g=u.generatedColumn,b=d.generatedColumn;return p>f||p==f&&b>=g||l.compareByGeneratedPositionsInflated(u,d)<=0}function o(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}return o.prototype.unsortedForEach=function(d,f){this._array.forEach(d,f)},o.prototype.add=function(d){a(this._last,d)?(this._last=d,this._array.push(d)):(this._sorted=!1,this._array.push(d))},o.prototype.toArray=function(){return this._sorted||(this._array.sort(l.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},mappingList.MappingList=o,mappingList}var hasRequiredSourceMapGenerator;function requireSourceMapGenerator(){if(hasRequiredSourceMapGenerator)return sourceMapGenerator;hasRequiredSourceMapGenerator=1;var l=requireBase64Vlq(),a=requireUtil(),o=requireArraySet().ArraySet,u=requireMappingList().MappingList;function d(f){f||(f={}),this._file=a.getArg(f,"file",null),this._sourceRoot=a.getArg(f,"sourceRoot",null),this._skipValidation=a.getArg(f,"skipValidation",!1),this._sources=new o,this._names=new o,this._mappings=new u,this._sourcesContents=null}return d.prototype._version=3,d.fromSourceMap=function(p){var g=p.sourceRoot,b=new d({file:p.file,sourceRoot:g});return p.eachMapping(function(O){var S={generated:{line:O.generatedLine,column:O.generatedColumn}};O.source!=null&&(S.source=O.source,g!=null&&(S.source=a.relative(g,S.source)),S.original={line:O.originalLine,column:O.originalColumn},O.name!=null&&(S.name=O.name)),b.addMapping(S)}),p.sources.forEach(function(O){var S=O;g!==null&&(S=a.relative(g,O)),b._sources.has(S)||b._sources.add(S);var A=p.sourceContentFor(O);A!=null&&b.setSourceContent(O,A)}),b},d.prototype.addMapping=function(p){var g=a.getArg(p,"generated"),b=a.getArg(p,"original",null),O=a.getArg(p,"source",null),S=a.getArg(p,"name",null);this._skipValidation||this._validateMapping(g,b,O,S),O!=null&&(O=String(O),this._sources.has(O)||this._sources.add(O)),S!=null&&(S=String(S),this._names.has(S)||this._names.add(S)),this._mappings.add({generatedLine:g.line,generatedColumn:g.column,originalLine:b!=null&&b.line,originalColumn:b!=null&&b.column,source:O,name:S})},d.prototype.setSourceContent=function(p,g){var b=p;this._sourceRoot!=null&&(b=a.relative(this._sourceRoot,b)),g!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[a.toSetString(b)]=g):this._sourcesContents&&(delete this._sourcesContents[a.toSetString(b)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},d.prototype.applySourceMap=function(p,g,b){var O=g;if(g==null){if(p.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);O=p.file}var S=this._sourceRoot;S!=null&&(O=a.relative(S,O));var A=new o,M=new o;this._mappings.unsortedForEach(function(E){if(E.source===O&&E.originalLine!=null){var R=p.originalPositionFor({line:E.originalLine,column:E.originalColumn});R.source!=null&&(E.source=R.source,b!=null&&(E.source=a.join(b,E.source)),S!=null&&(E.source=a.relative(S,E.source)),E.originalLine=R.line,E.originalColumn=R.column,R.name!=null&&(E.name=R.name))}var L=E.source;L!=null&&!A.has(L)&&A.add(L);var U=E.name;U!=null&&!M.has(U)&&M.add(U)},this),this._sources=A,this._names=M,p.sources.forEach(function(E){var R=p.sourceContentFor(E);R!=null&&(b!=null&&(E=a.join(b,E)),S!=null&&(E=a.relative(S,E)),this.setSourceContent(E,R))},this)},d.prototype._validateMapping=function(p,g,b,O){if(g&&typeof g.line!="number"&&typeof g.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(!(p&&"line"in p&&"column"in p&&p.line>0&&p.column>=0&&!g&&!b&&!O)){if(p&&"line"in p&&"column"in p&&g&&"line"in g&&"column"in g&&p.line>0&&p.column>=0&&g.line>0&&g.column>=0&&b)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:p,source:b,original:g,name:O}))}},d.prototype._serializeMappings=function(){for(var p=0,g=1,b=0,O=0,S=0,A=0,M="",E,R,L,U,Z=this._mappings.toArray(),re=0,he=Z.length;re<he;re++){if(R=Z[re],E="",R.generatedLine!==g)for(p=0;R.generatedLine!==g;)E+=";",g++;else if(re>0){if(!a.compareByGeneratedPositionsInflated(R,Z[re-1]))continue;E+=","}E+=l.encode(R.generatedColumn-p),p=R.generatedColumn,R.source!=null&&(U=this._sources.indexOf(R.source),E+=l.encode(U-A),A=U,E+=l.encode(R.originalLine-1-O),O=R.originalLine-1,E+=l.encode(R.originalColumn-b),b=R.originalColumn,R.name!=null&&(L=this._names.indexOf(R.name),E+=l.encode(L-S),S=L)),M+=E}return M},d.prototype._generateSourcesContent=function(p,g){return p.map(function(b){if(!this._sourcesContents)return null;g!=null&&(b=a.relative(g,b));var O=a.toSetString(b);return Object.prototype.hasOwnProperty.call(this._sourcesContents,O)?this._sourcesContents[O]:null},this)},d.prototype.toJSON=function(){var p={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(p.file=this._file),this._sourceRoot!=null&&(p.sourceRoot=this._sourceRoot),this._sourcesContents&&(p.sourcesContent=this._generateSourcesContent(p.sources,p.sourceRoot)),p},d.prototype.toString=function(){return JSON.stringify(this.toJSON())},sourceMapGenerator.SourceMapGenerator=d,sourceMapGenerator}var sourceMapConsumer={},binarySearch={},hasRequiredBinarySearch;function requireBinarySearch(){return hasRequiredBinarySearch||(hasRequiredBinarySearch=1,function(l){l.GREATEST_LOWER_BOUND=1,l.LEAST_UPPER_BOUND=2;function a(o,u,d,f,p,g){var b=Math.floor((u-o)/2)+o,O=p(d,f[b],!0);return O===0?b:O>0?u-b>1?a(b,u,d,f,p,g):g==l.LEAST_UPPER_BOUND?u<f.length?u:-1:b:b-o>1?a(o,b,d,f,p,g):g==l.LEAST_UPPER_BOUND?b:o<0?-1:o}l.search=function(u,d,f,p){if(d.length===0)return-1;var g=a(-1,d.length,u,d,f,p||l.GREATEST_LOWER_BOUND);if(g<0)return-1;for(;g-1>=0&&f(d[g],d[g-1],!0)===0;)--g;return g}}(binarySearch)),binarySearch}var quickSort={},hasRequiredQuickSort;function requireQuickSort(){if(hasRequiredQuickSort)return quickSort;hasRequiredQuickSort=1;function l(u,d,f){var p=u[d];u[d]=u[f],u[f]=p}function a(u,d){return Math.round(u+Math.random()*(d-u))}function o(u,d,f,p){if(f<p){var g=a(f,p),b=f-1;l(u,g,p);for(var O=u[p],S=f;S<p;S++)d(u[S],O)<=0&&(b+=1,l(u,b,S));l(u,b+1,S);var A=b+1;o(u,d,f,A-1),o(u,d,A+1,p)}}return quickSort.quickSort=function(u,d){o(u,d,0,u.length-1)},quickSort}var hasRequiredSourceMapConsumer;function requireSourceMapConsumer(){if(hasRequiredSourceMapConsumer)return sourceMapConsumer;hasRequiredSourceMapConsumer=1;var l=requireUtil(),a=requireBinarySearch(),o=requireArraySet().ArraySet,u=requireBase64Vlq(),d=requireQuickSort().quickSort;function f(O,S){var A=O;return typeof O=="string"&&(A=l.parseSourceMapInput(O)),A.sections!=null?new b(A,S):new p(A,S)}f.fromSourceMap=function(O,S){return p.fromSourceMap(O,S)},f.prototype._version=3,f.prototype.__generatedMappings=null,Object.defineProperty(f.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),f.prototype.__originalMappings=null,Object.defineProperty(f.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),f.prototype._charIsMappingSeparator=function(S,A){var M=S.charAt(A);return M===";"||M===","},f.prototype._parseMappings=function(S,A){throw new Error("Subclasses must implement _parseMappings")},f.GENERATED_ORDER=1,f.ORIGINAL_ORDER=2,f.GREATEST_LOWER_BOUND=1,f.LEAST_UPPER_BOUND=2,f.prototype.eachMapping=function(S,A,M){var E=A||null,R=M||f.GENERATED_ORDER,L;switch(R){case f.GENERATED_ORDER:L=this._generatedMappings;break;case f.ORIGINAL_ORDER:L=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var U=this.sourceRoot;L.map(function(Z){var re=Z.source===null?null:this._sources.at(Z.source);return re=l.computeSourceURL(U,re,this._sourceMapURL),{source:re,generatedLine:Z.generatedLine,generatedColumn:Z.generatedColumn,originalLine:Z.originalLine,originalColumn:Z.originalColumn,name:Z.name===null?null:this._names.at(Z.name)}},this).forEach(S,E)},f.prototype.allGeneratedPositionsFor=function(S){var A=l.getArg(S,"line"),M={source:l.getArg(S,"source"),originalLine:A,originalColumn:l.getArg(S,"column",0)};if(M.source=this._findSourceIndex(M.source),M.source<0)return[];var E=[],R=this._findMapping(M,this._originalMappings,"originalLine","originalColumn",l.compareByOriginalPositions,a.LEAST_UPPER_BOUND);if(R>=0){var L=this._originalMappings[R];if(S.column===void 0)for(var U=L.originalLine;L&&L.originalLine===U;)E.push({line:l.getArg(L,"generatedLine",null),column:l.getArg(L,"generatedColumn",null),lastColumn:l.getArg(L,"lastGeneratedColumn",null)}),L=this._originalMappings[++R];else for(var Z=L.originalColumn;L&&L.originalLine===A&&L.originalColumn==Z;)E.push({line:l.getArg(L,"generatedLine",null),column:l.getArg(L,"generatedColumn",null),lastColumn:l.getArg(L,"lastGeneratedColumn",null)}),L=this._originalMappings[++R]}return E},sourceMapConsumer.SourceMapConsumer=f;function p(O,S){var A=O;typeof O=="string"&&(A=l.parseSourceMapInput(O));var M=l.getArg(A,"version"),E=l.getArg(A,"sources"),R=l.getArg(A,"names",[]),L=l.getArg(A,"sourceRoot",null),U=l.getArg(A,"sourcesContent",null),Z=l.getArg(A,"mappings"),re=l.getArg(A,"file",null);if(M!=this._version)throw new Error("Unsupported version: "+M);L&&(L=l.normalize(L)),E=E.map(String).map(l.normalize).map(function(he){return L&&l.isAbsolute(L)&&l.isAbsolute(he)?l.relative(L,he):he}),this._names=o.fromArray(R.map(String),!0),this._sources=o.fromArray(E,!0),this._absoluteSources=this._sources.toArray().map(function(he){return l.computeSourceURL(L,he,S)}),this.sourceRoot=L,this.sourcesContent=U,this._mappings=Z,this._sourceMapURL=S,this.file=re}p.prototype=Object.create(f.prototype),p.prototype.consumer=f,p.prototype._findSourceIndex=function(O){var S=O;if(this.sourceRoot!=null&&(S=l.relative(this.sourceRoot,S)),this._sources.has(S))return this._sources.indexOf(S);var A;for(A=0;A<this._absoluteSources.length;++A)if(this._absoluteSources[A]==O)return A;return-1},p.fromSourceMap=function(S,A){var M=Object.create(p.prototype),E=M._names=o.fromArray(S._names.toArray(),!0),R=M._sources=o.fromArray(S._sources.toArray(),!0);M.sourceRoot=S._sourceRoot,M.sourcesContent=S._generateSourcesContent(M._sources.toArray(),M.sourceRoot),M.file=S._file,M._sourceMapURL=A,M._absoluteSources=M._sources.toArray().map(function(oe){return l.computeSourceURL(M.sourceRoot,oe,A)});for(var L=S._mappings.toArray().slice(),U=M.__generatedMappings=[],Z=M.__originalMappings=[],re=0,he=L.length;re<he;re++){var se=L[re],ee=new g;ee.generatedLine=se.generatedLine,ee.generatedColumn=se.generatedColumn,se.source&&(ee.source=R.indexOf(se.source),ee.originalLine=se.originalLine,ee.originalColumn=se.originalColumn,se.name&&(ee.name=E.indexOf(se.name)),Z.push(ee)),U.push(ee)}return d(M.__originalMappings,l.compareByOriginalPositions),M},p.prototype._version=3,Object.defineProperty(p.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function g(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}p.prototype._parseMappings=function(S,A){for(var M=1,E=0,R=0,L=0,U=0,Z=0,re=S.length,he=0,se={},ee={},oe=[],me=[],_e,ke,Oe,Te,Ce;he<re;)if(S.charAt(he)===";")M++,he++,E=0;else if(S.charAt(he)===",")he++;else{for(_e=new g,_e.generatedLine=M,Te=he;Te<re&&!this._charIsMappingSeparator(S,Te);Te++);if(ke=S.slice(he,Te),Oe=se[ke],Oe)he+=ke.length;else{for(Oe=[];he<Te;)u.decode(S,he,ee),Ce=ee.value,he=ee.rest,Oe.push(Ce);if(Oe.length===2)throw new Error("Found a source, but no line and column");if(Oe.length===3)throw new Error("Found a source and line, but no column");se[ke]=Oe}_e.generatedColumn=E+Oe[0],E=_e.generatedColumn,Oe.length>1&&(_e.source=U+Oe[1],U+=Oe[1],_e.originalLine=R+Oe[2],R=_e.originalLine,_e.originalLine+=1,_e.originalColumn=L+Oe[3],L=_e.originalColumn,Oe.length>4&&(_e.name=Z+Oe[4],Z+=Oe[4])),me.push(_e),typeof _e.originalLine=="number"&&oe.push(_e)}d(me,l.compareByGeneratedPositionsDeflated),this.__generatedMappings=me,d(oe,l.compareByOriginalPositions),this.__originalMappings=oe},p.prototype._findMapping=function(S,A,M,E,R,L){if(S[M]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+S[M]);if(S[E]<0)throw new TypeError("Column must be greater than or equal to 0, got "+S[E]);return a.search(S,A,R,L)},p.prototype.computeColumnSpans=function(){for(var S=0;S<this._generatedMappings.length;++S){var A=this._generatedMappings[S];if(S+1<this._generatedMappings.length){var M=this._generatedMappings[S+1];if(A.generatedLine===M.generatedLine){A.lastGeneratedColumn=M.generatedColumn-1;continue}}A.lastGeneratedColumn=1/0}},p.prototype.originalPositionFor=function(S){var A={generatedLine:l.getArg(S,"line"),generatedColumn:l.getArg(S,"column")},M=this._findMapping(A,this._generatedMappings,"generatedLine","generatedColumn",l.compareByGeneratedPositionsDeflated,l.getArg(S,"bias",f.GREATEST_LOWER_BOUND));if(M>=0){var E=this._generatedMappings[M];if(E.generatedLine===A.generatedLine){var R=l.getArg(E,"source",null);R!==null&&(R=this._sources.at(R),R=l.computeSourceURL(this.sourceRoot,R,this._sourceMapURL));var L=l.getArg(E,"name",null);return L!==null&&(L=this._names.at(L)),{source:R,line:l.getArg(E,"originalLine",null),column:l.getArg(E,"originalColumn",null),name:L}}}return{source:null,line:null,column:null,name:null}},p.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(S){return S==null}):!1},p.prototype.sourceContentFor=function(S,A){if(!this.sourcesContent)return null;var M=this._findSourceIndex(S);if(M>=0)return this.sourcesContent[M];var E=S;this.sourceRoot!=null&&(E=l.relative(this.sourceRoot,E));var R;if(this.sourceRoot!=null&&(R=l.urlParse(this.sourceRoot))){var L=E.replace(/^file:\/\//,"");if(R.scheme=="file"&&this._sources.has(L))return this.sourcesContent[this._sources.indexOf(L)];if((!R.path||R.path=="/")&&this._sources.has("/"+E))return this.sourcesContent[this._sources.indexOf("/"+E)]}if(A)return null;throw new Error('"'+E+'" is not in the SourceMap.')},p.prototype.generatedPositionFor=function(S){var A=l.getArg(S,"source");if(A=this._findSourceIndex(A),A<0)return{line:null,column:null,lastColumn:null};var M={source:A,originalLine:l.getArg(S,"line"),originalColumn:l.getArg(S,"column")},E=this._findMapping(M,this._originalMappings,"originalLine","originalColumn",l.compareByOriginalPositions,l.getArg(S,"bias",f.GREATEST_LOWER_BOUND));if(E>=0){var R=this._originalMappings[E];if(R.source===M.source)return{line:l.getArg(R,"generatedLine",null),column:l.getArg(R,"generatedColumn",null),lastColumn:l.getArg(R,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},sourceMapConsumer.BasicSourceMapConsumer=p;function b(O,S){var A=O;typeof O=="string"&&(A=l.parseSourceMapInput(O));var M=l.getArg(A,"version"),E=l.getArg(A,"sections");if(M!=this._version)throw new Error("Unsupported version: "+M);this._sources=new o,this._names=new o;var R={line:-1,column:0};this._sections=E.map(function(L){if(L.url)throw new Error("Support for url field in sections not implemented.");var U=l.getArg(L,"offset"),Z=l.getArg(U,"line"),re=l.getArg(U,"column");if(Z<R.line||Z===R.line&&re<R.column)throw new Error("Section offsets must be ordered and non-overlapping.");return R=U,{generatedOffset:{generatedLine:Z+1,generatedColumn:re+1},consumer:new f(l.getArg(L,"map"),S)}})}return b.prototype=Object.create(f.prototype),b.prototype.constructor=f,b.prototype._version=3,Object.defineProperty(b.prototype,"sources",{get:function(){for(var O=[],S=0;S<this._sections.length;S++)for(var A=0;A<this._sections[S].consumer.sources.length;A++)O.push(this._sections[S].consumer.sources[A]);return O}}),b.prototype.originalPositionFor=function(S){var A={generatedLine:l.getArg(S,"line"),generatedColumn:l.getArg(S,"column")},M=a.search(A,this._sections,function(R,L){var U=R.generatedLine-L.generatedOffset.generatedLine;return U||R.generatedColumn-L.generatedOffset.generatedColumn}),E=this._sections[M];return E?E.consumer.originalPositionFor({line:A.generatedLine-(E.generatedOffset.generatedLine-1),column:A.generatedColumn-(E.generatedOffset.generatedLine===A.generatedLine?E.generatedOffset.generatedColumn-1:0),bias:S.bias}):{source:null,line:null,column:null,name:null}},b.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(S){return S.consumer.hasContentsOfAllSources()})},b.prototype.sourceContentFor=function(S,A){for(var M=0;M<this._sections.length;M++){var E=this._sections[M],R=E.consumer.sourceContentFor(S,!0);if(R)return R}if(A)return null;throw new Error('"'+S+'" is not in the SourceMap.')},b.prototype.generatedPositionFor=function(S){for(var A=0;A<this._sections.length;A++){var M=this._sections[A];if(M.consumer._findSourceIndex(l.getArg(S,"source"))!==-1){var E=M.consumer.generatedPositionFor(S);if(E){var R={line:E.line+(M.generatedOffset.generatedLine-1),column:E.column+(M.generatedOffset.generatedLine===E.line?M.generatedOffset.generatedColumn-1:0)};return R}}}return{line:null,column:null}},b.prototype._parseMappings=function(S,A){this.__generatedMappings=[],this.__originalMappings=[];for(var M=0;M<this._sections.length;M++)for(var E=this._sections[M],R=E.consumer._generatedMappings,L=0;L<R.length;L++){var U=R[L],Z=E.consumer._sources.at(U.source);Z=l.computeSourceURL(E.consumer.sourceRoot,Z,this._sourceMapURL),this._sources.add(Z),Z=this._sources.indexOf(Z);var re=null;U.name&&(re=E.consumer._names.at(U.name),this._names.add(re),re=this._names.indexOf(re));var he={source:Z,generatedLine:U.generatedLine+(E.generatedOffset.generatedLine-1),generatedColumn:U.generatedColumn+(E.generatedOffset.generatedLine===U.generatedLine?E.generatedOffset.generatedColumn-1:0),originalLine:U.originalLine,originalColumn:U.originalColumn,name:re};this.__generatedMappings.push(he),typeof he.originalLine=="number"&&this.__originalMappings.push(he)}d(this.__generatedMappings,l.compareByGeneratedPositionsDeflated),d(this.__originalMappings,l.compareByOriginalPositions)},sourceMapConsumer.IndexedSourceMapConsumer=b,sourceMapConsumer}var sourceNode={},hasRequiredSourceNode;function requireSourceNode(){if(hasRequiredSourceNode)return sourceNode;hasRequiredSourceNode=1;var l=requireSourceMapGenerator().SourceMapGenerator,a=requireUtil(),o=/(\r?\n)/,u=10,d="$$$isSourceNode$$$";function f(p,g,b,O,S){this.children=[],this.sourceContents={},this.line=p??null,this.column=g??null,this.source=b??null,this.name=S??null,this[d]=!0,O!=null&&this.add(O)}return f.fromStringWithSourceMap=function(g,b,O){var S=new f,A=g.split(o),M=0,E=function(){var re=se(),he=se()||"";return re+he;function se(){return M<A.length?A[M++]:void 0}},R=1,L=0,U=null;return b.eachMapping(function(re){if(U!==null)if(R<re.generatedLine)Z(U,E()),R++,L=0;else{var he=A[M]||"",se=he.substr(0,re.generatedColumn-L);A[M]=he.substr(re.generatedColumn-L),L=re.generatedColumn,Z(U,se),U=re;return}for(;R<re.generatedLine;)S.add(E()),R++;if(L<re.generatedColumn){var he=A[M]||"";S.add(he.substr(0,re.generatedColumn)),A[M]=he.substr(re.generatedColumn),L=re.generatedColumn}U=re},this),M<A.length&&(U&&Z(U,E()),S.add(A.splice(M).join(""))),b.sources.forEach(function(re){var he=b.sourceContentFor(re);he!=null&&(O!=null&&(re=a.join(O,re)),S.setSourceContent(re,he))}),S;function Z(re,he){if(re===null||re.source===void 0)S.add(he);else{var se=O?a.join(O,re.source):re.source;S.add(new f(re.originalLine,re.originalColumn,se,he,re.name))}}},f.prototype.add=function(g){if(Array.isArray(g))g.forEach(function(b){this.add(b)},this);else if(g[d]||typeof g=="string")g&&this.children.push(g);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+g);return this},f.prototype.prepend=function(g){if(Array.isArray(g))for(var b=g.length-1;b>=0;b--)this.prepend(g[b]);else if(g[d]||typeof g=="string")this.children.unshift(g);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+g);return this},f.prototype.walk=function(g){for(var b,O=0,S=this.children.length;O<S;O++)b=this.children[O],b[d]?b.walk(g):b!==""&&g(b,{source:this.source,line:this.line,column:this.column,name:this.name})},f.prototype.join=function(g){var b,O,S=this.children.length;if(S>0){for(b=[],O=0;O<S-1;O++)b.push(this.children[O]),b.push(g);b.push(this.children[O]),this.children=b}return this},f.prototype.replaceRight=function(g,b){var O=this.children[this.children.length-1];return O[d]?O.replaceRight(g,b):typeof O=="string"?this.children[this.children.length-1]=O.replace(g,b):this.children.push("".replace(g,b)),this},f.prototype.setSourceContent=function(g,b){this.sourceContents[a.toSetString(g)]=b},f.prototype.walkSourceContents=function(g){for(var b=0,O=this.children.length;b<O;b++)this.children[b][d]&&this.children[b].walkSourceContents(g);for(var S=Object.keys(this.sourceContents),b=0,O=S.length;b<O;b++)g(a.fromSetString(S[b]),this.sourceContents[S[b]])},f.prototype.toString=function(){var g="";return this.walk(function(b){g+=b}),g},f.prototype.toStringWithSourceMap=function(g){var b={code:"",line:1,column:0},O=new l(g),S=!1,A=null,M=null,E=null,R=null;return this.walk(function(L,U){b.code+=L,U.source!==null&&U.line!==null&&U.column!==null?((A!==U.source||M!==U.line||E!==U.column||R!==U.name)&&O.addMapping({source:U.source,original:{line:U.line,column:U.column},generated:{line:b.line,column:b.column},name:U.name}),A=U.source,M=U.line,E=U.column,R=U.name,S=!0):S&&(O.addMapping({generated:{line:b.line,column:b.column}}),A=null,S=!1);for(var Z=0,re=L.length;Z<re;Z++)L.charCodeAt(Z)===u?(b.line++,b.column=0,Z+1===re?(A=null,S=!1):S&&O.addMapping({source:U.source,original:{line:U.line,column:U.column},generated:{line:b.line,column:b.column},name:U.name})):b.column++}),this.walkSourceContents(function(L,U){O.setSourceContent(L,U)}),{code:b.code,map:O}},sourceNode.SourceNode=f,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:"[email protected]",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(l){(function(){var a,o,u,d,f,p,g,b,O,S,A,M,E,R,L,U,Z,re,he,se,ee,oe,me,_e,ke,Oe;f=requireEstraverse(),p=requireUtils(),a=f.Syntax;function Te(N){return pt.Expression.hasOwnProperty(N.type)}function Ce(N){return pt.Statement.hasOwnProperty(N.type)}o={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},u={"??":o.Coalesce,"||":o.LogicalOR,"&&":o.LogicalAND,"|":o.BitwiseOR,"^":o.BitwiseXOR,"&":o.BitwiseAND,"==":o.Equality,"!=":o.Equality,"===":o.Equality,"!==":o.Equality,is:o.Equality,isnt:o.Equality,"<":o.Relational,">":o.Relational,"<=":o.Relational,">=":o.Relational,in:o.Relational,instanceof:o.Relational,"<<":o.BitwiseSHIFT,">>":o.BitwiseSHIFT,">>>":o.BitwiseSHIFT,"+":o.Additive,"-":o.Additive,"*":o.Multiplicative,"%":o.Multiplicative,"/":o.Multiplicative,"**":o.Exponentiation};var Ae=1,Ge=2,Ne=4,Qe=8,Ee=16,je=32,Ye=64,Ke=Ge|Ne,Ve=Ae|Ge,$e=Ae|Ge|Ne,ze=Ae,it=Ne,mt=Ae|Ne,Je=Ae,xt=Ae|je,ot=0,kt=Ae|Ee,zt=Ae|Qe;function Wt(){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 vt(N,K){var q="";for(K|=0;K>0;K>>>=1,N+=N)K&1&&(q+=N);return q}function Pt(N){return/[\r\n]/g.test(N)}function At(N){var K=N.length;return K&&p.code.isLineTerminator(N.charCodeAt(K-1))}function Ft(N,K){var q;for(q in K)K.hasOwnProperty(q)&&(N[q]=K[q]);return N}function Xt(N,K){var q,z;function fe(we){return typeof we=="object"&&we instanceof Object&&!(we instanceof RegExp)}for(q in K)K.hasOwnProperty(q)&&(z=K[q],fe(z)?fe(N[q])?Xt(N[q],z):N[q]=Xt({},z):N[q]=z);return N}function Yt(N){var K,q,z,fe,we;if(N!==N)throw new Error("Numeric literal whose value is NaN");if(N<0||N===0&&1/N<0)throw new Error("Numeric literal whose value is negative");if(N===1/0)return O?"null":S?"1e400":"1e+400";if(K=""+N,!S||K.length<3)return K;for(q=K.indexOf("."),!O&&K.charCodeAt(0)===48&&q===1&&(q=0,K=K.slice(1)),z=K,K=K.replace("e+","e"),fe=0,(we=z.indexOf("e"))>0&&(fe=+z.slice(we+1),z=z.slice(0,we)),q>=0&&(fe-=z.length-q-1,z=+(z.slice(0,q)+z.slice(q+1))+""),we=0;z.charCodeAt(z.length+we-1)===48;)--we;return we!==0&&(fe-=we,z=z.slice(0,we)),fe!==0&&(z+="e"+fe),(z.length<K.length||A&&N>1e12&&Math.floor(N)===N&&(z="0x"+N.toString(16)).length<K.length)&&+z===N&&(K=z),K}function Jt(N,K){return(N&-2)===8232?(K?"u":"\\u")+(N===8232?"2028":"2029"):N===10||N===13?(K?"":"\\")+(N===10?"n":"r"):String.fromCharCode(N)}function qt(N){var K,q,z,fe,we,De,Be,Le;if(q=N.toString(),N.source){if(K=q.match(/\/([^/]*)$/),!K)return q;for(z=K[1],q="",Be=!1,Le=!1,fe=0,we=N.source.length;fe<we;++fe)De=N.source.charCodeAt(fe),Le?(q+=Jt(De,Le),Le=!1):(Be?De===93&&(Be=!1):De===47?q+="\\":De===91&&(Be=!0),q+=Jt(De,Le),Le=De===92);return"/"+q+"/"+z}return q}function $t(N,K){var q;return N===8?"\\b":N===12?"\\f":N===9?"\\t":(q=N.toString(16).toUpperCase(),O||N>255?"\\u"+"0000".slice(q.length)+q:N===0&&!p.code.isDecimalDigit(K)?"\\0":N===11?"\\x0B":"\\x"+"00".slice(q.length)+q)}function an(N){if(N===92)return"\\\\";if(N===10)return"\\n";if(N===13)return"\\r";if(N===8232)return"\\u2028";if(N===8233)return"\\u2029";throw new Error("Incorrectly classified character")}function tn(N){var K,q,z,fe;for(fe=M==="double"?'"':"'",K=0,q=N.length;K<q;++K)if(z=N.charCodeAt(K),z===39){fe='"';break}else if(z===34){fe="'";break}else z===92&&++K;return fe+N+fe}function Lt(N){var K="",q,z,fe,we=0,De=0,Be,Le;for(q=0,z=N.length;q<z;++q){if(fe=N.charCodeAt(q),fe===39)++we;else if(fe===34)++De;else if(fe===47&&O)K+="\\";else if(p.code.isLineTerminator(fe)||fe===92){K+=an(fe);continue}else if(!p.code.isIdentifierPartES5(fe)&&(O&&fe<32||!O&&!E&&(fe<32||fe>126))){K+=$t(fe,N.charCodeAt(q+1));continue}K+=String.fromCharCode(fe)}if(Be=!(M==="double"||M==="auto"&&De<we),Le=Be?"'":'"',!(Be?we:De))return Le+K+Le;for(N=K,K=Le,q=0,z=N.length;q<z;++q)fe=N.charCodeAt(q),(fe===39&&Be||fe===34&&!Be)&&(K+="\\"),K+=String.fromCharCode(fe);return K+Le}function ln(N){var K,q,z,fe="";for(K=0,q=N.length;K<q;++K)z=N[K],fe+=Array.isArray(z)?ln(z):z;return fe}function rt(N,K){if(!oe)return Array.isArray(N)?ln(N):N;if(K==null){if(N instanceof d)return N;K={}}return K.loc==null?new d(null,null,oe,N,K.name||null):new d(K.loc.start.line,K.loc.start.column,oe===!0?K.loc.source||null:oe,N,K.name||null)}function Ot(){return L||" "}function Ie(N,K){var q,z,fe,we;return q=rt(N).toString(),q.length===0?[K]:(z=rt(K).toString(),z.length===0?[N]:(fe=q.charCodeAt(q.length-1),we=z.charCodeAt(0),(fe===43||fe===45)&&fe===we||p.code.isIdentifierPartES5(fe)&&p.code.isIdentifierPartES5(we)||fe===47&&we===105?[N,Ot(),K]:p.code.isWhiteSpace(fe)||p.code.isLineTerminator(fe)||p.code.isWhiteSpace(we)||p.code.isLineTerminator(we)?[N,K]:[N,L,K]))}function wt(N){return[g,N]}function nt(N){var K;K=g,g+=b,N(g),g=K}function gn(N){var K;for(K=N.length-1;K>=0&&!p.code.isLineTerminator(N.charCodeAt(K));--K);return N.length-1-K}function _n(N,K){var q,z,fe,we,De,Be,Le,st;for(q=N.split(/\r\n|[\r\n]/),Be=Number.MAX_VALUE,z=1,fe=q.length;z<fe;++z){for(we=q[z],De=0;De<we.length&&p.code.isWhiteSpace(we.charCodeAt(De));)++De;Be>De&&(Be=De)}for(typeof K<"u"?(Le=g,q[1][Be]==="*"&&(K+=" "),g=K):(Be&1&&--Be,Le=g),z=1,fe=q.length;z<fe;++z)st=rt(wt(q[z].slice(Be))),q[z]=oe?st.join(""):st;return g=Le,q.join(`
`)}function Ht(N,K){if(N.type==="Line"){if(At(N.value))return"//"+N.value;var q="//"+N.value;return _e||(q+=`
`),q}return se.format.indent.adjustMultilineComment&&/[\n\r]/.test(N.value)?_n("/*"+N.value+"*/",K):"/*"+N.value+"*/"}function cn(N,K){var q,z,fe,we,De,Be,Le,st,St,Xe,Dt,It,jt,Ut;if(N.leadingComments&&N.leadingComments.length>0){if(we=K,_e){for(fe=N.leadingComments[0],K=[],st=fe.extendedRange,St=fe.range,Dt=me.substring(st[0],St[0]),Ut=(Dt.match(/\n/g)||[]).length,Ut>0?(K.push(vt(`
`,Ut)),K.push(wt(Ht(fe)))):(K.push(Dt),K.push(Ht(fe))),Xe=St,q=1,z=N.leadingComments.length;q<z;q++)fe=N.leadingComments[q],St=fe.range,It=me.substring(Xe[1],St[0]),Ut=(It.match(/\n/g)||[]).length,K.push(vt(`
`,Ut)),K.push(wt(Ht(fe))),Xe=St;jt=me.substring(St[1],st[1]),Ut=(jt.match(/\n/g)||[]).length,K.push(vt(`
`,Ut))}else for(fe=N.leadingComments[0],K=[],re&&N.type===a.Program&&N.body.length===0&&K.push(`
`),K.push(Ht(fe)),At(rt(K).toString())||K.push(`
`),q=1,z=N.leadingComments.length;q<z;++q)fe=N.leadingComments[q],Le=[Ht(fe)],At(rt(Le).toString())||Le.push(`
`),K.push(wt(Le));K.push(wt(we))}if(N.trailingComments)if(_e)fe=N.trailingComments[0],st=fe.extendedRange,St=fe.range,Dt=me.substring(st[0],St[0]),Ut=(Dt.match(/\n/g)||[]).length,Ut>0?(K.push(vt(`
`,Ut)),K.push(wt(Ht(fe)))):(K.push(Dt),K.push(Ht(fe)));else for(De=!At(rt(K).toString()),Be=vt(" ",gn(rt([g,K,b]).toString())),q=0,z=N.trailingComments.length;q<z;++q)fe=N.trailingComments[q],De?(q===0?K=[K,b]:K=[K,Be],K.push(Ht(fe,Be))):K=[K,wt(Ht(fe))],q!==z-1&&!At(rt(K).toString())&&(K=[K,`
`]);return K}function ct(N,K,q){var z,fe=0;for(z=N;z<K;z++)me[z]===`
`&&fe++;for(z=1;z<fe;z++)q.push(R)}function ut(N,K,q){return K<q?["(",N,")"]:N}function bt(N){var K,q,z;for(z=N.split(/\r\n|\n/),K=1,q=z.length;K<q;K++)z[K]=R+g+z[K];return z}function Nt(N,K){var q,z,fe;return q=N[se.verbatim],typeof q=="string"?z=ut(bt(q),o.Sequence,K):(z=bt(q.content),fe=q.precedence!=null?q.precedence:o.Sequence,z=ut(z,fe,K)),rt(z,N)}function pt(){}pt.prototype.maybeBlock=function(N,K){var q,z,fe=this;return z=!se.comment||!N.leadingComments,N.type===a.BlockStatement&&z?[L,this.generateStatement(N,K)]:N.type===a.EmptyStatement&&z?";":(nt(function(){q=[R,wt(fe.generateStatement(N,K))]}),q)},pt.prototype.maybeBlockSuffix=function(N,K){var q=At(rt(K).toString());return N.type===a.BlockStatement&&(!se.comment||!N.leadingComments)&&!q?[K,L]:q?[K,g]:[K,R,g]};function Rt(N){return rt(N.name,N)}function Ct(N,K){return N.async?"async"+(K?Ot():L):""}function nn(N){var K=N.generator&&!se.moz.starlessGenerator;return K?"*"+L:""}function bn(N){var K=N.value,q="";return K.async&&(q+=Ct(K,!N.computed)),K.generator&&(q+=nn(K)?"*":""),q}pt.prototype.generatePattern=function(N,K,q){return N.type===a.Identifier?Rt(N):this.generateExpression(N,K,q)},pt.prototype.generateFunctionParams=function(N){var K,q,z,fe;if(fe=!1,N.type===a.ArrowFunctionExpression&&!N.rest&&(!N.defaults||N.defaults.length===0)&&N.params.length===1&&N.params[0].type===a.Identifier)z=[Ct(N,!0),Rt(N.params[0])];else{for(z=N.type===a.ArrowFunctionExpression?[Ct(N,!1)]:[],z.push("("),N.defaults&&(fe=!0),K=0,q=N.params.length;K<q;++K)fe&&N.defaults[K]?z.push(this.generateAssignment(N.params[K],N.defaults[K],"=",o.Assignment,$e)):z.push(this.generatePattern(N.params[K],o.Assignment,$e)),K+1<q&&z.push(","+L);N.rest&&(N.params.length&&z.push(","+L),z.push("..."),z.push(Rt(N.rest))),z.push(")")}return z},pt.prototype.generateFunctionBody=function(N){var K,q;return K=this.generateFunctionParams(N),N.type===a.ArrowFunctionExpression&&(K.push(L),K.push("=>")),N.expression?(K.push(L),q=this.generateExpression(N.body,o.Assignment,$e),q.toString().charAt(0)==="{"&&(q=["(",q,")"]),K.push(q)):K.push(this.maybeBlock(N.body,zt)),K},pt.prototype.generateIterationForStatement=function(N,K,q){var z=["for"+(K.await?Ot()+"await":"")+L+"("],fe=this;return nt(function(){K.left.type===a.VariableDeclaration?nt(function(){z.push(K.left.kind+Ot()),z.push(fe.generateStatement(K.left.declarations[0],ot))}):z.push(fe.generateExpression(K.left,o.Call,$e)),z=Ie(z,N),z=[Ie(z,fe.generateExpression(K.right,o.Assignment,$e)),")"]}),z.push(this.maybeBlock(K.body,q)),z},pt.prototype.generatePropertyKey=function(N,K){var q=[];return K&&q.push("["),q.push(this.generateExpression(N,o.Assignment,$e)),K&&q.push("]"),q},pt.prototype.generateAssignment=function(N,K,q,z,fe){return o.Assignment<z&&(fe|=Ae),ut([this.generateExpression(N,o.Call,fe),L+q+L,this.generateExpression(K,o.Assignment,fe)],o.Assignment,z)},pt.prototype.semicolon=function(N){return!Z&&N&je?"":";"},pt.Statement={BlockStatement:function(N,K){var q,z,fe=["{",R],we=this;return nt(function(){N.body.length===0&&_e&&(q=N.range,q[1]-q[0]>2&&(z=me.substring(q[0]+1,q[1]-1),z[0]===`
`&&(fe=["{"]),fe.push(z)));var De,Be,Le,st;for(st=Je,K&Qe&&(st|=Ee),De=0,Be=N.body.length;De<Be;++De)_e&&(De===0&&(N.body[0].leadingComments&&(q=N.body[0].leadingComments[0].extendedRange,z=me.substring(q[0],q[1]),z[0]===`
`&&(fe=["{"])),N.body[0].leadingComments||ct(N.range[0],N.body[0].range[0],fe)),De>0&&!N.body[De-1].trailingComments&&!N.body[De].leadingComments&&ct(N.body[De-1].range[1],N.body[De].range[0],fe)),De===Be-1&&(st|=je),N.body[De].leadingComments&&_e?Le=we.generateStatement(N.body[De],st):Le=wt(we.generateStatement(N.body[De],st)),fe.push(Le),At(rt(Le).toString())||_e&&De<Be-1&&N.body[De+1].leadingComments||fe.push(R),_e&&De===Be-1&&(N.body[De].trailingComments||ct(N.body[De].range[1],N.range[1],fe))}),fe.push(wt("}")),fe},BreakStatement:function(N,K){return N.label?"break "+N.label.name+this.semicolon(K):"break"+this.semicolon(K)},ContinueStatement:function(N,K){return N.label?"continue "+N.label.name+this.semicolon(K):"continue"+this.semicolon(K)},ClassBody:function(N,K){var q=["{",R],z=this;return nt(function(fe){var we,De;for(we=0,De=N.body.length;we<De;++we)q.push(fe),q.push(z.generateExpression(N.body[we],o.Sequence,$e)),we+1<De&&q.push(R)}),At(rt(q).toString())||q.push(R),q.push(g),q.push("}"),q},ClassDeclaration:function(N,K){var q,z;return q=["class"],N.id&&(q=Ie(q,this.generateExpression(N.id,o.Sequence,$e))),N.superClass&&(z=Ie("extends",this.generateExpression(N.superClass,o.Unary,$e)),q=Ie(q,z)),q.push(L),q.push(this.generateStatement(N.body,xt)),q},DirectiveStatement:function(N,K){return se.raw&&N.raw?N.raw+this.semicolon(K):tn(N.directive)+this.semicolon(K)},DoWhileStatement:function(N,K){var q=Ie("do",this.maybeBlock(N.body,Je));return q=this.maybeBlockSuffix(N.body,q),Ie(q,["while"+L+"(",this.generateExpression(N.test,o.Sequence,$e),")"+this.semicolon(K)])},CatchClause:function(N,K){var q,z=this;return nt(function(){var fe;N.param?(q=["catch"+L+"(",z.generateExpression(N.param,o.Sequence,$e),")"],N.guard&&(fe=z.generateExpression(N.guard,o.Sequence,$e),q.splice(2,0," if ",fe))):q=["catch"]}),q.push(this.maybeBlock(N.body,Je)),q},DebuggerStatement:function(N,K){return"debugger"+this.semicolon(K)},EmptyStatement:function(N,K){return";"},ExportDefaultDeclaration:function(N,K){var q=["export"],z;return z=K&je?xt:Je,q=Ie(q,"default"),Ce(N.declaration)?q=Ie(q,this.generateStatement(N.declaration,z)):q=Ie(q,this.generateExpression(N.declaration,o.Assignment,$e)+this.semicolon(K)),q},ExportNamedDeclaration:function(N,K){var q=["export"],z,fe=this;return z=K&je?xt:Je,N.declaration?Ie(q,this.generateStatement(N.declaration,z)):(N.specifiers&&(N.specifiers.length===0?q=Ie(q,"{"+L+"}"):N.specifiers[0].type===a.ExportBatchSpecifier?q=Ie(q,this.generateExpression(N.specifiers[0],o.Sequence,$e)):(q=Ie(q,"{"),nt(function(we){var De,Be;for(q.push(R),De=0,Be=N.specifiers.length;De<Be;++De)q.push(we),q.push(fe.generateExpression(N.specifiers[De],o.Sequence,$e)),De+1<Be&&q.push(","+R)}),At(rt(q).toString())||q.push(R),q.push(g+"}")),N.source?q=Ie(q,["from"+L,this.generateExpression(N.source,o.Sequence,$e),this.semicolon(K)]):q.push(this.semicolon(K))),q)},ExportAllDeclaration:function(N,K){return["export"+L,"*"+L,"from"+L,this.generateExpression(N.source,o.Sequence,$e),this.semicolon(K)]},ExpressionStatement:function(N,K){var q,z;function fe(Be){var Le;return Be.slice(0,5)!=="class"?!1:(Le=Be.charCodeAt(5),Le===123||p.code.isWhiteSpace(Le)||p.code.isLineTerminator(Le))}function we(Be){var Le;return Be.slice(0,8)!=="function"?!1:(Le=Be.charCodeAt(8),Le===40||p.code.isWhiteSpace(Le)||Le===42||p.code.isLineTerminator(Le))}function De(Be){var Le,st,St;if(Be.slice(0,5)!=="async"||!p.code.isWhiteSpace(Be.charCodeAt(5)))return!1;for(st=6,St=Be.length;st<St&&p.code.isWhiteSpace(Be.charCodeAt(st));++st);return st===St||Be.slice(st,st+8)!=="function"?!1:(Le=Be.charCodeAt(st+8),Le===40||p.code.isWhiteSpace(Le)||Le===42||p.code.isLineTerminator(Le))}return q=[this.generateExpression(N.expression,o.Sequence,$e)],z=rt(q).toString(),z.charCodeAt(0)===123||fe(z)||we(z)||De(z)||he&&K&Ee&&N.expression.type===a.Literal&&typeof N.expression.value=="string"?q=["(",q,")"+this.semicolon(K)]:q.push(this.semicolon(K)),q},ImportDeclaration:function(N,K){var q,z,fe=this;return N.specifiers.length===0?["import",L,this.generateExpression(N.source,o.Sequence,$e),this.semicolon(K)]:(q=["import"],z=0,N.specifiers[z].type===a.ImportDefaultSpecifier&&(q=Ie(q,[this.generateExpression(N.specifiers[z],o.Sequence,$e)]),++z),N.specifiers[z]&&(z!==0&&q.push(","),N.specifiers[z].type===a.ImportNamespaceSpecifier?q=Ie(q,[L,this.generateExpression(N.specifiers[z],o.Sequence,$e)]):(q.push(L+"{"),N.specifiers.length-z===1?(q.push(L),q.push(this.generateExpression(N.specifiers[z],o.Sequence,$e)),q.push(L+"}"+L)):(nt(function(we){var De,Be;for(q.push(R),De=z,Be=N.specifiers.length;De<Be;++De)q.push(we),q.push(fe.generateExpression(N.specifiers[De],o.Sequence,$e)),De+1<Be&&q.push(","+R)}),At(rt(q).toString())||q.push(R),q.push(g+"}"+L)))),q=Ie(q,["from"+L,this.generateExpression(N.source,o.Sequence,$e),this.semicolon(K)]),q)},VariableDeclarator:function(N,K){var q=K&Ae?$e:Ke;return N.init?[this.generateExpression(N.id,o.Assignment,q),L,"=",L,this.generateExpression(N.init,o.Assignment,q)]:this.generatePattern(N.id,o.Assignment,q)},VariableDeclaration:function(N,K){var q,z,fe,we,De,Be=this;q=[N.kind],De=K&Ae?Je:ot;function Le(){for(we=N.declarations[0],se.comment&&we.leadingComments?(q.push(`
`),q.push(wt(Be.generateStatement(we,De)))):(q.push(Ot()),q.push(Be.generateStatement(we,De))),z=1,fe=N.declarations.length;z<fe;++z)we=N.declarations[z],se.comment&&we.leadingComments?(q.push(","+R),q.push(wt(Be.generateStatement(we,De)))):(q.push(","+L),q.push(Be.generateStatement(we,De)))}return N.declarations.length>1?nt(Le):Le(),q.push(this.semicolon(K)),q},ThrowStatement:function(N,K){return[Ie("throw",this.generateExpression(N.argument,o.Sequence,$e)),this.semicolon(K)]},TryStatement:function(N,K){var q,z,fe,we;if(q=["try",this.maybeBlock(N.block,Je)],q=this.maybeBlockSuffix(N.block,q),N.handlers)for(z=0,fe=N.handlers.length;z<fe;++z)q=Ie(q,this.generateStatement(N.handlers[z],Je)),(N.finalizer||z+1!==fe)&&(q=this.maybeBlockSuffix(N.handlers[z].body,q));else{for(we=N.guardedHandlers||[],z=0,fe=we.length;z<fe;++z)q=Ie(q,this.generateStatement(we[z],Je)),(N.finalizer||z+1!==fe)&&(q=this.maybeBlockSuffix(we[z].body,q));if(N.handler)if(Array.isArray(N.handler))for(z=0,fe=N.handler.length;z<fe;++z)q=Ie(q,this.generateStatement(N.handler[z],Je)),(N.finalizer||z+1!==fe)&&(q=this.maybeBlockSuffix(N.handler[z].body,q));else q=Ie(q,this.generateStatement(N.handler,Je)),N.finalizer&&(q=this.maybeBlockSuffix(N.handler.body,q))}return N.finalizer&&(q=Ie(q,["finally",this.maybeBlock(N.finalizer,Je)])),q},SwitchStatement:function(N,K){var q,z,fe,we,De,Be=this;if(nt(function(){q=["switch"+L+"(",Be.generateExpression(N.discriminant,o.Sequence,$e),")"+L+"{"+R]}),N.cases)for(De=Je,fe=0,we=N.cases.length;fe<we;++fe)fe===we-1&&(De|=je),z=wt(this.generateStatement(N.cases[fe],De)),q.push(z),At(rt(z).toString())||q.push(R);return q.push(wt("}")),q},SwitchCase:function(N,K){var q,z,fe,we,De,Be=this;return nt(function(){for(N.test?q=[Ie("case",Be.generateExpression(N.test,o.Sequence,$e)),":"]:q=["default:"],fe=0,we=N.consequent.length,we&&N.consequent[0].type===a.BlockStatement&&(z=Be.maybeBlock(N.consequent[0],Je),q.push(z),fe=1),fe!==we&&!At(rt(q).toString())&&q.push(R),De=Je;fe<we;++fe)fe===we-1&&K&je&&(De|=je),z=wt(Be.generateStatement(N.consequent[fe],De)),q.push(z),fe+1!==we&&!At(rt(z).toString())&&q.push(R)}),q},IfStatement:function(N,K){var q,z,fe,we=this;return nt(function(){q=["if"+L+"(",we.generateExpression(N.test,o.Sequence,$e),")"]}),fe=K&je,z=Je,fe&&(z|=je),N.alternate?(q.push(this.maybeBlock(N.consequent,Je)),q=this.maybeBlockSuffix(N.consequent,q),N.alternate.type===a.IfStatement?q=Ie(q,["else ",this.generateStatement(N.alternate,z)]):q=Ie(q,Ie("else",this.maybeBlock(N.alternate,z)))):q.push(this.maybeBlock(N.consequent,z)),q},ForStatement:function(N,K){var q,z=this;return nt(function(){q=["for"+L+"("],N.init?N.init.type===a.VariableDeclaration?q.push(z.generateStatement(N.init,ot)):(q.push(z.generateExpression(N.init,o.Sequence,Ke)),q.push(";")):q.push(";"),N.test&&(q.push(L),q.push(z.generateExpression(N.test,o.Sequence,$e))),q.push(";"),N.update&&(q.push(L),q.push(z.generateExpression(N.update,o.Sequence,$e))),q.push(")")}),q.push(this.maybeBlock(N.body,K&je?xt:Je)),q},ForInStatement:function(N,K){return this.generateIterationForStatement("in",N,K&je?xt:Je)},ForOfStatement:function(N,K){return this.generateIterationForStatement("of",N,K&je?xt:Je)},LabeledStatement:function(N,K){return[N.label.name+":",this.maybeBlock(N.body,K&je?xt:Je)]},Program:function(N,K){var q,z,fe,we,De;for(we=N.body.length,q=[re&&we>0?`
`:""],De=kt,fe=0;fe<we;++fe)!re&&fe===we-1&&(De|=je),_e&&(fe===0&&(N.body[0].leadingComments||ct(N.range[0],N.body[fe].range[0],q)),fe>0&&!N.body[fe-1].trailingComments&&!N.body[fe].leadingComments&&ct(N.body[fe-1].range[1],N.body[fe].range[0],q)),z=wt(this.generateStatement(N.body[fe],De)),q.push(z),fe+1<we&&!At(rt(z).toString())&&(_e&&N.body[fe+1].leadingComments||q.push(R)),_e&&fe===we-1&&(N.body[fe].trailingComments||ct(N.body[fe].range[1],N.range[1],q));return q},FunctionDeclaration:function(N,K){return[Ct(N,!0),"function",nn(N)||Ot(),N.id?Rt(N.id):"",this.generateFunctionBody(N)]},ReturnStatement:function(N,K){return N.argument?[Ie("return",this.generateExpression(N.argument,o.Sequence,$e)),this.semicolon(K)]:["return"+this.semicolon(K)]},WhileStatement:function(N,K){var q,z=this;return nt(function(){q=["while"+L+"(",z.generateExpression(N.test,o.Sequence,$e),")"]}),q.push(this.maybeBlock(N.body,K&je?xt:Je)),q},WithStatement:function(N,K){var q,z=this;return nt(function(){q=["with"+L+"(",z.generateExpression(N.object,o.Sequence,$e),")"]}),q.push(this.maybeBlock(N.body,K&je?xt:Je)),q}},Ft(pt.prototype,pt.Statement),pt.Expression={SequenceExpression:function(N,K,q){var z,fe,we;for(o.Sequence<K&&(q|=Ae),z=[],fe=0,we=N.expressions.length;fe<we;++fe)z.push(this.generateExpression(N.expressions[fe],o.Assignment,q)),fe+1<we&&z.push(","+L);return ut(z,o.Sequence,K)},AssignmentExpression:function(N,K,q){return this.generateAssignment(N.left,N.right,N.operator,K,q)},ArrowFunctionExpression:function(N,K,q){return ut(this.generateFunctionBody(N),o.ArrowFunction,K)},ConditionalExpression:function(N,K,q){return o.Conditional<K&&(q|=Ae),ut([this.generateExpression(N.test,o.Coalesce,q),L+"?"+L,this.generateExpression(N.consequent,o.Assignment,q),L+":"+L,this.generateExpression(N.alternate,o.Assignment,q)],o.Conditional,K)},LogicalExpression:function(N,K,q){return N.operator==="??"&&(q|=Ye),this.BinaryExpression(N,K,q)},BinaryExpression:function(N,K,q){var z,fe,we,De,Be,Le;return De=u[N.operator],fe=N.operator==="**"?o.Postfix:De,we=N.operator==="**"?De:De+1,De<K&&(q|=Ae),Be=this.generateExpression(N.left,fe,q),Le=Be.toString(),Le.charCodeAt(Le.length-1)===47&&p.code.isIdentifierPartES5(N.operator.charCodeAt(0))?z=[Be,Ot(),N.operator]:z=Ie(Be,N.operator),Be=this.generateExpression(N.right,we,q),N.operator==="/"&&Be.toString().charAt(0)==="/"||N.operator.slice(-1)==="<"&&Be.toString().slice(0,3)==="!--"?(z.push(Ot()),z.push(Be)):z=Ie(z,Be),N.operator==="in"&&!(q&Ae)?["(",z,")"]:(N.operator==="||"||N.operator==="&&")&&q&Ye?["(",z,")"]:ut(z,De,K)},CallExpression:function(N,K,q){var z,fe,we;for(z=[this.generateExpression(N.callee,o.Call,Ve)],N.optional&&z.push("?."),z.push("("),fe=0,we=N.arguments.length;fe<we;++fe)z.push(this.generateExpression(N.arguments[fe],o.Assignment,$e)),fe+1<we&&z.push(","+L);return z.push(")"),q&Ge?ut(z,o.Call,K):["(",z,")"]},ChainExpression:function(N,K,q){o.OptionalChaining<K&&(q|=Ge);var z=this.generateExpression(N.expression,o.OptionalChaining,q);return ut(z,o.OptionalChaining,K)},NewExpression:function(N,K,q){var z,fe,we,De,Be;if(fe=N.arguments.length,Be=q&Ne&&!U&&fe===0?mt:ze,z=Ie("new",this.generateExpression(N.callee,o.New,Be)),!(q&Ne)||U||fe>0){for(z.push("("),we=0,De=fe;we<De;++we)z.push(this.generateExpression(N.arguments[we],o.Assignment,$e)),we+1<De&&z.push(","+L);z.push(")")}return ut(z,o.New,K)},MemberExpression:function(N,K,q){var z,fe;return z=[this.generateExpression(N.object,o.Call,q&Ge?Ve:ze)],N.computed?(N.optional&&z.push("?."),z.push("["),z.push(this.generateExpression(N.property,o.Sequence,q&Ge?$e:mt)),z.push("]")):(!N.optional&&N.object.type===a.Literal&&typeof N.object.value=="number"&&(fe=rt(z).toString(),fe.indexOf(".")<0&&!/[eExX]/.test(fe)&&p.code.isDecimalDigit(fe.charCodeAt(fe.length-1))&&!(fe.length>=2&&fe.charCodeAt(0)===48)&&z.push(" ")),z.push(N.optional?"?.":"."),z.push(Rt(N.property))),ut(z,o.Member,K)},MetaProperty:function(N,K,q){var z;return z=[],z.push(typeof N.meta=="string"?N.meta:Rt(N.meta)),z.push("."),z.push(typeof N.property=="string"?N.property:Rt(N.property)),ut(z,o.Member,K)},UnaryExpression:function(N,K,q){var z,fe,we,De,Be;return fe=this.generateExpression(N.argument,o.Unary,$e),L===""?z=Ie(N.operator,fe):(z=[N.operator],N.operator.length>2?z=Ie(z,fe):(De=rt(z).toString(),Be=De.charCodeAt(De.length-1),we=fe.toString().charCodeAt(0),((Be===43||Be===45)&&Be===we||p.code.isIdentifierPartES5(Be)&&p.code.isIdentifierPartES5(we))&&z.push(Ot()),z.push(fe))),ut(z,o.Unary,K)},YieldExpression:function(N,K,q){var z;return N.delegate?z="yield*":z="yield",N.argument&&(z=Ie(z,this.generateExpression(N.argument,o.Yield,$e))),ut(z,o.Yield,K)},AwaitExpression:function(N,K,q){var z=Ie(N.all?"await*":"await",this.generateExpression(N.argument,o.Await,$e));return ut(z,o.Await,K)},UpdateExpression:function(N,K,q){return N.prefix?ut([N.operator,this.generateExpression(N.argument,o.Unary,$e)],o.Unary,K):ut([this.generateExpression(N.argument,o.Postfix,$e),N.operator],o.Postfix,K)},FunctionExpression:function(N,K,q){var z=[Ct(N,!0),"function"];return N.id?(z.push(nn(N)||Ot()),z.push(Rt(N.id))):z.push(nn(N)||L),z.push(this.generateFunctionBody(N)),z},ArrayPattern:function(N,K,q){return this.ArrayExpression(N,K,q,!0)},ArrayExpression:function(N,K,q,z){var fe,we,De=this;return N.elements.length?(we=z?!1:N.elements.length>1,fe=["[",we?R:""],nt(function(Be){var Le,st;for(Le=0,st=N.elements.length;Le<st;++Le)N.elements[Le]?(fe.push(we?Be:""),fe.push(De.generateExpression(N.elements[Le],o.Assignment,$e))):(we&&fe.push(Be),Le+1===st&&fe.push(",")),Le+1<st&&fe.push(","+(we?R:L))}),we&&!At(rt(fe).toString())&&fe.push(R),fe.push(we?g:""),fe.push("]"),fe):"[]"},RestElement:function(N,K,q){return"..."+this.generatePattern(N.argument)},ClassExpression:function(N,K,q){var z,fe;return z=["class"],N.id&&(z=Ie(z,this.generateExpression(N.id,o.Sequence,$e))),N.superClass&&(fe=Ie("extends",this.generateExpression(N.superClass,o.Unary,$e)),z=Ie(z,fe)),z.push(L),z.push(this.generateStatement(N.body,xt)),z},MethodDefinition:function(N,K,q){var z,fe;return N.static?z=["static"+L]:z=[],N.kind==="get"||N.kind==="set"?fe=[Ie(N.kind,this.generatePropertyKey(N.key,N.computed)),this.generateFunctionBody(N.value)]:fe=[bn(N),this.generatePropertyKey(N.key,N.computed),this.generateFunctionBody(N.value)],Ie(z,fe)},Property:function(N,K,q){return N.kind==="get"||N.kind==="set"?[N.kind,Ot(),this.generatePropertyKey(N.key,N.computed),this.generateFunctionBody(N.value)]:N.shorthand?N.value.type==="AssignmentPattern"?this.AssignmentPattern(N.value,o.Sequence,$e):this.generatePropertyKey(N.key,N.computed):N.method?[bn(N),this.generatePropertyKey(N.key,N.computed),this.generateFunctionBody(N.value)]:[this.generatePropertyKey(N.key,N.computed),":"+L,this.generateExpression(N.value,o.Assignment,$e)]},ObjectExpression:function(N,K,q){var z,fe,we,De=this;return N.properties.length?(z=N.properties.length>1,nt(function(){we=De.generateExpression(N.properties[0],o.Sequence,$e)}),!z&&!Pt(rt(we).toString())?["{",L,we,L,"}"]:(nt(function(Be){var Le,st;if(fe=["{",R,Be,we],z)for(fe.push(","+R),Le=1,st=N.properties.length;Le<st;++Le)fe.push(Be),fe.push(De.generateExpression(N.properties[Le],o.Sequence,$e)),Le+1<st&&fe.push(","+R)}),At(rt(fe).toString())||fe.push(R),fe.push(g),fe.push("}"),fe)):"{}"},AssignmentPattern:function(N,K,q){return this.generateAssignment(N.left,N.right,"=",K,q)},ObjectPattern:function(N,K,q){var z,fe,we,De,Be,Le=this;if(!N.properties.length)return"{}";if(De=!1,N.properties.length===1)Be=N.properties[0],Be.type===a.Property&&Be.value.type!==a.Identifier&&(De=!0);else for(fe=0,we=N.properties.length;fe<we;++fe)if(Be=N.properties[fe],Be.type===a.Property&&!Be.shorthand){De=!0;break}return z=["{",De?R:""],nt(function(st){var St,Xe;for(St=0,Xe=N.properties.length;St<Xe;++St)z.push(De?st:""),z.push(Le.generateExpression(N.properties[St],o.Sequence,$e)),St+1<Xe&&z.push(","+(De?R:L))}),De&&!At(rt(z).toString())&&z.push(R),z.push(De?g:""),z.push("}"),z},ThisExpression:function(N,K,q){return"this"},Super:function(N,K,q){return"super"},Identifier:function(N,K,q){return Rt(N)},ImportDefaultSpecifier:function(N,K,q){return Rt(N.id||N.local)},ImportNamespaceSpecifier:function(N,K,q){var z=["*"],fe=N.id||N.local;return fe&&z.push(L+"as"+Ot()+Rt(fe)),z},ImportSpecifier:function(N,K,q){var z=N.imported,fe=[z.name],we=N.local;return we&&we.name!==z.name&&fe.push(Ot()+"as"+Ot()+Rt(we)),fe},ExportSpecifier:function(N,K,q){var z=N.local,fe=[z.name],we=N.exported;return we&&we.name!==z.name&&fe.push(Ot()+"as"+Ot()+Rt(we)),fe},Literal:function(N,K,q){var z;if(N.hasOwnProperty("raw")&&ee&&se.raw)try{if(z=ee(N.raw).body[0].expression,z.type===a.Literal&&z.value===N.value)return N.raw}catch{}return N.regex?"/"+N.regex.pattern+"/"+N.regex.flags:typeof N.value=="bigint"?N.value.toString()+"n":N.bigint?N.bigint+"n":N.value===null?"null":typeof N.value=="string"?Lt(N.value):typeof N.value=="number"?Yt(N.value):typeof N.value=="boolean"?N.value?"true":"false":qt(N.value)},GeneratorExpression:function(N,K,q){return this.ComprehensionExpression(N,K,q)},ComprehensionExpression:function(N,K,q){var z,fe,we,De,Be=this;return z=N.type===a.GeneratorExpression?["("]:["["],se.moz.comprehensionExpressionStartsWithAssignment&&(De=this.generateExpression(N.body,o.Assignment,$e),z.push(De)),N.blocks&&nt(function(){for(fe=0,we=N.blocks.length;fe<we;++fe)De=Be.generateExpression(N.blocks[fe],o.Sequence,$e),fe>0||se.moz.comprehensionExpressionStartsWithAssignment?z=Ie(z,De):z.push(De)}),N.filter&&(z=Ie(z,"if"+L),De=this.generateExpression(N.filter,o.Sequence,$e),z=Ie(z,["(",De,")"])),se.moz.comprehensionExpressionStartsWithAssignment||(De=this.generateExpression(N.body,o.Assignment,$e),z=Ie(z,De)),z.push(N.type===a.GeneratorExpression?")":"]"),z},ComprehensionBlock:function(N,K,q){var z;return N.left.type===a.VariableDeclaration?z=[N.left.kind,Ot(),this.generateStatement(N.left.declarations[0],ot)]:z=this.generateExpression(N.left,o.Call,$e),z=Ie(z,N.of?"of":"in"),z=Ie(z,this.generateExpression(N.right,o.Sequence,$e)),["for"+L+"(",z,")"]},SpreadElement:function(N,K,q){return["...",this.generateExpression(N.argument,o.Assignment,$e)]},TaggedTemplateExpression:function(N,K,q){var z=Ve;q&Ge||(z=ze);var fe=[this.generateExpression(N.tag,o.Call,z),this.generateExpression(N.quasi,o.Primary,it)];return ut(fe,o.TaggedTemplate,K)},TemplateElement:function(N,K,q){return N.value.raw},TemplateLiteral:function(N,K,q){var z,fe,we;for(z=["`"],fe=0,we=N.quasis.length;fe<we;++fe)z.push(this.generateExpression(N.quasis[fe],o.Primary,$e)),fe+1<we&&(z.push("${"+L),z.push(this.generateExpression(N.expressions[fe],o.Sequence,$e)),z.push(L+"}"));return z.push("`"),z},ModuleSpecifier:function(N,K,q){return this.Literal(N,K,q)},ImportExpression:function(N,K,q){return ut(["import(",this.generateExpression(N.source,o.Assignment,$e),")"],o.Call,K)}},Ft(pt.prototype,pt.Expression),pt.prototype.generateExpression=function(N,K,q){var z,fe;return fe=N.type||a.Property,se.verbatim&&N.hasOwnProperty(se.verbatim)?Nt(N,K):(z=this[fe](N,K,q),se.comment&&(z=cn(N,z)),rt(z,N))},pt.prototype.generateStatement=function(N,K){var q,z;return q=this[N.type](N,K),se.comment&&(q=cn(N,q)),z=rt(q).toString(),N.type===a.Program&&!re&&R===""&&z.charAt(z.length-1)===`
`&&(q=oe?rt(q).replaceRight(/\s+$/,""):z.replace(/\s+$/,"")),rt(q,N)};function vn(N){var K;if(K=new pt,Ce(N))return K.generateStatement(N,Je);if(Te(N))return K.generateExpression(N,o.Sequence,$e);throw new Error("Unknown node type: "+N.type)}function yn(N,K){var q=Wt(),z,fe;return K!=null?(typeof K.indent=="string"&&(q.format.indent.style=K.indent),typeof K.base=="number"&&(q.format.indent.base=K.base),K=Xt(q,K),b=K.format.indent.style,typeof K.base=="string"?g=K.base:g=vt(b,K.format.indent.base)):(K=q,b=K.format.indent.style,g=vt(b,K.format.indent.base)),O=K.format.json,S=K.format.renumber,A=O?!1:K.format.hexadecimal,M=O?"double":K.format.quotes,E=K.format.escapeless,R=K.format.newline,L=K.format.space,K.format.compact&&(R=L=b=g=""),U=K.format.parentheses,Z=K.format.semicolons,re=K.format.safeConcatenation,he=K.directive,ee=O?null:K.parse,oe=K.sourceMap,me=K.sourceCode,_e=K.format.preserveBlankLines&&me!==null,se=K,oe&&(l.browser?d=commonjsGlobal.sourceMap.SourceNode:d=requireSourceMap().SourceNode),z=vn(N),oe?(fe=z.toStringWithSourceMap({file:K.file,sourceRoot:K.sourceMapRoot}),K.sourceContent&&fe.map.setSourceContent(K.sourceMap,K.sourceContent),K.sourceMapWithCode?fe:fe.map.toString()):(fe={code:z.toString(),map:null},K.sourceMapWithCode?fe:fe.code)}ke={indent:{style:"",base:0},renumber:!0,hexadecimal:!0,quotes:"auto",escapeless:!0,compact:!0,parentheses:!1,semicolons:!1},Oe=Wt().format,l.version=require$$3.version,l.generate=yn,l.attachComments=f.attachComments,l.Precedence=Xt({},o),l.browser=!1,l.FORMAT_MINIFY=ke,l.FORMAT_DEFAULTS=Oe})()}(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:a=>this.replacement=a}}replace(a,o,u,d){a&&o&&(u!=null?a[o][u]=d:a[o]=d)}remove(a,o,u){a&&o&&(u!=null?a[o].splice(u,1):delete a[o])}}class SyncWalker extends WalkerBase{constructor(a,o){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:u=>this.replacement=u},this.enter=a,this.leave=o}visit(a,o,u,d){if(a){if(this.enter){const p=this.should_skip,g=this.should_remove,b=this.replacement;this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.enter.call(this.context,a,o,u,d),this.replacement&&(a=this.replacement,this.replace(o,u,d,a)),this.should_remove&&this.remove(o,u,d);const O=this.should_skip,S=this.should_remove;if(this.should_skip=p,this.should_remove=g,this.replacement=b,O)return a;if(S)return null}let f;for(f in a){const p=a[f];if(p&&typeof p=="object")if(Array.isArray(p)){const g=p;for(let b=0;b<g.length;b+=1){const O=g[b];isNode(O)&&(this.visit(O,a,f,b)||b--)}}else isNode(p)&&this.visit(p,a,f,null)}if(this.leave){const p=this.replacement,g=this.should_remove;this.replacement=null,this.should_remove=!1,this.leave.call(this.context,a,o,u,d),this.replacement&&(a=this.replacement,this.replace(o,u,d,a)),this.should_remove&&this.remove(o,u,d);const b=this.should_remove;if(this.replacement=p,this.should_remove=g,b)return null}}return a}}function isNode(l){return l!==null&&typeof l=="object"&&"type"in l&&typeof l.type=="string"}function walk(l,{enter:a,leave:o}){return new SyncWalker(a,o).visit(l,null)}let widgetMethods=[];function registerWidgetType(l){widgetMethods.push(l)}let languages=new Map;function transpiler(l,a={}){const{wrapAsync:o=!1,addReturn:u=!0,emitMiniLocations:d=!0,emitWidgets:f=!0}=a;let p=parse$6(l,{ecmaVersion:2022,allowAwaitOutsideFunction:!0,locations:!0}),g=[];const b=(M,E)=>{const R=languages.get("minilang");if(R){const L=`[${M}]`,U=R.getLocations(L,E.start);g=g.concat(U)}else{const L=getLeafLocations(`"${M}"`,E.start,l);g=g.concat(L)}};let O=[];walk(p,{enter(M,E){if(isLanguageLiteral(M)){const{name:R}=M.tag,L=languages.get(R),U=M.quasi.quasis[0].value.raw,Z=M.quasi.start+1;if(d){const re=L.getLocations(U,Z);g=g.concat(re)}return this.skip(),this.replace(languageWithLocation(R,U,Z))}if(isTemplateLiteral(M,"tidal")){const R=M.quasi.quasis[0].value.raw,L=M.quasi.start+1;if(d){const U=collectHaskellMiniLocations(R,L);g=g.concat(U)}return this.skip(),this.replace(tidalWithLocation(R,L))}if(isBackTickString(M,E)){const{quasis:R}=M,{raw:L}=R[0].value;return this.skip(),d&&b(L,M),this.replace(miniWithLocation(L,M))}if(isStringWithDoubleQuotes(M)){const{value:R}=M;return this.skip(),d&&b(R,M),this.replace(miniWithLocation(R,M))}if(isSliderFunction(M))return f&&O.push({from:M.arguments[0].start,to:M.arguments[0].end,value:M.arguments[0].raw,min:M.arguments[1]?.value??0,max:M.arguments[2]?.value??1,step:M.arguments[3]?.value,type:"slider"}),this.replace(sliderWithLocation(M));if(isWidgetMethod(M)){const R=M.callee.property.name,L=O.filter(Z=>Z.type===R).length,U={to:M.end,index:L,type:R,id:a.id};return f&&O.push(U),this.replace(widgetWithLocation(M,U))}if(isBareSamplesCall(M,E))return this.replace(withAwait(M));if(isLabelStatement(M))return this.replace(labelToP(M))},leave(M,E,R,L){}});let{body:S}=p;if(!S.length)console.warn("empty body -> fallback to silence"),S.push({type:"ExpressionStatement",expression:{type:"Identifier",name:"silence"}});else if(!S?.[S.length-1]?.expression)throw new Error("unexpected ast format without body expression");if(u){const{expression:M}=S[S.length-1];S[S.length-1]={type:"ReturnStatement",argument:M}}let A=escodegen.generate(p);return o&&(A=`(async ()=>{${A}})()`),d?{output:A,miniLocations:g,widgets:O}:{output:A}}function isStringWithDoubleQuotes(l,a,o){return l.type!=="Literal"?!1:l.raw[0]==='"'}function isBackTickString(l,a){return l.type==="TemplateLiteral"&&a.type!=="TaggedTemplateExpression"}function miniWithLocation(l,a){const{start:o}=a,u=languages.get("minilang");let d="m";return u&&u.name&&(d=u.name),{type:"CallExpression",callee:{type:"Identifier",name:d},arguments:[{type:"Literal",value:l},{type:"Literal",value:o}],optional:!1}}function isSliderFunction(l){return l.type==="CallExpression"&&l.callee.name==="slider"}function isWidgetMethod(l){return l.type==="CallExpression"&&widgetMethods.includes(l.callee.property?.name)}function sliderWithLocation(l){const a="slider_"+l.arguments[0].start;return l.arguments.unshift({type:"Literal",value:a,raw:a}),l.callee.name="sliderWithID",l}function getWidgetID(l){return`${l.id||""}_widget_${l.type}_${l.index}`}function widgetWithLocation(l,a){const o=getWidgetID(a);return l.arguments.unshift({type:"Literal",value:o,raw:o}),l}function isBareSamplesCall(l,a){return l.type==="CallExpression"&&l.callee.name==="samples"&&a.type!=="AwaitExpression"}function withAwait(l){return{type:"AwaitExpression",argument:l}}function isLabelStatement(l){return l.type==="LabeledStatement"}function labelToP(l){return{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:l.body.expression,property:{type:"Identifier",name:"p"}},arguments:[{type:"Literal",value:l.label.name,raw:`'${l.label.name}'`}]}}}function isLanguageLiteral(l){return l.type==="TaggedTemplateExpression"&&languages.has(l.tag.name)}function isTemplateLiteral(l,a){return l.type==="TaggedTemplateExpression"&&l.tag.name===a}function collectHaskellMiniLocations(l,a){return l.split("").reduce((o,u,d)=>(u!=='"'||(!o.length||o[o.length-1].length>1?o.push([d+1]):o[o.length-1].push(d)),o),[]).map(([o,u])=>{const d=l.slice(o,u);return getLeafLocations(`"${d}"`,a+o-1)}).flat()}function tidalWithLocation(l,a){return{type:"CallExpression",callee:{type:"Identifier",name:"tidal"},arguments:[{type:"Literal",value:l},{type:"Literal",value:a}],optional:!1}}function languageWithLocation(l,a,o){return{type:"CallExpression",callee:{type:"Identifier",name:l},arguments:[{type:"Literal",value:a},{type:"Literal",value:o}],optional:!1}}if(typeof DelayNode<"u"){class l extends DelayNode{constructor(o,u,d,f){super(o),u=Math.abs(u),this.delayTime.value=d;const p=o.createGain();p.gain.value=Math.min(Math.abs(f),.995),this.feedback=p.gain;const g=o.createGain();return g.gain.value=u,this.delayGain=g,this.connect(p),this.connect(g),p.connect(this),this.connect=b=>g.connect(b),this}start(o){this.delayGain.gain.setValueAtTime(this.delayGain.gain.value,o+this.delayTime.value)}}AudioContext.prototype.createFeedbackDelay=function(a,o,u){return new l(this,a,o,u)}}var reverbGen={};reverbGen.generateReverb=function(l,a){for(var o=l.audioContext||new AudioContext,u=o.sampleRate,d=l.numChannels||2,f=l.decayTime*1.5,p=Math.round(l.decayTime*u),g=Math.round(f*u),b=Math.round((l.fadeInTime||0)*u),O=Math.pow(1/1e3,1/p),S=o.createBuffer(d,g,u),A=0;A<d;A++){for(var M=S.getChannelData(A),E=0;E<g;E++)M[E]=randomSample()*Math.pow(O,E);for(var E=0;E<b;E++)M[E]*=E/b}applyGradualLowpass(S,l.lpFreqStart||0,l.lpFreqEnd||0,l.decayTime,a)},reverbGen.generateGraph=function(l,a,o,u,d){var f=document.createElement("canvas");f.width=a,f.height=o;var p=f.getContext("2d");p.fillStyle="#000",p.fillRect(0,0,f.width,f.height),p.fillStyle="#fff";for(var g=a/l.length,b=o/(d-u),O=0;O<l.length;O++)p.fillRect(O*g,o-(l[O]-u)*b,1,1);return f};var applyGradualLowpass=function(l,a,o,u,d){if(a==0){d(l);return}var f=getAllChannelData(l),p=new OfflineAudioContext(l.numberOfChannels,f[0].length,l.sampleRate),g=p.createBufferSource();g.buffer=l;var b=p.createBiquadFilter();a=Math.min(a,l.sampleRate/2),o=Math.min(o,l.sampleRate/2),b.type="lowpass",b.Q.value=1e-4,b.frequency.setValueAtTime(a,0),b.frequency.linearRampToValueAtTime(o,u),g.connect(b),b.connect(p.destination),g.start(),p.oncomplete=function(O){d(O.renderedBuffer)},p.startRendering(),window.filterNode=b},getAllChannelData=function(l){for(var a=[],o=0;o<l.numberOfChannels;o++)a[o]=l.getChannelData(o);return a},randomSample=function(){return Math.random()*2-1};typeof AudioContext<"u"&&(AudioContext.prototype.adjustLength=function(l,a){const o=a.sampleRate*l,u=this.createBuffer(a.numberOfChannels,a.length,a.sampleRate);for(let d=0;d<a.numberOfChannels;d++){let f=a.getChannelData(d),p=u.getChannelData(d);for(let g=0;g<o;g++)p[g]=f[g]||0}return u},AudioContext.prototype.createReverb=function(l,a,o,u,d){const f=this.createConvolver();return f.generate=(p=2,g=.1,b=15e3,O=1e3,S)=>{f.duration=p,f.fade=g,f.lp=b,f.dim=O,f.ir=S,S?f.buffer=this.adjustLength(p,S):reverbGen.generateReverb({audioContext:this,numChannels:2,decayTime:p,fadeInTime:g,lpFreqStart:b,lpFreqEnd:O},A=>{f.buffer=A})},f.generate(l,a,o,u,d),f});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 l extends GainNode{constructor(o,u){if(super(o),!vowelFormant[u])throw new Error("vowel: unknown vowel "+u);const{gains:d,qs:f,freqs:p}=vowelFormant[u],g=o.createGain();for(let b=0;b<5;b++){const O=o.createGain();O.gain.value=d[b];const S=o.createBiquadFilter();S.type="bandpass",S.Q.value=f[b],S.frequency.value=p[b],this.connect(S),S.connect(O),O.connect(g)}return g.gain.value=8,this.connect=b=>g.connect(b),this}}AudioContext.prototype.createVowelFilter=function(a){return new l(this,a)}}let log=l=>console.log(l);function errorLogger(l,a="cyclist"){logger$1(`[${a}] error: ${l.message}`)}const logger$1=(...l)=>log(...l),setLogger=l=>{log=l},tokenizeNote$2=l=>{if(typeof l!="string")return[];const[a,o="",u]=l.match(/^([a-gA-G])([#bsf]*)([0-9]*)$/)?.slice(1)||[];return a?[a,o,u?Number(u):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},noteToMidi=(l,a=3)=>{const[o,u,d=a]=tokenizeNote$2(l);if(!o)throw new Error('not a note: "'+l+'"');const f=chromas$1[o.toLowerCase()],p=u?.split("").reduce((g,b)=>g+accs$1[b],0)||0;return(Number(d)+1)*12+f+p},midiToFreq$1=l=>Math.pow(2,(l-69)/12)*440,clamp=(l,a,o)=>Math.min(Math.max(l,a),o),freqToMidi$1=l=>12*Math.log(l/440)/Math.LN2+69,valueToMidi=(l,a)=>{if(typeof l!="object")throw new Error("valueToMidi: expected object value");let{freq:o,note:u}=l;return typeof o=="number"?freqToMidi$1(o):typeof u=="string"?noteToMidi(u):typeof u=="number"?u:a};function nanFallback(l,a=0,o){return isNaN(Number(l))?(!o&&logger$1(`"${l}" is not a number, falling back to ${a}`,"warning"),a):l}const _mod=(l,a)=>(l%a+a)%a,getSoundIndex=(l,a)=>_mod(Math.round(nanFallback(l,0)),a);function cycleToSeconds(l,a){return l/a}const workletsUrl="data:text/javascript;base64,KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NsYXNzIGd0IGV4dGVuZHMgQXVkaW9Xb3JrbGV0UHJvY2Vzc29ye2NvbnN0cnVjdG9yKHQpe3N1cGVyKHQpLHRoaXMuc3RhcnRlZD0hMSx0aGlzLm5iSW5wdXRzPXQubnVtYmVyT2ZJbnB1dHMsdGhpcy5uYk91dHB1dHM9dC5udW1iZXJPZk91dHB1dHMsdGhpcy5ibG9ja1NpemU9dC5wcm9jZXNzb3JPcHRpb25zLmJsb2NrU2l6ZSx0aGlzLmhvcFNpemU9MTI4LHRoaXMubmJPdmVybGFwcz10aGlzLmJsb2NrU2l6ZS90aGlzLmhvcFNpemUsdGhpcy5pbnB1dEJ1ZmZlcnM9bmV3IEFycmF5KHRoaXMubmJJbnB1dHMpLHRoaXMuaW5wdXRCdWZmZXJzSGVhZD1uZXcgQXJyYXkodGhpcy5uYklucHV0cyksdGhpcy5pbnB1dEJ1ZmZlcnNUb1NlbmQ9bmV3IEFycmF5KHRoaXMubmJJbnB1dHMpO2ZvcihsZXQgZT0wO2U8dGhpcy5uYklucHV0cztlKyspdGhpcy5hbGxvY2F0ZUlucHV0Q2hhbm5lbHMoZSwxKTt0aGlzLm91dHB1dEJ1ZmZlcnM9bmV3IEFycmF5KHRoaXMubmJPdXRwdXRzKSx0aGlzLm91dHB1dEJ1ZmZlcnNUb1JldHJpZXZlPW5ldyBBcnJheSh0aGlzLm5iT3V0cHV0cyk7Zm9yKGxldCBlPTA7ZTx0aGlzLm5iT3V0cHV0cztlKyspdGhpcy5hbGxvY2F0ZU91dHB1dENoYW5uZWxzKGUsMSl9cmVhbGxvY2F0ZUNoYW5uZWxzSWZOZWVkZWQodCxlKXtmb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be25hbWU6ImJlZ2luIixkZWZhdWx0VmFsdWU6MCxtYXg6TnVtYmVyLlBPU0lUSVZFX0lORklOSVRZLG1pbjowfSx7bmFtZToiZnJlcXVlbmN5IixkZWZhdWx0VmFsdWU6NDQwLG1pbjpOdW1iZXIuRVBTSUxPTn0se25hbWU6ImRldHVuZSIsZGVmYXVsdFZhbHVlOjAsbWluOk51bWJlci5ORUdBVElWRV9JTkZJTklUWSxtYXg6TnVtYmVyLlBPU0lUSVZFX0lORklOSVRZfSx7bmFtZToiZW5kIixkZWZhdWx0VmFsdWU6MCxtYXg6TnVtYmVyLlBPU0lUSVZFX0lORklOSVRZLG1pbjowfV19cHJvY2Vzcyh0LGUscyl7aWYodGhpcy5kaXNjb25uZWN0ZWQpcmV0dXJuITE7aWYoY3VycmVudFRpbWU8PXMuYmVnaW5bMF0pcmV0dXJuITA7aWYoY3VycmVudFRpbWU+PXMuZW5kWzBdKXJldHVybiExO3RoaXMudD09bnVsbCYmKHRoaXMudD1zLmJlZ2luWzBdKnNhbXBsZVJhdGUpO2NvbnN0IHI9ZVswXTtmb3IobGV0IG89MDtvPHJbMF0ubGVuZ3RoO28rKyl7Y29uc3QgaT1xKG8scy5kZXR1bmUpLHU9dHQocShvLHMuZnJlcXVlbmN5KSxpLzEwMCk7bGV0IGM9dGhpcy50LyhzYW1wbGVSYXRlLzI1NikqdSt0aGlzLmluaXRpYWxPZmZzZXQ7Y29uc3QgbT0oKHRoaXMuZnVuYyhjKSYyNTUpLzEyNy41LTEpKi4yO2ZvcihsZXQgcD0wO3A8ci5sZW5ndGg7cCsrKXJbcF1bb109QyhtLC0uNCwuNCk7dGhpcy50PXRoaXMudCsxfXJldHVybiEwfX1yZWdpc3RlclByb2Nlc3NvcigiYnl0ZS1iZWF0LXByb2Nlc3NvciIsenQpfSkoKTsK";let noiseCache={};function getNoiseBuffer(l,a){const o=getAudioContext();if(noiseCache[l])return noiseCache[l];const u=2*o.sampleRate,d=o.createBuffer(1,u,o.sampleRate),f=d.getChannelData(0);let p=0,g,b,O,S,A,M,E;g=b=O=S=A=M=E=0;for(let R=0;R<u;R++)if(l==="white")f[R]=Math.random()*2-1;else if(l==="brown"){let L=Math.random()*2-1;f[R]=(p+.02*L)/1.02,p=f[R]}else if(l==="pink"){let L=Math.random()*2-1;g=.99886*g+L*.0555179,b=.99332*b+L*.0750759,O=.969*O+L*.153852,S=.8665*S+L*.3104856,A=.55*A+L*.5329522,M=-.7616*M-L*.016898,f[R]=g+b+O+S+A+M+E+L*.5362,f[R]*=.11,E=L*.115926}else if(l==="crackle"){const L=a*.01;Math.random()<L?f[R]=Math.random()*2-1:f[R]=0}return l!=="crackle"&&(noiseCache[l]=d),d}function getNoiseOscillator(l="white",a,o=.02){const d=getAudioContext().createBufferSource();return d.buffer=getNoiseBuffer(l,o),d.loop=!0,d.start(a),{node:d,stop:f=>d.stop(f)}}function getNoiseMix(l,a,o){const u=getNoiseOscillator("pink",o);return{node:drywet(l,u.node,a),stop:f=>u?.stop(f)}}const noises=["pink","white","brown","crackle"];function gainNode(l){const a=getAudioContext().createGain();return a.gain.value=l,a}const getSlope=(l,a,o,u)=>u-o===0?0:(a-l)/(u-o);function getWorklet(l,a,o,u){const d=new AudioWorkletNode(l,a,u);return Object.entries(o).forEach(([f,p])=>{d.parameters.get(f).value=p}),d}const getParamADSR=(l,a,o,u,d,f,p,g,b,O="exponential")=>{a=nanFallback(a),o=nanFallback(o),u=nanFallback(u),d=nanFallback(d);const S=O==="exponential"?"exponentialRampToValueAtTime":"linearRampToValueAtTime";O==="exponential"&&(f=f===0?.001:f,p=p===0?.001:p);const A=p-f,M=p,E=f+u*A,R=b-g,L=U=>{let Z;if(a>U){let re=getSlope(f,M,0,a);Z=U*re+(f>M?f:0)}else Z=(U-a)*getSlope(M,E,0,o)+M;return O==="exponential"&&(Z=Z||.001),Z};l.setValueAtTime(f,g),a>R?l[S](L(R),b):a+o>R?(l[S](L(a),g+a),l[S](L(R),b)):(l[S](L(a),g+a),l[S](L(a+o),g+a+o),l.setValueAtTime(E,b)),l[S](f,b+d)};function getCompressor(l,a,o,u,d,f){const p={threshold:a??-3,ratio:o??10,knee:u??10,attack:d??.005,release:f??.05};return new DynamicsCompressorNode(l,p)}const getADSRValues=(l,a="linear",o)=>{const[p,g,b,O]=l;if(p==null&&g==null&&b==null&&O==null)return o??[.001,.001,1,.01];const S=b??(p!=null&&g==null||p==null&&g==null?1:.001);return[Math.max(p??0,.001),Math.max(g??0,.001),Math.min(S,1),Math.max(O??0,.01)]};function createFilter(l,a,o,u,d,f,p,g,b,O,S,A,M,E){const R="exponential",[L,U,Z,re]=getADSRValues([d,f,p,g],R,[.005,.14,0,.1]);let he,se;if(M==="ladder"?(he=getWorklet(l,"ladder-processor",{frequency:o,q:u,drive:E}),se=he.parameters.get("frequency")):(he=l.createBiquadFilter(),he.type=a,he.Q.value=u,he.frequency.value=o,se=he.frequency),(d??f??p??g??b)!==void 0){b=nanFallback(b,1,!0),A=nanFallback(A,0,!0);const oe=Math.abs(b),me=oe*A;let _e=clamp(2**-me*o,0,2e4),ke=clamp(2**(oe-me)*o,0,2e4);return b<0&&([_e,ke]=[ke,_e]),getParamADSR(se,L,U,Z,re,_e,ke,O,S,R),he}return he}let wetfade=l=>l<.5?1:1-(l-.5)/.5;function drywet(l,a,o=0){const u=getAudioContext();if(!o)return l;let d=u.createGain(),f=u.createGain();l.connect(d),a.connect(f),d.gain.value=wetfade(o),f.gain.value=wetfade(1-o);let p=u.createGain();return d.connect(p),f.connect(p),p}let curves=["linear","exponential"];function getPitchEnvelope(l,a,o,u){if(!(a.pattack??a.pdecay??a.psustain??a.prelease??a.penv))return;const f=nanFallback(a.penv,1,!0),p=curves[a.pcurve??0];let[g,b,O,S]=getADSRValues([a.pattack,a.pdecay,a.psustain,a.prelease],p,[.2,.001,1,.001]),A=a.panchor??O;const M=f*100,E=0-M*A,R=M-M*A;getParamADSR(l,g,b,O,S,E,R,o,u,p)}function getVibratoOscillator(l,a,o){const{vibmod:u=.5,vib:d}=a;let f;if(d>0){f=getAudioContext().createOscillator(),f.frequency.value=d;const p=getAudioContext().createGain();return p.gain.value=u*100,f.connect(p),p.connect(l),f.start(o),f}}function webAudioTimeout(l,a,o,u){const d=new ConstantSourceNode(l);return d.start(o),d.stop(u),d.onended=()=>{a()},d}const mod$2=(l,a=1,o="sine")=>{const u=getAudioContext();let d;noises.includes(o)?(d=u.createBufferSource(),d.buffer=getNoiseBuffer(o,2),d.loop=!0):(d=u.createOscillator(),d.type=o,d.frequency.value=l),d.start();const f=new GainNode(u,{gain:a});return d.connect(f),{node:f,stop:p=>d.stop(p)}},fm=(l,a,o,u="sine")=>{const f=l.value*a,p=f*o;return mod$2(f,p,u)};function applyFM(l,a,o){const{fmh:u=1,fmi:d,fmenv:f="exp",fmattack:p,fmdecay:g,fmsustain:b,fmrelease:O,fmvelocity:S,fmwave:A="sine",duration:M}=a;let E,R=()=>{};if(d){const U=getAudioContext().createGain(),Z=fm(l,u,d,A);if(E=Z.node,R=Z.stop,![p,g,b,O,S].some(re=>re!==void 0))E.connect(l);else{const[re,he,se,ee]=getADSRValues([p,g,b,O]),oe=o+M;getParamADSR(U.gain,re,he,se,ee,0,1,o,oe,f==="exp"?"exponential":"linear"),E.connect(U),U.connect(l)}}return{stop:R}}let listenerQueue=[],lqIndex=0;const QUEUE_ITEMS_PER_LISTENER=4;let atom=l=>{let a=[],o={get(){return o.lc||o.listen(()=>{})(),o.value},lc:0,listen(u){return o.lc=a.push(u),()=>{for(let f=lqIndex+QUEUE_ITEMS_PER_LISTENER;f<listenerQueue.length;)listenerQueue[f]===u?listenerQueue.splice(f,QUEUE_ITEMS_PER_LISTENER):f+=QUEUE_ITEMS_PER_LISTENER;let d=a.indexOf(u);~d&&(a.splice(d,1),--o.lc||o.off())}},notify(u,d){let f=!listenerQueue.length;for(let p of a)listenerQueue.push(p,o.value,u,d);if(f){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(u){let d=o.value;d!==u&&(o.value=u,o.notify(d))},subscribe(u){let d=o.listen(u);return u(o.value),d},value:l};return o};const MOUNT=5,UNMOUNT=6,REVERT_MUTATION=10;let on$1=(l,a,o,u)=>(l.events=l.events||{},l.events[o+REVERT_MUTATION]||(l.events[o+REVERT_MUTATION]=u(d=>{l.events[o].reduceRight((f,p)=>(p(f),f),{shared:{},...d})})),l.events[o]=l.events[o]||[],l.events[o].push(a),()=>{let d=l.events[o],f=d.indexOf(a);d.splice(f,1),d.length||(delete l.events[o],l.events[o+REVERT_MUTATION](),delete l.events[o+REVERT_MUTATION])}),STORE_UNMOUNT_DELAY=1e3,onMount=(l,a)=>on$1(l,u=>{let d=a(u);d&&l.events[UNMOUNT].push(d)},MOUNT,u=>{let d=l.listen;l.listen=(...p)=>(!l.lc&&!l.active&&(l.active=!0,u()),d(...p));let f=l.off;return l.events[UNMOUNT]=[],l.off=()=>{f(),setTimeout(()=>{if(l.active&&!l.lc){l.active=!1;for(let p of l.events[UNMOUNT])p();l.events[UNMOUNT]=[]}},STORE_UNMOUNT_DELAY)},()=>{l.listen=d,l.off=f}}),map=(l={})=>{let a=atom(l);return a.setKey=function(o,u){let d=a.value;typeof u>"u"&&o in a.value?(a.value={...a.value},delete a.value[o],a.notify(d,o)):a.value[o]!==u&&(a.value={...a.value,[o]:u},a.notify(d,o))},a};const bufferCache$1={},loadCache$2={},getCachedBuffer=l=>bufferCache$1[l];function humanFileSize(l,a){var o=1024;if(l<o)return l+" B";var u=["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],d=-1;do l/=o,++d;while(l>=o);return l.toFixed(1)+" "+u[d]}function getSampleInfo(l,a){const{s:o,n:u=0,speed:d=1}=l;let f=valueToMidi(l,36),p=f-36,g,b=0;if(Array.isArray(a))b=getSoundIndex(u,a.length),g=a[b];else{const A=E=>noteToMidi(E)-f,M=Object.keys(a).filter(E=>!E.startsWith("_")).reduce((E,R,L)=>!E||Math.abs(A(R))<Math.abs(A(E))?R:E,null);p=-A(M),b=getSoundIndex(u,a[M].length),g=a[M][b]}const O=`${o}:${b}`;let S=Math.abs(d)*Math.pow(2,p/12);return{transpose:p,sampleUrl:g,index:b,midi:f,label:O,playbackRate:S}}const getSampleBuffer=async(l,a,o)=>{let{sampleUrl:u,label:d,playbackRate:f}=getSampleInfo(l,a);o&&(u=await o(u));const p=getAudioContext(),g=await loadBuffer(u,p,d);return l.unit==="c"&&(f=f*g.duration),{buffer:g,playbackRate:f}},getSampleBufferSource=async(l,a,o)=>{let{buffer:u,playbackRate:d}=await getSampleBuffer(l,a,o);l.speed<0&&(u=reverseBuffer(u));const p=getAudioContext().createBufferSource();p.buffer=u,p.playbackRate.value=d;const{s:g,loopBegin:b=0,loopEnd:O=1,begin:S=0,end:A=1}=l,M=S*p.buffer.duration;(g.startsWith("wt_")?1:l.loop)&&(p.loop=!0,p.loopStart=b*p.buffer.duration-M,p.loopEnd=O*p.buffer.duration-M);const R=p.buffer.duration/p.playbackRate.value,L=(A-S)*R;return{bufferSource:p,offset:M,bufferDuration:R,sliceDuration:L}},loadBuffer=(l,a,o,u=0)=>{const d=o?`sound "${o}:${u}"`:"sample";if(l=l.replace("#","%23"),!loadCache$2[l]){logger$1(`[sampler] load ${d}..`,"load-sample",{url:l});const f=Date.now();loadCache$2[l]=fetch(l).then(p=>p.arrayBuffer()).then(async p=>{const g=Date.now()-f,b=humanFileSize(p.byteLength);logger$1(`[sampler] load ${d}... done! loaded ${b} in ${g}ms`,"loaded-sample",{url:l});const O=await a.decodeAudioData(p);return bufferCache$1[l]=O,O})}return loadCache$2[l]};function reverseBuffer(l){const a=getAudioContext(),o=a.createBuffer(l.numberOfChannels,l.length,a.sampleRate);for(let u=0;u<l.numberOfChannels;u++)o.copyToChannel(l.getChannelData(u).slice().reverse(),u,u);return o}const getLoadedBuffer=l=>bufferCache$1[l];function resolveSpecialPaths(l){if(l.startsWith("bubo:")){const[a,o]=l.split(":");l=`github:Bubobubobubobubo/dough-${o}`}return l}function githubPath$1(l,a=""){if(!l.startsWith("github:"))throw new Error('expected "github:" at the start of pseudoUrl');let[o,u]=l.split("github:");return u=u.endsWith("/")?u.slice(0,-1):u,u.split("/").length===2&&(u+="/main"),`https://raw.githubusercontent.com/${u}/${a}`}const processSampleMap=(l,a,o=l._base||"")=>Object.entries(l).forEach(([u,d])=>{if(typeof d=="string"&&(d=[d]),typeof d!="object")throw new Error("wrong sample map format for "+u);o=d._base||o,o=resolveSpecialPaths(o),o.startsWith("github:")&&(o=githubPath$1(o,""));const f=p=>o+p;Array.isArray(d)?d=d.map(f):d=Object.fromEntries(Object.entries(d).map(([p,g])=>[p,(typeof g=="string"?[g]:g).map(f)])),a(u,d)});let resourcePrefixHandlers={};function registerSamplesPrefix(l,a){resourcePrefixHandlers[l]=a}function getSamplesPrefixHandler(l){const a=Object.entries(resourcePrefixHandlers).find(([o])=>l.startsWith(o));if(a)return a[1]}const samples=async(l,a=l._base||"",o={})=>{if(typeof l=="string"){const f=getSamplesPrefixHandler(l);if(f)return f(l);if(l=resolveSpecialPaths(l),l.startsWith("github:")&&(l=githubPath$1(l,"strudel.json")),l.startsWith("local:")&&(l="http://localhost:5432"),l.startsWith("shabda:")){let[g,b]=l.split("shabda:");l=`https://shabda.ndre.gr/${b}.json?strudel=1`}if(l.startsWith("shabda/speech")){let[g,b]=l.split("shabda/speech");b=b.startsWith("/")?b.substring(1):b;let[O,S]=b.split(":"),A="f",M="en-GB";O&&([M,A]=O.split("/")),l=`https://shabda.ndre.gr/speech/${S}.json?gender=${A}&language=${M}&strudel=1'`}if(typeof fetch!="function")return;const p=l.split("/").slice(0,-1).join("/");return typeof fetch>"u"?void 0:fetch(l).then(g=>g.json()).then(g=>samples(g,a||g._base||p,o)).catch(g=>{throw console.error(g),new Error(`error loading "${l}"`)})}const{prebake:u,tag:d}=o;processSampleMap(l,(f,p)=>registerSound(f,(g,b,O)=>onTriggerSample(g,b,O,p),{type:"sample",samples:p,baseUrl:a,prebake:u,tag:d}),a)},cutGroups=[];async function onTriggerSample(l,a,o,u,d){let{s:f,nudge:p=0,cut:g,loop:b,clip:O=void 0,n:S=0,speed:A=1,duration:M}=a;if(A===0)return;const E=getAudioContext();let[R,L,U,Z]=getADSRValues([a.attack,a.decay,a.sustain,a.release]);const{bufferSource:re,sliceDuration:he,offset:se}=await getSampleBufferSource(a,u,d);if(E.currentTime>l){logger$1(`[sampler] still loading sound "${f}:${S}"`,"highlight");return}if(!re){logger$1(`[sampler] could not load "${f}:${S}"`,"error");return}let ee=getVibratoOscillator(re.detune,a,l);const oe=l+p;re.start(oe,se);const me=E.createGain(),_e=re.connect(me);O==null&&b==null&&a.release==null&&(M=he);let ke=l+M;getParamADSR(_e.gain,R,L,U,Z,0,1,l,ke,"linear"),getPitchEnvelope(re.detune,a,l,ke);const Oe=E.createGain();_e.connect(Oe),re.onended=function(){re.disconnect(),ee?.stop(),_e.disconnect(),Oe.disconnect(),o()};let Te=ke+Z+.01;re.stop(Te);const Ae={node:Oe,bufferSource:re,stop:Ge=>{re.stop(Ge)}};if(g!==void 0){const Ge=cutGroups[g];Ge&&(Ge.node.gain.setValueAtTime(1,oe),Ge.node.gain.linearRampToValueAtTime(0,oe+.01)),cutGroups[g]=Ae}return Ae}const DEFAULT_MAX_POLYPHONY=128,DEFAULT_AUDIO_DEVICE_NAME="System Standard";let maxPolyphony=DEFAULT_MAX_POLYPHONY;function setMaxPolyphony(l){maxPolyphony=parseInt(l)??DEFAULT_MAX_POLYPHONY}let multiChannelOrbits=!1;function setMultiChannelOrbits(l){multiChannelOrbits=l==!0}function getModulationShapeInput(l){return typeof l=="number"?l%5:{tri:0,triangle:0,sine:1,ramp:2,saw:3,square:4}[l]??0}const soundMap=map();function registerSound(l,a,o={}){l=l.toLowerCase().replace(/\s+/g,"_"),soundMap.setKey(l,{onTrigger:a,data:o})}let gainCurveFunc=l=>l;function applyGainCurve(l){return gainCurveFunc(l)}function setGainCurve(l){gainCurveFunc=l}function aliasBankMap(l){for(const o in l)l[o.toLowerCase()]=l[o];const a=soundMap.get();for(const o in a){const[u,d]=o.split("_");if(!d)continue;const f=l[u];if(f){if(typeof f=="string")a[`${f}_${d}`.toLowerCase()]=a[o];else if(Array.isArray(f))for(const p of f)a[`${p}_${d}`.toLowerCase()]=a[o]}}soundMap.set({...a})}async function aliasBankPath(l){const o=await(await fetch(l)).json();aliasBankMap(o)}async function aliasBank(...l){switch(l.length){case 1:return typeof l[0]=="string"?aliasBankPath(l[0]):aliasBankMap(l[0]);case 2:return aliasBankMap({[l[0]]:l[1]});default:throw new Error("aliasMap expects 1 or 2 arguments, received "+l.length)}}function getSound(l){return typeof l!="string"?(console.warn(`getSound: expected string got "${l}". fall back to triangle`),soundMap.get().triangle):soundMap.get()[l.toLowerCase()]}const getAudioDevices=async()=>{await navigator.mediaDevices.getUserMedia({audio:!0});let l=await navigator.mediaDevices.enumerateDevices();l=l.filter(o=>o.kind==="audiooutput"&&o.deviceId!=="default");const a=new Map;return a.set(DEFAULT_AUDIO_DEVICE_NAME,""),l.forEach(o=>{a.set(o.label,o.deviceId)}),a};let defaultDefaultValues={s:"triangle",gain:.8,postgain:1,density:".03",ftype:"12db",fanchor:0,resonance:1,hresonance:1,bandq:1,channels:[1,2],phaserdepth:.75,shapevol:1,distortvol:1,delay:0,byteBeatExpression:"0",delayfeedback:.5,delaysync:3/16,orbit:1,i:1,velocity:1,fft:8};const defaultDefaultDefaultValues=Object.freeze({...defaultDefaultValues});function setDefault(l,a){defaultDefaultValues[l]=a}function resetDefaults(){defaultDefaultValues={...defaultDefaultDefaultValues}}let defaultControls=new Map(Object.entries(defaultDefaultValues));function setDefaultValue(l,a){defaultControls.set(l,a)}function getDefaultValue(l){return defaultControls.get(l)}function setDefaultValues(l){Object.keys(l).forEach(a=>{setDefaultValue(a,l[a])})}function resetDefaultValues(){defaultControls=new Map(Object.entries(defaultDefaultValues))}function setVersionDefaults(l){resetDefaultValues(),l==="1.0"&&setDefaultValue("fanchor",.5)}const resetLoadedSounds=()=>soundMap.set({});let audioContext;const setDefaultAudioContext=()=>(audioContext=new AudioContext,audioContext),getAudioContext=()=>audioContext||setDefaultAudioContext();function getAudioContextCurrentTime(){return getAudioContext().currentTime}let workletsLoading;function loadWorklets(){return workletsLoading||(workletsLoading=getAudioContext().audioWorklet.addModule(workletsUrl)),workletsLoading}async function initAudio(l={}){const{disableWorklets:a=!1,maxPolyphony:o,audioDeviceName:u=DEFAULT_AUDIO_DEVICE_NAME,multiChannelOrbits:d=!1}=l;if(setMaxPolyphony(o),setMultiChannelOrbits(d),typeof window>"u")return;const f=getAudioContext();if(u!=null&&u!=DEFAULT_AUDIO_DEVICE_NAME)try{const g=(await getAudioDevices()).get(u),b=(g??"").length>0;f.sinkId!==g&&b&&await f.setSinkId(g),logger$1(`[superdough] Audio Device set to ${u}, it might take a few seconds before audio plays on all output channels`)}catch{logger$1("[superdough] failed to set audio interface","warning")}if(await f.resume(),a){logger$1("[superdough]: AudioWorklets disabled with disableWorklets");return}try{await loadWorklets(),logger$1("[superdough] AudioWorklets loaded")}catch(p){console.warn("could not load AudioWorklet effects",p)}logger$1("[superdough] ready")}let audioReady;async function initAudioOnFirstClick(l){return audioReady||(audioReady=new Promise(a=>{document.addEventListener("click",async function o(){document.removeEventListener("click",o),await initAudio(l),a()})})),audioReady}let channelMerger,destinationGain;function initializeAudioOutput(){const l=getAudioContext(),a=l.destination.maxChannelCount;l.destination.channelCount=a,channelMerger=new ChannelMergerNode(l,{numberOfInputs:l.destination.channelCount}),destinationGain=new GainNode(l),channelMerger.connect(destinationGain),destinationGain.connect(l.destination)}const connectToDestination=(l,a=[0,1])=>{const o=getAudioContext();channelMerger==null&&initializeAudioOutput();const u=new StereoPannerNode(o);l.connect(u);const d=new ChannelSplitterNode(o,{numberOfOutputs:u.channelCount});u.connect(d),a.forEach((f,p)=>{d.connect(channelMerger,p%u.channelCount,f%o.destination.channelCount)})},panic=()=>{destinationGain!=null&&(destinationGain.gain.linearRampToValueAtTime(0,getAudioContext().currentTime+.01),destinationGain=null)};function getDelay(l,a,o,u,d){if(o=clamp(o,0,.98),!orbits[l].delayNode){const p=getAudioContext().createFeedbackDelay(1,a,o);p.start?.(u),connectToOrbit(p,l),orbits[l].delayNode=p}return orbits[l].delayNode.delayTime.value!==a&&orbits[l].delayNode.delayTime.setValueAtTime(a,u),orbits[l].delayNode.feedback.value!==o&&orbits[l].delayNode.feedback.setValueAtTime(o,u),orbits[l].delayNode}function getLfo(l,a,o,u={}){const{shape:d=0,...f}=u,{dcoffset:p=-.5,depth:g=1}=u,b={frequency:1,depth:g,skew:.5,phaseoffset:0,time:a,begin:a,end:o,shape:getModulationShapeInput(d),dcoffset:p,min:p*g,max:p*g+g,curve:1,...f};return getWorklet(l,"lfo-processor",b)}function getPhaser(l,a,o=1,u=.5,d=1e3,f=2e3){const p=getAudioContext(),g=getLfo(p,l,a,{frequency:o,depth:f*2}),b=2;let O=0;const S=[];for(let A=0;A<b;A++){const M=p.createBiquadFilter();M.type="notch",M.gain.value=1,M.frequency.value=d+O,M.Q.value=2-Math.min(Math.max(u*2,0),1.9),g.connect(M.detune),O+=282,A>0&&S[A-1].connect(M),S.push(M)}return S[S.length-1]}function getFilterType(l){l=l??0;const a=["12db","ladder","24db"];return typeof l=="number"?a[Math.floor(_mod(l,a.length))]:l}let orbits={};function connectToOrbit(l,a){orbits[a]==null&&errorLogger(new Error("target orbit does not exist"),"superdough"),l.connect(orbits[a].gain)}function setOrbit(l,a,o){orbits[a]==null&&(orbits[a]={gain:new GainNode(l,{gain:1})},connectToDestination(orbits[a].gain,o))}function duckOrbit(l,a,o,u=.1,d=1){[a].flat().forEach(p=>{if(orbits[p]==null){errorLogger(new Error(`duck target orbit ${p} does not exist`),"superdough");return}webAudioTimeout(l,()=>{orbits[p].gain.gain.cancelScheduledValues(o);const g=orbits[p].gain.gain.value;orbits[p].gain.gain.linearRampToValueAtTime(clamp(1-Math.pow(d,.5),.01,g),o),orbits[p].gain.gain.exponentialRampToValueAtTime(1,o+Math.max(.002,u))},0,o-.01)})}let hasChanged=(l,a)=>l!==void 0&&l!==a;function getReverb(l,a,o,u,d,f){if(!orbits[l].reverbNode){const g=getAudioContext().createReverb(a,o,u,d,f);connectToOrbit(g,l),orbits[l].reverbNode=g}return(hasChanged(a,orbits[l].reverbNode.duration)||hasChanged(o,orbits[l].reverbNode.fade)||hasChanged(u,orbits[l].reverbNode.lp)||hasChanged(d,orbits[l].reverbNode.dim)||orbits[l].reverbNode.ir!==f)&&orbits[l].reverbNode.generate(a,o,u,d,f),orbits[l].reverbNode}let analysers={},analysersData={};function getAnalyserById(l,a=1024,o=.5){if(!analysers[l]){const u=getAudioContext().createAnalyser();u.fftSize=a,u.smoothingTimeConstant=o,analysers[l]=u,analysersData[l]=new Float32Array(analysers[l].frequencyBinCount)}return analysers[l].fftSize!==a&&(analysers[l].fftSize=a,analysersData[l]=new Float32Array(analysers[l].frequencyBinCount)),analysers[l]}function getAnalyzerData(l="time",a=1){const o={time:()=>analysers[a]?.getFloatTimeDomainData(analysersData[a]),frequency:()=>analysers[a]?.getFloatFrequencyData(analysersData[a])}[l];if(!o)throw new Error(`getAnalyzerData: ${l} not supported. use one of ${Object.keys(o).join(", ")}`);return o(),analysersData[a]}function effectSend(l,a,o){const u=gainNode(o);return l.connect(u),u.connect(a),u}function resetGlobalEffects(){orbits={},analysers={},analysersData={}}let activeSoundSources=new Map;function mapChannelNumbers(l){return(Array.isArray(l)?l:[l]).map(a=>a-1)}const superdough=async(l,a,o,u=.5,d=.5)=>{const f=getAudioContext();let{stretch:p}=l;if(p!=null&&(a=a-.04),typeof l!="object")throw new Error(`expected hap.value to be an object, but got "${l}". Hint: append .note() or .s() to the end`,"error");if(l.duration=o,a<f.currentTime){console.warn(`[superdough]: cannot schedule sounds in the past (target: ${a.toFixed(2)}, now: ${f.currentTime.toFixed(2)})`);return}let{tremolo:g,tremolosync:b,tremolodepth:O=1,tremoloskew:S,tremolophase:A=0,tremoloshape:M,s:E=getDefaultValue("s"),bank:R,source:L,gain:U=getDefaultValue("gain"),postgain:Z=getDefaultValue("postgain"),density:re=getDefaultValue("density"),duckorbit:he,duckattack:se,duckdepth:ee,fanchor:oe=getDefaultValue("fanchor"),drive:me=.69,release:_e=0,cutoff:ke,lpenv:Oe,lpattack:Te,lpdecay:Ce,lpsustain:Ae,lprelease:Ge,resonance:Ne=getDefaultValue("resonance"),hpenv:Qe,hcutoff:Ee,hpattack:je,hpdecay:Ye,hpsustain:Ke,hprelease:Ve,hresonance:$e=getDefaultValue("hresonance"),bpenv:ze,bandf:it,bpattack:mt,bpdecay:Je,bpsustain:xt,bprelease:ot,bandq:kt=getDefaultValue("bandq"),phaserrate:zt,phaserdepth:Wt=getDefaultValue("phaserdepth"),phasersweep:vt,phasercenter:Pt,coarse:At,crush:Ft,dry:Xt,shape:Yt,shapevol:Jt=getDefaultValue("shapevol"),distort:qt,distortvol:$t=getDefaultValue("distortvol"),pan:an,vowel:tn,delay:Lt=getDefaultValue("delay"),delayfeedback:ln=getDefaultValue("delayfeedback"),delaysync:rt=getDefaultValue("delaysync"),delaytime:Ot,orbit:Ie=getDefaultValue("orbit"),room:wt,roomfade:nt,roomlp:gn,roomdim:_n,roomsize:Ht,ir:cn,i:ct=getDefaultValue("i"),velocity:ut=getDefaultValue("velocity"),analyze:bt,fft:Nt=getDefaultValue("fft"),compressor:pt,compressorRatio:Rt,compressorKnee:Ct,compressorAttack:nn,compressorRelease:bn}=l;Ot=Ot??cycleToSeconds(rt,u);const vn=mapChannelNumbers(multiChannelOrbits&&Ie>0?[Ie*2-1,Ie*2]:getDefaultValue("channels")),yn=l.channels!=null?mapChannelNumbers(l.channels):vn;setOrbit(f,Ie,yn),he!=null&&duckOrbit(f,he,a,se,ee),U=applyGainCurve(nanFallback(U,1)),Z=applyGainCurve(Z),Jt=applyGainCurve(Jt),$t=applyGainCurve($t),Lt=applyGainCurve(Lt),ut=applyGainCurve(ut),O=applyGainCurve(O),U*=ut;const N=a+o,K=N+_e,q=Math.round(Math.random()*1e6);for(let Xe=0;Xe<=activeSoundSources.size-maxPolyphony;Xe++){const Dt=activeSoundSources.entries().next(),It=Dt.value[1],jt=Dt.value[0],Ut=a+.25;It?.node?.gain?.linearRampToValueAtTime(0,Ut),It?.stop?.(Ut),activeSoundSources.delete(jt)}let z=[];if(["-","~","_"].includes(E))return;R&&E&&(E=`${R}_${E}`,l.s=E);let fe;if(L)fe=L(a,l,o,u);else if(getSound(E)){const{onTrigger:Xe}=getSound(E),It=await Xe(a,l,()=>{z.forEach(jt=>jt?.disconnect()),activeSoundSources.delete(q)});It&&(fe=It.node,activeSoundSources.set(q,It))}else throw new Error(`sound ${E} not found! Is it loaded?`);if(!fe)return;if(f.currentTime>a){logger$1("[webaudio] skip hap: still loading",f.currentTime-a);return}const we=[];we.push(fe),p!==void 0&&we.push(getWorklet(f,"phase-vocoder-processor",{pitchFactor:p})),we.push(gainNode(U));const De=getFilterType(l.ftype);if(ke!==void 0){let Xe=()=>createFilter(f,"lowpass",ke,Ne,Te,Ce,Ae,Ge,Oe,a,N,oe,De,me);we.push(Xe()),De==="24db"&&we.push(Xe())}if(Ee!==void 0){let Xe=()=>createFilter(f,"highpass",Ee,$e,je,Ye,Ke,Ve,Qe,a,N,oe);we.push(Xe()),De==="24db"&&we.push(Xe())}if(it!==void 0){let Xe=()=>createFilter(f,"bandpass",it,kt,mt,Je,xt,ot,ze,a,N,oe);we.push(Xe()),De==="24db"&&we.push(Xe())}if(tn!==void 0){const Xe=f.createVowelFilter(tn);we.push(Xe)}if(At!==void 0&&we.push(getWorklet(f,"coarse-processor",{coarse:At})),Ft!==void 0&&we.push(getWorklet(f,"crush-processor",{crush:Ft})),Yt!==void 0&&we.push(getWorklet(f,"shape-processor",{shape:Yt,postgain:Jt})),qt!==void 0&&we.push(getWorklet(f,"distort-processor",{distort:qt,postgain:$t})),b!=null&&(g=u*b),g!==void 0){const Xe=Math.max(1-O,0),Dt=new GainNode(f,{gain:Xe}),It=d/u;getLfo(f,a,K,{skew:S??(M!=null?.5:1),frequency:g,depth:O,time:It,dcoffset:0,shape:M,phaseoffset:A,min:0,max:1,curve:1.5}).connect(Dt.gain),we.push(Dt)}if(pt!==void 0&&we.push(getCompressor(f,pt,Rt,Ct,nn,bn)),an!==void 0){const Xe=f.createStereoPanner();Xe.pan.value=2*an-1,we.push(Xe)}if(zt!==void 0&&Wt>0){const Xe=getPhaser(a,K,zt,Wt,Pt,vt);we.push(Xe)}const Be=new GainNode(f,{gain:Z});we.push(Be);let Le;if(Lt>0&&Ot>0&&ln>0){const Xe=getDelay(Ie,Ot,ln,a);Le=effectSend(Be,Xe,Lt),z.push(Le)}let st;if(wt>0){let Xe;if(cn!==void 0){let It,jt=getSound(cn);Array.isArray(jt)?It=jt.data.samples[ct%jt.data.samples.length]:typeof jt=="object"&&(It=Object.values(jt.data.samples).flat()[ct%Object.values(jt.data.samples).length]),Xe=await loadBuffer(It,f,cn,0)}const Dt=getReverb(Ie,Ht,nt,gn,_n,Xe);st=effectSend(Be,Dt,wt),z.push(st)}let St;if(bt){const Xe=getAnalyserById(bt,2**(Nt+5));St=effectSend(Be,Xe,1),z.push(St)}if(Xt!=null){Xt=applyGainCurve(Xt);const Xe=new GainNode(f,{gain:Xt});we.push(Xe),connectToOrbit(Xe,Ie)}else connectToOrbit(Be,Ie);we.slice(1).reduce((Xe,Dt)=>Xe.connect(Dt),we[0]),z=z.concat(we)},superdoughTrigger=(l,a,o,u)=>{superdough(a,l-o,a.duration/u,u)},getFrequencyFromValue=(l,a=36)=>{let{note:o,freq:u}=l;return o=o||a,typeof o=="string"&&(o=noteToMidi(o)),!u&&typeof o=="number"&&(u=midiToFreq$1(o)),Number(u)};function destroyAudioWorkletNode(l){l!=null&&(l.disconnect(),l.parameters.get("end")?.setValueAtTime(0,0))}const waveforms=["triangle","square","sawtooth","sine"],waveformAliases=[["tri","triangle"],["sqr","square"],["saw","sawtooth"],["sin","sine"]];function makeSaturationCurve(l,a){const o=l,u=new Float32Array(a);for(let d=0;d<a;d++){const f=d*2/a-1;u[d]=Math.tanh(f*o)}return u}function registerSynthSounds(){[...waveforms].forEach(l=>{registerSound(l,(a,o,u)=>{const[d,f,p,g]=getADSRValues([o.attack,o.decay,o.sustain,o.release],"linear",[.001,.05,.6,.01]);let b=getOscillator(l,a,o),{node:O,stop:S,triggerRelease:A}=b;const M=gainNode(.3),{duration:E}=o;O.onended=()=>{O.disconnect(),M.disconnect(),u()};const R=gainNode(1);let L=O.connect(M).connect(R);const U=a+E;getParamADSR(L.gain,d,f,p,g,0,1,a,U,"linear");const Z=U+g+.01;return A?.(Z),S(Z),{node:L,stop:re=>{S(re)}}},{type:"synth",prebake:!0})}),registerSound("sbd",(l,a,o)=>{const{duration:u,decay:d=.5,pdecay:f=.5,penv:p=36,clip:g}=a,b=getAudioContext(),O=.02,S=1.2,A=.025,M=1,E=b.createOscillator();E.type="triangle",E.frequency.value=getFrequencyFromValue(a,29),E.detune.setValueAtTime(p*100,0),E.detune.setValueAtTime(p*100,l),E.detune.exponentialRampToValueAtTime(.001,l+f);const R=gainNode(1);R.gain.setValueAtTime(1,l+O),R.gain.exponentialRampToValueAtTime(.001,l+O+d),E.start(l);const L=getNoiseOscillator("brown",l,2),U=gainNode(1);U.gain.setValueAtTime(S,l),U.gain.exponentialRampToValueAtTime(.001,l+A);const Z=new WaveShaperNode(b);Z.curve=makeSaturationCurve(2,b.sampleRate);const re=gainNode(M);E.onended=()=>{E.disconnect(),R.disconnect(),Z.disconnect(),L.node.disconnect(),U.disconnect(),re.disconnect(),o()};const he=E.connect(Z).connect(R).connect(re);L.node.connect(U).connect(re);let ee=l+d+.01;return g!=null&&(ee=Math.min(l+g*u,ee)),re.gain.setValueAtTime(M,ee-.01),re.gain.linearRampToValueAtTime(0,ee),E.stop(ee),L.stop(ee),{node:he,stop:oe=>{E.stop(oe)}}},{type:"synth",prebake:!0}),registerSound("supersaw",(l,a,o)=>{const u=getAudioContext();let{duration:d,n:f,unison:p=5,spread:g=.6,detune:b}=a;b=b??f??.18;const O=getFrequencyFromValue(a),[S,A,M,E]=getADSRValues([a.attack,a.decay,a.sustain,a.release],"linear",[.001,.05,.6,.01]),R=l+d,L=R+E+.01,U=clamp(p,1,100);let Z=U>1?clamp(g,0,1):0,re=getWorklet(u,"supersaw-oscillator",{frequency:O,begin:l,end:L,freqspread:b,voices:U,panspread:Z},{outputChannelCount:[2]});const he=1/Math.sqrt(U);getPitchEnvelope(re.parameters.get("detune"),a,l,R);const se=getVibratoOscillator(re.parameters.get("detune"),a,l),ee=applyFM(re.parameters.get("frequency"),a,l);let oe=gainNode(1);oe=re.connect(oe),getParamADSR(oe.gain,S,A,M,E,0,.3*he,l,R,"linear");let me=webAudioTimeout(u,()=>{destroyAudioWorkletNode(re),oe.disconnect(),o(),ee?.stop(),se?.stop()},l,L);return{node:oe,stop:_e=>{me.stop(_e)}}},{prebake:!0,type:"synth"}),registerSound("bytebeat",(l,a,o)=>{const u=["(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:d=0}=a,f=getFrequencyFromValue(a),{byteBeatExpression:p=u[d%u.length],byteBeatStartTime:g}=a,b=getAudioContext();let{duration:O}=a;const[S,A,M,E]=getADSRValues([a.attack,a.decay,a.sustain,a.release],"linear",[.001,.05,.6,.01]),R=l+O,L=R+E+.01;let U=getWorklet(b,"byte-beat-processor",{frequency:f,begin:l,end:L},{outputChannelCount:[2]});U.port.postMessage({codeText:p,byteBeatStartTime:g,frequency:f});let Z=gainNode(1);Z=U.connect(Z),getParamADSR(Z.gain,S,A,M,E,0,1,l,R,"linear");let re=webAudioTimeout(b,()=>{destroyAudioWorkletNode(U),Z.disconnect(),o()},l,L);return{node:Z,stop:he=>{re.stop(he)}}},{prebake:!0,type:"synth"}),registerSound("pulse",(l,a,o)=>{const u=getAudioContext();let{pwrate:d,pwsweep:f}=a;f==null&&(d!=null?f=.3:f=0),d==null&&f!=null&&(d=1);let{duration:p,pw:g=.5}=a;const b=getFrequencyFromValue(a),[O,S,A,M]=getADSRValues([a.attack,a.decay,a.sustain,a.release],"linear",[.001,.05,.6,.01]),E=l+p,R=E+M+.01;let L=getWorklet(u,"pulse-oscillator",{frequency:b,begin:l,end:R,pulsewidth:g},{outputChannelCount:[2]});getPitchEnvelope(L.parameters.get("detune"),a,l,E);const U=getVibratoOscillator(L.parameters.get("detune"),a,l),Z=applyFM(L.parameters.get("frequency"),a,l);let re=gainNode(1);re=L.connect(re),getParamADSR(re.gain,O,S,A,M,0,1,l,E,"linear");let he;f!=0&&(he=getLfo(u,l,R,{frequency:d,depth:f}),he.connect(L.parameters.get("pulsewidth")));let se=webAudioTimeout(u,()=>{destroyAudioWorkletNode(L),destroyAudioWorkletNode(he),re.disconnect(),o(),Z?.stop(),U?.stop()},l,R);return{node:re,stop:ee=>{se.stop(ee)}}},{prebake:!0,type:"synth"}),[...noises].forEach(l=>{registerSound(l,(a,o,u)=>{const[d,f,p,g]=getADSRValues([o.attack,o.decay,o.sustain,o.release],"linear",[.001,.05,.6,.01]);let b,{density:O}=o;b=getNoiseOscillator(l,a,O);let{node:S,stop:A,triggerRelease:M}=b;const E=gainNode(.3),{duration:R}=o;S.onended=()=>{S.disconnect(),E.disconnect(),u()};const L=gainNode(1);let U=S.connect(E).connect(L);const Z=a+R;getParamADSR(U.gain,d,f,p,g,0,1,a,Z,"linear");const re=Z+g+.01;return M?.(re),A(re),{node:U,stop:he=>{A(he)}}},{type:"synth",prebake:!0})}),waveformAliases.forEach(([l,a])=>soundMap.set({...soundMap.get(),[l]:soundMap.get()[a]}))}function waveformN(l,a){const o=new Float32Array(l+1),u=new Float32Array(l+1),d=getAudioContext(),f=d.createOscillator(),p={sawtooth:O=>[0,-1/O],square:O=>[0,O%2===0?0:1/O],triangle:O=>[O%2===0?0:1/(O*O),0]};if(!p[a])throw new Error(`unknown wave type ${a}`);o[0]=0,u[0]=0;let g=1;for(;g<=l;){const[O,S]=p[a](g);o[g]=O,u[g]=S,g++}const b=d.createPeriodicWave(o,u);return f.setPeriodicWave(b),f}function getOscillator(l,a,o){let{n:u,duration:d,noise:f=0}=o,p;!u||l==="sine"?(p=getAudioContext().createOscillator(),p.type=l||"triangle"):p=waveformN(u,l),p.frequency.value=getFrequencyFromValue(o),p.start(a);let g=getVibratoOscillator(p.detune,o,a);getPitchEnvelope(p.detune,o,a,a+d);const b=applyFM(p.frequency,o,a);let O;return f&&(O=getNoiseMix(p,f,a)),{node:O?.node||p,stop:S=>{b.stop(S),g?.stop(S),O?.stop(S),p.stop(S)},triggerRelease:S=>{}}}function buildSamples(l=1,a=.05,o=220,u=0,d=0,f=.1,p=0,g=1,b=0,O=0,S=0,A=0,M=0,E=0,R=0,L=0,U=0,Z=1,re=0,he=0){let se=Math.PI*2,ee=getAudioContext().sampleRate,oe=Ye=>Ye>0?1:-1,me=b*=500*se/ee/ee,_e=o*=(1+a*2*Math.random()-a)*se/ee,ke=[],Oe=0,Te=0,Ce=0,Ae=1,Ge=0,Ne=0,Qe=0,Ee,je;for(u=u*ee+9,re*=ee,d*=ee,f*=ee,U*=ee,O*=500*se/ee**3,R*=se/ee,S*=se/ee,A*=ee,M=M*ee|0,je=u+re+d+f+U|0;Ce<je;ke[Ce++]=Qe)++Ne%(L*100|0)||(Qe=p?p>1?p>2?p>3?Math.sin((Oe%se)**3):Math.max(Math.min(Math.tan(Oe),1),-1):1-(2*Oe/se%2+2)%2:1-4*Math.abs(Math.round(Oe/se)-Oe/se):Math.sin(Oe),Qe=(M?1-he+he*Math.sin(se*Ce/M):1)*oe(Qe)*Math.abs(Qe)**g*l*1*(Ce<u?Ce/u:Ce<u+re?1-(Ce-u)/re*(1-Z):Ce<u+re+d?Z:Ce<je-U?(je-Ce-U)/f*Z:0),Qe=U?Qe/2+(U>Ce?0:(Ce<je-U?1:(je-Ce)/U)*ke[Ce-U|0]/2):Qe),Ee=(o+=b+=O)*Math.cos(R*Te++),Oe+=Ee-Ee*E*(1-(Math.sin(Ce)+1)*1e9%2),Ae&&++Ae>A&&(o+=S,_e+=S,Ae=0),M&&!(++Ge%M)&&(o=_e,b=me,Ae||=1);return ke}const getZZFX=(l,a)=>{let{s:o,note:u=36,freq:d,zrand:f=0,attack:p=0,decay:g=0,sustain:b=.8,release:O=.1,curve:S=1,slide:A=0,deltaSlide:M=0,pitchJump:E=0,pitchJumpTime:R=0,lfo:L=0,znoise:U=0,zmod:Z=0,zcrush:re=0,zdelay:he=0,tremolo:se=0,duration:ee=.2,zzfx:oe}=l;const me=Math.max(ee-p-g,0);typeof u=="string"&&(u=noteToMidi(u)),!d&&typeof u=="number"&&(d=midiToFreq$1(u)),o=o.replace("z_","");const _e=["sine","triangle","sawtooth","tan","noise"].indexOf(o)||0;S=o==="square"?0:S;const Oe=buildSamples(...oe||[.25,f,d,p,me,O,_e,S,A,M,E,R,L,U,Z,re,he,b,g,se]),Te=getAudioContext(),Ce=Te.createBuffer(1,Oe.length,Te.sampleRate);Ce.getChannelData(0).set(Oe);const Ae=getAudioContext().createBufferSource();return Ae.buffer=Ce,Ae.start(a),{node:Ae}};function registerZZFXSounds(){["zzfx","z_sine","z_sawtooth","z_triangle","z_square","z_tan","z_noise"].forEach(l=>{registerSound(l,(a,o,u)=>{const{node:d}=getZZFX({s:l,...o},a);return d.onended=()=>{d.disconnect(),u()},{node:d,stop:()=>{}}},{type:"synth",prebake:!0})})}let worklet;async function dspWorklet(l,a){const o=`dsp-worklet-${Date.now()}`,u=`${a}
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('${o}', MyProcessor);
`,f=`data:text/javascript;base64,${btoa(u)}`;await l.audioWorklet.addModule(f);const p=new AudioWorkletNode(l,o);return{node:p,stop:()=>p.port.postMessage("stop")}}const stop=()=>{worklet&&(worklet?.stop(),worklet?.node?.disconnect())};typeof window<"u"&&window.addEventListener("message",l=>{l.data==="strudel-stop"?stop():l.data?.dough&&worklet?.node.port.postMessage(l.data)});const dough=async l=>{const a=getAudioContext();stop(),worklet=await dspWorklet(a,l),worklet.node.connect(a.destination)};function doughTrigger(l,a,o,u){window.postMessage({time:u,dough:l.value,currentTime:a,duration:l.duration,cps:o})}const{Pattern,logger,repl}=core;setLogger(logger);const hap2value=l=>(l.ensureObjectValue(),l.value),webaudioOutput=(l,a,o,u,d)=>superdough(hap2value(l),d,o,u,l.whole?.begin.valueOf());function webaudioRepl(l={}){return l={getTime:()=>getAudioContext().currentTime,defaultOutput:webaudioOutput,...l},repl(l)}Pattern.prototype.dough=function(){return this.onTrigger(doughTrigger,1)};function drawTimeScope(l,{align:a=!0,color:o="white",thickness:u=3,scale:d=.25,pos:f=.75,trigger:p=0,ctx:g=getDrawContext(),id:b=1}={}){g.lineWidth=u,g.strokeStyle=o;let O=g.canvas;if(!l){g.beginPath();let L=f*O.height;g.moveTo(0,L),g.lineTo(O.width,L),g.stroke();return}const S=getAnalyzerData("time",b);g.beginPath();const A=l.frequencyBinCount;let M=a?Array.from(S).findIndex((L,U,Z)=>U&&Z[U-1]>-p&&L<=-p):0;M=Math.max(M,0);const E=O.width*1/A;let R=0;for(let L=M;L<A;L++){const U=S[L]+1,Z=(f-d*(U-1))*O.height;L===0?g.moveTo(R,Z):g.lineTo(R,Z),R+=E}g.stroke()}function drawFrequencyScope(l,{color:a="white",scale:o=.25,pos:u=.75,lean:d=.5,min:f=-150,max:p=0,ctx:g=getDrawContext(),id:b=1}={}){if(!l){g.beginPath();let R=u*S.height;g.moveTo(0,R),g.lineTo(S.width,R),g.stroke();return}const O=getAnalyzerData("frequency",b),S=g.canvas;g.fillStyle=a;const A=l.frequencyBinCount,M=S.width*1/A;let E=0;for(let R=0;R<A;R++){const U=clamp$1((O[R]-f)/(p-f),0,1)*o,Z=U*S.height,re=(u-U*d)*S.height;g.fillRect(E,re,Math.max(M,1),Z),E+=M}}function clearScreen(l=0,a="0,0,0",o=getDrawContext()){l?(o.fillStyle=`rgba(${a},${1-l})`,o.fillRect(0,0,o.canvas.width,o.canvas.height)):o.clearRect(0,0,o.canvas.width,o.canvas.height)}Pattern$1.prototype.fscope=function(l={}){let a=l.id??1;return this.analyze(a).draw(()=>{clearScreen(l.smear,"0,0,0",l.ctx),analysers[a]&&drawFrequencyScope(analysers[a],l)},{id:a})},Pattern$1.prototype.tscope=function(l={}){let a=l.id??1;return this.analyze(a).draw(o=>{l.color=o[0]?.value?.color||getTheme().foreground,l.color,clearScreen(l.smear,"0,0,0",l.ctx),drawTimeScope(analysers[a],l)},{id:a})},Pattern$1.prototype.scope=Pattern$1.prototype.tscope;let latestColor={};Pattern$1.prototype.spectrum=function(l={}){let a=l.id??1;return this.analyze(a).draw(o=>{l.color=o[0]?.value?.color||latestColor[a]||getTheme().foreground,latestColor[a]=l.color,drawSpectrum(analysers[a],l)},{id:a})},Pattern$1.prototype.scope=Pattern$1.prototype.tscope;const lastFrames=new Map;function drawSpectrum(l,{thickness:a=3,speed:o=1,min:u=-80,max:d=0,ctx:f=getDrawContext(),id:p=1,color:g}={}){if(f.lineWidth=a,f.strokeStyle=g,!l)return;const b=o,O=getAnalyzerData("frequency",p),S=f.canvas;f.fillStyle=g;const A=l.frequencyBinCount;let M=lastFrames.get(p)||f.getImageData(0,0,S.width,S.height);lastFrames.set(p,M),f.clearRect(0,0,f.canvas.width,f.canvas.height),f.putImageData(M,-b,0);let E=S.width-o;for(let R=0;R<A;R++){const L=clamp$1((O[R]-u)/(d-u),0,1);f.globalAlpha=L;const U=Math.log(R+1)/Math.log(A)*S.height;f.fillRect(E,S.height-U,b,2)}lastFrames.set(p,f.getImageData(0,0,S.width,S.height))}const index$9=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_MAX_POLYPHONY,aliasBank,get analysers(){return analysers},get analysersData(){return analysersData},applyFM,applyGainCurve,connectToDestination,createFilter,dough,doughTrigger,drawFrequencyScope,drawTimeScope,drywet,dspWorklet,errorLogger,gainNode,getADSRValues,getAnalyserById,getAnalyzerData,getAudioContext,getAudioContextCurrentTime,getAudioDevices,getCachedBuffer,getCompressor,getDefaultValue,getLfo,getLoadedBuffer,getOscillator,getParamADSR,getPitchEnvelope,getSampleBuffer,getSampleBufferSource,getSampleInfo,getSound,getVibratoOscillator,getWorklet,getZZFX,initAudio,initAudioOnFirstClick,initializeAudioOutput,loadBuffer,logger:logger$1,noises,onTriggerSample,panic,processSampleMap,registerSamplesPrefix,registerSound,registerSynthSounds,registerZZFXSounds,resetDefaultValues,resetDefaults,resetGlobalEffects,resetLoadedSounds,reverseBuffer,samples,setDefault,setDefaultAudioContext,setDefaultValue,setDefaultValues,setGainCurve,setLogger,setMaxPolyphony,setMultiChannelOrbits,setVersionDefaults,soundMap,superdough,superdoughTrigger,waveformN,webAudioTimeout,webaudioOutput,webaudioRepl},Symbol.toStringTag,{value:"Module"}));let rangeFrom=[],rangeTo=[];(()=>{let l="lc,34,7n,7,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,,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(a=>a?parseInt(a,36):1);for(let a=0,o=0;a<l.length;a++)(a%2?rangeTo:rangeFrom).push(o=o+l[a])})();function isExtendingChar(l){if(l<768)return!1;for(let a=0,o=rangeFrom.length;;){let u=a+o>>1;if(l<rangeFrom[u])o=u;else if(l>=rangeTo[u])a=u+1;else return!0;if(a==o)return!1}}function isRegionalIndicator(l){return l>=127462&&l<=127487}const ZWJ=8205;function findClusterBreak$1(l,a,o=!0,u=!0){return(o?nextClusterBreak:prevClusterBreak)(l,a,u)}function nextClusterBreak(l,a,o){if(a==l.length)return a;a&&surrogateLow$1(l.charCodeAt(a))&&surrogateHigh$1(l.charCodeAt(a-1))&&a--;let u=codePointAt$1(l,a);for(a+=codePointSize$1(u);a<l.length;){let d=codePointAt$1(l,a);if(u==ZWJ||d==ZWJ||o&&isExtendingChar(d))a+=codePointSize$1(d),u=d;else if(isRegionalIndicator(d)){let f=0,p=a-2;for(;p>=0&&isRegionalIndicator(codePointAt$1(l,p));)f++,p-=2;if(f%2==0)break;a+=2}else break}return a}function prevClusterBreak(l,a,o){for(;a>0;){let u=nextClusterBreak(l,a-2,o);if(u<a)return u;a--}return 0}function codePointAt$1(l,a){let o=l.charCodeAt(a);if(!surrogateHigh$1(o)||a+1==l.length)return o;let u=l.charCodeAt(a+1);return surrogateLow$1(u)?(o-55296<<10)+(u-56320)+65536:o}function surrogateLow$1(l){return l>=56320&&l<57344}function surrogateHigh$1(l){return l>=55296&&l<56320}function codePointSize$1(l){return l<65536?1:2}class Text{lineAt(a){if(a<0||a>this.length)throw new RangeError(`Invalid position ${a} in document of length ${this.length}`);return this.lineInner(a,!1,1,0)}line(a){if(a<1||a>this.lines)throw new RangeError(`Invalid line number ${a} in ${this.lines}-line document`);return this.lineInner(a,!0,1,0)}replace(a,o,u){[a,o]=clip(this,a,o);let d=[];return this.decompose(0,a,d,2),u.length&&u.decompose(0,u.length,d,3),this.decompose(o,this.length,d,1),TextNode.from(d,this.length-(o-a)+u.length)}append(a){return this.replace(this.length,this.length,a)}slice(a,o=this.length){[a,o]=clip(this,a,o);let u=[];return this.decompose(a,o,u,0),TextNode.from(u,o-a)}eq(a){if(a==this)return!0;if(a.length!=this.length||a.lines!=this.lines)return!1;let o=this.scanIdentical(a,1),u=this.length-this.scanIdentical(a,-1),d=new RawTextCursor(this),f=new RawTextCursor(a);for(let p=o,g=o;;){if(d.next(p),f.next(p),p=0,d.lineBreak!=f.lineBreak||d.done!=f.done||d.value!=f.value)return!1;if(g+=d.value.length,d.done||g>=u)return!0}}iter(a=1){return new RawTextCursor(this,a)}iterRange(a,o=this.length){return new PartialTextCursor(this,a,o)}iterLines(a,o){let u;if(a==null)u=this.iter();else{o==null&&(o=this.lines+1);let d=this.line(a).from;u=this.iterRange(d,Math.max(d,o==this.lines+1?this.length:o<=1?0:this.line(o-1).to))}return new LineCursor(u)}toString(){return this.sliceString(0)}toJSON(){let a=[];return this.flatten(a),a}constructor(){}static of(a){if(a.length==0)throw new RangeError("A document must have at least one line");return a.length==1&&!a[0]?Text.empty:a.length<=32?new TextLeaf(a):TextNode.from(TextLeaf.split(a,[]))}}class TextLeaf extends Text{constructor(a,o=textLength(a)){super(),this.text=a,this.length=o}get lines(){return this.text.length}get children(){return null}lineInner(a,o,u,d){for(let f=0;;f++){let p=this.text[f],g=d+p.length;if((o?u:g)>=a)return new Line(d,g,u,p);d=g+1,u++}}decompose(a,o,u,d){let f=a<=0&&o>=this.length?this:new TextLeaf(sliceText(this.text,a,o),Math.min(o,this.length)-Math.max(0,a));if(d&1){let p=u.pop(),g=appendText(f.text,p.text.slice(),0,f.length);if(g.length<=32)u.push(new TextLeaf(g,p.length+f.length));else{let b=g.length>>1;u.push(new TextLeaf(g.slice(0,b)),new TextLeaf(g.slice(b)))}}else u.push(f)}replace(a,o,u){if(!(u instanceof TextLeaf))return super.replace(a,o,u);[a,o]=clip(this,a,o);let d=appendText(this.text,appendText(u.text,sliceText(this.text,0,a)),o),f=this.length+u.length-(o-a);return d.length<=32?new TextLeaf(d,f):TextNode.from(TextLeaf.split(d,[]),f)}sliceString(a,o=this.length,u=`
`){[a,o]=clip(this,a,o);let d="";for(let f=0,p=0;f<=o&&p<this.text.length;p++){let g=this.text[p],b=f+g.length;f>a&&p&&(d+=u),a<b&&o>f&&(d+=g.slice(Math.max(0,a-f),o-f)),f=b+1}return d}flatten(a){for(let o of this.text)a.push(o)}scanIdentical(){return 0}static split(a,o){let u=[],d=-1;for(let f of a)u.push(f),d+=f.length+1,u.length==32&&(o.push(new TextLeaf(u,d)),u=[],d=-1);return d>-1&&o.push(new TextLeaf(u,d)),o}}class TextNode extends Text{constructor(a,o){super(),this.children=a,this.length=o,this.lines=0;for(let u of a)this.lines+=u.lines}lineInner(a,o,u,d){for(let f=0;;f++){let p=this.children[f],g=d+p.length,b=u+p.lines-1;if((o?b:g)>=a)return p.lineInner(a,o,u,d);d=g+1,u=b+1}}decompose(a,o,u,d){for(let f=0,p=0;p<=o&&f<this.children.length;f++){let g=this.children[f],b=p+g.length;if(a<=b&&o>=p){let O=d&((p<=a?1:0)|(b>=o?2:0));p>=a&&b<=o&&!O?u.push(g):g.decompose(a-p,o-p,u,O)}p=b+1}}replace(a,o,u){if([a,o]=clip(this,a,o),u.lines<this.lines)for(let d=0,f=0;d<this.children.length;d++){let p=this.children[d],g=f+p.length;if(a>=f&&o<=g){let b=p.replace(a-f,o-f,u),O=this.lines-p.lines+b.lines;if(b.lines<O>>4&&b.lines>O>>6){let S=this.children.slice();return S[d]=b,new TextNode(S,this.length-(o-a)+u.length)}return super.replace(f,g,b)}f=g+1}return super.replace(a,o,u)}sliceString(a,o=this.length,u=`
`){[a,o]=clip(this,a,o);let d="";for(let f=0,p=0;f<this.children.length&&p<=o;f++){let g=this.children[f],b=p+g.length;p>a&&f&&(d+=u),a<b&&o>p&&(d+=g.sliceString(a-p,o-p,u)),p=b+1}return d}flatten(a){for(let o of this.children)o.flatten(a)}scanIdentical(a,o){if(!(a instanceof TextNode))return 0;let u=0,[d,f,p,g]=o>0?[0,0,this.children.length,a.children.length]:[this.children.length-1,a.children.length-1,-1,-1];for(;;d+=o,f+=o){if(d==p||f==g)return u;let b=this.children[d],O=a.children[f];if(b!=O)return u+b.scanIdentical(O,o);u+=b.length+1}}static from(a,o=a.reduce((u,d)=>u+d.length+1,-1)){let u=0;for(let E of a)u+=E.lines;if(u<32){let E=[];for(let R of a)R.flatten(E);return new TextLeaf(E,o)}let d=Math.max(32,u>>5),f=d<<1,p=d>>1,g=[],b=0,O=-1,S=[];function A(E){let R;if(E.lines>f&&E instanceof TextNode)for(let L of E.children)A(L);else E.lines>p&&(b>p||!b)?(M(),g.push(E)):E instanceof TextLeaf&&b&&(R=S[S.length-1])instanceof TextLeaf&&E.lines+R.lines<=32?(b+=E.lines,O+=E.length+1,S[S.length-1]=new TextLeaf(R.text.concat(E.text),R.length+1+E.length)):(b+E.lines>d&&M(),b+=E.lines,O+=E.length+1,S.push(E))}function M(){b!=0&&(g.push(S.length==1?S[0]:TextNode.from(S,O)),O=-1,b=S.length=0)}for(let E of a)A(E);return M(),g.length==1?g[0]:new TextNode(g,o)}}Text.empty=new TextLeaf([""],0);function textLength(l){let a=-1;for(let o of l)a+=o.length+1;return a}function appendText(l,a,o=0,u=1e9){for(let d=0,f=0,p=!0;f<l.length&&d<=u;f++){let g=l[f],b=d+g.length;b>=o&&(b>u&&(g=g.slice(0,u-d)),d<o&&(g=g.slice(o-d)),p?(a[a.length-1]+=g,p=!1):a.push(g)),d=b+1}return a}function sliceText(l,a,o){return appendText(l,[""],a,o)}class RawTextCursor{constructor(a,o=1){this.dir=o,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[a],this.offsets=[o>0?1:(a instanceof TextLeaf?a.text.length:a.children.length)<<1]}nextInner(a,o){for(this.done=this.lineBreak=!1;;){let u=this.nodes.length-1,d=this.nodes[u],f=this.offsets[u],p=f>>1,g=d instanceof TextLeaf?d.text.length:d.children.length;if(p==(o>0?g:0)){if(u==0)return this.done=!0,this.value="",this;o>0&&this.offsets[u-1]++,this.nodes.pop(),this.offsets.pop()}else if((f&1)==(o>0?0:1)){if(this.offsets[u]+=o,a==0)return this.lineBreak=!0,this.value=`
`,this;a--}else if(d instanceof TextLeaf){let b=d.text[p+(o<0?-1:0)];if(this.offsets[u]+=o,b.length>Math.max(0,a))return this.value=a==0?b:o>0?b.slice(a):b.slice(0,b.length-a),this;a-=b.length}else{let b=d.children[p+(o<0?-1:0)];a>b.length?(a-=b.length,this.offsets[u]+=o):(o<0&&this.offsets[u]--,this.nodes.push(b),this.offsets.push(o>0?1:(b instanceof TextLeaf?b.text.length:b.children.length)<<1))}}}next(a=0){return a<0&&(this.nextInner(-a,-this.dir),a=this.value.length),this.nextInner(a,this.dir)}}class PartialTextCursor{constructor(a,o,u){this.value="",this.done=!1,this.cursor=new RawTextCursor(a,o>u?-1:1),this.pos=o>u?a.length:0,this.from=Math.min(o,u),this.to=Math.max(o,u)}nextInner(a,o){if(o<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;a+=Math.max(0,o<0?this.pos-this.to:this.from-this.pos);let u=o<0?this.pos-this.from:this.to-this.pos;a>u&&(a=u),u-=a;let{value:d}=this.cursor.next(a);return this.pos+=(d.length+a)*o,this.value=d.length<=u?d:o<0?d.slice(d.length-u):d.slice(0,u),this.done=!this.value,this}next(a=0){return a<0?a=Math.max(a,this.from-this.pos):a>0&&(a=Math.min(a,this.to-this.pos)),this.nextInner(a,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class LineCursor{constructor(a){this.inner=a,this.afterBreak=!0,this.value="",this.done=!1}next(a=0){let{done:o,lineBreak:u,value:d}=this.inner.next(a);return o&&this.afterBreak?(this.value="",this.afterBreak=!1):o?(this.done=!0,this.value=""):u?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=d,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Text.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(a,o,u,d){this.from=a,this.to=o,this.number=u,this.text=d}get length(){return this.to-this.from}}function clip(l,a,o){return a=Math.max(0,Math.min(l.length,a)),[a,Math.max(a,Math.min(l.length,o))]}function findClusterBreak(l,a,o=!0,u=!0){return findClusterBreak$1(l,a,o,u)}function surrogateLow(l){return l>=56320&&l<57344}function surrogateHigh(l){return l>=55296&&l<56320}function codePointAt(l,a){let o=l.charCodeAt(a);if(!surrogateHigh(o)||a+1==l.length)return o;let u=l.charCodeAt(a+1);return surrogateLow(u)?(o-55296<<10)+(u-56320)+65536:o}function fromCodePoint(l){return l<=65535?String.fromCharCode(l):(l-=65536,String.fromCharCode((l>>10)+55296,(l&1023)+56320))}function codePointSize(l){return l<65536?1:2}const DefaultSplit=/\r\n?|\n/;var MapMode=function(l){return l[l.Simple=0]="Simple",l[l.TrackDel=1]="TrackDel",l[l.TrackBefore=2]="TrackBefore",l[l.TrackAfter=3]="TrackAfter",l}(MapMode||(MapMode={}));class ChangeDesc{constructor(a){this.sections=a}get length(){let a=0;for(let o=0;o<this.sections.length;o+=2)a+=this.sections[o];return a}get newLength(){let a=0;for(let o=0;o<this.sections.length;o+=2){let u=this.sections[o+1];a+=u<0?this.sections[o]:u}return a}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(a){for(let o=0,u=0,d=0;o<this.sections.length;){let f=this.sections[o++],p=this.sections[o++];p<0?(a(u,d,f),d+=f):d+=p,u+=f}}iterChangedRanges(a,o=!1){iterChanges(this,a,o)}get invertedDesc(){let a=[];for(let o=0;o<this.sections.length;){let u=this.sections[o++],d=this.sections[o++];d<0?a.push(u,d):a.push(d,u)}return new ChangeDesc(a)}composeDesc(a){return this.empty?a:a.empty?this:composeSets(this,a)}mapDesc(a,o=!1){return a.empty?this:mapSet(this,a,o)}mapPos(a,o=-1,u=MapMode.Simple){let d=0,f=0;for(let p=0;p<this.sections.length;){let g=this.sections[p++],b=this.sections[p++],O=d+g;if(b<0){if(O>a)return f+(a-d);f+=g}else{if(u!=MapMode.Simple&&O>=a&&(u==MapMode.TrackDel&&d<a&&O>a||u==MapMode.TrackBefore&&d<a||u==MapMode.TrackAfter&&O>a))return null;if(O>a||O==a&&o<0&&!g)return a==d||o<0?f:f+b;f+=b}d=O}if(a>d)throw new RangeError(`Position ${a} is out of range for changeset of length ${d}`);return f}touchesRange(a,o=a){for(let u=0,d=0;u<this.sections.length&&d<=o;){let f=this.sections[u++],p=this.sections[u++],g=d+f;if(p>=0&&d<=o&&g>=a)return d<a&&g>o?"cover":!0;d=g}return!1}toString(){let a="";for(let o=0;o<this.sections.length;){let u=this.sections[o++],d=this.sections[o++];a+=(a?" ":"")+u+(d>=0?":"+d:"")}return a}toJSON(){return this.sections}static fromJSON(a){if(!Array.isArray(a)||a.length%2||a.some(o=>typeof o!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new ChangeDesc(a)}static create(a){return new ChangeDesc(a)}}class ChangeSet extends ChangeDesc{constructor(a,o){super(a),this.inserted=o}apply(a){if(this.length!=a.length)throw new RangeError("Applying change set to a document with the wrong length");return iterChanges(this,(o,u,d,f,p)=>a=a.replace(d,d+(u-o),p),!1),a}mapDesc(a,o=!1){return mapSet(this,a,o,!0)}invert(a){let o=this.sections.slice(),u=[];for(let d=0,f=0;d<o.length;d+=2){let p=o[d],g=o[d+1];if(g>=0){o[d]=g,o[d+1]=p;let b=d>>1;for(;u.length<b;)u.push(Text.empty);u.push(p?a.slice(f,f+p):Text.empty)}f+=p}return new ChangeSet(o,u)}compose(a){return this.empty?a:a.empty?this:composeSets(this,a,!0)}map(a,o=!1){return a.empty?this:mapSet(this,a,o,!0)}iterChanges(a,o=!1){iterChanges(this,a,o)}get desc(){return ChangeDesc.create(this.sections)}filter(a){let o=[],u=[],d=[],f=new SectionIter(this);e:for(let p=0,g=0;;){let b=p==a.length?1e9:a[p++];for(;g<b||g==b&&f.len==0;){if(f.done)break e;let S=Math.min(f.len,b-g);addSection(d,S,-1);let A=f.ins==-1?-1:f.off==0?f.ins:0;addSection(o,S,A),A>0&&addInsert(u,o,f.text),f.forward(S),g+=S}let O=a[p++];for(;g<O;){if(f.done)break e;let S=Math.min(f.len,O-g);addSection(o,S,-1),addSection(d,S,f.ins==-1?-1:f.off==0?f.ins:0),f.forward(S),g+=S}}return{changes:new ChangeSet(o,u),filtered:ChangeDesc.create(d)}}toJSON(){let a=[];for(let o=0;o<this.sections.length;o+=2){let u=this.sections[o],d=this.sections[o+1];d<0?a.push(u):d==0?a.push([u]):a.push([u].concat(this.inserted[o>>1].toJSON()))}return a}static of(a,o,u){let d=[],f=[],p=0,g=null;function b(S=!1){if(!S&&!d.length)return;p<o&&addSection(d,o-p,-1);let A=new ChangeSet(d,f);g=g?g.compose(A.map(g)):A,d=[],f=[],p=0}function O(S){if(Array.isArray(S))for(let A of S)O(A);else if(S instanceof ChangeSet){if(S.length!=o)throw new RangeError(`Mismatched change set length (got ${S.length}, expected ${o})`);b(),g=g?g.compose(S.map(g)):S}else{let{from:A,to:M=A,insert:E}=S;if(A>M||A<0||M>o)throw new RangeError(`Invalid change range ${A} to ${M} (in doc of length ${o})`);let R=E?typeof E=="string"?Text.of(E.split(u||DefaultSplit)):E:Text.empty,L=R.length;if(A==M&&L==0)return;A<p&&b(),A>p&&addSection(d,A-p,-1),addSection(d,M-A,L),addInsert(f,d,R),p=M}}return O(a),b(!g),g}static empty(a){return new ChangeSet(a?[a,-1]:[],[])}static fromJSON(a){if(!Array.isArray(a))throw new RangeError("Invalid JSON representation of ChangeSet");let o=[],u=[];for(let d=0;d<a.length;d++){let f=a[d];if(typeof f=="number")o.push(f,-1);else{if(!Array.isArray(f)||typeof f[0]!="number"||f.some((p,g)=>g&&typeof p!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(f.length==1)o.push(f[0],0);else{for(;u.length<d;)u.push(Text.empty);u[d]=Text.of(f.slice(1)),o.push(f[0],u[d].length)}}}return new ChangeSet(o,u)}static createSet(a,o){return new ChangeSet(a,o)}}function addSection(l,a,o,u=!1){if(a==0&&o<=0)return;let d=l.length-2;d>=0&&o<=0&&o==l[d+1]?l[d]+=a:d>=0&&a==0&&l[d]==0?l[d+1]+=o:u?(l[d]+=a,l[d+1]+=o):l.push(a,o)}function addInsert(l,a,o){if(o.length==0)return;let u=a.length-2>>1;if(u<l.length)l[l.length-1]=l[l.length-1].append(o);else{for(;l.length<u;)l.push(Text.empty);l.push(o)}}function iterChanges(l,a,o){let u=l.inserted;for(let d=0,f=0,p=0;p<l.sections.length;){let g=l.sections[p++],b=l.sections[p++];if(b<0)d+=g,f+=g;else{let O=d,S=f,A=Text.empty;for(;O+=g,S+=b,b&&u&&(A=A.append(u[p-2>>1])),!(o||p==l.sections.length||l.sections[p+1]<0);)g=l.sections[p++],b=l.sections[p++];a(d,O,f,S,A),d=O,f=S}}}function mapSet(l,a,o,u=!1){let d=[],f=u?[]:null,p=new SectionIter(l),g=new SectionIter(a);for(let b=-1;;){if(p.done&&g.len||g.done&&p.len)throw new Error("Mismatched change set lengths");if(p.ins==-1&&g.ins==-1){let O=Math.min(p.len,g.len);addSection(d,O,-1),p.forward(O),g.forward(O)}else if(g.ins>=0&&(p.ins<0||b==p.i||p.off==0&&(g.len<p.len||g.len==p.len&&!o))){let O=g.len;for(addSection(d,g.ins,-1);O;){let S=Math.min(p.len,O);p.ins>=0&&b<p.i&&p.len<=S&&(addSection(d,0,p.ins),f&&addInsert(f,d,p.text),b=p.i),p.forward(S),O-=S}g.next()}else if(p.ins>=0){let O=0,S=p.len;for(;S;)if(g.ins==-1){let A=Math.min(S,g.len);O+=A,S-=A,g.forward(A)}else if(g.ins==0&&g.len<S)S-=g.len,g.next();else break;addSection(d,O,b<p.i?p.ins:0),f&&b<p.i&&addInsert(f,d,p.text),b=p.i,p.forward(p.len-S)}else{if(p.done&&g.done)return f?ChangeSet.createSet(d,f):ChangeDesc.create(d);throw new Error("Mismatched change set lengths")}}}function composeSets(l,a,o=!1){let u=[],d=o?[]:null,f=new SectionIter(l),p=new SectionIter(a);for(let g=!1;;){if(f.done&&p.done)return d?ChangeSet.createSet(u,d):ChangeDesc.create(u);if(f.ins==0)addSection(u,f.len,0,g),f.next();else if(p.len==0&&!p.done)addSection(u,0,p.ins,g),d&&addInsert(d,u,p.text),p.next();else{if(f.done||p.done)throw new Error("Mismatched change set lengths");{let b=Math.min(f.len2,p.len),O=u.length;if(f.ins==-1){let S=p.ins==-1?-1:p.off?0:p.ins;addSection(u,b,S,g),d&&S&&addInsert(d,u,p.text)}else p.ins==-1?(addSection(u,f.off?0:f.len,b,g),d&&addInsert(d,u,f.textBit(b))):(addSection(u,f.off?0:f.len,p.off?0:p.ins,g),d&&!p.off&&addInsert(d,u,p.text));g=(f.ins>b||p.ins>=0&&p.len>b)&&(g||u.length>O),f.forward2(b),p.forward(b)}}}}class SectionIter{constructor(a){this.set=a,this.i=0,this.next()}next(){let{sections:a}=this.set;this.i<a.length?(this.len=a[this.i++],this.ins=a[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:a}=this.set,o=this.i-2>>1;return o>=a.length?Text.empty:a[o]}textBit(a){let{inserted:o}=this.set,u=this.i-2>>1;return u>=o.length&&!a?Text.empty:o[u].slice(this.off,a==null?void 0:this.off+a)}forward(a){a==this.len?this.next():(this.len-=a,this.off+=a)}forward2(a){this.ins==-1?this.forward(a):a==this.ins?this.next():(this.ins-=a,this.off+=a)}}class SelectionRange{constructor(a,o,u){this.from=a,this.to=o,this.flags=u}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 a=this.flags&7;return a==7?null:a}get goalColumn(){let a=this.flags>>6;return a==16777215?void 0:a}map(a,o=-1){let u,d;return this.empty?u=d=a.mapPos(this.from,o):(u=a.mapPos(this.from,1),d=a.mapPos(this.to,-1)),u==this.from&&d==this.to?this:new SelectionRange(u,d,this.flags)}extend(a,o=a){if(a<=this.anchor&&o>=this.anchor)return EditorSelection.range(a,o);let u=Math.abs(a-this.anchor)>Math.abs(o-this.anchor)?a:o;return EditorSelection.range(this.anchor,u)}eq(a,o=!1){return this.anchor==a.anchor&&this.head==a.head&&(!o||!this.empty||this.assoc==a.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(a){if(!a||typeof a.anchor!="number"||typeof a.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return EditorSelection.range(a.anchor,a.head)}static create(a,o,u){return new SelectionRange(a,o,u)}}class EditorSelection{constructor(a,o){this.ranges=a,this.mainIndex=o}map(a,o=-1){return a.empty?this:EditorSelection.create(this.ranges.map(u=>u.map(a,o)),this.mainIndex)}eq(a,o=!1){if(this.ranges.length!=a.ranges.length||this.mainIndex!=a.mainIndex)return!1;for(let u=0;u<this.ranges.length;u++)if(!this.ranges[u].eq(a.ranges[u],o))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new EditorSelection([this.main],0)}addRange(a,o=!0){return EditorSelection.create([a].concat(this.ranges),o?0:this.mainIndex+1)}replaceRange(a,o=this.mainIndex){let u=this.ranges.slice();return u[o]=a,EditorSelection.create(u,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(a=>a.toJSON()),main:this.mainIndex}}static fromJSON(a){if(!a||!Array.isArray(a.ranges)||typeof a.main!="number"||a.main>=a.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new EditorSelection(a.ranges.map(o=>SelectionRange.fromJSON(o)),a.main)}static single(a,o=a){return new EditorSelection([EditorSelection.range(a,o)],0)}static create(a,o=0){if(a.length==0)throw new RangeError("A selection needs at least one range");for(let u=0,d=0;d<a.length;d++){let f=a[d];if(f.empty?f.from<=u:f.from<u)return EditorSelection.normalized(a.slice(),o);u=f.to}return new EditorSelection(a,o)}static cursor(a,o=0,u,d){return SelectionRange.create(a,a,(o==0?0:o<0?8:16)|(u==null?7:Math.min(6,u))|(d??16777215)<<6)}static range(a,o,u,d){let f=(u??16777215)<<6|(d==null?7:Math.min(6,d));return o<a?SelectionRange.create(o,a,48|f):SelectionRange.create(a,o,(o>a?8:0)|f)}static normalized(a,o=0){let u=a[o];a.sort((d,f)=>d.from-f.from),o=a.indexOf(u);for(let d=1;d<a.length;d++){let f=a[d],p=a[d-1];if(f.empty?f.from<=p.to:f.from<p.to){let g=p.from,b=Math.max(f.to,p.to);d<=o&&o--,a.splice(--d,2,f.anchor>f.head?EditorSelection.range(b,g):EditorSelection.range(g,b))}}return new EditorSelection(a,o)}}function checkSelection(l,a){for(let o of l.ranges)if(o.to>a)throw new RangeError("Selection points outside of document")}let nextID=0;class Facet{constructor(a,o,u,d,f){this.combine=a,this.compareInput=o,this.compare=u,this.isStatic=d,this.id=nextID++,this.default=a([]),this.extensions=typeof f=="function"?f(this):f}get reader(){return this}static define(a={}){return new Facet(a.combine||(o=>o),a.compareInput||((o,u)=>o===u),a.compare||(a.combine?(o,u)=>o===u:sameArray$1),!!a.static,a.enables)}of(a){return new FacetProvider([],this,0,a)}compute(a,o){if(this.isStatic)throw new Error("Can't compute a static facet");return new FacetProvider(a,this,1,o)}computeN(a,o){if(this.isStatic)throw new Error("Can't compute a static facet");return new FacetProvider(a,this,2,o)}from(a,o){return o||(o=u=>u),this.compute([a],u=>o(u.field(a)))}}function sameArray$1(l,a){return l==a||l.length==a.length&&l.every((o,u)=>o===a[u])}class FacetProvider{constructor(a,o,u,d){this.dependencies=a,this.facet=o,this.type=u,this.value=d,this.id=nextID++}dynamicSlot(a){var o;let u=this.value,d=this.facet.compareInput,f=this.id,p=a[f]>>1,g=this.type==2,b=!1,O=!1,S=[];for(let A of this.dependencies)A=="doc"?b=!0:A=="selection"?O=!0:((o=a[A.id])!==null&&o!==void 0?o:1)&1||S.push(a[A.id]);return{create(A){return A.values[p]=u(A),1},update(A,M){if(b&&M.docChanged||O&&(M.docChanged||M.selection)||ensureAll(A,S)){let E=u(A);if(g?!compareArray(E,A.values[p],d):!d(E,A.values[p]))return A.values[p]=E,1}return 0},reconfigure:(A,M)=>{let E,R=M.config.address[f];if(R!=null){let L=getAddr(M,R);if(this.dependencies.every(U=>U instanceof Facet?M.facet(U)===A.facet(U):U instanceof StateField?M.field(U,!1)==A.field(U,!1):!0)||(g?compareArray(E=u(A),L,d):d(E=u(A),L)))return A.values[p]=L,0}else E=u(A);return A.values[p]=E,1}}}}function compareArray(l,a,o){if(l.length!=a.length)return!1;for(let u=0;u<l.length;u++)if(!o(l[u],a[u]))return!1;return!0}function ensureAll(l,a){let o=!1;for(let u of a)ensureAddr(l,u)&1&&(o=!0);return o}function dynamicFacetSlot(l,a,o){let u=o.map(b=>l[b.id]),d=o.map(b=>b.type),f=u.filter(b=>!(b&1)),p=l[a.id]>>1;function g(b){let O=[];for(let S=0;S<u.length;S++){let A=getAddr(b,u[S]);if(d[S]==2)for(let M of A)O.push(M);else O.push(A)}return a.combine(O)}return{create(b){for(let O of u)ensureAddr(b,O);return b.values[p]=g(b),1},update(b,O){if(!ensureAll(b,f))return 0;let S=g(b);return a.compare(S,b.values[p])?0:(b.values[p]=S,1)},reconfigure(b,O){let S=ensureAll(b,u),A=O.config.facets[a.id],M=O.facet(a);if(A&&!S&&sameArray$1(o,A))return b.values[p]=M,0;let E=g(b);return a.compare(E,M)?(b.values[p]=M,0):(b.values[p]=E,1)}}}const initField=Facet.define({static:!0});class StateField{constructor(a,o,u,d,f){this.id=a,this.createF=o,this.updateF=u,this.compareF=d,this.spec=f,this.provides=void 0}static define(a){let o=new StateField(nextID++,a.create,a.update,a.compare||((u,d)=>u===d),a);return a.provide&&(o.provides=a.provide(o)),o}create(a){let o=a.facet(initField).find(u=>u.field==this);return(o?.create||this.createF)(a)}slot(a){let o=a[this.id]>>1;return{create:u=>(u.values[o]=this.create(u),1),update:(u,d)=>{let f=u.values[o],p=this.updateF(f,d);return this.compareF(f,p)?0:(u.values[o]=p,1)},reconfigure:(u,d)=>d.config.address[this.id]!=null?(u.values[o]=d.field(this),0):(u.values[o]=this.create(u),1)}}init(a){return[this,initField.of({field:this,create:a})]}get extension(){return this}}const Prec_={lowest:4,low:3,default:2,high:1,highest:0};function prec(l){return a=>new PrecExtension(a,l)}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(a,o){this.inner=a,this.prec=o}}class Compartment{of(a){return new CompartmentInstance(this,a)}reconfigure(a){return Compartment.reconfigure.of({compartment:this,extension:a})}get(a){return a.config.compartments.get(this)}}class CompartmentInstance{constructor(a,o){this.compartment=a,this.inner=o}}class Configuration{constructor(a,o,u,d,f,p){for(this.base=a,this.compartments=o,this.dynamicSlots=u,this.address=d,this.staticValues=f,this.facets=p,this.statusTemplate=[];this.statusTemplate.length<u.length;)this.statusTemplate.push(0)}staticFacet(a){let o=this.address[a.id];return o==null?a.default:this.staticValues[o>>1]}static resolve(a,o,u){let d=[],f=Object.create(null),p=new Map;for(let M of flatten(a,o,p))M instanceof StateField?d.push(M):(f[M.facet.id]||(f[M.facet.id]=[])).push(M);let g=Object.create(null),b=[],O=[];for(let M of d)g[M.id]=O.length<<1,O.push(E=>M.slot(E));let S=u?.config.facets;for(let M in f){let E=f[M],R=E[0].facet,L=S&&S[M]||[];if(E.every(U=>U.type==0))if(g[R.id]=b.length<<1|1,sameArray$1(L,E))b.push(u.facet(R));else{let U=R.combine(E.map(Z=>Z.value));b.push(u&&R.compare(U,u.facet(R))?u.facet(R):U)}else{for(let U of E)U.type==0?(g[U.id]=b.length<<1|1,b.push(U.value)):(g[U.id]=O.length<<1,O.push(Z=>U.dynamicSlot(Z)));g[R.id]=O.length<<1,O.push(U=>dynamicFacetSlot(U,R,E))}}let A=O.map(M=>M(g));return new Configuration(a,p,A,g,b,f)}}function flatten(l,a,o){let u=[[],[],[],[],[]],d=new Map;function f(p,g){let b=d.get(p);if(b!=null){if(b<=g)return;let O=u[b].indexOf(p);O>-1&&u[b].splice(O,1),p instanceof CompartmentInstance&&o.delete(p.compartment)}if(d.set(p,g),Array.isArray(p))for(let O of p)f(O,g);else if(p instanceof CompartmentInstance){if(o.has(p.compartment))throw new RangeError("Duplicate use of compartment in extensions");let O=a.get(p.compartment)||p.inner;o.set(p.compartment,O),f(O,g)}else if(p instanceof PrecExtension)f(p.inner,p.prec);else if(p instanceof StateField)u[g].push(p),p.provides&&f(p.provides,g);else if(p instanceof FacetProvider)u[g].push(p),p.facet.extensions&&f(p.facet.extensions,Prec_.default);else{let O=p.extension;if(!O)throw new Error(`Unrecognized extension value in extension set (${p}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);f(O,g)}}return f(l,Prec_.default),u.reduce((p,g)=>p.concat(g))}function ensureAddr(l,a){if(a&1)return 2;let o=a>>1,u=l.status[o];if(u==4)throw new Error("Cyclic dependency between fields and/or facets");if(u&2)return u;l.status[o]=4;let d=l.computeSlot(l,l.config.dynamicSlots[o]);return l.status[o]=2|d}function getAddr(l,a){return a&1?l.config.staticValues[a>>1]:l.values[a>>1]}const languageData=Facet.define(),allowMultipleSelections=Facet.define({combine:l=>l.some(a=>a),static:!0}),lineSeparator=Facet.define({combine:l=>l.length?l[0]:void 0,static:!0}),changeFilter=Facet.define(),transactionFilter=Facet.define(),transactionExtender=Facet.define(),readOnly=Facet.define({combine:l=>l.length?l[0]:!1});class Annotation{constructor(a,o){this.type=a,this.value=o}static define(){return new AnnotationType}}class AnnotationType{of(a){return new Annotation(this,a)}}class StateEffectType{constructor(a){this.map=a}of(a){return new StateEffect(this,a)}}class StateEffect{constructor(a,o){this.type=a,this.value=o}map(a){let o=this.type.map(this.value,a);return o===void 0?void 0:o==this.value?this:new StateEffect(this.type,o)}is(a){return this.type==a}static define(a={}){return new StateEffectType(a.map||(o=>o))}static mapEffects(a,o){if(!a.length)return a;let u=[];for(let d of a){let f=d.map(o);f&&u.push(f)}return u}}StateEffect.reconfigure=StateEffect.define(),StateEffect.appendConfig=StateEffect.define();class Transaction{constructor(a,o,u,d,f,p){this.startState=a,this.changes=o,this.selection=u,this.effects=d,this.annotations=f,this.scrollIntoView=p,this._doc=null,this._state=null,u&&checkSelection(u,o.newLength),f.some(g=>g.type==Transaction.time)||(this.annotations=f.concat(Transaction.time.of(Date.now())))}static create(a,o,u,d,f,p){return new Transaction(a,o,u,d,f,p)}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(a){for(let o of this.annotations)if(o.type==a)return o.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(a){let o=this.annotation(Transaction.userEvent);return!!(o&&(o==a||o.length>a.length&&o.slice(0,a.length)==a&&o[a.length]=="."))}}Transaction.time=Annotation.define(),Transaction.userEvent=Annotation.define(),Transaction.addToHistory=Annotation.define(),Transaction.remote=Annotation.define();function joinRanges(l,a){let o=[];for(let u=0,d=0;;){let f,p;if(u<l.length&&(d==a.length||a[d]>=l[u]))f=l[u++],p=l[u++];else if(d<a.length)f=a[d++],p=a[d++];else return o;!o.length||o[o.length-1]<f?o.push(f,p):o[o.length-1]<p&&(o[o.length-1]=p)}}function mergeTransaction(l,a,o){var u;let d,f,p;return o?(d=a.changes,f=ChangeSet.empty(a.changes.length),p=l.changes.compose(a.changes)):(d=a.changes.map(l.changes),f=l.changes.mapDesc(a.changes,!0),p=l.changes.compose(d)),{changes:p,selection:a.selection?a.selection.map(f):(u=l.selection)===null||u===void 0?void 0:u.map(d),effects:StateEffect.mapEffects(l.effects,d).concat(StateEffect.mapEffects(a.effects,f)),annotations:l.annotations.length?l.annotations.concat(a.annotations):a.annotations,scrollIntoView:l.scrollIntoView||a.scrollIntoView}}function resolveTransactionInner(l,a,o){let u=a.selection,d=asArray$1(a.annotations);return a.userEvent&&(d=d.concat(Transaction.userEvent.of(a.userEvent))),{changes:a.changes instanceof ChangeSet?a.changes:ChangeSet.of(a.changes||[],o,l.facet(lineSeparator)),selection:u&&(u instanceof EditorSelection?u:EditorSelection.single(u.anchor,u.head)),effects:asArray$1(a.effects),annotations:d,scrollIntoView:!!a.scrollIntoView}}function resolveTransaction(l,a,o){let u=resolveTransactionInner(l,a.length?a[0]:{},l.doc.length);a.length&&a[0].filter===!1&&(o=!1);for(let f=1;f<a.length;f++){a[f].filter===!1&&(o=!1);let p=!!a[f].sequential;u=mergeTransaction(u,resolveTransactionInner(l,a[f],p?u.changes.newLength:l.doc.length),p)}let d=Transaction.create(l,u.changes,u.selection,u.effects,u.annotations,u.scrollIntoView);return extendTransaction(o?filterTransaction(d):d)}function filterTransaction(l){let a=l.startState,o=!0;for(let d of a.facet(changeFilter)){let f=d(l);if(f===!1){o=!1;break}Array.isArray(f)&&(o=o===!0?f:joinRanges(o,f))}if(o!==!0){let d,f;if(o===!1)f=l.changes.invertedDesc,d=ChangeSet.empty(a.doc.length);else{let p=l.changes.filter(o);d=p.changes,f=p.filtered.mapDesc(p.changes).invertedDesc}l=Transaction.create(a,d,l.selection&&l.selection.map(f),StateEffect.mapEffects(l.effects,f),l.annotations,l.scrollIntoView)}let u=a.facet(transactionFilter);for(let d=u.length-1;d>=0;d--){let f=u[d](l);f instanceof Transaction?l=f:Array.isArray(f)&&f.length==1&&f[0]instanceof Transaction?l=f[0]:l=resolveTransaction(a,asArray$1(f),!1)}return l}function extendTransaction(l){let a=l.startState,o=a.facet(transactionExtender),u=l;for(let d=o.length-1;d>=0;d--){let f=o[d](l);f&&Object.keys(f).length&&(u=mergeTransaction(u,resolveTransactionInner(a,f,l.changes.newLength),!0))}return u==l?l:Transaction.create(a,l.changes,l.selection,u.effects,u.annotations,u.scrollIntoView)}const none$2=[];function asArray$1(l){return l==null?none$2:Array.isArray(l)?l:[l]}var CharCategory=function(l){return l[l.Word=0]="Word",l[l.Space=1]="Space",l[l.Other=2]="Other",l}(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(l){}function hasWordChar(l){if(wordChar$1)return wordChar$1.test(l);for(let a=0;a<l.length;a++){let o=l[a];if(/\w/.test(o)||o>"€"&&(o.toUpperCase()!=o.toLowerCase()||nonASCIISingleCaseWordChar.test(o)))return!0}return!1}function makeCategorizer(l){return a=>{if(!/\S/.test(a))return CharCategory.Space;if(hasWordChar(a))return CharCategory.Word;for(let o=0;o<l.length;o++)if(a.indexOf(l[o])>-1)return CharCategory.Word;return CharCategory.Other}}class EditorState{constructor(a,o,u,d,f,p){this.config=a,this.doc=o,this.selection=u,this.values=d,this.status=a.statusTemplate.slice(),this.computeSlot=f,p&&(p._state=this);for(let g=0;g<this.config.dynamicSlots.length;g++)ensureAddr(this,g<<1);this.computeSlot=null}field(a,o=!0){let u=this.config.address[a.id];if(u==null){if(o)throw new RangeError("Field is not present in this state");return}return ensureAddr(this,u),getAddr(this,u)}update(...a){return resolveTransaction(this,a,!0)}applyTransaction(a){let o=this.config,{base:u,compartments:d}=o;for(let g of a.effects)g.is(Compartment.reconfigure)?(o&&(d=new Map,o.compartments.forEach((b,O)=>d.set(O,b)),o=null),d.set(g.value.compartment,g.value.extension)):g.is(StateEffect.reconfigure)?(o=null,u=g.value):g.is(StateEffect.appendConfig)&&(o=null,u=asArray$1(u).concat(g.value));let f;o?f=a.startState.values.slice():(o=Configuration.resolve(u,d,this),f=new EditorState(o,this.doc,this.selection,o.dynamicSlots.map(()=>null),(b,O)=>O.reconfigure(b,this),null).values);let p=a.startState.facet(allowMultipleSelections)?a.newSelection:a.newSelection.asSingle();new EditorState(o,a.newDoc,p,f,(g,b)=>b.update(g,a),a)}replaceSelection(a){return typeof a=="string"&&(a=this.toText(a)),this.changeByRange(o=>({changes:{from:o.from,to:o.to,insert:a},range:EditorSelection.cursor(o.from+a.length)}))}changeByRange(a){let o=this.selection,u=a(o.ranges[0]),d=this.changes(u.changes),f=[u.range],p=asArray$1(u.effects);for(let g=1;g<o.ranges.length;g++){let b=a(o.ranges[g]),O=this.changes(b.changes),S=O.map(d);for(let M=0;M<g;M++)f[M]=f[M].map(S);let A=d.mapDesc(O,!0);f.push(b.range.map(A)),d=d.compose(S),p=StateEffect.mapEffects(p,S).concat(StateEffect.mapEffects(asArray$1(b.effects),A))}return{changes:d,selection:EditorSelection.create(f,o.mainIndex),effects:p}}changes(a=[]){return a instanceof ChangeSet?a:ChangeSet.of(a,this.doc.length,this.facet(EditorState.lineSeparator))}toText(a){return Text.of(a.split(this.facet(EditorState.lineSeparator)||DefaultSplit))}sliceDoc(a=0,o=this.doc.length){return this.doc.sliceString(a,o,this.lineBreak)}facet(a){let o=this.config.address[a.id];return o==null?a.default:(ensureAddr(this,o),getAddr(this,o))}toJSON(a){let o={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(a)for(let u in a){let d=a[u];d instanceof StateField&&this.config.address[d.id]!=null&&(o[u]=d.spec.toJSON(this.field(a[u]),this))}return o}static fromJSON(a,o={},u){if(!a||typeof a.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let d=[];if(u){for(let f in u)if(Object.prototype.hasOwnProperty.call(a,f)){let p=u[f],g=a[f];d.push(p.init(b=>p.spec.fromJSON(g,b)))}}return EditorState.create({doc:a.doc,selection:EditorSelection.fromJSON(a.selection),extensions:o.extensions?d.concat([o.extensions]):d})}static create(a={}){let o=Configuration.resolve(a.extensions||[],new Map),u=a.doc instanceof Text?a.doc:Text.of((a.doc||"").split(o.staticFacet(EditorState.lineSeparator)||DefaultSplit)),d=a.selection?a.selection instanceof EditorSelection?a.selection:EditorSelection.single(a.selection.anchor,a.selection.head):EditorSelection.single(0);return checkSelection(d,u.length),o.staticFacet(allowMultipleSelections)||(d=d.asSingle()),new EditorState(o,u,d,o.dynamicSlots.map(()=>null),(f,p)=>p.create(f),null)}get tabSize(){return this.facet(EditorState.tabSize)}get lineBreak(){return this.facet(EditorState.lineSeparator)||`
`}get readOnly(){return this.facet(readOnly)}phrase(a,...o){for(let u of this.facet(EditorState.phrases))if(Object.prototype.hasOwnProperty.call(u,a)){a=u[a];break}return o.length&&(a=a.replace(/\$(\$|\d*)/g,(u,d)=>{if(d=="$")return"$";let f=+(d||1);return!f||f>o.length?u:o[f-1]})),a}languageDataAt(a,o,u=-1){let d=[];for(let f of this.facet(languageData))for(let p of f(this,o,u))Object.prototype.hasOwnProperty.call(p,a)&&d.push(p[a]);return d}charCategorizer(a){return makeCategorizer(this.languageDataAt("wordChars",a).join(""))}wordAt(a){let{text:o,from:u,length:d}=this.doc.lineAt(a),f=this.charCategorizer(a),p=a-u,g=a-u;for(;p>0;){let b=findClusterBreak(o,p,!1);if(f(o.slice(b,p))!=CharCategory.Word)break;p=b}for(;g<d;){let b=findClusterBreak(o,g);if(f(o.slice(g,b))!=CharCategory.Word)break;g=b}return p==g?null:EditorSelection.range(p+u,g+u)}}EditorState.allowMultipleSelections=allowMultipleSelections,EditorState.tabSize=Facet.define({combine:l=>l.length?l[0]:4}),EditorState.lineSeparator=lineSeparator,EditorState.readOnly=readOnly,EditorState.phrases=Facet.define({compare(l,a){let o=Object.keys(l),u=Object.keys(a);return o.length==u.length&&o.every(d=>l[d]==a[d])}}),EditorState.languageData=languageData,EditorState.changeFilter=changeFilter,EditorState.transactionFilter=transactionFilter,EditorState.transactionExtender=transactionExtender,Compartment.reconfigure=StateEffect.define();function combineConfig(l,a,o={}){let u={};for(let d of l)for(let f of Object.keys(d)){let p=d[f],g=u[f];if(g===void 0)u[f]=p;else if(!(g===p||p===void 0))if(Object.hasOwnProperty.call(o,f))u[f]=o[f](g,p);else throw new Error("Config merge conflict for field "+f)}for(let d in a)u[d]===void 0&&(u[d]=a[d]);return u}class RangeValue{eq(a){return this==a}range(a,o=a){return Range$1.create(a,o,this)}}RangeValue.prototype.startSide=RangeValue.prototype.endSide=0,RangeValue.prototype.point=!1,RangeValue.prototype.mapMode=MapMode.TrackDel;let Range$1=class Dr{constructor(a,o,u){this.from=a,this.to=o,this.value=u}static create(a,o,u){return new Dr(a,o,u)}};function cmpRange(l,a){return l.from-a.from||l.value.startSide-a.value.startSide}class Chunk{constructor(a,o,u,d){this.from=a,this.to=o,this.value=u,this.maxPoint=d}get length(){return this.to[this.to.length-1]}findIndex(a,o,u,d=0){let f=u?this.to:this.from;for(let p=d,g=f.length;;){if(p==g)return p;let b=p+g>>1,O=f[b]-a||(u?this.value[b].endSide:this.value[b].startSide)-o;if(b==p)return O>=0?p:g;O>=0?g=b:p=b+1}}between(a,o,u,d){for(let f=this.findIndex(o,-1e9,!0),p=this.findIndex(u,1e9,!1,f);f<p;f++)if(d(this.from[f]+a,this.to[f]+a,this.value[f])===!1)return!1}map(a,o){let u=[],d=[],f=[],p=-1,g=-1;for(let b=0;b<this.value.length;b++){let O=this.value[b],S=this.from[b]+a,A=this.to[b]+a,M,E;if(S==A){let R=o.mapPos(S,O.startSide,O.mapMode);if(R==null||(M=E=R,O.startSide!=O.endSide&&(E=o.mapPos(S,O.endSide),E<M)))continue}else if(M=o.mapPos(S,O.startSide),E=o.mapPos(A,O.endSide),M>E||M==E&&O.startSide>0&&O.endSide<=0)continue;(E-M||O.endSide-O.startSide)<0||(p<0&&(p=M),O.point&&(g=Math.max(g,E-M)),u.push(O),d.push(M-p),f.push(E-p))}return{mapped:u.length?new Chunk(d,f,u,g):null,pos:p}}}class RangeSet{constructor(a,o,u,d){this.chunkPos=a,this.chunk=o,this.nextLayer=u,this.maxPoint=d}static create(a,o,u,d){return new RangeSet(a,o,u,d)}get length(){let a=this.chunk.length-1;return a<0?0:Math.max(this.chunkEnd(a),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let a=this.nextLayer.size;for(let o of this.chunk)a+=o.value.length;return a}chunkEnd(a){return this.chunkPos[a]+this.chunk[a].length}update(a){let{add:o=[],sort:u=!1,filterFrom:d=0,filterTo:f=this.length}=a,p=a.filter;if(o.length==0&&!p)return this;if(u&&(o=o.slice().sort(cmpRange)),this.isEmpty)return o.length?RangeSet.of(o):this;let g=new LayerCursor(this,null,-1).goto(0),b=0,O=[],S=new RangeSetBuilder;for(;g.value||b<o.length;)if(b<o.length&&(g.from-o[b].from||g.startSide-o[b].value.startSide)>=0){let A=o[b++];S.addInner(A.from,A.to,A.value)||O.push(A)}else g.rangeIndex==1&&g.chunkIndex<this.chunk.length&&(b==o.length||this.chunkEnd(g.chunkIndex)<o[b].from)&&(!p||d>this.chunkEnd(g.chunkIndex)||f<this.chunkPos[g.chunkIndex])&&S.addChunk(this.chunkPos[g.chunkIndex],this.chunk[g.chunkIndex])?g.nextChunk():((!p||d>g.to||f<g.from||p(g.from,g.to,g.value))&&(S.addInner(g.from,g.to,g.value)||O.push(Range$1.create(g.from,g.to,g.value))),g.next());return S.finishInner(this.nextLayer.isEmpty&&!O.length?RangeSet.empty:this.nextLayer.update({add:O,filter:p,filterFrom:d,filterTo:f}))}map(a){if(a.empty||this.isEmpty)return this;let o=[],u=[],d=-1;for(let p=0;p<this.chunk.length;p++){let g=this.chunkPos[p],b=this.chunk[p],O=a.touchesRange(g,g+b.length);if(O===!1)d=Math.max(d,b.maxPoint),o.push(b),u.push(a.mapPos(g));else if(O===!0){let{mapped:S,pos:A}=b.map(g,a);S&&(d=Math.max(d,S.maxPoint),o.push(S),u.push(A))}}let f=this.nextLayer.map(a);return o.length==0?f:new RangeSet(u,o,f||RangeSet.empty,d)}between(a,o,u){if(!this.isEmpty){for(let d=0;d<this.chunk.length;d++){let f=this.chunkPos[d],p=this.chunk[d];if(o>=f&&a<=f+p.length&&p.between(f,a-f,o-f,u)===!1)return}this.nextLayer.between(a,o,u)}}iter(a=0){return HeapCursor.from([this]).goto(a)}get isEmpty(){return this.nextLayer==this}static iter(a,o=0){return HeapCursor.from(a).goto(o)}static compare(a,o,u,d,f=-1){let p=a.filter(A=>A.maxPoint>0||!A.isEmpty&&A.maxPoint>=f),g=o.filter(A=>A.maxPoint>0||!A.isEmpty&&A.maxPoint>=f),b=findSharedChunks(p,g,u),O=new SpanCursor(p,b,f),S=new SpanCursor(g,b,f);u.iterGaps((A,M,E)=>compare(O,A,S,M,E,d)),u.empty&&u.length==0&&compare(O,0,S,0,0,d)}static eq(a,o,u=0,d){d==null&&(d=999999999);let f=a.filter(S=>!S.isEmpty&&o.indexOf(S)<0),p=o.filter(S=>!S.isEmpty&&a.indexOf(S)<0);if(f.length!=p.length)return!1;if(!f.length)return!0;let g=findSharedChunks(f,p),b=new SpanCursor(f,g,0).goto(u),O=new SpanCursor(p,g,0).goto(u);for(;;){if(b.to!=O.to||!sameValues(b.active,O.active)||b.point&&(!O.point||!b.point.eq(O.point)))return!1;if(b.to>d)return!0;b.next(),O.next()}}static spans(a,o,u,d,f=-1){let p=new SpanCursor(a,null,f).goto(o),g=o,b=p.openStart;for(;;){let O=Math.min(p.to,u);if(p.point){let S=p.activeForPoint(p.to),A=p.pointFrom<o?S.length+1:p.point.startSide<0?S.length:Math.min(S.length,b);d.point(g,O,p.point,S,A,p.pointRank),b=Math.min(p.openEnd(O),S.length)}else O>g&&(d.span(g,O,p.active,b),b=p.openEnd(O));if(p.to>u)return b+(p.point&&p.to>u?1:0);g=p.to,p.next()}}static of(a,o=!1){let u=new RangeSetBuilder;for(let d of a instanceof Range$1?[a]:o?lazySort(a):a)u.add(d.from,d.to,d.value);return u.finish()}static join(a){if(!a.length)return RangeSet.empty;let o=a[a.length-1];for(let u=a.length-2;u>=0;u--)for(let d=a[u];d!=RangeSet.empty;d=d.nextLayer)o=new RangeSet(d.chunkPos,d.chunk,o,Math.max(d.maxPoint,o.maxPoint));return o}}RangeSet.empty=new RangeSet([],[],null,-1);function lazySort(l){if(l.length>1)for(let a=l[0],o=1;o<l.length;o++){let u=l[o];if(cmpRange(a,u)>0)return l.slice().sort(cmpRange);a=u}return l}RangeSet.empty.nextLayer=RangeSet.empty;class RangeSetBuilder{finishChunk(a){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,a&&(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(a,o,u){this.addInner(a,o,u)||(this.nextLayer||(this.nextLayer=new RangeSetBuilder)).add(a,o,u)}addInner(a,o,u){let d=a-this.lastTo||u.startSide-this.last.endSide;if(d<=0&&(a-this.lastFrom||u.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return d<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=a),this.from.push(a-this.chunkStart),this.to.push(o-this.chunkStart),this.last=u,this.lastFrom=a,this.lastTo=o,this.value.push(u),u.point&&(this.maxPoint=Math.max(this.maxPoint,o-a)),!0)}addChunk(a,o){if((a-this.lastTo||o.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,o.maxPoint),this.chunks.push(o),this.chunkPos.push(a);let u=o.value.length-1;return this.last=o.value[u],this.lastFrom=o.from[u]+a,this.lastTo=o.to[u]+a,!0}finish(){return this.finishInner(RangeSet.empty)}finishInner(a){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return a;let o=RangeSet.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(a):a,this.setMaxPoint);return this.from=null,o}}function findSharedChunks(l,a,o){let u=new Map;for(let f of l)for(let p=0;p<f.chunk.length;p++)f.chunk[p].maxPoint<=0&&u.set(f.chunk[p],f.chunkPos[p]);let d=new Set;for(let f of a)for(let p=0;p<f.chunk.length;p++){let g=u.get(f.chunk[p]);g!=null&&(o?o.mapPos(g):g)==f.chunkPos[p]&&!o?.touchesRange(g,g+f.chunk[p].length)&&d.add(f.chunk[p])}return d}class LayerCursor{constructor(a,o,u,d=0){this.layer=a,this.skip=o,this.minPoint=u,this.rank=d}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(a,o=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(a,o,!1),this}gotoInner(a,o,u){for(;this.chunkIndex<this.layer.chunk.length;){let d=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(d)||this.layer.chunkEnd(this.chunkIndex)<a||d.maxPoint<this.minPoint))break;this.chunkIndex++,u=!1}if(this.chunkIndex<this.layer.chunk.length){let d=this.layer.chunk[this.chunkIndex].findIndex(a-this.layer.chunkPos[this.chunkIndex],o,!0);(!u||this.rangeIndex<d)&&this.setRangeIndex(d)}this.next()}forward(a,o){(this.to-a||this.endSide-o)<0&&this.gotoInner(a,o,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let a=this.layer.chunkPos[this.chunkIndex],o=this.layer.chunk[this.chunkIndex],u=a+o.from[this.rangeIndex];if(this.from=u,this.to=a+o.to[this.rangeIndex],this.value=o.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(a){if(a==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=a}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(a){return this.from-a.from||this.startSide-a.startSide||this.rank-a.rank||this.to-a.to||this.endSide-a.endSide}}class HeapCursor{constructor(a){this.heap=a}static from(a,o=null,u=-1){let d=[];for(let f=0;f<a.length;f++)for(let p=a[f];!p.isEmpty;p=p.nextLayer)p.maxPoint>=u&&d.push(new LayerCursor(p,o,u,f));return d.length==1?d[0]:new HeapCursor(d)}get startSide(){return this.value?this.value.startSide:0}goto(a,o=-1e9){for(let u of this.heap)u.goto(a,o);for(let u=this.heap.length>>1;u>=0;u--)heapBubble(this.heap,u);return this.next(),this}forward(a,o){for(let u of this.heap)u.forward(a,o);for(let u=this.heap.length>>1;u>=0;u--)heapBubble(this.heap,u);(this.to-a||this.value.endSide-o)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let a=this.heap[0];this.from=a.from,this.to=a.to,this.value=a.value,this.rank=a.rank,a.value&&a.next(),heapBubble(this.heap,0)}}}function heapBubble(l,a){for(let o=l[a];;){let u=(a<<1)+1;if(u>=l.length)break;let d=l[u];if(u+1<l.length&&d.compare(l[u+1])>=0&&(d=l[u+1],u++),o.compare(d)<0)break;l[u]=o,l[a]=d,a=u}}class SpanCursor{constructor(a,o,u){this.minPoint=u,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(a,o,u)}goto(a,o=-1e9){return this.cursor.goto(a,o),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=a,this.endSide=o,this.openStart=-1,this.next(),this}forward(a,o){for(;this.minActive>-1&&(this.activeTo[this.minActive]-a||this.active[this.minActive].endSide-o)<0;)this.removeActive(this.minActive);this.cursor.forward(a,o)}removeActive(a){remove(this.active,a),remove(this.activeTo,a),remove(this.activeRank,a),this.minActive=findMinIndex(this.active,this.activeTo)}addActive(a){let o=0,{value:u,to:d,rank:f}=this.cursor;for(;o<this.activeRank.length&&(f-this.activeRank[o]||d-this.activeTo[o])>0;)o++;insert(this.active,o,u),insert(this.activeTo,o,d),insert(this.activeRank,o,f),a&&insert(a,o,this.cursor.from),this.minActive=findMinIndex(this.active,this.activeTo)}next(){let a=this.to,o=this.point;this.point=null;let u=this.openStart<0?[]:null;for(;;){let d=this.minActive;if(d>-1&&(this.activeTo[d]-this.cursor.from||this.active[d].endSide-this.cursor.startSide)<0){if(this.activeTo[d]>a){this.to=this.activeTo[d],this.endSide=this.active[d].endSide;break}this.removeActive(d),u&&remove(u,d)}else if(this.cursor.value)if(this.cursor.from>a){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let f=this.cursor.value;if(!f.point)this.addActive(u),this.cursor.next();else if(o&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=f,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=f.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(u){this.openStart=0;for(let d=u.length-1;d>=0&&u[d]<a;d--)this.openStart++}}activeForPoint(a){if(!this.active.length)return this.active;let o=[];for(let u=this.active.length-1;u>=0&&!(this.activeRank[u]<this.pointRank);u--)(this.activeTo[u]>a||this.activeTo[u]==a&&this.active[u].endSide>=this.point.endSide)&&o.push(this.active[u]);return o.reverse()}openEnd(a){let o=0;for(let u=this.activeTo.length-1;u>=0&&this.activeTo[u]>a;u--)o++;return o}}function compare(l,a,o,u,d,f){l.goto(a),o.goto(u);let p=u+d,g=u,b=u-a;for(;;){let O=l.to+b-o.to,S=O||l.endSide-o.endSide,A=S<0?l.to+b:o.to,M=Math.min(A,p);if(l.point||o.point?l.point&&o.point&&(l.point==o.point||l.point.eq(o.point))&&sameValues(l.activeForPoint(l.to),o.activeForPoint(o.to))||f.comparePoint(g,M,l.point,o.point):M>g&&!sameValues(l.active,o.active)&&f.compareRange(g,M,l.active,o.active),A>p)break;(O||l.openEnd!=o.openEnd)&&f.boundChange&&f.boundChange(A),g=A,S<=0&&l.next(),S>=0&&o.next()}}function sameValues(l,a){if(l.length!=a.length)return!1;for(let o=0;o<l.length;o++)if(l[o]!=a[o]&&!l[o].eq(a[o]))return!1;return!0}function remove(l,a){for(let o=a,u=l.length-1;o<u;o++)l[o]=l[o+1];l.pop()}function insert(l,a,o){for(let u=l.length-1;u>=a;u--)l[u+1]=l[u];l[a]=o}function findMinIndex(l,a){let o=-1,u=1e9;for(let d=0;d<a.length;d++)(a[d]-u||l[d].endSide-l[o].endSide)<0&&(o=d,u=a[d]);return o}function countColumn(l,a,o=l.length){let u=0;for(let d=0;d<o&&d<l.length;)l.charCodeAt(d)==9?(u+=a-u%a,d++):(u++,d=findClusterBreak(l,d));return u}function findColumn(l,a,o,u){for(let d=0,f=0;;){if(f>=a)return d;if(d==l.length)break;f+=l.charCodeAt(d)==9?o-f%o:1,d=findClusterBreak(l,d)}return u===!0?-1:l.length}const C$1="ͼ",COUNT=typeof Symbol>"u"?"__"+C$1:Symbol.for(C$1),SET=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),top=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class StyleModule{constructor(a,o){this.rules=[];let{finish:u}=o||{};function d(p){return/^@/.test(p)?[p]:p.split(/,\s*/)}function f(p,g,b,O){let S=[],A=/^@(\w+)\b/.exec(p[0]),M=A&&A[1]=="keyframes";if(A&&g==null)return b.push(p[0]+";");for(let E in g){let R=g[E];if(/&/.test(E))f(E.split(/,\s*/).map(L=>p.map(U=>L.replace(/&/,U))).reduce((L,U)=>L.concat(U)),R,b);else if(R&&typeof R=="object"){if(!A)throw new RangeError("The value of a property ("+E+") should be a primitive value.");f(d(E),R,S,M)}else R!=null&&S.push(E.replace(/_.*/,"").replace(/[A-Z]/g,L=>"-"+L.toLowerCase())+": "+R+";")}(S.length||M)&&b.push((u&&!A&&!O?p.map(u):p).join(", ")+" {"+S.join(" ")+"}")}for(let p in a)f(d(p),a[p],this.rules)}getRules(){return this.rules.join(`
`)}static newName(){let a=top[COUNT]||1;return top[COUNT]=a+1,C$1+a.toString(36)}static mount(a,o,u){let d=a[SET],f=u&&u.nonce;d?f&&d.setNonce(f):d=new StyleSet(a,f),d.mount(Array.isArray(o)?o:[o],a)}}let adoptedSet=new Map;class StyleSet{constructor(a,o){let u=a.ownerDocument||a,d=u.defaultView;if(!a.head&&a.adoptedStyleSheets&&d.CSSStyleSheet){let f=adoptedSet.get(u);if(f)return a[SET]=f;this.sheet=new d.CSSStyleSheet,adoptedSet.set(u,this)}else this.styleTag=u.createElement("style"),o&&this.styleTag.setAttribute("nonce",o);this.modules=[],a[SET]=this}mount(a,o){let u=this.sheet,d=0,f=0;for(let p=0;p<a.length;p++){let g=a[p],b=this.modules.indexOf(g);if(b<f&&b>-1&&(this.modules.splice(b,1),f--,b=-1),b==-1){if(this.modules.splice(f++,0,g),u)for(let O=0;O<g.rules.length;O++)u.insertRule(g.rules[O],d++)}else{for(;f<b;)d+=this.modules[f++].rules.length;d+=g.rules.length,f++}}if(u)o.adoptedStyleSheets.indexOf(this.sheet)<0&&(o.adoptedStyleSheets=[this.sheet,...o.adoptedStyleSheets]);else{let p="";for(let b=0;b<this.modules.length;b++)p+=this.modules[b].getRules()+`
`;this.styleTag.textContent=p;let g=o.head||o;this.styleTag.parentNode!=g&&g.insertBefore(this.styleTag,g.firstChild)}}setNonce(a){this.styleTag&&this.styleTag.getAttribute("nonce")!=a&&this.styleTag.setAttribute("nonce",a)}}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$1=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(l){var a=mac&&l.metaKey&&l.shiftKey&&!l.ctrlKey&&!l.altKey||ie$1&&l.shiftKey&&l.key&&l.key.length==1||l.key=="Unidentified",o=!a&&l.key||(l.shiftKey?shift:base)[l.keyCode]||l.key||"Unidentified";return o=="Esc"&&(o="Escape"),o=="Del"&&(o="Delete"),o=="Left"&&(o="ArrowLeft"),o=="Up"&&(o="ArrowUp"),o=="Right"&&(o="ArrowRight"),o=="Down"&&(o="ArrowDown"),o}function getSelection(l){let a;return l.nodeType==11?a=l.getSelection?l:l.ownerDocument:a=l,a.getSelection()}function contains(l,a){return a?l==a||l.contains(a.nodeType!=1?a.parentNode:a):!1}function hasSelection(l,a){if(!a.anchorNode)return!1;try{return contains(l,a.anchorNode)}catch{return!1}}function clientRectsFor(l){return l.nodeType==3?textRange(l,0,l.nodeValue.length).getClientRects():l.nodeType==1?l.getClientRects():[]}function isEquivalentPosition(l,a,o,u){return o?scanFor(l,a,o,u,-1)||scanFor(l,a,o,u,1):!1}function domIndex(l){for(var a=0;;a++)if(l=l.previousSibling,!l)return a}function isBlockElement(l){return l.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(l.nodeName)}function scanFor(l,a,o,u,d){for(;;){if(l==o&&a==u)return!0;if(a==(d<0?0:maxOffset(l))){if(l.nodeName=="DIV")return!1;let f=l.parentNode;if(!f||f.nodeType!=1)return!1;a=domIndex(l)+(d<0?0:1),l=f}else if(l.nodeType==1){if(l=l.childNodes[a+(d<0?-1:0)],l.nodeType==1&&l.contentEditable=="false")return!1;a=d<0?maxOffset(l):0}else return!1}}function maxOffset(l){return l.nodeType==3?l.nodeValue.length:l.childNodes.length}function flattenRect(l,a){let o=a?l.left:l.right;return{left:o,right:o,top:l.top,bottom:l.bottom}}function windowRect(l){let a=l.visualViewport;return a?{left:0,right:a.width,top:0,bottom:a.height}:{left:0,right:l.innerWidth,top:0,bottom:l.innerHeight}}function getScale(l,a){let o=a.width/l.offsetWidth,u=a.height/l.offsetHeight;return(o>.995&&o<1.005||!isFinite(o)||Math.abs(a.width-l.offsetWidth)<1)&&(o=1),(u>.995&&u<1.005||!isFinite(u)||Math.abs(a.height-l.offsetHeight)<1)&&(u=1),{scaleX:o,scaleY:u}}function scrollRectIntoView(l,a,o,u,d,f,p,g){let b=l.ownerDocument,O=b.defaultView||window;for(let S=l,A=!1;S&&!A;)if(S.nodeType==1){let M,E=S==b.body,R=1,L=1;if(E)M=windowRect(O);else{if(/^(fixed|sticky)$/.test(getComputedStyle(S).position)&&(A=!0),S.scrollHeight<=S.clientHeight&&S.scrollWidth<=S.clientWidth){S=S.assignedSlot||S.parentNode;continue}let re=S.getBoundingClientRect();({scaleX:R,scaleY:L}=getScale(S,re)),M={left:re.left,right:re.left+S.clientWidth*R,top:re.top,bottom:re.top+S.clientHeight*L}}let U=0,Z=0;if(d=="nearest")a.top<M.top?(Z=-(M.top-a.top+p),o>0&&a.bottom>M.bottom+Z&&(Z=a.bottom-M.bottom+Z+p)):a.bottom>M.bottom&&(Z=a.bottom-M.bottom+p,o<0&&a.top-Z<M.top&&(Z=-(M.top+Z-a.top+p)));else{let re=a.bottom-a.top,he=M.bottom-M.top;Z=(d=="center"&&re<=he?a.top+re/2-he/2:d=="start"||d=="center"&&o<0?a.top-p:a.bottom-he+p)-M.top}if(u=="nearest"?a.left<M.left?(U=-(M.left-a.left+f),o>0&&a.right>M.right+U&&(U=a.right-M.right+U+f)):a.right>M.right&&(U=a.right-M.right+f,o<0&&a.left<M.left+U&&(U=-(M.left+U-a.left+f))):U=(u=="center"?a.left+(a.right-a.left)/2-(M.right-M.left)/2:u=="start"==g?a.left-f:a.right-(M.right-M.left)+f)-M.left,U||Z)if(E)O.scrollBy(U,Z);else{let re=0,he=0;if(Z){let se=S.scrollTop;S.scrollTop+=Z/L,he=(S.scrollTop-se)*L}if(U){let se=S.scrollLeft;S.scrollLeft+=U/R,re=(S.scrollLeft-se)*R}a={left:a.left-re,top:a.top-he,right:a.right-re,bottom:a.bottom-he},re&&Math.abs(re-U)<1&&(u="nearest"),he&&Math.abs(he-Z)<1&&(d="nearest")}if(E)break;S=S.assignedSlot||S.parentNode}else if(S.nodeType==11)S=S.host;else break}function scrollableParents(l){let a=l.ownerDocument,o,u;for(let d=l.parentNode;d&&!(d==a.body||o&&u);)if(d.nodeType==1)!u&&d.scrollHeight>d.clientHeight&&(u=d),!o&&d.scrollWidth>d.clientWidth&&(o=d),d=d.assignedSlot||d.parentNode;else if(d.nodeType==11)d=d.host;else break;return{x:o,y:u}}class DOMSelectionState{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(a){return this.anchorNode==a.anchorNode&&this.anchorOffset==a.anchorOffset&&this.focusNode==a.focusNode&&this.focusOffset==a.focusOffset}setRange(a){let{anchorNode:o,focusNode:u}=a;this.set(o,Math.min(a.anchorOffset,o?maxOffset(o):0),u,Math.min(a.focusOffset,u?maxOffset(u):0))}set(a,o,u,d){this.anchorNode=a,this.anchorOffset=o,this.focusNode=u,this.focusOffset=d}}let preventScrollSupported=null;function focusPreventScroll(l){if(l.setActive)return l.setActive();if(preventScrollSupported)return l.focus(preventScrollSupported);let a=[];for(let o=l;o&&(a.push(o,o.scrollTop,o.scrollLeft),o!=o.ownerDocument);o=o.parentNode);if(l.focus(preventScrollSupported==null?{get preventScroll(){return preventScrollSupported={preventScroll:!0},!0}}:void 0),!preventScrollSupported){preventScrollSupported=!1;for(let o=0;o<a.length;){let u=a[o++],d=a[o++],f=a[o++];u.scrollTop!=d&&(u.scrollTop=d),u.scrollLeft!=f&&(u.scrollLeft=f)}}}let scratchRange;function textRange(l,a,o=a){let u=scratchRange||(scratchRange=document.createRange());return u.setEnd(l,o),u.setStart(l,a),u}function dispatchKey(l,a,o,u){let d={key:a,code:a,keyCode:o,which:o,cancelable:!0};u&&({altKey:d.altKey,ctrlKey:d.ctrlKey,shiftKey:d.shiftKey,metaKey:d.metaKey}=u);let f=new KeyboardEvent("keydown",d);f.synthetic=!0,l.dispatchEvent(f);let p=new KeyboardEvent("keyup",d);return p.synthetic=!0,l.dispatchEvent(p),f.defaultPrevented||p.defaultPrevented}function getRoot(l){for(;l;){if(l&&(l.nodeType==9||l.nodeType==11&&l.host))return l;l=l.assignedSlot||l.parentNode}return null}function clearAttributes(l){for(;l.attributes.length;)l.removeAttributeNode(l.attributes[0])}function atElementStart(l,a){let o=a.focusNode,u=a.focusOffset;if(!o||a.anchorNode!=o||a.anchorOffset!=u)return!1;for(u=Math.min(u,maxOffset(o));;)if(u){if(o.nodeType!=1)return!1;let d=o.childNodes[u-1];d.contentEditable=="false"?u--:(o=d,u=maxOffset(o))}else{if(o==l)return!0;u=domIndex(o),o=o.parentNode}}function isScrolledToBottom(l){return l.scrollTop>Math.max(1,l.scrollHeight-l.clientHeight-4)}function textNodeBefore(l,a){for(let o=l,u=a;;){if(o.nodeType==3&&u>0)return{node:o,offset:u};if(o.nodeType==1&&u>0){if(o.contentEditable=="false")return null;o=o.childNodes[u-1],u=maxOffset(o)}else if(o.parentNode&&!isBlockElement(o))u=domIndex(o),o=o.parentNode;else return null}}function textNodeAfter(l,a){for(let o=l,u=a;;){if(o.nodeType==3&&u<o.nodeValue.length)return{node:o,offset:u};if(o.nodeType==1&&u<o.childNodes.length){if(o.contentEditable=="false")return null;o=o.childNodes[u],u=0}else if(o.parentNode&&!isBlockElement(o))u=domIndex(o)+1,o=o.parentNode;else return null}}class DOMPos{constructor(a,o,u=!0){this.node=a,this.offset=o,this.precise=u}static before(a,o){return new DOMPos(a.parentNode,domIndex(a),o)}static after(a,o){return new DOMPos(a.parentNode,domIndex(a)+1,o)}}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(a){let o=this.posAtStart;for(let u of this.children){if(u==a)return o;o+=u.length+u.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(a){return this.posBefore(a)+a.length}sync(a,o){if(this.flags&2){let u=this.dom,d=null,f;for(let p of this.children){if(p.flags&7){if(!p.dom&&(f=d?d.nextSibling:u.firstChild)){let g=ContentView.get(f);(!g||!g.parent&&g.canReuseDOM(p))&&p.reuseDOM(f)}p.sync(a,o),p.flags&=-8}if(f=d?d.nextSibling:u.firstChild,o&&!o.written&&o.node==u&&f!=p.dom&&(o.written=!0),p.dom.parentNode==u)for(;f&&f!=p.dom;)f=rm$1(f);else u.insertBefore(p.dom,f);d=p.dom}for(f=d?d.nextSibling:u.firstChild,f&&o&&o.node==u&&(o.written=!0);f;)f=rm$1(f)}else if(this.flags&1)for(let u of this.children)u.flags&7&&(u.sync(a,o),u.flags&=-8)}reuseDOM(a){}localPosFromDOM(a,o){let u;if(a==this.dom)u=this.dom.childNodes[o];else{let d=maxOffset(a)==0?0:o==0?-1:1;for(;;){let f=a.parentNode;if(f==this.dom)break;d==0&&f.firstChild!=f.lastChild&&(a==f.firstChild?d=-1:d=1),a=f}d<0?u=a:u=a.nextSibling}if(u==this.dom.firstChild)return 0;for(;u&&!ContentView.get(u);)u=u.nextSibling;if(!u)return this.length;for(let d=0,f=0;;d++){let p=this.children[d];if(p.dom==u)return f;f+=p.length+p.breakAfter}}domBoundsAround(a,o,u=0){let d=-1,f=-1,p=-1,g=-1;for(let b=0,O=u,S=u;b<this.children.length;b++){let A=this.children[b],M=O+A.length;if(O<a&&M>o)return A.domBoundsAround(a,o,O);if(M>=a&&d==-1&&(d=b,f=O),O>o&&A.dom.parentNode==this.dom){p=b,g=S;break}S=M,O=M+A.breakAfter}return{from:f,to:g<0?u+this.length:g,startDOM:(d?this.children[d-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:p<this.children.length&&p>=0?this.children[p].dom:null}}markDirty(a=!1){this.flags|=2,this.markParentsDirty(a)}markParentsDirty(a){for(let o=this.parent;o;o=o.parent){if(a&&(o.flags|=2),o.flags&1)return;o.flags|=1,a=!1}}setParent(a){this.parent!=a&&(this.parent=a,this.flags&7&&this.markParentsDirty(!0))}setDOM(a){this.dom!=a&&(this.dom&&(this.dom.cmView=null),this.dom=a,a.cmView=this)}get rootView(){for(let a=this;;){let o=a.parent;if(!o)return a;a=o}}replaceChildren(a,o,u=noChildren){this.markDirty();for(let d=a;d<o;d++){let f=this.children[d];f.parent==this&&u.indexOf(f)<0&&f.destroy()}u.length<250?this.children.splice(a,o-a,...u):this.children=[].concat(this.children.slice(0,a),u,this.children.slice(o));for(let d=0;d<u.length;d++)u[d].setParent(this)}ignoreMutation(a){return!1}ignoreEvent(a){return!1}childCursor(a=this.length){return new ChildCursor(this.children,a,this.children.length)}childPos(a,o=1){return this.childCursor().findPos(a,o)}toString(){let a=this.constructor.name.replace("View","");return a+(this.children.length?"("+this.children.join()+")":this.length?"["+(a=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(a){return a.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(a,o,u,d,f,p){return!1}become(a){return!1}canReuseDOM(a){return a.constructor==this.constructor&&!((this.flags|a.flags)&8)}getSide(){return 0}destroy(){for(let a of this.children)a.parent==this&&a.destroy();this.parent=null}}ContentView.prototype.breakAfter=0;function rm$1(l){let a=l.nextSibling;return l.parentNode.removeChild(l),a}class ChildCursor{constructor(a,o,u){this.children=a,this.pos=o,this.i=u,this.off=0}findPos(a,o=1){for(;;){if(a>this.pos||a==this.pos&&(o>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=a-this.pos,this;let u=this.children[--this.i];this.pos-=u.length+u.breakAfter}}}function replaceRange(l,a,o,u,d,f,p,g,b){let{children:O}=l,S=O.length?O[a]:null,A=f.length?f[f.length-1]:null,M=A?A.breakAfter:p;if(!(a==u&&S&&!p&&!M&&f.length<2&&S.merge(o,d,f.length?A:null,o==0,g,b))){if(u<O.length){let E=O[u];E&&(d<E.length||E.breakAfter&&A?.breakAfter)?(a==u&&(E=E.split(d),d=0),!M&&A&&E.merge(0,d,A,!0,0,b)?f[f.length-1]=E:((d||E.children.length&&!E.children[0].length)&&E.merge(0,d,null,!1,0,b),f.push(E))):E?.breakAfter&&(A?A.breakAfter=1:p=1),u++}for(S&&(S.breakAfter=p,o>0&&(!p&&f.length&&S.merge(o,S.length,f[0],!1,g,0)?S.breakAfter=f.shift().breakAfter:(o<S.length||S.children.length&&S.children[S.children.length-1].length==0)&&S.merge(o,S.length,null,!1,g,0),a++));a<u&&f.length;)if(O[u-1].become(f[f.length-1]))u--,f.pop(),b=f.length?0:g;else if(O[a].become(f[0]))a++,f.shift(),g=f.length?0:b;else break;!f.length&&a&&u<O.length&&!O[a-1].breakAfter&&O[u].merge(0,0,O[a-1],!1,g,b)&&a--,(a<u||f.length)&&l.replaceChildren(a,u,f)}}function mergeChildrenInto(l,a,o,u,d,f){let p=l.childCursor(),{i:g,off:b}=p.findPos(o,1),{i:O,off:S}=p.findPos(a,-1),A=a-o;for(let M of u)A+=M.length;l.length+=A,replaceRange(l,O,S,g,b,u,0,d,f)}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=!!(ie_upto10||ie_11up||ie_edge),gecko=!ie&&/gecko\/(\d+)/i.test(nav.userAgent),chrome=!ie&&/Chrome\/(\d+)/.exec(nav.userAgent),webkit="webkitFontSmoothing"in doc.documentElement.style,safari=!ie&&/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_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(a){super(),this.text=a}get length(){return this.text.length}createDOM(a){this.setDOM(a||document.createTextNode(this.text))}sync(a,o){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(o&&o.node==this.dom&&(o.written=!0),this.dom.nodeValue=this.text)}reuseDOM(a){a.nodeType==3&&this.createDOM(a)}merge(a,o,u){return this.flags&8||u&&(!(u instanceof TextView)||this.length-(o-a)+u.length>MaxJoinLen||u.flags&8)?!1:(this.text=this.text.slice(0,a)+(u?u.text:"")+this.text.slice(o),this.markDirty(),!0)}split(a){let o=new TextView(this.text.slice(a));return this.text=this.text.slice(0,a),this.markDirty(),o.flags|=this.flags&8,o}localPosFromDOM(a,o){return a==this.dom?o:o?this.text.length:0}domAtPos(a){return new DOMPos(this.dom,a)}domBoundsAround(a,o,u){return{from:u,to:u+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(a,o){return textCoords(this.dom,a,o)}}class MarkView extends ContentView{constructor(a,o=[],u=0){super(),this.mark=a,this.children=o,this.length=u;for(let d of o)d.setParent(this)}setAttrs(a){if(clearAttributes(a),this.mark.class&&(a.className=this.mark.class),this.mark.attrs)for(let o in this.mark.attrs)a.setAttribute(o,this.mark.attrs[o]);return a}canReuseDOM(a){return super.canReuseDOM(a)&&!((this.flags|a.flags)&8)}reuseDOM(a){a.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(a),this.flags|=6)}sync(a,o){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(a,o)}merge(a,o,u,d,f,p){return u&&(!(u instanceof MarkView&&u.mark.eq(this.mark))||a&&f<=0||o<this.length&&p<=0)?!1:(mergeChildrenInto(this,a,o,u?u.children.slice():[],f-1,p-1),this.markDirty(),!0)}split(a){let o=[],u=0,d=-1,f=0;for(let g of this.children){let b=u+g.length;b>a&&o.push(u<a?g.split(a-u):g),d<0&&u>=a&&(d=f),u=b,f++}let p=this.length-a;return this.length=a,d>-1&&(this.children.length=d,this.markDirty()),new MarkView(this.mark,o,p)}domAtPos(a){return inlineDOMAtPos(this,a)}coordsAt(a,o){return coordsInChildren(this,a,o)}}function textCoords(l,a,o){let u=l.nodeValue.length;a>u&&(a=u);let d=a,f=a,p=0;a==0&&o<0||a==u&&o>=0?browser.chrome||browser.gecko||(a?(d--,p=1):f<u&&(f++,p=-1)):o<0?d--:f<u&&f++;let g=textRange(l,d,f).getClientRects();if(!g.length)return null;let b=g[(p?p<0:o>=0)?0:g.length-1];return browser.safari&&!p&&b.width==0&&(b=Array.prototype.find.call(g,O=>O.width)||b),p?flattenRect(b,p<0):b||null}class WidgetView extends ContentView{static create(a,o,u){return new WidgetView(a,o,u)}constructor(a,o,u){super(),this.widget=a,this.length=o,this.side=u,this.prevWidget=null}split(a){let o=WidgetView.create(this.widget,this.length-a,this.side);return this.length-=a,o}sync(a){(!this.dom||!this.widget.updateDOM(this.dom,a))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(a)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(a,o,u,d,f,p){return u&&(!(u instanceof WidgetView)||!this.widget.compare(u.widget)||a>0&&f<=0||o<this.length&&p<=0)?!1:(this.length=a+(u?u.length:0)+(this.length-o),!0)}become(a){return a instanceof WidgetView&&a.side==this.side&&this.widget.constructor==a.widget.constructor?(this.widget.compare(a.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=a.widget,this.length=a.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(a){return this.widget.ignoreEvent(a)}get overrideDOMText(){if(this.length==0)return Text.empty;let a=this;for(;a.parent;)a=a.parent;let{view:o}=a,u=o&&o.state.doc,d=this.posAtStart;return u?u.slice(d,d+this.length):Text.empty}domAtPos(a){return(this.length?a==0:this.side>0)?DOMPos.before(this.dom):DOMPos.after(this.dom,a==this.length)}domBoundsAround(){return null}coordsAt(a,o){let u=this.widget.coordsAt(this.dom,a,o);if(u)return u;let d=this.dom.getClientRects(),f=null;if(!d.length)return null;let p=this.side?this.side<0:a>0;for(let g=p?d.length-1:0;f=d[g],!(a>0?g==0:g==d.length-1||f.top<f.bottom);g+=p?-1:1);return flattenRect(f,!p)}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(a){super(),this.side=a}get length(){return 0}merge(){return!1}become(a){return a instanceof WidgetBufferView&&a.side==this.side}split(){return new WidgetBufferView(this.side)}sync(){if(!this.dom){let a=document.createElement("img");a.className="cm-widgetBuffer",a.setAttribute("aria-hidden","true"),this.setDOM(a)}}getSide(){return this.side}domAtPos(a){return this.side>0?DOMPos.before(this.dom):DOMPos.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(a){return this.dom.getBoundingClientRect()}get overrideDOMText(){return Text.empty}get isHidden(){return!0}}TextView.prototype.children=WidgetView.prototype.children=WidgetBufferView.prototype.children=noChildren;function inlineDOMAtPos(l,a){let o=l.dom,{children:u}=l,d=0;for(let f=0;d<u.length;d++){let p=u[d],g=f+p.length;if(!(g==f&&p.getSide()<=0)){if(a>f&&a<g&&p.dom.parentNode==o)return p.domAtPos(a-f);if(a<=f)break;f=g}}for(let f=d;f>0;f--){let p=u[f-1];if(p.dom.parentNode==o)return p.domAtPos(p.length)}for(let f=d;f<u.length;f++){let p=u[f];if(p.dom.parentNode==o)return p.domAtPos(0)}return new DOMPos(o,0)}function joinInlineInto(l,a,o){let u,{children:d}=l;o>0&&a instanceof MarkView&&d.length&&(u=d[d.length-1])instanceof MarkView&&u.mark.eq(a.mark)?joinInlineInto(u,a.children[0],o-1):(d.push(a),a.setParent(l)),l.length+=a.length}function coordsInChildren(l,a,o){let u=null,d=-1,f=null,p=-1;function g(O,S){for(let A=0,M=0;A<O.children.length&&M<=S;A++){let E=O.children[A],R=M+E.length;R>=S&&(E.children.length?g(E,S-M):(!f||f.isHidden&&o>0)&&(R>S||M==R&&E.getSide()>0)?(f=E,p=S-M):(M<S||M==R&&E.getSide()<0&&!E.isHidden)&&(u=E,d=S-M)),M=R}}g(l,a);let b=(o<0?u:f)||u||f;return b?b.coordsAt(Math.max(0,b==u?d:p),o):fallbackRect(l)}function fallbackRect(l){let a=l.dom.lastChild;if(!a)return l.dom.getBoundingClientRect();let o=clientRectsFor(a);return o[o.length-1]||null}function combineAttrs(l,a){for(let o in l)o=="class"&&a.class?a.class+=" "+l.class:o=="style"&&a.style?a.style+=";"+l.style:a[o]=l[o];return a}const noAttrs$1=Object.create(null);function attrsEq(l,a,o){if(l==a)return!0;l||(l=noAttrs$1),a||(a=noAttrs$1);let u=Object.keys(l),d=Object.keys(a);if(u.length-(o&&u.indexOf(o)>-1?1:0)!=d.length-(o&&d.indexOf(o)>-1?1:0))return!1;for(let f of u)if(f!=o&&(d.indexOf(f)==-1||l[f]!==a[f]))return!1;return!0}function updateAttrs(l,a,o){let u=!1;if(a)for(let d in a)o&&d in o||(u=!0,d=="style"?l.style.cssText="":l.removeAttribute(d));if(o)for(let d in o)a&&a[d]==o[d]||(u=!0,d=="style"?l.style.cssText=o[d]:l.setAttribute(d,o[d]));return u}function getAttrs(l){let a=Object.create(null);for(let o=0;o<l.attributes.length;o++){let u=l.attributes[o];a[u.name]=u.value}return a}class WidgetType{eq(a){return!1}updateDOM(a,o){return!1}compare(a){return this==a||this.constructor==a.constructor&&this.eq(a)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(a){return!0}coordsAt(a,o,u){return null}get isHidden(){return!1}get editable(){return!1}destroy(a){}}var BlockType=function(l){return l[l.Text=0]="Text",l[l.WidgetBefore=1]="WidgetBefore",l[l.WidgetAfter=2]="WidgetAfter",l[l.WidgetRange=3]="WidgetRange",l}(BlockType||(BlockType={}));class Decoration extends RangeValue{constructor(a,o,u,d){super(),this.startSide=a,this.endSide=o,this.widget=u,this.spec=d}get heightRelevant(){return!1}static mark(a){return new MarkDecoration(a)}static widget(a){let o=Math.max(-1e4,Math.min(1e4,a.side||0)),u=!!a.block;return o+=u&&!a.inlineOrder?o>0?3e8:-4e8:o>0?1e8:-1e8,new PointDecoration(a,o,o,u,a.widget||null,!1)}static replace(a){let o=!!a.block,u,d;if(a.isBlockGap)u=-5e8,d=4e8;else{let{start:f,end:p}=getInclusive(a,o);u=(f?o?-3e8:-1:5e8)-1,d=(p?o?2e8:1:-6e8)+1}return new PointDecoration(a,u,d,o,a.widget||null,!0)}static line(a){return new LineDecoration(a)}static set(a,o=!1){return RangeSet.of(a,o)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Decoration.none=RangeSet.empty;class MarkDecoration extends Decoration{constructor(a){let{start:o,end:u}=getInclusive(a);super(o?-1:5e8,u?1:-6e8,null,a),this.tagName=a.tagName||"span",this.class=a.class||"",this.attrs=a.attributes||null}eq(a){var o,u;return this==a||a instanceof MarkDecoration&&this.tagName==a.tagName&&(this.class||((o=this.attrs)===null||o===void 0?void 0:o.class))==(a.class||((u=a.attrs)===null||u===void 0?void 0:u.class))&&attrsEq(this.attrs,a.attrs,"class")}range(a,o=a){if(a>=o)throw new RangeError("Mark decorations may not be empty");return super.range(a,o)}}MarkDecoration.prototype.point=!1;class LineDecoration extends Decoration{constructor(a){super(-2e8,-2e8,null,a)}eq(a){return a instanceof LineDecoration&&this.spec.class==a.spec.class&&attrsEq(this.spec.attributes,a.spec.attributes)}range(a,o=a){if(o!=a)throw new RangeError("Line decoration ranges must be zero-length");return super.range(a,o)}}LineDecoration.prototype.mapMode=MapMode.TrackBefore,LineDecoration.prototype.point=!0;class PointDecoration extends Decoration{constructor(a,o,u,d,f,p){super(o,u,f,a),this.block=d,this.isReplace=p,this.mapMode=d?o<=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(a){return a instanceof PointDecoration&&widgetsEq(this.widget,a.widget)&&this.block==a.block&&this.startSide==a.startSide&&this.endSide==a.endSide}range(a,o=a){if(this.isReplace&&(a>o||a==o&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&o!=a)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(a,o)}}PointDecoration.prototype.point=!0;function getInclusive(l,a=!1){let{inclusiveStart:o,inclusiveEnd:u}=l;return o==null&&(o=l.inclusive),u==null&&(u=l.inclusive),{start:o??a,end:u??a}}function widgetsEq(l,a){return l==a||!!(l&&a&&l.compare(a))}function addRange(l,a,o,u=0){let d=o.length-1;d>=0&&o[d]+u>=l?o[d]=Math.max(o[d],a):o.push(l,a)}class LineView extends ContentView{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(a,o,u,d,f,p){if(u){if(!(u instanceof LineView))return!1;this.dom||u.transferDOM(this)}return d&&this.setDeco(u?u.attrs:null),mergeChildrenInto(this,a,o,u?u.children.slice():[],f,p),!0}split(a){let o=new LineView;if(o.breakAfter=this.breakAfter,this.length==0)return o;let{i:u,off:d}=this.childPos(a);d&&(o.append(this.children[u].split(d),0),this.children[u].merge(d,this.children[u].length,null,!1,0,0),u++);for(let f=u;f<this.children.length;f++)o.append(this.children[f],0);for(;u>0&&this.children[u-1].length==0;)this.children[--u].destroy();return this.children.length=u,this.markDirty(),this.length=a,o}transferDOM(a){this.dom&&(this.markDirty(),a.setDOM(this.dom),a.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(a){attrsEq(this.attrs,a)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=a)}append(a,o){joinInlineInto(this,a,o)}addLineDeco(a){let o=a.spec.attributes,u=a.spec.class;o&&(this.attrs=combineAttrs(o,this.attrs||{})),u&&(this.attrs=combineAttrs({class:u},this.attrs||{}))}domAtPos(a){return inlineDOMAtPos(this,a)}reuseDOM(a){a.nodeName=="DIV"&&(this.setDOM(a),this.flags|=6)}sync(a,o){var u;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(a,o);let d=this.dom.lastChild;for(;d&&ContentView.get(d)instanceof MarkView;)d=d.lastChild;if(!d||!this.length||d.nodeName!="BR"&&((u=ContentView.get(d))===null||u===void 0?void 0:u.isEditable)==!1&&(!browser.ios||!this.children.some(f=>f instanceof TextView))){let f=document.createElement("BR");f.cmIgnore=!0,this.dom.appendChild(f)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let a=0,o;for(let u of this.children){if(!(u instanceof TextView)||/[^ -~]/.test(u.text))return null;let d=clientRectsFor(u.dom);if(d.length!=1)return null;a+=d[0].width,o=d[0].height}return a?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:a/this.length,textHeight:o}:null}coordsAt(a,o){let u=coordsInChildren(this,a,o);if(!this.children.length&&u&&this.parent){let{heightOracle:d}=this.parent.view.viewState,f=u.bottom-u.top;if(Math.abs(f-d.lineHeight)<2&&d.textHeight<f){let p=(f-d.textHeight)/2;return{top:u.top+p,bottom:u.bottom-p,left:u.left,right:u.left}}}return u}become(a){return a instanceof LineView&&this.children.length==0&&a.children.length==0&&attrsEq(this.attrs,a.attrs)&&this.breakAfter==a.breakAfter}covers(){return!0}static find(a,o){for(let u=0,d=0;u<a.children.length;u++){let f=a.children[u],p=d+f.length;if(p>=o){if(f instanceof LineView)return f;if(p>o)break}d=p+f.breakAfter}return null}}class BlockWidgetView extends ContentView{constructor(a,o,u){super(),this.widget=a,this.length=o,this.deco=u,this.breakAfter=0,this.prevWidget=null}merge(a,o,u,d,f,p){return u&&(!(u instanceof BlockWidgetView)||!this.widget.compare(u.widget)||a>0&&f<=0||o<this.length&&p<=0)?!1:(this.length=a+(u?u.length:0)+(this.length-o),!0)}domAtPos(a){return a==0?DOMPos.before(this.dom):DOMPos.after(this.dom,a==this.length)}split(a){let o=this.length-a;this.length=a;let u=new BlockWidgetView(this.widget,o,this.deco);return u.breakAfter=this.breakAfter,u}get children(){return noChildren}sync(a){(!this.dom||!this.widget.updateDOM(this.dom,a))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(a)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):Text.empty}domBoundsAround(){return null}become(a){return a instanceof BlockWidgetView&&a.widget.constructor==this.widget.constructor?(a.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=a.widget,this.length=a.length,this.deco=a.deco,this.breakAfter=a.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(a){return this.widget.ignoreEvent(a)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(a,o){let u=this.widget.coordsAt(this.dom,a,o);return u||(this.widget instanceof BlockGapWidget?null:flattenRect(this.dom.getBoundingClientRect(),this.length?a==0:o<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(a){let{startSide:o,endSide:u}=this.deco;return o==u?!1:a<0?o<0:u>0}}class BlockGapWidget extends WidgetType{constructor(a){super(),this.height=a}toDOM(){let a=document.createElement("div");return a.className="cm-gap",this.updateDOM(a),a}eq(a){return a.height==this.height}updateDOM(a){return a.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class ContentBuilder{constructor(a,o,u,d){this.doc=a,this.pos=o,this.end=u,this.disallowBlockEffectsFor=d,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=a.iter(),this.skip=o}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let a=this.content[this.content.length-1];return!(a.breakAfter||a instanceof BlockWidgetView&&a.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new LineView),this.atCursorPos=!0),this.curLine}flushBuffer(a=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(wrapMarks(new WidgetBufferView(-1),a),a.length),this.pendingBuffer=0)}addBlockWidget(a){this.flushBuffer(),this.curLine=null,this.content.push(a)}finish(a){this.pendingBuffer&&a<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(a&&this.content.length&&this.content[this.content.length-1]instanceof BlockWidgetView)&&this.getLine()}buildText(a,o,u){for(;a>0;){if(this.textOff==this.text.length){let{value:f,lineBreak:p,done:g}=this.cursor.next(this.skip);if(this.skip=0,g)throw new Error("Ran out of text content when drawing inline views");if(p){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,a--;continue}else this.text=f,this.textOff=0}let d=Math.min(this.text.length-this.textOff,a,512);this.flushBuffer(o.slice(o.length-u)),this.getLine().append(wrapMarks(new TextView(this.text.slice(this.textOff,this.textOff+d)),o),u),this.atCursorPos=!0,this.textOff+=d,a-=d,u=0}}span(a,o,u,d){this.buildText(o-a,u,d),this.pos=o,this.openStart<0&&(this.openStart=d)}point(a,o,u,d,f,p){if(this.disallowBlockEffectsFor[p]&&u instanceof PointDecoration){if(u.block)throw new RangeError("Block decorations may not be specified via plugins");if(o>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let g=o-a;if(u instanceof PointDecoration)if(u.block)u.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new BlockWidgetView(u.widget||NullWidget.block,g,u));else{let b=WidgetView.create(u.widget||NullWidget.inline,g,g?0:u.startSide),O=this.atCursorPos&&!b.isEditable&&f<=d.length&&(a<o||u.startSide>0),S=!b.isEditable&&(a<o||f>d.length||u.startSide<=0),A=this.getLine();this.pendingBuffer==2&&!O&&!b.isEditable&&(this.pendingBuffer=0),this.flushBuffer(d),O&&(A.append(wrapMarks(new WidgetBufferView(1),d),f),f=d.length+Math.max(0,f-d.length)),A.append(wrapMarks(b,d),f),this.atCursorPos=S,this.pendingBuffer=S?a<o||f>d.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=d.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(u);g&&(this.textOff+g<=this.text.length?this.textOff+=g:(this.skip+=g-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=o),this.openStart<0&&(this.openStart=f)}static build(a,o,u,d,f){let p=new ContentBuilder(a,o,u,f);return p.openEnd=RangeSet.spans(d,o,u,p),p.openStart<0&&(p.openStart=p.openEnd),p.finish(p.openEnd),p}}function wrapMarks(l,a){for(let o of a)l=new MarkView(o,[l],l.length);return l}class NullWidget extends WidgetType{constructor(a){super(),this.tag=a}eq(a){return a.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(a){return a.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}NullWidget.inline=new NullWidget("span"),NullWidget.block=new NullWidget("div");var Direction=function(l){return l[l.LTR=0]="LTR",l[l.RTL=1]="RTL",l}(Direction||(Direction={}));const LTR=Direction.LTR,RTL=Direction.RTL;function dec(l){let a=[];for(let o=0;o<l.length;o++)a.push(1<<+l[o]);return a}const LowTypes=dec("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),ArabicTypes=dec("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Brackets=Object.create(null),BracketStack=[];for(let l of["()","[]","{}"]){let a=l.charCodeAt(0),o=l.charCodeAt(1);Brackets[a]=o,Brackets[o]=-a}function charType(l){return l<=247?LowTypes[l]:1424<=l&&l<=1524?2:1536<=l&&l<=1785?ArabicTypes[l-1536]:1774<=l&&l<=2220?4:8192<=l&&l<=8204?256:64336<=l&&l<=65023?4:1}const BidiRE=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class BidiSpan{get dir(){return this.level%2?RTL:LTR}constructor(a,o,u){this.from=a,this.to=o,this.level=u}side(a,o){return this.dir==o==a?this.to:this.from}forward(a,o){return a==(this.dir==o)}static find(a,o,u,d){let f=-1;for(let p=0;p<a.length;p++){let g=a[p];if(g.from<=o&&g.to>=o){if(g.level==u)return p;(f<0||(d!=0?d<0?g.from<o:g.to>o:a[f].level>g.level))&&(f=p)}}if(f<0)throw new RangeError("Index out of range");return f}}function isolatesEq(l,a){if(l.length!=a.length)return!1;for(let o=0;o<l.length;o++){let u=l[o],d=a[o];if(u.from!=d.from||u.to!=d.to||u.direction!=d.direction||!isolatesEq(u.inner,d.inner))return!1}return!0}const types=[];function computeCharTypes(l,a,o,u,d){for(let f=0;f<=u.length;f++){let p=f?u[f-1].to:a,g=f<u.length?u[f].from:o,b=f?256:d;for(let O=p,S=b,A=b;O<g;O++){let M=charType(l.charCodeAt(O));M==512?M=S:M==8&&A==4&&(M=16),types[O]=M==4?2:M,M&7&&(A=M),S=M}for(let O=p,S=b,A=b;O<g;O++){let M=types[O];if(M==128)O<g-1&&S==types[O+1]&&S&24?M=types[O]=S:types[O]=256;else if(M==64){let E=O+1;for(;E<g&&types[E]==64;)E++;let R=O&&S==8||E<o&&types[E]==8?A==1?1:8:256;for(let L=O;L<E;L++)types[L]=R;O=E-1}else M==8&&A==1&&(types[O]=1);S=M,M&7&&(A=M)}}}function processBracketPairs(l,a,o,u,d){let f=d==1?2:1;for(let p=0,g=0,b=0;p<=u.length;p++){let O=p?u[p-1].to:a,S=p<u.length?u[p].from:o;for(let A=O,M,E,R;A<S;A++)if(E=Brackets[M=l.charCodeAt(A)])if(E<0){for(let L=g-3;L>=0;L-=3)if(BracketStack[L+1]==-E){let U=BracketStack[L+2],Z=U&2?d:U&4?U&1?f:d:0;Z&&(types[A]=types[BracketStack[L]]=Z),g=L;break}}else{if(BracketStack.length==189)break;BracketStack[g++]=A,BracketStack[g++]=M,BracketStack[g++]=b}else if((R=types[A])==2||R==1){let L=R==d;b=L?0:1;for(let U=g-3;U>=0;U-=3){let Z=BracketStack[U+2];if(Z&2)break;if(L)BracketStack[U+2]|=2;else{if(Z&4)break;BracketStack[U+2]|=4}}}}}function processNeutrals(l,a,o,u){for(let d=0,f=u;d<=o.length;d++){let p=d?o[d-1].to:l,g=d<o.length?o[d].from:a;for(let b=p;b<g;){let O=types[b];if(O==256){let S=b+1;for(;;)if(S==g){if(d==o.length)break;S=o[d++].to,g=d<o.length?o[d].from:a}else if(types[S]==256)S++;else break;let A=f==1,M=(S<a?types[S]:u)==1,E=A==M?A?1:2:u;for(let R=S,L=d,U=L?o[L-1].to:l;R>b;)R==U&&(R=o[--L].from,U=L?o[L-1].to:l),types[--R]=E;b=S}else f=O,b++}}}function emitSpans(l,a,o,u,d,f,p){let g=u%2?2:1;if(u%2==d%2)for(let b=a,O=0;b<o;){let S=!0,A=!1;if(O==f.length||b<f[O].from){let L=types[b];L!=g&&(S=!1,A=L==16)}let M=!S&&g==1?[]:null,E=S?u:u+1,R=b;e:for(;;)if(O<f.length&&R==f[O].from){if(A)break e;let L=f[O];if(!S)for(let U=L.to,Z=O+1;;){if(U==o)break e;if(Z<f.length&&f[Z].from==U)U=f[Z++].to;else{if(types[U]==g)break e;break}}if(O++,M)M.push(L);else{L.from>b&&p.push(new BidiSpan(b,L.from,E));let U=L.direction==LTR!=!(E%2);computeSectionOrder(l,U?u+1:u,d,L.inner,L.from,L.to,p),b=L.to}R=L.to}else{if(R==o||(S?types[R]!=g:types[R]==g))break;R++}M?emitSpans(l,b,R,u+1,d,M,p):b<R&&p.push(new BidiSpan(b,R,E)),b=R}else for(let b=o,O=f.length;b>a;){let S=!0,A=!1;if(!O||b>f[O-1].to){let L=types[b-1];L!=g&&(S=!1,A=L==16)}let M=!S&&g==1?[]:null,E=S?u:u+1,R=b;e:for(;;)if(O&&R==f[O-1].to){if(A)break e;let L=f[--O];if(!S)for(let U=L.from,Z=O;;){if(U==a)break e;if(Z&&f[Z-1].to==U)U=f[--Z].from;else{if(types[U-1]==g)break e;break}}if(M)M.push(L);else{L.to<b&&p.push(new BidiSpan(L.to,b,E));let U=L.direction==LTR!=!(E%2);computeSectionOrder(l,U?u+1:u,d,L.inner,L.from,L.to,p),b=L.from}R=L.from}else{if(R==a||(S?types[R-1]!=g:types[R-1]==g))break;R--}M?emitSpans(l,R,b,u+1,d,M,p):R<b&&p.push(new BidiSpan(R,b,E)),b=R}}function computeSectionOrder(l,a,o,u,d,f,p){let g=a%2?2:1;computeCharTypes(l,d,f,u,g),processBracketPairs(l,d,f,u,g),processNeutrals(d,f,u,g),emitSpans(l,d,f,a,o,u,p)}function computeOrder(l,a,o){if(!l)return[new BidiSpan(0,0,a==RTL?1:0)];if(a==LTR&&!o.length&&!BidiRE.test(l))return trivialOrder(l.length);if(o.length)for(;l.length>types.length;)types[types.length]=256;let u=[],d=a==LTR?0:1;return computeSectionOrder(l,d,d,o,0,l.length,u),u}function trivialOrder(l){return[new BidiSpan(0,l,0)]}let movedOver="";function moveVisually(l,a,o,u,d){var f;let p=u.head-l.from,g=BidiSpan.find(a,p,(f=u.bidiLevel)!==null&&f!==void 0?f:-1,u.assoc),b=a[g],O=b.side(d,o);if(p==O){let M=g+=d?1:-1;if(M<0||M>=a.length)return null;b=a[g=M],p=b.side(!d,o),O=b.side(d,o)}let S=findClusterBreak(l.text,p,b.forward(d,o));(S<b.from||S>b.to)&&(S=O),movedOver=l.text.slice(Math.min(p,S),Math.max(p,S));let A=g==(d?a.length-1:0)?null:a[g+(d?1:-1)];return A&&S==O&&A.level+(d?0:1)<b.level?EditorSelection.cursor(A.side(!d,o)+l.from,A.forward(d,o)?1:-1,A.level):EditorSelection.cursor(S+l.from,b.forward(d,o)?-1:1,b.level)}function autoDirection(l,a,o){for(let u=a;u<o;u++){let d=charType(l.charCodeAt(u));if(d==1)return LTR;if(d==2||d==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:l=>l.some(a=>a)}),nativeSelectionHidden=Facet.define({combine:l=>l.some(a=>a)}),scrollHandler=Facet.define();class ScrollTarget{constructor(a,o="nearest",u="nearest",d=5,f=5,p=!1){this.range=a,this.y=o,this.x=u,this.yMargin=d,this.xMargin=f,this.isSnapshot=p}map(a){return a.empty?this:new ScrollTarget(this.range.map(a),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(a){return this.range.to<=a.doc.length?this:new ScrollTarget(EditorSelection.cursor(a.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const scrollIntoView$1=StateEffect.define({map:(l,a)=>l.map(a)}),setEditContextFormatting=StateEffect.define();function logException(l,a,o){let u=l.facet(exceptionSink);u.length?u[0](a):window.onerror?window.onerror(String(a),o,void 0,void 0,a):o?console.error(o+":",a):console.error(a)}const editable=Facet.define({combine:l=>l.length?l[0]:!0});let nextPluginID=0;const viewPlugin=Facet.define();class ViewPlugin{constructor(a,o,u,d,f){this.id=a,this.create=o,this.domEventHandlers=u,this.domEventObservers=d,this.extension=f(this)}static define(a,o){const{eventHandlers:u,eventObservers:d,provide:f,decorations:p}=o||{};return new ViewPlugin(nextPluginID++,a,u,d,g=>{let b=[viewPlugin.of(g)];return p&&b.push(decorations.of(O=>{let S=O.plugin(g);return S?p(S):Decoration.none})),f&&b.push(f(g)),b})}static fromClass(a,o){return ViewPlugin.define(u=>new a(u),o)}}class PluginInstance{constructor(a){this.spec=a,this.mustUpdate=null,this.value=null}update(a){if(this.value){if(this.mustUpdate){let o=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(o)}catch(u){if(logException(o.state,u,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(a)}catch(o){logException(a.state,o,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(a){var o;if(!((o=this.value)===null||o===void 0)&&o.destroy)try{this.value.destroy()}catch(u){logException(a.state,u,"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(l,a){let o=l.state.facet(bidiIsolatedRanges);if(!o.length)return o;let u=o.map(f=>f instanceof Function?f(l):f),d=[];return RangeSet.spans(u,a.from,a.to,{point(){},span(f,p,g,b){let O=f-a.from,S=p-a.from,A=d;for(let M=g.length-1;M>=0;M--,b--){let E=g[M].spec.bidiIsolate,R;if(E==null&&(E=autoDirection(a.text,O,S)),b>0&&A.length&&(R=A[A.length-1]).to==O&&R.direction==E)R.to=S,A=R.inner;else{let L={from:O,to:S,direction:E,inner:[]};A.push(L),A=L.inner}}}}),d}const scrollMargins=Facet.define();function getScrollMargins(l){let a=0,o=0,u=0,d=0;for(let f of l.state.facet(scrollMargins)){let p=f(l);p&&(p.left!=null&&(a=Math.max(a,p.left)),p.right!=null&&(o=Math.max(o,p.right)),p.top!=null&&(u=Math.max(u,p.top)),p.bottom!=null&&(d=Math.max(d,p.bottom)))}return{left:a,right:o,top:u,bottom:d}}const styleModule=Facet.define();class ChangedRange{constructor(a,o,u,d){this.fromA=a,this.toA=o,this.fromB=u,this.toB=d}join(a){return new ChangedRange(Math.min(this.fromA,a.fromA),Math.max(this.toA,a.toA),Math.min(this.fromB,a.fromB),Math.max(this.toB,a.toB))}addToSet(a){let o=a.length,u=this;for(;o>0;o--){let d=a[o-1];if(!(d.fromA>u.toA)){if(d.toA<u.fromA)break;u=u.join(d),a.splice(o-1,1)}}return a.splice(o,0,u),a}static extendWithRanges(a,o){if(o.length==0)return a;let u=[];for(let d=0,f=0,p=0,g=0;;d++){let b=d==a.length?null:a[d],O=p-g,S=b?b.fromB:1e9;for(;f<o.length&&o[f]<S;){let A=o[f],M=o[f+1],E=Math.max(g,A),R=Math.min(S,M);if(E<=R&&new ChangedRange(E+O,R+O,E,R).addToSet(u),M>S)break;f+=2}if(!b)return u;new ChangedRange(b.fromA,b.toA,b.fromB,b.toB).addToSet(u),p=b.toA,g=b.toB}}}class ViewUpdate{constructor(a,o,u){this.view=a,this.state=o,this.transactions=u,this.flags=0,this.startState=a.state,this.changes=ChangeSet.empty(this.startState.doc.length);for(let f of u)this.changes=this.changes.compose(f.changes);let d=[];this.changes.iterChangedRanges((f,p,g,b)=>d.push(new ChangedRange(f,p,g,b))),this.changedRanges=d}static create(a,o,u){return new ViewUpdate(a,o,u)}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(a=>a.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class DocView extends ContentView{get length(){return this.view.state.doc.length}constructor(a){super(),this.view=a,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(a.contentDOM),this.children=[new LineView],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new ChangedRange(0,0,0,a.state.doc.length)],0,null)}update(a){var o;let u=a.changedRanges;this.minWidth>0&&u.length&&(u.every(({fromA:O,toA:S})=>S<this.minWidthFrom||O>this.minWidthTo)?(this.minWidthFrom=a.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=a.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(a);let d=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((o=this.domChanged)===null||o===void 0)&&o.newSel?d=this.domChanged.newSel.head:!touchesComposition(a.changes,this.hasComposition)&&!a.selectionSet&&(d=a.state.selection.main.head));let f=d>-1?findCompositionRange(this.view,a.changes,d):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:O,to:S}=this.hasComposition;u=new ChangedRange(O,S,a.changes.mapPos(O,-1),a.changes.mapPos(S,1)).addToSet(u.slice())}this.hasComposition=f?{from:f.range.fromB,to:f.range.toB}:null,(browser.ie||browser.chrome)&&!f&&a&&a.state.doc.lines!=a.startState.doc.lines&&(this.forceSelection=!0);let p=this.decorations,g=this.updateDeco(),b=findChangedDeco(p,g,a.changes);return u=ChangedRange.extendWithRanges(u,b),!(this.flags&7)&&u.length==0?!1:(this.updateInner(u,a.startState.doc.length,f),a.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(a,o,u){this.view.viewState.mustMeasureContent=!0,this.updateChildren(a,o,u);let{observer:d}=this.view;d.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let p=browser.chrome||browser.ios?{node:d.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,p),this.flags&=-8,p&&(p.written||d.selectionRange.focusNode!=p.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(p=>p.flags&=-9);let f=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let p of this.children)p instanceof BlockWidgetView&&p.widget instanceof BlockGapWidget&&f.push(p.dom);d.updateGaps(f)}updateChildren(a,o,u){let d=u?u.range.addToSet(a.slice()):a,f=this.childCursor(o);for(let p=d.length-1;;p--){let g=p>=0?d[p]:null;if(!g)break;let{fromA:b,toA:O,fromB:S,toB:A}=g,M,E,R,L;if(u&&u.range.fromB<A&&u.range.toB>S){let se=ContentBuilder.build(this.view.state.doc,S,u.range.fromB,this.decorations,this.dynamicDecorationMap),ee=ContentBuilder.build(this.view.state.doc,u.range.toB,A,this.decorations,this.dynamicDecorationMap);E=se.breakAtStart,R=se.openStart,L=ee.openEnd;let oe=this.compositionView(u);ee.breakAtStart?oe.breakAfter=1:ee.content.length&&oe.merge(oe.length,oe.length,ee.content[0],!1,ee.openStart,0)&&(oe.breakAfter=ee.content[0].breakAfter,ee.content.shift()),se.content.length&&oe.merge(0,0,se.content[se.content.length-1],!0,0,se.openEnd)&&se.content.pop(),M=se.content.concat(oe).concat(ee.content)}else({content:M,breakAtStart:E,openStart:R,openEnd:L}=ContentBuilder.build(this.view.state.doc,S,A,this.decorations,this.dynamicDecorationMap));let{i:U,off:Z}=f.findPos(O,1),{i:re,off:he}=f.findPos(b,-1);replaceRange(this,re,he,U,Z,M,E,R,L)}u&&this.fixCompositionDOM(u)}updateEditContextFormatting(a){this.editContextFormatting=this.editContextFormatting.map(a.changes);for(let o of a.transactions)for(let u of o.effects)u.is(setEditContextFormatting)&&(this.editContextFormatting=u.value)}compositionView(a){let o=new TextView(a.text.nodeValue);o.flags|=8;for(let{deco:d}of a.marks)o=new MarkView(d,[o],o.length);let u=new LineView;return u.append(o,0),u}fixCompositionDOM(a){let o=(f,p)=>{p.flags|=8|(p.children.some(b=>b.flags&7)?1:0),this.markedForComposition.add(p);let g=ContentView.get(f);g&&g!=p&&(g.dom=null),p.setDOM(f)},u=this.childPos(a.range.fromB,1),d=this.children[u.i];o(a.line,d);for(let f=a.marks.length-1;f>=-1;f--)u=d.childPos(u.off,1),d=d.children[u.i],o(f>=0?a.marks[f].node:a.text,d)}updateSelection(a=!1,o=!1){(a||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let u=this.view.root.activeElement,d=u==this.dom,f=!d&&!(this.view.state.facet(editable)||this.dom.tabIndex>-1)&&hasSelection(this.dom,this.view.observer.selectionRange)&&!(u&&this.dom.contains(u));if(!(d||o||f))return;let p=this.forceSelection;this.forceSelection=!1;let g=this.view.state.selection.main,b=this.moveToLine(this.domAtPos(g.anchor)),O=g.empty?b:this.moveToLine(this.domAtPos(g.head));if(browser.gecko&&g.empty&&!this.hasComposition&&betweenUneditable(b)){let A=document.createTextNode("");this.view.observer.ignore(()=>b.node.insertBefore(A,b.node.childNodes[b.offset]||null)),b=O=new DOMPos(A,0),p=!0}let S=this.view.observer.selectionRange;(p||!S.focusNode||(!isEquivalentPosition(b.node,b.offset,S.anchorNode,S.anchorOffset)||!isEquivalentPosition(O.node,O.offset,S.focusNode,S.focusOffset))&&!this.suppressWidgetCursorChange(S,g))&&(this.view.observer.ignore(()=>{browser.android&&browser.chrome&&this.dom.contains(S.focusNode)&&inUneditable(S.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let A=getSelection(this.view.root);if(A)if(g.empty){if(browser.gecko){let M=nextToUneditable(b.node,b.offset);if(M&&M!=3){let E=(M==1?textNodeBefore:textNodeAfter)(b.node,b.offset);E&&(b=new DOMPos(E.node,E.offset))}}A.collapse(b.node,b.offset),g.bidiLevel!=null&&A.caretBidiLevel!==void 0&&(A.caretBidiLevel=g.bidiLevel)}else if(A.extend){A.collapse(b.node,b.offset);try{A.extend(O.node,O.offset)}catch{}}else{let M=document.createRange();g.anchor>g.head&&([b,O]=[O,b]),M.setEnd(O.node,O.offset),M.setStart(b.node,b.offset),A.removeAllRanges(),A.addRange(M)}f&&this.view.root.activeElement==this.dom&&(this.dom.blur(),u&&u.focus())}),this.view.observer.setSelectionRange(b,O)),this.impreciseAnchor=b.precise?null:new DOMPos(S.anchorNode,S.anchorOffset),this.impreciseHead=O.precise?null:new DOMPos(S.focusNode,S.focusOffset)}suppressWidgetCursorChange(a,o){return this.hasComposition&&o.empty&&isEquivalentPosition(a.focusNode,a.focusOffset,a.anchorNode,a.anchorOffset)&&this.posFromDOM(a.focusNode,a.focusOffset)==o.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:a}=this,o=a.state.selection.main,u=getSelection(a.root),{anchorNode:d,anchorOffset:f}=a.observer.selectionRange;if(!u||!o.empty||!o.assoc||!u.modify)return;let p=LineView.find(this,o.head);if(!p)return;let g=p.posAtStart;if(o.head==g||o.head==g+p.length)return;let b=this.coordsAt(o.head,-1),O=this.coordsAt(o.head,1);if(!b||!O||b.bottom>O.top)return;let S=this.domAtPos(o.head+o.assoc);u.collapse(S.node,S.offset),u.modify("move",o.assoc<0?"forward":"backward","lineboundary"),a.observer.readSelectionRange();let A=a.observer.selectionRange;a.docView.posFromDOM(A.anchorNode,A.anchorOffset)!=o.from&&u.collapse(d,f)}moveToLine(a){let o=this.dom,u;if(a.node!=o)return a;for(let d=a.offset;!u&&d<o.childNodes.length;d++){let f=ContentView.get(o.childNodes[d]);f instanceof LineView&&(u=f.domAtPos(0))}for(let d=a.offset-1;!u&&d>=0;d--){let f=ContentView.get(o.childNodes[d]);f instanceof LineView&&(u=f.domAtPos(f.length))}return u?new DOMPos(u.node,u.offset,!0):a}nearest(a){for(let o=a;o;){let u=ContentView.get(o);if(u&&u.rootView==this)return u;o=o.parentNode}return null}posFromDOM(a,o){let u=this.nearest(a);if(!u)throw new RangeError("Trying to find position for a DOM position outside of the document");return u.localPosFromDOM(a,o)+u.posAtStart}domAtPos(a){let{i:o,off:u}=this.childCursor().findPos(a,-1);for(;o<this.children.length-1;){let d=this.children[o];if(u<d.length||d instanceof LineView)break;o++,u=0}return this.children[o].domAtPos(u)}coordsAt(a,o){let u=null,d=0;for(let f=this.length,p=this.children.length-1;p>=0;p--){let g=this.children[p],b=f-g.breakAfter,O=b-g.length;if(b<a)break;if(O<=a&&(O<a||g.covers(-1))&&(b>a||g.covers(1))&&(!u||g instanceof LineView&&!(u instanceof LineView&&o>=0)))u=g,d=O;else if(u&&O==a&&b==a&&g instanceof BlockWidgetView&&Math.abs(o)<2){if(g.deco.startSide<0)break;p&&(u=null)}f=O}return u?u.coordsAt(a-d,o):null}coordsForChar(a){let{i:o,off:u}=this.childPos(a,1),d=this.children[o];if(!(d instanceof LineView))return null;for(;d.children.length;){let{i:g,off:b}=d.childPos(u,1);for(;;g++){if(g==d.children.length)return null;if((d=d.children[g]).length)break}u=b}if(!(d instanceof TextView))return null;let f=findClusterBreak(d.text,u);if(f==u)return null;let p=textRange(d.dom,u,f).getClientRects();for(let g=0;g<p.length;g++){let b=p[g];if(g==p.length-1||b.top<b.bottom&&b.left<b.right)return b}return null}measureVisibleLineHeights(a){let o=[],{from:u,to:d}=a,f=this.view.contentDOM.clientWidth,p=f>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,g=-1,b=this.view.textDirection==Direction.LTR;for(let O=0,S=0;S<this.children.length;S++){let A=this.children[S],M=O+A.length;if(M>d)break;if(O>=u){let E=A.dom.getBoundingClientRect();if(o.push(E.height),p){let R=A.dom.lastChild,L=R?clientRectsFor(R):[];if(L.length){let U=L[L.length-1],Z=b?U.right-E.left:E.right-U.left;Z>g&&(g=Z,this.minWidth=f,this.minWidthFrom=O,this.minWidthTo=M)}}}O=M+A.breakAfter}return o}textDirectionAt(a){let{i:o}=this.childPos(a,1);return getComputedStyle(this.children[o].dom).direction=="rtl"?Direction.RTL:Direction.LTR}measureTextSize(){for(let f of this.children)if(f instanceof LineView){let p=f.measureTextSize();if(p)return p}let a=document.createElement("div"),o,u,d;return a.className="cm-line",a.style.width="99999px",a.style.position="absolute",a.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(a);let f=clientRectsFor(a.firstChild)[0];o=a.getBoundingClientRect().height,u=f?f.width/27:7,d=f?f.height:o,a.remove()}),{lineHeight:o,charWidth:u,textHeight:d}}childCursor(a=this.length){let o=this.children.length;return o&&(a-=this.children[--o].length),new ChildCursor(this.children,a,o)}computeBlockGapDeco(){let a=[],o=this.view.viewState;for(let u=0,d=0;;d++){let f=d==o.viewports.length?null:o.viewports[d],p=f?f.from-1:this.length;if(p>u){let g=(o.lineBlockAt(p).bottom-o.lineBlockAt(u).top)/this.view.scaleY;a.push(Decoration.replace({widget:new BlockGapWidget(g),block:!0,inclusive:!0,isBlockGap:!0}).range(u,p))}if(!f)break;u=f.to+1}return Decoration.set(a)}updateDeco(){let a=1,o=this.view.state.facet(decorations).map(f=>(this.dynamicDecorationMap[a++]=typeof f=="function")?f(this.view):f),u=!1,d=this.view.state.facet(outerDecorations).map((f,p)=>{let g=typeof f=="function";return g&&(u=!0),g?f(this.view):f});for(d.length&&(this.dynamicDecorationMap[a++]=u,o.push(RangeSet.join(d))),this.decorations=[this.editContextFormatting,...o,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];a<this.decorations.length;)this.dynamicDecorationMap[a++]=!1;return this.decorations}scrollIntoView(a){if(a.isSnapshot){let O=this.view.viewState.lineBlockAt(a.range.head);this.view.scrollDOM.scrollTop=O.top-a.yMargin,this.view.scrollDOM.scrollLeft=a.xMargin;return}for(let O of this.view.state.facet(scrollHandler))try{if(O(this.view,a.range,a))return!0}catch(S){logException(this.view.state,S,"scroll handler")}let{range:o}=a,u=this.coordsAt(o.head,o.empty?o.assoc:o.head>o.anchor?-1:1),d;if(!u)return;!o.empty&&(d=this.coordsAt(o.anchor,o.anchor>o.head?-1:1))&&(u={left:Math.min(u.left,d.left),top:Math.min(u.top,d.top),right:Math.max(u.right,d.right),bottom:Math.max(u.bottom,d.bottom)});let f=getScrollMargins(this.view),p={left:u.left-f.left,top:u.top-f.top,right:u.right+f.right,bottom:u.bottom+f.bottom},{offsetWidth:g,offsetHeight:b}=this.view.scrollDOM;scrollRectIntoView(this.view.scrollDOM,p,o.head<o.anchor?-1:1,a.x,a.y,Math.max(Math.min(a.xMargin,g),-g),Math.max(Math.min(a.yMargin,b),-b),this.view.textDirection==Direction.LTR)}}function betweenUneditable(l){return l.node.nodeType==1&&l.node.firstChild&&(l.offset==0||l.node.childNodes[l.offset-1].contentEditable=="false")&&(l.offset==l.node.childNodes.length||l.node.childNodes[l.offset].contentEditable=="false")}function findCompositionNode(l,a){let o=l.observer.selectionRange;if(!o.focusNode)return null;let u=textNodeBefore(o.focusNode,o.focusOffset),d=textNodeAfter(o.focusNode,o.focusOffset),f=u||d;if(d&&u&&d.node!=u.node){let g=ContentView.get(d.node);if(!g||g instanceof TextView&&g.text!=d.node.nodeValue)f=d;else if(l.docView.lastCompositionAfterCursor){let b=ContentView.get(u.node);!b||b instanceof TextView&&b.text!=u.node.nodeValue||(f=d)}}if(l.docView.lastCompositionAfterCursor=f!=u,!f)return null;let p=a-f.offset;return{from:p,to:p+f.node.nodeValue.length,node:f.node}}function findCompositionRange(l,a,o){let u=findCompositionNode(l,o);if(!u)return null;let{node:d,from:f,to:p}=u,g=d.nodeValue;if(/[\n\r]/.test(g)||l.state.doc.sliceString(u.from,u.to)!=g)return null;let b=a.invertedDesc,O=new ChangedRange(b.mapPos(f),b.mapPos(p),f,p),S=[];for(let A=d.parentNode;;A=A.parentNode){let M=ContentView.get(A);if(M instanceof MarkView)S.push({node:A,deco:M.mark});else{if(M instanceof LineView||A.nodeName=="DIV"&&A.parentNode==l.contentDOM)return{range:O,text:d,marks:S,line:A};if(A!=l.contentDOM)S.push({node:A,deco:new MarkDecoration({inclusive:!0,attributes:getAttrs(A),tagName:A.tagName.toLowerCase()})});else return null}}}function nextToUneditable(l,a){return l.nodeType!=1?0:(a&&l.childNodes[a-1].contentEditable=="false"?1:0)|(a<l.childNodes.length&&l.childNodes[a].contentEditable=="false"?2:0)}let DecorationComparator$1=class{constructor(){this.changes=[]}compareRange(a,o){addRange(a,o,this.changes)}comparePoint(a,o){addRange(a,o,this.changes)}boundChange(a){addRange(a,a,this.changes)}};function findChangedDeco(l,a,o){let u=new DecorationComparator$1;return RangeSet.compare(l,a,o,u),u.changes}function inUneditable(l,a){for(let o=l;o&&o!=a;o=o.assignedSlot||o.parentNode)if(o.nodeType==1&&o.contentEditable=="false")return!0;return!1}function touchesComposition(l,a){let o=!1;return a&&l.iterChangedRanges((u,d)=>{u<a.to&&d>a.from&&(o=!0)}),o}function groupAt(l,a,o=1){let u=l.charCategorizer(a),d=l.doc.lineAt(a),f=a-d.from;if(d.length==0)return EditorSelection.cursor(a);f==0?o=1:f==d.length&&(o=-1);let p=f,g=f;o<0?p=findClusterBreak(d.text,f,!1):g=findClusterBreak(d.text,f);let b=u(d.text.slice(p,g));for(;p>0;){let O=findClusterBreak(d.text,p,!1);if(u(d.text.slice(O,p))!=b)break;p=O}for(;g<d.length;){let O=findClusterBreak(d.text,g);if(u(d.text.slice(g,O))!=b)break;g=O}return EditorSelection.range(p+d.from,g+d.from)}function getdx(l,a){return a.left>l?a.left-l:Math.max(0,l-a.right)}function getdy(l,a){return a.top>l?a.top-l:Math.max(0,l-a.bottom)}function yOverlap(l,a){return l.top<a.bottom-1&&l.bottom>a.top+1}function upTop(l,a){return a<l.top?{top:a,left:l.left,right:l.right,bottom:l.bottom}:l}function upBot(l,a){return a>l.bottom?{top:l.top,left:l.left,right:l.right,bottom:a}:l}function domPosAtCoords(l,a,o){let u,d,f,p,g=!1,b,O,S,A;for(let R=l.firstChild;R;R=R.nextSibling){let L=clientRectsFor(R);for(let U=0;U<L.length;U++){let Z=L[U];d&&yOverlap(d,Z)&&(Z=upTop(upBot(Z,d.bottom),d.top));let re=getdx(a,Z),he=getdy(o,Z);if(re==0&&he==0)return R.nodeType==3?domPosInText(R,a,o):domPosAtCoords(R,a,o);if(!u||p>he||p==he&&f>re){u=R,d=Z,f=re,p=he;let se=he?o<Z.top?-1:1:re?a<Z.left?-1:1:0;g=!se||(se>0?U<L.length-1:U>0)}re==0?o>Z.bottom&&(!S||S.bottom<Z.bottom)?(b=R,S=Z):o<Z.top&&(!A||A.top>Z.top)&&(O=R,A=Z):S&&yOverlap(S,Z)?S=upBot(S,Z.bottom):A&&yOverlap(A,Z)&&(A=upTop(A,Z.top))}}if(S&&S.bottom>=o?(u=b,d=S):A&&A.top<=o&&(u=O,d=A),!u)return{node:l,offset:0};let M=Math.max(d.left,Math.min(d.right,a));if(u.nodeType==3)return domPosInText(u,M,o);if(g&&u.contentEditable!="false")return domPosAtCoords(u,M,o);let E=Array.prototype.indexOf.call(l.childNodes,u)+(a>=(d.left+d.right)/2?1:0);return{node:l,offset:E}}function domPosInText(l,a,o){let u=l.nodeValue.length,d=-1,f=1e9,p=0;for(let g=0;g<u;g++){let b=textRange(l,g,g+1).getClientRects();for(let O=0;O<b.length;O++){let S=b[O];if(S.top==S.bottom)continue;p||(p=a-S.left);let A=(S.top>o?S.top-o:o-S.bottom)-1;if(S.left-1<=a&&S.right+1>=a&&A<f){let M=a>=(S.left+S.right)/2,E=M;if((browser.chrome||browser.gecko)&&textRange(l,g).getBoundingClientRect().left==S.right&&(E=!M),A<=0)return{node:l,offset:g+(E?1:0)};d=g+(E?1:0),f=A}}}return{node:l,offset:d>-1?d:p>0?l.nodeValue.length:0}}function posAtCoords(l,a,o,u=-1){var d,f;let p=l.contentDOM.getBoundingClientRect(),g=p.top+l.viewState.paddingTop,b,{docHeight:O}=l.viewState,{x:S,y:A}=a,M=A-g;if(M<0)return 0;if(M>O)return l.state.doc.length;for(let se=l.viewState.heightOracle.textHeight/2,ee=!1;b=l.elementAtHeight(M),b.type!=BlockType.Text;)for(;M=u>0?b.bottom+se:b.top-se,!(M>=0&&M<=O);){if(ee)return o?null:0;ee=!0,u=-u}A=g+M;let E=b.from;if(E<l.viewport.from)return l.viewport.from==0?0:o?null:posAtCoordsImprecise(l,p,b,S,A);if(E>l.viewport.to)return l.viewport.to==l.state.doc.length?l.state.doc.length:o?null:posAtCoordsImprecise(l,p,b,S,A);let R=l.dom.ownerDocument,L=l.root.elementFromPoint?l.root:R,U=L.elementFromPoint(S,A);U&&!l.contentDOM.contains(U)&&(U=null),U||(S=Math.max(p.left+1,Math.min(p.right-1,S)),U=L.elementFromPoint(S,A),U&&!l.contentDOM.contains(U)&&(U=null));let Z,re=-1;if(U&&((d=l.docView.nearest(U))===null||d===void 0?void 0:d.isEditable)!=!1){if(R.caretPositionFromPoint){let se=R.caretPositionFromPoint(S,A);se&&({offsetNode:Z,offset:re}=se)}else if(R.caretRangeFromPoint){let se=R.caretRangeFromPoint(S,A);se&&({startContainer:Z,startOffset:re}=se,(!l.contentDOM.contains(Z)||browser.safari&&isSuspiciousSafariCaretResult(Z,re,S)||browser.chrome&&isSuspiciousChromeCaretResult(Z,re,S))&&(Z=void 0))}Z&&(re=Math.min(maxOffset(Z),re))}if(!Z||!l.docView.dom.contains(Z)){let se=LineView.find(l.docView,E);if(!se)return M>b.top+b.height/2?b.to:b.from;({node:Z,offset:re}=domPosAtCoords(se.dom,S,A))}let he=l.docView.nearest(Z);if(!he)return null;if(he.isWidget&&((f=he.dom)===null||f===void 0?void 0:f.nodeType)==1){let se=he.dom.getBoundingClientRect();return a.y<se.top||a.y<=se.bottom&&a.x<=(se.left+se.right)/2?he.posAtStart:he.posAtEnd}else return he.localPosFromDOM(Z,re)+he.posAtStart}function posAtCoordsImprecise(l,a,o,u,d){let f=Math.round((u-a.left)*l.defaultCharacterWidth);if(l.lineWrapping&&o.height>l.defaultLineHeight*1.5){let g=l.viewState.heightOracle.textHeight,b=Math.floor((d-o.top-(l.defaultLineHeight-g)*.5)/g);f+=b*l.viewState.heightOracle.lineLength}let p=l.state.sliceDoc(o.from,o.to);return o.from+findColumn(p,f,l.state.tabSize)}function isSuspiciousSafariCaretResult(l,a,o){let u;if(l.nodeType!=3||a!=(u=l.nodeValue.length))return!1;for(let d=l.nextSibling;d;d=d.nextSibling)if(d.nodeType!=1||d.nodeName!="BR")return!1;return textRange(l,u-1,u).getBoundingClientRect().left>o}function isSuspiciousChromeCaretResult(l,a,o){if(a!=0)return!1;for(let d=l;;){let f=d.parentNode;if(!f||f.nodeType!=1||f.firstChild!=d)return!1;if(f.classList.contains("cm-line"))break;d=f}let u=l.nodeType==1?l.getBoundingClientRect():textRange(l,0,Math.max(l.nodeValue.length,1)).getBoundingClientRect();return o-u.left>5}function blockAt(l,a){let o=l.lineBlockAt(a);if(Array.isArray(o.type)){for(let u of o.type)if(u.to>a||u.to==a&&(u.to==o.to||u.type==BlockType.Text))return u}return o}function moveToLineBoundary(l,a,o,u){let d=blockAt(l,a.head),f=!u||d.type!=BlockType.Text||!(l.lineWrapping||d.widgetLineBreaks)?null:l.coordsAtPos(a.assoc<0&&a.head>d.from?a.head-1:a.head);if(f){let p=l.dom.getBoundingClientRect(),g=l.textDirectionAt(d.from),b=l.posAtCoords({x:o==(g==Direction.LTR)?p.right-1:p.left+1,y:(f.top+f.bottom)/2});if(b!=null)return EditorSelection.cursor(b,o?-1:1)}return EditorSelection.cursor(o?d.to:d.from,o?-1:1)}function moveByChar(l,a,o,u){let d=l.state.doc.lineAt(a.head),f=l.bidiSpans(d),p=l.textDirectionAt(d.from);for(let g=a,b=null;;){let O=moveVisually(d,f,p,g,o),S=movedOver;if(!O){if(d.number==(o?l.state.doc.lines:1))return g;S=`
`,d=l.state.doc.line(d.number+(o?1:-1)),f=l.bidiSpans(d),O=l.visualLineSide(d,!o)}if(b){if(!b(S))return g}else{if(!u)return O;b=u(S)}g=O}}function byGroup(l,a,o){let u=l.state.charCategorizer(a),d=u(o);return f=>{let p=u(f);return d==CharCategory.Space&&(d=p),d==p}}function moveVertically(l,a,o,u){let d=a.head,f=o?1:-1;if(d==(o?l.state.doc.length:0))return EditorSelection.cursor(d,a.assoc);let p=a.goalColumn,g,b=l.contentDOM.getBoundingClientRect(),O=l.coordsAtPos(d,a.assoc||-1),S=l.documentTop;if(O)p==null&&(p=O.left-b.left),g=f<0?O.top:O.bottom;else{let E=l.viewState.lineBlockAt(d);p==null&&(p=Math.min(b.right-b.left,l.defaultCharacterWidth*(d-E.from))),g=(f<0?E.top:E.bottom)+S}let A=b.left+p,M=u??l.viewState.heightOracle.textHeight>>1;for(let E=0;;E+=10){let R=g+(M+E)*f,L=posAtCoords(l,{x:A,y:R},!1,f);if(R<b.top||R>b.bottom||(f<0?L<d:L>d)){let U=l.docView.coordsForChar(L),Z=!U||R<U.top?-1:1;return EditorSelection.cursor(L,Z,void 0,p)}}}function skipAtomicRanges(l,a,o){for(;;){let u=0;for(let d of l)d.between(a-1,a+1,(f,p,g)=>{if(a>f&&a<p){let b=u||o||(a-f<p-a?-1:1);a=b<0?f:p,u=b}});if(!u)return a}}function skipAtoms(l,a,o){let u=skipAtomicRanges(l.state.facet(atomicRanges).map(d=>d(l)),o.from,a.head>o.from?-1:1);return u==o.from?o:EditorSelection.cursor(u,u<o.from?1:-1)}const LineBreakPlaceholder="￿";class DOMReader{constructor(a,o){this.points=a,this.text="",this.lineSeparator=o.facet(EditorState.lineSeparator)}append(a){this.text+=a}lineBreak(){this.text+=LineBreakPlaceholder}readRange(a,o){if(!a)return this;let u=a.parentNode;for(let d=a;;){this.findPointBefore(u,d);let f=this.text.length;this.readNode(d);let p=d.nextSibling;if(p==o)break;let g=ContentView.get(d),b=ContentView.get(p);(g&&b?g.breakAfter:(g?g.breakAfter:isBlockElement(d))||isBlockElement(p)&&(d.nodeName!="BR"||d.cmIgnore)&&this.text.length>f)&&this.lineBreak(),d=p}return this.findPointBefore(u,o),this}readTextNode(a){let o=a.nodeValue;for(let u of this.points)u.node==a&&(u.pos=this.text.length+Math.min(u.offset,o.length));for(let u=0,d=this.lineSeparator?null:/\r\n?|\n/g;;){let f=-1,p=1,g;if(this.lineSeparator?(f=o.indexOf(this.lineSeparator,u),p=this.lineSeparator.length):(g=d.exec(o))&&(f=g.index,p=g[0].length),this.append(o.slice(u,f<0?o.length:f)),f<0)break;if(this.lineBreak(),p>1)for(let b of this.points)b.node==a&&b.pos>this.text.length&&(b.pos-=p-1);u=f+p}}readNode(a){if(a.cmIgnore)return;let o=ContentView.get(a),u=o&&o.overrideDOMText;if(u!=null){this.findPointInside(a,u.length);for(let d=u.iter();!d.next().done;)d.lineBreak?this.lineBreak():this.append(d.value)}else a.nodeType==3?this.readTextNode(a):a.nodeName=="BR"?a.nextSibling&&this.lineBreak():a.nodeType==1&&this.readRange(a.firstChild,null)}findPointBefore(a,o){for(let u of this.points)u.node==a&&a.childNodes[u.offset]==o&&(u.pos=this.text.length)}findPointInside(a,o){for(let u of this.points)(a.nodeType==3?u.node==a:a.contains(u.node))&&(u.pos=this.text.length+(isAtEnd(a,u.node,u.offset)?o:0))}}function isAtEnd(l,a,o){for(;;){if(!a||o<maxOffset(a))return!1;if(a==l)return!0;o=domIndex(a)+1,a=a.parentNode}}class DOMPoint{constructor(a,o){this.node=a,this.offset=o,this.pos=-1}}class DOMChange{constructor(a,o,u,d){this.typeOver=d,this.bounds=null,this.text="",this.domChanged=o>-1;let{impreciseHead:f,impreciseAnchor:p}=a.docView;if(a.state.readOnly&&o>-1)this.newSel=null;else if(o>-1&&(this.bounds=a.docView.domBoundsAround(o,u,0))){let g=f||p?[]:selectionPoints(a),b=new DOMReader(g,a.state);b.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=b.text,this.newSel=selectionFromPoints(g,this.bounds.from)}else{let g=a.observer.selectionRange,b=f&&f.node==g.focusNode&&f.offset==g.focusOffset||!contains(a.contentDOM,g.focusNode)?a.state.selection.main.head:a.docView.posFromDOM(g.focusNode,g.focusOffset),O=p&&p.node==g.anchorNode&&p.offset==g.anchorOffset||!contains(a.contentDOM,g.anchorNode)?a.state.selection.main.anchor:a.docView.posFromDOM(g.anchorNode,g.anchorOffset),S=a.viewport;if((browser.ios||browser.chrome)&&a.state.selection.main.empty&&b!=O&&(S.from>0||S.to<a.state.doc.length)){let A=Math.min(b,O),M=Math.max(b,O),E=S.from-A,R=S.to-M;(E==0||E==1||A==0)&&(R==0||R==-1||M==a.state.doc.length)&&(b=0,O=a.state.doc.length)}this.newSel=EditorSelection.single(O,b)}}}function applyDOMChange(l,a){let o,{newSel:u}=a,d=l.state.selection.main,f=l.inputState.lastKeyTime>Date.now()-100?l.inputState.lastKeyCode:-1;if(a.bounds){let{from:p,to:g}=a.bounds,b=d.from,O=null;(f===8||browser.android&&a.text.length<g-p)&&(b=d.to,O="end");let S=findDiff(l.state.doc.sliceString(p,g,LineBreakPlaceholder),a.text,b-p,O);S&&(browser.chrome&&f==13&&S.toB==S.from+2&&a.text.slice(S.from,S.toB)==LineBreakPlaceholder+LineBreakPlaceholder&&S.toB--,o={from:p+S.from,to:p+S.toA,insert:Text.of(a.text.slice(S.from,S.toB).split(LineBreakPlaceholder))})}else u&&(!l.hasFocus&&l.state.facet(editable)||u.main.eq(d))&&(u=null);if(!o&&!u)return!1;if(!o&&a.typeOver&&!d.empty&&u&&u.main.empty?o={from:d.from,to:d.to,insert:l.state.doc.slice(d.from,d.to)}:(browser.mac||browser.android)&&o&&o.from==o.to&&o.from==d.head-1&&/^\. ?$/.test(o.insert.toString())&&l.contentDOM.getAttribute("autocorrect")=="off"?(u&&o.insert.length==2&&(u=EditorSelection.single(u.main.anchor-1,u.main.head-1)),o={from:o.from,to:o.to,insert:Text.of([o.insert.toString().replace("."," ")])}):o&&o.from>=d.from&&o.to<=d.to&&(o.from!=d.from||o.to!=d.to)&&d.to-d.from-(o.to-o.from)<=4?o={from:d.from,to:d.to,insert:l.state.doc.slice(d.from,o.from).append(o.insert).append(l.state.doc.slice(o.to,d.to))}:browser.chrome&&o&&o.from==o.to&&o.from==d.head&&o.insert.toString()==`
`&&l.lineWrapping&&(u&&(u=EditorSelection.single(u.main.anchor-1,u.main.head-1)),o={from:d.from,to:d.to,insert:Text.of([" "])}),o)return applyDOMChangeInner(l,o,u,f);if(u&&!u.main.eq(d)){let p=!1,g="select";return l.inputState.lastSelectionTime>Date.now()-50&&(l.inputState.lastSelectionOrigin=="select"&&(p=!0),g=l.inputState.lastSelectionOrigin),l.dispatch({selection:u,scrollIntoView:p,userEvent:g}),!0}else return!1}function applyDOMChangeInner(l,a,o,u=-1){if(browser.ios&&l.inputState.flushIOSKey(a))return!0;let d=l.state.selection.main;if(browser.android&&(a.to==d.to&&(a.from==d.from||a.from==d.from-1&&l.state.sliceDoc(a.from,d.from)==" ")&&a.insert.length==1&&a.insert.lines==2&&dispatchKey(l.contentDOM,"Enter",13)||(a.from==d.from-1&&a.to==d.to&&a.insert.length==0||u==8&&a.insert.length<a.to-a.from&&a.to>d.head)&&dispatchKey(l.contentDOM,"Backspace",8)||a.from==d.from&&a.to==d.to+1&&a.insert.length==0&&dispatchKey(l.contentDOM,"Delete",46)))return!0;let f=a.insert.toString();l.inputState.composing>=0&&l.inputState.composing++;let p,g=()=>p||(p=applyDefaultInsert(l,a,o));return l.state.facet(inputHandler$1).some(b=>b(l,a.from,a.to,f,g))||l.dispatch(g()),!0}function applyDefaultInsert(l,a,o){let u,d=l.state,f=d.selection.main;if(a.from>=f.from&&a.to<=f.to&&a.to-a.from>=(f.to-f.from)/3&&(!o||o.main.empty&&o.main.from==a.from+a.insert.length)&&l.inputState.composing<0){let g=f.from<a.from?d.sliceDoc(f.from,a.from):"",b=f.to>a.to?d.sliceDoc(a.to,f.to):"";u=d.replaceSelection(l.state.toText(g+a.insert.sliceString(0,void 0,l.state.lineBreak)+b))}else{let g=d.changes(a),b=o&&o.main.to<=g.newLength?o.main:void 0;if(d.selection.ranges.length>1&&l.inputState.composing>=0&&a.to<=f.to&&a.to>=f.to-10){let O=l.state.sliceDoc(a.from,a.to),S,A=o&&findCompositionNode(l,o.main.head);if(A){let R=a.insert.length-(a.to-a.from);S={from:A.from,to:A.to-R}}else S=l.state.doc.lineAt(f.head);let M=f.to-a.to,E=f.to-f.from;u=d.changeByRange(R=>{if(R.from==f.from&&R.to==f.to)return{changes:g,range:b||R.map(g)};let L=R.to-M,U=L-O.length;if(R.to-R.from!=E||l.state.sliceDoc(U,L)!=O||R.to>=S.from&&R.from<=S.to)return{range:R};let Z=d.changes({from:U,to:L,insert:a.insert}),re=R.to-f.to;return{changes:Z,range:b?EditorSelection.range(Math.max(0,b.anchor+re),Math.max(0,b.head+re)):R.map(Z)}})}else u={changes:g,selection:b&&d.selection.replaceRange(b)}}let p="input.type";return(l.composing||l.inputState.compositionPendingChange&&l.inputState.compositionEndedAt>Date.now()-50)&&(l.inputState.compositionPendingChange=!1,p+=".compose",l.inputState.compositionFirstChange&&(p+=".start",l.inputState.compositionFirstChange=!1)),d.update(u,{userEvent:p,scrollIntoView:!0})}function findDiff(l,a,o,u){let d=Math.min(l.length,a.length),f=0;for(;f<d&&l.charCodeAt(f)==a.charCodeAt(f);)f++;if(f==d&&l.length==a.length)return null;let p=l.length,g=a.length;for(;p>0&&g>0&&l.charCodeAt(p-1)==a.charCodeAt(g-1);)p--,g--;if(u=="end"){let b=Math.max(0,f-Math.min(p,g));o-=p+b-f}if(p<f&&l.length<a.length){let b=o<=f&&o>=p?f-o:0;f-=b,g=f+(g-p),p=f}else if(g<f){let b=o<=f&&o>=g?f-o:0;f-=b,p=f+(p-g),g=f}return{from:f,toA:p,toB:g}}function selectionPoints(l){let a=[];if(l.root.activeElement!=l.contentDOM)return a;let{anchorNode:o,anchorOffset:u,focusNode:d,focusOffset:f}=l.observer.selectionRange;return o&&(a.push(new DOMPoint(o,u)),(d!=o||f!=u)&&a.push(new DOMPoint(d,f))),a}function selectionFromPoints(l,a){if(l.length==0)return null;let o=l[0].pos,u=l.length==2?l[1].pos:o;return o>-1&&u>-1?EditorSelection.single(o+a,u+a):null}class InputState{setSelectionOrigin(a){this.lastSelectionOrigin=a,this.lastSelectionTime=Date.now()}constructor(a){this.view=a,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=a.hasFocus,browser.safari&&a.contentDOM.addEventListener("input",()=>null),browser.gecko&&firefoxCopyCutHack(a.contentDOM.ownerDocument)}handleEvent(a){!eventBelongsToEditor(this.view,a)||this.ignoreDuringComposition(a)||a.type=="keydown"&&this.keydown(a)||this.runHandlers(a.type,a)}runHandlers(a,o){let u=this.handlers[a];if(u){for(let d of u.observers)d(this.view,o);for(let d of u.handlers){if(o.defaultPrevented)break;if(d(this.view,o)){o.preventDefault();break}}}}ensureHandlers(a){let o=computeHandlers(a),u=this.handlers,d=this.view.contentDOM;for(let f in o)if(f!="scroll"){let p=!o[f].handlers.length,g=u[f];g&&p!=!g.handlers.length&&(d.removeEventListener(f,this.handleEvent),g=null),g||d.addEventListener(f,this.handleEvent,{passive:p})}for(let f in u)f!="scroll"&&!o[f]&&d.removeEventListener(f,this.handleEvent);this.handlers=o}keydown(a){if(this.lastKeyCode=a.keyCode,this.lastKeyTime=Date.now(),a.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&a.keyCode!=27&&modifierCodes.indexOf(a.keyCode)<0&&(this.tabFocusMode=-1),browser.android&&browser.chrome&&!a.synthetic&&(a.keyCode==13||a.keyCode==8))return this.view.observer.delayAndroidKey(a.key,a.keyCode),!0;let o;return browser.ios&&!a.synthetic&&!a.altKey&&!a.metaKey&&((o=PendingKeys.find(u=>u.keyCode==a.keyCode))&&!a.ctrlKey||EmacsyPendingKeys.indexOf(a.key)>-1&&a.ctrlKey&&!a.shiftKey)?(this.pendingIOSKey=o||a,setTimeout(()=>this.flushIOSKey(),250),!0):(a.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(a){let o=this.pendingIOSKey;return!o||o.key=="Enter"&&a&&a.from<a.to&&/^\S+$/.test(a.insert.toString())?!1:(this.pendingIOSKey=void 0,dispatchKey(this.view.contentDOM,o.key,o.keyCode,o instanceof KeyboardEvent?o:void 0))}ignoreDuringComposition(a){return/^key/.test(a.type)?this.composing>0?!0:browser.safari&&!browser.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(a){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=a}update(a){this.view.observer.update(a),this.mouseSelection&&this.mouseSelection.update(a),this.draggedContent&&a.docChanged&&(this.draggedContent=this.draggedContent.map(a.changes)),a.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function bindHandler(l,a){return(o,u)=>{try{return a.call(l,u,o)}catch(d){logException(o.state,d)}}}function computeHandlers(l){let a=Object.create(null);function o(u){return a[u]||(a[u]={observers:[],handlers:[]})}for(let u of l){let d=u.spec;if(d&&d.domEventHandlers)for(let f in d.domEventHandlers){let p=d.domEventHandlers[f];p&&o(f).handlers.push(bindHandler(u.value,p))}if(d&&d.domEventObservers)for(let f in d.domEventObservers){let p=d.domEventObservers[f];p&&o(f).observers.push(bindHandler(u.value,p))}}for(let u in handlers)o(u).handlers.push(handlers[u]);for(let u in observers)o(u).observers.push(observers[u]);return a}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(l){return Math.max(0,l)*.7+8}function dist$2(l,a){return Math.max(Math.abs(l.clientX-a.clientX),Math.abs(l.clientY-a.clientY))}class MouseSelection{constructor(a,o,u,d){this.view=a,this.startEvent=o,this.style=u,this.mustSelect=d,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=o,this.scrollParents=scrollableParents(a.contentDOM),this.atoms=a.state.facet(atomicRanges).map(p=>p(a));let f=a.contentDOM.ownerDocument;f.addEventListener("mousemove",this.move=this.move.bind(this)),f.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=o.shiftKey,this.multiple=a.state.facet(EditorState.allowMultipleSelections)&&addsSelectionRange(a,o),this.dragging=isInPrimarySelection(a,o)&&getClickType(o)==1?null:!1}start(a){this.dragging===!1&&this.select(a)}move(a){if(a.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&dist$2(this.startEvent,a)<10)return;this.select(this.lastEvent=a);let o=0,u=0,d=0,f=0,p=this.view.win.innerWidth,g=this.view.win.innerHeight;this.scrollParents.x&&({left:d,right:p}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:f,bottom:g}=this.scrollParents.y.getBoundingClientRect());let b=getScrollMargins(this.view);a.clientX-b.left<=d+dragScrollMargin?o=-dragScrollSpeed(d-a.clientX):a.clientX+b.right>=p-dragScrollMargin&&(o=dragScrollSpeed(a.clientX-p)),a.clientY-b.top<=f+dragScrollMargin?u=-dragScrollSpeed(f-a.clientY):a.clientY+b.bottom>=g-dragScrollMargin&&(u=dragScrollSpeed(a.clientY-g)),this.setScrollSpeed(o,u)}up(a){this.dragging==null&&this.select(this.lastEvent),this.dragging||a.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let a=this.view.contentDOM.ownerDocument;a.removeEventListener("mousemove",this.move),a.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(a,o){this.scrollSpeed={x:a,y:o},a||o?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:a,y:o}=this.scrollSpeed;a&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=a,a=0),o&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=o,o=0),(a||o)&&this.view.win.scrollBy(a,o),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(a){let o=null;for(let u=0;u<a.ranges.length;u++){let d=a.ranges[u],f=null;if(d.empty){let p=skipAtomicRanges(this.atoms,d.from,0);p!=d.from&&(f=EditorSelection.cursor(p,-1))}else{let p=skipAtomicRanges(this.atoms,d.from,-1),g=skipAtomicRanges(this.atoms,d.to,1);(p!=d.from||g!=d.to)&&(f=EditorSelection.range(d.from==d.anchor?p:g,d.from==d.head?p:g))}f&&(o||(o=a.ranges.slice()),o[u]=f)}return o?EditorSelection.create(o,a.mainIndex):a}select(a){let{view:o}=this,u=this.skipAtoms(this.style.get(a,this.extend,this.multiple));(this.mustSelect||!u.eq(o.state.selection,this.dragging===!1))&&this.view.dispatch({selection:u,userEvent:"select.pointer"}),this.mustSelect=!1}update(a){a.transactions.some(o=>o.isUserEvent("input.type"))?this.destroy():this.style.update(a)&&setTimeout(()=>this.select(this.lastEvent),20)}}function addsSelectionRange(l,a){let o=l.state.facet(clickAddsSelectionRange);return o.length?o[0](a):browser.mac?a.metaKey:a.ctrlKey}function dragMovesSelection(l,a){let o=l.state.facet(dragMovesSelection$1);return o.length?o[0](a):browser.mac?!a.altKey:!a.ctrlKey}function isInPrimarySelection(l,a){let{main:o}=l.state.selection;if(o.empty)return!1;let u=getSelection(l.root);if(!u||u.rangeCount==0)return!0;let d=u.getRangeAt(0).getClientRects();for(let f=0;f<d.length;f++){let p=d[f];if(p.left<=a.clientX&&p.right>=a.clientX&&p.top<=a.clientY&&p.bottom>=a.clientY)return!0}return!1}function eventBelongsToEditor(l,a){if(!a.bubbles)return!0;if(a.defaultPrevented)return!1;for(let o=a.target,u;o!=l.contentDOM;o=o.parentNode)if(!o||o.nodeType==11||(u=ContentView.get(o))&&u.ignoreEvent(a))return!1;return!0}const handlers=Object.create(null),observers=Object.create(null),brokenClipboardAPI=browser.ie&&browser.ie_version<15||browser.ios&&browser.webkit_version<604;function capturePaste(l){let a=l.dom.parentNode;if(!a)return;let o=a.appendChild(document.createElement("textarea"));o.style.cssText="position: fixed; left: -10000px; top: 10px",o.focus(),setTimeout(()=>{l.focus(),o.remove(),doPaste(l,o.value)},50)}function textFilter(l,a,o){for(let u of l.facet(a))o=u(o,l);return o}function doPaste(l,a){a=textFilter(l.state,clipboardInputFilter,a);let{state:o}=l,u,d=1,f=o.toText(a),p=f.lines==o.selection.ranges.length;if(lastLinewiseCopy!=null&&o.selection.ranges.every(b=>b.empty)&&lastLinewiseCopy==f.toString()){let b=-1;u=o.changeByRange(O=>{let S=o.doc.lineAt(O.from);if(S.from==b)return{range:O};b=S.from;let A=o.toText((p?f.line(d++).text:a)+o.lineBreak);return{changes:{from:S.from,insert:A},range:EditorSelection.cursor(O.from+A.length)}})}else p?u=o.changeByRange(b=>{let O=f.line(d++);return{changes:{from:b.from,to:b.to,insert:O.text},range:EditorSelection.cursor(b.from+O.length)}}):u=o.replaceSelection(f);l.dispatch(u,{userEvent:"input.paste",scrollIntoView:!0})}observers.scroll=l=>{l.inputState.lastScrollTop=l.scrollDOM.scrollTop,l.inputState.lastScrollLeft=l.scrollDOM.scrollLeft},handlers.keydown=(l,a)=>(l.inputState.setSelectionOrigin("select"),a.keyCode==27&&l.inputState.tabFocusMode!=0&&(l.inputState.tabFocusMode=Date.now()+2e3),!1),observers.touchstart=(l,a)=>{l.inputState.lastTouchTime=Date.now(),l.inputState.setSelectionOrigin("select.pointer")},observers.touchmove=l=>{l.inputState.setSelectionOrigin("select.pointer")},handlers.mousedown=(l,a)=>{if(l.observer.flush(),l.inputState.lastTouchTime>Date.now()-2e3)return!1;let o=null;for(let u of l.state.facet(mouseSelectionStyle))if(o=u(l,a),o)break;if(!o&&a.button==0&&(o=basicMouseSelection(l,a)),o){let u=!l.hasFocus;l.inputState.startMouseSelection(new MouseSelection(l,a,o,u)),u&&l.observer.ignore(()=>{focusPreventScroll(l.contentDOM);let f=l.root.activeElement;f&&!f.contains(l.contentDOM)&&f.blur()});let d=l.inputState.mouseSelection;if(d)return d.start(a),d.dragging===!1}return!1};function rangeForClick(l,a,o,u){if(u==1)return EditorSelection.cursor(a,o);if(u==2)return groupAt(l.state,a,o);{let d=LineView.find(l.docView,a),f=l.state.doc.lineAt(d?d.posAtEnd:a),p=d?d.posAtStart:f.from,g=d?d.posAtEnd:f.to;return g<l.state.doc.length&&g==f.to&&g++,EditorSelection.range(p,g)}}let inside=(l,a,o)=>a>=o.top&&a<=o.bottom&&l>=o.left&&l<=o.right;function findPositionSide(l,a,o,u){let d=LineView.find(l.docView,a);if(!d)return 1;let f=a-d.posAtStart;if(f==0)return 1;if(f==d.length)return-1;let p=d.coordsAt(f,-1);if(p&&inside(o,u,p))return-1;let g=d.coordsAt(f,1);return g&&inside(o,u,g)?1:p&&p.bottom>=u?-1:1}function queryPos(l,a){let o=l.posAtCoords({x:a.clientX,y:a.clientY},!1);return{pos:o,bias:findPositionSide(l,o,a.clientX,a.clientY)}}const BadMouseDetail=browser.ie&&browser.ie_version<=11;let lastMouseDown=null,lastMouseDownCount=0,lastMouseDownTime=0;function getClickType(l){if(!BadMouseDetail)return l.detail;let a=lastMouseDown,o=lastMouseDownTime;return lastMouseDown=l,lastMouseDownTime=Date.now(),lastMouseDownCount=!a||o>Date.now()-400&&Math.abs(a.clientX-l.clientX)<2&&Math.abs(a.clientY-l.clientY)<2?(lastMouseDownCount+1)%3:1}function basicMouseSelection(l,a){let o=queryPos(l,a),u=getClickType(a),d=l.state.selection;return{update(f){f.docChanged&&(o.pos=f.changes.mapPos(o.pos),d=d.map(f.changes))},get(f,p,g){let b=queryPos(l,f),O,S=rangeForClick(l,b.pos,b.bias,u);if(o.pos!=b.pos&&!p){let A=rangeForClick(l,o.pos,o.bias,u),M=Math.min(A.from,S.from),E=Math.max(A.to,S.to);S=M<S.from?EditorSelection.range(M,E):EditorSelection.range(E,M)}return p?d.replaceRange(d.main.extend(S.from,S.to)):g&&u==1&&d.ranges.length>1&&(O=removeRangeAround(d,b.pos))?O:g?d.addRange(S):EditorSelection.create([S])}}}function removeRangeAround(l,a){for(let o=0;o<l.ranges.length;o++){let{from:u,to:d}=l.ranges[o];if(u<=a&&d>=a)return EditorSelection.create(l.ranges.slice(0,o).concat(l.ranges.slice(o+1)),l.mainIndex==o?0:l.mainIndex-(l.mainIndex>o?1:0))}return null}handlers.dragstart=(l,a)=>{let{selection:{main:o}}=l.state;if(a.target.draggable){let d=l.docView.nearest(a.target);if(d&&d.isWidget){let f=d.posAtStart,p=f+d.length;(f>=o.to||p<=o.from)&&(o=EditorSelection.range(f,p))}}let{inputState:u}=l;return u.mouseSelection&&(u.mouseSelection.dragging=!0),u.draggedContent=o,a.dataTransfer&&(a.dataTransfer.setData("Text",textFilter(l.state,clipboardOutputFilter,l.state.sliceDoc(o.from,o.to))),a.dataTransfer.effectAllowed="copyMove"),!1},handlers.dragend=l=>(l.inputState.draggedContent=null,!1);function dropText(l,a,o,u){if(o=textFilter(l.state,clipboardInputFilter,o),!o)return;let d=l.posAtCoords({x:a.clientX,y:a.clientY},!1),{draggedContent:f}=l.inputState,p=u&&f&&dragMovesSelection(l,a)?{from:f.from,to:f.to}:null,g={from:d,insert:o},b=l.state.changes(p?[p,g]:g);l.focus(),l.dispatch({changes:b,selection:{anchor:b.mapPos(d,-1),head:b.mapPos(d,1)},userEvent:p?"move.drop":"input.drop"}),l.inputState.draggedContent=null}handlers.drop=(l,a)=>{if(!a.dataTransfer)return!1;if(l.state.readOnly)return!0;let o=a.dataTransfer.files;if(o&&o.length){let u=Array(o.length),d=0,f=()=>{++d==o.length&&dropText(l,a,u.filter(p=>p!=null).join(l.state.lineBreak),!1)};for(let p=0;p<o.length;p++){let g=new FileReader;g.onerror=f,g.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(g.result)||(u[p]=g.result),f()},g.readAsText(o[p])}return!0}else{let u=a.dataTransfer.getData("Text");if(u)return dropText(l,a,u,!0),!0}return!1},handlers.paste=(l,a)=>{if(l.state.readOnly)return!0;l.observer.flush();let o=brokenClipboardAPI?null:a.clipboardData;return o?(doPaste(l,o.getData("text/plain")||o.getData("text/uri-list")),!0):(capturePaste(l),!1)};function captureCopy(l,a){let o=l.dom.parentNode;if(!o)return;let u=o.appendChild(document.createElement("textarea"));u.style.cssText="position: fixed; left: -10000px; top: 10px",u.value=a,u.focus(),u.selectionEnd=a.length,u.selectionStart=0,setTimeout(()=>{u.remove(),l.focus()},50)}function copiedRange(l){let a=[],o=[],u=!1;for(let d of l.selection.ranges)d.empty||(a.push(l.sliceDoc(d.from,d.to)),o.push(d));if(!a.length){let d=-1;for(let{from:f}of l.selection.ranges){let p=l.doc.lineAt(f);p.number>d&&(a.push(p.text),o.push({from:p.from,to:Math.min(l.doc.length,p.to+1)})),d=p.number}u=!0}return{text:textFilter(l,clipboardOutputFilter,a.join(l.lineBreak)),ranges:o,linewise:u}}let lastLinewiseCopy=null;handlers.copy=handlers.cut=(l,a)=>{let{text:o,ranges:u,linewise:d}=copiedRange(l.state);if(!o&&!d)return!1;lastLinewiseCopy=d?o:null,a.type=="cut"&&!l.state.readOnly&&l.dispatch({changes:u,scrollIntoView:!0,userEvent:"delete.cut"});let f=brokenClipboardAPI?null:a.clipboardData;return f?(f.clearData(),f.setData("text/plain",o),!0):(captureCopy(l,o),!1)};const isFocusChange=Annotation.define();function focusChangeTransaction(l,a){let o=[];for(let u of l.facet(focusChangeEffect)){let d=u(l,a);d&&o.push(d)}return o?l.update({effects:o,annotations:isFocusChange.of(!0)}):null}function updateForFocusChange(l){setTimeout(()=>{let a=l.hasFocus;if(a!=l.inputState.notifiedFocused){let o=focusChangeTransaction(l.state,a);o?l.dispatch(o):l.update([])}},10)}observers.focus=l=>{l.inputState.lastFocusTime=Date.now(),!l.scrollDOM.scrollTop&&(l.inputState.lastScrollTop||l.inputState.lastScrollLeft)&&(l.scrollDOM.scrollTop=l.inputState.lastScrollTop,l.scrollDOM.scrollLeft=l.inputState.lastScrollLeft),updateForFocusChange(l)},observers.blur=l=>{l.observer.clearSelectionRange(),updateForFocusChange(l)},observers.compositionstart=observers.compositionupdate=l=>{l.observer.editContext||(l.inputState.compositionFirstChange==null&&(l.inputState.compositionFirstChange=!0),l.inputState.composing<0&&(l.inputState.composing=0))},observers.compositionend=l=>{l.observer.editContext||(l.inputState.composing=-1,l.inputState.compositionEndedAt=Date.now(),l.inputState.compositionPendingKey=!0,l.inputState.compositionPendingChange=l.observer.pendingRecords().length>0,l.inputState.compositionFirstChange=null,browser.chrome&&browser.android?l.observer.flushSoon():l.inputState.compositionPendingChange?Promise.resolve().then(()=>l.observer.flush()):setTimeout(()=>{l.inputState.composing<0&&l.docView.hasComposition&&l.update([])},50))},observers.contextmenu=l=>{l.inputState.lastContextMenu=Date.now()},handlers.beforeinput=(l,a)=>{var o,u;if(a.inputType=="insertReplacementText"&&l.observer.editContext){let f=(o=a.dataTransfer)===null||o===void 0?void 0:o.getData("text/plain"),p=a.getTargetRanges();if(f&&p.length){let g=p[0],b=l.posAtDOM(g.startContainer,g.startOffset),O=l.posAtDOM(g.endContainer,g.endOffset);return applyDOMChangeInner(l,{from:b,to:O,insert:l.state.toText(f)},null),!0}}let d;if(browser.chrome&&browser.android&&(d=PendingKeys.find(f=>f.inputType==a.inputType))&&(l.observer.delayAndroidKey(d.key,d.keyCode),d.key=="Backspace"||d.key=="Delete")){let f=((u=window.visualViewport)===null||u===void 0?void 0:u.height)||0;setTimeout(()=>{var p;(((p=window.visualViewport)===null||p===void 0?void 0:p.height)||0)>f+10&&l.hasFocus&&(l.contentDOM.blur(),l.focus())},100)}return browser.ios&&a.inputType=="deleteContentForward"&&l.observer.flushSoon(),browser.safari&&a.inputType=="insertText"&&l.inputState.composing>=0&&setTimeout(()=>observers.compositionend(l,a),20),!1};const appliedFirefoxHack=new Set;function firefoxCopyCutHack(l){appliedFirefoxHack.has(l)||(appliedFirefoxHack.add(l),l.addEventListener("copy",()=>{}),l.addEventListener("cut",()=>{}))}const wrappingWhiteSpace=["pre-wrap","normal","pre-line","break-spaces"];let heightChangeFlag=!1;function clearHeightChangeFlag(){heightChangeFlag=!1}class HeightOracle{constructor(a){this.lineWrapping=a,this.doc=Text.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(a,o){let u=this.doc.lineAt(o).number-this.doc.lineAt(a).number+1;return this.lineWrapping&&(u+=Math.max(0,Math.ceil((o-a-u*this.lineLength*.5)/this.lineLength))),this.lineHeight*u}heightForLine(a){return this.lineWrapping?(1+Math.max(0,Math.ceil((a-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(a){return this.doc=a,this}mustRefreshForWrapping(a){return wrappingWhiteSpace.indexOf(a)>-1!=this.lineWrapping}mustRefreshForHeights(a){let o=!1;for(let u=0;u<a.length;u++){let d=a[u];d<0?u++:this.heightSamples[Math.floor(d*10)]||(o=!0,this.heightSamples[Math.floor(d*10)]=!0)}return o}refresh(a,o,u,d,f,p){let g=wrappingWhiteSpace.indexOf(a)>-1,b=Math.round(o)!=Math.round(this.lineHeight)||this.lineWrapping!=g;if(this.lineWrapping=g,this.lineHeight=o,this.charWidth=u,this.textHeight=d,this.lineLength=f,b){this.heightSamples={};for(let O=0;O<p.length;O++){let S=p[O];S<0?O++:this.heightSamples[Math.floor(S*10)]=!0}}return b}}class MeasuredHeights{constructor(a,o){this.from=a,this.heights=o,this.index=0}get more(){return this.index<this.heights.length}}class BlockInfo{constructor(a,o,u,d,f){this.from=a,this.length=o,this.top=u,this.height=d,this._content=f}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(a){let o=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(a._content)?a._content:[a]);return new BlockInfo(this.from,this.length+a.length,this.top,this.height+a.height,o)}}var QueryType$1=function(l){return l[l.ByPos=0]="ByPos",l[l.ByHeight=1]="ByHeight",l[l.ByPosNoHeight=2]="ByPosNoHeight",l}(QueryType$1||(QueryType$1={}));const Epsilon=.001;class HeightMap{constructor(a,o,u=2){this.length=a,this.height=o,this.flags=u}get outdated(){return(this.flags&2)>0}set outdated(a){this.flags=(a?2:0)|this.flags&-3}setHeight(a){this.height!=a&&(Math.abs(this.height-a)>Epsilon&&(heightChangeFlag=!0),this.height=a)}replace(a,o,u){return HeightMap.of(u)}decomposeLeft(a,o){o.push(this)}decomposeRight(a,o){o.push(this)}applyChanges(a,o,u,d){let f=this,p=u.doc;for(let g=d.length-1;g>=0;g--){let{fromA:b,toA:O,fromB:S,toB:A}=d[g],M=f.lineAt(b,QueryType$1.ByPosNoHeight,u.setDoc(o),0,0),E=M.to>=O?M:f.lineAt(O,QueryType$1.ByPosNoHeight,u,0,0);for(A+=E.to-O,O=E.to;g>0&&M.from<=d[g-1].toA;)b=d[g-1].fromA,S=d[g-1].fromB,g--,b<M.from&&(M=f.lineAt(b,QueryType$1.ByPosNoHeight,u,0,0));S+=M.from-b,b=M.from;let R=NodeBuilder.build(u.setDoc(p),a,S,A);f=replace(f,f.replace(b,O,R))}return f.updateHeight(u,0)}static empty(){return new HeightMapText(0,0)}static of(a){if(a.length==1)return a[0];let o=0,u=a.length,d=0,f=0;for(;;)if(o==u)if(d>f*2){let g=a[o-1];g.break?a.splice(--o,1,g.left,null,g.right):a.splice(--o,1,g.left,g.right),u+=1+g.break,d-=g.size}else if(f>d*2){let g=a[u];g.break?a.splice(u,1,g.left,null,g.right):a.splice(u,1,g.left,g.right),u+=2+g.break,f-=g.size}else break;else if(d<f){let g=a[o++];g&&(d+=g.size)}else{let g=a[--u];g&&(f+=g.size)}let p=0;return a[o-1]==null?(p=1,o--):a[o]==null&&(p=1,u++),new HeightMapBranch(HeightMap.of(a.slice(0,o)),p,HeightMap.of(a.slice(u)))}}function replace(l,a){return l==a?l:(l.constructor!=a.constructor&&(heightChangeFlag=!0),a)}HeightMap.prototype.size=1;class HeightMapBlock extends HeightMap{constructor(a,o,u){super(a,o),this.deco=u}blockAt(a,o,u,d){return new BlockInfo(d,this.length,u,this.height,this.deco||0)}lineAt(a,o,u,d,f){return this.blockAt(0,u,d,f)}forEachLine(a,o,u,d,f,p){a<=f+this.length&&o>=f&&p(this.blockAt(0,u,d,f))}updateHeight(a,o=0,u=!1,d){return d&&d.from<=o&&d.more&&this.setHeight(d.heights[d.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class HeightMapText extends HeightMapBlock{constructor(a,o){super(a,o,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(a,o,u,d){return new BlockInfo(d,this.length,u,this.height,this.breaks)}replace(a,o,u){let d=u[0];return u.length==1&&(d instanceof HeightMapText||d instanceof HeightMapGap&&d.flags&4)&&Math.abs(this.length-d.length)<10?(d instanceof HeightMapGap?d=new HeightMapText(d.length,this.height):d.height=this.height,this.outdated||(d.outdated=!1),d):HeightMap.of(u)}updateHeight(a,o=0,u=!1,d){return d&&d.from<=o&&d.more?this.setHeight(d.heights[d.index++]):(u||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,a.heightForLine(this.length-this.collapsed))+this.breaks*a.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class HeightMapGap extends HeightMap{constructor(a){super(a,0)}heightMetrics(a,o){let u=a.doc.lineAt(o).number,d=a.doc.lineAt(o+this.length).number,f=d-u+1,p,g=0;if(a.lineWrapping){let b=Math.min(this.height,a.lineHeight*f);p=b/f,this.length>f+1&&(g=(this.height-b)/(this.length-f-1))}else p=this.height/f;return{firstLine:u,lastLine:d,perLine:p,perChar:g}}blockAt(a,o,u,d){let{firstLine:f,lastLine:p,perLine:g,perChar:b}=this.heightMetrics(o,d);if(o.lineWrapping){let O=d+(a<o.lineHeight?0:Math.round(Math.max(0,Math.min(1,(a-u)/this.height))*this.length)),S=o.doc.lineAt(O),A=g+S.length*b,M=Math.max(u,a-A/2);return new BlockInfo(S.from,S.length,M,A,0)}else{let O=Math.max(0,Math.min(p-f,Math.floor((a-u)/g))),{from:S,length:A}=o.doc.line(f+O);return new BlockInfo(S,A,u+g*O,g,0)}}lineAt(a,o,u,d,f){if(o==QueryType$1.ByHeight)return this.blockAt(a,u,d,f);if(o==QueryType$1.ByPosNoHeight){let{from:E,to:R}=u.doc.lineAt(a);return new BlockInfo(E,R-E,0,0,0)}let{firstLine:p,perLine:g,perChar:b}=this.heightMetrics(u,f),O=u.doc.lineAt(a),S=g+O.length*b,A=O.number-p,M=d+g*A+b*(O.from-f-A);return new BlockInfo(O.from,O.length,Math.max(d,Math.min(M,d+this.height-S)),S,0)}forEachLine(a,o,u,d,f,p){a=Math.max(a,f),o=Math.min(o,f+this.length);let{firstLine:g,perLine:b,perChar:O}=this.heightMetrics(u,f);for(let S=a,A=d;S<=o;){let M=u.doc.lineAt(S);if(S==a){let R=M.number-g;A+=b*R+O*(a-f-R)}let E=b+O*M.length;p(new BlockInfo(M.from,M.length,A,E,0)),A+=E,S=M.to+1}}replace(a,o,u){let d=this.length-o;if(d>0){let f=u[u.length-1];f instanceof HeightMapGap?u[u.length-1]=new HeightMapGap(f.length+d):u.push(null,new HeightMapGap(d-1))}if(a>0){let f=u[0];f instanceof HeightMapGap?u[0]=new HeightMapGap(a+f.length):u.unshift(new HeightMapGap(a-1),null)}return HeightMap.of(u)}decomposeLeft(a,o){o.push(new HeightMapGap(a-1),null)}decomposeRight(a,o){o.push(null,new HeightMapGap(this.length-a-1))}updateHeight(a,o=0,u=!1,d){let f=o+this.length;if(d&&d.from<=o+this.length&&d.more){let p=[],g=Math.max(o,d.from),b=-1;for(d.from>o&&p.push(new HeightMapGap(d.from-o-1).updateHeight(a,o));g<=f&&d.more;){let S=a.doc.lineAt(g).length;p.length&&p.push(null);let A=d.heights[d.index++];b==-1?b=A:Math.abs(A-b)>=Epsilon&&(b=-2);let M=new HeightMapText(S,A);M.outdated=!1,p.push(M),g+=S+1}g<=f&&p.push(null,new HeightMapGap(f-g).updateHeight(a,g));let O=HeightMap.of(p);return(b<0||Math.abs(O.height-this.height)>=Epsilon||Math.abs(b-this.heightMetrics(a,o).perLine)>=Epsilon)&&(heightChangeFlag=!0),replace(this,O)}else(u||this.outdated)&&(this.setHeight(a.heightForGap(o,o+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class HeightMapBranch extends HeightMap{constructor(a,o,u){super(a.length+o+u.length,a.height+u.height,o|(a.outdated||u.outdated?2:0)),this.left=a,this.right=u,this.size=a.size+u.size}get break(){return this.flags&1}blockAt(a,o,u,d){let f=u+this.left.height;return a<f?this.left.blockAt(a,o,u,d):this.right.blockAt(a,o,f,d+this.left.length+this.break)}lineAt(a,o,u,d,f){let p=d+this.left.height,g=f+this.left.length+this.break,b=o==QueryType$1.ByHeight?a<p:a<g,O=b?this.left.lineAt(a,o,u,d,f):this.right.lineAt(a,o,u,p,g);if(this.break||(b?O.to<g:O.from>g))return O;let S=o==QueryType$1.ByPosNoHeight?QueryType$1.ByPosNoHeight:QueryType$1.ByPos;return b?O.join(this.right.lineAt(g,S,u,p,g)):this.left.lineAt(g,S,u,d,f).join(O)}forEachLine(a,o,u,d,f,p){let g=d+this.left.height,b=f+this.left.length+this.break;if(this.break)a<b&&this.left.forEachLine(a,o,u,d,f,p),o>=b&&this.right.forEachLine(a,o,u,g,b,p);else{let O=this.lineAt(b,QueryType$1.ByPos,u,d,f);a<O.from&&this.left.forEachLine(a,O.from-1,u,d,f,p),O.to>=a&&O.from<=o&&p(O),o>O.to&&this.right.forEachLine(O.to+1,o,u,g,b,p)}}replace(a,o,u){let d=this.left.length+this.break;if(o<d)return this.balanced(this.left.replace(a,o,u),this.right);if(a>this.left.length)return this.balanced(this.left,this.right.replace(a-d,o-d,u));let f=[];a>0&&this.decomposeLeft(a,f);let p=f.length;for(let g of u)f.push(g);if(a>0&&mergeGaps(f,p-1),o<this.length){let g=f.length;this.decomposeRight(o,f),mergeGaps(f,g)}return HeightMap.of(f)}decomposeLeft(a,o){let u=this.left.length;if(a<=u)return this.left.decomposeLeft(a,o);o.push(this.left),this.break&&(u++,a>=u&&o.push(null)),a>u&&this.right.decomposeLeft(a-u,o)}decomposeRight(a,o){let u=this.left.length,d=u+this.break;if(a>=d)return this.right.decomposeRight(a-d,o);a<u&&this.left.decomposeRight(a,o),this.break&&a<d&&o.push(null),o.push(this.right)}balanced(a,o){return a.size>2*o.size||o.size>2*a.size?HeightMap.of(this.break?[a,null,o]:[a,o]):(this.left=replace(this.left,a),this.right=replace(this.right,o),this.setHeight(a.height+o.height),this.outdated=a.outdated||o.outdated,this.size=a.size+o.size,this.length=a.length+this.break+o.length,this)}updateHeight(a,o=0,u=!1,d){let{left:f,right:p}=this,g=o+f.length+this.break,b=null;return d&&d.from<=o+f.length&&d.more?b=f=f.updateHeight(a,o,u,d):f.updateHeight(a,o,u),d&&d.from<=g+p.length&&d.more?b=p=p.updateHeight(a,g,u,d):p.updateHeight(a,g,u),b?this.balanced(f,p):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function mergeGaps(l,a){let o,u;l[a]==null&&(o=l[a-1])instanceof HeightMapGap&&(u=l[a+1])instanceof HeightMapGap&&l.splice(a-1,3,new HeightMapGap(o.length+1+u.length))}const relevantWidgetHeight=5;class NodeBuilder{constructor(a,o){this.pos=a,this.oracle=o,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=a}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(a,o){if(this.lineStart>-1){let u=Math.min(o,this.lineEnd),d=this.nodes[this.nodes.length-1];d instanceof HeightMapText?d.length+=u-this.pos:(u>this.pos||!this.isCovered)&&this.nodes.push(new HeightMapText(u-this.pos,-1)),this.writtenTo=u,o>u&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=o}point(a,o,u){if(a<o||u.heightRelevant){let d=u.widget?u.widget.estimatedHeight:0,f=u.widget?u.widget.lineBreaks:0;d<0&&(d=this.oracle.lineHeight);let p=o-a;u.block?this.addBlock(new HeightMapBlock(p,d,u)):(p||f||d>=relevantWidgetHeight)&&this.addLineDeco(d,f,p)}else o>a&&this.span(a,o);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:a,to:o}=this.oracle.doc.lineAt(this.pos);this.lineStart=a,this.lineEnd=o,this.writtenTo<a&&((this.writtenTo<a-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,a-1)),this.nodes.push(null)),this.pos>a&&this.nodes.push(new HeightMapText(this.pos-a,-1)),this.writtenTo=this.pos}blankContent(a,o){let u=new HeightMapGap(o-a);return this.oracle.doc.lineAt(a).to==o&&(u.flags|=4),u}ensureLine(){this.enterLine();let a=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(a instanceof HeightMapText)return a;let o=new HeightMapText(0,-1);return this.nodes.push(o),o}addBlock(a){this.enterLine();let o=a.deco;o&&o.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(a),this.writtenTo=this.pos=this.pos+a.length,o&&o.endSide>0&&(this.covering=a)}addLineDeco(a,o,u){let d=this.ensureLine();d.length+=u,d.collapsed+=u,d.widgetHeight=Math.max(d.widgetHeight,a),d.breaks+=o,this.writtenTo=this.pos=this.pos+u}finish(a){let o=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(o instanceof HeightMapText)&&!this.isCovered?this.nodes.push(new HeightMapText(0,-1)):(this.writtenTo<this.pos||o==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let u=a;for(let d of this.nodes)d instanceof HeightMapText&&d.updateHeight(this.oracle,u),u+=d?d.length:1;return this.nodes}static build(a,o,u,d){let f=new NodeBuilder(u,a);return RangeSet.spans(o,u,d,f,0),f.finish(u)}}function heightRelevantDecoChanges(l,a,o){let u=new DecorationComparator;return RangeSet.compare(l,a,o,u,0),u.changes}class DecorationComparator{constructor(){this.changes=[]}compareRange(){}comparePoint(a,o,u,d){(a<o||u&&u.heightRelevant||d&&d.heightRelevant)&&addRange(a,o,this.changes,5)}}function visiblePixelRange(l,a){let o=l.getBoundingClientRect(),u=l.ownerDocument,d=u.defaultView||window,f=Math.max(0,o.left),p=Math.min(d.innerWidth,o.right),g=Math.max(0,o.top),b=Math.min(d.innerHeight,o.bottom);for(let O=l.parentNode;O&&O!=u.body;)if(O.nodeType==1){let S=O,A=window.getComputedStyle(S);if((S.scrollHeight>S.clientHeight||S.scrollWidth>S.clientWidth)&&A.overflow!="visible"){let M=S.getBoundingClientRect();f=Math.max(f,M.left),p=Math.min(p,M.right),g=Math.max(g,M.top),b=Math.min(O==l.parentNode?d.innerHeight:b,M.bottom)}O=A.position=="absolute"||A.position=="fixed"?S.offsetParent:S.parentNode}else if(O.nodeType==11)O=O.host;else break;return{left:f-o.left,right:Math.max(f,p)-o.left,top:g-(o.top+a),bottom:Math.max(g,b)-(o.top+a)}}function inWindow(l){let a=l.getBoundingClientRect(),o=l.ownerDocument.defaultView||window;return a.left<o.innerWidth&&a.right>0&&a.top<o.innerHeight&&a.bottom>0}function fullPixelRange(l,a){let o=l.getBoundingClientRect();return{left:0,right:o.right-o.left,top:a,bottom:o.bottom-(o.top+a)}}class LineGap{constructor(a,o,u,d){this.from=a,this.to=o,this.size=u,this.displaySize=d}static same(a,o){if(a.length!=o.length)return!1;for(let u=0;u<a.length;u++){let d=a[u],f=o[u];if(d.from!=f.from||d.to!=f.to||d.size!=f.size)return!1}return!0}draw(a,o){return Decoration.replace({widget:new LineGapWidget(this.displaySize*(o?a.scaleY:a.scaleX),o)}).range(this.from,this.to)}}class LineGapWidget extends WidgetType{constructor(a,o){super(),this.size=a,this.vertical=o}eq(a){return a.size==this.size&&a.vertical==this.vertical}toDOM(){let a=document.createElement("div");return this.vertical?a.style.height=this.size+"px":(a.style.width=this.size+"px",a.style.height="2px",a.style.display="inline-block"),a}get estimatedHeight(){return this.vertical?this.size:-1}}class ViewState{constructor(a){this.state=a,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 o=a.facet(contentAttributes).some(u=>typeof u!="function"&&u.class=="cm-lineWrapping");this.heightOracle=new HeightOracle(o),this.stateDeco=a.facet(decorations).filter(u=>typeof u!="function"),this.heightMap=HeightMap.empty().applyChanges(this.stateDeco,Text.empty,this.heightOracle.setDoc(a.doc),[new ChangedRange(0,0,0,a.doc.length)]);for(let u=0;u<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());u++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Decoration.set(this.lineGaps.map(u=>u.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let a=[this.viewport],{main:o}=this.state.selection;for(let u=0;u<=1;u++){let d=u?o.head:o.anchor;if(!a.some(({from:f,to:p})=>d>=f&&d<=p)){let{from:f,to:p}=this.lineBlockAt(d);a.push(new Viewport(f,p))}}return this.viewports=a.sort((u,d)=>u.from-d.from),this.updateScaler()}updateScaler(){let a=this.scaler;return this.scaler=this.heightMap.height<=7e6?IdScaler:new BigScaler(this.heightOracle,this.heightMap,this.viewports),a.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,a=>{this.viewportLines.push(scaleBlock(a,this.scaler))})}update(a,o=null){this.state=a.state;let u=this.stateDeco;this.stateDeco=this.state.facet(decorations).filter(S=>typeof S!="function");let d=a.changedRanges,f=ChangedRange.extendWithRanges(d,heightRelevantDecoChanges(u,this.stateDeco,a?a.changes:ChangeSet.empty(this.state.doc.length))),p=this.heightMap.height,g=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);clearHeightChangeFlag(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,a.startState.doc,this.heightOracle.setDoc(this.state.doc),f),(this.heightMap.height!=p||heightChangeFlag)&&(a.flags|=2),g?(this.scrollAnchorPos=a.changes.mapPos(g.from,-1),this.scrollAnchorHeight=g.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let b=f.length?this.mapViewport(this.viewport,a.changes):this.viewport;(o&&(o.range.head<b.from||o.range.head>b.to)||!this.viewportIsAppropriate(b))&&(b=this.getViewport(0,o));let O=b.from!=this.viewport.from||b.to!=this.viewport.to;this.viewport=b,a.flags|=this.updateForViewport(),(O||!a.changes.empty||a.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,a.changes))),a.flags|=this.computeVisibleRanges(a.changes),o&&(this.scrollTarget=o),!this.mustEnforceCursorAssoc&&a.selectionSet&&a.view.lineWrapping&&a.state.selection.main.empty&&a.state.selection.main.assoc&&!a.state.facet(nativeSelectionHidden)&&(this.mustEnforceCursorAssoc=!0)}measure(a){let o=a.contentDOM,u=window.getComputedStyle(o),d=this.heightOracle,f=u.whiteSpace;this.defaultTextDirection=u.direction=="rtl"?Direction.RTL:Direction.LTR;let p=this.heightOracle.mustRefreshForWrapping(f),g=o.getBoundingClientRect(),b=p||this.mustMeasureContent||this.contentDOMHeight!=g.height;this.contentDOMHeight=g.height,this.mustMeasureContent=!1;let O=0,S=0;if(g.width&&g.height){let{scaleX:se,scaleY:ee}=getScale(o,g);(se>.005&&Math.abs(this.scaleX-se)>.005||ee>.005&&Math.abs(this.scaleY-ee)>.005)&&(this.scaleX=se,this.scaleY=ee,O|=16,p=b=!0)}let A=(parseInt(u.paddingTop)||0)*this.scaleY,M=(parseInt(u.paddingBottom)||0)*this.scaleY;(this.paddingTop!=A||this.paddingBottom!=M)&&(this.paddingTop=A,this.paddingBottom=M,O|=18),this.editorWidth!=a.scrollDOM.clientWidth&&(d.lineWrapping&&(b=!0),this.editorWidth=a.scrollDOM.clientWidth,O|=16);let E=a.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=E&&(this.scrollAnchorHeight=-1,this.scrollTop=E),this.scrolledToBottom=isScrolledToBottom(a.scrollDOM);let R=(this.printing?fullPixelRange:visiblePixelRange)(o,this.paddingTop),L=R.top-this.pixelViewport.top,U=R.bottom-this.pixelViewport.bottom;this.pixelViewport=R;let Z=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(Z!=this.inView&&(this.inView=Z,Z&&(b=!0)),!this.inView&&!this.scrollTarget&&!inWindow(a.dom))return 0;let re=g.width;if((this.contentDOMWidth!=re||this.editorHeight!=a.scrollDOM.clientHeight)&&(this.contentDOMWidth=g.width,this.editorHeight=a.scrollDOM.clientHeight,O|=16),b){let se=a.docView.measureVisibleLineHeights(this.viewport);if(d.mustRefreshForHeights(se)&&(p=!0),p||d.lineWrapping&&Math.abs(re-this.contentDOMWidth)>d.charWidth){let{lineHeight:ee,charWidth:oe,textHeight:me}=a.docView.measureTextSize();p=ee>0&&d.refresh(f,ee,oe,me,re/oe,se),p&&(a.docView.minWidth=0,O|=16)}L>0&&U>0?S=Math.max(L,U):L<0&&U<0&&(S=Math.min(L,U)),clearHeightChangeFlag();for(let ee of this.viewports){let oe=ee.from==this.viewport.from?se:a.docView.measureVisibleLineHeights(ee);this.heightMap=(p?HeightMap.empty().applyChanges(this.stateDeco,Text.empty,this.heightOracle,[new ChangedRange(0,0,0,a.state.doc.length)]):this.heightMap).updateHeight(d,0,p,new MeasuredHeights(ee.from,oe))}heightChangeFlag&&(O|=2)}let he=!this.viewportIsAppropriate(this.viewport,S)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return he&&(O&2&&(O|=this.updateScaler()),this.viewport=this.getViewport(S,this.scrollTarget),O|=this.updateForViewport()),(O&2||he)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(p?[]:this.lineGaps,a)),O|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,a.docView.enforceCursorAssoc()),O}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(a,o){let u=.5-Math.max(-.5,Math.min(.5,a/1e3/2)),d=this.heightMap,f=this.heightOracle,{visibleTop:p,visibleBottom:g}=this,b=new Viewport(d.lineAt(p-u*1e3,QueryType$1.ByHeight,f,0,0).from,d.lineAt(g+(1-u)*1e3,QueryType$1.ByHeight,f,0,0).to);if(o){let{head:O}=o.range;if(O<b.from||O>b.to){let S=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),A=d.lineAt(O,QueryType$1.ByPos,f,0,0),M;o.y=="center"?M=(A.top+A.bottom)/2-S/2:o.y=="start"||o.y=="nearest"&&O<b.from?M=A.top:M=A.bottom-S,b=new Viewport(d.lineAt(M-500,QueryType$1.ByHeight,f,0,0).from,d.lineAt(M+S+500,QueryType$1.ByHeight,f,0,0).to)}}return b}mapViewport(a,o){let u=o.mapPos(a.from,-1),d=o.mapPos(a.to,1);return new Viewport(this.heightMap.lineAt(u,QueryType$1.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(d,QueryType$1.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:a,to:o},u=0){if(!this.inView)return!0;let{top:d}=this.heightMap.lineAt(a,QueryType$1.ByPos,this.heightOracle,0,0),{bottom:f}=this.heightMap.lineAt(o,QueryType$1.ByPos,this.heightOracle,0,0),{visibleTop:p,visibleBottom:g}=this;return(a==0||d<=p-Math.max(10,Math.min(-u,250)))&&(o==this.state.doc.length||f>=g+Math.max(10,Math.min(u,250)))&&d>p-2e3&&f<g+2e3}mapLineGaps(a,o){if(!a.length||o.empty)return a;let u=[];for(let d of a)o.touchesRange(d.from,d.to)||u.push(new LineGap(o.mapPos(d.from),o.mapPos(d.to),d.size,d.displaySize));return u}ensureLineGaps(a,o){let u=this.heightOracle.lineWrapping,d=u?1e4:2e3,f=d>>1,p=d<<1;if(this.defaultTextDirection!=Direction.LTR&&!u)return[];let g=[],b=(S,A,M,E)=>{if(A-S<f)return;let R=this.state.selection.main,L=[R.from];R.empty||L.push(R.to);for(let Z of L)if(Z>S&&Z<A){b(S,Z-10,M,E),b(Z+10,A,M,E);return}let U=find(a,Z=>Z.from>=M.from&&Z.to<=M.to&&Math.abs(Z.from-S)<f&&Math.abs(Z.to-A)<f&&!L.some(re=>Z.from<re&&Z.to>re));if(!U){if(A<M.to&&o&&u&&o.visibleRanges.some(he=>he.from<=A&&he.to>=A)){let he=o.moveToLineBoundary(EditorSelection.cursor(A),!1,!0).head;he>S&&(A=he)}let Z=this.gapSize(M,S,A,E),re=u||Z<2e6?Z:2e6;U=new LineGap(S,A,Z,re)}g.push(U)},O=S=>{if(S.length<p||S.type!=BlockType.Text)return;let A=lineStructure(S.from,S.to,this.stateDeco);if(A.total<p)return;let M=this.scrollTarget?this.scrollTarget.range.head:null,E,R;if(u){let L=d/this.heightOracle.lineLength*this.heightOracle.lineHeight,U,Z;if(M!=null){let re=findFraction(A,M),he=((this.visibleBottom-this.visibleTop)/2+L)/S.height;U=re-he,Z=re+he}else U=(this.visibleTop-S.top-L)/S.height,Z=(this.visibleBottom-S.top+L)/S.height;E=findPosition(A,U),R=findPosition(A,Z)}else{let L=A.total*this.heightOracle.charWidth,U=d*this.heightOracle.charWidth,Z=0;if(L>2e6)for(let oe of a)oe.from>=S.from&&oe.from<S.to&&oe.size!=oe.displaySize&&oe.from*this.heightOracle.charWidth+Z<this.pixelViewport.left&&(Z=oe.size-oe.displaySize);let re=this.pixelViewport.left+Z,he=this.pixelViewport.right+Z,se,ee;if(M!=null){let oe=findFraction(A,M),me=((he-re)/2+U)/L;se=oe-me,ee=oe+me}else se=(re-U)/L,ee=(he+U)/L;E=findPosition(A,se),R=findPosition(A,ee)}E>S.from&&b(S.from,E,S,A),R<S.to&&b(R,S.to,S,A)};for(let S of this.viewportLines)Array.isArray(S.type)?S.type.forEach(O):O(S);return g}gapSize(a,o,u,d){let f=findFraction(d,u)-findFraction(d,o);return this.heightOracle.lineWrapping?a.height*f:d.total*this.heightOracle.charWidth*f}updateLineGaps(a){LineGap.same(a,this.lineGaps)||(this.lineGaps=a,this.lineGapDeco=Decoration.set(a.map(o=>o.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(a){let o=this.stateDeco;this.lineGaps.length&&(o=o.concat(this.lineGapDeco));let u=[];RangeSet.spans(o,this.viewport.from,this.viewport.to,{span(f,p){u.push({from:f,to:p})},point(){}},20);let d=0;if(u.length!=this.visibleRanges.length)d=12;else for(let f=0;f<u.length&&!(d&8);f++){let p=this.visibleRanges[f],g=u[f];(p.from!=g.from||p.to!=g.to)&&(d|=4,a&&a.mapPos(p.from,-1)==g.from&&a.mapPos(p.to,1)==g.to||(d|=8))}return this.visibleRanges=u,d}lineBlockAt(a){return a>=this.viewport.from&&a<=this.viewport.to&&this.viewportLines.find(o=>o.from<=a&&o.to>=a)||scaleBlock(this.heightMap.lineAt(a,QueryType$1.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(a){return a>=this.viewportLines[0].top&&a<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(o=>o.top<=a&&o.bottom>=a)||scaleBlock(this.heightMap.lineAt(this.scaler.fromDOM(a),QueryType$1.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(a){let o=this.lineBlockAtHeight(a+8);return o.from>=this.viewport.from||this.viewportLines[0].top-a>200?o:this.viewportLines[0]}elementAtHeight(a){return scaleBlock(this.heightMap.blockAt(this.scaler.fromDOM(a),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(a,o){this.from=a,this.to=o}}function lineStructure(l,a,o){let u=[],d=l,f=0;return RangeSet.spans(o,l,a,{span(){},point(p,g){p>d&&(u.push({from:d,to:p}),f+=p-d),d=g}},20),d<a&&(u.push({from:d,to:a}),f+=a-d),{total:f,ranges:u}}function findPosition({total:l,ranges:a},o){if(o<=0)return a[0].from;if(o>=1)return a[a.length-1].to;let u=Math.floor(l*o);for(let d=0;;d++){let{from:f,to:p}=a[d],g=p-f;if(u<=g)return f+u;u-=g}}function findFraction(l,a){let o=0;for(let{from:u,to:d}of l.ranges){if(a<=d){o+=a-u;break}o+=d-u}return o/l.total}function find(l,a){for(let o of l)if(a(o))return o}const IdScaler={toDOM(l){return l},fromDOM(l){return l},scale:1,eq(l){return l==this}};class BigScaler{constructor(a,o,u){let d=0,f=0,p=0;this.viewports=u.map(({from:g,to:b})=>{let O=o.lineAt(g,QueryType$1.ByPos,a,0,0).top,S=o.lineAt(b,QueryType$1.ByPos,a,0,0).bottom;return d+=S-O,{from:g,to:b,top:O,bottom:S,domTop:0,domBottom:0}}),this.scale=(7e6-d)/(o.height-d);for(let g of this.viewports)g.domTop=p+(g.top-f)*this.scale,p=g.domBottom=g.domTop+(g.bottom-g.top),f=g.bottom}toDOM(a){for(let o=0,u=0,d=0;;o++){let f=o<this.viewports.length?this.viewports[o]:null;if(!f||a<f.top)return d+(a-u)*this.scale;if(a<=f.bottom)return f.domTop+(a-f.top);u=f.bottom,d=f.domBottom}}fromDOM(a){for(let o=0,u=0,d=0;;o++){let f=o<this.viewports.length?this.viewports[o]:null;if(!f||a<f.domTop)return u+(a-d)/this.scale;if(a<=f.domBottom)return f.top+(a-f.domTop);u=f.bottom,d=f.domBottom}}eq(a){return a instanceof BigScaler?this.scale==a.scale&&this.viewports.length==a.viewports.length&&this.viewports.every((o,u)=>o.from==a.viewports[u].from&&o.to==a.viewports[u].to):!1}}function scaleBlock(l,a){if(a.scale==1)return l;let o=a.toDOM(l.top),u=a.toDOM(l.bottom);return new BlockInfo(l.from,l.length,o,u-o,Array.isArray(l._content)?l._content.map(d=>scaleBlock(d,a)):l._content)}const theme$1=Facet.define({combine:l=>l.join(" ")}),darkTheme=Facet.define({combine:l=>l.indexOf(!0)>-1}),baseThemeID=StyleModule.newName(),baseLightID=StyleModule.newName(),baseDarkID=StyleModule.newName(),lightDarkIDs={"&light":"."+baseLightID,"&dark":"."+baseDarkID};function buildTheme(l,a,o){return new StyleModule(a,{finish(u){return/&/.test(u)?u.replace(/&\w*/,d=>{if(d=="&")return l;if(!o||!o[d])throw new RangeError(`Unsupported selector: ${d}`);return o[d]}):l+" "+u}})}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(a){this.view=a,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=a.contentDOM,this.observer=new MutationObserver(o=>{for(let u of o)this.queue.push(u);(browser.ie&&browser.ie_version<=11||browser.ios&&a.composing)&&o.some(u=>u.type=="childList"&&u.removedNodes.length||u.type=="characterData"&&u.oldValue.length>u.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&a.constructor.EDIT_CONTEXT!==!1&&!(browser.chrome&&browser.chrome_version<126)&&(this.editContext=new EditContextManager(a),a.state.facet(editable)&&(a.contentDOM.editContext=this.editContext.editContext)),useCharData&&(this.onCharData=o=>{this.queue.push({target:o.target,type:"characterData",oldValue:o.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 o;((o=this.view.docView)===null||o===void 0?void 0:o.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(a.scrollDOM)),this.addWindowListeners(this.win=a.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(o=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),o.length>0&&o[o.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(o=>{o.length>0&&o[o.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(a){this.view.inputState.runHandlers("scroll",a),this.intersecting&&this.view.measure()}onScroll(a){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(a)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(a){(a.type=="change"||!a.type)&&!a.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(a){if(this.gapIntersection&&(a.length!=this.gaps.length||this.gaps.some((o,u)=>o!=a[u]))){this.gapIntersection.disconnect();for(let o of a)this.gapIntersection.observe(o);this.gaps=a}}onSelectionChange(a){let o=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:u}=this,d=this.selectionRange;if(u.state.facet(editable)?u.root.activeElement!=this.dom:!hasSelection(this.dom,d))return;let f=d.anchorNode&&u.docView.nearest(d.anchorNode);if(f&&f.ignoreEvent(a)){o||(this.selectionChanged=!1);return}(browser.ie&&browser.ie_version<=11||browser.android&&browser.chrome)&&!u.state.selection.main.empty&&d.focusNode&&isEquivalentPosition(d.focusNode,d.focusOffset,d.anchorNode,d.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:a}=this,o=getSelection(a.root);if(!o)return!1;let u=browser.safari&&a.root.nodeType==11&&a.root.activeElement==this.dom&&safariSelectionRangeHack(this.view,o)||o;if(!u||this.selectionRange.eq(u))return!1;let d=hasSelection(this.dom,u);return d&&!this.selectionChanged&&a.inputState.lastFocusTime>Date.now()-200&&a.inputState.lastTouchTime<Date.now()-300&&atElementStart(this.dom,u)?(this.view.inputState.lastFocusTime=0,a.docView.updateSelection(),!1):(this.selectionRange.setRange(u),d&&(this.selectionChanged=!0),!0)}setSelectionRange(a,o){this.selectionRange.set(a.node,a.offset,o.node,o.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let a=0,o=null;for(let u=this.dom;u;)if(u.nodeType==1)!o&&a<this.scrollTargets.length&&this.scrollTargets[a]==u?a++:o||(o=this.scrollTargets.slice(0,a)),o&&o.push(u),u=u.assignedSlot||u.parentNode;else if(u.nodeType==11)u=u.host;else break;if(a<this.scrollTargets.length&&!o&&(o=this.scrollTargets.slice(0,a)),o){for(let u of this.scrollTargets)u.removeEventListener("scroll",this.onScroll);for(let u of this.scrollTargets=o)u.addEventListener("scroll",this.onScroll)}}ignore(a){if(!this.active)return a();try{return this.stop(),a()}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(a,o){var u;if(!this.delayedAndroidKey){let d=()=>{let f=this.delayedAndroidKey;f&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=f.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&f.force&&dispatchKey(this.dom,f.key,f.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(d)}(!this.delayedAndroidKey||a=="Enter")&&(this.delayedAndroidKey={key:a,keyCode:o,force:this.lastChange<Date.now()-50||!!(!((u=this.delayedAndroidKey)===null||u===void 0)&&u.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 a of this.observer.takeRecords())this.queue.push(a);return this.queue}processRecords(){let a=this.pendingRecords();a.length&&(this.queue=[]);let o=-1,u=-1,d=!1;for(let f of a){let p=this.readMutation(f);p&&(p.typeOver&&(d=!0),o==-1?{from:o,to:u}=p:(o=Math.min(p.from,o),u=Math.max(p.to,u)))}return{from:o,to:u,typeOver:d}}readChange(){let{from:a,to:o,typeOver:u}=this.processRecords(),d=this.selectionChanged&&hasSelection(this.dom,this.selectionRange);if(a<0&&!d)return null;a>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let f=new DOMChange(this.view,a,o,u);return this.view.docView.domChanged={newSel:f.newSel?f.newSel.main:null},f}flush(a=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;a&&this.readSelectionRange();let o=this.readChange();if(!o)return this.view.requestMeasure(),!1;let u=this.view.state,d=applyDOMChange(this.view,o);return this.view.state==u&&(o.domChanged||o.newSel&&!o.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),d}readMutation(a){let o=this.view.docView.nearest(a.target);if(!o||o.ignoreMutation(a))return null;if(o.markDirty(a.type=="attributes"),a.type=="attributes"&&(o.flags|=4),a.type=="childList"){let u=findChild(o,a.previousSibling||a.target.previousSibling,-1),d=findChild(o,a.nextSibling||a.target.nextSibling,1);return{from:u?o.posAfter(u):o.posAtStart,to:d?o.posBefore(d):o.posAtEnd,typeOver:!1}}else return a.type=="characterData"?{from:o.posAtStart,to:o.posAtEnd,typeOver:a.target.nodeValue==a.oldValue}:null}setWindow(a){a!=this.win&&(this.removeWindowListeners(this.win),this.win=a,this.addWindowListeners(this.win))}addWindowListeners(a){a.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):a.addEventListener("beforeprint",this.onPrint),a.addEventListener("scroll",this.onScroll),a.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(a){a.removeEventListener("scroll",this.onScroll),a.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):a.removeEventListener("beforeprint",this.onPrint),a.document.removeEventListener("selectionchange",this.onSelectionChange)}update(a){this.editContext&&(this.editContext.update(a),a.startState.facet(editable)!=a.state.facet(editable)&&(a.view.contentDOM.editContext=a.state.facet(editable)?this.editContext.editContext:null))}destroy(){var a,o,u;this.stop(),(a=this.intersection)===null||a===void 0||a.disconnect(),(o=this.gapIntersection)===null||o===void 0||o.disconnect(),(u=this.resizeScroll)===null||u===void 0||u.disconnect();for(let d of this.scrollTargets)d.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(l,a,o){for(;a;){let u=ContentView.get(a);if(u&&u.parent==l)return u;let d=a.parentNode;a=d!=l.dom?d:o>0?a.nextSibling:a.previousSibling}return null}function buildSelectionRangeFromRange(l,a){let o=a.startContainer,u=a.startOffset,d=a.endContainer,f=a.endOffset,p=l.docView.domAtPos(l.state.selection.main.anchor);return isEquivalentPosition(p.node,p.offset,d,f)&&([o,u,d,f]=[d,f,o,u]),{anchorNode:o,anchorOffset:u,focusNode:d,focusOffset:f}}function safariSelectionRangeHack(l,a){if(a.getComposedRanges){let d=a.getComposedRanges(l.root)[0];if(d)return buildSelectionRangeFromRange(l,d)}let o=null;function u(d){d.preventDefault(),d.stopImmediatePropagation(),o=d.getTargetRanges()[0]}return l.contentDOM.addEventListener("beforeinput",u,!0),l.dom.ownerDocument.execCommand("indent"),l.contentDOM.removeEventListener("beforeinput",u,!0),o?buildSelectionRangeFromRange(l,o):null}class EditContextManager{constructor(a){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(a.state);let o=this.editContext=new window.EditContext({text:a.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,a.state.selection.main.anchor))),selectionEnd:this.toContextPos(a.state.selection.main.head)});this.handlers.textupdate=u=>{let d=a.state.selection.main,{anchor:f,head:p}=d,g=this.toEditorPos(u.updateRangeStart),b=this.toEditorPos(u.updateRangeEnd);a.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:u.updateRangeStart,editorBase:g,drifted:!1});let O={from:g,to:b,insert:Text.of(u.text.split(`
`))};if(O.from==this.from&&f<this.from?O.from=f:O.to==this.to&&f>this.to&&(O.to=f),O.from==O.to&&!O.insert.length){let S=EditorSelection.single(this.toEditorPos(u.selectionStart),this.toEditorPos(u.selectionEnd));S.main.eq(d)||a.dispatch({selection:S,userEvent:"select"});return}if((browser.mac||browser.android)&&O.from==p-1&&/^\. ?$/.test(u.text)&&a.contentDOM.getAttribute("autocorrect")=="off"&&(O={from:g,to:b,insert:Text.of([u.text.replace("."," ")])}),this.pendingContextChange=O,!a.state.readOnly){let S=this.to-this.from+(O.to-O.from+O.insert.length);applyDOMChangeInner(a,O,EditorSelection.single(this.toEditorPos(u.selectionStart,S),this.toEditorPos(u.selectionEnd,S)))}this.pendingContextChange&&(this.revertPending(a.state),this.setSelection(a.state))},this.handlers.characterboundsupdate=u=>{let d=[],f=null;for(let p=this.toEditorPos(u.rangeStart),g=this.toEditorPos(u.rangeEnd);p<g;p++){let b=a.coordsForChar(p);f=b&&new DOMRect(b.left,b.top,b.right-b.left,b.bottom-b.top)||f||new DOMRect,d.push(f)}o.updateCharacterBounds(u.rangeStart,d)},this.handlers.textformatupdate=u=>{let d=[];for(let f of u.getTextFormats()){let p=f.underlineStyle,g=f.underlineThickness;if(p!="None"&&g!="None"){let b=this.toEditorPos(f.rangeStart),O=this.toEditorPos(f.rangeEnd);if(b<O){let S=`text-decoration: underline ${p=="Dashed"?"dashed ":p=="Squiggle"?"wavy ":""}${g=="Thin"?1:2}px`;d.push(Decoration.mark({attributes:{style:S}}).range(b,O))}}}a.dispatch({effects:setEditContextFormatting.of(Decoration.set(d))})},this.handlers.compositionstart=()=>{a.inputState.composing<0&&(a.inputState.composing=0,a.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(a.inputState.composing=-1,a.inputState.compositionFirstChange=null,this.composing){let{drifted:u}=this.composing;this.composing=null,u&&this.reset(a.state)}};for(let u in this.handlers)o.addEventListener(u,this.handlers[u]);this.measureReq={read:u=>{this.editContext.updateControlBounds(u.contentDOM.getBoundingClientRect());let d=getSelection(u.root);d&&d.rangeCount&&this.editContext.updateSelectionBounds(d.getRangeAt(0).getBoundingClientRect())}}}applyEdits(a){let o=0,u=!1,d=this.pendingContextChange;return a.changes.iterChanges((f,p,g,b,O)=>{if(u)return;let S=O.length-(p-f);if(d&&p>=d.to)if(d.from==f&&d.to==p&&d.insert.eq(O)){d=this.pendingContextChange=null,o+=S,this.to+=S;return}else d=null,this.revertPending(a.state);if(f+=o,p+=o,p<=this.from)this.from+=S,this.to+=S;else if(f<this.to){if(f<this.from||p>this.to||this.to-this.from+O.length>3e4){u=!0;return}this.editContext.updateText(this.toContextPos(f),this.toContextPos(p),O.toString()),this.to+=S}o+=S}),d&&!u&&this.revertPending(a.state),!u}update(a){let o=this.pendingContextChange;this.composing&&(this.composing.drifted||a.transactions.some(u=>!u.isUserEvent("input.type")&&u.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=a.changes.mapPos(this.composing.editorBase)):!this.applyEdits(a)||!this.rangeIsValid(a.state)?(this.pendingContextChange=null,this.reset(a.state)):(a.docChanged||a.selectionSet||o)&&this.setSelection(a.state),(a.geometryChanged||a.docChanged||a.selectionSet)&&a.view.requestMeasure(this.measureReq)}resetRange(a){let{head:o}=a.selection.main;this.from=Math.max(0,o-1e4),this.to=Math.min(a.doc.length,o+1e4)}reset(a){this.resetRange(a),this.editContext.updateText(0,this.editContext.text.length,a.doc.sliceString(this.from,this.to)),this.setSelection(a)}revertPending(a){let o=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(o.from),this.toContextPos(o.from+o.insert.length),a.doc.sliceString(o.from,o.to))}setSelection(a){let{main:o}=a.selection,u=this.toContextPos(Math.max(this.from,Math.min(this.to,o.anchor))),d=this.toContextPos(o.head);(this.editContext.selectionStart!=u||this.editContext.selectionEnd!=d)&&this.editContext.updateSelection(u,d)}rangeIsValid(a){let{head:o}=a.selection.main;return!(this.from>0&&o-this.from<500||this.to<a.doc.length&&this.to-o<500||this.to-this.from>3e4)}toEditorPos(a,o=this.to-this.from){a=Math.min(a,o);let u=this.composing;return u&&u.drifted?u.editorBase+(a-u.contextBase):a+this.from}toContextPos(a){let o=this.composing;return o&&o.drifted?o.contextBase+(a-o.editorBase):a-this.from}destroy(){for(let a in this.handlers)this.editContext.removeEventListener(a,this.handlers[a])}}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(a={}){var o;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),a.parent&&a.parent.appendChild(this.dom);let{dispatch:u}=a;this.dispatchTransactions=a.dispatchTransactions||u&&(d=>d.forEach(f=>u(f,this)))||(d=>this.update(d)),this.dispatch=this.dispatch.bind(this),this._root=a.root||getRoot(a.parent)||document,this.viewState=new ViewState(a.state||EditorState.create(a)),a.scrollTo&&a.scrollTo.is(scrollIntoView$1)&&(this.viewState.scrollTarget=a.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(viewPlugin).map(d=>new PluginInstance(d));for(let d of this.plugins)d.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(),!((o=document.fonts)===null||o===void 0)&&o.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...a){let o=a.length==1&&a[0]instanceof Transaction?a:a.length==1&&Array.isArray(a[0])?a[0]:[this.state.update(...a)];this.dispatchTransactions(o,this)}update(a){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let o=!1,u=!1,d,f=this.state;for(let M of a){if(M.startState!=f)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");f=M.state}if(this.destroyed){this.viewState.state=f;return}let p=this.hasFocus,g=0,b=null;a.some(M=>M.annotation(isFocusChange))?(this.inputState.notifiedFocused=p,g=1):p!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=p,b=focusChangeTransaction(f,p),b||(g=1));let O=this.observer.delayedAndroidKey,S=null;if(O?(this.observer.clearDelayedAndroidKey(),S=this.observer.readChange(),(S&&!this.state.doc.eq(f.doc)||!this.state.selection.eq(f.selection))&&(S=null)):this.observer.clear(),f.facet(EditorState.phrases)!=this.state.facet(EditorState.phrases))return this.setState(f);d=ViewUpdate.create(this,f,a),d.flags|=g;let A=this.viewState.scrollTarget;try{this.updateState=2;for(let M of a){if(A&&(A=A.map(M.changes)),M.scrollIntoView){let{main:E}=M.state.selection;A=new ScrollTarget(E.empty?E:EditorSelection.cursor(E.head,E.head>E.anchor?-1:1))}for(let E of M.effects)E.is(scrollIntoView$1)&&(A=E.value.clip(this.state))}this.viewState.update(d,A),this.bidiCache=CachedOrder.update(this.bidiCache,d.changes),d.empty||(this.updatePlugins(d),this.inputState.update(d)),o=this.docView.update(d),this.state.facet(styleModule)!=this.styleModules&&this.mountStyles(),u=this.updateAttrs(),this.showAnnouncements(a),this.docView.updateSelection(o,a.some(M=>M.isUserEvent("select.pointer")))}finally{this.updateState=0}if(d.startState.facet(theme$1)!=d.state.facet(theme$1)&&(this.viewState.mustMeasureContent=!0),(o||u||A||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),o&&this.docViewUpdate(),!d.empty)for(let M of this.state.facet(updateListener))try{M(d)}catch(E){logException(this.state,E,"update listener")}(b||S)&&Promise.resolve().then(()=>{b&&this.state==b.startState&&this.dispatch(b),S&&!applyDOMChange(this,S)&&O.force&&dispatchKey(this.contentDOM,O.key,O.keyCode)})}setState(a){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=a;return}this.updateState=2;let o=this.hasFocus;try{for(let u of this.plugins)u.destroy(this);this.viewState=new ViewState(a),this.plugins=a.facet(viewPlugin).map(u=>new PluginInstance(u)),this.pluginMap.clear();for(let u of this.plugins)u.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}o&&this.focus(),this.requestMeasure()}updatePlugins(a){let o=a.startState.facet(viewPlugin),u=a.state.facet(viewPlugin);if(o!=u){let d=[];for(let f of u){let p=o.indexOf(f);if(p<0)d.push(new PluginInstance(f));else{let g=this.plugins[p];g.mustUpdate=a,d.push(g)}}for(let f of this.plugins)f.mustUpdate!=a&&f.destroy(this);this.plugins=d,this.pluginMap.clear()}else for(let d of this.plugins)d.mustUpdate=a;for(let d=0;d<this.plugins.length;d++)this.plugins[d].update(this);o!=u&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let a of this.plugins){let o=a.value;if(o&&o.docViewUpdate)try{o.docViewUpdate(this)}catch(u){logException(this.state,u,"doc view update listener")}}}measure(a=!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,a&&this.observer.forceFlush();let o=null,u=this.scrollDOM,d=u.scrollTop*this.scaleY,{scrollAnchorPos:f,scrollAnchorHeight:p}=this.viewState;Math.abs(d-this.viewState.scrollTop)>1&&(p=-1),this.viewState.scrollAnchorHeight=-1;try{for(let g=0;;g++){if(p<0)if(isScrolledToBottom(u))f=-1,p=this.viewState.heightMap.height;else{let E=this.viewState.scrollAnchorAt(d);f=E.from,p=E.top}this.updateState=1;let b=this.viewState.measure(this);if(!b&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(g>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let O=[];b&4||([this.measureRequests,O]=[O,this.measureRequests]);let S=O.map(E=>{try{return E.read(this)}catch(R){return logException(this.state,R),BadMeasure}}),A=ViewUpdate.create(this,this.state,[]),M=!1;A.flags|=b,o?o.flags|=b:o=A,this.updateState=2,A.empty||(this.updatePlugins(A),this.inputState.update(A),this.updateAttrs(),M=this.docView.update(A),M&&this.docViewUpdate());for(let E=0;E<O.length;E++)if(S[E]!=BadMeasure)try{let R=O[E];R.write&&R.write(S[E],this)}catch(R){logException(this.state,R)}if(M&&this.docView.updateSelection(!0),!A.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,p=-1;continue}else{let R=(f<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(f).top)-p;if(R>1||R<-1){d=d+R,u.scrollTop=d/this.scaleY,p=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(o&&!o.empty)for(let g of this.state.facet(updateListener))g(o)}get themeClasses(){return baseThemeID+" "+(this.state.facet(darkTheme)?baseDarkID:baseLightID)+" "+this.state.facet(theme$1)}updateAttrs(){let a=attrsFromFacet(this,editorAttributes,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),o={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&&(o["aria-readonly"]="true"),attrsFromFacet(this,contentAttributes,o);let u=this.observer.ignore(()=>{let d=updateAttrs(this.contentDOM,this.contentAttrs,o),f=updateAttrs(this.dom,this.editorAttrs,a);return d||f});return this.editorAttrs=a,this.contentAttrs=o,u}showAnnouncements(a){let o=!0;for(let u of a)for(let d of u.effects)if(d.is(EditorView.announce)){o&&(this.announceDOM.textContent=""),o=!1;let f=this.announceDOM.appendChild(document.createElement("div"));f.textContent=d.value}}mountStyles(){this.styleModules=this.state.facet(styleModule);let a=this.state.facet(EditorView.cspNonce);StyleModule.mount(this.root,this.styleModules.concat(baseTheme$1$2).reverse(),a?{nonce:a}: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(a){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),a){if(this.measureRequests.indexOf(a)>-1)return;if(a.key!=null){for(let o=0;o<this.measureRequests.length;o++)if(this.measureRequests[o].key===a.key){this.measureRequests[o]=a;return}}this.measureRequests.push(a)}}plugin(a){let o=this.pluginMap.get(a);return(o===void 0||o&&o.spec!=a)&&this.pluginMap.set(a,o=this.plugins.find(u=>u.spec==a)||null),o&&o.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(a){return this.readMeasured(),this.viewState.elementAtHeight(a)}lineBlockAtHeight(a){return this.readMeasured(),this.viewState.lineBlockAtHeight(a)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(a){return this.viewState.lineBlockAt(a)}get contentHeight(){return this.viewState.contentHeight}moveByChar(a,o,u){return skipAtoms(this,a,moveByChar(this,a,o,u))}moveByGroup(a,o){return skipAtoms(this,a,moveByChar(this,a,o,u=>byGroup(this,a.head,u)))}visualLineSide(a,o){let u=this.bidiSpans(a),d=this.textDirectionAt(a.from),f=u[o?u.length-1:0];return EditorSelection.cursor(f.side(o,d)+a.from,f.forward(!o,d)?1:-1)}moveToLineBoundary(a,o,u=!0){return moveToLineBoundary(this,a,o,u)}moveVertically(a,o,u){return skipAtoms(this,a,moveVertically(this,a,o,u))}domAtPos(a){return this.docView.domAtPos(a)}posAtDOM(a,o=0){return this.docView.posFromDOM(a,o)}posAtCoords(a,o=!0){return this.readMeasured(),posAtCoords(this,a,o)}coordsAtPos(a,o=1){this.readMeasured();let u=this.docView.coordsAt(a,o);if(!u||u.left==u.right)return u;let d=this.state.doc.lineAt(a),f=this.bidiSpans(d),p=f[BidiSpan.find(f,a-d.from,-1,o)];return flattenRect(u,p.dir==Direction.LTR==o>0)}coordsForChar(a){return this.readMeasured(),this.docView.coordsForChar(a)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(a){return!this.state.facet(perLineTextDirection)||a<this.viewport.from||a>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(a))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(a){if(a.length>MaxBidiLine)return trivialOrder(a.length);let o=this.textDirectionAt(a.from),u;for(let f of this.bidiCache)if(f.from==a.from&&f.dir==o&&(f.fresh||isolatesEq(f.isolates,u=getIsolatedRanges(this,a))))return f.order;u||(u=getIsolatedRanges(this,a));let d=computeOrder(a.text,o,u);return this.bidiCache.push(new CachedOrder(a.from,a.to,o,u,!0,d)),d}get hasFocus(){var a;return(this.dom.ownerDocument.hasFocus()||browser.safari&&((a=this.inputState)===null||a===void 0?void 0:a.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{focusPreventScroll(this.contentDOM),this.docView.updateSelection()})}setRoot(a){this._root!=a&&(this._root=a,this.observer.setWindow((a.nodeType==9?a:a.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let a of this.plugins)a.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(a,o={}){return scrollIntoView$1.of(new ScrollTarget(typeof a=="number"?EditorSelection.cursor(a):a,o.y,o.x,o.yMargin,o.xMargin))}scrollSnapshot(){let{scrollTop:a,scrollLeft:o}=this.scrollDOM,u=this.viewState.scrollAnchorAt(a);return scrollIntoView$1.of(new ScrollTarget(EditorSelection.cursor(u.from),"start","start",u.top-a,o,!0))}setTabFocusMode(a){a==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof a=="boolean"?this.inputState.tabFocusMode=a?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+a)}static domEventHandlers(a){return ViewPlugin.define(()=>({}),{eventHandlers:a})}static domEventObservers(a){return ViewPlugin.define(()=>({}),{eventObservers:a})}static theme(a,o){let u=StyleModule.newName(),d=[theme$1.of(u),styleModule.of(buildTheme(`.${u}`,a))];return o&&o.dark&&d.push(darkTheme.of(!0)),d}static baseTheme(a){return Prec.lowest(styleModule.of(buildTheme("."+baseThemeID,a,lightDarkIDs)))}static findFromDOM(a){var o;let u=a.querySelector(".cm-content"),d=u&&ContentView.get(u)||ContentView.get(a);return((o=d?.rootView)===null||o===void 0?void 0:o.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:l=>l.length?l[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(a,o,u,d,f,p){this.from=a,this.to=o,this.dir=u,this.isolates=d,this.fresh=f,this.order=p}static update(a,o){if(o.empty&&!a.some(f=>f.fresh))return a;let u=[],d=a.length?a[a.length-1].dir:Direction.LTR;for(let f=Math.max(0,a.length-10);f<a.length;f++){let p=a[f];p.dir==d&&!o.touchesRange(p.from,p.to)&&u.push(new CachedOrder(o.mapPos(p.from,1),o.mapPos(p.to,-1),p.dir,p.isolates,!1,p.order))}return u}}function attrsFromFacet(l,a,o){for(let u=l.state.facet(a),d=u.length-1;d>=0;d--){let f=u[d],p=typeof f=="function"?f(l):f;p&&combineAttrs(p,o)}return o}const currentPlatform=browser.mac?"mac":browser.windows?"win":browser.linux?"linux":"key";function normalizeKeyName(l,a){const o=l.split(/-(?!$)/);let u=o[o.length-1];u=="Space"&&(u=" ");let d,f,p,g;for(let b=0;b<o.length-1;++b){const O=o[b];if(/^(cmd|meta|m)$/i.test(O))g=!0;else if(/^a(lt)?$/i.test(O))d=!0;else if(/^(c|ctrl|control)$/i.test(O))f=!0;else if(/^s(hift)?$/i.test(O))p=!0;else if(/^mod$/i.test(O))a=="mac"?g=!0:f=!0;else throw new Error("Unrecognized modifier name: "+O)}return d&&(u="Alt-"+u),f&&(u="Ctrl-"+u),g&&(u="Meta-"+u),p&&(u="Shift-"+u),u}function modifiers(l,a,o){return a.altKey&&(l="Alt-"+l),a.ctrlKey&&(l="Ctrl-"+l),a.metaKey&&(l="Meta-"+l),o!==!1&&a.shiftKey&&(l="Shift-"+l),l}const handleKeyEvents=Prec.default(EditorView.domEventHandlers({keydown(l,a){return runHandlers(getKeymap(a.state),l,a,"editor")}})),keymap=Facet.define({enables:handleKeyEvents}),Keymaps=new WeakMap;function getKeymap(l){let a=l.facet(keymap),o=Keymaps.get(a);return o||Keymaps.set(a,o=buildKeymap(a.reduce((u,d)=>u.concat(d),[]))),o}function runScopeHandlers(l,a,o){return runHandlers(getKeymap(l.state),a,l,o)}let storedPrefix=null;const PrefixTimeout=4e3;function buildKeymap(l,a=currentPlatform){let o=Object.create(null),u=Object.create(null),d=(p,g)=>{let b=u[p];if(b==null)u[p]=g;else if(b!=g)throw new Error("Key binding "+p+" is used both as a regular binding and as a multi-stroke prefix")},f=(p,g,b,O,S)=>{var A,M;let E=o[p]||(o[p]=Object.create(null)),R=g.split(/ (?!$)/).map(Z=>normalizeKeyName(Z,a));for(let Z=1;Z<R.length;Z++){let re=R.slice(0,Z).join(" ");d(re,!0),E[re]||(E[re]={preventDefault:!0,stopPropagation:!1,run:[he=>{let se=storedPrefix={view:he,prefix:re,scope:p};return setTimeout(()=>{storedPrefix==se&&(storedPrefix=null)},PrefixTimeout),!0}]})}let L=R.join(" ");d(L,!1);let U=E[L]||(E[L]={preventDefault:!1,stopPropagation:!1,run:((M=(A=E._any)===null||A===void 0?void 0:A.run)===null||M===void 0?void 0:M.slice())||[]});b&&U.run.push(b),O&&(U.preventDefault=!0),S&&(U.stopPropagation=!0)};for(let p of l){let g=p.scope?p.scope.split(" "):["editor"];if(p.any)for(let O of g){let S=o[O]||(o[O]=Object.create(null));S._any||(S._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:A}=p;for(let M in S)S[M].run.push(E=>A(E,currentKeyEvent))}let b=p[a]||p.key;if(b)for(let O of g)f(O,b,p.run,p.preventDefault,p.stopPropagation),p.shift&&f(O,"Shift-"+b,p.shift,p.preventDefault,p.stopPropagation)}return o}let currentKeyEvent=null;function runHandlers(l,a,o,u){currentKeyEvent=a;let d=keyName(a),f=codePointAt(d,0),p=codePointSize(f)==d.length&&d!=" ",g="",b=!1,O=!1,S=!1;storedPrefix&&storedPrefix.view==o&&storedPrefix.scope==u&&(g=storedPrefix.prefix+" ",modifierCodes.indexOf(a.keyCode)<0&&(O=!0,storedPrefix=null));let A=new Set,M=U=>{if(U){for(let Z of U.run)if(!A.has(Z)&&(A.add(Z),Z(o)))return U.stopPropagation&&(S=!0),!0;U.preventDefault&&(U.stopPropagation&&(S=!0),O=!0)}return!1},E=l[u],R,L;return E&&(M(E[g+modifiers(d,a,!p)])?b=!0:p&&(a.altKey||a.metaKey||a.ctrlKey)&&!(browser.windows&&a.ctrlKey&&a.altKey)&&(R=base[a.keyCode])&&R!=d?(M(E[g+modifiers(R,a,!0)])||a.shiftKey&&(L=shift[a.keyCode])!=d&&L!=R&&M(E[g+modifiers(L,a,!1)]))&&(b=!0):p&&a.shiftKey&&M(E[g+modifiers(d,a,!0)])&&(b=!0),!b&&M(E._any)&&(b=!0)),O&&(b=!0),b&&S&&a.stopPropagation(),currentKeyEvent=null,b}class RectangleMarker{constructor(a,o,u,d,f){this.className=a,this.left=o,this.top=u,this.width=d,this.height=f}draw(){let a=document.createElement("div");return a.className=this.className,this.adjust(a),a}update(a,o){return o.className!=this.className?!1:(this.adjust(a),!0)}adjust(a){a.style.left=this.left+"px",a.style.top=this.top+"px",this.width!=null&&(a.style.width=this.width+"px"),a.style.height=this.height+"px"}eq(a){return this.left==a.left&&this.top==a.top&&this.width==a.width&&this.height==a.height&&this.className==a.className}static forRange(a,o,u){if(u.empty){let d=a.coordsAtPos(u.head,u.assoc||1);if(!d)return[];let f=getBase$2(a);return[new RectangleMarker(o,d.left-f.left,d.top-f.top,null,d.bottom-d.top)]}else return rectanglesForRange(a,o,u)}}function getBase$2(l){let a=l.scrollDOM.getBoundingClientRect();return{left:(l.textDirection==Direction.LTR?a.left:a.right-l.scrollDOM.clientWidth*l.scaleX)-l.scrollDOM.scrollLeft*l.scaleX,top:a.top-l.scrollDOM.scrollTop*l.scaleY}}function wrappedLine(l,a,o,u){let d=l.coordsAtPos(a,o*2);if(!d)return u;let f=l.dom.getBoundingClientRect(),p=(d.top+d.bottom)/2,g=l.posAtCoords({x:f.left+1,y:p}),b=l.posAtCoords({x:f.right-1,y:p});return g==null||b==null?u:{from:Math.max(u.from,Math.min(g,b)),to:Math.min(u.to,Math.max(g,b))}}function rectanglesForRange(l,a,o){if(o.to<=l.viewport.from||o.from>=l.viewport.to)return[];let u=Math.max(o.from,l.viewport.from),d=Math.min(o.to,l.viewport.to),f=l.textDirection==Direction.LTR,p=l.contentDOM,g=p.getBoundingClientRect(),b=getBase$2(l),O=p.querySelector(".cm-line"),S=O&&window.getComputedStyle(O),A=g.left+(S?parseInt(S.paddingLeft)+Math.min(0,parseInt(S.textIndent)):0),M=g.right-(S?parseInt(S.paddingRight):0),E=blockAt(l,u),R=blockAt(l,d),L=E.type==BlockType.Text?E:null,U=R.type==BlockType.Text?R:null;if(L&&(l.lineWrapping||E.widgetLineBreaks)&&(L=wrappedLine(l,u,1,L)),U&&(l.lineWrapping||R.widgetLineBreaks)&&(U=wrappedLine(l,d,-1,U)),L&&U&&L.from==U.from&&L.to==U.to)return re(he(o.from,o.to,L));{let ee=L?he(o.from,null,L):se(E,!1),oe=U?he(null,o.to,U):se(R,!0),me=[];return(L||E).to<(U||R).from-(L&&U?1:0)||E.widgetLineBreaks>1&&ee.bottom+l.defaultLineHeight/2<oe.top?me.push(Z(A,ee.bottom,M,oe.top)):ee.bottom<oe.top&&l.elementAtHeight((ee.bottom+oe.top)/2).type==BlockType.Text&&(ee.bottom=oe.top=(ee.bottom+oe.top)/2),re(ee).concat(me).concat(re(oe))}function Z(ee,oe,me,_e){return new RectangleMarker(a,ee-b.left,oe-b.top,me-ee,_e-oe)}function re({top:ee,bottom:oe,horizontal:me}){let _e=[];for(let ke=0;ke<me.length;ke+=2)_e.push(Z(me[ke],ee,me[ke+1],oe));return _e}function he(ee,oe,me){let _e=1e9,ke=-1e9,Oe=[];function Te(Ge,Ne,Qe,Ee,je){let Ye=l.coordsAtPos(Ge,Ge==me.to?-2:2),Ke=l.coordsAtPos(Qe,Qe==me.from?2:-2);!Ye||!Ke||(_e=Math.min(Ye.top,Ke.top,_e),ke=Math.max(Ye.bottom,Ke.bottom,ke),je==Direction.LTR?Oe.push(f&&Ne?A:Ye.left,f&&Ee?M:Ke.right):Oe.push(!f&&Ee?A:Ke.left,!f&&Ne?M:Ye.right))}let Ce=ee??me.from,Ae=oe??me.to;for(let Ge of l.visibleRanges)if(Ge.to>Ce&&Ge.from<Ae)for(let Ne=Math.max(Ge.from,Ce),Qe=Math.min(Ge.to,Ae);;){let Ee=l.state.doc.lineAt(Ne);for(let je of l.bidiSpans(Ee)){let Ye=je.from+Ee.from,Ke=je.to+Ee.from;if(Ye>=Qe)break;Ke>Ne&&Te(Math.max(Ye,Ne),ee==null&&Ye<=Ce,Math.min(Ke,Qe),oe==null&&Ke>=Ae,je.dir)}if(Ne=Ee.to+1,Ne>=Qe)break}return Oe.length==0&&Te(Ce,ee==null,Ae,oe==null,l.textDirection),{top:_e,bottom:ke,horizontal:Oe}}function se(ee,oe){let me=g.top+(oe?ee.top:ee.bottom);return{top:me,bottom:me,horizontal:[]}}}function sameMarker(l,a){return l.constructor==a.constructor&&l.eq(a)}class LayerView{constructor(a,o){this.view=a,this.layer=o,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=a.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),o.above&&this.dom.classList.add("cm-layer-above"),o.class&&this.dom.classList.add(o.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(a.state),a.requestMeasure(this.measureReq),o.mount&&o.mount(this.dom,a)}update(a){a.startState.facet(layerOrder)!=a.state.facet(layerOrder)&&this.setOrder(a.state),(this.layer.update(a,this.dom)||a.geometryChanged)&&(this.scale(),a.view.requestMeasure(this.measureReq))}docViewUpdate(a){this.layer.updateOnDocViewUpdate!==!1&&a.requestMeasure(this.measureReq)}setOrder(a){let o=0,u=a.facet(layerOrder);for(;o<u.length&&u[o]!=this.layer;)o++;this.dom.style.zIndex=String((this.layer.above?150:-1)-o)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:a,scaleY:o}=this.view;(a!=this.scaleX||o!=this.scaleY)&&(this.scaleX=a,this.scaleY=o,this.dom.style.transform=`scale(${1/a}, ${1/o})`)}draw(a){if(a.length!=this.drawn.length||a.some((o,u)=>!sameMarker(o,this.drawn[u]))){let o=this.dom.firstChild,u=0;for(let d of a)d.update&&o&&d.constructor&&this.drawn[u].constructor&&d.update(o,this.drawn[u])?(o=o.nextSibling,u++):this.dom.insertBefore(d.draw(),o);for(;o;){let d=o.nextSibling;o.remove(),o=d}this.drawn=a}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const layerOrder=Facet.define();function layer(l){return[ViewPlugin.define(a=>new LayerView(a,l)),layerOrder.of(l)]}const CanHidePrimary=!(browser.ios&&browser.webkit&&browser.webkit_version<534),selectionConfig=Facet.define({combine(l){return combineConfig(l,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(a,o)=>Math.min(a,o),drawRangeCursor:(a,o)=>a||o})}});function drawSelection(l={}){return[selectionConfig.of(l),cursorLayer,selectionLayer,hideNativeSelection$2,nativeSelectionHidden.of(!0)]}function getDrawSelectionConfig$2(l){return l.facet(selectionConfig)}function configChanged$2(l){return l.startState.facet(selectionConfig)!=l.state.facet(selectionConfig)}const cursorLayer=layer({above:!0,markers(l){let{state:a}=l,o=a.facet(selectionConfig),u=[];for(let d of a.selection.ranges){let f=d==a.selection.main;if(d.empty?!f||CanHidePrimary:o.drawRangeCursor){let p=f?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",g=d.empty?d:EditorSelection.cursor(d.head,d.head>d.anchor?-1:1);for(let b of RectangleMarker.forRange(l,p,g))u.push(b)}}return u},update(l,a){l.transactions.some(u=>u.selection)&&(a.style.animationName=a.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let o=configChanged$2(l);return o&&setBlinkRate(l.state,a),l.docChanged||l.selectionSet||o},mount(l,a){setBlinkRate(a.state,l)},class:"cm-cursorLayer"});function setBlinkRate(l,a){a.style.animationDuration=l.facet(selectionConfig).cursorBlinkRate+"ms"}const selectionLayer=layer({above:!1,markers(l){return l.state.selection.ranges.map(a=>a.empty?[]:RectangleMarker.forRange(l,"cm-selectionBackground",a)).reduce((a,o)=>a.concat(o))},update(l,a){return l.docChanged||l.selectionSet||l.viewportChanged||configChanged$2(l)},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));function highlightActiveLine(){return activeLineHighlighter}const lineDeco=Decoration.line({class:"cm-activeLine"}),activeLineHighlighter=ViewPlugin.fromClass(class{constructor(l){this.decorations=this.getDeco(l)}update(l){(l.docChanged||l.selectionSet)&&(this.decorations=this.getDeco(l.view))}getDeco(l){let a=-1,o=[];for(let u of l.state.selection.ranges){let d=l.lineBlockAt(u.head);d.from>a&&(o.push(lineDeco.range(d.from)),a=d.from)}return Decoration.set(o)}},{decorations:l=>l.decorations}),Outside="-10000px";class TooltipViewManager{constructor(a,o,u,d){this.facet=o,this.createTooltipView=u,this.removeTooltipView=d,this.input=a.state.facet(o),this.tooltips=this.input.filter(p=>p);let f=null;this.tooltipViews=this.tooltips.map(p=>f=u(p,f))}update(a,o){var u;let d=a.state.facet(this.facet),f=d.filter(b=>b);if(d===this.input){for(let b of this.tooltipViews)b.update&&b.update(a);return!1}let p=[],g=o?[]:null;for(let b=0;b<f.length;b++){let O=f[b],S=-1;if(O){for(let A=0;A<this.tooltips.length;A++){let M=this.tooltips[A];M&&M.create==O.create&&(S=A)}if(S<0)p[b]=this.createTooltipView(O,b?p[b-1]:null),g&&(g[b]=!!O.above);else{let A=p[b]=this.tooltipViews[S];g&&(g[b]=o[S]),A.update&&A.update(a)}}}for(let b of this.tooltipViews)p.indexOf(b)<0&&(this.removeTooltipView(b),(u=b.destroy)===null||u===void 0||u.call(b));return o&&(g.forEach((b,O)=>o[O]=b),o.length=g.length),this.input=d,this.tooltips=f,this.tooltipViews=p,!0}}function windowSpace(l){let{win:a}=l;return{top:0,left:0,bottom:a.innerHeight,right:a.innerWidth}}const tooltipConfig=Facet.define({combine:l=>{var a,o,u;return{position:browser.ios?"absolute":((a=l.find(d=>d.position))===null||a===void 0?void 0:a.position)||"fixed",parent:((o=l.find(d=>d.parent))===null||o===void 0?void 0:o.parent)||null,tooltipSpace:((u=l.find(d=>d.tooltipSpace))===null||u===void 0?void 0:u.tooltipSpace)||windowSpace}}}),knownHeight=new WeakMap,tooltipPlugin=ViewPlugin.fromClass(class{constructor(l){this.view=l,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let a=l.state.facet(tooltipConfig);this.position=a.position,this.parent=a.parent,this.classes=l.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(l,showTooltip,(o,u)=>this.createTooltip(o,u),o=>{this.resizeObserver&&this.resizeObserver.unobserve(o.dom),o.dom.remove()}),this.above=this.manager.tooltips.map(o=>!!o.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(o=>{Date.now()>this.lastTransaction-50&&o.length>0&&o[o.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),l.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 l of this.manager.tooltipViews)this.intersectionObserver.observe(l.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(l){l.transactions.length&&(this.lastTransaction=Date.now());let a=this.manager.update(l,this.above);a&&this.observeIntersection();let o=a||l.geometryChanged,u=l.state.facet(tooltipConfig);if(u.position!=this.position&&!this.madeAbsolute){this.position=u.position;for(let d of this.manager.tooltipViews)d.dom.style.position=this.position;o=!0}if(u.parent!=this.parent){this.parent&&this.container.remove(),this.parent=u.parent,this.createContainer();for(let d of this.manager.tooltipViews)this.container.appendChild(d.dom);o=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);o&&this.maybeMeasure()}createTooltip(l,a){let o=l.create(this.view),u=a?a.dom:null;if(o.dom.classList.add("cm-tooltip"),l.arrow&&!o.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let d=document.createElement("div");d.className="cm-tooltip-arrow",o.dom.appendChild(d)}return o.dom.style.position=this.position,o.dom.style.top=Outside,o.dom.style.left="0px",this.container.insertBefore(o.dom,u),o.mount&&o.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(o.dom),o}destroy(){var l,a,o;this.view.win.removeEventListener("resize",this.measureSoon);for(let u of this.manager.tooltipViews)u.dom.remove(),(l=u.destroy)===null||l===void 0||l.call(u);this.parent&&this.container.remove(),(a=this.resizeObserver)===null||a===void 0||a.disconnect(),(o=this.intersectionObserver)===null||o===void 0||o.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let l=1,a=1,o=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:f}=this.manager.tooltipViews[0];if(browser.gecko)o=f.offsetParent!=this.container.ownerDocument.body;else if(f.style.top==Outside&&f.style.left=="0px"){let p=f.getBoundingClientRect();o=Math.abs(p.top+1e4)>1||Math.abs(p.left)>1}}if(o||this.position=="absolute")if(this.parent){let f=this.parent.getBoundingClientRect();f.width&&f.height&&(l=f.width/this.parent.offsetWidth,a=f.height/this.parent.offsetHeight)}else({scaleX:l,scaleY:a}=this.view.viewState);let u=this.view.scrollDOM.getBoundingClientRect(),d=getScrollMargins(this.view);return{visible:{left:u.left+d.left,top:u.top+d.top,right:u.right-d.right,bottom:u.bottom-d.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((f,p)=>{let g=this.manager.tooltipViews[p];return g.getCoords?g.getCoords(f.pos):this.view.coordsAtPos(f.pos)}),size:this.manager.tooltipViews.map(({dom:f})=>f.getBoundingClientRect()),space:this.view.state.facet(tooltipConfig).tooltipSpace(this.view),scaleX:l,scaleY:a,makeAbsolute:o}}writeMeasure(l){var a;if(l.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let g of this.manager.tooltipViews)g.dom.style.position="absolute"}let{visible:o,space:u,scaleX:d,scaleY:f}=l,p=[];for(let g=0;g<this.manager.tooltips.length;g++){let b=this.manager.tooltips[g],O=this.manager.tooltipViews[g],{dom:S}=O,A=l.pos[g],M=l.size[g];if(!A||b.clip!==!1&&(A.bottom<=Math.max(o.top,u.top)||A.top>=Math.min(o.bottom,u.bottom)||A.right<Math.max(o.left,u.left)-.1||A.left>Math.min(o.right,u.right)+.1)){S.style.top=Outside;continue}let E=b.arrow?O.dom.querySelector(".cm-tooltip-arrow"):null,R=E?7:0,L=M.right-M.left,U=(a=knownHeight.get(O))!==null&&a!==void 0?a:M.bottom-M.top,Z=O.offset||noOffset,re=this.view.textDirection==Direction.LTR,he=M.width>u.right-u.left?re?u.left:u.right-M.width:re?Math.max(u.left,Math.min(A.left-(E?14:0)+Z.x,u.right-L)):Math.min(Math.max(u.left,A.left-L+(E?14:0)-Z.x),u.right-L),se=this.above[g];!b.strictSide&&(se?A.top-U-R-Z.y<u.top:A.bottom+U+R+Z.y>u.bottom)&&se==u.bottom-A.bottom>A.top-u.top&&(se=this.above[g]=!se);let ee=(se?A.top-u.top:u.bottom-A.bottom)-R;if(ee<U&&O.resize!==!1){if(ee<this.view.defaultLineHeight){S.style.top=Outside;continue}knownHeight.set(O,U),S.style.height=(U=ee)/f+"px"}else S.style.height&&(S.style.height="");let oe=se?A.top-U-R-Z.y:A.bottom+R+Z.y,me=he+L;if(O.overlap!==!0)for(let _e of p)_e.left<me&&_e.right>he&&_e.top<oe+U&&_e.bottom>oe&&(oe=se?_e.top-U-2-R:_e.bottom+R+2);if(this.position=="absolute"?(S.style.top=(oe-l.parent.top)/f+"px",setLeftStyle(S,(he-l.parent.left)/d)):(S.style.top=oe/f+"px",setLeftStyle(S,he/d)),E){let _e=A.left+(re?Z.x:-Z.x)-(he+14-7);E.style.left=_e/d+"px"}O.overlap!==!0&&p.push({left:he,top:oe,right:me,bottom:oe+U}),S.classList.toggle("cm-tooltip-above",se),S.classList.toggle("cm-tooltip-below",!se),O.positioned&&O.positioned(l.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 l of this.manager.tooltipViews)l.dom.style.top=Outside}},{eventObservers:{scroll(){this.maybeMeasure()}}});function setLeftStyle(l,a){let o=parseInt(l.style.left,10);(isNaN(o)||Math.abs(a-o)>1)&&(l.style.left=a+"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:l=>l.reduce((a,o)=>a.concat(o),[])});class HoverTooltipHost{static create(a){return new HoverTooltipHost(a)}constructor(a){this.view=a,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new TooltipViewManager(a,showHoverTooltip,(o,u)=>this.createHostedView(o,u),o=>o.dom.remove())}createHostedView(a,o){let u=a.create(this.view);return u.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(u.dom,o?o.dom.nextSibling:this.dom.firstChild),this.mounted&&u.mount&&u.mount(this.view),u}mount(a){for(let o of this.manager.tooltipViews)o.mount&&o.mount(a);this.mounted=!0}positioned(a){for(let o of this.manager.tooltipViews)o.positioned&&o.positioned(a)}update(a){this.manager.update(a)}destroy(){var a;for(let o of this.manager.tooltipViews)(a=o.destroy)===null||a===void 0||a.call(o)}passProp(a){let o;for(let u of this.manager.tooltipViews){let d=u[a];if(d!==void 0){if(o===void 0)o=d;else if(o!==d)return}}return o}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],l=>{let a=l.facet(showHoverTooltip);return a.length===0?null:{pos:Math.min(...a.map(o=>o.pos)),end:Math.max(...a.map(o=>{var u;return(u=o.end)!==null&&u!==void 0?u:o.pos})),create:HoverTooltipHost.create,above:a[0].above,arrow:a.some(o=>o.arrow)}});class HoverPlugin{constructor(a,o,u,d,f){this.view=a,this.source=o,this.field=u,this.setHover=d,this.hoverTime=f,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:a.dom,time:0},this.checkHover=this.checkHover.bind(this),a.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),a.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 a=Date.now()-this.lastMove.time;a<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-a):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:a,lastMove:o}=this,u=a.docView.nearest(o.target);if(!u)return;let d,f=1;if(u instanceof WidgetView)d=u.posAtStart;else{if(d=a.posAtCoords(o),d==null)return;let g=a.coordsAtPos(d);if(!g||o.y<g.top||o.y>g.bottom||o.x<g.left-a.defaultCharacterWidth||o.x>g.right+a.defaultCharacterWidth)return;let b=a.bidiSpans(a.state.doc.lineAt(d)).find(S=>S.from<=d&&S.to>=d),O=b&&b.dir==Direction.RTL?-1:1;f=o.x<g.left?-O:O}let p=this.source(a,d,f);if(p?.then){let g=this.pending={pos:d};p.then(b=>{this.pending==g&&(this.pending=null,b&&!(Array.isArray(b)&&!b.length)&&a.dispatch({effects:this.setHover.of(Array.isArray(b)?b:[b])}))},b=>logException(a.state,b,"hover tooltip"))}else p&&!(Array.isArray(p)&&!p.length)&&a.dispatch({effects:this.setHover.of(Array.isArray(p)?p:[p])})}get tooltip(){let a=this.view.plugin(tooltipPlugin),o=a?a.manager.tooltips.findIndex(u=>u.create==HoverTooltipHost.create):-1;return o>-1?a.manager.tooltipViews[o]:null}mousemove(a){var o,u;this.lastMove={x:a.clientX,y:a.clientY,target:a.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:d,tooltip:f}=this;if(d.length&&f&&!isInTooltip(f.dom,a)||this.pending){let{pos:p}=d[0]||this.pending,g=(u=(o=d[0])===null||o===void 0?void 0:o.end)!==null&&u!==void 0?u:p;(p==g?this.view.posAtCoords(this.lastMove)!=p:!isOverRange(this.view,p,g,a.clientX,a.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(a){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:o}=this;if(o.length){let{tooltip:u}=this;u&&u.dom.contains(a.relatedTarget)?this.watchTooltipLeave(u.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(a){let o=u=>{a.removeEventListener("mouseleave",o),this.active.length&&!this.view.dom.contains(u.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};a.addEventListener("mouseleave",o)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const tooltipMargin=4;function isInTooltip(l,a){let{left:o,right:u,top:d,bottom:f}=l.getBoundingClientRect(),p;if(p=l.querySelector(".cm-tooltip-arrow")){let g=p.getBoundingClientRect();d=Math.min(g.top,d),f=Math.max(g.bottom,f)}return a.clientX>=o-tooltipMargin&&a.clientX<=u+tooltipMargin&&a.clientY>=d-tooltipMargin&&a.clientY<=f+tooltipMargin}function isOverRange(l,a,o,u,d,f){let p=l.scrollDOM.getBoundingClientRect(),g=l.documentTop+l.documentPadding.top+l.contentHeight;if(p.left>u||p.right<u||p.top>d||Math.min(p.bottom,g)<d)return!1;let b=l.posAtCoords({x:u,y:d},!1);return b>=a&&b<=o}function hoverTooltip(l,a={}){let o=StateEffect.define(),u=StateField.define({create(){return[]},update(d,f){if(d.length&&(a.hideOnChange&&(f.docChanged||f.selection)?d=[]:a.hideOn&&(d=d.filter(p=>!a.hideOn(f,p))),f.docChanged)){let p=[];for(let g of d){let b=f.changes.mapPos(g.pos,-1,MapMode.TrackDel);if(b!=null){let O=Object.assign(Object.create(null),g);O.pos=b,O.end!=null&&(O.end=f.changes.mapPos(O.end)),p.push(O)}}d=p}for(let p of f.effects)p.is(o)&&(d=p.value),p.is(closeHoverTooltipEffect)&&(d=[]);return d},provide:d=>showHoverTooltip.from(d)});return{active:u,extension:[u,ViewPlugin.define(d=>new HoverPlugin(d,l,u,o,a.hoverTime||300)),showHoverTooltipHost]}}function getTooltip(l,a){let o=l.plugin(tooltipPlugin);if(!o)return null;let u=o.manager.tooltips.indexOf(a);return u<0?null:o.manager.tooltipViews[u]}const closeHoverTooltipEffect=StateEffect.define(),panelConfig=Facet.define({combine(l){let a,o;for(let u of l)a=a||u.topContainer,o=o||u.bottomContainer;return{topContainer:a,bottomContainer:o}}});function getPanel(l,a){let o=l.plugin(panelPlugin),u=o?o.specs.indexOf(a):-1;return u>-1?o.panels[u]:null}const panelPlugin=ViewPlugin.fromClass(class{constructor(l){this.input=l.state.facet(showPanel),this.specs=this.input.filter(o=>o),this.panels=this.specs.map(o=>o(l));let a=l.state.facet(panelConfig);this.top=new PanelGroup(l,!0,a.topContainer),this.bottom=new PanelGroup(l,!1,a.bottomContainer),this.top.sync(this.panels.filter(o=>o.top)),this.bottom.sync(this.panels.filter(o=>!o.top));for(let o of this.panels)o.dom.classList.add("cm-panel"),o.mount&&o.mount()}update(l){let a=l.state.facet(panelConfig);this.top.container!=a.topContainer&&(this.top.sync([]),this.top=new PanelGroup(l.view,!0,a.topContainer)),this.bottom.container!=a.bottomContainer&&(this.bottom.sync([]),this.bottom=new PanelGroup(l.view,!1,a.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let o=l.state.facet(showPanel);if(o!=this.input){let u=o.filter(b=>b),d=[],f=[],p=[],g=[];for(let b of u){let O=this.specs.indexOf(b),S;O<0?(S=b(l.view),g.push(S)):(S=this.panels[O],S.update&&S.update(l)),d.push(S),(S.top?f:p).push(S)}this.specs=u,this.panels=d,this.top.sync(f),this.bottom.sync(p);for(let b of g)b.dom.classList.add("cm-panel"),b.mount&&b.mount()}else for(let u of this.panels)u.update&&u.update(l)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:l=>EditorView.scrollMargins.of(a=>{let o=a.plugin(l);return o&&{top:o.top.scrollMargin(),bottom:o.bottom.scrollMargin()}})});class PanelGroup{constructor(a,o,u){this.view=a,this.top=o,this.container=u,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(a){for(let o of this.panels)o.destroy&&a.indexOf(o)<0&&o.destroy();this.panels=a,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 o=this.container||this.view.dom;o.insertBefore(this.dom,this.top?o.firstChild:null)}let a=this.dom.firstChild;for(let o of this.panels)if(o.dom.parentNode==this.dom){for(;a!=o.dom;)a=rm(a);a=a.nextSibling}else this.dom.insertBefore(o.dom,a);for(;a;)a=rm(a)}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 a of this.classes.split(" "))a&&this.container.classList.remove(a);for(let a of(this.classes=this.view.themeClasses).split(" "))a&&this.container.classList.add(a)}}}function rm(l){let a=l.nextSibling;return l.remove(),a}const showPanel=Facet.define({enables:panelPlugin});class GutterMarker extends RangeValue{compare(a){return this==a||this.constructor==a.constructor&&this.eq(a)}eq(a){return!1}destroy(a){}}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:l=>l.some(a=>a)});function gutters(l){return[gutterView]}const gutterView=ViewPlugin.fromClass(class{constructor(l){this.view=l,this.prevViewport=l.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=l.state.facet(activeGutters).map(a=>new SingleGutterView(l,a));for(let a of this.gutters)this.dom.appendChild(a.dom);this.fixed=!l.state.facet(unfixGutters),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),l.scrollDOM.insertBefore(this.dom,l.contentDOM)}update(l){if(this.updateGutters(l)){let a=this.prevViewport,o=l.view.viewport,u=Math.min(a.to,o.to)-Math.max(a.from,o.from);this.syncGutters(u<(o.to-o.from)*.8)}l.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=l.view.viewport}syncGutters(l){let a=this.dom.nextSibling;l&&this.dom.remove();let o=RangeSet.iter(this.view.state.facet(gutterLineClass),this.view.viewport.from),u=[],d=this.gutters.map(f=>new UpdateContext(f,this.view.viewport,-this.view.documentPadding.top));for(let f of this.view.viewportLineBlocks)if(u.length&&(u=[]),Array.isArray(f.type)){let p=!0;for(let g of f.type)if(g.type==BlockType.Text&&p){advanceCursor(o,u,g.from);for(let b of d)b.line(this.view,g,u);p=!1}else if(g.widget)for(let b of d)b.widget(this.view,g)}else if(f.type==BlockType.Text){advanceCursor(o,u,f.from);for(let p of d)p.line(this.view,f,u)}else if(f.widget)for(let p of d)p.widget(this.view,f);for(let f of d)f.finish();l&&this.view.scrollDOM.insertBefore(this.dom,a)}updateGutters(l){let a=l.startState.facet(activeGutters),o=l.state.facet(activeGutters),u=l.docChanged||l.heightChanged||l.viewportChanged||!RangeSet.eq(l.startState.facet(gutterLineClass),l.state.facet(gutterLineClass),l.view.viewport.from,l.view.viewport.to);if(a==o)for(let d of this.gutters)d.update(l)&&(u=!0);else{u=!0;let d=[];for(let f of o){let p=a.indexOf(f);p<0?d.push(new SingleGutterView(this.view,f)):(this.gutters[p].update(l),d.push(this.gutters[p]))}for(let f of this.gutters)f.dom.remove(),d.indexOf(f)<0&&f.destroy();for(let f of d)this.dom.appendChild(f.dom);this.gutters=d}return u}destroy(){for(let l of this.gutters)l.destroy();this.dom.remove()}},{provide:l=>EditorView.scrollMargins.of(a=>{let o=a.plugin(l);return!o||o.gutters.length==0||!o.fixed?null:a.textDirection==Direction.LTR?{left:o.dom.offsetWidth*a.scaleX}:{right:o.dom.offsetWidth*a.scaleX}})});function asArray(l){return Array.isArray(l)?l:[l]}function advanceCursor(l,a,o){for(;l.value&&l.from<=o;)l.from==o&&a.push(l.value),l.next()}class UpdateContext{constructor(a,o,u){this.gutter=a,this.height=u,this.i=0,this.cursor=RangeSet.iter(a.markers,o.from)}addElement(a,o,u){let{gutter:d}=this,f=(o.top-this.height)/a.scaleY,p=o.height/a.scaleY;if(this.i==d.elements.length){let g=new GutterElement(a,p,f,u);d.elements.push(g),d.dom.appendChild(g.dom)}else d.elements[this.i].update(a,p,f,u);this.height=o.bottom,this.i++}line(a,o,u){let d=[];advanceCursor(this.cursor,d,o.from),u.length&&(d=d.concat(u));let f=this.gutter.config.lineMarker(a,o,d);f&&d.unshift(f);let p=this.gutter;d.length==0&&!p.config.renderEmptyElements||this.addElement(a,o,d)}widget(a,o){let u=this.gutter.config.widgetMarker(a,o.widget,o),d=u?[u]:null;for(let f of a.state.facet(gutterWidgetClass)){let p=f(a,o.widget,o);p&&(d||(d=[])).push(p)}d&&this.addElement(a,o,d)}finish(){let a=this.gutter;for(;a.elements.length>this.i;){let o=a.elements.pop();a.dom.removeChild(o.dom),o.destroy()}}}class SingleGutterView{constructor(a,o){this.view=a,this.config=o,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let u in o.domEventHandlers)this.dom.addEventListener(u,d=>{let f=d.target,p;if(f!=this.dom&&this.dom.contains(f)){for(;f.parentNode!=this.dom;)f=f.parentNode;let b=f.getBoundingClientRect();p=(b.top+b.bottom)/2}else p=d.clientY;let g=a.lineBlockAtHeight(p-a.documentTop);o.domEventHandlers[u](a,g,d)&&d.preventDefault()});this.markers=asArray(o.markers(a)),o.initialSpacer&&(this.spacer=new GutterElement(a,0,0,[o.initialSpacer(a)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(a){let o=this.markers;if(this.markers=asArray(this.config.markers(a.view)),this.spacer&&this.config.updateSpacer){let d=this.config.updateSpacer(this.spacer.markers[0],a);d!=this.spacer.markers[0]&&this.spacer.update(a.view,0,0,[d])}let u=a.view.viewport;return!RangeSet.eq(this.markers,o,u.from,u.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(a):!1)}destroy(){for(let a of this.elements)a.destroy()}}class GutterElement{constructor(a,o,u,d){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(a,o,u,d)}update(a,o,u,d){this.height!=o&&(this.height=o,this.dom.style.height=o+"px"),this.above!=u&&(this.dom.style.marginTop=(this.above=u)?u+"px":""),sameMarkers(this.markers,d)||this.setMarkers(a,d)}setMarkers(a,o){let u="cm-gutterElement",d=this.dom.firstChild;for(let f=0,p=0;;){let g=p,b=f<o.length?o[f++]:null,O=!1;if(b){let S=b.elementClass;S&&(u+=" "+S);for(let A=p;A<this.markers.length;A++)if(this.markers[A].compare(b)){g=A,O=!0;break}}else g=this.markers.length;for(;p<g;){let S=this.markers[p++];if(S.toDOM){S.destroy(d);let A=d.nextSibling;d.remove(),d=A}}if(!b)break;b.toDOM&&(O?d=d.nextSibling:this.dom.insertBefore(b.toDOM(a),d)),O&&p++}this.dom.className=u,this.markers=o}destroy(){this.setMarkers(null,[])}}function sameMarkers(l,a){if(l.length!=a.length)return!1;for(let o=0;o<l.length;o++)if(!l[o].compare(a[o]))return!1;return!0}const lineNumberMarkers=Facet.define(),lineNumberWidgetMarker=Facet.define(),lineNumberConfig=Facet.define({combine(l){return combineConfig(l,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(a,o){let u=Object.assign({},a);for(let d in o){let f=u[d],p=o[d];u[d]=f?(g,b,O)=>f(g,b,O)||p(g,b,O):p}return u}})}});class NumberMarker extends GutterMarker{constructor(a){super(),this.number=a}eq(a){return this.number==a.number}toDOM(){return document.createTextNode(this.number)}}function formatNumber(l,a){return l.state.facet(lineNumberConfig).formatNumber(a,l.state)}const lineNumberGutter=activeGutters.compute([lineNumberConfig],l=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(a){return a.state.facet(lineNumberMarkers)},lineMarker(a,o,u){return u.some(d=>d.toDOM)?null:new NumberMarker(formatNumber(a,a.state.doc.lineAt(o.from).number))},widgetMarker:(a,o,u)=>{for(let d of a.state.facet(lineNumberWidgetMarker)){let f=d(a,o,u);if(f)return f}return null},lineMarkerChange:a=>a.startState.facet(lineNumberConfig)!=a.state.facet(lineNumberConfig),initialSpacer(a){return new NumberMarker(formatNumber(a,maxLineNumber(a.state.doc.lines)))},updateSpacer(a,o){let u=formatNumber(o.view,maxLineNumber(o.view.state.doc.lines));return u==a.number?a:new NumberMarker(u)},domEventHandlers:l.facet(lineNumberConfig).domEventHandlers}));function lineNumbers(l={}){return[lineNumberConfig.of(l),gutters(),lineNumberGutter]}function maxLineNumber(l){let a=9;for(;a<l;)a=a*10+9;return a}const activeLineGutterMarker=new class extends GutterMarker{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},activeLineGutterHighlighter=gutterLineClass.compute(["selection"],l=>{let a=[],o=-1;for(let u of l.selection.ranges){let d=l.doc.lineAt(u.head).from;d>o&&(o=d,a.push(activeLineGutterMarker.range(d)))}return RangeSet.of(a)});function highlightActiveLineGutter(){return activeLineGutterHighlighter}const DefaultBufferLength=1024;let nextPropID=0;class Range{constructor(a,o){this.from=a,this.to=o}}class NodeProp{constructor(a={}){this.id=nextPropID++,this.perNode=!!a.perNode,this.deserialize=a.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(a){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof a!="function"&&(a=NodeType.match(a)),o=>{let u=a(o);return u===void 0?null:[this,u]}}}NodeProp.closedBy=new NodeProp({deserialize:l=>l.split(" ")}),NodeProp.openedBy=new NodeProp({deserialize:l=>l.split(" ")}),NodeProp.group=new NodeProp({deserialize:l=>l.split(" ")}),NodeProp.isolate=new NodeProp({deserialize:l=>{if(l&&l!="rtl"&&l!="ltr"&&l!="auto")throw new RangeError("Invalid value for isolate: "+l);return l||"auto"}}),NodeProp.contextHash=new NodeProp({perNode:!0}),NodeProp.lookAhead=new NodeProp({perNode:!0}),NodeProp.mounted=new NodeProp({perNode:!0});class MountedTree{constructor(a,o,u){this.tree=a,this.overlay=o,this.parser=u}static get(a){return a&&a.props&&a.props[NodeProp.mounted.id]}}const noProps=Object.create(null);class NodeType{constructor(a,o,u,d=0){this.name=a,this.props=o,this.id=u,this.flags=d}static define(a){let o=a.props&&a.props.length?Object.create(null):noProps,u=(a.top?1:0)|(a.skipped?2:0)|(a.error?4:0)|(a.name==null?8:0),d=new NodeType(a.name||"",o,a.id,u);if(a.props){for(let f of a.props)if(Array.isArray(f)||(f=f(d)),f){if(f[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");o[f[0].id]=f[1]}}return d}prop(a){return this.props[a.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(a){if(typeof a=="string"){if(this.name==a)return!0;let o=this.prop(NodeProp.group);return o?o.indexOf(a)>-1:!1}return this.id==a}static match(a){let o=Object.create(null);for(let u in a)for(let d of u.split(" "))o[d]=a[u];return u=>{for(let d=u.prop(NodeProp.group),f=-1;f<(d?d.length:0);f++){let p=o[f<0?u.name:d[f]];if(p)return p}}}}NodeType.none=new NodeType("",Object.create(null),0,8);class NodeSet{constructor(a){this.types=a;for(let o=0;o<a.length;o++)if(a[o].id!=o)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...a){let o=[];for(let u of this.types){let d=null;for(let f of a){let p=f(u);p&&(d||(d=Object.assign({},u.props)),d[p[0].id]=p[1])}o.push(d?new NodeType(u.name,d,u.id,u.flags):u)}return new NodeSet(o)}}const CachedNode=new WeakMap,CachedInnerNode=new WeakMap;var IterMode;(function(l){l[l.ExcludeBuffers=1]="ExcludeBuffers",l[l.IncludeAnonymous=2]="IncludeAnonymous",l[l.IgnoreMounts=4]="IgnoreMounts",l[l.IgnoreOverlays=8]="IgnoreOverlays"})(IterMode||(IterMode={}));class Tree{constructor(a,o,u,d,f){if(this.type=a,this.children=o,this.positions=u,this.length=d,this.props=null,f&&f.length){this.props=Object.create(null);for(let[p,g]of f)this.props[typeof p=="number"?p:p.id]=g}}toString(){let a=MountedTree.get(this);if(a&&!a.overlay)return a.tree.toString();let o="";for(let u of this.children){let d=u.toString();d&&(o&&(o+=","),o+=d)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(o.length?"("+o+")":""):o}cursor(a=0){return new TreeCursor(this.topNode,a)}cursorAt(a,o=0,u=0){let d=CachedNode.get(this)||this.topNode,f=new TreeCursor(d);return f.moveTo(a,o),CachedNode.set(this,f._tree),f}get topNode(){return new TreeNode(this,0,0,null)}resolve(a,o=0){let u=resolveNode(CachedNode.get(this)||this.topNode,a,o,!1);return CachedNode.set(this,u),u}resolveInner(a,o=0){let u=resolveNode(CachedInnerNode.get(this)||this.topNode,a,o,!0);return CachedInnerNode.set(this,u),u}resolveStack(a,o=0){return stackIterator(this,a,o)}iterate(a){let{enter:o,leave:u,from:d=0,to:f=this.length}=a,p=a.mode||0,g=(p&IterMode.IncludeAnonymous)>0;for(let b=this.cursor(p|IterMode.IncludeAnonymous);;){let O=!1;if(b.from<=f&&b.to>=d&&(!g&&b.type.isAnonymous||o(b)!==!1)){if(b.firstChild())continue;O=!0}for(;O&&u&&(g||!b.type.isAnonymous)&&u(b),!b.nextSibling();){if(!b.parent())return;O=!0}}}prop(a){return a.perNode?this.props?this.props[a.id]:void 0:this.type.prop(a)}get propValues(){let a=[];if(this.props)for(let o in this.props)a.push([+o,this.props[o]]);return a}balance(a={}){return this.children.length<=8?this:balanceRange(NodeType.none,this.children,this.positions,0,this.children.length,0,this.length,(o,u,d)=>new Tree(this.type,o,u,d,this.propValues),a.makeTree||((o,u,d)=>new Tree(NodeType.none,o,u,d)))}static build(a){return buildTree(a)}}Tree.empty=new Tree(NodeType.none,[],[],0);class FlatBufferCursor{constructor(a,o){this.buffer=a,this.index=o}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(a,o,u){this.buffer=a,this.length=o,this.set=u}get type(){return NodeType.none}toString(){let a=[];for(let o=0;o<this.buffer.length;)a.push(this.childString(o)),o=this.buffer[o+3];return a.join(",")}childString(a){let o=this.buffer[a],u=this.buffer[a+3],d=this.set.types[o],f=d.name;if(/\W/.test(f)&&!d.isError&&(f=JSON.stringify(f)),a+=4,u==a)return f;let p=[];for(;a<u;)p.push(this.childString(a)),a=this.buffer[a+3];return f+"("+p.join(",")+")"}findChild(a,o,u,d,f){let{buffer:p}=this,g=-1;for(let b=a;b!=o&&!(checkSide(f,d,p[b+1],p[b+2])&&(g=b,u>0));b=p[b+3]);return g}slice(a,o,u){let d=this.buffer,f=new Uint16Array(o-a),p=0;for(let g=a,b=0;g<o;){f[b++]=d[g++],f[b++]=d[g++]-u;let O=f[b++]=d[g++]-u;f[b++]=d[g++]-a,p=Math.max(p,O)}return new TreeBuffer(f,p,this.set)}}function checkSide(l,a,o,u){switch(l){case-2:return o<a;case-1:return u>=a&&o<a;case 0:return o<a&&u>a;case 1:return o<=a&&u>a;case 2:return u>a;case 4:return!0}}function resolveNode(l,a,o,u){for(var d;l.from==l.to||(o<1?l.from>=a:l.from>a)||(o>-1?l.to<=a:l.to<a);){let p=!u&&l instanceof TreeNode&&l.index<0?null:l.parent;if(!p)return l;l=p}let f=u?0:IterMode.IgnoreOverlays;if(u)for(let p=l,g=p.parent;g;p=g,g=p.parent)p instanceof TreeNode&&p.index<0&&((d=g.enter(a,o,f))===null||d===void 0?void 0:d.from)!=p.from&&(l=g);for(;;){let p=l.enter(a,o,f);if(!p)return l;l=p}}class BaseNode{cursor(a=0){return new TreeCursor(this,a)}getChild(a,o=null,u=null){let d=getChildren(this,a,o,u);return d.length?d[0]:null}getChildren(a,o=null,u=null){return getChildren(this,a,o,u)}resolve(a,o=0){return resolveNode(this,a,o,!1)}resolveInner(a,o=0){return resolveNode(this,a,o,!0)}matchContext(a){return matchNodeContext(this.parent,a)}enterUnfinishedNodesBefore(a){let o=this.childBefore(a),u=this;for(;o;){let d=o.lastChild;if(!d||d.to!=o.to)break;d.type.isError&&d.from==d.to?(u=o,o=d.prevSibling):o=d}return u}get node(){return this}get next(){return this.parent}}class TreeNode extends BaseNode{constructor(a,o,u,d){super(),this._tree=a,this.from=o,this.index=u,this._parent=d}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(a,o,u,d,f=0){for(let p=this;;){for(let{children:g,positions:b}=p._tree,O=o>0?g.length:-1;a!=O;a+=o){let S=g[a],A=b[a]+p.from;if(checkSide(d,u,A,A+S.length)){if(S instanceof TreeBuffer){if(f&IterMode.ExcludeBuffers)continue;let M=S.findChild(0,S.buffer.length,o,u-A,d);if(M>-1)return new BufferNode(new BufferContext(p,S,a,A),null,M)}else if(f&IterMode.IncludeAnonymous||!S.type.isAnonymous||hasChild(S)){let M;if(!(f&IterMode.IgnoreMounts)&&(M=MountedTree.get(S))&&!M.overlay)return new TreeNode(M.tree,A,a,p);let E=new TreeNode(S,A,a,p);return f&IterMode.IncludeAnonymous||!E.type.isAnonymous?E:E.nextChild(o<0?S.children.length-1:0,o,u,d)}}}if(f&IterMode.IncludeAnonymous||!p.type.isAnonymous||(p.index>=0?a=p.index+o:a=o<0?-1:p._parent._tree.children.length,p=p._parent,!p))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(a){return this.nextChild(0,1,a,2)}childBefore(a){return this.nextChild(this._tree.children.length-1,-1,a,-2)}enter(a,o,u=0){let d;if(!(u&IterMode.IgnoreOverlays)&&(d=MountedTree.get(this._tree))&&d.overlay){let f=a-this.from;for(let{from:p,to:g}of d.overlay)if((o>0?p<=f:p<f)&&(o<0?g>=f:g>f))return new TreeNode(d.tree,d.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,a,o,u)}nextSignificantParent(){let a=this;for(;a.type.isAnonymous&&a._parent;)a=a._parent;return a}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(l,a,o,u){let d=l.cursor(),f=[];if(!d.firstChild())return f;if(o!=null){for(let p=!1;!p;)if(p=d.type.is(o),!d.nextSibling())return f}for(;;){if(u!=null&&d.type.is(u))return f;if(d.type.is(a)&&f.push(d.node),!d.nextSibling())return u==null?f:[]}}function matchNodeContext(l,a,o=a.length-1){for(let u=l;o>=0;u=u.parent){if(!u)return!1;if(!u.type.isAnonymous){if(a[o]&&a[o]!=u.name)return!1;o--}}return!0}class BufferContext{constructor(a,o,u,d){this.parent=a,this.buffer=o,this.index=u,this.start=d}}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(a,o,u){super(),this.context=a,this._parent=o,this.index=u,this.type=a.buffer.set.types[a.buffer.buffer[u]]}child(a,o,u){let{buffer:d}=this.context,f=d.findChild(this.index+4,d.buffer[this.index+3],a,o-this.context.start,u);return f<0?null:new BufferNode(this.context,this,f)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(a){return this.child(1,a,2)}childBefore(a){return this.child(-1,a,-2)}enter(a,o,u=0){if(u&IterMode.ExcludeBuffers)return null;let{buffer:d}=this.context,f=d.findChild(this.index+4,d.buffer[this.index+3],o>0?1:-1,a-this.context.start,o);return f<0?null:new BufferNode(this.context,this,f)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(a){return this._parent?null:this.context.parent.nextChild(this.context.index+a,a,0,4)}get nextSibling(){let{buffer:a}=this.context,o=a.buffer[this.index+3];return o<(this._parent?a.buffer[this._parent.index+3]:a.buffer.length)?new BufferNode(this.context,this._parent,o):this.externalSibling(1)}get prevSibling(){let{buffer:a}=this.context,o=this._parent?this._parent.index+4:0;return this.index==o?this.externalSibling(-1):new BufferNode(this.context,this._parent,a.findChild(o,this.index,-1,0,4))}get tree(){return null}toTree(){let a=[],o=[],{buffer:u}=this.context,d=this.index+4,f=u.buffer[this.index+3];if(f>d){let p=u.buffer[this.index+1];a.push(u.slice(d,f,p)),o.push(0)}return new Tree(this.type,a,o,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function iterStack(l){if(!l.length)return null;let a=0,o=l[0];for(let f=1;f<l.length;f++){let p=l[f];(p.from>o.from||p.to<o.to)&&(o=p,a=f)}let u=o instanceof TreeNode&&o.index<0?null:o.parent,d=l.slice();return u?d[a]=u:d.splice(a,1),new StackIterator(d,o)}class StackIterator{constructor(a,o){this.heads=a,this.node=o}get next(){return iterStack(this.heads)}}function stackIterator(l,a,o){let u=l.resolveInner(a,o),d=null;for(let f=u instanceof TreeNode?u:u.context.parent;f;f=f.parent)if(f.index<0){let p=f.parent;(d||(d=[u])).push(p.resolve(a,o)),f=p}else{let p=MountedTree.get(f.tree);if(p&&p.overlay&&p.overlay[0].from<=a&&p.overlay[p.overlay.length-1].to>=a){let g=new TreeNode(p.tree,p.overlay[0].from+f.from,-1,f);(d||(d=[u])).push(resolveNode(g,a,o,!1))}}return d?iterStack(d):u}class TreeCursor{get name(){return this.type.name}constructor(a,o=0){if(this.mode=o,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,a instanceof TreeNode)this.yieldNode(a);else{this._tree=a.context.parent,this.buffer=a.context;for(let u=a._parent;u;u=u._parent)this.stack.unshift(u.index);this.bufferNode=a,this.yieldBuf(a.index)}}yieldNode(a){return a?(this._tree=a,this.type=a.type,this.from=a.from,this.to=a.to,!0):!1}yieldBuf(a,o){this.index=a;let{start:u,buffer:d}=this.buffer;return this.type=o||d.set.types[d.buffer[a]],this.from=u+d.buffer[a+1],this.to=u+d.buffer[a+2],!0}yield(a){return a?a instanceof TreeNode?(this.buffer=null,this.yieldNode(a)):(this.buffer=a.context,this.yieldBuf(a.index,a.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(a,o,u){if(!this.buffer)return this.yield(this._tree.nextChild(a<0?this._tree._tree.children.length-1:0,a,o,u,this.mode));let{buffer:d}=this.buffer,f=d.findChild(this.index+4,d.buffer[this.index+3],a,o-this.buffer.start,u);return f<0?!1:(this.stack.push(this.index),this.yieldBuf(f))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(a){return this.enterChild(1,a,2)}childBefore(a){return this.enterChild(-1,a,-2)}enter(a,o,u=this.mode){return this.buffer?u&IterMode.ExcludeBuffers?!1:this.enterChild(1,a,o):this.yield(this._tree.enter(a,o,u))}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 a=this.mode&IterMode.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(a)}sibling(a){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+a,a,0,4,this.mode)):!1;let{buffer:o}=this.buffer,u=this.stack.length-1;if(a<0){let d=u<0?0:this.stack[u]+4;if(this.index!=d)return this.yieldBuf(o.findChild(d,this.index,-1,0,4))}else{let d=o.buffer[this.index+3];if(d<(u<0?o.buffer.length:o.buffer[this.stack[u]+3]))return this.yieldBuf(d)}return u<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+a,a,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(a){let o,u,{buffer:d}=this;if(d){if(a>0){if(this.index<d.buffer.buffer.length)return!1}else for(let f=0;f<this.index;f++)if(d.buffer.buffer[f+3]<this.index)return!1;({index:o,parent:u}=d)}else({index:o,_parent:u}=this._tree);for(;u;{index:o,_parent:u}=u)if(o>-1)for(let f=o+a,p=a<0?-1:u._tree.children.length;f!=p;f+=a){let g=u._tree.children[f];if(this.mode&IterMode.IncludeAnonymous||g instanceof TreeBuffer||!g.type.isAnonymous||hasChild(g))return!1}return!0}move(a,o){if(o&&this.enterChild(a,0,4))return!0;for(;;){if(this.sibling(a))return!0;if(this.atLastNode(a)||!this.parent())return!1}}next(a=!0){return this.move(1,a)}prev(a=!0){return this.move(-1,a)}moveTo(a,o=0){for(;(this.from==this.to||(o<1?this.from>=a:this.from>a)||(o>-1?this.to<=a:this.to<a))&&this.parent(););for(;this.enterChild(1,a,o););return this}get node(){if(!this.buffer)return this._tree;let a=this.bufferNode,o=null,u=0;if(a&&a.context==this.buffer)e:for(let d=this.index,f=this.stack.length;f>=0;){for(let p=a;p;p=p._parent)if(p.index==d){if(d==this.index)return p;o=p,u=f+1;break e}d=this.stack[--f]}for(let d=u;d<this.stack.length;d++)o=new BufferNode(this.buffer,o,this.stack[d]);return this.bufferNode=new BufferNode(this.buffer,o,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(a,o){for(let u=0;;){let d=!1;if(this.type.isAnonymous||a(this)!==!1){if(this.firstChild()){u++;continue}this.type.isAnonymous||(d=!0)}for(;;){if(d&&o&&o(this),d=this.type.isAnonymous,!u)return;if(this.nextSibling())break;this.parent(),u--,d=!0}}}matchContext(a){if(!this.buffer)return matchNodeContext(this.node.parent,a);let{buffer:o}=this.buffer,{types:u}=o.set;for(let d=a.length-1,f=this.stack.length-1;d>=0;f--){if(f<0)return matchNodeContext(this._tree,a,d);let p=u[o.buffer[this.stack[f]]];if(!p.isAnonymous){if(a[d]&&a[d]!=p.name)return!1;d--}}return!0}}function hasChild(l){return l.children.some(a=>a instanceof TreeBuffer||!a.type.isAnonymous||hasChild(a))}function buildTree(l){var a;let{buffer:o,nodeSet:u,maxBufferLength:d=DefaultBufferLength,reused:f=[],minRepeatType:p=u.types.length}=l,g=Array.isArray(o)?new FlatBufferCursor(o,o.length):o,b=u.types,O=0,S=0;function A(ee,oe,me,_e,ke,Oe){let{id:Te,start:Ce,end:Ae,size:Ge}=g,Ne=S,Qe=O;for(;Ge<0;)if(g.next(),Ge==-1){let Ve=f[Te];me.push(Ve),_e.push(Ce-ee);return}else if(Ge==-3){O=Te;return}else if(Ge==-4){S=Te;return}else throw new RangeError(`Unrecognized record size: ${Ge}`);let Ee=b[Te],je,Ye,Ke=Ce-ee;if(Ae-Ce<=d&&(Ye=U(g.pos-oe,ke))){let Ve=new Uint16Array(Ye.size-Ye.skip),$e=g.pos-Ye.size,ze=Ve.length;for(;g.pos>$e;)ze=Z(Ye.start,Ve,ze);je=new TreeBuffer(Ve,Ae-Ye.start,u),Ke=Ye.start-ee}else{let Ve=g.pos-Ge;g.next();let $e=[],ze=[],it=Te>=p?Te:-1,mt=0,Je=Ae;for(;g.pos>Ve;)it>=0&&g.id==it&&g.size>=0?(g.end<=Je-d&&(R($e,ze,Ce,mt,g.end,Je,it,Ne,Qe),mt=$e.length,Je=g.end),g.next()):Oe>2500?M(Ce,Ve,$e,ze):A(Ce,Ve,$e,ze,it,Oe+1);if(it>=0&&mt>0&&mt<$e.length&&R($e,ze,Ce,mt,Ce,Je,it,Ne,Qe),$e.reverse(),ze.reverse(),it>-1&&mt>0){let xt=E(Ee,Qe);je=balanceRange(Ee,$e,ze,0,$e.length,0,Ae-Ce,xt,xt)}else je=L(Ee,$e,ze,Ae-Ce,Ne-Ae,Qe)}me.push(je),_e.push(Ke)}function M(ee,oe,me,_e){let ke=[],Oe=0,Te=-1;for(;g.pos>oe;){let{id:Ce,start:Ae,end:Ge,size:Ne}=g;if(Ne>4)g.next();else{if(Te>-1&&Ae<Te)break;Te<0&&(Te=Ge-d),ke.push(Ce,Ae,Ge),Oe++,g.next()}}if(Oe){let Ce=new Uint16Array(Oe*4),Ae=ke[ke.length-2];for(let Ge=ke.length-3,Ne=0;Ge>=0;Ge-=3)Ce[Ne++]=ke[Ge],Ce[Ne++]=ke[Ge+1]-Ae,Ce[Ne++]=ke[Ge+2]-Ae,Ce[Ne++]=Ne;me.push(new TreeBuffer(Ce,ke[2]-Ae,u)),_e.push(Ae-ee)}}function E(ee,oe){return(me,_e,ke)=>{let Oe=0,Te=me.length-1,Ce,Ae;if(Te>=0&&(Ce=me[Te])instanceof Tree){if(!Te&&Ce.type==ee&&Ce.length==ke)return Ce;(Ae=Ce.prop(NodeProp.lookAhead))&&(Oe=_e[Te]+Ce.length+Ae)}return L(ee,me,_e,ke,Oe,oe)}}function R(ee,oe,me,_e,ke,Oe,Te,Ce,Ae){let Ge=[],Ne=[];for(;ee.length>_e;)Ge.push(ee.pop()),Ne.push(oe.pop()+me-ke);ee.push(L(u.types[Te],Ge,Ne,Oe-ke,Ce-Oe,Ae)),oe.push(ke-me)}function L(ee,oe,me,_e,ke,Oe,Te){if(Oe){let Ce=[NodeProp.contextHash,Oe];Te=Te?[Ce].concat(Te):[Ce]}if(ke>25){let Ce=[NodeProp.lookAhead,ke];Te=Te?[Ce].concat(Te):[Ce]}return new Tree(ee,oe,me,_e,Te)}function U(ee,oe){let me=g.fork(),_e=0,ke=0,Oe=0,Te=me.end-d,Ce={size:0,start:0,skip:0};e:for(let Ae=me.pos-ee;me.pos>Ae;){let Ge=me.size;if(me.id==oe&&Ge>=0){Ce.size=_e,Ce.start=ke,Ce.skip=Oe,Oe+=4,_e+=4,me.next();continue}let Ne=me.pos-Ge;if(Ge<0||Ne<Ae||me.start<Te)break;let Qe=me.id>=p?4:0,Ee=me.start;for(me.next();me.pos>Ne;){if(me.size<0)if(me.size==-3)Qe+=4;else break e;else me.id>=p&&(Qe+=4);me.next()}ke=Ee,_e+=Ge,Oe+=Qe}return(oe<0||_e==ee)&&(Ce.size=_e,Ce.start=ke,Ce.skip=Oe),Ce.size>4?Ce:void 0}function Z(ee,oe,me){let{id:_e,start:ke,end:Oe,size:Te}=g;if(g.next(),Te>=0&&_e<p){let Ce=me;if(Te>4){let Ae=g.pos-(Te-4);for(;g.pos>Ae;)me=Z(ee,oe,me)}oe[--me]=Ce,oe[--me]=Oe-ee,oe[--me]=ke-ee,oe[--me]=_e}else Te==-3?O=_e:Te==-4&&(S=_e);return me}let re=[],he=[];for(;g.pos>0;)A(l.start||0,l.bufferStart||0,re,he,-1,0);let se=(a=l.length)!==null&&a!==void 0?a:re.length?he[0]+re[0].length:0;return new Tree(b[l.topID],re.reverse(),he.reverse(),se)}const nodeSizeCache=new WeakMap;function nodeSize(l,a){if(!l.isAnonymous||a instanceof TreeBuffer||a.type!=l)return 1;let o=nodeSizeCache.get(a);if(o==null){o=1;for(let u of a.children){if(u.type!=l||!(u instanceof Tree)){o=1;break}o+=nodeSize(l,u)}nodeSizeCache.set(a,o)}return o}function balanceRange(l,a,o,u,d,f,p,g,b){let O=0;for(let R=u;R<d;R++)O+=nodeSize(l,a[R]);let S=Math.ceil(O*1.5/8),A=[],M=[];function E(R,L,U,Z,re){for(let he=U;he<Z;){let se=he,ee=L[he],oe=nodeSize(l,R[he]);for(he++;he<Z;he++){let me=nodeSize(l,R[he]);if(oe+me>=S)break;oe+=me}if(he==se+1){if(oe>S){let me=R[se];E(me.children,me.positions,0,me.children.length,L[se]+re);continue}A.push(R[se])}else{let me=L[he-1]+R[he-1].length-ee;A.push(balanceRange(l,R,L,se,he,ee,me,null,b))}M.push(ee+re-f)}}return E(a,o,u,d,0),(g||b)(A,M,p)}class NodeWeakMap{constructor(){this.map=new WeakMap}setBuffer(a,o,u){let d=this.map.get(a);d||this.map.set(a,d=new Map),d.set(o,u)}getBuffer(a,o){let u=this.map.get(a);return u&&u.get(o)}set(a,o){a instanceof BufferNode?this.setBuffer(a.context.buffer,a.index,o):a instanceof TreeNode&&this.map.set(a.tree,o)}get(a){return a instanceof BufferNode?this.getBuffer(a.context.buffer,a.index):a instanceof TreeNode?this.map.get(a.tree):void 0}cursorSet(a,o){a.buffer?this.setBuffer(a.buffer.buffer,a.index,o):this.map.set(a.tree,o)}cursorGet(a){return a.buffer?this.getBuffer(a.buffer.buffer,a.index):this.map.get(a.tree)}}class TreeFragment{constructor(a,o,u,d,f=!1,p=!1){this.from=a,this.to=o,this.tree=u,this.offset=d,this.open=(f?1:0)|(p?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(a,o=[],u=!1){let d=[new TreeFragment(0,a.length,a,0,!1,u)];for(let f of o)f.to>a.length&&d.push(f);return d}static applyChanges(a,o,u=128){if(!o.length)return a;let d=[],f=1,p=a.length?a[0]:null;for(let g=0,b=0,O=0;;g++){let S=g<o.length?o[g]:null,A=S?S.fromA:1e9;if(A-b>=u)for(;p&&p.from<A;){let M=p;if(b>=M.from||A<=M.to||O){let E=Math.max(M.from,b)-O,R=Math.min(M.to,A)-O;M=E>=R?null:new TreeFragment(E,R,M.tree,M.offset+O,g>0,!!S)}if(M&&d.push(M),p.to>A)break;p=f<a.length?a[f++]:null}if(!S)break;b=S.toA,O=S.toA-S.toB}return d}}class Parser{startParse(a,o,u){return typeof a=="string"&&(a=new StringInput(a)),u=u?u.length?u.map(d=>new Range(d.from,d.to)):[new Range(0,0)]:[new Range(0,a.length)],this.createParse(a,o||[],u)}parse(a,o,u){let d=this.startParse(a,o,u);for(;;){let f=d.advance();if(f)return f}}}class StringInput{constructor(a){this.string=a}get length(){return this.string.length}chunk(a){return this.string.slice(a)}get lineChunks(){return!1}read(a,o){return this.string.slice(a,o)}}new NodeProp({perNode:!0});let nextTagID=0;class Tag{constructor(a,o,u,d){this.name=a,this.set=o,this.base=u,this.modified=d,this.id=nextTagID++}toString(){let{name:a}=this;for(let o of this.modified)o.name&&(a=`${o.name}(${a})`);return a}static define(a,o){let u=typeof a=="string"?a:"?";if(a instanceof Tag&&(o=a),o?.base)throw new Error("Can not derive from a modified tag");let d=new Tag(u,[],null,[]);if(d.set.push(d),o)for(let f of o.set)d.set.push(f);return d}static defineModifier(a){let o=new Modifier(a);return u=>u.modified.indexOf(o)>-1?u:Modifier.get(u.base||u,u.modified.concat(o).sort((d,f)=>d.id-f.id))}}let nextModifierID=0;class Modifier{constructor(a){this.name=a,this.instances=[],this.id=nextModifierID++}static get(a,o){if(!o.length)return a;let u=o[0].instances.find(g=>g.base==a&&sameArray(o,g.modified));if(u)return u;let d=[],f=new Tag(a.name,d,a,o);for(let g of o)g.instances.push(f);let p=powerSet(o);for(let g of a.set)if(!g.modified.length)for(let b of p)d.push(Modifier.get(g,b));return f}}function sameArray(l,a){return l.length==a.length&&l.every((o,u)=>o==a[u])}function powerSet(l){let a=[[]];for(let o=0;o<l.length;o++)for(let u=0,d=a.length;u<d;u++)a.push(a[u].concat(l[o]));return a.sort((o,u)=>u.length-o.length)}function styleTags(l){let a=Object.create(null);for(let o in l){let u=l[o];Array.isArray(u)||(u=[u]);for(let d of o.split(" "))if(d){let f=[],p=2,g=d;for(let A=0;;){if(g=="..."&&A>0&&A+3==d.length){p=1;break}let M=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(g);if(!M)throw new RangeError("Invalid path: "+d);if(f.push(M[0]=="*"?"":M[0][0]=='"'?JSON.parse(M[0]):M[0]),A+=M[0].length,A==d.length)break;let E=d[A++];if(A==d.length&&E=="!"){p=0;break}if(E!="/")throw new RangeError("Invalid path: "+d);g=d.slice(A)}let b=f.length-1,O=f[b];if(!O)throw new RangeError("Invalid path: "+d);let S=new Rule(u,p,b>0?f.slice(0,b):null);a[O]=S.sort(a[O])}}return ruleNodeProp.add(a)}const ruleNodeProp=new NodeProp;class Rule{constructor(a,o,u,d){this.tags=a,this.mode=o,this.context=u,this.next=d}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(a){return!a||a.depth<this.depth?(this.next=a,this):(a.next=this.sort(a.next),a)}get depth(){return this.context?this.context.length:0}}Rule.empty=new Rule([],2,null);function tagHighlighter(l,a){let o=Object.create(null);for(let f of l)if(!Array.isArray(f.tag))o[f.tag.id]=f.class;else for(let p of f.tag)o[p.id]=f.class;let{scope:u,all:d=null}=a||{};return{style:f=>{let p=d;for(let g of f)for(let b of g.set){let O=o[b.id];if(O){p=p?p+" "+O:O;break}}return p},scope:u}}function highlightTags(l,a){let o=null;for(let u of l){let d=u.style(a);d&&(o=o?o+" "+d:d)}return o}function highlightTree(l,a,o,u=0,d=l.length){let f=new HighlightBuilder(u,Array.isArray(a)?a:[a],o);f.highlightRange(l.cursor(),u,d,"",f.highlighters),f.flush(d)}class HighlightBuilder{constructor(a,o,u){this.at=a,this.highlighters=o,this.span=u,this.class=""}startSpan(a,o){o!=this.class&&(this.flush(a),a>this.at&&(this.at=a),this.class=o)}flush(a){a>this.at&&this.class&&this.span(this.at,a,this.class)}highlightRange(a,o,u,d,f){let{type:p,from:g,to:b}=a;if(g>=u||b<=o)return;p.isTop&&(f=this.highlighters.filter(E=>!E.scope||E.scope(p)));let O=d,S=getStyleTags(a)||Rule.empty,A=highlightTags(f,S.tags);if(A&&(O&&(O+=" "),O+=A,S.mode==1&&(d+=(d?" ":"")+A)),this.startSpan(Math.max(o,g),O),S.opaque)return;let M=a.tree&&a.tree.prop(NodeProp.mounted);if(M&&M.overlay){let E=a.node.enter(M.overlay[0].from+g,1),R=this.highlighters.filter(U=>!U.scope||U.scope(M.tree.type)),L=a.firstChild();for(let U=0,Z=g;;U++){let re=U<M.overlay.length?M.overlay[U]:null,he=re?re.from+g:b,se=Math.max(o,Z),ee=Math.min(u,he);if(se<ee&&L)for(;a.from<ee&&(this.highlightRange(a,se,ee,d,f),this.startSpan(Math.min(ee,a.to),O),!(a.to>=he||!a.nextSibling())););if(!re||he>u)break;Z=re.to+g,Z>o&&(this.highlightRange(E.cursor(),Math.max(o,re.from+g),Math.min(u,Z),"",R),this.startSpan(Math.min(u,Z),O))}L&&a.parent()}else if(a.firstChild()){M&&(d="");do if(!(a.to<=o)){if(a.from>=u)break;this.highlightRange(a,o,u,d,f),this.startSpan(Math.min(u,a.to),O)}while(a.nextSibling());a.parent()}}}function getStyleTags(l){let a=l.type.prop(ruleNodeProp);for(;a&&a.context&&!l.matchContext(a.context);)a=a.next;return a||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 l in tags){let a=tags[l];a instanceof Tag&&(a.name=l)}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(l){return Facet.define({combine:l?a=>a.concat(l):void 0})}const sublanguageProp=new NodeProp;class Language{constructor(a,o,u=[],d=""){this.data=a,this.name=d,EditorState.prototype.hasOwnProperty("tree")||Object.defineProperty(EditorState.prototype,"tree",{get(){return syntaxTree(this)}}),this.parser=o,this.extension=[language.of(this),EditorState.languageData.of((f,p,g)=>{let b=topNodeAt(f,p,g),O=b.type.prop(languageDataProp);if(!O)return[];let S=f.facet(O),A=b.type.prop(sublanguageProp);if(A){let M=b.resolve(p-b.from,g);for(let E of A)if(E.test(M,f)){let R=f.facet(E.facet);return E.type=="replace"?R:R.concat(S)}}return S})].concat(u)}isActiveAt(a,o,u=-1){return topNodeAt(a,o,u).type.prop(languageDataProp)==this.data}findRegions(a){let o=a.facet(language);if(o?.data==this.data)return[{from:0,to:a.doc.length}];if(!o||!o.allowsNesting)return[];let u=[],d=(f,p)=>{if(f.prop(languageDataProp)==this.data){u.push({from:p,to:p+f.length});return}let g=f.prop(NodeProp.mounted);if(g){if(g.tree.prop(languageDataProp)==this.data){if(g.overlay)for(let b of g.overlay)u.push({from:b.from+p,to:b.to+p});else u.push({from:p,to:p+f.length});return}else if(g.overlay){let b=u.length;if(d(g.tree,g.overlay[0].from+p),u.length>b)return}}for(let b=0;b<f.children.length;b++){let O=f.children[b];O instanceof Tree&&d(O,f.positions[b]+p)}};return d(syntaxTree(a),0),u}get allowsNesting(){return!0}}Language.setState=StateEffect.define();function topNodeAt(l,a,o){let u=l.facet(language),d=syntaxTree(l).topNode;if(!u||u.allowsNesting)for(let f=d;f;f=f.enter(a,o,IterMode.ExcludeBuffers))f.type.isTop&&(d=f);return d}class LRLanguage extends Language{constructor(a,o,u){super(a,o,[],u),this.parser=o}static define(a){let o=defineLanguageFacet(a.languageData);return new LRLanguage(o,a.parser.configure({props:[languageDataProp.add(u=>u.isTop?o:void 0)]}),a.name)}configure(a,o){return new LRLanguage(this.data,this.parser.configure(a),o||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function syntaxTree(l){let a=l.field(Language.state,!1);return a?a.tree:Tree.empty}function ensureSyntaxTree(l,a,o=50){var u;let d=(u=l.field(Language.state,!1))===null||u===void 0?void 0:u.context;if(!d)return null;let f=d.viewport;d.updateViewport({from:0,to:a});let p=d.isDone(a)||d.work(o,a)?d.tree:null;return d.updateViewport(f),p}class DocInput{constructor(a){this.doc=a,this.cursorPos=0,this.string="",this.cursor=a.iter()}get length(){return this.doc.length}syncTo(a){return this.string=this.cursor.next(a-this.cursorPos).value,this.cursorPos=a+this.string.length,this.cursorPos-this.string.length}chunk(a){return this.syncTo(a),this.string}get lineChunks(){return!0}read(a,o){let u=this.cursorPos-this.string.length;return a<u||o>=this.cursorPos?this.doc.sliceString(a,o):this.string.slice(a-u,o-u)}}let currentContext=null;class ParseContext{constructor(a,o,u=[],d,f,p,g,b){this.parser=a,this.state=o,this.fragments=u,this.tree=d,this.treeLen=f,this.viewport=p,this.skipped=g,this.scheduleOn=b,this.parse=null,this.tempSkipped=[]}static create(a,o,u){return new ParseContext(a,o,[],Tree.empty,0,u,[],null)}startParse(){return this.parser.startParse(new DocInput(this.state.doc),this.fragments)}work(a,o){return o!=null&&o>=this.state.doc.length&&(o=void 0),this.tree!=Tree.empty&&this.isDone(o??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var u;if(typeof a=="number"){let d=Date.now()+a;a=()=>Date.now()>d}for(this.parse||(this.parse=this.startParse()),o!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>o)&&o<this.state.doc.length&&this.parse.stopAt(o);;){let d=this.parse.advance();if(d)if(this.fragments=this.withoutTempSkipped(TreeFragment.addTree(d,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(u=this.parse.stoppedAt)!==null&&u!==void 0?u:this.state.doc.length,this.tree=d,this.parse=null,this.treeLen<(o??this.state.doc.length))this.parse=this.startParse();else return!0;if(a())return!1}})}takeTree(){let a,o;this.parse&&(a=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>a)&&this.parse.stopAt(a),this.withContext(()=>{for(;!(o=this.parse.advance()););}),this.treeLen=a,this.tree=o,this.fragments=this.withoutTempSkipped(TreeFragment.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(a){let o=currentContext;currentContext=this;try{return a()}finally{currentContext=o}}withoutTempSkipped(a){for(let o;o=this.tempSkipped.pop();)a=cutFragments(a,o.from,o.to);return a}changes(a,o){let{fragments:u,tree:d,treeLen:f,viewport:p,skipped:g}=this;if(this.takeTree(),!a.empty){let b=[];if(a.iterChangedRanges((O,S,A,M)=>b.push({fromA:O,toA:S,fromB:A,toB:M})),u=TreeFragment.applyChanges(u,b),d=Tree.empty,f=0,p={from:a.mapPos(p.from,-1),to:a.mapPos(p.to,1)},this.skipped.length){g=[];for(let O of this.skipped){let S=a.mapPos(O.from,1),A=a.mapPos(O.to,-1);S<A&&g.push({from:S,to:A})}}}return new ParseContext(this.parser,o,u,d,f,p,g,this.scheduleOn)}updateViewport(a){if(this.viewport.from==a.from&&this.viewport.to==a.to)return!1;this.viewport=a;let o=this.skipped.length;for(let u=0;u<this.skipped.length;u++){let{from:d,to:f}=this.skipped[u];d<a.to&&f>a.from&&(this.fragments=cutFragments(this.fragments,d,f),this.skipped.splice(u--,1))}return this.skipped.length>=o?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(a,o){this.skipped.push({from:a,to:o})}static getSkippingParser(a){return new class extends Parser{createParse(o,u,d){let f=d[0].from,p=d[d.length-1].to;return{parsedPos:f,advance(){let b=currentContext;if(b){for(let O of d)b.tempSkipped.push(O);a&&(b.scheduleOn=b.scheduleOn?Promise.all([b.scheduleOn,a]):a)}return this.parsedPos=p,new Tree(NodeType.none,[],[],p-f)},stoppedAt:null,stopAt(){}}}}}isDone(a){a=Math.min(a,this.state.doc.length);let o=this.fragments;return this.treeLen>=a&&o.length&&o[0].from==0&&o[0].to>=a}static get(){return currentContext}}function cutFragments(l,a,o){return TreeFragment.applyChanges(l,[{fromA:a,toA:o,fromB:a,toB:o}])}class LanguageState{constructor(a){this.context=a,this.tree=a.tree}apply(a){if(!a.docChanged&&this.tree==this.context.tree)return this;let o=this.context.changes(a.changes,a.state),u=this.context.treeLen==a.startState.doc.length?void 0:Math.max(a.changes.mapPos(this.context.treeLen),o.viewport.to);return o.work(20,u)||o.takeTree(),new LanguageState(o)}static init(a){let o=Math.min(3e3,a.doc.length),u=ParseContext.create(a.facet(language).parser,a,{from:0,to:o});return u.work(20,o)||u.takeTree(),new LanguageState(u)}}Language.state=StateField.define({create:LanguageState.init,update(l,a){for(let o of a.effects)if(o.is(Language.setState))return o.value;return a.startState.facet(language)!=a.state.facet(language)?LanguageState.init(a.state):l.apply(a)}});let requestIdle=l=>{let a=setTimeout(()=>l(),500);return()=>clearTimeout(a)};typeof requestIdleCallback<"u"&&(requestIdle=l=>{let a=-1,o=setTimeout(()=>{a=requestIdleCallback(l,{timeout:400})},100);return()=>a<0?clearTimeout(o):cancelIdleCallback(a)});const isInputPending=typeof navigator<"u"&&(!((_a=navigator.scheduling)===null||_a===void 0)&&_a.isInputPending)?()=>navigator.scheduling.isInputPending():null,parseWorker=ViewPlugin.fromClass(class{constructor(a){this.view=a,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(a){let o=this.view.state.field(Language.state).context;(o.updateViewport(a.view.viewport)||this.view.viewport.to>o.treeLen)&&this.scheduleWork(),(a.docChanged||a.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(o)}scheduleWork(){if(this.working)return;let{state:a}=this.view,o=a.field(Language.state);(o.tree!=o.context.tree||!o.context.isDone(a.doc.length))&&(this.working=requestIdle(this.work))}work(a){this.working=null;let o=Date.now();if(this.chunkEnd<o&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=o+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:u,viewport:{to:d}}=this.view,f=u.field(Language.state);if(f.tree==f.context.tree&&f.context.isDone(d+1e5))return;let p=Date.now()+Math.min(this.chunkBudget,100,a&&!isInputPending?Math.max(25,a.timeRemaining()-5):1e9),g=f.context.treeLen<d&&u.doc.length>d+1e3,b=f.context.work(()=>isInputPending&&isInputPending()||Date.now()>p,d+(g?0:1e5));this.chunkBudget-=Date.now()-o,(b||this.chunkBudget<=0)&&(f.context.takeTree(),this.view.dispatch({effects:Language.setState.of(new LanguageState(f.context))})),this.chunkBudget>0&&!(b&&!g)&&this.scheduleWork(),this.checkAsyncSchedule(f.context)}checkAsyncSchedule(a){a.scheduleOn&&(this.workScheduled++,a.scheduleOn.then(()=>this.scheduleWork()).catch(o=>logException(this.view.state,o)).then(()=>this.workScheduled--),a.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),language=Facet.define({combine(l){return l.length?l[0]:null},enables:l=>[Language.state,parseWorker,EditorView.contentAttributes.compute([l],a=>{let o=a.facet(l);return o&&o.name?{"data-language":o.name}:{}})]});class LanguageSupport{constructor(a,o=[]){this.language=a,this.support=o,this.extension=[a,o]}}const indentService=Facet.define(),indentUnit=Facet.define({combine:l=>{if(!l.length)return" ";let a=l[0];if(!a||/\S/.test(a)||Array.from(a).some(o=>o!=a[0]))throw new Error("Invalid indent unit: "+JSON.stringify(l[0]));return a}});function getIndentUnit(l){let a=l.facet(indentUnit);return a.charCodeAt(0)==9?l.tabSize*a.length:a.length}function indentString(l,a){let o="",u=l.tabSize,d=l.facet(indentUnit)[0];if(d==" "){for(;a>=u;)o+=" ",a-=u;d=" "}for(let f=0;f<a;f++)o+=d;return o}function getIndentation(l,a){l instanceof EditorState&&(l=new IndentContext(l));for(let u of l.state.facet(indentService)){let d=u(l,a);if(d!==void 0)return d}let o=syntaxTree(l.state);return o.length>=a?syntaxIndentation(l,o,a):null}class IndentContext{constructor(a,o={}){this.state=a,this.options=o,this.unit=getIndentUnit(a)}lineAt(a,o=1){let u=this.state.doc.lineAt(a),{simulateBreak:d,simulateDoubleBreak:f}=this.options;return d!=null&&d>=u.from&&d<=u.to?f&&d==a?{text:"",from:a}:(o<0?d<a:d<=a)?{text:u.text.slice(d-u.from),from:d}:{text:u.text.slice(0,d-u.from),from:u.from}:u}textAfterPos(a,o=1){if(this.options.simulateDoubleBreak&&a==this.options.simulateBreak)return"";let{text:u,from:d}=this.lineAt(a,o);return u.slice(a-d,Math.min(u.length,a+100-d))}column(a,o=1){let{text:u,from:d}=this.lineAt(a,o),f=this.countColumn(u,a-d),p=this.options.overrideIndentation?this.options.overrideIndentation(d):-1;return p>-1&&(f+=p-this.countColumn(u,u.search(/\S|$/))),f}countColumn(a,o=a.length){return countColumn(a,this.state.tabSize,o)}lineIndent(a,o=1){let{text:u,from:d}=this.lineAt(a,o),f=this.options.overrideIndentation;if(f){let p=f(d);if(p>-1)return p}return this.countColumn(u,u.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const indentNodeProp=new NodeProp;function syntaxIndentation(l,a,o){let u=a.resolveStack(o),d=a.resolveInner(o,-1).resolve(o,0).enterUnfinishedNodesBefore(o);if(d!=u.node){let f=[];for(let p=d;p&&!(p.from==u.node.from&&p.type==u.node.type);p=p.parent)f.push(p);for(let p=f.length-1;p>=0;p--)u={node:f[p],next:u}}return indentFor(u,l,o)}function indentFor(l,a,o){for(let u=l;u;u=u.next){let d=indentStrategy(u.node);if(d)return d(TreeIndentContext.create(a,o,u))}return 0}function ignoreClosed(l){return l.pos==l.options.simulateBreak&&l.options.simulateDoubleBreak}function indentStrategy(l){let a=l.type.prop(indentNodeProp);if(a)return a;let o=l.firstChild,u;if(o&&(u=o.type.prop(NodeProp.closedBy))){let d=l.lastChild,f=d&&u.indexOf(d.name)>-1;return p=>delimitedStrategy(p,!0,1,void 0,f&&!ignoreClosed(p)?d.from:void 0)}return l.parent==null?topIndent:null}function topIndent(){return 0}class TreeIndentContext extends IndentContext{constructor(a,o,u){super(a.state,a.options),this.base=a,this.pos=o,this.context=u}get node(){return this.context.node}static create(a,o,u){return new TreeIndentContext(a,o,u)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(a){let o=this.state.doc.lineAt(a.from);for(;;){let u=a.resolve(o.from);for(;u.parent&&u.parent.from==u.from;)u=u.parent;if(isParent(u,a))break;o=this.state.doc.lineAt(u.from)}return this.lineIndent(o.from)}continue(){return indentFor(this.context.next,this.base,this.pos)}}function isParent(l,a){for(let o=a;o;o=o.parent)if(l==o)return!0;return!1}function bracketedAligned(l){let a=l.node,o=a.childAfter(a.from),u=a.lastChild;if(!o)return null;let d=l.options.simulateBreak,f=l.state.doc.lineAt(o.from),p=d==null||d<=f.from?f.to:Math.min(f.to,d);for(let g=o.to;;){let b=a.childAfter(g);if(!b||b==u)return null;if(!b.type.isSkipped){if(b.from>=p)return null;let O=/^ */.exec(f.text.slice(o.to-f.from))[0].length;return{from:o.from,to:o.to+O}}g=b.to}}function delimitedIndent({closing:l,align:a=!0,units:o=1}){return u=>delimitedStrategy(u,a,o,l)}function delimitedStrategy(l,a,o,u,d){let f=l.textAfter,p=f.match(/^\s*/)[0].length,g=u&&f.slice(p,p+u.length)==u||d==l.pos+p,b=a?bracketedAligned(l):null;return b?g?l.column(b.from):l.column(b.to):l.baseIndent+(g?0:l.unit*o)}const flatIndent=l=>l.baseIndent;function continuedIndent({except:l,units:a=1}={}){return o=>{let u=l&&l.test(o.textAfter);return o.baseIndent+(u?0:a*o.unit)}}const foldService=Facet.define(),foldNodeProp=new NodeProp;function foldInside(l){let a=l.firstChild,o=l.lastChild;return a&&a.to<o.from?{from:a.to,to:o.type.isError?l.to:o.from}:null}function syntaxFolding(l,a,o){let u=syntaxTree(l);if(u.length<o)return null;let d=u.resolveStack(o,1),f=null;for(let p=d;p;p=p.next){let g=p.node;if(g.to<=o||g.from>o)continue;if(f&&g.from<a)break;let b=g.type.prop(foldNodeProp);if(b&&(g.to<u.length-50||u.length==l.doc.length||!isUnfinished(g))){let O=b(g,l);O&&O.from<=o&&O.from>=a&&O.to>o&&(f=O)}}return f}function isUnfinished(l){let a=l.lastChild;return a&&a.to==l.to&&a.type.isError}function foldable(l,a,o){for(let u of l.facet(foldService)){let d=u(l,a,o);if(d)return d}return syntaxFolding(l,a,o)}function mapRange(l,a){let o=a.mapPos(l.from,1),u=a.mapPos(l.to,-1);return o>=u?void 0:{from:o,to:u}}const foldEffect=StateEffect.define({map:mapRange}),unfoldEffect=StateEffect.define({map:mapRange});function selectedLines(l){let a=[];for(let{head:o}of l.state.selection.ranges)a.some(u=>u.from<=o&&u.to>=o)||a.push(l.lineBlockAt(o));return a}const foldState=StateField.define({create(){return Decoration.none},update(l,a){l=l.map(a.changes);for(let o of a.effects)if(o.is(foldEffect)&&!foldExists(l,o.value.from,o.value.to)){let{preparePlaceholder:u}=a.state.facet(foldConfig),d=u?Decoration.replace({widget:new PreparedFoldWidget(u(a.state,o.value))}):foldWidget;l=l.update({add:[d.range(o.value.from,o.value.to)]})}else o.is(unfoldEffect)&&(l=l.update({filter:(u,d)=>o.value.from!=u||o.value.to!=d,filterFrom:o.value.from,filterTo:o.value.to}));if(a.selection){let o=!1,{head:u}=a.selection.main;l.between(u,u,(d,f)=>{d<u&&f>u&&(o=!0)}),o&&(l=l.update({filterFrom:u,filterTo:u,filter:(d,f)=>f<=u||d>=u}))}return l},provide:l=>EditorView.decorations.from(l),toJSON(l,a){let o=[];return l.between(0,a.doc.length,(u,d)=>{o.push(u,d)}),o},fromJSON(l){if(!Array.isArray(l)||l.length%2)throw new RangeError("Invalid JSON for fold state");let a=[];for(let o=0;o<l.length;){let u=l[o++],d=l[o++];if(typeof u!="number"||typeof d!="number")throw new RangeError("Invalid JSON for fold state");a.push(foldWidget.range(u,d))}return Decoration.set(a,!0)}});function findFold(l,a,o){var u;let d=null;return(u=l.field(foldState,!1))===null||u===void 0||u.between(a,o,(f,p)=>{(!d||d.from>f)&&(d={from:f,to:p})}),d}function foldExists(l,a,o){let u=!1;return l.between(a,a,(d,f)=>{d==a&&f==o&&(u=!0)}),u}function maybeEnable(l,a){return l.field(foldState,!1)?a:a.concat(StateEffect.appendConfig.of(codeFolding()))}const foldCode=l=>{for(let a of selectedLines(l)){let o=foldable(l.state,a.from,a.to);if(o)return l.dispatch({effects:maybeEnable(l.state,[foldEffect.of(o),announceFold(l,o)])}),!0}return!1},unfoldCode=l=>{if(!l.state.field(foldState,!1))return!1;let a=[];for(let o of selectedLines(l)){let u=findFold(l.state,o.from,o.to);u&&a.push(unfoldEffect.of(u),announceFold(l,u,!1))}return a.length&&l.dispatch({effects:a}),a.length>0};function announceFold(l,a,o=!0){let u=l.state.doc.lineAt(a.from).number,d=l.state.doc.lineAt(a.to).number;return EditorView.announce.of(`${l.state.phrase(o?"Folded lines":"Unfolded lines")} ${u} ${l.state.phrase("to")} ${d}.`)}const foldAll=l=>{let{state:a}=l,o=[];for(let u=0;u<a.doc.length;){let d=l.lineBlockAt(u),f=foldable(a,d.from,d.to);f&&o.push(foldEffect.of(f)),u=(f?l.lineBlockAt(f.to):d).to+1}return o.length&&l.dispatch({effects:maybeEnable(l.state,o)}),!!o.length},unfoldAll=l=>{let a=l.state.field(foldState,!1);if(!a||!a.size)return!1;let o=[];return a.between(0,l.state.doc.length,(u,d)=>{o.push(unfoldEffect.of({from:u,to:d}))}),l.dispatch({effects:o}),!0},defaultConfig={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},foldConfig=Facet.define({combine(l){return combineConfig(l,defaultConfig)}});function codeFolding(l){return[foldState,baseTheme$1$1]}function widgetToDOM(l,a){let{state:o}=l,u=o.facet(foldConfig),d=p=>{let g=l.lineBlockAt(l.posAtDOM(p.target)),b=findFold(l.state,g.from,g.to);b&&l.dispatch({effects:unfoldEffect.of(b)}),p.preventDefault()};if(u.placeholderDOM)return u.placeholderDOM(l,d,a);let f=document.createElement("span");return f.textContent=u.placeholderText,f.setAttribute("aria-label",o.phrase("folded code")),f.title=o.phrase("unfold"),f.className="cm-foldPlaceholder",f.onclick=d,f}const foldWidget=Decoration.replace({widget:new class extends WidgetType{toDOM(l){return widgetToDOM(l,null)}}});class PreparedFoldWidget extends WidgetType{constructor(a){super(),this.value=a}eq(a){return this.value==a.value}toDOM(a){return widgetToDOM(a,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(a,o){this.specs=a;let u;function d(g){let b=StyleModule.newName();return(u||(u=Object.create(null)))["."+b]=g,b}const f=typeof o.all=="string"?o.all:o.all?d(o.all):void 0,p=o.scope;this.scope=p instanceof Language?g=>g.prop(languageDataProp)==p.data:p?g=>g==p:void 0,this.style=tagHighlighter(a.map(g=>({tag:g.tag,class:g.class||d(Object.assign({},g,{tag:null}))})),{all:f}).style,this.module=u?new StyleModule(u):null,this.themeType=o.themeType}static define(a,o){return new HighlightStyle(a,o||{})}}const highlighterFacet=Facet.define(),fallbackHighlighter=Facet.define({combine(l){return l.length?[l[0]]:null}});function getHighlighters(l){let a=l.facet(highlighterFacet);return a.length?a:l.facet(fallbackHighlighter)}function syntaxHighlighting(l,a){let o=[treeHighlighter],u;return l instanceof HighlightStyle&&(l.module&&o.push(EditorView.styleModule.of(l.module)),u=l.themeType),u?o.push(highlighterFacet.computeN([EditorView.darkTheme],d=>d.facet(EditorView.darkTheme)==(u=="dark")?[l]:[])):o.push(highlighterFacet.of(l)),o}class TreeHighlighter{constructor(a){this.markCache=Object.create(null),this.tree=syntaxTree(a.state),this.decorations=this.buildDeco(a,getHighlighters(a.state)),this.decoratedTo=a.viewport.to}update(a){let o=syntaxTree(a.state),u=getHighlighters(a.state),d=u!=getHighlighters(a.startState),{viewport:f}=a.view,p=a.changes.mapPos(this.decoratedTo,1);o.length<f.to&&!d&&o.type==this.tree.type&&p>=f.to?(this.decorations=this.decorations.map(a.changes),this.decoratedTo=p):(o!=this.tree||a.viewportChanged||d)&&(this.tree=o,this.decorations=this.buildDeco(a.view,u),this.decoratedTo=f.to)}buildDeco(a,o){if(!o||!this.tree.length)return Decoration.none;let u=new RangeSetBuilder;for(let{from:d,to:f}of a.visibleRanges)highlightTree(this.tree,o,(p,g,b)=>{u.add(p,g,this.markCache[b]||(this.markCache[b]=Decoration.mark({class:b})))},d,f);return u.finish()}}const treeHighlighter=Prec.high(ViewPlugin.fromClass(TreeHighlighter,{decorations:l=>l.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(l){return combineConfig(l,{afterCursor:!0,brackets:DefaultBrackets,maxScanDistance:DefaultScanDist,renderMatch:defaultRenderMatch})}}),matchingMark=Decoration.mark({class:"cm-matchingBracket"}),nonmatchingMark=Decoration.mark({class:"cm-nonmatchingBracket"});function defaultRenderMatch(l){let a=[],o=l.matched?matchingMark:nonmatchingMark;return a.push(o.range(l.start.from,l.start.to)),l.end&&a.push(o.range(l.end.from,l.end.to)),a}const bracketMatchingState=StateField.define({create(){return Decoration.none},update(l,a){if(!a.docChanged&&!a.selection)return l;let o=[],u=a.state.facet(bracketMatchingConfig);for(let d of a.state.selection.ranges){if(!d.empty)continue;let f=matchBrackets(a.state,d.head,-1,u)||d.head>0&&matchBrackets(a.state,d.head-1,1,u)||u.afterCursor&&(matchBrackets(a.state,d.head,1,u)||d.head<a.state.doc.length&&matchBrackets(a.state,d.head+1,-1,u));f&&(o=o.concat(u.renderMatch(f,a.state)))}return Decoration.set(o,!0)},provide:l=>EditorView.decorations.from(l)}),bracketMatchingUnique=[bracketMatchingState,baseTheme$4];function bracketMatching(l={}){return[bracketMatchingConfig.of(l),bracketMatchingUnique]}const bracketMatchingHandle=new NodeProp;function matchingNodes(l,a,o){let u=l.prop(a<0?NodeProp.openedBy:NodeProp.closedBy);if(u)return u;if(l.name.length==1){let d=o.indexOf(l.name);if(d>-1&&d%2==(a<0?1:0))return[o[d+a]]}return null}function findHandle(l){let a=l.type.prop(bracketMatchingHandle);return a?a(l.node):l}function matchBrackets(l,a,o,u={}){let d=u.maxScanDistance||DefaultScanDist,f=u.brackets||DefaultBrackets,p=syntaxTree(l),g=p.resolveInner(a,o);for(let b=g;b;b=b.parent){let O=matchingNodes(b.type,o,f);if(O&&b.from<b.to){let S=findHandle(b);if(S&&(o>0?a>=S.from&&a<S.to:a>S.from&&a<=S.to))return matchMarkedBrackets(l,a,o,b,S,O,f)}}return matchPlainBrackets(l,a,o,p,g.type,d,f)}function matchMarkedBrackets(l,a,o,u,d,f,p){let g=u.parent,b={from:d.from,to:d.to},O=0,S=g?.cursor();if(S&&(o<0?S.childBefore(u.from):S.childAfter(u.to)))do if(o<0?S.to<=u.from:S.from>=u.to){if(O==0&&f.indexOf(S.type.name)>-1&&S.from<S.to){let A=findHandle(S);return{start:b,end:A?{from:A.from,to:A.to}:void 0,matched:!0}}else if(matchingNodes(S.type,o,p))O++;else if(matchingNodes(S.type,-o,p)){if(O==0){let A=findHandle(S);return{start:b,end:A&&A.from<A.to?{from:A.from,to:A.to}:void 0,matched:!1}}O--}}while(o<0?S.prevSibling():S.nextSibling());return{start:b,matched:!1}}function matchPlainBrackets(l,a,o,u,d,f,p){let g=o<0?l.sliceDoc(a-1,a):l.sliceDoc(a,a+1),b=p.indexOf(g);if(b<0||b%2==0!=o>0)return null;let O={from:o<0?a-1:a,to:o>0?a+1:a},S=l.doc.iterRange(a,o>0?l.doc.length:0),A=0;for(let M=0;!S.next().done&&M<=f;){let E=S.value;o<0&&(M+=E.length);let R=a+M*o;for(let L=o>0?0:E.length-1,U=o>0?E.length:-1;L!=U;L+=o){let Z=p.indexOf(E[L]);if(!(Z<0||u.resolveInner(R+L,1).type!=d))if(Z%2==0==o>0)A++;else{if(A==1)return{start:O,end:{from:R+L,to:R+L+1},matched:Z>>1==b>>1};A--}}o>0&&(M+=E.length)}return S.done?{start:O,matched:!1}:null}function countCol(l,a,o,u=0,d=0){a==null&&(a=l.search(/[^\s\u00a0]/),a==-1&&(a=l.length));let f=d;for(let p=u;p<a;p++)l.charCodeAt(p)==9?f+=o-f%o:f++;return f}class StringStream{constructor(a,o,u,d){this.string=a,this.tabSize=o,this.indentUnit=u,this.overrideIndent=d,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(a){let o=this.string.charAt(this.pos),u;if(typeof a=="string"?u=o==a:u=o&&(a instanceof RegExp?a.test(o):a(o)),u)return++this.pos,o}eatWhile(a){let o=this.pos;for(;this.eat(a););return this.pos>o}eatSpace(){let a=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a}skipToEnd(){this.pos=this.string.length}skipTo(a){let o=this.string.indexOf(a,this.pos);if(o>-1)return this.pos=o,!0}backUp(a){this.pos-=a}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 a;return(a=this.overrideIndent)!==null&&a!==void 0?a:countCol(this.string,null,this.tabSize)}match(a,o,u){if(typeof a=="string"){let d=p=>u?p.toLowerCase():p,f=this.string.substr(this.pos,a.length);return d(f)==d(a)?(o!==!1&&(this.pos+=a.length),!0):null}else{let d=this.string.slice(this.pos).match(a);return d&&d.index>0?null:(d&&o!==!1&&(this.pos+=d[0].length),d)}}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[l,a]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[l]=createTokenType(noTokens,a);function warnForPart(l,a){warned.indexOf(l)>-1||(warned.push(l),console.warn(a))}function createTokenType(l,a){let o=[];for(let g of a.split(" ")){let b=[];for(let O of g.split(".")){let S=l[O]||tags[O];S?typeof S=="function"?b.length?b=b.map(S):warnForPart(O,`Modifier ${O} used at start of tag`):b.length?warnForPart(O,`Tag ${O} used as modifier`):b=Array.isArray(S)?S:[S]:warnForPart(O,`Unknown highlighting tag ${O}`)}for(let O of b)o.push(O)}if(!o.length)return 0;let u=a.replace(/ /g,"_"),d=u+" "+o.map(g=>g.id),f=byTag[d];if(f)return f.id;let p=byTag[d]=NodeType.define({id:typeArray.length,name:u,props:[styleTags({[u]:o})]});return typeArray.push(p),p.id}Direction.RTL,Direction.LTR;class CompletionContext{constructor(a,o,u,d){this.state=a,this.pos=o,this.explicit=u,this.view=d,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(a){let o=syntaxTree(this.state).resolveInner(this.pos,-1);for(;o&&a.indexOf(o.name)<0;)o=o.parent;return o?{from:o.from,to:this.pos,text:this.state.sliceDoc(o.from,this.pos),type:o.type}:null}matchBefore(a){let o=this.state.doc.lineAt(this.pos),u=Math.max(o.from,this.pos-250),d=o.text.slice(u-o.from,this.pos-o.from),f=d.search(ensureAnchor(a,!1));return f<0?null:{from:u+f,to:this.pos,text:d.slice(f)}}get aborted(){return this.abortListeners==null}addEventListener(a,o,u){a=="abort"&&this.abortListeners&&(this.abortListeners.push(o),u&&u.onDocChange&&(this.abortOnDocChange=!0))}}function toSet(l){let a=Object.keys(l).join(""),o=/\w/.test(a);return o&&(a=a.replace(/\w/g,"")),`[${o?"\\w":""}${a.replace(/[^\w\s]/g,"\\$&")}]`}function prefixMatch(l){let a=Object.create(null),o=Object.create(null);for(let{label:d}of l){a[d[0]]=!0;for(let f=1;f<d.length;f++)o[d[f]]=!0}let u=toSet(a)+toSet(o)+"*$";return[new RegExp("^"+u),new RegExp(u)]}function completeFromList(l){let a=l.map(d=>typeof d=="string"?{label:d}:d),[o,u]=a.every(d=>/^\w+$/.test(d.label))?[/\w*$/,/\w+$/]:prefixMatch(a);return d=>{let f=d.matchBefore(u);return f||d.explicit?{from:f?f.from:d.pos,options:a,validFor:o}:null}}function ifNotIn(l,a){return o=>{for(let u=syntaxTree(o.state).resolveInner(o.pos,-1);u;u=u.parent){if(l.indexOf(u.name)>-1)return null;if(u.type.isTop)break}return a(o)}}class Option{constructor(a,o,u,d){this.completion=a,this.source=o,this.match=u,this.score=d}}function cur(l){return l.selection.main.from}function ensureAnchor(l,a){var o;let{source:u}=l,d=a&&u[0]!="^",f=u[u.length-1]!="$";return!d&&!f?l:new RegExp(`${d?"^":""}(?:${u})${f?"$":""}`,(o=l.flags)!==null&&o!==void 0?o:l.ignoreCase?"i":"")}const pickedCompletion=Annotation.define();function insertCompletionText(l,a,o,u){let{main:d}=l.selection,f=o-d.from,p=u-d.from;return Object.assign(Object.assign({},l.changeByRange(g=>{if(g!=d&&o!=u&&l.sliceDoc(g.from+f,g.from+p)!=l.sliceDoc(o,u))return{range:g};let b=l.toText(a);return{changes:{from:g.from+f,to:u==d.from?g.to:g.from+p,insert:b},range:EditorSelection.cursor(g.from+f+b.length)}})),{scrollIntoView:!0,userEvent:"input.complete"})}const SourceCache=new WeakMap;function asSource(l){if(!Array.isArray(l))return l;let a=SourceCache.get(l);return a||SourceCache.set(l,a=completeFromList(l)),a}const startCompletionEffect=StateEffect.define(),closeCompletionEffect=StateEffect.define();class FuzzyMatcher{constructor(a){this.pattern=a,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let o=0;o<a.length;){let u=codePointAt(a,o),d=codePointSize(u);this.chars.push(u);let f=a.slice(o,o+d),p=f.toUpperCase();this.folded.push(codePointAt(p==f?f.toLowerCase():p,0)),o+=d}this.astral=a.length!=this.chars.length}ret(a,o){return this.score=a,this.matched=o,this}match(a){if(this.pattern.length==0)return this.ret(-100,[]);if(a.length<this.pattern.length)return null;let{chars:o,folded:u,any:d,precise:f,byWord:p}=this;if(o.length==1){let re=codePointAt(a,0),he=codePointSize(re),se=he==a.length?0:-100;if(re!=o[0])if(re==u[0])se+=-200;else return null;return this.ret(se,[0,he])}let g=a.indexOf(this.pattern);if(g==0)return this.ret(a.length==this.pattern.length?0:-100,[0,this.pattern.length]);let b=o.length,O=0;if(g<0){for(let re=0,he=Math.min(a.length,200);re<he&&O<b;){let se=codePointAt(a,re);(se==o[O]||se==u[O])&&(d[O++]=re),re+=codePointSize(se)}if(O<b)return null}let S=0,A=0,M=!1,E=0,R=-1,L=-1,U=/[a-z]/.test(a),Z=!0;for(let re=0,he=Math.min(a.length,200),se=0;re<he&&A<b;){let ee=codePointAt(a,re);g<0&&(S<b&&ee==o[S]&&(f[S++]=re),E<b&&(ee==o[E]||ee==u[E]?(E==0&&(R=re),L=re+1,E++):E=0));let oe,me=ee<255?ee>=48&&ee<=57||ee>=97&&ee<=122?2:ee>=65&&ee<=90?1:0:(oe=fromCodePoint(ee))!=oe.toLowerCase()?1:oe!=oe.toUpperCase()?2:0;(!re||me==1&&U||se==0&&me!=0)&&(o[A]==ee||u[A]==ee&&(M=!0)?p[A++]=re:p.length&&(Z=!1)),se=me,re+=codePointSize(ee)}return A==b&&p[0]==0&&Z?this.result(-100+(M?-200:0),p,a):E==b&&R==0?this.ret(-200-a.length+(L==a.length?0:-100),[0,L]):g>-1?this.ret(-700-a.length,[g,g+this.pattern.length]):E==b?this.ret(-900-a.length,[R,L]):A==b?this.result(-100+(M?-200:0)+-700+(Z?0:-1100),p,a):o.length==2?null:this.result((d[0]?-700:0)+-200+-1100,d,a)}result(a,o,u){let d=[],f=0;for(let p of o){let g=p+(this.astral?codePointSize(codePointAt(u,p)):1);f&&d[f-1]==p?d[f-1]=g:(d[f++]=p,d[f++]=g)}return this.ret(a-u.length,d)}}class StrictMatcher{constructor(a){this.pattern=a,this.matched=[],this.score=0,this.folded=a.toLowerCase()}match(a){if(a.length<this.pattern.length)return null;let o=a.slice(0,this.pattern.length),u=o==this.pattern?0:o.toLowerCase()==this.folded?-200:null;return u==null?null:(this.matched=[0,o.length],this.score=u+(a.length==this.pattern.length?0:-100),this)}}const completionConfig=Facet.define({combine(l){return combineConfig(l,{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:(a,o)=>a.label.localeCompare(o.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(a,o)=>a&&o,closeOnBlur:(a,o)=>a&&o,icons:(a,o)=>a&&o,tooltipClass:(a,o)=>u=>joinClass(a(u),o(u)),optionClass:(a,o)=>u=>joinClass(a(u),o(u)),addToOptions:(a,o)=>a.concat(o),filterStrict:(a,o)=>a||o})}});function joinClass(l,a){return l?a?l+" "+a:l:a}function defaultPositionInfo(l,a,o,u,d,f){let p=l.textDirection==Direction.RTL,g=p,b=!1,O="top",S,A,M=a.left-d.left,E=d.right-a.right,R=u.right-u.left,L=u.bottom-u.top;if(g&&M<Math.min(R,E)?g=!1:!g&&E<Math.min(R,M)&&(g=!0),R<=(g?M:E))S=Math.max(d.top,Math.min(o.top,d.bottom-L))-a.top,A=Math.min(400,g?M:E);else{b=!0,A=Math.min(400,(p?a.right:d.right-a.left)-30);let re=d.bottom-a.bottom;re>=L||re>a.top?S=o.bottom-a.top:(O="bottom",S=a.bottom-o.top)}let U=(a.bottom-a.top)/f.offsetHeight,Z=(a.right-a.left)/f.offsetWidth;return{style:`${O}: ${S/U}px; max-width: ${A/Z}px`,class:"cm-completionInfo-"+(b?p?"left-narrow":"right-narrow":g?"left":"right")}}function optionContent(l){let a=l.addToOptions.slice();return l.icons&&a.push({render(o){let u=document.createElement("div");return u.classList.add("cm-completionIcon"),o.type&&u.classList.add(...o.type.split(/\s+/g).map(d=>"cm-completionIcon-"+d)),u.setAttribute("aria-hidden","true"),u},position:20}),a.push({render(o,u,d,f){let p=document.createElement("span");p.className="cm-completionLabel";let g=o.displayLabel||o.label,b=0;for(let O=0;O<f.length;){let S=f[O++],A=f[O++];S>b&&p.appendChild(document.createTextNode(g.slice(b,S)));let M=p.appendChild(document.createElement("span"));M.appendChild(document.createTextNode(g.slice(S,A))),M.className="cm-completionMatchedText",b=A}return b<g.length&&p.appendChild(document.createTextNode(g.slice(b))),p},position:50},{render(o){if(!o.detail)return null;let u=document.createElement("span");return u.className="cm-completionDetail",u.textContent=o.detail,u},position:80}),a.sort((o,u)=>o.position-u.position).map(o=>o.render)}function rangeAroundSelected(l,a,o){if(l<=o)return{from:0,to:l};if(a<0&&(a=0),a<=l>>1){let d=Math.floor(a/o);return{from:d*o,to:(d+1)*o}}let u=Math.floor((l-a)/o);return{from:l-(u+1)*o,to:l-u*o}}class CompletionTooltip{constructor(a,o,u){this.view=a,this.stateField=o,this.applyCompletion=u,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:b=>this.placeInfo(b),key:this},this.space=null,this.currentClass="";let d=a.state.field(o),{options:f,selected:p}=d.open,g=a.state.facet(completionConfig);this.optionContent=optionContent(g),this.optionClass=g.optionClass,this.tooltipClass=g.tooltipClass,this.range=rangeAroundSelected(f.length,p,g.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(a.state),this.dom.addEventListener("mousedown",b=>{let{options:O}=a.state.field(o).open;for(let S=b.target,A;S&&S!=this.dom;S=S.parentNode)if(S.nodeName=="LI"&&(A=/-(\d+)$/.exec(S.id))&&+A[1]<O.length){this.applyCompletion(a,O[+A[1]]),b.preventDefault();return}}),this.dom.addEventListener("focusout",b=>{let O=a.state.field(this.stateField,!1);O&&O.tooltip&&a.state.facet(completionConfig).closeOnBlur&&b.relatedTarget!=a.contentDOM&&a.dispatch({effects:closeCompletionEffect.of(null)})}),this.showOptions(f,d.id)}mount(){this.updateSel()}showOptions(a,o){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(a,o,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(a){var o;let u=a.state.field(this.stateField),d=a.startState.field(this.stateField);if(this.updateTooltipClass(a.state),u!=d){let{options:f,selected:p,disabled:g}=u.open;(!d.open||d.open.options!=f)&&(this.range=rangeAroundSelected(f.length,p,a.state.facet(completionConfig).maxRenderedOptions),this.showOptions(f,u.id)),this.updateSel(),g!=((o=d.open)===null||o===void 0?void 0:o.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!g)}}updateTooltipClass(a){let o=this.tooltipClass(a);if(o!=this.currentClass){for(let u of this.currentClass.split(" "))u&&this.dom.classList.remove(u);for(let u of o.split(" "))u&&this.dom.classList.add(u);this.currentClass=o}}positioned(a){this.space=a,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let a=this.view.state.field(this.stateField),o=a.open;if((o.selected>-1&&o.selected<this.range.from||o.selected>=this.range.to)&&(this.range=rangeAroundSelected(o.options.length,o.selected,this.view.state.facet(completionConfig).maxRenderedOptions),this.showOptions(o.options,a.id)),this.updateSelectedOption(o.selected)){this.destroyInfo();let{completion:u}=o.options[o.selected],{info:d}=u;if(!d)return;let f=typeof d=="string"?document.createTextNode(d):d(u);if(!f)return;"then"in f?f.then(p=>{p&&this.view.state.field(this.stateField,!1)==a&&this.addInfoPane(p,u)}).catch(p=>logException(this.view.state,p,"completion info")):this.addInfoPane(f,u)}}addInfoPane(a,o){this.destroyInfo();let u=this.info=document.createElement("div");if(u.className="cm-tooltip cm-completionInfo",a.nodeType!=null)u.appendChild(a),this.infoDestroy=null;else{let{dom:d,destroy:f}=a;u.appendChild(d),this.infoDestroy=f||null}this.dom.appendChild(u),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(a){let o=null;for(let u=this.list.firstChild,d=this.range.from;u;u=u.nextSibling,d++)u.nodeName!="LI"||!u.id?d--:d==a?u.hasAttribute("aria-selected")||(u.setAttribute("aria-selected","true"),o=u):u.hasAttribute("aria-selected")&&u.removeAttribute("aria-selected");return o&&scrollIntoView(this.list,o),o}measureInfo(){let a=this.dom.querySelector("[aria-selected]");if(!a||!this.info)return null;let o=this.dom.getBoundingClientRect(),u=this.info.getBoundingClientRect(),d=a.getBoundingClientRect(),f=this.space;if(!f){let p=this.dom.ownerDocument.defaultView||window;f={left:0,top:0,right:p.innerWidth,bottom:p.innerHeight}}return d.top>Math.min(f.bottom,o.bottom)-10||d.bottom<Math.max(f.top,o.top)+10?null:this.view.state.facet(completionConfig).positionInfo(this.view,o,d,u,f,this.dom)}placeInfo(a){this.info&&(a?(a.style&&(this.info.style.cssText=a.style),this.info.className="cm-tooltip cm-completionInfo "+(a.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(a,o,u){const d=document.createElement("ul");d.id=o,d.setAttribute("role","listbox"),d.setAttribute("aria-expanded","true"),d.setAttribute("aria-label",this.view.state.phrase("Completions"));let f=null;for(let p=u.from;p<u.to;p++){let{completion:g,match:b}=a[p],{section:O}=g;if(O){let M=typeof O=="string"?O:O.name;if(M!=f&&(p>u.from||u.from==0))if(f=M,typeof O!="string"&&O.header)d.appendChild(O.header(O));else{let E=d.appendChild(document.createElement("completion-section"));E.textContent=M}}const S=d.appendChild(document.createElement("li"));S.id=o+"-"+p,S.setAttribute("role","option");let A=this.optionClass(g);A&&(S.className=A);for(let M of this.optionContent){let E=M(g,this.view.state,this.view,b);E&&S.appendChild(E)}}return u.from&&d.classList.add("cm-completionListIncompleteTop"),u.to<a.length&&d.classList.add("cm-completionListIncompleteBottom"),d}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function completionTooltip(l,a){return o=>new CompletionTooltip(o,l,a)}function scrollIntoView(l,a){let o=l.getBoundingClientRect(),u=a.getBoundingClientRect(),d=o.height/l.offsetHeight;u.top<o.top?l.scrollTop-=(o.top-u.top)/d:u.bottom>o.bottom&&(l.scrollTop+=(u.bottom-o.bottom)/d)}function score(l){return(l.boost||0)*100+(l.apply?10:0)+(l.info?5:0)+(l.type?1:0)}function sortOptions(l,a){let o=[],u=null,d=O=>{o.push(O);let{section:S}=O.completion;if(S){u||(u=[]);let A=typeof S=="string"?S:S.name;u.some(M=>M.name==A)||u.push(typeof S=="string"?{name:A}:S)}},f=a.facet(completionConfig);for(let O of l)if(O.hasResult()){let S=O.result.getMatch;if(O.result.filter===!1)for(let A of O.result.options)d(new Option(A,O.source,S?S(A):[],1e9-o.length));else{let A=a.sliceDoc(O.from,O.to),M,E=f.filterStrict?new StrictMatcher(A):new FuzzyMatcher(A);for(let R of O.result.options)if(M=E.match(R.label)){let L=R.displayLabel?S?S(R,M.matched):[]:M.matched;d(new Option(R,O.source,L,M.score+(R.boost||0)))}}}if(u){let O=Object.create(null),S=0,A=(M,E)=>{var R,L;return((R=M.rank)!==null&&R!==void 0?R:1e9)-((L=E.rank)!==null&&L!==void 0?L:1e9)||(M.name<E.name?-1:1)};for(let M of u.sort(A))S-=1e5,O[M.name]=S;for(let M of o){let{section:E}=M.completion;E&&(M.score+=O[typeof E=="string"?E:E.name])}}let p=[],g=null,b=f.compareCompletions;for(let O of o.sort((S,A)=>A.score-S.score||b(S.completion,A.completion))){let S=O.completion;!g||g.label!=S.label||g.detail!=S.detail||g.type!=null&&S.type!=null&&g.type!=S.type||g.apply!=S.apply||g.boost!=S.boost?p.push(O):score(O.completion)>score(g)&&(p[p.length-1]=O),g=O.completion}return p}class CompletionDialog{constructor(a,o,u,d,f,p){this.options=a,this.attrs=o,this.tooltip=u,this.timestamp=d,this.selected=f,this.disabled=p}setSelected(a,o){return a==this.selected||a>=this.options.length?this:new CompletionDialog(this.options,makeAttrs(o,a),this.tooltip,this.timestamp,a,this.disabled)}static build(a,o,u,d,f,p){if(d&&!p&&a.some(O=>O.isPending))return d.setDisabled();let g=sortOptions(a,o);if(!g.length)return d&&a.some(O=>O.isPending)?d.setDisabled():null;let b=o.facet(completionConfig).selectOnOpen?0:-1;if(d&&d.selected!=b&&d.selected!=-1){let O=d.options[d.selected].completion;for(let S=0;S<g.length;S++)if(g[S].completion==O){b=S;break}}return new CompletionDialog(g,makeAttrs(u,b),{pos:a.reduce((O,S)=>S.hasResult()?Math.min(O,S.from):O,1e8),create:createTooltip,above:f.aboveCursor},d?d.timestamp:Date.now(),b,!1)}map(a){return new CompletionDialog(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:a.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(a,o,u){this.active=a,this.id=o,this.open=u}static start(){return new CompletionState(none$1,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(a){let{state:o}=a,u=o.facet(completionConfig),f=(u.override||o.languageDataAt("autocomplete",cur(o)).map(asSource)).map(b=>(this.active.find(S=>S.source==b)||new ActiveSource(b,this.active.some(S=>S.state!=0)?1:0)).update(a,u));f.length==this.active.length&&f.every((b,O)=>b==this.active[O])&&(f=this.active);let p=this.open,g=a.effects.some(b=>b.is(setActiveEffect));p&&a.docChanged&&(p=p.map(a.changes)),a.selection||f.some(b=>b.hasResult()&&a.changes.touchesRange(b.from,b.to))||!sameResults(f,this.active)||g?p=CompletionDialog.build(f,o,this.id,p,u,g):p&&p.disabled&&!f.some(b=>b.isPending)&&(p=null),!p&&f.every(b=>!b.isPending)&&f.some(b=>b.hasResult())&&(f=f.map(b=>b.hasResult()?new ActiveSource(b.source,0):b));for(let b of a.effects)b.is(setSelectedEffect)&&(p=p&&p.setSelected(b.value,this.id));return f==this.active&&p==this.open?this:new CompletionState(f,this.id,p)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?baseAttrs:noAttrs}}function sameResults(l,a){if(l==a)return!0;for(let o=0,u=0;;){for(;o<l.length&&!l[o].hasResult();)o++;for(;u<a.length&&!a[u].hasResult();)u++;let d=o==l.length,f=u==a.length;if(d||f)return d==f;if(l[o++].result!=a[u++].result)return!1}}const baseAttrs={"aria-autocomplete":"list"},noAttrs={};function makeAttrs(l,a){let o={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":l};return a>-1&&(o["aria-activedescendant"]=l+"-"+a),o}const none$1=[];function getUpdateType(l,a){if(l.isUserEvent("input.complete")){let u=l.annotation(pickedCompletion);if(u&&a.activateOnCompletion(u))return 12}let o=l.isUserEvent("input.type");return o&&a.activateOnTyping?5:o?1:l.isUserEvent("delete.backward")?2:l.selection?8:l.docChanged?16:0}class ActiveSource{constructor(a,o,u=!1){this.source=a,this.state=o,this.explicit=u}hasResult(){return!1}get isPending(){return this.state==1}update(a,o){let u=getUpdateType(a,o),d=this;(u&8||u&16&&this.touches(a))&&(d=new ActiveSource(d.source,0)),u&4&&d.state==0&&(d=new ActiveSource(this.source,1)),d=d.updateFor(a,u);for(let f of a.effects)if(f.is(startCompletionEffect))d=new ActiveSource(d.source,1,f.value);else if(f.is(closeCompletionEffect))d=new ActiveSource(d.source,0);else if(f.is(setActiveEffect))for(let p of f.value)p.source==d.source&&(d=p);return d}updateFor(a,o){return this.map(a.changes)}map(a){return this}touches(a){return a.changes.touchesRange(cur(a.state))}}class ActiveResult extends ActiveSource{constructor(a,o,u,d,f,p){super(a,3,o),this.limit=u,this.result=d,this.from=f,this.to=p}hasResult(){return!0}updateFor(a,o){var u;if(!(o&3))return this.map(a.changes);let d=this.result;d.map&&!a.changes.empty&&(d=d.map(d,a.changes));let f=a.changes.mapPos(this.from),p=a.changes.mapPos(this.to,1),g=cur(a.state);if(g>p||!d||o&2&&(cur(a.startState)==this.from||g<this.limit))return new ActiveSource(this.source,o&4?1:0);let b=a.changes.mapPos(this.limit);return checkValid(d.validFor,a.state,f,p)?new ActiveResult(this.source,this.explicit,b,d,f,p):d.update&&(d=d.update(d,f,p,new CompletionContext(a.state,g,!1)))?new ActiveResult(this.source,this.explicit,b,d,d.from,(u=d.to)!==null&&u!==void 0?u:cur(a.state)):new ActiveSource(this.source,1,this.explicit)}map(a){return a.empty?this:(this.result.map?this.result.map(this.result,a):this.result)?new ActiveResult(this.source,this.explicit,a.mapPos(this.limit),this.result,a.mapPos(this.from),a.mapPos(this.to,1)):new ActiveSource(this.source,0)}touches(a){return a.changes.touchesRange(this.from,this.to)}}function checkValid(l,a,o,u){if(!l)return!1;let d=a.sliceDoc(o,u);return typeof l=="function"?l(d,o,u,a):ensureAnchor(l,!0).test(d)}const setActiveEffect=StateEffect.define({map(l,a){return l.map(o=>o.map(a))}}),setSelectedEffect=StateEffect.define(),completionState=StateField.define({create(){return CompletionState.start()},update(l,a){return l.update(a)},provide:l=>[showTooltip.from(l,a=>a.tooltip),EditorView.contentAttributes.from(l,a=>a.attrs)]});function applyCompletion(l,a){const o=a.completion.apply||a.completion.label;let u=l.state.field(completionState).active.find(d=>d.source==a.source);return u instanceof ActiveResult?(typeof o=="string"?l.dispatch(Object.assign(Object.assign({},insertCompletionText(l.state,o,u.from,u.to)),{annotations:pickedCompletion.of(a.completion)})):o(l,a.completion,u.from,u.to),!0):!1}const createTooltip=completionTooltip(completionState,applyCompletion);function moveCompletionSelection(l,a="option"){return o=>{let u=o.state.field(completionState,!1);if(!u||!u.open||u.open.disabled||Date.now()-u.open.timestamp<o.state.facet(completionConfig).interactionDelay)return!1;let d=1,f;a=="page"&&(f=getTooltip(o,u.open.tooltip))&&(d=Math.max(2,Math.floor(f.dom.offsetHeight/f.dom.querySelector("li").offsetHeight)-1));let{length:p}=u.open.options,g=u.open.selected>-1?u.open.selected+d*(l?1:-1):l?0:p-1;return g<0?g=a=="page"?0:p-1:g>=p&&(g=a=="page"?p-1:0),o.dispatch({effects:setSelectedEffect.of(g)}),!0}}const acceptCompletion=l=>{let a=l.state.field(completionState,!1);return l.state.readOnly||!a||!a.open||a.open.selected<0||a.open.disabled||Date.now()-a.open.timestamp<l.state.facet(completionConfig).interactionDelay?!1:applyCompletion(l,a.open.options[a.open.selected])},startCompletion=l=>l.state.field(completionState,!1)?(l.dispatch({effects:startCompletionEffect.of(!0)}),!0):!1,closeCompletion=l=>{let a=l.state.field(completionState,!1);return!a||!a.active.some(o=>o.state!=0)?!1:(l.dispatch({effects:closeCompletionEffect.of(null)}),!0)};class RunningQuery{constructor(a,o){this.active=a,this.context=o,this.time=Date.now(),this.updates=[],this.done=void 0}}const MaxUpdateCount=50,MinAbortTime=1e3,completionPlugin=ViewPlugin.fromClass(class{constructor(l){this.view=l,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let a of l.state.field(completionState).active)a.isPending&&this.startQuery(a)}update(l){let a=l.state.field(completionState),o=l.state.facet(completionConfig);if(!l.selectionSet&&!l.docChanged&&l.startState.field(completionState)==a)return;let u=l.transactions.some(f=>{let p=getUpdateType(f,o);return p&8||(f.selection||f.docChanged)&&!(p&3)});for(let f=0;f<this.running.length;f++){let p=this.running[f];if(u||p.context.abortOnDocChange&&l.docChanged||p.updates.length+l.transactions.length>MaxUpdateCount&&Date.now()-p.time>MinAbortTime){for(let g of p.context.abortListeners)try{g()}catch(b){logException(this.view.state,b)}p.context.abortListeners=null,this.running.splice(f--,1)}else p.updates.push(...l.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),l.transactions.some(f=>f.effects.some(p=>p.is(startCompletionEffect)))&&(this.pendingStart=!0);let d=this.pendingStart?50:o.activateOnTypingDelay;if(this.debounceUpdate=a.active.some(f=>f.isPending&&!this.running.some(p=>p.active.source==f.source))?setTimeout(()=>this.startUpdate(),d):-1,this.composing!=0)for(let f of l.transactions)f.isUserEvent("input.type")?this.composing=2:this.composing==2&&f.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:l}=this.view,a=l.field(completionState);for(let o of a.active)o.isPending&&!this.running.some(u=>u.active.source==o.source)&&this.startQuery(o);this.running.length&&a.open&&a.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(completionConfig).updateSyncTime))}startQuery(l){let{state:a}=this.view,o=cur(a),u=new CompletionContext(a,o,l.explicit,this.view),d=new RunningQuery(l,u);this.running.push(d),Promise.resolve(l.source(u)).then(f=>{d.context.aborted||(d.done=f||null,this.scheduleAccept())},f=>{this.view.dispatch({effects:closeCompletionEffect.of(null)}),logException(this.view.state,f)})}scheduleAccept(){this.running.every(l=>l.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(completionConfig).updateSyncTime))}accept(){var l;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let a=[],o=this.view.state.facet(completionConfig),u=this.view.state.field(completionState);for(let d=0;d<this.running.length;d++){let f=this.running[d];if(f.done===void 0)continue;if(this.running.splice(d--,1),f.done){let g=cur(f.updates.length?f.updates[0].startState:this.view.state),b=Math.min(g,f.done.from+(f.active.explicit?0:1)),O=new ActiveResult(f.active.source,f.active.explicit,b,f.done,f.done.from,(l=f.done.to)!==null&&l!==void 0?l:g);for(let S of f.updates)O=O.update(S,o);if(O.hasResult()){a.push(O);continue}}let p=u.active.find(g=>g.source==f.active.source);if(p&&p.isPending)if(f.done==null){let g=new ActiveSource(f.active.source,0);for(let b of f.updates)g=g.update(b,o);g.isPending||a.push(g)}else this.startQuery(p)}(a.length||u.open&&u.open.disabled)&&this.view.dispatch({effects:setActiveEffect.of(a)})}},{eventHandlers:{blur(l){let a=this.view.state.field(completionState,!1);if(a&&a.tooltip&&this.view.state.facet(completionConfig).closeOnBlur){let o=a.open&&getTooltip(this.view,a.open.tooltip);(!o||!o.dom.contains(l.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(l,a){let o=a.state.field(completionState,!1);if(!o||!o.open||o.open.disabled||o.open.selected<0||l.key.length>1||l.ctrlKey&&!(windows&&l.altKey)||l.metaKey)return!1;let u=o.open.options[o.open.selected],d=o.active.find(p=>p.source==u.source),f=u.completion.commitCharacters||d.result.commitCharacters;return f&&f.indexOf(l.key)>-1&&applyCompletion(a,u),!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(a,o,u,d){this.field=a,this.line=o,this.from=u,this.to=d}}class FieldRange{constructor(a,o,u){this.field=a,this.from=o,this.to=u}map(a){let o=a.mapPos(this.from,-1,MapMode.TrackDel),u=a.mapPos(this.to,1,MapMode.TrackDel);return o==null||u==null?null:new FieldRange(this.field,o,u)}}class Snippet{constructor(a,o){this.lines=a,this.fieldPositions=o}instantiate(a,o){let u=[],d=[o],f=a.doc.lineAt(o),p=/^\s*/.exec(f.text)[0];for(let b of this.lines){if(u.length){let O=p,S=/^\t*/.exec(b)[0].length;for(let A=0;A<S;A++)O+=a.facet(indentUnit);d.push(o+O.length-S),b=O+b.slice(S)}u.push(b),o+=b.length+1}let g=this.fieldPositions.map(b=>new FieldRange(b.field,d[b.line]+b.from,d[b.line]+b.to));return{text:u,ranges:g}}static parse(a){let o=[],u=[],d=[],f;for(let p of a.split(/\r\n?|\n/)){for(;f=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(p);){let g=f[1]?+f[1]:null,b=f[2]||f[3]||"",O=-1,S=b.replace(/\\[{}]/g,A=>A[1]);for(let A=0;A<o.length;A++)(g!=null?o[A].seq==g:S&&o[A].name==S)&&(O=A);if(O<0){let A=0;for(;A<o.length&&(g==null||o[A].seq!=null&&o[A].seq<g);)A++;o.splice(A,0,{seq:g,name:S}),O=A;for(let M of d)M.field>=O&&M.field++}d.push(new FieldPos(O,u.length,f.index,f.index+S.length)),p=p.slice(0,f.index)+b+p.slice(f.index+f[0].length)}p=p.replace(/\\([{}])/g,(g,b,O)=>{for(let S of d)S.line==u.length&&S.from>O&&(S.from--,S.to--);return b}),u.push(p)}return new Snippet(u,d)}}let fieldMarker=Decoration.widget({widget:new class extends WidgetType{toDOM(){let l=document.createElement("span");return l.className="cm-snippetFieldPosition",l}ignoreEvent(){return!1}}}),fieldRange=Decoration.mark({class:"cm-snippetField"});class ActiveSnippet{constructor(a,o){this.ranges=a,this.active=o,this.deco=Decoration.set(a.map(u=>(u.from==u.to?fieldMarker:fieldRange).range(u.from,u.to)))}map(a){let o=[];for(let u of this.ranges){let d=u.map(a);if(!d)return null;o.push(d)}return new ActiveSnippet(o,this.active)}selectionInsideField(a){return a.ranges.every(o=>this.ranges.some(u=>u.field==this.active&&u.from<=o.from&&u.to>=o.to))}}const setActive=StateEffect.define({map(l,a){return l&&l.map(a)}}),moveToField=StateEffect.define(),snippetState=StateField.define({create(){return null},update(l,a){for(let o of a.effects){if(o.is(setActive))return o.value;if(o.is(moveToField)&&l)return new ActiveSnippet(l.ranges,o.value)}return l&&a.docChanged&&(l=l.map(a.changes)),l&&a.selection&&!l.selectionInsideField(a.selection)&&(l=null),l},provide:l=>EditorView.decorations.from(l,a=>a?a.deco:Decoration.none)});function fieldSelection(l,a){return EditorSelection.create(l.filter(o=>o.field==a).map(o=>EditorSelection.range(o.from,o.to)))}function snippet(l){let a=Snippet.parse(l);return(o,u,d,f)=>{let{text:p,ranges:g}=a.instantiate(o.state,d),{main:b}=o.state.selection,O={changes:{from:d,to:f==b.from?b.to:f,insert:Text.of(p)},scrollIntoView:!0,annotations:u?[pickedCompletion.of(u),Transaction.userEvent.of("input.complete")]:void 0};if(g.length&&(O.selection=fieldSelection(g,0)),g.some(S=>S.field>0)){let S=new ActiveSnippet(g,0),A=O.effects=[setActive.of(S)];o.state.field(snippetState,!1)===void 0&&A.push(StateEffect.appendConfig.of([snippetState,addSnippetKeymap,snippetPointerHandler,baseTheme$3]))}o.dispatch(o.state.update(O))}}function moveField(l){return({state:a,dispatch:o})=>{let u=a.field(snippetState,!1);if(!u||l<0&&u.active==0)return!1;let d=u.active+l,f=l>0&&!u.ranges.some(p=>p.field==d+l);return o(a.update({selection:fieldSelection(u.ranges,d),effects:setActive.of(f?null:new ActiveSnippet(u.ranges,d)),scrollIntoView:!0})),!0}}const clearSnippet=({state:l,dispatch:a})=>l.field(snippetState,!1)?(a(l.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(l){return l.length?l[0]:defaultSnippetKeymap}}),addSnippetKeymap=Prec.highest(keymap.compute([snippetKeymap],l=>l.facet(snippetKeymap)));function snippetCompletion(l,a){return Object.assign(Object.assign({},a),{apply:snippet(l)})}const snippetPointerHandler=EditorView.domEventHandlers({mousedown(l,a){let o=a.state.field(snippetState,!1),u;if(!o||(u=a.posAtCoords({x:l.clientX,y:l.clientY}))==null)return!1;let d=o.ranges.find(f=>f.from<=u&&f.to>=u);return!d||d.field==o.active?!1:(a.dispatch({selection:fieldSelection(o.ranges,d.field),effects:setActive.of(o.ranges.some(f=>f.field>d.field)?new ActiveSnippet(o.ranges,d.field):null),scrollIntoView:!0}),!0)}}),defaults={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},closeBracketEffect=StateEffect.define({map(l,a){let o=a.mapPos(l,-1,MapMode.TrackAfter);return o??void 0}}),closedBracket=new class extends RangeValue{};closedBracket.startSide=1,closedBracket.endSide=-1;const bracketState=StateField.define({create(){return RangeSet.empty},update(l,a){if(l=l.map(a.changes),a.selection){let o=a.state.doc.lineAt(a.selection.main.head);l=l.update({filter:u=>u>=o.from&&u<=o.to})}for(let o of a.effects)o.is(closeBracketEffect)&&(l=l.update({add:[closedBracket.range(o.value,o.value+1)]}));return l}});function closeBrackets(){return[inputHandler,bracketState]}const definedClosing="()[]{}<>";function closing(l){for(let a=0;a<definedClosing.length;a+=2)if(definedClosing.charCodeAt(a)==l)return definedClosing.charAt(a+1);return fromCodePoint(l<128?l:l+1)}function config(l,a){return l.languageDataAt("closeBrackets",a)[0]||defaults}const android$1=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),inputHandler=EditorView.inputHandler.of((l,a,o,u)=>{if((android$1?l.composing:l.compositionStarted)||l.state.readOnly)return!1;let d=l.state.selection.main;if(u.length>2||u.length==2&&codePointSize(codePointAt(u,0))==1||a!=d.from||o!=d.to)return!1;let f=insertBracket(l.state,u);return f?(l.dispatch(f),!0):!1}),deleteBracketPair=({state:l,dispatch:a})=>{if(l.readOnly)return!1;let u=config(l,l.selection.main.head).brackets||defaults.brackets,d=null,f=l.changeByRange(p=>{if(p.empty){let g=prevChar(l.doc,p.head);for(let b of u)if(b==g&&nextChar(l.doc,p.head)==closing(codePointAt(b,0)))return{changes:{from:p.head-b.length,to:p.head+b.length},range:EditorSelection.cursor(p.head-b.length)}}return{range:d=p}});return d||a(l.update(f,{scrollIntoView:!0,userEvent:"delete.backward"})),!d};function insertBracket(l,a){let o=config(l,l.selection.main.head),u=o.brackets||defaults.brackets;for(let d of u){let f=closing(codePointAt(d,0));if(a==d)return f==d?handleSame(l,d,u.indexOf(d+d+d)>-1,o):handleOpen(l,d,f,o.before||defaults.before);if(a==f&&closedBracketAt(l,l.selection.main.from))return handleClose(l,d,f)}return null}function closedBracketAt(l,a){let o=!1;return l.field(bracketState).between(0,l.doc.length,u=>{u==a&&(o=!0)}),o}function nextChar(l,a){let o=l.sliceString(a,a+2);return o.slice(0,codePointSize(codePointAt(o,0)))}function prevChar(l,a){let o=l.sliceString(a-2,a);return codePointSize(codePointAt(o,0))==o.length?o:o.slice(1)}function handleOpen(l,a,o,u){let d=null,f=l.changeByRange(p=>{if(!p.empty)return{changes:[{insert:a,from:p.from},{insert:o,from:p.to}],effects:closeBracketEffect.of(p.to+a.length),range:EditorSelection.range(p.anchor+a.length,p.head+a.length)};let g=nextChar(l.doc,p.head);return!g||/\s/.test(g)||u.indexOf(g)>-1?{changes:{insert:a+o,from:p.head},effects:closeBracketEffect.of(p.head+a.length),range:EditorSelection.cursor(p.head+a.length)}:{range:d=p}});return d?null:l.update(f,{scrollIntoView:!0,userEvent:"input.type"})}function handleClose(l,a,o){let u=null,d=l.changeByRange(f=>f.empty&&nextChar(l.doc,f.head)==o?{changes:{from:f.head,to:f.head+o.length,insert:o},range:EditorSelection.cursor(f.head+o.length)}:u={range:f});return u?null:l.update(d,{scrollIntoView:!0,userEvent:"input.type"})}function handleSame(l,a,o,u){let d=u.stringPrefixes||defaults.stringPrefixes,f=null,p=l.changeByRange(g=>{if(!g.empty)return{changes:[{insert:a,from:g.from},{insert:a,from:g.to}],effects:closeBracketEffect.of(g.to+a.length),range:EditorSelection.range(g.anchor+a.length,g.head+a.length)};let b=g.head,O=nextChar(l.doc,b),S;if(O==a){if(nodeStart(l,b))return{changes:{insert:a+a,from:b},effects:closeBracketEffect.of(b+a.length),range:EditorSelection.cursor(b+a.length)};if(closedBracketAt(l,b)){let M=o&&l.sliceDoc(b,b+a.length*3)==a+a+a?a+a+a:a;return{changes:{from:b,to:b+M.length,insert:M},range:EditorSelection.cursor(b+M.length)}}}else{if(o&&l.sliceDoc(b-2*a.length,b)==a+a&&(S=canStartStringAt(l,b-2*a.length,d))>-1&&nodeStart(l,S))return{changes:{insert:a+a+a+a,from:b},effects:closeBracketEffect.of(b+a.length),range:EditorSelection.cursor(b+a.length)};if(l.charCategorizer(b)(O)!=CharCategory.Word&&canStartStringAt(l,b,d)>-1&&!probablyInString(l,b,a,d))return{changes:{insert:a+a,from:b},effects:closeBracketEffect.of(b+a.length),range:EditorSelection.cursor(b+a.length)}}return{range:f=g}});return f?null:l.update(p,{scrollIntoView:!0,userEvent:"input.type"})}function nodeStart(l,a){let o=syntaxTree(l).resolveInner(a+1);return o.parent&&o.from==a}function probablyInString(l,a,o,u){let d=syntaxTree(l).resolveInner(a,-1),f=u.reduce((p,g)=>Math.max(p,g.length),0);for(let p=0;p<5;p++){let g=l.sliceDoc(d.from,Math.min(d.to,d.from+o.length+f)),b=g.indexOf(o);if(!b||b>-1&&u.indexOf(g.slice(0,b))>-1){let S=d.firstChild;for(;S&&S.from==d.from&&S.to-S.from>o.length+b;){if(l.sliceDoc(S.to-o.length,S.to)==o)return!1;S=S.firstChild}return!0}let O=d.to==a&&d.parent;if(!O)break;d=O}return!1}function canStartStringAt(l,a,o){let u=l.charCategorizer(a);if(u(l.sliceDoc(a-1,a))!=CharCategory.Word)return a;for(let d of o){let f=a-d.length;if(l.sliceDoc(f,a)==d&&u(l.sliceDoc(f-1,f))!=CharCategory.Word)return f}return-1}function autocompletion(l={}){return[commitCharacters,completionState,completionConfig.of(l),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],l=>l.facet(completionConfig).defaultKeymap?[completionKeymap]:[]));function completionStatus(l){let a=l.field(completionState,!1);return a&&a.active.some(o=>o.isPending)?"pending":a&&a.active.some(o=>o.state!=0)?"active":null}const toggleComment=l=>{let{state:a}=l,o=a.doc.lineAt(a.selection.main.from),u=getConfig(l.state,o.from);return u.line?toggleLineComment(l):u.block?toggleBlockCommentByLine(l):!1};function command(l,a){return({state:o,dispatch:u})=>{if(o.readOnly)return!1;let d=l(a,o);return d?(u(o.update(d)),!0):!1}}const toggleLineComment=command(changeLineComment,0),lineComment=command(changeLineComment,1),lineUncomment=command(changeLineComment,2),toggleBlockComment=command(changeBlockComment,0),toggleBlockCommentByLine=command((l,a)=>changeBlockComment(l,a,selectedLineRanges(a)),0);function getConfig(l,a){let o=l.languageDataAt("commentTokens",a);return o.length?o[0]:{}}const SearchMargin=50;function findBlockComment(l,{open:a,close:o},u,d){let f=l.sliceDoc(u-SearchMargin,u),p=l.sliceDoc(d,d+SearchMargin),g=/\s*$/.exec(f)[0].length,b=/^\s*/.exec(p)[0].length,O=f.length-g;if(f.slice(O-a.length,O)==a&&p.slice(b,b+o.length)==o)return{open:{pos:u-g,margin:g&&1},close:{pos:d+b,margin:b&&1}};let S,A;d-u<=2*SearchMargin?S=A=l.sliceDoc(u,d):(S=l.sliceDoc(u,u+SearchMargin),A=l.sliceDoc(d-SearchMargin,d));let M=/^\s*/.exec(S)[0].length,E=/\s*$/.exec(A)[0].length,R=A.length-E-o.length;return S.slice(M,M+a.length)==a&&A.slice(R,R+o.length)==o?{open:{pos:u+M+a.length,margin:/\s/.test(S.charAt(M+a.length))?1:0},close:{pos:d-E-o.length,margin:/\s/.test(A.charAt(R-1))?1:0}}:null}function selectedLineRanges(l){let a=[];for(let o of l.selection.ranges){let u=l.doc.lineAt(o.from),d=o.to<=u.to?u:l.doc.lineAt(o.to);d.from>u.from&&d.from==o.to&&(d=o.to==u.to+1?u:l.doc.lineAt(o.to-1));let f=a.length-1;f>=0&&a[f].to>u.from?a[f].to=d.to:a.push({from:u.from+/^\s*/.exec(u.text)[0].length,to:d.to})}return a}function changeBlockComment(l,a,o=a.selection.ranges){let u=o.map(f=>getConfig(a,f.from).block);if(!u.every(f=>f))return null;let d=o.map((f,p)=>findBlockComment(a,u[p],f.from,f.to));if(l!=2&&!d.every(f=>f))return{changes:a.changes(o.map((f,p)=>d[p]?[]:[{from:f.from,insert:u[p].open+" "},{from:f.to,insert:" "+u[p].close}]))};if(l!=1&&d.some(f=>f)){let f=[];for(let p=0,g;p<d.length;p++)if(g=d[p]){let b=u[p],{open:O,close:S}=g;f.push({from:O.pos-b.open.length,to:O.pos+O.margin},{from:S.pos-S.margin,to:S.pos+b.close.length})}return{changes:f}}return null}function changeLineComment(l,a,o=a.selection.ranges){let u=[],d=-1;for(let{from:f,to:p}of o){let g=u.length,b=1e9,O=getConfig(a,f).line;if(O){for(let S=f;S<=p;){let A=a.doc.lineAt(S);if(A.from>d&&(f==p||p>A.from)){d=A.from;let M=/^\s*/.exec(A.text)[0].length,E=M==A.length,R=A.text.slice(M,M+O.length)==O?M:-1;M<A.text.length&&M<b&&(b=M),u.push({line:A,comment:R,token:O,indent:M,empty:E,single:!1})}S=A.to+1}if(b<1e9)for(let S=g;S<u.length;S++)u[S].indent<u[S].line.text.length&&(u[S].indent=b);u.length==g+1&&(u[g].single=!0)}}if(l!=2&&u.some(f=>f.comment<0&&(!f.empty||f.single))){let f=[];for(let{line:g,token:b,indent:O,empty:S,single:A}of u)(A||!S)&&f.push({from:g.from+O,insert:b+" "});let p=a.changes(f);return{changes:p,selection:a.selection.map(p,1)}}else if(l!=1&&u.some(f=>f.comment>=0)){let f=[];for(let{line:p,comment:g,token:b}of u)if(g>=0){let O=p.from+g,S=O+b.length;p.text[S-p.from]==" "&&S++,f.push({from:O,to:S})}return{changes:f}}return null}const fromHistory=Annotation.define(),isolateHistory=Annotation.define(),invertedEffects=Facet.define(),historyConfig=Facet.define({combine(l){return combineConfig(l,{minDepth:100,newGroupDelay:500,joinToEvent:(a,o)=>o},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(a,o)=>(u,d)=>a(u,d)||o(u,d)})}}),historyField_=StateField.define({create(){return HistoryState.empty},update(l,a){let o=a.state.facet(historyConfig),u=a.annotation(fromHistory);if(u){let b=HistEvent.fromTransaction(a,u.selection),O=u.side,S=O==0?l.undone:l.done;return b?S=updateBranch(S,S.length,o.minDepth,b):S=addSelection(S,a.startState.selection),new HistoryState(O==0?u.rest:S,O==0?S:u.rest)}let d=a.annotation(isolateHistory);if((d=="full"||d=="before")&&(l=l.isolate()),a.annotation(Transaction.addToHistory)===!1)return a.changes.empty?l:l.addMapping(a.changes.desc);let f=HistEvent.fromTransaction(a),p=a.annotation(Transaction.time),g=a.annotation(Transaction.userEvent);return f?l=l.addChanges(f,p,g,o,a):a.selection&&(l=l.addSelection(a.startState.selection,p,g,o.newGroupDelay)),(d=="full"||d=="after")&&(l=l.isolate()),l},toJSON(l){return{done:l.done.map(a=>a.toJSON()),undone:l.undone.map(a=>a.toJSON())}},fromJSON(l){return new HistoryState(l.done.map(HistEvent.fromJSON),l.undone.map(HistEvent.fromJSON))}});function history(l={}){return[historyField_,historyConfig.of(l),EditorView.domEventHandlers({beforeinput(a,o){let u=a.inputType=="historyUndo"?undo:a.inputType=="historyRedo"?redo:null;return u?(a.preventDefault(),u(o)):!1}})]}function cmd(l,a){return function({state:o,dispatch:u}){if(!a&&o.readOnly)return!1;let d=o.field(historyField_,!1);if(!d)return!1;let f=d.pop(l,o,a);return f?(u(f),!0):!1}}const undo=cmd(0,!1),redo=cmd(1,!1),undoSelection=cmd(0,!0),redoSelection=cmd(1,!0);class HistEvent{constructor(a,o,u,d,f){this.changes=a,this.effects=o,this.mapped=u,this.startSelection=d,this.selectionsAfter=f}setSelAfter(a){return new HistEvent(this.changes,this.effects,this.mapped,this.startSelection,a)}toJSON(){var a,o,u;return{changes:(a=this.changes)===null||a===void 0?void 0:a.toJSON(),mapped:(o=this.mapped)===null||o===void 0?void 0:o.toJSON(),startSelection:(u=this.startSelection)===null||u===void 0?void 0:u.toJSON(),selectionsAfter:this.selectionsAfter.map(d=>d.toJSON())}}static fromJSON(a){return new HistEvent(a.changes&&ChangeSet.fromJSON(a.changes),[],a.mapped&&ChangeDesc.fromJSON(a.mapped),a.startSelection&&EditorSelection.fromJSON(a.startSelection),a.selectionsAfter.map(EditorSelection.fromJSON))}static fromTransaction(a,o){let u=none;for(let d of a.startState.facet(invertedEffects)){let f=d(a);f.length&&(u=u.concat(f))}return!u.length&&a.changes.empty?null:new HistEvent(a.changes.invert(a.startState.doc),u,void 0,o||a.startState.selection,none)}static selection(a){return new HistEvent(void 0,none,void 0,void 0,a)}}function updateBranch(l,a,o,u){let d=a+1>o+20?a-o-1:0,f=l.slice(d,a);return f.push(u),f}function isAdjacent(l,a){let o=[],u=!1;return l.iterChangedRanges((d,f)=>o.push(d,f)),a.iterChangedRanges((d,f,p,g)=>{for(let b=0;b<o.length;){let O=o[b++],S=o[b++];g>=O&&p<=S&&(u=!0)}}),u}function eqSelectionShape(l,a){return l.ranges.length==a.ranges.length&&l.ranges.filter((o,u)=>o.empty!=a.ranges[u].empty).length===0}function conc(l,a){return l.length?a.length?l.concat(a):l:a}const none=[],MaxSelectionsPerEvent=200;function addSelection(l,a){if(l.length){let o=l[l.length-1],u=o.selectionsAfter.slice(Math.max(0,o.selectionsAfter.length-MaxSelectionsPerEvent));return u.length&&u[u.length-1].eq(a)?l:(u.push(a),updateBranch(l,l.length-1,1e9,o.setSelAfter(u)))}else return[HistEvent.selection([a])]}function popSelection(l){let a=l[l.length-1],o=l.slice();return o[l.length-1]=a.setSelAfter(a.selectionsAfter.slice(0,a.selectionsAfter.length-1)),o}function addMappingToBranch(l,a){if(!l.length)return l;let o=l.length,u=none;for(;o;){let d=mapEvent(l[o-1],a,u);if(d.changes&&!d.changes.empty||d.effects.length){let f=l.slice(0,o);return f[o-1]=d,f}else a=d.mapped,o--,u=d.selectionsAfter}return u.length?[HistEvent.selection(u)]:none}function mapEvent(l,a,o){let u=conc(l.selectionsAfter.length?l.selectionsAfter.map(g=>g.map(a)):none,o);if(!l.changes)return HistEvent.selection(u);let d=l.changes.map(a),f=a.mapDesc(l.changes,!0),p=l.mapped?l.mapped.composeDesc(f):f;return new HistEvent(d,StateEffect.mapEffects(l.effects,a),p,l.startSelection.map(f),u)}const joinableUserEvent=/^(input\.type|delete)($|\.)/;class HistoryState{constructor(a,o,u=0,d=void 0){this.done=a,this.undone=o,this.prevTime=u,this.prevUserEvent=d}isolate(){return this.prevTime?new HistoryState(this.done,this.undone):this}addChanges(a,o,u,d,f){let p=this.done,g=p[p.length-1];return g&&g.changes&&!g.changes.empty&&a.changes&&(!u||joinableUserEvent.test(u))&&(!g.selectionsAfter.length&&o-this.prevTime<d.newGroupDelay&&d.joinToEvent(f,isAdjacent(g.changes,a.changes))||u=="input.type.compose")?p=updateBranch(p,p.length-1,d.minDepth,new HistEvent(a.changes.compose(g.changes),conc(StateEffect.mapEffects(a.effects,g.changes),g.effects),g.mapped,g.startSelection,none)):p=updateBranch(p,p.length,d.minDepth,a),new HistoryState(p,none,o,u)}addSelection(a,o,u,d){let f=this.done.length?this.done[this.done.length-1].selectionsAfter:none;return f.length>0&&o-this.prevTime<d&&u==this.prevUserEvent&&u&&/^select($|\.)/.test(u)&&eqSelectionShape(f[f.length-1],a)?this:new HistoryState(addSelection(this.done,a),this.undone,o,u)}addMapping(a){return new HistoryState(addMappingToBranch(this.done,a),addMappingToBranch(this.undone,a),this.prevTime,this.prevUserEvent)}pop(a,o,u){let d=a==0?this.done:this.undone;if(d.length==0)return null;let f=d[d.length-1],p=f.selectionsAfter[0]||o.selection;if(u&&f.selectionsAfter.length)return o.update({selection:f.selectionsAfter[f.selectionsAfter.length-1],annotations:fromHistory.of({side:a,rest:popSelection(d),selection:p}),userEvent:a==0?"select.undo":"select.redo",scrollIntoView:!0});if(f.changes){let g=d.length==1?none:d.slice(0,d.length-1);return f.mapped&&(g=addMappingToBranch(g,f.mapped)),o.update({changes:f.changes,selection:f.startSelection,effects:f.effects,annotations:fromHistory.of({side:a,rest:g,selection:p}),filter:!1,userEvent:a==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(l,a){return EditorSelection.create(l.ranges.map(a),l.mainIndex)}function setSel(l,a){return l.update({selection:a,scrollIntoView:!0,userEvent:"select"})}function moveSel({state:l,dispatch:a},o){let u=updateSel(l.selection,o);return u.eq(l.selection,!0)?!1:(a(setSel(l,u)),!0)}function rangeEnd(l,a){return EditorSelection.cursor(a?l.to:l.from)}function cursorByChar(l,a){return moveSel(l,o=>o.empty?l.moveByChar(o,a):rangeEnd(o,a))}function ltrAtCursor(l){return l.textDirectionAt(l.state.selection.main.head)==Direction.LTR}const cursorCharLeft=l=>cursorByChar(l,!ltrAtCursor(l)),cursorCharRight=l=>cursorByChar(l,ltrAtCursor(l)),cursorCharBackward=l=>cursorByChar(l,!1);function cursorByGroup(l,a){return moveSel(l,o=>o.empty?l.moveByGroup(o,a):rangeEnd(o,a))}const cursorGroupLeft=l=>cursorByGroup(l,!ltrAtCursor(l)),cursorGroupRight=l=>cursorByGroup(l,ltrAtCursor(l));function interestingNode(l,a,o){if(a.type.prop(o))return!0;let u=a.to-a.from;return u&&(u>2||/[^\s,.;:]/.test(l.sliceDoc(a.from,a.to)))||a.firstChild}function moveBySyntax(l,a,o){let u=syntaxTree(l).resolveInner(a.head),d=o?NodeProp.closedBy:NodeProp.openedBy;for(let b=a.head;;){let O=o?u.childAfter(b):u.childBefore(b);if(!O)break;interestingNode(l,O,d)?u=O:b=o?O.to:O.from}let f=u.type.prop(d),p,g;return f&&(p=o?matchBrackets(l,u.from,1):matchBrackets(l,u.to,-1))&&p.matched?g=o?p.end.to:p.end.from:g=o?u.to:u.from,EditorSelection.cursor(g,o?-1:1)}const cursorSyntaxLeft=l=>moveSel(l,a=>moveBySyntax(l.state,a,!ltrAtCursor(l))),cursorSyntaxRight=l=>moveSel(l,a=>moveBySyntax(l.state,a,ltrAtCursor(l)));function cursorByLine(l,a){return moveSel(l,o=>{if(!o.empty)return rangeEnd(o,a);let u=l.moveVertically(o,a);return u.head!=o.head?u:l.moveToLineBoundary(o,a)})}const cursorLineUp=l=>cursorByLine(l,!1),cursorLineDown=l=>cursorByLine(l,!0);function pageInfo(l){let a=l.scrollDOM.clientHeight<l.scrollDOM.scrollHeight-2,o=0,u=0,d;if(a){for(let f of l.state.facet(EditorView.scrollMargins)){let p=f(l);p?.top&&(o=Math.max(p?.top,o)),p?.bottom&&(u=Math.max(p?.bottom,u))}d=l.scrollDOM.clientHeight-o-u}else d=(l.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:o,marginBottom:u,selfScroll:a,height:Math.max(l.defaultLineHeight,d-5)}}function cursorByPage(l,a){let o=pageInfo(l),{state:u}=l,d=updateSel(u.selection,p=>p.empty?l.moveVertically(p,a,o.height):rangeEnd(p,a));if(d.eq(u.selection))return!1;let f;if(o.selfScroll){let p=l.coordsAtPos(u.selection.main.head),g=l.scrollDOM.getBoundingClientRect(),b=g.top+o.marginTop,O=g.bottom-o.marginBottom;p&&p.top>b&&p.bottom<O&&(f=EditorView.scrollIntoView(d.main.head,{y:"start",yMargin:p.top-b}))}return l.dispatch(setSel(u,d),{effects:f}),!0}const cursorPageUp=l=>cursorByPage(l,!1),cursorPageDown=l=>cursorByPage(l,!0);function moveByLineBoundary(l,a,o){let u=l.lineBlockAt(a.head),d=l.moveToLineBoundary(a,o);if(d.head==a.head&&d.head!=(o?u.to:u.from)&&(d=l.moveToLineBoundary(a,o,!1)),!o&&d.head==u.from&&u.length){let f=/^\s*/.exec(l.state.sliceDoc(u.from,Math.min(u.from+100,u.to)))[0].length;f&&a.head!=u.from+f&&(d=EditorSelection.cursor(u.from+f))}return d}const cursorLineBoundaryForward=l=>moveSel(l,a=>moveByLineBoundary(l,a,!0)),cursorLineBoundaryBackward=l=>moveSel(l,a=>moveByLineBoundary(l,a,!1)),cursorLineBoundaryLeft=l=>moveSel(l,a=>moveByLineBoundary(l,a,!ltrAtCursor(l))),cursorLineBoundaryRight=l=>moveSel(l,a=>moveByLineBoundary(l,a,ltrAtCursor(l))),cursorLineStart=l=>moveSel(l,a=>EditorSelection.cursor(l.lineBlockAt(a.head).from,1)),cursorLineEnd=l=>moveSel(l,a=>EditorSelection.cursor(l.lineBlockAt(a.head).to,-1));function toMatchingBracket(l,a,o){let u=!1,d=updateSel(l.selection,f=>{let p=matchBrackets(l,f.head,-1)||matchBrackets(l,f.head,1)||f.head>0&&matchBrackets(l,f.head-1,1)||f.head<l.doc.length&&matchBrackets(l,f.head+1,-1);if(!p||!p.end)return f;u=!0;let g=p.start.from==f.head?p.end.to:p.end.from;return EditorSelection.cursor(g)});return u?(a(setSel(l,d)),!0):!1}const cursorMatchingBracket=({state:l,dispatch:a})=>toMatchingBracket(l,a);function extendSel(l,a){let o=updateSel(l.state.selection,u=>{let d=a(u);return EditorSelection.range(u.anchor,d.head,d.goalColumn,d.bidiLevel||void 0)});return o.eq(l.state.selection)?!1:(l.dispatch(setSel(l.state,o)),!0)}function selectByChar(l,a){return extendSel(l,o=>l.moveByChar(o,a))}const selectCharLeft=l=>selectByChar(l,!ltrAtCursor(l)),selectCharRight=l=>selectByChar(l,ltrAtCursor(l));function selectByGroup(l,a){return extendSel(l,o=>l.moveByGroup(o,a))}const selectGroupLeft=l=>selectByGroup(l,!ltrAtCursor(l)),selectGroupRight=l=>selectByGroup(l,ltrAtCursor(l)),selectSyntaxLeft=l=>extendSel(l,a=>moveBySyntax(l.state,a,!ltrAtCursor(l))),selectSyntaxRight=l=>extendSel(l,a=>moveBySyntax(l.state,a,ltrAtCursor(l)));function selectByLine(l,a){return extendSel(l,o=>l.moveVertically(o,a))}const selectLineUp=l=>selectByLine(l,!1),selectLineDown=l=>selectByLine(l,!0);function selectByPage(l,a){return extendSel(l,o=>l.moveVertically(o,a,pageInfo(l).height))}const selectPageUp=l=>selectByPage(l,!1),selectPageDown=l=>selectByPage(l,!0),selectLineBoundaryForward=l=>extendSel(l,a=>moveByLineBoundary(l,a,!0)),selectLineBoundaryBackward=l=>extendSel(l,a=>moveByLineBoundary(l,a,!1)),selectLineBoundaryLeft=l=>extendSel(l,a=>moveByLineBoundary(l,a,!ltrAtCursor(l))),selectLineBoundaryRight=l=>extendSel(l,a=>moveByLineBoundary(l,a,ltrAtCursor(l))),selectLineStart=l=>extendSel(l,a=>EditorSelection.cursor(l.lineBlockAt(a.head).from)),selectLineEnd=l=>extendSel(l,a=>EditorSelection.cursor(l.lineBlockAt(a.head).to)),cursorDocStart=({state:l,dispatch:a})=>(a(setSel(l,{anchor:0})),!0),cursorDocEnd=({state:l,dispatch:a})=>(a(setSel(l,{anchor:l.doc.length})),!0),selectDocStart=({state:l,dispatch:a})=>(a(setSel(l,{anchor:l.selection.main.anchor,head:0})),!0),selectDocEnd=({state:l,dispatch:a})=>(a(setSel(l,{anchor:l.selection.main.anchor,head:l.doc.length})),!0),selectAll=({state:l,dispatch:a})=>(a(l.update({selection:{anchor:0,head:l.doc.length},userEvent:"select"})),!0),selectLine=({state:l,dispatch:a})=>{let o=selectedLineBlocks(l).map(({from:u,to:d})=>EditorSelection.range(u,Math.min(d+1,l.doc.length)));return a(l.update({selection:EditorSelection.create(o),userEvent:"select"})),!0},selectParentSyntax=({state:l,dispatch:a})=>{let o=updateSel(l.selection,u=>{let d=syntaxTree(l),f=d.resolveStack(u.from,1);if(u.empty){let p=d.resolveStack(u.from,-1);p.node.from>=f.node.from&&p.node.to<=f.node.to&&(f=p)}for(let p=f;p;p=p.next){let{node:g}=p;if((g.from<u.from&&g.to>=u.to||g.to>u.to&&g.from<=u.from)&&p.next)return EditorSelection.range(g.to,g.from)}return u});return o.eq(l.selection)?!1:(a(setSel(l,o)),!0)},simplifySelection=({state:l,dispatch:a})=>{let o=l.selection,u=null;return o.ranges.length>1?u=EditorSelection.create([o.main]):o.main.empty||(u=EditorSelection.create([EditorSelection.cursor(o.main.head)])),u?(a(setSel(l,u)),!0):!1};function deleteBy(l,a){if(l.state.readOnly)return!1;let o="delete.selection",{state:u}=l,d=u.changeByRange(f=>{let{from:p,to:g}=f;if(p==g){let b=a(f);b<p?(o="delete.backward",b=skipAtomic(l,b,!1)):b>p&&(o="delete.forward",b=skipAtomic(l,b,!0)),p=Math.min(p,b),g=Math.max(g,b)}else p=skipAtomic(l,p,!1),g=skipAtomic(l,g,!0);return p==g?{range:f}:{changes:{from:p,to:g},range:EditorSelection.cursor(p,p<f.head?-1:1)}});return d.changes.empty?!1:(l.dispatch(u.update(d,{scrollIntoView:!0,userEvent:o,effects:o=="delete.selection"?EditorView.announce.of(u.phrase("Selection deleted")):void 0})),!0)}function skipAtomic(l,a,o){if(l instanceof EditorView)for(let u of l.state.facet(EditorView.atomicRanges).map(d=>d(l)))u.between(a,a,(d,f)=>{d<a&&f>a&&(a=o?f:d)});return a}const deleteByChar=(l,a,o)=>deleteBy(l,u=>{let d=u.from,{state:f}=l,p=f.doc.lineAt(d),g,b;if(o&&!a&&d>p.from&&d<p.from+200&&!/[^ \t]/.test(g=p.text.slice(0,d-p.from))){if(g[g.length-1]==" ")return d-1;let O=countColumn(g,f.tabSize),S=O%getIndentUnit(f)||getIndentUnit(f);for(let A=0;A<S&&g[g.length-1-A]==" ";A++)d--;b=d}else b=findClusterBreak(p.text,d-p.from,a,a)+p.from,b==d&&p.number!=(a?f.doc.lines:1)?b+=a?1:-1:!a&&/[\ufe00-\ufe0f]/.test(p.text.slice(b-p.from,d-p.from))&&(b=findClusterBreak(p.text,b-p.from,!1,!1)+p.from);return b}),deleteCharBackward=l=>deleteByChar(l,!1,!0),deleteCharForward=l=>deleteByChar(l,!0,!1),deleteByGroup=(l,a)=>deleteBy(l,o=>{let u=o.head,{state:d}=l,f=d.doc.lineAt(u),p=d.charCategorizer(u);for(let g=null;;){if(u==(a?f.to:f.from)){u==o.head&&f.number!=(a?d.doc.lines:1)&&(u+=a?1:-1);break}let b=findClusterBreak(f.text,u-f.from,a)+f.from,O=f.text.slice(Math.min(u,b)-f.from,Math.max(u,b)-f.from),S=p(O);if(g!=null&&S!=g)break;(O!=" "||u!=o.head)&&(g=S),u=b}return u}),deleteGroupBackward=l=>deleteByGroup(l,!1),deleteGroupForward=l=>deleteByGroup(l,!0),deleteToLineEnd=l=>deleteBy(l,a=>{let o=l.lineBlockAt(a.head).to;return a.head<o?o:Math.min(l.state.doc.length,a.head+1)}),deleteToLineStart=l=>deleteBy(l,a=>{let o=l.lineBlockAt(a.head).from;return a.head>o?o:Math.max(0,a.head-1)}),deleteLineBoundaryBackward=l=>deleteBy(l,a=>{let o=l.moveToLineBoundary(a,!1).head;return a.head>o?o:Math.max(0,a.head-1)}),deleteLineBoundaryForward=l=>deleteBy(l,a=>{let o=l.moveToLineBoundary(a,!0).head;return a.head<o?o:Math.min(l.state.doc.length,a.head+1)}),splitLine=({state:l,dispatch:a})=>{if(l.readOnly)return!1;let o=l.changeByRange(u=>({changes:{from:u.from,to:u.to,insert:Text.of(["",""])},range:EditorSelection.cursor(u.from)}));return a(l.update(o,{scrollIntoView:!0,userEvent:"input"})),!0},transposeChars=({state:l,dispatch:a})=>{if(l.readOnly)return!1;let o=l.changeByRange(u=>{if(!u.empty||u.from==0||u.from==l.doc.length)return{range:u};let d=u.from,f=l.doc.lineAt(d),p=d==f.from?d-1:findClusterBreak(f.text,d-f.from,!1)+f.from,g=d==f.to?d+1:findClusterBreak(f.text,d-f.from,!0)+f.from;return{changes:{from:p,to:g,insert:l.doc.slice(d,g).append(l.doc.slice(p,d))},range:EditorSelection.cursor(g)}});return o.changes.empty?!1:(a(l.update(o,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function selectedLineBlocks(l){let a=[],o=-1;for(let u of l.selection.ranges){let d=l.doc.lineAt(u.from),f=l.doc.lineAt(u.to);if(!u.empty&&u.to==f.from&&(f=l.doc.lineAt(u.to-1)),o>=d.number){let p=a[a.length-1];p.to=f.to,p.ranges.push(u)}else a.push({from:d.from,to:f.to,ranges:[u]});o=f.number+1}return a}function moveLine(l,a,o){if(l.readOnly)return!1;let u=[],d=[];for(let f of selectedLineBlocks(l)){if(o?f.to==l.doc.length:f.from==0)continue;let p=l.doc.lineAt(o?f.to+1:f.from-1),g=p.length+1;if(o){u.push({from:f.to,to:p.to},{from:f.from,insert:p.text+l.lineBreak});for(let b of f.ranges)d.push(EditorSelection.range(Math.min(l.doc.length,b.anchor+g),Math.min(l.doc.length,b.head+g)))}else{u.push({from:p.from,to:f.from},{from:f.to,insert:l.lineBreak+p.text});for(let b of f.ranges)d.push(EditorSelection.range(b.anchor-g,b.head-g))}}return u.length?(a(l.update({changes:u,scrollIntoView:!0,selection:EditorSelection.create(d,l.selection.mainIndex),userEvent:"move.line"})),!0):!1}const moveLineUp=({state:l,dispatch:a})=>moveLine(l,a,!1),moveLineDown=({state:l,dispatch:a})=>moveLine(l,a,!0);function copyLine(l,a,o){if(l.readOnly)return!1;let u=[];for(let d of selectedLineBlocks(l))o?u.push({from:d.from,insert:l.doc.slice(d.from,d.to)+l.lineBreak}):u.push({from:d.to,insert:l.lineBreak+l.doc.slice(d.from,d.to)});return a(l.update({changes:u,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const copyLineUp=({state:l,dispatch:a})=>copyLine(l,a,!1),copyLineDown=({state:l,dispatch:a})=>copyLine(l,a,!0),deleteLine=l=>{if(l.state.readOnly)return!1;let{state:a}=l,o=a.changes(selectedLineBlocks(a).map(({from:d,to:f})=>(d>0?d--:f<a.doc.length&&f++,{from:d,to:f}))),u=updateSel(a.selection,d=>{let f;if(l.lineWrapping){let p=l.lineBlockAt(d.head),g=l.coordsAtPos(d.head,d.assoc||1);g&&(f=p.bottom+l.documentTop-g.bottom+l.defaultLineHeight/2)}return l.moveVertically(d,!0,f)}).map(o);return l.dispatch({changes:o,selection:u,scrollIntoView:!0,userEvent:"delete.line"}),!0};function isBetweenBrackets(l,a){if(/\(\)|\[\]|\{\}/.test(l.sliceDoc(a-1,a+1)))return{from:a,to:a};let o=syntaxTree(l).resolveInner(a),u=o.childBefore(a),d=o.childAfter(a),f;return u&&d&&u.to<=a&&d.from>=a&&(f=u.type.prop(NodeProp.closedBy))&&f.indexOf(d.name)>-1&&l.doc.lineAt(u.to).from==l.doc.lineAt(d.from).from&&!/\S/.test(l.sliceDoc(u.to,d.from))?{from:u.to,to:d.from}:null}const insertNewlineAndIndent=newlineAndIndent(!1),insertBlankLine=newlineAndIndent(!0);function newlineAndIndent(l){return({state:a,dispatch:o})=>{if(a.readOnly)return!1;let u=a.changeByRange(d=>{let{from:f,to:p}=d,g=a.doc.lineAt(f),b=!l&&f==p&&isBetweenBrackets(a,f);l&&(f=p=(p<=g.to?g:a.doc.lineAt(p)).to);let O=new IndentContext(a,{simulateBreak:f,simulateDoubleBreak:!!b}),S=getIndentation(O,f);for(S==null&&(S=countColumn(/^\s*/.exec(a.doc.lineAt(f).text)[0],a.tabSize));p<g.to&&/\s/.test(g.text[p-g.from]);)p++;b?{from:f,to:p}=b:f>g.from&&f<g.from+100&&!/\S/.test(g.text.slice(0,f))&&(f=g.from);let A=["",indentString(a,S)];return b&&A.push(indentString(a,O.lineIndent(g.from,-1))),{changes:{from:f,to:p,insert:Text.of(A)},range:EditorSelection.cursor(f+1+A[1].length)}});return o(a.update(u,{scrollIntoView:!0,userEvent:"input"})),!0}}function changeBySelectedLine(l,a){let o=-1;return l.changeByRange(u=>{let d=[];for(let p=u.from;p<=u.to;){let g=l.doc.lineAt(p);g.number>o&&(u.empty||u.to>g.from)&&(a(g,d,u),o=g.number),p=g.to+1}let f=l.changes(d);return{changes:d,range:EditorSelection.range(f.mapPos(u.anchor,1),f.mapPos(u.head,1))}})}const indentSelection=({state:l,dispatch:a})=>{if(l.readOnly)return!1;let o=Object.create(null),u=new IndentContext(l,{overrideIndentation:f=>{let p=o[f];return p??-1}}),d=changeBySelectedLine(l,(f,p,g)=>{let b=getIndentation(u,f.from);if(b==null)return;/\S/.test(f.text)||(b=0);let O=/^\s*/.exec(f.text)[0],S=indentString(l,b);(O!=S||g.from<f.from+O.length)&&(o[f.from]=b,p.push({from:f.from,to:f.from+O.length,insert:S}))});return d.changes.empty||a(l.update(d,{userEvent:"indent"})),!0},indentMore=({state:l,dispatch:a})=>l.readOnly?!1:(a(l.update(changeBySelectedLine(l,(o,u)=>{u.push({from:o.from,insert:l.facet(indentUnit)})}),{userEvent:"input.indent"})),!0),indentLess=({state:l,dispatch:a})=>l.readOnly?!1:(a(l.update(changeBySelectedLine(l,(o,u)=>{let d=/^\s*/.exec(o.text)[0];if(!d)return;let f=countColumn(d,l.tabSize),p=0,g=indentString(l,Math.max(0,f-getIndentUnit(l)));for(;p<d.length&&p<g.length&&d.charCodeAt(p)==g.charCodeAt(p);)p++;u.push({from:o.from+p,to:o.from+d.length,insert:g.slice(p)})}),{userEvent:"delete.dedent"})),!0),toggleTabFocusMode=l=>(l.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(l=>({mac:l.key,run:l.run,shift:l.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(a,o,u,d,f,p,g,b,O,S=0,A){this.p=a,this.stack=o,this.state=u,this.reducePos=d,this.pos=f,this.score=p,this.buffer=g,this.bufferBase=b,this.curContext=O,this.lookAhead=S,this.parent=A}toString(){return`[${this.stack.filter((a,o)=>o%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(a,o,u=0){let d=a.parser.context;return new Stack(a,[],o,u,u,0,[],0,d?new StackContext(d,d.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(a,o){this.stack.push(this.state,o,this.bufferBase+this.buffer.length),this.state=a}reduce(a){var o;let u=a>>19,d=a&65535,{parser:f}=this.p,p=this.reducePos<this.pos-25;p&&this.setLookAhead(this.pos);let g=f.dynamicPrecedence(d);if(g&&(this.score+=g),u==0){this.pushState(f.getGoto(this.state,d,!0),this.reducePos),d<f.minRepeatTerm&&this.storeNode(d,this.reducePos,this.reducePos,p?8:4,!0),this.reduceContext(d,this.reducePos);return}let b=this.stack.length-(u-1)*3-(a&262144?6:0),O=b?this.stack[b-2]:this.p.ranges[0].from,S=this.reducePos-O;S>=2e3&&!(!((o=this.p.parser.nodeSet.types[d])===null||o===void 0)&&o.isAnonymous)&&(O==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=S):this.p.lastBigReductionSize<S&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=O,this.p.lastBigReductionSize=S));let A=b?this.stack[b-1]:0,M=this.bufferBase+this.buffer.length-A;if(d<f.minRepeatTerm||a&131072){let E=f.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(d,O,E,M+4,!0)}if(a&262144)this.state=this.stack[b];else{let E=this.stack[b-3];this.state=f.getGoto(E,d,!0)}for(;this.stack.length>b;)this.stack.pop();this.reduceContext(d,O)}storeNode(a,o,u,d=4,f=!1){if(a==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let p=this,g=this.buffer.length;if(g==0&&p.parent&&(g=p.bufferBase-p.parent.bufferBase,p=p.parent),g>0&&p.buffer[g-4]==0&&p.buffer[g-1]>-1){if(o==u)return;if(p.buffer[g-2]>=o){p.buffer[g-2]=u;return}}}if(!f||this.pos==u)this.buffer.push(a,o,u,d);else{let p=this.buffer.length;if(p>0&&this.buffer[p-4]!=0){let g=!1;for(let b=p;b>0&&this.buffer[b-2]>u;b-=4)if(this.buffer[b-1]>=0){g=!0;break}if(g)for(;p>0&&this.buffer[p-2]>u;)this.buffer[p]=this.buffer[p-4],this.buffer[p+1]=this.buffer[p-3],this.buffer[p+2]=this.buffer[p-2],this.buffer[p+3]=this.buffer[p-1],p-=4,d>4&&(d-=4)}this.buffer[p]=a,this.buffer[p+1]=o,this.buffer[p+2]=u,this.buffer[p+3]=d}}shift(a,o,u,d){if(a&131072)this.pushState(a&65535,this.pos);else if(a&262144)this.pos=d,this.shiftContext(o,u),o<=this.p.parser.maxNode&&this.buffer.push(o,u,d,4);else{let f=a,{parser:p}=this.p;(d>this.pos||o<=p.maxNode)&&(this.pos=d,p.stateFlag(f,1)||(this.reducePos=d)),this.pushState(f,u),this.shiftContext(o,u),o<=p.maxNode&&this.buffer.push(o,u,d,4)}}apply(a,o,u,d){a&65536?this.reduce(a):this.shift(a,o,u,d)}useNode(a,o){let u=this.p.reused.length-1;(u<0||this.p.reused[u]!=a)&&(this.p.reused.push(a),u++);let d=this.pos;this.reducePos=this.pos=d+a.length,this.pushState(o,d),this.buffer.push(u,d,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,a,this,this.p.stream.reset(this.pos-a.length)))}split(){let a=this,o=a.buffer.length;for(;o>0&&a.buffer[o-2]>a.reducePos;)o-=4;let u=a.buffer.slice(o),d=a.bufferBase+o;for(;a&&d==a.bufferBase;)a=a.parent;return new Stack(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,u,d,this.curContext,this.lookAhead,a)}recoverByDelete(a,o){let u=a<=this.p.parser.maxNode;u&&this.storeNode(a,this.pos,o,4),this.storeNode(0,this.pos,o,u?8:4),this.pos=this.reducePos=o,this.score-=190}canShift(a){for(let o=new SimulatedStack(this);;){let u=this.p.parser.stateSlot(o.state,4)||this.p.parser.hasAction(o.state,a);if(u==0)return!1;if(!(u&65536))return!0;o.reduce(u)}}recoverByInsert(a){if(this.stack.length>=300)return[];let o=this.p.parser.nextStates(this.state);if(o.length>8||this.stack.length>=120){let d=[];for(let f=0,p;f<o.length;f+=2)(p=o[f+1])!=this.state&&this.p.parser.hasAction(p,a)&&d.push(o[f],p);if(this.stack.length<120)for(let f=0;d.length<8&&f<o.length;f+=2){let p=o[f+1];d.some((g,b)=>b&1&&g==p)||d.push(o[f],p)}o=d}let u=[];for(let d=0;d<o.length&&u.length<4;d+=2){let f=o[d+1];if(f==this.state)continue;let p=this.split();p.pushState(f,this.pos),p.storeNode(0,p.pos,p.pos,4,!0),p.shiftContext(o[d],this.pos),p.reducePos=this.pos,p.score-=200,u.push(p)}return u}forceReduce(){let{parser:a}=this.p,o=a.stateSlot(this.state,5);if(!(o&65536))return!1;if(!a.validAction(this.state,o)){let u=o>>19,d=o&65535,f=this.stack.length-u*3;if(f<0||a.getGoto(this.stack[f],d,!1)<0){let p=this.findForcedReduction();if(p==null)return!1;o=p}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(o),!0}findForcedReduction(){let{parser:a}=this.p,o=[],u=(d,f)=>{if(!o.includes(d))return o.push(d),a.allActions(d,p=>{if(!(p&393216))if(p&65536){let g=(p>>19)-f;if(g>1){let b=p&65535,O=this.stack.length-g*3;if(O>=0&&a.getGoto(this.stack[O],b,!1)>=0)return g<<19|65536|b}}else{let g=u(p,f+1);if(g!=null)return g}})};return u(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:a}=this.p;return a.data[a.stateSlot(this.state,1)]==65535&&!a.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(a){if(this.state!=a.state||this.stack.length!=a.stack.length)return!1;for(let o=0;o<this.stack.length;o+=3)if(this.stack[o]!=a.stack[o])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(a){return this.p.parser.dialect.flags[a]}shiftContext(a,o){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,a,this,this.p.stream.reset(o)))}reduceContext(a,o){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,a,this,this.p.stream.reset(o)))}emitContext(){let a=this.buffer.length-1;(a<0||this.buffer[a]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let a=this.buffer.length-1;(a<0||this.buffer[a]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(a){if(a!=this.curContext.context){let o=new StackContext(this.curContext.tracker,a);o.hash!=this.curContext.hash&&this.emitContext(),this.curContext=o}}setLookAhead(a){a>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=a)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class StackContext{constructor(a,o){this.tracker=a,this.context=o,this.hash=a.strict?a.hash(o):0}}class SimulatedStack{constructor(a){this.start=a,this.state=a.state,this.stack=a.stack,this.base=this.stack.length}reduce(a){let o=a&65535,u=a>>19;u==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(u-1)*3;let d=this.start.p.parser.getGoto(this.stack[this.base-3],o,!0);this.state=d}}class StackBufferCursor{constructor(a,o,u){this.stack=a,this.pos=o,this.index=u,this.buffer=a.buffer,this.index==0&&this.maybeNext()}static create(a,o=a.bufferBase+a.buffer.length){return new StackBufferCursor(a,o,o-a.bufferBase)}maybeNext(){let a=this.stack.parent;a!=null&&(this.index=this.stack.bufferBase-a.bufferBase,this.stack=a,this.buffer=a.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(l,a=Uint16Array){if(typeof l!="string")return l;let o=null;for(let u=0,d=0;u<l.length;){let f=0;for(;;){let p=l.charCodeAt(u++),g=!1;if(p==126){f=65535;break}p>=92&&p--,p>=34&&p--;let b=p-32;if(b>=46&&(b-=46,g=!0),f+=b,g)break;f*=46}o?o[d++]=f:o=new a(f)}return o}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(a,o){this.input=a,this.ranges=o,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=nullToken,this.rangeIndex=0,this.pos=this.chunkPos=o[0].from,this.range=o[0],this.end=o[o.length-1].to,this.readNext()}resolveOffset(a,o){let u=this.range,d=this.rangeIndex,f=this.pos+a;for(;f<u.from;){if(!d)return null;let p=this.ranges[--d];f-=u.from-p.to,u=p}for(;o<0?f>u.to:f>=u.to;){if(d==this.ranges.length-1)return null;let p=this.ranges[++d];f+=p.from-u.to,u=p}return f}clipPos(a){if(a>=this.range.from&&a<this.range.to)return a;for(let o of this.ranges)if(o.to>a)return Math.max(a,o.from);return this.end}peek(a){let o=this.chunkOff+a,u,d;if(o>=0&&o<this.chunk.length)u=this.pos+a,d=this.chunk.charCodeAt(o);else{let f=this.resolveOffset(a,1);if(f==null)return-1;if(u=f,u>=this.chunk2Pos&&u<this.chunk2Pos+this.chunk2.length)d=this.chunk2.charCodeAt(u-this.chunk2Pos);else{let p=this.rangeIndex,g=this.range;for(;g.to<=u;)g=this.ranges[++p];this.chunk2=this.input.chunk(this.chunk2Pos=u),u+this.chunk2.length>g.to&&(this.chunk2=this.chunk2.slice(0,g.to-u)),d=this.chunk2.charCodeAt(0)}}return u>=this.token.lookAhead&&(this.token.lookAhead=u+1),d}acceptToken(a,o=0){let u=o?this.resolveOffset(o,-1):this.pos;if(u==null||u<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=a,this.token.end=u}acceptTokenTo(a,o){this.token.value=a,this.token.end=o}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:a,chunkPos:o}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=a,this.chunk2Pos=o,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let a=this.input.chunk(this.pos),o=this.pos+a.length;this.chunk=o>this.range.to?a.slice(0,this.range.to-this.pos):a,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(a=1){for(this.chunkOff+=a;this.pos+a>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();a-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=a,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(a,o){if(o?(this.token=o,o.start=a,o.lookAhead=a+1,o.value=o.extended=-1):this.token=nullToken,this.pos!=a){if(this.pos=a,a==this.end)return this.setDone(),this;for(;a<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;a>=this.range.to;)this.range=this.ranges[++this.rangeIndex];a>=this.chunkPos&&a<this.chunkPos+this.chunk.length?this.chunkOff=a-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(a,o){if(a>=this.chunkPos&&o<=this.chunkPos+this.chunk.length)return this.chunk.slice(a-this.chunkPos,o-this.chunkPos);if(a>=this.chunk2Pos&&o<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(a-this.chunk2Pos,o-this.chunk2Pos);if(a>=this.range.from&&o<=this.range.to)return this.input.read(a,o);let u="";for(let d of this.ranges){if(d.from>=o)break;d.to>a&&(u+=this.input.read(Math.max(d.from,a),Math.min(d.to,o)))}return u}}class TokenGroup{constructor(a,o){this.data=a,this.id=o}token(a,o){let{parser:u}=o.p;readToken(this.data,a,o,this.id,u.data,u.tokenPrecTable)}}TokenGroup.prototype.contextual=TokenGroup.prototype.fallback=TokenGroup.prototype.extend=!1;class LocalTokenGroup{constructor(a,o,u){this.precTable=o,this.elseToken=u,this.data=typeof a=="string"?decodeArray(a):a}token(a,o){let u=a.pos,d=0;for(;;){let f=a.next<0,p=a.resolveOffset(1,1);if(readToken(this.data,a,o,0,this.data,this.precTable),a.token.value>-1)break;if(this.elseToken==null)return;if(f||d++,p==null)break;a.reset(p,a.token)}d&&(a.reset(u,a.token),a.acceptToken(this.elseToken,d))}}LocalTokenGroup.prototype.contextual=TokenGroup.prototype.fallback=TokenGroup.prototype.extend=!1;class ExternalTokenizer{constructor(a,o={}){this.token=a,this.contextual=!!o.contextual,this.fallback=!!o.fallback,this.extend=!!o.extend}}function readToken(l,a,o,u,d,f){let p=0,g=1<<u,{dialect:b}=o.p.parser;e:for(;g&l[p];){let O=l[p+1];for(let E=p+3;E<O;E+=2)if((l[E+1]&g)>0){let R=l[E];if(b.allows(R)&&(a.token.value==-1||a.token.value==R||overrides(R,a.token.value,d,f))){a.acceptToken(R);break}}let S=a.next,A=0,M=l[p+2];if(a.next<0&&M>A&&l[O+M*3-3]==65535){p=l[O+M*3-1];continue e}for(;A<M;){let E=A+M>>1,R=O+E+(E<<1),L=l[R],U=l[R+1]||65536;if(S<L)M=E;else if(S>=U)A=E+1;else{p=l[R+2],a.advance();continue e}}break}}function findOffset(l,a,o){for(let u=a,d;(d=l[u])!=65535;u++)if(d==o)return u-a;return-1}function overrides(l,a,o,u){let d=findOffset(o,u,a);return d<0||findOffset(o,u,l)<d}const verbose=typeof process<"u"&&process.env&&/\bparse\b/.test(process.env.LOG);let stackIDs=null;function cutAt(l,a,o){let u=l.cursor(IterMode.IncludeAnonymous);for(u.moveTo(a);;)if(!(o<0?u.childBefore(a):u.childAfter(a)))for(;;){if((o<0?u.to<a:u.from>a)&&!u.type.isError)return o<0?Math.max(0,Math.min(u.to-1,a-25)):Math.min(l.length,Math.max(u.from+1,a+25));if(o<0?u.prevSibling():u.nextSibling())break;if(!u.parent())return o<0?0:l.length}}class FragmentCursor{constructor(a,o){this.fragments=a,this.nodeSet=o,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let a=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(a){for(this.safeFrom=a.openStart?cutAt(a.tree,a.from+a.offset,1)-a.offset:a.from,this.safeTo=a.openEnd?cutAt(a.tree,a.to+a.offset,-1)-a.offset:a.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(a.tree),this.start.push(-a.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(a){if(a<this.nextStart)return null;for(;this.fragment&&this.safeTo<=a;)this.nextFragment();if(!this.fragment)return null;for(;;){let o=this.trees.length-1;if(o<0)return this.nextFragment(),null;let u=this.trees[o],d=this.index[o];if(d==u.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let f=u.children[d],p=this.start[o]+u.positions[d];if(p>a)return this.nextStart=p,null;if(f instanceof Tree){if(p==a){if(p<this.safeFrom)return null;let g=p+f.length;if(g<=this.safeTo){let b=f.prop(NodeProp.lookAhead);if(!b||g+b<this.fragment.to)return f}}this.index[o]++,p+f.length>=Math.max(this.safeFrom,a)&&(this.trees.push(f),this.start.push(p),this.index.push(0))}else this.index[o]++,this.nextStart=p+f.length}}}class TokenCache{constructor(a,o){this.stream=o,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=a.tokenizers.map(u=>new CachedToken)}getActions(a){let o=0,u=null,{parser:d}=a.p,{tokenizers:f}=d,p=d.stateSlot(a.state,3),g=a.curContext?a.curContext.hash:0,b=0;for(let O=0;O<f.length;O++){if(!(1<<O&p))continue;let S=f[O],A=this.tokens[O];if(!(u&&!S.fallback)&&((S.contextual||A.start!=a.pos||A.mask!=p||A.context!=g)&&(this.updateCachedToken(A,S,a),A.mask=p,A.context=g),A.lookAhead>A.end+25&&(b=Math.max(A.lookAhead,b)),A.value!=0)){let M=o;if(A.extended>-1&&(o=this.addActions(a,A.extended,A.end,o)),o=this.addActions(a,A.value,A.end,o),!S.extend&&(u=A,o>M))break}}for(;this.actions.length>o;)this.actions.pop();return b&&a.setLookAhead(b),!u&&a.pos==this.stream.end&&(u=new CachedToken,u.value=a.p.parser.eofTerm,u.start=u.end=a.pos,o=this.addActions(a,u.value,u.end,o)),this.mainToken=u,this.actions}getMainToken(a){if(this.mainToken)return this.mainToken;let o=new CachedToken,{pos:u,p:d}=a;return o.start=u,o.end=Math.min(u+1,d.stream.end),o.value=u==d.stream.end?d.parser.eofTerm:0,o}updateCachedToken(a,o,u){let d=this.stream.clipPos(u.pos);if(o.token(this.stream.reset(d,a),u),a.value>-1){let{parser:f}=u.p;for(let p=0;p<f.specialized.length;p++)if(f.specialized[p]==a.value){let g=f.specializers[p](this.stream.read(a.start,a.end),u);if(g>=0&&u.p.parser.dialect.allows(g>>1)){g&1?a.extended=g>>1:a.value=g>>1;break}}}else a.value=0,a.end=this.stream.clipPos(d+1)}putAction(a,o,u,d){for(let f=0;f<d;f+=3)if(this.actions[f]==a)return d;return this.actions[d++]=a,this.actions[d++]=o,this.actions[d++]=u,d}addActions(a,o,u,d){let{state:f}=a,{parser:p}=a.p,{data:g}=p;for(let b=0;b<2;b++)for(let O=p.stateSlot(f,b?2:1);;O+=3){if(g[O]==65535)if(g[O+1]==1)O=pair(g,O+2);else{d==0&&g[O+1]==2&&(d=this.putAction(pair(g,O+2),o,u,d));break}g[O]==o&&(d=this.putAction(pair(g,O+1),o,u,d))}return d}}class Parse{constructor(a,o,u,d){this.parser=a,this.input=o,this.ranges=d,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(o,d),this.tokens=new TokenCache(a,this.stream),this.topTerm=a.top[1];let{from:f}=d[0];this.stacks=[Stack.start(this,a.top[0],f)],this.fragments=u.length&&this.stream.end-f>a.bufferLength*4?new FragmentCursor(u,a.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let a=this.stacks,o=this.minStackPos,u=this.stacks=[],d,f;if(this.bigReductionCount>300&&a.length==1){let[p]=a;for(;p.forceReduce()&&p.stack.length&&p.stack[p.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let p=0;p<a.length;p++){let g=a[p];for(;;){if(this.tokens.mainToken=null,g.pos>o)u.push(g);else{if(this.advanceStack(g,u,a))continue;{d||(d=[],f=[]),d.push(g);let b=this.tokens.getMainToken(g);f.push(b.value,b.end)}}break}}if(!u.length){let p=d&&findFinished(d);if(p)return verbose&&console.log("Finish with "+this.stackID(p)),this.stackToTree(p);if(this.parser.strict)throw verbose&&d&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+o);this.recovering||(this.recovering=5)}if(this.recovering&&d){let p=this.stoppedAt!=null&&d[0].pos>this.stoppedAt?d[0]:this.runRecovery(d,f,u);if(p)return verbose&&console.log("Force-finish "+this.stackID(p)),this.stackToTree(p.forceAll())}if(this.recovering){let p=this.recovering==1?1:this.recovering*3;if(u.length>p)for(u.sort((g,b)=>b.score-g.score);u.length>p;)u.pop();u.some(g=>g.reducePos>o)&&this.recovering--}else if(u.length>1){e:for(let p=0;p<u.length-1;p++){let g=u[p];for(let b=p+1;b<u.length;b++){let O=u[b];if(g.sameState(O)||g.buffer.length>500&&O.buffer.length>500)if((g.score-O.score||g.buffer.length-O.buffer.length)>0)u.splice(b--,1);else{u.splice(p--,1);continue e}}}u.length>12&&u.splice(12,u.length-12)}this.minStackPos=u[0].pos;for(let p=1;p<u.length;p++)u[p].pos<this.minStackPos&&(this.minStackPos=u[p].pos);return null}stopAt(a){if(this.stoppedAt!=null&&this.stoppedAt<a)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=a}advanceStack(a,o,u){let d=a.pos,{parser:f}=this,p=verbose?this.stackID(a)+" -> ":"";if(this.stoppedAt!=null&&d>this.stoppedAt)return a.forceReduce()?a:null;if(this.fragments){let O=a.curContext&&a.curContext.tracker.strict,S=O?a.curContext.hash:0;for(let A=this.fragments.nodeAt(d);A;){let M=this.parser.nodeSet.types[A.type.id]==A.type?f.getGoto(a.state,A.type.id):-1;if(M>-1&&A.length&&(!O||(A.prop(NodeProp.contextHash)||0)==S))return a.useNode(A,M),verbose&&console.log(p+this.stackID(a)+` (via reuse of ${f.getName(A.type.id)})`),!0;if(!(A instanceof Tree)||A.children.length==0||A.positions[0]>0)break;let E=A.children[0];if(E instanceof Tree&&A.positions[0]==0)A=E;else break}}let g=f.stateSlot(a.state,4);if(g>0)return a.reduce(g),verbose&&console.log(p+this.stackID(a)+` (via always-reduce ${f.getName(g&65535)})`),!0;if(a.stack.length>=8400)for(;a.stack.length>6e3&&a.forceReduce(););let b=this.tokens.getActions(a);for(let O=0;O<b.length;){let S=b[O++],A=b[O++],M=b[O++],E=O==b.length||!u,R=E?a:a.split(),L=this.tokens.mainToken;if(R.apply(S,A,L?L.start:R.pos,M),verbose&&console.log(p+this.stackID(R)+` (via ${S&65536?`reduce of ${f.getName(S&65535)}`:"shift"} for ${f.getName(A)} @ ${d}${R==a?"":", split"})`),E)return!0;R.pos>d?o.push(R):u.push(R)}return!1}advanceFully(a,o){let u=a.pos;for(;;){if(!this.advanceStack(a,null,null))return!1;if(a.pos>u)return pushStackDedup(a,o),!0}}runRecovery(a,o,u){let d=null,f=!1;for(let p=0;p<a.length;p++){let g=a[p],b=o[p<<1],O=o[(p<<1)+1],S=verbose?this.stackID(g)+" -> ":"";if(g.deadEnd&&(f||(f=!0,g.restart(),verbose&&console.log(S+this.stackID(g)+" (restarted)"),this.advanceFully(g,u))))continue;let A=g.split(),M=S;for(let E=0;A.forceReduce()&&E<10&&(verbose&&console.log(M+this.stackID(A)+" (via force-reduce)"),!this.advanceFully(A,u));E++)verbose&&(M=this.stackID(A)+" -> ");for(let E of g.recoverByInsert(b))verbose&&console.log(S+this.stackID(E)+" (via recover-insert)"),this.advanceFully(E,u);this.stream.end>g.pos?(O==g.pos&&(O++,b=0),g.recoverByDelete(b,O),verbose&&console.log(S+this.stackID(g)+` (via recover-delete ${this.parser.getName(b)})`),pushStackDedup(g,u)):(!d||d.score<g.score)&&(d=g)}return d}stackToTree(a){return a.close(),Tree.build({buffer:StackBufferCursor.create(a),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:a.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(a){let o=(stackIDs||(stackIDs=new WeakMap)).get(a);return o||stackIDs.set(a,o=String.fromCodePoint(this.nextStackID++)),o+a}}function pushStackDedup(l,a){for(let o=0;o<a.length;o++){let u=a[o];if(u.pos==l.pos&&u.sameState(l)){a[o].score<l.score&&(a[o]=l);return}}a.push(l)}class Dialect{constructor(a,o,u){this.source=a,this.flags=o,this.disabled=u}allows(a){return!this.disabled||this.disabled[a]==0}}const id=l=>l;class ContextTracker{constructor(a){this.start=a.start,this.shift=a.shift||id,this.reduce=a.reduce||id,this.reuse=a.reuse||id,this.hash=a.hash||(()=>0),this.strict=a.strict!==!1}}class LRParser extends Parser{constructor(a){if(super(),this.wrappers=[],a.version!=14)throw new RangeError(`Parser version (${a.version}) doesn't match runtime version (14)`);let o=a.nodeNames.split(" ");this.minRepeatTerm=o.length;for(let g=0;g<a.repeatNodeCount;g++)o.push("");let u=Object.keys(a.topRules).map(g=>a.topRules[g][1]),d=[];for(let g=0;g<o.length;g++)d.push([]);function f(g,b,O){d[g].push([b,b.deserialize(String(O))])}if(a.nodeProps)for(let g of a.nodeProps){let b=g[0];typeof b=="string"&&(b=NodeProp[b]);for(let O=1;O<g.length;){let S=g[O++];if(S>=0)f(S,b,g[O++]);else{let A=g[O+-S];for(let M=-S;M>0;M--)f(g[O++],b,A);O++}}}this.nodeSet=new NodeSet(o.map((g,b)=>NodeType.define({name:b>=this.minRepeatTerm?void 0:g,id:b,props:d[b],top:u.indexOf(b)>-1,error:b==0,skipped:a.skippedNodes&&a.skippedNodes.indexOf(b)>-1}))),a.propSources&&(this.nodeSet=this.nodeSet.extend(...a.propSources)),this.strict=!1,this.bufferLength=DefaultBufferLength;let p=decodeArray(a.tokenData);this.context=a.context,this.specializerSpecs=a.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let g=0;g<this.specializerSpecs.length;g++)this.specialized[g]=this.specializerSpecs[g].term;this.specializers=this.specializerSpecs.map(getSpecializer),this.states=decodeArray(a.states,Uint32Array),this.data=decodeArray(a.stateData),this.goto=decodeArray(a.goto),this.maxTerm=a.maxTerm,this.tokenizers=a.tokenizers.map(g=>typeof g=="number"?new TokenGroup(p,g):g),this.topRules=a.topRules,this.dialects=a.dialects||{},this.dynamicPrecedences=a.dynamicPrecedences||null,this.tokenPrecTable=a.tokenPrec,this.termNames=a.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(a,o,u){let d=new Parse(this,a,o,u);for(let f of this.wrappers)d=f(d,a,o,u);return d}getGoto(a,o,u=!1){let d=this.goto;if(o>=d[0])return-1;for(let f=d[o+1];;){let p=d[f++],g=p&1,b=d[f++];if(g&&u)return b;for(let O=f+(p>>1);f<O;f++)if(d[f]==a)return b;if(g)return-1}}hasAction(a,o){let u=this.data;for(let d=0;d<2;d++)for(let f=this.stateSlot(a,d?2:1),p;;f+=3){if((p=u[f])==65535)if(u[f+1]==1)p=u[f=pair(u,f+2)];else{if(u[f+1]==2)return pair(u,f+2);break}if(p==o||p==0)return pair(u,f+1)}return 0}stateSlot(a,o){return this.states[a*6+o]}stateFlag(a,o){return(this.stateSlot(a,0)&o)>0}validAction(a,o){return!!this.allActions(a,u=>u==o?!0:null)}allActions(a,o){let u=this.stateSlot(a,4),d=u?o(u):void 0;for(let f=this.stateSlot(a,1);d==null;f+=3){if(this.data[f]==65535)if(this.data[f+1]==1)f=pair(this.data,f+2);else break;d=o(pair(this.data,f+1))}return d}nextStates(a){let o=[];for(let u=this.stateSlot(a,1);;u+=3){if(this.data[u]==65535)if(this.data[u+1]==1)u=pair(this.data,u+2);else break;if(!(this.data[u+2]&1)){let d=this.data[u+1];o.some((f,p)=>p&1&&f==d)||o.push(this.data[u],d)}}return o}configure(a){let o=Object.assign(Object.create(LRParser.prototype),this);if(a.props&&(o.nodeSet=this.nodeSet.extend(...a.props)),a.top){let u=this.topRules[a.top];if(!u)throw new RangeError(`Invalid top rule name ${a.top}`);o.top=u}return a.tokenizers&&(o.tokenizers=this.tokenizers.map(u=>{let d=a.tokenizers.find(f=>f.from==u);return d?d.to:u})),a.specializers&&(o.specializers=this.specializers.slice(),o.specializerSpecs=this.specializerSpecs.map((u,d)=>{let f=a.specializers.find(g=>g.from==u.external);if(!f)return u;let p=Object.assign(Object.assign({},u),{external:f.to});return o.specializers[d]=getSpecializer(p),p})),a.contextTracker&&(o.context=a.contextTracker),a.dialect&&(o.dialect=this.parseDialect(a.dialect)),a.strict!=null&&(o.strict=a.strict),a.wrap&&(o.wrappers=o.wrappers.concat(a.wrap)),a.bufferLength!=null&&(o.bufferLength=a.bufferLength),o}hasWrappers(){return this.wrappers.length>0}getName(a){return this.termNames?this.termNames[a]:String(a<=this.maxNode&&this.nodeSet.types[a].name||a)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(a){let o=this.dynamicPrecedences;return o==null?0:o[a]||0}parseDialect(a){let o=Object.keys(this.dialects),u=o.map(()=>!1);if(a)for(let f of a.split(" ")){let p=o.indexOf(f);p>=0&&(u[p]=!0)}let d=null;for(let f=0;f<o.length;f++)if(!u[f])for(let p=this.dialects[o[f]],g;(g=this.data[p++])!=65535;)(d||(d=new Uint8Array(this.maxTerm+1)))[g]=1;return new Dialect(a,u,d)}static deserialize(a){return new LRParser(a)}}function pair(l,a){return l[a]|l[a+1]<<16}function findFinished(l){let a=null;for(let o of l){let u=o.p.stoppedAt;(o.pos==o.p.stream.end||u!=null&&o.pos>u)&&o.p.parser.stateFlag(o.state,2)&&(!a||a.score<o.score)&&(a=o)}return a}function getSpecializer(l){if(l.external){let a=l.extend?1:0;return(o,u)=>l.external(o,u)<<1|a}return l.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=60,comma=44,question=63,dot=46,bracketL=91,trackNewline=new ContextTracker({start:!1,shift(l,a){return a==LineComment||a==BlockComment||a==spaces?l:a==newline},strict:!1}),insertSemicolon=new ExternalTokenizer((l,a)=>{let{next:o}=l;(o==braceR||o==-1||a.context)&&l.acceptToken(insertSemi)},{contextual:!0,fallback:!0}),noSemicolon=new ExternalTokenizer((l,a)=>{let{next:o}=l,u;space.indexOf(o)>-1||o==slash&&((u=l.peek(1))==slash||u==star)||o!=braceR&&o!=semicolon&&o!=-1&&!a.context&&l.acceptToken(noSemi)},{contextual:!0}),noSemicolonType=new ExternalTokenizer((l,a)=>{l.next==bracketL&&!a.context&&l.acceptToken(noSemiType)},{contextual:!0}),operatorToken=new ExternalTokenizer((l,a)=>{let{next:o}=l;if(o==plus||o==minus){if(l.advance(),o==l.next){l.advance();let u=!a.context&&a.canShift(incdec);l.acceptToken(u?incdec:incdecPrefix)}}else o==question&&l.peek(1)==dot&&(l.advance(),l.advance(),(l.next<48||l.next>57)&&l.acceptToken(questionDot))},{contextual:!0});function identifierChar(l,a){return l>=65&&l<=90||l>=97&&l<=122||l==95||l>=192||!a&&l>=48&&l<=57}const jsx=new ExternalTokenizer((l,a)=>{if(l.next!=lt||!a.dialectEnabled(Dialect_jsx)||(l.advance(),l.next==slash))return;let o=0;for(;space.indexOf(l.next)>-1;)l.advance(),o++;if(identifierChar(l.next,!0)){for(l.advance(),o++;identifierChar(l.next,!1);)l.advance(),o++;for(;space.indexOf(l.next)>-1;)l.advance(),o++;if(l.next==comma)return;for(let u=0;;u++){if(u==7){if(!identifierChar(l.next,!0))return;break}if(l.next!="extends".charCodeAt(u))break;l.advance(),o++}}l.acceptToken(JSXStartTag,-o)}),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$1=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^OOQ['#I]'#I]Q`QlOOQ`QlOOO9sQ!L^O'#DtO9zQlO'#D|O:RQlO'#EOO9aQ`O'#GrO:YQMhO'#CoO:hQ`O'#ElO:sQ`O'#EwO:xQMhO'#FdO;gQ`O'#GrOOQO'#K^'#K^O;lQ`O'#K^O;zQ`O'#GzO;zQ`O'#G{O;zQ`O'#G}O9aQ`O'#HQO<qQ`O'#HTO>YQ`O'#CeO>jQ`O'#HaO>rQ`O'#HgO>rQ`O'#HiO`QlO'#HkO>rQ`O'#HmO>rQ`O'#HpO>wQ`O'#HvO>|Q!0LsO'#H|O%[QlO'#IOO?XQ!0LsO'#IQO?dQ!0LsO'#ISO9kQ!0Lr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QT-_'^-`]!qQ!r'^-`1g5qQ#p]R'g;wR)d$dY!uQ'^-`1g5qQ'i!rS's!v!yS'u!z5sS-o'j'kQ-q'lR2{-pT#kZ%dS#jZ%dS%jm,jU(e#h#i#lS.T(f(gQ.X(hQ0n+ZQ3Q.UU3R.V.W.YS6x3S3TR9T6yd#^W#W#Z%g(R([*W+W.O/hr#gZm#h#i#l%d(f(g(h+Z.U.V.W.Y3S3T6yS*Z$x*_Q/o*[Q1|,jQ2d-QQ4W/kQ6g2[Q7i4XQ8{6hT=_'V+XV#aW%g*WU#`W%g*WS(S#W([U(X#Z+W/hS-V'V+XT-y(R.OV'[!e%h*XQ$lfR)v$qT)k$l)lR3}/PT*]$x*_T*e${*WQ0q+cQ1_,QQ3V.aQ5j1aQ5u1iQ6}3ZQ8g5xQ9W6|Q:Q8fQ:d9VQ:|:SQ;U:fQ;`:}R;c;VnqOXst!Z#d%l&p&r&s&u,n,s2S2VQ&j!VR,c&gtmOXst!U!V!Z#d%l&g&p&r&s&u,n,s2S2VR,j&mT%km,jR1c,SR,b&eQ&T|R+z&UR+p&OT&n!W&qT&o!W&qT2U,s2V",nodeNames:"⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < 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$A`?HUOEr(n%d_$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$h&j(X!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(X!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$h&j(UpOY(rYZ&cZr(rr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![#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:l=>spec_identifier[l]||-1},{term:341,get:l=>spec_word[l]||-1},{term:93,get:l=>spec_LessThan[l]||-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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment