Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@webqit/subscript

Package Overview
Dependencies
Maintainers
1
Versions
92
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@webqit/subscript - npm Package Compare versions

Comparing version 2.1.25 to 2.1.26

162

dist/console-element.js

@@ -1,2 +0,160 @@

(()=>{"use strict";var e={829:(e,t,n)=>{n.d(t,{Z:()=>r});const r=e=>class extends e{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){[].concat(this.css).forEach((e=>{if(e.includes("{")&&e.includes(":")&&e.includes(";"))this.shadowRoot.appendChild(document.createElement("style")).textContent=e;else{let t=this.shadowRoot.appendChild(document.createElement("link"));t.setAttribute("rel","stylesheet"),t.setAttribute("href",e)}}))}get css(){return[]}}},790:(e,t,n)=>{function r(e,t=!1){let n=e.split(/\n/g);if(n.length>1){for(;!n[0].trim().length;)n.shift();let e=n[t?1:0].split(/[^\s]/)[0].length;if(e)return n.map(((t,r)=>{let a=t.substring(0,e);return a.trim().length?"}"===a.trim()&&r===n.length-1?"}":t:t.substring(e)})).join("\n")}return e}n.d(t,{B:()=>r})}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e=n(790),t=n(829),r=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,r={},a={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof i?new i(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++n}),e.__id},clone:function e(t,n){var r,i;switch(n=n||{},a.util.type(t)){case"Object":if(i=a.util.objId(t),n[i])return n[i];for(var s in r={},n[i]=r,t)t.hasOwnProperty(s)&&(r[s]=e(t[s],n));return r;case"Array":return i=a.util.objId(t),n[i]?n[i]:(r=[],n[i]=r,t.forEach((function(t,a){r[a]=e(t,n)})),r);default:return t}},getLanguage:function(e){for(;e;){var n=t.exec(e.className);if(n)return n[1].toLowerCase();e=e.parentElement}return"none"},setLanguage:function(e,n){e.className=e.className.replace(RegExp(t,"gi"),""),e.classList.add("language-"+n)},currentScript:function(){if("undefined"==typeof document)return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(r){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack)||[])[1];if(e){var t=document.getElementsByTagName("script");for(var n in t)if(t[n].src==e)return t[n]}return null}},isActive:function(e,t,n){for(var r="no-"+t;e;){var a=e.classList;if(a.contains(t))return!0;if(a.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(e,t){var n=a.util.clone(a.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){var i=(r=r||a.languages)[e],s={};for(var o in i)if(i.hasOwnProperty(o)){if(o==t)for(var l in n)n.hasOwnProperty(l)&&(s[l]=n[l]);n.hasOwnProperty(o)||(s[o]=i[o])}var c=r[e];return r[e]=s,a.languages.DFS(a.languages,(function(t,n){n===c&&t!=e&&(this[t]=s)})),s},DFS:function e(t,n,r,i){i=i||{};var s=a.util.objId;for(var o in t)if(t.hasOwnProperty(o)){n.call(t,o,t[o],r||o);var l=t[o],c=a.util.type(l);"Object"!==c||i[s(l)]?"Array"!==c||i[s(l)]||(i[s(l)]=!0,e(l,n,o,i)):(i[s(l)]=!0,e(l,n,null,i))}}},plugins:{},highlightAll:function(e,t){a.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var r={callback:n,container:e,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};a.hooks.run("before-highlightall",r),r.elements=Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)),a.hooks.run("before-all-elements-highlight",r);for(var i,s=0;i=r.elements[s++];)a.highlightElement(i,!0===t,r.callback)},highlightElement:function(t,n,r){var i=a.util.getLanguage(t),s=a.languages[i];a.util.setLanguage(t,i);var o=t.parentElement;o&&"pre"===o.nodeName.toLowerCase()&&a.util.setLanguage(o,i);var l={element:t,language:i,grammar:s,code:t.textContent};function c(e){l.highlightedCode=e,a.hooks.run("before-insert",l),l.element.innerHTML=l.highlightedCode,a.hooks.run("after-highlight",l),a.hooks.run("complete",l),r&&r.call(l.element)}if(a.hooks.run("before-sanity-check",l),(o=l.element.parentElement)&&"pre"===o.nodeName.toLowerCase()&&!o.hasAttribute("tabindex")&&o.setAttribute("tabindex","0"),!l.code)return a.hooks.run("complete",l),void(r&&r.call(l.element));if(a.hooks.run("before-highlight",l),l.grammar)if(n&&e.Worker){var u=new Worker(a.filename);u.onmessage=function(e){c(e.data)},u.postMessage(JSON.stringify({language:l.language,code:l.code,immediateClose:!0}))}else c(a.highlight(l.code,l.grammar,l.language));else c(a.util.encode(l.code))},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(a.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=a.tokenize(r.code,r.grammar),a.hooks.run("after-tokenize",r),i.stringify(a.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var u=new o;return l(u,u.head,e),function e(t,n,r,o,u,d){for(var h in r)if(r.hasOwnProperty(h)&&r[h]){var p=r[h];p=Array.isArray(p)?p:[p];for(var g=0;g<p.length;++g){if(d&&d.cause==h+","+g)return;var f=p[g],m=f.inside,b=!!f.lookbehind,v=!!f.greedy,y=f.alias;if(v&&!f.pattern.global){var x=f.pattern.toString().match(/[imsuy]*$/)[0];f.pattern=RegExp(f.pattern.source,x+"g")}for(var k=f.pattern||f,w=o.next,_=u;w!==n.tail&&!(d&&_>=d.reach);_+=w.value.length,w=w.next){var A=w.value;if(n.length>t.length)return;if(!(A instanceof i)){var E,F=1;if(v){if(!(E=s(k,_,t,b))||E.index>=t.length)break;var S=E.index,C=E.index+E[0].length,L=_;for(L+=w.value.length;L<=S;)L+=(w=w.next).value.length;if(_=L-=w.value.length,w.value instanceof i)continue;for(var N=w;N!==n.tail&&(L<C||"string"==typeof N.value);N=N.next)F++,L+=N.value.length;F--,A=t.slice(_,L),E.index-=_}else if(!(E=s(k,0,A,b)))continue;S=E.index;var $=E[0],T=A.slice(0,S),B=A.slice(S+$.length),z=_+A.length;d&&z>d.reach&&(d.reach=z);var P=w.prev;if(T&&(P=l(n,P,T),_+=T.length),c(n,P,F),w=l(n,P,new i(h,m?a.tokenize($,m):$,y,$)),B&&l(n,w,B),1<F){var j={cause:h+","+g,reach:z};e(t,n,r,w.prev,_,j),d&&j.reach>d.reach&&(d.reach=j.reach)}}}}}}(e,u,t,u.head,0),function(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}(u)},hooks:{all:{},add:function(e,t){var n=a.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=a.hooks.all[e];if(n&&n.length)for(var r,i=0;r=n[i++];)r(t)}},Token:i};function i(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function s(e,t,n,r){e.lastIndex=t;var a=e.exec(n);if(a&&r&&a[1]){var i=a[1].length;a.index+=i,a[0]=a[0].slice(i)}return a}function o(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function l(e,t,n){var r=t.next,a={value:n,prev:t,next:r};return t.next=a,r.prev=a,e.length++,a}function c(e,t,n){for(var r=t.next,a=0;a<n&&r!==e.tail;a++)r=r.next;(t.next=r).prev=t,e.length-=a}if(e.Prism=a,i.stringify=function e(t,n){if("string"==typeof t)return t;if(Array.isArray(t)){var r="";return t.forEach((function(t){r+=e(t,n)})),r}var i={type:t.type,content:e(t.content,n),tag:"span",classes:["token",t.type],attributes:{},language:n},s=t.alias;s&&(Array.isArray(s)?Array.prototype.push.apply(i.classes,s):i.classes.push(s)),a.hooks.run("wrap",i);var o="";for(var l in i.attributes)o+=" "+l+'="'+(i.attributes[l]||"").replace(/"/g,"&quot;")+'"';return"<"+i.tag+' class="'+i.classes.join(" ")+'"'+o+">"+i.content+"</"+i.tag+">"},!e.document)return e.addEventListener&&(a.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),r=n.language,i=n.code,s=n.immediateClose;e.postMessage(a.highlight(i,a.languages[r],r)),s&&e.close()}),!1)),a;var u=a.util.currentScript();function d(){a.manual||a.highlightAll()}if(u&&(a.filename=u.src,u.hasAttribute("data-manual")&&(a.manual=!0)),!a.manual){var h=document.readyState;"loading"===h||"interactive"===h&&u&&u.defer?document.addEventListener("DOMContentLoaded",d):window.requestAnimationFrame?window.requestAnimationFrame(d):window.setTimeout(d,16)}return a}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});"undefined"!=typeof module&&module.exports&&(module.exports=r),"undefined"!=typeof global&&(global.Prism=r),r.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},r.languages.markup.tag.inside["attr-value"].inside.entity=r.languages.markup.entity,r.languages.markup.doctype.inside["internal-subset"].inside=r.languages.markup,r.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&amp;/,"&"))})),Object.defineProperty(r.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:r.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var a={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};a["language-"+t]={pattern:/[\s\S]+/,inside:r.languages[t]};var i={};i[e]={pattern:RegExp("(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[^])*?(?=</__>)".replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:a},r.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(r.languages.markup.tag,"addAttribute",{value:function(e,t){r.languages.markup.tag.inside["special-attr"].push({pattern:RegExp("(^|[\"'\\s])(?:"+e+")\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s'\">=]+(?=[\\s>]))","i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:r.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),r.languages.html=r.languages.markup,r.languages.mathml=r.languages.markup,r.languages.svg=r.languages.markup,r.languages.xml=r.languages.extend("markup",{}),r.languages.ssml=r.languages.xml,r.languages.atom=r.languages.xml,r.languages.rss=r.languages.xml,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|(?:[^\\\\\r\n()\"']|\\\\[^])*)\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(r),r.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},r.languages.javascript=r.languages.extend("clike",{"class-name":[r.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp("(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])"),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),r.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,r.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:r.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:r.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:r.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:r.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:r.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),r.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:r.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),r.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),r.languages.markup&&(r.languages.markup.tag.addInlined("script","javascript"),r.languages.markup.tag.addAttribute("on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)","javascript")),r.languages.js=r.languages.javascript,function(){if(void 0!==r&&"undefined"!=typeof document&&document.querySelector){var e,t="line-numbers",n="linkable-line-numbers",a=function(){if(void 0===e){var t=document.createElement("div");t.style.fontSize="13px",t.style.lineHeight="1.5",t.style.padding="0",t.style.border="0",t.innerHTML="&nbsp;<br />&nbsp;",document.body.appendChild(t),e=38===t.offsetHeight,document.body.removeChild(t)}return e},i=!0;r.plugins.lineHighlight={highlightLines:function(e,s,u){var d=(s="string"==typeof s?s:e.getAttribute("data-line")||"").replace(/\s+/g,"").split(",").filter(Boolean),h=+e.getAttribute("data-line-offset")||0,p=(a()?parseInt:parseFloat)(getComputedStyle(e).lineHeight),g=r.util.isActive(e,t),f=e.querySelector("code"),m=g?e:f||e,b=[],v=f&&m!=f?function(e,t){var n=getComputedStyle(e),r=getComputedStyle(t);function a(e){return+e.substr(0,e.length-2)}return t.offsetTop+a(r.borderTopWidth)+a(r.paddingTop)-a(n.paddingTop)}(e,f):0;d.forEach((function(t){var n=t.split("-"),a=+n[0],i=+n[1]||a,s=e.querySelector('.line-highlight[data-range="'+t+'"]')||document.createElement("div");if(b.push((function(){s.setAttribute("aria-hidden","true"),s.setAttribute("data-range",t),s.className=(u||"")+" line-highlight"})),g&&r.plugins.lineNumbers){var o=r.plugins.lineNumbers.getLine(e,a),l=r.plugins.lineNumbers.getLine(e,i);if(o){var c=o.offsetTop+v+"px";b.push((function(){s.style.top=c}))}if(l){var d=l.offsetTop-o.offsetTop+l.offsetHeight+"px";b.push((function(){s.style.height=d}))}}else b.push((function(){s.setAttribute("data-start",String(a)),a<i&&s.setAttribute("data-end",String(i)),s.style.top=(a-h-1)*p+v+"px",s.textContent=new Array(i-a+2).join(" \n")}));b.push((function(){s.style.width=e.scrollWidth+"px"})),b.push((function(){m.appendChild(s)}))}));var y=e.id;if(g&&r.util.isActive(e,n)&&y){l(e,n)||b.push((function(){e.classList.add(n)}));var x=parseInt(e.getAttribute("data-start")||"1");o(".line-numbers-rows > span",e).forEach((function(e,t){var n=t+x;e.onclick=function(){var e=y+"."+n;i=!1,location.hash=e,setTimeout((function(){i=!0}),1)}}))}return function(){b.forEach(c)}}};var s=0;r.hooks.add("before-sanity-check",(function(e){var t=e.element.parentElement;if(u(t)){var n=0;o(".line-highlight",t).forEach((function(e){n+=e.textContent.length,e.parentNode.removeChild(e)})),n&&/^(?: \n)+$/.test(e.code.slice(-n))&&(e.code=e.code.slice(0,-n))}})),r.hooks.add("complete",(function e(n){var a=n.element.parentElement;if(u(a)){clearTimeout(s);var i=r.plugins.lineNumbers,o=n.plugins&&n.plugins.lineNumbers;l(a,t)&&i&&!o?r.hooks.add("line-numbers",e):(r.plugins.lineHighlight.highlightLines(a)(),s=setTimeout(d,1))}})),window.addEventListener("hashchange",d),window.addEventListener("resize",(function(){o("pre").filter(u).map((function(e){return r.plugins.lineHighlight.highlightLines(e)})).forEach(c)}))}function o(e,t){return Array.prototype.slice.call((t||document).querySelectorAll(e))}function l(e,t){return e.classList.contains(t)}function c(e){e()}function u(e){return!!(e&&/pre/i.test(e.nodeName)&&(e.hasAttribute("data-line")||e.id&&r.util.isActive(e,n)))}function d(){var e=location.hash.slice(1);o(".temporary.line-highlight").forEach((function(e){e.parentNode.removeChild(e)}));var t=(e.match(/\.([\d,-]+)$/)||[,""])[1];if(t&&!document.getElementById(e)){var n=e.slice(0,e.lastIndexOf(".")),a=document.getElementById(n);a&&(a.hasAttribute("data-line")||a.setAttribute("data-line",""),r.plugins.lineHighlight.highlightLines(a,t,"temporary ")(),i&&document.querySelector(".temporary.line-highlight").scrollIntoView())}}}(),function(){if(void 0!==r&&"undefined"!=typeof document){var e="line-numbers",t=/\n(?!$)/g,n=r.plugins.lineNumbers={getLine:function(t,n){if("PRE"===t.tagName&&t.classList.contains(e)){var r=t.querySelector(".line-numbers-rows");if(r){var a=parseInt(t.getAttribute("data-start"),10)||1,i=a+(r.children.length-1);n<a&&(n=a),i<n&&(n=i);var s=n-a;return r.children[s]}}},resize:function(e){i([e])},assumeViewportIndependence:!0},a=void 0;window.addEventListener("resize",(function(){n.assumeViewportIndependence&&a===window.innerWidth||(a=window.innerWidth,i(Array.prototype.slice.call(document.querySelectorAll("pre."+e))))})),r.hooks.add("complete",(function(n){if(n.code){var a=n.element,s=a.parentNode;if(s&&/pre/i.test(s.nodeName)&&!a.querySelector(".line-numbers-rows")&&r.util.isActive(a,e)){a.classList.remove(e),s.classList.add(e);var o,l=n.code.match(t),c=l?l.length+1:1,u=new Array(c+1).join("<span></span>");(o=document.createElement("span")).setAttribute("aria-hidden","true"),o.className="line-numbers-rows",o.innerHTML=u,s.hasAttribute("data-start")&&(s.style.counterReset="linenumber "+(parseInt(s.getAttribute("data-start"),10)-1)),n.element.appendChild(o),i([s]),r.hooks.run("line-numbers",n)}}})),r.hooks.add("line-numbers",(function(e){e.plugins=e.plugins||{},e.plugins.lineNumbers=!0}))}function i(e){if(0!=(e=e.filter((function(e){var t=function(e){return e?window.getComputedStyle?getComputedStyle(e):e.currentStyle||null:null}(e)["white-space"];return"pre-wrap"===t||"pre-line"===t}))).length){var n=e.map((function(e){var n=e.querySelector("code"),r=e.querySelector(".line-numbers-rows");if(n&&r){var a=e.querySelector(".line-numbers-sizer"),i=n.textContent.split(t);a||((a=document.createElement("span")).className="line-numbers-sizer",n.appendChild(a)),a.innerHTML="0",a.style.display="block";var s=a.getBoundingClientRect().height;return a.innerHTML="",{element:e,lines:i,lineHeights:[],oneLinerHeight:s,sizer:a}}})).filter(Boolean);n.forEach((function(e){var t=e.sizer,n=e.lines,r=e.lineHeights,a=e.oneLinerHeight;r[n.length-1]=void 0,n.forEach((function(e,n){if(e&&1<e.length){var i=t.appendChild(document.createElement("span"));i.style.display="block",i.textContent=e}else r[n]=a}))})),n.forEach((function(e){for(var t=e.sizer,n=e.lineHeights,r=0,a=0;a<n.length;a++)void 0===n[a]&&(n[a]=t.children[r++].getBoundingClientRect().height)})),n.forEach((function(e){var t=e.sizer,n=e.element.querySelector(".line-numbers-rows");t.style.display="none",t.innerHTML="",e.lineHeights.forEach((function(e,t){n.children[t].style.height=e+"px"}))}))}}}(),function(){if(void 0!==r&&"undefined"!=typeof document){var e=[],t={},n=function(){};r.plugins.toolbar={};var a=r.plugins.toolbar.registerButton=function(n,r){var a;a="function"==typeof r?r:function(e){var t;return"function"==typeof r.onClick?((t=document.createElement("button")).type="button",t.addEventListener("click",(function(){r.onClick.call(this,e)}))):"string"==typeof r.url?(t=document.createElement("a")).href=r.url:t=document.createElement("span"),r.className&&t.classList.add(r.className),t.textContent=r.text,t},n in t?console.warn('There is a button with the key "'+n+'" registered already.'):e.push(t[n]=a)},i=r.plugins.toolbar.hook=function(r){var a=r.element.parentNode;if(a&&/pre/i.test(a.nodeName)&&!a.parentNode.classList.contains("code-toolbar")){var i=document.createElement("div");i.classList.add("code-toolbar"),a.parentNode.insertBefore(i,a),i.appendChild(a);var s=document.createElement("div");s.classList.add("toolbar");var o=e,l=function(e){for(;e;){var t=e.getAttribute("data-toolbar-order");if(null!=t)return(t=t.trim()).length?t.split(/\s*,\s*/g):[];e=e.parentElement}}(r.element);l&&(o=l.map((function(e){return t[e]||n}))),o.forEach((function(e){var t=e(r);if(t){var n=document.createElement("div");n.classList.add("toolbar-item"),n.appendChild(t),s.appendChild(n)}})),i.appendChild(s)}};a("label",(function(e){var t=e.element.parentNode;if(t&&/pre/i.test(t.nodeName)&&t.hasAttribute("data-label")){var n,r,a=t.getAttribute("data-label");try{r=document.querySelector("template#"+a)}catch(e){}return r?n=r.content:(t.hasAttribute("data-url")?(n=document.createElement("a")).href=t.getAttribute("data-url"):n=document.createElement("span"),n.textContent=a),n}})),r.hooks.add("complete",i)}}(),function(){function e(e,n){e.addEventListener("click",(function(){!function(e){navigator.clipboard?navigator.clipboard.writeText(e.getText()).then(e.success,(function(){t(e)})):t(e)}(n)}))}function t(e){var t=document.createElement("textarea");t.value=e.getText(),t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{var n=document.execCommand("copy");setTimeout((function(){n?e.success():e.error()}),1)}catch(t){setTimeout((function(){e.error(t)}),1)}document.body.removeChild(t)}void 0!==r&&"undefined"!=typeof document&&(r.plugins.toolbar?r.plugins.toolbar.registerButton("copy-to-clipboard",(function(t){var n=t.element,r=function(e){var t={copy:"Copy","copy-error":"Press Ctrl+C to copy","copy-success":"Copied!","copy-timeout":5e3};for(var n in t){for(var r="data-prismjs-"+n,a=e;a&&!a.hasAttribute(r);)a=a.parentElement;a&&(t[n]=a.getAttribute(r))}return t}(n),a=document.createElement("button");a.className="copy-to-clipboard-button",a.setAttribute("type","button");var i=document.createElement("span");return a.appendChild(i),o("copy"),e(a,{getText:function(){return n.textContent},success:function(){o("copy-success"),s()},error:function(){o("copy-error"),setTimeout((function(){!function(e){window.getSelection().selectAllChildren(e)}(n)}),1),s()}}),a;function s(){setTimeout((function(){o("copy")}),r["copy-timeout"])}function o(e){i.textContent=r[e],a.setAttribute("data-copy-state",e)}})):console.warn("Copy to Clipboard plugin loaded before Toolbar plugin."))}(),function(){if(void 0!==r&&"undefined"!=typeof document){var e={"(":")","[":"]","{":"}"},t={"(":"brace-round","[":"brace-square","{":"brace-curly"},n={"${":"{"},a=0,i=/^(pair-\d+-)(close|open)$/;r.hooks.add("complete",(function(i){var o=i.element,d=o.parentElement;if(d&&"PRE"==d.tagName){var h=[];if(r.util.isActive(o,"match-braces")&&h.push("(","[","{"),0!=h.length){d.__listenerAdded||(d.addEventListener("mousedown",(function(){var e=d.querySelector("code"),t=s("brace-selected");Array.prototype.slice.call(e.querySelectorAll("."+t)).forEach((function(e){e.classList.remove(t)}))})),Object.defineProperty(d,"__listenerAdded",{value:!0}));var p=Array.prototype.slice.call(o.querySelectorAll("span."+s("token")+"."+s("punctuation"))),g=[];h.forEach((function(r){for(var i=e[r],o=s(t[r]),d=[],h=[],f=0;f<p.length;f++){var m=p[f];if(0==m.childElementCount){var b=m.textContent;(b=n[b]||b)===r?(g.push({index:f,open:!0,element:m}),m.classList.add(o),m.classList.add(s("brace-open")),h.push(f)):b===i&&(g.push({index:f,open:!1,element:m}),m.classList.add(o),m.classList.add(s("brace-close")),h.length&&d.push([f,h.pop()]))}}d.forEach((function(e){var t="pair-"+a+++"-",n=p[e[0]],r=p[e[1]];n.id=t+"open",r.id=t+"close",[n,r].forEach((function(e){e.addEventListener("mouseenter",l),e.addEventListener("mouseleave",c),e.addEventListener("click",u)}))}))}));var f=0;g.sort((function(e,t){return e.index-t.index})),g.forEach((function(e){e.open?(e.element.classList.add(s("brace-level-"+(f%12+1))),f++):(f=Math.max(0,f-1),e.element.classList.add(s("brace-level-"+(f%12+1))))}))}}}))}function s(e){var t=r.plugins.customClass;return t?t.apply(e,"none"):e}function o(e){var t=i.exec(e.id);return document.querySelector("#"+t[1]+("open"==t[2]?"close":"open"))}function l(){r.util.isActive(this,"brace-hover",!0)&&[this,o(this)].forEach((function(e){e.classList.add(s("brace-hover"))}))}function c(){[this,o(this)].forEach((function(e){e.classList.remove(s("brace-hover"))}))}function u(){r.util.isActive(this,"brace-select",!0)&&[this,o(this)].forEach((function(e){e.classList.add(s("brace-selected"))}))}}();const a=n=>class extends((0,t.Z)(n||HTMLElement)){static get observedAttributes(){return["name","editable","placeholder"]}connectedCallback(){this._lang="javascript",this._editable=this.getAttribute("editable"),this._styledBlock=this.getAttribute("styled-block")||"pre",this._div=document.createElement("div"),this._preBlock=this._div.appendChild(document.createElement("pre")),this._codeBlock=this._preBlock.appendChild(document.createElement("code")),this._div.classList.add("line-numbers"),this._div.classList.add("container"),this._lang&&(this._preBlock.classList.add("language-"+this._lang),this._codeBlock.classList.add("language-"+this._lang)),this._contentSlot=document.createElement("slot"),this._contentSlot.setAttribute("aria-hidden","true"),this._contentSlot.setAttribute("hidden","true"),this._initialSlotEvent=!1,this._contentSlot.addEventListener("slotchange",(()=>{let t=this._contentSlot.assignedNodes().reduce(((e,t)=>e+(t.outerHTML||t.nodeValue||"")),"");this._initialSlotEvent||(t=(0,e.B)(t),this._initialSlotEvent=!0),this._textarea&&(this._textarea.value=t),this.source=(e=>e.replace(new RegExp("&","g"),"&amp;").replace(new RegExp("<","g"),"&lt;"))(t)})),"true"===this._editable&&this._addEditor(),this.shadowRoot.append(this._contentSlot,this._textarea||"",this._div),super.connectedCallback()}get source(){return this._codeBlock.textContent}set source(e){e.endsWith("\n")&&(e+=" "),this._codeBlock.innerHTML="",this._codeBlock.innerHTML=e,this._highlightCodeBlock(),this._syncScrolling()}get name(){return this._name}set name(e){return this.setAttribute("name",e)}get placeholder(){return this._placeholder}set placeholder(e){return this.setAttribute("placeholder",e)}get editable(){return this._editable}set editable(e){return this.setAttribute("editable",!0===e?"true":!1===e?"false":e)}_addEditor(){this._placeholder=this.getAttribute("placeholder"),this._name=this.getAttribute("name"),this._textarea=this._div.appendChild(document.createElement("textarea")),this._textarea.placeholder=this._placeholder||this._lang,this._textarea.spellcheck=!1,this._textarea.name=this._name||"",this._textarea.value=this._codeBlock.textContent,this._preBlock.setAttribute("aria-hidden","true"),this._scrollBlock="code"===this.getAttribute("scroll-block")?this._codeBlock:this._preBlock,this._textarea.addEventListener("input",(e=>{this.source=e.target.value})),this._textarea.addEventListener("input",(()=>this._syncScrolling())),this._textarea.addEventListener("scroll",(()=>this._syncScrolling())),this._textarea.addEventListener("keydown",(e=>this._handleTabKeyEvent(e)))}_handleTabKeyEvent(e){if(!this._textarea)return;if("Tab"!==e.key)return;e.preventDefault();let t=this._textarea.value,n=this._textarea.selectionStart,r=this._textarea.selectionEnd;if(n===r){let e=t.slice(0,n),a=t.slice(r,t.length),i=r+1;this._textarea.value=e+"\t"+a,this._textarea.selectionStart=i,this._textarea.selectionEnd=i}else{let a=t.split("\n"),i=0,s=0,o=0;for(let t=0;t<a.length;t++)i+=a[t].length,n<i&&r>i-a[t].length&&(e.shiftKey?"\t"===a[t][0]&&(a[t]=a[t].slice(1),0===s&&o--,s--):(a[t]="\t"+a[t],0===s&&o++,s++));this._textarea.value=a.join("\n"),this._textarea.selectionStart=n+o,this._textarea.selectionEnd=r+s}this.source=this._textarea.value}_syncScrolling(){this._scrollBlock&&(this._scrollBlock.scrollTop=this._textarea.scrollTop,this._scrollBlock.scrollLeft=this._textarea.scrollLeft)}_highlightCodeBlock(){Prism.highlightElement(this._codeBlock)}disconnectedCallback(){Array.from(this.shadowRoot.childNodes).forEach((e=>e.remove()))}attributeChangedCallback(e,t,n){if(this.childNodes.length)switch(e){case"name":this._name=n,this._textarea.name=n;break;case"placeholder":this._placeholder=n,this._textarea.placeholder=n;break;case"editable":this._editable=n,this._textarea?this._textarea.disabled="false"===n:"true"===n&&this._addEditor(),"true"===n&&this._textarea.focus()}}get css(){return["https://unpkg.com/@webqit/subscript/src/console/assets/prism.css","https://unpkg.com/@webqit/subscript/src/console/assets/vs-code-dark.css",`\n * {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n :host {\n /* Allow other elems to be inside */\n position: relative;\n top: 0;\n left: 0;\n display: block;\n \n /* Normal inline styles */\n \n font-size: 0.8rem;\n font-family: monospace;\n line-height: 1.2rem;\n tab-size: 2;\n caret-color: darkgrey;\n white-space: pre;\n overflow: hidden;\n }\n .container {\n min-height: 100%;\n width: 100%;\n display: flex;\n }\n .container > * {\n width: 100%;\n }\n \n textarea, ${this._styledBlock} {\n /* Both elements need the same text and space styling so they are directly on top of each other */\n margin: 0px !important;\n padding-top: var(--vertical-padding, 1.5rem) !important;\n padding-bottom: var(--vertical-padding, 1.5rem) !important;\n padding-left: var(--horizontal-padding, 1rem) !important;\n padding-right: var(--horizontal-padding, 1rem) !important;\n border: 0 !important;\n width: 100% !important;\n height: 100% !important;\n }\n ${"code"===this._styledBlock?"pre":"code"} {\n margin: 0px !important;\n border: 0px !important;\n padding: 0px !important;\n overflow: auto !important;\n width: 100% !important;\n height: 100% !important;\n }\n .line-numbers :is(textarea, pre[class*=language-]) {\n padding-left:3.8rem !important;\n }\n textarea, pre, pre * {\n /* Also add text styles to highlighing tokens */\n font-size: inherit !important;\n font-family: inherit !important;\n line-height: inherit !important;\n tab-size: inherit !important;\n }\n \n textarea, pre {\n /* In the same place */\n position: absolute;\n top: 0;\n left: 0;\n }\n textarea[disabled] {\n pointer-events: none !important;\n }\n \n /* Move the textarea in front of the result */\n \n textarea {\n z-index: 1;\n }\n pre {\n z-index: 0;\n }\n \n /* Make textarea almost completely transparent */\n \n textarea {\n color: transparent;\n background: transparent;\n caret-color: inherit!important; /* Or choose your favourite color */\n }\n \n /* Can be scrolled */\n textarea, pre {\n overflow: auto !important;\n \n white-space: inherit !important;\n word-spacing: normal !important;\n word-break: normal !important;\n word-wrap: normal !important;\n }\n \n /* No resize on textarea; stop outline */\n textarea {\n resize: none;\n outline: none !important;\n }\n .line-numbers-rows {\n border: none !important;\n color: dimgray !important;\n }\n `]}},i=e=>class extends(e||class{}){setStateCallback(e,t,n,r=100,a){this._timeouts||(this._timeouts={}),e in this._timeouts||(this._timeouts[e]=[]),n?(this._timeouts[e].length||a(),r?this._timeouts[e].unshift(setTimeout((()=>this.setState(e,t,!1)),r)):this._timeouts[e].unshift(null),this._related&&this._related.setState(e,t,!0,r)):(this._timeouts[e].shift(),this._timeouts[e].length||(a(),this._related&&this._related.setState(e,t,!1)))}};class s extends(i()){bind(e){Object.assign(this,e),this.fullPaths=[],this.$fullPaths=[],this.ownerReference.assignee&&this.ownerReference.assignee.refs.forEach((e=>{e.depth&&this.fullPaths.push([...this.path,...e.depth])})),this.fullPaths.length||(this.fullPaths=[this.path]),this.fullPaths.forEach(((e,t)=>{this.$fullPaths.push(e.map((e=>"memoId"in e?"[[computed]]":e.name)).join(".")),e.forEach((e=>{e.anchor.classList.add("ref-identifier"),e.anchor.classList.add(this.subscriptions?"effect":"signal");let n=e.anchor.getAttribute("title"),r="> "+this.$fullPaths[t]+(this.subscriptions?" (Effect Ref)":" (Signal Ref)");e.anchor.setAttribute("title",n?n+"\n"+r:r)})),this._on(t,"mouseenter",(()=>{this._setState(t,"path","hover",!0,0)}))._on(t,"mouseleave",(()=>{this._setState(t,"path","hover",!1)})),this.subscriptions&&this._on(t,"click",(()=>{this.ownerReference.ownerContract.runThread(e)}))}))}_setState(e,t,n,r,a=100){this.setStateCallback(e+"|"+t,n,r,a,(()=>{r?this.fullPaths[e].forEach((e=>e.anchor.classList.add(`${t}-${n}`))):this.fullPaths[e].forEach((e=>e.anchor.classList.remove(`${t}-${n}`)))}))}setState(e,t,n,r=100){let[a,i]=e.split("|");if(void 0!==i)return this._setState(a,i,t,n,r);this.fullPaths.forEach(((a,i)=>{this._setState(i,e,t,n,r)}))}_on(e,t,n){return this.fullPaths[e].forEach((e=>e.anchor.addEventListener(t,n.bind(this)))),this}on(e,t){this.fullPaths.forEach(((n,r)=>{this._on(r,e,t)}))}}class o extends(i(HTMLElement)){bind(e){if(Object.assign(this,e),!this.graph)return;this.subContracts&&this.subContracts.forEach((e=>{e.replaceWith(...e.childNodes)})),this.subContracts=new Map,this._textNodes=this.getTextNodes();for(let e in this.graph.subContracts){let t=this.graph.subContracts[e],n=this.createSubContract({ownerContract:this,graph:t});this.subContracts.set(t.id,n)}if(this.effects=new Map,this.signals=new Map,this.refAnchors)for(let e in this.refAnchors){let t=this.refAnchors[e];t.replaceWith(...t.childNodes)}this.refAnchors={},this._textNodes=this.getTextNodes();const t=e=>{for(let t in this.graph[e]){let n=this.createReference({ownerContract:this,...this.graph[e][t]});this[e].set(t,n)}};t("effects"),t("signals"),this.setAttribute("title",this.graph.type),this.on("mouseenter",(()=>{this.setState("block","hover",!0,0)})).on("mouseleave",(()=>{this.setState("block","hover",!1)})),this.observe(((e,t)=>{this.setState("block","runtime-active",!0,100),t.forEach((e=>{let t=this.signals.get(e.referenceId+"");t&&t.refs.get(e.id).setState("path","runtime-active",!0,100)}))}))}get program(){return this.ownerContract?this.ownerContract.program:this.runtime}runThread(...e){let t=this.program.locate(this.graph.lineage);if(t)return t.thread(...e)}observe(e){return this.program.observe(this.graph.lineage,e)}createSubContract(e){let t=document.createElement("subscript-contract");return this.insertNode(t,e.graph.loc,"contract"),t.bind(e),t}createReference(e){let t={...e,refs:new Map};"assignee"in e&&(t.assignee=this.effects.get(e.assignee+""));for(let n of e.refs){let e=this.createRef({ownerReference:t,...n});t.refs.set(n.id,e)}return t}createRef(e){let t=new s;const n=e=>{let[t,n]=e.loc,r=t+"-"+n,a=this.refAnchors[r];return a||(a=document.createElement("span"),this.insertNode(a,[t,n],"ref"),this.refAnchors[r]=a),a};return(e={...e,path:e.path.map((e=>({anchor:n(e),...e})))}).depth&&(e.depth=e.depth.map((e=>({anchor:n(e),...e})))),t.bind(e),t}insertNode(e,t,n){let[r,a]=t,i=this.graph.loc?this.graph.loc[0]:0,[s,o]=this.resolveOffset(r-i),[l,c]=this.resolveOffset(a-i,!1),u=new Range;return"contract"===n?(0===o&&"SPAN"===s.parentNode.nodeName?u.setStartBefore(s.parentNode):u.setStart(s,o),c===(l.nodeValue||"").length&&"SPAN"===l.parentNode.nodeName?u.setEndAfter(l.parentNode):u.setEnd(l,c)):(u.setStart(s,o),u.setEnd(l,c)),u.surroundContents(e),e}resolveOffset(e,t=!0){return this._textNodes.reduce((([n,r,a],i)=>{if(null===r){let s=a+i.length;if(e<=s&&!i.isBlank){let r=e-a;if(!t&&0===r)return[n.node,n.length];if(!t||r<i.length)return[i.node,r]}[n,r,a]=[i,r,s]}return[n,r,a]}),[null,null,0])}getTextNodes(e=this){let t,n={acceptNode:function(e){if("SCRIPT"!==e.parentNode.nodeName)return window.NodeFilter.FILTER_ACCEPT}},r=window.document.createTreeWalker(e||this,window.NodeFilter.SHOW_TEXT,n,!1),a=[];for(;t=r.nextNode();){let e=t.nodeValue||"";a.push({node:t,length:e.length,isBlank:0===e.trim().length})}return a}setState(e,t,n,r=100){n&&this.ownerContract&&this.ownerContract.setState(e,t,!1),this.setStateCallback(e,t,n,r,(()=>{n?this.classList.add(`${e}-${t}`):this.classList.remove(`${e}-${t}`)}))}on(e,t){return this.addEventListener(e,t.bind(this)),this}}class l extends(a(o)){bind(e,t=!0){t&&(this.innerHTML=e.originalSource),setTimeout((()=>{if(!this._codeBlock.textContent.length)return;let t=e.runtime;super.bind({runtime:t,graph:t.graph})}),0)}createRef(e){}getTextNodes(e=null){return super.getTextNodes(e||this._codeBlock)}get css(){return super.css.concat(["\n .ref-identifier.path-runtime-active {\n text-decoration: underline;\n }\n .ref-identifier:is(.path-runtime-active) {\n }\n\n .ref-identifier.cause {\n cursor: default;\n }\n\n .ref-identifier.effect {\n cursor: pointer;\n }\n\n .ref-identifier.cause:is(.path-hover, .path-runtime-active) {\n color: aqua;\n }\n .token.keyword .ref-identifier.cause:is(.path-hover, .path-runtime-active) {\n color: mediumturquoise;\n }\n \n .ref-identifier.effect:is(.path-hover, .path-runtime-active) {\n color: yellowgreen;\n text-decoration: underline;\n }\n\n .ref-identifier.cause.effect:is(.path-hover, .path-runtime-active) {\n color: lightgreen;\n }\n\n subscript-contract.block-hover,\n subscript-contract.block-runtime-active {\n outline: 1px dashed gray;\n outline-offset: 0.1rem;\n border-radius: 0.1rem;\n /*\n background-color: darkblue;\n */\n }\n subscript-contract.block-runtime-active {\n background-color: rgba(100, 100, 100, 0.35);\n }\n "])}}customElements.define("subscript-codeblock",a()),customElements.define("subscript-contract",o),customElements.define("subscript-console",l)})()})();
//# sourceMappingURL=console-element.js.map
(()=>{function ee(b,t=!1){let n=b.split(/\n/g);if(n.length>1){for(;!n[0].trim().length;)n.shift();let i=n[t?1:0].split(/[^\s]/)[0].length;if(i)return n.map((e,r)=>{let l=e.substring(0,i);return l.trim().length?l.trim()==="}"&&r===n.length-1?"}":e:e.substring(i)}).join(`
`)}return b}var te=b=>class extends b{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){[].concat(this.css).forEach(n=>{if(n.includes("{")&&n.includes(":")&&n.includes(";")){let i=this.shadowRoot.appendChild(document.createElement("style"));i.textContent=n}else{let i=this.shadowRoot.appendChild(document.createElement("link"));i.setAttribute("rel","stylesheet"),i.setAttribute("href",n)}})}get css(){return[]}};var ae=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{},c=function(b){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,i={},e={manual:b.Prism&&b.Prism.manual,disableWorkerMessageHandler:b.Prism&&b.Prism.disableWorkerMessageHandler,util:{encode:function a(s){return s instanceof r?new r(s.type,a(s.content),s.alias):Array.isArray(s)?s.map(a):s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(a){return Object.prototype.toString.call(a).slice(8,-1)},objId:function(a){return a.__id||Object.defineProperty(a,"__id",{value:++n}),a.__id},clone:function a(s,p){var d,u;switch(p=p||{},e.util.type(s)){case"Object":if(u=e.util.objId(s),p[u])return p[u];for(var y in d={},p[u]=d,s)s.hasOwnProperty(y)&&(d[y]=a(s[y],p));return d;case"Array":return u=e.util.objId(s),p[u]?p[u]:(d=[],p[u]=d,s.forEach(function(m,x){d[x]=a(m,p)}),d);default:return s}},getLanguage:function(a){for(;a;){var s=t.exec(a.className);if(s)return s[1].toLowerCase();a=a.parentElement}return"none"},setLanguage:function(a,s){a.className=a.className.replace(RegExp(t,"gi"),""),a.classList.add("language-"+s)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(d){var a=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(d.stack)||[])[1];if(a){var s=document.getElementsByTagName("script");for(var p in s)if(s[p].src==a)return s[p]}return null}},isActive:function(a,s,p){for(var d="no-"+s;a;){var u=a.classList;if(u.contains(s))return!0;if(u.contains(d))return!1;a=a.parentElement}return!!p}},languages:{plain:i,plaintext:i,text:i,txt:i,extend:function(a,s){var p=e.util.clone(e.languages[a]);for(var d in s)p[d]=s[d];return p},insertBefore:function(a,s,p,d){var u=(d=d||e.languages)[a],y={};for(var m in u)if(u.hasOwnProperty(m)){if(m==s)for(var x in p)p.hasOwnProperty(x)&&(y[x]=p[x]);p.hasOwnProperty(m)||(y[m]=u[m])}var A=d[a];return d[a]=y,e.languages.DFS(e.languages,function(F,T){T===A&&F!=a&&(this[F]=y)}),y},DFS:function a(s,p,d,u){u=u||{};var y=e.util.objId;for(var m in s)if(s.hasOwnProperty(m)){p.call(s,m,s[m],d||m);var x=s[m],A=e.util.type(x);A!=="Object"||u[y(x)]?A!=="Array"||u[y(x)]||(u[y(x)]=!0,a(x,p,m,u)):(u[y(x)]=!0,a(x,p,null,u))}}},plugins:{},highlightAll:function(a,s){e.highlightAllUnder(document,a,s)},highlightAllUnder:function(a,s,p){var d={callback:p,container:a,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};e.hooks.run("before-highlightall",d),d.elements=Array.prototype.slice.apply(d.container.querySelectorAll(d.selector)),e.hooks.run("before-all-elements-highlight",d);for(var u,y=0;u=d.elements[y++];)e.highlightElement(u,s===!0,d.callback)},highlightElement:function(a,s,p){var d=e.util.getLanguage(a),u=e.languages[d];e.util.setLanguage(a,d);var y=a.parentElement;y&&y.nodeName.toLowerCase()==="pre"&&e.util.setLanguage(y,d);var m={element:a,language:d,grammar:u,code:a.textContent};function x(F){m.highlightedCode=F,e.hooks.run("before-insert",m),m.element.innerHTML=m.highlightedCode,e.hooks.run("after-highlight",m),e.hooks.run("complete",m),p&&p.call(m.element)}if(e.hooks.run("before-sanity-check",m),(y=m.element.parentElement)&&y.nodeName.toLowerCase()==="pre"&&!y.hasAttribute("tabindex")&&y.setAttribute("tabindex","0"),!m.code)return e.hooks.run("complete",m),void(p&&p.call(m.element));if(e.hooks.run("before-highlight",m),m.grammar)if(s&&b.Worker){var A=new Worker(e.filename);A.onmessage=function(F){x(F.data)},A.postMessage(JSON.stringify({language:m.language,code:m.code,immediateClose:!0}))}else x(e.highlight(m.code,m.grammar,m.language));else x(e.util.encode(m.code))},highlight:function(a,s,p){var d={code:a,grammar:s,language:p};if(e.hooks.run("before-tokenize",d),!d.grammar)throw new Error('The language "'+d.language+'" has no grammar.');return d.tokens=e.tokenize(d.code,d.grammar),e.hooks.run("after-tokenize",d),r.stringify(e.util.encode(d.tokens),d.language)},tokenize:function(a,s){var p=s.rest;if(p){for(var d in p)s[d]=p[d];delete s.rest}var u=new h;return f(u,u.head,a),function y(m,x,A,F,T,_){for(var C in A)if(A.hasOwnProperty(C)&&A[C]){var E=A[C];E=Array.isArray(E)?E:[E];for(var S=0;S<E.length;++S){if(_&&_.cause==C+","+S)return;var w=E[S],N=w.inside,I=!!w.lookbehind,H=!!w.greedy,G=w.alias;if(H&&!w.pattern.global){var ne=w.pattern.toString().match(/[imsuy]*$/)[0];w.pattern=RegExp(w.pattern.source,ne+"g")}for(var Q=w.pattern||w,L=F.next,$=T;L!==x.tail&&!(_&&$>=_.reach);$+=L.value.length,L=L.next){var j=L.value;if(x.length>m.length)return;if(!(j instanceof r)){var z,q=1;if(H){if(!(z=l(Q,$,m,I))||z.index>=m.length)break;var M=z.index,re=z.index+z[0].length,B=$;for(B+=L.value.length;B<=M;)L=L.next,B+=L.value.length;if(B-=L.value.length,$=B,L.value instanceof r)continue;for(var R=L;R!==x.tail&&(B<re||typeof R.value=="string");R=R.next)q++,B+=R.value.length;q--,j=m.slice($,B),z.index-=$}else if(!(z=l(Q,0,j,I)))continue;var M=z.index,W=z[0],J=j.slice(0,M),V=j.slice(M+W.length),U=$+j.length;_&&U>_.reach&&(_.reach=U);var Z=L.prev;J&&(Z=f(x,Z,J),$+=J.length),g(x,Z,q);var ie=new r(C,N?e.tokenize(W,N):W,G,W);if(L=f(x,Z,ie),V&&f(x,L,V),1<q){var X={cause:C+","+S,reach:U};y(m,x,A,L.prev,$,X),_&&X.reach>_.reach&&(_.reach=X.reach)}}}}}}(a,u,s,u.head,0),function(y){for(var m=[],x=y.head.next;x!==y.tail;)m.push(x.value),x=x.next;return m}(u)},hooks:{all:{},add:function(a,s){var p=e.hooks.all;p[a]=p[a]||[],p[a].push(s)},run:function(a,s){var p=e.hooks.all[a];if(p&&p.length)for(var d,u=0;d=p[u++];)d(s)}},Token:r};function r(a,s,p,d){this.type=a,this.content=s,this.alias=p,this.length=0|(d||"").length}function l(a,s,p,d){a.lastIndex=s;var u=a.exec(p);if(u&&d&&u[1]){var y=u[1].length;u.index+=y,u[0]=u[0].slice(y)}return u}function h(){var a={value:null,prev:null,next:null},s={value:null,prev:a,next:null};a.next=s,this.head=a,this.tail=s,this.length=0}function f(a,s,p){var d=s.next,u={value:p,prev:s,next:d};return s.next=u,d.prev=u,a.length++,u}function g(a,s,p){for(var d=s.next,u=0;u<p&&d!==a.tail;u++)d=d.next;(s.next=d).prev=s,a.length-=u}if(b.Prism=e,r.stringify=function a(s,p){if(typeof s=="string")return s;if(Array.isArray(s)){var d="";return s.forEach(function(A){d+=a(A,p)}),d}var u={type:s.type,content:a(s.content,p),tag:"span",classes:["token",s.type],attributes:{},language:p},y=s.alias;y&&(Array.isArray(y)?Array.prototype.push.apply(u.classes,y):u.classes.push(y)),e.hooks.run("wrap",u);var m="";for(var x in u.attributes)m+=" "+x+'="'+(u.attributes[x]||"").replace(/"/g,"&quot;")+'"';return"<"+u.tag+' class="'+u.classes.join(" ")+'"'+m+">"+u.content+"</"+u.tag+">"},!b.document)return b.addEventListener&&(e.disableWorkerMessageHandler||b.addEventListener("message",function(a){var s=JSON.parse(a.data),p=s.language,d=s.code,u=s.immediateClose;b.postMessage(e.highlight(d,e.languages[p],p)),u&&b.close()},!1)),e;var v=e.util.currentScript();function o(){e.manual||e.highlightAll()}if(v&&(e.filename=v.src,v.hasAttribute("data-manual")&&(e.manual=!0)),!e.manual){var k=document.readyState;k==="loading"||k==="interactive"&&v&&v.defer?document.addEventListener("DOMContentLoaded",o):window.requestAnimationFrame?window.requestAnimationFrame(o):window.setTimeout(o,16)}return e}(ae);typeof module<"u"&&module.exports&&(module.exports=c),typeof global<"u"&&(global.Prism=c);c.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},c.languages.markup.tag.inside["attr-value"].inside.entity=c.languages.markup.entity,c.languages.markup.doctype.inside["internal-subset"].inside=c.languages.markup,c.hooks.add("wrap",function(b){b.type==="entity"&&(b.attributes.title=b.content.replace(/&amp;/,"&"))}),Object.defineProperty(c.languages.markup.tag,"addInlined",{value:function(b,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:c.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};i["language-"+t]={pattern:/[\s\S]+/,inside:c.languages[t]};var e={};e[b]={pattern:RegExp("(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[^])*?(?=</__>)".replace(/__/g,function(){return b}),"i"),lookbehind:!0,greedy:!0,inside:i},c.languages.insertBefore("markup","cdata",e)}}),Object.defineProperty(c.languages.markup.tag,"addAttribute",{value:function(b,t){c.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(`(^|["'\\s])(?:`+b+`)\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s'">=]+(?=[\\s>]))`,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:c.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),c.languages.html=c.languages.markup,c.languages.mathml=c.languages.markup,c.languages.svg=c.languages.markup,c.languages.xml=c.languages.extend("markup",{}),c.languages.ssml=c.languages.xml,c.languages.atom=c.languages.xml,c.languages.rss=c.languages.xml;(function(b){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;b.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+`|(?:[^\\\\\r
()"']|\\\\[^])*)\\)`,"i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},b.languages.css.atrule.inside.rest=b.languages.css;var n=b.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))})(c);c.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};c.languages.javascript=c.languages.extend("clike",{"class-name":[c.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp("(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])"),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),c.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,c.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:c.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:c.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:c.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:c.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:c.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),c.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:c.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),c.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),c.languages.markup&&(c.languages.markup.tag.addInlined("script","javascript"),c.languages.markup.tag.addAttribute("on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)","javascript")),c.languages.js=c.languages.javascript;(function(){if(typeof c<"u"&&typeof document<"u"&&document.querySelector){var b,t="line-numbers",n="linkable-line-numbers",i=function(){if(b===void 0){var o=document.createElement("div");o.style.fontSize="13px",o.style.lineHeight="1.5",o.style.padding="0",o.style.border="0",o.innerHTML="&nbsp;<br />&nbsp;",document.body.appendChild(o),b=o.offsetHeight===38,document.body.removeChild(o)}return b},e=!0;c.plugins.lineHighlight={highlightLines:function(o,k,a){var s=(k=typeof k=="string"?k:o.getAttribute("data-line")||"").replace(/\s+/g,"").split(",").filter(Boolean),p=+o.getAttribute("data-line-offset")||0,d=(i()?parseInt:parseFloat)(getComputedStyle(o).lineHeight),u=c.util.isActive(o,t),y=o.querySelector("code"),m=u?o:y||o,x=[],A=y&&m!=y?function(_,C){var E=getComputedStyle(_),S=getComputedStyle(C);function w(N){return+N.substr(0,N.length-2)}return C.offsetTop+w(S.borderTopWidth)+w(S.paddingTop)-w(E.paddingTop)}(o,y):0;s.forEach(function(_){var C=_.split("-"),E=+C[0],S=+C[1]||E,w=o.querySelector('.line-highlight[data-range="'+_+'"]')||document.createElement("div");if(x.push(function(){w.setAttribute("aria-hidden","true"),w.setAttribute("data-range",_),w.className=(a||"")+" line-highlight"}),u&&c.plugins.lineNumbers){var N=c.plugins.lineNumbers.getLine(o,E),I=c.plugins.lineNumbers.getLine(o,S);if(N){var H=N.offsetTop+A+"px";x.push(function(){w.style.top=H})}if(I){var G=I.offsetTop-N.offsetTop+I.offsetHeight+"px";x.push(function(){w.style.height=G})}}else x.push(function(){w.setAttribute("data-start",String(E)),E<S&&w.setAttribute("data-end",String(S)),w.style.top=(E-p-1)*d+A+"px",w.textContent=new Array(S-E+2).join(`
`)});x.push(function(){w.style.width=o.scrollWidth+"px"}),x.push(function(){m.appendChild(w)})});var F=o.id;if(u&&c.util.isActive(o,n)&&F){h(o,n)||x.push(function(){o.classList.add(n)});var T=parseInt(o.getAttribute("data-start")||"1");l(".line-numbers-rows > span",o).forEach(function(_,C){var E=C+T;_.onclick=function(){var S=F+"."+E;e=!1,location.hash=S,setTimeout(function(){e=!0},1)}})}return function(){x.forEach(f)}}};var r=0;c.hooks.add("before-sanity-check",function(o){var k=o.element.parentElement;if(g(k)){var a=0;l(".line-highlight",k).forEach(function(s){a+=s.textContent.length,s.parentNode.removeChild(s)}),a&&/^(?: \n)+$/.test(o.code.slice(-a))&&(o.code=o.code.slice(0,-a))}}),c.hooks.add("complete",function o(k){var a=k.element.parentElement;if(g(a)){clearTimeout(r);var s=c.plugins.lineNumbers,p=k.plugins&&k.plugins.lineNumbers;h(a,t)&&s&&!p?c.hooks.add("line-numbers",o):(c.plugins.lineHighlight.highlightLines(a)(),r=setTimeout(v,1))}}),window.addEventListener("hashchange",v),window.addEventListener("resize",function(){l("pre").filter(g).map(function(o){return c.plugins.lineHighlight.highlightLines(o)}).forEach(f)})}function l(o,k){return Array.prototype.slice.call((k||document).querySelectorAll(o))}function h(o,k){return o.classList.contains(k)}function f(o){o()}function g(o){return!(!o||!/pre/i.test(o.nodeName))&&(!!o.hasAttribute("data-line")||!(!o.id||!c.util.isActive(o,n)))}function v(){var o=location.hash.slice(1);l(".temporary.line-highlight").forEach(function(p){p.parentNode.removeChild(p)});var k=(o.match(/\.([\d,-]+)$/)||[,""])[1];if(k&&!document.getElementById(o)){var a=o.slice(0,o.lastIndexOf(".")),s=document.getElementById(a);s&&(s.hasAttribute("data-line")||s.setAttribute("data-line",""),c.plugins.lineHighlight.highlightLines(s,k,"temporary ")(),e&&document.querySelector(".temporary.line-highlight").scrollIntoView())}}})();(function(){if(typeof c<"u"&&typeof document<"u"){var b="line-numbers",t=/\n(?!$)/g,n=c.plugins.lineNumbers={getLine:function(r,l){if(r.tagName==="PRE"&&r.classList.contains(b)){var h=r.querySelector(".line-numbers-rows");if(h){var f=parseInt(r.getAttribute("data-start"),10)||1,g=f+(h.children.length-1);l<f&&(l=f),g<l&&(l=g);var v=l-f;return h.children[v]}}},resize:function(r){e([r])},assumeViewportIndependence:!0},i=void 0;window.addEventListener("resize",function(){n.assumeViewportIndependence&&i===window.innerWidth||(i=window.innerWidth,e(Array.prototype.slice.call(document.querySelectorAll("pre."+b))))}),c.hooks.add("complete",function(r){if(r.code){var l=r.element,h=l.parentNode;if(h&&/pre/i.test(h.nodeName)&&!l.querySelector(".line-numbers-rows")&&c.util.isActive(l,b)){l.classList.remove(b),h.classList.add(b);var f,g=r.code.match(t),v=g?g.length+1:1,o=new Array(v+1).join("<span></span>");(f=document.createElement("span")).setAttribute("aria-hidden","true"),f.className="line-numbers-rows",f.innerHTML=o,h.hasAttribute("data-start")&&(h.style.counterReset="linenumber "+(parseInt(h.getAttribute("data-start"),10)-1)),r.element.appendChild(f),e([h]),c.hooks.run("line-numbers",r)}}}),c.hooks.add("line-numbers",function(r){r.plugins=r.plugins||{},r.plugins.lineNumbers=!0})}function e(r){if((r=r.filter(function(h){var f=function(g){return g?window.getComputedStyle?getComputedStyle(g):g.currentStyle||null:null}(h)["white-space"];return f==="pre-wrap"||f==="pre-line"})).length!=0){var l=r.map(function(h){var f=h.querySelector("code"),g=h.querySelector(".line-numbers-rows");if(f&&g){var v=h.querySelector(".line-numbers-sizer"),o=f.textContent.split(t);v||((v=document.createElement("span")).className="line-numbers-sizer",f.appendChild(v)),v.innerHTML="0",v.style.display="block";var k=v.getBoundingClientRect().height;return v.innerHTML="",{element:h,lines:o,lineHeights:[],oneLinerHeight:k,sizer:v}}}).filter(Boolean);l.forEach(function(h){var f=h.sizer,g=h.lines,v=h.lineHeights,o=h.oneLinerHeight;v[g.length-1]=void 0,g.forEach(function(k,a){if(k&&1<k.length){var s=f.appendChild(document.createElement("span"));s.style.display="block",s.textContent=k}else v[a]=o})}),l.forEach(function(h){for(var f=h.sizer,g=h.lineHeights,v=0,o=0;o<g.length;o++)g[o]===void 0&&(g[o]=f.children[v++].getBoundingClientRect().height)}),l.forEach(function(h){var f=h.sizer,g=h.element.querySelector(".line-numbers-rows");f.style.display="none",f.innerHTML="",h.lineHeights.forEach(function(v,o){g.children[o].style.height=v+"px"})})}}})();(function(){if(typeof c<"u"&&typeof document<"u"){var b=[],t={},n=function(){};c.plugins.toolbar={};var i=c.plugins.toolbar.registerButton=function(r,l){var h;h=typeof l=="function"?l:function(f){var g;return typeof l.onClick=="function"?((g=document.createElement("button")).type="button",g.addEventListener("click",function(){l.onClick.call(this,f)})):typeof l.url=="string"?(g=document.createElement("a")).href=l.url:g=document.createElement("span"),l.className&&g.classList.add(l.className),g.textContent=l.text,g},r in t?console.warn('There is a button with the key "'+r+'" registered already.'):b.push(t[r]=h)},e=c.plugins.toolbar.hook=function(r){var l=r.element.parentNode;if(l&&/pre/i.test(l.nodeName)&&!l.parentNode.classList.contains("code-toolbar")){var h=document.createElement("div");h.classList.add("code-toolbar"),l.parentNode.insertBefore(h,l),h.appendChild(l);var f=document.createElement("div");f.classList.add("toolbar");var g=b,v=function(o){for(;o;){var k=o.getAttribute("data-toolbar-order");if(k!=null)return(k=k.trim()).length?k.split(/\s*,\s*/g):[];o=o.parentElement}}(r.element);v&&(g=v.map(function(o){return t[o]||n})),g.forEach(function(o){var k=o(r);if(k){var a=document.createElement("div");a.classList.add("toolbar-item"),a.appendChild(k),f.appendChild(a)}}),h.appendChild(f)}};i("label",function(r){var l=r.element.parentNode;if(l&&/pre/i.test(l.nodeName)&&l.hasAttribute("data-label")){var h,f,g=l.getAttribute("data-label");try{f=document.querySelector("template#"+g)}catch{}return f?h=f.content:(l.hasAttribute("data-url")?(h=document.createElement("a")).href=l.getAttribute("data-url"):h=document.createElement("span"),h.textContent=g),h}}),c.hooks.add("complete",e)}})();(function(){function b(n,i){n.addEventListener("click",function(){(function(e){navigator.clipboard?navigator.clipboard.writeText(e.getText()).then(e.success,function(){t(e)}):t(e)})(i)})}function t(n){var i=document.createElement("textarea");i.value=n.getText(),i.style.top="0",i.style.left="0",i.style.position="fixed",document.body.appendChild(i),i.focus(),i.select();try{var e=document.execCommand("copy");setTimeout(function(){e?n.success():n.error()},1)}catch(r){setTimeout(function(){n.error(r)},1)}document.body.removeChild(i)}typeof c<"u"&&typeof document<"u"&&(c.plugins.toolbar?c.plugins.toolbar.registerButton("copy-to-clipboard",function(n){var i=n.element,e=function(g){var v={copy:"Copy","copy-error":"Press Ctrl+C to copy","copy-success":"Copied!","copy-timeout":5e3};for(var o in v){for(var k="data-prismjs-"+o,a=g;a&&!a.hasAttribute(k);)a=a.parentElement;a&&(v[o]=a.getAttribute(k))}return v}(i),r=document.createElement("button");r.className="copy-to-clipboard-button",r.setAttribute("type","button");var l=document.createElement("span");return r.appendChild(l),f("copy"),b(r,{getText:function(){return i.textContent},success:function(){f("copy-success"),h()},error:function(){f("copy-error"),setTimeout(function(){(function(g){window.getSelection().selectAllChildren(g)})(i)},1),h()}}),r;function h(){setTimeout(function(){f("copy")},e["copy-timeout"])}function f(g){l.textContent=e[g],r.setAttribute("data-copy-state",g)}}):console.warn("Copy to Clipboard plugin loaded before Toolbar plugin."))})();(function(){if(typeof c<"u"&&typeof document<"u"){var b={"(":")","[":"]","{":"}"},t={"(":"brace-round","[":"brace-square","{":"brace-curly"},n={"${":"{"},i=0,e=/^(pair-\d+-)(close|open)$/;c.hooks.add("complete",function(v){var o=v.element,k=o.parentElement;if(k&&k.tagName=="PRE"){var a=[];if(c.util.isActive(o,"match-braces")&&a.push("(","[","{"),a.length!=0){k.__listenerAdded||(k.addEventListener("mousedown",function(){var u=k.querySelector("code"),y=r("brace-selected");Array.prototype.slice.call(u.querySelectorAll("."+y)).forEach(function(m){m.classList.remove(y)})}),Object.defineProperty(k,"__listenerAdded",{value:!0}));var s=Array.prototype.slice.call(o.querySelectorAll("span."+r("token")+"."+r("punctuation"))),p=[];a.forEach(function(u){for(var y=b[u],m=r(t[u]),x=[],A=[],F=0;F<s.length;F++){var T=s[F];if(T.childElementCount==0){var _=T.textContent;(_=n[_]||_)===u?(p.push({index:F,open:!0,element:T}),T.classList.add(m),T.classList.add(r("brace-open")),A.push(F)):_===y&&(p.push({index:F,open:!1,element:T}),T.classList.add(m),T.classList.add(r("brace-close")),A.length&&x.push([F,A.pop()]))}}x.forEach(function(C){var E="pair-"+i+++"-",S=s[C[0]],w=s[C[1]];S.id=E+"open",w.id=E+"close",[S,w].forEach(function(N){N.addEventListener("mouseenter",h),N.addEventListener("mouseleave",f),N.addEventListener("click",g)})})});var d=0;p.sort(function(u,y){return u.index-y.index}),p.forEach(function(u){u.open?(u.element.classList.add(r("brace-level-"+(d%12+1))),d++):(d=Math.max(0,d-1),u.element.classList.add(r("brace-level-"+(d%12+1))))})}}})}function r(v){var o=c.plugins.customClass;return o?o.apply(v,"none"):v}function l(v){var o=e.exec(v.id);return document.querySelector("#"+o[1]+(o[2]=="open"?"close":"open"))}function h(){c.util.isActive(this,"brace-hover",!0)&&[this,l(this)].forEach(function(v){v.classList.add(r("brace-hover"))})}function f(){[this,l(this)].forEach(function(v){v.classList.remove(r("brace-hover"))})}function g(){c.util.isActive(this,"brace-select",!0)&&[this,l(this)].forEach(function(v){v.classList.add(r("brace-selected"))})}})();var Y=b=>class extends te(b||HTMLElement){static get observedAttributes(){return["name","editable","placeholder"]}connectedCallback(){let t=n=>n.replace(new RegExp("&","g"),"&amp;").replace(new RegExp("<","g"),"&lt;");this._lang="javascript",this._editable=this.getAttribute("editable"),this._styledBlock=this.getAttribute("styled-block")||"pre",this._div=document.createElement("div"),this._preBlock=this._div.appendChild(document.createElement("pre")),this._codeBlock=this._preBlock.appendChild(document.createElement("code")),this._div.classList.add("line-numbers"),this._div.classList.add("container"),this._lang&&(this._preBlock.classList.add("language-"+this._lang),this._codeBlock.classList.add("language-"+this._lang)),this._contentSlot=document.createElement("slot"),this._contentSlot.setAttribute("aria-hidden","true"),this._contentSlot.setAttribute("hidden","true"),this._initialSlotEvent=!1,this._contentSlot.addEventListener("slotchange",()=>{let n=this._contentSlot.assignedNodes().reduce((i,e)=>i+(e.outerHTML||e.nodeValue||""),"");this._initialSlotEvent||(n=ee(n),this._initialSlotEvent=!0),this._textarea&&(this._textarea.value=n),this.source=t(n)}),this._editable==="true"&&this._addEditor(),this.shadowRoot.append(this._contentSlot,this._textarea||"",this._div),super.connectedCallback()}get source(){return this._codeBlock.textContent}set source(t){t.endsWith(`
`)&&(t+=" "),this._codeBlock.innerHTML="",this._codeBlock.innerHTML=t,this._highlightCodeBlock(),this._syncScrolling()}get name(){return this._name}set name(t){return this.setAttribute("name",t)}get placeholder(){return this._placeholder}set placeholder(t){return this.setAttribute("placeholder",t)}get editable(){return this._editable}set editable(t){return this.setAttribute("editable",t===!0?"true":t===!1?"false":t)}_addEditor(){this._placeholder=this.getAttribute("placeholder"),this._name=this.getAttribute("name"),this._textarea=this._div.appendChild(document.createElement("textarea")),this._textarea.placeholder=this._placeholder||this._lang,this._textarea.spellcheck=!1,this._textarea.name=this._name||"",this._textarea.value=this._codeBlock.textContent,this._preBlock.setAttribute("aria-hidden","true"),this._scrollBlock=this.getAttribute("scroll-block")==="code"?this._codeBlock:this._preBlock,this._textarea.addEventListener("input",t=>{this.source=t.target.value}),this._textarea.addEventListener("input",()=>this._syncScrolling()),this._textarea.addEventListener("scroll",()=>this._syncScrolling()),this._textarea.addEventListener("keydown",t=>this._handleTabKeyEvent(t))}_handleTabKeyEvent(t){if(!this._textarea||t.key!=="Tab")return;t.preventDefault();let n=this._textarea.value,i=this._textarea.selectionStart,e=this._textarea.selectionEnd;if(i===e){let r=n.slice(0,i),l=n.slice(e,n.length),h=e+1;this._textarea.value=r+" "+l,this._textarea.selectionStart=h,this._textarea.selectionEnd=h}else{let r=n.split(`
`),l=0,h=0,f=0;for(let g=0;g<r.length;g++)l+=r[g].length,i<l&&e>l-r[g].length&&(t.shiftKey?r[g][0]===" "&&(r[g]=r[g].slice(1),h===0&&f--,h--):(r[g]=" "+r[g],h===0&&f++,h++));this._textarea.value=r.join(`
`),this._textarea.selectionStart=i+f,this._textarea.selectionEnd=e+h}this.source=this._textarea.value}_syncScrolling(){!this._scrollBlock||(this._scrollBlock.scrollTop=this._textarea.scrollTop,this._scrollBlock.scrollLeft=this._textarea.scrollLeft)}_highlightCodeBlock(){Prism.highlightElement(this._codeBlock)}disconnectedCallback(){Array.from(this.shadowRoot.childNodes).forEach(t=>t.remove())}attributeChangedCallback(t,n,i){if(!!this.childNodes.length)switch(t){case"name":this._name=i,this._textarea.name=i;break;case"placeholder":this._placeholder=i,this._textarea.placeholder=i;break;case"editable":this._editable=i,this._textarea?this._textarea.disabled=i==="false":i==="true"&&this._addEditor(),i==="true"&&this._textarea.focus();break}}get css(){return["https://unpkg.com/@webqit/subscript/src/console/assets/prism.css","https://unpkg.com/@webqit/subscript/src/console/assets/vs-code-dark.css",`
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
:host {
/* Allow other elems to be inside */
position: relative;
top: 0;
left: 0;
display: block;
/* Normal inline styles */
font-size: 0.8rem;
font-family: monospace;
line-height: 1.2rem;
tab-size: 2;
caret-color: darkgrey;
white-space: pre;
overflow: hidden;
}
.container {
min-height: 100%;
width: 100%;
display: flex;
}
.container > * {
width: 100%;
}
textarea, ${this._styledBlock} {
/* Both elements need the same text and space styling so they are directly on top of each other */
margin: 0px !important;
padding-top: var(--vertical-padding, 1.5rem) !important;
padding-bottom: var(--vertical-padding, 1.5rem) !important;
padding-left: var(--horizontal-padding, 1rem) !important;
padding-right: var(--horizontal-padding, 1rem) !important;
border: 0 !important;
width: 100% !important;
height: 100% !important;
}
${this._styledBlock==="code"?"pre":"code"} {
margin: 0px !important;
border: 0px !important;
padding: 0px !important;
overflow: auto !important;
width: 100% !important;
height: 100% !important;
}
.line-numbers :is(textarea, pre[class*=language-]) {
padding-left:3.8rem !important;
}
textarea, pre, pre * {
/* Also add text styles to highlighing tokens */
font-size: inherit !important;
font-family: inherit !important;
line-height: inherit !important;
tab-size: inherit !important;
}
textarea, pre {
/* In the same place */
position: absolute;
top: 0;
left: 0;
}
textarea[disabled] {
pointer-events: none !important;
}
/* Move the textarea in front of the result */
textarea {
z-index: 1;
}
pre {
z-index: 0;
}
/* Make textarea almost completely transparent */
textarea {
color: transparent;
background: transparent;
caret-color: inherit!important; /* Or choose your favourite color */
}
/* Can be scrolled */
textarea, pre {
overflow: auto !important;
white-space: inherit !important;
word-spacing: normal !important;
word-break: normal !important;
word-wrap: normal !important;
}
/* No resize on textarea; stop outline */
textarea {
resize: none;
outline: none !important;
}
.line-numbers-rows {
border: none !important;
color: dimgray !important;
}
`]}};var D=b=>class extends(b||class{}){setStateCallback(t,n,i,e=100,r){this._timeouts||(this._timeouts={}),t in this._timeouts||(this._timeouts[t]=[]),i?(this._timeouts[t].length||r(),e?this._timeouts[t].unshift(setTimeout(()=>this.setState(t,n,!1),e)):this._timeouts[t].unshift(null),this._related&&this._related.setState(t,n,!0,e)):(this._timeouts[t].shift(),this._timeouts[t].length||(r(),this._related&&this._related.setState(t,n,!1)))}};var O=class extends D(){bind(t){Object.assign(this,t),this.fullPaths=[],this.$fullPaths=[],this.ownerReference.assignee&&this.ownerReference.assignee.refs.forEach(n=>{!n.depth||this.fullPaths.push([...this.path,...n.depth])}),this.fullPaths.length||(this.fullPaths=[this.path]),this.fullPaths.forEach((n,i)=>{this.$fullPaths.push(n.map(e=>"memoId"in e?"[[computed]]":e.name).join(".")),n.forEach(e=>{e.anchor.classList.add("ref-identifier"),e.anchor.classList.add(this.subscriptions?"effect":"signal");let r=e.anchor.getAttribute("title"),l="> "+this.$fullPaths[i]+(this.subscriptions?" (Effect Ref)":" (Signal Ref)");e.anchor.setAttribute("title",r?r+`
`+l:l)}),this._on(i,"mouseenter",()=>{this._setState(i,"path","hover",!0,0)})._on(i,"mouseleave",()=>{this._setState(i,"path","hover",!1)}),this.subscriptions&&this._on(i,"click",()=>{this.ownerReference.ownerContract.runThread(n)})})}_setState(t,n,i,e,r=100){this.setStateCallback(t+"|"+n,i,e,r,()=>{e?this.fullPaths[t].forEach(l=>l.anchor.classList.add(`${n}-${i}`)):this.fullPaths[t].forEach(l=>l.anchor.classList.remove(`${n}-${i}`))})}setState(t,n,i,e=100){let[r,l]=t.split("|");if(l!==void 0)return this._setState(r,l,n,i,e);this.fullPaths.forEach((h,f)=>{this._setState(f,t,n,i,e)})}_on(t,n,i){return this.fullPaths[t].forEach(e=>e.anchor.addEventListener(n,i.bind(this))),this}on(t,n){this.fullPaths.forEach((i,e)=>{this._on(e,t,n)})}};var P=class extends D(HTMLElement){bind(t){if(Object.assign(this,t),!this.graph)return;this.subContracts&&this.subContracts.forEach(i=>{i.replaceWith(...i.childNodes)}),this.subContracts=new Map,this._textNodes=this.getTextNodes();for(let i in this.graph.subContracts){let e=this.graph.subContracts[i],r=this.createSubContract({ownerContract:this,graph:e});this.subContracts.set(e.id,r)}if(this.effects=new Map,this.signals=new Map,this.refAnchors)for(let i in this.refAnchors){let e=this.refAnchors[i];e.replaceWith(...e.childNodes)}this.refAnchors={},this._textNodes=this.getTextNodes();let n=i=>{for(let e in this.graph[i]){let r=this.createReference({ownerContract:this,...this.graph[i][e]});this[i].set(e,r)}};n("effects"),n("signals"),this.setAttribute("title",this.graph.type),this.on("mouseenter",()=>{this.setState("block","hover",!0,0)}).on("mouseleave",()=>{this.setState("block","hover",!1)}),this.observe((i,e)=>{this.setState("block","runtime-active",!0,100),e.forEach(r=>{let l=this.signals.get(r.referenceId+"");!l||l.refs.get(r.id).setState("path","runtime-active",!0,100)})})}get program(){return this.ownerContract?this.ownerContract.program:this.runtime}runThread(...t){let n=this.program.locate(this.graph.lineage);if(!!n)return n.thread(...t)}observe(t){return this.program.observe(this.graph.lineage,t)}createSubContract(t){let n=document.createElement("subscript-contract");return this.insertNode(n,t.graph.loc,"contract"),n.bind(t),n}createReference(t){let n={...t,refs:new Map};"assignee"in t&&(n.assignee=this.effects.get(t.assignee+""));for(let i of t.refs){let e=this.createRef({ownerReference:n,...i});n.refs.set(i.id,e)}return n}createRef(t){let n=new O,i=e=>{let[r,l]=e.loc,h=r+"-"+l,f=this.refAnchors[h];return f||(f=document.createElement("span"),this.insertNode(f,[r,l],"ref"),this.refAnchors[h]=f),f};return t={...t,path:t.path.map(e=>({anchor:i(e),...e}))},t.depth&&(t.depth=t.depth.map(e=>({anchor:i(e),...e}))),n.bind(t),n}insertNode(t,n,i){let[e,r]=n,l=this.graph.loc?this.graph.loc[0]:0,[h,f]=this.resolveOffset(e-l),[g,v]=this.resolveOffset(r-l,!1),o=new Range;return i==="contract"?(f===0&&h.parentNode.nodeName==="SPAN"?o.setStartBefore(h.parentNode):o.setStart(h,f),v===(g.nodeValue||"").length&&g.parentNode.nodeName==="SPAN"?o.setEndAfter(g.parentNode):o.setEnd(g,v)):(o.setStart(h,f),o.setEnd(g,v)),o.surroundContents(t),t}resolveOffset(t,n=!0){return this._textNodes.reduce(([i,e,r],l)=>{if(e===null){let h=r+l.length;if(t<=h&&!l.isBlank){let f=t-r;if(!n&&f===0)return[i.node,i.length];if(!n||f<l.length)return[l.node,f]}[i,e,r]=[l,e,h]}return[i,e,r]},[null,null,0])}getTextNodes(t=this){let n={acceptNode:function(l){if(l.parentNode.nodeName!=="SCRIPT")return window.NodeFilter.FILTER_ACCEPT}},i=window.document.createTreeWalker(t||this,window.NodeFilter.SHOW_TEXT,n,!1),e=[],r;for(;r=i.nextNode();){let l=r.nodeValue||"";e.push({node:r,length:l.length,isBlank:l.trim().length===0})}return e}setState(t,n,i,e=100){i&&this.ownerContract&&this.ownerContract.setState(t,n,!1),this.setStateCallback(t,n,i,e,()=>{i?this.classList.add(`${t}-${n}`):this.classList.remove(`${t}-${n}`)})}on(t,n){return this.addEventListener(t,n.bind(this)),this}};var K=class extends Y(P){bind(t,n=!0){n&&(this.innerHTML=t.originalSource),setTimeout(()=>{if(!this._codeBlock.textContent.length)return;let i=t.runtime;super.bind({runtime:i,graph:i.graph})},0)}createRef(t){}getTextNodes(t=null){return super.getTextNodes(t||this._codeBlock)}get css(){return super.css.concat([`
.ref-identifier.path-runtime-active {
text-decoration: underline;
}
.ref-identifier:is(.path-runtime-active) {
}
.ref-identifier.cause {
cursor: default;
}
.ref-identifier.effect {
cursor: pointer;
}
.ref-identifier.cause:is(.path-hover, .path-runtime-active) {
color: aqua;
}
.token.keyword .ref-identifier.cause:is(.path-hover, .path-runtime-active) {
color: mediumturquoise;
}
.ref-identifier.effect:is(.path-hover, .path-runtime-active) {
color: yellowgreen;
text-decoration: underline;
}
.ref-identifier.cause.effect:is(.path-hover, .path-runtime-active) {
color: lightgreen;
}
subscript-contract.block-hover,
subscript-contract.block-runtime-active {
outline: 1px dashed gray;
outline-offset: 0.1rem;
border-radius: 0.1rem;
/*
background-color: darkblue;
*/
}
subscript-contract.block-runtime-active {
background-color: rgba(100, 100, 100, 0.35);
}
`])}};customElements.define("subscript-codeblock",Y());customElements.define("subscript-contract",P);customElements.define("subscript-console",K);})();
//# sourceMappingURL=console-element.js.map

@@ -1,2 +0,32 @@

(()=>{"use strict";var t={829:(t,e,n)=>{n.d(e,{Z:()=>s});const s=t=>class extends t{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){[].concat(this.css).forEach((t=>{if(t.includes("{")&&t.includes(":")&&t.includes(";"))this.shadowRoot.appendChild(document.createElement("style")).textContent=t;else{let e=this.shadowRoot.appendChild(document.createElement("link"));e.setAttribute("rel","stylesheet"),e.setAttribute("href",t)}}))}get css(){return[]}}}},e={};function n(s){var o=e[s];if(void 0!==o)return o.exports;var i=e[s]={exports:{}};return t[s](i,i.exports,n),i.exports}n.d=(t,e)=>{for(var s in e)n.o(e,s)&&!n.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t=n(829);class e extends((0,t.Z)(HTMLElement)){connectedCallback(){this._contentSlot=document.createElement("slot"),this.shadowRoot.append(this._contentSlot),super.connectedCallback(),this._contentSlot.addEventListener("slotchange",(()=>{setTimeout((()=>{let t=this._contentSlot.assignedNodes().reduce(((t,e)=>t||(e.subscript instanceof Map?e:null)),null);if(t){this.inspectElement(t);let e=this.getAttribute("active");e&&this.inspectFunction(e)}}),0)}))}inspectElement(t){this.consoleElement&&(this.consoleElement.remove(),this.controlsElement.remove()),this.consoleElement=document.createElement("subscript-console"),this.controlsElement=document.createElement("div"),this.controlsElement.classList.add("controls-element"),this.shadowRoot.append(this.consoleElement,this.controlsElement),this.buttons={},t.subscript.forEach(((t,e)=>{let n="number"==typeof e?`script:${e}`:`${e}()`;this.buttons[e]=this.controlsElement.appendChild(document.createElement("button")),this.buttons[e].setAttribute("script-id",e),this.buttons[e].setAttribute("title",n),this.buttons[e].appendChild(document.createElement("span")).append(" ",n);let s=this.buttons[e].appendChild(document.createElement("i"));(this.getAttribute("data-icons")||"bi bi-"+("number"==typeof e?"code":"braces")).split(" ").map((t=>t.trim())).forEach((t=>s.classList.add(t))),this.buttons[e].addEventListener("click",(n=>{this.active&&this.active.classList.remove("active"),this.active=this.buttons[e],this.active.classList.add("active"),this.inspectFunction(t)}))}))}inspectFunction(t){if(t&&"string"!=typeof t)this.consoleElement.bind(t);else{let e=t;if(t||(e=Object.keys(this.buttons)[0]),e){let t=this.buttons[e],n=new MouseEvent("click",{view:window});t.dispatchEvent(n)}}}get css(){return["https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css","\n * {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n :host {\n position: relative;\n display: block;\n background-color: rgb(75, 75, 75);\n }\n .controls-element {\n position: relative;\n z-index: 10;\n }\n .controls-element button {\n display: inline-flex;\n align-items: center;\n background-color: transparent;\n padding: 0.5rem 1rem;\n border: none;\n color: silver;\n }\n .controls-element button:is(:hover, .active) {\n background-color: dimgray;\n color: gainsboro;\n }\n .controls-element button .bi {\n margin-left: 0.5rem;\n }\n "]}}customElements.define("subscript-inspector",e)})()})();
//# sourceMappingURL=inspector-element.js.map
(()=>{var c=l=>class extends l{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){[].concat(this.css).forEach(e=>{if(e.includes("{")&&e.includes(":")&&e.includes(";")){let t=this.shadowRoot.appendChild(document.createElement("style"));t.textContent=e}else{let t=this.shadowRoot.appendChild(document.createElement("link"));t.setAttribute("rel","stylesheet"),t.setAttribute("href",e)}})}get css(){return[]}};var i=class extends c(HTMLElement){connectedCallback(){this._contentSlot=document.createElement("slot"),this.shadowRoot.append(this._contentSlot),super.connectedCallback(),this._contentSlot.addEventListener("slotchange",()=>{setTimeout(()=>{let n=this._contentSlot.assignedNodes().reduce((e,t)=>e||(t.subscript instanceof Map?t:null),null);if(n){this.inspectElement(n);let e=this.getAttribute("active");e&&this.inspectFunction(e)}else console.error("No subscript element found.")},0)})}inspectElement(n){this.consoleElement&&(this.consoleElement.remove(),this.controlsElement.remove()),this.consoleElement=document.createElement("subscript-console"),this.controlsElement=document.createElement("div"),this.controlsElement.classList.add("controls-element"),this.shadowRoot.append(this.consoleElement,this.controlsElement),this.buttons={},n.subscript.forEach((e,t)=>{let s=typeof t=="number"?`script:${t}`:`${t}()`;this.buttons[t]=this.controlsElement.appendChild(document.createElement("button")),this.buttons[t].setAttribute("script-id",t),this.buttons[t].setAttribute("title",s),this.buttons[t].appendChild(document.createElement("span")).append(" ",s);let r=this.buttons[t].appendChild(document.createElement("i"));(this.getAttribute("data-icons")||`bi bi-${typeof t=="number"?"code":"braces"}`).split(" ").map(o=>o.trim()).forEach(o=>r.classList.add(o)),this.buttons[t].addEventListener("click",o=>{this.active&&this.active.classList.remove("active"),this.active=this.buttons[t],this.active.classList.add("active"),this.inspectFunction(e)})})}inspectFunction(n){if(!n||typeof n=="string"){let e=n;if(n||(e=Object.keys(this.buttons)[0]),e){let t=this.buttons[e],s=new MouseEvent("click",{view:window});t.dispatchEvent(s)}return}this.consoleElement.bind(n)}get css(){return["https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css",`
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
:host {
position: relative;
display: block;
background-color: rgb(75, 75, 75);
}
.controls-element {
position: relative;
z-index: 10;
}
.controls-element button {
display: inline-flex;
align-items: center;
background-color: transparent;
padding: 0.5rem 1rem;
border: none;
color: silver;
}
.controls-element button:is(:hover, .active) {
background-color: dimgray;
color: gainsboro;
}
.controls-element button .bi {
margin-left: 0.5rem;
}
`]}};customElements.define("subscript-inspector",i);})();
//# sourceMappingURL=inspector-element.js.map

14

package.json

@@ -11,3 +11,3 @@ {

"homepage": "https://webqit.io/tooling/subscript",
"version": "2.1.25",
"version": "2.1.26",
"license": "MIT",

@@ -27,3 +27,3 @@ "repository": {

"test:coverage": "c8 --reporter=text-lcov npm run test | coveralls",
"build": "webpack --config ./webpack.config.cjs",
"build": "esbuild main=src/browser-entry.js console-element=src/console/Console.js player-element=src/console/Player.js inspector-element=src/console/Inspector.js dev-elements=src/console/index.js --bundle --minify --sourcemap --outdir=dist",
"-preversion": "npm run test && npm run build && git add -A dist",

@@ -35,13 +35,11 @@ "preversion": "npm run build && git add -A dist",

"dependencies": {
"acorn": "^8.7.0",
"astring": "^1.8.1"
"acorn": "^8.7.1",
"astring": "^1.8.3"
},
"devDependencies": {
"chai": "^4.3.4",
"compression-webpack-plugin": "^9.2.0",
"coveralls": "^3.1.1",
"esbuild": "^0.14.42",
"mocha": "^9.0.2",
"mocha-lcov-reporter": "^1.3.0",
"webpack": "^5.69.0",
"webpack-cli": "^4.9.2"
"mocha-lcov-reporter": "^1.3.0"
},

@@ -48,0 +46,0 @@ "author": "Oxford Harrison <oxharris.dev@gmail.com>",

@@ -1,4 +0,5 @@

# Subscript Function Proposal
# Reactive Contexts Proposal
> a.k.a: Subscript Functions Proposal
This project proposes a new function primitive that lets us open a reactive programming context within JavaScript.
This project proposes a new function primitive that lets us open a *reactive programming context* within JavaScript.

@@ -42,4 +43,3 @@ ## Table of Contents

let [ valueA, setValueA ] = useState(10);
let [ valueB, setValueB ] = useState();
useEffect(() => setValueB(valueA() * 2));
let valueB = useMemo(() => valueA * 2, [ valueA ]);
```

@@ -50,4 +50,3 @@

let [ valueA, setValueA ] = createSignal(10);
let [ valueB, setValueB ] = createSignal();
createEffect(() => setValueB(valueA() * 2));
let valueB = createMemo(() => valueA() * 2);
```

@@ -86,3 +85,3 @@

*Subscript Function* is a proposed function primitive that provides this *reactive programming context* within JavaScript. It “keeps the contract" for the individual expressions and statements that go into its context!
We propose having a special function primitve *Subscript Function* provide this *reactive programming context* within JavaScript. The idea is to have this function “keep the contract" for the individual expressions and statements that go into its context!

@@ -94,2 +93,3 @@ These functions go with a notation as in below...

// much like the syntax for generator functions - function* fn() {}
// but this syntax is open for discussion ahead
```

@@ -322,10 +322,11 @@

As another special-syntax case, *spread* expressions are bound to both the *spread element* itself and its sub elements.
<details>
<summary>Heuristics and spread elements</summary>
<p>As another special-syntax case, <b>spread</b> expressions are bound to both the <i>spread element</i> itself and its sub elements.</p>
<pre><code>
let candidateCopy = { …candidate };
</code></pre>
<p>This means that the expression will re-evaluate when the <i>spread element</i> <code>candidate</code> changes, and when any of its direct properties change.</p>
</details>
```js
let candidateCopy = { …candidate };
```
This means that the expression will re-evaluate when the *spread element* `candidate` changes, and when any of its direct properties change.
#### Side Effects

@@ -695,3 +696,3 @@

+ **The syntax notation for Subscript Functions** - does the double star idea (`**`) work here? (See [#3](https://github.com/webqit/subscript/discussions/3#discussion-4084380).)
+ **The syntax for Subscript Functions** - the double star (`**`) syntax and other conventions are open for discussion. (See [#5](https://github.com/webqit/subscript/discussions/5).)
+ **Subscript Functions vs "x"** - coming to Subscript Functions from a totally different background? Wondering how patterns compare between Subscript Functions and a certain framework? (Please see [#4](https://github.com/webqit/subscript/discussions/4).)

@@ -735,3 +736,8 @@ + **Other** - (Please see (or use) the [Discussions](https://github.com/webqit/subscript/discussions) tab.)

```js
let fn = new SubscriptFunction( `a`, `b`, `return a + b;` );
var externalVar = 10;
let sum = new SubscriptFunction( `a`, `b`, `return a + b + externalVar;` );
let result = sum(10, 10); // 30
// result = sum.thread( [ 'externalVar' ] ); // 30
// result = sum.thread( [ 'b' ] ); // no effect; "a" isn't an external dependency to sum()
// result = sum.thread( [ 'a', 'b' ] ); // no effect; "a" and "b" aren't an external dependencies to sum()
```

@@ -743,11 +749,15 @@

let fn = new SubscriptFunction( `
var externalVar = 10;
function** sum( a, b ) {
return a + b;
return a + b + externalVar;
}
let result = sum( score, 100 );
// result = sum.thread();
let result = sum( 10, 10 ); // 30
// result = sum.thread( [ 'externalVar' ] ); // 30
// result = sum.thread( [ 'b' ] ); // no effect; "a" isn't an external dependency to sum()
// result = sum.thread( [ 'a', 'b' ] ); // no effect; "a" and "b" aren't an external dependencies to sum()
` );
fn();
```
+ Subscript Functions as class methods are currently only supported using a `SubscriptClass()` mixin.
+ *Subscript Functions as class methods* are currently only supported using a `SubscriptClass()` mixin.

@@ -765,3 +775,5 @@ ```js

}
```
let myInstance = new MyClass();
typeof myInstance.sum.thread === 'function'; // true
```

@@ -778,2 +790,4 @@ ```js

}
let myInstance = new MyClass();
typeof myInstance.render.thread === 'function'; // true
```

@@ -814,2 +828,18 @@

Create a custom element having at least one subscript method (using the SubscriptClass() mixin)...
```js
import { SubscriptClass } from '@webqit/subscript';
customElements.define('my-counter', class MyCounter extends SubscriptClass( HTMLElement ) {
static get subscriptMethods() {
return [ 'render' ];
}
render() {
}
});
```
Wrap your custom element markup with it...

@@ -829,4 +859,2 @@

**And, wouldn't you give a star for this 🤨 ?**
### Issues

@@ -833,0 +861,0 @@

@@ -27,2 +27,4 @@

}
} else {
console.error(`No subscript element found.`);
}

@@ -29,0 +31,0 @@ }, 0 );

@@ -9,3 +9,3 @@

while ( !rawSourceSplit[ 0 ].trim().length ) rawSourceSplit.shift();
let possibleBodyIndentLevel = rawSourceSplit[ isFunc ? 1 : 0 ].split(/[^\s]/)[0].length;
let possibleBodyIndentLevel = rawSourceSplit[ isFunc ? 1 : 0 ].split(/[^\s]/)[ 0 ].length;
if ( possibleBodyIndentLevel ) {

@@ -12,0 +12,0 @@ return rawSourceSplit.map( ( line, i ) => {

@@ -6,3 +6,10 @@

import { _parse, _generate, _serialize } from './driver.js';
import { SubscriptFunction } from '../src/index.js';
globalThis.window = {};
let r = await import('../dist/main.js');
let rrr = window.WebQit.Subscript.SubscriptFunction;
let fn = new rrr('return 10 + 1');
console.log('-------------------------------------', fn(), rrr);
let source = `

@@ -15,3 +22,9 @@ let b = a && 1;

console.log( '>> Subscript Source' );
console.log( gen.source );
/**
console.log( '' );
console.log( '>> Dependency Graph' );
console.log( JSON.stringify( gen.graph, null, 4 ) );
*/

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

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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc