var Tr=Object.defineProperty;var Wt=Object.getOwnPropertySymbols;var Ar=Object.prototype.hasOwnProperty,Ir=Object.prototype.propertyIsEnumerable;var qt=(n,e,t)=>e in n?Tr(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Xt=(n,e)=>{for(var t in e||(e={}))Ar.call(e,t)&&qt(n,t,e[t]);if(Wt)for(var t of Wt(e))Ir.call(e,t)&&qt(n,t,e[t]);return n};import{S as ct,i as ut,s as ft,e as v,k as M,c as w,a as y,m as F,d as f,b as u,g as ce,J as i,K as Be,L as Te,E as qe,M as Pt,t as J,h as Z,N as st,O as at,P as jr,w as Xe,x as ht,y as Ge,n as Je,o as _e,B as Ze,p as Ke,q as he,Q as St,R as Ve,T as ze,l as lt,j as Qe,U as br,v as yr,V as Er,W as kt,f as We,X as Dr,Y as Gt,Z as Lr,_ as Rr}from"../chunks/index-86f4d6c3.js";import{_ as De,w as kr,b as Jt}from"../chunks/preload-helper-359634c4.js";var ye=(n=>(n.INITIAL="",n.CORRECT="correct",n.PRESENT="present",n.ABSENT="absent",n))(ye||{}),ve=(n=>(n[n.LOADING=0]="LOADING",n[n.PLAYING=1]="PLAYING",n[n.SUCESS=2]="SUCESS",n[n.FAIL=3]="FAIL",n[n.COMPLETED=4]="COMPLETED",n))(ve||{});function Cr(n,e){const t=[...n],r=t[e];for(const s of[...r].reverse())if(s.letter){s.letter="";break}return t}function Nr(n,e,t){const r=[...n],s=r[e];for(const a of s)if(a.correct===" "&&(a.letter=" "),!a.letter){a.letter=t;break}return r}const Zt={[ye.CORRECT]:"#00b81a",[ye.PRESENT]:"#ffc80a",[ye.ABSENT]:"#d9d9d9",[ye.INITIAL]:"#5d5d5d"},ot={2:"two",5:"five",10:"ten",15:"fifteen",20:"twenty",35:"thirtyfive",50:"fifty"},Or=["\u{1F917} Hugging \u{1F917}","\u{1F9DE} Genius \u{1F9DE}","\u{1F929} Magnificent \u{1F929}","\u{1F632} Impressive \u{1F632}","\u{1F9DA} Splendid \u{1F9DA}","\u2733 Great \u2733","\u{1F361} Phew \u{1F361}"];function Kt(n,e,t){const r=n.slice();return r[4]=e[t],r[6]=t,r}function Qt(n,e,t){const r=n.slice();return r[7]=e[t],r}function Ur(n){let e;return{c(){e=v("div"),this.h()},l(t){e=w(t,"DIV",{class:!0}),y(e).forEach(f),this.h()},h(){u(e,"class","spacer svelte-2ngxdh")},m(t,r){ce(t,e,r)},d(t){t&&f(e)}}}function Br(n){let e,t=n[7]+"",r;return{c(){e=v("span"),r=J(t)},l(s){e=w(s,"SPAN",{});var a=y(e);r=Z(a,t),a.forEach(f)},m(s,a){ce(s,e,a),i(e,r)},p:qe,d(s){s&&f(e)}}}function Vr(n){let e,t;return{c(){e=st("svg"),t=st("path"),this.h()},l(r){e=at(r,"svg",{xmlns:!0,height:!0,viewBox:!0,width:!0});var s=y(e);t=at(s,"path",{fill:!0,d:!0}),y(t).forEach(f),s.forEach(f),this.h()},h(){u(t,"fill","currentColor"),u(t,"d","M22 3H7c-.69 0-1.23.35-1.59.88L0 12l5.41 8.11c.36.53.9.89 1.59.89h15c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H7.07L2.4 12l4.66-7H22v14zm-11.59-2L14 13.41 17.59 17 19 15.59 15.41 12 19 8.41 17.59 7 14 10.59 10.41 7 9 8.41 12.59 12 9 15.59z"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"height","24"),u(e,"viewBox","0 0 24 24"),u(e,"width","24")},m(r,s){ce(r,e,s),i(e,t)},p:qe,d(r){r&&f(e)}}}function $t(n){let e,t,r,s;function a(_,S){return _[7]==="Backspace"?Vr:Br}let o=a(n)(n);function c(){return n[3](n[7])}return{c(){e=v("button"),o.c(),this.h()},l(_){e=w(_,"BUTTON",{class:!0});var S=y(e);o.l(S),S.forEach(f),this.h()},h(){u(e,"class",t=(n[0][n[7]]===void 0?"":n[0][n[7]])+" "+(n[7].length>1&&"big")+" svelte-2ngxdh")},m(_,S){ce(_,e,S),o.m(e,null),r||(s=Be(e,"click",c),r=!0)},p(_,S){n=_,o.p(n,S),S&1&&t!==(t=(n[0][n[7]]===void 0?"":n[0][n[7]])+" "+(n[7].length>1&&"big")+" svelte-2ngxdh")&&u(e,"class",t)},d(_){_&&f(e),o.d(),r=!1,s()}}}function zr(n){let e;return{c(){e=v("div"),this.h()},l(t){e=w(t,"DIV",{class:!0}),y(e).forEach(f),this.h()},h(){u(e,"class","spacer svelte-2ngxdh")},m(t,r){ce(t,e,r)},d(t){t&&f(e)}}}function er(n){let e,t,r,s,a=n[6]===1&&Ur(),l=n[4],o=[];for(let _=0;_s("keyup",o);return n.$$set=o=>{"letterStates"in o&&t(0,r=o.letterStates)},[r,s,a,l]}class Hr extends ct{constructor(e){super(),ut(this,e,Fr,Mr,ft,{letterStates:0})}}function Yr(n){const e=n-1;return e*e*e+1}function it(n,{delay:e=0,duration:t=400,easing:r=jr}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:r,css:a=>`opacity: ${a*s}`}}function tr(n,{delay:e=0,duration:t=400,easing:r=Yr,start:s=0,opacity:a=0}={}){const l=getComputedStyle(n),o=+l.opacity,c=l.transform==="none"?"":l.transform,_=1-s,S=o*(1-a);return{delay:e,duration:t,easing:r,css:(j,Y)=>` transform: ${c} scale(${1-_*Y}); opacity: ${o-S*Y} `}}var xr={exports:{}};(function(n){(function(e){var t=K(),r=ue(),s=D(),a=$(),l={imagePlaceholder:void 0,cacheBust:!1},o={toSvg:c,toPng:S,toJpeg:j,toBlob:Y,toPixelData:_,impl:{fontFaces:s,images:a,util:t,inliner:r,options:{}}};n.exports=o;function c(h,p){return p=p||{},H(p),Promise.resolve(h).then(function(E){return z(E,p.filter,!0)}).then(q).then(oe).then(T).then(function(E){return Q(E,p.width||t.width(h),p.height||t.height(h))});function T(E){return p.bgcolor&&(E.style.backgroundColor=p.bgcolor),p.width&&(E.style.width=p.width+"px"),p.height&&(E.style.height=p.height+"px"),p.style&&Object.keys(p.style).forEach(function(P){E.style[P]=p.style[P]}),E}}function _(h,p){return U(h,p||{}).then(function(T){return T.getContext("2d").getImageData(0,0,t.width(h),t.height(h)).data})}function S(h,p){return U(h,p||{}).then(function(T){return T.toDataURL()})}function j(h,p){return p=p||{},U(h,p).then(function(T){return T.toDataURL("image/jpeg",p.quality||1)})}function Y(h,p){return U(h,p||{}).then(t.canvasToBlob)}function H(h){typeof h.imagePlaceholder=="undefined"?o.impl.options.imagePlaceholder=l.imagePlaceholder:o.impl.options.imagePlaceholder=h.imagePlaceholder,typeof h.cacheBust=="undefined"?o.impl.options.cacheBust=l.cacheBust:o.impl.options.cacheBust=h.cacheBust}function U(h,p){return c(h,p).then(t.makeImage).then(t.delay(100)).then(function(E){var P=T(h);return P.getContext("2d").drawImage(E,0,0),P});function T(E){var P=document.createElement("canvas");if(P.width=p.width||t.width(E),P.height=p.height||t.height(E),p.bgcolor){var A=P.getContext("2d");A.fillStyle=p.bgcolor,A.fillRect(0,0,P.width,P.height)}return P}}function z(h,p,T){if(!T&&p&&!p(h))return Promise.resolve();return Promise.resolve(h).then(E).then(function(k){return P(h,k,p)}).then(function(k){return A(h,k)});function E(k){return k instanceof HTMLCanvasElement?t.makeImage(k.toDataURL()):k.cloneNode(!1)}function P(k,L,ee){var d=k.childNodes;if(d.length===0)return Promise.resolve(L);return C(L,t.asArray(d),ee).then(function(){return L});function C(I,B,b){var g=Promise.resolve();return B.forEach(function(V){g=g.then(function(){return z(V,b)}).then(function(x){x&&I.appendChild(x)})}),g}}function A(k,L){if(!(L instanceof Element))return L;return Promise.resolve().then(ee).then(d).then(C).then(I).then(function(){return L});function ee(){B(window.getComputedStyle(k),L.style);function B(b,g){b.cssText?g.cssText=b.cssText:V(b,g);function V(x,te){t.asArray(x).forEach(function(m){te.setProperty(m,x.getPropertyValue(m),x.getPropertyPriority(m))})}}}function d(){[":before",":after"].forEach(function(b){B(b)});function B(b){var g=window.getComputedStyle(k,b),V=g.getPropertyValue("content");if(V===""||V==="none")return;var x=t.uid();L.className=L.className+" "+x;var te=document.createElement("style");te.appendChild(m(x,b,g)),L.appendChild(te);function m(N,W,O){var ne="."+N+":"+W,ie=O.cssText?we(O):be(O);return document.createTextNode(ne+"{"+ie+"}");function we(de){var re=de.getPropertyValue("content");return de.cssText+" content: "+re+";"}function be(de){return t.asArray(de).map(re).join("; ")+";";function re(fe){return fe+": "+de.getPropertyValue(fe)+(de.getPropertyPriority(fe)?" !important":"")}}}}}function C(){k instanceof HTMLTextAreaElement&&(L.innerHTML=k.value),k instanceof HTMLInputElement&&L.setAttribute("value",k.value)}function I(){L instanceof SVGElement&&(L.setAttribute("xmlns","http://www.w3.org/2000/svg"),L instanceof SVGRectElement&&["width","height"].forEach(function(B){var b=L.getAttribute(B);!b||L.style.setProperty(B,b)}))}}}function q(h){return s.resolveAll().then(function(p){var T=document.createElement("style");return h.appendChild(T),T.appendChild(document.createTextNode(p)),h})}function oe(h){return a.inlineAll(h).then(function(){return h})}function Q(h,p,T){return Promise.resolve(h).then(function(E){return E.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),new XMLSerializer().serializeToString(E)}).then(t.escapeXhtml).then(function(E){return''+E+""}).then(function(E){return''+E+""}).then(function(E){return"data:image/svg+xml;charset=utf-8,"+E})}function K(){return{escape:I,parseExtension:p,mimeType:T,dataAsUrl:C,isDataUrl:E,canvasToBlob:A,resolveUrl:k,getAndEncode:d,uid:L(),delay:B,asArray:b,escapeXhtml:g,makeImage:ee,width:V,height:x};function h(){var m="application/font-woff",N="image/jpeg";return{woff:m,woff2:m,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:N,jpeg:N,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"}}function p(m){var N=/\.([^\.\/]*?)$/g.exec(m);return N?N[1]:""}function T(m){var N=p(m).toLowerCase();return h()[N]||""}function E(m){return m.search(/^(data:)/)!==-1}function P(m){return new Promise(function(N){for(var W=window.atob(m.toDataURL().split(",")[1]),O=W.length,ne=new Uint8Array(O),ie=0;ieimport("../chunks/fifteen-9add13bd.js"),["chunks/fifteen-9add13bd.js","chunks/index-86f4d6c3.js"]);case"./badges/fifty.svelte":return De(()=>import("../chunks/fifty-f65036e1.js"),["chunks/fifty-f65036e1.js","chunks/index-86f4d6c3.js"]);case"./badges/five.svelte":return De(()=>import("../chunks/five-ba00de65.js"),["chunks/five-ba00de65.js","chunks/index-86f4d6c3.js"]);case"./badges/ten.svelte":return De(()=>import("../chunks/ten-042882a1.js"),["chunks/ten-042882a1.js","chunks/index-86f4d6c3.js"]);case"./badges/thirtyfive.svelte":return De(()=>import("../chunks/thirtyfive-e8960031.js"),["chunks/thirtyfive-e8960031.js","chunks/index-86f4d6c3.js"]);case"./badges/twenty.svelte":return De(()=>import("../chunks/twenty-39a31000.js"),["chunks/twenty-39a31000.js","chunks/index-86f4d6c3.js"]);case"./badges/two.svelte":return De(()=>import("../chunks/two-86591465.js"),["chunks/two-86591465.js","chunks/index-86f4d6c3.js"]);default:return new Promise(function(e,t){(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(t.bind(null,new Error("Unknown variable dynamic import: "+n)))})}}function rr(n,e,t){const r=n.slice();return r[18]=e[t],r[20]=t,r}function nr(n,e,t){const r=n.slice();return r[21]=e[t],r[23]=t,r}function sr(n,e,t){const r=n.slice();return r[24]=e[t],r}function ar(n){let e,t,r,s;var a=n[6];function l(o){return{props:{classNames:"w-full max-w-[180px]"}}}return a&&(t=new a(l())),{c(){e=v("div"),t&&Xe(t.$$.fragment),this.h()},l(o){e=w(o,"DIV",{class:!0});var c=y(e);t&&ht(t.$$.fragment,c),c.forEach(f),this.h()},h(){u(e,"class","absolute left-0 right-0 top-0 bottom-0 flex place-content-center place-items-center")},m(o,c){ce(o,e,c),t&&Ge(t,e,null),s=!0},p(o,c){if(a!==(a=o[6])){if(t){Je();const _=t;_e(_.$$.fragment,1,0,()=>{Ze(_,1)}),Ke()}a?(t=new a(l()),Xe(t.$$.fragment),he(t.$$.fragment,1),Ge(t,e,null)):t=null}},i(o){s||(t&&he(t.$$.fragment,o),St(()=>{r||(r=Ve(e,tr,{duration:500},!0)),r.run(1)}),s=!0)},o(o){t&&_e(t.$$.fragment,o),r||(r=Ve(e,tr,{duration:500},!1)),r.run(0),s=!1},d(o){o&&f(e),t&&Ze(t),o&&r&&r.end()}}}function lr(n){let e,t,r,s;return{c(){e=v("div"),t=v("img"),s=M(),this.h()},l(a){e=w(a,"DIV",{});var l=y(e);t=w(l,"IMG",{src:!0,alt:!0,class:!0}),s=F(l),l.forEach(f),this.h()},h(){ze(t.src,r=n[9]+n[24])||u(t,"src",r),u(t,"alt",""),u(t,"class","aspect-square w-full h-full")},m(a,l){ce(a,e,l),i(e,t),i(e,s)},p(a,l){l&2&&!ze(t.src,r=a[9]+a[24])&&u(t,"src",r)},d(a){a&&f(e)}}}function or(n){let e,t;return{c(){e=st("rect"),this.h()},l(r){e=at(r,"rect",{fill:!0,x:!0,y:!0,width:!0,height:!0,rx:!0}),y(e).forEach(f),this.h()},h(){u(e,"fill",t=Zt[n[21].state]),u(e,"x",n[23]*(xe+ke)),u(e,"y",n[20]*(xe+ke)),u(e,"width",xe),u(e,"height",xe),u(e,"rx",n[11])},m(r,s){ce(r,e,s)},p(r,s){s&1&&t!==(t=Zt[r[21].state])&&u(e,"fill",t)},d(r){r&&f(e)}}}function ir(n){let e,t=n[18],r=[];for(let s=0;s{d=null}),Ke()),V&514){C=g[1];let x;for(x=0;x{A||(A=Ve(e,it,{},!0)),A.run(1)}),k=!0)},o(g){_e(d),A||(A=Ve(e,it,{},!1)),A.run(0),k=!1},d(g){g&&f(e),d&&d.d(),Te(I,g),Te(b,g),n[13](null),n[16](null),g&&A&&A.end(),L=!1,br(ee)}}}const xe=10,ke=1;function Gr(n,e,t){const r=Pt();let{board:s}=e,{currentRowIndex:a}=e,{imagePaths:l}=e,{totalStreaks:o}=e;const c=Or[a],_="";let S,j,Y=!1;async function H(D){t(5,Y=!0);try{const $=await Wr.toBlob(D,{bgcolor:"#000"}),h=document.createElement("a");h.download=`sucess-${Date.now()}.png`,h.target="_self",h.onclick=async p=>{if(t(5,Y=!0),h.href){URL.revokeObjectURL(h.href),t(5,Y=!1);return}h.href=URL.createObjectURL($),t(5,Y=!1)},h.click(),console.log("Downloding image.")}catch($){console.log($.name,$.message)}}const U=D=>{D.key==="Escape"||D.key==="Enter"?r("restart"):D.key===" "&&H(j)};let z;yr(async()=>{if(o in ot){const D=ot[o];t(6,z=(await qr(`./badges/${D}.svelte`)).default)}setTimeout(()=>{window.addEventListener("keyup",U,!0)},1e3)}),Er(()=>{window.removeEventListener("keyup",U,!0)});const q=xe/10;function oe(D){kt[D?"unshift":"push"](()=>{j=D,t(4,j)})}const Q=()=>H(j),K=()=>r("restart");function ue(D){kt[D?"unshift":"push"](()=>{S=D,t(3,S)})}return n.$$set=D=>{"board"in D&&t(0,s=D.board),"currentRowIndex"in D&&t(12,a=D.currentRowIndex),"imagePaths"in D&&t(1,l=D.imagePaths),"totalStreaks"in D&&t(2,o=D.totalStreaks)},[s,l,o,S,j,Y,z,r,c,_,H,q,a,oe,Q,K,ue]}class Jr extends ct{constructor(e){super(),ut(this,e,Gr,Xr,ft,{board:0,currentRowIndex:12,imagePaths:1,totalStreaks:2})}}function cr(n){let e,t,r,s,a;return{c(){e=v("div"),t=v("button"),r=J("Try Again"),this.h()},l(l){e=w(l,"DIV",{class:!0});var o=y(e);t=w(o,"BUTTON",{class:!0});var c=y(t);r=Z(c,"Try Again"),c.forEach(f),o.forEach(f),this.h()},h(){u(t,"class","hover:no-underline underline underline-offset-2 hover:scale-105 transition-all duration-200 ease-in-out"),u(e,"class","font-light flex-1 text-xs sm:text-base text-center")},m(l,o){ce(l,e,o),i(e,t),i(t,r),s||(a=Be(t,"click",n[3]),s=!0)},p:qe,d(l){l&&f(e),s=!1,a()}}}function Zr(n){let e,t,r,s,a,l=n[0]===ve.FAIL&&cr(n);return{c(){e=v("div"),t=J(n[1]),r=M(),l&&l.c(),this.h()},l(o){e=w(o,"DIV",{class:!0});var c=y(e);t=Z(c,n[1]),r=F(c),l&&l.l(c),c.forEach(f),this.h()},h(){u(e,"class","message svelte-1sv0qpd")},m(o,c){ce(o,e,c),i(e,t),i(e,r),l&&l.m(e,null),a=!0},p(o,[c]){(!a||c&2)&&Qe(t,o[1]),o[0]===ve.FAIL?l?l.p(o,c):(l=cr(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},i(o){a||(St(()=>{s||(s=Ve(e,it,{},!0)),s.run(1)}),a=!0)},o(o){s||(s=Ve(e,it,{},!1)),s.run(0),a=!1},d(o){o&&f(e),l&&l.d(),o&&s&&s.end()}}}function Kr(n,e,t){const r=Pt();let{gameState:s}=e,{message:a=null}=e;const l=()=>r("restart");return n.$$set=o=>{"gameState"in o&&t(0,s=o.gameState),"message"in o&&t(1,a=o.message)},[s,a,r,l]}class Qr extends ct{constructor(e){super(),ut(this,e,Kr,Zr,ft,{gameState:0,message:1})}}let $r=(n=21)=>crypto.getRandomValues(new Uint8Array(n)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),"");const en=$r(),tn=[],Pr=kr(JSON.parse(localStorage.user||JSON.stringify(en)));Pr.subscribe(n=>localStorage.user=JSON.stringify(n));const xt=kr(JSON.parse(localStorage.completedPrompts||JSON.stringify(tn)));xt.subscribe(n=>localStorage.completedPrompts=JSON.stringify(n));function ur(n,e,t){const r=n.slice();return r[29]=e[t],r[31]=t,r}function fr(n,e,t){const r=n.slice();return r[32]=e[t],r[31]=t,r}function hr(n,e,t){const r=n.slice();return r[34]=e[t],r}function dr(n){let e,t,r,s,a,l,o,c,_,S,j,Y,H,U,z,q,oe,Q,K,ue,D,$,h,p,T,E,P,A,k,L,ee,d,C,I,B,b,g,V,x,te,m,N,W,O,ne,ie,we,be,de,re,fe,Le,Tt,dt,Re,At,mt,Ee,Ce,Me,pt,gt,Fe,vt,wt,Pe,Ae,_t,Ie,bt,$e,He,yt,It,ae=n[7]&&mr(n),le=n[9]===ve.SUCESS&&pr(n),Ne=n[2],me=[];for(let R=0;RRr(h,"letterStates",Sr)),h.$on("keyup",n[15]),{c(){e=v("div"),ae&&ae.c(),t=M(),le&&le.c(),r=M(),s=v("header"),a=v("span"),l=J("Guess the prompt!"),o=M(),c=v("span"),_=M(),S=v("h1"),j=J("\u{1F951} WORDALLE \u{1F951}"),Y=M(),H=v("span"),U=M(),z=v("span"),q=v("button"),oe=J("Skip to next"),Q=M(),K=v("div");for(let R=0;R