1import{b as H}from"./B1ANI7s_.js";import{g as M}from"./dQh_cajN.js";import{d as s}from"./B9BvQYN_.js";import{_ as L}from"./DlAUqK2U.js";import{a as k}from"./CrfJppij.js";import{V as O}from"./6nf4KObW.js";import{r as d,B as p,o as W,c as D,b as c,w as _,a as x,H as r,ak as h,aj as V,ae as $,n as P}from"./C--HIF4D.js";import"./COzyvX5r.js";const Q=["innerHTML"],U={__name:"WariAmari",props:{params:Object},emits:["answer"],setup(R,{expose:T,emit:S}){const o=R,l=d(""),u=d(""),t=d({quotient:"",remainder:""}),m=d(null),v=d(null),z={quotient:m,remainder:v},f=p(()=>o.params.decimal_place[0]+o.params.decimal_place[1]),b=p(()=>`${l.value}÷${u.value}`),y=[e=>!!e||"å
¥ãã¦ï¼"],w=p(()=>{const e=String(Math.max(o.params.dividend_max,o.params.divisor_max)).length;return`width: ${60+f.value*20+e*20}px;`}),E=p(()=>{const e=String(Math.max(o.params.dividend_max,o.params.divisor_max)).length,a=96-(f.value+e)*10,n=s.isMobile()?.7:1;return`font-size: ${a*n}px;`}),K=async()=>{l.value="",u.value="",t.value.quotient="",t.value.remainder="",N(),await P(()=>m.value.focus())},N=()=>{const e=()=>{for(;;)try{const a=M.randomNum(o.params.dividend_min,o.params.dividend_max,o.params.decimal_place[0]),n=M.randomNum(o.params.divisor_min,o.params.divisor_max,o.params.decimal_place[1]);if(o.params.quotient_min<=a/n&&a/n<=o.params.quotient_max)return[a,n]}catch(a){console.log(a);return}};[l.value,u.value]=e()},A=()=>{const e=10**f.value,a=Math.round(l.value*e%(u.value*e))/e,n=Math.round((l.value-a)/u.value*e)/e,j=n==t.value.quotient&&a==t.value.remainder;return{question:`${b.value}`,true_answer:`${n}ãã¾ã${a}`,your_answer:`${t.value.quotient}ãã¾ã${t.value.remainder}`,is_correct:j,dividend:l.value,divisor:u.value,true_quotient:n,true_remainder:a,your_quotient:t.value.quotient,your_remainder:t.value.remainder}},q=S,C=e=>{if(e.key=="Enter"||e.key=="ArrowRight")return v.value.focus()},B=e=>{if(e.key=="Enter"&&t.value.quotient&&t.value.remainder)return q("answer");if(e.key=="Enter"||e.key=="ArrowLeft")return m.value.focus()},i=d("quotient"),F=e=>{t.value[i.value]||(t.value[i.value]=""),e=="C"?t.value[i.value]="":e==="answer"?q("answer"):t.value[i.value]+=e,z[i.value].value.focus()},g=H();return T({start:K,checkAnswer:A,onTouchPanelPress:F}),(e,a)=>(W(),D("div",null,[c(k,{class:"mb-2 text-center"},{default:_(()=>[x("span",{innerHTML:r(b),style:h(r(E))},null,12,Q)]),_:1}),c(k,null,{default:_(()=>[c(O,{class:"justify-center mb-2"},{default:_(()=>[x("div",{class:"mr-4",style:h(r(w))},[c(V,{ref_key:"quotientRef",ref:m,onFocus:a[0]||(a[0]=n=>i.value="quotient"),onKeydown:C,modelValue:r(t).quotient,"onUpdate:modelValue":a[1]||(a[1]=n=>r(t).quotient=n),label:"å",class:$(["text-h3 answer",{"text-h3":!r(s).isMobile(),"text-h5":r(s).isMobile()}]),height:r(s).isMobile()?60:100,"hide-spin-buttons":"",variant:"outlined",rules:y,readonly:r(s).isMobileOrTablet()&&!r(g).isEnableKeyboard},null,8,["modelValue","class","height","readonly"])],4),x("div",{style:h(r(w))},[c(V,{ref_key:"remainderRef",ref:v,onFocus:a[2]||(a[2]=n=>i.value="remainder"),onKeydown:B,modelValue:r(t).remainder,"onUpdate:modelValue":a[3]||(a[3]=n=>r(t).remainder=n),label:"ä½ã",class:$(["text-h3 answer text-right",{"text-h3":!r(s).isMobile(),"text-h5":r(s).isMobile()}]),height:r(s).isMobile()?60:100,"hide-spin-buttons":"",variant:"outlined",rules:y,readonly:r(s).isMobileOrTablet()&&!r(g).isEnableKeyboard},null,8,["modelValue","class","height","readonly"])],4)]),_:1})]),_:1})]))}},re=L(U,[["__scopeId","data-v-f61d5ae1"]]);export{re 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.