Spaces:
Running
Running
import{S as kt,i as Dt,s as Ct,k as r,a as T,q as u,H as xt,l as s,m as l,h as n,c as L,r as m,n as a,I as Qe,F as e,b as Ie,J as ue,K as Pt,L as St,A as pt,M as _t,o as At,z as jt,N as Tt,O as ut,p as mt,u as Lt,P as Xe}from"../../chunks/index-a207c28c.js";const{document:Ae,window:gt}=Tt;function bt(c){let p,i,I,P,V,f;return{c(){p=r("div"),i=r("p"),I=u("Loading\u2026"),P=T(),V=r("p"),f=u("\u2588\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592")},l(H){p=s(H,"DIV",{});var C=l(p);i=s(C,"P",{});var S=l(i);I=m(S,"Loading\u2026"),S.forEach(n),P=L(C),V=s(C,"P",{});var v=l(V);f=m(v,"\u2588\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592"),v.forEach(n),C.forEach(n)},m(H,C){Ie(H,p,C),e(p,i),e(i,I),e(p,P),e(p,V),e(V,f)},d(H){H&&n(p)}}}function wt(c){let p,i,I,P,V,f,H,C,S,v,g,k,A,F,D,b,M,K,h,w,x,Z,ee,N,se,te,Y,J,le,ae,$,z;return{c(){p=r("div"),i=r("div"),I=r("p"),P=u("Strength:"),V=T(),f=r("span"),H=T(),C=r("div"),S=r("p"),v=u("Prompt:"),g=T(),k=r("span"),A=T(),F=r("div"),D=r("button"),b=u("diffuse \u{1FA84}"),K=T(),h=r("div"),w=r("label"),x=r("input"),Z=u(` | |
upload img`),ee=T(),N=r("p"),se=u("pro tip: upload img by dropping on the canvas"),te=T(),Y=r("div"),J=r("p"),le=u("Images returned: "),ae=u(c[2]),this.h()},l(R){p=s(R,"DIV",{});var E=l(p);i=s(E,"DIV",{class:!0});var ne=l(i);I=s(ne,"P",{class:!0});var ie=l(I);P=m(ie,"Strength:"),ie.forEach(n),V=L(ne),f=s(ne,"SPAN",{class:!0,role:!0,contenteditable:!0,spellcheck:!0,dir:!0,maxlength:!0}),l(f).forEach(n),ne.forEach(n),H=L(E),C=s(E,"DIV",{class:!0});var G=l(C);S=s(G,"P",{class:!0});var ce=l(S);v=m(ce,"Prompt:"),ce.forEach(n),g=L(G),k=s(G,"SPAN",{class:!0,role:!0,contenteditable:!0,style:!0,spellcheck:!0,dir:!0,maxlength:!0}),l(k).forEach(n),G.forEach(n),A=L(E),F=s(E,"DIV",{class:!0});var de=l(F);D=s(de,"BUTTON",{class:!0});var fe=l(D);b=m(fe,"diffuse \u{1FA84}"),fe.forEach(n),de.forEach(n),K=L(E),h=s(E,"DIV",{class:!0});var t=l(h);w=s(t,"LABEL",{class:!0});var o=l(w);x=s(o,"INPUT",{accept:!0,style:!0,type:!0}),Z=m(o,` | |
upload img`),o.forEach(n),ee=L(t),N=s(t,"P",{class:!0});var d=l(N);se=m(d,"pro tip: upload img by dropping on the canvas"),d.forEach(n),t.forEach(n),te=L(E),Y=s(E,"DIV",{});var _=l(Y);J=s(_,"P",{class:!0});var y=l(J);le=m(y,"Images returned: "),ae=m(y,c[2]),y.forEach(n),_.forEach(n),E.forEach(n),this.h()},h(){a(I,"class","font-bold align-middle py-2"),a(f,"class","overflow-auto resize-y py-2 px-3 min-h-[42px] max-h-[500px] !w-[181px] whitespace-pre-wrap inline-block border border-gray-200 shadow-inner outline-none svelte-1wfa7x9"),a(f,"role","textbox"),a(f,"contenteditable",""),a(f,"spellcheck","false"),a(f,"dir","auto"),a(f,"maxlength","200"),c[1]===void 0&&ut(()=>c[16].call(f)),a(i,"class","flex gap-x-2 mt-3 items-start justify-center align-vertical"),a(S,"class","font-bold align-middle py-2"),a(k,"class","overflow-auto resize-y py-2 px-3 min-h-[42px] max-h-[500px] !w-[181px] whitespace-pre-wrap inline-block border border-gray-200 shadow-inner outline-none svelte-1wfa7x9"),a(k,"role","textbox"),a(k,"contenteditable",""),mt(k,"--placeholder","'Add prompt'"),a(k,"spellcheck","false"),a(k,"dir","auto"),a(k,"maxlength","1000"),c[0]===void 0&&ut(()=>c[17].call(k)),a(C,"class","flex gap-x-2 mt-3 items-start justify-center"),a(D,"class","bg-green-700 hover:bg-green-800 text-white font-bold py-[0.555rem] px-4 rounded-xl"),a(F,"class",M="flex gap-x-2 mt-3 items-start justify-center "+(c[3]?"animate-pulse":"")),a(x,"accept","image/*"),mt(x,"display","none"),a(x,"type","file"),a(w,"class","inline border py-2 px-3 bg-slate-200 cursor-pointer"),a(N,"class","hidden desktop:inline mt-2 opacity-50"),a(h,"class","mt-4"),a(J,"class","my-4")},m(R,E){Ie(R,p,E),e(p,i),e(i,I),e(I,P),e(i,V),e(i,f),c[1]!==void 0&&(f.textContent=c[1]),e(p,H),e(p,C),e(C,S),e(S,v),e(C,g),e(C,k),c[0]!==void 0&&(k.textContent=c[0]),e(p,A),e(p,F),e(F,D),e(D,b),e(p,K),e(p,h),e(h,w),e(w,x),c[18](x),e(w,Z),e(h,ee),e(h,N),e(N,se),e(p,te),e(p,Y),e(Y,J),e(J,le),e(J,ae),$||(z=[ue(f,"input",c[16]),ue(f,"keydown",c[13]),ue(k,"input",c[17]),ue(k,"keydown",c[13]),ue(D,"click",c[9]),ue(x,"change",c[10])],$=!0)},p(R,E){E[0]&2&&R[1]!==f.textContent&&(f.textContent=R[1]),E[0]&1&&R[0]!==k.textContent&&(k.textContent=R[0]),E[0]&8&&M!==(M="flex gap-x-2 mt-3 items-start justify-center "+(R[3]?"animate-pulse":""))&&a(F,"class",M),E[0]&4&&Lt(ae,R[2])},d(R){R&&n(p),c[18](null),$=!1,_t(z)}}}function Bt(c){let p,i,I,P,V,f,H,C,S,v,g,k,A,F,D,b,M,K,h,w,x,Z,ee,N,se,te,Y,J,le,ae,$,z,R,E,ne,ie,G,ce,de,fe,t,o,d,_,y,B,W,me,Q,_e,oe,je,ke,De,Be,Me,he,Ne,ge,Re,Ve,be,qe,He,Ce,Fe,Ue,pe,Oe,we,ze,Ge,ve,We,Te,Ke,$e,U=!c[4]&&bt(),q=c[4]&&wt(c);return{c(){p=r("link"),i=r("script"),P=r("script"),f=r("script"),C=T(),S=r("div"),v=r("canvas"),k=T(),A=r("div"),U&&U.c(),F=T(),D=r("div"),b=T(),q&&q.c(),K=T(),h=r("article"),w=r("div"),x=u(`This is a fork of Huggingface's [diffuse-the-rest](https://huggingface.co/spaces/huggingface-projects/diffuse-the-rest), with the additional ability to change the strength, and other just miscellaneous tweaks. | |
`),Z=r("p"),ee=u("Github repo: "),N=r("a"),se=u("dbirks/diffuse-the-rest"),te=T(),Y=r("p"),J=u("Hi Rachel \u{1F44B}\u{1F642}"),le=T(),ae=r("hr"),$=T(),z=r("p"),R=u("Stable Diffusion model by "),E=r("a"),ne=u("CompVis"),ie=u(" and "),G=r("a"),ce=u("Stability AI"),de=u(" - Demo by \u{1F917} Hugging Face"),fe=T(),t=r("p"),o=u("Powered by "),d=r("a"),_=u("\u{1F917} Diffusers: State-of-the-art diffusion models for image and audio generation in PyTorch"),y=u(". Based on "),B=r("a"),W=u("notebook by @psuraj28"),me=T(),Q=r("p"),_e=u("Check out "),oe=r("a"),je=u("Stable Diffusion Gradio demo"),ke=T(),De=r("h3"),Be=u("LICENSE"),Me=T(),he=r("p"),Ne=u("The model is licensed with a "),ge=r("a"),Re=u("CreativeML Open RAIL-M"),Ve=u(" license. The authors claim no rights on the outputs you generate, you are free to use them and are accountable for their use which must not go against the provisions set in this license. The license forbids you from sharing any content that violates any laws, produce any harm to a person, disseminate any personal information that would be meant for harm, spread misinformation and target vulnerable groups. For the full list of restrictions please "),be=r("a"),qe=u("read the license"),He=T(),Ce=r("h3"),Fe=u("Biases and content acknowledgment"),Ue=T(),pe=r("p"),Oe=u("Despite how impressive being able to turn text into image is, beware to the fact that this model may output content that reinforces or exacerbates societal biases, as well as realistic faces, pornography and violence. The model was trained on the "),we=r("a"),ze=u("LAION-5B dataset"),Ge=u(", which scraped non-curated image-text-pairs from the internet (the exception being the removal of illegal content) and is meant for research purposes. You can read more in the "),ve=r("a"),We=u("model card"),this.h()},l(j){const O=xt('[data-svelte="svelte-bw39ln"]',Ae.head);p=s(O,"LINK",{href:!0,rel:!0}),i=s(O,"SCRIPT",{src:!0});var yt=l(i);yt.forEach(n),P=s(O,"SCRIPT",{src:!0});var Et=l(P);Et.forEach(n),f=s(O,"SCRIPT",{src:!0});var It=l(f);It.forEach(n),O.forEach(n),C=L(j),S=s(j,"DIV",{class:!0});var Le=l(S);v=s(Le,"CANVAS",{class:!0}),l(v).forEach(n),k=L(Le),A=s(Le,"DIV",{class:!0});var ye=l(A);U&&U.l(ye),F=L(ye),D=s(ye,"DIV",{id:!0}),l(D).forEach(n),b=L(ye),q&&q.l(ye),ye.forEach(n),Le.forEach(n),K=L(j),h=s(j,"ARTICLE",{class:!0});var re=l(h);w=s(re,"DIV",{class:!0});var X=l(w);x=m(X,`This is a fork of Huggingface's [diffuse-the-rest](https://huggingface.co/spaces/huggingface-projects/diffuse-the-rest), with the additional ability to change the strength, and other just miscellaneous tweaks. | |
`),Z=s(X,"P",{});var Ye=l(Z);ee=m(Ye,"Github repo: "),N=s(Ye,"A",{href:!0,rel:!0});var et=l(N);se=m(et,"dbirks/diffuse-the-rest"),et.forEach(n),Ye.forEach(n),te=L(X),Y=s(X,"P",{});var tt=l(Y);J=m(tt,"Hi Rachel \u{1F44B}\u{1F642}"),tt.forEach(n),le=L(X),ae=s(X,"HR",{}),$=L(X),z=s(X,"P",{});var Ee=l(z);R=m(Ee,"Stable Diffusion model by "),E=s(Ee,"A",{href:!0,rel:!0});var at=l(E);ne=m(at,"CompVis"),at.forEach(n),ie=m(Ee," and "),G=s(Ee,"A",{href:!0,rel:!0});var nt=l(G);ce=m(nt,"Stability AI"),nt.forEach(n),de=m(Ee," - Demo by \u{1F917} Hugging Face"),Ee.forEach(n),fe=L(X),t=s(X,"P",{});var xe=l(t);o=m(xe,"Powered by "),d=s(xe,"A",{href:!0,rel:!0});var ot=l(d);_=m(ot,"\u{1F917} Diffusers: State-of-the-art diffusion models for image and audio generation in PyTorch"),ot.forEach(n),y=m(xe,". Based on "),B=s(xe,"A",{href:!0,rel:!0});var rt=l(B);W=m(rt,"notebook by @psuraj28"),rt.forEach(n),xe.forEach(n),me=L(X),Q=s(X,"P",{});var Je=l(Q);_e=m(Je,"Check out "),oe=s(Je,"A",{href:!0,rel:!0});var st=l(oe);je=m(st,"Stable Diffusion Gradio demo"),st.forEach(n),Je.forEach(n),X.forEach(n),ke=L(re),De=s(re,"H3",{});var lt=l(De);Be=m(lt,"LICENSE"),lt.forEach(n),Me=L(re),he=s(re,"P",{});var Pe=l(he);Ne=m(Pe,"The model is licensed with a "),ge=s(Pe,"A",{href:!0,rel:!0});var it=l(ge);Re=m(it,"CreativeML Open RAIL-M"),it.forEach(n),Ve=m(Pe," license. The authors claim no rights on the outputs you generate, you are free to use them and are accountable for their use which must not go against the provisions set in this license. The license forbids you from sharing any content that violates any laws, produce any harm to a person, disseminate any personal information that would be meant for harm, spread misinformation and target vulnerable groups. For the full list of restrictions please "),be=s(Pe,"A",{href:!0,rel:!0});var ct=l(be);qe=m(ct,"read the license"),ct.forEach(n),Pe.forEach(n),He=L(re),Ce=s(re,"H3",{});var dt=l(Ce);Fe=m(dt,"Biases and content acknowledgment"),dt.forEach(n),Ue=L(re),pe=s(re,"P",{});var Se=l(pe);Oe=m(Se,"Despite how impressive being able to turn text into image is, beware to the fact that this model may output content that reinforces or exacerbates societal biases, as well as realistic faces, pornography and violence. The model was trained on the "),we=s(Se,"A",{href:!0,rel:!0});var ft=l(we);ze=m(ft,"LAION-5B dataset"),ft.forEach(n),Ge=m(Se,", which scraped non-curated image-text-pairs from the internet (the exception being the removal of illegal content) and is meant for research purposes. You can read more in the "),ve=s(Se,"A",{href:!0,rel:!0});var ht=l(ve);We=m(ht,"model card"),ht.forEach(n),Se.forEach(n),re.forEach(n),this.h()},h(){a(p,"href","https://cdnjs.cloudflare.com/ajax/libs/drawingboard.js/0.4.2/drawingboard.css"),a(p,"rel","stylesheet"),Qe(i.src,I="https://code.jquery.com/jquery-1.12.4.min.js")||a(i,"src",I),Qe(P.src,V="https://cdnjs.cloudflare.com/ajax/libs/drawingboard.js/0.4.2/drawingboard.min.js")||a(P,"src",V),Qe(f.src,H="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.1/iframeResizer.contentWindow.min.js")||a(f,"src",H),a(v,"class",g="border-[1.2px] desktop:mt-[34px] "+(c[8]?"":"hidden")),a(D,"id","board-container"),a(A,"class",M="flex flex-col items-center "+(c[3]?"pointer-events-none":"")),a(S,"class","flex flex-wrap gap-x-4 gap-y-2 justify-center my-8"),a(N,"href","https://github.com/dbirks/diffuse-the-rest"),a(N,"rel","nofollow"),a(E,"href","https://huggingface.co/CompVis"),a(E,"rel","nofollow"),a(G,"href","https://huggingface.co/stabilityai"),a(G,"rel","nofollow"),a(d,"href","https://github.com/huggingface/diffusers"),a(d,"rel","nofollow"),a(B,"href","https://twitter.com/psuraj28/status/1562039265126670339"),a(B,"rel","nofollow"),a(oe,"href","https://huggingface.co/spaces/stabilityai/stable-diffusion"),a(oe,"rel","nofollow"),a(w,"class","text-center"),a(ge,"href","https://huggingface.co/spaces/CompVis/stable-diffusion-license"),a(ge,"rel","nofollow"),a(be,"href","https://huggingface.co/spaces/CompVis/stable-diffusion-license"),a(be,"rel","nofollow"),a(we,"href","https://laion.ai/blog/laion-5b/"),a(we,"rel","nofollow"),a(ve,"href","https://huggingface.co/CompVis/stable-diffusion-v1-4"),a(ve,"rel","nofollow"),a(h,"class",Te="prose-sm px-4 md:px-12 lg:px-56 mb-8 "+(c[4]?"":"hidden"))},m(j,O){e(Ae.head,p),e(Ae.head,i),e(Ae.head,P),e(Ae.head,f),Ie(j,C,O),Ie(j,S,O),e(S,v),c[14](v),e(S,k),e(S,A),U&&U.m(A,null),e(A,F),e(A,D),c[15](D),e(A,b),q&&q.m(A,null),Ie(j,K,O),Ie(j,h,O),e(h,w),e(w,x),e(w,Z),e(Z,ee),e(Z,N),e(N,se),e(w,te),e(w,Y),e(Y,J),e(w,le),e(w,ae),e(w,$),e(w,z),e(z,R),e(z,E),e(E,ne),e(z,ie),e(z,G),e(G,ce),e(z,de),e(w,fe),e(w,t),e(t,o),e(t,d),e(d,_),e(t,y),e(t,B),e(B,W),e(w,me),e(w,Q),e(Q,_e),e(Q,oe),e(oe,je),e(h,ke),e(h,De),e(De,Be),e(h,Me),e(h,he),e(he,Ne),e(he,ge),e(ge,Re),e(he,Ve),e(he,be),e(be,qe),e(h,He),e(h,Ce),e(Ce,Fe),e(h,Ue),e(h,pe),e(pe,Oe),e(pe,we),e(we,ze),e(pe,Ge),e(pe,ve),e(ve,We),Ke||($e=[ue(gt,"drop",Pt(St(c[11]))),ue(gt,"paste",c[12])],Ke=!0)},p(j,O){O[0]&256&&g!==(g="border-[1.2px] desktop:mt-[34px] "+(j[8]?"":"hidden"))&&a(v,"class",g),j[4]?U&&(U.d(1),U=null):U||(U=bt(),U.c(),U.m(A,F)),j[4]?q?q.p(j,O):(q=wt(j),q.c(),q.m(A,null)):q&&(q.d(1),q=null),O[0]&8&&M!==(M="flex flex-col items-center "+(j[3]?"pointer-events-none":""))&&a(A,"class",M),O[0]&16&&Te!==(Te="prose-sm px-4 md:px-12 lg:px-56 mb-8 "+(j[4]?"":"hidden"))&&a(h,"class",Te)},i:pt,o:pt,d(j){n(p),n(i),n(P),n(f),j&&n(C),j&&n(S),c[14](null),U&&U.d(),c[15](null),q&&q.d(),j&&n(K),j&&n(h),Ke=!1,_t($e)}}}const Ze=500,vt=3e3;function Mt(){window.createImageBitmap=async function(c){return new Promise((p,i)=>{const I=document.createElement("canvas"),P=I.getContext("2d");I.width=c.width,I.height=c.height,P.putImageData(c,0,0);const V=I.toDataURL(),f=document.createElement("img");f.addEventListener("load",()=>{p(f)}),f.src=V})}}function Nt(){const c=document.querySelectorAll("a");for(const p of c)p.target="_blank"}function Rt(c,p,i){let I="",P="0.85",V="0",f=!1,H=!1,C=!1,S,v,g,k,A,F,D,b=400,M,K,h,w=!1,x=[],Z;async function ee(){if(!g)return;const t=g.createImageData(v.width,v.height),o=t.data;for(let y=0,B=o.length;y<B;y+=4)o[y]=40*Math.random()*7,o[y+1]=40*Math.random()*7,o[y+2]=40*Math.random()*7,o[y+3]=10;const d=await createImageBitmap(t),_=performance.now()-k;g.globalAlpha=Math.min(_,vt)/vt,g.drawImage(d,0,0,b,b),f&&window.requestAnimationFrame(ee)}function N(t){if(!g)return;const o=performance.now()-A;g.globalAlpha=Math.min(o,Ze)/Ze,g.drawImage(t,0,0,b,b),o<Ze&&window.requestAnimationFrame(()=>N(t))}async function se(t){const o=t.toDataURL("png"),_=await(await fetch(o)).blob(),y=new File([_],"canvas shot.png",{type:"image/png"}),B=t.getContext("2d").getImageData(0,0,b,b),W=await createImageBitmap(B);return{imgFile:y,imgBitmap:W}}async function te(){if(!I)return alert("Please add prompt");if(!v||!g)return;D&&clearInterval(D),i(3,f=!0),i(8,w=!1),C=!1,ae(),k=performance.now(),ee();const{imgFile:t,imgBitmap:o}=await se(v),d=new FormData;d.append("prompt",I),d.append("strength",P),d.append("image",t);try{const _=await fetch("https://sdb.pcuenca.net/i2i",{method:"POST",body:d}),y=JSON.parse(await _.text()),{images:B}=y;if(i(2,V=B.length.toString()),!B.length)return alert("All the results were flagged. Please try again with diffeerent sketch + prompt");x=await Promise.all(B.map(async me=>{const Q=new Image;return Q.src=`data:image/png;base64, ${me}`,await new Promise((_e,oe)=>{Q.onload=()=>_e(Q)}),Q})),x.push(o),Z={sketch:t,generations:await Promise.all(B.map(async me=>{const Q=`data:image/jpeg;base64, ${me}`,oe=await(await fetch(Q)).blob(),ke=`diffuse-the-rest-${Date.now()%200}.jpeg`;return new File([oe],ke,{type:"image/jpeg"})}))},i(8,w=!0);let W=0;A=performance.now(),N(x[W%x.length]),F=()=>{D&&clearInterval(D),A=performance.now(),W=W+1,N(x[W%x.length])},D=setInterval(()=>{W=W+1,A=performance.now(),N(x[W%x.length])},2500),H||Y(),C=!0}catch(_){console.error(_),alert("Error happened, queue might be full. Please try again in a bit :)")}finally{i(3,f=!1)}}function Y(){const t=document.createElement("div");t.className="drawing-board-control";const o=document.createElement("button");o.innerHTML="\u23EF",o.onclick=F,t.append(o);const d=document.querySelector(".drawing-board-controls");d&&x.length>1&&(d.appendChild(t),H=!0,i(5,M.onclick=()=>{D&&clearInterval(D)},M))}function J(){const t=document.createElement("div");t.className="drawing-board-control";const o=document.createElement("button");o.innerHTML="\u{1F9F9}",o.onclick=()=>{g==null||g.clearRect(0,0,b,b),x=[],i(8,w=!1)},t.append(o);const d=document.querySelector(".drawing-board-controls");d&&d.appendChild(t)}function le(){const t=document.createElement("div");t.className="drawing-board-control";const o=document.createElement("button");o.innerHTML="\u2B07\uFE0F",o.onclick=()=>{if(!v)return;const _=document.createElement("a"),y=Date.now()%200;_.download=`diffuse-the-rest-${y}.png`,_.href=v.toDataURL(),_.click()},t.append(o);const d=document.querySelector(".drawing-board-controls");d&&d.appendChild(t)}function ae(){const t=h.getContext("2d");i(7,h.width=v.width,h),i(7,h.height=v.height,h),t.drawImage(v,0,0)}async function $(t){D&&clearInterval(D);const o=new Image;o.src=URL.createObjectURL(t),await new Promise((y,B)=>{o.onload=()=>y(o)});const{width:d,height:_}=o;if(d==_)g==null||g.drawImage(o,0,0,d,_,0,0,b,b);else if(d>_){const y=Math.floor(b*_/d),B=Math.floor((b-y)/2);g==null||g.drawImage(o,0,0,d,_,0,B,b,y)}else{const y=Math.floor(b*d/_),B=Math.floor((b-y)/2);g==null||g.drawImage(o,0,0,d,_,B,0,y,b)}}function z(){var o;const t=(o=K.files)==null?void 0:o[0];t&&$(t)}function R(t){var _;if(!((_=t.dataTransfer)!=null&&_.files))return;t.preventDefault();const d=Array.from(t.dataTransfer.files)[0];$(d)}function E(t){if(!t.clipboardData)return;const o=Array.from(t.clipboardData.files);if(o.length===0)return;t.preventDefault();const d=o[0];$(d)}function ne(t){if(f)return t.preventDefault();t.code==="Enter"&&(t.preventDefault(),te())}At(async()=>{typeof createImageBitmap>"u"&&Mt();const{innerWidth:t}=window;b=Math.min(b,Math.floor(t*.75)),i(5,M.style.width=`${b}px`,M),i(5,M.style.height=`${b}px`,M),i(7,h.style.width=`${b}px`,h),i(7,h.style.height=`${b}px`,h),await jt(),S=new window.DrawingBoard.Board("board-container",{size:10,controls:["Color",{Size:{type:"dropdown"}},{DrawingMode:{filler:!1}}],webStorage:!1,enlargeYourContainer:!0}),i(4,v=S.canvas),g=v.getContext("2d"),i(4,v.ondragover=function(o){return o.preventDefault(),!1},v),J(),le(),Nt()});function ie(t){Xe[t?"unshift":"push"](()=>{h=t,i(7,h)})}function G(t){Xe[t?"unshift":"push"](()=>{M=t,i(5,M)})}function ce(){P=this.textContent,i(1,P)}function de(){I=this.textContent,i(0,I)}function fe(t){Xe[t?"unshift":"push"](()=>{K=t,i(6,K)})}return[I,P,V,f,v,M,K,h,w,te,z,R,E,ne,ie,G,ce,de,fe]}class qt extends kt{constructor(p){super(),Dt(this,p,Rt,Bt,Ct,{},null,[-1,-1])}}export{qt as default}; | |