PageSourceSearch

https://www.teachany.com/_nuxt/_id_-DjP9G8S_-29.js

js teachany.com collected 2026-09-24 09:55:00 UTC 12,684 bytes, 1 lines download raw bytes

1import{_ as X}from"./nuxt-link-D_rgCK5z-29.js";import{a8 as Z,o as ee,b as te,H as c,$ as r,a0 as a,O as i,B as b,W as h,a1 as y,a3 as m,a2 as se,V as $,T as L,ai as V,r as g,j as oe,c as f,U as u}from"./lazy-qrcode-oXPcgXJC-29.js";import{c as A,b as re,d as ae}from"./generator-B9Z-PAk9-29.js";import{S as le,g as ne,a as ue,i as ie,m as de}from"./Grid-DZOx4qbJ-29.js";import{S as ce,a as pe,r as me}from"./Timer-LFG0U39D-29.js";import{f as H,a as ge,c as fe,b as he}from"#entry";import{r as ye}from"./ExclamationTriangleIcon-DLko1OG1-29.js";import{r as ke}from"./PlayIcon-BPH6vxsL-29.js";import{r as ve}from"./CheckCircleIcon-DMxaflmY-29.js";import"./lazy-pdf-GO-7vVHk-29.js";import"./_plugin-vue_export-helper-DlAUqK2U-29.js";import"./PencilIcon-Y7k2Y7p4-29.js";import"./LightBulbIcon-AwDidPpO-29.js";import"./ClockIcon-Cvmh8X1U-29.js";const we={class:"min-h-screen bg-gradient-to-br from-slate-50 via-blue-50 to-indigo-50 dark:from-gray-900 dark:via-gray-800 dark:to-gray-900"},be={class:"px-4 py-6 md:px-8 md:py-8 pt-20 md:pt-24 max-w-3xl mx-auto"},xe={key:0,class:"flex flex-col items-center justify-center py-20"},ze={class:"text-gray-500 dark:text-gray-400 text-sm"},_e={key:1,class:"flex flex-col items-center justify-center py-20 text-center"},Ce={class:"w-16 h-16 bg-red-100 dark:bg-red-900/30 rounded-full flex items-center justify-center mb-4"},Se={class:"text-xl font-bold text-gray-900 dark:text-gray-100 mb-2"},$e={class:"text-gray-500 dark:text-gray-400 mb-6 text-sm max-w-sm"},Ie={key:2},Pe={class:"text-center mb-6"},Ee={class:"text-2xl md:text-3xl font-bold text-gray-900 dark:text-gray-100 mb-1"},Me={class:"text-sm text-gray-500 dark:text-gray-400"},Ne={class:"bg-white/80 dark:bg-gray-800/80 backdrop-blur-sm rounded-2xl shadow-lg border border-gray-200/50 dark:border-gray-700/50 p-3 md:p-5"},Te={class:"flex items-center justify-between mb-3 pb-3 border-b border-gray-200 dark:border-gray-700"},je={class:"flex items-center gap-3"},Le={class:"flex items-center gap-2"},Ve={key:0,class:"inline-flex items-center gap-1.5 px-2.5 py-1 bg-emerald-100 dark:bg-emerald-900/40 text-emerald-700 dark:text-emerald-300 rounded-full text-xs font-semibold"},Ae={key:0,class:"mt-4 pt-4 border-t border-gray-200 dark:border-gray-700"},He={class:"text-center mt-6"},Ue={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm p-4"},De={class:"bg-white dark:bg-gray-800 rounded-3xl shadow-2xl p-6 md:p-8 max-w-sm w-full text-center transform"},Oe={class:"w-20 h-20 bg-gradient-to-br from-emerald-400 to-green-500 rounded-full flex items-center justify-center mx-auto mb-5 shadow-lg shadow-emerald-500/30"},Be={class:"text-2xl font-bold text-gray-900 dark:text-gray-100 mb-2"},Re={class:"text-gray-500 dark:text-gray-400 mb-5"},Fe={class:"bg-gray-100 dark:bg-gray-700/50 rounded-2xl p-4 mb-5"},Ge={class:"text-xs text-gray-500 dark:text-gray-400 uppercase tracking-wide mb-1"},Ke={class:"text-3xl font-bold text-gray-900 dark:text-gray-100 font-mono"},Ye={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 backdrop-blur-sm p-4"},Je={class:"bg-white dark:bg-gray-800 rounded-3xl shadow-2xl p-6 md:p-8 max-w-sm w-full text-center"},We={class:"w-16 h-16 bg-blue-100 dark:bg-blue-900/30 rounded-full flex items-center justify-center mx-auto mb-4"},qe={class:"text-xl font-bold text-gray-900 dark:text-gray-100 mb-2"},Qe={class:"text-gray-500 dark:text-gray-400 mb-5 text-sm"},gt={__name:"[id]",async setup(Xe){let k,I;const{t:x,locale:z}=H(),U=H(),D=ge().params.id;try{const{data:t}=([k,I]=Z(()=>fe(`i18n_sudokugenerator_${z.value}`,()=>$fetch(`https://project.deletetweets.ai/i18n_languages/teachany/sudoku-generator/1.0.1/${z.value}.json`))),k=await k,I(),k);t.value&&U.mergeLocaleMessage(z.value,t.value)}catch{}const _=g(!0),C=g(!1),l=g("preview"),e=oe({size:9,difficulty:"medium",puzzle:[],solution:[],userInput:[],notes:[],selectedCell:null,history:[],timer:0,notesMode:!1,showErrors:!0}),v=g(!1),w=g(!1),d=g(null),p=f(()=>e.puzzle.length?de(e.puzzle,e.userInput,e.size):[]),O=f(()=>p.value.length?re(p.value,e.size):new Map),B=f(()=>!e.showErrors||!e.puzzle.length||l.value!=="playing"?[]:ue(e.puzzle,e.userIn
1put,e.solution,e.size)),R=f(()=>{if(!e.selectedCell||!p.value.length||l.value!=="playing")return[];const[t,s]=e.selectedCell;return ne(p.value,t,s,e.size)}),P=f(()=>p.value.length?ie(p.value,e.size):!1),F=f(()=>{const t=Math.floor(e.timer/3600),s=Math.floor(e.timer%3600/60),o=e.timer%60;return t>0?`${t}:${String(s).padStart(2,"0")}:${String(o).padStart(2,"0")}`:`${String(s).padStart(2,"0")}:${String(o).padStart(2,"0")}`});function G(t){return x(`sudokumaker.page.difficulties.${t}`)||{easy:"Easy",medium:"Medium",hard:"Hard"}[t]||t}function E(t){const s=[];for(let o=0;o<t;o++){s[o]=[];for(let n=0;n<t;n++)s[o][n]=new Set}return s}function K(){e.puzzle.length&&(l.value="playing",e.userInput=A(e.size),e.notes=E(e.size),e.history=[],e.timer=0,v.value=!1,d.value&&(d.value.reset(),d.value.start()))}function Y(){d.value&&d.value.pause(),w.value=!0}function J(){w.value=!1,d.value&&d.value.resume()}function W({row:t,col:s}){l.value==="playing"&&(e.selectedCell=[t,s])}function S(t){if(l.value!=="playing"||!e.selectedCell)return;const[s,o]=e.selectedCell;e.puzzle[s][o]===0&&(e.history.push({type:e.notesMode?"note":"input",row:s,col:o,previousValue:e.notesMode?new Set(e.notes[s][o]):e.userInput[s][o],previousNotes:new Set(e.notes[s][o])}),e.notesMode?(e.notes[s][o].has(t)?e.notes[s][o].delete(t):e.notes[s][o].add(t),e.notes=[...e.notes]):e.userInput[s][o]===t?e.userInput[s][o]=0:(e.userInput[s][o]=t,e.notes[s][o].clear()),T())}function M(){if(l.value!=="playing"||!e.selectedCell)return;const[t,s]=e.selectedCell;e.puzzle[t][s]===0&&(e.history.push({type:"erase",row:t,col:s,previousValue:e.userInput[t][s],previousNotes:new Set(e.notes[t][s])}),e.userInput[t][s]=0,e.notes[t][s].clear(),e.notes=[...e.notes])}function N(){if(l.value!=="playing"||e.history.length===0)return;const t=e.history.pop();t.type==="note"?(e.notes[t.row][t.col]=t.previousValue,e.notes=[...e.notes]):(e.userInput[t.row][t.col]=t.previousValue,e.notes[t.row][t.col]=t.previousNotes,e.notes=[...e.notes])}function q(){if(l.value!=="playing")return;const t=ae(e.puzzle,e.userInput,e.solution,e.size);t&&(e.history.push({type:"hint",row:t.row,col:t.col,previousValue:e.userInput[t.row][t.col],previousNotes:new Set(e.notes[t.row][t.col])}),e.userInput[t.row][t.col]=t.value,e.notes[t.row][t.col].clear(),e.selectedCell=[t.row,t.col],T())}function T(){P.value&&(d.value&&d.value.pause(),v.value=!0)}function j(t){if(l.value!=="playing"||!e.selectedCell||w.value||v.value)return;const[s,o]=e.selectedCell;if(t.key>="1"&&t.key<="9"){const n=parseInt(t.key);n<=e.size&&S(n)}if(e.size===16&&t.key.toLowerCase()>="a"&&t.key.toLowerCase()<="g"){const n=t.key.toLowerCase().charCodeAt(0)-87;S(n)}(t.key==="Delete"||t.key==="Backspace")&&M(),t.key==="ArrowUp"&&s>0&&(e.selectedCell=[s-1,o]),t.key==="ArrowDown"&&s<e.size-1&&(e.selectedCell=[s+1,o]),t.key==="ArrowLeft"&&o>0&&(e.selectedCell=[s,o-1]),t.key==="ArrowRight"&&o<e.size-1&&(e.selectedCell=[s,o+1]),(t.ctrlKey||t.metaKey)&&t.key==="z"&&(t.preventDefault(),N()),(t.key==="n"||t.key==="N")&&(e.notesMode=!e.notesMode),t.key==="Escape"&&Y()}async function Q(){_.value=!0,C.value=!1;try{const t=await fetch("https://usa.imgkits.com/site/get",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`key=${encodeURIComponent("sudoku_"+D)}`});if(!t.ok)throw new Error("Failed to fetch puzzle");const s=await t.json();if(!s?.data?.value)throw new Error("Puzzle not found");const o=JSON.parse(s.data.value);if(!o.puzzle||!o.solution||!o.size)throw new Error("Invalid puzzle data");e.puzzle=o.puzzle,e.solution=o.solution,e.size=o.size,e.difficulty=o.difficulty||"medium",e.userInput=A(o.size),e.notes=E(o.size),e.selectedCell=null,e.history=[],e.timer=0}catch{C.value=!0}finally{_.value=!1}}return ee(()=>{Q(),window.addEventListener("keydown",j)}),te(()=>{window.removeEventListener("keydown",j)}),he({title:x("sudokumaker.page.sharePage.metaTitle")||"Shared Sudoku Puzzle - TeachAny",meta:[{name:"description",content:x("sudokumaker.page.sharePage.metaDescription")||"Play a shared Sudoku puzzle challenge"},{name:"robots",content:"noindex"}]}),(t,s)=>{const o=X;return u(),c("div",we,[r("div",be,[_.value?(u(),c("div",xe,[s[3]||(s[3]=r("svg",{class:"animate-spin w-10 h-10 text-blue-500 mb-4",fill:"none",viewBox:"0 0 24 24"},[r("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),r("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)),r("p",ze,a(t.$t("sudokumaker.page.sharePage.loading")||"Loading puzzle..."),1)])):C.value?(u(),c("div",_e,[r("div",Ce,[i(b(ye),{class:"w-8 h-8 text-red-500"})]),r("h2",Se,a(t.$t("sudokumaker.page.sharePage.notFound")||"Puzzle Not Found"),1),r("p",$e,a(t.$t("sudokumaker.page.sharePage.notFoundMessage")||"This puzzle link may have expired or doesn't exist. Try asking the sender for a new link."),1),i(o,{to:"/tools/sudoku-generator",class:"px-5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white font-semibold text-sm rounded-xl transition-all"},{default:h(()=>[y(a(t.$t("sudokumaker.page.sharePage.createOwn")||"Create Your Own Puzzle"),1)]),_:1})])):(u(),c("div",Ie,[r("div",Pe,[r("h1",Ee,a(t.$t("sudokumaker.page.sharePage.title")||"Sudoku Challenge"),1),r("p",Me,a(e.size)+"
1×"+a(e.size)+" · "+a(G(e.difficulty)),1)]),r("div",Ne,[r("div",Te,[r("div",je,[i(ce,{ref_key:"timerRef",ref:d,autoStart:l.value==="playing","onUpdate:time":s[0]||(s[0]=n=>e.timer=n)},null,8,["autoStart"])]),r("div",Le,[l.value==="playing"?(u(),c("span",Ve,[s[4]||(s[4]=r("span",{class:"w-1.5 h-1.5 bg-emerald-500 rounded-full animate-pulse"},null,-1)),y(" "+a(t.$t("sudokumaker.page.gameInProgress")||"Playing"),1)])):m("",!0),l.value==="preview"?(u(),c("button",{key:1,onClick:K,class:"px-4 py-1.5 bg-gradient-to-r from-blue-500 to-indigo-500 hover:from-blue-600 hover:to-indigo-600 text-white font-semibold text-xs rounded-lg shadow transition-all flex items-center gap-1.5"},[i(b(ke),{class:"w-4 h-4"}),y(" "+a(t.$t("sudokumaker.page.buttons.startPlaying")||"Start"),1)])):m("",!0)])]),r("div",{class:se(["flex justify-center",{"opacity-80":l.value==="preview"}])},[e.puzzle.length?(u(),$(le,{key:0,puzzle:e.puzzle,userInput:e.userInput,solution:e.solution,notes:e.notes,selectedCell:l.value==="playing"?e.selectedCell:null,showErrors:e.showErrors,errorCells:B.value,conflictCells:R.value,onCellClick:W},null,8,["puzzle","userInput","solution","notes","selectedCell","showErrors","errorCells","conflictCells"])):m("",!0)],2),l.value==="playing"?(u(),c("div",Ae,[i(pe,{size:e.size,numberCounts:O.value,notesMode:e.notesMode,canUndo:e.history.length>0,canHint:!P.value,showErrors:e.showErrors,onNumberClick:S,onUndo:N,onErase:M,onToggleNotes:s[1]||(s[1]=n=>e.notesMode=!e.notesMode),onHint:q,onToggleErrors:s[2]||(s[2]=n=>e.showErrors=!e.showErrors)},null,8,["size","numberCounts","notesMode","canUndo","canHint","showErrors"])])):m("",!0)]),r("div",He,[i(o,{to:"/tools/sudoku-generator",class:"text-sm text-blue-600 dark:text-blue-400 hover:underline"},{default:h(()=>[y(a(t.$t("sudokumaker.page.sharePage.createOwnLink")||"Create your own Sudoku puzzle")+" → ",1)]),_:1})])])),(u(),$(V,{to:"body"},[i(L,{name:"modal"},{default:h(()=>[v.value?(u(),c("div",Ue,[r("div",De,[r("div",Oe,[i(b(ve),{class:"w-10 h-10 text-white"})]),r("h3",Be,a(t.$t("sudokumaker.page.success.title")||"Awesome!"),1),r("p",Re,a(t.$t("sudokumaker.page.success.message")||"Puzzle completed!"),1),r("div",Fe,[r("p",Ge,a(t.$t("sudokumaker.page.success.yourTime")||"Your Time"),1),r("p",Ke,a(F.value),1)]),i(o,{to:"/tools/sudoku-generator",class:"block w-full py-3 px-4 bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 text-white font-semibold rounded-xl shadow-lg shadow-blue-500/25 transition-all text-center"},{default:h(()=>[y(a(t.$t("sudokumaker.page.sharePage.createOwn")||"Create Your Own"),1)]),_:1})])])):m("",!0)]),_:1})])),(u(),$(V,{to:"body"},[i(L,{name:"modal"},{default:h(()=>[w.value?(u(),c("div",Ye,[r("div",Je,[r("div",We,[i(b(me),{class:"w-10 h-10 text-blue-500"})]),r("h3",qe,a(t.$t("sudokumaker.page.paused.title")||"Paused"),1),r("p",Qe,a(t.$t("sudokumaker.page.paused.message")||"Take a break!"),1),r("button",{onClick:J,class:"w-full py-3 px-4 bg-blue-600 hover:bg-blue-500 text-white font-semibold rounded-xl transition-all"},a(t.$t("sudokumaker.page.buttons.resume")||"Resume"),1)])])):m("",!0)]),_:1})]))])])}}};export{gt as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.