var G=Object.create;var $=Object.defineProperty;var Z=Object.getOwnPropertyDescriptor;var X=Object.getOwnPropertyNames;var Y=Object.getPrototypeOf,tt=Object.prototype.hasOwnProperty;var et=(t,i)=>()=>(i||t((i={exports:{}}).exports,i),i.exports);var ot=(t,i,m,f)=>{if(i&&typeof i=="object"||typeof i=="function")for(let b of X(i))!tt.call(t,b)&&b!==m&&$(t,b,{get:()=>i[b],enumerable:!(f=Z(i,b))||f.enumerable});return t};var st=(t,i,m)=>(m=t!=null?G(Y(t)):{},ot(i||!t||!t.__esModule?$(m,"default",{value:t,enumerable:!0}):m,t));var P=et((ht,k)=>{var rt=function(){var t=String.fromCharCode,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",f={};function b(e,n){if(!f[e]){f[e]={};for(var c=0;c>>8,c[r*2+1]=u%256}return c},decompressFromUint8Array:function(e){if(e==null)return g.decompress(e);for(var n=new Array(e.length/2),c=0,r=n.length;c>1}else{for(a=1,r=0;r>1}y--,y==0&&(y=Math.pow(2,p),p++),delete v[h]}else for(a=u[h],r=0;r>1;y--,y==0&&(y=Math.pow(2,p),p++),u[U]=j++,h=String(w)}if(h!==""){if(Object.prototype.hasOwnProperty.call(v,h)){if(h.charCodeAt(0)<256){for(r=0;r>1}else{for(a=1,r=0;r>1}y--,y==0&&(y=Math.pow(2,p),p++),delete v[h]}else for(a=u[h],r=0;r>1;y--,y==0&&(y=Math.pow(2,p),p++)}for(a=2,r=0;r>1;for(;;)if(o=o<<1,s==n-1){d.push(c(o));break}else s++;return d.join("")},decompress:function(e){return e==null?"":e==""?null:g._decompress(e.length,32768,function(n){return e.charCodeAt(n)})},_decompress:function(e,n,c){var r=[],a,u=4,v=4,w=3,U="",h=[],y,j,p,d,o,s,x,l={val:c(0),position:n,index:1};for(y=0;y<3;y+=1)r[y]=y;for(p=0,o=Math.pow(2,2),s=1;s!=o;)d=l.val&l.position,l.position>>=1,l.position==0&&(l.position=n,l.val=c(l.index++)),p|=(d>0?1:0)*s,s<<=1;switch(a=p){case 0:for(p=0,o=Math.pow(2,8),s=1;s!=o;)d=l.val&l.position,l.position>>=1,l.position==0&&(l.position=n,l.val=c(l.index++)),p|=(d>0?1:0)*s,s<<=1;x=t(p);break;case 1:for(p=0,o=Math.pow(2,16),s=1;s!=o;)d=l.val&l.position,l.position>>=1,l.position==0&&(l.position=n,l.val=c(l.index++)),p|=(d>0?1:0)*s,s<<=1;x=t(p);break;case 2:return""}for(r[3]=x,j=x,h.push(x);;){if(l.index>e)return"";for(p=0,o=Math.pow(2,w),s=1;s!=o;)d=l.val&l.position,l.position>>=1,l.position==0&&(l.position=n,l.val=c(l.index++)),p|=(d>0?1:0)*s,s<<=1;switch(x=p){case 0:for(p=0,o=Math.pow(2,8),s=1;s!=o;)d=l.val&l.position,l.position>>=1,l.position==0&&(l.position=n,l.val=c(l.index++)),p|=(d>0?1:0)*s,s<<=1;r[v++]=t(p),x=v-1,u--;break;case 1:for(p=0,o=Math.pow(2,16),s=1;s!=o;)d=l.val&l.position,l.position>>=1,l.position==0&&(l.position=n,l.val=c(l.index++)),p|=(d>0?1:0)*s,s<<=1;r[v++]=t(p),x=v-1,u--;break;case 2:return h.join("")}if(u==0&&(u=Math.pow(2,w),w++),r[x])U=r[x];else if(x===v)U=j+j.charAt(0);else return null;h.push(U),r[v++]=j+U.charAt(0),u--,j=U,u==0&&(u=Math.pow(2,w),w++)}}};return g}();typeof k<"u"&&k!=null&&(k.exports=rt)});var T=(t=location.origin)=>!!(t&&(t.endsWith("livecodes.io")||t.endsWith("livecodes.pages.dev")||t.endsWith("localpen.pages.dev")||t.startsWith("http://127.0.0.1")||t.startsWith("http://localhost")));var A=st(P());var W=["esm.sh","skypack","esm.run","jsdelivr.esm","fastly.jsdelivr.esm","gcore.jsdelivr.esm","testingcf.jsdelivr.esm","jsdelivr.b-cdn.esm","jspm"],O=["jsdelivr","fastly.jsdelivr","unpkg","gcore.jsdelivr","testingcf.jsdelivr","jsdelivr.b-cdn","npmcdn"],D=["jsdelivr.gh","fastly.jsdelivr.gh","statically","gcore.jsdelivr.gh","testingcf.jsdelivr.gh","jsdelivr.b-cdn.gh"],S={getModuleUrl:(t,{isModule:i=!0,defaultCDN:m="esm.sh",external:f}={})=>{t=t.replace(/#nobundle/g,"");let b=e=>!f||!e.includes("https://esm.sh")?e:e.includes("?")?`${e}&external=${f}`:`${e}?external=${f}`,g=B(t,i,m);return g?b(g):i?b("https://esm.sh/"+t):"https://cdn.jsdelivr.net/npm/"+t},getUrl:(t,i)=>t.startsWith("http")||t.startsWith("data:")?t:B(t,!1,i||nt())||t,cdnLists:{npm:O,module:W,gh:D},checkCDNs:async(t,i)=>{let m=[i,...S.cdnLists.npm].filter(Boolean);for(let f of m)try{if((await fetch(S.getUrl(t,f),{method:"HEAD"})).ok)return f}catch{}return S.cdnLists.npm[0]}},nt=()=>{if(globalThis.appCDN)return globalThis.appCDN;try{return new URL(location.href).searchParams.get("appCDN")||S.cdnLists.npm[0]}catch{return S.cdnLists.npm[0]}},B=(t,i,m)=>{let f=i&&t.startsWith("unpkg:")?"?module":"";t.startsWith("gh:")?t=t.replace("gh",D[0]):t.includes(":")||(t=(m||(i?W[0]:O[0]))+":"+t);for(let b of it){let[g,e]=b;if(g.test(t))return t.replace(g,e)+f}return null},it=[[/^(esm\.sh:)(.+)/i,"https://esm.sh/$2"],[/^(npm:)(.+)/i,"https://esm.sh/$2"],[/^(node:)(.+)/i,"https://esm.sh/$2"],[/^(jsr:)(.+)/i,"https://esm.sh/jsr/$2"],[/^(skypack:)(.+)/i,"https://cdn.skypack.dev/$2"],[/^(jsdelivr:)(.+)/i,"https://cdn.jsdelivr.net/npm/$2"],[/^(fastly\.jsdelivr:)(.+)/i,"https://fastly.jsdelivr.net/npm/$2"],[/^(gcore\.jsdelivr:)(.+)/i,"https://gcore.jsdelivr.net/npm/$2"],[/^(testingcf\.jsdelivr:)(.+)/i,"https://testingcf.jsdelivr.net/npm/$2"],[/^(jsdelivr\.b-cdn:)(.+)/i,"https://jsdelivr.b-cdn.net/npm/$2"],[/^(jsdelivr\.gh:)(.+)/i,"https://cdn.jsdelivr.net/gh/$2"],[/^(fastly\.jsdelivr\.gh:)(.+)/i,"https://fastly.jsdelivr.net/gh/$2"],[/^(gcore\.jsdelivr\.gh:)(.+)/i,"https://gcore.jsdelivr.net/gh/$2"],[/^(testingcf\.jsdelivr\.gh:)(.+)/i,"https://testingcf.jsdelivr.net/gh/$2"],[/^(jsdelivr\.b-cdn\.gh:)(.+)/i,"https://jsdelivr.b-cdn.net/gh/$2"],[/^(statically:)(.+)/i,"https://cdn.statically.io/gh/$2"],[/^(esm\.run:)(.+)/i,"https://esm.run/$2"],[/^(jsdelivr\.esm:)(.+)/i,"https://cdn.jsdelivr.net/npm/$2/+esm"],[/^(fastly\.jsdelivr\.esm:)(.+)/i,"https://fastly.jsdelivr.net/npm/$2/+esm"],[/^(gcore\.jsdelivr\.esm:)(.+)/i,"https://gcore.jsdelivr.net/npm/$2/+esm"],[/^(testingcf\.jsdelivr\.esm:)(.+)/i,"https://testingcf.jsdelivr.net/npm/$2/+esm"],[/^(jsdelivr\.b-cdn\.esm:)(.+)/i,"https://jsdelivr.b-cdn.net/npm/$2/+esm"],[/^(jspm:)(.+)/i,"https://jspm.dev/$2"],[/^(esbuild:)(.+)/i,"https://esbuild.vercel.app/$2"],[/^(bundle\.run:)(.+)/i,"https://bundle.run/$2"],[/^(unpkg:)(.+)/i,"https://unpkg.com/$2"],[/^(npmcdn:)(.+)/i,"https://npmcdn.com/$2"],[/^(bundlejs:)(.+)/i,"https://deno.bundlejs.com/?file&q=$2"],[/^(bundle:)(.+)/i,"https://deno.bundlejs.com/?file&q=$2"],[/^(deno:)(.+)/i,"https://deno.bundlejs.com/?file&q=https://deno.land/x/$2/mod.ts"],[/^(https:\/\/deno\.land\/.+)/i,"https://deno.bundlejs.com/?file&q=$1"],[/^(github:|https:\/\/github\.com\/)(.[^\/]+?)\/(.[^\/]+?)\/(?!releases\/)(?:(?:blob|raw)\/)?(.+?\/.+)/i,"https://deno.bundlejs.com/?file&q=https://cdn.jsdelivr.net/gh/$2/$3@$4"],[/^(gist\.github:)(.+?\/[0-9a-f]+\/raw\/(?:[0-9a-f]+\/)?.+)$/i,"https://gist.githack.com/$2"],[/^(gitlab:|https:\/\/gitlab\.com\/)([^\/]+.*\/[^\/]+)\/(?:raw|blob)\/(.+?)(?:\?.*)?$/i,"https://deno.bundlejs.com/?file&q=https://gl.githack.com/$2/raw/$3"],[/^(bitbucket:|https:\/\/bitbucket\.org\/)([^\/]+\/[^\/]+)\/(?:raw|src)\/(.+?)(?:\?.*)?$/i,"https://deno.bundlejs.com/?file&q=https://bb.githack.com/$2/raw/$3"],[/^(bitbucket:)snippets\/([^\/]+\/[^\/]+)\/revisions\/([^\/\#\?]+)(?:\?[^#]*)?(?:\#file-(.+?))$/i,"https://bb.githack.com/!api/2.0/snippets/$2/$3/files/$4"],[/^(bitbucket:)snippets\/([^\/]+\/[^\/\#\?]+)(?:\?[^#]*)?(?:\#file-(.+?))$/i,"https://bb.githack.com/!api/2.0/snippets/$2/HEAD/files/$3"],[/^(bitbucket:)\!api\/2.0\/snippets\/([^\/]+\/[^\/]+\/[^\/]+)\/files\/(.+?)(?:\?.*)?$/i,"https://bb.githack.com/!api/2.0/snippets/$2/files/$3"],[/^(api\.bitbucket:)2.0\/snippets\/([^\/]+\/[^\/]+\/[^\/]+)\/files\/(.+?)(?:\?.*)?$/i,"https://bb.githack.com/!api/2.0/snippets/$2/files/$3"],[/^(rawgit:)(.+?\/[0-9a-f]+\/raw\/(?:[0-9a-f]+\/)?.+)$/i,"https://gist.githack.com/$2"],[/^(rawgit:|https:\/\/raw\.githubusercontent\.com)(\/[^\/]+\/[^\/]+|[0-9A-Za-z-]+\/[0-9a-f]+\/raw)\/(.+)/i,"https://deno.bundlejs.com/?file&q=https://raw.githack.com/$2/$3"]];var{getUrl:q,getModuleUrl:qt}=S;var L=q("quill@2.0.2/dist/"),N=q("quill-html-edit-button@2.2.14/dist/quill.htmlEditButton.min.js"),F=q("quill-blot-formatter@1.0.5/dist/quill-blot-formatter.min.js"),M=q("quill-better-table@1.2.10/dist/");var lt="https://livecodes-sandbox.pages.dev";var I=lt,z="v8",_={getResultUrl:()=>`${I}/${z}/`,getCompilerUrl:()=>`${I}/${z}/compiler`,getOrigin:()=>new URL(I).origin};var K="https://dpaste.com/",ct="https://dpaste.com/api/v2/",Q="https://api2.livecodes.io/share",V={getProject:async t=>{try{let i=await fetch(K+t+".txt");return i.ok?JSON.parse(await i.text()):{}}catch{return{}}},shareProject:async t=>{try{let i=await fetch(ct,{method:"POST",mode:"cors",headers:{"Content-Type":"application/x-www-form-urlencoded","User-Agent":"LiveCodes / https://livecodes.io/"},body:`content=${encodeURIComponent(JSON.stringify(t))}&title=${encodeURIComponent(t.title||"")}&syntax=json&expiry_days=365`});return i.ok?(await i.text()).replace(K,""):""}catch{return""}}},pt={getProject:async t=>{if(t.length<11)return V.getProject(t);if(!T())return{};try{let i=await fetch(Q+"?id="+t);return i.ok?JSON.parse(await i.text()):{}}catch{return{}}},shareProject:async t=>{if(!T())return"";try{let i=await fetch(Q,{method:"POST",mode:"cors",body:JSON.stringify(t)});return i.ok?i.text():""}catch{return""}}},Ee=T()?pt:V;var J=`Rich Text Editor