Deploying to gh-pages from @ sehugg/8bitworkshop@eaf2db15e6 🚀

This commit is contained in:
sehugg committed 2026-03-23 21:24:12 +00:00
1 parent 7630697b97
commit 77a7a0bdab
14 files changed
+63 -59

No files matched your search

@@ -1,4 +1,4 @@
import{b as E}from"./chunk-3FIVEUG2.js";import{a as S,t as y}from"./chunk-EFP34EU3.js";import"./chunk-JSIZCY7X.js";import"./chunk-LNOKARBD.js";import"./chunk-KJNUV3FX.js";import"./chunk-ZBO3TMVB.js";import{B as c,K as f,T as d,U as v,a as g}from"./chunk-NIHHDIEJ.js";import"./chunk-KT7KMEQC.js";function O(u){return u.value!=null}function k(u){return u.name!=null}function N(u){return u.op!=null&&u.left!=null&&u.right!=null}function I(u){return u.op!=null&&u.expr!=null}var m=class{randomize(){this.seed(Math.random()*2147483647,Math.random()*2147483647,Math.random()*2147483647,Math.random()*2147483647)}constructor(){(()=>{var r,e,i,n;this.seed=function(s,a,h,o){r=s,e=a,i=h,n=o},this.seedfloat=function(s){this.seed(s,s*4294,s*429496,s*4294967296),this.next(),this.next(),this.next()},this.next=function(){r>>>=0,e>>>=0,i>>>=0,n>>>=0;var s=r+e|0;return r=e^e>>>9,e=i+(i<<3)|0,i=i<<21|i>>>11,n=n+1|0,s=s+n|0,i=i+s|0,(s>>>0)/4294967296}})(),this.seedfloat(-1)}},L=1024*1024,l=class u{constructor(){this.margin=80;this.running=!1;this.exited=!0;this.trace=!1}load(t){let r=null,e=0;if(this.pc2label!=null){let s=this.curpc;for(;s>0&&(r=this.pc2label.get(s))==null;)s--;e=this.curpc-s,console.log("oldpc=",this.curpc,"restart @ label",r,"+",e)}this.program=t,this.opts=t.opts,this.opts.maxArrayElements||(this.opts.maxArrayElements=L),this.allstmts=t.stmts,this.label2pc=t.labels,this.label2dataptr={},this.pc2label=new Map,this.datums=[],this.subroutines={},this.builtins=this.getBuiltinFunctions();for(var i in t.labels){var n=t.labels[i];this.pc2label.set(n,i)}return this.allstmts.forEach((s,a)=>{this.curpc=a+1,this.compileStatement(s),s.command=="DATA"&&(this.label2dataptr[s.$loc.label]=this.datums.length,s.datums.forEach(h=>{this.curpc=s.$loc.offset,this.datums.push(h)}))}),this.label2pc[r]!=null?(this.curpc=this.label2pc[r]+e,!0):(this.curpc=0,!1)}reset(){this.curpc=0,this.dataptr=0,this.clearVars(),this.returnStack=[],this.column=0,this.running=!0,this.exited=!1}clearVars(){this.globals=this.vars={},this.arrays={},this.defs={},this.forLoops={},this.forLoopStack=[],this.whileLoops=[],this.rng=new m,this.opts&&this.opts.staticArrays&&this.allstmts.filter(t=>t.command=="DIM").forEach(t=>{t.args.forEach(r=>this.compileJS(this._DIM(r))())})}saveState(){return $.extend(!0,{},this)}loadState(t){$.extend(!0,this,t)}getBuiltinFunctions(){var t=this.program&&this.opts.validFunctions;t||(t=Object.getOwnPropertyNames(u.prototype).filter(i=>/^[A-Z]{3,}[$]?$/.test(i)));var r={};for(var e of t)this.supportsFunction(e)&&(r[e]=this[e].bind(this));return r}supportsFunction(t){return typeof this[t]=="function"}runtimeError(t){throw this.curpc--,new d(t,this.getCurrentSourceLocation())}dialectError(t){this.runtimeError(`I can't ${t} in this dialect of BASIC.`)}getLineForPC(t){var r=this.allstmts[t];return r&&r.$loc&&r.$loc.line}getLabelForPC(t){var r=this.allstmts[t];return r&&r.$loc&&r.$loc.label}getCurrentSourceLocation(){var t=this.getStatement();return t&&t.$loc}getCurrentLabel(){var t=this.getCurrentSourceLocation();return t&&t.label}getStatement(){return this.allstmts[this.curpc]}step(){if(!this.running)return!1;var t=this.getStatement();return t?(this.trace&&console.log(this.curpc,t,this.vars,Object.keys(this.arrays)),this.curpc++,this.executeStatement(t),this.running):(this.running=!1,this.exited=!0,!1)}compileStatement(t){if(t.$run==null)try{var r=this["do__"+t.command];r==null&&this.runtimeError(`I don't know how to "${t.command}".`);var e=r.bind(this)(t);this.trace&&console.log(e),t.$run=this.compileJS(e)}catch(i){throw e&&console.log(e),i}}compileJS(t){return new Function(t).bind(this)}executeStatement(t){this.compileStatement(t),t.$run()}skipToEOL(){do this.curpc++;while(this.curpc<this.allstmts.length&&!this.pc2label.get(this.curpc))}skipToElse(){for(;this.curpc<this.allstmts.length;){var t=this.allstmts[this.curpc].command;if(t=="ELSE"){this.curpc++;break}else if(t=="IF")return this.skipToEOL();if(this.curpc++,this.pc2label.get(this.curpc))break}}skipToEOF(){this.curpc=this.allstmts.length}skipToAfterNext(t){for(var r=this.curpc;r<this.allstmts.length;){var e=this.allstmts[r];if(e.command=="NEXT"){var i=e.lexpr;if(i&&i.name==t){this.curpc=r+1;return}}r++}this.runtimeError(`I couldn't find a matching NEXT ${t} to skip this for loop.`)}skipToAfterWend(){for(var t=this.curpc-1,r=0;t<this.allstmts.length;){var e=this.allstmts[t];if(e.command=="WHILE")r++;else if(e.command=="WEND"&&(r--,r==0)){this.curpc=t+1;return}t++}this.runtimeError("I couldn't find a matching WEND for this WHILE.")}gotoLabel(t){var r=this.label2pc[t];r>=0?this.curpc=r:this.runtimeError(`I tried to go to the label "${t}" but couldn't find it.`)}newLocalScope(){this.vars=Object.create(this.vars)}popLocalScope(){this.vars!==this.globals&&(this.vars=Object.getPrototypeOf(this.vars))}gosubLabel(t){this.returnStack.length>32767&&this.runtimeError("I did too many GOSUBs without a RETURN."),this.returnStack.push(this.curpc),this.gotoLabel(t)}returnFromGosub(){this.returnLine truncated
import{b as E}from"./chunk-3FIVEUG2.js";import{a as S,t as y}from"./chunk-RID3TRKY.js";import"./chunk-JSIZCY7X.js";import"./chunk-LNOKARBD.js";import"./chunk-XFAJRCL6.js";import"./chunk-ZBO3TMVB.js";import{B as c,K as f,T as d,U as v,a as g}from"./chunk-NIHHDIEJ.js";import"./chunk-KT7KMEQC.js";function O(u){return u.value!=null}function k(u){return u.name!=null}function N(u){return u.op!=null&&u.left!=null&&u.right!=null}function I(u){return u.op!=null&&u.expr!=null}var m=class{randomize(){this.seed(Math.random()*2147483647,Math.random()*2147483647,Math.random()*2147483647,Math.random()*2147483647)}constructor(){(()=>{var r,e,i,n;this.seed=function(s,a,h,o){r=s,e=a,i=h,n=o},this.seedfloat=function(s){this.seed(s,s*4294,s*429496,s*4294967296),this.next(),this.next(),this.next()},this.next=function(){r>>>=0,e>>>=0,i>>>=0,n>>>=0;var s=r+e|0;return r=e^e>>>9,e=i+(i<<3)|0,i=i<<21|i>>>11,n=n+1|0,s=s+n|0,i=i+s|0,(s>>>0)/4294967296}})(),this.seedfloat(-1)}},L=1024*1024,l=class u{constructor(){this.margin=80;this.running=!1;this.exited=!0;this.trace=!1}load(t){let r=null,e=0;if(this.pc2label!=null){let s=this.curpc;for(;s>0&&(r=this.pc2label.get(s))==null;)s--;e=this.curpc-s,console.log("oldpc=",this.curpc,"restart @ label",r,"+",e)}this.program=t,this.opts=t.opts,this.opts.maxArrayElements||(this.opts.maxArrayElements=L),this.allstmts=t.stmts,this.label2pc=t.labels,this.label2dataptr={},this.pc2label=new Map,this.datums=[],this.subroutines={},this.builtins=this.getBuiltinFunctions();for(var i in t.labels){var n=t.labels[i];this.pc2label.set(n,i)}return this.allstmts.forEach((s,a)=>{this.curpc=a+1,this.compileStatement(s),s.command=="DATA"&&(this.label2dataptr[s.$loc.label]=this.datums.length,s.datums.forEach(h=>{this.curpc=s.$loc.offset,this.datums.push(h)}))}),this.label2pc[r]!=null?(this.curpc=this.label2pc[r]+e,!0):(this.curpc=0,!1)}reset(){this.curpc=0,this.dataptr=0,this.clearVars(),this.returnStack=[],this.column=0,this.running=!0,this.exited=!1}clearVars(){this.globals=this.vars={},this.arrays={},this.defs={},this.forLoops={},this.forLoopStack=[],this.whileLoops=[],this.rng=new m,this.opts&&this.opts.staticArrays&&this.allstmts.filter(t=>t.command=="DIM").forEach(t=>{t.args.forEach(r=>this.compileJS(this._DIM(r))())})}saveState(){return $.extend(!0,{},this)}loadState(t){$.extend(!0,this,t)}getBuiltinFunctions(){var t=this.program&&this.opts.validFunctions;t||(t=Object.getOwnPropertyNames(u.prototype).filter(i=>/^[A-Z]{3,}[$]?$/.test(i)));var r={};for(var e of t)this.supportsFunction(e)&&(r[e]=this[e].bind(this));return r}supportsFunction(t){return typeof this[t]=="function"}runtimeError(t){throw this.curpc--,new d(t,this.getCurrentSourceLocation())}dialectError(t){this.runtimeError(`I can't ${t} in this dialect of BASIC.`)}getLineForPC(t){var r=this.allstmts[t];return r&&r.$loc&&r.$loc.line}getLabelForPC(t){var r=this.allstmts[t];return r&&r.$loc&&r.$loc.label}getCurrentSourceLocation(){var t=this.getStatement();return t&&t.$loc}getCurrentLabel(){var t=this.getCurrentSourceLocation();return t&&t.label}getStatement(){return this.allstmts[this.curpc]}step(){if(!this.running)return!1;var t=this.getStatement();return t?(this.trace&&console.log(this.curpc,t,this.vars,Object.keys(this.arrays)),this.curpc++,this.executeStatement(t),this.running):(this.running=!1,this.exited=!0,!1)}compileStatement(t){if(t.$run==null)try{var r=this["do__"+t.command];r==null&&this.runtimeError(`I don't know how to "${t.command}".`);var e=r.bind(this)(t);this.trace&&console.log(e),t.$run=this.compileJS(e)}catch(i){throw e&&console.log(e),i}}compileJS(t){return new Function(t).bind(this)}executeStatement(t){this.compileStatement(t),t.$run()}skipToEOL(){do this.curpc++;while(this.curpc<this.allstmts.length&&!this.pc2label.get(this.curpc))}skipToElse(){for(;this.curpc<this.allstmts.length;){var t=this.allstmts[this.curpc].command;if(t=="ELSE"){this.curpc++;break}else if(t=="IF")return this.skipToEOL();if(this.curpc++,this.pc2label.get(this.curpc))break}}skipToEOF(){this.curpc=this.allstmts.length}skipToAfterNext(t){for(var r=this.curpc;r<this.allstmts.length;){var e=this.allstmts[r];if(e.command=="NEXT"){var i=e.lexpr;if(i&&i.name==t){this.curpc=r+1;return}}r++}this.runtimeError(`I couldn't find a matching NEXT ${t} to skip this for loop.`)}skipToAfterWend(){for(var t=this.curpc-1,r=0;t<this.allstmts.length;){var e=this.allstmts[t];if(e.command=="WHILE")r++;else if(e.command=="WEND"&&(r--,r==0)){this.curpc=t+1;return}t++}this.runtimeError("I couldn't find a matching WEND for this WHILE.")}gotoLabel(t){var r=this.label2pc[t];r>=0?this.curpc=r:this.runtimeError(`I tried to go to the label "${t}" but couldn't find it.`)}newLocalScope(){this.vars=Object.create(this.vars)}popLocalScope(){this.vars!==this.globals&&(this.vars=Object.getPrototypeOf(this.vars))}gosubLabel(t){this.returnStack.length>32767&&this.runtimeError("I did too many GOSUBs without a RETURN."),this.returnStack.push(this.curpc),this.gotoLabel(t)}returnFromGosub(){this.returnLine truncated
`)this.column=0,e=t;else if(t==" "){var n=this.opts.printZoneLength,s=Math.floor(this.column/n),a=(s+1)*this.opts.printZoneLength;a+n>this.margin?(this.column=0,e=`
`):e=this.TAB(a)}else e=`${t}`;return e}float2str(t,r){var e=t.toString().toUpperCase();if(r>0){for(var i=r;e.length>r;)e=t.toPrecision(i--);e.startsWith("0.")?e=e.substr(1):e.startsWith("-0.")&&(e="-"+e.substr(2))}return e}printExpr(t){var r=this.valueToString(t,this.opts.numericPadding);this.column+=r.length,this.print(r)}print(t){console.log(t)}async input(t,r){return{line:"",vals:[]}}resume(){}expr2js(t,r){if(r||(r={}),O(t))return JSON.stringify(t.value);if(k(t)){if(!t.args&&r.locals&&r.locals.indexOf(t.name)>=0)return t.name;{r.isconst&&this.runtimeError("I expected a constant value here.");var e="",i=JSON.stringify(t.name);let h=t.args?t.args.map(o=>this.expr2js(o,r)).join(", "):[];return t.name.startsWith("FN")?e+=`this.getDef(${i})(${h})`:this.builtins[t.name]?(this.checkFuncArgs(t,this.builtins[t.name]),e+=`this.builtins.${t.name}(${h})`):t.args?this.opts.arraysContainChars&&t.name.endsWith("$")?e+=`this.getStringSlice(this.vars.${t.name}, ${h})`:e+=`this.arrayGet(${i}, ${h})`:e+=`this.vars.${t.name}`,r.novalid?e:`this.checkValue(${e}, ${i})`}}else if(N(t)){var n=this.expr2js(t.left,r),s=this.expr2js(t.right,r);return`this.${t.op}(${n}, ${s})`}else if(I(t)){var a=this.expr2js(t.expr,r);return`this.${t.op}(${a})`}}assign2js(t,r){r||(r={});var e="";return(t.name.startsWith("FN")||this.builtins[t.name])&&this.runtimeError("I can't call a function here."),t.args?this.opts.arraysContainChars&&t.name.endsWith("$")?this.runtimeError("I can't set array slices via this command yet."):e+=this.array2js(t,r):e=`this.globals.${t.name}`,e}array2js(t,r){var e=JSON.stringify(t.name),i=t.args||[];return this.expr2js(t,{novalid:!0})+`;this.getArray(${e}, ${i.length})`+i.map(n=>"[this.ROUND("+this.expr2js(n,r)+")]").join("")}checkFuncArgs(t,r){var e=t.args?t.args.length:0;t.name=="RND"&&e==0||t.name=="MID$"&&e==2||t.name=="INSTR"&&e==2||r.length!=e&&this.runtimeError(`I expected ${r.length} arguments for the ${t.name} function, but I got ${e}.`)}startForLoop(t,r,e,i,n){var s=this.curpc-1,a=this.pc2label.get(s);i||(i=1),this.vars[t]=r,this.trace&&console.log(`FOR ${t} = ${r} TO ${e} STEP ${i}`);var h=()=>i>=0?this.vars[t]>e:this.vars[t]<e;this.opts.testInitialFor&&h()&&(n!=null?this.curpc=n+1:this.skipToAfterNext(t)),this.forLoopStack[t]!=null&&(this.forLoopStack=this.forLoopStack.filter(o=>o==t)),this.forLoopStack.push(t),this.forLoops[t]={$next:o=>{o&&t!=o&&this.runtimeError(`I executed NEXT "${o}", but the last FOR was for "${t}".`),this.vars[t]+=i;var b=h();b?(this.forLoopStack.pop(),delete this.forLoops[t]):this.curpc=(a!=null&&this.label2pc[a]||s)+1,this.trace&&console.log(`NEXT ${t}: ${this.vars[t]} TO ${e} STEP ${i} DONE=${b}`)}}}nextForLoop(t){var r=this.forLoops[t||this.opts.optionalNextVar&&this.forLoopStack[this.forLoopStack.length-1]];r||this.runtimeError("I couldn't find a matching FOR for this NEXT."),r.$next(t)}whileLoop(t){t?this.whileLoops.push(this.curpc-1):this.skipToAfterWend()}nextWhileLoop(){var t=this.whileLoops.pop();t==null?this.runtimeError("I couldn't find a matching WHILE for this WEND."):this.curpc=t}assign(t,r,e){return e&&t.endsWith("$")?this.checkValue(this.convert(t,r),t):t.endsWith("$")?this.convertToString(r,t):this.convertToNumber(r,t)}convert(t,r){return t.endsWith("$")?r==null?"":r.toString():typeof r=="number"?r:parseFloat(r+"")}convertToString(t,r){if(typeof t!="string")this.runtimeError(`I can't convert ${t} to a string.`);else return t}convertToNumber(t,r){if(typeof t!="number")this.runtimeError(`I can't convert ${t} to a number.`);else return this.checkNum(t)}dimArray(t,...r){if(r=r.map(Math.round),this.arrays[t]!=null){if(this.opts.staticArrays)return;this.runtimeError(`I already dimensioned this array (${t}) earlier.`)}var e=this.getTotalArrayLength(r);e>this.opts.maxArrayElements&&this.runtimeError("I can't create an array with this many elements.");var i=t.endsWith("$"),n=i?Array:Float64Array;if(r.length==1)this.arrays[t]=new n(r[0]+1);else if(r.length==2){this.arrays[t]=new Array(r[0]+1);for(var s=0;s<r[0]+1;s++)this.arrays[t][s]=new n(r[1]+1)}else this.runtimeError("I only support arrays of one or two dimensions.")}getTotalArrayLength(t){for(var r=1,e=0;e<t.length;e++)t[e]<this.opts.defaultArrayBase&&this.runtimeError(`I can't create an array with a dimension less than ${this.opts.defaultArrayBase}.`),r*=t[e];return r}getArray(t,r){return this.arrays[t]||(this.opts.defaultArraySize==0&&this.dialectError("automatically declare arrays without a DIM statement (or did you mean to call a function?)"),r==1?this.dimArray(t,this.opts.defaultArraySize-1):r==2?this.dimArray(t,this.opts.defaultArraySize-1,this.opts.defaultArraySize-1):this.runtimeError("I only support arrays of one or two dimensions.")),this.arrays[t]}arrayGet(t,...r){var e=this.getArray(t,r.length);r=r.map(this.ROUND.bind(this));for(var i=e,n=0;n<r.length;n++){var s=r[n];c(i)||this.runtimeError(`I tried to lookup ${t}(${r}) but used too many dimensions.`),s<this.opts.defaultArrayBase&&this.runtimeError(`I triedLine truncated
var value = this.convert(${JSON.stringify(n.name)}, response.vals[${s}]);
@@ -34,4 +34,4 @@ import{b as E}from"./chunk-3FIVEUG2.js";import{a as S,t as y}from"./chunk-EFP34E
`),this.tty.addtext("*** END OF PROGRAM ***",1),this.tty.showPrintHead(!1)}loadROM(t,r){var e=this.runtime.exited;this.program=r;var i=this.runtime.load(r);this.tty.uppercaseOnly=!0,S.input=this.program.opts.uppercaseOnly?n=>n.toUpperCase():null,(!this.hotReload||e||!i)&&this.reset()}getROMExtension(){return".json"}reset(){this.tty.clear(),this.runtime.reset(),this.clock=0,this.transcript=[]}pause(){this.timer.stop()}resume(){this.isBlocked()||(this.animcount=0,this.timer.start())}isBlocked(){return this.tty.waitingfor!=null||this.runtime.exited}isRunning(){return this.timer.isRunning()}getDefaultExtensions(){return[".bas"]}getToolForFilename(){return"basic"}getPresets(){return T}getPC(){return this.runtime.curpc}getSP(){return 4096-this.runtime.returnStack.length}isStable(){return!0}getCPUState(){return{PC:this.getPC(),SP:this.getSP()}}saveState(){return{c:this.getCPUState(),rt:this.runtime.saveState()}}loadState(t){this.runtime.loadState(t)}getDebugTree(){return{CurrentLine:this.runtime.getCurrentLabel(),Variables:this.runtime.vars,Arrays:this.runtime.arrays,Functions:this.runtime.defs,ForLoops:this.runtime.forLoops,WhileLoops:this.runtime.whileLoops,ReturnStack:this.runtime.returnStack,NextDatum:this.runtime.datums[this.runtime.dataptr],Clock:this.clock,Options:this.runtime.opts,Internals:this.runtime}}inspect(t){let r=this.runtime.vars[t];if(r!=null)return`${t} = ${r}`}showHelp(){return"https://8bitworkshop.com/docs/platforms/basic/"}getDebugCategories(){return["Variables"]}getDebugInfo(t,r){switch(t){case"Variables":return this.varsToLongString()}}varsToLongString(){var t="",r=Object.keys(this.runtime.vars);r.sort();for(var e of r){var i=this.runtime.vars[e],n=JSON.stringify(i);n.length>24&&(n=`${n.substr(0,24)}...(${n.length})`),t+=g(e,3)+" = "+n+`
`}return t}setupDebug(t){this.onBreakpointHit=t}clearDebug(){this.onBreakpointHit=null,this.debugTrap=null}checkDebugTrap(){return this.debugTrap&&this.debugTrap()?(this.pause(),this.break(),!0):!1}break(){this.onBreakpointHit&&this.onBreakpointHit(this.saveState())}step(){var t=this.clock;this.debugTrap=()=>this.clock>t,this.resume()}stepOver(){var t=this.runtime.getStatement();if(t&&(t.command=="GOSUB"||t.command=="ONGOSUB")){var r=this.getPC()+1;this.runEval(()=>this.getPC()==r)}else this.step()}runUntilReturn(){var t=this.getSP();this.runEval(()=>this.getSP()>t)}runEval(t){this.debugTrap=()=>t(this.getCPUState()),this.resume()}restartAtPC(t){return t=Math.round(t),t>=0&&t<this.runtime.allstmts.length?(this.runtime.curpc=t,this.tty.cancelinput(),this.clock=0,!0):!1}readFile(t){return this.internalFiles[t]}writeFile(t,r){return this.internalFiles[t]=r,!0}didExit(){this.internalFiles["stdout.txt"]=this.transcript.join(""),y()}};f.basic=p;
//# sourceMappingURL=basic-SVFVBWLN.js.map
//# sourceMappingURL=basic-E2ISAZP6.js.map
File renamed without changes.
-7
View File
@@ -1,7 +0,0 @@
{
"version": 3,
"sources": ["../node_modules/localforage/dist/localforage.js", "../node_modules/jquery/dist/jquery.js", "../node_modules/dompurify/src/utils.ts", "../node_modules/dompurify/src/tags.ts", "../node_modules/dompurify/src/attrs.ts", "../node_modules/dompurify/src/regexp.ts", "../node_modules/dompurify/src/purify.ts", "../src/ide/ui.ts", "../src/ide/analytics.ts", "../src/ide/dialogs.ts", "../src/common/workertypes.ts", "../src/ide/project.ts", "../src/ide/services.ts", "../src/common/audio/CommodoreTape.ts", "../src/ide/shareexport.ts", "../src/ide/sync.ts", "../src/ide/views/baseviews.ts", "../src/ide/pixeleditor.ts", "../src/ide/views/asseteditor.ts", "../src/ide/views/debugviews.ts", "../node_modules/@marijn/find-cluster-break/src/index.js", "../node_modules/@codemirror/state/dist/index.js", "../node_modules/style-mod/src/style-mod.js", "../node_modules/w3c-keyname/index.js", "../node_modules/crelt/index.js", "../node_modules/@codemirror/view/dist/index.js", "../node_modules/@lezer/common/dist/index.js", "../node_modules/@lezer/highlight/dist/index.js", "../node_modules/@codemirror/language/dist/index.js", "../node_modules/@codemirror/autocomplete/dist/index.js", "../node_modules/@codemirror/commands/dist/index.js", "../node_modules/@lezer/lr/dist/index.js", "../node_modules/@lezer/cpp/dist/index.js", "../node_modules/@codemirror/lang-cpp/dist/index.js", "../node_modules/@lezer/markdown/dist/index.js", "../node_modules/@lezer/html/dist/index.js", "../node_modules/@lezer/css/dist/index.js", "../node_modules/@codemirror/lang-css/dist/index.js", "../node_modules/@lezer/javascript/dist/index.js", "../node_modules/@codemirror/lang-javascript/dist/index.js", "../node_modules/@codemirror/lang-html/dist/index.js", "../node_modules/@codemirror/lang-markdown/dist/index.js", "../node_modules/@codemirror/search/dist/index.js", "../src/parser/tokens-6502.ts", "parser/lang-6502.grammar.js", "../src/parser/lang-6502.ts", "../src/parser/lang-basic.ts", "../src/parser/lang-bataribasic.ts", "../src/parser/lang-fastbasic.ts", "../src/parser/lang-inform6.ts", "../src/parser/lang-verilog.ts", "../src/parser/lang-wiz.ts", "parser/lang-z80.grammar.js", "../src/parser/lang-z80.ts", "../src/themes/cobalt.ts", "../src/themes/disassemblyTheme.ts", "../src/themes/editorTheme.ts", "../src/themes/mbo.ts", "../src/ide/views/debug.ts", "../src/ide/views/filters.ts", "../src/ide/views/gutter.ts", "../src/ide/views/assetdecorations.ts", "../src/ide/views/tabs.ts", "../src/ide/views/visuals.ts", "../src/ide/views/editors.ts", "../src/ide/views/treeviews.ts", "../src/ide/windows.ts"],
"sourcesContent": ["/*!\n localForage -- Offline Storage, Improved\n Version 1.10.0\n https://localforage.github.io/localForage\n (c) 2013-2017 Mozilla, Apache License 2.0\n*/\n(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.localforage = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw (f.code=\"MODULE_NOT_FOUND\", f)}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){\n(function (global){\n'use strict';\nvar Mutation = global.MutationObserver || global.WebKitMutationObserver;\n\nvar scheduleDrain;\n\n{\n if (Mutation) {\n var called = 0;\n var observer = new Mutation(nextTick);\n var element = global.document.createTextNode('');\n observer.observe(element, {\n characterData: true\n });\n scheduleDrain = function () {\n element.data = (called = ++called % 2);\n };\n } else if (!global.setImmediate && typeof global.MessageChannel !== 'undefined') {\n var channel = new global.MessageChannel();\n channel.port1.onmessage = nextTick;\n scheduleDrain = function () {\n channel.port2.postMessage(0);\n };\n } else if ('document' in global && 'onreadystatechange' in global.document.createElement('script')) {\n scheduleDrain = function () {\n\n // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted\n // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.\n var scriptEl = global.document.createElement('script');\n scriptEl.onreadystatechange = function () {\n nextTick();\n\n scriptEl.onreadystatechange = null;\n scriptEl.parentNode.removeChild(scriptEl);\n scriptEl = null;\n };\n global.document.documentElement.appendChild(scriptEl);\n };\n } else {\n scheduleDrain = function () {\n setTimeout(nextTick, 0);\n };\n }\n}\n\nvar draining;\nvar queue = [];\n//named nextTick for less confusing stack traces\nfunction nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}\n\nmodule.exports = immediate;\nfunction immediate(task) {\n if (queue.push(task) === 1 && !draining) {\n scheduleDrain();\n }\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{}],2:[function(_dereq_,module,exports){\n'use strict';\nvar immediate = _dereq_(1);\n\n/* istanbul ignore next */\nfunction INTERNAL() {}\n\nvar handlers = {};\n\nvar REJECTED = ['REJECTED'];\nvar FULFILLED = ['FULFILLED'];\nvar PENDING = ['PENDING'];\n\nmodule.exports = Promise;\n\nfunction Promise(resolver) {\n if (typeof resolver !== 'function') {\n throw new TypeError('resolver must be a function');\n }\n this.state = PENDING;\n this.queue = [];\n this.outcome = void 0;\n if (resolver !== INTERNAL) {\n safelyResolveThenable(this, resolver);\n }\n}\n\nPromise.prototype[\"catch\"] = function (onRejected) {\n return this.then(null, onRejected);\n};\nPromise.prototype.then = function (onFulfilled, onRejected) {\n if (typeof onFulfilled !== 'function' && this.state === FULFILLED ||\n typeof onRejected !== 'function' && this.state === REJECTED) {\n return this;\n }\n var promise = new this.constructor(INTERNAL);\n if (this.state !== PENDING) {\n var resolver = this.state === FULFILLED ? onFulfilled : onRejected;\n unwrap(promise, resolver, this.outcome);\n } else {\n this.queue.push(new QueueItem(promise, onFulfilled, onRejected));\n }\n\n return promise;\n};\nfunction QueueItem(promise, onFulfilled, onRejected) {\n this.promise = promise;\n if (typeof onFulfilled === 'function') {\n this.onFulfilled = onFulfilled;\n this.callFulfilled = this.otherCallFulfilled;\n }\n if (typeof onRejected === 'function') {\n this.onRejected = onRejected;\n this.callRejected = this.otherCallRejected;\n }\n}\nQueueItem.prototype.callFulfilled = function (value) {\n handlers.resolve(this.promise, value);\n};\nQueueItem.prototype.otherCallFulfilled = function (value) {\n unwrap(this.promise, this.onFulfilled, value);\n};\nQueueItem.prototype.callLine truncated
"mappings": "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 truncated
"names": ["require_localforage", "__commonJSMin", "exports", "module", "f", "g", "define", "e", "t", "n", "r", "s", "o", "u", "a", "__require", "i", "l", "_dereq_", "global", "Mutation", "scheduleDrain", "called", "observer", "nextTick", "element", "channel", "scriptEl", "draining", "queue", "oldQueue", "len", "immediate", "task", "INTERNAL", "handlers", "REJECTED", "FULFILLED", "PENDING", "Promise", "resolver", "safelyResolveThenable", "onRejected", "onFulfilled", "promise", "unwrap", "QueueItem", "value", "func", "returnValue", "self", "result", "tryCatch", "getThen", "thenable", "error", "obj", "then", "onError", "onSuccess", "tryToUnwrap", "out", "resolve", "reject", "reason", "all", "iterable", "values", "resolved", "allResolver", "resolveFromAll", "outValue", "race", "response", "_typeof", "_classCallCheck", "instance", "Constructor", "getIDB", "idb", "isIndexedDBValid", "isSafari", "hasFetch", "createBlob", "parts", "properties", "Builder", "builder", "Promise$1", "executeCallback", "callback", "executeTwoCallbacks", "errorCallback", "normalizeKey", "key", "getCallback", "DETECT_BLOB_SUPPORT_STORE", "supportsBlobs", "dbContexts", "toString", "READ_ONLY", "READ_WRITE", "_binStringToArrayBuffer", "bin", "length", "buf", "arr", "_checkBlobSupportWithoutCaching", "txn", "blob", "matchedChrome", "matchedEdge", "_checkBlobSupport", "_deferReadiness", "dbInfo", "dbContext", "deferredOperation", "_advanceReadiness", "_rejectReadiness", "err", "_getConnection", "upgradeNeeded", "createDbContext", "dbArgs", "openreq", "db", "ex", "_getOriginalConnection", "_getUpgradedConnection", "_isUpgradeNeeded", "defaultVersion", "isNewStore", "isDowngrade", "isUpgrade", "incVersion", "_encodeBlob", "reader", "base64", "_decodeBlob", "encodedBlob", "arrayBuff", "_isEncodedBlob", "_fullyReady", "_tryReconnect", "forages", "forage", "createTransaction", "mode", "retries", "tx", "_initStorage", "options", "initPromises", "ignoreErrors", "j", "k", "getItem", "transaction", "store", "req", "iterate", "iterator", "iterationNumber", "cursor", "setItem", "blobSupport", "removeItem", "clear", "advanced", "keys", "dropInstance", "currentConfig", "isCurrentDb", "dbPromise", "newVersion", "dropObjectPromise", "_forage2", "dropDBPromise", "_forage", "asyncStorage", "isWebSQLValid", "BASE_CHARS", "BLOB_TYPE_PREFIX", "BLOB_TYPE_PREFIX_REGEX", "SERIALIZED_MARKER", "SERIALIZED_MARKER_LENGTH", "TYPE_ARRAYBUFFER", "TYPE_BLOB", "TYPE_INT8ARRAY", "TYPE_UINT8ARRAY", "TYPE_UINT8CLAMPEDARRAY", "TYPE_INT16ARRAY", "TYPE_INT32ARRAY", "TYPE_UINT16ARRAY", "TYPE_UINT32ARRAY", "TYPE_FLOAT32ARRAY", "TYPE_FLOAT64ARRAY", "TYPE_SERIALIZED_MARKER_LENGTH", "toString$1", "stringToBuffer", "serializedString", "bufferLength", "p", "encoded1", "encoded2", "encoded3", "encoded4", "buffer", "bytes", "bufferToString", "base64String", "serialize", "valueType", "marker", "fileReader", "str", "deserialize", "type", "blobType", "matcher", "localforageSerializer", "createDbTable", "_initStorage$1", "dbInfoPromise", "tryExecuteSql", "sqlStatement", "args", "results", "getItem$1", "iterate$1", "rows", "item", "_setItem", "retriesLeft", "originalValue", "sqlError", "setItem$1", "removeItem$1", "clear$1", "length$1", "key$1", "keys$1", "getAllStoreNames", "storeNames", "dropInstance$1", "operationInfo", "dropTable", "storeName", "operations", "webSQLStorage", "isLocalStorageValid", "_getKeyPrefix", "defaultConfig", "keyPrefix", "checkIfLocalStorageThrows", "localStorageTestKey", "_isLocalStorageUsable", "_initStorage$2", "clear$2", "getItem$2", "iterate$2", "keyPrefixLength", "key$2", "keys$2", "itemKey", "length$2", "removeItem$2", "setItem$2", "dropInstance$2", "localStorageWrapper", "sameValue", "x", "y", "includes", "array", "searchElement", "isArray", "arg", "DefinedDrivers", "DriverSupport", "DefaultDrivers", "DefaultDriverOrder", "OptionalDriverMethods", "LibraryMethods", "DefaultConfig", "callWhenReady", "localForageInstance", "libraryMethod", "_args", "extend", "_key", "LocalForage", "driverTypeKey", "driver", "driverName", "driverObject", "complianceError", "driverMethods", "driverMethodName", "isRequired", "configureMissingMethods", "methodNotImplementedFactory", "methodName", "_i", "_len", "optionalDriverMethod", "setDriverSupport", "support", "getDriverPromise", "serializerPromise", "drivers", "supportedDrivers", "setDriverToConfig", "extendSelfWithDriver", "initDriver", "currentDriverIndex", "driverPromiseLoop", "oldDriverSetDone", "libraryMethodsAndProperties", "localforage_js", "require_jquery", "__commonJSMin", "exports", "module", "global", "factory", "w", "window", "noGlobal", "arr", "getProto", "slice", "flat", "array", "push", "indexOf", "class2type", "toString", "hasOwn", "fnToString", "ObjectFunctionString", "support", "isFunction", "obj", "isWindow", "document", "preservedScriptAttributes", "DOMEval", "code", "node", "doc", "i", "val", "script", "toType", "version", "rhtmlSuffix", "jQuery", "selector", "context", "num", "elems", "ret", "callback",Line truncated
}
+29 -29
View File
@@ -1,37 +1,37 @@
import{a as hc,b as ko,c as P1}from"./chunk-JSIZCY7X.js";import{a as Rg}from"./chunk-LNOKARBD.js";import{a as _g,b as Cg,c as k1}from"./chunk-KJNUV3FX.js";import{D as $u,J as Pu,t as Tg,u as Xg}from"./chunk-ZBO3TMVB.js";import{A as Zs,E as fr,F as xu,G as Po,I as lc,J as $g,K as yu,T as wu,V as Pg,a as cn,b as ba,ba as cc,ca as kg,d as li,da as Sa,e as Su,f as ci,g as ht,h as Qu,k as xg,m as rc,n as nc,o as sc,p as Es,q as yg,t as oc,w as wg,x as vu,y as ac,z as Qi}from"./chunk-NIHHDIEJ.js";import{a as zi,b as ic,c as ma,d as gu,e as bu}from"./chunk-KT7KMEQC.js";var Tu=gu((Ag,ku)=>{(function(i){if(typeof Ag=="object"&&typeof ku!="undefined")ku.exports=i();else if(typeof define=="function"&&define.amd)define([],i);else{var e;typeof window!="undefined"?e=window:typeof global!="undefined"?e=global:typeof self!="undefined"?e=self:e=this,e.localforage=i()}})(function(){var i,e,t;return(function r(n,s,o){function a(f,O){if(!s[f]){if(!n[f]){var m=typeof ma=="function"&&ma;if(!O&&m)return m(f,!0);if(l)return l(f,!0);var b=new Error("Cannot find module '"+f+"'");throw b.code="MODULE_NOT_FOUND",b}var v=s[f]={exports:{}};n[f][0].call(v.exports,function(P){var T=n[f][1][P];return a(T||P)},v,v.exports,r,n,s,o)}return s[f].exports}for(var l=typeof ma=="function"&&ma,h=0;h<o.length;h++)a(o[h]);return a})({1:[function(r,n,s){(function(o){"use strict";var a=o.MutationObserver||o.WebKitMutationObserver,l;if(a){var h=0,f=new a(P),O=o.document.createTextNode("");f.observe(O,{characterData:!0}),l=function(){O.data=h=++h%2}}else if(!o.setImmediate&&typeof o.MessageChannel!="undefined"){var m=new o.MessageChannel;m.port1.onmessage=P,l=function(){m.port2.postMessage(0)}}else"document"in o&&"onreadystatechange"in o.document.createElement("script")?l=function(){var Y=o.document.createElement("script");Y.onreadystatechange=function(){P(),Y.onreadystatechange=null,Y.parentNode.removeChild(Y),Y=null},o.document.documentElement.appendChild(Y)}:l=function(){setTimeout(P,0)};var b,v=[];function P(){b=!0;for(var Y,B,q=v.length;q;){for(B=v,v=[],Y=-1;++Y<q;)B[Y]();q=v.length}b=!1}n.exports=T;function T(Y){v.push(Y)===1&&!b&&l()}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(r,n,s){"use strict";var o=r(1);function a(){}var l={},h=["REJECTED"],f=["FULFILLED"],O=["PENDING"];n.exports=m;function m(d){if(typeof d!="function")throw new TypeError("resolver must be a function");this.state=O,this.queue=[],this.outcome=void 0,d!==a&&T(this,d)}m.prototype.catch=function(d){return this.then(null,d)},m.prototype.then=function(d,j){if(typeof d!="function"&&this.state===f||typeof j!="function"&&this.state===h)return this;var F=new this.constructor(a);if(this.state!==O){var Oe=this.state===f?d:j;v(F,Oe,this.outcome)}else this.queue.push(new b(F,d,j));return F};function b(d,j,F){this.promise=d,typeof j=="function"&&(this.onFulfilled=j,this.callFulfilled=this.otherCallFulfilled),typeof F=="function"&&(this.onRejected=F,this.callRejected=this.otherCallRejected)}b.prototype.callFulfilled=function(d){l.resolve(this.promise,d)},b.prototype.otherCallFulfilled=function(d){v(this.promise,this.onFulfilled,d)},b.prototype.callRejected=function(d){l.reject(this.promise,d)},b.prototype.otherCallRejected=function(d){v(this.promise,this.onRejected,d)};function v(d,j,F){o(function(){var Oe;try{Oe=j(F)}catch(Ye){return l.reject(d,Ye)}Oe===d?l.reject(d,new TypeError("Cannot resolve promise with itself")):l.resolve(d,Oe)})}l.resolve=function(d,j){var F=Y(P,j);if(F.status==="error")return l.reject(d,F.value);var Oe=F.value;if(Oe)T(d,Oe);else{d.state=f,d.outcome=j;for(var Ye=-1,ge=d.queue.length;++Ye<ge;)d.queue[Ye].callFulfilled(j)}return d},l.reject=function(d,j){d.state=h,d.outcome=j;for(var F=-1,Oe=d.queue.length;++F<Oe;)d.queue[F].callRejected(j);return d};function P(d){var j=d&&d.then;if(d&&(typeof d=="object"||typeof d=="function")&&typeof j=="function")return function(){j.apply(d,arguments)}}function T(d,j){var F=!1;function Oe(Te){F||(F=!0,l.reject(d,Te))}function Ye(Te){F||(F=!0,l.resolve(d,Te))}function ge(){j(Ye,Oe)}var ie=Y(ge);ie.status==="error"&&Oe(ie.value)}function Y(d,j){var F={};try{F.value=d(j),F.status="success"}catch(Oe){F.status="error",F.value=Oe}return F}m.resolve=B;function B(d){return d instanceof this?d:l.resolve(new this(a),d)}m.reject=q;function q(d){var j=new this(a);return l.reject(j,d)}m.all=N;function N(d){var j=this;if(Object.prototype.toString.call(d)!=="[object Array]")return this.reject(new TypeError("must be an array"));var F=d.length,Oe=!1;if(!F)return this.resolve([]);for(var Ye=new Array(F),ge=0,ie=-1,Te=new this(a);++ie<F;)Ze(d[ie],ie);return Te;function Ze(Be,te){j.resolve(Be).then(ve,function(ce){Oe||(Oe=!0,l.reject(Te,ce))});function ve(ce){Ye[te]=ce,++ge===F&&!Oe&&(Oe=!0,l.resolve(Te,Ye))}}}m.race=M;function M(d){var j=this;if(Object.prototype.toString.call(d)!=="[object Array]")return this.reject(new TypeError("must be an array"));var F=d.lengthLine truncated
`):c)),u};var ru=/^(?:focusinfocus|focusoutblur)$/,Hl=function(c){c.stopPropagation()};d.extend(d.event,{trigger:function(c,u,p,g){var S,Q,y,R,_,z,G,ee,W=[p||T],oe=f.call(c,"type")?c.type:c,Ve=f.call(c,"namespace")?c.namespace.split("."):[];if(Q=ee=y=p=p||T,!(p.nodeType===3||p.nodeType===8)&&!ru.test(oe+d.event.triggered)&&(oe.indexOf(".")>-1&&(Ve=oe.split("."),oe=Ve.shift(),Ve.sort()),_=oe.indexOf(":")<0&&"on"+oe,c=c[d.expando]?c:new d.Event(oe,typeof c=="object"&&c),c.isTrigger=g?2:3,c.namespace=Ve.join("."),c.rnamespace=c.namespace?new RegExp("(^|\\.)"+Ve.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,c.result=void 0,c.target||(c.target=p),u=u==null?[c]:d.makeArray(u,[c]),G=d.event.special[oe]||{},!(!g&&G.trigger&&G.trigger.apply(p,u)===!1))){if(!g&&!G.noBubble&&!P(p)){for(R=G.delegateType||oe,ru.test(R+oe)||(Q=Q.parentNode);Q;Q=Q.parentNode)W.push(Q),y=Q;y===(p.ownerDocument||T)&&W.push(y.defaultView||y.parentWindow||i)}for(S=0;(Q=W[S++])&&!c.isPropagationStopped();)ee=Q,c.type=S>1?R:G.bindType||oe,z=(we.get(Q,"events")||Object.create(null))[c.type]&&we.get(Q,"handle"),z&&z.apply(Q,u),z=_&&Q[_],z&&z.apply&&nr(Q)&&(c.result=z.apply(Q,u),c.result===!1&&c.preventDefault());return c.type=oe,!g&&!c.isDefaultPrevented()&&(!G._default||G._default.apply(W.pop(),u)===!1)&&nr(p)&&_&&v(p[oe])&&!P(p)&&(y=p[_],y&&(p[_]=null),d.event.triggered=oe,c.isPropagationStopped()&&ee.addEventListener(oe,Hl),p[oe](),c.isPropagationStopped()&&ee.removeEventListener(oe,Hl),d.event.triggered=void 0,y&&(p[_]=y)),c.result}},simulate:function(c,u,p){var g=d.extend(new d.Event,p,{type:c,isSimulated:!0});d.event.trigger(g,null,u)}}),d.fn.extend({trigger:function(c,u){return this.each(function(){d.event.trigger(c,u,this)})},triggerHandler:function(c,u){var p=this[0];if(p)return d.event.trigger(c,u,p,!0)}});var nu=/\[\]$/,fa=/\r?\n/g,n1=/^(?:submit|button|image|reset|file)$/i,s1=/^(?:input|select|textarea|keygen)/i;function su(c,u,p,g){var S;if(Array.isArray(u))d.each(u,function(Q,y){p||nu.test(c)?g(c,y):su(c+"["+(typeof y=="object"&&y!=null?Q:"")+"]",y,p,g)});else if(!p&&q(u)==="object")for(S in u)su(c+"["+S+"]",u[S],p,g);else g(c,u)}d.param=function(c,u){var p,g=[],S=function(Q,y){var R=v(y)?y():y;g[g.length]=encodeURIComponent(Q)+"="+encodeURIComponent(R==null?"":R)};if(c==null)return"";if(Array.isArray(c)||c.jquery&&!d.isPlainObject(c))d.each(c,function(){S(this.name,this.value)});else for(p in c)su(p,c[p],u,S);return g.join("&")},d.fn.extend({serialize:function(){return d.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var c=d.prop(this,"elements");return c?d.makeArray(c):this}).filter(function(){var c=this.type;return this.name&&!d(this).is(":disabled")&&s1.test(this.nodeName)&&!n1.test(c)&&(this.checked||!Wt.test(c))}).map(function(c,u){var p=d(this).val();return p==null?null:Array.isArray(p)?d.map(p,function(g){return{name:u.name,value:g.replace(fa,`\r
import{a as hc,b as ko,c as P1}from"./chunk-JSIZCY7X.js";import{a as Rg}from"./chunk-LNOKARBD.js";import{a as _g,b as Cg,c as k1}from"./chunk-XFAJRCL6.js";import{D as $u,J as Pu,t as Tg,u as Xg}from"./chunk-ZBO3TMVB.js";import{A as Zs,E as fr,F as yu,G as Po,I as lc,J as $g,K as xu,T as wu,V as Pg,a as cn,b as ba,ba as cc,ca as kg,d as li,da as Sa,e as Su,f as ci,g as ht,h as Qu,k as yg,m as rc,n as nc,o as sc,p as Es,q as xg,t as oc,w as wg,x as vu,y as ac,z as Qi}from"./chunk-NIHHDIEJ.js";import{a as zi,b as ic,c as ma,d as gu,e as bu}from"./chunk-KT7KMEQC.js";var Tu=gu((Ag,ku)=>{(function(i){if(typeof Ag=="object"&&typeof ku!="undefined")ku.exports=i();else if(typeof define=="function"&&define.amd)define([],i);else{var e;typeof window!="undefined"?e=window:typeof global!="undefined"?e=global:typeof self!="undefined"?e=self:e=this,e.localforage=i()}})(function(){var i,e,t;return(function r(n,s,o){function a(f,O){if(!s[f]){if(!n[f]){var m=typeof ma=="function"&&ma;if(!O&&m)return m(f,!0);if(l)return l(f,!0);var b=new Error("Cannot find module '"+f+"'");throw b.code="MODULE_NOT_FOUND",b}var v=s[f]={exports:{}};n[f][0].call(v.exports,function(P){var X=n[f][1][P];return a(X||P)},v,v.exports,r,n,s,o)}return s[f].exports}for(var l=typeof ma=="function"&&ma,h=0;h<o.length;h++)a(o[h]);return a})({1:[function(r,n,s){(function(o){"use strict";var a=o.MutationObserver||o.WebKitMutationObserver,l;if(a){var h=0,f=new a(P),O=o.document.createTextNode("");f.observe(O,{characterData:!0}),l=function(){O.data=h=++h%2}}else if(!o.setImmediate&&typeof o.MessageChannel!="undefined"){var m=new o.MessageChannel;m.port1.onmessage=P,l=function(){m.port2.postMessage(0)}}else"document"in o&&"onreadystatechange"in o.document.createElement("script")?l=function(){var Y=o.document.createElement("script");Y.onreadystatechange=function(){P(),Y.onreadystatechange=null,Y.parentNode.removeChild(Y),Y=null},o.document.documentElement.appendChild(Y)}:l=function(){setTimeout(P,0)};var b,v=[];function P(){b=!0;for(var Y,G,q=v.length;q;){for(G=v,v=[],Y=-1;++Y<q;)G[Y]();q=v.length}b=!1}n.exports=X;function X(Y){v.push(Y)===1&&!b&&l()}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(r,n,s){"use strict";var o=r(1);function a(){}var l={},h=["REJECTED"],f=["FULFILLED"],O=["PENDING"];n.exports=m;function m(d){if(typeof d!="function")throw new TypeError("resolver must be a function");this.state=O,this.queue=[],this.outcome=void 0,d!==a&&X(this,d)}m.prototype.catch=function(d){return this.then(null,d)},m.prototype.then=function(d,j){if(typeof d!="function"&&this.state===f||typeof j!="function"&&this.state===h)return this;var F=new this.constructor(a);if(this.state!==O){var Oe=this.state===f?d:j;v(F,Oe,this.outcome)}else this.queue.push(new b(F,d,j));return F};function b(d,j,F){this.promise=d,typeof j=="function"&&(this.onFulfilled=j,this.callFulfilled=this.otherCallFulfilled),typeof F=="function"&&(this.onRejected=F,this.callRejected=this.otherCallRejected)}b.prototype.callFulfilled=function(d){l.resolve(this.promise,d)},b.prototype.otherCallFulfilled=function(d){v(this.promise,this.onFulfilled,d)},b.prototype.callRejected=function(d){l.reject(this.promise,d)},b.prototype.otherCallRejected=function(d){v(this.promise,this.onRejected,d)};function v(d,j,F){o(function(){var Oe;try{Oe=j(F)}catch(Ye){return l.reject(d,Ye)}Oe===d?l.reject(d,new TypeError("Cannot resolve promise with itself")):l.resolve(d,Oe)})}l.resolve=function(d,j){var F=Y(P,j);if(F.status==="error")return l.reject(d,F.value);var Oe=F.value;if(Oe)X(d,Oe);else{d.state=f,d.outcome=j;for(var Ye=-1,ge=d.queue.length;++Ye<ge;)d.queue[Ye].callFulfilled(j)}return d},l.reject=function(d,j){d.state=h,d.outcome=j;for(var F=-1,Oe=d.queue.length;++F<Oe;)d.queue[F].callRejected(j);return d};function P(d){var j=d&&d.then;if(d&&(typeof d=="object"||typeof d=="function")&&typeof j=="function")return function(){j.apply(d,arguments)}}function X(d,j){var F=!1;function Oe(Te){F||(F=!0,l.reject(d,Te))}function Ye(Te){F||(F=!0,l.resolve(d,Te))}function ge(){j(Ye,Oe)}var ie=Y(ge);ie.status==="error"&&Oe(ie.value)}function Y(d,j){var F={};try{F.value=d(j),F.status="success"}catch(Oe){F.status="error",F.value=Oe}return F}m.resolve=G;function G(d){return d instanceof this?d:l.resolve(new this(a),d)}m.reject=q;function q(d){var j=new this(a);return l.reject(j,d)}m.all=N;function N(d){var j=this;if(Object.prototype.toString.call(d)!=="[object Array]")return this.reject(new TypeError("must be an array"));var F=d.length,Oe=!1;if(!F)return this.resolve([]);for(var Ye=new Array(F),ge=0,ie=-1,Te=new this(a);++ie<F;)Ze(d[ie],ie);return Te;function Ze(Be,te){j.resolve(Be).then(ve,function(ce){Oe||(Oe=!0,l.reject(Te,ce))});function ve(ce){Ye[te]=ce,++ge===F&&!Oe&&(Oe=!0,l.resolve(Te,Ye))}}}m.race=V;function V(d){var j=this;if(Object.prototype.toString.call(d)!=="[object Array]")return this.reject(new TypeError("must be an array"));var F=d.lengthLine truncated
`):c)),u};var ru=/^(?:focusinfocus|focusoutblur)$/,Hl=function(c){c.stopPropagation()};d.extend(d.event,{trigger:function(c,u,p,g){var S,Q,x,R,_,z,B,ee,W=[p||X],oe=f.call(c,"type")?c.type:c,Ve=f.call(c,"namespace")?c.namespace.split("."):[];if(Q=ee=x=p=p||X,!(p.nodeType===3||p.nodeType===8)&&!ru.test(oe+d.event.triggered)&&(oe.indexOf(".")>-1&&(Ve=oe.split("."),oe=Ve.shift(),Ve.sort()),_=oe.indexOf(":")<0&&"on"+oe,c=c[d.expando]?c:new d.Event(oe,typeof c=="object"&&c),c.isTrigger=g?2:3,c.namespace=Ve.join("."),c.rnamespace=c.namespace?new RegExp("(^|\\.)"+Ve.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,c.result=void 0,c.target||(c.target=p),u=u==null?[c]:d.makeArray(u,[c]),B=d.event.special[oe]||{},!(!g&&B.trigger&&B.trigger.apply(p,u)===!1))){if(!g&&!B.noBubble&&!P(p)){for(R=B.delegateType||oe,ru.test(R+oe)||(Q=Q.parentNode);Q;Q=Q.parentNode)W.push(Q),x=Q;x===(p.ownerDocument||X)&&W.push(x.defaultView||x.parentWindow||i)}for(S=0;(Q=W[S++])&&!c.isPropagationStopped();)ee=Q,c.type=S>1?R:B.bindType||oe,z=(we.get(Q,"events")||Object.create(null))[c.type]&&we.get(Q,"handle"),z&&z.apply(Q,u),z=_&&Q[_],z&&z.apply&&nr(Q)&&(c.result=z.apply(Q,u),c.result===!1&&c.preventDefault());return c.type=oe,!g&&!c.isDefaultPrevented()&&(!B._default||B._default.apply(W.pop(),u)===!1)&&nr(p)&&_&&v(p[oe])&&!P(p)&&(x=p[_],x&&(p[_]=null),d.event.triggered=oe,c.isPropagationStopped()&&ee.addEventListener(oe,Hl),p[oe](),c.isPropagationStopped()&&ee.removeEventListener(oe,Hl),d.event.triggered=void 0,x&&(p[_]=x)),c.result}},simulate:function(c,u,p){var g=d.extend(new d.Event,p,{type:c,isSimulated:!0});d.event.trigger(g,null,u)}}),d.fn.extend({trigger:function(c,u){return this.each(function(){d.event.trigger(c,u,this)})},triggerHandler:function(c,u){var p=this[0];if(p)return d.event.trigger(c,u,p,!0)}});var nu=/\[\]$/,fa=/\r?\n/g,n1=/^(?:submit|button|image|reset|file)$/i,s1=/^(?:input|select|textarea|keygen)/i;function su(c,u,p,g){var S;if(Array.isArray(u))d.each(u,function(Q,x){p||nu.test(c)?g(c,x):su(c+"["+(typeof x=="object"&&x!=null?Q:"")+"]",x,p,g)});else if(!p&&q(u)==="object")for(S in u)su(c+"["+S+"]",u[S],p,g);else g(c,u)}d.param=function(c,u){var p,g=[],S=function(Q,x){var R=v(x)?x():x;g[g.length]=encodeURIComponent(Q)+"="+encodeURIComponent(R==null?"":R)};if(c==null)return"";if(Array.isArray(c)||c.jquery&&!d.isPlainObject(c))d.each(c,function(){S(this.name,this.value)});else for(p in c)su(p,c[p],u,S);return g.join("&")},d.fn.extend({serialize:function(){return d.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var c=d.prop(this,"elements");return c?d.makeArray(c):this}).filter(function(){var c=this.type;return this.name&&!d(this).is(":disabled")&&s1.test(this.nodeName)&&!n1.test(c)&&(this.checked||!Wt.test(c))}).map(function(c,u){var p=d(this).val();return p==null?null:Array.isArray(p)?d.map(p,function(g){return{name:u.name,value:g.replace(fa,`\r
`)}}):{name:u.name,value:p.replace(fa,`\r
`)}}).get()}});var o1=/%20/g,a1=/#.*$/,l1=/([?&])_=[^&]*/,c1=/^(.*?):[ \t]*([^\r\n]*)$/mg,h1=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,f1=/^(?:GET|HEAD)$/,u1=/^\/\//,dg={},ou={},pg="*/".concat("*"),au=T.createElement("a");au.href=yn.href;function mg(c){return function(u,p){typeof u!="string"&&(p=u,u="*");var g,S=0,Q=u.toLowerCase().match(Oi)||[];if(v(p))for(;g=Q[S++];)g[0]==="+"?(g=g.slice(1)||"*",(c[g]=c[g]||[]).unshift(p)):(c[g]=c[g]||[]).push(p)}}function gg(c,u,p,g){var S={},Q=c===ou;function y(R){var _;return S[R]=!0,d.each(c[R]||[],function(z,G){var ee=G(u,p,g);if(typeof ee=="string"&&!Q&&!S[ee])return u.dataTypes.unshift(ee),y(ee),!1;if(Q)return!(_=ee)}),_}return y(u.dataTypes[0])||!S["*"]&&y("*")}function lu(c,u){var p,g,S=d.ajaxSettings.flatOptions||{};for(p in u)u[p]!==void 0&&((S[p]?c:g||(g={}))[p]=u[p]);return g&&d.extend(!0,c,g),c}function O1(c,u,p){for(var g,S,Q,y,R=c.contents,_=c.dataTypes;_[0]==="*";)_.shift(),g===void 0&&(g=c.mimeType||u.getResponseHeader("Content-Type"));if(g){for(S in R)if(R[S]&&R[S].test(g)){_.unshift(S);break}}if(_[0]in p)Q=_[0];else{for(S in p){if(!_[0]||c.converters[S+" "+_[0]]){Q=S;break}y||(y=S)}Q=Q||y}if(Q)return Q!==_[0]&&_.unshift(Q),p[Q]}function d1(c,u,p,g){var S,Q,y,R,_,z={},G=c.dataTypes.slice();if(G[1])for(y in c.converters)z[y.toLowerCase()]=c.converters[y];for(Q=G.shift();Q;)if(c.responseFields[Q]&&(p[c.responseFields[Q]]=u),!_&&g&&c.dataFilter&&(u=c.dataFilter(u,c.dataType)),_=Q,Q=G.shift(),Q){if(Q==="*")Q=_;else if(_!=="*"&&_!==Q){if(y=z[_+" "+Q]||z["* "+Q],!y){for(S in z)if(R=S.split(" "),R[1]===Q&&(y=z[_+" "+R[0]]||z["* "+R[0]],y)){y===!0?y=z[S]:z[S]!==!0&&(Q=R[0],G.unshift(R[1]));break}}if(y!==!0)if(y&&c.throws)u=y(u);else try{u=y(u)}catch(ee){return{state:"parsererror",error:y?ee:"No conversion from "+_+" to "+Q}}}}return{state:"success",data:u}}d.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn.href,type:"GET",isLocal:h1.test(yn.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":pg,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":d.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(c,u){return u?lu(lu(c,d.ajaxSettings),u):lu(d.ajaxSettings,c)},ajaxPrefilter:mg(dg),ajaxTransport:mg(ou),ajax:function(c,u){typeof c=="object"&&(u=c,c=void 0),u=u||{};var p,g,S,Q,y,R,_,z,G,ee,W=d.ajaxSetup({},u),oe=W.context||W,Ve=W.context&&(oe.nodeType||oe.jquery)?d(oe):d.event,st=d.Deferred(),Ie=d.Callbacks("once memory"),ei=W.statusCode||{},qt={},nn={},sn="canceled",et={readyState:0,getResponseHeader:function(ct){var Et;if(_){if(!Q)for(Q={};Et=c1.exec(S);)Q[Et[1].toLowerCase()+" "]=(Q[Et[1].toLowerCase()+" "]||[]).concat(Et[2]);Et=Q[ct.toLowerCase()+" "]}return Et==null?null:Et.join(", ")},getAllResponseHeaders:function(){return _?S:null},setRequestHeader:function(ct,Et){return _==null&&(ct=nn[ct.toLowerCase()]=nn[ct.toLowerCase()]||ct,qt[ct]=Et),this},overrideMimeType:function(ct){return _==null&&(W.mimeType=ct),this},statusCode:function(ct){var Et;if(ct)if(_)et.always(ct[et.status]);else for(Et in ct)ei[Et]=[ei[Et],ct[Et]];return this},abort:function(ct){var Et=ct||sn;return p&&p.abort(Et),As(0,Et),this}};if(st.promise(et),W.url=((c||W.url||yn.href)+"").replace(u1,yn.protocol+"//"),W.type=u.method||u.type||W.method||W.type,W.dataTypes=(W.dataType||"*").toLowerCase().match(Oi)||[""],W.crossDomain==null){R=T.createElement("a");try{R.href=W.url,R.href=R.href,W.crossDomain=au.protocol+"//"+au.host!=R.protocol+"//"+R.host}catch(ct){W.crossDomain=!0}}if(W.data&&W.processData&&typeof W.data!="string"&&(W.data=d.param(W.data,W.traditional)),gg(dg,W,u,et),_)return et;z=d.event&&W.global,z&&d.active++===0&&d.event.trigger("ajaxStart"),W.type=W.type.toUpperCase(),W.hasContent=!f1.test(W.type),g=W.url.replace(a1,""),W.hasContent?W.data&&W.processData&&(W.contentType||"").indexOf("application/x-www-form-urlencoded")===0&&(W.data=W.data.replace(o1,"+")):(ee=W.url.slice(g.length),W.data&&(W.processData||typeof W.data=="string")&&(g+=(Cs.test(g)?"&":"?")+W.data,delete W.data),W.cache===!1&&(g=g.replace(l1,"$1"),ee=(Cs.test(g)?"&":"?")+"_="+Fl.guid+++ee),W.url=g+ee),W.ifModified&&(d.lastModified[g]&&et.setRequestHeader("If-Modified-Since",d.lastModified[g]),d.etag[g]&&et.setRequestHeader("If-None-Match",d.etag[g])),(W.data&&W.hasContent&&W.contentType!==!1||u.contentType)&&et.setRequestHeader("Content-Type",W.contentType),et.setRequestHeader("Accept",W.dataTypes[0]&&W.accepts[W.dataTypes[0]]?W.accepts[W.dataTypes[0]]+(W.dataTypes[0]!=="*"?", "+pg+"; q=0.01":""):W.accepts["*"]);for(G in W.headers)et.setRequestHeader(G,W.headers[G]);if(W.beforeSend&&(W.beforeSend.call(oe,et,W)===!1||_))return et.abort();if(sn="ab Line truncated
`+Vt),kr&&If([ie,Te,Ze],Gt=>{Vt=Ul(Vt,Gt," ")}),N&&Hr?N.createHTML(Vt):Vt},e.setConfig=function(){let Pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};or(Pe),Ht=!0},e.clearConfig=function(){tn=null,Ht=!1},e.isValidAttribute=function(Pe,A,ae){tn||or({});let xe=kt(Pe),pt=kt(A);return Cr(xe,pt,ae)},e.addHook=function(Pe,A){typeof A=="function"&&Zl(ge[Pe],A)},e.removeHook=function(Pe,A){if(A!==void 0){let ae=hA(ge[Pe],A);return ae===-1?void 0:fA(ge[Pe],ae,1)[0]}return ww(ge[Pe])},e.removeHooks=function(Pe){ge[Pe]=[]},e.removeAllHooks=function(){ge=_w()},e}var TA=Yw();Ew.exports=TA});var sg=bu(Tu());function Us(i,e,t,r){window.ga&&ga("send","event",i,e,t,r)}function Yg(i){window.ga&&ga("send","pageview",i)}function yt(i){i?(Yr(0),$("#pleaseWaitModal").modal("show")):(Yr(1),$("#pleaseWaitModal").modal("hide"))}function Yr(i){$("#pleaseWaitProgressBar").css("width",i*100+"%").show()}function Ge(i){yt(!1),bootbox.alert({title:'<span class="glyphicon glyphicon-alert" aria-hidden="true"></span> Alert',message:ko.sanitize(i)})}function Li(i){yt(!1),bootbox.alert(ko.sanitize(i))}function Eg(i){throw Ge(i),new Error(i)}var Qa=class{constructor(e,t){e=e||[],this.lines=e,this.text=t,this.offset2loc=new Map,this.line2offset=new Map;for(var r of e)r.offset>=0&&(this.offset2loc[r.offset]||(this.offset2loc[r.offset]=r),this.line2offset[r.line]||(this.line2offset[r.line]=r.offset))}findLineForOffset(e,t){if(this.offset2loc)for(var r=0;r<=t;r++){var n=this.offset2loc[e];if(n)return n;e--}return null}lineCount(){return this.lines.length}};function Zg(i){return"errors"in i}function Ug(i){return"output"in i}var zg=bu(Tu()),fc=class{constructor(e){this.preset_id=Qi(e)}async getRemoteFile(e){return new Promise((t,r)=>ac(e,t,Es(e)?"arraybuffer":"text"))}async getFileData(e){var t="presets/"+this.preset_id+"/"+e,r=await this.getRemoteFile(t);return r&&console.log("read",t,r.length,"bytes"),r}async setFileData(e,t){}};var To=class{constructor(e,t){this.basefs=e,this.overlayfs=t}async getFileData(e){var t=await this.overlayfs.getFileData(e);return t==null?this.basefs.getFileData(e):t}async setFileData(e,t){return await this.overlayfs.setFileData(e,t),this.basefs.setFileData(e,t)}},uc=class{constructor(e){this.store=e}async getFileData(e){return this.store.getItem(e)}async setFileData(e,t){return this.store.setItem(e,t)}};var Oc=class{constructor(e,t,r,n){this.filedata={};this.pendingWorkerMessages=0;this.tools_preloaded={};this.isCompiling=!1;this.filename2path={};this.worker=e,this.platform_id=t,this.platform=r,this.filesystem=n,e.onmessage=s=>{this.receiveWorkerMessage(s.data)}}receiveWorkerMessage(e){var t=this.pendingWorkerMessages>1;t?(this.sendBuild(),this.pendingWorkerMessages=1):(this.callbackBuildStatus&&this.callbackBuildStatus(!1),this.isCompiling||(console.log(this.pendingWorkerMessages),console.trace()),this.isCompiling=!1,this.pendingWorkerMessages=0),e&&Ug(e)?this.processBuildResult(e):Zg(e)&&this.processBuildListings(e),this.callbackBuildResult(e)}getToolForFilename(e){return this.remoteTool?"remote:"+this.remoteTool:this.platform.getToolForFilename(e)}preloadWorker(e){var t=this.getToolForFilename(e);t&&!this.tools_preloaded[t]&&(this.worker.postMessage({preload:t,platform:this.platform_id}),this.tools_preloaded[t]=!0)}pushAllFiles(e,t){e.push(t);var r=Su(this.mainPath);r.length>0&&r!="local"&&e.push(r+"/"+t)}parseIncludeDependencies(e){let t=[],r;if(this.platform_id.startsWith("verilog")){let n=/^\s*(`include|[.]include)\s+"(.+?)"/gmi;for(;r=n.exec(e);)this.pushAllFiles(t,r[2]);let s=/^\s*\$(include|\$dofile|\$write_image_in_table)\('(.+?)'/gmi;for(;r=s.exec(e);)this.pushAllFiles(t,r[2]);let o=/^\s*([.]arch)\s+(\w+)/gmi;for(;r=o.exec(e);)this.pushAllFiles(t,r[2]+".json");let a=/\$readmem[bh]\("(.+?)"/gmi;for(;r=a.exec(e);)this.pushAllFiles(t,r[1])}else{let n=/^\s*[.#%]?(include|incbin|embed)\s+"(.+?)"/gmi;for(;r=n.exec(e);)this.pushAllFiles(t,r[2]);let s=/^\s*([;']|[/][/])#(resource)\s+"(.+?)"/gm;for(;r=s.exec(e);)this.pushAllFiles(t,r[3]);let o=/^\s+(USE|ASM)\s+(\S+[.]\S+)/gm;for(;r=o.exec(e);)this.pushAllFiles(t,r[2]);let a=/^\s*(import|embed)\s*"(.+?)";/gmi;for(;r=a.exec(e);)r[1]=="import"?this.pushAllFiles(t,r[2]+".wiz"):this.pushAllFiles(t,r[2]);let l=/^\s*(import)\s*"(.+?)"/gmi;for(;r=l.exec(e);)this.pushAllFiles(t,r[2]);let h=/^[!]src\s+"(.+?)"/gmi;for(;r=h.exec(e);)this.pushAllFiles(t,r[1])}return t}parseLinkDependencies(e){let t=[],r;if(!this.platform_id.startsWith("verilog")){let n=/^\s*([;]|[/][/])#link\s+"(.+?)"/gm;for(;r=n.exec(e);)this.pushAllFiles(t,r[2])}return t}loadFileDependencies(e){let t=this.parseIncludeDependencies(e),r=this.parseLinkDependencies(e),n=t.concat(r);return this.loadFiles(n).then(s=>{if(s)for(let o of s)o.link=r.indexOf(o.path)>=0;return s})}okToSend(){return this.pendingWorkerMessages++==0&&this.mainPath!=null}updateFileInStore(e,t){this.filesystem.setFileData(e,t)}buildWorkerMessage(e){this.preloadWorker(this.mainPath);var t={updates:[],buildsteps:[]},r=this.stripLocalLine truncated
`)}}).get()}});var o1=/%20/g,a1=/#.*$/,l1=/([?&])_=[^&]*/,c1=/^(.*?):[ \t]*([^\r\n]*)$/mg,h1=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,f1=/^(?:GET|HEAD)$/,u1=/^\/\//,dg={},ou={},pg="*/".concat("*"),au=X.createElement("a");au.href=xn.href;function mg(c){return function(u,p){typeof u!="string"&&(p=u,u="*");var g,S=0,Q=u.toLowerCase().match(Oi)||[];if(v(p))for(;g=Q[S++];)g[0]==="+"?(g=g.slice(1)||"*",(c[g]=c[g]||[]).unshift(p)):(c[g]=c[g]||[]).push(p)}}function gg(c,u,p,g){var S={},Q=c===ou;function x(R){var _;return S[R]=!0,d.each(c[R]||[],function(z,B){var ee=B(u,p,g);if(typeof ee=="string"&&!Q&&!S[ee])return u.dataTypes.unshift(ee),x(ee),!1;if(Q)return!(_=ee)}),_}return x(u.dataTypes[0])||!S["*"]&&x("*")}function lu(c,u){var p,g,S=d.ajaxSettings.flatOptions||{};for(p in u)u[p]!==void 0&&((S[p]?c:g||(g={}))[p]=u[p]);return g&&d.extend(!0,c,g),c}function O1(c,u,p){for(var g,S,Q,x,R=c.contents,_=c.dataTypes;_[0]==="*";)_.shift(),g===void 0&&(g=c.mimeType||u.getResponseHeader("Content-Type"));if(g){for(S in R)if(R[S]&&R[S].test(g)){_.unshift(S);break}}if(_[0]in p)Q=_[0];else{for(S in p){if(!_[0]||c.converters[S+" "+_[0]]){Q=S;break}x||(x=S)}Q=Q||x}if(Q)return Q!==_[0]&&_.unshift(Q),p[Q]}function d1(c,u,p,g){var S,Q,x,R,_,z={},B=c.dataTypes.slice();if(B[1])for(x in c.converters)z[x.toLowerCase()]=c.converters[x];for(Q=B.shift();Q;)if(c.responseFields[Q]&&(p[c.responseFields[Q]]=u),!_&&g&&c.dataFilter&&(u=c.dataFilter(u,c.dataType)),_=Q,Q=B.shift(),Q){if(Q==="*")Q=_;else if(_!=="*"&&_!==Q){if(x=z[_+" "+Q]||z["* "+Q],!x){for(S in z)if(R=S.split(" "),R[1]===Q&&(x=z[_+" "+R[0]]||z["* "+R[0]],x)){x===!0?x=z[S]:z[S]!==!0&&(Q=R[0],B.unshift(R[1]));break}}if(x!==!0)if(x&&c.throws)u=x(u);else try{u=x(u)}catch(ee){return{state:"parsererror",error:x?ee:"No conversion from "+_+" to "+Q}}}}return{state:"success",data:u}}d.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:xn.href,type:"GET",isLocal:h1.test(xn.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":pg,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":d.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(c,u){return u?lu(lu(c,d.ajaxSettings),u):lu(d.ajaxSettings,c)},ajaxPrefilter:mg(dg),ajaxTransport:mg(ou),ajax:function(c,u){typeof c=="object"&&(u=c,c=void 0),u=u||{};var p,g,S,Q,x,R,_,z,B,ee,W=d.ajaxSetup({},u),oe=W.context||W,Ve=W.context&&(oe.nodeType||oe.jquery)?d(oe):d.event,st=d.Deferred(),Ie=d.Callbacks("once memory"),ei=W.statusCode||{},qt={},nn={},sn="canceled",et={readyState:0,getResponseHeader:function(ct){var Et;if(_){if(!Q)for(Q={};Et=c1.exec(S);)Q[Et[1].toLowerCase()+" "]=(Q[Et[1].toLowerCase()+" "]||[]).concat(Et[2]);Et=Q[ct.toLowerCase()+" "]}return Et==null?null:Et.join(", ")},getAllResponseHeaders:function(){return _?S:null},setRequestHeader:function(ct,Et){return _==null&&(ct=nn[ct.toLowerCase()]=nn[ct.toLowerCase()]||ct,qt[ct]=Et),this},overrideMimeType:function(ct){return _==null&&(W.mimeType=ct),this},statusCode:function(ct){var Et;if(ct)if(_)et.always(ct[et.status]);else for(Et in ct)ei[Et]=[ei[Et],ct[Et]];return this},abort:function(ct){var Et=ct||sn;return p&&p.abort(Et),As(0,Et),this}};if(st.promise(et),W.url=((c||W.url||xn.href)+"").replace(u1,xn.protocol+"//"),W.type=u.method||u.type||W.method||W.type,W.dataTypes=(W.dataType||"*").toLowerCase().match(Oi)||[""],W.crossDomain==null){R=X.createElement("a");try{R.href=W.url,R.href=R.href,W.crossDomain=au.protocol+"//"+au.host!=R.protocol+"//"+R.host}catch(ct){W.crossDomain=!0}}if(W.data&&W.processData&&typeof W.data!="string"&&(W.data=d.param(W.data,W.traditional)),gg(dg,W,u,et),_)return et;z=d.event&&W.global,z&&d.active++===0&&d.event.trigger("ajaxStart"),W.type=W.type.toUpperCase(),W.hasContent=!f1.test(W.type),g=W.url.replace(a1,""),W.hasContent?W.data&&W.processData&&(W.contentType||"").indexOf("application/x-www-form-urlencoded")===0&&(W.data=W.data.replace(o1,"+")):(ee=W.url.slice(g.length),W.data&&(W.processData||typeof W.data=="string")&&(g+=(Cs.test(g)?"&":"?")+W.data,delete W.data),W.cache===!1&&(g=g.replace(l1,"$1"),ee=(Cs.test(g)?"&":"?")+"_="+Fl.guid+++ee),W.url=g+ee),W.ifModified&&(d.lastModified[g]&&et.setRequestHeader("If-Modified-Since",d.lastModified[g]),d.etag[g]&&et.setRequestHeader("If-None-Match",d.etag[g])),(W.data&&W.hasContent&&W.contentType!==!1||u.contentType)&&et.setRequestHeader("Content-Type",W.contentType),et.setRequestHeader("Accept",W.dataTypes[0]&&W.accepts[W.dataTypes[0]]?W.accepts[W.dataTypes[0]]+(W.dataTypes[0]!=="*"?", "+pg+"; q=0.01":""):W.accepts["*"]);for(B in W.headers)et.setRequestHeader(B,W.headers[B]);if(W.beforeSend&&(W.beforeSend.call(oe,et,W)===!1||_))return et.abort();if(sn="ab Line truncated
`+Vt),kr&&If([ie,Te,Ze],Gt=>{Vt=Ul(Vt,Gt," ")}),N&&Hr?N.createHTML(Vt):Vt},e.setConfig=function(){let Pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};or(Pe),Ht=!0},e.clearConfig=function(){tn=null,Ht=!1},e.isValidAttribute=function(Pe,A,ae){tn||or({});let ye=kt(Pe),pt=kt(A);return Cr(ye,pt,ae)},e.addHook=function(Pe,A){typeof A=="function"&&Zl(ge[Pe],A)},e.removeHook=function(Pe,A){if(A!==void 0){let ae=hA(ge[Pe],A);return ae===-1?void 0:fA(ge[Pe],ae,1)[0]}return ww(ge[Pe])},e.removeHooks=function(Pe){ge[Pe]=[]},e.removeAllHooks=function(){ge=_w()},e}var TA=Yw();Ew.exports=TA});var sg=bu(Tu());function Us(i,e,t,r){window.ga&&ga("send","event",i,e,t,r)}function Yg(i){window.ga&&ga("send","pageview",i)}function xt(i){i?(Yr(0),$("#pleaseWaitModal").modal("show")):(Yr(1),$("#pleaseWaitModal").modal("hide"))}function Yr(i){$("#pleaseWaitProgressBar").css("width",i*100+"%").show()}function Ge(i){xt(!1),bootbox.alert({title:'<span class="glyphicon glyphicon-alert" aria-hidden="true"></span> Alert',message:ko.sanitize(i)})}function Li(i){xt(!1),bootbox.alert(ko.sanitize(i))}function Eg(i){throw Ge(i),new Error(i)}var Qa=class{constructor(e,t){e=e||[],this.lines=e,this.text=t,this.offset2loc=new Map,this.line2offset=new Map;for(var r of e)r.offset>=0&&(this.offset2loc[r.offset]||(this.offset2loc[r.offset]=r),this.line2offset[r.line]||(this.line2offset[r.line]=r.offset))}findLineForOffset(e,t){if(this.offset2loc)for(var r=0;r<=t;r++){var n=this.offset2loc[e];if(n)return n;e--}return null}lineCount(){return this.lines.length}};function Zg(i){return"errors"in i}function Ug(i){return"output"in i}var zg=bu(Tu()),fc=class{constructor(e){this.preset_id=Qi(e)}async getRemoteFile(e){return new Promise((t,r)=>ac(e,t,Es(e)?"arraybuffer":"text"))}async getFileData(e){var t="presets/"+this.preset_id+"/"+e,r=await this.getRemoteFile(t);return r&&console.log("read",t,r.length,"bytes"),r}async setFileData(e,t){}};var To=class{constructor(e,t){this.basefs=e,this.overlayfs=t}async getFileData(e){var t=await this.overlayfs.getFileData(e);return t==null?this.basefs.getFileData(e):t}async setFileData(e,t){return await this.overlayfs.setFileData(e,t),this.basefs.setFileData(e,t)}},uc=class{constructor(e){this.store=e}async getFileData(e){return this.store.getItem(e)}async setFileData(e,t){return this.store.setItem(e,t)}};var Oc=class{constructor(e,t,r,n){this.filedata={};this.pendingWorkerMessages=0;this.tools_preloaded={};this.isCompiling=!1;this.filename2path={};this.worker=e,this.platform_id=t,this.platform=r,this.filesystem=n,e.onmessage=s=>{this.receiveWorkerMessage(s.data)}}receiveWorkerMessage(e){var t=this.pendingWorkerMessages>1;t?(this.sendBuild(),this.pendingWorkerMessages=1):(this.callbackBuildStatus&&this.callbackBuildStatus(!1),this.isCompiling||(console.log(this.pendingWorkerMessages),console.trace()),this.isCompiling=!1,this.pendingWorkerMessages=0),e&&Ug(e)?this.processBuildResult(e):Zg(e)&&this.processBuildListings(e),this.callbackBuildResult(e)}getToolForFilename(e){return this.remoteTool?"remote:"+this.remoteTool:this.platform.getToolForFilename(e)}preloadWorker(e){var t=this.getToolForFilename(e);t&&!this.tools_preloaded[t]&&(this.worker.postMessage({preload:t,platform:this.platform_id}),this.tools_preloaded[t]=!0)}pushAllFiles(e,t){e.push(t);var r=Su(this.mainPath);r.length>0&&r!="local"&&e.push(r+"/"+t)}parseIncludeDependencies(e){let t=[],r;if(this.platform_id.startsWith("verilog")){let n=/^\s*(`include|[.]include)\s+"(.+?)"/gmi;for(;r=n.exec(e);)this.pushAllFiles(t,r[2]);let s=/^\s*\$(include|\$dofile|\$write_image_in_table)\('(.+?)'/gmi;for(;r=s.exec(e);)this.pushAllFiles(t,r[2]);let o=/^\s*([.]arch)\s+(\w+)/gmi;for(;r=o.exec(e);)this.pushAllFiles(t,r[2]+".json");let a=/\$readmem[bh]\("(.+?)"/gmi;for(;r=a.exec(e);)this.pushAllFiles(t,r[1])}else{let n=/^\s*[.#%]?(include|incbin|embed)\s+"(.+?)"/gmi;for(;r=n.exec(e);)this.pushAllFiles(t,r[2]);let s=/^\s*([;']|[/][/])#(resource)\s+"(.+?)"/gm;for(;r=s.exec(e);)this.pushAllFiles(t,r[3]);let o=/^\s+(USE|ASM)\s+(\S+[.]\S+)/gm;for(;r=o.exec(e);)this.pushAllFiles(t,r[2]);let a=/^\s*(import|embed)\s*"(.+?)";/gmi;for(;r=a.exec(e);)r[1]=="import"?this.pushAllFiles(t,r[2]+".wiz"):this.pushAllFiles(t,r[2]);let l=/^\s*(import)\s*"(.+?)"/gmi;for(;r=l.exec(e);)this.pushAllFiles(t,r[2]);let h=/^[!]src\s+"(.+?)"/gmi;for(;r=h.exec(e);)this.pushAllFiles(t,r[1])}return t}parseLinkDependencies(e){let t=[],r;if(!this.platform_id.startsWith("verilog")){let n=/^\s*([;]|[/][/])#link\s+"(.+?)"/gm;for(;r=n.exec(e);)this.pushAllFiles(t,r[2])}return t}loadFileDependencies(e){let t=this.parseIncludeDependencies(e),r=this.parseLinkDependencies(e),n=t.concat(r);return this.loadFiles(n).then(s=>{if(s)for(let o of s)o.link=r.indexOf(o.path)>=0;return s})}okToSend(){return this.pendingWorkerMessages++==0&&this.mainPath!=null}updateFileInStore(e,t){this.filesystem.setFileData(e,t)}buildWorkerMessage(e){this.preloadWorker(this.mainPath);var t={updates:[],buildsteps:[]},r=this.stripLocalLine truncated
=====
[Open this project in 8bitworkshop](http://8bitworkshop.com/redir.html?platform=$PLATFORM&githubURL=$GITHUBURL&file=$MAINFILE).
`;function Xo(){for(var i={},e=0;e<localStorage.length;e++){var t=localStorage.key(e);if(t.startsWith("__repo__")){var r=JSON.parse(localStorage.getItem(t)),n=t.substring(8);i[n]=r}}return i}function va(i){var e=i.split("/",8);return e.length<5||e[0]!="https:"||e[2]!="github.com"||e[5]&&e[5]!="tree"?null:{user:e[3],repo:e[4],repopath:e[3]+"/"+e[4],branch:e[6],subtreepath:e[7]}}var pc=class{constructor(e,t,r,n){this.githubCons=e,this.githubToken=t,this.store=r,this.project=n,this.recreateGithub()}recreateGithub(){this.github=new this.githubCons({token:this.githubToken})}login(){if(this.githubToken&&this.githubToken.length)return new Promise((t,r)=>{t()});var e=new firebase.auth.GithubAuthProvider;return e.addScope("repo"),firebase.auth().signInWithPopup(e).then(t=>{this.githubToken=t.credential.accessToken;var r=t.user;this.recreateGithub(),document.cookie="__github_key="+this.githubToken+";path=/;max-age=31536000",console.log("Stored GitHub OAUTH key")})}logout(){return this.githubToken&&this.githubToken.length?firebase.auth().signOut().then(()=>{document.cookie="__github_key=;path=/;max-age=0",this.githubToken=null,this.recreateGithub()}):new Promise((e,t)=>{e()})}isFileIgnored(e){return e=e.toUpperCase(),!!(e.startsWith("LICENSE")||e.startsWith("README")||e.startsWith("."))}async getGithubSession(e){var t=va(e);if(!t)throw new Error("Please enter a valid GitHub URL.");var r=Xo()[t.repopath],n=t.branch||r&&r.branch,s=this.github.repos(t.user,t.repo);try{n=(await s.fetch()).defaultBranch||"master"}catch(a){console.log("could not fetch default branch: "+a),n="main"}console.log("branch =",n);var o={url:e,user:t.user,reponame:t.repo,repopath:t.repopath,branch:n,subtreepath:t.subtreepath,prefix:"",repo:s,platform_id:this.project?this.project.platform_id:r?r.platform_id:null};return o}getGithubHEADTree(e){var t;return this.getGithubSession(e).then(r=>(t=r,t.repo.git.refs.heads(t.branch).fetch())).then(r=>(t.head=r,t.sha=r.object.sha,t.repo.git.trees(t.sha).fetch())).then(r=>{if(t.subtreepath){for(let n of r.tree)if(n.type=="tree"&&n.path==t.subtreepath&&n.sha)return t.repo.git.trees(n.sha).fetch();throw Error("Cannot find subtree '"+t.subtreepath+"' in tree "+r.sha)}return r}).then(r=>(t.tree=r,t))}bind(e,t){var r="__repo__"+e.repopath;if(t){var n={url:e.url,branch:e.branch,platform_id:e.platform_id,mainPath:e.mainPath,sha:e.sha};console.log("storing",n),localStorage.setItem(r,JSON.stringify(n))}else localStorage.removeItem(r)}import(e){var t;return this.getGithubSession(e).then(r=>(t=r,t.repo.contents("README.md").read())).catch(r=>(console.log(r),console.log("no README.md found"),t.repo.fetch().then(n=>""))).then(r=>{var n;if(n=/8bitworkshop.com[^)]+file=([^)&]+)/.exec(r),n&&n[1]&&(console.log("main path: '"+n[1]+"'"),t.mainPath=n[1]),n=/8bitworkshop.com[^)]+platform=([A-Za-z0-9._\-]+)/.exec(r),n){if(console.log("platform id: '"+n[1]+"'"),t.platform_id&&!t.platform_id.startsWith(n[1]))throw Error("Platform mismatch: Repository is "+n[1]+", you have "+t.platform_id+" selected.");t.platform_id=n[1]}return this.bind(t,!0),t})}pull(e,t){var r;return this.getGithubHEADTree(e).then(n=>{r=n;let s=[];return r.paths=[],r.tree.tree.forEach(o=>{if(console.log(o.path,o.type,o.size),r.paths.push(o.path),o.type=="blob"&&!this.isFileIgnored(o.path)){var a=r.repo.git.blobs(o.sha).fetch().then(l=>{var h=r.prefix+o.path,f=o.size,O=l.encoding,m=l.content;if(l.encoding=="base64"){var b=rc(atob(m)),v=Es(o.path,b);m=v?b:sc(b)}return l.size!=m.length&&(m=m.slice(0,l.size)),(t||this.store).setItem(h,m)});s.push(a)}else console.log("ignoring "+o.path)}),Promise.all(s)}).then(n=>r)}importAndPull(e){return this.import(e).then(t=>this.pull(e))}publish(e,t,r,n){var s,o=this.project.platform_id,a=this.project.stripLocalPath(this.project.mainPath);return this.github.user.repos.create({name:e,description:t,private:n,auto_init:!1,license_template:r}).then(l=>{s=l;var h=T1;h=h.replace(/\$NAME/g,encodeURIComponent(e)),h=h.replace(/\$PLATFORM/g,encodeURIComponent(o)),h=h.replace(/\$GITHUBURL/g,encodeURIComponent(s.htmlUrl)),h=h.replace(/\$MAINFILE/g,encodeURIComponent(a));var f={message:"8bitworkshop: updated metadata in README.md",content:btoa(h)};return s.contents("README.md").add(f)}).then(()=>this.getGithubSession(s.htmlUrl))}commit(e,t,r){var n;return t||(t="updated from 8bitworkshop.com"),this.getGithubHEADTree(e).then(s=>{if(n=s,n.subtreepath)throw Error("Sorry, right now you can only commit files to the root directory of a repository.");return Promise.all(r.map(o=>typeof o.data=="string"?n.repo.git.blobs.create({content:o.data,encoding:"utf-8"}):n.repo.git.blobs.create({content:btoa(nc(o.data)),encoding:"base64"})))}).then(s=>n.repo.git.trees.create({tree:r.map((o,a)=>({path:o.path,mode:"100644",type:"blob",sha:s[a].sha})),base_tree:n.tree.sha})).then(s=>n.repo.git.commits.create({message:t,tree:s.sha,parents:[n.head.object.sha]})).then(s=>n.repo.commits(s.sha).fetch()).then(s=>(n.commit=s,n))}push(e){return e.head.update({sha:e.commit. Line truncated
`;function Xo(){for(var i={},e=0;e<localStorage.length;e++){var t=localStorage.key(e);if(t.startsWith("__repo__")){var r=JSON.parse(localStorage.getItem(t)),n=t.substring(8);i[n]=r}}return i}function va(i){var e=i.split("/",8);return e.length<5||e[0]!="https:"||e[2]!="github.com"||e[5]&&e[5]!="tree"?null:{user:e[3],repo:e[4],repopath:e[3]+"/"+e[4],branch:e[6],subtreepath:e[7]}}var pc=class{constructor(e,t,r,n){this.githubCons=e,this.githubToken=t,this.store=r,this.project=n,this.recreateGithub()}recreateGithub(){this.github=new this.githubCons({token:this.githubToken})}login(){if(this.githubToken&&this.githubToken.length)return new Promise((t,r)=>{t()});var e=new firebase.auth.GithubAuthProvider;return e.addScope("repo"),firebase.auth().signInWithPopup(e).then(t=>{this.githubToken=t.credential.accessToken;var r=t.user;this.recreateGithub(),document.cookie="__github_key="+this.githubToken+";path=/;max-age=31536000",console.log("Stored GitHub OAUTH key")})}logout(){return this.githubToken&&this.githubToken.length?firebase.auth().signOut().then(()=>{document.cookie="__github_key=;path=/;max-age=0",this.githubToken=null,this.recreateGithub()}):new Promise((e,t)=>{e()})}isFileIgnored(e){return e=e.toUpperCase(),!!(e.startsWith("LICENSE")||e.startsWith("README")||e.startsWith("."))}async getGithubSession(e){var t=va(e);if(!t)throw new Error("Please enter a valid GitHub URL.");var r=Xo()[t.repopath],n=t.branch||r&&r.branch,s=this.github.repos(t.user,t.repo);try{n=(await s.fetch()).defaultBranch||"master"}catch(a){console.log("could not fetch default branch: "+a),n="main"}console.log("branch =",n);var o={url:e,user:t.user,reponame:t.repo,repopath:t.repopath,branch:n,subtreepath:t.subtreepath,prefix:"",repo:s,platform_id:this.project?this.project.platform_id:r?r.platform_id:null};return o}getGithubHEADTree(e){var t;return this.getGithubSession(e).then(r=>(t=r,t.repo.git.refs.heads(t.branch).fetch())).then(r=>(t.head=r,t.sha=r.object.sha,t.repo.git.trees(t.sha).fetch())).then(r=>{if(t.subtreepath){for(let n of r.tree)if(n.type=="tree"&&n.path==t.subtreepath&&n.sha)return t.repo.git.trees(n.sha).fetch();throw Error("Cannot find subtree '"+t.subtreepath+"' in tree "+r.sha)}return r}).then(r=>(t.tree=r,t))}bind(e,t){var r="__repo__"+e.repopath;if(t){var n={url:e.url,branch:e.branch,platform_id:e.platform_id,mainPath:e.mainPath,sha:e.sha};console.log("storing",n),localStorage.setItem(r,JSON.stringify(n))}else localStorage.removeItem(r)}import(e){var t;return this.getGithubSession(e).then(r=>(t=r,t.repo.contents("README.md").read())).catch(r=>(console.log(r),console.log("no README.md found"),t.repo.fetch().then(n=>""))).then(r=>{var n;if(n=/8bitworkshop.com[^)]+file=([^)&]+)/.exec(r),n&&n[1]&&(console.log("main path: '"+n[1]+"'"),t.mainPath=n[1]),n=/8bitworkshop.com[^)]+platform=([A-Za-z0-9._\-]+)/.exec(r),n){if(console.log("platform id: '"+n[1]+"'"),t.platform_id&&!t.platform_id.startsWith(n[1]))throw Error("Platform mismatch: Repository is "+n[1]+", you have "+t.platform_id+" selected.");t.platform_id=n[1]}return this.bind(t,!0),t})}pull(e,t){var r;return this.getGithubHEADTree(e).then(n=>{r=n;let s=[];return r.paths=[],r.tree.tree.forEach(o=>{if(console.log(o.path,o.type,o.size),r.paths.push(o.path),o.type=="blob"&&!this.isFileIgnored(o.path)){var a=r.repo.git.blobs(o.sha).fetch().then(l=>{var h=r.prefix+o.path,f=o.size,O=l.encoding,m=l.content;if(l.encoding=="base64"){var b=rc(atob(m)),v=Es(o.path,b);m=v?b:sc(b)}return l.size!=m.length&&(m=m.slice(0,l.size)),(t||this.store).setItem(h,m)});s.push(a)}else console.log("ignoring "+o.path)}),Promise.all(s)}).then(n=>r)}importAndPull(e){return this.import(e).then(t=>this.pull(e))}publish(e,t,r,n){var s,o=this.project.platform_id,a=this.project.stripLocalPath(this.project.mainPath);return this.github.user.repos.create({name:e,description:t,private:n,auto_init:!1,license_template:r}).then(l=>{s=l;var h=T1;h=h.replace(/\$NAME/g,encodeURIComponent(e)),h=h.replace(/\$PLATFORM/g,encodeURIComponent(o)),h=h.replace(/\$GITHUBURL/g,encodeURIComponent(s.htmlUrl)),h=h.replace(/\$MAINFILE/g,encodeURIComponent(a));var f={message:"8bitworkshop: updated metadata in README.md",content:btoa(h)};return s.contents("README.md").add(f)}).then(()=>this.getGithubSession(s.htmlUrl))}commit(e,t,r){var n;return t||(t="updated from 8bitworkshop.com"),this.getGithubHEADTree(e).then(s=>{if(n=s,n.subtreepath)throw Error("Sorry, right now you can only commit files to the root directory of a repository.");return Promise.all(r.map(o=>typeof o.data=="string"?n.repo.git.blobs.create({content:o.data,encoding:"utf-8"}):n.repo.git.blobs.create({content:btoa(nc(o.data)),encoding:"base64"})))}).then(s=>n.repo.git.trees.create({tree:r.map((o,a)=>({path:o.path,mode:"100644",type:"blob",sha:s[a].sha})),base_tree:n.tree.sha})).then(s=>n.repo.git.commits.create({message:t,tree:s.sha,parents:[n.head.object.sha]})).then(s=>n.repo.commits(s.sha).fetch()).then(s=>(n.commit=s,n))}push(e){return e.head.update({sha:e.commit. Line truncated
`},s=window.c2t({noInitialRun:!0,print:n,printErr:n}),o=s.FS,a=jt()+".bin",l=jt()+".wav";o.writeFile(a,vi(),{encoding:"binary"});var h=["-2bc",a+","+e.toString(16),l];s.callMain(h);var f=o.readFile(l,{encoding:"binary"});if(f){var O=new Blob([f],{type:"audio/wav"});(0,hn.saveAs)(O,l),r+="Then connect your audio output to the cassette input, turn up the volume, and play the audio file.",Li(r)}})}function C1(i){fr("lib/makewav.js").then(()=>{let e="",t=function(a){e+=a+`
`};var r=ci(jt());let n=r+".bin",s=r+".wav";window.makewav({noInitialRun:!1,print:t,printErr:t,arguments:["-ts","-f0","-v10",n],preRun:a=>{a.FS.writeFile(n,vi(),{encoding:"binary"})}}).ready.then(a=>{let l=[n];a.run(l),console.log(e);let f=a.FS.readFile(s,{encoding:"binary"});if(f){let O=new Blob([f],{type:"audio/wav"});(0,hn.saveAs)(O,s),e+=`
Connect your audio output to the SuperCharger input, turn up the volume, and play the audio file.`,Li(e)}})})}function A1(i){var e=ci(jt());let t=e+".tap",r=new zs(e),n=new mc({sine_wave:!0}),s=vi(),o=s[0]+s[1]*256;s=s.slice(2),r.setContent({data:s,startAddress:o,type:zs.FILE_TYPE_NON_RELOCATABLE}),r.generateSound(n);let a=n.getTAPData();if(a){let l=new Blob([a],{type:"application/octet-stream"});(0,hn.saveAs)(l,t)}}function _u(){switch(Qi(Re)){case"vcs":return C1;case"apple2":return R1;case"c64":return A1}}function Mg(i){if(vi()==null)return Ge("Please fix errors before exporting."),!0;var e=_u();if(e===void 0)return Ge("Cassette export is not supported on this platform."),!0;e(i)}function Vg(i){if(vi()==null)return Ge("Please finish compiling with no errors before downloading ROM."),!0;var e=ci(jt());if(L.getDownloadFile){var t=L.getDownloadFile(),e=ci(jt());(0,hn.saveAs)(t.blob,e+t.extension)}else if(vi()instanceof Uint8Array){var r=new Blob([vi()],{type:"application/octet-stream"}),n=L.getROMExtension&&L.getROMExtension(vi())||"-"+Qi(Re)+".bin";(0,hn.saveAs)(r,e+n)}else Ge(`The "${Re}" platform doesn't have downloadable ROMs.`)}function Dg(i){var e=ke.getCurrentText();if(!e)return!1;var t=new Blob([e],{type:"text/plain;charset=utf-8"});(0,hn.saveAs)(t,Bg(),{autoBom:!1})}async function Wg(){let i=(await import("./jszip.min-HOLYP7RC.js")).default;return new i}async function qg(i){var e=await Wg();Pn().iterateFiles((t,r)=>{r&&e.file(li(t),r)}),e.generateAsync({type:"blob"}).then(t=>{(0,hn.saveAs)(t,jt()+"-"+Qi(Re)+".zip")})}function jg(i){let e=L.getDebugSymbolFile&&L.getDebugSymbolFile();if(!e){Ge("This project does not have debug information.");return}var t=ci(jt());(0,hn.saveAs)(e.blob,t+e.extension,{autoBom:!1})}async function Ig(i){var e=await Wg(),t=await Kn().keys();yt(!0);try{var r=0;await Promise.all(t.map(s=>Kn().getItem(s).then(o=>{Yr(r++/(t.length+1)),o&&e.file(s,o)})));var n=await e.generateAsync({type:"blob"});(0,hn.saveAs)(n,Qi(Re)+"-all.zip")}finally{yt(!1)}}var Xu=!1;function Ng(){Xu||fr("lib/gif.js").then(()=>{var i=$("#emulator").find("canvas")[0];if(!i){Ge("Could not find canvas element to record video!");return}var e=0;i.style&&i.style.transform&&(i.style.transform.indexOf("rotate(-90deg)")>=0?e=-1:i.style.transform.indexOf("rotate(90deg)")>=0&&(e=1));var t=new GIF({workerScript:"lib/gif.worker.js",workers:4,quality:10,rotate:e}),r=$("#videoPreviewImage");t.on("progress",l=>{Yr(l)}),t.on("finished",l=>{r.attr("src",URL.createObjectURL(l)),yt(!1),L.resume(),$("#videoPreviewModal").modal("show")});var n=20,s=300,o=0;console.log("Recording video",i),$("#emulator").css("backgroundColor","#cc3333");var a=()=>{o++>s?(console.log("Rendering video"),$("#emulator").css("backgroundColor","inherit"),yt(!0),L.pause(),t.render(),Xu=!1):(t.addFrame(i,{delay:n,copy:!0}),setTimeout(a,n),Xu=!0)};a()})}var Ru;async function Ls(){if(!Ru){await fr("lib/octokat.js"),await fr("https://www.gstatic.com/firebasejs/8.8.1/firebase-app.js"),await fr("https://www.gstatic.com/firebasejs/8.8.1/firebase-auth.js"),await fr("https://8bitworkshop.com/config.js");var i=lc("__github_key");Ru=new pc(Octokat,i,Kn(),Pn()),console.log("loaded github service")}return Ru}function ya(){var i=(Zt||"").split("/");return i.length!=2?(Ge("You are not in a GitHub repository. Choose one from the pulldown, or Import or Publish one."),null):"https://github.com/"+i[0]+"/"+i[1]}async function gc(i,e){var t,r=va(i);if(!r){Ge("Could not parse Github URL.");return}var n=Xo()[r.repopath];if(!(n&&!confirm("You've already imported "+r.repopath+" -- do you want to replace all local files?"))){yt(!0);var s=dc(r.repopath);Yr(.25);var o=await Ls();return o.import(i).then(a=>(t=a,Yr(.75),o.pull(i,s))).then(a=>{yt(!1),Us("sync","import",i),Ms(e,{repo:r.repopath})}).catch(a=>{yt(!1),console.log(a),Ge("Could not import "+i+"."+a)})}}async function Gg(i){var e=await Ls();e.login().then(()=>{Li("You are signed in to Github.")}).catch(t=>{Ge("Could not sign in."+t)})}async function Fg(i){var e=await Ls();e.logout().then(()=>{Li("You are logged out of Github.")})}function Hg(i){var e=$("#importGithubModal"),t=$("#importGithubButton");e.modal("show"),t.off("click").on("click",()=>{var r=$("#importGithubURL").val()+"";e.modal("hide"),gc(r,!1)})}function Kg(i){if(!(Zt&&!confirm("This project ("+Pn().mainPath+") is already bound to a Github repository. Do you want to re-publish to a new repository? (You can instead choose 'Push Changes' to update files in the existing repository.)"))){var e=$("#publishGithubModal"),t=$("#publishGithubButton");$("#githubRepoName").val(ci(li(Pn().mainPath))),e.modal("show"),t.off("click").on("click",async()=>{var r=$("#githubRepoName").val()+"",n=$("#githubRepoDesc").val()+"",s=$("#githubRepoPrivate").val()=="private",o=$("#githubRepoLicense").val()+"",a;if(!r){Ge("You did not enter a project name.");return}e.modal("hide"),yt(!0);var l=await Ls();l.login().then(()=>(Yr(.25),l.publish(r,n,o,s))).then(h=>(a=h,Yr(.5),t0("initial iLine truncated
`&&t++;return t}var Tc=class{createDiv(e){return this.maindiv=kn(e,"vertical-scroll"),this.maindiv[0]}clearAssets(){this.rootnodes=[],this.deferrednodes=[]}registerAsset(e,t,r){this.rootnodes.push(t),r?r>1?this.deferrednodes.push(t):this.deferrednodes.unshift(t):t.refreshRight()}getPalettes(e){var t=[];return this.rootnodes.forEach(r=>{for(;r!=null;){if(r instanceof Pa){var n=r.palette;e==n.length&&t.push({node:r,name:"Palette",palette:n}),r.layout&&r.layout.forEach(([s,o,a])=>{if(o<n.length){if(a==e){var l=n.slice(o,o+a);t.push({node:r,name:s,palette:l})}else if(-a==e){var l=n.slice(o,o-a);l.reverse(),t.push({node:r,name:s,palette:l})}else if(a+1==e){var l=new Uint32Array(e);l[0]=n[0],l.set(n.slice(o,o+a),1),t.push({node:r,name:s,palette:l})}}});break}r=r.right}}),t}getTilemaps(e){var t=[];return this.rootnodes.forEach(r=>{for(;r!=null;){if(r instanceof Ds){var n=r.rgbimgs;n&&n.length>=e&&t.push({node:r,name:"Tilemap",images:r.images,rgbimgs:n})}r=r.right}}),t}isEditing(){return this.cureditordiv!=null}getCurrentEditNode(){return this.cureditnode}setCurrentEditor(e,t,r){for(this.cureditordiv!=e&&(this.cureditordiv&&(this.cureditordiv.hide(250),this.cureditordiv=null),e&&(this.cureditordiv=e,this.cureditordiv.show(),this.cureditordiv[0].scrollIntoView({behavior:"smooth",block:"center"}))),this.cureditelem&&(this.cureditelem.removeClass("selected"),this.cureditelem=null),t&&(this.cureditelem=t,this.cureditelem.addClass("selected"));r.left;)r=r.left;this.cureditnode=r,this.updateHashForSelection(e)}updateHashForSelection(e){if(typeof window!="undefined"){var t=e?e.closest(".asset_block[data-fileid]"):null,r=t&&t.attr("data-fileid"),n=t&&t.attr("data-startline"),s="#asseteditor";r&&n&&(s+="/"+encodeURIComponent(r)+"/"+n),window.location.hash!==s&&history.replaceState(null,"",s)}}scanFileTextForAssets(e,t){for(var r=/[/;][*;]([{].+[}])[*;][/;]/g,n=[],s;s=r.exec(t);){var o=s.index+s[0].length,a;Re.includes("verilog")?a=t.indexOf("end",o):s[0].startsWith(";;")?(a=t.indexOf(";;",o),a==t.indexOf(";;{",o)&&(a=-1)):a=t.indexOf(";",o);var l=c0(t,s.index),h=s[0],f=a>=0?c0(t,a):"???";if(a<0){var O=Re.includes("verilog")?'"end"':s[0].startsWith(";;")?'";;"':'";"';n.push({fileid:e,header:h,startline:l,endline:f,error:`No closing ${O} found after asset header`})}else if(a<=o)n.push({fileid:e,header:h,startline:l,endline:f,error:"Empty data block after asset header"});else try{var m=s[1].replace(/([A-Za-z]+):/g,'"$1":'),b=JSON.parse(m);n.push({fileid:e,header:h,startline:l,endline:f,fmt:b,start:o,end:a})}catch(F){n.push({fileid:e,header:h,startline:l,endline:f,error:`Invalid asset format: ${F.message}`})}}for(var v=/DEF_METASPRITE_(\d+)x(\d+)[(](\w+),\s*(\w+),\s*(\w+)/gi;s=v.exec(t);){for(var P=parseInt(s[1]),T=parseInt(s[2]),Y=s[3],B=parseInt(s[4]),q=parseInt(s[5]),N=[],M=0;M<P;M++)for(var d=0;d<T;d++)N.push({x:M*8,y:d*8,tile:B,attr:q});var j={defs:N,width:P*8,height:T*8};n.push({fileid:e,label:Y,meta:j})}return n}addPaletteEditorViews(e,t,r){var n=$('<div class="asset_dual"/>').appendTo(e),s=$('<div class="asset_editor"/>').hide(),o=[];t.getAllColors().forEach(P=>{o.push(new Uint32Array([P]))});var a=$("<table/>").appendTo(n);s.appendTo(n);var l=t.layout;if(!l){var h=t.palette.length,f=h>32?8:4;l=[];for(var O=0;O<h;O+=f)l.push(["",O,Math.min(h-O,f)])}var m=[];function b(P,T){var Y=t.words[T],B=t.palette[T],q="#"+ht(oc(B),6),N=B&32768?"black":"white";P.text(ht(Y,2)).css("background-color",q).css("color",N)}function v(){m.forEach(({cell:P,index:T})=>b(P,T))}return l.forEach(([P,T,Y])=>{if(T<t.palette.length){var B=$("<tr/>").appendTo(a);$("<td/>").text(P).appendTo(B);for(var q=[],N=T;N<T+Math.abs(Y);N++)q.push(N);Y<0&&q.reverse(),q.forEach(M=>{var d=$("<td/>").addClass("asset_cell asset_editable").appendTo(B);m.push({cell:d,index:M}),b(d,M),d.click(j=>{var F=new ka;F.rgbimgs=o,F.width=1,F.height=1,F.recreate(s,(Oe,Ye)=>{r(M,Oe),b(d,M)}),this.setCurrentEditor(s,d,t)})})}}),v}addPixelEditor(e,t,r){r.xform="scale(2)";var n=new xc(r);t.addRight(n);var s=new Ds(this,r);n.addRight(s),s.addRight(new $c(this,kn(e),r))}addPaletteEditor(e,t,r){var n=new Pa(r);t.addRight(n),t.refreshRight();var s=this.addPaletteEditorViews(e,n,(o,a)=>{console.log("set entry",o,"=",a),t.words[o]=a,n.words=null,n.updateRight(),n.refreshLeft()});n.addRight(new yc(s))}ensureFileDiv(e){var t=this.getFileDivId(e),r=$(document.getElementById(t));if(r.length===0){var n=kn(this.maindiv,"asset_file"),s=kn(n,"asset_file_header").text(e);r=kn(n).attr("id",t).addClass("disable-select")}return r}refreshAssetsInFile(e,t){let r=0;if(Re.startsWith("nes")&&e.endsWith(".chr")&&t instanceof Uint8Array){let o=new $a(ke,e),a={w:8,h:8,bpp:1,count:t.length>>4,brev:!0,np:2,pofs:8,remap:[0,1,2,4,5,6,7,8,9,10,11,12]};this.addPixelEditor(this.ensureFileDiv(e),o,a),this.registerAsset("charmap",o,1),r++}else if(Re.startsWith("nes")&&e.endsWith(".pal")&&t instanceof Uint8Array){let o=new $a(ke,e),a={pal:"nes",layout:"nes"};this.addPaletteEditor(this.ensureFileDiv(e),o,a),this.regi Line truncated
Connect your audio output to the SuperCharger input, turn up the volume, and play the audio file.`,Li(e)}})})}function A1(i){var e=ci(jt());let t=e+".tap",r=new zs(e),n=new mc({sine_wave:!0}),s=vi(),o=s[0]+s[1]*256;s=s.slice(2),r.setContent({data:s,startAddress:o,type:zs.FILE_TYPE_NON_RELOCATABLE}),r.generateSound(n);let a=n.getTAPData();if(a){let l=new Blob([a],{type:"application/octet-stream"});(0,hn.saveAs)(l,t)}}function _u(){switch(Qi(Re)){case"vcs":return C1;case"apple2":return R1;case"c64":return A1}}function Mg(i){if(vi()==null)return Ge("Please fix errors before exporting."),!0;var e=_u();if(e===void 0)return Ge("Cassette export is not supported on this platform."),!0;e(i)}function Vg(i){if(vi()==null)return Ge("Please finish compiling with no errors before downloading ROM."),!0;var e=ci(jt());if(L.getDownloadFile){var t=L.getDownloadFile(),e=ci(jt());(0,hn.saveAs)(t.blob,e+t.extension)}else if(vi()instanceof Uint8Array){var r=new Blob([vi()],{type:"application/octet-stream"}),n=L.getROMExtension&&L.getROMExtension(vi())||"-"+Qi(Re)+".bin";(0,hn.saveAs)(r,e+n)}else Ge(`The "${Re}" platform doesn't have downloadable ROMs.`)}function Dg(i){var e=ke.getCurrentText();if(!e)return!1;var t=new Blob([e],{type:"text/plain;charset=utf-8"});(0,hn.saveAs)(t,Bg(),{autoBom:!1})}async function Wg(){let i=(await import("./jszip.min-HOLYP7RC.js")).default;return new i}async function qg(i){var e=await Wg();Pn().iterateFiles((t,r)=>{r&&e.file(li(t),r)}),e.generateAsync({type:"blob"}).then(t=>{(0,hn.saveAs)(t,jt()+"-"+Qi(Re)+".zip")})}function jg(i){let e=L.getDebugSymbolFile&&L.getDebugSymbolFile();if(!e){Ge("This project does not have debug information.");return}var t=ci(jt());(0,hn.saveAs)(e.blob,t+e.extension,{autoBom:!1})}async function Ig(i){var e=await Wg(),t=await Kn().keys();xt(!0);try{var r=0;await Promise.all(t.map(s=>Kn().getItem(s).then(o=>{Yr(r++/(t.length+1)),o&&e.file(s,o)})));var n=await e.generateAsync({type:"blob"});(0,hn.saveAs)(n,Qi(Re)+"-all.zip")}finally{xt(!1)}}var Xu=!1;function Ng(){Xu||fr("lib/gif.js").then(()=>{var i=$("#emulator").find("canvas")[0];if(!i){Ge("Could not find canvas element to record video!");return}var e=0;i.style&&i.style.transform&&(i.style.transform.indexOf("rotate(-90deg)")>=0?e=-1:i.style.transform.indexOf("rotate(90deg)")>=0&&(e=1));var t=new GIF({workerScript:"lib/gif.worker.js",workers:4,quality:10,rotate:e}),r=$("#videoPreviewImage");t.on("progress",l=>{Yr(l)}),t.on("finished",l=>{r.attr("src",URL.createObjectURL(l)),xt(!1),L.resume(),$("#videoPreviewModal").modal("show")});var n=20,s=300,o=0;console.log("Recording video",i),$("#emulator").css("backgroundColor","#cc3333");var a=()=>{o++>s?(console.log("Rendering video"),$("#emulator").css("backgroundColor","inherit"),xt(!0),L.pause(),t.render(),Xu=!1):(t.addFrame(i,{delay:n,copy:!0}),setTimeout(a,n),Xu=!0)};a()})}var Ru;async function Ls(){if(!Ru){await fr("lib/octokat.js"),await fr("https://www.gstatic.com/firebasejs/8.8.1/firebase-app.js"),await fr("https://www.gstatic.com/firebasejs/8.8.1/firebase-auth.js"),await fr("https://8bitworkshop.com/config.js");var i=lc("__github_key");Ru=new pc(Octokat,i,Kn(),Pn()),console.log("loaded github service")}return Ru}function xa(){var i=(Zt||"").split("/");return i.length!=2?(Ge("You are not in a GitHub repository. Choose one from the pulldown, or Import or Publish one."),null):"https://github.com/"+i[0]+"/"+i[1]}async function gc(i,e){var t,r=va(i);if(!r){Ge("Could not parse Github URL.");return}var n=Xo()[r.repopath];if(!(n&&!confirm("You've already imported "+r.repopath+" -- do you want to replace all local files?"))){xt(!0);var s=dc(r.repopath);Yr(.25);var o=await Ls();return o.import(i).then(a=>(t=a,Yr(.75),o.pull(i,s))).then(a=>{xt(!1),Us("sync","import",i),Ms(e,{repo:r.repopath})}).catch(a=>{xt(!1),console.log(a),Ge("Could not import "+i+"."+a)})}}async function Gg(i){var e=await Ls();e.login().then(()=>{Li("You are signed in to Github.")}).catch(t=>{Ge("Could not sign in."+t)})}async function Fg(i){var e=await Ls();e.logout().then(()=>{Li("You are logged out of Github.")})}function Hg(i){var e=$("#importGithubModal"),t=$("#importGithubButton");e.modal("show"),t.off("click").on("click",()=>{var r=$("#importGithubURL").val()+"";e.modal("hide"),gc(r,!1)})}function Kg(i){if(!(Zt&&!confirm("This project ("+Pn().mainPath+") is already bound to a Github repository. Do you want to re-publish to a new repository? (You can instead choose 'Push Changes' to update files in the existing repository.)"))){var e=$("#publishGithubModal"),t=$("#publishGithubButton");$("#githubRepoName").val(ci(li(Pn().mainPath))),e.modal("show"),t.off("click").on("click",async()=>{var r=$("#githubRepoName").val()+"",n=$("#githubRepoDesc").val()+"",s=$("#githubRepoPrivate").val()=="private",o=$("#githubRepoLicense").val()+"",a;if(!r){Ge("You did not enter a project name.");return}e.modal("hide"),xt(!0);var l=await Ls();l.login().then(()=>(Yr(.25),l.publish(r,n,o,s))).then(h=>(a=h,Yr(.5),t0("initial iLine truncated
`&&t++;return t}var Tc=class{createDiv(e){return this.maindiv=kn(e,"vertical-scroll"),this.maindiv[0]}clearAssets(){this.rootnodes=[],this.deferrednodes=[]}registerAsset(e,t,r){this.rootnodes.push(t),r?r>1?this.deferrednodes.push(t):this.deferrednodes.unshift(t):t.refreshRight()}getPalettes(e){var t=[];return this.rootnodes.forEach(r=>{for(;r!=null;){if(r instanceof Pa){var n=r.palette;e==n.length&&t.push({node:r,name:"Palette",palette:n}),r.layout&&r.layout.forEach(([s,o,a])=>{if(o<n.length){if(a==e){var l=n.slice(o,o+a);t.push({node:r,name:s,palette:l})}else if(-a==e){var l=n.slice(o,o-a);l.reverse(),t.push({node:r,name:s,palette:l})}else if(a+1==e){var l=new Uint32Array(e);l[0]=n[0],l.set(n.slice(o,o+a),1),t.push({node:r,name:s,palette:l})}}});break}r=r.right}}),t}getTilemaps(e){var t=[];return this.rootnodes.forEach(r=>{for(;r!=null;){if(r instanceof Ds){var n=r.rgbimgs;n&&n.length>=e&&t.push({node:r,name:"Tilemap",images:r.images,rgbimgs:n})}r=r.right}}),t}isEditing(){return this.cureditordiv!=null}getCurrentEditNode(){return this.cureditnode}setCurrentEditor(e,t,r){for(this.cureditordiv!=e&&(this.cureditordiv&&(this.cureditordiv.hide(250),this.cureditordiv=null),e&&(this.cureditordiv=e,this.cureditordiv.show(),this.cureditordiv[0].scrollIntoView({behavior:"smooth",block:"center"}))),this.cureditelem&&(this.cureditelem.removeClass("selected"),this.cureditelem=null),t&&(this.cureditelem=t,this.cureditelem.addClass("selected"));r.left;)r=r.left;this.cureditnode=r,this.updateHashForSelection(e)}updateHashForSelection(e){if(typeof window!="undefined"){var t=e?e.closest(".asset_block[data-fileid]"):null,r=t&&t.attr("data-fileid"),n=t&&t.attr("data-startline"),s="#asseteditor";r&&n&&(s+="/"+encodeURIComponent(r)+"/"+n),window.location.hash!==s&&history.replaceState(null,"",s)}}scanFileTextForAssets(e,t){for(var r=/[/;][*;]([{].+[}])[*;][/;]/g,n=[],s;s=r.exec(t);){var o=s.index+s[0].length,a;Re.includes("verilog")?a=t.indexOf("end",o):s[0].startsWith(";;")?(a=t.indexOf(";;",o),a==t.indexOf(";;{",o)&&(a=-1)):a=t.indexOf(";",o);var l=c0(t,s.index),h=s[0],f=a>=0?c0(t,a):"???";if(a<0){var O=Re.includes("verilog")?'"end"':s[0].startsWith(";;")?'";;"':'";"';n.push({fileid:e,header:h,startline:l,endline:f,error:`No closing ${O} found after asset header`})}else if(a<=o)n.push({fileid:e,header:h,startline:l,endline:f,error:"Empty data block after asset header"});else try{var m=s[1].replace(/([A-Za-z]+):/g,'"$1":'),b=JSON.parse(m);n.push({fileid:e,header:h,startline:l,endline:f,fmt:b,start:o,end:a})}catch(v){n.push({fileid:e,header:h,startline:l,endline:f,error:`Invalid asset format: ${v.message}`})}}return n}addPaletteEditorViews(e,t,r){var n=$('<div class="asset_dual"/>').appendTo(e),s=$('<div class="asset_editor"/>').hide(),o=[];t.getAllColors().forEach(P=>{o.push(new Uint32Array([P]))});var a=$("<table/>").appendTo(n);s.appendTo(n);var l=t.layout;if(!l){var h=t.palette.length,f=h>32?8:4;l=[];for(var O=0;O<h;O+=f)l.push(["",O,Math.min(h-O,f)])}var m=[];function b(P,X){var Y=t.words[X],G=t.palette[X],q="#"+ht(oc(G),6),N=G&32768?"black":"white";P.text(ht(Y,2)).css("background-color",q).css("color",N)}function v(){m.forEach(({cell:P,index:X})=>b(P,X))}return l.forEach(([P,X,Y])=>{if(X<t.palette.length){var G=$("<tr/>").appendTo(a);$("<td/>").text(P).appendTo(G);for(var q=[],N=X;N<X+Math.abs(Y);N++)q.push(N);Y<0&&q.reverse(),q.forEach(V=>{var d=$("<td/>").addClass("asset_cell asset_editable").appendTo(G);m.push({cell:d,index:V}),b(d,V),d.click(j=>{var F=new ka;F.rgbimgs=o,F.width=1,F.height=1,F.recreate(s,(Oe,Ye)=>{r(V,Oe),b(d,V)}),this.setCurrentEditor(s,d,t)})})}}),v}addPixelEditor(e,t,r){r.xform="scale(2)";var n=new yc(r);t.addRight(n);var s=new Ds(this,r);n.addRight(s),s.addRight(new $c(this,kn(e),r))}addPaletteEditor(e,t,r){var n=new Pa(r);t.addRight(n),t.refreshRight();var s=this.addPaletteEditorViews(e,n,(o,a)=>{console.log("set entry",o,"=",a),t.words[o]=a,n.words=null,n.updateRight(),n.refreshLeft()});n.addRight(new xc(s))}ensureFileDiv(e){var t=this.getFileDivId(e),r=$(document.getElementById(t));if(r.length===0){var n=kn(this.maindiv,"asset_file"),s=kn(n,"asset_file_header").text(e);r=kn(n).attr("id",t).addClass("disable-select")}return r}refreshAssetsInFile(e,t){let r=0;if(Re.startsWith("nes")&&e.endsWith(".chr")&&t instanceof Uint8Array){let o=new $a(ke,e),a={w:8,h:8,bpp:1,count:t.length>>4,brev:!0,np:2,pofs:8,remap:[0,1,2,4,5,6,7,8,9,10,11,12]};this.addPixelEditor(this.ensureFileDiv(e),o,a),this.registerAsset("charmap",o,1),r++}else if(Re.startsWith("nes")&&e.endsWith(".pal")&&t instanceof Uint8Array){let o=new $a(ke,e),a={pal:"nes",layout:"nes"};this.addPaletteEditor(this.ensureFileDiv(e),o,a),this.registerAsset("palette",o,0),r++}else if(typeof t=="string"){let o=this.scanFileTextForAssets(e,t);for(let a of o){let l=$('<div class="asset_block"/>').attr({"data-fileid":e,"data-startline":a.startline}).appendTo(this.ensureFileDiv(e));var n=$('<div class="asset_snip"/>').appendTo(l),s=$('<span class="asset_ Line truncated
`+s),n+=`
`+this.opToString(l,h,b))}),"X: "+t+" Y: "+r+" "+n}refresh(){this.tick(),this.datau32.fill(Zr)}tick(){super.tick(),this.drawImage()}drawImage(){this.ctx.putImageData(this.imageData,0,0)}clear(){this.datau32.fill(Zr)}},Ac=class extends Cc{createDiv(e){return this.createCanvas(e,256,256)}initCanvas(){super.initCanvas(),this.canvas.onclick=e=>{var t=cc(this.canvas,e),r=Math.floor(t.x)+Math.floor(t.y)*256,n=-1,s=-1;this.redraw((o,a)=>{s<0&&n>=0&&a==r&&(s=n),o==16777216&&(n=a)}),s>=0&&Ws([s])}}clear(){for(var e=0;e<=65535;e++){var t=L.readAddress(e),r=t>>2|t&31;r|=r<<8|r<<16,this.datau32[e]=r|Zr}}drawEvent(e,t,r,n){var s=this.getOpRGB(e,t);if(s){var o=t&255,a=t>>8&255,l=this.datau32[t&65535];l=l|s|Zr,this.datau32[t&65535]=l}}getTooltipText(e,t){var r=(e&255)+(t<<8),n="",s=-1,o={},a=null,l=[];return this.redraw((h,f,O,m,b,v)=>{switch(h){case 16777216:s=f,a=this.addr2symbol(f)||a;break;case 167772160:l.push(a);break;case 184549376:a=l.pop();break}var P=h|s;f==r&&!o[P]&&(n==""&&a&&(n+=`
`+a),n+=`
PC `+this.addr2str(s)+" "+this.opToString(h,null,v),o[P]=1)}),this.addr2str(r)+n}},zu=class extends Cc{initCanvas(){super.initCanvas(),this.canvas.onclick=e=>{var t=cc(this.canvas,e),r=Math.floor(t.x),n=Math.floor(t.y),s=this.getOpAtPos(t.x,t.y,16777216);s&&(fn("toline"),L.runEval(()=>{let o=L.getRasterScanline&&L.getRasterScanline()>=n;return o&&L.getRasterLineClock?o&&L.getRasterLineClock()>r:o}))}}drawEvent(e,t,r,n){var s=this.getOpRGB(e,t);if(s){var o=r+n*this.canvas.width,a=s|Zr;this.datau32[o]|=a}}drawImage(){let e=Zr;for(let t=0;t<this.datau32.length;t++)this.datau32[t]==Zr?this.datau32[t]=e:e=this.datau32[t];super.drawImage()}},Yc=class extends zu{constructor(){super(...arguments);this.interrupt=0;this.rgb=0;this.lastpc=0}drawEvent(t,r,n,s){var o=n+s*this.canvas.width;if(t==134217728&&(this.interrupt=1),this.interrupt==1&&t==167772160&&(this.interrupt=r),this.interrupt>1&&this.sp>this.interrupt&&(this.interrupt=0),t==318767104&&(this.rgb|=47),t==385875968&&(this.rgb|=16256),t==352321536&&(this.rgb|=2047872),t==335544320&&(this.rgb|=7936),t==520093696&&(this.rgb=32768),t==150994944||t==402653184)this.datau32[o]=4279176975;else{let a=this.rgb;if(t==16777216){let l=this.sp&15;l>=8&&(l=16-l),Math.abs(this.lastpc)-r>16&&(l+=1),Math.abs(this.lastpc)-r>256&&(l+=1),a=this.rgb=526344*l+2105376,this.lastpc=r}this.interrupt&&(a|=8388672),this.datau32[o]==Zr&&(this.datau32[o]=a|Zr)}}},Ec=class extends Jn{constructor(){super(...arguments);this.recreateOnResize=!0}createDiv(t){return this.vlist=new Sa(t),this.vlist.create(t,this.cyclesPerLine*this.totalScanlines,this.getMemoryLineAt.bind(this)),this.vlist.maindiv}getMemoryLineAt(t){var r="",n="seg_data",s=this.dumplines&&this.dumplines[t];if(s!=null){var o=s.info.join(", ");r="("+cn(s.row,4)+", "+cn(s.col,4)+") "+ba(s.asm||"",20)+o,o.indexOf("Write ")>=0&&(n="seg_io")}return{text:r,clas:n}}refresh(){this.tick()}tick(){let t=L instanceof Pu||L instanceof $u;this.dumplines={},this.redraw((r,n,s,o,a,l)=>{t&&(a>>=2);var h=this.dumplines[a];switch(h==null&&(h={op:r,addr:n,row:o,col:s,asm:null,info:[]},this.dumplines[a]=h),r){case 16777216:if(L.disassemble){var f=L.disassemble(n,L.readAddress.bind(L));h.asm=f&&f.line}break;default:var O=this.opToString(r,n,l);O!=""&&h.info.push(O);break}}),this.vlist.refresh()}},Zc=class extends Jn{constructor(){super(...arguments);this.recreateOnResize=!0}createDiv(t){return this.vlist=new Sa(t),this.vlist.create(t,this.totalScanlines,this.getMemoryLineAt.bind(this)),this.vlist.maindiv}getMemoryLineAt(t){for(var r=cn(t+"",3)+" ",n="seg_code",s=this.dumplines&&this.dumplines[t]||[],o=Math.round(this.cyclesPerLine/3.3),a=0;a<this.cyclesPerLine;a++){var l=s[a];if(l!==void 0){var h=l&65535,f=f&Zr;if(f==16777216)r+=",";else{var O=ht(h);r+=O,a+=O.length-1}}else r+=a==o?"|":"."}return s[-1]&&(r+=" "+s[-1]),{text:r,clas:n}}refresh(){this.tick()}tick(){let t=L instanceof Pu||L instanceof $u;this.dumplines={},this.redraw((r,n,s,o,a,l)=>{var h=this.dumplines[o];switch(h==null&&(this.dumplines[o]=h=[]),r){case 16777216:var f=L.debugSymbols.addr2symbol[n];f&&(h[-1]=f);break;case 335544320:case 352321536:case 369098752:case 385875968:h[s]=r|n;break}}),this.vlist.refresh()}},Uc=class extends Jn{constructor(){super(...arguments);this.recreateOnResize=!0;this.cumulativeData=!0}createDiv(t){return L.debugSymbols&&L.debugSymbols.symbolmap?this.keys=Array.from(Object.keys(L.debugSymbols.symbolmap).filter(r=>!h0(r))):this.keys=["no symbols defined"],this.vlist=new Sa(t),this.vlist.create(t,this.keys.length+1,this.getMemoryLineAt.bind(this)),this.vlist.maindiv}getMemoryLineAt(t){if(t==0)return{text:cn("Symbol",35)+cn("Reads",8)+cn("Writes",8)};var r=this.keys[t-1],n=this.dumplines&&this.dumplines[r];function s(l){var h=n[l]|0;return cn(h?h.toString():"",8)}var o,a;return n!=null?(o=cn(r,35)+s(301989888)+s(318767104),n[16777216]?a="seg_code":n[335544320]||n[352321536]?a="seg_io":a="seg_data"):(o=cn(r,35),a="seg_unknown"),{text:o,clas:a}}refresh(){this.tick()}tick(){this.dumplines={},this.redraw((t,r,n,s,o,a)=>{var l=L.debugSymbols.addr2symbol[r];if(l!=null){var h=this.dumplines[l];h==null&&(h={},this.dumplines[l]=h),h[t]=(h[t]|0)+1}}),this.vlist.refresh(),this.probe&&this.probe.clear()}};var Mu=[],d0=[];(()=>{let i="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2, Line truncated
`){[e,t]=Eo(this,e,t);let n="";for(let s=0,o=0;s<=t&&o<this.text.length;o++){let a=this.text[o],l=s+a.length;s>e&&o&&(n+=r),e<l&&t>s&&(n+=a.slice(Math.max(0,e-s),t-s)),s=l+1}return n}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let r=[],n=-1;for(let s of e)r.push(s),n+=s.length+1,r.length==32&&(t.push(new i(r,n)),r=[],n=-1);return n>-1&&t.push(new i(r,n)),t}},Co=class i extends tt{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,t,r,n){for(let s=0;;s++){let o=this.children[s],a=n+o.length,l=r+o.lines-1;if((t?l:a)>=e)return o.lineInner(e,t,r,n);n=a+1,r=l+1}}decompose(e,t,r,n){for(let s=0,o=0;o<=t&&s<this.children.length;s++){let a=this.children[s],l=o+a.length;if(e<=l&&t>=o){let h=n&((o<=e?1:0)|(l>=t?2:0));o>=e&&l<=t&&!h?r.push(a):a.decompose(e-o,t-o,r,h)}o=l+1}}replace(e,t,r){if([e,t]=Eo(this,e,t),r.lines<this.lines)for(let n=0,s=0;n<this.children.length;n++){let o=this.children[n],a=s+o.length;if(e>=s&&t<=a){let l=o.replace(e-s,t-s,r),h=this.lines-o.lines+l.lines;if(l.lines<h>>4&&l.lines>h>>6){let f=this.children.slice();return f[n]=l,new i(f,this.length-(t-e)+r.length)}return super.replace(s,a,l)}s=a+1}return super.replace(e,t,r)}sliceString(e,t=this.length,r=`
`){[e,t]=Eo(this,e,t);let n="";for(let s=0,o=0;s<this.children.length&&o<=t;s++){let a=this.children[s],l=o+a.length;o>e&&s&&(n+=r),e<l&&t>o&&(n+=a.sliceString(e-o,t-o,r)),o=l+1}return n}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof i))return 0;let r=0,[n,s,o,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;n+=t,s+=t){if(n==o||s==a)return r;let l=this.children[n],h=e.children[s];if(l!=h)return r+l.scanIdentical(h,t);r+=l.length+1}}static from(e,t=e.reduce((r,n)=>r+n.length+1,-1)){let r=0;for(let b of e)r+=b.lines;if(r<32){let b=[];for(let v of e)v.flatten(b);return new Fi(b,t)}let n=Math.max(32,r>>5),s=n<<1,o=n>>1,a=[],l=0,h=-1,f=[];function O(b){let v;if(b.lines>s&&b instanceof i)for(let P of b.children)O(P);else b.lines>o&&(l>o||!l)?(m(),a.push(b)):b instanceof Fi&&l&&(v=f[f.length-1])instanceof Fi&&b.lines+v.lines<=32?(l+=b.lines,h+=b.length+1,f[f.length-1]=new Fi(v.text.concat(b.text),v.length+1+b.length)):(l+b.lines>n&&m(),l+=b.lines,h+=b.length+1,f.push(b))}function m(){l!=0&&(a.push(f.length==1?f[0]:i.from(f,h)),h=-1,l=f.length=0)}for(let b of e)O(b);return m(),a.length==1?a[0]:new i(a,t)}};tt.empty=new Fi([""],0);function I1(i){let e=-1;for(let t of i)e+=t.length+1;return e}function Vc(i,e,t=0,r=1e9){for(let n=0,s=0,o=!0;s<i.length&&n<=r;s++){let a=i[s],l=n+a.length;l>=t&&(l>r&&(a=a.slice(0,r-n)),n<t&&(a=a.slice(t-n)),o?(e[e.length-1]+=a,o=!1):e.push(a)),n=l+1}return e}function S0(i,e,t){return Vc(i,[""],e,t)}var Is=class{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof Fi?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,n=this.nodes[r],s=this.offsets[r],o=s>>1,a=n instanceof Fi?n.text.length:n.children.length;if(o==(t>0?a:0)){if(r==0)return this.done=!0,this.value="",this;t>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[r]+=t,e==0)return this.lineBreak=!0,this.value=`
`,this;e--}else if(n instanceof Fi){let l=n.text[o+(t<0?-1:0)];if(this.offsets[r]+=t,l.length>Math.max(0,e))return this.value=e==0?l:t>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=n.children[o+(t<0?-1:0)];e>l.length?(e-=l.length,this.offsets[r]+=t):(t<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(t>0?1:(l instanceof Fi?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},Dc=class{constructor(e,t,r){this.value="",this.done=!1,this.cursor=new Is(e,t>r?-1:1),this.pos=t>r?e.length:0,this.from=Math.min(t,r),this.to=Math.max(t,r)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let r=t<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:n}=this.cursor.next(e);return this.pos+=(n.length+e)*t,this.value=n.length<=r?n:t<0?n.slice(n.length-r):n.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}},Wc=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:r,value:n}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=n,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol!="undefined"&&(tt.prototype[Symbol.iterator]=function(){return this.iter()},Is.prototype[Symbol.iterator]=Dc.prototype[Symbol.iterator]=Wc.prototype[Symbol.iterator]=function(){return this});var Du=class{constructor(e,t,r,n){this.from=e,this.to=t,this.number=r,this.text=n}get length(){return this.to-this.from}};function Eo(i,e,t){return e=Math.max(0,Math.min(i.length,e)),[e,Math.max(e,Math.min(i.length,t))]}function zt(i,e,t=!0,r=!0){return p0(i,e,t,r)}function N1(i){return i>=56320&&i<57344}function B1(i){return i>=55296&&i<56320}function zr(i,e){let t=i.charCodeAt(e);if(!B1(t)||e+1==i.length)return t;let r=i.charCodeAt(e+1);return N1(r)?(t-55296<<10)+(r-56320)+65536:t}function Bc(i){return i<=65535?String.fromCharCode(i):(i-=65536,String.fromCharCode((i>>10)+55296,(i&1023)+56320))}function ts(i){return i<65536?1:2}var Wu=/\r\n?|\n/,It=(function(i){return i[i.Simple=0]="Simple",i[i.TrackDel=1]="TrackDel",i[i.TrackBefore=2]="TrackBefore",i[i.TrackAfter=3]="TrackAfter",i})(It||(It={})),Tn=class i{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let r=this.sections[t+1];e+=r<0?this.sections[t]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,r=0,n=0;t<this.sections.length;){let s=this.sections[t++],o=this.sections[t++];o<0?(e(r,n,s),n+=s):n+=o,r+=s}}iterChangedRanges(e,t=!1){qu(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let r=this.sections[t++],n=this.sections[t++];n<0?e.push(r,n):e.push(n,r)}return new i(e)}composeDesc(e){return this.empty?e:e.empty?this:w0(this,e)}mapDesc(e,t=!1){return e.empty?this:ju(this,e,t)}mapPos(e,t=-1,r=It.Simple){let n=0,s=0;for(let o=0;o<this.sections.length;){let a=this.sections[o++],l=this.sections[o++],h=n+a;if(l<0){if(h>e)return s+(e-n);s+=a}else{if(r!=It.Simple&&h>=e&&(r==It.TrackDel&&n<e&&h>e||r==It.TrackBefore&&n<e||r==It.TrackAfter&&h>e))return null;if(h>e||h==e&&t<0&&!a)return e==n||t<0?s:s+l;s+=l}n=h}if(e>n)throw new RangeError(`Position ${e} is out of range for changeset of length ${n}`);return s}touchesRange(e,t=e){for(let r=0,n=0;r<this.sections.length&&n<=t;){let s=this.sections[r++],o=this.sections[r++],a=n+s;if(o>=0&&n<=t&&a>=e)return n<e&&a>t?"cover":!0;n=a}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let r=this.sections[t++],n=this.sections[t++];e+=(e?" ":"")+r+(n>=0?":"+n:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new i(e)}static create(e){return new i(e)}},xi=class i extends Tn{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return qu(this,(t,r,n,s,o)=>e=e.replace(n,n+(r-t),o),!1),e}mapDesc(e,t=!1){return ju(this,e,t,!0)}invert(e){let t=this.sections.slice(),r=[];for(let n=0,s=0;n<t.length;n+=2){let o=t[n],a=t[n+1];if(a>=0){t[n]=a,t[n+1]=o;let l=n>>1;for(;r.length<l;)r.push(tt.empty);r.push(o?e.slice(s,s+o):tt.empty)}s+=o}return new i(t,r)}compose(e){return this.empty?e:e.empty?this:w0(this,e,!0)}map(e,t=!1){return e.empty?this:ju(this,e,t,!0)}iterChanges(e,t=!1){qu(this,e,t)}get desc Line truncated
`}get readOnly(){return this.facet(R0)}phrase(e,...t){for(let r of this.facet(i.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(r,n)=>{if(n=="$")return"$";let s=+(n||1);return!s||s>t.length?r:t[s-1]})),e}languageDataAt(e,t,r=-1){let n=[];for(let s of this.facet(P0))for(let o of s(this,t,r))Object.prototype.hasOwnProperty.call(o,e)&&n.push(o[e]);return n}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return r$(t.length?t[0]:"")}wordAt(e){let{text:t,from:r,length:n}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-r,a=e-r;for(;o>0;){let l=zt(t,o,!1);if(s(t.slice(l,o))!=xt.Word)break;o=l}for(;a<n;){let l=zt(t,a);if(s(t.slice(a,l))!=xt.Word)break;a=l}return o==a?null:H.range(o+r,a+r)}};it.allowMultipleSelections=Nu;it.tabSize=me.define({combine:i=>i.length?i[0]:4});it.lineSeparator=k0;it.readOnly=R0;it.phrases=me.define({compare(i,e){let t=Object.keys(i),r=Object.keys(e);return t.length==r.length&&t.every(n=>i[n]==e[n])}});it.languageData=P0;it.changeFilter=T0;it.transactionFilter=X0;it.transactionExtender=_0;Zo.reconfigure=Ce.define();function Hi(i,e,t={}){let r={};for(let n of i)for(let s of Object.keys(n)){let o=n[s],a=r[s];if(a===void 0)r[s]=o;else if(!(a===o||o===void 0))if(Object.hasOwnProperty.call(t,s))r[s]=t[s](a,o);else throw new Error("Config merge conflict for field "+s)}for(let n in e)r[n]===void 0&&(r[n]=e[n]);return r}var ur=class{eq(e){return this==e}range(e,t=e){return Ya.create(e,t,this)}};ur.prototype.startSide=ur.prototype.endSide=0;ur.prototype.point=!1;ur.prototype.mapMode=It.TrackDel;function rO(i,e){return i==e||i.constructor==e.constructor&&i.eq(e)}var Ya=class i{constructor(e,t,r){this.from=e,this.to=t,this.value=r}static create(e,t,r){return new i(e,t,r)}};function Ku(i,e){return i.from-e.from||i.value.startSide-e.value.startSide}var Ju=class i{constructor(e,t,r,n){this.from=e,this.to=t,this.value=r,this.maxPoint=n}get length(){return this.to[this.to.length-1]}findIndex(e,t,r,n=0){let s=r?this.to:this.from;for(let o=n,a=s.length;;){if(o==a)return o;let l=o+a>>1,h=s[l]-e||(r?this.value[l].endSide:this.value[l].startSide)-t;if(l==o)return h>=0?o:a;h>=0?a=l:o=l+1}}between(e,t,r,n){for(let s=this.findIndex(t,-1e9,!0),o=this.findIndex(r,1e9,!1,s);s<o;s++)if(n(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,t){let r=[],n=[],s=[],o=-1,a=-1;for(let l=0;l<this.value.length;l++){let h=this.value[l],f=this.from[l]+e,O=this.to[l]+e,m,b;if(f==O){let v=t.mapPos(f,h.startSide,h.mapMode);if(v==null||(m=b=v,h.startSide!=h.endSide&&(b=t.mapPos(f,h.endSide),b<m)))continue}else if(m=t.mapPos(f,h.startSide),b=t.mapPos(O,h.endSide),m>b||m==b&&h.startSide>0&&h.endSide<=0)continue;(b-m||h.endSide-h.startSide)<0||(o<0&&(o=m),h.point&&(a=Math.max(a,b-m)),r.push(h),n.push(m-o),s.push(b-o))}return{mapped:r.length?new i(n,s,r,a):null,pos:o}}},Le=class i{constructor(e,t,r,n){this.chunkPos=e,this.chunk=t,this.nextLayer=r,this.maxPoint=n}static create(e,t,r,n){return new i(e,t,r,n)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:r=!1,filterFrom:n=0,filterTo:s=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(r&&(t=t.slice().sort(Ku)),this.isEmpty)return t.length?i.of(t):this;let a=new Nc(this,null,-1).goto(0),l=0,h=[],f=new Ur;for(;a.value||l<t.length;)if(l<t.length&&(a.from-t[l].from||a.startSide-t[l].value.startSide)>=0){let O=t[l++];f.addInner(O.from,O.to,O.value)||h.push(O)}else a.rangeIndex==1&&a.chunkIndex<this.chunk.length&&(l==t.length||this.chunkEnd(a.chunkIndex)<t[l].from)&&(!o||n>this.chunkEnd(a.chunkIndex)||s<this.chunkPos[a.chunkIndex])&&f.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!o||n>a.to||s<a.from||o(a.from,a.to,a.value))&&(f.addInner(a.from,a.to,a.value)||h.push(Ya.create(a.from,a.to,a.value))),a.next());return f.finishInner(this.nextLayer.isEmpty&&!h.length?i.empty:this.nextLayer.update({add:h,filter:o,filterFrom:n,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],r=[],n=-1;for(let o=0;o<this.chunk.length;o++){let a=this.chunkPos[o],l=this.chunk[o],h=e.touchesRange(a,a+l.length);if(h===!1)n=Math.max(n,l.maxPoint),t.push(l),r.push(e.mapPos(a));else if(h===!0){let{mapped:f,pos:O}=l.map(a,e);f&&(n=Math.max(n,f.maxPoint),t.push(f),r.push(O))}}let s=this.nextLayer.map(e);return t.length==0?s:new i(r,t,s||i.empty,n)}between(e,t,r){if(!this.isEmpty){for(let n=0;n<this.chunk.length;n++){let s=this.chunkPos[n],o=this.chunk[n];if(t>=s&&e<=s+o.length&&o.between(s,e-s,t-s,r)===!1)return}this.nextLayer.between(e,t,r)}}iter(e=0){return Ea.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Ea.from(e).goto(t)}static compare(e,t,r,n,s=-1){let o=e.filter(O=>O.maxPoint>0||!O.is Line truncated
`,this;e--}else if(n instanceof Fi){let l=n.text[o+(t<0?-1:0)];if(this.offsets[r]+=t,l.length>Math.max(0,e))return this.value=e==0?l:t>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=n.children[o+(t<0?-1:0)];e>l.length?(e-=l.length,this.offsets[r]+=t):(t<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(t>0?1:(l instanceof Fi?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},Dc=class{constructor(e,t,r){this.value="",this.done=!1,this.cursor=new Is(e,t>r?-1:1),this.pos=t>r?e.length:0,this.from=Math.min(t,r),this.to=Math.max(t,r)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let r=t<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:n}=this.cursor.next(e);return this.pos+=(n.length+e)*t,this.value=n.length<=r?n:t<0?n.slice(n.length-r):n.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}},Wc=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:r,value:n}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=n,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol!="undefined"&&(tt.prototype[Symbol.iterator]=function(){return this.iter()},Is.prototype[Symbol.iterator]=Dc.prototype[Symbol.iterator]=Wc.prototype[Symbol.iterator]=function(){return this});var Du=class{constructor(e,t,r,n){this.from=e,this.to=t,this.number=r,this.text=n}get length(){return this.to-this.from}};function Eo(i,e,t){return e=Math.max(0,Math.min(i.length,e)),[e,Math.max(e,Math.min(i.length,t))]}function zt(i,e,t=!0,r=!0){return p0(i,e,t,r)}function N1(i){return i>=56320&&i<57344}function B1(i){return i>=55296&&i<56320}function zr(i,e){let t=i.charCodeAt(e);if(!B1(t)||e+1==i.length)return t;let r=i.charCodeAt(e+1);return N1(r)?(t-55296<<10)+(r-56320)+65536:t}function Bc(i){return i<=65535?String.fromCharCode(i):(i-=65536,String.fromCharCode((i>>10)+55296,(i&1023)+56320))}function ts(i){return i<65536?1:2}var Wu=/\r\n?|\n/,It=(function(i){return i[i.Simple=0]="Simple",i[i.TrackDel=1]="TrackDel",i[i.TrackBefore=2]="TrackBefore",i[i.TrackAfter=3]="TrackAfter",i})(It||(It={})),Tn=class i{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let r=this.sections[t+1];e+=r<0?this.sections[t]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,r=0,n=0;t<this.sections.length;){let s=this.sections[t++],o=this.sections[t++];o<0?(e(r,n,s),n+=s):n+=o,r+=s}}iterChangedRanges(e,t=!1){qu(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let r=this.sections[t++],n=this.sections[t++];n<0?e.push(r,n):e.push(n,r)}return new i(e)}composeDesc(e){return this.empty?e:e.empty?this:w0(this,e)}mapDesc(e,t=!1){return e.empty?this:ju(this,e,t)}mapPos(e,t=-1,r=It.Simple){let n=0,s=0;for(let o=0;o<this.sections.length;){let a=this.sections[o++],l=this.sections[o++],h=n+a;if(l<0){if(h>e)return s+(e-n);s+=a}else{if(r!=It.Simple&&h>=e&&(r==It.TrackDel&&n<e&&h>e||r==It.TrackBefore&&n<e||r==It.TrackAfter&&h>e))return null;if(h>e||h==e&&t<0&&!a)return e==n||t<0?s:s+l;s+=l}n=h}if(e>n)throw new RangeError(`Position ${e} is out of range for changeset of length ${n}`);return s}touchesRange(e,t=e){for(let r=0,n=0;r<this.sections.length&&n<=t;){let s=this.sections[r++],o=this.sections[r++],a=n+s;if(o>=0&&n<=t&&a>=e)return n<e&&a>t?"cover":!0;n=a}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let r=this.sections[t++],n=this.sections[t++];e+=(e?" ":"")+r+(n>=0?":"+n:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new i(e)}static create(e){return new i(e)}},yi=class i extends Tn{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return qu(this,(t,r,n,s,o)=>e=e.replace(n,n+(r-t),o),!1),e}mapDesc(e,t=!1){return ju(this,e,t,!0)}invert(e){let t=this.sections.slice(),r=[];for(let n=0,s=0;n<t.length;n+=2){let o=t[n],a=t[n+1];if(a>=0){t[n]=a,t[n+1]=o;let l=n>>1;for(;r.length<l;)r.push(tt.empty);r.push(o?e.slice(s,s+o):tt.empty)}s+=o}return new i(t,r)}compose(e){return this.empty?e:e.empty?this:w0(this,e,!0)}map(e,t=!1){return e.empty?this:ju(this,e,t,!0)}iterChanges(e,t=!1){qu(this,e,t)}get desc Line truncated
`}get readOnly(){return this.facet(R0)}phrase(e,...t){for(let r of this.facet(i.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(r,n)=>{if(n=="$")return"$";let s=+(n||1);return!s||s>t.length?r:t[s-1]})),e}languageDataAt(e,t,r=-1){let n=[];for(let s of this.facet(P0))for(let o of s(this,t,r))Object.prototype.hasOwnProperty.call(o,e)&&n.push(o[e]);return n}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return r$(t.length?t[0]:"")}wordAt(e){let{text:t,from:r,length:n}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-r,a=e-r;for(;o>0;){let l=zt(t,o,!1);if(s(t.slice(l,o))!=yt.Word)break;o=l}for(;a<n;){let l=zt(t,a);if(s(t.slice(a,l))!=yt.Word)break;a=l}return o==a?null:H.range(o+r,a+r)}};it.allowMultipleSelections=Nu;it.tabSize=me.define({combine:i=>i.length?i[0]:4});it.lineSeparator=k0;it.readOnly=R0;it.phrases=me.define({compare(i,e){let t=Object.keys(i),r=Object.keys(e);return t.length==r.length&&t.every(n=>i[n]==e[n])}});it.languageData=P0;it.changeFilter=T0;it.transactionFilter=X0;it.transactionExtender=_0;Zo.reconfigure=Ce.define();function Hi(i,e,t={}){let r={};for(let n of i)for(let s of Object.keys(n)){let o=n[s],a=r[s];if(a===void 0)r[s]=o;else if(!(a===o||o===void 0))if(Object.hasOwnProperty.call(t,s))r[s]=t[s](a,o);else throw new Error("Config merge conflict for field "+s)}for(let n in e)r[n]===void 0&&(r[n]=e[n]);return r}var ur=class{eq(e){return this==e}range(e,t=e){return Ya.create(e,t,this)}};ur.prototype.startSide=ur.prototype.endSide=0;ur.prototype.point=!1;ur.prototype.mapMode=It.TrackDel;function rO(i,e){return i==e||i.constructor==e.constructor&&i.eq(e)}var Ya=class i{constructor(e,t,r){this.from=e,this.to=t,this.value=r}static create(e,t,r){return new i(e,t,r)}};function Ku(i,e){return i.from-e.from||i.value.startSide-e.value.startSide}var Ju=class i{constructor(e,t,r,n){this.from=e,this.to=t,this.value=r,this.maxPoint=n}get length(){return this.to[this.to.length-1]}findIndex(e,t,r,n=0){let s=r?this.to:this.from;for(let o=n,a=s.length;;){if(o==a)return o;let l=o+a>>1,h=s[l]-e||(r?this.value[l].endSide:this.value[l].startSide)-t;if(l==o)return h>=0?o:a;h>=0?a=l:o=l+1}}between(e,t,r,n){for(let s=this.findIndex(t,-1e9,!0),o=this.findIndex(r,1e9,!1,s);s<o;s++)if(n(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,t){let r=[],n=[],s=[],o=-1,a=-1;for(let l=0;l<this.value.length;l++){let h=this.value[l],f=this.from[l]+e,O=this.to[l]+e,m,b;if(f==O){let v=t.mapPos(f,h.startSide,h.mapMode);if(v==null||(m=b=v,h.startSide!=h.endSide&&(b=t.mapPos(f,h.endSide),b<m)))continue}else if(m=t.mapPos(f,h.startSide),b=t.mapPos(O,h.endSide),m>b||m==b&&h.startSide>0&&h.endSide<=0)continue;(b-m||h.endSide-h.startSide)<0||(o<0&&(o=m),h.point&&(a=Math.max(a,b-m)),r.push(h),n.push(m-o),s.push(b-o))}return{mapped:r.length?new i(n,s,r,a):null,pos:o}}},Le=class i{constructor(e,t,r,n){this.chunkPos=e,this.chunk=t,this.nextLayer=r,this.maxPoint=n}static create(e,t,r,n){return new i(e,t,r,n)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:r=!1,filterFrom:n=0,filterTo:s=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(r&&(t=t.slice().sort(Ku)),this.isEmpty)return t.length?i.of(t):this;let a=new Nc(this,null,-1).goto(0),l=0,h=[],f=new Ur;for(;a.value||l<t.length;)if(l<t.length&&(a.from-t[l].from||a.startSide-t[l].value.startSide)>=0){let O=t[l++];f.addInner(O.from,O.to,O.value)||h.push(O)}else a.rangeIndex==1&&a.chunkIndex<this.chunk.length&&(l==t.length||this.chunkEnd(a.chunkIndex)<t[l].from)&&(!o||n>this.chunkEnd(a.chunkIndex)||s<this.chunkPos[a.chunkIndex])&&f.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!o||n>a.to||s<a.from||o(a.from,a.to,a.value))&&(f.addInner(a.from,a.to,a.value)||h.push(Ya.create(a.from,a.to,a.value))),a.next());return f.finishInner(this.nextLayer.isEmpty&&!h.length?i.empty:this.nextLayer.update({add:h,filter:o,filterFrom:n,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],r=[],n=-1;for(let o=0;o<this.chunk.length;o++){let a=this.chunkPos[o],l=this.chunk[o],h=e.touchesRange(a,a+l.length);if(h===!1)n=Math.max(n,l.maxPoint),t.push(l),r.push(e.mapPos(a));else if(h===!0){let{mapped:f,pos:O}=l.map(a,e);f&&(n=Math.max(n,f.maxPoint),t.push(f),r.push(O))}}let s=this.nextLayer.map(e);return t.length==0?s:new i(r,t,s||i.empty,n)}between(e,t,r){if(!this.isEmpty){for(let n=0;n<this.chunk.length;n++){let s=this.chunkPos[n],o=this.chunk[n];if(t>=s&&e<=s+o.length&&o.between(s,e-s,t-s,r)===!1)return}this.nextLayer.between(e,t,r)}}iter(e=0){return Ea.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Ea.from(e).goto(t)}static compare(e,t,r,n,s=-1){let o=e.filter(O=>O.maxPoint>0||!O.is Line truncated
`)}static newName(){let e=E0[Y0]||1;return E0[Y0]=e+1,"\u037C"+e.toString(36)}static mount(e,t,r){let n=e[nO],s=r&&r.nonce;n?s&&n.setNonce(s):n=new sO(e,s),n.mount(Array.isArray(t)?t:[t],e)}},Z0=new Map,sO=class{constructor(e,t){let r=e.ownerDocument||e,n=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&n.CSSStyleSheet){let s=Z0.get(r);if(s)return e[nO]=s;this.sheet=new n.CSSStyleSheet,Z0.set(r,this)}else this.styleTag=r.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[nO]=this}mount(e,t){let r=this.sheet,n=0,s=0;for(let o=0;o<e.length;o++){let a=e[o],l=this.modules.indexOf(a);if(l<s&&l>-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,a),r)for(let h=0;h<a.rules.length;h++)r.insertRule(a.rules[h],n++)}else{for(;s<l;)n+=this.modules[s++].rules.length;n+=a.rules.length,s++}}if(r)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let o="";for(let l=0;l<this.modules.length;l++)o+=this.modules[l].getRules()+`
`;this.styleTag.textContent=o;let a=t.head||t;this.styleTag.parentNode!=a&&a.insertBefore(this.styleTag,a.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}};var Xn={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:"'"},Uo={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},s$=typeof navigator!="undefined"&&/Mac/.test(navigator.platform),o$=typeof navigator!="undefined"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(Dt=0;Dt<10;Dt++)Xn[48+Dt]=Xn[96+Dt]=String(Dt);var Dt;for(Dt=1;Dt<=24;Dt++)Xn[Dt+111]="F"+Dt;var Dt;for(Dt=65;Dt<=90;Dt++)Xn[Dt]=String.fromCharCode(Dt+32),Uo[Dt]=String.fromCharCode(Dt);var Dt;for(Fc in Xn)Uo.hasOwnProperty(Fc)||(Uo[Fc]=Xn[Fc]);var Fc;function U0(i){var e=s$&&i.metaKey&&i.shiftKey&&!i.ctrlKey&&!i.altKey||o$&&i.shiftKey&&i.key&&i.key.length==1||i.key=="Unidentified",t=!e&&i.key||(i.shiftKey?Uo:Xn)[i.keyCode]||i.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function Lt(){var i=arguments[0];typeof i=="string"&&(i=document.createElement(i));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var n=t[r];typeof n=="string"?i.setAttribute(r,n):n!=null&&(i[r]=n)}e++}for(;e<arguments.length;e++)z0(i,arguments[e]);return i}function z0(i,e){if(typeof e=="string")i.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)i.appendChild(e);else if(Array.isArray(e))for(var t=0;t<e.length;t++)z0(i,e[t]);else throw new RangeError("Unsupported child node: "+e)}var wi=typeof navigator!="undefined"?navigator:{userAgent:"",vendor:"",platform:""},pO=typeof document!="undefined"?document:{documentElement:{style:{}}},mO=/Edge\/(\d+)/.exec(wi.userAgent),yb=/MSIE \d/.test(wi.userAgent),gO=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(wi.userAgent),Xh=!!(yb||gO||mO),L0=!Xh&&/gecko\/(\d+)/i.test(wi.userAgent),oO=!Xh&&/Chrome\/(\d+)/.exec(wi.userAgent),M0="webkitFontSmoothing"in pO.documentElement.style,bO=!Xh&&/Apple Computer/.test(wi.vendor),V0=bO&&(/Mobile\/\w+/.test(wi.userAgent)||wi.maxTouchPoints>2),Qe={mac:V0||/Mac/.test(wi.platform),windows:/Win/.test(wi.platform),linux:/Linux|X11/.test(wi.platform),ie:Xh,ie_version:yb?pO.documentMode||6:gO?+gO[1]:mO?+mO[1]:0,gecko:L0,gecko_version:L0?+(/Firefox\/(\d+)/.exec(wi.userAgent)||[0,0])[1]:0,chrome:!!oO,chrome_version:oO?+oO[1]:0,ios:V0,android:/Android\b/.test(wi.userAgent),webkit:M0,webkit_version:M0?+(/\bAppleWebKit\/(\d+)/.exec(wi.userAgent)||[0,0])[1]:0,safari:bO,safari_version:bO?+(/\bVersion\/(\d+(\.\d+)?)/.exec(wi.userAgent)||[0,0])[1]:0,tabSize:pO.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function hd(i,e){for(let t in i)t=="class"&&e.class?e.class+=" "+i.class:t=="style"&&e.style?e.style+=";"+i.style:e[t]=i[t];return e}var fh=Object.create(null);function fd(i,e,t){if(i==e)return!0;i||(i=fh),e||(e=fh);let r=Object.keys(i),n=Object.keys(e);if(r.length-(t&&r.indexOf(t)>-1?1:0)!=n.length-(t&&n.indexOf(t)>-1?1:0))return!1;for(let s of r)if(s!=t&&(n.indexOf(s)==-1||i[s]!==e[s]))return!1;return!0}function a$(i,e){for(let t=i.attributes.length-1;t>=0;t--){let r=i.attributes[t].name;e[r]==null&&i.removeAttribute(r)}for(let t in e){let r=e[t];t=="style"?i.style.cssText=r:i.getAttribute(t)!=r&&i.setAttribute(t,r)}}function D0(i,e,t){let r=!1;if(e)for(let n in e)t&&n in t||(r=!0,n=="style"?i.style.cssText="":i.removeAttribute(n));if(t)for(let n in t)e&&e[n]==t[n]||(r=!0,n=="style"?i.style.cssText=t[n]:i.setAttribute(n,t[n]));return r}function l$(i){let e=Object.create(null);for(let t=0;t<i.attributes.length;t++){let r=i.attributes[t];e[r.name]=r.value}return e}var Ft=class{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}},ti=(function(i){return i[i.Text=0]="Text",i[i.WidgetBefore=1]="WidgetBefore",i[i.WidgetAfter=2]="WidgetAfter",i[i.WidgetRange=3]="WidgetRange",i})(ti||(ti={})),de=class extends ur{constructor(e,t,r,n){super(),this.startSide=e,this.endSLine truncated
`,n=i.state.doc.line(n.number+(t?1:-1)),s=i.bidiSpans(n),h=i.visualLineSide(n,!t)}if(l){if(!l(f))return a}else{if(!r)return h;l=r(f)}a=h}}function D$(i,e,t){let r=i.state.charCategorizer(e),n=r(t);return s=>{let o=r(s);return n==xt.Space&&(n=o),n==o}}function W$(i,e,t,r){let n=e.head,s=t?1:-1;if(n==(t?i.state.doc.length:0))return H.cursor(n,e.assoc);let o=e.goalColumn,a,l=i.contentDOM.getBoundingClientRect(),h=i.coordsAtPos(n,(e.empty?e.assoc:0)||(t?1:-1)),f=i.documentTop;if(h)o==null&&(o=h.left-l.left),a=s<0?h.top:h.bottom;else{let v=i.viewState.lineBlockAt(n);o==null&&(o=Math.min(l.right-l.left,i.defaultCharacterWidth*(n-v.from))),a=(s<0?v.top:v.bottom)+f}let O=l.left+o,m=r!=null?r:i.viewState.heightOracle.textHeight>>1,b=YO(i,{x:O,y:a+m*s},!1,s);return H.cursor(b.pos,b.assoc,void 0,o)}function ja(i,e,t){for(;;){let r=0;for(let n of i)n.between(e-1,e+1,(s,o,a)=>{if(e>s&&e<o){let l=r||t||(e-s<o-e?-1:1);e=l<0?s:o,r=l}});if(!r)return e}}function Hb(i,e){let t=null;for(let r=0;r<e.ranges.length;r++){let n=e.ranges[r],s=null;if(n.empty){let o=ja(i,n.from,0);o!=n.from&&(s=H.cursor(o,-1))}else{let o=ja(i,n.from,-1),a=ja(i,n.to,1);(o!=n.from||a!=n.to)&&(s=H.range(n.from==n.anchor?o:a,n.from==n.head?o:a))}s&&(t||(t=e.ranges.slice()),t[r]=s)}return t?H.create(t,e.mainIndex):e}function cO(i,e,t){let r=ja(i.state.facet(il).map(n=>n(i)),t.from,e.head>t.from?-1:1);return r==t.from?t:H.cursor(r,r<t.from?1:-1)}var mr=class{constructor(e,t){this.pos=e,this.assoc=t}};function YO(i,e,t,r){let n=i.contentDOM.getBoundingClientRect(),s=n.top+i.viewState.paddingTop,{x:o,y:a}=e,l=a-s,h;for(;;){if(l<0)return new mr(0,1);if(l>i.viewState.docHeight)return new mr(i.state.doc.length,-1);if(h=i.elementAtHeight(l),r==null)break;if(h.type==ti.Text){if(r<0?h.to<i.viewport.from:h.from>i.viewport.to)break;let m=i.docView.coordsAt(r<0?h.from:h.to,r>0?-1:1);if(m&&(r<0?m.top<=l+s:m.bottom>=l+s))break}let O=i.viewState.heightOracle.textHeight/2;l=r>0?h.bottom+O:h.top-O}if(i.viewport.from>=h.to||i.viewport.to<=h.from){if(t)return null;if(h.type==ti.Text){let O=M$(i,n,h,o,a);return new mr(O,O==h.from?1:-1)}}if(h.type!=ti.Text)return l<(h.top+h.bottom)/2?new mr(h.from,1):new mr(h.to,-1);let f=i.docView.lineAt(h.from,2);return(!f||f.length!=h.length)&&(f=i.docView.lineAt(h.from,-2)),new EO(i,o,a,i.textDirectionAt(h.from)).scanTile(f,h.from)}var EO=class{constructor(e,t,r,n){this.view=e,this.x=t,this.y=r,this.baseDir=n,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:r,spans:n}=this.bidiSpansAt(e);return n[gr.find(n,e-r.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:r,spans:n}=this.bidiSpansAt(e);return n[gr.find(n,e-r.from,-1,t)].dir}bidiIn(e,t){let{spans:r,line:n}=this.bidiSpansAt(e);return r.length>1||r.length&&(r[0].level!=this.baseDir||r[0].to+n.from<t)}scan(e,t){let r=0,n=e.length-1,s=new Set,o=this.bidiIn(e[0],e[n]),a,l,h=-1,f=1e9,O;e:for(;r<n;){let b=n-r,v=r+n>>1;t:if(s.has(v)){let T=r+Math.floor(Math.random()*b);for(let Y=0;Y<b;Y++){if(!s.has(T)){v=T;break t}T++,T==n&&(T=r)}break e}s.add(v);let P=t(v);if(P)for(let T=0;T<P.length;T++){let Y=P[T],B=0;if(Y.bottom<this.y)(!a||a.bottom<Y.bottom)&&(a=Y),B=1;else if(Y.top>this.y)(!l||l.top>Y.top)&&(l=Y),B=-1;else{let q=Y.left>this.x?this.x-Y.left:Y.right<this.x?this.x-Y.right:0,N=Math.abs(q);N<f&&(h=v,f=N,O=Y),q&&(B=q<0==(this.baseDir==St.LTR)?-1:1)}B==-1&&(!o||this.baseDirAt(e[v],1))?n=v:B==1&&(!o||this.baseDirAt(e[v+1],-1))&&(r=v+1)}}if(!O){let b=a&&(!l||this.y-a.bottom<l.top-this.y)?a:l;return this.y=(b.top+b.bottom)/2,this.scan(e,t)}let m=(o?this.dirAt(e[h],1):this.baseDir)==St.LTR;return{i:h,after:this.x>(O.left+O.right)/2==m}}scanText(e,t){let r=[];for(let s=0;s<e.length;s=zt(e.text,s))r.push(t+s);r.push(t+e.length);let n=this.scan(r,s=>{let o=r[s]-t,a=r[s+1]-t;return Ka(e.dom,o,a).getClientRects()});return n.after?new mr(r[n.i+1],-1):new mr(r[n.i],1)}scanTile(e,t){if(!e.length)return new mr(t,1);if(e.children.length==1){let a=e.children[0];if(a.isText())return this.scanText(a,t);if(a.isComposite())return this.scanTile(a,t)}let r=[t];for(let a=0,l=t;a<e.children.length;a++)r.push(l+=e.children[a].length);let n=this.scan(r,a=>{let l=e.children[a];return l.flags&48?null:(l.dom.nodeType==1?l.dom:Ka(l.dom,0,l.length)).getClientRects()}),s=e.children[n.i],o=r[n.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):n.after?new mr(r[n.i+1],-1):new mr(o,1)}},Ua="\uFFFF",ZO=class{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(it.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Ua}readRange(e,t){if(!e)return this;let r=e.parentNode;for(let n=e;;){this.findPointBefore(r,n);let s=this.text.length;this.readNode(n);let o=Ut.get(n),a=n.nextSibling;if(a==t){o!=null&&o.breakAfter&&!a&&r!=this.view.contentDOM&&this.lineBreak();break}let l=Ut.get(a);(o&&l?o.breakAfter: Line truncated
`&&i.lineWrapping&&(r&&(r=H.single(r.main.anchor-1,r.main.head-1)),t={from:n.from,to:n.to,insert:tt.of([" "])}),t)return bd(i,t,r,s);if(r&&!Sh(r,n)){let o=!1,a="select";return i.inputState.lastSelectionTime>Date.now()-50&&(i.inputState.lastSelectionOrigin=="select"&&(o=!0),a=i.inputState.lastSelectionOrigin,a=="select.pointer"&&(r=Hb(i.state.facet(il).map(l=>l(i)),r))),i.dispatch({selection:r,scrollIntoView:o,userEvent:a}),!0}else return!1}function bd(i,e,t,r=-1){if(Qe.ios&&i.inputState.flushIOSKey(e))return!0;let n=i.state.selection.main;if(Qe.android&&(e.to==n.to&&(e.from==n.from||e.from==n.from-1&&i.state.sliceDoc(e.from,n.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Wo(i.contentDOM,"Enter",13)||(e.from==n.from-1&&e.to==n.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>n.head)&&Wo(i.contentDOM,"Backspace",8)||e.from==n.from&&e.to==n.to+1&&e.insert.length==0&&Wo(i.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();i.inputState.composing>=0&&i.inputState.composing++;let o,a=()=>o||(o=I$(i,e,t));return i.state.facet(Lb).some(l=>l(i,e.from,e.to,s,a))||i.dispatch(a()),!0}function I$(i,e,t){let r,n=i.state,s=n.selection.main,o=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let l=e.from<s.from?-1:1,h=l<0?s.from:s.to,f=ja(n.facet(il).map(O=>O(i)),h,l);e.from==f&&(o=f)}if(o>-1)r={changes:e,selection:H.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&i.inputState.composing<0){let l=s.from<e.from?n.sliceDoc(s.from,e.from):"",h=s.to>e.to?n.sliceDoc(e.to,s.to):"";r=n.replaceSelection(i.state.toText(l+e.insert.sliceString(0,void 0,i.state.lineBreak)+h))}else{let l=n.changes(e),h=t&&t.main.to<=l.newLength?t.main:void 0;if(n.selection.ranges.length>1&&(i.inputState.composing>=0||i.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let f=i.state.sliceDoc(e.from,e.to),O,m=t&&Fb(i,t.main.head);if(m){let v=e.insert.length-(e.to-e.from);O={from:m.from,to:m.to-v}}else O=i.state.doc.lineAt(s.head);let b=s.to-e.to;r=n.changeByRange(v=>{if(v.from==s.from&&v.to==s.to)return{changes:l,range:h||v.map(l)};let P=v.to-b,T=P-f.length;if(i.state.sliceDoc(T,P)!=f||P>=O.from&&T<=O.to)return{range:v};let Y=n.changes({from:T,to:P,insert:e.insert}),B=v.to-s.to;return{changes:Y,range:h?H.range(Math.max(0,h.anchor+B),Math.max(0,h.head+B)):v.map(Y)}})}else r={changes:l,selection:h&&n.selection.replaceRange(h)}}let a="input.type";return(i.composing||i.inputState.compositionPendingChange&&i.inputState.compositionEndedAt>Date.now()-50)&&(i.inputState.compositionPendingChange=!1,a+=".compose",i.inputState.compositionFirstChange&&(a+=".start",i.inputState.compositionFirstChange=!1)),n.update(r,{userEvent:a,scrollIntoView:!0})}function eS(i,e,t,r){let n=Math.min(i.length,e.length),s=0;for(;s<n&&i.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==n&&i.length==e.length)return null;let o=i.length,a=e.length;for(;o>0&&a>0&&i.charCodeAt(o-1)==e.charCodeAt(a-1);)o--,a--;if(r=="end"){let l=Math.max(0,s-Math.min(o,a));t-=o+l-s}if(o<s&&i.length<e.length){let l=t<=s&&t>=o?s-t:0;s-=l,a=s+(a-o),o=s}else if(a<s){let l=t<=s&&t>=a?s-t:0;s-=l,o=s+(o-a),a=s}return{from:s,toA:o,toB:a}}function N$(i){let e=[];if(i.root.activeElement!=i.contentDOM)return e;let{anchorNode:t,anchorOffset:r,focusNode:n,focusOffset:s}=i.observer.selectionRange;return t&&(e.push(new bh(t,r)),(n!=t||s!=r)&&e.push(new bh(n,s))),e}function B$(i,e){if(i.length==0)return null;let t=i[0].pos,r=i.length==2?i[1].pos:t;return t>-1&&r>-1?H.single(t+e,r+e):null}function Sh(i,e){return e.head==i.main.head&&e.anchor==i.main.anchor}var zO=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Qe.safari&&e.contentDOM.addEventListener("input",()=>null),Qe.gecko&&lP(e.contentDOM.ownerDocument)}handleEvent(e){!tP(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let r=this.handlers[e];if(r){for(let n of r.observers)n(this.view,t);for(let n of r.handlers){if(t.defaultPrevented)break;if(n(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=G$(e),r=this.handlers,n=this.view.contentDOM;for(let s in t)if(s!="scroll"){let o=!t[s]. Line truncated
`))};if((Qe.mac||Qe.android)&&O.from==o-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(O={from:a,to:l,insert:tt.of([r.text.replace("."," ")])}),this.pendingContextChange=O,!e.state.readOnly){let m=this.to-this.from+(O.to-O.from+O.insert.length);bd(e,O,H.single(this.toEditorPos(r.selectionStart,m),this.toEditorPos(r.selectionEnd,m)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),O.from<O.to&&!O.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(t.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let n=[],s=null;for(let o=this.toEditorPos(r.rangeStart),a=this.toEditorPos(r.rangeEnd);o<a;o++){let l=e.coordsForChar(o);s=l&&new DOMRect(l.left,l.top,l.right-l.left,l.bottom-l.top)||s||new DOMRect,n.push(s)}t.updateCharacterBounds(r.rangeStart,n)},this.handlers.textformatupdate=r=>{let n=[];for(let s of r.getTextFormats()){let o=s.underlineStyle,a=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(a)){let l=this.toEditorPos(s.rangeStart),h=this.toEditorPos(s.rangeEnd);if(l<h){let f=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(a)?1:2}px`;n.push(de.mark({attributes:{style:f}}).range(l,h))}}}e.dispatch({effects:qb.of(de.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)t.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let n=Ha(r.root);n&&n.rangeCount&&this.editContext.updateSelectionBounds(n.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,r=!1,n=this.pendingContextChange;return e.changes.iterChanges((s,o,a,l,h)=>{if(r)return;let f=h.length-(o-s);if(n&&o>=n.to)if(n.from==s&&n.to==o&&n.insert.eq(h)){n=this.pendingContextChange=null,t+=f,this.to+=f;return}else n=null,this.revertPending(e.state);if(s+=t,o+=t,o<=this.from)this.from+=f,this.to+=f;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+h.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),h.toString()),this.to+=f}t+=f}),n&&!r&&this.revertPending(e.state),!r}update(e){let t=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(n=>!n.isUserEvent("input.type")&&n.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),n=this.toContextPos(t.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=n)&&this.editContext.updateSelection(r,n)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},ne=class i{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&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.mea Line truncated
-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,id),YP={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},fO=null;function EP(){var i;if(fO==null&&typeof document!="undefined"&&document.body){let e=document.body.style;fO=((i=e.tabSize)!==null&&i!==void 0?i:e.MozTabSize)!=null}return fO||!1}var ch=me.define({combine(i){let e=Hi(i,{render:null,specialChars:AP,addSpecialChars:null});return(e.replaceTabs=!EP())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,id)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,id)),e}});function QS(i={}){return[ch.of(i),ZP()]}var pb=null;function ZP(){return pb||(pb=Rt.fromClass(class{constructor(i){this.view=i,this.decorations=de.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(i.state.facet(ch)),this.decorations=this.decorator.createDeco(i)}makeDecorator(i){return new td({regexp:i.specialChars,decoration:(e,t,r)=>{let{doc:n}=t.state,s=zr(e[0],0);if(s==9){let o=n.lineAt(r),a=t.state.tabSize,l=yi(o.text,a,r-o.from);return de.replace({widget:new nd((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=de.replace({widget:new rd(i,s)}))},boundary:i.replaceTabs?void 0:/[^]/})}update(i){let e=i.state.facet(ch);i.startState.facet(ch)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(i.view)):this.decorations=this.decorator.updateDeco(i,this.decorations)}},{decorations:i=>i.decorations}))}var UP="\u2022";function zP(i){return i>=32?UP:i==10?"\u2424":String.fromCharCode(9216+i)}var rd=class extends Ft{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=zP(this.code),r=e.state.phrase("Control character")+" "+(YP[this.code]||"0x"+this.code.toString(16)),n=this.options.render&&this.options.render(this.code,r,t);if(n)return n;let s=document.createElement("span");return s.textContent=t,s.title=r,s.setAttribute("aria-label",r),s.className="cm-specialChar",s}ignoreEvent(){return!1}},nd=class extends Ft{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}};function Qd(){return MP}var LP=de.line({class:"cm-activeLine"}),MP=Rt.fromClass(class{constructor(i){this.decorations=this.getDeco(i)}update(i){(i.docChanged||i.selectionSet)&&(this.decorations=this.getDeco(i.view))}getDeco(i){let e=-1,t=[];for(let r of i.state.selection.ranges){let n=i.lineBlockAt(r.head);n.from>e&&(t.push(LP.range(n.from)),e=n.from)}return de.set(t)}},{decorations:i=>i.decorations});var sd=2e3;function VP(i,e,t){let r=Math.min(e.line,t.line),n=Math.max(e.line,t.line),s=[];if(e.off>sd||t.off>sd||e.col<0||t.col<0){let o=Math.min(e.off,t.off),a=Math.max(e.off,t.off);for(let l=r;l<=n;l++){let h=i.doc.line(l);h.length<=a&&s.push(H.range(h.from+o,h.to+a))}}else{let o=Math.min(e.col,t.col),a=Math.max(e.col,t.col);for(let l=r;l<=n;l++){let h=i.doc.line(l),f=Gc(h.text,o,i.tabSize,!0);if(f<0)s.push(H.cursor(h.to));else{let O=Gc(h.text,a,i.tabSize);s.push(H.range(h.from+f,h.from+O))}}}return s}function DP(i,e){let t=i.coordsAtPos(i.viewport.from);return t?Math.round(Math.abs((t.left-e)/i.defaultCharacterWidth)):-1}function mb(i,e){let t=i.posAtCoords({x:e.clientX,y:e.clientY},!1),r=i.state.doc.lineAt(t),n=t-r.from,s=n>sd?-1:n==r.length?DP(i,e.clientX):yi(r.text,i.state.tabSize,t-r.from);return{line:r.number,col:s,off:n}}function WP(i,e){let t=mb(i,e),r=i.state.selection;return t?{update(n){if(n.docChanged){let s=n.changes.mapPos(n.startState.doc.line(t.line).from),o=n.state.doc.lineAt(s);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},r=r.map(n.changes)}},get(n,s,o){let a=mb(i,n);if(!a)return r;let l=VP(i.state,t,a);return l.length?o?H.create(l.concat(r.ranges)):H.create(l):r}}:null}function vd(i){let e=(i==null?void 0:i.eventFilter)||(t=>t.altKey&&t.button==0);return ne.mouseSelectionStyle.of((t,r)=>e(r)?WP(t,r):null)}var qP={Alt:[18,i=>!!i.altKey],Control:[17,i=>!!i.ctrlKey],Shift:[16,i=>!!i.shiftKey],Meta:[91,i=>!!i.metaKey]},jP={style:"cursor: crosshair"};function xd(i={}){let[e,t]=qP[i.key||"Alt"],r=Rt.fromClass(class{constructor(n){this.view=n,this.isDown=!1}set(n){this.isDown!=n&&(this.isDown=n,this.view.update([]))}},{eventObservers:{keydown(n){this.set(n.keyCode==e||t(n))},keyup(n){(n.keyCode==e||!t(n))&&this.set(!1)},mousemove(n){this.set(t(n))}}} Line truncated
`;this.styleTag.textContent=o;let a=t.head||t;this.styleTag.parentNode!=a&&a.insertBefore(this.styleTag,a.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}};var Xn={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:"'"},Uo={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},s$=typeof navigator!="undefined"&&/Mac/.test(navigator.platform),o$=typeof navigator!="undefined"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(Dt=0;Dt<10;Dt++)Xn[48+Dt]=Xn[96+Dt]=String(Dt);var Dt;for(Dt=1;Dt<=24;Dt++)Xn[Dt+111]="F"+Dt;var Dt;for(Dt=65;Dt<=90;Dt++)Xn[Dt]=String.fromCharCode(Dt+32),Uo[Dt]=String.fromCharCode(Dt);var Dt;for(Fc in Xn)Uo.hasOwnProperty(Fc)||(Uo[Fc]=Xn[Fc]);var Fc;function U0(i){var e=s$&&i.metaKey&&i.shiftKey&&!i.ctrlKey&&!i.altKey||o$&&i.shiftKey&&i.key&&i.key.length==1||i.key=="Unidentified",t=!e&&i.key||(i.shiftKey?Uo:Xn)[i.keyCode]||i.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function Lt(){var i=arguments[0];typeof i=="string"&&(i=document.createElement(i));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var n=t[r];typeof n=="string"?i.setAttribute(r,n):n!=null&&(i[r]=n)}e++}for(;e<arguments.length;e++)z0(i,arguments[e]);return i}function z0(i,e){if(typeof e=="string")i.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)i.appendChild(e);else if(Array.isArray(e))for(var t=0;t<e.length;t++)z0(i,e[t]);else throw new RangeError("Unsupported child node: "+e)}var wi=typeof navigator!="undefined"?navigator:{userAgent:"",vendor:"",platform:""},pO=typeof document!="undefined"?document:{documentElement:{style:{}}},mO=/Edge\/(\d+)/.exec(wi.userAgent),xb=/MSIE \d/.test(wi.userAgent),gO=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(wi.userAgent),Xh=!!(xb||gO||mO),L0=!Xh&&/gecko\/(\d+)/i.test(wi.userAgent),oO=!Xh&&/Chrome\/(\d+)/.exec(wi.userAgent),M0="webkitFontSmoothing"in pO.documentElement.style,bO=!Xh&&/Apple Computer/.test(wi.vendor),V0=bO&&(/Mobile\/\w+/.test(wi.userAgent)||wi.maxTouchPoints>2),Qe={mac:V0||/Mac/.test(wi.platform),windows:/Win/.test(wi.platform),linux:/Linux|X11/.test(wi.platform),ie:Xh,ie_version:xb?pO.documentMode||6:gO?+gO[1]:mO?+mO[1]:0,gecko:L0,gecko_version:L0?+(/Firefox\/(\d+)/.exec(wi.userAgent)||[0,0])[1]:0,chrome:!!oO,chrome_version:oO?+oO[1]:0,ios:V0,android:/Android\b/.test(wi.userAgent),webkit:M0,webkit_version:M0?+(/\bAppleWebKit\/(\d+)/.exec(wi.userAgent)||[0,0])[1]:0,safari:bO,safari_version:bO?+(/\bVersion\/(\d+(\.\d+)?)/.exec(wi.userAgent)||[0,0])[1]:0,tabSize:pO.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function hd(i,e){for(let t in i)t=="class"&&e.class?e.class+=" "+i.class:t=="style"&&e.style?e.style+=";"+i.style:e[t]=i[t];return e}var fh=Object.create(null);function fd(i,e,t){if(i==e)return!0;i||(i=fh),e||(e=fh);let r=Object.keys(i),n=Object.keys(e);if(r.length-(t&&r.indexOf(t)>-1?1:0)!=n.length-(t&&n.indexOf(t)>-1?1:0))return!1;for(let s of r)if(s!=t&&(n.indexOf(s)==-1||i[s]!==e[s]))return!1;return!0}function a$(i,e){for(let t=i.attributes.length-1;t>=0;t--){let r=i.attributes[t].name;e[r]==null&&i.removeAttribute(r)}for(let t in e){let r=e[t];t=="style"?i.style.cssText=r:i.getAttribute(t)!=r&&i.setAttribute(t,r)}}function D0(i,e,t){let r=!1;if(e)for(let n in e)t&&n in t||(r=!0,n=="style"?i.style.cssText="":i.removeAttribute(n));if(t)for(let n in t)e&&e[n]==t[n]||(r=!0,n=="style"?i.style.cssText=t[n]:i.setAttribute(n,t[n]));return r}function l$(i){let e=Object.create(null);for(let t=0;t<i.attributes.length;t++){let r=i.attributes[t];e[r.name]=r.value}return e}var Ft=class{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}},ti=(function(i){return i[i.Text=0]="Text",i[i.WidgetBefore=1]="WidgetBefore",i[i.WidgetAfter=2]="WidgetAfter",i[i.WidgetRange=3]="WidgetRange",i})(ti||(ti={})),de=class extends ur{constructor(e,t,r,n){super(),this.startSide=e,this.endSLine truncated
`,n=i.state.doc.line(n.number+(t?1:-1)),s=i.bidiSpans(n),h=i.visualLineSide(n,!t)}if(l){if(!l(f))return a}else{if(!r)return h;l=r(f)}a=h}}function D$(i,e,t){let r=i.state.charCategorizer(e),n=r(t);return s=>{let o=r(s);return n==yt.Space&&(n=o),n==o}}function W$(i,e,t,r){let n=e.head,s=t?1:-1;if(n==(t?i.state.doc.length:0))return H.cursor(n,e.assoc);let o=e.goalColumn,a,l=i.contentDOM.getBoundingClientRect(),h=i.coordsAtPos(n,(e.empty?e.assoc:0)||(t?1:-1)),f=i.documentTop;if(h)o==null&&(o=h.left-l.left),a=s<0?h.top:h.bottom;else{let v=i.viewState.lineBlockAt(n);o==null&&(o=Math.min(l.right-l.left,i.defaultCharacterWidth*(n-v.from))),a=(s<0?v.top:v.bottom)+f}let O=l.left+o,m=r!=null?r:i.viewState.heightOracle.textHeight>>1,b=YO(i,{x:O,y:a+m*s},!1,s);return H.cursor(b.pos,b.assoc,void 0,o)}function ja(i,e,t){for(;;){let r=0;for(let n of i)n.between(e-1,e+1,(s,o,a)=>{if(e>s&&e<o){let l=r||t||(e-s<o-e?-1:1);e=l<0?s:o,r=l}});if(!r)return e}}function Hb(i,e){let t=null;for(let r=0;r<e.ranges.length;r++){let n=e.ranges[r],s=null;if(n.empty){let o=ja(i,n.from,0);o!=n.from&&(s=H.cursor(o,-1))}else{let o=ja(i,n.from,-1),a=ja(i,n.to,1);(o!=n.from||a!=n.to)&&(s=H.range(n.from==n.anchor?o:a,n.from==n.head?o:a))}s&&(t||(t=e.ranges.slice()),t[r]=s)}return t?H.create(t,e.mainIndex):e}function cO(i,e,t){let r=ja(i.state.facet(il).map(n=>n(i)),t.from,e.head>t.from?-1:1);return r==t.from?t:H.cursor(r,r<t.from?1:-1)}var mr=class{constructor(e,t){this.pos=e,this.assoc=t}};function YO(i,e,t,r){let n=i.contentDOM.getBoundingClientRect(),s=n.top+i.viewState.paddingTop,{x:o,y:a}=e,l=a-s,h;for(;;){if(l<0)return new mr(0,1);if(l>i.viewState.docHeight)return new mr(i.state.doc.length,-1);if(h=i.elementAtHeight(l),r==null)break;if(h.type==ti.Text){if(r<0?h.to<i.viewport.from:h.from>i.viewport.to)break;let m=i.docView.coordsAt(r<0?h.from:h.to,r>0?-1:1);if(m&&(r<0?m.top<=l+s:m.bottom>=l+s))break}let O=i.viewState.heightOracle.textHeight/2;l=r>0?h.bottom+O:h.top-O}if(i.viewport.from>=h.to||i.viewport.to<=h.from){if(t)return null;if(h.type==ti.Text){let O=M$(i,n,h,o,a);return new mr(O,O==h.from?1:-1)}}if(h.type!=ti.Text)return l<(h.top+h.bottom)/2?new mr(h.from,1):new mr(h.to,-1);let f=i.docView.lineAt(h.from,2);return(!f||f.length!=h.length)&&(f=i.docView.lineAt(h.from,-2)),new EO(i,o,a,i.textDirectionAt(h.from)).scanTile(f,h.from)}var EO=class{constructor(e,t,r,n){this.view=e,this.x=t,this.y=r,this.baseDir=n,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:r,spans:n}=this.bidiSpansAt(e);return n[gr.find(n,e-r.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:r,spans:n}=this.bidiSpansAt(e);return n[gr.find(n,e-r.from,-1,t)].dir}bidiIn(e,t){let{spans:r,line:n}=this.bidiSpansAt(e);return r.length>1||r.length&&(r[0].level!=this.baseDir||r[0].to+n.from<t)}scan(e,t){let r=0,n=e.length-1,s=new Set,o=this.bidiIn(e[0],e[n]),a,l,h=-1,f=1e9,O;e:for(;r<n;){let b=n-r,v=r+n>>1;t:if(s.has(v)){let X=r+Math.floor(Math.random()*b);for(let Y=0;Y<b;Y++){if(!s.has(X)){v=X;break t}X++,X==n&&(X=r)}break e}s.add(v);let P=t(v);if(P)for(let X=0;X<P.length;X++){let Y=P[X],G=0;if(Y.bottom<this.y)(!a||a.bottom<Y.bottom)&&(a=Y),G=1;else if(Y.top>this.y)(!l||l.top>Y.top)&&(l=Y),G=-1;else{let q=Y.left>this.x?this.x-Y.left:Y.right<this.x?this.x-Y.right:0,N=Math.abs(q);N<f&&(h=v,f=N,O=Y),q&&(G=q<0==(this.baseDir==St.LTR)?-1:1)}G==-1&&(!o||this.baseDirAt(e[v],1))?n=v:G==1&&(!o||this.baseDirAt(e[v+1],-1))&&(r=v+1)}}if(!O){let b=a&&(!l||this.y-a.bottom<l.top-this.y)?a:l;return this.y=(b.top+b.bottom)/2,this.scan(e,t)}let m=(o?this.dirAt(e[h],1):this.baseDir)==St.LTR;return{i:h,after:this.x>(O.left+O.right)/2==m}}scanText(e,t){let r=[];for(let s=0;s<e.length;s=zt(e.text,s))r.push(t+s);r.push(t+e.length);let n=this.scan(r,s=>{let o=r[s]-t,a=r[s+1]-t;return Ka(e.dom,o,a).getClientRects()});return n.after?new mr(r[n.i+1],-1):new mr(r[n.i],1)}scanTile(e,t){if(!e.length)return new mr(t,1);if(e.children.length==1){let a=e.children[0];if(a.isText())return this.scanText(a,t);if(a.isComposite())return this.scanTile(a,t)}let r=[t];for(let a=0,l=t;a<e.children.length;a++)r.push(l+=e.children[a].length);let n=this.scan(r,a=>{let l=e.children[a];return l.flags&48?null:(l.dom.nodeType==1?l.dom:Ka(l.dom,0,l.length)).getClientRects()}),s=e.children[n.i],o=r[n.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):n.after?new mr(r[n.i+1],-1):new mr(o,1)}},Ua="\uFFFF",ZO=class{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(it.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Ua}readRange(e,t){if(!e)return this;let r=e.parentNode;for(let n=e;;){this.findPointBefore(r,n);let s=this.text.length;this.readNode(n);let o=Ut.get(n),a=n.nextSibling;if(a==t){o!=null&&o.breakAfter&&!a&&r!=this.view.contentDOM&&this.lineBreak();break}let l=Ut.get(a);(o&&l?o.breakAfter: Line truncated
`&&i.lineWrapping&&(r&&(r=H.single(r.main.anchor-1,r.main.head-1)),t={from:n.from,to:n.to,insert:tt.of([" "])}),t)return bd(i,t,r,s);if(r&&!Sh(r,n)){let o=!1,a="select";return i.inputState.lastSelectionTime>Date.now()-50&&(i.inputState.lastSelectionOrigin=="select"&&(o=!0),a=i.inputState.lastSelectionOrigin,a=="select.pointer"&&(r=Hb(i.state.facet(il).map(l=>l(i)),r))),i.dispatch({selection:r,scrollIntoView:o,userEvent:a}),!0}else return!1}function bd(i,e,t,r=-1){if(Qe.ios&&i.inputState.flushIOSKey(e))return!0;let n=i.state.selection.main;if(Qe.android&&(e.to==n.to&&(e.from==n.from||e.from==n.from-1&&i.state.sliceDoc(e.from,n.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Wo(i.contentDOM,"Enter",13)||(e.from==n.from-1&&e.to==n.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>n.head)&&Wo(i.contentDOM,"Backspace",8)||e.from==n.from&&e.to==n.to+1&&e.insert.length==0&&Wo(i.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();i.inputState.composing>=0&&i.inputState.composing++;let o,a=()=>o||(o=I$(i,e,t));return i.state.facet(Lb).some(l=>l(i,e.from,e.to,s,a))||i.dispatch(a()),!0}function I$(i,e,t){let r,n=i.state,s=n.selection.main,o=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let l=e.from<s.from?-1:1,h=l<0?s.from:s.to,f=ja(n.facet(il).map(O=>O(i)),h,l);e.from==f&&(o=f)}if(o>-1)r={changes:e,selection:H.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&i.inputState.composing<0){let l=s.from<e.from?n.sliceDoc(s.from,e.from):"",h=s.to>e.to?n.sliceDoc(e.to,s.to):"";r=n.replaceSelection(i.state.toText(l+e.insert.sliceString(0,void 0,i.state.lineBreak)+h))}else{let l=n.changes(e),h=t&&t.main.to<=l.newLength?t.main:void 0;if(n.selection.ranges.length>1&&(i.inputState.composing>=0||i.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let f=i.state.sliceDoc(e.from,e.to),O,m=t&&Fb(i,t.main.head);if(m){let v=e.insert.length-(e.to-e.from);O={from:m.from,to:m.to-v}}else O=i.state.doc.lineAt(s.head);let b=s.to-e.to;r=n.changeByRange(v=>{if(v.from==s.from&&v.to==s.to)return{changes:l,range:h||v.map(l)};let P=v.to-b,X=P-f.length;if(i.state.sliceDoc(X,P)!=f||P>=O.from&&X<=O.to)return{range:v};let Y=n.changes({from:X,to:P,insert:e.insert}),G=v.to-s.to;return{changes:Y,range:h?H.range(Math.max(0,h.anchor+G),Math.max(0,h.head+G)):v.map(Y)}})}else r={changes:l,selection:h&&n.selection.replaceRange(h)}}let a="input.type";return(i.composing||i.inputState.compositionPendingChange&&i.inputState.compositionEndedAt>Date.now()-50)&&(i.inputState.compositionPendingChange=!1,a+=".compose",i.inputState.compositionFirstChange&&(a+=".start",i.inputState.compositionFirstChange=!1)),n.update(r,{userEvent:a,scrollIntoView:!0})}function eS(i,e,t,r){let n=Math.min(i.length,e.length),s=0;for(;s<n&&i.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==n&&i.length==e.length)return null;let o=i.length,a=e.length;for(;o>0&&a>0&&i.charCodeAt(o-1)==e.charCodeAt(a-1);)o--,a--;if(r=="end"){let l=Math.max(0,s-Math.min(o,a));t-=o+l-s}if(o<s&&i.length<e.length){let l=t<=s&&t>=o?s-t:0;s-=l,a=s+(a-o),o=s}else if(a<s){let l=t<=s&&t>=a?s-t:0;s-=l,o=s+(o-a),a=s}return{from:s,toA:o,toB:a}}function N$(i){let e=[];if(i.root.activeElement!=i.contentDOM)return e;let{anchorNode:t,anchorOffset:r,focusNode:n,focusOffset:s}=i.observer.selectionRange;return t&&(e.push(new bh(t,r)),(n!=t||s!=r)&&e.push(new bh(n,s))),e}function B$(i,e){if(i.length==0)return null;let t=i[0].pos,r=i.length==2?i[1].pos:t;return t>-1&&r>-1?H.single(t+e,r+e):null}function Sh(i,e){return e.head==i.main.head&&e.anchor==i.main.anchor}var zO=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Qe.safari&&e.contentDOM.addEventListener("input",()=>null),Qe.gecko&&lP(e.contentDOM.ownerDocument)}handleEvent(e){!tP(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let r=this.handlers[e];if(r){for(let n of r.observers)n(this.view,t);for(let n of r.handlers){if(t.defaultPrevented)break;if(n(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=G$(e),r=this.handlers,n=this.view.contentDOM;for(let s in t)if(s!="scroll"){let o=!t[s]. Line truncated
`))};if((Qe.mac||Qe.android)&&O.from==o-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(O={from:a,to:l,insert:tt.of([r.text.replace("."," ")])}),this.pendingContextChange=O,!e.state.readOnly){let m=this.to-this.from+(O.to-O.from+O.insert.length);bd(e,O,H.single(this.toEditorPos(r.selectionStart,m),this.toEditorPos(r.selectionEnd,m)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),O.from<O.to&&!O.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(t.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let n=[],s=null;for(let o=this.toEditorPos(r.rangeStart),a=this.toEditorPos(r.rangeEnd);o<a;o++){let l=e.coordsForChar(o);s=l&&new DOMRect(l.left,l.top,l.right-l.left,l.bottom-l.top)||s||new DOMRect,n.push(s)}t.updateCharacterBounds(r.rangeStart,n)},this.handlers.textformatupdate=r=>{let n=[];for(let s of r.getTextFormats()){let o=s.underlineStyle,a=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(a)){let l=this.toEditorPos(s.rangeStart),h=this.toEditorPos(s.rangeEnd);if(l<h){let f=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(a)?1:2}px`;n.push(de.mark({attributes:{style:f}}).range(l,h))}}}e.dispatch({effects:qb.of(de.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)t.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let n=Ha(r.root);n&&n.rangeCount&&this.editContext.updateSelectionBounds(n.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,r=!1,n=this.pendingContextChange;return e.changes.iterChanges((s,o,a,l,h)=>{if(r)return;let f=h.length-(o-s);if(n&&o>=n.to)if(n.from==s&&n.to==o&&n.insert.eq(h)){n=this.pendingContextChange=null,t+=f,this.to+=f;return}else n=null,this.revertPending(e.state);if(s+=t,o+=t,o<=this.from)this.from+=f,this.to+=f;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+h.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),h.toString()),this.to+=f}t+=f}),n&&!r&&this.revertPending(e.state),!r}update(e){let t=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(n=>!n.isUserEvent("input.type")&&n.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),n=this.toContextPos(t.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=n)&&this.editContext.updateSelection(r,n)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},ne=class i{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&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.mea Line truncated
-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,id),YP={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},fO=null;function EP(){var i;if(fO==null&&typeof document!="undefined"&&document.body){let e=document.body.style;fO=((i=e.tabSize)!==null&&i!==void 0?i:e.MozTabSize)!=null}return fO||!1}var ch=me.define({combine(i){let e=Hi(i,{render:null,specialChars:AP,addSpecialChars:null});return(e.replaceTabs=!EP())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,id)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,id)),e}});function QS(i={}){return[ch.of(i),ZP()]}var pb=null;function ZP(){return pb||(pb=Rt.fromClass(class{constructor(i){this.view=i,this.decorations=de.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(i.state.facet(ch)),this.decorations=this.decorator.createDeco(i)}makeDecorator(i){return new td({regexp:i.specialChars,decoration:(e,t,r)=>{let{doc:n}=t.state,s=zr(e[0],0);if(s==9){let o=n.lineAt(r),a=t.state.tabSize,l=xi(o.text,a,r-o.from);return de.replace({widget:new nd((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=de.replace({widget:new rd(i,s)}))},boundary:i.replaceTabs?void 0:/[^]/})}update(i){let e=i.state.facet(ch);i.startState.facet(ch)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(i.view)):this.decorations=this.decorator.updateDeco(i,this.decorations)}},{decorations:i=>i.decorations}))}var UP="\u2022";function zP(i){return i>=32?UP:i==10?"\u2424":String.fromCharCode(9216+i)}var rd=class extends Ft{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=zP(this.code),r=e.state.phrase("Control character")+" "+(YP[this.code]||"0x"+this.code.toString(16)),n=this.options.render&&this.options.render(this.code,r,t);if(n)return n;let s=document.createElement("span");return s.textContent=t,s.title=r,s.setAttribute("aria-label",r),s.className="cm-specialChar",s}ignoreEvent(){return!1}},nd=class extends Ft{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}};function Qd(){return MP}var LP=de.line({class:"cm-activeLine"}),MP=Rt.fromClass(class{constructor(i){this.decorations=this.getDeco(i)}update(i){(i.docChanged||i.selectionSet)&&(this.decorations=this.getDeco(i.view))}getDeco(i){let e=-1,t=[];for(let r of i.state.selection.ranges){let n=i.lineBlockAt(r.head);n.from>e&&(t.push(LP.range(n.from)),e=n.from)}return de.set(t)}},{decorations:i=>i.decorations});var sd=2e3;function VP(i,e,t){let r=Math.min(e.line,t.line),n=Math.max(e.line,t.line),s=[];if(e.off>sd||t.off>sd||e.col<0||t.col<0){let o=Math.min(e.off,t.off),a=Math.max(e.off,t.off);for(let l=r;l<=n;l++){let h=i.doc.line(l);h.length<=a&&s.push(H.range(h.from+o,h.to+a))}}else{let o=Math.min(e.col,t.col),a=Math.max(e.col,t.col);for(let l=r;l<=n;l++){let h=i.doc.line(l),f=Gc(h.text,o,i.tabSize,!0);if(f<0)s.push(H.cursor(h.to));else{let O=Gc(h.text,a,i.tabSize);s.push(H.range(h.from+f,h.from+O))}}}return s}function DP(i,e){let t=i.coordsAtPos(i.viewport.from);return t?Math.round(Math.abs((t.left-e)/i.defaultCharacterWidth)):-1}function mb(i,e){let t=i.posAtCoords({x:e.clientX,y:e.clientY},!1),r=i.state.doc.lineAt(t),n=t-r.from,s=n>sd?-1:n==r.length?DP(i,e.clientX):xi(r.text,i.state.tabSize,t-r.from);return{line:r.number,col:s,off:n}}function WP(i,e){let t=mb(i,e),r=i.state.selection;return t?{update(n){if(n.docChanged){let s=n.changes.mapPos(n.startState.doc.line(t.line).from),o=n.state.doc.lineAt(s);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},r=r.map(n.changes)}},get(n,s,o){let a=mb(i,n);if(!a)return r;let l=VP(i.state,t,a);return l.length?o?H.create(l.concat(r.ranges)):H.create(l):r}}:null}function vd(i){let e=(i==null?void 0:i.eventFilter)||(t=>t.altKey&&t.button==0);return ne.mouseSelectionStyle.of((t,r)=>e(r)?WP(t,r):null)}var qP={Alt:[18,i=>!!i.altKey],Control:[17,i=>!!i.ctrlKey],Shift:[16,i=>!!i.shiftKey],Meta:[91,i=>!!i.metaKey]},jP={style:"cursor: crosshair"};function yd(i={}){let[e,t]=qP[i.key||"Alt"],r=Rt.fromClass(class{constructor(n){this.view=n,this.isDown=!1}set(n){this.isDown!=n&&(this.isDown=n,this.view.update([]))}},{eventObservers:{keydown(n){this.set(n.keyCode==e||t(n))},keyup(n){(n.keyCode==e||!t(n))&&this.set(!1)},mousemove(n){this.set(t(n))}}} Line truncated
`&&(t="");else{let r=t.indexOf(`
`);r>-1&&(t=t.slice(0,r))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),r=e+t.length;for(let n=this.rangeIndex;;){let s=this.ranges[n].to;if(s>=r||(t=t.slice(0,s-(r-t.length)),n++,n==this.ranges.length))break;let o=this.ranges[n].from,a=this.lineAfter(o);t+=a,r=o+a.length}return{line:t,end:r}}skipGapsTo(e,t,r){for(;;){let n=this.ranges[this.rangeIndex].to,s=e+t;if(r>0?n>s:n>=s)break;let o=this.ranges[++this.rangeIndex].from;t+=o-n}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,r,n){let s=4;if(this.ranges.length>1){n=this.skipGapsTo(t,n,1),t+=n;let a=this.chunk.length;n=this.skipGapsTo(r,n,-1),r+=n,s+=this.chunk.length-a}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==t?this.chunk[o+2]=r:this.chunk.push(e,t,r,s),n}parseLine(e){let{line:t,end:r}=this.nextLine(),n=0,{streamParser:s}=this.lang,o=new Wh(t,e?e.state.tabSize:4,e?us(e.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let a=uQ(s.token,o,this.state);if(a&&(n=this.emitToken(this.lang.tokenTable.resolve(a),this.parsedPos+o.start,this.parsedPos+o.pos,n)),o.start>1e4)break}this.parsedPos=r,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=Ne.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:Gk,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new Ne(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new Ne(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}};function uQ(i,e,t){e.start=e.pos;for(let r=0;r<10;r++){let n=i(e,t);if(e.pos>e.start)return n}throw new Error("Stream parser failed to advance stream.")}var sp=Object.create(null),cl=[Ct.none],Gk=new Cn(cl),FS=[],HS=Object.create(null),OQ=Object.create(null);for(let[i,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])OQ[i]=dQ(sp,e);var qh=class{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),OQ)}resolve(e){return e?this.table[e]||(this.table[e]=dQ(this.extra,e)):0}},Fk=new qh(sp);function qd(i,e){FS.indexOf(i)>-1||(FS.push(i),console.warn(e))}function dQ(i,e){let t=[];for(let a of e.split(" ")){let l=[];for(let h of a.split(".")){let f=i[h]||x[h];f?typeof f=="function"?l.length?l=l.map(f):qd(h,`Modifier ${h} used at start of tag`):l.length?qd(h,`Tag ${h} used as modifier`):l=Array.isArray(f)?f:[f]:qd(h,`Unknown highlighting tag ${h}`)}for(let h of l)t.push(h)}if(!t.length)return 0;let r=e.replace(/ /g,"_"),n=r+" "+t.map(a=>a.id),s=HS[n];if(s)return s.id;let o=HS[n]=Ct.define({id:cl.length,name:r,props:[ii({[r]:t})]});return cl.push(o),o.id}function Hk(i,e){let t=Ct.define({id:cl.length,name:"Document",props:[En.add(()=>i),qi.add(()=>r=>e.getIndent(r))],top:!0});return cl.push(t),t}var RZ={rtl:de.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:St.RTL}),ltr:de.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:St.LTR}),auto:de.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})};var Gh=class{constructor(e,t,r,n){this.state=e,this.pos=t,this.explicit=r,this.view=n,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=rt(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),r=Math.max(t.from,this.pos-250),n=t.text.slice(r-t.from,this.pos-t.from),s=n.search(Jk(e,!1));return s<0?null:{from:r+s,to:this.pos,text:n.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),r&&r.onDocChange&&(this.abortOnDocChange=!0))}};function pQ(i){let e=Object.keys(i).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function Kk(i){let e=Object.create(null),t=Object.create(null);for(let{label:n}of i){e[n[0]]=!0;for(let s=1;s<n.length;s++)t[n[s]]=!0}let r=pQ(e)+pQ(t)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function SQ(i){let e=i.map(n=>typeof n=="string"?{label:n}:n),[t,r]=e.every(n=>/^\w+$/.test(n.label))?[/\w*$/,/\w+$/]:Kk(e);return n=>{let s=n.matchBefore(r);return s||n.explicit?{from:s?s.from:n.pos,options:e,validFor:t}:null}}function QQ(i,e){return t=>{for(let r=rt(t.state).reso Line truncated
`+t.scrub(),s=this.advance(n);return s>-1&&s<n.length?this.complete(e,r,s):!1}finish(e,t){return(this.stage==2||this.stage==3)&&bl(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,r){return e.addLeafElement(t,lt(fe.LinkReference,this.start,this.start+r,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(ex(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(lt(fe.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(Kv(e,bl(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=bl(e,this.pos),r=0;if(t>this.pos){let n=Jv(e,t,this.start);if(n){let s=_p(e,n.to-this.start);s>0&&(this.nextStage(n),r=s)}}return r||(r=_p(e,this.pos)),r>0&&r<e.length?r:-1}else return _p(e,this.pos)}}};function _p(i,e){for(;e<i.length;e++){let t=i.charCodeAt(e);if(t==10)break;if(!vr(t))return-1}return e}var Up=class{nextLine(e,t,r){let n=t.depth<e.stack.length?-1:Wv(t),s=t.next;if(n<0)return!1;let o=lt(fe.HeaderMark,e.lineStart+t.pos,e.lineStart+n);return e.nextLine(),e.addLeafElement(r,lt(s==61?fe.SetextHeading1:fe.SetextHeading2,r.start,e.prevLineEnd(),[...e.parser.parseInline(r.content,r.start),o])),!0}finish(){return!1}},Nv={LinkReference(i,e){return e.content.charCodeAt(0)==91?new Zp(e):null},SetextHeading(){return new Up}},e_=[(i,e)=>Dv(e)>=0,(i,e)=>Lv(e)>=0,(i,e)=>Mv(e)>=0,(i,e)=>qp(e,i,!0)>=0,(i,e)=>jp(e,i,!0)>=0,(i,e)=>Wp(e,i,!0)>=0,(i,e)=>Iv(e,i,!0)>=0],t_={text:"",end:0},zp=class{constructor(e,t,r,n){this.parser=e,this.input=t,this.ranges=n,this.line=new Ap,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=n[n.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=n[0].from,this.block=cf.create(fe.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=r.length?new Vp(r,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let r=0;;){let n=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;r<e.markers.length&&(!n||e.markers[r].from<n.end);){let s=e.markers[r++];this.addNode(s.type,s.from,s.to)}if(!n)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let r of this.parser.blockParsers)if(r){let n=r(this,e);if(n!=!1){if(n==!0)return null;e.forward();continue e}}break}let t=new Cp(this.lineStart+e.pos,e.text.slice(e.pos));for(let r of this.parser.leafBlockParsers)if(r){let n=r(this,t);n&&t.parsers.push(n)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let r of this.parser.endLeafBlock)if(r(this,e,t))break e}for(let r of t.parsers)if(r.nextLine(this,e,t))return null;t.content+=`
`+e.scrub();for(let r of e.markers)t.marks.push(r)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=tx(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=t_;if(t.end=e,e>=this.to)t.text="";else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let r=this.absoluteLineStart,n=this.rangeI;for(;this.ranges[n].to<t.end;){n++;let s=this.ranges[n].from,o=this.lineChunkAt(s);t.end=s+o.length,t.text=t.text.slice(0,this.ranges[n-1].to-r)+o,r=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:r}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=r,e.reset(t);e.depth<this.stack.length;e.depth++){let n=this.stack[e.depth],s=this.parser.skipContextMarkup[n.type];if(!s)throw new Error("Unhandled block context "+fe[n.type]);let o=this.line.markers.length;if(!s(n,this,e)){this.line.markers.length>o&&(n.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),r;if(this.input.lineChunks)r=t==`
`);r>-1&&(t=t.slice(0,r))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),r=e+t.length;for(let n=this.rangeIndex;;){let s=this.ranges[n].to;if(s>=r||(t=t.slice(0,s-(r-t.length)),n++,n==this.ranges.length))break;let o=this.ranges[n].from,a=this.lineAfter(o);t+=a,r=o+a.length}return{line:t,end:r}}skipGapsTo(e,t,r){for(;;){let n=this.ranges[this.rangeIndex].to,s=e+t;if(r>0?n>s:n>=s)break;let o=this.ranges[++this.rangeIndex].from;t+=o-n}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,r,n){let s=4;if(this.ranges.length>1){n=this.skipGapsTo(t,n,1),t+=n;let a=this.chunk.length;n=this.skipGapsTo(r,n,-1),r+=n,s+=this.chunk.length-a}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==t?this.chunk[o+2]=r:this.chunk.push(e,t,r,s),n}parseLine(e){let{line:t,end:r}=this.nextLine(),n=0,{streamParser:s}=this.lang,o=new Wh(t,e?e.state.tabSize:4,e?us(e.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let a=uQ(s.token,o,this.state);if(a&&(n=this.emitToken(this.lang.tokenTable.resolve(a),this.parsedPos+o.start,this.parsedPos+o.pos,n)),o.start>1e4)break}this.parsedPos=r,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=Ne.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:Gk,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new Ne(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new Ne(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}};function uQ(i,e,t){e.start=e.pos;for(let r=0;r<10;r++){let n=i(e,t);if(e.pos>e.start)return n}throw new Error("Stream parser failed to advance stream.")}var sp=Object.create(null),cl=[Ct.none],Gk=new Cn(cl),FS=[],HS=Object.create(null),OQ=Object.create(null);for(let[i,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])OQ[i]=dQ(sp,e);var qh=class{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),OQ)}resolve(e){return e?this.table[e]||(this.table[e]=dQ(this.extra,e)):0}},Fk=new qh(sp);function qd(i,e){FS.indexOf(i)>-1||(FS.push(i),console.warn(e))}function dQ(i,e){let t=[];for(let a of e.split(" ")){let l=[];for(let h of a.split(".")){let f=i[h]||y[h];f?typeof f=="function"?l.length?l=l.map(f):qd(h,`Modifier ${h} used at start of tag`):l.length?qd(h,`Tag ${h} used as modifier`):l=Array.isArray(f)?f:[f]:qd(h,`Unknown highlighting tag ${h}`)}for(let h of l)t.push(h)}if(!t.length)return 0;let r=e.replace(/ /g,"_"),n=r+" "+t.map(a=>a.id),s=HS[n];if(s)return s.id;let o=HS[n]=Ct.define({id:cl.length,name:r,props:[ii({[r]:t})]});return cl.push(o),o.id}function Hk(i,e){let t=Ct.define({id:cl.length,name:"Document",props:[En.add(()=>i),qi.add(()=>r=>e.getIndent(r))],top:!0});return cl.push(t),t}var RZ={rtl:de.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:St.RTL}),ltr:de.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:St.LTR}),auto:de.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})};var Gh=class{constructor(e,t,r,n){this.state=e,this.pos=t,this.explicit=r,this.view=n,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=rt(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),r=Math.max(t.from,this.pos-250),n=t.text.slice(r-t.from,this.pos-t.from),s=n.search(Jk(e,!1));return s<0?null:{from:r+s,to:this.pos,text:n.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),r&&r.onDocChange&&(this.abortOnDocChange=!0))}};function pQ(i){let e=Object.keys(i).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function Kk(i){let e=Object.create(null),t=Object.create(null);for(let{label:n}of i){e[n[0]]=!0;for(let s=1;s<n.length;s++)t[n[s]]=!0}let r=pQ(e)+pQ(t)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function SQ(i){let e=i.map(n=>typeof n=="string"?{label:n}:n),[t,r]=e.every(n=>/^\w+$/.test(n.label))?[/\w*$/,/\w+$/]:Kk(e);return n=>{let s=n.matchBefore(r);return s||n.explicit?{from:s?s.from:n.pos,options:e,validFor:t}:null}}function QQ(i,e){return t=>{for(let r=rt(t.state).reso Line truncated
`+t.scrub(),s=this.advance(n);return s>-1&&s<n.length?this.complete(e,r,s):!1}finish(e,t){return(this.stage==2||this.stage==3)&&bl(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,r){return e.addLeafElement(t,lt(fe.LinkReference,this.start,this.start+r,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(ey(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(lt(fe.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(Kv(e,bl(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=bl(e,this.pos),r=0;if(t>this.pos){let n=Jv(e,t,this.start);if(n){let s=_p(e,n.to-this.start);s>0&&(this.nextStage(n),r=s)}}return r||(r=_p(e,this.pos)),r>0&&r<e.length?r:-1}else return _p(e,this.pos)}}};function _p(i,e){for(;e<i.length;e++){let t=i.charCodeAt(e);if(t==10)break;if(!vr(t))return-1}return e}var Up=class{nextLine(e,t,r){let n=t.depth<e.stack.length?-1:Wv(t),s=t.next;if(n<0)return!1;let o=lt(fe.HeaderMark,e.lineStart+t.pos,e.lineStart+n);return e.nextLine(),e.addLeafElement(r,lt(s==61?fe.SetextHeading1:fe.SetextHeading2,r.start,e.prevLineEnd(),[...e.parser.parseInline(r.content,r.start),o])),!0}finish(){return!1}},Nv={LinkReference(i,e){return e.content.charCodeAt(0)==91?new Zp(e):null},SetextHeading(){return new Up}},e_=[(i,e)=>Dv(e)>=0,(i,e)=>Lv(e)>=0,(i,e)=>Mv(e)>=0,(i,e)=>qp(e,i,!0)>=0,(i,e)=>jp(e,i,!0)>=0,(i,e)=>Wp(e,i,!0)>=0,(i,e)=>Iv(e,i,!0)>=0],t_={text:"",end:0},zp=class{constructor(e,t,r,n){this.parser=e,this.input=t,this.ranges=n,this.line=new Ap,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=n[n.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=n[0].from,this.block=cf.create(fe.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=r.length?new Vp(r,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let r=0;;){let n=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;r<e.markers.length&&(!n||e.markers[r].from<n.end);){let s=e.markers[r++];this.addNode(s.type,s.from,s.to)}if(!n)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let r of this.parser.blockParsers)if(r){let n=r(this,e);if(n!=!1){if(n==!0)return null;e.forward();continue e}}break}let t=new Cp(this.lineStart+e.pos,e.text.slice(e.pos));for(let r of this.parser.leafBlockParsers)if(r){let n=r(this,t);n&&t.parsers.push(n)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let r of this.parser.endLeafBlock)if(r(this,e,t))break e}for(let r of t.parsers)if(r.nextLine(this,e,t))return null;t.content+=`
`+e.scrub();for(let r of e.markers)t.marks.push(r)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=ty(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=t_;if(t.end=e,e>=this.to)t.text="";else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let r=this.absoluteLineStart,n=this.rangeI;for(;this.ranges[n].to<t.end;){n++;let s=this.ranges[n].from,o=this.lineChunkAt(s);t.end=s+o.length,t.text=t.text.slice(0,this.ranges[n-1].to-r)+o,r=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:r}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=r,e.reset(t);e.depth<this.stack.length;e.depth++){let n=this.stack[e.depth],s=this.parser.skipContextMarkup[n.type];if(!s)throw new Error("Unhandled block context "+fe[n.type]);let o=this.line.markers.length;if(!s(n,this,e)){this.line.markers.length>o&&(n.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),r;if(this.input.lineChunks)r=t==`
`?"":t;else{let n=t.indexOf(`
`);r=n<0?t:t.slice(0,n)}return e+r.length>this.to?r.slice(0,this.to-e):r}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,r=0){this.block=cf.create(e,r,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,r=0){this.startContext(this.parser.getNodeType(e),t,r)}addNode(e,t,r){typeof e=="number"&&(e=new Ne(this.parser.nodeSet.types[e],na,na,(r!=null?r:this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(Mp(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?Bv(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let r of e.parsers)if(r.finish(this,e))return;let t=Mp(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(fe.Paragraph,e.content.length),e.start)}elt(e,t,r,n){return typeof e=="string"?lt(this.parser.getNodeType(e),t,r,n):new ff(e,t)}get buffer(){return new hf(this.parser.nodeSet)}};function Bv(i,e,t,r,n){let s=i[e].to,o=[],a=[],l=t.from+r;function h(f,O){for(;O?f>=s:f>s;){let m=i[e+1].from-s;r+=m,f+=m,e++,s=i[e].to}}for(let f=t.firstChild;f;f=f.nextSibling){h(f.from+r,!0);let O=f.from+r,m,b=n.get(f.tree);b?m=b:f.to+r>s?(m=Bv(i,e,f,r,n),h(f.to+r,!1)):m=f.toTree(),o.push(m),a.push(O-l)}return h(t.to+r,!1),new Ne(t.type,o,a,t.to+r-l,t.tree?t.tree.propValues:void 0)}var Ql=class i extends Yn{constructor(e,t,r,n,s,o,a,l,h){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=r,this.blockNames=n,this.endLeafBlock=s,this.skipContextMarkup=o,this.inlineParsers=a,this.inlineNames=l,this.wrappers=h,this.nodeTypes=Object.create(null);for(let f of e.types)this.nodeTypes[f.name]=f.id}createParse(e,t,r){let n=new zp(this,e,t,r);for(let s of this.wrappers)n=s(n,e,t,r);return n}configure(e){let t=Lp(e);if(!t)return this;let{nodeSet:r,skipContextMarkup:n}=this,s=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),a=this.blockNames.slice(),l=this.inlineParsers.slice(),h=this.inlineNames.slice(),f=this.endLeafBlock.slice(),O=this.wrappers;if(gl(t.defineNodes)){n=Object.assign({},n);let m=r.types.slice(),b;for(let v of t.defineNodes){let{name:P,block:T,composite:Y,style:B}=typeof v=="string"?{name:v}:v;if(m.some(M=>M.name==P))continue;Y&&(n[m.length]=(M,d,j)=>Y(d,j,M.value));let q=m.length,N=Y?["Block","BlockContext"]:T?q>=fe.ATXHeading1&&q<=fe.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;m.push(Ct.define({id:q,name:P,props:N&&[[Ae.group,N]]})),B&&(b||(b={}),Array.isArray(B)||B instanceof er?b[P]=B:Object.assign(b,B))}r=new Cn(m),b&&(r=r.extend(ii(b)))}if(gl(t.props)&&(r=r.extend(...t.props)),gl(t.remove))for(let m of t.remove){let b=this.blockNames.indexOf(m),v=this.inlineNames.indexOf(m);b>-1&&(s[b]=o[b]=void 0),v>-1&&(l[v]=void 0)}if(gl(t.parseBlock))for(let m of t.parseBlock){let b=a.indexOf(m.name);if(b>-1)s[b]=m.parse,o[b]=m.leaf;else{let v=m.before?lf(a,m.before):m.after?lf(a,m.after)+1:a.length-1;s.splice(v,0,m.parse),o.splice(v,0,m.leaf),a.splice(v,0,m.name)}m.endLeaf&&f.push(m.endLeaf)}if(gl(t.parseInline))for(let m of t.parseInline){let b=h.indexOf(m.name);if(b>-1)l[b]=m.parse;else{let v=m.before?lf(h,m.before):m.after?lf(h,m.after)+1:h.length-1;l.splice(v,0,m.parse),h.splice(v,0,m.name)}}return t.wrap&&(O=O.concat(t.wrap)),new i(r,s,o,a,f,n,l,h,O)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw new RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let r=new xl(this,e,t);e:for(let n=t;n<r.end;){let s=r.char(n);for(let o of this.inlineParsers)if(o){let a=o(r,s,n);if(a>=0){n=a;continue e}}n++}return r.resolveMarkers(0)}};function gl(i){return i!=null&&i.length>0}function Lp(i){if(!Array.isArray(i))return i;if(i.length==0)return null;let e=Lp(i[0]);if(i.length==1)return e;let t=Lp(i.slice(1));if(!t||!e)return e||t;let r=(o,a)=>(o||na).concat(a||na),n=e.wrap,s=t.wrap;return{props:r(e.props,t.props),defineNodes:r(e.defineNodes,t.defineNodes),parseBlock:r(e.parseBlock,t.parseBlock),parseInline:r(e.parseInline,t.parseInline),remove:r(e.remove,t.remove),wrap:n?s?(o,a,l,h)=>n(s(o,a,l,h),a,l,h):n:s}}function lf(i,e){let t=i.indexOf(e);if(t<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return t}var Gv=[Ct.none];for(let i=1,e;e=fe[i];i++)Gv[i]=Ct.define({id:i,name:e,props:i>=fe.Escape?[]:[[Ae.group,i in zv?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});var na=[],hf=class{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e Line truncated
`;)s--;this.fragmentEnd=s?s-1:0}let r=this.cursor;r||(r=this.cursor=this.fragment.tree.cursor(),r.firstChild());let n=e+this.fragment.offset;for(;r.to<=n;)if(!r.parent())return!1;for(;;){if(r.from>=n)return this.fragment.from<=t;if(!r.childAfter(n))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(Ae.contextHash)==e}takeNodes(e){let t=this.cursor,r=this.fragment.offset,n=this.fragmentEnd-(this.fragment.openEnd?1:0),s=e.absoluteLineStart,o=s,a=e.block.children.length,l=o,h=a;for(;;){if(t.to-r>n){if(t.type.isAnonymous&&t.firstChild())continue;break}let f=tx(t.from-r,e.ranges);if(t.to-r<=e.ranges[e.rangeI].to)e.addNode(t.tree,f);else{let O=new Ne(e.parser.nodeSet.types[fe.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(O,t.tree),e.addNode(O,f)}if(t.type.is("Block")&&(r_.indexOf(t.type.id)<0?(o=t.to-r,a=e.block.children.length):(o=l,a=h),l=t.to-r,h=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>a;)e.block.children.pop(),e.block.positions.pop();return o-s}};function tx(i,e){let t=i;for(let r=1;r<e.length;r++){let n=e[r-1].to,s=e[r].from;n<i&&(t-=s-n)}return t}var n_=ii({"Blockquote/...":x.quote,HorizontalRule:x.contentSeparator,"ATXHeading1/... SetextHeading1/...":x.heading1,"ATXHeading2/... SetextHeading2/...":x.heading2,"ATXHeading3/...":x.heading3,"ATXHeading4/...":x.heading4,"ATXHeading5/...":x.heading5,"ATXHeading6/...":x.heading6,"Comment CommentBlock":x.comment,Escape:x.escape,Entity:x.character,"Emphasis/...":x.emphasis,"StrongEmphasis/...":x.strong,"Link/... Image/...":x.link,"OrderedList/... BulletList/...":x.list,"BlockQuote/...":x.quote,"InlineCode CodeText":x.monospace,"URL Autolink":x.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":x.processingInstruction,"CodeInfo LinkLabel":x.labelName,LinkTitle:x.string,Paragraph:x.content}),ix=new Ql(new Cn(Gv).extend(n_),Object.keys(af).map(i=>af[i]),Object.keys(af).map(i=>Nv[i]),Object.keys(af),e_,zv,Object.keys(Rp).map(i=>Rp[i]),Object.keys(Rp),[]);function s_(i,e,t){let r=[];for(let n=i.firstChild,s=e;;n=n.nextSibling){let o=n?n.from:t;if(o>s&&r.push({from:s,to:o}),!n)break;s=n.to}return r}function rx(i){let{codeParser:e,htmlParser:t}=i;return{wrap:Uh((n,s)=>{let o=n.type.id;if(e&&(o==fe.CodeBlock||o==fe.FencedCode)){let a="";if(o==fe.FencedCode){let h=n.node.getChild(fe.CodeInfo);h&&(a=s.read(h.from,h.to))}let l=e(a);if(l)return{parser:l,overlay:h=>h.type.id==fe.CodeText,bracketed:o==fe.FencedCode}}else if(t&&(o==fe.HTMLBlock||o==fe.HTMLTag||o==fe.CommentBlock))return{parser:t,overlay:s_(n.node,n.from,n.to)};return null})}}var o_={resolve:"Strikethrough",mark:"StrikethroughMark"},a_={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":x.strikethrough}},{name:"StrikethroughMark",style:x.processingInstruction}],parseInline:[{name:"Strikethrough",parse(i,e,t){if(e!=126||i.char(t+1)!=126||i.char(t+2)==126)return-1;let r=i.slice(t-1,t),n=i.slice(t+2,t+3),s=/\s|^$/.test(r),o=/\s|^$/.test(n),a=vl.test(r),l=vl.test(n);return i.addDelimiter(o_,t,t+2,!o&&(!l||s||a),!s&&(!a||o||l))},after:"Emphasis"}]};function Sl(i,e,t=0,r,n=0){let s=0,o=!0,a=-1,l=-1,h=!1,f=()=>{r.push(i.elt("TableCell",n+a,n+l,i.parser.parseInline(e.slice(a,l),n+a)))};for(let O=t;O<e.length;O++){let m=e.charCodeAt(O);m==124&&!h?((!o||a>-1)&&s++,o=!1,r&&(a>-1&&f(),r.push(i.elt("TableDelimiter",O+n,O+n+1))),a=l=-1):(h||m!=32&&m!=9)&&(a<0&&(a=O),l=O+1),h=!h&&m==92}return a>-1&&(s++,r&&f()),s}function Rv(i,e){for(let t=e;t<i.length;t++){let r=i.charCodeAt(t);if(r==124)return!0;r==92&&t++}return!1}var nx=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,Of=class{constructor(){this.rows=null}nextLine(e,t,r){if(this.rows==null){this.rows=!1;let n;if((t.next==45||t.next==58||t.next==124)&&nx.test(n=t.text.slice(t.pos))){let s=[];Sl(e,r.content,0,s,r.start)==Sl(e,n,t.pos)&&(this.rows=[e.elt("TableHeader",r.start,r.start+r.content.length,s),e.elt("TableDelimiter",e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let n=[];Sl(e,t.text,t.pos,n,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+t.pos,e.lineStart+t.text.length,n))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt("Table",t.start,t.start+t.content.length,this.rows)),!0):!1}},l_={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":x.heading}},"TableRow",{name:"TableCell",style:x.content},{name:"TableDelimiter",style:x.processingInstruction}],parseBlock:[{name:"Table",leaf(i,e){return Rv(e.content,0)?new Of:null},endLeaf(i,e,t){if(t.parsers.some(n=>n instanceof Of)||!Rv(e.text,e.basePos))return!1;let r=i.peekLine();return nx.test(r)&&Sl(i,e.text,e.basePos)==Sl(i,r,e.basePos)},before:"SetextHeading"}]},Dp=class{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt("Task",t.start,t.start+t.content.length,[e.elt("TaskMarker",t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}},c_={defineNodes:[{name:"Task",block:!0,style:x.list},{name:"TaskMarker",style:x.atom}],pars Line truncated
`);r=n<0?t:t.slice(0,n)}return e+r.length>this.to?r.slice(0,this.to-e):r}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,r=0){this.block=cf.create(e,r,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,r=0){this.startContext(this.parser.getNodeType(e),t,r)}addNode(e,t,r){typeof e=="number"&&(e=new Ne(this.parser.nodeSet.types[e],na,na,(r!=null?r:this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(Mp(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?Bv(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let r of e.parsers)if(r.finish(this,e))return;let t=Mp(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(fe.Paragraph,e.content.length),e.start)}elt(e,t,r,n){return typeof e=="string"?lt(this.parser.getNodeType(e),t,r,n):new ff(e,t)}get buffer(){return new hf(this.parser.nodeSet)}};function Bv(i,e,t,r,n){let s=i[e].to,o=[],a=[],l=t.from+r;function h(f,O){for(;O?f>=s:f>s;){let m=i[e+1].from-s;r+=m,f+=m,e++,s=i[e].to}}for(let f=t.firstChild;f;f=f.nextSibling){h(f.from+r,!0);let O=f.from+r,m,b=n.get(f.tree);b?m=b:f.to+r>s?(m=Bv(i,e,f,r,n),h(f.to+r,!1)):m=f.toTree(),o.push(m),a.push(O-l)}return h(t.to+r,!1),new Ne(t.type,o,a,t.to+r-l,t.tree?t.tree.propValues:void 0)}var Ql=class i extends Yn{constructor(e,t,r,n,s,o,a,l,h){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=r,this.blockNames=n,this.endLeafBlock=s,this.skipContextMarkup=o,this.inlineParsers=a,this.inlineNames=l,this.wrappers=h,this.nodeTypes=Object.create(null);for(let f of e.types)this.nodeTypes[f.name]=f.id}createParse(e,t,r){let n=new zp(this,e,t,r);for(let s of this.wrappers)n=s(n,e,t,r);return n}configure(e){let t=Lp(e);if(!t)return this;let{nodeSet:r,skipContextMarkup:n}=this,s=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),a=this.blockNames.slice(),l=this.inlineParsers.slice(),h=this.inlineNames.slice(),f=this.endLeafBlock.slice(),O=this.wrappers;if(gl(t.defineNodes)){n=Object.assign({},n);let m=r.types.slice(),b;for(let v of t.defineNodes){let{name:P,block:X,composite:Y,style:G}=typeof v=="string"?{name:v}:v;if(m.some(V=>V.name==P))continue;Y&&(n[m.length]=(V,d,j)=>Y(d,j,V.value));let q=m.length,N=Y?["Block","BlockContext"]:X?q>=fe.ATXHeading1&&q<=fe.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;m.push(Ct.define({id:q,name:P,props:N&&[[Ae.group,N]]})),G&&(b||(b={}),Array.isArray(G)||G instanceof er?b[P]=G:Object.assign(b,G))}r=new Cn(m),b&&(r=r.extend(ii(b)))}if(gl(t.props)&&(r=r.extend(...t.props)),gl(t.remove))for(let m of t.remove){let b=this.blockNames.indexOf(m),v=this.inlineNames.indexOf(m);b>-1&&(s[b]=o[b]=void 0),v>-1&&(l[v]=void 0)}if(gl(t.parseBlock))for(let m of t.parseBlock){let b=a.indexOf(m.name);if(b>-1)s[b]=m.parse,o[b]=m.leaf;else{let v=m.before?lf(a,m.before):m.after?lf(a,m.after)+1:a.length-1;s.splice(v,0,m.parse),o.splice(v,0,m.leaf),a.splice(v,0,m.name)}m.endLeaf&&f.push(m.endLeaf)}if(gl(t.parseInline))for(let m of t.parseInline){let b=h.indexOf(m.name);if(b>-1)l[b]=m.parse;else{let v=m.before?lf(h,m.before):m.after?lf(h,m.after)+1:h.length-1;l.splice(v,0,m.parse),h.splice(v,0,m.name)}}return t.wrap&&(O=O.concat(t.wrap)),new i(r,s,o,a,f,n,l,h,O)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw new RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let r=new yl(this,e,t);e:for(let n=t;n<r.end;){let s=r.char(n);for(let o of this.inlineParsers)if(o){let a=o(r,s,n);if(a>=0){n=a;continue e}}n++}return r.resolveMarkers(0)}};function gl(i){return i!=null&&i.length>0}function Lp(i){if(!Array.isArray(i))return i;if(i.length==0)return null;let e=Lp(i[0]);if(i.length==1)return e;let t=Lp(i.slice(1));if(!t||!e)return e||t;let r=(o,a)=>(o||na).concat(a||na),n=e.wrap,s=t.wrap;return{props:r(e.props,t.props),defineNodes:r(e.defineNodes,t.defineNodes),parseBlock:r(e.parseBlock,t.parseBlock),parseInline:r(e.parseInline,t.parseInline),remove:r(e.remove,t.remove),wrap:n?s?(o,a,l,h)=>n(s(o,a,l,h),a,l,h):n:s}}function lf(i,e){let t=i.indexOf(e);if(t<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return t}var Gv=[Ct.none];for(let i=1,e;e=fe[i];i++)Gv[i]=Ct.define({id:i,name:e,props:i>=fe.Escape?[]:[[Ae.group,i in zv?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});var na=[],hf=class{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e Line truncated
`;)s--;this.fragmentEnd=s?s-1:0}let r=this.cursor;r||(r=this.cursor=this.fragment.tree.cursor(),r.firstChild());let n=e+this.fragment.offset;for(;r.to<=n;)if(!r.parent())return!1;for(;;){if(r.from>=n)return this.fragment.from<=t;if(!r.childAfter(n))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(Ae.contextHash)==e}takeNodes(e){let t=this.cursor,r=this.fragment.offset,n=this.fragmentEnd-(this.fragment.openEnd?1:0),s=e.absoluteLineStart,o=s,a=e.block.children.length,l=o,h=a;for(;;){if(t.to-r>n){if(t.type.isAnonymous&&t.firstChild())continue;break}let f=ty(t.from-r,e.ranges);if(t.to-r<=e.ranges[e.rangeI].to)e.addNode(t.tree,f);else{let O=new Ne(e.parser.nodeSet.types[fe.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(O,t.tree),e.addNode(O,f)}if(t.type.is("Block")&&(r_.indexOf(t.type.id)<0?(o=t.to-r,a=e.block.children.length):(o=l,a=h),l=t.to-r,h=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>a;)e.block.children.pop(),e.block.positions.pop();return o-s}};function ty(i,e){let t=i;for(let r=1;r<e.length;r++){let n=e[r-1].to,s=e[r].from;n<i&&(t-=s-n)}return t}var n_=ii({"Blockquote/...":y.quote,HorizontalRule:y.contentSeparator,"ATXHeading1/... SetextHeading1/...":y.heading1,"ATXHeading2/... SetextHeading2/...":y.heading2,"ATXHeading3/...":y.heading3,"ATXHeading4/...":y.heading4,"ATXHeading5/...":y.heading5,"ATXHeading6/...":y.heading6,"Comment CommentBlock":y.comment,Escape:y.escape,Entity:y.character,"Emphasis/...":y.emphasis,"StrongEmphasis/...":y.strong,"Link/... Image/...":y.link,"OrderedList/... BulletList/...":y.list,"BlockQuote/...":y.quote,"InlineCode CodeText":y.monospace,"URL Autolink":y.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":y.processingInstruction,"CodeInfo LinkLabel":y.labelName,LinkTitle:y.string,Paragraph:y.content}),iy=new Ql(new Cn(Gv).extend(n_),Object.keys(af).map(i=>af[i]),Object.keys(af).map(i=>Nv[i]),Object.keys(af),e_,zv,Object.keys(Rp).map(i=>Rp[i]),Object.keys(Rp),[]);function s_(i,e,t){let r=[];for(let n=i.firstChild,s=e;;n=n.nextSibling){let o=n?n.from:t;if(o>s&&r.push({from:s,to:o}),!n)break;s=n.to}return r}function ry(i){let{codeParser:e,htmlParser:t}=i;return{wrap:Uh((n,s)=>{let o=n.type.id;if(e&&(o==fe.CodeBlock||o==fe.FencedCode)){let a="";if(o==fe.FencedCode){let h=n.node.getChild(fe.CodeInfo);h&&(a=s.read(h.from,h.to))}let l=e(a);if(l)return{parser:l,overlay:h=>h.type.id==fe.CodeText,bracketed:o==fe.FencedCode}}else if(t&&(o==fe.HTMLBlock||o==fe.HTMLTag||o==fe.CommentBlock))return{parser:t,overlay:s_(n.node,n.from,n.to)};return null})}}var o_={resolve:"Strikethrough",mark:"StrikethroughMark"},a_={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":y.strikethrough}},{name:"StrikethroughMark",style:y.processingInstruction}],parseInline:[{name:"Strikethrough",parse(i,e,t){if(e!=126||i.char(t+1)!=126||i.char(t+2)==126)return-1;let r=i.slice(t-1,t),n=i.slice(t+2,t+3),s=/\s|^$/.test(r),o=/\s|^$/.test(n),a=vl.test(r),l=vl.test(n);return i.addDelimiter(o_,t,t+2,!o&&(!l||s||a),!s&&(!a||o||l))},after:"Emphasis"}]};function Sl(i,e,t=0,r,n=0){let s=0,o=!0,a=-1,l=-1,h=!1,f=()=>{r.push(i.elt("TableCell",n+a,n+l,i.parser.parseInline(e.slice(a,l),n+a)))};for(let O=t;O<e.length;O++){let m=e.charCodeAt(O);m==124&&!h?((!o||a>-1)&&s++,o=!1,r&&(a>-1&&f(),r.push(i.elt("TableDelimiter",O+n,O+n+1))),a=l=-1):(h||m!=32&&m!=9)&&(a<0&&(a=O),l=O+1),h=!h&&m==92}return a>-1&&(s++,r&&f()),s}function Rv(i,e){for(let t=e;t<i.length;t++){let r=i.charCodeAt(t);if(r==124)return!0;r==92&&t++}return!1}var ny=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,Of=class{constructor(){this.rows=null}nextLine(e,t,r){if(this.rows==null){this.rows=!1;let n;if((t.next==45||t.next==58||t.next==124)&&ny.test(n=t.text.slice(t.pos))){let s=[];Sl(e,r.content,0,s,r.start)==Sl(e,n,t.pos)&&(this.rows=[e.elt("TableHeader",r.start,r.start+r.content.length,s),e.elt("TableDelimiter",e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let n=[];Sl(e,t.text,t.pos,n,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+t.pos,e.lineStart+t.text.length,n))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt("Table",t.start,t.start+t.content.length,this.rows)),!0):!1}},l_={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":y.heading}},"TableRow",{name:"TableCell",style:y.content},{name:"TableDelimiter",style:y.processingInstruction}],parseBlock:[{name:"Table",leaf(i,e){return Rv(e.content,0)?new Of:null},endLeaf(i,e,t){if(t.parsers.some(n=>n instanceof Of)||!Rv(e.text,e.basePos))return!1;let r=i.peekLine();return ny.test(r)&&Sl(i,e.text,e.basePos)==Sl(i,r,e.basePos)},before:"SetextHeading"}]},Dp=class{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt("Task",t.start,t.start+t.content.length,[e.elt("TaskMarker",t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}},c_={defineNodes:[{name:"Task",block:!0,style:y.list},{name:"TaskMarker",style:y.atom}],pars Line truncated
\${}
} catch (\${error}) {
\${}
@@ -43,11 +43,11 @@ PC `+this.addr2str(s)+" "+this.opToString(h,null,v),o[P]=1)}),this.addr2str(r)+n
constructor(\${params}) {
\${}
}
}`,{label:"class",detail:"definition",type:"keyword"}),$i('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),$i('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],oC=Ix.concat([$i("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),$i("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),$i("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Wx=new Fo,Nx=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function $l(i){return(e,t)=>{let r=e.node.getChild("VariableDefinition");return r&&t(r,i),!0}}var aC=["FunctionDeclaration"],lC={FunctionDeclaration:$l("function"),ClassDeclaration:$l("class"),ClassExpression:()=>!0,EnumDeclaration:$l("constant"),TypeAliasDeclaration:$l("type"),NamespaceDeclaration:$l("namespace"),VariableDefinition(i,e){i.matchContext(aC)||e(i,"variable")},TypeDefinition(i,e){e(i,"type")},__proto__:null};function Bx(i,e){let t=Wx.get(e);if(t)return t;let r=[],n=!0;function s(o,a){let l=i.sliceString(o.from,o.to);r.push({label:l,type:a})}return e.cursor(at.IncludeAnonymous).iterate(o=>{if(n)n=!1;else if(o.name){let a=lC[o.name];if(a&&a(o,s)||Nx.has(o.name))return!1}else if(o.to-o.from>8192){for(let a of Bx(i,o.node))r.push(a);return!1}}),Wx.set(e,r),r}var qx=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Gx=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function cC(i){let e=rt(i.state).resolveInner(i.pos,-1);if(Gx.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&qx.test(i.state.sliceDoc(e.from,e.to));if(!t&&!i.explicit)return null;let r=[];for(let n=e;n;n=n.parent)Nx.has(n.name)&&(r=r.concat(Bx(i.state.doc,n)));return{options:r,from:t?e.from:i.pos,validFor:qx}}var Nr=ri.define({name:"javascript",parser:Dx.configure({props:[qi.add({IfStatement:Sn({except:/^\s*({|else\b)/}),TryStatement:Sn({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Nh,SwitchBody:i=>{let e=i.textAfter,t=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return i.baseIndent+(t?0:r?1:2)*i.unit},Block:Jo({closing:"}"}),ArrowFunction:i=>i.baseIndent+i.unit,"TemplateString BlockComment":()=>null,"Statement Property":Sn({except:/^\s*{/}),JSXElement(i){let e=/^\s*<\//.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},JSXEscape(i){let e=/\s*\}/.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},"JSXOpenTag JSXSelfClosingTag"(i){return i.column(i.node.from)+i.unit}}),ji.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":ds,BlockComment(i){return{from:i.from+2,to:i.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),Fx={test:i=>/^JSX/.test(i.name),facet:Ho({commentTokens:{block:{open:"{/*",close:"*/}"}}})},om=Nr.configure({dialect:"ts"},"typescript"),am=Nr.configure({dialect:"jsx",props:[jh.add(i=>i.isTop?[Fx]:void 0)]}),lm=Nr.configure({dialect:"jsx ts",props:[jh.add(i=>i.isTop?[Fx]:void 0)]},"typescript"),Hx=i=>({label:i,type:"keyword"}),Kx="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(Hx),hC=Kx.concat(["declare","implements","private","protected","public"].map(Hx));function Jx(i={}){let e=i.jsx?i.typescript?lm:am:i.typescript?om:Nr,t=i.typescript?oC.concat(hC):Ix.concat(Kx);return new Qt(e,[Nr.data.of({autocomplete:QQ(Gx,SQ(t))}),Nr.data.of({autocomplete:cC}),i.jsx?OC:[]])}function fC(i){for(;;){if(i.name=="JSXOpenTag"||i.name=="JSXSelfClosingTag"||i.name=="JSXFragmentTag")return i;if(i.name=="JSXEscape"||!i.parent)return null;i=i.parent}}function jx(i,e,t=i.length){for(let r=e==null?void 0:e.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return i.sliceString(r.from,Math.min(r.to,t));return""}var uC=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),OC=ne.inputHandler.of((i,e,t,r,n)=>{if((uC?i.composing:i.compositionStarted)||i.state.readOnly||e!=t||r!=">"&&r!="/"||!Nr.isActiveAt(i.state,e,-1))return!1;let s=n(),{state:o}=s,a=o.changeByRange(l=>{var h;let{head:f}=l,O=rt(o).resolveInner(f-1,-1),m;if(O.name=="JSXStartTag"&&(O=O.parent),!(o.doc.sliceString(f-1,f)!=r||O.name=="JSXAttributeValue"&&O.to>f)){if(r==">"&&O.name=="JSXFragmentTag")return{range:l,changes:{from:f,insert:"</>"}};if(r=="/"&&O.name=="JSXStartCloseTag"){let b=O.parent,v=b.parent;if(v&&b.from==f-2&&((m=jx(o.doc,v.firstChild,f))||((h=v.firstCh Line truncated
`:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new Qm(this):new Sm(this)}getCursor(e,t=0,r){let n=e.doc?e:it.create({doc:e});return r==null&&(r=n.doc.length),this.regexp?la(this,n,t,r):aa(this,n,t,r)}},$f=class{constructor(e){this.spec=e}};function BC(i,e,t){return(r,n,s,o)=>{if(t&&!t(r,n,s,o))return!1;let a=r>=o&&n<=o+s.length?s.slice(r-o,n-o):e.doc.sliceString(r,n);return i(a,e,r,n)}}function aa(i,e,t,r){let n;return i.wholeWord&&(n=GC(e.doc,e.charCategorizer(e.selection.main.head))),i.test&&(n=BC(i.test,e,n)),new Ss(e.doc,i.unquoted,t,r,i.caseSensitive?void 0:s=>s.toLowerCase(),n)}function GC(i,e){return(t,r,n,s)=>((s>t||s+n.length<r)&&(s=Math.max(0,t-2),n=i.sliceString(s,Math.min(i.length,r+2))),(e(Pf(n,t-s))!=xt.Word||e(kf(n,t-s))!=xt.Word)&&(e(kf(n,r-s))!=xt.Word||e(Pf(n,r-s))!=xt.Word))}var Sm=class extends $f{constructor(e){super(e)}nextMatch(e,t,r){let n=aa(this.spec,e,r,e.doc.length).nextOverlapping();if(n.done){let s=Math.min(e.doc.length,t+this.spec.unquoted.length);n=aa(this.spec,e,0,s).nextOverlapping()}return n.done||n.value.from==t&&n.value.to==r?null:n.value}prevMatchInRange(e,t,r){for(let n=r;;){let s=Math.max(t,n-1e4-this.spec.unquoted.length),o=aa(this.spec,e,s,n),a=null;for(;!o.nextOverlapping().done;)a=o.value;if(a)return a;if(s==t)return null;n-=1e4}}prevMatch(e,t,r){let n=this.prevMatchInRange(e,0,t);return n||(n=this.prevMatchInRange(e,Math.max(0,r-this.spec.unquoted.length),e.doc.length)),n&&(n.from!=t||n.to!=r)?n:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let r=aa(this.spec,e,0,e.doc.length),n=[];for(;!r.next().done;){if(n.length>=t)return null;n.push(r.value)}return n}highlight(e,t,r,n){let s=aa(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)n(s.value.from,s.value.to)}};function FC(i,e,t){return(r,n,s)=>(!t||t(r,n,s))&&i(s[0],e,r,n)}function la(i,e,t,r){let n;return i.wholeWord&&(n=HC(e.charCategorizer(e.selection.main.head))),i.test&&(n=FC(i.test,e,n)),new Qf(e.doc,i.search,{ignoreCase:!i.caseSensitive,test:n},t,r)}function Pf(i,e){return i.slice(zt(i,e,!1),e)}function kf(i,e){return i.slice(e,zt(i,e))}function HC(i){return(e,t,r)=>!r[0].length||(i(Pf(r.input,r.index))!=xt.Word||i(kf(r.input,r.index))!=xt.Word)&&(i(kf(r.input,r.index+r[0].length))!=xt.Word||i(Pf(r.input,r.index+r[0].length))!=xt.Word)}var Qm=class extends $f{nextMatch(e,t,r){let n=la(this.spec,e,r,e.doc.length).next();return n.done&&(n=la(this.spec,e,0,t).next()),n.done?null:n.value}prevMatchInRange(e,t,r){for(let n=1;;n++){let s=Math.max(t,r-n*1e4),o=la(this.spec,e,s,r),a=null;for(;!o.next().done;)a=o.value;if(a&&(s==t||a.from>s+10))return a;if(s==t)return null}}prevMatch(e,t,r){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,r)=>{if(r=="&")return e.match[0];if(r=="$")return"$";for(let n=r.length;n>0;n--){let s=+r.slice(0,n);if(s>0&&s<e.match.length)return e.match[s]+r.slice(n)}return t})}matchAll(e,t){let r=la(this.spec,e,0,e.doc.length),n=[];for(;!r.next().done;){if(n.length>=t)return null;n.push(r.value)}return n}highlight(e,t,r,n){let s=la(this.spec,e,Math.max(0,t-250),Math.min(r+250,e.doc.length));for(;!s.next().done;)n(s.value.from,s.value.to)}},Xl=Ce.define(),Pm=Ce.define(),bs=ot.define({create(i){return new Tl(vm(i).create(),null)},update(i,e){for(let t of e.effects)t.is(Xl)?i=new Tl(t.value.create(),i.panel):t.is(Pm)&&(i=new Tl(i.query,t.value?km:null));return i},provide:i=>tl.from(i,e=>e.panel)});var Tl=class{constructor(e,t){this.query=e,this.panel=t}},KC=de.mark({class:"cm-searchMatch"}),JC=de.mark({class:"cm-searchMatch cm-searchMatch-selected"}),e2=Rt.fromClass(class{constructor(i){this.view=i,this.decorations=this.highlight(i.state.field(bs))}update(i){let e=i.state.field(bs);(e!=i.startState.field(bs)||i.docChanged||i.selectionSet||i.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:i,panel:e}){if(!e||!i.spec.valid)return de.none;let{view:t}=this,r=new Ur;for(let n=0,s=t.visibleRanges,o=s.length;n<o;n++){let{from:a,to:l}=s[n];for(;n<o-1&&l>s[n+1].from-500;)l=s[++n].to;i.highlight(t.state,a,l,(h,f)=>{let O=t.state.selection.ranges.some(m=>m.from==h&&m.to==f);r.add(h,f,O?JC:KC)})}return r.finish()}},{decorations:i=>i.decorations});function _l(i){return e=>{let t=e.state.field(bs,!1);return t&&t.query.spec.valid?i(e,t):_y(e)}}var Tf=_l((i,{query:e})=>{let{to:t}=i.state.selection.main,r=e.nextMatch(i.state,t,t);if(!r)return!1;let n=H.single(r.from,r.to),s=i.state.facet(co);return i.dispatch({selection:n,effects:[Tm(i,r),s.scrollToMatch(n.main,i)],userEvent:"select.search"}),Xy(i),!0}),Xf=_l((i,{query:e})=>{let{state:t}=i,{from:r}=t.selection.main,n=e.prevMatch(t,r,r);if( Line truncated
}`,{label:"class",detail:"definition",type:"keyword"}),$i('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),$i('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],oC=Iy.concat([$i("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),$i("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),$i("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Wy=new Fo,Ny=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function $l(i){return(e,t)=>{let r=e.node.getChild("VariableDefinition");return r&&t(r,i),!0}}var aC=["FunctionDeclaration"],lC={FunctionDeclaration:$l("function"),ClassDeclaration:$l("class"),ClassExpression:()=>!0,EnumDeclaration:$l("constant"),TypeAliasDeclaration:$l("type"),NamespaceDeclaration:$l("namespace"),VariableDefinition(i,e){i.matchContext(aC)||e(i,"variable")},TypeDefinition(i,e){e(i,"type")},__proto__:null};function By(i,e){let t=Wy.get(e);if(t)return t;let r=[],n=!0;function s(o,a){let l=i.sliceString(o.from,o.to);r.push({label:l,type:a})}return e.cursor(at.IncludeAnonymous).iterate(o=>{if(n)n=!1;else if(o.name){let a=lC[o.name];if(a&&a(o,s)||Ny.has(o.name))return!1}else if(o.to-o.from>8192){for(let a of By(i,o.node))r.push(a);return!1}}),Wy.set(e,r),r}var qy=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Gy=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function cC(i){let e=rt(i.state).resolveInner(i.pos,-1);if(Gy.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&qy.test(i.state.sliceDoc(e.from,e.to));if(!t&&!i.explicit)return null;let r=[];for(let n=e;n;n=n.parent)Ny.has(n.name)&&(r=r.concat(By(i.state.doc,n)));return{options:r,from:t?e.from:i.pos,validFor:qy}}var Nr=ri.define({name:"javascript",parser:Dy.configure({props:[qi.add({IfStatement:Sn({except:/^\s*({|else\b)/}),TryStatement:Sn({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Nh,SwitchBody:i=>{let e=i.textAfter,t=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return i.baseIndent+(t?0:r?1:2)*i.unit},Block:Jo({closing:"}"}),ArrowFunction:i=>i.baseIndent+i.unit,"TemplateString BlockComment":()=>null,"Statement Property":Sn({except:/^\s*{/}),JSXElement(i){let e=/^\s*<\//.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},JSXEscape(i){let e=/\s*\}/.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},"JSXOpenTag JSXSelfClosingTag"(i){return i.column(i.node.from)+i.unit}}),ji.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":ds,BlockComment(i){return{from:i.from+2,to:i.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),Fy={test:i=>/^JSX/.test(i.name),facet:Ho({commentTokens:{block:{open:"{/*",close:"*/}"}}})},om=Nr.configure({dialect:"ts"},"typescript"),am=Nr.configure({dialect:"jsx",props:[jh.add(i=>i.isTop?[Fy]:void 0)]}),lm=Nr.configure({dialect:"jsx ts",props:[jh.add(i=>i.isTop?[Fy]:void 0)]},"typescript"),Hy=i=>({label:i,type:"keyword"}),Ky="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(Hy),hC=Ky.concat(["declare","implements","private","protected","public"].map(Hy));function Jy(i={}){let e=i.jsx?i.typescript?lm:am:i.typescript?om:Nr,t=i.typescript?oC.concat(hC):Iy.concat(Ky);return new Qt(e,[Nr.data.of({autocomplete:QQ(Gy,SQ(t))}),Nr.data.of({autocomplete:cC}),i.jsx?OC:[]])}function fC(i){for(;;){if(i.name=="JSXOpenTag"||i.name=="JSXSelfClosingTag"||i.name=="JSXFragmentTag")return i;if(i.name=="JSXEscape"||!i.parent)return null;i=i.parent}}function jy(i,e,t=i.length){for(let r=e==null?void 0:e.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return i.sliceString(r.from,Math.min(r.to,t));return""}var uC=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),OC=ne.inputHandler.of((i,e,t,r,n)=>{if((uC?i.composing:i.compositionStarted)||i.state.readOnly||e!=t||r!=">"&&r!="/"||!Nr.isActiveAt(i.state,e,-1))return!1;let s=n(),{state:o}=s,a=o.changeByRange(l=>{var h;let{head:f}=l,O=rt(o).resolveInner(f-1,-1),m;if(O.name=="JSXStartTag"&&(O=O.parent),!(o.doc.sliceString(f-1,f)!=r||O.name=="JSXAttributeValue"&&O.to>f)){if(r==">"&&O.name=="JSXFragmentTag")return{range:l,changes:{from:f,insert:"</>"}};if(r=="/"&&O.name=="JSXStartCloseTag"){let b=O.parent,v=b.parent;if(v&&b.from==f-2&&((m=jy(o.doc,v.firstChild,f))||((h=v.firstCh Line truncated
`:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new Qm(this):new Sm(this)}getCursor(e,t=0,r){let n=e.doc?e:it.create({doc:e});return r==null&&(r=n.doc.length),this.regexp?la(this,n,t,r):aa(this,n,t,r)}},$f=class{constructor(e){this.spec=e}};function BC(i,e,t){return(r,n,s,o)=>{if(t&&!t(r,n,s,o))return!1;let a=r>=o&&n<=o+s.length?s.slice(r-o,n-o):e.doc.sliceString(r,n);return i(a,e,r,n)}}function aa(i,e,t,r){let n;return i.wholeWord&&(n=GC(e.doc,e.charCategorizer(e.selection.main.head))),i.test&&(n=BC(i.test,e,n)),new Ss(e.doc,i.unquoted,t,r,i.caseSensitive?void 0:s=>s.toLowerCase(),n)}function GC(i,e){return(t,r,n,s)=>((s>t||s+n.length<r)&&(s=Math.max(0,t-2),n=i.sliceString(s,Math.min(i.length,r+2))),(e(Pf(n,t-s))!=yt.Word||e(kf(n,t-s))!=yt.Word)&&(e(kf(n,r-s))!=yt.Word||e(Pf(n,r-s))!=yt.Word))}var Sm=class extends $f{constructor(e){super(e)}nextMatch(e,t,r){let n=aa(this.spec,e,r,e.doc.length).nextOverlapping();if(n.done){let s=Math.min(e.doc.length,t+this.spec.unquoted.length);n=aa(this.spec,e,0,s).nextOverlapping()}return n.done||n.value.from==t&&n.value.to==r?null:n.value}prevMatchInRange(e,t,r){for(let n=r;;){let s=Math.max(t,n-1e4-this.spec.unquoted.length),o=aa(this.spec,e,s,n),a=null;for(;!o.nextOverlapping().done;)a=o.value;if(a)return a;if(s==t)return null;n-=1e4}}prevMatch(e,t,r){let n=this.prevMatchInRange(e,0,t);return n||(n=this.prevMatchInRange(e,Math.max(0,r-this.spec.unquoted.length),e.doc.length)),n&&(n.from!=t||n.to!=r)?n:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let r=aa(this.spec,e,0,e.doc.length),n=[];for(;!r.next().done;){if(n.length>=t)return null;n.push(r.value)}return n}highlight(e,t,r,n){let s=aa(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)n(s.value.from,s.value.to)}};function FC(i,e,t){return(r,n,s)=>(!t||t(r,n,s))&&i(s[0],e,r,n)}function la(i,e,t,r){let n;return i.wholeWord&&(n=HC(e.charCategorizer(e.selection.main.head))),i.test&&(n=FC(i.test,e,n)),new Qf(e.doc,i.search,{ignoreCase:!i.caseSensitive,test:n},t,r)}function Pf(i,e){return i.slice(zt(i,e,!1),e)}function kf(i,e){return i.slice(e,zt(i,e))}function HC(i){return(e,t,r)=>!r[0].length||(i(Pf(r.input,r.index))!=yt.Word||i(kf(r.input,r.index))!=yt.Word)&&(i(kf(r.input,r.index+r[0].length))!=yt.Word||i(Pf(r.input,r.index+r[0].length))!=yt.Word)}var Qm=class extends $f{nextMatch(e,t,r){let n=la(this.spec,e,r,e.doc.length).next();return n.done&&(n=la(this.spec,e,0,t).next()),n.done?null:n.value}prevMatchInRange(e,t,r){for(let n=1;;n++){let s=Math.max(t,r-n*1e4),o=la(this.spec,e,s,r),a=null;for(;!o.next().done;)a=o.value;if(a&&(s==t||a.from>s+10))return a;if(s==t)return null}}prevMatch(e,t,r){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,r)=>{if(r=="&")return e.match[0];if(r=="$")return"$";for(let n=r.length;n>0;n--){let s=+r.slice(0,n);if(s>0&&s<e.match.length)return e.match[s]+r.slice(n)}return t})}matchAll(e,t){let r=la(this.spec,e,0,e.doc.length),n=[];for(;!r.next().done;){if(n.length>=t)return null;n.push(r.value)}return n}highlight(e,t,r,n){let s=la(this.spec,e,Math.max(0,t-250),Math.min(r+250,e.doc.length));for(;!s.next().done;)n(s.value.from,s.value.to)}},Xl=Ce.define(),Pm=Ce.define(),bs=ot.define({create(i){return new Tl(vm(i).create(),null)},update(i,e){for(let t of e.effects)t.is(Xl)?i=new Tl(t.value.create(),i.panel):t.is(Pm)&&(i=new Tl(i.query,t.value?km:null));return i},provide:i=>tl.from(i,e=>e.panel)});var Tl=class{constructor(e,t){this.query=e,this.panel=t}},KC=de.mark({class:"cm-searchMatch"}),JC=de.mark({class:"cm-searchMatch cm-searchMatch-selected"}),e2=Rt.fromClass(class{constructor(i){this.view=i,this.decorations=this.highlight(i.state.field(bs))}update(i){let e=i.state.field(bs);(e!=i.startState.field(bs)||i.docChanged||i.selectionSet||i.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:i,panel:e}){if(!e||!i.spec.valid)return de.none;let{view:t}=this,r=new Ur;for(let n=0,s=t.visibleRanges,o=s.length;n<o;n++){let{from:a,to:l}=s[n];for(;n<o-1&&l>s[n+1].from-500;)l=s[++n].to;i.highlight(t.state,a,l,(h,f)=>{let O=t.state.selection.ranges.some(m=>m.from==h&&m.to==f);r.add(h,f,O?JC:KC)})}return r.finish()}},{decorations:i=>i.decorations});function _l(i){return e=>{let t=e.state.field(bs,!1);return t&&t.query.spec.valid?i(e,t):_x(e)}}var Tf=_l((i,{query:e})=>{let{to:t}=i.state.selection.main,r=e.nextMatch(i.state,t,t);if(!r)return!1;let n=H.single(r.from,r.to),s=i.state.facet(co);return i.dispatch({selection:n,effects:[Tm(i,r),s.scrollToMatch(n.main,i)],userEvent:"select.search"}),Xx(i),!0}),Xf=_l((i,{query:e})=>{let{state:t}=i,{from:r}=t.selection.main,n=e.prevMatch(t,r,r);if( Line truncated
`;let o=i.state.facet(gn),a=o instanceof ri?"Lezer LRLanguage":o instanceof ni?"StreamLanguage":"Unknown",l=o instanceof ri?"AST ":o instanceof ni?"Token ":"Name ";return{pos:e,above:!0,arrow:!0,create(h){let f=document.createElement("div");f.style.overflow="visible",f.style.height="0",f.style.width="0";let O=document.createElement("div");return O.className="cm-debug-tooltip",O.textContent=`Parser: ${a}
${l}: ${r.name}
Tags : ${s}`,O.style.whiteSpace="pre-wrap",O.style.fontFamily="monospace",O.style.background="#333",O.style.color="white",O.style.padding="2px 8px",O.style.borderRadius="4px",O.style.fontSize="12px",O.style.border="1px solid #555",O.style.pointerEvents="none",O.style.position="absolute",O.style.bottom="0",O.style.width="max-content",f.appendChild(O),{dom:f}}}},{hoverTime:10,hideOnChange:!0});function V2(i){return it.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input")||!i.input)return e;let t=[],r=!1;if(e.changes.iterChanges((o,a,l,h,f)=>{let O=f.toString(),m=i.input(O);t.push({from:o,to:a,insert:m}),m!==O&&(r=!0)}),!r)return e;let n=e.annotation(Tt.userEvent),s=e.annotation(Tt.addToHistory);return{changes:t,selection:e.selection,effects:e.effects,scrollIntoView:e.scrollIntoView,annotations:[...n!=null?[Tt.userEvent.of(n)]:[],...s!=null?[Tt.addToHistory.of(s)]:[]]}})}var Em=new Zo;function Iy(i){return Em.reconfigure(V2(i))}var Ny=Ce.define(),By=Ce.define(),Gy=Ce.define(),Um=Ce.define(),Fy=Ce.define(),Hy=Ce.define(),Ky=Ce.define(),Jy=Ce.define(),ew=ot.define({create(){return Le.empty},update(i,e){i=i.map(e.changes);for(let t of e.effects)if(t.is(Ny)){let r=t.value,n=[];for(let[s,o]of r.entries())if(s>=1&&s<=e.state.doc.lines){let a=e.state.doc.line(s).from;n.push(new _f(ht(o,4)).range(a))}i=Le.of(n,!0)}return i}}),tw=ot.define({create(){return Le.empty},update(i,e){i=i.map(e.changes);for(let t of e.effects)if(t.is(By)){let r=t.value,n=[];for(let[s,o]of r.entries())if(s>=1&&s<=e.state.doc.lines){let a=e.state.doc.line(s).from;n.push(new Rf(o).range(a))}i=Le.of(n,!0)}return i}}),iw=ot.define({create(){return Le.empty},update(i,e){i=i.map(e.changes);for(let t of e.effects)if(t.is(Gy)){let r=t.value,n=[];for(let[s,o]of r.entries())if(s>=1&&s<=e.state.doc.lines){let a=e.state.doc.line(s).from;n.push(new Cf(o).range(a))}i=Le.of(n,!0)}return i}}),rw=ot.define({create(){return Le.empty},update(i,e){i=i.map(e.changes);for(let t of e.effects)if(t.is(Um))if(t.value===null)i=Le.empty;else{let r=t.value;if(r>=1&&r<=e.state.doc.lines){let n=e.state.doc.line(r).from,s=!1;i.between(n,n,()=>(s=!0,!1)),s?i=i.update({filter:o=>o!==n}):i=i.update({add:[W2.range(n)]})}}return i}}),Zm=ot.define({create(){return Le.empty},update(i,e){i=i.map(e.changes);for(let t of e.effects)if(t.is(Fy)){let r=t.value,n=[];for(let[s,o]of r.entries())if(s>=1&&s<=e.state.doc.lines){let a=e.state.doc.line(s).from;n.push(new Af(s,o).range(a))}i=Le.of(n,!0)}return i}}),nw=ot.define({create(){return Le.empty},update(i,e){i=i.map(e.changes);for(let t of e.effects)if(t.is(Hy))if(t.value===null)i=Le.empty;else{let r=t.value;if(r>=1&&r<=e.state.doc.lines){let n=e.state.doc.line(r).from;i=Le.of(sw.range(n))}}return i}}),_f=class extends Mt{constructor(t){super();this.hex=t}toDOM(){return document.createTextNode(this.hex)}eq(t){return this.hex==t.hex}},Rf=class extends Mt{constructor(t){super();this.bytes=t}toDOM(){return document.createTextNode(this.bytes)}eq(t){return this.bytes==t.bytes}},Cf=class extends Mt{constructor(t){super();this.clock=t}toDOM(){return document.createTextNode(this.clock)}eq(t){return this.clock==t.clock}},D2=new class extends Mt{toDOM(){let i=document.createElement("span");return i.textContent="\u25CF",i.style.color="transparent",i.style.cursor="pointer",i.addEventListener("mouseenter",()=>{i.style.color="rgba(255, 0, 0, 0.5)"}),i.addEventListener("mouseleave",()=>{i.style.color="transparent"}),i}},W2=new class extends Mt{toDOM(){let i=document.createElement("span");return i.innerHTML="\u25CF",i.style.color="rgba(255, 0, 0, 1.0)",i.style.cursor="pointer",i.title="Click to run to here",i}},Af=class extends Mt{constructor(t,r){super();this.line=t;this.msg=r}toDOM(){let t=document.createElement("span");return t.innerHTML="\u24E7",t.style.color="red",t.style.cursor="pointer",t.title=this.msg,t}eq(t){return this.line==t.line&&this.msg==t.msg}},q2=new class extends Mt{toDOM(){let i=document.createElement("span");return i.textContent="\u25B6",i.style.color="transparent",i.style.cursor="pointer",i.title="Click to run to here",i.addEventListener("mouseenter",()=>{i.style.color="#ffee66"}),i.addEventListener("mouseleave",()=>{i.style.color="transparent"}),i}},sw=new class extends Mt{toDOM(){let i=document.createElement("span");return i.innerHTML="\u25B6",i.style.color="#ff66ee",i.style.cursor="pointer",i.title="Current PC",i}},j2=as({class:"gutter-offset",markers:i=>i.state.field(ew),initialSpacer:()=>new _f("0000")}),I2=as({class:"gutter-bytes",markers:i=>i.state.field(tw),initialSpacer:()=>new Rf("00 00 00")}),N2=as({class:"gutter-clock",markers:i=>i.state.field(iw),initialSpacer:()=>new Cf("00")}),B2=as({class:"gutter-status",lineMarker(i,e,t){return t.length===0?D2:null},markers:i=>{let e=i.state.field(Zm);return e.size>0?e:i.state.field(rw)},initialSpacer:()=>new Af(0,"\u24E7"),domEventHandlers:{click(i,e){let t=i.state.field(Zm);if(t.size>0){let r=e.from,n="";if(t.between(r,r,(s,o,a)=>{n=a.msg}),n){let s=i.state.doc.line Line truncated
Tags : ${s}`,O.style.whiteSpace="pre-wrap",O.style.fontFamily="monospace",O.style.background="#333",O.style.color="white",O.style.padding="2px 8px",O.style.borderRadius="4px",O.style.fontSize="12px",O.style.border="1px solid #555",O.style.pointerEvents="none",O.style.position="absolute",O.style.bottom="0",O.style.width="max-content",f.appendChild(O),{dom:f}}}},{hoverTime:10,hideOnChange:!0});function V2(i){return it.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input")||!i.input)return e;let t=[],r=!1;if(e.changes.iterChanges((o,a,l,h,f)=>{let O=f.toString(),m=i.input(O);t.push({from:o,to:a,insert:m}),m!==O&&(r=!0)}),!r)return e;let n=e.annotation(Tt.userEvent),s=e.annotation(Tt.addToHistory);return{changes:t,selection:e.selection,effects:e.effects,scrollIntoView:e.scrollIntoView,annotations:[...n!=null?[Tt.userEvent.of(n)]:[],...s!=null?[Tt.addToHistory.of(s)]:[]]}})}var Em=new Zo;function Ix(i){return Em.reconfigure(V2(i))}var Nx=Ce.define(),Bx=Ce.define(),Gx=Ce.define(),Um=Ce.define(),Fx=Ce.define(),Hx=Ce.define(),Kx=Ce.define(),Jx=Ce.define(),ew=ot.define({create(){return Le.empty},update(i,e){i=i.map(e.changes);for(let t of e.effects)if(t.is(Nx)){let r=t.value,n=[];for(let[s,o]of r.entries())if(s>=1&&s<=e.state.doc.lines){let a=e.state.doc.line(s).from;n.push(new _f(ht(o,4)).range(a))}i=Le.of(n,!0)}return i}}),tw=ot.define({create(){return Le.empty},update(i,e){i=i.map(e.changes);for(let t of e.effects)if(t.is(Bx)){let r=t.value,n=[];for(let[s,o]of r.entries())if(s>=1&&s<=e.state.doc.lines){let a=e.state.doc.line(s).from;n.push(new Rf(o).range(a))}i=Le.of(n,!0)}return i}}),iw=ot.define({create(){return Le.empty},update(i,e){i=i.map(e.changes);for(let t of e.effects)if(t.is(Gx)){let r=t.value,n=[];for(let[s,o]of r.entries())if(s>=1&&s<=e.state.doc.lines){let a=e.state.doc.line(s).from;n.push(new Cf(o).range(a))}i=Le.of(n,!0)}return i}}),rw=ot.define({create(){return Le.empty},update(i,e){i=i.map(e.changes);for(let t of e.effects)if(t.is(Um))if(t.value===null)i=Le.empty;else{let r=t.value;if(r>=1&&r<=e.state.doc.lines){let n=e.state.doc.line(r).from,s=!1;i.between(n,n,()=>(s=!0,!1)),s?i=i.update({filter:o=>o!==n}):i=i.update({add:[W2.range(n)]})}}return i}}),Zm=ot.define({create(){return Le.empty},update(i,e){i=i.map(e.changes);for(let t of e.effects)if(t.is(Fx)){let r=t.value,n=[];for(let[s,o]of r.entries())if(s>=1&&s<=e.state.doc.lines){let a=e.state.doc.line(s).from;n.push(new Af(s,o).range(a))}i=Le.of(n,!0)}return i}}),nw=ot.define({create(){return Le.empty},update(i,e){i=i.map(e.changes);for(let t of e.effects)if(t.is(Hx))if(t.value===null)i=Le.empty;else{let r=t.value;if(r>=1&&r<=e.state.doc.lines){let n=e.state.doc.line(r).from;i=Le.of(sw.range(n))}}return i}}),_f=class extends Mt{constructor(t){super();this.hex=t}toDOM(){return document.createTextNode(this.hex)}eq(t){return this.hex==t.hex}},Rf=class extends Mt{constructor(t){super();this.bytes=t}toDOM(){return document.createTextNode(this.bytes)}eq(t){return this.bytes==t.bytes}},Cf=class extends Mt{constructor(t){super();this.clock=t}toDOM(){return document.createTextNode(this.clock)}eq(t){return this.clock==t.clock}},D2=new class extends Mt{toDOM(){let i=document.createElement("span");return i.textContent="\u25CF",i.style.color="transparent",i.style.cursor="pointer",i.addEventListener("mouseenter",()=>{i.style.color="rgba(255, 0, 0, 0.5)"}),i.addEventListener("mouseleave",()=>{i.style.color="transparent"}),i}},W2=new class extends Mt{toDOM(){let i=document.createElement("span");return i.innerHTML="\u25CF",i.style.color="rgba(255, 0, 0, 1.0)",i.style.cursor="pointer",i.title="Click to run to here",i}},Af=class extends Mt{constructor(t,r){super();this.line=t;this.msg=r}toDOM(){let t=document.createElement("span");return t.innerHTML="\u24E7",t.style.color="red",t.style.cursor="pointer",t.title=this.msg,t}eq(t){return this.line==t.line&&this.msg==t.msg}},q2=new class extends Mt{toDOM(){let i=document.createElement("span");return i.textContent="\u25B6",i.style.color="transparent",i.style.cursor="pointer",i.title="Click to run to here",i.addEventListener("mouseenter",()=>{i.style.color="#ffee66"}),i.addEventListener("mouseleave",()=>{i.style.color="transparent"}),i}},sw=new class extends Mt{toDOM(){let i=document.createElement("span");return i.innerHTML="\u25B6",i.style.color="#ff66ee",i.style.cursor="pointer",i.title="Current PC",i}},j2=as({class:"gutter-offset",markers:i=>i.state.field(ew),initialSpacer:()=>new _f("0000")}),I2=as({class:"gutter-bytes",markers:i=>i.state.field(tw),initialSpacer:()=>new Rf("00 00 00")}),N2=as({class:"gutter-clock",markers:i=>i.state.field(iw),initialSpacer:()=>new Cf("00")}),B2=as({class:"gutter-status",lineMarker(i,e,t){return t.length===0?D2:null},markers:i=>{let e=i.state.field(Zm);return e.size>0?e:i.state.field(rw)},initialSpacer:()=>new Af(0,"\u24E7"),domEventHandlers:{click(i,e){let t=i.state.field(Zm);if(t.size>0){let r=e.from,n="";if(t.between(r,r,(s,o,a)=>{n=a.msg}),n){let s=i.state.doc.line Line truncated
`);for(let l of a){aw.lastIndex=0;let h=aw.exec(l);if(h){let f=o+h.index+h[0].length;t.push(de.widget({widget:new zm(h[0],e),side:-1}).range(f))}o+=l.length+1}}return de.set(t,!0)}function cw(i){let e;function t(r){let n=e.posAtDOM(r);i(e.state.doc.lineAt(n).number)}return Rt.fromClass(class{constructor(r){e=r,this.decorations=lw(r,t)}update(r){e=r.view,(r.docChanged||r.viewportChanged)&&(this.decorations=lw(r.view,t))}},{decorations:r=>r.decorations})}function F2(i){let e=i.state.tabSize;return i.dispatch(i.state.changeByRange(t=>{let r=i.state.doc.lineAt(t.from),n=i.state.doc.lineAt(t.to);if(t.empty){let s=t.head-r.from,o=e-s%e,a=" ".repeat(o);return{changes:{from:t.from,insert:a},range:H.cursor(t.from+o)}}else if(r.number===n.number){let s=t.from-r.from,o=e-s%e,a=" ".repeat(o);return{changes:{from:t.from,to:t.to,insert:a},range:H.cursor(t.from+o)}}else{let s=[];for(let a=r.number;a<=n.number;a++){let l=i.state.doc.line(a),h=l.text.search(/\S/);if(h<0)continue;let O=(Math.floor(h/e)+1)*e-h;s.push({from:l.from+h,insert:" ".repeat(O)})}let o=i.state.changes(s);return{changes:o,range:H.range(o.mapPos(t.from),o.mapPos(t.to))}}})),!0}function H2(i){let e=i.state.tabSize,t=[],r=new Set;for(let n of i.state.selection.ranges){let s=i.state.doc.lineAt(n.from),o=i.state.doc.lineAt(n.to);for(let a=s.number;a<=o.number;a++){if(r.has(a))continue;r.add(a);let l=i.state.doc.line(a),h=l.text.search(/\S/);if(h<=0)continue;let f=Math.floor((h-1)/e)*e;t.push({from:l.from+f,to:l.from+h})}}return t.length&&i.dispatch({changes:t}),!0}var hw=[{key:"Tab",run:F2},{key:"Shift-Tab",run:H2}];var fw=Ce.define(),uw=de.line({attributes:{class:"cm-currentpc"}}),K2=ot.define({create(){return de.none},update(i,e){i=i.map(e.changes);for(let t of e.effects)if(t.is(fw)){if(t.value===null)return de.none;let r=e.state.doc.line(t.value);return de.set([uw.range(r.from)])}return i},provide:i=>ne.decorations.from(i)}),Cl=class extends Ft{constructor(t){super();this.message=t}toDOM(){let t=document.createElement("div");return t.textContent=this.message,t.style.cssText=`
color: #ff6666;
background-color: #330000;
@@ -59,12 +59,12 @@ Tags : ${s}`,O.style.whiteSpace="pre-wrap",O.style.fontFamily="monospace",O.sty
color: #ccccff;
background-color: #000066;
display: inline-block;
`,t.className="cm-line",t}},Ow=Ce.define(),eA=ot.define({create(){return de.none},update(i,e){i=i.map(e.changes);for(let t of e.effects)if(t.is(Ow)){if(t.value===null||!t.value)return de.none;let r=e.state.doc.lineAt(t.value.range.to);return de.set([de.widget({widget:new Lm(t.value.val),block:!0,side:1}).range(r.to)])}return i},provide:i=>ne.decorations.from(i)}),dw=Ce.define(),tA=de.mark({attributes:{class:"cm-error-span"}}),iA=ot.define({create(){return de.none},update(i,e){i=i.map(e.changes);for(let t of e.effects)if(t.is(dw)){if(t.value===null)return de.none;let r=[];for(let n of t.value)try{let s=e.state.doc.line(n.line),o=s.from+n.start,a=s.from+n.end;o>=s.from&&a<=s.to&&o<a&&r.push(tA.range(o,a))}catch(s){}return de.set(r,!0)}return i},provide:i=>ne.decorations.from(i)}),pw=Ce.define(),rA=de.line({attributes:{class:"highlight-lines"}}),nA=ot.define({create(){return de.none},update(i,e){i=i.map(e.changes);for(let t of e.effects)if(t.is(pw)){if(t.value===null)return de.none;let{start:r,end:n}=t.value,s=[];for(let o=r;o<=n;o++)try{let a=e.state.doc.line(o);s.push(rA.range(a.from))}catch(a){}return de.set(s)}return i!==de.none&&(e.docChanged||e.selection)?de.none:i},provide:i=>ne.decorations.from(i)}),mw={field:J2,widget:Cl},Al={effect:fw,decoration:uw,field:K2},Uf={effect:Ow,field:eA},zf={effect:dw,field:iA},Mm={effect:pw,field:nA};var gw=!1,Mf=64,sA=200,Vm={default:{theme:Am},6502:{isAsm:!0},z80:{isAsm:!0},jsasm:{isAsm:!0},gas:{isAsm:!0},vasm:{isAsm:!0},inform6:{theme:Cm},markdown:{lineWrap:!0},fastbasic:{noGutters:!0},basic:{noLineNumbers:!0,noGutters:!0},ecs:{theme:Am,isAsm:!0}},oA={input:null},fo=class{constructor(e,t){this.updateTimer=null;this.dirtylisting=!0;this.refreshDelayMsec=300;this.path=e,this.mode=t}createDiv(e){var t=document.createElement("div");t.setAttribute("class","editor"),e.appendChild(t);var r=ze.getFile(this.path),n=r&&this.mode=="verilog"&&/__asm\b([\s\S]+?)\b__endasm\b/.test(r);return this.newEditor(t,r,n),this.editor.dispatch({effects:Iy(oA)}),ze.getToolForFilename(this.path).startsWith("remote:")&&(this.refreshDelayMsec=1e3),t}setVisible(e){e&&this.editor.focus()}newEditor(e,t,r){var n=Vm[this.mode]||Vm.default,s=r||n.isAsm,o=!!n.lineWrap,a=n.theme||Vm.default.theme,l=!n.noLineNumbers&&!wa;ye.embed&&(l=!1,s=!1);let h=n.noGutters||wa;var f;switch(this.mode){case"6502":f=Ey();break;case"basic":f=Zy();break;case"bataribasic":f=Uy();break;case"fastbasic":f=zy();break;case"inform6":f=Ly();break;case"markdown":f=vy();break;case"text/x-csrc":f=Pv();break;case"text/x-wiz":f=Vy();break;case"verilog":f=My();break;case"z80":f=Wy();break;default:console.warn("Unknown mode: "+this.mode);break}this.editor=new ne({parent:e,doc:t,extensions:[Dr.of([{key:"Backspace",run:PQ}]),Dr.of(dv),l?TS():[],QS(),LQ(),Dr.of(DQ),sQ(),SS(),it.allowMultipleSelections.of(!0),Sd(),tQ(),hQ(),yQ(),vd(),xd(),Qd(),XS(),$m(),ky({top:!0}),Dr.of(Cy),f||[],a,jy,gw?Ym:[],it.tabSize.of(8),bn.of(" "),Dr.of(hw),o?ne.lineWrapping:[],Al.field,h?[]:[Yf.field,Yf.gutter],s&&!h?[Rl.field,Rl.gutter,Ef.field,Ef.gutter]:[],Zf.field,ow.gutter,ne.updateListener.of(O=>{for(let m of O.transactions.flatMap(b=>b.effects))if(m.is(Zf.set)&&L.isRunning()&&this.runToBreakpoints(O.state),m.is(ca.runToLine)){let b=m.value;if(this.sourcefile&&this.sourcefile.line2offset){let v=this.sourcefile.line2offset[b];v>=0&&Ws([v])}}}),ho.field,mw.field,zf.field,ca.field,ca.gutter,Mm.field,cw(O=>{window.location.hash="asseteditor/"+encodeURIComponent(this.path)+"/"+O}),Em.of([]),ne.updateListener.of(O=>{O.docChanged&&this.editorChanged()}),Uf.field,ne.updateListener.of(O=>{O.selectionSet&&this.inspectUnderCursor(O)})]})}editorChanged(){clearTimeout(this.updateTimer),this.updateTimer=setTimeout(()=>{ze.updateFile(this.path,this.editor.state.doc.toString())},this.refreshDelayMsec)}inspectUnderCursor(e){let t=e.state.selection.main,r=e.state.sliceDoc(t.from,t.to).trim();var n;L.inspect&&(n=L.inspect(r)),!t.empty&&n&&n.length<80?e.view.dispatch({effects:Uf.effect.of({range:t,val:n})}):e.view.dispatch({effects:Uf.effect.of(null)})}setText(e){var t=this.editor.state.doc.toString();t!=e&&this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,insert:e},annotations:Jh.of("full")})}replaceTextRange(e,t,r){let n=this.editor.state.doc.lineAt(e).number,s=this.editor.state.doc.lineAt(t).number;this.editor.dispatch({changes:{from:e,to:t,insert:r},annotations:Jh.of("full"),selection:{anchor:e,head:t},effects:[ne.scrollIntoView(this.editor.state.doc.line(n).from,{y:"start",yMargin:100})]})}insertLinesBefore(e){let t=this.editor.state.selection.main.from,r=this.editor.state.doc.lineAt(t).number,n=this.editor.state.doc.lineAt(t).from,s=e.split(`
`).length-1;this.editor.dispatch({changes:{from:n,insert:e}}),this.highlightLines(r-1,r+s-2)}highlightLines(e,t){let r=this.editor.state.doc.line(e+1);this.editor.dispatch({effects:[Mm.effect.of({start:e+1,end:t+1}),ne.scrollIntoView(r.from,{y:"start",yMargin:100})]})}getValue(){return this.editor.state.doc.toString()}getPath(){return this.path}markErrors(e){this.clearErrors(),e=e.slice(0,sA);let t=new Map,r=[];for(var n of e)if(!n.path||this.path.endsWith(n.path)){var s=this.editor.state.doc.lines,o=n.line;(isNaN(o)||o<1||o>s)&&(o=1),t.set(o,n.msg),n.start!=null&&n.end!=null&&n.end>n.start&&r.push({line:o,start:n.start,end:n.end})}this.editor.dispatch({effects:[ho.set.of(t),zf.effect.of(r.length>0?r:null)]})}clearErrors(){this.dirtylisting=!0,this.editor.dispatch({effects:[ho.set.of(new Map),ho.showMessage.of(null),zf.effect.of(null)]})}getSourceFile(){return this.sourcefile}updateListing(){this.clearErrors();var e=this.sourcefile.lines||[];let t=new Map,r=new Map,n=new Map;for(var s of e)if(s.offset>=0&&t.set(s.line,ht(s.offset&65535,4)),s.insns){var o=s.insns.length>9?"...":s.insns;if(r.set(s.line,o),s.iscode){if(s.cycles)n.set(s.line,s.cycles+"");else if(L.getOpcodeMetadata){var a=parseInt(s.insns.split(" ")[0],16),l=L.getOpcodeMetadata(a,s.offset);if(l&&l.minCycles){var h=l.minCycles+"";n.set(s.line,h)}}}}this.editor.dispatch({effects:[Yf.set.of(t),Rl.set.of(r),Ef.set.of(n)]})}setTimingResult(e){if(this.sourcefile!=null){var t=new Map;for(let o of Object.keys(this.sourcefile.line2offset)){let a=this.sourcefile.line2offset[o],l=e.pc2clockrange[a];var r=l&&l.minclocks,n=l&&l.maxclocks;if(r>=0&&n>=0){var s;n==r?s=r+"":s=r+"-"+n,n==e.MAX_CLOCKS&&(s+="+"),t.set(parseInt(o),s)}}this.editor.dispatch({effects:[Rl.set.of(t)]})}}setCurrentLine(e,t){var r=n=>{this.editor.dispatch({effects:[ca.set.of(n.line),Al.effect.of(n.line),ne.scrollIntoView(this.editor.state.doc.line(n.line).from,{y:"center"})]})};if(this.clearCurrentLine(t),e){if(e.line<1||e.line>this.editor.state.doc.lines)return!1;if(r(e),t){let s=this.editor.state.doc.line(e.line).from+(e.start||0);this.editor.dispatch({selection:{anchor:s,head:s},effects:ne.scrollIntoView(s,{y:"center"})})}return this.currentDebugLine=e,!0}}clearCurrentLine(e){if(this.currentDebugLine){if(e){let t=this.editor.state.selection.main.head;this.editor.dispatch({selection:{anchor:t,head:t}})}this.currentDebugLine=null}this.editor.dispatch({effects:[ca.set.of(null),Al.effect.of(null)]})}getActiveLine(){if(this.sourcefile){var e=zn&&zn.c;if(!e&&L.getCPUState&&!L.isRunning()&&(e=L.getCPUState()),e){var t=e&&(e.EPC||e.PC),r=this.sourcefile.findLineForOffset(t,Mf);return r}}}refreshDebugState(e){this.clearCurrentLine(e);var t=this.getActiveLine();t&&this.setCurrentLine(t,e)}refreshListing(){var e=ze.getListingForFile(this.path);e&&e.sourcefile&&e.sourcefile!==this.sourcefile&&(this.sourcefile=e.sourcefile,this.dirtylisting=!0),!(!this.sourcefile||!this.dirtylisting)&&(this.updateListing(),this.dirtylisting=!1)}refresh(e){this.refreshListing(),this.refreshDebugState(e)}tick(){this.refreshDebugState(!1)}getLine(e){return this.editor.state.doc.line(e).text}getCurrentLine(){let e=this.editor.state.selection.main.head;return this.editor.state.doc.lineAt(e).number}getCursorPC(){for(var e=this.getCurrentLine();this.sourcefile&&e>=0;){var t=this.sourcefile.line2offset[e];if(t>=0)return t;e--}return-1}undoStep(){tf(this.editor)}redoStep(){dl(this.editor)}getBreakpointPCs(){if(this.sourcefile==null)return[];let e=[],r=this.editor.state.field(Zf.field).iter();for(;r.value;){let n=this.editor.state.doc.lineAt(r.from).number,s=this.sourcefile.line2offset[n];s>=0&&e.push(s),r.next()}return e}runToBreakpoints(e){let t=this.getBreakpointPCs();t.length>0?Ws(t):uo()}},Dm=1024,Yl=class{createDiv(e){var t=document.createElement("div");return t.setAttribute("class","editor"),e.appendChild(t),this.newEditor(t),t}newEditor(e){this.disasmview=new ne({parent:e,extensions:[vd(),xd(),it.allowMultipleSelections.of(!0),Sd(),Qd(),$m(),gw?Ym:[],qy,Cm,Al.field,it.tabSize.of(8),it.readOnly.of(!0)]})}refresh(e){let t=zn||L.saveState(),r=t.c?t.c.PC:0,n=0,s=0,o=L.debugSymbols&&L.debugSymbols.addr2symbol||{},a=(f,O)=>{let m="",b=0;for(;b<O;){let v=f+b|0,P=L.disassemble(v,L.readAddress.bind(L)),T="",Y="";for(let N=0;N<P.nbytes;N++)T+=ht(L.readAddress(v+N));for(;T.length<14;)T+=" ";let B=P.line;if(o&&P.isaddr&&(B=B.replace(/([^#])[$]([0-9A-F]+)/,(N,...M)=>{let d=parseInt(M[1],16),j=o[d];return j?M[0]+j:(j=o[d-1],j?M[0]+j+"+1":N)})),o){let N=o[v];N&&(Y="; "+N)}let q=ht(v,4)+" "+ba(T,14)+" "+ba(B,30)+Y+`
`;m+=q,v==r&&(s=n),n++,b+=P.nbytes||1}return m};var l=r<0?r-Dm:Math.max(0,r-Dm);let h=a(l,r-l)+a(r,Dm);if(this.disasmview.dispatch({changes:{from:0,to:this.disasmview.state.doc.length,insert:h}}),e){let f=this.disasmview.state.doc.line(s+1);this.disasmview.dispatch({selection:{anchor:f.from,head:f.from},effects:ne.scrollIntoView(f.from,{y:"center"})})}}getCursorPC(){let e=this.disasmview.state.selection.main.head,t=this.disasmview.state.doc.lineAt(e).number;if(t>=0){let n=this.disasmview.state.doc.line(t).text.trim().split(/\s+/);if(n&&n.length>=1){let s=parseInt(n[0],16);if(console.log("getCursorPC",s),s>=0)return s}}return-1}},Lf=class extends Yl{constructor(e){super(),this.path=e}refreshListing(){var e=ze.getListingForFile(this.path);this.assemblyfile=e&&(e.assemblyfile||e.sourcefile)}refresh(e){if(this.refreshListing(),!!this.assemblyfile){var t=this.assemblyfile.text;if(this.disasmview.dispatch({changes:{from:0,to:this.disasmview.state.doc.length,insert:t}}),!!L.saveState){var r=zn||L.saveState(),n=r.c?r.c.EPC||r.c.PC:0;if(n>=0&&this.assemblyfile){var s=this.assemblyfile.findLineForOffset(n,Mf);if(s&&e){let o=this.disasmview.state.doc.line(s.line);this.disasmview.dispatch({selection:{anchor:o.from,head:o.from},effects:ne.scrollIntoView(o.from,{y:"center"})})}}}}}};var El=256,bw=100,Sw=!1,Vf=class i{constructor(e,t){this.expanded=!1;this.parent=e,this.name=t,this.children=new Map,this.level=e?e.level+1:-1,this.view=e?e.view:null}getDiv(){return this._div==null&&(this._div=document.createElement("div"),this._div.classList.add("vertical-scroll"),this._div.classList.add("tree-content"),this._header=document.createElement("div"),this._header.classList.add("tree-header"),this._header.classList.add("tree-level-"+this.level),this._header.append(this.name),this._inline=document.createElement("span"),this._inline.classList.add("tree-value"),this._header.append(this._inline),this._div.append(this._header),this.parent._content.append(this._div),this._header.onclick=e=>{this.toggleExpanded()}),this.expanded&&this._content==null?(this._content=document.createElement("div"),this._div.append(this._content)):!this.expanded&&this._content!=null&&(this._content.remove(),this._content=null,this.children.clear()),this._div}toggleExpanded(){this.expanded=!this.expanded,this.view.tick()}remove(){this._div.remove(),this._div=null}update(e){this.getDiv();var t="";if(e&&e.$$&&typeof e.$$=="function"&&this._content!=null&&(e=e.$$()),e==null)t=e+"";else if(typeof e=="number")e!=(e|0)?t=e.toString():t=e+" ($"+ht(e)+")";else if(typeof e=="boolean")t=e.toString();else if(typeof e=="string")e.length<bw?t=e:t=e.substring(0,bw)+"...";else if(e.buffer&&e.length<=El)t=Pg(e,0,e.length);else if(typeof e=="object"||typeof e=="function")if(this._content!=null){if(e.slice&&e.length>El){let l={},h=e;for(var r=El;e.length/r>El;)r*=2;for(let f=0;f<h.length;f+=r)l["$"+ht(f)]={$$:()=>h.slice(f,f+r)};e=l}if(e instanceof Map){let l={};for(let[h,f]of e.entries())l[h]=f;e=l}let o=e instanceof Array?Array.from(e.keys()):Object.getOwnPropertyNames(e);if(o.length>El){let l={},h=e;for(var r=100;o.length/r>100;)r*=2;for(let O=0;O<o.length;O+=r){for(var n={},s=O;s<O+r;s++)n[o[s]]=h[o[s]];l["["+O+"...]"]=n}e=l,o=Object.getOwnPropertyNames(e)}let a=new Set(this.children.keys());o.forEach(l=>{var h=!Sw&&typeof l=="string"&&l.startsWith("$$");if(!h){let f=this.children.get(l);f==null&&(f=new i(this,l),this.children.set(l,f)),f.update(e[l])}a.delete(l)}),a.forEach(l=>{this.children.get(l).remove(),this.children.delete(l)}),this._header.classList.add("tree-expanded"),this._header.classList.remove("tree-collapsed")}else this._header.classList.add("tree-collapsed"),this._header.classList.remove("tree-expanded");else t=typeof e;this._inline.innerText!=t&&(this._inline.innerText=t)}};function Qw(i,e){var t=new Vf(null,null);t.view=e,t._content=i;var r=new Vf(t,"/");return r.expanded=!0,r.getDiv(),r._div.style.padding="0px",r}var Wm=class{createDiv(e){return this.root=Qw(e,this),this.root.getDiv()}refresh(){this.tick()}tick(){this.root.update(this.getRootObject())}};var Df=class extends Wm{getRootObject(){return L.getDebugTree()}},Wf=class extends Jn{constructor(){super(...arguments);this.cumulativeData=!0}createDiv(t){return this.clear(),this.treeroot=Qw(t,this),this.treeroot.getDiv()}refresh(){this.tick()}tick(){this.treeroot.update(this.getRootObject()),this.probe&&this.probe.clear()}clear(){this.graph=null,this.reset()}reset(){this.stack=[],this.lastsp=-1,this.lastpc=0,this.jsr=!1,this.rts=!1}newNode(t,r){return{$$SP:r,$$PC:t,count:0,startLine:null,endLine:null,calls:{}}}newRoot(t,r){this.stack.length==0?(this.graph=this.newNode(null,r),this.stack.unshift(this.graph)):r>this.stack[0].$$SP&&(this.graph=this.newNode(null,r),this.graph.calls[this.addr2str(t)]=this.stack[0],this.stack.unshift(this.graph))}getRootObject(){return this.redraw((t,r,n,s,o,a)=>{switch(t){case 184549376:this.newRoot(this.lastpc,this.lastsp);case 167772160:if(this.stack.length){let h=this.st Line truncated
`,await Uw(i),ye.newfile?!r&&!t?Ge('No build tool for "'+i+'" on this platform; project will not build.'):r?ag(!0,!0):Li("No skeleton file for "+t+" on this platform; using blank file."):Li('Could not find file "'+i+'"<br><br>Creating new '+(r?t:"blank")+" file."),delete ye.newfile,iu()}}function lg(i){if(i=="/")ye={repo:"/"};else if(i.indexOf("://")>=0){var e=va(i);e&&(ye={repo:e.repopath})}else ye.platform=Re,ye.file=i;Ms()}async function LA(i){var e=L.getToolForFilename(i);try{return await $.get("presets/"+Qi(Re)+"/skeleton."+e,"text")}catch(t){return console.log(t+""),null}}function cg(i){return i.indexOf(" ")>=0?(Ge("No spaces in filenames, please."),!1):!0}async function MA(i){var e=Qi(Re),t={},r=[];for(var n of i){var s=L.getToolForFilename("test"+n);t[s]||(t[s]=[],r.push(s)),t[s].push(n)}var o=r.map(f=>$.ajax({url:"presets/"+e+"/skeleton."+f,type:"HEAD"}).then(()=>f,()=>null)),a=await Promise.all(o),l=[];for(var h of a)h!=null&&l.push({tool:h,extensions:t[h]});return l}async function VA(i){var e=await MA(L.getDefaultExtensions()),t,r;return e.length===0?(t=L.getDefaultExtensions(),r=t.join(" ")):(t=e.reduce((n,s)=>n.concat(s.extensions),[]),r=e.map(n=>n.extensions.join(" ")).join("<br>")),bootbox.prompt({title:"Enter the name of your new main source file.<br><br><span class='dialog-help'>"+r+"</span>",placeholder:"newfile"+t[0],callback:n=>{if(n&&n.trim().length>0){if(!cg(n))return;n.indexOf(".")<0&&(n+=t[0]);var s=n;Us("workspace","file","new"),ye.newfile="1",lg(s)}}}),!0}function DA(i){let e=$('<input type="file" multiple accept="*" style="display:none">'),t=e[0];e.change(r=>{WA(t.files)}),e.click()}function WA(i){console.log(i);var e=0;function t(){var r=i[e++];if(!r)console.log("Done uploading",e),e>2?(Li("Files uploaded."),setTimeout(Il,1e3)):(ye.file=i[0].name,bootbox.confirm({message:"Open '"+mo.sanitize(ye.file)+"' as main project file?",buttons:{confirm:{label:"Open As New Project"},cancel:{label:"Include/Link With Project Later"}},callback:o=>{o?Ms():setTimeout(Il,1e3)}})),Us("workspace","file","upload");else{var n=r.name,s=new FileReader;s.onload=function(o){var a=o.target.result,l=new Uint8Array(a);Es(n,l)||(l=sc(l).replace(`\r
`,t.className="cm-line",t}},Ow=Ce.define(),eA=ot.define({create(){return de.none},update(i,e){i=i.map(e.changes);for(let t of e.effects)if(t.is(Ow)){if(t.value===null||!t.value)return de.none;let r=e.state.doc.lineAt(t.value.range.to);return de.set([de.widget({widget:new Lm(t.value.val),block:!0,side:1}).range(r.to)])}return i},provide:i=>ne.decorations.from(i)}),dw=Ce.define(),tA=de.mark({attributes:{class:"cm-error-span"}}),iA=ot.define({create(){return de.none},update(i,e){i=i.map(e.changes);for(let t of e.effects)if(t.is(dw)){if(t.value===null)return de.none;let r=[];for(let n of t.value)try{let s=e.state.doc.line(n.line),o=s.from+n.start,a=s.from+n.end;o>=s.from&&a<=s.to&&o<a&&r.push(tA.range(o,a))}catch(s){}return de.set(r,!0)}return i},provide:i=>ne.decorations.from(i)}),pw=Ce.define(),rA=de.line({attributes:{class:"highlight-lines"}}),nA=ot.define({create(){return de.none},update(i,e){i=i.map(e.changes);for(let t of e.effects)if(t.is(pw)){if(t.value===null)return de.none;let{start:r,end:n}=t.value,s=[];for(let o=r;o<=n;o++)try{let a=e.state.doc.line(o);s.push(rA.range(a.from))}catch(a){}return de.set(s)}return i!==de.none&&(e.docChanged||e.selection)?de.none:i},provide:i=>ne.decorations.from(i)}),mw={field:J2,widget:Cl},Al={effect:fw,decoration:uw,field:K2},Uf={effect:Ow,field:eA},zf={effect:dw,field:iA},Mm={effect:pw,field:nA};var gw=!1,Mf=64,sA=200,Vm={default:{theme:Am},6502:{isAsm:!0},z80:{isAsm:!0},jsasm:{isAsm:!0},gas:{isAsm:!0},vasm:{isAsm:!0},inform6:{theme:Cm},markdown:{lineWrap:!0},fastbasic:{noGutters:!0},basic:{noLineNumbers:!0,noGutters:!0},ecs:{theme:Am,isAsm:!0}},oA={input:null},fo=class{constructor(e,t){this.updateTimer=null;this.dirtylisting=!0;this.refreshDelayMsec=300;this.path=e,this.mode=t}createDiv(e){var t=document.createElement("div");t.setAttribute("class","editor"),e.appendChild(t);var r=ze.getFile(this.path),n=r&&this.mode=="verilog"&&/__asm\b([\s\S]+?)\b__endasm\b/.test(r);return this.newEditor(t,r,n),this.editor.dispatch({effects:Ix(oA)}),ze.getToolForFilename(this.path).startsWith("remote:")&&(this.refreshDelayMsec=1e3),t}setVisible(e){e&&this.editor.focus()}newEditor(e,t,r){var n=Vm[this.mode]||Vm.default,s=r||n.isAsm,o=!!n.lineWrap,a=n.theme||Vm.default.theme,l=!n.noLineNumbers&&!wa;xe.embed&&(l=!1,s=!1);let h=n.noGutters||wa;var f;switch(this.mode){case"6502":f=Ex();break;case"basic":f=Zx();break;case"bataribasic":f=Ux();break;case"fastbasic":f=zx();break;case"inform6":f=Lx();break;case"markdown":f=vx();break;case"text/x-csrc":f=Pv();break;case"text/x-wiz":f=Vx();break;case"verilog":f=Mx();break;case"z80":f=Wx();break;default:console.warn("Unknown mode: "+this.mode);break}this.editor=new ne({parent:e,doc:t,extensions:[Dr.of([{key:"Backspace",run:PQ}]),Dr.of(dv),l?TS():[],QS(),LQ(),Dr.of(DQ),sQ(),SS(),it.allowMultipleSelections.of(!0),Sd(),tQ(),hQ(),xQ(),vd(),yd(),Qd(),XS(),$m(),kx({top:!0}),Dr.of(Cx),f||[],a,jx,gw?Ym:[],it.tabSize.of(8),bn.of(" "),Dr.of(hw),o?ne.lineWrapping:[],Al.field,h?[]:[Yf.field,Yf.gutter],s&&!h?[Rl.field,Rl.gutter,Ef.field,Ef.gutter]:[],Zf.field,ow.gutter,ne.updateListener.of(O=>{for(let m of O.transactions.flatMap(b=>b.effects))if(m.is(Zf.set)&&L.isRunning()&&this.runToBreakpoints(O.state),m.is(ca.runToLine)){let b=m.value;if(this.sourcefile&&this.sourcefile.line2offset){let v=this.sourcefile.line2offset[b];v>=0&&Ws([v])}}}),ho.field,mw.field,zf.field,ca.field,ca.gutter,Mm.field,cw(O=>{window.location.hash="asseteditor/"+encodeURIComponent(this.path)+"/"+O}),Em.of([]),ne.updateListener.of(O=>{O.docChanged&&this.editorChanged()}),Uf.field,ne.updateListener.of(O=>{O.selectionSet&&this.inspectUnderCursor(O)})]})}editorChanged(){clearTimeout(this.updateTimer),this.updateTimer=setTimeout(()=>{ze.updateFile(this.path,this.editor.state.doc.toString())},this.refreshDelayMsec)}inspectUnderCursor(e){let t=e.state.selection.main,r=e.state.sliceDoc(t.from,t.to).trim();var n;L.inspect&&(n=L.inspect(r)),!t.empty&&n&&n.length<80?e.view.dispatch({effects:Uf.effect.of({range:t,val:n})}):e.view.dispatch({effects:Uf.effect.of(null)})}setText(e){var t=this.editor.state.doc.toString();t!=e&&this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,insert:e},annotations:Jh.of("full")})}replaceTextRange(e,t,r){let n=this.editor.state.doc.lineAt(e).number,s=this.editor.state.doc.lineAt(t).number;this.editor.dispatch({changes:{from:e,to:t,insert:r},annotations:Jh.of("full"),selection:{anchor:e,head:t},effects:[ne.scrollIntoView(this.editor.state.doc.line(n).from,{y:"start",yMargin:100})]})}insertLinesBefore(e){let t=this.editor.state.selection.main.from,r=this.editor.state.doc.lineAt(t).number,n=this.editor.state.doc.lineAt(t).from,s=e.split(`
`).length-1;this.editor.dispatch({changes:{from:n,insert:e}}),this.highlightLines(r-1,r+s-2)}highlightLines(e,t){let r=this.editor.state.doc.line(e+1);this.editor.dispatch({effects:[Mm.effect.of({start:e+1,end:t+1}),ne.scrollIntoView(r.from,{y:"start",yMargin:100})]})}getValue(){return this.editor.state.doc.toString()}getPath(){return this.path}markErrors(e){this.clearErrors(),e=e.slice(0,sA);let t=new Map,r=[];for(var n of e)if(!n.path||this.path.endsWith(n.path)){var s=this.editor.state.doc.lines,o=n.line;(isNaN(o)||o<1||o>s)&&(o=1),t.set(o,n.msg),n.start!=null&&n.end!=null&&n.end>n.start&&r.push({line:o,start:n.start,end:n.end})}this.editor.dispatch({effects:[ho.set.of(t),zf.effect.of(r.length>0?r:null)]})}clearErrors(){this.dirtylisting=!0,this.editor.dispatch({effects:[ho.set.of(new Map),ho.showMessage.of(null),zf.effect.of(null)]})}getSourceFile(){return this.sourcefile}updateListing(){this.clearErrors();var e=this.sourcefile.lines||[];let t=new Map,r=new Map,n=new Map;for(var s of e)if(s.offset>=0&&t.set(s.line,ht(s.offset&65535,4)),s.insns){var o=s.insns.length>9?"...":s.insns;if(r.set(s.line,o),s.iscode){if(s.cycles)n.set(s.line,s.cycles+"");else if(L.getOpcodeMetadata){var a=parseInt(s.insns.split(" ")[0],16),l=L.getOpcodeMetadata(a,s.offset);if(l&&l.minCycles){var h=l.minCycles+"";n.set(s.line,h)}}}}this.editor.dispatch({effects:[Yf.set.of(t),Rl.set.of(r),Ef.set.of(n)]})}setTimingResult(e){if(this.sourcefile!=null){var t=new Map;for(let o of Object.keys(this.sourcefile.line2offset)){let a=this.sourcefile.line2offset[o],l=e.pc2clockrange[a];var r=l&&l.minclocks,n=l&&l.maxclocks;if(r>=0&&n>=0){var s;n==r?s=r+"":s=r+"-"+n,n==e.MAX_CLOCKS&&(s+="+"),t.set(parseInt(o),s)}}this.editor.dispatch({effects:[Rl.set.of(t)]})}}setCurrentLine(e,t){var r=n=>{this.editor.dispatch({effects:[ca.set.of(n.line),Al.effect.of(n.line),ne.scrollIntoView(this.editor.state.doc.line(n.line).from,{y:"center"})]})};if(this.clearCurrentLine(t),e){if(e.line<1||e.line>this.editor.state.doc.lines)return!1;if(r(e),t){let s=this.editor.state.doc.line(e.line).from+(e.start||0);this.editor.dispatch({selection:{anchor:s,head:s},effects:ne.scrollIntoView(s,{y:"center"})})}return this.currentDebugLine=e,!0}}clearCurrentLine(e){if(this.currentDebugLine){if(e){let t=this.editor.state.selection.main.head;this.editor.dispatch({selection:{anchor:t,head:t}})}this.currentDebugLine=null}this.editor.dispatch({effects:[ca.set.of(null),Al.effect.of(null)]})}getActiveLine(){if(this.sourcefile){var e=zn&&zn.c;if(!e&&L.getCPUState&&!L.isRunning()&&(e=L.getCPUState()),e){var t=e&&(e.EPC||e.PC),r=this.sourcefile.findLineForOffset(t,Mf);return r}}}refreshDebugState(e){this.clearCurrentLine(e);var t=this.getActiveLine();t&&this.setCurrentLine(t,e)}refreshListing(){var e=ze.getListingForFile(this.path);e&&e.sourcefile&&e.sourcefile!==this.sourcefile&&(this.sourcefile=e.sourcefile,this.dirtylisting=!0),!(!this.sourcefile||!this.dirtylisting)&&(this.updateListing(),this.dirtylisting=!1)}refresh(e){this.refreshListing(),this.refreshDebugState(e)}tick(){this.refreshDebugState(!1)}getLine(e){return this.editor.state.doc.line(e).text}getCurrentLine(){let e=this.editor.state.selection.main.head;return this.editor.state.doc.lineAt(e).number}getCursorPC(){for(var e=this.getCurrentLine();this.sourcefile&&e>=0;){var t=this.sourcefile.line2offset[e];if(t>=0)return t;e--}return-1}undoStep(){tf(this.editor)}redoStep(){dl(this.editor)}getBreakpointPCs(){if(this.sourcefile==null)return[];let e=[],r=this.editor.state.field(Zf.field).iter();for(;r.value;){let n=this.editor.state.doc.lineAt(r.from).number,s=this.sourcefile.line2offset[n];s>=0&&e.push(s),r.next()}return e}runToBreakpoints(e){let t=this.getBreakpointPCs();t.length>0?Ws(t):uo()}},Dm=1024,Yl=class{createDiv(e){var t=document.createElement("div");return t.setAttribute("class","editor"),e.appendChild(t),this.newEditor(t),t}newEditor(e){this.disasmview=new ne({parent:e,extensions:[vd(),yd(),it.allowMultipleSelections.of(!0),Sd(),Qd(),$m(),gw?Ym:[],qx,Cm,Al.field,it.tabSize.of(8),it.readOnly.of(!0)]})}refresh(e){let t=zn||L.saveState(),r=t.c?t.c.PC:0,n=0,s=0,o=L.debugSymbols&&L.debugSymbols.addr2symbol||{},a=(f,O)=>{let m="",b=0;for(;b<O;){let v=f+b|0,P=L.disassemble(v,L.readAddress.bind(L)),X="",Y="";for(let N=0;N<P.nbytes;N++)X+=ht(L.readAddress(v+N));for(;X.length<14;)X+=" ";let G=P.line;if(o&&P.isaddr&&(G=G.replace(/([^#])[$]([0-9A-F]+)/,(N,...V)=>{let d=parseInt(V[1],16),j=o[d];return j?V[0]+j:(j=o[d-1],j?V[0]+j+"+1":N)})),o){let N=o[v];N&&(Y="; "+N)}let q=ht(v,4)+" "+ba(X,14)+" "+ba(G,30)+Y+`
`;m+=q,v==r&&(s=n),n++,b+=P.nbytes||1}return m};var l=r<0?r-Dm:Math.max(0,r-Dm);let h=a(l,r-l)+a(r,Dm);if(this.disasmview.dispatch({changes:{from:0,to:this.disasmview.state.doc.length,insert:h}}),e){let f=this.disasmview.state.doc.line(s+1);this.disasmview.dispatch({selection:{anchor:f.from,head:f.from},effects:ne.scrollIntoView(f.from,{y:"center"})})}}getCursorPC(){let e=this.disasmview.state.selection.main.head,t=this.disasmview.state.doc.lineAt(e).number;if(t>=0){let n=this.disasmview.state.doc.line(t).text.trim().split(/\s+/);if(n&&n.length>=1){let s=parseInt(n[0],16);if(console.log("getCursorPC",s),s>=0)return s}}return-1}},Lf=class extends Yl{constructor(e){super(),this.path=e}refreshListing(){var e=ze.getListingForFile(this.path);this.assemblyfile=e&&(e.assemblyfile||e.sourcefile)}refresh(e){if(this.refreshListing(),!!this.assemblyfile){var t=this.assemblyfile.text;if(this.disasmview.dispatch({changes:{from:0,to:this.disasmview.state.doc.length,insert:t}}),!!L.saveState){var r=zn||L.saveState(),n=r.c?r.c.EPC||r.c.PC:0;if(n>=0&&this.assemblyfile){var s=this.assemblyfile.findLineForOffset(n,Mf);if(s&&e){let o=this.disasmview.state.doc.line(s.line);this.disasmview.dispatch({selection:{anchor:o.from,head:o.from},effects:ne.scrollIntoView(o.from,{y:"center"})})}}}}}};var El=256,bw=100,Sw=!1,Vf=class i{constructor(e,t){this.expanded=!1;this.parent=e,this.name=t,this.children=new Map,this.level=e?e.level+1:-1,this.view=e?e.view:null}getDiv(){return this._div==null&&(this._div=document.createElement("div"),this._div.classList.add("vertical-scroll"),this._div.classList.add("tree-content"),this._header=document.createElement("div"),this._header.classList.add("tree-header"),this._header.classList.add("tree-level-"+this.level),this._header.append(this.name),this._inline=document.createElement("span"),this._inline.classList.add("tree-value"),this._header.append(this._inline),this._div.append(this._header),this.parent._content.append(this._div),this._header.onclick=e=>{this.toggleExpanded()}),this.expanded&&this._content==null?(this._content=document.createElement("div"),this._div.append(this._content)):!this.expanded&&this._content!=null&&(this._content.remove(),this._content=null,this.children.clear()),this._div}toggleExpanded(){this.expanded=!this.expanded,this.view.tick()}remove(){this._div.remove(),this._div=null}update(e){this.getDiv();var t="";if(e&&e.$$&&typeof e.$$=="function"&&this._content!=null&&(e=e.$$()),e==null)t=e+"";else if(typeof e=="number")e!=(e|0)?t=e.toString():t=e+" ($"+ht(e)+")";else if(typeof e=="boolean")t=e.toString();else if(typeof e=="string")e.length<bw?t=e:t=e.substring(0,bw)+"...";else if(e.buffer&&e.length<=El)t=Pg(e,0,e.length);else if(typeof e=="object"||typeof e=="function")if(this._content!=null){if(e.slice&&e.length>El){let l={},h=e;for(var r=El;e.length/r>El;)r*=2;for(let f=0;f<h.length;f+=r)l["$"+ht(f)]={$$:()=>h.slice(f,f+r)};e=l}if(e instanceof Map){let l={};for(let[h,f]of e.entries())l[h]=f;e=l}let o=e instanceof Array?Array.from(e.keys()):Object.getOwnPropertyNames(e);if(o.length>El){let l={},h=e;for(var r=100;o.length/r>100;)r*=2;for(let O=0;O<o.length;O+=r){for(var n={},s=O;s<O+r;s++)n[o[s]]=h[o[s]];l["["+O+"...]"]=n}e=l,o=Object.getOwnPropertyNames(e)}let a=new Set(this.children.keys());o.forEach(l=>{var h=!Sw&&typeof l=="string"&&l.startsWith("$$");if(!h){let f=this.children.get(l);f==null&&(f=new i(this,l),this.children.set(l,f)),f.update(e[l])}a.delete(l)}),a.forEach(l=>{this.children.get(l).remove(),this.children.delete(l)}),this._header.classList.add("tree-expanded"),this._header.classList.remove("tree-collapsed")}else this._header.classList.add("tree-collapsed"),this._header.classList.remove("tree-expanded");else t=typeof e;this._inline.innerText!=t&&(this._inline.innerText=t)}};function Qw(i,e){var t=new Vf(null,null);t.view=e,t._content=i;var r=new Vf(t,"/");return r.expanded=!0,r.getDiv(),r._div.style.padding="0px",r}var Wm=class{createDiv(e){return this.root=Qw(e,this),this.root.getDiv()}refresh(){this.tick()}tick(){this.root.update(this.getRootObject())}};var Df=class extends Wm{getRootObject(){return L.getDebugTree()}},Wf=class extends Jn{constructor(){super(...arguments);this.cumulativeData=!0}createDiv(t){return this.clear(),this.treeroot=Qw(t,this),this.treeroot.getDiv()}refresh(){this.tick()}tick(){this.treeroot.update(this.getRootObject()),this.probe&&this.probe.clear()}clear(){this.graph=null,this.reset()}reset(){this.stack=[],this.lastsp=-1,this.lastpc=0,this.jsr=!1,this.rts=!1}newNode(t,r){return{$$SP:r,$$PC:t,count:0,startLine:null,endLine:null,calls:{}}}newRoot(t,r){this.stack.length==0?(this.graph=this.newNode(null,r),this.stack.unshift(this.graph)):r>this.stack[0].$$SP&&(this.graph=this.newNode(null,r),this.graph.calls[this.addr2str(t)]=this.stack[0],this.stack.unshift(this.graph))}getRootObject(){return this.redraw((t,r,n,s,o,a)=>{switch(t){case 184549376:this.newRoot(this.lastpc,this.lastsp);case 167772160:if(this.stack.length){let h=this.st Line truncated
`,await Uw(i),xe.newfile?!r&&!t?Ge('No build tool for "'+i+'" on this platform; project will not build.'):r?ag(!0,!0):Li("No skeleton file for "+t+" on this platform; using blank file."):Li('Could not find file "'+i+'"<br><br>Creating new '+(r?t:"blank")+" file."),delete xe.newfile,iu()}}function lg(i){if(i=="/")xe={repo:"/"};else if(i.indexOf("://")>=0){var e=va(i);e&&(xe={repo:e.repopath})}else xe.platform=Re,xe.file=i;Ms()}async function LA(i){var e=L.getToolForFilename(i);try{return await $.get("presets/"+Qi(Re)+"/skeleton."+e,"text")}catch(t){return console.log(t+""),null}}function cg(i){return i.indexOf(" ")>=0?(Ge("No spaces in filenames, please."),!1):!0}async function MA(i){var e=Qi(Re),t={},r=[];for(var n of i){var s=L.getToolForFilename("test"+n);t[s]||(t[s]=[],r.push(s)),t[s].push(n)}var o=r.map(f=>$.ajax({url:"presets/"+e+"/skeleton."+f,type:"HEAD"}).then(()=>f,()=>null)),a=await Promise.all(o),l=[];for(var h of a)h!=null&&l.push({tool:h,extensions:t[h]});return l}async function VA(i){var e=await MA(L.getDefaultExtensions()),t,r;return e.length===0?(t=L.getDefaultExtensions(),r=t.join(" ")):(t=e.reduce((n,s)=>n.concat(s.extensions),[]),r=e.map(n=>n.extensions.join(" ")).join("<br>")),bootbox.prompt({title:"Enter the name of your new main source file.<br><br><span class='dialog-help'>"+r+"</span>",placeholder:"newfile"+t[0],callback:n=>{if(n&&n.trim().length>0){if(!cg(n))return;n.indexOf(".")<0&&(n+=t[0]);var s=n;Us("workspace","file","new"),xe.newfile="1",lg(s)}}}),!0}function DA(i){let e=$('<input type="file" multiple accept="*" style="display:none">'),t=e[0];e.change(r=>{WA(t.files)}),e.click()}function WA(i){console.log(i);var e=0;function t(){var r=i[e++];if(!r)console.log("Done uploading",e),e>2?(Li("Files uploaded."),setTimeout(Il,1e3)):(xe.file=i[0].name,bootbox.confirm({message:"Open '"+mo.sanitize(xe.file)+"' as main project file?",buttons:{confirm:{label:"Open As New Project"},cancel:{label:"Include/Link With Project Later"}},callback:o=>{o?Ms():setTimeout(Il,1e3)}})),Us("workspace","file","upload");else{var n=r.name,s=new FileReader;s.onload=function(o){var a=o.target.result,l=new Uint8Array(a);Es(n,l)||(l=sc(l).replace(`\r
`,`
`)),ke.updateFile(n,l),console.log("Uploaded "+n+" "+l.length+" bytes"),t()},s.readAsArrayBuffer(r)}}i&&t()}async function qA(i){var e=window.showDirectoryPicker;e||Ge("This browser can't open local files on your computer, yet. Try Chrome.");var t=await e(),r=t.name,n="__localfs__"+r,s={handle:t},o=sg.createInstance({name:n,version:2});await o.setItem(n,s),ye={localfs:r},Ms(!0)}async function jA(i){return new Promise((e,t)=>{bootbox.prompt(mo.sanitize(i),r=>{e(r)})})}async function IA(i){let e={mode:"readwrite"};var t="__localfs__"+i,r=sg.createInstance({name:t,version:2}),n=await r.getItem(t),s=n.handle;console.log(n,s);var o=await s.queryPermission(e);if(console.log(o),o!=="granted"&&(await jA("Request permissions to access filesystem?"),o=await s.requestPermission(e)),o!=="granted"){Ge("Could not get permission to access filesystem.");return}return{getFileData:async a=>{console.log("getFileData",a);let l=await s.getFileHandle(a,{create:!1});console.log("getFileData",l);let h=await l.getFile();console.log("getFileData",h);let f=await(Es(a)?h.binary():h.text());return console.log(l,h,f),f},setFileData:async(a,l)=>{}}}function jt(){return li(ze.mainPath)}function Bg(){return li(ke.getActiveID())}function NA(i){var e=ke.getActive();if(e&&e.setText){var t=ke.getActiveID();$.get("presets/"+Qi(Re)+"/"+t,r=>{bootbox.confirm("Reset '"+mo.sanitize(t)+"' to default?",n=>{n&&e.setText(r)})},"text").fail(()=>{Zt?Ge("Can only revert built-in examples. If you want to revert all files, You can pull from the repository."):Ge("Can only revert built-in examples.")})}else Ge("Cannot revert the active window. Please choose a text file.")}function BA(i){var e=ke.getActive();if(e&&e.getPath){var t=ke.getActiveID();bootbox.confirm("Delete '"+mo.sanitize(t)+"'?",r=>{r&&wr.removeItem(t).then(()=>{ye.file==t?(go.unsetLastPreset(),Ms()):(Il(),Li("Deleted "+t))})})}else Ge("Cannot delete the active window.")}function GA(i){var e=ke.getActive();if(e&&e.getPath&&ze.getFile(e.getPath())){var t=ke.getActiveID();bootbox.prompt({title:"Rename '"+mo.sanitize(t)+"' to?",value:t,callback:r=>{var n=ze.getFile(e.getPath());if(r&&r!=t&&n){if(!cg(r))return;wr.removeItem(t).then(()=>wr.setItem(r,n)).then(()=>{Il(),alert("Renamed "+t+" to "+r),t==ze.mainPath&&lg(r)})}}})}else Ge("Cannot rename the active window.")}function FA(i){let e={},t,r=L.getPresets?L.getPresets():[];for(var n=0;n<r.length;n++){var s=r[n],o=s.chapter?s.chapter+". "+s.name:s.name,a=s.id==ze.mainPath;s.category?t=$("<optgroup />").attr("label","Examples: "+s.category).appendTo(i):t||(t=$("<optgroup />").attr("label","Examples").appendTo(i)),t.append($("<option />").val(s.id).text(o).attr("selected",a?"selected":null)),a&&(Gf=s),e[s.id]=o}return e}function HA(i){if(yr&&!Nl){var e=0,t=Xo();if(t){let n=$("<optgroup />").attr("label","Repositories").appendTo(i);for(let s in t){var r=t[s];r.platform_id&&Qi(r.platform_id)==Qi(Re)&&n.append($("<option />").val(r.url).text(r.url.substring(r.url.indexOf("/"))))}}}}async function zw(i,e,t,r){let n=await wr.keys();n||(n=[]);let s;for(var o=0;o<n.length;o++){let a=n[o];if(a.startsWith(t)&&!r[a]){s||(s=$("<optgroup />").attr("label",e).appendTo(i));let l=a.substring(t.length);s.append($("<option />").val(a).text(l).attr("selected",a==ze.mainPath?"selected":null))}}}function Lw(i){i.css("visibility","visible");var e=ze.mainPath;i.val()!=e&&i.append($("<option />").val(e).text(e).attr("selected","selected"))}async function Il(){var i=$("#preset_select").empty();if(Zt)i.append($("<option />").val("/").text("Leave Repository")),$("#repo_name").text(li(Zt)+"/").show(),await zw(i,Zt,"",{}),Lw(i);else{HA(i);var e=FA(i);await zw(i,"Local Files","",e),Lw(i)}i.off("change").change(function(t){lg($(this).val().toString())})}function KA(i){var e=$("<p/>");if(i.path!=null){var t=i.line?i.label?`(${i.path} @ ${i.label})`:`(${i.path}:${i.line})`:`(${i.path})`,r=$("<a/>").text(t),n=i.path;n==jt()&&(n=ze.mainPath),ke.isWindow(n)&&r.click(s=>{var o=ke.createOrShow(n);o instanceof fo&&o.setCurrentLine(i,!0)}),e.append(r),e.append("&nbsp;")}return e.append($("<span/>").text(i.msg)),e}function Ww(){$("#error_alert").hide(),og=!1}function hg(i,e){var t=$("#error_alert_msg").empty();for(var r of i.slice(0,10))t.append(KA(r));$("#error_alert").show(),og=e}function qw(i,e){if(e!=null){var t={msg:e,line:0};i instanceof wu&&i.$loc&&(t=Object.create(i.$loc),t.msg=e,console.log(t)),hg([t],!0)}}async function JA(i){if("errors"in i&&i.errors.length>0)Wl.addClass("has-errors"),ke.setErrors(i.errors),ql(),hg(i.errors,!1);else{if(Wl.removeClass("has-errors"),ke.setErrors(null),Ww(),i==null||"unchanged"in i&&i.unchanged||!("output"in i))return;L.debugSymbols=new Tg(i.symbolmap,i.debuginfo),Mw=i.params;var e=i.output;if(e!=null)try{uo(),Gw(),await L.loadROM(AA(),e),po=e,Kf||Mn(),jY()}catch(t){console.log(t),Wl.addClass("has-errors"),qw(t,t+""),po=null,ql();return}ql(),ke.refresh(!1)}}async function eY(){if(L.loadBIOS){var i=Re+".rom",e=await wr.getItem(i);e instanceof Uint8A Line truncated
`)),ke.updateFile(n,l),console.log("Uploaded "+n+" "+l.length+" bytes"),t()},s.readAsArrayBuffer(r)}}i&&t()}async function qA(i){var e=window.showDirectoryPicker;e||Ge("This browser can't open local files on your computer, yet. Try Chrome.");var t=await e(),r=t.name,n="__localfs__"+r,s={handle:t},o=sg.createInstance({name:n,version:2});await o.setItem(n,s),xe={localfs:r},Ms(!0)}async function jA(i){return new Promise((e,t)=>{bootbox.prompt(mo.sanitize(i),r=>{e(r)})})}async function IA(i){let e={mode:"readwrite"};var t="__localfs__"+i,r=sg.createInstance({name:t,version:2}),n=await r.getItem(t),s=n.handle;console.log(n,s);var o=await s.queryPermission(e);if(console.log(o),o!=="granted"&&(await jA("Request permissions to access filesystem?"),o=await s.requestPermission(e)),o!=="granted"){Ge("Could not get permission to access filesystem.");return}return{getFileData:async a=>{console.log("getFileData",a);let l=await s.getFileHandle(a,{create:!1});console.log("getFileData",l);let h=await l.getFile();console.log("getFileData",h);let f=await(Es(a)?h.binary():h.text());return console.log(l,h,f),f},setFileData:async(a,l)=>{}}}function jt(){return li(ze.mainPath)}function Bg(){return li(ke.getActiveID())}function NA(i){var e=ke.getActive();if(e&&e.setText){var t=ke.getActiveID();$.get("presets/"+Qi(Re)+"/"+t,r=>{bootbox.confirm("Reset '"+mo.sanitize(t)+"' to default?",n=>{n&&e.setText(r)})},"text").fail(()=>{Zt?Ge("Can only revert built-in examples. If you want to revert all files, You can pull from the repository."):Ge("Can only revert built-in examples.")})}else Ge("Cannot revert the active window. Please choose a text file.")}function BA(i){var e=ke.getActive();if(e&&e.getPath){var t=ke.getActiveID();bootbox.confirm("Delete '"+mo.sanitize(t)+"'?",r=>{r&&wr.removeItem(t).then(()=>{xe.file==t?(go.unsetLastPreset(),Ms()):(Il(),Li("Deleted "+t))})})}else Ge("Cannot delete the active window.")}function GA(i){var e=ke.getActive();if(e&&e.getPath&&ze.getFile(e.getPath())){var t=ke.getActiveID();bootbox.prompt({title:"Rename '"+mo.sanitize(t)+"' to?",value:t,callback:r=>{var n=ze.getFile(e.getPath());if(r&&r!=t&&n){if(!cg(r))return;wr.removeItem(t).then(()=>wr.setItem(r,n)).then(()=>{Il(),alert("Renamed "+t+" to "+r),t==ze.mainPath&&lg(r)})}}})}else Ge("Cannot rename the active window.")}function FA(i){let e={},t,r=L.getPresets?L.getPresets():[];for(var n=0;n<r.length;n++){var s=r[n],o=s.chapter?s.chapter+". "+s.name:s.name,a=s.id==ze.mainPath;s.category?t=$("<optgroup />").attr("label","Examples: "+s.category).appendTo(i):t||(t=$("<optgroup />").attr("label","Examples").appendTo(i)),t.append($("<option />").val(s.id).text(o).attr("selected",a?"selected":null)),a&&(Gf=s),e[s.id]=o}return e}function HA(i){if(xr&&!Nl){var e=0,t=Xo();if(t){let n=$("<optgroup />").attr("label","Repositories").appendTo(i);for(let s in t){var r=t[s];r.platform_id&&Qi(r.platform_id)==Qi(Re)&&n.append($("<option />").val(r.url).text(r.url.substring(r.url.indexOf("/"))))}}}}async function zw(i,e,t,r){let n=await wr.keys();n||(n=[]);let s;for(var o=0;o<n.length;o++){let a=n[o];if(a.startsWith(t)&&!r[a]){s||(s=$("<optgroup />").attr("label",e).appendTo(i));let l=a.substring(t.length);s.append($("<option />").val(a).text(l).attr("selected",a==ze.mainPath?"selected":null))}}}function Lw(i){i.css("visibility","visible");var e=ze.mainPath;i.val()!=e&&i.append($("<option />").val(e).text(e).attr("selected","selected"))}async function Il(){var i=$("#preset_select").empty();if(Zt)i.append($("<option />").val("/").text("Leave Repository")),$("#repo_name").text(li(Zt)+"/").show(),await zw(i,Zt,"",{}),Lw(i);else{HA(i);var e=FA(i);await zw(i,"Local Files","",e),Lw(i)}i.off("change").change(function(t){lg($(this).val().toString())})}function KA(i){var e=$("<p/>");if(i.path!=null){var t=i.line?i.label?`(${i.path} @ ${i.label})`:`(${i.path}:${i.line})`:`(${i.path})`,r=$("<a/>").text(t),n=i.path;n==jt()&&(n=ze.mainPath),ke.isWindow(n)&&r.click(s=>{var o=ke.createOrShow(n);o instanceof fo&&o.setCurrentLine(i,!0)}),e.append(r),e.append("&nbsp;")}return e.append($("<span/>").text(i.msg)),e}function Ww(){$("#error_alert").hide(),og=!1}function hg(i,e){var t=$("#error_alert_msg").empty();for(var r of i.slice(0,10))t.append(KA(r));$("#error_alert").show(),og=e}function qw(i,e){if(e!=null){var t={msg:e,line:0};i instanceof wu&&i.$loc&&(t=Object.create(i.$loc),t.msg=e,console.log(t)),hg([t],!0)}}async function JA(i){if("errors"in i&&i.errors.length>0)Wl.addClass("has-errors"),ke.setErrors(i.errors),ql(),hg(i.errors,!1);else{if(Wl.removeClass("has-errors"),ke.setErrors(null),Ww(),i==null||"unchanged"in i&&i.unchanged||!("output"in i))return;L.debugSymbols=new Tg(i.symbolmap,i.debuginfo),Mw=i.params;var e=i.output;if(e!=null)try{uo(),Gw(),await L.loadROM(AA(),e),po=e,Kf||Mn(),jY()}catch(t){console.log(t),Wl.addClass("has-errors"),qw(t,t+""),po=null,ql();return}ql(),ke.refresh(!1)}}async function eY(){if(L.loadBIOS){var i=Re+".rom",e=await wr.getItem(i);e instanceof Uint8A Line truncated
`),e.SP&&(t+="c.SP < 0x"+ht(e.SP)+`
`),e.HL&&(t+=`c.HL == 0x4000
`),L.readAddress&&(t+=`this.readAddress(0x1234) == 0x0
@@ -73,7 +73,7 @@ Tags : ${s}`,O.style.whiteSpace="pre-wrap",O.style.fontFamily="monospace",O.sty
`),t}function dY(i){var e=new Function("c","return ("+i+");").bind(L);fn(),L.runEval(e),Dw=i}function Bw(){L.isRunning()?(ke.tick(),Ff=!1):Ff||(ke.tick(),Ff=!0),setTimeout(Bw,100)}function tu(i){L.setFrameRate(i),i>.01?$("#fps_label").text(i.toFixed(2)):$("#fps_label").text("1/"+Math.round(1/i))}function pY(){var i=L.getFrameRate();i=i/2,i>1e-5&&tu(i)}function mY(){var i=L.getFrameRate();i=Math.min(60,i*2),tu(i)}function gY(){tu(60/65536)}function bY(){Mn(),tu(60)}function SY(){ke.refresh(!1);var i=ke.getActive();if(i.getSourceFile&&i.setTimingResult){var e=L.newCodeAnalyzer();e.showLoopTimingForPC(0),i.setTimingResult(e)}}function ug(){ha&&(L.setRecorder(null),$("#dbg_record").removeClass("btn_recording"),$("#replaydiv").hide(),fg(),ha=!1)}function Gw(){ha&&_i.reset()}function Fw(){_i.reset(),L.setRecorder(_i),$("#dbg_record").addClass("btn_recording"),$("#replaydiv").show(),ha=!0}function QY(){ha?ug():Fw()}function Ln(i,e,t){var r=ke.getActive();r&&r.insertLinesBefore?bootbox.prompt({title:"Add "+mo.sanitize(i)+" File to Project",value:"filename"+mo.sanitize(e),callback:n=>{if(n&&n.trim().length>0){if(!cg(n))return;var s=n,o=`
`+t(n)+`
`;ze.loadFiles([s]).then(a=>{a&&a.length?Ge(n+" already exists; including anyway"):ze.updateFile(s,`
`),r.insertLinesBefore(o),ql()})}}}):Ge("Can't insert text in this window -- switch back to main file")}function vY(){var i=jt(),e=L.getToolForFilename(i);i.endsWith(".c")||e=="sdcc"||e=="cc65"||e=="cmoc"||e=="smlrc"?Ln("Header",".h",t=>'#include "'+t+'"'):e=="dasm"||e=="zmac"?Ln("Include",".inc",t=>' include "'+t+'"'):e=="ca65"||e=="sdasz80"||e=="vasm"||e=="armips"?Ln("Include",".inc",t=>' .include "'+t+'"'):e=="verilator"?Ln("Verilog",".v",t=>'`include "'+t+'"'):e=="wiz"?Ln("Include",".wiz",t=>'import "'+t+'";'):e=="ecs"?Ln("Include",".ecs",t=>'import "'+t+'"'):e=="acme"?Ln("Include",".acme",t=>'!src "'+t+'"'):Ge("Can't add include file to this project type ("+e+")")}function xY(){var i=jt(),e=L.getToolForFilename(i);i.endsWith(".c")||e=="sdcc"||e=="cc65"||e=="cmoc"||e=="smlrc"?Ln("Linked C (or .s)",".c",t=>'//#link "'+t+'"'):i.endsWith("asm")||i.endsWith(".s")||e=="ca65"||e=="lwasm"?Ln("Linked ASM",".inc",t=>';#link "'+t+'"'):Ge("Can't add linked file to this project type ("+e+")")}function yY(){if(Nt=new hc($("#toolbar")[0],null),Nt.grp.prop("id","run_bar"),Nt.add("ctrl+alt+r","Reset","glyphicon-refresh",hY).prop("id","dbg_reset"),Nt.add("ctrl+alt+,","Pause","glyphicon-pause",iY).prop("id","dbg_pause"),Nt.add("ctrl+alt+.","Resume","glyphicon-play",Iw).prop("id","dbg_go"),L.restartAtPC&&Nt.add("ctrl+alt+/","Restart at Cursor","glyphicon-play-circle",oY).prop("id","dbg_restartatline"),Nt.newGroup(),Nt.grp.prop("id","debug_bar"),L.runEval&&Nt.add("ctrl+alt+e","Reset and Debug","glyphicon-fast-backward",fY).prop("id","dbg_restart"),L.stepBack&&Nt.add("ctrl+alt+b","Step Backwards","glyphicon-step-backward",cY).prop("id","dbg_stepback"),L.step&&Nt.add("ctrl+alt+s","Single Step","glyphicon-step-forward",rY).prop("id","dbg_step"),L.stepOver&&Nt.add("ctrl+alt+t","Step Over","glyphicon-hand-right",nY).prop("id","dbg_stepover"),L.runUntilReturn&&Nt.add("ctrl+alt+o","Step Out of Subroutine","glyphicon-hand-up",lY).prop("id","dbg_stepout"),L.runToVsync&&Nt.add("ctrl+alt+n","Next Frame/Interrupt","glyphicon-forward",sY).prop("id","dbg_tovsync"),(L.runEval||L.runToPC)&&!Re.startsWith("verilog")&&Nt.add("ctrl+alt+l","Run To Line","glyphicon-save",aY).prop("id","dbg_toline"),Nt.newGroup(),Nt.grp.prop("id","xtra_bar"),$(".dropdown-menu").collapse({toggle:!1}),$("#item_new_file").click(VA),$("#item_upload_file").click(DA),$("#item_open_directory").click(qA),$("#item_github_login").click(Gg),$("#item_github_logout").click(Fg),$("#item_github_import").click(Hg),$("#item_github_publish").click(Kg),$("#item_github_push").click(Jg),$("#item_github_pull").click(e0),$("#item_repo_delete").click(i0),$("#item_share_file").click(Lg),$("#item_reset_file").click(NA),$("#item_rename_file").click(GA),$("#item_delete_file").click(BA),L.runEval?$("#item_debug_expr").click(uY).show():$("#item_debug_expr").hide(),$("#item_download_rom").click(Vg),$("#item_download_file").click(Dg),$("#item_download_zip").click(qg),L.getDebugSymbolFile?$("#item_download_sym").click(jg):$("#item_download_sym").hide(),$("#item_download_allzip").click(Ig),$("#item_record_video").click(Ng),_u()?$("#item_export_cassette").click(Mg):$("#item_export_cassette").hide(),L.setFrameRate&&L.getFrameRate&&($("#dbg_slower").click(pY),$("#dbg_faster").click(mY),$("#dbg_slowest").click(gY),$("#dbg_fastest").click(bY)),$("#item_addfile_include").click(vY),$("#item_addfile_link").click(xY),$("#item_request_persist").click(()=>ag(!0,!1)),Bw(),L.newCodeAnalyzer&&Nt.add(null,"Analyze CPU Timing","glyphicon-time",SY),L.setRecorder&&L.advance&&wY(),L.showHelp){let{li:t,a:r}=ig("help__"+Re,eg+" Help");$("#help_menu").append(t),$(r).click(()=>window.open(L.showHelp(),"_8bws_help"))}let i=L.getToolForFilename(jt()),e=RA[i];if(e){let{li:t,a:r}=ig("help__"+i,i+" Help");$("#help_menu").append(t),$(r).click(()=>window.open(e,"_8bws_help"))}}function wY(){var i=$("#replayslider"),e=$("#clockslider"),t=$("#replay_frame"),r=$("#replay_clock");L.advanceFrameClock||$("#clockdiv").hide();var n=()=>{t.text(_i.lastSeekFrame+""),r.text(_i.lastSeekStep+"")},s=l=>{vs();var h=parseInt(i.val().toString()),f=parseInt(e.val().toString());_i.loadFrame(h,f)>=0&&(e.attr("min",0),e.attr("max",_i.lastStepCount),n(),Hf(L.saveState()))},o=l=>{vs(),_i.loadFrame(l)>=0&&(i.val(l),n(),Hf(L.saveState()))},a=l=>{vs();var h=parseInt(i.val().toString());_i.loadFrame(h,l)>=0&&(e.val(l),n(),Hf(L.saveState()))};_i.callbackStateChanged=()=>{i.attr("min",0),i.attr("max",_i.numFrames()),i.val(_i.currentFrame()),e.val(_i.currentStep()),n(),Bl(L.saveState())},i.on("input",s),e.on("input",s),$("#replay_min").click(()=>{o(1)}),$("#replay_max").click(()=>{o(_i.numFrames())}),$("#replay_back").click(()=>{o(parseInt(i.val().toString())-1)}),$("#replay_fwd").click(()=>{o(parseInt(i.val().toString())+1)}),$("#clock_back").click(()=>{a(parseInt(e.val().toString())-1)}),$("#clock_fwd").click(()=>{a(parseInt(e.val().toString())+1)}),$("#replay_bar").show(),Nt.add("ctrl+alt+0","Start/Stop Replay Recording","glyphicon-record",QY).prop(Line truncated
`),r.insertLinesBefore(o),ql()})}}}):Ge("Can't insert text in this window -- switch back to main file")}function vY(){var i=jt(),e=L.getToolForFilename(i);i.endsWith(".c")||e=="sdcc"||e=="cc65"||e=="cmoc"||e=="smlrc"?Ln("Header",".h",t=>'#include "'+t+'"'):e=="dasm"||e=="zmac"?Ln("Include",".inc",t=>' include "'+t+'"'):e=="ca65"||e=="sdasz80"||e=="vasm"||e=="armips"?Ln("Include",".inc",t=>' .include "'+t+'"'):e=="verilator"?Ln("Verilog",".v",t=>'`include "'+t+'"'):e=="wiz"?Ln("Include",".wiz",t=>'import "'+t+'";'):e=="ecs"?Ln("Include",".ecs",t=>'import "'+t+'"'):e=="acme"?Ln("Include",".acme",t=>'!src "'+t+'"'):Ge("Can't add include file to this project type ("+e+")")}function yY(){var i=jt(),e=L.getToolForFilename(i);i.endsWith(".c")||e=="sdcc"||e=="cc65"||e=="cmoc"||e=="smlrc"?Ln("Linked C (or .s)",".c",t=>'//#link "'+t+'"'):i.endsWith("asm")||i.endsWith(".s")||e=="ca65"||e=="lwasm"?Ln("Linked ASM",".inc",t=>';#link "'+t+'"'):Ge("Can't add linked file to this project type ("+e+")")}function xY(){if(Nt=new hc($("#toolbar")[0],null),Nt.grp.prop("id","run_bar"),Nt.add("ctrl+alt+r","Reset","glyphicon-refresh",hY).prop("id","dbg_reset"),Nt.add("ctrl+alt+,","Pause","glyphicon-pause",iY).prop("id","dbg_pause"),Nt.add("ctrl+alt+.","Resume","glyphicon-play",Iw).prop("id","dbg_go"),L.restartAtPC&&Nt.add("ctrl+alt+/","Restart at Cursor","glyphicon-play-circle",oY).prop("id","dbg_restartatline"),Nt.newGroup(),Nt.grp.prop("id","debug_bar"),L.runEval&&Nt.add("ctrl+alt+e","Reset and Debug","glyphicon-fast-backward",fY).prop("id","dbg_restart"),L.stepBack&&Nt.add("ctrl+alt+b","Step Backwards","glyphicon-step-backward",cY).prop("id","dbg_stepback"),L.step&&Nt.add("ctrl+alt+s","Single Step","glyphicon-step-forward",rY).prop("id","dbg_step"),L.stepOver&&Nt.add("ctrl+alt+t","Step Over","glyphicon-hand-right",nY).prop("id","dbg_stepover"),L.runUntilReturn&&Nt.add("ctrl+alt+o","Step Out of Subroutine","glyphicon-hand-up",lY).prop("id","dbg_stepout"),L.runToVsync&&Nt.add("ctrl+alt+n","Next Frame/Interrupt","glyphicon-forward",sY).prop("id","dbg_tovsync"),(L.runEval||L.runToPC)&&!Re.startsWith("verilog")&&Nt.add("ctrl+alt+l","Run To Line","glyphicon-save",aY).prop("id","dbg_toline"),Nt.newGroup(),Nt.grp.prop("id","xtra_bar"),$(".dropdown-menu").collapse({toggle:!1}),$("#item_new_file").click(VA),$("#item_upload_file").click(DA),$("#item_open_directory").click(qA),$("#item_github_login").click(Gg),$("#item_github_logout").click(Fg),$("#item_github_import").click(Hg),$("#item_github_publish").click(Kg),$("#item_github_push").click(Jg),$("#item_github_pull").click(e0),$("#item_repo_delete").click(i0),$("#item_share_file").click(Lg),$("#item_reset_file").click(NA),$("#item_rename_file").click(GA),$("#item_delete_file").click(BA),L.runEval?$("#item_debug_expr").click(uY).show():$("#item_debug_expr").hide(),$("#item_download_rom").click(Vg),$("#item_download_file").click(Dg),$("#item_download_zip").click(qg),L.getDebugSymbolFile?$("#item_download_sym").click(jg):$("#item_download_sym").hide(),$("#item_download_allzip").click(Ig),$("#item_record_video").click(Ng),_u()?$("#item_export_cassette").click(Mg):$("#item_export_cassette").hide(),L.setFrameRate&&L.getFrameRate&&($("#dbg_slower").click(pY),$("#dbg_faster").click(mY),$("#dbg_slowest").click(gY),$("#dbg_fastest").click(bY)),$("#item_addfile_include").click(vY),$("#item_addfile_link").click(yY),$("#item_request_persist").click(()=>ag(!0,!1)),Bw(),L.newCodeAnalyzer&&Nt.add(null,"Analyze CPU Timing","glyphicon-time",SY),L.setRecorder&&L.advance&&wY(),L.showHelp){let{li:t,a:r}=ig("help__"+Re,eg+" Help");$("#help_menu").append(t),$(r).click(()=>window.open(L.showHelp(),"_8bws_help"))}let i=L.getToolForFilename(jt()),e=RA[i];if(e){let{li:t,a:r}=ig("help__"+i,i+" Help");$("#help_menu").append(t),$(r).click(()=>window.open(e,"_8bws_help"))}}function wY(){var i=$("#replayslider"),e=$("#clockslider"),t=$("#replay_frame"),r=$("#replay_clock");L.advanceFrameClock||$("#clockdiv").hide();var n=()=>{t.text(_i.lastSeekFrame+""),r.text(_i.lastSeekStep+"")},s=l=>{vs();var h=parseInt(i.val().toString()),f=parseInt(e.val().toString());_i.loadFrame(h,f)>=0&&(e.attr("min",0),e.attr("max",_i.lastStepCount),n(),Hf(L.saveState()))},o=l=>{vs(),_i.loadFrame(l)>=0&&(i.val(l),n(),Hf(L.saveState()))},a=l=>{vs();var h=parseInt(i.val().toString());_i.loadFrame(h,l)>=0&&(e.val(l),n(),Hf(L.saveState()))};_i.callbackStateChanged=()=>{i.attr("min",0),i.attr("max",_i.numFrames()),i.val(_i.currentFrame()),e.val(_i.currentStep()),n(),Bl(L.saveState())},i.on("input",s),e.on("input",s),$("#replay_min").click(()=>{o(1)}),$("#replay_max").click(()=>{o(_i.numFrames())}),$("#replay_back").click(()=>{o(parseInt(i.val().toString())-1)}),$("#replay_fwd").click(()=>{o(parseInt(i.val().toString())+1)}),$("#clock_back").click(()=>{a(parseInt(e.val().toString())-1)}),$("#clock_fwd").click(()=>{a(parseInt(e.val().toString())+1)}),$("#replay_bar").show(),Nt.add("ctrl+alt+0","Start/Stop Replay Recording","glyphicon-record",QY).prop(Line truncated
/*! Bundled license information:
localforage/dist/localforage.js:
@@ -99,4 +99,4 @@ jquery/dist/jquery.js:
dompurify/dist/purify.cjs.js:
(*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE *)
*/
//# sourceMappingURL=chunk-EFP34EU3.js.map
//# sourceMappingURL=chunk-RID3TRKY.js.map
+7
View File
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../node_modules/localforage/dist/localforage.js", "../node_modules/jquery/dist/jquery.js", "../node_modules/dompurify/src/utils.ts", "../node_modules/dompurify/src/tags.ts", "../node_modules/dompurify/src/attrs.ts", "../node_modules/dompurify/src/regexp.ts", "../node_modules/dompurify/src/purify.ts", "../src/ide/ui.ts", "../src/ide/analytics.ts", "../src/ide/dialogs.ts", "../src/common/workertypes.ts", "../src/ide/project.ts", "../src/ide/services.ts", "../src/common/audio/CommodoreTape.ts", "../src/ide/shareexport.ts", "../src/ide/sync.ts", "../src/ide/views/baseviews.ts", "../src/ide/pixeleditor.ts", "../src/ide/views/asseteditor.ts", "../src/ide/views/debugviews.ts", "../node_modules/@marijn/find-cluster-break/src/index.js", "../node_modules/@codemirror/state/dist/index.js", "../node_modules/style-mod/src/style-mod.js", "../node_modules/w3c-keyname/index.js", "../node_modules/crelt/index.js", "../node_modules/@codemirror/view/dist/index.js", "../node_modules/@lezer/common/dist/index.js", "../node_modules/@lezer/highlight/dist/index.js", "../node_modules/@codemirror/language/dist/index.js", "../node_modules/@codemirror/autocomplete/dist/index.js", "../node_modules/@codemirror/commands/dist/index.js", "../node_modules/@lezer/lr/dist/index.js", "../node_modules/@lezer/cpp/dist/index.js", "../node_modules/@codemirror/lang-cpp/dist/index.js", "../node_modules/@lezer/markdown/dist/index.js", "../node_modules/@lezer/html/dist/index.js", "../node_modules/@lezer/css/dist/index.js", "../node_modules/@codemirror/lang-css/dist/index.js", "../node_modules/@lezer/javascript/dist/index.js", "../node_modules/@codemirror/lang-javascript/dist/index.js", "../node_modules/@codemirror/lang-html/dist/index.js", "../node_modules/@codemirror/lang-markdown/dist/index.js", "../node_modules/@codemirror/search/dist/index.js", "../src/parser/tokens-6502.ts", "parser/lang-6502.grammar.js", "../src/parser/lang-6502.ts", "../src/parser/lang-basic.ts", "../src/parser/lang-bataribasic.ts", "../src/parser/lang-fastbasic.ts", "../src/parser/lang-inform6.ts", "../src/parser/lang-verilog.ts", "../src/parser/lang-wiz.ts", "parser/lang-z80.grammar.js", "../src/parser/lang-z80.ts", "../src/themes/cobalt.ts", "../src/themes/disassemblyTheme.ts", "../src/themes/editorTheme.ts", "../src/themes/mbo.ts", "../src/ide/views/debug.ts", "../src/ide/views/filters.ts", "../src/ide/views/gutter.ts", "../src/ide/views/assetdecorations.ts", "../src/ide/views/tabs.ts", "../src/ide/views/visuals.ts", "../src/ide/views/editors.ts", "../src/ide/views/treeviews.ts", "../src/ide/windows.ts"],
"sourcesContent": ["/*!\n localForage -- Offline Storage, Improved\n Version 1.10.0\n https://localforage.github.io/localForage\n (c) 2013-2017 Mozilla, Apache License 2.0\n*/\n(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.localforage = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw (f.code=\"MODULE_NOT_FOUND\", f)}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){\n(function (global){\n'use strict';\nvar Mutation = global.MutationObserver || global.WebKitMutationObserver;\n\nvar scheduleDrain;\n\n{\n if (Mutation) {\n var called = 0;\n var observer = new Mutation(nextTick);\n var element = global.document.createTextNode('');\n observer.observe(element, {\n characterData: true\n });\n scheduleDrain = function () {\n element.data = (called = ++called % 2);\n };\n } else if (!global.setImmediate && typeof global.MessageChannel !== 'undefined') {\n var channel = new global.MessageChannel();\n channel.port1.onmessage = nextTick;\n scheduleDrain = function () {\n channel.port2.postMessage(0);\n };\n } else if ('document' in global && 'onreadystatechange' in global.document.createElement('script')) {\n scheduleDrain = function () {\n\n // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted\n // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.\n var scriptEl = global.document.createElement('script');\n scriptEl.onreadystatechange = function () {\n nextTick();\n\n scriptEl.onreadystatechange = null;\n scriptEl.parentNode.removeChild(scriptEl);\n scriptEl = null;\n };\n global.document.documentElement.appendChild(scriptEl);\n };\n } else {\n scheduleDrain = function () {\n setTimeout(nextTick, 0);\n };\n }\n}\n\nvar draining;\nvar queue = [];\n//named nextTick for less confusing stack traces\nfunction nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}\n\nmodule.exports = immediate;\nfunction immediate(task) {\n if (queue.push(task) === 1 && !draining) {\n scheduleDrain();\n }\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{}],2:[function(_dereq_,module,exports){\n'use strict';\nvar immediate = _dereq_(1);\n\n/* istanbul ignore next */\nfunction INTERNAL() {}\n\nvar handlers = {};\n\nvar REJECTED = ['REJECTED'];\nvar FULFILLED = ['FULFILLED'];\nvar PENDING = ['PENDING'];\n\nmodule.exports = Promise;\n\nfunction Promise(resolver) {\n if (typeof resolver !== 'function') {\n throw new TypeError('resolver must be a function');\n }\n this.state = PENDING;\n this.queue = [];\n this.outcome = void 0;\n if (resolver !== INTERNAL) {\n safelyResolveThenable(this, resolver);\n }\n}\n\nPromise.prototype[\"catch\"] = function (onRejected) {\n return this.then(null, onRejected);\n};\nPromise.prototype.then = function (onFulfilled, onRejected) {\n if (typeof onFulfilled !== 'function' && this.state === FULFILLED ||\n typeof onRejected !== 'function' && this.state === REJECTED) {\n return this;\n }\n var promise = new this.constructor(INTERNAL);\n if (this.state !== PENDING) {\n var resolver = this.state === FULFILLED ? onFulfilled : onRejected;\n unwrap(promise, resolver, this.outcome);\n } else {\n this.queue.push(new QueueItem(promise, onFulfilled, onRejected));\n }\n\n return promise;\n};\nfunction QueueItem(promise, onFulfilled, onRejected) {\n this.promise = promise;\n if (typeof onFulfilled === 'function') {\n this.onFulfilled = onFulfilled;\n this.callFulfilled = this.otherCallFulfilled;\n }\n if (typeof onRejected === 'function') {\n this.onRejected = onRejected;\n this.callRejected = this.otherCallRejected;\n }\n}\nQueueItem.prototype.callFulfilled = function (value) {\n handlers.resolve(this.promise, value);\n};\nQueueItem.prototype.otherCallFulfilled = function (value) {\n unwrap(this.promise, this.onFulfilled, value);\n};\nQueueItem.prototype.callLine truncated
"mappings": "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 truncated
"names": ["require_localforage", "__commonJSMin", "exports", "module", "f", "g", "define", "e", "t", "n", "r", "s", "o", "u", "a", "__require", "i", "l", "_dereq_", "global", "Mutation", "scheduleDrain", "called", "observer", "nextTick", "element", "channel", "scriptEl", "draining", "queue", "oldQueue", "len", "immediate", "task", "INTERNAL", "handlers", "REJECTED", "FULFILLED", "PENDING", "Promise", "resolver", "safelyResolveThenable", "onRejected", "onFulfilled", "promise", "unwrap", "QueueItem", "value", "func", "returnValue", "self", "result", "tryCatch", "getThen", "thenable", "error", "obj", "then", "onError", "onSuccess", "tryToUnwrap", "out", "resolve", "reject", "reason", "all", "iterable", "values", "resolved", "allResolver", "resolveFromAll", "outValue", "race", "response", "_typeof", "_classCallCheck", "instance", "Constructor", "getIDB", "idb", "isIndexedDBValid", "isSafari", "hasFetch", "createBlob", "parts", "properties", "Builder", "builder", "Promise$1", "executeCallback", "callback", "executeTwoCallbacks", "errorCallback", "normalizeKey", "key", "getCallback", "DETECT_BLOB_SUPPORT_STORE", "supportsBlobs", "dbContexts", "toString", "READ_ONLY", "READ_WRITE", "_binStringToArrayBuffer", "bin", "length", "buf", "arr", "_checkBlobSupportWithoutCaching", "txn", "blob", "matchedChrome", "matchedEdge", "_checkBlobSupport", "_deferReadiness", "dbInfo", "dbContext", "deferredOperation", "_advanceReadiness", "_rejectReadiness", "err", "_getConnection", "upgradeNeeded", "createDbContext", "dbArgs", "openreq", "db", "ex", "_getOriginalConnection", "_getUpgradedConnection", "_isUpgradeNeeded", "defaultVersion", "isNewStore", "isDowngrade", "isUpgrade", "incVersion", "_encodeBlob", "reader", "base64", "_decodeBlob", "encodedBlob", "arrayBuff", "_isEncodedBlob", "_fullyReady", "_tryReconnect", "forages", "forage", "createTransaction", "mode", "retries", "tx", "_initStorage", "options", "initPromises", "ignoreErrors", "j", "k", "getItem", "transaction", "store", "req", "iterate", "iterator", "iterationNumber", "cursor", "setItem", "blobSupport", "removeItem", "clear", "advanced", "keys", "dropInstance", "currentConfig", "isCurrentDb", "dbPromise", "newVersion", "dropObjectPromise", "_forage2", "dropDBPromise", "_forage", "asyncStorage", "isWebSQLValid", "BASE_CHARS", "BLOB_TYPE_PREFIX", "BLOB_TYPE_PREFIX_REGEX", "SERIALIZED_MARKER", "SERIALIZED_MARKER_LENGTH", "TYPE_ARRAYBUFFER", "TYPE_BLOB", "TYPE_INT8ARRAY", "TYPE_UINT8ARRAY", "TYPE_UINT8CLAMPEDARRAY", "TYPE_INT16ARRAY", "TYPE_INT32ARRAY", "TYPE_UINT16ARRAY", "TYPE_UINT32ARRAY", "TYPE_FLOAT32ARRAY", "TYPE_FLOAT64ARRAY", "TYPE_SERIALIZED_MARKER_LENGTH", "toString$1", "stringToBuffer", "serializedString", "bufferLength", "p", "encoded1", "encoded2", "encoded3", "encoded4", "buffer", "bytes", "bufferToString", "base64String", "serialize", "valueType", "marker", "fileReader", "str", "deserialize", "type", "blobType", "matcher", "localforageSerializer", "createDbTable", "_initStorage$1", "dbInfoPromise", "tryExecuteSql", "sqlStatement", "args", "results", "getItem$1", "iterate$1", "rows", "item", "_setItem", "retriesLeft", "originalValue", "sqlError", "setItem$1", "removeItem$1", "clear$1", "length$1", "key$1", "keys$1", "getAllStoreNames", "storeNames", "dropInstance$1", "operationInfo", "dropTable", "storeName", "operations", "webSQLStorage", "isLocalStorageValid", "_getKeyPrefix", "defaultConfig", "keyPrefix", "checkIfLocalStorageThrows", "localStorageTestKey", "_isLocalStorageUsable", "_initStorage$2", "clear$2", "getItem$2", "iterate$2", "keyPrefixLength", "key$2", "keys$2", "itemKey", "length$2", "removeItem$2", "setItem$2", "dropInstance$2", "localStorageWrapper", "sameValue", "x", "y", "includes", "array", "searchElement", "isArray", "arg", "DefinedDrivers", "DriverSupport", "DefaultDrivers", "DefaultDriverOrder", "OptionalDriverMethods", "LibraryMethods", "DefaultConfig", "callWhenReady", "localForageInstance", "libraryMethod", "_args", "extend", "_key", "LocalForage", "driverTypeKey", "driver", "driverName", "driverObject", "complianceError", "driverMethods", "driverMethodName", "isRequired", "configureMissingMethods", "methodNotImplementedFactory", "methodName", "_i", "_len", "optionalDriverMethod", "setDriverSupport", "support", "getDriverPromise", "serializerPromise", "drivers", "supportedDrivers", "setDriverToConfig", "extendSelfWithDriver", "initDriver", "currentDriverIndex", "driverPromiseLoop", "oldDriverSetDone", "libraryMethodsAndProperties", "localforage_js", "require_jquery", "__commonJSMin", "exports", "module", "global", "factory", "w", "window", "noGlobal", "arr", "getProto", "slice", "flat", "array", "push", "indexOf", "class2type", "toString", "hasOwn", "fnToString", "ObjectFunctionString", "support", "isFunction", "obj", "isWindow", "document", "preservedScriptAttributes", "DOMEval", "code", "node", "doc", "i", "val", "script", "toType", "version", "rhtmlSuffix", "jQuery", "selector", "context", "num", "elems", "ret", "callback",Line truncated
}
@@ -1,2 +1,2 @@
import{M as b,N as w}from"./chunk-NIHHDIEJ.js";import{d as E}from"./chunk-KT7KMEQC.js";var y=E((d,v)=>{(function(l,e){typeof define=="function"&&define.amd?define([],e):typeof d!="undefined"?e():(e(),l.FileSaver={})})(d,function(){"use strict";function l(t,r){return typeof r=="undefined"?r={autoBom:!1}:typeof r!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),r={autoBom:!r}),r.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\uFEFF",t],{type:t.type}):t}function e(t,r,c){var a=new XMLHttpRequest;a.open("GET",t),a.responseType="blob",a.onload=function(){h(a.response,r,c)},a.onerror=function(){console.error("could not download file")},a.send()}function n(t){var r=new XMLHttpRequest;r.open("HEAD",t,!1);try{r.send()}catch(c){}return 200<=r.status&&299>=r.status}function i(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(c){var r=document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(r)}}var o=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:void 0,u=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),h=o.saveAs||(typeof window!="object"||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!u?function(t,r,c){var a=o.URL||o.webkitURL,s=document.createElement("a");r=r||t.name||"download",s.download=r,s.rel="noopener",typeof t=="string"?(s.href=t,s.origin===location.origin?i(s):n(s.href)?e(t,r,c):i(s,s.target="_blank")):(s.href=a.createObjectURL(t),setTimeout(function(){a.revokeObjectURL(s.href)},4e4),setTimeout(function(){i(s)},0))}:"msSaveOrOpenBlob"in navigator?function(t,r,c){if(r=r||t.name||"download",typeof t!="string")navigator.msSaveOrOpenBlob(l(t,c),r);else if(n(t))e(t,r,c);else{var a=document.createElement("a");a.href=t,a.target="_blank",setTimeout(function(){i(a)})}}:function(t,r,c,a){if(a=a||open("","_blank"),a&&(a.document.title=a.document.body.innerText="downloading..."),typeof t=="string")return e(t,r,c);var s=t.type==="application/octet-stream",C=/constructor/i.test(o.HTMLElement)||o.safari,S=/CriOS\/[\d]+/.test(navigator.userAgent);if((S||s&&C||u)&&typeof FileReader!="undefined"){var p=new FileReader;p.onloadend=function(){var m=p.result;m=S?m:m.replace(/^data:[^;]*;/,"data:attachment/file;"),a?a.location.href=m:location=m,a=null},p.readAsDataURL(t)}else{var k=o.URL||o.webkitURL,f=k.createObjectURL(t);a?a.location=f:location.href=f,a=null,setTimeout(function(){k.revokeObjectURL(f)},4e4)}});o.saveAs=h.saveAs=h,typeof v!="undefined"&&(v.exports=h)})});var g=class{constructor(e){this.checkpointInterval=10;this.maxCheckpoints=300;this.reset(),this.platform=e}reset(){this.checkpoints=[],this.framerecs=[],this.frameCount=0,this.lastSeekFrame=0,this.lastSeekStep=0,this.lastStepCount=0,this.callbackStateChanged&&this.callbackStateChanged()}frameRequested(){var e={controls:this.platform.saveControlsState(),seed:b()},n=!1;return this.lastSeekFrame<this.frameCount?this.loadControls(this.lastSeekFrame):(this.platform.saveControlsState&&this.framerecs.push(e),n=this.frameCount++%this.checkpointInterval==0),this.lastSeekFrame++,this.lastSeekStep=0,this.callbackStateChanged&&this.callbackStateChanged(),n}numFrames(){return this.frameCount}currentFrame(){return this.lastSeekFrame}currentStep(){return this.lastSeekStep}recordFrame(e){this.checkpoints.push(e),this.callbackNewCheckpoint&&this.callbackNewCheckpoint(e),this.checkpoints.length>this.maxCheckpoints&&(this.checkpoints.shift(),this.framerecs=this.framerecs.slice(this.checkpointInterval),this.lastSeekFrame-=this.checkpointInterval,this.frameCount-=this.checkpointInterval,this.callbackStateChanged&&this.callbackStateChanged())}getStateAtOrBefore(e){if(e<=0&&this.checkpoints.length>0)return{frame:0,state:this.checkpoints[0]};var n=Math.floor(e/this.checkpointInterval),i=n<this.checkpoints.length?n:this.checkpoints.length-1,o=i*this.checkpointInterval;return{frame:o,state:this.checkpoints[i]}}loadFrame(e,n){if(e|=0,n|=0,e==this.lastSeekFrame&&n==this.lastSeekStep)return e;let{frame:i,state:o}=this.getStateAtOrBefore(e-1);if(o){var u=0;for(this.platform.pause(),this.platform.loadState(o);i<e;)i<this.framerecs.length&&this.loadControls(i),i++,u=this.platform.advance(i<e);return i==0&&(u=this.platform.advance(!0),this.platform.loadState(o)),n>0&&this.platform.advanceFrameClock&&(n=this.platform.advanceFrameClock(null,n)),this.lastSeekFrame=e,this.lastSeekStep=n,this.lastStepCount=u,e}else return-1}loadControls(e){this.platform.loadControlsState&&this.platform.loadControlsState(this.framerecs[e].controls),w(this.framerecs[e].seed)}getLastCheckpoint(){return this.checkpoints.length&&this.checkpoints[this.checkpoints.length-1]}};function R(l){switch(l){case"apple2":return import("./apple2-UREXXIB5.js");case"arm32"Line truncated
//# sourceMappingURL=chunk-KJNUV3FX.js.map
import{M as b,N as w}from"./chunk-NIHHDIEJ.js";import{d as E}from"./chunk-KT7KMEQC.js";var y=E((d,v)=>{(function(l,e){typeof define=="function"&&define.amd?define([],e):typeof d!="undefined"?e():(e(),l.FileSaver={})})(d,function(){"use strict";function l(t,r){return typeof r=="undefined"?r={autoBom:!1}:typeof r!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),r={autoBom:!r}),r.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\uFEFF",t],{type:t.type}):t}function e(t,r,c){var a=new XMLHttpRequest;a.open("GET",t),a.responseType="blob",a.onload=function(){h(a.response,r,c)},a.onerror=function(){console.error("could not download file")},a.send()}function n(t){var r=new XMLHttpRequest;r.open("HEAD",t,!1);try{r.send()}catch(c){}return 200<=r.status&&299>=r.status}function i(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(c){var r=document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(r)}}var o=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:void 0,u=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),h=o.saveAs||(typeof window!="object"||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!u?function(t,r,c){var a=o.URL||o.webkitURL,s=document.createElement("a");r=r||t.name||"download",s.download=r,s.rel="noopener",typeof t=="string"?(s.href=t,s.origin===location.origin?i(s):n(s.href)?e(t,r,c):i(s,s.target="_blank")):(s.href=a.createObjectURL(t),setTimeout(function(){a.revokeObjectURL(s.href)},4e4),setTimeout(function(){i(s)},0))}:"msSaveOrOpenBlob"in navigator?function(t,r,c){if(r=r||t.name||"download",typeof t!="string")navigator.msSaveOrOpenBlob(l(t,c),r);else if(n(t))e(t,r,c);else{var a=document.createElement("a");a.href=t,a.target="_blank",setTimeout(function(){i(a)})}}:function(t,r,c,a){if(a=a||open("","_blank"),a&&(a.document.title=a.document.body.innerText="downloading..."),typeof t=="string")return e(t,r,c);var s=t.type==="application/octet-stream",C=/constructor/i.test(o.HTMLElement)||o.safari,S=/CriOS\/[\d]+/.test(navigator.userAgent);if((S||s&&C||u)&&typeof FileReader!="undefined"){var p=new FileReader;p.onloadend=function(){var m=p.result;m=S?m:m.replace(/^data:[^;]*;/,"data:attachment/file;"),a?a.location.href=m:location=m,a=null},p.readAsDataURL(t)}else{var k=o.URL||o.webkitURL,f=k.createObjectURL(t);a?a.location=f:location.href=f,a=null,setTimeout(function(){k.revokeObjectURL(f)},4e4)}});o.saveAs=h.saveAs=h,typeof v!="undefined"&&(v.exports=h)})});var g=class{constructor(e){this.checkpointInterval=10;this.maxCheckpoints=300;this.reset(),this.platform=e}reset(){this.checkpoints=[],this.framerecs=[],this.frameCount=0,this.lastSeekFrame=0,this.lastSeekStep=0,this.lastStepCount=0,this.callbackStateChanged&&this.callbackStateChanged()}frameRequested(){var e={controls:this.platform.saveControlsState(),seed:b()},n=!1;return this.lastSeekFrame<this.frameCount?this.loadControls(this.lastSeekFrame):(this.platform.saveControlsState&&this.framerecs.push(e),n=this.frameCount++%this.checkpointInterval==0),this.lastSeekFrame++,this.lastSeekStep=0,this.callbackStateChanged&&this.callbackStateChanged(),n}numFrames(){return this.frameCount}currentFrame(){return this.lastSeekFrame}currentStep(){return this.lastSeekStep}recordFrame(e){this.checkpoints.push(e),this.callbackNewCheckpoint&&this.callbackNewCheckpoint(e),this.checkpoints.length>this.maxCheckpoints&&(this.checkpoints.shift(),this.framerecs=this.framerecs.slice(this.checkpointInterval),this.lastSeekFrame-=this.checkpointInterval,this.frameCount-=this.checkpointInterval,this.callbackStateChanged&&this.callbackStateChanged())}getStateAtOrBefore(e){if(e<=0&&this.checkpoints.length>0)return{frame:0,state:this.checkpoints[0]};var n=Math.floor(e/this.checkpointInterval),i=n<this.checkpoints.length?n:this.checkpoints.length-1,o=i*this.checkpointInterval;return{frame:o,state:this.checkpoints[i]}}loadFrame(e,n){if(e|=0,n|=0,e==this.lastSeekFrame&&n==this.lastSeekStep)return e;let{frame:i,state:o}=this.getStateAtOrBefore(e-1);if(o){var u=0;for(this.platform.pause(),this.platform.loadState(o);i<e;)i<this.framerecs.length&&this.loadControls(i),i++,u=this.platform.advance(i<e);return i==0&&(u=this.platform.advance(!0),this.platform.loadState(o)),n>0&&this.platform.advanceFrameClock&&(n=this.platform.advanceFrameClock(null,n)),this.lastSeekFrame=e,this.lastSeekStep=n,this.lastStepCount=u,e}else return-1}loadControls(e){this.platform.loadControlsState&&this.platform.loadControlsState(this.framerecs[e].controls),w(this.framerecs[e].seed)}getLastCheckpoint(){return this.checkpoints.length&&this.checkpoints[this.checkpoints.length-1]}};function R(l){switch(l){case"apple2":return import("./apple2-UREXXIB5.js");case"arm32"Line truncated
//# sourceMappingURL=chunk-XFAJRCL6.js.map
File renamed without changes.
@@ -1,2 +1,2 @@
import{a as x}from"./chunk-3FIVEUG2.js";import{t as y}from"./chunk-EFP34EU3.js";import"./chunk-JSIZCY7X.js";import"./chunk-LNOKARBD.js";import"./chunk-KJNUV3FX.js";import{I as m,m as c,p}from"./chunk-ZBO3TMVB.js";import{C as d,K as f,aa as a,n as h}from"./chunk-NIHHDIEJ.js";import"./chunk-KT7KMEQC.js";var n=31,s=class extends p{constructor(){super();this.cpuFrequency=1e6;this.defaultROMSize=32768;this.cpu=new c;this.ram=new Uint8Array(16384);this.read=a([[0,16383,16383,e=>this.ram[e]],[16384,16384,65535,e=>this.serial.byteAvailable()?128:0],[16385,16385,65535,e=>this.serial.recvByte()],[16386,16386,65535,e=>this.serial.clearToSend()?128:0],[32768,65535,32767,e=>this.rom&&this.rom[e]]]);this.write=a([[0,16383,16383,(e,r)=>{this.ram[e]=r}],[16387,16387,65535,(e,r)=>this.serial.sendByte(r)],[16399,16399,65535,(e,r)=>{this.inputs[n]=1}]]);this.connectCPUMemoryBus(this)}connectSerialIO(e){this.serial=e}readConst(e){return this.read(e)}advanceFrame(e){for(var r=0;r<this.cpuFrequency/60&&!(e&&e());)r+=this.advanceCPU();return r}advanceCPU(){if(this.isHalted())return 1;var e=super.advanceCPU();return this.serial&&this.serial.advance(e),e}reset(){this.inputs[n]=0,super.reset(),this.serial&&this.serial.reset()}isHalted(){return this.inputs[n]!=0}};var S=[{id:"hello.dasm",name:"Hello World (ASM)"}],l=class{constructor(t){t.style.overflowY="auto";var e=$('<div id="gameport"/>').appendTo(t);$('<p class="transcript-header">Serial Output</p>').appendTo(e);var r=$('<div id="windowport" class="transcript"/>').appendTo(e);this.div=r[0]}start(){this.tty=new x(this.div,!1)}reset(){this.tty.clear()}saveState(){return this.tty.saveState()}loadState(t){this.tty.loadState(t)}};function v(i){return i==10?"":i<32?String.fromCharCode(i+9216):String.fromCharCode(i)}var u=class{constructor(){this.bufferedRead=!0;this.cyclesPerByte=1e6/(57600/8);this.maxOutputBytes=4096}clearToSend(){return this.outputBytes.length<this.maxOutputBytes}sendByte(t){this.clearToSend()&&(this.outputBytes.push(t),this.viewer.tty.addtext(v(t),34),t==10&&this.viewer.tty.newline(),this.clearToSend()||(this.viewer.tty.newline(),this.viewer.tty.addtext("\u26A0\uFE0F OUTPUT BUFFER FULL \u26A0\uFE0F",4)))}byteAvailable(){return this.readIndex()>this.inputIndex}recvByte(){var t=this.readIndex();this.inputIndex=t;var e=(this.inputBytes&&this.inputBytes[t])|0;return this.viewer.tty.addtext(v(e),18),e==10&&this.viewer.tty.newline(),e}readIndex(){return this.bufferedRead?this.inputIndex+1:Math.floor(this.clk/this.cyclesPerByte)}reset(){this.inputIndex=-1,this.clk=0,this.outputBytes=[],this.bufin=""}advance(t){this.clk+=t}saveState(){return{clk:this.clk,idx:this.inputIndex,out:this.outputBytes.slice()}}loadState(t){this.clk=t.clk,this.inputIndex=t.idx,this.outputBytes=t.out.slice()}},o=class extends m{constructor(e){super(e);this.getMemoryMap=function(){return{main:[{name:"RAM",start:0,size:16384,type:"ram"},{name:"ROM",start:32768,size:32768,type:"rom"}]}};this.serview=new l(e)}async start(){super.start(),this.serial=new u,this.serial.viewer=this.serview,this.serview.start(),this.machine.connectSerialIO(this.serial)}reset(){this.serial.inputBytes=d(this.internalFiles["serialin.dat"]),super.reset(),this.serview.reset()}isBlocked(){return this.machine.isHalted()}advance(e){return this.isBlocked()?(this.internalFiles["serialout.dat"]=h(this.serial.outputBytes),y(),0):super.advance(e)}saveState(){var e=super.saveState();return e.serial=this.serial.saveState(),e.serview=this.serview.saveState(),e}loadState(e){super.loadState(e),this.serial.loadState(e.serial),this.serview.loadState(e.serview)}newMachine(){return new s}getPresets(){return S}readAddress(e){return this.machine.readConst(e)}};f["devel-6502"]=o;export{u as SerialTestHarness};
//# sourceMappingURL=devel-GUIWR3FR.js.map
import{a as x}from"./chunk-3FIVEUG2.js";import{t as y}from"./chunk-RID3TRKY.js";import"./chunk-JSIZCY7X.js";import"./chunk-LNOKARBD.js";import"./chunk-XFAJRCL6.js";import{I as m,m as c,p}from"./chunk-ZBO3TMVB.js";import{C as d,K as f,aa as a,n as h}from"./chunk-NIHHDIEJ.js";import"./chunk-KT7KMEQC.js";var n=31,s=class extends p{constructor(){super();this.cpuFrequency=1e6;this.defaultROMSize=32768;this.cpu=new c;this.ram=new Uint8Array(16384);this.read=a([[0,16383,16383,e=>this.ram[e]],[16384,16384,65535,e=>this.serial.byteAvailable()?128:0],[16385,16385,65535,e=>this.serial.recvByte()],[16386,16386,65535,e=>this.serial.clearToSend()?128:0],[32768,65535,32767,e=>this.rom&&this.rom[e]]]);this.write=a([[0,16383,16383,(e,r)=>{this.ram[e]=r}],[16387,16387,65535,(e,r)=>this.serial.sendByte(r)],[16399,16399,65535,(e,r)=>{this.inputs[n]=1}]]);this.connectCPUMemoryBus(this)}connectSerialIO(e){this.serial=e}readConst(e){return this.read(e)}advanceFrame(e){for(var r=0;r<this.cpuFrequency/60&&!(e&&e());)r+=this.advanceCPU();return r}advanceCPU(){if(this.isHalted())return 1;var e=super.advanceCPU();return this.serial&&this.serial.advance(e),e}reset(){this.inputs[n]=0,super.reset(),this.serial&&this.serial.reset()}isHalted(){return this.inputs[n]!=0}};var S=[{id:"hello.dasm",name:"Hello World (ASM)"}],l=class{constructor(t){t.style.overflowY="auto";var e=$('<div id="gameport"/>').appendTo(t);$('<p class="transcript-header">Serial Output</p>').appendTo(e);var r=$('<div id="windowport" class="transcript"/>').appendTo(e);this.div=r[0]}start(){this.tty=new x(this.div,!1)}reset(){this.tty.clear()}saveState(){return this.tty.saveState()}loadState(t){this.tty.loadState(t)}};function v(i){return i==10?"":i<32?String.fromCharCode(i+9216):String.fromCharCode(i)}var u=class{constructor(){this.bufferedRead=!0;this.cyclesPerByte=1e6/(57600/8);this.maxOutputBytes=4096}clearToSend(){return this.outputBytes.length<this.maxOutputBytes}sendByte(t){this.clearToSend()&&(this.outputBytes.push(t),this.viewer.tty.addtext(v(t),34),t==10&&this.viewer.tty.newline(),this.clearToSend()||(this.viewer.tty.newline(),this.viewer.tty.addtext("\u26A0\uFE0F OUTPUT BUFFER FULL \u26A0\uFE0F",4)))}byteAvailable(){return this.readIndex()>this.inputIndex}recvByte(){var t=this.readIndex();this.inputIndex=t;var e=(this.inputBytes&&this.inputBytes[t])|0;return this.viewer.tty.addtext(v(e),18),e==10&&this.viewer.tty.newline(),e}readIndex(){return this.bufferedRead?this.inputIndex+1:Math.floor(this.clk/this.cyclesPerByte)}reset(){this.inputIndex=-1,this.clk=0,this.outputBytes=[],this.bufin=""}advance(t){this.clk+=t}saveState(){return{clk:this.clk,idx:this.inputIndex,out:this.outputBytes.slice()}}loadState(t){this.clk=t.clk,this.inputIndex=t.idx,this.outputBytes=t.out.slice()}},o=class extends m{constructor(e){super(e);this.getMemoryMap=function(){return{main:[{name:"RAM",start:0,size:16384,type:"ram"},{name:"ROM",start:32768,size:32768,type:"rom"}]}};this.serview=new l(e)}async start(){super.start(),this.serial=new u,this.serial.viewer=this.serview,this.serview.start(),this.machine.connectSerialIO(this.serial)}reset(){this.serial.inputBytes=d(this.internalFiles["serialin.dat"]),super.reset(),this.serview.reset()}isBlocked(){return this.machine.isHalted()}advance(e){return this.isBlocked()?(this.internalFiles["serialout.dat"]=h(this.serial.outputBytes),y(),0):super.advance(e)}saveState(){var e=super.saveState();return e.serial=this.serial.saveState(),e.serview=this.serview.saveState(),e}loadState(e){super.loadState(e),this.serial.loadState(e.serial),this.serview.loadState(e.serview)}newMachine(){return new s}getPresets(){return S}readAddress(e){return this.machine.readConst(e)}};f["devel-6502"]=o;export{u as SerialTestHarness};
//# sourceMappingURL=devel-SCOVN7GF.js.map
File renamed without changes.
+1 -1
View File
@@ -1,2 +1,2 @@
import{b as v,c as P}from"./chunk-KJNUV3FX.js";import{A as p,E as w,K as c,l as u,m,y as g}from"./chunk-NIHHDIEJ.js";import{e as I}from"./chunk-KT7KMEQC.js";var k=I(P()),i,a,l,h=(function(e){if(!e||e.length==0)return{};for(var r={},t=0;t<e.length;++t){var o=e[t].split("=",2);o.length==1?r[o[0]]="":r[o[0]]=decodeURIComponent(o[1].replace(/\+/g," "))}return r})(window.location.search.substr(1).split("&"));function x(){typeof window.onerror=="object"&&(window.onerror=function(e,r,t,o,n){var s=e+" "+r+" "+t+":"+o+", "+n;$.get("/error?msg="+encodeURIComponent(s),"text")})}function M(){var e=!1;document.addEventListener("visibilitychange",function(r){document.visibilityState=="hidden"&&a.isRunning()?(a.pause(),e=!0):document.visibilityState=="visible"&&e&&(a.resume(),e=!1)}),$(window).on("focus",function(){e&&(a.resume(),e=!1)}),$(window).on("blur",function(){a.isRunning()&&(a.pause(),e=!0)})}async function y(e,r){if(!r){alert("No ROM found.");return}console.log(r.length+" bytes"),await a.loadROM(e,r),a.resume()}function R(){return $("#emulator").find("canvas")}function E(e,r,t){w("gif.js/dist/gif.js").then(()=>{var o=R()[0];if(!o){alert("Could not find canvas element to record video!");return}var n=0;o.style&&o.style.transform&&(o.style.transform.indexOf("rotate(-90deg)")>=0?n=-1:o.style.transform.indexOf("rotate(90deg)")>=0&&(n=1));var s=new GIF({workerScript:"gif.js/dist/gif.worker.js",workers:4,quality:10,rotate:n});s.on("finished",function(C){console.log("finished encoding GIF"),t(C)}),e=e||100+(Math.random()*256&3),r=r||100+(Math.random()*256&15);var f=0;console.log("Recording video",o);var d=()=>{f++>r?(console.log("Rendering video"),s.render()):(s.addFrame(o,{delay:e,copy:!0}),setTimeout(d,e))};d()})}async function S(e){if(!c[i])throw Error("Invalid platform '"+i+"'.");a=new c[i]($("#emuscreen")[0]),await a.start(),e.rec&&R().on("focus",()=>{a.resume()});var r=e.n||"Game",t,o=e.url,n=e.r;if(o)return console.log(o),g(o,f=>{y(r,f)},"arraybuffer"),!0;if(n){var s=m(atob(n));t=new u().decode(s)}return M(),y(r,t),!0}async function b(e){if(e.data&&(e=e.data),i=e.p,!i)throw new Error("No platform variable!");try{var r=await v(p(i));console.log("starting platform",i),await S(e)}catch(t){console.log(t),alert('Platform "'+i+'" not supported.')}}function F(){x(),h.p&&b(h)}window.addEventListener("message",O,!1);function O(e){if(e.data){var r=e.data.cmd;if(r=="start"&&!a)b(e);else if(r=="reset")a.reset(),l.reset();else if(r=="getReplay"){var t={frameCount:l.frameCount,checkpoints:l.checkpoints,framerecs:l.framerecs,checkpointInterval:l.checkpointInterval,maxCheckpoints:l.maxCheckpoints};e.source.postMessage({ack:r,replay:t},e.origin)}else if(r=="watchState"){var o=new Function("platform","state",e.data.fn);l.callbackNewCheckpoint=n=>{e.source.postMessage({ack:r,state:o(a,n)},e.origin)}}else r=="recordVideo"?E(e.data.intervalMsec,e.data.maxFrames,function(n){e.data.filename&&(0,k.saveAs)(n,e.data.filename),e.source.postMessage({ack:r,gif:n},e.origin)}):console.log("Unknown data.cmd: "+r)}}self===top&&(document.body.style.backgroundColor="#555");F();export{a as platform,i as platform_id,F as startEmbed,l as stateRecorder};
import{b as v,c as P}from"./chunk-XFAJRCL6.js";import{A as p,E as w,K as c,l as u,m,y as g}from"./chunk-NIHHDIEJ.js";import{e as I}from"./chunk-KT7KMEQC.js";var k=I(P()),i,a,l,h=(function(e){if(!e||e.length==0)return{};for(var r={},t=0;t<e.length;++t){var o=e[t].split("=",2);o.length==1?r[o[0]]="":r[o[0]]=decodeURIComponent(o[1].replace(/\+/g," "))}return r})(window.location.search.substr(1).split("&"));function x(){typeof window.onerror=="object"&&(window.onerror=function(e,r,t,o,n){var s=e+" "+r+" "+t+":"+o+", "+n;$.get("/error?msg="+encodeURIComponent(s),"text")})}function M(){var e=!1;document.addEventListener("visibilitychange",function(r){document.visibilityState=="hidden"&&a.isRunning()?(a.pause(),e=!0):document.visibilityState=="visible"&&e&&(a.resume(),e=!1)}),$(window).on("focus",function(){e&&(a.resume(),e=!1)}),$(window).on("blur",function(){a.isRunning()&&(a.pause(),e=!0)})}async function y(e,r){if(!r){alert("No ROM found.");return}console.log(r.length+" bytes"),await a.loadROM(e,r),a.resume()}function R(){return $("#emulator").find("canvas")}function E(e,r,t){w("gif.js/dist/gif.js").then(()=>{var o=R()[0];if(!o){alert("Could not find canvas element to record video!");return}var n=0;o.style&&o.style.transform&&(o.style.transform.indexOf("rotate(-90deg)")>=0?n=-1:o.style.transform.indexOf("rotate(90deg)")>=0&&(n=1));var s=new GIF({workerScript:"gif.js/dist/gif.worker.js",workers:4,quality:10,rotate:n});s.on("finished",function(C){console.log("finished encoding GIF"),t(C)}),e=e||100+(Math.random()*256&3),r=r||100+(Math.random()*256&15);var f=0;console.log("Recording video",o);var d=()=>{f++>r?(console.log("Rendering video"),s.render()):(s.addFrame(o,{delay:e,copy:!0}),setTimeout(d,e))};d()})}async function S(e){if(!c[i])throw Error("Invalid platform '"+i+"'.");a=new c[i]($("#emuscreen")[0]),await a.start(),e.rec&&R().on("focus",()=>{a.resume()});var r=e.n||"Game",t,o=e.url,n=e.r;if(o)return console.log(o),g(o,f=>{y(r,f)},"arraybuffer"),!0;if(n){var s=m(atob(n));t=new u().decode(s)}return M(),y(r,t),!0}async function b(e){if(e.data&&(e=e.data),i=e.p,!i)throw new Error("No platform variable!");try{var r=await v(p(i));console.log("starting platform",i),await S(e)}catch(t){console.log(t),alert('Platform "'+i+'" not supported.')}}function F(){x(),h.p&&b(h)}window.addEventListener("message",O,!1);function O(e){if(e.data){var r=e.data.cmd;if(r=="start"&&!a)b(e);else if(r=="reset")a.reset(),l.reset();else if(r=="getReplay"){var t={frameCount:l.frameCount,checkpoints:l.checkpoints,framerecs:l.framerecs,checkpointInterval:l.checkpointInterval,maxCheckpoints:l.maxCheckpoints};e.source.postMessage({ack:r,replay:t},e.origin)}else if(r=="watchState"){var o=new Function("platform","state",e.data.fn);l.callbackNewCheckpoint=n=>{e.source.postMessage({ack:r,state:o(a,n)},e.origin)}}else r=="recordVideo"?E(e.data.intervalMsec,e.data.maxFrames,function(n){e.data.filename&&(0,k.saveAs)(n,e.data.filename),e.source.postMessage({ack:r,gif:n},e.origin)}):console.log("Unknown data.cmd: "+r)}}self===top&&(document.body.style.backgroundColor="#555");F();export{a as platform,i as platform_id,F as startEmbed,l as stateRecorder};
//# sourceMappingURL=embedui.js.map
+15 -13
View File
@@ -219,23 +219,25 @@ class AssetEditorView {
}
}
// look for DEF_METASPRITE_2x2(playerRStand, 0xd8, 0)
// TODO: could also look in ROM
// TODO: this feature was never implemented, it would require a totally new type of editor and stuff
/*
var re2 = /DEF_METASPRITE_(\d+)x(\d+)[(](\w+),\s*(\w+),\s*(\w+)/gi;
while (m = re2.exec(data)) {
var width = parseInt(m[1]);
var height = parseInt(m[2]);
var ident = m[3];
var tile = parseInt(m[4]);
var attr = parseInt(m[5]);
var metadefs = [];
for (var x = 0; x < width; x++) {
for (var y = 0; y < height; y++) {
metadefs.push({ x: x * 8, y: y * 8, tile: tile, attr: attr });
}
var width = parseInt(m[1]);
var height = parseInt(m[2]);
var ident = m[3];
var tile = parseInt(m[4]);
var attr = parseInt(m[5]);
var metadefs = [];
for (var x = 0; x < width; x++) {
for (var y = 0; y < height; y++) {
metadefs.push({ x: x * 8, y: y * 8, tile: tile, attr: attr });
}
var meta = { defs: metadefs, width: width * 8, height: height * 8 };
result.push({ fileid: id, label: ident, meta: meta });
}
var meta = { defs: metadefs, width: width * 8, height: height * 8 };
result.push({ fileid: id, label: ident, meta: meta });
}
*/
// TODO: look for decode <ident> --- ... ---
/*
var re3 = /\bdecode\s+(\w+)\s*---(.+?)---/gims;
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"asseteditor.js","sourceRoot":"","sources":["../../../src/ide/views/asseteditor.ts"],"names":[],"mappings":"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 truncated
{"version":3,"file":"asseteditor.js","sourceRoot":"","sources":["../../../src/ide/views/asseteditor.ts"],"names":[],"mappings":"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 truncated
+1 -1
View File
@@ -1,2 +1,2 @@
import{A as z,B as A,C as B,D as C,b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r as q,s as r,t as s,u as t,v as u,w as v,x as w,y as x,z as y}from"./chunk-EFP34EU3.js";import"./chunk-JSIZCY7X.js";import"./chunk-LNOKARBD.js";import"./chunk-KJNUV3FX.js";import"./chunk-ZBO3TMVB.js";import"./chunk-NIHHDIEJ.js";import"./chunk-KT7KMEQC.js";export{q as clearBreakpoint,f as current_project,A as emulationHalted,n as getCurrentEditorFilename,m as getCurrentMainFilename,k as getCurrentOutput,j as getCurrentProject,v as getPlatformAndRepo,i as getPlatformStore,z as getSaveState,y as getTestOutput,l as getWorkerParams,t as gotoNewLocation,s as haltEmulation,C as highlightSearch,h as lastDebugState,e as platform,b as platform_id,g as projectWindows,a as qs,B as reloadWorkspaceFile,d as repo_id,p as runToPC,r as setFrameRateUI,x as setTestInput,o as setupBreakpoint,u as setupSplits,w as startUI,c as store_id};
import{A as z,B as A,C as B,D as C,b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r as q,s as r,t as s,u as t,v as u,w as v,x as w,y as x,z as y}from"./chunk-RID3TRKY.js";import"./chunk-JSIZCY7X.js";import"./chunk-LNOKARBD.js";import"./chunk-XFAJRCL6.js";import"./chunk-ZBO3TMVB.js";import"./chunk-NIHHDIEJ.js";import"./chunk-KT7KMEQC.js";export{q as clearBreakpoint,f as current_project,A as emulationHalted,n as getCurrentEditorFilename,m as getCurrentMainFilename,k as getCurrentOutput,j as getCurrentProject,v as getPlatformAndRepo,i as getPlatformStore,z as getSaveState,y as getTestOutput,l as getWorkerParams,t as gotoNewLocation,s as haltEmulation,C as highlightSearch,h as lastDebugState,e as platform,b as platform_id,g as projectWindows,a as qs,B as reloadWorkspaceFile,d as repo_id,p as runToPC,r as setFrameRateUI,x as setTestInput,o as setupBreakpoint,u as setupSplits,w as startUI,c as store_id};
//# sourceMappingURL=ui.js.map
+3 -1
View File
@@ -193,7 +193,8 @@ export class AssetEditorView implements ProjectView, pixed.EditorContext {
}
}
// look for DEF_METASPRITE_2x2(playerRStand, 0xd8, 0)
// TODO: could also look in ROM
// TODO: this feature was never implemented, it would require a totally new type of editor and stuff
/*
var re2 = /DEF_METASPRITE_(\d+)x(\d+)[(](\w+),\s*(\w+),\s*(\w+)/gi;
while (m = re2.exec(data)) {
var width = parseInt(m[1]);
@@ -210,6 +211,7 @@ export class AssetEditorView implements ProjectView, pixed.EditorContext {
var meta = { defs: metadefs, width: width * 8, height: height * 8 };
result.push({ fileid: id, label: ident, meta: meta });
}
*/
// TODO: look for decode <ident> --- ... ---
/*
var re3 = /\bdecode\s+(\w+)\s*---(.+?)---/gims;