@ihabdevteam/core 0.9.2 → 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
@@ -780,4 +780,4 @@
780
780
  * See the LICENSE file in the root directory of this source tree.
781
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
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??{};return l.useEffect(()=>{r>0&&va(u).catch(()=>{})},[r,u]),l.useEffect(()=>{let g=!1;return d(!0),(async()=>{const b=jd({cho:m,jung:S,jong:w,syllable:_}),k=c.length>0?c.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: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}})),g||(f(R),d(!1))})(),()=>{g=!0}},[t,n,m,S,w,_,u,i,s,r,c]),{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;
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;