|
|
|
@@ -1,21 +1,21 @@
|
|
|
|
|
import{a as $u,b as ku,c as H$,d as pb,e as mb,f as gb,g as zl,h as Lr,j as Ml,k as Ll,l as $s,m as K$}from"./chunk-CZNGOAGP.js";import{a as G$}from"./chunk-T6VURU5O.js";import{a as Ul}from"./chunk-A7SWO6EA.js";import{a as Ob,b as bb,c as J$}from"./chunk-Y4RZDW4X.js";import{D as Qu,K as Pu,t as ub,u as fb}from"./chunk-ELRBFCEX.js";import{A as Mr,E as xr,F as wu,G as Qs,I as Ps,J as El,K as vu,T as yu,V as hb,a as si,b as Uo,ba as Zl,d as ft,e as zo,f as Pt,g as be,h as xu,i as ab,k as lb,m as Rl,n as Cl,o as Al,p as Xn,q as cb,t as ys,w as db,x as Su,y as Mo,z as $t}from"./chunk-TYDI7JZQ.js";import{a as tt,b as Tn,c as Zo,d as ob,e as bu}from"./chunk-VSC4MAII.js";var Xu=ob((xb,Tu)=>{(function(r){if(typeof xb=="object"&&typeof Tu!="undefined")Tu.exports=r();else if(typeof define=="function"&&define.amd)define([],r);else{var e;typeof window!="undefined"?e=window:typeof global!="undefined"?e=global:typeof self!="undefined"?e=self:e=this,e.localforage=r()}})(function(){var r,e,t;return(function i(n,s,o){function a(d,h){if(!s[d]){if(!n[d]){var u=typeof Zo=="function"&&Zo;if(!h&&u)return u(d,!0);if(l)return l(d,!0);var f=new Error("Cannot find module '"+d+"'");throw f.code="MODULE_NOT_FOUND",f}var p=s[d]={exports:{}};n[d][0].call(p.exports,function(m){var S=n[d][1][m];return a(S||m)},p,p.exports,i,n,s,o)}return s[d].exports}for(var l=typeof Zo=="function"&&Zo,c=0;c<o.length;c++)a(o[c]);return a})({1:[function(i,n,s){(function(o){"use strict";var a=o.MutationObserver||o.WebKitMutationObserver,l;if(a){var c=0,d=new a(m),h=o.document.createTextNode("");d.observe(h,{characterData:!0}),l=function(){h.data=c=++c%2}}else if(!o.setImmediate&&typeof o.MessageChannel!="undefined"){var u=new o.MessageChannel;u.port1.onmessage=m,l=function(){u.port2.postMessage(0)}}else"document"in o&&"onreadystatechange"in o.document.createElement("script")?l=function(){var y=o.document.createElement("script");y.onreadystatechange=function(){m(),y.onreadystatechange=null,y.parentNode.removeChild(y),y=null},o.document.documentElement.appendChild(y)}:l=function(){setTimeout(m,0)};var f,p=[];function m(){f=!0;for(var y,A,R=p.length;R;){for(A=p,p=[],y=-1;++y<R;)A[y]();R=p.length}f=!1}n.exports=S;function S(y){p.push(y)===1&&!f&&l()}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(i,n,s){"use strict";var o=i(1);function a(){}var l={},c=["REJECTED"],d=["FULFILLED"],h=["PENDING"];n.exports=u;function u(P){if(typeof P!="function")throw new TypeError("resolver must be a function");this.state=h,this.queue=[],this.outcome=void 0,P!==a&&S(this,P)}u.prototype.catch=function(P){return this.then(null,P)},u.prototype.then=function(P,C){if(typeof P!="function"&&this.state===d||typeof C!="function"&&this.state===c)return this;var z=new this.constructor(a);if(this.state!==h){var q=this.state===d?P:C;p(z,q,this.outcome)}else this.queue.push(new f(z,P,C));return z};function f(P,C,z){this.promise=P,typeof C=="function"&&(this.onFulfilled=C,this.callFulfilled=this.otherCallFulfilled),typeof z=="function"&&(this.onRejected=z,this.callRejected=this.otherCallRejected)}f.prototype.callFulfilled=function(P){l.resolve(this.promise,P)},f.prototype.otherCallFulfilled=function(P){p(this.promise,this.onFulfilled,P)},f.prototype.callRejected=function(P){l.reject(this.promise,P)},f.prototype.otherCallRejected=function(P){p(this.promise,this.onRejected,P)};function p(P,C,z){o(function(){var q;try{q=C(z)}catch(ne){return l.reject(P,ne)}q===P?l.reject(P,new TypeError("Cannot resolve promise with itself")):l.resolve(P,q)})}l.resolve=function(P,C){var z=y(m,C);if(z.status==="error")return l.reject(P,z.value);var q=z.value;if(q)S(P,q);else{P.state=d,P.outcome=C;for(var ne=-1,se=P.queue.length;++ne<se;)P.queue[ne].callFulfilled(C)}return P},l.reject=function(P,C){P.state=c,P.outcome=C;for(var z=-1,q=P.queue.length;++z<q;)P.queue[z].callRejected(C);return P};function m(P){var C=P&&P.then;if(P&&(typeof P=="object"||typeof P=="function")&&typeof C=="function")return function(){C.apply(P,arguments)}}function S(P,C){var z=!1;function q(fe){z||(z=!0,l.reject(P,fe))}function ne(fe){z||(z=!0,l.resolve(P,fe))}function se(){C(ne,q)}var te=y(se);te.status==="error"&&q(te.value)}function y(P,C){var z={};try{z.value=P(C),z.status="success"}catch(q){z.status="error",z.value=q}return z}u.resolve=A;function A(P){return P instanceof this?P:l.resolve(new this(a),P)}u.reject=R;function R(P){var C=new this(a);return l.reject(C,P)}u.all=U;function U(P){var C=this;if(Object.prototype.toString.call(P)!=="[object Array]")return this.reject(new TypeError("must be an array"));var z=P.length,q=!1;if(!z)return this.resolve([]);for(var ne=new Array(z),se=0,te=-1,fe=new this(a);++te<z;)Oe(P[te],te);return fe;function Oe(ye,M){C.resolve(ye).then(oe,function(G){q||(q=!0,l.reject(fe,G))});function oe(G){ne[M]=G,++se===z&&!q&&(q=!0,l.resolve(fe,ne))}}}u.race=T;function T(P){var C=this;if(Object.prototype.toString.call(P)!=="[object
Line truncated
|
|
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function P5(r,e){return v5(r)||y5(r,e)||$5(r,e)||Q5()}function $5(r,e){if(r){if(typeof r=="string")return zP(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?zP(r,e):void 0}}var KP=Object.entries,MP=Object.setPrototypeOf,k5=Object.isFrozen,T5=Object.getPrototypeOf,X5=Object.getOwnPropertyDescriptor,mt=Object.freeze,gt=Object.seal,mo=Object.create,JP=typeof Reflect!="undefined"&&Reflect,Ug=JP.apply,zg=JP.construct;mt||(mt=function(e){return e});gt||(gt=function(e){return e});Ug||(Ug=function(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),s=2;s<i;s++)n[s-2]=arguments[s];return e.apply(t,n)});zg||(zg=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return new e(...i)});var ls=ut(Array.prototype.forEach),_5=ut(Array.prototype.lastIndexOf),LP=ut(Array.prototype.pop),rl=ut(Array.prototype.push),R5=ut(Array.prototype.splice),go=Array.isArray,sl=ut(String.prototype.toLowerCase),_g=ut(String.prototype.toString),YP=ut(String.prototype.match),il=ut(String.prototype.replace),WP=ut(String.prototype.indexOf),C5=ut(String.prototype.trim),A5=ut(Number.prototype.toString),E5=ut(Boolean.prototype.toString),VP=typeof BigInt=="undefined"?null:ut(BigInt.prototype.toString),jP=typeof Symbol=="undefined"?null:ut(Symbol.prototype.toString),rr=ut(Object.prototype.hasOwnProperty),nl=ut(Object.prototype.toString),Ct=ut(RegExp.prototype.test),as=Z5(TypeError);function ut(r){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return Ug(r,e,i)}}function Z5(r){return function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return zg(r,t)}}function Ae(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:sl;if(MP&&MP(r,null),!go(e))return r;let i=e.length;for(;i--;){let n=e[i];if(typeof n=="string"){let s=t(n);s!==n&&(k5(e)||(e[i]=s),n=s)}r[n]=!0}return r}function U5(r){for(let e=0;e<r.length;e++)rr(r,e)||(r[e]=null);return r}function fr(r){let e=mo(null);for(let i of KP(r)){var t=P5(i,2);let n=t[0],s=t[1];rr(r,n)&&(go(s)?e[n]=U5(s):s&&typeof s=="object"&&s.constructor===Object?e[n]=fr(s):e[n]=s)}return e}function z5(r){switch(typeof r){case"string":return r;case"number":return A5(r);case"boolean":return E5(r);case"bigint":return VP?VP(r):"0";case"symbol":return jP?jP(r):"Symbol()";case"undefined":return nl(r);case"function":case"object":{if(r===null)return nl(r);let e=r,t=Ar(e,"toString");if(typeof t=="function"){let i=t(e);return typeof i=="string"?i:nl(i)}return nl(r)}default:return nl(r)}}function Ar(r,e){for(;r!==null;){let i=X5(r,e);if(i){if(i.get)return ut(i.get);if(typeof i.value=="function")return ut(i.value)}r=T5(r)}function t(){return null}return t}function M5(r){try{return Ct(r,""),!0}catch(e){return!1}}var DP=mt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Rg=mt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Cg=mt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),L5=mt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-gly
Line truncated
|
|
|
|
|
`+et),zr&&(et=x(et)),ne&&gs?M(et):et},e.setConfig=function(){let I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Eo(I),ps=!0,wn=Ve,vn=je},e.clearConfig=function(){Wi=null,ps=!1,wn=null,vn=null,ne=te,se=""},e.isValidAttribute=function(I,b,_){Wi||Eo({});let Y=Je(I),ie=Je(b);return Ee(Y,ie,_)},e.addHook=function(I,b){typeof b=="function"&&rr(Re,I)&&rl(Re[I],b)},e.removeHook=function(I,b){if(rr(Re,I)){if(b!==void 0){let _=_5(Re[I],b);return _===-1?void 0:R5(Re[I],_,1)[0]}return LP(Re[I])}},e.removeHooks=function(I){rr(Re,I)&&(Re[I]=[])},e.removeAllHooks=function(){Re=HP()},e}var rz=t$();r$.exports=rz});var Hg=bu(Xu());var Me=[/^\s*[.#%]?(include|incbin|embed)\s+"(.+?)"/gmi,/^\s*([;']|[/][/])#(resource)\s+"(.+?)"/gm],Ie=[/^\s*([;]|[/][/])#link\s+"(.+?)"/gm],Lo=[/^\s*(`include|[.]include)\s+"(.+?)"/gmi,/^\s*\$(include|\$dofile|\$write_image_in_table)\('(.+?)'/gmi,{re:/^\s*([.]arch)\s+(\w+)/gmi,suffix:".json"},/\$readmem[bh]\("(.+?)"/gmi],ek=[{re:/^\s*[.#%]?\s*include\s+<(.+?)>/gmi,system:!0}];function vb(r){let e=r&&Bt(r);return e&&e.includeDirs&&e.includeDirs.length?ek:[]}var Sb=[/^\s+(USE|ASM)\s+(\S+[.]\S+)/gm],tk=[/^[!]src\s+"(.+?)"/gmi],rk=[{re:/^\s*import\s*"(.+?)";/gmi,suffix:".wiz"},/^\s*embed\s*"(.+?)";/gmi],ik=[/^\s*(import)\s*"(.+?)"/gmi],nk=[/^\s*%%\s*#include\s+"(.+?)"/gm],wb={apple2:{preloadFS:"65-apple2"},c64:{preloadFS:"65-c64"},vic20:{preloadFS:"65-vic20"},nes:{preloadFS:"65-nes"},atari8:{preloadFS:"65-atari8"},vector:{preloadFS:"65-none"},atari7800:{preloadFS:"65-none"},devel:{preloadFS:"65-none"},vcs:{preloadFS:"65-atari2600"},pce:{preloadFS:"65-pce"},exidy:{preloadFS:"65-none"}},ks={dasm:{id:"dasm",name:"DASM",kind:"assembler",arch:"6502",extensions:[".dasm"],editorStyle:"6502",helpURL:"https://raw.githubusercontent.com/dasm-assembler/dasm/refs/tags/v2.20.17/docs/dasm.txt",wasmModule:"dasm-wasisdk",version:"2.20.17",includePatterns:Me,linkPatterns:Ie},acme:{id:"acme",name:"ACME",kind:"assembler",arch:"6502",extensions:[".acme"],editorStyle:"6502",helpURL:"https://raw.githubusercontent.com/sehugg/acme/main/docs/QuickRef.txt",wasmModule:"acme",version:"0.97.1",includePatterns:[...Me,...tk],linkPatterns:Ie},xa:{id:"xa",name:"XA",kind:"assembler",arch:"6502",extensions:[".xa"],editorStyle:"6502",helpURL:"https://www.floodgap.com/retrotech/xa/",wasmModule:"xa",version:"2.4.1",includePatterns:Me,linkPatterns:Ie},nesasm:{id:"nesasm",name:"NESASM",kind:"assembler",arch:"6502",extensions:[".nesasm"],editorStyle:"6502",helpURL:"https://github.com/camsaul/nesasm",wasmModule:"nesasm",version:"3.1",includePatterns:Me,linkPatterns:Ie},merlin32:{id:"merlin32",name:"Merlin 32",kind:"assembler",arch:"6502",extensions:[".lnk"],editorStyle:"6502",helpURL:"https://github.com/apple2accumulator/merlin32",wasmModule:"merlin32",version:"1.1.10",includePatterns:[...Me,...Sb],linkPatterns:Ie},cc65:{id:"cc65",name:"cc65",kind:"compiler",arch:"6502",extensions:[".c",".h"],includeDirs:["/include","/asminc"],editorStyle:"text/x-csrc",helpURL:"https://cc65.github.io/doc/cc65.html",wasmModule:"cc65",version:"2.19",defineFlag:"-D",defineInline:!0,platforms:wb,includePatterns:Me,linkPatterns:Ie},ca65:{id:"ca65",name:"ca65",kind:"assembler",arch:"6502",extensions:[".s",".ca65",".inc"],includeDirs:["/include","/asminc"],editorStyle:"6502",helpURL:"https://cc65.github.io/doc/ca65.html",wasmModule:"ca65",version:"2.19",defineFlag:"-D",defineInline:!1,platforms:wb,includePatterns:Me,linkPatterns:Ie},ld65:{id:"ld65",name:"ld65",kind:"linker",arch:"6502",extensions:[],wasmModule:"ld65",version:"2.19",linkSymbolFlag:"-D",linkSymbolInline:!1},sdcc:{id:"sdcc",name:"SDCC",kind:"compiler",arch:"z80",extensions:[".c",".h"],includeDirs:["/include"],editorStyle:"text/x-csrc",helpURL:"http://sdcc.sourceforge.net/doc/sdccman.pdf",wasmModule:"sdcc",version:"3.6.5",defineFlag:"-D",defineInline:!0,platforms:{default:{preloadFS:"sdcc"}},includePatterns:Me,linkPatterns:Ie},sdasz80:{id:"sdasz80",name:"sdasz80",kind:"assembler",arch:"z80",extensions:[".s"],includeDirs:["/include"],editorStyle:"z80",wasmModule:"sdasz80",version:"02.00",platforms:{default:{preloadFS:"sdcc"}},includePatterns:Me,linkPatterns:Ie},sdasgb:{id:"sdasgb",name:"sdasgb",kind:"assembler",arch:"gbz80",extensions:[".sgb"],includeDirs:["/include"],editorStyle:"z80",wasmModule:"sdasgb",platforms:{default:{preloadFS:"sdcc"}},includePatterns:Me,linkPatterns:Ie},sdldz80:{id:"sdldz80",name:"sdldz80",kind:"linker",arch:"z80",extensions:[],wasmModule:"sdldz80",version:"03.00",linkSymbolFlag:"-g",linkSymbolInline:!1},sccz80:{id:"sccz80",name:"sccz80",kind:"compiler",arch:"z80",extensions:[".scc"],platforms:{default:{preloadFS:"sccz80"}},noWorkerBuild:!0},naken:{id:"naken",name:"Naken",kind:"assembler",extensions:[".ns"],helpURL:"https://github.com/mikeakohn/naken_asm",noWorkerBuild:!0},zmac:{id:"zmac",name:"zmac",kind:"assembler",arch:"z80",extensions:[".z"],editorStyle:"z80",helpURL:"https://raw.githubusercontent.com/sehugg/zmac/master/doc.txt",wasmModule:"zmac",version:"28jul2Line truncated
|
|
|
|
|
import{a as $u,b as ku,c as Ob,d as pb,e as mb,f as zl,g as Lr,i as Ml,j as Ll,k as $s,l as G$}from"./chunk-22ZJCPEG.js";import{a as N$}from"./chunk-T6VURU5O.js";import{a as Ul}from"./chunk-A7SWO6EA.js";import{a as fb,b as gb,c as H$}from"./chunk-F6OOEJJR.js";import{D as Qu,K as Pu,t as hb,u as ub}from"./chunk-ELRBFCEX.js";import{A as Mr,E as xr,F as wu,G as Qs,I as Ps,J as El,K as vu,T as yu,V as db,a as si,b as Uo,ba as Zl,d as ft,e as zo,f as Pt,g as be,h as xu,i as ob,k as ab,m as Rl,n as Cl,o as Al,p as Xn,q as lb,t as ys,w as cb,x as Su,y as Mo,z as $t}from"./chunk-TYDI7JZQ.js";import{a as tt,b as Tn,c as Zo,d as sb,e as bu}from"./chunk-VSC4MAII.js";var Xu=sb((bb,Tu)=>{(function(r){if(typeof bb=="object"&&typeof Tu!="undefined")Tu.exports=r();else if(typeof define=="function"&&define.amd)define([],r);else{var e;typeof window!="undefined"?e=window:typeof global!="undefined"?e=global:typeof self!="undefined"?e=self:e=this,e.localforage=r()}})(function(){var r,e,t;return(function i(n,s,o){function a(d,h){if(!s[d]){if(!n[d]){var u=typeof Zo=="function"&&Zo;if(!h&&u)return u(d,!0);if(l)return l(d,!0);var f=new Error("Cannot find module '"+d+"'");throw f.code="MODULE_NOT_FOUND",f}var p=s[d]={exports:{}};n[d][0].call(p.exports,function(m){var S=n[d][1][m];return a(S||m)},p,p.exports,i,n,s,o)}return s[d].exports}for(var l=typeof Zo=="function"&&Zo,c=0;c<o.length;c++)a(o[c]);return a})({1:[function(i,n,s){(function(o){"use strict";var a=o.MutationObserver||o.WebKitMutationObserver,l;if(a){var c=0,d=new a(m),h=o.document.createTextNode("");d.observe(h,{characterData:!0}),l=function(){h.data=c=++c%2}}else if(!o.setImmediate&&typeof o.MessageChannel!="undefined"){var u=new o.MessageChannel;u.port1.onmessage=m,l=function(){u.port2.postMessage(0)}}else"document"in o&&"onreadystatechange"in o.document.createElement("script")?l=function(){var y=o.document.createElement("script");y.onreadystatechange=function(){m(),y.onreadystatechange=null,y.parentNode.removeChild(y),y=null},o.document.documentElement.appendChild(y)}:l=function(){setTimeout(m,0)};var f,p=[];function m(){f=!0;for(var y,A,R=p.length;R;){for(A=p,p=[],y=-1;++y<R;)A[y]();R=p.length}f=!1}n.exports=S;function S(y){p.push(y)===1&&!f&&l()}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(i,n,s){"use strict";var o=i(1);function a(){}var l={},c=["REJECTED"],d=["FULFILLED"],h=["PENDING"];n.exports=u;function u(P){if(typeof P!="function")throw new TypeError("resolver must be a function");this.state=h,this.queue=[],this.outcome=void 0,P!==a&&S(this,P)}u.prototype.catch=function(P){return this.then(null,P)},u.prototype.then=function(P,C){if(typeof P!="function"&&this.state===d||typeof C!="function"&&this.state===c)return this;var z=new this.constructor(a);if(this.state!==h){var q=this.state===d?P:C;p(z,q,this.outcome)}else this.queue.push(new f(z,P,C));return z};function f(P,C,z){this.promise=P,typeof C=="function"&&(this.onFulfilled=C,this.callFulfilled=this.otherCallFulfilled),typeof z=="function"&&(this.onRejected=z,this.callRejected=this.otherCallRejected)}f.prototype.callFulfilled=function(P){l.resolve(this.promise,P)},f.prototype.otherCallFulfilled=function(P){p(this.promise,this.onFulfilled,P)},f.prototype.callRejected=function(P){l.reject(this.promise,P)},f.prototype.otherCallRejected=function(P){p(this.promise,this.onRejected,P)};function p(P,C,z){o(function(){var q;try{q=C(z)}catch(ne){return l.reject(P,ne)}q===P?l.reject(P,new TypeError("Cannot resolve promise with itself")):l.resolve(P,q)})}l.resolve=function(P,C){var z=y(m,C);if(z.status==="error")return l.reject(P,z.value);var q=z.value;if(q)S(P,q);else{P.state=d,P.outcome=C;for(var ne=-1,se=P.queue.length;++ne<se;)P.queue[ne].callFulfilled(C)}return P},l.reject=function(P,C){P.state=c,P.outcome=C;for(var z=-1,q=P.queue.length;++z<q;)P.queue[z].callRejected(C);return P};function m(P){var C=P&&P.then;if(P&&(typeof P=="object"||typeof P=="function")&&typeof C=="function")return function(){C.apply(P,arguments)}}function S(P,C){var z=!1;function q(fe){z||(z=!0,l.reject(P,fe))}function ne(fe){z||(z=!0,l.resolve(P,fe))}function se(){C(ne,q)}var te=y(se);te.status==="error"&&q(te.value)}function y(P,C){var z={};try{z.value=P(C),z.status="success"}catch(q){z.status="error",z.value=q}return z}u.resolve=A;function A(P){return P instanceof this?P:l.resolve(new this(a),P)}u.reject=R;function R(P){var C=new this(a);return l.reject(C,P)}u.all=U;function U(P){var C=this;if(Object.prototype.toString.call(P)!=="[object Array]")return this.reject(new TypeError("must be an array"));var z=P.length,q=!1;if(!z)return this.resolve([]);for(var ne=new Array(z),se=0,te=-1,fe=new this(a);++te<z;)Oe(P[te],te);return fe;function Oe(ye,M){C.resolve(ye).then(oe,function(G){q||(q=!0,l.reject(fe,G))});function oe(G){ne[M]=G,++se===z&&!q&&(q=!0,l.resolve(fe,ne))}}}u.race=T;function T(P){var C=this;if(Object.prototype.toString.call(P)!=="[object Array]")Line truncated
|
|
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function y5(r,e){return S5(r)||w5(r,e)||Q5(r,e)||v5()}function Q5(r,e){if(r){if(typeof r=="string")return UP(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?UP(r,e):void 0}}var HP=Object.entries,zP=Object.setPrototypeOf,P5=Object.isFrozen,$5=Object.getPrototypeOf,k5=Object.getOwnPropertyDescriptor,mt=Object.freeze,gt=Object.seal,mo=Object.create,KP=typeof Reflect!="undefined"&&Reflect,Ug=KP.apply,zg=KP.construct;mt||(mt=function(e){return e});gt||(gt=function(e){return e});Ug||(Ug=function(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),s=2;s<i;s++)n[s-2]=arguments[s];return e.apply(t,n)});zg||(zg=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return new e(...i)});var ls=ut(Array.prototype.forEach),T5=ut(Array.prototype.lastIndexOf),MP=ut(Array.prototype.pop),rl=ut(Array.prototype.push),X5=ut(Array.prototype.splice),go=Array.isArray,sl=ut(String.prototype.toLowerCase),_g=ut(String.prototype.toString),LP=ut(String.prototype.match),il=ut(String.prototype.replace),YP=ut(String.prototype.indexOf),_5=ut(String.prototype.trim),R5=ut(Number.prototype.toString),C5=ut(Boolean.prototype.toString),WP=typeof BigInt=="undefined"?null:ut(BigInt.prototype.toString),VP=typeof Symbol=="undefined"?null:ut(Symbol.prototype.toString),rr=ut(Object.prototype.hasOwnProperty),nl=ut(Object.prototype.toString),Ct=ut(RegExp.prototype.test),as=A5(TypeError);function ut(r){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return Ug(r,e,i)}}function A5(r){return function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return zg(r,t)}}function Ae(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:sl;if(zP&&zP(r,null),!go(e))return r;let i=e.length;for(;i--;){let n=e[i];if(typeof n=="string"){let s=t(n);s!==n&&(P5(e)||(e[i]=s),n=s)}r[n]=!0}return r}function E5(r){for(let e=0;e<r.length;e++)rr(r,e)||(r[e]=null);return r}function fr(r){let e=mo(null);for(let i of HP(r)){var t=y5(i,2);let n=t[0],s=t[1];rr(r,n)&&(go(s)?e[n]=E5(s):s&&typeof s=="object"&&s.constructor===Object?e[n]=fr(s):e[n]=s)}return e}function Z5(r){switch(typeof r){case"string":return r;case"number":return R5(r);case"boolean":return C5(r);case"bigint":return WP?WP(r):"0";case"symbol":return VP?VP(r):"Symbol()";case"undefined":return nl(r);case"function":case"object":{if(r===null)return nl(r);let e=r,t=Ar(e,"toString");if(typeof t=="function"){let i=t(e);return typeof i=="string"?i:nl(i)}return nl(r)}default:return nl(r)}}function Ar(r,e){for(;r!==null;){let i=k5(r,e);if(i){if(i.get)return ut(i.get);if(typeof i.value=="function")return ut(i.value)}r=$5(r)}function t(){return null}return t}function U5(r){try{return Ct(r,""),!0}catch(e){return!1}}var jP=mt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Rg=mt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Cg=mt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),z5=mt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-gly
Line truncated
|
|
|
|
|
`+et),zr&&(et=x(et)),ne&&gs?M(et):et},e.setConfig=function(){let I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Eo(I),ps=!0,wn=Ve,vn=je},e.clearConfig=function(){Wi=null,ps=!1,wn=null,vn=null,ne=te,se=""},e.isValidAttribute=function(I,b,_){Wi||Eo({});let Y=Je(I),ie=Je(b);return Ee(Y,ie,_)},e.addHook=function(I,b){typeof b=="function"&&rr(Re,I)&&rl(Re[I],b)},e.removeHook=function(I,b){if(rr(Re,I)){if(b!==void 0){let _=T5(Re[I],b);return _===-1?void 0:X5(Re[I],_,1)[0]}return MP(Re[I])}},e.removeHooks=function(I){rr(Re,I)&&(Re[I]=[])},e.removeAllHooks=function(){Re=GP()},e}var ez=e$();t$.exports=ez});var Gg=bu(Xu());var Me=[/^\s*[.#%]?(include|incbin|embed)\s+"(.+?)"/gmi,/^\s*([;']|[/][/])#(resource)\s+"(.+?)"/gm],Ie=[/^\s*([;]|[/][/])#link\s+"(.+?)"/gm],Lo=[/^\s*(`include|[.]include)\s+"(.+?)"/gmi,/^\s*\$(include|\$dofile|\$write_image_in_table)\('(.+?)'/gmi,{re:/^\s*([.]arch)\s+(\w+)/gmi,suffix:".json"},/\$readmem[bh]\("(.+?)"/gmi],K$=[{re:/^\s*[.#%]?\s*include\s+<(.+?)>/gmi,system:!0}];function wb(r){let e=r&&Bt(r);return e&&e.includeDirs&&e.includeDirs.length?K$:[]}var xb=[/^\s+(USE|ASM)\s+(\S+[.]\S+)/gm],J$=[/^[!]src\s+"(.+?)"/gmi],ek=[{re:/^\s*import\s*"(.+?)";/gmi,suffix:".wiz"},/^\s*embed\s*"(.+?)";/gmi],tk=[/^\s*(import)\s*"(.+?)"/gmi],rk=[/^\s*%%\s*#include\s+"(.+?)"/gm],Sb={apple2:{preloadFS:"65-apple2"},c64:{preloadFS:"65-c64"},vic20:{preloadFS:"65-vic20"},nes:{preloadFS:"65-nes"},atari8:{preloadFS:"65-atari8"},vector:{preloadFS:"65-none"},atari7800:{preloadFS:"65-none"},devel:{preloadFS:"65-none"},vcs:{preloadFS:"65-atari2600"},pce:{preloadFS:"65-pce"},exidy:{preloadFS:"65-none"}},ks={dasm:{id:"dasm",name:"DASM",kind:"assembler",arch:"6502",extensions:[".dasm"],editorStyle:"6502",helpURL:"https://raw.githubusercontent.com/dasm-assembler/dasm/refs/tags/v2.20.17/docs/dasm.txt",wasmModule:"dasm-wasisdk",version:"2.20.17",includePatterns:Me,linkPatterns:Ie},acme:{id:"acme",name:"ACME",kind:"assembler",arch:"6502",extensions:[".acme"],editorStyle:"6502",helpURL:"https://raw.githubusercontent.com/sehugg/acme/main/docs/QuickRef.txt",wasmModule:"acme",version:"0.97.1",includePatterns:[...Me,...J$],linkPatterns:Ie},xa:{id:"xa",name:"XA",kind:"assembler",arch:"6502",extensions:[".xa"],editorStyle:"6502",helpURL:"https://www.floodgap.com/retrotech/xa/",wasmModule:"xa",version:"2.4.1",includePatterns:Me,linkPatterns:Ie},nesasm:{id:"nesasm",name:"NESASM",kind:"assembler",arch:"6502",extensions:[".nesasm"],editorStyle:"6502",helpURL:"https://github.com/camsaul/nesasm",wasmModule:"nesasm",version:"3.1",includePatterns:Me,linkPatterns:Ie},merlin32:{id:"merlin32",name:"Merlin 32",kind:"assembler",arch:"6502",extensions:[".lnk"],editorStyle:"6502",helpURL:"https://github.com/apple2accumulator/merlin32",wasmModule:"merlin32",version:"1.1.10",includePatterns:[...Me,...xb],linkPatterns:Ie},cc65:{id:"cc65",name:"cc65",kind:"compiler",arch:"6502",extensions:[".c",".h"],includeDirs:["/include","/asminc"],editorStyle:"text/x-csrc",helpURL:"https://cc65.github.io/doc/cc65.html",wasmModule:"cc65",version:"2.19",defineFlag:"-D",defineInline:!0,platforms:Sb,includePatterns:Me,linkPatterns:Ie},ca65:{id:"ca65",name:"ca65",kind:"assembler",arch:"6502",extensions:[".s",".ca65",".inc"],includeDirs:["/include","/asminc"],editorStyle:"6502",helpURL:"https://cc65.github.io/doc/ca65.html",wasmModule:"ca65",version:"2.19",defineFlag:"-D",defineInline:!1,platforms:Sb,includePatterns:Me,linkPatterns:Ie},ld65:{id:"ld65",name:"ld65",kind:"linker",arch:"6502",extensions:[],wasmModule:"ld65",version:"2.19",linkSymbolFlag:"-D",linkSymbolInline:!1},sdcc:{id:"sdcc",name:"SDCC",kind:"compiler",arch:"z80",extensions:[".c",".h"],includeDirs:["/include"],editorStyle:"text/x-csrc",helpURL:"http://sdcc.sourceforge.net/doc/sdccman.pdf",wasmModule:"sdcc",version:"3.6.5",defineFlag:"-D",defineInline:!0,platforms:{default:{preloadFS:"sdcc"}},includePatterns:Me,linkPatterns:Ie},sdasz80:{id:"sdasz80",name:"sdasz80",kind:"assembler",arch:"z80",extensions:[".s"],includeDirs:["/include"],editorStyle:"z80",wasmModule:"sdasz80",version:"02.00",platforms:{default:{preloadFS:"sdcc"}},includePatterns:Me,linkPatterns:Ie},sdasgb:{id:"sdasgb",name:"sdasgb",kind:"assembler",arch:"gbz80",extensions:[".sgb"],includeDirs:["/include"],editorStyle:"z80",wasmModule:"sdasgb",platforms:{default:{preloadFS:"sdcc"}},includePatterns:Me,linkPatterns:Ie},sdldz80:{id:"sdldz80",name:"sdldz80",kind:"linker",arch:"z80",extensions:[],wasmModule:"sdldz80",version:"03.00",linkSymbolFlag:"-g",linkSymbolInline:!1},sccz80:{id:"sccz80",name:"sccz80",kind:"compiler",arch:"z80",extensions:[".scc"],platforms:{default:{preloadFS:"sccz80"}},noWorkerBuild:!0},naken:{id:"naken",name:"Naken",kind:"assembler",extensions:[".ns"],helpURL:"https://github.com/mikeakohn/naken_asm",noWorkerBuild:!0},zmac:{id:"zmac",name:"zmac",kind:"assembler",arch:"z80",extensions:[".z"],editorStyle:"z80",helpURL:"https://raw.githubusercontent.com/sehugg/zmac/master/doc.txt",wasmModule:"zmac",version:"28jul2Line truncated
|
|
|
|
|
`){[e,t]=Rs(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+=i),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 i=[],n=-1;for(let s of e)i.push(s),n+=s.length+1,i.length==32&&(t.push(new r(i,n)),i=[],n=-1);return n>-1&&t.push(new r(i,n)),t}},Ts=class r extends Pe{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,n){for(let s=0;;s++){let o=this.children[s],a=n+o.length,l=i+o.lines-1;if((t?l:a)>=e)return o.lineInner(e,t,i,n);n=a+1,i=l+1}}decompose(e,t,i,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 c=n&((o<=e?1:0)|(l>=t?2:0));o>=e&&l<=t&&!c?i.push(a):a.decompose(e-o,t-o,i,c)}o=l+1}}replace(e,t,i){if([e,t]=Rs(this,e,t),i.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,i),c=this.lines-o.lines+l.lines;if(l.lines<c>>4&&l.lines>c>>6){let d=this.children.slice();return d[n]=l,new r(d,this.length-(t-e)+i.length)}return super.replace(s,a,l)}s=a+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
|
|
|
|
|
`){[e,t]=Rs(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+=i),e<l&&t>o&&(n+=a.sliceString(e-o,t-o,i)),o=l+1}return n}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof r))return 0;let i=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 i;let l=this.children[n],c=e.children[s];if(l!=c)return i+l.scanIdentical(c,t);i+=l.length+1}}static from(e,t=e.reduce((i,n)=>i+n.length+1,-1)){let i=0;for(let f of e)i+=f.lines;if(i<32){let f=[];for(let p of e)p.flatten(f);return new nr(f,t)}let n=Math.max(32,i>>5),s=n<<1,o=n>>1,a=[],l=0,c=-1,d=[];function h(f){let p;if(f.lines>s&&f instanceof r)for(let m of f.children)h(m);else f.lines>o&&(l>o||!l)?(u(),a.push(f)):f instanceof nr&&l&&(p=d[d.length-1])instanceof nr&&f.lines+p.lines<=32?(l+=f.lines,c+=f.length+1,d[d.length-1]=new nr(p.text.concat(f.text),p.length+1+f.length)):(l+f.lines>n&&u(),l+=f.lines,c+=f.length+1,d.push(f))}function u(){l!=0&&(a.push(d.length==1?d[0]:r.from(d,c)),c=-1,l=d.length=0)}for(let f of e)h(f);return u(),a.length==1?a[0]:new r(a,t)}};Pe.empty=new nr([""],0);function hk(r){let e=-1;for(let t of r)e+=t.length+1;return e}function Fl(r,e,t=0,i=1e9){for(let n=0,s=0,o=!0;s<r.length&&n<=i;s++){let a=r[s],l=n+a.length;l>=t&&(l>i&&(a=a.slice(0,i-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 Mb(r,e,t){return Fl(r,[""],e,t)}var An=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 nr?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,n=this.nodes[i],s=this.offsets[i],o=s>>1,a=n instanceof nr?n.text.length:n.children.length;if(o==(t>0?a:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
|
|
|
`,this;e--}else if(n instanceof nr){let l=n.text[o+(t<0?-1:0)];if(this.offsets[i]+=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[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(l),this.offsets.push(t>0?1:(l instanceof nr?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)}},Bl=class{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new An(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}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 i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:n}=this.cursor.next(e);return this.pos+=(n.length+e)*t,this.value=n.length<=i?n:t<0?n.slice(n.length-i):n.slice(0,i),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!=""}},Nl=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:n}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=n,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol!="undefined"&&(Pe.prototype[Symbol.iterator]=function(){return this.iter()},An.prototype[Symbol.iterator]=Bl.prototype[Symbol.iterator]=Nl.prototype[Symbol.iterator]=function(){return this});var Zu=class{constructor(e,t,i,n){this.from=e,this.to=t,this.number=i,this.text=n}get length(){return this.to-this.from}};function Rs(r,e,t){return e=Math.max(0,Math.min(r.length,e)),[e,Math.max(e,Math.min(r.length,t))]}function st(r,e,t=!0,i=!0){return Eb(r,e,t,i)}function uk(r){return r>=56320&&r<57344}function fk(r){return r>=55296&&r<56320}function jr(r,e){let t=r.charCodeAt(e);if(!fk(t)||e+1==r.length)return t;let i=r.charCodeAt(e+1);return uk(i)?(t-55296<<10)+(i-56320)+65536:t}function ec(r){return r<=65535?String.fromCharCode(r):(r-=65536,String.fromCharCode((r>>10)+55296,(r&1023)+56320))}function Fi(r){return r<65536?1:2}var Uu=/\r\n?|\n/,Ot=(function(r){return r[r.Simple=0]="Simple",r[r.TrackDel=1]="TrackDel",r[r.TrackBefore=2]="TrackBefore",r[r.TrackAfter=3]="TrackAfter",r})(Ot||(Ot={})),bi=class r{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 i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,n=0;t<this.sections.length;){let s=this.sections[t++],o=this.sections[t++];o<0?(e(i,n,s),n+=s):n+=o,i+=s}}iterChangedRanges(e,t=!1){zu(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],n=this.sections[t++];n<0?e.push(i,n):e.push(n,i)}return new r(e)}composeDesc(e){return this.empty?e:e.empty?this:jb(this,e)}mapDesc(e,t=!1){return e.empty?this:Mu(this,e,t)}mapPos(e,t=-1,i=Ot.Simple){let n=0,s=0;for(let o=0;o<this.sections.length;){let a=this.sections[o++],l=this.sections[o++],c=n+a;if(l<0){if(c>e)return s+(e-n);s+=a}else{if(i!=Ot.Simple&&c>=e&&(i==Ot.TrackDel&&n<e&&c>e||i==Ot.TrackBefore&&n<e||i==Ot.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!a)return e==n||t<0?s:s+l;s+=l}n=c}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 i=0,n=0;i<this.sections.length&&n<=t;){let s=this.sections[i++],o=this.sections[i++],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 i=this.sections[t++],n=this.sections[t++];e+=(e?" ":"")+i+(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 r(e)}static create(e){return new r(e)}},Ut=class r extends bi{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 zu(this,(t,i,n,s,o)=>e=e.replace(n,n+(i-t),o),!1),e}mapDesc(e,t=!1){return Mu(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];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(;i.length<l;)i.push(Pe.empty);i.push(o?e.slice(s,s+o):Pe.empty)}s+=o}return new r(t,i)}compose(e){return this.empty?e:e.empty?this:jb(this,e,!0)}map(e,t=!1){return e.empty?this:Mu(this,e,t,!0)}iterChanges(e,t=!1){zu(this,e,t)}get desc
Line truncated
|
|
|
|
|
`}get readOnly(){return this.facet(Gb)}phrase(e,...t){for(let i of this.facet(r.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,n)=>{if(n=="$")return"$";let s=+(n||1);return!s||s>t.length?i:t[s-1]})),e}languageDataAt(e,t,i=-1){let n=[];for(let s of this.facet(Ib))for(let o of s(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&n.push(o[e]);return n}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return vk(t.length?t[0]:"")}wordAt(e){let{text:t,from:i,length:n}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-i,a=e-i;for(;o>0;){let l=st(t,o,!1);if(s(t.slice(l,o))!=ze.Word)break;o=l}for(;a<n;){let l=st(t,a);if(s(t.slice(a,l))!=ze.Word)break;a=l}return o==a?null:E.range(o+i,a+i)}};Qe.allowMultipleSelections=Yu;Qe.tabSize=J.define({combine:r=>r.length?r[0]:4});Qe.lineSeparator=qb;Qe.readOnly=Gb;Qe.phrases=J.define({compare(r,e){let t=Object.keys(r),i=Object.keys(e);return t.length==i.length&&t.every(n=>r[n]==e[n])}});Qe.languageData=Ib;Qe.changeFilter=Fb;Qe.transactionFilter=Bb;Qe.transactionExtender=Nb;bt.reconfigure=ce.define();function sr(r,e,t={}){let i={};for(let n of r)for(let s of Object.keys(n)){let o=n[s],a=i[s];if(a===void 0)i[s]=o;else if(!(a===o||o===void 0))if(Object.hasOwnProperty.call(t,s))i[s]=t[s](a,o);else throw new Error("Config merge conflict for field "+s)}for(let n in e)i[n]===void 0&&(i[n]=e[n]);return i}var Sr=class{eq(e){return this==e}range(e,t=e){return jo.create(e,t,this)}};Sr.prototype.startSide=Sr.prototype.endSide=0;Sr.prototype.point=!1;Sr.prototype.mapMode=Ot.TrackDel;function Gu(r,e){return r==e||r.constructor==e.constructor&&r.eq(e)}var jo=class r{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new r(e,t,i)}};function Iu(r,e){return r.from-e.from||r.value.startSide-e.value.startSide}var qu=class r{constructor(e,t,i,n){this.from=e,this.to=t,this.value=i,this.maxPoint=n}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,n=0){let s=i?this.to:this.from;for(let o=n,a=s.length;;){if(o==a)return o;let l=o+a>>1,c=s[l]-e||(i?this.value[l].endSide:this.value[l].startSide)-t;if(l==o)return c>=0?o:a;c>=0?a=l:o=l+1}}between(e,t,i,n){for(let s=this.findIndex(t,-1e9,!0),o=this.findIndex(i,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 i=[],n=[],s=[],o=-1,a=-1;for(let l=0;l<this.value.length;l++){let c=this.value[l],d=this.from[l]+e,h=this.to[l]+e,u,f;if(d==h){let p=t.mapPos(d,c.startSide,c.mapMode);if(p==null||(u=f=p,c.startSide!=c.endSide&&(f=t.mapPos(d,c.endSide),f<u)))continue}else if(u=t.mapPos(d,c.startSide),f=t.mapPos(h,c.endSide),u>f||u==f&&c.startSide>0&&c.endSide<=0)continue;(f-u||c.endSide-c.startSide)<0||(o<0&&(o=u),c.point&&(a=Math.max(a,f-u)),i.push(c),n.push(u-o),s.push(f-o))}return{mapped:i.length?new r(n,s,i,a):null,pos:o}}},me=class r{constructor(e,t,i,n){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=n}static create(e,t,i,n){return new r(e,t,i,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:i=!1,filterFrom:n=0,filterTo:s=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(i&&(t=t.slice().sort(Iu)),this.isEmpty)return t.length?r.of(t):this;let a=new Jl(this,null,-1).goto(0),l=0,c=[],d=new Vr;for(;a.value||l<t.length;)if(l<t.length&&(a.from-t[l].from||a.startSide-t[l].value.startSide)>=0){let h=t[l++];d.addInner(h.from,h.to,h.value)||c.push(h)}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])&&d.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))&&(d.addInner(a.from,a.to,a.value)||c.push(jo.create(a.from,a.to,a.value))),a.next());return d.finishInner(this.nextLayer.isEmpty&&!c.length?r.empty:this.nextLayer.update({add:c,filter:o,filterFrom:n,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],i=[],n=-1;for(let o=0;o<this.chunk.length;o++){let a=this.chunkPos[o],l=this.chunk[o],c=e.touchesRange(a,a+l.length);if(c===!1)n=Math.max(n,l.maxPoint),t.push(l),i.push(e.mapPos(a));else if(c===!0){let{mapped:d,pos:h}=l.map(a,e);d&&(n=Math.max(n,d.maxPoint),t.push(d),i.push(h))}}let s=this.nextLayer.map(e);return t.length==0?s:new r(i,t,s||r.empty,n)}between(e,t,i){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,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return Do.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Do.from(e).goto(t)}static compare(e,t,i,n,s=-1){let o=e.filter(h=>h.maxPoint>0||!h.isEm
Line truncated
|
|
|
|
|
`)}static newName(){let e=e0[Jb]||1;return e0[Jb]=e+1,"\u037C"+e.toString(36)}static mount(e,t,i){let n=e[Hu],s=i&&i.nonce;n?s&&n.setNonce(s):n=new Ku(e,s),n.mount(Array.isArray(t)?t:[t],e)}},t0=new Map,Ku=class{constructor(e,t){let i=e.ownerDocument||e,n=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&n.CSSStyleSheet){let s=t0.get(i);if(s)return e[Hu]=s;this.sheet=new n.CSSStyleSheet,t0.set(i,this)}else this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[Hu]=this}mount(e,t){let i=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),i)for(let c=0;c<a.rules.length;c++)i.insertRule(a.rules[c],n++)}else{for(;s<l;)n+=this.modules[s++].rules.length;n+=a.rules.length,s++}}if(i)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 xi={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:"'"},Cs={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Qk=typeof navigator!="undefined"&&/Mac/.test(navigator.platform),Pk=typeof navigator!="undefined"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(ct=0;ct<10;ct++)xi[48+ct]=xi[96+ct]=String(ct);var ct;for(ct=1;ct<=24;ct++)xi[ct+111]="F"+ct;var ct;for(ct=65;ct<=90;ct++)xi[ct]=String.fromCharCode(ct+32),Cs[ct]=String.fromCharCode(ct);var ct;for(rc in xi)Cs.hasOwnProperty(rc)||(Cs[rc]=xi[rc]);var rc;function r0(r){var e=Qk&&r.metaKey&&r.shiftKey&&!r.ctrlKey&&!r.altKey||Pk&&r.shiftKey&&r.key&&r.key.length==1||r.key=="Unidentified",t=!e&&r.key||(r.shiftKey?Cs:xi)[r.keyCode]||r.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 ot(){var r=arguments[0];typeof r=="string"&&(r=document.createElement(r));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var n=t[i];typeof n=="string"?r.setAttribute(i,n):n!=null&&(r[i]=n)}e++}for(;e<arguments.length;e++)i0(r,arguments[e]);return r}function i0(r,e){if(typeof e=="string")r.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)r.appendChild(e);else if(Array.isArray(e))for(var t=0;t<e.length;t++)i0(r,e[t]);else throw new RangeError("Unsupported child node: "+e)}var Mt=typeof navigator!="undefined"?navigator:{userAgent:"",vendor:"",platform:""},cf=typeof document!="undefined"?document:{documentElement:{style:{}}},df=/Edge\/(\d+)/.exec(Mt.userAgent),V0=/MSIE \d/.test(Mt.userAgent),hf=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Mt.userAgent),Zc=!!(V0||hf||df),n0=!Zc&&/gecko\/(\d+)/i.test(Mt.userAgent),Ju=!Zc&&/Chrome\/(\d+)/.exec(Mt.userAgent),s0="webkitFontSmoothing"in cf.documentElement.style,uf=!Zc&&/Apple Computer/.test(Mt.vendor),o0=uf&&(/Mobile\/\w+/.test(Mt.userAgent)||Mt.maxTouchPoints>2),ee={mac:o0||/Mac/.test(Mt.platform),windows:/Win/.test(Mt.platform),linux:/Linux|X11/.test(Mt.platform),ie:Zc,ie_version:V0?cf.documentMode||6:hf?+hf[1]:df?+df[1]:0,gecko:n0,gecko_version:n0?+(/Firefox\/(\d+)/.exec(Mt.userAgent)||[0,0])[1]:0,chrome:!!Ju,chrome_version:Ju?+Ju[1]:0,ios:o0,android:/Android\b/.test(Mt.userAgent),webkit:s0,webkit_version:s0?+(/\bAppleWebKit\/(\d+)/.exec(Mt.userAgent)||[0,0])[1]:0,safari:uf,safari_version:uf?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Mt.userAgent)||[0,0])[1]:0,tabSize:cf.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function iO(r,e){for(let t in r)t=="class"&&e.class?e.class+=" "+r.class:t=="style"&&e.style?e.style+=";"+r.style:e[t]=r[t];return e}var gc=Object.create(null);function nO(r,e,t){if(r==e)return!0;r||(r=gc),e||(e=gc);let i=Object.keys(r),n=Object.keys(e);if(i.length-(t&&i.indexOf(t)>-1?1:0)!=n.length-(t&&n.indexOf(t)>-1?1:0))return!1;for(let s of i)if(s!=t&&(n.indexOf(s)==-1||r[s]!==e[s]))return!1;return!0}function $k(r,e){for(let t=r.attributes.length-1;t>=0;t--){let i=r.attributes[t].name;e[i]==null&&r.removeAttribute(i)}for(let t in e){let i=e[t];t=="style"?r.style.cssText=i:r.getAttribute(t)!=i&&r.setAttribute(t,i)}}function a0(r,e,t){let i=!1;if(e)for(let n in e)t&&n in t||(i=!0,n=="style"?r.style.cssText="":r.removeAttribute(n));if(t)for(let n in t)e&&e[n]==t[n]||(i=!0,n=="style"?r.style.cssText=t[n]:r.setAttribute(n,t[n]));return i}function kk(r){let e=Object.create(null);for(let t=0;t<r.attributes.length;t++){let i=r.attributes[t];e[i.name]=i.value}return e}var dt=class{eq(e){return!1}updateDOM(e,t,i){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,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}},xt=(function(r){return r[r.Text=0]="Text",r[r.WidgetBefore=1]="WidgetBefore",r[r.WidgetAfter=2]="WidgetAfter",r[r.WidgetRange=3]="WidgetRange",r})(xt||(xt={})),F=class extends Sr{constructor(e,t,i,n){super(),this.startSide=e,this.endLine truncated
|
|
|
|
|
`,n=r.state.doc.line(n.number+(t?1:-1)),s=r.bidiSpans(n),c=r.visualLineSide(n,!t)}if(l){if(!l(d))return a}else{if(!i)return c;l=i(d)}a=c}}function oT(r,e,t){let i=r.state.charCategorizer(e),n=i(t);return s=>{let o=i(s);return n==ze.Space&&(n=o),n==o}}function aT(r,e,t,i){let n=e.head,s=t?1:-1;if(n==(t?r.state.doc.length:0))return E.cursor(n,e.assoc);let o=e.goalColumn,a,l=r.contentDOM.getBoundingClientRect(),c=r.coordsAtPos(n,e.assoc||((e.empty?t:e.head==e.from)?1:-1)),d=r.documentTop;if(c)o==null&&(o=c.left-l.left),a=s<0?c.top:c.bottom;else{let p=r.viewState.lineBlockAt(n);o==null&&(o=Math.min(l.right-l.left,r.defaultCharacterWidth*(n-p.from))),a=(s<0?p.top:p.bottom)+d}let h=l.left+o,u=r.viewState.heightOracle.textHeight>>1,f=i!=null?i:u;for(let p=0;;p+=u){let m=a+(f+p)*s,S=Tf(r,{x:h,y:m},!1,s);if(t?m>l.bottom:m<l.top)return E.cursor(S.pos,S.assoc);let y=r.coordsAtPos(S.pos,S.assoc),A=y?(y.top+y.bottom)/2:0;if(!y||(t?A>a:A<a))return E.cursor(S.pos,S.assoc,void 0,o)}}function Jo(r,e,t){for(;;){let i=0;for(let n of r)n.between(e-1,e+1,(s,o,a)=>{if(e>s&&e<o){let l=i||t||(e-s<o-e?-1:1);e=l<0?s:o,i=l}});if(!i)return e}}function xx(r,e){let t=null;for(let i=0;i<e.ranges.length;i++){let n=e.ranges[i],s=null;if(n.empty){let o=Jo(r,n.from,0);o!=n.from&&(s=E.cursor(o,-1))}else{let o=Jo(r,n.from,-1),a=Jo(r,n.to,1);(o!=n.from||a!=n.to)&&(n.undirectional?s=E.undirectionalRange(n.from,n.to):s=E.range(n.from==n.anchor?o:a,n.from==n.head?o:a))}s&&(t||(t=e.ranges.slice()),t[i]=s)}return t?E.create(t,e.mainIndex):e}function rf(r,e,t){let i=Jo(r.state.facet(ca).map(n=>n(r)),t.from,e.head>t.from?-1:1);return i==t.from?t:E.cursor(i,i<t.from?1:-1)}var Qr=class{constructor(e,t){this.pos=e,this.assoc=t}};function Tf(r,e,t,i){let n=r.contentDOM.getBoundingClientRect(),s=n.top+r.viewState.paddingTop,{x:o,y:a}=e,l=a-s,c;for(;;){if(l<0)return new Qr(0,1);if(l>r.viewState.docHeight)return new Qr(r.state.doc.length,-1);if(c=r.elementAtHeight(l),i==null)break;if(c.type==xt.Text){if(i<0?c.to<r.viewport.from:c.from>r.viewport.to)break;let u=r.docView.coordsAt(i<0?c.from:c.to,i>0?-1:1);if(u&&(i<0?u.top<=l+s:u.bottom>=l+s))break}let h=r.viewState.heightOracle.textHeight/2;l=i>0?c.bottom+h:c.top-h}if(r.viewport.from>=c.to||r.viewport.to<=c.from){if(t)return null;if(c.type==xt.Text){let h=nT(r,n,c,o,a);return new Qr(h,h==c.from?1:-1)}}if(c.type!=xt.Text)return l<(c.top+c.bottom)/2?new Qr(c.from,1):new Qr(c.to,-1);let d=r.docView.lineAt(c.from,2);return(!d||d.length!=c.length)&&(d=r.docView.lineAt(c.from,-2)),new Xf(r,o,a,r.textDirectionAt(c.from)).scanTile(d,c.from)}var Xf=class{constructor(e,t,i,n){this.view=e,this.x=t,this.y=i,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:i,spans:n}=this.bidiSpansAt(e);return n[Pr.find(n,e-i.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:i,spans:n}=this.bidiSpansAt(e);return n[Pr.find(n,e-i.from,-1,t)].dir}bidiIn(e,t){let{spans:i,line:n}=this.bidiSpansAt(e);return i.length>1||i.length&&(i[0].level!=this.baseDir||i[0].to+n.from<t)}scan(e,t,i=!1){let n=0,s=e.length-1,o=new Set,a=this.bidiIn(e[0],e[s]),l,c,d=-1,h=1e9,u;e:for(;n<s;){let p=s-n,m=n+s>>1;t:if(o.has(m)){for(let A=1;A<p;A++){let R=m+A;if(R>=s&&(R-=p),!o.has(R)){m=R;break t}}break e}o.add(m);let S=t(m),y=0;if(S)for(let A=0;A<S.length;A++){let R=S[A];if(!(R.width==0&&S.length>1))if(R.bottom<this.y)(!l||l.bottom<R.bottom)&&(l=R),y=1;else if(R.top>this.y)(!c||c.top>R.top)&&(c=R),y=-1;else{let U=R.left>this.x?this.x-R.left:R.right<this.x?this.x-R.right:0,T=Math.abs(U);T<h&&(d=m,h=T,u=R),U&&(y=U<0==(this.baseDir==Ue.LTR)?-1:1)}}y==-1&&(!a||this.baseDirAt(e[m],1))?s=m:y==1&&(!a||this.baseDirAt(e[m+1],-1))&&(n=m+1)}if(!u){if(!c&&!l)return{i:0,after:!1};let p=l&&(!c||this.y-l.bottom<c.top-this.y)?l:c;return this.y=(p.top+p.bottom)/2,this.scan(e,t,!0)}if(h&&!i){let{top:p,bottom:m}=u;if(l&&l.bottom>(p+p+m)/3)return this.y=l.bottom-1,this.scan(e,t,!0);if(c&&c.top<(p+m+m)/3)return this.y=c.top+1,this.scan(e,t,!0)}let f=(a?this.dirAt(e[d],1):this.baseDir)==Ue.LTR;return{i:d,after:this.x>(u.left+u.right)/2==f}}scanText(e,t){let i=[];for(let s=0;s<e.length;s=st(e.text,s))i.push(t+s);i.push(t+e.length);let n=this.scan(i,s=>{let o=i[s]-t,a=i[s+1]-t;return oa(e.dom,o,a).getClientRects()});return n.after?new Qr(i[n.i+1],-1):new Qr(i[n.i],1)}scanTile(e,t){if(!e.length)return new Qr(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 i=[t];for(let a=0,l=t;a<e.children.length;a++)i.push(l+=e.children[a].length);let n=this.scan(i,a=>{let l=e.children[a];return l.flags&48?null:(l.dom.nodeType==1?l.dom:oa(l.dom,0,l.length)).getClientRects()}),s=e.children[n.i],o=i[n.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):n.after?new Qr(i[n.i+1],-1):new Qr(o,1)}},As="\uFFFF",_f=class{con
Line truncated
|
|
|
|
|
`&&r.lineWrapping&&(i&&(i=E.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:Pe.of([" "])}),t)return hO(r,t,i,o);if(i&&!Pc(i,s)){let a=!1,l="select";return r.inputState.lastSelectionTime>Date.now()-50&&(r.inputState.lastSelectionOrigin=="select"&&(a=!0),l=r.inputState.lastSelectionOrigin,l=="select.pointer"&&(i=xx(n.facet(ca).map(c=>c(r)),i))),r.dispatch({selection:i,scrollIntoView:a,userEvent:l}),!0}else return!1}function hO(r,e,t,i=-1){if(ee.ios&&r.inputState.flushIOSKey(e))return!0;let n=r.state.selection.main;if(ee.android&&(e.to==n.to&&(e.from==n.from||e.from==n.from-1&&r.state.sliceDoc(e.from,n.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Ls(r.contentDOM,"Enter",13)||(e.from==n.from-1&&e.to==n.to&&e.insert.length==0||i==8&&e.insert.length<e.to-e.from&&e.to>n.head)&&Ls(r.contentDOM,"Backspace",8)||e.from==n.from&&e.to==n.to+1&&e.insert.length==0&&Ls(r.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();r.inputState.composing>=0&&r.inputState.composing++;let o,a=()=>o||(o=dT(r,e,t));return r.state.facet(ax).some(l=>l(r,e.from,e.to,s,a))||r.dispatch(a()),!0}function dT(r,e,t){let i,n=r.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,c=l<0?s.from:s.to,d=Jo(n.facet(ca).map(h=>h(r)),c,l);e.from==d&&(o=d)}if(o>-1)i={changes:e,selection:E.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)&&r.inputState.composing<0){let l=s.from<e.from?n.sliceDoc(s.from,e.from):"",c=s.to>e.to?n.sliceDoc(e.to,s.to):"";i=n.replaceSelection(r.state.toText(l+e.insert.sliceString(0,void 0,r.state.lineBreak)+c))}else{let l=n.changes(e),c=t&&t.main.to<=l.newLength?t.main:void 0;if(n.selection.ranges.length>1&&(r.inputState.composing>=0||r.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let d=r.state.sliceDoc(e.from,e.to),h,u=t&&bx(r,t.main.head);if(u){let p=e.insert.length-(e.to-e.from);h={from:u.from,to:u.to-p}}else h=r.state.doc.lineAt(s.head);let f=s.to-e.to;i=n.changeByRange(p=>{if(p.from==s.from&&p.to==s.to)return{changes:l,range:c||p.map(l)};let m=p.to-f,S=m-d.length;if(r.state.sliceDoc(S,m)!=d||m>=h.from&&S<=h.to)return{range:p};let y=n.changes({from:S,to:m,insert:e.insert}),A=p.to-s.to;return{changes:y,range:c?E.range(Math.max(0,c.anchor+A),Math.max(0,c.head+A)):p.map(y)}})}else i={changes:l,selection:c&&n.selection.replaceRange(c)}}let a="input.type";return(r.composing||r.inputState.compositionPendingChange&&r.inputState.compositionEndedAt>Date.now()-50)&&(r.inputState.compositionPendingChange=!1,a+=".compose",r.inputState.compositionFirstChange&&(a+=".start",r.inputState.compositionFirstChange=!1)),n.update(i,{userEvent:a,scrollIntoView:!0})}function vx(r,e,t,i){let n=Math.min(r.length,e.length),s=0;for(;s<n&&r.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==n&&r.length==e.length)return null;let o=r.length,a=e.length;for(;o>0&&a>0&&r.charCodeAt(o-1)==e.charCodeAt(a-1);)o--,a--;if(i=="end"){let l=Math.max(0,s-Math.min(o,a));t-=o+l-s}if(o<s&&r.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 hT(r){let e=[];if(r.root.activeElement!=r.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:n,focusOffset:s}=r.observer.selectionRange;return t&&(e.push(new Qc(t,i)),(n!=t||s!=i)&&e.push(new Qc(n,s))),e}function uT(r,e){if(r.length==0)return null;let t=r[0].pos,i=r.length==2?r[1].pos:t;return t>-1&&i>-1?E.single(t+e,i+e):null}function Pc(r,e){return e.head==r.main.head&&e.anchor==r.main.anchor}var Cf=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=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,ee.safari&&e.contentDOM.addEventListener("input",()=>null),ee.gecko&&kT(e.contentDOM.ownerDocument)}handleEvent(e){!ST(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 i=this.handlers[e];if(i){for(let n of i.observers)n(this.view,t);for(let n of i.handlers){if(t.defaultPrevented)break;if(n(this.view,t)){t.preventDefault();break}}}}ensureHandl
Line truncated
|
|
|
|
|
`))};if((ee.mac||ee.android)&&h.from==o-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(h={from:a,to:l,insert:Pe.of([i.text.replace("."," ")])}),this.pendingContextChange=h,!e.state.readOnly){let u=this.to-this.from+(h.to-h.from+h.insert.length);hO(e,h,E.single(this.toEditorPos(i.selectionStart,u),this.toEditorPos(i.selectionEnd,u)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),h.from<h.to&&!h.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(t.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let n=[],s=null;for(let o=this.toEditorPos(i.rangeStart),a=this.toEditorPos(i.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(i.rangeStart,n)},this.handlers.textformatupdate=i=>{let n=[];for(let s of i.getTextFormats()){let o=s.underlineStyle,a=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(a)){let l=this.toEditorPos(s.rangeStart),c=this.toEditorPos(s.rangeEnd);if(l<c){let d=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(a)?1:2}px`;n.push(F.mark({attributes:{style:d}}).range(l,c))}}}e.dispatch({effects:ux.of(F.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:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)t.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{let n=sa(i.root);n&&n.rangeCount&&this.editContext.updateSelectionBounds(n.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,i=!1,n=this.pendingContextChange;return e.changes.iterChanges((s,o,a,l,c)=>{if(i)return;let d=c.length-(o-s);if(n&&o>=n.to)if(n.from==s&&n.to==o&&n.insert.eq(c)){n=this.pendingContextChange=null,t+=d,this.to+=d;return}else n=null,this.revertPending(e.state);if(s+=t,o+=t,o<=this.from)this.from+=d,this.to+=d;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+c.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),c.toString()),this.to+=d}t+=d}),n&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.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,i=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),n=this.toContextPos(t.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=n)&&this.editContext.updateSelection(i,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 i=this.composing;return i&&i.drifted?i.editorBase+(e-i.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])}},V=class r{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.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=d
Line truncated
|
|
|
|
|
-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,Nf),eX={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"},sf=null;function tX(){var r;if(sf==null&&typeof document!="undefined"&&document.body){let e=document.body.style;sf=((r=e.tabSize)!==null&&r!==void 0?r:e.MozTabSize)!=null}return sf||!1}var pc=J.define({combine(r){let e=sr(r,{render:null,specialChars:JT,addSpecialChars:null});return(e.replaceTabs=!tX())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Nf)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Nf)),e}});function Vx(r={}){return[pc.of(r),rX()]}var E0=null;function rX(){return E0||(E0=We.fromClass(class{constructor(r){this.view=r,this.decorations=F.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(r.state.facet(pc)),this.decorations=this.decorator.createDeco(r)}makeDecorator(r){return new aa({regexp:r.specialChars,decoration:(e,t,i)=>{let{doc:n}=t.state,s=jr(e[0],0);if(s==9){let o=n.lineAt(i),a=t.state.tabSize,l=zt(o.text,a,i-o.from);return F.replace({widget:new Hf((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=F.replace({widget:new Gf(r,s)}))},boundary:r.replaceTabs?void 0:/[^]/})}update(r){let e=r.state.facet(pc);r.startState.facet(pc)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(r.view)):this.decorations=this.decorator.updateDeco(r,this.decorations)}},{decorations:r=>r.decorations}))}var iX="\u2022";function nX(r){return r>=32?iX:r==10?"\u2424":String.fromCharCode(9216+r)}var Gf=class extends dt{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=nX(this.code),i=e.state.phrase("Control character")+" "+(eX[this.code]||"0x"+this.code.toString(16)),n=this.options.render&&this.options.render(this.code,i,t);if(n)return n;let s=document.createElement("span");return s.textContent=t,s.title=i,s.setAttribute("aria-label",i),s.className="cm-specialChar",s}ignoreEvent(){return!1}},Hf=class extends dt{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 Lc(){return oX}var sX=F.line({class:"cm-activeLine"}),oX=We.fromClass(class{constructor(r){this.decorations=this.getDeco(r)}update(r){(r.docChanged||r.selectionSet)&&(this.decorations=this.getDeco(r.view))}getDeco(r){let e=-1,t=[];for(let i of r.state.selection.ranges){let n=r.lineBlockAt(i.head);n.from>e&&(t.push(sX.range(n.from)),e=n.from)}return F.set(t)}},{decorations:r=>r.decorations});var Kf=2e3;function aX(r,e,t){let i=Math.min(e.line,t.line),n=Math.max(e.line,t.line),s=[];if(e.off>Kf||t.off>Kf||e.col<0||t.col<0){let o=Math.min(e.off,t.off),a=Math.max(e.off,t.off);for(let l=i;l<=n;l++){let c=r.doc.line(l);c.length<=a&&s.push(E.range(c.from+o,c.to+a))}}else{let o=Math.min(e.col,t.col),a=Math.max(e.col,t.col);for(let l=i;l<=n;l++){let c=r.doc.line(l),d=tc(c.text,o,r.tabSize,!0);if(d<0)s.push(E.cursor(c.to));else{let h=tc(c.text,a,r.tabSize);s.push(E.range(c.from+d,c.from+h))}}}return s}function lX(r,e){let t=r.coordsAtPos(r.viewport.from);return t?Math.round(Math.abs((t.left-e)/r.defaultCharacterWidth)):-1}function Z0(r,e){let t=r.posAtCoords({x:e.clientX,y:e.clientY},!1),i=r.state.doc.lineAt(t),n=t-i.from,s=n>Kf?-1:n==i.length?lX(r,e.clientX):zt(i.text,r.state.tabSize,t-i.from);return{line:i.number,col:s,off:n}}function cX(r,e){let t=Z0(r,e),i=r.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)},i=i.map(n.changes)}},get(n,s,o){let a=Z0(r,n);if(!a)return i;let l=aX(r.state,t,a);return l.length?o?E.create(l.concat(i.ranges)):E.create(l):i}}:null}function Yc(r){let e=(r==null?void 0:r.eventFilter)||(t=>t.altKey&&t.button==0);return V.mouseSelectionStyle.of((t,i)=>e(i)?cX(t,i):null)}var dX={Alt:[18,r=>!!r.altKey],Control:[17,r=>!!r.ctrlKey],Shift:[16,r=>!!r.shiftKey],Meta:[91,r=>!!r.metaKey]},hX={style:"cursor: crosshair"};function Wc(r={}){let[e,t]=dX[r.key||"Alt"],i=We.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))}}});retur
Line truncated
|
|
|
|
|
`){[e,t]=Rs(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+=i),e<l&&t>o&&(n+=a.sliceString(e-o,t-o,i)),o=l+1}return n}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof r))return 0;let i=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 i;let l=this.children[n],c=e.children[s];if(l!=c)return i+l.scanIdentical(c,t);i+=l.length+1}}static from(e,t=e.reduce((i,n)=>i+n.length+1,-1)){let i=0;for(let f of e)i+=f.lines;if(i<32){let f=[];for(let p of e)p.flatten(f);return new nr(f,t)}let n=Math.max(32,i>>5),s=n<<1,o=n>>1,a=[],l=0,c=-1,d=[];function h(f){let p;if(f.lines>s&&f instanceof r)for(let m of f.children)h(m);else f.lines>o&&(l>o||!l)?(u(),a.push(f)):f instanceof nr&&l&&(p=d[d.length-1])instanceof nr&&f.lines+p.lines<=32?(l+=f.lines,c+=f.length+1,d[d.length-1]=new nr(p.text.concat(f.text),p.length+1+f.length)):(l+f.lines>n&&u(),l+=f.lines,c+=f.length+1,d.push(f))}function u(){l!=0&&(a.push(d.length==1?d[0]:r.from(d,c)),c=-1,l=d.length=0)}for(let f of e)h(f);return u(),a.length==1?a[0]:new r(a,t)}};Pe.empty=new nr([""],0);function ck(r){let e=-1;for(let t of r)e+=t.length+1;return e}function Fl(r,e,t=0,i=1e9){for(let n=0,s=0,o=!0;s<r.length&&n<=i;s++){let a=r[s],l=n+a.length;l>=t&&(l>i&&(a=a.slice(0,i-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 zb(r,e,t){return Fl(r,[""],e,t)}var An=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 nr?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,n=this.nodes[i],s=this.offsets[i],o=s>>1,a=n instanceof nr?n.text.length:n.children.length;if(o==(t>0?a:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
|
|
|
`,this;e--}else if(n instanceof nr){let l=n.text[o+(t<0?-1:0)];if(this.offsets[i]+=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[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(l),this.offsets.push(t>0?1:(l instanceof nr?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)}},Bl=class{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new An(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}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 i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:n}=this.cursor.next(e);return this.pos+=(n.length+e)*t,this.value=n.length<=i?n:t<0?n.slice(n.length-i):n.slice(0,i),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!=""}},Nl=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:n}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=n,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol!="undefined"&&(Pe.prototype[Symbol.iterator]=function(){return this.iter()},An.prototype[Symbol.iterator]=Bl.prototype[Symbol.iterator]=Nl.prototype[Symbol.iterator]=function(){return this});var Zu=class{constructor(e,t,i,n){this.from=e,this.to=t,this.number=i,this.text=n}get length(){return this.to-this.from}};function Rs(r,e,t){return e=Math.max(0,Math.min(r.length,e)),[e,Math.max(e,Math.min(r.length,t))]}function st(r,e,t=!0,i=!0){return Ab(r,e,t,i)}function dk(r){return r>=56320&&r<57344}function hk(r){return r>=55296&&r<56320}function jr(r,e){let t=r.charCodeAt(e);if(!hk(t)||e+1==r.length)return t;let i=r.charCodeAt(e+1);return dk(i)?(t-55296<<10)+(i-56320)+65536:t}function ec(r){return r<=65535?String.fromCharCode(r):(r-=65536,String.fromCharCode((r>>10)+55296,(r&1023)+56320))}function Fi(r){return r<65536?1:2}var Uu=/\r\n?|\n/,Ot=(function(r){return r[r.Simple=0]="Simple",r[r.TrackDel=1]="TrackDel",r[r.TrackBefore=2]="TrackBefore",r[r.TrackAfter=3]="TrackAfter",r})(Ot||(Ot={})),bi=class r{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 i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,n=0;t<this.sections.length;){let s=this.sections[t++],o=this.sections[t++];o<0?(e(i,n,s),n+=s):n+=o,i+=s}}iterChangedRanges(e,t=!1){zu(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],n=this.sections[t++];n<0?e.push(i,n):e.push(n,i)}return new r(e)}composeDesc(e){return this.empty?e:e.empty?this:Vb(this,e)}mapDesc(e,t=!1){return e.empty?this:Mu(this,e,t)}mapPos(e,t=-1,i=Ot.Simple){let n=0,s=0;for(let o=0;o<this.sections.length;){let a=this.sections[o++],l=this.sections[o++],c=n+a;if(l<0){if(c>e)return s+(e-n);s+=a}else{if(i!=Ot.Simple&&c>=e&&(i==Ot.TrackDel&&n<e&&c>e||i==Ot.TrackBefore&&n<e||i==Ot.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!a)return e==n||t<0?s:s+l;s+=l}n=c}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 i=0,n=0;i<this.sections.length&&n<=t;){let s=this.sections[i++],o=this.sections[i++],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 i=this.sections[t++],n=this.sections[t++];e+=(e?" ":"")+i+(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 r(e)}static create(e){return new r(e)}},Ut=class r extends bi{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 zu(this,(t,i,n,s,o)=>e=e.replace(n,n+(i-t),o),!1),e}mapDesc(e,t=!1){return Mu(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];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(;i.length<l;)i.push(Pe.empty);i.push(o?e.slice(s,s+o):Pe.empty)}s+=o}return new r(t,i)}compose(e){return this.empty?e:e.empty?this:Vb(this,e,!0)}map(e,t=!1){return e.empty?this:Mu(this,e,t,!0)}iterChanges(e,t=!1){zu(this,e,t)}get desc
Line truncated
|
|
|
|
|
`}get readOnly(){return this.facet(Nb)}phrase(e,...t){for(let i of this.facet(r.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,n)=>{if(n=="$")return"$";let s=+(n||1);return!s||s>t.length?i:t[s-1]})),e}languageDataAt(e,t,i=-1){let n=[];for(let s of this.facet(Db))for(let o of s(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&n.push(o[e]);return n}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return Sk(t.length?t[0]:"")}wordAt(e){let{text:t,from:i,length:n}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-i,a=e-i;for(;o>0;){let l=st(t,o,!1);if(s(t.slice(l,o))!=ze.Word)break;o=l}for(;a<n;){let l=st(t,a);if(s(t.slice(a,l))!=ze.Word)break;a=l}return o==a?null:E.range(o+i,a+i)}};Qe.allowMultipleSelections=Yu;Qe.tabSize=J.define({combine:r=>r.length?r[0]:4});Qe.lineSeparator=Ib;Qe.readOnly=Nb;Qe.phrases=J.define({compare(r,e){let t=Object.keys(r),i=Object.keys(e);return t.length==i.length&&t.every(n=>r[n]==e[n])}});Qe.languageData=Db;Qe.changeFilter=qb;Qe.transactionFilter=Fb;Qe.transactionExtender=Bb;bt.reconfigure=ce.define();function sr(r,e,t={}){let i={};for(let n of r)for(let s of Object.keys(n)){let o=n[s],a=i[s];if(a===void 0)i[s]=o;else if(!(a===o||o===void 0))if(Object.hasOwnProperty.call(t,s))i[s]=t[s](a,o);else throw new Error("Config merge conflict for field "+s)}for(let n in e)i[n]===void 0&&(i[n]=e[n]);return i}var Sr=class{eq(e){return this==e}range(e,t=e){return jo.create(e,t,this)}};Sr.prototype.startSide=Sr.prototype.endSide=0;Sr.prototype.point=!1;Sr.prototype.mapMode=Ot.TrackDel;function Gu(r,e){return r==e||r.constructor==e.constructor&&r.eq(e)}var jo=class r{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new r(e,t,i)}};function Iu(r,e){return r.from-e.from||r.value.startSide-e.value.startSide}var qu=class r{constructor(e,t,i,n){this.from=e,this.to=t,this.value=i,this.maxPoint=n}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,n=0){let s=i?this.to:this.from;for(let o=n,a=s.length;;){if(o==a)return o;let l=o+a>>1,c=s[l]-e||(i?this.value[l].endSide:this.value[l].startSide)-t;if(l==o)return c>=0?o:a;c>=0?a=l:o=l+1}}between(e,t,i,n){for(let s=this.findIndex(t,-1e9,!0),o=this.findIndex(i,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 i=[],n=[],s=[],o=-1,a=-1;for(let l=0;l<this.value.length;l++){let c=this.value[l],d=this.from[l]+e,h=this.to[l]+e,u,f;if(d==h){let p=t.mapPos(d,c.startSide,c.mapMode);if(p==null||(u=f=p,c.startSide!=c.endSide&&(f=t.mapPos(d,c.endSide),f<u)))continue}else if(u=t.mapPos(d,c.startSide),f=t.mapPos(h,c.endSide),u>f||u==f&&c.startSide>0&&c.endSide<=0)continue;(f-u||c.endSide-c.startSide)<0||(o<0&&(o=u),c.point&&(a=Math.max(a,f-u)),i.push(c),n.push(u-o),s.push(f-o))}return{mapped:i.length?new r(n,s,i,a):null,pos:o}}},me=class r{constructor(e,t,i,n){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=n}static create(e,t,i,n){return new r(e,t,i,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:i=!1,filterFrom:n=0,filterTo:s=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(i&&(t=t.slice().sort(Iu)),this.isEmpty)return t.length?r.of(t):this;let a=new Jl(this,null,-1).goto(0),l=0,c=[],d=new Vr;for(;a.value||l<t.length;)if(l<t.length&&(a.from-t[l].from||a.startSide-t[l].value.startSide)>=0){let h=t[l++];d.addInner(h.from,h.to,h.value)||c.push(h)}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])&&d.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))&&(d.addInner(a.from,a.to,a.value)||c.push(jo.create(a.from,a.to,a.value))),a.next());return d.finishInner(this.nextLayer.isEmpty&&!c.length?r.empty:this.nextLayer.update({add:c,filter:o,filterFrom:n,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],i=[],n=-1;for(let o=0;o<this.chunk.length;o++){let a=this.chunkPos[o],l=this.chunk[o],c=e.touchesRange(a,a+l.length);if(c===!1)n=Math.max(n,l.maxPoint),t.push(l),i.push(e.mapPos(a));else if(c===!0){let{mapped:d,pos:h}=l.map(a,e);d&&(n=Math.max(n,d.maxPoint),t.push(d),i.push(h))}}let s=this.nextLayer.map(e);return t.length==0?s:new r(i,t,s||r.empty,n)}between(e,t,i){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,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return Do.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Do.from(e).goto(t)}static compare(e,t,i,n,s=-1){let o=e.filter(h=>h.maxPoint>0||!h.isEm
Line truncated
|
|
|
|
|
`)}static newName(){let e=Jb[Kb]||1;return Jb[Kb]=e+1,"\u037C"+e.toString(36)}static mount(e,t,i){let n=e[Hu],s=i&&i.nonce;n?s&&n.setNonce(s):n=new Ku(e,s),n.mount(Array.isArray(t)?t:[t],e)}},e0=new Map,Ku=class{constructor(e,t){let i=e.ownerDocument||e,n=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&n.CSSStyleSheet){let s=e0.get(i);if(s)return e[Hu]=s;this.sheet=new n.CSSStyleSheet,e0.set(i,this)}else this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[Hu]=this}mount(e,t){let i=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),i)for(let c=0;c<a.rules.length;c++)i.insertRule(a.rules[c],n++)}else{for(;s<l;)n+=this.modules[s++].rules.length;n+=a.rules.length,s++}}if(i)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 xi={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:"'"},Cs={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},vk=typeof navigator!="undefined"&&/Mac/.test(navigator.platform),yk=typeof navigator!="undefined"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(ct=0;ct<10;ct++)xi[48+ct]=xi[96+ct]=String(ct);var ct;for(ct=1;ct<=24;ct++)xi[ct+111]="F"+ct;var ct;for(ct=65;ct<=90;ct++)xi[ct]=String.fromCharCode(ct+32),Cs[ct]=String.fromCharCode(ct);var ct;for(rc in xi)Cs.hasOwnProperty(rc)||(Cs[rc]=xi[rc]);var rc;function t0(r){var e=vk&&r.metaKey&&r.shiftKey&&!r.ctrlKey&&!r.altKey||yk&&r.shiftKey&&r.key&&r.key.length==1||r.key=="Unidentified",t=!e&&r.key||(r.shiftKey?Cs:xi)[r.keyCode]||r.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 ot(){var r=arguments[0];typeof r=="string"&&(r=document.createElement(r));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var n=t[i];typeof n=="string"?r.setAttribute(i,n):n!=null&&(r[i]=n)}e++}for(;e<arguments.length;e++)r0(r,arguments[e]);return r}function r0(r,e){if(typeof e=="string")r.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)r.appendChild(e);else if(Array.isArray(e))for(var t=0;t<e.length;t++)r0(r,e[t]);else throw new RangeError("Unsupported child node: "+e)}var Mt=typeof navigator!="undefined"?navigator:{userAgent:"",vendor:"",platform:""},cf=typeof document!="undefined"?document:{documentElement:{style:{}}},df=/Edge\/(\d+)/.exec(Mt.userAgent),W0=/MSIE \d/.test(Mt.userAgent),hf=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Mt.userAgent),Zc=!!(W0||hf||df),i0=!Zc&&/gecko\/(\d+)/i.test(Mt.userAgent),Ju=!Zc&&/Chrome\/(\d+)/.exec(Mt.userAgent),n0="webkitFontSmoothing"in cf.documentElement.style,uf=!Zc&&/Apple Computer/.test(Mt.vendor),s0=uf&&(/Mobile\/\w+/.test(Mt.userAgent)||Mt.maxTouchPoints>2),ee={mac:s0||/Mac/.test(Mt.platform),windows:/Win/.test(Mt.platform),linux:/Linux|X11/.test(Mt.platform),ie:Zc,ie_version:W0?cf.documentMode||6:hf?+hf[1]:df?+df[1]:0,gecko:i0,gecko_version:i0?+(/Firefox\/(\d+)/.exec(Mt.userAgent)||[0,0])[1]:0,chrome:!!Ju,chrome_version:Ju?+Ju[1]:0,ios:s0,android:/Android\b/.test(Mt.userAgent),webkit:n0,webkit_version:n0?+(/\bAppleWebKit\/(\d+)/.exec(Mt.userAgent)||[0,0])[1]:0,safari:uf,safari_version:uf?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Mt.userAgent)||[0,0])[1]:0,tabSize:cf.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function iO(r,e){for(let t in r)t=="class"&&e.class?e.class+=" "+r.class:t=="style"&&e.style?e.style+=";"+r.style:e[t]=r[t];return e}var gc=Object.create(null);function nO(r,e,t){if(r==e)return!0;r||(r=gc),e||(e=gc);let i=Object.keys(r),n=Object.keys(e);if(i.length-(t&&i.indexOf(t)>-1?1:0)!=n.length-(t&&n.indexOf(t)>-1?1:0))return!1;for(let s of i)if(s!=t&&(n.indexOf(s)==-1||r[s]!==e[s]))return!1;return!0}function Qk(r,e){for(let t=r.attributes.length-1;t>=0;t--){let i=r.attributes[t].name;e[i]==null&&r.removeAttribute(i)}for(let t in e){let i=e[t];t=="style"?r.style.cssText=i:r.getAttribute(t)!=i&&r.setAttribute(t,i)}}function o0(r,e,t){let i=!1;if(e)for(let n in e)t&&n in t||(i=!0,n=="style"?r.style.cssText="":r.removeAttribute(n));if(t)for(let n in t)e&&e[n]==t[n]||(i=!0,n=="style"?r.style.cssText=t[n]:r.setAttribute(n,t[n]));return i}function Pk(r){let e=Object.create(null);for(let t=0;t<r.attributes.length;t++){let i=r.attributes[t];e[i.name]=i.value}return e}var dt=class{eq(e){return!1}updateDOM(e,t,i){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,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}},xt=(function(r){return r[r.Text=0]="Text",r[r.WidgetBefore=1]="WidgetBefore",r[r.WidgetAfter=2]="WidgetAfter",r[r.WidgetRange=3]="WidgetRange",r})(xt||(xt={})),F=class extends Sr{constructor(e,t,i,n){super(),this.startSide=e,this.endLine truncated
|
|
|
|
|
`,n=r.state.doc.line(n.number+(t?1:-1)),s=r.bidiSpans(n),c=r.visualLineSide(n,!t)}if(l){if(!l(d))return a}else{if(!i)return c;l=i(d)}a=c}}function nT(r,e,t){let i=r.state.charCategorizer(e),n=i(t);return s=>{let o=i(s);return n==ze.Space&&(n=o),n==o}}function sT(r,e,t,i){let n=e.head,s=t?1:-1;if(n==(t?r.state.doc.length:0))return E.cursor(n,e.assoc);let o=e.goalColumn,a,l=r.contentDOM.getBoundingClientRect(),c=r.coordsAtPos(n,e.assoc||((e.empty?t:e.head==e.from)?1:-1)),d=r.documentTop;if(c)o==null&&(o=c.left-l.left),a=s<0?c.top:c.bottom;else{let p=r.viewState.lineBlockAt(n);o==null&&(o=Math.min(l.right-l.left,r.defaultCharacterWidth*(n-p.from))),a=(s<0?p.top:p.bottom)+d}let h=l.left+o,u=r.viewState.heightOracle.textHeight>>1,f=i!=null?i:u;for(let p=0;;p+=u){let m=a+(f+p)*s,S=Tf(r,{x:h,y:m},!1,s);if(t?m>l.bottom:m<l.top)return E.cursor(S.pos,S.assoc);let y=r.coordsAtPos(S.pos,S.assoc),A=y?(y.top+y.bottom)/2:0;if(!y||(t?A>a:A<a))return E.cursor(S.pos,S.assoc,void 0,o)}}function Jo(r,e,t){for(;;){let i=0;for(let n of r)n.between(e-1,e+1,(s,o,a)=>{if(e>s&&e<o){let l=i||t||(e-s<o-e?-1:1);e=l<0?s:o,i=l}});if(!i)return e}}function bx(r,e){let t=null;for(let i=0;i<e.ranges.length;i++){let n=e.ranges[i],s=null;if(n.empty){let o=Jo(r,n.from,0);o!=n.from&&(s=E.cursor(o,-1))}else{let o=Jo(r,n.from,-1),a=Jo(r,n.to,1);(o!=n.from||a!=n.to)&&(n.undirectional?s=E.undirectionalRange(n.from,n.to):s=E.range(n.from==n.anchor?o:a,n.from==n.head?o:a))}s&&(t||(t=e.ranges.slice()),t[i]=s)}return t?E.create(t,e.mainIndex):e}function rf(r,e,t){let i=Jo(r.state.facet(ca).map(n=>n(r)),t.from,e.head>t.from?-1:1);return i==t.from?t:E.cursor(i,i<t.from?1:-1)}var Qr=class{constructor(e,t){this.pos=e,this.assoc=t}};function Tf(r,e,t,i){let n=r.contentDOM.getBoundingClientRect(),s=n.top+r.viewState.paddingTop,{x:o,y:a}=e,l=a-s,c;for(;;){if(l<0)return new Qr(0,1);if(l>r.viewState.docHeight)return new Qr(r.state.doc.length,-1);if(c=r.elementAtHeight(l),i==null)break;if(c.type==xt.Text){if(i<0?c.to<r.viewport.from:c.from>r.viewport.to)break;let u=r.docView.coordsAt(i<0?c.from:c.to,i>0?-1:1);if(u&&(i<0?u.top<=l+s:u.bottom>=l+s))break}let h=r.viewState.heightOracle.textHeight/2;l=i>0?c.bottom+h:c.top-h}if(r.viewport.from>=c.to||r.viewport.to<=c.from){if(t)return null;if(c.type==xt.Text){let h=rT(r,n,c,o,a);return new Qr(h,h==c.from?1:-1)}}if(c.type!=xt.Text)return l<(c.top+c.bottom)/2?new Qr(c.from,1):new Qr(c.to,-1);let d=r.docView.lineAt(c.from,2);return(!d||d.length!=c.length)&&(d=r.docView.lineAt(c.from,-2)),new Xf(r,o,a,r.textDirectionAt(c.from)).scanTile(d,c.from)}var Xf=class{constructor(e,t,i,n){this.view=e,this.x=t,this.y=i,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:i,spans:n}=this.bidiSpansAt(e);return n[Pr.find(n,e-i.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:i,spans:n}=this.bidiSpansAt(e);return n[Pr.find(n,e-i.from,-1,t)].dir}bidiIn(e,t){let{spans:i,line:n}=this.bidiSpansAt(e);return i.length>1||i.length&&(i[0].level!=this.baseDir||i[0].to+n.from<t)}scan(e,t,i=!1){let n=0,s=e.length-1,o=new Set,a=this.bidiIn(e[0],e[s]),l,c,d=-1,h=1e9,u;e:for(;n<s;){let p=s-n,m=n+s>>1;t:if(o.has(m)){for(let A=1;A<p;A++){let R=m+A;if(R>=s&&(R-=p),!o.has(R)){m=R;break t}}break e}o.add(m);let S=t(m),y=0;if(S)for(let A=0;A<S.length;A++){let R=S[A];if(!(R.width==0&&S.length>1))if(R.bottom<this.y)(!l||l.bottom<R.bottom)&&(l=R),y=1;else if(R.top>this.y)(!c||c.top>R.top)&&(c=R),y=-1;else{let U=R.left>this.x?this.x-R.left:R.right<this.x?this.x-R.right:0,T=Math.abs(U);T<h&&(d=m,h=T,u=R),U&&(y=U<0==(this.baseDir==Ue.LTR)?-1:1)}}y==-1&&(!a||this.baseDirAt(e[m],1))?s=m:y==1&&(!a||this.baseDirAt(e[m+1],-1))&&(n=m+1)}if(!u){if(!c&&!l)return{i:0,after:!1};let p=l&&(!c||this.y-l.bottom<c.top-this.y)?l:c;return this.y=(p.top+p.bottom)/2,this.scan(e,t,!0)}if(h&&!i){let{top:p,bottom:m}=u;if(l&&l.bottom>(p+p+m)/3)return this.y=l.bottom-1,this.scan(e,t,!0);if(c&&c.top<(p+m+m)/3)return this.y=c.top+1,this.scan(e,t,!0)}let f=(a?this.dirAt(e[d],1):this.baseDir)==Ue.LTR;return{i:d,after:this.x>(u.left+u.right)/2==f}}scanText(e,t){let i=[];for(let s=0;s<e.length;s=st(e.text,s))i.push(t+s);i.push(t+e.length);let n=this.scan(i,s=>{let o=i[s]-t,a=i[s+1]-t;return oa(e.dom,o,a).getClientRects()});return n.after?new Qr(i[n.i+1],-1):new Qr(i[n.i],1)}scanTile(e,t){if(!e.length)return new Qr(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 i=[t];for(let a=0,l=t;a<e.children.length;a++)i.push(l+=e.children[a].length);let n=this.scan(i,a=>{let l=e.children[a];return l.flags&48?null:(l.dom.nodeType==1?l.dom:oa(l.dom,0,l.length)).getClientRects()}),s=e.children[n.i],o=i[n.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):n.after?new Qr(i[n.i+1],-1):new Qr(o,1)}},As="\uFFFF",_f=class{con
Line truncated
|
|
|
|
|
`&&r.lineWrapping&&(i&&(i=E.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:Pe.of([" "])}),t)return hO(r,t,i,o);if(i&&!Pc(i,s)){let a=!1,l="select";return r.inputState.lastSelectionTime>Date.now()-50&&(r.inputState.lastSelectionOrigin=="select"&&(a=!0),l=r.inputState.lastSelectionOrigin,l=="select.pointer"&&(i=bx(n.facet(ca).map(c=>c(r)),i))),r.dispatch({selection:i,scrollIntoView:a,userEvent:l}),!0}else return!1}function hO(r,e,t,i=-1){if(ee.ios&&r.inputState.flushIOSKey(e))return!0;let n=r.state.selection.main;if(ee.android&&(e.to==n.to&&(e.from==n.from||e.from==n.from-1&&r.state.sliceDoc(e.from,n.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Ls(r.contentDOM,"Enter",13)||(e.from==n.from-1&&e.to==n.to&&e.insert.length==0||i==8&&e.insert.length<e.to-e.from&&e.to>n.head)&&Ls(r.contentDOM,"Backspace",8)||e.from==n.from&&e.to==n.to+1&&e.insert.length==0&&Ls(r.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();r.inputState.composing>=0&&r.inputState.composing++;let o,a=()=>o||(o=lT(r,e,t));return r.state.facet(ox).some(l=>l(r,e.from,e.to,s,a))||r.dispatch(a()),!0}function lT(r,e,t){let i,n=r.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,c=l<0?s.from:s.to,d=Jo(n.facet(ca).map(h=>h(r)),c,l);e.from==d&&(o=d)}if(o>-1)i={changes:e,selection:E.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)&&r.inputState.composing<0){let l=s.from<e.from?n.sliceDoc(s.from,e.from):"",c=s.to>e.to?n.sliceDoc(e.to,s.to):"";i=n.replaceSelection(r.state.toText(l+e.insert.sliceString(0,void 0,r.state.lineBreak)+c))}else{let l=n.changes(e),c=t&&t.main.to<=l.newLength?t.main:void 0;if(n.selection.ranges.length>1&&(r.inputState.composing>=0||r.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let d=r.state.sliceDoc(e.from,e.to),h,u=t&&gx(r,t.main.head);if(u){let p=e.insert.length-(e.to-e.from);h={from:u.from,to:u.to-p}}else h=r.state.doc.lineAt(s.head);let f=s.to-e.to;i=n.changeByRange(p=>{if(p.from==s.from&&p.to==s.to)return{changes:l,range:c||p.map(l)};let m=p.to-f,S=m-d.length;if(r.state.sliceDoc(S,m)!=d||m>=h.from&&S<=h.to)return{range:p};let y=n.changes({from:S,to:m,insert:e.insert}),A=p.to-s.to;return{changes:y,range:c?E.range(Math.max(0,c.anchor+A),Math.max(0,c.head+A)):p.map(y)}})}else i={changes:l,selection:c&&n.selection.replaceRange(c)}}let a="input.type";return(r.composing||r.inputState.compositionPendingChange&&r.inputState.compositionEndedAt>Date.now()-50)&&(r.inputState.compositionPendingChange=!1,a+=".compose",r.inputState.compositionFirstChange&&(a+=".start",r.inputState.compositionFirstChange=!1)),n.update(i,{userEvent:a,scrollIntoView:!0})}function wx(r,e,t,i){let n=Math.min(r.length,e.length),s=0;for(;s<n&&r.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==n&&r.length==e.length)return null;let o=r.length,a=e.length;for(;o>0&&a>0&&r.charCodeAt(o-1)==e.charCodeAt(a-1);)o--,a--;if(i=="end"){let l=Math.max(0,s-Math.min(o,a));t-=o+l-s}if(o<s&&r.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 cT(r){let e=[];if(r.root.activeElement!=r.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:n,focusOffset:s}=r.observer.selectionRange;return t&&(e.push(new Qc(t,i)),(n!=t||s!=i)&&e.push(new Qc(n,s))),e}function dT(r,e){if(r.length==0)return null;let t=r[0].pos,i=r.length==2?r[1].pos:t;return t>-1&&i>-1?E.single(t+e,i+e):null}function Pc(r,e){return e.head==r.main.head&&e.anchor==r.main.anchor}var Cf=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=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,ee.safari&&e.contentDOM.addEventListener("input",()=>null),ee.gecko&&PT(e.contentDOM.ownerDocument)}handleEvent(e){!bT(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 i=this.handlers[e];if(i){for(let n of i.observers)n(this.view,t);for(let n of i.handlers){if(t.defaultPrevented)break;if(n(this.view,t)){t.preventDefault();break}}}}ensureHandl
Line truncated
|
|
|
|
|
`))};if((ee.mac||ee.android)&&h.from==o-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(h={from:a,to:l,insert:Pe.of([i.text.replace("."," ")])}),this.pendingContextChange=h,!e.state.readOnly){let u=this.to-this.from+(h.to-h.from+h.insert.length);hO(e,h,E.single(this.toEditorPos(i.selectionStart,u),this.toEditorPos(i.selectionEnd,u)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),h.from<h.to&&!h.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(t.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let n=[],s=null;for(let o=this.toEditorPos(i.rangeStart),a=this.toEditorPos(i.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(i.rangeStart,n)},this.handlers.textformatupdate=i=>{let n=[];for(let s of i.getTextFormats()){let o=s.underlineStyle,a=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(a)){let l=this.toEditorPos(s.rangeStart),c=this.toEditorPos(s.rangeEnd);if(l<c){let d=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(a)?1:2}px`;n.push(F.mark({attributes:{style:d}}).range(l,c))}}}e.dispatch({effects:hx.of(F.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:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)t.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{let n=sa(i.root);n&&n.rangeCount&&this.editContext.updateSelectionBounds(n.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,i=!1,n=this.pendingContextChange;return e.changes.iterChanges((s,o,a,l,c)=>{if(i)return;let d=c.length-(o-s);if(n&&o>=n.to)if(n.from==s&&n.to==o&&n.insert.eq(c)){n=this.pendingContextChange=null,t+=d,this.to+=d;return}else n=null,this.revertPending(e.state);if(s+=t,o+=t,o<=this.from)this.from+=d,this.to+=d;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+c.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),c.toString()),this.to+=d}t+=d}),n&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.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,i=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),n=this.toContextPos(t.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=n)&&this.editContext.updateSelection(i,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 i=this.composing;return i&&i.drifted?i.editorBase+(e-i.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])}},V=class r{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.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=d
Line truncated
|
|
|
|
|
-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,Nf),KT={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"},sf=null;function JT(){var r;if(sf==null&&typeof document!="undefined"&&document.body){let e=document.body.style;sf=((r=e.tabSize)!==null&&r!==void 0?r:e.MozTabSize)!=null}return sf||!1}var pc=J.define({combine(r){let e=sr(r,{render:null,specialChars:HT,addSpecialChars:null});return(e.replaceTabs=!JT())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Nf)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Nf)),e}});function Wx(r={}){return[pc.of(r),eX()]}var A0=null;function eX(){return A0||(A0=We.fromClass(class{constructor(r){this.view=r,this.decorations=F.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(r.state.facet(pc)),this.decorations=this.decorator.createDeco(r)}makeDecorator(r){return new aa({regexp:r.specialChars,decoration:(e,t,i)=>{let{doc:n}=t.state,s=jr(e[0],0);if(s==9){let o=n.lineAt(i),a=t.state.tabSize,l=zt(o.text,a,i-o.from);return F.replace({widget:new Hf((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=F.replace({widget:new Gf(r,s)}))},boundary:r.replaceTabs?void 0:/[^]/})}update(r){let e=r.state.facet(pc);r.startState.facet(pc)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(r.view)):this.decorations=this.decorator.updateDeco(r,this.decorations)}},{decorations:r=>r.decorations}))}var tX="\u2022";function rX(r){return r>=32?tX:r==10?"\u2424":String.fromCharCode(9216+r)}var Gf=class extends dt{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=rX(this.code),i=e.state.phrase("Control character")+" "+(KT[this.code]||"0x"+this.code.toString(16)),n=this.options.render&&this.options.render(this.code,i,t);if(n)return n;let s=document.createElement("span");return s.textContent=t,s.title=i,s.setAttribute("aria-label",i),s.className="cm-specialChar",s}ignoreEvent(){return!1}},Hf=class extends dt{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 Lc(){return nX}var iX=F.line({class:"cm-activeLine"}),nX=We.fromClass(class{constructor(r){this.decorations=this.getDeco(r)}update(r){(r.docChanged||r.selectionSet)&&(this.decorations=this.getDeco(r.view))}getDeco(r){let e=-1,t=[];for(let i of r.state.selection.ranges){let n=r.lineBlockAt(i.head);n.from>e&&(t.push(iX.range(n.from)),e=n.from)}return F.set(t)}},{decorations:r=>r.decorations});var Kf=2e3;function sX(r,e,t){let i=Math.min(e.line,t.line),n=Math.max(e.line,t.line),s=[];if(e.off>Kf||t.off>Kf||e.col<0||t.col<0){let o=Math.min(e.off,t.off),a=Math.max(e.off,t.off);for(let l=i;l<=n;l++){let c=r.doc.line(l);c.length<=a&&s.push(E.range(c.from+o,c.to+a))}}else{let o=Math.min(e.col,t.col),a=Math.max(e.col,t.col);for(let l=i;l<=n;l++){let c=r.doc.line(l),d=tc(c.text,o,r.tabSize,!0);if(d<0)s.push(E.cursor(c.to));else{let h=tc(c.text,a,r.tabSize);s.push(E.range(c.from+d,c.from+h))}}}return s}function oX(r,e){let t=r.coordsAtPos(r.viewport.from);return t?Math.round(Math.abs((t.left-e)/r.defaultCharacterWidth)):-1}function E0(r,e){let t=r.posAtCoords({x:e.clientX,y:e.clientY},!1),i=r.state.doc.lineAt(t),n=t-i.from,s=n>Kf?-1:n==i.length?oX(r,e.clientX):zt(i.text,r.state.tabSize,t-i.from);return{line:i.number,col:s,off:n}}function aX(r,e){let t=E0(r,e),i=r.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)},i=i.map(n.changes)}},get(n,s,o){let a=E0(r,n);if(!a)return i;let l=sX(r.state,t,a);return l.length?o?E.create(l.concat(i.ranges)):E.create(l):i}}:null}function Yc(r){let e=(r==null?void 0:r.eventFilter)||(t=>t.altKey&&t.button==0);return V.mouseSelectionStyle.of((t,i)=>e(i)?aX(t,i):null)}var lX={Alt:[18,r=>!!r.altKey],Control:[17,r=>!!r.ctrlKey],Shift:[16,r=>!!r.shiftKey],Meta:[91,r=>!!r.metaKey]},cX={style:"cursor: crosshair"};function Wc(r={}){let[e,t]=lX[r.key||"Alt"],i=We.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))}}});retur
Line truncated
|
|
|
|
|
`&&(t="");else{let i=t.indexOf(`
|
|
|
|
|
`);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let n=this.rangeIndex;;){let s=this.ranges[n].to;if(s>=i||(t=t.slice(0,s-(i-t.length)),n++,n==this.ranges.length))break;let o=this.ranges[n].from,a=this.lineAfter(o);t+=a,i=o+a.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let n=this.ranges[this.rangeIndex].to,s=e+t;if(i>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,i,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(i,n,-1),i+=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]=i:this.chunk.push(e,t,i,s),n}parseLine(e){let{line:t,end:i}=this.nextLine(),n=0,{streamParser:s}=this.lang,o=new ed(t,e?e.state.tabSize:4,e?nn(e.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let a=zS(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=i,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=Se.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:x_,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new Se(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 Se(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}};function zS(r,e,t){e.start=e.pos;for(let i=0;i<10;i++){let n=r(e,t);if(e.pos>e.start)return n}throw new Error("Stream parser failed to advance stream.")}var NO=Object.create(null),ma=[rt.none],x_=new yi(ma),wS=[],vS=Object.create(null),MS=Object.create(null);for(let[r,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"]])MS[r]=LS(NO,e);var td=class{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),MS)}resolve(e){return e?this.table[e]||(this.table[e]=LS(this.extra,e)):0}},S_=new td(NO);function AO(r,e){wS.indexOf(r)>-1||(wS.push(r),console.warn(e))}function LS(r,e){let t=[];for(let a of e.split(" ")){let l=[];for(let c of a.split(".")){let d=r[c]||O[c];d?typeof d=="function"?l.length?l=l.map(d):AO(c,`Modifier ${c} used at start of tag`):l.length?AO(c,`Tag ${c} used as modifier`):l=Array.isArray(d)?d:[d]:AO(c,`Unknown highlighting tag ${c}`)}for(let c of l)t.push(c)}if(!t.length)return 0;let i=e.replace(/ /g,"_"),n=i+" "+t.map(a=>a.id),s=vS[n];if(s)return s.id;let o=vS[n]=rt.define({id:ma.length,name:i,props:[St({[i]:t})]});return ma.push(o),o.id}function w_(r,e){let t=rt.define({id:ma.length,name:"Document",props:[$i.add(()=>r),kr.add(()=>i=>e.getIndent(i))],top:!0});return ma.push(t),t}var dL={rtl:F.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:Ue.RTL}),ltr:F.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:Ue.LTR}),auto:F.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})};var ad=class{constructor(e,t,i,n){this.state=e,this.pos=t,this.explicit=i,this.view=n,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=Te(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),i=Math.max(t.from,this.pos-250),n=t.text.slice(i-t.from,this.pos-t.from),s=n.search(y_(e,!1));return s<0?null:{from:i+s,to:this.pos,text:n.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,i){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),i&&i.onDocChange&&(this.abortOnDocChange=!0))}};function YS(r){let e=Object.keys(r).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function v_(r){let e=Object.create(null),t=Object.create(null);for(let{label:n}of r){e[n[0]]=!0;for(let s=1;s<n.length;s++)t[n[s]]=!0}let i=YS(e)+YS(t)+"*$";return[new RegExp("^"+i),new RegExp(i)]}function DS(r){let e=r.map(n=>typeof n=="string"?{label:n}:n),[t,i]=e.every(n=>/^\w+$/.test(n.label))?[/\w*$/,/\w+$/]:v_(e);return n=>{let s=n.matchBefore(i);return s||n.explicit?{from:s?s.from:n.pos,options:e,validFor:t}:null}}function IS(r,e){return t=>{for(let i=Te(t.state).resolve
Line truncated
|
|
|
|
|
`);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let n=this.rangeIndex;;){let s=this.ranges[n].to;if(s>=i||(t=t.slice(0,s-(i-t.length)),n++,n==this.ranges.length))break;let o=this.ranges[n].from,a=this.lineAfter(o);t+=a,i=o+a.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let n=this.ranges[this.rangeIndex].to,s=e+t;if(i>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,i,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(i,n,-1),i+=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]=i:this.chunk.push(e,t,i,s),n}parseLine(e){let{line:t,end:i}=this.nextLine(),n=0,{streamParser:s}=this.lang,o=new ed(t,e?e.state.tabSize:4,e?nn(e.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let a=US(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=i,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=Se.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:g_,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new Se(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 Se(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}};function US(r,e,t){e.start=e.pos;for(let i=0;i<10;i++){let n=r(e,t);if(e.pos>e.start)return n}throw new Error("Stream parser failed to advance stream.")}var NO=Object.create(null),ma=[rt.none],g_=new yi(ma),SS=[],wS=Object.create(null),zS=Object.create(null);for(let[r,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"]])zS[r]=MS(NO,e);var td=class{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),zS)}resolve(e){return e?this.table[e]||(this.table[e]=MS(this.extra,e)):0}},b_=new td(NO);function AO(r,e){SS.indexOf(r)>-1||(SS.push(r),console.warn(e))}function MS(r,e){let t=[];for(let a of e.split(" ")){let l=[];for(let c of a.split(".")){let d=r[c]||O[c];d?typeof d=="function"?l.length?l=l.map(d):AO(c,`Modifier ${c} used at start of tag`):l.length?AO(c,`Tag ${c} used as modifier`):l=Array.isArray(d)?d:[d]:AO(c,`Unknown highlighting tag ${c}`)}for(let c of l)t.push(c)}if(!t.length)return 0;let i=e.replace(/ /g,"_"),n=i+" "+t.map(a=>a.id),s=wS[n];if(s)return s.id;let o=wS[n]=rt.define({id:ma.length,name:i,props:[St({[i]:t})]});return ma.push(o),o.id}function x_(r,e){let t=rt.define({id:ma.length,name:"Document",props:[$i.add(()=>r),kr.add(()=>i=>e.getIndent(i))],top:!0});return ma.push(t),t}var lL={rtl:F.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:Ue.RTL}),ltr:F.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:Ue.LTR}),auto:F.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})};var ad=class{constructor(e,t,i,n){this.state=e,this.pos=t,this.explicit=i,this.view=n,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=Te(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),i=Math.max(t.from,this.pos-250),n=t.text.slice(i-t.from,this.pos-t.from),s=n.search(w_(e,!1));return s<0?null:{from:i+s,to:this.pos,text:n.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,i){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),i&&i.onDocChange&&(this.abortOnDocChange=!0))}};function LS(r){let e=Object.keys(r).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function S_(r){let e=Object.create(null),t=Object.create(null);for(let{label:n}of r){e[n[0]]=!0;for(let s=1;s<n.length;s++)t[n[s]]=!0}let i=LS(e)+LS(t)+"*$";return[new RegExp("^"+i),new RegExp(i)]}function jS(r){let e=r.map(n=>typeof n=="string"?{label:n}:n),[t,i]=e.every(n=>/^\w+$/.test(n.label))?[/\w*$/,/\w+$/]:S_(e);return n=>{let s=n.matchBefore(i);return s||n.explicit?{from:s?s.from:n.pos,options:e,validFor:t}:null}}function DS(r,e){return t=>{for(let i=Te(t.state).resolve
Line truncated
|
|
|
|
|
`;let o=r.state.facet(hi),a=o instanceof wt?"Lezer LRLanguage":o instanceof pt?"StreamLanguage":"Unknown",l=o instanceof wt?"AST ":o instanceof pt?"Token ":"Name ";return{pos:e,above:!0,arrow:!0,create(c){let d=document.createElement("div");d.style.overflow="visible",d.style.height="0",d.style.width="0";let h=document.createElement("div");return h.className="cm-debug-tooltip",h.textContent=`Parser: ${a}
|
|
|
|
|
${l}: ${i.name}
|
|
|
|
|
Tags : ${s}`,h.style.whiteSpace="pre-wrap",h.style.fontFamily="monospace",h.style.background="#333",h.style.color="white",h.style.padding="2px 8px",h.style.borderRadius="4px",h.style.fontSize="12px",h.style.border="1px solid #555",h.style.pointerEvents="none",h.style.position="absolute",h.style.bottom="0",h.style.width="max-content",d.appendChild(h),{dom:d}}}},{hoverTime:10,hideOnChange:!0});var D_=r=>{let{state:e}=r,t=e.doc.lineAt(e.selection.main.from),i=ap(r.state,t.from);return i.line?I_(r):i.block?F_(r):!1};function op(r,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let n=r(e,t);return n?(i(t.update(n)),!0):!1}}var I_=op(G_,0);var q_=op(lw,0);var F_=op((r,e)=>lw(r,e,N_(e)),0);function ap(r,e){let t=r.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}var Sa=50;function B_(r,{open:e,close:t},i,n){let s=r.sliceDoc(i-Sa,i),o=r.sliceDoc(n,n+Sa),a=/\s*$/.exec(s)[0].length,l=/^\s*/.exec(o)[0].length,c=s.length-a;if(s.slice(c-e.length,c)==e&&o.slice(l,l+t.length)==t)return{open:{pos:i-a,margin:a&&1},close:{pos:n+l,margin:l&&1}};let d,h;n-i<=2*Sa?d=h=r.sliceDoc(i,n):(d=r.sliceDoc(i,i+Sa),h=r.sliceDoc(n-Sa,n));let u=/^\s*/.exec(d)[0].length,f=/\s*$/.exec(h)[0].length,p=h.length-f-t.length;return d.slice(u,u+e.length)==e&&h.slice(p,p+t.length)==t?{open:{pos:i+u+e.length,margin:/\s/.test(d.charAt(u+e.length))?1:0},close:{pos:n-f-t.length,margin:/\s/.test(h.charAt(p-1))?1:0}}:null}function N_(r){let e=[];for(let t of r.selection.ranges){let i=r.doc.lineAt(t.from),n=t.to<=i.to?i:r.doc.lineAt(t.to);n.from>i.from&&n.from==t.to&&(n=t.to==i.to+1?i:r.doc.lineAt(t.to-1));let s=e.length-1;s>=0&&e[s].to>i.from?e[s].to=n.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:n.to})}return e}function lw(r,e,t=e.selection.ranges){let i=t.map(s=>ap(e,s.from).block);if(!i.every(s=>s))return null;let n=t.map((s,o)=>B_(e,i[o],s.from,s.to));if(r!=2&&!n.every(s=>s))return{changes:e.changes(t.map((s,o)=>n[o]?[]:[{from:s.from,insert:i[o].open+" "},{from:s.to,insert:" "+i[o].close}]))};if(r!=1&&n.some(s=>s)){let s=[];for(let o=0,a;o<n.length;o++)if(a=n[o]){let l=i[o],{open:c,close:d}=a;s.push({from:c.pos-l.open.length,to:c.pos+c.margin},{from:d.pos-d.margin,to:d.pos+l.close.length})}return{changes:s}}return null}function G_(r,e,t=e.selection.ranges){let i=[],n=-1;e:for(let{from:s,to:o}of t){let a=i.length,l=1e9,c;for(let d=s;d<=o;){let h=e.doc.lineAt(d);if(c==null&&(c=ap(e,h.from).line,!c))continue e;if(h.from>n&&(s==o||o>h.from)){n=h.from;let u=/^\s*/.exec(h.text)[0].length,f=u==h.length,p=h.text.slice(u,u+c.length)==c?u:-1;u<h.text.length&&u<l&&(l=u),i.push({line:h,comment:p,token:c,indent:u,empty:f,single:!1})}d=h.to+1}if(l<1e9)for(let d=a;d<i.length;d++)i[d].indent<i[d].line.text.length&&(i[d].indent=l);i.length==a+1&&(i[a].single=!0)}if(r!=2&&i.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:a,token:l,indent:c,empty:d,single:h}of i)(h||!d)&&s.push({from:a.from+c,insert:l+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(r!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:a,token:l}of i)if(a>=0){let c=o.from+a,d=c+l.length;o.text[d-o.from]==" "&&d++,s.push({from:c,to:d})}return{changes:s}}return null}var ip=Nt.define(),hd=Nt.define(),H_=J.define(),cw=J.define({combine(r){return sr(r,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,n)=>e(i,n)||t(i,n)})}}),dw=ke.define({create(){return Fn.empty},update(r,e){let t=e.state.facet(cw),i=e.annotation(ip);if(i){let l=Br.fromTransaction(e,i.selection),c=i.side,d=c==0?r.undone:r.done;return l?d=dd(d,d.length,t.minDepth,l):d=fw(d,e.startState.selection),new Fn(c==0?i.rest:d,c==0?d:i.rest)}let n=e.annotation(hd);if((n=="full"||n=="before")&&(r=r.isolate()),e.annotation(Be.addToHistory)===!1)return e.changes.empty?r:r.addMapping(e.changes.desc);let s=Br.fromTransaction(e),o=e.annotation(Be.time),a=e.annotation(Be.userEvent);return s?r=r.addChanges(s,o,a,t,e):e.selection&&(r=r.addSelection(e.startState.selection,o,a,t.newGroupDelay)),(n=="full"||n=="after")&&(r=r.isolate()),r},toJSON(r){return{done:r.done.map(e=>e.toJSON()),undone:r.undone.map(e=>e.toJSON())}},fromJSON(r){return new Fn(r.done.map(Br.fromJSON),r.undone.map(Br.fromJSON))}});function hw(r={}){return[dw,cw.of(r),V.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?wa:e.inputType=="historyRedo"?Hs:null;return i?(e.preventDefault(),i(t)):!1}})]}function ud(r,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let n=t.field(dw,!1);if(!n)return!1;let s=n.pop(r,t,e);return s?(i(s),!0):!1}}var wa=ud(0,!1),Hs=ud(1,!1),K_=ud(0,!0),J_=ud(1,!0);var Br=class r{constructor(e,t,i,n,s){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=n,this.selectionsAfter=s}setSelAfter(e){return new r(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.m
Line truncated
|
|
|
|
|
Tags : ${s}`,h.style.whiteSpace="pre-wrap",h.style.fontFamily="monospace",h.style.background="#333",h.style.color="white",h.style.padding="2px 8px",h.style.borderRadius="4px",h.style.fontSize="12px",h.style.border="1px solid #555",h.style.pointerEvents="none",h.style.position="absolute",h.style.bottom="0",h.style.width="max-content",d.appendChild(h),{dom:d}}}},{hoverTime:10,hideOnChange:!0});var V_=r=>{let{state:e}=r,t=e.doc.lineAt(e.selection.main.from),i=ap(r.state,t.from);return i.line?j_(r):i.block?I_(r):!1};function op(r,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let n=r(e,t);return n?(i(t.update(n)),!0):!1}}var j_=op(B_,0);var D_=op(aw,0);var I_=op((r,e)=>aw(r,e,F_(e)),0);function ap(r,e){let t=r.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}var Sa=50;function q_(r,{open:e,close:t},i,n){let s=r.sliceDoc(i-Sa,i),o=r.sliceDoc(n,n+Sa),a=/\s*$/.exec(s)[0].length,l=/^\s*/.exec(o)[0].length,c=s.length-a;if(s.slice(c-e.length,c)==e&&o.slice(l,l+t.length)==t)return{open:{pos:i-a,margin:a&&1},close:{pos:n+l,margin:l&&1}};let d,h;n-i<=2*Sa?d=h=r.sliceDoc(i,n):(d=r.sliceDoc(i,i+Sa),h=r.sliceDoc(n-Sa,n));let u=/^\s*/.exec(d)[0].length,f=/\s*$/.exec(h)[0].length,p=h.length-f-t.length;return d.slice(u,u+e.length)==e&&h.slice(p,p+t.length)==t?{open:{pos:i+u+e.length,margin:/\s/.test(d.charAt(u+e.length))?1:0},close:{pos:n-f-t.length,margin:/\s/.test(h.charAt(p-1))?1:0}}:null}function F_(r){let e=[];for(let t of r.selection.ranges){let i=r.doc.lineAt(t.from),n=t.to<=i.to?i:r.doc.lineAt(t.to);n.from>i.from&&n.from==t.to&&(n=t.to==i.to+1?i:r.doc.lineAt(t.to-1));let s=e.length-1;s>=0&&e[s].to>i.from?e[s].to=n.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:n.to})}return e}function aw(r,e,t=e.selection.ranges){let i=t.map(s=>ap(e,s.from).block);if(!i.every(s=>s))return null;let n=t.map((s,o)=>q_(e,i[o],s.from,s.to));if(r!=2&&!n.every(s=>s))return{changes:e.changes(t.map((s,o)=>n[o]?[]:[{from:s.from,insert:i[o].open+" "},{from:s.to,insert:" "+i[o].close}]))};if(r!=1&&n.some(s=>s)){let s=[];for(let o=0,a;o<n.length;o++)if(a=n[o]){let l=i[o],{open:c,close:d}=a;s.push({from:c.pos-l.open.length,to:c.pos+c.margin},{from:d.pos-d.margin,to:d.pos+l.close.length})}return{changes:s}}return null}function B_(r,e,t=e.selection.ranges){let i=[],n=-1;e:for(let{from:s,to:o}of t){let a=i.length,l=1e9,c;for(let d=s;d<=o;){let h=e.doc.lineAt(d);if(c==null&&(c=ap(e,h.from).line,!c))continue e;if(h.from>n&&(s==o||o>h.from)){n=h.from;let u=/^\s*/.exec(h.text)[0].length,f=u==h.length,p=h.text.slice(u,u+c.length)==c?u:-1;u<h.text.length&&u<l&&(l=u),i.push({line:h,comment:p,token:c,indent:u,empty:f,single:!1})}d=h.to+1}if(l<1e9)for(let d=a;d<i.length;d++)i[d].indent<i[d].line.text.length&&(i[d].indent=l);i.length==a+1&&(i[a].single=!0)}if(r!=2&&i.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:a,token:l,indent:c,empty:d,single:h}of i)(h||!d)&&s.push({from:a.from+c,insert:l+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(r!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:a,token:l}of i)if(a>=0){let c=o.from+a,d=c+l.length;o.text[d-o.from]==" "&&d++,s.push({from:c,to:d})}return{changes:s}}return null}var ip=Nt.define(),hd=Nt.define(),N_=J.define(),lw=J.define({combine(r){return sr(r,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,n)=>e(i,n)||t(i,n)})}}),cw=ke.define({create(){return Fn.empty},update(r,e){let t=e.state.facet(lw),i=e.annotation(ip);if(i){let l=Br.fromTransaction(e,i.selection),c=i.side,d=c==0?r.undone:r.done;return l?d=dd(d,d.length,t.minDepth,l):d=uw(d,e.startState.selection),new Fn(c==0?i.rest:d,c==0?d:i.rest)}let n=e.annotation(hd);if((n=="full"||n=="before")&&(r=r.isolate()),e.annotation(Be.addToHistory)===!1)return e.changes.empty?r:r.addMapping(e.changes.desc);let s=Br.fromTransaction(e),o=e.annotation(Be.time),a=e.annotation(Be.userEvent);return s?r=r.addChanges(s,o,a,t,e):e.selection&&(r=r.addSelection(e.startState.selection,o,a,t.newGroupDelay)),(n=="full"||n=="after")&&(r=r.isolate()),r},toJSON(r){return{done:r.done.map(e=>e.toJSON()),undone:r.undone.map(e=>e.toJSON())}},fromJSON(r){return new Fn(r.done.map(Br.fromJSON),r.undone.map(Br.fromJSON))}});function dw(r={}){return[cw,lw.of(r),V.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?wa:e.inputType=="historyRedo"?Hs:null;return i?(e.preventDefault(),i(t)):!1}})]}function ud(r,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let n=t.field(cw,!1);if(!n)return!1;let s=n.pop(r,t,e);return s?(i(s),!0):!1}}var wa=ud(0,!1),Hs=ud(1,!1),G_=ud(0,!0),H_=ud(1,!0);var Br=class r{constructor(e,t,i,n,s){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=n,this.selectionsAfter=s}setSelAfter(e){return new r(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.m
Line truncated
|
|
|
|
|
<div class="form-group"><label>Tab size: <input type="number" id="setting_tabSize" min="1" max="40" value="${r.tabSize}" style="width:4em"></label></div>
|
|
|
|
|
<div class="checkbox"><label><input type="checkbox" id="setting_tabsToSpaces" ${r.tabsToSpaces?"checked":""}> Insert spaces when pressing TAB</label></div>
|
|
|
|
|
<div class="checkbox"><label><input type="checkbox" id="setting_highlightSpecialChars" ${r.highlightSpecialChars?"checked":""}> Highlight special characters</label></div>
|
|
|
|
@@ -29,23 +29,23 @@ Tags : ${s}`,h.style.whiteSpace="pre-wrap",h.style.fontFamily="monospace",h.sty
|
|
|
|
|
<h5>Internal</h5>
|
|
|
|
|
<div class="checkbox"><label><input type="checkbox" id="setting_debugHighlightTags" ${r.debugHighlightTags?"checked":""}> Debug editor syntax highlighting tags</label></div>
|
|
|
|
|
`:""}
|
|
|
|
|
</form>`,buttons:{cancel:{label:"Cancel",className:"btn-default"},ok:{label:"Save",className:"btn-primary",callback:()=>{r.tabSize=parseInt($("#setting_tabSize").val())||8,r.tabsToSpaces=$("#setting_tabsToSpaces").is(":checked"),r.highlightSpecialChars=$("#setting_highlightSpecialChars").is(":checked"),r.highlightWhitespace=$("#setting_highlightWhitespace").is(":checked"),r.highlightTrailingWhitespace=$("#setting_highlightTrailingWhitespace").is(":checked"),r.closeBrackets=$("#setting_closeBrackets").is(":checked"),r.showLineNumbers=$("#setting_showLineNumbers").is(":checked"),e&&(r.debugHighlightTags=$("#setting_debugHighlightTags").is(":checked")),r.showStatusBar=$("#setting_showStatusBar").is(":checked"),O2(r),p2(r),zl(r.showStatusBar)}}}})}function xd(){return typeof navigator!="undefined"?navigator.storage:null}function m2(r){var e=r!==void 0?r:xd();return!!(e&&typeof e.persist=="function")}async function g2(r){var e=r!==void 0?r:xd();try{if(e&&typeof e.estimate=="function"){var t=await e.estimate();return{usage:t&&t.usage,quota:t&&t.quota}}}catch(i){console.log("storage.estimate() failed",i)}return{}}async function b2(r){var e=r!==void 0?r:xd(),t={supported:m2(e),persisted:!1};try{e&&typeof e.persisted=="function"&&(t.persisted=await e.persisted())}catch(n){console.log("storage.persisted() failed",n)}var i=await g2(e);return t.usage=i.usage,t.quota=i.quota,t}async function up(r){var e=r!==void 0?r:xd(),t=await b2(e);if(!t.supported||t.persisted)return t.granted=!1,t;try{t.persisted=await e.persist(),t.granted=t.persisted}catch(i){console.log("storage.persist() failed",i),t.granted=!1}return t}function x2(r){return r==null&&(r=typeof navigator!="undefined"?navigator.userAgent:""),r?/Edg\/|OPR\/|Chrome\/|Chromium\//.test(r)?"chromium":/Firefox\/|FxiOS\//.test(r)?"firefox":/Safari\//.test(r)?"safari":"other":"other"}function tv(r){if(typeof r!="number"||!isFinite(r))return"?";for(var e=["bytes","KB","MB","GB","TB"],t=0;r>=1024&&t<e.length-1;)r/=1024,t++;return(t==0?r.toFixed(0):r.toFixed(1))+" "+e[t]}function rv(r){return r.usage==null&&r.quota==null?"":"This site is using "+tv(r.usage)+" of the "+tv(r.quota)+" your browser allows."}var hp="Your edits are still saved in this browser either way — persistence only protects them if the browser needs to reclaim disk space. Use <b>File > Download All Changes as ZIP</b> (or push to GitHub) to keep a backup.";function iv(r){switch(r||x2()){case"chromium":return"Chrome and Edge never ask — they grant persistent storage on their own to sites you use regularly. Bookmarking this page, or installing it as an app, usually qualifies it; then try <b>Request Local Storage Permissions</b> again.";case"firefox":return"Firefox asks for permission the first time. If you dismissed or blocked that prompt, clear it from the padlock icon in the address bar and try <b>Request Local Storage Permissions</b> again.";case"safari":return"Safari decides on its own, and may delete site data after several days without a visit. Adding this page to your Favorites or Home Screen makes eviction less likely.";default:return"This browser decides on its own whether to keep site data."}}function S2(){return"This browser doesn't support persistent storage, so it may discard your local file edits when it needs disk space. "+hp}function nv(r,e){var t=rv(r),i;return r.supported?r.persisted?i=(r.granted?"Your browser just granted persistent storage. ":"Your browser is already persisting your local file edits. ")+hp:i="Your browser has not granted persistent storage, so it may discard your local file edits when it needs disk space.<br><br>"+iv()+"<br><br>"+hp:i=S2(),t?i+"<br><br>"+t:i}function sv(r){return"Your browser ran out of space for this site, so your last edit may not have been saved.<br><br>"+rv(r)+" Delete unused projects, or use <b>File > Download All Changes as ZIP</b> to back up your work before it is lost."+(r.supported&&!r.persisted?"<br><br>"+iv():"")}var lv=bu(Xu());var Qa=class{constructor(e,t){e=e||[],this.lines=e,this.text=t,this.offset2loc=new Map,this.line2offset=new Map;for(var i of e)i.offset>=0&&(this.offset2loc.has(i.offset)||this.offset2loc.set(i.offset,i),this.line2offset.has(i.line)||this.line2offset.set(i.line,i.offset));this.sortedOffsets=Array.from(this.offset2loc.keys()).sort((n,s)=>n-s)}findLineForOffset(e,t){let i=this.sortedOffsets;for(var n=0,s=i.length-1,o=-1;n<=s;){var a=n+s>>1;i[a]<=e?(o=a,n=a+1):s=a-1}if(o<0)return null;var l=i[o];return e-l>t?null:this.offset2loc.get(l)}lineCount(){return this.lines.length}};function ov(r){return"errors"in r}function av(r){return"output"in r}var Sd=class{constructor(e){this.preset_id=$t(e)}async getRemoteFile(e){return new Promise((t,i)=>Mo(e,t,Xn(e)?"arraybuffer":"text"))}async getFileData(e){var t="presets/"+this.preset_id+"/"+e,i=await this.getRemoteFile(t);return i&&console.log("read",t,i.length,"bytes"),i}async setFileData(e,t){}onFileSystemUpdate(e){}};var ro=class{constructor(e,t){this.basefs=eLine truncated
|
|
|
|
|
</form>`,buttons:{cancel:{label:"Cancel",className:"btn-default"},ok:{label:"Save",className:"btn-primary",callback:()=>{r.tabSize=parseInt($("#setting_tabSize").val())||8,r.tabsToSpaces=$("#setting_tabsToSpaces").is(":checked"),r.highlightSpecialChars=$("#setting_highlightSpecialChars").is(":checked"),r.highlightWhitespace=$("#setting_highlightWhitespace").is(":checked"),r.highlightTrailingWhitespace=$("#setting_highlightTrailingWhitespace").is(":checked"),r.closeBrackets=$("#setting_closeBrackets").is(":checked"),r.showLineNumbers=$("#setting_showLineNumbers").is(":checked"),e&&(r.debugHighlightTags=$("#setting_debugHighlightTags").is(":checked")),r.showStatusBar=$("#setting_showStatusBar").is(":checked"),u2(r),f2(r),zl(r.showStatusBar)}}}})}function xd(){return typeof navigator!="undefined"?navigator.storage:null}function O2(r){var e=r!==void 0?r:xd();return!!(e&&typeof e.persist=="function")}async function p2(r){var e=r!==void 0?r:xd();try{if(e&&typeof e.estimate=="function"){var t=await e.estimate();return{usage:t&&t.usage,quota:t&&t.quota}}}catch(i){console.log("storage.estimate() failed",i)}return{}}async function m2(r){var e=r!==void 0?r:xd(),t={supported:O2(e),persisted:!1};try{e&&typeof e.persisted=="function"&&(t.persisted=await e.persisted())}catch(n){console.log("storage.persisted() failed",n)}var i=await p2(e);return t.usage=i.usage,t.quota=i.quota,t}async function up(r){var e=r!==void 0?r:xd(),t=await m2(e);if(!t.supported||t.persisted)return t.granted=!1,t;try{t.persisted=await e.persist(),t.granted=t.persisted}catch(i){console.log("storage.persist() failed",i),t.granted=!1}return t}function g2(r){return r==null&&(r=typeof navigator!="undefined"?navigator.userAgent:""),r?/Edg\/|OPR\/|Chrome\/|Chromium\//.test(r)?"chromium":/Firefox\/|FxiOS\//.test(r)?"firefox":/Safari\//.test(r)?"safari":"other":"other"}function ev(r){if(typeof r!="number"||!isFinite(r))return"?";for(var e=["bytes","KB","MB","GB","TB"],t=0;r>=1024&&t<e.length-1;)r/=1024,t++;return(t==0?r.toFixed(0):r.toFixed(1))+" "+e[t]}function tv(r){return r.usage==null&&r.quota==null?"":"This site is using "+ev(r.usage)+" of the "+ev(r.quota)+" your browser allows."}var hp="Your edits are still saved in this browser either way — persistence only protects them if the browser needs to reclaim disk space. Use <b>File > Download All Changes as ZIP</b> (or push to GitHub) to keep a backup.";function rv(r){switch(r||g2()){case"chromium":return"Chrome and Edge never ask — they grant persistent storage on their own to sites you use regularly. Bookmarking this page, or installing it as an app, usually qualifies it; then try <b>Request Local Storage Permissions</b> again.";case"firefox":return"Firefox asks for permission the first time. If you dismissed or blocked that prompt, clear it from the padlock icon in the address bar and try <b>Request Local Storage Permissions</b> again.";case"safari":return"Safari decides on its own, and may delete site data after several days without a visit. Adding this page to your Favorites or Home Screen makes eviction less likely.";default:return"This browser decides on its own whether to keep site data."}}function b2(){return"This browser doesn't support persistent storage, so it may discard your local file edits when it needs disk space. "+hp}function iv(r,e){var t=tv(r),i;return r.supported?r.persisted?i=(r.granted?"Your browser just granted persistent storage. ":"Your browser is already persisting your local file edits. ")+hp:i="Your browser has not granted persistent storage, so it may discard your local file edits when it needs disk space.<br><br>"+rv()+"<br><br>"+hp:i=b2(),t?i+"<br><br>"+t:i}function nv(r){return"Your browser ran out of space for this site, so your last edit may not have been saved.<br><br>"+tv(r)+" Delete unused projects, or use <b>File > Download All Changes as ZIP</b> to back up your work before it is lost."+(r.supported&&!r.persisted?"<br><br>"+rv():"")}var av=bu(Xu());var Qa=class{constructor(e,t){e=e||[],this.lines=e,this.text=t,this.offset2loc=new Map,this.line2offset=new Map;for(var i of e)i.offset>=0&&(this.offset2loc.has(i.offset)||this.offset2loc.set(i.offset,i),this.line2offset.has(i.line)||this.line2offset.set(i.line,i.offset));this.sortedOffsets=Array.from(this.offset2loc.keys()).sort((n,s)=>n-s)}findLineForOffset(e,t){let i=this.sortedOffsets;for(var n=0,s=i.length-1,o=-1;n<=s;){var a=n+s>>1;i[a]<=e?(o=a,n=a+1):s=a-1}if(o<0)return null;var l=i[o];return e-l>t?null:this.offset2loc.get(l)}lineCount(){return this.lines.length}};function sv(r){return"errors"in r}function ov(r){return"output"in r}var Sd=class{constructor(e){this.preset_id=$t(e)}async getRemoteFile(e){return new Promise((t,i)=>Mo(e,t,Xn(e)?"arraybuffer":"text"))}async getFileData(e){var t="presets/"+this.preset_id+"/"+e,i=await this.getRemoteFile(t);return i&&console.log("read",t,i.length,"bytes"),i}async setFileData(e,t){}onFileSystemUpdate(e){}};var ro=class{constructor(e,t){this.basefs=eLine truncated
|
|
|
|
|
=====
|
|
|
|
|
|
|
|
|
|
[Open this project in 8bitworkshop](http://8bitworkshop.com/redir.html?platform=$PLATFORM&githubURL=$GITHUBURL&file=$MAINFILE).
|
|
|
|
|
`;function Bn(){for(var r={},e=0;e<localStorage.length;e++){var t=localStorage.key(e);if(t.startsWith("__repo__")){var i=JSON.parse(localStorage.getItem(t)),n=t.substring(8);r[n]=i}}return r}function Pa(r){var e=r.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 Qd=class{constructor(e,t,i,n){this.githubCons=e,this.githubToken=t,this.store=i,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,i)=>{t()});var e=new firebase.auth.GithubAuthProvider;return e.addScope("repo"),firebase.auth().signInWithPopup(e).then(t=>{this.githubToken=t.credential.accessToken;var i=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=Pa(e);if(!t)throw new Error("Please enter a valid GitHub URL.");var i=Bn()[t.repopath],n=t.branch||i&&i.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:i?i.platform_id:null};return o}getGithubHEADTree(e){var t;return this.getGithubSession(e).then(i=>(t=i,t.repo.git.refs.heads(t.branch).fetch())).then(i=>(t.head=i,t.sha=i.object.sha,t.repo.git.trees(t.sha).fetch())).then(i=>{if(t.subtreepath){for(let n of i.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 "+i.sha)}return i}).then(i=>(t.tree=i,t))}bind(e,t){var i="__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(i,JSON.stringify(n))}else localStorage.removeItem(i)}import(e){var t;return this.getGithubSession(e).then(i=>(t=i,t.repo.contents("README.md").read())).catch(i=>(console.log(i),console.log("no README.md found"),t.repo.fetch().then(n=>""))).then(i=>{var n;if(n=/8bitworkshop.com[^)]+file=([^)&]+)/.exec(i),n&&n[1]&&(console.log("main path: '"+n[1]+"'"),t.mainPath=n[1]),n=/8bitworkshop.com[^)]+platform=([A-Za-z0-9._\-]+)/.exec(i),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 i;return this.getGithubHEADTree(e).then(n=>{i=n;let s=[];return i.paths=[],i.tree.tree.forEach(o=>{if(console.log(o.path,o.type,o.size),i.paths.push(o.path),o.type=="blob"&&!this.isFileIgnored(o.path)){var a=i.repo.git.blobs(o.sha).fetch().then(l=>{var c=i.prefix+o.path,d=o.size,h=l.encoding,u=l.content;if(l.encoding=="base64"){var f=Rl(atob(u)),p=Xn(o.path,f);u=p?f:Al(f)}return l.size!=u.length&&(u=u.slice(0,l.size)),(t||this.store).setItem(c,u)});s.push(a)}else console.log("ignoring "+o.path)}),Promise.all(s)}).then(n=>i)}importAndPull(e){return this.import(e).then(t=>this.pull(e))}publish(e,t,i,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:i}).then(l=>{s=l;var c=w2;c=c.replace(/\$NAME/g,encodeURIComponent(e)),c=c.replace(/\$PLATFORM/g,encodeURIComponent(o)),c=c.replace(/\$GITHUBURL/g,encodeURIComponent(s.htmlUrl)),c=c.replace(/\$MAINFILE/g,encodeURIComponent(a));var d={message:"8bitworkshop: updated metadata in README.md",content:btoa(c)};return s.contents("README.md").add(d)}).then(()=>this.getGithubSession(s.htmlUrl))}commit(e,t,i){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(i.map(o=>typeof o.data=="string"?n.repo.git.blobs.create({content:o.data,encoding:"utf-8"}):n.repo.git.blobs.create({content:btoa(Cl(o.data)),encoding:"base64"})))}).then(s=>n.repo.git.trees.create({tree:i.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.com
Line truncated
|
|
|
|
|
`},s=window.c2t({noInitialRun:!0,print:n,printErr:n}),o=s.FS,a=lt()+".bin",l=lt()+".wav";o.writeFile(a,Wt(),{encoding:"binary"});var c=["-2bc",a+","+e.toString(16),l];s.callMain(c);var d=o.readFile(l,{encoding:"binary"});if(d){var h=new Blob([d],{type:"audio/wav"});(0,fi.saveAs)(h,l),i+="Then connect your audio output to the cassette input, turn up the volume, and play the audio file.",kt(i)}})}function P2(r){xr("lib/makewav.js").then(()=>{let e="",t=function(a){e+=a+`
|
|
|
|
|
`;function Bn(){for(var r={},e=0;e<localStorage.length;e++){var t=localStorage.key(e);if(t.startsWith("__repo__")){var i=JSON.parse(localStorage.getItem(t)),n=t.substring(8);r[n]=i}}return r}function Pa(r){var e=r.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 Qd=class{constructor(e,t,i,n){this.githubCons=e,this.githubToken=t,this.store=i,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,i)=>{t()});var e=new firebase.auth.GithubAuthProvider;return e.addScope("repo"),firebase.auth().signInWithPopup(e).then(t=>{this.githubToken=t.credential.accessToken;var i=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=Pa(e);if(!t)throw new Error("Please enter a valid GitHub URL.");var i=Bn()[t.repopath],n=t.branch||i&&i.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:i?i.platform_id:null};return o}getGithubHEADTree(e){var t;return this.getGithubSession(e).then(i=>(t=i,t.repo.git.refs.heads(t.branch).fetch())).then(i=>(t.head=i,t.sha=i.object.sha,t.repo.git.trees(t.sha).fetch())).then(i=>{if(t.subtreepath){for(let n of i.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 "+i.sha)}return i}).then(i=>(t.tree=i,t))}bind(e,t){var i="__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(i,JSON.stringify(n))}else localStorage.removeItem(i)}import(e){var t;return this.getGithubSession(e).then(i=>(t=i,t.repo.contents("README.md").read())).catch(i=>(console.log(i),console.log("no README.md found"),t.repo.fetch().then(n=>""))).then(i=>{var n;if(n=/8bitworkshop.com[^)]+file=([^)&]+)/.exec(i),n&&n[1]&&(console.log("main path: '"+n[1]+"'"),t.mainPath=n[1]),n=/8bitworkshop.com[^)]+platform=([A-Za-z0-9._\-]+)/.exec(i),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 i;return this.getGithubHEADTree(e).then(n=>{i=n;let s=[];return i.paths=[],i.tree.tree.forEach(o=>{if(console.log(o.path,o.type,o.size),i.paths.push(o.path),o.type=="blob"&&!this.isFileIgnored(o.path)){var a=i.repo.git.blobs(o.sha).fetch().then(l=>{var c=i.prefix+o.path,d=o.size,h=l.encoding,u=l.content;if(l.encoding=="base64"){var f=Rl(atob(u)),p=Xn(o.path,f);u=p?f:Al(f)}return l.size!=u.length&&(u=u.slice(0,l.size)),(t||this.store).setItem(c,u)});s.push(a)}else console.log("ignoring "+o.path)}),Promise.all(s)}).then(n=>i)}importAndPull(e){return this.import(e).then(t=>this.pull(e))}publish(e,t,i,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:i}).then(l=>{s=l;var c=x2;c=c.replace(/\$NAME/g,encodeURIComponent(e)),c=c.replace(/\$PLATFORM/g,encodeURIComponent(o)),c=c.replace(/\$GITHUBURL/g,encodeURIComponent(s.htmlUrl)),c=c.replace(/\$MAINFILE/g,encodeURIComponent(a));var d={message:"8bitworkshop: updated metadata in README.md",content:btoa(c)};return s.contents("README.md").add(d)}).then(()=>this.getGithubSession(s.htmlUrl))}commit(e,t,i){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(i.map(o=>typeof o.data=="string"?n.repo.git.blobs.create({content:o.data,encoding:"utf-8"}):n.repo.git.blobs.create({content:btoa(Cl(o.data)),encoding:"base64"})))}).then(s=>n.repo.git.trees.create({tree:i.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.com
Line truncated
|
|
|
|
|
`},s=window.c2t({noInitialRun:!0,print:n,printErr:n}),o=s.FS,a=lt()+".bin",l=lt()+".wav";o.writeFile(a,Wt(),{encoding:"binary"});var c=["-2bc",a+","+e.toString(16),l];s.callMain(c);var d=o.readFile(l,{encoding:"binary"});if(d){var h=new Blob([d],{type:"audio/wav"});(0,fi.saveAs)(h,l),i+="Then connect your audio output to the cassette input, turn up the volume, and play the audio file.",kt(i)}})}function y2(r){xr("lib/makewav.js").then(()=>{let e="",t=function(a){e+=a+`
|
|
|
|
|
`};var i=Pt(lt());let n=i+".bin",s=i+".wav";window.makewav({noInitialRun:!1,print:t,printErr:t,arguments:["-ts","-f0","-v10",n],preRun:a=>{a.FS.writeFile(n,Wt(),{encoding:"binary"})}}).ready.then(a=>{let l=[n];a.run(l),console.log(e);let d=a.FS.readFile(s,{encoding:"binary"});if(d){let h=new Blob([d],{type:"audio/wav"});(0,fi.saveAs)(h,s),e+=`
|
|
|
|
|
Connect your audio output to the SuperCharger input, turn up the volume, and play the audio file.`,kt(e)}})})}function $2(r){var e=Pt(lt());let t=e+".tap",i=new Nn(e),n=new Pd({sine_wave:!0}),s=Wt(),o=s[0]+s[1]*256;s=s.slice(2),i.setContent({data:s,startAddress:o,type:Nn.FILE_TYPE_NON_RELOCATABLE}),i.generateSound(n);let a=n.getTAPData();if(a){let l=new Blob([a],{type:"application/octet-stream"});(0,fi.saveAs)(l,t)}}function Op(){switch($t(le)){case"vcs":return P2;case"apple2":return Q2;case"c64":return $2}}function dv(r){if(Wt()==null)return ve("Please fix errors before exporting."),!0;var e=Op();if(e===void 0)return ve("Cassette export is not supported on this platform."),!0;e(r)}function hv(r){if(Wt()==null)return ve("Please finish compiling with no errors before downloading ROM."),!0;var e=Pt(lt());if(w.getDownloadFile){var t=w.getDownloadFile(),e=Pt(lt());(0,fi.saveAs)(t.blob,e+t.extension)}else if(Wt()instanceof Uint8Array){var i=new Blob([Wt()],{type:"application/octet-stream"}),n=w.getROMExtension&&w.getROMExtension(Wt())||"-"+$t(le)+".bin";(0,fi.saveAs)(i,e+n)}else ve(`The "${le}" platform doesn't have downloadable ROMs.`)}function uv(r){var e=W.getCurrentText();if(!e)return!1;var t=new Blob([e],{type:"text/plain;charset=utf-8"});(0,fi.saveAs)(t,bv(),{autoBom:!1})}async function fv(){let r=(await import("./jszip.min-EENSZHRN.js")).default;return new r}async function Ov(r){var e=await fv();ki().iterateFiles((t,i)=>{i&&e.file(ft(t),i)}),e.generateAsync({type:"blob"}).then(t=>{(0,fi.saveAs)(t,lt()+"-"+$t(le)+".zip")})}function pv(r){let e=w.getDebugSymbolFile&&w.getDebugSymbolFile();if(!e){ve("This project does not have debug information.");return}var t=Pt(lt());(0,fi.saveAs)(e.blob,t+e.extension,{autoBom:!1})}async function mv(r){var e=await fv(),t=await an().keys();Le(!0);try{var i=0;await Promise.all(t.map(s=>an().getItem(s).then(o=>{Wr(i++/(t.length+1)),o&&e.file(s,o)})));var n=await e.generateAsync({type:"blob"});(0,fi.saveAs)(n,$t(le)+"-all.zip")}finally{Le(!1)}}var fp=!1;function gv(){fp||xr("lib/gif.js").then(()=>{var r=$("#emulator").find("canvas")[0];if(!r){ve("Could not find canvas element to record video!");return}var e=0;r.style&&r.style.transform&&(r.style.transform.indexOf("rotate(-90deg)")>=0?e=-1:r.style.transform.indexOf("rotate(90deg)")>=0&&(e=1));var t=new GIF({workerScript:"lib/gif.worker.js",workers:4,quality:10,rotate:e}),i=$("#videoPreviewImage");t.on("progress",l=>{Wr(l)}),t.on("finished",l=>{i.attr("src",URL.createObjectURL(l)),Le(!1),w.resume(),$("#videoPreviewModal").modal("show")});var n=20,s=300,o=0;console.log("Recording video",r),$("#emulator").css("backgroundColor","#cc3333");var a=()=>{o++>s?(console.log("Rendering video"),$("#emulator").css("backgroundColor","inherit"),Le(!0),w.pause(),t.render(),fp=!1):(t.addFrame(r,{delay:n,copy:!0}),setTimeout(a,n),fp=!0)};a()})}var pp;async function Gn(){if(!pp){await xr("lib/octokat.js"),await xr("https://www.gstatic.com/firebasejs/8.8.1/firebase-app.js"),await xr("https://www.gstatic.com/firebasejs/8.8.1/firebase-auth.js"),await xr("https://8bitworkshop.com/config.js");var r=El("__github_key");pp=new Qd(Octokat,r,an(),ki()),console.log("loaded github service")}return pp}function ka(){var r=(ht||"").split("/");return r.length!=2?(ve("You are not in a GitHub repository. Choose one from the pulldown, or Import or Publish one."),null):"https://github.com/"+r[0]+"/"+r[1]}async function Ta(r,e){var t,i=Pa(r);if(!i){ve("Could not parse GitHub URL.");return}var n=Bn()[i.repopath];if(!(n&&!confirm("You've already imported "+i.repopath+" -- do you want to replace all local files?"))){Le(!0);var s=yd(i.repopath);Wr(.25);var o=await Gn();return o.import(r).then(a=>(t=a,Wr(.75),o.pull(r,s))).then(a=>{Le(!1),Hn(e,{repo:i.repopath})}).catch(a=>{Le(!1),console.log(a),ve("Could not import "+r+". "+a)})}}async function xv(r){var e=await Gn();e.login().then(()=>{kt("You are signed in to GitHub.")}).catch(t=>{ve("Could not sign in."+t)})}async function Sv(r){var e=await Gn();e.logout().then(()=>{kt("You are logged out of GitHub.")})}function wv(r){var e=$("#importGithubModal"),t=$("#importGithubButton");e.modal("show"),e.off("shown.bs.modal").on("shown.bs.modal",()=>$("#importGithubURL").trigger("focus")),$("#importGithubURL").off("keydown").on("keydown",i=>{i.key==="Enter"&&(i.preventDefault(),t.trigger("click"))}),t.off("click").on("click",()=>{var i=$("#importGithubURL").val()+"";e.modal("hide"),Ta(i,!1)})}function vv(r){if(!(ht&&!confirm("This project ("+ki().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(Pt(ft(ki().mainPath))),e.modal("show"),t.off("click").on("click",async()=>{var i=$("#githubRepoName").val()+"",n=$("#githubRepoDesc").val()+"",s=$("#githubRepoPrivate").val()=="private",o=$("#githubRepoLicense").val()+""Line truncated
|
|
|
|
|
`);for(let o=0;o<s.length;o++){let a=s[o],l=o+1,c=a.match(/(?:function|func|def|proc)\s+(\w+)/i);c&&n.push({id:`${e}:${l}:${c[1]}`,name:c[1],kind:"func",source:i,file:e,line:l});let d=a.match(/(?:var|let|const|global)\s+(\w+)/i);d&&n.push({id:`${e}:${l}:${d[1]}`,name:d[1],kind:"var",source:i,file:e,line:l});let h=a.match(/(?:struct|class|interface|type)\s+(\w+)/i);h&&n.push({id:`${e}:${l}:${h[1]}`,name:h[1],kind:"type",source:i,file:e,line:l});let u=a.match(/^\s*(\w+)\s*:/);u&&!a.trim().startsWith("//")&&n.push({id:`${e}:${l}:${u[1]}`,name:u[1],kind:"label",source:i,file:e,line:l});let f=a.match(/#define\s+(\w+)/i);f&&n.push({id:`${e}:${l}:${f[1]}`,name:f[1],kind:"macro",source:i,file:e,line:l});let p=a.match(/^\s*(\w+)\s*(?:=|equ)\s+/i);p&&n.push({id:`${e}:${l}:${p[1]}`,name:p[1],kind:"equate",source:i,file:e,line:l})}return n}var Xv=()=>null;function _v(r){Xv=r}function Kn(){return Xv()}var $d=class{constructor(){this.id="project";this.kind="project";this.rebuilt=!1;this.index=new io([])}async ready(){await this.index.init(),this.rebuilt||(this.rebuilt=!0,await this.rebuild())}query(e,t){let i=this.index.query(e,t),n=this.fulltextQuery(e,t),s=i.concat(n);return s.sort((o,a)=>a.score-o.score),s.slice(0,t)}fulltextQuery(e,t){if(e.length<2)return[];let i=e.toLowerCase(),n=[],s=Math.max(t,10),o=Kn();return o?(o.iterateFiles((a,l)=>{if(typeof l!="string")return;let c=l.split(`
|
|
|
|
|
`),d=0;for(let h=0;h<c.length;h++){let u=c[h],p=u.toLowerCase().indexOf(i);if(p>=0){let m=u.trim();if(!m)continue;if(n.push({record:{id:`text:${a}:${h+1}`,name:m.length>80?m.slice(0,80)+"\u2026":m,kind:"text",source:"project",file:a,line:h+1},score:200+Math.max(0,100-p*2),ranges:[p,p+e.length]}),++d>=s)break}}}),n):[]}async onFileChanged(e,t){let i=this.extractSymbolsFromFile(e,t,"project");this.index.pushRecords(i)}extractSymbolsFromFile(e,t,i){if(typeof t!="string")return[];let n=this.detectEditorStyle(e);return gp(t,e,n,i)}detectEditorStyle(e){var i;switch((i=e.split(".").pop())==null?void 0:i.toLowerCase()){case"c":case"h":return"text/x-csrc";case"asm":case"a65":case"inc":return"6502";case"v":return"verilog";case"wiz":return"text/x-wiz";case"bas":case"basic":return"basic";case"fb":case"fastbasic":return"fastbasic";case"bac":case"bataribasic":return"bataribasic";case"i":return"inform6";case"d":return"dialog";default:return"text/x-csrc"}}async rebuild(){this.index.clear(),await this.index.init();let e=Kn();if(!e)return;let t=[];e.iterateFiles((i,n)=>{if(typeof n!="string")return;let s=this.detectEditorStyle(i),o=gp(n,i,s,"project");t.push(...o)}),this.index.pushRecords(t)}};var R2=new Set(["h","hh","hpp","inc","asm","a65","s","mac","defs","def","equ","i","m","c","bas","txt"]),C2=20,kd=class{constructor(){this.id="toolchain";this.kind="toolchain";this.fsName=null;this.files=[];this.loaded=new Map;this.readyDone=!1;this.loadIdx=0;this.batchSize=C2}async ready(){if(this.readyDone)return;this.readyDone=!0;let e=Kn();if(!e)return;let t;try{t=e.getToolForFilename?e.getToolForFilename(e.mainPath):""}catch(o){t=""}let i=jl(t,e.platform_id),n=Vl(t,e.platform_id);if(!i||!n.length)return;this.fsName=i;let s=new Set;for(let o of n){let a=await this.listFiles(o);for(let l of a)this.isSearchable(l)&&!s.has(l)&&(s.add(l),this.files.push(l))}this.files.sort()}isValid(){return this.fsName!=null&&this.files.length>0}async listFiles(e){let t=Kn();if(!t||!this.fsName||!t.queryWorker)return[];try{let i={preload_fs:this.fsName,listshared:e,updates:[],buildsteps:[]},n=await t.queryWorker(i),s=n&&n.output;return Array.isArray(s)?s:[]}catch(i){return console.debug("Toolchain list error:",i),[]}}async readFile(e){let t=Kn();if(!t||!this.fsName||!t.queryWorker)return null;try{let i={preload_fs:this.fsName,readshared:e,updates:[],buildsteps:[]},n=await t.queryWorker(i),s=n&&n.output;return s instanceof Uint8Array&&s.length>0?new TextDecoder().decode(s):null}catch(i){return console.debug("Toolchain read error:",i),null}}isSearchable(e){let t=e.split("/").pop()||e,i=t.lastIndexOf(".");return i<0?!0:R2.has(t.substring(i+1).toLowerCase())}async ensureBatch(){let e=Kn();if(!(!e||!e.queryWorker))for(;this.loadIdx<this.files.length;){let t=this.files.slice(this.loadIdx,this.loadIdx+this.batchSize);this.loadIdx+=t.length;let i=await Promise.all(t.map(async n=>{let s=await this.readFile(n);return[n,s]}));for(let[n,s]of i)s!=null&&this.loaded.set(n,s);if(this.loaded.size>0||this.loadIdx>=this.files.length)break}}async query(e,t){return await this.ready(),!this.isValid()||e.length<2?[]:(await this.ensureBatch(),this.textQuery(e,t))}textQuery(e,t){if(e.length<2)return[];let i=e.toLowerCase(),n=[],s=Math.max(t,5);for(let[o,a]of this.loaded){let l=a.split(`
|
|
|
|
|
`),c=0;for(let d=0;d<l.length;d++){let h=l[d],f=h.toLowerCase().indexOf(i);if(f>=0){let p=h.trim();if(!p)continue;if(n.push({record:{id:`toolchain:${o}:${d+1}`,name:p.length>80?p.slice(0,80)+"\u2026":p,kind:"text",source:"toolchain",file:o,line:d+1},score:200+Math.max(0,100-f*2),ranges:[f,f+e.length]}),++c>=s)break}}}return n.sort((o,a)=>a.score-o.score),n.slice(0,t)}invalidate(){this.fsName=null,this.files=[],this.loaded.clear(),this.readyDone=!1,this.loadIdx=0}};var Rv=()=>[];function Cv(r){Rv=r}var A2=/<h([1-3])\b[^>]*>([\s\S]*?)<\/h\1>/gi;function E2(r){return r.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/&#(?:0*39|x27);/gi,"'").replace(/ /g," ").replace(/…/g,"\u2026").replace(/—/g,"\u2014").replace(/–/g,"\u2013").replace(/’|‘/g,"'").replace(/”|“/g,'"').replace(/»/g,"\xBB").replace(/«/g,"\xAB").replace(/&/g,"&")}function bp(r){return E2(r.replace(/<[^>]+>/g," ")).replace(/\s+/g," ").trim()}function Z2(r,e=180){let t=r.trim();if(!t)return;let n=t.slice(0,e).match(/^([\s\S]*?[.!?])(?:\s|$)/);return n?n[1]:t.length<=e?t:t.slice(0,e-1)+"\u2026"}function U2(r){let e=[],t="#help/"+r.id,i=r.title||r.id,n=r.html||"",s=[],o=new RegExp(A2.source,"gi"),a;for(;a=o.exec(n);)s.push({name:bp(a[2]),start:a.index,end:o.lastIndex});let l=(u,f,p)=>{if(!f)return;let m=Z2(p),S=m&&p.startsWith(m)?p.slice(m.length).trim():p;e.push({id:`${r.id}:${u}`,name:f,kind:"doc",brief:m,detail:S||void 0,source:"docs",file:i,url:t})},c=s.length?s[0].start:n.length,d=bp(n.slice(0,c)),h=s.length&&s[0].start===0?s[0].name||r.title:r.title||r.id;l(0,h,d);for(let u=0;u<s.length;u++){if(u===0&&s[0].start===0)continue;let f=u+1<s.length?s[u+1].start:n.length;l(u+1,s[u].name,bp(n.slice(s[u].end,f)))}return e}var Td=class{constructor(){this.id="docs";this.kind="docs";this.index=null;this.readyPromise=null}async ready(){return this.readyPromise?this.readyPromise:(this.readyPromise=this.load(),this.readyPromise)}async load(){let e=Rv()||[];if(e.length===0)return;let t=[];for(let n of e)t.push(...U2(n));if(t.length===0)return;let i=new io(t);await i.init(),this.index=i}async query(e,t){return await this.ready(),this.index?this.index.query(e,t):[]}};var z2=50,xp=class r{constructor(){this.sources=new Map;this.projectSource=new $d,this.toolchainSource=new kd,this.docsSource=new Td,this.sources.set("project",this.projectSource),this.sources.set("toolchain",this.toolchainSource),this.sources.set("docs",this.docsSource)}static getInstance(){return r.instance||(r.instance=new r),r.instance}parseQuery(e){return e.startsWith("#")?{needle:e.slice(1).trim(),filter:"symbols"}:e.startsWith(">")?{needle:e.slice(1).trim(),filter:"files"}:e.startsWith("?")?{needle:e.slice(1).trim(),filter:"docs"}:{needle:e,filter:"all"}}async query(e,t=z2){let{needle:i,filter:n}=this.parseQuery(e);if(!i)return[];let s=[],o=[];n==="docs"?o.push(this.docsSource):n==="files"?o.push(this.projectSource):n==="symbols"?(o.push(this.projectSource),o.push(this.toolchainSource)):(o.push(this.projectSource),o.push(this.toolchainSource),o.push(this.docsSource));for(let d of o)try{await d.ready();let h=await d.query(i,t-s.length);s.push(...h)}catch(h){console.debug("Search source error:",h)}s.sort((d,h)=>h.score-d.score);let a={project:1.3,toolchain:1,docs:.7};for(let d of s){let h=a[d.record.source]||1;d.score*=h}s.sort((d,h)=>h.score-d.score);let l=new Set;return s.filter(d=>l.has(d.record.id)?!1:(l.add(d.record.id),!0)).slice(0,t)}},Av=xp.getInstance();var vp=class r{constructor(e,t,i,n,s,o,a,l,c,d=0,h){this.p=e,this.stack=t,this.state=i,this.reducePos=n,this.pos=s,this.score=o,this.buffer=a,this.bufferBase=l,this.curContext=c,this.lookAhead=d,this.parent=h}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,i=0){let n=e.parser.context;return new r(e,[],t,i,i,0,[],0,n?new Xd(n,n.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let i=e>>19,n=e&65535,{parser:s}=this.p,o=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=s.dynamicPrecedence(n);if(a&&(this.score+=a),i==0){n<s.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(s.getGoto(this.state,n,!0),this.reducePos),n<s.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(n,this.reducePos);return}let l=this.stack.length-(i-1)*3-(e&262144?6:0),c=l?this.stack[l-2]:this.p.ranges[0].from;n<s.minRepeatTerm&&c==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let d=this.reducePos-c;d>=2e3&&!(!((t=this.p.parser.nodeSet.types[n])===null||t===void 0)&&t.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=d):this.p.lastBigReductionSize<d&&(this.p.bigReductionCount=1,this.p.lastBigReductionStar
Line truncated
|
|
|
|
|
`:i=="r"?"\r":i=="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 Ap(this):new Cp(this)}getCursor(e,t=0,i){let n=e.doc?e:Qe.create({doc:e});return i==null&&(i=n.doc.length),this.regexp?ao(this,n,t,i):oo(this,n,t,i)}},zd=class{constructor(e){this.spec=e}};function bC(r,e,t){return(i,n,s,o)=>{if(t&&!t(i,n,s,o))return!1;let a=i>=o&&n<=o+s.length?s.slice(i-o,n-o):e.doc.sliceString(i,n);return r(a,e,i,n)}}function oo(r,e,t,i){let n;return r.wholeWord&&(n=xC(e.doc,e.charCategorizer(e.selection.main.head))),r.test&&(n=bC(r.test,e,n)),new dn(e.doc,r.unquoted,t,i,r.caseSensitive?void 0:s=>s.toLowerCase(),n)}function xC(r,e){return(t,i,n,s)=>((s>t||s+n.length<i)&&(s=Math.max(0,t-2),n=r.sliceString(s,Math.min(r.length,i+2))),(e(Md(n,t-s))!=ze.Word||e(Ld(n,t-s))!=ze.Word)&&(e(Ld(n,i-s))!=ze.Word||e(Md(n,i-s))!=ze.Word))}var Cp=class extends zd{constructor(e){super(e)}nextMatch(e,t,i){let n=oo(this.spec,e,i,e.doc.length).nextOverlapping();if(n.done){let s=Math.min(e.doc.length,t+this.spec.unquoted.length);n=oo(this.spec,e,0,s).nextOverlapping()}return n.done||n.value.from==t&&n.value.to==i?null:n.value}prevMatchInRange(e,t,i){for(let n=i;;){let s=Math.max(t,n-1e4-this.spec.unquoted.length),o=oo(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,i){let n=this.prevMatchInRange(e,0,t);return n||(n=this.prevMatchInRange(e,Math.max(0,i-this.spec.unquoted.length),e.doc.length)),n&&(n.from!=t||n.to!=i)?n:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let i=oo(this.spec,e,0,e.doc.length),n=[];for(;!i.next().done;){if(n.length>=t)return null;n.push(i.value)}return n}highlight(e,t,i,n){let s=oo(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)n(s.value.from,s.value.to)}};function SC(r,e,t){return(i,n,s)=>(!t||t(i,n,s))&&r(s[0],e,i,n)}function ao(r,e,t,i){let n;return r.wholeWord&&(n=wC(e.charCategorizer(e.selection.main.head))),r.test&&(n=SC(r.test,e,n)),new Cd(e.doc,r.search,{ignoreCase:!r.caseSensitive,test:n},t,i)}function Md(r,e){return r.slice(st(r,e,!1),e)}function Ld(r,e){return r.slice(e,st(r,e))}function wC(r){return(e,t,i)=>!i[0].length||(r(Md(i.input,i.index))!=ze.Word||r(Ld(i.input,i.index))!=ze.Word)&&(r(Ld(i.input,i.index+i[0].length))!=ze.Word||r(Md(i.input,i.index+i[0].length))!=ze.Word)}var Ap=class extends zd{nextMatch(e,t,i){let n=ao(this.spec,e,i,e.doc.length).next();return n.done&&(n=ao(this.spec,e,0,t).next()),n.done?null:n.value}prevMatchInRange(e,t,i){for(let n=1;;n++){let s=Math.max(t,i-n*1e4),o=ao(this.spec,e,s,i),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,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,i)=>{if(i=="&")return e.match[0];if(i=="$")return"$";for(let n=i.length;n>0;n--){let s=+i.slice(0,n);if(s>0&&s<e.match.length)return e.match[s]+i.slice(n)}return t})}matchAll(e,t){let i=ao(this.spec,e,0,e.doc.length),n=[];for(;!i.next().done;){if(n.length>=t)return null;n.push(i.value)}return n}highlight(e,t,i,n){let s=ao(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!s.next().done;)n(s.value.from,s.value.to)}},Ca=ce.define(),Yp=ce.define(),cn=ke.define({create(r){return new Ra(Ep(r).create(),null)},update(r,e){for(let t of e.effects)t.is(Ca)?r=new Ra(t.value.create(),r.panel):t.is(Yp)&&(r=new Ra(r.query,t.value?Wp:null));return r},provide:r=>la.from(r,e=>e.panel)});var Ra=class{constructor(e,t){this.query=e,this.panel=t}},vC=F.mark({class:"cm-searchMatch"}),yC=F.mark({class:"cm-searchMatch cm-searchMatch-selected"}),QC=We.fromClass(class{constructor(r){this.view=r,this.decorations=this.highlight(r.state.field(cn))}update(r){let e=r.state.field(cn);(e!=r.startState.field(cn)||r.docChanged||r.selectionSet||r.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:r,panel:e}){if(!e||!r.spec.valid)return F.none;let{view:t}=this,i=new Vr;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;r.highlight(t.state,a,l,(c,d)=>{let h=t.state.selection.ranges.some(u=>u.from==c&&u.to==d);i.add(c,d,h?yC:vC)})}return i.finish()}},{decorations:r=>r.decorations});function Aa(r){return e=>{let t=e.state.field(cn,!1);return t&&t.query.spec.valid?r(e,t):Vd(e)}}var lo=Aa((r,{query:e})=>{let{to:t}=r.state.selection.main,i=e.nextMatch(r.state,t,t);if(!i)return!1;let n=E.single(i.from,i.to),s=r.state.facet(Jn);return r.dispatch({selection:n,effects:[Vp(r,i),s.scrollToMatch(n.main,r)],userEvent:"select.search"}),Hv(r),!0}),Yd=Aa((r,{query:e})=>{let{state:t}=r,{from:i}=t.selection.main,n=e.prevMatch(t,i,i);if(!n)
Line truncated
|
|
|
|
|
`+t.scrub(),s=this.advance(n);return s>-1&&s<n.length?this.complete(e,i,s):!1}finish(e,t){return(this.stage==2||this.stage==3)&&Za(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,i){return e.addLeafElement(t,_e(B.LinkReference,this.start,this.start+i,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(Iy(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(_e(B.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(jy(e,Za(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=Za(e,this.pos),i=0;if(t>this.pos){let n=Dy(e,t,this.start);if(n){let s=fm(e,n.to-this.start);s>0&&(this.nextStage(n),i=s)}}return i||(i=fm(e,this.pos)),i>0&&i<e.length?i:-1}else return fm(e,this.pos)}}};function fm(r,e){for(;e<r.length;e++){let t=r.charCodeAt(e);if(t==10)break;if(!Rr(t))return-1}return e}var Sm=class{nextLine(e,t,i){let n=t.depth<e.stack.length?-1:Ey(t),s=t.next;if(n<0)return!1;let o=_e(B.HeaderMark,e.lineStart+t.pos,e.lineStart+n);return e.nextLine(),e.addLeafElement(i,_e(s==61?B.SetextHeading1:B.SetextHeading2,i.start,e.prevLineEnd(),[...e.parser.parseInline(i.content,i.start),o])),!0}finish(){return!1}},My={LinkReference(r,e){return e.content.charCodeAt(0)==91?new xm(e):null},SetextHeading(){return new Sm}},EA=[(r,e)=>Ay(e)>=0,(r,e)=>_y(e)>=0,(r,e)=>Ry(e)>=0,(r,e)=>km(e,r,!0)>=0,(r,e)=>Tm(e,r,!0)>=0,(r,e)=>$m(e,r,!0)>=0,(r,e)=>zy(e,r,!0)>=0],ZA={text:"",end:0},wm=class{constructor(e,t,i,n){this.parser=e,this.input=t,this.ranges=n,this.line=new mm,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=Id.create(B.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=i.length?new Qm(i,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 i=0;;){let n=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;i<e.markers.length&&(!n||e.markers[i].from<n.end);){let s=e.markers[i++];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 i of this.parser.blockParsers)if(i){let n=i(this,e);if(n!=!1){if(n==!0)return null;e.forward();continue e}}break}if(e.pos==e.text.length)return this.nextLine()?null:this.finish();let t=new pm(this.lineStart+e.pos,e.text.slice(e.pos));for(let i of this.parser.leafBlockParsers)if(i){let n=i(this,t);n&&t.parsers.push(n)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let i of this.parser.endLeafBlock)if(i(this,e,t))break e}for(let i of t.parsers)if(i.nextLine(this,e,t))return null;t.content+=`
|
|
|
|
|
`+e.scrub();for(let i of e.markers)t.marks.push(i)}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=qy(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=ZA;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 i=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-i)+o,i=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:i}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=i,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 "+B[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),i;if(this.input.lineChunks)i=t==`
|
|
|
|
|
Connect your audio output to the SuperCharger input, turn up the volume, and play the audio file.`,kt(e)}})})}function Q2(r){var e=Pt(lt());let t=e+".tap",i=new Nn(e),n=new Pd({sine_wave:!0}),s=Wt(),o=s[0]+s[1]*256;s=s.slice(2),i.setContent({data:s,startAddress:o,type:Nn.FILE_TYPE_NON_RELOCATABLE}),i.generateSound(n);let a=n.getTAPData();if(a){let l=new Blob([a],{type:"application/octet-stream"});(0,fi.saveAs)(l,t)}}function Op(){switch($t(le)){case"vcs":return y2;case"apple2":return v2;case"c64":return Q2}}function cv(r){if(Wt()==null)return ve("Please fix errors before exporting."),!0;var e=Op();if(e===void 0)return ve("Cassette export is not supported on this platform."),!0;e(r)}function dv(r){if(Wt()==null)return ve("Please finish compiling with no errors before downloading ROM."),!0;var e=Pt(lt());if(w.getDownloadFile){var t=w.getDownloadFile(),e=Pt(lt());(0,fi.saveAs)(t.blob,e+t.extension)}else if(Wt()instanceof Uint8Array){var i=new Blob([Wt()],{type:"application/octet-stream"}),n=w.getROMExtension&&w.getROMExtension(Wt())||"-"+$t(le)+".bin";(0,fi.saveAs)(i,e+n)}else ve(`The "${le}" platform doesn't have downloadable ROMs.`)}function hv(r){var e=W.getCurrentText();if(!e)return!1;var t=new Blob([e],{type:"text/plain;charset=utf-8"});(0,fi.saveAs)(t,gv(),{autoBom:!1})}async function uv(){let r=(await import("./jszip.min-EENSZHRN.js")).default;return new r}async function fv(r){var e=await uv();ki().iterateFiles((t,i)=>{i&&e.file(ft(t),i)}),e.generateAsync({type:"blob"}).then(t=>{(0,fi.saveAs)(t,lt()+"-"+$t(le)+".zip")})}function Ov(r){let e=w.getDebugSymbolFile&&w.getDebugSymbolFile();if(!e){ve("This project does not have debug information.");return}var t=Pt(lt());(0,fi.saveAs)(e.blob,t+e.extension,{autoBom:!1})}async function pv(r){var e=await uv(),t=await an().keys();Le(!0);try{var i=0;await Promise.all(t.map(s=>an().getItem(s).then(o=>{Wr(i++/(t.length+1)),o&&e.file(s,o)})));var n=await e.generateAsync({type:"blob"});(0,fi.saveAs)(n,$t(le)+"-all.zip")}finally{Le(!1)}}var fp=!1;function mv(){fp||xr("lib/gif.js").then(()=>{var r=$("#emulator").find("canvas")[0];if(!r){ve("Could not find canvas element to record video!");return}var e=0;r.style&&r.style.transform&&(r.style.transform.indexOf("rotate(-90deg)")>=0?e=-1:r.style.transform.indexOf("rotate(90deg)")>=0&&(e=1));var t=new GIF({workerScript:"lib/gif.worker.js",workers:4,quality:10,rotate:e}),i=$("#videoPreviewImage");t.on("progress",l=>{Wr(l)}),t.on("finished",l=>{i.attr("src",URL.createObjectURL(l)),Le(!1),w.resume(),$("#videoPreviewModal").modal("show")});var n=20,s=300,o=0;console.log("Recording video",r),$("#emulator").css("backgroundColor","#cc3333");var a=()=>{o++>s?(console.log("Rendering video"),$("#emulator").css("backgroundColor","inherit"),Le(!0),w.pause(),t.render(),fp=!1):(t.addFrame(r,{delay:n,copy:!0}),setTimeout(a,n),fp=!0)};a()})}var pp;async function Gn(){if(!pp){await xr("lib/octokat.js"),await xr("https://www.gstatic.com/firebasejs/8.8.1/firebase-app.js"),await xr("https://www.gstatic.com/firebasejs/8.8.1/firebase-auth.js"),await xr("https://8bitworkshop.com/config.js");var r=El("__github_key");pp=new Qd(Octokat,r,an(),ki()),console.log("loaded github service")}return pp}function ka(){var r=(ht||"").split("/");return r.length!=2?(ve("You are not in a GitHub repository. Choose one from the pulldown, or Import or Publish one."),null):"https://github.com/"+r[0]+"/"+r[1]}async function Ta(r,e){var t,i=Pa(r);if(!i){ve("Could not parse GitHub URL.");return}var n=Bn()[i.repopath];if(!(n&&!confirm("You've already imported "+i.repopath+" -- do you want to replace all local files?"))){Le(!0);var s=yd(i.repopath);Wr(.25);var o=await Gn();return o.import(r).then(a=>(t=a,Wr(.75),o.pull(r,s))).then(a=>{Le(!1),Hn(e,{repo:i.repopath})}).catch(a=>{Le(!1),console.log(a),ve("Could not import "+r+". "+a)})}}async function bv(r){var e=await Gn();e.login().then(()=>{kt("You are signed in to GitHub.")}).catch(t=>{ve("Could not sign in."+t)})}async function xv(r){var e=await Gn();e.logout().then(()=>{kt("You are logged out of GitHub.")})}function Sv(r){var e=$("#importGithubModal"),t=$("#importGithubButton");e.modal("show"),e.off("shown.bs.modal").on("shown.bs.modal",()=>$("#importGithubURL").trigger("focus")),$("#importGithubURL").off("keydown").on("keydown",i=>{i.key==="Enter"&&(i.preventDefault(),t.trigger("click"))}),t.off("click").on("click",()=>{var i=$("#importGithubURL").val()+"";e.modal("hide"),Ta(i,!1)})}function wv(r){if(!(ht&&!confirm("This project ("+ki().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(Pt(ft(ki().mainPath))),e.modal("show"),t.off("click").on("click",async()=>{var i=$("#githubRepoName").val()+"",n=$("#githubRepoDesc").val()+"",s=$("#githubRepoPrivate").val()=="private",o=$("#githubRepoLicense").val()+""Line truncated
|
|
|
|
|
`);for(let o=0;o<s.length;o++){let a=s[o],l=o+1,c=a.match(/(?:function|func|def|proc)\s+(\w+)/i);c&&n.push({id:`${e}:${l}:${c[1]}`,name:c[1],kind:"func",source:i,file:e,line:l});let d=a.match(/(?:var|let|const|global)\s+(\w+)/i);d&&n.push({id:`${e}:${l}:${d[1]}`,name:d[1],kind:"var",source:i,file:e,line:l});let h=a.match(/(?:struct|class|interface|type)\s+(\w+)/i);h&&n.push({id:`${e}:${l}:${h[1]}`,name:h[1],kind:"type",source:i,file:e,line:l});let u=a.match(/^\s*(\w+)\s*:/);u&&!a.trim().startsWith("//")&&n.push({id:`${e}:${l}:${u[1]}`,name:u[1],kind:"label",source:i,file:e,line:l});let f=a.match(/#define\s+(\w+)/i);f&&n.push({id:`${e}:${l}:${f[1]}`,name:f[1],kind:"macro",source:i,file:e,line:l});let p=a.match(/^\s*(\w+)\s*(?:=|equ)\s+/i);p&&n.push({id:`${e}:${l}:${p[1]}`,name:p[1],kind:"equate",source:i,file:e,line:l})}return n}var Tv=()=>null;function Xv(r){Tv=r}function Kn(){return Tv()}var $d=class{constructor(){this.id="project";this.kind="project";this.rebuilt=!1;this.index=new io([])}async ready(){await this.index.init(),this.rebuilt||(this.rebuilt=!0,await this.rebuild())}query(e,t){let i=this.index.query(e,t),n=this.fulltextQuery(e,t),s=i.concat(n);return s.sort((o,a)=>a.score-o.score),s.slice(0,t)}fulltextQuery(e,t){if(e.length<2)return[];let i=e.toLowerCase(),n=[],s=Math.max(t,10),o=Kn();return o?(o.iterateFiles((a,l)=>{if(typeof l!="string")return;let c=l.split(`
|
|
|
|
|
`),d=0;for(let h=0;h<c.length;h++){let u=c[h],p=u.toLowerCase().indexOf(i);if(p>=0){let m=u.trim();if(!m)continue;if(n.push({record:{id:`text:${a}:${h+1}`,name:m.length>80?m.slice(0,80)+"\u2026":m,kind:"text",source:"project",file:a,line:h+1},score:200+Math.max(0,100-p*2),ranges:[p,p+e.length]}),++d>=s)break}}}),n):[]}async onFileChanged(e,t){let i=this.extractSymbolsFromFile(e,t,"project");this.index.pushRecords(i)}extractSymbolsFromFile(e,t,i){if(typeof t!="string")return[];let n=this.detectEditorStyle(e);return gp(t,e,n,i)}detectEditorStyle(e){var i;switch((i=e.split(".").pop())==null?void 0:i.toLowerCase()){case"c":case"h":return"text/x-csrc";case"asm":case"a65":case"inc":return"6502";case"v":return"verilog";case"wiz":return"text/x-wiz";case"bas":case"basic":return"basic";case"fb":case"fastbasic":return"fastbasic";case"bac":case"bataribasic":return"bataribasic";case"i":return"inform6";case"d":return"dialog";default:return"text/x-csrc"}}async rebuild(){this.index.clear(),await this.index.init();let e=Kn();if(!e)return;let t=[];e.iterateFiles((i,n)=>{if(typeof n!="string")return;let s=this.detectEditorStyle(i),o=gp(n,i,s,"project");t.push(...o)}),this.index.pushRecords(t)}};var X2=new Set(["h","hh","hpp","inc","asm","a65","s","mac","defs","def","equ","i","m","c","bas","txt"]),_2=20,kd=class{constructor(){this.id="toolchain";this.kind="toolchain";this.fsName=null;this.files=[];this.loaded=new Map;this.readyDone=!1;this.loadIdx=0;this.batchSize=_2}async ready(){if(this.readyDone)return;this.readyDone=!0;let e=Kn();if(!e)return;let t;try{t=e.getToolForFilename?e.getToolForFilename(e.mainPath):""}catch(o){t=""}let i=jl(t,e.platform_id),n=Vl(t,e.platform_id);if(!i||!n.length)return;this.fsName=i;let s=new Set;for(let o of n){let a=await this.listFiles(o);for(let l of a)this.isSearchable(l)&&!s.has(l)&&(s.add(l),this.files.push(l))}this.files.sort()}isValid(){return this.fsName!=null&&this.files.length>0}async listFiles(e){let t=Kn();if(!t||!this.fsName||!t.queryWorker)return[];try{let i={preload_fs:this.fsName,listshared:e,updates:[],buildsteps:[]},n=await t.queryWorker(i),s=n&&n.output;return Array.isArray(s)?s:[]}catch(i){return console.debug("Toolchain list error:",i),[]}}async readFile(e){let t=Kn();if(!t||!this.fsName||!t.queryWorker)return null;try{let i={preload_fs:this.fsName,readshared:e,updates:[],buildsteps:[]},n=await t.queryWorker(i),s=n&&n.output;return s instanceof Uint8Array&&s.length>0?new TextDecoder().decode(s):null}catch(i){return console.debug("Toolchain read error:",i),null}}isSearchable(e){let t=e.split("/").pop()||e,i=t.lastIndexOf(".");return i<0?!0:X2.has(t.substring(i+1).toLowerCase())}async ensureBatch(){let e=Kn();if(!(!e||!e.queryWorker))for(;this.loadIdx<this.files.length;){let t=this.files.slice(this.loadIdx,this.loadIdx+this.batchSize);this.loadIdx+=t.length;let i=await Promise.all(t.map(async n=>{let s=await this.readFile(n);return[n,s]}));for(let[n,s]of i)s!=null&&this.loaded.set(n,s);if(this.loaded.size>0||this.loadIdx>=this.files.length)break}}async query(e,t){return await this.ready(),!this.isValid()||e.length<2?[]:(await this.ensureBatch(),this.textQuery(e,t))}textQuery(e,t){if(e.length<2)return[];let i=e.toLowerCase(),n=[],s=Math.max(t,5);for(let[o,a]of this.loaded){let l=a.split(`
|
|
|
|
|
`),c=0;for(let d=0;d<l.length;d++){let h=l[d],f=h.toLowerCase().indexOf(i);if(f>=0){let p=h.trim();if(!p)continue;if(n.push({record:{id:`toolchain:${o}:${d+1}`,name:p.length>80?p.slice(0,80)+"\u2026":p,kind:"text",source:"toolchain",file:o,line:d+1},score:200+Math.max(0,100-f*2),ranges:[f,f+e.length]}),++c>=s)break}}}return n.sort((o,a)=>a.score-o.score),n.slice(0,t)}invalidate(){this.fsName=null,this.files=[],this.loaded.clear(),this.readyDone=!1,this.loadIdx=0}};var _v=()=>[];function Rv(r){_v=r}var R2=/<h([1-3])\b[^>]*>([\s\S]*?)<\/h\1>/gi;function C2(r){return r.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/&#(?:0*39|x27);/gi,"'").replace(/ /g," ").replace(/…/g,"\u2026").replace(/—/g,"\u2014").replace(/–/g,"\u2013").replace(/’|‘/g,"'").replace(/”|“/g,'"').replace(/»/g,"\xBB").replace(/«/g,"\xAB").replace(/&/g,"&")}function bp(r){return C2(r.replace(/<[^>]+>/g," ")).replace(/\s+/g," ").trim()}function A2(r,e=180){let t=r.trim();if(!t)return;let n=t.slice(0,e).match(/^([\s\S]*?[.!?])(?:\s|$)/);return n?n[1]:t.length<=e?t:t.slice(0,e-1)+"\u2026"}function E2(r){let e=[],t="#help/"+r.id,i=r.title||r.id,n=r.html||"",s=[],o=new RegExp(R2.source,"gi"),a;for(;a=o.exec(n);)s.push({name:bp(a[2]),start:a.index,end:o.lastIndex});let l=(u,f,p)=>{if(!f)return;let m=A2(p),S=m&&p.startsWith(m)?p.slice(m.length).trim():p;e.push({id:`${r.id}:${u}`,name:f,kind:"doc",brief:m,detail:S||void 0,source:"docs",file:i,url:t})},c=s.length?s[0].start:n.length,d=bp(n.slice(0,c)),h=s.length&&s[0].start===0?s[0].name||r.title:r.title||r.id;l(0,h,d);for(let u=0;u<s.length;u++){if(u===0&&s[0].start===0)continue;let f=u+1<s.length?s[u+1].start:n.length;l(u+1,s[u].name,bp(n.slice(s[u].end,f)))}return e}var Td=class{constructor(){this.id="docs";this.kind="docs";this.index=null;this.readyPromise=null}async ready(){return this.readyPromise?this.readyPromise:(this.readyPromise=this.load(),this.readyPromise)}async load(){let e=_v()||[];if(e.length===0)return;let t=[];for(let n of e)t.push(...E2(n));if(t.length===0)return;let i=new io(t);await i.init(),this.index=i}async query(e,t){return await this.ready(),this.index?this.index.query(e,t):[]}};var Z2=50,xp=class r{constructor(){this.sources=new Map;this.projectSource=new $d,this.toolchainSource=new kd,this.docsSource=new Td,this.sources.set("project",this.projectSource),this.sources.set("toolchain",this.toolchainSource),this.sources.set("docs",this.docsSource)}static getInstance(){return r.instance||(r.instance=new r),r.instance}parseQuery(e){return e.startsWith("#")?{needle:e.slice(1).trim(),filter:"symbols"}:e.startsWith(">")?{needle:e.slice(1).trim(),filter:"files"}:e.startsWith("?")?{needle:e.slice(1).trim(),filter:"docs"}:{needle:e,filter:"all"}}async query(e,t=Z2){let{needle:i,filter:n}=this.parseQuery(e);if(!i)return[];let s=[],o=[];n==="docs"?o.push(this.docsSource):n==="files"?o.push(this.projectSource):n==="symbols"?(o.push(this.projectSource),o.push(this.toolchainSource)):(o.push(this.projectSource),o.push(this.toolchainSource),o.push(this.docsSource));for(let d of o)try{await d.ready();let h=await d.query(i,t-s.length);s.push(...h)}catch(h){console.debug("Search source error:",h)}s.sort((d,h)=>h.score-d.score);let a={project:1.3,toolchain:1,docs:.7};for(let d of s){let h=a[d.record.source]||1;d.score*=h}s.sort((d,h)=>h.score-d.score);let l=new Set;return s.filter(d=>l.has(d.record.id)?!1:(l.add(d.record.id),!0)).slice(0,t)}},Cv=xp.getInstance();var vp=class r{constructor(e,t,i,n,s,o,a,l,c,d=0,h){this.p=e,this.stack=t,this.state=i,this.reducePos=n,this.pos=s,this.score=o,this.buffer=a,this.bufferBase=l,this.curContext=c,this.lookAhead=d,this.parent=h}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,i=0){let n=e.parser.context;return new r(e,[],t,i,i,0,[],0,n?new Xd(n,n.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let i=e>>19,n=e&65535,{parser:s}=this.p,o=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=s.dynamicPrecedence(n);if(a&&(this.score+=a),i==0){n<s.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(s.getGoto(this.state,n,!0),this.reducePos),n<s.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(n,this.reducePos);return}let l=this.stack.length-(i-1)*3-(e&262144?6:0),c=l?this.stack[l-2]:this.p.ranges[0].from;n<s.minRepeatTerm&&c==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let d=this.reducePos-c;d>=2e3&&!(!((t=this.p.parser.nodeSet.types[n])===null||t===void 0)&&t.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=d):this.p.lastBigReductionSize<d&&(this.p.bigReductionCount=1,this.p.lastBigReductionStar
Line truncated
|
|
|
|
|
`:i=="r"?"\r":i=="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 Ap(this):new Cp(this)}getCursor(e,t=0,i){let n=e.doc?e:Qe.create({doc:e});return i==null&&(i=n.doc.length),this.regexp?ao(this,n,t,i):oo(this,n,t,i)}},zd=class{constructor(e){this.spec=e}};function mC(r,e,t){return(i,n,s,o)=>{if(t&&!t(i,n,s,o))return!1;let a=i>=o&&n<=o+s.length?s.slice(i-o,n-o):e.doc.sliceString(i,n);return r(a,e,i,n)}}function oo(r,e,t,i){let n;return r.wholeWord&&(n=gC(e.doc,e.charCategorizer(e.selection.main.head))),r.test&&(n=mC(r.test,e,n)),new dn(e.doc,r.unquoted,t,i,r.caseSensitive?void 0:s=>s.toLowerCase(),n)}function gC(r,e){return(t,i,n,s)=>((s>t||s+n.length<i)&&(s=Math.max(0,t-2),n=r.sliceString(s,Math.min(r.length,i+2))),(e(Md(n,t-s))!=ze.Word||e(Ld(n,t-s))!=ze.Word)&&(e(Ld(n,i-s))!=ze.Word||e(Md(n,i-s))!=ze.Word))}var Cp=class extends zd{constructor(e){super(e)}nextMatch(e,t,i){let n=oo(this.spec,e,i,e.doc.length).nextOverlapping();if(n.done){let s=Math.min(e.doc.length,t+this.spec.unquoted.length);n=oo(this.spec,e,0,s).nextOverlapping()}return n.done||n.value.from==t&&n.value.to==i?null:n.value}prevMatchInRange(e,t,i){for(let n=i;;){let s=Math.max(t,n-1e4-this.spec.unquoted.length),o=oo(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,i){let n=this.prevMatchInRange(e,0,t);return n||(n=this.prevMatchInRange(e,Math.max(0,i-this.spec.unquoted.length),e.doc.length)),n&&(n.from!=t||n.to!=i)?n:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let i=oo(this.spec,e,0,e.doc.length),n=[];for(;!i.next().done;){if(n.length>=t)return null;n.push(i.value)}return n}highlight(e,t,i,n){let s=oo(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)n(s.value.from,s.value.to)}};function bC(r,e,t){return(i,n,s)=>(!t||t(i,n,s))&&r(s[0],e,i,n)}function ao(r,e,t,i){let n;return r.wholeWord&&(n=xC(e.charCategorizer(e.selection.main.head))),r.test&&(n=bC(r.test,e,n)),new Cd(e.doc,r.search,{ignoreCase:!r.caseSensitive,test:n},t,i)}function Md(r,e){return r.slice(st(r,e,!1),e)}function Ld(r,e){return r.slice(e,st(r,e))}function xC(r){return(e,t,i)=>!i[0].length||(r(Md(i.input,i.index))!=ze.Word||r(Ld(i.input,i.index))!=ze.Word)&&(r(Ld(i.input,i.index+i[0].length))!=ze.Word||r(Md(i.input,i.index+i[0].length))!=ze.Word)}var Ap=class extends zd{nextMatch(e,t,i){let n=ao(this.spec,e,i,e.doc.length).next();return n.done&&(n=ao(this.spec,e,0,t).next()),n.done?null:n.value}prevMatchInRange(e,t,i){for(let n=1;;n++){let s=Math.max(t,i-n*1e4),o=ao(this.spec,e,s,i),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,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,i)=>{if(i=="&")return e.match[0];if(i=="$")return"$";for(let n=i.length;n>0;n--){let s=+i.slice(0,n);if(s>0&&s<e.match.length)return e.match[s]+i.slice(n)}return t})}matchAll(e,t){let i=ao(this.spec,e,0,e.doc.length),n=[];for(;!i.next().done;){if(n.length>=t)return null;n.push(i.value)}return n}highlight(e,t,i,n){let s=ao(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!s.next().done;)n(s.value.from,s.value.to)}},Ca=ce.define(),Yp=ce.define(),cn=ke.define({create(r){return new Ra(Ep(r).create(),null)},update(r,e){for(let t of e.effects)t.is(Ca)?r=new Ra(t.value.create(),r.panel):t.is(Yp)&&(r=new Ra(r.query,t.value?Wp:null));return r},provide:r=>la.from(r,e=>e.panel)});var Ra=class{constructor(e,t){this.query=e,this.panel=t}},SC=F.mark({class:"cm-searchMatch"}),wC=F.mark({class:"cm-searchMatch cm-searchMatch-selected"}),vC=We.fromClass(class{constructor(r){this.view=r,this.decorations=this.highlight(r.state.field(cn))}update(r){let e=r.state.field(cn);(e!=r.startState.field(cn)||r.docChanged||r.selectionSet||r.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:r,panel:e}){if(!e||!r.spec.valid)return F.none;let{view:t}=this,i=new Vr;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;r.highlight(t.state,a,l,(c,d)=>{let h=t.state.selection.ranges.some(u=>u.from==c&&u.to==d);i.add(c,d,h?wC:SC)})}return i.finish()}},{decorations:r=>r.decorations});function Aa(r){return e=>{let t=e.state.field(cn,!1);return t&&t.query.spec.valid?r(e,t):Vd(e)}}var lo=Aa((r,{query:e})=>{let{to:t}=r.state.selection.main,i=e.nextMatch(r.state,t,t);if(!i)return!1;let n=E.single(i.from,i.to),s=r.state.facet(Jn);return r.dispatch({selection:n,effects:[Vp(r,i),s.scrollToMatch(n.main,r)],userEvent:"select.search"}),Gv(r),!0}),Yd=Aa((r,{query:e})=>{let{state:t}=r,{from:i}=t.selection.main,n=e.prevMatch(t,i,i);if(!n)
Line truncated
|
|
|
|
|
`+t.scrub(),s=this.advance(n);return s>-1&&s<n.length?this.complete(e,i,s):!1}finish(e,t){return(this.stage==2||this.stage==3)&&Za(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,i){return e.addLeafElement(t,_e(B.LinkReference,this.start,this.start+i,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(Dy(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(_e(B.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(Vy(e,Za(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=Za(e,this.pos),i=0;if(t>this.pos){let n=jy(e,t,this.start);if(n){let s=fm(e,n.to-this.start);s>0&&(this.nextStage(n),i=s)}}return i||(i=fm(e,this.pos)),i>0&&i<e.length?i:-1}else return fm(e,this.pos)}}};function fm(r,e){for(;e<r.length;e++){let t=r.charCodeAt(e);if(t==10)break;if(!Rr(t))return-1}return e}var Sm=class{nextLine(e,t,i){let n=t.depth<e.stack.length?-1:Ay(t),s=t.next;if(n<0)return!1;let o=_e(B.HeaderMark,e.lineStart+t.pos,e.lineStart+n);return e.nextLine(),e.addLeafElement(i,_e(s==61?B.SetextHeading1:B.SetextHeading2,i.start,e.prevLineEnd(),[...e.parser.parseInline(i.content,i.start),o])),!0}finish(){return!1}},zy={LinkReference(r,e){return e.content.charCodeAt(0)==91?new xm(e):null},SetextHeading(){return new Sm}},CA=[(r,e)=>Cy(e)>=0,(r,e)=>Xy(e)>=0,(r,e)=>_y(e)>=0,(r,e)=>km(e,r,!0)>=0,(r,e)=>Tm(e,r,!0)>=0,(r,e)=>$m(e,r,!0)>=0,(r,e)=>Uy(e,r,!0)>=0],AA={text:"",end:0},wm=class{constructor(e,t,i,n){this.parser=e,this.input=t,this.ranges=n,this.line=new mm,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=Id.create(B.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=i.length?new Qm(i,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 i=0;;){let n=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;i<e.markers.length&&(!n||e.markers[i].from<n.end);){let s=e.markers[i++];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 i of this.parser.blockParsers)if(i){let n=i(this,e);if(n!=!1){if(n==!0)return null;e.forward();continue e}}break}if(e.pos==e.text.length)return this.nextLine()?null:this.finish();let t=new pm(this.lineStart+e.pos,e.text.slice(e.pos));for(let i of this.parser.leafBlockParsers)if(i){let n=i(this,t);n&&t.parsers.push(n)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let i of this.parser.endLeafBlock)if(i(this,e,t))break e}for(let i of t.parsers)if(i.nextLine(this,e,t))return null;t.content+=`
|
|
|
|
|
`+e.scrub();for(let i of e.markers)t.marks.push(i)}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=Iy(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=AA;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 i=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-i)+o,i=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:i}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=i,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 "+B[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),i;if(this.input.lineChunks)i=t==`
|
|
|
|
|
`?"":t;else{let n=t.indexOf(`
|
|
|
|
|
`);i=n<0?t:t.slice(0,n)}return e+i.length>this.to?i.slice(0,this.to-e):i}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,i=0){this.block=Id.create(e,i,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,i=0){this.startContext(this.parser.getNodeType(e),t,i)}addNode(e,t,i){typeof e=="number"&&(e=new Se(this.parser.nodeSet.types[e],co,co,(i!=null?i: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(ym(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?Ly(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let i of e.parsers)if(i.finish(this,e))return;let t=ym(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(B.Paragraph,e.content.length),e.start)}elt(e,t,i,n){return typeof e=="string"?_e(this.parser.getNodeType(e),t,i,n):new Fd(e,t)}get buffer(){return new qd(this.parser.nodeSet)}};function Ly(r,e,t,i,n){let s=r[e].to,o=[],a=[],l=t.from+i;function c(d,h){for(;h?d>=s:d>s;){let u=r[e+1].from-s;i+=u,d+=u,e++,s=r[e].to}}for(let d=t.firstChild;d;d=d.nextSibling){c(d.from+i,!0);let h=d.from+i,u,f=n.get(d.tree);f?u=f:d.to+i>s?(u=Ly(r,e,d,i,n),c(d.to+i,!1)):u=d.toTree(),o.push(u),a.push(h-l)}return c(t.to+i,!1),new Se(t.type,o,a,t.to+i-l,t.tree?t.tree.propValues:void 0)}var za=class r extends Pi{constructor(e,t,i,n,s,o,a,l,c){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=i,this.blockNames=n,this.endLeafBlock=s,this.skipContextMarkup=o,this.inlineParsers=a,this.inlineNames=l,this.wrappers=c,this.nodeTypes=Object.create(null);for(let d of e.types)this.nodeTypes[d.name]=d.id}createParse(e,t,i){let n=new wm(this,e,t,i);for(let s of this.wrappers)n=s(n,e,t,i);return n}configure(e){let t=vm(e);if(!t)return this;let{nodeSet:i,skipContextMarkup:n}=this,s=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),a=this.blockNames.slice(),l=this.inlineParsers.slice(),c=this.inlineNames.slice(),d=this.endLeafBlock.slice(),h=this.wrappers;if(Ea(t.defineNodes)){n=Object.assign({},n);let u=i.types.slice(),f;for(let p of t.defineNodes){let{name:m,block:S,composite:y,style:A}=typeof p=="string"?{name:p}:p;if(u.some(T=>T.name==m))continue;y&&(n[u.length]=(T,P,C)=>y(P,C,T.value));let R=u.length,U=y?["Block","BlockContext"]:S?R>=B.ATXHeading1&&R<=B.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;u.push(rt.define({id:R,name:m,props:U&&[[ue.group,U]]})),A&&(f||(f={}),Array.isArray(A)||A instanceof lr?f[m]=A:Object.assign(f,A))}i=new yi(u),f&&(i=i.extend(St(f)))}if(Ea(t.props)&&(i=i.extend(...t.props)),Ea(t.remove))for(let u of t.remove){let f=this.blockNames.indexOf(u),p=this.inlineNames.indexOf(u);f>-1&&(s[f]=o[f]=void 0),p>-1&&(l[p]=void 0)}if(Ea(t.parseBlock))for(let u of t.parseBlock){let f=a.indexOf(u.name);if(f>-1)s[f]=u.parse,o[f]=u.leaf;else{let p=u.before?Dd(a,u.before):u.after?Dd(a,u.after)+1:a.length-1;s.splice(p,0,u.parse),o.splice(p,0,u.leaf),a.splice(p,0,u.name)}u.endLeaf&&d.push(u.endLeaf)}if(Ea(t.parseInline))for(let u of t.parseInline){let f=c.indexOf(u.name);if(f>-1)l[f]=u.parse;else{let p=u.before?Dd(c,u.before):u.after?Dd(c,u.after)+1:c.length-1;l.splice(p,0,u.parse),c.splice(p,0,u.name)}}return t.wrap&&(h=h.concat(t.wrap)),new r(i,s,o,a,d,n,l,c,h)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw new RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let i=new La(this,e,t);e:for(let n=t;n<i.end;){let s=i.char(n);for(let o of this.inlineParsers)if(o){let a=o(i,s,n);if(a>=0){n=a;continue e}}n++}return i.resolveMarkers(0)}};function Ea(r){return r!=null&&r.length>0}function vm(r){if(!Array.isArray(r))return r;if(r.length==0)return null;let e=vm(r[0]);if(r.length==1)return e;let t=vm(r.slice(1));if(!t||!e)return e||t;let i=(o,a)=>(o||co).concat(a||co),n=e.wrap,s=t.wrap;return{props:i(e.props,t.props),defineNodes:i(e.defineNodes,t.defineNodes),parseBlock:i(e.parseBlock,t.parseBlock),parseInline:i(e.parseInline,t.parseInline),remove:i(e.remove,t.remove),wrap:n?s?(o,a,l,c)=>n(s(o,a,l,c),a,l,c):n:s}}function Dd(r,e){let t=r.indexOf(e);if(t<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return t}var Yy=[rt.none];for(let r=1,e;e=B[r];r++)Yy[r]=rt.define({id:r,name:e,props:r>=B.Escape?[]:[[ue.group,r in Xy?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});var co=[],qd=class{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,i,
Line truncated
|
|
|
|
|
`;)s--;this.fragmentEnd=s?s-1:0}let i=this.cursor;i||(i=this.cursor=this.fragment.tree.cursor(),i.firstChild());let n=e+this.fragment.offset;for(;i.to<=n;)if(!i.parent())return!1;for(;;){if(i.from>=n)return this.fragment.from<=t;if(!i.childAfter(n))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(ue.contextHash)==e}takeNodes(e){let t=this.cursor,i=this.fragment.offset,n=this.fragmentEnd-(this.fragment.openEnd?1:0),s=e.absoluteLineStart,o=s,a=e.block.children.length,l=o,c=a;for(;;){if(t.to-i>n){if(t.type.isAnonymous&&t.firstChild())continue;break}let d=qy(t.from-i,e.ranges);if(t.to-i<=e.ranges[e.rangeI].to)e.addNode(t.tree,d);else{let h=new Se(e.parser.nodeSet.types[B.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(h,t.tree),e.addNode(h,d)}if(t.type.is("Block")&&(zA.indexOf(t.type.id)<0?(o=t.to-i,a=e.block.children.length):(o=l,a=c),l=t.to-i,c=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 qy(r,e){let t=r;for(let i=1;i<e.length;i++){let n=e[i-1].to,s=e[i].from;n<r&&(t-=s-n)}return t}var MA=St({"Blockquote/...":O.quote,HorizontalRule:O.contentSeparator,"ATXHeading1/... SetextHeading1/...":O.heading1,"ATXHeading2/... SetextHeading2/...":O.heading2,"ATXHeading3/...":O.heading3,"ATXHeading4/...":O.heading4,"ATXHeading5/...":O.heading5,"ATXHeading6/...":O.heading6,"Comment CommentBlock":O.comment,Escape:O.escape,Entity:O.character,"Emphasis/...":O.emphasis,"StrongEmphasis/...":O.strong,"Link/... Image/...":O.link,"OrderedList/... BulletList/...":O.list,"BlockQuote/...":O.quote,"InlineCode CodeText":O.monospace,"URL Autolink":O.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":O.processingInstruction,"CodeInfo LinkLabel":O.labelName,LinkTitle:O.string,Paragraph:O.content}),Fy=new za(new yi(Yy).extend(MA),Object.keys(jd).map(r=>jd[r]),Object.keys(jd).map(r=>My[r]),Object.keys(jd),EA,Xy,Object.keys(Om).map(r=>Om[r]),Object.keys(Om),[]);function LA(r,e,t){let i=[];for(let n=r.firstChild,s=e;;n=n.nextSibling){let o=n?n.from:t;if(o>s&&i.push({from:s,to:o}),!n)break;s=n.to}return i}function By(r){let{codeParser:e,htmlParser:t}=r;return{wrap:Bc((n,s)=>{let o=n.type.id;if(e&&(o==B.CodeBlock||o==B.FencedCode)){let a="";if(o==B.FencedCode){let c=n.node.getChild(B.CodeInfo);c&&(a=s.read(c.from,c.to))}let l=e(a);if(l)return{parser:l,overlay:c=>c.type.id==B.CodeText,bracketed:o==B.FencedCode}}else if(t&&(o==B.HTMLBlock||o==B.HTMLTag||o==B.CommentBlock))return{parser:t,overlay:LA(n.node,n.from,n.to)};return null})}}var YA={resolve:"Strikethrough",mark:"StrikethroughMark"},WA={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":O.strikethrough}},{name:"StrikethroughMark",style:O.processingInstruction}],parseInline:[{name:"Strikethrough",parse(r,e,t){if(e!=126||r.char(t+1)!=126||r.char(t+2)==126)return-1;let i=r.slice(t-1,t),n=r.slice(t+2,t+3),s=/\s|^$/.test(i),o=/\s|^$/.test(n),a=Ma.test(i),l=Ma.test(n);return r.addDelimiter(YA,t,t+2,!o&&(!l||s||a),!s&&(!a||o||l))},after:"Emphasis"}]};function Ua(r,e,t=0,i,n=0){let s=0,o=!0,a=-1,l=-1,c=!1,d=()=>{i.push(r.elt("TableCell",n+a,n+l,r.parser.parseInline(e.slice(a,l),n+a)))};for(let h=t;h<e.length;h++){let u=e.charCodeAt(h);u==124&&!c?((!o||a>-1)&&s++,o=!1,i&&(a>-1&&d(),i.push(r.elt("TableDelimiter",h+n,h+n+1))),a=l=-1):(c||u!=32&&u!=9)&&(a<0&&(a=h),l=h+1),c=!c&&u==92}return a>-1&&(s++,i&&d()),s}function vy(r,e){for(let t=e;t<r.length;t++){let i=r.charCodeAt(t);if(i==124)return!0;i==92&&t++}return!1}var Ny=/^[>\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,Nd=class{constructor(){this.rows=null}nextLine(e,t,i){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=[];Ua(e,i.content,0,s,i.start)==Ua(e,n,0)&&(this.rows=[e.elt("TableHeader",i.start,i.start+i.content.length,s),e.elt("TableDelimiter",e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let n=[];Ua(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}},VA={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":O.heading}},"TableRow",{name:"TableCell",style:O.content},{name:"TableDelimiter",style:O.processingInstruction}],parseBlock:[{name:"Table",leaf(r,e){return vy(e.content,0)?new Nd:null},endLeaf(r,e,t){if(t.parsers.some(n=>n instanceof Nd)||!vy(e.text,e.basePos))return!1;let i=r.peekLine();return Ny.test(i)&&Ua(r,e.text,e.basePos)==Ua(r,i,e.basePos)},before:"SetextHeading"}]},Pm=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}},jA={defineNodes:[{name:"Task",block:!0,style:O.list},{name:"TaskMarker",style:O.atom}],parseBlock:[
Line truncated
|
|
|
|
|
`);i=n<0?t:t.slice(0,n)}return e+i.length>this.to?i.slice(0,this.to-e):i}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,i=0){this.block=Id.create(e,i,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,i=0){this.startContext(this.parser.getNodeType(e),t,i)}addNode(e,t,i){typeof e=="number"&&(e=new Se(this.parser.nodeSet.types[e],co,co,(i!=null?i: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(ym(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?My(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let i of e.parsers)if(i.finish(this,e))return;let t=ym(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(B.Paragraph,e.content.length),e.start)}elt(e,t,i,n){return typeof e=="string"?_e(this.parser.getNodeType(e),t,i,n):new Fd(e,t)}get buffer(){return new qd(this.parser.nodeSet)}};function My(r,e,t,i,n){let s=r[e].to,o=[],a=[],l=t.from+i;function c(d,h){for(;h?d>=s:d>s;){let u=r[e+1].from-s;i+=u,d+=u,e++,s=r[e].to}}for(let d=t.firstChild;d;d=d.nextSibling){c(d.from+i,!0);let h=d.from+i,u,f=n.get(d.tree);f?u=f:d.to+i>s?(u=My(r,e,d,i,n),c(d.to+i,!1)):u=d.toTree(),o.push(u),a.push(h-l)}return c(t.to+i,!1),new Se(t.type,o,a,t.to+i-l,t.tree?t.tree.propValues:void 0)}var za=class r extends Pi{constructor(e,t,i,n,s,o,a,l,c){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=i,this.blockNames=n,this.endLeafBlock=s,this.skipContextMarkup=o,this.inlineParsers=a,this.inlineNames=l,this.wrappers=c,this.nodeTypes=Object.create(null);for(let d of e.types)this.nodeTypes[d.name]=d.id}createParse(e,t,i){let n=new wm(this,e,t,i);for(let s of this.wrappers)n=s(n,e,t,i);return n}configure(e){let t=vm(e);if(!t)return this;let{nodeSet:i,skipContextMarkup:n}=this,s=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),a=this.blockNames.slice(),l=this.inlineParsers.slice(),c=this.inlineNames.slice(),d=this.endLeafBlock.slice(),h=this.wrappers;if(Ea(t.defineNodes)){n=Object.assign({},n);let u=i.types.slice(),f;for(let p of t.defineNodes){let{name:m,block:S,composite:y,style:A}=typeof p=="string"?{name:p}:p;if(u.some(T=>T.name==m))continue;y&&(n[u.length]=(T,P,C)=>y(P,C,T.value));let R=u.length,U=y?["Block","BlockContext"]:S?R>=B.ATXHeading1&&R<=B.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;u.push(rt.define({id:R,name:m,props:U&&[[ue.group,U]]})),A&&(f||(f={}),Array.isArray(A)||A instanceof lr?f[m]=A:Object.assign(f,A))}i=new yi(u),f&&(i=i.extend(St(f)))}if(Ea(t.props)&&(i=i.extend(...t.props)),Ea(t.remove))for(let u of t.remove){let f=this.blockNames.indexOf(u),p=this.inlineNames.indexOf(u);f>-1&&(s[f]=o[f]=void 0),p>-1&&(l[p]=void 0)}if(Ea(t.parseBlock))for(let u of t.parseBlock){let f=a.indexOf(u.name);if(f>-1)s[f]=u.parse,o[f]=u.leaf;else{let p=u.before?Dd(a,u.before):u.after?Dd(a,u.after)+1:a.length-1;s.splice(p,0,u.parse),o.splice(p,0,u.leaf),a.splice(p,0,u.name)}u.endLeaf&&d.push(u.endLeaf)}if(Ea(t.parseInline))for(let u of t.parseInline){let f=c.indexOf(u.name);if(f>-1)l[f]=u.parse;else{let p=u.before?Dd(c,u.before):u.after?Dd(c,u.after)+1:c.length-1;l.splice(p,0,u.parse),c.splice(p,0,u.name)}}return t.wrap&&(h=h.concat(t.wrap)),new r(i,s,o,a,d,n,l,c,h)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw new RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let i=new La(this,e,t);e:for(let n=t;n<i.end;){let s=i.char(n);for(let o of this.inlineParsers)if(o){let a=o(i,s,n);if(a>=0){n=a;continue e}}n++}return i.resolveMarkers(0)}};function Ea(r){return r!=null&&r.length>0}function vm(r){if(!Array.isArray(r))return r;if(r.length==0)return null;let e=vm(r[0]);if(r.length==1)return e;let t=vm(r.slice(1));if(!t||!e)return e||t;let i=(o,a)=>(o||co).concat(a||co),n=e.wrap,s=t.wrap;return{props:i(e.props,t.props),defineNodes:i(e.defineNodes,t.defineNodes),parseBlock:i(e.parseBlock,t.parseBlock),parseInline:i(e.parseInline,t.parseInline),remove:i(e.remove,t.remove),wrap:n?s?(o,a,l,c)=>n(s(o,a,l,c),a,l,c):n:s}}function Dd(r,e){let t=r.indexOf(e);if(t<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return t}var Ly=[rt.none];for(let r=1,e;e=B[r];r++)Ly[r]=rt.define({id:r,name:e,props:r>=B.Escape?[]:[[ue.group,r in Ty?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});var co=[],qd=class{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,i,
Line truncated
|
|
|
|
|
`;)s--;this.fragmentEnd=s?s-1:0}let i=this.cursor;i||(i=this.cursor=this.fragment.tree.cursor(),i.firstChild());let n=e+this.fragment.offset;for(;i.to<=n;)if(!i.parent())return!1;for(;;){if(i.from>=n)return this.fragment.from<=t;if(!i.childAfter(n))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(ue.contextHash)==e}takeNodes(e){let t=this.cursor,i=this.fragment.offset,n=this.fragmentEnd-(this.fragment.openEnd?1:0),s=e.absoluteLineStart,o=s,a=e.block.children.length,l=o,c=a;for(;;){if(t.to-i>n){if(t.type.isAnonymous&&t.firstChild())continue;break}let d=Iy(t.from-i,e.ranges);if(t.to-i<=e.ranges[e.rangeI].to)e.addNode(t.tree,d);else{let h=new Se(e.parser.nodeSet.types[B.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(h,t.tree),e.addNode(h,d)}if(t.type.is("Block")&&(ZA.indexOf(t.type.id)<0?(o=t.to-i,a=e.block.children.length):(o=l,a=c),l=t.to-i,c=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 Iy(r,e){let t=r;for(let i=1;i<e.length;i++){let n=e[i-1].to,s=e[i].from;n<r&&(t-=s-n)}return t}var UA=St({"Blockquote/...":O.quote,HorizontalRule:O.contentSeparator,"ATXHeading1/... SetextHeading1/...":O.heading1,"ATXHeading2/... SetextHeading2/...":O.heading2,"ATXHeading3/...":O.heading3,"ATXHeading4/...":O.heading4,"ATXHeading5/...":O.heading5,"ATXHeading6/...":O.heading6,"Comment CommentBlock":O.comment,Escape:O.escape,Entity:O.character,"Emphasis/...":O.emphasis,"StrongEmphasis/...":O.strong,"Link/... Image/...":O.link,"OrderedList/... BulletList/...":O.list,"BlockQuote/...":O.quote,"InlineCode CodeText":O.monospace,"URL Autolink":O.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":O.processingInstruction,"CodeInfo LinkLabel":O.labelName,LinkTitle:O.string,Paragraph:O.content}),qy=new za(new yi(Ly).extend(UA),Object.keys(jd).map(r=>jd[r]),Object.keys(jd).map(r=>zy[r]),Object.keys(jd),CA,Ty,Object.keys(Om).map(r=>Om[r]),Object.keys(Om),[]);function zA(r,e,t){let i=[];for(let n=r.firstChild,s=e;;n=n.nextSibling){let o=n?n.from:t;if(o>s&&i.push({from:s,to:o}),!n)break;s=n.to}return i}function Fy(r){let{codeParser:e,htmlParser:t}=r;return{wrap:Bc((n,s)=>{let o=n.type.id;if(e&&(o==B.CodeBlock||o==B.FencedCode)){let a="";if(o==B.FencedCode){let c=n.node.getChild(B.CodeInfo);c&&(a=s.read(c.from,c.to))}let l=e(a);if(l)return{parser:l,overlay:c=>c.type.id==B.CodeText,bracketed:o==B.FencedCode}}else if(t&&(o==B.HTMLBlock||o==B.HTMLTag||o==B.CommentBlock))return{parser:t,overlay:zA(n.node,n.from,n.to)};return null})}}var MA={resolve:"Strikethrough",mark:"StrikethroughMark"},LA={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":O.strikethrough}},{name:"StrikethroughMark",style:O.processingInstruction}],parseInline:[{name:"Strikethrough",parse(r,e,t){if(e!=126||r.char(t+1)!=126||r.char(t+2)==126)return-1;let i=r.slice(t-1,t),n=r.slice(t+2,t+3),s=/\s|^$/.test(i),o=/\s|^$/.test(n),a=Ma.test(i),l=Ma.test(n);return r.addDelimiter(MA,t,t+2,!o&&(!l||s||a),!s&&(!a||o||l))},after:"Emphasis"}]};function Ua(r,e,t=0,i,n=0){let s=0,o=!0,a=-1,l=-1,c=!1,d=()=>{i.push(r.elt("TableCell",n+a,n+l,r.parser.parseInline(e.slice(a,l),n+a)))};for(let h=t;h<e.length;h++){let u=e.charCodeAt(h);u==124&&!c?((!o||a>-1)&&s++,o=!1,i&&(a>-1&&d(),i.push(r.elt("TableDelimiter",h+n,h+n+1))),a=l=-1):(c||u!=32&&u!=9)&&(a<0&&(a=h),l=h+1),c=!c&&u==92}return a>-1&&(s++,i&&d()),s}function wy(r,e){for(let t=e;t<r.length;t++){let i=r.charCodeAt(t);if(i==124)return!0;i==92&&t++}return!1}var By=/^[>\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,Nd=class{constructor(){this.rows=null}nextLine(e,t,i){if(this.rows==null){this.rows=!1;let n;if((t.next==45||t.next==58||t.next==124)&&By.test(n=t.text.slice(t.pos))){let s=[];Ua(e,i.content,0,s,i.start)==Ua(e,n,0)&&(this.rows=[e.elt("TableHeader",i.start,i.start+i.content.length,s),e.elt("TableDelimiter",e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let n=[];Ua(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}},YA={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":O.heading}},"TableRow",{name:"TableCell",style:O.content},{name:"TableDelimiter",style:O.processingInstruction}],parseBlock:[{name:"Table",leaf(r,e){return wy(e.content,0)?new Nd:null},endLeaf(r,e,t){if(t.parsers.some(n=>n instanceof Nd)||!wy(e.text,e.basePos))return!1;let i=r.peekLine();return By.test(i)&&Ua(r,e.text,e.basePos)==Ua(r,i,e.basePos)},before:"SetextHeading"}]},Pm=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}},WA={defineNodes:[{name:"Task",block:!0,style:O.list},{name:"TaskMarker",style:O.atom}],parseBlock:[
Line truncated
|
|
|
|
|
\${}
|
|
|
|
|
} catch (\${error}) {
|
|
|
|
|
\${}
|
|
|
|
@@ -57,36 +57,36 @@ Connect your audio output to the SuperCharger input, turn up the volume, and pla
|
|
|
|
|
constructor(\${params}) {
|
|
|
|
|
\${}
|
|
|
|
|
}
|
|
|
|
|
}`,{label:"class",detail:"definition",type:"keyword"}),Yt('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Yt('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],YZ=zQ.concat([Yt("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Yt("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Yt("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),EQ=new Fs,MQ=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Va(r){return(e,t)=>{let i=e.node.getChild("VariableDefinition");return i&&t(i,r),!0}}var WZ=["FunctionDeclaration"],VZ={FunctionDeclaration:Va("function"),ClassDeclaration:Va("class"),ClassExpression:()=>!0,EnumDeclaration:Va("constant"),TypeAliasDeclaration:Va("type"),NamespaceDeclaration:Va("namespace"),VariableDefinition(r,e){r.matchContext(WZ)||e(r,"variable")},TypeDefinition(r,e){e(r,"type")},__proto__:null};function LQ(r,e){let t=EQ.get(e);if(t)return t;let i=[],n=!0;function s(o,a){let l=r.sliceString(o.from,o.to);i.push({label:l,type:a})}return e.cursor(Xe.IncludeAnonymous).iterate(o=>{if(n)n=!1;else if(o.name){let a=VZ[o.name];if(a&&a(o,s)||MQ.has(o.name))return!1}else if(o.to-o.from>8192){for(let a of LQ(r,o.node))i.push(a);return!1}}),EQ.set(e,i),i}var ZQ=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,YQ=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function jZ(r){let e=Te(r.state).resolveInner(r.pos,-1);if(YQ.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&ZQ.test(r.state.sliceDoc(e.from,e.to));if(!t&&!r.explicit)return null;let i=[];for(let n=e;n;n=n.parent)MQ.has(n.name)&&(i=i.concat(LQ(r.state.doc,n)));return{options:i,from:t?e.from:r.pos,validFor:ZQ}}var Hr=wt.define({name:"javascript",parser:AQ.configure({props:[kr.add({IfStatement:ui({except:/^\s*({|else\b)/}),TryStatement:ui({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:sd,SwitchBody:r=>{let e=r.textAfter,t=/^\s*\}/.test(e),i=/^\s*(case|default)\b/.test(e);return r.baseIndent+(t?0:i?1:2)*r.unit},Block:nd({closing:"}"}),ArrowFunction:r=>r.baseIndent+r.unit,"TemplateString BlockComment":()=>null,"Statement Property":ui({except:/^\s*{/}),JSXElement(r){let e=/^\s*<\//.test(r.textAfter);return r.lineIndent(r.node.from)+(e?0:r.unit)},JSXEscape(r){let e=/\s*\}/.test(r.textAfter);return r.lineIndent(r.node.from)+(e?0:r.unit)},"JSXOpenTag JSXSelfClosingTag"(r){return r.column(r.node.from)+r.unit}}),_t.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Tr,BlockComment(r){return{from:r.from+2,to:r.to-2}},JSXElement(r){let e=r.firstChild;if(!e||e.name=="JSXSelfClosingTag")return null;let t=r.lastChild;return{from:e.to,to:t.type.isError?r.to:t.from}},"JSXSelfClosingTag JSXOpenTag"(r){var e;let t=(e=r.firstChild)===null||e===void 0?void 0:e.nextSibling,i=r.lastChild;return!t||t.type.isError?null:{from:t.to,to:i.type.isError?r.to:i.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),WQ={test:r=>/^JSX/.test(r.name),facet:Bs({commentTokens:{block:{open:"{/*",close:"*/}"}}})},jm=Hr.configure({dialect:"ts"},"typescript"),Dm=Hr.configure({dialect:"jsx",props:[rd.add(r=>r.isTop?[WQ]:void 0)]}),Im=Hr.configure({dialect:"jsx ts",props:[rd.add(r=>r.isTop?[WQ]:void 0)]},"typescript"),VQ=r=>({label:r,type:"keyword"}),jQ="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(VQ),DZ=jQ.concat(["declare","implements","private","protected","public"].map(VQ));function DQ(r={}){let e=r.jsx?r.typescript?Im:Dm:r.typescript?jm:Hr,t=r.typescript?YZ.concat(DZ):zQ.concat(jQ);return new Ze(e,[Hr.data.of({autocomplete:IS(YQ,DS(t))}),Hr.data.of({autocomplete:jZ}),r.jsx?FZ:[]])}function IZ(r){for(;;){if(r.name=="JSXOpenTag"||r.name=="JSXSelfClosingTag"||r.name=="JSXFragmentTag")return r;if(r.name=="JSXEscape"||!r.parent)return null;r=r.parent}}function UQ(r,e,t=r.length){for(let i=e==null?void 0:e.firstChild;i;i=i.nextSibling)if(i.name=="JSXIdentifier"||i.name=="JSXBuiltin"||i.name=="JSXNamespacedName"||i.name=="JSXMemberExpression")return r.sliceString(i.from,Math.min(i.to,t));return""}var qZ=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),FZ=V.inputHandler.of((r,e,t,i,n)=>{if((qZ?r.composing:r.compositionStarted)||r.state.readOnly||e!=t||i!=">"&&i!="/"||!Hr.isActiveAt(r.state,e,-1))return!1;let s=n(),{state:o}=s,a=o.changeByRange(l=>{var c;let{head:d}=l,h=Te(o).resol
Line truncated
|
|
|
|
|
`);for(let l of a){b1.lastIndex=0;let c=b1.exec(l);if(c){let d=o+c.index+c[0].length;t.push(F.widget({widget:new og(c[0],e),side:-1}).range(d))}o+=l.length+1}}return F.set(t,!0)}function S1(r){let e;function t(i){let n=e.posAtDOM(i);r(e.state.doc.lineAt(n).number)}return We.fromClass(class{constructor(i){e=i,this.decorations=x1(i,t)}update(i){e=i.view,(i.docChanged||i.viewportChanged)&&(this.decorations=x1(i.view,t))}},{decorations:i=>i.decorations})}var ag=class extends dt{constructor(t,i,n){super();this.filename=t;this.system=i;this.handleClick=n}toDOM(){let t=document.createElement("span");return t.className="include-link-badge",t.textContent="\u2192",t.title=(this.system?"System header: ":"View ")+this.filename,t.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),this.handleClick(this.filename,this.system)}),t}eq(t){return this.filename===t.filename&&this.system===t.system}ignoreEvent(){return!1}};function kU(r,e,t){let i=[],n=r.state.doc,s=new Set;for(let{from:o,to:a}of r.visibleRanges){let l=r.state.sliceDoc(o,a);for(let c of e){let d=c instanceof RegExp?{re:c}:c;d.re.lastIndex=0;let h;for(;h=d.re.exec(l);){let u=h[d.group!=null?d.group:h.length-1];if(!u)continue;let f=d.suffix?u+d.suffix:u,p=Math.min(o+h.index+h[0].length,n.length),m=n.lineAt(p),S=m.number+":"+f;s.has(S)||(s.add(S),i.push(F.widget({widget:new ag(f,!!d.system,t),side:1}).range(m.to)))}}}return F.set(i,!0)}function w1(r,e){function t(i){let n=r();return!n||!n.length?F.none:kU(i,n,e)}return We.fromClass(class{constructor(i){this.decorations=t(i)}update(i){(i.docChanged||i.viewportChanged)&&(this.decorations=t(i.view))}},{decorations:i=>i.decorations})}var fn=window.matchMedia&&window.matchMedia("only screen and (max-width: 760px)").matches;function Cr(r,e){var t=$(document.createElement("div"));return r&&t.appendTo(r),e&&t.addClass(e),t}function TU(r){return Qe.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input")||!r.input)return e;let t=[],i=!1;if(e.changes.iterChanges((o,a,l,c,d)=>{let h=d.toString(),u=r.input(h);t.push({from:o,to:a,insert:u}),u!==h&&(i=!0)}),!i)return e;let n=e.annotation(Be.userEvent),s=e.annotation(Be.addToHistory);return{changes:t,selection:e.selection,effects:e.effects,scrollIntoView:e.scrollIntoView,annotations:[...n!=null?[Be.userEvent.of(n)]:[],...s!=null?[Be.addToHistory.of(s)]:[]]}})}var lg=new bt;function v1(r){return lg.reconfigure(TU(r))}var y1=ce.define(),Q1=ce.define(),P1=ce.define(),$1=ce.define(),k1=ce.define(),T1=ce.define(),X1=ce.define(),dg=ce.define(),_1=ce.define(),R1=ke.define({create(){return me.empty},update(r,e){r=r.map(e.changes);for(let t of e.effects)if(t.is(y1)){let i=t.value,n=[];for(let[s,o]of i.entries())if(s>=1&&s<=e.state.doc.lines){let a=e.state.doc.line(s).from;n.push(new ih(be(o,4)).range(a))}r=me.of(n,!0)}return r}}),C1=ke.define({create(){return me.empty},update(r,e){r=r.map(e.changes);for(let t of e.effects)if(t.is(Q1)){let i=t.value,n=[];for(let[s,o]of i.entries())if(s>=1&&s<=e.state.doc.lines){let a=e.state.doc.line(s).from;n.push(new nh(o).range(a))}r=me.of(n,!0)}return r}}),A1=ke.define({create(){return me.empty},update(r,e){r=r.map(e.changes);for(let t of e.effects)if(t.is(P1)){let i=t.value,n=[];for(let[s,o]of i.entries())if(s>=1&&s<=e.state.doc.lines){let a=e.state.doc.line(s).from;n.push(new sh(o).range(a))}r=me.of(n,!0)}return r}}),E1=ke.define({create(){return me.empty},update(r,e){r=r.map(e.changes);for(let t of e.effects)if(t.is(k1)){let i=[],n=t.value.filter(s=>s.line>=1&&s.line<=e.state.doc.lines).sort((s,o)=>s.line-o.line);for(let s of n){let o=e.state.doc.line(s.line).from;i.push((s.enabled?_U:RU).range(o))}r=me.of(i,!0)}return r}}),cg=ke.define({create(){return me.empty},update(r,e){r=r.map(e.changes);for(let t of e.effects)if(t.is(T1)){let i=t.value,n=[];for(let[s,o]of i.entries())if(s>=1&&s<=e.state.doc.lines){let a=e.state.doc.line(s).from;n.push(new ah(s,o).range(a))}r=me.of(n,!0)}return r}}),Z1=ke.define({create(){return me.empty},update(r,e){r=r.map(e.changes);for(let t of e.effects)if(t.is(X1))if(t.value===null)r=me.empty;else{let i=t.value;if(i>=1&&i<=e.state.doc.lines){let n=e.state.doc.line(i).from;r=me.of(U1.range(n))}}return r}}),ih=class extends at{constructor(t){super();this.hex=t}toDOM(){let t=document.createElement("span");return t.textContent=this.hex,t.style.cursor="pointer",t.title="Click to run to here",t.addEventListener("mouseenter",()=>{t.style.textDecoration="underline"}),t.addEventListener("mouseleave",()=>{t.style.textDecoration="none"}),t}eq(t){return this.hex==t.hex}},nh=class extends at{constructor(t){super();this.bytes=t}toDOM(){return document.createTextNode(this.bytes)}eq(t){return this.bytes==t.bytes}},sh=class extends at{constructor(t){super();this.clock=t}toDOM(){return document.createTextNode(this.clock)}eq(t){return this.clock==t.clock}},XU=new class extends at{toDOM(){let r=document.createElement("span");return r.textContent="\u25CF",r.style.color="transparent",r.style.cursor="pointer",r.addE
Line truncated
|
|
|
|
|
}`,{label:"class",detail:"definition",type:"keyword"}),Yt('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Yt('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],MZ=UQ.concat([Yt("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Yt("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Yt("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),AQ=new Fs,zQ=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Va(r){return(e,t)=>{let i=e.node.getChild("VariableDefinition");return i&&t(i,r),!0}}var LZ=["FunctionDeclaration"],YZ={FunctionDeclaration:Va("function"),ClassDeclaration:Va("class"),ClassExpression:()=>!0,EnumDeclaration:Va("constant"),TypeAliasDeclaration:Va("type"),NamespaceDeclaration:Va("namespace"),VariableDefinition(r,e){r.matchContext(LZ)||e(r,"variable")},TypeDefinition(r,e){e(r,"type")},__proto__:null};function MQ(r,e){let t=AQ.get(e);if(t)return t;let i=[],n=!0;function s(o,a){let l=r.sliceString(o.from,o.to);i.push({label:l,type:a})}return e.cursor(Xe.IncludeAnonymous).iterate(o=>{if(n)n=!1;else if(o.name){let a=YZ[o.name];if(a&&a(o,s)||zQ.has(o.name))return!1}else if(o.to-o.from>8192){for(let a of MQ(r,o.node))i.push(a);return!1}}),AQ.set(e,i),i}var EQ=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,LQ=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function WZ(r){let e=Te(r.state).resolveInner(r.pos,-1);if(LQ.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&EQ.test(r.state.sliceDoc(e.from,e.to));if(!t&&!r.explicit)return null;let i=[];for(let n=e;n;n=n.parent)zQ.has(n.name)&&(i=i.concat(MQ(r.state.doc,n)));return{options:i,from:t?e.from:r.pos,validFor:EQ}}var Hr=wt.define({name:"javascript",parser:CQ.configure({props:[kr.add({IfStatement:ui({except:/^\s*({|else\b)/}),TryStatement:ui({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:sd,SwitchBody:r=>{let e=r.textAfter,t=/^\s*\}/.test(e),i=/^\s*(case|default)\b/.test(e);return r.baseIndent+(t?0:i?1:2)*r.unit},Block:nd({closing:"}"}),ArrowFunction:r=>r.baseIndent+r.unit,"TemplateString BlockComment":()=>null,"Statement Property":ui({except:/^\s*{/}),JSXElement(r){let e=/^\s*<\//.test(r.textAfter);return r.lineIndent(r.node.from)+(e?0:r.unit)},JSXEscape(r){let e=/\s*\}/.test(r.textAfter);return r.lineIndent(r.node.from)+(e?0:r.unit)},"JSXOpenTag JSXSelfClosingTag"(r){return r.column(r.node.from)+r.unit}}),_t.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Tr,BlockComment(r){return{from:r.from+2,to:r.to-2}},JSXElement(r){let e=r.firstChild;if(!e||e.name=="JSXSelfClosingTag")return null;let t=r.lastChild;return{from:e.to,to:t.type.isError?r.to:t.from}},"JSXSelfClosingTag JSXOpenTag"(r){var e;let t=(e=r.firstChild)===null||e===void 0?void 0:e.nextSibling,i=r.lastChild;return!t||t.type.isError?null:{from:t.to,to:i.type.isError?r.to:i.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),YQ={test:r=>/^JSX/.test(r.name),facet:Bs({commentTokens:{block:{open:"{/*",close:"*/}"}}})},jm=Hr.configure({dialect:"ts"},"typescript"),Dm=Hr.configure({dialect:"jsx",props:[rd.add(r=>r.isTop?[YQ]:void 0)]}),Im=Hr.configure({dialect:"jsx ts",props:[rd.add(r=>r.isTop?[YQ]:void 0)]},"typescript"),WQ=r=>({label:r,type:"keyword"}),VQ="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(WQ),VZ=VQ.concat(["declare","implements","private","protected","public"].map(WQ));function jQ(r={}){let e=r.jsx?r.typescript?Im:Dm:r.typescript?jm:Hr,t=r.typescript?MZ.concat(VZ):UQ.concat(VQ);return new Ze(e,[Hr.data.of({autocomplete:DS(LQ,jS(t))}),Hr.data.of({autocomplete:WZ}),r.jsx?IZ:[]])}function jZ(r){for(;;){if(r.name=="JSXOpenTag"||r.name=="JSXSelfClosingTag"||r.name=="JSXFragmentTag")return r;if(r.name=="JSXEscape"||!r.parent)return null;r=r.parent}}function ZQ(r,e,t=r.length){for(let i=e==null?void 0:e.firstChild;i;i=i.nextSibling)if(i.name=="JSXIdentifier"||i.name=="JSXBuiltin"||i.name=="JSXNamespacedName"||i.name=="JSXMemberExpression")return r.sliceString(i.from,Math.min(i.to,t));return""}var DZ=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),IZ=V.inputHandler.of((r,e,t,i,n)=>{if((DZ?r.composing:r.compositionStarted)||r.state.readOnly||e!=t||i!=">"&&i!="/"||!Hr.isActiveAt(r.state,e,-1))return!1;let s=n(),{state:o}=s,a=o.changeByRange(l=>{var c;let{head:d}=l,h=Te(o).resol
Line truncated
|
|
|
|
|
`);for(let l of a){g1.lastIndex=0;let c=g1.exec(l);if(c){let d=o+c.index+c[0].length;t.push(F.widget({widget:new og(c[0],e),side:-1}).range(d))}o+=l.length+1}}return F.set(t,!0)}function x1(r){let e;function t(i){let n=e.posAtDOM(i);r(e.state.doc.lineAt(n).number)}return We.fromClass(class{constructor(i){e=i,this.decorations=b1(i,t)}update(i){e=i.view,(i.docChanged||i.viewportChanged)&&(this.decorations=b1(i.view,t))}},{decorations:i=>i.decorations})}var ag=class extends dt{constructor(t,i,n){super();this.filename=t;this.system=i;this.handleClick=n}toDOM(){let t=document.createElement("span");return t.className="include-link-badge",t.textContent="\u2192",t.title=(this.system?"System header: ":"View ")+this.filename,t.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),this.handleClick(this.filename,this.system)}),t}eq(t){return this.filename===t.filename&&this.system===t.system}ignoreEvent(){return!1}};function PU(r,e,t){let i=[],n=r.state.doc,s=new Set;for(let{from:o,to:a}of r.visibleRanges){let l=r.state.sliceDoc(o,a);for(let c of e){let d=c instanceof RegExp?{re:c}:c;d.re.lastIndex=0;let h;for(;h=d.re.exec(l);){let u=h[d.group!=null?d.group:h.length-1];if(!u)continue;let f=d.suffix?u+d.suffix:u,p=Math.min(o+h.index+h[0].length,n.length),m=n.lineAt(p),S=m.number+":"+f;s.has(S)||(s.add(S),i.push(F.widget({widget:new ag(f,!!d.system,t),side:1}).range(m.to)))}}}return F.set(i,!0)}function S1(r,e){function t(i){let n=r();return!n||!n.length?F.none:PU(i,n,e)}return We.fromClass(class{constructor(i){this.decorations=t(i)}update(i){(i.docChanged||i.viewportChanged)&&(this.decorations=t(i.view))}},{decorations:i=>i.decorations})}var fn=window.matchMedia&&window.matchMedia("only screen and (max-width: 760px)").matches;function Cr(r,e){var t=$(document.createElement("div"));return r&&t.appendTo(r),e&&t.addClass(e),t}function $U(r){return Qe.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input")||!r.input)return e;let t=[],i=!1;if(e.changes.iterChanges((o,a,l,c,d)=>{let h=d.toString(),u=r.input(h);t.push({from:o,to:a,insert:u}),u!==h&&(i=!0)}),!i)return e;let n=e.annotation(Be.userEvent),s=e.annotation(Be.addToHistory);return{changes:t,selection:e.selection,effects:e.effects,scrollIntoView:e.scrollIntoView,annotations:[...n!=null?[Be.userEvent.of(n)]:[],...s!=null?[Be.addToHistory.of(s)]:[]]}})}var lg=new bt;function w1(r){return lg.reconfigure($U(r))}var v1=ce.define(),y1=ce.define(),Q1=ce.define(),P1=ce.define(),$1=ce.define(),k1=ce.define(),T1=ce.define(),dg=ce.define(),X1=ce.define(),_1=ke.define({create(){return me.empty},update(r,e){r=r.map(e.changes);for(let t of e.effects)if(t.is(v1)){let i=t.value,n=[];for(let[s,o]of i.entries())if(s>=1&&s<=e.state.doc.lines){let a=e.state.doc.line(s).from;n.push(new ih(be(o,4)).range(a))}r=me.of(n,!0)}return r}}),R1=ke.define({create(){return me.empty},update(r,e){r=r.map(e.changes);for(let t of e.effects)if(t.is(y1)){let i=t.value,n=[];for(let[s,o]of i.entries())if(s>=1&&s<=e.state.doc.lines){let a=e.state.doc.line(s).from;n.push(new nh(o).range(a))}r=me.of(n,!0)}return r}}),C1=ke.define({create(){return me.empty},update(r,e){r=r.map(e.changes);for(let t of e.effects)if(t.is(Q1)){let i=t.value,n=[];for(let[s,o]of i.entries())if(s>=1&&s<=e.state.doc.lines){let a=e.state.doc.line(s).from;n.push(new sh(o).range(a))}r=me.of(n,!0)}return r}}),A1=ke.define({create(){return me.empty},update(r,e){r=r.map(e.changes);for(let t of e.effects)if(t.is($1)){let i=[],n=t.value.filter(s=>s.line>=1&&s.line<=e.state.doc.lines).sort((s,o)=>s.line-o.line);for(let s of n){let o=e.state.doc.line(s.line).from;i.push((s.enabled?TU:XU).range(o))}r=me.of(i,!0)}return r}}),cg=ke.define({create(){return me.empty},update(r,e){r=r.map(e.changes);for(let t of e.effects)if(t.is(k1)){let i=t.value,n=[];for(let[s,o]of i.entries())if(s>=1&&s<=e.state.doc.lines){let a=e.state.doc.line(s).from;n.push(new ah(s,o).range(a))}r=me.of(n,!0)}return r}}),E1=ke.define({create(){return me.empty},update(r,e){r=r.map(e.changes);for(let t of e.effects)if(t.is(T1))if(t.value===null)r=me.empty;else{let i=t.value;if(i>=1&&i<=e.state.doc.lines){let n=e.state.doc.line(i).from;r=me.of(Z1.range(n))}}return r}}),ih=class extends at{constructor(t){super();this.hex=t}toDOM(){let t=document.createElement("span");return t.textContent=this.hex,t.style.cursor="pointer",t.title="Click to run to here",t.addEventListener("mouseenter",()=>{t.style.textDecoration="underline"}),t.addEventListener("mouseleave",()=>{t.style.textDecoration="none"}),t}eq(t){return this.hex==t.hex}},nh=class extends at{constructor(t){super();this.bytes=t}toDOM(){return document.createTextNode(this.bytes)}eq(t){return this.bytes==t.bytes}},sh=class extends at{constructor(t){super();this.clock=t}toDOM(){return document.createTextNode(this.clock)}eq(t){return this.clock==t.clock}},kU=new class extends at{toDOM(){let r=document.createElement("span");return r.textContent="\u25CF",r.style.color="transparent",r.style.cursor="pointer",r.addE
Line truncated
|
|
|
|
|
color: #ff6666;
|
|
|
|
|
background-color: #330000;
|
|
|
|
|
padding: 4px 8px;
|
|
|
|
|
margin: 2px 0;
|
|
|
|
|
border-left: 3px solid #ff0000;
|
|
|
|
|
font-family: monospace;
|
|
|
|
|
`,t}},LU=ke.define({create(){return F.none},update(r,e){r=r.map(e.changes);for(let t of e.effects)if(t.is(ns.showMessage)){if(t.value===null||!t.value)return F.none;if(t.value.toggle){let i=[],n=new Map;return r.between(0,e.state.doc.length,(a,l,c)=>{try{let d=e.state.doc.lineAt(l).number;c.spec.widget instanceof Fa&&n.set(d,c.spec.widget.message)}catch(d){}}),n.has(t.value.line)?n.delete(t.value.line):n.set(t.value.line,t.value.msg),Array.from(n.keys()).sort((a,l)=>a-l).forEach(a=>{try{let l=e.state.doc.line(a);i.push(F.widget({widget:new Fa(n.get(a)),block:!0,side:1}).range(l.to))}catch(l){}}),F.set(i,!0)}}return r},provide:r=>V.decorations.from(r)}),hg=class extends dt{constructor(t){super();this.value=t}toDOM(){let t=document.createElement("div");return t.textContent=`${this.value}`,t.style.cssText=`
|
|
|
|
|
`,t}},zU=ke.define({create(){return F.none},update(r,e){r=r.map(e.changes);for(let t of e.effects)if(t.is(ns.showMessage)){if(t.value===null||!t.value)return F.none;if(t.value.toggle){let i=[],n=new Map;return r.between(0,e.state.doc.length,(a,l,c)=>{try{let d=e.state.doc.lineAt(l).number;c.spec.widget instanceof Fa&&n.set(d,c.spec.widget.message)}catch(d){}}),n.has(t.value.line)?n.delete(t.value.line):n.set(t.value.line,t.value.msg),Array.from(n.keys()).sort((a,l)=>a-l).forEach(a=>{try{let l=e.state.doc.line(a);i.push(F.widget({widget:new Fa(n.get(a)),block:!0,side:1}).range(l.to))}catch(l){}}),F.set(i,!0)}}return r},provide:r=>V.decorations.from(r)}),hg=class extends dt{constructor(t){super();this.value=t}toDOM(){let t=document.createElement("div");return t.textContent=`${this.value}`,t.style.cssText=`
|
|
|
|
|
color: #ccccff;
|
|
|
|
|
background-color: #000066;
|
|
|
|
|
display: inline-block;
|
|
|
|
|
`,t.className="cm-line",t}},Y1=ce.define(),YU=ke.define({create(){return F.none},update(r,e){r=r.map(e.changes);for(let t of e.effects)if(t.is(Y1)){if(t.value===null||!t.value)return F.none;let i=e.state.doc.lineAt(t.value.range.to);return F.set([F.widget({widget:new hg(t.value.val),block:!0,side:1}).range(i.to)])}return r},provide:r=>V.decorations.from(r)}),W1=ce.define(),WU=F.mark({attributes:{class:"cm-error-span"}}),VU=ke.define({create(){return F.none},update(r,e){r=r.map(e.changes);for(let t of e.effects)if(t.is(W1)){if(t.value===null)return F.none;let i=[];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&&i.push(WU.range(o,a))}catch(s){}return F.set(i,!0)}return r},provide:r=>V.decorations.from(r)}),V1=ce.define(),jU=F.line({attributes:{class:"highlight-lines"}}),DU=ke.define({create(){return F.none},update(r,e){r=r.map(e.changes);for(let t of e.effects)if(t.is(V1)){if(t.value===null)return F.none;let{start:i,end:n}=t.value,s=[];for(let o=i;o<=n;o++)try{let a=e.state.doc.line(o);s.push(jU.range(a.from))}catch(a){}return F.set(s)}return r!==F.none&&(e.docChanged||e.selection)?F.none:r},provide:r=>V.decorations.from(r)}),j1={field:LU,widget:Fa},Ba={effect:M1,decoration:L1,field:MU},hh={effect:Y1,field:YU},uh={effect:W1,field:VU},fh={effect:V1,field:DU},D1=ce.define(),IU=F.line({attributes:{class:"cm-traced-line"}}),qU=ke.define({create(){return F.none},update(r,e){r=r.map(e.changes);for(let t of e.effects)if(t.is(D1)){let i=[];for(let n of t.value)try{let s=e.state.doc.line(n);i.push(IU.range(s.from))}catch(s){}return F.set(i,!0)}return r},provide:r=>V.decorations.from(r)}),Oh={effect:D1,field:qU};var FU=[...ku(Ww,$u),{key:"Mod-Shift-Backspace",run:lp}],F1=ku(Jv,$u),fo=64,B1=ce.define(),N1=ce.define(),ug=ke.define({create(){return new Map},update(r,e){let t=r;for(let i of e.effects)if(i.is(N1))t=new Map;else if(i.is(B1)){t===r&&(t=new Map(r));for(let n of i.value)t.set(n.id,{from:n.from,to:n.to})}if(!e.changes.empty){let i=new Map;for(let[n,s]of t)i.set(n,{from:e.changes.mapPos(s.from,-1),to:e.changes.mapPos(s.to,1)});return i}return t}}),BU=200,fg={default:{theme:th},6502:{isAsm:!0},z80:{isAsm:!0},jsasm:{isAsm:!0},gas:{isAsm:!0},vasm:{isAsm:!0},inform6:{theme:eh},dialog:{theme:eh,lineWrap:!0},markdown:{lineWrap:!0},fastbasic:{noGutters:!0},basic:{noGutters:!0},ecs:{theme:th}},G1={input:null};function H1(r){G1.input=r?e=>e.toUpperCase():null}function mg(r){if(!r)return"";let e=r.state.selection.main;return e.empty?"":r.state.sliceDoc(e.from,e.to)}var Na=class Na{constructor(e,t){this.updateTimer=null;this.dirtylisting=!0;this.refreshDelayMsec=300;this.probe=null;this.path=e,this.mode=t}createDiv(e){var t=document.createElement("div");t.setAttribute("class","editor"),e.appendChild(t);var i=K.getFile(this.path),n=i&&this.mode=="verilog"&&/__asm\b([\s\S]+?)\b__endasm\b/.test(i);return this.newEditor(t,i,n),this.editor.dispatch({effects:v1(G1)}),this.syncBreakpoints(),K.getToolForFilename(this.path).startsWith("remote:")&&(this.refreshDelayMsec=1e3),t}setVisible(e){e?(this.editor.focus(),Na.tracingEnabled&&this.startTracing()):this.stopTracing()}getShortcuts(){if(!this.editor)return[];var e=this.editor,t=(i,n,s)=>({key:i,label:n,fn:()=>{s(e),e.focus()}});return[t("mod+f","Find",Vd),t("mod+g","Find Next",lo),t("mod+d","Next Occurrence",Mp),t("mod+z","Undo",wa),t("mod+shift+z","Redo",Hs)]}startTracing(){!this.probe&&w.startProbing&&(this.probe=w.startProbing(),this.probe.singleFrame=!1,this.probe.clear())}stopTracing(){this.probe&&(w.stopProbing(),this.probe=null),this.editor.dispatch({effects:Oh.effect.of([])})}setTracingEnabled(e){Na.tracingEnabled=e,e?this.startTracing():this.stopTracing()}newEditor(e,t,i){var n=fg[this.mode]||fg.default,s=i||n.isAsm,o=!!n.lineWrap,a=n.theme||fg.default.theme,l=n.useLineNumbers&&!fn;re.embed&&(l=!1,s=!1);let c=n.noGutters||fn;var d;let h=tg[this.mode];h?d=h.language:(console.warn("Unknown mode: "+this.mode),d=null),this.editor=new V({parent:e,doc:t,extensions:[s?[]:$r.of(" "),s?jO.of((u,f)=>{let p=u.state.doc.lineAt(f).number;if(p>=0){let m=u.state.doc.line(p);if(m.text.trim())return u.lineIndent(m.from)}return 0}):[],...s?[Ht.of(Fw(()=>to().tabsToSpaces))]:[],...Hw(to()),Ht.of(FU),l?Vc():[],hw(),Ht.of(Ow),_S(),Wx(),Qe.allowMultipleSelections.of(!0),Mc(),$S(),ZS(),Yc(),Wc(),Lc(),Gx(),Wd(),Lp({top:!0}),Ht.of(F1),d||[],a,rg,o?V.lineWrapping:[],Ba.field,c?[]:[lh.field,lh.gutter],s&&!c?[qa.field,qa.gutter,ch.field,ch.gutter]:[],dh.field,z1.gutter,V.updateListener.of(u=>{for(let f of u.transactions.flatMap(p=>p.effects))if(f.is(dh.requestToggle)&&vt.toggleSourceLine(this.path,f.value),f.is(uo.runToLine)){let p=f.value;if(this.sourcefile&&this.sourcefile.line2offset){let m=this.sourcefile.line2offset.get(p);m>=0&&Ha([m])}}}),ns.field,j1.field,uh.field,uo.field,uo.gutter,fh.field,Oh.field,ug,S1(u=>{window.location.hash="asseteditor/"+encodeURIComponent(this.path)+"/"+u}),re.embed?[]:w1(()=>{var u=K&&K.getToolFo
Line truncated
|
|
|
|
|
`).length-1;this.editor.dispatch({changes:{from:n,insert:e}}),this.highlightLines(i-1,i+s-2)}highlightLines(e,t){let i=this.editor.state.doc.line(e+1);this.editor.dispatch({effects:[fh.effect.of({start:e+1,end:t+1}),V.scrollIntoView(i.from,{y:"start",yMargin:100})]})}navigateToLine(e){if(e<1||e>this.editor.state.doc.lines)return;let t=this.editor.state.doc.line(e);this.editor.dispatch({selection:{anchor:t.from},effects:[fh.effect.of({start:e,end:e}),V.scrollIntoView(t.from,{y:"center"})]}),this.editor.focus()}getValue(){return this.editor.state.doc.toString()}getSelectionText(){return mg(this.editor)}getPath(){return this.path}markErrors(e){this.clearErrors(),e=e.slice(0,BU);let t=new Map,i=[];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&&i.push({line:o,start:n.start,end:n.end})}this.editor.dispatch({effects:[ns.set.of(t),uh.effect.of(i.length>0?i:null)]})}clearErrors(){this.dirtylisting=!0,this.editor.dispatch({effects:[ns.set.of(new Map),ns.showMessage.of(null),uh.effect.of(null)]})}getSourceFile(){return this.sourcefile}updateListing(){this.clearErrors();var e=this.sourcefile.lines||[];let t=new Map,i=new Map,n=new Map;for(var s of e)if(s.offset>=0&&t.set(s.line,be(s.offset&65535,4)),s.insns){var o=s.insns.length>9?"...":s.insns;if(i.set(s.line,o),s.iscode){if(s.cycles)n.set(s.line,s.cycles+"");else if(w.getOpcodeMetadata){var a=parseInt(s.insns.split(" ")[0],16),l=w.getOpcodeMetadata(a,s.offset);if(l&&l.minCycles){var c=l.minCycles+"";n.set(s.line,c)}}}}this.editor.dispatch({effects:[lh.set.of(t),qa.set.of(i),ch.set.of(n)]})}setTimingResult(e){if(this.sourcefile!=null){var t=new Map;for(let[o,a]of this.sourcefile.line2offset){let l=e.pc2clockrange[a];var i=l&&l.minclocks,n=l&&l.maxclocks;if(i>=0&&n>=0){var s;n==i?s=i+"":s=i+"-"+n,n==e.MAX_CLOCKS&&(s+="+"),t.set(o,s)}}this.editor.dispatch({effects:[qa.set.of(t)]})}}setCurrentLine(e,t){var i=n=>{this.editor.dispatch({effects:[uo.set.of(n.line),Ba.effect.of(n.line),...t?[V.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;if(i(e),t){let s=this.editor.state.doc.line(e.line).from+(e.start||0);this.editor.dispatch({selection:{anchor:s,head:s},effects:V.scrollIntoView(s,{y:"center"})})}this.currentDebugLine=e}}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:[uo.set.of(null),Ba.effect.of(null)]})}getActiveLine(){if(this.sourcefile){var e=yt&&yt.c;if(!e&&w.getCPUState&&!w.isRunning()&&(e=w.getCPUState()),e){var t=e&&(e.EPC||e.PC),i=this.sourcefile.findLineForOffset(t,fo);return i}}}refreshDebugState(e){var t=this.getActiveLine();!e&&(t===this.currentDebugLine||!t&&!this.currentDebugLine)||this.setCurrentLine(t,e)}refreshListing(){var e=K.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),this.updateTracedLines()}updateTracedLines(){let e=this.probe;if(!e||!e.idx||!this.sourcefile)return;let t=new Set;for(let i=0;i<e.idx;i++){let n=e.buf[i];if((n&4278190080)===16777216){let s=this.sourcefile.findLineForOffset(n&65535,fo);s&&t.add(s.line)}}e.clear(),this.editor.dispatch({effects:Oh.effect.of(Array.from(t))})}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.get(e);if(t>=0)return t;e--}return-1}undoStep(){wa(this.editor)}redoStep(){Hs(this.editor)}syncBreakpoints(){let e=vt.getSourceBreakpointsForFile(this.path).map(t=>({line:t.line,enabled:t.enabled}));this.editor.dispatch({effects:dh.setAll.of(e)})}};Na.tracingEnabled=!1;var jt=Na,Og=1024,_i=class{getSelectionText(){return mg(this.disasmview)}createDiv(e){var t=document.createElement("div");return t.setAttribute("class","editor"),e.appendChild(t),this.newEditor(t),t}newEditor(e){this.disasmview=new V({parent:e,extensions:[Yc(),Wc(),Qe.allowMultipleSelections.of(!0),Mc(),Lc(),Wd(),O1,eh,Ba.field,Qe.tabSize.of(8),Qe.readOnly.of(!0)]})}refresh(e,t){let i=yt||w.saveState(),n=t!==void 0?t:i.c?i.c.PC:0,s=0,o=0,a=w.debugSymbols&&w.debugSymbols.addr2symbol||{},l=(h,u)=>{let f="",p=0;for(;p<u;){let m=h+p|0,S=w.disassemble(m,w.readAddress.bind(w)),y="",A="";for(let T=0;T<S.nbytes;T++)y+=be(w.readAddress(m+T));for(;y.length<14;)y+=" ";let R=S.line;if(a&&S.isaddr&&(R=R.replace(/([^#])[$]([0-9A-F]+)/,(T,...P)=>{let C=parseInt(P[1],16),z=a[C];return z?P[0]+z:(z=a[
Line truncated
|
|
|
|
|
`;f+=U,m==n&&(o=s),s++,p+=S.nbytes||1}return f};var c=n<0?n-Og:Math.max(0,n-Og);let d=l(c,n-c)+l(n,Og);if(this.disasmview.dispatch({changes:{from:0,to:this.disasmview.state.doc.length,insert:d}}),e){let h=this.disasmview.state.doc.line(o+1);this.disasmview.dispatch({selection:{anchor:h.from,head:h.from},effects:V.scrollIntoView(h.from,{y:"center"})})}}goToAddress(e){e|=0,this.findAndSelectAddress(e)||(this.refresh(!1,e),this.findAndSelectAddress(e)),this.disasmview.focus()}findAndSelectAddress(e){let t=be(e,4),i=this.disasmview.state.doc;for(let n=1;n<=i.lines;n++){let s=i.line(n);if(s.text.startsWith(t+" "))return this.disasmview.dispatch({selection:{anchor:s.from,head:s.from+t.length},effects:V.scrollIntoView(s.from,{y:"center"})}),!0}return!1}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}},ph=class extends _i{constructor(e){super(),this.path=e}refreshListing(){var e=K.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}}),!!w.saveState){var i=yt||w.saveState(),n=i.c?i.c.EPC||i.c.PC:0;if(n>=0&&this.assemblyfile){var s=this.assemblyfile.findLineForOffset(n,fo);if(s&&e){let o=this.disasmview.state.doc.line(s.line);this.disasmview.dispatch({selection:{anchor:o.from,head:o.from},effects:V.scrollIntoView(o.from,{y:"center"})})}}}}}goToAddress(e){this.refreshListing();let t=this.assemblyfile&&this.assemblyfile.findLineForOffset(e,fo);if(t){let i=this.disasmview.state.doc.line(t.line);this.disasmview.dispatch({selection:{anchor:i.from,head:i.from},effects:V.scrollIntoView(i.from,{y:"center"})})}this.disasmview.focus()}};function K1(r){let e=[r];try{var t=zo(K.mainPath);t.length>0&&t!="local"&&e.push(t+"/"+r)}catch(s){}for(var i of e){var n=K&&K.getFile(i);if(typeof n=="string")return i}return null}function I1(r){for(var e of yb(r))if(e.editorStyle){var t=f1(e.editorStyle);if(t)return t}return null}var pg=new Map;function NU(r){let e=K.getToolForFilename(K.mainPath),t=jl(e,K.platform_id),i=Vl(e,K.platform_id);if(!t||!i.length)return Promise.resolve(null);let n=t+":"+r;return pg.has(n)||pg.set(n,(async()=>{var s=[...i.map(d=>d+"/"+r),r];for(var o of s){var a={preload_fs:t,readshared:o,updates:[],buildsteps:[]},l=await K.queryWorker(a),c=l&&l.output;if(c instanceof Uint8Array&&c.length>0)return new TextDecoder().decode(c)}return null})()),pg.get(n)}var On=class{constructor(e){this.fn=e;this.languageCompartment=new bt}getSelectionText(){return mg(this.view)}createDiv(e){var t=document.createElement("div");t.setAttribute("class","editor"),e.appendChild(t);var i=I1(this.fn||this.currentPath||"")||_a();return this.view=new V({parent:t,extensions:[Yc(),Wc(),Qe.allowMultipleSelections.of(!0),Mc(),Lc(),Wd(),Lp({top:!0}),Ht.of(F1),this.languageCompartment.of(i),th,rg,Qe.readOnly.of(!0)]}),this.refresh(!1),t}setVisible(e){e&&this.refresh(!1)}setHeaderText(e){var t=I1(this.currentPath||this.fn||"")||_a();this.view.dispatch({effects:this.languageCompartment.reconfigure(t),changes:{from:0,to:this.view.state.doc.length,insert:e}})}refresh(e){var t=this.fn;if(!t){var i=window.location.hash;if(!i||!i.startsWith("#headerview/"))return;t=this.fn=decodeURIComponent(i.substring(12))}this.loadIncludeFile(t)}async loadIncludeFile(e){this.requestedFn=e;var t=K1(e);if(t){this.currentPath=t,this.setHeaderText(K.getFile(t));return}var i=await NU(e);if(this.requestedFn===e){if(i!=null){this.currentPath=e,this.setHeaderText(i);return}this.currentPath=e,this.setHeaderText("// "+e+` was not found.
|
|
|
|
|
`,t.className="cm-line",t}},L1=ce.define(),MU=ke.define({create(){return F.none},update(r,e){r=r.map(e.changes);for(let t of e.effects)if(t.is(L1)){if(t.value===null||!t.value)return F.none;let i=e.state.doc.lineAt(t.value.range.to);return F.set([F.widget({widget:new hg(t.value.val),block:!0,side:1}).range(i.to)])}return r},provide:r=>V.decorations.from(r)}),Y1=ce.define(),LU=F.mark({attributes:{class:"cm-error-span"}}),YU=ke.define({create(){return F.none},update(r,e){r=r.map(e.changes);for(let t of e.effects)if(t.is(Y1)){if(t.value===null)return F.none;let i=[];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&&i.push(LU.range(o,a))}catch(s){}return F.set(i,!0)}return r},provide:r=>V.decorations.from(r)}),W1=ce.define(),WU=F.line({attributes:{class:"highlight-lines"}}),VU=ke.define({create(){return F.none},update(r,e){r=r.map(e.changes);for(let t of e.effects)if(t.is(W1)){if(t.value===null)return F.none;let{start:i,end:n}=t.value,s=[];for(let o=i;o<=n;o++)try{let a=e.state.doc.line(o);s.push(WU.range(a.from))}catch(a){}return F.set(s)}return r!==F.none&&(e.docChanged||e.selection)?F.none:r},provide:r=>V.decorations.from(r)}),V1={field:zU,widget:Fa},Ba={effect:z1,decoration:M1,field:UU},hh={effect:L1,field:MU},uh={effect:Y1,field:YU},fh={effect:W1,field:VU},j1=ce.define(),jU=F.line({attributes:{class:"cm-traced-line"}}),DU=ke.define({create(){return F.none},update(r,e){r=r.map(e.changes);for(let t of e.effects)if(t.is(j1)){let i=[];for(let n of t.value)try{let s=e.state.doc.line(n);i.push(jU.range(s.from))}catch(s){}return F.set(i,!0)}return r},provide:r=>V.decorations.from(r)}),Oh={effect:j1,field:DU};var IU=[...ku(Yw,$u),{key:"Mod-Shift-Backspace",run:lp}],q1=ku(Kv,$u),fo=64,F1=ce.define(),B1=ce.define(),ug=ke.define({create(){return new Map},update(r,e){let t=r;for(let i of e.effects)if(i.is(B1))t=new Map;else if(i.is(F1)){t===r&&(t=new Map(r));for(let n of i.value)t.set(n.id,{from:n.from,to:n.to})}if(!e.changes.empty){let i=new Map;for(let[n,s]of t)i.set(n,{from:e.changes.mapPos(s.from,-1),to:e.changes.mapPos(s.to,1)});return i}return t}}),qU=200,fg={default:{theme:th},6502:{isAsm:!0},z80:{isAsm:!0},jsasm:{isAsm:!0},gas:{isAsm:!0},vasm:{isAsm:!0},inform6:{theme:eh},dialog:{theme:eh,lineWrap:!0},markdown:{lineWrap:!0},fastbasic:{noGutters:!0},basic:{noGutters:!0},ecs:{theme:th}},N1={input:null};function G1(r){N1.input=r?e=>e.toUpperCase():null}function mg(r){if(!r)return"";let e=r.state.selection.main;return e.empty?"":r.state.sliceDoc(e.from,e.to)}var Na=class Na{constructor(e,t){this.updateTimer=null;this.dirtylisting=!0;this.refreshDelayMsec=300;this.probe=null;this.path=e,this.mode=t}createDiv(e){var t=document.createElement("div");t.setAttribute("class","editor"),e.appendChild(t);var i=K.getFile(this.path),n=i&&this.mode=="verilog"&&/__asm\b([\s\S]+?)\b__endasm\b/.test(i);return this.newEditor(t,i,n),this.editor.dispatch({effects:w1(N1)}),this.syncBreakpoints(),K.getToolForFilename(this.path).startsWith("remote:")&&(this.refreshDelayMsec=1e3),t}setVisible(e){e?(this.editor.focus(),Na.tracingEnabled&&this.startTracing()):this.stopTracing()}getShortcuts(){if(!this.editor)return[];var e=this.editor,t=(i,n,s)=>({key:i,label:n,fn:()=>{s(e),e.focus()}});return[t("mod+f","Find",Vd),t("mod+g","Find Next",lo),t("mod+d","Next Occurrence",Mp),t("mod+z","Undo",wa),t("mod+shift+z","Redo",Hs)]}startTracing(){!this.probe&&w.startProbing&&(this.probe=w.startProbing(),this.probe.singleFrame=!1,this.probe.clear())}stopTracing(){this.probe&&(w.stopProbing(),this.probe=null),this.editor.dispatch({effects:Oh.effect.of([])})}setTracingEnabled(e){Na.tracingEnabled=e,e?this.startTracing():this.stopTracing()}newEditor(e,t,i){var n=fg[this.mode]||fg.default,s=i||n.isAsm,o=!!n.lineWrap,a=n.theme||fg.default.theme,l=n.useLineNumbers&&!fn;re.embed&&(l=!1,s=!1);let c=n.noGutters||fn;var d;let h=tg[this.mode];h?d=h.language:(console.warn("Unknown mode: "+this.mode),d=null),this.editor=new V({parent:e,doc:t,extensions:[s?[]:$r.of(" "),s?jO.of((u,f)=>{let p=u.state.doc.lineAt(f).number;if(p>=0){let m=u.state.doc.line(p);if(m.text.trim())return u.lineIndent(m.from)}return 0}):[],...s?[Ht.of(qw(()=>to().tabsToSpaces))]:[],...Gw(to()),Ht.of(IU),l?Vc():[],dw(),Ht.of(fw),XS(),Yx(),Qe.allowMultipleSelections.of(!0),Mc(),PS(),ES(),Yc(),Wc(),Lc(),Nx(),Wd(),Lp({top:!0}),Ht.of(q1),d||[],a,rg,o?V.lineWrapping:[],Ba.field,c?[]:[lh.field,lh.gutter],s&&!c?[qa.field,qa.gutter,ch.field,ch.gutter]:[],dh.field,U1.gutter,V.updateListener.of(u=>{for(let f of u.transactions.flatMap(p=>p.effects))if(f.is(dh.requestToggle)&&vt.toggleSourceLine(this.path,f.value),f.is(uo.runToLine)){let p=f.value;if(this.sourcefile&&this.sourcefile.line2offset){let m=this.sourcefile.line2offset.get(p);m>=0&&Ha([m])}}}),ns.field,V1.field,uh.field,uo.field,uo.gutter,fh.field,Oh.field,ug,x1(u=>{window.location.hash="asseteditor/"+encodeURIComponent(this.path)+"/"+u}),re.embed?[]:S1(()=>{var u=K&&K.getToolFo
Line truncated
|
|
|
|
|
`).length-1;this.editor.dispatch({changes:{from:n,insert:e}}),this.highlightLines(i-1,i+s-2)}highlightLines(e,t){let i=this.editor.state.doc.line(e+1);this.editor.dispatch({effects:[fh.effect.of({start:e+1,end:t+1}),V.scrollIntoView(i.from,{y:"start",yMargin:100})]})}navigateToLine(e){if(e<1||e>this.editor.state.doc.lines)return;let t=this.editor.state.doc.line(e);this.editor.dispatch({selection:{anchor:t.from},effects:[fh.effect.of({start:e,end:e}),V.scrollIntoView(t.from,{y:"center"})]}),this.editor.focus()}getValue(){return this.editor.state.doc.toString()}getSelectionText(){return mg(this.editor)}getPath(){return this.path}markErrors(e){this.clearErrors(),e=e.slice(0,qU);let t=new Map,i=[];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&&i.push({line:o,start:n.start,end:n.end})}this.editor.dispatch({effects:[ns.set.of(t),uh.effect.of(i.length>0?i:null)]})}clearErrors(){this.dirtylisting=!0,this.editor.dispatch({effects:[ns.set.of(new Map),ns.showMessage.of(null),uh.effect.of(null)]})}getSourceFile(){return this.sourcefile}updateListing(){this.clearErrors();var e=this.sourcefile.lines||[];let t=new Map,i=new Map,n=new Map;for(var s of e)if(s.offset>=0&&t.set(s.line,be(s.offset&65535,4)),s.insns){var o=s.insns.length>9?"...":s.insns;if(i.set(s.line,o),s.iscode){if(s.cycles)n.set(s.line,s.cycles+"");else if(w.getOpcodeMetadata){var a=parseInt(s.insns.split(" ")[0],16),l=w.getOpcodeMetadata(a,s.offset);if(l&&l.minCycles){var c=l.minCycles+"";n.set(s.line,c)}}}}this.editor.dispatch({effects:[lh.set.of(t),qa.set.of(i),ch.set.of(n)]})}setTimingResult(e){if(this.sourcefile!=null){var t=new Map;for(let[o,a]of this.sourcefile.line2offset){let l=e.pc2clockrange[a];var i=l&&l.minclocks,n=l&&l.maxclocks;if(i>=0&&n>=0){var s;n==i?s=i+"":s=i+"-"+n,n==e.MAX_CLOCKS&&(s+="+"),t.set(o,s)}}this.editor.dispatch({effects:[qa.set.of(t)]})}}setCurrentLine(e,t){var i=n=>{this.editor.dispatch({effects:[uo.set.of(n.line),Ba.effect.of(n.line),...t?[V.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;if(i(e),t){let s=this.editor.state.doc.line(e.line).from+(e.start||0);this.editor.dispatch({selection:{anchor:s,head:s},effects:V.scrollIntoView(s,{y:"center"})})}this.currentDebugLine=e}}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:[uo.set.of(null),Ba.effect.of(null)]})}getActiveLine(){if(this.sourcefile){var e=yt&&yt.c;if(!e&&w.getCPUState&&!w.isRunning()&&(e=w.getCPUState()),e){var t=e&&(e.EPC||e.PC),i=this.sourcefile.findLineForOffset(t,fo);return i}}}refreshDebugState(e){var t=this.getActiveLine();!e&&(t===this.currentDebugLine||!t&&!this.currentDebugLine)||this.setCurrentLine(t,e)}refreshListing(){var e=K.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),this.updateTracedLines()}updateTracedLines(){let e=this.probe;if(!e||!e.idx||!this.sourcefile)return;let t=new Set;for(let i=0;i<e.idx;i++){let n=e.buf[i];if((n&4278190080)===16777216){let s=this.sourcefile.findLineForOffset(n&65535,fo);s&&t.add(s.line)}}e.clear(),this.editor.dispatch({effects:Oh.effect.of(Array.from(t))})}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.get(e);if(t>=0)return t;e--}return-1}undoStep(){wa(this.editor)}redoStep(){Hs(this.editor)}syncBreakpoints(){let e=vt.getSourceBreakpointsForFile(this.path).map(t=>({line:t.line,enabled:t.enabled}));this.editor.dispatch({effects:dh.setAll.of(e)})}};Na.tracingEnabled=!1;var jt=Na,Og=1024,_i=class{getSelectionText(){return mg(this.disasmview)}createDiv(e){var t=document.createElement("div");return t.setAttribute("class","editor"),e.appendChild(t),this.newEditor(t),t}newEditor(e){this.disasmview=new V({parent:e,extensions:[Yc(),Wc(),Qe.allowMultipleSelections.of(!0),Mc(),Lc(),Wd(),f1,eh,Ba.field,Qe.tabSize.of(8),Qe.readOnly.of(!0)]})}refresh(e,t){let i=yt||w.saveState(),n=t!==void 0?t:i.c?i.c.PC:0,s=0,o=0,a=w.debugSymbols&&w.debugSymbols.addr2symbol||{},l=(h,u)=>{let f="",p=0;for(;p<u;){let m=h+p|0,S=w.disassemble(m,w.readAddress.bind(w)),y="",A="";for(let T=0;T<S.nbytes;T++)y+=be(w.readAddress(m+T));for(;y.length<14;)y+=" ";let R=S.line;if(a&&S.isaddr&&(R=R.replace(/([^#])[$]([0-9A-F]+)/,(T,...P)=>{let C=parseInt(P[1],16),z=a[C];return z?P[0]+z:(z=a[
Line truncated
|
|
|
|
|
`;f+=U,m==n&&(o=s),s++,p+=S.nbytes||1}return f};var c=n<0?n-Og:Math.max(0,n-Og);let d=l(c,n-c)+l(n,Og);if(this.disasmview.dispatch({changes:{from:0,to:this.disasmview.state.doc.length,insert:d}}),e){let h=this.disasmview.state.doc.line(o+1);this.disasmview.dispatch({selection:{anchor:h.from,head:h.from},effects:V.scrollIntoView(h.from,{y:"center"})})}}goToAddress(e){e|=0,this.findAndSelectAddress(e)||(this.refresh(!1,e),this.findAndSelectAddress(e)),this.disasmview.focus()}findAndSelectAddress(e){let t=be(e,4),i=this.disasmview.state.doc;for(let n=1;n<=i.lines;n++){let s=i.line(n);if(s.text.startsWith(t+" "))return this.disasmview.dispatch({selection:{anchor:s.from,head:s.from+t.length},effects:V.scrollIntoView(s.from,{y:"center"})}),!0}return!1}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}},ph=class extends _i{constructor(e){super(),this.path=e}refreshListing(){var e=K.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}}),!!w.saveState){var i=yt||w.saveState(),n=i.c?i.c.EPC||i.c.PC:0;if(n>=0&&this.assemblyfile){var s=this.assemblyfile.findLineForOffset(n,fo);if(s&&e){let o=this.disasmview.state.doc.line(s.line);this.disasmview.dispatch({selection:{anchor:o.from,head:o.from},effects:V.scrollIntoView(o.from,{y:"center"})})}}}}}goToAddress(e){this.refreshListing();let t=this.assemblyfile&&this.assemblyfile.findLineForOffset(e,fo);if(t){let i=this.disasmview.state.doc.line(t.line);this.disasmview.dispatch({selection:{anchor:i.from,head:i.from},effects:V.scrollIntoView(i.from,{y:"center"})})}this.disasmview.focus()}};function H1(r){let e=[r];try{var t=zo(K.mainPath);t.length>0&&t!="local"&&e.push(t+"/"+r)}catch(s){}for(var i of e){var n=K&&K.getFile(i);if(typeof n=="string")return i}return null}function D1(r){for(var e of vb(r))if(e.editorStyle){var t=u1(e.editorStyle);if(t)return t}return null}var pg=new Map;function FU(r){let e=K.getToolForFilename(K.mainPath),t=jl(e,K.platform_id),i=Vl(e,K.platform_id);if(!t||!i.length)return Promise.resolve(null);let n=t+":"+r;return pg.has(n)||pg.set(n,(async()=>{var s=[...i.map(d=>d+"/"+r),r];for(var o of s){var a={preload_fs:t,readshared:o,updates:[],buildsteps:[]},l=await K.queryWorker(a),c=l&&l.output;if(c instanceof Uint8Array&&c.length>0)return new TextDecoder().decode(c)}return null})()),pg.get(n)}var On=class{constructor(e){this.fn=e;this.languageCompartment=new bt}getSelectionText(){return mg(this.view)}createDiv(e){var t=document.createElement("div");t.setAttribute("class","editor"),e.appendChild(t);var i=D1(this.fn||this.currentPath||"")||_a();return this.view=new V({parent:t,extensions:[Yc(),Wc(),Qe.allowMultipleSelections.of(!0),Mc(),Lc(),Wd(),Lp({top:!0}),Ht.of(q1),this.languageCompartment.of(i),th,rg,Qe.readOnly.of(!0)]}),this.refresh(!1),t}setVisible(e){e&&this.refresh(!1)}setHeaderText(e){var t=D1(this.currentPath||this.fn||"")||_a();this.view.dispatch({effects:this.languageCompartment.reconfigure(t),changes:{from:0,to:this.view.state.doc.length,insert:e}})}refresh(e){var t=this.fn;if(!t){var i=window.location.hash;if(!i||!i.startsWith("#headerview/"))return;t=this.fn=decodeURIComponent(i.substring(12))}this.loadIncludeFile(t)}async loadIncludeFile(e){this.requestedFn=e;var t=H1(e);if(t){this.currentPath=t,this.setHeaderText(K.getFile(t));return}var i=await FU(e);if(this.requestedFn===e){if(i!=null){this.currentPath=e,this.setHeaderText(i);return}this.currentPath=e,this.setHeaderText("// "+e+` was not found.
|
|
|
|
|
// Project include files are loaded during a build -- try building first.
|
|
|
|
|
// Toolchain headers are only available when the tool has a bundled filesystem.`)}}navigateToLine(e){if(!(!this.view||e<1)&&e<=this.view.state.doc.lines){let t=this.view.state.doc.line(e);this.view.dispatch({selection:{anchor:t.from},effects:[V.scrollIntoView(t.from,{y:"center"})]}),this.view.focus()}}};var ss=class{constructor(e){var t=document.createElement("div");t.setAttribute("class","memdump"),e.appendChild(t),this.maindiv=t}create(e,t,i){this.getLineAt=i,this.memorylist=new Ll({w:$(e).width(),h:$(e).height(),itemHeight:gg(),totalRows:t,generatorFn:n=>{var s=i(n),o=document.createElement("div");return o.appendChild(document.createTextNode(s.text)),s.clas!=null&&(o.className=s.clas),o}}),$(this.maindiv).append(this.memorylist.container)}refresh(){this.memorylist&&$(this.maindiv).find("[data-index]").each((e,t)=>{var i=t,n=parseInt(i.getAttribute("data-index")),s=i.innerText,o=this.getLineAt(n),a=o.text;if(s!=a&&(i.innerText=a,o.clas!=null&&!i.classList.contains(o.clas))){var l=Array.from(i.classList);l.forEach(c=>i.classList.remove(c)),i.classList.add("vrow"),i.classList.add(o.clas)}})}};function gg(){return $("#booksMenuButton").first().height()}function J1(r){return r.endsWith("_SIZE__")||r.endsWith("_LAST__")||r.endsWith("STACKSIZE__")||r.endsWith("FILEOFFS__")||r.startsWith("l__")||r.startsWith("s__")||r.startsWith(".__.")}var pn=class{constructor(){this.recreateOnResize=!0;this.hibits=0;this.totalRows=5120;this.gotoRow=-1}createDiv(e){var t=document.createElement("div");return t.setAttribute("class","memdump"),e.appendChild(t),this.showMemoryWindow(e,t),this.maindiv=t}showMemoryWindow(e,t){this.memorylist=new Ll({w:$(e).width(),h:$(e).height(),itemHeight:gg(),totalRows:this.totalRows,generatorFn:n=>{var s=this.getMemoryLineAt(n),o=document.createElement("div");if(this.dumplines){var a=this.dumplines[n];a&&o.classList.add("seg_"+this.getMemorySegment(this.dumplines[n].a|this.hibits))}return n==this.gotoRow&&o.classList.add("goto_line"),o.appendChild(document.createTextNode(s)),o}}),$(t).append(this.memorylist.container),this.tick();let i=$a();i&&this.dumplines&&this.scrollToAddress(i.data_start)}scrollToAddress(e){this.dumplines&&(this.hibits=e&4294901760,this.memorylist.scrollToItem(this.findMemoryWindowLine(e&65535)))}goToAddress(e){this.hibits=e&4294901760;var t=this.getDumpLines(),i;if(t&&t.length?i=this.findMemoryWindowLine(e&65535):i=(e&65535)>>4,i!==void 0){if(this.gotoRow=i,this.memorylist){var n=this.memorylist.container,s=i*this.memorylist.itemHeight-(n.clientHeight-this.memorylist.itemHeight)/2;n.scrollTop=Math.max(0,s)}this.tick()}}refresh(){this.dumplines=null,this.tick()}tick(){this.memorylist&&$(this.maindiv).find("[data-index]").each((e,t)=>{var i=$(t),n=parseInt(i.attr("data-index")),s=i.text(),o=this.getMemoryLineAt(n);s!=o&&i.text(o),i.toggleClass("goto_line",n==this.gotoRow)})}getMemoryLineAt(e){var t=e*16,i=0,n=16,s;if(this.getDumpLines()){var o=this.dumplines[e];if(o)t=o.a&65520,i=o.a-t,n=i+o.l,s=o.s;else return"."}for(var a=be(t+i,4)+" ",l=0;l<i;l++)a+=" ";i>8&&(a+=" ");for(var l=i;l<n;l++){var c=this.readAddress(t+l|this.hibits);l==8&&(a+=" "),a+=" "+(typeof c=="number"?be(c,2):"??")}for(var l=n;l<16;l++)a+=" ";return s&&(a+=" "+s),a}readAddress(e){return w.readAddress(e)}getDumpLineAt(e){var t=this.dumplines[e];if(t)return t.a+" "+t.s}getDumpLines(){var e=w.debugSymbols&&w.debugSymbols.addr2symbol||{};if(this.dumplines==null){this.dumplines=[];var t=0,i;for(let a of Object.keys(e)){var n=parseInt(a),s=e[n|this.hibits];if(i)for(J1(i)&&(i="");t<n&&this.dumplines.length<65536;){var o=t+16&1048560;o>n&&(o=n),this.dumplines.push({a:t,l:o-t,s:i}),t=o}i=s}}return this.dumplines}getMemorySegment(e){let t=$a();if(t){if(e>=t.data_start&&e<t.data_start+t.data_size)return w.getSP&&e>=w.getSP()-15?"stack":"data";if(e>=t.code_start&&e<t.code_start+(t.code_size||t.rom_size))return"code"}var i=K.segments;if(i){for(var n of i)if(e>=n.start&&e<n.start+n.size){if(n.type=="rom")return"code";if(n.type=="ram")return"data";if(n.type=="io")return"io"}}return"unknown"}findMemoryWindowLine(e){for(var t=0;t<this.dumplines.length;t++)if(this.dumplines[t].a>=e)return t}},mh=class extends pn{constructor(){super(...arguments);this.totalRows=2048}readAddress(t){return w.readVRAMAddress(t)}getMemorySegment(t){return"video"}getDumpLines(){return null}},Ka=class{constructor(e,t){this.recreateOnResize=!0;this.path=e,this.data=t}populateVlist(){$(this.vlist.maindiv).empty(),this.vlist.create(this.parent,this.data.length+15>>4,this.getMemoryLineAt.bind(this))}createDiv(e){return this.parent=e,this.vlist=new ss(this.parent),this.populateVlist(),this.vlist.maindiv}setData(e){this.data=e,this.populateVlist()}getMemoryLineAt(e){for(var t=e*16,i=0,n=16,s=be(t+i,4)+" ",o=0;o<i;o++)s+=" ";i>8&&(s+=" ");for(var o=i;o<n;o++){var a=this.data[t+o];o==8&&(s+=" "),s+=" "+(a>=0?be(a,2):" ")}return{text:s}}refresh(){this.vlist.refresh()}getPath(){return this.path}},gh=class{createDiv(e){return this.maindiv=Cr(e,"vert
Line truncated
|
|
|
|
|
// Toolchain headers are only available when the tool has a bundled filesystem.`)}}navigateToLine(e){if(!(!this.view||e<1)&&e<=this.view.state.doc.lines){let t=this.view.state.doc.line(e);this.view.dispatch({selection:{anchor:t.from},effects:[V.scrollIntoView(t.from,{y:"center"})]}),this.view.focus()}}};var ss=class{constructor(e){var t=document.createElement("div");t.setAttribute("class","memdump"),e.appendChild(t),this.maindiv=t}create(e,t,i){this.getLineAt=i,this.memorylist=new Ll({w:$(e).width(),h:$(e).height(),itemHeight:gg(),totalRows:t,generatorFn:n=>{var s=i(n),o=document.createElement("div");return o.appendChild(document.createTextNode(s.text)),s.clas!=null&&(o.className=s.clas),o}}),$(this.maindiv).append(this.memorylist.container)}refresh(){this.memorylist&&$(this.maindiv).find("[data-index]").each((e,t)=>{var i=t,n=parseInt(i.getAttribute("data-index")),s=i.innerText,o=this.getLineAt(n),a=o.text;if(s!=a&&(i.innerText=a,o.clas!=null&&!i.classList.contains(o.clas))){var l=Array.from(i.classList);l.forEach(c=>i.classList.remove(c)),i.classList.add("vrow"),i.classList.add(o.clas)}})}};function gg(){return $("#booksMenuButton").first().height()}function K1(r){return r.endsWith("_SIZE__")||r.endsWith("_LAST__")||r.endsWith("STACKSIZE__")||r.endsWith("FILEOFFS__")||r.startsWith("l__")||r.startsWith("s__")||r.startsWith(".__.")}var pn=class{constructor(){this.recreateOnResize=!0;this.hibits=0;this.totalRows=5120;this.gotoRow=-1}createDiv(e){var t=document.createElement("div");return t.setAttribute("class","memdump"),e.appendChild(t),this.showMemoryWindow(e,t),this.maindiv=t}showMemoryWindow(e,t){this.memorylist=new Ll({w:$(e).width(),h:$(e).height(),itemHeight:gg(),totalRows:this.totalRows,generatorFn:n=>{var s=this.getMemoryLineAt(n),o=document.createElement("div");if(this.dumplines){var a=this.dumplines[n];a&&o.classList.add("seg_"+this.getMemorySegment(this.dumplines[n].a|this.hibits))}return n==this.gotoRow&&o.classList.add("goto_line"),o.appendChild(document.createTextNode(s)),o}}),$(t).append(this.memorylist.container),this.tick();let i=$a();i&&this.dumplines&&this.scrollToAddress(i.data_start)}scrollToAddress(e){this.dumplines&&(this.hibits=e&4294901760,this.memorylist.scrollToItem(this.findMemoryWindowLine(e&65535)))}goToAddress(e){this.hibits=e&4294901760;var t=this.getDumpLines(),i;if(t&&t.length?i=this.findMemoryWindowLine(e&65535):i=(e&65535)>>4,i!==void 0){if(this.gotoRow=i,this.memorylist){var n=this.memorylist.container,s=i*this.memorylist.itemHeight-(n.clientHeight-this.memorylist.itemHeight)/2;n.scrollTop=Math.max(0,s)}this.tick()}}refresh(){this.dumplines=null,this.tick()}tick(){this.memorylist&&$(this.maindiv).find("[data-index]").each((e,t)=>{var i=$(t),n=parseInt(i.attr("data-index")),s=i.text(),o=this.getMemoryLineAt(n);s!=o&&i.text(o),i.toggleClass("goto_line",n==this.gotoRow)})}getMemoryLineAt(e){var t=e*16,i=0,n=16,s;if(this.getDumpLines()){var o=this.dumplines[e];if(o)t=o.a&65520,i=o.a-t,n=i+o.l,s=o.s;else return"."}for(var a=be(t+i,4)+" ",l=0;l<i;l++)a+=" ";i>8&&(a+=" ");for(var l=i;l<n;l++){var c=this.readAddress(t+l|this.hibits);l==8&&(a+=" "),a+=" "+(typeof c=="number"?be(c,2):"??")}for(var l=n;l<16;l++)a+=" ";return s&&(a+=" "+s),a}readAddress(e){return w.readAddress(e)}getDumpLineAt(e){var t=this.dumplines[e];if(t)return t.a+" "+t.s}getDumpLines(){var e=w.debugSymbols&&w.debugSymbols.addr2symbol||{};if(this.dumplines==null){this.dumplines=[];var t=0,i;for(let a of Object.keys(e)){var n=parseInt(a),s=e[n|this.hibits];if(i)for(K1(i)&&(i="");t<n&&this.dumplines.length<65536;){var o=t+16&1048560;o>n&&(o=n),this.dumplines.push({a:t,l:o-t,s:i}),t=o}i=s}}return this.dumplines}getMemorySegment(e){let t=$a();if(t){if(e>=t.data_start&&e<t.data_start+t.data_size)return w.getSP&&e>=w.getSP()-15?"stack":"data";if(e>=t.code_start&&e<t.code_start+(t.code_size||t.rom_size))return"code"}var i=K.segments;if(i){for(var n of i)if(e>=n.start&&e<n.start+n.size){if(n.type=="rom")return"code";if(n.type=="ram")return"data";if(n.type=="io")return"io"}}return"unknown"}findMemoryWindowLine(e){for(var t=0;t<this.dumplines.length;t++)if(this.dumplines[t].a>=e)return t}},mh=class extends pn{constructor(){super(...arguments);this.totalRows=2048}readAddress(t){return w.readVRAMAddress(t)}getMemorySegment(t){return"video"}getDumpLines(){return null}},Ka=class{constructor(e,t){this.recreateOnResize=!0;this.path=e,this.data=t}populateVlist(){$(this.vlist.maindiv).empty(),this.vlist.create(this.parent,this.data.length+15>>4,this.getMemoryLineAt.bind(this))}createDiv(e){return this.parent=e,this.vlist=new ss(this.parent),this.populateVlist(),this.vlist.maindiv}setData(e){this.data=e,this.populateVlist()}getMemoryLineAt(e){for(var t=e*16,i=0,n=16,s=be(t+i,4)+" ",o=0;o<i;o++)s+=" ";i>8&&(s+=" ");for(var o=i;o<n;o++){var a=this.data[t+o];o==8&&(s+=" "),s+=" "+(a>=0?be(a,2):" ")}return{text:s}}refresh(){this.vlist.refresh()}getPath(){return this.path}},gh=class{createDiv(e){return this.maindiv=Cr(e,"vert
Line truncated
|
|
|
|
|
`+s),n+=`
|
|
|
|
|
`+this.opToString(l,c,f))}),"X: "+t+" Y: "+i+" "+n}refresh(){this.tick(),this.datau32.fill(Kr)}tick(){super.tick(),this.drawImage()}drawImage(){this.ctx.putImageData(this.imageData,0,0)}clear(){this.datau32.fill(Kr)}},xh=class extends bh{createDiv(e){return this.createCanvas(e,256,256)}initCanvas(){super.initCanvas(),this.canvas.onclick=e=>{var t=Zl(this.canvas,e),i=Math.floor(t.x)+Math.floor(t.y)*256,n=-1,s=-1;this.redraw((o,a)=>{s<0&&n>=0&&a==i&&(s=n),o==16777216&&(n=a)}),s>=0&&Ha([s])}}clear(){for(var e=0;e<=65535;e++){var t=w.readAddress(e),i=t>>2|t&31;i|=i<<8|i<<16,this.datau32[e]=i|Kr}}drawEvent(e,t,i,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|Kr,this.datau32[t&65535]=l}}getTooltipText(e,t){var i=(e&255)+(t<<8),n="",s=-1,o={},a=null,l=[];return this.redraw((c,d,h,u,f,p)=>{switch(c){case 16777216:s=d,a=this.addr2symbol(d)||a;break;case 167772160:l.push(a);break;case 184549376:a=l.pop();break}var m=c|s;d==i&&!o[m]&&(n==""&&a&&(n+=`
|
|
|
|
|
`+a),n+=`
|
|
|
|
|
PC `+this.addr2str(s)+" "+this.opToString(c,null,p),o[m]=1)}),this.addr2str(i)+n}},xg=class extends bh{initCanvas(){super.initCanvas(),this.canvas.onclick=e=>{var t=Zl(this.canvas,e),i=Math.floor(t.x),n=Math.floor(t.y),s=this.getOpAtPos(t.x,t.y,16777216);s&&(Jr("toline"),w.runEval(()=>{let o=w.getRasterScanline&&w.getRasterScanline()>=n;return o&&w.getRasterLineClock?o&&w.getRasterLineClock()>i:o}))}}drawEvent(e,t,i,n){var s=this.getOpRGB(e,t);if(s){var o=i+n*this.canvas.width,a=s|Kr;this.datau32[o]|=a}}drawImage(){let e=Kr;for(let t=0;t<this.datau32.length;t++)this.datau32[t]==Kr?this.datau32[t]=e:e=this.datau32[t];super.drawImage()}},Sh=class extends xg{constructor(){super(...arguments);this.interrupt=0;this.rgb=0;this.lastpc=0}drawEvent(t,i,n,s){var o=n+s*this.canvas.width;if(t==134217728&&(this.interrupt=1),this.interrupt==1&&t==167772160&&(this.interrupt=i),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)-i>16&&(l+=1),Math.abs(this.lastpc)-i>256&&(l+=1),a=this.rgb=526344*l+2105376,this.lastpc=i}this.interrupt&&(a|=8388672),this.datau32[o]==Kr&&(this.datau32[o]=a|Kr)}}},wh=class extends mn{constructor(){super(...arguments);this.recreateOnResize=!0}createDiv(t){return this.vlist=new ss(t),this.vlist.create(t,this.cyclesPerLine*this.totalScanlines,this.getMemoryLineAt.bind(this)),this.vlist.maindiv}getMemoryLineAt(t){var i="",n="seg_data",s=this.dumplines&&this.dumplines[t];if(s!=null){var o=s.info.join(", ");i="("+si(s.row,4)+", "+si(s.col,4)+") "+Uo(s.asm||"",20)+o,o.indexOf("Write ")>=0&&(n="seg_io")}return{text:i,clas:n}}refresh(){this.tick()}tick(){let t=w instanceof Pu||w instanceof Qu;this.dumplines={},this.redraw((i,n,s,o,a,l)=>{t&&(a>>=2);var c=this.dumplines[a];switch(c==null&&(c={op:i,addr:n,row:o,col:s,asm:null,info:[]},this.dumplines[a]=c),i){case 16777216:if(w.disassemble){var d=w.disassemble(n,w.readAddress.bind(w));c.asm=d&&d.line}break;default:var h=this.opToString(i,n,l);h!=""&&c.info.push(h);break}}),this.vlist.refresh()}},vh=class extends mn{constructor(){super(...arguments);this.recreateOnResize=!0}createDiv(t){return this.vlist=new ss(t),this.vlist.create(t,this.totalScanlines,this.getMemoryLineAt.bind(this)),this.vlist.maindiv}getMemoryLineAt(t){for(var i=si(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 c=l&65535,d=d&Kr;if(d==16777216)i+=",";else{var h=be(c);i+=h,a+=h.length-1}}else i+=a==o?"|":"."}return s[-1]&&(i+=" "+s[-1]),{text:i,clas:n}}refresh(){this.tick()}tick(){let t=w instanceof Pu||w instanceof Qu;this.dumplines={},this.redraw((i,n,s,o,a,l)=>{var c=this.dumplines[o];switch(c==null&&(this.dumplines[o]=c=[]),i){case 16777216:var d=w.debugSymbols.addr2symbol[n];d&&(c[-1]=d);break;case 335544320:case 352321536:case 369098752:case 385875968:c[s]=i|n;break}}),this.vlist.refresh()}},yh=class extends mn{constructor(){super(...arguments);this.recreateOnResize=!0;this.cumulativeData=!0}createDiv(t){return w.debugSymbols&&w.debugSymbols.symbolmap?this.keys=Array.from(Object.keys(w.debugSymbols.symbolmap).filter(i=>!J1(i))):this.keys=["no symbols defined"],this.vlist=new ss(t),this.vlist.create(t,this.keys.length+1,this.getMemoryLineAt.bind(this)),this.vlist.maindiv}getMemoryLineAt(t){if(t==0)return{text:si("Symbol",35)+si("Reads",8)+si("Writes",8)};var i=this.keys[t-1],n=this.dumplines&&this.dumplines[i];function s(l){var c=n[l]|0;return si(c?c.toString():"",8)}var o,a;return n!=null?(o=si(i,35)+s(301989888)+s(318767104),n[16777216]?a="seg_code":n[335544320]||n[352321536]?a="seg_io":a="seg_data"):(o=si(i,35),a="seg_unknown"),{text:o,clas:a}}refresh(){this.tick()}tick(){this.dumplines={},this.redraw((t,i,n,s,o,a)=>{var l=w.debugSymbols.addr2symbol[i];if(l!=null){var c=this.dumplines[l];c==null&&(c={},this.dumplines[l]=c),c[t]=(c[t]|0)+1}}),this.vlist.refresh(),this.probe&&this.probe.clear()}},Qh=class{constructor(){this.editingId=null}createDiv(e){return this.maindiv=Cr(e,"vertical-scroll bp-view"),this.render(),this.maindiv[0]}refresh(e){this.render()}render(){let e=this.maindiv.empty(),t=rh(),i=this.editingId!=null?t.find(d=>d.bp.id==this.editingId):null,n=$('<div class="bp-form"/>'),s=$('<input type="text" class="bp-input" spellcheck="false"/>').attr("placeholder","address or symbol (e.g. $8000, mainloop)").val(i&&i.bp.type=="address"?i.bp.target:""),o=$('<input type="text" class="bp-input" spellcheck="false"/>').attr("placeholder","condition (e.g. A == $20 && X < 4)").val(i&&i.bp.condition||""),a=$('<button class="btn btn-default btn-xs bp-submit"/>').text(i?"Save":"Add"),l=$('<button class="btn btn-default btn-xs bp-submit"/>').text("Cancel");l.toggle(i!=
Line truncated
|
|
|
|
|
`)<0&&e.indexOf("\r")<0)return e.trim()}return""}function e5(r){var t;let e=r.record;if(e.source==="project"){let i=e.file;if(!i||!W.isWindow(i))return;let n=W.createOrShow(i);n instanceof jt&&e.line&&n.navigateToLine(e.line)}else if(e.source==="toolchain"){let i=e.file;if(!i)return;Ga(i);let n=W.createOrShow("#headerview/"+i);n instanceof On&&e.line&&n.navigateToLine(e.line)}else if(e.source==="debugger"){let i=(t=e.addr)!=null?t:-1;if(i<0)return;if(e.kind==="label"&&W.isWindow("#disasm")){let n=W.createOrShow("#disasm");n instanceof _i&&n.goToAddress(i)}else{let n=W.createOrShow("#memory");n instanceof pn&&n.goToAddress(i)}}else if(e.source==="docs"){let i=e.url||"";i.startsWith("#help/")?W.createOrShow(i):i&&window.open(i,"_blank")}}function Sg(){bootbox.dialog({title:"Search",onEscape:!0,message:`
|
|
|
|
|
PC `+this.addr2str(s)+" "+this.opToString(c,null,p),o[m]=1)}),this.addr2str(i)+n}},xg=class extends bh{initCanvas(){super.initCanvas(),this.canvas.onclick=e=>{var t=Zl(this.canvas,e),i=Math.floor(t.x),n=Math.floor(t.y),s=this.getOpAtPos(t.x,t.y,16777216);s&&(Jr("toline"),w.runEval(()=>{let o=w.getRasterScanline&&w.getRasterScanline()>=n;return o&&w.getRasterLineClock?o&&w.getRasterLineClock()>i:o}))}}drawEvent(e,t,i,n){var s=this.getOpRGB(e,t);if(s){var o=i+n*this.canvas.width,a=s|Kr;this.datau32[o]|=a}}drawImage(){let e=Kr;for(let t=0;t<this.datau32.length;t++)this.datau32[t]==Kr?this.datau32[t]=e:e=this.datau32[t];super.drawImage()}},Sh=class extends xg{constructor(){super(...arguments);this.interrupt=0;this.rgb=0;this.lastpc=0}drawEvent(t,i,n,s){var o=n+s*this.canvas.width;if(t==134217728&&(this.interrupt=1),this.interrupt==1&&t==167772160&&(this.interrupt=i),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)-i>16&&(l+=1),Math.abs(this.lastpc)-i>256&&(l+=1),a=this.rgb=526344*l+2105376,this.lastpc=i}this.interrupt&&(a|=8388672),this.datau32[o]==Kr&&(this.datau32[o]=a|Kr)}}},wh=class extends mn{constructor(){super(...arguments);this.recreateOnResize=!0}createDiv(t){return this.vlist=new ss(t),this.vlist.create(t,this.cyclesPerLine*this.totalScanlines,this.getMemoryLineAt.bind(this)),this.vlist.maindiv}getMemoryLineAt(t){var i="",n="seg_data",s=this.dumplines&&this.dumplines[t];if(s!=null){var o=s.info.join(", ");i="("+si(s.row,4)+", "+si(s.col,4)+") "+Uo(s.asm||"",20)+o,o.indexOf("Write ")>=0&&(n="seg_io")}return{text:i,clas:n}}refresh(){this.tick()}tick(){let t=w instanceof Pu||w instanceof Qu;this.dumplines={},this.redraw((i,n,s,o,a,l)=>{t&&(a>>=2);var c=this.dumplines[a];switch(c==null&&(c={op:i,addr:n,row:o,col:s,asm:null,info:[]},this.dumplines[a]=c),i){case 16777216:if(w.disassemble){var d=w.disassemble(n,w.readAddress.bind(w));c.asm=d&&d.line}break;default:var h=this.opToString(i,n,l);h!=""&&c.info.push(h);break}}),this.vlist.refresh()}},vh=class extends mn{constructor(){super(...arguments);this.recreateOnResize=!0}createDiv(t){return this.vlist=new ss(t),this.vlist.create(t,this.totalScanlines,this.getMemoryLineAt.bind(this)),this.vlist.maindiv}getMemoryLineAt(t){for(var i=si(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 c=l&65535,d=d&Kr;if(d==16777216)i+=",";else{var h=be(c);i+=h,a+=h.length-1}}else i+=a==o?"|":"."}return s[-1]&&(i+=" "+s[-1]),{text:i,clas:n}}refresh(){this.tick()}tick(){let t=w instanceof Pu||w instanceof Qu;this.dumplines={},this.redraw((i,n,s,o,a,l)=>{var c=this.dumplines[o];switch(c==null&&(this.dumplines[o]=c=[]),i){case 16777216:var d=w.debugSymbols.addr2symbol[n];d&&(c[-1]=d);break;case 335544320:case 352321536:case 369098752:case 385875968:c[s]=i|n;break}}),this.vlist.refresh()}},yh=class extends mn{constructor(){super(...arguments);this.recreateOnResize=!0;this.cumulativeData=!0}createDiv(t){return w.debugSymbols&&w.debugSymbols.symbolmap?this.keys=Array.from(Object.keys(w.debugSymbols.symbolmap).filter(i=>!K1(i))):this.keys=["no symbols defined"],this.vlist=new ss(t),this.vlist.create(t,this.keys.length+1,this.getMemoryLineAt.bind(this)),this.vlist.maindiv}getMemoryLineAt(t){if(t==0)return{text:si("Symbol",35)+si("Reads",8)+si("Writes",8)};var i=this.keys[t-1],n=this.dumplines&&this.dumplines[i];function s(l){var c=n[l]|0;return si(c?c.toString():"",8)}var o,a;return n!=null?(o=si(i,35)+s(301989888)+s(318767104),n[16777216]?a="seg_code":n[335544320]||n[352321536]?a="seg_io":a="seg_data"):(o=si(i,35),a="seg_unknown"),{text:o,clas:a}}refresh(){this.tick()}tick(){this.dumplines={},this.redraw((t,i,n,s,o,a)=>{var l=w.debugSymbols.addr2symbol[i];if(l!=null){var c=this.dumplines[l];c==null&&(c={},this.dumplines[l]=c),c[t]=(c[t]|0)+1}}),this.vlist.refresh(),this.probe&&this.probe.clear()}},Qh=class{constructor(){this.editingId=null}createDiv(e){return this.maindiv=Cr(e,"vertical-scroll bp-view"),this.render(),this.maindiv[0]}refresh(e){this.render()}render(){let e=this.maindiv.empty(),t=rh(),i=this.editingId!=null?t.find(d=>d.bp.id==this.editingId):null,n=$('<div class="bp-form"/>'),s=$('<input type="text" class="bp-input" spellcheck="false"/>').attr("placeholder","address or symbol (e.g. $8000, mainloop)").val(i&&i.bp.type=="address"?i.bp.target:""),o=$('<input type="text" class="bp-input" spellcheck="false"/>').attr("placeholder","condition (e.g. A == $20 && X < 4)").val(i&&i.bp.condition||""),a=$('<button class="btn btn-default btn-xs bp-submit"/>').text(i?"Save":"Add"),l=$('<button class="btn btn-default btn-xs bp-submit"/>').text("Cancel");l.toggle(i!=
Line truncated
|
|
|
|
|
`)<0&&e.indexOf("\r")<0)return e.trim()}return""}function KU(r){var t;let e=r.record;if(e.source==="project"){let i=e.file;if(!i||!W.isWindow(i))return;let n=W.createOrShow(i);n instanceof jt&&e.line&&n.navigateToLine(e.line)}else if(e.source==="toolchain"){let i=e.file;if(!i)return;Ga(i);let n=W.createOrShow("#headerview/"+i);n instanceof On&&e.line&&n.navigateToLine(e.line)}else if(e.source==="debugger"){let i=(t=e.addr)!=null?t:-1;if(i<0)return;if(e.kind==="label"&&W.isWindow("#disasm")){let n=W.createOrShow("#disasm");n instanceof _i&&n.goToAddress(i)}else{let n=W.createOrShow("#memory");n instanceof pn&&n.goToAddress(i)}}else if(e.source==="docs"){let i=e.url||"";i.startsWith("#help/")?W.createOrShow(i):i&&window.open(i,"_blank")}}function Sg(){bootbox.dialog({title:"Search",onEscape:!0,message:`
|
|
|
|
|
<div id="searchbox_form">
|
|
|
|
|
<input type="text" id="searchboxInput" class="form-control"
|
|
|
|
|
placeholder="Search symbols, files, docs"
|
|
|
|
|
autocomplete="off" style="margin-bottom:8px">
|
|
|
|
|
<div id="searchboxResults" style="max-height:340px;overflow-y:auto"></div>
|
|
|
|
|
</div>
|
|
|
|
|
`,buttons:{close:{label:"Close",className:"btn-default"}}}).one("shown.bs.modal",()=>{$("#searchboxInput").trigger("focus")});let e=$("#searchboxInput"),t=$("#searchboxResults"),i=[],n=-1,s=d=>{if(n=Math.max(-1,Math.min(d,i.length-1)),t.find("li.search-hit").each((h,u)=>{$(u).toggleClass("active",h===n)}),n>=0){let h=t[0],u=t.find("li.search-hit").eq(n);if(u.length){let f=u[0],p=h.getBoundingClientRect(),m=f.getBoundingClientRect(),S=m.top-p.top;S<0?h.scrollTop+=S:S+m.height>p.height&&(h.scrollTop+=S+m.height-p.height)}}},o=(d=n)=>{let h=i[d];h&&(e5(h),bootbox.hideAll())},a=d=>{if(i=d||[],i.length===0){n=-1,t.html('<div class="text-muted" style="padding:8px">No matches.</div>');return}let h=$('<ul class="list-group" style="margin-bottom:0"></ul>');for(let u of i){let f=u.record,p=f.source,m=f.kind==="func"?"\u0192":f.kind==="macro"?"#":f.kind==="label"?":":f.kind==="struct"?"S":f.kind==="enum"?"E":f.kind==="text"?"\u2261":"\u2022",S=f.source==="debugger"?be(f.addr,4):f.file&&f.line?`${f.file}:${f.line}`:f.file||"",y=f.kind!=="text",A=$('<li class="list-group-item search-hit" style="cursor:pointer;padding:6px 10px;display:flex;align-items:center;overflow:hidden"></li>');A.html(`<span class="search-kind" style="margin-right:6px;font-weight:bold;flex:0 0 auto">${m}</span><span class="search-name" style="flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">`+(y?`<strong>${$h(f.name)}</strong>`:`<span class="search-dumb">${$h(f.name)}</span>`)+(f.brief?` <span class="text-muted">- ${$h(f.brief)}</span>`:"")+`</span><span class="search-loc" style="flex:0 0 auto;margin-left:8px;font-style:italic;font-size:small;white-space:nowrap">${S?$h(S):""}</span>`),A.click(()=>{o(i.indexOf(u))}),h.append(A)}t.empty().append(h),s(0)},l=HU(async()=>{let d=e.val();if(!d){i=[],n=-1,t.empty();return}try{let h=await Av.query(d,KU),u=Ph(d,w&&w.debugSymbols&&w.debugSymbols.symbolmap);u&&rP(u,h.length>0)&&h.push(tP(d,u,K&&K.segments)),a(h)}catch(h){t.html('<div class="text-danger" style="padding:8px">Search failed.</div>')}},150);e.on("input",l),e.on("keydown",d=>{d.key==="ArrowDown"?(d.preventDefault(),s(n+1)):d.key==="ArrowUp"?(d.preventDefault(),s(n-1)):d.key==="Enter"?(d.preventDefault(),n>=0?o():l()):d.key==="Home"?(d.preventDefault(),s(0)):d.key==="End"&&(d.preventDefault(),s(i.length-1))});let c=JU();c&&(e.val(c),l())}var t5=800,r5=1e3,i5=16;function iP(r){return r.art?r.brev?0:7:null}var kh=/([0#]?)([x$%]|\d'h)([0-9a-f]+)(?:[;].*)?|(\d'b|0b)([01]+)/gim;function $g(r){return r.replace(/(\shex\s+)([0-9a-f]+)/ig,function(e,t,i){for(var n=t,s=0;s<i.length;s+=2)n+="0x"+i.substr(s,2)+",";return n})}function aP(r){for(var e=[],t;t=kh.exec(r);){var i;t[4]?i=parseInt(t[5],2):t[2].startsWith("%")?i=parseInt(t[3],2):t[2].startsWith("x")||t[2].startsWith("$")||t[2].endsWith("h")?i=parseInt(t[3],16):i=parseInt(t[3]),e.push(i)}return e}function n5(r,e,t){r=$g(r);for(var i="",n,s=0,o=0,a=Math.ceil(t/4);n=kh.exec(r);)i+=r.slice(s,kh.lastIndex-n[0].length),s=kh.lastIndex,n[4]?i+=n[4]+xu(e[o++],parseInt(n[4])):n[2].startsWith("%")?i+=n[1]+n[2]+xu(e[o++],t):n[2].endsWith("h")?i+=n[1]+n[2]+be(e[o++],parseInt(n[2])):n[2].startsWith("x")?i+=n[1]+"x"+be(e[o++],a):n[2].startsWith("$")?i+=n[1]+"$"+be(e[o++],a):i+=n[1]+e[o++].toString();return i+=r.slice(s),i=i.replace(/(\shex\s+)([,x0-9a-f]+)/ig,(l,c,d)=>{var h=c+d;return h=h.replace(/0x/ig,"").replace(/,/ig,""),h}),i}function kg(r,e){if(!e)return r;for(var t=0,i=0;i<e.length;i++){var n=e[i];n<0&&(n=-n-1,t^=1<<n),r&1<<i&&(t^=1<<n)}return t}function Tg(r,e){var t=e[r%e.length];return[t>>3,t&7]}var s5=[[0,0,4],[8,0,0]],o5=[[0,8,12],[8,8,0],[16,8,4],[24,8,8],[32,0,12],[40,0,0],[48,0,4],[56,0,8]];function a5(r,e,t,i,n,s){for(var o=0;o<8;o++)for(var a=r[e+o]||0,l=0;l<4;l++){var c=(3-l)*s+(7-o),d=a>>l&1|(a>>l+4&1)<<1;t[n*s+i+c]=d}}function l5(r,e,t,i,n,s){for(var o=0;o<8;o++){for(var a=0,l=0;l<4;l++){var c=(3-l)*s+(7-o),d=(t[n*s+i+c]||0)&3;d&1&&(a|=1<<l),d&2&&(a|=1<<l+4)}r[e+o]=a}}function Xg(r){return r.w===16&&r.h===16?o5:s5}function lP(r){return Xg(r).length*8}function c5(r,e){for(var t=e.w,i=e.h,n=e.count||1,s=e.wpimg||lP(e),o=Xg(e),a=[],l=0;l<n;l++){for(var c=new Array(t*i).fill(0),d=l*s,h=0;h<o.length;h++){var[u,f,p]=o[h];a5(r,d+u,c,f,p,t)}a.push(new Uint8Array(c))}return a}function d5(r,e){for(var t=e.w,i=e.h,n=e.count||r.length,s=e.wpimg||lP(e),o=Xg(e),a=new Array(s*n).fill(0),l=0;l<n;l++)for(var c=r[l]||new Uint8Array(t*i),d=l*s,h=0;h<o.length;h++){var[u,f,p]=o[h];l5(a,d+u,c,f,p,t)}return a}function h5(r,e){if(e.pacstrip)return c5(r,e);var t=e.w,i=e.h,n=e.count||1,s=e.bpp||1,o=e.np||1,a=e.bpw||8,l=e.sl||Math.ceil(t*s/a),c=(1<<s)-1,d=e.pofs||l*i*n,h=e.skip||0,u=e.wpimg||l*i,f=l;e.il&&(u=l,f=l*n);for(var p=[],m=0;m<n;m++){for(var S=[],y=0;y<i;y++)for(var A=e.flip?i-1-y:y,R=u*m+A*f,U=0,T=0;T<t;T++){var P=0,C=kg(R,e.remap);e.reindex&&([C,U]=Tg(T,e.reindex),C+=R);for(var z=0;z<o;z++){var q=r[C+z*d+h];P|=((e.brev?q>>a-U-s:q>>U)&c)<<z*s}S.push(P),U+=s,U>=a&&!e.reindex&Line truncated
|
|
|
|
|
`&&t++;return t}function uP(r,e){for(var t=/[/;][*;]([{].+[}])[*;][/;]/g,i=[],n;n=t.exec(r);){var s=n.index+n[0].length,o;e?o=r.indexOf("end",s):n[0].startsWith(";;")?(o=r.indexOf(";;",s),o==r.indexOf(";;{",s)&&(o=-1)):o=r.indexOf(";",s);var a=nP(r,n.index),l=n[0],c=o>=0?nP(r,o):"???";if(o<0){var d=e?'"end"':n[0].startsWith(";;")?'";;"':'";"';i.push({header:l,startline:a,endline:c,error:`No closing ${d} found after asset header`})}else if(o<=s)i.push({header:l,startline:a,endline:c,error:"Empty data block after asset header"});else try{var h=n[1].replace(/([A-Za-z]+):/g,'"$1":'),u=JSON.parse(h),f=/#embed\s+"(.+?)"/.exec(r.substring(s,o)),p=f?f[1]:void 0;i.push({header:l,startline:a,endline:c,fmt:u,start:s,end:o,embedFile:p})}catch(m){i.push({header:l,startline:a,endline:c,error:`Invalid asset format: ${m.message}`})}}return i}function fP(r,e,t){if(t(e))return e;var i=r.lastIndexOf("/");if(i>=0){var n=r.substring(0,i+1)+e;if(t(n))return n}return null}function u5(r,e){if(e.destfmt&&(e=e.destfmt),e.pacstrip)return d5(r,e);var t=e.w,i=e.h,n=e.count||1,s=e.bpp||1,o=e.np||1,a=e.bpw||8,l=e.sl||Math.ceil(e.w*s/a),c=(1<<s)-1,d=e.pofs||l*i*n,h=e.skip||0,u=e.wpimg||l*i,f=l;e.il&&(u=l,f=l*n);var p=e.il?f*i:u*n,m;o>0&&e.sl?m=new Uint8Array(p):a<=8?m=new Uint8Array(p*o):m=new Uint32Array(p*o);for(var S=0;S<n;S++)for(var y=r[S],A=0,R=0;R<i;R++)for(var U=e.flip?i-1-R:R,T=S*u+U*f,P=0,C=0;C<t;C++){var z=y[A++],q=kg(T,e.remap);e.reindex&&([q,P]=Tg(C,e.reindex),q+=T);for(var ne=0;ne<o;ne++){var se=z>>ne*s&c;m[q+ne*d+h]|=e.brev?se<<a-P-s:se<<P}P+=s,P>=a&&!e.reindex&&(T+=1,P=0)}return m}function sP(r,e,t,i,n,s,o){for(var a=[],l=0;l<r.length;l++){var c=r[l],d=4278190080;d|=(c>>e&(1<<t)-1)<<8-t,d|=(c>>i&(1<<n)-1)<<16-n,d|=(c>>s&(1<<o)-1)<<24-o,a.push(d)}return a}function f5(r){var e=(r>>0&1)*33+(r>>1&1)*71+(r>>2&1)*151,t=(r>>3&1)*33+(r>>4&1)*71+(r>>5&1)*151,i=(r>>6&1)*81+(r>>7&1)*174;return 4278190080|i<<16|t<<8|e}function O5(r){var e=r.pal;if(typeof e=="number"){var t=Math.floor(Math.abs(e/100)%10),i=Math.floor(Math.abs(e/10)%10),n=Math.floor(Math.abs(e)%10);return 1<<t+i+n}else{if(e==="pacman")return 256;var s=OP[e];if(s)return s.length;throw new Error("No palette named "+e)}}function wg(r,e){var t=e.pal,i;if(typeof t=="number"){var n=Math.floor(Math.abs(t/100)%10),s=Math.floor(Math.abs(t/10)%10),o=Math.floor(Math.abs(t)%10);t>=0?i=sP(r,0,n,n,s,n+s,o):i=sP(r,n+s,o,n,s,0,n)}else if(t==="pacman"){i=[];for(var a=0;a<r.length;a++)i.push(f5(r[a]))}else{var l=OP[t];if(l)i=new Uint32Array(r).map(c=>l[c&l.length-1]|4278190080);else throw new Error("No palette named "+t)}return i}function el(r){var e=r.pal;if(typeof e!="number"||!isFinite(e))return null;var t=Math.floor(Math.abs(e/100)%10),i=Math.floor(Math.abs(e/10)%10),n=Math.floor(Math.abs(e)%10);return t+i+n<=0?null:e>=0?{r:t,g:i,b:n,rshift:0,gshift:t,bshift:t+i}:{r:n,g:i,b:t,rshift:t+i,gshift:t,bshift:0}}function oP(r,e,t,i){var n=el(r);return n?(e&(1<<n.r)-1)<<n.rshift|(t&(1<<n.g)-1)<<n.gshift|(i&(1<<n.b)-1)<<n.bshift:0}function p5(r,e){var t=el(r);return t?{r:e>>t.rshift&(1<<t.r)-1,g:e>>t.gshift&(1<<t.g)-1,b:e>>t.bshift&(1<<t.b)-1}:null}var OP={gb:[13686916,8890444,5401396,2961698],nes:[5395026,11796480,10485760,11599933,7602281,91,95,6208,12048,543240,26368,1196544,7153664,0,0,0,12899815,16728064,14421538,16729963,14090399,6818519,6588,21681,27227,35843,43776,2918400,10777088,0,0,0,16316664,16755516,16742785,16735173,16730354,14633471,4681215,46327,57599,58229,259115,7911470,15065624,7895160,0,0,16777215,16773822,16300216,16300248,16758527,16761855,13095423,10148607,8973816,8650717,12122296,16119980,16777136,16308472,0,0],ap2lores:[0,16711935,127,8323199,32512,8355711,191,255,12549888,16760576,12566463,16744319,65280,16776960,49023,16777215],vcs:[0,0,4210752,4210752,7105644,7105644,9474192,9474192,11579568,11579568,13158600,13158600,14474460,14474460,16053492,16053492,17476,17476,1074276,1074276,2393220,2393220,3448992,3448992,4241592,4241592,5296336,5296336,6088936,6088936,6880508,6880508,10352,10352,1328260,1328260,2645144,2645144,3963052,3963052,5016764,5016764,6070476,6070476,6862044,6862044,7915756,7915756,6276,6276,1586328,1586328,3166380,3166380,4745408,4745408,6062288,6062288,7378144,7378144,8431852,8431852,9747708,9747708,136,136,2105500,2105500,3947696,3947696,5789888,5789888,7368912,7368912,8947936,8947936,10526956,10526956,11842812,11842812,6029432,6029432,7610508,7610508,8928416,8928416,10246320,10246320,11563200,11563200,12616912,12616912,13671644,13671644,14725356,14725356,7864392,7864392,9445472,9445472,10763384,10763384,12081292,12081292,13398176,13398176,14451892,14451892,15506628,15506628,16560340,16560340,8650772,8650772,9969712,9969712,11287628,11287628,12605544,12605544,13660284,13660284,14715028,14715028,15507624,15507624,16561340,16561340,8912896,8912896,10231836,10231836,11550776,11550776,12606544,12606544,13661288,13661288,14716028,14716028,15508624,15508624,16562340,16562340,8132608,8132608,9451548,9451548,11031608,11031608,12349520,12349520,13404264,1
Line truncated
|
|
|
|
|
`,buttons:{close:{label:"Close",className:"btn-default"}}}).one("shown.bs.modal",()=>{$("#searchboxInput").trigger("focus")});let e=$("#searchboxInput"),t=$("#searchboxResults"),i=[],n=-1,s=d=>{if(n=Math.max(-1,Math.min(d,i.length-1)),t.find("li.search-hit").each((h,u)=>{$(u).toggleClass("active",h===n)}),n>=0){let h=t[0],u=t.find("li.search-hit").eq(n);if(u.length){let f=u[0],p=h.getBoundingClientRect(),m=f.getBoundingClientRect(),S=m.top-p.top;S<0?h.scrollTop+=S:S+m.height>p.height&&(h.scrollTop+=S+m.height-p.height)}}},o=(d=n)=>{let h=i[d];h&&(KU(h),bootbox.hideAll())},a=d=>{if(i=d||[],i.length===0){n=-1,t.html('<div class="text-muted" style="padding:8px">No matches.</div>');return}let h=$('<ul class="list-group" style="margin-bottom:0"></ul>');for(let u of i){let f=u.record,p=f.source,m=f.kind==="func"?"\u0192":f.kind==="macro"?"#":f.kind==="label"?":":f.kind==="struct"?"S":f.kind==="enum"?"E":f.kind==="text"?"\u2261":"\u2022",S=f.source==="debugger"?be(f.addr,4):f.file&&f.line?`${f.file}:${f.line}`:f.file||"",y=f.kind!=="text",A=$('<li class="list-group-item search-hit" style="cursor:pointer;padding:6px 10px;display:flex;align-items:center;overflow:hidden"></li>');A.html(`<span class="search-kind" style="margin-right:6px;font-weight:bold;flex:0 0 auto">${m}</span><span class="search-name" style="flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">`+(y?`<strong>${$h(f.name)}</strong>`:`<span class="search-dumb">${$h(f.name)}</span>`)+(f.brief?` <span class="text-muted">- ${$h(f.brief)}</span>`:"")+`</span><span class="search-loc" style="flex:0 0 auto;margin-left:8px;font-style:italic;font-size:small;white-space:nowrap">${S?$h(S):""}</span>`),A.click(()=>{o(i.indexOf(u))}),h.append(A)}t.empty().append(h),s(0)},l=NU(async()=>{let d=e.val();if(!d){i=[],n=-1,t.empty();return}try{let h=await Cv.query(d,GU),u=Ph(d,w&&w.debugSymbols&&w.debugSymbols.symbolmap);u&&tP(u,h.length>0)&&h.push(eP(d,u,K&&K.segments)),a(h)}catch(h){t.html('<div class="text-danger" style="padding:8px">Search failed.</div>')}},150);e.on("input",l),e.on("keydown",d=>{d.key==="ArrowDown"?(d.preventDefault(),s(n+1)):d.key==="ArrowUp"?(d.preventDefault(),s(n-1)):d.key==="Enter"?(d.preventDefault(),n>=0?o():l()):d.key==="Home"?(d.preventDefault(),s(0)):d.key==="End"&&(d.preventDefault(),s(i.length-1))});let c=HU();c&&(e.val(c),l())}var JU=800,e5=1e3,t5=16;function rP(r){return r.art?r.brev?0:7:null}var kh=/([0#]?)([x$%]|\d'h)([0-9a-f]+)(?:[;].*)?|(\d'b|0b)([01]+)/gim;function $g(r){return r.replace(/(\shex\s+)([0-9a-f]+)/ig,function(e,t,i){for(var n=t,s=0;s<i.length;s+=2)n+="0x"+i.substr(s,2)+",";return n})}function oP(r){for(var e=[],t;t=kh.exec(r);){var i;t[4]?i=parseInt(t[5],2):t[2].startsWith("%")?i=parseInt(t[3],2):t[2].startsWith("x")||t[2].startsWith("$")||t[2].endsWith("h")?i=parseInt(t[3],16):i=parseInt(t[3]),e.push(i)}return e}function r5(r,e,t){r=$g(r);for(var i="",n,s=0,o=0,a=Math.ceil(t/4);n=kh.exec(r);)i+=r.slice(s,kh.lastIndex-n[0].length),s=kh.lastIndex,n[4]?i+=n[4]+xu(e[o++],parseInt(n[4])):n[2].startsWith("%")?i+=n[1]+n[2]+xu(e[o++],t):n[2].endsWith("h")?i+=n[1]+n[2]+be(e[o++],parseInt(n[2])):n[2].startsWith("x")?i+=n[1]+"x"+be(e[o++],a):n[2].startsWith("$")?i+=n[1]+"$"+be(e[o++],a):i+=n[1]+e[o++].toString();return i+=r.slice(s),i=i.replace(/(\shex\s+)([,x0-9a-f]+)/ig,(l,c,d)=>{var h=c+d;return h=h.replace(/0x/ig,"").replace(/,/ig,""),h}),i}function kg(r,e){if(!e)return r;for(var t=0,i=0;i<e.length;i++){var n=e[i];n<0&&(n=-n-1,t^=1<<n),r&1<<i&&(t^=1<<n)}return t}function Tg(r,e){var t=e[r%e.length];return[t>>3,t&7]}var i5=[[0,0,4],[8,0,0]],n5=[[0,8,12],[8,8,0],[16,8,4],[24,8,8],[32,0,12],[40,0,0],[48,0,4],[56,0,8]];function s5(r,e,t,i,n,s){for(var o=0;o<8;o++)for(var a=r[e+o]||0,l=0;l<4;l++){var c=(3-l)*s+(7-o),d=a>>l&1|(a>>l+4&1)<<1;t[n*s+i+c]=d}}function o5(r,e,t,i,n,s){for(var o=0;o<8;o++){for(var a=0,l=0;l<4;l++){var c=(3-l)*s+(7-o),d=(t[n*s+i+c]||0)&3;d&1&&(a|=1<<l),d&2&&(a|=1<<l+4)}r[e+o]=a}}function Xg(r){return r.w===16&&r.h===16?n5:i5}function aP(r){return Xg(r).length*8}function a5(r,e){for(var t=e.w,i=e.h,n=e.count||1,s=e.wpimg||aP(e),o=Xg(e),a=[],l=0;l<n;l++){for(var c=new Array(t*i).fill(0),d=l*s,h=0;h<o.length;h++){var[u,f,p]=o[h];s5(r,d+u,c,f,p,t)}a.push(new Uint8Array(c))}return a}function l5(r,e){for(var t=e.w,i=e.h,n=e.count||r.length,s=e.wpimg||aP(e),o=Xg(e),a=new Array(s*n).fill(0),l=0;l<n;l++)for(var c=r[l]||new Uint8Array(t*i),d=l*s,h=0;h<o.length;h++){var[u,f,p]=o[h];o5(a,d+u,c,f,p,t)}return a}function c5(r,e){if(e.pacstrip)return a5(r,e);var t=e.w,i=e.h,n=e.count||1,s=e.bpp||1,o=e.np||1,a=e.bpw||8,l=e.sl||Math.ceil(t*s/a),c=(1<<s)-1,d=e.pofs||l*i*n,h=e.skip||0,u=e.wpimg||l*i,f=l;e.il&&(u=l,f=l*n);for(var p=[],m=0;m<n;m++){for(var S=[],y=0;y<i;y++)for(var A=e.flip?i-1-y:y,R=u*m+A*f,U=0,T=0;T<t;T++){var P=0,C=kg(R,e.remap);e.reindex&&([C,U]=Tg(T,e.reindex),C+=R);for(var z=0;z<o;z++){var q=r[C+z*d+h];P|=((e.brev?q>>a-U-s:q>>U)&c)<<z*s}S.push(P),U+=s,U>=a&&!e.reindex&Line truncated
|
|
|
|
|
`&&t++;return t}function hP(r,e){for(var t=/[/;][*;]([{].+[}])[*;][/;]/g,i=[],n;n=t.exec(r);){var s=n.index+n[0].length,o;e?o=r.indexOf("end",s):n[0].startsWith(";;")?(o=r.indexOf(";;",s),o==r.indexOf(";;{",s)&&(o=-1)):o=r.indexOf(";",s);var a=iP(r,n.index),l=n[0],c=o>=0?iP(r,o):"???";if(o<0){var d=e?'"end"':n[0].startsWith(";;")?'";;"':'";"';i.push({header:l,startline:a,endline:c,error:`No closing ${d} found after asset header`})}else if(o<=s)i.push({header:l,startline:a,endline:c,error:"Empty data block after asset header"});else try{var h=n[1].replace(/([A-Za-z]+):/g,'"$1":'),u=JSON.parse(h),f=/#embed\s+"(.+?)"/.exec(r.substring(s,o)),p=f?f[1]:void 0;i.push({header:l,startline:a,endline:c,fmt:u,start:s,end:o,embedFile:p})}catch(m){i.push({header:l,startline:a,endline:c,error:`Invalid asset format: ${m.message}`})}}return i}function uP(r,e,t){if(t(e))return e;var i=r.lastIndexOf("/");if(i>=0){var n=r.substring(0,i+1)+e;if(t(n))return n}return null}function d5(r,e){if(e.destfmt&&(e=e.destfmt),e.pacstrip)return l5(r,e);var t=e.w,i=e.h,n=e.count||1,s=e.bpp||1,o=e.np||1,a=e.bpw||8,l=e.sl||Math.ceil(e.w*s/a),c=(1<<s)-1,d=e.pofs||l*i*n,h=e.skip||0,u=e.wpimg||l*i,f=l;e.il&&(u=l,f=l*n);var p=e.il?f*i:u*n,m;o>0&&e.sl?m=new Uint8Array(p):a<=8?m=new Uint8Array(p*o):m=new Uint32Array(p*o);for(var S=0;S<n;S++)for(var y=r[S],A=0,R=0;R<i;R++)for(var U=e.flip?i-1-R:R,T=S*u+U*f,P=0,C=0;C<t;C++){var z=y[A++],q=kg(T,e.remap);e.reindex&&([q,P]=Tg(C,e.reindex),q+=T);for(var ne=0;ne<o;ne++){var se=z>>ne*s&c;m[q+ne*d+h]|=e.brev?se<<a-P-s:se<<P}P+=s,P>=a&&!e.reindex&&(T+=1,P=0)}return m}function nP(r,e,t,i,n,s,o){for(var a=[],l=0;l<r.length;l++){var c=r[l],d=4278190080;d|=(c>>e&(1<<t)-1)<<8-t,d|=(c>>i&(1<<n)-1)<<16-n,d|=(c>>s&(1<<o)-1)<<24-o,a.push(d)}return a}function h5(r){var e=(r>>0&1)*33+(r>>1&1)*71+(r>>2&1)*151,t=(r>>3&1)*33+(r>>4&1)*71+(r>>5&1)*151,i=(r>>6&1)*81+(r>>7&1)*174;return 4278190080|i<<16|t<<8|e}function u5(r){var e=r.pal;if(typeof e=="number"){var t=Math.floor(Math.abs(e/100)%10),i=Math.floor(Math.abs(e/10)%10),n=Math.floor(Math.abs(e)%10);return 1<<t+i+n}else{if(e==="pacman")return 256;var s=fP[e];if(s)return s.length;throw new Error("No palette named "+e)}}function wg(r,e){var t=e.pal,i;if(typeof t=="number"){var n=Math.floor(Math.abs(t/100)%10),s=Math.floor(Math.abs(t/10)%10),o=Math.floor(Math.abs(t)%10);t>=0?i=nP(r,0,n,n,s,n+s,o):i=nP(r,n+s,o,n,s,0,n)}else if(t==="pacman"){i=[];for(var a=0;a<r.length;a++)i.push(h5(r[a]))}else{var l=fP[t];if(l)i=new Uint32Array(r).map(c=>l[c&l.length-1]|4278190080);else throw new Error("No palette named "+t)}return i}function el(r){var e=r.pal;if(typeof e!="number"||!isFinite(e))return null;var t=Math.floor(Math.abs(e/100)%10),i=Math.floor(Math.abs(e/10)%10),n=Math.floor(Math.abs(e)%10);return t+i+n<=0?null:e>=0?{r:t,g:i,b:n,rshift:0,gshift:t,bshift:t+i}:{r:n,g:i,b:t,rshift:t+i,gshift:t,bshift:0}}function sP(r,e,t,i){var n=el(r);return n?(e&(1<<n.r)-1)<<n.rshift|(t&(1<<n.g)-1)<<n.gshift|(i&(1<<n.b)-1)<<n.bshift:0}function f5(r,e){var t=el(r);return t?{r:e>>t.rshift&(1<<t.r)-1,g:e>>t.gshift&(1<<t.g)-1,b:e>>t.bshift&(1<<t.b)-1}:null}var fP={gb:[13686916,8890444,5401396,2961698],nes:[5395026,11796480,10485760,11599933,7602281,91,95,6208,12048,543240,26368,1196544,7153664,0,0,0,12899815,16728064,14421538,16729963,14090399,6818519,6588,21681,27227,35843,43776,2918400,10777088,0,0,0,16316664,16755516,16742785,16735173,16730354,14633471,4681215,46327,57599,58229,259115,7911470,15065624,7895160,0,0,16777215,16773822,16300216,16300248,16758527,16761855,13095423,10148607,8973816,8650717,12122296,16119980,16777136,16308472,0,0],ap2lores:[0,16711935,127,8323199,32512,8355711,191,255,12549888,16760576,12566463,16744319,65280,16776960,49023,16777215],vcs:[0,0,4210752,4210752,7105644,7105644,9474192,9474192,11579568,11579568,13158600,13158600,14474460,14474460,16053492,16053492,17476,17476,1074276,1074276,2393220,2393220,3448992,3448992,4241592,4241592,5296336,5296336,6088936,6088936,6880508,6880508,10352,10352,1328260,1328260,2645144,2645144,3963052,3963052,5016764,5016764,6070476,6070476,6862044,6862044,7915756,7915756,6276,6276,1586328,1586328,3166380,3166380,4745408,4745408,6062288,6062288,7378144,7378144,8431852,8431852,9747708,9747708,136,136,2105500,2105500,3947696,3947696,5789888,5789888,7368912,7368912,8947936,8947936,10526956,10526956,11842812,11842812,6029432,6029432,7610508,7610508,8928416,8928416,10246320,10246320,11563200,11563200,12616912,12616912,13671644,13671644,14725356,14725356,7864392,7864392,9445472,9445472,10763384,10763384,12081292,12081292,13398176,13398176,14451892,14451892,15506628,15506628,16560340,16560340,8650772,8650772,9969712,9969712,11287628,11287628,12605544,12605544,13660284,13660284,14715028,14715028,15507624,15507624,16561340,16561340,8912896,8912896,10231836,10231836,11550776,11550776,12606544,12606544,13661288,13661288,14716028,14716028,15508624,15508624,16562340,16562340,8132608,8132608,9451548,9451548,11031608,11031608,12349520,12349520,13404264,1
Line truncated
|
|
|
|
|
<p>The 8bitworkshop IDE is a browser-based development environment for
|
|
|
|
|
micro computers and consoles.
|
|
|
|
|
The IDE compiles or assembles your source code
|
|
|
|
@@ -303,7 +303,7 @@ layout and your previous pane sizes.</p>
|
|
|
|
|
status bar at the bottom of the window (toggle it under
|
|
|
|
|
<strong>Settings \xBB Show keyboard shortcuts / status bar</strong>).</p>
|
|
|
|
|
<p>See <a href="editor.md">Editor</a> for editor-specific shortcuts.</p>
|
|
|
|
|
`;var bP=`<h1>Editor</h1>
|
|
|
|
|
`;var gP=`<h1>Editor</h1>
|
|
|
|
|
<p>The source editor is based on <a href="https://codemirror.net/">CodeMirror 6</a>.
|
|
|
|
|
Syntax highlighting is chosen from the toolchain that handles the file\u2019s
|
|
|
|
|
extension, so a <code>.c</code> file opens as C, a <code>.ca65</code> file as 6502 assembly,
|
|
|
|
@@ -380,7 +380,7 @@ filesystem in a read-only viewer.</li>
|
|
|
|
|
<p>The editor also inherits the standard <a href="https://codemirror.net/">CodeMirror 6</a> keymap,
|
|
|
|
|
including cursor/word movement and selection with the arrow keys, and cut/
|
|
|
|
|
copy/paste (<code>mod+X</code>, <code>mod+C</code>, <code>mod+V</code>).</p>
|
|
|
|
|
`;var xP=`<h1>Disassembly</h1>
|
|
|
|
|
`;var bP=`<h1>Disassembly</h1>
|
|
|
|
|
<p>The Disassembly window disassembles machine code around the current
|
|
|
|
|
program counter. It is available on platforms that expose both a
|
|
|
|
|
disassembler and a savable CPU state.</p>
|
|
|
|
@@ -429,7 +429,7 @@ from the tool\u2019s own output; see <a href="editor.md">Editor</a>. The listing
|
|
|
|
|
the program counter using the line-to-address map from the assembler,
|
|
|
|
|
which is more accurate for source-level navigation than the live
|
|
|
|
|
disassembly.</p>
|
|
|
|
|
`;var SP=`<h1>Memory Browser</h1>
|
|
|
|
|
`;var xP=`<h1>Memory Browser</h1>
|
|
|
|
|
<p>The Memory Browser shows a hex dump of CPU memory. It is available on
|
|
|
|
|
platforms that implement <code>readAddress</code>.</p>
|
|
|
|
|
<p>The dump is laid out 16 bytes per row:</p>
|
|
|
|
@@ -448,7 +448,7 @@ row containing it.</li>
|
|
|
|
|
<li>Clicking a segment in the <a href="memmap.md">Memory Map</a> opens this
|
|
|
|
|
window and scrolls to that segment\u2019s start address.</li>
|
|
|
|
|
</ul>
|
|
|
|
|
`;var wP=`<h1>Memory Map</h1>
|
|
|
|
|
`;var SP=`<h1>Memory Map</h1>
|
|
|
|
|
<p>The Memory Map draws the memory image produced by the linker: each
|
|
|
|
|
segment is a bar whose position is its start address, whose height is
|
|
|
|
|
proportional to its size, and whose color reflects its type.</p>
|
|
|
|
@@ -469,7 +469,7 @@ scroll it to that segment\u2019s start address.</p>
|
|
|
|
|
<li>Overlapping segments (for example ROM and a load segment) currently
|
|
|
|
|
share the same row; the map does not yet stack them.</li>
|
|
|
|
|
</ul>
|
|
|
|
|
`;var vP=`<h1>VRAM Browser</h1>
|
|
|
|
|
`;var wP=`<h1>VRAM Browser</h1>
|
|
|
|
|
<p>The VRAM Browser is a hex dump of video memory. It is available on
|
|
|
|
|
systems with a separate video chip and a <code>readVRAMAddress</code> implementation.</p>
|
|
|
|
|
<p>It behaves like the <a href="memory.md">Memory Browser</a> \u2014 16 bytes per
|
|
|
|
@@ -477,7 +477,7 @@ row \u2014 but reads through the platform\u2019s video-memory accessor instead o
|
|
|
|
|
CPU memory, and its rows are all shown with the <code>video</code> segment color.</p>
|
|
|
|
|
<p>The dump does not scroll to a data segment on open, since VRAM has no
|
|
|
|
|
linker segments.</p>
|
|
|
|
|
`;var yP=`<h1>Memory Probe</h1>
|
|
|
|
|
`;var vP=`<h1>Memory Probe</h1>
|
|
|
|
|
<p>The Memory Probe is a heat map of memory activity. It is available on
|
|
|
|
|
platforms that implement <code>startProbing</code>.</p>
|
|
|
|
|
<p>The canvas is a 256\xD7256 grid of the 64K address space:</p>
|
|
|
|
@@ -543,7 +543,7 @@ contents, so the map is still readable before anything executes.</li>
|
|
|
|
|
<p>Hovering the map shows the routines and operations that touched that
|
|
|
|
|
address, including the program counter that performed each access and
|
|
|
|
|
any associated value.</p>
|
|
|
|
|
`;var QP=`<h1>CRT Probe</h1>
|
|
|
|
|
`;var yP=`<h1>CRT Probe</h1>
|
|
|
|
|
<p>The CRT Probe shows memory and I/O activity laid out by <em>raster
|
|
|
|
|
position</em> instead of by address, so you can see what the CPU touches at
|
|
|
|
|
each point of the display sweep. It is available on platforms that
|
|
|
|
@@ -596,7 +596,7 @@ implement <code>startProbing</code>.</p>
|
|
|
|
|
are filled with the previous color, so the display does not show false
|
|
|
|
|
black bands.</p>
|
|
|
|
|
<p>The view shows a complete frame, and might be incomplete during debugging.</p>
|
|
|
|
|
`;var PP=`<h1>Probe Log</h1>
|
|
|
|
|
`;var QP=`<h1>Probe Log</h1>
|
|
|
|
|
<p>The Probe Log is a chronological text view of CPU and memory activity
|
|
|
|
|
for a frame. It is available on platforms that implement <code>startProbing</code>.</p>
|
|
|
|
|
<p>Each line describes one clock tick:</p>
|
|
|
|
@@ -612,7 +612,7 @@ addresses and, where relevant, values.</li>
|
|
|
|
|
</ul>
|
|
|
|
|
<p>Write operations are colored differently from reads so they stand out.</p>
|
|
|
|
|
<p>The view shows a complete frame, and might be incomplete during debugging.</p>
|
|
|
|
|
`;var $P=`<h1>Scanline I/O</h1>
|
|
|
|
|
`;var PP=`<h1>Scanline I/O</h1>
|
|
|
|
|
<p>The Scanline I/O window shows the I/O and VRAM accesses made during each
|
|
|
|
|
scanline. It is available on platforms that implement <code>startProbing</code>.</p>
|
|
|
|
|
<p>Each row is one scanline:</p>
|
|
|
|
@@ -627,7 +627,7 @@ end, when known.</li>
|
|
|
|
|
<p>This makes it easy to see where per-scanline register writes (raster
|
|
|
|
|
effects) occur relative to the start of the visible line.</p>
|
|
|
|
|
<p>The view shows a complete frame, and might be incomplete during debugging.</p>
|
|
|
|
|
`;var kP=`<h1>Symbol Profiler</h1>
|
|
|
|
|
`;var $P=`<h1>Symbol Profiler</h1>
|
|
|
|
|
<p>The Symbol Profiler counts memory reads and writes per symbol over time.
|
|
|
|
|
It is available on platforms that implement <code>startProbing</code>.</p>
|
|
|
|
|
<p>Each row lists a symbol with two counters:</p>
|
|
|
|
@@ -663,7 +663,7 @@ It is available on platforms that implement <code>startProbing</code>.</p>
|
|
|
|
|
the numbers keep growing while you run and are reset when data is
|
|
|
|
|
collected again. Symbols from the debug map are listed even before they
|
|
|
|
|
are touched.</p>
|
|
|
|
|
`;var TP=`<h1>Call Stack</h1>
|
|
|
|
|
`;var kP=`<h1>Call Stack</h1>
|
|
|
|
|
<p>The Call Stack window reconstructs the program\u2019s call graph from runtime
|
|
|
|
|
stack activity. It is available on platforms that implement
|
|
|
|
|
<code>startProbing</code>.</p>
|
|
|
|
@@ -677,7 +677,7 @@ probe buffer is cleared on each refresh, and the graph resets when the
|
|
|
|
|
emulator is reset.</p>
|
|
|
|
|
<p>Expanding a node reveals its callees, so you can drill into a hot
|
|
|
|
|
routine and see where the time and calls are going.</p>
|
|
|
|
|
`;var XP=`<h1>Debug Tree</h1>
|
|
|
|
|
`;var TP=`<h1>Debug Tree</h1>
|
|
|
|
|
<p>The Debug Tree shows a hierarchical view of platform debug information.
|
|
|
|
|
It is available on platforms that implement <code>getDebugTree</code>.</p>
|
|
|
|
|
<p>The tree\u2019s shape is defined by the platform. Where the
|
|
|
|
@@ -697,7 +697,7 @@ lazy are only called when the node is expanded.</li>
|
|
|
|
|
</ul>
|
|
|
|
|
<p>Nodes collapse and expand on click. The tree refreshes with the emulator
|
|
|
|
|
while debugging.</p>
|
|
|
|
|
`;var _P=`<h1>Breakpoints</h1>
|
|
|
|
|
`;var XP=`<h1>Breakpoints</h1>
|
|
|
|
|
<p>The Breakpoints window lists every breakpoint in the project and lets you
|
|
|
|
|
add, edit, enable, or delete them. It is available on platforms that
|
|
|
|
|
implement <code>runEval</code> or <code>runToPC</code>.</p>
|
|
|
|
@@ -788,7 +788,7 @@ the disassembly, at the breakpoint\u2019s address.</li>
|
|
|
|
|
<p>The breakpoint that the CPU is currently stopped at is highlighted.</p>
|
|
|
|
|
<p>Breakpoints are persisted in browser local storage, scoped to the
|
|
|
|
|
current platform and project file, so they survive a reload.</p>
|
|
|
|
|
`;var RP=`<h1>Asset Editor</h1>
|
|
|
|
|
`;var _P=`<h1>Asset Editor</h1>
|
|
|
|
|
<p>The Asset Editor finds <a href="asset-headers.md">asset headers</a> in your source \u2014 small JSON
|
|
|
|
|
descriptors inside comments \u2014 and turns the data block that follows into
|
|
|
|
|
an editable bitmap, tilemap, or palette. Edits are written straight back
|
|
|
|
@@ -839,7 +839,7 @@ from your project\u2019s graphics and palette, as a single preview.</p>
|
|
|
|
|
<p>Use <code>Ctrl/Cmd+Z</code> to undo and <code>Ctrl/Cmd+Shift+Z</code> to redo your edits. The
|
|
|
|
|
history starts fresh each time you open the Asset Editor, so undo only
|
|
|
|
|
affects the changes you\u2019ve made in this session.</p>
|
|
|
|
|
`;var CP=`<h1>Managing Files</h1>
|
|
|
|
|
`;var RP=`<h1>Managing Files</h1>
|
|
|
|
|
<h2>Importing and exporting files</h2>
|
|
|
|
|
<p>To save your files outside of the browser:</p>
|
|
|
|
|
<ol>
|
|
|
|
@@ -952,7 +952,7 @@ commit message, then <strong>Push Changes</strong>.</li>
|
|
|
|
|
<strong>OK</strong>. All local files are overwritten; there is no merge in the
|
|
|
|
|
browser.</li>
|
|
|
|
|
</ul>
|
|
|
|
|
`;var AP=`<h1>Build Directives</h1>
|
|
|
|
|
`;var CP=`<h1>Build Directives</h1>
|
|
|
|
|
<p>A project can contain multiple files. The build system decides how each
|
|
|
|
|
file is used based on directives in your source, and each file\u2019s
|
|
|
|
|
extension selects the tool that compiles or assembles it.</p>
|
|
|
|
@@ -1226,7 +1226,7 @@ cases:</p>
|
|
|
|
|
</table>
|
|
|
|
|
<p>See <a href="toolchains.md">Toolchains & Platforms</a> for the full
|
|
|
|
|
platform \xD7 extension \u2192 tool table.</p>
|
|
|
|
|
`;var EP=`<!-- generated by \`npm run doctools\`; do not edit by hand -->
|
|
|
|
|
`;var AP=`<!-- generated by \`npm run doctools\`; do not edit by hand -->
|
|
|
|
|
<h1>Toolchains & Platforms</h1>
|
|
|
|
|
<p>A source file\u2019s <strong>extension</strong> picks a tool, and the <strong>platform</strong>
|
|
|
|
|
disambiguates extensions several tools share (<code>.c</code>, <code>.s</code>, <code>.bas</code>).</p>
|
|
|
|
@@ -2858,7 +2858,7 @@ not accepted on that platform.</p>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
`;var ZP=`<h1>Asset Header</h1>
|
|
|
|
|
`;var EP=`<h1>Asset Header</h1>
|
|
|
|
|
<p>An <strong>asset header</strong> is a tiny note to the <a href="asseteditor.md">Asset Editor</a>
|
|
|
|
|
that tells it what a block of data means. It is just a JSON object inside
|
|
|
|
|
a comment, sitting right above the bytes:</p>
|
|
|
|
@@ -3481,7 +3481,7 @@ bytes).</li>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
`;var UP=`<h2>Embedding the IDE in a web page</h2>
|
|
|
|
|
`;var ZP=`<h2>Embedding the IDE in a web page</h2>
|
|
|
|
|
<p>You can embed the IDE using an IFRAME element:</p>
|
|
|
|
|
<pre><code class="language-html"><iframe src="https://8bitworkshop.com/redir.html?embed=1&..."></iframe>
|
|
|
|
|
</code></pre>
|
|
|
|
@@ -3524,19 +3524,19 @@ containing embeds is effectively sandboxed from the others.</p>
|
|
|
|
|
src="https://8bitworkshop.com/redir.html?embed=1&platform=nes&highlight=&file0_name=testembed.dasm&file0_data=..."></iframe>
|
|
|
|
|
</div>
|
|
|
|
|
</code></pre>
|
|
|
|
|
`;var iz=Mg(),Wh=[{id:"index",title:"IDE Help",html:gP},{id:"editor",title:"Editor",html:bP},{id:"disasm",title:"Disassembly",html:xP},{id:"memory",title:"Memory Browser",html:SP},{id:"memmap",title:"Memory Map",html:wP},{id:"vram",title:"VRAM Browser",html:vP},{id:"memprobe",title:"Memory Probe",html:yP},{id:"crtprobe",title:"CRT Probe",html:QP},{id:"probelog",title:"Probe Log",html:PP},{id:"scanlineio",title:"Scanline I/O",html:$P},{id:"symbols",title:"Symbol Profiler",html:kP},{id:"callstack",title:"Call Stack",html:TP},{id:"debugtree",title:"Debug Tree",html:XP},{id:"breakpoints",title:"Breakpoints",html:_P},{id:"asseteditor",title:"Asset Editor",html:RP},{id:"managing-files",title:"Managing Files",html:CP},{id:"build-directives",title:"Build Directives",html:AP},{id:"toolchains",title:"Toolchains & Platforms",html:EP},{id:"asset-headers",title:"Asset Headers",html:ZP},{id:"embedding-ide",title:"Embedding the IDE",html:UP}],Lg={};for(let r of Wh)Lg[r.id]=r;Cv(()=>Wh);function Yg(r){let e=r||"";return e.startsWith("#")&&(e=e.substring(1)),e.startsWith("help")&&(e=e.substring(4)),e.startsWith("/")&&(e=e.substring(1)),e.endsWith(".md")&&(e=e.substring(0,e.length-3)),e=e.replace(/^\.\//,""),Lg[e]?e:"index"}function nz(r){return Lg[Yg(r)]}var sz={"#disasm":"disasm","#memory":"memory","#memmap":"memmap","#vram":"vram","#memprobe":"memprobe","#crtprobe":"crtprobe","#probelog":"probelog","#scanlineio":"scanlineio","#symbols":"symbols","#callstack":"callstack","#debugtree":"debugtree","#breakpoints":"breakpoints","#asseteditor":"asseteditor"};function i$(r,e){return e?"editor":r&&sz[r]||"index"}function oz(r){r.querySelectorAll("a[href]").forEach(t=>{let i=t.getAttribute("href");if(!i)return;if(/^[a-z][a-z0-9+.-]*:/i.test(i)){t.setAttribute("target","_blank"),t.setAttribute("rel","noopener noreferrer");return}if(i.startsWith("/")||i.startsWith("#"))return;let n=i.indexOf("#"),s=n>=0?i.substring(0,n):i;s.endsWith(".md")&&(t.setAttribute("href","#help/"+Yg(s)),t.removeAttribute("target"))})}function az(r,e){let t=nz(e);r.innerHTML=iz.sanitize(t.html),oz(r)}var ol=class{constructor(e){this.id=Yg(e||"index")}getPath(){return"#help/"+this.id}createDiv(e){return this.maindiv=Cr(e,"vertical-scroll help-view"),az(this.maindiv[0],this.id),this.maindiv[0]}refresh(e){}};var al=256,n$=100,s$=!1,Vh=class r{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+" ($"+be(e)+")";else if(typeof e=="boolean")t=e.toString();else if(typeof e=="string")e.length<n$?t=e:t=e.substring(0,n$)+"...";else if(e.buffer&&e.length<=al)t=hb(e,0,e.length);else if(typeof e=="object"||typeof e=="function")if(this._content!=null){if(e.slice&&e.length>al){let l={},c=e;for(var i=al;e.length/i>al;)i*=2;for(let d=0;d<c.length;d+=i)l["$"+be(d)]={$$:()=>c.slice(d,d+i)};e=l}if(e instanceof Map){let l={};for(let[c,d]of e.entries())l[c]=d;e=l}let o=e instanceof Array?Array.from(e.keys()):Object.getOwnPropertyNames(e);if(o.length>al){let l={},c=e;for(var i=100;o.length/i>100;)i*=2;for(let h=0;h<o.length;h+=i){for(var n={},s=h;s<h+i;s++)n[o[s]]=c[o[s]];l["["+h+"...]"]=n}e=l,o=Object.getOwnPropertyNames(e)}let a=new Set(this.children.keys());o.forEach(l=>{var c=!s$&&typeof l=="string"&&l.startsWith("$$");if(!c){let d=this.children.get(l);d==null&&(d=new r(this,l),this.children.set(l,d)),d.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 o$(r,e){var t=new Vh(null,null);t.view=e,t._content=r;var i=new Vh(t,"/");return i.expanded=!0,i.getDiv(),i._div.style.padding="0px",i}var Wg=class{createDiv(e){return this.root=o$(e,this),th
Line truncated
|
|
|
|
|
`,await O$(r),re.newfile?!i&&!t?ve('No build tool for "'+r+'" on this platform; project will not build.'):i?S$(!0,!0):kt("No skeleton file for "+t+" on this platform; using blank file."):kt('Could not find file "'+r+'"<br><br>Creating new '+(i?t:"blank")+" file."),delete re.newfile,su()}}function Jg(r){if(r=="/")re={repo:"/"};else if(r.indexOf("://")>=0){var e=Pa(r);e&&(re={repo:e.repopath})}else re.platform=le,re.file=r;Hn()}async function bz(r){var e=_u(w.getToolForFilename(r));try{return await $.get("presets/"+$t(le)+"/skeleton."+e,"text")}catch(t){return console.log(t+""),null}}function eb(r){return r.indexOf(" ")>=0?(ve("No spaces in filenames, please."),!1):!0}async function xz(r){var e=$t(le),t={},i=[];for(var n of r){var s=w.getToolForFilename("test"+n);t[s]||(t[s]=[],i.push(s)),t[s].push(n)}var o=i.map(d=>$.ajax({url:"presets/"+e+"/skeleton."+_u(d),type:"HEAD"}).then(()=>d,()=>null)),a=await Promise.all(o),l=[];for(var c of a)c!=null&&l.push({tool:c,extensions:t[c]});return l}async function Sz(r){var e=await xz(w.getDefaultExtensions()),t,i;return e.length===0?(t=w.getDefaultExtensions(),i=t.join(" ")):(t=e.reduce((n,s)=>n.concat(s.extensions),[]),i=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'>"+i+"</span>",placeholder:"newfile"+t[0],callback:n=>{if(n&&n.trim().length>0){if(!eb(n))return;n.indexOf(".")<0&&(n+=t[0]);var s=n;re.newfile="1",Jg(s)}}}),!0}function wz(r){let e=$('<input type="file" multiple accept="*" style="display:none">'),t=e[0];e.change(i=>{vz(t.files)}),e.click()}function vz(r){console.log(r);var e=0;function t(){var i=r[e++];if(!i)console.log("Done uploading",e),e>2?(kt("Files uploaded."),setTimeout(fl,1e3)):(re.file=r[0].name,bootbox.confirm({message:"Open '"+xn.sanitize(re.file)+"' as main project file?",buttons:{confirm:{label:"Open As New Project"},cancel:{label:"Include/Link With Project Later"}},callback:o=>{o?Hn():setTimeout(fl,1e3)}}));else{var n=i.name,s=new FileReader;s.onload=function(o){var a=o.target.result,l=new Uint8Array(a);Xn(n,l)||(l=Al(l).replace(`\r
|
|
|
|
|
`;var tz=Mg(),Wh=[{id:"index",title:"IDE Help",html:mP},{id:"editor",title:"Editor",html:gP},{id:"disasm",title:"Disassembly",html:bP},{id:"memory",title:"Memory Browser",html:xP},{id:"memmap",title:"Memory Map",html:SP},{id:"vram",title:"VRAM Browser",html:wP},{id:"memprobe",title:"Memory Probe",html:vP},{id:"crtprobe",title:"CRT Probe",html:yP},{id:"probelog",title:"Probe Log",html:QP},{id:"scanlineio",title:"Scanline I/O",html:PP},{id:"symbols",title:"Symbol Profiler",html:$P},{id:"callstack",title:"Call Stack",html:kP},{id:"debugtree",title:"Debug Tree",html:TP},{id:"breakpoints",title:"Breakpoints",html:XP},{id:"asseteditor",title:"Asset Editor",html:_P},{id:"managing-files",title:"Managing Files",html:RP},{id:"build-directives",title:"Build Directives",html:CP},{id:"toolchains",title:"Toolchains & Platforms",html:AP},{id:"asset-headers",title:"Asset Headers",html:EP},{id:"embedding-ide",title:"Embedding the IDE",html:ZP}],Lg={};for(let r of Wh)Lg[r.id]=r;Rv(()=>Wh);function Yg(r){let e=r||"";return e.startsWith("#")&&(e=e.substring(1)),e.startsWith("help")&&(e=e.substring(4)),e.startsWith("/")&&(e=e.substring(1)),e.endsWith(".md")&&(e=e.substring(0,e.length-3)),e=e.replace(/^\.\//,""),Lg[e]?e:"index"}function rz(r){return Lg[Yg(r)]}var iz={"#disasm":"disasm","#memory":"memory","#memmap":"memmap","#vram":"vram","#memprobe":"memprobe","#crtprobe":"crtprobe","#probelog":"probelog","#scanlineio":"scanlineio","#symbols":"symbols","#callstack":"callstack","#debugtree":"debugtree","#breakpoints":"breakpoints","#asseteditor":"asseteditor"};function r$(r,e){return e?"editor":r&&iz[r]||"index"}function nz(r){r.querySelectorAll("a[href]").forEach(t=>{let i=t.getAttribute("href");if(!i)return;if(/^[a-z][a-z0-9+.-]*:/i.test(i)){t.setAttribute("target","_blank"),t.setAttribute("rel","noopener noreferrer");return}if(i.startsWith("/")||i.startsWith("#"))return;let n=i.indexOf("#"),s=n>=0?i.substring(0,n):i;s.endsWith(".md")&&(t.setAttribute("href","#help/"+Yg(s)),t.removeAttribute("target"))})}function sz(r,e){let t=rz(e);r.innerHTML=tz.sanitize(t.html),nz(r)}var ol=class{constructor(e){this.id=Yg(e||"index")}getPath(){return"#help/"+this.id}createDiv(e){return this.maindiv=Cr(e,"vertical-scroll help-view"),sz(this.maindiv[0],this.id),this.maindiv[0]}refresh(e){}};var al=256,i$=100,n$=!1,Vh=class r{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+" ($"+be(e)+")";else if(typeof e=="boolean")t=e.toString();else if(typeof e=="string")e.length<i$?t=e:t=e.substring(0,i$)+"...";else if(e.buffer&&e.length<=al)t=db(e,0,e.length);else if(typeof e=="object"||typeof e=="function")if(this._content!=null){if(e.slice&&e.length>al){let l={},c=e;for(var i=al;e.length/i>al;)i*=2;for(let d=0;d<c.length;d+=i)l["$"+be(d)]={$$:()=>c.slice(d,d+i)};e=l}if(e instanceof Map){let l={};for(let[c,d]of e.entries())l[c]=d;e=l}let o=e instanceof Array?Array.from(e.keys()):Object.getOwnPropertyNames(e);if(o.length>al){let l={},c=e;for(var i=100;o.length/i>100;)i*=2;for(let h=0;h<o.length;h+=i){for(var n={},s=h;s<h+i;s++)n[o[s]]=c[o[s]];l["["+h+"...]"]=n}e=l,o=Object.getOwnPropertyNames(e)}let a=new Set(this.children.keys());o.forEach(l=>{var c=!n$&&typeof l=="string"&&l.startsWith("$$");if(!c){let d=this.children.get(l);d==null&&(d=new r(this,l),this.children.set(l,d)),d.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 s$(r,e){var t=new Vh(null,null);t.view=e,t._content=r;var i=new Vh(t,"/");return i.expanded=!0,i.getDiv(),i._div.style.padding="0px",i}var Wg=class{createDiv(e){return this.root=s$(e,this),th
Line truncated
|
|
|
|
|
`,await f$(r),re.newfile?!i&&!t?ve('No build tool for "'+r+'" on this platform; project will not build.'):i?x$(!0,!0):kt("No skeleton file for "+t+" on this platform; using blank file."):kt('Could not find file "'+r+'"<br><br>Creating new '+(i?t:"blank")+" file."),delete re.newfile,su()}}function Kg(r){if(r=="/")re={repo:"/"};else if(r.indexOf("://")>=0){var e=Pa(r);e&&(re={repo:e.repopath})}else re.platform=le,re.file=r;Hn()}async function mz(r){var e=_u(w.getToolForFilename(r));try{return await $.get("presets/"+$t(le)+"/skeleton."+e,"text")}catch(t){return console.log(t+""),null}}function Jg(r){return r.indexOf(" ")>=0?(ve("No spaces in filenames, please."),!1):!0}async function gz(r){var e=$t(le),t={},i=[];for(var n of r){var s=w.getToolForFilename("test"+n);t[s]||(t[s]=[],i.push(s)),t[s].push(n)}var o=i.map(d=>$.ajax({url:"presets/"+e+"/skeleton."+_u(d),type:"HEAD"}).then(()=>d,()=>null)),a=await Promise.all(o),l=[];for(var c of a)c!=null&&l.push({tool:c,extensions:t[c]});return l}async function bz(r){var e=await gz(w.getDefaultExtensions()),t,i;return e.length===0?(t=w.getDefaultExtensions(),i=t.join(" ")):(t=e.reduce((n,s)=>n.concat(s.extensions),[]),i=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'>"+i+"</span>",placeholder:"newfile"+t[0],callback:n=>{if(n&&n.trim().length>0){if(!Jg(n))return;n.indexOf(".")<0&&(n+=t[0]);var s=n;re.newfile="1",Kg(s)}}}),!0}function xz(r){let e=$('<input type="file" multiple accept="*" style="display:none">'),t=e[0];e.change(i=>{Sz(t.files)}),e.click()}function Sz(r){console.log(r);var e=0;function t(){var i=r[e++];if(!i)console.log("Done uploading",e),e>2?(kt("Files uploaded."),setTimeout(fl,1e3)):(re.file=r[0].name,bootbox.confirm({message:"Open '"+xn.sanitize(re.file)+"' as main project file?",buttons:{confirm:{label:"Open As New Project"},cancel:{label:"Include/Link With Project Later"}},callback:o=>{o?Hn():setTimeout(fl,1e3)}}));else{var n=i.name,s=new FileReader;s.onload=function(o){var a=o.target.result,l=new Uint8Array(a);Xn(n,l)||(l=Al(l).replace(`\r
|
|
|
|
|
`,`
|
|
|
|
|
`)),W.updateFile(n,l),console.log("Uploaded "+n+" "+l.length+" bytes"),t()},s.readAsArrayBuffer(i)}}r&&t()}async function yz(r){var e=window.showDirectoryPicker;e||ve("This browser can't open local files on your computer, yet. Try Chrome.");var t=await e(),i=t.name,n="__localfs__"+i,s={handle:t},o=Hg.createInstance({name:n,version:2});await o.setItem(n,s),re={localfs:i},Hn(!0)}async function Qz(r){return new Promise((e,t)=>{bootbox.prompt(xn.sanitize(r),i=>{e(i)})})}async function Pz(r){let e={mode:"readwrite"};var t="__localfs__"+r,i=Hg.createInstance({name:t,version:2}),n=await i.getItem(t),s=n.handle;console.log(n,s);var o=await s.queryPermission(e);if(console.log(o),o!=="granted"&&(await Qz("Request permissions to access filesystem?"),o=await s.requestPermission(e)),o!=="granted"){ve("Could not get permission to access filesystem.");return}let a={};return{getFileData:async l=>{console.log("getFileData",l);let d=await(await s.getFileHandle(l,{create:!1})).getFile(),h=await(Xn(l)?d.arrayBuffer():d.text());return h instanceof ArrayBuffer?new Uint8Array(h):h},setFileData:async(l,c)=>{a[l]=Date.now();let h=await(await s.getFileHandle(l,{create:!0})).createWritable();await h.write(c),await h.close()},onFileSystemUpdate:l=>{if(typeof window.FileSystemObserver=="undefined")return;new window.FileSystemObserver((d,h)=>{for(let u of d)if(u.changedHandle){let f=u.changedHandle.name;if(Date.now()-(a[f]||0)<2e3)continue;l(f)}}).observe(s,{recursive:!0})}}}function lt(){return ft(K.mainPath)}function bv(){return ft(W.getActiveID())}function $z(r){var e=W.getActive(),t=W.getActiveID(),i=e&&e.setData&&!e.setText;if(e&&(e.setText||e.setData)){var n="presets/"+$t(le)+"/"+t;Mo(n,s=>{if(s==null){ht?ve("Can only revert built-in examples. If you want to revert all files, You can pull from the repository."):ve("Can only revert built-in examples.");return}bootbox.confirm("Reset '"+xn.sanitize(t)+"' to default?",o=>{o&&(i?(e.setData(s),K.updateFile(t,s)):e.setText(s))})},i?"arraybuffer":"text")}else ve("Cannot revert the active window. Please choose a text file.")}function kz(r){var e=W.getActive();if(e&&e.getPath){var t=W.getActiveID();bootbox.confirm("Delete '"+xn.sanitize(t)+"'?",i=>{i&&Zr.removeItem(t).then(()=>{re.file==t?(Ei.unsetLastPreset(),Hn()):(fl(),kt("Deleted "+t))})})}else ve("Cannot delete the active window.")}function Tz(r){var e=W.getActive();if(e&&e.getPath&&K.getFile(e.getPath())){var t=W.getActiveID();bootbox.prompt({title:"Rename '"+xn.sanitize(t)+"' to?",value:t,callback:i=>{var n=K.getFile(e.getPath());if(i&&i!=t&&n){if(!eb(i))return;Zr.removeItem(t).then(()=>Zr.setItem(i,n)).then(()=>{fl(),alert("Renamed "+t+" to "+i),t==K.mainPath&&Jg(i)})}}})}else ve("Cannot rename the active window.")}function Xz(r){let e={},t,i=w.getPresets?w.getPresets():[];for(var n=0;n<i.length;n++){var s=i[n],o=s.chapter?s.chapter+". "+s.name:s.name,a=s.id==K.mainPath;s.category?t=$("<optgroup />").attr("label","Examples: "+s.category).appendTo(r):t||(t=$("<optgroup />").attr("label","Examples").appendTo(r)),t.append($("<option />").val(s.id).text(o).attr("selected",a?"selected":null)),a&&(Bh=s),e[s.id]=o}return e}function _z(r){if(ir&&!vo){var e=0,t=Bn();if(t){let n=$("<optgroup />").attr("label","Repositories").appendTo(r);for(let s in t){var i=t[s];i.platform_id&&$t(i.platform_id)==$t(le)&&n.append($("<option />").val(i.url).text(i.url.substring(i.url.indexOf("/"))))}}}}async function p$(r,e,t,i){let n=await Zr.keys();n||(n=[]);let s;for(var o=0;o<n.length;o++){let a=n[o];if(a.startsWith(t)&&!i[a]){s||(s=$("<optgroup />").attr("label",e).appendTo(r));let l=a.substring(t.length);s.append($("<option />").val(a).text(l).attr("selected",a==K.mainPath?"selected":null))}}}function m$(r){r.css("visibility","visible");var e=K.mainPath;r.val()!=e&&r.append($("<option />").val(e).text(e).attr("selected","selected"))}async function fl(){var r=$("#preset_select").empty();if(ht)r.append($("<option />").val("/").text("Leave Repository")),$("#repo_name").text(ft(ht)+"/").show(),await p$(r,ht,"",{}),m$(r);else{_z(r);var e=Xz(r);await p$(r,"Local Files","",e),m$(r)}r.off("change").change(function(t){Jg($(this).val().toString())})}function Rz(r){var e=$("<p/>");if(r.path!=null){var t=r.line?r.label?`(${r.path} @ ${r.label})`:`(${r.path}:${r.line})`:`(${r.path})`,i=$("<a/>").text(t),n=r.path;n==lt()&&(n=K.mainPath),W.isWindow(n)&&i.click(s=>{var o=W.createOrShow(n);o instanceof jt&&o.navigateToLine(r.line)}),e.append(i),e.append(" ")}return e.append($("<span/>").text(r.msg)),e}function w$(){$("#error_alert").hide(),Kg=!1}function tb(r,e){var t=$("#error_alert_msg").empty();for(var i of r.slice(0,10))t.append(Rz(i));$("#error_alert").show(),Kg=e;var n=r.find(o=>o.path!=null),s;n&&W.isWindow(n.path==lt()?K.mainPath:n.path)&&(s=()=>{Ez(n)})}function v$(r,e){if(e!=null){var t={msg:e,line:0};r instanceof yu&&r.$loc&&(t=Object.create(r.$loc),t.msg=e,console.log(t)),tb([t],!0)}}async function Cz(r){if("uppercaseOnly"in r&&H1(r.uppercaseOnly),"erro
Line truncated
|
|
|
|
|
`)),W.updateFile(n,l),console.log("Uploaded "+n+" "+l.length+" bytes"),t()},s.readAsArrayBuffer(i)}}r&&t()}async function wz(r){var e=window.showDirectoryPicker;e||ve("This browser can't open local files on your computer, yet. Try Chrome.");var t=await e(),i=t.name,n="__localfs__"+i,s={handle:t},o=Gg.createInstance({name:n,version:2});await o.setItem(n,s),re={localfs:i},Hn(!0)}async function vz(r){return new Promise((e,t)=>{bootbox.prompt(xn.sanitize(r),i=>{e(i)})})}async function yz(r){let e={mode:"readwrite"};var t="__localfs__"+r,i=Gg.createInstance({name:t,version:2}),n=await i.getItem(t),s=n.handle;console.log(n,s);var o=await s.queryPermission(e);if(console.log(o),o!=="granted"&&(await vz("Request permissions to access filesystem?"),o=await s.requestPermission(e)),o!=="granted"){ve("Could not get permission to access filesystem.");return}let a={};return{getFileData:async l=>{console.log("getFileData",l);let d=await(await s.getFileHandle(l,{create:!1})).getFile(),h=await(Xn(l)?d.arrayBuffer():d.text());return h instanceof ArrayBuffer?new Uint8Array(h):h},setFileData:async(l,c)=>{a[l]=Date.now();let h=await(await s.getFileHandle(l,{create:!0})).createWritable();await h.write(c),await h.close()},onFileSystemUpdate:l=>{if(typeof window.FileSystemObserver=="undefined")return;new window.FileSystemObserver((d,h)=>{for(let u of d)if(u.changedHandle){let f=u.changedHandle.name;if(Date.now()-(a[f]||0)<2e3)continue;l(f)}}).observe(s,{recursive:!0})}}}function lt(){return ft(K.mainPath)}function gv(){return ft(W.getActiveID())}function Qz(r){var e=W.getActive(),t=W.getActiveID(),i=e&&e.setData&&!e.setText;if(e&&(e.setText||e.setData)){var n="presets/"+$t(le)+"/"+t;Mo(n,s=>{if(s==null){ht?ve("Can only revert built-in examples. If you want to revert all files, You can pull from the repository."):ve("Can only revert built-in examples.");return}bootbox.confirm("Reset '"+xn.sanitize(t)+"' to default?",o=>{o&&(i?(e.setData(s),K.updateFile(t,s)):e.setText(s))})},i?"arraybuffer":"text")}else ve("Cannot revert the active window. Please choose a text file.")}function Pz(r){var e=W.getActive();if(e&&e.getPath){var t=W.getActiveID();bootbox.confirm("Delete '"+xn.sanitize(t)+"'?",i=>{i&&Zr.removeItem(t).then(()=>{re.file==t?(Ei.unsetLastPreset(),Hn()):(fl(),kt("Deleted "+t))})})}else ve("Cannot delete the active window.")}function $z(r){var e=W.getActive();if(e&&e.getPath&&K.getFile(e.getPath())){var t=W.getActiveID();bootbox.prompt({title:"Rename '"+xn.sanitize(t)+"' to?",value:t,callback:i=>{var n=K.getFile(e.getPath());if(i&&i!=t&&n){if(!Jg(i))return;Zr.removeItem(t).then(()=>Zr.setItem(i,n)).then(()=>{fl(),alert("Renamed "+t+" to "+i),t==K.mainPath&&Kg(i)})}}})}else ve("Cannot rename the active window.")}function kz(r){let e={},t,i=w.getPresets?w.getPresets():[];for(var n=0;n<i.length;n++){var s=i[n],o=s.chapter?s.chapter+". "+s.name:s.name,a=s.id==K.mainPath;s.category?t=$("<optgroup />").attr("label","Examples: "+s.category).appendTo(r):t||(t=$("<optgroup />").attr("label","Examples").appendTo(r)),t.append($("<option />").val(s.id).text(o).attr("selected",a?"selected":null)),a&&(Bh=s),e[s.id]=o}return e}function Tz(r){if(ir&&!vo){var e=0,t=Bn();if(t){let n=$("<optgroup />").attr("label","Repositories").appendTo(r);for(let s in t){var i=t[s];i.platform_id&&$t(i.platform_id)==$t(le)&&n.append($("<option />").val(i.url).text(i.url.substring(i.url.indexOf("/"))))}}}}async function O$(r,e,t,i){let n=await Zr.keys();n||(n=[]);let s;for(var o=0;o<n.length;o++){let a=n[o];if(a.startsWith(t)&&!i[a]){s||(s=$("<optgroup />").attr("label",e).appendTo(r));let l=a.substring(t.length);s.append($("<option />").val(a).text(l).attr("selected",a==K.mainPath?"selected":null))}}}function p$(r){r.css("visibility","visible");var e=K.mainPath;r.val()!=e&&r.append($("<option />").val(e).text(e).attr("selected","selected"))}async function fl(){var r=$("#preset_select").empty();if(ht)r.append($("<option />").val("/").text("Leave Repository")),$("#repo_name").text(ft(ht)+"/").show(),await O$(r,ht,"",{}),p$(r);else{Tz(r);var e=kz(r);await O$(r,"Local Files","",e),p$(r)}r.off("change").change(function(t){Kg($(this).val().toString())})}function Xz(r){var e=$("<p/>");if(r.path!=null){var t=r.line?r.label?`(${r.path} @ ${r.label})`:`(${r.path}:${r.line})`:`(${r.path})`,i=$("<a/>").text(t),n=r.path;n==lt()&&(n=K.mainPath),W.isWindow(n)&&i.click(s=>{var o=W.createOrShow(n);o instanceof jt&&o.navigateToLine(r.line)}),e.append(i),e.append(" ")}return e.append($("<span/>").text(r.msg)),e}function S$(){$("#error_alert").hide(),Hg=!1}function eb(r,e){var t=$("#error_alert_msg").empty();for(var i of r.slice(0,10))t.append(Xz(i));$("#error_alert").show(),Hg=e;var n=r.find(o=>o.path!=null),s;n&&W.isWindow(n.path==lt()?K.mainPath:n.path)&&(s=()=>{Cz(n)})}function w$(r,e){if(e!=null){var t={msg:e,line:0};r instanceof yu&&r.$loc&&(t=Object.create(r.$loc),t.msg=e,console.log(t)),eb([t],!0)}}async function _z(r){if("uppercaseOnly"in r&&G1(r.uppercaseOnly),"erro
Line truncated
|
|
|
|
|
`),e.SP&&(t+="c.SP < 0x"+be(e.SP)+`
|
|
|
|
|
`),e.HL&&(t+=`c.HL == 0x4000
|
|
|
|
|
`),w.readAddress&&(t+=`this.readAddress(0x1234) == 0x0
|
|
|
|
|
`),w.readVRAMAddress&&(t+=`this.readVRAMAddress(0x1234) != 0x80
|
|
|
|
|
`),w.getRasterScanline&&(t+=`this.getRasterScanline() > 222
|
|
|
|
|
`),t}function Dz(r){var e=new Function("c","return ("+r+");").bind(w);Jr(),w.runEval(e),x$=r}function L$(){w.isRunning()?(W.tick(),Nh=!1):Nh||(W.tick(),Nh=!0),setTimeout(L$,100)}function nu(r){w.setFrameRate(r),r>.01?$("#fps_label").text(r.toFixed(2)):$("#fps_label").text("1/"+Math.round(1/r))}function Iz(){var r=w.getFrameRate();r=r/2,r>1e-5&&nu(r)}function qz(){var r=w.getFrameRate();r=Math.min(60,r*2),nu(r)}function Fz(){nu(60/65536)}function Bz(){Zi(),nu(60)}function Nz(){W.refresh(!1);var r=W.getActive();if(r.getSourceFile&&r.setTimingResult){var e=w.newCodeAnalyzer();e.showLoopTimingForPC(0),r.setTimingResult(e)}}function ib(){So&&(w.setRecorder(null),$("#dbg_record").removeClass("btn_recording"),$("#replaydiv").hide(),ru(),So=!1)}function Y$(){So&&Dt.reset()}function W$(){Dt.reset(),w.setRecorder(Dt),$("#dbg_record").addClass("btn_recording"),$("#replaydiv").show(),So=!0}function Gz(){So?ib():W$(),Lr()}function Hz(){var r=!jt.tracingEnabled;$("#dbg_tracelines").toggleClass("btn_active",r);var e=W.getActive();e instanceof jt?e.setTracingEnabled(r):jt.tracingEnabled=r}function ti(r,e,t){var i=W.getActive();i&&i.insertLinesBefore?bootbox.prompt({title:"Add "+xn.sanitize(r)+" File to Project",value:"filename"+xn.sanitize(e),callback:n=>{if(n&&n.trim().length>0){if(!eb(n))return;var s=n,o=`
|
|
|
|
|
`),t}function Vz(r){var e=new Function("c","return ("+r+");").bind(w);Jr(),w.runEval(e),b$=r}function M$(){w.isRunning()?(W.tick(),Nh=!1):Nh||(W.tick(),Nh=!0),setTimeout(M$,100)}function nu(r){w.setFrameRate(r),r>.01?$("#fps_label").text(r.toFixed(2)):$("#fps_label").text("1/"+Math.round(1/r))}function jz(){var r=w.getFrameRate();r=r/2,r>1e-5&&nu(r)}function Dz(){var r=w.getFrameRate();r=Math.min(60,r*2),nu(r)}function Iz(){nu(60/65536)}function qz(){Zi(),nu(60)}function Fz(){W.refresh(!1);var r=W.getActive();if(r.getSourceFile&&r.setTimingResult){var e=w.newCodeAnalyzer();e.showLoopTimingForPC(0),r.setTimingResult(e)}}function rb(){So&&(w.setRecorder(null),$("#dbg_record").removeClass("btn_recording"),$("#replaydiv").hide(),ru(),So=!1)}function L$(){So&&Dt.reset()}function Y$(){Dt.reset(),w.setRecorder(Dt),$("#dbg_record").addClass("btn_recording"),$("#replaydiv").show(),So=!0}function Bz(){So?rb():Y$(),Lr()}function Nz(){var r=!jt.tracingEnabled;$("#dbg_tracelines").toggleClass("btn_active",r);var e=W.getActive();e instanceof jt?e.setTracingEnabled(r):jt.tracingEnabled=r}function ti(r,e,t){var i=W.getActive();i&&i.insertLinesBefore?bootbox.prompt({title:"Add "+xn.sanitize(r)+" File to Project",value:"filename"+xn.sanitize(e),callback:n=>{if(n&&n.trim().length>0){if(!Jg(n))return;var s=n,o=`
|
|
|
|
|
`+t(n)+`
|
|
|
|
|
`;K.loadFiles([s]).then(a=>{a&&a.length?ve(n+" already exists; including anyway"):K.updateFile(s,`
|
|
|
|
|
`),i.insertLinesBefore(o),xo()})}}}):ve("Can't insert text in this window -- switch back to main file")}function Kz(){var r=lt(),e=w.getToolForFilename(r);r.endsWith(".c")||e=="sdcc"||e=="cc65"||e=="cmoc"||e=="smlrc"?ti("Header",".h",t=>'#include "'+t+'"'):e=="dasm"||e=="zmac"?ti("Include",".inc",t=>' include "'+t+'"'):e=="ca65"||e=="sdasz80"||e=="vasm"||e=="armips"?ti("Include",".inc",t=>' .include "'+t+'"'):e=="verilator"?ti("Verilog",".v",t=>'`include "'+t+'"'):e=="wiz"?ti("Include",".wiz",t=>'import "'+t+'";'):e=="ecs"?ti("Include",".ecs",t=>'import "'+t+'"'):e=="acme"?ti("Include",".acme",t=>'!src "'+t+'"'):e=="xa"?ti("Include",".xa",t=>'#include "'+t+'"'):e=="dialog"?ti("Include",".dg",t=>'%% #include "'+t+'"'):ve("Can't add include file to this project type ("+e+")")}function Jz(){var r=lt(),e=w.getToolForFilename(r);r.endsWith(".c")||e=="sdcc"||e=="cc65"||e=="cmoc"||e=="smlrc"?ti("Linked C (or .s)",".c",t=>'//#link "'+t+'"'):r.endsWith("asm")||r.endsWith(".s")||e=="ca65"||e=="lwasm"?ti("Linked ASM",".inc",t=>';#link "'+t+'"'):ve("Can't add linked file to this project type ("+e+")")}function eM(){if(Ke=new Ml($("#toolbar")[0],null),Ke.grp.prop("id","run_bar"),Ke.add("mod+shift+r","Reset","glyphicon-refresh",z$).prop("id","dbg_reset"),Ke.add("mod+shift+h","Pause","glyphicon-pause",k$).prop("id","dbg_pause"),Ke.add("mod+shift+g","Go To Address","",i=>{Q$()||eu()}),Ke.add("mod+shift+g","Resume","glyphicon-play",eu).prop("id","dbg_go"),Ke.add("F8","Pause/Resume","",T$),Ke.add("F1","Help","",V$),w.restartAtPC&&Ke.add("mod+shift+a","Restart at Cursor","glyphicon-play-circle",A$).prop("id","dbg_restartatline"),Ke.newGroup(),Ke.grp.prop("id","debug_bar"),w.runEval&&Ke.add("mod+shift+d","Reset and Debug","glyphicon-fast-backward",M$).prop("id","dbg_restart"),w.stepBack&&Ke.add("mod+shift+j","Step Backwards","glyphicon-step-backward",U$).prop("id","dbg_stepback"),w.step&&Ke.add("mod+shift+l","Single Step","glyphicon-step-forward",X$).prop("id","dbg_step"),w.stepOver&&Ke.add("mod+shift+k","Step Over","glyphicon-hand-right",_$).prop("id","dbg_stepover"),w.runUntilReturn&&Ke.add("mod+shift+i","Step Out of Subroutine","glyphicon-hand-up",Z$).prop("id","dbg_stepout"),w.runToVsync&&Ke.add("mod+shift+x","Next Frame/Interrupt","glyphicon-forward",R$).prop("id","dbg_tovsync"),(w.runEval||w.runToPC)&&!le.startsWith("verilog")&&Ke.add("mod+shift+y","Run To Line","glyphicon-save",E$).prop("id","dbg_toline"),Ke.newGroup(),Ke.grp.prop("id","xtra_bar"),Ke.add("mod+shift+f","Search","glyphicon-search",Sg).prop("id","dbg_search"),$(".dropdown-menu").collapse({toggle:!1}),$("#item_new_file").click(Sz),$("#item_upload_file").click(wz),$("#item_open_directory").click(yz),$("#item_github_login").click(xv),$("#item_github_logout").click(Sv),$("#item_github_import").click(wv),$("#item_github_publish").click(vv),$("#item_github_push").click(yv),$("#item_github_pull").click(Qv),$("#item_repo_delete").click($v),$("#item_share_file").click(cv),$("#item_reset_file").click($z),$("#item_rename_file").click(Tz),$("#item_delete_file").click(kz),w.runEval?$("#item_debug_expr").click(Vz).show():$("#item_debug_expr").hide(),$("#item_download_rom").click(hv),$("#item_download_file").click(uv),$("#item_download_zip").click(Ov),w.getDebugSymbolFile?$("#item_download_sym").click(pv):$("#item_download_sym").hide(),$("#item_download_allzip").click(mv),$("#item_record_video").click(gv),Op()?$("#item_export_cassette").click(dv):$("#item_export_cassette").hide(),w.setFrameRate&&w.getFrameRate&&($("#dbg_slower").click(Iz),$("#dbg_faster").click(qz),$("#dbg_slowest").click(Fz),$("#dbg_fastest").click(Bz)),$("#item_addfile_include").click(Kz),$("#item_addfile_link").click(Jz),$("#item_request_persist").click(()=>S$(!0,!1)),$("#item_settings").click(ev),L$(),w.newCodeAnalyzer&&Ke.add(null,"Analyze CPU Timing","glyphicon-time",Nz),w.startProbing&&Ke.add(null,"Highlight Executed Lines","glyphicon-fire",Hz).prop("id","dbg_tracelines"),w.setRecorder&&w.advance&&rM(),w.showHelp){let{li:i,a:n}=Gh("help__"+le,Kh+" Help");$("#help_menu").append(i),$(n).click(s=>{s.preventDefault(),window.open(w.showHelp(),"_8bws_help")})}let r=w.getToolForFilename(lt()),e=r&&Bt(r),t=e==null?void 0:e.helpURL;if(t){let i=r+" Help";e.version&&(i+=" ("+e.version+")");let{li:n,a:s}=Gh("help__"+r,i);$("#help_menu").append(n),$(s).click(o=>{o.preventDefault(),window.open(t,"_8bws_help")})}{let{li:i}=Gh("#help","IDE Help");$("#help_menu").prepend(i)}$("#item_tool_versions").click(tM)}function V$(){if(W){var r=W.getActive()instanceof jt,e=i$(W.getActiveID(),r),t="#help/"+e;window.location.hash===t?W.createOrShow(t):window.location.hash=t}}function tM(){let r=u=>String(u==null?"":u).replace(/[&<>"]/g,f=>({"&":"&","<":"<",">":">",'"':"""})[f]),e=(u,f)=>"$"+be(u,4).toUpperCase()+(f!=null?"+$"+be(f,4).toUpperCase():""),t=Yr[le]||Yr[$t(le)]||Yr[Mr(le)],i=t&&t.arch||"\u2014",n=[];t&&(t.rom_start!=null&&n.push("rom "+e(t.rom_start,t.rom_size)),t.code_start!=null&&n.push("code "+e(tLine truncated
|
|
|
|
|
`),i.insertLinesBefore(o),xo()})}}}):ve("Can't insert text in this window -- switch back to main file")}function Gz(){var r=lt(),e=w.getToolForFilename(r);r.endsWith(".c")||e=="sdcc"||e=="cc65"||e=="cmoc"||e=="smlrc"?ti("Header",".h",t=>'#include "'+t+'"'):e=="dasm"||e=="zmac"?ti("Include",".inc",t=>' include "'+t+'"'):e=="ca65"||e=="sdasz80"||e=="vasm"||e=="armips"?ti("Include",".inc",t=>' .include "'+t+'"'):e=="verilator"?ti("Verilog",".v",t=>'`include "'+t+'"'):e=="wiz"?ti("Include",".wiz",t=>'import "'+t+'";'):e=="ecs"?ti("Include",".ecs",t=>'import "'+t+'"'):e=="acme"?ti("Include",".acme",t=>'!src "'+t+'"'):e=="xa"?ti("Include",".xa",t=>'#include "'+t+'"'):e=="dialog"?ti("Include",".dg",t=>'%% #include "'+t+'"'):ve("Can't add include file to this project type ("+e+")")}function Hz(){var r=lt(),e=w.getToolForFilename(r);r.endsWith(".c")||e=="sdcc"||e=="cc65"||e=="cmoc"||e=="smlrc"?ti("Linked C (or .s)",".c",t=>'//#link "'+t+'"'):r.endsWith("asm")||r.endsWith(".s")||e=="ca65"||e=="lwasm"?ti("Linked ASM",".inc",t=>';#link "'+t+'"'):ve("Can't add linked file to this project type ("+e+")")}function Kz(){if(Ke=new Ml($("#toolbar")[0],null),Ke.grp.prop("id","run_bar"),Ke.add("mod+shift+r","Reset","glyphicon-refresh",U$).prop("id","dbg_reset"),Ke.add("mod+shift+h","Pause","glyphicon-pause",$$).prop("id","dbg_pause"),Ke.add("mod+shift+g","Go To Address","",i=>{y$()||eu()}),Ke.add("mod+shift+g","Resume","glyphicon-play",eu).prop("id","dbg_go"),Ke.add("F8","Pause/Resume","",k$),Ke.add("F1","Help","",W$),w.restartAtPC&&Ke.add("mod+shift+a","Restart at Cursor","glyphicon-play-circle",C$).prop("id","dbg_restartatline"),Ke.newGroup(),Ke.grp.prop("id","debug_bar"),w.runEval&&Ke.add("mod+shift+d","Reset and Debug","glyphicon-fast-backward",z$).prop("id","dbg_restart"),w.stepBack&&Ke.add("mod+shift+j","Step Backwards","glyphicon-step-backward",Z$).prop("id","dbg_stepback"),w.step&&Ke.add("mod+shift+l","Single Step","glyphicon-step-forward",T$).prop("id","dbg_step"),w.stepOver&&Ke.add("mod+shift+k","Step Over","glyphicon-hand-right",X$).prop("id","dbg_stepover"),w.runUntilReturn&&Ke.add("mod+shift+i","Step Out of Subroutine","glyphicon-hand-up",E$).prop("id","dbg_stepout"),w.runToVsync&&Ke.add("mod+shift+x","Next Frame/Interrupt","glyphicon-forward",_$).prop("id","dbg_tovsync"),(w.runEval||w.runToPC)&&!le.startsWith("verilog")&&Ke.add("mod+shift+y","Run To Line","glyphicon-save",A$).prop("id","dbg_toline"),Ke.newGroup(),Ke.grp.prop("id","xtra_bar"),Ke.add("mod+shift+f","Search","glyphicon-search",Sg).prop("id","dbg_search"),$(".dropdown-menu").collapse({toggle:!1}),$("#item_new_file").click(bz),$("#item_upload_file").click(xz),$("#item_open_directory").click(wz),$("#item_github_login").click(bv),$("#item_github_logout").click(xv),$("#item_github_import").click(Sv),$("#item_github_publish").click(wv),$("#item_github_push").click(vv),$("#item_github_pull").click(yv),$("#item_repo_delete").click(Pv),$("#item_share_file").click(lv),$("#item_reset_file").click(Qz),$("#item_rename_file").click($z),$("#item_delete_file").click(Pz),w.runEval?$("#item_debug_expr").click(Yz).show():$("#item_debug_expr").hide(),$("#item_download_rom").click(dv),$("#item_download_file").click(hv),$("#item_download_zip").click(fv),w.getDebugSymbolFile?$("#item_download_sym").click(Ov):$("#item_download_sym").hide(),$("#item_download_allzip").click(pv),$("#item_record_video").click(mv),Op()?$("#item_export_cassette").click(cv):$("#item_export_cassette").hide(),w.setFrameRate&&w.getFrameRate&&($("#dbg_slower").click(jz),$("#dbg_faster").click(Dz),$("#dbg_slowest").click(Iz),$("#dbg_fastest").click(qz)),$("#item_addfile_include").click(Gz),$("#item_addfile_link").click(Hz),$("#item_request_persist").click(()=>x$(!0,!1)),$("#item_settings").click(Jw),M$(),w.newCodeAnalyzer&&Ke.add(null,"Analyze CPU Timing","glyphicon-time",Fz),w.startProbing&&Ke.add(null,"Highlight Executed Lines","glyphicon-fire",Nz).prop("id","dbg_tracelines"),w.setRecorder&&w.advance&&eM(),w.showHelp){let{li:i,a:n}=Gh("help__"+le,Kh+" Help");$("#help_menu").append(i),$(n).click(s=>{s.preventDefault(),window.open(w.showHelp(),"_8bws_help")})}let r=w.getToolForFilename(lt()),e=r&&Bt(r),t=e==null?void 0:e.helpURL;if(t){let i=r+" Help";e.version&&(i+=" ("+e.version+")");let{li:n,a:s}=Gh("help__"+r,i);$("#help_menu").append(n),$(s).click(o=>{o.preventDefault(),window.open(t,"_8bws_help")})}{let{li:i}=Gh("#help","IDE Help");$("#help_menu").prepend(i)}$("#item_tool_versions").click(Jz)}function W$(){if(W){var r=W.getActive()instanceof jt,e=r$(W.getActiveID(),r),t="#help/"+e;window.location.hash===t?W.createOrShow(t):window.location.hash=t}}function Jz(){let r=u=>String(u==null?"":u).replace(/[&<>"]/g,f=>({"&":"&","<":"<",">":">",'"':"""})[f]),e=(u,f)=>"$"+be(u,4).toUpperCase()+(f!=null?"+$"+be(f,4).toUpperCase():""),t=Yr[le]||Yr[$t(le)]||Yr[Mr(le)],i=t&&t.arch||"\u2014",n=[];t&&(t.rom_start!=null&&n.push("rom "+e(t.rom_start,t.rom_size)),t.code_start!=null&&n.push("code "+e(tLine truncated
|
|
|
|
|
<table class="help">
|
|
|
|
|
<tr><th>Architecture</th><td>${r(i)}</td></tr>
|
|
|
|
|
<tr><th>Memory</th><td>${n.length?n.join(" \xB7 "):"\u2014"}</td></tr>
|
|
|
|
@@ -3553,7 +3553,7 @@ containing embeds is effectively sandboxed from the others.</p>
|
|
|
|
|
<tr><th>Tool</th><th>Kind</th><th>Version</th><th>Extensions</th></tr>
|
|
|
|
|
${h}
|
|
|
|
|
</table>
|
|
|
|
|
</div>`})}function rM(){var r=$("#replayslider"),e=$("#clockslider"),t=$("#replay_frame"),i=$("#replay_clock");w.advanceFrameClock||$("#clockdiv").hide();var n=()=>{t.text(Dt.lastSeekFrame+""),i.text(Dt.lastSeekStep+"")},s=l=>{bn();var c=parseInt(r.val().toString()),d=parseInt(e.val().toString());Dt.loadFrame(c,d)>=0&&(e.attr("min",0),e.attr("max",Dt.lastStepCount),n(),Hh(w.saveState()))},o=l=>{bn(),Dt.loadFrame(l)>=0&&(r.val(l),n(),Hh(w.saveState()))},a=l=>{bn();var c=parseInt(r.val().toString());Dt.loadFrame(c,l)>=0&&(e.val(l),n(),Hh(w.saveState()))};Dt.callbackStateChanged=()=>{r.attr("min",0),r.attr("max",Dt.numFrames()),r.val(Dt.currentFrame()),e.val(Dt.currentStep()),n(),Ol(w.saveState())},r.on("input",s),e.on("input",s),$("#replay_min").click(()=>{o(1)}),$("#replay_max").click(()=>{o(Dt.numFrames())}),$("#replay_back").click(()=>{o(parseInt(r.val().toString())-1)}),$("#replay_fwd").click(()=>{o(parseInt(r.val().toString())+1)}),$("#clock_back").click(()=>{a(parseInt(e.val().toString())-1)}),$("#clock_fwd").click(()=>{a(parseInt(e.val().toString())+1)}),$("#replay_bar").show(),Ke.add("mod+shift+e","Start/Stop Replay Recording","glyphicon-record",Gz).prop("id","dbg_record")}async function iM(){if(Ei.shouldCompleteTour()){await xr("lib/bootstrap-tourist.js");var r=le.startsWith("vcs"),e=[{element:"#platformsMenuButton",placement:"right",title:"Platform Selector",content:`You're currently on the "<b>`+le+'</b>" platform. You can choose a different one from the menu.'},{element:"#preset_select",title:"Project Selector",content:"You can choose different code examples, create your own files, or import projects from GitHub."},{element:"#workspace",title:"Code Editor",content:r?"Type your 6502 assembly code into the editor, and it'll be assembled in real-time.":"Type your source code into the editor, and it'll be compiled in real-time."},{element:"#emulator",placement:"left",title:"Emulator",content:"We'll load your compiled code into the emulator whenever you make changes."},{element:"#debug_bar",placement:"bottom",title:"Debug Tools",content:"Use these buttons to set breakpoints, single step through code, pause/resume, and use debugging tools."},{element:"#dropdownMenuButton",title:"Main Menu",content:"Click the menu to create new files, download your code, or share your work with others."},{element:"#sidebar",title:"Sidebar",content:"Pull right to expose the sidebar. It lets you switch between source files, view assembly listings, and use other tools like Disassembler, Memory Browser, and Asset Editor."}];Ps()&&(e.unshift({element:"#dropdownMenuButton",placement:"right",title:"Cookie Consent",content:'Before we start, we should tell you that this website stores persistent data in your browser. Review our <a href="/privacy.html" target="_new">privacy policy</a>.'}),e.push({element:"#booksMenuButton",placement:"left",title:"Books",content:"Get some books that explain how to program all of this stuff, and write some games!"})),vo&&(e.unshift({element:"#dropdownMenuButton",placement:"right",title:"Developer Analytics",content:"BTW, we send stack traces to sentry.io when exceptions are thrown. Hope that's ok."}),e.unshift({element:"#dropdownMenuButton",placement:"right",title:"Welcome to 8bitworkshop Desktop!",content:'The directory "~/8bitworkshop" contains all of your file edits and built ROM images. You can create new projects under the platform directories (e.g. "c64/myproject")'}));var t=new Tour({autoscroll:!1,steps:e,onEnd:()=>{Ei.completedTour()}});setTimeout(()=>{t.start()},2500)}}function tu(r){var e=(r.message||r.error||r)+"";if(e.indexOf("QuotaExceededError")>=0)hz();else{var t=r.error||r.reason;t!=null&&t instanceof yu?nM(t):Ps()&&Tb(e,t,{platform:le,window:W?W.getActiveID():"",errors:W.lasterrors||[]})}}function nM(r){console.log("haltEmulation"),bn(),xM(r)}function sM(){window.addEventListener("error",tu),window.addEventListener("unhandledrejection",tu)}function j$(){window.removeEventListener("error",tu),window.removeEventListener("unhandledrejection",tu)}function Hn(r,e){e&&(re=e),j$(),r?window.location.replace("?"+$.param(re)):window.location.href="?"+$.param(re)}function su(){le&&(re.platform=le),delete re[""],history.replaceState({},"","?"+$.param(re)+window.location.hash)}function D$(r){if(!r||r==="#")return null;var e=decodeURIComponent(r.substring(1));return e.startsWith("asseteditor/")?"#asseteditor":e.startsWith("headerview/")?(Ga(e.substring(11)),"#"+e):W.isWindow("#"+e)?"#"+e:W.isWindow(e)?e:null}function oM(){function r(){let e=window.location.hash,t=e&&e!=="#"?D$(e):null;if(t)t!==W.getActiveID()&&W.createOrShow(t);else{let i=K.mainPath;i&&W.getActiveID()!=i&&W.createOrShow(i)}}window.addEventListener("popstate",r),window.addEventListener("hashchange",r)}function aM(r){if(r&&r!=="#"){let e=D$(r)||K.mainPath;history.replaceState(null,"",r),W.createOrShow(e)}}function lM(){var r=!1;document.addEventListener("visibilitychange",()=>{document.visibilityState=="hidden"&&w&&w.isRunningLine truncated
|
|
|
|
|
</div>`})}function eM(){var r=$("#replayslider"),e=$("#clockslider"),t=$("#replay_frame"),i=$("#replay_clock");w.advanceFrameClock||$("#clockdiv").hide();var n=()=>{t.text(Dt.lastSeekFrame+""),i.text(Dt.lastSeekStep+"")},s=l=>{bn();var c=parseInt(r.val().toString()),d=parseInt(e.val().toString());Dt.loadFrame(c,d)>=0&&(e.attr("min",0),e.attr("max",Dt.lastStepCount),n(),Hh(w.saveState()))},o=l=>{bn(),Dt.loadFrame(l)>=0&&(r.val(l),n(),Hh(w.saveState()))},a=l=>{bn();var c=parseInt(r.val().toString());Dt.loadFrame(c,l)>=0&&(e.val(l),n(),Hh(w.saveState()))};Dt.callbackStateChanged=()=>{r.attr("min",0),r.attr("max",Dt.numFrames()),r.val(Dt.currentFrame()),e.val(Dt.currentStep()),n(),Ol(w.saveState())},r.on("input",s),e.on("input",s),$("#replay_min").click(()=>{o(1)}),$("#replay_max").click(()=>{o(Dt.numFrames())}),$("#replay_back").click(()=>{o(parseInt(r.val().toString())-1)}),$("#replay_fwd").click(()=>{o(parseInt(r.val().toString())+1)}),$("#clock_back").click(()=>{a(parseInt(e.val().toString())-1)}),$("#clock_fwd").click(()=>{a(parseInt(e.val().toString())+1)}),$("#replay_bar").show(),Ke.add("mod+shift+e","Start/Stop Replay Recording","glyphicon-record",Bz).prop("id","dbg_record")}async function tM(){if(Ei.shouldCompleteTour()){await xr("lib/bootstrap-tourist.js");var r=le.startsWith("vcs"),e=[{element:"#platformsMenuButton",placement:"right",title:"Platform Selector",content:`You're currently on the "<b>`+le+'</b>" platform. You can choose a different one from the menu.'},{element:"#preset_select",title:"Project Selector",content:"You can choose different code examples, create your own files, or import projects from GitHub."},{element:"#workspace",title:"Code Editor",content:r?"Type your 6502 assembly code into the editor, and it'll be assembled in real-time.":"Type your source code into the editor, and it'll be compiled in real-time."},{element:"#emulator",placement:"left",title:"Emulator",content:"We'll load your compiled code into the emulator whenever you make changes."},{element:"#debug_bar",placement:"bottom",title:"Debug Tools",content:"Use these buttons to set breakpoints, single step through code, pause/resume, and use debugging tools."},{element:"#dropdownMenuButton",title:"Main Menu",content:"Click the menu to create new files, download your code, or share your work with others."},{element:"#sidebar",title:"Sidebar",content:"Pull right to expose the sidebar. It lets you switch between source files, view assembly listings, and use other tools like Disassembler, Memory Browser, and Asset Editor."}];Ps()&&(e.unshift({element:"#dropdownMenuButton",placement:"right",title:"Cookie Consent",content:'Before we start, we should tell you that this website stores persistent data in your browser. Review our <a href="/privacy.html" target="_new">privacy policy</a>.'}),e.push({element:"#booksMenuButton",placement:"left",title:"Books",content:"Get some books that explain how to program all of this stuff, and write some games!"})),vo&&(e.unshift({element:"#dropdownMenuButton",placement:"right",title:"Developer Analytics",content:"BTW, we send stack traces to sentry.io when exceptions are thrown. Hope that's ok."}),e.unshift({element:"#dropdownMenuButton",placement:"right",title:"Welcome to 8bitworkshop Desktop!",content:'The directory "~/8bitworkshop" contains all of your file edits and built ROM images. You can create new projects under the platform directories (e.g. "c64/myproject")'}));var t=new Tour({autoscroll:!1,steps:e,onEnd:()=>{Ei.completedTour()}});setTimeout(()=>{t.start()},2500)}}function tu(r){var e=(r.message||r.error||r)+"";if(e.indexOf("QuotaExceededError")>=0)cz();else{var t=r.error||r.reason;t!=null&&t instanceof yu?rM(t):Ps()&&kb(e,t,{platform:le,window:W?W.getActiveID():"",errors:W.lasterrors||[]})}}function rM(r){console.log("haltEmulation"),bn(),gM(r)}function iM(){window.addEventListener("error",tu),window.addEventListener("unhandledrejection",tu)}function V$(){window.removeEventListener("error",tu),window.removeEventListener("unhandledrejection",tu)}function Hn(r,e){e&&(re=e),V$(),r?window.location.replace("?"+$.param(re)):window.location.href="?"+$.param(re)}function su(){le&&(re.platform=le),delete re[""],history.replaceState({},"","?"+$.param(re)+window.location.hash)}function j$(r){if(!r||r==="#")return null;var e=decodeURIComponent(r.substring(1));return e.startsWith("asseteditor/")?"#asseteditor":e.startsWith("headerview/")?(Ga(e.substring(11)),"#"+e):W.isWindow("#"+e)?"#"+e:W.isWindow(e)?e:null}function nM(){function r(){let e=window.location.hash,t=e&&e!=="#"?j$(e):null;if(t)t!==W.getActiveID()&&W.createOrShow(t);else{let i=K.mainPath;i&&W.getActiveID()!=i&&W.createOrShow(i)}}window.addEventListener("popstate",r),window.addEventListener("hashchange",r)}function sM(r){if(r&&r!=="#"){let e=j$(r)||K.mainPath;history.replaceState(null,"",r),W.createOrShow(e)}}function oM(){var r=!1;document.addEventListener("visibilitychange",()=>{document.visibilityState=="hidden"&&w&&w.isRunningLine truncated
|
|
|
|
|
/*! Bundled license information:
|
|
|
|
|
|
|
|
|
|
localforage/dist/localforage.js:
|
|
|
|
@@ -3567,4 +3567,4 @@ localforage/dist/localforage.js:
|
|
|
|
|
dompurify/dist/purify.cjs.js:
|
|
|
|
|
(*! @license DOMPurify 3.4.15 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.15/LICENSE *)
|
|
|
|
|
*/
|
|
|
|
|
//# sourceMappingURL=chunk-42RNKHZX.js.map
|
|
|
|
|
//# sourceMappingURL=chunk-YP6JMRCE.js.map
|