@typescript/sandbox
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -1,2 +0,2 @@ | ||
"use strict";function e(){e=function(){return r};var t,r={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},s="function"==typeof Symbol?Symbol:{},a=s.iterator||"@@iterator",u=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(t){l=function(e,t,r){return e[t]=r}}function f(e,t,r,n){var o=Object.create((t&&t.prototype instanceof y?t:y).prototype),s=new D(n||[]);return i(o,"_invoke",{value:j(e,r,s)}),o}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}r.wrap=f;var d="suspendedStart",m="suspendedYield",h="executing",g="completed",v={};function y(){}function b(){}function w(){}var x={};l(x,a,(function(){return this}));var k=Object.getPrototypeOf,S=k&&k(k(A([])));S&&S!==n&&o.call(S,a)&&(x=S);var C=w.prototype=y.prototype=Object.create(x);function F(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(n,i,s,a){var u=p(e[n],e,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==typeof l&&o.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,s,a)}),(function(e){r("throw",e,s,a)})):t.resolve(l).then((function(e){c.value=e,s(c)}),(function(e){return r("throw",e,s,a)}))}a(u.arg)}var n;i(this,"_invoke",{value:function(e,o){function i(){return new t((function(t,n){r(e,o,t,n)}))}return n=n?n.then(i,i):i()}})}function j(e,r,n){var o=d;return function(i,s){if(o===h)throw Error("Generator is already running");if(o===g){if("throw"===i)throw s;return{value:t,done:!0}}for(n.method=i,n.arg=s;;){var a=n.delegate;if(a){var u=L(a,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var c=p(e,r,n);if("normal"===c.type){if(o=n.done?g:m,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=g,n.method="throw",n.arg=c.arg)}}}function L(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,L(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=p(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var s=i.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function N(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function D(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function r(){for(;++n<e.length;)if(o.call(e,n))return r.value=e[n],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return b.prototype=w,i(C,"constructor",{value:w,configurable:!0}),i(w,"constructor",{value:b,configurable:!0}),b.displayName=l(w,c,"GeneratorFunction"),r.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,l(e,c,"GeneratorFunction")),e.prototype=Object.create(C),e},r.awrap=function(e){return{__await:e}},F(E.prototype),l(E.prototype,u,(function(){return this})),r.AsyncIterator=E,r.async=function(e,t,n,o,i){void 0===i&&(i=Promise);var s=new E(f(e,t,n,o),i);return r.isGeneratorFunction(t)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},F(C),l(C,c,"Generator"),l(C,a,(function(){return this})),l(C,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=A,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var u=o.call(s,"catchLoc"),c=o.call(s,"finallyLoc");if(u&&c){if(this.prev<s.catchLoc)return n(s.catchLoc,!0);if(this.prev<s.finallyLoc)return n(s.finallyLoc)}else if(u){if(this.prev<s.catchLoc)return n(s.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return n(s.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=e,s.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),N(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;N(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},r}function t(e,t,r,n,o,i,s){try{var a=e[i](s),u=a.value}catch(e){return void r(e)}a.done?t(u):Promise.resolve(u).then(n,o)}function r(e){return function(){var r=this,n=arguments;return new Promise((function(o,i){var s=e.apply(r,n);function a(e){t(s,o,i,a,u,"next",e)}function u(e){t(s,o,i,a,u,"throw",e)}a(void 0)}))}}function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},n.apply(this,arguments)}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function i(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}Object.defineProperty(exports,"__esModule",{value:!0});var s="0c840a",a={base:"vs",inherit:!0,rules:[{token:"",foreground:"000000",background:"fffffe"},{token:"invalid",foreground:"cd3131"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"11bb11"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"44ee11"},{token:"comment",foreground:"6c6f2d"},{token:"number",foreground:s},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"#811f3f"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"1142AF"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"delimiter.xml",foreground:"0000FF"},{token:"tag",foreground:"800000"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"string",foreground:s},{token:"keyword",foreground:"3757ef"},{token:"keyword.json",foreground:"0451A5"}],colors:{editorBackground:"#fafafa",editorForeground:"#000000",editorInactiveSelection:"#E5EBF1",editorIndentGuides:"#D3D3D3",editorActiveIndentGuides:"#939393",editorSelectionHighlight:"#ADD6FF4D"}},u={base:"vs-dark",inherit:!0,rules:[{token:"constant",foreground:"44ee11"},{token:"comment",foreground:"7caf3d"},{token:"regexp",foreground:"#811f3f"}],colors:{}},c=function(e,t){for(var r=e,o=new URLSearchParams(document.location.search),i=r.getCompilerOptions(),s=r.compilerDefaults,a=Object.entries(i).reduce((function(e,t){var r=t[0];return t[1]!==s[r]&&(e[r]=i[r]),e}),{}),u="code/"+r.lzstring.compressToEncodedURIComponent(r.getText()),c=Object.assign({},a),l=0,f=["lib","ts"];l<f.length;l++){var p=f[l],d=new URLSearchParams(location.search);d.has(p)&&(c.ts="ts"!==p||"Nightly"!==d.get(p)&&"next"!==d.get(p)?d.get(p):r.ts.version)}var m=r.editor.getSelection(),h=m&&m.selectionStartLineNumber!==m.positionLineNumber||m&&m.selectionStartColumn!==m.positionColumn,g=r.editor.getModel().getFullModelRange();!m||!h||m&&m.selectionStartLineNumber===g.startLineNumber&&m.selectionStartColumn===g.startColumn&&m.positionColumn===g.endColumn&&m.positionLineNumber===g.endLineNumber?(c.ssl=void 0,c.ssc=void 0,c.pln=void 0,c.pc=void 0):(c.ssl=m.selectionStartLineNumber,c.ssc=m.selectionStartColumn,c.pln=m.positionLineNumber,c.pc=m.positionColumn),"ts"!==r.config.filetype&&(c.filetype=r.config.filetype),t&&(c=n({},c,t));var v=o.keys().length>0;if(Object.keys(c).length>0||v){var y=Object.entries(c).filter((function(e){return void 0!==e[1]})).filter((function(e){return null!==e[1]})).map((function(e){return e[0]+"="+encodeURIComponent(e[1])})).join("&");return o.forEach((function(e,t){["ssl","ssc","pln","pc"].includes(t)||y.includes(t)||i[t]||(y+="&"+t+"="+e)})),"?"+y+"#"+u}return"#"+u};function l(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var f={exports:{}};null!=f&&(f.exports=function(){function e(e,t){if(!o[e]){o[e]={};for(var r=0;r<e.length;r++)o[e][e.charAt(r)]=r}return o[e][t]}var t=String.fromCharCode,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",o={},i={compressToBase64:function(e){if(null==e)return"";var t=i._compress(e,6,(function(e){return r.charAt(e)}));switch(t.length%4){default:case 0:return t;case 1:return t+"===";case 2:return t+"==";case 3:return t+"="}},decompressFromBase64:function(t){return null==t?"":""==t?null:i._decompress(t.length,32,(function(n){return e(r,t.charAt(n))}))},compressToUTF16:function(e){return null==e?"":i._compress(e,15,(function(e){return t(e+32)}))+" "},decompressFromUTF16:function(e){return null==e?"":""==e?null:i._decompress(e.length,16384,(function(t){return e.charCodeAt(t)-32}))},compressToUint8Array:function(e){for(var t=i.compress(e),r=new Uint8Array(2*t.length),n=0,o=t.length;o>n;n++){var s=t.charCodeAt(n);r[2*n]=s>>>8,r[2*n+1]=s%256}return r},decompressFromUint8Array:function(e){if(null==e)return i.decompress(e);for(var r=new Array(e.length/2),n=0,o=r.length;o>n;n++)r[n]=256*e[2*n]+e[2*n+1];var s=[];return r.forEach((function(e){s.push(t(e))})),i.decompress(s.join(""))},compressToEncodedURIComponent:function(e){return null==e?"":i._compress(e,6,(function(e){return n.charAt(e)}))},decompressFromEncodedURIComponent:function(t){return null==t?"":""==t?null:(t=t.replace(/ /g,"+"),i._decompress(t.length,32,(function(r){return e(n,t.charAt(r))})))},compress:function(e){return i._compress(e,16,(function(e){return t(e)}))},_compress:function(e,t,r){if(null==e)return"";var n,o,i,s={},a={},u="",c="",l="",f=2,p=3,d=2,m=[],h=0,g=0;for(i=0;i<e.length;i+=1)if(u=e.charAt(i),Object.prototype.hasOwnProperty.call(s,u)||(s[u]=p++,a[u]=!0),c=l+u,Object.prototype.hasOwnProperty.call(s,c))l=c;else{if(Object.prototype.hasOwnProperty.call(a,l)){if(l.charCodeAt(0)<256){for(n=0;d>n;n++)h<<=1,g==t-1?(g=0,m.push(r(h)),h=0):g++;for(o=l.charCodeAt(0),n=0;8>n;n++)h=h<<1|1&o,g==t-1?(g=0,m.push(r(h)),h=0):g++,o>>=1}else{for(o=1,n=0;d>n;n++)h=h<<1|o,g==t-1?(g=0,m.push(r(h)),h=0):g++,o=0;for(o=l.charCodeAt(0),n=0;16>n;n++)h=h<<1|1&o,g==t-1?(g=0,m.push(r(h)),h=0):g++,o>>=1}0==--f&&(f=Math.pow(2,d),d++),delete a[l]}else for(o=s[l],n=0;d>n;n++)h=h<<1|1&o,g==t-1?(g=0,m.push(r(h)),h=0):g++,o>>=1;0==--f&&(f=Math.pow(2,d),d++),s[c]=p++,l=String(u)}if(""!==l){if(Object.prototype.hasOwnProperty.call(a,l)){if(l.charCodeAt(0)<256){for(n=0;d>n;n++)h<<=1,g==t-1?(g=0,m.push(r(h)),h=0):g++;for(o=l.charCodeAt(0),n=0;8>n;n++)h=h<<1|1&o,g==t-1?(g=0,m.push(r(h)),h=0):g++,o>>=1}else{for(o=1,n=0;d>n;n++)h=h<<1|o,g==t-1?(g=0,m.push(r(h)),h=0):g++,o=0;for(o=l.charCodeAt(0),n=0;16>n;n++)h=h<<1|1&o,g==t-1?(g=0,m.push(r(h)),h=0):g++,o>>=1}0==--f&&(f=Math.pow(2,d),d++),delete a[l]}else for(o=s[l],n=0;d>n;n++)h=h<<1|1&o,g==t-1?(g=0,m.push(r(h)),h=0):g++,o>>=1;0==--f&&(f=Math.pow(2,d),d++)}for(o=2,n=0;d>n;n++)h=h<<1|1&o,g==t-1?(g=0,m.push(r(h)),h=0):g++,o>>=1;for(;;){if(h<<=1,g==t-1){m.push(r(h));break}g++}return m.join("")},decompress:function(e){return null==e?"":""==e?null:i._decompress(e.length,32768,(function(t){return e.charCodeAt(t)}))},_decompress:function(e,r,n){var o,i,s,a,u,c,l,f=[],p=4,d=4,m=3,h="",g=[],v={val:n(0),position:r,index:1};for(o=0;3>o;o+=1)f[o]=o;for(s=0,u=Math.pow(2,2),c=1;c!=u;)a=v.val&v.position,v.position>>=1,0==v.position&&(v.position=r,v.val=n(v.index++)),s|=(a>0?1:0)*c,c<<=1;switch(s){case 0:for(s=0,u=Math.pow(2,8),c=1;c!=u;)a=v.val&v.position,v.position>>=1,0==v.position&&(v.position=r,v.val=n(v.index++)),s|=(a>0?1:0)*c,c<<=1;l=t(s);break;case 1:for(s=0,u=Math.pow(2,16),c=1;c!=u;)a=v.val&v.position,v.position>>=1,0==v.position&&(v.position=r,v.val=n(v.index++)),s|=(a>0?1:0)*c,c<<=1;l=t(s);break;case 2:return""}for(f[3]=l,i=l,g.push(l);;){if(v.index>e)return"";for(s=0,u=Math.pow(2,m),c=1;c!=u;)a=v.val&v.position,v.position>>=1,0==v.position&&(v.position=r,v.val=n(v.index++)),s|=(a>0?1:0)*c,c<<=1;switch(l=s){case 0:for(s=0,u=Math.pow(2,8),c=1;c!=u;)a=v.val&v.position,v.position>>=1,0==v.position&&(v.position=r,v.val=n(v.index++)),s|=(a>0?1:0)*c,c<<=1;f[d++]=t(s),l=d-1,p--;break;case 1:for(s=0,u=Math.pow(2,16),c=1;c!=u;)a=v.val&v.position,v.position>>=1,0==v.position&&(v.position=r,v.val=n(v.index++)),s|=(a>0?1:0)*c,c<<=1;f[d++]=t(s),l=d-1,p--;break;case 2:return g.join("")}if(0==p&&(p=Math.pow(2,m),m++),f[l])h=f[l];else{if(l!==d)return null;h=i+i.charAt(0)}g.push(h),f[d++]=i+h.charAt(0),i=h,0==--p&&(p=Math.pow(2,m),m++)}}};return i}());var p=l(f.exports),d=["5.5.0-beta","5.4.5","5.3.3","5.2.2","5.1.6","5.0.4","4.9.5","4.8.4","4.7.4","4.6.4","4.5.5","4.4.4","4.3.5","4.2.3","4.1.5","4.0.5","3.9.7","3.8.3","3.7.5","3.6.3","3.5.1","3.3.3","3.1.6","3.0.1","2.8.1","2.7.2","2.4.1"],m=/^\/\/\s?@(\w+)$/,h=/^\/\/\s?@(\w+):\s?(.+)$/;function g(e,t,r,n){var o=n.get(e.toLowerCase());if(o){switch(o.type){case"number":case"string":case"boolean":r[o.name]=v(t,o.type);break;case"list":var i=o.element.type,s=t.split(",");r[o.name]="string"==typeof i?s.map((function(e){return v(e,i)})):s.map((function(e){return y(o.name,e,i)})).filter(Boolean);break;default:r[o.name]=y(o.name,t,o.type)}if(void 0===r[o.name]){var a=Array.from(o.type.keys());console.log("Invalid value "+t+" for "+o.name+". Allowed values: "+a.join(","))}}}function v(e,t){switch(t){case"number":return+e;case"string":return e;case"boolean":return"true"===e.toLowerCase()||0===e.length}console.log("Unknown primitive type "+t+" with - "+e)}function y(e,t,r){var n=r.get(t.toLowerCase());if(void 0===n){var o=Array.from(r.keys());console.error("Invalid inline compiler value","Got "+t+" for "+e+" but it is not a supported value by the TS compiler.","Allowed values: "+o.join(","))}return n}var b=function(e,t){return function(t,r,n){var o=[],i=t.getValueInRange({startLineNumber:r.lineNumber,startColumn:0,endLineNumber:r.lineNumber,endColumn:r.column});if(!i.startsWith("//"))return{suggestions:[]};var s=i.replace("\t","").split(" ");if(2!==s.length)return{suggestions:[]};var a=s[1];if(a.startsWith("-"))return{suggestions:[{label:"---cut---",kind:14,detail:"Twoslash split output",insertText:"---cut---".replace(a,"")}]};if(!a.startsWith("@"))return{suggestions:[]};var u=e.optionDeclarations.map((function(e){return e.name}));return["noErrors","errors","showEmit","showEmittedFile","noStaticSemanticInfo","emit","noErrorValidation","filename"].concat(u).forEach((function(e){e.startsWith(a.slice(1))&&o.push({label:e,kind:14,detail:"Twoslash comment",insertText:e})})),{suggestions:o}}},w=!1;try{w="undefined"!=typeof localStorage}catch(e){}var x="undefined"!=typeof process,k=w&&localStorage.getItem("DEBUG")||x&&process.env.DEBUG?console.log:function(e){return""},S=function(e,t){var r,n=e.lib||[],o=["lib.d.ts","lib.decorators.d.ts","lib.decorators.legacy.d.ts","lib.dom.d.ts","lib.dom.iterable.d.ts","lib.webworker.d.ts","lib.webworker.importscripts.d.ts","lib.webworker.iterable.d.ts","lib.scripthost.d.ts","lib.es5.d.ts","lib.es6.d.ts","lib.es2015.collection.d.ts","lib.es2015.core.d.ts","lib.es2015.d.ts","lib.es2015.generator.d.ts","lib.es2015.iterable.d.ts","lib.es2015.promise.d.ts","lib.es2015.proxy.d.ts","lib.es2015.reflect.d.ts","lib.es2015.symbol.d.ts","lib.es2015.symbol.wellknown.d.ts","lib.es2016.array.include.d.ts","lib.es2016.d.ts","lib.es2016.full.d.ts","lib.es2017.d.ts","lib.es2017.date.d.ts","lib.es2017.full.d.ts","lib.es2017.intl.d.ts","lib.es2017.object.d.ts","lib.es2017.sharedmemory.d.ts","lib.es2017.string.d.ts","lib.es2017.typedarrays.d.ts","lib.es2018.asyncgenerator.d.ts","lib.es2018.asynciterable.d.ts","lib.es2018.d.ts","lib.es2018.full.d.ts","lib.es2018.intl.d.ts","lib.es2018.promise.d.ts","lib.es2018.regexp.d.ts","lib.es2019.array.d.ts","lib.es2019.d.ts","lib.es2019.full.d.ts","lib.es2019.intl.d.ts","lib.es2019.object.d.ts","lib.es2019.string.d.ts","lib.es2019.symbol.d.ts","lib.es2020.bigint.d.ts","lib.es2020.d.ts","lib.es2020.date.d.ts","lib.es2020.full.d.ts","lib.es2020.intl.d.ts","lib.es2020.number.d.ts","lib.es2020.promise.d.ts","lib.es2020.sharedmemory.d.ts","lib.es2020.string.d.ts","lib.es2020.symbol.wellknown.d.ts","lib.es2021.d.ts","lib.es2021.full.d.ts","lib.es2021.intl.d.ts","lib.es2021.promise.d.ts","lib.es2021.string.d.ts","lib.es2021.weakref.d.ts","lib.es2022.array.d.ts","lib.es2022.d.ts","lib.es2022.error.d.ts","lib.es2022.full.d.ts","lib.es2022.intl.d.ts","lib.es2022.object.d.ts","lib.es2022.regexp.d.ts","lib.es2022.sharedmemory.d.ts","lib.es2022.string.d.ts","lib.es2023.array.d.ts","lib.es2023.collection.d.ts","lib.es2023.d.ts","lib.es2023.full.d.ts","lib.esnext.array.d.ts","lib.esnext.asynciterable.d.ts","lib.esnext.bigint.d.ts","lib.esnext.d.ts","lib.esnext.decorators.d.ts","lib.esnext.disposable.d.ts","lib.esnext.full.d.ts","lib.esnext.intl.d.ts","lib.esnext.promise.d.ts","lib.esnext.string.d.ts","lib.esnext.symbol.d.ts","lib.esnext.weakref.d.ts"],i=t.ScriptTarget[e.target||t.ScriptTarget.ES5],s=o.filter((function(e){return e.startsWith("lib."+i.toLowerCase())})),a=o.indexOf(s.pop()),u=n.map((function(e){var t=o.filter((function(t){return t.startsWith("lib."+e.toLowerCase())}));return 0===t.length?0:o.indexOf(t.pop())})),c=((r=u)&&r.length?r.reduce((function(e,t){return t>e?t:e})):void 0)||0,l=Math.max(a,c);return o.slice(0,l+1)},C=function(e,t){var r=T(),n=M();(function e(t){var o=[];return n.readdirSync(t).forEach((function(i){i=r.join(t,i);var s=n.statSync(i);s&&s.isDirectory()?o=o.concat(e(i)):o.push(i)})),o})(t).forEach((function(o){var i="/node_modules/@types"+o.replace(t,""),s=n.readFileSync(o,"utf8");[".ts",".tsx"].includes(r.extname(i))&&e.set(i,s)}))},F=function(e,t,r,n,o,i,s){var a=i||fetch,u=new Map,c=S(e,n),l="https://playgroundcdn.typescriptlang.org/cdn/"+t+"/typescript/lib/";return(r?function(){var e=s||localStorage;return Object.keys(e).forEach((function(r){r.startsWith("ts-lib-")&&!r.startsWith("ts-lib-"+t)&&e.removeItem(r)})),Promise.all(c.map((function(r){var n,i="ts-lib-"+t+"-"+r,s=e.getItem(i);return s?Promise.resolve((n=s,o?o.decompressFromUTF16(n):n)):a(l+r).then((function(e){return e.text()})).then((function(t){var r;return e.setItem(i,(r=t,o?o.compressToUTF16(r):r)),t})).catch((function(){}))}))).then((function(e){e.forEach((function(e,t){e&&u.set("/"+c[t],e)}))}))}:function(){return Promise.all(c.map((function(e){return a(l+e).then((function(e){return e.text()}))}))).then((function(e){e.forEach((function(e,t){return u.set("/"+c[t],e)}))})).catch((function(){}))})().then((function(){return u}))};function E(e){throw new Error("Method '"+e+"' is not implemented.")}function j(e,t){return function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];var i=t.apply(void 0,n),s="string"==typeof i?i.slice(0,80)+"...":i;return k.apply(void 0,["> "+e].concat(n)),k("< "+s),i}}var L=function(e){return n({},e.getDefaultCompilerOptions(),{jsx:e.JsxEmit.React,strict:!0,esModuleInterop:!0,module:e.ModuleKind.ESNext,suppressOutputPathCheck:!0,skipLibCheck:!0,skipDefaultLibCheck:!0,moduleResolution:e.ModuleResolutionKind.NodeJs})},O=function(e){return e.replace("/","/lib.").toLowerCase()};function N(e){return{args:[],createDirectory:function(){return E("createDirectory")},directoryExists:j("directoryExists",(function(t){return Array.from(e.keys()).some((function(e){return e.startsWith(t)}))})),exit:function(){return E("exit")},fileExists:j("fileExists",(function(t){return e.has(t)||e.has(O(t))})),getCurrentDirectory:function(){return"/"},getDirectories:function(){return[]},getExecutingFilePath:function(){return E("getExecutingFilePath")},readDirectory:j("readDirectory",(function(t){return"/"===t?Array.from(e.keys()):[]})),readFile:j("readFile",(function(t){return e.get(t)||e.get(O(t))})),resolvePath:function(e){return e},newLine:"\n",useCaseSensitiveFileNames:!0,write:function(){return E("write")},writeFile:function(t,r){e.set(t,r)}}}function D(e,t,r){var o=new Map;return{compilerHost:n({},e,{getCanonicalFileName:function(e){return e},getDefaultLibFileName:function(){return"/"+r.getDefaultLibFileName(t)},getDirectories:function(){return[]},getNewLine:function(){return e.newLine},getSourceFile:function(n){return o.get(n)||(i=r.createSourceFile(n,e.readFile(n),t.target||L(r).target,!1),o.set(i.fileName,i),i);var i},useCaseSensitiveFileNames:function(){return e.useCaseSensitiveFileNames}}),updateFile:function(t){var r=o.has(t.fileName);return e.writeFile(t.fileName,t.text),o.set(t.fileName,t),r}}}function A(e,t,r,o,i){var s=[].concat(t),a=D(e,r,o),u=a.compilerHost,c=a.updateFile,l=new Map,f=0;return{languageServiceHost:n({},u,{getProjectVersion:function(){return f.toString()},getCompilationSettings:function(){return r},getCustomTransformers:function(){return i},getScriptFileNames:function(){return s.slice()},getScriptSnapshot:function(t){var r=e.readFile(t);if(r&&"string"==typeof r)return o.ScriptSnapshot.fromString(r)},getScriptVersion:function(e){return l.get(e)||"0"},writeFile:e.writeFile}),updateFile:function(e){f++,l.set(e.fileName,f.toString()),s.includes(e.fileName)||s.push(e.fileName),c(e)}}}var T=function(){return require(String.fromCharCode(112,97,116,104))},M=function(){return require(String.fromCharCode(102,115))},I={__proto__:null,addAllFilesFromFolder:C,addFilesForTypesIntoFolder:function(e){return C(e,"node_modules/@types")},createDefaultMapFromCDN:F,createDefaultMapFromNodeModules:function(e,t,r){var n=T(),o=M(),i=o.readdirSync(r||n.dirname(require.resolve("typescript"))).filter((function(e){return e.startsWith("lib.")&&e.endsWith(".d.ts")})),s=new Map;return i.forEach((function(e){s.set("/"+e,function(e){var t=r||n.dirname(require.resolve("typescript"));return o.readFileSync(n.join(t,e),"utf8")}(e))})),s},createFSBackedSystem:function(e,t,r,n){var o=t+"/vfs",i=T(),s=r.sys,a=null!=n?n:i.dirname(require.resolve("typescript"));return{name:"fs-vfs",root:o,args:[],createDirectory:function(){return E("createDirectory")},directoryExists:j("directoryExists",(function(t){return Array.from(e.keys()).some((function(e){return e.startsWith(t)}))||s.directoryExists(t)})),exit:s.exit,fileExists:j("fileExists",(function(t){if(e.has(t))return!0;if(t.includes("tsconfig.json")||t.includes("tsconfig.json"))return!1;if(t.startsWith("/lib")){var r=a+"/"+t.replace("/","");return s.fileExists(r)}return s.fileExists(t)})),getCurrentDirectory:function(){return o},getDirectories:s.getDirectories,getExecutingFilePath:function(){return E("getExecutingFilePath")},readDirectory:j("readDirectory",(function(){return"/"===(arguments.length<=0?void 0:arguments[0])?Array.from(e.keys()):s.readDirectory.apply(s,arguments)})),readFile:j("readFile",(function(t){if(e.has(t))return e.get(t);if(t.startsWith("/lib")){var r=a+"/"+t.replace("/",""),n=s.readFile(r);if(!n){var o=s.readDirectory(a);throw new Error("TSVFS: A request was made for "+r+" but there wasn't a file found in the file map. You likely have a mismatch in the compiler options for the CDN download vs the compiler program. Existing Libs: "+o+".")}return n}return s.readFile(t)})),resolvePath:function(t){return e.has(t)?t:s.resolvePath(t)},newLine:"\n",useCaseSensitiveFileNames:!0,write:function(){return E("write")},writeFile:function(t,r){e.set(t,r)}}},createSystem:N,createVirtualCompilerHost:D,createVirtualLanguageServiceHost:A,createVirtualTypeScriptEnvironment:function(e,t,r,o,i){void 0===o&&(o={});var s=n({},L(r),o),a=A(e,t,s,r,i),u=a.updateFile,c=r.createLanguageService(a.languageServiceHost),l=c.getCompilerOptionsDiagnostics();if(l.length){var f=D(e,o,r);throw new Error(r.formatDiagnostics(l,f.compilerHost))}return{name:"vfs",sys:e,languageService:c,getSourceFile:function(e){var t;return null==(t=c.getProgram())?void 0:t.getSourceFile(e)},createFile:function(e,t){u(r.createSourceFile(e,t,s.target,!1))},updateFile:function(e,t,n){var o=c.getProgram().getSourceFile(e);if(!o)throw new Error("Did not find a source file for "+e);var i=o.text,s=null!=n?n:r.createTextSpan(0,i.length),a=i.slice(0,s.start)+t+i.slice(s.start+s.length),l=r.updateSourceFile(o,a,{span:s,newLength:t.length});u(l)}}},knownLibFilesForCompilerOptions:S},P=function(e,t){return R(e,"https://data.jsdelivr.com/v1/package/npm/"+t,{cache:"no-store"})},_=function(e,t,r){return R(e,"https://data.jsdelivr.com/v1/package/resolve/npm/"+t+"@"+r)},W=function(){var t=r(e().mark((function t(r,o,i){var s,a;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s="https://data.jsdelivr.com/v1/package/npm/"+o+"@"+i+"/flat",e.next=3,R(r,s);case 3:if(!((a=e.sent)instanceof Error)){e.next=8;break}return e.abrupt("return",a);case 8:return e.abrupt("return",n({},a,{moduleName:o,version:i}));case 9:case"end":return e.stop()}}),t)})));return function(e,r,n){return t.apply(this,arguments)}}(),U=function(){var t=r(e().mark((function t(r,n,o,i){var s,a,u;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s="https://cdn.jsdelivr.net/npm/"+n+"@"+o+i,a=r.fetcher||fetch,e.next=4,a(s);case 4:if(!(u=e.sent).ok){e.next=9;break}return e.abrupt("return",u.text());case 9:return e.abrupt("return",new Error("OK"));case 10:case"end":return e.stop()}}),t)})));return function(e,r,n,o){return t.apply(this,arguments)}}();function R(e,t,r){return(e.fetcher||fetch)(t,r).then((function(e){return e.ok?e.json().then((function(e){return e})):new Error("OK")}))}var G=function(e){if(["assert","assert/strict","async_hooks","buffer","child_process","cluster","console","constants","crypto","dgram","diagnostics_channel","dns","dns/promises","domain","events","fs","fs/promises","http","http2","https","inspector","module","net","os","path","path/posix","path/win32","perf_hooks","process","punycode","querystring","readline","repl","stream","stream/promises","stream/consumers","stream/web","string_decoder","sys","timers","timers/promises","tls","trace_events","tty","url","util","util/types","v8","vm","wasi","worker_threads","zlib"].includes(e.replace("node:","")))return"node";var t=e.split("/"),r=t[0],n=void 0===r?"":r,o=t[1],i=void 0===o?"":o;return n.startsWith("@")?n+"/"+i:n};function V(e,t){for(var r,n=[],o=i(e.files);!(r=o()).done;){var s=r.value;s.name.endsWith(".d.ts")&&n.push({moduleName:e.moduleName,moduleVersion:e.version,vfsPath:""+t+s.name,path:s.name})}return n}function B(e,t,r){return function(e,t){var r=e.preProcessFile(t),n=e.libMap||new Map;return r.referencedFiles.concat(r.importedFiles).concat(r.libReferenceDirectives).filter((function(e){return!e.fileName.endsWith(".d.ts")})).filter((function(e){return!n.has(e.fileName)})).map((function(e){var r=void 0;if(!e.fileName.startsWith(".")){r="latest";var n=t.slice(e.end).split("\n")[0];n.includes("// types:")&&(r=n.split("// types: ")[1].trim())}return{module:e.fileName,version:r}}))}(e.typescript,r).map((function(e){return n({},e,{module:G(e.module)})})).filter((function(e){return!e.module.startsWith(".")})).filter((function(e){return!t.has(e.module)}))}var H=function(){var t=r(e().mark((function t(r,n,o){var i,s,a,u,c,l;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((i=o||"latest").split(".").length<2)){e.next=17;break}return e.next=4,_(r,n,i);case 4:if(!((s=e.sent)instanceof Error)){e.next=7;break}return e.abrupt("return",{error:s,userFacingMessage:"Could not go from a tag to version on npm for "+n+" - possible typo?"});case 7:if(a=s.version){e.next=16;break}return e.next=11,P(r,n);case 11:if(!((u=e.sent)instanceof Error)){e.next=14;break}return e.abrupt("return",{error:s,userFacingMessage:"Could not get versions on npm for "+n+" - possible typo?"});case 14:return c=Object.entries(u.tags).join(", "),e.abrupt("return",{error:new Error("Could not find tag for module"),userFacingMessage:"Could not find a tag for "+n+" called "+o+". Did find "+c});case 16:i=a;case 17:return e.next=19,W(r,n,i);case 19:if(!((l=e.sent)instanceof Error)){e.next=22;break}return e.abrupt("return",{error:l,userFacingMessage:"Could not get the files for "+n+"@"+i+". Is it possibly a typo?"});case 22:return e.abrupt("return",l);case 23:case"end":return e.stop()}}),t)})));return function(e,r,n){return t.apply(this,arguments)}}();function q(e){return 0===e.indexOf("@")&&-1!==e.indexOf("/")&&(e=e.substr(1).replace("/","__")),e}var J=navigator&&/android/i.test(navigator.userAgent),K={scrollBeyondLastLine:!0,scrollBeyondLastColumn:3,minimap:{enabled:!1},lightbulb:{enabled:!0},quickSuggestions:{other:!J,comments:!J,strings:!J},acceptSuggestionOnCommitCharacter:!J,acceptSuggestionOnEnter:J?"off":"on",accessibilitySupport:J?"off":"on",inlayHints:{enabled:!0}};function z(){return{text:"",domID:"",compilerOptions:{},acquireTypes:!0,filetype:"ts",supportTwoslashCompilerOptions:!1,logger:console}}exports.createTypeScriptSandbox=function(t,o,s){if(!("domID"in t)&&!("elementToAppend"in t))throw new Error("You did not provide a domID or elementToAppend");var l,f=n({},z(),t),v=f.suppressAutomaticallyGettingDefaultText?f.text:function(e,t){if(t.hash.startsWith("#src")){var r=t.hash.replace("#src=","").trim();return decodeURIComponent(r)}if(t.hash.startsWith("#code")){var n=t.hash.replace("#code/","").trim(),o=p.decompressFromEncodedURIComponent(n);return o||(o=p.decompressFromEncodedURIComponent(decodeURIComponent(n))),o}return localStorage.getItem("sandbox-history")?localStorage.getItem("sandbox-history"):e}(f.text,document.location),y=function(e,t,r){var o=r.versionMajorMinor.split(".").map((function(e){return parseInt(e)})),i="js"===e.filetype,s={strict:!0,noImplicitAny:!0,strictNullChecks:!i,strictFunctionTypes:!0,strictPropertyInitialization:!0,strictBindCallApply:!0,noImplicitThis:!0,noImplicitReturns:!0,noUncheckedIndexedAccess:!1,useDefineForClassFields:!1,alwaysStrict:!0,allowUnreachableCode:!1,allowUnusedLabels:!1,downlevelIteration:!1,noEmitHelpers:!1,noLib:!1,noStrictGenericChecks:!1,noUnusedLocals:!1,noUnusedParameters:!1,esModuleInterop:!0,preserveConstEnums:!1,removeComments:!1,skipLibCheck:!1,checkJs:i,allowJs:i,declaration:!0,importHelpers:!1,experimentalDecorators:!0,emitDecoratorMetadata:!0,moduleResolution:t.languages.typescript.ModuleResolutionKind.NodeJs,target:t.languages.typescript.ScriptTarget.ES2017,jsx:t.languages.typescript.JsxEmit.React,module:t.languages.typescript.ModuleKind.ESNext};return o[0]>=5&&(s.experimentalDecorators=!1,s.emitDecoratorMetadata=!1),n({},s,e.compilerOptions)}(f,o,s);if(f.suppressAutomaticallyGettingCompilerFlags)l=y;else{var w=new URLSearchParams(location.search),x=function(e,t,r){var n={};return r.forEach((function(r,o){if(e[o]){var i=void 0;"true"===r&&!0!==e[o]?i=!0:"false"===r&&!1!==e[o]?i=!1:isNaN(parseInt(r,10))||e[o]===parseInt(r,10)||(i=parseInt(r,10)),void 0!==i&&(n[o]=i)}else if(t.optionDeclarations.find((function(e){return e.name===o}))){var s=!0;"false"===r&&(s=!1),isNaN(parseInt(r,10))||(s=parseInt(r,10)),n[o]=s}})),n}(y,s,w);Object.keys(x).length&&f.logger.log("[Compiler] Found compiler options in query params: ",x),l=n({},y,x)}var k="js"===f.filetype;k&&(l.allowJs=!0);var S=function(e){return"js"===e.filetype?"javascript":"typescript"}(f),C=function(e,t,r){return r.Uri.file(function(e,t,r){return"input."+(t.jsx!==r.languages.typescript.JsxEmit.None&&"d.ts"!==e.filetype?e.filetype+"x":e.filetype)}(e,t,r))}(f,l,o),E="elementToAppend"in f?f.elementToAppend:document.getElementById(f.domID);if(!E)throw new Error("DOM element lookup by domID failed");var j=o.editor.createModel(v,S,C);o.editor.defineTheme("sandbox",a),o.editor.defineTheme("sandbox-dark",u),o.editor.setTheme("sandbox");var L=Object.assign({model:j},K,f.monacoSettings||{}),O=o.editor.create(E,L),A=k?o.languages.typescript.getJavaScriptWorker:o.languages.typescript.getTypeScriptWorker,T=k?o.languages.typescript.javascriptDefaults:o.languages.typescript.typescriptDefaults;f.customTypeScriptWorkerPath&&T.setWorkerOptions&&T.setWorkerOptions({customWorkerPath:f.customTypeScriptWorkerPath}),T.setDiagnosticsOptions(n({},T.getDiagnosticsOptions(),{noSemanticValidation:!1,diagnosticCodesToIgnore:[2354]}));var M=function(e,t){var r="file://"+t;T.addExtraLib(e,r);var n=o.Uri.file(r);null===o.editor.getModel(n)&&o.editor.createModel(e,"javascript",n),f.logger.log("[ATA] Adding "+r+" to runtime",{code:e})},P=function(e){var t=new Map;if("optionDeclarations"in e)for(var r,n=i(e.optionDeclarations);!(r=n()).done;){var o=r.value;t.set(o.name.toLowerCase(),o)}else console.error("Could not get compiler options from ts.optionDeclarations - skipping twoslash support.");return function(e){var r=e.split("\n"),n={};return r.forEach((function(e){var r,o=e.trim();(r=m.exec(o))?t.has(r[1].toLowerCase())&&(n[r[1]]=!0,g(r[1],"true",n,t)):(r=h.exec(o))&&t.has(r[1].toLowerCase())&&g(r[1],r[2],n,t)})),n}}(s);f.supportTwoslashCompilerOptions&&["javascript","typescript"].forEach((function(e){return o.languages.registerCompletionItemProvider(e,{triggerCharacters:["@","/","-"],provideCompletionItems:b(s)})}));var _=function(t){var n=new Map,o=new Map,s=0,a=0;return function(e){return s=0,a=0,u(e,0).then((function(e){a>0&&(null==t.delegate.finished||t.delegate.finished(o))}))};function u(e,t){return c.apply(this,arguments)}function c(){return c=r(e().mark((function c(l,f){var p,d,m,h,g,v,y,b,w,x,k,S,C,F,E;return e().wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return(p=B(t,n,l)).forEach((function(e){return n.set(e.module,{state:"loading"})})),c.next=4,Promise.all(p.map((function(e){return H(t,e.module,e.version)})));case 4:return d=c.sent.filter((function(e){return!("error"in e)})),m=d.filter((function(e){return e.files.find((function(e){return e.name.endsWith(".d.ts")}))})),h=m.map((function(e){return V(e,"/node_modules/"+e.moduleName)})),g=d.filter((function(e){return!m.includes(e)})),c.next=11,Promise.all(g.map((function(e){return H(t,"@types/"+q(e.moduleName),"latest")})));case 11:v=c.sent.filter((function(e){return!("error"in e)})),y=v.map((function(e){return V(e,"/node_modules/@types/"+q(e.moduleName).replace("types__",""))})),b=h.concat(y).reduce((function(e,t){return e.concat(t)}),[]),s+=b.length,b.length&&0===f&&(null==t.delegate.started||t.delegate.started()),w=i(d);case 18:if((x=w()).done){c.next=29;break}return S="/node_modules/"+(k=x.value).moduleName,v.includes(k)&&(S="/node_modules/@types/"+q(k.moduleName).replace("types__","")),C=S+"/package.json",c.next=25,U(t,k.moduleName,k.version,"/package.json");case 25:"string"==typeof(F=c.sent)?(o.set(C,F),null==t.delegate.receivedFile||t.delegate.receivedFile(F,C)):null==(E=t.logger)||E.error("Could not download package.json for "+k.moduleName);case 27:c.next=18;break;case 29:return c.next=31,Promise.all(b.map(function(){var n=r(e().mark((function r(n){var i,c;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,U(t,n.moduleName,n.moduleVersion,n.path);case 2:if(a++,!((i=e.sent)instanceof Error)){e.next=8;break}null==(c=t.logger)||c.error("Had an issue getting "+n.path+" for "+n.moduleName),e.next=13;break;case 8:return o.set(n.vfsPath,i),null==t.delegate.receivedFile||t.delegate.receivedFile(i,n.vfsPath),t.delegate.progress&&a%5==0&&t.delegate.progress(a,s),e.next=13,u(i,f+1);case 13:case"end":return e.stop()}}),r)})));return function(e){return n.apply(this,arguments)}}()));case 31:case"end":return c.stop()}}),c)}))),c.apply(this,arguments)}}({projectName:"TypeScript Playground",typescript:s,logger:console,delegate:{receivedFile:M,progress:function(e,t){},started:function(){console.log("ATA start")},finished:function(e){console.log("ATA done")}}}),W=function(){var e=O.getModel().getValue();if(f.supportTwoslashCompilerOptions){var t=P(e);J(t)}f.acquireTypes&&_(e)},R=!1;O.onDidChangeModelContent((function(e){R||(R=!0,setTimeout((function(){R=!1,W()}),1e3))})),f.logger.log("[Compiler] Set compiler options: ",l),T.setCompilerOptions(l);var G=function(e){},J=function(e){var t=Object.keys(e);t.length&&(t.forEach((function(t){l[t]==e[t]&&delete e[t]})),Object.keys(e).length&&(f.logger.log("[Compiler] Updating compiler options: ",e),l=n({},l,e),T.setCompilerOptions(l),G(l)))},Y=function(){var t=r(e().mark((function t(r,n){var o,i;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=O.getModel(),e.next=3,X();case 3:return i=e.sent,e.next=6,i.getEmitOutput(o.uri.toString(),r,n);case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),$=function(){var t=r(e().mark((function t(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!k){e.next=2;break}return e.abrupt("return",ee());case 2:return e.next=4,Y();case 4:return r=e.sent.outputFiles.find((function(e){return e.name.endsWith(".js")||e.name.endsWith(".jsx")})),e.abrupt("return",r&&r.text||"");case 7:case"end":return e.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Q=function(){var t=r(e().mark((function t(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Y(void 0,!0);case 2:return e.abrupt("return",(null==(r=e.sent.outputFiles.find((function(e){return e.name.endsWith(".d.ts")})))?void 0:r.text)||"");case 4:case"end":return e.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),X=function(){var t=r(e().mark((function t(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,A();case 2:return r=e.sent,e.next=5,r(j.uri);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Z=function(){return O.getModel()},ee=function(){return Z().getValue()||""},te=function(){var t=r(e().mark((function t(r){var n,o,i,a;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,F(l,s.version,!0,s,p);case 2:return(n=e.sent).set(C.path,ee()),r&&r.forEach((function(e,t){return n.set(t,e)})),o=N(n),i=D(o,l,s),a=s.createProgram({rootNames:[].concat(n.keys()),options:l,host:i.compilerHost}),e.abrupt("return",{program:a,system:o,host:i,fsMap:n});case 9:case"end":return e.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),re=function(){var t=r(e().mark((function t(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,te();case 2:return e.abrupt("return",e.sent.program);case 4:case"end":return e.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),ne=function(){var t=r(e().mark((function t(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,re();case 2:return(r=e.sent).emit(),e.abrupt("return",r.getSourceFile(C.path));case 5:case"end":return e.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),oe=d;return W(),{config:f,supportedVersions:oe,editor:O,language:S,monaco:o,getWorkerProcess:X,tsvfs:I,getEmitResult:Y,getRunnableJS:$,getDTSForCode:Q,getDomNode:function(){return O.getDomNode()},getModel:Z,getText:ee,setText:function(e){return Z().setValue(e)},getAST:ne,ts:s,setupTSVFS:te,createTSProgram:re,compilerDefaults:y,getCompilerOptions:function(){return l},setCompilerSettings:function(e){f.logger.log("[Compiler] Setting compiler options: ",e),T.setCompilerOptions(l=e),G(l)},updateCompilerSetting:function(e,t){f.logger.log("[Compiler] Setting compiler options ",e,"to",t),l[e]=t,T.setCompilerOptions(l),G(l)},updateCompilerSettings:J,setDidUpdateCompilerSettings:function(e){G=e},lzstring:p,createURLQueryWithCompilerOptions:c,getTwoSlashComplierOptions:P,getTwoSlashCompilerOptions:P,languageServiceDefaults:T,filepath:C.path,addLibraryToRuntime:M}},exports.defaultPlaygroundSettings=z; | ||
"use strict";function e(){e=function(){return r};var t,r={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},s="function"==typeof Symbol?Symbol:{},a=s.iterator||"@@iterator",u=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(t){l=function(e,t,r){return e[t]=r}}function f(e,t,r,n){var o=Object.create((t&&t.prototype instanceof y?t:y).prototype),s=new D(n||[]);return i(o,"_invoke",{value:j(e,r,s)}),o}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}r.wrap=f;var d="suspendedStart",m="suspendedYield",h="executing",g="completed",v={};function y(){}function b(){}function w(){}var x={};l(x,a,(function(){return this}));var k=Object.getPrototypeOf,S=k&&k(k(A([])));S&&S!==n&&o.call(S,a)&&(x=S);var C=w.prototype=y.prototype=Object.create(x);function F(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(n,i,s,a){var u=p(e[n],e,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==typeof l&&o.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,s,a)}),(function(e){r("throw",e,s,a)})):t.resolve(l).then((function(e){c.value=e,s(c)}),(function(e){return r("throw",e,s,a)}))}a(u.arg)}var n;i(this,"_invoke",{value:function(e,o){function i(){return new t((function(t,n){r(e,o,t,n)}))}return n=n?n.then(i,i):i()}})}function j(e,r,n){var o=d;return function(i,s){if(o===h)throw Error("Generator is already running");if(o===g){if("throw"===i)throw s;return{value:t,done:!0}}for(n.method=i,n.arg=s;;){var a=n.delegate;if(a){var u=L(a,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var c=p(e,r,n);if("normal"===c.type){if(o=n.done?g:m,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=g,n.method="throw",n.arg=c.arg)}}}function L(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,L(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=p(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var s=i.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function N(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function D(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function r(){for(;++n<e.length;)if(o.call(e,n))return r.value=e[n],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return b.prototype=w,i(C,"constructor",{value:w,configurable:!0}),i(w,"constructor",{value:b,configurable:!0}),b.displayName=l(w,c,"GeneratorFunction"),r.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,l(e,c,"GeneratorFunction")),e.prototype=Object.create(C),e},r.awrap=function(e){return{__await:e}},F(E.prototype),l(E.prototype,u,(function(){return this})),r.AsyncIterator=E,r.async=function(e,t,n,o,i){void 0===i&&(i=Promise);var s=new E(f(e,t,n,o),i);return r.isGeneratorFunction(t)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},F(C),l(C,c,"Generator"),l(C,a,(function(){return this})),l(C,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=A,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var u=o.call(s,"catchLoc"),c=o.call(s,"finallyLoc");if(u&&c){if(this.prev<s.catchLoc)return n(s.catchLoc,!0);if(this.prev<s.finallyLoc)return n(s.finallyLoc)}else if(u){if(this.prev<s.catchLoc)return n(s.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return n(s.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=e,s.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),N(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;N(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},r}function t(e,t,r,n,o,i,s){try{var a=e[i](s),u=a.value}catch(e){return void r(e)}a.done?t(u):Promise.resolve(u).then(n,o)}function r(e){return function(){var r=this,n=arguments;return new Promise((function(o,i){var s=e.apply(r,n);function a(e){t(s,o,i,a,u,"next",e)}function u(e){t(s,o,i,a,u,"throw",e)}a(void 0)}))}}function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},n.apply(this,arguments)}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function i(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}Object.defineProperty(exports,"__esModule",{value:!0});var s="0c840a",a={base:"vs",inherit:!0,rules:[{token:"",foreground:"000000",background:"fffffe"},{token:"invalid",foreground:"cd3131"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"11bb11"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"44ee11"},{token:"comment",foreground:"6c6f2d"},{token:"number",foreground:s},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"#811f3f"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"1142AF"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"delimiter.xml",foreground:"0000FF"},{token:"tag",foreground:"800000"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"string",foreground:s},{token:"keyword",foreground:"3757ef"},{token:"keyword.json",foreground:"0451A5"}],colors:{editorBackground:"#fafafa",editorForeground:"#000000",editorInactiveSelection:"#E5EBF1",editorIndentGuides:"#D3D3D3",editorActiveIndentGuides:"#939393",editorSelectionHighlight:"#ADD6FF4D"}},u={base:"vs-dark",inherit:!0,rules:[{token:"constant",foreground:"44ee11"},{token:"comment",foreground:"7caf3d"},{token:"regexp",foreground:"#811f3f"}],colors:{}},c=function(e,t){for(var r=e,o=new URLSearchParams(document.location.search),i=r.getCompilerOptions(),s=r.compilerDefaults,a=Object.entries(i).reduce((function(e,t){var r=t[0];return t[1]!==s[r]&&(e[r]=i[r]),e}),{}),u="code/"+r.lzstring.compressToEncodedURIComponent(r.getText()),c=Object.assign({},a),l=0,f=["lib","ts"];l<f.length;l++){var p=f[l],d=new URLSearchParams(location.search);d.has(p)&&(c.ts="ts"!==p||"Nightly"!==d.get(p)&&"next"!==d.get(p)?d.get(p):r.ts.version)}var m=r.editor.getSelection(),h=m&&m.selectionStartLineNumber!==m.positionLineNumber||m&&m.selectionStartColumn!==m.positionColumn,g=r.editor.getModel().getFullModelRange();!m||!h||m&&m.selectionStartLineNumber===g.startLineNumber&&m.selectionStartColumn===g.startColumn&&m.positionColumn===g.endColumn&&m.positionLineNumber===g.endLineNumber?(c.ssl=void 0,c.ssc=void 0,c.pln=void 0,c.pc=void 0):(c.ssl=m.selectionStartLineNumber,c.ssc=m.selectionStartColumn,c.pln=m.positionLineNumber,c.pc=m.positionColumn),"ts"!==r.config.filetype&&(c.filetype=r.config.filetype),t&&(c=n({},c,t));var v=o.keys().length>0;if(Object.keys(c).length>0||v){var y=Object.entries(c).filter((function(e){return void 0!==e[1]})).filter((function(e){return null!==e[1]})).map((function(e){return e[0]+"="+encodeURIComponent(e[1])})).join("&");return o.forEach((function(e,t){["ssl","ssc","pln","pc"].includes(t)||y.includes(t)||i[t]||(y+="&"+t+"="+e)})),"?"+y+"#"+u}return"#"+u};function l(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var f={exports:{}};null!=f&&(f.exports=function(){function e(e,t){if(!o[e]){o[e]={};for(var r=0;r<e.length;r++)o[e][e.charAt(r)]=r}return o[e][t]}var t=String.fromCharCode,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",o={},i={compressToBase64:function(e){if(null==e)return"";var t=i._compress(e,6,(function(e){return r.charAt(e)}));switch(t.length%4){default:case 0:return t;case 1:return t+"===";case 2:return t+"==";case 3:return t+"="}},decompressFromBase64:function(t){return null==t?"":""==t?null:i._decompress(t.length,32,(function(n){return e(r,t.charAt(n))}))},compressToUTF16:function(e){return null==e?"":i._compress(e,15,(function(e){return t(e+32)}))+" "},decompressFromUTF16:function(e){return null==e?"":""==e?null:i._decompress(e.length,16384,(function(t){return e.charCodeAt(t)-32}))},compressToUint8Array:function(e){for(var t=i.compress(e),r=new Uint8Array(2*t.length),n=0,o=t.length;o>n;n++){var s=t.charCodeAt(n);r[2*n]=s>>>8,r[2*n+1]=s%256}return r},decompressFromUint8Array:function(e){if(null==e)return i.decompress(e);for(var r=new Array(e.length/2),n=0,o=r.length;o>n;n++)r[n]=256*e[2*n]+e[2*n+1];var s=[];return r.forEach((function(e){s.push(t(e))})),i.decompress(s.join(""))},compressToEncodedURIComponent:function(e){return null==e?"":i._compress(e,6,(function(e){return n.charAt(e)}))},decompressFromEncodedURIComponent:function(t){return null==t?"":""==t?null:(t=t.replace(/ /g,"+"),i._decompress(t.length,32,(function(r){return e(n,t.charAt(r))})))},compress:function(e){return i._compress(e,16,(function(e){return t(e)}))},_compress:function(e,t,r){if(null==e)return"";var n,o,i,s={},a={},u="",c="",l="",f=2,p=3,d=2,m=[],h=0,g=0;for(i=0;i<e.length;i+=1)if(u=e.charAt(i),Object.prototype.hasOwnProperty.call(s,u)||(s[u]=p++,a[u]=!0),c=l+u,Object.prototype.hasOwnProperty.call(s,c))l=c;else{if(Object.prototype.hasOwnProperty.call(a,l)){if(l.charCodeAt(0)<256){for(n=0;d>n;n++)h<<=1,g==t-1?(g=0,m.push(r(h)),h=0):g++;for(o=l.charCodeAt(0),n=0;8>n;n++)h=h<<1|1&o,g==t-1?(g=0,m.push(r(h)),h=0):g++,o>>=1}else{for(o=1,n=0;d>n;n++)h=h<<1|o,g==t-1?(g=0,m.push(r(h)),h=0):g++,o=0;for(o=l.charCodeAt(0),n=0;16>n;n++)h=h<<1|1&o,g==t-1?(g=0,m.push(r(h)),h=0):g++,o>>=1}0==--f&&(f=Math.pow(2,d),d++),delete a[l]}else for(o=s[l],n=0;d>n;n++)h=h<<1|1&o,g==t-1?(g=0,m.push(r(h)),h=0):g++,o>>=1;0==--f&&(f=Math.pow(2,d),d++),s[c]=p++,l=String(u)}if(""!==l){if(Object.prototype.hasOwnProperty.call(a,l)){if(l.charCodeAt(0)<256){for(n=0;d>n;n++)h<<=1,g==t-1?(g=0,m.push(r(h)),h=0):g++;for(o=l.charCodeAt(0),n=0;8>n;n++)h=h<<1|1&o,g==t-1?(g=0,m.push(r(h)),h=0):g++,o>>=1}else{for(o=1,n=0;d>n;n++)h=h<<1|o,g==t-1?(g=0,m.push(r(h)),h=0):g++,o=0;for(o=l.charCodeAt(0),n=0;16>n;n++)h=h<<1|1&o,g==t-1?(g=0,m.push(r(h)),h=0):g++,o>>=1}0==--f&&(f=Math.pow(2,d),d++),delete a[l]}else for(o=s[l],n=0;d>n;n++)h=h<<1|1&o,g==t-1?(g=0,m.push(r(h)),h=0):g++,o>>=1;0==--f&&(f=Math.pow(2,d),d++)}for(o=2,n=0;d>n;n++)h=h<<1|1&o,g==t-1?(g=0,m.push(r(h)),h=0):g++,o>>=1;for(;;){if(h<<=1,g==t-1){m.push(r(h));break}g++}return m.join("")},decompress:function(e){return null==e?"":""==e?null:i._decompress(e.length,32768,(function(t){return e.charCodeAt(t)}))},_decompress:function(e,r,n){var o,i,s,a,u,c,l,f=[],p=4,d=4,m=3,h="",g=[],v={val:n(0),position:r,index:1};for(o=0;3>o;o+=1)f[o]=o;for(s=0,u=Math.pow(2,2),c=1;c!=u;)a=v.val&v.position,v.position>>=1,0==v.position&&(v.position=r,v.val=n(v.index++)),s|=(a>0?1:0)*c,c<<=1;switch(s){case 0:for(s=0,u=Math.pow(2,8),c=1;c!=u;)a=v.val&v.position,v.position>>=1,0==v.position&&(v.position=r,v.val=n(v.index++)),s|=(a>0?1:0)*c,c<<=1;l=t(s);break;case 1:for(s=0,u=Math.pow(2,16),c=1;c!=u;)a=v.val&v.position,v.position>>=1,0==v.position&&(v.position=r,v.val=n(v.index++)),s|=(a>0?1:0)*c,c<<=1;l=t(s);break;case 2:return""}for(f[3]=l,i=l,g.push(l);;){if(v.index>e)return"";for(s=0,u=Math.pow(2,m),c=1;c!=u;)a=v.val&v.position,v.position>>=1,0==v.position&&(v.position=r,v.val=n(v.index++)),s|=(a>0?1:0)*c,c<<=1;switch(l=s){case 0:for(s=0,u=Math.pow(2,8),c=1;c!=u;)a=v.val&v.position,v.position>>=1,0==v.position&&(v.position=r,v.val=n(v.index++)),s|=(a>0?1:0)*c,c<<=1;f[d++]=t(s),l=d-1,p--;break;case 1:for(s=0,u=Math.pow(2,16),c=1;c!=u;)a=v.val&v.position,v.position>>=1,0==v.position&&(v.position=r,v.val=n(v.index++)),s|=(a>0?1:0)*c,c<<=1;f[d++]=t(s),l=d-1,p--;break;case 2:return g.join("")}if(0==p&&(p=Math.pow(2,m),m++),f[l])h=f[l];else{if(l!==d)return null;h=i+i.charAt(0)}g.push(h),f[d++]=i+h.charAt(0),i=h,0==--p&&(p=Math.pow(2,m),m++)}}};return i}());var p=l(f.exports),d=["5.5.0-beta","5.4.5","5.3.3","5.2.2","5.1.6","5.0.4","4.9.5","4.8.4","4.7.4","4.6.4","4.5.5","4.4.4","4.3.5","4.2.3","4.1.5","4.0.5","3.9.7","3.8.3","3.7.5","3.6.3","3.5.1","3.3.3","3.1.6","3.0.1","2.8.1","2.7.2","2.4.1"],m=/^\/\/\s?@(\w+)$/,h=/^\/\/\s?@(\w+):\s?(.+)$/;function g(e,t,r,n){var o=n.get(e.toLowerCase());if(o){switch(o.type){case"number":case"string":case"boolean":r[o.name]=v(t,o.type);break;case"list":var i=o.element.type,s=t.split(",");r[o.name]="string"==typeof i?s.map((function(e){return v(e,i)})):s.map((function(e){return y(o.name,e,i)})).filter(Boolean);break;default:r[o.name]=y(o.name,t,o.type)}if(void 0===r[o.name]){var a=Array.from(o.type.keys());console.log("Invalid value "+t+" for "+o.name+". Allowed values: "+a.join(","))}}}function v(e,t){switch(t){case"number":return+e;case"string":return e;case"boolean":return"true"===e.toLowerCase()||0===e.length}console.log("Unknown primitive type "+t+" with - "+e)}function y(e,t,r){var n=r.get(t.toLowerCase());if(void 0===n){var o=Array.from(r.keys());console.error("Invalid inline compiler value","Got "+t+" for "+e+" but it is not a supported value by the TS compiler.","Allowed values: "+o.join(","))}return n}var b=function(e,t){return function(t,r,n){var o=[],i=t.getValueInRange({startLineNumber:r.lineNumber,startColumn:0,endLineNumber:r.lineNumber,endColumn:r.column});if(!i.startsWith("//"))return{suggestions:[]};var s=i.replace("\t","").split(" ");if(2!==s.length)return{suggestions:[]};var a=s[1];if(a.startsWith("-"))return{suggestions:[{label:"---cut---",kind:14,detail:"Twoslash split output",insertText:"---cut---".replace(a,"")}]};if(!a.startsWith("@"))return{suggestions:[]};var u=e.optionDeclarations.map((function(e){return e.name}));return["noErrors","errors","showEmit","showEmittedFile","noStaticSemanticInfo","emit","noErrorValidation","filename"].concat(u).forEach((function(e){e.startsWith(a.slice(1))&&o.push({label:e,kind:14,detail:"Twoslash comment",insertText:e})})),{suggestions:o}}},w=!1;try{w="undefined"!=typeof localStorage}catch(e){}var x="undefined"!=typeof process,k=w&&localStorage.getItem("DEBUG")||x&&process.env.DEBUG?console.log:function(e){return""},S=function(e,t){var r,n=e.lib||[],o=["lib.d.ts","lib.decorators.d.ts","lib.decorators.legacy.d.ts","lib.dom.d.ts","lib.dom.iterable.d.ts","lib.webworker.d.ts","lib.webworker.importscripts.d.ts","lib.webworker.iterable.d.ts","lib.scripthost.d.ts","lib.es5.d.ts","lib.es6.d.ts","lib.es2015.collection.d.ts","lib.es2015.core.d.ts","lib.es2015.d.ts","lib.es2015.generator.d.ts","lib.es2015.iterable.d.ts","lib.es2015.promise.d.ts","lib.es2015.proxy.d.ts","lib.es2015.reflect.d.ts","lib.es2015.symbol.d.ts","lib.es2015.symbol.wellknown.d.ts","lib.es2016.array.include.d.ts","lib.es2016.d.ts","lib.es2016.full.d.ts","lib.es2017.d.ts","lib.es2017.date.d.ts","lib.es2017.full.d.ts","lib.es2017.intl.d.ts","lib.es2017.object.d.ts","lib.es2017.sharedmemory.d.ts","lib.es2017.string.d.ts","lib.es2017.typedarrays.d.ts","lib.es2018.asyncgenerator.d.ts","lib.es2018.asynciterable.d.ts","lib.es2018.d.ts","lib.es2018.full.d.ts","lib.es2018.intl.d.ts","lib.es2018.promise.d.ts","lib.es2018.regexp.d.ts","lib.es2019.array.d.ts","lib.es2019.d.ts","lib.es2019.full.d.ts","lib.es2019.intl.d.ts","lib.es2019.object.d.ts","lib.es2019.string.d.ts","lib.es2019.symbol.d.ts","lib.es2020.bigint.d.ts","lib.es2020.d.ts","lib.es2020.date.d.ts","lib.es2020.full.d.ts","lib.es2020.intl.d.ts","lib.es2020.number.d.ts","lib.es2020.promise.d.ts","lib.es2020.sharedmemory.d.ts","lib.es2020.string.d.ts","lib.es2020.symbol.wellknown.d.ts","lib.es2021.d.ts","lib.es2021.full.d.ts","lib.es2021.intl.d.ts","lib.es2021.promise.d.ts","lib.es2021.string.d.ts","lib.es2021.weakref.d.ts","lib.es2022.array.d.ts","lib.es2022.d.ts","lib.es2022.error.d.ts","lib.es2022.full.d.ts","lib.es2022.intl.d.ts","lib.es2022.object.d.ts","lib.es2022.regexp.d.ts","lib.es2022.sharedmemory.d.ts","lib.es2022.string.d.ts","lib.es2023.array.d.ts","lib.es2023.collection.d.ts","lib.es2023.d.ts","lib.es2023.full.d.ts","lib.esnext.array.d.ts","lib.esnext.asynciterable.d.ts","lib.esnext.bigint.d.ts","lib.esnext.d.ts","lib.esnext.decorators.d.ts","lib.esnext.disposable.d.ts","lib.esnext.full.d.ts","lib.esnext.intl.d.ts","lib.esnext.promise.d.ts","lib.esnext.string.d.ts","lib.esnext.symbol.d.ts","lib.esnext.weakref.d.ts"],i=t.ScriptTarget[e.target||t.ScriptTarget.ES5],s=o.filter((function(e){return e.startsWith("lib."+i.toLowerCase())})),a=o.indexOf(s.pop()),u=n.map((function(e){var t=o.filter((function(t){return t.startsWith("lib."+e.toLowerCase())}));return 0===t.length?0:o.indexOf(t.pop())})),c=((r=u)&&r.length?r.reduce((function(e,t){return t>e?t:e})):void 0)||0,l=Math.max(a,c);return o.slice(0,l+1)},C=function(e,t){var r=T(),n=M();(function e(t){var o=[];return n.readdirSync(t).forEach((function(i){i=r.join(t,i);var s=n.statSync(i);s&&s.isDirectory()?o=o.concat(e(i)):o.push(i)})),o})(t).forEach((function(o){var i="/node_modules/@types"+o.replace(t,""),s=n.readFileSync(o,"utf8");[".ts",".tsx"].includes(r.extname(i))&&e.set(i,s)}))},F=function(e,t,r,n,o,i,s){var a=i||fetch,u=new Map,c=S(e,n),l="https://playgroundcdn.typescriptlang.org/cdn/"+t+"/typescript/lib/";return(r?function(){var e=s||localStorage;return Object.keys(e).forEach((function(r){r.startsWith("ts-lib-")&&!r.startsWith("ts-lib-"+t)&&e.removeItem(r)})),Promise.all(c.map((function(r){var n,i="ts-lib-"+t+"-"+r,s=e.getItem(i);return s?Promise.resolve((n=s,o?o.decompressFromUTF16(n):n)):a(l+r).then((function(e){return e.text()})).then((function(t){var r;return e.setItem(i,(r=t,o?o.compressToUTF16(r):r)),t})).catch((function(){}))}))).then((function(e){e.forEach((function(e,t){e&&u.set("/"+c[t],e)}))}))}:function(){return Promise.all(c.map((function(e){return a(l+e).then((function(e){return e.text()}))}))).then((function(e){e.forEach((function(e,t){return u.set("/"+c[t],e)}))})).catch((function(){}))})().then((function(){return u}))};function E(e){throw new Error("Method '"+e+"' is not implemented.")}function j(e,t){return function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];var i=t.apply(void 0,n),s="string"==typeof i?i.slice(0,80)+"...":i;return k.apply(void 0,["> "+e].concat(n)),k("< "+s),i}}var L=function(e){return n({},e.getDefaultCompilerOptions(),{jsx:e.JsxEmit.React,strict:!0,esModuleInterop:!0,module:e.ModuleKind.ESNext,suppressOutputPathCheck:!0,skipLibCheck:!0,skipDefaultLibCheck:!0,moduleResolution:e.ModuleResolutionKind.NodeJs})},O=function(e){return e.replace("/","/lib.").toLowerCase()};function N(e){return{args:[],createDirectory:function(){return E("createDirectory")},directoryExists:j("directoryExists",(function(t){return Array.from(e.keys()).some((function(e){return e.startsWith(t)}))})),exit:function(){return E("exit")},fileExists:j("fileExists",(function(t){return e.has(t)||e.has(O(t))})),getCurrentDirectory:function(){return"/"},getDirectories:function(){return[]},getExecutingFilePath:function(){return E("getExecutingFilePath")},readDirectory:j("readDirectory",(function(t){return"/"===t?Array.from(e.keys()):[]})),readFile:j("readFile",(function(t){var r;return null!=(r=e.get(t))?r:e.get(O(t))})),resolvePath:function(e){return e},newLine:"\n",useCaseSensitiveFileNames:!0,write:function(){return E("write")},writeFile:function(t,r){e.set(t,r)}}}function D(e,t,r){var o=new Map;return{compilerHost:n({},e,{getCanonicalFileName:function(e){return e},getDefaultLibFileName:function(){return"/"+r.getDefaultLibFileName(t)},getDirectories:function(){return[]},getNewLine:function(){return e.newLine},getSourceFile:function(n,i){var s,a;return o.get(n)||(a=r.createSourceFile(n,e.readFile(n),null!=(s=null!=i?i:t.target)?s:L(r).target,!1),o.set(a.fileName,a),a)},useCaseSensitiveFileNames:function(){return e.useCaseSensitiveFileNames}}),updateFile:function(t){var r=o.has(t.fileName);return e.writeFile(t.fileName,t.text),o.set(t.fileName,t),r}}}function A(e,t,r,o,i){var s=[].concat(t),a=D(e,r,o),u=a.compilerHost,c=a.updateFile,l=new Map,f=0;return{languageServiceHost:n({},u,{getProjectVersion:function(){return f.toString()},getCompilationSettings:function(){return r},getCustomTransformers:function(){return i},getScriptFileNames:function(){return s.slice()},getScriptSnapshot:function(t){var r=e.readFile(t);if(r&&"string"==typeof r)return o.ScriptSnapshot.fromString(r)},getScriptVersion:function(e){return l.get(e)||"0"},writeFile:e.writeFile}),updateFile:function(e){f++,l.set(e.fileName,f.toString()),s.includes(e.fileName)||s.push(e.fileName),c(e)}}}var T=function(){return require(String.fromCharCode(112,97,116,104))},M=function(){return require(String.fromCharCode(102,115))},I={__proto__:null,addAllFilesFromFolder:C,addFilesForTypesIntoFolder:function(e){return C(e,"node_modules/@types")},createDefaultMapFromCDN:F,createDefaultMapFromNodeModules:function(e,t,r){var n=T(),o=M(),i=o.readdirSync(r||n.dirname(require.resolve("typescript"))).filter((function(e){return e.startsWith("lib.")&&/\.d\.([^\.]+\.)?[cm]?ts$/i.test(e)})),s=new Map;return i.forEach((function(e){s.set("/"+e,function(e){var t=r||n.dirname(require.resolve("typescript"));return o.readFileSync(n.join(t,e),"utf8")}(e))})),s},createFSBackedSystem:function(e,t,r,n){var o=t+"/vfs",i=T(),s=r.sys,a=null!=n?n:i.dirname(require.resolve("typescript"));return{name:"fs-vfs",root:o,args:[],createDirectory:function(){return E("createDirectory")},directoryExists:j("directoryExists",(function(t){return Array.from(e.keys()).some((function(e){return e.startsWith(t)}))||s.directoryExists(t)})),exit:s.exit,fileExists:j("fileExists",(function(t){if(e.has(t))return!0;if(t.includes("tsconfig.json")||t.includes("tsconfig.json"))return!1;if(t.startsWith("/lib")){var r=a+"/"+t.replace("/","");return s.fileExists(r)}return s.fileExists(t)})),getCurrentDirectory:function(){return o},getDirectories:s.getDirectories,getExecutingFilePath:function(){return E("getExecutingFilePath")},readDirectory:j("readDirectory",(function(){return"/"===(arguments.length<=0?void 0:arguments[0])?Array.from(e.keys()):s.readDirectory.apply(s,arguments)})),readFile:j("readFile",(function(t){if(e.has(t))return e.get(t);if(t.startsWith("/lib")){var r=a+"/"+t.replace("/",""),n=s.readFile(r);if(!n){var o=s.readDirectory(a);throw new Error("TSVFS: A request was made for "+r+" but there wasn't a file found in the file map. You likely have a mismatch in the compiler options for the CDN download vs the compiler program. Existing Libs: "+o+".")}return n}return s.readFile(t)})),resolvePath:function(t){return e.has(t)?t:s.resolvePath(t)},newLine:"\n",useCaseSensitiveFileNames:!0,write:function(){return E("write")},writeFile:function(t,r){e.set(t,r)},realpath:s.realpath}},createSystem:N,createVirtualCompilerHost:D,createVirtualLanguageServiceHost:A,createVirtualTypeScriptEnvironment:function(e,t,r,o,i){void 0===o&&(o={});var s=n({},L(r),o),a=A(e,t,s,r,i),u=a.updateFile,c=r.createLanguageService(a.languageServiceHost),l=c.getCompilerOptionsDiagnostics();if(l.length){var f=D(e,o,r);throw new Error(r.formatDiagnostics(l,f.compilerHost))}return{name:"vfs",sys:e,languageService:c,getSourceFile:function(e){var t;return null==(t=c.getProgram())?void 0:t.getSourceFile(e)},createFile:function(e,t){u(r.createSourceFile(e,t,s.target,!1))},updateFile:function(e,t,n){var o=c.getProgram().getSourceFile(e);if(!o)throw new Error("Did not find a source file for "+e);var i=o.text,s=null!=n?n:r.createTextSpan(0,i.length),a=i.slice(0,s.start)+t+i.slice(s.start+s.length),l=r.updateSourceFile(o,a,{span:s,newLength:t.length});u(l)}}},knownLibFilesForCompilerOptions:S},P=function(e,t){return R(e,"https://data.jsdelivr.com/v1/package/npm/"+t,{cache:"no-store"})},_=function(e,t,r){return R(e,"https://data.jsdelivr.com/v1/package/resolve/npm/"+t+"@"+r)},U=function(){var t=r(e().mark((function t(r,o,i){var s,a;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s="https://data.jsdelivr.com/v1/package/npm/"+o+"@"+i+"/flat",e.next=3,R(r,s);case 3:if(!((a=e.sent)instanceof Error)){e.next=8;break}return e.abrupt("return",a);case 8:return e.abrupt("return",n({},a,{moduleName:o,version:i}));case 9:case"end":return e.stop()}}),t)})));return function(e,r,n){return t.apply(this,arguments)}}(),W=function(){var t=r(e().mark((function t(r,n,o,i){var s,a,u;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s="https://cdn.jsdelivr.net/npm/"+n+"@"+o+i,a=r.fetcher||fetch,e.next=4,a(s);case 4:if(!(u=e.sent).ok){e.next=9;break}return e.abrupt("return",u.text());case 9:return e.abrupt("return",new Error("OK"));case 10:case"end":return e.stop()}}),t)})));return function(e,r,n,o){return t.apply(this,arguments)}}();function R(e,t,r){return(e.fetcher||fetch)(t,r).then((function(e){return e.ok?e.json().then((function(e){return e})):new Error("OK")}))}var G=function(e){if(["assert","assert/strict","async_hooks","buffer","child_process","cluster","console","constants","crypto","dgram","diagnostics_channel","dns","dns/promises","domain","events","fs","fs/promises","http","http2","https","inspector","module","net","os","path","path/posix","path/win32","perf_hooks","process","punycode","querystring","readline","repl","stream","stream/promises","stream/consumers","stream/web","string_decoder","sys","timers","timers/promises","tls","trace_events","tty","url","util","util/types","v8","vm","wasi","worker_threads","zlib"].includes(e.replace("node:","")))return"node";var t=e.split("/"),r=t[0],n=void 0===r?"":r,o=t[1],i=void 0===o?"":o;return n.startsWith("@")?n+"/"+i:n};function V(e,t){for(var r,n=[],o=i(e.files);!(r=o()).done;){var s=r.value;J(s.name)&&n.push({moduleName:e.moduleName,moduleVersion:e.version,vfsPath:""+t+s.name,path:s.name})}return n}function B(e,t,r){return function(e,t){var r=e.preProcessFile(t),n=e.libMap||new Map;return r.referencedFiles.concat(r.importedFiles).concat(r.libReferenceDirectives).filter((function(e){return!J(e.fileName)})).filter((function(e){return!n.has(e.fileName)})).map((function(e){var r=void 0;if(!e.fileName.startsWith(".")){r="latest";var n=t.slice(e.end).split("\n")[0];n.includes("// types:")&&(r=n.split("// types: ")[1].trim())}return{module:e.fileName,version:r}}))}(e.typescript,r).map((function(e){return n({},e,{module:G(e.module)})})).filter((function(e){return!e.module.startsWith(".")})).filter((function(e){return!t.has(e.module)}))}var H=function(){var t=r(e().mark((function t(r,n,o){var i,s,a,u,c,l;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((i=o||"latest").split(".").length<2)){e.next=17;break}return e.next=4,_(r,n,i);case 4:if(!((s=e.sent)instanceof Error)){e.next=7;break}return e.abrupt("return",{error:s,userFacingMessage:"Could not go from a tag to version on npm for "+n+" - possible typo?"});case 7:if(a=s.version){e.next=16;break}return e.next=11,P(r,n);case 11:if(!((u=e.sent)instanceof Error)){e.next=14;break}return e.abrupt("return",{error:s,userFacingMessage:"Could not get versions on npm for "+n+" - possible typo?"});case 14:return c=Object.entries(u.tags).join(", "),e.abrupt("return",{error:new Error("Could not find tag for module"),userFacingMessage:"Could not find a tag for "+n+" called "+o+". Did find "+c});case 16:i=a;case 17:return e.next=19,U(r,n,i);case 19:if(!((l=e.sent)instanceof Error)){e.next=22;break}return e.abrupt("return",{error:l,userFacingMessage:"Could not get the files for "+n+"@"+i+". Is it possibly a typo?"});case 22:return e.abrupt("return",l);case 23:case"end":return e.stop()}}),t)})));return function(e,r,n){return t.apply(this,arguments)}}();function q(e){return 0===e.indexOf("@")&&-1!==e.indexOf("/")&&(e=e.substr(1).replace("/","__")),e}function J(e){return/\.d\.([^\.]+\.)?[cm]?ts$/i.test(e)}var K=navigator&&/android/i.test(navigator.userAgent),$={scrollBeyondLastLine:!0,scrollBeyondLastColumn:3,minimap:{enabled:!1},lightbulb:{enabled:!0},quickSuggestions:{other:!K,comments:!K,strings:!K},acceptSuggestionOnCommitCharacter:!K,acceptSuggestionOnEnter:K?"off":"on",accessibilitySupport:K?"off":"on",inlayHints:{enabled:!0}};function z(){return{text:"",domID:"",compilerOptions:{},acquireTypes:!0,filetype:"ts",supportTwoslashCompilerOptions:!1,logger:console}}exports.createTypeScriptSandbox=function(t,o,s){if(!("domID"in t)&&!("elementToAppend"in t))throw new Error("You did not provide a domID or elementToAppend");var l,f=n({},z(),t),v=f.suppressAutomaticallyGettingDefaultText?f.text:function(e,t){if(t.hash.startsWith("#src")){var r=t.hash.replace("#src=","").trim();return decodeURIComponent(r)}if(t.hash.startsWith("#code")){var n=t.hash.replace("#code/","").trim(),o=p.decompressFromEncodedURIComponent(n);return o||(o=p.decompressFromEncodedURIComponent(decodeURIComponent(n))),o}return localStorage.getItem("sandbox-history")?localStorage.getItem("sandbox-history"):e}(f.text,document.location),y=function(e,t,r){var o=r.versionMajorMinor.split(".").map((function(e){return parseInt(e)})),i="js"===e.filetype,s={strict:!0,noImplicitAny:!0,strictNullChecks:!i,strictFunctionTypes:!0,strictPropertyInitialization:!0,strictBindCallApply:!0,noImplicitThis:!0,noImplicitReturns:!0,noUncheckedIndexedAccess:!1,useDefineForClassFields:!1,alwaysStrict:!0,allowUnreachableCode:!1,allowUnusedLabels:!1,downlevelIteration:!1,noEmitHelpers:!1,noLib:!1,noStrictGenericChecks:!1,noUnusedLocals:!1,noUnusedParameters:!1,esModuleInterop:!0,preserveConstEnums:!1,removeComments:!1,skipLibCheck:!1,checkJs:i,allowJs:i,declaration:!0,importHelpers:!1,experimentalDecorators:!0,emitDecoratorMetadata:!0,moduleResolution:t.languages.typescript.ModuleResolutionKind.NodeJs,target:t.languages.typescript.ScriptTarget.ES2017,jsx:t.languages.typescript.JsxEmit.React,module:t.languages.typescript.ModuleKind.ESNext};return o[0]>=5&&(s.experimentalDecorators=!1,s.emitDecoratorMetadata=!1),n({},s,e.compilerOptions)}(f,o,s);if(f.suppressAutomaticallyGettingCompilerFlags)l=y;else{var w=new URLSearchParams(location.search),x=function(e,t,r){var n={};return r.forEach((function(r,o){if(e[o]){var i=void 0;"true"===r&&!0!==e[o]?i=!0:"false"===r&&!1!==e[o]?i=!1:isNaN(parseInt(r,10))||e[o]===parseInt(r,10)||(i=parseInt(r,10)),void 0!==i&&(n[o]=i)}else if(t.optionDeclarations.find((function(e){return e.name===o}))){var s=!0;"false"===r&&(s=!1),isNaN(parseInt(r,10))||(s=parseInt(r,10)),n[o]=s}})),n}(y,s,w);Object.keys(x).length&&f.logger.log("[Compiler] Found compiler options in query params: ",x),l=n({},y,x)}var k="js"===f.filetype;k&&(l.allowJs=!0);var S=function(e){return"js"===e.filetype?"javascript":"typescript"}(f),C=function(e,t,r){return r.Uri.file(function(e,t,r){return"input."+(t.jsx!==r.languages.typescript.JsxEmit.None&&"d.ts"!==e.filetype?e.filetype+"x":e.filetype)}(e,t,r))}(f,l,o),E="elementToAppend"in f?f.elementToAppend:document.getElementById(f.domID);if(!E)throw new Error("DOM element lookup by domID failed");var j=o.editor.createModel(v,S,C);o.editor.defineTheme("sandbox",a),o.editor.defineTheme("sandbox-dark",u),o.editor.setTheme("sandbox");var L=Object.assign({model:j},$,f.monacoSettings||{}),O=o.editor.create(E,L),A=k?o.languages.typescript.getJavaScriptWorker:o.languages.typescript.getTypeScriptWorker,T=k?o.languages.typescript.javascriptDefaults:o.languages.typescript.typescriptDefaults;f.customTypeScriptWorkerPath&&T.setWorkerOptions&&T.setWorkerOptions({customWorkerPath:f.customTypeScriptWorkerPath}),T.setDiagnosticsOptions(n({},T.getDiagnosticsOptions(),{noSemanticValidation:!1,diagnosticCodesToIgnore:[2354]}));var M=function(e,t){var r="file://"+t;T.addExtraLib(e,r);var n=o.Uri.file(r);null===o.editor.getModel(n)&&o.editor.createModel(e,"javascript",n),f.logger.log("[ATA] Adding "+r+" to runtime",{code:e})},P=function(e){var t=new Map;if("optionDeclarations"in e)for(var r,n=i(e.optionDeclarations);!(r=n()).done;){var o=r.value;t.set(o.name.toLowerCase(),o)}else console.error("Could not get compiler options from ts.optionDeclarations - skipping twoslash support.");return function(e){var r=e.split("\n"),n={};return r.forEach((function(e){var r,o=e.trim();(r=m.exec(o))?t.has(r[1].toLowerCase())&&(n[r[1]]=!0,g(r[1],"true",n,t)):(r=h.exec(o))&&t.has(r[1].toLowerCase())&&g(r[1],r[2],n,t)})),n}}(s);f.supportTwoslashCompilerOptions&&["javascript","typescript"].forEach((function(e){return o.languages.registerCompletionItemProvider(e,{triggerCharacters:["@","/","-"],provideCompletionItems:b(s)})}));var _=function(t){var n=new Map,o=new Map,s=0,a=0;return function(e){return s=0,a=0,u(e,0).then((function(e){a>0&&(null==t.delegate.finished||t.delegate.finished(o))}))};function u(e,t){return c.apply(this,arguments)}function c(){return c=r(e().mark((function c(l,f){var p,d,m,h,g,v,y,b,w,x,k,S,C,F,E;return e().wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return(p=B(t,n,l)).forEach((function(e){return n.set(e.module,{state:"loading"})})),c.next=4,Promise.all(p.map((function(e){return H(t,e.module,e.version)})));case 4:return d=c.sent.filter((function(e){return!("error"in e)})),m=d.filter((function(e){return e.files.find((function(e){return J(e.name)}))})),h=m.map((function(e){return V(e,"/node_modules/"+e.moduleName)})),g=d.filter((function(e){return!m.includes(e)})),c.next=11,Promise.all(g.map((function(e){return H(t,"@types/"+q(e.moduleName),"latest")})));case 11:v=c.sent.filter((function(e){return!("error"in e)})),y=v.map((function(e){return V(e,"/node_modules/@types/"+q(e.moduleName).replace("types__",""))})),b=h.concat(y).reduce((function(e,t){return e.concat(t)}),[]),s+=b.length,b.length&&0===f&&(null==t.delegate.started||t.delegate.started()),w=i(d);case 18:if((x=w()).done){c.next=29;break}return S="/node_modules/"+(k=x.value).moduleName,v.includes(k)&&(S="/node_modules/@types/"+q(k.moduleName).replace("types__","")),C=S+"/package.json",c.next=25,W(t,k.moduleName,k.version,"/package.json");case 25:"string"==typeof(F=c.sent)?(o.set(C,F),null==t.delegate.receivedFile||t.delegate.receivedFile(F,C)):null==(E=t.logger)||E.error("Could not download package.json for "+k.moduleName);case 27:c.next=18;break;case 29:return c.next=31,Promise.all(b.map(function(){var n=r(e().mark((function r(n){var i,c;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W(t,n.moduleName,n.moduleVersion,n.path);case 2:if(a++,!((i=e.sent)instanceof Error)){e.next=8;break}null==(c=t.logger)||c.error("Had an issue getting "+n.path+" for "+n.moduleName),e.next=13;break;case 8:return o.set(n.vfsPath,i),null==t.delegate.receivedFile||t.delegate.receivedFile(i,n.vfsPath),t.delegate.progress&&a%5==0&&t.delegate.progress(a,s),e.next=13,u(i,f+1);case 13:case"end":return e.stop()}}),r)})));return function(e){return n.apply(this,arguments)}}()));case 31:case"end":return c.stop()}}),c)}))),c.apply(this,arguments)}}({projectName:"TypeScript Playground",typescript:s,logger:console,delegate:{receivedFile:M,progress:function(e,t){},started:function(){console.log("ATA start")},finished:function(e){console.log("ATA done")}}}),U=function(){var e=O.getModel().getValue();if(f.supportTwoslashCompilerOptions){var t=P(e);K(t)}f.acquireTypes&&_(e)},R=!1;O.onDidChangeModelContent((function(e){R||(R=!0,setTimeout((function(){R=!1,U()}),1e3))})),f.logger.log("[Compiler] Set compiler options: ",l),T.setCompilerOptions(l);var G=function(e){},K=function(e){var t=Object.keys(e);t.length&&(t.forEach((function(t){l[t]==e[t]&&delete e[t]})),Object.keys(e).length&&(f.logger.log("[Compiler] Updating compiler options: ",e),l=n({},l,e),T.setCompilerOptions(l),G(l)))},Y=function(){var t=r(e().mark((function t(r,n){var o,i;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=O.getModel(),e.next=3,Z();case 3:return i=e.sent,e.next=6,i.getEmitOutput(o.uri.toString(),r,n);case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),Q=function(){var t=r(e().mark((function t(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!k){e.next=2;break}return e.abrupt("return",te());case 2:return e.next=4,Y();case 4:return r=e.sent.outputFiles.find((function(e){return e.name.endsWith(".js")||e.name.endsWith(".jsx")})),e.abrupt("return",r&&r.text||"");case 7:case"end":return e.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),X=function(){var t=r(e().mark((function t(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Y(void 0,!0);case 2:return e.abrupt("return",(null==(r=e.sent.outputFiles.find((function(e){return/\.d\.([^\.]+\.)?[cm]?ts$/i.test(e.name)})))?void 0:r.text)||"");case 4:case"end":return e.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Z=function(){var t=r(e().mark((function t(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,A();case 2:return r=e.sent,e.next=5,r(j.uri);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),ee=function(){return O.getModel()},te=function(){return ee().getValue()||""},re=function(){var t=r(e().mark((function t(r){var n,o,i,a;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,F(l,s.version,!0,s,p);case 2:return(n=e.sent).set(C.path,te()),r&&r.forEach((function(e,t){return n.set(t,e)})),o=N(n),i=D(o,l,s),a=s.createProgram({rootNames:[].concat(n.keys()),options:l,host:i.compilerHost}),e.abrupt("return",{program:a,system:o,host:i,fsMap:n});case 9:case"end":return e.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),ne=function(){var t=r(e().mark((function t(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,re();case 2:return e.abrupt("return",e.sent.program);case 4:case"end":return e.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),oe=function(){var t=r(e().mark((function t(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ne();case 2:return(r=e.sent).emit(),e.abrupt("return",r.getSourceFile(C.path));case 5:case"end":return e.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),ie=d;return U(),{config:f,supportedVersions:ie,editor:O,language:S,monaco:o,getWorkerProcess:Z,tsvfs:I,getEmitResult:Y,getRunnableJS:Q,getDTSForCode:X,getDomNode:function(){return O.getDomNode()},getModel:ee,getText:te,setText:function(e){return ee().setValue(e)},getAST:oe,ts:s,setupTSVFS:re,createTSProgram:ne,compilerDefaults:y,getCompilerOptions:function(){return l},setCompilerSettings:function(e){f.logger.log("[Compiler] Setting compiler options: ",e),T.setCompilerOptions(l=e),G(l)},updateCompilerSetting:function(e,t){f.logger.log("[Compiler] Setting compiler options ",e,"to",t),l[e]=t,T.setCompilerOptions(l),G(l)},updateCompilerSettings:K,setDidUpdateCompilerSettings:function(e){G=e},lzstring:p,createURLQueryWithCompilerOptions:c,getTwoSlashComplierOptions:P,getTwoSlashCompilerOptions:P,languageServiceDefaults:T,filepath:C.path,addLibraryToRuntime:M}},exports.defaultPlaygroundSettings=z; | ||
//# sourceMappingURL=sandbox.cjs.production.min.js.map |
@@ -8,2 +8,11 @@ type System = import("typescript").System; | ||
type TS = typeof import("typescript"); | ||
type FetchLike = (url: string) => Promise<{ | ||
json(): Promise<any>; | ||
text(): Promise<string>; | ||
}>; | ||
interface LocalStorageLike { | ||
getItem(key: string): string | null; | ||
setItem(key: string, value: string): void; | ||
removeItem(key: string): void; | ||
} | ||
export interface VirtualTypeScriptEnvironment { | ||
@@ -50,2 +59,6 @@ sys: System; | ||
export declare const addFilesForTypesIntoFolder: (map: Map<string, string>) => void; | ||
export interface LZString { | ||
compressToUTF16(input: string): string; | ||
decompressFromUTF16(compressed: string): string; | ||
} | ||
/** | ||
@@ -63,3 +76,3 @@ * Create a virtual FS Map with the lib files from a particular TypeScript | ||
*/ | ||
export declare const createDefaultMapFromCDN: (options: CompilerOptions, version: string, cache: boolean, ts: TS, lzstring?: typeof import("lz-string"), fetcher?: typeof fetch, storer?: typeof localStorage) => Promise<Map<string, string>>; | ||
export declare const createDefaultMapFromCDN: (options: CompilerOptions, version: string, cache: boolean, ts: TS, lzstring?: LZString, fetcher?: FetchLike, storer?: LocalStorageLike) => Promise<Map<string, string>>; | ||
/** | ||
@@ -66,0 +79,0 @@ * Creates an in-memory System object which can be used in a TypeScript program, this |
{ | ||
"name": "@typescript/sandbox", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"license": "MIT", | ||
@@ -41,4 +41,4 @@ "author": "TypeScript team", | ||
"lz-string": "^1.5.0", | ||
"@typescript/ata": "0.9.5", | ||
"@typescript/vfs": "1.5.2" | ||
"@typescript/ata": "0.9.6", | ||
"@typescript/vfs": "1.5.3" | ||
}, | ||
@@ -45,0 +45,0 @@ "devDependencies": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
787301
5780
+ Added@typescript/ata@0.9.6(transitive)
+ Added@typescript/vfs@1.5.3(transitive)
+ Addedtypescript@5.7.3(transitive)
- Removed@typescript/ata@0.9.5(transitive)
- Removed@typescript/vfs@1.5.2(transitive)
- Removedtypescript@4.9.5(transitive)
Updated@typescript/ata@0.9.6
Updated@typescript/vfs@1.5.3