@ihabdevteam/core 0.147.0 → 0.148.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/utils.cjs.js CHANGED
@@ -17,4 +17,4 @@
17
17
  \uC124\uCE58 \uBA85\uB839\uC5B4 (\uC2A4\uD1A0\uB9AC\uC9C0 SDK \uBBF8\uC124\uCE58 \uC2DC):
18
18
  npm install @supabase/supabase-js
19
19
  pnpm add @supabase/supabase-js
20
- `),this.name="StorageNotConfiguredError"}};function Gt(e){vt(e)}function Ft(e,n){if(!e)return null;const t=Z();return t?.resolvePath?t.resolvePath(e,n):n?`${n}/${e}.mp3`:null}async function An(e){if(!e)return!1;const n=Z();if(!n)throw new Ue("fileExists");if(n.exists)return n.exists(e);try{return await n.resolveUrl(e)!==null}catch{return!1}}async function wn(e){if(!e)return null;const n=Z();if(!n)throw new Ue("getSignedOrPublicUrl");try{return await n.resolveUrl(e)}catch{return null}}async function xt(e){const n=Z();if(!n)throw new Ue("downloadSound");return n.download(e)}function Wt(){return Z()?.noiseBaseUrl??"/sounds/noise"}function Yt(){const e=Number(Z()?.noiseFileGain);return Number.isFinite(e)&&e>0?e:1}function Ht(e){const n=AbortSignal.timeout;if(typeof n=="function")return n.call(AbortSignal,e);const t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal}const Ve="__ihab_core_tts_config__";function Kt(e){globalThis[Ve]=e}function Ut(){return globalThis[Ve]?.urlResolver??null}function Vt(){return globalThis[Ve]?.fallbackUrlResolver??null}const zt=new Map;function Jt(){zt.clear()}const bn="__ihab_core_pronunciation_resolver__";function qt(e){globalThis[bn]=e}function Qt(){return globalThis[bn]??null}let K=null;const ie=new WeakMap,ze=new WeakMap,Je=new WeakMap;let _n=!1;const Bn=e=>Math.max(0,Math.min(1,Number.isFinite(e)?e:0));function Zt(){if(_n||typeof document>"u")return;_n=!0;const e=()=>{try{K&&K.state!=="running"&&K.resume()}catch{}};for(const n of["pointerdown","touchend","keydown"])document.addEventListener(n,e,{capture:!0,passive:!0})}function Nn(){if(K)return K;try{const e=window.AudioContext||window.webkitAudioContext;return e?(K=new e,Zt(),K):null}catch{return null}}function Xt(){try{K?.resume()}catch{}}function qe(e,n){const t=ie.get(n);if(t)return t;try{const o=e.createMediaElementSource(n),r=e.createGain(),i=e.createAnalyser();i.fftSize=1024,i.smoothingTimeConstant=.6,r.gain.value=Bn(ze.get(n)??n.volume),o.connect(r),r.connect(i),r.connect(e.destination);try{n.volume=1}catch{}const u={gain:r,analyser:i};return ie.set(n,u),u}catch{return null}}function Ln(e){if(!e)return Promise.resolve(null);const n=ie.get(e);if(n)return Promise.resolve(n.analyser);const t=Nn();if(!t)return Promise.resolve(null);if(t.state==="running")return Promise.resolve(qe(t,e)?.analyser??null);const o=Je.get(e);if(o)return o;const r=Promise.resolve().then(()=>t.resume()).then(()=>t.state==="running"?qe(t,e)?.analyser??null:null).catch(()=>null).finally(()=>{Je.delete(e)});return Je.set(e,r),r}function eo(e){if(!e)return null;const n=ie.get(e);if(n)return n.analyser;const t=Nn();return t?t.state==="running"?qe(t,e)?.analyser??null:(Ln(e),null):null}function no(e,n){const t=Bn(n);ze.set(e,t);const o=ie.get(e);if(o){try{e.volume!==1&&(e.volume=1)}catch{}const r=o.gain.gain;try{const i=o.gain.context.currentTime;r.cancelScheduledValues(i),r.setTargetAtTime(t,i,.01)}catch{try{r.value=t}catch{}}return"gain"}try{e.volume=t}catch{}return"element"}function to(e){return ze.get(e)??e.volume}function oo(e,n){e.getFloatTimeDomainData(n);let t=0;for(let o=0;o<n.length;o++){const r=n[o];t+=r*r}return Math.sqrt(t/n.length)}const jn="__ihab_core_image_config__";function uo(e){globalThis[jn]=e}function Rn(){return globalThis[jn]??null}const ae="word_image_existence_map_v1";let M=null,se=0,On=-1,le=null;const Ne=new Map;function ce(){if(M)return M;try{const e=typeof localStorage<"u"?localStorage.getItem(ae):null,n=e?JSON.parse(e):null;M=n&&typeof n=="object"&&!Array.isArray(n)?n:{}}catch{M={}}return M}let Qe=null;function ro(){Qe||(Qe=setTimeout(()=>{Qe=null;try{typeof localStorage<"u"&&M&&localStorage.setItem(ae,JSON.stringify(M))}catch{}},200))}function Le(e,n){return`${e}_${n??1}`}async function kn(e,n){const t=ce(),o=Le(e,n);if(o in t)return t[o];if(Ne.has(o))return Ne.get(o);const r=Rn();if(!r)return!1;const i=r(e,n);if(!i)return!1;const u=fetch(i,{method:"HEAD",signal:Ht(8e3)}).then(a=>a.status>=500?null:a.ok,()=>null).then(a=>(Ne.delete(o),a===null?!1:(t[o]=a,se++,ro(),a)));return Ne.set(o,u),u}function io(e,n){const t=ce(),o=Le(e,n);return o in t?t[o]:void 0}async function ao(e,n={}){const{force:t=!1,concurrency:o=16,onProgress:r}=n,i=ce(),u=t?Array.from(new Set(e)):Array.from(new Set(e)).filter(l=>!(Le(l)in i));let a=0;if(u.length>0){let l=0;const c=Array.from({length:Math.min(o,u.length)},async()=>{for(;l<u.length;){const C=l++,s=u[C],g=Le(s);if(!t&&g in i){a++,r?.(a,u.length);continue}try{await kn(s)}catch{}a++,r?.(a,u.length)}});await Promise.all(c)}try{typeof localStorage<"u"&&M&&localStorage.setItem(ae,JSON.stringify(M))}catch{}return{checked:u.length,cached:Object.keys(i).length,total:e.length}}function so(){const e=ce();if(On===se)return le?{...le}:null;const n=Object.values(e);return le=n.length===0?null:{total:n.length,exists:n.filter(Boolean).length},On=se,le?{...le}:null}function lo(e){const n=ce();Object.assign(n,e),se++;try{typeof localStorage<"u"&&localStorage.setItem(ae,JSON.stringify(n))}catch{}}function co(){M={},se++;try{typeof localStorage<"u"&&localStorage.removeItem(ae)}catch{}}const A=["\u3131","\u3132","\u3134","\u3137","\u3138","\u3139","\u3141","\u3142","\u3143","\u3145","\u3146","\u3147","\u3148","\u3149","\u314A","\u314B","\u314C","\u314D","\u314E"],b=["\u314F","\u3150","\u3151","\u3152","\u3153","\u3154","\u3155","\u3156","\u3157","\u3158","\u3159","\u315A","\u315B","\u315C","\u315D","\u315E","\u315F","\u3160","\u3161","\u3162","\u3163"],B=["","\u3131","\u3132","\u3133","\u3134","\u3135","\u3136","\u3137","\u3139","\u313A","\u313B","\u313C","\u313D","\u313E","\u313F","\u3140","\u3141","\u3142","\u3144","\u3145","\u3146","\u3147","\u3148","\u314A","\u314B","\u314C","\u314D","\u314E"];function S(e){if(!e)return null;const n=e.charCodeAt(0)-44032;return n<0||n>=11172?null:{cho:Math.floor(n/588),jung:Math.floor(n%588/28),jong:n%28}}function Co(){const e=new Map;return n=>{let t=e.get(n);return t||(t=[...n].map(o=>S(o)),e.set(n,t)),t}}function x(e,n,t=0){return String.fromCharCode(44032+(e*21+n)*28+t)}function go(e,n){if(!e||!n||e===n||e.length!==n.length)return"random";let t=0,o=null;for(let r=0;r<e.length;r++){const i=S(e[r]),u=S(n[r]);if(!i||!u)return"random";if(i.cho===u.cho&&i.jung===u.jung&&i.jong===u.jong)continue;t++;const a=i.cho!==u.cho,l=i.jung!==u.jung,c=i.jong!==u.jong;(a?1:0)+(l?1:0)+(c?1:0)>1?o="multi":a?o="cho":l?o="jung":o="jong"}return t!==1?"random":o==="cho"?"cho":o==="jung"?"jung":o==="jong"?"jong":"random"}function In(e){const n=S(e[0]||"");return n?A[n.cho]:""}function $n(e){return[...e].map(n=>{const t=S(n);return t?A[t.cho]:n}).join("")}function Pn(e){return!!e&&[...e].every(n=>A.includes(n))}function fo(e,n){return n?(e=e.normalize("NFC"),n=n.normalize("NFC"),Pn(n)?$n(e).includes(n):e.toLowerCase().includes(n.toLowerCase())):!0}function ho(e,n){return Mn(n)(e)}function Mn(e){if(!e)return()=>!0;e=e.normalize("NFC");const n=[...e],t=u=>A.includes(u),o=u=>b.includes(u),r=n.map(u=>t(u)?"cho":o(u)?"jung":S(u)?"syl":"other"),i=n.map(u=>S(u));if(r.includes("other")){const u=e.toLowerCase();return a=>a.normalize("NFC").toLowerCase().includes(u)}return u=>{const a=[...u.normalize("NFC")];for(let l=0;l+n.length<=a.length;l++){let c=!0;for(let C=0;C<n.length;C++){const s=a[l+C],g=r[C];if(g==="cho"){if(In(s)!==n[C]){c=!1;break}}else if(g==="jung"){const h=S(s);if(!h||b[h.jung]!==n[C]){c=!1;break}}else{const h=i[C];if(h&&h.jong===0){const m=S(s);if(!m||m.cho!==h.cho||m.jung!==h.jung){c=!1;break}}else if(s!==n[C]){c=!1;break}}}if(c)return!0}return!1}}const je={3:["\u3131","\u3145"],5:["\u3134","\u3148"],6:["\u3134","\u314E"],9:["\u3139","\u3131"],10:["\u3139","\u3141"],11:["\u3139","\u3142"],12:["\u3139","\u3145"],13:["\u3139","\u314C"],14:["\u3139","\u314D"],15:["\u3139","\u314E"],18:["\u3142","\u3145"]},vn=Object.fromEntries(Object.entries(je).map(([e,n])=>[n.join(""),B[Number(e)]]));function mo(e,n){if(!e||!n)return!1;for(const t of e){const o=S(t);if(o&&A[o.cho]===n)return!0}return!1}function So(e,n){if(!e||!n)return!1;for(const t of e){const o=S(t);if(o&&b[o.jung]===n)return!0}return!1}function yo(e,n){if(!e||!n)return!1;for(const t of e){const o=S(t);if(!o||o.jong<=0)continue;if(B[o.jong]===n)return!0;const r=je[o.jong];if(r&&r.includes(n))return!0}return!1}function Do(e){if(!e)return 0;let n=0;for(const t of e)S(t)&&n++;return n}function Eo(e){if(!e)return!1;let n=!1;for(const t of e){const o=S(t);if(o&&(n=!0,o.jong>0))return!1}return n}function To(e,n){if(e.jong<=0)return!1;if(n.includes(B[e.jong]))return!0;const t=je[e.jong];return!!t&&t.some(o=>n.includes(o))}function po(e,n,t){if(!e)return!1;const o=[...e],r=i=>{const u=S(o[i]);if(!u||n.cho&&!n.cho.includes(A[u.cho])||n.jung&&!n.jung.includes(b[u.jung]))return!1;if(n.jongNone){if(u.jong>0)return!1}else if(n.jong&&!To(u,n.jong))return!1;return!0};if(t==="head")return r(0);if(t==="tail")return r(o.length-1);if(t==="mid"){for(let i=1;i<o.length-1;i++)if(r(i))return!0;return!1}for(let i=0;i<o.length;i++)if(r(i))return!0;return!1}function Gn(e){return e.includes(",")||e.includes("_")}function Fn(e){if(e==="")return[{kind:"any"}];if(e.includes("_")){const n=[...e];if(n.length>4)return[{kind:"invalid"}];const t=n[0]??"_",o=n[1]??"_";let r=n.slice(2).join("");if(r.length===2){const i=vn[r];if(!i)return[{kind:"invalid"}];r=i}return[{kind:"template",cho:t,jung:o,jong:r||"_"}]}return[...e].map(n=>S(n)?{kind:"syllable",ch:n}:A.includes(n)?{kind:"cho",jamo:n}:b.includes(n)?{kind:"jung",jamo:n}:{kind:"invalid"})}function Ao(e,n){switch(n.kind){case"any":return!0;case"syllable":{const t=S(n.ch);if(!t)return e===n.ch;if(t.jong===0){const o=S(e);return!!o&&o.cho===t.cho&&o.jung===t.jung}return e===n.ch}case"cho":{const t=S(e);return!!t&&A[t.cho]===n.jamo}case"jung":{const t=S(e);return!!t&&b[t.jung]===n.jamo}case"template":{const t=S(e);return!(!t||n.cho!=="_"&&A[t.cho]!==n.cho||n.jung!=="_"&&b[t.jung]!==n.jung||n.jong!=="_"&&B[t.jong]!==n.jong)}case"invalid":return!1}}function xn(e,n){e=e.normalize("NFC"),n=n.normalize("NFC");const t=n.split(",").flatMap(r=>Fn(r.trim()));if(t.length===0)return!0;const o=[...e];if(o.length<t.length)return!1;for(let r=0;r+t.length<=o.length;r++)if(t.every((i,u)=>Ao(o[r+u],i)))return!0;return!1}function wo(e){const n=e.split(",").flatMap(i=>Fn(i.trim())),t=new Set,o=new Set,r=new Set;for(const i of n)switch(i.kind){case"cho":t.add(i.jamo);break;case"jung":o.add(i.jamo);break;case"template":i.cho!=="_"&&t.add(i.cho),i.jung!=="_"&&o.add(i.jung),i.jong!=="_"&&r.add(i.jong);break;case"syllable":{const u=S(i.ch);u&&(t.add(A[u.cho]),o.add(b[u.jung]),u.jong!==0&&r.add(B[u.jong]));break}}return t.size===0&&o.size===0&&r.size===0?null:{cho:t.size?[...t]:null,jung:o.size?[...o]:null,jong:r.size?[...r]:null}}function bo(e){return!!S(e)||A.includes(e)||b.includes(e)}function _o(e){const n=e.normalize("NFC").trim();if(!n)return{ok:!0};for(const t of n.split(",")){const o=t.trim();if(o!==""){if(o.includes("_")){const r=[...o];if(r.length>4)return{ok:!1};const i=r[0],u=r[1],a=r.slice(2).join(""),l=i===void 0||i==="_"||A.includes(i),c=u===void 0||u==="_"||b.includes(u),C=a===""||a==="_"||B.filter(Boolean).includes(a)||!!vn[a];if(l&&c&&C)continue;return{ok:!1}}if(![...o].every(bo))return{ok:!1}}}return{ok:!0}}A.length,b.length,B.length;function Bo(e,n){const t=n.normalize("NFC").trim();if(!t||!/[^\s,_]/.test(t))return e;if(Gn(t))return e.filter(l=>xn(l.word,t));const o=Mn(t),r=[...t].length,i=l=>!!l&&o(l.normalize("NFC").slice(0,r)),u=[],a=[];for(const l of e)(o(l.word)||o(l.pronunciation??""))&&(i(l.word)||i(l.pronunciation??"")?u:a).push(l);return u.concat(a)}const Ze="word_pair_index_v2",Xe="word_pair_index_sig_v2";let v=null,Ce=null;function Wn(){try{if(typeof localStorage>"u")return null;const e=localStorage.getItem(Ze),n=localStorage.getItem(Xe);return!e||!n?null:{index:JSON.parse(e),sig:n}}catch{return null}}function No(e,n){try{if(typeof localStorage>"u")return;localStorage.setItem(Ze,JSON.stringify(e)),localStorage.setItem(Xe,n)}catch{}}function Lo(e){const n=e.map(o=>`${o.word}|${o.pron??""}`).sort();let t=0;for(const o of n)for(let r=0;r<o.length;r++)t=(t<<5)-t+o.charCodeAt(r)|0;return`${n.length}-${t}`}async function jo(e,n){const t=new Set,o=[];for(const c of e){if(!c.word||t.has(c.word))continue;const C=c.pron||c.word,s=Array.from(C).map(S);s.some(g=>g===null)||s.length===Array.from(c.word).length&&(t.add(c.word),o.push({word:c.word,syls:s}))}const r={},i=o.length,u=new Map;for(const c of o){const C=c.syls.length;u.has(C)||u.set(C,[]),u.get(C).push(c)}let a=0;const l=["cho","jung","jong"];for(const c of u.values()){const C=c[0].syls.length;for(let s=0;s<C;s++)for(const g of l){const h=new Map;for(const m of c){let y="";for(let f=0;f<C;f++){f>0&&(y+="~");const d=m.syls[f];f===s?g==="cho"?y+=`*:${d.jung}:${d.jong}`:g==="jung"?y+=`${d.cho}:*:${d.jong}`:y+=`${d.cho}:${d.jung}:*`:y+=`${d.cho}:${d.jung}:${d.jong}`}let D=h.get(y);D||(D=[],h.set(y,D)),D.push(m)}for(const m of h.values())if(!(m.length<2))for(let y=0;y<m.length;y++){const D=m[y];for(let f=y+1;f<m.length;f++){const d=m[f];D.syls[s][g]!==d.syls[s][g]&&(r[D.word]||(r[D.word]={cho:[],jung:[],jong:[]}),r[d.word]||(r[d.word]={cho:[],jung:[],jong:[]}),r[D.word][g].push(d.word),r[d.word][g].push(D.word))}}}a+=c.length,n?.(a,i),await new Promise(s=>setTimeout(s,0))}return i>0&&n?.(i,i),r}let en=0;async function Ro(e,n={}){const t=Lo(e);if(!n.force){if(v&&Ce===t)return v;const i=Wn();if(i&&i.sig===t)return v=i.index,Ce=t,v}const o=++en,r=await jo(e,n.onProgress);return o===en&&(v=r,Ce=t,No(r,t)),r}function Yn(){if(v)return v;const e=Wn();return e?(v=e.index,Ce=e.sig,v):null}function Oo(){en+=1,v=null,Ce=null;try{typeof localStorage<"u"&&(localStorage.removeItem(Ze),localStorage.removeItem(Xe))}catch{}}const nn={cho:A,jung:b,jong:B},k=e=>Array.isArray(e)?e.length>0:!!e;function tn(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++){const o=e[t],r=n[t];if(!(!o||!r)&&(o.cho!==r.cho&&A[o.cho]==="\u3147"!=(A[r.cho]==="\u3147")||o.jong!==r.jong&&o.jong===0!=(r.jong===0)))return!0}return!1}function Hn(e,n,t){const o=t.pronOf(e),r=t.decompOf,i=t.sameStructureOnly&&r?r(o):null,u=[];for(const a of n)a!==e&&(t.okSet&&!t.okSet.has(a)||t.pronOf(a)!==o&&(i&&r&&tn(i,r(t.pronOf(a)))||u.push(a)));return u}function ko(e,n,t){const o=n?.[e];if(!o)return[];const r=t.kind?o[t.kind]??[]:[...o.cho??[],...o.jung??[],...o.jong??[]];return Hn(e,r,t)}function Io(e,n,t,o,r,i,u){const a=["cho","jung","jong"].filter(g=>k(e[g])),l={};for(const g of a){const h=e[g];l[g]=new Set(Array.isArray(h)?h:[h])}const c=r==="pron",C=new Map;for(const g of n){const h=t(i(g));if(h.some(f=>!f))continue;let m=h;if(!c&&(m=t(g),m.length!==h.length||m.some(f=>!f)))continue;const y=h.length,D=C.get(y);D?D.push({w:g,dPron:h,dPos:m}):C.set(y,[{w:g,dPron:h,dPos:m}])}const s=new Map;for(const[g,h]of C){const m=new Map,y=(D,f)=>{const d=D.dPos[f];return d!=null&&a.every(E=>l[E].has(nn[E][d[E]]))};for(const D of h){let f;if(u==="head")f=y(D,0)?0:-1;else if(u==="tail")f=y(D,g-1)?g-1:-1;else if(u==="mid"){f=-1;for(let E=1;E<g-1;E++)if(y(D,E)){f=E;break}}else f=D.dPos.findIndex(E=>E!=null&&a.every(p=>l[p].has(nn[p][E[p]])));if(f<0)continue;const d=m.get(f);d?d.push(D):m.set(f,[D])}for(const[D,f]of m){const d=a.includes("cho"),E=a.includes("jung"),p=a.includes("jong"),P=w=>{let j="";for(let O=0;O<g;O++){const T=w[O];O===D?j+=(d?"*":T.cho)+"."+(E?"*":T.jung)+"."+(p?"*":T.jong)+".":j+=T.cho+"."+T.jung+"."+T.jong+"."}return j},L=new Map;for(const w of h){const j=P(w.dPron),O=L.get(j);O?O.push(w):L.set(j,[w])}for(const w of f){const j=L.get(P(w.dPron))??[],O=[];for(const T of j){if(T.w===w.w)continue;let I=!0;for(const F of a){const Q=w.dPron[D][F],z=T.dPron[D][F];if(z===Q){I=!1;break}if(c&&l[F].has(nn[F][z])){I=!1;break}}I&&(o&&tn(w.dPron,T.dPron)||O.push(T.w))}s.set(w.w,O)}}}return s}const Re=0,Kn=1,J=2,on=3,$o=4,Oe=5,un=6,ke=7,Po=8,rn=9,X=10,Mo=11,ge=12,vo=13,de=14,Ie=15,$e=16,fe=17,Go=18,$=0,W=1,Fo=3,U=4,an=5,he=6,G=7,_=8,Un=9,Vn=10,Pe=11,zn=12,sn=13,ee=15,Me=16,Y=17,Jn=18,ln=21,cn=27,xo=20,Wo={1:Re,2:Kn,4:J,7:on,8:Oe,16:un,17:ke,19:rn,20:X,22:ge,23:de,24:Ie,25:$e,26:fe},Yo={[Fo]:[W,X],[an]:[U,ge],[Un]:[_,Re],[Vn]:[_,un],[Pe]:[_,ke],[zn]:[_,X],[sn]:[_,$e],14:[_,fe],[Jn]:[Y,X]},Ho={[he]:J,[ee]:Oe},Cn={2:W,24:W,3:W,9:W,5:U,6:U,19:G,20:G,22:G,23:G,25:G,27:G,11:_,12:_,13:_,15:_,10:Me,14:Y,18:Y,26:Y},qn={[Re]:Ie,[on]:$e,[ke]:fe,[ge]:de},Qn={[Re]:Kn,[on]:$o,[ke]:Po,[rn]:X,[ge]:vo},Ko=new Set([an,Vn,Pe,zn,sn,ee,Jn]),Uo=new Set(["\uBC1F"]);function Vo(e){const n=(e??"").trim();if(!n)return"";const t=[...n],o=t.map(S);if(o.some(i=>i===null))return n;const r=o;for(let i=0;i<r.length;i++){const u=r[i],a=r[i+1],l=u.jong;if(!a){u.jong=Cn[u.jong]??u.jong;break}if(u.jong===$)continue;if(a.cho===Mo){if(a.jung===xo){if(u.jong===G){u.jong=$,a.cho=ge;continue}if(u.jong===25){u.jong=$,a.cho=de;continue}if(u.jong===sn){u.jong=_,a.cho=de;continue}}if(u.jong===cn){u.jong=$;continue}const C=Ho[u.jong];if(C!==void 0){u.jong=$,a.cho=C;continue}const s=Yo[u.jong];if(s){u.jong=s[0],a.cho=s[1];continue}const g=Wo[u.jong];g!==void 0&&(u.jong=$,a.cho=g);continue}if((u.jong===cn||u.jong===he||u.jong===ee)&&qn[a.cho]!==void 0){a.cho=qn[a.cho],u.jong=u.jong===he?U:u.jong===ee?_:$;continue}if((u.jong===cn||u.jong===he||u.jong===ee)&&a.cho===rn){a.cho=X,u.jong=u.jong===he?U:u.jong===ee?_:$;continue}if(a.cho===Go){if(u.jong===an){u.jong=U,a.cho=de;continue}if(u.jong===Un){u.jong=_,a.cho=Ie;continue}if(u.jong===Pe){u.jong=_,a.cho=fe;continue}const C=Cn[u.jong]??u.jong;if(C===W){u.jong=$,a.cho=Ie;continue}if(C===G){u.jong=$,a.cho=$e;continue}if(C===Y){u.jong=$,a.cho=fe;continue}}let c=Cn[u.jong]??u.jong;l===Pe&&Uo.has(t[i])&&(c=Y),u.jong=c,Qn[a.cho]!==void 0&&(c===W||c===G||c===Y||Ko.has(l))&&(a.cho=Qn[a.cho]),(a.cho===J||a.cho===un)&&(u.jong===W?u.jong=ln:u.jong===G?u.jong=U:u.jong===Y&&(u.jong=Me)),a.cho===Oe?u.jong===U?u.jong=_:u.jong===Me||u.jong===ln?a.cho=J:u.jong===W?(u.jong=ln,a.cho=J):u.jong===Y&&(u.jong=Me,a.cho=J):u.jong===_&&a.cho===J&&(a.cho=Oe)}return r.map(i=>x(i.cho,i.jung,i.jong)).join("")}const zo={\u3131:"\u3131",\u3132:"\u3131",\u314B:"\u3131",\u3133:"\u3131",\u313A:"\u3131",\u3134:"\u3134",\u3135:"\u3134",\u3136:"\u3134",\u3137:"\u3137",\u3145:"\u3137",\u3146:"\u3137",\u3148:"\u3137",\u314A:"\u3137",\u314C:"\u3137",\u314E:"\u3137",\u3139:"\u3139",\u313C:"\u3139",\u313D:"\u3139",\u313E:"\u3139",\u3140:"\u3139",\u3141:"\u3141",\u313B:"\u3141",\u3142:"\u3142",\u314D:"\u3142",\u313F:"\u3142",\u3144:"\u3142",\u3147:"\u3147"};function Zn(e){return zo[e]??e}const ne=/[ㄱ-ㅎ]/,Jo=/[ㅏ-ㅣ]/;function me(e){e=e.normalize("NFC");for(let n=e.length-1;n>=0;n--){const t=e[n],o=t.charCodeAt(0);if(o>=44032&&o<=55203||ne.test(t)||Jo.test(t))return t}return null}function Xn(e){const n=me(e);if(!n)return"\uAC00";const t=n.charCodeAt(0);return t>=44032&&t<=55203?(t-44032)%28!==0?"\uC774":"\uAC00":ne.test(n)?"\uC774":"\uAC00"}function qo(e){return`${e}${Xn(e)}`}function et(e){const n=me(e);if(!n)return"\uB97C";const t=n.charCodeAt(0);return t>=44032&&t<=55203?(t-44032)%28!==0?"\uC744":"\uB97C":ne.test(n)?"\uC744":"\uB97C"}function Qo(e){return`${e}${et(e)}`}function nt(e){const n=me(e);if(!n)return"\uB294";const t=n.charCodeAt(0);return t>=44032&&t<=55203?(t-44032)%28!==0?"\uC740":"\uB294":ne.test(n)?"\uC740":"\uB294"}function Zo(e){return`${e}${nt(e)}`}function tt(e){const n=me(e);if(!n)return"\uC640";const t=n.charCodeAt(0);return t>=44032&&t<=55203?(t-44032)%28!==0?"\uACFC":"\uC640":ne.test(n)?"\uACFC":"\uC640"}function Xo(e){return`${e}${tt(e)}`}function ot(e){const n=me(e);if(!n)return"\uB85C";const t=n.charCodeAt(0);if(t>=44032&&t<=55203){const o=(t-44032)%28;return o===0||o===8?"\uB85C":"\uC73C\uB85C"}return n==="\u3139"?"\uB85C":ne.test(n)?"\uC73C\uB85C":"\uB85C"}function eu(e){return`${e}${ot(e)}`}function nu(e,n,t){const o=e.slice(),[r]=o.splice(n,1);return o.splice(t,0,r),o}function R(e,n=Math.random){const t=e.slice();for(let o=t.length-1;o>0;o--){const r=Math.floor(n()*(o+1));[t[o],t[r]]=[t[r],t[o]]}return t}function H(e,n,t=Math.random){return!Array.isArray(e)||e.length===0||n<=0?[]:n>=e.length?R(e,t):R(e,t).slice(0,n)}const ut={SAME_SOUND_PICK:{difficulty:!0,choseong:!0,group:"discrimination"},SAME_OR_DIFF:{difficulty:!0,choseong:!0,group:"discrimination"},HEAR_AND_PICK_SAME:{difficulty:!0,choseong:!0,group:"discrimination"},HEAR_AND_PICK_INCLUDED:{difficulty:!0,choseong:!0,group:"discrimination"},STARTS_WITH_SAME_SOUND:{difficulty:!1,choseong:!0,group:"discrimination"},LISTEN_AND_REMEMBER_ORDER:{difficulty:!1,choseong:!0,group:"attention"},MERGE_2_SYLLABLES:{difficulty:!1,choseong:!0,group:"synthesis"},MERGE_3_SYLLABLES:{difficulty:!1,choseong:!0,group:"synthesis"},MERGE_2_PHONEMES:{difficulty:!1,choseong:!0,group:"synthesis"},MERGE_3_PHONEMES:{difficulty:!1,choseong:!0,group:"synthesis"},DROP_1_FROM_2SYLL:{difficulty:!1,choseong:!0,group:"deletion"},DROP_1_FROM_3SYLL:{difficulty:!1,choseong:!0,group:"deletion"},DROP_PART_FROM_COMPOUND:{difficulty:!1,choseong:!0,group:"deletion"},DROP_FINAL_CONSONANT_FROM_1SYLL:{difficulty:!1,choseong:!0,group:"deletion"},REMOVE_CONSONANT_AND_IDENTIFY_PHONEME:{difficulty:!1,choseong:!0,group:"deletion"},CHANGE_1_SYLL_IN_2SYLL:{difficulty:!0,choseong:!0,group:"substitution"},CHANGE_1_SYLL_IN_3SYLL:{difficulty:!0,choseong:!0,group:"substitution"},CHANGE_1_PHONEME_IN_1SYLL:{difficulty:!1,choseong:!0,group:"substitution"},CHANGE_1_PHONEME_IN_2SYLL:{difficulty:!0,choseong:!0,group:"substitution"}};function tu(e){const n=e?ut[e]?.group:void 0;return n==="synthesis"||n==="deletion"||n==="substitution"?n:null}const ou=A.indexOf("\u3147"),rt={DROP_FINAL_CONSONANT_FROM_1SYLL:{syllables:1,syllable:e=>e.jong>0},REMOVE_CONSONANT_AND_IDENTIFY_PHONEME:{syllables:1,syllable:e=>e.jong===0&&e.cho!==ou},MERGE_2_SYLLABLES:{syllables:2,syllable:()=>!0},MERGE_3_SYLLABLES:{syllables:3,syllable:()=>!0},MERGE_2_PHONEMES:{syllables:1,syllable:e=>e.jong===0},MERGE_3_PHONEMES:{syllables:1,syllable:e=>e.jong>0&&!je[e.jong]}},uu=new Set([]);function ru(e){return e in rt}function iu(e,n){const t=rt[e];if(!t)return!0;const o=[...n];if(o.length!==t.syllables)return!1;const r=S(o[0]);return!!r&&t.syllable(r)}function au(e){return uu.has(e)}function su(e){const n=e.charCodeAt((e.length||1)-1)||0;return n<44032||n>55203||(n-44032)%28===0?"\uC640":"\uACFC"}function gn(e){const n=e.charCodeAt((e.length||1)-1)||0;return n<44032||n>55203||(n-44032)%28===0?"\uB97C":"\uC744"}function it(e){const n=e.charCodeAt((e.length||1)-1)||0;if(n<44032||n>55203)return"\uB85C";const t=(n-44032)%28;return t===0||t===8?"\uB85C":"\uC73C\uB85C"}function at(e){const n=e.charAt((e.length||1)-1),t=n.charCodeAt(0)||0;return t>=44032&&t<=55203?(t-44032)%28===0?"\uAC00":"\uC774":/[ㄱ-ㅎ]/.test(n)?"\uC774":"\uAC00"}const st={\u3131:"\uAE30\uC5ED",\u3132:"\uC30D\uAE30\uC5ED",\u3134:"\uB2C8\uC740",\u3137:"\uB514\uADFF",\u3138:"\uC30D\uB514\uADFF",\u3139:"\uB9AC\uC744",\u3141:"\uBBF8\uC74C",\u3142:"\uBE44\uC74D",\u3143:"\uC30D\uBE44\uC74D",\u3145:"\uC2DC\uC637",\u3146:"\uC30D\uC2DC\uC637",\u3147:"\uC774\uC751",\u3148:"\uC9C0\uC752",\u3149:"\uC30D\uC9C0\uC752",\u314A:"\uCE58\uC753",\u314B:"\uD0A4\uC754",\u314C:"\uD2F0\uC755",\u314D:"\uD53C\uC756",\u314E:"\uD788\uC757",\u3133:"\uAE30\uC5ED\uC2DC\uC637",\u3135:"\uB2C8\uC740\uC9C0\uC752",\u3136:"\uB2C8\uC740\uD788\uC757",\u313A:"\uB9AC\uC744\uAE30\uC5ED",\u313B:"\uB9AC\uC744\uBBF8\uC74C",\u313C:"\uB9AC\uC744\uBE44\uC74D",\u313D:"\uB9AC\uC744\uC2DC\uC637",\u313E:"\uB9AC\uC744\uD2F0\uC755",\u313F:"\uB9AC\uC744\uD53C\uC756",\u3140:"\uB9AC\uC744\uD788\uC757",\u3144:"\uBE44\uC74D\uC2DC\uC637",\u314F:"\uC544",\u3150:"\uC560",\u3151:"\uC57C",\u3152:"\uC598",\u3153:"\uC5B4",\u3154:"\uC5D0",\u3155:"\uC5EC",\u3156:"\uC608",\u3157:"\uC624",\u3158:"\uC640",\u3159:"\uC65C",\u315A:"\uC678",\u315B:"\uC694",\u315C:"\uC6B0",\u315D:"\uC6CC",\u315E:"\uC6E8",\u315F:"\uC704",\u3160:"\uC720",\u3161:"\uC73C",\u3162:"\uC758",\u3163:"\uC774"};function lu(e){if([...e].length!==1)return[e];const n=S(e);if(!n)return[e];const t=[A[n.cho],b[n.jung]];return n.jong!==0&&t.push(B[n.jong]),t}function lt(e,n=!1){const t=e.filter(Boolean);if(t.length<2)return"";const o=a=>st[a]??a,r=t.slice(0,-1).map(a=>`"${a}"${su(o(a))}`).join(" "),i=t[t.length-1],u=`"${i}"${gn(o(i))}`;return`${r} ${u} \uD569\uCE58\uBA74 \uC5B4\uB5A4 ${n?"\uC18C\uB9AC":"\uB2E8\uC5B4"}\uAC00 \uB418\uB098\uC694?`}function cu(e,n){return lt(n,e==="MERGE_2_PHONEMES"||e==="MERGE_3_PHONEMES")}function Cu(e,n){const t=String(n?.word??n?.original??""),o=String(n?.changedFrom??""),r=String(n?.changedTo??"");return e==="CHANGE_1_PHONEME_IN_1SYLL"?`"${t}"${gn(t)} "${r}"${it(r)} \uBC14\uAFB8\uBA74 \uBB34\uC5C7\uC774 \uB418\uB098\uC694?`:`"${t}"\uC5D0\uC11C "${o}"${gn(o)} "${r}"${it(r)} \uBC14\uAFB8\uBA74 \uBB34\uC5C7\uC774 \uB418\uB098\uC694?`}function gu(e,n){const t=String(n?.word??n?.original??n?.base??""),o=String(n?.dropped??"");if(e==="DROP_FINAL_CONSONANT_FROM_1SYLL")return`"${t}"\uC5D0\uC11C \uBC1B\uCE68\uC774 \uC5C6\uC5B4\uC9C0\uBA74 \uC5B4\uB5A4 \uB9D0\uC774 \uB418\uB098\uC694?`;if(e==="REMOVE_CONSONANT_AND_IDENTIFY_PHONEME"){const r=String(n?.missingConsonant??"");return`"${t}"\uC5D0\uC11C "${r}"${at(r)} \uC5C6\uC5B4\uC9C0\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB418\uB098\uC694?`}return`"${t}"\uC5D0\uC11C "${o}"${at(o)} \uC5C6\uC5B4\uC9C0\uBA74 \uC5B4\uB5A4 \uB9D0\uC774 \uB418\uB098\uC694?`}function du(e,n,t){switch(tu(e)){case"synthesis":return cu(e,t);case"substitution":return Cu(e,n);case"deletion":return gu(e,n);default:return""}}function fu(e){return e.replace(/"([ㄱ-ㅣ])"(으로|와|과|을|를|이|가|은|는|로)?/g,(n,t,o)=>{const r=st[t];if(!r)return n;if(!o)return`"${r}"`;const i=(r.charCodeAt(r.length-1)-44032)%28,u=i!==0;let a=o;return o==="\uC640"||o==="\uACFC"?a=u?"\uACFC":"\uC640":o==="\uC744"||o==="\uB97C"?a=u?"\uC744":"\uB97C":o==="\uC774"||o==="\uAC00"?a=u?"\uC774":"\uAC00":o==="\uC740"||o==="\uB294"?a=u?"\uC740":"\uB294":(o==="\uC73C\uB85C"||o==="\uB85C")&&(a=i===0||i===8?"\uB85C":"\uC73C\uB85C"),`"${r}"${a}`})}const hu=e=>e==null?[]:Array.isArray(e)?e:[e];function ct(e){if([...e].length!==1)return"";const n=S(e);if(!n)return"";const t=Zn(B[n.jong]),o=t===""?0:B.indexOf(t);return x(n.cho,n.jung,o<0?0:o)}function dn(e,n){return n.get(e)||ct(e)||e}function ve(e){return e?k(e.cho)?"cho":k(e.jung)?"jung":k(e.jong)?"jong":null:null}function q(e,n){const t=(r,i)=>!k(r)||hu(r).includes(i),o=n.jongNone?e.jong===0:t(n.jong,B[e.jong]);return t(n.cho,A[e.cho])&&t(n.jung,b[e.jung])&&o}function te(e,n,t){const o=[...e];if(t!=="pron")return o.map(i=>S(i));const r=[...n.get(e)||e];return r.length!==o.length?o.map(i=>S(i)):r.map(i=>S(i))}function oe(e,n,t,o,r){const i=n==="cho"?A:n==="jung"?b:B,u=e[n],a=[],l=s=>n==="jung"?Su(dn(s,r)):dn(s,r),c=new Map([[l(t),-1]]),C=R(i.map((s,g)=>g).filter(s=>s!==u&&(n!=="cho"||i[s]!=="\u3147")&&(n!=="jong"||s!==0)));for(const s of C){if(a.length>=o)break;const g=n==="cho"?x(s,e.jung,e.jong):n==="jung"?x(e.cho,s,e.jong):x(e.cho,e.jung,s),h=l(g),m=c.get(h);if(m!==void 0){n==="jung"&&m>=0&&r.has(g)&&!r.has(a[m])&&(a[m]=g);continue}c.set(h,a.length),a.push(g)}return a}const mu={\u3154:"\u3150",\u3156:"\u3152",\u315A:"\u3159",\u315E:"\u3159"};function Su(e){if([...e].length!==1)return e;const n=S(e);if(!n)return e;const t=mu[b[n.jung]];return t?x(n.cho,b.indexOf(t),n.jong):e}function yu(e,n,t,o,r,i=null){const u=[...e];if(u.length!==2)return null;const a=u.map(s=>S(s));if(a.some(s=>!s))return null;const l=te(e,t,o);if(l.some(s=>!s))return null;const c=ve(n);let C=c&&n?l.map((s,g)=>q(s,n)?g:-1).filter(s=>s>=0):[0,1];if(i!=null&&(C=C.filter(s=>s!==i)),!C.length)return null;for(const s of R(C)){const g=u[s];if(!r.has(g))continue;const h=oe(a[s],c??"cho",g,40,t),m=[];for(const y of h)if(y!==g&&r.has(y)&&!m.includes(y)&&m.push(y),m.length>=2)break;if(!(m.length<2))return{question:e,distractors:[g,...m]}}return null}function Du(e,n,t,o,r,i=null){const u=[...e];if(u.length!==3)return null;const a=u.map(s=>S(s));if(a.some(s=>!s))return null;const l=te(e,t,o);if(l.some(s=>!s))return null;const c=ve(n),C=c&&n?l.map((s,g)=>q(s,n)?g:-1).filter(s=>s>=0):[0,1,2];if(!C.length)return null;for(const s of R(C))for(const g of R([0,1,2].filter(h=>h!==s&&(i==null||h===i)))){const h=[0,1,2].filter(d=>d!==g),m=h.map(d=>u[d]).join("");if(!r.has(m))continue;const y=h.indexOf(s),D=oe(a[s],c??"cho",u[s],40,t),f=[];for(const d of D){const E=h.map(P=>u[P]);E[y]=d;const p=E.join("");if(p!==m&&r.has(p)&&!f.includes(p)&&f.push(p),f.length>=2)break}if(!(f.length<2))return{question:e,distractors:[m,...f]}}return null}function Eu(e,n,t,o,r,i=null){const u=[...e],a=u.length;if(a<2)return null;const l=[];for(let C=1;C<=a-1;C++)l.push({remain:u.slice(0,C).join(""),dropped:u.slice(C).join(""),droppedEnd:1}),l.push({remain:u.slice(a-C).join(""),dropped:u.slice(0,a-C).join(""),droppedEnd:0});const c=ve(n);for(const{remain:C,dropped:s,droppedEnd:g}of R(l)){if(i!=null&&g!==i||C===e||!r.has(C)||!r.has(s))continue;const h=[...C],m=h.map(f=>S(f));if(m.some(f=>!f))continue;const y=te(C,t,o);if(y.some(f=>!f))continue;const D=c&&n?y.map((f,d)=>q(f,n)?d:-1).filter(f=>f>=0):h.map((f,d)=>d);if(D.length)for(const f of R(D)){const d=oe(m[f],c??"cho",h[f],40,t),E=[];for(const p of d){const P=[...h];P[f]=p;const L=P.join("");if(L!==C&&r.has(L)&&!E.includes(L)&&E.push(L),E.length>=2)break}if(E.length>=2)return{question:e,distractors:[C,...E],dropped:s}}}return null}function Tu(e,n,t,o,r,i=null){if([...e].length!==1)return null;const u=S(t.get(e)||e);if(!u||u.jong===0)return null;const a=x(u.cho,u.jung,0),l=oe({cho:u.cho,jung:u.jung,jong:0},"cho",a,2,t);return l.length<2?null:{question:e,distractors:[a,...l]}}const fn=A.indexOf("\u3147");function pu(e,n,t,o,r,i=null){if([...e].length!==1)return null;const u=S(t.get(e)||e);if(!u||u.jong!==0||u.cho===fn)return null;const a=x(fn,u.jung,0),l=oe({cho:fn,jung:u.jung,jong:0},"jung",a,2,t);return l.length<2?null:{question:e,distractors:[a,...l]}}function Au(e){const n=new Map;for(const t of e){const o=[...t],r=o.length;if(!(r<2||r>3))for(let i=0;i<r;i++){let u=r+"|"+i+"|";for(let l=0;l<r;l++)u+=l===i?"*":o[l];const a=n.get(u);a?a.push(t):n.set(u,[t])}}return n}function wu(e,n,t,o,r,i=null,u=null,a=2){const l=[...e],c=l.length;if(c<2||c>3)return null;const C=l.map(d=>S(d));if(C.some(d=>!d))return null;const s=te(e,t,o);if(s.some(d=>!d))return null;const g=d=>t.get(d)??d,h=g(e),m=!!n&&(k(n.cho)||k(n.jung)||k(n.jong)),y=!!u&&(k(u.cho)||k(u.jung)||k(u.jong)),D=d=>{let E=c+"|"+d+"|";for(let p=0;p<c;p++)E+=p===d?"*":l[p];return E};let f;if(i!=null){if(i>=c||m&&!q(s[i],n))return null;f=[i]}else m?f=s.map((d,E)=>q(d,n)?E:-1).filter(d=>d>=0):f=Array.from({length:c},(d,E)=>E);for(const d of R(f)){const E=r.get(D(d))??[],p=[],P=[];for(const T of E){if(T===e)continue;const I=[...T].map(_e=>S(_e)),F=C[d],Q=I[d];if(!F||!Q)continue;let z=0;if(F.cho!==Q.cho&&z++,F.jung!==Q.jung&&z++,F.jong!==Q.jong&&z++,!(z<a||g(T)===h))if(y){const _e=te(T,t,o)[d];_e&&q(_e,u)?p.push(T):P.push(T)}else p.push(T)}if(!p.length)continue;const L=R(p)[0],w=[],j=new Set([h,g(L)]),O=y?P:p.filter(T=>T!==L);for(const T of R(O)){const I=g(T);if(!j.has(I)&&(j.add(I),w.push(T),w.length>=2))break}if(!y&&w.length<2)for(const T of R(E)){if(T===e||T===L)continue;const I=g(T);if(!j.has(I)&&(j.add(I),w.push(T),w.length>=2))break}if(!(w.length<2))return{question:e,distractors:[L,...w]}}return null}const bu=()=>{const e="\uC54C \uC218 \uC5C6\uB294 \uC624\uB958",n=typeof Be?.t=="function"?Be.t("common.unknownError",{defaultValue:e}):void 0;return typeof n=="string"&&n?n:e};function _u(e,n){if(n===void 0&&(n=bu()),e instanceof Error)return e.message||n;if(typeof e=="string")return e||n;if(e&&typeof e=="object"){const t=e;for(const o of[t.message,t.error_description,t.error])if(typeof o=="string"&&o)return o}return n}const hn="\uB124\uD2B8\uC6CC\uD06C \uC5F0\uACB0\uC774 \uBD88\uC548\uC815\uD569\uB2C8\uB2E4. \uC5F0\uACB0 \uC0C1\uD0DC\uB97C \uD655\uC778\uD55C \uB4A4 \uB2E4\uC2DC \uC2DC\uB3C4\uD574 \uC8FC\uC138\uC694.",Bu=()=>{const e=typeof Be?.t=="function"?Be.t("common.networkError",{defaultValue:hn}):void 0;return typeof e=="string"&&e?e:hn};function Ct(e){return e?/failed to fetch|load failed|networkerror|network request failed|fetcherror/i.test(e):!1}function Nu(e){return Ct(e)?Bu():e}function Lu(e,n){return e==="id"?void 0:`${e}|${n?"asc":"desc"}`}function ju(e){const[n,t]=e.split("|");return{key:n,asc:t==="asc"}}function Ru(e){let n=e==null?"":String(e);return!(typeof e=="number"&&Number.isFinite(e))&&/^[=+\-@\t\r]/.test(n)&&(n=" "+n),/[",\n\r]/.test(n)?`"${n.replaceAll('"','""')}"`:n}function Ou(e,n){const t=new Blob(["\uFEFF"+n],{type:"text/csv;charset=utf-8"}),o=URL.createObjectURL(t),r=document.createElement("a");r.href=o,r.download=e,r.click(),URL.revokeObjectURL(o)}const gt="__ihab_core_word_pool__";function ku(){typeof window<"u"&&window.dispatchEvent(new CustomEvent("wordpool:update"))}function Iu(e,n){const t=new Map;for(const r of e)t.set(r.word,r);const o={entries:e,pairIndex:n??null,byWord:t};globalThis[gt]=o,ku()}function dt(){return globalThis[gt]??null}const ue=globalThis;function mn(e,n){const t=o=>{};try{const o=n();o&&typeof o.catch=="function"&&o.catch(t)}catch(o){t(o)}}function $u(e){ue.__ihabTrainingTimeLogger=e}function Pu(e){mn("time",()=>ue.__ihabTrainingTimeLogger?.(e))}function Mu(e){ue.__ihabTrainingCompletionLogger=e}function vu(e){mn("completion",()=>ue.__ihabTrainingCompletionLogger?.(e))}function Gu(e){ue.__ihabCrosswordLogger=e}function Fu(e){mn("crossword",()=>ue.__ihabCrosswordLogger?.(e))}function N(e){return typeof e=="string"?e.trim()||null:typeof e=="number"?String(e):null}function ft(e){for(const n of["correct","isCorrect","heard","judgement"])if(typeof e[n]=="boolean")return e[n];return e.score===1?!0:e.score===0?!1:null}function xu(e){return Array.isArray(e)?e.map((n,t)=>{const o=n??{};return{index:t,itemId:N(o.contextCode)??N(o.itemId)??N(o.itemCode)??N(o.id),question:N(o.question)??N(o.q)??N(o.sentence)??N(o.text)??N(o.prompt)??N(o.word)??N(o.targetSyllable),answer:N(o.answer),selected:N(o.selectedText)??N(o.selected),correct:ft(o)}}):[]}function Wu(e){return e.filter(n=>n.correct===!1)}let ht=null,mt=null,St=null;function Yu(e){ht=e}function Hu(e){mt=e}function Ku(e){St=e}async function Uu(e,n){try{return await ht?.(e,n)??null}catch{return null}}async function Vu(){try{return await mt?.()??null}catch{return null}}async function zu(e,n){try{return await St?.(e,n)??null}catch{return null}}const Ge=globalThis;function Ju(e){Ge.__ihabNoiseSettingsStore=e}async function qu(){try{return await Ge.__ihabNoiseSettingsStore?.load()??null}catch{return null}}function Qu(e){const n=t=>{};try{const t=Ge.__ihabNoiseSettingsStore?.save(e);t&&typeof t.catch=="function"&&t.catch(n)}catch(t){n(t)}}function Zu(e){try{Ge.__ihabNoiseSettingsStore?.applied?.(e)}catch{}}function Fe(e){const n=new TextEncoder().encode(String(e).normalize("NFC"));let t="";return n.forEach(o=>{t+=o.toString(16).padStart(2,"0")}),t}const Xu=Fe;function er(e,n){return`${e}/${Fe(n)}.mp3`}function nr(e={}){const n=e.storagePrefix??"audio-cache",t=e.voice??"ko-f",o=typeof e.speed=="number"?e.speed:1,r=e.filenameSanitizer??Fe;return async function(i){const u=String(i||"").trim();if(!u)return"";const a=`${r(u)}_${t}.mp3`,l=`${n}/${a}`;try{if(await An(l)){const c=await wn(l);if(c)return c}}catch{}if(e.generator)try{const c=await e.generator(u,l,e);if(c)return c}catch{}try{const c=`/api/tts?word=${encodeURIComponent(u)}&voice=${encodeURIComponent(t)}&speed=${encodeURIComponent(String(o))}`;return await fetch(c,{method:"GET"}),`/audio-cache/${a}`}catch{return`/audio-cache/${a}`}}}async function tr(e){if(typeof document<"u"){const n=document.activeElement;let t=null;try{if(t=document.createElement("textarea"),t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.opacity="0",t.style.pointerEvents="none",document.body.appendChild(t),t.focus(),t.select(),t.setSelectionRange(0,e.length),document.execCommand("copy"))return!0}catch{}finally{if(t?.parentNode&&t.parentNode.removeChild(t),n&&n!==document.activeElement&&typeof n.focus=="function"&&n.isConnected)try{n.focus({preventScroll:!0})}catch{}}}try{if(typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function")return await navigator.clipboard.writeText(e),!0}catch{}return!1}const re="Asia/Seoul",Se=e=>{const n=new Date(e);return Number.isNaN(n.getTime())?null:n};function or(e){const n=Se(e);return n?n.toLocaleDateString("ko-KR",{timeZone:re,year:"numeric",month:"short",day:"numeric"}):""}function ur(e){const n=Se(e);return n?n.toLocaleString("ko-KR",{timeZone:re,year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"}):""}function rr(e,n){const t=n.startsWith("ko")?"ko-KR":"en-US",o=Se(e);return o?o.toLocaleDateString(t,{timeZone:re,year:"numeric",month:"short",day:"numeric"}):""}function ir(e,n){const t=n.startsWith("ko")?"ko-KR":"en-US",o=Se(e);return o?o.toLocaleString(t,{timeZone:re,year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"}):""}function ar(e){const n=Se(e);return n?n.toLocaleString("ko-KR",{timeZone:re,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):""}function sr(e){if(e==null||e==="")return"";const n=e instanceof Date?e:new Date(e);return isNaN(n.getTime())?"":new Intl.DateTimeFormat("en-GB",{timeZone:re,hour:"2-digit",minute:"2-digit",hour12:!1}).format(n)}function Sn(){return ye(new Date)}function lr(){return yt(Sn())}const cr=540*60*1e3;function Cr(e,n,t){return new Date(Date.UTC(e,n,t)-cr)}function yt(e){const[n,t,o]=e.split("-").map(Number);return new Date(n,(t||1)-1,o||1)}function ye(e){if(e==null||e==="")return"";const n=e instanceof Date?e:new Date(e);return isNaN(n.getTime())?"":new Intl.DateTimeFormat("fr-CA",{timeZone:"Asia/Seoul"}).format(n)}function gr(e,n){if(!e)return"";const t=new Date(e).getTime();if(Number.isNaN(t))return"";const o=Math.max(0,Math.floor((Date.now()-t)/1e3)),r=Math.floor(o/60),i=Math.floor(r/60),u=Math.floor(i/24),a=Math.floor(u/7),l=Math.floor(u/30),c=Math.floor(u/365);return r<1?n("store.time.justNow","\uBC29\uAE08 \uC804"):r<60?n("store.time.minutesAgo",{n:r}):i<24?n("store.time.hoursAgo",{n:i}):u<7?n("store.time.daysAgo",{n:u}):a<5?n("store.time.weeksAgo",{n:a}):u<365?n("store.time.monthsAgo",{n:Math.min(l,11)}):n("store.time.yearsAgo",{n:c})}function dr(e,n={}){const{sep:t=".",pad:o=!0,trailingDot:r=!1,fallback:i="\u2014"}=n;if(!e)return i;const u=ye(e instanceof Date?e:String(e));if(!u)return i;const[a,l,c]=u.split("-"),C=o?l:String(Number(l)),s=o?c:String(Number(c));return`${a}${t}${C}${t}${s}${r?".":""}`}function fr(e){const n=e.normalize("NFKC").replace(/\D/g,"");if(/^(050\d|0303)/.test(n)){const o=n.slice(0,12);return o.length<=4?o:o.length<=8?`${o.slice(0,4)}-${o.slice(4)}`:`${o.slice(0,4)}-${o.slice(4,o.length-4)}-${o.slice(o.length-4)}`}if(/^1[5-9]\d{2}/.test(n)&&n.length<=8)return n.length<=4?n:`${n.slice(0,4)}-${n.slice(4)}`;const t=n.slice(0,11);return t.startsWith("02")?t.length<=2?t:t.length<=6?`${t.slice(0,2)}-${t.slice(2)}`:`${t.slice(0,2)}-${t.slice(2,t.length-4)}-${t.slice(t.length-4)}`:t.length<=3?t:t.length<=7?`${t.slice(0,3)}-${t.slice(3)}`:`${t.slice(0,3)}-${t.slice(3,t.length-4)}-${t.slice(t.length-4)}`}function hr(e){if(e){if(/^\d{4}\.\d{2}\.\d{2}$/.test(e))return e;if(/^\d{8}$/.test(e))return`${e.slice(0,4)}.${e.slice(4,6)}.${e.slice(6,8)}`;if(/^\d{4}-\d{2}-\d{2}$/.test(e))return e.replace(/-/g,".");if(/^\d{4}-\d{2}-\d{2}T/.test(e)){const n=new Date(e);return isNaN(n.getTime())?void 0:ye(n).replace(/-/g,".")}}}function mr(e){if(e)return/^\d{4}\.\d{2}\.\d{2}$/.test(e)?e.replace(/\./g,"-"):e}function Sr(e,n){if(!e)return"-";const t=/^(\d{1,2}):(\d{2})$/.exec(e.trim());if(!t)return e;const o=Number(t[1]),r=Number(t[2]),i=t[1].padStart(2,"0");return r===0?n("date.timeH",{h:o,hh:i,mm:t[2]}):n("date.timeHM",{h:o,hh:i,m:r,mm:t[2]})}function yr(e){return(e??0).toLocaleString("ko-KR")}const Dr=[{key:"FOOD",label:"\uC74C\uC2DD",icon:"salad",color:"#FF8A65",subs:[{key:"TRKRFD",label:"\uD55C\uAD6D \uC804\uD1B5\uC74C\uC2DD"},{key:"MDKRFD",label:"\uD55C\uAD6D \uD604\uB300\uC74C\uC2DD"},{key:"WRLDFD",label:"\uC138\uACC4\uC758 \uC74C\uC2DD"},{key:"MTRFRT",label:"\uC2DD\uC7AC\uB8CC\uC640 \uACFC\uC77C"},{key:"GEFDKL",label:"\uC74C\uC2DD \uC0C1\uC2DD"}]},{key:"HLTH",label:"\uAC74\uAC15",icon:"heart",color:"#66BB6A",subs:[{key:"HTETHB",label:"\uAC74\uAC15\uD55C \uC2DD\uC2B5\uAD00"},{key:"DISILL",label:"\uBCD1\uACFC \uC9C8\uD658"},{key:"EXCISE",label:"\uC6B4\uB3D9"},{key:"GEHTKL",label:"\uAC74\uAC15\uC0C1\uC2DD"}]},{key:"WETH",label:"\uB0A0\uC528",icon:"sun-medium",color:"#42A5F5",subs:[{key:"GESSKL",label:"\uACC4\uC808\uC0C1\uC2DD"},{key:"SNWRAN",label:"\uB208\uACFC \uBE44"},{key:"WTHFCT",label:"\uC77C\uAE30\uC608\uBCF4"},{key:"GEWTKL",label:"\uB0A0\uC528\uC0C1\uC2DD"}]},{key:"PRSN",label:"\uC778\uBB3C",icon:"user-round",color:"#AB47BC",subs:[{key:"JODYPS",label:"\uC870\uC120\uC2DC\uB300"},{key:"MDKRPS",label:"\uD55C\uAD6D \uADFC\uD604\uB300"},{key:"THKDPS",label:"\uC0BC\uAD6D\uC2DC\uB300"},{key:"WRLART",label:"\uC138\uACC4\uC758 \uC608\uC220\uAC00"},{key:"WRLPSN",label:"\uC138\uACC4\uC758 \uC778\uBB3C"}]},{key:"KRCT",label:"\uD55C\uAD6D\uBB38\uD654",icon:"bow-arrow",color:"#EC407A",subs:[{key:"KRLANG",label:"\uC6B0\uB9AC\uB9D0"},{key:"TRPLCT",label:"\uC804\uD1B5\uB180\uC774"},{key:"HERITG",label:"\uBB38\uD654\uC7AC"},{key:"EVTFES",label:"\uD589\uC0AC\uC640 \uCD95\uC81C"},{key:"GECTKL",label:"\uC0C1\uC2DD"}]},{key:"STRY",label:"\uC774\uC57C\uAE30",icon:"message-circle",color:"#8D6E63",subs:[{key:"FRYTAL",label:"\uB3D9\uD654"},{key:"AMZING",label:"\uC2E0\uAE30\uD55C \uC774\uC57C\uAE30"},{key:"DAYSTR",label:"\uC77C\uC0C1 \uC18D \uC774\uC57C\uAE30"}]},{key:"LOCA",label:"\uC9C0\uC5ED",icon:"map-pin",color:"#26A69A",subs:[{key:"KRLDMK",label:"\uD55C\uAD6D\uC758 \uBA85\uC18C"},{key:"SELNMK",label:"\uC11C\uC6B8\uC758 \uBA85\uC18C"},{key:"WRDTRB",label:"\uC138\uACC4\uC5EC\uD589"},{key:"NAVIGT",label:"\uAE38 \uCC3E\uAE30"}]},{key:"SOAR",label:"\uC0AC\uD68C\uC640 \uC608\uC220",icon:"landmark",color:"#5C6BC0",subs:[{key:"KRSOCI",label:"\uD55C\uAD6D"},{key:"ECONEW",label:"\uACBD\uC81C\uC640 \uB274\uC2A4"},{key:"GENART",label:"\uC608\uC220"},{key:"GELFKL",label:"\uC0DD\uD65C \uC0C1\uC2DD"}]},{key:"NTSC",label:"\uC790\uC5F0\uACFC \uACFC\uD559",icon:"leaf",color:"#9CCC65",subs:[{key:"ANIMAL",label:"\uB3D9\uBB3C"},{key:"PLANTS",label:"\uC2DD\uBB3C"},{key:"ETHPLT",label:"\uC9C0\uAD6C"},{key:"TOLELC",label:"\uB3C4\uAD6C\uC640 \uC804\uC790\uC81C\uD488"},{key:"GESCKL",label:"\uACFC\uD559\uC0C1\uC2DD"}]},{key:"SPRT",label:"\uC2A4\uD3EC\uCE20",icon:"trophy",color:"#FFCA28",subs:[{key:"INVDSP",label:"\uAC1C\uC778\uACBD\uAE30"},{key:"MARART",label:"\uACA9\uD22C\uAE30"},{key:"TEAMSP",label:"\uB2E8\uCCB4\uACBD\uAE30"},{key:"FOOTBL",label:"\uCD95\uAD6C"},{key:"GESPKL",label:"\uC2A4\uD3EC\uCE20 \uC0C1\uC2DD"}]}],Er=[{key:"LISTEN_IN_NOISE",label:"\uC18C\uC74C \uD558 \uBB38\uC7A5 \uB4E3\uAE30",icon:"party-popper",desc:"\uC18C\uC74C \uD658\uACBD \uC18D \uBB38\uC7A5 \uC774\uD574 \uD6C8\uB828"},{key:"SHORT_STORY",label:"\uC9E7\uC740 \uC774\uC57C\uAE30 \uB4E3\uAE30",icon:"message-square",desc:"\uC9E7\uC740 \uC774\uC57C\uAE30 + 4\uBB38\uC81C"},{key:"LONG_STORY",label:"\uAE34 \uC774\uC57C\uAE30 \uB4E3\uAE30",icon:"message-square-text",desc:"\uAE34 \uC774\uC57C\uAE30 \uC2EC\uD654 \uD6C8\uB828"},{key:"ORDERING_SENTENCE",label:"\uBB38\uC7A5 \uC21C\uC11C\uD654 \uD558\uAE30",icon:"align-start-vertical",desc:"\uC21C\uC11C \uBC30\uC5F4 \uD6C8\uB828"}];let yn=null;function Tr(e){yn=e}function pr(){return yn?.topicTypes??Dr}function Ar(){return yn?.trainingTypes??Er}const Dt="ihab_theme",Et="light";function Tt(){try{const e=localStorage.getItem(Dt);if(e==="light"||e==="dark"||e==="auto")return e}catch{}return Et}function pt(e){const n=e==="light"||e==="dark"||e==="auto"?e:Et;try{document.documentElement.setAttribute("data-theme",n),localStorage.setItem(Dt,n)}catch{}}function wr(){pt(Tt())}const At="ihab_font_scale",br="medium",_r=["medium","large1","large2","large3"];function wt(){try{const e=localStorage.getItem(At);if(_r.includes(e))return e}catch{}return br}function bt(e){try{document.documentElement.setAttribute("data-font-scale",e),localStorage.setItem(At,e)}catch{}}function Br(){bt(wt())}const De=[],Ee=[],Te=[],pe=[],Ae={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},we={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},Nr={LISTEN_IN_NOISE:3,SHORT_STORY:2,LONG_STORY:1,ORDERING_SENTENCE:2};let Dn=null,_t=null,V=null;function Bt({counts:e,forceRefresh:n}={}){const t=Object.assign({},Nr,e||{}),o=Sn(),r=ye(new Date(`${o}T00:00:00+09:00`).getTime()-864e5),i=JSON.stringify(t);if(!n&&_t===o&&Dn===i&&V)return Object.assign(Ae,V.today),Object.assign(we,V.yesterday?.selection||{LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]}),{today:Ae,yesterday:we};const u={LISTEN_IN_NOISE:H(De,Math.max(0,Number(t.LISTEN_IN_NOISE)||0)),SHORT_STORY:H(Ee,Math.max(0,Number(t.SHORT_STORY)||0)),LONG_STORY:H(Te,Math.max(0,Number(t.LONG_STORY)||0)),ORDERING_SENTENCE:H(pe,Math.max(0,Number(t.ORDERING_SENTENCE)||0))};let a=null;return V&&Dn===i&&V.yesterday&&V.yesterday.date===r&&(a=V.yesterday.selection),a||(a={LISTEN_IN_NOISE:H(De,Math.max(0,Number(t.LISTEN_IN_NOISE)||0)),SHORT_STORY:H(Ee,Math.max(0,Number(t.SHORT_STORY)||0)),LONG_STORY:H(Te,Math.max(0,Number(t.LONG_STORY)||0)),ORDERING_SENTENCE:H(pe,Math.max(0,Number(t.ORDERING_SENTENCE)||0))}),Object.assign(Ae,u),Object.assign(we,a),_t=o,Dn=i,V={today:u,yesterday:{date:r,countsKey:i,selection:a}},{today:Ae,yesterday:we}}function Lr(){return{today:Ae,yesterday:we}}function jr(){return{LISTEN_IN_NOISE:De,SHORT_STORY:Ee,LONG_STORY:Te,ORDERING_SENTENCE:pe}}let xe=!1,be=null;async function Rr(){try{const e={url:typeof document>"u"?require("url").pathToFileURL(__filename).href:Ye&&Ye.tagName.toUpperCase()==="SCRIPT"&&Ye.src||new URL("utils.cjs.js",document.baseURI).href}&&void 0||"/",n=await fetch(`${e}data/allTrainingData.json`);return n.ok?await n.json():null}catch{return null}}async function Nt(){if(!xe)return be||(be=(async()=>{const e=await Rr();if(!e){be=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}const n={noise:[],short:[],long:[],order:[]};try{for(const t of Object.keys(e||{})){const o=e[t]||[];for(const r of o){if(!r||typeof r!="object")continue;const i=r,u=String(i.training_type||t),a=String(i.category_main_code||i.category_main||i.category_0||""),l=String(i.category_sub_code||i.category_sub||i.category_1||""),c=Object.assign({},i,{training_type:u,category_0:a,category_1:l});u==="LISTEN_IN_NOISE"?n.noise.push(c):u==="SHORT_STORY"?n.short.push(c):u==="LONG_STORY"?n.long.push(c):u==="ORDERING_SENTENCE"&&n.order.push(c)}}}catch{be=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}De.push(...n.noise),Ee.push(...n.short),Te.push(...n.long),pe.push(...n.order),xe=!0;try{Bt()}catch{}try{window.dispatchEvent(new Event("speechear.data.updated"))}catch{}})(),be)}function Or(){return xe}async function kr(e=3e3){const n=Nt();let t;try{await Promise.race([n,new Promise(o=>{t=setTimeout(o,e)})])}finally{t!==void 0&&clearTimeout(t)}return xe}const Ir=[{key:"LISTEN_IN_NOISE",label:"\uC18C\uC74C \uD558 \uBB38\uC7A5 \uB4E3\uAE30",icon:"party-popper",desc:"\uB2E4\uC591\uD55C \uC18C\uC74C \uD658\uACBD\uC5D0\uC11C \uBB38\uC7A5 \uCCAD\uB825\uC744 \uD6C8\uB828\uD569\uB2C8\uB2E4."},{key:"SHORT_STORY",label:"\uC9E7\uC740 \uC774\uC57C\uAE30 \uB4E3\uAE30",icon:"message-square",desc:"\uC9E7\uC740 \uC774\uC57C\uAE30\uB97C \uB4E3\uACE0 \uAE30\uC5B5\uD558\uC5EC \uBB38\uC81C\uB97C \uD480\uC5B4\uBD05\uB2C8\uB2E4."},{key:"LONG_STORY",label:"\uAE34 \uC774\uC57C\uAE30 \uB4E3\uAE30",icon:"message-square-text",desc:"\uAE34 \uC774\uC57C\uAE30\uB97C \uB4E3\uACE0 \uAE30\uC5B5\uD558\uC5EC \uB2E4\uC218\uC758 \uBB38\uC81C\uB97C \uD480\uC5B4\uBD05\uB2C8\uB2E4."},{key:"ORDERING_SENTENCE",label:"\uBB38\uC7A5 \uC21C\uC11C\uD654 \uD558\uAE30",icon:"align-start-vertical",desc:"\uC5EC\uB7EC\uAC1C\uC758 \uC9E7\uC740 \uBB38\uC7A5\uC744 \uB4E3\uACE0 \uAE30\uC5B5\uD558\uC5EC \uADF8 \uC21C\uC11C\uC5D0 \uB9DE\uAC8C \uBC30\uC5F4\uD569\uB2C8\uB2E4."}],$r=[{key:"FOOD",label:"\uC74C\uC2DD",icon:"salad",color:"#FF8A65",subs:[{key:"TRKRFD",label:"\uD55C\uAD6D \uC804\uD1B5\uC74C\uC2DD"},{key:"MDKRFD",label:"\uD55C\uAD6D \uD604\uB300\uC74C\uC2DD"},{key:"WRLDFD",label:"\uC138\uACC4\uC758 \uC74C\uC2DD"},{key:"MTRFRT",label:"\uC2DD\uC7AC\uB8CC\uC640 \uACFC\uC77C"},{key:"GEFDKL",label:"\uC74C\uC2DD \uC0C1\uC2DD"}]},{key:"HLTH",label:"\uAC74\uAC15",icon:"heart",color:"#66BB6A",subs:[{key:"HTETHB",label:"\uAC74\uAC15\uD55C \uC2DD\uC2B5\uAD00"},{key:"DISILL",label:"\uBCD1\uACFC \uC9C8\uD658"},{key:"EXCISE",label:"\uC6B4\uB3D9"},{key:"GEHTKL",label:"\uAC74\uAC15\uC0C1\uC2DD"}]},{key:"WETH",label:"\uB0A0\uC528",icon:"sun-medium",color:"#42A5F5",subs:[{key:"GESSKL",label:"\uACC4\uC808\uC0C1\uC2DD"},{key:"SNWRAN",label:"\uB208\uACFC \uBE44"},{key:"WTHFCT",label:"\uC77C\uAE30\uC608\uBCF4"},{key:"GEWTKL",label:"\uB0A0\uC528\uC0C1\uC2DD"}]},{key:"PRSN",label:"\uC778\uBB3C",icon:"user-round",color:"#AB47BC",subs:[{key:"JODYPS",label:"\uC870\uC120\uC2DC\uB300"},{key:"MDKRPS",label:"\uD55C\uAD6D \uADFC\uD604\uB300"},{key:"THKDPS",label:"\uC0BC\uAD6D\uC2DC\uB300"},{key:"WRLART",label:"\uC138\uACC4\uC758 \uC608\uC220\uAC00"},{key:"WRLPSN",label:"\uC138\uACC4\uC758 \uC778\uBB3C"}]},{key:"KRCT",label:"\uD55C\uAD6D\uBB38\uD654",icon:"bow-arrow",color:"#EC407A",subs:[{key:"KRLANG",label:"\uC6B0\uB9AC\uB9D0"},{key:"TRPLCT",label:"\uC804\uD1B5\uB180\uC774"},{key:"HERITG",label:"\uBB38\uD654\uC7AC"},{key:"EVTFES",label:"\uD589\uC0AC\uC640 \uCD95\uC81C"},{key:"GECTKL",label:"\uC0C1\uC2DD"}]},{key:"STRY",label:"\uC774\uC57C\uAE30",icon:"message-circle",color:"#8D6E63",subs:[{key:"FRYTAL",label:"\uB3D9\uD654"},{key:"AMZING",label:"\uC2E0\uAE30\uD55C \uC774\uC57C\uAE30"},{key:"DAYSTR",label:"\uC77C\uC0C1 \uC18D \uC774\uC57C\uAE30"}]},{key:"LOCA",label:"\uC9C0\uC5ED",icon:"map-pin",color:"#26A69A",subs:[{key:"KRLDMK",label:"\uD55C\uAD6D\uC758 \uBA85\uC18C"},{key:"SELNMK",label:"\uC11C\uC6B8\uC758 \uBA85\uC18C"},{key:"WRDTRB",label:"\uC138\uACC4\uC5EC\uD589"},{key:"NAVIGT",label:"\uAE38 \uCC3E\uAE30"}]},{key:"SOAR",label:"\uC0AC\uD68C\uC640 \uC608\uC220",icon:"landmark",color:"#5C6BC0",subs:[{key:"KRSOCI",label:"\uD55C\uAD6D"},{key:"ECONEW",label:"\uACBD\uC81C\uC640 \uB274\uC2A4"},{key:"GENART",label:"\uC608\uC220"},{key:"GELFKL",label:"\uC0DD\uD65C \uC0C1\uC2DD"}]},{key:"NTSC",label:"\uC790\uC5F0\uACFC \uACFC\uD559",icon:"leaf",color:"#9CCC65",subs:[{key:"ANIMAL",label:"\uB3D9\uBB3C"},{key:"PLANTS",label:"\uC2DD\uBB3C"},{key:"ETHPLT",label:"\uC9C0\uAD6C"},{key:"TOLELC",label:"\uB3C4\uAD6C\uC640 \uC804\uC790\uC81C\uD488"},{key:"GESCKL",label:"\uACFC\uD559\uC0C1\uC2DD"}]},{key:"SPRT",label:"\uC2A4\uD3EC\uCE20",icon:"trophy",color:"#FFCA28",subs:[{key:"INVDSP",label:"\uAC1C\uC778\uACBD\uAE30"},{key:"MARART",label:"\uACA9\uD22C\uAE30"},{key:"TEAMSP",label:"\uB2E8\uCCB4\uACBD\uAE30"},{key:"FOOTBL",label:"\uCD95\uAD6C"},{key:"GESPKL",label:"\uC2A4\uD3EC\uCE20 \uC0C1\uC2DD"}]}],Pr={LISTEN_IN_NOISE:"listenInNoise",SHORT_STORY:"shortStory",LONG_STORY:"longStory",ORDERING_SENTENCE:"orderingSentence"};let We=null,Lt=null,jt=null;function Mr(){const e=dt();if(e&&e.entries.length>0){const n=Yn();if(We&&Lt===e&&jt===n)return We;const t=new Set,o=[];for(const r of e.entries)!r.word||t.has(r.word)||(t.add(r.word),o.push({w:r.word,s:r.syllables,p:n?.[r.word]?[...n[r.word].cho??[],...n[r.word].jung??[],...n[r.word].jong??[]]:[],pron:r.pronunciation||r.word,grade:r.grade}));return We=o,Lt=e,jt=n,We}return[]}new Proxy([],{get(e,n){const t=Mr(),o=t[n];return typeof o=="function"?o.bind(t):o}});const vr={free:{maxCustomers:0,visitWord:!1,visitSentence:!1,homework:!1,customerStats:!1,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!1,wordTrainingSetting:!1,myWordList:!1,wordListShare:!1,groupTrainingSetting:!1,minimalPairSearch:!0,wordTableSetting:!1,wordTablePrint:!1,addToMyList:!1,addToGroupList:!1,wordSearch:!0,wordSearchPrint:!1,wordSearchAddToMyList:!1,wordSearchAddToGroupList:!1,wordDataLevel:1,sentenceDataLevel:0,crossword:!1,crosswordMid:!1,crosswordHigh:!1,wordTrainingView:!1,sentenceTrainingView:!1},personal_standard:{maxCustomers:0,visitWord:!1,visitSentence:!1,homework:!1,customerStats:!1,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!0,wordTrainingSetting:!0,myWordList:!0,wordListShare:!0,groupTrainingSetting:!1,minimalPairSearch:!0,wordTableSetting:!0,wordTablePrint:!0,addToMyList:!0,addToGroupList:!1,wordSearch:!0,wordSearchPrint:!0,wordSearchAddToMyList:!0,wordSearchAddToGroupList:!1,wordDataLevel:2,sentenceDataLevel:2,crossword:!0,crosswordMid:!0,crosswordHigh:!1,wordTrainingView:!0,sentenceTrainingView:!0},mgr_free:{maxCustomers:5,visitWord:!0,visitSentence:!0,homework:!1,customerStats:!1,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!1,wordTrainingSetting:!1,myWordList:!1,wordListShare:!1,groupTrainingSetting:!1,minimalPairSearch:!0,wordTableSetting:!1,wordTablePrint:!1,addToMyList:!1,addToGroupList:!1,wordSearch:!0,wordSearchPrint:!1,wordSearchAddToMyList:!1,wordSearchAddToGroupList:!1,wordDataLevel:1,sentenceDataLevel:1,crossword:!1,crosswordMid:!1,crosswordHigh:!1,wordTrainingView:!1,sentenceTrainingView:!1},none:{maxCustomers:0,visitWord:!1,visitSentence:!1,homework:!1,customerStats:!1,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!1,wordTrainingSetting:!1,myWordList:!1,wordListShare:!1,groupTrainingSetting:!1,minimalPairSearch:!1,wordTableSetting:!1,wordTablePrint:!1,addToMyList:!1,addToGroupList:!1,wordSearch:!1,wordSearchPrint:!1,wordSearchAddToMyList:!1,wordSearchAddToGroupList:!1,wordDataLevel:0,sentenceDataLevel:0,crossword:!1,crosswordMid:!1,crosswordHigh:!1,wordTrainingView:!1,sentenceTrainingView:!1},lite_word:{maxCustomers:10,visitWord:!0,visitSentence:!1,homework:!1,customerStats:!1,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!1,wordTrainingSetting:!1,myWordList:!1,wordListShare:!1,groupTrainingSetting:!1,minimalPairSearch:!0,wordTableSetting:!0,wordTablePrint:!0,addToMyList:!1,addToGroupList:!1,wordSearch:!0,wordSearchPrint:!0,wordSearchAddToMyList:!1,wordSearchAddToGroupList:!1,wordDataLevel:1,sentenceDataLevel:0,crossword:!0,crosswordMid:!1,crosswordHigh:!1,wordTrainingView:!0,sentenceTrainingView:!1},lite_sentence:{maxCustomers:10,visitWord:!1,visitSentence:!0,homework:!1,customerStats:!1,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!1,wordTrainingSetting:!1,myWordList:!1,wordListShare:!1,groupTrainingSetting:!1,minimalPairSearch:!1,wordTableSetting:!1,wordTablePrint:!0,addToMyList:!1,addToGroupList:!1,wordSearch:!1,wordSearchPrint:!0,wordSearchAddToMyList:!1,wordSearchAddToGroupList:!1,wordDataLevel:0,sentenceDataLevel:1,crossword:!0,crosswordMid:!1,crosswordHigh:!1,wordTrainingView:!1,sentenceTrainingView:!0},lite:{maxCustomers:10,visitWord:!0,visitSentence:!0,homework:!1,customerStats:!1,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!1,wordTrainingSetting:!1,myWordList:!1,wordListShare:!1,groupTrainingSetting:!1,minimalPairSearch:!0,wordTableSetting:!0,wordTablePrint:!0,addToMyList:!1,addToGroupList:!1,wordSearch:!0,wordSearchPrint:!0,wordSearchAddToMyList:!1,wordSearchAddToGroupList:!1,wordDataLevel:1,sentenceDataLevel:1,crossword:!0,crosswordMid:!1,crosswordHigh:!1,wordTrainingView:!0,sentenceTrainingView:!0},standard:{maxCustomers:30,visitWord:!0,visitSentence:!0,homework:!1,customerStats:!1,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!0,wordTrainingSetting:!0,myWordList:!0,wordListShare:!0,groupTrainingSetting:!1,minimalPairSearch:!0,wordTableSetting:!0,wordTablePrint:!0,addToMyList:!0,addToGroupList:!1,wordSearch:!0,wordSearchPrint:!0,wordSearchAddToMyList:!0,wordSearchAddToGroupList:!1,wordDataLevel:2,sentenceDataLevel:2,crossword:!0,crosswordMid:!0,crosswordHigh:!1,wordTrainingView:!0,sentenceTrainingView:!0},pro:{maxCustomers:50,visitWord:!0,visitSentence:!0,homework:!0,customerStats:!0,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!0,wordTrainingSetting:!0,myWordList:!0,wordListShare:!0,groupTrainingSetting:!1,minimalPairSearch:!0,wordTableSetting:!0,wordTablePrint:!0,addToMyList:!0,addToGroupList:!1,wordSearch:!0,wordSearchPrint:!0,wordSearchAddToMyList:!0,wordSearchAddToGroupList:!1,wordDataLevel:3,sentenceDataLevel:3,crossword:!0,crosswordMid:!0,crosswordHigh:!0,wordTrainingView:!0,sentenceTrainingView:!0},enterprise:{maxCustomers:1/0,visitWord:!0,visitSentence:!0,homework:!0,customerStats:!0,managerCustomerSplit:!0,managerManagement:!0,sentenceTrainingSetting:!0,wordTrainingSetting:!0,myWordList:!0,wordListShare:!0,groupTrainingSetting:!0,minimalPairSearch:!0,wordTableSetting:!0,wordTablePrint:!0,addToMyList:!0,addToGroupList:!0,wordSearch:!0,wordSearchPrint:!0,wordSearchAddToMyList:!0,wordSearchAddToGroupList:!0,wordDataLevel:3,sentenceDataLevel:3,crossword:!0,crosswordMid:!0,crosswordHigh:!0,wordTrainingView:!0,sentenceTrainingView:!0}},Gr={none:0,free:1,personal_standard:3,mgr_free:4,lite_word:5,lite_sentence:5,lite:6,standard:7,pro:8,enterprise:9},Fr={free:{sentenceTrainingDaily:2,wordTrainingDaily:2,gameDaily:1},personal_standard:{sentenceTrainingDaily:null,wordTrainingDaily:null,gameDaily:null},mgr_free:{sentenceTrainingDaily:2,wordTrainingDaily:2,gameDaily:1,trainingItemMax:5,customerMax:5,homeworkSendDaily:1},lite:{sentenceTrainingDaily:5,wordTrainingDaily:5,gameDaily:5,trainingItemMax:10,customerMax:10,homeworkSendDaily:10},standard:{sentenceTrainingDaily:null,wordTrainingDaily:null,gameDaily:null,trainingItemMax:30,customerMax:30,homeworkSendDaily:30},pro:{sentenceTrainingDaily:null,wordTrainingDaily:null,gameDaily:null,trainingItemMax:null,customerMax:50,homeworkSendDaily:50},enterprise:{sentenceTrainingDaily:null,wordTrainingDaily:null,gameDaily:null,trainingItemMax:null,customerMax:null,homeworkSendDaily:null}};function xr(e){const n=(e??"").toLowerCase();return n==="speechear_free"||n==="free"?"free":n.startsWith("manager_free")||n.startsWith("mgr_free")?"mgr_free":n.startsWith("manager_enterprise")?"enterprise":n.startsWith("manager_pro")?"pro":n.startsWith("manager_standard")?"standard":n.startsWith("manager_lite_word")?"lite_word":n.startsWith("manager_lite_sentence")?"lite_sentence":n.startsWith("manager_lite")||n.startsWith("mgr_lite")?"lite":n.startsWith("mgr_standard")?"standard":n.startsWith("mgr_pro")?"pro":n.startsWith("content_")||n.startsWith("speechear_")||n.startsWith("light_")||n==="light"?"personal_standard":"none"}const Wr=5,Yr=5;function Hr({rank:e,voteCount:n,quota:t=5}){return e<t&&n>0}const Kr={selected:"ALREADY_SELECTED",added:"ALREADY_ADDED",rejected:"ALREADY_REJECTED"},Ur="0.147.0";exports.CAPABILITY=ut,exports.CHOSEONG=A,exports.CORE_VERSION=Ur,exports.JONGSEONG=B,exports.JUNGSEONG=b,exports.LONG_STORIES=Te,exports.NETWORK_ERROR_MESSAGE=hn,exports.NOISE_DATAS=De,exports.ORDER_SETS=pe,exports.PLAN_FEATURES=vr,exports.PLAN_LIMITS=Fr,exports.SHORT_STORIES=Ee,exports.TIER_RANK=Gr,exports.TOPIC_TYPES=$r,exports.TRAINING_TYPES=Ir,exports.TRAINING_TYPE_I18N_KEY=Pr,exports.WORD_SUGGESTION_ACCOUNT_LIMIT=Yr,exports.WORD_SUGGESTION_EXISTING_ERROR=Kr,exports.WORD_SUGGESTION_WEEKLY_QUOTA=Wr,exports.applyFontScale=bt,exports.applyTheme=pt,exports.buildChangeWholeSyllableProblem=wu,exports.buildDropCompoundProblem=Eu,exports.buildDropContrast3Problem=Du,exports.buildDropContrastProblem=yu,exports.buildDropFinalConsonantProblem=Tu,exports.buildMultiPartPosContrast=Io,exports.buildPairIndex=Ro,exports.buildRemoveConsonantProblem=pu,exports.buildSyllableMaskIndex=Au,exports.bulkSetImageExistence=lo,exports.cardQuestionTitle=du,exports.checkImageExists=kn,exports.classifyPairDifficulty=go,exports.clearAudioExistsCache=Jt,exports.clearImageExistenceCache=co,exports.clearPairIndexCache=Oo,exports.composeSyllable=x,exports.computeDailySelection=Bt,exports.configureImageResolver=uo,exports.configureNoiseSettingsStore=Ju,exports.configurePronunciationResolver=qt,exports.configureStorage=Gt,exports.configureTTS=Kt,exports.configureTrainingCategories=Tr,exports.copyText=tr,exports.createDecompCache=Co,exports.createTTSUrlResolver=nr,exports.dateToDb=mr,exports.downloadCsvText=Ou,exports.downloadSound=xt,exports.ensureTrainingDataLoaded=kr,exports.escapeCsvField=Ru,exports.fileExists=An,exports.filterContrastCandidates=Hn,exports.finalToPhoneme=Zn,exports.firstChoseongOf=In,exports.formatCount=yr,exports.formatDateKo=or,exports.formatDateLocale=rr,exports.formatDateLongKo=ur,exports.formatDateLongLocale=ir,exports.formatDatetimeKo=ar,exports.formatPhone=fr,exports.formatRelativeTime=gr,exports.formatTimeHM=Sr,exports.formatYmd=dr,exports.getAssetBaseUrl=Tn,exports.getDailySelection=Lr,exports.getElementAnalyser=eo,exports.getElementVolume=to,exports.getErrorMessage=_u,exports.getImageExistenceStats=so,exports.getImageExistsCached=io,exports.getImageResolver=Rn,exports.getNoiseBaseUrl=Wt,exports.getNoiseFileGain=Yt,exports.getPairIndex=Yn,exports.getPlanTier=xr,exports.getPronunciationResolver=Qt,exports.getSavedFontScale=wt,exports.getSavedTheme=Tt,exports.getSignedOrPublicUrl=wn,exports.getTTSFallbackUrlResolver=Vt,exports.getTTSUrlResolver=Ut,exports.getTodayKst=Sn,exports.getTodayKstDate=lr,exports.getTopicTypes=pr,exports.getTrainingPools=jr,exports.getTrainingTypes=Ar,exports.getWordPool=dt,exports.hasQuestionWordConstraint=ru,exports.hasSel=k,exports.hasStructureContrast=tn,exports.initFontScale=Br,exports.initTheme=wr,exports.isAllChoseong=Pn,exports.isManualOnlyType=au,exports.isNetworkErrorMessage=Ct,exports.isSyllablePattern=Gn,exports.isThisWeekPick=Hr,exports.isTrainingDataLoaded=Or,exports.isValidQuestionWord=iu,exports.itemCorrectness=ft,exports.jamoToNamesForSpeech=fu,exports.kstStartOfDay=Cr,exports.loadGameLeaderboard=zu,exports.loadMyGameRanks=Vu,exports.loadNoiseSettings=qu,exports.loadTrainingData=Nt,exports.logCrossword=Fu,exports.logTrainingCompletion=vu,exports.logTrainingTime=Pu,exports.matchSyllables=te,exports.matchesChoseongSearch=fo,exports.matchesSyllablePattern=xn,exports.matchesWordQuery=ho,exports.mergeQuestionText=lt,exports.minimalPairDistractors=ko,exports.normalizeDate=hr,exports.officialSoundPath=er,exports.parseLocalYmd=yt,exports.parseSortValue=ju,exports.parseSyllable=S,exports.patternToComposition=wo,exports.phonemePartsOf=lu,exports.pickEuRo=ot,exports.pickEulReul=et,exports.pickEunNeun=nt,exports.pickIga=Xn,exports.pickWaGwa=tt,exports.prewarmImageCache=ao,exports.primarySelPart=ve,exports.readLevel=oo,exports.reorderArray=nu,exports.reportAppliedNoiseSettings=Zu,exports.resolveAssetUrl=Mt,exports.resolveSoundPath=Ft,exports.resumeAudioMeter=Xt,exports.routeElementAudio=Ln,exports.sample=H,exports.saveNoiseSettings=Qu,exports.searchAndRankWords=Bo,exports.setAssetBaseUrl=Pt,exports.setCrosswordLogger=Gu,exports.setElementVolume=no,exports.setGameLeaderboardLoader=Ku,exports.setGameRanksLoader=Hu,exports.setGameScoreSubmitter=Yu,exports.setTrainingCompletionLogger=Mu,exports.setTrainingTimeLogger=$u,exports.setWordPool=Iu,exports.shuffle=R,exports.sortToValue=Lu,exports.soundOf=dn,exports.speak=Ot,exports.stopSpeaking=kt,exports.submitGameScore=Uu,exports.syllMatchesComp=q,exports.syllableContrasts=oe,exports.syllableLength=Do,exports.syllablePron=ct,exports.toBase64UrlSafe=Xu,exports.toChoseong=$n,exports.toItemResults=xu,exports.toKstHm=sr,exports.toKstYmd=ye,exports.toStandardPronunciation=Vo,exports.toStorageName=Fe,exports.toUserErrorMessage=Nu,exports.validateSyllableSearchInput=_o,exports.withEuRo=eu,exports.withEulReul=Qo,exports.withEunNeun=Zo,exports.withIga=qo,exports.withWaGwa=Xo,exports.wordContainsChoseong=mo,exports.wordContainsJongseong=yo,exports.wordContainsJungseong=So,exports.wordHasNoCoda=Eo,exports.wordHasSyllableMatching=po,exports.wrongItems=Wu;
20
+ `),this.name="StorageNotConfiguredError"}};function Gt(e){vt(e)}function Ft(e,n){if(!e)return null;const t=Z();return t?.resolvePath?t.resolvePath(e,n):n?`${n}/${e}.mp3`:null}async function An(e){if(!e)return!1;const n=Z();if(!n)throw new Ue("fileExists");if(n.exists)return n.exists(e);try{return await n.resolveUrl(e)!==null}catch{return!1}}async function wn(e){if(!e)return null;const n=Z();if(!n)throw new Ue("getSignedOrPublicUrl");try{return await n.resolveUrl(e)}catch{return null}}async function xt(e){const n=Z();if(!n)throw new Ue("downloadSound");return n.download(e)}function Wt(){return Z()?.noiseBaseUrl??"/sounds/noise"}function Yt(){const e=Number(Z()?.noiseFileGain);return Number.isFinite(e)&&e>0?e:1}function Ht(e){const n=AbortSignal.timeout;if(typeof n=="function")return n.call(AbortSignal,e);const t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal}const Ve="__ihab_core_tts_config__";function Kt(e){globalThis[Ve]=e}function Ut(){return globalThis[Ve]?.urlResolver??null}function Vt(){return globalThis[Ve]?.fallbackUrlResolver??null}const zt=new Map;function Jt(){zt.clear()}const bn="__ihab_core_pronunciation_resolver__";function qt(e){globalThis[bn]=e}function Qt(){return globalThis[bn]??null}let K=null;const ie=new WeakMap,ze=new WeakMap,Je=new WeakMap;let _n=!1;const Bn=e=>Math.max(0,Math.min(1,Number.isFinite(e)?e:0));function Zt(){if(_n||typeof document>"u")return;_n=!0;const e=()=>{try{K&&K.state!=="running"&&K.resume()}catch{}};for(const n of["pointerdown","touchend","keydown"])document.addEventListener(n,e,{capture:!0,passive:!0})}function Nn(){if(K)return K;try{const e=window.AudioContext||window.webkitAudioContext;return e?(K=new e,Zt(),K):null}catch{return null}}function Xt(){try{K?.resume()}catch{}}function qe(e,n){const t=ie.get(n);if(t)return t;try{const o=e.createMediaElementSource(n),r=e.createGain(),i=e.createAnalyser();i.fftSize=1024,i.smoothingTimeConstant=.6,r.gain.value=Bn(ze.get(n)??n.volume),o.connect(r),r.connect(i),r.connect(e.destination);try{n.volume=1}catch{}const u={gain:r,analyser:i};return ie.set(n,u),u}catch{return null}}function Ln(e){if(!e)return Promise.resolve(null);const n=ie.get(e);if(n)return Promise.resolve(n.analyser);const t=Nn();if(!t)return Promise.resolve(null);if(t.state==="running")return Promise.resolve(qe(t,e)?.analyser??null);const o=Je.get(e);if(o)return o;const r=Promise.resolve().then(()=>t.resume()).then(()=>t.state==="running"?qe(t,e)?.analyser??null:null).catch(()=>null).finally(()=>{Je.delete(e)});return Je.set(e,r),r}function eo(e){if(!e)return null;const n=ie.get(e);if(n)return n.analyser;const t=Nn();return t?t.state==="running"?qe(t,e)?.analyser??null:(Ln(e),null):null}function no(e,n){const t=Bn(n);ze.set(e,t);const o=ie.get(e);if(o){try{e.volume!==1&&(e.volume=1)}catch{}const r=o.gain.gain;try{const i=o.gain.context.currentTime;r.cancelScheduledValues(i),r.setTargetAtTime(t,i,.01)}catch{try{r.value=t}catch{}}return"gain"}try{e.volume=t}catch{}return"element"}function to(e){return ze.get(e)??e.volume}function oo(e,n){e.getFloatTimeDomainData(n);let t=0;for(let o=0;o<n.length;o++){const r=n[o];t+=r*r}return Math.sqrt(t/n.length)}const jn="__ihab_core_image_config__";function uo(e){globalThis[jn]=e}function Rn(){return globalThis[jn]??null}const ae="word_image_existence_map_v1";let M=null,se=0,On=-1,le=null;const Ne=new Map;function ce(){if(M)return M;try{const e=typeof localStorage<"u"?localStorage.getItem(ae):null,n=e?JSON.parse(e):null;M=n&&typeof n=="object"&&!Array.isArray(n)?n:{}}catch{M={}}return M}let Qe=null;function ro(){Qe||(Qe=setTimeout(()=>{Qe=null;try{typeof localStorage<"u"&&M&&localStorage.setItem(ae,JSON.stringify(M))}catch{}},200))}function Le(e,n){return`${e}_${n??1}`}async function kn(e,n){const t=ce(),o=Le(e,n);if(o in t)return t[o];if(Ne.has(o))return Ne.get(o);const r=Rn();if(!r)return!1;const i=r(e,n);if(!i)return!1;const u=fetch(i,{method:"HEAD",signal:Ht(8e3)}).then(a=>a.status>=500?null:a.ok,()=>null).then(a=>(Ne.delete(o),a===null?!1:(t[o]=a,se++,ro(),a)));return Ne.set(o,u),u}function io(e,n){const t=ce(),o=Le(e,n);return o in t?t[o]:void 0}async function ao(e,n={}){const{force:t=!1,concurrency:o=16,onProgress:r}=n,i=ce(),u=t?Array.from(new Set(e)):Array.from(new Set(e)).filter(l=>!(Le(l)in i));let a=0;if(u.length>0){let l=0;const c=Array.from({length:Math.min(o,u.length)},async()=>{for(;l<u.length;){const C=l++,s=u[C],g=Le(s);if(!t&&g in i){a++,r?.(a,u.length);continue}try{await kn(s)}catch{}a++,r?.(a,u.length)}});await Promise.all(c)}try{typeof localStorage<"u"&&M&&localStorage.setItem(ae,JSON.stringify(M))}catch{}return{checked:u.length,cached:Object.keys(i).length,total:e.length}}function so(){const e=ce();if(On===se)return le?{...le}:null;const n=Object.values(e);return le=n.length===0?null:{total:n.length,exists:n.filter(Boolean).length},On=se,le?{...le}:null}function lo(e){const n=ce();Object.assign(n,e),se++;try{typeof localStorage<"u"&&localStorage.setItem(ae,JSON.stringify(n))}catch{}}function co(){M={},se++;try{typeof localStorage<"u"&&localStorage.removeItem(ae)}catch{}}const A=["\u3131","\u3132","\u3134","\u3137","\u3138","\u3139","\u3141","\u3142","\u3143","\u3145","\u3146","\u3147","\u3148","\u3149","\u314A","\u314B","\u314C","\u314D","\u314E"],b=["\u314F","\u3150","\u3151","\u3152","\u3153","\u3154","\u3155","\u3156","\u3157","\u3158","\u3159","\u315A","\u315B","\u315C","\u315D","\u315E","\u315F","\u3160","\u3161","\u3162","\u3163"],B=["","\u3131","\u3132","\u3133","\u3134","\u3135","\u3136","\u3137","\u3139","\u313A","\u313B","\u313C","\u313D","\u313E","\u313F","\u3140","\u3141","\u3142","\u3144","\u3145","\u3146","\u3147","\u3148","\u314A","\u314B","\u314C","\u314D","\u314E"];function S(e){if(!e)return null;const n=e.charCodeAt(0)-44032;return n<0||n>=11172?null:{cho:Math.floor(n/588),jung:Math.floor(n%588/28),jong:n%28}}function Co(){const e=new Map;return n=>{let t=e.get(n);return t||(t=[...n].map(o=>S(o)),e.set(n,t)),t}}function x(e,n,t=0){return String.fromCharCode(44032+(e*21+n)*28+t)}function go(e,n){if(!e||!n||e===n||e.length!==n.length)return"random";let t=0,o=null;for(let r=0;r<e.length;r++){const i=S(e[r]),u=S(n[r]);if(!i||!u)return"random";if(i.cho===u.cho&&i.jung===u.jung&&i.jong===u.jong)continue;t++;const a=i.cho!==u.cho,l=i.jung!==u.jung,c=i.jong!==u.jong;(a?1:0)+(l?1:0)+(c?1:0)>1?o="multi":a?o="cho":l?o="jung":o="jong"}return t!==1?"random":o==="cho"?"cho":o==="jung"?"jung":o==="jong"?"jong":"random"}function In(e){const n=S(e[0]||"");return n?A[n.cho]:""}function $n(e){return[...e].map(n=>{const t=S(n);return t?A[t.cho]:n}).join("")}function Pn(e){return!!e&&[...e].every(n=>A.includes(n))}function fo(e,n){return n?(e=e.normalize("NFC"),n=n.normalize("NFC"),Pn(n)?$n(e).includes(n):e.toLowerCase().includes(n.toLowerCase())):!0}function ho(e,n){return Mn(n)(e)}function Mn(e){if(!e)return()=>!0;e=e.normalize("NFC");const n=[...e],t=u=>A.includes(u),o=u=>b.includes(u),r=n.map(u=>t(u)?"cho":o(u)?"jung":S(u)?"syl":"other"),i=n.map(u=>S(u));if(r.includes("other")){const u=e.toLowerCase();return a=>a.normalize("NFC").toLowerCase().includes(u)}return u=>{const a=[...u.normalize("NFC")];for(let l=0;l+n.length<=a.length;l++){let c=!0;for(let C=0;C<n.length;C++){const s=a[l+C],g=r[C];if(g==="cho"){if(In(s)!==n[C]){c=!1;break}}else if(g==="jung"){const h=S(s);if(!h||b[h.jung]!==n[C]){c=!1;break}}else{const h=i[C];if(h&&h.jong===0){const m=S(s);if(!m||m.cho!==h.cho||m.jung!==h.jung){c=!1;break}}else if(s!==n[C]){c=!1;break}}}if(c)return!0}return!1}}const je={3:["\u3131","\u3145"],5:["\u3134","\u3148"],6:["\u3134","\u314E"],9:["\u3139","\u3131"],10:["\u3139","\u3141"],11:["\u3139","\u3142"],12:["\u3139","\u3145"],13:["\u3139","\u314C"],14:["\u3139","\u314D"],15:["\u3139","\u314E"],18:["\u3142","\u3145"]},vn=Object.fromEntries(Object.entries(je).map(([e,n])=>[n.join(""),B[Number(e)]]));function mo(e,n){if(!e||!n)return!1;for(const t of e){const o=S(t);if(o&&A[o.cho]===n)return!0}return!1}function So(e,n){if(!e||!n)return!1;for(const t of e){const o=S(t);if(o&&b[o.jung]===n)return!0}return!1}function yo(e,n){if(!e||!n)return!1;for(const t of e){const o=S(t);if(!o||o.jong<=0)continue;if(B[o.jong]===n)return!0;const r=je[o.jong];if(r&&r.includes(n))return!0}return!1}function Do(e){if(!e)return 0;let n=0;for(const t of e)S(t)&&n++;return n}function Eo(e){if(!e)return!1;let n=!1;for(const t of e){const o=S(t);if(o&&(n=!0,o.jong>0))return!1}return n}function To(e,n){if(e.jong<=0)return!1;if(n.includes(B[e.jong]))return!0;const t=je[e.jong];return!!t&&t.some(o=>n.includes(o))}function po(e,n,t){if(!e)return!1;const o=[...e],r=i=>{const u=S(o[i]);if(!u||n.cho&&!n.cho.includes(A[u.cho])||n.jung&&!n.jung.includes(b[u.jung]))return!1;if(n.jongNone){if(u.jong>0)return!1}else if(n.jong&&!To(u,n.jong))return!1;return!0};if(t==="head")return r(0);if(t==="tail")return r(o.length-1);if(t==="mid"){for(let i=1;i<o.length-1;i++)if(r(i))return!0;return!1}for(let i=0;i<o.length;i++)if(r(i))return!0;return!1}function Gn(e){return e.includes(",")||e.includes("_")}function Fn(e){if(e==="")return[{kind:"any"}];if(e.includes("_")){const n=[...e];if(n.length>4)return[{kind:"invalid"}];const t=n[0]??"_",o=n[1]??"_";let r=n.slice(2).join("");if(r.length===2){const i=vn[r];if(!i)return[{kind:"invalid"}];r=i}return[{kind:"template",cho:t,jung:o,jong:r||"_"}]}return[...e].map(n=>S(n)?{kind:"syllable",ch:n}:A.includes(n)?{kind:"cho",jamo:n}:b.includes(n)?{kind:"jung",jamo:n}:{kind:"invalid"})}function Ao(e,n){switch(n.kind){case"any":return!0;case"syllable":{const t=S(n.ch);if(!t)return e===n.ch;if(t.jong===0){const o=S(e);return!!o&&o.cho===t.cho&&o.jung===t.jung}return e===n.ch}case"cho":{const t=S(e);return!!t&&A[t.cho]===n.jamo}case"jung":{const t=S(e);return!!t&&b[t.jung]===n.jamo}case"template":{const t=S(e);return!(!t||n.cho!=="_"&&A[t.cho]!==n.cho||n.jung!=="_"&&b[t.jung]!==n.jung||n.jong!=="_"&&B[t.jong]!==n.jong)}case"invalid":return!1}}function xn(e,n){e=e.normalize("NFC"),n=n.normalize("NFC");const t=n.split(",").flatMap(r=>Fn(r.trim()));if(t.length===0)return!0;const o=[...e];if(o.length<t.length)return!1;for(let r=0;r+t.length<=o.length;r++)if(t.every((i,u)=>Ao(o[r+u],i)))return!0;return!1}function wo(e){const n=e.split(",").flatMap(i=>Fn(i.trim())),t=new Set,o=new Set,r=new Set;for(const i of n)switch(i.kind){case"cho":t.add(i.jamo);break;case"jung":o.add(i.jamo);break;case"template":i.cho!=="_"&&t.add(i.cho),i.jung!=="_"&&o.add(i.jung),i.jong!=="_"&&r.add(i.jong);break;case"syllable":{const u=S(i.ch);u&&(t.add(A[u.cho]),o.add(b[u.jung]),u.jong!==0&&r.add(B[u.jong]));break}}return t.size===0&&o.size===0&&r.size===0?null:{cho:t.size?[...t]:null,jung:o.size?[...o]:null,jong:r.size?[...r]:null}}function bo(e){return!!S(e)||A.includes(e)||b.includes(e)}function _o(e){const n=e.normalize("NFC").trim();if(!n)return{ok:!0};for(const t of n.split(",")){const o=t.trim();if(o!==""){if(o.includes("_")){const r=[...o];if(r.length>4)return{ok:!1};const i=r[0],u=r[1],a=r.slice(2).join(""),l=i===void 0||i==="_"||A.includes(i),c=u===void 0||u==="_"||b.includes(u),C=a===""||a==="_"||B.filter(Boolean).includes(a)||!!vn[a];if(l&&c&&C)continue;return{ok:!1}}if(![...o].every(bo))return{ok:!1}}}return{ok:!0}}A.length,b.length,B.length;function Bo(e,n){const t=n.normalize("NFC").trim();if(!t||!/[^\s,_]/.test(t))return e;if(Gn(t))return e.filter(l=>xn(l.word,t));const o=Mn(t),r=[...t].length,i=l=>!!l&&o(l.normalize("NFC").slice(0,r)),u=[],a=[];for(const l of e)(o(l.word)||o(l.pronunciation??""))&&(i(l.word)||i(l.pronunciation??"")?u:a).push(l);return u.concat(a)}const Ze="word_pair_index_v2",Xe="word_pair_index_sig_v2";let v=null,Ce=null;function Wn(){try{if(typeof localStorage>"u")return null;const e=localStorage.getItem(Ze),n=localStorage.getItem(Xe);return!e||!n?null:{index:JSON.parse(e),sig:n}}catch{return null}}function No(e,n){try{if(typeof localStorage>"u")return;localStorage.setItem(Ze,JSON.stringify(e)),localStorage.setItem(Xe,n)}catch{}}function Lo(e){const n=e.map(o=>`${o.word}|${o.pron??""}`).sort();let t=0;for(const o of n)for(let r=0;r<o.length;r++)t=(t<<5)-t+o.charCodeAt(r)|0;return`${n.length}-${t}`}async function jo(e,n){const t=new Set,o=[];for(const c of e){if(!c.word||t.has(c.word))continue;const C=c.pron||c.word,s=Array.from(C).map(S);s.some(g=>g===null)||s.length===Array.from(c.word).length&&(t.add(c.word),o.push({word:c.word,syls:s}))}const r={},i=o.length,u=new Map;for(const c of o){const C=c.syls.length;u.has(C)||u.set(C,[]),u.get(C).push(c)}let a=0;const l=["cho","jung","jong"];for(const c of u.values()){const C=c[0].syls.length;for(let s=0;s<C;s++)for(const g of l){const h=new Map;for(const m of c){let y="";for(let f=0;f<C;f++){f>0&&(y+="~");const d=m.syls[f];f===s?g==="cho"?y+=`*:${d.jung}:${d.jong}`:g==="jung"?y+=`${d.cho}:*:${d.jong}`:y+=`${d.cho}:${d.jung}:*`:y+=`${d.cho}:${d.jung}:${d.jong}`}let D=h.get(y);D||(D=[],h.set(y,D)),D.push(m)}for(const m of h.values())if(!(m.length<2))for(let y=0;y<m.length;y++){const D=m[y];for(let f=y+1;f<m.length;f++){const d=m[f];D.syls[s][g]!==d.syls[s][g]&&(r[D.word]||(r[D.word]={cho:[],jung:[],jong:[]}),r[d.word]||(r[d.word]={cho:[],jung:[],jong:[]}),r[D.word][g].push(d.word),r[d.word][g].push(D.word))}}}a+=c.length,n?.(a,i),await new Promise(s=>setTimeout(s,0))}return i>0&&n?.(i,i),r}let en=0;async function Ro(e,n={}){const t=Lo(e);if(!n.force){if(v&&Ce===t)return v;const i=Wn();if(i&&i.sig===t)return v=i.index,Ce=t,v}const o=++en,r=await jo(e,n.onProgress);return o===en&&(v=r,Ce=t,No(r,t)),r}function Yn(){if(v)return v;const e=Wn();return e?(v=e.index,Ce=e.sig,v):null}function Oo(){en+=1,v=null,Ce=null;try{typeof localStorage<"u"&&(localStorage.removeItem(Ze),localStorage.removeItem(Xe))}catch{}}const nn={cho:A,jung:b,jong:B},k=e=>Array.isArray(e)?e.length>0:!!e;function tn(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++){const o=e[t],r=n[t];if(!(!o||!r)&&(o.cho!==r.cho&&A[o.cho]==="\u3147"!=(A[r.cho]==="\u3147")||o.jong!==r.jong&&o.jong===0!=(r.jong===0)))return!0}return!1}function Hn(e,n,t){const o=t.pronOf(e),r=t.decompOf,i=t.sameStructureOnly&&r?r(o):null,u=[];for(const a of n)a!==e&&(t.okSet&&!t.okSet.has(a)||t.pronOf(a)!==o&&(i&&r&&tn(i,r(t.pronOf(a)))||u.push(a)));return u}function ko(e,n,t){const o=n?.[e];if(!o)return[];const r=t.kind?o[t.kind]??[]:[...o.cho??[],...o.jung??[],...o.jong??[]];return Hn(e,r,t)}function Io(e,n,t,o,r,i,u){const a=["cho","jung","jong"].filter(g=>k(e[g])),l={};for(const g of a){const h=e[g];l[g]=new Set(Array.isArray(h)?h:[h])}const c=r==="pron",C=new Map;for(const g of n){const h=t(i(g));if(h.some(f=>!f))continue;let m=h;if(!c&&(m=t(g),m.length!==h.length||m.some(f=>!f)))continue;const y=h.length,D=C.get(y);D?D.push({w:g,dPron:h,dPos:m}):C.set(y,[{w:g,dPron:h,dPos:m}])}const s=new Map;for(const[g,h]of C){const m=new Map,y=(D,f)=>{const d=D.dPos[f];return d!=null&&a.every(E=>l[E].has(nn[E][d[E]]))};for(const D of h){let f;if(u==="head")f=y(D,0)?0:-1;else if(u==="tail")f=y(D,g-1)?g-1:-1;else if(u==="mid"){f=-1;for(let E=1;E<g-1;E++)if(y(D,E)){f=E;break}}else f=D.dPos.findIndex(E=>E!=null&&a.every(p=>l[p].has(nn[p][E[p]])));if(f<0)continue;const d=m.get(f);d?d.push(D):m.set(f,[D])}for(const[D,f]of m){const d=a.includes("cho"),E=a.includes("jung"),p=a.includes("jong"),P=w=>{let j="";for(let O=0;O<g;O++){const T=w[O];O===D?j+=(d?"*":T.cho)+"."+(E?"*":T.jung)+"."+(p?"*":T.jong)+".":j+=T.cho+"."+T.jung+"."+T.jong+"."}return j},L=new Map;for(const w of h){const j=P(w.dPron),O=L.get(j);O?O.push(w):L.set(j,[w])}for(const w of f){const j=L.get(P(w.dPron))??[],O=[];for(const T of j){if(T.w===w.w)continue;let I=!0;for(const F of a){const Q=w.dPron[D][F],z=T.dPron[D][F];if(z===Q){I=!1;break}if(c&&l[F].has(nn[F][z])){I=!1;break}}I&&(o&&tn(w.dPron,T.dPron)||O.push(T.w))}s.set(w.w,O)}}}return s}const Re=0,Kn=1,J=2,on=3,$o=4,Oe=5,un=6,ke=7,Po=8,rn=9,X=10,Mo=11,ge=12,vo=13,de=14,Ie=15,$e=16,fe=17,Go=18,$=0,W=1,Fo=3,U=4,an=5,he=6,G=7,_=8,Un=9,Vn=10,Pe=11,zn=12,sn=13,ee=15,Me=16,Y=17,Jn=18,ln=21,cn=27,xo=20,Wo={1:Re,2:Kn,4:J,7:on,8:Oe,16:un,17:ke,19:rn,20:X,22:ge,23:de,24:Ie,25:$e,26:fe},Yo={[Fo]:[W,X],[an]:[U,ge],[Un]:[_,Re],[Vn]:[_,un],[Pe]:[_,ke],[zn]:[_,X],[sn]:[_,$e],14:[_,fe],[Jn]:[Y,X]},Ho={[he]:J,[ee]:Oe},Cn={2:W,24:W,3:W,9:W,5:U,6:U,19:G,20:G,22:G,23:G,25:G,27:G,11:_,12:_,13:_,15:_,10:Me,14:Y,18:Y,26:Y},qn={[Re]:Ie,[on]:$e,[ke]:fe,[ge]:de},Qn={[Re]:Kn,[on]:$o,[ke]:Po,[rn]:X,[ge]:vo},Ko=new Set([an,Vn,Pe,zn,sn,ee,Jn]),Uo=new Set(["\uBC1F"]);function Vo(e){const n=(e??"").trim();if(!n)return"";const t=[...n],o=t.map(S);if(o.some(i=>i===null))return n;const r=o;for(let i=0;i<r.length;i++){const u=r[i],a=r[i+1],l=u.jong;if(!a){u.jong=Cn[u.jong]??u.jong;break}if(u.jong===$)continue;if(a.cho===Mo){if(a.jung===xo){if(u.jong===G){u.jong=$,a.cho=ge;continue}if(u.jong===25){u.jong=$,a.cho=de;continue}if(u.jong===sn){u.jong=_,a.cho=de;continue}}if(u.jong===cn){u.jong=$;continue}const C=Ho[u.jong];if(C!==void 0){u.jong=$,a.cho=C;continue}const s=Yo[u.jong];if(s){u.jong=s[0],a.cho=s[1];continue}const g=Wo[u.jong];g!==void 0&&(u.jong=$,a.cho=g);continue}if((u.jong===cn||u.jong===he||u.jong===ee)&&qn[a.cho]!==void 0){a.cho=qn[a.cho],u.jong=u.jong===he?U:u.jong===ee?_:$;continue}if((u.jong===cn||u.jong===he||u.jong===ee)&&a.cho===rn){a.cho=X,u.jong=u.jong===he?U:u.jong===ee?_:$;continue}if(a.cho===Go){if(u.jong===an){u.jong=U,a.cho=de;continue}if(u.jong===Un){u.jong=_,a.cho=Ie;continue}if(u.jong===Pe){u.jong=_,a.cho=fe;continue}const C=Cn[u.jong]??u.jong;if(C===W){u.jong=$,a.cho=Ie;continue}if(C===G){u.jong=$,a.cho=$e;continue}if(C===Y){u.jong=$,a.cho=fe;continue}}let c=Cn[u.jong]??u.jong;l===Pe&&Uo.has(t[i])&&(c=Y),u.jong=c,Qn[a.cho]!==void 0&&(c===W||c===G||c===Y||Ko.has(l))&&(a.cho=Qn[a.cho]),(a.cho===J||a.cho===un)&&(u.jong===W?u.jong=ln:u.jong===G?u.jong=U:u.jong===Y&&(u.jong=Me)),a.cho===Oe?u.jong===U?u.jong=_:u.jong===Me||u.jong===ln?a.cho=J:u.jong===W?(u.jong=ln,a.cho=J):u.jong===Y&&(u.jong=Me,a.cho=J):u.jong===_&&a.cho===J&&(a.cho=Oe)}return r.map(i=>x(i.cho,i.jung,i.jong)).join("")}const zo={\u3131:"\u3131",\u3132:"\u3131",\u314B:"\u3131",\u3133:"\u3131",\u313A:"\u3131",\u3134:"\u3134",\u3135:"\u3134",\u3136:"\u3134",\u3137:"\u3137",\u3145:"\u3137",\u3146:"\u3137",\u3148:"\u3137",\u314A:"\u3137",\u314C:"\u3137",\u314E:"\u3137",\u3139:"\u3139",\u313C:"\u3139",\u313D:"\u3139",\u313E:"\u3139",\u3140:"\u3139",\u3141:"\u3141",\u313B:"\u3141",\u3142:"\u3142",\u314D:"\u3142",\u313F:"\u3142",\u3144:"\u3142",\u3147:"\u3147"};function Zn(e){return zo[e]??e}const ne=/[ㄱ-ㅎ]/,Jo=/[ㅏ-ㅣ]/;function me(e){e=e.normalize("NFC");for(let n=e.length-1;n>=0;n--){const t=e[n],o=t.charCodeAt(0);if(o>=44032&&o<=55203||ne.test(t)||Jo.test(t))return t}return null}function Xn(e){const n=me(e);if(!n)return"\uAC00";const t=n.charCodeAt(0);return t>=44032&&t<=55203?(t-44032)%28!==0?"\uC774":"\uAC00":ne.test(n)?"\uC774":"\uAC00"}function qo(e){return`${e}${Xn(e)}`}function et(e){const n=me(e);if(!n)return"\uB97C";const t=n.charCodeAt(0);return t>=44032&&t<=55203?(t-44032)%28!==0?"\uC744":"\uB97C":ne.test(n)?"\uC744":"\uB97C"}function Qo(e){return`${e}${et(e)}`}function nt(e){const n=me(e);if(!n)return"\uB294";const t=n.charCodeAt(0);return t>=44032&&t<=55203?(t-44032)%28!==0?"\uC740":"\uB294":ne.test(n)?"\uC740":"\uB294"}function Zo(e){return`${e}${nt(e)}`}function tt(e){const n=me(e);if(!n)return"\uC640";const t=n.charCodeAt(0);return t>=44032&&t<=55203?(t-44032)%28!==0?"\uACFC":"\uC640":ne.test(n)?"\uACFC":"\uC640"}function Xo(e){return`${e}${tt(e)}`}function ot(e){const n=me(e);if(!n)return"\uB85C";const t=n.charCodeAt(0);if(t>=44032&&t<=55203){const o=(t-44032)%28;return o===0||o===8?"\uB85C":"\uC73C\uB85C"}return n==="\u3139"?"\uB85C":ne.test(n)?"\uC73C\uB85C":"\uB85C"}function eu(e){return`${e}${ot(e)}`}function nu(e,n,t){const o=e.slice(),[r]=o.splice(n,1);return o.splice(t,0,r),o}function R(e,n=Math.random){const t=e.slice();for(let o=t.length-1;o>0;o--){const r=Math.floor(n()*(o+1));[t[o],t[r]]=[t[r],t[o]]}return t}function H(e,n,t=Math.random){return!Array.isArray(e)||e.length===0||n<=0?[]:n>=e.length?R(e,t):R(e,t).slice(0,n)}const ut={SAME_SOUND_PICK:{difficulty:!0,choseong:!0,group:"discrimination"},SAME_OR_DIFF:{difficulty:!0,choseong:!0,group:"discrimination"},HEAR_AND_PICK_SAME:{difficulty:!0,choseong:!0,group:"discrimination"},HEAR_AND_PICK_INCLUDED:{difficulty:!0,choseong:!0,group:"discrimination"},STARTS_WITH_SAME_SOUND:{difficulty:!1,choseong:!0,group:"discrimination"},LISTEN_AND_REMEMBER_ORDER:{difficulty:!1,choseong:!0,group:"attention"},MERGE_2_SYLLABLES:{difficulty:!1,choseong:!0,group:"synthesis"},MERGE_3_SYLLABLES:{difficulty:!1,choseong:!0,group:"synthesis"},MERGE_2_PHONEMES:{difficulty:!1,choseong:!0,group:"synthesis"},MERGE_3_PHONEMES:{difficulty:!1,choseong:!0,group:"synthesis"},DROP_1_FROM_2SYLL:{difficulty:!1,choseong:!0,group:"deletion"},DROP_1_FROM_3SYLL:{difficulty:!1,choseong:!0,group:"deletion"},DROP_PART_FROM_COMPOUND:{difficulty:!1,choseong:!0,group:"deletion"},DROP_FINAL_CONSONANT_FROM_1SYLL:{difficulty:!1,choseong:!0,group:"deletion"},REMOVE_CONSONANT_AND_IDENTIFY_PHONEME:{difficulty:!1,choseong:!0,group:"deletion"},CHANGE_1_SYLL_IN_2SYLL:{difficulty:!0,choseong:!0,group:"substitution"},CHANGE_1_SYLL_IN_3SYLL:{difficulty:!0,choseong:!0,group:"substitution"},CHANGE_1_PHONEME_IN_1SYLL:{difficulty:!1,choseong:!0,group:"substitution"},CHANGE_1_PHONEME_IN_2SYLL:{difficulty:!0,choseong:!0,group:"substitution"}};function tu(e){const n=e?ut[e]?.group:void 0;return n==="synthesis"||n==="deletion"||n==="substitution"?n:null}const ou=A.indexOf("\u3147"),rt={DROP_FINAL_CONSONANT_FROM_1SYLL:{syllables:1,syllable:e=>e.jong>0},REMOVE_CONSONANT_AND_IDENTIFY_PHONEME:{syllables:1,syllable:e=>e.jong===0&&e.cho!==ou},MERGE_2_SYLLABLES:{syllables:2,syllable:()=>!0},MERGE_3_SYLLABLES:{syllables:3,syllable:()=>!0},MERGE_2_PHONEMES:{syllables:1,syllable:e=>e.jong===0},MERGE_3_PHONEMES:{syllables:1,syllable:e=>e.jong>0&&!je[e.jong]}},uu=new Set([]);function ru(e){return e in rt}function iu(e,n){const t=rt[e];if(!t)return!0;const o=[...n];if(o.length!==t.syllables)return!1;const r=S(o[0]);return!!r&&t.syllable(r)}function au(e){return uu.has(e)}function su(e){const n=e.charCodeAt((e.length||1)-1)||0;return n<44032||n>55203||(n-44032)%28===0?"\uC640":"\uACFC"}function gn(e){const n=e.charCodeAt((e.length||1)-1)||0;return n<44032||n>55203||(n-44032)%28===0?"\uB97C":"\uC744"}function it(e){const n=e.charCodeAt((e.length||1)-1)||0;if(n<44032||n>55203)return"\uB85C";const t=(n-44032)%28;return t===0||t===8?"\uB85C":"\uC73C\uB85C"}function at(e){const n=e.charAt((e.length||1)-1),t=n.charCodeAt(0)||0;return t>=44032&&t<=55203?(t-44032)%28===0?"\uAC00":"\uC774":/[ㄱ-ㅎ]/.test(n)?"\uC774":"\uAC00"}const st={\u3131:"\uAE30\uC5ED",\u3132:"\uC30D\uAE30\uC5ED",\u3134:"\uB2C8\uC740",\u3137:"\uB514\uADFF",\u3138:"\uC30D\uB514\uADFF",\u3139:"\uB9AC\uC744",\u3141:"\uBBF8\uC74C",\u3142:"\uBE44\uC74D",\u3143:"\uC30D\uBE44\uC74D",\u3145:"\uC2DC\uC637",\u3146:"\uC30D\uC2DC\uC637",\u3147:"\uC774\uC751",\u3148:"\uC9C0\uC752",\u3149:"\uC30D\uC9C0\uC752",\u314A:"\uCE58\uC753",\u314B:"\uD0A4\uC754",\u314C:"\uD2F0\uC755",\u314D:"\uD53C\uC756",\u314E:"\uD788\uC757",\u3133:"\uAE30\uC5ED\uC2DC\uC637",\u3135:"\uB2C8\uC740\uC9C0\uC752",\u3136:"\uB2C8\uC740\uD788\uC757",\u313A:"\uB9AC\uC744\uAE30\uC5ED",\u313B:"\uB9AC\uC744\uBBF8\uC74C",\u313C:"\uB9AC\uC744\uBE44\uC74D",\u313D:"\uB9AC\uC744\uC2DC\uC637",\u313E:"\uB9AC\uC744\uD2F0\uC755",\u313F:"\uB9AC\uC744\uD53C\uC756",\u3140:"\uB9AC\uC744\uD788\uC757",\u3144:"\uBE44\uC74D\uC2DC\uC637",\u314F:"\uC544",\u3150:"\uC560",\u3151:"\uC57C",\u3152:"\uC598",\u3153:"\uC5B4",\u3154:"\uC5D0",\u3155:"\uC5EC",\u3156:"\uC608",\u3157:"\uC624",\u3158:"\uC640",\u3159:"\uC65C",\u315A:"\uC678",\u315B:"\uC694",\u315C:"\uC6B0",\u315D:"\uC6CC",\u315E:"\uC6E8",\u315F:"\uC704",\u3160:"\uC720",\u3161:"\uC73C",\u3162:"\uC758",\u3163:"\uC774"};function lu(e){if([...e].length!==1)return[e];const n=S(e);if(!n)return[e];const t=[A[n.cho],b[n.jung]];return n.jong!==0&&t.push(B[n.jong]),t}function lt(e,n=!1){const t=e.filter(Boolean);if(t.length<2)return"";const o=a=>st[a]??a,r=t.slice(0,-1).map(a=>`"${a}"${su(o(a))}`).join(" "),i=t[t.length-1],u=`"${i}"${gn(o(i))}`;return`${r} ${u} \uD569\uCE58\uBA74 \uC5B4\uB5A4 ${n?"\uC18C\uB9AC":"\uB2E8\uC5B4"}\uAC00 \uB418\uB098\uC694?`}function cu(e,n){return lt(n,e==="MERGE_2_PHONEMES"||e==="MERGE_3_PHONEMES")}function Cu(e,n){const t=String(n?.word??n?.original??""),o=String(n?.changedFrom??""),r=String(n?.changedTo??"");return e==="CHANGE_1_PHONEME_IN_1SYLL"?`"${t}"${gn(t)} "${r}"${it(r)} \uBC14\uAFB8\uBA74 \uBB34\uC5C7\uC774 \uB418\uB098\uC694?`:`"${t}"\uC5D0\uC11C "${o}"${gn(o)} "${r}"${it(r)} \uBC14\uAFB8\uBA74 \uBB34\uC5C7\uC774 \uB418\uB098\uC694?`}function gu(e,n){const t=String(n?.word??n?.original??n?.base??""),o=String(n?.dropped??"");if(e==="DROP_FINAL_CONSONANT_FROM_1SYLL")return`"${t}"\uC5D0\uC11C \uBC1B\uCE68\uC774 \uC5C6\uC5B4\uC9C0\uBA74 \uC5B4\uB5A4 \uB9D0\uC774 \uB418\uB098\uC694?`;if(e==="REMOVE_CONSONANT_AND_IDENTIFY_PHONEME"){const r=String(n?.missingConsonant??"");return`"${t}"\uC5D0\uC11C "${r}"${at(r)} \uC5C6\uC5B4\uC9C0\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB418\uB098\uC694?`}return`"${t}"\uC5D0\uC11C "${o}"${at(o)} \uC5C6\uC5B4\uC9C0\uBA74 \uC5B4\uB5A4 \uB9D0\uC774 \uB418\uB098\uC694?`}function du(e,n,t){switch(tu(e)){case"synthesis":return cu(e,t);case"substitution":return Cu(e,n);case"deletion":return gu(e,n);default:return""}}function fu(e){return e.replace(/"([ㄱ-ㅣ])"(으로|와|과|을|를|이|가|은|는|로)?/g,(n,t,o)=>{const r=st[t];if(!r)return n;if(!o)return`"${r}"`;const i=(r.charCodeAt(r.length-1)-44032)%28,u=i!==0;let a=o;return o==="\uC640"||o==="\uACFC"?a=u?"\uACFC":"\uC640":o==="\uC744"||o==="\uB97C"?a=u?"\uC744":"\uB97C":o==="\uC774"||o==="\uAC00"?a=u?"\uC774":"\uAC00":o==="\uC740"||o==="\uB294"?a=u?"\uC740":"\uB294":(o==="\uC73C\uB85C"||o==="\uB85C")&&(a=i===0||i===8?"\uB85C":"\uC73C\uB85C"),`"${r}"${a}`})}const hu=e=>e==null?[]:Array.isArray(e)?e:[e];function ct(e){if([...e].length!==1)return"";const n=S(e);if(!n)return"";const t=Zn(B[n.jong]),o=t===""?0:B.indexOf(t);return x(n.cho,n.jung,o<0?0:o)}function dn(e,n){return n.get(e)||ct(e)||e}function ve(e){return e?k(e.cho)?"cho":k(e.jung)?"jung":k(e.jong)?"jong":null:null}function q(e,n){const t=(r,i)=>!k(r)||hu(r).includes(i),o=n.jongNone?e.jong===0:t(n.jong,B[e.jong]);return t(n.cho,A[e.cho])&&t(n.jung,b[e.jung])&&o}function te(e,n,t){const o=[...e];if(t!=="pron")return o.map(i=>S(i));const r=[...n.get(e)||e];return r.length!==o.length?o.map(i=>S(i)):r.map(i=>S(i))}function oe(e,n,t,o,r){const i=n==="cho"?A:n==="jung"?b:B,u=e[n],a=[],l=s=>n==="jung"?Su(dn(s,r)):dn(s,r),c=new Map([[l(t),-1]]),C=R(i.map((s,g)=>g).filter(s=>s!==u&&(n!=="cho"||i[s]!=="\u3147")&&(n!=="jong"||s!==0)));for(const s of C){if(a.length>=o)break;const g=n==="cho"?x(s,e.jung,e.jong):n==="jung"?x(e.cho,s,e.jong):x(e.cho,e.jung,s),h=l(g),m=c.get(h);if(m!==void 0){n==="jung"&&m>=0&&r.has(g)&&!r.has(a[m])&&(a[m]=g);continue}c.set(h,a.length),a.push(g)}return a}const mu={\u3154:"\u3150",\u3156:"\u3152",\u315A:"\u3159",\u315E:"\u3159"};function Su(e){if([...e].length!==1)return e;const n=S(e);if(!n)return e;const t=mu[b[n.jung]];return t?x(n.cho,b.indexOf(t),n.jong):e}function yu(e,n,t,o,r,i=null){const u=[...e];if(u.length!==2)return null;const a=u.map(s=>S(s));if(a.some(s=>!s))return null;const l=te(e,t,o);if(l.some(s=>!s))return null;const c=ve(n);let C=c&&n?l.map((s,g)=>q(s,n)?g:-1).filter(s=>s>=0):[0,1];if(i!=null&&(C=C.filter(s=>s!==i)),!C.length)return null;for(const s of R(C)){const g=u[s];if(!r.has(g))continue;const h=oe(a[s],c??"cho",g,40,t),m=[];for(const y of h)if(y!==g&&r.has(y)&&!m.includes(y)&&m.push(y),m.length>=2)break;if(!(m.length<2))return{question:e,distractors:[g,...m]}}return null}function Du(e,n,t,o,r,i=null){const u=[...e];if(u.length!==3)return null;const a=u.map(s=>S(s));if(a.some(s=>!s))return null;const l=te(e,t,o);if(l.some(s=>!s))return null;const c=ve(n),C=c&&n?l.map((s,g)=>q(s,n)?g:-1).filter(s=>s>=0):[0,1,2];if(!C.length)return null;for(const s of R(C))for(const g of R([0,1,2].filter(h=>h!==s&&(i==null||h===i)))){const h=[0,1,2].filter(d=>d!==g),m=h.map(d=>u[d]).join("");if(!r.has(m))continue;const y=h.indexOf(s),D=oe(a[s],c??"cho",u[s],40,t),f=[];for(const d of D){const E=h.map(P=>u[P]);E[y]=d;const p=E.join("");if(p!==m&&r.has(p)&&!f.includes(p)&&f.push(p),f.length>=2)break}if(!(f.length<2))return{question:e,distractors:[m,...f]}}return null}function Eu(e,n,t,o,r,i=null){const u=[...e],a=u.length;if(a<2)return null;const l=[];for(let C=1;C<=a-1;C++)l.push({remain:u.slice(0,C).join(""),dropped:u.slice(C).join(""),droppedEnd:1}),l.push({remain:u.slice(a-C).join(""),dropped:u.slice(0,a-C).join(""),droppedEnd:0});const c=ve(n);for(const{remain:C,dropped:s,droppedEnd:g}of R(l)){if(i!=null&&g!==i||C===e||!r.has(C)||!r.has(s))continue;const h=[...C],m=h.map(f=>S(f));if(m.some(f=>!f))continue;const y=te(C,t,o);if(y.some(f=>!f))continue;const D=c&&n?y.map((f,d)=>q(f,n)?d:-1).filter(f=>f>=0):h.map((f,d)=>d);if(D.length)for(const f of R(D)){const d=oe(m[f],c??"cho",h[f],40,t),E=[];for(const p of d){const P=[...h];P[f]=p;const L=P.join("");if(L!==C&&r.has(L)&&!E.includes(L)&&E.push(L),E.length>=2)break}if(E.length>=2)return{question:e,distractors:[C,...E],dropped:s}}}return null}function Tu(e,n,t,o,r,i=null){if([...e].length!==1)return null;const u=S(t.get(e)||e);if(!u||u.jong===0)return null;const a=x(u.cho,u.jung,0),l=oe({cho:u.cho,jung:u.jung,jong:0},"cho",a,2,t);return l.length<2?null:{question:e,distractors:[a,...l]}}const fn=A.indexOf("\u3147");function pu(e,n,t,o,r,i=null){if([...e].length!==1)return null;const u=S(t.get(e)||e);if(!u||u.jong!==0||u.cho===fn)return null;const a=x(fn,u.jung,0),l=oe({cho:fn,jung:u.jung,jong:0},"jung",a,2,t);return l.length<2?null:{question:e,distractors:[a,...l]}}function Au(e){const n=new Map;for(const t of e){const o=[...t],r=o.length;if(!(r<2||r>3))for(let i=0;i<r;i++){let u=r+"|"+i+"|";for(let l=0;l<r;l++)u+=l===i?"*":o[l];const a=n.get(u);a?a.push(t):n.set(u,[t])}}return n}function wu(e,n,t,o,r,i=null,u=null,a=2){const l=[...e],c=l.length;if(c<2||c>3)return null;const C=l.map(d=>S(d));if(C.some(d=>!d))return null;const s=te(e,t,o);if(s.some(d=>!d))return null;const g=d=>t.get(d)??d,h=g(e),m=!!n&&(k(n.cho)||k(n.jung)||k(n.jong)),y=!!u&&(k(u.cho)||k(u.jung)||k(u.jong)),D=d=>{let E=c+"|"+d+"|";for(let p=0;p<c;p++)E+=p===d?"*":l[p];return E};let f;if(i!=null){if(i>=c||m&&!q(s[i],n))return null;f=[i]}else m?f=s.map((d,E)=>q(d,n)?E:-1).filter(d=>d>=0):f=Array.from({length:c},(d,E)=>E);for(const d of R(f)){const E=r.get(D(d))??[],p=[],P=[];for(const T of E){if(T===e)continue;const I=[...T].map(_e=>S(_e)),F=C[d],Q=I[d];if(!F||!Q)continue;let z=0;if(F.cho!==Q.cho&&z++,F.jung!==Q.jung&&z++,F.jong!==Q.jong&&z++,!(z<a||g(T)===h))if(y){const _e=te(T,t,o)[d];_e&&q(_e,u)?p.push(T):P.push(T)}else p.push(T)}if(!p.length)continue;const L=R(p)[0],w=[],j=new Set([h,g(L)]),O=y?P:p.filter(T=>T!==L);for(const T of R(O)){const I=g(T);if(!j.has(I)&&(j.add(I),w.push(T),w.length>=2))break}if(!y&&w.length<2)for(const T of R(E)){if(T===e||T===L)continue;const I=g(T);if(!j.has(I)&&(j.add(I),w.push(T),w.length>=2))break}if(!(w.length<2))return{question:e,distractors:[L,...w]}}return null}const bu=()=>{const e="\uC54C \uC218 \uC5C6\uB294 \uC624\uB958",n=typeof Be?.t=="function"?Be.t("common.unknownError",{defaultValue:e}):void 0;return typeof n=="string"&&n?n:e};function _u(e,n){if(n===void 0&&(n=bu()),e instanceof Error)return e.message||n;if(typeof e=="string")return e||n;if(e&&typeof e=="object"){const t=e;for(const o of[t.message,t.error_description,t.error])if(typeof o=="string"&&o)return o}return n}const hn="\uB124\uD2B8\uC6CC\uD06C \uC5F0\uACB0\uC774 \uBD88\uC548\uC815\uD569\uB2C8\uB2E4. \uC5F0\uACB0 \uC0C1\uD0DC\uB97C \uD655\uC778\uD55C \uB4A4 \uB2E4\uC2DC \uC2DC\uB3C4\uD574 \uC8FC\uC138\uC694.",Bu=()=>{const e=typeof Be?.t=="function"?Be.t("common.networkError",{defaultValue:hn}):void 0;return typeof e=="string"&&e?e:hn};function Ct(e){return e?/failed to fetch|load failed|networkerror|network request failed|fetcherror/i.test(e):!1}function Nu(e){return Ct(e)?Bu():e}function Lu(e,n){return e==="id"?void 0:`${e}|${n?"asc":"desc"}`}function ju(e){const[n,t]=e.split("|");return{key:n,asc:t==="asc"}}function Ru(e){let n=e==null?"":String(e);return!(typeof e=="number"&&Number.isFinite(e))&&/^[=+\-@\t\r]/.test(n)&&(n=" "+n),/[",\n\r]/.test(n)?`"${n.replaceAll('"','""')}"`:n}function Ou(e,n){const t=new Blob(["\uFEFF"+n],{type:"text/csv;charset=utf-8"}),o=URL.createObjectURL(t),r=document.createElement("a");r.href=o,r.download=e,r.click(),URL.revokeObjectURL(o)}const gt="__ihab_core_word_pool__";function ku(){typeof window<"u"&&window.dispatchEvent(new CustomEvent("wordpool:update"))}function Iu(e,n){const t=new Map;for(const r of e)t.set(r.word,r);const o={entries:e,pairIndex:n??null,byWord:t};globalThis[gt]=o,ku()}function dt(){return globalThis[gt]??null}const ue=globalThis;function mn(e,n){const t=o=>{};try{const o=n();o&&typeof o.catch=="function"&&o.catch(t)}catch(o){t(o)}}function $u(e){ue.__ihabTrainingTimeLogger=e}function Pu(e){mn("time",()=>ue.__ihabTrainingTimeLogger?.(e))}function Mu(e){ue.__ihabTrainingCompletionLogger=e}function vu(e){mn("completion",()=>ue.__ihabTrainingCompletionLogger?.(e))}function Gu(e){ue.__ihabCrosswordLogger=e}function Fu(e){mn("crossword",()=>ue.__ihabCrosswordLogger?.(e))}function N(e){return typeof e=="string"?e.trim()||null:typeof e=="number"?String(e):null}function ft(e){for(const n of["correct","isCorrect","heard","judgement"])if(typeof e[n]=="boolean")return e[n];return e.score===1?!0:e.score===0?!1:null}function xu(e){return Array.isArray(e)?e.map((n,t)=>{const o=n??{};return{index:t,itemId:N(o.contextCode)??N(o.itemId)??N(o.itemCode)??N(o.id),question:N(o.question)??N(o.q)??N(o.sentence)??N(o.text)??N(o.prompt)??N(o.word)??N(o.targetSyllable),answer:N(o.answer),selected:N(o.selectedText)??N(o.selected),correct:ft(o)}}):[]}function Wu(e){return e.filter(n=>n.correct===!1)}let ht=null,mt=null,St=null;function Yu(e){ht=e}function Hu(e){mt=e}function Ku(e){St=e}async function Uu(e,n){try{return await ht?.(e,n)??null}catch{return null}}async function Vu(){try{return await mt?.()??null}catch{return null}}async function zu(e,n){try{return await St?.(e,n)??null}catch{return null}}const Ge=globalThis;function Ju(e){Ge.__ihabNoiseSettingsStore=e}async function qu(){try{return await Ge.__ihabNoiseSettingsStore?.load()??null}catch{return null}}function Qu(e){const n=t=>{};try{const t=Ge.__ihabNoiseSettingsStore?.save(e);t&&typeof t.catch=="function"&&t.catch(n)}catch(t){n(t)}}function Zu(e){try{Ge.__ihabNoiseSettingsStore?.applied?.(e)}catch{}}function Fe(e){const n=new TextEncoder().encode(String(e).normalize("NFC"));let t="";return n.forEach(o=>{t+=o.toString(16).padStart(2,"0")}),t}const Xu=Fe;function er(e,n){return`${e}/${Fe(n)}.mp3`}function nr(e={}){const n=e.storagePrefix??"audio-cache",t=e.voice??"ko-f",o=typeof e.speed=="number"?e.speed:1,r=e.filenameSanitizer??Fe;return async function(i){const u=String(i||"").trim();if(!u)return"";const a=`${r(u)}_${t}.mp3`,l=`${n}/${a}`;try{if(await An(l)){const c=await wn(l);if(c)return c}}catch{}if(e.generator)try{const c=await e.generator(u,l,e);if(c)return c}catch{}try{const c=`/api/tts?word=${encodeURIComponent(u)}&voice=${encodeURIComponent(t)}&speed=${encodeURIComponent(String(o))}`;return await fetch(c,{method:"GET"}),`/audio-cache/${a}`}catch{return`/audio-cache/${a}`}}}async function tr(e){if(typeof document<"u"){const n=document.activeElement;let t=null;try{if(t=document.createElement("textarea"),t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.opacity="0",t.style.pointerEvents="none",document.body.appendChild(t),t.focus(),t.select(),t.setSelectionRange(0,e.length),document.execCommand("copy"))return!0}catch{}finally{if(t?.parentNode&&t.parentNode.removeChild(t),n&&n!==document.activeElement&&typeof n.focus=="function"&&n.isConnected)try{n.focus({preventScroll:!0})}catch{}}}try{if(typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function")return await navigator.clipboard.writeText(e),!0}catch{}return!1}const re="Asia/Seoul",Se=e=>{const n=new Date(e);return Number.isNaN(n.getTime())?null:n};function or(e){const n=Se(e);return n?n.toLocaleDateString("ko-KR",{timeZone:re,year:"numeric",month:"short",day:"numeric"}):""}function ur(e){const n=Se(e);return n?n.toLocaleString("ko-KR",{timeZone:re,year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"}):""}function rr(e,n){const t=n.startsWith("ko")?"ko-KR":"en-US",o=Se(e);return o?o.toLocaleDateString(t,{timeZone:re,year:"numeric",month:"short",day:"numeric"}):""}function ir(e,n){const t=n.startsWith("ko")?"ko-KR":"en-US",o=Se(e);return o?o.toLocaleString(t,{timeZone:re,year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"}):""}function ar(e){const n=Se(e);return n?n.toLocaleString("ko-KR",{timeZone:re,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):""}function sr(e){if(e==null||e==="")return"";const n=e instanceof Date?e:new Date(e);return isNaN(n.getTime())?"":new Intl.DateTimeFormat("en-GB",{timeZone:re,hour:"2-digit",minute:"2-digit",hour12:!1}).format(n)}function Sn(){return ye(new Date)}function lr(){return yt(Sn())}const cr=540*60*1e3;function Cr(e,n,t){return new Date(Date.UTC(e,n,t)-cr)}function yt(e){const[n,t,o]=e.split("-").map(Number);return new Date(n,(t||1)-1,o||1)}function ye(e){if(e==null||e==="")return"";const n=e instanceof Date?e:new Date(e);return isNaN(n.getTime())?"":new Intl.DateTimeFormat("fr-CA",{timeZone:"Asia/Seoul"}).format(n)}function gr(e,n){if(!e)return"";const t=new Date(e).getTime();if(Number.isNaN(t))return"";const o=Math.max(0,Math.floor((Date.now()-t)/1e3)),r=Math.floor(o/60),i=Math.floor(r/60),u=Math.floor(i/24),a=Math.floor(u/7),l=Math.floor(u/30),c=Math.floor(u/365);return r<1?n("store.time.justNow","\uBC29\uAE08 \uC804"):r<60?n("store.time.minutesAgo",{n:r}):i<24?n("store.time.hoursAgo",{n:i}):u<7?n("store.time.daysAgo",{n:u}):a<5?n("store.time.weeksAgo",{n:a}):u<365?n("store.time.monthsAgo",{n:Math.min(l,11)}):n("store.time.yearsAgo",{n:c})}function dr(e,n={}){const{sep:t=".",pad:o=!0,trailingDot:r=!1,fallback:i="\u2014"}=n;if(!e)return i;const u=ye(e instanceof Date?e:String(e));if(!u)return i;const[a,l,c]=u.split("-"),C=o?l:String(Number(l)),s=o?c:String(Number(c));return`${a}${t}${C}${t}${s}${r?".":""}`}function fr(e){const n=e.normalize("NFKC").replace(/\D/g,"");if(/^(050\d|0303)/.test(n)){const o=n.slice(0,12);return o.length<=4?o:o.length<=8?`${o.slice(0,4)}-${o.slice(4)}`:`${o.slice(0,4)}-${o.slice(4,o.length-4)}-${o.slice(o.length-4)}`}if(/^1[5-9]\d{2}/.test(n)&&n.length<=8)return n.length<=4?n:`${n.slice(0,4)}-${n.slice(4)}`;const t=n.slice(0,11);return t.startsWith("02")?t.length<=2?t:t.length<=6?`${t.slice(0,2)}-${t.slice(2)}`:`${t.slice(0,2)}-${t.slice(2,t.length-4)}-${t.slice(t.length-4)}`:t.length<=3?t:t.length<=7?`${t.slice(0,3)}-${t.slice(3)}`:`${t.slice(0,3)}-${t.slice(3,t.length-4)}-${t.slice(t.length-4)}`}function hr(e){if(e){if(/^\d{4}\.\d{2}\.\d{2}$/.test(e))return e;if(/^\d{8}$/.test(e))return`${e.slice(0,4)}.${e.slice(4,6)}.${e.slice(6,8)}`;if(/^\d{4}-\d{2}-\d{2}$/.test(e))return e.replace(/-/g,".");if(/^\d{4}-\d{2}-\d{2}T/.test(e)){const n=new Date(e);return isNaN(n.getTime())?void 0:ye(n).replace(/-/g,".")}}}function mr(e){if(e)return/^\d{4}\.\d{2}\.\d{2}$/.test(e)?e.replace(/\./g,"-"):e}function Sr(e,n){if(!e)return"-";const t=/^(\d{1,2}):(\d{2})$/.exec(e.trim());if(!t)return e;const o=Number(t[1]),r=Number(t[2]),i=t[1].padStart(2,"0");return r===0?n("date.timeH",{h:o,hh:i,mm:t[2]}):n("date.timeHM",{h:o,hh:i,m:r,mm:t[2]})}function yr(e){return(e??0).toLocaleString("ko-KR")}const Dr=[{key:"FOOD",label:"\uC74C\uC2DD",icon:"salad",color:"#FF8A65",subs:[{key:"TRKRFD",label:"\uD55C\uAD6D \uC804\uD1B5\uC74C\uC2DD"},{key:"MDKRFD",label:"\uD55C\uAD6D \uD604\uB300\uC74C\uC2DD"},{key:"WRLDFD",label:"\uC138\uACC4\uC758 \uC74C\uC2DD"},{key:"MTRFRT",label:"\uC2DD\uC7AC\uB8CC\uC640 \uACFC\uC77C"},{key:"GEFDKL",label:"\uC74C\uC2DD \uC0C1\uC2DD"}]},{key:"HLTH",label:"\uAC74\uAC15",icon:"heart",color:"#66BB6A",subs:[{key:"HTETHB",label:"\uAC74\uAC15\uD55C \uC2DD\uC2B5\uAD00"},{key:"DISILL",label:"\uBCD1\uACFC \uC9C8\uD658"},{key:"EXCISE",label:"\uC6B4\uB3D9"},{key:"GEHTKL",label:"\uAC74\uAC15\uC0C1\uC2DD"}]},{key:"WETH",label:"\uB0A0\uC528",icon:"sun-medium",color:"#42A5F5",subs:[{key:"GESSKL",label:"\uACC4\uC808\uC0C1\uC2DD"},{key:"SNWRAN",label:"\uB208\uACFC \uBE44"},{key:"WTHFCT",label:"\uC77C\uAE30\uC608\uBCF4"},{key:"GEWTKL",label:"\uB0A0\uC528\uC0C1\uC2DD"}]},{key:"PRSN",label:"\uC778\uBB3C",icon:"user-round",color:"#AB47BC",subs:[{key:"JODYPS",label:"\uC870\uC120\uC2DC\uB300"},{key:"MDKRPS",label:"\uD55C\uAD6D \uADFC\uD604\uB300"},{key:"THKDPS",label:"\uC0BC\uAD6D\uC2DC\uB300"},{key:"WRLART",label:"\uC138\uACC4\uC758 \uC608\uC220\uAC00"},{key:"WRLPSN",label:"\uC138\uACC4\uC758 \uC778\uBB3C"}]},{key:"KRCT",label:"\uD55C\uAD6D\uBB38\uD654",icon:"bow-arrow",color:"#EC407A",subs:[{key:"KRLANG",label:"\uC6B0\uB9AC\uB9D0"},{key:"TRPLCT",label:"\uC804\uD1B5\uB180\uC774"},{key:"HERITG",label:"\uBB38\uD654\uC7AC"},{key:"EVTFES",label:"\uD589\uC0AC\uC640 \uCD95\uC81C"},{key:"GECTKL",label:"\uC0C1\uC2DD"}]},{key:"STRY",label:"\uC774\uC57C\uAE30",icon:"message-circle",color:"#8D6E63",subs:[{key:"FRYTAL",label:"\uB3D9\uD654"},{key:"AMZING",label:"\uC2E0\uAE30\uD55C \uC774\uC57C\uAE30"},{key:"DAYSTR",label:"\uC77C\uC0C1 \uC18D \uC774\uC57C\uAE30"}]},{key:"LOCA",label:"\uC9C0\uC5ED",icon:"map-pin",color:"#26A69A",subs:[{key:"KRLDMK",label:"\uD55C\uAD6D\uC758 \uBA85\uC18C"},{key:"SELNMK",label:"\uC11C\uC6B8\uC758 \uBA85\uC18C"},{key:"WRDTRB",label:"\uC138\uACC4\uC5EC\uD589"},{key:"NAVIGT",label:"\uAE38 \uCC3E\uAE30"}]},{key:"SOAR",label:"\uC0AC\uD68C\uC640 \uC608\uC220",icon:"landmark",color:"#5C6BC0",subs:[{key:"KRSOCI",label:"\uD55C\uAD6D"},{key:"ECONEW",label:"\uACBD\uC81C\uC640 \uB274\uC2A4"},{key:"GENART",label:"\uC608\uC220"},{key:"GELFKL",label:"\uC0DD\uD65C \uC0C1\uC2DD"}]},{key:"NTSC",label:"\uC790\uC5F0\uACFC \uACFC\uD559",icon:"leaf",color:"#9CCC65",subs:[{key:"ANIMAL",label:"\uB3D9\uBB3C"},{key:"PLANTS",label:"\uC2DD\uBB3C"},{key:"ETHPLT",label:"\uC9C0\uAD6C"},{key:"TOLELC",label:"\uB3C4\uAD6C\uC640 \uC804\uC790\uC81C\uD488"},{key:"GESCKL",label:"\uACFC\uD559\uC0C1\uC2DD"}]},{key:"SPRT",label:"\uC2A4\uD3EC\uCE20",icon:"trophy",color:"#FFCA28",subs:[{key:"INVDSP",label:"\uAC1C\uC778\uACBD\uAE30"},{key:"MARART",label:"\uACA9\uD22C\uAE30"},{key:"TEAMSP",label:"\uB2E8\uCCB4\uACBD\uAE30"},{key:"FOOTBL",label:"\uCD95\uAD6C"},{key:"GESPKL",label:"\uC2A4\uD3EC\uCE20 \uC0C1\uC2DD"}]}],Er=[{key:"LISTEN_IN_NOISE",label:"\uC18C\uC74C \uD558 \uBB38\uC7A5 \uB4E3\uAE30",icon:"party-popper",desc:"\uC18C\uC74C \uD658\uACBD \uC18D \uBB38\uC7A5 \uC774\uD574 \uD6C8\uB828"},{key:"SHORT_STORY",label:"\uC9E7\uC740 \uC774\uC57C\uAE30 \uB4E3\uAE30",icon:"message-square",desc:"\uC9E7\uC740 \uC774\uC57C\uAE30 + 4\uBB38\uC81C"},{key:"LONG_STORY",label:"\uAE34 \uC774\uC57C\uAE30 \uB4E3\uAE30",icon:"message-square-text",desc:"\uAE34 \uC774\uC57C\uAE30 \uC2EC\uD654 \uD6C8\uB828"},{key:"ORDERING_SENTENCE",label:"\uBB38\uC7A5 \uC21C\uC11C\uD654 \uD558\uAE30",icon:"align-start-vertical",desc:"\uC21C\uC11C \uBC30\uC5F4 \uD6C8\uB828"}];let yn=null;function Tr(e){yn=e}function pr(){return yn?.topicTypes??Dr}function Ar(){return yn?.trainingTypes??Er}const Dt="ihab_theme",Et="light";function Tt(){try{const e=localStorage.getItem(Dt);if(e==="light"||e==="dark"||e==="auto")return e}catch{}return Et}function pt(e){const n=e==="light"||e==="dark"||e==="auto"?e:Et;try{document.documentElement.setAttribute("data-theme",n),localStorage.setItem(Dt,n)}catch{}}function wr(){pt(Tt())}const At="ihab_font_scale",br="medium",_r=["medium","large1","large2","large3"];function wt(){try{const e=localStorage.getItem(At);if(_r.includes(e))return e}catch{}return br}function bt(e){try{document.documentElement.setAttribute("data-font-scale",e),localStorage.setItem(At,e)}catch{}}function Br(){bt(wt())}const De=[],Ee=[],Te=[],pe=[],Ae={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},we={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},Nr={LISTEN_IN_NOISE:3,SHORT_STORY:2,LONG_STORY:1,ORDERING_SENTENCE:2};let Dn=null,_t=null,V=null;function Bt({counts:e,forceRefresh:n}={}){const t=Object.assign({},Nr,e||{}),o=Sn(),r=ye(new Date(`${o}T00:00:00+09:00`).getTime()-864e5),i=JSON.stringify(t);if(!n&&_t===o&&Dn===i&&V)return Object.assign(Ae,V.today),Object.assign(we,V.yesterday?.selection||{LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]}),{today:Ae,yesterday:we};const u={LISTEN_IN_NOISE:H(De,Math.max(0,Number(t.LISTEN_IN_NOISE)||0)),SHORT_STORY:H(Ee,Math.max(0,Number(t.SHORT_STORY)||0)),LONG_STORY:H(Te,Math.max(0,Number(t.LONG_STORY)||0)),ORDERING_SENTENCE:H(pe,Math.max(0,Number(t.ORDERING_SENTENCE)||0))};let a=null;return V&&Dn===i&&V.yesterday&&V.yesterday.date===r&&(a=V.yesterday.selection),a||(a={LISTEN_IN_NOISE:H(De,Math.max(0,Number(t.LISTEN_IN_NOISE)||0)),SHORT_STORY:H(Ee,Math.max(0,Number(t.SHORT_STORY)||0)),LONG_STORY:H(Te,Math.max(0,Number(t.LONG_STORY)||0)),ORDERING_SENTENCE:H(pe,Math.max(0,Number(t.ORDERING_SENTENCE)||0))}),Object.assign(Ae,u),Object.assign(we,a),_t=o,Dn=i,V={today:u,yesterday:{date:r,countsKey:i,selection:a}},{today:Ae,yesterday:we}}function Lr(){return{today:Ae,yesterday:we}}function jr(){return{LISTEN_IN_NOISE:De,SHORT_STORY:Ee,LONG_STORY:Te,ORDERING_SENTENCE:pe}}let xe=!1,be=null;async function Rr(){try{const e={url:typeof document>"u"?require("url").pathToFileURL(__filename).href:Ye&&Ye.tagName.toUpperCase()==="SCRIPT"&&Ye.src||new URL("utils.cjs.js",document.baseURI).href}&&void 0||"/",n=await fetch(`${e}data/allTrainingData.json`);return n.ok?await n.json():null}catch{return null}}async function Nt(){if(!xe)return be||(be=(async()=>{const e=await Rr();if(!e){be=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}const n={noise:[],short:[],long:[],order:[]};try{for(const t of Object.keys(e||{})){const o=e[t]||[];for(const r of o){if(!r||typeof r!="object")continue;const i=r,u=String(i.training_type||t),a=String(i.category_main_code||i.category_main||i.category_0||""),l=String(i.category_sub_code||i.category_sub||i.category_1||""),c=Object.assign({},i,{training_type:u,category_0:a,category_1:l});u==="LISTEN_IN_NOISE"?n.noise.push(c):u==="SHORT_STORY"?n.short.push(c):u==="LONG_STORY"?n.long.push(c):u==="ORDERING_SENTENCE"&&n.order.push(c)}}}catch{be=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}De.push(...n.noise),Ee.push(...n.short),Te.push(...n.long),pe.push(...n.order),xe=!0;try{Bt()}catch{}try{window.dispatchEvent(new Event("speechear.data.updated"))}catch{}})(),be)}function Or(){return xe}async function kr(e=3e3){const n=Nt();let t;try{await Promise.race([n,new Promise(o=>{t=setTimeout(o,e)})])}finally{t!==void 0&&clearTimeout(t)}return xe}const Ir=[{key:"LISTEN_IN_NOISE",label:"\uC18C\uC74C \uD558 \uBB38\uC7A5 \uB4E3\uAE30",icon:"party-popper",desc:"\uB2E4\uC591\uD55C \uC18C\uC74C \uD658\uACBD\uC5D0\uC11C \uBB38\uC7A5 \uCCAD\uB825\uC744 \uD6C8\uB828\uD569\uB2C8\uB2E4."},{key:"SHORT_STORY",label:"\uC9E7\uC740 \uC774\uC57C\uAE30 \uB4E3\uAE30",icon:"message-square",desc:"\uC9E7\uC740 \uC774\uC57C\uAE30\uB97C \uB4E3\uACE0 \uAE30\uC5B5\uD558\uC5EC \uBB38\uC81C\uB97C \uD480\uC5B4\uBD05\uB2C8\uB2E4."},{key:"LONG_STORY",label:"\uAE34 \uC774\uC57C\uAE30 \uB4E3\uAE30",icon:"message-square-text",desc:"\uAE34 \uC774\uC57C\uAE30\uB97C \uB4E3\uACE0 \uAE30\uC5B5\uD558\uC5EC \uB2E4\uC218\uC758 \uBB38\uC81C\uB97C \uD480\uC5B4\uBD05\uB2C8\uB2E4."},{key:"ORDERING_SENTENCE",label:"\uBB38\uC7A5 \uC21C\uC11C\uD654 \uD558\uAE30",icon:"align-start-vertical",desc:"\uC5EC\uB7EC\uAC1C\uC758 \uC9E7\uC740 \uBB38\uC7A5\uC744 \uB4E3\uACE0 \uAE30\uC5B5\uD558\uC5EC \uADF8 \uC21C\uC11C\uC5D0 \uB9DE\uAC8C \uBC30\uC5F4\uD569\uB2C8\uB2E4."}],$r=[{key:"FOOD",label:"\uC74C\uC2DD",icon:"salad",color:"#FF8A65",subs:[{key:"TRKRFD",label:"\uD55C\uAD6D \uC804\uD1B5\uC74C\uC2DD"},{key:"MDKRFD",label:"\uD55C\uAD6D \uD604\uB300\uC74C\uC2DD"},{key:"WRLDFD",label:"\uC138\uACC4\uC758 \uC74C\uC2DD"},{key:"MTRFRT",label:"\uC2DD\uC7AC\uB8CC\uC640 \uACFC\uC77C"},{key:"GEFDKL",label:"\uC74C\uC2DD \uC0C1\uC2DD"}]},{key:"HLTH",label:"\uAC74\uAC15",icon:"heart",color:"#66BB6A",subs:[{key:"HTETHB",label:"\uAC74\uAC15\uD55C \uC2DD\uC2B5\uAD00"},{key:"DISILL",label:"\uBCD1\uACFC \uC9C8\uD658"},{key:"EXCISE",label:"\uC6B4\uB3D9"},{key:"GEHTKL",label:"\uAC74\uAC15\uC0C1\uC2DD"}]},{key:"WETH",label:"\uB0A0\uC528",icon:"sun-medium",color:"#42A5F5",subs:[{key:"GESSKL",label:"\uACC4\uC808\uC0C1\uC2DD"},{key:"SNWRAN",label:"\uB208\uACFC \uBE44"},{key:"WTHFCT",label:"\uC77C\uAE30\uC608\uBCF4"},{key:"GEWTKL",label:"\uB0A0\uC528\uC0C1\uC2DD"}]},{key:"PRSN",label:"\uC778\uBB3C",icon:"user-round",color:"#AB47BC",subs:[{key:"JODYPS",label:"\uC870\uC120\uC2DC\uB300"},{key:"MDKRPS",label:"\uD55C\uAD6D \uADFC\uD604\uB300"},{key:"THKDPS",label:"\uC0BC\uAD6D\uC2DC\uB300"},{key:"WRLART",label:"\uC138\uACC4\uC758 \uC608\uC220\uAC00"},{key:"WRLPSN",label:"\uC138\uACC4\uC758 \uC778\uBB3C"}]},{key:"KRCT",label:"\uD55C\uAD6D\uBB38\uD654",icon:"bow-arrow",color:"#EC407A",subs:[{key:"KRLANG",label:"\uC6B0\uB9AC\uB9D0"},{key:"TRPLCT",label:"\uC804\uD1B5\uB180\uC774"},{key:"HERITG",label:"\uBB38\uD654\uC7AC"},{key:"EVTFES",label:"\uD589\uC0AC\uC640 \uCD95\uC81C"},{key:"GECTKL",label:"\uC0C1\uC2DD"}]},{key:"STRY",label:"\uC774\uC57C\uAE30",icon:"message-circle",color:"#8D6E63",subs:[{key:"FRYTAL",label:"\uB3D9\uD654"},{key:"AMZING",label:"\uC2E0\uAE30\uD55C \uC774\uC57C\uAE30"},{key:"DAYSTR",label:"\uC77C\uC0C1 \uC18D \uC774\uC57C\uAE30"}]},{key:"LOCA",label:"\uC9C0\uC5ED",icon:"map-pin",color:"#26A69A",subs:[{key:"KRLDMK",label:"\uD55C\uAD6D\uC758 \uBA85\uC18C"},{key:"SELNMK",label:"\uC11C\uC6B8\uC758 \uBA85\uC18C"},{key:"WRDTRB",label:"\uC138\uACC4\uC5EC\uD589"},{key:"NAVIGT",label:"\uAE38 \uCC3E\uAE30"}]},{key:"SOAR",label:"\uC0AC\uD68C\uC640 \uC608\uC220",icon:"landmark",color:"#5C6BC0",subs:[{key:"KRSOCI",label:"\uD55C\uAD6D"},{key:"ECONEW",label:"\uACBD\uC81C\uC640 \uB274\uC2A4"},{key:"GENART",label:"\uC608\uC220"},{key:"GELFKL",label:"\uC0DD\uD65C \uC0C1\uC2DD"}]},{key:"NTSC",label:"\uC790\uC5F0\uACFC \uACFC\uD559",icon:"leaf",color:"#9CCC65",subs:[{key:"ANIMAL",label:"\uB3D9\uBB3C"},{key:"PLANTS",label:"\uC2DD\uBB3C"},{key:"ETHPLT",label:"\uC9C0\uAD6C"},{key:"TOLELC",label:"\uB3C4\uAD6C\uC640 \uC804\uC790\uC81C\uD488"},{key:"GESCKL",label:"\uACFC\uD559\uC0C1\uC2DD"}]},{key:"SPRT",label:"\uC2A4\uD3EC\uCE20",icon:"trophy",color:"#FFCA28",subs:[{key:"INVDSP",label:"\uAC1C\uC778\uACBD\uAE30"},{key:"MARART",label:"\uACA9\uD22C\uAE30"},{key:"TEAMSP",label:"\uB2E8\uCCB4\uACBD\uAE30"},{key:"FOOTBL",label:"\uCD95\uAD6C"},{key:"GESPKL",label:"\uC2A4\uD3EC\uCE20 \uC0C1\uC2DD"}]}],Pr={LISTEN_IN_NOISE:"listenInNoise",SHORT_STORY:"shortStory",LONG_STORY:"longStory",ORDERING_SENTENCE:"orderingSentence"};let We=null,Lt=null,jt=null;function Mr(){const e=dt();if(e&&e.entries.length>0){const n=Yn();if(We&&Lt===e&&jt===n)return We;const t=new Set,o=[];for(const r of e.entries)!r.word||t.has(r.word)||(t.add(r.word),o.push({w:r.word,s:r.syllables,p:n?.[r.word]?[...n[r.word].cho??[],...n[r.word].jung??[],...n[r.word].jong??[]]:[],pron:r.pronunciation||r.word,grade:r.grade}));return We=o,Lt=e,jt=n,We}return[]}new Proxy([],{get(e,n){const t=Mr(),o=t[n];return typeof o=="function"?o.bind(t):o}});const vr={free:{maxCustomers:0,visitWord:!1,visitSentence:!1,homework:!1,customerStats:!1,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!1,wordTrainingSetting:!1,myWordList:!1,wordListShare:!1,groupTrainingSetting:!1,minimalPairSearch:!0,wordTableSetting:!1,wordTablePrint:!1,addToMyList:!1,addToGroupList:!1,wordSearch:!0,wordSearchPrint:!1,wordSearchAddToMyList:!1,wordSearchAddToGroupList:!1,wordDataLevel:1,sentenceDataLevel:0,crossword:!1,crosswordMid:!1,crosswordHigh:!1,wordTrainingView:!1,sentenceTrainingView:!1},personal_standard:{maxCustomers:0,visitWord:!1,visitSentence:!1,homework:!1,customerStats:!1,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!0,wordTrainingSetting:!0,myWordList:!0,wordListShare:!0,groupTrainingSetting:!1,minimalPairSearch:!0,wordTableSetting:!0,wordTablePrint:!0,addToMyList:!0,addToGroupList:!1,wordSearch:!0,wordSearchPrint:!0,wordSearchAddToMyList:!0,wordSearchAddToGroupList:!1,wordDataLevel:2,sentenceDataLevel:2,crossword:!0,crosswordMid:!0,crosswordHigh:!1,wordTrainingView:!0,sentenceTrainingView:!0},mgr_free:{maxCustomers:5,visitWord:!0,visitSentence:!0,homework:!1,customerStats:!1,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!1,wordTrainingSetting:!1,myWordList:!1,wordListShare:!1,groupTrainingSetting:!1,minimalPairSearch:!0,wordTableSetting:!1,wordTablePrint:!1,addToMyList:!1,addToGroupList:!1,wordSearch:!0,wordSearchPrint:!1,wordSearchAddToMyList:!1,wordSearchAddToGroupList:!1,wordDataLevel:1,sentenceDataLevel:1,crossword:!1,crosswordMid:!1,crosswordHigh:!1,wordTrainingView:!1,sentenceTrainingView:!1},none:{maxCustomers:0,visitWord:!1,visitSentence:!1,homework:!1,customerStats:!1,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!1,wordTrainingSetting:!1,myWordList:!1,wordListShare:!1,groupTrainingSetting:!1,minimalPairSearch:!1,wordTableSetting:!1,wordTablePrint:!1,addToMyList:!1,addToGroupList:!1,wordSearch:!1,wordSearchPrint:!1,wordSearchAddToMyList:!1,wordSearchAddToGroupList:!1,wordDataLevel:0,sentenceDataLevel:0,crossword:!1,crosswordMid:!1,crosswordHigh:!1,wordTrainingView:!1,sentenceTrainingView:!1},lite_word:{maxCustomers:10,visitWord:!0,visitSentence:!1,homework:!1,customerStats:!1,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!1,wordTrainingSetting:!1,myWordList:!1,wordListShare:!1,groupTrainingSetting:!1,minimalPairSearch:!0,wordTableSetting:!0,wordTablePrint:!0,addToMyList:!1,addToGroupList:!1,wordSearch:!0,wordSearchPrint:!0,wordSearchAddToMyList:!1,wordSearchAddToGroupList:!1,wordDataLevel:1,sentenceDataLevel:0,crossword:!0,crosswordMid:!1,crosswordHigh:!1,wordTrainingView:!0,sentenceTrainingView:!1},lite_sentence:{maxCustomers:10,visitWord:!1,visitSentence:!0,homework:!1,customerStats:!1,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!1,wordTrainingSetting:!1,myWordList:!1,wordListShare:!1,groupTrainingSetting:!1,minimalPairSearch:!1,wordTableSetting:!1,wordTablePrint:!0,addToMyList:!1,addToGroupList:!1,wordSearch:!1,wordSearchPrint:!0,wordSearchAddToMyList:!1,wordSearchAddToGroupList:!1,wordDataLevel:0,sentenceDataLevel:1,crossword:!0,crosswordMid:!1,crosswordHigh:!1,wordTrainingView:!1,sentenceTrainingView:!0},lite:{maxCustomers:10,visitWord:!0,visitSentence:!0,homework:!1,customerStats:!1,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!1,wordTrainingSetting:!1,myWordList:!1,wordListShare:!1,groupTrainingSetting:!1,minimalPairSearch:!0,wordTableSetting:!0,wordTablePrint:!0,addToMyList:!1,addToGroupList:!1,wordSearch:!0,wordSearchPrint:!0,wordSearchAddToMyList:!1,wordSearchAddToGroupList:!1,wordDataLevel:1,sentenceDataLevel:1,crossword:!0,crosswordMid:!1,crosswordHigh:!1,wordTrainingView:!0,sentenceTrainingView:!0},standard:{maxCustomers:30,visitWord:!0,visitSentence:!0,homework:!1,customerStats:!1,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!0,wordTrainingSetting:!0,myWordList:!0,wordListShare:!0,groupTrainingSetting:!1,minimalPairSearch:!0,wordTableSetting:!0,wordTablePrint:!0,addToMyList:!0,addToGroupList:!1,wordSearch:!0,wordSearchPrint:!0,wordSearchAddToMyList:!0,wordSearchAddToGroupList:!1,wordDataLevel:2,sentenceDataLevel:2,crossword:!0,crosswordMid:!0,crosswordHigh:!1,wordTrainingView:!0,sentenceTrainingView:!0},pro:{maxCustomers:50,visitWord:!0,visitSentence:!0,homework:!0,customerStats:!0,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!0,wordTrainingSetting:!0,myWordList:!0,wordListShare:!0,groupTrainingSetting:!1,minimalPairSearch:!0,wordTableSetting:!0,wordTablePrint:!0,addToMyList:!0,addToGroupList:!1,wordSearch:!0,wordSearchPrint:!0,wordSearchAddToMyList:!0,wordSearchAddToGroupList:!1,wordDataLevel:3,sentenceDataLevel:3,crossword:!0,crosswordMid:!0,crosswordHigh:!0,wordTrainingView:!0,sentenceTrainingView:!0},enterprise:{maxCustomers:1/0,visitWord:!0,visitSentence:!0,homework:!0,customerStats:!0,managerCustomerSplit:!0,managerManagement:!0,sentenceTrainingSetting:!0,wordTrainingSetting:!0,myWordList:!0,wordListShare:!0,groupTrainingSetting:!0,minimalPairSearch:!0,wordTableSetting:!0,wordTablePrint:!0,addToMyList:!0,addToGroupList:!0,wordSearch:!0,wordSearchPrint:!0,wordSearchAddToMyList:!0,wordSearchAddToGroupList:!0,wordDataLevel:3,sentenceDataLevel:3,crossword:!0,crosswordMid:!0,crosswordHigh:!0,wordTrainingView:!0,sentenceTrainingView:!0}},Gr={none:0,free:1,personal_standard:3,mgr_free:4,lite_word:5,lite_sentence:5,lite:6,standard:7,pro:8,enterprise:9},Fr={free:{sentenceTrainingDaily:2,wordTrainingDaily:2,gameDaily:1},personal_standard:{sentenceTrainingDaily:null,wordTrainingDaily:null,gameDaily:null},mgr_free:{sentenceTrainingDaily:2,wordTrainingDaily:2,gameDaily:1,trainingItemMax:5,customerMax:5,homeworkSendDaily:1},lite:{sentenceTrainingDaily:5,wordTrainingDaily:5,gameDaily:5,trainingItemMax:10,customerMax:10,homeworkSendDaily:10},standard:{sentenceTrainingDaily:null,wordTrainingDaily:null,gameDaily:null,trainingItemMax:30,customerMax:30,homeworkSendDaily:30},pro:{sentenceTrainingDaily:null,wordTrainingDaily:null,gameDaily:null,trainingItemMax:null,customerMax:50,homeworkSendDaily:50},enterprise:{sentenceTrainingDaily:null,wordTrainingDaily:null,gameDaily:null,trainingItemMax:null,customerMax:null,homeworkSendDaily:null}};function xr(e){const n=(e??"").toLowerCase();return n==="speechear_free"||n==="free"?"free":n.startsWith("manager_free")||n.startsWith("mgr_free")?"mgr_free":n.startsWith("manager_enterprise")?"enterprise":n.startsWith("manager_pro")?"pro":n.startsWith("manager_standard")?"standard":n.startsWith("manager_lite_word")?"lite_word":n.startsWith("manager_lite_sentence")?"lite_sentence":n.startsWith("manager_lite")||n.startsWith("mgr_lite")?"lite":n.startsWith("mgr_standard")?"standard":n.startsWith("mgr_pro")?"pro":n.startsWith("content_")||n.startsWith("speechear_")||n.startsWith("light_")||n==="light"?"personal_standard":"none"}const Wr=5,Yr=5;function Hr({rank:e,voteCount:n,quota:t=5}){return e<t&&n>0}const Kr={selected:"ALREADY_SELECTED",added:"ALREADY_ADDED",rejected:"ALREADY_REJECTED"},Ur="0.148.0";exports.CAPABILITY=ut,exports.CHOSEONG=A,exports.CORE_VERSION=Ur,exports.JONGSEONG=B,exports.JUNGSEONG=b,exports.LONG_STORIES=Te,exports.NETWORK_ERROR_MESSAGE=hn,exports.NOISE_DATAS=De,exports.ORDER_SETS=pe,exports.PLAN_FEATURES=vr,exports.PLAN_LIMITS=Fr,exports.SHORT_STORIES=Ee,exports.TIER_RANK=Gr,exports.TOPIC_TYPES=$r,exports.TRAINING_TYPES=Ir,exports.TRAINING_TYPE_I18N_KEY=Pr,exports.WORD_SUGGESTION_ACCOUNT_LIMIT=Yr,exports.WORD_SUGGESTION_EXISTING_ERROR=Kr,exports.WORD_SUGGESTION_WEEKLY_QUOTA=Wr,exports.applyFontScale=bt,exports.applyTheme=pt,exports.buildChangeWholeSyllableProblem=wu,exports.buildDropCompoundProblem=Eu,exports.buildDropContrast3Problem=Du,exports.buildDropContrastProblem=yu,exports.buildDropFinalConsonantProblem=Tu,exports.buildMultiPartPosContrast=Io,exports.buildPairIndex=Ro,exports.buildRemoveConsonantProblem=pu,exports.buildSyllableMaskIndex=Au,exports.bulkSetImageExistence=lo,exports.cardQuestionTitle=du,exports.checkImageExists=kn,exports.classifyPairDifficulty=go,exports.clearAudioExistsCache=Jt,exports.clearImageExistenceCache=co,exports.clearPairIndexCache=Oo,exports.composeSyllable=x,exports.computeDailySelection=Bt,exports.configureImageResolver=uo,exports.configureNoiseSettingsStore=Ju,exports.configurePronunciationResolver=qt,exports.configureStorage=Gt,exports.configureTTS=Kt,exports.configureTrainingCategories=Tr,exports.copyText=tr,exports.createDecompCache=Co,exports.createTTSUrlResolver=nr,exports.dateToDb=mr,exports.downloadCsvText=Ou,exports.downloadSound=xt,exports.ensureTrainingDataLoaded=kr,exports.escapeCsvField=Ru,exports.fileExists=An,exports.filterContrastCandidates=Hn,exports.finalToPhoneme=Zn,exports.firstChoseongOf=In,exports.formatCount=yr,exports.formatDateKo=or,exports.formatDateLocale=rr,exports.formatDateLongKo=ur,exports.formatDateLongLocale=ir,exports.formatDatetimeKo=ar,exports.formatPhone=fr,exports.formatRelativeTime=gr,exports.formatTimeHM=Sr,exports.formatYmd=dr,exports.getAssetBaseUrl=Tn,exports.getDailySelection=Lr,exports.getElementAnalyser=eo,exports.getElementVolume=to,exports.getErrorMessage=_u,exports.getImageExistenceStats=so,exports.getImageExistsCached=io,exports.getImageResolver=Rn,exports.getNoiseBaseUrl=Wt,exports.getNoiseFileGain=Yt,exports.getPairIndex=Yn,exports.getPlanTier=xr,exports.getPronunciationResolver=Qt,exports.getSavedFontScale=wt,exports.getSavedTheme=Tt,exports.getSignedOrPublicUrl=wn,exports.getTTSFallbackUrlResolver=Vt,exports.getTTSUrlResolver=Ut,exports.getTodayKst=Sn,exports.getTodayKstDate=lr,exports.getTopicTypes=pr,exports.getTrainingPools=jr,exports.getTrainingTypes=Ar,exports.getWordPool=dt,exports.hasQuestionWordConstraint=ru,exports.hasSel=k,exports.hasStructureContrast=tn,exports.initFontScale=Br,exports.initTheme=wr,exports.isAllChoseong=Pn,exports.isManualOnlyType=au,exports.isNetworkErrorMessage=Ct,exports.isSyllablePattern=Gn,exports.isThisWeekPick=Hr,exports.isTrainingDataLoaded=Or,exports.isValidQuestionWord=iu,exports.itemCorrectness=ft,exports.jamoToNamesForSpeech=fu,exports.kstStartOfDay=Cr,exports.loadGameLeaderboard=zu,exports.loadMyGameRanks=Vu,exports.loadNoiseSettings=qu,exports.loadTrainingData=Nt,exports.logCrossword=Fu,exports.logTrainingCompletion=vu,exports.logTrainingTime=Pu,exports.matchSyllables=te,exports.matchesChoseongSearch=fo,exports.matchesSyllablePattern=xn,exports.matchesWordQuery=ho,exports.mergeQuestionText=lt,exports.minimalPairDistractors=ko,exports.normalizeDate=hr,exports.officialSoundPath=er,exports.parseLocalYmd=yt,exports.parseSortValue=ju,exports.parseSyllable=S,exports.patternToComposition=wo,exports.phonemePartsOf=lu,exports.pickEuRo=ot,exports.pickEulReul=et,exports.pickEunNeun=nt,exports.pickIga=Xn,exports.pickWaGwa=tt,exports.prewarmImageCache=ao,exports.primarySelPart=ve,exports.readLevel=oo,exports.reorderArray=nu,exports.reportAppliedNoiseSettings=Zu,exports.resolveAssetUrl=Mt,exports.resolveSoundPath=Ft,exports.resumeAudioMeter=Xt,exports.routeElementAudio=Ln,exports.sample=H,exports.saveNoiseSettings=Qu,exports.searchAndRankWords=Bo,exports.setAssetBaseUrl=Pt,exports.setCrosswordLogger=Gu,exports.setElementVolume=no,exports.setGameLeaderboardLoader=Ku,exports.setGameRanksLoader=Hu,exports.setGameScoreSubmitter=Yu,exports.setTrainingCompletionLogger=Mu,exports.setTrainingTimeLogger=$u,exports.setWordPool=Iu,exports.shuffle=R,exports.sortToValue=Lu,exports.soundOf=dn,exports.speak=Ot,exports.stopSpeaking=kt,exports.submitGameScore=Uu,exports.syllMatchesComp=q,exports.syllableContrasts=oe,exports.syllableLength=Do,exports.syllablePron=ct,exports.toBase64UrlSafe=Xu,exports.toChoseong=$n,exports.toItemResults=xu,exports.toKstHm=sr,exports.toKstYmd=ye,exports.toStandardPronunciation=Vo,exports.toStorageName=Fe,exports.toUserErrorMessage=Nu,exports.validateSyllableSearchInput=_o,exports.withEuRo=eu,exports.withEulReul=Qo,exports.withEunNeun=Zo,exports.withIga=qo,exports.withWaGwa=Xo,exports.wordContainsChoseong=mo,exports.wordContainsJongseong=yo,exports.wordContainsJungseong=So,exports.wordHasNoCoda=Eo,exports.wordHasSyllableMatching=po,exports.wrongItems=Wu;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ihabdevteam/core",
3
- "version": "0.147.0",
3
+ "version": "0.148.0",
4
4
  "private": false,
5
5
  "main": "dist/ihabdevteam-core.cjs.js",
6
6
  "module": "dist/packages/core/src/index.js",