var Nt=Object.defineProperty;var at=Object.getOwnPropertySymbols;var Ut=Object.prototype.hasOwnProperty,Bt=Object.prototype.propertyIsEnumerable;var st=(n,e,t)=>e in n?Nt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,lt=(n,e)=>{for(var t in e||(e={}))Ut.call(e,t)&&st(n,t,e[t]);if(at)for(var t of at(e))Bt.call(e,t)&&st(n,t,e[t]);return n};import{S as Me,i as He,s as qe,e as A,k as K,c as j,a as P,m as Z,d,b as u,g as le,J as c,K as xe,L as be,n as Te,M as We,t as oe,h as ie,N as Ue,O as Be,P as Vt,x as Ae,y as Xe,z as je,o as Ie,p as me,C as Re,q as De,r as ce,Q as Ke,R as Pe,T as Ve,l as Oe,j as Le,U as Rt,w as Dt,V as Lt,W as Ye,f as Se,X as Ot,Y as zt}from"../chunks/index-7118b6c4.js";import{_ as ke}from"../chunks/preload-helper-8235996a.js";var pe=(n=>(n.INITIAL="",n.CORRECT="correct",n.PRESENT="present",n.ABSENT="absent",n))(pe||{}),ge=(n=>(n[n.PLAYING=0]="PLAYING",n[n.SUCESS=1]="SUCESS",n[n.FAIL=2]="FAIL",n))(ge||{});function Ft(n,e){const t=[...n],r=t[e];for(const a of[...r].reverse())if(a.letter){a.letter="";break}return t}function Mt(n,e,t){const r=[...n],a=r[e];for(const s of a)if(s.correct===" "&&(s.letter=" "),!s.letter){s.letter=t;break}return r}const ot={[pe.CORRECT]:"#00b81a",[pe.PRESENT]:"#ffc80a",[pe.ABSENT]:"#d9d9d9",[pe.INITIAL]:"#5d5d5d"},ze={2:"two",5:"five",10:"ten",15:"fifteen",20:"twenty",35:"thirtyfive",50:"fifty"},Ht=["\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 it(n,e,t){const r=n.slice();return r[4]=e[t],r[6]=t,r}function ct(n,e,t){const r=n.slice();return r[7]=e[t],r}function qt(n){let e;return{c(){e=A("div"),this.h()},l(t){e=j(t,"DIV",{class:!0}),P(e).forEach(d),this.h()},h(){u(e,"class","spacer svelte-2ngxdh")},m(t,r){le(t,e,r)},d(t){t&&d(e)}}}function Xt(n){let e,t=n[7]+"",r;return{c(){e=A("span"),r=oe(t)},l(a){e=j(a,"SPAN",{});var s=P(e);r=ie(s,t),s.forEach(d)},m(a,s){le(a,e,s),c(e,r)},p:Te,d(a){a&&d(e)}}}function Gt(n){let e,t;return{c(){e=Ue("svg"),t=Ue("path"),this.h()},l(r){e=Be(r,"svg",{xmlns:!0,height:!0,viewBox:!0,width:!0});var a=P(e);t=Be(a,"path",{fill:!0,d:!0}),P(t).forEach(d),a.forEach(d),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,a){le(r,e,a),c(e,t)},p:Te,d(r){r&&d(e)}}}function ut(n){let e,t,r,a;function s(g,S){return g[7]==="Backspace"?Gt:Xt}let o=s(n)(n);function i(){return n[3](n[7])}return{c(){e=A("button"),o.c(),this.h()},l(g){e=j(g,"BUTTON",{class:!0});var S=P(e);o.l(S),S.forEach(d),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(g,S){le(g,e,S),o.m(e,null),r||(a=xe(e,"click",i),r=!0)},p(g,S){n=g,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(g){g&&d(e),o.d(),r=!1,a()}}}function Yt(n){let e;return{c(){e=A("div"),this.h()},l(t){e=j(t,"DIV",{class:!0}),P(e).forEach(d),this.h()},h(){u(e,"class","spacer svelte-2ngxdh")},m(t,r){le(t,e,r)},d(t){t&&d(e)}}}function ft(n){let e,t,r,a,s=n[6]===1&&qt(),l=n[4],o=[];for(let g=0;ga("keyup",o);return n.$$set=o=>{"letterStates"in o&&t(0,r=o.letterStates)},[r,a,s,l]}class Zt extends Me{constructor(e){super(),He(this,e,Kt,Wt,qe,{letterStates:0})}}function Jt(n){const e=n-1;return e*e*e+1}function Fe(n,{delay:e=0,duration:t=400,easing:r=Vt}={}){const a=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:r,css:s=>`opacity: ${s*a}`}}function ht(n,{delay:e=0,duration:t=400,easing:r=Jt,start:a=0,opacity:s=0}={}){const l=getComputedStyle(n),o=+l.opacity,i=l.transform==="none"?"":l.transform,g=1-a,S=o*(1-s);return{delay:e,duration:t,easing:r,css:(D,z)=>` transform: ${i} scale(${1-g*z}); opacity: ${o-S*z} `}}var Ct={exports:{}};(function(n){(function(e){var t=ae(),r=he(),a=C(),s=te(),l={imagePlaceholder:void 0,cacheBust:!1},o={toSvg:i,toPng:S,toJpeg:D,toBlob:z,toPixelData:g,impl:{fontFaces:a,images:s,util:t,inliner:r,options:{}}};n.exports=o;function i(f,p){return p=p||{},B(p),Promise.resolve(f).then(function(_){return q(_,p.filter,!0)}).then(J).then(se).then(x).then(function(_){return Q(_,p.width||t.width(f),p.height||t.height(f))});function x(_){return p.bgcolor&&(_.style.backgroundColor=p.bgcolor),p.width&&(_.style.width=p.width+"px"),p.height&&(_.style.height=p.height+"px"),p.style&&Object.keys(p.style).forEach(function(I){_.style[I]=p.style[I]}),_}}function g(f,p){return V(f,p||{}).then(function(x){return x.getContext("2d").getImageData(0,0,t.width(f),t.height(f)).data})}function S(f,p){return V(f,p||{}).then(function(x){return x.toDataURL()})}function D(f,p){return p=p||{},V(f,p).then(function(x){return x.toDataURL("image/jpeg",p.quality||1)})}function z(f,p){return V(f,p||{}).then(t.canvasToBlob)}function B(f){typeof f.imagePlaceholder=="undefined"?o.impl.options.imagePlaceholder=l.imagePlaceholder:o.impl.options.imagePlaceholder=f.imagePlaceholder,typeof f.cacheBust=="undefined"?o.impl.options.cacheBust=l.cacheBust:o.impl.options.cacheBust=f.cacheBust}function V(f,p){return i(f,p).then(t.makeImage).then(t.delay(100)).then(function(_){var I=x(f);return I.getContext("2d").drawImage(_,0,0),I});function x(_){var I=document.createElement("canvas");if(I.width=p.width||t.width(_),I.height=p.height||t.height(_),p.bgcolor){var E=I.getContext("2d");E.fillStyle=p.bgcolor,E.fillRect(0,0,I.width,I.height)}return I}}function q(f,p,x){if(!x&&p&&!p(f))return Promise.resolve();return Promise.resolve(f).then(_).then(function(w){return I(f,w,p)}).then(function(w){return E(f,w)});function _(w){return w instanceof HTMLCanvasElement?t.makeImage(w.toDataURL()):w.cloneNode(!1)}function I(w,h,F){var T=w.childNodes;if(T.length===0)return Promise.resolve(h);return U(h,t.asArray(T),F).then(function(){return h});function U(y,M,R){var v=Promise.resolve();return M.forEach(function(X){v=v.then(function(){return q(X,R)}).then(function(b){b&&y.appendChild(b)})}),v}}function E(w,h){if(!(h instanceof Element))return h;return Promise.resolve().then(F).then(T).then(U).then(y).then(function(){return h});function F(){M(window.getComputedStyle(w),h.style);function M(R,v){R.cssText?v.cssText=R.cssText:X(R,v);function X(b,$){t.asArray(b).forEach(function(m){$.setProperty(m,b.getPropertyValue(m),b.getPropertyPriority(m))})}}}function T(){[":before",":after"].forEach(function(R){M(R)});function M(R){var v=window.getComputedStyle(w,R),X=v.getPropertyValue("content");if(X===""||X==="none")return;var b=t.uid();h.className=h.className+" "+b;var $=document.createElement("style");$.appendChild(m(b,R,v)),h.appendChild($);function m(N,H,k){var O="."+N+":"+H,re=k.cssText?ee(k):fe(k);return document.createTextNode(O+"{"+re+"}");function ee(G){var de=G.getPropertyValue("content");return G.cssText+" content: "+de+";"}function fe(G){return t.asArray(G).map(de).join("; ")+";";function de(ue){return ue+": "+G.getPropertyValue(ue)+(G.getPropertyPriority(ue)?" !important":"")}}}}}function U(){w instanceof HTMLTextAreaElement&&(h.innerHTML=w.value),w instanceof HTMLInputElement&&h.setAttribute("value",w.value)}function y(){h instanceof SVGElement&&(h.setAttribute("xmlns","http://www.w3.org/2000/svg"),h instanceof SVGRectElement&&["width","height"].forEach(function(M){var R=h.getAttribute(M);!R||h.style.setProperty(M,R)}))}}}function J(f){return a.resolveAll().then(function(p){var x=document.createElement("style");return f.appendChild(x),x.appendChild(document.createTextNode(p)),f})}function se(f){return s.inlineAll(f).then(function(){return f})}function Q(f,p,x){return Promise.resolve(f).then(function(_){return _.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),new XMLSerializer().serializeToString(_)}).then(t.escapeXhtml).then(function(_){return''+_+""}).then(function(_){return''+_+""}).then(function(_){return"data:image/svg+xml;charset=utf-8,"+_})}function ae(){return{escape:y,parseExtension:p,mimeType:x,dataAsUrl:U,isDataUrl:_,canvasToBlob:E,resolveUrl:w,getAndEncode:T,uid:h(),delay:M,asArray:R,escapeXhtml:v,makeImage:F,width:X,height:b};function f(){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 x(m){var N=p(m).toLowerCase();return f()[N]||""}function _(m){return m.search(/^(data:)/)!==-1}function I(m){return new Promise(function(N){for(var H=window.atob(m.toDataURL().split(",")[1]),k=H.length,O=new Uint8Array(k),re=0;reimport("../chunks/fifteen-6ece83ce.js"),["chunks/fifteen-6ece83ce.js","chunks/index-7118b6c4.js"]);case"./badges/fifty.svelte":return ke(()=>import("../chunks/fifty-230cfc24.js"),["chunks/fifty-230cfc24.js","chunks/index-7118b6c4.js"]);case"./badges/five.svelte":return ke(()=>import("../chunks/five-e7ec1bc4.js"),["chunks/five-e7ec1bc4.js","chunks/index-7118b6c4.js"]);case"./badges/ten.svelte":return ke(()=>import("../chunks/ten-7c9c0a66.js"),["chunks/ten-7c9c0a66.js","chunks/index-7118b6c4.js"]);case"./badges/thirtyfive.svelte":return ke(()=>import("../chunks/thirtyfive-d3270980.js"),["chunks/thirtyfive-d3270980.js","chunks/index-7118b6c4.js"]);case"./badges/twenty.svelte":return ke(()=>import("../chunks/twenty-97dd6623.js"),["chunks/twenty-97dd6623.js","chunks/index-7118b6c4.js"]);case"./badges/two.svelte":return ke(()=>import("../chunks/two-09cc56a1.js"),["chunks/two-09cc56a1.js","chunks/index-7118b6c4.js"]);default:return new Promise(function(e,t){(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(t.bind(null,new Error("Unknown variable dynamic import: "+n)))})}}function dt(n,e,t){const r=n.slice();return r[18]=e[t],r[20]=t,r}function mt(n,e,t){const r=n.slice();return r[21]=e[t],r[23]=t,r}function pt(n,e,t){const r=n.slice();return r[24]=e[t],r}function gt(n){let e,t,r,a;var s=n[6];function l(o){return{props:{classNames:"w-full max-w-[180px]"}}}return s&&(t=new s(l())),{c(){e=A("div"),t&&Ae(t.$$.fragment),this.h()},l(o){e=j(o,"DIV",{class:!0});var i=P(e);t&&Xe(t.$$.fragment,i),i.forEach(d),this.h()},h(){u(e,"class","absolute left-0 right-0 top-0 bottom-0 flex place-content-center place-items-center")},m(o,i){le(o,e,i),t&&je(t,e,null),a=!0},p(o,i){if(s!==(s=o[6])){if(t){Ie();const g=t;me(g.$$.fragment,1,0,()=>{Re(g,1)}),De()}s?(t=new s(l()),Ae(t.$$.fragment),ce(t.$$.fragment,1),je(t,e,null)):t=null}},i(o){a||(t&&ce(t.$$.fragment,o),Ke(()=>{r||(r=Pe(e,ht,{duration:500},!0)),r.run(1)}),a=!0)},o(o){t&&me(t.$$.fragment,o),r||(r=Pe(e,ht,{duration:500},!1)),r.run(0),a=!1},d(o){o&&d(e),t&&Re(t),o&&r&&r.end()}}}function vt(n){let e,t,r,a;return{c(){e=A("div"),t=A("img"),a=K(),this.h()},l(s){e=j(s,"DIV",{});var l=P(e);t=j(l,"IMG",{src:!0,alt:!0,class:!0}),a=Z(l),l.forEach(d),this.h()},h(){Ve(t.src,r=n[9]+n[24])||u(t,"src",r),u(t,"alt",""),u(t,"class","aspect-square w-full h-full")},m(s,l){le(s,e,l),c(e,t),c(e,a)},p(s,l){l&2&&!Ve(t.src,r=s[9]+s[24])&&u(t,"src",r)},d(s){s&&d(e)}}}function wt(n){let e,t;return{c(){e=Ue("rect"),this.h()},l(r){e=Be(r,"rect",{fill:!0,x:!0,y:!0,width:!0,height:!0,rx:!0}),P(e).forEach(d),this.h()},h(){u(e,"fill",t=ot[n[21].state]),u(e,"x",n[23]*(we+ve)),u(e,"y",n[20]*(we+ve)),u(e,"width",we),u(e,"height",we),u(e,"rx",n[11])},m(r,a){le(r,e,a)},p(r,a){a&1&&t!==(t=ot[r[21].state])&&u(e,"fill",t)},d(r){r&&d(e)}}}function _t(n){let e,t=n[18],r=[];for(let a=0;a{T=null}),De()),X&514){U=v[1];let b;for(b=0;b{E||(E=Pe(e,Fe,{},!0)),E.run(1)}),w=!0)},o(v){me(T),E||(E=Pe(e,Fe,{},!1)),E.run(0),w=!1},d(v){v&&d(e),T&&T.d(),be(y,v),be(R,v),n[13](null),n[16](null),v&&E&&E.end(),h=!1,Rt(F)}}}const we=10,ve=1;function tr(n,e,t){const r=We();let{board:a}=e,{currentRowIndex:s}=e,{imagePaths:l}=e,{totalStreaks:o}=e;const i=Ht[s],g="";let S,D,z=!1;async function B(C){t(5,z=!0);try{const te=await Qt.toBlob(C,{bgcolor:"#000"}),f=document.createElement("a");f.download=`sucess-${Date.now()}.png`,f.target="_self",f.onclick=async p=>{if(t(5,z=!0),f.href){URL.revokeObjectURL(f.href),t(5,z=!1);return}f.href=URL.createObjectURL(te),t(5,z=!1)},f.click(),console.log("Downloding image.")}catch(te){console.log(te.name,te.message)}}const V=C=>{C.key==="Escape"?r("restart"):C.key===" "&&B(D)};let q;Dt(async()=>{if(o in ze){const C=ze[o];t(6,q=(await $t(`./badges/${C}.svelte`)).default)}window.addEventListener("keyup",V,!0)}),Lt(()=>{window.removeEventListener("keyup",V,!0)});const J=we/10;function se(C){Ye[C?"unshift":"push"](()=>{D=C,t(4,D)})}const Q=()=>B(D),ae=()=>r("restart");function he(C){Ye[C?"unshift":"push"](()=>{S=C,t(3,S)})}return n.$$set=C=>{"board"in C&&t(0,a=C.board),"currentRowIndex"in C&&t(12,s=C.currentRowIndex),"imagePaths"in C&&t(1,l=C.imagePaths),"totalStreaks"in C&&t(2,o=C.totalStreaks)},[a,l,o,S,D,z,q,r,i,g,B,J,s,se,Q,ae,he]}class rr extends Me{constructor(e){super(),He(this,e,tr,er,qe,{board:0,currentRowIndex:12,imagePaths:1,totalStreaks:2})}}function bt(n){let e,t,r,a,s;return{c(){e=A("div"),t=A("button"),r=oe("Try Again"),this.h()},l(l){e=j(l,"DIV",{class:!0});var o=P(e);t=j(o,"BUTTON",{class:!0});var i=P(t);r=ie(i,"Try Again"),i.forEach(d),o.forEach(d),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){le(l,e,o),c(e,t),c(t,r),a||(s=xe(t,"click",n[3]),a=!0)},p:Te,d(l){l&&d(e),a=!1,s()}}}function nr(n){let e,t,r,a,s,l=n[0]===ge.FAIL&&bt(n);return{c(){e=A("div"),t=oe(n[1]),r=K(),l&&l.c(),this.h()},l(o){e=j(o,"DIV",{class:!0});var i=P(e);t=ie(i,n[1]),r=Z(i),l&&l.l(i),i.forEach(d),this.h()},h(){u(e,"class","message svelte-1sv0qpd")},m(o,i){le(o,e,i),c(e,t),c(e,r),l&&l.m(e,null),s=!0},p(o,[i]){(!s||i&2)&&Le(t,o[1]),o[0]===ge.FAIL?l?l.p(o,i):(l=bt(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},i(o){s||(Ke(()=>{a||(a=Pe(e,Fe,{},!0)),a.run(1)}),s=!0)},o(o){a||(a=Pe(e,Fe,{},!1)),a.run(0),s=!1},d(o){o&&d(e),l&&l.d(),o&&a&&a.end()}}}function ar(n,e,t){const r=We();let{gameState:a}=e,{message:s=null}=e;const l=()=>r("restart");return n.$$set=o=>{"gameState"in o&&t(0,a=o.gameState),"message"in o&&t(1,s=o.message)},[a,s,r,l]}class sr extends Me{constructor(e){super(),He(this,e,ar,nr,qe,{gameState:0,message:1})}}function yt(n,e,t){const r=n.slice();return r[27]=e[t],r[29]=t,r}function kt(n,e,t){const r=n.slice();return r[30]=e[t],r[29]=t,r}function Et(n,e,t){const r=n.slice();return r[32]=e[t],r}function xt(n){let e,t,r,a,s,l,o,i,g,S,D,z,B,V,q,J,se,Q,ae,he,C,te,f,p,x,_,I,E,w,h,F,T,U,y,M,R,v,X,b,$,m,N,H,k=n[7]&&Pt(n),O=n[9]===ge.SUCESS&&St(n),re=n[2],ee=[];for(let L=0;Lzt(f,"letterStates",de)),f.$on("keyup",n[15]),{c(){e=A("div"),k&&k.c(),t=K(),O&&O.c(),r=K(),a=A("header"),s=A("span"),l=oe("Guess the prompt!"),o=K(),i=A("span"),g=K(),S=A("h1"),D=oe("\u{1F951} WORDALLE \u{1F951}"),z=K(),B=A("span"),V=K(),q=A("span"),J=A("button"),se=oe("Skip to next"),Q=K(),ae=A("div");for(let L=0;L