1import{b as R}from"./B1ANI7s_.js";import{c as v}from"./DFwrOiIh.js";import{g}from"./dQh_cajN.js";import{d as u}from"./B9BvQYN_.js";import{_ as B}from"./DlAUqK2U.js";import{a as x}from"./CrfJppij.js";import{V as P}from"./6nf4KObW.js";import{r as i,B as m,o as j,c as q,b as c,w as p,a as h,ak as b,H as t,ae as E,aj as H,G as K,n as D}from"./C--HIF4D.js";import"./COzyvX5r.js";const L=["innerHTML"],O={__name:"Tashi",props:{params:Object},emits:["answer"],setup(w,{expose:k,emit:y}){const e=w,o=i(0),l=i(0),r=i(0),d=i(null),f=m(()=>{const a=o.value<0?`(${o.value})`:o.value,s=l.value<0?`(${l.value})`:l.value;return`${a}+${s}`}),T=m(()=>[a=>!!a||"å
¥ãã¦ï¼"]),M=m(()=>{const a=String(Math.max(e.params.augend_max,e.params.addend_max)).length;return`width: ${60+e.params.decimal_place*40+a*40}px;`}),S=m(()=>{const a=String(Math.max(e.params.augend_max,e.params.addend_max)).length,s=96-(e.params.decimal_place+a)*10,n=u.isMobile()?.7:1;return`font-size: ${s*n}px;`}),V=async()=>{o.value="",l.value="",r.value="",z(),await D(()=>d.value.focus())},z=()=>{const a=()=>{for(;;){const s=g.randomNum(e.params.augend_min,e.params.augend_max,e.params.decimal_place),n=g.randomNum(e.params.addend_min,e.params.addend_max,e.params.decimal_place);if(e.params.kuriagari==0&&!v.kuriagari(s,n)||e.params.kuriagari==1||e.params.kuriagari==2&&v.kuriagari(s,n))return[s,n]}};[o.value,l.value]=a()},N=()=>{const a=Math.round((o.value+l.value)*10**e.params.decimal_place)/10**e.params.decimal_place,s=a==r.value;return{question:f.value,true_answer:a,your_answer:r.value,is_correct:s,augend:o.value,addend:l.value}},_=y,$=a=>{if(a.key=="Enter"&&r.value)return _("answer")},C=R();return k({start:V,checkAnswer:N,onTouchPanelPress:a=>{r.value===null&&(r.value=""),a=="C"?r.value="":a==="answer"?_("answer"):r.value+=a,d.value.focus()}}),(a,s)=>(j(),q("div",null,[c(x,{class:E(["my-2 text-center",{"py-2":t(u).isMobile(),"text-h2":!t(u).isMobile()}])},{default:p(()=>[h("span",{style:b(t(S)),innerHTML:t(f)},null,12,L)]),_:1},8,["class"]),c(x,null,{default:p(()=>[c(P,{class:"justify-center mb-2"},{default:p(()=>[h("div",{style:b(t(M))},[c(H,{ref_key:"answerRef",ref:d,onKeydown:$,modelValue:t(r),"onUpdate:modelValue":s[0]||(s[0]=n=>K(r)?r.value=n:null),label:"å",class:"text-h3 answer","hide-spin-buttons":"",variant:"outlined",rules:t(T),readonly:t(u).isMobileOrTablet()&&!t(C).isEnableKeyboard},null,8,["modelValue","rules","readonly"])],4)]),_:1})]),_:1})]))}},Z=B(O,[["__scopeId","data-v-86cabef9"]]);export{Z 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.