@ihabdevteam/core 0.9.1 → 0.9.3

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/hooks.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var l=require("react"),mt=require("react-i18next"),V=require("react/jsx-runtime"),Bo=require("react-dom"),Pn=typeof document<"u"?document.currentScript:null;function mr({storageKey:e="fontScale",baseFont:t=20,minScale:n=.8,maxScale:o=1.4,step:u=.1,lineHeightRatio:r=1.4}={}){const i=_=>Math.max(n,Math.min(o,Number(_))),[s,d]=l.useState(()=>{try{const _=localStorage.getItem(e),g=_?Number(_):1;return Number.isFinite(g)?g:1}catch{return 1}});l.useEffect(()=>{try{localStorage.setItem(e,String(s))}catch{}},[e,s]);const p=_=>{d(typeof _=="function"?g=>i(_(g)):i(_))},f=()=>p(_=>+(_+u).toFixed(6)),C=()=>p(_=>+(_-u).toFixed(6)),c=s<o-Number.EPSILON,m=s>n+Number.EPSILON,S=Math.round(t*s),w=Math.round(S*r);return{scale:s,setScale:p,increase:f,decrease:C,canIncrease:c,canDecrease:m,fontSize:S,lineHeight:w}}const Do=l.createContext(null);function gr(e){return/max-width:\s*7[0-9][0-9]px/.test(e)}function _r(e){const t=l.useContext(Do),n=r=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(r).matches,[o,u]=l.useState(n(e));return l.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const r=window.matchMedia(e),i=d=>u(d.matches),s=r;return s.addEventListener?s.addEventListener("change",i):s.addListener&&s.addListener(i),u(r.matches),()=>{s.removeEventListener?s.removeEventListener("change",i):s.removeListener&&s.removeListener(i)}},[e]),t&&typeof t.mobile=="boolean"&&gr(e)?t.mobile:o}function vo(e){const t=l.useRef(e);return l.useEffect(()=>{t.current=e}),t}function Oo(e,t){const n=vo(t);l.useEffect(()=>{const o=()=>n.current();try{window.addEventListener(e,o)}catch{}return()=>{try{window.removeEventListener(e,o)}catch{}}},[e,n])}const $n=" \xB7 ",Lo=(()=>{if(typeof document>"u")return"";const e=document.title;return e.includes($n)?e.split($n).pop()??e:e})(),Ro=l.createContext(!1);function Er(e){const t=l.useContext(Ro);l.useEffect(()=>{if(t||typeof e!="string"||!e)return;const n=document.title;return document.title=Lo?`${e}${$n}${Lo}`:e,()=>{document.title=n}},[e,t])}function br(){const{t:e}=mt.useTranslation();return l.useCallback(t=>{if(!t)return"";const n=new Date(t).getTime();if(Number.isNaN(n))return"";const o=Math.floor((Date.now()-n)/864e5);return o<=0?e("myHomework.relativeDay.today","\uC624\uB298"):o===1?e("myHomework.relativeDay.yesterday","\uC5B4\uC81C"):e("myHomework.relativeDay.daysAgo",{n:o})},[e])}function Sr(e){const[t,n]=l.useState({current:"",next:"",confirm:""}),[o,u]=l.useState(null),[r,i]=l.useState(!1),s=l.useRef(null);l.useEffect(()=>()=>{s.current!==null&&clearTimeout(s.current)},[]);const d=l.useCallback(()=>{n({current:"",next:"",confirm:""}),u(null)},[]),p=l.useCallback(async()=>{if(!t.current){u({type:"error",text:"\uD604\uC7AC \uBE44\uBC00\uBC88\uD638\uB97C \uC785\uB825\uD558\uC138\uC694."});return}if(!t.next){u({type:"error",text:"\uC0C8 \uBE44\uBC00\uBC88\uD638\uB97C \uC785\uB825\uD558\uC138\uC694."});return}if(t.next!==t.confirm){u({type:"error",text:"\uC0C8 \uBE44\uBC00\uBC88\uD638\uAC00 \uC77C\uCE58\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."});return}i(!0);const f=e?await e(t.current,t.next):null;if(i(!1),f){u({type:"error",text:f});return}u({type:"success",text:"\uBE44\uBC00\uBC88\uD638\uAC00 \uBCC0\uACBD\uB418\uC5C8\uC2B5\uB2C8\uB2E4."}),n({current:"",next:"",confirm:""}),s.current!==null&&clearTimeout(s.current),s.current=setTimeout(()=>u(null),1500)},[t,e]);return{pw:t,setPw:n,pwMsg:o,setPwMsg:u,pwLoading:r,handleChangePw:p,reset:d}}const Se=["\u3131","\u3132","\u3134","\u3137","\u3138","\u3139","\u3141","\u3142","\u3143","\u3145","\u3146","\u3147","\u3148","\u3149","\u314A","\u314B","\u314C","\u314D","\u314E"],rt=["\u314F","\u3150","\u3151","\u3152","\u3153","\u3154","\u3155","\u3156","\u3157","\u3158","\u3159","\u315A","\u315B","\u315C","\u315D","\u315E","\u315F","\u3160","\u3161","\u3162","\u3163"],Pe=["","\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 se(e){if(!e)return null;const t=e.charCodeAt(0)-44032;return t<0||t>=11172?null:{cho:Math.floor(t/588),jung:Math.floor(t%588/28),jong:t%28}}function kr(){const e=new Map;return t=>{let n=e.get(t);return n||(n=[...t].map(o=>se(o)),e.set(t,n)),n}}function gt(e,t,n=0){return String.fromCharCode(44032+(e*21+t)*28+n)}function Ar(e,t){if(!e||!t||e===t||e.length!==t.length)return"random";let n=0,o=null;for(let u=0;u<e.length;u++){const r=se(e[u]),i=se(t[u]);if(!r||!i)return"random";if(r.cho===i.cho&&r.jung===i.jung&&r.jong===i.jong)continue;n++;const s=r.cho!==i.cho,d=r.jung!==i.jung,p=r.jong!==i.jong;(s?1:0)+(d?1:0)+(p?1:0)>1?o="multi":s?o="cho":d?o="jung":o="jong"}return n!==1?"random":o==="cho"?"cho":o==="jung"?"jung":o==="jong"?"jong":"random"}const $t={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"]};Object.fromEntries(Object.entries($t).map(([e,t])=>[t.join(""),Pe[Number(e)]]));function wr(e,t){if(!e||!t)return!1;for(const n of e){const o=se(n);if(o){if(Se[o.cho]===t)return!0;if(o.jong>0){if(Pe[o.jong]===t)return!0;const u=$t[o.jong];if(u&&u.includes(t))return!0}}}return!1}function pn(e){if(!e)return 0;let t=0;for(const n of e)se(n)&&t++;return t}function Mr(e){if(!e)return!1;let t=!1;for(const n of e){const o=se(n);if(o&&(t=!0,o.jong>0))return!1}return t}function Nr(e,t){if(e.jong<=0)return!1;if(t.includes(Pe[e.jong]))return!0;const n=$t[e.jong];return!!n&&n.some(o=>t.includes(o))}function Tr(e,t,n){if(!e)return!1;const o=[...e],u=r=>{const i=se(o[r]);if(!i||t.cho&&!t.cho.includes(Se[i.cho])||t.jung&&!t.jung.includes(rt[i.jung]))return!1;if(t.jongNone){if(i.jong>0)return!1}else if(t.jong&&!Nr(i,t.jong))return!1;return!0};if(n==="head")return u(0);if(n==="tail")return u(o.length-1);if(n==="mid"){for(let r=1;r<o.length-1;r++)if(u(r))return!0;return!1}for(let r=0;r<o.length;r++)if(u(r))return!0;return!1}const xr={cho:Se.length,jung:rt.length,jong:Pe.length};function Br(e,t,n,o,u=1/0){if(!e||n<1)return[];const r=[...e].map(C=>se(C));if(r.some(C=>!C))return[];const i=r,s=i.length;if(n>s)return[];const d=xr[t],p=new Set,f=[];(function C(c,m){if(m.length===n){f.push([...m]);return}for(let S=c;S<s;S++)m.push(S),C(S+1,m),m.pop()})(0,[]);for(const C of f)if((function c(m,S){if(p.size>=u)return;if(m===C.length){const g=S.map(b=>gt(b.cho,b.jung,b.jong)).join("");g!==e&&o.has(g)&&p.add(g);return}const w=C[m],_=i[w][t];for(let g=0;g<d;g++){if(g===_)continue;const b=S.slice();if(b[w]={...S[w],[t]:g},c(m+1,b),p.size>=u)return}})(0,i),p.size>=u)break;return[...p]}function Dr(e,t){if(!e||!t||e.length!==t.length)return-1;let n=0;for(let o=0;o<e.length;o++){const u=se(e[o]),r=se(t[o]);if(!u||!r)return-1;u.cho!==r.cho&&n++,u.jung!==r.jung&&n++,u.jong!==r.jong&&n++}return n}const Io="word_pair_index_v2",jo="word_pair_index_sig_v2";let Ft=null;function vr(){try{if(typeof localStorage>"u")return null;const e=localStorage.getItem(Io),t=localStorage.getItem(jo);return!e||!t?null:{index:JSON.parse(e),sig:t}}catch{return null}}function Ht(){if(Ft)return Ft;const e=vr();return e?(Ft=e.index,e.sig,Ft):null}function Or(){Ft=null;try{typeof localStorage<"u"&&(localStorage.removeItem(Io),localStorage.removeItem(jo))}catch{}}const Po="word_image_existence_map_v1";let Bt=null;function $o(){if(Bt)return Bt;try{const e=typeof localStorage<"u"?localStorage.getItem(Po):null;Bt=e?JSON.parse(e):{}}catch{Bt={}}return Bt}function Lr(e,t){return`${e}_${t??1}`}function Rr(e,t){const n=$o(),o=Lr(e,t);return o in n?n[o]:void 0}function Fo(){const e=$o(),t=Object.values(e);return t.length===0?null:{total:t.length,exists:t.filter(Boolean).length}}function Ir(){Bt={};try{typeof localStorage<"u"&&localStorage.removeItem(Po)}catch{}}const Ho=[{id:"wordData",labelKey:"settings.cache.group.wordData.label",subKey:"settings.cache.group.wordData.sub",keys:["word_data_cache","word_data_version"]},{id:"pairIndex",labelKey:"settings.cache.group.pairIndex.label",subKey:"settings.cache.group.pairIndex.sub",keys:["word_pair_index_v2","word_pair_index_sig_v2"]},{id:"imageCache",labelKey:"settings.cache.group.imageCache.label",subKey:"settings.cache.group.imageCache.sub",keys:["word_image_existence_map_v1"]}];function zo(e){return e.reduce((t,n)=>{try{const o=localStorage.getItem(n);return t+(o?new Blob([o]).size:0)}catch{return t}},0)}function jr(e){return e===0?"0 B":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(2)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`}function Pr(e){const{t}=mt.useTranslation(),[n,o]=l.useState({}),[u,r]=l.useState(null),[i,s]=l.useState(null),[d,p]=l.useState(null),f=l.useCallback(()=>{const c={};Ho.forEach(m=>{c[m.id]=zo([...m.keys])}),o(c),typeof navigator<"u"&&navigator.storage?.estimate&&navigator.storage.estimate().then(m=>{p({usage:m.usage??0,quota:m.quota??0})}).catch(()=>{})},[]);l.useEffect(()=>{f()},[f]);const C=l.useCallback(async c=>{r(c);try{c==="wordData"?(localStorage.removeItem("word_data_cache"),localStorage.removeItem("word_data_version")):c==="pairIndex"?Or():c==="imageCache"&&Ir(),f(),e?.(t("settings.cache.cleared","\uCE90\uC2DC\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4."))}finally{r(null)}},[f,e,t]);return{cacheSizes:n,clearingId:u,confirmCacheId:i,setConfirmCacheId:s,storageEstimate:d,refreshCacheSizes:f,handleClearCache:C}}function $r(e){const[t,n]=l.useState(null),[o,u]=l.useState(null),r=l.useCallback(()=>{const i=Ht();if(i){const d=Object.values(i),p=d.filter(f=>f.cho.length+f.jung.length+f.jong.length>0).length;n({matched:p,total:d.length})}else n(null);const s=Fo();u(s?{exists:s.exists,total:s.total}:null)},[]);return l.useEffect(()=>{r();const i=setTimeout(r,1e3);return()=>clearTimeout(i)},[e,r]),{pairStats:t,imgStats:o,setPairStats:n,setImgStats:u,refreshStats:r}}function Vo(e,t=[]){const[n,o]=l.useState(t),[u,r]=l.useState(null),[i,s]=l.useState(!1),[d,p]=l.useState(e),f=l.useRef(i);l.useEffect(()=>{f.current=i});const C=l.useRef(null);l.useEffect(()=>{if(f.current)return;const g=C.current;g!==null&&g.length===t.length&&g.every((b,k)=>b===t[k])||(C.current=t,o(t))},[t]);const c=l.useCallback(g=>{r(g),s(!1),p({...g})},[]),m=l.useCallback(()=>s(!0),[]),S=l.useCallback(()=>s(!1),[]),w=l.useCallback((g,b)=>{o(g),r(b),s(!1)},[]),_=l.useCallback(g=>{o(b=>b.filter(k=>k!==g)),r(null)},[]);return{list:n,setList:o,selected:u,setSelected:r,isEditing:i,setIsEditing:s,editForm:d,setEditForm:p,openDetail:c,startEditing:m,cancelEditing:S,commitEdit:w,remove:_}}const zt=()=>{const e=new Date;return{year:String(e.getFullYear()),month:String(e.getMonth()+1).padStart(2,"0"),day:String(e.getDate()).padStart(2,"0")}},Fr={year:"",month:"",day:"",hour:"09",minute:"00",memo:""};function Hr(e=[]){const{list:t,setList:n,selected:o,setSelected:u,isEditing:r,setIsEditing:i,editForm:s,setEditForm:d,openDetail:p,commitEdit:f}=Vo(Fr,e),{year:C,month:c,day:m}=zt(),[S,w]=l.useState({year:C,month:c,day:m,hour:"09",minute:"00",memo:""});return{visitHistory:t,visitForm:S,setVisitForm:w,setVisit:_=>g=>w(b=>({...b,[_]:g})),selectedVisit:o,setSelectedVisit:u,isEditingVisit:r,setIsEditingVisit:i,editVisitForm:s,setEditVisitForm:d,openVisitDetail:p,handleVisitSave:_=>{n(D=>[S,...D]);const{year:g,month:b,day:k}=zt();w({year:g,month:b,day:k,hour:"09",minute:"00",memo:""}),_?.()},handleVisitEditSave:()=>{f(_=>_.map(g=>g===o?s:g),s)},addVisit:_=>{n(g=>[_,...g])},removeVisit:_=>{n(g=>g.filter(b=>b!==_))},revertVisitEdit:(_,g)=>{n(b=>b.map(k=>k===g?_:k)),u(b=>b===g?_:b)}}}const Uo=e=>`${e.year.padStart(4,"0")}-${e.month.padStart(2,"0")}-${e.day.padStart(2,"0")} ${e.hour.padStart(2,"0")}:${e.minute.padStart(2,"0")}`,Cn=e=>[...e].sort((t,n)=>{const o=Uo(t),u=Uo(n);return o<u?-1:o>u?1:0}),zr={year:"",month:"",day:"",hour:"09",minute:"00",memo:""};function Vr(e,t=[]){const n=l.useMemo(()=>Cn(t),[t]),{list:o,setList:u,selected:r,setSelected:i,isEditing:s,setIsEditing:d,editForm:p,setEditForm:f,openDetail:C,commitEdit:c,remove:m}=Vo(zr,n),[S,w]=l.useState([]),{year:_,month:g,day:b}=zt(),[k,D]=l.useState({year:_,month:g,day:b,hour:"09",minute:"00",memo:""}),R=z=>B=>D(O=>({...O,[z]:B})),v=z=>{u(X=>Cn([...X,k]));const{year:B,month:O,day:Ce}=zt();D({year:B,month:O,day:Ce,hour:"09",minute:"00",memo:""}),z?.()},j=()=>{c(z=>Cn(z.map(B=>B===r?p:B)),p)},H=l.useCallback(z=>{m(z)},[m]),G=l.useCallback(z=>{e({year:z.year,month:z.month,day:z.day,hour:z.hour,minute:z.minute,memo:z.memo}),m(z)},[e,m]),F=l.useCallback(z=>{u(B=>B.filter(O=>O!==z)),w(B=>[z,...B]),i(null)},[u,i]),J=l.useCallback(z=>{u(B=>Cn([...B,z]))},[u]),Y=l.useCallback(z=>{u(B=>B.filter(O=>O!==z))},[u]),W=l.useCallback((z,B)=>{u(O=>O.map(Ce=>Ce===B?z:Ce)),i(O=>O===B?z:O)},[u,i]);return{scheduleList:o,noShowList:S,addSchedule:J,removeSchedule:Y,revertScheduleEdit:W,scheduleForm:k,setScheduleForm:D,setSchedule:R,selectedSchedule:r,setSelectedSchedule:i,isEditingSchedule:s,setIsEditingSchedule:d,editScheduleForm:p,setEditScheduleForm:f,openScheduleDetail:C,handleScheduleSave:v,handleScheduleEditSave:j,handleScheduleDelete:H,handleScheduleToVisit:G,handleScheduleNoVisit:F}}const Go=[{value:"10",label:"10\uAC1C\uC529 \uBCF4\uAE30"},{value:"25",label:"25\uAC1C\uC529 \uBCF4\uAE30"},{value:"50",label:"50\uAC1C\uC529 \uBCF4\uAE30"},{value:"100",label:"100\uAC1C\uC529 \uBCF4\uAE30"}];function Ur(e){const[t,n]=l.useState(""),[o,u]=l.useState("25"),[r,i]=l.useState("all"),[s,d]=l.useState(1),p=l.useMemo(()=>e.filter(({item:c,status:m})=>!(t&&!c.memo.includes(t)||r!=="all"&&m!==r)),[e,t,r]),f=Math.max(1,Math.ceil(p.length/Number(o))),C=l.useMemo(()=>{const c=Math.min(s,f);return p.slice((c-1)*Number(o),c*Number(o))},[p,s,o,f]);return{vapSearch:t,setVapSearch:n,vapPageSize:o,setVapPageSize:u,vapStatus:r,setVapStatus:i,vapPage:s,setVapPage:d,vapFiltered:p,vapTotal:f,vapPageItems:C}}function Gr(e,t){const{t:n}=mt.useTranslation(),[o,u]=l.useState("25"),[r,i]=l.useState(1),[s,d]=l.useState(t);s!==t&&(d(t),r!==1&&i(1));const p=l.useMemo(()=>Go.map(m=>({...m,label:n("visits.showN",{n:m.value})})),[n]),f=l.useCallback(m=>{u(m),i(1)},[]),C=Math.max(1,Math.ceil(e.length/Number(o))),c=Math.min(r,C);return{pageRows:l.useMemo(()=>e.slice((c-1)*Number(o),c*Number(o)),[e,c,o]),pageSizeProps:{options:p,value:o,onChange:f},paginationProps:{page:c,total:C,onChange:i},setPage:i}}function Yr(){const[e,t]=l.useState(null),n=l.useCallback(u=>{t(r=>r?.key===u?{key:u,asc:!r.asc}:{key:u,asc:!0})},[]),o=l.useCallback((u,r)=>({label:u,sortDir:e?.key===r?e.asc?"asc":"desc":null,onClick:()=>n(r)}),[e,n]);return{\uC815\uB82C:e,\uCE78:o}}function qr(){const[e,t]=l.useState(!1),[n,o]=l.useState("\uC88C"),[u,r]=l.useState({\uC88C:null,\uC6B0:null}),[i,s]=l.useState({\uC88C:[],\uC6B0:[]}),[d,p]=l.useState(!1),[f,C]=l.useState("\uC88C"),c=l.useCallback(S=>{const w=S.direction;r(_=>({..._,[w]:S})),s(_=>({..._,[w]:[S,..._[w]]})),t(!1)},[]),m=l.useCallback(S=>{const w=S.direction;r(_=>({..._,[w]:S})),p(!1)},[]);return{showDevice:e,setShowDevice:t,deviceDirection:n,setDeviceDirection:o,devices:u,setDevices:r,deviceHistory:i,setDeviceHistory:s,showDeviceList:d,setShowDeviceList:p,listForSide:f,setListForSide:C,handleDeviceSubmit:c,handleSelectFromList:m}}const Wr="__ihab_core_word_pool__";function yn(){return globalThis[Wr]??null}function ae(e,t=Math.random){const n=e.slice();for(let o=n.length-1;o>0;o--){const u=Math.floor(t()*(o+1));[n[o],n[u]]=[n[u],n[o]]}return n}function at(e,t,n=Math.random){return!Array.isArray(e)||e.length===0||t<=0?[]:t>=e.length?ae(e,n):ae(e,n).slice(0,t)}const Fn={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"}},Kr=Se.indexOf("\u3147"),Yo={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!==Kr},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}},Xr={\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"},Zr={\u314F:{nucleus:"\u314F"},\u3151:{glide:"j",nucleus:"\u314F"},\u3153:{nucleus:"\u3153"},\u3155:{glide:"j",nucleus:"\u3153"},\u3157:{nucleus:"\u3157"},\u315B:{glide:"j",nucleus:"\u3157"},\u315C:{nucleus:"\u315C"},\u3160:{glide:"j",nucleus:"\u315C"},\u3161:{nucleus:"\u3161"},\u3163:{nucleus:"\u3163"},\u3150:{nucleus:"\u3154/\u3150"},\u3152:{glide:"j",nucleus:"\u3154/\u3150"},\u3154:{nucleus:"\u3154/\u3150"},\u3156:{glide:"j",nucleus:"\u3154/\u3150"},\u3158:{glide:"w",nucleus:"\u314F"},\u3159:{glide:"w",nucleus:"\u3154/\u3150"},\u315A:{glide:"w",nucleus:"\u3154/\u3150"},\u315D:{glide:"w",nucleus:"\u3153"},\u315E:{glide:"w",nucleus:"\u3154/\u3150"},\u315F:{glide:"w",nucleus:"\u3163"},\u3162:{glide:"\u0270",nucleus:"\u3163"}};function qo(e){return Xr[e]??e}const Hn={cho:Se,jung:rt,jong:Pe},_e=e=>Array.isArray(e)?e.length>0:!!e;function zn(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){const o=e[n],u=t[n];if(!(!o||!u)&&(o.cho!==u.cho&&Se[o.cho]==="\u3147"!=(Se[u.cho]==="\u3147")||o.jong!==u.jong&&o.jong===0!=(u.jong===0)))return!0}return!1}function Jr(e,t,n){const o=n.pronOf(e),u=n.decompOf,r=n.sameStructureOnly&&u?u(o):null,i=[];for(const s of t)s!==e&&(n.okSet&&!n.okSet.has(s)||n.pronOf(s)!==o&&(r&&u&&zn(r,u(n.pronOf(s)))||i.push(s)));return i}function Wo(e,t,n){const o=t?.[e];if(!o)return[];const u=n.kind?o[n.kind]??[]:[...o.cho??[],...o.jung??[],...o.jong??[]];return Jr(e,u,n)}function Qr(e,t,n,o,u,r,i){const s=["cho","jung","jong"].filter(c=>_e(e[c])),d={};for(const c of s){const m=e[c];d[c]=new Set(Array.isArray(m)?m:[m])}const p=u==="pron",f=new Map;for(const c of t){const m=n(r(c));if(m.some(g=>!g))continue;let S=m;if(!p&&(S=n(c),S.length!==m.length||S.some(g=>!g)))continue;const w=m.length,_=f.get(w);_?_.push({w:c,dPron:m,dPos:S}):f.set(w,[{w:c,dPron:m,dPos:S}])}const C=new Map;for(const[c,m]of f){const S=new Map,w=(_,g)=>{const b=_.dPos[g];return b!=null&&s.every(k=>d[k].has(Hn[k][b[k]]))};for(const _ of m){let g;if(i==="head")g=w(_,0)?0:-1;else if(i==="tail")g=w(_,c-1)?c-1:-1;else if(i==="mid"){g=-1;for(let k=1;k<c-1;k++)if(w(_,k)){g=k;break}}else g=_.dPos.findIndex(k=>k!=null&&s.every(D=>d[D].has(Hn[D][k[D]])));if(g<0)continue;const b=S.get(g);b?b.push(_):S.set(g,[_])}for(const[_,g]of S){const b=new Set(s.map(R=>_+":"+R)),k=R=>{let v="";for(let j=0;j<c;j++){const H=R[j];for(const G of["cho","jung","jong"])v+=(b.has(j+":"+G)?"*":H[G])+"."}return v},D=new Map;for(const R of m){const v=k(R.dPron),j=D.get(v);j?j.push(R):D.set(v,[R])}for(const R of g){const v=D.get(k(R.dPron))??[],j=[];for(const H of v){if(H.w===R.w)continue;let G=!0;for(const F of s){const J=R.dPron[_][F],Y=H.dPron[_][F];if(Y===J){G=!1;break}if(p&&d[F].has(Hn[F][Y])){G=!1;break}}G&&(o&&zn(R.dPron,H.dPron)||j.push(H.w))}C.set(R.w,j)}}}return C}const ea=e=>e==null?[]:Array.isArray(e)?e:[e];function ta(e){if([...e].length!==1)return"";const t=se(e);if(!t)return"";const n=qo(Pe[t.jong]),o=n===""?0:Pe.indexOf(n);return gt(t.cho,t.jung,o<0?0:o)}function Ko(e,t){return t.get(e)||ta(e)||e}function Vn(e){return e?_e(e.cho)?"cho":_e(e.jung)?"jung":_e(e.jong)?"jong":null:null}function Dt(e,t){const n=(o,u)=>!_e(o)||ea(o).includes(u);return n(t.cho,Se[e.cho])&&n(t.jung,rt[e.jung])&&n(t.jong,Pe[e.jong])}function Vt(e,t,n){const o=[...e];if(n!=="pron")return o.map(r=>se(r));const u=[...t.get(e)||e];return u.length!==o.length?o.map(r=>se(r)):u.map(r=>se(r))}function Ut(e,t,n,o,u){const r=t==="cho"?Se:t==="jung"?rt:Pe,i=e[t],s=[],d=new Set([Ko(n,u)]),p=ae(r.map((f,C)=>C).filter(f=>f!==i&&(t!=="cho"||r[f]!=="\u3147")&&(t!=="jong"||f!==0)));for(const f of p){if(s.length>=o)break;const C=t==="cho"?gt(f,e.jung,e.jong):t==="jung"?gt(e.cho,f,e.jong):gt(e.cho,e.jung,f),c=Ko(C,u);d.has(c)||(d.add(c),s.push(C))}return s}function na(e,t,n,o,u,r=null){const i=[...e];if(i.length!==2)return null;const s=i.map(C=>se(C));if(s.some(C=>!C))return null;const d=Vt(e,n,o);if(d.some(C=>!C))return null;const p=Vn(t);let f=p&&t?d.map((C,c)=>Dt(C,t)?c:-1).filter(C=>C>=0):[0,1];if(r!=null&&(f=f.filter(C=>C!==r)),!f.length)return null;for(const C of ae(f)){const c=i[C];if(!u.has(c))continue;const m=Ut(s[C],p??"cho",c,40,n),S=[];for(const w of m)if(w!==c&&u.has(w)&&!S.includes(w)&&S.push(w),S.length>=2)break;if(!(S.length<2))return{question:e,distractors:[c,...S]}}return null}function oa(e,t,n,o,u,r=null){const i=[...e];if(i.length!==3)return null;const s=i.map(C=>se(C));if(s.some(C=>!C))return null;const d=Vt(e,n,o);if(d.some(C=>!C))return null;const p=Vn(t),f=p&&t?d.map((C,c)=>Dt(C,t)?c:-1).filter(C=>C>=0):[0,1,2];if(!f.length)return null;for(const C of ae(f))for(const c of ae([0,1,2].filter(m=>m!==C&&(r==null||m===r)))){const m=[0,1,2].filter(b=>b!==c),S=m.map(b=>i[b]).join("");if(!u.has(S))continue;const w=m.indexOf(C),_=Ut(s[C],p??"cho",i[C],40,n),g=[];for(const b of _){const k=m.map(R=>i[R]);k[w]=b;const D=k.join("");if(D!==S&&u.has(D)&&!g.includes(D)&&g.push(D),g.length>=2)break}if(!(g.length<2))return{question:e,distractors:[S,...g]}}return null}function ua(e,t,n,o,u,r=null){const i=[...e],s=i.length;if(s<2)return null;const d=[];for(let f=1;f<=s-1;f++)d.push({remain:i.slice(0,f).join(""),dropped:i.slice(f).join(""),droppedEnd:1}),d.push({remain:i.slice(s-f).join(""),dropped:i.slice(0,s-f).join(""),droppedEnd:0});const p=Vn(t);for(const{remain:f,dropped:C,droppedEnd:c}of ae(d)){if(r!=null&&c!==r||f===e||!u.has(f)||!u.has(C))continue;const m=[...f],S=m.map(g=>se(g));if(S.some(g=>!g))continue;const w=Vt(f,n,o);if(w.some(g=>!g))continue;const _=p&&t?w.map((g,b)=>Dt(g,t)?b:-1).filter(g=>g>=0):m.map((g,b)=>b);if(_.length)for(const g of ae(_)){const b=Ut(S[g],p??"cho",m[g],40,n),k=[];for(const D of b){const R=[...m];R[g]=D;const v=R.join("");if(v!==f&&u.has(v)&&!k.includes(v)&&k.push(v),k.length>=2)break}if(k.length>=2)return{question:e,distractors:[f,...k]}}}return null}function ra(e,t,n,o,u,r=null){if([...e].length!==1)return null;const i=se(n.get(e)||e);if(!i||i.jong===0)return null;const s=gt(i.cho,i.jung,0),d=Ut({cho:i.cho,jung:i.jung,jong:0},"cho",s,2,n);return d.length<2?null:{question:e,distractors:[s,...d]}}const Un=Se.indexOf("\u3147");function aa(e,t,n,o,u,r=null){if([...e].length!==1)return null;const i=se(n.get(e)||e);if(!i||i.jong!==0||i.cho===Un)return null;const s=gt(Un,i.jung,0),d=Ut({cho:Un,jung:i.jung,jong:0},"jung",s,2,n);return d.length<2?null:{question:e,distractors:[s,...d]}}function ia(e){const t=new Map;for(const n of e){const o=[...n],u=o.length;if(!(u<2||u>3))for(let r=0;r<u;r++){let i=u+"|"+r+"|";for(let d=0;d<u;d++)i+=d===r?"*":o[d];const s=t.get(i);s?s.push(n):t.set(i,[n])}}return t}function sa(e,t,n,o,u,r=null,i=null,s=2){const d=[...e],p=d.length;if(p<2||p>3)return null;const f=d.map(b=>se(b));if(f.some(b=>!b))return null;const C=Vt(e,n,o);if(C.some(b=>!b))return null;const c=b=>n.get(b)??b,m=c(e),S=!!t&&(_e(t.cho)||_e(t.jung)||_e(t.jong)),w=!!i&&(_e(i.cho)||_e(i.jung)||_e(i.jong)),_=b=>{let k=p+"|"+b+"|";for(let D=0;D<p;D++)k+=D===b?"*":d[D];return k};let g;if(r!=null){if(r>=p||S&&!Dt(C[r],t))return null;g=[r]}else S?g=C.map((b,k)=>Dt(b,t)?k:-1).filter(b=>b>=0):g=Array.from({length:p},(b,k)=>k);for(const b of ae(g)){const k=u.get(_(b))??[],D=[],R=[];for(const F of k){if(F===e)continue;const J=[...F].map(B=>se(B)),Y=f[b],W=J[b];if(!Y||!W)continue;let z=0;if(Y.cho!==W.cho&&z++,Y.jung!==W.jung&&z++,Y.jong!==W.jong&&z++,!(z<s||c(F)===m))if(w){const B=Vt(F,n,o)[b];B&&Dt(B,i)?D.push(F):R.push(F)}else D.push(F)}if(!D.length)continue;const v=ae(D)[0],j=[],H=new Set([m,c(v)]),G=w?R:D.filter(F=>F!==v);for(const F of ae(G)){const J=c(F);if(!H.has(J)&&(H.add(J),j.push(F),j.length>=2))break}if(!w&&j.length<2)for(const F of ae(k)){if(F===e||F===v)continue;const J=c(F);if(!H.has(J)&&(H.add(J),j.push(F),j.length>=2))break}if(!(j.length<2))return{question:e,distractors:[v,...j]}}return null}let mn=null,Xo=null,Zo=null;function la(){const e=yn();if(e&&e.entries.length>0){const t=Ht();if(mn&&Xo===e&&Zo===t)return mn;const n=new Set,o=[];for(const u of e.entries)!u.word||n.has(u.word)||(n.add(u.word),o.push({w:u.word,s:u.syllables,p:t?.[u.word]?[...t[u.word].cho??[],...t[u.word].jung??[],...t[u.word].jong??[]]:[],pron:u.pronunciation||u.word,grade:u.grade}));return mn=o,Xo=e,Zo=t,mn}return[]}const He=new Proxy([],{get(e,t){const n=la(),o=n[t];return typeof o=="function"?o.bind(n):o}});function gn(e){return e.length?e[Math.floor(Math.random()*e.length)]:void 0}function ze(e,t){if(t>=e.length)return ae(e);if(t===0)return[];const n=e.slice();for(let o=0;o<t;o++){const u=o+Math.floor(Math.random()*(n.length-o)),r=n[o];n[o]=n[u],n[u]=r}return n.slice(0,t)}let Gn=null,Jo=null;function _t(){const e=yn();if(Gn&&Jo===e)return Gn;const t=new Map;for(const n of He)n.w&&t.set(n.w,n.pron);return Gn=t,Jo=e,t}function ve(e){return _t().get(e)||e}function Yn(e,t,n=new Set){const o=[];for(const u of ae(e)){if(o.length>=t)break;const r=ve(u);n.has(r)||(n.add(r),o.push(u))}return o}let ca=0;function ke(e){return`${e}-rt-${++ca}`}function Gt(e){const t=Fo();if(!t||t.total===0){const o=new Set;for(const u of e)o.add(u);return o}const n=new Set;for(const o of e)Rr(o)===!0&&n.add(o);return n}const _n=new Map;let Qo=null,eu=null;function Yt(e){return e==null?"":Array.isArray(e)?e.slice().sort().join(","):e}function tu(e){const t=Yt(e.choseong),n=e.composition,o=n?.syllable==null?"":Array.isArray(n.syllable)?n.syllable.slice().sort().join(","):String(n.syllable),u=n?`${Yt(n.cho)}/${Yt(n.jung)}/${Yt(n.jong)}/${n.jongNone?"N":""}/${o}`:"",r=Yt(e.grade);return`${e.difficulty??""}|${t}|${u}|${e.excludeNoImage?"1":"0"}|${e.count??""}|x${e.contrastCount??1}|${e.fullCount?"F":""}|s${e.sameStructureOnly===!1?"0":"1"}|v${e.phonemeView==="pron"?"p":"c"}|g${r}|t${e.targetSyllable??""}|c${e.choicesPerItem??""}`}async function Oe(e){const t=yn(),n=Ht();(t!==Qo||n!==eu)&&(_n.clear(),Qo=t,eu=n);const o=tu(e);return _n.has(o)||_n.set(o,ha(e)),_n.get(o)}function da(e){if(!e)return null;const t=i=>i==null?null:Array.isArray(i)?i.length?i:null:[i],n=t(e.cho),o=t(e.jung),u=!!e.jongNone,r=u?null:t(e.jong);return n||o||r||u?u&&!n&&!o&&!r?i=>Mr(i):i=>Tr(i,{cho:n,jung:o,jong:r,jongNone:u}):null}async function ha(e){const{difficulty:t=null,choseong:n=null,composition:o=null,targetSyllable:u=null,excludeNoImage:r=!1}=e,i=e.grade&&e.grade.length>0?new Set(e.grade):null,s=e.sameStructureOnly??!0,d=e.phonemeView==="pron"?"pron":"char",p=Math.max(1,e.contrastCount??1),f=t==="cho"||t==="jung"||t==="jong",C=f&&p>=2,c=t==="count",m=n?new Set(Array.isArray(n)?n:[n]):null,S=o?.syllable!=null?new Set(Array.isArray(o.syllable)?o.syllable:[o.syllable]):null,w=o?[da(o),S?M=>S.has(pn(M)):null].filter(M=>M!=null):[],_=t==="random"||t===null,g=_||c,b=_||C||c;let k=He.filter(M=>!M.w||i&&(!M.grade||!i.has(M.grade))?!1:b?!0:Array.isArray(M.p)&&M.p.length>0);m&&(k=k.filter(M=>{for(const P of m)if(wr(M.w,P))return!0;return!1})),w.length>0&&(k=k.filter(M=>{const P=d==="pron"?ve(M.w):M.w;return w.every(ne=>ne(P))})),u&&(k=k.filter(M=>M.w[0]===u));let D;if(r){const M=new Set;for(const P of k)if(M.add(P.w),Array.isArray(P.p))for(const ne of P.p)M.add(ne);if(g)for(const P of He)P.w&&M.add(P.w);D=Gt(M)}else{const M=new Set;for(const P of k)if(M.add(P.w),Array.isArray(P.p))for(const ne of P.p)M.add(ne);if(g)for(const P of He)P.w&&M.add(P.w);D=M}let R=null;if(C){const M=new Set;for(const P of He)P.w&&M.add(P.w);R=r?Gt(M):M}const v=k.filter(M=>D.has(M.w)),j=600,H=Array.from(D),G=H.length>j?ze(H,j):H,F=c&&o!=null&&(_e(o.cho)||_e(o.jung)||_e(o.jong)),J=2500,Y=new Map;if(c&&!F&&p>=2){for(const M of H){const P=pn(M),ne=Y.get(P);ne?ne.push(M):Y.set(P,[M])}for(const[M,P]of Y)P.length>J&&Y.set(M,ze(P,J))}const W=kr(),z=F?Qr(o,H,W,s,d,ve):null,B=500,O=1500,Ce=e.fullCount?v:t==="random"?v.length>B?ze(v,B):v:v.length>O?ze(v,O):v,X=Ht(),Q=[];for(const M of Ce){let P;const ne=ve(M.w);if(C)P=Br(M.w,t,p,R,24).filter(oe=>ve(oe)!==ne);else if(c)F?P=(z.get(M.w)??[]).filter(oe=>ve(oe)!==ne):p<=1?P=Wo(M.w,X,{okSet:D,pronOf:ve,decompOf:W,sameStructureOnly:!1}):P=(Y.get(pn(M.w))??[]).filter(oe=>{if(oe===M.w||ve(oe)===ne)return!1;const q=Dr(M.w,oe);return p>=5?q>=5:q===p});else if(_)P=G.filter(oe=>oe!==M.w&&oe.length===M.w.length&&ve(oe)!==ne);else{const oe=t;P=Wo(M.w,X,{kind:oe,okSet:D,pronOf:ve,decompOf:W,sameStructureOnly:!1}),P.length===0&&(P=(G.length>30?ze(G,30):G).filter(q=>q!==M.w&&Ar(M.w,q)===t&&ve(q)!==ne))}if(s&&P.length>0&&(f||c&&!F)){const oe=W(ve(M.w));P=P.filter(q=>!zn(oe,W(ve(q))))}P.length!==0&&Q.push({word:M,usable:P})}return Q}async function nu(e,t){const{choicesPerItem:n=3,count:o=10}=t,u=n-1,r=(await Oe(t)).filter(s=>s.usable.length>=u),i=[];for(const s of ae(r)){if(i.length>=o)break;const d=Yn(s.usable,u);if(d.length<u)continue;const p=ae([s.word.w,...d]);i.push({id:ke(e+"-item"),index:i.length+1,word:s.word.w,syllables:s.word.s,choices:p,answerIndex:p.indexOf(s.word.w)})}return i}async function fa(e){const{choicesPerItem:t=3,count:n=10}=e,o=t-1,u=await Oe({...e,difficulty:null});if(u.length<t)return[];const r=[],i=ae([...u]);for(const s of i){if(r.length>=n)break;const d=s.word.w,p=[...s.word.pron||d],f=gn(p);if(!f)continue;const C=u.filter(S=>S.word.w!==d&&S.word.s===s.word.s&&!(S.word.pron||S.word.w).includes(f)&&S.word.pron!==s.word.pron);if(C.length<o)continue;const c=Yn(C.map(S=>S.word.w),o);if(c.length<o)continue;const m=ae([d,...c]);r.push({id:ke("HPI-item"),index:r.length+1,targetSyllable:f,word:d,choices:m,answerIndex:m.indexOf(d)})}return r}async function pa(e){const{count:t=10}=e,n=(await Oe(e)).filter(o=>o.usable.length>=1);return Array.from({length:t},(o,u)=>{const r=gn(n);if(!r)return null;const i=u%2===0;let s;if(i)s=[r.word.w,r.word.w];else{const d=gn(r.usable);s=Math.random()<.5?[r.word.w,d]:[d,r.word.w]}return{id:ke("SOD-item"),index:u+1,word:r.word.w,pair:s,same:i}}).filter(o=>!!o)}async function Ca(e){const{choicesPerItem:t=3,count:n=10}=e,o=t-1,u=await Oe({...e,difficulty:null});if(u.length<t+1)return[];const r=u.map(c=>c.word.w),i=new Map(u.map(c=>[c.word.w,c.word.pron])),s=c=>(i.get(c)||c)[0]??"",d={};for(const c of u){const m=s(c.word.w);m&&(d[m]||(d[m]=[]),d[m].push(c.word.w))}const p=Object.entries(d).filter(([,c])=>c.length>=2).map(([c])=>c);if(p.length===0)return[];const f=[],C=ae([...p]);for(let c=0;f.length<n&&c<n*4;c++){const m=C[c%C.length],S=d[m];if(S.length<2)continue;const w=ae([...S]),_=w[0],g=w[1];if(!_||!g||_===g||(i.get(_)||_)===(i.get(g)||g))continue;const b=i.get(g)||g,k=r.filter(v=>s(v)!==m&&v!==_&&v!==g&&v.length===g.length&&(i.get(v)||v)!==b);if(k.length<o)continue;const D=Yn(k,o);if(D.length<o)continue;const R=ae([g,...D]);f.push({id:ke("SWS-item"),index:f.length+1,sourceWord:_,targetSyllable:m,word:g,choices:R,answerIndex:R.indexOf(g)})}return f}function ou(e,t,n){return ze(e,t).map((o,u)=>{const r=gn(o.usable)??"",i=[...o.word.w],s=[...r],d=i.findIndex((f,C)=>f!==s[C]),p=ae(o.usable.filter(f=>f&&f!==r)).slice(0,2);return{id:ke(n),index:u+1,word:o.word.w,original:o.word.w,changed:r,changedFrom:d>=0?i[d]:"",changedTo:d>=0?s[d]:"",distractors:p}})}async function uu(e,t,n){const{count:o=10}=t,u=_t(),r=He.filter(m=>m.w&&m.s===e),i=t.excludeNoImage?Gt(r.map(m=>m.w)):null,s=i?r.filter(m=>i.has(m.w)):r,d=new Set(s.map(m=>m.w)),p=ia(d),f=t.phonemeView??"char",C=t.composition??null,c=[];for(const m of ae(s)){if(c.length>=o)break;const S=sa(m.w,C,u,f,p,null,null);if(!S)continue;const w=S.distractors[0],_=[...m.w],g=[...w],b=_.findIndex((k,D)=>k!==g[D]);c.push({id:ke(n),index:c.length+1,word:m.w,original:m.w,changed:w,changedFrom:b>=0?_[b]:"",changedTo:b>=0?g[b]:"",distractors:S.distractors.slice(1)})}return c}async function ya(e){return uu(2,e,"CS2-item")}async function ma(e){return uu(3,e,"CS3-item")}async function ga(e){const t=(await Oe({...e,difficulty:"count",contrastCount:1})).filter(n=>n.word.s===1&&n.usable.length>=1);return ou(t,e.count??10,"CP1-item")}async function _a(e){const t=e.difficulty&&e.difficulty!=="random"?e.difficulty:"count",n=(await Oe({...e,difficulty:t,contrastCount:1})).filter(o=>o.word.s===2&&o.usable.length>=1);return ou(n,e.count??10,"CP2-item")}async function Ea(e){const{count:t=10}=e,n=(await Oe({...e})).filter(o=>o.word.s===2);return ze(n,t).map((o,u)=>({id:ke("M2S-item"),index:u+1,word:o.word.w,answer:o.word.w,parts:[...o.word.w]}))}async function ba(e){const{count:t=10}=e,n=(await Oe({...e})).filter(o=>o.word.s===3);return ze(n,t).map((o,u)=>({id:ke("M3S-item"),index:u+1,word:o.word.w,answer:o.word.w,parts:[...o.word.w]}))}async function Sa(e){const{count:t=10}=e,n=(await Oe({...e})).filter(s=>s.word.s===2),o=_t(),u=new Set(He.map(s=>s.w)),r=e.phonemeView??"char",i=[];for(const s of ae(n)){if(i.length>=t)break;const d=na(s.word.w,e.composition??null,o,r,u);if(!d)continue;const[p,...f]=d.distractors,C=[...s.word.w],c=C[0]===p?C[1]:C[0];i.push({id:ke("D2-item"),index:i.length+1,original:s.word.w,word:s.word.w,dropped:c,missingResult:p,distractors:f})}return i}async function ka(e){const{count:t=10}=e,n=(await Oe({...e})).filter(s=>s.word.s===3),o=_t(),u=new Set(He.map(s=>s.w)),r=e.phonemeView??"char",i=[];for(const s of ae(n)){if(i.length>=t)break;const d=oa(s.word.w,e.composition??null,o,r,u);if(!d)continue;const[p,...f]=d.distractors,C=[...s.word.w];let c="";for(let m=0;m<C.length;m++)if(C.filter((S,w)=>w!==m).join("")===p){c=C[m];break}i.push({id:ke("D3-item"),index:i.length+1,original:s.word.w,word:s.word.w,dropped:c,missingResult:p,distractors:f})}return i}async function Aa(e){const{count:t=10}=e,n=(await Oe({...e})).filter(s=>s.word.s>=2),o=_t(),u=new Set(He.map(s=>s.w)),r=e.phonemeView??"char",i=[];for(const s of ae(n)){if(i.length>=t)break;const d=ua(s.word.w,e.composition??null,o,r,u);if(!d)continue;const[p,...f]=d.distractors,C=s.word.w,c=C.startsWith(p)?C.slice(p.length):C.endsWith(p)?C.slice(0,C.length-p.length):"";i.push({id:ke("DPC-item"),index:i.length+1,original:C,word:C,dropped:c,missingResult:p,distractors:f})}return i}async function wa(e){const{count:t=10}=e,n=(await Oe({...e})).map(o=>o.word.w);return n.length<3?[]:Array.from({length:t},(o,u)=>{const r=ze(n,3);return{id:ke("LRO-item"),index:u+1,sequence:r,choices:ae(r)}})}function En(e,t,n){const o=He.filter(i=>i.w&&i.s===e),u=t?Gt(o.map(i=>i.w)):null,r=[];for(const i of o)if(!(u&&!u.has(i.w))){if(n){const s=se(i.w);if(!s||!n(s))continue}r.push(i)}return r}function Ma(e){const t=En(1,e.excludeNoImage??!1,n=>n.jong===0);return ze(t,e.count??10).map((n,o)=>{const u=se(n.w);return{id:ke("M2P-item"),index:o+1,parts:[Se[u.cho],rt[u.jung]],answer:n.w,word:n.w}})}function Na(e){const t=En(1,e.excludeNoImage??!1,n=>n.jong>0&&!$t[n.jong]);return ze(t,e.count??10).map((n,o)=>{const u=se(n.w);return{id:ke("M3P-item"),index:o+1,parts:[Se[u.cho],rt[u.jung],Pe[u.jong]],answer:n.w,word:n.w}})}function Ta(e){const t=Yo.DROP_FINAL_CONSONANT_FROM_1SYLL,n=En(t.syllables,e.excludeNoImage??!1,t.syllable),o=_t(),u=[];for(const r of ae(n)){if(u.length>=(e.count??10))break;const i=ra(r.w,null,o);if(!i)continue;const[s,...d]=i.distractors;u.push({id:ke("DFC-item"),index:u.length+1,original:r.w,word:r.w,result:s,distractors:d})}return u}function xa(e){const t=Yo.REMOVE_CONSONANT_AND_IDENTIFY_PHONEME,n=En(t.syllables,e.excludeNoImage??!1,t.syllable),o=_t(),u=[];for(const r of ae(n)){if(u.length>=(e.count??10))break;const i=aa(r.w,null,o);if(!i)continue;const s=se(o.get(r.w)||r.w);if(!s)continue;const[d,...p]=i.distractors;u.push({id:ke("RCP-item"),index:u.length+1,base:r.w,word:r.w,missingConsonant:Se[s.cho],remaining:d,distractors:p})}return u}const bn=new Map;let ru=null,au=null;async function iu(e,t={}){const n=yn(),o=Ht();(n!==ru||o!==au)&&(bn.clear(),ru=n,au=o);const u=`${e}:${tu(t)}`;if(bn.has(u))return bn.get(u);const r=await Da(e,t);return bn.set(u,r),r}const Ba={SAME_SOUND_PICK:e=>nu("SSP",e),HEAR_AND_PICK_SAME:e=>nu("HPS",e),HEAR_AND_PICK_INCLUDED:e=>fa(e),SAME_OR_DIFF:e=>pa(e),STARTS_WITH_SAME_SOUND:e=>Ca(e),LISTEN_AND_REMEMBER_ORDER:e=>wa(e),MERGE_2_SYLLABLES:e=>Ea(e),MERGE_3_SYLLABLES:e=>ba(e),MERGE_2_PHONEMES:e=>Ma(e),MERGE_3_PHONEMES:e=>Na(e),DROP_1_FROM_2SYLL:e=>Sa(e),DROP_1_FROM_3SYLL:e=>ka(e),DROP_PART_FROM_COMPOUND:e=>Aa(e),DROP_FINAL_CONSONANT_FROM_1SYLL:e=>Ta(e),REMOVE_CONSONANT_AND_IDENTIFY_PHONEME:e=>xa(e),CHANGE_1_SYLL_IN_2SYLL:e=>ya(e),CHANGE_1_SYLL_IN_3SYLL:e=>ma(e),CHANGE_1_PHONEME_IN_1SYLL:e=>ga(e),CHANGE_1_PHONEME_IN_2SYLL:e=>_a(e)};async function Da(e,t={}){const n=Ba[e];return n?await n(t):[]}async function va(e){const t=[null,"count"],n=Object.keys(Fn);let o=0;for(const u of t)for(const r of n){const i=Fn[r];iu(r,{difficulty:i.difficulty?u:null,choseong:null,count:10,excludeNoImage:e}).catch(()=>{}),++o%6===0&&await new Promise(s=>setTimeout(s,0))}}async function Oa(e){return(await Oe({...e,fullCount:!0})).length}async function La(e={}){const t=[];for(const s of He)s.w&&t.push(s.w);const n=e.excludeNoImage?Gt(t):t,o=new Set,u=new Set,r=new Set,i=new Set;for(const s of n){i.add(pn(s));for(const d of s){const p=se(d);if(p&&(Se[p.cho]!=="\u3147"&&o.add(Se[p.cho]),u.add(rt[p.jung]),p.jong>0)){r.add(Pe[p.jong]);const f=$t[p.jong];f&&f.forEach(C=>r.add(C))}}}return{cho:o,jung:u,jong:r,syllable:i}}const Et="\uC804\uCCB4";function Ra(...e){return e.filter(Boolean).join(" ")}/**
1
+ "use strict";var l=require("react"),mt=require("react-i18next"),V=require("react/jsx-runtime"),Bo=require("react-dom"),Pn=typeof document<"u"?document.currentScript:null;function mr({storageKey:e="fontScale",baseFont:t=20,minScale:n=.8,maxScale:o=1.4,step:u=.1,lineHeightRatio:r=1.4}={}){const i=_=>Math.max(n,Math.min(o,Number(_))),[s,c]=l.useState(()=>{try{const _=localStorage.getItem(e),g=_?Number(_):1;return Number.isFinite(g)?g:1}catch{return 1}});l.useEffect(()=>{try{localStorage.setItem(e,String(s))}catch{}},[e,s]);const C=_=>{c(typeof _=="function"?g=>i(_(g)):i(_))},f=()=>C(_=>+(_+u).toFixed(6)),p=()=>C(_=>+(_-u).toFixed(6)),d=s<o-Number.EPSILON,m=s>n+Number.EPSILON,S=Math.round(t*s),w=Math.round(S*r);return{scale:s,setScale:C,increase:f,decrease:p,canIncrease:d,canDecrease:m,fontSize:S,lineHeight:w}}const Do=l.createContext(null);function gr(e){return/max-width:\s*7[0-9][0-9]px/.test(e)}function _r(e){const t=l.useContext(Do),n=r=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(r).matches,[o,u]=l.useState(n(e));return l.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const r=window.matchMedia(e),i=c=>u(c.matches),s=r;return s.addEventListener?s.addEventListener("change",i):s.addListener&&s.addListener(i),u(r.matches),()=>{s.removeEventListener?s.removeEventListener("change",i):s.removeListener&&s.removeListener(i)}},[e]),t&&typeof t.mobile=="boolean"&&gr(e)?t.mobile:o}function vo(e){const t=l.useRef(e);return l.useEffect(()=>{t.current=e}),t}function Oo(e,t){const n=vo(t);l.useEffect(()=>{const o=()=>n.current();try{window.addEventListener(e,o)}catch{}return()=>{try{window.removeEventListener(e,o)}catch{}}},[e,n])}const $n=" \xB7 ",Lo=(()=>{if(typeof document>"u")return"";const e=document.title;return e.includes($n)?e.split($n).pop()??e:e})(),Ro=l.createContext(!1);function Er(e){const t=l.useContext(Ro);l.useEffect(()=>{if(t||typeof e!="string"||!e)return;const n=document.title;return document.title=Lo?`${e}${$n}${Lo}`:e,()=>{document.title=n}},[e,t])}function br(){const{t:e}=mt.useTranslation();return l.useCallback(t=>{if(!t)return"";const n=new Date(t).getTime();if(Number.isNaN(n))return"";const o=Math.floor((Date.now()-n)/864e5);return o<=0?e("myHomework.relativeDay.today","\uC624\uB298"):o===1?e("myHomework.relativeDay.yesterday","\uC5B4\uC81C"):e("myHomework.relativeDay.daysAgo",{n:o})},[e])}function Sr(e){const[t,n]=l.useState({current:"",next:"",confirm:""}),[o,u]=l.useState(null),[r,i]=l.useState(!1),s=l.useRef(null);l.useEffect(()=>()=>{s.current!==null&&clearTimeout(s.current)},[]);const c=l.useCallback(()=>{n({current:"",next:"",confirm:""}),u(null)},[]),C=l.useCallback(async()=>{if(!t.current){u({type:"error",text:"\uD604\uC7AC \uBE44\uBC00\uBC88\uD638\uB97C \uC785\uB825\uD558\uC138\uC694."});return}if(!t.next){u({type:"error",text:"\uC0C8 \uBE44\uBC00\uBC88\uD638\uB97C \uC785\uB825\uD558\uC138\uC694."});return}if(t.next!==t.confirm){u({type:"error",text:"\uC0C8 \uBE44\uBC00\uBC88\uD638\uAC00 \uC77C\uCE58\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."});return}i(!0);const f=e?await e(t.current,t.next):null;if(i(!1),f){u({type:"error",text:f});return}u({type:"success",text:"\uBE44\uBC00\uBC88\uD638\uAC00 \uBCC0\uACBD\uB418\uC5C8\uC2B5\uB2C8\uB2E4."}),n({current:"",next:"",confirm:""}),s.current!==null&&clearTimeout(s.current),s.current=setTimeout(()=>u(null),1500)},[t,e]);return{pw:t,setPw:n,pwMsg:o,setPwMsg:u,pwLoading:r,handleChangePw:C,reset:c}}const Se=["\u3131","\u3132","\u3134","\u3137","\u3138","\u3139","\u3141","\u3142","\u3143","\u3145","\u3146","\u3147","\u3148","\u3149","\u314A","\u314B","\u314C","\u314D","\u314E"],rt=["\u314F","\u3150","\u3151","\u3152","\u3153","\u3154","\u3155","\u3156","\u3157","\u3158","\u3159","\u315A","\u315B","\u315C","\u315D","\u315E","\u315F","\u3160","\u3161","\u3162","\u3163"],Pe=["","\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 se(e){if(!e)return null;const t=e.charCodeAt(0)-44032;return t<0||t>=11172?null:{cho:Math.floor(t/588),jung:Math.floor(t%588/28),jong:t%28}}function kr(){const e=new Map;return t=>{let n=e.get(t);return n||(n=[...t].map(o=>se(o)),e.set(t,n)),n}}function gt(e,t,n=0){return String.fromCharCode(44032+(e*21+t)*28+n)}function Ar(e,t){if(!e||!t||e===t||e.length!==t.length)return"random";let n=0,o=null;for(let u=0;u<e.length;u++){const r=se(e[u]),i=se(t[u]);if(!r||!i)return"random";if(r.cho===i.cho&&r.jung===i.jung&&r.jong===i.jong)continue;n++;const s=r.cho!==i.cho,c=r.jung!==i.jung,C=r.jong!==i.jong;(s?1:0)+(c?1:0)+(C?1:0)>1?o="multi":s?o="cho":c?o="jung":o="jong"}return n!==1?"random":o==="cho"?"cho":o==="jung"?"jung":o==="jong"?"jong":"random"}const $t={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"]};Object.fromEntries(Object.entries($t).map(([e,t])=>[t.join(""),Pe[Number(e)]]));function wr(e,t){if(!e||!t)return!1;for(const n of e){const o=se(n);if(o){if(Se[o.cho]===t)return!0;if(o.jong>0){if(Pe[o.jong]===t)return!0;const u=$t[o.jong];if(u&&u.includes(t))return!0}}}return!1}function pn(e){if(!e)return 0;let t=0;for(const n of e)se(n)&&t++;return t}function Mr(e){if(!e)return!1;let t=!1;for(const n of e){const o=se(n);if(o&&(t=!0,o.jong>0))return!1}return t}function Nr(e,t){if(e.jong<=0)return!1;if(t.includes(Pe[e.jong]))return!0;const n=$t[e.jong];return!!n&&n.some(o=>t.includes(o))}function Tr(e,t,n){if(!e)return!1;const o=[...e],u=r=>{const i=se(o[r]);if(!i||t.cho&&!t.cho.includes(Se[i.cho])||t.jung&&!t.jung.includes(rt[i.jung]))return!1;if(t.jongNone){if(i.jong>0)return!1}else if(t.jong&&!Nr(i,t.jong))return!1;return!0};if(n==="head")return u(0);if(n==="tail")return u(o.length-1);if(n==="mid"){for(let r=1;r<o.length-1;r++)if(u(r))return!0;return!1}for(let r=0;r<o.length;r++)if(u(r))return!0;return!1}const xr={cho:Se.length,jung:rt.length,jong:Pe.length};function Br(e,t,n,o,u=1/0){if(!e||n<1)return[];const r=[...e].map(p=>se(p));if(r.some(p=>!p))return[];const i=r,s=i.length;if(n>s)return[];const c=xr[t],C=new Set,f=[];(function p(d,m){if(m.length===n){f.push([...m]);return}for(let S=d;S<s;S++)m.push(S),p(S+1,m),m.pop()})(0,[]);for(const p of f)if((function d(m,S){if(C.size>=u)return;if(m===p.length){const g=S.map(b=>gt(b.cho,b.jung,b.jong)).join("");g!==e&&o.has(g)&&C.add(g);return}const w=p[m],_=i[w][t];for(let g=0;g<c;g++){if(g===_)continue;const b=S.slice();if(b[w]={...S[w],[t]:g},d(m+1,b),C.size>=u)return}})(0,i),C.size>=u)break;return[...C]}function Dr(e,t){if(!e||!t||e.length!==t.length)return-1;let n=0;for(let o=0;o<e.length;o++){const u=se(e[o]),r=se(t[o]);if(!u||!r)return-1;u.cho!==r.cho&&n++,u.jung!==r.jung&&n++,u.jong!==r.jong&&n++}return n}const Io="word_pair_index_v2",jo="word_pair_index_sig_v2";let Ft=null;function vr(){try{if(typeof localStorage>"u")return null;const e=localStorage.getItem(Io),t=localStorage.getItem(jo);return!e||!t?null:{index:JSON.parse(e),sig:t}}catch{return null}}function Ht(){if(Ft)return Ft;const e=vr();return e?(Ft=e.index,e.sig,Ft):null}function Or(){Ft=null;try{typeof localStorage<"u"&&(localStorage.removeItem(Io),localStorage.removeItem(jo))}catch{}}const Po="word_image_existence_map_v1";let Bt=null;function $o(){if(Bt)return Bt;try{const e=typeof localStorage<"u"?localStorage.getItem(Po):null;Bt=e?JSON.parse(e):{}}catch{Bt={}}return Bt}function Lr(e,t){return`${e}_${t??1}`}function Rr(e,t){const n=$o(),o=Lr(e,t);return o in n?n[o]:void 0}function Fo(){const e=$o(),t=Object.values(e);return t.length===0?null:{total:t.length,exists:t.filter(Boolean).length}}function Ir(){Bt={};try{typeof localStorage<"u"&&localStorage.removeItem(Po)}catch{}}const Ho=[{id:"wordData",labelKey:"settings.cache.group.wordData.label",subKey:"settings.cache.group.wordData.sub",keys:["word_data_cache","word_data_version"]},{id:"pairIndex",labelKey:"settings.cache.group.pairIndex.label",subKey:"settings.cache.group.pairIndex.sub",keys:["word_pair_index_v2","word_pair_index_sig_v2"]},{id:"imageCache",labelKey:"settings.cache.group.imageCache.label",subKey:"settings.cache.group.imageCache.sub",keys:["word_image_existence_map_v1"]}];function zo(e){return e.reduce((t,n)=>{try{const o=localStorage.getItem(n);return t+(o?new Blob([o]).size:0)}catch{return t}},0)}function jr(e){return e===0?"0 B":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(2)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`}function Pr(e){const{t}=mt.useTranslation(),[n,o]=l.useState({}),[u,r]=l.useState(null),[i,s]=l.useState(null),[c,C]=l.useState(null),f=l.useCallback(()=>{const d={};Ho.forEach(m=>{d[m.id]=zo([...m.keys])}),o(d),typeof navigator<"u"&&navigator.storage?.estimate&&navigator.storage.estimate().then(m=>{C({usage:m.usage??0,quota:m.quota??0})}).catch(()=>{})},[]);l.useEffect(()=>{f()},[f]);const p=l.useCallback(async d=>{r(d);try{d==="wordData"?(localStorage.removeItem("word_data_cache"),localStorage.removeItem("word_data_version")):d==="pairIndex"?Or():d==="imageCache"&&Ir(),f(),e?.(t("settings.cache.cleared","\uCE90\uC2DC\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4."))}finally{r(null)}},[f,e,t]);return{cacheSizes:n,clearingId:u,confirmCacheId:i,setConfirmCacheId:s,storageEstimate:c,refreshCacheSizes:f,handleClearCache:p}}function $r(e){const[t,n]=l.useState(null),[o,u]=l.useState(null),r=l.useCallback(()=>{const i=Ht();if(i){const c=Object.values(i),C=c.filter(f=>f.cho.length+f.jung.length+f.jong.length>0).length;n({matched:C,total:c.length})}else n(null);const s=Fo();u(s?{exists:s.exists,total:s.total}:null)},[]);return l.useEffect(()=>{r();const i=setTimeout(r,1e3);return()=>clearTimeout(i)},[e,r]),{pairStats:t,imgStats:o,setPairStats:n,setImgStats:u,refreshStats:r}}function Vo(e,t=[]){const[n,o]=l.useState(t),[u,r]=l.useState(null),[i,s]=l.useState(!1),[c,C]=l.useState(e),f=l.useRef(i);l.useEffect(()=>{f.current=i});const p=l.useRef(null);l.useEffect(()=>{if(f.current)return;const g=p.current;g!==null&&g.length===t.length&&g.every((b,k)=>b===t[k])||(p.current=t,o(t))},[t]);const d=l.useCallback(g=>{r(g),s(!1),C({...g})},[]),m=l.useCallback(()=>s(!0),[]),S=l.useCallback(()=>s(!1),[]),w=l.useCallback((g,b)=>{o(g),r(b),s(!1)},[]),_=l.useCallback(g=>{o(b=>b.filter(k=>k!==g)),r(null)},[]);return{list:n,setList:o,selected:u,setSelected:r,isEditing:i,setIsEditing:s,editForm:c,setEditForm:C,openDetail:d,startEditing:m,cancelEditing:S,commitEdit:w,remove:_}}const zt=()=>{const e=new Date;return{year:String(e.getFullYear()),month:String(e.getMonth()+1).padStart(2,"0"),day:String(e.getDate()).padStart(2,"0")}},Fr={year:"",month:"",day:"",hour:"09",minute:"00",memo:""};function Hr(e=[]){const{list:t,setList:n,selected:o,setSelected:u,isEditing:r,setIsEditing:i,editForm:s,setEditForm:c,openDetail:C,commitEdit:f}=Vo(Fr,e),{year:p,month:d,day:m}=zt(),[S,w]=l.useState({year:p,month:d,day:m,hour:"09",minute:"00",memo:""});return{visitHistory:t,visitForm:S,setVisitForm:w,setVisit:_=>g=>w(b=>({...b,[_]:g})),selectedVisit:o,setSelectedVisit:u,isEditingVisit:r,setIsEditingVisit:i,editVisitForm:s,setEditVisitForm:c,openVisitDetail:C,handleVisitSave:_=>{n(D=>[S,...D]);const{year:g,month:b,day:k}=zt();w({year:g,month:b,day:k,hour:"09",minute:"00",memo:""}),_?.()},handleVisitEditSave:()=>{f(_=>_.map(g=>g===o?s:g),s)},addVisit:_=>{n(g=>[_,...g])},removeVisit:_=>{n(g=>g.filter(b=>b!==_))},revertVisitEdit:(_,g)=>{n(b=>b.map(k=>k===g?_:k)),u(b=>b===g?_:b)}}}const Uo=e=>`${e.year.padStart(4,"0")}-${e.month.padStart(2,"0")}-${e.day.padStart(2,"0")} ${e.hour.padStart(2,"0")}:${e.minute.padStart(2,"0")}`,Cn=e=>[...e].sort((t,n)=>{const o=Uo(t),u=Uo(n);return o<u?-1:o>u?1:0}),zr={year:"",month:"",day:"",hour:"09",minute:"00",memo:""};function Vr(e,t=[]){const n=l.useMemo(()=>Cn(t),[t]),{list:o,setList:u,selected:r,setSelected:i,isEditing:s,setIsEditing:c,editForm:C,setEditForm:f,openDetail:p,commitEdit:d,remove:m}=Vo(zr,n),[S,w]=l.useState([]),{year:_,month:g,day:b}=zt(),[k,D]=l.useState({year:_,month:g,day:b,hour:"09",minute:"00",memo:""}),R=z=>B=>D(O=>({...O,[z]:B})),v=z=>{u(X=>Cn([...X,k]));const{year:B,month:O,day:Ce}=zt();D({year:B,month:O,day:Ce,hour:"09",minute:"00",memo:""}),z?.()},j=()=>{d(z=>Cn(z.map(B=>B===r?C:B)),C)},H=l.useCallback(z=>{m(z)},[m]),G=l.useCallback(z=>{e({year:z.year,month:z.month,day:z.day,hour:z.hour,minute:z.minute,memo:z.memo}),m(z)},[e,m]),F=l.useCallback(z=>{u(B=>B.filter(O=>O!==z)),w(B=>[z,...B]),i(null)},[u,i]),J=l.useCallback(z=>{u(B=>Cn([...B,z]))},[u]),Y=l.useCallback(z=>{u(B=>B.filter(O=>O!==z))},[u]),W=l.useCallback((z,B)=>{u(O=>O.map(Ce=>Ce===B?z:Ce)),i(O=>O===B?z:O)},[u,i]);return{scheduleList:o,noShowList:S,addSchedule:J,removeSchedule:Y,revertScheduleEdit:W,scheduleForm:k,setScheduleForm:D,setSchedule:R,selectedSchedule:r,setSelectedSchedule:i,isEditingSchedule:s,setIsEditingSchedule:c,editScheduleForm:C,setEditScheduleForm:f,openScheduleDetail:p,handleScheduleSave:v,handleScheduleEditSave:j,handleScheduleDelete:H,handleScheduleToVisit:G,handleScheduleNoVisit:F}}const Go=[{value:"10",label:"10\uAC1C\uC529 \uBCF4\uAE30"},{value:"25",label:"25\uAC1C\uC529 \uBCF4\uAE30"},{value:"50",label:"50\uAC1C\uC529 \uBCF4\uAE30"},{value:"100",label:"100\uAC1C\uC529 \uBCF4\uAE30"}];function Ur(e){const[t,n]=l.useState(""),[o,u]=l.useState("25"),[r,i]=l.useState("all"),[s,c]=l.useState(1),C=l.useMemo(()=>e.filter(({item:m,status:S})=>!(t&&!m.memo.includes(t)||r!=="all"&&S!==r)),[e,t,r]),f=Math.max(1,Math.ceil(C.length/Number(o))),p=Math.min(s,f),d=l.useMemo(()=>C.slice((p-1)*Number(o),p*Number(o)),[C,p,o]);return{vapSearch:t,setVapSearch:n,vapPageSize:o,setVapPageSize:u,vapStatus:r,setVapStatus:i,vapPage:p,setVapPage:c,vapFiltered:C,vapTotal:f,vapPageItems:d}}function Gr(e,t){const{t:n}=mt.useTranslation(),[o,u]=l.useState("25"),[r,i]=l.useState(1),[s,c]=l.useState(t);s!==t&&(c(t),r!==1&&i(1));const C=l.useMemo(()=>Go.map(m=>({...m,label:n("visits.showN",{n:m.value})})),[n]),f=l.useCallback(m=>{u(m),i(1)},[]),p=Math.max(1,Math.ceil(e.length/Number(o))),d=Math.min(r,p);return{pageRows:l.useMemo(()=>e.slice((d-1)*Number(o),d*Number(o)),[e,d,o]),pageSizeProps:{options:C,value:o,onChange:f},paginationProps:{page:d,total:p,onChange:i},setPage:i}}function Yr(){const[e,t]=l.useState(null),n=l.useCallback(u=>{t(r=>r?.key===u?{key:u,asc:!r.asc}:{key:u,asc:!0})},[]),o=l.useCallback((u,r)=>({label:u,sortDir:e?.key===r?e.asc?"asc":"desc":null,onClick:()=>n(r)}),[e,n]);return{\uC815\uB82C:e,\uCE78:o}}function qr(){const[e,t]=l.useState(!1),[n,o]=l.useState("\uC88C"),[u,r]=l.useState({\uC88C:null,\uC6B0:null}),[i,s]=l.useState({\uC88C:[],\uC6B0:[]}),[c,C]=l.useState(!1),[f,p]=l.useState("\uC88C"),d=l.useCallback(S=>{const w=S.direction;r(_=>({..._,[w]:S})),s(_=>({..._,[w]:[S,..._[w]]})),t(!1)},[]),m=l.useCallback(S=>{const w=S.direction;r(_=>({..._,[w]:S})),C(!1)},[]);return{showDevice:e,setShowDevice:t,deviceDirection:n,setDeviceDirection:o,devices:u,setDevices:r,deviceHistory:i,setDeviceHistory:s,showDeviceList:c,setShowDeviceList:C,listForSide:f,setListForSide:p,handleDeviceSubmit:d,handleSelectFromList:m}}const Wr="__ihab_core_word_pool__";function yn(){return globalThis[Wr]??null}function ae(e,t=Math.random){const n=e.slice();for(let o=n.length-1;o>0;o--){const u=Math.floor(t()*(o+1));[n[o],n[u]]=[n[u],n[o]]}return n}function at(e,t,n=Math.random){return!Array.isArray(e)||e.length===0||t<=0?[]:t>=e.length?ae(e,n):ae(e,n).slice(0,t)}const Fn={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"}},Kr=Se.indexOf("\u3147"),Yo={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!==Kr},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}},Xr={\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"},Zr={\u314F:{nucleus:"\u314F"},\u3151:{glide:"j",nucleus:"\u314F"},\u3153:{nucleus:"\u3153"},\u3155:{glide:"j",nucleus:"\u3153"},\u3157:{nucleus:"\u3157"},\u315B:{glide:"j",nucleus:"\u3157"},\u315C:{nucleus:"\u315C"},\u3160:{glide:"j",nucleus:"\u315C"},\u3161:{nucleus:"\u3161"},\u3163:{nucleus:"\u3163"},\u3150:{nucleus:"\u3154/\u3150"},\u3152:{glide:"j",nucleus:"\u3154/\u3150"},\u3154:{nucleus:"\u3154/\u3150"},\u3156:{glide:"j",nucleus:"\u3154/\u3150"},\u3158:{glide:"w",nucleus:"\u314F"},\u3159:{glide:"w",nucleus:"\u3154/\u3150"},\u315A:{glide:"w",nucleus:"\u3154/\u3150"},\u315D:{glide:"w",nucleus:"\u3153"},\u315E:{glide:"w",nucleus:"\u3154/\u3150"},\u315F:{glide:"w",nucleus:"\u3163"},\u3162:{glide:"\u0270",nucleus:"\u3163"}};function qo(e){return Xr[e]??e}const Hn={cho:Se,jung:rt,jong:Pe},_e=e=>Array.isArray(e)?e.length>0:!!e;function zn(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){const o=e[n],u=t[n];if(!(!o||!u)&&(o.cho!==u.cho&&Se[o.cho]==="\u3147"!=(Se[u.cho]==="\u3147")||o.jong!==u.jong&&o.jong===0!=(u.jong===0)))return!0}return!1}function Jr(e,t,n){const o=n.pronOf(e),u=n.decompOf,r=n.sameStructureOnly&&u?u(o):null,i=[];for(const s of t)s!==e&&(n.okSet&&!n.okSet.has(s)||n.pronOf(s)!==o&&(r&&u&&zn(r,u(n.pronOf(s)))||i.push(s)));return i}function Wo(e,t,n){const o=t?.[e];if(!o)return[];const u=n.kind?o[n.kind]??[]:[...o.cho??[],...o.jung??[],...o.jong??[]];return Jr(e,u,n)}function Qr(e,t,n,o,u,r,i){const s=["cho","jung","jong"].filter(d=>_e(e[d])),c={};for(const d of s){const m=e[d];c[d]=new Set(Array.isArray(m)?m:[m])}const C=u==="pron",f=new Map;for(const d of t){const m=n(r(d));if(m.some(g=>!g))continue;let S=m;if(!C&&(S=n(d),S.length!==m.length||S.some(g=>!g)))continue;const w=m.length,_=f.get(w);_?_.push({w:d,dPron:m,dPos:S}):f.set(w,[{w:d,dPron:m,dPos:S}])}const p=new Map;for(const[d,m]of f){const S=new Map,w=(_,g)=>{const b=_.dPos[g];return b!=null&&s.every(k=>c[k].has(Hn[k][b[k]]))};for(const _ of m){let g;if(i==="head")g=w(_,0)?0:-1;else if(i==="tail")g=w(_,d-1)?d-1:-1;else if(i==="mid"){g=-1;for(let k=1;k<d-1;k++)if(w(_,k)){g=k;break}}else g=_.dPos.findIndex(k=>k!=null&&s.every(D=>c[D].has(Hn[D][k[D]])));if(g<0)continue;const b=S.get(g);b?b.push(_):S.set(g,[_])}for(const[_,g]of S){const b=new Set(s.map(R=>_+":"+R)),k=R=>{let v="";for(let j=0;j<d;j++){const H=R[j];for(const G of["cho","jung","jong"])v+=(b.has(j+":"+G)?"*":H[G])+"."}return v},D=new Map;for(const R of m){const v=k(R.dPron),j=D.get(v);j?j.push(R):D.set(v,[R])}for(const R of g){const v=D.get(k(R.dPron))??[],j=[];for(const H of v){if(H.w===R.w)continue;let G=!0;for(const F of s){const J=R.dPron[_][F],Y=H.dPron[_][F];if(Y===J){G=!1;break}if(C&&c[F].has(Hn[F][Y])){G=!1;break}}G&&(o&&zn(R.dPron,H.dPron)||j.push(H.w))}p.set(R.w,j)}}}return p}const ea=e=>e==null?[]:Array.isArray(e)?e:[e];function ta(e){if([...e].length!==1)return"";const t=se(e);if(!t)return"";const n=qo(Pe[t.jong]),o=n===""?0:Pe.indexOf(n);return gt(t.cho,t.jung,o<0?0:o)}function Ko(e,t){return t.get(e)||ta(e)||e}function Vn(e){return e?_e(e.cho)?"cho":_e(e.jung)?"jung":_e(e.jong)?"jong":null:null}function Dt(e,t){const n=(o,u)=>!_e(o)||ea(o).includes(u);return n(t.cho,Se[e.cho])&&n(t.jung,rt[e.jung])&&n(t.jong,Pe[e.jong])}function Vt(e,t,n){const o=[...e];if(n!=="pron")return o.map(r=>se(r));const u=[...t.get(e)||e];return u.length!==o.length?o.map(r=>se(r)):u.map(r=>se(r))}function Ut(e,t,n,o,u){const r=t==="cho"?Se:t==="jung"?rt:Pe,i=e[t],s=[],c=new Set([Ko(n,u)]),C=ae(r.map((f,p)=>p).filter(f=>f!==i&&(t!=="cho"||r[f]!=="\u3147")&&(t!=="jong"||f!==0)));for(const f of C){if(s.length>=o)break;const p=t==="cho"?gt(f,e.jung,e.jong):t==="jung"?gt(e.cho,f,e.jong):gt(e.cho,e.jung,f),d=Ko(p,u);c.has(d)||(c.add(d),s.push(p))}return s}function na(e,t,n,o,u,r=null){const i=[...e];if(i.length!==2)return null;const s=i.map(p=>se(p));if(s.some(p=>!p))return null;const c=Vt(e,n,o);if(c.some(p=>!p))return null;const C=Vn(t);let f=C&&t?c.map((p,d)=>Dt(p,t)?d:-1).filter(p=>p>=0):[0,1];if(r!=null&&(f=f.filter(p=>p!==r)),!f.length)return null;for(const p of ae(f)){const d=i[p];if(!u.has(d))continue;const m=Ut(s[p],C??"cho",d,40,n),S=[];for(const w of m)if(w!==d&&u.has(w)&&!S.includes(w)&&S.push(w),S.length>=2)break;if(!(S.length<2))return{question:e,distractors:[d,...S]}}return null}function oa(e,t,n,o,u,r=null){const i=[...e];if(i.length!==3)return null;const s=i.map(p=>se(p));if(s.some(p=>!p))return null;const c=Vt(e,n,o);if(c.some(p=>!p))return null;const C=Vn(t),f=C&&t?c.map((p,d)=>Dt(p,t)?d:-1).filter(p=>p>=0):[0,1,2];if(!f.length)return null;for(const p of ae(f))for(const d of ae([0,1,2].filter(m=>m!==p&&(r==null||m===r)))){const m=[0,1,2].filter(b=>b!==d),S=m.map(b=>i[b]).join("");if(!u.has(S))continue;const w=m.indexOf(p),_=Ut(s[p],C??"cho",i[p],40,n),g=[];for(const b of _){const k=m.map(R=>i[R]);k[w]=b;const D=k.join("");if(D!==S&&u.has(D)&&!g.includes(D)&&g.push(D),g.length>=2)break}if(!(g.length<2))return{question:e,distractors:[S,...g]}}return null}function ua(e,t,n,o,u,r=null){const i=[...e],s=i.length;if(s<2)return null;const c=[];for(let f=1;f<=s-1;f++)c.push({remain:i.slice(0,f).join(""),dropped:i.slice(f).join(""),droppedEnd:1}),c.push({remain:i.slice(s-f).join(""),dropped:i.slice(0,s-f).join(""),droppedEnd:0});const C=Vn(t);for(const{remain:f,dropped:p,droppedEnd:d}of ae(c)){if(r!=null&&d!==r||f===e||!u.has(f)||!u.has(p))continue;const m=[...f],S=m.map(g=>se(g));if(S.some(g=>!g))continue;const w=Vt(f,n,o);if(w.some(g=>!g))continue;const _=C&&t?w.map((g,b)=>Dt(g,t)?b:-1).filter(g=>g>=0):m.map((g,b)=>b);if(_.length)for(const g of ae(_)){const b=Ut(S[g],C??"cho",m[g],40,n),k=[];for(const D of b){const R=[...m];R[g]=D;const v=R.join("");if(v!==f&&u.has(v)&&!k.includes(v)&&k.push(v),k.length>=2)break}if(k.length>=2)return{question:e,distractors:[f,...k]}}}return null}function ra(e,t,n,o,u,r=null){if([...e].length!==1)return null;const i=se(n.get(e)||e);if(!i||i.jong===0)return null;const s=gt(i.cho,i.jung,0),c=Ut({cho:i.cho,jung:i.jung,jong:0},"cho",s,2,n);return c.length<2?null:{question:e,distractors:[s,...c]}}const Un=Se.indexOf("\u3147");function aa(e,t,n,o,u,r=null){if([...e].length!==1)return null;const i=se(n.get(e)||e);if(!i||i.jong!==0||i.cho===Un)return null;const s=gt(Un,i.jung,0),c=Ut({cho:Un,jung:i.jung,jong:0},"jung",s,2,n);return c.length<2?null:{question:e,distractors:[s,...c]}}function ia(e){const t=new Map;for(const n of e){const o=[...n],u=o.length;if(!(u<2||u>3))for(let r=0;r<u;r++){let i=u+"|"+r+"|";for(let c=0;c<u;c++)i+=c===r?"*":o[c];const s=t.get(i);s?s.push(n):t.set(i,[n])}}return t}function sa(e,t,n,o,u,r=null,i=null,s=2){const c=[...e],C=c.length;if(C<2||C>3)return null;const f=c.map(b=>se(b));if(f.some(b=>!b))return null;const p=Vt(e,n,o);if(p.some(b=>!b))return null;const d=b=>n.get(b)??b,m=d(e),S=!!t&&(_e(t.cho)||_e(t.jung)||_e(t.jong)),w=!!i&&(_e(i.cho)||_e(i.jung)||_e(i.jong)),_=b=>{let k=C+"|"+b+"|";for(let D=0;D<C;D++)k+=D===b?"*":c[D];return k};let g;if(r!=null){if(r>=C||S&&!Dt(p[r],t))return null;g=[r]}else S?g=p.map((b,k)=>Dt(b,t)?k:-1).filter(b=>b>=0):g=Array.from({length:C},(b,k)=>k);for(const b of ae(g)){const k=u.get(_(b))??[],D=[],R=[];for(const F of k){if(F===e)continue;const J=[...F].map(B=>se(B)),Y=f[b],W=J[b];if(!Y||!W)continue;let z=0;if(Y.cho!==W.cho&&z++,Y.jung!==W.jung&&z++,Y.jong!==W.jong&&z++,!(z<s||d(F)===m))if(w){const B=Vt(F,n,o)[b];B&&Dt(B,i)?D.push(F):R.push(F)}else D.push(F)}if(!D.length)continue;const v=ae(D)[0],j=[],H=new Set([m,d(v)]),G=w?R:D.filter(F=>F!==v);for(const F of ae(G)){const J=d(F);if(!H.has(J)&&(H.add(J),j.push(F),j.length>=2))break}if(!w&&j.length<2)for(const F of ae(k)){if(F===e||F===v)continue;const J=d(F);if(!H.has(J)&&(H.add(J),j.push(F),j.length>=2))break}if(!(j.length<2))return{question:e,distractors:[v,...j]}}return null}let mn=null,Xo=null,Zo=null;function la(){const e=yn();if(e&&e.entries.length>0){const t=Ht();if(mn&&Xo===e&&Zo===t)return mn;const n=new Set,o=[];for(const u of e.entries)!u.word||n.has(u.word)||(n.add(u.word),o.push({w:u.word,s:u.syllables,p:t?.[u.word]?[...t[u.word].cho??[],...t[u.word].jung??[],...t[u.word].jong??[]]:[],pron:u.pronunciation||u.word,grade:u.grade}));return mn=o,Xo=e,Zo=t,mn}return[]}const He=new Proxy([],{get(e,t){const n=la(),o=n[t];return typeof o=="function"?o.bind(n):o}});function gn(e){return e.length?e[Math.floor(Math.random()*e.length)]:void 0}function ze(e,t){if(t>=e.length)return ae(e);if(t===0)return[];const n=e.slice();for(let o=0;o<t;o++){const u=o+Math.floor(Math.random()*(n.length-o)),r=n[o];n[o]=n[u],n[u]=r}return n.slice(0,t)}let Gn=null,Jo=null;function _t(){const e=yn();if(Gn&&Jo===e)return Gn;const t=new Map;for(const n of He)n.w&&t.set(n.w,n.pron);return Gn=t,Jo=e,t}function ve(e){return _t().get(e)||e}function Yn(e,t,n=new Set){const o=[];for(const u of ae(e)){if(o.length>=t)break;const r=ve(u);n.has(r)||(n.add(r),o.push(u))}return o}let ca=0;function ke(e){return`${e}-rt-${++ca}`}function Gt(e){const t=Fo();if(!t||t.total===0){const o=new Set;for(const u of e)o.add(u);return o}const n=new Set;for(const o of e)Rr(o)===!0&&n.add(o);return n}const _n=new Map;let Qo=null,eu=null;function Yt(e){return e==null?"":Array.isArray(e)?e.slice().sort().join(","):e}function tu(e){const t=Yt(e.choseong),n=e.composition,o=n?.syllable==null?"":Array.isArray(n.syllable)?n.syllable.slice().sort().join(","):String(n.syllable),u=n?`${Yt(n.cho)}/${Yt(n.jung)}/${Yt(n.jong)}/${n.jongNone?"N":""}/${o}`:"",r=Yt(e.grade);return`${e.difficulty??""}|${t}|${u}|${e.excludeNoImage?"1":"0"}|${e.count??""}|x${e.contrastCount??1}|${e.fullCount?"F":""}|s${e.sameStructureOnly===!1?"0":"1"}|v${e.phonemeView==="pron"?"p":"c"}|g${r}|t${e.targetSyllable??""}|c${e.choicesPerItem??""}`}async function Oe(e){const t=yn(),n=Ht();(t!==Qo||n!==eu)&&(_n.clear(),Qo=t,eu=n);const o=tu(e);return _n.has(o)||_n.set(o,ha(e)),_n.get(o)}function da(e){if(!e)return null;const t=i=>i==null?null:Array.isArray(i)?i.length?i:null:[i],n=t(e.cho),o=t(e.jung),u=!!e.jongNone,r=u?null:t(e.jong);return n||o||r||u?u&&!n&&!o&&!r?i=>Mr(i):i=>Tr(i,{cho:n,jung:o,jong:r,jongNone:u}):null}async function ha(e){const{difficulty:t=null,choseong:n=null,composition:o=null,targetSyllable:u=null,excludeNoImage:r=!1}=e,i=e.grade&&e.grade.length>0?new Set(e.grade):null,s=e.sameStructureOnly??!0,c=e.phonemeView==="pron"?"pron":"char",C=Math.max(1,e.contrastCount??1),f=t==="cho"||t==="jung"||t==="jong",p=f&&C>=2,d=t==="count",m=n?new Set(Array.isArray(n)?n:[n]):null,S=o?.syllable!=null?new Set(Array.isArray(o.syllable)?o.syllable:[o.syllable]):null,w=o?[da(o),S?M=>S.has(pn(M)):null].filter(M=>M!=null):[],_=t==="random"||t===null,g=_||d,b=_||p||d;let k=He.filter(M=>!M.w||i&&(!M.grade||!i.has(M.grade))?!1:b?!0:Array.isArray(M.p)&&M.p.length>0);m&&(k=k.filter(M=>{for(const P of m)if(wr(M.w,P))return!0;return!1})),w.length>0&&(k=k.filter(M=>{const P=c==="pron"?ve(M.w):M.w;return w.every(ne=>ne(P))})),u&&(k=k.filter(M=>M.w[0]===u));let D;if(r){const M=new Set;for(const P of k)if(M.add(P.w),Array.isArray(P.p))for(const ne of P.p)M.add(ne);if(g)for(const P of He)P.w&&M.add(P.w);D=Gt(M)}else{const M=new Set;for(const P of k)if(M.add(P.w),Array.isArray(P.p))for(const ne of P.p)M.add(ne);if(g)for(const P of He)P.w&&M.add(P.w);D=M}let R=null;if(p){const M=new Set;for(const P of He)P.w&&M.add(P.w);R=r?Gt(M):M}const v=k.filter(M=>D.has(M.w)),j=600,H=Array.from(D),G=H.length>j?ze(H,j):H,F=d&&o!=null&&(_e(o.cho)||_e(o.jung)||_e(o.jong)),J=2500,Y=new Map;if(d&&!F&&C>=2){for(const M of H){const P=pn(M),ne=Y.get(P);ne?ne.push(M):Y.set(P,[M])}for(const[M,P]of Y)P.length>J&&Y.set(M,ze(P,J))}const W=kr(),z=F?Qr(o,H,W,s,c,ve):null,B=500,O=1500,Ce=e.fullCount?v:t==="random"?v.length>B?ze(v,B):v:v.length>O?ze(v,O):v,X=Ht(),Q=[];for(const M of Ce){let P;const ne=ve(M.w);if(p)P=Br(M.w,t,C,R,24).filter(oe=>ve(oe)!==ne);else if(d)F?P=(z.get(M.w)??[]).filter(oe=>ve(oe)!==ne):C<=1?P=Wo(M.w,X,{okSet:D,pronOf:ve,decompOf:W,sameStructureOnly:!1}):P=(Y.get(pn(M.w))??[]).filter(oe=>{if(oe===M.w||ve(oe)===ne)return!1;const q=Dr(M.w,oe);return C>=5?q>=5:q===C});else if(_)P=G.filter(oe=>oe!==M.w&&oe.length===M.w.length&&ve(oe)!==ne);else{const oe=t;P=Wo(M.w,X,{kind:oe,okSet:D,pronOf:ve,decompOf:W,sameStructureOnly:!1}),P.length===0&&(P=(G.length>30?ze(G,30):G).filter(q=>q!==M.w&&Ar(M.w,q)===t&&ve(q)!==ne))}if(s&&P.length>0&&(f||d&&!F)){const oe=W(ve(M.w));P=P.filter(q=>!zn(oe,W(ve(q))))}P.length!==0&&Q.push({word:M,usable:P})}return Q}async function nu(e,t){const{choicesPerItem:n=3,count:o=10}=t,u=n-1,r=(await Oe(t)).filter(s=>s.usable.length>=u),i=[];for(const s of ae(r)){if(i.length>=o)break;const c=Yn(s.usable,u);if(c.length<u)continue;const C=ae([s.word.w,...c]);i.push({id:ke(e+"-item"),index:i.length+1,word:s.word.w,syllables:s.word.s,choices:C,answerIndex:C.indexOf(s.word.w)})}return i}async function fa(e){const{choicesPerItem:t=3,count:n=10}=e,o=t-1,u=await Oe({...e,difficulty:null});if(u.length<t)return[];const r=[],i=ae([...u]);for(const s of i){if(r.length>=n)break;const c=s.word.w,C=[...s.word.pron||c],f=gn(C);if(!f)continue;const p=u.filter(S=>S.word.w!==c&&S.word.s===s.word.s&&!(S.word.pron||S.word.w).includes(f)&&S.word.pron!==s.word.pron);if(p.length<o)continue;const d=Yn(p.map(S=>S.word.w),o);if(d.length<o)continue;const m=ae([c,...d]);r.push({id:ke("HPI-item"),index:r.length+1,targetSyllable:f,word:c,choices:m,answerIndex:m.indexOf(c)})}return r}async function pa(e){const{count:t=10}=e,n=(await Oe(e)).filter(o=>o.usable.length>=1);return Array.from({length:t},(o,u)=>{const r=gn(n);if(!r)return null;const i=u%2===0;let s;if(i)s=[r.word.w,r.word.w];else{const c=gn(r.usable);s=Math.random()<.5?[r.word.w,c]:[c,r.word.w]}return{id:ke("SOD-item"),index:u+1,word:r.word.w,pair:s,same:i}}).filter(o=>!!o)}async function Ca(e){const{choicesPerItem:t=3,count:n=10}=e,o=t-1,u=await Oe({...e,difficulty:null});if(u.length<t+1)return[];const r=u.map(d=>d.word.w),i=new Map(u.map(d=>[d.word.w,d.word.pron])),s=d=>(i.get(d)||d)[0]??"",c={};for(const d of u){const m=s(d.word.w);m&&(c[m]||(c[m]=[]),c[m].push(d.word.w))}const C=Object.entries(c).filter(([,d])=>d.length>=2).map(([d])=>d);if(C.length===0)return[];const f=[],p=ae([...C]);for(let d=0;f.length<n&&d<n*4;d++){const m=p[d%p.length],S=c[m];if(S.length<2)continue;const w=ae([...S]),_=w[0],g=w[1];if(!_||!g||_===g||(i.get(_)||_)===(i.get(g)||g))continue;const b=i.get(g)||g,k=r.filter(v=>s(v)!==m&&v!==_&&v!==g&&v.length===g.length&&(i.get(v)||v)!==b);if(k.length<o)continue;const D=Yn(k,o);if(D.length<o)continue;const R=ae([g,...D]);f.push({id:ke("SWS-item"),index:f.length+1,sourceWord:_,targetSyllable:m,word:g,choices:R,answerIndex:R.indexOf(g)})}return f}function ou(e,t,n){return ze(e,t).map((o,u)=>{const r=gn(o.usable)??"",i=[...o.word.w],s=[...r],c=i.findIndex((f,p)=>f!==s[p]),C=ae(o.usable.filter(f=>f&&f!==r)).slice(0,2);return{id:ke(n),index:u+1,word:o.word.w,original:o.word.w,changed:r,changedFrom:c>=0?i[c]:"",changedTo:c>=0?s[c]:"",distractors:C}})}async function uu(e,t,n){const{count:o=10}=t,u=_t(),r=He.filter(m=>m.w&&m.s===e),i=t.excludeNoImage?Gt(r.map(m=>m.w)):null,s=i?r.filter(m=>i.has(m.w)):r,c=new Set(s.map(m=>m.w)),C=ia(c),f=t.phonemeView??"char",p=t.composition??null,d=[];for(const m of ae(s)){if(d.length>=o)break;const S=sa(m.w,p,u,f,C,null,null);if(!S)continue;const w=S.distractors[0],_=[...m.w],g=[...w],b=_.findIndex((k,D)=>k!==g[D]);d.push({id:ke(n),index:d.length+1,word:m.w,original:m.w,changed:w,changedFrom:b>=0?_[b]:"",changedTo:b>=0?g[b]:"",distractors:S.distractors.slice(1)})}return d}async function ya(e){return uu(2,e,"CS2-item")}async function ma(e){return uu(3,e,"CS3-item")}async function ga(e){const t=(await Oe({...e,difficulty:"count",contrastCount:1})).filter(n=>n.word.s===1&&n.usable.length>=1);return ou(t,e.count??10,"CP1-item")}async function _a(e){const t=e.difficulty&&e.difficulty!=="random"?e.difficulty:"count",n=(await Oe({...e,difficulty:t,contrastCount:1})).filter(o=>o.word.s===2&&o.usable.length>=1);return ou(n,e.count??10,"CP2-item")}async function Ea(e){const{count:t=10}=e,n=(await Oe({...e})).filter(o=>o.word.s===2);return ze(n,t).map((o,u)=>({id:ke("M2S-item"),index:u+1,word:o.word.w,answer:o.word.w,parts:[...o.word.w]}))}async function ba(e){const{count:t=10}=e,n=(await Oe({...e})).filter(o=>o.word.s===3);return ze(n,t).map((o,u)=>({id:ke("M3S-item"),index:u+1,word:o.word.w,answer:o.word.w,parts:[...o.word.w]}))}async function Sa(e){const{count:t=10}=e,n=(await Oe({...e})).filter(s=>s.word.s===2),o=_t(),u=new Set(He.map(s=>s.w)),r=e.phonemeView??"char",i=[];for(const s of ae(n)){if(i.length>=t)break;const c=na(s.word.w,e.composition??null,o,r,u);if(!c)continue;const[C,...f]=c.distractors,p=[...s.word.w],d=p[0]===C?p[1]:p[0];i.push({id:ke("D2-item"),index:i.length+1,original:s.word.w,word:s.word.w,dropped:d,missingResult:C,distractors:f})}return i}async function ka(e){const{count:t=10}=e,n=(await Oe({...e})).filter(s=>s.word.s===3),o=_t(),u=new Set(He.map(s=>s.w)),r=e.phonemeView??"char",i=[];for(const s of ae(n)){if(i.length>=t)break;const c=oa(s.word.w,e.composition??null,o,r,u);if(!c)continue;const[C,...f]=c.distractors,p=[...s.word.w];let d="";for(let m=0;m<p.length;m++)if(p.filter((S,w)=>w!==m).join("")===C){d=p[m];break}i.push({id:ke("D3-item"),index:i.length+1,original:s.word.w,word:s.word.w,dropped:d,missingResult:C,distractors:f})}return i}async function Aa(e){const{count:t=10}=e,n=(await Oe({...e})).filter(s=>s.word.s>=2),o=_t(),u=new Set(He.map(s=>s.w)),r=e.phonemeView??"char",i=[];for(const s of ae(n)){if(i.length>=t)break;const c=ua(s.word.w,e.composition??null,o,r,u);if(!c)continue;const[C,...f]=c.distractors,p=s.word.w,d=p.startsWith(C)?p.slice(C.length):p.endsWith(C)?p.slice(0,p.length-C.length):"";i.push({id:ke("DPC-item"),index:i.length+1,original:p,word:p,dropped:d,missingResult:C,distractors:f})}return i}async function wa(e){const{count:t=10}=e,n=(await Oe({...e})).map(o=>o.word.w);return n.length<3?[]:Array.from({length:t},(o,u)=>{const r=ze(n,3);return{id:ke("LRO-item"),index:u+1,sequence:r,choices:ae(r)}})}function En(e,t,n){const o=He.filter(i=>i.w&&i.s===e),u=t?Gt(o.map(i=>i.w)):null,r=[];for(const i of o)if(!(u&&!u.has(i.w))){if(n){const s=se(i.w);if(!s||!n(s))continue}r.push(i)}return r}function Ma(e){const t=En(1,e.excludeNoImage??!1,n=>n.jong===0);return ze(t,e.count??10).map((n,o)=>{const u=se(n.w);return{id:ke("M2P-item"),index:o+1,parts:[Se[u.cho],rt[u.jung]],answer:n.w,word:n.w}})}function Na(e){const t=En(1,e.excludeNoImage??!1,n=>n.jong>0&&!$t[n.jong]);return ze(t,e.count??10).map((n,o)=>{const u=se(n.w);return{id:ke("M3P-item"),index:o+1,parts:[Se[u.cho],rt[u.jung],Pe[u.jong]],answer:n.w,word:n.w}})}function Ta(e){const t=Yo.DROP_FINAL_CONSONANT_FROM_1SYLL,n=En(t.syllables,e.excludeNoImage??!1,t.syllable),o=_t(),u=[];for(const r of ae(n)){if(u.length>=(e.count??10))break;const i=ra(r.w,null,o);if(!i)continue;const[s,...c]=i.distractors;u.push({id:ke("DFC-item"),index:u.length+1,original:r.w,word:r.w,result:s,distractors:c})}return u}function xa(e){const t=Yo.REMOVE_CONSONANT_AND_IDENTIFY_PHONEME,n=En(t.syllables,e.excludeNoImage??!1,t.syllable),o=_t(),u=[];for(const r of ae(n)){if(u.length>=(e.count??10))break;const i=aa(r.w,null,o);if(!i)continue;const s=se(o.get(r.w)||r.w);if(!s)continue;const[c,...C]=i.distractors;u.push({id:ke("RCP-item"),index:u.length+1,base:r.w,word:r.w,missingConsonant:Se[s.cho],remaining:c,distractors:C})}return u}const bn=new Map;let ru=null,au=null;async function iu(e,t={}){const n=yn(),o=Ht();(n!==ru||o!==au)&&(bn.clear(),ru=n,au=o);const u=`${e}:${tu(t)}`;if(bn.has(u))return bn.get(u);const r=await Da(e,t);return bn.set(u,r),r}const Ba={SAME_SOUND_PICK:e=>nu("SSP",e),HEAR_AND_PICK_SAME:e=>nu("HPS",e),HEAR_AND_PICK_INCLUDED:e=>fa(e),SAME_OR_DIFF:e=>pa(e),STARTS_WITH_SAME_SOUND:e=>Ca(e),LISTEN_AND_REMEMBER_ORDER:e=>wa(e),MERGE_2_SYLLABLES:e=>Ea(e),MERGE_3_SYLLABLES:e=>ba(e),MERGE_2_PHONEMES:e=>Ma(e),MERGE_3_PHONEMES:e=>Na(e),DROP_1_FROM_2SYLL:e=>Sa(e),DROP_1_FROM_3SYLL:e=>ka(e),DROP_PART_FROM_COMPOUND:e=>Aa(e),DROP_FINAL_CONSONANT_FROM_1SYLL:e=>Ta(e),REMOVE_CONSONANT_AND_IDENTIFY_PHONEME:e=>xa(e),CHANGE_1_SYLL_IN_2SYLL:e=>ya(e),CHANGE_1_SYLL_IN_3SYLL:e=>ma(e),CHANGE_1_PHONEME_IN_1SYLL:e=>ga(e),CHANGE_1_PHONEME_IN_2SYLL:e=>_a(e)};async function Da(e,t={}){const n=Ba[e];return n?await n(t):[]}async function va(e){const t=[null,"count"],n=Object.keys(Fn);let o=0;for(const u of t)for(const r of n){const i=Fn[r];iu(r,{difficulty:i.difficulty?u:null,choseong:null,count:10,excludeNoImage:e}).catch(()=>{}),++o%6===0&&await new Promise(s=>setTimeout(s,0))}}async function Oa(e){return(await Oe({...e,fullCount:!0})).length}async function La(e={}){const t=[];for(const s of He)s.w&&t.push(s.w);const n=e.excludeNoImage?Gt(t):t,o=new Set,u=new Set,r=new Set,i=new Set;for(const s of n){i.add(pn(s));for(const c of s){const C=se(c);if(C&&(Se[C.cho]!=="\u3147"&&o.add(Se[C.cho]),u.add(rt[C.jung]),C.jong>0)){r.add(Pe[C.jong]);const f=$t[C.jong];f&&f.forEach(p=>r.add(p))}}}return{cho:o,jung:u,jong:r,syllable:i}}const Et="\uC804\uCCB4";function Ra(...e){return e.filter(Boolean).join(" ")}/**
2
2
  * @license lucide-react v1.38.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -28,7 +28,7 @@
28
28
  *
29
29
  * This source code is licensed under the ISC license.
30
30
  * See the LICENSE file in the root directory of this source tree.
31
- */const Pa=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},$a=l.createContext({}),Fa=()=>l.useContext($a),Ha=l.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:o,className:u="",children:r,iconNode:i,...s},d)=>{const{size:p=24,strokeWidth:f=2,absoluteStrokeWidth:C=!1,color:c="currentColor",className:m=""}=Fa()??{},S=o??C?Number(n??f)*24/Number(t??p):n??f;return l.createElement("svg",{ref:d,...qn,width:t??p??qn.width,height:t??p??qn.height,stroke:e??c,strokeWidth:S,className:su("lucide",m,u),...!r&&!Pa(s)&&{"aria-hidden":"true"},...s},[...i.map(([w,_])=>l.createElement(w,_)),...Array.isArray(r)?r:[r]])});/**
31
+ */const Pa=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},$a=l.createContext({}),Fa=()=>l.useContext($a),Ha=l.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:o,className:u="",children:r,iconNode:i,...s},c)=>{const{size:C=24,strokeWidth:f=2,absoluteStrokeWidth:p=!1,color:d="currentColor",className:m=""}=Fa()??{},S=o??p?Number(n??f)*24/Number(t??C):n??f;return l.createElement("svg",{ref:c,...qn,width:t??C??qn.width,height:t??C??qn.height,stroke:e??d,strokeWidth:S,className:su("lucide",m,u),...!r&&!Pa(s)&&{"aria-hidden":"true"},...s},[...i.map(([w,_])=>l.createElement(w,_)),...Array.isArray(r)?r:[r]])});/**
32
32
  * @license lucide-react v1.38.0 - ISC
33
33
  *
34
34
  * This source code is licensed under the ISC license.
@@ -778,6 +778,6 @@
778
778
  *
779
779
  * This source code is licensed under the ISC license.
780
780
  * See the LICENSE file in the root directory of this source tree.
781
- */const d0=[["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}],["path",{d:"M7 10v12",key:"1qc93n"}]],h0=y("thumbs-up",d0),fu={"alert-triangle":cu,"align-start-vertical":Ua,anchor:A1,"arrow-down":Ya,"arrow-left":Wa,"arrow-right":Xa,"arrow-right-left":Ja,"arrow-up-a-z":M1,"audio-lines":ei,baby:ni,ban:ui,"bar-chart-2":T1,bell:ai,"book-marked":si,"book-open":ci,"bow-arrow":hi,braces:pi,bug:yi,calendar:B1,"calendar-check":gi,"calendar-days":Ei,camera:Si,car:v1,"chart-column":Ai,"chart-line":Mi,"chart-pie":Ti,check:Bi,"chevron-down":e0,"chevron-left":vi,"chevron-right":Li,"chevron-up":n0,circle:u0,"clipboard-list":Ii,coffee:L1,combine:Pi,copy:Fi,"credit-card":zi,database:Ui,diff:Yi,download:Wi,ear:Xi,edit:Ji,"edit-2":es,"edit-3":ns,ellipsis:du,eraser:rs,"external-link":is,eye:ls,"file-text":ds,"flip-horizontal":fs,"folder-open":Cs,"folder-plus":ms,gamepad:_s,"gamepad-2":I1,gavel:bs,"git-merge":ks,globe:ws,headphones:Ns,heart:xs,home:Ds,inbox:P1,info:Os,"key-round":Rs,landmark:js,layers:$s,"layout-dashboard":Hs,leaf:Vs,lightbulb:Gs,link:qs,"link-2":Ks,"link-2-off":Zs,list:Qs,"list-checks":tl,"list-ordered":ol,"list-tree":F1,loader:rl,"log-out":il,mail:ll,"map-pin":dl,menu:s0,"message-circle":fl,"message-circle-question-mark":Cl,"message-square":ml,"message-square-more":z1,"message-square-text":_l,minus:U1,"minus-circle":bl,moon:c0,"more-horizontal":du,package:kl,palette:wl,"party-popper":Nl,pause:xl,pencil:Dl,phone:Ol,play:Rl,"play-circle":jl,plus:$l,printer:Hl,"refresh-cw":Vl,repeat:Gl,replace:ql,rocket:Kl,"rotate-ccw":Zl,"rotate-cw":Ql,salad:tc,"scan-search":oc,search:sc,"circle-alert":hu,"alert-circle":hu,"check-circle":ac,scissors:cc,"search-x":hc,send:pc,settings:yc,"share-2":Y1,"shield-check":gc,"shopping-cart":Ec,shuffle:Sc,"skip-back":Ac,"skip-forward":Mc,sparkles:W1,square:Tc,star:Bc,store:vc,"sun-medium":Lc,table:Ic,"table-2":Pc,terminal:Fc,"text-cursor-input":zc,"text-initial":Uc,"thumbs-up":h0,ticket:Yc,triangle:a0,"trash-2":Wc,"trending-up":Xc,"triangle-alert":cu,trophy:Jc,type:X1,unlink:e1,upload:n1,user:u1,"user-plus":a1,"user-round":s1,"user-round-check":c1,users:h1,"users-round":p1,volume:J1,"volume-2":y1,wrench:g1,x:E1,zap:S1};function f0(e){return fu[e]??null}const pu=new Set,p0=(()=>{try{const e=globalThis;return e.process!=null&&e.process.env?.NODE_ENV!=="production"}catch{return!1}})();function C0(e){return p0&&!(e in fu)&&!pu.has(e)&&(pu.add(e),console.warn(`[ihabdevteam-core] lucide \uC544\uC774\uCF58 '${e}' \uC774 \uC815\uC801 \uBAA9\uB85D\uC5D0 \uC5C6\uC5B4 \uB80C\uB354\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. utils/lucideIconSet.ts \uC758 STATIC_LUCIDE_ICONS \uC5D0 \uCD94\uAC00\uD558\uC138\uC694.`)),Promise.resolve(null)}const y0=e=>e.replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Za-z])([0-9])/g,"$1-$2").replace(/[_ ]+/g,"-").toLowerCase();function m0(e){const t=e.toLowerCase();if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:")||e.includes("/assets/"))return null;const n=(e.split("/").pop()||"").replace(/\.svg$/,"");return n?y0(n):null}const Cu=new Map;function g0(e){const t=typeof e=="string"?m0(e):null,n=t?f0(t)??Cu.get(t)??null:null,[o,u]=l.useState(null);return l.useEffect(()=>{if(!t||n)return;let r=!1;return C0(t).then(i=>{Cu.set(t,i),r||u(i)}),()=>{r=!0}},[t,n]),n??o}/*! @license DOMPurify 3.4.14 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.14/LICENSE */function yu(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function _0(e){if(Array.isArray(e))return e}function E0(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o,u,r,i,s=[],d=!0,p=!1;try{if(r=(n=n.call(e)).next,t!==0)for(;!(d=(o=r.call(n)).done)&&(s.push(o.value),s.length!==t);d=!0);}catch(f){p=!0,u=f}finally{try{if(!d&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(p)throw u}}return s}}function b0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
782
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function S0(e,t){return _0(e)||E0(e,t)||k0(e,t)||b0()}function k0(e,t){if(e){if(typeof e=="string")return yu(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yu(e,t):void 0}}const mu=Object.entries,gu=Object.setPrototypeOf,A0=Object.isFrozen,w0=Object.getPrototypeOf,M0=Object.getOwnPropertyDescriptor;let pe=Object.freeze,ge=Object.seal,vt=Object.create,_u=typeof Reflect<"u"&&Reflect,Wn=_u.apply,Kn=_u.construct;pe||(pe=function(t){return t}),ge||(ge=function(t){return t}),Wn||(Wn=function(t,n){for(var o=arguments.length,u=new Array(o>2?o-2:0),r=2;r<o;r++)u[r-2]=arguments[r];return t.apply(n,u)}),Kn||(Kn=function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),u=1;u<n;u++)o[u-1]=arguments[u];return new t(...o)});const bt=de(Array.prototype.forEach),N0=de(Array.prototype.lastIndexOf),Eu=de(Array.prototype.pop),qt=de(Array.prototype.push),T0=de(Array.prototype.splice),Ot=Array.isArray,Wt=de(String.prototype.toLowerCase),Xn=de(String.prototype.toString),bu=de(String.prototype.match),Kt=de(String.prototype.replace),Su=de(String.prototype.indexOf),x0=de(String.prototype.trim),B0=de(Number.prototype.toString),D0=de(Boolean.prototype.toString),ku=typeof BigInt>"u"?null:de(BigInt.prototype.toString),Au=typeof Symbol>"u"?null:de(Symbol.prototype.toString),Be=de(Object.prototype.hasOwnProperty),Xt=de(Object.prototype.toString),Ae=de(RegExp.prototype.test),St=v0(TypeError);function de(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),u=1;u<n;u++)o[u-1]=arguments[u];return Wn(e,t,o)}}function v0(e){return function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return Kn(e,n)}}function Z(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Wt;if(gu&&gu(e,null),!Ot(t))return e;let o=t.length;for(;o--;){let u=t[o];if(typeof u=="string"){const r=n(u);r!==u&&(A0(t)||(t[o]=r),u=r)}e[u]=!0}return e}function O0(e){for(let t=0;t<e.length;t++)Be(e,t)||(e[t]=null);return e}function Le(e){const t=vt(null);for(const o of mu(e)){var n=S0(o,2);const u=n[0],r=n[1];Be(e,u)&&(Ot(r)?t[u]=O0(r):r&&typeof r=="object"&&r.constructor===Object?t[u]=Le(r):t[u]=r)}return t}function L0(e){switch(typeof e){case"string":return e;case"number":return B0(e);case"boolean":return D0(e);case"bigint":return ku?ku(e):"0";case"symbol":return Au?Au(e):"Symbol()";case"undefined":return Xt(e);case"function":case"object":{if(e===null)return Xt(e);const t=e,n=Ve(t,"toString");if(typeof n=="function"){const o=n(t);return typeof o=="string"?o:Xt(o)}return Xt(e)}default:return Xt(e)}}function Ve(e,t){for(;e!==null;){const o=M0(e,t);if(o){if(o.get)return de(o.get);if(typeof o.value=="function")return de(o.value)}e=w0(e)}function n(){return null}return n}function R0(e){try{return Ae(e,""),!0}catch{return!1}}const wu=pe(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Zn=pe(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Jn=pe(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I0=pe(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Qn=pe(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),j0=pe(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Mu=pe(["#text"]),Nu=pe(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),eo=pe(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Tu=pe(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Sn=pe(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),P0=ge(/{{[\w\W]*|^[\w\W]*}}/g),$0=ge(/<%[\w\W]*|^[\w\W]*%>/g),F0=ge(/\${[\w\W]*/g),H0=ge(/^data-[\-\w.\u00B7-\uFFFF]+$/),z0=ge(/^aria-[\-\w]+$/),xu=ge(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),V0=ge(/^(?:\w+script|data):/i),U0=ge(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),G0=ge(/^html$/i),Y0=ge(/^[a-z][.\w]*(-[.\w]+)+$/i),Bu=ge(/<[/\w!]/g),Du=ge(/<[/\w]/g),q0=ge(/<\/no(script|embed|frames)/i),W0=ge(/\/>/i),Re={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},vu=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],K0=pe(Z({},vu)),X0=(function(){const e={};return bt(vu,t=>{e[t]=ge(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),pe(e)})(),Z0=function(){return typeof window>"u"?null:window},J0=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let o=null;const u="data-tt-policy-suffix";n&&n.hasAttribute(u)&&(o=n.getAttribute(u));const r="dompurify"+(o?"#"+o:"");try{return t.createPolicy(r,{createHTML(i){return i},createScriptURL(i){return i}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},Ou=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ft=function(t,n,o,u){return Be(t,n)&&Ot(t[n])?Z(u.base?Le(u.base):{},t[n],u.transform):o},to=function(t,n,o){const u=Be(t,n)?t[n]:void 0;return u&&typeof u=="object"?Le(u):o()};function Lu(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Z0();const t=N=>Lu(N);if(t.version="3.4.14",t.removed=[],!e||!e.document||e.document.nodeType!==Re.document||!e.Element)return t.isSupported=!1,t;let n=e.document;const o=n,u=o.currentScript;e.DocumentFragment;const r=e.HTMLTemplateElement,i=e.Node,s=e.Element,d=e.NodeFilter,p=e.NamedNodeMap;p===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const f=e.DOMParser,C=e.trustedTypes,c=s.prototype,m=Ve(c,"cloneNode"),S=Ve(c,"remove"),w=Ve(c,"nextSibling"),_=Ve(c,"childNodes"),g=Ve(c,"parentNode"),b=Ve(c,"shadowRoot"),k=Ve(c,"attributes"),D=i&&i.prototype?Ve(i.prototype,"nodeType"):null,R=i&&i.prototype?Ve(i.prototype,"nodeName"):null,v=i&&i.prototype?Ve(i.prototype,"ownerDocument"):null,j=function(a){return D?D(a):a.nodeType},H=function(a){return R?R(a):a.nodeName};if(typeof r=="function"){const N=n.createElement("template");N.content&&N.content.ownerDocument&&(n=N.content.ownerDocument)}let G,F="",J,Y=!1,W=0;const z=function(){if(W>0)throw St('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},B=function(a){z(),W++;try{return G.createHTML(a)}finally{W--}},O=function(a){z(),W++;try{return G.createScriptURL(a)}finally{W--}},Ce=function(){return Y||(J=J0(C,u),Y=!0),J},X=n,Q=X.implementation,M=X.createNodeIterator,P=X.createDocumentFragment,ne=X.getElementsByTagName,oe=o.importNode;let q=Ou();t.isSupported=typeof mu=="function"&&typeof g=="function"&&Q&&Q.createHTMLDocument!==void 0;const be=P0,T=$0,he=F0,fe=H0,Ie=z0,lt=V0,Ue=U0,Qe=Y0;let $e=xu,ee=null;const et=Z({},[...wu,...Zn,...Jn,...Qn,...Mu]);let ue=null;const A=Z({},[...Nu,...eo,...Tu,...Sn]);let L=Object.seal(vt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$=null,K=null;const te=Object.seal(vt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ne=!0,we=!0,Ge=!1,Fe=!0,ye=!1,je=!0,De=!1,ct=!1,Ye=null,tt=null,nt=!1,ot=!1,kt=!1,Ct=!1,Rt=!0,me=!1;const At="user-content-";let wt=!0,ut=!1,dt={},qe=null;const re=Z({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let We=null;const It=Z({},["audio","video","img","source","image","track"]);let Mt=null;const po=Z({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),rn="http://www.w3.org/1998/Math/MathML",an="http://www.w3.org/2000/svg",Ke="http://www.w3.org/1999/xhtml";let Nt=Ke,Bn=!1,Dn=null;const tr=Z({},[rn,an,Ke],Xn),Co=pe(["mi","mo","mn","ms","mtext"]);let vn=Z({},Co);const yo=pe(["annotation-xml"]);let On=Z({},yo);const nr=Z({},["title","style","font","a","script"]);let jt=null;const or=["application/xhtml+xml","text/html"],ur="text/html";let ce=null,Tt=null;const rr=n.createElement("form"),mo=function(a){return a instanceof RegExp||a instanceof Function},Ln=function(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Tt&&Tt===a)return;(!a||typeof a!="object")&&(a={}),a=Le(a),jt=or.indexOf(a.PARSER_MEDIA_TYPE)===-1?ur:a.PARSER_MEDIA_TYPE,ce=jt==="application/xhtml+xml"?Xn:Wt,ee=ft(a,"ALLOWED_TAGS",et,{transform:ce}),ue=ft(a,"ALLOWED_ATTR",A,{transform:ce}),Dn=ft(a,"ALLOWED_NAMESPACES",tr,{transform:Xn}),Mt=ft(a,"ADD_URI_SAFE_ATTR",po,{transform:ce,base:po}),We=ft(a,"ADD_DATA_URI_TAGS",It,{transform:ce,base:It}),qe=ft(a,"FORBID_CONTENTS",re,{transform:ce}),$=ft(a,"FORBID_TAGS",Le({}),{transform:ce}),K=ft(a,"FORBID_ATTR",Le({}),{transform:ce}),dt=Be(a,"USE_PROFILES")?a.USE_PROFILES&&typeof a.USE_PROFILES=="object"?Le(a.USE_PROFILES):a.USE_PROFILES:!1,Ne=a.ALLOW_ARIA_ATTR!==!1,we=a.ALLOW_DATA_ATTR!==!1,Ge=a.ALLOW_UNKNOWN_PROTOCOLS||!1,Fe=a.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ye=a.SAFE_FOR_TEMPLATES||!1,je=a.SAFE_FOR_XML!==!1,De=a.WHOLE_DOCUMENT||!1,ot=a.RETURN_DOM||!1,kt=a.RETURN_DOM_FRAGMENT||!1,Ct=a.RETURN_TRUSTED_TYPE||!1,nt=a.FORCE_BODY||!1,Rt=a.SANITIZE_DOM!==!1,me=a.SANITIZE_NAMED_PROPS||!1,wt=a.KEEP_CONTENT!==!1,ut=a.IN_PLACE||!1,$e=R0(a.ALLOWED_URI_REGEXP)?a.ALLOWED_URI_REGEXP:xu,Nt=typeof a.NAMESPACE=="string"?a.NAMESPACE:Ke,vn=to(a,"MATHML_TEXT_INTEGRATION_POINTS",()=>Z({},Co)),On=to(a,"HTML_INTEGRATION_POINTS",()=>Z({},yo));const h=to(a,"CUSTOM_ELEMENT_HANDLING",()=>vt(null));if(L=vt(null),Be(h,"tagNameCheck")&&mo(h.tagNameCheck)&&(L.tagNameCheck=h.tagNameCheck),Be(h,"attributeNameCheck")&&mo(h.attributeNameCheck)&&(L.attributeNameCheck=h.attributeNameCheck),Be(h,"allowCustomizedBuiltInElements")&&typeof h.allowCustomizedBuiltInElements=="boolean"&&(L.allowCustomizedBuiltInElements=h.allowCustomizedBuiltInElements),ge(L),ye&&(we=!1),kt&&(ot=!0),dt&&(ee=Z({},Mu),ue=vt(null),dt.html===!0&&(Z(ee,wu),Z(ue,Nu)),dt.svg===!0&&(Z(ee,Zn),Z(ue,eo),Z(ue,Sn)),dt.svgFilters===!0&&(Z(ee,Jn),Z(ue,eo),Z(ue,Sn)),dt.mathMl===!0&&(Z(ee,Qn),Z(ue,Tu),Z(ue,Sn))),te.tagCheck=null,te.attributeCheck=null,Be(a,"ADD_TAGS")&&(typeof a.ADD_TAGS=="function"?te.tagCheck=a.ADD_TAGS:Ot(a.ADD_TAGS)&&(ee===et&&(ee=Le(ee)),Z(ee,a.ADD_TAGS,ce))),Be(a,"ADD_ATTR")&&(typeof a.ADD_ATTR=="function"?te.attributeCheck=a.ADD_ATTR:Ot(a.ADD_ATTR)&&(ue===A&&(ue=Le(ue)),Z(ue,a.ADD_ATTR,ce))),Be(a,"ADD_FORBID_CONTENTS")&&Ot(a.ADD_FORBID_CONTENTS)&&(qe===re&&(qe=Le(qe)),Z(qe,a.ADD_FORBID_CONTENTS,ce)),wt&&(ee["#text"]=!0),De&&Z(ee,["html","head","body"]),ee.table&&(Z(ee,["tbody"]),delete $.tbody),a.TRUSTED_TYPES_POLICY){if(typeof a.TRUSTED_TYPES_POLICY.createHTML!="function")throw St('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof a.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw St('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const E=G;G=a.TRUSTED_TYPES_POLICY;try{F=B("")}catch(x){throw G=E,x}}else a.TRUSTED_TYPES_POLICY===null?(G=void 0,F=""):(G===void 0&&(G=Ce()),G&&typeof F=="string"&&(F=B("")));pe&&pe(a),Tt=a},go=Z({},[...Zn,...Jn,...I0]),_o=Z({},[...Qn,...j0]),ar=function(a,h,E){return h.namespaceURI===Ke?a==="svg":h.namespaceURI===rn?a==="svg"&&(E==="annotation-xml"||vn[E]):!!go[a]},ir=function(a,h,E){return h.namespaceURI===Ke?a==="math":h.namespaceURI===an?a==="math"&&On[E]:!!_o[a]},sr=function(a,h,E){return h.namespaceURI===an&&!On[E]||h.namespaceURI===rn&&!vn[E]?!1:!_o[a]&&(nr[a]||!go[a])},lr=function(a){let h=g(a);(!h||!h.tagName)&&(h={namespaceURI:Nt,tagName:"template"});const E=Wt(a.tagName),x=Wt(h.tagName);return Dn[a.namespaceURI]?a.namespaceURI===an?ar(E,h,x):a.namespaceURI===rn?ir(E,h,x):a.namespaceURI===Ke?sr(E,h,x):!!(jt==="application/xhtml+xml"&&Dn[a.namespaceURI]):!1},ht=function(a){qt(t.removed,{element:a});try{g(a).removeChild(a)}catch{if(S(a),!g(a))throw St("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Eo=function(a,h,E){try{a.removeAttributeNode(h)}catch{try{a.removeAttribute(E)}catch{}}},sn=function(a){ln(a);const h=_(a);if(h){const x=[];bt(h,I=>{qt(x,I)}),bt(x,I=>{try{S(I)}catch{}})}const E=k(a);if(E)for(let x=E.length-1;x>=0;--x){const I=E[x],U=I&&I.name;typeof U=="string"&&Eo(a,I,U)}},yt=function(a,h,E){if(!E)try{E=h.getAttributeNode(a)}catch{E=null}qt(t.removed,{attribute:E||null,from:h});try{E?h.removeAttributeNode(E):h.removeAttribute(a)}catch{try{h.removeAttribute(a)}catch{}}if(a==="is")if(ot||kt)try{ht(h)}catch{}else try{h.setAttribute(a,"")}catch{}},cr=function(a){const h=k(a);if(h)for(let E=h.length-1;E>=0;--E){const x=h[E],I=x&&x.name;typeof I!="string"||ue[ce(I)]||Eo(a,x,I)}},ln=function(a){const h=[a];for(;h.length>0;){const E=h.pop();j(E)===Re.element&&cr(E);const I=_(E);if(I)for(let U=I.length-1;U>=0;--U)h.push(I[U])}},bo=function(a,h){return je?a==="patchsrc"?!0:a==="for"&&h!=="label"&&h!=="output":!1},dr=function(a){if(!je)return;const h=[a];for(;h.length>0;){const E=h.pop(),x=j(E);if(x===Re.processingInstruction||x===Re.comment&&Ae(Du,E.data)){try{S(E)}catch{}continue}if(x===Re.element){const U=E,ie=ce(H(E));try{U.hasAttribute&&U.hasAttribute("patchsrc")&&U.removeAttribute("patchsrc"),U.hasAttribute&&U.hasAttribute("for")&&bo("for",ie)&&U.removeAttribute("for")}catch{}}const I=_(E);if(I)for(let U=I.length-1;U>=0;--U)h.push(I[U])}},So=function(a){let h=null,E=null;if(nt)a="<remove></remove>"+a;else{const U=bu(a,/^[\r\n\t ]+/);E=U&&U[0]}jt==="application/xhtml+xml"&&Nt===Ke&&(a='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+a+"</body></html>");const x=G?B(a):a;if(Nt===Ke)try{h=new f().parseFromString(x,jt)}catch{}if(!h||!h.documentElement){h=Q.createDocument(Nt,"template",null);try{h.documentElement.innerHTML=Bn?F:x}catch{}}const I=h.body||h.documentElement;return a&&E&&I.insertBefore(n.createTextNode(E),I.childNodes[0]||null),Nt===Ke?ne.call(h,De?"html":"body")[0]:De?h.documentElement:I},ko=function(a){const h=v?v(a):a.ownerDocument;return M.call(h||a,a,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},cn=function(a){return a=Kt(a,be," "),a=Kt(a,T," "),a=Kt(a,he," "),a},Rn=function(a){var h;a.normalize();const E=v?v(a):a.ownerDocument,x=M.call(E||a,a,d.SHOW_TEXT|d.SHOW_COMMENT|d.SHOW_CDATA_SECTION|d.SHOW_PROCESSING_INSTRUCTION,null);let I=x.nextNode();for(;I;)I.data=cn(I.data),I=x.nextNode();const U=(h=a.querySelectorAll)===null||h===void 0?void 0:h.call(a,"template");U&&bt(U,ie=>{xt(ie.content)&&Rn(ie.content)})},dn=function(a){const h=R?R(a):null;return typeof h!="string"||ce(h)!=="form"?!1:typeof a.nodeName!="string"||typeof a.textContent!="string"||typeof a.removeChild!="function"||a.attributes!==k(a)||typeof a.removeAttribute!="function"||typeof a.setAttribute!="function"||typeof a.namespaceURI!="string"||typeof a.insertBefore!="function"||typeof a.hasChildNodes!="function"||a.nodeType!==D(a)||a.childNodes!==_(a)},xt=function(a){if(!D||typeof a!="object"||a===null)return!1;try{return D(a)===Re.documentFragment}catch{return!1}},Pt=function(a){if(!D||typeof a!="object"||a===null)return!1;try{return typeof D(a)=="number"}catch{return!1}};function Xe(N,a,h){N.length!==0&&bt(N,E=>{E.call(t,a,h,Tt)})}const hr=function(a,h){return!!(je&&a.hasChildNodes()&&!Pt(a.firstElementChild)&&Ae(Bu,a.textContent)&&Ae(Bu,a.innerHTML)||je&&a.namespaceURI===Ke&&K0[h]&&(Pt(a.firstElementChild)||typeof a.textContent=="string"&&Ae(X0[h],a.textContent))||a.nodeType===Re.processingInstruction||je&&a.nodeType===Re.comment&&Ae(Du,a.data))},hn=function(a,h){if(a instanceof RegExp)return Ae(a,h);if(a instanceof Function){for(var E=arguments.length,x=new Array(E>2?E-2:0),I=2;I<E;I++)x[I-2]=arguments[I];return!!a(h,...x)}return!1},fr=function(a,h,E){if(!$[h]&&To(h)&&hn(L.tagNameCheck,h))return!1;if(wt&&!qe[h]){const x=g(a),I=_(a);if(I&&x){const U=I.length;for(let ie=U-1;ie>=0;--ie){const le=a===E?m(I[ie],!0):I[ie];x.insertBefore(le,w(a))}}}return ht(a),!0},Ao=function(a,h,E,x){return a.length===0?h:h===E||h===x?Le(h):h},wo=function(a,h){return a===h||g(a)!==null?!1:(ut&&ln(a),!0)},Mo=function(a,h){if(Xe(q.beforeSanitizeElements,a,null),wo(a,h))return!0;if(dn(a))return ht(a),!0;const E=ce(H(a));if(ee=Ao(q.uponSanitizeElement,ee,et,Ye),Xe(q.uponSanitizeElement,a,{tagName:E,allowedTags:ee}),wo(a,h))return!0;if(hr(a,E))return ht(a),!0;if($[E]||!(te.tagCheck instanceof Function&&te.tagCheck(E))&&!ee[E]){const I=fr(a,E,h);return I===!1&&Xe(q.afterSanitizeElements,a,null),I}if(j(a)===Re.element&&!lr(a)||(E==="noscript"||E==="noembed"||E==="noframes")&&Ae(q0,a.innerHTML))return ht(a),!0;if(ye&&a.nodeType===Re.text){const I=cn(a.textContent);a.textContent!==I&&(qt(t.removed,{element:a.cloneNode()}),a.textContent=I)}return Xe(q.afterSanitizeElements,a,null),!1},No=function(a,h,E){if(K[h]||bo(h,a)||Rt&&(h==="id"||h==="name")&&(E in n||E in rr))return!1;const x=ue[h]||te.attributeCheck instanceof Function&&te.attributeCheck(h,a);return we&&Ae(fe,h)||Ne&&Ae(Ie,h)?!0:x?Mt[h]||Ae($e,Kt(E,Ue,""))||(h==="src"||h==="xlink:href"||h==="href")&&a!=="script"&&Su(E,"data:")===0&&We[a]||Ge&&!Ae(lt,Kt(E,Ue,""))?!0:!E:To(a)&&hn(L.tagNameCheck,a)&&hn(L.attributeNameCheck,h,a)||h==="is"&&L.allowCustomizedBuiltInElements&&hn(L.tagNameCheck,E)},pr=Z({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),To=function(a){return!pr[Wt(a)]&&Ae(Qe,a)},Cr=function(a,h,E,x){if(G&&typeof C=="object"&&typeof C.getAttributeType=="function"&&!E)switch(C.getAttributeType(a,h)){case"TrustedHTML":return B(x);case"TrustedScriptURL":return O(x)}return x},yr=function(a,h,E,x){try{E?a.setAttributeNS(E,h,x):a.setAttribute(h,x),dn(a)?ht(a):Eu(t.removed)}catch{yt(h,a)}},xo=function(a){Xe(q.beforeSanitizeAttributes,a,null);const h=a.attributes;if(!h||dn(a))return;ue=Ao(q.uponSanitizeAttribute,ue,A,tt);const E={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ue,forceKeepAttr:void 0};let x=h.length;const I=ce(a.nodeName);for(;x--;){const U=h[x],ie=U.name,le=U.namespaceURI,Te=U.value,xe=ce(ie),jn=Te;let Me=ie==="value"?jn:x0(jn);if(E.attrName=xe,E.attrValue=Me,E.keepAttr=!0,E.forceKeepAttr=void 0,Xe(q.uponSanitizeAttribute,a,E),Me=E.attrValue,me&&(xe==="id"||xe==="name")&&Su(Me,At)!==0&&(yt(ie,a,U),Me=At+Me),je&&Ae(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Me)){yt(ie,a,U);continue}if(xe==="attributename"&&bu(Me,"href")){yt(ie,a,U);continue}if(!E.forceKeepAttr){if(!E.keepAttr){yt(ie,a,U);continue}if(!Fe&&Ae(W0,Me)){yt(ie,a,U);continue}if(ye&&(Me=cn(Me)),!No(I,xe,Me)){yt(ie,a,U);continue}Me=Cr(I,xe,le,Me),Me!==jn&&yr(a,ie,le,Me)}}Xe(q.afterSanitizeAttributes,a,null)},fn=function(a){let h=null;const E=ko(a);for(Xe(q.beforeSanitizeShadowDOM,a,null);h=E.nextNode();)if(Xe(q.uponSanitizeShadowNode,h,null),Mo(h,a),xo(h),xt(h.content)&&fn(h.content),j(h)===Re.element){const x=b(h);xt(x)&&(In(x),fn(x))}Xe(q.afterSanitizeShadowDOM,a,null)},In=function(a){const h=[{node:a,shadow:null}];for(;h.length>0;){const E=h.pop();if(E.shadow){fn(E.shadow);continue}const x=E.node,U=j(x)===Re.element,ie=_(x);if(ie)for(let le=ie.length-1;le>=0;--le)h.push({node:ie[le],shadow:null});if(U){const le=R?R(x):null;if(typeof le=="string"&&ce(le)==="template"){const Te=x.content;xt(Te)&&h.push({node:Te,shadow:null})}}if(U){const le=b(x);xt(le)&&h.push({node:null,shadow:le},{node:le,shadow:null})}}};return t.sanitize=function(N){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=null,E=null,x=null,I=null;if(Bn=!N,Bn&&(N="<!-->"),typeof N!="string"&&!Pt(N)&&(N=L0(N),typeof N!="string"))throw St("dirty is not a string, aborting");if(!t.isSupported)return N;ct?(ee=Ye,ue=tt):Ln(a),(q.uponSanitizeElement.length>0||q.uponSanitizeAttribute.length>0)&&(ee=Le(ee)),q.uponSanitizeAttribute.length>0&&(ue=Le(ue)),t.removed=[];const U=ut&&typeof N!="string"&&Pt(N);if(U){dr(N);const Te=H(N);if(typeof Te=="string"){const xe=ce(Te);if(!ee[xe]||$[xe])throw sn(N),St("root node is forbidden and cannot be sanitized in-place")}if(dn(N))throw sn(N),St("root node is clobbered and cannot be sanitized in-place");try{In(N)}catch(xe){throw sn(N),xe}}else if(Pt(N))h=So("<!---->"),E=h.ownerDocument.importNode(N,!0),E.nodeType===Re.element&&E.nodeName==="BODY"||E.nodeName==="HTML"?h=E:h.appendChild(E),In(E);else{if(!ot&&!ye&&!De&&N.indexOf("<")===-1)return G&&Ct?B(N):N;if(h=So(N),!h)return ot?null:Ct?F:""}h&&nt&&ht(h.firstChild);const ie=U?N:h;try{const Te=ko(ie);for(;x=Te.nextNode();)Mo(x,ie),xo(x),xt(x.content)&&fn(x.content)}catch(Te){throw U&&(sn(N),bt(t.removed,xe=>{xe.element&&ln(xe.element)})),Te}if(U)return bt(t.removed,Te=>{Te.element&&ln(Te.element)}),ye&&Rn(N),N;if(ot){if(ye&&Rn(h),kt)for(I=P.call(h.ownerDocument);h.firstChild;)I.appendChild(h.firstChild);else I=h;return(ue.shadowroot||ue.shadowrootmode)&&(I=oe.call(o,I,!0)),I}let le=De?h.outerHTML:h.innerHTML;return De&&ee["!doctype"]&&h.ownerDocument&&h.ownerDocument.doctype&&h.ownerDocument.doctype.name&&Ae(G0,h.ownerDocument.doctype.name)&&(le="<!DOCTYPE "+h.ownerDocument.doctype.name+`>
783
- `+le),ye&&(le=cn(le)),G&&Ct?B(le):le},t.setConfig=function(){let N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ln(N),ct=!0,Ye=ee,tt=ue},t.clearConfig=function(){Tt=null,ct=!1,Ye=null,tt=null,G=J,F=""},t.isValidAttribute=function(N,a,h){Tt||Ln({});const E=ce(N),x=ce(a);return No(E,x,h)},t.addHook=function(N,a){typeof a=="function"&&Be(q,N)&&qt(q[N],a)},t.removeHook=function(N,a){if(Be(q,N)){if(a!==void 0){const h=N0(q[N],a);return h===-1?void 0:T0(q[N],h,1)[0]}return Eu(q[N])}},t.removeHooks=function(N){Be(q,N)&&(q[N]=[])},t.removeAllHooks=function(){q=Ou()},t}var Q0=Lu();const ed=/^(?:[a-z]+:)?\/\//i;let td="";function nd(){return td}function no(e){const t=String(e||"").trim();if(!t)return"";if(ed.test(t)||t.startsWith("data:")||t.startsWith("blob:"))return t;const n=t.startsWith("/")?t:`/${t}`,o=nd();return o?`${o}${n}`:n}function od(){return kn(new Date)}function kn(e){if(e==null||e==="")return"";const t=e instanceof Date?e:new Date(e);return isNaN(t.getTime())?"":new Intl.DateTimeFormat("fr-CA",{timeZone:"Asia/Seoul"}).format(t)}const Zt=[],Jt=[],Qt=[],en=[],An={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},wn={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},ud={LISTEN_IN_NOISE:3,SHORT_STORY:2,LONG_STORY:1,ORDERING_SENTENCE:2};let oo=null,Ru=null,pt=null;function rd({counts:e,forceRefresh:t}={}){const n=Object.assign({},ud,e||{}),o=od(),u=kn(new Date(`${o}T00:00:00+09:00`).getTime()-864e5),r=JSON.stringify(n);if(!t&&Ru===o&&oo===r&&pt)return Object.assign(An,pt.today),Object.assign(wn,pt.yesterday?.selection||{LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]}),{today:An,yesterday:wn};const i={LISTEN_IN_NOISE:at(Zt,Math.max(0,Number(n.LISTEN_IN_NOISE)||0)),SHORT_STORY:at(Jt,Math.max(0,Number(n.SHORT_STORY)||0)),LONG_STORY:at(Qt,Math.max(0,Number(n.LONG_STORY)||0)),ORDERING_SENTENCE:at(en,Math.max(0,Number(n.ORDERING_SENTENCE)||0))};let s=null;return pt&&oo===r&&pt.yesterday&&pt.yesterday.date===u&&(s=pt.yesterday.selection),s||(s={LISTEN_IN_NOISE:at(Zt,Math.max(0,Number(n.LISTEN_IN_NOISE)||0)),SHORT_STORY:at(Jt,Math.max(0,Number(n.SHORT_STORY)||0)),LONG_STORY:at(Qt,Math.max(0,Number(n.LONG_STORY)||0)),ORDERING_SENTENCE:at(en,Math.max(0,Number(n.ORDERING_SENTENCE)||0))}),Object.assign(An,i),Object.assign(wn,s),Ru=o,oo=r,pt={today:i,yesterday:{date:u,countsKey:r,selection:s}},{today:An,yesterday:wn}}let Iu=!1,tn=null;async function ad(){try{const e={url:typeof document>"u"?require("url").pathToFileURL(__filename).href:Pn&&Pn.tagName.toUpperCase()==="SCRIPT"&&Pn.src||new URL("hooks.cjs.js",document.baseURI).href}&&void 0||"/",t=await fetch(`${e}data/allTrainingData.json`);return t.ok?await t.json():null}catch{return null}}async function id(){if(!Iu)return tn||(tn=(async()=>{const e=await ad();if(!e){tn=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}try{for(const t of Object.keys(e||{})){const n=e[t]||[];for(const o of n){const u=o,r=String(u.training_type||t),i=String(u.category_main_code||u.category_main||u.category_0||""),s=String(u.category_sub_code||u.category_sub||u.category_1||""),d=Object.assign({},u,{training_type:r,category_0:i,category_1:s});r==="LISTEN_IN_NOISE"?Zt.push(d):r==="SHORT_STORY"?Jt.push(d):r==="LONG_STORY"?Qt.push(d):r==="ORDERING_SENTENCE"&&en.push(d)}}}catch{tn=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}try{window.dispatchEvent(new Event("speechear.data.updated"))}catch{}try{rd()}catch{}Iu=!0})(),tn)}async function sd(e=3e3){const t=id();return Promise.race([t,new Promise(n=>setTimeout(n,e))])}const ld=[{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."}],cd={LISTEN_IN_NOISE:"listenInNoise",SHORT_STORY:"shortStory",LONG_STORY:"longStory",ORDERING_SENTENCE:"orderingSentence"};function dd(e){return ld.map(t=>{const n=cd[t.key];return n?{...t,label:e(`trainingType.${n}.title`),desc:e(`trainingType.${n}.desc`)}:t})}function hd(e){return typeof window>"u"?"":Q0.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},FORBID_TAGS:["script","use"],FORBID_ATTR:["xlink:href","href"]})}function fd(e){const[t,n]=l.useState(null),[o,u]=l.useState(null),[r,i]=l.useState(null),[s,d]=l.useState(null);return l.useEffect(()=>{if(!e||typeof e!="string"||!e.endsWith(".svg")){n(null),u(null),i(null);return}const p=e.split("/").pop();let f=e;p&&(e.startsWith("/")?f=no(e):/^(Logo|Symbol)/i.test(p)?f=no(`logo/${p}`):(/^https?:\/\//i.test(e)||e.startsWith("data:"),f=e)),n(f)},[e]),l.useEffect(()=>{if(!t)return;let p=!1;async function f(){try{let C=await fetch(t);C.ok||(C=await fetch(t));const c=C.headers.get("content-type")||"";if(p)return;if(c.includes("svg")){u("mask");return}if(c.startsWith("image/")){u("img");return}const m=await fetch(t);if(!m.ok)throw new Error("not ok");const S=await m.text();if(p)return;if(/^\s*<svg[\s>]/i.test(S)){const w=hd(S);if(!w){u("none");return}i(w),u("inline");return}u("none")}catch{p||u("none")}}return f(),()=>{p=!0}},[t]),l.useEffect(()=>{let p=!1,f=null;return o==="mask"&&t&&fetch(t).then(C=>{if(!C.ok)throw new Error("fetch failed");return C.blob()}).then(C=>{p||(f=URL.createObjectURL(C),d(f))}).catch(()=>{p||u("img")}),()=>{p=!0,f&&URL.revokeObjectURL(f),d(null)}},[o,t]),{iconToUse:t,mode:o,svgText:r,blobUrl:s}}function pd(e){const{icon:t,label:n,className:o,imgClassName:u,maskClassName:r,svgClassName:i,wrapperStyle:s,size:d}=e||{},p=o??"iconRenderer-icon",f=u??"iconRenderer-icon-image",C=r??"iconRenderer-icon-mask",c=i??"iconRenderer-icon-svg",m=typeof t=="string"?t:null,S=g0(m),{iconToUse:w,mode:_,svgText:g,blobUrl:b}=fd(m),k=(j,H={})=>V.jsx("span",{className:p,style:s,...H,children:j}),D=(j,H={})=>V.jsx("img",{src:j,alt:typeof n=="string"?n:n?String(n):"",className:f,...H});if(!t)return null;if(typeof t!="string")return k(t);if(t==="none")return k(V.jsx("span",{className:c,dangerouslySetInnerHTML:{__html:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true"></svg>'}}),{"aria-hidden":"true"});if(S)try{return k(l.createElement(S,{className:c,size:typeof d=="number"?d:20}),{"aria-hidden":"true"})}catch{}if(w&&w.endsWith(".svg")){if(_==="mask"){const j={"--icon-url":b?`url(${b})`:`url(${w})`};return k(V.jsx("span",{className:C,style:j}),{"aria-hidden":"true"})}return _==="img"?k(D(w,{onError:j=>{j.currentTarget.onerror=null,j.currentTarget.style.display="none"}}),{"aria-hidden":"true"}):_==="inline"?k(V.jsx("span",{className:c,dangerouslySetInnerHTML:g?{__html:g}:void 0}),{"aria-hidden":"true"}):k(null,{"aria-hidden":"true"})}if(t.startsWith("/")||t.includes("/assets/")||t.match(/\.(png|jpg|jpeg|webp|gif)$/i))return D(no(t),{style:s,onError:j=>{j.currentTarget.onerror=null,j.currentTarget.style.display="none"}});const R=typeof d=="number"?d:20,v=`<svg width="${R}" height="${R}" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><rect x="3" y="3" width="18" height="18" rx="2" ry="2" style="fill:none;stroke:currentColor;stroke-width:2"/></svg>`;return k(V.jsx("span",{className:c,dangerouslySetInnerHTML:{__html:v}}),{"aria-hidden":"true"})}function ju(e){const{anchorRect:t,anchorEl:n,offset:o=20,edgeMargin:u=20,onClose:r,closeOnOutsideClick:i=!0,className:s="",role:d="dialog",ariaLabel:p="",children:f,backdrop:C=!1,isMobilePopup:c=!1,useBorder:m=!0,header:S}=e||{},w=l.useRef(null),[_,g]=l.useState({position:"fixed",left:0,top:-9999}),[b,k]=l.useState(!1),[D,R]=l.useState("bottom"),[v,j]=l.useState(!1),[H,G]=l.useState(!1),F=!t&&!n,J=l.useCallback((B=!1)=>{if(H&&c)return;const O=n?n.getBoundingClientRect():t;if(!O||!w.current)return;const Ce=w.current,{offsetWidth:X,offsetHeight:Q}=Ce,M=window.innerWidth,P=window.innerHeight,ne=M-O.right,oe=O.left,q=O.top,be=P-O.bottom;let T=0,he=0,fe="top";if(q>=Q+o)fe="top",he=O.top-o-Q,T=O.left+O.width/2-X/2;else if(be>=Q+o)fe="bottom",he=O.bottom+o,T=O.left+O.width/2-X/2;else if(ne>=X+o)fe="right",T=O.right+o,he=O.top+O.height/2-Q/2;else if(oe>=X+o)fe="left",T=O.left-o-X,he=O.top+O.height/2-Q/2;else{const Qe=Math.max(q,be,ne,oe);Qe===q?(fe="top",he=O.top-o-Q,T=O.left+O.width/2-X/2):Qe===be?(fe="bottom",he=O.bottom+o,T=O.left+O.width/2-X/2):Qe===ne?(fe="right",T=O.right+o,he=O.top+O.height/2-Q/2):(fe="left",T=O.left-o-X,he=O.top+O.height/2-Q/2)}const Ie=Number(u)||8;T=Math.min(Math.max(T,Ie),M-X-Ie),he=Math.min(Math.max(he,Ie),P-Q-Ie);const lt=Math.round(T),Ue=Math.round(he);B&&w.current?(w.current.style.left=`${lt}px`,w.current.style.top=`${Ue}px`,w.current.dataset.placement=fe):(R(fe||D),g({position:"fixed",left:lt,top:Ue}),j(!0))},[H,c,n,t,o,u,D]);l.useLayoutEffect(()=>{if(F)return;if(H&&c){g({position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"calc(100% - 40px)",maxWidth:"calc(100% - 40px)"}),j(!0);return}J();const B=requestAnimationFrame(()=>J());return()=>cancelAnimationFrame(B)},[t,n,o,f,u,F,H,c,J]),l.useEffect(()=>{if(F||H&&c||!w.current||typeof ResizeObserver>"u")return;const B=new ResizeObserver(()=>{t&&J()});return B.observe(w.current),()=>B.disconnect()},[t,f,u,F,H,c,J]),l.useEffect(()=>{if(F||H&&c)return;const B=()=>J(!0);return window.addEventListener("resize",B),document.addEventListener("scroll",B,{passive:!0,capture:!0}),()=>{window.removeEventListener("resize",B),document.removeEventListener("scroll",B,{capture:!0})}},[t,o,f,u,F,H,c,J]),l.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const B=window.matchMedia("(max-width: 768px)"),O=()=>G(!!B.matches);O();try{B.addEventListener?B.addEventListener("change",O):B.addListener(O)}catch{try{B.addListener(O)}catch{}}return()=>{try{B.removeEventListener?B.removeEventListener("change",O):B.removeListener(O)}catch{}}},[]);const Y=l.useRef(!1),W=l.useCallback((B=!1)=>{if(!(b||Y.current)){if(Y.current=!0,B){k(!0);try{r&&r()}catch{}return}k(!0),setTimeout(()=>{r&&r()},200)}},[b,r,k]);l.useEffect(()=>{const B=X=>{const Q=w.current;if(!Q)return;const M=X.target;if(M&&!Q.contains(M)){try{if(M.closest&&M.closest("[data-tooltip-ignore]"))return}catch{}i&&W(!0)}},O=X=>{const Q=w.current;if(!Q)return;const M=X.target;if(M&&!Q.contains(M)){try{if(M.closest&&M.closest("[data-tooltip-ignore]"))return}catch{}i&&W(!0)}},Ce=X=>{if(X.key==="Escape"){X.stopPropagation(),W();return}if(X.key==="Tab"){const Q=w.current;if(!Q)return;const M=Q.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(!M||M.length===0)return;const P=M[0],ne=M[M.length-1],oe=document.activeElement;X.shiftKey?oe===P&&(X.preventDefault(),ne.focus()):oe===ne&&(X.preventDefault(),P.focus())}};return document.addEventListener("pointerdown",B,!0),document.addEventListener("click",O,!0),document.addEventListener("keydown",Ce),()=>{document.removeEventListener("pointerdown",B,!0),document.removeEventListener("click",O,!0),document.removeEventListener("keydown",Ce)}},[r,i,W]),l.useEffect(()=>{const B=()=>{W(!0)};return typeof document<"u"&&document.addEventListener("speechear-close-tooltips",B),()=>{typeof document<"u"&&document.removeEventListener("speechear-close-tooltips",B)}},[W]);const z=V.jsxs("div",{ref:w,className:`tooltip-content ${m?"tooltip-content--bordered":""} ${b?"is-closing":""} ${s} ${H&&c?"is-mobile":""}`,role:d,"aria-label":p||void 0,style:F?{}:{..._,visibility:v?"visible":"hidden"},tabIndex:-1,"data-placement":D,"data-left":F?"":_.left,"data-top":F?"":_.top,"data-anchor-left":t?Math.round(t.left):"","data-anchor-top":t?Math.round(t.top):"","data-anchor-width":t?Math.round(t.width):"","data-anchor-height":t?Math.round(t.height):"",children:[S!=null&&V.jsx("div",{className:"tooltip-content__header h5",children:S}),f]});if(F||typeof document>"u")return z;if(C||H&&c){const B=V.jsxs("div",{className:"tooltip-portal",children:[V.jsx("div",{className:"tooltip-backdrop",onClick:()=>{i&&W(!0)}}),z]});return Bo.createPortal(B,document.body)}return Bo.createPortal(z,document.body)}function Cd(e){const{anchorRect:t,text:n,offset:o=8,onClose:u,className:r="",ariaLabel:i}=e||{};return n?V.jsx(ju,{anchorRect:t,offset:o,onClose:u,closeOnOutsideClick:!1,className:`tooltip-info ${r}`,ariaLabel:i||n,children:V.jsx("div",{className:"tooltip-info__content body-3",children:n})}):null}function Pu(e){const{anchorRect:t,title:n,items:o,activeIndex:u=-1,showIndex:r=!0,onClose:i,offset:s=12}=e||{},d=Array.isArray(o)?o:o?[o]:[];return!d.length&&!n?null:V.jsx(ju,{anchorRect:t,offset:s,onClose:i,closeOnOutsideClick:!0,useBorder:!1,className:"tooltip-description",children:V.jsxs("div",{className:"tooltip-description__box",children:[n&&V.jsx("span",{className:"tooltip-description__title body-2",children:n}),V.jsx("ol",{className:"tooltip-description__items",children:d.map((p,f)=>V.jsxs("li",{className:`tooltip-description__item body-3${f===u?" tooltip-description__item--active":""}`,children:[r&&d.length>1&&V.jsxs("span",{className:"tooltip-description__index button-1",children:[f+1,"."]}),V.jsx("span",{children:p})]},f))})]})})}function yd(e){const{size:t=48,type:n,htmlType:o,href:u,target:r,rel:i,icon:s,rightIcon:d,label:p,count:f,subLabel:C,children:c,ariaLabel:m,variant:S="default",align:w="center",selected:_,toggleable:g=!1,disabled:b=!1,useLabel:k=!0,useBorder:D=!0,useBG:R=!0,useDisabledCovered:v=!1,useDisabledInvisible:j=!1,width:H,minWidth:G,onClick:F,onDisabledClick:J,showTooltipInfo:Y=!1,tooltipInfoText:W=null,tooltipDescription:z=null,iconSize:B="medium",iconColor:O,shape:Ce="rounded",color:X,className:Q,...M}=e,P=typeof t=="string"&&isNaN(Number(t))?t.toLowerCase():String(Number(t)||48),ne=P.match(/^\d+$/)?`button${P}`:`button-${P}`,oe=Number(t),q=!isNaN(oe)&&oe<40?"button-2":"button-1",be=p??c,T=b||!!M.disabled,he=T?v?"disabled-covered":j?"disabled-invisibled":"disabled":S,fe=he?`button--variant-${he}`:"",Ie=w?`button--align-${w}`:"",lt=Ce?`button--shape-${Ce}`:"",Ue=typeof O=="string"&&O.startsWith("--")?`var(${O})`:O,Qe={...H?{width:typeof H=="number"?`${H}px`:H}:{},...G?{minWidth:typeof G=="number"?`${G}px`:G}:{},...D?{}:{"--button-border":T?"0":"1px solid transparent"},...Ue?{"--button-icon-color":Ue}:{},...X?{"--color-main":X}:{}},$e=k===!1?"":be,ee=Array.isArray($e)?$e.length>0:!!$e,et=!!d,ue=n??(ee||s||et?"bar":"dot"),A=`${ne}--${ue}`,L=l.useRef(null),$=l.useRef(T),[K,te]=l.useState(!!_),[Ne,we]=l.useState(!1),[Ge,Fe]=l.useState(null),ye=l.useCallback(()=>we(!1),[]);l.useEffect(()=>{(Y||z)&&T&&Ne&&(we(!1),Fe(null))},[T,Y,z,Ne]),l.useEffect(()=>{typeof _=="boolean"&&te(_)},[_]),l.useEffect(()=>{if($.current&&!T&&L.current){const re=L.current;re.blur(),re.style.pointerEvents="none";const We=requestAnimationFrame(()=>{requestAnimationFrame(()=>{L.current&&(L.current.style.pointerEvents="")})});return()=>cancelAnimationFrame(We)}$.current=T},[T]);const je=typeof _=="boolean"?!!_:K,De=g||typeof _=="boolean"?je?"true":"false":void 0,ct=Ra("button",ne,A,fe,Ie,lt,je?"is-selected":null,R?null:"button--no-bg",Q),Ye=`button__icon button__icon--${B}`,tt=Array.isArray(C)?C:C!==void 0?[C]:[],nt=()=>{if(Array.isArray($e))return $e.map((We,It)=>{const Mt=tt[It];return V.jsxs("span",{className:`button__label-text${Mt!==void 0?" button__label-text--has-sub":""}`,children:[We,Mt!==void 0&&V.jsx("span",{className:"button__sub-label-text caption-1",children:Mt})]},It)});const re=C!==void 0;return V.jsxs("span",{className:`button__label-text${re?" button__label-text--has-sub":""}`,children:[$e,f!=null&&V.jsx("span",{className:"button__count",children:f}),re&&V.jsx("span",{className:"button__sub-label-text caption-1",children:C})]})},ot=re=>{T||(typeof M.onMouseLeave=="function"&&M.onMouseLeave(re),typeof _!="boolean"&&te(!1),re.currentTarget.blur())},kt=re=>{if(T){J?.(re);return}typeof _!="boolean"&&g&&te(We=>!We),F?.(re)},Ct=l.useCallback(()=>{!T&&(Y||z)&&(we(!0),Fe(L.current?.getBoundingClientRect()??null))},[T,Y,z]),Rt=l.useCallback(()=>{(Y||z)&&(we(!1),Fe(null))},[Y,z]),me={...M};delete me.disabled,delete me.className,delete me.faded,delete me.useFaded,delete me.loading,delete me.onMouseLeave,delete me.onPointerEnter,delete me.onPointerLeave,delete me.onFocus,delete me.onBlur,T&&(Object.keys(me).forEach(re=>{/^on[A-Z]/.test(re)&&typeof me[re]=="function"&&delete me[re]}),me["aria-disabled"]="true");const At=(typeof Y=="string"?Y:null)??(typeof W=="string"?W:null)??(typeof m=="string"?m:null)??(typeof be=="string"?be:null)??void 0,wt=typeof m=="string"?m:typeof be=="string"?be:At,ut=(re,We)=>V.jsx(pd,{icon:re,label:We??wt,className:Ye,imgClassName:"button__icon-img",maskClassName:"button__icon-mask",svgClassName:"button__icon-svg"}),dt=()=>ue==="dot"?V.jsxs(V.Fragment,{children:[ut(s),ee&&V.jsx("span",{className:`button__label ${q}`,children:nt()})]}):w==="center"&&s?V.jsxs(V.Fragment,{children:[V.jsxs("span",{className:"button__center-group",children:[V.jsx("span",{className:"button__left",children:ut(s)}),ee&&V.jsx("span",{className:`button__label ${q}`,children:nt()})]}),et&&V.jsx("span",{className:"button__right",children:ut(d)})]}):V.jsxs(V.Fragment,{children:[s&&V.jsx("span",{className:"button__left",children:ut(s,m??be)}),ee&&V.jsx("span",{className:`button__label ${q}`,children:nt()}),et&&V.jsx("span",{className:"button__right",children:ut(d)})]}),qe=!!u&&!T;return V.jsxs(V.Fragment,{children:[V.jsx(qe?"a":"button",{...me,ref:L,...qe?{href:u,target:r,rel:i??(r==="_blank"?"noreferrer":void 0)}:{type:o,disabled:T&&!J},className:ct,"aria-pressed":De,"aria-label":wt,"aria-disabled":qe&&T?!0:void 0,style:Qe,onClick:kt,onMouseLeave:ot,onPointerEnter:re=>{Ct(),!T&&typeof M.onPointerEnter=="function"&&M.onPointerEnter(re)},onPointerLeave:re=>{Rt(),!T&&typeof M.onPointerLeave=="function"&&M.onPointerLeave(re)},onFocus:re=>{Ct(),!T&&typeof M.onFocus=="function"&&M.onFocus(re)},onBlur:re=>{ot(re),Rt(),!T&&typeof M.onBlur=="function"&&M.onBlur(re)},children:dt()}),Ne&&z?V.jsx(Pu,{anchorRect:Ge,title:z.title,items:z.items,onClose:ye}):Ne&&At?V.jsx(Cd,{anchorRect:Ge,text:At,onClose:ye}):null]})}function $u(){const[e,t]=l.useState(null),n=l.useCallback(r=>t(r.getBoundingClientRect()),[]),o=l.useCallback(()=>t(null),[]),u=l.useCallback(r=>{const i=r.getBoundingClientRect();t(s=>s?null:i)},[]);return{anchorRect:e,isOpen:e!=null,openAt:n,close:o,toggleAt:u}}function md(e){const[t,n]=l.useState(null),[o,u]=l.useState(null),r=l.useRef(null);l.useEffect(()=>()=>{r.current&&clearTimeout(r.current)},[]);const i=l.useCallback((d,p)=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{n(d),u(p)},e)},[e]),s=l.useCallback(()=>{r.current&&clearTimeout(r.current),n(null),u(null)},[]);return{payload:t,anchorRect:o,openAfterDelay:i,close:s}}function gd({title:e,items:t}){const{t:n}=mt.useTranslation(),{anchorRect:o,openAt:u,close:r}=$u();return V.jsxs(V.Fragment,{children:[V.jsx(yd,{size:24,type:"dot",icon:"info",variant:"transparent-gray",useBorder:!1,selected:!!o,ariaLabel:n("common.info","\uC124\uBA85"),onPointerEnter:i=>u(i.currentTarget),onPointerLeave:r,onFocus:i=>u(i.currentTarget),onBlur:r}),o&&V.jsx(Pu,{title:e,items:t,showIndex:t.length>1,anchorRect:o,onClose:r})]})}function Fu(){const{t:e}=mt.useTranslation();return l.useMemo(()=>({difficulty:e("wordSearch.filter.difficulty","\uB4F1\uAE09"),syllables:e("wordSearch.filter.syllables","\uC74C\uC808 \uC218"),syllable5plus:e("wordSearch.filter.syllable5plus","5\uC74C\uC808 \uC774\uC0C1"),partOfSpeech:e("wordSearch.filter.partOfSpeech","\uD488\uC0AC"),wordType:e("wordSearch.filter.wordType","\uC720\uD615"),posMap:{[e("wordSearch.filter.pos.noun","\uCCB4\uC5B8(\uBA85\uC0AC, \uC218\uC0AC)")]:["\uBA85","\uC218"],[e("wordSearch.filter.pos.verb","\uC6A9\uC5B8(\uB3D9\uC0AC, \uD615\uC6A9\uC0AC)")]:["\uB3D9","\uD615"],[e("wordSearch.filter.pos.modifier","\uC218\uC2DD\uC5B8(\uBD80\uC0AC, \uAD00\uD615\uC0AC)")]:["\uBD80","\uAD00"]},typeMap:{[e("wordSearch.filter.type.native","\uACE0\uC720\uC5B4")]:"\uACE0\uC720",[e("wordSearch.filter.type.sino","\uD55C\uC790\uC5B4")]:"\uD55C\uC790",[e("wordSearch.filter.type.foreign","\uC678\uB798\uC5B4")]:"\uC678\uB798",[e("wordSearch.filter.type.mixed","\uD63C\uC885\uC5B4")]:"\uD63C\uC885"}}),[e])}function Hu(e,t,n){return{label:t.difficulty,items:[1,2,3,4].map(o=>e("wordSearch.filter.grade",{n:o})),multiple:!0,allOption:!0,allLabel:n?.allLabel,labelAction:n?.labelAction}}function zu(e){return{label:e.partOfSpeech,items:Object.keys(e.posMap),multiple:!0,allOption:!0}}function Vu(e){return{label:e.wordType,items:Object.keys(e.typeMap),multiple:!0,allOption:!0}}function _d(e,t){return{label:t.syllables,items:[e("wordSearch.filter.syllable",{n:1}),e("wordSearch.filter.syllable",{n:2}),e("wordSearch.filter.syllable",{n:3}),e("wordSearch.filter.syllable",{n:4}),t.syllable5plus],multiple:!0,allOption:!0}}function Ed(e,t){const n=[e("wordPairs.filter.onlyHasImage","\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC")];return t?.includeStructure&&n.push(e("wordPairs.filter.onlySameStructure","\uC74C\uC18C \uAD6C\uC870 \uAC19\uC740 \uB2E8\uC5B4\uB9CC")),{label:e("wordPairs.filter.selectLabel","\uC120\uD0DD"),items:n,multiple:!0,labelAction:t?.labelAction}}function bd(e,t){const{label:n,headValue:o,midValue:u,tailValue:r,includeMid:i=!0,headDisabled:s,midDisabled:d,tailDisabled:p,allOptionDisabled:f,groupLabel:C,labelAction:c}=t;return{label:n,...C?{groupLabel:C}:{},...c?{labelAction:c}:{},allOption:!0,allLabel:e("wordSearch.filter.positionAny",{defaultValue:"\uBB34\uAD00"}),...f?{allOptionDisabled:f}:{},items:[{value:o,displayLabel:e("wordSearch.filter.positionHead",{defaultValue:"\uC5B4\uB450"}),disabled:s},...i?[{value:u,displayLabel:e("wordSearch.filter.positionMid",{defaultValue:"\uC5B4\uC911"}),disabled:d}]:[],{value:r,displayLabel:e("wordSearch.filter.positionTail",{defaultValue:"\uC5B4\uB9D0"}),disabled:p}]}}function Sd(e,t,n){if(t===Et){const{[n]:r,...i}=e;return i}const o=e[n]??[],u=o.includes(t)?o.filter(r=>r!==t):[...o,t];if(u.length===0){const{[n]:r,...i}=e;return i}return{...e,[n]:u}}Object.fromEntries(Object.entries(Zr).map(([e,{nucleus:t}])=>[e,t]));const kd={\uACE0\uC720\uC5B4:"\uACE0\uC720",\uD55C\uC790\uC5B4:"\uD55C\uC790",\uC678\uB798\uC5B4:"\uC678\uB798",\uD63C\uC885\uC5B4:"\uD63C\uC885"},Ad={"\uCCB4\uC5B8(\uBA85\uC0AC,\uC218\uC0AC)":["\uBA85","\uC218"],"\uC6A9\uC5B8(\uB3D9\uC0AC,\uD615\uC6A9\uC0AC)":["\uB3D9","\uD615"],"\uC218\uC2DD\uC5B8(\uBD80\uC0AC,\uAD00\uD615\uC0AC)":["\uBD80","\uAD00"]},wd={difficulty:"\uB09C\uC774\uB3C4 \uB4F1\uAE09",syllables:"\uC74C\uC808 \uC218",syllable5plus:"5\uC74C\uC808 \uC774\uC0C1",partOfSpeech:"\uD488\uC0AC",wordType:"\uC720\uD615",posMap:Ad,typeMap:kd};function Md(e,t,n=wd){const o=t[n.difficulty];if(o?.length&&!o.some(s=>e.grade===s.replace(/\D/g,"")))return!1;const u=t[n.syllables];if(u?.length){const s=e.syllables??0;if(!u.some(d=>d===n.syllable5plus?s>=5:s===parseInt(d)))return!1}const r=t[n.partOfSpeech];if(r?.length&&!r.flatMap(s=>n.posMap[s]??[s]).some(s=>(e.pos??"").includes(s)))return!1;const i=t[n.wordType];return!(i?.length&&!i.some(s=>e.wordType===n.typeMap[s]))}const it=(e,t)=>t.map(n=>({jamos:[n],tooltip:e})),Ee=(e,t)=>({jamos:[...e],tooltip:t}),uo={cho:[it("\uC591\uC21C\uC74C",["\u3142","\u3143","\u314D","\u3141"]),it("\uCE58\uC870\uC74C",["\u3137","\u3138","\u314C","\u3134","\u3139"]),it("\uCE58\uC870\uC74C",["\u3145","\u3146"]),it("\uACBD\uAD6C\uAC1C\uC74C",["\u3148","\u3149","\u314A"]),it("\uC5F0\uAD6C\uAC1C\uC74C",["\u3131","\u3132","\u314B"]),it("\uC131\uBB38\uC74C",["\u314E"])],jung:[[Ee("\u3163","\uC804\uC124 \uACE0\uBAA8\uC74C"),Ee("\u315F","\uC804\uC124 \uACE0\uBAA8\uC74C \xB7 w\uD65C\uC74C"),Ee("\u3162","\uC804\uC124 \uACE0\uBAA8\uC74C \xB7 \u0270\uD65C\uC74C")],[Ee("\u3161","\uD6C4\uC124 \uACE0\uBAA8\uC74C \uD3C9\uC21C")],[Ee("\u315C","\uD6C4\uC124 \uACE0\uBAA8\uC74C \uC6D0\uC21C"),Ee("\u3160","\uD6C4\uC124 \uACE0\uBAA8\uC74C \uC6D0\uC21C \xB7 j\uD65C\uC74C")],[Ee("\u3154\u3150","\uC804\uC124 \uC911\uBAA8\uC74C"),Ee("\u3156\u3152","\uC804\uC124 \uC911\uBAA8\uC74C \xB7 j\uD65C\uC74C"),Ee("\u3159\u315A\u315E","\uC804\uC124 \uC911\uBAA8\uC74C \xB7 w\uD65C\uC74C")],[Ee("\u3153","\uD6C4\uC124 \uC911\uBAA8\uC74C \uD3C9\uC21C"),Ee("\u3155","\uD6C4\uC124 \uC911\uBAA8\uC74C \uD3C9\uC21C \xB7 j\uD65C\uC74C"),Ee("\u315D","\uD6C4\uC124 \uC911\uBAA8\uC74C \uD3C9\uC21C \xB7 w\uD65C\uC74C")],[Ee("\u3157","\uD6C4\uC124 \uC911\uBAA8\uC74C \uC6D0\uC21C"),Ee("\u315B","\uD6C4\uC124 \uC911\uBAA8\uC74C \uC6D0\uC21C \xB7 j\uD65C\uC74C")],[Ee("\u314F","\uC800\uBAA8\uC74C"),Ee("\u3151","\uC800\uBAA8\uC74C \xB7 j\uD65C\uC74C"),Ee("\u3158","\uC800\uBAA8\uC74C \xB7 w\uD65C\uC74C")]],jong:[it("\uC591\uC21C\uC74C",["\u3142","\u3141"]),it("\uCE58\uC870\uC74C",["\u3137","\u3134","\u3139"]),it("\uC5F0\uAD6C\uAC1C\uC74C",["\u3131","\u3147"])]},Nd=[...Se],Td=[...rt],xd=Pe.filter(e=>e!==""),st=e=>e===Ze?[]:Array.from(e),Ze="__NO_CODA__",Uu=[1,2,3,4],Je=5,Bd=12,Gu="SYL_",ro=e=>`${Gu}${e}`,Dd=e=>Number(e.slice(Gu.length));function ao(e){return e>=Je?Array.from({length:Bd-Je+1},(t,n)=>Je+n):[e]}const Yu={cho:Nd,jung:Td,jong:xd},io=e=>e.map(t=>t.map(({jamos:n,tooltip:o})=>({v:n.join(""),tooltip:o}))),so={cho:io(uo.cho),jung:io(uo.jung),jong:io(uo.jong)},qu={};so.jung.flat().forEach(({v:e})=>{for(const t of st(e))qu[t]=e});const vd=new Set(so.cho.flat().map(e=>e.v));function Wu(e,t){return e==="cho"?vd.has(t)?t:null:e==="jung"?qu[t]??t:qo(t)}function Ku(e,t,n){if(e==="jung"){const o=st(t);return n&&o.includes(n)?n:o[0]??t}return t}function Xu(e,t,n){const o=(u,r)=>r?u==="jong"&&r===Ze?Ze:t==="pron"?Wu(u,r):Ku(u,r,u==="jung"?n:null):null;return{...e,cho:o("cho",e.cho),jung:o("jung",e.jung),jong:o("jong",e.jong)}}const lo={cho:null,jung:null,jong:null,syllable:null},Od="wt_filter",Zu=e=>`wt_filter_${e}`;function Ld(e){try{const t=localStorage.getItem(Zu(e))??localStorage.getItem(Od);if(t)return JSON.parse(t)}catch{}return null}function Rd(e){const t=e;return t?.composition?{cho:t.composition.cho??null,jung:t.composition.jung??null,jong:t.composition.jong??null,syllable:t.composition.syllable??null}:t?.choseong?{...lo,cho:t.choseong}:lo}function Id(e,t,n){const{t:o,i18n:u}=mt.useTranslation(),[r]=l.useState(()=>n?.resetOnMount?null:Ld(e)),i=r?.contrastCount,s=typeof i=="number"&&Number.isFinite(i)?i:1,[d,p]=l.useState(Math.min(5,Math.max(1,s))),[f,C]=l.useState(r?.phonemeView==="pron"?"pron":r?.phonemeView==="direct"?"direct":"char"),[c,m]=l.useState(()=>Rd(r)),S=l.useCallback(()=>t.requireSyllable?{cho:"\u3131",jung:"\u314F",jong:Ze,syllable:t.fixedSyllable??null}:{cho:null,jung:null,jong:t.fixedNoCoda?Ze:null,syllable:t.fixedSyllable??null},[t.requireSyllable,t.fixedSyllable,t.fixedNoCoda]);l.useEffect(()=>{!t.requireSyllable&&t.fixedSyllable==null&&!t.fixedNoCoda||m(A=>A.cho||A.jung||A.syllable!=null||A.jong?A:S())},[]);const w=l.useMemo(()=>_e(c.cho)||_e(c.jung)||_e(c.jong)?"count":"random",[c.cho,c.jung,c.jong]),_=l.useRef(f==="char"?c.jung:null);l.useEffect(()=>{f==="char"&&(_.current=c.jung)},[f,c.jung]);const[g,b]=l.useState(n?.resetOnMount?!!n?.defaultImageOnly:r?.excludeNoImage??!0),[k,D]=l.useState(n?.resetOnMount?!1:r?.sameStructureOnly??!0),[R,v]=l.useState(Array.isArray(r?.gradeFilter)?r.gradeFilter:[]),[j,H]=l.useState(Array.isArray(r?.posFilter)?r.posFilter:[]),[G,F]=l.useState(Array.isArray(r?.wordTypeFilter)?r.wordTypeFilter:[]),J=l.useRef(n?.resetKey);l.useEffect(()=>{J.current!==n?.resetKey&&(J.current=n?.resetKey,m(S()),b(!1),D(!1),v([]),H([]),F([]),p(1))},[n?.resetKey]);const Y=Fu(),[W,z]=l.useState({cho:new Set,jung:new Set,jong:new Set,syllable:new Set}),[B,O]=l.useState(!1),[Ce,X]=l.useState(null),Q=1,M=Math.max(1,[c.cho,c.jung,c.jong].filter(Boolean).length);l.useEffect(()=>{d<M&&p(M)},[M,d]),l.useEffect(()=>{if(!n?.resetOnMount)try{localStorage.setItem(Zu(e),JSON.stringify({contrastCount:d,composition:c,excludeNoImage:g,sameStructureOnly:k,phonemeView:f,gradeFilter:R,posFilter:j,wordTypeFilter:G}))}catch{}},[n?.resetOnMount,e,d,c,g,k,f,R,j,G]);const[P,ne]=l.useState(0);Oo("wordpool:update",()=>ne(A=>A+1));const oe=l.useRef(u.language);l.useEffect(()=>{oe.current!==u.language&&(oe.current=u.language,ne(A=>A+1))},[u.language]),l.useEffect(()=>{if(!t.choseong)return;let A=!1;return La({difficulty:w,excludeNoImage:g}).then(L=>{A||(z(L),L.cho.size+L.jung.size+L.jong.size>0&&O(!0))}).catch(()=>{A||z({cho:new Set,jung:new Set,jong:new Set,syllable:new Set})}),()=>{A=!0}},[t.choseong,w,g,P]),l.useEffect(()=>{let A=!1;const L=c,$=L.cho?st(L.cho):null,K=L.jung?st(L.jung):null,te=L.jong===Ze,Ne=te?null:L.jong?st(L.jong):null,we=L.syllable!=null?ao(L.syllable):null,Ge=!!($||K||Ne||te||we);return Oa({difficulty:t.difficulty?w:null,contrastCount:t.difficulty?d:1,composition:t.choseong&&Ge?{cho:$,jung:K,jong:Ne,jongNone:te,syllable:we}:null,excludeNoImage:g,sameStructureOnly:k,phonemeView:f==="pron"?"pron":"char",grade:R.length>0?R:null}).then(Fe=>{A||X(Fe)}).catch(()=>{A||X(null)}),()=>{A=!0}},[t.choseong,t.difficulty,w,d,c,f,g,k,P,R]),l.useEffect(()=>{B&&m(A=>{const L={...A};let $=!1;return["cho","jung","jong"].forEach(K=>{const te=A[K];!te||te===Ze||st(te).some(Ne=>W[K].has(Ne))||(L[K]=null,$=!0)}),A.syllable!=null&&t.fixedSyllable==null&&(A.syllable>=Je?[...W.syllable].some(K=>K>=Je)||(L.syllable=null,$=!0):(!W.syllable.has(A.syllable)||A.syllable<Q)&&(L.syllable=null,$=!0)),$?L:A})},[W,B,Q,t.fixedSyllable]);const q=l.useMemo(()=>{const A=L=>{const $=new Set;for(const K of Yu[L])W[L].has(K)&&$.add(K);return $};return{cho:A("cho"),jung:A("jung"),jong:A("jong")}},[W]),be=l.useMemo(()=>({exact:new Set(Uu.filter(A=>W.syllable.has(A))),min:[...W.syllable].some(A=>A>=Je)}),[W]),T=l.useMemo(()=>({diffPhonemeCount:o("training.contrast.diffPhonemeCount",{defaultValue:"\uB2E4\uB978 \uC74C\uC18C\uC758 \uCD1D \uAC2F\uC218"}),composition:o("wordPairs.composition","\uC815\uB2F5 \uB2E8\uC5B4 \uAD6C\uC131"),syllableCount:o("wordPairs.syllableCount","\uC74C\uC808 \uC218"),onset:o("wordPairs.onset","\uCD08\uC131"),vowel:o("wordPairs.vowel","\uBAA8\uC74C"),coda:o("wordPairs.coda","\uC885\uC131"),phonemeGroup:o("training.filter.phonemeGroup",{defaultValue:"\uD6C8\uB828 \uC74C\uC808"}),trainOnset:o("training.filter.trainOnset",{defaultValue:"\uCD08\uC131"}),trainVowel:o("training.filter.trainVowel",{defaultValue:"\uBAA8\uC74C"}),trainCoda:o("training.filter.trainCoda",{defaultValue:"\uC885\uC131"}),random:o("training.filter.random","\uBB34\uC791\uC704"),exclude:o("wordSearch.filter.exclude","\uC81C\uC678"),selectLabel:o("training.filter.selectSection",{defaultValue:"\uC120\uD0DD"}),none:o("common.none","\uC5C6\uC74C"),noImage:o("wordSearch.filter.excludeNoImage","\uC774\uBBF8\uC9C0 \uC5C6\uC74C"),excludeImage:o("training.filter.excludeImage",{defaultValue:"\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC"}),sameStructure:o("training.filter.sameStructure",{defaultValue:"\uC74C\uC18C \uAD6C\uC870 \uAC19\uC740 \uB2E8\uC5B4\uB9CC"}),noLimit:o("training.filter.noLimit",{defaultValue:"\uBB34\uAD00"}),codaExclude:o("training.filter.codaExclude",{defaultValue:"\uC81C\uC678"}),gradeLabel:o("training.filter.gradeLabel",{defaultValue:"\uB09C\uC774\uB3C4 \uB4F1\uAE09"})}),[o]),he=l.useMemo(()=>({[T.trainOnset]:"cho",[T.trainVowel]:"jung",[T.trainCoda]:"jong"}),[T]),fe=l.useCallback((A,L)=>l.createElement(gd,{title:L,items:A}),[]),Ie=l.useMemo(()=>[o("training.filter.excludeImageInfo",{defaultValue:"\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC: \uB2E8\uC5B4 \uC911\uC5D0 \uC774\uBBF8\uC9C0\uAC00 \uC788\uB294 \uB2E8\uC5B4\uB9CC \uACB0\uACFC\uC5D0 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4."}),o("training.filter.sameStructureInfo",{defaultValue:"\uC74C\uC18C \uAD6C\uC870 \uAC19\uC740 \uB2E8\uC5B4\uB9CC: \uC815\uB2F5\uACFC \uC624\uB2F5\uC758 \uC74C\uC808 \uAD6C\uC870(\uAE00\uC790 \uC218\xB7\uBC1B\uCE68 \uC720\uBB34 \uB4F1)\uAC00 \uAC19\uC740 \uACB0\uACFC\uB9CC \uB0A8\uACA8\uC694."})],[o]),lt=l.useMemo(()=>{const A=[];if(t.choseong){const L={value:Ze,displayLabel:T.codaExclude},$=t.fixedNoCoda===!0,K=(te,Ne)=>{const we=$&&te==="jong",Ge={label:Ne,groupLabel:T.phonemeGroup,allOption:!t.requireSyllable,allLabel:T.noLimit,allOptionDisabled:we};if(f==="pron"){const ye=so[te].map(je=>je.map(({v:De,tooltip:ct})=>{const Ye=st(De),tt=we||!Ye.some(nt=>W[te].has(nt));return Ye.length>1?{value:De,labels:Ye,tooltip:ct,disabled:tt}:{value:De,tooltip:ct,disabled:tt}}));return te==="jong"&&!t.requireCoda&&ye.unshift([L]),{...Ge,groups:ye}}const Fe=Yu[te].map(ye=>!we&&q[te].has(ye)?ye:{value:ye,disabled:!0});return{...Ge,items:te==="jong"&&!t.requireCoda?[L,...Fe]:Fe}};A.push(K("cho",T.trainOnset)),A.push(K("jung",T.trainVowel)),A.push(K("jong",T.trainCoda))}if(A.push({...Hu(o,Y,{labelAction:fe([o("wordPairs.filter.difficultyInfo",{defaultValue:"\uAD6D\uB9BD\uAD6D\uC5B4\uC6D0\uC758 \uAE30\uCD08 \uC5B4\uD718 \uB4F1\uAE09\uC774 \uACB0\uACFC\uC5D0 \uBC18\uC601\uB429\uB2C8\uB2E4."})])}),label:T.gradeLabel}),t.partOfSpeech&&A.push(zu(Y)),t.wordType&&A.push(Vu(Y)),t.choseong||t.fixedSyllable!=null){const L=t.fixedSyllable;A.push({label:T.syllableCount,items:[...Uu.map($=>({value:ro($),displayLabel:o("wordPairs.syllableN",{n:$,defaultValue:"{{n}}\uC74C\uC808"}),disabled:L!=null?$!==L:!be.exact.has($)||$<Q})),{value:ro(Je),displayLabel:o("wordPairs.syllableNPlus",{n:Je,defaultValue:"{{n}}\uC74C\uC808 \uC774\uC0C1"}),disabled:L!=null?Je!==L:!be.min}],allOption:!0,allOptionDisabled:L!=null})}return t.choseong?A.push({label:T.exclude,displayLabel:T.selectLabel,multiple:!0,items:[T.excludeImage,T.sameStructure],labelAction:fe(Ie)}):A.push({label:T.exclude,displayLabel:T.selectLabel,multiple:!0,items:[T.excludeImage],labelAction:fe([Ie[0]])}),A},[t.choseong,t.partOfSpeech,t.wordType,t.requireSyllable,t.fixedSyllable,t.fixedNoCoda,t.requireCoda,Q,q,W,f,be,T,o,fe,Ie,Y]),Ue={...t.difficulty?{[T.diffPhonemeCount]:String(d)}:{},...(t.choseong||t.fixedSyllable!=null)&&c.syllable!=null?{[T.syllableCount]:ro(c.syllable)}:{},...t.choseong&&c.cho?{[T.trainOnset]:c.cho}:{},...t.choseong&&c.jung?{[T.trainVowel]:c.jung}:{},...t.choseong&&c.jong?{[T.trainCoda]:c.jong}:{},[T.exclude]:[...g?[T.excludeImage]:[],...k?[T.sameStructure]:[]],[T.gradeLabel]:R.map(A=>o("wordSearch.filter.grade",{n:Number(A),defaultValue:"{{n}}\uB4F1\uAE09"})),...t.partOfSpeech?{[Y.partOfSpeech]:j}:{},...t.wordType?{[Y.wordType]:G}:{}},Qe=l.useCallback((A,L)=>{if(L===T.diffPhonemeCount){const $=Number(A);$>=1&&p($)}else if(L===T.exclude)A===T.excludeImage?b($=>!$):A===T.sameStructure&&D($=>!$);else if(L===T.syllableCount)m($=>{if(!A||A===Et)return{...$,syllable:null};const K=Dd(A);return{...$,syllable:$.syllable===K?null:K}});else if(L===T.gradeLabel){if(!A||A===Et){v([]);return}const $=A.replace(/\D/g,"");v(K=>K.includes($)?K.filter(te=>te!==$):[...K,$])}else if(L===Y.partOfSpeech){if(!A||A===Et){H([]);return}H($=>$.includes(A)?$.filter(K=>K!==A):[...$,A])}else if(L===Y.wordType){if(!A||A===Et){F([]);return}F($=>$.includes(A)?$.filter(K=>K!==A):[...$,A])}else{const $=he[L];if(!$)return;m(K=>t.requireSyllable?A&&A!==Et?{...K,[$]:A}:K:!A||A===Et||K[$]===A?{...K,[$]:null}:{...K,[$]:A})}},[T,he,Y,t.requireSyllable]),$e=l.useCallback(A=>!t.partOfSpeech&&!t.wordType?!0:Md(A,{...t.partOfSpeech?{[Y.partOfSpeech]:j}:{},...t.wordType?{[Y.wordType]:G}:{}},Y),[t.partOfSpeech,t.wordType,j,G,Y]),ee=l.useCallback(A=>{A!==f&&(A!=="direct"&&f!=="direct"&&m(L=>Xu(L,A,_.current)),C(A))},[f]),et=l.useCallback(()=>({composition:c,contrastCount:d,excludeNoImage:g,sameStructureOnly:k,phonemeView:f,gradeFilter:R}),[c,d,g,k,f,R]),ue=l.useCallback(A=>{m(A.composition),p(A.contrastCount),b(A.excludeNoImage),D(A.sameStructureOnly??!0),C(A.phonemeView),v(Array.isArray(A.gradeFilter)?A.gradeFilter:[])},[]);return{difficulty:w,contrastCount:d,composition:c,choseong:c.cho,excludeNoImage:g,sameStructureOnly:k,gradeFilter:R,posFilter:j,wordTypeFilter:G,matchesWordAttributes:$e,poolVersion:P,filterSections:lt,filterSelected:Ue,handleFilterSelect:Qe,phonemeView:f,setPhonemeView:ee,phonemeGroupLabel:T.phonemeGroup,wordCount:Ce,getFilterSnapshot:et,restoreFilterSnapshot:ue}}function jd(e){const t=s=>s?st(s):null,n=t(e.cho),o=t(e.jung),u=e.jong===Ze,r=u?null:t(e.jong),i=e.syllable!=null?ao(e.syllable):null;return!n&&!o&&!r&&!u&&!i?null:{cho:n,jung:o,jong:r,jongNone:u,syllable:i}}function Pd(e,t,n,o,u,r,i=!0,s="char",d=[]){const[p,f]=l.useState({}),[C,c]=l.useState(!1),{cho:m=null,jung:S=null,jong:w=null,syllable:_=null}=o??{};return l.useEffect(()=>{r>0&&va(u).catch(()=>{})},[r,u]),l.useEffect(()=>{let g=!1;return c(!0),(async()=>{const b=jd({cho:m,jung:S,jong:w,syllable:_}),k=d.length>0?d.slice().sort().join(","):"",D=`${m??""}_${S??""}_${w??""}_${_??""}_${k}`,R={};await Promise.all(e.map(async v=>{const j=Fn[v.key];try{const H=await iu(v.key,{difficulty:j.difficulty?t:null,contrastCount:j.difficulty?n:1,composition:j.choseong?b:null,count:5,excludeNoImage:u,sameStructureOnly:i,phonemeView:s,grade:d.length>0?d:null});H&&H.length>0?R[v.key]={id:`wt-${v.key}-${t}-${D}-${Date.now()}`,name:v.label,training_type:v.key,category_main_code:"WORD",iconColor:v.color,subTitle:v.subTitle,items:H,itemCount:H.length}:R[v.key]={id:`wt-${v.key}-empty`,name:v.label,training_type:v.key,category_main_code:"WORD",iconColor:v.color,subTitle:v.subTitle,items:[],itemCount:0,__empty:!0}}catch{R[v.key]=null}})),g||(f(R),c(!1))})(),()=>{g=!0}},[t,n,m,S,w,_,u,i,s,r,d]),{perTypeData:p,generating:C}}function $d(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function Fd(e){let t=e>>>0;return()=>{t|=0,t=t+1831565813|0;let n=Math.imul(t^t>>>15,1|t);return n=n+Math.imul(n^n>>>7,61|n)^n,((n^n>>>14)>>>0)/4294967296}}const Mn=at;function co(e,t){const n=t?Fd($d(t)):Math.random;return{LISTEN_IN_NOISE:Mn(Zt,Math.max(0,e.LISTEN_IN_NOISE||0),n),SHORT_STORY:Mn(Jt,Math.max(0,e.SHORT_STORY||0),n),LONG_STORY:Mn(Qt,Math.max(0,e.LONG_STORY||0),n),ORDERING_SENTENCE:Mn(en,Math.max(0,e.ORDERING_SENTENCE||0),n)}}function Ju(e){return e?!!(e.LISTEN_IN_NOISE?.length||e.SHORT_STORY?.length||e.LONG_STORY?.length||e.ORDERING_SENTENCE?.length):!1}const Hd={LISTEN_IN_NOISE:3,SHORT_STORY:2,LONG_STORY:1,ORDERING_SENTENCE:2};function Qu(e=!1,t=Hd,n){const o=kn(Date.now()),u=kn(Date.now()-864e5),r=`${n??""}|${o}`,i=`${n??""}|${u}`;return Zt.length>0||Jt.length>0||Qt.length>0||en.length>0?{today:co(t,r),yesterday:co(t,i)}:{today:co(t,r),yesterday:null}}function zd(e){const t=l.useRef({LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]}),n=l.useRef(null),[o,u]=l.useState(!1),[r,i]=l.useState(!1),[s,d]=l.useState(0);l.useEffect(()=>{let f=!1,C,c=0;const m=40,S=()=>{C!==void 0&&(clearInterval(C),C=void 0)};let w=!1;try{const b=new URLSearchParams(window.location.search),k=b.get("forceRefresh")||b.get("force");w=k==="1"||k==="true"}catch{}const _=b=>{t.current=b.today,n.current=b.yesterday,u(!0),d(k=>k+1),f=!0,S()},g=async()=>{if(f)return;if(!w){const k=Qu(!1,void 0,e);if(Ju(k.today)){_(k);return}}try{await sd(3e3)}catch{}if(f)return;const b=Qu(w,void 0,e);if(Ju(b.today)){_(b);return}++c>=m&&(u(!0),f=!0,S())};return g(),C=setInterval(g,250),()=>{f=!0,S()}},[e]);const p=l.useCallback(f=>{const C=r?n.current:t.current,c=r?t.current:n.current;return C?.[f]?.length?C[f]:c?.[f]?.length?c[f]:void 0},[r,s]);return{loaded:o,showYesterday:r,setShowYesterday:i,getTrainingPerType:p}}const Lt=[];let Nn=!1;function er(e){if(e.key!=="Escape"||e.defaultPrevented)return;const t=Lt[Lt.length-1];t&&(e.stopPropagation(),t())}function Vd(e){return Lt.push(e),!Nn&&typeof document<"u"&&(document.addEventListener("keydown",er),Nn=!0),()=>{const t=Lt.lastIndexOf(e);t>=0&&Lt.splice(t,1),Lt.length===0&&Nn&&typeof document<"u"&&(document.removeEventListener("keydown",er),Nn=!1)}}function Ud(e,t=!0){const n=vo(e);l.useEffect(()=>{if(t)return Vd(()=>{n.current?.()})},[t,n])}const ho=(e,t)=>`${e}:${t??1}`,fo=new Map;function Gd(e,t){const[n,o]=l.useState(0),u=e.map(r=>ho(r.word,r.homonum)).join("|");return l.useEffect(()=>{const r=(u?u.split("|"):[]).filter(d=>!fo.has(d));if(r.length===0)return;let i=!1;const s=Array.from(new Set(r.map(d=>d.slice(0,d.lastIndexOf(":")))));return t(s).then(d=>{if(!(i||d.length===0)){for(const p of d)p.Meaning&&fo.set(ho(p.Word,p.Homonum??void 0),p.Meaning);o(p=>p+1)}}),()=>{i=!0}},[u,t]),l.useMemo(()=>{const r=u?u.split("|"):[],i=new Map;for(const s of r){const d=fo.get(s);d!=null&&i.set(s,d)}return i},[u,n])}function Yd(e,t,n){const o=Number.isFinite(t)&&t>=1?Math.floor(t):1,u=Math.max(1,Math.ceil(e.length/o)),r=Number.isFinite(n)?Math.min(Math.max(1,Math.floor(n)),u):1;return{pageItems:l.useMemo(()=>e.slice((r-1)*o,r*o),[e,r,o]),totalPages:u,curPage:r}}function qd(e="warning"){const[t,n]=l.useState(""),[o,u]=l.useState(e),[r,i]=l.useState(0),s=l.useCallback((C,c)=>{u(c),n(C),i(m=>m+1)},[]),d=l.useCallback(C=>s(C,"warning"),[s]),p=l.useCallback(C=>s(C,"normal"),[s]),f=l.useCallback(()=>n(""),[]);return{toastMessage:t,toastType:o,toastKey:r,showToast:s,showWarning:d,showNormal:p,clearToast:f}}const nn={blue:"#60A5FA",green:"#4ADE80",amber:"#FBBF24",purple:"#A78BFA",pink:"#F472B6"},on=nn.blue,Tn=nn.green,un=nn.amber,xn=nn.purple,Wd=nn.pink,Kd=[{key:"discrimination",label:"\uBCC0\uBCC4\uD6C8\uB828",disc:"\uB450 \uC18C\uB9AC\uAC00 \uAC19\uC740\uC9C0 \uB2E4\uB978\uC9C0, \uB610\uB294 \uD2B9\uC815 \uC18C\uB9AC\uB97C \uAD6C\uBCC4\uD558\uB294 \uD6C8\uB828\uC785\uB2C8\uB2E4.",icon:"ear",types:[{key:"SAME_SOUND_PICK",label:"\uAC19\uC740 \uC18C\uB9AC \uACE0\uB974\uAE30",icon:"volume-2",color:on,subTitle:"\uB4E4\uC740 \uC18C\uB9AC\uC640 \uAC19\uC740 \uB2E8\uC5B4 \uCE74\uB4DC\uB97C \uACE0\uB974\uC138\uC694."},{key:"SAME_OR_DIFF",label:"\uAC19\uC740\uC9C0 \uB2E4\uB978\uC9C0 \uB9DE\uD788\uAE30",icon:"diff",color:on,subTitle:"\uB450 \uC18C\uB9AC\uAC00 \uAC19\uC740\uC9C0, \uB2E4\uB978\uC9C0 \uAD6C\uBD84\uD558\uC138\uC694."},{key:"HEAR_AND_PICK_SAME",label:"\uC77C\uCE58\uD558\uB294 \uB2E8\uC5B4 \uB9DE\uD788\uAE30",icon:"headphones",color:on,subTitle:"\uB4E4\uC740 \uC18C\uB9AC\uC758 \uB2E8\uC5B4 \uCE74\uB4DC\uB97C \uACE0\uB974\uC138\uC694."},{key:"HEAR_AND_PICK_INCLUDED",label:"\uD55C \uC74C\uC808 \uD3EC\uD568 \uB2E8\uC5B4 \uB9DE\uD788\uAE30",icon:"scan-search",color:on,subTitle:"\uB4E4\uC740 \uC74C\uC808\uC774 \uD3EC\uD568\uB41C \uB2E8\uC5B4 \uCE74\uB4DC\uB97C \uACE0\uB974\uC138\uC694."},{key:"STARTS_WITH_SAME_SOUND",label:"\uCCAB \uC74C\uC808\uC774 \uAC19\uC740 \uB2E8\uC5B4 \uB9DE\uD788\uAE30",icon:"play-circle",color:on,subTitle:"\uB4E4\uC740 \uB2E8\uC5B4\uC640 \uAC19\uC740 \uC18C\uB9AC\uB85C \uC2DC\uC791\uD558\uB294 \uB2E8\uC5B4\uB97C \uACE0\uB974\uC138\uC694."}]},{key:"synthesis",label:"\uD569\uC131\uD6C8\uB828",disc:"\uB450 \uAC1C \uC774\uC0C1\uC758 \uC74C\uC808\uC774\uB098 \uC74C\uC18C\uB97C \uD569\uCCD0 \uB2E8\uC5B4\uB97C \uB9CC\uB4DC\uB294 \uD6C8\uB828\uC785\uB2C8\uB2E4.",icon:"git-merge",types:[{key:"MERGE_2_SYLLABLES",label:"\uC74C\uC808 2\uAC1C \uD569\uCE58\uAE30",icon:"link-2",color:Tn,subTitle:"\uB450 \uC74C\uC808\uC744 \uD569\uCE58\uBA74 \uC5B4\uB5A4 \uB2E8\uC5B4\uAC00 \uB420\uAE4C\uC694?"},{key:"MERGE_3_SYLLABLES",label:"\uC74C\uC808 3\uAC1C \uD569\uCE58\uAE30",icon:"git-merge",color:Tn,subTitle:"\uC138 \uC74C\uC808\uC744 \uD569\uCE58\uBA74 \uC5B4\uB5A4 \uB2E8\uC5B4\uAC00 \uB420\uAE4C\uC694?"},{key:"MERGE_2_PHONEMES",label:"\uC74C\uC18C 2\uAC1C \uD569\uCE58\uAE30",icon:"combine",color:Tn,subTitle:"\uB450 \uC74C\uC18C\uB97C \uD569\uCE58\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB420\uAE4C\uC694?"},{key:"MERGE_3_PHONEMES",label:"\uC74C\uC18C 3\uAC1C \uD569\uCE58\uAE30",icon:"braces",color:Tn,subTitle:"\uC138 \uC74C\uC18C\uB97C \uD569\uCE58\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB420\uAE4C\uC694?"}]},{key:"deletion",label:"\uD0C8\uB77D\uD6C8\uB828",disc:"\uB2E8\uC5B4\uC5D0\uC11C \uC74C\uC808\uC774\uB098 \uC74C\uC18C\uB97C \uC81C\uAC70\uD588\uC744 \uB54C \uB0A8\uB294 \uC18C\uB9AC\uB97C \uC778\uC2DD\uD558\uB294 \uD6C8\uB828\uC785\uB2C8\uB2E4.",icon:"scissors",types:[{key:"DROP_1_FROM_2SYLL",label:"2\uC74C\uC808\uC5D0\uC11C 1\uC74C\uC808 \uD0C8\uB77D",icon:"scissors",color:un,subTitle:"2\uC74C\uC808 \uB2E8\uC5B4\uC5D0\uC11C \uD55C \uC74C\uC808\uC744 \uBE7C\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB420\uAE4C\uC694?"},{key:"DROP_1_FROM_3SYLL",label:"3\uC74C\uC808\uC5D0\uC11C 1\uC74C\uC808 \uD0C8\uB77D",icon:"minus-circle",color:un,subTitle:"3\uC74C\uC808 \uB2E8\uC5B4\uC5D0\uC11C \uD55C \uC74C\uC808\uC744 \uBE7C\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB420\uAE4C\uC694?"},{key:"DROP_PART_FROM_COMPOUND",label:"\uD569\uC131\uC5B4\uC5D0\uC11C \uBD80\uBD84\uD0C8\uB77D",icon:"unlink",color:un,subTitle:"\uD569\uC131\uC5B4\uC758 \uC77C\uBD80\uB97C \uBE7C\uBA74 \uC5B4\uB5A4 \uB2E8\uC5B4\uAC00 \uB420\uAE4C\uC694?"},{key:"DROP_FINAL_CONSONANT_FROM_1SYLL",label:"1\uC74C\uC808\uC5D0\uC11C \uBC1B\uCE68 \uD0C8\uB77D",icon:"eraser",color:un,subTitle:"\uBC1B\uCE68\uC744 \uBE7C\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB420\uAE4C\uC694?"},{key:"REMOVE_CONSONANT_AND_IDENTIFY_PHONEME",label:"1\uC74C\uC808\uC5D0\uC11C \uC790\uC74C \uD0C8\uB77D",icon:"audio-lines",color:un,subTitle:"\uC790\uC74C\uC744 \uBE7C\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB0A8\uC744\uAE4C\uC694?"}]},{key:"substitution",label:"\uB300\uCE58\uD6C8\uB828",disc:"\uB2E8\uC5B4\uC758 \uC77C\uBD80 \uC74C\uC808\uC774\uB098 \uC74C\uC18C\uB97C \uBC14\uAFB8\uC5B4 \uC0C8\uB85C\uC6B4 \uC18C\uB9AC\uB97C \uB9CC\uB4DC\uB294 \uD6C8\uB828\uC785\uB2C8\uB2E4.",icon:"replace",types:[{key:"CHANGE_1_SYLL_IN_2SYLL",label:"2\uC74C\uC808\uC5D0\uC11C \uD55C \uC74C\uC808 \uBC14\uAFB8\uAE30",icon:"replace",color:xn,subTitle:"2\uC74C\uC808 \uB2E8\uC5B4\uC758 \uD55C \uC74C\uC808\uC744 \uBC14\uAFD4 \uC0C8 \uB2E8\uC5B4\uB97C \uB9CC\uB4DC\uC138\uC694."},{key:"CHANGE_1_SYLL_IN_3SYLL",label:"3\uC74C\uC808\uC5D0\uC11C \uD55C \uC74C\uC808 \uBC14\uAFB8\uAE30",icon:"shuffle",color:xn,subTitle:"3\uC74C\uC808 \uB2E8\uC5B4\uC758 \uD55C \uC74C\uC808\uC744 \uBC14\uAFD4 \uC0C8 \uB2E8\uC5B4\uB97C \uB9CC\uB4DC\uC138\uC694."},{key:"CHANGE_1_PHONEME_IN_1SYLL",label:"1\uC74C\uC808\uC5D0\uC11C \uD55C \uC74C\uC18C \uBC14\uAFB8\uAE30",icon:"arrow-right-left",color:xn,subTitle:"1\uC74C\uC808 \uB2E8\uC5B4\uC758 \uD55C \uC74C\uC18C\uB97C \uBC14\uAFD4 \uC0C8 \uC18C\uB9AC\uB97C \uB9CC\uB4DC\uC138\uC694."},{key:"CHANGE_1_PHONEME_IN_2SYLL",label:"2\uC74C\uC808\uC5D0\uC11C \uD55C \uC74C\uC18C \uBC14\uAFB8\uAE30",icon:"flip-horizontal",color:xn,subTitle:"2\uC74C\uC808 \uB2E8\uC5B4\uC758 \uD55C \uC74C\uC18C\uB97C \uBC14\uAFD4 \uC0C8 \uB2E8\uC5B4\uB97C \uB9CC\uB4DC\uC138\uC694."}]},{key:"attention",label:"\uCCAD\uAC01\uC801\uC8FC\uC758\uB825\uD6C8\uB828",disc:"\uC5EC\uB7EC \uC18C\uB9AC\uB97C \uB4E3\uACE0 \uC21C\uC11C\uB97C \uAE30\uC5B5\uD558\uB294 \uC8FC\uC758\uB825\uACFC \uB2E8\uAE30 \uAE30\uC5B5 \uD6C8\uB828\uC785\uB2C8\uB2E4.",icon:"list-ordered",types:[{key:"LISTEN_AND_REMEMBER_ORDER",label:"\uB4E3\uACE0 \uC21C\uC11C\uB300\uB85C \uAE30\uC5B5\uD558\uAE30",icon:"list-ordered",color:Wd,subTitle:"\uC138 \uB2E8\uC5B4\uB97C \uB4E4\uC740 \uC21C\uC11C\uB300\uB85C \uCE74\uB4DC\uB97C \uC120\uD0DD\uD558\uC138\uC694."}]}];function Xd(){const{t:e}=mt.useTranslation();return l.useMemo(()=>{const t=Object.fromEntries(dd(e).map(o=>[o.key,o.label])),n={...t};return Kd.flatMap(o=>o.types).forEach(o=>{n[o.key]=e(`trainingType.${o.key}.label`,{defaultValue:o.label})}),{sentence:t,all:n}},[e])}exports.CACHE_GROUPS=Ho,exports.DocumentTitleSuppressContext=Ro,exports.EMPTY_COMPOSITION=lo,exports.MediaQueryOverrideContext=Do,exports.NO_CODA=Ze,exports.SYLLABLE_MIN=Je,exports.VAP_PAGE_SIZE_OPTIONS=Go,exports.buildGradeSection=Hu,exports.buildPartOfSpeechSection=zu,exports.buildPositionSection=bd,exports.buildSelectSection=Ed,exports.buildSyllableSection=_d,exports.buildWordTypeSection=Vu,exports.charToPronValue=Wu,exports.convertComposition=Xu,exports.fmtBytes=jr,exports.lsBytes=zo,exports.meaningKey=ho,exports.pronToCharValue=Ku,exports.syllableToFilter=ao,exports.today=zt,exports.toggleAttributeFilter=Sd,exports.useCacheManagement=Pr,exports.useDailyTrainingSelection=zd,exports.useDelayedHoverAnchor=md,exports.useDeviceManagement=qr,exports.useDocumentTitle=Er,exports.useEscToClose=Ud,exports.useFontScale=mr,exports.useHoverAnchor=$u,exports.useMediaQuery=_r,exports.usePagedList=Yd,exports.usePasswordChange=Sr,exports.useRelativeDay=br,exports.useTablePaging=Gr,exports.useTableSort=Yr,exports.useToastState=qd,exports.useTrainingTypeLabels=Xd,exports.useVisitAllPanel=Ur,exports.useVisitHistory=Hr,exports.useVisitSchedule=Vr,exports.useWindowEvent=Oo,exports.useWordAttributeFilterKeys=Fu,exports.useWordDataStats=$r,exports.useWordMeanings=Gd,exports.useWordTrainingDataGeneration=Pd,exports.useWordTrainingFilter=Id,exports.valueToJamos=st;
781
+ */const d0=[["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}],["path",{d:"M7 10v12",key:"1qc93n"}]],h0=y("thumbs-up",d0),fu={"alert-triangle":cu,"align-start-vertical":Ua,anchor:A1,"arrow-down":Ya,"arrow-left":Wa,"arrow-right":Xa,"arrow-right-left":Ja,"arrow-up-a-z":M1,"audio-lines":ei,baby:ni,ban:ui,"bar-chart-2":T1,bell:ai,"book-marked":si,"book-open":ci,"bow-arrow":hi,braces:pi,bug:yi,calendar:B1,"calendar-check":gi,"calendar-days":Ei,camera:Si,car:v1,"chart-column":Ai,"chart-line":Mi,"chart-pie":Ti,check:Bi,"chevron-down":e0,"chevron-left":vi,"chevron-right":Li,"chevron-up":n0,circle:u0,"clipboard-list":Ii,coffee:L1,combine:Pi,copy:Fi,"credit-card":zi,database:Ui,diff:Yi,download:Wi,ear:Xi,edit:Ji,"edit-2":es,"edit-3":ns,ellipsis:du,eraser:rs,"external-link":is,eye:ls,"file-text":ds,"flip-horizontal":fs,"folder-open":Cs,"folder-plus":ms,gamepad:_s,"gamepad-2":I1,gavel:bs,"git-merge":ks,globe:ws,headphones:Ns,heart:xs,home:Ds,inbox:P1,info:Os,"key-round":Rs,landmark:js,layers:$s,"layout-dashboard":Hs,leaf:Vs,lightbulb:Gs,link:qs,"link-2":Ks,"link-2-off":Zs,list:Qs,"list-checks":tl,"list-ordered":ol,"list-tree":F1,loader:rl,"log-out":il,mail:ll,"map-pin":dl,menu:s0,"message-circle":fl,"message-circle-question-mark":Cl,"message-square":ml,"message-square-more":z1,"message-square-text":_l,minus:U1,"minus-circle":bl,moon:c0,"more-horizontal":du,package:kl,palette:wl,"party-popper":Nl,pause:xl,pencil:Dl,phone:Ol,play:Rl,"play-circle":jl,plus:$l,printer:Hl,"refresh-cw":Vl,repeat:Gl,replace:ql,rocket:Kl,"rotate-ccw":Zl,"rotate-cw":Ql,salad:tc,"scan-search":oc,search:sc,"circle-alert":hu,"alert-circle":hu,"check-circle":ac,scissors:cc,"search-x":hc,send:pc,settings:yc,"share-2":Y1,"shield-check":gc,"shopping-cart":Ec,shuffle:Sc,"skip-back":Ac,"skip-forward":Mc,sparkles:W1,square:Tc,star:Bc,store:vc,"sun-medium":Lc,table:Ic,"table-2":Pc,terminal:Fc,"text-cursor-input":zc,"text-initial":Uc,"thumbs-up":h0,ticket:Yc,triangle:a0,"trash-2":Wc,"trending-up":Xc,"triangle-alert":cu,trophy:Jc,type:X1,unlink:e1,upload:n1,user:u1,"user-plus":a1,"user-round":s1,"user-round-check":c1,users:h1,"users-round":p1,volume:J1,"volume-2":y1,wrench:g1,x:E1,zap:S1};function f0(e){return fu[e]??null}const pu=new Set,p0=(()=>{try{const e=globalThis;return e.process!=null&&e.process.env?.NODE_ENV!=="production"}catch{return!1}})();function C0(e){return p0&&!(e in fu)&&!pu.has(e)&&(pu.add(e),console.warn(`[ihabdevteam-core] lucide \uC544\uC774\uCF58 '${e}' \uC774 \uC815\uC801 \uBAA9\uB85D\uC5D0 \uC5C6\uC5B4 \uB80C\uB354\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. utils/lucideIconSet.ts \uC758 STATIC_LUCIDE_ICONS \uC5D0 \uCD94\uAC00\uD558\uC138\uC694.`)),Promise.resolve(null)}const y0=e=>e.replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Za-z])([0-9])/g,"$1-$2").replace(/[_ ]+/g,"-").toLowerCase();function m0(e){const t=e.toLowerCase();if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:")||e.includes("/assets/"))return null;const n=(e.split("/").pop()||"").replace(/\.svg$/,"");return n?y0(n):null}const Cu=new Map;function g0(e){const t=typeof e=="string"?m0(e):null,n=t?f0(t)??Cu.get(t)??null:null,[o,u]=l.useState(null);return l.useEffect(()=>{if(!t||n)return;let r=!1;return C0(t).then(i=>{Cu.set(t,i),r||u(i)}),()=>{r=!0}},[t,n]),n??o}/*! @license DOMPurify 3.4.14 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.14/LICENSE */function yu(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function _0(e){if(Array.isArray(e))return e}function E0(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o,u,r,i,s=[],c=!0,C=!1;try{if(r=(n=n.call(e)).next,t!==0)for(;!(c=(o=r.call(n)).done)&&(s.push(o.value),s.length!==t);c=!0);}catch(f){C=!0,u=f}finally{try{if(!c&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(C)throw u}}return s}}function b0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
782
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function S0(e,t){return _0(e)||E0(e,t)||k0(e,t)||b0()}function k0(e,t){if(e){if(typeof e=="string")return yu(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yu(e,t):void 0}}const mu=Object.entries,gu=Object.setPrototypeOf,A0=Object.isFrozen,w0=Object.getPrototypeOf,M0=Object.getOwnPropertyDescriptor;let pe=Object.freeze,ge=Object.seal,vt=Object.create,_u=typeof Reflect<"u"&&Reflect,Wn=_u.apply,Kn=_u.construct;pe||(pe=function(t){return t}),ge||(ge=function(t){return t}),Wn||(Wn=function(t,n){for(var o=arguments.length,u=new Array(o>2?o-2:0),r=2;r<o;r++)u[r-2]=arguments[r];return t.apply(n,u)}),Kn||(Kn=function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),u=1;u<n;u++)o[u-1]=arguments[u];return new t(...o)});const bt=de(Array.prototype.forEach),N0=de(Array.prototype.lastIndexOf),Eu=de(Array.prototype.pop),qt=de(Array.prototype.push),T0=de(Array.prototype.splice),Ot=Array.isArray,Wt=de(String.prototype.toLowerCase),Xn=de(String.prototype.toString),bu=de(String.prototype.match),Kt=de(String.prototype.replace),Su=de(String.prototype.indexOf),x0=de(String.prototype.trim),B0=de(Number.prototype.toString),D0=de(Boolean.prototype.toString),ku=typeof BigInt>"u"?null:de(BigInt.prototype.toString),Au=typeof Symbol>"u"?null:de(Symbol.prototype.toString),Be=de(Object.prototype.hasOwnProperty),Xt=de(Object.prototype.toString),Ae=de(RegExp.prototype.test),St=v0(TypeError);function de(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),u=1;u<n;u++)o[u-1]=arguments[u];return Wn(e,t,o)}}function v0(e){return function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return Kn(e,n)}}function Z(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Wt;if(gu&&gu(e,null),!Ot(t))return e;let o=t.length;for(;o--;){let u=t[o];if(typeof u=="string"){const r=n(u);r!==u&&(A0(t)||(t[o]=r),u=r)}e[u]=!0}return e}function O0(e){for(let t=0;t<e.length;t++)Be(e,t)||(e[t]=null);return e}function Le(e){const t=vt(null);for(const o of mu(e)){var n=S0(o,2);const u=n[0],r=n[1];Be(e,u)&&(Ot(r)?t[u]=O0(r):r&&typeof r=="object"&&r.constructor===Object?t[u]=Le(r):t[u]=r)}return t}function L0(e){switch(typeof e){case"string":return e;case"number":return B0(e);case"boolean":return D0(e);case"bigint":return ku?ku(e):"0";case"symbol":return Au?Au(e):"Symbol()";case"undefined":return Xt(e);case"function":case"object":{if(e===null)return Xt(e);const t=e,n=Ve(t,"toString");if(typeof n=="function"){const o=n(t);return typeof o=="string"?o:Xt(o)}return Xt(e)}default:return Xt(e)}}function Ve(e,t){for(;e!==null;){const o=M0(e,t);if(o){if(o.get)return de(o.get);if(typeof o.value=="function")return de(o.value)}e=w0(e)}function n(){return null}return n}function R0(e){try{return Ae(e,""),!0}catch{return!1}}const wu=pe(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Zn=pe(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Jn=pe(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I0=pe(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Qn=pe(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),j0=pe(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Mu=pe(["#text"]),Nu=pe(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),eo=pe(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Tu=pe(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Sn=pe(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),P0=ge(/{{[\w\W]*|^[\w\W]*}}/g),$0=ge(/<%[\w\W]*|^[\w\W]*%>/g),F0=ge(/\${[\w\W]*/g),H0=ge(/^data-[\-\w.\u00B7-\uFFFF]+$/),z0=ge(/^aria-[\-\w]+$/),xu=ge(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),V0=ge(/^(?:\w+script|data):/i),U0=ge(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),G0=ge(/^html$/i),Y0=ge(/^[a-z][.\w]*(-[.\w]+)+$/i),Bu=ge(/<[/\w!]/g),Du=ge(/<[/\w]/g),q0=ge(/<\/no(script|embed|frames)/i),W0=ge(/\/>/i),Re={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},vu=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],K0=pe(Z({},vu)),X0=(function(){const e={};return bt(vu,t=>{e[t]=ge(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),pe(e)})(),Z0=function(){return typeof window>"u"?null:window},J0=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let o=null;const u="data-tt-policy-suffix";n&&n.hasAttribute(u)&&(o=n.getAttribute(u));const r="dompurify"+(o?"#"+o:"");try{return t.createPolicy(r,{createHTML(i){return i},createScriptURL(i){return i}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},Ou=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ft=function(t,n,o,u){return Be(t,n)&&Ot(t[n])?Z(u.base?Le(u.base):{},t[n],u.transform):o},to=function(t,n,o){const u=Be(t,n)?t[n]:void 0;return u&&typeof u=="object"?Le(u):o()};function Lu(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Z0();const t=N=>Lu(N);if(t.version="3.4.14",t.removed=[],!e||!e.document||e.document.nodeType!==Re.document||!e.Element)return t.isSupported=!1,t;let n=e.document;const o=n,u=o.currentScript;e.DocumentFragment;const r=e.HTMLTemplateElement,i=e.Node,s=e.Element,c=e.NodeFilter,C=e.NamedNodeMap;C===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const f=e.DOMParser,p=e.trustedTypes,d=s.prototype,m=Ve(d,"cloneNode"),S=Ve(d,"remove"),w=Ve(d,"nextSibling"),_=Ve(d,"childNodes"),g=Ve(d,"parentNode"),b=Ve(d,"shadowRoot"),k=Ve(d,"attributes"),D=i&&i.prototype?Ve(i.prototype,"nodeType"):null,R=i&&i.prototype?Ve(i.prototype,"nodeName"):null,v=i&&i.prototype?Ve(i.prototype,"ownerDocument"):null,j=function(a){return D?D(a):a.nodeType},H=function(a){return R?R(a):a.nodeName};if(typeof r=="function"){const N=n.createElement("template");N.content&&N.content.ownerDocument&&(n=N.content.ownerDocument)}let G,F="",J,Y=!1,W=0;const z=function(){if(W>0)throw St('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},B=function(a){z(),W++;try{return G.createHTML(a)}finally{W--}},O=function(a){z(),W++;try{return G.createScriptURL(a)}finally{W--}},Ce=function(){return Y||(J=J0(p,u),Y=!0),J},X=n,Q=X.implementation,M=X.createNodeIterator,P=X.createDocumentFragment,ne=X.getElementsByTagName,oe=o.importNode;let q=Ou();t.isSupported=typeof mu=="function"&&typeof g=="function"&&Q&&Q.createHTMLDocument!==void 0;const be=P0,T=$0,he=F0,fe=H0,Ie=z0,lt=V0,Ue=U0,Qe=Y0;let $e=xu,ee=null;const et=Z({},[...wu,...Zn,...Jn,...Qn,...Mu]);let ue=null;const A=Z({},[...Nu,...eo,...Tu,...Sn]);let L=Object.seal(vt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$=null,K=null;const te=Object.seal(vt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ne=!0,we=!0,Ge=!1,Fe=!0,ye=!1,je=!0,De=!1,ct=!1,Ye=null,tt=null,nt=!1,ot=!1,kt=!1,Ct=!1,Rt=!0,me=!1;const At="user-content-";let wt=!0,ut=!1,dt={},qe=null;const re=Z({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let We=null;const It=Z({},["audio","video","img","source","image","track"]);let Mt=null;const po=Z({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),rn="http://www.w3.org/1998/Math/MathML",an="http://www.w3.org/2000/svg",Ke="http://www.w3.org/1999/xhtml";let Nt=Ke,Bn=!1,Dn=null;const tr=Z({},[rn,an,Ke],Xn),Co=pe(["mi","mo","mn","ms","mtext"]);let vn=Z({},Co);const yo=pe(["annotation-xml"]);let On=Z({},yo);const nr=Z({},["title","style","font","a","script"]);let jt=null;const or=["application/xhtml+xml","text/html"],ur="text/html";let ce=null,Tt=null;const rr=n.createElement("form"),mo=function(a){return a instanceof RegExp||a instanceof Function},Ln=function(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Tt&&Tt===a)return;(!a||typeof a!="object")&&(a={}),a=Le(a),jt=or.indexOf(a.PARSER_MEDIA_TYPE)===-1?ur:a.PARSER_MEDIA_TYPE,ce=jt==="application/xhtml+xml"?Xn:Wt,ee=ft(a,"ALLOWED_TAGS",et,{transform:ce}),ue=ft(a,"ALLOWED_ATTR",A,{transform:ce}),Dn=ft(a,"ALLOWED_NAMESPACES",tr,{transform:Xn}),Mt=ft(a,"ADD_URI_SAFE_ATTR",po,{transform:ce,base:po}),We=ft(a,"ADD_DATA_URI_TAGS",It,{transform:ce,base:It}),qe=ft(a,"FORBID_CONTENTS",re,{transform:ce}),$=ft(a,"FORBID_TAGS",Le({}),{transform:ce}),K=ft(a,"FORBID_ATTR",Le({}),{transform:ce}),dt=Be(a,"USE_PROFILES")?a.USE_PROFILES&&typeof a.USE_PROFILES=="object"?Le(a.USE_PROFILES):a.USE_PROFILES:!1,Ne=a.ALLOW_ARIA_ATTR!==!1,we=a.ALLOW_DATA_ATTR!==!1,Ge=a.ALLOW_UNKNOWN_PROTOCOLS||!1,Fe=a.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ye=a.SAFE_FOR_TEMPLATES||!1,je=a.SAFE_FOR_XML!==!1,De=a.WHOLE_DOCUMENT||!1,ot=a.RETURN_DOM||!1,kt=a.RETURN_DOM_FRAGMENT||!1,Ct=a.RETURN_TRUSTED_TYPE||!1,nt=a.FORCE_BODY||!1,Rt=a.SANITIZE_DOM!==!1,me=a.SANITIZE_NAMED_PROPS||!1,wt=a.KEEP_CONTENT!==!1,ut=a.IN_PLACE||!1,$e=R0(a.ALLOWED_URI_REGEXP)?a.ALLOWED_URI_REGEXP:xu,Nt=typeof a.NAMESPACE=="string"?a.NAMESPACE:Ke,vn=to(a,"MATHML_TEXT_INTEGRATION_POINTS",()=>Z({},Co)),On=to(a,"HTML_INTEGRATION_POINTS",()=>Z({},yo));const h=to(a,"CUSTOM_ELEMENT_HANDLING",()=>vt(null));if(L=vt(null),Be(h,"tagNameCheck")&&mo(h.tagNameCheck)&&(L.tagNameCheck=h.tagNameCheck),Be(h,"attributeNameCheck")&&mo(h.attributeNameCheck)&&(L.attributeNameCheck=h.attributeNameCheck),Be(h,"allowCustomizedBuiltInElements")&&typeof h.allowCustomizedBuiltInElements=="boolean"&&(L.allowCustomizedBuiltInElements=h.allowCustomizedBuiltInElements),ge(L),ye&&(we=!1),kt&&(ot=!0),dt&&(ee=Z({},Mu),ue=vt(null),dt.html===!0&&(Z(ee,wu),Z(ue,Nu)),dt.svg===!0&&(Z(ee,Zn),Z(ue,eo),Z(ue,Sn)),dt.svgFilters===!0&&(Z(ee,Jn),Z(ue,eo),Z(ue,Sn)),dt.mathMl===!0&&(Z(ee,Qn),Z(ue,Tu),Z(ue,Sn))),te.tagCheck=null,te.attributeCheck=null,Be(a,"ADD_TAGS")&&(typeof a.ADD_TAGS=="function"?te.tagCheck=a.ADD_TAGS:Ot(a.ADD_TAGS)&&(ee===et&&(ee=Le(ee)),Z(ee,a.ADD_TAGS,ce))),Be(a,"ADD_ATTR")&&(typeof a.ADD_ATTR=="function"?te.attributeCheck=a.ADD_ATTR:Ot(a.ADD_ATTR)&&(ue===A&&(ue=Le(ue)),Z(ue,a.ADD_ATTR,ce))),Be(a,"ADD_FORBID_CONTENTS")&&Ot(a.ADD_FORBID_CONTENTS)&&(qe===re&&(qe=Le(qe)),Z(qe,a.ADD_FORBID_CONTENTS,ce)),wt&&(ee["#text"]=!0),De&&Z(ee,["html","head","body"]),ee.table&&(Z(ee,["tbody"]),delete $.tbody),a.TRUSTED_TYPES_POLICY){if(typeof a.TRUSTED_TYPES_POLICY.createHTML!="function")throw St('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof a.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw St('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const E=G;G=a.TRUSTED_TYPES_POLICY;try{F=B("")}catch(x){throw G=E,x}}else a.TRUSTED_TYPES_POLICY===null?(G=void 0,F=""):(G===void 0&&(G=Ce()),G&&typeof F=="string"&&(F=B("")));pe&&pe(a),Tt=a},go=Z({},[...Zn,...Jn,...I0]),_o=Z({},[...Qn,...j0]),ar=function(a,h,E){return h.namespaceURI===Ke?a==="svg":h.namespaceURI===rn?a==="svg"&&(E==="annotation-xml"||vn[E]):!!go[a]},ir=function(a,h,E){return h.namespaceURI===Ke?a==="math":h.namespaceURI===an?a==="math"&&On[E]:!!_o[a]},sr=function(a,h,E){return h.namespaceURI===an&&!On[E]||h.namespaceURI===rn&&!vn[E]?!1:!_o[a]&&(nr[a]||!go[a])},lr=function(a){let h=g(a);(!h||!h.tagName)&&(h={namespaceURI:Nt,tagName:"template"});const E=Wt(a.tagName),x=Wt(h.tagName);return Dn[a.namespaceURI]?a.namespaceURI===an?ar(E,h,x):a.namespaceURI===rn?ir(E,h,x):a.namespaceURI===Ke?sr(E,h,x):!!(jt==="application/xhtml+xml"&&Dn[a.namespaceURI]):!1},ht=function(a){qt(t.removed,{element:a});try{g(a).removeChild(a)}catch{if(S(a),!g(a))throw St("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Eo=function(a,h,E){try{a.removeAttributeNode(h)}catch{try{a.removeAttribute(E)}catch{}}},sn=function(a){ln(a);const h=_(a);if(h){const x=[];bt(h,I=>{qt(x,I)}),bt(x,I=>{try{S(I)}catch{}})}const E=k(a);if(E)for(let x=E.length-1;x>=0;--x){const I=E[x],U=I&&I.name;typeof U=="string"&&Eo(a,I,U)}},yt=function(a,h,E){if(!E)try{E=h.getAttributeNode(a)}catch{E=null}qt(t.removed,{attribute:E||null,from:h});try{E?h.removeAttributeNode(E):h.removeAttribute(a)}catch{try{h.removeAttribute(a)}catch{}}if(a==="is")if(ot||kt)try{ht(h)}catch{}else try{h.setAttribute(a,"")}catch{}},cr=function(a){const h=k(a);if(h)for(let E=h.length-1;E>=0;--E){const x=h[E],I=x&&x.name;typeof I!="string"||ue[ce(I)]||Eo(a,x,I)}},ln=function(a){const h=[a];for(;h.length>0;){const E=h.pop();j(E)===Re.element&&cr(E);const I=_(E);if(I)for(let U=I.length-1;U>=0;--U)h.push(I[U])}},bo=function(a,h){return je?a==="patchsrc"?!0:a==="for"&&h!=="label"&&h!=="output":!1},dr=function(a){if(!je)return;const h=[a];for(;h.length>0;){const E=h.pop(),x=j(E);if(x===Re.processingInstruction||x===Re.comment&&Ae(Du,E.data)){try{S(E)}catch{}continue}if(x===Re.element){const U=E,ie=ce(H(E));try{U.hasAttribute&&U.hasAttribute("patchsrc")&&U.removeAttribute("patchsrc"),U.hasAttribute&&U.hasAttribute("for")&&bo("for",ie)&&U.removeAttribute("for")}catch{}}const I=_(E);if(I)for(let U=I.length-1;U>=0;--U)h.push(I[U])}},So=function(a){let h=null,E=null;if(nt)a="<remove></remove>"+a;else{const U=bu(a,/^[\r\n\t ]+/);E=U&&U[0]}jt==="application/xhtml+xml"&&Nt===Ke&&(a='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+a+"</body></html>");const x=G?B(a):a;if(Nt===Ke)try{h=new f().parseFromString(x,jt)}catch{}if(!h||!h.documentElement){h=Q.createDocument(Nt,"template",null);try{h.documentElement.innerHTML=Bn?F:x}catch{}}const I=h.body||h.documentElement;return a&&E&&I.insertBefore(n.createTextNode(E),I.childNodes[0]||null),Nt===Ke?ne.call(h,De?"html":"body")[0]:De?h.documentElement:I},ko=function(a){const h=v?v(a):a.ownerDocument;return M.call(h||a,a,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},cn=function(a){return a=Kt(a,be," "),a=Kt(a,T," "),a=Kt(a,he," "),a},Rn=function(a){var h;a.normalize();const E=v?v(a):a.ownerDocument,x=M.call(E||a,a,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null);let I=x.nextNode();for(;I;)I.data=cn(I.data),I=x.nextNode();const U=(h=a.querySelectorAll)===null||h===void 0?void 0:h.call(a,"template");U&&bt(U,ie=>{xt(ie.content)&&Rn(ie.content)})},dn=function(a){const h=R?R(a):null;return typeof h!="string"||ce(h)!=="form"?!1:typeof a.nodeName!="string"||typeof a.textContent!="string"||typeof a.removeChild!="function"||a.attributes!==k(a)||typeof a.removeAttribute!="function"||typeof a.setAttribute!="function"||typeof a.namespaceURI!="string"||typeof a.insertBefore!="function"||typeof a.hasChildNodes!="function"||a.nodeType!==D(a)||a.childNodes!==_(a)},xt=function(a){if(!D||typeof a!="object"||a===null)return!1;try{return D(a)===Re.documentFragment}catch{return!1}},Pt=function(a){if(!D||typeof a!="object"||a===null)return!1;try{return typeof D(a)=="number"}catch{return!1}};function Xe(N,a,h){N.length!==0&&bt(N,E=>{E.call(t,a,h,Tt)})}const hr=function(a,h){return!!(je&&a.hasChildNodes()&&!Pt(a.firstElementChild)&&Ae(Bu,a.textContent)&&Ae(Bu,a.innerHTML)||je&&a.namespaceURI===Ke&&K0[h]&&(Pt(a.firstElementChild)||typeof a.textContent=="string"&&Ae(X0[h],a.textContent))||a.nodeType===Re.processingInstruction||je&&a.nodeType===Re.comment&&Ae(Du,a.data))},hn=function(a,h){if(a instanceof RegExp)return Ae(a,h);if(a instanceof Function){for(var E=arguments.length,x=new Array(E>2?E-2:0),I=2;I<E;I++)x[I-2]=arguments[I];return!!a(h,...x)}return!1},fr=function(a,h,E){if(!$[h]&&To(h)&&hn(L.tagNameCheck,h))return!1;if(wt&&!qe[h]){const x=g(a),I=_(a);if(I&&x){const U=I.length;for(let ie=U-1;ie>=0;--ie){const le=a===E?m(I[ie],!0):I[ie];x.insertBefore(le,w(a))}}}return ht(a),!0},Ao=function(a,h,E,x){return a.length===0?h:h===E||h===x?Le(h):h},wo=function(a,h){return a===h||g(a)!==null?!1:(ut&&ln(a),!0)},Mo=function(a,h){if(Xe(q.beforeSanitizeElements,a,null),wo(a,h))return!0;if(dn(a))return ht(a),!0;const E=ce(H(a));if(ee=Ao(q.uponSanitizeElement,ee,et,Ye),Xe(q.uponSanitizeElement,a,{tagName:E,allowedTags:ee}),wo(a,h))return!0;if(hr(a,E))return ht(a),!0;if($[E]||!(te.tagCheck instanceof Function&&te.tagCheck(E))&&!ee[E]){const I=fr(a,E,h);return I===!1&&Xe(q.afterSanitizeElements,a,null),I}if(j(a)===Re.element&&!lr(a)||(E==="noscript"||E==="noembed"||E==="noframes")&&Ae(q0,a.innerHTML))return ht(a),!0;if(ye&&a.nodeType===Re.text){const I=cn(a.textContent);a.textContent!==I&&(qt(t.removed,{element:a.cloneNode()}),a.textContent=I)}return Xe(q.afterSanitizeElements,a,null),!1},No=function(a,h,E){if(K[h]||bo(h,a)||Rt&&(h==="id"||h==="name")&&(E in n||E in rr))return!1;const x=ue[h]||te.attributeCheck instanceof Function&&te.attributeCheck(h,a);return we&&Ae(fe,h)||Ne&&Ae(Ie,h)?!0:x?Mt[h]||Ae($e,Kt(E,Ue,""))||(h==="src"||h==="xlink:href"||h==="href")&&a!=="script"&&Su(E,"data:")===0&&We[a]||Ge&&!Ae(lt,Kt(E,Ue,""))?!0:!E:To(a)&&hn(L.tagNameCheck,a)&&hn(L.attributeNameCheck,h,a)||h==="is"&&L.allowCustomizedBuiltInElements&&hn(L.tagNameCheck,E)},pr=Z({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),To=function(a){return!pr[Wt(a)]&&Ae(Qe,a)},Cr=function(a,h,E,x){if(G&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!E)switch(p.getAttributeType(a,h)){case"TrustedHTML":return B(x);case"TrustedScriptURL":return O(x)}return x},yr=function(a,h,E,x){try{E?a.setAttributeNS(E,h,x):a.setAttribute(h,x),dn(a)?ht(a):Eu(t.removed)}catch{yt(h,a)}},xo=function(a){Xe(q.beforeSanitizeAttributes,a,null);const h=a.attributes;if(!h||dn(a))return;ue=Ao(q.uponSanitizeAttribute,ue,A,tt);const E={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ue,forceKeepAttr:void 0};let x=h.length;const I=ce(a.nodeName);for(;x--;){const U=h[x],ie=U.name,le=U.namespaceURI,Te=U.value,xe=ce(ie),jn=Te;let Me=ie==="value"?jn:x0(jn);if(E.attrName=xe,E.attrValue=Me,E.keepAttr=!0,E.forceKeepAttr=void 0,Xe(q.uponSanitizeAttribute,a,E),Me=E.attrValue,me&&(xe==="id"||xe==="name")&&Su(Me,At)!==0&&(yt(ie,a,U),Me=At+Me),je&&Ae(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Me)){yt(ie,a,U);continue}if(xe==="attributename"&&bu(Me,"href")){yt(ie,a,U);continue}if(!E.forceKeepAttr){if(!E.keepAttr){yt(ie,a,U);continue}if(!Fe&&Ae(W0,Me)){yt(ie,a,U);continue}if(ye&&(Me=cn(Me)),!No(I,xe,Me)){yt(ie,a,U);continue}Me=Cr(I,xe,le,Me),Me!==jn&&yr(a,ie,le,Me)}}Xe(q.afterSanitizeAttributes,a,null)},fn=function(a){let h=null;const E=ko(a);for(Xe(q.beforeSanitizeShadowDOM,a,null);h=E.nextNode();)if(Xe(q.uponSanitizeShadowNode,h,null),Mo(h,a),xo(h),xt(h.content)&&fn(h.content),j(h)===Re.element){const x=b(h);xt(x)&&(In(x),fn(x))}Xe(q.afterSanitizeShadowDOM,a,null)},In=function(a){const h=[{node:a,shadow:null}];for(;h.length>0;){const E=h.pop();if(E.shadow){fn(E.shadow);continue}const x=E.node,U=j(x)===Re.element,ie=_(x);if(ie)for(let le=ie.length-1;le>=0;--le)h.push({node:ie[le],shadow:null});if(U){const le=R?R(x):null;if(typeof le=="string"&&ce(le)==="template"){const Te=x.content;xt(Te)&&h.push({node:Te,shadow:null})}}if(U){const le=b(x);xt(le)&&h.push({node:null,shadow:le},{node:le,shadow:null})}}};return t.sanitize=function(N){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=null,E=null,x=null,I=null;if(Bn=!N,Bn&&(N="<!-->"),typeof N!="string"&&!Pt(N)&&(N=L0(N),typeof N!="string"))throw St("dirty is not a string, aborting");if(!t.isSupported)return N;ct?(ee=Ye,ue=tt):Ln(a),(q.uponSanitizeElement.length>0||q.uponSanitizeAttribute.length>0)&&(ee=Le(ee)),q.uponSanitizeAttribute.length>0&&(ue=Le(ue)),t.removed=[];const U=ut&&typeof N!="string"&&Pt(N);if(U){dr(N);const Te=H(N);if(typeof Te=="string"){const xe=ce(Te);if(!ee[xe]||$[xe])throw sn(N),St("root node is forbidden and cannot be sanitized in-place")}if(dn(N))throw sn(N),St("root node is clobbered and cannot be sanitized in-place");try{In(N)}catch(xe){throw sn(N),xe}}else if(Pt(N))h=So("<!---->"),E=h.ownerDocument.importNode(N,!0),E.nodeType===Re.element&&E.nodeName==="BODY"||E.nodeName==="HTML"?h=E:h.appendChild(E),In(E);else{if(!ot&&!ye&&!De&&N.indexOf("<")===-1)return G&&Ct?B(N):N;if(h=So(N),!h)return ot?null:Ct?F:""}h&&nt&&ht(h.firstChild);const ie=U?N:h;try{const Te=ko(ie);for(;x=Te.nextNode();)Mo(x,ie),xo(x),xt(x.content)&&fn(x.content)}catch(Te){throw U&&(sn(N),bt(t.removed,xe=>{xe.element&&ln(xe.element)})),Te}if(U)return bt(t.removed,Te=>{Te.element&&ln(Te.element)}),ye&&Rn(N),N;if(ot){if(ye&&Rn(h),kt)for(I=P.call(h.ownerDocument);h.firstChild;)I.appendChild(h.firstChild);else I=h;return(ue.shadowroot||ue.shadowrootmode)&&(I=oe.call(o,I,!0)),I}let le=De?h.outerHTML:h.innerHTML;return De&&ee["!doctype"]&&h.ownerDocument&&h.ownerDocument.doctype&&h.ownerDocument.doctype.name&&Ae(G0,h.ownerDocument.doctype.name)&&(le="<!DOCTYPE "+h.ownerDocument.doctype.name+`>
783
+ `+le),ye&&(le=cn(le)),G&&Ct?B(le):le},t.setConfig=function(){let N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ln(N),ct=!0,Ye=ee,tt=ue},t.clearConfig=function(){Tt=null,ct=!1,Ye=null,tt=null,G=J,F=""},t.isValidAttribute=function(N,a,h){Tt||Ln({});const E=ce(N),x=ce(a);return No(E,x,h)},t.addHook=function(N,a){typeof a=="function"&&Be(q,N)&&qt(q[N],a)},t.removeHook=function(N,a){if(Be(q,N)){if(a!==void 0){const h=N0(q[N],a);return h===-1?void 0:T0(q[N],h,1)[0]}return Eu(q[N])}},t.removeHooks=function(N){Be(q,N)&&(q[N]=[])},t.removeAllHooks=function(){q=Ou()},t}var Q0=Lu();const ed=/^(?:[a-z]+:)?\/\//i;let td="";function nd(){return td}function no(e){const t=String(e||"").trim();if(!t)return"";if(ed.test(t)||t.startsWith("data:")||t.startsWith("blob:"))return t;const n=t.startsWith("/")?t:`/${t}`,o=nd();return o?`${o}${n}`:n}function od(){return kn(new Date)}function kn(e){if(e==null||e==="")return"";const t=e instanceof Date?e:new Date(e);return isNaN(t.getTime())?"":new Intl.DateTimeFormat("fr-CA",{timeZone:"Asia/Seoul"}).format(t)}const Zt=[],Jt=[],Qt=[],en=[],An={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},wn={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},ud={LISTEN_IN_NOISE:3,SHORT_STORY:2,LONG_STORY:1,ORDERING_SENTENCE:2};let oo=null,Ru=null,pt=null;function rd({counts:e,forceRefresh:t}={}){const n=Object.assign({},ud,e||{}),o=od(),u=kn(new Date(`${o}T00:00:00+09:00`).getTime()-864e5),r=JSON.stringify(n);if(!t&&Ru===o&&oo===r&&pt)return Object.assign(An,pt.today),Object.assign(wn,pt.yesterday?.selection||{LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]}),{today:An,yesterday:wn};const i={LISTEN_IN_NOISE:at(Zt,Math.max(0,Number(n.LISTEN_IN_NOISE)||0)),SHORT_STORY:at(Jt,Math.max(0,Number(n.SHORT_STORY)||0)),LONG_STORY:at(Qt,Math.max(0,Number(n.LONG_STORY)||0)),ORDERING_SENTENCE:at(en,Math.max(0,Number(n.ORDERING_SENTENCE)||0))};let s=null;return pt&&oo===r&&pt.yesterday&&pt.yesterday.date===u&&(s=pt.yesterday.selection),s||(s={LISTEN_IN_NOISE:at(Zt,Math.max(0,Number(n.LISTEN_IN_NOISE)||0)),SHORT_STORY:at(Jt,Math.max(0,Number(n.SHORT_STORY)||0)),LONG_STORY:at(Qt,Math.max(0,Number(n.LONG_STORY)||0)),ORDERING_SENTENCE:at(en,Math.max(0,Number(n.ORDERING_SENTENCE)||0))}),Object.assign(An,i),Object.assign(wn,s),Ru=o,oo=r,pt={today:i,yesterday:{date:u,countsKey:r,selection:s}},{today:An,yesterday:wn}}let Iu=!1,tn=null;async function ad(){try{const e={url:typeof document>"u"?require("url").pathToFileURL(__filename).href:Pn&&Pn.tagName.toUpperCase()==="SCRIPT"&&Pn.src||new URL("hooks.cjs.js",document.baseURI).href}&&void 0||"/",t=await fetch(`${e}data/allTrainingData.json`);return t.ok?await t.json():null}catch{return null}}async function id(){if(!Iu)return tn||(tn=(async()=>{const e=await ad();if(!e){tn=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}try{for(const t of Object.keys(e||{})){const n=e[t]||[];for(const o of n){const u=o,r=String(u.training_type||t),i=String(u.category_main_code||u.category_main||u.category_0||""),s=String(u.category_sub_code||u.category_sub||u.category_1||""),c=Object.assign({},u,{training_type:r,category_0:i,category_1:s});r==="LISTEN_IN_NOISE"?Zt.push(c):r==="SHORT_STORY"?Jt.push(c):r==="LONG_STORY"?Qt.push(c):r==="ORDERING_SENTENCE"&&en.push(c)}}}catch{tn=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}try{window.dispatchEvent(new Event("speechear.data.updated"))}catch{}try{rd()}catch{}Iu=!0})(),tn)}async function sd(e=3e3){const t=id();return Promise.race([t,new Promise(n=>setTimeout(n,e))])}const ld=[{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."}],cd={LISTEN_IN_NOISE:"listenInNoise",SHORT_STORY:"shortStory",LONG_STORY:"longStory",ORDERING_SENTENCE:"orderingSentence"};function dd(e){return ld.map(t=>{const n=cd[t.key];return n?{...t,label:e(`trainingType.${n}.title`),desc:e(`trainingType.${n}.desc`)}:t})}function hd(e){return typeof window>"u"?"":Q0.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},FORBID_TAGS:["script","use"],FORBID_ATTR:["xlink:href","href"]})}function fd(e){const[t,n]=l.useState(null),[o,u]=l.useState(null),[r,i]=l.useState(null),[s,c]=l.useState(null);return l.useEffect(()=>{if(!e||typeof e!="string"||!e.endsWith(".svg")){n(null),u(null),i(null);return}const C=e.split("/").pop();let f=e;C&&(e.startsWith("/")?f=no(e):/^(Logo|Symbol)/i.test(C)?f=no(`logo/${C}`):(/^https?:\/\//i.test(e)||e.startsWith("data:"),f=e)),n(f)},[e]),l.useEffect(()=>{if(!t)return;let C=!1;async function f(){try{let p=await fetch(t);p.ok||(p=await fetch(t));const d=p.headers.get("content-type")||"";if(C)return;if(d.includes("svg")){u("mask");return}if(d.startsWith("image/")){u("img");return}const m=await fetch(t);if(!m.ok)throw new Error("not ok");const S=await m.text();if(C)return;if(/^\s*<svg[\s>]/i.test(S)){const w=hd(S);if(!w){u("none");return}i(w),u("inline");return}u("none")}catch{C||u("none")}}return f(),()=>{C=!0}},[t]),l.useEffect(()=>{let C=!1,f=null;return o==="mask"&&t&&fetch(t).then(p=>{if(!p.ok)throw new Error("fetch failed");return p.blob()}).then(p=>{C||(f=URL.createObjectURL(p),c(f))}).catch(()=>{C||u("img")}),()=>{C=!0,f&&URL.revokeObjectURL(f),c(null)}},[o,t]),{iconToUse:t,mode:o,svgText:r,blobUrl:s}}function pd(e){const{icon:t,label:n,className:o,imgClassName:u,maskClassName:r,svgClassName:i,wrapperStyle:s,size:c}=e||{},C=o??"iconRenderer-icon",f=u??"iconRenderer-icon-image",p=r??"iconRenderer-icon-mask",d=i??"iconRenderer-icon-svg",m=typeof t=="string"?t:null,S=g0(m),{iconToUse:w,mode:_,svgText:g,blobUrl:b}=fd(m),k=(j,H={})=>V.jsx("span",{className:C,style:s,...H,children:j}),D=(j,H={})=>V.jsx("img",{src:j,alt:typeof n=="string"?n:n?String(n):"",className:f,...H});if(!t)return null;if(typeof t!="string")return k(t);if(t==="none")return k(V.jsx("span",{className:d,dangerouslySetInnerHTML:{__html:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true"></svg>'}}),{"aria-hidden":"true"});if(S)try{return k(l.createElement(S,{className:d,size:typeof c=="number"?c:20}),{"aria-hidden":"true"})}catch{}if(w&&w.endsWith(".svg")){if(_==="mask"){const j={"--icon-url":b?`url(${b})`:`url(${w})`};return k(V.jsx("span",{className:p,style:j}),{"aria-hidden":"true"})}return _==="img"?k(D(w,{onError:j=>{j.currentTarget.onerror=null,j.currentTarget.style.display="none"}}),{"aria-hidden":"true"}):_==="inline"?k(V.jsx("span",{className:d,dangerouslySetInnerHTML:g?{__html:g}:void 0}),{"aria-hidden":"true"}):k(null,{"aria-hidden":"true"})}if(t.startsWith("/")||t.includes("/assets/")||t.match(/\.(png|jpg|jpeg|webp|gif)$/i))return D(no(t),{style:s,onError:j=>{j.currentTarget.onerror=null,j.currentTarget.style.display="none"}});const R=typeof c=="number"?c:20,v=`<svg width="${R}" height="${R}" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><rect x="3" y="3" width="18" height="18" rx="2" ry="2" style="fill:none;stroke:currentColor;stroke-width:2"/></svg>`;return k(V.jsx("span",{className:d,dangerouslySetInnerHTML:{__html:v}}),{"aria-hidden":"true"})}function ju(e){const{anchorRect:t,anchorEl:n,offset:o=20,edgeMargin:u=20,onClose:r,closeOnOutsideClick:i=!0,className:s="",role:c="dialog",ariaLabel:C="",children:f,backdrop:p=!1,isMobilePopup:d=!1,useBorder:m=!0,header:S}=e||{},w=l.useRef(null),[_,g]=l.useState({position:"fixed",left:0,top:-9999}),[b,k]=l.useState(!1),[D,R]=l.useState("bottom"),[v,j]=l.useState(!1),[H,G]=l.useState(!1),F=!t&&!n,J=l.useCallback((B=!1)=>{if(H&&d)return;const O=n?n.getBoundingClientRect():t;if(!O||!w.current)return;const Ce=w.current,{offsetWidth:X,offsetHeight:Q}=Ce,M=window.innerWidth,P=window.innerHeight,ne=M-O.right,oe=O.left,q=O.top,be=P-O.bottom;let T=0,he=0,fe="top";if(q>=Q+o)fe="top",he=O.top-o-Q,T=O.left+O.width/2-X/2;else if(be>=Q+o)fe="bottom",he=O.bottom+o,T=O.left+O.width/2-X/2;else if(ne>=X+o)fe="right",T=O.right+o,he=O.top+O.height/2-Q/2;else if(oe>=X+o)fe="left",T=O.left-o-X,he=O.top+O.height/2-Q/2;else{const Qe=Math.max(q,be,ne,oe);Qe===q?(fe="top",he=O.top-o-Q,T=O.left+O.width/2-X/2):Qe===be?(fe="bottom",he=O.bottom+o,T=O.left+O.width/2-X/2):Qe===ne?(fe="right",T=O.right+o,he=O.top+O.height/2-Q/2):(fe="left",T=O.left-o-X,he=O.top+O.height/2-Q/2)}const Ie=Number(u)||8;T=Math.min(Math.max(T,Ie),M-X-Ie),he=Math.min(Math.max(he,Ie),P-Q-Ie);const lt=Math.round(T),Ue=Math.round(he);B&&w.current?(w.current.style.left=`${lt}px`,w.current.style.top=`${Ue}px`,w.current.dataset.placement=fe):(R(fe||D),g({position:"fixed",left:lt,top:Ue}),j(!0))},[H,d,n,t,o,u,D]);l.useLayoutEffect(()=>{if(F)return;if(H&&d){g({position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"calc(100% - 40px)",maxWidth:"calc(100% - 40px)"}),j(!0);return}J();const B=requestAnimationFrame(()=>J());return()=>cancelAnimationFrame(B)},[t,n,o,f,u,F,H,d,J]),l.useEffect(()=>{if(F||H&&d||!w.current||typeof ResizeObserver>"u")return;const B=new ResizeObserver(()=>{t&&J()});return B.observe(w.current),()=>B.disconnect()},[t,f,u,F,H,d,J]),l.useEffect(()=>{if(F||H&&d)return;const B=()=>J(!0);return window.addEventListener("resize",B),document.addEventListener("scroll",B,{passive:!0,capture:!0}),()=>{window.removeEventListener("resize",B),document.removeEventListener("scroll",B,{capture:!0})}},[t,o,f,u,F,H,d,J]),l.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const B=window.matchMedia("(max-width: 768px)"),O=()=>G(!!B.matches);O();try{B.addEventListener?B.addEventListener("change",O):B.addListener(O)}catch{try{B.addListener(O)}catch{}}return()=>{try{B.removeEventListener?B.removeEventListener("change",O):B.removeListener(O)}catch{}}},[]);const Y=l.useRef(!1),W=l.useCallback((B=!1)=>{if(!(b||Y.current)){if(Y.current=!0,B){k(!0);try{r&&r()}catch{}return}k(!0),setTimeout(()=>{r&&r()},200)}},[b,r,k]);l.useEffect(()=>{const B=X=>{const Q=w.current;if(!Q)return;const M=X.target;if(M&&!Q.contains(M)){try{if(M.closest&&M.closest("[data-tooltip-ignore]"))return}catch{}i&&W(!0)}},O=X=>{const Q=w.current;if(!Q)return;const M=X.target;if(M&&!Q.contains(M)){try{if(M.closest&&M.closest("[data-tooltip-ignore]"))return}catch{}i&&W(!0)}},Ce=X=>{if(X.key==="Escape"){X.stopPropagation(),W();return}if(X.key==="Tab"){const Q=w.current;if(!Q)return;const M=Q.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(!M||M.length===0)return;const P=M[0],ne=M[M.length-1],oe=document.activeElement;X.shiftKey?oe===P&&(X.preventDefault(),ne.focus()):oe===ne&&(X.preventDefault(),P.focus())}};return document.addEventListener("pointerdown",B,!0),document.addEventListener("click",O,!0),document.addEventListener("keydown",Ce),()=>{document.removeEventListener("pointerdown",B,!0),document.removeEventListener("click",O,!0),document.removeEventListener("keydown",Ce)}},[r,i,W]),l.useEffect(()=>{const B=()=>{W(!0)};return typeof document<"u"&&document.addEventListener("speechear-close-tooltips",B),()=>{typeof document<"u"&&document.removeEventListener("speechear-close-tooltips",B)}},[W]);const z=V.jsxs("div",{ref:w,className:`tooltip-content ${m?"tooltip-content--bordered":""} ${b?"is-closing":""} ${s} ${H&&d?"is-mobile":""}`,role:c,"aria-label":C||void 0,style:F?{}:{..._,visibility:v?"visible":"hidden"},tabIndex:-1,"data-placement":D,"data-left":F?"":_.left,"data-top":F?"":_.top,"data-anchor-left":t?Math.round(t.left):"","data-anchor-top":t?Math.round(t.top):"","data-anchor-width":t?Math.round(t.width):"","data-anchor-height":t?Math.round(t.height):"",children:[S!=null&&V.jsx("div",{className:"tooltip-content__header h5",children:S}),f]});if(F||typeof document>"u")return z;if(p||H&&d){const B=V.jsxs("div",{className:"tooltip-portal",children:[V.jsx("div",{className:"tooltip-backdrop",onClick:()=>{i&&W(!0)}}),z]});return Bo.createPortal(B,document.body)}return Bo.createPortal(z,document.body)}function Cd(e){const{anchorRect:t,text:n,offset:o=8,onClose:u,className:r="",ariaLabel:i}=e||{};return n?V.jsx(ju,{anchorRect:t,offset:o,onClose:u,closeOnOutsideClick:!1,className:`tooltip-info ${r}`,ariaLabel:i||n,children:V.jsx("div",{className:"tooltip-info__content body-3",children:n})}):null}function Pu(e){const{anchorRect:t,title:n,items:o,activeIndex:u=-1,showIndex:r=!0,onClose:i,offset:s=12}=e||{},c=Array.isArray(o)?o:o?[o]:[];return!c.length&&!n?null:V.jsx(ju,{anchorRect:t,offset:s,onClose:i,closeOnOutsideClick:!0,useBorder:!1,className:"tooltip-description",children:V.jsxs("div",{className:"tooltip-description__box",children:[n&&V.jsx("span",{className:"tooltip-description__title body-2",children:n}),V.jsx("ol",{className:"tooltip-description__items",children:c.map((C,f)=>V.jsxs("li",{className:`tooltip-description__item body-3${f===u?" tooltip-description__item--active":""}`,children:[r&&c.length>1&&V.jsxs("span",{className:"tooltip-description__index button-1",children:[f+1,"."]}),V.jsx("span",{children:C})]},f))})]})})}function yd(e){const{size:t=48,type:n,htmlType:o,href:u,target:r,rel:i,icon:s,rightIcon:c,label:C,count:f,subLabel:p,children:d,ariaLabel:m,variant:S="default",align:w="center",selected:_,toggleable:g=!1,disabled:b=!1,useLabel:k=!0,useBorder:D=!0,useBG:R=!0,useDisabledCovered:v=!1,useDisabledInvisible:j=!1,width:H,minWidth:G,onClick:F,onDisabledClick:J,showTooltipInfo:Y=!1,tooltipInfoText:W=null,tooltipDescription:z=null,iconSize:B="medium",iconColor:O,shape:Ce="rounded",color:X,className:Q,...M}=e,P=typeof t=="string"&&isNaN(Number(t))?t.toLowerCase():String(Number(t)||48),ne=P.match(/^\d+$/)?`button${P}`:`button-${P}`,oe=Number(t),q=!isNaN(oe)&&oe<40?"button-2":"button-1",be=C??d,T=b||!!M.disabled,he=T?v?"disabled-covered":j?"disabled-invisibled":"disabled":S,fe=he?`button--variant-${he}`:"",Ie=w?`button--align-${w}`:"",lt=Ce?`button--shape-${Ce}`:"",Ue=typeof O=="string"&&O.startsWith("--")?`var(${O})`:O,Qe={...H?{width:typeof H=="number"?`${H}px`:H}:{},...G?{minWidth:typeof G=="number"?`${G}px`:G}:{},...D?{}:{"--button-border":T?"0":"1px solid transparent"},...Ue?{"--button-icon-color":Ue}:{},...X?{"--color-main":X}:{}},$e=k===!1?"":be,ee=Array.isArray($e)?$e.length>0:!!$e,et=!!c,ue=n??(ee||s||et?"bar":"dot"),A=`${ne}--${ue}`,L=l.useRef(null),$=l.useRef(T),[K,te]=l.useState(!!_),[Ne,we]=l.useState(!1),[Ge,Fe]=l.useState(null),ye=l.useCallback(()=>we(!1),[]);l.useEffect(()=>{(Y||z)&&T&&Ne&&(we(!1),Fe(null))},[T,Y,z,Ne]),l.useEffect(()=>{typeof _=="boolean"&&te(_)},[_]),l.useEffect(()=>{if($.current&&!T&&L.current){const re=L.current;re.blur(),re.style.pointerEvents="none";const We=requestAnimationFrame(()=>{requestAnimationFrame(()=>{L.current&&(L.current.style.pointerEvents="")})});return()=>cancelAnimationFrame(We)}$.current=T},[T]);const je=typeof _=="boolean"?!!_:K,De=g||typeof _=="boolean"?je?"true":"false":void 0,ct=Ra("button",ne,A,fe,Ie,lt,je?"is-selected":null,R?null:"button--no-bg",Q),Ye=`button__icon button__icon--${B}`,tt=Array.isArray(p)?p:p!==void 0?[p]:[],nt=()=>{if(Array.isArray($e))return $e.map((We,It)=>{const Mt=tt[It];return V.jsxs("span",{className:`button__label-text${Mt!==void 0?" button__label-text--has-sub":""}`,children:[We,Mt!==void 0&&V.jsx("span",{className:"button__sub-label-text caption-1",children:Mt})]},It)});const re=p!==void 0;return V.jsxs("span",{className:`button__label-text${re?" button__label-text--has-sub":""}`,children:[$e,f!=null&&V.jsx("span",{className:"button__count",children:f}),re&&V.jsx("span",{className:"button__sub-label-text caption-1",children:p})]})},ot=re=>{T||(typeof M.onMouseLeave=="function"&&M.onMouseLeave(re),typeof _!="boolean"&&te(!1),re.currentTarget.blur())},kt=re=>{if(T){J?.(re);return}typeof _!="boolean"&&g&&te(We=>!We),F?.(re)},Ct=l.useCallback(()=>{!T&&(Y||z)&&(we(!0),Fe(L.current?.getBoundingClientRect()??null))},[T,Y,z]),Rt=l.useCallback(()=>{(Y||z)&&(we(!1),Fe(null))},[Y,z]),me={...M};delete me.disabled,delete me.className,delete me.faded,delete me.useFaded,delete me.loading,delete me.onMouseLeave,delete me.onPointerEnter,delete me.onPointerLeave,delete me.onFocus,delete me.onBlur,T&&(Object.keys(me).forEach(re=>{/^on[A-Z]/.test(re)&&typeof me[re]=="function"&&delete me[re]}),me["aria-disabled"]="true");const At=(typeof Y=="string"?Y:null)??(typeof W=="string"?W:null)??(typeof m=="string"?m:null)??(typeof be=="string"?be:null)??void 0,wt=typeof m=="string"?m:typeof be=="string"?be:At,ut=(re,We)=>V.jsx(pd,{icon:re,label:We??wt,className:Ye,imgClassName:"button__icon-img",maskClassName:"button__icon-mask",svgClassName:"button__icon-svg"}),dt=()=>ue==="dot"?V.jsxs(V.Fragment,{children:[ut(s),ee&&V.jsx("span",{className:`button__label ${q}`,children:nt()})]}):w==="center"&&s?V.jsxs(V.Fragment,{children:[V.jsxs("span",{className:"button__center-group",children:[V.jsx("span",{className:"button__left",children:ut(s)}),ee&&V.jsx("span",{className:`button__label ${q}`,children:nt()})]}),et&&V.jsx("span",{className:"button__right",children:ut(c)})]}):V.jsxs(V.Fragment,{children:[s&&V.jsx("span",{className:"button__left",children:ut(s,m??be)}),ee&&V.jsx("span",{className:`button__label ${q}`,children:nt()}),et&&V.jsx("span",{className:"button__right",children:ut(c)})]}),qe=!!u&&!T;return V.jsxs(V.Fragment,{children:[V.jsx(qe?"a":"button",{...me,ref:L,...qe?{href:u,target:r,rel:i??(r==="_blank"?"noreferrer":void 0)}:{type:o,disabled:T&&!J},className:ct,"aria-pressed":De,"aria-label":wt,"aria-disabled":qe&&T?!0:void 0,style:Qe,onClick:kt,onMouseLeave:ot,onPointerEnter:re=>{Ct(),!T&&typeof M.onPointerEnter=="function"&&M.onPointerEnter(re)},onPointerLeave:re=>{Rt(),!T&&typeof M.onPointerLeave=="function"&&M.onPointerLeave(re)},onFocus:re=>{Ct(),!T&&typeof M.onFocus=="function"&&M.onFocus(re)},onBlur:re=>{ot(re),Rt(),!T&&typeof M.onBlur=="function"&&M.onBlur(re)},children:dt()}),Ne&&z?V.jsx(Pu,{anchorRect:Ge,title:z.title,items:z.items,onClose:ye}):Ne&&At?V.jsx(Cd,{anchorRect:Ge,text:At,onClose:ye}):null]})}function $u(){const[e,t]=l.useState(null),n=l.useCallback(r=>t(r.getBoundingClientRect()),[]),o=l.useCallback(()=>t(null),[]),u=l.useCallback(r=>{const i=r.getBoundingClientRect();t(s=>s?null:i)},[]);return{anchorRect:e,isOpen:e!=null,openAt:n,close:o,toggleAt:u}}function md(e){const[t,n]=l.useState(null),[o,u]=l.useState(null),r=l.useRef(null);l.useEffect(()=>()=>{r.current&&clearTimeout(r.current)},[]);const i=l.useCallback((c,C)=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{n(c),u(C)},e)},[e]),s=l.useCallback(()=>{r.current&&clearTimeout(r.current),n(null),u(null)},[]);return{payload:t,anchorRect:o,openAfterDelay:i,close:s}}function gd({title:e,items:t}){const{t:n}=mt.useTranslation(),{anchorRect:o,openAt:u,close:r}=$u();return V.jsxs(V.Fragment,{children:[V.jsx(yd,{size:24,type:"dot",icon:"info",variant:"transparent-gray",useBorder:!1,selected:!!o,ariaLabel:n("common.info","\uC124\uBA85"),onPointerEnter:i=>u(i.currentTarget),onPointerLeave:r,onFocus:i=>u(i.currentTarget),onBlur:r}),o&&V.jsx(Pu,{title:e,items:t,showIndex:t.length>1,anchorRect:o,onClose:r})]})}function Fu(){const{t:e}=mt.useTranslation();return l.useMemo(()=>({difficulty:e("wordSearch.filter.difficulty","\uB4F1\uAE09"),syllables:e("wordSearch.filter.syllables","\uC74C\uC808 \uC218"),syllable5plus:e("wordSearch.filter.syllable5plus","5\uC74C\uC808 \uC774\uC0C1"),partOfSpeech:e("wordSearch.filter.partOfSpeech","\uD488\uC0AC"),wordType:e("wordSearch.filter.wordType","\uC720\uD615"),posMap:{[e("wordSearch.filter.pos.noun","\uCCB4\uC5B8(\uBA85\uC0AC, \uC218\uC0AC)")]:["\uBA85","\uC218"],[e("wordSearch.filter.pos.verb","\uC6A9\uC5B8(\uB3D9\uC0AC, \uD615\uC6A9\uC0AC)")]:["\uB3D9","\uD615"],[e("wordSearch.filter.pos.modifier","\uC218\uC2DD\uC5B8(\uBD80\uC0AC, \uAD00\uD615\uC0AC)")]:["\uBD80","\uAD00"]},typeMap:{[e("wordSearch.filter.type.native","\uACE0\uC720\uC5B4")]:"\uACE0\uC720",[e("wordSearch.filter.type.sino","\uD55C\uC790\uC5B4")]:"\uD55C\uC790",[e("wordSearch.filter.type.foreign","\uC678\uB798\uC5B4")]:"\uC678\uB798",[e("wordSearch.filter.type.mixed","\uD63C\uC885\uC5B4")]:"\uD63C\uC885"}}),[e])}function Hu(e,t,n){return{label:t.difficulty,items:[1,2,3,4].map(o=>e("wordSearch.filter.grade",{n:o})),multiple:!0,allOption:!0,allLabel:n?.allLabel,labelAction:n?.labelAction}}function zu(e){return{label:e.partOfSpeech,items:Object.keys(e.posMap),multiple:!0,allOption:!0}}function Vu(e){return{label:e.wordType,items:Object.keys(e.typeMap),multiple:!0,allOption:!0}}function _d(e,t){return{label:t.syllables,items:[e("wordSearch.filter.syllable",{n:1}),e("wordSearch.filter.syllable",{n:2}),e("wordSearch.filter.syllable",{n:3}),e("wordSearch.filter.syllable",{n:4}),t.syllable5plus],multiple:!0,allOption:!0}}function Ed(e,t){const n=[e("wordPairs.filter.onlyHasImage","\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC")];return t?.includeStructure&&n.push(e("wordPairs.filter.onlySameStructure","\uC74C\uC18C \uAD6C\uC870 \uAC19\uC740 \uB2E8\uC5B4\uB9CC")),{label:e("wordPairs.filter.selectLabel","\uC120\uD0DD"),items:n,multiple:!0,labelAction:t?.labelAction}}function bd(e,t){const{label:n,headValue:o,midValue:u,tailValue:r,includeMid:i=!0,headDisabled:s,midDisabled:c,tailDisabled:C,allOptionDisabled:f,groupLabel:p,labelAction:d}=t;return{label:n,...p?{groupLabel:p}:{},...d?{labelAction:d}:{},allOption:!0,allLabel:e("wordSearch.filter.positionAny",{defaultValue:"\uBB34\uAD00"}),...f?{allOptionDisabled:f}:{},items:[{value:o,displayLabel:e("wordSearch.filter.positionHead",{defaultValue:"\uC5B4\uB450"}),disabled:s},...i?[{value:u,displayLabel:e("wordSearch.filter.positionMid",{defaultValue:"\uC5B4\uC911"}),disabled:c}]:[],{value:r,displayLabel:e("wordSearch.filter.positionTail",{defaultValue:"\uC5B4\uB9D0"}),disabled:C}]}}function Sd(e,t,n){if(t===Et){const{[n]:r,...i}=e;return i}const o=e[n]??[],u=o.includes(t)?o.filter(r=>r!==t):[...o,t];if(u.length===0){const{[n]:r,...i}=e;return i}return{...e,[n]:u}}Object.fromEntries(Object.entries(Zr).map(([e,{nucleus:t}])=>[e,t]));const kd={\uACE0\uC720\uC5B4:"\uACE0\uC720",\uD55C\uC790\uC5B4:"\uD55C\uC790",\uC678\uB798\uC5B4:"\uC678\uB798",\uD63C\uC885\uC5B4:"\uD63C\uC885"},Ad={"\uCCB4\uC5B8(\uBA85\uC0AC,\uC218\uC0AC)":["\uBA85","\uC218"],"\uC6A9\uC5B8(\uB3D9\uC0AC,\uD615\uC6A9\uC0AC)":["\uB3D9","\uD615"],"\uC218\uC2DD\uC5B8(\uBD80\uC0AC,\uAD00\uD615\uC0AC)":["\uBD80","\uAD00"]},wd={difficulty:"\uB09C\uC774\uB3C4 \uB4F1\uAE09",syllables:"\uC74C\uC808 \uC218",syllable5plus:"5\uC74C\uC808 \uC774\uC0C1",partOfSpeech:"\uD488\uC0AC",wordType:"\uC720\uD615",posMap:Ad,typeMap:kd};function Md(e,t,n=wd){const o=t[n.difficulty];if(o?.length&&!o.some(s=>e.grade===s.replace(/\D/g,"")))return!1;const u=t[n.syllables];if(u?.length){const s=e.syllables??0;if(!u.some(c=>c===n.syllable5plus?s>=5:s===parseInt(c)))return!1}const r=t[n.partOfSpeech];if(r?.length&&!r.flatMap(s=>n.posMap[s]??[s]).some(s=>(e.pos??"").includes(s)))return!1;const i=t[n.wordType];return!(i?.length&&!i.some(s=>e.wordType===n.typeMap[s]))}const it=(e,t)=>t.map(n=>({jamos:[n],tooltip:e})),Ee=(e,t)=>({jamos:[...e],tooltip:t}),uo={cho:[it("\uC591\uC21C\uC74C",["\u3142","\u3143","\u314D","\u3141"]),it("\uCE58\uC870\uC74C",["\u3137","\u3138","\u314C","\u3134","\u3139"]),it("\uCE58\uC870\uC74C",["\u3145","\u3146"]),it("\uACBD\uAD6C\uAC1C\uC74C",["\u3148","\u3149","\u314A"]),it("\uC5F0\uAD6C\uAC1C\uC74C",["\u3131","\u3132","\u314B"]),it("\uC131\uBB38\uC74C",["\u314E"])],jung:[[Ee("\u3163","\uC804\uC124 \uACE0\uBAA8\uC74C"),Ee("\u315F","\uC804\uC124 \uACE0\uBAA8\uC74C \xB7 w\uD65C\uC74C"),Ee("\u3162","\uC804\uC124 \uACE0\uBAA8\uC74C \xB7 \u0270\uD65C\uC74C")],[Ee("\u3161","\uD6C4\uC124 \uACE0\uBAA8\uC74C \uD3C9\uC21C")],[Ee("\u315C","\uD6C4\uC124 \uACE0\uBAA8\uC74C \uC6D0\uC21C"),Ee("\u3160","\uD6C4\uC124 \uACE0\uBAA8\uC74C \uC6D0\uC21C \xB7 j\uD65C\uC74C")],[Ee("\u3154\u3150","\uC804\uC124 \uC911\uBAA8\uC74C"),Ee("\u3156\u3152","\uC804\uC124 \uC911\uBAA8\uC74C \xB7 j\uD65C\uC74C"),Ee("\u3159\u315A\u315E","\uC804\uC124 \uC911\uBAA8\uC74C \xB7 w\uD65C\uC74C")],[Ee("\u3153","\uD6C4\uC124 \uC911\uBAA8\uC74C \uD3C9\uC21C"),Ee("\u3155","\uD6C4\uC124 \uC911\uBAA8\uC74C \uD3C9\uC21C \xB7 j\uD65C\uC74C"),Ee("\u315D","\uD6C4\uC124 \uC911\uBAA8\uC74C \uD3C9\uC21C \xB7 w\uD65C\uC74C")],[Ee("\u3157","\uD6C4\uC124 \uC911\uBAA8\uC74C \uC6D0\uC21C"),Ee("\u315B","\uD6C4\uC124 \uC911\uBAA8\uC74C \uC6D0\uC21C \xB7 j\uD65C\uC74C")],[Ee("\u314F","\uC800\uBAA8\uC74C"),Ee("\u3151","\uC800\uBAA8\uC74C \xB7 j\uD65C\uC74C"),Ee("\u3158","\uC800\uBAA8\uC74C \xB7 w\uD65C\uC74C")]],jong:[it("\uC591\uC21C\uC74C",["\u3142","\u3141"]),it("\uCE58\uC870\uC74C",["\u3137","\u3134","\u3139"]),it("\uC5F0\uAD6C\uAC1C\uC74C",["\u3131","\u3147"])]},Nd=[...Se],Td=[...rt],xd=Pe.filter(e=>e!==""),st=e=>e===Ze?[]:Array.from(e),Ze="__NO_CODA__",Uu=[1,2,3,4],Je=5,Bd=12,Gu="SYL_",ro=e=>`${Gu}${e}`,Dd=e=>Number(e.slice(Gu.length));function ao(e){return e>=Je?Array.from({length:Bd-Je+1},(t,n)=>Je+n):[e]}const Yu={cho:Nd,jung:Td,jong:xd},io=e=>e.map(t=>t.map(({jamos:n,tooltip:o})=>({v:n.join(""),tooltip:o}))),so={cho:io(uo.cho),jung:io(uo.jung),jong:io(uo.jong)},qu={};so.jung.flat().forEach(({v:e})=>{for(const t of st(e))qu[t]=e});const vd=new Set(so.cho.flat().map(e=>e.v));function Wu(e,t){return e==="cho"?vd.has(t)?t:null:e==="jung"?qu[t]??t:qo(t)}function Ku(e,t,n){if(e==="jung"){const o=st(t);return n&&o.includes(n)?n:o[0]??t}return t}function Xu(e,t,n){const o=(u,r)=>r?u==="jong"&&r===Ze?Ze:t==="pron"?Wu(u,r):Ku(u,r,u==="jung"?n:null):null;return{...e,cho:o("cho",e.cho),jung:o("jung",e.jung),jong:o("jong",e.jong)}}const lo={cho:null,jung:null,jong:null,syllable:null},Od="wt_filter",Zu=e=>`wt_filter_${e}`;function Ld(e){try{const t=localStorage.getItem(Zu(e))??localStorage.getItem(Od);if(t)return JSON.parse(t)}catch{}return null}function Rd(e){const t=e;return t?.composition?{cho:t.composition.cho??null,jung:t.composition.jung??null,jong:t.composition.jong??null,syllable:t.composition.syllable??null}:t?.choseong?{...lo,cho:t.choseong}:lo}function Id(e,t,n){const{t:o,i18n:u}=mt.useTranslation(),[r]=l.useState(()=>n?.resetOnMount?null:Ld(e)),i=r?.contrastCount,s=typeof i=="number"&&Number.isFinite(i)?i:1,[c,C]=l.useState(Math.min(5,Math.max(1,s))),[f,p]=l.useState(r?.phonemeView==="pron"?"pron":r?.phonemeView==="direct"?"direct":"char"),[d,m]=l.useState(()=>Rd(r)),S=l.useCallback(()=>t.requireSyllable?{cho:"\u3131",jung:"\u314F",jong:Ze,syllable:t.fixedSyllable??null}:{cho:null,jung:null,jong:t.fixedNoCoda?Ze:null,syllable:t.fixedSyllable??null},[t.requireSyllable,t.fixedSyllable,t.fixedNoCoda]);l.useEffect(()=>{!t.requireSyllable&&t.fixedSyllable==null&&!t.fixedNoCoda||m(A=>A.cho||A.jung||A.syllable!=null||A.jong?A:S())},[]);const w=l.useMemo(()=>_e(d.cho)||_e(d.jung)||_e(d.jong)?"count":"random",[d.cho,d.jung,d.jong]),_=l.useRef(f==="char"?d.jung:null);l.useEffect(()=>{f==="char"&&(_.current=d.jung)},[f,d.jung]);const[g,b]=l.useState(n?.resetOnMount?!!n?.defaultImageOnly:r?.excludeNoImage??!0),[k,D]=l.useState(n?.resetOnMount?!1:r?.sameStructureOnly??!0),[R,v]=l.useState(Array.isArray(r?.gradeFilter)?r.gradeFilter:[]),[j,H]=l.useState(Array.isArray(r?.posFilter)?r.posFilter:[]),[G,F]=l.useState(Array.isArray(r?.wordTypeFilter)?r.wordTypeFilter:[]),J=l.useRef(n?.resetKey);l.useEffect(()=>{J.current!==n?.resetKey&&(J.current=n?.resetKey,m(S()),b(!1),D(!1),v([]),H([]),F([]),C(1))},[n?.resetKey]);const Y=Fu(),[W,z]=l.useState({cho:new Set,jung:new Set,jong:new Set,syllable:new Set}),[B,O]=l.useState(!1),[Ce,X]=l.useState(null),Q=1,M=Math.max(1,[d.cho,d.jung,d.jong].filter(Boolean).length);l.useEffect(()=>{c<M&&C(M)},[M,c]),l.useEffect(()=>{if(!n?.resetOnMount)try{localStorage.setItem(Zu(e),JSON.stringify({contrastCount:c,composition:d,excludeNoImage:g,sameStructureOnly:k,phonemeView:f,gradeFilter:R,posFilter:j,wordTypeFilter:G}))}catch{}},[n?.resetOnMount,e,c,d,g,k,f,R,j,G]);const[P,ne]=l.useState(0);Oo("wordpool:update",()=>ne(A=>A+1));const oe=l.useRef(u.language);l.useEffect(()=>{oe.current!==u.language&&(oe.current=u.language,ne(A=>A+1))},[u.language]),l.useEffect(()=>{if(!t.choseong)return;let A=!1;return La({difficulty:w,excludeNoImage:g}).then(L=>{A||(z(L),L.cho.size+L.jung.size+L.jong.size>0&&O(!0))}).catch(()=>{A||z({cho:new Set,jung:new Set,jong:new Set,syllable:new Set})}),()=>{A=!0}},[t.choseong,w,g,P]),l.useEffect(()=>{let A=!1;const L=d,$=L.cho?st(L.cho):null,K=L.jung?st(L.jung):null,te=L.jong===Ze,Ne=te?null:L.jong?st(L.jong):null,we=L.syllable!=null?ao(L.syllable):null,Ge=!!($||K||Ne||te||we);return Oa({difficulty:t.difficulty?w:null,contrastCount:t.difficulty?c:1,composition:t.choseong&&Ge?{cho:$,jung:K,jong:Ne,jongNone:te,syllable:we}:null,excludeNoImage:g,sameStructureOnly:k,phonemeView:f==="pron"?"pron":"char",grade:R.length>0?R:null}).then(Fe=>{A||X(Fe)}).catch(()=>{A||X(null)}),()=>{A=!0}},[t.choseong,t.difficulty,w,c,d,f,g,k,P,R]),l.useEffect(()=>{B&&m(A=>{const L={...A};let $=!1;return["cho","jung","jong"].forEach(K=>{const te=A[K];!te||te===Ze||st(te).some(Ne=>W[K].has(Ne))||(L[K]=null,$=!0)}),A.syllable!=null&&t.fixedSyllable==null&&(A.syllable>=Je?[...W.syllable].some(K=>K>=Je)||(L.syllable=null,$=!0):(!W.syllable.has(A.syllable)||A.syllable<Q)&&(L.syllable=null,$=!0)),$?L:A})},[W,B,Q,t.fixedSyllable]);const q=l.useMemo(()=>{const A=L=>{const $=new Set;for(const K of Yu[L])W[L].has(K)&&$.add(K);return $};return{cho:A("cho"),jung:A("jung"),jong:A("jong")}},[W]),be=l.useMemo(()=>({exact:new Set(Uu.filter(A=>W.syllable.has(A))),min:[...W.syllable].some(A=>A>=Je)}),[W]),T=l.useMemo(()=>({diffPhonemeCount:o("training.contrast.diffPhonemeCount",{defaultValue:"\uB2E4\uB978 \uC74C\uC18C\uC758 \uCD1D \uAC2F\uC218"}),composition:o("wordPairs.composition","\uC815\uB2F5 \uB2E8\uC5B4 \uAD6C\uC131"),syllableCount:o("wordPairs.syllableCount","\uC74C\uC808 \uC218"),onset:o("wordPairs.onset","\uCD08\uC131"),vowel:o("wordPairs.vowel","\uBAA8\uC74C"),coda:o("wordPairs.coda","\uC885\uC131"),phonemeGroup:o("training.filter.phonemeGroup",{defaultValue:"\uD6C8\uB828 \uC74C\uC808"}),trainOnset:o("training.filter.trainOnset",{defaultValue:"\uCD08\uC131"}),trainVowel:o("training.filter.trainVowel",{defaultValue:"\uBAA8\uC74C"}),trainCoda:o("training.filter.trainCoda",{defaultValue:"\uC885\uC131"}),random:o("training.filter.random","\uBB34\uC791\uC704"),exclude:o("wordSearch.filter.exclude","\uC81C\uC678"),selectLabel:o("training.filter.selectSection",{defaultValue:"\uC120\uD0DD"}),none:o("common.none","\uC5C6\uC74C"),noImage:o("wordSearch.filter.excludeNoImage","\uC774\uBBF8\uC9C0 \uC5C6\uC74C"),excludeImage:o("training.filter.excludeImage",{defaultValue:"\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC"}),sameStructure:o("training.filter.sameStructure",{defaultValue:"\uC74C\uC18C \uAD6C\uC870 \uAC19\uC740 \uB2E8\uC5B4\uB9CC"}),noLimit:o("training.filter.noLimit",{defaultValue:"\uBB34\uAD00"}),codaExclude:o("training.filter.codaExclude",{defaultValue:"\uC81C\uC678"}),gradeLabel:o("training.filter.gradeLabel",{defaultValue:"\uB09C\uC774\uB3C4 \uB4F1\uAE09"})}),[o]),he=l.useMemo(()=>({[T.trainOnset]:"cho",[T.trainVowel]:"jung",[T.trainCoda]:"jong"}),[T]),fe=l.useCallback((A,L)=>l.createElement(gd,{title:L,items:A}),[]),Ie=l.useMemo(()=>[o("training.filter.excludeImageInfo",{defaultValue:"\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC: \uB2E8\uC5B4 \uC911\uC5D0 \uC774\uBBF8\uC9C0\uAC00 \uC788\uB294 \uB2E8\uC5B4\uB9CC \uACB0\uACFC\uC5D0 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4."}),o("training.filter.sameStructureInfo",{defaultValue:"\uC74C\uC18C \uAD6C\uC870 \uAC19\uC740 \uB2E8\uC5B4\uB9CC: \uC815\uB2F5\uACFC \uC624\uB2F5\uC758 \uC74C\uC808 \uAD6C\uC870(\uAE00\uC790 \uC218\xB7\uBC1B\uCE68 \uC720\uBB34 \uB4F1)\uAC00 \uAC19\uC740 \uACB0\uACFC\uB9CC \uB0A8\uACA8\uC694."})],[o]),lt=l.useMemo(()=>{const A=[];if(t.choseong){const L={value:Ze,displayLabel:T.codaExclude},$=t.fixedNoCoda===!0,K=(te,Ne)=>{const we=$&&te==="jong",Ge={label:Ne,groupLabel:T.phonemeGroup,allOption:!t.requireSyllable,allLabel:T.noLimit,allOptionDisabled:we};if(f==="pron"){const ye=so[te].map(je=>je.map(({v:De,tooltip:ct})=>{const Ye=st(De),tt=we||!Ye.some(nt=>W[te].has(nt));return Ye.length>1?{value:De,labels:Ye,tooltip:ct,disabled:tt}:{value:De,tooltip:ct,disabled:tt}}));return te==="jong"&&!t.requireCoda&&ye.unshift([L]),{...Ge,groups:ye}}const Fe=Yu[te].map(ye=>!we&&q[te].has(ye)?ye:{value:ye,disabled:!0});return{...Ge,items:te==="jong"&&!t.requireCoda?[L,...Fe]:Fe}};A.push(K("cho",T.trainOnset)),A.push(K("jung",T.trainVowel)),A.push(K("jong",T.trainCoda))}if(A.push({...Hu(o,Y,{labelAction:fe([o("wordPairs.filter.difficultyInfo",{defaultValue:"\uAD6D\uB9BD\uAD6D\uC5B4\uC6D0\uC758 \uAE30\uCD08 \uC5B4\uD718 \uB4F1\uAE09\uC774 \uACB0\uACFC\uC5D0 \uBC18\uC601\uB429\uB2C8\uB2E4."})])}),label:T.gradeLabel}),t.partOfSpeech&&A.push(zu(Y)),t.wordType&&A.push(Vu(Y)),t.choseong||t.fixedSyllable!=null){const L=t.fixedSyllable;A.push({label:T.syllableCount,items:[...Uu.map($=>({value:ro($),displayLabel:o("wordPairs.syllableN",{n:$,defaultValue:"{{n}}\uC74C\uC808"}),disabled:L!=null?$!==L:!be.exact.has($)||$<Q})),{value:ro(Je),displayLabel:o("wordPairs.syllableNPlus",{n:Je,defaultValue:"{{n}}\uC74C\uC808 \uC774\uC0C1"}),disabled:L!=null?Je!==L:!be.min}],allOption:!0,allOptionDisabled:L!=null})}return t.choseong?A.push({label:T.exclude,displayLabel:T.selectLabel,multiple:!0,items:[T.excludeImage,T.sameStructure],labelAction:fe(Ie)}):A.push({label:T.exclude,displayLabel:T.selectLabel,multiple:!0,items:[T.excludeImage],labelAction:fe([Ie[0]])}),A},[t.choseong,t.partOfSpeech,t.wordType,t.requireSyllable,t.fixedSyllable,t.fixedNoCoda,t.requireCoda,Q,q,W,f,be,T,o,fe,Ie,Y]),Ue={...t.difficulty?{[T.diffPhonemeCount]:String(c)}:{},...(t.choseong||t.fixedSyllable!=null)&&d.syllable!=null?{[T.syllableCount]:ro(d.syllable)}:{},...t.choseong&&d.cho?{[T.trainOnset]:d.cho}:{},...t.choseong&&d.jung?{[T.trainVowel]:d.jung}:{},...t.choseong&&d.jong?{[T.trainCoda]:d.jong}:{},[T.exclude]:[...g?[T.excludeImage]:[],...k?[T.sameStructure]:[]],[T.gradeLabel]:R.map(A=>o("wordSearch.filter.grade",{n:Number(A),defaultValue:"{{n}}\uB4F1\uAE09"})),...t.partOfSpeech?{[Y.partOfSpeech]:j}:{},...t.wordType?{[Y.wordType]:G}:{}},Qe=l.useCallback((A,L)=>{if(L===T.diffPhonemeCount){const $=Number(A);$>=1&&C($)}else if(L===T.exclude)A===T.excludeImage?b($=>!$):A===T.sameStructure&&D($=>!$);else if(L===T.syllableCount)m($=>{if(!A||A===Et)return{...$,syllable:null};const K=Dd(A);return{...$,syllable:$.syllable===K?null:K}});else if(L===T.gradeLabel){if(!A||A===Et){v([]);return}const $=A.replace(/\D/g,"");v(K=>K.includes($)?K.filter(te=>te!==$):[...K,$])}else if(L===Y.partOfSpeech){if(!A||A===Et){H([]);return}H($=>$.includes(A)?$.filter(K=>K!==A):[...$,A])}else if(L===Y.wordType){if(!A||A===Et){F([]);return}F($=>$.includes(A)?$.filter(K=>K!==A):[...$,A])}else{const $=he[L];if(!$)return;m(K=>t.requireSyllable?A&&A!==Et?{...K,[$]:A}:K:!A||A===Et||K[$]===A?{...K,[$]:null}:{...K,[$]:A})}},[T,he,Y,t.requireSyllable]),$e=l.useCallback(A=>!t.partOfSpeech&&!t.wordType?!0:Md(A,{...t.partOfSpeech?{[Y.partOfSpeech]:j}:{},...t.wordType?{[Y.wordType]:G}:{}},Y),[t.partOfSpeech,t.wordType,j,G,Y]),ee=l.useCallback(A=>{A!==f&&(A!=="direct"&&f!=="direct"&&m(L=>Xu(L,A,_.current)),p(A))},[f]),et=l.useCallback(()=>({composition:d,contrastCount:c,excludeNoImage:g,sameStructureOnly:k,phonemeView:f,gradeFilter:R}),[d,c,g,k,f,R]),ue=l.useCallback(A=>{m(A.composition),C(A.contrastCount),b(A.excludeNoImage),D(A.sameStructureOnly??!0),p(A.phonemeView),v(Array.isArray(A.gradeFilter)?A.gradeFilter:[])},[]);return{difficulty:w,contrastCount:c,composition:d,choseong:d.cho,excludeNoImage:g,sameStructureOnly:k,gradeFilter:R,posFilter:j,wordTypeFilter:G,matchesWordAttributes:$e,poolVersion:P,filterSections:lt,filterSelected:Ue,handleFilterSelect:Qe,phonemeView:f,setPhonemeView:ee,phonemeGroupLabel:T.phonemeGroup,wordCount:Ce,getFilterSnapshot:et,restoreFilterSnapshot:ue}}function jd(e){const t=s=>s?st(s):null,n=t(e.cho),o=t(e.jung),u=e.jong===Ze,r=u?null:t(e.jong),i=e.syllable!=null?ao(e.syllable):null;return!n&&!o&&!r&&!u&&!i?null:{cho:n,jung:o,jong:r,jongNone:u,syllable:i}}function Pd(e,t,n,o,u,r,i=!0,s="char",c=[]){const[C,f]=l.useState({}),[p,d]=l.useState(!1),{cho:m=null,jung:S=null,jong:w=null,syllable:_=null}=o??{},g=c.length>0?c.slice().sort().join(","):"";return l.useEffect(()=>{r>0&&va(u).catch(()=>{})},[r,u]),l.useEffect(()=>{let b=!1;return d(!0),(async()=>{const k=jd({cho:m,jung:S,jong:w,syllable:_}),D=`${m??""}_${S??""}_${w??""}_${_??""}_${g}`,R={};await Promise.all(e.map(async v=>{const j=Fn[v.key];try{const H=await iu(v.key,{difficulty:j.difficulty?t:null,contrastCount:j.difficulty?n:1,composition:j.choseong?k:null,count:5,excludeNoImage:u,sameStructureOnly:i,phonemeView:s,grade:c.length>0?c:null});H&&H.length>0?R[v.key]={id:`wt-${v.key}-${t}-${D}-${Date.now()}`,name:v.label,training_type:v.key,category_main_code:"WORD",iconColor:v.color,subTitle:v.subTitle,items:H,itemCount:H.length}:R[v.key]={id:`wt-${v.key}-empty`,name:v.label,training_type:v.key,category_main_code:"WORD",iconColor:v.color,subTitle:v.subTitle,items:[],itemCount:0,__empty:!0}}catch{R[v.key]=null}})),b||(f(R),d(!1))})(),()=>{b=!0}},[t,n,m,S,w,_,u,i,s,r,g]),{perTypeData:C,generating:p}}function $d(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function Fd(e){let t=e>>>0;return()=>{t|=0,t=t+1831565813|0;let n=Math.imul(t^t>>>15,1|t);return n=n+Math.imul(n^n>>>7,61|n)^n,((n^n>>>14)>>>0)/4294967296}}const Mn=at;function co(e,t){const n=t?Fd($d(t)):Math.random;return{LISTEN_IN_NOISE:Mn(Zt,Math.max(0,e.LISTEN_IN_NOISE||0),n),SHORT_STORY:Mn(Jt,Math.max(0,e.SHORT_STORY||0),n),LONG_STORY:Mn(Qt,Math.max(0,e.LONG_STORY||0),n),ORDERING_SENTENCE:Mn(en,Math.max(0,e.ORDERING_SENTENCE||0),n)}}function Ju(e){return e?!!(e.LISTEN_IN_NOISE?.length||e.SHORT_STORY?.length||e.LONG_STORY?.length||e.ORDERING_SENTENCE?.length):!1}const Hd={LISTEN_IN_NOISE:3,SHORT_STORY:2,LONG_STORY:1,ORDERING_SENTENCE:2};function Qu(e=!1,t=Hd,n){const o=kn(Date.now()),u=kn(Date.now()-864e5),r=`${n??""}|${o}`,i=`${n??""}|${u}`;return Zt.length>0||Jt.length>0||Qt.length>0||en.length>0?{today:co(t,r),yesterday:co(t,i)}:{today:co(t,r),yesterday:null}}function zd(e){const t=l.useRef({LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]}),n=l.useRef(null),[o,u]=l.useState(!1),[r,i]=l.useState(!1),[s,c]=l.useState(0);l.useEffect(()=>{let f=!1,p,d=0;const m=40,S=()=>{p!==void 0&&(clearInterval(p),p=void 0)};let w=!1;try{const b=new URLSearchParams(window.location.search),k=b.get("forceRefresh")||b.get("force");w=k==="1"||k==="true"}catch{}const _=b=>{t.current=b.today,n.current=b.yesterday,u(!0),c(k=>k+1),f=!0,S()},g=async()=>{if(f)return;if(!w){const k=Qu(!1,void 0,e);if(Ju(k.today)){_(k);return}}try{await sd(3e3)}catch{}if(f)return;const b=Qu(w,void 0,e);if(Ju(b.today)){_(b);return}++d>=m&&(u(!0),f=!0,S())};return g(),p=setInterval(g,250),()=>{f=!0,S()}},[e]);const C=l.useCallback(f=>{const p=r?n.current:t.current,d=r?t.current:n.current;return p?.[f]?.length?p[f]:d?.[f]?.length?d[f]:void 0},[r,s]);return{loaded:o,showYesterday:r,setShowYesterday:i,getTrainingPerType:C}}const Lt=[];let Nn=!1;function er(e){if(e.key!=="Escape"||e.defaultPrevented)return;const t=Lt[Lt.length-1];t&&(e.stopPropagation(),t())}function Vd(e){return Lt.push(e),!Nn&&typeof document<"u"&&(document.addEventListener("keydown",er),Nn=!0),()=>{const t=Lt.lastIndexOf(e);t>=0&&Lt.splice(t,1),Lt.length===0&&Nn&&typeof document<"u"&&(document.removeEventListener("keydown",er),Nn=!1)}}function Ud(e,t=!0){const n=vo(e);l.useEffect(()=>{if(t)return Vd(()=>{n.current?.()})},[t,n])}const ho=(e,t)=>`${e}:${t??1}`,fo=new Map;function Gd(e,t){const[n,o]=l.useState(0),u=e.map(r=>ho(r.word,r.homonum)).join("|");return l.useEffect(()=>{const r=(u?u.split("|"):[]).filter(c=>!fo.has(c));if(r.length===0)return;let i=!1;const s=Array.from(new Set(r.map(c=>c.slice(0,c.lastIndexOf(":")))));return t(s).then(c=>{if(!(i||c.length===0)){for(const C of c)C.Meaning&&fo.set(ho(C.Word,C.Homonum??void 0),C.Meaning);o(C=>C+1)}}),()=>{i=!0}},[u,t]),l.useMemo(()=>{const r=u?u.split("|"):[],i=new Map;for(const s of r){const c=fo.get(s);c!=null&&i.set(s,c)}return i},[u,n])}function Yd(e,t,n){const o=Number.isFinite(t)&&t>=1?Math.floor(t):1,u=Math.max(1,Math.ceil(e.length/o)),r=Number.isFinite(n)?Math.min(Math.max(1,Math.floor(n)),u):1;return{pageItems:l.useMemo(()=>e.slice((r-1)*o,r*o),[e,r,o]),totalPages:u,curPage:r}}function qd(e="warning"){const[t,n]=l.useState(""),[o,u]=l.useState(e),[r,i]=l.useState(0),s=l.useCallback((p,d)=>{u(d),n(p),i(m=>m+1)},[]),c=l.useCallback(p=>s(p,"warning"),[s]),C=l.useCallback(p=>s(p,"normal"),[s]),f=l.useCallback(()=>n(""),[]);return{toastMessage:t,toastType:o,toastKey:r,showToast:s,showWarning:c,showNormal:C,clearToast:f}}const nn={blue:"#60A5FA",green:"#4ADE80",amber:"#FBBF24",purple:"#A78BFA",pink:"#F472B6"},on=nn.blue,Tn=nn.green,un=nn.amber,xn=nn.purple,Wd=nn.pink,Kd=[{key:"discrimination",label:"\uBCC0\uBCC4\uD6C8\uB828",disc:"\uB450 \uC18C\uB9AC\uAC00 \uAC19\uC740\uC9C0 \uB2E4\uB978\uC9C0, \uB610\uB294 \uD2B9\uC815 \uC18C\uB9AC\uB97C \uAD6C\uBCC4\uD558\uB294 \uD6C8\uB828\uC785\uB2C8\uB2E4.",icon:"ear",types:[{key:"SAME_SOUND_PICK",label:"\uAC19\uC740 \uC18C\uB9AC \uACE0\uB974\uAE30",icon:"volume-2",color:on,subTitle:"\uB4E4\uC740 \uC18C\uB9AC\uC640 \uAC19\uC740 \uB2E8\uC5B4 \uCE74\uB4DC\uB97C \uACE0\uB974\uC138\uC694."},{key:"SAME_OR_DIFF",label:"\uAC19\uC740\uC9C0 \uB2E4\uB978\uC9C0 \uB9DE\uD788\uAE30",icon:"diff",color:on,subTitle:"\uB450 \uC18C\uB9AC\uAC00 \uAC19\uC740\uC9C0, \uB2E4\uB978\uC9C0 \uAD6C\uBD84\uD558\uC138\uC694."},{key:"HEAR_AND_PICK_SAME",label:"\uC77C\uCE58\uD558\uB294 \uB2E8\uC5B4 \uB9DE\uD788\uAE30",icon:"headphones",color:on,subTitle:"\uB4E4\uC740 \uC18C\uB9AC\uC758 \uB2E8\uC5B4 \uCE74\uB4DC\uB97C \uACE0\uB974\uC138\uC694."},{key:"HEAR_AND_PICK_INCLUDED",label:"\uD55C \uC74C\uC808 \uD3EC\uD568 \uB2E8\uC5B4 \uB9DE\uD788\uAE30",icon:"scan-search",color:on,subTitle:"\uB4E4\uC740 \uC74C\uC808\uC774 \uD3EC\uD568\uB41C \uB2E8\uC5B4 \uCE74\uB4DC\uB97C \uACE0\uB974\uC138\uC694."},{key:"STARTS_WITH_SAME_SOUND",label:"\uCCAB \uC74C\uC808\uC774 \uAC19\uC740 \uB2E8\uC5B4 \uB9DE\uD788\uAE30",icon:"play-circle",color:on,subTitle:"\uB4E4\uC740 \uB2E8\uC5B4\uC640 \uAC19\uC740 \uC18C\uB9AC\uB85C \uC2DC\uC791\uD558\uB294 \uB2E8\uC5B4\uB97C \uACE0\uB974\uC138\uC694."}]},{key:"synthesis",label:"\uD569\uC131\uD6C8\uB828",disc:"\uB450 \uAC1C \uC774\uC0C1\uC758 \uC74C\uC808\uC774\uB098 \uC74C\uC18C\uB97C \uD569\uCCD0 \uB2E8\uC5B4\uB97C \uB9CC\uB4DC\uB294 \uD6C8\uB828\uC785\uB2C8\uB2E4.",icon:"git-merge",types:[{key:"MERGE_2_SYLLABLES",label:"\uC74C\uC808 2\uAC1C \uD569\uCE58\uAE30",icon:"link-2",color:Tn,subTitle:"\uB450 \uC74C\uC808\uC744 \uD569\uCE58\uBA74 \uC5B4\uB5A4 \uB2E8\uC5B4\uAC00 \uB420\uAE4C\uC694?"},{key:"MERGE_3_SYLLABLES",label:"\uC74C\uC808 3\uAC1C \uD569\uCE58\uAE30",icon:"git-merge",color:Tn,subTitle:"\uC138 \uC74C\uC808\uC744 \uD569\uCE58\uBA74 \uC5B4\uB5A4 \uB2E8\uC5B4\uAC00 \uB420\uAE4C\uC694?"},{key:"MERGE_2_PHONEMES",label:"\uC74C\uC18C 2\uAC1C \uD569\uCE58\uAE30",icon:"combine",color:Tn,subTitle:"\uB450 \uC74C\uC18C\uB97C \uD569\uCE58\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB420\uAE4C\uC694?"},{key:"MERGE_3_PHONEMES",label:"\uC74C\uC18C 3\uAC1C \uD569\uCE58\uAE30",icon:"braces",color:Tn,subTitle:"\uC138 \uC74C\uC18C\uB97C \uD569\uCE58\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB420\uAE4C\uC694?"}]},{key:"deletion",label:"\uD0C8\uB77D\uD6C8\uB828",disc:"\uB2E8\uC5B4\uC5D0\uC11C \uC74C\uC808\uC774\uB098 \uC74C\uC18C\uB97C \uC81C\uAC70\uD588\uC744 \uB54C \uB0A8\uB294 \uC18C\uB9AC\uB97C \uC778\uC2DD\uD558\uB294 \uD6C8\uB828\uC785\uB2C8\uB2E4.",icon:"scissors",types:[{key:"DROP_1_FROM_2SYLL",label:"2\uC74C\uC808\uC5D0\uC11C 1\uC74C\uC808 \uD0C8\uB77D",icon:"scissors",color:un,subTitle:"2\uC74C\uC808 \uB2E8\uC5B4\uC5D0\uC11C \uD55C \uC74C\uC808\uC744 \uBE7C\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB420\uAE4C\uC694?"},{key:"DROP_1_FROM_3SYLL",label:"3\uC74C\uC808\uC5D0\uC11C 1\uC74C\uC808 \uD0C8\uB77D",icon:"minus-circle",color:un,subTitle:"3\uC74C\uC808 \uB2E8\uC5B4\uC5D0\uC11C \uD55C \uC74C\uC808\uC744 \uBE7C\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB420\uAE4C\uC694?"},{key:"DROP_PART_FROM_COMPOUND",label:"\uD569\uC131\uC5B4\uC5D0\uC11C \uBD80\uBD84\uD0C8\uB77D",icon:"unlink",color:un,subTitle:"\uD569\uC131\uC5B4\uC758 \uC77C\uBD80\uB97C \uBE7C\uBA74 \uC5B4\uB5A4 \uB2E8\uC5B4\uAC00 \uB420\uAE4C\uC694?"},{key:"DROP_FINAL_CONSONANT_FROM_1SYLL",label:"1\uC74C\uC808\uC5D0\uC11C \uBC1B\uCE68 \uD0C8\uB77D",icon:"eraser",color:un,subTitle:"\uBC1B\uCE68\uC744 \uBE7C\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB420\uAE4C\uC694?"},{key:"REMOVE_CONSONANT_AND_IDENTIFY_PHONEME",label:"1\uC74C\uC808\uC5D0\uC11C \uC790\uC74C \uD0C8\uB77D",icon:"audio-lines",color:un,subTitle:"\uC790\uC74C\uC744 \uBE7C\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB0A8\uC744\uAE4C\uC694?"}]},{key:"substitution",label:"\uB300\uCE58\uD6C8\uB828",disc:"\uB2E8\uC5B4\uC758 \uC77C\uBD80 \uC74C\uC808\uC774\uB098 \uC74C\uC18C\uB97C \uBC14\uAFB8\uC5B4 \uC0C8\uB85C\uC6B4 \uC18C\uB9AC\uB97C \uB9CC\uB4DC\uB294 \uD6C8\uB828\uC785\uB2C8\uB2E4.",icon:"replace",types:[{key:"CHANGE_1_SYLL_IN_2SYLL",label:"2\uC74C\uC808\uC5D0\uC11C \uD55C \uC74C\uC808 \uBC14\uAFB8\uAE30",icon:"replace",color:xn,subTitle:"2\uC74C\uC808 \uB2E8\uC5B4\uC758 \uD55C \uC74C\uC808\uC744 \uBC14\uAFD4 \uC0C8 \uB2E8\uC5B4\uB97C \uB9CC\uB4DC\uC138\uC694."},{key:"CHANGE_1_SYLL_IN_3SYLL",label:"3\uC74C\uC808\uC5D0\uC11C \uD55C \uC74C\uC808 \uBC14\uAFB8\uAE30",icon:"shuffle",color:xn,subTitle:"3\uC74C\uC808 \uB2E8\uC5B4\uC758 \uD55C \uC74C\uC808\uC744 \uBC14\uAFD4 \uC0C8 \uB2E8\uC5B4\uB97C \uB9CC\uB4DC\uC138\uC694."},{key:"CHANGE_1_PHONEME_IN_1SYLL",label:"1\uC74C\uC808\uC5D0\uC11C \uD55C \uC74C\uC18C \uBC14\uAFB8\uAE30",icon:"arrow-right-left",color:xn,subTitle:"1\uC74C\uC808 \uB2E8\uC5B4\uC758 \uD55C \uC74C\uC18C\uB97C \uBC14\uAFD4 \uC0C8 \uC18C\uB9AC\uB97C \uB9CC\uB4DC\uC138\uC694."},{key:"CHANGE_1_PHONEME_IN_2SYLL",label:"2\uC74C\uC808\uC5D0\uC11C \uD55C \uC74C\uC18C \uBC14\uAFB8\uAE30",icon:"flip-horizontal",color:xn,subTitle:"2\uC74C\uC808 \uB2E8\uC5B4\uC758 \uD55C \uC74C\uC18C\uB97C \uBC14\uAFD4 \uC0C8 \uB2E8\uC5B4\uB97C \uB9CC\uB4DC\uC138\uC694."}]},{key:"attention",label:"\uCCAD\uAC01\uC801\uC8FC\uC758\uB825\uD6C8\uB828",disc:"\uC5EC\uB7EC \uC18C\uB9AC\uB97C \uB4E3\uACE0 \uC21C\uC11C\uB97C \uAE30\uC5B5\uD558\uB294 \uC8FC\uC758\uB825\uACFC \uB2E8\uAE30 \uAE30\uC5B5 \uD6C8\uB828\uC785\uB2C8\uB2E4.",icon:"list-ordered",types:[{key:"LISTEN_AND_REMEMBER_ORDER",label:"\uB4E3\uACE0 \uC21C\uC11C\uB300\uB85C \uAE30\uC5B5\uD558\uAE30",icon:"list-ordered",color:Wd,subTitle:"\uC138 \uB2E8\uC5B4\uB97C \uB4E4\uC740 \uC21C\uC11C\uB300\uB85C \uCE74\uB4DC\uB97C \uC120\uD0DD\uD558\uC138\uC694."}]}];function Xd(){const{t:e}=mt.useTranslation();return l.useMemo(()=>{const t=Object.fromEntries(dd(e).map(o=>[o.key,o.label])),n={...t};return Kd.flatMap(o=>o.types).forEach(o=>{n[o.key]=e(`trainingType.${o.key}.label`,{defaultValue:o.label})}),{sentence:t,all:n}},[e])}exports.CACHE_GROUPS=Ho,exports.DocumentTitleSuppressContext=Ro,exports.EMPTY_COMPOSITION=lo,exports.MediaQueryOverrideContext=Do,exports.NO_CODA=Ze,exports.SYLLABLE_MIN=Je,exports.VAP_PAGE_SIZE_OPTIONS=Go,exports.buildGradeSection=Hu,exports.buildPartOfSpeechSection=zu,exports.buildPositionSection=bd,exports.buildSelectSection=Ed,exports.buildSyllableSection=_d,exports.buildWordTypeSection=Vu,exports.charToPronValue=Wu,exports.convertComposition=Xu,exports.fmtBytes=jr,exports.lsBytes=zo,exports.meaningKey=ho,exports.pronToCharValue=Ku,exports.syllableToFilter=ao,exports.today=zt,exports.toggleAttributeFilter=Sd,exports.useCacheManagement=Pr,exports.useDailyTrainingSelection=zd,exports.useDelayedHoverAnchor=md,exports.useDeviceManagement=qr,exports.useDocumentTitle=Er,exports.useEscToClose=Ud,exports.useFontScale=mr,exports.useHoverAnchor=$u,exports.useMediaQuery=_r,exports.usePagedList=Yd,exports.usePasswordChange=Sr,exports.useRelativeDay=br,exports.useTablePaging=Gr,exports.useTableSort=Yr,exports.useToastState=qd,exports.useTrainingTypeLabels=Xd,exports.useVisitAllPanel=Ur,exports.useVisitHistory=Hr,exports.useVisitSchedule=Vr,exports.useWindowEvent=Oo,exports.useWordAttributeFilterKeys=Fu,exports.useWordDataStats=$r,exports.useWordMeanings=Gd,exports.useWordTrainingDataGeneration=Pd,exports.useWordTrainingFilter=Id,exports.valueToJamos=st;