@ihabdevteam/core 0.338.0 → 0.339.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -0
- package/dist/components.cjs.js +10 -10
- package/dist/hooks.cjs.js +1 -1
- package/dist/i18n.cjs.js +1 -1
- package/dist/ihabdevteam-core.cjs.js +16 -16
- package/dist/ihabdevteam-core.d.ts +1 -1
- package/dist/packages/core/src/components/BrandLogo.js +6 -2
- package/dist/packages/core/src/hooks/useInlineSvg.d.ts +15 -0
- package/dist/packages/core/src/hooks/useInlineSvg.js +36 -0
- package/dist/packages/core/src/version.d.ts +1 -1
- package/dist/packages/core/src/version.js +1 -1
- package/dist/utils.cjs.js +1 -1
- package/package.json +1 -1
package/dist/components.cjs.js
CHANGED
|
@@ -848,18 +848,18 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
848
848
|
\uC2E0\uB8B0\uB97C \uC313\uACE0
|
|
849
849
|
\uD68C\uBCF5\uC744 \uB3D5\uC2B5\uB2C8\uB2E4.`,site:{title:"\uC0AC\uC774\uD2B8",malgwi:"\uB9D0\uADC0",soundDirection:"\uC18C\uB9AC\uBC29\uD5A5\uC131\uC2DC\uC2A4\uD15C",vrSoundDirection:"VR\uC18C\uB9AC\uBC29\uD5A5\uC131\uC2DC\uC2A4\uD15C",hearingTest:"\uCCAD\uB825\uD14C\uC2A4\uD2B8 \uD504\uB85C"},sns:{title:"SNS",naverBlog:"\uB124\uC774\uBC84 \uBE14\uB85C\uADF8",kakao:"KAKAO Talk \uC624\uD508\uCC44\uD305"},policy:{title:"\uC815\uCC45",terms:"\uC774\uC6A9\uC57D\uAD00",privacy:"\uAC1C\uC778\uC815\uBCF4 \uCC98\uB9AC\uBC29\uCE68"},ceo:"\uB300\uD45C",address:"\uC8FC\uC18C",support:"\uACE0\uAC1D\uC13C\uD130",ceoName:"\uD55C\uC9C0\uD61C",addressValue:"\uAC15\uC6D0\uB3C4 \uCD98\uCC9C\uC2DC \uC2DC\uCCAD\uAE38 32 \uD574\uCC2C\uBE4C\uB529 3\uCE35 302\uD638"},_g={trainingPhone:{topic:"\uD143\uBC2D\uAC00\uAFB8\uAE30",prev:"\uC774\uC804",next:"\uB2E4\uC74C",speed:"\uBE60\uB974\uAE30 3",noiseType:"\uC640\uAE00\uC640\uAE00",settings:"\uC124\uC815",start:{caption:"\uC544\uB798 \uD50C\uB808\uC774(\u25B6) \uBC84\uD2BC\uC744 \uB20C\uB7EC \uBB38\uC7A5\uC744 \uC798 \uB4E4\uC5B4\uBCF4\uC138\uC694. \uC798 \uB4E4\uC73C\uC2E0 \uB4A4 \uBB38\uC7A5\uC744 \uD655\uC778\uD558\uC138\uC694."},feedback:{caption:"\uC798 \uD0A4\uC6B4 \uBAA8\uC885\uC744 \uD143\uBC2D\uC5D0 \uC2EC\uACE0 \uBE44\uB2D0\uC744 \uC798 \uB36E\uC5B4 \uC90D\uB2C8\uB2E4."},done:{heardWell:"\uC798 \uB4E4\uB9B0 \uBB38\uC7A5",listenAgain:"\uD55C \uBC88 \uB354 \uB4E3\uAE30"}}},wg={timeHM:"{{h}}\uC2DC {{m}}\uBD84",timeH:"{{h}}\uC2DC"},Bg={options:"\uD6C8\uB828 \uC635\uC158",difficulty:"\uB09C\uC774\uB3C4",exclude:"\uC81C\uC678",chosung:"\uCD08\uC131",excludeOptions:{none:"\uC5C6\uC74C",noImage:"\uC774\uBBF8\uC9C0 \uC5C6\uC74C"}},kg={answer:"\uC815\uB2F5",distractor:"\uC624\uB2F5"},Ag={phaseWordDownload:"\uB2E8\uC5B4 \uB370\uC774\uD130 \uB2E4\uC6B4\uB85C\uB4DC",phaseImageCheck:"\uC774\uBBF8\uC9C0 \uD655\uC778",phasePairAnalysis:"\uB2E8\uC5B4\uC30D \uBD84\uC11D",downloadingCount:"{{n}}\uAC1C \uB2E4\uC6B4\uB85C\uB4DC \uC911",checkingPage:"{{page}}\uD398\uC774\uC9C0 \uBAA9\uB85D \uD655\uC778 \uC911",imageCount:"{{done}} / {{total}}\uAC1C"},Ng={clearAriaLabel:"\uC785\uB825\uAC12 \uC9C0\uC6B0\uAE30"},Eg={ariaLabel:"\uC120\uD0DD \uD0ED"},Dg={ariaLabel:"\uD0ED"},Sg={dragPrompt:"\uD30C\uC77C\uC744 \uC774\uACF3\uC5D0 \uB4DC\uB798\uADF8\uD558\uC5EC \uC5C5\uB85C\uB4DC",browseButton:"\uD30C\uC77C \uC120\uD0DD",removeAriaLabel:"{{name}} \uC81C\uAC70"},Tg={ariaLabel:"\uC0AC\uC6A9\uC790 \uC544\uBC14\uD0C0"},jg={relativeDay:{today:"\uC624\uB298",yesterday:"\uC5B4\uC81C",daysAgo:"{{n}}\uC77C \uC804"},reason:{notLoggedIn:"\uB85C\uADF8\uC778\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},list:{title:"\uBC1B\uC740 \uC219\uC81C"},status:{expired:"\uB9CC\uB8CC\uB428",done:"\uC644\uB8CC {{count}}\uD68C \xB7 {{date}}",notDone:"\uBBF8\uC644\uB8CC"}},Mg={weekly:{title:"\uC8FC\uAC04 \uD6C8\uB828 \uD604\uD669",daily:"\uC624\uB298\uC758 \uB4E3\uAE30",crossword:"\uAC00\uB85C\uC138\uB85C"},homework:{title:"\uC219\uC81C \uC9C4\uD589\uD604\uD669",totalRate:"\uC804\uCCB4 \uC644\uB8CC\uC728",count:"\uC804\uCCB4",done:"\uC644\uB8CC",remaining:"\uBBF8\uC644\uB8CC"},today:{tooltipTotal:"\uC804\uCCB4",tooltipDone:"\uC644\uB8CC"},filter:{countSuffix:" \uD6C8\uB828"},time:{countLabel:"{{n}}\uD68C \uD6C8\uB828",empty:"\uD6C8\uB828 \uAE30\uB85D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."},daily:{title:"\uC624\uB298\uC758 \uB4E3\uAE30 \uAE30\uB85D",empty:"\uC644\uB8CC\uD55C \uD68C\uCC28\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."},crossword:{title:"\uAC00\uB85C\uC138\uB85C\uD034\uC988",empty:"\uC644\uB8CC\uD55C \uB808\uBCA8\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"},visit:{title:"\uBC29\uBB38 \uC5F0\uB3D9 \uAE30\uB85D"},detail:"\uC0C1\uC138\uBCF4\uAE30",detailFor:"{{name}} \uC0C1\uC138\uBCF4\uAE30",trainingType:{LISTEN_IN_NOISE:"\uC18C\uC74C \uD558 \uBB38\uC7A5",SHORT_STORY:"\uC9E7\uC740 \uC774\uC57C\uAE30",LONG_STORY:"\uAE34 \uC774\uC57C\uAE30",ORDERING_SENTENCE:"\uBB38\uC7A5 \uC21C\uC11C\uD654"}},Lg={publish:{descPlaceholder:"\uB9D0\uADC0\uC790\uB8CC\uC2E4\uC5D0 \uD45C\uC2DC\uD560 \uD55C \uC904 \uC124\uBA85 (\uC120\uD0DD)"},import:"\uB0B4 \uD6C8\uB828\uC5D0 \uAC00\uC838\uC624\uAE30",publisher:"\uAC8C\uC2DC\uC790",time:{justNow:"\uBC29\uAE08 \uC804",minutesAgo:"{{n}}\uBD84 \uC804",hoursAgo:"{{n}}\uC2DC\uAC04 \uC804",daysAgo:"{{n}}\uC77C \uC804",weeksAgo:"{{n}}\uC8FC \uC804",monthsAgo:"{{n}}\uAC1C\uC6D4 \uC804",yearsAgo:"{{n}}\uB144 \uC804"},badge:{shared:"\uB9D0\uADC0\uC790\uB8CC\uC2E4"}},$g={manage:{unit:"\uAC74"}},Rg={cancelLabel:"\uCDE8\uC18C"},Pg={steps:"\uC9C4\uD589 \uB2E8\uACC4 {{current}} / {{total}}"},Ig={panelTitle:"\uD6C8\uB828 \uC624\uB2F5",viewItems:"\uBB38\uD56D",viewTypes:"\uC720\uD615",colPending:"\uB0A8\uC740 \uAC83",colTrend:"\uBCC0\uD654",colRuns:"\uD310",unitItem:"\uAC1C",skippedOnly:"\uC61B \uAE30\uB85D {{n}}\uAC74\uC740 \uBB34\uC5C7\uC744 \uD47C \uAC83\uC778\uC9C0 \uC548 \uB0A8\uC544 \uC788\uC5B4 \uC148\uC5D0\uC11C \uBE90\uC2B5\uB2C8\uB2E4.",summaryLabel:"\uC313\uC778 \uAE30\uB85D",summaryValue:"{{items}}\uBB38\uD56D \xB7 \uC544\uC9C1 \uBABB \uC7A1\uC740 \uAC83 {{pending}}\uAC1C",nextLabel:"\uB2E4\uC74C\uC5D0 \uBCFC \uAC83",nextCount:"{{count}}\uAC1C",nextCountCapped:"{{total}}\uAC1C \uC911 {{shown}}\uAC1C",picked:"\u2192 {{what}}",typeClear:"\uB2E4 \uC7A1\uC558\uC5B4\uC694",typePending:"{{total}}\uAC1C \uC911 {{pending}}\uAC1C \uB0A8\uC74C",flat:"\uBCC0\uD654 \uC5C6\uC74C",runs:"{{count}}\uD310",avgDuration:"\uD3C9\uADE0 {{sec}}\uCD08"},Fg={resetColumns:"\uCE78 \uB108\uBE44 \uCD08\uAE30\uD654",scrollRegion:"\uAC00\uB85C\uB85C \uAD74\uB9B4 \uC218 \uC788\uB294 \uD45C",rowActionHint:"\uC904\uC744 \uB204\uB974\uBA74 \uC790\uC138\uD788 \uBD05\uB2C8\uB2E4"},Og={panelTitle:"\uB2E8\uC5B4\uD45C \uCC44\uC810",viewWords:"\uB0B1\uB9D0",viewTables:"\uD45C",colLatest:"\uB9C8\uC9C0\uB9C9",colTrend:"\uBCC0\uD654",unitTime:"\uD68C",summaryLabel:"\uC313\uC778 \uCC44\uC810",summaryValue:"{{times}}\uD68C \xB7 \uB0B1\uB9D0 {{words}}\uAC1C",nextLabel:"\uB2E4\uC74C\uC5D0 \uBCFC \uAC83",nextCount:"{{count}}\uAC1C",allClear:"\uC9C0\uB09C\uBC88\uC5D0 \uBAA8\uB450 \uB9DE\uD614\uC2B5\uB2C8\uB2E4.",times:"{{count}}\uD68C",flat:"\uBCC0\uD654 \uC5C6\uC74C",recentLabel:"\uCD5C\uADFC \uCC44\uC810",nextCountCapped:"{{total}}\uAC1C \uC911 {{shown}}\uAC1C"},zg={ariaLabel:"\uBC30\uB108",dotAriaLabel:"{{count}}\uAC1C \uC911 {{index}}\uBC88\uC9F8 \uBC30\uB108"},Wg={selectYearMonth:"\uC5F0\uC6D4 \uC120\uD0DD",chooseDate:"\uB0A0\uC9DC \uC120\uD0DD"},Hg={previewRegion:"\uBCF4\uACE0\uC11C \uBBF8\uB9AC\uBCF4\uAE30 \u2014 \uC88C\uC6B0\uB85C \uAD74\uB824 \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4"},Vg={description:"\uC124\uBA85",textbox:"\uBCF8\uBB38",training:"\uD6C8\uB828 \uC548\uB0B4",menu:"\uBA54\uB274"},qg={devNone:"\uBC1C\uB2EC \uC790\uB8CC \uC5C6\uC74C",place:{labial:"\uC591\uC21C\uC74C",alveolar:"\uCE58\uC870\uC74C",palatal:"\uACBD\uAD6C\uAC1C\uC74C",velar:"\uC5F0\uAD6C\uAC1C\uC74C",glottal:"\uC131\uBB38\uC74C"}},Ug={clearSelection:"\uC120\uD0DD \uD574\uC81C"},Gg={showResult:"{{type}} \uACB0\uACFC\uBCF4\uAE30"},Kg={selected:"\uC120\uD0DD\uB428",remove:"\uC81C\uAC70",exclude:"\uC81C\uC678",nthSelected:"{{n}}\uBC88\uC9F8 \uC120\uD0DD"},Yg={loading:"\uBD88\uB7EC\uC624\uB294 \uC911\u2026"},Zg={state:{active:"\uC18C\uB9AC \uB098\uB294 \uC911",played:"\uB4E4\uC74C",correct:"\uC815\uB2F5",wrong:"\uC624\uB2F5"}},Xg={ariaLabel:"\uC774\uB3D9 \uACBD\uB85C"},Jg={empty:"\uB4F1\uB85D\uB41C \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."},Qg={main:"\uBA54\uC778 \uADF8\uB77C\uB514\uC5B8\uD2B8",soft:"\uC18C\uD504\uD2B8",sub:"\uC11C\uBE0C \uCEEC\uB7EC",deep:"\uB525 \uADF8\uB77C\uB514\uC5B8\uD2B8",softSub:"\uC18C\uD504\uD2B8 \uC11C\uBE0C",warm:"\uC6DC(\uAC15\uC870)",dark:"\uB2E4\uD06C",radial:"\uBC29\uC0AC\uD615 \uADF8\uB77C\uB514\uC5B8\uD2B8",diagonal:"\uB300\uAC01\uC120 \uD328\uD134",dots:"\uB3C4\uD2B8 \uD328\uD134",outline:"\uC544\uC6C3\uB77C\uC778",success:"\uC131\uACF5/\uC644\uB8CC",naver:"\uB124\uC774\uBC84 \uBE14\uB85C\uADF8 \uC548\uB0B4",instagram:"\uC778\uC2A4\uD0C0\uADF8\uB7A8 \uC548\uB0B4"},eb={common:FC,calendar:OC,passCard:zC,searchField:WC,rating:HC,colorPicker:VC,dropdown:qC,accordion:UC,header:GC,nav:KC,settings:YC,usage:ZC,account:XC,help:JC,training:QC,trainingSettings:eg,customers:tg,payment:ng,coupons:ag,visits:rg,company:og,trainingType:sg,myWordTraining:ig,myWordTable:lg,keyWords:ug,wordTable:cg,wordSearch:dg,wordPrint:pg,topic:mg,accessLinkManager:hg,login:fg,trainingPlanRun:Cg,device:gg,manager:bg,wordPairs:yg,game:vg,footer:xg,landing:_g,date:wg,trainingSetPage:Bg,wordTrainingPreview:kg,wordData:Ag,textField:Ng,segmentedControl:Eg,tabs:Dg,fileUpload:Sg,avatar:Tg,myHomework:jg,trainingStatus:Mg,store:Lg,homework:$g,inquiry:Rg,progress:Pg,trainingMiss:Ig,table:Fg,wordScore:Og,topBanner:zg,datePicker:Wg,report:Hg,tooltip:Vg,phonemeProfile:qg,bulkBar:Ug,debug:Gg,badge:Kg,loader:Yg,soundCompass:Zg,breadcrumb:Xg,board:Jg,promoBannerBg:Qg},tb={statusFilter:"Filter by status",pageSizeSelect:"Items per page",selectedCount_one:"{{count}} selected",selectedCount_other:"{{count}} selected",moreFor:"More options for {{name}}",collapseFor:"Collapse {{name}}",expandFor:"Expand {{name}}",sortFor:"Sort {{name}}",cancel:"Cancel",info:"Info",errorState:{message:"Couldn't load this.",retry:"Try again"},save:"Save",confirm:"Confirm",discardConfirm:{title:"Discard your changes?",body:"If you do not save, everything you have entered will be lost.",confirm:"Discard"},close:"Close",back:"Back",emptyTrainingName:"Training name is empty.",remove:"Remove",image:"Image",delete:"Delete",reset:"Reset",update:"Update",download:"Download",likeCount_one:"{{count}} like",likeCount_other:"{{count}} likes",selectedOfMax:"{{count}} of {{max}}",downloadCount_one:"{{count}} download",downloadCount_other:"{{count}} downloads",descriptionFor:"About {{name}}",search:"Search",empty:"No data.",yes:"Yes",no:"No",all:"All",none:"None",days_one:"{{count}} day",days_other:"{{count}} days",loadMore:"Load More",retry:"Try Again",prevPage:"Previous page",nextPage:"Next page",play:"Play",playFor:"Play {{name}}",pauseFor:"Pause {{name}}",pause:"Pause",playPause:"Play / Pause",replay:"Replay",subscription:"Subscription",done:"Done",failed:"Failed",continue:"Continue",notification:"Notice",emptyList:"No items",noMatches:"No matching items",menu:"Menu",resetSelection:"Reset Selection",pageSizeLabel:"Show {{n}}",totalCountPrefix:"Total: ",totalCountSuffix:"",expand:"Expand",collapse:"Collapse",popup:"Popup",more:"More",codeBlock:"Code block",totalPrefix:"",copyCode:"Copy code",copied:"Copied",col:{problem:"Question"},phonetics:{place:{labial:"Bilabial",alveolar:"Alveolar",palatal:"Palatal",velar:"Velar",glottal:"Glottal"},vowel:{frontHigh:"Front high vowel",backHighUnrounded:"Back high unrounded vowel",backHighRounded:"Back high rounded vowel",frontMid:"Front mid vowel",backMidUnrounded:"Back mid unrounded vowel",backMidRounded:"Back mid rounded vowel",low:"Low vowel"},glide:{j:"j-glide",w:"w-glide",velar:"\u0270-glide"}},unknownError:"Unknown error",networkError:"The network connection is unstable. Check your connection and try again."},nb={rangeSelect:"Select period",dow:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekLabel:"Week {{ord}}",prevMonth:"Previous month",addOnDate:"Add a visit on {{date}}",nextMonth:"Next month",prevWeek:"Previous week",nextWeek:"Next week",legend:{visited:"Visited",scheduled:"Scheduled",noVisit:"No Show"},periodSelect:"Period unit",visitCount_one:"{{count}} visit",visitCount_other:"{{count}} visits",statusCount:"{{count}} {{label}}",weekOrdinal:["1","2","3","4","5","6","7"]},ab={planSuffix:"Plan",labeledPlan:"{{label}} Plan",couponCode:"Pass Code",specialLabel:"Open Special",unitDay:"d",unitYear:"yr",remainingDay:"{{n}}d left",remainingHour:"{{n}}h left",remainingMinute:"{{n}}m left",remainingSecond:"{{n}}s left",expired:"Expired",menu:{use:"Activate",refund:"Refund",delete:"Delete"}},rb={clearAriaLabel:"Clear search"},ob={starLabel:"Select star {{n}}",valueLabel:"{{value}} out of {{max}}",groupLabel:"Rating"},sb={selected:"selected"},ib={placeholder:"Select"},lb={collapse:"Collapse",expand:"Expand"},ub={biArea:"BI area",biSymbol:"BI symbol",logoMalgwi:"Malgwi logo",logoManager:"Malgwi Manager logo",menuOpen:"Open menu",utilMenu:"Utility menu",menuClose:"Close menu"},cb={mainMenu:"Main menu",bottomNav:"Bottom navigation",goToManager:"Go to Malgwi Manager",goToMalgwi:"Go to Malgwi",modeLabelManager:"Malgwi Manager",modeLabelMalgwi:"Malgwi",training:"Training",settings:"Settings",notifications:"Notifications",account:"Account",help:"Help",feedback:"Report a bug",debug:"Debug",coupons:"Coupons",topic:"By Topic",trainingType:"By Training Type",wordPairs:"Word Pairs",wordSearch:"Word Search",wordTable:"Word Table Creator",company:"Company Info",more:"More",moreMenu:"More menu",badgeLabel:"{{label}}, {{count}}",badgeInsideLabel_one:"{{label}}, {{count}} notification inside",badgeInsideLabel_other:"{{label}}, {{count}} notifications inside"},db={language:{training:{label:"Training Language",sub:"Language used for training words and speech"}},notifications:{title:"Notifications"},display:{fontSize:{small:"Small",large:"Large"}},cache:{title:"Cache Management",confirmMessage:"Delete cache ({{size}}). Do you want to continue?",delete:"Delete",deleting:"Deleting",cleared:"Cache cleared successfully.",group:{wordData:{label:"Word Data",sub:"Word list and version info"},pairIndex:{label:"Pair Index",sub:"Onset\xB7vowel\xB7coda minimal pair analysis cache"},imageCache:{label:"Image Cache",sub:"Word image existence check results"},trainingRecord:{label:"Training Record",sub:"Daily training progress and streak"}}},button:{save:"Save Settings"},popup:{clear:{confirm:"Reset"},update:{confirm:"Update"},cache:{title:"Delete {{label}}",message:"Delete {{label}} ({{size}}). Do you want to continue?"}},saved:"\u2713 Saved",account:{title:"Account",delete:{sub:"You can restore your account within 30 days of withdrawal."}}},pb={addButton:"Add Subscription",couponButton:"Enter Coupon",active:{infoTitle:"Subscription Info",refund:"Request Refund",startDate:"Start Date",endDate:"End Date",remaining:"Remaining"},pending:{title:"Pending",empty:"No pending subscriptions."},loading:"Loading\u2026",segment:{personal:"Malgwi",org:"Malgwi Manager"},org:{title:"Current Plan",disc:"Subscription plan in use by your organization.",empty:"No organization plan registered.",fallbackTitle:"Organization Plan",startDate:"Start Date",endDate:"End Date",remaining:"Remaining",duration:"Duration"}},mb={profile:{planSuffix:"",plan:"Plan"},basicInfo:{name:{placeholder:"John Doe"}},security:{title:"Security",password:{label:"Password",currentRequired:"Enter your current password.",newRequired:"Enter a new password.",mismatch:"The new passwords do not match.",changed:"Your password has been changed."},twoFactor:{label:"Two-Factor Authentication",sub:"Strengthen your account security"}}},hb={guide:{faq:{title:"FAQ",desc:"View all frequently asked questions"}}},fb={settings:"Settings",start:{title:"Start Word Training",description:"Select a training type below to begin"},difficulty:{tooltip:"The easiest difficulty is 'Random', the hardest is 'Initial Consonant Difference'."},contrast:{label:"Contrast",type:"Contrast Type",count:"Contrast Count",n:"{{n}}"},filter:{random:"Random",trainOnset:"Onset",trainVowel:"Vowel",trainCoda:"Coda",phonemeGroup:"Training phonemes",noLimit:"Any",codaExclude:"Exclude",gradeLabel:"Grade",excludeImageInfo:"Only words with images: keeps only results with a registered word image.",sameStructureInfo:"Only same phoneme structure: keeps only pairs where the correct and wrong answers share the same syllable structure (length, batchim, etc.).",selectSection:"Select",excludeImage:"Only words with images",sameStructure:"Only same phoneme structure"},noQuestions:"No questions available.",countQuestions_one:"{{n}} question",countQuestions_other:"{{n}} questions",countSentences_one:"{{n}} sentence",countSentences_other:"{{n}} sentences",comingSoon:"Coming Soon",nextQuestion:"Next",noiseRatioTitle:"Noise Ratio",noiseRatioValue:"{{ratio}}\xD7",noiseTypeTitle:"Noise Type",playVolumeTitle:"Volume",playSpeedTitle:"Speed",meter:{sentence:"Playback",noise:"Noise",toggle:"Show Audio Meter"},viewResult:"View Results",problemNotice:"Problem {{n}}.",trainingSettingsTitle:"Training Settings",sentencePreview:"Sentence Preview",notHeard:"Didn't hear it.",heardWell:"Heard it well.",confirmTitle:"Check the sentence and select whether you heard it.",noSoundWaveform:"Waveform is not shown for sound-comparison questions.",noise:{level:{none:"None",weak:"Weak",medium:"Medium",strong:"Strong",veryStrong:"Very Strong"},type:{none:"None",default:"Default",street:"Street",buzz:"Buzzing",restaurant:"Restaurant"}},listenTitle:"Please listen to the sentence.",listenButton:"Listen",playSound:"Play Sound",playAll:"Play All",selectInOrder:"Select the cards in the order you heard.",stop:"Stop",preview:"Preview",previewFor:"Preview {{name}}",stopFor:"Stop {{name}}",next:"Next",completed:"Completed",selected:"Selected",nthSelected:"Selection {{n}}",fontSizeMin:"Font size is at the minimum.",fontSizeMax:"Font size is at the maximum.",fontSizeDecrease:"Decrease font size",fontSizeIncrease:"Increase font size",toggleBackground:"Toggle background",cardInstructions:"Look at the word card, listen to the sound, and check it.",noCards:"No cards.",audioFetchError:"Failed to load the sound source.",ttsUnavailable:"Speech playback isn't available on this device.",selectConfirm:"Look at the question and select the answer.",orderListDefault:"Arrange the sentences in the order you heard.",result:{pendingDone:"Results are still being calculated, so you can't finish yet.",eyebrow:"Training Complete",title:"You've finished all the training!",scoreAria:"{{correct}} / {{total}} questions",elapsed:"Time Elapsed",summary:"You heard {{correct}} item(s) correctly.",tableAriaLabel:"Per-question judgement",colJudge:"Judgement",colAnswerSelected:"Answer \xB7 Selected",colAnswer:"Answer",colSelected:"Selected",heardWell:"Heard well",notHeard:"Didn't hear",notJudged:"Not judged",replay:"Replay",replaySound:"Replay item {{no}}",replaySoundStop:"Stop item {{no}}",done:"Done",viewResult:"View Results",noContent:"(No content)"},up:"Move up",down:"Move down",prev:"Previous",listenLabel:"Listen",sourcePlay:"Play source {{n}}",listen:"Listen",audioStatus:{idle:"Idle",resolving:"Resolving\u2026",checking_exists:"Checking file\u2026",getting_signed_url:"Getting URL\u2026",downloading:"Downloading\u2026",measuring_duration:"Measuring length\u2026",ready:"Ready",error:"Error",synthesizing:"Preparing the sound\u2026"}},Cb={totalCount:" training bundles",sort:{customers:"Customers"},copyLink:"Copy Link",removeLink:"Remove Link",linkRemoved:"Link removed.",linkSaveFirst:"Please save the training bundle first.",linkSaveFirstHint:"You can only create a shared link from a saved training bundle.",linkCopySelect:"Copy blocked \u2014 link selected. Press Ctrl/\u2318+C to copy.",nameRequired:"Please enter a training bundle name.",itemRequired:"Please add at least one training item.",randomAdd:"Random Add",menu:{publish:"Post to Store",duplicate:"Duplicate Training Bundle",edit:"Edit Training Bundle",move:"Move Group",rename:"Rename"},itemCount:"Number of Items",renameGroup:"Rename Group"},gb={totalCount:" customers",loadError:"Failed to load list",basicInfo:{editTooltip:"Edit"},member:{placeholder:"Email or phone",link:"Link",linking:"Linking\u2026"},device:{title:"Hearing Devices",addTooltip:"Add New",addButton:"Add device",listTooltip:"View List",listTitle:" Device List",historyEmpty:"No device history registered",wearing:" in use",notRegistered:"Not registered",unit:"",wearingNow:"In use",wear:"Wear",unwear:"Remove",wornSince:"Since {{date}}",release:"Release",historyTitle:"Hearing device history"},schedule:{title:"Upcoming Visits",addTooltip:"Add Schedule",listTooltip:"View All",empty:"No upcoming visits",registerTitle:" Register Schedule",memoPlaceholder:"Enter a memo for this visit."},visitHistory:{title:"Visit History",addTooltip:"Add Visit",empty:"No visit history yet",popupTitle:" Visit History",registerTitle:" Register Visit"},moreItems:"more",viewAll:"View All",visits:{title:"Visits"},trainingRecord:{title:"Customer Training Records"},status:{trainingSubtitle:"Training Status"},detail:{session:{completedFmt:"Done {{done}}/{{total}} \xB7 {{duration}}"},visitSuffix:" visits"},homework:{active:"Active",copied:"Link copied.",copy:"Copy Link",inactive:"Inactive",title:"Homework Progress"},duration:{minSec:"{{m}}m {{s}}s",min:"{{m}}m",sec:"{{s}}s"}},bb={plan:{recommendedFor:"Recommended for",features:"Key Features",freePrice:"Free",contact:"Contact Us",tierFallback:"Plan",openPromo:"Launch offer"},products:{mgrEnterprise:{tier:{price:"Contact us"}}}},yb={title:"Coupons",subtitle:"Enter a coupon code or view your coupons",input:{label:"Coupon code",placeholder:"Enter coupon code"},applyButton:"Apply",error:{invalid:"Invalid coupon code.",alreadyUsed:"This coupon has already been used."},success:{applied:'"{{name}}" coupon applied.'},section:{owned:"My Coupons"},status:{used:"Used",available:"Available"}},vb={unitVisit:"",periodAll:"All",showN:"Show {{n}}"},xb={subtitle:"Manage company and business information",editButton:"Edit Info",basicInfo:{title:"Basic Info"},contactInfo:{title:"Contact Info"}},_b={title:"Training by Type",subtitle:"Select the training type you want",listenInNoise:{title:"Sentence Listening in Noise",desc:"Train sentence comprehension in various noise environments."},shortStory:{title:"Short Story Listening",desc:"Listen to short stories and understand the content."},longStory:{title:"Long Story Listening",desc:"Focus on listening to long stories and grasp the content."},orderingSentence:{title:"Sentence Ordering",desc:"Arrange heard sentences in the correct order."},SAME_SOUND_PICK:{label:"Listen & Pick Same Sound",sub:"Pick the word card that matches what you heard."},SAME_OR_DIFF:{label:"Same or Different?",sub:"Decide whether the two sounds are the same or different."},HEAR_AND_PICK_SAME:{label:"Hear & Match Word",sub:"Pick the word card that matches the sound you heard."},HEAR_AND_PICK_INCLUDED:{label:"Find Word Containing Sound",sub:"Pick the word card that contains the syllable you heard."},STARTS_WITH_SAME_SOUND:{label:"Find Word Starting with Same Sound",sub:"Pick a word that starts with the same sound as what you heard."},LISTEN_AND_REMEMBER_ORDER:{label:"Listen & Recall Order",sub:"Select the cards in the order you heard the three words."},MERGE_2_SYLLABLES:{label:"Combine 2 Syllables",sub:"What word do two syllables make?"},MERGE_3_SYLLABLES:{label:"Combine 3 Syllables",sub:"What word do three syllables make?"},MERGE_2_PHONEMES:{label:"Combine 2 Phonemes",sub:"What sound do two phonemes make?"},MERGE_3_PHONEMES:{label:"Combine 3 Phonemes",sub:"What sound do three phonemes make?"},DROP_1_FROM_2SYLL:{label:"Drop 1 Syllable from 2-Syllable",sub:"What sound remains when you remove a syllable from a 2-syllable word?"},DROP_1_FROM_3SYLL:{label:"Drop 1 Syllable from 3-Syllable",sub:"What sound remains when you remove a syllable from a 3-syllable word?"},DROP_PART_FROM_COMPOUND:{label:"Drop Part of Compound Word",sub:"What word remains when you remove part of a compound word?"},DROP_FINAL_CONSONANT_FROM_1SYLL:{label:"Drop Final Consonant",sub:"What sound remains when you remove the final consonant?"},REMOVE_CONSONANT_AND_IDENTIFY_PHONEME:{label:"Drop Consonant",sub:"What sound remains when you remove the consonant?"},CHANGE_1_SYLL_IN_2SYLL:{label:"Change 1 Syllable (2-Syllable)",sub:"Change one syllable in a 2-syllable word to make a new word."},CHANGE_1_SYLL_IN_3SYLL:{label:"Change 1 Syllable (3-Syllable)",sub:"Change one syllable in a 3-syllable word to make a new word."},CHANGE_1_PHONEME_IN_1SYLL:{label:"Change 1 Phoneme (1-Syllable)",sub:"Change one phoneme in a 1-syllable word to make a new sound."},CHANGE_1_PHONEME_IN_2SYLL:{label:"Change 1 Phoneme (2-Syllable)",sub:"Change one phoneme in a 2-syllable word to make a new word."}},wb={comingSoon:"Word training is coming soon."},Bb={colName:"Table Name",open:"Open",countSuffix:" tables",addCard:"Add Word Table Card",cardsEmpty:"No word table cards created yet.",menu:{publishStore:"Post to Training Store",unpublishStore:"Remove from Training Store"},newBadge:"Newly created",tab:{cards:"Word Table Cards",tables:"Word Tables"},publishedBadge:"Published",sharedBadge:"Shared"},kb={title:"Key Words",empty:"No key words available."},Ab={defaultName:"Word Table",title:"Word Table Builder",subtitle:"Set columns and add words to build a table.",filterTitle:"Table Settings",filter:{composition:"Composition",image:"Image",word:"Word",standardPron:"Standard Pronunciation",colloquialPron:"Colloquial Pronunciation",paperOrientation:"Paper Orientation",landscape:"Landscape",portrait:"Portrait",columns:"Columns",column:"{{count}} col",itemsPerPageWord:"Words per page",itemsPerPagePair:"Pairs per page",itemsPerPageOption:"{{count}}",pageIndicator:"{{current}} / {{total}}",pageNumber:"Page Number",pageNumberLeft:"Left",pageNumberCenter:"Center",pageNumberRight:"Right",border:"Border",topInfo:"Header",bottomInfo:"Footer",cutLine:"Cut Line",show:"Show",hide:"Hide",dotted:"Dotted",corner:"Corner"},addWord:"Add",wordInfo:"Info for {{word}}",emptyItems:"Please add at least one word.",load:"Load",openNewWindow:"Open in New Window",saveButton:"Save",saveAsNewButton:"Save as New",print:"Print",popupBlocked:"Popup was blocked. Please allow popups in your browser settings.",printFileNameSingle:"Word Table",printFileNamePair:"Contrast Pair Table",save:{title:"Save Word Table",nameLabel:"Name",desc:"Enter a name for the word table.",placeholder:"Enter a title for this word table.",descriptionLabel:"Description",descriptionPlaceholder:"Enter a description for this word table.",duplicateName:"This name is already in use.",nameRequired:"Please enter a table name.",autoFillHint:" (Press Tab or Space to autofill)",copyName:"{{name}} (copy)"},loadTable:{title:"Load Saved Word Table",empty:"No saved word tables.",loadButton:"Load",itemCount_one:"{{count}} word",itemCount_other:"{{count}} words",deleteAriaLabel:"Delete {{name}}",viewLabel:"View as",sortLabel:"Sort by",sort:{newest:"Newest",oldest:"Oldest",name:"Name",count:"Word Count"},view:{grid:"Grid View",list:"List View"}},publisherFilter:"Show only tables by {{name}}",groupDeleteMessage:"Word tables in this group will be moved to 'No Group'.",groupNamePlaceholder:"Group name",store:{badge:"Training Store"},card:{sub:"Word Table Card",empty:"No word tables in this card."},toast:{renameError:"Failed to rename",saveError:"Failed to save",deleteError:"Failed to delete",duplicateError:"Failed to duplicate",saveSuccess:"Word table saved."},scoring:{o:"{{word}} correct",triangle:"{{word}} partial",x:"{{word}} incorrect",markName:{o:"Correct",triangle:"Partial",x:"Incorrect"},button:"Score",pickTitle:"Who are you scoring?",pickSubtitle:"Choose the customer who trained with \u201C{{name}}\u201D.",pickSearch:"Search by name or phone",pickEmpty:"No customers registered.",pickNoMatch:"No matching customer.",pickAgain:"Choose another",scoringFor:"Scoring {{name}}",none:"Tap \u25CB \xB7 \u25B3 \xB7 \u2715 under a cell to mark it. With a mouse they appear when you hover the cell; with a keyboard, when focus reaches it.",tally:"{{marked}} scored \xB7 \u25CB {{o}} \xB7 \u25B3 {{triangle}} \xB7 \u2715 {{x}} \xB7 {{rate}}%",save:"Save score",saved_one:"Saved {{count}} mark for {{name}}.",saved_other:"Saved {{count}} marks for {{name}}.",reviewTitle:"Create a review table?",reviewMessage_one:"Builds a new table from the {{count}} cell {{name}} got wrong or partial. Correct ones are left out.",reviewMessage_other:"Builds a new table from the {{count}} cells {{name}} got wrong or partial. Correct ones are left out.",reviewConfirm:"Create review table",reviewDescription:"Cells marked wrong or partial in \u201C{{name}}\u201D \u2014 {{count}} of them.",reviewCreated_one:"Created \u201C{{name}}\u201D \u2014 {{count}} cell.",reviewCreated_other:"Created \u201C{{name}}\u201D \u2014 {{count}} cells.",discardTitle:"Discard this scoring?",discardMessage_one:"You marked {{count}} cell but have not saved. Leaving discards it.",discardMessage_other:"You marked {{count}} cells but have not saved. Leaving discards them.",discardConfirm:"Discard and leave"},info:{grade:"Grade: {{n}}",syllables:"Syllables: {{n}}",pos:"Part of speech: {{v}}",wordType:"Type: {{v}}"},pos:{noun:"Noun",verb:"Verb",adjective:"Adjective",adverb:"Adverb",numeral:"Numeral",determiner:"Determiner",interjection:"Interjection",particle:"Particle",affix:"Affix",dependentNoun:"Dependent noun",pronoun:"Pronoun",auxVerb:"Auxiliary verb",auxAdjective:"Auxiliary adjective"},reorder:{moved:"Moved to position {{n}} of {{total}}",handle:"Reorder {{word}} (Alt + arrow keys)",hint:"Alt + \u2190 \u2192 to reorder"}},Nb={editBanner:{message:"Saving will update the word table you're editing."},filterTitle:"Word Search Settings",filter:{positionAny:"Any",positionHead:"Start",positionMid:"Middle",positionTail:"End",difficulty:"Grade",grade:"Grade {{n}}",gradeNone:"None",syllables:"Syllables",syllable:"{{n}} Syll.",syllable5plus:"5+ Syllables",partOfSpeech:"Part of Speech",pos:{noun:"Noun/Numeral",verb:"Verb/Adjective",modifier:"Adverb/Determiner"},wordType:"Word Type",field:"Semantic Category",type:{native:"Native Korean",sino:"Sino-Korean",foreign:"Loanword",mixed:"Hybrid"},exclude:"Exclude",excludeNoImage:"No Image"},searchButton:"Search",resultUnit:"words",remaining:"{{count}} remaining",resultDisc:"Select {{unit}}. Up to {{max}} items. ({{selected}}/{{max}})",resultTitlePrefix:"",resultTitleSuffix:" {{unit}} found.",emptyResult:"No results found.",groupCount:"{{count}}",sort:{aria:"Sort",match:"Best Match",ganada:"A\u2013Z \u2191",ganadaDesc:"A\u2013Z \u2193",syllable:"Syllables \u2191",syllableDesc:"Syllables \u2193",grade:"Grade \u2191",gradeDesc:"Grade \u2193",original:"Original order"},pageSize:"Show {{count}}",pageSizeAria:"Page size",popup:{title:"Select a word for cell {{n}}"}},Eb={clearAllSelection:"Clear All Selections",divLine:"Contrast Line",removePair:"Remove pair",removeWord:"Remove word"},Db={title:"By Topic",subtitle:"Select a topic to start listening training",noiseTitle:"Sentence Listening in Noise",shortStoryTitle:"Short Story Listening",FOOD:"Food",HLTH:"Health",WETH:"Weather",PRSN:"People",KRCT:"Korean Culture",STRY:"Stories",LOCA:"Locations",SOAR:"Society & Arts",NTSC:"Nature & Science",SPRT:"Sports",sub:{TRKRFD:"Traditional Korean Food",MDKRFD:"Modern Korean Food",WRLDFD:"World Cuisine",MTRFRT:"Ingredients & Fruits",GEFDKL:"Food Facts",HTETHB:"Healthy Eating",DISILL:"Diseases",EXCISE:"Exercise",GEHTKL:"Health Facts",GESSKL:"Seasons",SNWRAN:"Snow & Rain",WTHFCT:"Weather Forecast",GEWTKL:"Weather Facts",JODYPS:"Joseon Dynasty",MDKRPS:"Modern Korea",THKDPS:"Three Kingdoms",WRLART:"World Artists",WRLPSN:"World Figures",KRLANG:"Korean Language",TRPLCT:"Traditional Games",HERITG:"Heritage",EVTFES:"Events & Festivals",GECTKL:"General Knowledge",FRYTAL:"Fairy Tales",AMZING:"Amazing Stories",DAYSTR:"Everyday Stories",KRLDMK:"Korean Landmarks",SELNMK:"Seoul Landmarks",WRDTRB:"World Travel",NAVIGT:"Navigation",KRSOCI:"Korea",ECONEW:"Economy & News",GENART:"Arts",GELFKL:"Life Tips",ANIMAL:"Animals",PLANTS:"Plants",ETHPLT:"Earth",TOLELC:"Tools & Electronics",GESCKL:"Science Facts",INVDSP:"Individual Sports",MARART:"Martial Arts",TEAMSP:"Team Sports",FOOTBL:"Soccer",GESPKL:"Sports Facts"}},Sb={maxUses:"Max uses (leave blank for unlimited)",redirect:"Redirect URL (leave blank for app home)",creating:"Creating\u2026",create:"Create link",created:"\u2713 Link created",copied:"Copied!",copy:"Copy",loading:"Loading\u2026",empty:"No links created yet.",uses_one:"Used {{count}} time",uses_other:"Used {{count}} times",expiresAt:"Expires: {{date}}",createdAt:"Created: {{date}}",confirmDelete:"Delete this link?",deactivate:"Deactivate",delete:"Delete",status:{active:"Active",expired:"Expired",inactive:"Inactive"}},Tb={passwordPlaceholder:"Enter password"},jb={direction:{left:"L",right:"R",label:"Side"},wornDate:"Date Worn",deviceType:"Device Type",brand:"Brand",fitType:"Fit Type",productName:"Product Name",validationError:{brandAndProduct:"Please enter brand and product name."},addNew:"Add New Device",selectFromList:"Select from List",removeDevice:"Remove",type:{hearingAid:"Hearing Aid",cochlearImplant:"Cochlear Implant",other:"Other"}},Mb={stat:{totalCustomers:"Total Customers",monthlyVisits:"This Month's Visits"},chart:{visitDetail:"Visit Details",trainingDetail:"Training Details",weekly:"Weekly",daily:"Daily",periodMonth:"Month",periodWeek:"Week",weeklyPrefix:"Weekly",monthlyPrefix:"Monthly",visit:"Visits",reservation:"Reservations",trainingDone:"Completed",trainingInProgress:"In Progress",weekRange:"{{start}}\u2013{{end}}",week:"W{{n}}"},subscriptionStatus:{active:"{{pct}}% Active",expired:"{{pct}}% Expired",unused:"{{pct}}% Unused"}},Lb={editBanner:{message:"Saving will update the contrast pair table you're editing."},phonemeSelect:{title:"Phoneme Selection",vs:"vs"},caution:"Caution",mode:{include:"Phoneme Include",pick:"Phoneme Contrast",contrast:"Specify Contrast",infoTitle:"Contrast Mode",infoInclude:"Include \u2014 finds words containing all selected phonemes, plus their minimal pair.",infoPick:"Contrast \u2014 matches only if the selected phoneme is the actual point of difference in the pair.",infoContrast:"Specify Contrast \u2014 directly choose phonemes for the base word and the contrasting word to find pairs."},count:"{{n}}",countLabel:"Number of phonemes",input:{char:"Choose Letters",pron:"Choose Sound",infoTitle:"Input mode",infoChar:"Choose Letters \u2014 finds words by the selected phonemes (spelling), then finds their standard-pronunciation contrast pairs.",infoPron:"Choose Sound \u2014 finds standard-pronunciation contrast pairs directly from the selected phonemes."},phonemeN:"Syllable {{n}}",phonemeSingleLabel:"Syllable",phonemeContrastSingleLabel:"Contrast Syllable",ordinals:["First","Second","Third","Fourth"],phonemeOrdinalLabel:"{{ordinal}} Syllable",phonemeContrastOrdinalLabel:"Contrast {{ordinal}} Syllable",composition:"Answer Word Composition",syllableCount:"Syllables",syllableN:"{{n}} syll.",syllableNPlus:"{{n}}+ syll.",onset:"Onset",vowel:"Vowel",coda:"Coda",filter:{searchOptionsTitle:"Contrast Settings",searchModeLabel:"Contrast Mode",countLabel:"Input Syllable Count",inputModeLabel:"Input mode",phonemeOrder:"Input Syllable Position",phonemeOrderInfo:["Match: the pair must differ at exactly the same position (syllable).","Any: the differing position doesn't matter."],orderAny:"Any",orderMatch:"Match",difficultyInfo:["Level 1 \u2014 everyday vocabulary acquired before school age and used for life","Level 2 \u2014 difficulty of grades 1\u20132","Level 3 \u2014 difficulty of grades 3\u20134","Level 4 \u2014 difficulty of grades 5\u20136","No level \u2014 frequent everyday words outside the national standard list, plus coinages and loanwords"],selectLabel:"Select",onlyHasImage:"Only words with images",onlySameStructure:"Only same phoneme structure"},searchLabel:{error:"Failed to load data",loading:"Loading\u2026"},confirmMessage:"The word table with {{count}} selected {{unit}} will be lost.",resetOptions:"Reset Options",phonemeContrast:"Contrast Syllable {{n}}",infoNotes:["The preview character is an example of the selected phoneme combination. The actual search covers all words containing the phoneme.","Initial consonant '\u3147' cannot be selected. \u3147 at the start of a word is effectively silent.","If only onset and coda are selected, the vowel is automatically displayed as '\u314F'.","Increasing the phoneme count searches for minimal pairs between each phoneme."]},$b={sentenceTyping:{roundCount:"{{rounds}} rounds \xB7 {{timeLimit}}s each"},wordDefense:{me:"Me"},dictation:{title:"Dictation",desc:"Practice writing down exactly what you hear.",comingSoon:"Coming soon: audio playback, input field, answer comparison"},result:{heading:"Level {{number}} Answer",retry:"Try Again"},common:{accuracy:"{{pct}}% accuracy"},soundMatch:{title:"Sound Match",desc:"Quickly match words or sentences that share the same sound.",comingSoon:"Coming soon: play button, timer, score tracking"},orderSequence:{title:"Sentence Ordering",desc:"Arrange scattered sentence fragments in the correct order.",comingSoon:"Coming soon: sentence sets, ordering interface"},speedListen:{title:"Speed Listen",desc:"A challenge game to count the number of words in a sentence within a time limit.",comingSoon:"Coming soon: time limit, scoreboard"},noiseChallenge:{title:"Noise Challenge",desc:"Practice distinguishing sentences amid background noise.",comingSoon:"Coming soon: various noise levels, score tracking"},fastListen:{title:"Fast Listen",desc:"Listen to short sentences at speed and select the key word.",comingSoon:"Coming soon: speed by difficulty, timer"},shadowing:{title:"Shadowing",desc:"Practice pronunciation and intonation by repeating sentences aloud.",comingSoon:"Coming soon: playback, recording, comparison feedback"},phonemeHunt:{title:"Phoneme Hunt",desc:"Find words that contain a specific phoneme (sound).",comingSoon:"Coming soon: phoneme filter, hint feature"}},Rb={lead:`IHAB builds trust
|
|
850
850
|
through sound
|
|
851
|
-
and aids recovery.`,site:{title:"Site",malgwi:"Malgwi",soundDirection:"Sound Direction System",vrSoundDirection:"VR Sound Direction System",hearingTest:"Hearing Test Pro"},sns:{title:"SNS",naverBlog:"Naver Blog",kakao:"KAKAO Talk Open Chat"},policy:{title:"Policy",terms:"Terms of Service",privacy:"Privacy Policy"},ceo:"CEO",address:"Address",support:"Support",ceoName:"Ji-hye Han",addressValue:"302, 3F, Haechan Bldg, 32 Sicheong-gil, Chuncheon, Gangwon, Korea"},Pb={trainingPhone:{topic:"Gardening",prev:"Prev",next:"Next",speed:"Speed 3",noiseType:"Crowd noise",settings:"Settings",start:{caption:"Press the play (\u25B6) button below and listen carefully. After listening, check the sentence."},feedback:{caption:"Plant the well-grown seedlings in the garden bed and cover them carefully with plastic film."},done:{heardWell:"Heard clearly",listenAgain:"Listen again"}}},Ib={timeHM:"{{hh}}:{{mm}}",timeH:"{{hh}}:{{mm}}"},Fb={options:"Training Options",difficulty:"Difficulty",exclude:"Exclude",chosung:"Initial Consonant",excludeOptions:{none:"None",noImage:"No Image"}},Ob={answer:"Answer",distractor:"Distractor"},zb={phaseWordDownload:"Download Word Data",phaseImageCheck:"Check Images",phasePairAnalysis:"Analyze Word Pairs",downloadingCount_one:"Downloading {{n}} word",downloadingCount_other:"Downloading {{n}} words",checkingPage:"Checking page {{page}} list",imageCount:"{{done}} / {{total}} items"},Wb={clearAriaLabel:"Clear input"},Hb={ariaLabel:"Select tab"},Vb={ariaLabel:"Tabs"},qb={dragPrompt:"Drag and drop files here",browseButton:"Choose Files",removeAriaLabel:"Remove {{name}}"},Ub={ariaLabel:"User avatar"},Gb={relativeDay:{today:"Today",yesterday:"Yesterday",daysAgo:"{{n}}d ago"},reason:{notLoggedIn:"Login required."},list:{title:"Received Homework"},status:{expired:"Expired",done:"Done {{count}}\xD7 \xB7 {{date}}",notDone:"Not done"}},Kb={weekly:{title:"Weekly Training",daily:"Daily Listening",crossword:"Crossword"},homework:{title:"Homework Progress",totalRate:"Overall rate",count:"Total",done:"Done",remaining:"Remaining"},today:{tooltipTotal:"Total",tooltipDone:"Done"},filter:{countSuffix:" sessions"},time:{countLabel_one:"{{n}} session",countLabel_other:"{{n}} sessions",empty:"No training records"},daily:{title:"Today's Listening Record",empty:"No completed sessions"},crossword:{title:"Crossword Quiz",empty:"No completed levels"},visit:{title:"Linked Visit Records"},detail:"Details",detailFor:"{{name}} details",trainingType:{LISTEN_IN_NOISE:"Sentence in Noise",SHORT_STORY:"Short Story",LONG_STORY:"Long Story",ORDERING_SENTENCE:"Sentence Ordering"}},Yb={import:"Add to my trainings",publisher:"Publisher",time:{justNow:"just now",minutesAgo:"{{n}}m ago",hoursAgo:"{{n}}h ago",daysAgo:"{{n}}d ago",weeksAgo:"{{n}}w ago",monthsAgo:"{{n}}mo ago",yearsAgo:"{{n}}y ago"},badge:{shared:"Store"},publish:{descPlaceholder:"One-line description for the Training Store (optional)"}},Zb={manage:{unit:"item(s)"}},Xb={cancelLabel:"Cancel"},Jb={subtitle:"Select a topic to start listening practice."},Qb={steps:"Step {{current}} of {{total}}"},ey={panelTitle:"Training misses",viewItems:"Items",viewTypes:"Types",colPending:"Left",colTrend:"Change",colRuns:"Runs",unitItem:" items",skippedOnly_one:"{{n}} older record was excluded \u2014 it does not say what was answered.",skippedOnly_other:"{{n}} older records were excluded \u2014 they do not say what was answered.",summaryLabel:"Recorded",summaryValue:"{{items}} items \xB7 {{pending}} still missed",nextLabel:"Next to work on",nextCount:"{{count}}",nextCountCapped:"{{shown}} of {{total}}",picked:"\u2192 {{what}}",typeClear:"All caught up",typePending:"{{pending}} of {{total}} left",flat:"no change",runs_one:"{{count}} run",runs_other:"{{count}} runs",avgDuration:"{{sec}}s avg"},ty={resetColumns:"Reset column widths",scrollRegion:"Horizontally scrollable table",rowActionHint:"Press a row to open its details"},ny={panelTitle:"Word table scores",viewWords:"Words",viewTables:"Tables",colLatest:"When",colTrend:"Change",unitTime:" times",summaryLabel:"Scored",summaryValue:"{{times}} times \xB7 {{words}} words",nextLabel:"Focus next",nextCount:"{{count}}",allClear:"All correct last time.",times:"{{count}}x",flat:"no change",recentLabel:"Recent scorings",nextCountCapped:"{{shown}} of {{total}}"},ay={ariaLabel:"Banner",dotAriaLabel:"Banner {{index}} of {{count}}"},ry={selectYearMonth:"Select year and month",chooseDate:"Choose a date"},oy={previewRegion:"Report preview \u2014 scrollable sideways"},sy={description:"Description",textbox:"Text",training:"Training guide",menu:"Menu"},iy={devNone:"No acquisition data",place:{labial:"Bilabial",alveolar:"Alveolar",palatal:"Palatal",velar:"Velar",glottal:"Glottal"}},ly={clearSelection:"Clear selection"},uy={showResult:"Show {{type}} result"},cy={selected:"Selected",remove:"Remove",exclude:"Excluded",nthSelected:"Selection {{n}}"},dy={loading:"Loading"},py={state:{active:"playing",played:"heard",correct:"correct",wrong:"wrong"}},my={ariaLabel:"Breadcrumb"},hy={empty:"No items yet."},fy={main:"Main gradient",soft:"Soft",sub:"Sub color",deep:"Deep gradient",softSub:"Soft sub",warm:"Warm (accent)",dark:"Dark",radial:"Radial gradient",diagonal:"Diagonal pattern",dots:"Dot pattern",outline:"Outline",success:"Success / done",naver:"Naver blog notice",instagram:"Instagram notice"},Cy={common:tb,calendar:nb,passCard:ab,searchField:rb,rating:ob,colorPicker:sb,dropdown:ib,accordion:lb,header:ub,nav:cb,settings:db,usage:pb,account:mb,help:hb,training:fb,trainingSettings:Cb,customers:gb,payment:bb,coupons:yb,visits:vb,company:xb,trainingType:_b,myWordTraining:wb,myWordTable:Bb,keyWords:kb,wordTable:Ab,wordSearch:Nb,wordPrint:Eb,topic:Db,accessLinkManager:Sb,login:Tb,device:jb,manager:Mb,wordPairs:Lb,game:$b,footer:Rb,landing:Pb,date:Ib,trainingSetPage:Fb,wordTrainingPreview:Ob,wordData:zb,textField:Wb,segmentedControl:Hb,tabs:Vb,fileUpload:qb,avatar:Ub,myHomework:Gb,trainingStatus:Kb,store:Yb,homework:Zb,inquiry:Xb,trainingPlanRun:Jb,progress:Qb,trainingMiss:ey,table:ty,wordScore:ny,topBanner:ay,datePicker:ry,report:oy,tooltip:sy,phonemeProfile:iy,bulkBar:ly,debug:uy,badge:cy,loader:dy,soundCompass:py,breadcrumb:my,board:hy,promoBannerBg:fy};const gy="0.338.0",by=[{code:"ko",label:"\uD55C\uAD6D\uC5B4"},{code:"en",label:"English"}],io="ko",yy="ihab_display_language";function Oi(){if(typeof window>"u")return io;try{const e=localStorage.getItem(yy);if(e&&by.some(t=>t.code===e))return e}catch{}return io}function zi(e){try{document.documentElement.lang=e}catch{}}Rt.on("languageChanged",zi),zi(Oi()),Rt.use(xe.initReactI18next).init({resources:{ko:{translation:eb},en:{translation:Cy}},lng:Oi(),fallbackLng:io,interpolation:{escapeValue:!1},react:{useSuspense:!1}});const vy=new Map;try{Rt.store?.on?.("added",()=>vy.clear())}catch{}let nr=null,Wi=null,Hi=null;function xy(){const e=Di();if(e&&e.entries.length>0){const t=sC();if(nr&&Wi===e&&Hi===t)return nr;const a=new Set,r=[];for(const i of e.entries)!i.word||a.has(i.word)||(a.add(i.word),r.push({w:i.word,s:i.syllables,p:t?.[i.word]?[...t[i.word].cho??[],...t[i.word].jung??[],...t[i.word].jong??[]]:[],pron:i.pronunciation||i.word,grade:i.grade}));return nr=r,Wi=e,Hi=t,nr}return[]}new Proxy([],{get(e,t){const a=xy(),r=a[t];return typeof r=="function"?r.bind(a):r}});function _y(e){if(e.includes("\\")&&e.includes("("))return!0;if(!/url\s*\(/i.test(e))return!1;const t=e.replace(/url\(\s*(['"]?)#[^)'"]*\1\s*\)/gi,"");return/url\s*\(/i.test(t)}function wy(e){if(typeof window>"u")return"";const t=(a,r)=>{typeof r.attrValue=="string"&&_y(r.attrValue)&&(r.keepAttr=!1)};Vr.addHook("uponSanitizeAttribute",t);try{return Vr.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},FORBID_TAGS:["script","use","style"],FORBID_ATTR:["xlink:href","href"]})}finally{Vr.removeHook("uponSanitizeAttribute",t)}}function By(e){const[t,a]=o.useState(null),[r,i]=o.useState(null),[s,l]=o.useState(null),[u,c]=o.useState(null);return o.useEffect(()=>{if(!e||typeof e!="string"||!e.endsWith(".svg")){a(null),i(null),l(null);return}const d=e.split("/").pop();let m=e;d&&(e.startsWith("/")?m=Kr(e):/^(Logo|Symbol)/i.test(d)?m=Kr(`logo/${d}`):(/^https?:\/\//i.test(e)||e.startsWith("data:"),m=e)),i(null),l(null),a(m)},[e]),o.useEffect(()=>{if(!t)return;let d=!1;async function m(){try{let p=await fetch(t);p.ok||(p=await fetch(t));const f=p.headers.get("content-type")||"";if(d)return;if(f.includes("svg")){i("mask");return}if(f.startsWith("image/")){i("img");return}const y=await fetch(t);if(!y.ok)throw new Error("not ok");const x=await y.text();if(d)return;if(/^\s*<svg[\s>]/i.test(x)){const C=wy(x);if(!C){i("none");return}l(C),i("inline");return}i("none")}catch{d||i("none")}}return m(),()=>{d=!0}},[t]),o.useEffect(()=>{let d=!1,m=null;return r==="mask"&&t&&fetch(t).then(p=>{if(!p.ok)throw new Error("fetch failed");return p.blob()}).then(p=>{d||(m=URL.createObjectURL(p),c(m))}).catch(()=>{d||i("img")}),()=>{d=!0,m&&URL.revokeObjectURL(m),c(null)}},[r,t]),{iconToUse:t,mode:r,svgText:s,blobUrl:u}}function at(e){const{icon:t,label:a,className:r,imgClassName:i,maskClassName:s,svgClassName:l,wrapperStyle:u,size:c}=e||{},d=r??"iconRenderer-icon",m=i??"iconRenderer-icon-image",p=s??"iconRenderer-icon-mask",f=l??"iconRenderer-icon-svg",y=typeof t=="string"?t:null,x=U1(y),{iconToUse:C,mode:h,svgText:_,blobUrl:g}=By(y),A=(B,E={})=>n.jsx("span",{className:d,style:u,...E,children:B}),b=typeof c=="number"?{width:c,height:c,objectFit:"contain"}:null,k=(B,E={})=>n.jsx("img",{src:B,alt:typeof a=="string"?a:typeof a=="number"?String(a):"",className:m,...E,style:b?{...E.style,...b}:E.style});if(!t)return null;if(typeof t!="string")return A(t);if(t==="none")return A(n.jsx("span",{className:f,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(x)try{return A(o.createElement(x,{className:f,size:typeof c=="number"?c:20}),{"aria-hidden":"true"})}catch{}if(C&&C.endsWith(".svg")){if(h==="mask"){const B={"--icon-url":g?`url(${g})`:`url(${C})`,...typeof c=="number"?{"--icon-size":`${c}px`}:null};return A(n.jsx("span",{className:p,style:B}),{"aria-hidden":"true"})}return h==="img"?A(k(C,{onError:B=>{B.currentTarget.onerror=null,B.currentTarget.style.display="none"}}),{"aria-hidden":"true"}):h==="inline"?A(n.jsx("span",{className:f,dangerouslySetInnerHTML:_?{__html:_}:void 0}),{"aria-hidden":"true"}):A(null,{"aria-hidden":"true"})}if(t.startsWith("/")||t.includes("/assets/")||t.match(/\.(png|jpg|jpeg|webp|gif)$/i))return k(Kr(t),{style:u,onError:B=>{B.currentTarget.onerror=null,B.currentTarget.style.display="none"}});const v=typeof c=="number"?c:20,w=`<svg width="${v}" height="${v}" 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 A(n.jsx("span",{className:f,dangerouslySetInnerHTML:{__html:w}}),{"aria-hidden":"true"})}function Vi(e){const[t,a]=o.useState(!1),r=o.useRef(!1),i=o.useRef(!0);o.useEffect(()=>(i.current=!0,()=>{i.current=!1}),[]);const s=o.useCallback(()=>{if(!e||r.current)return;const l=e();if(l&&typeof l.then=="function"){r.current=!0,a(!0);const u=()=>{r.current=!1,i.current&&a(!1)};l.then(u,u)}},[e]);return{pending:t,press:s}}function ky({icon:e,title:t,message:a,action:r,className:i}){const{pending:s,press:l}=Vi(r?.onClick);return n.jsxs("div",{className:_e("empty-state",i),children:[e&&n.jsx(at,{icon:e,size:48,className:"empty-state__icon"}),t&&n.jsx("p",{className:"empty-state__title h4",children:t}),a&&n.jsx("p",{className:"empty-state__message body-3",children:a}),r&&n.jsxs("button",{type:"button",className:"empty-state__action button button40 button40--bar button--variant-main button--align-center button--shape-rounded",onClick:l,disabled:s,"aria-busy":s||void 0,children:[r.icon&&n.jsx(at,{icon:r.icon,className:"button__icon"}),n.jsx("span",{className:"button__label button-1",children:r.label})]})]})}function Ay({message:e,hint:t,icon:a="triangle-alert",onRetry:r,retryLabel:i,className:s}){const{t:l}=xe.useTranslation(),{pending:u,press:c}=Vi(r);return n.jsxs("div",{className:_e("empty-state","error-state",s),role:"alert",children:[n.jsx(at,{icon:a,size:48,className:"empty-state__icon error-state__icon"}),n.jsx("p",{className:"empty-state__message body-3",children:e??l("common.errorState.message",{defaultValue:"\uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."})}),t&&n.jsx("p",{className:"error-state__hint caption-1",children:t}),r&&n.jsxs("button",{type:"button",className:"empty-state__action button button40 button40--bar button--variant-main button--align-center button--shape-rounded",onClick:c,disabled:u,"aria-busy":u||void 0,children:[n.jsx(at,{icon:"rotate-cw",className:"button__icon"}),n.jsx("span",{className:"button__label button-1",children:i??l("common.errorState.retry",{defaultValue:"\uB2E4\uC2DC \uC2DC\uB3C4"})})]})]})}function Ny({icon:e,title:t,description:a,cta:r,tone:i="main",disabled:s=!1,onClick:l,className:u=""}){const c=o.useId(),d=`${c}-title`,m=`${c}-desc`,p=`${c}-cta`,f=()=>{s||l?.()};return n.jsx("section",{role:"button",tabIndex:s?-1:0,"aria-disabled":s||void 0,"aria-labelledby":d,"aria-describedby":`${m} ${p}`,onClick:f,onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),f())},className:_e("action-card",`action-card--${i}`,s&&"action-card--disabled",u),children:n.jsxs("div",{className:"action-card__body",children:[n.jsx("span",{"aria-hidden":!0,className:"action-card__chip",children:n.jsx(at,{icon:e,size:34})}),n.jsxs("div",{className:"action-card__text",children:[n.jsx("h2",{id:d,className:"action-card__title",children:t}),n.jsx("p",{id:m,className:"action-card__desc",children:a})]}),n.jsxs("div",{className:"action-card__cta",children:[n.jsx("span",{id:p,children:r}),n.jsx("span",{"aria-hidden":!0,className:"action-card__arrow",children:n.jsx(at,{icon:"arrow-right",size:18})})]})]})})}function Ey({as:e="div",className:t="",children:a,storage:r,...i}){r&&Lf({resolveUrl:r.resolveUrl,download:r.download??(()=>Promise.reject(new Error("[ihabdevteam-core] CoreScope: download resolver\uAC00 \uC124\uC815\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."))),exists:r.exists,resolvePath:r.resolvePath,noiseBaseUrl:r.noiseBaseUrl,noiseFileGain:r.noiseFileGain});const s=_e("ihabdevteam-core-scope",t);return n.jsx(e,{className:s,...i,children:a})}function lo(e,t=!0){o.useEffect(()=>{if(!t)return;const a=e.current;if(!a)return;const r=i=>{if(i.key!=="Tab")return;const s=Array.from(a.querySelectorAll(Cn)).filter(m=>!m.closest('[aria-hidden="true"]'));if(!s.length){i.preventDefault();return}const l=s[0],u=s[s.length-1],c=document.activeElement,d=c===a;i.shiftKey&&(c===l||d)?(i.preventDefault(),u.focus()):!i.shiftKey&&c===u&&(i.preventDefault(),l.focus())};return a.addEventListener("keydown",r),()=>a.removeEventListener("keydown",r)},[e,t])}const Cn='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',uo=new WeakMap;function co(e,t){e&&uo.set(e,t)}function po(e){let t=e;for(let a=0;t&&!t.isConnected&&a<10;a++){let r=t;for(;r&&!uo.has(r);)r=r.parentElement;if(!r)return t;t=uo.get(r)??null}return t}function qi(e){return!(!e||!e.isConnected||e===document.body||typeof e.focus!="function"||e.disabled||e instanceof HTMLInputElement&&e.type==="hidden"||e.closest('[inert],[aria-hidden="true"],[hidden]'))}function ar(e,t,a){const r=e?.isConnected?e:a?.isConnected?a:null;if(qi(t)&&!(e&&e.contains(t)))return t.focus(),t;if(!r)return null;const i=Array.from(document.querySelectorAll(Cn)).filter(c=>!(e&&e.contains(c))&&qi(c));let s=null,l=null;for(const c of i)r.compareDocumentPosition(c)&Node.DOCUMENT_POSITION_PRECEDING?s=c:l||(l=c);const u=s??l;return u?.focus(),u}function Dy({title:e="",lines:t=[],notices:a=null,children:r,variant:i="default",dismissible:s=!1,className:l=""}){const{t:u}=xe.useTranslation(),[c,d]=o.useState(!1),m=o.useRef(null),p=o.useCallback(()=>{const C=m.current;C&&C.contains(document.activeElement)&&ar(C),d(!0)},[]);if(c)return null;const f=`notice-box notice-box--${i} body-2 ${l}`.trim(),y=s&&n.jsx("button",{type:"button",className:"notice-box__dismiss",onClick:p,"aria-label":u("common.close","\uB2EB\uAE30"),children:"\xD7"});if(a&&Array.isArray(a)&&a.length)return n.jsxs("div",{className:f,role:"note",children:[a.map((C,h)=>n.jsxs("div",{className:"notice-box__inner",children:[C.title?n.jsx("span",{className:"notice-box__title body-3",children:C.title}):null,n.jsx("div",{className:"notice-box__body",children:C.lines&&C.lines.length?n.jsx("div",{children:C.lines.map((_,g)=>n.jsx("span",{className:"notice-box__line body-3",children:_},g))}):C.children??null})]},h)),y]});const x=e||t.length?n.jsxs("div",{className:"notice-box__inner",children:[e?n.jsx("span",{className:"notice-box__title body-1",children:e}):null,n.jsx("div",{className:"notice-box__body",children:t.length?n.jsx("ul",{children:t.map((C,h)=>n.jsx("li",{className:"notice-box__line",children:C},h))}):r})]}):n.jsx("div",{className:"notice-box__inner",children:r});return n.jsxs("div",{ref:m,className:f,role:"note",children:[x,y]})}const sa=[];let rr=!1;function Ui(e){if(e.key!=="Escape"||e.defaultPrevented||e.isComposing||e.keyCode===229)return;const t=sa[sa.length-1];t&&(e.stopPropagation(),t())}function Gn(e){return sa.push(e),!rr&&typeof document<"u"&&(document.addEventListener("keydown",Ui),rr=!0),()=>{const t=sa.lastIndexOf(e);t>=0&&sa.splice(t,1),sa.length===0&&rr&&typeof document<"u"&&(document.removeEventListener("keydown",Ui),rr=!1)}}const Gi=o.createContext(null);function Sy(e){return/max-width:\s*7[0-9][0-9]px/.test(e)}const Ki=e=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(e).matches;function Ty(e){const t=o.useCallback(a=>{if(typeof window>"u"||!window.matchMedia)return()=>{};const r=window.matchMedia(e);return r.addEventListener?r.addEventListener("change",a):r.addListener&&r.addListener(a),()=>{r.removeEventListener?r.removeEventListener("change",a):r.removeListener&&r.removeListener(a)}},[e]);return As.useSyncExternalStore(t,()=>Ki(e),()=>!1)}function jy(e){const[t,a]=o.useState(Ki(e));return o.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const r=window.matchMedia(e),i=l=>a(l.matches),s=r;return s.addEventListener?s.addEventListener("change",i):s.addListener&&s.addListener(i),a(r.matches),()=>{s.removeEventListener?s.removeEventListener("change",i):s.removeListener&&s.removeListener(i)}},[e]),t}const My=typeof As.useSyncExternalStore=="function"?Ty:jy;function ln(e){const t=o.useContext(Gi),a=My(e);return t&&typeof t.mobile=="boolean"&&Sy(e)?t.mobile:a}const Ly="(prefers-reduced-motion: reduce)";function mo(){return ln(Ly)}function cn(e){const{anchorRect:t,anchorEl:a,offset:r=20,edgeMargin:i=20,onClose:s,closeOnOutsideClick:l=!0,className:u="",role:c="dialog",ariaLabel:d="",children:m,backdrop:p=!1,isMobilePopup:f=!1,useBorder:y=!0,header:x,focusOnOpen:C}=e||{},h=o.useRef(null),[_,g]=o.useState({position:"fixed",left:0,top:-9999}),[A,b]=o.useState(!1),[k,v]=o.useState("bottom"),[w,B]=o.useState(!1),[E,D]=o.useState(!1),N=!t&&!a,O=o.useCallback((V=!1)=>{if(E&&f)return;const R=a?a.getBoundingClientRect():t;if(!R||!h.current)return;const H=h.current,{offsetWidth:W,offsetHeight:I}=H,S=window.innerWidth,j=window.innerHeight,F=S-R.right,U=R.left,re=R.top,ne=j-R.bottom;let le=0,K=0,oe="top";if(re>=I+r)oe="top",K=R.top-r-I,le=R.left+R.width/2-W/2;else if(ne>=I+r)oe="bottom",K=R.bottom+r,le=R.left+R.width/2-W/2;else if(F>=W+r)oe="right",le=R.right+r,K=R.top+R.height/2-I/2;else if(U>=W+r)oe="left",le=R.left-r-W,K=R.top+R.height/2-I/2;else{const me=Math.max(re,ne,F,U);me===re?(oe="top",K=R.top-r-I,le=R.left+R.width/2-W/2):me===ne?(oe="bottom",K=R.bottom+r,le=R.left+R.width/2-W/2):me===F?(oe="right",le=R.right+r,K=R.top+R.height/2-I/2):(oe="left",le=R.left-r-W,K=R.top+R.height/2-I/2)}const Ae=Number.isFinite(Number(i))?Number(i):8;le=Math.min(Math.max(le,Ae),S-W-Ae),K=Math.min(Math.max(K,Ae),j-I-Ae);const Y=Math.round(le),Q=Math.round(K);V&&h.current?(h.current.style.left=`${Y}px`,h.current.style.top=`${Q}px`,h.current.dataset.placement=oe):(v(oe||k),g({position:"fixed",left:Y,top:Q}),B(!0))},[E,f,a,t,r,i,k]);o.useLayoutEffect(()=>{if(N)return;if(E&&f){g({position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"calc(100% - 40px)",maxWidth:"calc(100% - 40px)"}),B(!0);return}O();const V=requestAnimationFrame(()=>O());return()=>cancelAnimationFrame(V)},[t,a,r,m,i,N,E,f,O]),o.useEffect(()=>{if(N||E&&f||!h.current||typeof ResizeObserver>"u")return;const V=new ResizeObserver(()=>{t&&O()});return V.observe(h.current),()=>V.disconnect()},[t,m,i,N,E,f,O]),o.useEffect(()=>{if(N||E&&f)return;let V=null;const R=()=>{if(typeof requestAnimationFrame>"u"){O(!0);return}V===null&&(V=requestAnimationFrame(()=>{V=null,O(!0)}))},H=W=>{if(!a&&s){const I=W.target;if(I&&h.current&&h.current.contains(I))return;try{if(I&&I.closest&&I.closest("[data-tooltip-ignore]"))return}catch{}$.current(!0);return}R()};return window.addEventListener("resize",R),document.addEventListener("scroll",H,{passive:!0,capture:!0}),()=>{V!==null&&cancelAnimationFrame(V),window.removeEventListener("resize",R),document.removeEventListener("scroll",H,{capture:!0})}},[t,a,s,r,m,i,N,E,f,O]),o.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const V=window.matchMedia("(max-width: 768px)"),R=()=>D(!!V.matches);R();try{V.addEventListener?V.addEventListener("change",R):V.addListener(R)}catch{try{V.addListener(R)}catch{}}return()=>{try{V.removeEventListener?V.removeEventListener("change",R):V.removeListener(R)}catch{}}},[]);const P=o.useRef(!1),G=o.useRef(null),L=mo(),M=o.useCallback((V=!1)=>{if(s&&!(A||P.current)){if(P.current=!0,V){b(!0);try{s&&s()}catch{P.current=!1,b(!1)}return}b(!0),G.current=setTimeout(()=>{G.current=null;try{s&&s()}catch{P.current=!1,b(!1)}},L?0:200)}},[A,s,b,L]);o.useEffect(()=>()=>{G.current&&clearTimeout(G.current)},[]),o.useEffect(()=>{if(N)return;const V=W=>{const I=h.current;if(!I)return;const S=W.target;if(S&&!I.contains(S)){try{if(S.closest&&S.closest("[data-tooltip-ignore]"))return}catch{}l&&M(!0)}},R=W=>{const I=h.current;if(!I)return;const S=W.target;if(S&&!I.contains(S)){try{if(S.closest&&S.closest("[data-tooltip-ignore]"))return}catch{}l&&M(!0)}},H=W=>{if(W.key==="Tab"){const I=h.current;if(!I)return;const S=I.querySelectorAll(Cn);if(!S||S.length===0)return;const j=S[0],F=S[S.length-1],U=document.activeElement;W.shiftKey?U===j&&(W.preventDefault(),F.focus()):U===F&&(W.preventDefault(),j.focus())}};return document.addEventListener("pointerdown",V,!0),document.addEventListener("click",R,!0),document.addEventListener("keydown",H),()=>{document.removeEventListener("pointerdown",V,!0),document.removeEventListener("click",R,!0),document.removeEventListener("keydown",H)}},[s,l,M,N]);const $=o.useRef(M);o.useEffect(()=>{$.current=M});const Z=!!s;o.useEffect(()=>{if(!(N||!Z))return Gn(()=>$.current())},[N,Z]),o.useEffect(()=>{const V=()=>{M(!0)};return typeof document<"u"&&document.addEventListener("speechear-close-tooltips",V),()=>{typeof document<"u"&&document.removeEventListener("speechear-close-tooltips",V)}},[M]);const q=o.useRef(null);o.useEffect(()=>{if(N||C===!1||!w)return;const V=h.current;if(!V)return;const R=V.querySelector(Cn);if(R)return q.current=document.activeElement,R.focus(),()=>{const H=q.current;q.current=null,H&&document.contains(H)&&H.focus()}},[N,C,w]),o.useEffect(()=>{c==="dialog"&&!d&&St("tooltip-no-name",'[ihab/Tooltip] \uC774\uB984 \uC5C6\uB294 role="dialog" \uC785\uB2C8\uB2E4 \u2014 ariaLabel \uC744 \uC8FC\uC138\uC694. \uB0AD\uB3C5\uAE30\uAC00 "\uB300\uD654\uC0C1\uC790" \uB77C\uACE0\uB9CC \uC77D\uC2B5\uB2C8\uB2E4.')},[c,d]);const z=n.jsxs("div",{ref:h,className:`tooltip-content ${N?"tooltip-content--inline":""} ${y?"tooltip-content--bordered":""} ${A?"is-closing":""} ${u} ${E&&f?"is-mobile":""}`,role:c,"aria-label":d||void 0,style:N?{}:{..._,visibility:w?"visible":"hidden"},tabIndex:-1,"data-placement":k,"data-left":N?"":_.left,"data-top":N?"":_.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:[x!=null&&n.jsx("div",{className:"tooltip-content__header h5",children:x}),m]});if(N||typeof document>"u")return z;if(p||E&&f){const V=n.jsxs("div",{className:"tooltip-portal",children:[n.jsx("div",{className:"tooltip-backdrop",onClick:()=>{l&&M(!0)}}),z]});return en.createPortal(V,document.body)}return en.createPortal(z,document.body)}function Bn(e){const{anchorRect:t,text:a,offset:r=8,onClose:i,className:s="",ariaLabel:l}=e||{};return a?n.jsx(cn,{anchorRect:t,offset:r,onClose:i,closeOnOutsideClick:!1,className:`tooltip-info ${s}`,ariaLabel:l||a,children:n.jsx("div",{className:"tooltip-info__content body-3",children:a})}):null}function Kn(e){const{t}=xe.useTranslation(),{anchorRect:a,title:r,items:i,activeIndex:s=-1,showIndex:l=!0,onClose:u,offset:c=12,closeOnOutsideClick:d=!0}=e||{},m=(Array.isArray(i)?i:i?[i]:[]).map(p=>typeof p=="string"?{text:p}:p);return!m.length&&!r?null:n.jsx(cn,{anchorRect:a,offset:c,onClose:u,closeOnOutsideClick:d,useBorder:!1,className:"tooltip-description",ariaLabel:r||t("tooltip.description","\uC124\uBA85"),children:n.jsxs("div",{className:"tooltip-description__box",children:[r&&n.jsx("span",{className:"tooltip-description__title body-2",children:r}),n.jsx("ol",{className:"tooltip-description__items",children:m.map((p,f)=>n.jsxs("li",{className:`tooltip-description__item body-3${f===s?" tooltip-description__item--active":""}`,children:[l&&m.length>1&&n.jsxs("span",{className:"tooltip-description__index button-1",children:[f+1,"."]}),p.color&&n.jsx("span",{className:"tooltip-description__dot",style:{background:p.color},"aria-hidden":"true"}),n.jsx("span",{children:p.text})]},f))})]})})}function Da(e){const t=o.useRef(e);return o.useEffect(()=>{t.current=e}),t}let ho=0,Yi=!1;function Zi(){Yi||typeof document>"u"||(Yi=!0,document.addEventListener("pointerdown",e=>{e.pointerType==="touch"&&(ho=Date.now())},!0),document.addEventListener("touchstart",()=>{ho=Date.now()},{capture:!0,passive:!0}))}Zi();function ia(e){return!!e&&e.pointerType==="touch"}function la(e=1e3){return Zi(),Date.now()-ho<e}function fo(e,t,a,{enabled:r=!0,fallbackOnParent:i=!1}={}){const s=Da(e),l=Da(t),u=o.useRef(null),c=o.useRef(0);o.useEffect(()=>{if(!r||typeof document>"u")return;const m=p=>{const f=p,y=p.target,x=a.current,C=!!(y&&x&&x.contains(y));if(f.pointerType!=="touch"){C&&(u.current=null);return}if(C){u.current=s.current;return}u.current=null,s.current&&!(y&&y.closest?.(".tooltip-content"))&&l.current(!1,x)};return document.addEventListener("pointerdown",m,!0),()=>document.removeEventListener("pointerdown",m,!0)},[r,a,s,l]);const d=o.useCallback(m=>{const p=u.current;return p===null?!1:(u.current=null,c.current=Date.now(),l.current(!p,m??a.current),!0)},[a,l]);return o.useEffect(()=>{if(!r||!i)return;const m=a.current,p=m?.parentElement;if(!m||!p)return;let f=null;const y=h=>{const _=h.changedTouches?.[0];if(!_)return!1;const g=m.getBoundingClientRect();return _.clientX>=g.left&&_.clientX<=g.right&&_.clientY>=g.top&&_.clientY<=g.bottom},x=h=>{f=y(h)?s.current:null},C=h=>{const _=f;f=null,!(_===null||Date.now()-c.current<700||!y(h))&&(u.current=null,c.current=Date.now(),l.current(!_,m))};return p.addEventListener("touchstart",x,{passive:!0}),p.addEventListener("touchend",C),()=>{p.removeEventListener("touchstart",x),p.removeEventListener("touchend",C)}},[r,i,a,s,l]),{touchPress:d}}function $y(e,t){const{size:a=48,type:r,htmlType:i,href:s,target:l,rel:u,icon:c,rightIcon:d,label:m,count:p,subLabel:f,children:y,ariaLabel:x,variant:C="default",align:h="center",nowrap:_=!1,selected:g,toggleable:A=!1,ariaExpanded:b,ariaControls:k,disabled:v=!1,useLabel:w=!0,useBorder:B=!0,useBG:E=!0,useDisabledCovered:D=!1,useDisabledInvisible:N=!1,width:O,minWidth:P,onClick:G,onDisabledClick:L,showTooltipInfo:M=!1,tooltipInfoText:$=null,tooltipDescription:Z=null,tooltipOnly:q=!1,iconSize:z="medium",iconColor:V,shape:R="rounded",color:H,className:W,...I}=e,S=typeof a=="string"&&isNaN(Number(a))?a.toLowerCase():String(Number(a)||48),j=S.match(/^\d+$/)?`button${S}`:`button-${S}`,F=Number(a),U=!isNaN(F)&&F<40?"button-2":"button-1",re=m??y,ne=v||!!I.disabled,le=ne?D?"disabled-covered":N?"disabled-invisibled":"disabled":C,K=le?`button--variant-${le}`:"",oe=h?`button--align-${h}`:"",Ae=_?"button--nowrap":"",Y=R?`button--shape-${R}`:"",Q=typeof V=="string"&&V.startsWith("--")?`var(${V})`:V,me={...O?{width:typeof O=="number"?`${O}px`:O}:{},...P?{minWidth:typeof P=="number"?`${P}px`:P}:{},...B?{}:{"--button-border":ne?"0":"1px solid transparent"},...Q?{"--button-icon-color":Q}:{},...H?{"--color-main":H}:{}},De=w===!1?"":re,be=Array.isArray(De)?De.length>0:!!De,te=!!d,ue=r??(be||c||te?"bar":"dot"),fe=`${j}--${ue}`,ge=o.useRef(null);o.useEffect(()=>{!Ln||i!==void 0||ge.current?.closest("form")&&St(`button-in-form:${typeof re=="string"?re:""}`,'[ihab/Button] <form> \uC548\uC778\uB370 htmlType \uC774 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 \uC774 \uB2E8\uCD94\uB294 type="button" \uC774\uB77C \uD3FC\uC744 \uBCF4\uB0B4\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uBCF4\uB0B4\uB294 \uB2E8\uCD94\uBA74 htmlType="submit" \uC744 \uC8FC\uC138\uC694. \uD3FC\uC5D0 \uBCF4\uB0B4\uB294 \uB2E8\uCD94\uAC00 \uD558\uB098\uB3C4 \uC5C6\uC73C\uBA74 **Enter \uB85C\uB3C4 \uC548 \uBCF4\uB0B4\uC9D1\uB2C8\uB2E4**(\uCE78\uC774 \uB458 \uC774\uC0C1\uC77C \uB54C).'+(typeof re=="string"&&re?` \uB2E8\uCD94: ${re}`:""))},[i,re]);const Ce=o.useRef(t);Ce.current=t;const $e=o.useCallback(Re=>{ge.current=Re;const tt=Ce.current;typeof tt=="function"?tt(Re):tt&&(tt.current=Re)},[]),He=o.useRef(ne),[Te,Ie]=o.useState(!!g),[qe,mt]=o.useState(!1),[ct,rt]=o.useState(null),ft=o.useCallback(()=>mt(!1),[]),[ke,Ve]=o.useState(!1),we=o.useId();o.useEffect(()=>{typeof g=="boolean"&&Ie(g)},[g]),o.useEffect(()=>{if(He.current&&!ne&&ge.current){const Re=ge.current;let tt=!1;try{tt=Re.matches(":focus:not(:focus-visible)")}catch{tt=!1}tt&&Re.blur(),Re.style.pointerEvents="none";const xt=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ge.current&&(ge.current.style.pointerEvents="")})});return()=>cancelAnimationFrame(xt)}He.current=ne},[ne]);const Ue=typeof g=="boolean"?!!g:Te,Be=typeof b=="boolean"?void 0:A||typeof g=="boolean"?Ue?"true":"false":I["aria-pressed"],je=_e("button",j,fe,K,oe,Ae,Y,Ue?"is-selected":null,E?null:"button--no-bg",q?"button--tooltip-only":null,W),Se=`button__icon button__icon--${z}`,Xe=Array.isArray(f)?f:f!==void 0?[f]:[],Qe=()=>{if(Array.isArray(De))return De.map((tt,xt)=>{const Lt=Xe[xt];return n.jsxs("span",{className:`button__label-text${Lt!==void 0?" button__label-text--has-sub":""}`,children:[tt,Lt!==void 0&&n.jsx("span",{className:"button__sub-label-text caption-1",children:Lt})]},xt)});const Re=f!==void 0;return n.jsxs("span",{className:`button__label-text${Re?" button__label-text--has-sub":""}`,children:[De,p!=null&&n.jsx("span",{className:"button__count",children:p}),Re&&n.jsx("span",{className:"button__sub-label-text caption-1",children:f})]})},dt=Re=>{typeof g!="boolean"&&!A&&Ie(!1),Re.currentTarget.blur()},ht=Re=>{ne||(typeof I.onMouseLeave=="function"&&I.onMouseLeave(Re),dt(Re))},wt=Re=>{if(q&>&&it.touchPress(Re.currentTarget),ne){gt&&it.touchPress(Re.currentTarget),Re.preventDefault(),L?.(Re);return}typeof g!="boolean"&&A&&Ie(tt=>!tt),G?.(Re)},Ct=o.useCallback(()=>{(M||Z)&&(mt(!0),rt(ge.current?.getBoundingClientRect()??null))},[M,Z]),Nt=o.useCallback(()=>{(M||Z)&&(mt(!1),rt(null))},[M,Z]),gt=!!(M||Z),it=fo(qe,Re=>{Re?Ct():Nt()},ge,{enabled:gt&&(ne||q),fallbackOnParent:gt&&ne}),Ke={...I};delete Ke.disabled,delete Ke.className,delete Ke.faded,delete Ke.useFaded,delete Ke.loading,delete Ke.onMouseLeave,delete Ke.onPointerEnter,delete Ke.onPointerLeave,delete Ke.onPointerUp,delete Ke.onFocus,delete Ke.onBlur,ne&&(Object.keys(Ke).forEach(Re=>{/^on[A-Z]/.test(Re)&&typeof Ke[Re]=="function"&&delete Ke[Re]}),Ke["aria-disabled"]="true");const se=(typeof M=="string"?M:null)??(typeof $=="string"?$:null)??(typeof x=="string"?x:null)??(typeof re=="string"?re:null)??void 0,Ne=typeof x=="string"?x:typeof re=="string"?re:se,We=Z?[Z.title,...Z.items??[]].filter(Boolean).join(". "):M&&se&&se!==Ne?se:"",nt=[typeof I["aria-describedby"]=="string"?I["aria-describedby"]:void 0,We?we:null].filter(Boolean).join(" ")||void 0,Fe=(Re,tt)=>n.jsx(at,{icon:Re,label:tt??Ne,className:Se,imgClassName:"button__icon-img",maskClassName:"button__icon-mask",svgClassName:"button__icon-svg"}),Ge=()=>ue==="dot"?n.jsxs(n.Fragment,{children:[Fe(c),be&&n.jsx("span",{className:`button__label ${U}`,children:Qe()})]}):h==="center"&&c?n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"button__center-group",children:[n.jsx("span",{className:"button__left",children:Fe(c)}),be&&n.jsx("span",{className:`button__label ${U}`,children:Qe()})]}),te&&n.jsx("span",{className:"button__right",children:Fe(d)})]}):n.jsxs(n.Fragment,{children:[c&&n.jsx("span",{className:"button__left",children:Fe(c,x??re)}),be&&n.jsx("span",{className:`button__label ${U}`,children:Qe()}),te&&n.jsx("span",{className:"button__right",children:Fe(d)})]}),bt=!!s&&!ne;return n.jsxs(n.Fragment,{children:[n.jsxs(bt?"a":"button",{...Ke,ref:$e,...bt?{href:s,target:l,rel:u??(l==="_blank"?"noreferrer":void 0)}:{type:i??"button",disabled:ne&&!L&&!ke},className:je,"aria-pressed":Be,"aria-expanded":typeof b=="boolean"?b:I["aria-expanded"],"aria-controls":k??I["aria-controls"],"aria-label":Ne,"aria-disabled":ne&&(bt||L||ke)?!0:void 0,"aria-describedby":nt,style:me,onClick:wt,onMouseLeave:ht,onPointerEnter:Re=>{ia(Re)||Ct(),!ne&&typeof I.onPointerEnter=="function"&&I.onPointerEnter(Re)},onPointerLeave:Re=>{ia(Re)||Nt(),!ne&&typeof I.onPointerLeave=="function"&&I.onPointerLeave(Re)},onPointerUp:Re=>{ne&>&&it.touchPress(Re.currentTarget),!ne&&typeof I.onPointerUp=="function"&&I.onPointerUp(Re)},onFocus:Re=>{Ve(!0),la()||Ct(),!ne&&typeof I.onFocus=="function"&&I.onFocus(Re)},onBlur:Re=>{Ve(!1),ne||dt(Re),Nt(),!ne&&typeof I.onBlur=="function"&&I.onBlur(Re)},children:[Ge(),We?n.jsx("span",{id:we,hidden:!0,"aria-label":We}):null]}),qe&&Z?n.jsx(Kn,{anchorRect:ct,title:Z.title,items:Z.items,onClose:ft}):qe&&se?n.jsx(Bn,{anchorRect:ct,text:se,onClose:ft}):null]})}const pe=o.forwardRef($y);pe.displayName="Button";function kt(e,t,a){const r=o.useRef(null);return o.useLayoutEffect(()=>{const i=r.current?.parentElement??null;return t(i,e),()=>a(i)},[e,t,a]),r}const Sa={title:"--promo-banner-bg-title",description:"--promo-banner-bg-description"},Co=new WeakMap;function go(e){if(e)return Co.get(e)}function Gt(e,t){e&&(e.style.setProperty(Sa.title,t.title),e.style.setProperty(Sa.description,t.description),Co.set(e,t))}function Kt(e){e&&(e.style.removeProperty(Sa.title),e.style.removeProperty(Sa.description),Co.delete(e))}const Xi={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"default"};function Ji(){const e=kt(Xi,Gt,Kt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-main","aria-hidden":"true"})}const Qi={title:"var(--color-main)",description:"var(--color-gray)",actionVariant:"main"};function el(){const e=kt(Qi,Gt,Kt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-soft","aria-hidden":"true"})}const tl={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"main"};function nl(){const e=kt(tl,Gt,Kt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-sub","aria-hidden":"true"})}const al={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"main"};function rl(){const e=kt(al,Gt,Kt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-deep","aria-hidden":"true"})}const ol={title:"var(--color-darkSub)",description:"var(--color-gray)",actionVariant:"main"};function sl(){const e=kt(ol,Gt,Kt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-soft-sub","aria-hidden":"true"})}const il={title:"var(--color-black)",description:"var(--color-darkGray)",actionVariant:"main"};function ll(){const e=kt(il,Gt,Kt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-warm","aria-hidden":"true"})}const ul={title:"var(--color-white)",description:"var(--color-lightGray)",actionVariant:"main"};function cl(){const e=kt(ul,Gt,Kt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-dark","aria-hidden":"true"})}const dl={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"main"};function pl(){const e=kt(dl,Gt,Kt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-radial","aria-hidden":"true"})}const ml={title:"var(--color-darkMain)",description:"var(--color-gray)",actionVariant:"main"};function hl(){const e=kt(ml,Gt,Kt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-diagonal","aria-hidden":"true"})}const fl={title:"var(--color-darkSub)",description:"var(--color-gray)",actionVariant:"main"};function Cl(){const e=kt(fl,Gt,Kt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-dots","aria-hidden":"true"})}const gl={title:"var(--color-black)",description:"var(--color-gray)",actionVariant:"main"};function bl(){const e=kt(gl,Gt,Kt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-outline","aria-hidden":"true",children:n.jsx("span",{className:"promo-banner-bg-outline__dot"})})}const yl={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"main"};function vl(){const e=kt(yl,Gt,Kt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-success","aria-hidden":"true"})}const xl={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"sub"};function _l(){const e=kt(xl,Gt,Kt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-naver","aria-hidden":"true"})}const wl={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"transparent-white"};function Bl(){const e=kt(wl,Gt,Kt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-instagram","aria-hidden":"true"})}const Qt=(e,t,a)=>({key:e,get label(){return Rt.t(`promoBannerBg.${e}`,t)},textTone:a}),Ry=[Qt("main","\uBA54\uC778 \uADF8\uB77C\uB514\uC5B8\uD2B8","light"),Qt("soft","\uC18C\uD504\uD2B8","dark"),Qt("sub","\uC11C\uBE0C \uCEEC\uB7EC","light"),Qt("deep","\uB525 \uADF8\uB77C\uB514\uC5B8\uD2B8","light"),Qt("softSub","\uC18C\uD504\uD2B8 \uC11C\uBE0C","dark"),Qt("warm","\uC6DC(\uAC15\uC870)","dark"),Qt("dark","\uB2E4\uD06C","light"),Qt("radial","\uBC29\uC0AC\uD615 \uADF8\uB77C\uB514\uC5B8\uD2B8","light"),Qt("diagonal","\uB300\uAC01\uC120 \uD328\uD134","dark"),Qt("dots","\uB3C4\uD2B8 \uD328\uD134","dark"),Qt("outline","\uC544\uC6C3\uB77C\uC778","dark"),Qt("success","\uC131\uACF5/\uC644\uB8CC","light"),Qt("naver","\uB124\uC774\uBC84 \uBE14\uB85C\uADF8 \uC548\uB0B4","light"),Qt("instagram","\uC778\uC2A4\uD0C0\uADF8\uB7A8 \uC548\uB0B4","light")],kl={main:Ji,soft:el,sub:nl,deep:rl,softSub:sl,warm:ll,dark:cl,radial:pl,diagonal:hl,dots:Cl,outline:bl,success:vl,naver:_l,instagram:Bl};function Al({storageKey:e="fontScale",baseFont:t=20,minScale:a=.8,maxScale:r=1.4,step:i=.1,lineHeightRatio:s=1.4}={}){const l=A=>Math.max(a,Math.min(r,Number(A))),u=A=>{try{const b=localStorage.getItem(A),k=b?Number(b):1;return Number.isFinite(k)?l(k):l(1)}catch{return l(1)}},[c,d]=o.useState(()=>u(e)),[m,p]=o.useState(e);m!==e&&(p(e),d(u(e))),o.useEffect(()=>{try{localStorage.setItem(e,String(c))}catch{}},[e,c]);const f=A=>{d(typeof A=="function"?b=>l(A(b)):l(A))},y=()=>f(A=>+(A+i).toFixed(6)),x=()=>f(A=>+(A-i).toFixed(6)),C=c<r-Number.EPSILON,h=c>a+Number.EPSILON,_=Math.round(t*c),g=Math.round(_*s);return{scale:c,setScale:f,increase:y,decrease:x,canIncrease:C,canDecrease:h,fontSize:_,lineHeight:g}}function Nl(e,t){const a=Da(t);o.useEffect(()=>{const r=()=>a.current();try{window.addEventListener(e,r)}catch{}return()=>{try{window.removeEventListener(e,r)}catch{}}},[e,a])}const bo=" \xB7 ",El=(()=>{if(typeof document>"u")return"";const e=document.title;return e.includes(bo)?e.split(bo).pop()??e:e})(),Py=o.createContext(!1),Yn=[];let Dl=null;function Iy(e){const t=o.useContext(Py);o.useEffect(()=>{if(t||typeof e!="string"||!e)return;Yn.length===0&&(Dl=document.title);const a={text:El?`${e}${bo}${El}`:e};return Yn.push(a),document.title=a.text,()=>{const r=Yn.lastIndexOf(a);r>=0&&Yn.splice(r,1),document.title=Yn.length?Yn[Yn.length-1].text:Dl??document.title}},[e,t])}const Sl=[{value:"10",label:"10\uAC1C\uC529 \uBCF4\uAE30"},{value:"25",label:"25\uAC1C\uC529 \uBCF4\uAE30"},{value:"50",label:"50\uAC1C\uC529 \uBCF4\uAE30"},{value:"100",label:"100\uAC1C\uC529 \uBCF4\uAE30"}],Fy=(()=>{let e=null;return()=>(e||(e=new Intl.Collator("ko")),e)})();function an(e,t){return Fy().compare(e,t)}const or=new Map;function Oy(e){const t=or.get(e);if(t)return t;const a=[],r=/-?\d+(?:\.\d+)?/g;let i=0;for(let s=r.exec(e);s;s=r.exec(e)){let l=s.index,u=s[0];u[0]==="-"&&l>0&&!/\s/.test(e[l-1])&&(l+=1,u=u.slice(1)),l>i&&a.push(e.slice(i,l)),a.push(Number(u)),i=s.index+s[0].length}return i<e.length&&a.push(e.slice(i)),or.size>5e3&&or.clear(),or.set(e,a),a}function zy(e){if(!/^[\d\s-]+$/.test(e))return null;const t=e.replace(/\D/g,"");return t.length<9||t.length>11?null:t[0]==="0"||t[0]==="1"&&e!==t?t:null}function Wy(e,t){const a=d=>d==null||typeof d=="number"&&Number.isNaN(d)?"":String(d).trim(),r=a(e),i=a(t);if(r===i)return 0;const s=(d,m)=>{if(typeof d=="number"&&!Number.isNaN(d))return[d];const p=zy(m);return p!==null?[p]:Oy(m)},l=s(e,r),u=s(t,i),c=Math.min(l.length,u.length);for(let d=0;d<c;d++){const m=l[d],p=u[d];if(typeof m=="number"&&typeof p=="number"){if(m!==p)return m-p;continue}if(typeof m=="number")return-1;if(typeof p=="number")return 1;const f=an(m,p);if(f!==0)return f}return l.length!==u.length?l.length-u.length:an(r,i)}const Tl=e=>e==null||typeof e=="number"&&Number.isNaN(e)||typeof e=="string"&&e.trim()==="";function yo(e,t,a){const r=Tl(e),i=Tl(t);if(r||i)return r===i?0:r?1:-1;const s=Wy(e,t);return a?s:-s}function Hy(e,t,a){const{t:r}=xe.useTranslation(),[i,s]=o.useState(()=>{const x=a?.initialPageSize;return x&&Sl.some(C=>C.value===x)?x:"25"}),[l,u]=o.useState(1),[c,d]=o.useState(t);Object.is(c,t)||(d(t),l!==1&&u(1));const m=o.useMemo(()=>Sl.map(x=>({...x,label:r("visits.showN",{n:x.value})})),[r]),p=o.useCallback(x=>{s(x),u(1)},[]),f=Math.max(1,Math.ceil(e.length/Number(i)));(l>f||l<1||!Number.isFinite(l))&&u(Math.min(Math.max(1,Number.isFinite(l)?l:1),f));const y=Math.min(Math.max(1,Number.isFinite(l)?l:1),f);return{pageRows:o.useMemo(()=>e.slice((y-1)*Number(i),y*Number(i)),[e,y,i]),pageSizeProps:{options:m,value:i,onChange:p},paginationProps:{page:y,total:f,onChange:u},setPage:u}}function Vy(e){const[t,a]=o.useState(null),r=o.useRef(t),i=o.useRef(e?.onSortChange);i.current=e?.onSortChange;const s=o.useCallback(c=>{const d=r.current,m=d?.key===c?{key:c,asc:!d.asc}:{key:c,asc:!0};r.current=m,a(m),i.current?.(m)},[]),l=o.useCallback((c,d)=>({label:c,sortDir:t?.key===d?t.asc?"asc":"desc":null,onClick:()=>s(d)}),[t,s]),u=o.useCallback((c,d)=>{if(!t)return c;const{key:m,asc:p}=t;return[...c].sort((f,y)=>yo(d(f,m),d(y,m),p))},[t]);return{sort:t,field:l,sortRows:u}}const dn="\uC804\uCCB4";Object.fromEntries(Object.entries(Jf).map(([e,{nucleus:t}])=>[e,t]));const qy={labial:e=>e("common.phonetics.place.labial",{defaultValue:"\uC591\uC21C\uC74C"}),alveolar:e=>e("common.phonetics.place.alveolar",{defaultValue:"\uCE58\uC870\uC74C"}),palatal:e=>e("common.phonetics.place.palatal",{defaultValue:"\uACBD\uAD6C\uAC1C\uC74C"}),velar:e=>e("common.phonetics.place.velar",{defaultValue:"\uC5F0\uAD6C\uAC1C\uC74C"}),glottal:e=>e("common.phonetics.place.glottal",{defaultValue:"\uC131\uBB38\uC74C"})},Uy={frontHigh:e=>e("common.phonetics.vowel.frontHigh",{defaultValue:"\uC804\uC124 \uACE0\uBAA8\uC74C"}),backHighUnrounded:e=>e("common.phonetics.vowel.backHighUnrounded",{defaultValue:"\uD6C4\uC124 \uACE0\uBAA8\uC74C \uD3C9\uC21C"}),backHighRounded:e=>e("common.phonetics.vowel.backHighRounded",{defaultValue:"\uD6C4\uC124 \uACE0\uBAA8\uC74C \uC6D0\uC21C"}),frontMid:e=>e("common.phonetics.vowel.frontMid",{defaultValue:"\uC804\uC124 \uC911\uBAA8\uC74C"}),backMidUnrounded:e=>e("common.phonetics.vowel.backMidUnrounded",{defaultValue:"\uD6C4\uC124 \uC911\uBAA8\uC74C \uD3C9\uC21C"}),backMidRounded:e=>e("common.phonetics.vowel.backMidRounded",{defaultValue:"\uD6C4\uC124 \uC911\uBAA8\uC74C \uC6D0\uC21C"}),low:e=>e("common.phonetics.vowel.low",{defaultValue:"\uC800\uBAA8\uC74C"})},Gy={j:e=>e("common.phonetics.glide.j",{defaultValue:"j\uD65C\uC74C"}),w:e=>e("common.phonetics.glide.w",{defaultValue:"w\uD65C\uC74C"}),velar:e=>e("common.phonetics.glide.velar",{defaultValue:"\u0270\uD65C\uC74C"})};function Ky(e,t){if("place"in t)return qy[t.place](e);const a=Uy[t.vowel](e);return t.glide?`${a} \xB7 ${Gy[t.glide](e)}`:a}const Yy=(e,{defaultValue:t})=>t,jl=(e,t)=>({jamos:e,phonetic:t,tooltip:Ky(Yy,t)}),kn=(e,t)=>t.map(a=>jl([a],{place:e})),Pt=(e,t,a)=>jl([...e],a?{vowel:t,glide:a}:{vowel:t}),vo={cho:[kn("labial",["\u3142","\u3143","\u314D","\u3141"]),kn("alveolar",["\u3137","\u3138","\u314C","\u3134","\u3139"]),kn("alveolar",["\u3145","\u3146"]),kn("palatal",["\u3148","\u3149","\u314A"]),kn("velar",["\u3131","\u3132","\u314B"]),kn("glottal",["\u314E"])],jung:[[Pt("\u3163","frontHigh"),Pt("\u315F","frontHigh","w"),Pt("\u3162","frontHigh","velar")],[Pt("\u3161","backHighUnrounded")],[Pt("\u315C","backHighRounded"),Pt("\u3160","backHighRounded","j")],[Pt("\u3154\u3150","frontMid"),Pt("\u3156\u3152","frontMid","j"),Pt("\u3159\u315A\u315E","frontMid","w")],[Pt("\u3153","backMidUnrounded"),Pt("\u3155","backMidUnrounded","j"),Pt("\u315D","backMidUnrounded","w")],[Pt("\u3157","backMidRounded"),Pt("\u315B","backMidRounded","j")],[Pt("\u314F","low"),Pt("\u3151","low","j"),Pt("\u3158","low","w")]],jong:[kn("labial",["\u3142","\u3141"]),kn("alveolar",["\u3137","\u3134","\u3139"]),kn("velar",["\u3131","\u3147"])]},Zy=e=>e===Xy?[]:Array.from(e),Xy="__NO_CODA__",xo=e=>e.map(t=>t.map(({jamos:a,phonetic:r,tooltip:i})=>({v:a.join(""),phonetic:r,tooltip:i}))),Ml={cho:xo(vo.cho),jung:xo(vo.jung),jong:xo(vo.jong)};Ml.jung.flat().forEach(({v:e})=>{for(const t of Zy(e));}),new Set(Ml.cho.flat().map(e=>e.v));function Jy(e,t=!0){const a=Da(e);o.useEffect(()=>{if(t)return Gn(()=>{a.current?.()})},[t,a])}function Ta(){const[e,t]=o.useState(null),a=o.useCallback(s=>t(s.getBoundingClientRect()),[]),r=o.useCallback(()=>t(null),[]),i=o.useCallback(s=>{const l=s.getBoundingClientRect();t(u=>u?null:l)},[]);return{anchorRect:e,isOpen:e!=null,openAt:a,close:r,toggleAt:i}}function Qy(e){const[t,a]=o.useState(null),[r,i]=o.useState(null),s=o.useRef(null);o.useEffect(()=>()=>{s.current&&clearTimeout(s.current)},[]);const l=o.useCallback((c,d)=>{s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{a(c),i(d)},e)},[e]),u=o.useCallback(()=>{s.current&&clearTimeout(s.current),a(null),i(null)},[]);return{payload:t,anchorRect:r,openAfterDelay:l,close:u}}function Ll(e="warning"){const[t,a]=o.useState(""),[r,i]=o.useState(e),[s,l]=o.useState(0),u=o.useCallback((p,f)=>{i(f),a(p),l(y=>y+1)},[]),c=o.useCallback(p=>u(p,"warning"),[u]),d=o.useCallback(p=>u(p,"normal"),[u]),m=o.useCallback(()=>a(""),[]);return{toastMessage:t,toastType:r,toastKey:s,showToast:u,showWarning:c,showNormal:d,clearToast:m}}function ja(e){let t=0;if(e&&typeof window<"u"&&typeof window.getComputedStyle=="function")for(let a=e;a&&a!==document.body&&a!==document.documentElement;a=a.parentElement){const r=parseInt(window.getComputedStyle(a).zIndex,10);!Number.isNaN(r)&&r>t&&(t=r)}return t>0?`max(var(--z-menu, 1500), ${t+1})`:"var(--z-menu, 1500)"}function Ma({computeStyle:e,onScroll:t="close",onResize:a="close",ignoreOutsideClickSelector:r}){const[i,s]=o.useState(!1),[l,u]=o.useState({position:"fixed"}),c=o.useRef(null),d=o.useRef(null),m=o.useCallback(()=>{c.current&&u(e(c.current.getBoundingClientRect(),c.current))},[e]);o.useLayoutEffect(()=>{i&&m()},[i,m]),o.useEffect(()=>{if(!i)return;let y=d.current?.offsetHeight??0;y>0&&m();let x=0,C=null;typeof ResizeObserver<"u"&&d.current&&(C=new ResizeObserver(()=>{const w=d.current?.offsetHeight??0;if(w!==y){if(y=w,++x>4){C?.disconnect(),C=null;return}m()}}),C.observe(d.current));const h=w=>{const B=w.target;r&&B.closest?.(r)||c.current?.contains(B)||d.current?.contains(B)||s(!1)};document.addEventListener("mousedown",h),document.addEventListener("pointerdown",h);let _=null;const g=()=>{if(typeof requestAnimationFrame>"u"){m();return}_===null&&(_=requestAnimationFrame(()=>{_=null,m()}))},A=w=>{d.current?.contains(w.target)||(t==="reposition"?g():t==="close"&&s(!1))};t!=="ignore"&&window.addEventListener("scroll",A,!0);const b=()=>{a==="reposition"?g():a==="close"&&s(!1)};let k=null;const v=()=>{b(),k&&clearTimeout(k),k=setTimeout(()=>{k=null,a==="reposition"&&m()},250)};return a!=="ignore"&&(window.addEventListener("resize",b),window.addEventListener("orientationchange",v)),()=>{_!==null&&cancelAnimationFrame(_),C?.disconnect(),document.removeEventListener("mousedown",h),document.removeEventListener("pointerdown",h),t!=="ignore"&&window.removeEventListener("scroll",A,!0),a!=="ignore"&&(window.removeEventListener("resize",b),window.removeEventListener("orientationchange",v)),k&&clearTimeout(k)}},[i,m,t,a,r]),o.useEffect(()=>{if(i)return Gn(()=>s(!1))},[i]);const p=o.useCallback(()=>s(y=>!y),[]),f=o.useCallback(()=>s(!1),[]);return{open:i,setOpen:s,toggle:p,close:f,style:l,triggerRef:c,menuRef:d}}function e2(e,{mode:t="playback",autoStart:a=!1,onPlaySpeaker:r,onComplete:i,playMs:s=1100,feedbackMs:l=1500}={}){const[u,c]=o.useState([]),[d,m]=o.useState(0),[p,f]=o.useState("idle"),[y,x]=o.useState(null),[C,h]=o.useState([]),[_,g]=o.useState(null),[A,b]=o.useState(0),k=o.useRef(0),v=o.useCallback(R=>{k.current=typeof R=="function"?R(k.current):R,b(k.current)},[]),w=o.useRef(r),B=o.useRef(i);o.useEffect(()=>{w.current=r,B.current=i},[r,i]);const E=o.useRef([]),D=()=>{E.current.forEach(clearTimeout),E.current=[]},N=(R,H)=>{E.current.push(setTimeout(H,R))};o.useEffect(()=>()=>D(),[]);const O=u[d]?.id??null,P=o.useRef(null),G=o.useCallback(()=>{D(),f("playing"),h([]),g(null),v(0);let R=0;e.forEach((H,W)=>{N(R,()=>{m(W),x(H.id),w.current?.(H)}),N(R+1e3,()=>{x(null),h(I=>[...I,H.id])}),R+=1300}),N(R,()=>{f("done"),B.current?.({score:0,total:e.length})})},[e,v]),L=o.useCallback((R,H)=>{if(H>=R.length){f("done"),B.current?.({score:k.current,total:R.length});return}P.current=null,m(H),g(null),f("playing"),x(R[H].id),w.current?.(R[H]),N(s,()=>{x(null),f("waiting")})},[s]),M=o.useCallback(()=>{D();const R=Na(e);c(R),v(0),h([]),L(R,0)},[e,L,v]),$=o.useCallback(()=>{t==="playback"?(c(e),G()):M()},[t,e,G,M]),Z=o.useCallback(()=>{D(),f("idle"),x(null),h([]),g(null),m(0),v(0),c([])},[v]),q=e.map(R=>R.id).join("|");o.useEffect(()=>(a?$():Z(),()=>D()),[t,q,a]);const z=o.useCallback(R=>{p!=="waiting"||t==="playback"||P.current===d||(P.current=d,g(R),R===u[d]?.id&&v(H=>H+1),t==="exam"?(f("playing"),N(400,()=>L(u,d+1))):(f("feedback"),N(l,()=>L(u,d+1))))},[p,t,u,d,L,l,v]),V=t==="playback"?e.length:u.length;return{bind:{activeSpeakerId:y,playedIds:C,selectedId:_,answerId:O,showFeedback:p==="feedback",clickable:p==="waiting",onSelectSpeaker:z},index:d,total:V,score:A,phase:p,done:p==="done",start:$,reset:Z}}const _o=new Map,wo=new Map;function $l(e){const t=/^data:image\/svg\+xml(;base64)?,([\s\S]*)$/.exec(e);if(!t)return null;try{return t[1]?atob(t[2]):decodeURIComponent(t[2])}catch{return null}}function t2(e){return e.replace(/<script[\s\S]*?<\/script\s*>/gi,"").replace(/<script[^>]*\/>/gi,"").replace(/\son[a-z]+\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi,"").replace(/\s(xlink:)?href\s*=\s*("\s*javascript:[^"]*"|'\s*javascript:[^']*')/gi,"")}function n2(e){const t=wo.get(e);if(t)return t;const a=fetch(e).then(r=>r.ok?r.text():null).then(r=>(r!=null&&_o.set(e,r),r)).catch(()=>null).finally(()=>{wo.delete(e)});return wo.set(e,a),a}function a2(e,t=!0){const a=t&&e?$l(e)??_o.get(e)??null:null,[r,i]=o.useState(a);return o.useEffect(()=>{if(!t||!e){i(null);return}const s=$l(e)??_o.get(e)??null;if(s!==null){i(s);return}let l=!0;return n2(e).then(u=>{l&&i(u)}),()=>{l=!1}},[e,t]),r}function r2({title:e,description:t,actionLabel:a,onAction:r,bg:i,color:s,size:l="medium",actionVariant:u,titleColor:c,descriptionColor:d,className:m=""}){const p=i??s??"main",f=o.useRef(null),[y,x]=o.useState("main"),C=ln("(max-width: 767px)"),h=o.useRef({title:!1,description:!1});o.useLayoutEffect(()=>{const A=f.current;if(!A)return;const b=go(A),k=(v,w,B)=>{if(B!==void 0)A.style.setProperty(w,B),h.current[v]=!0;else if(h.current[v]){const E=b?.[v];E?A.style.setProperty(w,E):A.style.removeProperty(w),h.current[v]=!1}};k("title","--promo-banner-bg-title",c),k("description","--promo-banner-bg-description",d)},[c,d,p]),o.useLayoutEffect(()=>{const A=f.current;if(!A)return;const b=go(A);x(b?.actionVariant??"main")},[p]);const _=_e("promo-banner",`promo-banner--${l}`,m),g=kl[p];return n.jsxs("div",{ref:f,className:_,role:"note",children:[n.jsx(g,{}),n.jsxs("div",{className:"promo-banner__text",children:[n.jsx("span",{className:`promo-banner__title ${l==="small"?"body-2":"h2"}`,children:e}),t&&n.jsx("span",{className:"promo-banner__description body-3",children:t})]}),a&&r&&n.jsx(pe,{htmlType:"button",size:40,variant:u??y,shape:"pill",useBorder:!0,onClick:r,ariaLabel:a,...C?{type:"dot",icon:"arrow-right"}:{rightIcon:"arrow-right",label:a,minWidth:140}})]})}function o2({children:e,interval:t=5e3,dotTone:a,className:r="","aria-label":i}){const{t:s}=xe.useTranslation(),l=i??s("topBanner.ariaLabel","\uBC30\uB108"),u=o.Children.toArray(e),c=u.length,[d,m]=o.useState(0),[p,f]=o.useState(!1),[y,x]=o.useState(!1),[C,h]=o.useState(!1),_=o.useRef(null),g=o.useRef(null),A=o.useRef(null),b=mo(),k=p||y||C,v=c>0?Math.min(d,c-1):0;o.useEffect(()=>{if(c<2||t<=0||k||b)return;const B=window.setInterval(()=>m(E=>(Math.min(E,c-1)+1)%c),t);return()=>window.clearInterval(B)},[c,t,k,b]);const w=B=>{g.current!=null&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>{g.current=null,h(!1)},B)};return o.useEffect(()=>()=>{g.current!=null&&window.clearTimeout(g.current)},[]),o.useEffect(()=>{if(!C)return;const B=E=>{E.pointerType==="touch"&&(A.current&&A.current.contains(E.target)||(g.current!=null&&(window.clearTimeout(g.current),g.current=null),h(!1)))};return document.addEventListener("pointerdown",B,!0),()=>document.removeEventListener("pointerdown",B,!0)},[C]),c===0?null:n.jsxs("section",{ref:A,className:_e("top-banner",r),"aria-label":l,"aria-roledescription":"carousel",onPointerEnter:B=>{_.current=B.pointerType},onPointerDown:B=>{_.current=B.pointerType,B.pointerType==="touch"&&(g.current!=null&&(window.clearTimeout(g.current),g.current=null),h(!0))},onPointerUp:B=>{B.pointerType==="touch"&&w(5e3)},onPointerCancel:B=>{B.pointerType==="touch"&&w(5e3)},onMouseEnter:()=>{_.current!=="touch"&&f(!0)},onMouseLeave:()=>f(!1),onFocus:B=>{let E=!0;try{E=B.target.matches(":focus-visible")}catch{E=!0}x(E)},onBlur:B=>{B.currentTarget.contains(B.relatedTarget)||x(!1)},children:[n.jsx("div",{className:"top-banner__viewport",children:n.jsx("div",{className:"top-banner__track",style:{transform:`translateX(-${v*100}%)`},children:u.map((B,E)=>n.jsx("div",{className:"top-banner__slide","aria-hidden":E!==v,...E!==v?{inert:!0}:{},children:B},E))})}),c>1&&n.jsx("div",{className:`top-banner__dots${(a?.[v]??"light")==="dark"?" top-banner__dots--dark":""}`,children:u.map((B,E)=>n.jsx("button",{type:"button",className:`top-banner__dot${E===v?" top-banner__dot--active":""}`,"aria-label":s("topBanner.dotAriaLabel",{count:c,index:E+1,defaultValue:`${c}\uAC1C \uC911 ${E+1}\uBC88\uC9F8 \uBC30\uB108`}),"aria-current":E===v,onClick:()=>m(E)},E))})]})}function s2({title:e,body:t,open:a=!1,onToggle:r,avatar:i,titleClassName:s="body-2",bodyClassName:l="body-2",className:u=""}){const{t:c}=xe.useTranslation();return n.jsxs("div",{className:`accordion-item ${a?"accordion-item--open":""} ${u}`.trim(),role:"listitem",children:[n.jsxs("div",{className:"accordion-item__header",role:"button",tabIndex:0,"aria-expanded":a,"data-accordion-header":!0,onClick:r,onKeyDown:d=>{if(d.key==="Enter"||d.key===" ")d.preventDefault(),r?.();else if(d.key==="ArrowDown"||d.key==="ArrowUp"){d.preventDefault();const m=d.currentTarget.closest('[role="list"]');if(!m)return;const p=Array.from(m.querySelectorAll("[data-accordion-header]")),f=p.indexOf(d.currentTarget);(d.key==="ArrowDown"?p[f+1]:p[f-1])?.focus()}},children:[i&&n.jsx("div",{className:"accordion-item__avatar",children:i}),n.jsx("div",{className:`accordion-item__title ${s}`,children:e}),n.jsx("div",{className:"accordion-item__chevron",children:n.jsx(at,{icon:a?"chevron-up":"chevron-down",label:a?c("accordion.collapse","\uC811\uAE30"):c("accordion.expand","\uD3BC\uCE58\uAE30"),className:"accordion-item__chevron-icon",imgClassName:"accordion-item__chevron-image"})})]}),a&&n.jsx("div",{className:`accordion-item__body ${l}`,children:typeof t=="string"?n.jsx("p",{children:t}):t})]})}function i2({items:e=[],defaultOpenIndex:t=0,size:a=72,className:r="",bodyClassName:i}){const[s,l]=o.useState({index:t}),u=(c,d)=>s.id!=null&&c.id!=null?c.id===s.id:s.id==null&&d===s.index;return n.jsx("div",{className:`accordion-group accordion-group--s${a} ${r}`.trim(),role:"list",children:e.map((c,d)=>n.jsx(s2,{title:c.title,body:c.body,avatar:c.avatar,open:u(c,d),onToggle:()=>l(u(c,d)?{index:-1}:{index:d,id:c.id}),bodyClassName:i},c.id??d))})}function l2(){return n.jsx("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:2.2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:n.jsx("polyline",{points:"2,6 5,9 10,3"})})}function u2(){return n.jsxs("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:2.2,strokeLinecap:"round","aria-hidden":"true",children:[n.jsx("line",{x1:"3",y1:"3",x2:"9",y2:"9"}),n.jsx("line",{x1:"9",y1:"3",x2:"3",y2:"9"})]})}function c2(){return n.jsx("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:2.2,strokeLinecap:"round","aria-hidden":"true",children:n.jsx("line",{x1:"2.5",y1:"6",x2:"9.5",y2:"6"})})}function At(e){const{t}=xe.useTranslation(),{type:a="bar",size:r,className:i="","aria-label":s,"aria-hidden":l}=e;if(a==="dot"){const{icon:k,number:v,position:w="top-right",onClick:B,animate:E=!1}=e,D=k??"check",N=v!==void 0?"number":D,O=typeof r=="number"?r:32,P=_e("circle-badge",`circle-badge--${N}`,`circle-badge--${w}`,`circle-badge--${O}`,E?"circle-badge--animate":"",B?"circle-badge--clickable":"",i),G=v!==void 0?t("badge.nthSelected",{n:v,defaultValue:"{{n}}\uBC88\uC9F8 \uC120\uD0DD"}):{check:t("badge.selected","\uC120\uD0DD\uB428"),remove:t("badge.remove","\uC81C\uAC70"),minus:t("badge.exclude","\uC81C\uC678")}[D];return n.jsxs("span",{className:P,onClick:B,onKeyDown:B?L=>{L.key!=="Enter"&&L.key!==" "||(L.preventDefault(),L.currentTarget.click())}:void 0,"aria-label":l?void 0:s??G,"aria-hidden":l||void 0,role:B?"button":l?void 0:"img",tabIndex:B?0:void 0,children:[v!==void 0&&v,v===void 0&&D==="check"&&n.jsx(l2,{}),v===void 0&&D==="remove"&&n.jsx(u2,{}),v===void 0&&D==="minus"&&n.jsx(c2,{})]})}const{label:u,children:c,variant:d="default",fill:m="filled",minWidth:p,iconLeft:f,iconRight:y,color:x}=e,C=typeof r=="number"?"medium":r??"medium",h={small:"caption-2b",medium:"body-3b",large:"body-2b"}[C]??"body-2b",_={small:12,medium:14,large:16}[C]??14,g=_e("badge",`badge--${d}`,`badge--${C}`,m!=="filled"?`badge--${m}`:"",h,i),A=x?.startsWith("--")?`var(${x})`:x,b=p!==void 0||A?{...p!==void 0?{minWidth:typeof p=="number"?`${p}px`:p}:{},...A?{"--badge-color":A}:{}}:void 0;return n.jsxs("span",{className:g,style:b,"aria-label":l?void 0:s,role:s&&!l?"img":void 0,"aria-hidden":l||void 0,children:[f&&n.jsx(at,{icon:f,size:_,className:"badge__icon"}),u??c,y&&n.jsx(at,{icon:y,size:_,className:"badge__icon"})]})}function La({columns:e=[],onClose:t,className:a="",size:r="medium"}){const{t:i}=xe.useTranslation(),s=r==="small"?40:48,[l,u]=o.useState([]),c=o.useMemo(()=>{const h=[{title:null,columns:e}];let _=e;for(const g of l){const A=_?.[g.ci]?.items?.[g.ii];if(!A||!Array.isArray(A.children)||!A.children.length)break;_=[{title:null,items:A.children}],h.push({title:A.label||null,columns:_})}return h},[e,l]),d=c[c.length-1],m=c.length-1,p=o.useCallback(()=>u(h=>h.slice(0,Math.max(0,Math.min(h.length,m)-1))),[m]),f=o.useRef(null),y=o.useRef(null),x=c.length;o.useEffect(()=>{y.current||(y.current=document.activeElement);let h=0,_=0;const g=()=>{const A=f.current?.querySelector("button:not([disabled])");if(A&&A.offsetParent){A.focus({preventScroll:!0});return}_++<20&&(h=requestAnimationFrame(g))};return h=requestAnimationFrame(g),()=>cancelAnimationFrame(h)},[x]),o.useEffect(()=>()=>{y.current?.focus?.({preventScroll:!0})},[]);const C=o.useCallback((h,_,g)=>{if(h){if(Array.isArray(h.children)&&h.children.length){u(A=>[...A.slice(0,m),{ci:_,ii:g}]);return}try{typeof h.onClick=="function"&&h.onClick()}catch{}try{h&&h.closeOnSelect&&typeof t=="function"&&t()}catch{}}},[t,m]);return n.jsxs("div",{className:`tooltip-menu tooltip-menu--${r} ${a}`,children:[(c.length>1||d.title)&&n.jsxs("div",{className:"tooltip-menu__header",children:[c.length>1?n.jsx(pe,{htmlType:"button",size:s,type:"dot",icon:"chevron-left",ariaLabel:i("common.back","\uB4A4\uB85C"),onClick:p,variant:"transparent-gray",useBorder:!1}):null,n.jsx("div",{className:"tooltip-menu__title button-1",children:d.title})]}),n.jsx("div",{className:"tooltip-menu__columns",ref:f,children:d.columns&&d.columns.map((h,_)=>n.jsxs("div",{className:"tooltip-menu__column",children:[h.title?n.jsx("div",{className:"tooltip-menu__column-title body-3",children:h.title}):null,n.jsx("div",{className:"tooltip-menu__items",children:(h.items||[]).map((g,A)=>n.jsxs(o.Fragment,{children:[g.separatorBefore&&A>0&&n.jsx("div",{className:"tooltip-menu__separator",role:"separator"}),n.jsx(pe,{htmlType:"button",className:"tooltip-menu__item",size:s,type:g.label?"bar":"dot",icon:g.selected?"check":g.icon||"none",rightIcon:Array.isArray(g.children)&&g.children.length?"chevron-right":g.badgeCount?n.jsx(At,{type:"dot",position:"inline",number:Math.min(g.badgeCount,99),size:24,"aria-hidden":!0}):void 0,label:g.label,ariaLabel:g.label&&g.badgeCount&&g.badgeCount>0?i("nav.badgeLabel",{label:g.label,count:g.badgeCount,defaultValue:"{{label}}, {{count}}\uAC1C"}):g.label,onClick:()=>C(g,_,A),selected:g.selected,disabled:g.disabled,showTooltipInfo:g.tooltip||!1,useBorder:!1,align:"left"})]},A))})]},_))})]})}const Rl=".content-area";function Bo(e,t="Nav"){try{const a=typeof e=="string"?document.querySelector(e):e?.current??document.querySelector(Rl);if(a){a.scrollTop=0;return}const r=document.scrollingElement??document.documentElement;r&&r.scrollHeight<=r.clientHeight&&St("nav-scroll-container",`[${t}] \uBCF8\uBB38\uC744 \uB9E8 \uC704\uB85C \uB418\uB3CC\uB9B4 \uD1B5\uC744 \uBABB \uCC3E\uC558\uB2E4(\uAE30\uBCF8 ${Rl}) \u2014 \uCC3D\uB3C4 \uAD6C\uB97C \uC218 \uC5C6\uC5B4 \uC544\uBB34 \uC77C\uB3C4 \uD558\uC9C0 \uC54A\uB294\uB2E4. scrollContainer \uB85C \uD1B5\uC744 \uC54C\uB824 \uC900\uB2E4.`),window.scrollTo({top:0})}catch{}}const ko=52,sr=10,Pl=e=>e&&e>0?e:0;function Il({items:e=[],activeKey:t,onChange:a,appMode:r,onAppModeChange:i,moreItems:s=[],scrollContainer:l}){const{t:u}=xe.useTranslation(),c=r==="manager"?"malgwi":"manager",d=r==="manager"?"arrow-left":"arrow-right",m=r==="manager"?u("nav.modeLabelMalgwi","\uB9D0\uADC0"):u("nav.modeLabelManager","\uB9D0\uADC0 \uB9E4\uB2C8\uC800"),p=o.useRef(null),[f,y]=o.useState(0),x=e.length;o.useEffect(()=>{const R=p.current;if(!R)return;const H=()=>{const S=typeof getComputedStyle=="function"?getComputedStyle(R):null,j=R.clientWidth-(parseFloat(S?.paddingLeft??"")||0)-(parseFloat(S?.paddingRight??"")||0),F=R.querySelector(".bottom-nav__left"),U=F?.nextElementSibling,re=(F?.offsetWidth??0)+(F&&U?.classList.contains("bottom-nav__divider")?U.offsetWidth:0);y(Math.max(0,j-re))};if(H(),typeof ResizeObserver>"u")return;const W=new ResizeObserver(H);W.observe(R);const I=R.querySelector(".bottom-nav__left");return I&&W.observe(I),()=>W.disconnect()},[i]);const C=ko+1,h=R=>Math.max(0,Math.floor((R+sr)/(ko+sr))),_=x*(ko+sr)-sr<=f,g=f<=0||s.length===0&&_?x:Math.min(x,h(f-C)),A=f>0&&g<x,b=A?g:x,k=e.slice(0,b),v=e.slice(b),w=A||s.length>0,B=o.useCallback((R,H)=>({position:"fixed",bottom:window.innerHeight-R.top+8,right:window.innerWidth-R.right,zIndex:ja(H)}),[]),E=o.useId(),{open:D,toggle:N,close:O,style:P,triggerRef:G,menuRef:L}=Ma({computeStyle:B,onScroll:"ignore",onResize:"reposition"}),M=o.useCallback((R,H)=>H>0?u("nav.badgeLabel",{label:R,count:H,defaultValue:"{{label}}, {{count}}\uAC1C"}):R,[u]),$=o.useCallback((R,H)=>H>0?u("nav.badgeInsideLabel",{label:R,count:H,defaultValue:"{{label}}, \uC548\uC5D0 \uC54C\uB9BC {{count}}\uAC1C"}):R,[u]),Z=o.useCallback(()=>i?.(c),[i,c]),q=o.useMemo(()=>v.find(R=>!!R.key&&R.key===t)??s.find(R=>R.selected||R.key&&R.key===t),[v,t,s]),z=o.useMemo(()=>[{items:[...v.map(R=>({label:R.label,icon:R.icon,badgeCount:R.badgeCount,selected:!!R.key&&R.key===t,closeOnSelect:!0,disabled:R.state==="disabled",onClick:()=>{R.state!=="disabled"&&(R.key&&a&&(a(R.key),Bo(l,"BottomNav")),O())}})),...s.map(R=>({label:R.label,icon:R.icon,badgeCount:R.badgeCount,selected:R.selected??(!!R.key&&R.key===t),closeOnSelect:!0,onClick:()=>{R.onClick?.(),O()}}))]}],[v,s,t,a,O]),V=[...v,...s].reduce((R,H)=>R+Pl(H.badgeCount),0);return n.jsxs("nav",{className:"bottom-nav",ref:p,"aria-label":u("nav.bottomNav","\uD558\uB2E8 \uB124\uBE44\uAC8C\uC774\uC158"),children:[i&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"bottom-nav__left",children:n.jsx(pe,{htmlType:"button",size:52,type:"dot",icon:d,ariaLabel:m,className:"bottom-nav-item",onClick:Z})}),n.jsx("div",{className:"bottom-nav__divider","aria-hidden":"true"})]}),n.jsx("div",{className:"bottom-nav__items",children:k.map((R,H)=>{const W=Pl(R.badgeCount);return n.jsxs("span",{className:"bottom-nav__slot",children:[n.jsx(pe,{htmlType:"button",size:52,type:"dot",icon:R.icon,ariaLabel:M(R.label,W),selected:!!R.key&&R.key===t,disabled:R.state==="disabled",className:"bottom-nav-item",onClick:()=>{R.key&&(a?.(R.key),Bo(l,"BottomNav"))}}),W>0&&n.jsx("span",{"aria-hidden":"true",children:n.jsx(At,{type:"dot",position:"top-right",number:Math.min(W,99),size:24})})]},R.key??`__slot-${H}`)})}),w&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"bottom-nav__divider","aria-hidden":"true"}),n.jsx("div",{className:"bottom-nav__right",children:n.jsxs("div",{ref:G,className:"bottom-nav__slot",children:[n.jsx(pe,{htmlType:"button",size:52,type:"dot",icon:q?.icon??"ellipsis",ariaLabel:$(q?.label??u("nav.more","\uB354\uBCF4\uAE30"),V),selected:!!q,className:"bottom-nav-item",onClick:N,"aria-expanded":D,"aria-controls":D?E:void 0}),V>0&&n.jsx("span",{"aria-hidden":"true",children:n.jsx(At,{type:"dot",position:"top-right",number:Math.min(V,99),size:24})}),D&&en.createPortal(n.jsx("div",{id:E,role:"group","aria-label":u("nav.moreMenu","\uB354\uBCF4\uAE30 \uBA54\uB274"),className:"tooltip-content",style:P,ref:L,children:n.jsx(La,{columns:z,onClose:O})}),document.body)]})})]})]})}function Fl(e){if(typeof e!="string")return!1;let t="";for(const r of e){const i=r.charCodeAt(0);i<=32||i>=127&&i<=159||(t+=r)}if(!t)return!1;const a=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(t);return a?["http","https","mailto","tel"].includes(a[1].toLowerCase()):!0}function Ol(e,t,a){return a&&a>0?e("nav.badgeLabel",{label:t,count:a,defaultValue:"{{label}}, {{count}}\uAC1C"}):t}function d2(e){const{t}=xe.useTranslation(),{activeKey:a,unreadCount:r,onDebug:i,onNotification:s,onSetting:l,onHelp:u,onFeedback:c,onAccount:d}=e||{},m="default";return i||s||l||u||c||d?n.jsxs("div",{className:"side-nav__footer",children:[i&&n.jsx(pe,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:m,icon:"terminal",ariaLabel:t("nav.debug","\uB514\uBC84\uADF8"),onClick:i,selected:a==="debug"}),s&&n.jsxs("span",{className:"side-nav__notification-wrap",children:[n.jsx(pe,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:m,icon:"bell",ariaLabel:Ol(t,t("nav.notifications","\uC54C\uB9BC"),r),onClick:s,selected:a==="notifications"}),!!r&&r>0&&n.jsx(At,{type:"dot",number:Math.min(r,99),size:24,"aria-hidden":!0})]}),l&&n.jsx(pe,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:m,icon:"settings",ariaLabel:t("nav.settings","\uC124\uC815"),onClick:l,selected:a==="settings"}),u&&n.jsx(pe,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:m,icon:"message-circle-question-mark",ariaLabel:t("nav.help","\uB3C4\uC6C0\uB9D0"),onClick:u,selected:a==="help"}),c&&n.jsx(pe,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:m,icon:"bug",ariaLabel:t("nav.feedback","\uBC84\uADF8\uC2E0\uACE0"),onClick:c,selected:a==="feedback"}),d&&n.jsx(pe,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:m,icon:"user-round",ariaLabel:t("nav.account","\uACC4\uC815"),onClick:d,selected:a==="account"})]}):null}function zl(e){const{t}=xe.useTranslation(),{item:a,itemKey:r,label:i,icon:s,active:l,onClick:u,style:c,state:d,labelStyle:m}=e||{},p=a?.key??r??"",f=a?.label??i??"",y=a?.icon??s??"",x=a?.badge??0,C=n.jsx("span",{className:"side-nav__icon-wrap",children:n.jsx(at,{icon:y,label:typeof f=="string"?f:void 0,className:"side-nav__icon",maskClassName:"side-nav__icon-image",imgClassName:void 0,svgClassName:void 0})}),h=d==="disabled",_=`side-nav__item ${l?"active":""} ${d||""} ${h?"disabled":""} ${a?.child?"side-nav__item--child":""}`,g=o.useCallback(A=>{if(h)return;const b=A.detail>0;if(b)try{A.currentTarget.blur()}catch{}u?.(p,A.currentTarget,b)},[h,p,u]);return n.jsxs("button",{type:"button",className:_,onClick:g,"aria-label":typeof f=="string"?Ol(t,f,x):void 0,"aria-current":l?"page":void 0,style:c,"aria-disabled":h,children:[C,n.jsx("span",{className:"side-nav__label button-1 f",style:m,children:f}),x>0&&n.jsx(At,{type:"dot",position:"inline",number:Math.min(x,99),size:24,"aria-hidden":!0}),d==="loading"&&n.jsx("span",{className:"side-nav__spinner",role:"img","aria-label":t("loader.loading","\uBD88\uB7EC\uC624\uB294 \uC911\u2026")})]})}function Wl(e){const{t}=xe.useTranslation(),{items:a=[],activeKey:r,onChange:i,unreadCount:s,onDebug:l,onNotification:u,onAccount:c,onSetting:d,onHelp:m,onFeedback:p,appMode:f,onAppModeChange:y,scrollContainer:x}=e||{},C=f==="manager",h=o.useCallback(()=>y?.(C?"malgwi":"manager"),[y,C]),_=o.useRef(null),[g,A]=o.useState(null);o.useEffect(()=>{const B=_.current;if(!B)return;let E=null;const D=()=>{const{scrollHeight:P,clientHeight:G,scrollTop:L}=B;if(P<=G+1){A(z=>z===null?z:null);return}const M=Math.max(24,G/P*G),$=G-M,Z=P-G,q={top:Math.round(L/Z*$),height:Math.round(M)};A(z=>z&&z.top===q.top&&z.height===q.height?z:q)},N=()=>{if(typeof requestAnimationFrame>"u"){D();return}E===null&&(E=requestAnimationFrame(()=>{E=null,D()}))};D(),B.addEventListener("scroll",N,{passive:!0});const O=typeof ResizeObserver<"u"?new ResizeObserver(N):null;O?.observe(B);for(const P of Array.from(B.children))O?.observe(P);return()=>{E!==null&&cancelAnimationFrame(E),B.removeEventListener("scroll",N),O?.disconnect()}},[a]);const b=o.useRef(null),k=o.useCallback(B=>{const E=_.current;E&&(B.preventDefault(),b.current={y:B.clientY,top:E.scrollTop},B.currentTarget.setPointerCapture(B.pointerId))},[]),v=o.useCallback(B=>{const E=_.current,D=b.current;!E||!D||(E.scrollTop=D.top+(B.clientY-D.y)*(E.scrollHeight/E.clientHeight))},[]),w=o.useCallback(B=>{b.current=null,B.currentTarget.hasPointerCapture(B.pointerId)&&B.currentTarget.releasePointerCapture(B.pointerId)},[]);return n.jsxs("nav",{ref:_,"aria-label":t("nav.mainMenu","\uBA54\uC778 \uBA54\uB274"),className:"side-nav__menu",children:[g&&n.jsx("div",{className:"side-nav__scroll","aria-hidden":"true",children:n.jsx("div",{className:"side-nav__scroll-thumb",style:{top:g.top,height:g.height},onPointerDown:k,onPointerMove:v,onPointerUp:w,onPointerCancel:w})}),n.jsxs("div",{className:"side-nav__menu-list",children:[(a||[]).filter(B=>!B.section&&(B.key||B.label)).map((B,E)=>n.jsxs(o.Fragment,{children:[B.divider&&n.jsx("div",{className:"side-nav__separator"}),n.jsx(zl,{item:B,active:!!B.key&&B.key===r,state:B.disabled?"disabled":void 0,onClick:(D,N,O)=>{if(B.disabled)return;if(B.href){if(Fl(B.href)&&window.open(B.href,"_blank","noopener,noreferrer"),O)try{N?.blur()}catch{}return}if(i?.(B.key),Bo(x,"SideNav"),!O)return;try{N?.blur()}catch{}if(typeof window<"u"&&window.matchMedia){if(!window.matchMedia("(min-width: 768px) and (max-width: 1023px)").matches)return}else return;const P=document.querySelector(".header");if(P){const G=typeof P.matches=="function";if(!(window.matchMedia("(hover: hover)").matches&&G&&P.matches(":hover"))){P.classList.add("header--force-collapsed");const L=()=>{P.classList.remove("header--force-collapsed"),P.removeEventListener("mouseenter",L)};P.addEventListener("mouseenter",L)}}}})]},B.key??`side-nav__item-${E}`)),y&&n.jsx("div",{className:"side-nav__separator side-nav__separator--short"}),y&&n.jsx(zl,{item:{key:"__mode-switch__",label:C?t("nav.goToMalgwi","\uB9D0\uADC0\uB85C \uC774\uB3D9"):t("nav.goToManager","\uB9D0\uADC0\uB9E4\uB2C8\uC800\uB85C \uC774\uB3D9"),icon:C?"arrow-left":"arrow-right"},onClick:h})]}),n.jsx(d2,{activeKey:r,unreadCount:s,onDebug:l,onNotification:u,onAccount:c,onSetting:d,onHelp:m,onFeedback:p})]})}var ir='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Logo_SpeechEar_kor" xmlns="http://www.w3.org/2000/svg" width="583.33" height="240" viewBox="0 0 583.33 240"><g id="text"><path d="M278.07,115.18V47.71h85.73v67.47h-85.73ZM408.4,173.42v20.18h-125.33v-44.02h96.5v-5.96h-96.88v-20.18h124.18v44.02h-96.11v5.96h97.65ZM305.56,70.97v20.76h30.95v-20.76h-30.95ZM423.39,92.88h-16.53v25.37h-27.68V45.98h27.68v20.18h16.53v26.72Z"/><path d="M527.58,113.83v26.33c-7.82,3.59-20.06,5.38-36.71,5.38h-1.73v48.06h-27.68v-48.06h-34.21v-26.33h64.01c16.4,0,28.51-1.79,36.33-5.38ZM435.31,75.77v-26.33h80.35v62.09h-27.68v-35.75h-52.67ZM563.33,193.61h-27.68V45.98h27.68v147.63Z"/></g><g id="symbol"><path d="M183.92,56.08c-8.48-15.54-24.97-26.08-43.92-26.08h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%234dcdc0"/><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23499cdf"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></g></svg>',Ao='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Logo_SpeechEarManager_ko" xmlns="http://www.w3.org/2000/svg" width="1035.43" height="240" viewBox="0 0 1035.43 240"><g id="text"><path d="M278.07,115.18V47.71h85.73v67.47h-85.73ZM408.4,173.42v20.18h-125.33v-44.02h96.5v-5.96h-96.88v-20.18h124.18v44.02h-96.11v5.96h97.65ZM305.56,70.97v20.76h30.95v-20.76h-30.95ZM423.39,92.88h-16.53v25.37h-27.68V45.98h27.68v20.18h16.53v26.72Z"/><path d="M527.58,113.83v26.33c-7.82,3.59-20.06,5.38-36.71,5.38h-1.73v48.06h-27.68v-48.06h-34.21v-26.33h64.01c16.4,0,28.51-1.79,36.33-5.38ZM435.31,75.77v-26.33h80.35v62.09h-27.68v-35.75h-52.67ZM563.33,193.61h-27.68V45.98h27.68v147.63Z"/><path d="M644.64,52.32v131.48h-58.24V52.32h58.24ZM634.45,173.81V62.32h-38.25v111.49h38.25ZM713.65,193.61h-10.19v-75.16h-28.64v72.66h-10V46.94h10v61.32h28.64v-62.28h10.19v147.63Z"/><path d="M819.46,171.6c6.6-1.35,12.08-3.11,16.44-5.29v10.19c-4.23,2.31-9.64,4.1-16.24,5.38-6.6,1.28-13.3,1.92-20.09,1.92h-57.28V51.36h10.57v122.25h46.71c6.66,0,13.29-.67,19.89-2.02ZM851.47,193.8V45.98h10.57v147.63l-10.57.19Z"/><path d="M935.66,113.64l48.44,62.28-8.27,6.34-43.06-56.13c-4.36,16.66-10.38,29.92-18.07,39.79-7.69,9.87-16.72,15.83-27.1,17.88v-10.76c8.71-2.05,16.21-8.07,22.49-18.07,6.28-10,11.05-22.97,14.32-38.92,3.27-15.95,5.03-33.86,5.29-53.73h-39.21v-10h88.61v10h-39.02c-.13,18.84-1.6,35.95-4.42,51.32ZM1015.43,193.61h-10.38v-79.39h-37.87v-10.19h37.87v-58.05h10.38v147.63Z"/></g><g id="symbol"><path d="M183.92,56.08c-8.48-15.54-24.97-26.08-43.92-26.08h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%234dcdc0"/><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23499cdf"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></g></svg>',p2='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="a" xmlns="http://www.w3.org/2000/svg" width="240" height="240" viewBox="0 0 240 240"><path d="M183.92,56.08c-8.48-15.54-24.97-26.08-43.92-26.08h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%234dcdc0"/><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23499cdf"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></svg>';function Hl({appMode:e}){const{t}=xe.useTranslation(),a=e==="manager",r=a?Ao:ir,i=p2;return n.jsxs("div",{className:"brand-identity__root","aria-label":t("header.biArea","BI \uC601\uC5ED"),children:[n.jsx("img",{src:i,alt:t("header.biSymbol","BI \uC2EC\uBCFC"),className:"brand-identity__image brand-identity__image--symbol"}),n.jsx("img",{src:r,alt:a?t("header.logoManager","\uB9D0\uADC0\uB9E4\uB2C8\uC800 \uB85C\uACE0"):t("header.logoMalgwi","\uB9D0\uADC0 \uB85C\uACE0"),className:"brand-identity__image brand-identity__image--logo"})]})}function Vl({activeKey:e,onChange:t,items:a,malgwiItems:r,managerItems:i,unreadCount:s,onDebug:l,onNotification:u,onAccount:c,onSetting:d,onHelp:m,onFeedback:p,appMode:f,onAppModeChange:y,scrollContainer:x}){const{t:C}=xe.useTranslation(),h=ln("(max-width: 767px)"),_=o.useMemo(()=>(a??[]).filter(P=>!P.section&&(P.key||P.label)).map(P=>({key:P.key,label:typeof P.label=="string"?P.label:void 0,icon:P.icon,state:P.disabled?"disabled":void 0,badgeCount:P.badge})),[a]),g=o.useCallback(P=>{const G=a?.find(L=>L.key===P);if(!G?.disabled){if(G?.href){Fl(G.href)&&window.open(G.href,"_blank","noopener,noreferrer");return}t?.(P)}},[a,t]),A=o.useMemo(()=>{const P=[];return l&&P.push({key:"debug",icon:"terminal",label:C("nav.debug","\uB514\uBC84\uADF8"),onClick:l}),u&&P.push({key:"notifications",icon:"bell",label:C("nav.notifications","\uC54C\uB9BC"),badgeCount:s,onClick:u}),d&&P.push({key:"settings",icon:"settings",label:C("nav.settings","\uC124\uC815"),onClick:d}),m&&P.push({key:"help",icon:"message-circle-question-mark",label:C("nav.help","\uB3C4\uC6C0\uB9D0"),onClick:m}),p&&P.push({key:"feedback",icon:"bug",label:C("nav.feedback","\uBC84\uADF8\uC2E0\uACE0"),onClick:p}),c&&P.push({key:"account",icon:"user-round",label:C("nav.account","\uACC4\uC815"),onClick:c}),P},[C,l,u,d,m,p,c,s]),b=o.useCallback((P,G)=>({position:"fixed",top:P.bottom+8,right:Math.max(8,window.innerWidth-P.right),zIndex:ja(G)}),[]),k=o.useId(),{open:v,toggle:w,close:B,style:E,triggerRef:D,menuRef:N}=Ma({computeStyle:b,onScroll:"ignore",onResize:"reposition"}),O=o.useMemo(()=>[{items:A.map(P=>({label:P.label,icon:P.icon,badgeCount:P.badgeCount,selected:P.selected??(!!P.key&&P.key===e),closeOnSelect:!0,onClick:()=>{P.onClick?.(),B()}}))}],[A,e,B]);return n.jsxs("aside",{className:`header${f==="manager"?" header--manager":""}`,children:[n.jsxs("div",{className:"header__bi",children:[n.jsx(Hl,{appMode:f}),n.jsxs("div",{className:"header__menu-button",ref:D,children:[n.jsx(pe,{htmlType:"button",size:48,type:"dot",shape:"pill",variant:"default",useBorder:!1,icon:"menu",ariaLabel:u&&s&&s>0?C("nav.badgeInsideLabel",{label:C("header.menuOpen","\uBA54\uB274 \uC5F4\uAE30"),count:s,defaultValue:"{{label}}, \uC548\uC5D0 \uC54C\uB9BC {{count}}\uAC1C"}):C("header.menuOpen","\uBA54\uB274 \uC5F4\uAE30"),onClick:w,"aria-expanded":v,"aria-controls":v?k:void 0}),!!u&&!!s&&s>0&&n.jsx(At,{type:"dot",number:Math.min(s,99),size:24,"aria-hidden":!0}),v&&en.createPortal(n.jsx("div",{id:k,role:"group","aria-label":C("header.utilMenu","\uC720\uD2F8\uB9AC\uD2F0 \uBA54\uB274"),className:"tooltip-content",style:E,ref:N,children:n.jsx(La,{columns:O,onClose:B})}),document.body)]})]}),n.jsx(Wl,{scrollContainer:x,items:a,activeKey:e??void 0,onChange:t,unreadCount:s,onDebug:l,onNotification:u,onAccount:c,onSetting:d,onHelp:m,onFeedback:p,appMode:f,onAppModeChange:y}),h&&n.jsx(Il,{items:_,activeKey:e??void 0,onChange:g,scrollContainer:x,appMode:f,onAppModeChange:y})]})}const m2=Vl,h2=()=>Rt.t("passCard.planSuffix","\uC774\uC6A9\uAD8C");function ql(e){if(!(e==null||e==="")){if(typeof e=="string"&&/^\s*\d[\d,]*\s*$/.test(e)){const t=Number(e.replace(/[,\s]/g,""));if(Number.isFinite(t))return oa(`${t.toLocaleString("ko-KR")}\uC6D0`)}return oa(typeof e=="number"?`${e.toLocaleString("ko-KR")}\uC6D0`:e)}}function f2(e){const t=`${e.code??""} ${e.name??""}`.toLowerCase();return/manager|매니저/.test(t)?"manager":"speechear"}function C2(e){if(e.durationDays&&e.durationDays>0){const s=e.durationDays;return s%365===0?`${s/365}\uB144`:`${s}\uC77C`}const t=(e.code??"").match(/(\d+)(d|y)\b/i);if(t)return t[2].toLowerCase()==="y"?`${t[1]}\uB144`:`${t[1]}\uC77C`;const a=e.name??"",r=a.match(/(\d+\s*(?:년|개월|주|일))\s*(?:이용권)?\s*$/);if(r)return r[1].replace(/\s+/g,"");const i=a.match(/(\d+)\s*-?\s*(day|year)s?\b/i);return i?i[2].toLowerCase()==="year"?`${i[1]}\uB144`:`${i[1]}\uC77C`:a||h2()}function g2(e){const t=(e??"").match(/(\d+)(d|y)\b/i);if(!t)return null;const a=Number(t[1]);return t[2].toLowerCase()==="y"?a*365:a}function Ul(e){return{type:e.type??f2(e),plan:C2(e),label:e.label,price:ql(e.price),originalPrice:ql(e.originalPrice),discountLabel:e.discountLabel}}var b2='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Logo_SpeechEar_kor_mono" xmlns="http://www.w3.org/2000/svg" width="583.33" height="240" viewBox="0 0 583.33 240"><g id="text"><path d="M278.07,115.18V47.71h85.73v67.47h-85.73ZM408.4,173.42v20.18h-125.33v-44.02h96.5v-5.96h-96.88v-20.18h124.18v44.02h-96.11v5.96h97.65ZM305.56,70.97v20.76h30.95v-20.76h-30.95ZM423.39,92.88h-16.53v25.37h-27.68V45.98h27.68v20.18h16.53v26.72Z" fill="%23fff"/><path d="M527.58,113.83v26.33c-7.82,3.59-20.06,5.38-36.71,5.38h-1.73v48.06h-27.68v-48.06h-34.21v-26.33h64.01c16.4,0,28.51-1.79,36.33-5.38ZM435.31,75.77v-26.33h80.35v62.09h-27.68v-35.75h-52.67ZM563.33,193.61h-27.68V45.98h27.68v147.63Z" fill="%23fff"/></g><g id="symbol"><g opacity=".5"><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23fff"/></g><path d="M140,30h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84-3.88-7.1-6.08-15.25-6.08-23.92v-80c0-16.57,13.43-30,30-30h80c8.66,0,16.81,2.21,23.92,6.08-8.48-15.54-24.97-26.08-43.92-26.08Z" fill="%23fff"/><path d="M183.92,56.08c3.88,7.1,6.08,15.25,6.08,23.92v80c0,16.57-13.43,30-30,30h-80c-8.66,0-16.81-2.21-23.92-6.08,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%23fff"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></g></svg>',y2='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Logo_SpeechEarManager_ko_mono" xmlns="http://www.w3.org/2000/svg" width="1035.43" height="240" viewBox="0 0 1035.43 240"><g id="text"><path d="M278.07,115.18V47.71h85.73v67.47h-85.73ZM408.4,173.42v20.18h-125.33v-44.02h96.5v-5.96h-96.88v-20.18h124.18v44.02h-96.11v5.96h97.65ZM305.56,70.97v20.76h30.95v-20.76h-30.95ZM423.39,92.88h-16.53v25.37h-27.68V45.98h27.68v20.18h16.53v26.72Z" fill="%23fff"/><path d="M527.58,113.83v26.33c-7.82,3.59-20.06,5.38-36.71,5.38h-1.73v48.06h-27.68v-48.06h-34.21v-26.33h64.01c16.4,0,28.51-1.79,36.33-5.38ZM435.31,75.77v-26.33h80.35v62.09h-27.68v-35.75h-52.67ZM563.33,193.61h-27.68V45.98h27.68v147.63Z" fill="%23fff"/><path d="M644.64,52.32v131.48h-58.24V52.32h58.24ZM634.45,173.81V62.32h-38.25v111.49h38.25ZM713.65,193.61h-10.19v-75.16h-28.64v72.66h-10V46.94h10v61.32h28.64v-62.28h10.19v147.63Z" fill="%23fff"/><path d="M819.46,171.6c6.6-1.35,12.08-3.11,16.44-5.29v10.19c-4.23,2.31-9.64,4.1-16.24,5.38-6.6,1.28-13.3,1.92-20.09,1.92h-57.28V51.36h10.57v122.25h46.71c6.66,0,13.29-.67,19.89-2.02ZM851.47,193.8V45.98h10.57v147.63l-10.57.19Z" fill="%23fff"/><path d="M935.66,113.64l48.44,62.28-8.27,6.34-43.06-56.13c-4.36,16.66-10.38,29.92-18.07,39.79-7.69,9.87-16.72,15.83-27.1,17.88v-10.76c8.71-2.05,16.21-8.07,22.49-18.07,6.28-10,11.05-22.97,14.32-38.92,3.27-15.95,5.03-33.86,5.29-53.73h-39.21v-10h88.61v10h-39.02c-.13,18.84-1.6,35.95-4.42,51.32ZM1015.43,193.61h-10.38v-79.39h-37.87v-10.19h37.87v-58.05h10.38v147.63Z" fill="%23fff"/></g><g id="symbol"><g opacity=".5"><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23fff"/></g><path d="M140,30h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84-3.88-7.1-6.08-15.25-6.08-23.92v-80c0-16.57,13.43-30,30-30h80c8.66,0,16.81,2.21,23.92,6.08-8.48-15.54-24.97-26.08-43.92-26.08Z" fill="%23fff"/><path d="M183.92,56.08c3.88,7.1,6.08,15.25,6.08,23.92v80c0,16.57-13.43,30-30,30h-80c-8.66,0-16.81-2.21-23.92-6.08,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%23fff"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></g></svg>',Gl='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Symbol_IHAB_white" xmlns="http://www.w3.org/2000/svg" width="240" height="240" viewBox="0 0 240 240"><path id="symbol" d="M190.71,49.29c-18.1-18.1-43.1-29.29-70.71-29.29s-34.94,28.87-53.03,46.97h0c-18.1,18.1-46.97,25.56-46.97,53.03s11.19,52.61,29.29,70.71c18.1,18.1,43.1,29.29,70.71,29.29s52.61-11.19,70.71-29.29c18.1-18.1,29.29-43.1,29.29-70.71s-11.19-52.61-29.29-70.71ZM155.36,155.36c-9.05,9.05-21.55,14.64-35.36,14.64s-26.31-5.6-35.36-14.64c-9.05-9.05-14.64-21.55-14.64-35.36s5.6-26.31,14.64-35.36c9.05-9.05,21.55-14.64,35.36-14.64s26.31,5.6,35.36,14.64c9.05,9.05,14.64,21.55,14.64,35.36s-5.6,26.31-14.64,35.36Z" fill="%23fff"/></svg>';const Zn={text:"--pass-card-text",sub:"--pass-card-sub",copyright:"--pass-card-copyright"},No=new WeakMap;function v2(e){if(e)return No.get(e)}function An(e,t){e&&(e.style.setProperty(Zn.text,t.text),e.style.setProperty(Zn.sub,t.sub),t.copyrightColor&&e.style.setProperty(Zn.copyright,t.copyrightColor),No.set(e,t))}function Nn(e){e&&(e.style.removeProperty(Zn.text),e.style.removeProperty(Zn.sub),e.style.removeProperty(Zn.copyright),No.delete(e))}const Kl={text:"var(--color-pureBlack)",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"#1a1a1a"};function Yl(e={}){const t=kt(Kl,An,Nn);return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-two-circle","aria-hidden":"true",children:[n.jsx("div",{className:"pass-card-bg-two-circle__c1"}),n.jsx("div",{className:"pass-card-bg-two-circle__c3"}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-two-circle__symbol",style:{"--symbol-url":`url("${Gl}")`}})]})}const Zl="M190.71,49.29c-18.1-18.1-43.1-29.29-70.71-29.29s-34.94,28.87-53.03,46.97h0c-18.1,18.1-46.97,25.56-46.97,53.03s11.19,52.61,29.29,70.71c18.1,18.1,43.1,29.29,70.71,29.29s52.61-11.19,70.71-29.29c18.1-18.1,29.29-43.1,29.29-70.71s-11.19-52.61-29.29-70.71Z",ua=240;var $a='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="a" xmlns="http://www.w3.org/2000/svg" width="240" height="240" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 240 240"><defs><linearGradient id="b" x1="62.99" y1="62.99" x2="190.71" y2="190.71" gradientUnits="userSpaceOnUse"><stop offset=".2" stop-color="%23499cdf"/><stop offset=".8" stop-color="%234dcdc0"/></linearGradient></defs><path d="M190.71,49.29c-18.1-18.1-43.1-29.29-70.71-29.29s-34.94,28.87-53.03,46.97h0c-18.1,18.1-46.97,25.56-46.97,53.03s11.19,52.61,29.29,70.71c18.1,18.1,43.1,29.29,70.71,29.29s52.61-11.19,70.71-29.29c18.1-18.1,29.29-43.1,29.29-70.71s-11.19-52.61-29.29-70.71ZM155.36,155.36c-9.05,9.05-21.55,14.64-35.36,14.64s-26.31-5.6-35.36-14.64c-9.05-9.05-14.64-21.55-14.64-35.36s5.6-26.31,14.64-35.36c9.05-9.05,21.55-14.64,35.36-14.64s26.31,5.6,35.36,14.64c9.05,9.05,14.64,21.55,14.64,35.36s-5.6,26.31-14.64,35.36Z" fill="url(%23b)"/></svg>';const x2={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"var(--color-main)"},_2=100,w2=[{scale:1,opacity:.55},{scale:2,opacity:.4},{scale:3.1,opacity:.28},{scale:4.5,opacity:.18},{scale:6,opacity:.1}];function Xl(e={}){const t=kt(x2,An,Nn),a="var(--color-main)",r=270,i=170;return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-sound-move","aria-hidden":"true",children:[n.jsx("svg",{className:"pass-card-bg-sound-move__svg",viewBox:"0 0 300 189",preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",children:w2.map(({scale:s,opacity:l},u)=>n.jsx("g",{transform:`translate(${r} ${i}) scale(${s*_2/ua}) translate(${-ua/2} ${-ua/2})`,opacity:l,children:n.jsx("path",{d:Zl,fill:"none",stroke:a,strokeWidth:"1.5",vectorEffect:"non-scaling-stroke"})},u))}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-sound-move__symbol",style:{"--symbol-url":`url("${$a}")`}})]})}const B2={text:"#ffffff",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",logoColor:"_mono",copyrightColor:"#ffffff"},k2=100,A2=[{scale:1,opacity:.55},{scale:2,opacity:.4},{scale:3.1,opacity:.28},{scale:4.5,opacity:.18},{scale:6,opacity:.1}];function N2(e={}){const t=kt(B2,An,Nn),a="#ffffff",r=270,i=170;return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-sound-move-v1","aria-hidden":"true",children:[n.jsx("svg",{className:"pass-card-bg-sound-move-v1__svg",viewBox:"0 0 300 189",preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",children:A2.map(({scale:s,opacity:l},u)=>n.jsx("g",{transform:`translate(${r} ${i}) scale(${s*k2/ua}) translate(${-ua/2} ${-ua/2})`,opacity:l,children:n.jsx("path",{d:Zl,fill:"none",stroke:a,strokeWidth:"1.5",vectorEffect:"non-scaling-stroke"})},u))}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-sound-move-v1__symbol",style:{"--symbol-url":`url("${Gl}")`}})]})}const E2={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"var(--color-main)"};function D2(e={}){const t=kt(E2,An,Nn);return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-talk","aria-hidden":"true",children:[n.jsx("div",{className:"pass-card-bg-talk__shape pass-card-bg-talk__shape--left"}),n.jsx("div",{className:"pass-card-bg-talk__shape pass-card-bg-talk__shape--right"}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-talk__symbol",style:{"--symbol-url":`url("${$a}")`}})]})}const S2={Logo_SpeechEar_ko:{"":ir,_mono:b2},Logo_SpeechEarManager_ko:{"":Ao,_mono:y2}};function T2(e,t){if(e)return S2[e]?.[t??""]??void 0}const j2={speechear:ir,manager:Ao},M2={speechear:"Logo_SpeechEar_ko",manager:"Logo_SpeechEarManager_ko"},Jl=10;function L2(e){return e<=0?0:e>=86400?Math.floor(e/86400)*86400:e>=3600?Math.floor(e/3600)*3600:e>=60?Math.floor(e/60)*60:Math.floor(e)}function Ql(e,t){if(e<=0)return t("passCard.remainingSecond",{n:0});const a=Math.floor(e/86400);if(a>0)return t("passCard.remainingDay",{n:a});const r=Math.floor(e/3600);if(r>0)return t("passCard.remainingHour",{n:r});const i=Math.floor(e/60);return i>0?t("passCard.remainingMinute",{n:i}):t("passCard.remainingSecond",{n:Math.floor(e)})}function $2(e,t,a){if(e==="manager"){const r=/년/.test(t)||/yr|year/i.test(t)||/1년|365/.test(t),i=a==="\uC624\uD508\uD2B9\uAC00"||a===Rt.t("passCard.specialLabel");return r?n.jsx(D2,{}):i?n.jsx(N2,{}):n.jsx(Xl,{})}return n.jsx(Yl,{})}function eu({ariaLabel:e,product:t,showPrice:a=!1,plan:r,type:i,endDate:s,remainingSeconds:l,endInclusive:u=!1,state:c="active",bg:d,bgOnly:m=!1,textColor:p,subColor:f,copyrightColor:y,logoSrc:x,label:C,price:h,originalPrice:_,discountLabel:g,onUse:A,onRefund:b,onDelete:k}){const{t:v}=xe.useTranslation(),w=t?Ul(t):void 0,B=i??w?.type??"speechear",E=r??w?.plan??v("passCard.planSuffix","\uC774\uC6A9\uAD8C"),D=C??w?.label,N=h??(a?w?.price:void 0),O=_??(a?w?.originalPrice:void 0),P=g??w?.discountLabel,G=o.useMemo(()=>{if(N)return null;const Y=t?.durationDays??g2(t?.code);if(!Y||Y<=0)return l!=null?{percent:null,remainingLabel:Ql(l,v)}:null;const Q=Y*86400;let me;if(l!=null)me=l;else if((c==="active"||c==="expired")&&s){const te=new Date(s).getTime();if(Number.isNaN(te))return null;const ue=/^(\d{4})-(\d{2})-(\d{2})/.exec(String(s)),fe=/^(\d{4})-(\d{2})-(\d{2})/.exec(Ea()),ge=Math.round(ue&&fe?(Date.UTC(+ue[1],+ue[2]-1,+ue[3])-Date.UTC(+fe[1],+fe[2]-1,+fe[3]))/864e5:(te-Date.now())/864e5);me=Math.max(0,u?ge+1:ge)*86400}else c==="expired"?me=0:me=Q;const De=L2(me),be=Math.max(0,Math.min(100,Math.floor(Math.min(De,Q)/Q*100)));return c==="pending"&&be>=100?null:{percent:be,remainingLabel:c==="expired"?v("passCard.expired","\uB9CC\uB8CC\uB428"):Ql(me,v)}},[N,c,s,l,u,t?.durationDays,t?.code,v]),L=o.useRef(null),[M,$]=o.useState({}),[Z,q]=o.useState(null),z=!!(A||b||k),V=o.useRef(!1),R=o.useRef(void 0),[H,W]=o.useState(x);o.useLayoutEffect(()=>{W(x)},[x]),o.useLayoutEffect(()=>{const Y=L.current;Y&&(p!==void 0&&Y.style.setProperty("--pass-card-text",p),f!==void 0&&Y.style.setProperty("--pass-card-sub",f),y!==void 0&&Y.style.setProperty("--pass-card-copyright",y))},[p,f,y]),o.useLayoutEffect(()=>{const Y=L.current;if(!Y)return;const Q=v2(Y);if(!x){const me=M2[B],De=c==="expired"?"_mono":Q?.logoColor??"",be=T2(me,De);W(be)}},[d,x,B,c]);const I=Y=>{const Q=L.current;if(!Q)return null;const{left:me,top:De,width:be,height:te}=Q.getBoundingClientRect(),ue=(Y.clientX-me)/be-.5;return{rotateX:-((Y.clientY-De)/te-.5)*Jl,rotateY:ue*Jl}},S=(Y,Q)=>{const me=Q*-.7,De=Y*.7+10,be=20+(Math.abs(Y)+Math.abs(Q))*.4;return`${me}px ${De}px ${be}px rgba(0, 0, 0, 0.18)`},j=o.useCallback(Y=>{if(la())return;V.current=!0,clearTimeout(R.current),R.current=setTimeout(()=>{V.current=!1},200);const Q=I(Y);Q&&$({transform:`perspective(800px) rotateX(${Q.rotateX}deg) rotateY(${Q.rotateY}deg) scale3d(1.03, 1.03, 1.03)`,boxShadow:S(Q.rotateX,Q.rotateY),transition:"transform 0.25s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.25s cubic-bezier(0.23, 1, 0.32, 1)"})},[]),F=o.useCallback(Y=>{if(la())return;const Q=I(Y);if(!Q)return;const me=V.current?"transform 0.2s ease, box-shadow 0.2s ease":"none";$({transform:`perspective(800px) rotateX(${Q.rotateX}deg) rotateY(${Q.rotateY}deg) scale3d(1.03, 1.03, 1.03)`,boxShadow:S(Q.rotateX,Q.rotateY),transition:me})},[]),U=o.useCallback(()=>{clearTimeout(R.current),V.current=!1,$({transform:"perspective(800px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)",boxShadow:"0px 4px 16px rgba(0, 0, 0, 0.08)",transition:"transform 0.5s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.5s cubic-bezier(0.23, 1, 0.32, 1)"})},[]),re=o.useCallback(()=>q(null),[]),ne=o.useMemo(()=>{const Y=v("passCard.planSuffix","\uC774\uC6A9\uAD8C"),Q=E.replace("\uC774\uC6A9\uAD8C","").replace(Y==="\uC774\uC6A9\uAD8C"?"":Y,"").trim(),me=Q.match(/^(.*?)(일|년)$/);return me?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"h0 pass-card__plan-number",children:me[1]}),n.jsx("span",{className:"h5b pass-card__plan-unit",children:me[2]==="\uB144"?v("passCard.unitYear","\uB144"):v("passCard.unitDay","\uC77C")})]}):n.jsx("span",{className:"h0",children:Q})},[E,v]),le=o.useMemo(()=>{const Y=oa(N);if(!Y)return null;const Q=Y.match(/^([^\d]*)([\d.,]+)(.*)$/);if(!Q)return n.jsx("span",{className:"h1",children:Y});const[,me,De,be]=Q;return n.jsxs(n.Fragment,{children:[me&&n.jsx("span",{className:"h5 pass-card__price-symbol",children:me}),n.jsx("span",{className:"h1 pass-card__price-amount",children:De}),be.trim()&&n.jsx("span",{className:"h5 pass-card__price-symbol",children:be.trim()})]})},[N]),K=o.useCallback(()=>{z&&q(Y=>{if(Y)return null;const Q=L.current?.getBoundingClientRect();if(!Q)return null;const me=50;return{left:Q.left,right:Q.right,width:Q.width,height:Q.height,x:Q.x,y:Q.y+me,top:Q.top+me,bottom:Q.bottom+me}})},[z]),oe=o.useCallback(Y=>{z&&(Y.key==="Enter"||Y.key===" ")&&(Y.preventDefault(),K())},[z,K]),Ae=[{items:[...A?[{label:v("passCard.menu.use","\uC0AC\uC6A9\uD558\uAE30"),icon:"play",onClick:()=>{A(),q(null)},closeOnSelect:!0}]:[],...b?[{label:v("passCard.menu.refund","\uD658\uBD88\uD558\uAE30"),icon:"rotate-ccw",onClick:()=>{b(),q(null)},closeOnSelect:!0}]:[],...k?[{label:v("passCard.menu.delete","\uC0AD\uC81C\uD558\uAE30"),icon:"trash-2",onClick:()=>{k(),q(null)},closeOnSelect:!0}]:[]]}];return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"pass-card-frame",children:n.jsxs("div",{ref:L,className:`pass-card pass-card--${c}${z?" pass-card--clickable":""}`,style:M,onMouseEnter:j,onMouseMove:F,onMouseLeave:U,onPointerUp:Y=>{Y.pointerType==="touch"&&U()},onPointerCancel:Y=>{Y.pointerType==="touch"&&U()},onClick:K,onKeyDown:z?oe:void 0,role:z?"button":void 0,tabIndex:z?0:void 0,"aria-label":e,"aria-haspopup":z?"menu":void 0,"aria-expanded":z?!!Z:void 0,children:[d??$2(B,E,D),!m&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"pass-card__top",children:n.jsxs("div",{className:"pass-card__top-left",children:[n.jsx("img",{src:H??j2[B],className:"pass-card__logo",alt:B==="manager"?v("header.logoManager","\uB9D0\uADC0\uB9E4\uB2C8\uC800 \uB85C\uACE0"):v("header.logoMalgwi","\uB9D0\uADC0 \uB85C\uACE0")}),n.jsxs("div",{className:"pass-card__plan",children:[n.jsx("div",{children:ne}),n.jsx("span",{className:"h5b pass-card__plan-suffix",children:D?v("passCard.labeledPlan",{label:D}):v("passCard.planSuffix","\uC774\uC6A9\uAD8C")})]})]})}),N?n.jsxs("div",{className:"pass-card__price-area",children:[P&&n.jsx("span",{className:"pass-card__discount body-3",children:P}),n.jsxs("div",{className:"pass-card__price",children:[O&&n.jsx("span",{className:"pass-card__price-original body-3",children:oa(O)}),le]})]}):G?n.jsxs("div",{className:"pass-card__usage",children:[n.jsx("span",{className:"h5b pass-card__usage-remaining",children:G.remainingLabel}),G.percent!=null&&n.jsxs("span",{className:"pass-card__usage-percent",children:[n.jsx("span",{className:"h1 pass-card__usage-value",children:G.percent}),n.jsx("span",{className:"h5b pass-card__usage-symbol",children:"%"})]})]}):n.jsx("div",{className:"pass-card__copyright caption-2","aria-hidden":"true",children:"\xA9 IHAB Corp. All rights reserved."})]})]})}),Z&&n.jsx(cn,{anchorRect:Z,onClose:re,ariaLabel:v("tooltip.menu","\uBA54\uB274"),children:n.jsx(La,{columns:Ae,onClose:re,size:"small"})})]})}const R2={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"#1a1a1a"};function P2(e={}){const t=`passcard-sound-line-grad-${o.useId()}`,a=kt(R2,An,Nn);return n.jsxs("div",{ref:a,className:"pass-card-bg pass-card-bg-sound-line","aria-hidden":"true",children:[n.jsxs("svg",{className:"pass-card-bg-sound-line__svg",viewBox:"0 0 500 300",preserveAspectRatio:"xMidYMid slice",xmlns:"http://www.w3.org/2000/svg",children:[n.jsx("defs",{children:n.jsxs("linearGradient",{id:t,x1:"0",y1:"0",x2:"1",y2:"0",children:[n.jsx("stop",{offset:"20%",stopColor:"var(--color-main)"}),n.jsx("stop",{offset:"80%",stopColor:"var(--color-sub)"})]})}),n.jsx("g",{transform:"translate(25, 45)",children:n.jsx("path",{d:"M -30 150 C 40 80, 100 220, 160 150 S 280 80, 340 150 S 460 220, 510 150",fill:"none",stroke:`url(#${t})`,strokeWidth:"50",strokeLinecap:"round"})})]}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-sound-line__symbol",style:{"--symbol-url":`url("${$a}")`}})]})}const I2={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"var(--color-main)"};function F2(e={}){const t=kt(I2,An,Nn);return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-talk-v1","aria-hidden":"true",children:[n.jsx("div",{className:"pass-card-bg-talk-v1__shape pass-card-bg-talk-v1__shape--left"}),n.jsx("div",{className:"pass-card-bg-talk-v1__shape pass-card-bg-talk-v1__shape--right"}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-talk-v1__symbol",style:{"--symbol-url":`url("${$a}")`}})]})}function O2(e,t){if(e){if(t==="manager_pro")return n.jsx(F2,{});if(t==="manager_standard")return n.jsx(P2,{});if(t==="manager_lite")return n.jsx(Xl,{})}}function z2(e){const t=oa(e);if(!t)return null;const a=t.match(/^([^\d]*)([\d.,]+)(.*)$/);if(!a)return t;const[,r,i,s]=a;return n.jsxs(n.Fragment,{children:[r&&n.jsx("span",{className:"payment-plan__pricing-symbol h4",children:r}),i,s.trim()&&n.jsx("span",{className:"payment-plan__pricing-symbol h4",children:s.trim()})]})}function W2(e){const{t}=xe.useTranslation(),a=t("payment.plan.tierFallback",{defaultValue:"\uC774\uC6A9\uAD8C"}),r=t("payment.plan.openPromo",{defaultValue:"\uC624\uD508 \uD2B9\uAC00"}),{plan:i,onSelect:s,period:l="monthly",ownedCodes:u}=e||{},c=b=>!!b&&!!u?.includes(b),d=b=>b.onceOnly??/오픈\s*특가/.test(b.label??""),m=(i.tiers||[]).some(b=>d(b)&&c(b.code)),p=b=>{const k=b.prices?b.prices[l]:b.price;return k?(i.tiers||[]).some(v=>!!v.badge&&v.originals?.[l]===k):!1},f=i.colorToken?`var(--color-${i.colorToken})`:"var(--color-gray)",y=t("payment.plan.freePrice","\uBB34\uB8CC"),x=t("payment.products.mgrEnterprise.tier.price","\uBB38\uC758"),C=b=>b.prices?b.prices[l]:b.price,h=(i.tiers||[]).length>0&&(i.tiers||[]).every(b=>{const k=C(b);return k==="\uBB34\uB8CC"||k===y||k==="0\uC6D0"||typeof k=="string"&&/\d/.test(k)&&!/[1-9]/.test(k)}),_=(i.tiers||[]).length>0&&(i.tiers||[]).every(b=>{const k=C(b);return k==="\uBB38\uC758"||k===x}),g=i.group==="org",A=g?"manager":"speechear";return n.jsxs("div",{className:"payment-plan__card",style:{borderColor:f,"--plan-color":f},children:[i.cardBadge&&n.jsx("div",{className:"payment-plan__card-badge",children:n.jsx(At,{label:i.cardBadge,variant:"main",size:"medium",fill:"soft"})}),n.jsxs("div",{className:"payment-plan__title",children:[n.jsx("p",{className:"payment-plan__quote body-3b",style:{color:f},children:i.quote||"\xA0"}),n.jsx("h3",{className:"payment-plan__title-heading h1",children:i.tier??i.title}),n.jsx("p",{className:"payment-plan__subtitle body-3",children:i.subtitle})]}),n.jsxs("div",{className:"payment-plan__box",children:[n.jsx("span",{className:"payment-plan__box-title body-3b",children:t("payment.plan.recommendedFor","\uC774\uB7F0 \uBD84\uAED8 \uCD94\uCC9C\uD569\uB2C8\uB2E4.")}),n.jsx("ul",{className:"payment-plan__feature-list",children:(i.recommendedFor||[]).map((b,k)=>n.jsxs("li",{className:"payment-plan__feature-item body-3",children:[n.jsx(at,{icon:"check",size:18,className:"payment-plan__feature-check",wrapperStyle:{color:f}}),b]},k))})]}),n.jsxs("div",{className:"payment-plan__box",children:[n.jsx("span",{className:"payment-plan__box-title body-3b",children:t("payment.plan.features","\uD575\uC2EC \uAE30\uB2A5")}),n.jsx("ul",{className:"payment-plan__feature-list",children:(i.features||[]).map((b,k)=>n.jsxs("li",{className:"payment-plan__feature-item body-3",children:[n.jsx(at,{icon:"check",size:18,className:"payment-plan__feature-check",wrapperStyle:{color:f}}),b]},k))})]}),n.jsx("div",{className:"payment-plan__card-pricing",children:h?null:_?n.jsx(pe,{htmlType:"button",className:"payment-plan__contact-button",label:t("payment.plan.contact",{defaultValue:"\uBB38\uC758\uD558\uAE30"}),variant:"main",size:56,onClick:()=>i.tiers?.[0]&&s?.({...i.tiers[0],productId:i.id,productTitle:i.title})}):n.jsx(n.Fragment,{children:n.jsx("div",{className:"payment-plan__pricing-list",children:(i.tiers||[]).map(b=>{const k=b.label||a,v=d(b),w=v||b.openPromo===!0,B=k.replace(/^오픈\s*특가\s*/,"")||a,E=b.prices?b.prices[l]:b.price,D=b.badge?w?`${r}
|
|
852
|
-
${b.badge}`:b.badge:void 0;if(v&&c(b.code))return null;if(!b.badge&&!m)return p(b)?null:n.jsxs("div",{className:`payment-plan__pricing-row payment-plan__pricing-row--static${b.highlight?" payment-plan__pricing-row--highlight":""}`,children:[n.jsx("div",{className:"payment-plan__pricing-row-title",children:n.jsx("div",{className:"payment-plan__pricing-row-label h5b",children:b.label})}),n.jsx("div",{className:"payment-plan__pricing-row-price",children:n.jsx("span",{className:"payment-plan__pricing-current h1",children:z2(E)})})]},b.id);const N=i.tier??(g?i.title:void 0),O=n.jsx(eu,{showPrice:!0,product:{type:A,code:b.code,name:B,label:N,price:E,originalPrice:b.originals?.[l]??void 0,discountLabel:D},bg:O2(g,i.id)}),P=()=>s?.({...b,productId:i.id,productTitle:i.title,preview:O});return n.jsx("div",{className:"payment-plan__pricing-card",onClick:P,onKeyDown:s?G=>{G.target===G.currentTarget&&(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),P())}:void 0,role:s?"button":void 0,tabIndex:s?0:void 0,children:O},b.id)})})})})]})}function H2({variant:e="default"}){return n.jsxs("div",{className:`pass-card-bg pass-card-bg--${e}`,"aria-hidden":"true",children:[n.jsx("div",{className:"pass-card-bg__circle pass-card-bg__circle--1"}),n.jsx("div",{className:"pass-card-bg__circle pass-card-bg__circle--2"}),n.jsx("div",{className:"pass-card-bg__circle pass-card-bg__circle--3"})]})}var Eo='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Logo_IHAB_eng" xmlns="http://www.w3.org/2000/svg" width="765.08" height="240" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 765.08 240"><defs><linearGradient id="linear-gradient" x1="62.99" y1="62.99" x2="190.71" y2="190.71" gradientUnits="userSpaceOnUse"><stop offset=".2" stop-color="%23499cdf"/><stop offset=".8" stop-color="%234dcdc0"/></linearGradient></defs><path id="symbol" d="M190.71,49.29c-18.1-18.1-43.1-29.29-70.71-29.29s-34.94,28.87-53.03,46.97h0c-18.1,18.1-46.97,25.56-46.97,53.03s11.19,52.61,29.29,70.71c18.1,18.1,43.1,29.29,70.71,29.29s52.61-11.19,70.71-29.29c18.1-18.1,29.29-43.1,29.29-70.71s-11.19-52.61-29.29-70.71ZM155.36,155.36c-9.05,9.05-21.55,14.64-35.36,14.64s-26.31-5.6-35.36-14.64c-9.05-9.05-14.64-21.55-14.64-35.36s5.6-26.31,14.64-35.36c9.05-9.05,21.55-14.64,35.36-14.64s26.31,5.6,35.36,14.64c9.05,9.05,14.64,21.55,14.64,35.36s-5.6,26.31-14.64,35.36Z" fill="url(%23linear-gradient)"/><g id="text"><path d="M316.21,190.6h-36.74V50.61h36.74v139.99Z"/><path d="M335.16,50.61h36.74v55.11h51.63v-55.11h36.93v139.99h-36.93v-55.11h-51.63v55.11h-36.74V50.61Z"/><path d="M473.99,190.6l46.6-139.99h50.08l46.41,139.99h-39.64l-8.31-27.46h-46.99l-8.31,27.46h-39.83ZM560.62,135.3l-14.5-46.99h-1.16l-14.31,46.99h29.97Z"/><path d="M631,50.61h59.94c31.9,0,48.73,13.73,48.73,35.19,0,15.47-11.02,27.26-26.88,30.55v1.35c17.6.58,32.29,13.54,32.29,33.45,0,22.82-18.56,39.45-49.11,39.45h-64.97V50.61ZM701.77,93.53c0-8.89-6.96-13.92-17.02-13.92h-17.02v27.84h16.44c10.25,0,17.6-5.03,17.6-13.92ZM706.22,146.51c0-10.25-7.35-16.05-19.14-16.05h-19.34v30.55h18.76c13.15,0,19.72-5.03,19.72-14.5Z"/></g></svg>';const tu={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"#c9c9c9"};function V2(){const e=kt(tu,An,Nn);return n.jsx("div",{ref:e,className:"pass-card-bg pass-card-bg-ihab","aria-hidden":"true",children:n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-ihab__symbol-top",style:{"--symbol-url":`url("${Eo}")`}})})}const nu={text:"#ffffff",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEarManager_ko",logoColor:"_mono",copyrightColor:"#ffffff"};function q2(e={}){const t=kt(nu,An,Nn);return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-left-color-grid","aria-hidden":"true",children:[n.jsx("div",{className:"pass-card-bg-left-color-grid__bar"}),n.jsx("div",{className:"pass-card-bg-left-color-grid__grid"}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-left-color-grid__symbol",style:{"--symbol-url":`url("${$a}")`}})]})}function au({keys:e,anchor:t="top-right",scale:a,className:r=""}){const i=Array.isArray(e)?e:[e];return n.jsx("span",{className:_e("shortcut-badge",`shortcut-badge--${t}`,r),style:a===void 0?void 0:{"--shortcut-badge-scale":String(a)},children:i.map((s,l)=>n.jsxs("span",{className:"shortcut-badge__group",children:[l>0&&n.jsx("span",{className:"shortcut-badge__plus",children:"+"}),n.jsx("kbd",{className:"shortcut-badge__key",children:s})]},`${s}-${l}`))})}const Ra=(e,t,a)=>e+(t-e)*a;function U2({speakers:e,size:t=300,viewT:a=0,activeSpeakerId:r=null,playedIds:i,selectedId:s=null,answerId:l=null,showFeedback:u=!1,pulseSelected:c=!1,pulseSelectedDuration:d,pulseScale:m,clickable:p=!1,onSelectSpeaker:f,buttonSize:y=40,showIcon:x=!0,onCenterClick:C,centerLabel:h,centerDisabled:_=!1,centerAttention:g=!1,shortcutAnchor:A="top-right",shortcutScale:b,scaleShortcut:k=!1}){const{t:v}=xe.useTranslation(),w=Math.max(0,Math.min(1,a)),B=t/2,E=110/300,D=.18,N=Y=>t*(E+(Y-1)*D),O=Y=>{const Q=N(Y.row??1),me=Y.angleDeg*Math.PI/180;return{x:B+Q*Math.cos(me),y:B+Q*Math.sin(me)}},P=Math.max(...e.map(Y=>Y.row??1),1),G=t*.08,L=t*.1,M=t*.24,$=t-2*G,Z=t-L-M,q=t-M/2,z=o.useMemo(()=>[...new Set(e.map(Y=>Y.deg))].sort((Y,Q)=>Y-Q),[e]),V=z.length,R=Math.max(68,V>1?$/(V-1):0),H=o.useMemo(()=>new Map(z.map((Y,Q)=>[Y,Q])),[z]),W=Y=>{const Q=H.get(Y.deg)??0,me=B+(Q-(V-1)/2)*R,De=P>1?Math.min(68,Z/(P-1)):0,be=De*(P-1),te=L+(Z-be)/2,ue=P===1?L+Z*.4:te+(P-(Y.row??1))*De;return{x:me,y:ue}},I=Y=>{const Q=O(Y),me=W(Y);return{x:Ra(Q.x,me.x,w),y:Ra(Q.y,me.y,w)}},S={x:B,y:Ra(B,q,w)},j=Math.round(y*1.2),F=Math.round(Math.max(16,Math.min(80,y*.7))),U=[],re=new Map;for(const Y of e){const Q=Y.row??1;re.has(Q)||re.set(Q,[]),re.get(Q).push(Y)}for(const[Y,Q]of re.entries()){if(Q.length<2)continue;const me=[...Q].sort((qe,mt)=>qe.deg-mt.deg),De=me.map(qe=>I(qe)),be=me.map(qe=>qe.deg),te=be[be.length-1]-be[0],ue=te/(be.length-1),fe=360-te,ge=me.length>=3&&ue>0&&fe<=ue*1.5,Ce=Math.round(N(Y)*1e3)/1e3,$e=(qe,mt,ct,rt)=>{const ft=(mt.angleDeg-qe.angleDeg+540)%360-180;if(ft===0)return`L ${rt.x} ${rt.y}`;if(w===0)return`A ${Ce} ${Ce} 0 0 ${ft>0?1:0} ${rt.x} ${rt.y}`;const ke=(qe.angleDeg+ft/2)*Math.PI/180,Ve={x:B+Ce*Math.cos(ke),y:B+Ce*Math.sin(ke)},we={x:(ct.x+rt.x)/2,y:(ct.y+rt.y)/2},Ue={x:Ra(Ve.x,we.x,w),y:Ra(Ve.y,we.y,w)},Be={x:2*Ue.x-we.x,y:2*Ue.y-we.y};return`Q ${Be.x} ${Be.y} ${rt.x} ${rt.y}`},He=ge?[...me,me[0]]:me,Te=ge?[...De,De[0]]:De;let Ie=`M ${Te[0].x} ${Te[0].y}`;for(let qe=1;qe<Te.length;qe++)Ie+=" "+$e(He[qe-1],He[qe],Te[qe-1],Te[qe]);U.push({key:`arc-${Y}`,d:Ie})}const ne=o.useMemo(()=>new Set(i??[]),[i]),le=Y=>({idle:"",active:v("soundCompass.state.active","\uC18C\uB9AC \uB098\uB294 \uC911"),played:v("soundCompass.state.played","\uB4E4\uC74C"),correct:v("soundCompass.state.correct","\uC815\uB2F5"),wrong:v("soundCompass.state.wrong","\uC624\uB2F5")})[Y],K=Y=>{if(r===Y.id)return"active";if(u){if(Y.id===l)return"correct";if(Y.id===s&&s!==l)return"wrong"}return ne.has(Y.id)?"played":"idle"},oe=Y=>r===Y.id?"loop":u?Y.id===l?"loop":null:c&&Y.id===s?"once":null,Ae=(Y,Q)=>{switch(Y){case"played":case"correct":return n.jsx(Ts,{size:Q});case"wrong":return n.jsx(zs,{size:Q});default:return n.jsx(Os,{size:Q})}};return n.jsx("div",{className:"sound-compass",children:n.jsxs("div",{className:"sound-compass__compass-wrap",style:{width:t,height:t},children:[n.jsxs("svg",{width:t,height:t,viewBox:`0 0 ${t} ${t}`,className:"sound-compass__svg",children:[w===0&&e.map(Y=>{const{x:Q,y:me}=I(Y);return n.jsx("line",{x1:S.x,y1:S.y,x2:Q,y2:me,stroke:"#dde3ec",strokeWidth:"1"},Y.id)}),U.map(Y=>n.jsx("path",{d:Y.d,fill:"none",stroke:"#dde3ec",strokeWidth:"1"},Y.key))]}),g&&!_&&n.jsx("div",{className:"sound-compass__pulse sound-compass__pulse--active sound-compass__pulse--center",style:{width:j,height:j,left:S.x-j/2,top:S.y-j/2}}),C?n.jsx("button",{type:"button",className:`sound-compass__center sound-compass__center--button${_?" sound-compass__center--disabled":""}`,style:{width:j,height:j,left:S.x,top:S.y},"aria-label":h,"aria-disabled":_||void 0,tabIndex:_?-1:0,onClick:_?void 0:C,children:n.jsx($r,{size:F,color:"currentColor",strokeWidth:1.5})}):n.jsx("div",{className:"sound-compass__center",style:{width:j,height:j,left:S.x,top:S.y},children:n.jsx($r,{size:F,color:"currentColor",strokeWidth:1.5})}),e.map((Y,Q)=>{const{x:me,y:De}=I(Y),be=K(Y),te=oe(Y),ue={...b!==void 0||k?{"--shortcut-badge-scale":String(b??Math.max(.75,Math.min(3,y/56)))}:null,pointerEvents:p?"auto":"none",cursor:p?"pointer":"default",zIndex:be!=="idle"?10:1},fe=y,ge=Math.round(Math.max(10,Math.min(56,fe*.38))),Ce=Math.round(Math.max(7,Math.min(18,fe*.2))),$e=Math.round(Math.max(10,Math.min(56,fe*.4))),He=x==="answered"&&(be==="played"||be==="correct"||be==="wrong"),Te=x===!0||He,Ie=!He;return n.jsxs("div",{className:"sound-compass__speaker-pos",style:{...ue,left:me-fe/2,top:De-fe/2},children:[te&&n.jsx("div",{className:`sound-compass__pulse sound-compass__pulse--${be}`+(te==="once"?" sound-compass__pulse--once":""),style:{width:fe,height:fe,...te==="once"&&d!==void 0?{"--sc-pulse-duration-once":`${d}ms`}:null,...m!==void 0?{"--sc-pulse-scale":String(m)}:null}}),n.jsxs("button",{type:"button",tabIndex:p?0:-1,"aria-disabled":p?void 0:!0,onClick:p?()=>f?.(Y.id):void 0,className:`sound-compass__speaker-btn sound-compass__speaker-btn--${be}`,style:{width:fe,height:fe},"aria-label":le(be)?`${Y.label}, ${le(be)}`:Y.label,"aria-pressed":s!=null?Y.id===s:void 0,children:[Te&&Ae(be,ge),Ie&&n.jsx("span",{className:"sound-compass__speaker-number",style:{fontSize:x===!0?Ce:$e},children:Q+1})]}),Y.shortcut&&n.jsx(au,{keys:Y.shortcut,anchor:A,className:"sound-compass__speaker-shortcut"})]},Y.id)})]})})}function G2({children:e,position:t="top-left",size:a=24,className:r=""}){return n.jsx("span",{className:_e("circle-badge","circle-badge--number",`circle-badge--${a}`,`circle-badge--${t}`,r),children:e})}function K2({orientation:e="horizontal",label:t,className:a=""}){const r=_e("divider",`divider--${e}`,t&&e==="horizontal"?"divider--labeled":"",a);return e==="vertical"?n.jsx("div",{className:r,role:"separator","aria-orientation":"vertical"}):t?n.jsxs("div",{className:r,role:"separator","aria-orientation":"horizontal",children:[n.jsx("span",{className:"divider__line"}),n.jsx("span",{className:"divider__label caption-1",children:t}),n.jsx("span",{className:"divider__line"})]}):n.jsx("div",{className:r,role:"separator","aria-orientation":"horizontal"})}function ru({checked:e,onChange:t,name:a,value:r,disabled:i=!1,label:s,className:l=""}){const u=o.useId();return n.jsxs("label",{className:`radio${i?" radio--disabled":""} ${l}`.trim(),htmlFor:u,children:[n.jsx("input",{id:u,type:"radio",name:a,value:r,checked:e,disabled:i,onChange:c=>t?.(c.target.checked)}),n.jsx("span",{className:"radio__dot"}),s&&n.jsx("span",{className:"radio__label body-2",children:s})]})}function Y2({options:e,value:t,onChange:a,name:r,disabled:i=!1,direction:s="vertical",className:l="",ariaLabel:u}){const c=o.useId(),d=r??`radio-group-${c}`;return n.jsx("div",{className:`radio-group radio-group--${s} ${l}`.trim(),role:"radiogroup","aria-label":u,children:e.map(m=>n.jsx(ru,{name:d,value:m.value,checked:t===m.value,disabled:i||m.disabled,label:m.label,onChange:p=>{p&&a?.(m.value)}},m.value))})}const Z2={info:"info",success:"check-circle",warning:"alert-triangle",danger:"alert-circle"};function X2({tone:e="info",title:t,message:a,children:r,dismissible:i=!1,onDismiss:s,live:l,className:u=""}){const{t:c}=xe.useTranslation(),[d,m]=o.useState(!1),p=o.useRef(null),f=o.useCallback(()=>{const g=p.current;g&&g.contains(document.activeElement)&&ar(g),m(!0),s?.()},[s]);if(d)return null;const y=_e("alert",`alert--${e}`,u),x=l??(e==="danger"||e==="warning"?"assertive":"polite"),C=x==="assertive"?"alert":x==="polite"?"status":void 0,h=!!t,_=!!(a||r);return n.jsxs("div",{ref:p,className:y,role:C,children:[n.jsxs("div",{className:"alert__body",children:[n.jsxs("div",{className:"alert__header",children:[n.jsx(at,{icon:Z2[e],size:20,className:"alert__icon"}),h&&n.jsx("span",{className:"alert__title body-2",children:t}),!h&&_&&n.jsx("div",{className:"alert__message body-3",children:a||r})]}),h&&_&&n.jsx("div",{className:"alert__message alert__message--indented body-3",children:a||r})]}),i&&n.jsx("button",{type:"button",className:"alert__dismiss",onClick:f,"aria-label":c("common.close","\uB2EB\uAE30"),children:"\xD7"})]})}const J2={ready:"search",guide:"info",error:"circle-alert"};function Q2(e,t){const a=t.filter(Boolean);if(a.length===0)return e;const r=[];let i=0,s=0;for(const l of a){const u=e.indexOf(l,i);u<0||(u>i&&r.push(e.slice(i,u)),r.push(n.jsx("strong",{className:"search-summary__em body-2",children:l},s++)),i=u+l.length)}return i<e.length&&r.push(e.slice(i)),r}function ev({status:e="guide",label:t,children:a,emphasis:r,icon:i,className:s=""}){const l=i===!1?null:i??J2[e],u=_e("search-summary",`search-summary--${e}`,s),c=t??a,d=typeof c=="string"&&r&&r.length>0?Q2(c,r):c;return n.jsxs("div",{className:u,role:"status","aria-live":"polite",children:[l!=null&&n.jsx(at,{icon:l,size:18,className:"search-summary__icon"}),n.jsx("span",{className:"search-summary__text body-2",children:d})]})}function Pa({title:e,items:t}){const{t:a}=xe.useTranslation(),{anchorRect:r,openAt:i,close:s}=Ta(),l=o.useRef(null),u=fo(!!r,(c,d)=>{c&&d?i(l.current?.querySelector("button")??d):s()},l);return n.jsxs("span",{ref:l,style:{display:"contents"},children:[n.jsx(pe,{htmlType:"button",size:24,type:"dot",icon:"info",variant:"transparent-gray",useBorder:!1,selected:!!r,ariaLabel:a("common.info","\uC124\uBA85"),onPointerEnter:c=>{ia(c)||i(c.currentTarget)},onPointerLeave:c=>{ia(c)||s()},onClick:c=>{u.touchPress(c.currentTarget)},onFocus:c=>{la()||i(c.currentTarget)},onBlur:s}),r&&n.jsx(Kn,{title:e,items:t,showIndex:t.length>1,anchorRect:r,onClose:s})]})}function tv({items:e=[],value:t,onChange:a,className:r="",size:i=40}){const s=o.useId(),{t:l}=xe.useTranslation(),u=o.useRef(null),c=e.find(C=>!C.disabled)?.key,d=e.some(C=>C.key===t)?t:c??e[0]?.key,m=e.find(C=>C.key===d&&!C.disabled)?.key??c,p=()=>Array.from(u.current?.querySelectorAll('[role="tab"]:not(:disabled)')??[]),f=(C,h=p())=>{if(h.length===0)return;const _=(C%h.length+h.length)%h.length;h[_]?.focus(),h[_]?.click()},y=C=>{if(!["ArrowRight","ArrowDown","ArrowLeft","ArrowUp","Home","End"].includes(C.key))return;C.preventDefault();const h=p(),_=h.indexOf(C.currentTarget);C.key==="ArrowRight"||C.key==="ArrowDown"?f(_+1,h):C.key==="ArrowLeft"||C.key==="ArrowUp"?f(_-1,h):C.key==="Home"?f(0,h):f(h.length-1,h)},x=e.find(C=>C.key===d);return n.jsxs("div",{className:`tabs ${r}`.trim(),children:[n.jsx("div",{ref:u,className:`tabs__list tabs__list--${i}`,role:"tablist","aria-label":l("tabs.ariaLabel","\uD0ED"),children:e.map(C=>n.jsx("button",{id:`tabs__tab-${s}-${C.key}`,type:"button",role:"tab","aria-selected":C.key===d,"aria-controls":`tabs__panel-${s}-${C.key}`,disabled:C.disabled,tabIndex:C.key===m?0:-1,className:`tabs__tab body-2${C.key===d?" tabs__tab--active":""}`,onClick:()=>{C.key!==t&&a?.(C.key)},onKeyDown:y,children:C.label},C.key))}),x&&n.jsx("div",{id:`tabs__panel-${s}-${x.key}`,role:"tabpanel","aria-labelledby":`tabs__tab-${s}-${x.key}`,tabIndex:0,className:"tabs__panel",children:x.panel},x.key)]})}const nv={xs:12,sm:16,md:20,lg:28,xl:36};function av(e){const t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"":t.length===1?[...t[0]].slice(0,2).join("").toUpperCase():([...t[0]][0]+[...t[t.length-1]][0]).toUpperCase()}function rv({src:e,name:t,size:a="md",shape:r="circle",className:i=""}){const{t:s}=xe.useTranslation(),[l,u]=o.useState(null),c=!!e&&l===e,d=t?av(t):"",m=!!e&&!c,p=!m&&!!d,f=t||s("avatar.ariaLabel","\uC0AC\uC6A9\uC790 \uC544\uBC14\uD0C0");return n.jsxs("span",{className:`avatar avatar--${a} avatar--${r} ${i}`.trim(),role:"img","aria-label":f,children:[m&&n.jsx("img",{className:"avatar__image",src:e,alt:f,onError:()=>u(e??null)}),!m&&p&&n.jsx("span",{className:"avatar__initials","aria-hidden":"true",children:d}),!m&&!p&&n.jsx(at,{icon:"user-round",size:nv[a],className:"avatar__icon"})]})}function ov(e,t){if(!t)return!0;const a=t.split(",").map(s=>s.trim()).filter(Boolean);if(a.length===0)return!0;const r=e.name.toLowerCase(),i=e.type.toLowerCase();return a.some(s=>{const l=s.toLowerCase();return l.startsWith(".")?r.endsWith(l):l.endsWith("/*")?i.startsWith(l.slice(0,-1)):i===l})}function sv({onFilesSelected:e,accept:t,multiple:a=!1,disabled:r=!1,showFileList:i=!0,files:s,onRemove:l,className:u=""}){const{t:c}=xe.useTranslation(),d=o.useRef(null),[m,p]=o.useState(!1),[f,y]=o.useState([]),x=s??f,C=v=>{if(!v||v.length===0)return;const w=Array.from(v).filter(E=>ov(E,t));if(w.length===0)return;const B=a?w:w.slice(0,1);if(s===void 0){const E=a?[...x,...B]:B;y(E),e?.(E)}else e?.(B)},h=v=>{v.preventDefault(),!r&&p(!0)},_=v=>{v.preventDefault(),p(!1)},g=v=>{v.preventDefault(),p(!1),!r&&C(v.dataTransfer.files)},A=v=>{const w=v.target;try{C(w.files)}finally{w.value=""}},b=()=>{r||d.current?.click()},k=v=>{if(!r&&(l?.(v),s===void 0)){const w=x.filter((B,E)=>E!==v);y(w),l||e?.(w)}};return n.jsxs("div",{className:`file-upload ${u}`.trim(),children:[n.jsxs("div",{className:_e("file-upload__dropzone",m&&"file-upload__dropzone--dragging",r&&"file-upload__dropzone--disabled"),role:"button",tabIndex:r?-1:0,"aria-disabled":r,onClick:b,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),b())},onDragOver:h,onDragLeave:_,onDrop:g,children:[n.jsx(at,{icon:"upload",size:24,className:"file-upload__icon"}),n.jsx("span",{className:"file-upload__prompt body-2",children:c("fileUpload.dragPrompt","\uD30C\uC77C\uC744 \uC774\uACF3\uC5D0 \uB4DC\uB798\uADF8\uD558\uC5EC \uC5C5\uB85C\uB4DC")}),n.jsx("button",{type:"button",className:"file-upload__browse-button body-3",disabled:r,onClick:v=>{v.stopPropagation(),b()},children:c("fileUpload.browseButton","\uD30C\uC77C \uC120\uD0DD")}),n.jsx("input",{ref:d,type:"file",className:"file-upload__input",accept:t,multiple:a,disabled:r,onChange:A,tabIndex:-1})]}),i&&x.length>0&&n.jsx("ul",{className:"file-upload__list",children:x.map((v,w)=>n.jsxs("li",{className:"file-upload__list-item body-3",children:[n.jsx("span",{className:"file-upload__file-name body-3",children:v.name}),n.jsx("button",{type:"button",className:"file-upload__remove-button","aria-label":c("fileUpload.removeAriaLabel",{name:v.name}),disabled:r,onClick:()=>k(w),children:n.jsx(at,{icon:"x",size:14})})]},`${v.name}-${w}`))})]})}function iv({items:e,className:t=""}){const{t:a}=xe.useTranslation();return n.jsx("nav",{className:`breadcrumb ${t}`.trim(),"aria-label":a("breadcrumb.ariaLabel","\uC774\uB3D9 \uACBD\uB85C"),children:n.jsx("ol",{className:"breadcrumb__list",children:e.map((r,i)=>{const s=i===e.length-1;return n.jsxs("li",{className:"breadcrumb__item",children:[s?n.jsx("span",{className:"breadcrumb__current body-3","aria-current":"page",children:r.label}):r.href?n.jsx("a",{className:"breadcrumb__link body-3",href:r.href,target:r.target,rel:r.rel??(r.target==="_blank"?"noopener noreferrer":void 0),onClick:r.onClick,children:r.label}):r.onClick?n.jsx("button",{type:"button",className:"breadcrumb__link body-3",onClick:r.onClick,children:r.label}):n.jsx("span",{className:"breadcrumb__text body-3",children:r.label}),!s&&n.jsx(at,{icon:"chevron-right",size:14,className:"breadcrumb__separator"})]},i)})})})}const lv={small:14,medium:20,large:28};function uv({value:e,onChange:t,max:a=5,readOnly:r=!1,size:i="medium",ariaLabel:s,className:l=""}){const{t:u}=xe.useTranslation(),c=r||!t,[d,m]=o.useState(null),p=c?e:Number.isFinite(e)?Math.round(e):0,f=d??p,y=lv[i],x=v=>{v!==e&&t?.(v)},C=v=>{c||x(v)},h=v=>{c||la()||m(v)},_=o.useRef(null),g=v=>{const w=Math.min(a,Math.max(1,v));x(w),Array.from(_.current?.querySelectorAll("[data-star]")??[]).find(B=>B.dataset.star===String(w))?.focus()},A=v=>{if(!c){switch(v.key){case"ArrowRight":case"ArrowUp":g((p||0)+1);break;case"ArrowLeft":case"ArrowDown":g((p||1)-1);break;case"Home":g(1);break;case"End":g(a);break;default:return}v.preventDefault()}},b=p>=1&&p<=a?Math.round(p):1,k=()=>{c||m(null)};return n.jsx("div",{className:`rating rating--${i}${c?" rating--readOnly":""} ${l}`.trim(),ref:_,onKeyDown:A,role:c?"img":"radiogroup","aria-label":c?u("rating.valueLabel",{value:e,max:a}):s??u("rating.groupLabel","\uBCC4\uC810"),onMouseLeave:k,onPointerUp:v=>{v.pointerType==="touch"&&k()},onPointerCancel:v=>{v.pointerType==="touch"&&k()},children:Array.from({length:a},(v,w)=>{const B=w+1,E=Math.max(0,Math.min(1,f-w)),D=E>0&&E<1,N=n.jsxs("span",{className:"rating__star-wrap",children:[n.jsx(at,{icon:"star",size:y,className:"rating__star rating__star--empty"}),E>0&&n.jsx("span",{className:`rating__star-fill${D?" rating__star-fill--half":""}`,style:D?{width:`${E*100}%`}:void 0,children:n.jsx(at,{icon:"star",size:y,className:"rating__star rating__star--filled"})})]});return c?n.jsx("span",{className:"rating__item","aria-hidden":"true",children:N},B):n.jsx("button",{type:"button",className:"rating__item rating__item--interactive",role:"radio","aria-checked":p===B,"aria-label":u("rating.starLabel",{n:B}),"data-star":B,tabIndex:B===b?0:-1,onClick:()=>C(B),onMouseEnter:()=>h(B),children:N},B)})})}const cv=20,dv=["#499cdf","#4dcdc0","#2fae9e","#e6b94e","#d9534f","#e06b68","#bfc7d1"];function pv({value:e,onChange:t,palette:a=dv,size:r=40,className:i="",ariaLabel:s}){const{t:l}=xe.useTranslation();return n.jsx("div",{className:`color-picker ${i}`.trim(),role:"group","aria-label":s,children:a.map(u=>{const c=e?.toLowerCase()===u.toLowerCase();return n.jsx("button",{type:"button",className:`color-picker__swatch color-picker__swatch--${r}`,style:{backgroundColor:u},onClick:()=>t(u),"aria-pressed":c,"aria-label":c?`${u} ${l("colorPicker.selected","\uC120\uD0DD\uB428")}`:u,children:c&&n.jsx(at,{icon:"check",size:cv,className:"color-picker__check"})},u)})})}function ou({icon:e,label:t,tooltip:a,wrapperStyle:r,color:i,bgColor:s,useHover:l=!0,iconSize:u="medium"}){const{t:c}=xe.useTranslation(),d=u==="small",m=_e("category-icon",d?"category-icon--small":""),p=d?16:20,f=o.useRef(null),[y,x]=o.useState(!1),C=o.useMemo(()=>{const B=r&&typeof r=="object"?{...r}:{};return!i&&!s?B:{...B,...i?{color:i,"--t-item-fg":i}:{},...s?{"--t-item-bg":s}:{}}},[r,i,s]),h=a||t,_=l&&!!h,[g,A]=o.useState(null);o.useLayoutEffect(()=>{y&&A(f.current?.getBoundingClientRect()??null)},[y]),o.useEffect(()=>{if(!l&&y)try{x(!1)}catch{}},[l,y]),o.useEffect(()=>{if(!y)return;const B=E=>{const D=f.current;if(!D)return;const N=E.target;N&&!D.contains(N)&&x(!1)};return document.addEventListener("pointerdown",B,!0),()=>document.removeEventListener("pointerdown",B,!0)},[y]);const b=o.useCallback(()=>{l&&x(!0)},[l]),k=o.useCallback(()=>{l&&x(!1)},[l]),v=o.useCallback(()=>x(!1),[]),w=o.useCallback(B=>{if(B.key==="Escape"){x(!1);return}(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),x(E=>!E))},[]);return n.jsxs("span",{ref:f,className:_e("category-icon__wrap",_&&"category-icon__wrap--interactive"),onPointerEnter:b,onPointerLeave:k,onFocus:b,onBlur:k,onKeyDown:w,role:"button",tabIndex:0,"aria-label":typeof h=="string"?c("common.descriptionFor",{name:h,defaultValue:`${h} \uC124\uBA85`}):void 0,"aria-haspopup":!!h,"aria-expanded":y,"data-tooltip-ignore":!0,children:[n.jsx(at,{icon:e,label:t,className:m,imgClassName:"category-icon__image",maskClassName:"category-icon__mask",svgClassName:"category-icon__svg",wrapperStyle:C,size:p}),y&&h&&n.jsx(Bn,{anchorRect:g,text:typeof h=="string"?h:void 0,offset:8,onClose:v,className:"category-icon__tooltip",ariaLabel:typeof h=="string"?h:void 0})]})}let In=null;function lr(e){if(In&&In!==e)try{In()}catch{}return In=e,()=>{In===e&&(In=null)}}function ur(e){if(In===e){In=null;try{e()}catch{}}}function cr(e,t){let a=()=>{};const r=new Promise(u=>{a=u});if(typeof e!="string"||e.trim()===""){St("one-shot-empty-url","[core] playOneShot \uC5D0 \uBE48 \uC8FC\uC18C\uAC00 \uC654\uB2E4 \u2014 \uC548 \uD2BC\uB2E4. \uBD80\uB974\uB294 \uCABD\uC774 \uC8FC\uC18C\uB97C \uC5BB\uAE30 \uC804\uC5D0 \uBD88\uB800\uB2E4.",new Error("playOneShot(empty)").stack),a(!1);try{t?.(!1)}catch{}return{el:{},stop:()=>{},done:r}}let i=!1;const s=u=>{if(!i){i=!0;try{t?.(u)}catch{}a(u)}};let l;try{l=new Audio(e)}catch{return s(!1),{el:{},stop:()=>{},done:r}}l.onended=()=>s(!0),l.onerror=()=>s(!1);try{l.play().catch(()=>s(!1))}catch{s(!1)}return{el:l,stop:()=>{try{l.pause()}catch{}s(!1)},done:r}}function mv(e,t){if(!e)return{previewCodes:[],previewBucket:null};const a=e,r=l=>l.map(u=>u?.contextCode||u?.context_code).filter(Boolean).map(String);if(t==="LISTEN_IN_NOISE"){const l=a.sentences||a.items||[],u=Array.isArray(l)&&l.length>0?r(l):[];return u.length===0&&(a.contextCode||a.context_code)&&u.push(String(a.contextCode||a.context_code)),{previewCodes:u,previewBucket:"LIN_D"}}if(t==="SHORT_STORY"){const l=a.items||a.sentences||[],u=Array.isArray(l)&&l.length>0?r(l):[];return u.length===0&&(a.contextCode||a.context_code)&&u.push(String(a.contextCode||a.context_code)),{previewCodes:u,previewBucket:"SHORT_S"}}if(t==="LONG_STORY"){const l=a.items||a.sentences||[],u=Array.isArray(l)&&l.length>0?r(l):[];return u.length===0&&(a.contextCode||a.context_code)&&u.push(String(a.contextCode||a.context_code)),{previewCodes:u,previewBucket:"LONG"}}if(t==="ORDERING_SENTENCE"){const l=a.sentences||a.items||[],u=Array.isArray(l)&&l.length>0?r(l):[];return u.length===0&&(a.contextCode||a.context_code)&&u.push(String(a.contextCode||a.context_code)),{previewCodes:u,previewBucket:"LIN_D"}}const i=a.sentences||a.items||[],s=r(Array.isArray(i)?i:[]);return s.length===0&&(a.contextCode||a.context_code)&&s.push(String(a.contextCode||a.context_code)),{previewCodes:s,previewBucket:null}}function hv(e,t){const[a,r]=o.useState(!1),[i,s]=o.useState(-1),[l,u]=o.useState({key:"",urls:[]}),c=o.useRef(null),d=o.useRef(!1),m=o.useRef(null),p=o.useRef(null),[f,y]=o.useState(!1),x=o.useRef([]),{previewCodes:C,previewBucket:h}=mv(e,t),_=`${C.join(",")}|${h??""}`,g=o.useMemo(()=>l.key===_?l.urls:[],[l,_]);o.useEffect(()=>{if(!C.length)return;let b=!1;return(async()=>{const k=[],v=[];for(const w of C)try{const B=fi(w,h);if(!B){k.push("");continue}let E=null;try{E=await Ci(B)}catch{}if(!E)try{const D=await gi(B);D&&(E=URL.createObjectURL(D),v.push(E))}catch{}k.push(E??"")}catch{k.push("")}b?v.forEach(w=>{try{URL.revokeObjectURL(w)}catch{}}):(x.current.forEach(w=>{try{URL.revokeObjectURL(w)}catch{}}),x.current=v,u({key:_,urls:k}))})(),()=>{b=!0}},[C.join(","),h]),o.useEffect(()=>()=>{x.current.forEach(b=>{try{URL.revokeObjectURL(b)}catch{}}),x.current=[]},[]);const A=o.useCallback(async b=>{if(b.stopPropagation(),b.preventDefault(),d.current){m.current&&ur(m.current),d.current=!1;try{c.current?.pause()}catch{}r(!1),s(-1);return}if(!g.filter(Boolean).length)return;let k=null;const v=()=>{d.current=!1,k?.stop()};m.current=v;const w=lr(v);d.current=!0,r(!0);for(let B=0;B<g.length&&d.current;B++){const E=g[B];if(E&&(s(B),k=cr(E),c.current=k.el,!await k.done))break}w(),m.current===v&&(m.current=null,d.current=!1,r(!1),s(-1))},[g]);return o.useEffect(()=>()=>{m.current&&ur(m.current),d.current=!1;try{c.current?.pause()}catch{}c.current=null},[]),{playing:a,playingIndex:i,previewUrls:g,previewHover:f,setPreviewHover:y,previewBtnRef:p,handlePreview:A}}const fv=e=>{if(!e)return[];const t=typeof e.context=="string"&&e.context.trim()||typeof e.sentence=="string"&&e.sentence.trim()||typeof e.text=="string"&&e.text.trim()||"";if(t)return[String(t)];const a=e.sentences||e.items||e.questions||[];return Array.isArray(a)&&a.length>0?a.map(r=>{if(typeof r=="string")return r;if(r&&typeof r=="object"){const i=r;return i.sentence||i.text||i.context||i.question||i.title||""}return""}).filter(r=>typeof r=="string"&&r.trim().length>0).map(r=>r.trim()):[]};function Do(e){const{index:t,type:a,trainingData:r,ariaLabel:i,depth:s,renderPopup:l,completed:u,completedIds:c,selectedIds:d,tooltipText:m,useDescriptionTooltip:p=!1,onRemove:f,hideCheckBadge:y=!1,showTypeLabel:x=!1,onComplete:C,onSelect:h,onMore:_,countLabelOverride:g,size:A="square"}=e||{},{t:b}=xe.useTranslation(),[k,v]=o.useState(!1),w=o.useRef(null),[B,E]=o.useState(!1);o.useEffect(()=>{w.current?.matches(":hover")&&E(!0)},[]);const{playing:D,playingIndex:N,previewUrls:O,previewHover:P,setPreviewHover:G,previewBtnRef:L,handlePreview:M}=hv(r,a?.key),$=o.useCallback(()=>{h?h():v(!0)},[h]),Z=o.useCallback(()=>v(!1),[]),q=o.useCallback(()=>E(!0),[]),z=o.useCallback(()=>E(!1),[]),V=o.useCallback(()=>G(!0),[G]),R=o.useCallback(()=>G(!1),[G]),[H,W]=o.useState(null);o.useLayoutEffect(()=>{P&&W(L.current?.getBoundingClientRect()??null)},[P,L]);const[I,S]=o.useState(null);o.useLayoutEffect(()=>{B&&!k&&p&&S(w.current?.getBoundingClientRect()??null)},[B,k,p]);const j=o.useCallback(we=>{we.target===we.currentTarget&&(we.key==="Enter"||we.key===" ")&&(we.preventDefault(),$())},[$]),F=r||null,U=o.useMemo(()=>{if(!p)return null;const we=m?(Array.isArray(m)?m:[m]).filter(Boolean):null,Ue=we&&we.length>0?we:fv(F);return Ue&&Ue.length>0?Ue:null},[p,m,F]),re=o.useCallback(we=>{we.stopPropagation(),f?.()},[f]),ne=o.useCallback(we=>we.stopPropagation(),[]),le=o.useCallback(we=>{typeof C=="function"&&C(we)},[C]),K=u||(c&&r?.id!=null?c.has(String(r.id)):!1),oe=!K&&(d!=null&&r?.id!=null?d.has(String(r.id)):!1);Nl("speechear.popup.close",Z);const Ae=Ii(),Y=`${a?.label||""} ${t+1}`,Q=F?.title||F?.name||Y;let me=a?.icon,De,be="",te="";try{const we=F?.category_0||F?.category_main_code||F?.category_main,Ue=F?.category_1||F?.category_sub_code||F?.category_sub,Be=Ae.find(je=>je.key===we);Be?.icon&&(me=Be.icon),!De&&Be?.color&&(De={"--t-item-fg":Be.color}),!De&&F?.iconColor&&(De={"--t-item-fg":F.iconColor}),be=Be?b(`topic.${Be.key}`,{defaultValue:Be.label||""}):"";try{const je=Be?.subs?.find(Se=>Se.key===Ue);te=je?b(`topic.sub.${je.key}`,{defaultValue:je.label||""}):""}catch{}}catch{}const ue=te?`${be} / ${te}`:be||a?.label||Q,fe=we=>b("training.countQuestions",{n:we,count:we}),ge=we=>b("training.countSentences",{n:we,count:we});let Ce="";try{if(F)if(a?.key==="LISTEN_IN_NOISE"){let we=0;Array.isArray(F.items)&&F.items.length>0?we=F.items.length:Array.isArray(F.sentences)&&F.sentences.length>0?we=F.sentences.length:F.sentences&&(we=1),Ce=ge(we)}else if(a?.key==="SHORT_STORY"){let we=1;Array.isArray(r?.items)?we=r.items.length:Array.isArray(r?.raw&&r.raw?.items)?we=r.raw.items.length:Array.isArray(F?.questions)?we=F.questions.length:Array.isArray(F?.sentences)&&(we=F.sentences.length),Ce=fe(we)}else if(a?.key==="LONG_STORY"){let we=1;if(Array.isArray(F.items)&&F.items.length>0){const Ue=F.items.reduce((Be,je)=>{const Se=je.questionItems;return Array.isArray(Se)?Be+Se.length:Array.isArray(je.questions)?Be+je.questions.length:Be},0);we=Ue>0?Ue:F.items.length}else Array.isArray(F.questions)&&F.questions.length>0?we=F.questions.length:Array.isArray(F.sentences)&&F.sentences.length>0&&(we=F.sentences.length);Ce=fe(we)}else if(a?.key==="ORDERING_SENTENCE"){let we=1;Array.isArray(F.items)&&F.items.length>0?we=F.items.length:Array.isArray(F.sentences)&&F.sentences.length>0&&(we=F.sentences.length),Ce=ge(we)}else Array.isArray(F.items)&&(Ce=F.items.length>0?fe(F.items.length):"")}catch{}const $e=A==="row",He=A==="list"||$e,Te=A==="compact",Ie=A==="small",qe=Ie&&a?.key?TC().find(we=>we.key===a.key):void 0,mt=qe?Fi[qe.key]:void 0,ct=qe?mt?b(`trainingType.${mt}.title`,{defaultValue:qe.label}):qe.label??"":"",rt=x&&a?.label&&a.label!==String(Q)?String(a.label):Ie&&ct&&ct!==String(Q)?ct:"",ft=!!rt,ke=g!==void 0?g:Ce,Ve=[rt,typeof Q=="string"?Q:"",ke].map(we=>String(we??"").trim()).filter(Boolean).join(" ");return n.jsxs(n.Fragment,{children:[n.jsxs("div",{ref:w,className:`training-block-button${He?" training-block-button--list":""}${$e?" training-block-button--row":""}${Te?" training-block-button--compact":""}${Ie?" training-block-button--small":""}${K?" training-block-button--completed":""}${oe?" training-block-button--selected":""}${ft&&!Ie?" training-block-button--withType":""}${Ie&&!ft?" training-block-button--no-type-label":""}`,onClick:$,onPointerEnter:q,onPointerLeave:z,role:"button",tabIndex:0,onKeyDown:j,"aria-label":typeof i=="string"?i:Ve||void 0,title:!p&&m&&(Array.isArray(m)?m.filter(Boolean).join(`
|
|
853
|
-
`):m)||void 0,children:[n.jsxs("div",{className:"training-block-button__left",children:[x&&a?.label&&a.label!==String(Q)&&n.jsx("span",{className:"training-block-button__type-label caption-1",children:a.label}),Ie&&ct&&ct!==String(Q)&&n.jsx("span",{className:"training-block-button__type-label caption-2",children:ct}),n.jsx(ou,{icon:me,label:Q,tooltip:ue,wrapperStyle:De,iconSize:Ie||Te?"small":"medium"}),!y&&(K||oe)&&!(f&&B)&&n.jsx(At,{className:f?"training-block-button__check--removable":void 0,type:"dot",icon:"check",position:"top-left",size:"medium","aria-label":K?b("training.completed","\uD6C8\uB828 \uC644\uB8CC"):b("training.selected","\uC120\uD0DD\uB428")}),f&&n.jsx(At,{className:`training-block-button__remove${B?" is-hover":""}`,type:"dot",icon:"remove",position:"top-left",size:"medium","aria-label":b("common.remove","\uC81C\uAC70"),onClick:re}),n.jsx("div",{className:`training-block-button__title ${Te?"body-3":Ie?"body-3b":"h3"}`,children:String(Q)}),n.jsxs("div",{className:"training-block-button__description",children:[ke?n.jsx("div",{className:`training-block-button__count ${Ie?"caption-2":"caption-1"}`,children:ke}):null,n.jsx("div",{className:"training-block-button__chevron",children:n.jsx(at,{icon:"chevron-right",label:b("training.next","\uB2E4\uC74C"),className:"training-block-button__chevron-icon",imgClassName:"training-block-button__chevron-icon-image",maskClassName:"training-block-button__chevron-icon-mask",svgClassName:"training-block-button__chevron-icon-svg",size:Ie?12:20})})]}),(He&&!$e||Ie)&&O.length>0&&n.jsx("div",{ref:L,className:"training-block-button__preview","data-tooltip-ignore":!0,onClick:ne,onPointerEnter:V,onPointerLeave:R,children:n.jsx(pe,{htmlType:"button",size:Ie?28:32,type:"dot",icon:D?"pause":"play",variant:Ie?"transparent-lightGray":"default",useBorder:!1,selected:D,ariaLabel:String(Q).trim()?D?b("training.stopFor",{name:Q,defaultValue:`${Q} \uC815\uC9C0`}):b("training.previewFor",{name:Q,defaultValue:`${Q} \uBBF8\uB9AC \uB4E3\uAE30`}):D?b("training.stop","\uC815\uC9C0"):b("training.preview","\uBBF8\uB9AC \uB4E3\uAE30"),onClick:M})})]}),_&&n.jsx("div",{className:"training-block-button__more","data-tooltip-ignore":!0,onClick:we=>{we.stopPropagation(),_(we)},children:n.jsx(pe,{htmlType:"button",size:40,type:"dot",icon:"more-horizontal",variant:"transparent-lightGray",useBorder:!1,ariaLabel:String(Q).trim()?b("common.moreFor",{name:Q}):b("common.more","\uB354\uBCF4\uAE30")})})]}),P&&n.jsx(Bn,{anchorRect:H,text:D?b("training.stop","\uC815\uC9C0"):b("training.preview","\uBBF8\uB9AC \uB4E3\uAE30"),offset:8,onClose:R}),B&&!k&&p&&(U?n.jsx(Kn,{anchorRect:I,items:U,activeIndex:N,onClose:z}):F?.subTitle?n.jsx(Bn,{anchorRect:I,text:F.subTitle,offset:8,onClose:z}):null),k&&l&&l({trainingData:F,typeKey:a?.key??"",onClose:Z,onComplete:le,popupTitle:String(Q),popupSubTitle:a?.subTitle,depth:s!=null?String(s):void 0,popupIcon:me,popupIconTooltip:String(ue),popupWrapperStyle:De})]})}const su=200;function Cv(e){return e.itemId?(RC()[e.trainingType]??[]).find(t=>t?.id!=null&&String(t.id)===String(e.itemId))??null:null}function iu({plan:e,groups:t,anchorRect:a,offset:r=12,onClose:i}){const{t:s}=xe.useTranslation(),l=o.useMemo(()=>t?t.map((c,d)=>({key:c.key??c.type?.key??String(d),label:c.label,type:c.type,data:c.items??[]})).filter(c=>c.data.length>0):IC(s).map(c=>{const d=(e?.items??[]).filter(m=>m.trainingType===c.key);return{key:c.key,label:c.label,type:c,pickedCount:d.length,data:d.map(Cv).filter(m=>m!=null)}}).filter(c=>c.pickedCount>0),[t,e?.items,s]);if(l.length===0)return null;const u=n.jsx("div",{className:"tooltip-training__box",children:n.jsx("div",{className:"tooltip-training__groups",children:l.flatMap(({key:c,label:d,type:m,data:p},f)=>[f>0?n.jsx("div",{className:"tooltip-training__divider"},`div-${c}`):null,n.jsxs("div",{className:"tooltip-training__section",children:[n.jsx("div",{className:"tooltip-training__section-header",children:n.jsx("span",{className:"tooltip-training__type-label body-3b",children:d})}),n.jsx("div",{className:"tooltip-training__items",children:p.map((y,x)=>n.jsx(Do,{index:x,type:m,trainingData:y,size:"compact",hideCheckBadge:!0},String(y.id??x)))})]},c)])})});return a?n.jsx(cn,{anchorRect:a,offset:r,onClose:i,closeOnOutsideClick:!1,className:"tooltip-training",ariaLabel:s("tooltip.training","\uD6C8\uB828 \uC548\uB0B4"),children:u}):u}const gv=200;function bv({icon:e,count:t,title:a,plan:r,tooltip:i=!0,hoverAccent:s=!1,className:l="",onClick:u,onMouseEnter:c,onMouseLeave:d}){const m=!!u||!!c||i&&!!r,p=_e("count-tile",m&&"count-tile--interactive",m&&s&&"count-tile--accent",u&&"count-tile--clickable",l),f=o.useRef(null),[y,x]=o.useState(null),C=o.useRef(null),h=o.useRef(null),_=!!(y&&r&&i),g=o.useCallback(()=>{C.current&&(clearTimeout(C.current),C.current=null),h.current&&(clearTimeout(h.current),h.current=null)},[]),A=o.useCallback(()=>{g(),x(null)},[g]),b=o.useCallback(()=>{!i||!r||(g(),C.current=setTimeout(()=>{C.current=null,x(f.current?.getBoundingClientRect()??null)},su))},[i,r,g]),k=o.useCallback(()=>{C.current&&(clearTimeout(C.current),C.current=null),!h.current&&(h.current=setTimeout(()=>{h.current=null,x(null)},gv))},[]);return o.useEffect(()=>()=>{g()},[g]),o.useEffect(()=>{(!i||!r)&&A()},[i,r,A]),o.useEffect(()=>{if(!_)return;const v=B=>B instanceof Element&&(f.current?.contains(B)||!!B.closest(".tooltip-training")),w=B=>{v(B.target)?g():k()};return document.addEventListener("pointerover",w,!0),()=>document.removeEventListener("pointerover",w,!0)},[_,g,k]),n.jsxs(n.Fragment,{children:[n.jsxs("div",{ref:f,className:p,onClick:u?v=>{A(),u(v)}:void 0,onKeyDown:u?v=>{v.key!=="Enter"&&v.key!==" "||(v.preventDefault(),v.currentTarget.click())}:void 0,onPointerEnter:v=>{v.pointerType==="touch"||v.pointerType==="pen"?A():b()},onMouseEnter:c,onMouseLeave:v=>{k(),d?.(v)},role:u?"button":"img",tabIndex:u?0:void 0,"aria-label":`${a} ${t}`,children:[n.jsx(at,{icon:e,size:20,className:"count-tile__icon"}),n.jsx("span",{className:"count-tile__count h5","aria-hidden":"true",children:t})]}),y&&r&&n.jsx(iu,{plan:r,anchorRect:y,onClose:A})]})}let Ia=0,lu="",So="",Fa=0;function uu(){return cu(!1)}function yv(){return cu(!0)}function cu(e){const t=typeof document<"u";Ia===0&&t&&(lu=document.body.style.overflow,document.body.style.overflow="hidden"),e&&t&&(Fa===0&&(So=document.body.style.paddingRight),Fa++,document.body.style.paddingRight="0px"),Ia++;let a=!1;return()=>{a||(a=!0,Ia=Math.max(0,Ia-1),e&&t&&(Fa=Math.max(0,Fa-1),Fa===0&&(So?document.body.style.paddingRight=So:document.body.style.removeProperty("padding-right"))),Ia===0&&t&&(document.body.style.overflow=lu))}}function vv(){return n.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round","aria-hidden":!0,children:n.jsx("path",{d:"M6 6l12 12M18 6 6 18"})})}function xv({open:e,onClose:t,ariaLabel:a,title:r,children:i,size:s="md",closeOnBackdrop:l=!0,closeOnEscape:u=!0,showClose:c=!0,className:d,contentClassName:m}){const{t:p}=xe.useTranslation(),f=o.useId(),y=o.useRef(null),x=o.useCallback(()=>t(),[t]);o.useEffect(()=>{if(!e)return;const g=document.activeElement,A=uu(),b=y.current;return co(b,g),b?.focus(),()=>{A();const k=document.activeElement;(!k||k===document.body||b&&b.contains(k))&&po(g)?.focus?.()}},[e]);const C=o.useRef(x),h=o.useRef(u);o.useEffect(()=>{C.current=x,h.current=u}),o.useEffect(()=>{if(e)return Gn(()=>{h.current&&C.current()})},[e]);const _=o.useRef(!1);return lo(y,e),!e||typeof document>"u"?null:en.createPortal(n.jsx("div",{className:_e("dialog",d),onPointerDown:l?g=>{_.current=g.target===g.currentTarget}:void 0,onMouseDown:g=>{g.target===g.currentTarget&&g.preventDefault()},onClick:l?g=>{const A=_.current;_.current=!1,A&&g.target===g.currentTarget&&x()}:void 0,children:n.jsxs("div",{ref:y,role:"dialog","aria-modal":"true","aria-label":r?void 0:a,"aria-labelledby":r?f:void 0,tabIndex:-1,className:_e("dialog__surface",`dialog__surface--${s}`,m),onClick:g=>g.stopPropagation(),children:[r?n.jsx("div",{className:"dialog__header",children:n.jsx("h2",{id:f,className:"dialog__title h4b",children:r})}):null,c?n.jsx("button",{type:"button",className:"dialog__close","aria-label":p("common.close","\uB2EB\uAE30"),onClick:x,children:n.jsx(vv,{})}):null,n.jsx("div",{className:"dialog__body",children:i})]})}),document.body)}function _v({columns:e,rows:t,rowKey:a,title:r,toolbar:i,empty:s,loading:l,caption:u,className:c=""}){const{t:d}=xe.useTranslation(),m=!l&&t.length===0;return n.jsxs("div",{className:_e("board",c),children:[r||i?n.jsxs("div",{className:"board__head",children:[r?n.jsx("h2",{className:"board__title",children:r}):n.jsx("span",{}),i?n.jsx("div",{className:"board__toolbar",children:i}):null]}):null,n.jsxs("table",{className:"board__table",children:[u?n.jsx("caption",{className:"board__caption",children:u}):null,n.jsx("thead",{children:n.jsx("tr",{children:e.map(p=>n.jsx("th",{scope:"col",className:_e("board__th",`board__cell--${p.headerAlign??p.align??"left"}`),style:p.width?{width:p.width}:void 0,children:p.header},p.key))})}),n.jsx("tbody",{children:l?n.jsx("tr",{children:n.jsx("td",{className:"board__state",colSpan:e.length,children:l})}):m?n.jsx("tr",{children:n.jsx("td",{className:"board__state",colSpan:e.length,children:s??d("board.empty","\uB4F1\uB85D\uB41C \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.")})}):t.map((p,f)=>n.jsx("tr",{className:"board__row",children:e.map(y=>n.jsx("td",{className:_e("board__td",`board__cell--${y.align??"left"}`),children:y.render(p,f)},y.key))},a(p,f)))})]})]})}function wv({name:e,role:t,photo:a,media:r,credentials:i,size:s=190,className:l=""}){return n.jsxs("div",{className:_e("person-card",l),children:[n.jsx("div",{className:"person-card__photo",style:{width:s,height:s},children:r??(a?n.jsx("img",{src:a,alt:t?`${e} ${t}`:e}):null)}),n.jsx("h3",{className:"person-card__name",children:e}),t?n.jsx("p",{className:"person-card__role",children:t}):null,i?.length?n.jsx("ul",{className:"person-card__credentials",children:i.map(u=>n.jsx("li",{children:u},u))}):null]})}function Bv({groups:e,className:t=""}){return n.jsx("div",{className:_e("timeline",t),children:e.map(a=>n.jsxs("section",{className:"timeline__group",children:[n.jsx("h3",{className:"timeline__title",children:a.title}),n.jsx("ul",{className:"timeline__rows",children:a.entries.map((r,i)=>n.jsxs("li",{className:"timeline__row",children:[r.label?n.jsx("span",{className:"timeline__label",children:r.label}):null,n.jsx("div",{className:"timeline__items",children:r.items.map((s,l)=>n.jsx("p",{children:s},l))})]},`${r.label??""}-${i}`))})]},a.title))})}function kv({title:e,kind:t,body:a,badge:r,badgeSrc:i,footer:s,width:l,className:u=""}){const c=r??(i?n.jsx("img",{src:i,alt:""}):null);return n.jsxs("div",{className:_e("publication-card",u),style:l?{width:l,flexShrink:0}:void 0,children:[c?n.jsx("div",{className:"publication-card__badge","aria-hidden":"true",children:c}):null,n.jsx("h3",{className:"publication-card__title",children:e}),t?n.jsx("p",{className:"publication-card__kind",children:t}):null,n.jsx("p",{className:"publication-card__body",children:a}),s?n.jsx("div",{className:"publication-card__footer",children:s}):null]})}function Av({logo:e,alt:t,onDone:a,durationMs:r=3e3}){const i=Da(a);return o.useEffect(()=>{const s=setTimeout(()=>i.current?.(),r);return()=>clearTimeout(s)},[r,i]),n.jsx("div",{className:"splash-logo",style:{"--splash-logo-duration":`${r}ms`},"aria-hidden":"true",children:n.jsx("img",{src:e,alt:t,className:"splash-logo__image"})})}function Nv({eyebrow:e,eyebrowIndex:t,title:a,description:r,level:i=2,tone:s="dark",className:l=""}){const u=i===1?"h1":"h2";return n.jsxs("div",{className:_e("section-header",`section-header--${s}`,l),children:[e?n.jsxs("p",{className:"section-header__eyebrow",children:[t?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"section-header__index",children:t}),n.jsx("span",{"aria-hidden":!0,className:"section-header__rule"})]}):null,e]}):null,a?n.jsx(u,{className:"section-header__title",children:a}):null,r?n.jsx("div",{className:"section-header__description",children:r}):null]})}function Ev({items:e,className:t=""}){return n.jsx("ul",{className:_e("company-meta",t),children:e.map((a,r)=>n.jsxs("li",{className:"company-meta__item",children:[r>0?n.jsx("span",{"aria-hidden":!0,className:"company-meta__divider",children:"|"}):null,a]},a))})}function du(e){return typeof e=="string"?e:e.label}function pu({value:e,onChange:t,suggestions:a,openOnFocus:r=!1,filterSuggestions:i,onSelectSuggestion:s,autoActiveFirst:l=!1}){const u=o.useId(),[c,d]=o.useState(!1),[m,p]=o.useState(-1),f=o.useRef(null),y=o.useMemo(()=>{if(!a.length)return[];const N=e??"";return i===!1?a:N?typeof i=="function"?i(a,N):a.filter(O=>du(O).toLowerCase().includes(N.toLowerCase())):r?a:[]},[a,e,r,i]),[x,C]=o.useState(!1),h=o.useRef([]),_=x&&y.length===0?h.current:y;o.useEffect(()=>{_.length&&(h.current=_)},[_]);const g=o.useCallback(()=>C(!0),[]),A=o.useCallback(()=>C(!1),[]),b=l?0:-1;o.useEffect(()=>{c||p(b)},[c,b]),o.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]);const k=m<_.length?m:b<_.length?b:-1,v=o.useCallback(N=>{s?s(N):t?.(du(N)),d(!1)},[t,s]),w=o.useCallback(()=>d(!0),[]),B=o.useCallback(()=>{d(!0),p(b)},[b]),E=o.useCallback(()=>{f.current=setTimeout(()=>d(!1),120)},[]),D=o.useCallback(N=>{N.nativeEvent.isComposing||N.keyCode===229||(N.key==="ArrowDown"?(N.preventDefault(),d(!0),p(O=>Math.min(_.length-1,(O<_.length?O:b)+1))):N.key==="ArrowUp"?(N.preventDefault(),p(O=>Math.max(b,(O<_.length?O:_.length)-1))):N.key==="Enter"?k>=0&&v(_[k]):N.key==="Escape"&&c&&(N.preventDefault(),d(!1)))},[_,k,c,v,b]);return{listId:u,open:c,activeIdx:k,filtered:_,handleFocus:w,handleBlur:E,handleInput:B,handleKeyDown:D,handleSelect:v,handleCompositionStart:g,handleCompositionEnd:A}}const To=typeof window<"u"?o.useLayoutEffect:o.useEffect;function Xn(e){const{value:t,defaultValue:a,name:r,inputRef:i,onChange:s,label:l,ariaLabel:u,ariaDescribedBy:c,required:d,placeholder:m,ghostText:p,ghostHint:f,type:y="text",disabled:x=!1,readOnly:C=!1,error:h,helperText:_,maxLength:g,size:A=48,variant:b="input",fullWidth:k=!1,newline:v=!1,multiline:w=!1,rows:B=3,leftIcon:E,rightIcon:D,clearable:N=!1,list:O,showCount:P=!0,className:G="",onFocus:L,onBlur:M,onKeyDown:$,onEnter:Z,inputMode:q,autoComplete:z,autoFocus:V,suggestions:R,filterSuggestions:H,onSelectSuggestion:W,autoActiveFirst:I,openOnFocus:S=!1}=e,j=C||x?void 0:R,{t:F}=xe.useTranslation(),U=o.useId();!l&&!u&&St(`TextField:unnamed:${U}`,"[ihab/TextField] \uC774\uB984\uC774 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 label \uC774\uB098 ariaLabel \uC911 \uD558\uB098\uB97C \uC8FC\uC138\uC694. placeholder \uB294 \uC774\uB984\uC744 \uB300\uC2E0\uD558\uC9C0 \uBABB\uD569\uB2C8\uB2E4.");const re=`tf-${U}`,ne=`tf-helper-${U}`,le=o.useRef(null),K=pu({value:t??"",onChange:s,suggestions:j??[],openOnFocus:S,filterSuggestions:H,onSelectSuggestion:W,autoActiveFirst:I}),oe=!!j&&K.open&&K.filtered.length>0,Ae=o.useRef(null),[Y,Q]=o.useState(null),me=o.useCallback(()=>{const ke=Ae.current;if(!ke||typeof window>"u")return;const Ve=ke.getBoundingClientRect(),we=230,Ue=window.innerHeight-Ve.bottom<we+8&&Ve.top>we+8;Q({position:"fixed",left:Ve.left,width:Ve.width,...Ue?{bottom:window.innerHeight-Ve.top+8}:{top:Ve.bottom+8},zIndex:ja(ke)})},[]);To(()=>{if(!oe)return;me();let ke=null;const Ve=()=>{if(typeof requestAnimationFrame>"u"){me();return}ke===null&&(ke=requestAnimationFrame(()=>{ke=null,me()}))},we=Ue=>{const Be=Ue.target;Be&&Be.nodeType===1&&Be.closest?.(".text-field__suggestions")||Ve()};return window.addEventListener("scroll",we,!0),window.addEventListener("resize",Ve),()=>{ke!==null&&cancelAnimationFrame(ke),window.removeEventListener("scroll",we,!0),window.removeEventListener("resize",Ve)}},[oe,me]);const De=o.useCallback(ke=>{le.current=ke,typeof i=="function"?i(ke):i&&(i.current=ke)},[i]),be=p?`${p}${f??F("wordTable.save.autoFillHint"," (Tab \uB610\uB294 space \uC785\uB825\uC2DC \uC790\uB3D9 \uC785\uB825)")}`:m,te=t!==void 0,ue=te&&y==="password",[fe,ge]=o.useState((a??"").length),Ce=te?(t??"").length:fe,$e=o.useRef(t);To(()=>{$e.current=t}),o.useEffect(()=>{const ke=le.current;if(!ue||!ke)return;const Ve=t??"";ke.value!==Ve&&(ke.value=Ve)},[ue,t]),o.useEffect(()=>{if(!v||!le.current)return;const ke=le.current;ke.style.height="",ke.scrollHeight>ke.clientHeight&&(ke.style.height=`${ke.scrollHeight}px`)},[t,fe,v]);const He=g!=null&&Ce>g,Te=A===32?16:20,Ie=_e("text-field",`text-field--s${A}`,b==="display"?"text-field--display":"",k?"text-field--full-width":"",x?"text-field--disabled":"",C?"text-field--readonly":"",h?"text-field--error":"",E?"text-field--has-left-icon":"",D||N?"text-field--has-right-icon":"",G),qe={id:re,...ue?{}:te?{value:t}:{defaultValue:a},ref:De,placeholder:be,name:r,disabled:x,readOnly:C,autoFocus:V,maxLength:g,list:O,inputMode:q,autoComplete:z,"aria-label":!l&&u?u:void 0,"aria-required":d,"aria-invalid":!!h,"aria-describedby":[_||h?ne:null,c].filter(Boolean).join(" ")||void 0,role:j?"combobox":void 0,"aria-autocomplete":j?"list":void 0,"aria-haspopup":j?"listbox":void 0,"aria-expanded":j?oe:void 0,"aria-controls":oe?K.listId:void 0,"aria-activedescendant":oe&&K.activeIdx>=0?`${K.listId}-option-${K.activeIdx}`:void 0,onChange:ke=>{const Ve=ke.target;te||ge(Ve.value.length),s?.(Ve.value),j&&K.handleInput(),ue&&queueMicrotask(()=>{const we=$e.current??"";Ve.value!==we&&(Ve.value=we)})},onCompositionStart:j?K.handleCompositionStart:void 0,onCompositionEnd:j?K.handleCompositionEnd:void 0,onFocus:(ke=>{L?.(ke),j&&K.handleFocus()}),onBlur:(ke=>{M?.(ke),j&&K.handleBlur()}),onKeyDown:(ke=>{const Ve=(ke.key==="Tab"&&!ke.shiftKey||ke.key===" ")&&!ke.nativeEvent.isComposing;if(p&&Ve&&!C&&!x&&!(ke.currentTarget.value??"").trim()){ke.preventDefault();const we=ke.currentTarget;te||(we.value=p,ge(p.length)),s?.(p);return}j&&ke.key==="Enter"&&!ke.nativeEvent.isComposing&&K.activeIdx>=0?ke.preventDefault():Z&&ke.key==="Enter"&&!ke.nativeEvent.isComposing&&(ke.preventDefault(),Z()),$?.(ke),j&&K.handleKeyDown(ke)})},mt=N&&!x&&!C&&Ce>0,ct=()=>v?n.jsx("textarea",{...qe,className:"text-field__input text-field__input--auto body-2",rows:1}):w?n.jsx("textarea",{...qe,className:"text-field__input text-field__input--textarea body-2",rows:B}):n.jsx("input",{...qe,type:y,className:"text-field__input body-2"}),rt=b==="display"&&!v&&!w&&!!be,ft=()=>n.jsxs(n.Fragment,{children:[ct(),rt&&n.jsx("span",{className:"text-field__placeholder","aria-hidden":"true",children:be})]});return n.jsxs("div",{ref:Ae,className:Ie,children:[l&&n.jsxs("label",{htmlFor:re,className:"text-field__label caption-1",children:[l,d&&n.jsx("span",{className:"text-field__required",children:"*"})]}),n.jsxs("div",{className:"text-field__wrap",children:[E&&n.jsx("span",{className:"text-field__icon text-field__icon--left",children:n.jsx(at,{icon:E,label:"",className:"",svgClassName:"text-field__icon-svg",size:Te})}),ft(),g!=null&&P&&n.jsxs("span",{className:`text-field__count caption-2${He?" text-field__count--over":""}`,children:[Ce,"/",g]}),mt&&n.jsx(pe,{size:24,type:"dot",icon:"x",variant:"transparent-gray",useBorder:!1,className:"text-field__clear",ariaLabel:F("textField.clearAriaLabel","\uC785\uB825\uAC12 \uC9C0\uC6B0\uAE30"),htmlType:"button",onMouseDown:ke=>{ke.preventDefault()},onClick:()=>{!te&&le.current&&(le.current.value="",ge(0)),s?.("")},tabIndex:-1}),D&&!mt&&n.jsx("span",{className:"text-field__icon text-field__icon--right",children:n.jsx(at,{icon:D,label:"",className:"",svgClassName:"text-field__icon-svg",size:Te})})]}),!!j&&n.jsx("span",{className:"text-field__status",role:"status","aria-live":"polite",children:K.open&&(t??"").length>0&&K.filtered.length===0?F("common.noMatches","\uB9DE\uB294 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"):""}),oe&&(typeof document>"u"?null:en.createPortal(n.jsx("ul",{id:K.listId,className:"text-field__suggestions",role:"listbox",style:Y??{position:"fixed",visibility:"hidden"},"data-tooltip-ignore":!0,children:K.filtered.map((ke,Ve)=>n.jsx("li",{id:`${K.listId}-option-${Ve}`,role:"option","aria-selected":Ve===K.activeIdx,className:`text-field__suggestion body-2${Ve===K.activeIdx?" is-active":""}`,onMouseDown:we=>we.preventDefault(),onClick:()=>{K.handleSelect(ke),le.current?.focus()},children:typeof ke=="string"?ke:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-field__suggestion-label",children:ke.label}),ke.hint&&n.jsx("span",{className:"text-field__suggestion-hint caption-1",children:ke.hint})]})},typeof ke=="string"?`${ke}-${Ve}`:ke.id))}),document.body)),(_||h)&&n.jsx("div",{className:"text-field__footer",children:n.jsx("span",{id:ne,className:"text-field__helper caption-1",role:h?"alert":void 0,children:h||_})})]})}function pn({options:e,value:t,onChange:a,placeholder:r,disabled:i=!1,block:s=!1,size:l=48,error:u=!1,className:c="",ariaLabel:d,ariaDescribedBy:m}){const{t:p}=xe.useTranslation(),f=r??p("dropdown.placeholder","\uC120\uD0DD"),y=o.useId(),x=o.useId(),C=o.useRef(null),h=o.useCallback((L,M)=>{const $=window.innerHeight-L.bottom<260&&L.top>260;return{position:"fixed",left:L.left,minWidth:L.width,...$?{bottom:window.innerHeight-L.top+6}:{top:L.bottom+6},zIndex:ja(M)}},[]),{open:_,setOpen:g,toggle:A,style:b,triggerRef:k,menuRef:v}=Ma({computeStyle:h}),[w,B]=o.useState(-1),E=o.useCallback(()=>B(-1),[]),D=e.find(L=>L.value===t);o.useEffect(()=>{if(_){const L=e.findIndex(M=>M.value===t);B(L>=0?L:e.length?0:-1),requestAnimationFrame(()=>{const M=v.current;if(!M)return;const $=M.querySelectorAll(".dropdown__option")[L];$&&(M.scrollTop=Math.max(0,$.offsetTop-M.clientHeight/2+$.clientHeight/2))})}},[_]),o.useEffect(()=>{_&&B(L=>{if(L>=0&&L<e.length)return L;const M=e.findIndex($=>$.value===t);return M>=0?M:e.length?0:-1})},[_,e.length]);const N=o.useCallback(()=>{i||A()},[i,A]),O=o.useCallback(L=>{L.disabled||i||(L.value!==t&&a?.(L.value),g(!1))},[a,g,i,t]);o.useEffect(()=>{i&&g(!1)},[i,g]);const P=o.useCallback(L=>{if(!i){if(!_){(L.key==="Enter"||L.key===" "||L.key==="ArrowDown")&&(L.preventDefault(),g(!0));return}if(L.key==="Escape"){L.preventDefault(),g(!1);return}L.key==="ArrowDown"?(L.preventDefault(),B(M=>{let $=M+1;for(;$<e.length&&e[$].disabled;)$++;return $<e.length?$:M})):L.key==="ArrowUp"?(L.preventDefault(),B(M=>{let $=M-1;for(;$>=0&&e[$].disabled;)$--;return $>=0?$:M})):(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),e[w]?O(e[w]):g(!1))}},[i,_,e,w,O,g]),G=_?n.jsx("div",{ref:v,id:y,className:"dropdown__menu","data-tooltip-ignore":!0,role:"listbox",style:b,onMouseLeave:E,onMouseDown:L=>L.preventDefault(),children:e.map((L,M)=>n.jsxs("button",{id:`${y}-option-${M}`,type:"button",role:"option","aria-selected":L.value===t,className:_e("dropdown__option body-2",L.value===t?"dropdown__option--active":"",M===w?"dropdown__option--active":"",L.disabled?"dropdown__option--disabled":""),onMouseDown:$=>$.preventDefault(),onClick:()=>O(L),onMouseEnter:()=>B(M),disabled:L.disabled,children:[n.jsx("span",{className:"dropdown__option-check",children:L.value===t&&n.jsx("svg",{viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"2 7 5.5 10.5 12 3.5"})})}),L.label]},L.value))}):null;return n.jsxs("div",{ref:C,className:_e("dropdown",`dropdown--s${l}`,_?"dropdown--open":"",s?"dropdown--block":"",u?"dropdown--error":"",c),onKeyDown:P,children:[n.jsxs("button",{ref:k,type:"button",className:"dropdown__trigger",role:"combobox","aria-haspopup":"listbox","aria-expanded":_,"aria-controls":_?y:void 0,"aria-activedescendant":_&&w>=0?`${y}-option-${w}`:void 0,"aria-label":d,"aria-describedby":[d&&D?x:"",m??""].filter(Boolean).join(" ")||void 0,"aria-invalid":u||void 0,disabled:i,onClick:N,onBlur:L=>{_&&!v.current?.contains(L.relatedTarget)&&g(!1)},children:[n.jsx("span",{id:x,className:`dropdown__trigger-label body-2${D?"":" dropdown__trigger-label--placeholder"}`,children:D?D.label:f}),n.jsx("svg",{className:"dropdown__chevron",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"4 6 8 10 12 6"})})]}),typeof document<"u"&&en.createPortal(G,C.current?.closest(".ihabdevteam-core-scope")??document.body)]})}function dr({page:e,totalPages:t,onChange:a,prevLabel:r,nextLabel:i,className:s=""}){const{t:l}=xe.useTranslation(),u=r??l("common.prevPage","\uC774\uC804 \uD398\uC774\uC9C0"),c=i??l("common.nextPage","\uB2E4\uC74C \uD398\uC774\uC9C0"),d=Math.max(1,t),m=()=>a(Math.max(1,Math.min(d,e-1))),p=()=>a(Math.min(d,e+1));return n.jsxs("div",{className:_e("pagination",s),children:[n.jsx(pe,{htmlType:"button",size:32,type:"dot",shape:"rounded",icon:"chevron-left",ariaLabel:u,disabled:e<=1,onClick:m}),n.jsxs("span",{className:"pagination__info body-3","aria-live":"polite","aria-atomic":"true",children:[Math.min(Math.max(1,e),d)," / ",d]}),n.jsx(pe,{htmlType:"button",size:32,type:"dot",shape:"rounded",icon:"chevron-right",ariaLabel:c,disabled:e>=t,onClick:p})]})}const Oa=new Map;function gn(e){const{t}=xe.useTranslation(),{options:a=[],value:r=a.find(b=>!b.disabled)?.key??a[0]?.key,onChange:i=b=>{},className:s="",size:l=40,shape:u="pill",useBG:c=!0,fullWidth:d=!1,minButtonWidth:m,ariaLabel:p}=e||{},f=o.useRef(null),y=a.filter(b=>!b.disabled),x=o.useId(),C=a.map(b=>b.key).join("\xB7");o.useEffect(()=>{if(!(!Ln||p!=null&&p!=="")){if(Oa.set(x,C||"(\uBCF4\uAE30 \uC5C6\uC74C)"),Oa.size>1){const b=[...Oa.values()].sort();St(`segmented-control-unnamed:${b.join("|")}`,`[ihab/SegmentedControl] \uC774\uB984 \uC5C6\uB294 \uB77C\uB514\uC624\uADF8\uB8F9\uC774 \uD55C \uD654\uBA74\uC5D0 ${Oa.size} \uAC1C \uC11C \uC788\uC2B5\uB2C8\uB2E4 \u2014 \uB0AD\uB3C5\uAE30\uB294 \uBAA8\uB450 "\uC120\uD0DD \uD0ED" \uC73C\uB85C \uC77D\uC5B4 \uC5B4\uB290 \uAC83\uC774 \uBB34\uC5C7\uC778\uC9C0 \uAC00\uB9B4 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. ariaLabel \uC744 \uC8FC\uC138\uC694. \uC9C0\uAE08 \uC120 \uAC83(\uBCF4\uAE30 \uC774\uB984\uC73C\uB85C \uC801\uC74C): ${b.join(" / ")}`)}return()=>{Oa.delete(x)}}},[p,C,x]);const h=b=>{if(!y.length)return;const k=Math.max(0,y.findIndex(w=>w.key===r)),v=b==="first"?y[0]:b==="last"?y[y.length-1]:y[(k+b+y.length)%y.length];v&&(i(v.key),Array.from(f.current?.querySelectorAll("[data-segkey]")??[]).find(w=>w.dataset.segkey===v.key)?.focus())},_=b=>{switch(b.key){case"ArrowRight":case"ArrowDown":h(1);break;case"ArrowLeft":case"ArrowUp":h(-1);break;case"Home":h("first");break;case"End":h("last");break;default:return}b.preventDefault()},g=b=>{const k=v=>typeof v=="string"||typeof v=="number";if(!(!k(b.label)||b.count==null||b.count===!1||!k(b.count)))return`${b.label}, ${b.count}`},A=y.some(b=>b.key===r)?r:y[0]?.key;return n.jsx("div",{ref:f,onKeyDown:_,className:_e("segmented-control",`segmented-control--${u}`,`segmented-control--${l}`,d&&"segmented-control--full",!c&&"segmented-control--no-bg",m!=null&&"segmented-control--min",s),style:m!=null?{"--segmented-min-button-w":`${m}px`}:void 0,role:"radiogroup","aria-label":p??t("segmentedControl.ariaLabel","\uC120\uD0DD \uD0ED"),children:a.map(b=>n.jsx(pe,{htmlType:"button",role:"radio","aria-checked":b.key===r,"data-segkey":b.key,tabIndex:b.key===A?0:-1,label:b.label,count:b.count,ariaLabel:g(b),disabled:b.disabled,className:b.key===r?"is-selected":"",onClick:()=>{b.disabled||i(b.key)},size:l,shape:u,useBorder:!1,useBG:!1},b.key))})}function jo({count:e,search:t,segment:a,filters:r,pageSize:i,pagination:s,actions:l,className:u}){const{t:c}=xe.useTranslation(),d=e!=null&&n.jsxs("p",{className:"toolbar__count body-1",role:"status","aria-atomic":"true",children:[e.prefix??c("common.totalPrefix","\uCD1D "),n.jsx("span",{className:"toolbar__count-highlight",children:e.value}),e.unit,e.suffix]}),m=!!(t||r?.length||i||s||l);return n.jsxs("div",{className:_e("toolbar",u),children:[n.jsxs("div",{className:"toolbar__row",children:[d,a&&(Array.isArray(a)?a:[a]).map((p,f)=>n.jsx(gn,{size:40,...p},p.ariaLabel??f))]}),m&&n.jsx("div",{className:"toolbar__row",children:n.jsxs("div",{className:"toolbar__row-end",children:[t&&n.jsx(Xn,{className:"toolbar__search",size:40,value:t.value,onChange:t.onChange,placeholder:t.placeholder??c("common.search","\uAC80\uC0C9"),ariaLabel:t.placeholder??c("common.search","\uAC80\uC0C9"),autoFocus:t.autoFocus,clearable:!0}),r?.map((p,f)=>n.jsx(pn,{size:40,options:p.options,value:p.value,onChange:p.onChange,ariaLabel:p.ariaLabel},f)),(i||s)&&n.jsxs("div",{className:"toolbar__pager",children:[i&&n.jsx(pn,{size:40,options:i.options,value:i.value,onChange:i.onChange,ariaLabel:i.ariaLabel??c("common.pageSizeSelect","\uD398\uC774\uC9C0\uB2F9 \uD45C\uC2DC \uAC1C\uC218")}),s&&n.jsx(dr,{page:s.page,totalPages:s.total,onChange:s.onChange,prevLabel:s.prevLabel,nextLabel:s.nextLabel})]}),l]})})]})}function mu(e){return typeof e=="string"?e:typeof e=="number"?String(e):Array.isArray(e)?e.map(mu).join(""):""}function Dv(e){let t=e.replace(/\r\n/g,`
|
|
851
|
+
and aids recovery.`,site:{title:"Site",malgwi:"Malgwi",soundDirection:"Sound Direction System",vrSoundDirection:"VR Sound Direction System",hearingTest:"Hearing Test Pro"},sns:{title:"SNS",naverBlog:"Naver Blog",kakao:"KAKAO Talk Open Chat"},policy:{title:"Policy",terms:"Terms of Service",privacy:"Privacy Policy"},ceo:"CEO",address:"Address",support:"Support",ceoName:"Ji-hye Han",addressValue:"302, 3F, Haechan Bldg, 32 Sicheong-gil, Chuncheon, Gangwon, Korea"},Pb={trainingPhone:{topic:"Gardening",prev:"Prev",next:"Next",speed:"Speed 3",noiseType:"Crowd noise",settings:"Settings",start:{caption:"Press the play (\u25B6) button below and listen carefully. After listening, check the sentence."},feedback:{caption:"Plant the well-grown seedlings in the garden bed and cover them carefully with plastic film."},done:{heardWell:"Heard clearly",listenAgain:"Listen again"}}},Ib={timeHM:"{{hh}}:{{mm}}",timeH:"{{hh}}:{{mm}}"},Fb={options:"Training Options",difficulty:"Difficulty",exclude:"Exclude",chosung:"Initial Consonant",excludeOptions:{none:"None",noImage:"No Image"}},Ob={answer:"Answer",distractor:"Distractor"},zb={phaseWordDownload:"Download Word Data",phaseImageCheck:"Check Images",phasePairAnalysis:"Analyze Word Pairs",downloadingCount_one:"Downloading {{n}} word",downloadingCount_other:"Downloading {{n}} words",checkingPage:"Checking page {{page}} list",imageCount:"{{done}} / {{total}} items"},Wb={clearAriaLabel:"Clear input"},Hb={ariaLabel:"Select tab"},Vb={ariaLabel:"Tabs"},qb={dragPrompt:"Drag and drop files here",browseButton:"Choose Files",removeAriaLabel:"Remove {{name}}"},Ub={ariaLabel:"User avatar"},Gb={relativeDay:{today:"Today",yesterday:"Yesterday",daysAgo:"{{n}}d ago"},reason:{notLoggedIn:"Login required."},list:{title:"Received Homework"},status:{expired:"Expired",done:"Done {{count}}\xD7 \xB7 {{date}}",notDone:"Not done"}},Kb={weekly:{title:"Weekly Training",daily:"Daily Listening",crossword:"Crossword"},homework:{title:"Homework Progress",totalRate:"Overall rate",count:"Total",done:"Done",remaining:"Remaining"},today:{tooltipTotal:"Total",tooltipDone:"Done"},filter:{countSuffix:" sessions"},time:{countLabel_one:"{{n}} session",countLabel_other:"{{n}} sessions",empty:"No training records"},daily:{title:"Today's Listening Record",empty:"No completed sessions"},crossword:{title:"Crossword Quiz",empty:"No completed levels"},visit:{title:"Linked Visit Records"},detail:"Details",detailFor:"{{name}} details",trainingType:{LISTEN_IN_NOISE:"Sentence in Noise",SHORT_STORY:"Short Story",LONG_STORY:"Long Story",ORDERING_SENTENCE:"Sentence Ordering"}},Yb={import:"Add to my trainings",publisher:"Publisher",time:{justNow:"just now",minutesAgo:"{{n}}m ago",hoursAgo:"{{n}}h ago",daysAgo:"{{n}}d ago",weeksAgo:"{{n}}w ago",monthsAgo:"{{n}}mo ago",yearsAgo:"{{n}}y ago"},badge:{shared:"Store"},publish:{descPlaceholder:"One-line description for the Training Store (optional)"}},Zb={manage:{unit:"item(s)"}},Xb={cancelLabel:"Cancel"},Jb={subtitle:"Select a topic to start listening practice."},Qb={steps:"Step {{current}} of {{total}}"},ey={panelTitle:"Training misses",viewItems:"Items",viewTypes:"Types",colPending:"Left",colTrend:"Change",colRuns:"Runs",unitItem:" items",skippedOnly_one:"{{n}} older record was excluded \u2014 it does not say what was answered.",skippedOnly_other:"{{n}} older records were excluded \u2014 they do not say what was answered.",summaryLabel:"Recorded",summaryValue:"{{items}} items \xB7 {{pending}} still missed",nextLabel:"Next to work on",nextCount:"{{count}}",nextCountCapped:"{{shown}} of {{total}}",picked:"\u2192 {{what}}",typeClear:"All caught up",typePending:"{{pending}} of {{total}} left",flat:"no change",runs_one:"{{count}} run",runs_other:"{{count}} runs",avgDuration:"{{sec}}s avg"},ty={resetColumns:"Reset column widths",scrollRegion:"Horizontally scrollable table",rowActionHint:"Press a row to open its details"},ny={panelTitle:"Word table scores",viewWords:"Words",viewTables:"Tables",colLatest:"When",colTrend:"Change",unitTime:" times",summaryLabel:"Scored",summaryValue:"{{times}} times \xB7 {{words}} words",nextLabel:"Focus next",nextCount:"{{count}}",allClear:"All correct last time.",times:"{{count}}x",flat:"no change",recentLabel:"Recent scorings",nextCountCapped:"{{shown}} of {{total}}"},ay={ariaLabel:"Banner",dotAriaLabel:"Banner {{index}} of {{count}}"},ry={selectYearMonth:"Select year and month",chooseDate:"Choose a date"},oy={previewRegion:"Report preview \u2014 scrollable sideways"},sy={description:"Description",textbox:"Text",training:"Training guide",menu:"Menu"},iy={devNone:"No acquisition data",place:{labial:"Bilabial",alveolar:"Alveolar",palatal:"Palatal",velar:"Velar",glottal:"Glottal"}},ly={clearSelection:"Clear selection"},uy={showResult:"Show {{type}} result"},cy={selected:"Selected",remove:"Remove",exclude:"Excluded",nthSelected:"Selection {{n}}"},dy={loading:"Loading"},py={state:{active:"playing",played:"heard",correct:"correct",wrong:"wrong"}},my={ariaLabel:"Breadcrumb"},hy={empty:"No items yet."},fy={main:"Main gradient",soft:"Soft",sub:"Sub color",deep:"Deep gradient",softSub:"Soft sub",warm:"Warm (accent)",dark:"Dark",radial:"Radial gradient",diagonal:"Diagonal pattern",dots:"Dot pattern",outline:"Outline",success:"Success / done",naver:"Naver blog notice",instagram:"Instagram notice"},Cy={common:tb,calendar:nb,passCard:ab,searchField:rb,rating:ob,colorPicker:sb,dropdown:ib,accordion:lb,header:ub,nav:cb,settings:db,usage:pb,account:mb,help:hb,training:fb,trainingSettings:Cb,customers:gb,payment:bb,coupons:yb,visits:vb,company:xb,trainingType:_b,myWordTraining:wb,myWordTable:Bb,keyWords:kb,wordTable:Ab,wordSearch:Nb,wordPrint:Eb,topic:Db,accessLinkManager:Sb,login:Tb,device:jb,manager:Mb,wordPairs:Lb,game:$b,footer:Rb,landing:Pb,date:Ib,trainingSetPage:Fb,wordTrainingPreview:Ob,wordData:zb,textField:Wb,segmentedControl:Hb,tabs:Vb,fileUpload:qb,avatar:Ub,myHomework:Gb,trainingStatus:Kb,store:Yb,homework:Zb,inquiry:Xb,trainingPlanRun:Jb,progress:Qb,trainingMiss:ey,table:ty,wordScore:ny,topBanner:ay,datePicker:ry,report:oy,tooltip:sy,phonemeProfile:iy,bulkBar:ly,debug:uy,badge:cy,loader:dy,soundCompass:py,breadcrumb:my,board:hy,promoBannerBg:fy};const gy="0.339.0",by=[{code:"ko",label:"\uD55C\uAD6D\uC5B4"},{code:"en",label:"English"}],io="ko",yy="ihab_display_language";function Oi(){if(typeof window>"u")return io;try{const e=localStorage.getItem(yy);if(e&&by.some(t=>t.code===e))return e}catch{}return io}function zi(e){try{document.documentElement.lang=e}catch{}}Rt.on("languageChanged",zi),zi(Oi()),Rt.use(xe.initReactI18next).init({resources:{ko:{translation:eb},en:{translation:Cy}},lng:Oi(),fallbackLng:io,interpolation:{escapeValue:!1},react:{useSuspense:!1}});const vy=new Map;try{Rt.store?.on?.("added",()=>vy.clear())}catch{}let nr=null,Wi=null,Hi=null;function xy(){const e=Di();if(e&&e.entries.length>0){const t=sC();if(nr&&Wi===e&&Hi===t)return nr;const a=new Set,r=[];for(const i of e.entries)!i.word||a.has(i.word)||(a.add(i.word),r.push({w:i.word,s:i.syllables,p:t?.[i.word]?[...t[i.word].cho??[],...t[i.word].jung??[],...t[i.word].jong??[]]:[],pron:i.pronunciation||i.word,grade:i.grade}));return nr=r,Wi=e,Hi=t,nr}return[]}new Proxy([],{get(e,t){const a=xy(),r=a[t];return typeof r=="function"?r.bind(a):r}});function _y(e){if(e.includes("\\")&&e.includes("("))return!0;if(!/url\s*\(/i.test(e))return!1;const t=e.replace(/url\(\s*(['"]?)#[^)'"]*\1\s*\)/gi,"");return/url\s*\(/i.test(t)}function wy(e){if(typeof window>"u")return"";const t=(a,r)=>{typeof r.attrValue=="string"&&_y(r.attrValue)&&(r.keepAttr=!1)};Vr.addHook("uponSanitizeAttribute",t);try{return Vr.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},FORBID_TAGS:["script","use","style"],FORBID_ATTR:["xlink:href","href"]})}finally{Vr.removeHook("uponSanitizeAttribute",t)}}function By(e){const[t,a]=o.useState(null),[r,i]=o.useState(null),[s,l]=o.useState(null),[u,c]=o.useState(null);return o.useEffect(()=>{if(!e||typeof e!="string"||!e.endsWith(".svg")){a(null),i(null),l(null);return}const d=e.split("/").pop();let m=e;d&&(e.startsWith("/")?m=Kr(e):/^(Logo|Symbol)/i.test(d)?m=Kr(`logo/${d}`):(/^https?:\/\//i.test(e)||e.startsWith("data:"),m=e)),i(null),l(null),a(m)},[e]),o.useEffect(()=>{if(!t)return;let d=!1;async function m(){try{let p=await fetch(t);p.ok||(p=await fetch(t));const f=p.headers.get("content-type")||"";if(d)return;if(f.includes("svg")){i("mask");return}if(f.startsWith("image/")){i("img");return}const y=await fetch(t);if(!y.ok)throw new Error("not ok");const x=await y.text();if(d)return;if(/^\s*<svg[\s>]/i.test(x)){const C=wy(x);if(!C){i("none");return}l(C),i("inline");return}i("none")}catch{d||i("none")}}return m(),()=>{d=!0}},[t]),o.useEffect(()=>{let d=!1,m=null;return r==="mask"&&t&&fetch(t).then(p=>{if(!p.ok)throw new Error("fetch failed");return p.blob()}).then(p=>{d||(m=URL.createObjectURL(p),c(m))}).catch(()=>{d||i("img")}),()=>{d=!0,m&&URL.revokeObjectURL(m),c(null)}},[r,t]),{iconToUse:t,mode:r,svgText:s,blobUrl:u}}function at(e){const{icon:t,label:a,className:r,imgClassName:i,maskClassName:s,svgClassName:l,wrapperStyle:u,size:c}=e||{},d=r??"iconRenderer-icon",m=i??"iconRenderer-icon-image",p=s??"iconRenderer-icon-mask",f=l??"iconRenderer-icon-svg",y=typeof t=="string"?t:null,x=U1(y),{iconToUse:C,mode:h,svgText:_,blobUrl:g}=By(y),A=(B,E={})=>n.jsx("span",{className:d,style:u,...E,children:B}),b=typeof c=="number"?{width:c,height:c,objectFit:"contain"}:null,k=(B,E={})=>n.jsx("img",{src:B,alt:typeof a=="string"?a:typeof a=="number"?String(a):"",className:m,...E,style:b?{...E.style,...b}:E.style});if(!t)return null;if(typeof t!="string")return A(t);if(t==="none")return A(n.jsx("span",{className:f,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(x)try{return A(o.createElement(x,{className:f,size:typeof c=="number"?c:20}),{"aria-hidden":"true"})}catch{}if(C&&C.endsWith(".svg")){if(h==="mask"){const B={"--icon-url":g?`url(${g})`:`url(${C})`,...typeof c=="number"?{"--icon-size":`${c}px`}:null};return A(n.jsx("span",{className:p,style:B}),{"aria-hidden":"true"})}return h==="img"?A(k(C,{onError:B=>{B.currentTarget.onerror=null,B.currentTarget.style.display="none"}}),{"aria-hidden":"true"}):h==="inline"?A(n.jsx("span",{className:f,dangerouslySetInnerHTML:_?{__html:_}:void 0}),{"aria-hidden":"true"}):A(null,{"aria-hidden":"true"})}if(t.startsWith("/")||t.includes("/assets/")||t.match(/\.(png|jpg|jpeg|webp|gif)$/i))return k(Kr(t),{style:u,onError:B=>{B.currentTarget.onerror=null,B.currentTarget.style.display="none"}});const v=typeof c=="number"?c:20,w=`<svg width="${v}" height="${v}" 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 A(n.jsx("span",{className:f,dangerouslySetInnerHTML:{__html:w}}),{"aria-hidden":"true"})}function Vi(e){const[t,a]=o.useState(!1),r=o.useRef(!1),i=o.useRef(!0);o.useEffect(()=>(i.current=!0,()=>{i.current=!1}),[]);const s=o.useCallback(()=>{if(!e||r.current)return;const l=e();if(l&&typeof l.then=="function"){r.current=!0,a(!0);const u=()=>{r.current=!1,i.current&&a(!1)};l.then(u,u)}},[e]);return{pending:t,press:s}}function ky({icon:e,title:t,message:a,action:r,className:i}){const{pending:s,press:l}=Vi(r?.onClick);return n.jsxs("div",{className:_e("empty-state",i),children:[e&&n.jsx(at,{icon:e,size:48,className:"empty-state__icon"}),t&&n.jsx("p",{className:"empty-state__title h4",children:t}),a&&n.jsx("p",{className:"empty-state__message body-3",children:a}),r&&n.jsxs("button",{type:"button",className:"empty-state__action button button40 button40--bar button--variant-main button--align-center button--shape-rounded",onClick:l,disabled:s,"aria-busy":s||void 0,children:[r.icon&&n.jsx(at,{icon:r.icon,className:"button__icon"}),n.jsx("span",{className:"button__label button-1",children:r.label})]})]})}function Ay({message:e,hint:t,icon:a="triangle-alert",onRetry:r,retryLabel:i,className:s}){const{t:l}=xe.useTranslation(),{pending:u,press:c}=Vi(r);return n.jsxs("div",{className:_e("empty-state","error-state",s),role:"alert",children:[n.jsx(at,{icon:a,size:48,className:"empty-state__icon error-state__icon"}),n.jsx("p",{className:"empty-state__message body-3",children:e??l("common.errorState.message",{defaultValue:"\uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."})}),t&&n.jsx("p",{className:"error-state__hint caption-1",children:t}),r&&n.jsxs("button",{type:"button",className:"empty-state__action button button40 button40--bar button--variant-main button--align-center button--shape-rounded",onClick:c,disabled:u,"aria-busy":u||void 0,children:[n.jsx(at,{icon:"rotate-cw",className:"button__icon"}),n.jsx("span",{className:"button__label button-1",children:i??l("common.errorState.retry",{defaultValue:"\uB2E4\uC2DC \uC2DC\uB3C4"})})]})]})}function Ny({icon:e,title:t,description:a,cta:r,tone:i="main",disabled:s=!1,onClick:l,className:u=""}){const c=o.useId(),d=`${c}-title`,m=`${c}-desc`,p=`${c}-cta`,f=()=>{s||l?.()};return n.jsx("section",{role:"button",tabIndex:s?-1:0,"aria-disabled":s||void 0,"aria-labelledby":d,"aria-describedby":`${m} ${p}`,onClick:f,onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),f())},className:_e("action-card",`action-card--${i}`,s&&"action-card--disabled",u),children:n.jsxs("div",{className:"action-card__body",children:[n.jsx("span",{"aria-hidden":!0,className:"action-card__chip",children:n.jsx(at,{icon:e,size:34})}),n.jsxs("div",{className:"action-card__text",children:[n.jsx("h2",{id:d,className:"action-card__title",children:t}),n.jsx("p",{id:m,className:"action-card__desc",children:a})]}),n.jsxs("div",{className:"action-card__cta",children:[n.jsx("span",{id:p,children:r}),n.jsx("span",{"aria-hidden":!0,className:"action-card__arrow",children:n.jsx(at,{icon:"arrow-right",size:18})})]})]})})}function Ey({as:e="div",className:t="",children:a,storage:r,...i}){r&&Lf({resolveUrl:r.resolveUrl,download:r.download??(()=>Promise.reject(new Error("[ihabdevteam-core] CoreScope: download resolver\uAC00 \uC124\uC815\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."))),exists:r.exists,resolvePath:r.resolvePath,noiseBaseUrl:r.noiseBaseUrl,noiseFileGain:r.noiseFileGain});const s=_e("ihabdevteam-core-scope",t);return n.jsx(e,{className:s,...i,children:a})}function lo(e,t=!0){o.useEffect(()=>{if(!t)return;const a=e.current;if(!a)return;const r=i=>{if(i.key!=="Tab")return;const s=Array.from(a.querySelectorAll(Cn)).filter(m=>!m.closest('[aria-hidden="true"]'));if(!s.length){i.preventDefault();return}const l=s[0],u=s[s.length-1],c=document.activeElement,d=c===a;i.shiftKey&&(c===l||d)?(i.preventDefault(),u.focus()):!i.shiftKey&&c===u&&(i.preventDefault(),l.focus())};return a.addEventListener("keydown",r),()=>a.removeEventListener("keydown",r)},[e,t])}const Cn='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',uo=new WeakMap;function co(e,t){e&&uo.set(e,t)}function po(e){let t=e;for(let a=0;t&&!t.isConnected&&a<10;a++){let r=t;for(;r&&!uo.has(r);)r=r.parentElement;if(!r)return t;t=uo.get(r)??null}return t}function qi(e){return!(!e||!e.isConnected||e===document.body||typeof e.focus!="function"||e.disabled||e instanceof HTMLInputElement&&e.type==="hidden"||e.closest('[inert],[aria-hidden="true"],[hidden]'))}function ar(e,t,a){const r=e?.isConnected?e:a?.isConnected?a:null;if(qi(t)&&!(e&&e.contains(t)))return t.focus(),t;if(!r)return null;const i=Array.from(document.querySelectorAll(Cn)).filter(c=>!(e&&e.contains(c))&&qi(c));let s=null,l=null;for(const c of i)r.compareDocumentPosition(c)&Node.DOCUMENT_POSITION_PRECEDING?s=c:l||(l=c);const u=s??l;return u?.focus(),u}function Dy({title:e="",lines:t=[],notices:a=null,children:r,variant:i="default",dismissible:s=!1,className:l=""}){const{t:u}=xe.useTranslation(),[c,d]=o.useState(!1),m=o.useRef(null),p=o.useCallback(()=>{const C=m.current;C&&C.contains(document.activeElement)&&ar(C),d(!0)},[]);if(c)return null;const f=`notice-box notice-box--${i} body-2 ${l}`.trim(),y=s&&n.jsx("button",{type:"button",className:"notice-box__dismiss",onClick:p,"aria-label":u("common.close","\uB2EB\uAE30"),children:"\xD7"});if(a&&Array.isArray(a)&&a.length)return n.jsxs("div",{className:f,role:"note",children:[a.map((C,h)=>n.jsxs("div",{className:"notice-box__inner",children:[C.title?n.jsx("span",{className:"notice-box__title body-3",children:C.title}):null,n.jsx("div",{className:"notice-box__body",children:C.lines&&C.lines.length?n.jsx("div",{children:C.lines.map((_,g)=>n.jsx("span",{className:"notice-box__line body-3",children:_},g))}):C.children??null})]},h)),y]});const x=e||t.length?n.jsxs("div",{className:"notice-box__inner",children:[e?n.jsx("span",{className:"notice-box__title body-1",children:e}):null,n.jsx("div",{className:"notice-box__body",children:t.length?n.jsx("ul",{children:t.map((C,h)=>n.jsx("li",{className:"notice-box__line",children:C},h))}):r})]}):n.jsx("div",{className:"notice-box__inner",children:r});return n.jsxs("div",{ref:m,className:f,role:"note",children:[x,y]})}const sa=[];let rr=!1;function Ui(e){if(e.key!=="Escape"||e.defaultPrevented||e.isComposing||e.keyCode===229)return;const t=sa[sa.length-1];t&&(e.stopPropagation(),t())}function Gn(e){return sa.push(e),!rr&&typeof document<"u"&&(document.addEventListener("keydown",Ui),rr=!0),()=>{const t=sa.lastIndexOf(e);t>=0&&sa.splice(t,1),sa.length===0&&rr&&typeof document<"u"&&(document.removeEventListener("keydown",Ui),rr=!1)}}const Gi=o.createContext(null);function Sy(e){return/max-width:\s*7[0-9][0-9]px/.test(e)}const Ki=e=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(e).matches;function Ty(e){const t=o.useCallback(a=>{if(typeof window>"u"||!window.matchMedia)return()=>{};const r=window.matchMedia(e);return r.addEventListener?r.addEventListener("change",a):r.addListener&&r.addListener(a),()=>{r.removeEventListener?r.removeEventListener("change",a):r.removeListener&&r.removeListener(a)}},[e]);return As.useSyncExternalStore(t,()=>Ki(e),()=>!1)}function jy(e){const[t,a]=o.useState(Ki(e));return o.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const r=window.matchMedia(e),i=l=>a(l.matches),s=r;return s.addEventListener?s.addEventListener("change",i):s.addListener&&s.addListener(i),a(r.matches),()=>{s.removeEventListener?s.removeEventListener("change",i):s.removeListener&&s.removeListener(i)}},[e]),t}const My=typeof As.useSyncExternalStore=="function"?Ty:jy;function ln(e){const t=o.useContext(Gi),a=My(e);return t&&typeof t.mobile=="boolean"&&Sy(e)?t.mobile:a}const Ly="(prefers-reduced-motion: reduce)";function mo(){return ln(Ly)}function cn(e){const{anchorRect:t,anchorEl:a,offset:r=20,edgeMargin:i=20,onClose:s,closeOnOutsideClick:l=!0,className:u="",role:c="dialog",ariaLabel:d="",children:m,backdrop:p=!1,isMobilePopup:f=!1,useBorder:y=!0,header:x,focusOnOpen:C}=e||{},h=o.useRef(null),[_,g]=o.useState({position:"fixed",left:0,top:-9999}),[A,b]=o.useState(!1),[k,v]=o.useState("bottom"),[w,B]=o.useState(!1),[E,D]=o.useState(!1),N=!t&&!a,O=o.useCallback((V=!1)=>{if(E&&f)return;const R=a?a.getBoundingClientRect():t;if(!R||!h.current)return;const H=h.current,{offsetWidth:W,offsetHeight:I}=H,S=window.innerWidth,j=window.innerHeight,F=S-R.right,U=R.left,re=R.top,ne=j-R.bottom;let le=0,K=0,oe="top";if(re>=I+r)oe="top",K=R.top-r-I,le=R.left+R.width/2-W/2;else if(ne>=I+r)oe="bottom",K=R.bottom+r,le=R.left+R.width/2-W/2;else if(F>=W+r)oe="right",le=R.right+r,K=R.top+R.height/2-I/2;else if(U>=W+r)oe="left",le=R.left-r-W,K=R.top+R.height/2-I/2;else{const me=Math.max(re,ne,F,U);me===re?(oe="top",K=R.top-r-I,le=R.left+R.width/2-W/2):me===ne?(oe="bottom",K=R.bottom+r,le=R.left+R.width/2-W/2):me===F?(oe="right",le=R.right+r,K=R.top+R.height/2-I/2):(oe="left",le=R.left-r-W,K=R.top+R.height/2-I/2)}const Ae=Number.isFinite(Number(i))?Number(i):8;le=Math.min(Math.max(le,Ae),S-W-Ae),K=Math.min(Math.max(K,Ae),j-I-Ae);const Y=Math.round(le),Q=Math.round(K);V&&h.current?(h.current.style.left=`${Y}px`,h.current.style.top=`${Q}px`,h.current.dataset.placement=oe):(v(oe||k),g({position:"fixed",left:Y,top:Q}),B(!0))},[E,f,a,t,r,i,k]);o.useLayoutEffect(()=>{if(N)return;if(E&&f){g({position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"calc(100% - 40px)",maxWidth:"calc(100% - 40px)"}),B(!0);return}O();const V=requestAnimationFrame(()=>O());return()=>cancelAnimationFrame(V)},[t,a,r,m,i,N,E,f,O]),o.useEffect(()=>{if(N||E&&f||!h.current||typeof ResizeObserver>"u")return;const V=new ResizeObserver(()=>{t&&O()});return V.observe(h.current),()=>V.disconnect()},[t,m,i,N,E,f,O]),o.useEffect(()=>{if(N||E&&f)return;let V=null;const R=()=>{if(typeof requestAnimationFrame>"u"){O(!0);return}V===null&&(V=requestAnimationFrame(()=>{V=null,O(!0)}))},H=W=>{if(!a&&s){const I=W.target;if(I&&h.current&&h.current.contains(I))return;try{if(I&&I.closest&&I.closest("[data-tooltip-ignore]"))return}catch{}$.current(!0);return}R()};return window.addEventListener("resize",R),document.addEventListener("scroll",H,{passive:!0,capture:!0}),()=>{V!==null&&cancelAnimationFrame(V),window.removeEventListener("resize",R),document.removeEventListener("scroll",H,{capture:!0})}},[t,a,s,r,m,i,N,E,f,O]),o.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const V=window.matchMedia("(max-width: 768px)"),R=()=>D(!!V.matches);R();try{V.addEventListener?V.addEventListener("change",R):V.addListener(R)}catch{try{V.addListener(R)}catch{}}return()=>{try{V.removeEventListener?V.removeEventListener("change",R):V.removeListener(R)}catch{}}},[]);const P=o.useRef(!1),G=o.useRef(null),L=mo(),M=o.useCallback((V=!1)=>{if(s&&!(A||P.current)){if(P.current=!0,V){b(!0);try{s&&s()}catch{P.current=!1,b(!1)}return}b(!0),G.current=setTimeout(()=>{G.current=null;try{s&&s()}catch{P.current=!1,b(!1)}},L?0:200)}},[A,s,b,L]);o.useEffect(()=>()=>{G.current&&clearTimeout(G.current)},[]),o.useEffect(()=>{if(N)return;const V=W=>{const I=h.current;if(!I)return;const S=W.target;if(S&&!I.contains(S)){try{if(S.closest&&S.closest("[data-tooltip-ignore]"))return}catch{}l&&M(!0)}},R=W=>{const I=h.current;if(!I)return;const S=W.target;if(S&&!I.contains(S)){try{if(S.closest&&S.closest("[data-tooltip-ignore]"))return}catch{}l&&M(!0)}},H=W=>{if(W.key==="Tab"){const I=h.current;if(!I)return;const S=I.querySelectorAll(Cn);if(!S||S.length===0)return;const j=S[0],F=S[S.length-1],U=document.activeElement;W.shiftKey?U===j&&(W.preventDefault(),F.focus()):U===F&&(W.preventDefault(),j.focus())}};return document.addEventListener("pointerdown",V,!0),document.addEventListener("click",R,!0),document.addEventListener("keydown",H),()=>{document.removeEventListener("pointerdown",V,!0),document.removeEventListener("click",R,!0),document.removeEventListener("keydown",H)}},[s,l,M,N]);const $=o.useRef(M);o.useEffect(()=>{$.current=M});const Z=!!s;o.useEffect(()=>{if(!(N||!Z))return Gn(()=>$.current())},[N,Z]),o.useEffect(()=>{const V=()=>{M(!0)};return typeof document<"u"&&document.addEventListener("speechear-close-tooltips",V),()=>{typeof document<"u"&&document.removeEventListener("speechear-close-tooltips",V)}},[M]);const q=o.useRef(null);o.useEffect(()=>{if(N||C===!1||!w)return;const V=h.current;if(!V)return;const R=V.querySelector(Cn);if(R)return q.current=document.activeElement,R.focus(),()=>{const H=q.current;q.current=null,H&&document.contains(H)&&H.focus()}},[N,C,w]),o.useEffect(()=>{c==="dialog"&&!d&&St("tooltip-no-name",'[ihab/Tooltip] \uC774\uB984 \uC5C6\uB294 role="dialog" \uC785\uB2C8\uB2E4 \u2014 ariaLabel \uC744 \uC8FC\uC138\uC694. \uB0AD\uB3C5\uAE30\uAC00 "\uB300\uD654\uC0C1\uC790" \uB77C\uACE0\uB9CC \uC77D\uC2B5\uB2C8\uB2E4.')},[c,d]);const z=n.jsxs("div",{ref:h,className:`tooltip-content ${N?"tooltip-content--inline":""} ${y?"tooltip-content--bordered":""} ${A?"is-closing":""} ${u} ${E&&f?"is-mobile":""}`,role:c,"aria-label":d||void 0,style:N?{}:{..._,visibility:w?"visible":"hidden"},tabIndex:-1,"data-placement":k,"data-left":N?"":_.left,"data-top":N?"":_.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:[x!=null&&n.jsx("div",{className:"tooltip-content__header h5",children:x}),m]});if(N||typeof document>"u")return z;if(p||E&&f){const V=n.jsxs("div",{className:"tooltip-portal",children:[n.jsx("div",{className:"tooltip-backdrop",onClick:()=>{l&&M(!0)}}),z]});return en.createPortal(V,document.body)}return en.createPortal(z,document.body)}function Bn(e){const{anchorRect:t,text:a,offset:r=8,onClose:i,className:s="",ariaLabel:l}=e||{};return a?n.jsx(cn,{anchorRect:t,offset:r,onClose:i,closeOnOutsideClick:!1,className:`tooltip-info ${s}`,ariaLabel:l||a,children:n.jsx("div",{className:"tooltip-info__content body-3",children:a})}):null}function Kn(e){const{t}=xe.useTranslation(),{anchorRect:a,title:r,items:i,activeIndex:s=-1,showIndex:l=!0,onClose:u,offset:c=12,closeOnOutsideClick:d=!0}=e||{},m=(Array.isArray(i)?i:i?[i]:[]).map(p=>typeof p=="string"?{text:p}:p);return!m.length&&!r?null:n.jsx(cn,{anchorRect:a,offset:c,onClose:u,closeOnOutsideClick:d,useBorder:!1,className:"tooltip-description",ariaLabel:r||t("tooltip.description","\uC124\uBA85"),children:n.jsxs("div",{className:"tooltip-description__box",children:[r&&n.jsx("span",{className:"tooltip-description__title body-2",children:r}),n.jsx("ol",{className:"tooltip-description__items",children:m.map((p,f)=>n.jsxs("li",{className:`tooltip-description__item body-3${f===s?" tooltip-description__item--active":""}`,children:[l&&m.length>1&&n.jsxs("span",{className:"tooltip-description__index button-1",children:[f+1,"."]}),p.color&&n.jsx("span",{className:"tooltip-description__dot",style:{background:p.color},"aria-hidden":"true"}),n.jsx("span",{children:p.text})]},f))})]})})}function Da(e){const t=o.useRef(e);return o.useEffect(()=>{t.current=e}),t}let ho=0,Yi=!1;function Zi(){Yi||typeof document>"u"||(Yi=!0,document.addEventListener("pointerdown",e=>{e.pointerType==="touch"&&(ho=Date.now())},!0),document.addEventListener("touchstart",()=>{ho=Date.now()},{capture:!0,passive:!0}))}Zi();function ia(e){return!!e&&e.pointerType==="touch"}function la(e=1e3){return Zi(),Date.now()-ho<e}function fo(e,t,a,{enabled:r=!0,fallbackOnParent:i=!1}={}){const s=Da(e),l=Da(t),u=o.useRef(null),c=o.useRef(0);o.useEffect(()=>{if(!r||typeof document>"u")return;const m=p=>{const f=p,y=p.target,x=a.current,C=!!(y&&x&&x.contains(y));if(f.pointerType!=="touch"){C&&(u.current=null);return}if(C){u.current=s.current;return}u.current=null,s.current&&!(y&&y.closest?.(".tooltip-content"))&&l.current(!1,x)};return document.addEventListener("pointerdown",m,!0),()=>document.removeEventListener("pointerdown",m,!0)},[r,a,s,l]);const d=o.useCallback(m=>{const p=u.current;return p===null?!1:(u.current=null,c.current=Date.now(),l.current(!p,m??a.current),!0)},[a,l]);return o.useEffect(()=>{if(!r||!i)return;const m=a.current,p=m?.parentElement;if(!m||!p)return;let f=null;const y=h=>{const _=h.changedTouches?.[0];if(!_)return!1;const g=m.getBoundingClientRect();return _.clientX>=g.left&&_.clientX<=g.right&&_.clientY>=g.top&&_.clientY<=g.bottom},x=h=>{f=y(h)?s.current:null},C=h=>{const _=f;f=null,!(_===null||Date.now()-c.current<700||!y(h))&&(u.current=null,c.current=Date.now(),l.current(!_,m))};return p.addEventListener("touchstart",x,{passive:!0}),p.addEventListener("touchend",C),()=>{p.removeEventListener("touchstart",x),p.removeEventListener("touchend",C)}},[r,i,a,s,l]),{touchPress:d}}function $y(e,t){const{size:a=48,type:r,htmlType:i,href:s,target:l,rel:u,icon:c,rightIcon:d,label:m,count:p,subLabel:f,children:y,ariaLabel:x,variant:C="default",align:h="center",nowrap:_=!1,selected:g,toggleable:A=!1,ariaExpanded:b,ariaControls:k,disabled:v=!1,useLabel:w=!0,useBorder:B=!0,useBG:E=!0,useDisabledCovered:D=!1,useDisabledInvisible:N=!1,width:O,minWidth:P,onClick:G,onDisabledClick:L,showTooltipInfo:M=!1,tooltipInfoText:$=null,tooltipDescription:Z=null,tooltipOnly:q=!1,iconSize:z="medium",iconColor:V,shape:R="rounded",color:H,className:W,...I}=e,S=typeof a=="string"&&isNaN(Number(a))?a.toLowerCase():String(Number(a)||48),j=S.match(/^\d+$/)?`button${S}`:`button-${S}`,F=Number(a),U=!isNaN(F)&&F<40?"button-2":"button-1",re=m??y,ne=v||!!I.disabled,le=ne?D?"disabled-covered":N?"disabled-invisibled":"disabled":C,K=le?`button--variant-${le}`:"",oe=h?`button--align-${h}`:"",Ae=_?"button--nowrap":"",Y=R?`button--shape-${R}`:"",Q=typeof V=="string"&&V.startsWith("--")?`var(${V})`:V,me={...O?{width:typeof O=="number"?`${O}px`:O}:{},...P?{minWidth:typeof P=="number"?`${P}px`:P}:{},...B?{}:{"--button-border":ne?"0":"1px solid transparent"},...Q?{"--button-icon-color":Q}:{},...H?{"--color-main":H}:{}},De=w===!1?"":re,be=Array.isArray(De)?De.length>0:!!De,te=!!d,ue=r??(be||c||te?"bar":"dot"),fe=`${j}--${ue}`,ge=o.useRef(null);o.useEffect(()=>{!Ln||i!==void 0||ge.current?.closest("form")&&St(`button-in-form:${typeof re=="string"?re:""}`,'[ihab/Button] <form> \uC548\uC778\uB370 htmlType \uC774 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 \uC774 \uB2E8\uCD94\uB294 type="button" \uC774\uB77C \uD3FC\uC744 \uBCF4\uB0B4\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uBCF4\uB0B4\uB294 \uB2E8\uCD94\uBA74 htmlType="submit" \uC744 \uC8FC\uC138\uC694. \uD3FC\uC5D0 \uBCF4\uB0B4\uB294 \uB2E8\uCD94\uAC00 \uD558\uB098\uB3C4 \uC5C6\uC73C\uBA74 **Enter \uB85C\uB3C4 \uC548 \uBCF4\uB0B4\uC9D1\uB2C8\uB2E4**(\uCE78\uC774 \uB458 \uC774\uC0C1\uC77C \uB54C).'+(typeof re=="string"&&re?` \uB2E8\uCD94: ${re}`:""))},[i,re]);const Ce=o.useRef(t);Ce.current=t;const $e=o.useCallback(Re=>{ge.current=Re;const tt=Ce.current;typeof tt=="function"?tt(Re):tt&&(tt.current=Re)},[]),He=o.useRef(ne),[Te,Ie]=o.useState(!!g),[qe,mt]=o.useState(!1),[ct,rt]=o.useState(null),ft=o.useCallback(()=>mt(!1),[]),[ke,Ve]=o.useState(!1),we=o.useId();o.useEffect(()=>{typeof g=="boolean"&&Ie(g)},[g]),o.useEffect(()=>{if(He.current&&!ne&&ge.current){const Re=ge.current;let tt=!1;try{tt=Re.matches(":focus:not(:focus-visible)")}catch{tt=!1}tt&&Re.blur(),Re.style.pointerEvents="none";const xt=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ge.current&&(ge.current.style.pointerEvents="")})});return()=>cancelAnimationFrame(xt)}He.current=ne},[ne]);const Ue=typeof g=="boolean"?!!g:Te,Be=typeof b=="boolean"?void 0:A||typeof g=="boolean"?Ue?"true":"false":I["aria-pressed"],je=_e("button",j,fe,K,oe,Ae,Y,Ue?"is-selected":null,E?null:"button--no-bg",q?"button--tooltip-only":null,W),Se=`button__icon button__icon--${z}`,Xe=Array.isArray(f)?f:f!==void 0?[f]:[],Qe=()=>{if(Array.isArray(De))return De.map((tt,xt)=>{const Lt=Xe[xt];return n.jsxs("span",{className:`button__label-text${Lt!==void 0?" button__label-text--has-sub":""}`,children:[tt,Lt!==void 0&&n.jsx("span",{className:"button__sub-label-text caption-1",children:Lt})]},xt)});const Re=f!==void 0;return n.jsxs("span",{className:`button__label-text${Re?" button__label-text--has-sub":""}`,children:[De,p!=null&&n.jsx("span",{className:"button__count",children:p}),Re&&n.jsx("span",{className:"button__sub-label-text caption-1",children:f})]})},dt=Re=>{typeof g!="boolean"&&!A&&Ie(!1),Re.currentTarget.blur()},ht=Re=>{ne||(typeof I.onMouseLeave=="function"&&I.onMouseLeave(Re),dt(Re))},wt=Re=>{if(q&>&&it.touchPress(Re.currentTarget),ne){gt&&it.touchPress(Re.currentTarget),Re.preventDefault(),L?.(Re);return}typeof g!="boolean"&&A&&Ie(tt=>!tt),G?.(Re)},Ct=o.useCallback(()=>{(M||Z)&&(mt(!0),rt(ge.current?.getBoundingClientRect()??null))},[M,Z]),Nt=o.useCallback(()=>{(M||Z)&&(mt(!1),rt(null))},[M,Z]),gt=!!(M||Z),it=fo(qe,Re=>{Re?Ct():Nt()},ge,{enabled:gt&&(ne||q),fallbackOnParent:gt&&ne}),Ke={...I};delete Ke.disabled,delete Ke.className,delete Ke.faded,delete Ke.useFaded,delete Ke.loading,delete Ke.onMouseLeave,delete Ke.onPointerEnter,delete Ke.onPointerLeave,delete Ke.onPointerUp,delete Ke.onFocus,delete Ke.onBlur,ne&&(Object.keys(Ke).forEach(Re=>{/^on[A-Z]/.test(Re)&&typeof Ke[Re]=="function"&&delete Ke[Re]}),Ke["aria-disabled"]="true");const se=(typeof M=="string"?M:null)??(typeof $=="string"?$:null)??(typeof x=="string"?x:null)??(typeof re=="string"?re:null)??void 0,Ne=typeof x=="string"?x:typeof re=="string"?re:se,We=Z?[Z.title,...Z.items??[]].filter(Boolean).join(". "):M&&se&&se!==Ne?se:"",nt=[typeof I["aria-describedby"]=="string"?I["aria-describedby"]:void 0,We?we:null].filter(Boolean).join(" ")||void 0,Fe=(Re,tt)=>n.jsx(at,{icon:Re,label:tt??Ne,className:Se,imgClassName:"button__icon-img",maskClassName:"button__icon-mask",svgClassName:"button__icon-svg"}),Ge=()=>ue==="dot"?n.jsxs(n.Fragment,{children:[Fe(c),be&&n.jsx("span",{className:`button__label ${U}`,children:Qe()})]}):h==="center"&&c?n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"button__center-group",children:[n.jsx("span",{className:"button__left",children:Fe(c)}),be&&n.jsx("span",{className:`button__label ${U}`,children:Qe()})]}),te&&n.jsx("span",{className:"button__right",children:Fe(d)})]}):n.jsxs(n.Fragment,{children:[c&&n.jsx("span",{className:"button__left",children:Fe(c,x??re)}),be&&n.jsx("span",{className:`button__label ${U}`,children:Qe()}),te&&n.jsx("span",{className:"button__right",children:Fe(d)})]}),bt=!!s&&!ne;return n.jsxs(n.Fragment,{children:[n.jsxs(bt?"a":"button",{...Ke,ref:$e,...bt?{href:s,target:l,rel:u??(l==="_blank"?"noreferrer":void 0)}:{type:i??"button",disabled:ne&&!L&&!ke},className:je,"aria-pressed":Be,"aria-expanded":typeof b=="boolean"?b:I["aria-expanded"],"aria-controls":k??I["aria-controls"],"aria-label":Ne,"aria-disabled":ne&&(bt||L||ke)?!0:void 0,"aria-describedby":nt,style:me,onClick:wt,onMouseLeave:ht,onPointerEnter:Re=>{ia(Re)||Ct(),!ne&&typeof I.onPointerEnter=="function"&&I.onPointerEnter(Re)},onPointerLeave:Re=>{ia(Re)||Nt(),!ne&&typeof I.onPointerLeave=="function"&&I.onPointerLeave(Re)},onPointerUp:Re=>{ne&>&&it.touchPress(Re.currentTarget),!ne&&typeof I.onPointerUp=="function"&&I.onPointerUp(Re)},onFocus:Re=>{Ve(!0),la()||Ct(),!ne&&typeof I.onFocus=="function"&&I.onFocus(Re)},onBlur:Re=>{Ve(!1),ne||dt(Re),Nt(),!ne&&typeof I.onBlur=="function"&&I.onBlur(Re)},children:[Ge(),We?n.jsx("span",{id:we,hidden:!0,"aria-label":We}):null]}),qe&&Z?n.jsx(Kn,{anchorRect:ct,title:Z.title,items:Z.items,onClose:ft}):qe&&se?n.jsx(Bn,{anchorRect:ct,text:se,onClose:ft}):null]})}const pe=o.forwardRef($y);pe.displayName="Button";function kt(e,t,a){const r=o.useRef(null);return o.useLayoutEffect(()=>{const i=r.current?.parentElement??null;return t(i,e),()=>a(i)},[e,t,a]),r}const Sa={title:"--promo-banner-bg-title",description:"--promo-banner-bg-description"},Co=new WeakMap;function go(e){if(e)return Co.get(e)}function Gt(e,t){e&&(e.style.setProperty(Sa.title,t.title),e.style.setProperty(Sa.description,t.description),Co.set(e,t))}function Kt(e){e&&(e.style.removeProperty(Sa.title),e.style.removeProperty(Sa.description),Co.delete(e))}const Xi={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"default"};function Ji(){const e=kt(Xi,Gt,Kt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-main","aria-hidden":"true"})}const Qi={title:"var(--color-main)",description:"var(--color-gray)",actionVariant:"main"};function el(){const e=kt(Qi,Gt,Kt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-soft","aria-hidden":"true"})}const tl={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"main"};function nl(){const e=kt(tl,Gt,Kt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-sub","aria-hidden":"true"})}const al={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"main"};function rl(){const e=kt(al,Gt,Kt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-deep","aria-hidden":"true"})}const ol={title:"var(--color-darkSub)",description:"var(--color-gray)",actionVariant:"main"};function sl(){const e=kt(ol,Gt,Kt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-soft-sub","aria-hidden":"true"})}const il={title:"var(--color-black)",description:"var(--color-darkGray)",actionVariant:"main"};function ll(){const e=kt(il,Gt,Kt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-warm","aria-hidden":"true"})}const ul={title:"var(--color-white)",description:"var(--color-lightGray)",actionVariant:"main"};function cl(){const e=kt(ul,Gt,Kt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-dark","aria-hidden":"true"})}const dl={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"main"};function pl(){const e=kt(dl,Gt,Kt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-radial","aria-hidden":"true"})}const ml={title:"var(--color-darkMain)",description:"var(--color-gray)",actionVariant:"main"};function hl(){const e=kt(ml,Gt,Kt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-diagonal","aria-hidden":"true"})}const fl={title:"var(--color-darkSub)",description:"var(--color-gray)",actionVariant:"main"};function Cl(){const e=kt(fl,Gt,Kt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-dots","aria-hidden":"true"})}const gl={title:"var(--color-black)",description:"var(--color-gray)",actionVariant:"main"};function bl(){const e=kt(gl,Gt,Kt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-outline","aria-hidden":"true",children:n.jsx("span",{className:"promo-banner-bg-outline__dot"})})}const yl={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"main"};function vl(){const e=kt(yl,Gt,Kt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-success","aria-hidden":"true"})}const xl={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"sub"};function _l(){const e=kt(xl,Gt,Kt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-naver","aria-hidden":"true"})}const wl={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"transparent-white"};function Bl(){const e=kt(wl,Gt,Kt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-instagram","aria-hidden":"true"})}const Qt=(e,t,a)=>({key:e,get label(){return Rt.t(`promoBannerBg.${e}`,t)},textTone:a}),Ry=[Qt("main","\uBA54\uC778 \uADF8\uB77C\uB514\uC5B8\uD2B8","light"),Qt("soft","\uC18C\uD504\uD2B8","dark"),Qt("sub","\uC11C\uBE0C \uCEEC\uB7EC","light"),Qt("deep","\uB525 \uADF8\uB77C\uB514\uC5B8\uD2B8","light"),Qt("softSub","\uC18C\uD504\uD2B8 \uC11C\uBE0C","dark"),Qt("warm","\uC6DC(\uAC15\uC870)","dark"),Qt("dark","\uB2E4\uD06C","light"),Qt("radial","\uBC29\uC0AC\uD615 \uADF8\uB77C\uB514\uC5B8\uD2B8","light"),Qt("diagonal","\uB300\uAC01\uC120 \uD328\uD134","dark"),Qt("dots","\uB3C4\uD2B8 \uD328\uD134","dark"),Qt("outline","\uC544\uC6C3\uB77C\uC778","dark"),Qt("success","\uC131\uACF5/\uC644\uB8CC","light"),Qt("naver","\uB124\uC774\uBC84 \uBE14\uB85C\uADF8 \uC548\uB0B4","light"),Qt("instagram","\uC778\uC2A4\uD0C0\uADF8\uB7A8 \uC548\uB0B4","light")],kl={main:Ji,soft:el,sub:nl,deep:rl,softSub:sl,warm:ll,dark:cl,radial:pl,diagonal:hl,dots:Cl,outline:bl,success:vl,naver:_l,instagram:Bl};function Al({storageKey:e="fontScale",baseFont:t=20,minScale:a=.8,maxScale:r=1.4,step:i=.1,lineHeightRatio:s=1.4}={}){const l=A=>Math.max(a,Math.min(r,Number(A))),u=A=>{try{const b=localStorage.getItem(A),k=b?Number(b):1;return Number.isFinite(k)?l(k):l(1)}catch{return l(1)}},[c,d]=o.useState(()=>u(e)),[m,p]=o.useState(e);m!==e&&(p(e),d(u(e))),o.useEffect(()=>{try{localStorage.setItem(e,String(c))}catch{}},[e,c]);const f=A=>{d(typeof A=="function"?b=>l(A(b)):l(A))},y=()=>f(A=>+(A+i).toFixed(6)),x=()=>f(A=>+(A-i).toFixed(6)),C=c<r-Number.EPSILON,h=c>a+Number.EPSILON,_=Math.round(t*c),g=Math.round(_*s);return{scale:c,setScale:f,increase:y,decrease:x,canIncrease:C,canDecrease:h,fontSize:_,lineHeight:g}}function Nl(e,t){const a=Da(t);o.useEffect(()=>{const r=()=>a.current();try{window.addEventListener(e,r)}catch{}return()=>{try{window.removeEventListener(e,r)}catch{}}},[e,a])}const bo=" \xB7 ",El=(()=>{if(typeof document>"u")return"";const e=document.title;return e.includes(bo)?e.split(bo).pop()??e:e})(),Py=o.createContext(!1),Yn=[];let Dl=null;function Iy(e){const t=o.useContext(Py);o.useEffect(()=>{if(t||typeof e!="string"||!e)return;Yn.length===0&&(Dl=document.title);const a={text:El?`${e}${bo}${El}`:e};return Yn.push(a),document.title=a.text,()=>{const r=Yn.lastIndexOf(a);r>=0&&Yn.splice(r,1),document.title=Yn.length?Yn[Yn.length-1].text:Dl??document.title}},[e,t])}const Sl=[{value:"10",label:"10\uAC1C\uC529 \uBCF4\uAE30"},{value:"25",label:"25\uAC1C\uC529 \uBCF4\uAE30"},{value:"50",label:"50\uAC1C\uC529 \uBCF4\uAE30"},{value:"100",label:"100\uAC1C\uC529 \uBCF4\uAE30"}],Fy=(()=>{let e=null;return()=>(e||(e=new Intl.Collator("ko")),e)})();function an(e,t){return Fy().compare(e,t)}const or=new Map;function Oy(e){const t=or.get(e);if(t)return t;const a=[],r=/-?\d+(?:\.\d+)?/g;let i=0;for(let s=r.exec(e);s;s=r.exec(e)){let l=s.index,u=s[0];u[0]==="-"&&l>0&&!/\s/.test(e[l-1])&&(l+=1,u=u.slice(1)),l>i&&a.push(e.slice(i,l)),a.push(Number(u)),i=s.index+s[0].length}return i<e.length&&a.push(e.slice(i)),or.size>5e3&&or.clear(),or.set(e,a),a}function zy(e){if(!/^[\d\s-]+$/.test(e))return null;const t=e.replace(/\D/g,"");return t.length<9||t.length>11?null:t[0]==="0"||t[0]==="1"&&e!==t?t:null}function Wy(e,t){const a=d=>d==null||typeof d=="number"&&Number.isNaN(d)?"":String(d).trim(),r=a(e),i=a(t);if(r===i)return 0;const s=(d,m)=>{if(typeof d=="number"&&!Number.isNaN(d))return[d];const p=zy(m);return p!==null?[p]:Oy(m)},l=s(e,r),u=s(t,i),c=Math.min(l.length,u.length);for(let d=0;d<c;d++){const m=l[d],p=u[d];if(typeof m=="number"&&typeof p=="number"){if(m!==p)return m-p;continue}if(typeof m=="number")return-1;if(typeof p=="number")return 1;const f=an(m,p);if(f!==0)return f}return l.length!==u.length?l.length-u.length:an(r,i)}const Tl=e=>e==null||typeof e=="number"&&Number.isNaN(e)||typeof e=="string"&&e.trim()==="";function yo(e,t,a){const r=Tl(e),i=Tl(t);if(r||i)return r===i?0:r?1:-1;const s=Wy(e,t);return a?s:-s}function Hy(e,t,a){const{t:r}=xe.useTranslation(),[i,s]=o.useState(()=>{const x=a?.initialPageSize;return x&&Sl.some(C=>C.value===x)?x:"25"}),[l,u]=o.useState(1),[c,d]=o.useState(t);Object.is(c,t)||(d(t),l!==1&&u(1));const m=o.useMemo(()=>Sl.map(x=>({...x,label:r("visits.showN",{n:x.value})})),[r]),p=o.useCallback(x=>{s(x),u(1)},[]),f=Math.max(1,Math.ceil(e.length/Number(i)));(l>f||l<1||!Number.isFinite(l))&&u(Math.min(Math.max(1,Number.isFinite(l)?l:1),f));const y=Math.min(Math.max(1,Number.isFinite(l)?l:1),f);return{pageRows:o.useMemo(()=>e.slice((y-1)*Number(i),y*Number(i)),[e,y,i]),pageSizeProps:{options:m,value:i,onChange:p},paginationProps:{page:y,total:f,onChange:u},setPage:u}}function Vy(e){const[t,a]=o.useState(null),r=o.useRef(t),i=o.useRef(e?.onSortChange);i.current=e?.onSortChange;const s=o.useCallback(c=>{const d=r.current,m=d?.key===c?{key:c,asc:!d.asc}:{key:c,asc:!0};r.current=m,a(m),i.current?.(m)},[]),l=o.useCallback((c,d)=>({label:c,sortDir:t?.key===d?t.asc?"asc":"desc":null,onClick:()=>s(d)}),[t,s]),u=o.useCallback((c,d)=>{if(!t)return c;const{key:m,asc:p}=t;return[...c].sort((f,y)=>yo(d(f,m),d(y,m),p))},[t]);return{sort:t,field:l,sortRows:u}}const dn="\uC804\uCCB4";Object.fromEntries(Object.entries(Jf).map(([e,{nucleus:t}])=>[e,t]));const qy={labial:e=>e("common.phonetics.place.labial",{defaultValue:"\uC591\uC21C\uC74C"}),alveolar:e=>e("common.phonetics.place.alveolar",{defaultValue:"\uCE58\uC870\uC74C"}),palatal:e=>e("common.phonetics.place.palatal",{defaultValue:"\uACBD\uAD6C\uAC1C\uC74C"}),velar:e=>e("common.phonetics.place.velar",{defaultValue:"\uC5F0\uAD6C\uAC1C\uC74C"}),glottal:e=>e("common.phonetics.place.glottal",{defaultValue:"\uC131\uBB38\uC74C"})},Uy={frontHigh:e=>e("common.phonetics.vowel.frontHigh",{defaultValue:"\uC804\uC124 \uACE0\uBAA8\uC74C"}),backHighUnrounded:e=>e("common.phonetics.vowel.backHighUnrounded",{defaultValue:"\uD6C4\uC124 \uACE0\uBAA8\uC74C \uD3C9\uC21C"}),backHighRounded:e=>e("common.phonetics.vowel.backHighRounded",{defaultValue:"\uD6C4\uC124 \uACE0\uBAA8\uC74C \uC6D0\uC21C"}),frontMid:e=>e("common.phonetics.vowel.frontMid",{defaultValue:"\uC804\uC124 \uC911\uBAA8\uC74C"}),backMidUnrounded:e=>e("common.phonetics.vowel.backMidUnrounded",{defaultValue:"\uD6C4\uC124 \uC911\uBAA8\uC74C \uD3C9\uC21C"}),backMidRounded:e=>e("common.phonetics.vowel.backMidRounded",{defaultValue:"\uD6C4\uC124 \uC911\uBAA8\uC74C \uC6D0\uC21C"}),low:e=>e("common.phonetics.vowel.low",{defaultValue:"\uC800\uBAA8\uC74C"})},Gy={j:e=>e("common.phonetics.glide.j",{defaultValue:"j\uD65C\uC74C"}),w:e=>e("common.phonetics.glide.w",{defaultValue:"w\uD65C\uC74C"}),velar:e=>e("common.phonetics.glide.velar",{defaultValue:"\u0270\uD65C\uC74C"})};function Ky(e,t){if("place"in t)return qy[t.place](e);const a=Uy[t.vowel](e);return t.glide?`${a} \xB7 ${Gy[t.glide](e)}`:a}const Yy=(e,{defaultValue:t})=>t,jl=(e,t)=>({jamos:e,phonetic:t,tooltip:Ky(Yy,t)}),kn=(e,t)=>t.map(a=>jl([a],{place:e})),Pt=(e,t,a)=>jl([...e],a?{vowel:t,glide:a}:{vowel:t}),vo={cho:[kn("labial",["\u3142","\u3143","\u314D","\u3141"]),kn("alveolar",["\u3137","\u3138","\u314C","\u3134","\u3139"]),kn("alveolar",["\u3145","\u3146"]),kn("palatal",["\u3148","\u3149","\u314A"]),kn("velar",["\u3131","\u3132","\u314B"]),kn("glottal",["\u314E"])],jung:[[Pt("\u3163","frontHigh"),Pt("\u315F","frontHigh","w"),Pt("\u3162","frontHigh","velar")],[Pt("\u3161","backHighUnrounded")],[Pt("\u315C","backHighRounded"),Pt("\u3160","backHighRounded","j")],[Pt("\u3154\u3150","frontMid"),Pt("\u3156\u3152","frontMid","j"),Pt("\u3159\u315A\u315E","frontMid","w")],[Pt("\u3153","backMidUnrounded"),Pt("\u3155","backMidUnrounded","j"),Pt("\u315D","backMidUnrounded","w")],[Pt("\u3157","backMidRounded"),Pt("\u315B","backMidRounded","j")],[Pt("\u314F","low"),Pt("\u3151","low","j"),Pt("\u3158","low","w")]],jong:[kn("labial",["\u3142","\u3141"]),kn("alveolar",["\u3137","\u3134","\u3139"]),kn("velar",["\u3131","\u3147"])]},Zy=e=>e===Xy?[]:Array.from(e),Xy="__NO_CODA__",xo=e=>e.map(t=>t.map(({jamos:a,phonetic:r,tooltip:i})=>({v:a.join(""),phonetic:r,tooltip:i}))),Ml={cho:xo(vo.cho),jung:xo(vo.jung),jong:xo(vo.jong)};Ml.jung.flat().forEach(({v:e})=>{for(const t of Zy(e));}),new Set(Ml.cho.flat().map(e=>e.v));function Jy(e,t=!0){const a=Da(e);o.useEffect(()=>{if(t)return Gn(()=>{a.current?.()})},[t,a])}function Ta(){const[e,t]=o.useState(null),a=o.useCallback(s=>t(s.getBoundingClientRect()),[]),r=o.useCallback(()=>t(null),[]),i=o.useCallback(s=>{const l=s.getBoundingClientRect();t(u=>u?null:l)},[]);return{anchorRect:e,isOpen:e!=null,openAt:a,close:r,toggleAt:i}}function Qy(e){const[t,a]=o.useState(null),[r,i]=o.useState(null),s=o.useRef(null);o.useEffect(()=>()=>{s.current&&clearTimeout(s.current)},[]);const l=o.useCallback((c,d)=>{s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{a(c),i(d)},e)},[e]),u=o.useCallback(()=>{s.current&&clearTimeout(s.current),a(null),i(null)},[]);return{payload:t,anchorRect:r,openAfterDelay:l,close:u}}function Ll(e="warning"){const[t,a]=o.useState(""),[r,i]=o.useState(e),[s,l]=o.useState(0),u=o.useCallback((p,f)=>{i(f),a(p),l(y=>y+1)},[]),c=o.useCallback(p=>u(p,"warning"),[u]),d=o.useCallback(p=>u(p,"normal"),[u]),m=o.useCallback(()=>a(""),[]);return{toastMessage:t,toastType:r,toastKey:s,showToast:u,showWarning:c,showNormal:d,clearToast:m}}function ja(e){let t=0;if(e&&typeof window<"u"&&typeof window.getComputedStyle=="function")for(let a=e;a&&a!==document.body&&a!==document.documentElement;a=a.parentElement){const r=parseInt(window.getComputedStyle(a).zIndex,10);!Number.isNaN(r)&&r>t&&(t=r)}return t>0?`max(var(--z-menu, 1500), ${t+1})`:"var(--z-menu, 1500)"}function Ma({computeStyle:e,onScroll:t="close",onResize:a="close",ignoreOutsideClickSelector:r}){const[i,s]=o.useState(!1),[l,u]=o.useState({position:"fixed"}),c=o.useRef(null),d=o.useRef(null),m=o.useCallback(()=>{c.current&&u(e(c.current.getBoundingClientRect(),c.current))},[e]);o.useLayoutEffect(()=>{i&&m()},[i,m]),o.useEffect(()=>{if(!i)return;let y=d.current?.offsetHeight??0;y>0&&m();let x=0,C=null;typeof ResizeObserver<"u"&&d.current&&(C=new ResizeObserver(()=>{const w=d.current?.offsetHeight??0;if(w!==y){if(y=w,++x>4){C?.disconnect(),C=null;return}m()}}),C.observe(d.current));const h=w=>{const B=w.target;r&&B.closest?.(r)||c.current?.contains(B)||d.current?.contains(B)||s(!1)};document.addEventListener("mousedown",h),document.addEventListener("pointerdown",h);let _=null;const g=()=>{if(typeof requestAnimationFrame>"u"){m();return}_===null&&(_=requestAnimationFrame(()=>{_=null,m()}))},A=w=>{d.current?.contains(w.target)||(t==="reposition"?g():t==="close"&&s(!1))};t!=="ignore"&&window.addEventListener("scroll",A,!0);const b=()=>{a==="reposition"?g():a==="close"&&s(!1)};let k=null;const v=()=>{b(),k&&clearTimeout(k),k=setTimeout(()=>{k=null,a==="reposition"&&m()},250)};return a!=="ignore"&&(window.addEventListener("resize",b),window.addEventListener("orientationchange",v)),()=>{_!==null&&cancelAnimationFrame(_),C?.disconnect(),document.removeEventListener("mousedown",h),document.removeEventListener("pointerdown",h),t!=="ignore"&&window.removeEventListener("scroll",A,!0),a!=="ignore"&&(window.removeEventListener("resize",b),window.removeEventListener("orientationchange",v)),k&&clearTimeout(k)}},[i,m,t,a,r]),o.useEffect(()=>{if(i)return Gn(()=>s(!1))},[i]);const p=o.useCallback(()=>s(y=>!y),[]),f=o.useCallback(()=>s(!1),[]);return{open:i,setOpen:s,toggle:p,close:f,style:l,triggerRef:c,menuRef:d}}function e2(e,{mode:t="playback",autoStart:a=!1,onPlaySpeaker:r,onComplete:i,playMs:s=1100,feedbackMs:l=1500}={}){const[u,c]=o.useState([]),[d,m]=o.useState(0),[p,f]=o.useState("idle"),[y,x]=o.useState(null),[C,h]=o.useState([]),[_,g]=o.useState(null),[A,b]=o.useState(0),k=o.useRef(0),v=o.useCallback(R=>{k.current=typeof R=="function"?R(k.current):R,b(k.current)},[]),w=o.useRef(r),B=o.useRef(i);o.useEffect(()=>{w.current=r,B.current=i},[r,i]);const E=o.useRef([]),D=()=>{E.current.forEach(clearTimeout),E.current=[]},N=(R,H)=>{E.current.push(setTimeout(H,R))};o.useEffect(()=>()=>D(),[]);const O=u[d]?.id??null,P=o.useRef(null),G=o.useCallback(()=>{D(),f("playing"),h([]),g(null),v(0);let R=0;e.forEach((H,W)=>{N(R,()=>{m(W),x(H.id),w.current?.(H)}),N(R+1e3,()=>{x(null),h(I=>[...I,H.id])}),R+=1300}),N(R,()=>{f("done"),B.current?.({score:0,total:e.length})})},[e,v]),L=o.useCallback((R,H)=>{if(H>=R.length){f("done"),B.current?.({score:k.current,total:R.length});return}P.current=null,m(H),g(null),f("playing"),x(R[H].id),w.current?.(R[H]),N(s,()=>{x(null),f("waiting")})},[s]),M=o.useCallback(()=>{D();const R=Na(e);c(R),v(0),h([]),L(R,0)},[e,L,v]),$=o.useCallback(()=>{t==="playback"?(c(e),G()):M()},[t,e,G,M]),Z=o.useCallback(()=>{D(),f("idle"),x(null),h([]),g(null),m(0),v(0),c([])},[v]),q=e.map(R=>R.id).join("|");o.useEffect(()=>(a?$():Z(),()=>D()),[t,q,a]);const z=o.useCallback(R=>{p!=="waiting"||t==="playback"||P.current===d||(P.current=d,g(R),R===u[d]?.id&&v(H=>H+1),t==="exam"?(f("playing"),N(400,()=>L(u,d+1))):(f("feedback"),N(l,()=>L(u,d+1))))},[p,t,u,d,L,l,v]),V=t==="playback"?e.length:u.length;return{bind:{activeSpeakerId:y,playedIds:C,selectedId:_,answerId:O,showFeedback:p==="feedback",clickable:p==="waiting",onSelectSpeaker:z},index:d,total:V,score:A,phase:p,done:p==="done",start:$,reset:Z}}const _o=new Map,wo=new Map;function $l(e){const t=/^data:image\/svg\+xml(;base64)?,([\s\S]*)$/.exec(e);if(!t)return null;try{return t[1]?atob(t[2]):decodeURIComponent(t[2])}catch{return null}}function t2(e){return e.replace(/<script[\s\S]*?<\/script\s*>/gi,"").replace(/<script[^>]*\/>/gi,"").replace(/\son[a-z]+\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi,"").replace(/\s(xlink:)?href\s*=\s*("\s*javascript:[^"]*"|'\s*javascript:[^']*')/gi,"")}function n2(e,t){const a=new Set;for(const l of e.matchAll(/url\(#([^)\s"']+)\)/g))a.add(l[1]);for(const l of e.matchAll(/(?:xlink:)?href="#([^"]+)"/g))a.add(l[1]);const r=new Set([...e.matchAll(/id="([^"]*)"/g)].map(l=>l[1])),i=[...a].filter(l=>r.has(l));if(i.length===0)return e;let s=e;for(const l of i){const u=l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),c=`${t}-${l}`;s=s.replace(new RegExp(`id="${u}"`,"g"),`id="${c}"`).replace(new RegExp(`url\\(#${u}\\)`,"g"),`url(#${c})`).replace(new RegExp(`((?:xlink:)?href)="#${u}"`,"g"),`$1="#${c}"`)}return s}function a2(e){const t=wo.get(e);if(t)return t;const a=fetch(e).then(r=>r.ok?r.text():null).then(r=>(r!=null&&_o.set(e,r),r)).catch(()=>null).finally(()=>{wo.delete(e)});return wo.set(e,a),a}function r2(e,t=!0){const a=t&&e?$l(e)??_o.get(e)??null:null,[r,i]=o.useState(a);return o.useEffect(()=>{if(!t||!e){i(null);return}const s=$l(e)??_o.get(e)??null;if(s!==null){i(s);return}let l=!0;return a2(e).then(u=>{l&&i(u)}),()=>{l=!1}},[e,t]),r}function o2({title:e,description:t,actionLabel:a,onAction:r,bg:i,color:s,size:l="medium",actionVariant:u,titleColor:c,descriptionColor:d,className:m=""}){const p=i??s??"main",f=o.useRef(null),[y,x]=o.useState("main"),C=ln("(max-width: 767px)"),h=o.useRef({title:!1,description:!1});o.useLayoutEffect(()=>{const A=f.current;if(!A)return;const b=go(A),k=(v,w,B)=>{if(B!==void 0)A.style.setProperty(w,B),h.current[v]=!0;else if(h.current[v]){const E=b?.[v];E?A.style.setProperty(w,E):A.style.removeProperty(w),h.current[v]=!1}};k("title","--promo-banner-bg-title",c),k("description","--promo-banner-bg-description",d)},[c,d,p]),o.useLayoutEffect(()=>{const A=f.current;if(!A)return;const b=go(A);x(b?.actionVariant??"main")},[p]);const _=_e("promo-banner",`promo-banner--${l}`,m),g=kl[p];return n.jsxs("div",{ref:f,className:_,role:"note",children:[n.jsx(g,{}),n.jsxs("div",{className:"promo-banner__text",children:[n.jsx("span",{className:`promo-banner__title ${l==="small"?"body-2":"h2"}`,children:e}),t&&n.jsx("span",{className:"promo-banner__description body-3",children:t})]}),a&&r&&n.jsx(pe,{htmlType:"button",size:40,variant:u??y,shape:"pill",useBorder:!0,onClick:r,ariaLabel:a,...C?{type:"dot",icon:"arrow-right"}:{rightIcon:"arrow-right",label:a,minWidth:140}})]})}function s2({children:e,interval:t=5e3,dotTone:a,className:r="","aria-label":i}){const{t:s}=xe.useTranslation(),l=i??s("topBanner.ariaLabel","\uBC30\uB108"),u=o.Children.toArray(e),c=u.length,[d,m]=o.useState(0),[p,f]=o.useState(!1),[y,x]=o.useState(!1),[C,h]=o.useState(!1),_=o.useRef(null),g=o.useRef(null),A=o.useRef(null),b=mo(),k=p||y||C,v=c>0?Math.min(d,c-1):0;o.useEffect(()=>{if(c<2||t<=0||k||b)return;const B=window.setInterval(()=>m(E=>(Math.min(E,c-1)+1)%c),t);return()=>window.clearInterval(B)},[c,t,k,b]);const w=B=>{g.current!=null&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>{g.current=null,h(!1)},B)};return o.useEffect(()=>()=>{g.current!=null&&window.clearTimeout(g.current)},[]),o.useEffect(()=>{if(!C)return;const B=E=>{E.pointerType==="touch"&&(A.current&&A.current.contains(E.target)||(g.current!=null&&(window.clearTimeout(g.current),g.current=null),h(!1)))};return document.addEventListener("pointerdown",B,!0),()=>document.removeEventListener("pointerdown",B,!0)},[C]),c===0?null:n.jsxs("section",{ref:A,className:_e("top-banner",r),"aria-label":l,"aria-roledescription":"carousel",onPointerEnter:B=>{_.current=B.pointerType},onPointerDown:B=>{_.current=B.pointerType,B.pointerType==="touch"&&(g.current!=null&&(window.clearTimeout(g.current),g.current=null),h(!0))},onPointerUp:B=>{B.pointerType==="touch"&&w(5e3)},onPointerCancel:B=>{B.pointerType==="touch"&&w(5e3)},onMouseEnter:()=>{_.current!=="touch"&&f(!0)},onMouseLeave:()=>f(!1),onFocus:B=>{let E=!0;try{E=B.target.matches(":focus-visible")}catch{E=!0}x(E)},onBlur:B=>{B.currentTarget.contains(B.relatedTarget)||x(!1)},children:[n.jsx("div",{className:"top-banner__viewport",children:n.jsx("div",{className:"top-banner__track",style:{transform:`translateX(-${v*100}%)`},children:u.map((B,E)=>n.jsx("div",{className:"top-banner__slide","aria-hidden":E!==v,...E!==v?{inert:!0}:{},children:B},E))})}),c>1&&n.jsx("div",{className:`top-banner__dots${(a?.[v]??"light")==="dark"?" top-banner__dots--dark":""}`,children:u.map((B,E)=>n.jsx("button",{type:"button",className:`top-banner__dot${E===v?" top-banner__dot--active":""}`,"aria-label":s("topBanner.dotAriaLabel",{count:c,index:E+1,defaultValue:`${c}\uAC1C \uC911 ${E+1}\uBC88\uC9F8 \uBC30\uB108`}),"aria-current":E===v,onClick:()=>m(E)},E))})]})}function i2({title:e,body:t,open:a=!1,onToggle:r,avatar:i,titleClassName:s="body-2",bodyClassName:l="body-2",className:u=""}){const{t:c}=xe.useTranslation();return n.jsxs("div",{className:`accordion-item ${a?"accordion-item--open":""} ${u}`.trim(),role:"listitem",children:[n.jsxs("div",{className:"accordion-item__header",role:"button",tabIndex:0,"aria-expanded":a,"data-accordion-header":!0,onClick:r,onKeyDown:d=>{if(d.key==="Enter"||d.key===" ")d.preventDefault(),r?.();else if(d.key==="ArrowDown"||d.key==="ArrowUp"){d.preventDefault();const m=d.currentTarget.closest('[role="list"]');if(!m)return;const p=Array.from(m.querySelectorAll("[data-accordion-header]")),f=p.indexOf(d.currentTarget);(d.key==="ArrowDown"?p[f+1]:p[f-1])?.focus()}},children:[i&&n.jsx("div",{className:"accordion-item__avatar",children:i}),n.jsx("div",{className:`accordion-item__title ${s}`,children:e}),n.jsx("div",{className:"accordion-item__chevron",children:n.jsx(at,{icon:a?"chevron-up":"chevron-down",label:a?c("accordion.collapse","\uC811\uAE30"):c("accordion.expand","\uD3BC\uCE58\uAE30"),className:"accordion-item__chevron-icon",imgClassName:"accordion-item__chevron-image"})})]}),a&&n.jsx("div",{className:`accordion-item__body ${l}`,children:typeof t=="string"?n.jsx("p",{children:t}):t})]})}function l2({items:e=[],defaultOpenIndex:t=0,size:a=72,className:r="",bodyClassName:i}){const[s,l]=o.useState({index:t}),u=(c,d)=>s.id!=null&&c.id!=null?c.id===s.id:s.id==null&&d===s.index;return n.jsx("div",{className:`accordion-group accordion-group--s${a} ${r}`.trim(),role:"list",children:e.map((c,d)=>n.jsx(i2,{title:c.title,body:c.body,avatar:c.avatar,open:u(c,d),onToggle:()=>l(u(c,d)?{index:-1}:{index:d,id:c.id}),bodyClassName:i},c.id??d))})}function u2(){return n.jsx("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:2.2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:n.jsx("polyline",{points:"2,6 5,9 10,3"})})}function c2(){return n.jsxs("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:2.2,strokeLinecap:"round","aria-hidden":"true",children:[n.jsx("line",{x1:"3",y1:"3",x2:"9",y2:"9"}),n.jsx("line",{x1:"9",y1:"3",x2:"3",y2:"9"})]})}function d2(){return n.jsx("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:2.2,strokeLinecap:"round","aria-hidden":"true",children:n.jsx("line",{x1:"2.5",y1:"6",x2:"9.5",y2:"6"})})}function At(e){const{t}=xe.useTranslation(),{type:a="bar",size:r,className:i="","aria-label":s,"aria-hidden":l}=e;if(a==="dot"){const{icon:k,number:v,position:w="top-right",onClick:B,animate:E=!1}=e,D=k??"check",N=v!==void 0?"number":D,O=typeof r=="number"?r:32,P=_e("circle-badge",`circle-badge--${N}`,`circle-badge--${w}`,`circle-badge--${O}`,E?"circle-badge--animate":"",B?"circle-badge--clickable":"",i),G=v!==void 0?t("badge.nthSelected",{n:v,defaultValue:"{{n}}\uBC88\uC9F8 \uC120\uD0DD"}):{check:t("badge.selected","\uC120\uD0DD\uB428"),remove:t("badge.remove","\uC81C\uAC70"),minus:t("badge.exclude","\uC81C\uC678")}[D];return n.jsxs("span",{className:P,onClick:B,onKeyDown:B?L=>{L.key!=="Enter"&&L.key!==" "||(L.preventDefault(),L.currentTarget.click())}:void 0,"aria-label":l?void 0:s??G,"aria-hidden":l||void 0,role:B?"button":l?void 0:"img",tabIndex:B?0:void 0,children:[v!==void 0&&v,v===void 0&&D==="check"&&n.jsx(u2,{}),v===void 0&&D==="remove"&&n.jsx(c2,{}),v===void 0&&D==="minus"&&n.jsx(d2,{})]})}const{label:u,children:c,variant:d="default",fill:m="filled",minWidth:p,iconLeft:f,iconRight:y,color:x}=e,C=typeof r=="number"?"medium":r??"medium",h={small:"caption-2b",medium:"body-3b",large:"body-2b"}[C]??"body-2b",_={small:12,medium:14,large:16}[C]??14,g=_e("badge",`badge--${d}`,`badge--${C}`,m!=="filled"?`badge--${m}`:"",h,i),A=x?.startsWith("--")?`var(${x})`:x,b=p!==void 0||A?{...p!==void 0?{minWidth:typeof p=="number"?`${p}px`:p}:{},...A?{"--badge-color":A}:{}}:void 0;return n.jsxs("span",{className:g,style:b,"aria-label":l?void 0:s,role:s&&!l?"img":void 0,"aria-hidden":l||void 0,children:[f&&n.jsx(at,{icon:f,size:_,className:"badge__icon"}),u??c,y&&n.jsx(at,{icon:y,size:_,className:"badge__icon"})]})}function La({columns:e=[],onClose:t,className:a="",size:r="medium"}){const{t:i}=xe.useTranslation(),s=r==="small"?40:48,[l,u]=o.useState([]),c=o.useMemo(()=>{const h=[{title:null,columns:e}];let _=e;for(const g of l){const A=_?.[g.ci]?.items?.[g.ii];if(!A||!Array.isArray(A.children)||!A.children.length)break;_=[{title:null,items:A.children}],h.push({title:A.label||null,columns:_})}return h},[e,l]),d=c[c.length-1],m=c.length-1,p=o.useCallback(()=>u(h=>h.slice(0,Math.max(0,Math.min(h.length,m)-1))),[m]),f=o.useRef(null),y=o.useRef(null),x=c.length;o.useEffect(()=>{y.current||(y.current=document.activeElement);let h=0,_=0;const g=()=>{const A=f.current?.querySelector("button:not([disabled])");if(A&&A.offsetParent){A.focus({preventScroll:!0});return}_++<20&&(h=requestAnimationFrame(g))};return h=requestAnimationFrame(g),()=>cancelAnimationFrame(h)},[x]),o.useEffect(()=>()=>{y.current?.focus?.({preventScroll:!0})},[]);const C=o.useCallback((h,_,g)=>{if(h){if(Array.isArray(h.children)&&h.children.length){u(A=>[...A.slice(0,m),{ci:_,ii:g}]);return}try{typeof h.onClick=="function"&&h.onClick()}catch{}try{h&&h.closeOnSelect&&typeof t=="function"&&t()}catch{}}},[t,m]);return n.jsxs("div",{className:`tooltip-menu tooltip-menu--${r} ${a}`,children:[(c.length>1||d.title)&&n.jsxs("div",{className:"tooltip-menu__header",children:[c.length>1?n.jsx(pe,{htmlType:"button",size:s,type:"dot",icon:"chevron-left",ariaLabel:i("common.back","\uB4A4\uB85C"),onClick:p,variant:"transparent-gray",useBorder:!1}):null,n.jsx("div",{className:"tooltip-menu__title button-1",children:d.title})]}),n.jsx("div",{className:"tooltip-menu__columns",ref:f,children:d.columns&&d.columns.map((h,_)=>n.jsxs("div",{className:"tooltip-menu__column",children:[h.title?n.jsx("div",{className:"tooltip-menu__column-title body-3",children:h.title}):null,n.jsx("div",{className:"tooltip-menu__items",children:(h.items||[]).map((g,A)=>n.jsxs(o.Fragment,{children:[g.separatorBefore&&A>0&&n.jsx("div",{className:"tooltip-menu__separator",role:"separator"}),n.jsx(pe,{htmlType:"button",className:"tooltip-menu__item",size:s,type:g.label?"bar":"dot",icon:g.selected?"check":g.icon||"none",rightIcon:Array.isArray(g.children)&&g.children.length?"chevron-right":g.badgeCount?n.jsx(At,{type:"dot",position:"inline",number:Math.min(g.badgeCount,99),size:24,"aria-hidden":!0}):void 0,label:g.label,ariaLabel:g.label&&g.badgeCount&&g.badgeCount>0?i("nav.badgeLabel",{label:g.label,count:g.badgeCount,defaultValue:"{{label}}, {{count}}\uAC1C"}):g.label,onClick:()=>C(g,_,A),selected:g.selected,disabled:g.disabled,showTooltipInfo:g.tooltip||!1,useBorder:!1,align:"left"})]},A))})]},_))})]})}const Rl=".content-area";function Bo(e,t="Nav"){try{const a=typeof e=="string"?document.querySelector(e):e?.current??document.querySelector(Rl);if(a){a.scrollTop=0;return}const r=document.scrollingElement??document.documentElement;r&&r.scrollHeight<=r.clientHeight&&St("nav-scroll-container",`[${t}] \uBCF8\uBB38\uC744 \uB9E8 \uC704\uB85C \uB418\uB3CC\uB9B4 \uD1B5\uC744 \uBABB \uCC3E\uC558\uB2E4(\uAE30\uBCF8 ${Rl}) \u2014 \uCC3D\uB3C4 \uAD6C\uB97C \uC218 \uC5C6\uC5B4 \uC544\uBB34 \uC77C\uB3C4 \uD558\uC9C0 \uC54A\uB294\uB2E4. scrollContainer \uB85C \uD1B5\uC744 \uC54C\uB824 \uC900\uB2E4.`),window.scrollTo({top:0})}catch{}}const ko=52,sr=10,Pl=e=>e&&e>0?e:0;function Il({items:e=[],activeKey:t,onChange:a,appMode:r,onAppModeChange:i,moreItems:s=[],scrollContainer:l}){const{t:u}=xe.useTranslation(),c=r==="manager"?"malgwi":"manager",d=r==="manager"?"arrow-left":"arrow-right",m=r==="manager"?u("nav.modeLabelMalgwi","\uB9D0\uADC0"):u("nav.modeLabelManager","\uB9D0\uADC0 \uB9E4\uB2C8\uC800"),p=o.useRef(null),[f,y]=o.useState(0),x=e.length;o.useEffect(()=>{const R=p.current;if(!R)return;const H=()=>{const S=typeof getComputedStyle=="function"?getComputedStyle(R):null,j=R.clientWidth-(parseFloat(S?.paddingLeft??"")||0)-(parseFloat(S?.paddingRight??"")||0),F=R.querySelector(".bottom-nav__left"),U=F?.nextElementSibling,re=(F?.offsetWidth??0)+(F&&U?.classList.contains("bottom-nav__divider")?U.offsetWidth:0);y(Math.max(0,j-re))};if(H(),typeof ResizeObserver>"u")return;const W=new ResizeObserver(H);W.observe(R);const I=R.querySelector(".bottom-nav__left");return I&&W.observe(I),()=>W.disconnect()},[i]);const C=ko+1,h=R=>Math.max(0,Math.floor((R+sr)/(ko+sr))),_=x*(ko+sr)-sr<=f,g=f<=0||s.length===0&&_?x:Math.min(x,h(f-C)),A=f>0&&g<x,b=A?g:x,k=e.slice(0,b),v=e.slice(b),w=A||s.length>0,B=o.useCallback((R,H)=>({position:"fixed",bottom:window.innerHeight-R.top+8,right:window.innerWidth-R.right,zIndex:ja(H)}),[]),E=o.useId(),{open:D,toggle:N,close:O,style:P,triggerRef:G,menuRef:L}=Ma({computeStyle:B,onScroll:"ignore",onResize:"reposition"}),M=o.useCallback((R,H)=>H>0?u("nav.badgeLabel",{label:R,count:H,defaultValue:"{{label}}, {{count}}\uAC1C"}):R,[u]),$=o.useCallback((R,H)=>H>0?u("nav.badgeInsideLabel",{label:R,count:H,defaultValue:"{{label}}, \uC548\uC5D0 \uC54C\uB9BC {{count}}\uAC1C"}):R,[u]),Z=o.useCallback(()=>i?.(c),[i,c]),q=o.useMemo(()=>v.find(R=>!!R.key&&R.key===t)??s.find(R=>R.selected||R.key&&R.key===t),[v,t,s]),z=o.useMemo(()=>[{items:[...v.map(R=>({label:R.label,icon:R.icon,badgeCount:R.badgeCount,selected:!!R.key&&R.key===t,closeOnSelect:!0,disabled:R.state==="disabled",onClick:()=>{R.state!=="disabled"&&(R.key&&a&&(a(R.key),Bo(l,"BottomNav")),O())}})),...s.map(R=>({label:R.label,icon:R.icon,badgeCount:R.badgeCount,selected:R.selected??(!!R.key&&R.key===t),closeOnSelect:!0,onClick:()=>{R.onClick?.(),O()}}))]}],[v,s,t,a,O]),V=[...v,...s].reduce((R,H)=>R+Pl(H.badgeCount),0);return n.jsxs("nav",{className:"bottom-nav",ref:p,"aria-label":u("nav.bottomNav","\uD558\uB2E8 \uB124\uBE44\uAC8C\uC774\uC158"),children:[i&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"bottom-nav__left",children:n.jsx(pe,{htmlType:"button",size:52,type:"dot",icon:d,ariaLabel:m,className:"bottom-nav-item",onClick:Z})}),n.jsx("div",{className:"bottom-nav__divider","aria-hidden":"true"})]}),n.jsx("div",{className:"bottom-nav__items",children:k.map((R,H)=>{const W=Pl(R.badgeCount);return n.jsxs("span",{className:"bottom-nav__slot",children:[n.jsx(pe,{htmlType:"button",size:52,type:"dot",icon:R.icon,ariaLabel:M(R.label,W),selected:!!R.key&&R.key===t,disabled:R.state==="disabled",className:"bottom-nav-item",onClick:()=>{R.key&&(a?.(R.key),Bo(l,"BottomNav"))}}),W>0&&n.jsx("span",{"aria-hidden":"true",children:n.jsx(At,{type:"dot",position:"top-right",number:Math.min(W,99),size:24})})]},R.key??`__slot-${H}`)})}),w&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"bottom-nav__divider","aria-hidden":"true"}),n.jsx("div",{className:"bottom-nav__right",children:n.jsxs("div",{ref:G,className:"bottom-nav__slot",children:[n.jsx(pe,{htmlType:"button",size:52,type:"dot",icon:q?.icon??"ellipsis",ariaLabel:$(q?.label??u("nav.more","\uB354\uBCF4\uAE30"),V),selected:!!q,className:"bottom-nav-item",onClick:N,"aria-expanded":D,"aria-controls":D?E:void 0}),V>0&&n.jsx("span",{"aria-hidden":"true",children:n.jsx(At,{type:"dot",position:"top-right",number:Math.min(V,99),size:24})}),D&&en.createPortal(n.jsx("div",{id:E,role:"group","aria-label":u("nav.moreMenu","\uB354\uBCF4\uAE30 \uBA54\uB274"),className:"tooltip-content",style:P,ref:L,children:n.jsx(La,{columns:z,onClose:O})}),document.body)]})})]})]})}function Fl(e){if(typeof e!="string")return!1;let t="";for(const r of e){const i=r.charCodeAt(0);i<=32||i>=127&&i<=159||(t+=r)}if(!t)return!1;const a=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(t);return a?["http","https","mailto","tel"].includes(a[1].toLowerCase()):!0}function Ol(e,t,a){return a&&a>0?e("nav.badgeLabel",{label:t,count:a,defaultValue:"{{label}}, {{count}}\uAC1C"}):t}function p2(e){const{t}=xe.useTranslation(),{activeKey:a,unreadCount:r,onDebug:i,onNotification:s,onSetting:l,onHelp:u,onFeedback:c,onAccount:d}=e||{},m="default";return i||s||l||u||c||d?n.jsxs("div",{className:"side-nav__footer",children:[i&&n.jsx(pe,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:m,icon:"terminal",ariaLabel:t("nav.debug","\uB514\uBC84\uADF8"),onClick:i,selected:a==="debug"}),s&&n.jsxs("span",{className:"side-nav__notification-wrap",children:[n.jsx(pe,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:m,icon:"bell",ariaLabel:Ol(t,t("nav.notifications","\uC54C\uB9BC"),r),onClick:s,selected:a==="notifications"}),!!r&&r>0&&n.jsx(At,{type:"dot",number:Math.min(r,99),size:24,"aria-hidden":!0})]}),l&&n.jsx(pe,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:m,icon:"settings",ariaLabel:t("nav.settings","\uC124\uC815"),onClick:l,selected:a==="settings"}),u&&n.jsx(pe,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:m,icon:"message-circle-question-mark",ariaLabel:t("nav.help","\uB3C4\uC6C0\uB9D0"),onClick:u,selected:a==="help"}),c&&n.jsx(pe,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:m,icon:"bug",ariaLabel:t("nav.feedback","\uBC84\uADF8\uC2E0\uACE0"),onClick:c,selected:a==="feedback"}),d&&n.jsx(pe,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:m,icon:"user-round",ariaLabel:t("nav.account","\uACC4\uC815"),onClick:d,selected:a==="account"})]}):null}function zl(e){const{t}=xe.useTranslation(),{item:a,itemKey:r,label:i,icon:s,active:l,onClick:u,style:c,state:d,labelStyle:m}=e||{},p=a?.key??r??"",f=a?.label??i??"",y=a?.icon??s??"",x=a?.badge??0,C=n.jsx("span",{className:"side-nav__icon-wrap",children:n.jsx(at,{icon:y,label:typeof f=="string"?f:void 0,className:"side-nav__icon",maskClassName:"side-nav__icon-image",imgClassName:void 0,svgClassName:void 0})}),h=d==="disabled",_=`side-nav__item ${l?"active":""} ${d||""} ${h?"disabled":""} ${a?.child?"side-nav__item--child":""}`,g=o.useCallback(A=>{if(h)return;const b=A.detail>0;if(b)try{A.currentTarget.blur()}catch{}u?.(p,A.currentTarget,b)},[h,p,u]);return n.jsxs("button",{type:"button",className:_,onClick:g,"aria-label":typeof f=="string"?Ol(t,f,x):void 0,"aria-current":l?"page":void 0,style:c,"aria-disabled":h,children:[C,n.jsx("span",{className:"side-nav__label button-1 f",style:m,children:f}),x>0&&n.jsx(At,{type:"dot",position:"inline",number:Math.min(x,99),size:24,"aria-hidden":!0}),d==="loading"&&n.jsx("span",{className:"side-nav__spinner",role:"img","aria-label":t("loader.loading","\uBD88\uB7EC\uC624\uB294 \uC911\u2026")})]})}function Wl(e){const{t}=xe.useTranslation(),{items:a=[],activeKey:r,onChange:i,unreadCount:s,onDebug:l,onNotification:u,onAccount:c,onSetting:d,onHelp:m,onFeedback:p,appMode:f,onAppModeChange:y,scrollContainer:x}=e||{},C=f==="manager",h=o.useCallback(()=>y?.(C?"malgwi":"manager"),[y,C]),_=o.useRef(null),[g,A]=o.useState(null);o.useEffect(()=>{const B=_.current;if(!B)return;let E=null;const D=()=>{const{scrollHeight:P,clientHeight:G,scrollTop:L}=B;if(P<=G+1){A(z=>z===null?z:null);return}const M=Math.max(24,G/P*G),$=G-M,Z=P-G,q={top:Math.round(L/Z*$),height:Math.round(M)};A(z=>z&&z.top===q.top&&z.height===q.height?z:q)},N=()=>{if(typeof requestAnimationFrame>"u"){D();return}E===null&&(E=requestAnimationFrame(()=>{E=null,D()}))};D(),B.addEventListener("scroll",N,{passive:!0});const O=typeof ResizeObserver<"u"?new ResizeObserver(N):null;O?.observe(B);for(const P of Array.from(B.children))O?.observe(P);return()=>{E!==null&&cancelAnimationFrame(E),B.removeEventListener("scroll",N),O?.disconnect()}},[a]);const b=o.useRef(null),k=o.useCallback(B=>{const E=_.current;E&&(B.preventDefault(),b.current={y:B.clientY,top:E.scrollTop},B.currentTarget.setPointerCapture(B.pointerId))},[]),v=o.useCallback(B=>{const E=_.current,D=b.current;!E||!D||(E.scrollTop=D.top+(B.clientY-D.y)*(E.scrollHeight/E.clientHeight))},[]),w=o.useCallback(B=>{b.current=null,B.currentTarget.hasPointerCapture(B.pointerId)&&B.currentTarget.releasePointerCapture(B.pointerId)},[]);return n.jsxs("nav",{ref:_,"aria-label":t("nav.mainMenu","\uBA54\uC778 \uBA54\uB274"),className:"side-nav__menu",children:[g&&n.jsx("div",{className:"side-nav__scroll","aria-hidden":"true",children:n.jsx("div",{className:"side-nav__scroll-thumb",style:{top:g.top,height:g.height},onPointerDown:k,onPointerMove:v,onPointerUp:w,onPointerCancel:w})}),n.jsxs("div",{className:"side-nav__menu-list",children:[(a||[]).filter(B=>!B.section&&(B.key||B.label)).map((B,E)=>n.jsxs(o.Fragment,{children:[B.divider&&n.jsx("div",{className:"side-nav__separator"}),n.jsx(zl,{item:B,active:!!B.key&&B.key===r,state:B.disabled?"disabled":void 0,onClick:(D,N,O)=>{if(B.disabled)return;if(B.href){if(Fl(B.href)&&window.open(B.href,"_blank","noopener,noreferrer"),O)try{N?.blur()}catch{}return}if(i?.(B.key),Bo(x,"SideNav"),!O)return;try{N?.blur()}catch{}if(typeof window<"u"&&window.matchMedia){if(!window.matchMedia("(min-width: 768px) and (max-width: 1023px)").matches)return}else return;const P=document.querySelector(".header");if(P){const G=typeof P.matches=="function";if(!(window.matchMedia("(hover: hover)").matches&&G&&P.matches(":hover"))){P.classList.add("header--force-collapsed");const L=()=>{P.classList.remove("header--force-collapsed"),P.removeEventListener("mouseenter",L)};P.addEventListener("mouseenter",L)}}}})]},B.key??`side-nav__item-${E}`)),y&&n.jsx("div",{className:"side-nav__separator side-nav__separator--short"}),y&&n.jsx(zl,{item:{key:"__mode-switch__",label:C?t("nav.goToMalgwi","\uB9D0\uADC0\uB85C \uC774\uB3D9"):t("nav.goToManager","\uB9D0\uADC0\uB9E4\uB2C8\uC800\uB85C \uC774\uB3D9"),icon:C?"arrow-left":"arrow-right"},onClick:h})]}),n.jsx(p2,{activeKey:r,unreadCount:s,onDebug:l,onNotification:u,onAccount:c,onSetting:d,onHelp:m,onFeedback:p})]})}var ir='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Logo_SpeechEar_kor" xmlns="http://www.w3.org/2000/svg" width="583.33" height="240" viewBox="0 0 583.33 240"><g id="text"><path d="M278.07,115.18V47.71h85.73v67.47h-85.73ZM408.4,173.42v20.18h-125.33v-44.02h96.5v-5.96h-96.88v-20.18h124.18v44.02h-96.11v5.96h97.65ZM305.56,70.97v20.76h30.95v-20.76h-30.95ZM423.39,92.88h-16.53v25.37h-27.68V45.98h27.68v20.18h16.53v26.72Z"/><path d="M527.58,113.83v26.33c-7.82,3.59-20.06,5.38-36.71,5.38h-1.73v48.06h-27.68v-48.06h-34.21v-26.33h64.01c16.4,0,28.51-1.79,36.33-5.38ZM435.31,75.77v-26.33h80.35v62.09h-27.68v-35.75h-52.67ZM563.33,193.61h-27.68V45.98h27.68v147.63Z"/></g><g id="symbol"><path d="M183.92,56.08c-8.48-15.54-24.97-26.08-43.92-26.08h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%234dcdc0"/><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23499cdf"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></g></svg>',Ao='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Logo_SpeechEarManager_ko" xmlns="http://www.w3.org/2000/svg" width="1035.43" height="240" viewBox="0 0 1035.43 240"><g id="text"><path d="M278.07,115.18V47.71h85.73v67.47h-85.73ZM408.4,173.42v20.18h-125.33v-44.02h96.5v-5.96h-96.88v-20.18h124.18v44.02h-96.11v5.96h97.65ZM305.56,70.97v20.76h30.95v-20.76h-30.95ZM423.39,92.88h-16.53v25.37h-27.68V45.98h27.68v20.18h16.53v26.72Z"/><path d="M527.58,113.83v26.33c-7.82,3.59-20.06,5.38-36.71,5.38h-1.73v48.06h-27.68v-48.06h-34.21v-26.33h64.01c16.4,0,28.51-1.79,36.33-5.38ZM435.31,75.77v-26.33h80.35v62.09h-27.68v-35.75h-52.67ZM563.33,193.61h-27.68V45.98h27.68v147.63Z"/><path d="M644.64,52.32v131.48h-58.24V52.32h58.24ZM634.45,173.81V62.32h-38.25v111.49h38.25ZM713.65,193.61h-10.19v-75.16h-28.64v72.66h-10V46.94h10v61.32h28.64v-62.28h10.19v147.63Z"/><path d="M819.46,171.6c6.6-1.35,12.08-3.11,16.44-5.29v10.19c-4.23,2.31-9.64,4.1-16.24,5.38-6.6,1.28-13.3,1.92-20.09,1.92h-57.28V51.36h10.57v122.25h46.71c6.66,0,13.29-.67,19.89-2.02ZM851.47,193.8V45.98h10.57v147.63l-10.57.19Z"/><path d="M935.66,113.64l48.44,62.28-8.27,6.34-43.06-56.13c-4.36,16.66-10.38,29.92-18.07,39.79-7.69,9.87-16.72,15.83-27.1,17.88v-10.76c8.71-2.05,16.21-8.07,22.49-18.07,6.28-10,11.05-22.97,14.32-38.92,3.27-15.95,5.03-33.86,5.29-53.73h-39.21v-10h88.61v10h-39.02c-.13,18.84-1.6,35.95-4.42,51.32ZM1015.43,193.61h-10.38v-79.39h-37.87v-10.19h37.87v-58.05h10.38v147.63Z"/></g><g id="symbol"><path d="M183.92,56.08c-8.48-15.54-24.97-26.08-43.92-26.08h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%234dcdc0"/><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23499cdf"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></g></svg>',m2='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="a" xmlns="http://www.w3.org/2000/svg" width="240" height="240" viewBox="0 0 240 240"><path d="M183.92,56.08c-8.48-15.54-24.97-26.08-43.92-26.08h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%234dcdc0"/><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23499cdf"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></svg>';function Hl({appMode:e}){const{t}=xe.useTranslation(),a=e==="manager",r=a?Ao:ir,i=m2;return n.jsxs("div",{className:"brand-identity__root","aria-label":t("header.biArea","BI \uC601\uC5ED"),children:[n.jsx("img",{src:i,alt:t("header.biSymbol","BI \uC2EC\uBCFC"),className:"brand-identity__image brand-identity__image--symbol"}),n.jsx("img",{src:r,alt:a?t("header.logoManager","\uB9D0\uADC0\uB9E4\uB2C8\uC800 \uB85C\uACE0"):t("header.logoMalgwi","\uB9D0\uADC0 \uB85C\uACE0"),className:"brand-identity__image brand-identity__image--logo"})]})}function Vl({activeKey:e,onChange:t,items:a,malgwiItems:r,managerItems:i,unreadCount:s,onDebug:l,onNotification:u,onAccount:c,onSetting:d,onHelp:m,onFeedback:p,appMode:f,onAppModeChange:y,scrollContainer:x}){const{t:C}=xe.useTranslation(),h=ln("(max-width: 767px)"),_=o.useMemo(()=>(a??[]).filter(P=>!P.section&&(P.key||P.label)).map(P=>({key:P.key,label:typeof P.label=="string"?P.label:void 0,icon:P.icon,state:P.disabled?"disabled":void 0,badgeCount:P.badge})),[a]),g=o.useCallback(P=>{const G=a?.find(L=>L.key===P);if(!G?.disabled){if(G?.href){Fl(G.href)&&window.open(G.href,"_blank","noopener,noreferrer");return}t?.(P)}},[a,t]),A=o.useMemo(()=>{const P=[];return l&&P.push({key:"debug",icon:"terminal",label:C("nav.debug","\uB514\uBC84\uADF8"),onClick:l}),u&&P.push({key:"notifications",icon:"bell",label:C("nav.notifications","\uC54C\uB9BC"),badgeCount:s,onClick:u}),d&&P.push({key:"settings",icon:"settings",label:C("nav.settings","\uC124\uC815"),onClick:d}),m&&P.push({key:"help",icon:"message-circle-question-mark",label:C("nav.help","\uB3C4\uC6C0\uB9D0"),onClick:m}),p&&P.push({key:"feedback",icon:"bug",label:C("nav.feedback","\uBC84\uADF8\uC2E0\uACE0"),onClick:p}),c&&P.push({key:"account",icon:"user-round",label:C("nav.account","\uACC4\uC815"),onClick:c}),P},[C,l,u,d,m,p,c,s]),b=o.useCallback((P,G)=>({position:"fixed",top:P.bottom+8,right:Math.max(8,window.innerWidth-P.right),zIndex:ja(G)}),[]),k=o.useId(),{open:v,toggle:w,close:B,style:E,triggerRef:D,menuRef:N}=Ma({computeStyle:b,onScroll:"ignore",onResize:"reposition"}),O=o.useMemo(()=>[{items:A.map(P=>({label:P.label,icon:P.icon,badgeCount:P.badgeCount,selected:P.selected??(!!P.key&&P.key===e),closeOnSelect:!0,onClick:()=>{P.onClick?.(),B()}}))}],[A,e,B]);return n.jsxs("aside",{className:`header${f==="manager"?" header--manager":""}`,children:[n.jsxs("div",{className:"header__bi",children:[n.jsx(Hl,{appMode:f}),n.jsxs("div",{className:"header__menu-button",ref:D,children:[n.jsx(pe,{htmlType:"button",size:48,type:"dot",shape:"pill",variant:"default",useBorder:!1,icon:"menu",ariaLabel:u&&s&&s>0?C("nav.badgeInsideLabel",{label:C("header.menuOpen","\uBA54\uB274 \uC5F4\uAE30"),count:s,defaultValue:"{{label}}, \uC548\uC5D0 \uC54C\uB9BC {{count}}\uAC1C"}):C("header.menuOpen","\uBA54\uB274 \uC5F4\uAE30"),onClick:w,"aria-expanded":v,"aria-controls":v?k:void 0}),!!u&&!!s&&s>0&&n.jsx(At,{type:"dot",number:Math.min(s,99),size:24,"aria-hidden":!0}),v&&en.createPortal(n.jsx("div",{id:k,role:"group","aria-label":C("header.utilMenu","\uC720\uD2F8\uB9AC\uD2F0 \uBA54\uB274"),className:"tooltip-content",style:E,ref:N,children:n.jsx(La,{columns:O,onClose:B})}),document.body)]})]}),n.jsx(Wl,{scrollContainer:x,items:a,activeKey:e??void 0,onChange:t,unreadCount:s,onDebug:l,onNotification:u,onAccount:c,onSetting:d,onHelp:m,onFeedback:p,appMode:f,onAppModeChange:y}),h&&n.jsx(Il,{items:_,activeKey:e??void 0,onChange:g,scrollContainer:x,appMode:f,onAppModeChange:y})]})}const h2=Vl,f2=()=>Rt.t("passCard.planSuffix","\uC774\uC6A9\uAD8C");function ql(e){if(!(e==null||e==="")){if(typeof e=="string"&&/^\s*\d[\d,]*\s*$/.test(e)){const t=Number(e.replace(/[,\s]/g,""));if(Number.isFinite(t))return oa(`${t.toLocaleString("ko-KR")}\uC6D0`)}return oa(typeof e=="number"?`${e.toLocaleString("ko-KR")}\uC6D0`:e)}}function C2(e){const t=`${e.code??""} ${e.name??""}`.toLowerCase();return/manager|매니저/.test(t)?"manager":"speechear"}function g2(e){if(e.durationDays&&e.durationDays>0){const s=e.durationDays;return s%365===0?`${s/365}\uB144`:`${s}\uC77C`}const t=(e.code??"").match(/(\d+)(d|y)\b/i);if(t)return t[2].toLowerCase()==="y"?`${t[1]}\uB144`:`${t[1]}\uC77C`;const a=e.name??"",r=a.match(/(\d+\s*(?:년|개월|주|일))\s*(?:이용권)?\s*$/);if(r)return r[1].replace(/\s+/g,"");const i=a.match(/(\d+)\s*-?\s*(day|year)s?\b/i);return i?i[2].toLowerCase()==="year"?`${i[1]}\uB144`:`${i[1]}\uC77C`:a||f2()}function b2(e){const t=(e??"").match(/(\d+)(d|y)\b/i);if(!t)return null;const a=Number(t[1]);return t[2].toLowerCase()==="y"?a*365:a}function Ul(e){return{type:e.type??C2(e),plan:g2(e),label:e.label,price:ql(e.price),originalPrice:ql(e.originalPrice),discountLabel:e.discountLabel}}var y2='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Logo_SpeechEar_kor_mono" xmlns="http://www.w3.org/2000/svg" width="583.33" height="240" viewBox="0 0 583.33 240"><g id="text"><path d="M278.07,115.18V47.71h85.73v67.47h-85.73ZM408.4,173.42v20.18h-125.33v-44.02h96.5v-5.96h-96.88v-20.18h124.18v44.02h-96.11v5.96h97.65ZM305.56,70.97v20.76h30.95v-20.76h-30.95ZM423.39,92.88h-16.53v25.37h-27.68V45.98h27.68v20.18h16.53v26.72Z" fill="%23fff"/><path d="M527.58,113.83v26.33c-7.82,3.59-20.06,5.38-36.71,5.38h-1.73v48.06h-27.68v-48.06h-34.21v-26.33h64.01c16.4,0,28.51-1.79,36.33-5.38ZM435.31,75.77v-26.33h80.35v62.09h-27.68v-35.75h-52.67ZM563.33,193.61h-27.68V45.98h27.68v147.63Z" fill="%23fff"/></g><g id="symbol"><g opacity=".5"><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23fff"/></g><path d="M140,30h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84-3.88-7.1-6.08-15.25-6.08-23.92v-80c0-16.57,13.43-30,30-30h80c8.66,0,16.81,2.21,23.92,6.08-8.48-15.54-24.97-26.08-43.92-26.08Z" fill="%23fff"/><path d="M183.92,56.08c3.88,7.1,6.08,15.25,6.08,23.92v80c0,16.57-13.43,30-30,30h-80c-8.66,0-16.81-2.21-23.92-6.08,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%23fff"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></g></svg>',v2='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Logo_SpeechEarManager_ko_mono" xmlns="http://www.w3.org/2000/svg" width="1035.43" height="240" viewBox="0 0 1035.43 240"><g id="text"><path d="M278.07,115.18V47.71h85.73v67.47h-85.73ZM408.4,173.42v20.18h-125.33v-44.02h96.5v-5.96h-96.88v-20.18h124.18v44.02h-96.11v5.96h97.65ZM305.56,70.97v20.76h30.95v-20.76h-30.95ZM423.39,92.88h-16.53v25.37h-27.68V45.98h27.68v20.18h16.53v26.72Z" fill="%23fff"/><path d="M527.58,113.83v26.33c-7.82,3.59-20.06,5.38-36.71,5.38h-1.73v48.06h-27.68v-48.06h-34.21v-26.33h64.01c16.4,0,28.51-1.79,36.33-5.38ZM435.31,75.77v-26.33h80.35v62.09h-27.68v-35.75h-52.67ZM563.33,193.61h-27.68V45.98h27.68v147.63Z" fill="%23fff"/><path d="M644.64,52.32v131.48h-58.24V52.32h58.24ZM634.45,173.81V62.32h-38.25v111.49h38.25ZM713.65,193.61h-10.19v-75.16h-28.64v72.66h-10V46.94h10v61.32h28.64v-62.28h10.19v147.63Z" fill="%23fff"/><path d="M819.46,171.6c6.6-1.35,12.08-3.11,16.44-5.29v10.19c-4.23,2.31-9.64,4.1-16.24,5.38-6.6,1.28-13.3,1.92-20.09,1.92h-57.28V51.36h10.57v122.25h46.71c6.66,0,13.29-.67,19.89-2.02ZM851.47,193.8V45.98h10.57v147.63l-10.57.19Z" fill="%23fff"/><path d="M935.66,113.64l48.44,62.28-8.27,6.34-43.06-56.13c-4.36,16.66-10.38,29.92-18.07,39.79-7.69,9.87-16.72,15.83-27.1,17.88v-10.76c8.71-2.05,16.21-8.07,22.49-18.07,6.28-10,11.05-22.97,14.32-38.92,3.27-15.95,5.03-33.86,5.29-53.73h-39.21v-10h88.61v10h-39.02c-.13,18.84-1.6,35.95-4.42,51.32ZM1015.43,193.61h-10.38v-79.39h-37.87v-10.19h37.87v-58.05h10.38v147.63Z" fill="%23fff"/></g><g id="symbol"><g opacity=".5"><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23fff"/></g><path d="M140,30h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84-3.88-7.1-6.08-15.25-6.08-23.92v-80c0-16.57,13.43-30,30-30h80c8.66,0,16.81,2.21,23.92,6.08-8.48-15.54-24.97-26.08-43.92-26.08Z" fill="%23fff"/><path d="M183.92,56.08c3.88,7.1,6.08,15.25,6.08,23.92v80c0,16.57-13.43,30-30,30h-80c-8.66,0-16.81-2.21-23.92-6.08,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%23fff"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></g></svg>',Gl='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Symbol_IHAB_white" xmlns="http://www.w3.org/2000/svg" width="240" height="240" viewBox="0 0 240 240"><path id="symbol" d="M190.71,49.29c-18.1-18.1-43.1-29.29-70.71-29.29s-34.94,28.87-53.03,46.97h0c-18.1,18.1-46.97,25.56-46.97,53.03s11.19,52.61,29.29,70.71c18.1,18.1,43.1,29.29,70.71,29.29s52.61-11.19,70.71-29.29c18.1-18.1,29.29-43.1,29.29-70.71s-11.19-52.61-29.29-70.71ZM155.36,155.36c-9.05,9.05-21.55,14.64-35.36,14.64s-26.31-5.6-35.36-14.64c-9.05-9.05-14.64-21.55-14.64-35.36s5.6-26.31,14.64-35.36c9.05-9.05,21.55-14.64,35.36-14.64s26.31,5.6,35.36,14.64c9.05,9.05,14.64,21.55,14.64,35.36s-5.6,26.31-14.64,35.36Z" fill="%23fff"/></svg>';const Zn={text:"--pass-card-text",sub:"--pass-card-sub",copyright:"--pass-card-copyright"},No=new WeakMap;function x2(e){if(e)return No.get(e)}function An(e,t){e&&(e.style.setProperty(Zn.text,t.text),e.style.setProperty(Zn.sub,t.sub),t.copyrightColor&&e.style.setProperty(Zn.copyright,t.copyrightColor),No.set(e,t))}function Nn(e){e&&(e.style.removeProperty(Zn.text),e.style.removeProperty(Zn.sub),e.style.removeProperty(Zn.copyright),No.delete(e))}const Kl={text:"var(--color-pureBlack)",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"#1a1a1a"};function Yl(e={}){const t=kt(Kl,An,Nn);return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-two-circle","aria-hidden":"true",children:[n.jsx("div",{className:"pass-card-bg-two-circle__c1"}),n.jsx("div",{className:"pass-card-bg-two-circle__c3"}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-two-circle__symbol",style:{"--symbol-url":`url("${Gl}")`}})]})}const Zl="M190.71,49.29c-18.1-18.1-43.1-29.29-70.71-29.29s-34.94,28.87-53.03,46.97h0c-18.1,18.1-46.97,25.56-46.97,53.03s11.19,52.61,29.29,70.71c18.1,18.1,43.1,29.29,70.71,29.29s52.61-11.19,70.71-29.29c18.1-18.1,29.29-43.1,29.29-70.71s-11.19-52.61-29.29-70.71Z",ua=240;var $a='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="a" xmlns="http://www.w3.org/2000/svg" width="240" height="240" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 240 240"><defs><linearGradient id="b" x1="62.99" y1="62.99" x2="190.71" y2="190.71" gradientUnits="userSpaceOnUse"><stop offset=".2" stop-color="%23499cdf"/><stop offset=".8" stop-color="%234dcdc0"/></linearGradient></defs><path d="M190.71,49.29c-18.1-18.1-43.1-29.29-70.71-29.29s-34.94,28.87-53.03,46.97h0c-18.1,18.1-46.97,25.56-46.97,53.03s11.19,52.61,29.29,70.71c18.1,18.1,43.1,29.29,70.71,29.29s52.61-11.19,70.71-29.29c18.1-18.1,29.29-43.1,29.29-70.71s-11.19-52.61-29.29-70.71ZM155.36,155.36c-9.05,9.05-21.55,14.64-35.36,14.64s-26.31-5.6-35.36-14.64c-9.05-9.05-14.64-21.55-14.64-35.36s5.6-26.31,14.64-35.36c9.05-9.05,21.55-14.64,35.36-14.64s26.31,5.6,35.36,14.64c9.05,9.05,14.64,21.55,14.64,35.36s-5.6,26.31-14.64,35.36Z" fill="url(%23b)"/></svg>';const _2={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"var(--color-main)"},w2=100,B2=[{scale:1,opacity:.55},{scale:2,opacity:.4},{scale:3.1,opacity:.28},{scale:4.5,opacity:.18},{scale:6,opacity:.1}];function Xl(e={}){const t=kt(_2,An,Nn),a="var(--color-main)",r=270,i=170;return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-sound-move","aria-hidden":"true",children:[n.jsx("svg",{className:"pass-card-bg-sound-move__svg",viewBox:"0 0 300 189",preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",children:B2.map(({scale:s,opacity:l},u)=>n.jsx("g",{transform:`translate(${r} ${i}) scale(${s*w2/ua}) translate(${-ua/2} ${-ua/2})`,opacity:l,children:n.jsx("path",{d:Zl,fill:"none",stroke:a,strokeWidth:"1.5",vectorEffect:"non-scaling-stroke"})},u))}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-sound-move__symbol",style:{"--symbol-url":`url("${$a}")`}})]})}const k2={text:"#ffffff",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",logoColor:"_mono",copyrightColor:"#ffffff"},A2=100,N2=[{scale:1,opacity:.55},{scale:2,opacity:.4},{scale:3.1,opacity:.28},{scale:4.5,opacity:.18},{scale:6,opacity:.1}];function E2(e={}){const t=kt(k2,An,Nn),a="#ffffff",r=270,i=170;return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-sound-move-v1","aria-hidden":"true",children:[n.jsx("svg",{className:"pass-card-bg-sound-move-v1__svg",viewBox:"0 0 300 189",preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",children:N2.map(({scale:s,opacity:l},u)=>n.jsx("g",{transform:`translate(${r} ${i}) scale(${s*A2/ua}) translate(${-ua/2} ${-ua/2})`,opacity:l,children:n.jsx("path",{d:Zl,fill:"none",stroke:a,strokeWidth:"1.5",vectorEffect:"non-scaling-stroke"})},u))}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-sound-move-v1__symbol",style:{"--symbol-url":`url("${Gl}")`}})]})}const D2={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"var(--color-main)"};function S2(e={}){const t=kt(D2,An,Nn);return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-talk","aria-hidden":"true",children:[n.jsx("div",{className:"pass-card-bg-talk__shape pass-card-bg-talk__shape--left"}),n.jsx("div",{className:"pass-card-bg-talk__shape pass-card-bg-talk__shape--right"}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-talk__symbol",style:{"--symbol-url":`url("${$a}")`}})]})}const T2={Logo_SpeechEar_ko:{"":ir,_mono:y2},Logo_SpeechEarManager_ko:{"":Ao,_mono:v2}};function j2(e,t){if(e)return T2[e]?.[t??""]??void 0}const M2={speechear:ir,manager:Ao},L2={speechear:"Logo_SpeechEar_ko",manager:"Logo_SpeechEarManager_ko"},Jl=10;function $2(e){return e<=0?0:e>=86400?Math.floor(e/86400)*86400:e>=3600?Math.floor(e/3600)*3600:e>=60?Math.floor(e/60)*60:Math.floor(e)}function Ql(e,t){if(e<=0)return t("passCard.remainingSecond",{n:0});const a=Math.floor(e/86400);if(a>0)return t("passCard.remainingDay",{n:a});const r=Math.floor(e/3600);if(r>0)return t("passCard.remainingHour",{n:r});const i=Math.floor(e/60);return i>0?t("passCard.remainingMinute",{n:i}):t("passCard.remainingSecond",{n:Math.floor(e)})}function R2(e,t,a){if(e==="manager"){const r=/년/.test(t)||/yr|year/i.test(t)||/1년|365/.test(t),i=a==="\uC624\uD508\uD2B9\uAC00"||a===Rt.t("passCard.specialLabel");return r?n.jsx(S2,{}):i?n.jsx(E2,{}):n.jsx(Xl,{})}return n.jsx(Yl,{})}function eu({ariaLabel:e,product:t,showPrice:a=!1,plan:r,type:i,endDate:s,remainingSeconds:l,endInclusive:u=!1,state:c="active",bg:d,bgOnly:m=!1,textColor:p,subColor:f,copyrightColor:y,logoSrc:x,label:C,price:h,originalPrice:_,discountLabel:g,onUse:A,onRefund:b,onDelete:k}){const{t:v}=xe.useTranslation(),w=t?Ul(t):void 0,B=i??w?.type??"speechear",E=r??w?.plan??v("passCard.planSuffix","\uC774\uC6A9\uAD8C"),D=C??w?.label,N=h??(a?w?.price:void 0),O=_??(a?w?.originalPrice:void 0),P=g??w?.discountLabel,G=o.useMemo(()=>{if(N)return null;const Y=t?.durationDays??b2(t?.code);if(!Y||Y<=0)return l!=null?{percent:null,remainingLabel:Ql(l,v)}:null;const Q=Y*86400;let me;if(l!=null)me=l;else if((c==="active"||c==="expired")&&s){const te=new Date(s).getTime();if(Number.isNaN(te))return null;const ue=/^(\d{4})-(\d{2})-(\d{2})/.exec(String(s)),fe=/^(\d{4})-(\d{2})-(\d{2})/.exec(Ea()),ge=Math.round(ue&&fe?(Date.UTC(+ue[1],+ue[2]-1,+ue[3])-Date.UTC(+fe[1],+fe[2]-1,+fe[3]))/864e5:(te-Date.now())/864e5);me=Math.max(0,u?ge+1:ge)*86400}else c==="expired"?me=0:me=Q;const De=$2(me),be=Math.max(0,Math.min(100,Math.floor(Math.min(De,Q)/Q*100)));return c==="pending"&&be>=100?null:{percent:be,remainingLabel:c==="expired"?v("passCard.expired","\uB9CC\uB8CC\uB428"):Ql(me,v)}},[N,c,s,l,u,t?.durationDays,t?.code,v]),L=o.useRef(null),[M,$]=o.useState({}),[Z,q]=o.useState(null),z=!!(A||b||k),V=o.useRef(!1),R=o.useRef(void 0),[H,W]=o.useState(x);o.useLayoutEffect(()=>{W(x)},[x]),o.useLayoutEffect(()=>{const Y=L.current;Y&&(p!==void 0&&Y.style.setProperty("--pass-card-text",p),f!==void 0&&Y.style.setProperty("--pass-card-sub",f),y!==void 0&&Y.style.setProperty("--pass-card-copyright",y))},[p,f,y]),o.useLayoutEffect(()=>{const Y=L.current;if(!Y)return;const Q=x2(Y);if(!x){const me=L2[B],De=c==="expired"?"_mono":Q?.logoColor??"",be=j2(me,De);W(be)}},[d,x,B,c]);const I=Y=>{const Q=L.current;if(!Q)return null;const{left:me,top:De,width:be,height:te}=Q.getBoundingClientRect(),ue=(Y.clientX-me)/be-.5;return{rotateX:-((Y.clientY-De)/te-.5)*Jl,rotateY:ue*Jl}},S=(Y,Q)=>{const me=Q*-.7,De=Y*.7+10,be=20+(Math.abs(Y)+Math.abs(Q))*.4;return`${me}px ${De}px ${be}px rgba(0, 0, 0, 0.18)`},j=o.useCallback(Y=>{if(la())return;V.current=!0,clearTimeout(R.current),R.current=setTimeout(()=>{V.current=!1},200);const Q=I(Y);Q&&$({transform:`perspective(800px) rotateX(${Q.rotateX}deg) rotateY(${Q.rotateY}deg) scale3d(1.03, 1.03, 1.03)`,boxShadow:S(Q.rotateX,Q.rotateY),transition:"transform 0.25s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.25s cubic-bezier(0.23, 1, 0.32, 1)"})},[]),F=o.useCallback(Y=>{if(la())return;const Q=I(Y);if(!Q)return;const me=V.current?"transform 0.2s ease, box-shadow 0.2s ease":"none";$({transform:`perspective(800px) rotateX(${Q.rotateX}deg) rotateY(${Q.rotateY}deg) scale3d(1.03, 1.03, 1.03)`,boxShadow:S(Q.rotateX,Q.rotateY),transition:me})},[]),U=o.useCallback(()=>{clearTimeout(R.current),V.current=!1,$({transform:"perspective(800px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)",boxShadow:"0px 4px 16px rgba(0, 0, 0, 0.08)",transition:"transform 0.5s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.5s cubic-bezier(0.23, 1, 0.32, 1)"})},[]),re=o.useCallback(()=>q(null),[]),ne=o.useMemo(()=>{const Y=v("passCard.planSuffix","\uC774\uC6A9\uAD8C"),Q=E.replace("\uC774\uC6A9\uAD8C","").replace(Y==="\uC774\uC6A9\uAD8C"?"":Y,"").trim(),me=Q.match(/^(.*?)(일|년)$/);return me?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"h0 pass-card__plan-number",children:me[1]}),n.jsx("span",{className:"h5b pass-card__plan-unit",children:me[2]==="\uB144"?v("passCard.unitYear","\uB144"):v("passCard.unitDay","\uC77C")})]}):n.jsx("span",{className:"h0",children:Q})},[E,v]),le=o.useMemo(()=>{const Y=oa(N);if(!Y)return null;const Q=Y.match(/^([^\d]*)([\d.,]+)(.*)$/);if(!Q)return n.jsx("span",{className:"h1",children:Y});const[,me,De,be]=Q;return n.jsxs(n.Fragment,{children:[me&&n.jsx("span",{className:"h5 pass-card__price-symbol",children:me}),n.jsx("span",{className:"h1 pass-card__price-amount",children:De}),be.trim()&&n.jsx("span",{className:"h5 pass-card__price-symbol",children:be.trim()})]})},[N]),K=o.useCallback(()=>{z&&q(Y=>{if(Y)return null;const Q=L.current?.getBoundingClientRect();if(!Q)return null;const me=50;return{left:Q.left,right:Q.right,width:Q.width,height:Q.height,x:Q.x,y:Q.y+me,top:Q.top+me,bottom:Q.bottom+me}})},[z]),oe=o.useCallback(Y=>{z&&(Y.key==="Enter"||Y.key===" ")&&(Y.preventDefault(),K())},[z,K]),Ae=[{items:[...A?[{label:v("passCard.menu.use","\uC0AC\uC6A9\uD558\uAE30"),icon:"play",onClick:()=>{A(),q(null)},closeOnSelect:!0}]:[],...b?[{label:v("passCard.menu.refund","\uD658\uBD88\uD558\uAE30"),icon:"rotate-ccw",onClick:()=>{b(),q(null)},closeOnSelect:!0}]:[],...k?[{label:v("passCard.menu.delete","\uC0AD\uC81C\uD558\uAE30"),icon:"trash-2",onClick:()=>{k(),q(null)},closeOnSelect:!0}]:[]]}];return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"pass-card-frame",children:n.jsxs("div",{ref:L,className:`pass-card pass-card--${c}${z?" pass-card--clickable":""}`,style:M,onMouseEnter:j,onMouseMove:F,onMouseLeave:U,onPointerUp:Y=>{Y.pointerType==="touch"&&U()},onPointerCancel:Y=>{Y.pointerType==="touch"&&U()},onClick:K,onKeyDown:z?oe:void 0,role:z?"button":void 0,tabIndex:z?0:void 0,"aria-label":e,"aria-haspopup":z?"menu":void 0,"aria-expanded":z?!!Z:void 0,children:[d??R2(B,E,D),!m&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"pass-card__top",children:n.jsxs("div",{className:"pass-card__top-left",children:[n.jsx("img",{src:H??M2[B],className:"pass-card__logo",alt:B==="manager"?v("header.logoManager","\uB9D0\uADC0\uB9E4\uB2C8\uC800 \uB85C\uACE0"):v("header.logoMalgwi","\uB9D0\uADC0 \uB85C\uACE0")}),n.jsxs("div",{className:"pass-card__plan",children:[n.jsx("div",{children:ne}),n.jsx("span",{className:"h5b pass-card__plan-suffix",children:D?v("passCard.labeledPlan",{label:D}):v("passCard.planSuffix","\uC774\uC6A9\uAD8C")})]})]})}),N?n.jsxs("div",{className:"pass-card__price-area",children:[P&&n.jsx("span",{className:"pass-card__discount body-3",children:P}),n.jsxs("div",{className:"pass-card__price",children:[O&&n.jsx("span",{className:"pass-card__price-original body-3",children:oa(O)}),le]})]}):G?n.jsxs("div",{className:"pass-card__usage",children:[n.jsx("span",{className:"h5b pass-card__usage-remaining",children:G.remainingLabel}),G.percent!=null&&n.jsxs("span",{className:"pass-card__usage-percent",children:[n.jsx("span",{className:"h1 pass-card__usage-value",children:G.percent}),n.jsx("span",{className:"h5b pass-card__usage-symbol",children:"%"})]})]}):n.jsx("div",{className:"pass-card__copyright caption-2","aria-hidden":"true",children:"\xA9 IHAB Corp. All rights reserved."})]})]})}),Z&&n.jsx(cn,{anchorRect:Z,onClose:re,ariaLabel:v("tooltip.menu","\uBA54\uB274"),children:n.jsx(La,{columns:Ae,onClose:re,size:"small"})})]})}const P2={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"#1a1a1a"};function I2(e={}){const t=`passcard-sound-line-grad-${o.useId()}`,a=kt(P2,An,Nn);return n.jsxs("div",{ref:a,className:"pass-card-bg pass-card-bg-sound-line","aria-hidden":"true",children:[n.jsxs("svg",{className:"pass-card-bg-sound-line__svg",viewBox:"0 0 500 300",preserveAspectRatio:"xMidYMid slice",xmlns:"http://www.w3.org/2000/svg",children:[n.jsx("defs",{children:n.jsxs("linearGradient",{id:t,x1:"0",y1:"0",x2:"1",y2:"0",children:[n.jsx("stop",{offset:"20%",stopColor:"var(--color-main)"}),n.jsx("stop",{offset:"80%",stopColor:"var(--color-sub)"})]})}),n.jsx("g",{transform:"translate(25, 45)",children:n.jsx("path",{d:"M -30 150 C 40 80, 100 220, 160 150 S 280 80, 340 150 S 460 220, 510 150",fill:"none",stroke:`url(#${t})`,strokeWidth:"50",strokeLinecap:"round"})})]}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-sound-line__symbol",style:{"--symbol-url":`url("${$a}")`}})]})}const F2={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"var(--color-main)"};function O2(e={}){const t=kt(F2,An,Nn);return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-talk-v1","aria-hidden":"true",children:[n.jsx("div",{className:"pass-card-bg-talk-v1__shape pass-card-bg-talk-v1__shape--left"}),n.jsx("div",{className:"pass-card-bg-talk-v1__shape pass-card-bg-talk-v1__shape--right"}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-talk-v1__symbol",style:{"--symbol-url":`url("${$a}")`}})]})}function z2(e,t){if(e){if(t==="manager_pro")return n.jsx(O2,{});if(t==="manager_standard")return n.jsx(I2,{});if(t==="manager_lite")return n.jsx(Xl,{})}}function W2(e){const t=oa(e);if(!t)return null;const a=t.match(/^([^\d]*)([\d.,]+)(.*)$/);if(!a)return t;const[,r,i,s]=a;return n.jsxs(n.Fragment,{children:[r&&n.jsx("span",{className:"payment-plan__pricing-symbol h4",children:r}),i,s.trim()&&n.jsx("span",{className:"payment-plan__pricing-symbol h4",children:s.trim()})]})}function H2(e){const{t}=xe.useTranslation(),a=t("payment.plan.tierFallback",{defaultValue:"\uC774\uC6A9\uAD8C"}),r=t("payment.plan.openPromo",{defaultValue:"\uC624\uD508 \uD2B9\uAC00"}),{plan:i,onSelect:s,period:l="monthly",ownedCodes:u}=e||{},c=b=>!!b&&!!u?.includes(b),d=b=>b.onceOnly??/오픈\s*특가/.test(b.label??""),m=(i.tiers||[]).some(b=>d(b)&&c(b.code)),p=b=>{const k=b.prices?b.prices[l]:b.price;return k?(i.tiers||[]).some(v=>!!v.badge&&v.originals?.[l]===k):!1},f=i.colorToken?`var(--color-${i.colorToken})`:"var(--color-gray)",y=t("payment.plan.freePrice","\uBB34\uB8CC"),x=t("payment.products.mgrEnterprise.tier.price","\uBB38\uC758"),C=b=>b.prices?b.prices[l]:b.price,h=(i.tiers||[]).length>0&&(i.tiers||[]).every(b=>{const k=C(b);return k==="\uBB34\uB8CC"||k===y||k==="0\uC6D0"||typeof k=="string"&&/\d/.test(k)&&!/[1-9]/.test(k)}),_=(i.tiers||[]).length>0&&(i.tiers||[]).every(b=>{const k=C(b);return k==="\uBB38\uC758"||k===x}),g=i.group==="org",A=g?"manager":"speechear";return n.jsxs("div",{className:"payment-plan__card",style:{borderColor:f,"--plan-color":f},children:[i.cardBadge&&n.jsx("div",{className:"payment-plan__card-badge",children:n.jsx(At,{label:i.cardBadge,variant:"main",size:"medium",fill:"soft"})}),n.jsxs("div",{className:"payment-plan__title",children:[n.jsx("p",{className:"payment-plan__quote body-3b",style:{color:f},children:i.quote||"\xA0"}),n.jsx("h3",{className:"payment-plan__title-heading h1",children:i.tier??i.title}),n.jsx("p",{className:"payment-plan__subtitle body-3",children:i.subtitle})]}),n.jsxs("div",{className:"payment-plan__box",children:[n.jsx("span",{className:"payment-plan__box-title body-3b",children:t("payment.plan.recommendedFor","\uC774\uB7F0 \uBD84\uAED8 \uCD94\uCC9C\uD569\uB2C8\uB2E4.")}),n.jsx("ul",{className:"payment-plan__feature-list",children:(i.recommendedFor||[]).map((b,k)=>n.jsxs("li",{className:"payment-plan__feature-item body-3",children:[n.jsx(at,{icon:"check",size:18,className:"payment-plan__feature-check",wrapperStyle:{color:f}}),b]},k))})]}),n.jsxs("div",{className:"payment-plan__box",children:[n.jsx("span",{className:"payment-plan__box-title body-3b",children:t("payment.plan.features","\uD575\uC2EC \uAE30\uB2A5")}),n.jsx("ul",{className:"payment-plan__feature-list",children:(i.features||[]).map((b,k)=>n.jsxs("li",{className:"payment-plan__feature-item body-3",children:[n.jsx(at,{icon:"check",size:18,className:"payment-plan__feature-check",wrapperStyle:{color:f}}),b]},k))})]}),n.jsx("div",{className:"payment-plan__card-pricing",children:h?null:_?n.jsx(pe,{htmlType:"button",className:"payment-plan__contact-button",label:t("payment.plan.contact",{defaultValue:"\uBB38\uC758\uD558\uAE30"}),variant:"main",size:56,onClick:()=>i.tiers?.[0]&&s?.({...i.tiers[0],productId:i.id,productTitle:i.title})}):n.jsx(n.Fragment,{children:n.jsx("div",{className:"payment-plan__pricing-list",children:(i.tiers||[]).map(b=>{const k=b.label||a,v=d(b),w=v||b.openPromo===!0,B=k.replace(/^오픈\s*특가\s*/,"")||a,E=b.prices?b.prices[l]:b.price,D=b.badge?w?`${r}
|
|
852
|
+
${b.badge}`:b.badge:void 0;if(v&&c(b.code))return null;if(!b.badge&&!m)return p(b)?null:n.jsxs("div",{className:`payment-plan__pricing-row payment-plan__pricing-row--static${b.highlight?" payment-plan__pricing-row--highlight":""}`,children:[n.jsx("div",{className:"payment-plan__pricing-row-title",children:n.jsx("div",{className:"payment-plan__pricing-row-label h5b",children:b.label})}),n.jsx("div",{className:"payment-plan__pricing-row-price",children:n.jsx("span",{className:"payment-plan__pricing-current h1",children:W2(E)})})]},b.id);const N=i.tier??(g?i.title:void 0),O=n.jsx(eu,{showPrice:!0,product:{type:A,code:b.code,name:B,label:N,price:E,originalPrice:b.originals?.[l]??void 0,discountLabel:D},bg:z2(g,i.id)}),P=()=>s?.({...b,productId:i.id,productTitle:i.title,preview:O});return n.jsx("div",{className:"payment-plan__pricing-card",onClick:P,onKeyDown:s?G=>{G.target===G.currentTarget&&(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),P())}:void 0,role:s?"button":void 0,tabIndex:s?0:void 0,children:O},b.id)})})})})]})}function V2({variant:e="default"}){return n.jsxs("div",{className:`pass-card-bg pass-card-bg--${e}`,"aria-hidden":"true",children:[n.jsx("div",{className:"pass-card-bg__circle pass-card-bg__circle--1"}),n.jsx("div",{className:"pass-card-bg__circle pass-card-bg__circle--2"}),n.jsx("div",{className:"pass-card-bg__circle pass-card-bg__circle--3"})]})}var Eo='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Logo_IHAB_eng" xmlns="http://www.w3.org/2000/svg" width="765.08" height="240" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 765.08 240"><defs><linearGradient id="linear-gradient" x1="62.99" y1="62.99" x2="190.71" y2="190.71" gradientUnits="userSpaceOnUse"><stop offset=".2" stop-color="%23499cdf"/><stop offset=".8" stop-color="%234dcdc0"/></linearGradient></defs><path id="symbol" d="M190.71,49.29c-18.1-18.1-43.1-29.29-70.71-29.29s-34.94,28.87-53.03,46.97h0c-18.1,18.1-46.97,25.56-46.97,53.03s11.19,52.61,29.29,70.71c18.1,18.1,43.1,29.29,70.71,29.29s52.61-11.19,70.71-29.29c18.1-18.1,29.29-43.1,29.29-70.71s-11.19-52.61-29.29-70.71ZM155.36,155.36c-9.05,9.05-21.55,14.64-35.36,14.64s-26.31-5.6-35.36-14.64c-9.05-9.05-14.64-21.55-14.64-35.36s5.6-26.31,14.64-35.36c9.05-9.05,21.55-14.64,35.36-14.64s26.31,5.6,35.36,14.64c9.05,9.05,14.64,21.55,14.64,35.36s-5.6,26.31-14.64,35.36Z" fill="url(%23linear-gradient)"/><g id="text"><path d="M316.21,190.6h-36.74V50.61h36.74v139.99Z"/><path d="M335.16,50.61h36.74v55.11h51.63v-55.11h36.93v139.99h-36.93v-55.11h-51.63v55.11h-36.74V50.61Z"/><path d="M473.99,190.6l46.6-139.99h50.08l46.41,139.99h-39.64l-8.31-27.46h-46.99l-8.31,27.46h-39.83ZM560.62,135.3l-14.5-46.99h-1.16l-14.31,46.99h29.97Z"/><path d="M631,50.61h59.94c31.9,0,48.73,13.73,48.73,35.19,0,15.47-11.02,27.26-26.88,30.55v1.35c17.6.58,32.29,13.54,32.29,33.45,0,22.82-18.56,39.45-49.11,39.45h-64.97V50.61ZM701.77,93.53c0-8.89-6.96-13.92-17.02-13.92h-17.02v27.84h16.44c10.25,0,17.6-5.03,17.6-13.92ZM706.22,146.51c0-10.25-7.35-16.05-19.14-16.05h-19.34v30.55h18.76c13.15,0,19.72-5.03,19.72-14.5Z"/></g></svg>';const tu={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"#c9c9c9"};function q2(){const e=kt(tu,An,Nn);return n.jsx("div",{ref:e,className:"pass-card-bg pass-card-bg-ihab","aria-hidden":"true",children:n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-ihab__symbol-top",style:{"--symbol-url":`url("${Eo}")`}})})}const nu={text:"#ffffff",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEarManager_ko",logoColor:"_mono",copyrightColor:"#ffffff"};function U2(e={}){const t=kt(nu,An,Nn);return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-left-color-grid","aria-hidden":"true",children:[n.jsx("div",{className:"pass-card-bg-left-color-grid__bar"}),n.jsx("div",{className:"pass-card-bg-left-color-grid__grid"}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-left-color-grid__symbol",style:{"--symbol-url":`url("${$a}")`}})]})}function au({keys:e,anchor:t="top-right",scale:a,className:r=""}){const i=Array.isArray(e)?e:[e];return n.jsx("span",{className:_e("shortcut-badge",`shortcut-badge--${t}`,r),style:a===void 0?void 0:{"--shortcut-badge-scale":String(a)},children:i.map((s,l)=>n.jsxs("span",{className:"shortcut-badge__group",children:[l>0&&n.jsx("span",{className:"shortcut-badge__plus",children:"+"}),n.jsx("kbd",{className:"shortcut-badge__key",children:s})]},`${s}-${l}`))})}const Ra=(e,t,a)=>e+(t-e)*a;function G2({speakers:e,size:t=300,viewT:a=0,activeSpeakerId:r=null,playedIds:i,selectedId:s=null,answerId:l=null,showFeedback:u=!1,pulseSelected:c=!1,pulseSelectedDuration:d,pulseScale:m,clickable:p=!1,onSelectSpeaker:f,buttonSize:y=40,showIcon:x=!0,onCenterClick:C,centerLabel:h,centerDisabled:_=!1,centerAttention:g=!1,shortcutAnchor:A="top-right",shortcutScale:b,scaleShortcut:k=!1}){const{t:v}=xe.useTranslation(),w=Math.max(0,Math.min(1,a)),B=t/2,E=110/300,D=.18,N=Y=>t*(E+(Y-1)*D),O=Y=>{const Q=N(Y.row??1),me=Y.angleDeg*Math.PI/180;return{x:B+Q*Math.cos(me),y:B+Q*Math.sin(me)}},P=Math.max(...e.map(Y=>Y.row??1),1),G=t*.08,L=t*.1,M=t*.24,$=t-2*G,Z=t-L-M,q=t-M/2,z=o.useMemo(()=>[...new Set(e.map(Y=>Y.deg))].sort((Y,Q)=>Y-Q),[e]),V=z.length,R=Math.max(68,V>1?$/(V-1):0),H=o.useMemo(()=>new Map(z.map((Y,Q)=>[Y,Q])),[z]),W=Y=>{const Q=H.get(Y.deg)??0,me=B+(Q-(V-1)/2)*R,De=P>1?Math.min(68,Z/(P-1)):0,be=De*(P-1),te=L+(Z-be)/2,ue=P===1?L+Z*.4:te+(P-(Y.row??1))*De;return{x:me,y:ue}},I=Y=>{const Q=O(Y),me=W(Y);return{x:Ra(Q.x,me.x,w),y:Ra(Q.y,me.y,w)}},S={x:B,y:Ra(B,q,w)},j=Math.round(y*1.2),F=Math.round(Math.max(16,Math.min(80,y*.7))),U=[],re=new Map;for(const Y of e){const Q=Y.row??1;re.has(Q)||re.set(Q,[]),re.get(Q).push(Y)}for(const[Y,Q]of re.entries()){if(Q.length<2)continue;const me=[...Q].sort((qe,mt)=>qe.deg-mt.deg),De=me.map(qe=>I(qe)),be=me.map(qe=>qe.deg),te=be[be.length-1]-be[0],ue=te/(be.length-1),fe=360-te,ge=me.length>=3&&ue>0&&fe<=ue*1.5,Ce=Math.round(N(Y)*1e3)/1e3,$e=(qe,mt,ct,rt)=>{const ft=(mt.angleDeg-qe.angleDeg+540)%360-180;if(ft===0)return`L ${rt.x} ${rt.y}`;if(w===0)return`A ${Ce} ${Ce} 0 0 ${ft>0?1:0} ${rt.x} ${rt.y}`;const ke=(qe.angleDeg+ft/2)*Math.PI/180,Ve={x:B+Ce*Math.cos(ke),y:B+Ce*Math.sin(ke)},we={x:(ct.x+rt.x)/2,y:(ct.y+rt.y)/2},Ue={x:Ra(Ve.x,we.x,w),y:Ra(Ve.y,we.y,w)},Be={x:2*Ue.x-we.x,y:2*Ue.y-we.y};return`Q ${Be.x} ${Be.y} ${rt.x} ${rt.y}`},He=ge?[...me,me[0]]:me,Te=ge?[...De,De[0]]:De;let Ie=`M ${Te[0].x} ${Te[0].y}`;for(let qe=1;qe<Te.length;qe++)Ie+=" "+$e(He[qe-1],He[qe],Te[qe-1],Te[qe]);U.push({key:`arc-${Y}`,d:Ie})}const ne=o.useMemo(()=>new Set(i??[]),[i]),le=Y=>({idle:"",active:v("soundCompass.state.active","\uC18C\uB9AC \uB098\uB294 \uC911"),played:v("soundCompass.state.played","\uB4E4\uC74C"),correct:v("soundCompass.state.correct","\uC815\uB2F5"),wrong:v("soundCompass.state.wrong","\uC624\uB2F5")})[Y],K=Y=>{if(r===Y.id)return"active";if(u){if(Y.id===l)return"correct";if(Y.id===s&&s!==l)return"wrong"}return ne.has(Y.id)?"played":"idle"},oe=Y=>r===Y.id?"loop":u?Y.id===l?"loop":null:c&&Y.id===s?"once":null,Ae=(Y,Q)=>{switch(Y){case"played":case"correct":return n.jsx(Ts,{size:Q});case"wrong":return n.jsx(zs,{size:Q});default:return n.jsx(Os,{size:Q})}};return n.jsx("div",{className:"sound-compass",children:n.jsxs("div",{className:"sound-compass__compass-wrap",style:{width:t,height:t},children:[n.jsxs("svg",{width:t,height:t,viewBox:`0 0 ${t} ${t}`,className:"sound-compass__svg",children:[w===0&&e.map(Y=>{const{x:Q,y:me}=I(Y);return n.jsx("line",{x1:S.x,y1:S.y,x2:Q,y2:me,stroke:"#dde3ec",strokeWidth:"1"},Y.id)}),U.map(Y=>n.jsx("path",{d:Y.d,fill:"none",stroke:"#dde3ec",strokeWidth:"1"},Y.key))]}),g&&!_&&n.jsx("div",{className:"sound-compass__pulse sound-compass__pulse--active sound-compass__pulse--center",style:{width:j,height:j,left:S.x-j/2,top:S.y-j/2}}),C?n.jsx("button",{type:"button",className:`sound-compass__center sound-compass__center--button${_?" sound-compass__center--disabled":""}`,style:{width:j,height:j,left:S.x,top:S.y},"aria-label":h,"aria-disabled":_||void 0,tabIndex:_?-1:0,onClick:_?void 0:C,children:n.jsx($r,{size:F,color:"currentColor",strokeWidth:1.5})}):n.jsx("div",{className:"sound-compass__center",style:{width:j,height:j,left:S.x,top:S.y},children:n.jsx($r,{size:F,color:"currentColor",strokeWidth:1.5})}),e.map((Y,Q)=>{const{x:me,y:De}=I(Y),be=K(Y),te=oe(Y),ue={...b!==void 0||k?{"--shortcut-badge-scale":String(b??Math.max(.75,Math.min(3,y/56)))}:null,pointerEvents:p?"auto":"none",cursor:p?"pointer":"default",zIndex:be!=="idle"?10:1},fe=y,ge=Math.round(Math.max(10,Math.min(56,fe*.38))),Ce=Math.round(Math.max(7,Math.min(18,fe*.2))),$e=Math.round(Math.max(10,Math.min(56,fe*.4))),He=x==="answered"&&(be==="played"||be==="correct"||be==="wrong"),Te=x===!0||He,Ie=!He;return n.jsxs("div",{className:"sound-compass__speaker-pos",style:{...ue,left:me-fe/2,top:De-fe/2},children:[te&&n.jsx("div",{className:`sound-compass__pulse sound-compass__pulse--${be}`+(te==="once"?" sound-compass__pulse--once":""),style:{width:fe,height:fe,...te==="once"&&d!==void 0?{"--sc-pulse-duration-once":`${d}ms`}:null,...m!==void 0?{"--sc-pulse-scale":String(m)}:null}}),n.jsxs("button",{type:"button",tabIndex:p?0:-1,"aria-disabled":p?void 0:!0,onClick:p?()=>f?.(Y.id):void 0,className:`sound-compass__speaker-btn sound-compass__speaker-btn--${be}`,style:{width:fe,height:fe},"aria-label":le(be)?`${Y.label}, ${le(be)}`:Y.label,"aria-pressed":s!=null?Y.id===s:void 0,children:[Te&&Ae(be,ge),Ie&&n.jsx("span",{className:"sound-compass__speaker-number",style:{fontSize:x===!0?Ce:$e},children:Q+1})]}),Y.shortcut&&n.jsx(au,{keys:Y.shortcut,anchor:A,className:"sound-compass__speaker-shortcut"})]},Y.id)})]})})}function K2({children:e,position:t="top-left",size:a=24,className:r=""}){return n.jsx("span",{className:_e("circle-badge","circle-badge--number",`circle-badge--${a}`,`circle-badge--${t}`,r),children:e})}function Y2({orientation:e="horizontal",label:t,className:a=""}){const r=_e("divider",`divider--${e}`,t&&e==="horizontal"?"divider--labeled":"",a);return e==="vertical"?n.jsx("div",{className:r,role:"separator","aria-orientation":"vertical"}):t?n.jsxs("div",{className:r,role:"separator","aria-orientation":"horizontal",children:[n.jsx("span",{className:"divider__line"}),n.jsx("span",{className:"divider__label caption-1",children:t}),n.jsx("span",{className:"divider__line"})]}):n.jsx("div",{className:r,role:"separator","aria-orientation":"horizontal"})}function ru({checked:e,onChange:t,name:a,value:r,disabled:i=!1,label:s,className:l=""}){const u=o.useId();return n.jsxs("label",{className:`radio${i?" radio--disabled":""} ${l}`.trim(),htmlFor:u,children:[n.jsx("input",{id:u,type:"radio",name:a,value:r,checked:e,disabled:i,onChange:c=>t?.(c.target.checked)}),n.jsx("span",{className:"radio__dot"}),s&&n.jsx("span",{className:"radio__label body-2",children:s})]})}function Z2({options:e,value:t,onChange:a,name:r,disabled:i=!1,direction:s="vertical",className:l="",ariaLabel:u}){const c=o.useId(),d=r??`radio-group-${c}`;return n.jsx("div",{className:`radio-group radio-group--${s} ${l}`.trim(),role:"radiogroup","aria-label":u,children:e.map(m=>n.jsx(ru,{name:d,value:m.value,checked:t===m.value,disabled:i||m.disabled,label:m.label,onChange:p=>{p&&a?.(m.value)}},m.value))})}const X2={info:"info",success:"check-circle",warning:"alert-triangle",danger:"alert-circle"};function J2({tone:e="info",title:t,message:a,children:r,dismissible:i=!1,onDismiss:s,live:l,className:u=""}){const{t:c}=xe.useTranslation(),[d,m]=o.useState(!1),p=o.useRef(null),f=o.useCallback(()=>{const g=p.current;g&&g.contains(document.activeElement)&&ar(g),m(!0),s?.()},[s]);if(d)return null;const y=_e("alert",`alert--${e}`,u),x=l??(e==="danger"||e==="warning"?"assertive":"polite"),C=x==="assertive"?"alert":x==="polite"?"status":void 0,h=!!t,_=!!(a||r);return n.jsxs("div",{ref:p,className:y,role:C,children:[n.jsxs("div",{className:"alert__body",children:[n.jsxs("div",{className:"alert__header",children:[n.jsx(at,{icon:X2[e],size:20,className:"alert__icon"}),h&&n.jsx("span",{className:"alert__title body-2",children:t}),!h&&_&&n.jsx("div",{className:"alert__message body-3",children:a||r})]}),h&&_&&n.jsx("div",{className:"alert__message alert__message--indented body-3",children:a||r})]}),i&&n.jsx("button",{type:"button",className:"alert__dismiss",onClick:f,"aria-label":c("common.close","\uB2EB\uAE30"),children:"\xD7"})]})}const Q2={ready:"search",guide:"info",error:"circle-alert"};function ev(e,t){const a=t.filter(Boolean);if(a.length===0)return e;const r=[];let i=0,s=0;for(const l of a){const u=e.indexOf(l,i);u<0||(u>i&&r.push(e.slice(i,u)),r.push(n.jsx("strong",{className:"search-summary__em body-2",children:l},s++)),i=u+l.length)}return i<e.length&&r.push(e.slice(i)),r}function tv({status:e="guide",label:t,children:a,emphasis:r,icon:i,className:s=""}){const l=i===!1?null:i??Q2[e],u=_e("search-summary",`search-summary--${e}`,s),c=t??a,d=typeof c=="string"&&r&&r.length>0?ev(c,r):c;return n.jsxs("div",{className:u,role:"status","aria-live":"polite",children:[l!=null&&n.jsx(at,{icon:l,size:18,className:"search-summary__icon"}),n.jsx("span",{className:"search-summary__text body-2",children:d})]})}function Pa({title:e,items:t}){const{t:a}=xe.useTranslation(),{anchorRect:r,openAt:i,close:s}=Ta(),l=o.useRef(null),u=fo(!!r,(c,d)=>{c&&d?i(l.current?.querySelector("button")??d):s()},l);return n.jsxs("span",{ref:l,style:{display:"contents"},children:[n.jsx(pe,{htmlType:"button",size:24,type:"dot",icon:"info",variant:"transparent-gray",useBorder:!1,selected:!!r,ariaLabel:a("common.info","\uC124\uBA85"),onPointerEnter:c=>{ia(c)||i(c.currentTarget)},onPointerLeave:c=>{ia(c)||s()},onClick:c=>{u.touchPress(c.currentTarget)},onFocus:c=>{la()||i(c.currentTarget)},onBlur:s}),r&&n.jsx(Kn,{title:e,items:t,showIndex:t.length>1,anchorRect:r,onClose:s})]})}function nv({items:e=[],value:t,onChange:a,className:r="",size:i=40}){const s=o.useId(),{t:l}=xe.useTranslation(),u=o.useRef(null),c=e.find(C=>!C.disabled)?.key,d=e.some(C=>C.key===t)?t:c??e[0]?.key,m=e.find(C=>C.key===d&&!C.disabled)?.key??c,p=()=>Array.from(u.current?.querySelectorAll('[role="tab"]:not(:disabled)')??[]),f=(C,h=p())=>{if(h.length===0)return;const _=(C%h.length+h.length)%h.length;h[_]?.focus(),h[_]?.click()},y=C=>{if(!["ArrowRight","ArrowDown","ArrowLeft","ArrowUp","Home","End"].includes(C.key))return;C.preventDefault();const h=p(),_=h.indexOf(C.currentTarget);C.key==="ArrowRight"||C.key==="ArrowDown"?f(_+1,h):C.key==="ArrowLeft"||C.key==="ArrowUp"?f(_-1,h):C.key==="Home"?f(0,h):f(h.length-1,h)},x=e.find(C=>C.key===d);return n.jsxs("div",{className:`tabs ${r}`.trim(),children:[n.jsx("div",{ref:u,className:`tabs__list tabs__list--${i}`,role:"tablist","aria-label":l("tabs.ariaLabel","\uD0ED"),children:e.map(C=>n.jsx("button",{id:`tabs__tab-${s}-${C.key}`,type:"button",role:"tab","aria-selected":C.key===d,"aria-controls":`tabs__panel-${s}-${C.key}`,disabled:C.disabled,tabIndex:C.key===m?0:-1,className:`tabs__tab body-2${C.key===d?" tabs__tab--active":""}`,onClick:()=>{C.key!==t&&a?.(C.key)},onKeyDown:y,children:C.label},C.key))}),x&&n.jsx("div",{id:`tabs__panel-${s}-${x.key}`,role:"tabpanel","aria-labelledby":`tabs__tab-${s}-${x.key}`,tabIndex:0,className:"tabs__panel",children:x.panel},x.key)]})}const av={xs:12,sm:16,md:20,lg:28,xl:36};function rv(e){const t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"":t.length===1?[...t[0]].slice(0,2).join("").toUpperCase():([...t[0]][0]+[...t[t.length-1]][0]).toUpperCase()}function ov({src:e,name:t,size:a="md",shape:r="circle",className:i=""}){const{t:s}=xe.useTranslation(),[l,u]=o.useState(null),c=!!e&&l===e,d=t?rv(t):"",m=!!e&&!c,p=!m&&!!d,f=t||s("avatar.ariaLabel","\uC0AC\uC6A9\uC790 \uC544\uBC14\uD0C0");return n.jsxs("span",{className:`avatar avatar--${a} avatar--${r} ${i}`.trim(),role:"img","aria-label":f,children:[m&&n.jsx("img",{className:"avatar__image",src:e,alt:f,onError:()=>u(e??null)}),!m&&p&&n.jsx("span",{className:"avatar__initials","aria-hidden":"true",children:d}),!m&&!p&&n.jsx(at,{icon:"user-round",size:av[a],className:"avatar__icon"})]})}function sv(e,t){if(!t)return!0;const a=t.split(",").map(s=>s.trim()).filter(Boolean);if(a.length===0)return!0;const r=e.name.toLowerCase(),i=e.type.toLowerCase();return a.some(s=>{const l=s.toLowerCase();return l.startsWith(".")?r.endsWith(l):l.endsWith("/*")?i.startsWith(l.slice(0,-1)):i===l})}function iv({onFilesSelected:e,accept:t,multiple:a=!1,disabled:r=!1,showFileList:i=!0,files:s,onRemove:l,className:u=""}){const{t:c}=xe.useTranslation(),d=o.useRef(null),[m,p]=o.useState(!1),[f,y]=o.useState([]),x=s??f,C=v=>{if(!v||v.length===0)return;const w=Array.from(v).filter(E=>sv(E,t));if(w.length===0)return;const B=a?w:w.slice(0,1);if(s===void 0){const E=a?[...x,...B]:B;y(E),e?.(E)}else e?.(B)},h=v=>{v.preventDefault(),!r&&p(!0)},_=v=>{v.preventDefault(),p(!1)},g=v=>{v.preventDefault(),p(!1),!r&&C(v.dataTransfer.files)},A=v=>{const w=v.target;try{C(w.files)}finally{w.value=""}},b=()=>{r||d.current?.click()},k=v=>{if(!r&&(l?.(v),s===void 0)){const w=x.filter((B,E)=>E!==v);y(w),l||e?.(w)}};return n.jsxs("div",{className:`file-upload ${u}`.trim(),children:[n.jsxs("div",{className:_e("file-upload__dropzone",m&&"file-upload__dropzone--dragging",r&&"file-upload__dropzone--disabled"),role:"button",tabIndex:r?-1:0,"aria-disabled":r,onClick:b,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),b())},onDragOver:h,onDragLeave:_,onDrop:g,children:[n.jsx(at,{icon:"upload",size:24,className:"file-upload__icon"}),n.jsx("span",{className:"file-upload__prompt body-2",children:c("fileUpload.dragPrompt","\uD30C\uC77C\uC744 \uC774\uACF3\uC5D0 \uB4DC\uB798\uADF8\uD558\uC5EC \uC5C5\uB85C\uB4DC")}),n.jsx("button",{type:"button",className:"file-upload__browse-button body-3",disabled:r,onClick:v=>{v.stopPropagation(),b()},children:c("fileUpload.browseButton","\uD30C\uC77C \uC120\uD0DD")}),n.jsx("input",{ref:d,type:"file",className:"file-upload__input",accept:t,multiple:a,disabled:r,onChange:A,tabIndex:-1})]}),i&&x.length>0&&n.jsx("ul",{className:"file-upload__list",children:x.map((v,w)=>n.jsxs("li",{className:"file-upload__list-item body-3",children:[n.jsx("span",{className:"file-upload__file-name body-3",children:v.name}),n.jsx("button",{type:"button",className:"file-upload__remove-button","aria-label":c("fileUpload.removeAriaLabel",{name:v.name}),disabled:r,onClick:()=>k(w),children:n.jsx(at,{icon:"x",size:14})})]},`${v.name}-${w}`))})]})}function lv({items:e,className:t=""}){const{t:a}=xe.useTranslation();return n.jsx("nav",{className:`breadcrumb ${t}`.trim(),"aria-label":a("breadcrumb.ariaLabel","\uC774\uB3D9 \uACBD\uB85C"),children:n.jsx("ol",{className:"breadcrumb__list",children:e.map((r,i)=>{const s=i===e.length-1;return n.jsxs("li",{className:"breadcrumb__item",children:[s?n.jsx("span",{className:"breadcrumb__current body-3","aria-current":"page",children:r.label}):r.href?n.jsx("a",{className:"breadcrumb__link body-3",href:r.href,target:r.target,rel:r.rel??(r.target==="_blank"?"noopener noreferrer":void 0),onClick:r.onClick,children:r.label}):r.onClick?n.jsx("button",{type:"button",className:"breadcrumb__link body-3",onClick:r.onClick,children:r.label}):n.jsx("span",{className:"breadcrumb__text body-3",children:r.label}),!s&&n.jsx(at,{icon:"chevron-right",size:14,className:"breadcrumb__separator"})]},i)})})})}const uv={small:14,medium:20,large:28};function cv({value:e,onChange:t,max:a=5,readOnly:r=!1,size:i="medium",ariaLabel:s,className:l=""}){const{t:u}=xe.useTranslation(),c=r||!t,[d,m]=o.useState(null),p=c?e:Number.isFinite(e)?Math.round(e):0,f=d??p,y=uv[i],x=v=>{v!==e&&t?.(v)},C=v=>{c||x(v)},h=v=>{c||la()||m(v)},_=o.useRef(null),g=v=>{const w=Math.min(a,Math.max(1,v));x(w),Array.from(_.current?.querySelectorAll("[data-star]")??[]).find(B=>B.dataset.star===String(w))?.focus()},A=v=>{if(!c){switch(v.key){case"ArrowRight":case"ArrowUp":g((p||0)+1);break;case"ArrowLeft":case"ArrowDown":g((p||1)-1);break;case"Home":g(1);break;case"End":g(a);break;default:return}v.preventDefault()}},b=p>=1&&p<=a?Math.round(p):1,k=()=>{c||m(null)};return n.jsx("div",{className:`rating rating--${i}${c?" rating--readOnly":""} ${l}`.trim(),ref:_,onKeyDown:A,role:c?"img":"radiogroup","aria-label":c?u("rating.valueLabel",{value:e,max:a}):s??u("rating.groupLabel","\uBCC4\uC810"),onMouseLeave:k,onPointerUp:v=>{v.pointerType==="touch"&&k()},onPointerCancel:v=>{v.pointerType==="touch"&&k()},children:Array.from({length:a},(v,w)=>{const B=w+1,E=Math.max(0,Math.min(1,f-w)),D=E>0&&E<1,N=n.jsxs("span",{className:"rating__star-wrap",children:[n.jsx(at,{icon:"star",size:y,className:"rating__star rating__star--empty"}),E>0&&n.jsx("span",{className:`rating__star-fill${D?" rating__star-fill--half":""}`,style:D?{width:`${E*100}%`}:void 0,children:n.jsx(at,{icon:"star",size:y,className:"rating__star rating__star--filled"})})]});return c?n.jsx("span",{className:"rating__item","aria-hidden":"true",children:N},B):n.jsx("button",{type:"button",className:"rating__item rating__item--interactive",role:"radio","aria-checked":p===B,"aria-label":u("rating.starLabel",{n:B}),"data-star":B,tabIndex:B===b?0:-1,onClick:()=>C(B),onMouseEnter:()=>h(B),children:N},B)})})}const dv=20,pv=["#499cdf","#4dcdc0","#2fae9e","#e6b94e","#d9534f","#e06b68","#bfc7d1"];function mv({value:e,onChange:t,palette:a=pv,size:r=40,className:i="",ariaLabel:s}){const{t:l}=xe.useTranslation();return n.jsx("div",{className:`color-picker ${i}`.trim(),role:"group","aria-label":s,children:a.map(u=>{const c=e?.toLowerCase()===u.toLowerCase();return n.jsx("button",{type:"button",className:`color-picker__swatch color-picker__swatch--${r}`,style:{backgroundColor:u},onClick:()=>t(u),"aria-pressed":c,"aria-label":c?`${u} ${l("colorPicker.selected","\uC120\uD0DD\uB428")}`:u,children:c&&n.jsx(at,{icon:"check",size:dv,className:"color-picker__check"})},u)})})}function ou({icon:e,label:t,tooltip:a,wrapperStyle:r,color:i,bgColor:s,useHover:l=!0,iconSize:u="medium"}){const{t:c}=xe.useTranslation(),d=u==="small",m=_e("category-icon",d?"category-icon--small":""),p=d?16:20,f=o.useRef(null),[y,x]=o.useState(!1),C=o.useMemo(()=>{const B=r&&typeof r=="object"?{...r}:{};return!i&&!s?B:{...B,...i?{color:i,"--t-item-fg":i}:{},...s?{"--t-item-bg":s}:{}}},[r,i,s]),h=a||t,_=l&&!!h,[g,A]=o.useState(null);o.useLayoutEffect(()=>{y&&A(f.current?.getBoundingClientRect()??null)},[y]),o.useEffect(()=>{if(!l&&y)try{x(!1)}catch{}},[l,y]),o.useEffect(()=>{if(!y)return;const B=E=>{const D=f.current;if(!D)return;const N=E.target;N&&!D.contains(N)&&x(!1)};return document.addEventListener("pointerdown",B,!0),()=>document.removeEventListener("pointerdown",B,!0)},[y]);const b=o.useCallback(()=>{l&&x(!0)},[l]),k=o.useCallback(()=>{l&&x(!1)},[l]),v=o.useCallback(()=>x(!1),[]),w=o.useCallback(B=>{if(B.key==="Escape"){x(!1);return}(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),x(E=>!E))},[]);return n.jsxs("span",{ref:f,className:_e("category-icon__wrap",_&&"category-icon__wrap--interactive"),onPointerEnter:b,onPointerLeave:k,onFocus:b,onBlur:k,onKeyDown:w,role:"button",tabIndex:0,"aria-label":typeof h=="string"?c("common.descriptionFor",{name:h,defaultValue:`${h} \uC124\uBA85`}):void 0,"aria-haspopup":!!h,"aria-expanded":y,"data-tooltip-ignore":!0,children:[n.jsx(at,{icon:e,label:t,className:m,imgClassName:"category-icon__image",maskClassName:"category-icon__mask",svgClassName:"category-icon__svg",wrapperStyle:C,size:p}),y&&h&&n.jsx(Bn,{anchorRect:g,text:typeof h=="string"?h:void 0,offset:8,onClose:v,className:"category-icon__tooltip",ariaLabel:typeof h=="string"?h:void 0})]})}let In=null;function lr(e){if(In&&In!==e)try{In()}catch{}return In=e,()=>{In===e&&(In=null)}}function ur(e){if(In===e){In=null;try{e()}catch{}}}function cr(e,t){let a=()=>{};const r=new Promise(u=>{a=u});if(typeof e!="string"||e.trim()===""){St("one-shot-empty-url","[core] playOneShot \uC5D0 \uBE48 \uC8FC\uC18C\uAC00 \uC654\uB2E4 \u2014 \uC548 \uD2BC\uB2E4. \uBD80\uB974\uB294 \uCABD\uC774 \uC8FC\uC18C\uB97C \uC5BB\uAE30 \uC804\uC5D0 \uBD88\uB800\uB2E4.",new Error("playOneShot(empty)").stack),a(!1);try{t?.(!1)}catch{}return{el:{},stop:()=>{},done:r}}let i=!1;const s=u=>{if(!i){i=!0;try{t?.(u)}catch{}a(u)}};let l;try{l=new Audio(e)}catch{return s(!1),{el:{},stop:()=>{},done:r}}l.onended=()=>s(!0),l.onerror=()=>s(!1);try{l.play().catch(()=>s(!1))}catch{s(!1)}return{el:l,stop:()=>{try{l.pause()}catch{}s(!1)},done:r}}function hv(e,t){if(!e)return{previewCodes:[],previewBucket:null};const a=e,r=l=>l.map(u=>u?.contextCode||u?.context_code).filter(Boolean).map(String);if(t==="LISTEN_IN_NOISE"){const l=a.sentences||a.items||[],u=Array.isArray(l)&&l.length>0?r(l):[];return u.length===0&&(a.contextCode||a.context_code)&&u.push(String(a.contextCode||a.context_code)),{previewCodes:u,previewBucket:"LIN_D"}}if(t==="SHORT_STORY"){const l=a.items||a.sentences||[],u=Array.isArray(l)&&l.length>0?r(l):[];return u.length===0&&(a.contextCode||a.context_code)&&u.push(String(a.contextCode||a.context_code)),{previewCodes:u,previewBucket:"SHORT_S"}}if(t==="LONG_STORY"){const l=a.items||a.sentences||[],u=Array.isArray(l)&&l.length>0?r(l):[];return u.length===0&&(a.contextCode||a.context_code)&&u.push(String(a.contextCode||a.context_code)),{previewCodes:u,previewBucket:"LONG"}}if(t==="ORDERING_SENTENCE"){const l=a.sentences||a.items||[],u=Array.isArray(l)&&l.length>0?r(l):[];return u.length===0&&(a.contextCode||a.context_code)&&u.push(String(a.contextCode||a.context_code)),{previewCodes:u,previewBucket:"LIN_D"}}const i=a.sentences||a.items||[],s=r(Array.isArray(i)?i:[]);return s.length===0&&(a.contextCode||a.context_code)&&s.push(String(a.contextCode||a.context_code)),{previewCodes:s,previewBucket:null}}function fv(e,t){const[a,r]=o.useState(!1),[i,s]=o.useState(-1),[l,u]=o.useState({key:"",urls:[]}),c=o.useRef(null),d=o.useRef(!1),m=o.useRef(null),p=o.useRef(null),[f,y]=o.useState(!1),x=o.useRef([]),{previewCodes:C,previewBucket:h}=hv(e,t),_=`${C.join(",")}|${h??""}`,g=o.useMemo(()=>l.key===_?l.urls:[],[l,_]);o.useEffect(()=>{if(!C.length)return;let b=!1;return(async()=>{const k=[],v=[];for(const w of C)try{const B=fi(w,h);if(!B){k.push("");continue}let E=null;try{E=await Ci(B)}catch{}if(!E)try{const D=await gi(B);D&&(E=URL.createObjectURL(D),v.push(E))}catch{}k.push(E??"")}catch{k.push("")}b?v.forEach(w=>{try{URL.revokeObjectURL(w)}catch{}}):(x.current.forEach(w=>{try{URL.revokeObjectURL(w)}catch{}}),x.current=v,u({key:_,urls:k}))})(),()=>{b=!0}},[C.join(","),h]),o.useEffect(()=>()=>{x.current.forEach(b=>{try{URL.revokeObjectURL(b)}catch{}}),x.current=[]},[]);const A=o.useCallback(async b=>{if(b.stopPropagation(),b.preventDefault(),d.current){m.current&&ur(m.current),d.current=!1;try{c.current?.pause()}catch{}r(!1),s(-1);return}if(!g.filter(Boolean).length)return;let k=null;const v=()=>{d.current=!1,k?.stop()};m.current=v;const w=lr(v);d.current=!0,r(!0);for(let B=0;B<g.length&&d.current;B++){const E=g[B];if(E&&(s(B),k=cr(E),c.current=k.el,!await k.done))break}w(),m.current===v&&(m.current=null,d.current=!1,r(!1),s(-1))},[g]);return o.useEffect(()=>()=>{m.current&&ur(m.current),d.current=!1;try{c.current?.pause()}catch{}c.current=null},[]),{playing:a,playingIndex:i,previewUrls:g,previewHover:f,setPreviewHover:y,previewBtnRef:p,handlePreview:A}}const Cv=e=>{if(!e)return[];const t=typeof e.context=="string"&&e.context.trim()||typeof e.sentence=="string"&&e.sentence.trim()||typeof e.text=="string"&&e.text.trim()||"";if(t)return[String(t)];const a=e.sentences||e.items||e.questions||[];return Array.isArray(a)&&a.length>0?a.map(r=>{if(typeof r=="string")return r;if(r&&typeof r=="object"){const i=r;return i.sentence||i.text||i.context||i.question||i.title||""}return""}).filter(r=>typeof r=="string"&&r.trim().length>0).map(r=>r.trim()):[]};function Do(e){const{index:t,type:a,trainingData:r,ariaLabel:i,depth:s,renderPopup:l,completed:u,completedIds:c,selectedIds:d,tooltipText:m,useDescriptionTooltip:p=!1,onRemove:f,hideCheckBadge:y=!1,showTypeLabel:x=!1,onComplete:C,onSelect:h,onMore:_,countLabelOverride:g,size:A="square"}=e||{},{t:b}=xe.useTranslation(),[k,v]=o.useState(!1),w=o.useRef(null),[B,E]=o.useState(!1);o.useEffect(()=>{w.current?.matches(":hover")&&E(!0)},[]);const{playing:D,playingIndex:N,previewUrls:O,previewHover:P,setPreviewHover:G,previewBtnRef:L,handlePreview:M}=fv(r,a?.key),$=o.useCallback(()=>{h?h():v(!0)},[h]),Z=o.useCallback(()=>v(!1),[]),q=o.useCallback(()=>E(!0),[]),z=o.useCallback(()=>E(!1),[]),V=o.useCallback(()=>G(!0),[G]),R=o.useCallback(()=>G(!1),[G]),[H,W]=o.useState(null);o.useLayoutEffect(()=>{P&&W(L.current?.getBoundingClientRect()??null)},[P,L]);const[I,S]=o.useState(null);o.useLayoutEffect(()=>{B&&!k&&p&&S(w.current?.getBoundingClientRect()??null)},[B,k,p]);const j=o.useCallback(we=>{we.target===we.currentTarget&&(we.key==="Enter"||we.key===" ")&&(we.preventDefault(),$())},[$]),F=r||null,U=o.useMemo(()=>{if(!p)return null;const we=m?(Array.isArray(m)?m:[m]).filter(Boolean):null,Ue=we&&we.length>0?we:Cv(F);return Ue&&Ue.length>0?Ue:null},[p,m,F]),re=o.useCallback(we=>{we.stopPropagation(),f?.()},[f]),ne=o.useCallback(we=>we.stopPropagation(),[]),le=o.useCallback(we=>{typeof C=="function"&&C(we)},[C]),K=u||(c&&r?.id!=null?c.has(String(r.id)):!1),oe=!K&&(d!=null&&r?.id!=null?d.has(String(r.id)):!1);Nl("speechear.popup.close",Z);const Ae=Ii(),Y=`${a?.label||""} ${t+1}`,Q=F?.title||F?.name||Y;let me=a?.icon,De,be="",te="";try{const we=F?.category_0||F?.category_main_code||F?.category_main,Ue=F?.category_1||F?.category_sub_code||F?.category_sub,Be=Ae.find(je=>je.key===we);Be?.icon&&(me=Be.icon),!De&&Be?.color&&(De={"--t-item-fg":Be.color}),!De&&F?.iconColor&&(De={"--t-item-fg":F.iconColor}),be=Be?b(`topic.${Be.key}`,{defaultValue:Be.label||""}):"";try{const je=Be?.subs?.find(Se=>Se.key===Ue);te=je?b(`topic.sub.${je.key}`,{defaultValue:je.label||""}):""}catch{}}catch{}const ue=te?`${be} / ${te}`:be||a?.label||Q,fe=we=>b("training.countQuestions",{n:we,count:we}),ge=we=>b("training.countSentences",{n:we,count:we});let Ce="";try{if(F)if(a?.key==="LISTEN_IN_NOISE"){let we=0;Array.isArray(F.items)&&F.items.length>0?we=F.items.length:Array.isArray(F.sentences)&&F.sentences.length>0?we=F.sentences.length:F.sentences&&(we=1),Ce=ge(we)}else if(a?.key==="SHORT_STORY"){let we=1;Array.isArray(r?.items)?we=r.items.length:Array.isArray(r?.raw&&r.raw?.items)?we=r.raw.items.length:Array.isArray(F?.questions)?we=F.questions.length:Array.isArray(F?.sentences)&&(we=F.sentences.length),Ce=fe(we)}else if(a?.key==="LONG_STORY"){let we=1;if(Array.isArray(F.items)&&F.items.length>0){const Ue=F.items.reduce((Be,je)=>{const Se=je.questionItems;return Array.isArray(Se)?Be+Se.length:Array.isArray(je.questions)?Be+je.questions.length:Be},0);we=Ue>0?Ue:F.items.length}else Array.isArray(F.questions)&&F.questions.length>0?we=F.questions.length:Array.isArray(F.sentences)&&F.sentences.length>0&&(we=F.sentences.length);Ce=fe(we)}else if(a?.key==="ORDERING_SENTENCE"){let we=1;Array.isArray(F.items)&&F.items.length>0?we=F.items.length:Array.isArray(F.sentences)&&F.sentences.length>0&&(we=F.sentences.length),Ce=ge(we)}else Array.isArray(F.items)&&(Ce=F.items.length>0?fe(F.items.length):"")}catch{}const $e=A==="row",He=A==="list"||$e,Te=A==="compact",Ie=A==="small",qe=Ie&&a?.key?TC().find(we=>we.key===a.key):void 0,mt=qe?Fi[qe.key]:void 0,ct=qe?mt?b(`trainingType.${mt}.title`,{defaultValue:qe.label}):qe.label??"":"",rt=x&&a?.label&&a.label!==String(Q)?String(a.label):Ie&&ct&&ct!==String(Q)?ct:"",ft=!!rt,ke=g!==void 0?g:Ce,Ve=[rt,typeof Q=="string"?Q:"",ke].map(we=>String(we??"").trim()).filter(Boolean).join(" ");return n.jsxs(n.Fragment,{children:[n.jsxs("div",{ref:w,className:`training-block-button${He?" training-block-button--list":""}${$e?" training-block-button--row":""}${Te?" training-block-button--compact":""}${Ie?" training-block-button--small":""}${K?" training-block-button--completed":""}${oe?" training-block-button--selected":""}${ft&&!Ie?" training-block-button--withType":""}${Ie&&!ft?" training-block-button--no-type-label":""}`,onClick:$,onPointerEnter:q,onPointerLeave:z,role:"button",tabIndex:0,onKeyDown:j,"aria-label":typeof i=="string"?i:Ve||void 0,title:!p&&m&&(Array.isArray(m)?m.filter(Boolean).join(`
|
|
853
|
+
`):m)||void 0,children:[n.jsxs("div",{className:"training-block-button__left",children:[x&&a?.label&&a.label!==String(Q)&&n.jsx("span",{className:"training-block-button__type-label caption-1",children:a.label}),Ie&&ct&&ct!==String(Q)&&n.jsx("span",{className:"training-block-button__type-label caption-2",children:ct}),n.jsx(ou,{icon:me,label:Q,tooltip:ue,wrapperStyle:De,iconSize:Ie||Te?"small":"medium"}),!y&&(K||oe)&&!(f&&B)&&n.jsx(At,{className:f?"training-block-button__check--removable":void 0,type:"dot",icon:"check",position:"top-left",size:"medium","aria-label":K?b("training.completed","\uD6C8\uB828 \uC644\uB8CC"):b("training.selected","\uC120\uD0DD\uB428")}),f&&n.jsx(At,{className:`training-block-button__remove${B?" is-hover":""}`,type:"dot",icon:"remove",position:"top-left",size:"medium","aria-label":b("common.remove","\uC81C\uAC70"),onClick:re}),n.jsx("div",{className:`training-block-button__title ${Te?"body-3":Ie?"body-3b":"h3"}`,children:String(Q)}),n.jsxs("div",{className:"training-block-button__description",children:[ke?n.jsx("div",{className:`training-block-button__count ${Ie?"caption-2":"caption-1"}`,children:ke}):null,n.jsx("div",{className:"training-block-button__chevron",children:n.jsx(at,{icon:"chevron-right",label:b("training.next","\uB2E4\uC74C"),className:"training-block-button__chevron-icon",imgClassName:"training-block-button__chevron-icon-image",maskClassName:"training-block-button__chevron-icon-mask",svgClassName:"training-block-button__chevron-icon-svg",size:Ie?12:20})})]}),(He&&!$e||Ie)&&O.length>0&&n.jsx("div",{ref:L,className:"training-block-button__preview","data-tooltip-ignore":!0,onClick:ne,onPointerEnter:V,onPointerLeave:R,children:n.jsx(pe,{htmlType:"button",size:Ie?28:32,type:"dot",icon:D?"pause":"play",variant:Ie?"transparent-lightGray":"default",useBorder:!1,selected:D,ariaLabel:String(Q).trim()?D?b("training.stopFor",{name:Q,defaultValue:`${Q} \uC815\uC9C0`}):b("training.previewFor",{name:Q,defaultValue:`${Q} \uBBF8\uB9AC \uB4E3\uAE30`}):D?b("training.stop","\uC815\uC9C0"):b("training.preview","\uBBF8\uB9AC \uB4E3\uAE30"),onClick:M})})]}),_&&n.jsx("div",{className:"training-block-button__more","data-tooltip-ignore":!0,onClick:we=>{we.stopPropagation(),_(we)},children:n.jsx(pe,{htmlType:"button",size:40,type:"dot",icon:"more-horizontal",variant:"transparent-lightGray",useBorder:!1,ariaLabel:String(Q).trim()?b("common.moreFor",{name:Q}):b("common.more","\uB354\uBCF4\uAE30")})})]}),P&&n.jsx(Bn,{anchorRect:H,text:D?b("training.stop","\uC815\uC9C0"):b("training.preview","\uBBF8\uB9AC \uB4E3\uAE30"),offset:8,onClose:R}),B&&!k&&p&&(U?n.jsx(Kn,{anchorRect:I,items:U,activeIndex:N,onClose:z}):F?.subTitle?n.jsx(Bn,{anchorRect:I,text:F.subTitle,offset:8,onClose:z}):null),k&&l&&l({trainingData:F,typeKey:a?.key??"",onClose:Z,onComplete:le,popupTitle:String(Q),popupSubTitle:a?.subTitle,depth:s!=null?String(s):void 0,popupIcon:me,popupIconTooltip:String(ue),popupWrapperStyle:De})]})}const su=200;function gv(e){return e.itemId?(RC()[e.trainingType]??[]).find(t=>t?.id!=null&&String(t.id)===String(e.itemId))??null:null}function iu({plan:e,groups:t,anchorRect:a,offset:r=12,onClose:i}){const{t:s}=xe.useTranslation(),l=o.useMemo(()=>t?t.map((c,d)=>({key:c.key??c.type?.key??String(d),label:c.label,type:c.type,data:c.items??[]})).filter(c=>c.data.length>0):IC(s).map(c=>{const d=(e?.items??[]).filter(m=>m.trainingType===c.key);return{key:c.key,label:c.label,type:c,pickedCount:d.length,data:d.map(gv).filter(m=>m!=null)}}).filter(c=>c.pickedCount>0),[t,e?.items,s]);if(l.length===0)return null;const u=n.jsx("div",{className:"tooltip-training__box",children:n.jsx("div",{className:"tooltip-training__groups",children:l.flatMap(({key:c,label:d,type:m,data:p},f)=>[f>0?n.jsx("div",{className:"tooltip-training__divider"},`div-${c}`):null,n.jsxs("div",{className:"tooltip-training__section",children:[n.jsx("div",{className:"tooltip-training__section-header",children:n.jsx("span",{className:"tooltip-training__type-label body-3b",children:d})}),n.jsx("div",{className:"tooltip-training__items",children:p.map((y,x)=>n.jsx(Do,{index:x,type:m,trainingData:y,size:"compact",hideCheckBadge:!0},String(y.id??x)))})]},c)])})});return a?n.jsx(cn,{anchorRect:a,offset:r,onClose:i,closeOnOutsideClick:!1,className:"tooltip-training",ariaLabel:s("tooltip.training","\uD6C8\uB828 \uC548\uB0B4"),children:u}):u}const bv=200;function yv({icon:e,count:t,title:a,plan:r,tooltip:i=!0,hoverAccent:s=!1,className:l="",onClick:u,onMouseEnter:c,onMouseLeave:d}){const m=!!u||!!c||i&&!!r,p=_e("count-tile",m&&"count-tile--interactive",m&&s&&"count-tile--accent",u&&"count-tile--clickable",l),f=o.useRef(null),[y,x]=o.useState(null),C=o.useRef(null),h=o.useRef(null),_=!!(y&&r&&i),g=o.useCallback(()=>{C.current&&(clearTimeout(C.current),C.current=null),h.current&&(clearTimeout(h.current),h.current=null)},[]),A=o.useCallback(()=>{g(),x(null)},[g]),b=o.useCallback(()=>{!i||!r||(g(),C.current=setTimeout(()=>{C.current=null,x(f.current?.getBoundingClientRect()??null)},su))},[i,r,g]),k=o.useCallback(()=>{C.current&&(clearTimeout(C.current),C.current=null),!h.current&&(h.current=setTimeout(()=>{h.current=null,x(null)},bv))},[]);return o.useEffect(()=>()=>{g()},[g]),o.useEffect(()=>{(!i||!r)&&A()},[i,r,A]),o.useEffect(()=>{if(!_)return;const v=B=>B instanceof Element&&(f.current?.contains(B)||!!B.closest(".tooltip-training")),w=B=>{v(B.target)?g():k()};return document.addEventListener("pointerover",w,!0),()=>document.removeEventListener("pointerover",w,!0)},[_,g,k]),n.jsxs(n.Fragment,{children:[n.jsxs("div",{ref:f,className:p,onClick:u?v=>{A(),u(v)}:void 0,onKeyDown:u?v=>{v.key!=="Enter"&&v.key!==" "||(v.preventDefault(),v.currentTarget.click())}:void 0,onPointerEnter:v=>{v.pointerType==="touch"||v.pointerType==="pen"?A():b()},onMouseEnter:c,onMouseLeave:v=>{k(),d?.(v)},role:u?"button":"img",tabIndex:u?0:void 0,"aria-label":`${a} ${t}`,children:[n.jsx(at,{icon:e,size:20,className:"count-tile__icon"}),n.jsx("span",{className:"count-tile__count h5","aria-hidden":"true",children:t})]}),y&&r&&n.jsx(iu,{plan:r,anchorRect:y,onClose:A})]})}let Ia=0,lu="",So="",Fa=0;function uu(){return cu(!1)}function vv(){return cu(!0)}function cu(e){const t=typeof document<"u";Ia===0&&t&&(lu=document.body.style.overflow,document.body.style.overflow="hidden"),e&&t&&(Fa===0&&(So=document.body.style.paddingRight),Fa++,document.body.style.paddingRight="0px"),Ia++;let a=!1;return()=>{a||(a=!0,Ia=Math.max(0,Ia-1),e&&t&&(Fa=Math.max(0,Fa-1),Fa===0&&(So?document.body.style.paddingRight=So:document.body.style.removeProperty("padding-right"))),Ia===0&&t&&(document.body.style.overflow=lu))}}function xv(){return n.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round","aria-hidden":!0,children:n.jsx("path",{d:"M6 6l12 12M18 6 6 18"})})}function _v({open:e,onClose:t,ariaLabel:a,title:r,children:i,size:s="md",closeOnBackdrop:l=!0,closeOnEscape:u=!0,showClose:c=!0,className:d,contentClassName:m}){const{t:p}=xe.useTranslation(),f=o.useId(),y=o.useRef(null),x=o.useCallback(()=>t(),[t]);o.useEffect(()=>{if(!e)return;const g=document.activeElement,A=uu(),b=y.current;return co(b,g),b?.focus(),()=>{A();const k=document.activeElement;(!k||k===document.body||b&&b.contains(k))&&po(g)?.focus?.()}},[e]);const C=o.useRef(x),h=o.useRef(u);o.useEffect(()=>{C.current=x,h.current=u}),o.useEffect(()=>{if(e)return Gn(()=>{h.current&&C.current()})},[e]);const _=o.useRef(!1);return lo(y,e),!e||typeof document>"u"?null:en.createPortal(n.jsx("div",{className:_e("dialog",d),onPointerDown:l?g=>{_.current=g.target===g.currentTarget}:void 0,onMouseDown:g=>{g.target===g.currentTarget&&g.preventDefault()},onClick:l?g=>{const A=_.current;_.current=!1,A&&g.target===g.currentTarget&&x()}:void 0,children:n.jsxs("div",{ref:y,role:"dialog","aria-modal":"true","aria-label":r?void 0:a,"aria-labelledby":r?f:void 0,tabIndex:-1,className:_e("dialog__surface",`dialog__surface--${s}`,m),onClick:g=>g.stopPropagation(),children:[r?n.jsx("div",{className:"dialog__header",children:n.jsx("h2",{id:f,className:"dialog__title h4b",children:r})}):null,c?n.jsx("button",{type:"button",className:"dialog__close","aria-label":p("common.close","\uB2EB\uAE30"),onClick:x,children:n.jsx(xv,{})}):null,n.jsx("div",{className:"dialog__body",children:i})]})}),document.body)}function wv({columns:e,rows:t,rowKey:a,title:r,toolbar:i,empty:s,loading:l,caption:u,className:c=""}){const{t:d}=xe.useTranslation(),m=!l&&t.length===0;return n.jsxs("div",{className:_e("board",c),children:[r||i?n.jsxs("div",{className:"board__head",children:[r?n.jsx("h2",{className:"board__title",children:r}):n.jsx("span",{}),i?n.jsx("div",{className:"board__toolbar",children:i}):null]}):null,n.jsxs("table",{className:"board__table",children:[u?n.jsx("caption",{className:"board__caption",children:u}):null,n.jsx("thead",{children:n.jsx("tr",{children:e.map(p=>n.jsx("th",{scope:"col",className:_e("board__th",`board__cell--${p.headerAlign??p.align??"left"}`),style:p.width?{width:p.width}:void 0,children:p.header},p.key))})}),n.jsx("tbody",{children:l?n.jsx("tr",{children:n.jsx("td",{className:"board__state",colSpan:e.length,children:l})}):m?n.jsx("tr",{children:n.jsx("td",{className:"board__state",colSpan:e.length,children:s??d("board.empty","\uB4F1\uB85D\uB41C \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.")})}):t.map((p,f)=>n.jsx("tr",{className:"board__row",children:e.map(y=>n.jsx("td",{className:_e("board__td",`board__cell--${y.align??"left"}`),children:y.render(p,f)},y.key))},a(p,f)))})]})]})}function Bv({name:e,role:t,photo:a,media:r,credentials:i,size:s=190,className:l=""}){return n.jsxs("div",{className:_e("person-card",l),children:[n.jsx("div",{className:"person-card__photo",style:{width:s,height:s},children:r??(a?n.jsx("img",{src:a,alt:t?`${e} ${t}`:e}):null)}),n.jsx("h3",{className:"person-card__name",children:e}),t?n.jsx("p",{className:"person-card__role",children:t}):null,i?.length?n.jsx("ul",{className:"person-card__credentials",children:i.map(u=>n.jsx("li",{children:u},u))}):null]})}function kv({groups:e,className:t=""}){return n.jsx("div",{className:_e("timeline",t),children:e.map(a=>n.jsxs("section",{className:"timeline__group",children:[n.jsx("h3",{className:"timeline__title",children:a.title}),n.jsx("ul",{className:"timeline__rows",children:a.entries.map((r,i)=>n.jsxs("li",{className:"timeline__row",children:[r.label?n.jsx("span",{className:"timeline__label",children:r.label}):null,n.jsx("div",{className:"timeline__items",children:r.items.map((s,l)=>n.jsx("p",{children:s},l))})]},`${r.label??""}-${i}`))})]},a.title))})}function Av({title:e,kind:t,body:a,badge:r,badgeSrc:i,footer:s,width:l,className:u=""}){const c=r??(i?n.jsx("img",{src:i,alt:""}):null);return n.jsxs("div",{className:_e("publication-card",u),style:l?{width:l,flexShrink:0}:void 0,children:[c?n.jsx("div",{className:"publication-card__badge","aria-hidden":"true",children:c}):null,n.jsx("h3",{className:"publication-card__title",children:e}),t?n.jsx("p",{className:"publication-card__kind",children:t}):null,n.jsx("p",{className:"publication-card__body",children:a}),s?n.jsx("div",{className:"publication-card__footer",children:s}):null]})}function Nv({logo:e,alt:t,onDone:a,durationMs:r=3e3}){const i=Da(a);return o.useEffect(()=>{const s=setTimeout(()=>i.current?.(),r);return()=>clearTimeout(s)},[r,i]),n.jsx("div",{className:"splash-logo",style:{"--splash-logo-duration":`${r}ms`},"aria-hidden":"true",children:n.jsx("img",{src:e,alt:t,className:"splash-logo__image"})})}function Ev({eyebrow:e,eyebrowIndex:t,title:a,description:r,level:i=2,tone:s="dark",className:l=""}){const u=i===1?"h1":"h2";return n.jsxs("div",{className:_e("section-header",`section-header--${s}`,l),children:[e?n.jsxs("p",{className:"section-header__eyebrow",children:[t?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"section-header__index",children:t}),n.jsx("span",{"aria-hidden":!0,className:"section-header__rule"})]}):null,e]}):null,a?n.jsx(u,{className:"section-header__title",children:a}):null,r?n.jsx("div",{className:"section-header__description",children:r}):null]})}function Dv({items:e,className:t=""}){return n.jsx("ul",{className:_e("company-meta",t),children:e.map((a,r)=>n.jsxs("li",{className:"company-meta__item",children:[r>0?n.jsx("span",{"aria-hidden":!0,className:"company-meta__divider",children:"|"}):null,a]},a))})}function du(e){return typeof e=="string"?e:e.label}function pu({value:e,onChange:t,suggestions:a,openOnFocus:r=!1,filterSuggestions:i,onSelectSuggestion:s,autoActiveFirst:l=!1}){const u=o.useId(),[c,d]=o.useState(!1),[m,p]=o.useState(-1),f=o.useRef(null),y=o.useMemo(()=>{if(!a.length)return[];const N=e??"";return i===!1?a:N?typeof i=="function"?i(a,N):a.filter(O=>du(O).toLowerCase().includes(N.toLowerCase())):r?a:[]},[a,e,r,i]),[x,C]=o.useState(!1),h=o.useRef([]),_=x&&y.length===0?h.current:y;o.useEffect(()=>{_.length&&(h.current=_)},[_]);const g=o.useCallback(()=>C(!0),[]),A=o.useCallback(()=>C(!1),[]),b=l?0:-1;o.useEffect(()=>{c||p(b)},[c,b]),o.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]);const k=m<_.length?m:b<_.length?b:-1,v=o.useCallback(N=>{s?s(N):t?.(du(N)),d(!1)},[t,s]),w=o.useCallback(()=>d(!0),[]),B=o.useCallback(()=>{d(!0),p(b)},[b]),E=o.useCallback(()=>{f.current=setTimeout(()=>d(!1),120)},[]),D=o.useCallback(N=>{N.nativeEvent.isComposing||N.keyCode===229||(N.key==="ArrowDown"?(N.preventDefault(),d(!0),p(O=>Math.min(_.length-1,(O<_.length?O:b)+1))):N.key==="ArrowUp"?(N.preventDefault(),p(O=>Math.max(b,(O<_.length?O:_.length)-1))):N.key==="Enter"?k>=0&&v(_[k]):N.key==="Escape"&&c&&(N.preventDefault(),d(!1)))},[_,k,c,v,b]);return{listId:u,open:c,activeIdx:k,filtered:_,handleFocus:w,handleBlur:E,handleInput:B,handleKeyDown:D,handleSelect:v,handleCompositionStart:g,handleCompositionEnd:A}}const To=typeof window<"u"?o.useLayoutEffect:o.useEffect;function Xn(e){const{value:t,defaultValue:a,name:r,inputRef:i,onChange:s,label:l,ariaLabel:u,ariaDescribedBy:c,required:d,placeholder:m,ghostText:p,ghostHint:f,type:y="text",disabled:x=!1,readOnly:C=!1,error:h,helperText:_,maxLength:g,size:A=48,variant:b="input",fullWidth:k=!1,newline:v=!1,multiline:w=!1,rows:B=3,leftIcon:E,rightIcon:D,clearable:N=!1,list:O,showCount:P=!0,className:G="",onFocus:L,onBlur:M,onKeyDown:$,onEnter:Z,inputMode:q,autoComplete:z,autoFocus:V,suggestions:R,filterSuggestions:H,onSelectSuggestion:W,autoActiveFirst:I,openOnFocus:S=!1}=e,j=C||x?void 0:R,{t:F}=xe.useTranslation(),U=o.useId();!l&&!u&&St(`TextField:unnamed:${U}`,"[ihab/TextField] \uC774\uB984\uC774 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 label \uC774\uB098 ariaLabel \uC911 \uD558\uB098\uB97C \uC8FC\uC138\uC694. placeholder \uB294 \uC774\uB984\uC744 \uB300\uC2E0\uD558\uC9C0 \uBABB\uD569\uB2C8\uB2E4.");const re=`tf-${U}`,ne=`tf-helper-${U}`,le=o.useRef(null),K=pu({value:t??"",onChange:s,suggestions:j??[],openOnFocus:S,filterSuggestions:H,onSelectSuggestion:W,autoActiveFirst:I}),oe=!!j&&K.open&&K.filtered.length>0,Ae=o.useRef(null),[Y,Q]=o.useState(null),me=o.useCallback(()=>{const ke=Ae.current;if(!ke||typeof window>"u")return;const Ve=ke.getBoundingClientRect(),we=230,Ue=window.innerHeight-Ve.bottom<we+8&&Ve.top>we+8;Q({position:"fixed",left:Ve.left,width:Ve.width,...Ue?{bottom:window.innerHeight-Ve.top+8}:{top:Ve.bottom+8},zIndex:ja(ke)})},[]);To(()=>{if(!oe)return;me();let ke=null;const Ve=()=>{if(typeof requestAnimationFrame>"u"){me();return}ke===null&&(ke=requestAnimationFrame(()=>{ke=null,me()}))},we=Ue=>{const Be=Ue.target;Be&&Be.nodeType===1&&Be.closest?.(".text-field__suggestions")||Ve()};return window.addEventListener("scroll",we,!0),window.addEventListener("resize",Ve),()=>{ke!==null&&cancelAnimationFrame(ke),window.removeEventListener("scroll",we,!0),window.removeEventListener("resize",Ve)}},[oe,me]);const De=o.useCallback(ke=>{le.current=ke,typeof i=="function"?i(ke):i&&(i.current=ke)},[i]),be=p?`${p}${f??F("wordTable.save.autoFillHint"," (Tab \uB610\uB294 space \uC785\uB825\uC2DC \uC790\uB3D9 \uC785\uB825)")}`:m,te=t!==void 0,ue=te&&y==="password",[fe,ge]=o.useState((a??"").length),Ce=te?(t??"").length:fe,$e=o.useRef(t);To(()=>{$e.current=t}),o.useEffect(()=>{const ke=le.current;if(!ue||!ke)return;const Ve=t??"";ke.value!==Ve&&(ke.value=Ve)},[ue,t]),o.useEffect(()=>{if(!v||!le.current)return;const ke=le.current;ke.style.height="",ke.scrollHeight>ke.clientHeight&&(ke.style.height=`${ke.scrollHeight}px`)},[t,fe,v]);const He=g!=null&&Ce>g,Te=A===32?16:20,Ie=_e("text-field",`text-field--s${A}`,b==="display"?"text-field--display":"",k?"text-field--full-width":"",x?"text-field--disabled":"",C?"text-field--readonly":"",h?"text-field--error":"",E?"text-field--has-left-icon":"",D||N?"text-field--has-right-icon":"",G),qe={id:re,...ue?{}:te?{value:t}:{defaultValue:a},ref:De,placeholder:be,name:r,disabled:x,readOnly:C,autoFocus:V,maxLength:g,list:O,inputMode:q,autoComplete:z,"aria-label":!l&&u?u:void 0,"aria-required":d,"aria-invalid":!!h,"aria-describedby":[_||h?ne:null,c].filter(Boolean).join(" ")||void 0,role:j?"combobox":void 0,"aria-autocomplete":j?"list":void 0,"aria-haspopup":j?"listbox":void 0,"aria-expanded":j?oe:void 0,"aria-controls":oe?K.listId:void 0,"aria-activedescendant":oe&&K.activeIdx>=0?`${K.listId}-option-${K.activeIdx}`:void 0,onChange:ke=>{const Ve=ke.target;te||ge(Ve.value.length),s?.(Ve.value),j&&K.handleInput(),ue&&queueMicrotask(()=>{const we=$e.current??"";Ve.value!==we&&(Ve.value=we)})},onCompositionStart:j?K.handleCompositionStart:void 0,onCompositionEnd:j?K.handleCompositionEnd:void 0,onFocus:(ke=>{L?.(ke),j&&K.handleFocus()}),onBlur:(ke=>{M?.(ke),j&&K.handleBlur()}),onKeyDown:(ke=>{const Ve=(ke.key==="Tab"&&!ke.shiftKey||ke.key===" ")&&!ke.nativeEvent.isComposing;if(p&&Ve&&!C&&!x&&!(ke.currentTarget.value??"").trim()){ke.preventDefault();const we=ke.currentTarget;te||(we.value=p,ge(p.length)),s?.(p);return}j&&ke.key==="Enter"&&!ke.nativeEvent.isComposing&&K.activeIdx>=0?ke.preventDefault():Z&&ke.key==="Enter"&&!ke.nativeEvent.isComposing&&(ke.preventDefault(),Z()),$?.(ke),j&&K.handleKeyDown(ke)})},mt=N&&!x&&!C&&Ce>0,ct=()=>v?n.jsx("textarea",{...qe,className:"text-field__input text-field__input--auto body-2",rows:1}):w?n.jsx("textarea",{...qe,className:"text-field__input text-field__input--textarea body-2",rows:B}):n.jsx("input",{...qe,type:y,className:"text-field__input body-2"}),rt=b==="display"&&!v&&!w&&!!be,ft=()=>n.jsxs(n.Fragment,{children:[ct(),rt&&n.jsx("span",{className:"text-field__placeholder","aria-hidden":"true",children:be})]});return n.jsxs("div",{ref:Ae,className:Ie,children:[l&&n.jsxs("label",{htmlFor:re,className:"text-field__label caption-1",children:[l,d&&n.jsx("span",{className:"text-field__required",children:"*"})]}),n.jsxs("div",{className:"text-field__wrap",children:[E&&n.jsx("span",{className:"text-field__icon text-field__icon--left",children:n.jsx(at,{icon:E,label:"",className:"",svgClassName:"text-field__icon-svg",size:Te})}),ft(),g!=null&&P&&n.jsxs("span",{className:`text-field__count caption-2${He?" text-field__count--over":""}`,children:[Ce,"/",g]}),mt&&n.jsx(pe,{size:24,type:"dot",icon:"x",variant:"transparent-gray",useBorder:!1,className:"text-field__clear",ariaLabel:F("textField.clearAriaLabel","\uC785\uB825\uAC12 \uC9C0\uC6B0\uAE30"),htmlType:"button",onMouseDown:ke=>{ke.preventDefault()},onClick:()=>{!te&&le.current&&(le.current.value="",ge(0)),s?.("")},tabIndex:-1}),D&&!mt&&n.jsx("span",{className:"text-field__icon text-field__icon--right",children:n.jsx(at,{icon:D,label:"",className:"",svgClassName:"text-field__icon-svg",size:Te})})]}),!!j&&n.jsx("span",{className:"text-field__status",role:"status","aria-live":"polite",children:K.open&&(t??"").length>0&&K.filtered.length===0?F("common.noMatches","\uB9DE\uB294 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"):""}),oe&&(typeof document>"u"?null:en.createPortal(n.jsx("ul",{id:K.listId,className:"text-field__suggestions",role:"listbox",style:Y??{position:"fixed",visibility:"hidden"},"data-tooltip-ignore":!0,children:K.filtered.map((ke,Ve)=>n.jsx("li",{id:`${K.listId}-option-${Ve}`,role:"option","aria-selected":Ve===K.activeIdx,className:`text-field__suggestion body-2${Ve===K.activeIdx?" is-active":""}`,onMouseDown:we=>we.preventDefault(),onClick:()=>{K.handleSelect(ke),le.current?.focus()},children:typeof ke=="string"?ke:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-field__suggestion-label",children:ke.label}),ke.hint&&n.jsx("span",{className:"text-field__suggestion-hint caption-1",children:ke.hint})]})},typeof ke=="string"?`${ke}-${Ve}`:ke.id))}),document.body)),(_||h)&&n.jsx("div",{className:"text-field__footer",children:n.jsx("span",{id:ne,className:"text-field__helper caption-1",role:h?"alert":void 0,children:h||_})})]})}function pn({options:e,value:t,onChange:a,placeholder:r,disabled:i=!1,block:s=!1,size:l=48,error:u=!1,className:c="",ariaLabel:d,ariaDescribedBy:m}){const{t:p}=xe.useTranslation(),f=r??p("dropdown.placeholder","\uC120\uD0DD"),y=o.useId(),x=o.useId(),C=o.useRef(null),h=o.useCallback((L,M)=>{const $=window.innerHeight-L.bottom<260&&L.top>260;return{position:"fixed",left:L.left,minWidth:L.width,...$?{bottom:window.innerHeight-L.top+6}:{top:L.bottom+6},zIndex:ja(M)}},[]),{open:_,setOpen:g,toggle:A,style:b,triggerRef:k,menuRef:v}=Ma({computeStyle:h}),[w,B]=o.useState(-1),E=o.useCallback(()=>B(-1),[]),D=e.find(L=>L.value===t);o.useEffect(()=>{if(_){const L=e.findIndex(M=>M.value===t);B(L>=0?L:e.length?0:-1),requestAnimationFrame(()=>{const M=v.current;if(!M)return;const $=M.querySelectorAll(".dropdown__option")[L];$&&(M.scrollTop=Math.max(0,$.offsetTop-M.clientHeight/2+$.clientHeight/2))})}},[_]),o.useEffect(()=>{_&&B(L=>{if(L>=0&&L<e.length)return L;const M=e.findIndex($=>$.value===t);return M>=0?M:e.length?0:-1})},[_,e.length]);const N=o.useCallback(()=>{i||A()},[i,A]),O=o.useCallback(L=>{L.disabled||i||(L.value!==t&&a?.(L.value),g(!1))},[a,g,i,t]);o.useEffect(()=>{i&&g(!1)},[i,g]);const P=o.useCallback(L=>{if(!i){if(!_){(L.key==="Enter"||L.key===" "||L.key==="ArrowDown")&&(L.preventDefault(),g(!0));return}if(L.key==="Escape"){L.preventDefault(),g(!1);return}L.key==="ArrowDown"?(L.preventDefault(),B(M=>{let $=M+1;for(;$<e.length&&e[$].disabled;)$++;return $<e.length?$:M})):L.key==="ArrowUp"?(L.preventDefault(),B(M=>{let $=M-1;for(;$>=0&&e[$].disabled;)$--;return $>=0?$:M})):(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),e[w]?O(e[w]):g(!1))}},[i,_,e,w,O,g]),G=_?n.jsx("div",{ref:v,id:y,className:"dropdown__menu","data-tooltip-ignore":!0,role:"listbox",style:b,onMouseLeave:E,onMouseDown:L=>L.preventDefault(),children:e.map((L,M)=>n.jsxs("button",{id:`${y}-option-${M}`,type:"button",role:"option","aria-selected":L.value===t,className:_e("dropdown__option body-2",L.value===t?"dropdown__option--active":"",M===w?"dropdown__option--active":"",L.disabled?"dropdown__option--disabled":""),onMouseDown:$=>$.preventDefault(),onClick:()=>O(L),onMouseEnter:()=>B(M),disabled:L.disabled,children:[n.jsx("span",{className:"dropdown__option-check",children:L.value===t&&n.jsx("svg",{viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"2 7 5.5 10.5 12 3.5"})})}),L.label]},L.value))}):null;return n.jsxs("div",{ref:C,className:_e("dropdown",`dropdown--s${l}`,_?"dropdown--open":"",s?"dropdown--block":"",u?"dropdown--error":"",c),onKeyDown:P,children:[n.jsxs("button",{ref:k,type:"button",className:"dropdown__trigger",role:"combobox","aria-haspopup":"listbox","aria-expanded":_,"aria-controls":_?y:void 0,"aria-activedescendant":_&&w>=0?`${y}-option-${w}`:void 0,"aria-label":d,"aria-describedby":[d&&D?x:"",m??""].filter(Boolean).join(" ")||void 0,"aria-invalid":u||void 0,disabled:i,onClick:N,onBlur:L=>{_&&!v.current?.contains(L.relatedTarget)&&g(!1)},children:[n.jsx("span",{id:x,className:`dropdown__trigger-label body-2${D?"":" dropdown__trigger-label--placeholder"}`,children:D?D.label:f}),n.jsx("svg",{className:"dropdown__chevron",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"4 6 8 10 12 6"})})]}),typeof document<"u"&&en.createPortal(G,C.current?.closest(".ihabdevteam-core-scope")??document.body)]})}function dr({page:e,totalPages:t,onChange:a,prevLabel:r,nextLabel:i,className:s=""}){const{t:l}=xe.useTranslation(),u=r??l("common.prevPage","\uC774\uC804 \uD398\uC774\uC9C0"),c=i??l("common.nextPage","\uB2E4\uC74C \uD398\uC774\uC9C0"),d=Math.max(1,t),m=()=>a(Math.max(1,Math.min(d,e-1))),p=()=>a(Math.min(d,e+1));return n.jsxs("div",{className:_e("pagination",s),children:[n.jsx(pe,{htmlType:"button",size:32,type:"dot",shape:"rounded",icon:"chevron-left",ariaLabel:u,disabled:e<=1,onClick:m}),n.jsxs("span",{className:"pagination__info body-3","aria-live":"polite","aria-atomic":"true",children:[Math.min(Math.max(1,e),d)," / ",d]}),n.jsx(pe,{htmlType:"button",size:32,type:"dot",shape:"rounded",icon:"chevron-right",ariaLabel:c,disabled:e>=t,onClick:p})]})}const Oa=new Map;function gn(e){const{t}=xe.useTranslation(),{options:a=[],value:r=a.find(b=>!b.disabled)?.key??a[0]?.key,onChange:i=b=>{},className:s="",size:l=40,shape:u="pill",useBG:c=!0,fullWidth:d=!1,minButtonWidth:m,ariaLabel:p}=e||{},f=o.useRef(null),y=a.filter(b=>!b.disabled),x=o.useId(),C=a.map(b=>b.key).join("\xB7");o.useEffect(()=>{if(!(!Ln||p!=null&&p!=="")){if(Oa.set(x,C||"(\uBCF4\uAE30 \uC5C6\uC74C)"),Oa.size>1){const b=[...Oa.values()].sort();St(`segmented-control-unnamed:${b.join("|")}`,`[ihab/SegmentedControl] \uC774\uB984 \uC5C6\uB294 \uB77C\uB514\uC624\uADF8\uB8F9\uC774 \uD55C \uD654\uBA74\uC5D0 ${Oa.size} \uAC1C \uC11C \uC788\uC2B5\uB2C8\uB2E4 \u2014 \uB0AD\uB3C5\uAE30\uB294 \uBAA8\uB450 "\uC120\uD0DD \uD0ED" \uC73C\uB85C \uC77D\uC5B4 \uC5B4\uB290 \uAC83\uC774 \uBB34\uC5C7\uC778\uC9C0 \uAC00\uB9B4 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. ariaLabel \uC744 \uC8FC\uC138\uC694. \uC9C0\uAE08 \uC120 \uAC83(\uBCF4\uAE30 \uC774\uB984\uC73C\uB85C \uC801\uC74C): ${b.join(" / ")}`)}return()=>{Oa.delete(x)}}},[p,C,x]);const h=b=>{if(!y.length)return;const k=Math.max(0,y.findIndex(w=>w.key===r)),v=b==="first"?y[0]:b==="last"?y[y.length-1]:y[(k+b+y.length)%y.length];v&&(i(v.key),Array.from(f.current?.querySelectorAll("[data-segkey]")??[]).find(w=>w.dataset.segkey===v.key)?.focus())},_=b=>{switch(b.key){case"ArrowRight":case"ArrowDown":h(1);break;case"ArrowLeft":case"ArrowUp":h(-1);break;case"Home":h("first");break;case"End":h("last");break;default:return}b.preventDefault()},g=b=>{const k=v=>typeof v=="string"||typeof v=="number";if(!(!k(b.label)||b.count==null||b.count===!1||!k(b.count)))return`${b.label}, ${b.count}`},A=y.some(b=>b.key===r)?r:y[0]?.key;return n.jsx("div",{ref:f,onKeyDown:_,className:_e("segmented-control",`segmented-control--${u}`,`segmented-control--${l}`,d&&"segmented-control--full",!c&&"segmented-control--no-bg",m!=null&&"segmented-control--min",s),style:m!=null?{"--segmented-min-button-w":`${m}px`}:void 0,role:"radiogroup","aria-label":p??t("segmentedControl.ariaLabel","\uC120\uD0DD \uD0ED"),children:a.map(b=>n.jsx(pe,{htmlType:"button",role:"radio","aria-checked":b.key===r,"data-segkey":b.key,tabIndex:b.key===A?0:-1,label:b.label,count:b.count,ariaLabel:g(b),disabled:b.disabled,className:b.key===r?"is-selected":"",onClick:()=>{b.disabled||i(b.key)},size:l,shape:u,useBorder:!1,useBG:!1},b.key))})}function jo({count:e,search:t,segment:a,filters:r,pageSize:i,pagination:s,actions:l,className:u}){const{t:c}=xe.useTranslation(),d=e!=null&&n.jsxs("p",{className:"toolbar__count body-1",role:"status","aria-atomic":"true",children:[e.prefix??c("common.totalPrefix","\uCD1D "),n.jsx("span",{className:"toolbar__count-highlight",children:e.value}),e.unit,e.suffix]}),m=!!(t||r?.length||i||s||l);return n.jsxs("div",{className:_e("toolbar",u),children:[n.jsxs("div",{className:"toolbar__row",children:[d,a&&(Array.isArray(a)?a:[a]).map((p,f)=>n.jsx(gn,{size:40,...p},p.ariaLabel??f))]}),m&&n.jsx("div",{className:"toolbar__row",children:n.jsxs("div",{className:"toolbar__row-end",children:[t&&n.jsx(Xn,{className:"toolbar__search",size:40,value:t.value,onChange:t.onChange,placeholder:t.placeholder??c("common.search","\uAC80\uC0C9"),ariaLabel:t.placeholder??c("common.search","\uAC80\uC0C9"),autoFocus:t.autoFocus,clearable:!0}),r?.map((p,f)=>n.jsx(pn,{size:40,options:p.options,value:p.value,onChange:p.onChange,ariaLabel:p.ariaLabel},f)),(i||s)&&n.jsxs("div",{className:"toolbar__pager",children:[i&&n.jsx(pn,{size:40,options:i.options,value:i.value,onChange:i.onChange,ariaLabel:i.ariaLabel??c("common.pageSizeSelect","\uD398\uC774\uC9C0\uB2F9 \uD45C\uC2DC \uAC1C\uC218")}),s&&n.jsx(dr,{page:s.page,totalPages:s.total,onChange:s.onChange,prevLabel:s.prevLabel,nextLabel:s.nextLabel})]}),l]})})]})}function mu(e){return typeof e=="string"?e:typeof e=="number"?String(e):Array.isArray(e)?e.map(mu).join(""):""}function Sv(e){let t=e.replace(/\r\n/g,`
|
|
854
854
|
`).replace(/\r/g,`
|
|
855
855
|
`);t=t.replace(/^\n+/,"").replace(/\n+$/,"");const a=t.split(`
|
|
856
856
|
`).map(s=>s.replace(/\t/g," ")),r=a.filter(s=>s.trim().length>0),i=r.length>0?Math.min(...r.map(s=>s.match(/^ */)?.[0].length??0)):0;return a.map(s=>s.slice(i)).join(`
|
|
857
|
-
`)}const
|
|
857
|
+
`)}const Tv=new Set(["pnpm","npm","yarn","node","git","curl","docker","cat","ls","cd","rm","mv","cp","echo","export"]),jv=/^(?:const|let|var|function|return|if|else|for|while|switch|case|break|import|from|export|class|new|try|catch|finally|throw|await|async|null|true|false|this|typeof|instanceof)\b/;function Mv(e,t){let a=e;const r=[],i=/^(?:sh|bash|zsh|shell|console)$/.test(t.toLowerCase()),s=(l,u)=>r.push({type:l,content:u});for(;a.length>0;){const l=a.match(/^\s+/);if(l){s("whitespace",l[0]),a=a.slice(l[0].length);continue}if(!i&&a.startsWith("//")){const x=a.indexOf(`
|
|
858
858
|
`),C=x===-1?a:a.slice(0,x);s("comment",C),a=a.slice(C.length);continue}if(i&&a.startsWith("#")){const x=a.indexOf(`
|
|
859
|
-
`),C=x===-1?a:a.slice(0,x);s("comment",C),a=a.slice(C.length);continue}const u=a.match(/^\/\*[\s\S]*?\*\//);if(u){s("comment",u[0]),a=a.slice(u[0].length);continue}const c=a.match(/^(`(?:\\.|[^`])*`|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*')/);if(c){s("string",c[0]),a=a.slice(c[0].length);continue}const d=a.match(/^\d+(?:\.\d+)?/);if(d){s("number",d[0]),a=a.slice(d[0].length);continue}const m=a.match(Tv);if(m){s("keyword",m[0]),a=a.slice(m[0].length);continue}const p=a.match(/^[A-Za-z_$][A-Za-z0-9_$-]*/);if(p){const x=p[0];s(i&&Sv.has(x)?"command":"identifier",x),a=a.slice(x.length);continue}const f=a.match(/^[=+\-*/%<>!&|^~?:]+/);if(f){s("operator",f[0]),a=a.slice(f[0].length);continue}const y=a.match(/^[()[\]{};.,]/);if(y){s("punctuation",y[0]),a=a.slice(1);continue}s("other",a[0]),a=a.slice(1)}return r}function Mv({children:e,language:t="bash",title:a="",showCopy:r=!0,size:i="default",className:s=""}){const{t:l}=xe.useTranslation(),[u,c]=o.useState(!1),d=Dv(mu(e)),m=o.useRef(null);o.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]);const p=async()=>{try{if(!await _C(d))return;c(!0),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>c(!1),2e3)}catch{}},f=jv(d,t),y=i==="small"?"caption-1":"body-3";return n.jsxs("div",{className:_e("code-box",i==="small"?"code-box--small":"",s),children:[(a||r)&&n.jsxs("div",{className:"code-box__header",role:"toolbar","aria-label":l("common.codeBlock","\uCF54\uB4DC \uBE14\uB85D"),children:[n.jsx("div",{className:"code-box__title caption-1",children:a}),r&&n.jsx(pe,{htmlType:"button",className:"code-box__copy",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:u?"check":"copy",onClick:p,ariaLabel:u?l("common.copied","\uBCF5\uC0AC\uB428"):l("common.copyCode","\uCF54\uB4DC \uBCF5\uC0AC")})]}),n.jsx("pre",{className:"code-box__inner","data-lang":t,children:n.jsx("code",{children:f.map((x,C)=>n.jsx("span",{className:`code-token ${x.type} ${y}`,children:x.content},C))})})]})}const Lv={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0};function za(e){const{t}=xe.useTranslation(),{variant:a="spinner",size:r=24,progress:i=null,label:s}=e||{},l=s||t("loader.loading","Loading");if(a==="bar"){const c=i==null||!Number.isFinite(Number(i)),d=c?0:Math.max(0,Math.min(100,Number(i)));return n.jsx("div",{className:`loader-bar${c?" loader-bar--indeterminate":""}`,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":c?void 0:d,"aria-label":l,children:n.jsx("div",{className:"loader-bar__inner",style:c?void 0:{width:`${d}%`}})})}const u=typeof r=="number"?`${r}px`:r;return n.jsxs("div",{className:"loader-spinner",style:{width:u,height:u},role:"status","aria-label":l,children:[n.jsx("span",{style:Lv,children:l}),n.jsxs("svg",{className:"loader-spinner__svg",viewBox:"0 0 50 50",width:r,height:r,children:[n.jsx("circle",{className:"loader-spinner__bg",cx:"25",cy:"25",r:"20",fill:"none",strokeWidth:"4"}),n.jsx("circle",{className:"loader-spinner__fg",cx:"25",cy:"25",r:"20",fill:"none",strokeWidth:"4",strokeLinecap:"round"})]})]})}function hu({checked:e,onChange:t,disabled:a=!1,label:r,ariaLabel:i,labelPosition:s="right",className:l="",id:u}){const c=r&&n.jsx("span",{className:"toggle__label body-3",children:r});return n.jsxs("label",{className:`toggle${a?" toggle--disabled":""} ${l}`.trim(),children:[s==="left"&&c,n.jsx("input",{id:u,type:"checkbox",role:"switch",checked:e,disabled:a,onChange:d=>t?.(d.target.checked),"aria-label":!r&&i?i:void 0}),n.jsx("span",{className:"toggle__slider"}),s==="right"&&c]})}function fu({checked:e=!1,onChange:t,disabled:a,indeterminate:r,label:i,size:s="medium",className:l,title:u,ariaLabel:c}){const d=o.useRef(null),m=o.useId(),p=o.useRef(!!r);return p.current=!!r,o.useEffect(()=>{d.current&&(d.current.indeterminate=!!r)}),n.jsxs("label",{className:_e("checkbox",s==="small"&&"checkbox--small",s==="large"&&"checkbox--large",a&&"checkbox--disabled",l),htmlFor:m,title:u,children:[n.jsx("input",{ref:d,id:m,type:"checkbox",className:"checkbox__input",checked:e,onChange:f=>{t?.(f.target.checked),d.current&&(d.current.indeterminate=p.current)},disabled:a,"aria-label":!i&&c?c:void 0}),n.jsx("span",{className:"checkbox__box"}),i&&n.jsx("span",{className:"checkbox__label body-3",children:i})]})}function $v({count:e,actions:t,onClear:a,clearLabel:r,visible:i,content:s,max:l}){const{t:u}=xe.useTranslation(),c=i!==void 0?i:e>0,d=r??u("bulkBar.clearSelection","\uC120\uD0DD \uD574\uC81C"),m=o.useRef(null),p=o.useRef(null),f=o.useRef(null),y=o.useRef(c);o.useLayoutEffect(()=>{const g=p.current,A=y.current;if(y.current=c,c&&!A){const b=typeof document<"u"?document.activeElement:null;f.current=b&&b!==document.body&&!g?.contains(b)?b:null}else!c&&A&&g&&g.contains(document.activeElement)&&ar(g,f.current)},[c]);const[x,C]=o.useState(!1),h=o.useRef(!1),_=o.useRef(null);return o.useEffect(()=>{const g=m.current;if(!g)return;const A=E=>{h.current=E,C(E)},b=()=>{const E=g.firstElementChild??g,D=Array.from(E.children);if(D.length<2){A(!1);return}const N=D[0].offsetTop,O=D.some($=>$.offsetTop!==N);if(!h.current){_.current=g.clientWidth,O&&A(!0);return}if(O)return;const P=D[0],G=D[D.length-1],L=G.offsetLeft+G.offsetWidth-P.offsetLeft,M=_.current;(M==null||L<=M)&&A(!1)};if(b(),typeof ResizeObserver>"u")return;const k=new ResizeObserver(b);k.observe(g);const v=g.parentElement;let w=v?.clientWidth??0;const B=new ResizeObserver(()=>{const E=v?.clientWidth??0;E!==w&&(w=E,_.current=null,b())});return v&&B.observe(v),()=>{k.disconnect(),B.disconnect()}},[s,e]),n.jsxs("div",{ref:p,className:`bulk-bar ${c?"bulk-bar--visible":""}`,inert:!c||void 0,"aria-hidden":c?void 0:!0,children:[n.jsx("span",{ref:m,className:"bulk-bar__count body-2",role:"status",children:s??n.jsx("b",{children:u("common.selectedCount",{count:e})})}),l!==void 0&&n.jsx(At,{size:"small",fill:"soft",variant:"main",label:`${e} / ${l}`,"aria-label":u("common.selectedOfMax",{count:e,max:l,defaultValue:`\uCD5C\uB300 ${l}\uAC1C \uC911 ${e}\uAC1C`})}),n.jsxs("div",{className:`bulk-bar__actions${x?" bulk-bar__actions--stacked":""}`,children:[n.jsx(pe,{htmlType:"button",size:40,label:d,onClick:a}),t.map((g,A)=>n.jsx(pe,{htmlType:"button",size:40,variant:g.variant??"default",icon:g.icon,label:g.label,onClick:g.onClick},A))]})]})}const Rv=[{key:"edit",icon:"edit-2",closeFirst:!0},{key:"duplicate",icon:"copy",closeFirst:!1},{key:"publish",icon:"book-marked",closeFirst:!1},{key:"copyLink",icon:"link",closeFirst:!1},{key:"remove",icon:"trash-2",closeFirst:!0}];function Pv(e){const{onClose:t,className:a}=e;return n.jsx("div",{className:_e("item-actions",a),children:Rv.map(({key:r,icon:i,closeFirst:s})=>{const l=e[r];if(!l)return null;const u=r==="publish"?l.published?l.unpublish:l.publish:l;return n.jsx(pe,{htmlType:"button",size:40,type:"dot",icon:i,ariaLabel:u.label,showTooltipInfo:u.label,onClick:()=>{s&&t(),u.onClick()}},r)})})}function Cu(e,t){const a=()=>{if(e){const[C,h]=e.split("-");return{y:+C,m:+h-1}}const[y,x]=ro(t).split("-");return{y:+y,m:+x-1}},[r,i]=o.useState(()=>a().y),[s,l]=o.useState(()=>a().m),u=o.useRef(e);o.useEffect(()=>{if(e===u.current)return;u.current=e;const y=a();i(y.y),l(y.m)},[e]);const c=o.useRef({y:r,m:s});o.useEffect(()=>{c.current={y:r,m:s}},[r,s]);const d=o.useCallback(y=>{const x=c.current.y*12+c.current.m+y,C=Math.floor(x/12),h=x-C*12;c.current={y:C,m:h},i(C),l(h)},[]),m=o.useCallback(()=>d(-1),[d]),p=o.useCallback(()=>d(1),[d]),f=o.useCallback((y,x)=>{c.current={y,m:x},i(y),l(x)},[]);return{viewY:r,viewM:s,prevMonth:m,nextMonth:p,setViewYM:f}}function pr(e,t){return new Date(e,t+1,0).getDate()}function Iv(e,t){return new Date(e,t,1).getDay()}function mr(e,t,a){return`${e}-${String(t+1).padStart(2,"0")}-${String(a).padStart(2,"0")}`}function Fv(e){if(!e)return"";const[t,a,r]=e.split("-");return`${t}. ${a}. ${r}.`}function Ov(e,t,a,r){const i=a?+a.split("-")[0]:e-10,s=r?+r.split("-")[0]:e+10,l=[];for(let u=i;u<=s;u++)for(let c=0;c<12;c++){const d=`${u}-${String(c+1).padStart(2,"0")}`;a&&d<a.slice(0,7)||r&&d>r.slice(0,7)||l.push({value:d,label:t(u,c+1)})}return l}function zv({value:e,onChange:t,size:a=48,min:r,max:i,disabled:s,placeholder:l,className:u,today:c}){const{t:d,i18n:m}=xe.useTranslation(),p=l??d("datePicker.chooseDate","\uB0A0\uC9DC \uC120\uD0DD"),f=o.useMemo(()=>d("calendar.dow",{returnObjects:!0}),[d]),y=ro(c),{viewY:x,viewM:C,prevMonth:h,nextMonth:_,setViewYM:g}=Cu(e,c),A=o.useId(),b=o.useCallback((I,S)=>{const j=window.innerHeight,F=window.innerWidth,U=typeof document<"u"?document.getElementById(A):null,re=Math.max(U?.offsetHeight||0,U?.scrollHeight||0)||300,ne=Math.max(I.width,U?.offsetWidth||0,260),le=j-I.bottom,K=I.top,oe=le<re&&K>le,Ae=8,Y=(Q,me)=>Math.min(Math.max(Ae,Q),Math.max(Ae,me));return{position:"fixed",left:Y(I.left,F-ne-Ae),width:I.width,minWidth:260,...oe?{top:"auto",bottom:Y(j-I.top+6,j-re-Ae)}:{bottom:"auto",top:Y(I.bottom+6,j-re-Ae)},zIndex:ja(S)}},[A]),{open:k,setOpen:v,toggle:w,style:B,triggerRef:E,menuRef:D}=Ma({computeStyle:b,onScroll:"reposition",onResize:"reposition",ignoreOutsideClickSelector:".dropdown__menu"});o.useEffect(()=>{if(!k)return;const I=D.current;return(I?.querySelector(".date-picker__day--selected:not(:disabled)")??I?.querySelector(".date-picker__day--today:not(:disabled)")??I?.querySelector(".date-picker__day:not(:disabled)")??I?.querySelector(Cn)??I)?.focus?.(),()=>{const S=document.activeElement;(!S||S===document.body)&&E.current?.focus?.()}},[k,D,E]);const[N,O]=o.useState(1),P=o.useRef(null),G=o.useRef(null);o.useEffect(()=>{if(!k)return;const I=e&&e.slice(0,7)===`${x}-${String(C+1).padStart(2,"0")}`?+e.slice(8):y.slice(0,7)===`${x}-${String(C+1).padStart(2,"0")}`?+y.slice(8):1;O(I)},[k]),o.useEffect(()=>{if(G.current==null)return;const I=G.current;G.current=null,P.current?.querySelector(`[data-day="${I}"]`)?.focus()}),o.useEffect(()=>{O(I=>Math.min(I,pr(x,C)))},[x,C]);const L=o.useCallback(I=>{let S=mr(I.getFullYear(),I.getMonth(),I.getDate());r&&S<r&&(S=r),i&&S>i&&(S=i);const[j,F,U]=S.split("-").map(Number);(j!==x||F-1!==C)&&g(j,F-1),O(U),G.current=U},[r,i,x,C,g]),M=o.useCallback(I=>{const S=new Date(x,C,N),j=U=>{S.setDate(S.getDate()+U),L(S)},F=U=>{const re=S.getFullYear()*12+S.getMonth()+U,ne=Math.floor(re/12),le=re-ne*12;L(new Date(ne,le,Math.min(S.getDate(),pr(ne,le))))};switch(I.key){case"ArrowLeft":j(-1);break;case"ArrowRight":j(1);break;case"ArrowUp":j(-7);break;case"ArrowDown":j(7);break;case"Home":j(-S.getDay());break;case"End":j(6-S.getDay());break;case"PageUp":I.shiftKey?F(-12):F(-1);break;case"PageDown":I.shiftKey?F(12):F(1);break;default:return}I.preventDefault()},[x,C,N,L]),$=o.useCallback(I=>{s||(t(mr(x,C,I)),v(!1))},[x,C,t,v,s]);o.useEffect(()=>{s&&v(!1)},[s,v]);const Z=I=>{const S=mr(x,C,I);return!!(r&&S<r||i&&S>i)},q=(()=>{const I=pr(x,C);if(N>=1&&N<=I&&!Z(N))return N;for(let S=1;S<=I;S++)if(!Z(S))return S;return-1})(),z=[];for(let I=0;I<Iv(x,C);I++)z.push(null);for(let I=1;I<=pr(x,C);I++)z.push(I);const V=a===64?20:a===40?16:18,R=Ov(x,(I,S)=>tr(d,m.language,I,S),r,i),H=`${x}-${String(C+1).padStart(2,"0")}`,W=k?en.createPortal(n.jsxs("div",{ref:D,id:A,className:"date-picker__dropdown",style:B,"data-tooltip-ignore":!0,role:"dialog","aria-label":d("datePicker.chooseDate","\uB0A0\uC9DC \uC120\uD0DD"),tabIndex:-1,children:[n.jsxs("div",{className:"date-picker__nav",children:[n.jsx("button",{type:"button",className:"date-picker__nav-btn",onClick:h,"aria-label":d("calendar.prevMonth","\uC774\uC804 \uB2EC"),children:n.jsx(js,{size:16,strokeWidth:2})}),n.jsx(pn,{className:"date-picker__nav-dropdown",ariaLabel:d("datePicker.selectYearMonth","\uC5F0\uC6D4 \uC120\uD0DD"),options:R,value:H,onChange:I=>{const[S,j]=I.split("-");g(+S,+j-1)},block:!0,size:40}),n.jsx("button",{type:"button",className:"date-picker__nav-btn",onClick:_,"aria-label":d("calendar.nextMonth","\uB2E4\uC74C \uB2EC"),children:n.jsx(Ms,{size:16,strokeWidth:2})})]}),n.jsxs("div",{className:"date-picker__grid",ref:P,onKeyDown:M,children:[f.map(I=>n.jsx("div",{className:"date-picker__dow caption-1",children:I},I)),z.map((I,S)=>{if(I===null)return n.jsx("div",{},`e${S}`);const j=mr(x,C,I),F=j===e,U=j===y,re=Z(I),ne=S%7;return n.jsx("button",{type:"button",disabled:re,"data-day":I,tabIndex:I===q?0:-1,"aria-current":U?"date":void 0,onClick:()=>!re&&$(I),className:_e("date-picker__day caption-1",F&&"date-picker__day--selected",U&&!F&&"date-picker__day--today",re&&"date-picker__day--disabled",ne===0&&"date-picker__day--sun",ne===6&&"date-picker__day--sat"),children:I},I)})]})]}),document.body):null;return n.jsxs("div",{className:_e("date-picker",`date-picker--s${a}`,k&&"date-picker--open",u),children:[n.jsxs("button",{ref:E,type:"button",className:"date-picker__trigger body-2",onClick:()=>!s&&w(),disabled:s,"aria-haspopup":"true","aria-expanded":k,children:[n.jsx("span",{className:e?"date-picker__value":"date-picker__placeholder",children:e?Fv(e):p}),n.jsx(Ws,{size:V,className:"date-picker__icon",strokeWidth:1.5})]}),W]})}function Wv({src:e,alt:t,className:a,style:r,tone:i,textColor:s}){const l=!i&&!!s,u=a2(e,l);return i?n.jsx("span",{className:_e("brand-logo","brand-logo--tone",a),role:t?"img":void 0,"aria-label":t||void 0,"aria-hidden":t?void 0:!0,style:{...r,"--brand-logo-src":`url("${e}")`,"--brand-logo-tone":i},children:n.jsx("img",{src:e,alt:"","aria-hidden":"true",className:"brand-logo__sizer",draggable:!1})}):l&&u?n.jsx("span",{className:_e("brand-logo","brand-logo--inline",a),role:t?"img":void 0,"aria-label":t||void 0,"aria-hidden":t?void 0:!0,style:{...r,"--brand-logo-text-color":s},dangerouslySetInnerHTML:{__html:t2(u)}}):n.jsx("img",{src:e,alt:t,className:_e("brand-logo",a),style:r,draggable:!1})}function gu({children:e,className:t}){const a=o.useRef(null),[r,i]=o.useState(null);return o.useEffect(()=>{i(a.current?.parentElement??null)},[]),o.useEffect(()=>{const s=a.current;if(!s||!r)return;const l=()=>{const c=typeof window<"u"&&window.getComputedStyle(s).position==="absolute"?Math.ceil(s.getBoundingClientRect().width):0;c>0?r.style.setProperty("--section-head-float-w",`${c}px`):r.style.removeProperty("--section-head-float-w")};if(l(),typeof ResizeObserver>"u")return()=>{r.style.removeProperty("--section-head-float-w")};const u=new ResizeObserver(()=>l());return u.observe(s),u.observe(r),()=>{u.disconnect(),r.style.removeProperty("--section-head-float-w")}},[r,e]),n.jsx("div",{ref:a,className:_e("section-head-float",t),children:e})}function Mo({items:e,className:t}){return n.jsx("div",{className:t?`manager-bar-chart-legend ${t}`:"manager-bar-chart-legend",children:e.map((a,r)=>n.jsxs("span",{className:"manager-bar-chart-legend-item",children:[n.jsx("span",{className:"manager-bar-chart-legend-dot",style:{background:a.color}}),a.label]},r))})}function Wa({label:e,children:t}){return e?n.jsxs("div",{className:"barchart-total barchart-total--stacked",children:[n.jsx("span",{className:"barchart-total__label body-3",children:e}),n.jsx("span",{className:"barchart-total__value",children:t})]}):n.jsx("div",{className:"barchart-total",children:t})}function Lo({title:e,titleClassName:t="h3",titleLevel:a=3,icon:r,disc:i,headRight:s,headFloat:l,headSegment:u,headMenuItems:c,collapseBelow:d=420,onClick:m,ariaLabel:p,tooltip:f,totalNum:y,totalUnit:x,totalLabel:C,subRow:h,subRowAlign:_="start",className:g,inGrid:A=!1,children:b}){const{t:k}=xe.useTranslation(),v=o.useRef(null),{anchorRect:w,openAt:B,close:E}=Ta(),D=o.useCallback(()=>{f&&v.current&&B(v.current)},[f,B]),[N,O]=o.useState(!1);To(()=>{const S=v.current;if(!S||!u)return;const j=U=>O(U>0&&U<d);if(j(S.clientWidth),typeof ResizeObserver>"u")return;const F=new ResizeObserver(U=>j(U[0].contentRect.width));return F.observe(S),()=>F.disconnect()},[u,d]);const[P,G]=o.useState(null),L=o.useCallback(()=>G(null),[]),M=o.useCallback(S=>{const j=S.currentTarget.getBoundingClientRect();G(F=>F?null:{left:j.left,right:j.right,top:j.top,bottom:j.bottom,width:j.width,height:j.height,x:j.x,y:j.y})},[]),$=!!u&&N;o.useEffect(()=>{$||G(null)},[$]);const Z=u?[...u.options.map(S=>({label:S.label,icon:S.icon,selected:S.key===u.value,disabled:S.disabled,onClick:()=>u.onChange(S.key),closeOnSelect:!0})),...(c??[]).map((S,j)=>j===0?{...S,separatorBefore:!0}:S)]:[],q=o.useCallback(S=>{if(!m)return;const j=S.target;j&&typeof j.closest=="function"&&j.closest('button, a, input, select, textarea, [role="radiogroup"]')||m()},[m]),z=o.useCallback(S=>{m&&S.target===S.currentTarget&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),m())},[m]),V=typeof s=="function"?s({collapsed:$}):s,R=y!=null||C?n.jsxs(Wa,{label:C,children:[y!=null&&n.jsx("span",{className:"barchart-total__num h0",children:y}),x&&n.jsx("span",{className:"barchart-total__unit h5",children:x})]}):null,H=V||u?n.jsxs("div",{className:"manager-section__head-right",children:[u&&($?n.jsx(pe,{htmlType:"button",size:32,type:"dot",icon:"ellipsis",ariaLabel:u.ariaLabel??k("common.more","\uB354\uBCF4\uAE30"),showTooltipInfo:u.ariaLabel??k("common.more","\uB354\uBCF4\uAE30"),"aria-haspopup":"menu","aria-expanded":!!P,onClick:M}):n.jsx(gn,{size:32,ariaLabel:u.ariaLabel,options:u.options.map(S=>({key:S.key,label:S.label,disabled:S.disabled})),value:u.value,onChange:u.onChange})),V]}):null,W=o.useId(),I=a?`h${a}`:"div";return n.jsxs("section",{ref:v,className:["manager-section",A&&"manager-section--grid",m&&"manager-section--clickable",g].filter(Boolean).join(" "),onClick:m?q:void 0,onKeyDown:m?z:void 0,onPointerEnter:f?D:void 0,onPointerLeave:f?E:void 0,onFocus:f?D:void 0,onBlur:f?E:void 0,role:m?"button":void 0,tabIndex:m?0:void 0,"aria-label":m?p??(typeof e=="string"?e:void 0):void 0,"aria-labelledby":!m&&e!=null?W:void 0,children:[f&&w&&n.jsx(Bn,{anchorRect:{left:w.left,top:w.top+21,right:w.right,bottom:w.bottom,width:w.width,height:w.height},text:f}),l&&n.jsx(gu,{children:l}),n.jsxs("div",{className:"manager-section__head",children:[n.jsxs("div",{className:"manager-section__title-row",children:[r&&n.jsx(at,{icon:r,label:typeof e=="string"?e:void 0,className:"manager-section__icon"}),n.jsx(I,{id:W,className:["manager-section__title",t].filter(Boolean).join(" "),children:e})]}),H,i&&n.jsx("div",{className:"manager-section__disc body-3",children:i})]}),(R||h)&&n.jsxs("div",{className:["barchart-sub-row",_!=="start"&&`barchart-sub-row--${_}`].filter(Boolean).join(" "),children:[R,h]}),b,P&&n.jsx(cn,{anchorRect:P,onClose:L,ariaLabel:u?.ariaLabel??k("tooltip.menu","\uBA54\uB274"),children:n.jsx(La,{columns:[{items:Z}],onClose:L,size:"small"})})]})}const Ha=(e,t)=>`${e}-${String(t).padStart(2,"0")}`,$o=e=>Ha(e.getFullYear(),e.getMonth()+1);function ca(e){const t=/^(\d{4})-(\d{2})$/.exec(e);if(!t)return null;const a=Number(t[2]);return a>=1&&a<=12?{year:Number(t[1]),month1:a}:null}const Ro=(e,t)=>`${e}#${t}`;function bn(e,t){const a=new Date(e,t,1).getDay();return 1+(8-(a===0?7:a))%7}function Hv(){const e=ra();let t=e.getFullYear(),a=e.getMonth(),r=e.getDate();if(r<bn(t,a)){const l=new Date(t,a,0);t=l.getFullYear(),a=l.getMonth(),r=l.getDate()}const i=Math.floor((r-bn(t,a))/7),s=Ha(t,a+1);return{monthKey:s,value:Ro(s,i)}}function Vv(e){const t=ra(),a=$o(t),r=(c,d)=>Ha(c,d+1),i=new Map;i.set(a,[]);for(const c of e){if(isNaN(c.date.getTime()))continue;const d=r(c.date.getFullYear(),c.date.getMonth());i.has(d)||i.set(d,[]),i.get(d).push(c)}for(const[c,d]of[...i.entries()]){const m=ca(c);if(!m)continue;const p=m.year,f=m.month1-1,y=bn(p,f);if(!(c===a&&t.getDate()<y)&&!d.some(h=>h.date.getDate()<y))continue;const x=new Date(p,f,0),C=r(x.getFullYear(),x.getMonth());i.has(C)||i.set(C,[])}const s=new Map;for(const[c,d]of i){const m=ca(c);if(!m)continue;const p=m.year,f=m.month1-1,y=new Date(p,f+1,0).getDate(),x=d.reduce((b,k)=>Math.max(b,k.parts?.length??0,k.partsB?.length??0),0),C=d.some(b=>b.partsB),h=new Array(y+1).fill(0),_=new Array(y+1).fill(0),g=Array.from({length:y+1},()=>new Array(x).fill(0)),A=Array.from({length:y+1},()=>new Array(x).fill(0));for(const b of d){const k=b.date.getDate();if(h[k]+=b.a,_[k]+=b.b,b.parts)for(let v=0;v<x;v++)g[k][v]+=b.parts[v]??0;if(b.partsB)for(let v=0;v<x;v++)A[k][v]+=b.partsB[v]??0}s.set(c,{year:p,month:f,daysInMonth:y,partsLen:x,hasPartsB:C,dayA:h,dayB:_,dayParts:g,dayPartsB:A})}const l=(c,d,m)=>new Date(c,d,m).getTime()>new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),u={};for(const[c,d]of s){const{year:m,month:p,daysInMonth:f,dayA:y,dayB:x,dayParts:C,dayPartsB:h}=d,_=m===t.getFullYear()&&p===t.getMonth(),g=t.getDate(),A=s.get(r(p===11?m+1:m,(p+1)%12)),b=d.partsLen,k=[];for(let w=1;w<=f;w++){const B=_&&w>g;k.push({label:String(w),...B&&y[w]===0&&x[w]===0?{future:!0}:{},a:B&&y[w]===0&&x[w]===0?-1:y[w],b:x[w],...b?{parts:C[w]}:{},...b&&d.hasPartsB?{partsB:h[w]}:{}})}const v=[];for(let w=bn(m,p);w<=f;w+=7){const B=Math.max(0,w+6-f),E=B&&A?Math.max(b,A.partsLen):b,D=d.hasPartsB||!!(B&&A?.hasPartsB);let N=0,O=0;const P=new Array(E).fill(0),G=new Array(E).fill(0);for(let M=w;M<=Math.min(w+6,f);M++){N+=y[M],O+=x[M];for(let $=0;$<b;$++)P[$]+=C[M][$],G[$]+=h[M][$]}if(B&&A)for(let M=1;M<=B&&!l(A.year,A.month,M);M++){N+=A.dayA[M],O+=A.dayB[M];for(let $=0;$<A.partsLen;$++)P[$]+=A.dayParts[M][$],G[$]+=A.dayPartsB[M][$]}const L=B?`${(p+1)%12+1}/${B}`:`${w+6}`;v.push({label:`${v.length+1}\uC8FC`,sublabel:`[${w}\uC77C~${L}\uC77C]`,a:N,b:O,...E?{parts:P}:{},...E&&D?{partsB:G}:{}})}u[c]={weekly:v,daily:k}}return u}function bu(){const e=ra(),t=e.getFullYear(),a=e.getMonth()+1,r=[];for(let i=2024;i<=t;i++){const s=i===t?a:12;for(let l=1;l<=s;l++)r.push({value:Ha(i,l),year:i,month:l})}return r.reverse()}bu();function qv(){return bu()}function yu(e,t){const a=e("calendar.weekOrdinal",{returnObjects:!0,defaultValue:[]}),r=Array.isArray(a)&&typeof a[t]=="string"?a[t]:null;return e("calendar.weekLabel",{ord:r??String(t+1)})}function vu(e){const{t,i18n:a}=xe.useTranslation(),[r,i]=o.useState("week"),s=o.useMemo(()=>qv().filter(E=>E.value in e),[e]),l=o.useMemo(()=>{const E=[];for(const D of s){const N=new Date(D.year,D.month,0).getDate(),O=bn(D.year,D.month-1),P=Math.ceil((N-O+1)/7);for(let G=P-1;G>=0;G--)E.push({value:Ro(D.value,G),monthKey:D.value,year:D.year,month:D.month,week:G})}return E},[s]),u=o.useCallback(E=>`${tr(t,a.language,E.year,E.month)} ${yu(t,E.week)}`,[t]),c=o.useMemo(()=>s.map(E=>({value:E.value,label:tr(t,a.language,E.year,E.month)})),[t,a.language,s]),d=o.useMemo(()=>l.map(E=>({value:E.value,label:u(E)})),[l,u]),m=o.useMemo(()=>Hv(),[e]),p=o.useMemo(()=>s.find(E=>E.value===m.monthKey)?.value??s[0]?.value??"",[s,m]),f=o.useMemo(()=>l.find(E=>E.value===m.value)?.value??l[0]?.value??"",[l,m]),[y,x]=o.useState(""),[C,h]=o.useState("");o.useEffect(()=>{s.find(E=>E.value===y)||x(p)},[s,y,p]),o.useEffect(()=>{l.find(E=>E.value===C)||h(f)},[l,C,f]);const _=r==="month"?c:d,g=r==="month"?y:C,A=r==="month"?x:h,b=o.useMemo(()=>{const E=t("calendar.dow",{returnObjects:!0});return Array.isArray(E)?E:["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"]},[t]),k=_.findIndex(E=>E.value===g),v=o.useCallback(()=>{const E=_.findIndex(D=>D.value===g);E<_.length-1&&A(_[E+1].value)},[_,g,A]),w=o.useCallback(()=>{const E=_.findIndex(D=>D.value===g);E>0&&A(_[E-1].value)},[_,g,A]),B=o.useMemo(()=>[{key:"week",label:t("manager.chart.periodWeek","\uC8FC")},{key:"month",label:t("manager.chart.periodMonth","\uC6D4")}],[t]);return{period:r,setPeriod:i,range:g,setRange:A,activeOptions:_,activeIdx:k,handlePrev:v,handleNext:w,periodOptions:B,monthRange:y,weekRange:C,weekRanges:l,DOW:b}}const _t=e=>typeof e=="number"&&Number.isFinite(e)?e:0;function En(e,t=!0){return e.future===!0||t&&e.a===-1}function Uv({data:e,colorA:t,colorB:a,labelA:r,labelB:i,barWidth:s=10,barGap:l=1,height:u=140,maxOverride:c,tightMax:d,seriesColors:m,seriesLabels:p,rateLabels:f,grouped:y=!1,baseline:x,focusableBars:C=!1}){const h=!a,_=!!(m&&m.length>0),g=x,A=o.useMemo(()=>_?Math.max(0,...e.filter(z=>!En(z,g==null)).map(z=>y?Math.max(0,...(z.parts??[]).map(_t)):(z.parts??[]).reduce((V,R)=>V+Math.max(0,_t(R)),0))):Math.max(0,...e.filter(z=>!En(z,g==null)).flatMap(z=>h?[_t(z.a)]:[_t(z.a),_t(z.b)])),[e,h,_,y]),b=o.useMemo(()=>{if(g==null)return 0;const z=e.filter(V=>!En(V,g==null)).flatMap(V=>_?(V.parts??[]).map(_t):h?[_t(V.a)]:[_t(V.a),_t(V.b)]);return Math.max(0,...z.map(V=>Math.abs(V-g)))},[e,g,_,h]),k=o.useMemo(()=>{const z=g!=null?b:A;return c??(d?z>0?z:10:Math.ceil(z/10)*10||10)},[A,b,g,c,d]),v=u,w=_?y?Math.max(1,m.length):1:h?1:2,B={"--bar-width":`${o.useMemo(()=>{const z=Math.max(1,e.length);return Math.max(2,Math.min(s,Math.round(120/(z*w)+6)))},[e.length,w,s])}px`},E={"--bar-group-gap":`${Math.max(0,l)}px`},D=o.useMemo(()=>{const z=Math.round(k/2);return g!=null?[g+k,...z!==k?[g+z]:[],g,...z!==k?[g-z]:[],g-k]:z!==k?[k,z,0]:[k,0]},[k,g]),N=z=>g!=null?1-(z-(g-k))/(2*k):1-z/k,[O,P]=o.useState(null),G=o.useCallback(()=>P(null),[]),L=o.useCallback((z,V)=>{const R=[z.label,z.sublabel].filter(Boolean).join(" ");let H;if(_&&y&&z.rawPartsB)H=(p??[]).map((W,I)=>{const S=z.rawPartsB[I]??0;return{text:S>0?`${W}: ${V[I]??0}% (${z.rawParts?.[I]??0}/${S})`:`${W}: -`,color:(m??[])[I]}});else if(_&&y)H=(p??[]).map((W,I)=>({text:`${W}: ${Z(V[I]??0)}`,color:(m??[])[I]}));else if(_){const W=(p??[]).map((S,j)=>({text:`${S}: ${V[j]??0}`,color:(m??[])[j]})),I=W.filter((S,j)=>(V[j]??0)>0);H=I.length?I:W}else f&&!h?H=[{text:`${r} ${_t(z.a)}%`,color:t},{text:`${i} ${_t(z.b)}%`,color:a}]:f&&z.rawB!==void 0?H=[{text:`${f.total} ${z.rawB}`},{text:`${f.done} ${z.rawA??0}`,color:t}]:h?H=[{text:`${r}: ${_t(z.a)}`,color:t}]:H=[{text:`${r}: ${_t(z.a)}`,color:t},{text:`${i}: ${_t(z.b)}`,color:a}];return{title:R,items:H}},[_,y,p,m,f,h,r,i,t,a,g]),M=o.useCallback((z,V,R)=>{const H=z.getBoundingClientRect(),{title:W,items:I}=L(V,R);P({rect:{left:H.left,top:H.top,right:H.right,bottom:H.bottom,width:H.width,height:H.height},title:W,items:I})},[L]),$=o.useCallback((z,V)=>{const{title:R,items:H}=L(z,V);return[R,...H.map(W=>W.text)].filter(Boolean).join(", ")},[L]),Z=z=>g!=null&&z>g?`+${z}`:`${z}`,q=O!=null;return o.useEffect(()=>{if(!q)return;const z=()=>P(null),V=R=>{const H=R.target;H&&typeof H.closest=="function"&&H.closest(".manager-bar-chart-col")||P(null)};return window.addEventListener("scroll",z,!0),document.addEventListener("pointerdown",V,!0),()=>{window.removeEventListener("scroll",z,!0),document.removeEventListener("pointerdown",V,!0)}},[q]),n.jsxs("div",{className:"manager-bar-chart-wrap",style:E,children:[n.jsx("div",{className:"manager-bar-chart-inner",children:n.jsx("div",{className:"manager-bar-chart-scroll",children:n.jsxs("div",{className:"manager-bar-chart-area",children:[n.jsxs("div",{className:"manager-bar-chart-plot",style:{height:v},children:[D.slice(0,-1).map((z,V)=>n.jsx("div",{className:`manager-bar-chart-gridline${g!=null&&z===g?" manager-bar-chart-gridline--baseline":""}`,style:{top:N(z)*v},children:n.jsx("span",{className:"manager-bar-chart-gridline__label caption-1",children:z})},V)),e.map((z,V)=>{const R=En(z,g==null),H=v/2,W=F=>g!=null?Math.min(H,Math.abs(_t(F)-g)/k*H):Math.min(v,Math.max(0,_t(F)/k*v)),I=R?0:W(z.a),S=R?0:W(z.b),j=(z.parts??[]).map(_t);return n.jsx("div",{className:`manager-bar-chart-col${y&&_?" manager-bar-chart-col--group":""}`,style:{cursor:R?"default":"pointer"},tabIndex:C&&!R?0:void 0,role:C&&!R?"img":void 0,"aria-label":C&&!R?$(z,j):void 0,onMouseEnter:R?void 0:F=>M(F.currentTarget,z,j),onFocus:R||!C?void 0:F=>M(F.currentTarget,z,j),onBlur:C?G:void 0,onMouseLeave:G,children:!R&&(_&&y?(m??[]).map((F,U)=>{const re=j[U]??0;if(g==null)return n.jsx("div",{className:"manager-bar-chart-bar",style:{...B,height:W(re),background:F}},U);const ne=_t(re)<g;return n.jsxs("div",{className:"manager-bar-chart-slot",style:B,children:[n.jsx("div",{className:"manager-bar-chart-slot__half manager-bar-chart-slot__half--up",children:!ne&&n.jsx("div",{className:"manager-bar-chart-bar manager-bar-chart-bar--full",style:{height:W(re),background:F}})}),n.jsx("div",{className:"manager-bar-chart-slot__half manager-bar-chart-slot__half--down",children:ne&&n.jsx("div",{className:"manager-bar-chart-bar manager-bar-chart-bar--full manager-bar-chart-bar--down",style:{height:W(re),background:F}})})]},U)}):_?n.jsx("div",{className:"manager-bar-chart-stack",style:B,children:(()=>{const F=j.reduce((re,ne,le)=>ne>0?le:re,-1);let U=v;return j.map((re,ne)=>{if(re<=0)return null;const le=Math.min(U,re/k*v);return U-=le,n.jsx("div",{className:"manager-bar-chart-stack-segment",style:{height:le,background:(m??[])[ne],borderRadius:ne===F?"6px 6px 0 0":void 0}},ne)})})()}):g!=null?n.jsx(n.Fragment,{children:[{v:_t(z.a),c:t},...h?[]:[{v:_t(z.b),c:a}]].map(({v:F,c:U},re)=>n.jsxs("div",{className:"manager-bar-chart-slot",style:B,children:[n.jsx("div",{className:"manager-bar-chart-slot__half manager-bar-chart-slot__half--up",children:F>=g&&n.jsx("div",{className:"manager-bar-chart-bar manager-bar-chart-bar--full",style:{height:W(F),background:U}})}),n.jsx("div",{className:"manager-bar-chart-slot__half manager-bar-chart-slot__half--down",children:F<g&&n.jsx("div",{className:"manager-bar-chart-bar manager-bar-chart-bar--full manager-bar-chart-bar--down",style:{height:W(F),background:U}})})]},re))}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"manager-bar-chart-bar",style:{...B,height:I,background:t}}),!h&&n.jsx("div",{className:"manager-bar-chart-bar",style:{...B,height:S,background:a}})]}))},V)})]}),n.jsx("div",{className:"manager-bar-chart-x-axis",children:e.map((z,V)=>{const R=En(z,g==null);return n.jsxs("span",{className:`manager-bar-chart-x-axis__label${R?" manager-bar-chart-x-axis__label--future":""}`,children:[n.jsxs("span",{className:"caption-1 manager-bar-chart-x-axis__main",children:[z.isToday&&n.jsx("span",{className:"manager-bar-chart-x-axis__today-dot",style:{background:t}}),z.label]}),z.sublabel&&n.jsx("span",{className:"caption-1",children:z.sublabel})]},V)})})]})})}),O&&n.jsx(Kn,{anchorRect:O.rect,title:O.title,items:O.items,showIndex:!1,closeOnOutsideClick:!1})]})}function xu({control:e}){const{t}=xe.useTranslation(),{activeOptions:a,activeIdx:r,range:i,setRange:s,handlePrev:l,handleNext:u,periodOptions:c,period:d,setPeriod:m}=e,p=d==="week"?t("calendar.prevWeek","\uC774\uC804 \uC8FC"):t("calendar.prevMonth","\uC774\uC804 \uB2EC"),f=d==="week"?t("calendar.nextWeek","\uB2E4\uC74C \uC8FC"):t("calendar.nextMonth","\uB2E4\uC74C \uB2EC");return n.jsxs("div",{className:"manager-section-controls",children:[n.jsx(pe,{htmlType:"button",size:32,type:"dot",icon:"chevron-left",ariaLabel:p,showTooltipInfo:p,disabled:r===a.length-1,onClick:l}),n.jsx(pn,{value:i,onChange:s,options:a,size:40,className:"month-dropdown",ariaLabel:t("calendar.rangeSelect","\uAE30\uAC04 \uC120\uD0DD")}),n.jsx(pe,{htmlType:"button",size:32,type:"dot",icon:"chevron-right",ariaLabel:f,showTooltipInfo:f,disabled:r<=0,onClick:u}),n.jsx(gn,{ariaLabel:t("calendar.periodSelect","\uAE30\uAC04 \uB2E8\uC704"),options:c,value:d,onChange:y=>m(y),size:40})]})}function Po(e,t,a,r=!0){const i=new Date(a.getFullYear(),a.getMonth(),a.getDate());return Array.from({length:7},(s,l)=>{const u=new Date(t);u.setDate(t.getDate()+l);const c=(e[$o(u)]?.daily??[])[u.getDate()-1],d=c!=null&&En(c,r)||u>i;return{dt:u,entry:c,isFuture:d}})}function Gv(e,t,a,r=!0){const{period:i,monthRange:s,weekRange:l,weekRanges:u,DOW:c}=t,d=ra(),m=d.getFullYear(),p=d.getMonth()+1,f=d.getDate();if(i==="month"){const C=e[s]??{weekly:[],daily:[]},h=ca(s),_=h?h.year:null,g=h?h.month1:null,A=_&&g?bn(_,g-1):1;return C.weekly.map((b,k)=>{const v=k+1;let w=b.label,B=!1,E=!1;if(_&&g){const D=A+k*7,N=new Date(_,g-1,D+6),O=N.getMonth()+1,P=N.getDate(),G=O===g?`${P}`:`${O}/${P}`;w=a("manager.chart.weekRange",{start:D,end:G});const L=new Date(m,p-1,f).getTime();B=L>=new Date(_,g-1,D).getTime()&&L<=N.getTime(),E=_>m||_===m&&(g>p||g===p&&D>f)}return{...b,label:w,sublabel:yu(a,v-1),isToday:B,future:b.future===!0||E||void 0,a:E?-1:b.a,b:E?0:b.b}})}const y=u.find(C=>C.value===l);if(!y)return[];const x=new Date(y.year,y.month-1,bn(y.year,y.month-1)+y.week*7);return Po(e,x,d,r).map(({dt:C,entry:h,isFuture:_})=>{const g=C.getMonth()+1,A=C.getDate(),b=C.getFullYear();return{label:g===y.month&&b===y.year?`${A}`:`${g}/${A}`,sublabel:c[C.getDay()]??"",future:_||void 0,a:_?-1:h&&h.a>0?h.a:0,b:_?0:h&&h.b>0?h.b:0,isToday:b===m&&g===p&&A===f,...h?.parts?{parts:_?h.parts.map(()=>0):h.parts}:{},...h?.partsB?{partsB:_?h.partsB.map(()=>0):h.partsB}:{}}})}const Kv={small:{height:100,barWidth:16},medium:{height:140,barWidth:20},large:{height:180,barWidth:24}};function Yv({focusableBars:e,size:t="medium",barWidth:a,titleKey:r,titleLevel:i,data:s,colorA:l,colorB:u,labelAKey:c,labelBKey:d,showTotal:m=!1,totalUnitKey:p,totalLabelKey:f,control:y,hideControls:x=!1,rate:C=!1,rateAgg:h="dayMean",tightMax:_=!1,avgMode:g=!1,totalFormat:A,series:b,seriesMode:k="stack",loading:v=!1,onDetail:w,headExtra:B,headSegment:E,icon:D,disc:N,onClick:O,cardAriaLabel:P,cardTooltip:G,detailSize:L=32,barGap:M,baseline:$,className:Z,inGrid:q=!1}){const{t:z}=xe.useTranslation(),V=Kv[t],R=vu(s),H=y??R,W=o.useMemo(()=>Gv(s,H,z,$==null),[s,H,z,$]),I=k==="group"&&!!b&&b.length>0;M!=null&&!I&&St("bar-chart-bargap-without-group","[BarChart] barGap \uC740 seriesMode='group' + series \uC5D0\uC11C\uB9CC \uC4F0\uC778\uB2E4 \u2014 \uADF8 \uBC16\uC5D0\uC11C\uB294 \uC544\uBB34 \uC77C\uB3C4 \uD558\uC9C0 \uC54A\uB294\uB2E4.");const S=o.useMemo(()=>{if(!C)return W;const K=H.period==="month"?ca(H.monthRange):null,oe=ra(),Ae=b?.length??0,Y=Q=>{const me=[],De=[],be=[];for(let te=0;te<Ae;te++){let ue=0,fe=0,ge=0;for(const Ce of Q){const $e=_t(Ce.a[te]),He=_t(Ce.b[te]);He<=0||(ue+=$e,fe+=He,ge+=$e/He*100)}me.push(h==="weighted"?fe>0?Math.round(ue/fe*100):0:Q.length?Math.round(ge/Q.length):0),De.push(ue),be.push(fe)}return{pct:me,ra:De,rb:be}};return W.map((Q,me)=>{let De=Q.a===-1?-1:Q.b>0?Math.round(Q.a/Q.b*100):0;if(K&&!En(Q)){const te=K.year,ue=K.month1-1,fe=Po(s,new Date(te,ue,bn(te,ue)+me*7),oe).filter(ge=>!ge.isFuture);if(h==="weighted"){let ge=0,Ce=0;for(const{entry:$e}of fe)$e&&$e.b>0&&(ge+=$e.a,Ce+=$e.b);De=Ce>0?Math.round(ge/Ce*100):0}else De=fe.length?Math.round(fe.reduce((ge,{entry:Ce})=>ge+(Ce&&Ce.b>0?Ce.a/Ce.b*100:0),0)/fe.length):0}let be=null;if(I&&!En(Q)){let te;if(K){const fe=K.year,ge=K.month1-1;te=Po(s,new Date(fe,ge,bn(fe,ge)+me*7),oe).filter(Ce=>!Ce.isFuture).map(({entry:Ce})=>({a:Ce?.parts??[],b:Ce?.partsB??[]}))}else te=[{a:Q.parts??[],b:Q.partsB??[]}];const ue=Y(te);be={parts:ue.pct,rawParts:ue.ra,rawPartsB:ue.rb}}return{...Q,a:De,b:Q.a===-1?0:d&&Q.parts&&Q.parts[1]>0?Math.round(Q.parts[0]/Q.parts[1]*100):0,rawA:Q.a===-1?-1:Q.a,rawB:Q.b,...be??{}}})},[W,C,h,d,H.period,H.monthRange,s,I,b?.length]),j=o.useMemo(()=>{if(C||g){const oe=(H.period==="week"?W:s[H.monthRange]?.daily??[]).filter(Y=>Y.a!==-1);if(oe.length===0)return 0;if(C&&h==="weighted"){let Y=0,Q=0;for(const me of oe)me.b>0&&(Y+=me.a,Q+=me.b);return Q>0?Math.round(Y/Q*100):0}const Ae=C?oe.reduce((Y,Q)=>Y+(Q.b>0?Q.a/Q.b*100:0),0):oe.reduce((Y,Q)=>Y+(Q.a>0?Q.a:0),0);return Math.round(Ae/oe.length)}const K=H.period==="month"?s[H.monthRange]?.daily??[]:S;return $!=null?K.reduce((oe,Ae)=>oe+(En(Ae,!1)?0:_t(Ae.a)+(d?_t(Ae.b):0)),0):K.reduce((oe,Ae)=>oe+(Ae.a>0?Ae.a:0)+(d&&Ae.b>0?Ae.b:0),0)},[S,W,C,h,g,$,d,H.period,H.monthRange,s]),F=b&&b.length>0?b.map(K=>({color:K.color,label:K.label})):[{color:l,label:z(c)},...d?[{color:u,label:z(d)}]:[]],U=t==="small",re=[U?"manager-section--compact":t==="large"?"manager-section--full":void 0,Z].filter(Boolean).join(" ")||void 0,ne=r?z(r):"",le=ne?z("trainingStatus.detailFor",{name:ne,defaultValue:"{{name}} \uC0C1\uC138\uBCF4\uAE30"}):z("trainingStatus.detail","\uC0C1\uC138\uBCF4\uAE30");return n.jsx(Lo,{className:re,inGrid:q,icon:D,disc:N,onClick:O,ariaLabel:P,tooltip:G,headSegment:E,headMenuItems:w?[{label:le,icon:"list",onClick:w,closeOnSelect:!0}]:void 0,title:z(r),titleLevel:i,titleClassName:U?"h5 chart-section-title--small":void 0,headRight:U?B??void 0:({collapsed:K})=>n.jsxs(n.Fragment,{children:[!x&&n.jsx(xu,{control:H}),B,w&&!K&&n.jsx("span",{className:"manager-bar-chart-detail-btn",children:n.jsx(pe,{htmlType:"button",size:L,type:"dot",icon:"list",ariaLabel:le,showTooltipInfo:le,onClick:w})})]}),subRow:n.jsxs(n.Fragment,{children:[m?C||g||f&&A?n.jsx(Wa,{label:U?void 0:`${z(H.period==="week"?"manager.chart.weeklyPrefix":"manager.chart.monthlyPrefix")} ${z(f??c)}`,children:A?(A(j).match(/([+-]?\d[\d.,]*|[^\d]+)/g)??[]).map((K,oe)=>/\d/.test(K)?n.jsx("span",{className:"barchart-total__num h0",children:K},oe):n.jsx("span",{className:"barchart-total__unit h5",children:K},oe)):n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"barchart-total__num h0",children:j}),p&&n.jsx("span",{className:"barchart-total__unit h5",children:z(p)})]})}):n.jsxs(Wa,{children:[n.jsx("span",{className:"barchart-total__num h0",children:j}),n.jsx("span",{className:"barchart-total__unit h5",children:z(c)}),p&&n.jsx("span",{className:"barchart-total__unit h5",children:z(p)})]}):n.jsx("span",{}),n.jsx(Mo,{items:F,className:"caption-1"})]}),children:v?n.jsx("div",{className:"manager-bar-chart-wrap manager-bar-chart-loading","aria-busy":"true",children:n.jsx("div",{className:"manager-bar-chart-inner",children:n.jsxs("div",{className:"manager-bar-chart-area manager-bar-chart-area--loading",children:[n.jsx("div",{className:"manager-bar-chart-plot manager-bar-chart-plot--loading",style:{height:V.height},children:n.jsx(za,{size:32})}),n.jsx("div",{className:"manager-bar-chart-x-axis","aria-hidden":"true",children:n.jsxs("span",{className:"manager-bar-chart-x-axis__label",children:[n.jsx("span",{className:"caption-1 manager-bar-chart-x-axis__main",children:"\xA0"}),S.some(K=>!!K.sublabel)&&n.jsx("span",{className:"caption-1",children:"\xA0"})]})})]})})}):n.jsx(Uv,{focusableBars:e,data:S,colorA:l,colorB:d?u:void 0,labelA:z(c),labelB:d?z(d):void 0,barWidth:a??V.barWidth,barGap:M,baseline:$,height:V.height,maxOverride:C?100:void 0,tightMax:_,seriesColors:b?.map(K=>K.color),seriesLabels:b?.map(K=>K.label),rateLabels:C?{total:z("trainingStatus.today.tooltipTotal","\uC804\uCCB4"),done:z("trainingStatus.today.tooltipDone","\uC644\uB8CC")}:void 0,grouped:I})})}const _u=120,Zv={left:38,right:16,top:26,bottom:24};function Xv({points:e=[],range:t,ticks:a=[],axisTitle:r,color:i,height:s=156,fallbackWidth:l=320,insets:u,overlay:c,ariaLabel:d,className:m}){const[p,f]=o.useState(null),[y,x]=o.useState(null);o.useEffect(()=>{if(!y)return;const $=q=>f(Math.round(q)||null);if($(y.getBoundingClientRect().width),typeof ResizeObserver>"u")return;const Z=new ResizeObserver(([q])=>$(q.contentRect.width));return Z.observe(y),()=>{Z.disconnect()}},[y]);const{payload:C,anchorRect:h,openAfterDelay:_,close:g}=Qy(_u),A=o.useCallback(($,Z)=>{$&&_($,Z.getBoundingClientRect())},[_]),b=p??l,k=s,{left:v,right:w,top:B,bottom:E}={...Zv,...u},[D,N]=t,O=$=>N===D?v:v+(b-v-w)*($-D)/(N-D),P=$=>B+(k-B-E)*(100-$)/100,G={x:O,y:P,plot:{left:v,right:b-w,top:B,bottom:k-E,width:Math.max(0,b-v-w),height:Math.max(0,k-B-E)}},L=e.filter($=>!$.hollow),M=i??"var(--color-main)";return n.jsxs(n.Fragment,{children:[n.jsxs("svg",{ref:x,className:_e("line-chart",m),viewBox:`0 0 ${b} ${k}`,role:"img","aria-label":d??e.map($=>$.description).filter(Boolean).join(", "),children:[r&&n.jsx("text",{className:"line-chart__axis-title",x:0,y:12,children:r}),[0,100].map($=>n.jsxs("g",{children:[n.jsx("line",{className:"line-chart__grid",x1:v,x2:b-w,y1:P($),y2:P($)}),n.jsxs("text",{className:"line-chart__tick",x:v-6,y:P($)+4,textAnchor:"end",children:[$,"%"]})]},$)),c?.(G),a.map($=>n.jsx("text",{className:"line-chart__tick",x:O($.x),y:k-5,textAnchor:"middle",children:$.label},$.x)),L.length>1&&n.jsx("polyline",{className:"line-chart__line",fill:"none",stroke:M,points:L.map($=>`${O($.x)},${P($.pct)}`).join(" ")}),e.map($=>n.jsxs("g",{className:"line-chart__dot",onPointerEnter:Z=>A($.description,Z.currentTarget),onPointerLeave:g,children:[n.jsx("circle",{className:"line-chart__dot-hit",cx:O($.x),cy:P($.pct),r:12}),n.jsx("circle",{className:_e("line-chart__dot-main",$.hollow&&"is-hollow"),cx:O($.x),cy:P($.pct),r:4,stroke:M,fill:$.hollow?void 0:M})]},$.x))]}),C!=null&&n.jsx(cn,{anchorRect:h,offset:10,closeOnOutsideClick:!1,className:"line-chart__tip",role:"tooltip",ariaLabel:C,children:C})]})}function Jv({icon:e,iconSize:t=56,title:a,titleClass:r="h2",description:i,tipGroups:s,start:l,className:u}){return n.jsxs("div",{className:_e("game-intro",u),children:[e!=null&&n.jsx("span",{className:"game-intro__icon","aria-hidden":"true",style:{"--game-intro-icon":`${t}px`},children:e}),n.jsx("h2",{className:_e("game-intro__title",r),children:a}),i!=null&&n.jsx("p",{className:"game-intro__description body-3",children:i}),s?.map((c,d)=>n.jsxs("div",{className:"game-intro__tips",children:[c.title!=null&&n.jsx("span",{className:"game-intro__tips-title body-3",children:c.title}),c.tips.map((m,p)=>n.jsxs("span",{className:"game-intro__tip body-3",children:[m.icon!=null&&n.jsx("span",{"aria-hidden":"true",children:m.icon}),n.jsx("span",{children:m.text})]},p))]},d)),l&&n.jsx(pe,{htmlType:"button",className:l.className,variant:"main",color:l.color,size:48,width:"100%",disabled:l.disabled,onClick:l.onClick,children:l.label})]})}const wu=(e,t,a)=>{const r=new Date(Date.UTC(e,t,a));return`${r.getUTCFullYear()}-${String(r.getUTCMonth()+1).padStart(2,"0")}-${String(r.getUTCDate()).padStart(2,"0")}`},Bu=(e,t,a,r)=>({from:Li(e,t,a),to:new Date(Li(e,t,a+r).getTime()-1),fromYmd:wu(e,t,a),toYmd:wu(e,t,a+r-1)});function Qv(e,t=0){if(e.period==="month"){const i=ca(e.monthRange),s=ra(),l=i?i.year:s.getFullYear(),u=(i?i.month1:s.getMonth()+1)-1+t,c=new Date(Date.UTC(l,u+1,0)).getUTCDate();return Bu(l,u,1,c)}const a=e.weekRanges.find(i=>i.value===e.weekRange);if(!a){const i=new Date,s=Ea();return{from:i,to:i,fromYmd:s,toYmd:s}}const r=bn(a.year,a.month-1);return Bu(a.year,a.month-1,r+(a.week+t)*7,7)}const Io={small:{diameter:96,strokeWidth:16},medium:{diameter:120,strokeWidth:18},large:{diameter:160,strokeWidth:22}};function ku(e){return!Number.isFinite(e)||e<=0?0:e>=1?100:Math.min(99,Math.max(1,Math.round(e*100)))}function Au({done:e,total:t,segments:a,color:r="var(--color-main)",size:i="medium",strokeWidth:s,label:l="%",hideCenter:u=!1,hideLabel:c=!1}){const d=typeof i=="number"?i:Io[i].diameter,m=s??(typeof i=="number"?12:Io[i].strokeWidth),p=d/2,f=(d-m)/2,y=2*Math.PI*f;if(a&&a.length>0){const _=a.reduce((g,A)=>{const b=g.length>0?g[g.length-1].acc:0,k=Number.isFinite(A.ratio)?A.ratio:0,v=Math.max(0,Math.min(k,1-b));return g.push({color:A.color,rotate:-90+b*360,dash:y*v,acc:b+v}),g},[]);return n.jsx("div",{className:"ring-chart",style:{width:d,height:d},children:n.jsxs("svg",{width:d,height:d,viewBox:`0 0 ${d} ${d}`,"aria-hidden":"true",children:[n.jsx("circle",{cx:p,cy:p,r:f,fill:"none",stroke:"var(--color-whiteLine)",strokeWidth:m}),_.map((g,A)=>g.dash>0&&n.jsx("circle",{cx:p,cy:p,r:f,fill:"none",stroke:g.color,strokeWidth:m,strokeDasharray:`${g.dash} ${y}`,strokeLinecap:"round",transform:`rotate(${g.rotate} ${p} ${p})`},A))]})})}const x=(t??0)>0?Math.min((e??0)/t,1):0,C=y*x,h=y-C;return n.jsxs("div",{className:"ring-chart",style:{width:d,height:d},children:[n.jsxs("svg",{width:d,height:d,viewBox:`0 0 ${d} ${d}`,"aria-hidden":"true",children:[n.jsx("circle",{cx:p,cy:p,r:f,fill:"none",stroke:"var(--color-whiteLine)",strokeWidth:m}),x>0&&n.jsx("circle",{cx:p,cy:p,r:f,fill:"none",stroke:r,strokeWidth:m,strokeDasharray:`${C} ${h}`,strokeLinecap:x<.02||x>.98?"butt":"round",transform:`rotate(-90 ${p} ${p})`})]}),!u&&n.jsxs("div",{className:`ring-chart__center${c?"":` ${d<=96?"ring-chart__center--small":i==="medium"?"ring-chart__center--medium":"ring-chart__center--large"}`}`,children:[n.jsx("span",{className:`ring-chart__pct ${d<=96?"h2":"h1"}`,children:ku(x)}),!c&&n.jsx("span",{className:`ring-chart__label ${d<=96?"caption-2":"caption-1"}${d<=96||i==="medium"?" ring-chart__label--tight":""}`,children:l})]})]})}function e4({titleKey:e,titleLevel:t,headRight:a,icon:r,showTotal:i,totalLabelKey:s,legend:l,loading:u,className:c,inGrid:d=!1,onClick:m,ariaLabel:p,tooltip:f,...y}){const{t:x}=xe.useTranslation();if(!e)return n.jsx(Au,{...y});const C=(y.total??0)>0?ku(Math.min((y.done??0)/y.total,1)):0,h=y.size==="small",_=typeof y.size=="number"?y.size:Io[y.size??"medium"].diameter,g=y.size==="large",A=[c,h?"manager-section--compact":g?"manager-section--full":""].filter(Boolean).join(" ")||void 0,b=r&&n.jsx("span",{className:"chart-section-icon",children:n.jsx(at,{icon:r,className:"chart-section-icon-inner"})});return n.jsx(Lo,{className:A,inGrid:d,onClick:m,ariaLabel:p,tooltip:f,title:x(e),titleLevel:t,titleClassName:h?"h5 chart-section-title--small":void 0,headRight:b||(h?void 0:a),subRow:(i||l)&&n.jsxs(n.Fragment,{children:[i?n.jsxs(Wa,{label:!h&&s?x(s):void 0,children:[n.jsx("span",{className:"barchart-total__num h0",children:C}),n.jsx("span",{className:"barchart-total__unit h5",children:"%"})]}):n.jsx("span",{}),l&&n.jsx(Mo,{items:l})]}),children:u?n.jsx("div",{className:"ring-chart-section-body ring-chart-section-body--offset",children:n.jsx("div",{className:"ring-chart ring-chart--loading",style:{width:_,height:_},"aria-busy":"true",children:n.jsx(za,{size:32})})}):n.jsx("div",{className:"ring-chart-section-body ring-chart-section-body--offset",children:n.jsx(Au,{...y,hideCenter:y.hideCenter??h})})})}function t4({label:e,value:t,change:a,changeType:r,icon:i,tooltip:s,onClick:l,children:u}){const c=o.useRef(null),{anchorRect:d,openAt:m,close:p}=Ta(),f=o.useCallback(()=>{s&&c.current&&m(c.current)},[s,m]),y=r??(a===void 0?void 0:a>0?"up":a<0?"down":"neutral"),x=a===void 0?void 0:a>0?`+${a}`:`${a}`,C=o.useCallback(h=>{l&&(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),l())},[l]);return n.jsxs("div",{ref:c,className:`manager-stat-card${l?" manager-stat-card--clickable":""}`,onClick:l,onKeyDown:l?C:void 0,onPointerEnter:f,onPointerLeave:p,onFocus:f,onBlur:p,role:l?"button":void 0,tabIndex:l?0:void 0,"aria-label":l?[e,t,x].filter(h=>h!==void 0&&h!=="").join(" "):void 0,children:[s&&d&&n.jsx(Bn,{anchorRect:{left:d.left,top:d.top+21,right:d.right,bottom:d.bottom,width:d.width,height:d.height},text:s}),n.jsxs("div",{className:"manager-stat-card__label-row",children:[n.jsx("span",{className:"manager-stat-card__label h5",children:e}),i&&n.jsx("span",{className:"manager-stat-card__icon",children:n.jsx(at,{icon:i,className:"manager-stat-card__icon-inner"})})]}),n.jsxs("div",{className:"manager-stat-card__content",children:[n.jsxs("div",{className:"manager-stat-card__left",children:[n.jsx("div",{className:"manager-stat-card__value h2",children:t}),x&&n.jsx("div",{className:`manager-stat-card__change manager-stat-card__change--${y??"neutral"} caption-1`,children:x})]}),u&&n.jsx("div",{className:"manager-stat-card__body",children:u})]})]})}function Nu({value:e,onChange:t,min:a=0,max:r=100,step:i=1,orientation:s="horizontal",size:l=24,disabled:u=!1,ariaLabel:c,length:d,className:m,label:p,formatValue:f,labelPos:y,labelAlign:x="right",showMinMax:C=!1,minLabel:h,maxLabel:_,showBgTick:g=!1,showFillTick:A=!1,tickStep:b,tickShape:k="dot"}){t&&!c&&St("Slider:unnamed","[ihab/Slider] \uC774\uB984\uC774 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 ariaLabel \uC744 \uC8FC\uC138\uC694. label prop \uC740 \uAC12 \uD45C\uAE30 \uBC29\uC2DD\uC774\uC9C0 \uC774\uB984\uC774 \uC544\uB2D9\uB2C8\uB2E4.");const v=Math.min(r,Math.max(a,e)),w=r>a?(v-a)/(r-a):0,B=s==="vertical",E=!t,D=W=>t?.(Number(W.target.value)),N=typeof d=="number"?`${d}px`:d,O={"--slider-ratio":String(w),"--slider-thumb":`${l}px`,...N?B?{height:N}:{width:N}:{}},P=b??i,G=(g||A)&&P>0&&r>a?Math.floor((r-a)/P+1e-6):0;if(G>0&&G<=100){const W=k!=="dash",I=re=>W?`radial-gradient(circle, ${re} 0.5px, transparent 1px)`:B?`linear-gradient(to bottom, transparent calc(50% - 2px), ${re} calc(50% - 2px), ${re} calc(50% + 2px), transparent calc(50% + 2px))`:`linear-gradient(to right, transparent calc(50% - 2px), ${re} calc(50% - 2px), ${re} calc(50% + 2px), transparent calc(50% + 2px))`,S=W?"2px":"4px",j=[],F=[],U=[];for(let re=0;re<=G;re++){const ne=re*P/(r-a);if(ne>1+1e-6)break;const le=`${((B?1-ne:ne)*100).toFixed(4)}%`,K=ne<=w+1e-6;if(K?!A:!g)continue;const oe=K?"var(--slider-tick-color-on-fill, var(--color-deepWhite))":"var(--slider-tick-color, var(--color-lightGray))";j.push(I(oe)),F.push(B?`${S} var(--slider-thumb)`:`var(--slider-thumb) ${S}`),U.push(B?`center ${le}`:`${le} center`)}j.push(B?"linear-gradient(to top, var(--slider-fill-color) var(--slider-fill), var(--color-darkWhite) var(--slider-fill))":"linear-gradient(to right, var(--slider-fill-color) var(--slider-fill), var(--color-darkWhite) var(--slider-fill))"),F.push("100% 100%"),U.push("0 0"),O.backgroundImage=j.join(", "),O.backgroundSize=F.join(", "),O.backgroundPosition=U.join(", "),O.backgroundRepeat="no-repeat"}const L=f?f(v):p==="percent"?`${Math.round(r>a?(v-a)/(r-a)*100:0)}%`:p==="count"?`${v} / ${r}`:v===a&&h?h:v===r&&_?_:void 0,M=n.jsx("input",{type:"range",className:_e("slider",`slider--${s}`,E&&"slider--static",!p&&!C&&m),min:a,max:r,step:i,value:v,disabled:u,readOnly:E,tabIndex:E?-1:void 0,"aria-label":c,"aria-valuetext":L,"aria-orientation":s,onChange:D,style:O});if(!p&&!C)return M;const $=n.jsx("span",{className:"slider-wrap__minmax caption-1",children:h??a}),Z=n.jsx("span",{className:"slider-wrap__minmax caption-1",children:_??r}),q=C?n.jsxs("div",{className:_e("slider-track-group",`slider-track-group--${s}`,!p&&m),children:[B?Z:$,M,B?$:Z]}):M;if(!p)return q;const z=y??(B?"bottom":"right"),V=`${Math.round(r>a?(v-a)/(r-a)*100:0)}%`,R=f?f(v):p==="percent"?V:p==="count"?`${v} / ${r}`:String(v),H=n.jsx("span",{className:"slider-wrap__value body-3b",children:R});return n.jsxs("div",{className:_e("slider-wrap",`slider-wrap--${s}`,`slider-wrap--label-${z}`,`slider-wrap--align-${x}`,m),children:[q,H]})}const n4=.86,a4=250,Fo=(e,t,a,r)=>Math.round(Math.min(r,Math.max(a,e-t))),Oo=(e,t,a,r)=>{const i=Fo(e,t,a,r);return`${i<0?"-":"+"}${Math.abs(i)} dB`};function zo({analyser:e,audioElement:t,orientation:a="horizontal",length:r,label:i,labelPos:s,labelAlign:l="right",floorDb:u=-60,refDb:c=-35,displayMin:d=-5,displayMax:m=25,className:p,ariaLabel:f}){const y=o.useRef(null),x=o.useRef(null),C=o.useRef(null),h=o.useRef(null),[_,g]=o.useState(null);o.useEffect(()=>{const v=M=>{const $=Oo(M,c,d,m);C.current&&(C.current.textContent=$);const Z=y.current;Z&&(Z.setAttribute("aria-valuenow",String(Fo(M,c,d,m))),Z.setAttribute("aria-valuetext",$))},w=e??zf(t)??(_&&_.el===t?_.node:null),B=x.current;if(!w||!B){B?.style.setProperty("--meter-level","0"),v(u);let M=!1;return!e&&t&&Ya(t).then($=>{!M&&$&&g({el:t,node:$})}),()=>{M=!0}}Jr();const E=new Float32Array(w.fftSize);let D=0,N=0,O=0,P=0,G=null;const L=M=>{const $=Wf(w,E);D=$>D?$:D*n4;const Z=D>1e-5?20*Math.log10(D):-1/0,q=Math.max(u,Z),z=q-c,V=Math.min(1,Math.max(0,(z-d)/(m-d)));if(B.style.setProperty("--meter-level",V.toFixed(3)),N+=q,O+=1,M-P>=a4){const R=N/O;G=G==null?R:G*.6+R*.4,v(G),N=0,O=0,P=M}h.current=requestAnimationFrame(L)};return h.current=requestAnimationFrame(L),()=>{h.current!=null&&cancelAnimationFrame(h.current),h.current=null}},[e,t,_,u,c,d,m]);const A=typeof r=="number"?`${r}px`:r,b=n.jsx("div",{className:"audio-meter__track",style:A?a==="vertical"?{height:A}:{width:A}:{},children:n.jsx("div",{ref:x,className:"audio-meter__fill"})}),k=s??(a==="vertical"?"bottom":"right");return n.jsxs("div",{ref:y,className:_e("audio-meter",`audio-meter--${a}`,i&&`audio-meter--label-${k}`,i&&`audio-meter--align-${l}`,p),role:"meter","aria-label":f,"aria-valuemin":d,"aria-valuemax":m,"aria-valuenow":Fo(u,c,d,m),"aria-valuetext":Oo(u,c,d,m),children:[b,i&&n.jsx("span",{ref:C,className:"audio-meter__value caption-2",children:Oo(u,c,d,m)})]})}const Eu=260;function Du({message:e,position:t,duration:a,onClose:r}){const[i,s]=o.useState(!1),[l,u]=o.useState(!1),c=o.useRef(l),d=o.useRef(i);o.useEffect(()=>{c.current=l},[l]),o.useEffect(()=>{d.current=i},[i]);const m=o.useRef(null),p=o.useRef(""),f=o.useRef(r);o.useEffect(()=>{f.current=r});const y=a,x=o.useRef(null),C=o.useRef(0),h=o.useRef(0),_=o.useRef(!1),g=o.useRef(null),A=o.useRef(null),b=o.useRef(null),k=o.useRef(null),v=o.useRef(()=>{});v.current=E=>{E<0||(C.current=Date.now(),h.current=E,x.current=setTimeout(()=>{x.current=null,s(!1),g.current=setTimeout(()=>{u(!1);try{f.current()}catch{}},Eu)},E))};const w=o.useCallback(()=>{_.current||!x.current||(_.current=!0,clearTimeout(x.current),x.current=null,h.current=Math.max(0,h.current-(Date.now()-C.current)))},[]),B=o.useCallback(()=>{_.current&&(_.current=!1,v.current(h.current))},[]);return o.useEffect(()=>{if(e!==p.current&&(x.current&&(clearTimeout(x.current),x.current=null),g.current&&(clearTimeout(g.current),g.current=null)),e){if(d.current)return y>0&&!x.current&&(_.current?h.current=y:v.current(y)),p.current=e,()=>{x.current&&(clearTimeout(x.current),x.current=null),g.current&&(clearTimeout(g.current),g.current=null)};const E=()=>{const D=m.current;if(D)try{D.classList.remove("is-visible"),D.style.transition="none",t==="top"?D.style.transform="translateX(-50%) translateY(-16px)":D.style.transform="translateX(-50%) translateY(16px)",D.style.opacity="0",D.offsetWidth,D.style.transition="",D.classList.add("is-visible"),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>{k.current=null;try{D.style.opacity="",D.style.transform="",D.style.transition=""}catch{}},60)}catch{}};c.current?(E(),s(!0)):(u(!0),A.current=requestAnimationFrame(()=>{b.current=requestAnimationFrame(()=>{E(),s(!0)})})),y>0&&(_.current=!1,v.current(y))}else s(!1),g.current=setTimeout(()=>u(!1),Eu);return p.current=e,()=>{x.current&&clearTimeout(x.current),g.current&&clearTimeout(g.current),A.current&&cancelAnimationFrame(A.current),b.current&&cancelAnimationFrame(b.current),k.current&&clearTimeout(k.current),x.current=null,g.current=null,A.current=null,b.current=null,k.current=null}},[e,y,t]),{mounted:l,showing:i,popupRef:m,pause:w,resume:B}}function da({message:e="",position:t="top",type:a="normal",onClose:r=()=>{},duration:i=2e3}){const{mounted:s,showing:l,popupRef:u,pause:c,resume:d}=Du({message:e,position:t,duration:i,onClose:r}),m=o.useRef(null),[p,f]=o.useState(!1);if(o.useEffect(()=>{l?f(!0):s||f(!1)},[l,s]),!s)return null;const y=a==="notice"||a==="warning"?a:"normal",x=n.jsx("div",{ref:u,className:`toast toast--${t} ${l?"is-visible":""}`,role:"status","aria-live":"polite",onPointerEnter:C=>{m.current=C.pointerType},onMouseEnter:()=>{m.current!=="touch"&&c()},onMouseLeave:d,onFocusCapture:c,onBlurCapture:d,children:n.jsx("div",{className:`toast__inner toast__inner--${y} body-2`,"aria-hidden":p||l?void 0:!0,children:n.jsx("span",{className:"toast__text",children:e})})});return typeof document<"u"?en.createPortal(x,document.body):x}const r4=24;function o4({value:e,max:t=100,size:a=8,color:r,trackColor:i,label:s,formatValue:l,labelPos:u,labelAlign:c="right",ariaLabel:d,className:m}){const p=Number.isFinite(t)&&t>0?t:1,f=Math.max(0,Math.min(Number.isFinite(e)?e:0,p)),y=f/p*100,x=Number.isFinite(t)&&t>0?t:0,C=u??(a>=r4?"inside":"bottom"),h=C==="center"?"inside":C,_=h==="inside"&&(c==="left"?y>=15:c==="center"?y>=50:y>=85),g={};return r&&(g["--progress-bar-fill"]=r),i&&(g["--progress-bar-track"]=i),n.jsxs("div",{className:_e("progress-bar",`progress-bar--${a}`,`progress-bar--label-${h}`,s&&`progress-bar--align-${c}`,s&&_&&"progress-bar--label-on-fill",m),style:g,children:[n.jsx("div",{className:"progress-bar__track",role:"progressbar","aria-valuenow":f,"aria-valuemin":0,"aria-valuemax":x,"aria-valuetext":s?l?l(f):s==="percent"?void 0:s==="raw"?String(f):`${f} / ${x}`:void 0,"aria-label":d,children:n.jsx("div",{className:"progress-bar__fill",style:{width:`${y}%`}})}),s&&n.jsx("span",{className:"progress-bar__label caption-1b",children:l?l(f):s==="percent"?`${Math.round(y)}%`:s==="raw"?String(f):`${f} / ${x}`})]})}const Su={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},s4="rgba(255, 255, 255, 0.16)";function Tu({max:e,index:t,inactiveBg:a,inactiveColor:r,transparent:i,variant:s="numbered",announce:l=!1,ariaLabel:u}){const{t:c}=xe.useTranslation(),d=ln("(max-width: 767px)");if(!Number.isInteger(e)||e<=0)return null;const m=Number.isInteger(t)?Math.max(0,Math.min(t,e-1)):0,p=u??c("progress.steps",{current:m+1,total:e,defaultValue:"\uC9C4\uD589 \uB2E8\uACC4 {{current}} / {{total}}"}),f={};if(a&&(f["--pi-inactive-bg"]=a),r&&(f["--pi-inactive-color"]=r),i&&(a||(f["--pi-inactive-bg"]=s4),r||(f["--pi-inactive-color"]="var(--color-white)")),s==="dot")return n.jsxs("div",{className:"progress-indicator progress-indicator--dot",style:f,role:l?"status":"img","aria-label":l?void 0:p,children:[l&&n.jsx("span",{style:Su,children:p}),Array.from({length:e}).map((x,C)=>n.jsx("span",{"aria-hidden":"true",className:`progress-indicator-dot--dot${C<m?" done":C===m?" active":""}`},C))]});const y=l?n.jsx("span",{role:"status",style:Su,children:p}):null;return d?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"progress-indicator progress-indicator--mobile",style:f,role:"list","aria-label":p,children:n.jsxs("span",{role:"listitem",className:"progress-indicator-dot active body-3",children:[m+1," / ",e]})}),y]}):n.jsxs(n.Fragment,{children:[y,n.jsx("div",{className:"progress-indicator",style:f,role:"list","aria-label":p,children:Array.from({length:e}).map((x,C)=>n.jsx("span",{role:"listitem","aria-current":C===m?"step":void 0,className:`progress-indicator-dot ${C<m?" done":C===m?" active":""} body-3`,children:C+1},C))})]})}function i4(e){if(!e)return[];const t=[];let a=0,r="";for(const i of e.trim()){if(i==="("?a++:i===")"&&a--,/\s/.test(i)&&a===0){r&&(t.push(r),r="");continue}r+=i}return r&&t.push(r),t}function l4({children:e,className:t,style:a,rowLabel:r,onRowClick:i}){return n.jsx("div",{role:"cell",className:t?`table-cell ${t}`:"table-cell",style:a,children:r&&i?n.jsx("button",{type:"button",className:"table-cell__row-button","aria-label":r,children:e}):e})}function Wo({variant:e="default",children:t,className:a,draggable:r,onClick:i,onMouseEnter:s,onMouseLeave:l,onDragStart:u,onDragEnd:c,expandedContent:d,colSpan:m,describedBy:p,rowHasButton:f}){const y=o.useCallback(x=>{i&&x.target===x.currentTarget&&(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),i())},[i]);return e==="loading"?n.jsx("div",{role:"presentation",className:"table-row-wrap",children:n.jsx("div",{role:"row",className:"table-row table-row--loading",children:n.jsx("div",{role:"cell","aria-colspan":m,className:"table-row__full-cell",children:n.jsx(za,{size:28})})})}):e==="empty"?n.jsx("div",{role:"presentation",className:"table-row-wrap",children:n.jsx("div",{role:"row",className:"table-row table-row--empty body-3",children:n.jsx("div",{role:"cell","aria-colspan":m,className:"table-row__full-cell",children:t})})}):n.jsxs("div",{role:"presentation",className:"table-row-wrap",children:[n.jsx("div",{className:a?`table-row ${a}`:"table-row",draggable:r,onClick:i,onKeyDown:i?y:void 0,onMouseEnter:s,onMouseLeave:l,onDragStart:u,onDragEnd:c,role:"row",tabIndex:i&&!f?0:void 0,"aria-describedby":i&&!f?p:void 0,children:t}),d&&n.jsx("div",{role:"row",className:"table-row-expand",children:n.jsx("div",{role:"cell","aria-colspan":m,className:"table-row-expand__cell",children:d})})]})}function u4({dir:e}){return n.jsx(e==="asc"?Vs:Hs,{className:"table-field__sort-arrow",size:16,strokeWidth:2})}function c4({children:e,onClick:t,className:a,sortDir:r,ariaSort:i,onResizeStart:s}){const l=n.jsxs(n.Fragment,{children:[e,r&&n.jsx(u4,{dir:r})]});return n.jsxs("div",{onClick:t,role:"columnheader","aria-sort":i,className:_e("table-field body-3",a,r?"table-field--sorted":"",s?"table-field--resizable":""),children:[t?n.jsx("button",{type:"button",className:"table-field__button",children:l}):l,s&&n.jsx("span",{className:"table-field__resizer",onPointerDown:s,onClick:u=>u.stopPropagation(),"aria-hidden":"true"})]})}function Ho({fields:e=[],headerGroups:t,items:a=[],renderRow:r,onRowClick:i,isRowClickable:s,onRowMouseEnter:l,onRowMouseLeave:u,onRowDragStart:c,onRowDragEnd:d,draggingId:m,gridTemplateColumns:p,mobileGridTemplateColumns:f,resizable:y=!1,resizeMode:x="grow",resizeStorageKey:C,size:h="small",title:_,icon:g,count:A,collapsed:b=!1,onToggleCollapse:k,headerActions:v,empty:w,loading:B,dragOver:E=!1,onDragOver:D,onDragLeave:N,onDrop:O,renderExpandedRow:P,expandedId:G}){const{t:L}=xe.useTranslation(),M=o.useId(),$=`table-title-${M}`,Z=`table-row-hint-${M}`,q=ln("(max-width: 767px)"),z=f&&q?f:null,V=y&&!q,R=48,H=o.useRef(()=>R),W=C?`table-cols:${C}`:null,I=o.useRef(null),S=o.useRef(null),j=o.useRef(null),F=o.useRef(null),[U,re]=o.useState(!1),[ne,le]=o.useState(0),K=o.useCallback(()=>{const se=j.current;se&&(re(se.scrollWidth>se.clientWidth+1),le(se.clientWidth))},[]),oe=o.useCallback((se,Ne)=>{const We=se.current;We&&S.current&&S.current.unobserve(We),se.current=Ne,Ne?(!S.current&&typeof ResizeObserver<"u"&&(S.current=new ResizeObserver(()=>K())),S.current?.observe(Ne)):!j.current&&!F.current&&(S.current?.disconnect(),S.current=null),K()},[K]),Ae=o.useCallback(se=>oe(j,se),[oe]),Y=o.useCallback(se=>oe(F,se),[oe]);o.useEffect(()=>{K()}),o.useEffect(()=>{if(typeof window>"u")return;const se=typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>K()):null;return window.addEventListener("resize",K),()=>{se!=null&&cancelAnimationFrame(se),window.removeEventListener("resize",K)}},[K]);const Q=o.useRef(()=>!1),me=o.useRef([]),De=o.useRef(null),be=se=>{if(!se||typeof window>"u")return null;try{const Ne=JSON.parse(window.localStorage.getItem(se)??"null");return Array.isArray(Ne)&&Ne.length>0&&Ne.every(We=>typeof We=="number"&&Number.isFinite(We)&&We>0)?Ne:null}catch{return null}},[te,ue]=o.useState(()=>be(W)),[fe,ge]=o.useState(W),[Ce,$e]=o.useState(()=>be(W)!==null);if(fe!==W){ge(W);const se=be(W);ue(se),$e(se!==null)}const He=o.useRef(te);o.useEffect(()=>{He.current=te},[te]);const Te=o.useCallback(se=>{const Ne=De.current;if(!Ne)return;const We=He.current;if(We){const nt=[...We];if(Ne.next!=null&&Ne.startWNext!=null){const Fe=se.clientX-Ne.startX,Ge=Math.max(H.current(Ne.index)-Ne.startW,Math.min(Ne.startWNext-H.current(Ne.next),Fe));nt[Ne.index]=Ne.startW+Ge,nt[Ne.next]=Ne.startWNext-Ge}else nt[Ne.index]=Math.max(H.current(Ne.index),Ne.startW+(se.clientX-Ne.startX));He.current=nt,ue(nt)}},[]),Ie=o.useCallback(()=>{if(De.current=null,window.removeEventListener("pointermove",Te),window.removeEventListener("pointerup",Ie),window.removeEventListener("pointercancel",Ie),document.body.style.cursor="",document.body.style.userSelect="",W&&He.current)try{window.localStorage.setItem(W,JSON.stringify(He.current))}catch{}},[Te,W]),qe=o.useCallback((se,Ne)=>{Ne.preventDefault(),Ne.stopPropagation();const We=I.current;if(!We)return;const nt=Array.from(We.children).map(Ge=>Ge.getBoundingClientRect().width),Fe=x==="fit"?e.findIndex((Ge,bt)=>bt>se&&Ge.resizable!==!1):-1;De.current=Fe>=0?{index:se,startX:Ne.clientX,startW:nt[se],next:Fe,startWNext:nt[Fe]}:{index:se,startX:Ne.clientX,startW:nt[se]},He.current=nt,ue(nt),$e(!0),window.addEventListener("pointermove",Te),window.addEventListener("pointerup",Ie),window.addEventListener("pointercancel",Ie),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[Te,Ie,x,e]),mt=o.useCallback(()=>{const se=I.current,Ne=se?.closest(".table-wrap");if(!se||!Ne)return null;const We=Ne.style.getPropertyValue("--table-grid-cols");Ne.style.setProperty("--table-grid-cols",e.map((et,ot)=>Q.current(ot)?me.current[ot]:"max-content").join(" "));const nt=Array.from(Ne.querySelectorAll(".table-row")).filter(et=>!et.classList.contains("table-row--loading")&&!et.classList.contains("table-row--empty")),Fe=e.map((et,ot)=>{let lt=se.children[ot]?.getBoundingClientRect().width??0;for(const jt of nt){const Wt=jt.children[ot];Wt&&(lt=Math.max(lt,Wt.getBoundingClientRect().width))}const st=Q.current(ot)?parseFloat(me.current[ot]):NaN;return Number.isFinite(st)?st:Math.max(H.current(ot),Math.ceil(lt))}),Ge=window.getComputedStyle(se),bt=se.clientWidth-(parseFloat(Ge.paddingLeft)||0)-(parseFloat(Ge.paddingRight)||0);We?Ne.style.setProperty("--table-grid-cols",We):Ne.style.removeProperty("--table-grid-cols");let Re=Fe;const tt=Fe.reduce((et,ot,lt)=>et+(Q.current(lt)?ot:0),0),xt=Fe.reduce((et,ot,lt)=>et+(Q.current(lt)?0:ot),0),Lt=bt-tt;if(bt>0&&xt>0&&Lt>0){const et=Lt/xt;Re=Fe.map((lt,st)=>Q.current(st)?lt:Math.max(H.current(st),Math.round(lt*et)));const ot=Math.round(Lt-Re.reduce((lt,st,jt)=>lt+(Q.current(jt)?0:st),0));if(ot!==0){let lt=-1;Re.forEach((st,jt)=>{!Q.current(jt)&&(lt<0||st>Re[lt])&&(lt=jt)}),lt>=0&&(Re[lt]=Math.max(H.current(lt),Re[lt]+ot))}}return Re},[e,x]),ct=(se,Ne)=>se!==null&&se.length===Ne.length&&se.every((We,nt)=>We===Ne[nt]),rt=o.useRef(mt);o.useEffect(()=>{rt.current=mt});const[ft,ke]=o.useState(0),Ve=a.length>0,we=`${W??""}|${ft}|${e.length}|${ne}`,Ue=!Ce&&V&&W!==null&&!B?`${we}|${Ve?1:0}`:null,Be=o.useRef(null);o.useEffect(()=>{if(Ue===null||!Ve||Be.current===we)return;const se=rt.current();se&&(Be.current=we,ue(Ne=>ct(Ne,se)?Ne:se))},[Ue]);const je=o.useCallback(()=>{if(W)try{window.localStorage.removeItem(W)}catch{}$e(!1);const se=rt.current();ue(se),He.current=se,ke(Ne=>Ne+1)},[W]);o.useEffect(()=>()=>{De.current&&(window.removeEventListener("pointermove",Te),window.removeEventListener("pointerup",Ie),window.removeEventListener("pointercancel",Ie),document.body.style.cursor="",document.body.style.userSelect="")},[Te,Ie]);const Se=i4(p),Xe=Se.filter(se=>/\b(auto|min-content|max-content)\b|fit-content\(/.test(se));Xe.length>0&&St(`table-content-track:${p}`,`[ihabdevteam-core] Table \uC758 gridTemplateColumns \uC5D0 \uB0B4\uC6A9\uC73C\uB85C \uD06C\uAE30\uAC00 \uC815\uD574\uC9C0\uB294 \uD2B8\uB799(${Xe.join(", ")})\uC774 \uC788\uC2B5\uB2C8\uB2E4. \uBA38\uB9AC\uC640 \uBAB8\uD1B5\uC740 \uC11C\uB85C \uB2E4\uB978 \uACA9\uC790\uB77C \uADF8 \uD2B8\uB799\uC774 \uAC01\uC790 \uB2E4\uB974\uAC8C \uD480\uB824 \uC5F4\uC774 \uC5B4\uAE0B\uB0A9\uB2C8\uB2E4. px \uC774\uB098 fr \uC744 \uC4F0\uC138\uC694. (\uBC1B\uC740 \uAC12: ${p})`);const Qe=e.findIndex(se=>!!se.sortDir);e.filter(se=>!!se.sortDir).length>1&&St("table-multi-sort","[ihabdevteam-core] Table \uC758 fields \uC5D0 sortDir \uC774 \uB458 \uC774\uC0C1 \uC788\uC2B5\uB2C8\uB2E4. aria-sort \uB294 \uD45C \uD558\uB098\uC5D0 \uD55C \uCE78\uB9CC \uAC00\uC9C8 \uC218 \uC788\uC5B4 \uCCAB \uCE78\uB9CC \uBC29\uD5A5\uC73C\uB85C \uC54C\uB9AC\uACE0 \uB098\uBA38\uC9C0\uB294 none \uC73C\uB85C \uB461\uB2C8\uB2E4.");const dt=se=>se===Qe?e[se].sortDir==="asc"?"ascending":"descending":e[se].onClick?"none":void 0,ht=se=>/^\d+(\.\d+)?px$/.test(Se[se]??""),wt=se=>{const Ne=Se[se]??"",We=/^minmax\(\s*(\d+(?:\.\d+)?)px\s*,/.exec(Ne)??/^(\d+(?:\.\d+)?)px$/.exec(Ne);return We?parseFloat(We[1]):R};Q.current=ht,H.current=wt,me.current=Se;const Ct=se=>x==="fit"&&!ht(se)?"fr":"px",Nt=te&&te.length===e.length&&!q,gt=z??(Nt?e.map((se,Ne)=>se.resizable===!1&&Se[Ne]?Se[Ne]:`${te[Ne]}${Ct(Ne)}`).join(" "):p),it=gt?{"--table-grid-cols":gt}:void 0,Ke=_!==void 0;return n.jsxs("div",{ref:Ae,className:`table-wrap table-wrap--${h}${V?" table-wrap--resizable":""}${E?" table-wrap--dragover":""}${b?" table-wrap--collapsed":""}`,style:it,onDragOver:D,onDragLeave:N,onDrop:O,tabIndex:U?0:void 0,role:U?"region":void 0,"aria-label":U?typeof _=="string"?_:L("table.scrollRegion","\uAC00\uB85C\uB85C \uAD74\uB9B4 \uC218 \uC788\uB294 \uD45C"):void 0,children:[!!i&&n.jsx("span",{id:Z,className:"table-row-hint",children:L("table.rowActionHint","\uC904\uC744 \uB204\uB974\uBA74 \uC790\uC138\uD788 \uBD05\uB2C8\uB2E4")}),n.jsxs("div",{ref:Y,role:"table","aria-labelledby":Ke&&typeof _=="string"?$:void 0,className:"table body-2",children:[Ke&&n.jsxs("div",{className:_e("table-header",k&&"table-header--clickable"),onClick:k,role:"caption",children:[k&&n.jsx(pe,{htmlType:"button",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:b?"chevron-right":"chevron-down",ariaLabel:b?L("common.expand","\uD3BC\uCE58\uAE30"):L("common.collapse","\uC811\uAE30"),ariaExpanded:!b,className:"table-header__chevron"}),g&&n.jsx(at,{icon:g,label:typeof _=="string"?_:void 0,className:"table-header__icon"}),n.jsx("span",{id:$,className:"table-header__title h5b",children:_}),A!==void 0&&n.jsx("span",{className:"table-header__count body-3b",children:A}),v&&n.jsx("span",{className:"table-header__actions",onClick:se=>se.stopPropagation(),children:v})]}),!b&&n.jsxs(n.Fragment,{children:[t&&t.length>0&&n.jsx("div",{role:"row",className:"table-fields table-fields--groups",children:t.map((se,Ne)=>n.jsx("div",{role:"columnheader","aria-colspan":se.span,className:_e("table-field body-3",se.className),style:{gridColumn:`span ${se.span}`},children:se.label},Ne))}),n.jsxs("div",{role:"presentation",className:_e("table-fields-strip",V&&"table-fields-strip--resizable"),children:[n.jsx("div",{role:"row",className:"table-fields",ref:I,children:e.map((se,Ne)=>n.jsx(c4,{onClick:se.onClick,className:se.className,sortDir:se.sortDir,ariaSort:dt(Ne),onResizeStart:V&&Ne<e.length-1&&se.resizable!==!1&&(x!=="fit"||e.some((We,nt)=>nt>Ne&&We.resizable!==!1))?We=>qe(Ne,We):void 0,children:se.label},Ne))}),V&&n.jsx(pe,{htmlType:"button",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:"chevrons-left-right-ellipsis",ariaLabel:L("table.resetColumns","\uCE78 \uB108\uBE44 \uCD08\uAE30\uD654"),showTooltipInfo:L("table.resetColumns","\uCE78 \uB108\uBE44 \uCD08\uAE30\uD654"),className:"table-fields__reset",onClick:je})]}),n.jsx("div",{role:"rowgroup",className:"table-body",children:B?n.jsx(Wo,{variant:"loading",colSpan:e.length||void 0}):a.length===0&&w?n.jsx(Wo,{variant:"empty",colSpan:e.length||void 0,children:w}):a.map((se,Ne)=>{const We=m!=null&&se.id===m,nt=!!i&&(s?s(se):!0),Fe=G!=null&&se.id!=null&&(G instanceof Set?G.has(se.id)||[...G].some(Ge=>String(Ge)===String(se.id)):String(se.id)===String(G));return n.jsx(Wo,{className:`${nt?" table-row--clickable":""}${c?" table-row--draggable":""}${We?" table-row--dragging":""}`.trim(),draggable:!!c,onClick:nt?()=>i(se):void 0,colSpan:e.length||void 0,rowHasButton:r(se).some(Ge=>!!Ge.rowLabel),describedBy:Z,onMouseEnter:l?Ge=>l(se,Ge):void 0,onMouseLeave:u?Ge=>u(se,Ge):void 0,onDragStart:c?Ge=>c(se,Ge):void 0,onDragEnd:d?Ge=>d(se,Ge):void 0,expandedContent:Fe&&P?P(se):void 0,children:r(se).map((Ge,bt)=>n.jsx(l4,{className:Ge.className,style:Ge.style,rowLabel:nt?Ge.rowLabel:void 0,onRowClick:nt?()=>i(se):void 0,children:Ge.content},bt))},se.id!=null?`${typeof se.id}:${se.id}`:`__idx:${Ne}`)})})]})]})]})}const d4={hearingAid:"hearingAid",cochlearImplant:"cochlearImplant",other:"other",\uBCF4\uCCAD\uAE30:"hearingAid",\uC778\uACF5\uC640\uC6B0:"cochlearImplant",\uAE30\uD0C0:"other"};function ju(e){return e?d4[e]??null:null}function Mu(e){switch(ju(e)){case"hearingAid":return"main";case"cochlearImplant":return"sub";default:return"default"}}function Lu(e,t){const a=ju(e);return a?t(`device.type.${a}`,{defaultValue:e??""}):e??""}const pa=e=>e==null?"":String(e).trim();function Vo(e,t,a,r){const i=pa(e),s=pa(t),l=pa(a);if(r&&i&&s&&l){const c=`${i.padStart(4,"0")}-${s.padStart(2,"0")}-${l.padStart(2,"0")}`,d=new Date(c);if(!Number.isNaN(d.getTime())&&d.toISOString().slice(0,10)===c){const m=Mi(c,r);if(m)return m}}const u=[i,s,l];for(;u.length>0&&u[u.length-1]==="";)u.pop();return u.join(".")}function p4(e,t,a){const r=pa(e);return r?`${r}-${pa(t).padStart(2,"0")}-${pa(a).padStart(2,"0")}`:""}function $u(e,t){return t!=="wornAt"?String(e[t]??""):p4(e.wornYear,e.wornMonth,e.wornDay)}function m4({rows:e,loading:t,onSelect:a,onDelete:r,onWear:i,onRelease:s,onAdd:l}){const{t:u,i18n:c}=xe.useTranslation(),d=h=>h==="left"?u("device.direction.left","\uC88C"):u("device.direction.right","\uC6B0"),{sort:m,field:p}=Vy(),f=o.useMemo(()=>{if(!m)return e;const{key:h,asc:_}=m;return[...e].sort((g,A)=>{if(h==="worn"){const b=Number(A.worn)-Number(g.worn);return _?b:-b}return yo($u(g,h),$u(A,h),_)})},[e,m]),{pageRows:y,pageSizeProps:x,paginationProps:C}=Hy(f,m);return n.jsxs("div",{className:"dlp-side-table",children:[n.jsx(jo,{count:{value:e.length,unit:u("customers.device.unit","\uAC1C")},pageSize:x,pagination:C,actions:l&&n.jsx(pe,{htmlType:"button",size:40,type:"bar",variant:"main",icon:"plus",label:u("customers.device.addButton","\uAE30\uAE30 \uCD94\uAC00"),onClick:l})}),n.jsx(Ho,{loading:t,resizable:!0,resizeMode:"fit",resizeStorageKey:"customer-device-history-v2",fields:[{...p(u("customers.device.wearingNow","\uCC29\uC6A9"),"worn"),resizable:!1},p(u("device.direction.label","\uBC29\uD5A5"),"side"),p(u("device.deviceType","\uC885\uB958"),"device"),p(u("device.brand","\uBE0C\uB79C\uB4DC"),"brand"),p(u("device.fitType","\uCC29\uC6A9\uD615\uD0DC"),"fitType"),p(u("device.productName","\uC81C\uD488\uBA85"),"productName"),p(u("device.wornDate","\uCC29\uC6A9\uC77C"),"wornAt"),...r?[{label:"",resizable:!1}]:[]],items:y.map((h,_)=>({id:h.id??`${h.side}-${_}`,row:h})),gridTemplateColumns:`56px 110px 110px minmax(120px, 1fr) 100px minmax(120px, 1fr) 110px${r?" 80px":""}`,renderRow:({row:h})=>[{content:n.jsx("span",{className:"dlp-worn-check",onClick:_=>_.stopPropagation(),children:n.jsx(fu,{checked:h.worn,disabled:h.worn?!s:!i,ariaLabel:h.worn?u("customers.device.unwear","\uCC29\uC6A9 \uD574\uC81C"):u("customers.device.wear","\uCC29\uC6A9"),onChange:_=>{_?i?.(h):s?.(h)}})})},{content:n.jsx("span",{children:d(h.side)})},{content:h.device?n.jsx(At,{size:"small",variant:Mu(h.device),fill:"soft",label:Lu(h.device,u)}):n.jsx("span",{})},{content:n.jsx("span",{children:h.brand})},{content:n.jsx("span",{children:h.fitType||"-"})},{content:n.jsx("span",{children:h.productName||"-"})},{content:n.jsx("span",{className:"dlp-date",children:Vo(h.wornYear,h.wornMonth,h.wornDay,c.language)||"-"})},...r?[{content:n.jsx("span",{className:"dlp-row-actions",children:n.jsx(pe,{htmlType:"button",size:28,type:"bar",variant:"transparent-gray",label:u("common.delete","\uC0AD\uC81C"),onClick:_=>{_?.stopPropagation(),r(h)}})})}]:[]],onRowClick:({row:h})=>a(h),empty:u("customers.device.historyEmpty","\uB4F1\uB85D\uB41C \uAE30\uAE30 \uC774\uB825\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.")})]})}function Ru(e,t){return e?{role:t?.role??"button",tabIndex:0,...t?.selected===void 0?{}:{"aria-selected":t.selected},onKeyDown:a=>{a.target===a.currentTarget&&(a.key!=="Enter"&&a.key!==" "||(a.preventDefault(),e(a)))}}:{}}function h4(e,t){return new Date(e,t+1,0).getDate()}function f4(e,t){return new Date(e,t,1).getDay()}function C4({visits:e=[],onVisitClick:t,onVisitMove:a,onDayClick:r,today:i}){const{t:s,i18n:l}=xe.useTranslation(),u=o.useMemo(()=>s("calendar.dow",{returnObjects:!0}),[s]),c=ro(i),[d,m]=o.useState(()=>Number(c.slice(0,4))),[p,f]=o.useState(()=>Number(c.slice(5,7))-1),[y,x]=o.useState(null),C=o.useRef(null),h=o.useMemo(()=>{const v={};return e.forEach(w=>{v[w.date]||(v[w.date]=[]),v[w.date].push(w)}),v},[e]),_=o.useMemo(()=>{const v=h4(d,p),w=f4(d,p),B=[];for(let E=0;E<w;E++)B.push(null);for(let E=1;E<=v;E++)B.push(E);for(;B.length<35;)B.push(null);return B},[d,p]),g=o.useCallback(()=>{p===0?(m(v=>v-1),f(11)):f(v=>v-1)},[p]),A=o.useCallback(()=>{p===11?(m(v=>v+1),f(0)):f(v=>v+1)},[p]),b=v=>`${d}-${String(p+1).padStart(2,"0")}-${String(v).padStart(2,"0")}`,k=v=>b(v)===c;return n.jsxs("div",{children:[n.jsxs("div",{className:"calendar-nav",children:[n.jsx("button",{type:"button",className:"calendar-nav__button",onClick:g,"aria-label":s("calendar.prevMonth","\uC774\uC804 \uB2EC"),children:n.jsx(at,{icon:"chevron-left",label:"",className:"",svgClassName:"calendar-nav__button-icon",size:18})}),n.jsx("span",{className:"calendar-nav__title h5","aria-live":"polite",children:tr(s,l.language,d,p+1)}),n.jsx("button",{type:"button",className:"calendar-nav__button",onClick:A,"aria-label":s("calendar.nextMonth","\uB2E4\uC74C \uB2EC"),children:n.jsx(at,{icon:"chevron-right",label:"",className:"",svgClassName:"calendar-nav__button-icon",size:18})}),n.jsxs("div",{className:"calendar-nav__legend",children:[n.jsx("span",{className:"calendar-nav__legend-dot calendar-nav__legend-dot--main"}),n.jsx("span",{className:"caption-1",children:s("calendar.legend.visited","\uBC29\uBB38")}),n.jsx("span",{className:"calendar-nav__legend-dot calendar-nav__legend-dot--sub"}),n.jsx("span",{className:"caption-1",children:s("calendar.legend.scheduled","\uC608\uC57D")}),n.jsx("span",{className:"calendar-nav__legend-dot calendar-nav__legend-dot--disabled"}),n.jsx("span",{className:"caption-1",children:s("calendar.legend.noVisit","\uBBF8\uBC29\uBB38")})]})]}),n.jsxs("div",{className:"calendar-grid",children:[u.map(v=>n.jsx("div",{className:"calendar-day-header body-3",children:v},v)),_.map((v,w)=>{if(v===null)return n.jsx("div",{className:"calendar-cell empty"},`empty-${w}`);const B=v,E=b(B),D=h[E]??[],N=Mi(E,l.language),O=y===E;return n.jsxs("div",{className:`calendar-cell${k(B)?" today":""}${O?" drag-over":""}${r?" calendar-cell--clickable":""}`,role:r?"button":void 0,tabIndex:r?0:void 0,"aria-label":r?s("calendar.addOnDate",{date:E}):void 0,"aria-current":k(B)?"date":void 0,onClick:r?()=>r(E):void 0,onKeyDown:r?P=>{P.target===P.currentTarget&&(P.key!=="Enter"&&P.key!==" "||(P.preventDefault(),r(E)))}:void 0,onDragOver:a?P=>{P.preventDefault(),x(E)}:void 0,onDragLeave:a?P=>{P.currentTarget.contains(P.relatedTarget)||x(null)}:void 0,onDrop:a?P=>{P.preventDefault(),C.current!=null&&(a(C.current,E),C.current=null),x(null)}:void 0,children:[n.jsx("div",{className:"calendar-cell__number body-3",children:B}),D.length>0&&(()=>{const P=[{key:"visited",label:s("calendar.legend.visited","\uBC29\uBB38"),count:D.filter(L=>(L.status??"visited")==="visited").length},{key:"scheduled",label:s("calendar.legend.scheduled","\uC608\uC57D"),count:D.filter(L=>L.status==="scheduled").length},{key:"noVisit",label:s("calendar.legend.noVisit","\uBBF8\uBC29\uBB38"),count:D.filter(L=>L.status==="noVisit").length}].filter(L=>L.count>0),G=P.length===1&&P[0].key==="visited"?s("calendar.visitCount",{count:D.length,defaultValue:"\uBC29\uBB38 {{count}}\uAC74"}):P.map(L=>s("calendar.statusCount",{label:L.label,count:L.count,defaultValue:"{{label}} {{count}}\uAC74"})).join(" \xB7 ");return n.jsxs("span",{className:"calendar-cell__visit-count caption-1","aria-label":`${N} ${G}`,children:[P.map(L=>n.jsx("span",{className:`calendar-cell__visit-dot calendar-cell__visit-dot--${L.key}`,"aria-hidden":"true"},L.key)),D.length]})})(),n.jsx("div",{className:"calendar-cell__badges",children:D.map((P,G)=>n.jsxs("div",{draggable:!!a,className:`calendar-visit-badge${P.status==="noVisit"?" calendar-visit-badge--no-visit":P.status==="scheduled"?" calendar-visit-badge--scheduled":""}${t?" calendar-visit-badge--clickable":""}${a?" calendar-visit-badge--draggable":""}`,onDragStart:a?L=>{C.current=P.id,L.dataTransfer.effectAllowed="move"}:void 0,onDragEnd:a?()=>{C.current=null,x(null)}:void 0,onClick:t?L=>{L.stopPropagation(),t(P)}:void 0,...Ru(t?()=>t(P):void 0),"aria-label":[N,P.time?Pi(P.time,s):null,P.customer,s(P.status==="noVisit"?"calendar.legend.noVisit":P.status==="scheduled"?"calendar.legend.scheduled":"calendar.legend.visited")].filter(Boolean).join(" "),children:[P.time&&n.jsx("span",{className:"calendar-visit-badge__time body-3",children:Pi(P.time,s)}),n.jsx("span",{className:"calendar-visit-badge__name body-3",children:P.customer}),P.status==="noVisit"&&n.jsx("span",{className:"calendar-visit-badge__no-visit caption-1",children:s("calendar.legend.noVisit","\uBBF8\uBC29\uBB38")})]},P.id??G))})]},B)})]})]})}const g4={page:"h3",pagePopup:"h4",popup:"h5"};function ma({type:e="page",title:t,headingLevel:a=2,icon:r,action:i,disc:s,children:l,inGrid:u=!1,className:c,style:d}){const m=g4[e],p=t||s||i||r,f=a?`h${a}`:"div";return n.jsxs("div",{className:_e("section",`section--${e}`,u&&"section--in-grid",c),style:d,children:[p&&n.jsxs("div",{className:"section__header",children:[n.jsxs("div",{className:"section__title-row",children:[r&&n.jsx(at,{icon:r,label:typeof t=="string"?t:void 0,className:"section__icon"}),n.jsxs("div",{className:"section__title-group",children:[t&&n.jsx(f,{className:`section__title ${m}`,children:t}),s&&n.jsx("div",{className:"section__disc body-3",children:s})]})]}),i&&n.jsx("div",{className:"section__action",children:i})]}),l]})}let qo=null,Pu=!1;function Iu(){if(Pu||typeof document>"u")return;Pu=!0,document.addEventListener("keydown",t=>{t.metaKey||t.ctrlKey||t.altKey||(qo="keyboard")},!0);const e=()=>{qo="pointer"};document.addEventListener("pointerdown",e,!0),document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,{capture:!0,passive:!0})}Iu();function hr(){return Iu(),qo==="keyboard"}const fr=20;function b4(e){const{t}=xe.useTranslation(),{type:a,trainingDatas:r,depth:i,renderPopup:s,completedIds:l,selectedIds:u,onItemComplete:c,size:d,useDescriptionTooltip:m,onRemove:p,onMore:f,sectionType:y="page"}=e||{},[,x]=o.useState(0),C=typeof r<"u"?Array.isArray(r)?r:[]:[],h=C.length,[_,g]=o.useState(Math.min(h,fr)),A=o.useMemo(()=>Array.isArray(i)?[...i,a?.label].filter(Boolean).join(" \xB7 "):[i||"",a?.label].filter(Boolean).join(" \xB7 "),[i,a?.label]);o.useEffect(()=>{g(Math.min(h,fr))},[h]),Nl("speechear.data.updated",()=>x(w=>w+1));const b=o.useRef(null),k=o.useRef(null);function v(){const w=document.activeElement;k.current=hr()&&w&&w.closest?.(".training-block__more")?_:null,g(B=>Math.min(h,B+fr))}return o.useEffect(()=>{const w=k.current;if(w==null)return;k.current=null;const B=document.activeElement;B&&B!==document.body||b.current?.querySelectorAll(".training-block-button")[w]?.focus()},[_]),n.jsxs(ma,{type:y,title:a?.label,icon:a?.icon,disc:a?.desc,className:"training-block",children:[n.jsx("div",{className:"training-list",ref:b,children:(C||[]).slice(0,_).map((w,B)=>{const E=w;return n.jsx(Do,{index:B,type:a,trainingData:E,depth:A,renderPopup:s,completedIds:l,selectedIds:u,size:d,useDescriptionTooltip:m,onRemove:typeof p=="function"&&u!=null&&E?.id!=null&&u.has(String(E.id))?()=>p(E):void 0,onComplete:typeof c=="function"&&E?.id!=null?()=>c(String(E.id)):void 0,onMore:typeof f=="function"?D=>f(E,D):void 0},E?.id!=null?`${a?.key||"t"}-${String(E.id)}`:`${a?.key||"t"}-${B}`)})}),h>fr&&_<h&&n.jsx("div",{className:"training-block__more",children:n.jsx(pe,{htmlType:"button",size:48,type:"bar",icon:"plus",onClick:v,ariaLabel:t("common.loadMore","\uB354\uBCF4\uAE30"),label:t("common.loadMore","\uB354\uBCF4\uAE30"),variant:"main"})})]})}function y4(e){let t=0;const a=r=>{Array.isArray(r)?r.forEach(a):r!=null&&r!==!1&&r!==!0&&r!==""&&t++};return a(e),t}function v4({gap:e=10,count:t,className:a,children:r}){const i=o.useRef(null),[s,l]=o.useState({width:0,card:0}),u=t??y4(r);o.useLayoutEffect(()=>{const f=i.current;if(!f)return;const y=()=>{const C=f.style.maxWidth;f.style.maxWidth="none";const h=f.clientWidth;f.style.maxWidth=C;const _=f.firstElementChild?.offsetWidth??0;l(g=>g.width===h&&g.card===_?g:{width:h,card:_})};if(y(),typeof ResizeObserver>"u")return;const x=new ResizeObserver(y);return x.observe(f),()=>x.disconnect()},[u,e]);const c=s.card>0?s.card:0,d=c>0?iC(s.width,c,e):0,m=d>0?lC(u,d):0,p={"--block-grid-gap":`${e}px`,...m>0?{"--block-grid-cols":m,"--block-grid-card":`${c}px`}:{}};return n.jsx("div",{ref:i,className:_e("training-block-grid",m>0&&"training-block-grid--measured",a),style:p,"data-cols":m>0?m:void 0,children:r})}function Uo(e){const t=o.useRef(null),[a,r]=o.useState(!!e),[i,s]=o.useState(!1);o.useEffect(()=>{s(!1);const c=t.current;r(!!e&&!(c?.complete&&c.naturalWidth>0))},[e]);const l=o.useCallback(()=>r(!1),[]),u=o.useCallback(()=>{r(!1),s(!0)},[]);return{imgRef:t,loading:a,failed:i,hasImage:!!e&&!i,onLoad:l,onError:u}}var x4='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="a" xmlns="http://www.w3.org/2000/svg" width="240" height="240" viewBox="0 0 240 240"><g opacity=".5"><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23fff"/></g><path d="M140,30h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84-3.88-7.1-6.08-15.25-6.08-23.92v-80c0-16.57,13.43-30,30-30h80c8.66,0,16.81,2.21,23.92,6.08-8.48-15.54-24.97-26.08-43.92-26.08Z" fill="%23fff"/><path d="M183.92,56.08c3.88,7.1,6.08,15.25,6.08,23.92v80c0,16.57-13.43,30-30,30h-80c-8.66,0-16.81-2.21-23.92-6.08,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%23fff"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></svg>';const _4=x4,Go=o.forwardRef(function({item:e,disabled:t=!1,onPlayDone:a,selectable:r=!1,selected:i=!1,onSelect:s,flipDelay:l=0,hideLabel:u=!1,hideAudio:c=!1,orderRank:d=null},m){const{t:p}=xe.useTranslation(),f=e.word||e.title||"",y=t||!f,x=e.audio??e.sound??e.audioKey,C=e.subLabel||e.pronunciation||"",h=e.colloquialLabel||"",[_,g]=o.useState({label:f,subLabel:C,colloquialLabel:h,homonum:e.homonum});f&&(_.label!==f||_.subLabel!==C||_.colloquialLabel!==h||!Object.is(_.homonum,e.homonum))&&g({label:f,subLabel:C,colloquialLabel:h,homonum:e.homonum});const A=o.useRef(null),b=ln("(max-width: 767px)"),[k,v]=o.useState(!1),w=`${typeof x=="string"?x:x?.src??""}\0${f}`,[B,E]=o.useState({for:"",url:""}),D=B.for===w?B.url:"",N=Di(),O=e.textOnly??(!e.image&&!!_.label&&!!N&&N.entries.length>0&&!N.byWord.has(_.label)),P=O?"":aa()?.(_.label,_.homonum)??e.image??"",{imgRef:G,loading:L,hasImage:M,onLoad:$,onError:Z}=Uo(P);o.useEffect(()=>{let j=!1;return(async()=>{if(x){if(typeof x=="string"){if(x.startsWith("http")||x.includes("/")){E({for:w,url:x});return}}else if(typeof x=="object"&&!Array.isArray(x)){const U=x.src;if(U){E({for:w,url:U});return}}}const F=Ba();if(F&&f)try{const U=await Promise.resolve(F(f));!j&&U&&E({for:w,url:U})}catch{}})(),()=>{j=!0}},[x,f,w]);const q=o.useRef(!0),z=o.useRef(null);o.useEffect(()=>(q.current=!0,()=>{q.current=!1,z.current&&ur(z.current),z.current=null;try{A.current?.pause()}catch{}A.current=null}),[]);const V=o.useCallback(()=>new Promise(j=>{if(typeof window<"u"&&window.speechSynthesis&&f){v(!0),window.speechSynthesis.cancel();const F=new SpeechSynthesisUtterance(f);F.lang="ko-KR",F.onend=()=>{v(!1);try{a?.()}catch{}j()},F.onerror=()=>{v(!1),j()},window.speechSynthesis.speak(F)}else j()}),[f,a]),R=o.useCallback(j=>{const F=cr(j,U=>{if(v(!1),U)try{a?.()}catch{}});return A.current=F.el,F.done},[a]),H=o.useCallback(async()=>{if(t||!q.current)return;const j=()=>{z.current===j&&(z.current=null);try{A.current?.pause()}catch{}try{window.speechSynthesis?.cancel()}catch{}v(!1)},F=lr(j);z.current=j;try{window.speechSynthesis?.cancel()}catch{}try{if(D&&(v(!0),await R(D)))return;const U=Yr();if(U&&f)try{const re=await Promise.resolve(U(f));if(!q.current||z.current!==j||re&&(v(!0),await R(re)))return}catch{}if(!q.current||z.current!==j)return;await V()}finally{F(),z.current===j&&(z.current=null)}},[t,D,f,R,V]);o.useImperativeHandle(m,()=>({play:()=>H()}),[H]);const W=j=>j.stopPropagation(),I=o.useCallback(j=>{if(j.stopPropagation(),!t){if(k){try{A.current?.pause()}catch{}try{window.speechSynthesis?.cancel()}catch{}v(!1);return}H()}},[t,k,H]),S=_e("training-word-card",t?"training-word-card--disabled":"",y?"training-word-card--flipped":"",r?"training-word-card--selectable":"",i?"training-word-card--selected":"");return n.jsx("div",{className:S,onClick:r&&!t?s:void 0,role:r?"button":void 0,"aria-pressed":r?i:void 0,tabIndex:r&&!t?0:void 0,"aria-disabled":r&&t?!0:void 0,onKeyDown:r&&!t?j=>{j.target===j.currentTarget&&(j.key==="Enter"||j.key===" "||j.key==="Spacebar")&&(j.preventDefault(),s?.())}:void 0,children:n.jsxs("div",{className:"training-word-card__flipper",style:{transitionDelay:y?"0ms":`${l}ms`},children:[n.jsxs("div",{className:"training-word-card__front",children:[i&&n.jsx("div",{className:"training-word-card__selected-badge",onClick:W,children:n.jsx(At,{type:"dot",size:40,position:"inline",animate:!0,icon:d!=null?void 0:"check",number:d??void 0,"aria-label":d!=null?p("training.nthSelected",{n:d}):p("training.selected","\uC120\uD0DD\uB428")})}),n.jsx("div",{className:"training-word-card__image-wrap",children:O?n.jsx("div",{className:"training-word-card__text-face",children:_.label}):M?n.jsxs(n.Fragment,{children:[L&&n.jsx("div",{className:"training-word-card__spinner"}),n.jsx("img",{ref:G,className:"training-word-card__image",src:P,alt:_.label||p("common.image","\uC774\uBBF8\uC9C0"),style:{opacity:L?0:1},onLoad:$,onError:Z})]}):n.jsx("div",{className:"training-word-card__placeholder"})}),!u&&n.jsxs("div",{className:"training-word-card__body",children:[!O&&n.jsx("div",{className:"training-word-card__word",children:_.label}),_.subLabel&&n.jsxs("div",{className:"training-word-card__pronunciation",children:["[",_.subLabel,"]"]}),_.colloquialLabel&&n.jsxs("div",{className:"training-word-card__colloquial caption-1",children:["[",_.colloquialLabel,"]"]})]}),!c&&n.jsx("div",{className:"training-word-card__bottom",onClick:r?W:void 0,children:n.jsx(pe,{htmlType:"button",size:b?40:48,type:b?"dot":"bar",icon:k?"pause":"play",label:b?void 0:p("training.playSound","\uC18C\uB9AC \uB4E3\uAE30"),selected:k,onClick:I,disabled:t,ariaLabel:p("training.playSound","\uC18C\uB9AC \uB4E3\uAE30")})})]}),n.jsx("div",{className:"training-word-card__back","aria-hidden":"true",children:n.jsx("span",{className:"training-word-card__disabled-symbol",style:{"--disabled-symbol-src":`url("${_4}")`}})})]})})}),w4=260;function Fn(e){const{t}=xe.useTranslation(),{title:a,subtitle:r,headerActions:i,headerSegment:s,children:l,buttons:u,footer:c,footerStart:d,footerEnd:m,footerNote:p,footerNoteDivider:f=!1,footerClassName:y="",footerLayout:x="center",onClose:C,closeDisabled:h=!1,beforeClose:_,closeOnBackdrop:g=!0,className:A="",ariaLabel:b,useTitle:k=!0,inline:v=!1,size:w,layer:B="modal",height:E,fillBody:D=!1,resetScrollKey:N}=e||{},[O,P]=o.useState(!1),G=o.useRef(!1),L=o.useRef(null),M=o.useId(),$=o.useRef(null);o.useEffect(()=>{},[v,a,b,A]),o.useEffect(()=>{N!==void 0&&$.current&&($.current.scrollTop=0)},[N]);const[Z,q]=o.useState(!1);o.useEffect(()=>{const K=$.current;if(!K)return;const oe=()=>q(K.scrollHeight>K.clientHeight+1);if(oe(),typeof ResizeObserver>"u")return;const Ae=new ResizeObserver(oe);Ae.observe(K);const Y=K.firstElementChild;return Y&&Ae.observe(Y),()=>Ae.disconnect()},[l,N]),o.useEffect(()=>{if(!v)return uu()},[v]),o.useEffect(()=>{if(v)return;const K=document.activeElement,oe=L.current;return co(oe,K),oe&&!oe.contains(document.activeElement)&&(oe.querySelector(Cn)??oe).focus(),()=>{const Ae=document.activeElement;(!Ae||Ae===document.body||oe&&oe.contains(Ae))&&po(K)?.focus?.()}},[v]),lo(L,!v);const z=o.useRef(!0),V=mo(),R=o.useRef(null);o.useEffect(()=>(z.current=!0,()=>{z.current=!1,R.current&&(clearTimeout(R.current),R.current=null)}),[]);const H=o.useCallback(()=>{!z.current||!G.current||(G.current=!1,P(!1))},[]),W=o.useCallback((K,oe=!1)=>{if(oe&&!z.current||G.current)return;G.current=!0,P(!0);const Ae=setTimeout(()=>{R.current===Ae&&(R.current=null);let Y;try{Y=K?K():void 0}catch{H();return}Y&&typeof Y.then=="function"&&Y.then(()=>{setTimeout(H,120)},H)},V?0:w4);oe&&(R.current=Ae)},[H,V]),I=o.useCallback(()=>{h||_&&_()===!1||W(C,!0)},[W,C,h,_]),S=o.useRef(I);o.useEffect(()=>{S.current=I});const j=!v&&!!C;o.useEffect(()=>{if(j)return Gn(()=>S.current())},[j]);const F=j&&g,U=o.useRef(!1),re=K=>{U.current=K.target===K.currentTarget},ne=K=>{const oe=U.current;U.current=!1,oe&&K.target===K.currentTarget&&I()},le=n.jsx("div",{className:`popup ${v?"popup--inline":""} ${B==="belowPagePopup"?"popup--below-page-popup":""} ${O?"popup--closing":""} ${A}`,onPointerDown:F?re:void 0,onClick:F?ne:void 0,onMouseDown:v?void 0:K=>{K.target===K.currentTarget&&K.preventDefault()},children:n.jsxs("div",{ref:L,className:`popup-panel${w?` popup-panel--${w}`:""}${E!=null?" popup-panel--has-height":""}${D?" popup-panel--fill-body":""}`,style:E!=null?{"--popup-height":typeof E=="number"?`${E}px`:E}:void 0,tabIndex:-1,role:v?void 0:"dialog","aria-modal":v?void 0:!0,"aria-labelledby":!v&&k&&a?M:void 0,"aria-label":!v&&!(k&&a)?b??(typeof a=="string"?a:void 0):void 0,children:[!k&&(i||C)?n.jsxs("div",{className:"popup-close-float",children:[i,C&&n.jsx(pe,{htmlType:"button",size:40,type:"dot",icon:"x",variant:"transparent-gray",useBorder:!1,onClick:I,disabled:h,ariaLabel:t("common.close","\uB2EB\uAE30")})]}):a||i||C?n.jsxs("div",{className:`popup-header${r?" popup-header--with-subtitle":""}`,children:[n.jsxs("div",{className:"popup-header-main",children:[a?n.jsx("h2",{id:M,className:"popup-title popup-title--left h2",children:a}):n.jsx("span",{id:M,className:"popup-title popup-title--left h2"}),r&&n.jsx("span",{className:"popup-subtitle body-3",children:r})]}),s&&n.jsx("div",{className:"popup-header-segment",children:n.jsx(gn,{size:40,ariaLabel:s.ariaLabel,options:s.options.map(K=>({key:K.key,label:K.label,disabled:K.disabled})),value:s.value,onChange:s.onChange})}),n.jsxs("div",{className:"popup-header-actions",children:[i,C&&n.jsx(pe,{htmlType:"button",size:40,type:"dot",icon:"x",variant:"transparent-gray",useBorder:!1,onClick:I,disabled:h,ariaLabel:t("common.close","\uB2EB\uAE30")})]})]}):null,n.jsx("div",{className:"popup-content",ref:$,tabIndex:Z?0:void 0,children:n.jsx("div",{className:"popup-content__inner",children:typeof l=="function"?l({animateThen:W,closeWithAnimation:I}):l})}),p!=null&&p!==!1&&n.jsx("div",{className:`popup-footer-note caption-1${f?" popup-footer-note--divider":""}`,role:"note",children:p}),d||m?n.jsxs("div",{className:`popup-footer popup-footer--bar${y?` ${y}`:""}`,children:[n.jsx("div",{className:"popup-footer__start",children:typeof d=="function"?d({animateThen:W,closeWithAnimation:I}):d}),n.jsx("div",{className:"popup-footer__end",children:typeof m=="function"?m({animateThen:W,closeWithAnimation:I}):m})]}):u?.length?n.jsx("div",{className:`popup-footer popup-footer--buttons${x!=="center"?` popup-footer--${x}`:""}`,children:u.map((K,oe)=>n.jsx(pe,{htmlType:"button",size:48,variant:K.variant??"default",label:K.label,disabled:K.disabled,onClick:()=>K.onClick?.({animateThen:W,closeWithAnimation:I})},oe))}):c?n.jsx("div",{className:`popup-footer${x!=="center"?` popup-footer--${x}`:""}${y?` ${y}`:""}`,children:typeof c=="function"?c({animateThen:W,closeWithAnimation:I}):c}):null]})});return v||typeof document>"u"?le:en.createPortal(le,document.body)}function Cr(e){return String(e)}const gr=["o","triangle","x"];function Fu(e,t){return e===t?null:t}const Ou={o:"circle",triangle:"triangle",x:"x"},zu={o:"main",triangle:"warn",x:"danger"};function B4(e){let t=0,a=0,r=0;for(const s of Object.values(e))s==="o"?t++:s==="triangle"?a++:s==="x"&&r++;const i=t+a+r;return{marked:i,o:t,triangle:a,x:r,rate:i===0?null:(t+a*.5)/i}}function Ko(e){const t={};for(const[a,r]of Object.entries(e))(r==="o"||r==="triangle"||r==="x")&&(t[a]=r);return t}function Wu(e){const t=[];let a=0;for(const r of e)t.push(a),a+=r;return t}function k4(e,t){return!t&&e>0}const ha={landscape:{width:1123,height:794,printSize:"A4 landscape",printW:"297mm",printH:"210mm"},portrait:{width:794,height:1123,printSize:"A4 portrait",printW:"210mm",printH:"297mm"}};function A4(e="landscape"){St("print-word-table-deprecated","[printWordTable] @deprecated \u2014 WordTablePopup renderButtons \uC758 print(\uB610\uB294 useWordTablePrint().print)\uB97C \uC4F0\uC138\uC694. \uC804\uC5ED \uC778\uC1C4\uB294 \uD654\uBA74\uC758 \uBAA8\uB4E0 \uB2E8\uC5B4\uD45C\uB97C \uD568\uAED8 \uCC0D\uC2B5\uB2C8\uB2E4.");const{printSize:t,printW:a,printH:r}=ha[e],i=document.createElement("style");i.textContent=`@page { size: ${t}; margin: 0; } .word-table { width: ${a} !important; height: ${r} !important; }`,document.head.appendChild(i);const s=()=>{document.head.removeChild(i),window.removeEventListener("afterprint",s)};window.addEventListener("afterprint",s),window.print()}function Hu(e,t){if(e.length===0)return[[]];const a=Math.max(1,Math.floor(t)),r=[];for(let i=0;i<e.length;i+=a)r.push(e.slice(i,i+a));return r}const N4={landscape:{1:{cols:1,rows:1},2:{cols:2,rows:1},3:{cols:3,rows:1},4:{cols:2,rows:2},5:{cols:3,rows:2},6:{cols:3,rows:2},7:{cols:4,rows:2},8:{cols:4,rows:2},9:{cols:5,rows:2},10:{cols:5,rows:2},11:{cols:4,rows:3},12:{cols:4,rows:3}},portrait:{1:{cols:1,rows:1},2:{cols:1,rows:2},3:{cols:1,rows:3},4:{cols:1,rows:4},5:{cols:1,rows:5},6:{cols:2,rows:3},7:{cols:2,rows:4},8:{cols:2,rows:4},9:{cols:2,rows:5},10:{cols:2,rows:5},11:{cols:3,rows:4},12:{cols:3,rows:4}}};function E4(e,t){const a=N4[e][t];if(a)return a;const r=Math.max(1,Math.ceil(t)),i=Math.max(1,Math.ceil(Math.sqrt(r*.707)));let s,l;return e==="landscape"?(l=i,s=Math.ceil(r/l)):(s=i,l=Math.ceil(r/s)),(e==="landscape"?s<l:l<s)&&([s,l]=[l,s]),{cols:s,rows:l}}const D4={show:"word-table-block__content--cut-show",dashed:"",corner:"word-table-block__content--cut-corner",hide:""},Vu={\uBA85:"\uBA85\uC0AC",\uB3D9:"\uB3D9\uC0AC",\uD615:"\uD615\uC6A9\uC0AC",\uBD80:"\uBD80\uC0AC",\uC218:"\uC218\uC0AC",\uAD00:"\uAD00\uD615\uC0AC",\uAC10:"\uAC10\uD0C4\uC0AC",\uC870:"\uC870\uC0AC",\uC811:"\uC811\uC0AC",\uC758:"\uC758\uC874\uBA85\uC0AC",\uB300:"\uB300\uBA85\uC0AC",\uBCF4\uB3D9:"\uBCF4\uC870\uB3D9\uC0AC",\uBCF4\uD615:"\uBCF4\uC870\uD615\uC6A9\uC0AC"},qu={\uACE0\uC720:"\uACE0\uC720\uC5B4",\uD55C\uC790:"\uD55C\uC790\uC5B4",\uC678\uB798:"\uC678\uB798\uC5B4",\uD63C\uC885:"\uD63C\uC885\uC5B4"},Yo={\uBA85:"noun",\uB3D9:"verb",\uD615:"adjective",\uBD80:"adverb",\uC218:"numeral",\uAD00:"determiner",\uAC10:"interjection",\uC870:"particle",\uC811:"affix",\uC758:"dependentNoun",\uB300:"pronoun",\uBCF4\uB3D9:"auxVerb",\uBCF4\uD615:"auxAdjective"},Zo={\uACE0\uC720:"native",\uD55C\uC790:"sino",\uC678\uB798:"foreign",\uD63C\uC885:"mixed"};function Uu(e){return Object.fromEntries(Object.entries(Vu).map(([t,a])=>[t,Yo[t]?e(`wordTable.pos.${Yo[t]}`,{defaultValue:a}):a]))}function Gu(e){return Object.fromEntries(Object.entries(qu).map(([t,a])=>[t,Zo[t]?e(`wordSearch.filter.type.${Zo[t]}`,{defaultValue:a}):a]))}const S4={pos:Yo,wordType:Zo};function Xo(e,t){return e?e.split("/").map(a=>t[a]??a).join("/"):""}function Ku(e,t,a,r){if(r!=="dashed")return{};const i=e%t,s=Math.floor(e/t),l=i<t-1,u=s<a-1;if(!l&&!u)return{};const c="#ddd",d=y=>`repeating-linear-gradient(to ${y}, ${c} 0, ${c} 5px, transparent 5px, transparent 10px)`,m=[],p=[],f=[];return l&&(m.push(d("bottom")),p.push("1px 100%"),f.push("right center")),u&&(m.push(d("right")),p.push("100% 1px"),f.push("center bottom")),{backgroundImage:m.join(", "),backgroundSize:p.join(", "),backgroundPosition:f.join(", "),backgroundRepeat:"no-repeat",printColorAdjust:"exact",WebkitPrintColorAdjust:"exact"}}const T4=280,j4=240,M4=280,L4=400,$4=120,R4=280;function Yu(e,t){const a=o.useRef(null),[r,i]=o.useState(1),[s,l]=o.useState(0),u=o.useCallback((c,d)=>{if(!(c>0))return;const m=c/e,p=t&&d>0?d/t:1/0,f=Math.min(1,m,p);i(f),l(Math.max(0,(c-e*f)/2))},[e,t]);return o.useEffect(()=>{const c=a.current;if(!c)return;const d=t?c.parentElement??c:c;if(u(d.clientWidth,d.clientHeight),typeof ResizeObserver>"u")return;const m=new ResizeObserver(([p])=>u(p.contentRect.width,p.contentRect.height));return m.observe(d),()=>m.disconnect()},[u,t]),{scalerRef:a,scale:r,offset:s}}const P4=24,I4={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},F4=400,Zu=8;function Xu({label:e,subLabel:t,colloquialLabel:a,homonum:r,showWord:i=!0,showImage:s=!0,showPronunciation:l=!0,showColloquial:u=!0,buttonSize:c=40,wordInfo:d,outerScale:m=1}){const{t:p}=xe.useTranslation(),f=o.useRef(null),y=o.useRef(null),x=o.useRef(null),[C,h]=o.useState(1),[_,g]=o.useState(!1),[A,b]=o.useState({for:"",url:""}),[k,v]=o.useState(null),w=t&&t.length>0?t:Ff()?.(e,r)??"",B=aa()?.(e,r)??"",{imgRef:E,loading:D,failed:N,onLoad:O,onError:P}=Uo(B),G=o.useCallback(()=>v(y.current?.getBoundingClientRect()??null),[]),L=o.useCallback(()=>v(null),[]),M=fo(!!k,j=>{j?G():L()},y),$=o.useMemo(()=>{if(!d)return null;const j=[];return d.grade&&j.push(p("wordTable.info.grade",{n:d.grade,defaultValue:"\uB09C\uC774\uB3C4: {{n}}\uB4F1\uAE09"})),d.syllables&&j.push(p("wordTable.info.syllables",{n:d.syllables,defaultValue:"\uC74C\uC808 \uC218: {{n}}\uC74C\uC808"})),d.pos&&j.push(p("wordTable.info.pos",{v:Xo(d.pos,Uu(p)),defaultValue:"\uD488\uC0AC: {{v}}"})),d.wordType&&j.push(p("wordTable.info.wordType",{v:Xo(d.wordType,Gu(p)),defaultValue:"\uC720\uD615: {{v}}"})),j.length?j:null},[d,p]),Z=w||e,q=A.for===Z?A.url:"";o.useEffect(()=>{const j=Ba(),F=w||e;if(!j||!F)return;let U=!1;return Promise.resolve(j(F)).then(re=>{!U&&re&&b({for:F,url:re})}),()=>{U=!0}},[w,e]);const z=o.useRef(null),V=o.useRef(null);o.useEffect(()=>()=>{x.current?.pause(),V.current?.()},[]);const R=o.useCallback(j=>{if(j.stopPropagation(),_){z.current?.();return}if(!q)return;g(!0);const F=cr(q,()=>{g(!1),V.current?.()});x.current=F.el,z.current=F.stop,V.current=lr(F.stop)},[_,q]),H=s&&!!B&&!N,W=H&&i?T4:H?M4:j4,I=H&&i?L4:H?R4:$4;o.useEffect(()=>{const j=f.current;if(!j||typeof ResizeObserver>"u")return;const F=new ResizeObserver(([U])=>{const{width:re,height:ne}=U.contentRect;h(Math.min(re/W,ne/I))});return F.observe(j),()=>F.disconnect()},[W,I]);const S=c*m<P4;return n.jsxs("div",{ref:f,className:_e("word-table-cell",S&&"word-table-cell--tap-too-small",H?"word-table-cell--with-image":""),"data-ref-w":W,"data-ref-h":I,children:[n.jsxs("div",{className:"word-table-cell__inner",style:{transform:`scale(${C})`},children:[H&&n.jsxs("div",{className:"word-table-cell__image-wrap",children:[D&&n.jsx("div",{className:"word-table-cell__spinner"}),n.jsx("img",{ref:E,className:"word-table-cell__image",src:B,alt:e,draggable:!1,style:{opacity:D?0:1},onLoad:O,onError:P})]}),i&&n.jsx("span",{className:"word-table-cell__word h0",children:e}),l&&w&&n.jsxs("span",{className:"word-table-cell__sub h3",children:["[",w,"]"]}),u&&a&&n.jsxs("span",{className:"word-table-cell__colloquial h5",children:["[",a,"]"]})]}),n.jsxs("div",{className:"word-table-cell__play-button","data-audio-src":q,children:[n.jsx("span",{"data-play-state":"play",style:{display:_?"none":void 0},children:n.jsx(pe,{htmlType:"button",size:c,type:"dot",icon:"play",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:p("common.play","\uC7AC\uC0DD"),ariaLabel:e?p("common.playFor",{name:e,defaultValue:`${e} \uC7AC\uC0DD`}):p("common.play","\uC7AC\uC0DD"),onClick:R})}),n.jsx("span",{"data-play-state":"pause",style:{display:_?void 0:"none"},children:n.jsx(pe,{htmlType:"button",size:c,type:"dot",icon:"pause",useBorder:!1,selected:!0,showTooltipInfo:p("common.pause","\uBA48\uCDA4"),ariaLabel:e?p("common.pauseFor",{name:e,defaultValue:`${e} \uBA48\uCDA4`}):p("common.pause","\uBA48\uCDA4"),onClick:R})})]}),d&&n.jsxs("div",{ref:y,className:"word-table-cell__info-button",onPointerEnter:j=>{ia(j)||G()},onPointerLeave:j=>{ia(j)||L()},onFocus:()=>{la()||G()},onBlur:L,children:[n.jsx(pe,{htmlType:"button",size:c,type:"dot",icon:"info",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:!1,ariaLabel:p("wordTable.wordInfo","{{word}} \uB0B1\uB9D0 \uC815\uBCF4",{word:e}),onClick:j=>{j.stopPropagation(),M.touchPress()}}),k&&$&&n.jsx(Kn,{anchorRect:k,items:$,showIndex:!1})]})]})}function fa({title:e,titleIcon:t,disc:a,className:r,orientation:i="landscape",contentTypes:s=["image","word","standardPron"],cutLine:l="show",showOutline:u=!0,showDivLine:c=!0,items:d,editCells:m,count:p,activeCell:f=null,onActivateCell:y,onRemoveCell:x,onRemoveItem:C,onReorder:h,renderCellAction:_,showFillerAdd:g=!1,contentRef:A,buttonSize:b=40,brand:k,code:v,pageNumber:w,pageNumberPosition:B="right",fitHeight:E=!1,scoring:D=!1,marks:N,onMarkClick:O,scoreIndexOffset:P=0}){const G=o.useCallback((Be,je)=>{O?.(P+Be,je)},[O,P]),L=(Be,je)=>{const Se=N?.[Cr(P+Be)]??null;return n.jsx("div",{className:_e("word-table-cell__score",Se?"word-table-cell__score--marked":""),style:Ve>1?{transform:`translateX(-50%) scale(${Ve})`,transformOrigin:"bottom center"}:void 0,children:gr.map(Xe=>n.jsx("span",{className:_e("word-table-cell__score-slot",Se===Xe?"word-table-cell__score-slot--on":""),children:n.jsx(pe,{htmlType:"button",size:b,type:"dot",shape:"pill",icon:Ou[Xe],variant:Se===Xe?zu[Xe]:"default",selected:Se===Xe,useBorder:!1,...ke?{}:{tabIndex:-1,role:"img"},showTooltipInfo:M(`wordTable.scoring.markName.${Xe}`,{defaultValue:Xe}),ariaLabel:M(`wordTable.scoring.${Xe}`,{word:je,defaultValue:`${je} ${Xe}`}),onClick:ke?Qe=>{Qe.stopPropagation(),G(Be,Xe)}:void 0})},Xe))})},{t:M}=xe.useTranslation(),$=m!==void 0,Z=e!=null||!!t||!!a,q=ln("(max-width: 767px)"),z=o.useRef(null),[V,R]=o.useState(null),H=d?.length??0,[W,I]=o.useState(null),[S,j]=o.useState(""),F=o.useRef(null),U=o.useRef(null),re=o.useRef(null),ne=o.useRef(null),le=o.useCallback(Be=>{U.current=Be,typeof A=="function"?A(Be):A&&(A.current=Be)},[A]),K=o.useCallback((Be,je)=>{F.current=je,h?.(Be,je),j(M("wordTable.reorder.moved",{n:je+1,total:H,defaultValue:"{{total}}\uCE78 \uAC00\uC6B4\uB370 {{n}}\uBC88\uC9F8\uB85C \uC62E\uAE40"}))},[h,M,H]);o.useEffect(()=>{const Be=F.current;Be!=null&&(F.current=null,U.current?.querySelectorAll(".word-table-block__card:not(.word-table-block__card--filler)")?.[Be]?.querySelector(".word-table-block__card-handle button")?.focus())}),o.useEffect(()=>()=>{ne.current?.()},[]);const oe=o.useCallback((Be,je)=>{if(!h||!Be.altKey||Be.ctrlKey||Be.metaKey)return;const Se=Be.key==="ArrowRight";if(!Se&&Be.key!=="ArrowLeft")return;Be.preventDefault();const Xe=je+(Se?1:-1);Xe<0||Xe>=H||K(je,Xe)},[h,H,K]),Ae=o.useCallback((Be,je)=>{if(!h||Be.pointerType==="mouse")return;const Se=Be.target.closest?.("button");if(Se&&!Se.closest(".word-table-block__card-handle"))return;ne.current?.();const Xe={x:Be.clientX,y:Be.clientY};let Qe=!1;const dt=se=>{Qe&&se.cancelable&&se.preventDefault()};let ht=null,wt=null;const Ct=()=>{const se=wt;if(!se)return;const Ne=document.elementFromPoint?.(se.x,se.y)?.closest?.("[data-wordtable-cell]"),We=Ne?Number(Ne.dataset.wordtableCell):NaN,nt=Number.isInteger(We)?We:null;re.current=nt,R(Fe=>Fe===nt?Fe:nt)},Nt=se=>{if(!Qe){(Math.abs(se.clientX-Xe.x)>Zu||Math.abs(se.clientY-Xe.y)>Zu)&&Ke();return}if(wt={x:se.clientX,y:se.clientY},typeof requestAnimationFrame>"u"){Ct();return}ht===null&&(ht=requestAnimationFrame(()=>{ht=null,Ct()}))},gt=()=>{ht!==null&&(cancelAnimationFrame(ht),ht=null,Ct());const se=re.current,Ne=Qe;Ke(),Ne&&se!=null&&se!==je&&K(je,se)},it=setTimeout(()=>{Qe=!0,I(je),re.current=je,R(je),window.addEventListener("touchmove",dt,{passive:!1})},F4);function Ke(){clearTimeout(it),window.removeEventListener("pointermove",Nt),window.removeEventListener("pointerup",gt),window.removeEventListener("pointercancel",gt),window.removeEventListener("touchmove",dt),Qe=!1,ht!==null&&(cancelAnimationFrame(ht),ht=null),re.current=null,ne.current=null,I(null),R(null)}ne.current=Ke,window.addEventListener("pointermove",Nt),window.addEventListener("pointerup",gt),window.addEventListener("pointercancel",gt)},[h,K]),{width:Y,height:Q}=ha[i],me=typeof E=="number"?E:E&&typeof E=="object"?q?E.narrow:E.wide:null,{scalerRef:De,scale:be,offset:te}=Yu(Y,E?Q:void 0),ue=$?m?.length??0:d?.length??0,fe=Math.max(p??ue,1),{cols:ge,rows:Ce}=E4(i,fe),$e={word:s.length===0||s.includes("word"),image:s.length===0||s.includes("image"),pron:s.length===0||s.includes("standardPron"),colloq:s.length===0||s.includes("colloquialPron")},He=$?(m??[]).some(Be=>Be!==null&&Be.length>1):(d??[]).some(Be=>(Be.words??[]).length>1),Te=!!k?.show,Ie=!!k?.show&&k?.top!==!1,qe=!!k?.show&&k?.bottom!==!1,mt=k?.copyright??"\xA9 IHAB, Inc. All rights reserved.",ct=_e("word-table-block__content",D4[l],u&&"word-table-block__content--outline",c&&He&&"word-table-block__content--div-line",!Te&&w&&B!=="none"&&"word-table-block__content--page-number",Ie&&"word-table-block__content--brand-top",qe&&"word-table-block__content--brand-bottom"),rt={transform:`scale(${1/be})`,transformOrigin:"center center"},ft=b*gr.length+4*(gr.length-1),ke=!!O,Ve=ke?Math.max(1,Math.min(1/be,Y/ge/ft)):1,we=n.jsxs("div",{ref:De,className:"word-table__scaler",style:{height:Q*be},children:[n.jsx("div",{className:_e("word-table",D&&!ke&&"word-table--score-readonly",!Z&&r),style:{width:Y,height:Q,transform:`scale(${be})`,transformOrigin:"top left",marginLeft:te},children:n.jsxs("div",{ref:le,className:ct,style:{gridTemplateColumns:`repeat(${ge}, 1fr)`,gridTemplateRows:`repeat(${Ce}, 1fr)`},children:[$?n.jsx(n.Fragment,{children:(m??[]).map((Be,je)=>n.jsx("div",{className:_e("word-table-block__edit-cell",Be?"word-table-block__edit-cell--filled":"word-table-block__edit-cell--empty",f===je?"word-table-block__edit-cell--active":""),style:Ku(je,ge,Ce,l),children:Be?n.jsxs(n.Fragment,{children:[Be.map((Se,Xe)=>n.jsxs(o.Fragment,{children:[Xe>0&&n.jsx("div",{className:"word-table-block__pair-divider"}),n.jsx(Xu,{outerScale:be,label:Se.word,subLabel:Se.pronunciation,colloquialLabel:Se.colloquialPronunciation,homonum:Se.homonum,showWord:$e.word,showImage:$e.image,showPronunciation:$e.pron,showColloquial:$e.colloq,buttonSize:b})]},Xe)),D&&L(je,Be.map(Se=>Se.word).join(" / ")),x&&n.jsx("div",{className:"word-table-block__card-close",children:n.jsx(pe,{htmlType:"button",size:b,type:"dot",icon:"x",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:Be.length>1?M("wordPrint.removePair","\uB300\uB9BD\uC30D \uBE7C\uAE30"):M("wordPrint.removeWord","\uB2E8\uC5B4 \uBE7C\uAE30"),ariaLabel:Be.length>1?M("wordPrint.removePair","\uB300\uB9BD\uC30D \uBE7C\uAE30"):M("wordPrint.removeWord","\uB2E8\uC5B4 \uBE7C\uAE30"),onClick:()=>x(je)})})]}):y&&n.jsx("div",{style:rt,children:n.jsx(pe,{htmlType:"button",size:"48",type:"bar",icon:"plus",label:M("wordTable.addWord","\uCD94\uAC00\uD558\uAE30"),onClick:()=>y(je)})})},je))}):n.jsxs(n.Fragment,{children:[(d??[]).map((Be,je)=>n.jsxs("div",{"data-wordtable-cell":h?je:void 0,className:`word-table-block__card${h?" word-table-block__card--draggable":""}${V===je?" word-table-block__card--drag-over":""}${W===je?" word-table-block__card--dragging":""}`,style:Ku(je,ge,Ce,l),draggable:!!h,onPointerDown:h?Se=>Ae(Se,je):void 0,onKeyDown:h?Se=>oe(Se,je):void 0,onDragStart:h?()=>{z.current=je}:void 0,onDragOver:h?Se=>{Se.preventDefault(),R(je)}:void 0,onDragLeave:h?()=>R(null):void 0,onDrop:h?Se=>{Se.preventDefault(),z.current!==null&&z.current!==je&&h(z.current,je),z.current=null,R(null)}:void 0,onDragEnd:h?()=>{z.current=null,R(null)}:void 0,children:[(Be.words??[]).map((Se,Xe)=>n.jsxs(o.Fragment,{children:[Xe>0&&n.jsx("div",{className:"word-table-block__pair-divider"}),n.jsx(Xu,{outerScale:be,label:Se.label,subLabel:Se.subLabel,colloquialLabel:Se.colloquialLabel,homonum:Se.homonum,showWord:$e.word,showImage:$e.image,showPronunciation:$e.pron,showColloquial:$e.colloq,buttonSize:b,wordInfo:Se.grade||Se.syllables!=null||Se.pos||Se.wordType?{grade:Se.grade,syllables:Se.syllables,pos:Se.pos,wordType:Se.wordType}:void 0})]},Xe)),D&&L(je,(Be.words??[]).map(Se=>Se.label).join(" / ")),h&&n.jsx("div",{className:"word-table-block__card-handle",children:n.jsx(pe,{htmlType:"button",size:b,type:"dot",icon:"grip-vertical",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:M("wordTable.reorder.hint","Alt + \u2190 \u2192 \uB85C \uC21C\uC11C \uBC14\uAFB8\uAE30"),ariaLabel:M("wordTable.reorder.handle",{word:(Be.words??[]).map(Se=>Se.label).join(" / "),defaultValue:"{{word}} \uC21C\uC11C \uBC14\uAFB8\uAE30 (Alt + \uD654\uC0B4\uD45C)"})})}),(_||C)&&n.jsxs("div",{className:"word-table-block__card-actions",children:[_?.(je,Be),C&&n.jsx("div",{className:"word-table-block__card-close",children:n.jsx(pe,{htmlType:"button",size:b,type:"dot",icon:"x",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:(Be.words??[]).length>1?M("wordPrint.removePair","\uB300\uB9BD\uC30D \uBE7C\uAE30"):M("wordPrint.removeWord","\uB2E8\uC5B4 \uBE7C\uAE30"),ariaLabel:(Be.words??[]).length>1?M("wordPrint.removePair","\uB300\uB9BD\uC30D \uBE7C\uAE30"):M("wordPrint.removeWord","\uB2E8\uC5B4 \uBE7C\uAE30"),onClick:()=>C(Be.id)})})]})]},Be.id)),Array.from({length:Math.max(0,ge*Ce-(d?.length??0))}).map((Be,je)=>{const Se=(d?.length??0)+je<fe;return n.jsx("div",{className:"word-table-block__card word-table-block__card--filler",children:g&&y&&Se&&n.jsx("div",{style:rt,children:n.jsx(pe,{htmlType:"button",size:b,type:"bar",icon:"plus",label:M("wordTable.addWord","\uCD94\uAC00\uD558\uAE30"),onClick:()=>y((d?.length??0)+je)})})},`filler-${je}`)})]}),Ie&&n.jsx(n.Fragment,{children:n.jsxs("div",{className:"word-table__band word-table__band--top",children:[n.jsx("img",{className:"word-table__brand-logo",src:k?.topLogo?.src??ir,alt:k?.topLogo?.alt??"\uB9D0\uADC0"}),(()=>{const Be=[k?.title&&n.jsx("span",{className:"word-table__paper-title",children:k.title},"t"),k?.owner&&n.jsx("span",{className:"word-table__owner",children:k.owner},"o"),v&&n.jsx("span",{className:"word-table__code",children:v},"c")].filter(Boolean);return Be.length===0?null:n.jsx("span",{className:"word-table__ident",children:Be.map((je,Se)=>n.jsxs(o.Fragment,{children:[Se>0&&n.jsx("span",{className:"word-table__ident-dot","aria-hidden":"true",children:"\xB7"}),je]},Se))})})()]})}),qe&&n.jsx(n.Fragment,{children:n.jsxs("div",{className:"word-table__band word-table__band--bottom",children:[n.jsxs("span",{className:"word-table__brand-by",children:[k?.bottomLogo?n.jsx("img",{className:"word-table__brand-logo--ihab word-table__brand-logo--given",src:k.bottomLogo.src,alt:k.bottomLogo.alt}):n.jsx("span",{className:"word-table__brand-logo--ihab",role:"img","aria-label":"IHAB"}),n.jsx("span",{className:"word-table__copyright",children:mt})]}),n.jsxs("span",{className:"word-table__band-end",children:[k?.link&&n.jsx("span",{className:"word-table__link",children:k.link}),w&&B!=="none"&&n.jsx("span",{className:"word-table__page-count",children:M("wordTable.filter.pageIndicator",{current:w.current,total:w.total})})]})]})}),!Te&&w&&B!=="none"&&n.jsx("span",{className:`word-table__page-number body-3 word-table__page-number--${B}`,children:M("wordTable.filter.pageIndicator",{current:w.current,total:w.total})})]})}),h&&n.jsx("span",{role:"status",style:I4,children:S})]}),Ue=me==null?we:n.jsx("div",{className:"word-table__frame",style:{height:me},children:we});return Z?n.jsx(ma,{type:"page",icon:t,title:e,disc:a,className:_e("word-table-block",r),children:Ue}):Ue}function O4(e,t,a){const r=[];for(const i of e??[]){if(i.type==="note"||i.type==="input")continue;const s=i.displayLabel??i.label,l=z4(i,t?.[i.label],a);l!==null&&r.push(`${s} ${l}`)}return r.join(" \xB7 ")}function z4(e,t,a){const r=(Array.isArray(t)?t:t===void 0?[]:[t]).filter(i=>i!==dn);return r.length===0?e.allOption?e.allLabel??a:null:r.map(i=>W4(e,i)).join(", ")}function W4(e,t){const a=[...e.items??[],...(e.groups??[]).flat()];for(const r of a)if(r!=null){if(typeof r=="string"){if(r===t)return r;continue}if(r.value===t)return r.displayLabel??r.labels?.join(" ")??r.value}return t}function Dn({title:e,titleLevel:t=2,headerAction:a,headerSummary:r,collapsible:i=!1,defaultCollapsed:s=!1,collapsed:l,onCollapsedChange:u,footer:c,sections:d,selected:m={},onSelect:p,align:f,sectionAlign:y,className:x}){const C=(f??(y==="vertical"?"newline":"inline"))==="inline",{t:h}=xe.useTranslation(),[_,g]=o.useState(s),A=l??_,b=()=>{const N=!A;g(N),u?.(N)},k=N=>{if(!i)return;const O=N.target;!O||typeof O.closest!="function"||O.closest(".filter-panel__collapse-toggle")||O.closest('button, a, input, select, textarea, label, [role="radiogroup"], [role="button"], [role="menu"]')||b()},v=o.useMemo(()=>r!==void 0||!A?"":O4(d,m,h("common.all","\uC804\uCCB4")),[r,A,d,m,h]),w=r??(v?n.jsx("span",{className:"filter-panel__header-summary body-3",children:v}):null),B=e||a||r||i,E=o.useId(),D=t?`h${t}`:"span";return n.jsxs("div",{className:_e("filter-panel",i?"filter-panel--collapsible":"",A?"filter-panel--collapsed":"",x),role:typeof e=="string"&&e?"group":void 0,"aria-labelledby":typeof e=="string"&&e?E:void 0,children:[B&&n.jsxs("div",{className:"filter-panel__header",onClick:i?k:void 0,children:[n.jsx("div",{className:"filter-panel__title-row",children:e&&n.jsx(D,{id:E,className:"filter-panel__title h4",children:e})}),n.jsxs("div",{className:"filter-panel__header-actions",children:[A?w:a,i&&n.jsx(pe,{htmlType:"button",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:A?"chevron-down":"chevron-up",className:"filter-panel__collapse-toggle",ariaLabel:A?h("common.expand","\uD3BC\uCE58\uAE30"):h("common.collapse","\uC811\uAE30"),showTooltipInfo:A?h("common.expand","\uD3BC\uCE58\uAE30"):h("common.collapse","\uC811\uAE30"),"aria-expanded":!A,onClick:b})]})]}),!A&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:_e("filter-panel__sections",C?"filter-panel__sections--row":""),children:d.map(N=>{const O=m[N.label],P=O===void 0||(Array.isArray(O)?O.length===0:!1),G=(N.items??[]).filter(M=>M!=null);N.allOption&&G.some(M=>(typeof M=="string"?M:M.value)===dn)&&St(`filter-panel-all-value:${N.label}`,`[FilterPanel] '${N.label}' \uC808\uC5D0 allOption \uACFC \uAC12 '${dn}' \uC778 \uBCF4\uAE30\uAC00 \uD568\uAED8 \uC788\uB2E4 \u2014 \uB450 \uC120\uD0DD\uC774 \uAD6C\uBCC4\uB418\uC9C0 \uC54A\uB294\uB2E4. \uBCF4\uAE30 \uAC12\uC744 \uBC14\uAFD4\uB77C.`);const L=M=>{const $=typeof M=="string"?M:M.value,Z=typeof M!="string"&&!!M.disabled,q=typeof M!="string"?M.labels:void 0,z=typeof M!="string"?M.displayLabel:void 0,V=typeof M!="string"?M.tooltip:void 0,R=typeof M!="string"?M.descriptionTooltip:void 0,H=typeof M!="string"?M.shape:void 0,W=Array.isArray(O)?O.includes($):O===$;return n.jsx(pe,{htmlType:"button",size:"keyboard",label:q??z??$,type:N.itemType??(q?"bar":$.length===1?"dot":void 0),selected:W,disabled:Z,shape:H,showTooltipInfo:!!V,tooltipInfoText:V,tooltipDescription:R,onClick:()=>p?.($,N.label)},$)};return n.jsxs(o.Fragment,{children:[N.groupLabel&&n.jsxs("div",{className:"filter-panel__group-label-row",children:[n.jsx("div",{className:"filter-panel__group-label body-2",children:N.groupLabel}),N.groupAction]}),n.jsxs("div",{className:_e("filter-panel__section",N.layout==="row"?"filter-panel__section--row":"",N.block?"filter-panel__section--block":""),children:[n.jsxs("div",{className:"filter-panel__section-label-row",children:[n.jsx("span",{className:"filter-panel__section-label body-3",children:N.displayLabel??N.label}),N.labelAction??(N.labelInfo?n.jsx(Pa,{...N.labelInfo}):null)]}),N.type==="note"?n.jsx("div",{className:"filter-panel__note body-3",children:N.content}):N.type==="input"?n.jsx(Xn,{className:"filter-panel__textfield",placeholder:N.placeholder,ariaLabel:N.displayLabel??N.label,value:m[N.label]??"",onChange:M=>p?.(M,N.label),error:N.error}):!N.multiple&&N.display==="segmented"?n.jsx(gn,{ariaLabel:N.displayLabel??N.label,options:[...N.allOption?[{key:dn,label:N.allLabel??h("common.all","\uC804\uCCB4"),disabled:N.allOptionDisabled}]:[],...G.map(M=>{const $=typeof M=="string"?M:M.value,Z=typeof M!="string"?M.displayLabel:void 0,q=typeof M!="string"?M.disabled:void 0;return{key:$,label:Z??$,disabled:q}})],value:P&&N.allOption?dn:m[N.label]??"",onChange:M=>p?.(M,N.label),size:32}):!N.multiple&&N.display==="dropdown"?n.jsx(pn,{className:"filter-panel__dropdown",ariaLabel:typeof N.label=="string"?N.label:void 0,size:40,options:[...N.allOption?[{value:dn,label:N.allLabel??h("common.all","\uC804\uCCB4"),disabled:N.allOptionDisabled}]:[],...G.map(M=>{const $=typeof M=="string"?M:M.value,Z=typeof M!="string"?M.displayLabel:void 0,q=typeof M!="string"?M.disabled:void 0;return{value:$,label:Z??$,disabled:q}})],value:P&&N.allOption?dn:m[N.label],onChange:M=>p?.(M,N.label)}):n.jsxs("div",{className:N.groups?"filter-panel__item-groups":"filter-panel__items",children:[N.allOption&&!N.groups&&n.jsx(pe,{htmlType:"button",size:"keyboard",label:N.allLabel??h("common.all","\uC804\uCCB4"),selected:P,disabled:N.allOptionDisabled,onClick:()=>p?.(dn,N.label)}),N.groups?N.groups.map((M,$)=>n.jsxs("div",{className:"filter-panel__item-group",children:[$===0&&N.allOption&&n.jsx(pe,{htmlType:"button",size:"keyboard",label:N.allLabel??h("common.all","\uC804\uCCB4"),selected:P,disabled:N.allOptionDisabled,onClick:()=>p?.(dn,N.label)}),M.filter(Z=>Z!=null).map(L)]},$)):G.map(L)]})]})]},N.label)})}),c!=null&&c!==!1&&n.jsx("div",{className:"filter-panel__footer body-3",children:c})]})]})}const H4=[1,2,3,4,5,6,7,8,9,10,11,12],Ju=[8,4,2,1],rn="show",yn="hide";function Qu(e,t){return{label:e("wordTable.filter.composition","\uAD6C\uC131"),items:[{value:"image",disabled:!t.hasImage,displayLabel:e("wordTable.filter.image","\uC774\uBBF8\uC9C0")},{value:"word",displayLabel:e("wordTable.filter.word","\uB2E8\uC5B4")},{value:"standardPron",displayLabel:e("wordTable.filter.standardPron","\uD45C\uC900 \uBC1C\uC74C")},{value:"colloquialPron",disabled:!t.hasColloquial,displayLabel:e("wordTable.filter.colloquialPron","\uAD6C\uC5B4\uCCB4 \uBC1C\uC74C")}],multiple:!0,allOption:!0}}function ec(e){return{label:e("wordTable.filter.paperOrientation","\uC6A9\uC9C0 \uBC29\uD5A5"),items:[{value:"landscape",displayLabel:e("wordTable.filter.landscape","\uAC00\uB85C")},{value:"portrait",displayLabel:e("wordTable.filter.portrait","\uC138\uB85C")}],display:"segmented"}}function tc(e){return{label:e("wordTable.filter.border","\uC678\uACFD\uC120"),items:[{value:rn,displayLabel:e("wordTable.filter.show","\uD45C\uC2DC")},{value:yn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function nc(e){return{label:e("wordTable.filter.topInfo","\uC0C1\uB2E8 \uC815\uBCF4"),items:[{value:rn,displayLabel:e("wordTable.filter.show","\uD45C\uC2DC")},{value:yn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function ac(e){return{label:e("wordTable.filter.bottomInfo","\uD558\uB2E8 \uC815\uBCF4"),items:[{value:rn,displayLabel:e("wordTable.filter.show","\uD45C\uC2DC")},{value:yn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function rc(e){return{label:e("wordTable.filter.cutLine","\uC808\uCDE8\uC120"),items:[{value:rn,displayLabel:e("wordTable.filter.show","\uD45C\uC2DC")},{value:"dashed",displayLabel:e("wordTable.filter.dotted","\uC810\uC120")},{value:"corner",displayLabel:e("wordTable.filter.corner","\uCF54\uB108")},{value:yn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function oc(e){return{label:e("wordPrint.divLine","\uB300\uB9BD\uC120"),items:[{value:rn,displayLabel:e("wordTable.filter.show","\uD45C\uC2DC")},{value:yn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function sc(e,t){return{label:e(t.hasPairs?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord"),items:[t.itemCount,...Ju.filter(a=>a<t.itemCount)].map(a=>({value:`${a}\uAC1C`,displayLabel:e("wordTable.filter.itemsPerPageOption",{count:a})})),display:"segmented"}}function ic(e,t){return e===t||!Ju.includes(e)?Number.POSITIVE_INFINITY:e}function V4(e){return{label:e("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638"),items:[{value:"left",displayLabel:e("wordTable.filter.pageNumberLeft","\uC67C\uCABD")},{value:"center",displayLabel:e("wordTable.filter.pageNumberCenter","\uC911\uC559")},{value:"right",displayLabel:e("wordTable.filter.pageNumberRight","\uC624\uB978\uCABD")},{value:yn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function lc(e){return e==="left"||e==="center"||e==="right"?e:"none"}function uc(e,t){return{[e("wordTable.filter.composition","\uAD6C\uC131")]:t.contentTypes,[e("wordTable.filter.paperOrientation","\uC6A9\uC9C0 \uBC29\uD5A5")]:t.orientation,[e("wordTable.filter.border","\uC678\uACFD\uC120")]:t.showOutline?rn:yn,[e("wordTable.filter.cutLine","\uC808\uCDE8\uC120")]:t.cutLine,[e("wordPrint.divLine","\uB300\uB9BD\uC120")]:t.showDivLine?rn:yn,...t.showTopInfo!=null?{[e("wordTable.filter.topInfo","\uC0C1\uB2E8 \uC815\uBCF4")]:t.showTopInfo?rn:yn}:{},...t.showBottomInfo!=null?{[e("wordTable.filter.bottomInfo","\uD558\uB2E8 \uC815\uBCF4")]:t.showBottomInfo?rn:yn}:{}}}function cc(e,t,a,r){return a===e("wordTable.filter.composition","\uAD6C\uC131")?t===dn?(r.setContentTypes(()=>[]),!0):(r.setContentTypes(i=>i.includes(t)?i.filter(s=>s!==t):[...i,t]),!0):a===e("wordTable.filter.paperOrientation","\uC6A9\uC9C0 \uBC29\uD5A5")?(r.setOrientation(t==="landscape"?"landscape":"portrait"),!0):a===e("wordTable.filter.border","\uC678\uACFD\uC120")?(r.setShowOutline(t===rn),!0):a===e("wordTable.filter.cutLine","\uC808\uCDE8\uC120")?(r.setCutLine(t),!0):a===e("wordPrint.divLine","\uB300\uB9BD\uC120")?(r.setShowDivLine(t===rn),!0):a===e("wordTable.filter.topInfo","\uC0C1\uB2E8 \uC815\uBCF4")?(r.setShowTopInfo?.(t===rn),!0):a===e("wordTable.filter.bottomInfo","\uD558\uB2E8 \uC815\uBCF4")?(r.setShowBottomInfo?.(t===rn),!0):!1}function q4(e){return"sections"in e}function Jo(e){const{t}=xe.useTranslation(),{title:a,className:r,collapsible:i,defaultCollapsed:s,collapsed:l,onCollapsedChange:u,headerSummary:c}=e,d={collapsible:i,defaultCollapsed:s,collapsed:l,onCollapsedChange:u,headerSummary:c};if(q4(e))return n.jsx(Dn,{className:r,title:a??t("wordTable.filterTitle","\uD45C \uC124\uC815"),sections:e.sections,selected:e.selected,onSelect:e.onSelect,...d,align:"inline"});const{hasImage:m,hasColloquial:p,contentTypes:f,orientation:y,showOutline:x,cutLine:C,showDivLine:h,setters:_,showCutLine:g=!1,showDivLine2:A=!1,middleSections:b=[],extraSelected:k={},onExtraSelect:v,showPaperBands:w=!1,showTopInfo:B=!0,showBottomInfo:E=!0}=e,D=[Qu(t,{hasImage:m,hasColloquial:p}),ec(t),...b,tc(t),...g?[rc(t)]:[],...A?[oc(t)]:[],...w?[nc(t),ac(t)]:[]],N={...uc(t,{contentTypes:f,orientation:y,showOutline:x,cutLine:C,showDivLine:h,showTopInfo:B,showBottomInfo:E}),...k},O=(P,G)=>{cc(t,P,G,_)||v?.(P,G)};return n.jsx(Dn,{className:r,title:a??t("wordTable.filterTitle","\uD45C \uC124\uC815"),sections:D,selected:N,onSelect:O,...d,sectionAlign:"horizontal"})}function Qo(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function U4(e){return Qo(e).replace(/"/g,""").replace(/'/g,"'")}function es(e){return e.replace(/[\\/:*?"<>|]/g,"_").trim()}let br=null,Ca=null;function G4(e,t,a,r="",i=""){if(e.length===0||Ca&&Ca.iframe.isConnected&&Date.now()-Ca.at<1e4)return;const s=r?es(r):"";br?.();let l=null;if(s){const d=document.title;document.title=s,l=()=>{document.title=d,window.removeEventListener("afterprint",l),br===l&&(br=null)},br=l,window.addEventListener("afterprint",l)}const u=document.createElement("iframe");u.style.cssText="position:fixed;left:-10000px;top:0;width:1200px;height:900px;border:0;",document.body.appendChild(u);const c=u.contentDocument;if(!c){u.remove();return}Ca={iframe:u,at:Date.now()},c.open(),c.write(ts(e,t,a,!0,s,i)),c.close(),u.contentWindow?.addEventListener("afterprint",()=>{l?.(),setTimeout(()=>{u.remove(),Ca?.iframe===u&&(Ca=null)},0)})}function ts(e,t,a,r=!1,i="",s=""){i=i?es(i):"";const l=Array.from(document.styleSheets).flatMap(p=>{try{return Array.from(p.cssRules).map(f=>f.cssText)}catch{return[]}}).join(`
|
|
859
|
+
`),C=x===-1?a:a.slice(0,x);s("comment",C),a=a.slice(C.length);continue}const u=a.match(/^\/\*[\s\S]*?\*\//);if(u){s("comment",u[0]),a=a.slice(u[0].length);continue}const c=a.match(/^(`(?:\\.|[^`])*`|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*')/);if(c){s("string",c[0]),a=a.slice(c[0].length);continue}const d=a.match(/^\d+(?:\.\d+)?/);if(d){s("number",d[0]),a=a.slice(d[0].length);continue}const m=a.match(jv);if(m){s("keyword",m[0]),a=a.slice(m[0].length);continue}const p=a.match(/^[A-Za-z_$][A-Za-z0-9_$-]*/);if(p){const x=p[0];s(i&&Tv.has(x)?"command":"identifier",x),a=a.slice(x.length);continue}const f=a.match(/^[=+\-*/%<>!&|^~?:]+/);if(f){s("operator",f[0]),a=a.slice(f[0].length);continue}const y=a.match(/^[()[\]{};.,]/);if(y){s("punctuation",y[0]),a=a.slice(1);continue}s("other",a[0]),a=a.slice(1)}return r}function Lv({children:e,language:t="bash",title:a="",showCopy:r=!0,size:i="default",className:s=""}){const{t:l}=xe.useTranslation(),[u,c]=o.useState(!1),d=Sv(mu(e)),m=o.useRef(null);o.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]);const p=async()=>{try{if(!await _C(d))return;c(!0),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>c(!1),2e3)}catch{}},f=Mv(d,t),y=i==="small"?"caption-1":"body-3";return n.jsxs("div",{className:_e("code-box",i==="small"?"code-box--small":"",s),children:[(a||r)&&n.jsxs("div",{className:"code-box__header",role:"toolbar","aria-label":l("common.codeBlock","\uCF54\uB4DC \uBE14\uB85D"),children:[n.jsx("div",{className:"code-box__title caption-1",children:a}),r&&n.jsx(pe,{htmlType:"button",className:"code-box__copy",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:u?"check":"copy",onClick:p,ariaLabel:u?l("common.copied","\uBCF5\uC0AC\uB428"):l("common.copyCode","\uCF54\uB4DC \uBCF5\uC0AC")})]}),n.jsx("pre",{className:"code-box__inner","data-lang":t,children:n.jsx("code",{children:f.map((x,C)=>n.jsx("span",{className:`code-token ${x.type} ${y}`,children:x.content},C))})})]})}const $v={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0};function za(e){const{t}=xe.useTranslation(),{variant:a="spinner",size:r=24,progress:i=null,label:s}=e||{},l=s||t("loader.loading","Loading");if(a==="bar"){const c=i==null||!Number.isFinite(Number(i)),d=c?0:Math.max(0,Math.min(100,Number(i)));return n.jsx("div",{className:`loader-bar${c?" loader-bar--indeterminate":""}`,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":c?void 0:d,"aria-label":l,children:n.jsx("div",{className:"loader-bar__inner",style:c?void 0:{width:`${d}%`}})})}const u=typeof r=="number"?`${r}px`:r;return n.jsxs("div",{className:"loader-spinner",style:{width:u,height:u},role:"status","aria-label":l,children:[n.jsx("span",{style:$v,children:l}),n.jsxs("svg",{className:"loader-spinner__svg",viewBox:"0 0 50 50",width:r,height:r,children:[n.jsx("circle",{className:"loader-spinner__bg",cx:"25",cy:"25",r:"20",fill:"none",strokeWidth:"4"}),n.jsx("circle",{className:"loader-spinner__fg",cx:"25",cy:"25",r:"20",fill:"none",strokeWidth:"4",strokeLinecap:"round"})]})]})}function hu({checked:e,onChange:t,disabled:a=!1,label:r,ariaLabel:i,labelPosition:s="right",className:l="",id:u}){const c=r&&n.jsx("span",{className:"toggle__label body-3",children:r});return n.jsxs("label",{className:`toggle${a?" toggle--disabled":""} ${l}`.trim(),children:[s==="left"&&c,n.jsx("input",{id:u,type:"checkbox",role:"switch",checked:e,disabled:a,onChange:d=>t?.(d.target.checked),"aria-label":!r&&i?i:void 0}),n.jsx("span",{className:"toggle__slider"}),s==="right"&&c]})}function fu({checked:e=!1,onChange:t,disabled:a,indeterminate:r,label:i,size:s="medium",className:l,title:u,ariaLabel:c}){const d=o.useRef(null),m=o.useId(),p=o.useRef(!!r);return p.current=!!r,o.useEffect(()=>{d.current&&(d.current.indeterminate=!!r)}),n.jsxs("label",{className:_e("checkbox",s==="small"&&"checkbox--small",s==="large"&&"checkbox--large",a&&"checkbox--disabled",l),htmlFor:m,title:u,children:[n.jsx("input",{ref:d,id:m,type:"checkbox",className:"checkbox__input",checked:e,onChange:f=>{t?.(f.target.checked),d.current&&(d.current.indeterminate=p.current)},disabled:a,"aria-label":!i&&c?c:void 0}),n.jsx("span",{className:"checkbox__box"}),i&&n.jsx("span",{className:"checkbox__label body-3",children:i})]})}function Rv({count:e,actions:t,onClear:a,clearLabel:r,visible:i,content:s,max:l}){const{t:u}=xe.useTranslation(),c=i!==void 0?i:e>0,d=r??u("bulkBar.clearSelection","\uC120\uD0DD \uD574\uC81C"),m=o.useRef(null),p=o.useRef(null),f=o.useRef(null),y=o.useRef(c);o.useLayoutEffect(()=>{const g=p.current,A=y.current;if(y.current=c,c&&!A){const b=typeof document<"u"?document.activeElement:null;f.current=b&&b!==document.body&&!g?.contains(b)?b:null}else!c&&A&&g&&g.contains(document.activeElement)&&ar(g,f.current)},[c]);const[x,C]=o.useState(!1),h=o.useRef(!1),_=o.useRef(null);return o.useEffect(()=>{const g=m.current;if(!g)return;const A=E=>{h.current=E,C(E)},b=()=>{const E=g.firstElementChild??g,D=Array.from(E.children);if(D.length<2){A(!1);return}const N=D[0].offsetTop,O=D.some($=>$.offsetTop!==N);if(!h.current){_.current=g.clientWidth,O&&A(!0);return}if(O)return;const P=D[0],G=D[D.length-1],L=G.offsetLeft+G.offsetWidth-P.offsetLeft,M=_.current;(M==null||L<=M)&&A(!1)};if(b(),typeof ResizeObserver>"u")return;const k=new ResizeObserver(b);k.observe(g);const v=g.parentElement;let w=v?.clientWidth??0;const B=new ResizeObserver(()=>{const E=v?.clientWidth??0;E!==w&&(w=E,_.current=null,b())});return v&&B.observe(v),()=>{k.disconnect(),B.disconnect()}},[s,e]),n.jsxs("div",{ref:p,className:`bulk-bar ${c?"bulk-bar--visible":""}`,inert:!c||void 0,"aria-hidden":c?void 0:!0,children:[n.jsx("span",{ref:m,className:"bulk-bar__count body-2",role:"status",children:s??n.jsx("b",{children:u("common.selectedCount",{count:e})})}),l!==void 0&&n.jsx(At,{size:"small",fill:"soft",variant:"main",label:`${e} / ${l}`,"aria-label":u("common.selectedOfMax",{count:e,max:l,defaultValue:`\uCD5C\uB300 ${l}\uAC1C \uC911 ${e}\uAC1C`})}),n.jsxs("div",{className:`bulk-bar__actions${x?" bulk-bar__actions--stacked":""}`,children:[n.jsx(pe,{htmlType:"button",size:40,label:d,onClick:a}),t.map((g,A)=>n.jsx(pe,{htmlType:"button",size:40,variant:g.variant??"default",icon:g.icon,label:g.label,onClick:g.onClick},A))]})]})}const Pv=[{key:"edit",icon:"edit-2",closeFirst:!0},{key:"duplicate",icon:"copy",closeFirst:!1},{key:"publish",icon:"book-marked",closeFirst:!1},{key:"copyLink",icon:"link",closeFirst:!1},{key:"remove",icon:"trash-2",closeFirst:!0}];function Iv(e){const{onClose:t,className:a}=e;return n.jsx("div",{className:_e("item-actions",a),children:Pv.map(({key:r,icon:i,closeFirst:s})=>{const l=e[r];if(!l)return null;const u=r==="publish"?l.published?l.unpublish:l.publish:l;return n.jsx(pe,{htmlType:"button",size:40,type:"dot",icon:i,ariaLabel:u.label,showTooltipInfo:u.label,onClick:()=>{s&&t(),u.onClick()}},r)})})}function Cu(e,t){const a=()=>{if(e){const[C,h]=e.split("-");return{y:+C,m:+h-1}}const[y,x]=ro(t).split("-");return{y:+y,m:+x-1}},[r,i]=o.useState(()=>a().y),[s,l]=o.useState(()=>a().m),u=o.useRef(e);o.useEffect(()=>{if(e===u.current)return;u.current=e;const y=a();i(y.y),l(y.m)},[e]);const c=o.useRef({y:r,m:s});o.useEffect(()=>{c.current={y:r,m:s}},[r,s]);const d=o.useCallback(y=>{const x=c.current.y*12+c.current.m+y,C=Math.floor(x/12),h=x-C*12;c.current={y:C,m:h},i(C),l(h)},[]),m=o.useCallback(()=>d(-1),[d]),p=o.useCallback(()=>d(1),[d]),f=o.useCallback((y,x)=>{c.current={y,m:x},i(y),l(x)},[]);return{viewY:r,viewM:s,prevMonth:m,nextMonth:p,setViewYM:f}}function pr(e,t){return new Date(e,t+1,0).getDate()}function Fv(e,t){return new Date(e,t,1).getDay()}function mr(e,t,a){return`${e}-${String(t+1).padStart(2,"0")}-${String(a).padStart(2,"0")}`}function Ov(e){if(!e)return"";const[t,a,r]=e.split("-");return`${t}. ${a}. ${r}.`}function zv(e,t,a,r){const i=a?+a.split("-")[0]:e-10,s=r?+r.split("-")[0]:e+10,l=[];for(let u=i;u<=s;u++)for(let c=0;c<12;c++){const d=`${u}-${String(c+1).padStart(2,"0")}`;a&&d<a.slice(0,7)||r&&d>r.slice(0,7)||l.push({value:d,label:t(u,c+1)})}return l}function Wv({value:e,onChange:t,size:a=48,min:r,max:i,disabled:s,placeholder:l,className:u,today:c}){const{t:d,i18n:m}=xe.useTranslation(),p=l??d("datePicker.chooseDate","\uB0A0\uC9DC \uC120\uD0DD"),f=o.useMemo(()=>d("calendar.dow",{returnObjects:!0}),[d]),y=ro(c),{viewY:x,viewM:C,prevMonth:h,nextMonth:_,setViewYM:g}=Cu(e,c),A=o.useId(),b=o.useCallback((I,S)=>{const j=window.innerHeight,F=window.innerWidth,U=typeof document<"u"?document.getElementById(A):null,re=Math.max(U?.offsetHeight||0,U?.scrollHeight||0)||300,ne=Math.max(I.width,U?.offsetWidth||0,260),le=j-I.bottom,K=I.top,oe=le<re&&K>le,Ae=8,Y=(Q,me)=>Math.min(Math.max(Ae,Q),Math.max(Ae,me));return{position:"fixed",left:Y(I.left,F-ne-Ae),width:I.width,minWidth:260,...oe?{top:"auto",bottom:Y(j-I.top+6,j-re-Ae)}:{bottom:"auto",top:Y(I.bottom+6,j-re-Ae)},zIndex:ja(S)}},[A]),{open:k,setOpen:v,toggle:w,style:B,triggerRef:E,menuRef:D}=Ma({computeStyle:b,onScroll:"reposition",onResize:"reposition",ignoreOutsideClickSelector:".dropdown__menu"});o.useEffect(()=>{if(!k)return;const I=D.current;return(I?.querySelector(".date-picker__day--selected:not(:disabled)")??I?.querySelector(".date-picker__day--today:not(:disabled)")??I?.querySelector(".date-picker__day:not(:disabled)")??I?.querySelector(Cn)??I)?.focus?.(),()=>{const S=document.activeElement;(!S||S===document.body)&&E.current?.focus?.()}},[k,D,E]);const[N,O]=o.useState(1),P=o.useRef(null),G=o.useRef(null);o.useEffect(()=>{if(!k)return;const I=e&&e.slice(0,7)===`${x}-${String(C+1).padStart(2,"0")}`?+e.slice(8):y.slice(0,7)===`${x}-${String(C+1).padStart(2,"0")}`?+y.slice(8):1;O(I)},[k]),o.useEffect(()=>{if(G.current==null)return;const I=G.current;G.current=null,P.current?.querySelector(`[data-day="${I}"]`)?.focus()}),o.useEffect(()=>{O(I=>Math.min(I,pr(x,C)))},[x,C]);const L=o.useCallback(I=>{let S=mr(I.getFullYear(),I.getMonth(),I.getDate());r&&S<r&&(S=r),i&&S>i&&(S=i);const[j,F,U]=S.split("-").map(Number);(j!==x||F-1!==C)&&g(j,F-1),O(U),G.current=U},[r,i,x,C,g]),M=o.useCallback(I=>{const S=new Date(x,C,N),j=U=>{S.setDate(S.getDate()+U),L(S)},F=U=>{const re=S.getFullYear()*12+S.getMonth()+U,ne=Math.floor(re/12),le=re-ne*12;L(new Date(ne,le,Math.min(S.getDate(),pr(ne,le))))};switch(I.key){case"ArrowLeft":j(-1);break;case"ArrowRight":j(1);break;case"ArrowUp":j(-7);break;case"ArrowDown":j(7);break;case"Home":j(-S.getDay());break;case"End":j(6-S.getDay());break;case"PageUp":I.shiftKey?F(-12):F(-1);break;case"PageDown":I.shiftKey?F(12):F(1);break;default:return}I.preventDefault()},[x,C,N,L]),$=o.useCallback(I=>{s||(t(mr(x,C,I)),v(!1))},[x,C,t,v,s]);o.useEffect(()=>{s&&v(!1)},[s,v]);const Z=I=>{const S=mr(x,C,I);return!!(r&&S<r||i&&S>i)},q=(()=>{const I=pr(x,C);if(N>=1&&N<=I&&!Z(N))return N;for(let S=1;S<=I;S++)if(!Z(S))return S;return-1})(),z=[];for(let I=0;I<Fv(x,C);I++)z.push(null);for(let I=1;I<=pr(x,C);I++)z.push(I);const V=a===64?20:a===40?16:18,R=zv(x,(I,S)=>tr(d,m.language,I,S),r,i),H=`${x}-${String(C+1).padStart(2,"0")}`,W=k?en.createPortal(n.jsxs("div",{ref:D,id:A,className:"date-picker__dropdown",style:B,"data-tooltip-ignore":!0,role:"dialog","aria-label":d("datePicker.chooseDate","\uB0A0\uC9DC \uC120\uD0DD"),tabIndex:-1,children:[n.jsxs("div",{className:"date-picker__nav",children:[n.jsx("button",{type:"button",className:"date-picker__nav-btn",onClick:h,"aria-label":d("calendar.prevMonth","\uC774\uC804 \uB2EC"),children:n.jsx(js,{size:16,strokeWidth:2})}),n.jsx(pn,{className:"date-picker__nav-dropdown",ariaLabel:d("datePicker.selectYearMonth","\uC5F0\uC6D4 \uC120\uD0DD"),options:R,value:H,onChange:I=>{const[S,j]=I.split("-");g(+S,+j-1)},block:!0,size:40}),n.jsx("button",{type:"button",className:"date-picker__nav-btn",onClick:_,"aria-label":d("calendar.nextMonth","\uB2E4\uC74C \uB2EC"),children:n.jsx(Ms,{size:16,strokeWidth:2})})]}),n.jsxs("div",{className:"date-picker__grid",ref:P,onKeyDown:M,children:[f.map(I=>n.jsx("div",{className:"date-picker__dow caption-1",children:I},I)),z.map((I,S)=>{if(I===null)return n.jsx("div",{},`e${S}`);const j=mr(x,C,I),F=j===e,U=j===y,re=Z(I),ne=S%7;return n.jsx("button",{type:"button",disabled:re,"data-day":I,tabIndex:I===q?0:-1,"aria-current":U?"date":void 0,onClick:()=>!re&&$(I),className:_e("date-picker__day caption-1",F&&"date-picker__day--selected",U&&!F&&"date-picker__day--today",re&&"date-picker__day--disabled",ne===0&&"date-picker__day--sun",ne===6&&"date-picker__day--sat"),children:I},I)})]})]}),document.body):null;return n.jsxs("div",{className:_e("date-picker",`date-picker--s${a}`,k&&"date-picker--open",u),children:[n.jsxs("button",{ref:E,type:"button",className:"date-picker__trigger body-2",onClick:()=>!s&&w(),disabled:s,"aria-haspopup":"true","aria-expanded":k,children:[n.jsx("span",{className:e?"date-picker__value":"date-picker__placeholder",children:e?Ov(e):p}),n.jsx(Ws,{size:V,className:"date-picker__icon",strokeWidth:1.5})]}),W]})}function Hv({src:e,alt:t,className:a,style:r,tone:i,textColor:s}){const l=!i&&!!s,u=r2(e,l),c="bl"+o.useId().replace(/[^a-zA-Z0-9]/g,"");return i?n.jsx("span",{className:_e("brand-logo","brand-logo--tone",a),role:t?"img":void 0,"aria-label":t||void 0,"aria-hidden":t?void 0:!0,style:{...r,"--brand-logo-src":`url("${e}")`,"--brand-logo-tone":i},children:n.jsx("img",{src:e,alt:"","aria-hidden":"true",className:"brand-logo__sizer",draggable:!1})}):l&&u?n.jsx("span",{className:_e("brand-logo","brand-logo--inline",a),role:t?"img":void 0,"aria-label":t||void 0,"aria-hidden":t?void 0:!0,style:{...r,"--brand-logo-text-color":s},dangerouslySetInnerHTML:{__html:n2(t2(u),c)}}):n.jsx("img",{src:e,alt:t,className:_e("brand-logo",a),style:r,draggable:!1})}function gu({children:e,className:t}){const a=o.useRef(null),[r,i]=o.useState(null);return o.useEffect(()=>{i(a.current?.parentElement??null)},[]),o.useEffect(()=>{const s=a.current;if(!s||!r)return;const l=()=>{const c=typeof window<"u"&&window.getComputedStyle(s).position==="absolute"?Math.ceil(s.getBoundingClientRect().width):0;c>0?r.style.setProperty("--section-head-float-w",`${c}px`):r.style.removeProperty("--section-head-float-w")};if(l(),typeof ResizeObserver>"u")return()=>{r.style.removeProperty("--section-head-float-w")};const u=new ResizeObserver(()=>l());return u.observe(s),u.observe(r),()=>{u.disconnect(),r.style.removeProperty("--section-head-float-w")}},[r,e]),n.jsx("div",{ref:a,className:_e("section-head-float",t),children:e})}function Mo({items:e,className:t}){return n.jsx("div",{className:t?`manager-bar-chart-legend ${t}`:"manager-bar-chart-legend",children:e.map((a,r)=>n.jsxs("span",{className:"manager-bar-chart-legend-item",children:[n.jsx("span",{className:"manager-bar-chart-legend-dot",style:{background:a.color}}),a.label]},r))})}function Wa({label:e,children:t}){return e?n.jsxs("div",{className:"barchart-total barchart-total--stacked",children:[n.jsx("span",{className:"barchart-total__label body-3",children:e}),n.jsx("span",{className:"barchart-total__value",children:t})]}):n.jsx("div",{className:"barchart-total",children:t})}function Lo({title:e,titleClassName:t="h3",titleLevel:a=3,icon:r,disc:i,headRight:s,headFloat:l,headSegment:u,headMenuItems:c,collapseBelow:d=420,onClick:m,ariaLabel:p,tooltip:f,totalNum:y,totalUnit:x,totalLabel:C,subRow:h,subRowAlign:_="start",className:g,inGrid:A=!1,children:b}){const{t:k}=xe.useTranslation(),v=o.useRef(null),{anchorRect:w,openAt:B,close:E}=Ta(),D=o.useCallback(()=>{f&&v.current&&B(v.current)},[f,B]),[N,O]=o.useState(!1);To(()=>{const S=v.current;if(!S||!u)return;const j=U=>O(U>0&&U<d);if(j(S.clientWidth),typeof ResizeObserver>"u")return;const F=new ResizeObserver(U=>j(U[0].contentRect.width));return F.observe(S),()=>F.disconnect()},[u,d]);const[P,G]=o.useState(null),L=o.useCallback(()=>G(null),[]),M=o.useCallback(S=>{const j=S.currentTarget.getBoundingClientRect();G(F=>F?null:{left:j.left,right:j.right,top:j.top,bottom:j.bottom,width:j.width,height:j.height,x:j.x,y:j.y})},[]),$=!!u&&N;o.useEffect(()=>{$||G(null)},[$]);const Z=u?[...u.options.map(S=>({label:S.label,icon:S.icon,selected:S.key===u.value,disabled:S.disabled,onClick:()=>u.onChange(S.key),closeOnSelect:!0})),...(c??[]).map((S,j)=>j===0?{...S,separatorBefore:!0}:S)]:[],q=o.useCallback(S=>{if(!m)return;const j=S.target;j&&typeof j.closest=="function"&&j.closest('button, a, input, select, textarea, [role="radiogroup"]')||m()},[m]),z=o.useCallback(S=>{m&&S.target===S.currentTarget&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),m())},[m]),V=typeof s=="function"?s({collapsed:$}):s,R=y!=null||C?n.jsxs(Wa,{label:C,children:[y!=null&&n.jsx("span",{className:"barchart-total__num h0",children:y}),x&&n.jsx("span",{className:"barchart-total__unit h5",children:x})]}):null,H=V||u?n.jsxs("div",{className:"manager-section__head-right",children:[u&&($?n.jsx(pe,{htmlType:"button",size:32,type:"dot",icon:"ellipsis",ariaLabel:u.ariaLabel??k("common.more","\uB354\uBCF4\uAE30"),showTooltipInfo:u.ariaLabel??k("common.more","\uB354\uBCF4\uAE30"),"aria-haspopup":"menu","aria-expanded":!!P,onClick:M}):n.jsx(gn,{size:32,ariaLabel:u.ariaLabel,options:u.options.map(S=>({key:S.key,label:S.label,disabled:S.disabled})),value:u.value,onChange:u.onChange})),V]}):null,W=o.useId(),I=a?`h${a}`:"div";return n.jsxs("section",{ref:v,className:["manager-section",A&&"manager-section--grid",m&&"manager-section--clickable",g].filter(Boolean).join(" "),onClick:m?q:void 0,onKeyDown:m?z:void 0,onPointerEnter:f?D:void 0,onPointerLeave:f?E:void 0,onFocus:f?D:void 0,onBlur:f?E:void 0,role:m?"button":void 0,tabIndex:m?0:void 0,"aria-label":m?p??(typeof e=="string"?e:void 0):void 0,"aria-labelledby":!m&&e!=null?W:void 0,children:[f&&w&&n.jsx(Bn,{anchorRect:{left:w.left,top:w.top+21,right:w.right,bottom:w.bottom,width:w.width,height:w.height},text:f}),l&&n.jsx(gu,{children:l}),n.jsxs("div",{className:"manager-section__head",children:[n.jsxs("div",{className:"manager-section__title-row",children:[r&&n.jsx(at,{icon:r,label:typeof e=="string"?e:void 0,className:"manager-section__icon"}),n.jsx(I,{id:W,className:["manager-section__title",t].filter(Boolean).join(" "),children:e})]}),H,i&&n.jsx("div",{className:"manager-section__disc body-3",children:i})]}),(R||h)&&n.jsxs("div",{className:["barchart-sub-row",_!=="start"&&`barchart-sub-row--${_}`].filter(Boolean).join(" "),children:[R,h]}),b,P&&n.jsx(cn,{anchorRect:P,onClose:L,ariaLabel:u?.ariaLabel??k("tooltip.menu","\uBA54\uB274"),children:n.jsx(La,{columns:[{items:Z}],onClose:L,size:"small"})})]})}const Ha=(e,t)=>`${e}-${String(t).padStart(2,"0")}`,$o=e=>Ha(e.getFullYear(),e.getMonth()+1);function ca(e){const t=/^(\d{4})-(\d{2})$/.exec(e);if(!t)return null;const a=Number(t[2]);return a>=1&&a<=12?{year:Number(t[1]),month1:a}:null}const Ro=(e,t)=>`${e}#${t}`;function bn(e,t){const a=new Date(e,t,1).getDay();return 1+(8-(a===0?7:a))%7}function Vv(){const e=ra();let t=e.getFullYear(),a=e.getMonth(),r=e.getDate();if(r<bn(t,a)){const l=new Date(t,a,0);t=l.getFullYear(),a=l.getMonth(),r=l.getDate()}const i=Math.floor((r-bn(t,a))/7),s=Ha(t,a+1);return{monthKey:s,value:Ro(s,i)}}function qv(e){const t=ra(),a=$o(t),r=(c,d)=>Ha(c,d+1),i=new Map;i.set(a,[]);for(const c of e){if(isNaN(c.date.getTime()))continue;const d=r(c.date.getFullYear(),c.date.getMonth());i.has(d)||i.set(d,[]),i.get(d).push(c)}for(const[c,d]of[...i.entries()]){const m=ca(c);if(!m)continue;const p=m.year,f=m.month1-1,y=bn(p,f);if(!(c===a&&t.getDate()<y)&&!d.some(h=>h.date.getDate()<y))continue;const x=new Date(p,f,0),C=r(x.getFullYear(),x.getMonth());i.has(C)||i.set(C,[])}const s=new Map;for(const[c,d]of i){const m=ca(c);if(!m)continue;const p=m.year,f=m.month1-1,y=new Date(p,f+1,0).getDate(),x=d.reduce((b,k)=>Math.max(b,k.parts?.length??0,k.partsB?.length??0),0),C=d.some(b=>b.partsB),h=new Array(y+1).fill(0),_=new Array(y+1).fill(0),g=Array.from({length:y+1},()=>new Array(x).fill(0)),A=Array.from({length:y+1},()=>new Array(x).fill(0));for(const b of d){const k=b.date.getDate();if(h[k]+=b.a,_[k]+=b.b,b.parts)for(let v=0;v<x;v++)g[k][v]+=b.parts[v]??0;if(b.partsB)for(let v=0;v<x;v++)A[k][v]+=b.partsB[v]??0}s.set(c,{year:p,month:f,daysInMonth:y,partsLen:x,hasPartsB:C,dayA:h,dayB:_,dayParts:g,dayPartsB:A})}const l=(c,d,m)=>new Date(c,d,m).getTime()>new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),u={};for(const[c,d]of s){const{year:m,month:p,daysInMonth:f,dayA:y,dayB:x,dayParts:C,dayPartsB:h}=d,_=m===t.getFullYear()&&p===t.getMonth(),g=t.getDate(),A=s.get(r(p===11?m+1:m,(p+1)%12)),b=d.partsLen,k=[];for(let w=1;w<=f;w++){const B=_&&w>g;k.push({label:String(w),...B&&y[w]===0&&x[w]===0?{future:!0}:{},a:B&&y[w]===0&&x[w]===0?-1:y[w],b:x[w],...b?{parts:C[w]}:{},...b&&d.hasPartsB?{partsB:h[w]}:{}})}const v=[];for(let w=bn(m,p);w<=f;w+=7){const B=Math.max(0,w+6-f),E=B&&A?Math.max(b,A.partsLen):b,D=d.hasPartsB||!!(B&&A?.hasPartsB);let N=0,O=0;const P=new Array(E).fill(0),G=new Array(E).fill(0);for(let M=w;M<=Math.min(w+6,f);M++){N+=y[M],O+=x[M];for(let $=0;$<b;$++)P[$]+=C[M][$],G[$]+=h[M][$]}if(B&&A)for(let M=1;M<=B&&!l(A.year,A.month,M);M++){N+=A.dayA[M],O+=A.dayB[M];for(let $=0;$<A.partsLen;$++)P[$]+=A.dayParts[M][$],G[$]+=A.dayPartsB[M][$]}const L=B?`${(p+1)%12+1}/${B}`:`${w+6}`;v.push({label:`${v.length+1}\uC8FC`,sublabel:`[${w}\uC77C~${L}\uC77C]`,a:N,b:O,...E?{parts:P}:{},...E&&D?{partsB:G}:{}})}u[c]={weekly:v,daily:k}}return u}function bu(){const e=ra(),t=e.getFullYear(),a=e.getMonth()+1,r=[];for(let i=2024;i<=t;i++){const s=i===t?a:12;for(let l=1;l<=s;l++)r.push({value:Ha(i,l),year:i,month:l})}return r.reverse()}bu();function Uv(){return bu()}function yu(e,t){const a=e("calendar.weekOrdinal",{returnObjects:!0,defaultValue:[]}),r=Array.isArray(a)&&typeof a[t]=="string"?a[t]:null;return e("calendar.weekLabel",{ord:r??String(t+1)})}function vu(e){const{t,i18n:a}=xe.useTranslation(),[r,i]=o.useState("week"),s=o.useMemo(()=>Uv().filter(E=>E.value in e),[e]),l=o.useMemo(()=>{const E=[];for(const D of s){const N=new Date(D.year,D.month,0).getDate(),O=bn(D.year,D.month-1),P=Math.ceil((N-O+1)/7);for(let G=P-1;G>=0;G--)E.push({value:Ro(D.value,G),monthKey:D.value,year:D.year,month:D.month,week:G})}return E},[s]),u=o.useCallback(E=>`${tr(t,a.language,E.year,E.month)} ${yu(t,E.week)}`,[t]),c=o.useMemo(()=>s.map(E=>({value:E.value,label:tr(t,a.language,E.year,E.month)})),[t,a.language,s]),d=o.useMemo(()=>l.map(E=>({value:E.value,label:u(E)})),[l,u]),m=o.useMemo(()=>Vv(),[e]),p=o.useMemo(()=>s.find(E=>E.value===m.monthKey)?.value??s[0]?.value??"",[s,m]),f=o.useMemo(()=>l.find(E=>E.value===m.value)?.value??l[0]?.value??"",[l,m]),[y,x]=o.useState(""),[C,h]=o.useState("");o.useEffect(()=>{s.find(E=>E.value===y)||x(p)},[s,y,p]),o.useEffect(()=>{l.find(E=>E.value===C)||h(f)},[l,C,f]);const _=r==="month"?c:d,g=r==="month"?y:C,A=r==="month"?x:h,b=o.useMemo(()=>{const E=t("calendar.dow",{returnObjects:!0});return Array.isArray(E)?E:["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"]},[t]),k=_.findIndex(E=>E.value===g),v=o.useCallback(()=>{const E=_.findIndex(D=>D.value===g);E<_.length-1&&A(_[E+1].value)},[_,g,A]),w=o.useCallback(()=>{const E=_.findIndex(D=>D.value===g);E>0&&A(_[E-1].value)},[_,g,A]),B=o.useMemo(()=>[{key:"week",label:t("manager.chart.periodWeek","\uC8FC")},{key:"month",label:t("manager.chart.periodMonth","\uC6D4")}],[t]);return{period:r,setPeriod:i,range:g,setRange:A,activeOptions:_,activeIdx:k,handlePrev:v,handleNext:w,periodOptions:B,monthRange:y,weekRange:C,weekRanges:l,DOW:b}}const _t=e=>typeof e=="number"&&Number.isFinite(e)?e:0;function En(e,t=!0){return e.future===!0||t&&e.a===-1}function Gv({data:e,colorA:t,colorB:a,labelA:r,labelB:i,barWidth:s=10,barGap:l=1,height:u=140,maxOverride:c,tightMax:d,seriesColors:m,seriesLabels:p,rateLabels:f,grouped:y=!1,baseline:x,focusableBars:C=!1}){const h=!a,_=!!(m&&m.length>0),g=x,A=o.useMemo(()=>_?Math.max(0,...e.filter(z=>!En(z,g==null)).map(z=>y?Math.max(0,...(z.parts??[]).map(_t)):(z.parts??[]).reduce((V,R)=>V+Math.max(0,_t(R)),0))):Math.max(0,...e.filter(z=>!En(z,g==null)).flatMap(z=>h?[_t(z.a)]:[_t(z.a),_t(z.b)])),[e,h,_,y]),b=o.useMemo(()=>{if(g==null)return 0;const z=e.filter(V=>!En(V,g==null)).flatMap(V=>_?(V.parts??[]).map(_t):h?[_t(V.a)]:[_t(V.a),_t(V.b)]);return Math.max(0,...z.map(V=>Math.abs(V-g)))},[e,g,_,h]),k=o.useMemo(()=>{const z=g!=null?b:A;return c??(d?z>0?z:10:Math.ceil(z/10)*10||10)},[A,b,g,c,d]),v=u,w=_?y?Math.max(1,m.length):1:h?1:2,B={"--bar-width":`${o.useMemo(()=>{const z=Math.max(1,e.length);return Math.max(2,Math.min(s,Math.round(120/(z*w)+6)))},[e.length,w,s])}px`},E={"--bar-group-gap":`${Math.max(0,l)}px`},D=o.useMemo(()=>{const z=Math.round(k/2);return g!=null?[g+k,...z!==k?[g+z]:[],g,...z!==k?[g-z]:[],g-k]:z!==k?[k,z,0]:[k,0]},[k,g]),N=z=>g!=null?1-(z-(g-k))/(2*k):1-z/k,[O,P]=o.useState(null),G=o.useCallback(()=>P(null),[]),L=o.useCallback((z,V)=>{const R=[z.label,z.sublabel].filter(Boolean).join(" ");let H;if(_&&y&&z.rawPartsB)H=(p??[]).map((W,I)=>{const S=z.rawPartsB[I]??0;return{text:S>0?`${W}: ${V[I]??0}% (${z.rawParts?.[I]??0}/${S})`:`${W}: -`,color:(m??[])[I]}});else if(_&&y)H=(p??[]).map((W,I)=>({text:`${W}: ${Z(V[I]??0)}`,color:(m??[])[I]}));else if(_){const W=(p??[]).map((S,j)=>({text:`${S}: ${V[j]??0}`,color:(m??[])[j]})),I=W.filter((S,j)=>(V[j]??0)>0);H=I.length?I:W}else f&&!h?H=[{text:`${r} ${_t(z.a)}%`,color:t},{text:`${i} ${_t(z.b)}%`,color:a}]:f&&z.rawB!==void 0?H=[{text:`${f.total} ${z.rawB}`},{text:`${f.done} ${z.rawA??0}`,color:t}]:h?H=[{text:`${r}: ${_t(z.a)}`,color:t}]:H=[{text:`${r}: ${_t(z.a)}`,color:t},{text:`${i}: ${_t(z.b)}`,color:a}];return{title:R,items:H}},[_,y,p,m,f,h,r,i,t,a,g]),M=o.useCallback((z,V,R)=>{const H=z.getBoundingClientRect(),{title:W,items:I}=L(V,R);P({rect:{left:H.left,top:H.top,right:H.right,bottom:H.bottom,width:H.width,height:H.height},title:W,items:I})},[L]),$=o.useCallback((z,V)=>{const{title:R,items:H}=L(z,V);return[R,...H.map(W=>W.text)].filter(Boolean).join(", ")},[L]),Z=z=>g!=null&&z>g?`+${z}`:`${z}`,q=O!=null;return o.useEffect(()=>{if(!q)return;const z=()=>P(null),V=R=>{const H=R.target;H&&typeof H.closest=="function"&&H.closest(".manager-bar-chart-col")||P(null)};return window.addEventListener("scroll",z,!0),document.addEventListener("pointerdown",V,!0),()=>{window.removeEventListener("scroll",z,!0),document.removeEventListener("pointerdown",V,!0)}},[q]),n.jsxs("div",{className:"manager-bar-chart-wrap",style:E,children:[n.jsx("div",{className:"manager-bar-chart-inner",children:n.jsx("div",{className:"manager-bar-chart-scroll",children:n.jsxs("div",{className:"manager-bar-chart-area",children:[n.jsxs("div",{className:"manager-bar-chart-plot",style:{height:v},children:[D.slice(0,-1).map((z,V)=>n.jsx("div",{className:`manager-bar-chart-gridline${g!=null&&z===g?" manager-bar-chart-gridline--baseline":""}`,style:{top:N(z)*v},children:n.jsx("span",{className:"manager-bar-chart-gridline__label caption-1",children:z})},V)),e.map((z,V)=>{const R=En(z,g==null),H=v/2,W=F=>g!=null?Math.min(H,Math.abs(_t(F)-g)/k*H):Math.min(v,Math.max(0,_t(F)/k*v)),I=R?0:W(z.a),S=R?0:W(z.b),j=(z.parts??[]).map(_t);return n.jsx("div",{className:`manager-bar-chart-col${y&&_?" manager-bar-chart-col--group":""}`,style:{cursor:R?"default":"pointer"},tabIndex:C&&!R?0:void 0,role:C&&!R?"img":void 0,"aria-label":C&&!R?$(z,j):void 0,onMouseEnter:R?void 0:F=>M(F.currentTarget,z,j),onFocus:R||!C?void 0:F=>M(F.currentTarget,z,j),onBlur:C?G:void 0,onMouseLeave:G,children:!R&&(_&&y?(m??[]).map((F,U)=>{const re=j[U]??0;if(g==null)return n.jsx("div",{className:"manager-bar-chart-bar",style:{...B,height:W(re),background:F}},U);const ne=_t(re)<g;return n.jsxs("div",{className:"manager-bar-chart-slot",style:B,children:[n.jsx("div",{className:"manager-bar-chart-slot__half manager-bar-chart-slot__half--up",children:!ne&&n.jsx("div",{className:"manager-bar-chart-bar manager-bar-chart-bar--full",style:{height:W(re),background:F}})}),n.jsx("div",{className:"manager-bar-chart-slot__half manager-bar-chart-slot__half--down",children:ne&&n.jsx("div",{className:"manager-bar-chart-bar manager-bar-chart-bar--full manager-bar-chart-bar--down",style:{height:W(re),background:F}})})]},U)}):_?n.jsx("div",{className:"manager-bar-chart-stack",style:B,children:(()=>{const F=j.reduce((re,ne,le)=>ne>0?le:re,-1);let U=v;return j.map((re,ne)=>{if(re<=0)return null;const le=Math.min(U,re/k*v);return U-=le,n.jsx("div",{className:"manager-bar-chart-stack-segment",style:{height:le,background:(m??[])[ne],borderRadius:ne===F?"6px 6px 0 0":void 0}},ne)})})()}):g!=null?n.jsx(n.Fragment,{children:[{v:_t(z.a),c:t},...h?[]:[{v:_t(z.b),c:a}]].map(({v:F,c:U},re)=>n.jsxs("div",{className:"manager-bar-chart-slot",style:B,children:[n.jsx("div",{className:"manager-bar-chart-slot__half manager-bar-chart-slot__half--up",children:F>=g&&n.jsx("div",{className:"manager-bar-chart-bar manager-bar-chart-bar--full",style:{height:W(F),background:U}})}),n.jsx("div",{className:"manager-bar-chart-slot__half manager-bar-chart-slot__half--down",children:F<g&&n.jsx("div",{className:"manager-bar-chart-bar manager-bar-chart-bar--full manager-bar-chart-bar--down",style:{height:W(F),background:U}})})]},re))}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"manager-bar-chart-bar",style:{...B,height:I,background:t}}),!h&&n.jsx("div",{className:"manager-bar-chart-bar",style:{...B,height:S,background:a}})]}))},V)})]}),n.jsx("div",{className:"manager-bar-chart-x-axis",children:e.map((z,V)=>{const R=En(z,g==null);return n.jsxs("span",{className:`manager-bar-chart-x-axis__label${R?" manager-bar-chart-x-axis__label--future":""}`,children:[n.jsxs("span",{className:"caption-1 manager-bar-chart-x-axis__main",children:[z.isToday&&n.jsx("span",{className:"manager-bar-chart-x-axis__today-dot",style:{background:t}}),z.label]}),z.sublabel&&n.jsx("span",{className:"caption-1",children:z.sublabel})]},V)})})]})})}),O&&n.jsx(Kn,{anchorRect:O.rect,title:O.title,items:O.items,showIndex:!1,closeOnOutsideClick:!1})]})}function xu({control:e}){const{t}=xe.useTranslation(),{activeOptions:a,activeIdx:r,range:i,setRange:s,handlePrev:l,handleNext:u,periodOptions:c,period:d,setPeriod:m}=e,p=d==="week"?t("calendar.prevWeek","\uC774\uC804 \uC8FC"):t("calendar.prevMonth","\uC774\uC804 \uB2EC"),f=d==="week"?t("calendar.nextWeek","\uB2E4\uC74C \uC8FC"):t("calendar.nextMonth","\uB2E4\uC74C \uB2EC");return n.jsxs("div",{className:"manager-section-controls",children:[n.jsx(pe,{htmlType:"button",size:32,type:"dot",icon:"chevron-left",ariaLabel:p,showTooltipInfo:p,disabled:r===a.length-1,onClick:l}),n.jsx(pn,{value:i,onChange:s,options:a,size:40,className:"month-dropdown",ariaLabel:t("calendar.rangeSelect","\uAE30\uAC04 \uC120\uD0DD")}),n.jsx(pe,{htmlType:"button",size:32,type:"dot",icon:"chevron-right",ariaLabel:f,showTooltipInfo:f,disabled:r<=0,onClick:u}),n.jsx(gn,{ariaLabel:t("calendar.periodSelect","\uAE30\uAC04 \uB2E8\uC704"),options:c,value:d,onChange:y=>m(y),size:40})]})}function Po(e,t,a,r=!0){const i=new Date(a.getFullYear(),a.getMonth(),a.getDate());return Array.from({length:7},(s,l)=>{const u=new Date(t);u.setDate(t.getDate()+l);const c=(e[$o(u)]?.daily??[])[u.getDate()-1],d=c!=null&&En(c,r)||u>i;return{dt:u,entry:c,isFuture:d}})}function Kv(e,t,a,r=!0){const{period:i,monthRange:s,weekRange:l,weekRanges:u,DOW:c}=t,d=ra(),m=d.getFullYear(),p=d.getMonth()+1,f=d.getDate();if(i==="month"){const C=e[s]??{weekly:[],daily:[]},h=ca(s),_=h?h.year:null,g=h?h.month1:null,A=_&&g?bn(_,g-1):1;return C.weekly.map((b,k)=>{const v=k+1;let w=b.label,B=!1,E=!1;if(_&&g){const D=A+k*7,N=new Date(_,g-1,D+6),O=N.getMonth()+1,P=N.getDate(),G=O===g?`${P}`:`${O}/${P}`;w=a("manager.chart.weekRange",{start:D,end:G});const L=new Date(m,p-1,f).getTime();B=L>=new Date(_,g-1,D).getTime()&&L<=N.getTime(),E=_>m||_===m&&(g>p||g===p&&D>f)}return{...b,label:w,sublabel:yu(a,v-1),isToday:B,future:b.future===!0||E||void 0,a:E?-1:b.a,b:E?0:b.b}})}const y=u.find(C=>C.value===l);if(!y)return[];const x=new Date(y.year,y.month-1,bn(y.year,y.month-1)+y.week*7);return Po(e,x,d,r).map(({dt:C,entry:h,isFuture:_})=>{const g=C.getMonth()+1,A=C.getDate(),b=C.getFullYear();return{label:g===y.month&&b===y.year?`${A}`:`${g}/${A}`,sublabel:c[C.getDay()]??"",future:_||void 0,a:_?-1:h&&h.a>0?h.a:0,b:_?0:h&&h.b>0?h.b:0,isToday:b===m&&g===p&&A===f,...h?.parts?{parts:_?h.parts.map(()=>0):h.parts}:{},...h?.partsB?{partsB:_?h.partsB.map(()=>0):h.partsB}:{}}})}const Yv={small:{height:100,barWidth:16},medium:{height:140,barWidth:20},large:{height:180,barWidth:24}};function Zv({focusableBars:e,size:t="medium",barWidth:a,titleKey:r,titleLevel:i,data:s,colorA:l,colorB:u,labelAKey:c,labelBKey:d,showTotal:m=!1,totalUnitKey:p,totalLabelKey:f,control:y,hideControls:x=!1,rate:C=!1,rateAgg:h="dayMean",tightMax:_=!1,avgMode:g=!1,totalFormat:A,series:b,seriesMode:k="stack",loading:v=!1,onDetail:w,headExtra:B,headSegment:E,icon:D,disc:N,onClick:O,cardAriaLabel:P,cardTooltip:G,detailSize:L=32,barGap:M,baseline:$,className:Z,inGrid:q=!1}){const{t:z}=xe.useTranslation(),V=Yv[t],R=vu(s),H=y??R,W=o.useMemo(()=>Kv(s,H,z,$==null),[s,H,z,$]),I=k==="group"&&!!b&&b.length>0;M!=null&&!I&&St("bar-chart-bargap-without-group","[BarChart] barGap \uC740 seriesMode='group' + series \uC5D0\uC11C\uB9CC \uC4F0\uC778\uB2E4 \u2014 \uADF8 \uBC16\uC5D0\uC11C\uB294 \uC544\uBB34 \uC77C\uB3C4 \uD558\uC9C0 \uC54A\uB294\uB2E4.");const S=o.useMemo(()=>{if(!C)return W;const K=H.period==="month"?ca(H.monthRange):null,oe=ra(),Ae=b?.length??0,Y=Q=>{const me=[],De=[],be=[];for(let te=0;te<Ae;te++){let ue=0,fe=0,ge=0;for(const Ce of Q){const $e=_t(Ce.a[te]),He=_t(Ce.b[te]);He<=0||(ue+=$e,fe+=He,ge+=$e/He*100)}me.push(h==="weighted"?fe>0?Math.round(ue/fe*100):0:Q.length?Math.round(ge/Q.length):0),De.push(ue),be.push(fe)}return{pct:me,ra:De,rb:be}};return W.map((Q,me)=>{let De=Q.a===-1?-1:Q.b>0?Math.round(Q.a/Q.b*100):0;if(K&&!En(Q)){const te=K.year,ue=K.month1-1,fe=Po(s,new Date(te,ue,bn(te,ue)+me*7),oe).filter(ge=>!ge.isFuture);if(h==="weighted"){let ge=0,Ce=0;for(const{entry:$e}of fe)$e&&$e.b>0&&(ge+=$e.a,Ce+=$e.b);De=Ce>0?Math.round(ge/Ce*100):0}else De=fe.length?Math.round(fe.reduce((ge,{entry:Ce})=>ge+(Ce&&Ce.b>0?Ce.a/Ce.b*100:0),0)/fe.length):0}let be=null;if(I&&!En(Q)){let te;if(K){const fe=K.year,ge=K.month1-1;te=Po(s,new Date(fe,ge,bn(fe,ge)+me*7),oe).filter(Ce=>!Ce.isFuture).map(({entry:Ce})=>({a:Ce?.parts??[],b:Ce?.partsB??[]}))}else te=[{a:Q.parts??[],b:Q.partsB??[]}];const ue=Y(te);be={parts:ue.pct,rawParts:ue.ra,rawPartsB:ue.rb}}return{...Q,a:De,b:Q.a===-1?0:d&&Q.parts&&Q.parts[1]>0?Math.round(Q.parts[0]/Q.parts[1]*100):0,rawA:Q.a===-1?-1:Q.a,rawB:Q.b,...be??{}}})},[W,C,h,d,H.period,H.monthRange,s,I,b?.length]),j=o.useMemo(()=>{if(C||g){const oe=(H.period==="week"?W:s[H.monthRange]?.daily??[]).filter(Y=>Y.a!==-1);if(oe.length===0)return 0;if(C&&h==="weighted"){let Y=0,Q=0;for(const me of oe)me.b>0&&(Y+=me.a,Q+=me.b);return Q>0?Math.round(Y/Q*100):0}const Ae=C?oe.reduce((Y,Q)=>Y+(Q.b>0?Q.a/Q.b*100:0),0):oe.reduce((Y,Q)=>Y+(Q.a>0?Q.a:0),0);return Math.round(Ae/oe.length)}const K=H.period==="month"?s[H.monthRange]?.daily??[]:S;return $!=null?K.reduce((oe,Ae)=>oe+(En(Ae,!1)?0:_t(Ae.a)+(d?_t(Ae.b):0)),0):K.reduce((oe,Ae)=>oe+(Ae.a>0?Ae.a:0)+(d&&Ae.b>0?Ae.b:0),0)},[S,W,C,h,g,$,d,H.period,H.monthRange,s]),F=b&&b.length>0?b.map(K=>({color:K.color,label:K.label})):[{color:l,label:z(c)},...d?[{color:u,label:z(d)}]:[]],U=t==="small",re=[U?"manager-section--compact":t==="large"?"manager-section--full":void 0,Z].filter(Boolean).join(" ")||void 0,ne=r?z(r):"",le=ne?z("trainingStatus.detailFor",{name:ne,defaultValue:"{{name}} \uC0C1\uC138\uBCF4\uAE30"}):z("trainingStatus.detail","\uC0C1\uC138\uBCF4\uAE30");return n.jsx(Lo,{className:re,inGrid:q,icon:D,disc:N,onClick:O,ariaLabel:P,tooltip:G,headSegment:E,headMenuItems:w?[{label:le,icon:"list",onClick:w,closeOnSelect:!0}]:void 0,title:z(r),titleLevel:i,titleClassName:U?"h5 chart-section-title--small":void 0,headRight:U?B??void 0:({collapsed:K})=>n.jsxs(n.Fragment,{children:[!x&&n.jsx(xu,{control:H}),B,w&&!K&&n.jsx("span",{className:"manager-bar-chart-detail-btn",children:n.jsx(pe,{htmlType:"button",size:L,type:"dot",icon:"list",ariaLabel:le,showTooltipInfo:le,onClick:w})})]}),subRow:n.jsxs(n.Fragment,{children:[m?C||g||f&&A?n.jsx(Wa,{label:U?void 0:`${z(H.period==="week"?"manager.chart.weeklyPrefix":"manager.chart.monthlyPrefix")} ${z(f??c)}`,children:A?(A(j).match(/([+-]?\d[\d.,]*|[^\d]+)/g)??[]).map((K,oe)=>/\d/.test(K)?n.jsx("span",{className:"barchart-total__num h0",children:K},oe):n.jsx("span",{className:"barchart-total__unit h5",children:K},oe)):n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"barchart-total__num h0",children:j}),p&&n.jsx("span",{className:"barchart-total__unit h5",children:z(p)})]})}):n.jsxs(Wa,{children:[n.jsx("span",{className:"barchart-total__num h0",children:j}),n.jsx("span",{className:"barchart-total__unit h5",children:z(c)}),p&&n.jsx("span",{className:"barchart-total__unit h5",children:z(p)})]}):n.jsx("span",{}),n.jsx(Mo,{items:F,className:"caption-1"})]}),children:v?n.jsx("div",{className:"manager-bar-chart-wrap manager-bar-chart-loading","aria-busy":"true",children:n.jsx("div",{className:"manager-bar-chart-inner",children:n.jsxs("div",{className:"manager-bar-chart-area manager-bar-chart-area--loading",children:[n.jsx("div",{className:"manager-bar-chart-plot manager-bar-chart-plot--loading",style:{height:V.height},children:n.jsx(za,{size:32})}),n.jsx("div",{className:"manager-bar-chart-x-axis","aria-hidden":"true",children:n.jsxs("span",{className:"manager-bar-chart-x-axis__label",children:[n.jsx("span",{className:"caption-1 manager-bar-chart-x-axis__main",children:"\xA0"}),S.some(K=>!!K.sublabel)&&n.jsx("span",{className:"caption-1",children:"\xA0"})]})})]})})}):n.jsx(Gv,{focusableBars:e,data:S,colorA:l,colorB:d?u:void 0,labelA:z(c),labelB:d?z(d):void 0,barWidth:a??V.barWidth,barGap:M,baseline:$,height:V.height,maxOverride:C?100:void 0,tightMax:_,seriesColors:b?.map(K=>K.color),seriesLabels:b?.map(K=>K.label),rateLabels:C?{total:z("trainingStatus.today.tooltipTotal","\uC804\uCCB4"),done:z("trainingStatus.today.tooltipDone","\uC644\uB8CC")}:void 0,grouped:I})})}const _u=120,Xv={left:38,right:16,top:26,bottom:24};function Jv({points:e=[],range:t,ticks:a=[],axisTitle:r,color:i,height:s=156,fallbackWidth:l=320,insets:u,overlay:c,ariaLabel:d,className:m}){const[p,f]=o.useState(null),[y,x]=o.useState(null);o.useEffect(()=>{if(!y)return;const $=q=>f(Math.round(q)||null);if($(y.getBoundingClientRect().width),typeof ResizeObserver>"u")return;const Z=new ResizeObserver(([q])=>$(q.contentRect.width));return Z.observe(y),()=>{Z.disconnect()}},[y]);const{payload:C,anchorRect:h,openAfterDelay:_,close:g}=Qy(_u),A=o.useCallback(($,Z)=>{$&&_($,Z.getBoundingClientRect())},[_]),b=p??l,k=s,{left:v,right:w,top:B,bottom:E}={...Xv,...u},[D,N]=t,O=$=>N===D?v:v+(b-v-w)*($-D)/(N-D),P=$=>B+(k-B-E)*(100-$)/100,G={x:O,y:P,plot:{left:v,right:b-w,top:B,bottom:k-E,width:Math.max(0,b-v-w),height:Math.max(0,k-B-E)}},L=e.filter($=>!$.hollow),M=i??"var(--color-main)";return n.jsxs(n.Fragment,{children:[n.jsxs("svg",{ref:x,className:_e("line-chart",m),viewBox:`0 0 ${b} ${k}`,role:"img","aria-label":d??e.map($=>$.description).filter(Boolean).join(", "),children:[r&&n.jsx("text",{className:"line-chart__axis-title",x:0,y:12,children:r}),[0,100].map($=>n.jsxs("g",{children:[n.jsx("line",{className:"line-chart__grid",x1:v,x2:b-w,y1:P($),y2:P($)}),n.jsxs("text",{className:"line-chart__tick",x:v-6,y:P($)+4,textAnchor:"end",children:[$,"%"]})]},$)),c?.(G),a.map($=>n.jsx("text",{className:"line-chart__tick",x:O($.x),y:k-5,textAnchor:"middle",children:$.label},$.x)),L.length>1&&n.jsx("polyline",{className:"line-chart__line",fill:"none",stroke:M,points:L.map($=>`${O($.x)},${P($.pct)}`).join(" ")}),e.map($=>n.jsxs("g",{className:"line-chart__dot",onPointerEnter:Z=>A($.description,Z.currentTarget),onPointerLeave:g,children:[n.jsx("circle",{className:"line-chart__dot-hit",cx:O($.x),cy:P($.pct),r:12}),n.jsx("circle",{className:_e("line-chart__dot-main",$.hollow&&"is-hollow"),cx:O($.x),cy:P($.pct),r:4,stroke:M,fill:$.hollow?void 0:M})]},$.x))]}),C!=null&&n.jsx(cn,{anchorRect:h,offset:10,closeOnOutsideClick:!1,className:"line-chart__tip",role:"tooltip",ariaLabel:C,children:C})]})}function Qv({icon:e,iconSize:t=56,title:a,titleClass:r="h2",description:i,tipGroups:s,start:l,className:u}){return n.jsxs("div",{className:_e("game-intro",u),children:[e!=null&&n.jsx("span",{className:"game-intro__icon","aria-hidden":"true",style:{"--game-intro-icon":`${t}px`},children:e}),n.jsx("h2",{className:_e("game-intro__title",r),children:a}),i!=null&&n.jsx("p",{className:"game-intro__description body-3",children:i}),s?.map((c,d)=>n.jsxs("div",{className:"game-intro__tips",children:[c.title!=null&&n.jsx("span",{className:"game-intro__tips-title body-3",children:c.title}),c.tips.map((m,p)=>n.jsxs("span",{className:"game-intro__tip body-3",children:[m.icon!=null&&n.jsx("span",{"aria-hidden":"true",children:m.icon}),n.jsx("span",{children:m.text})]},p))]},d)),l&&n.jsx(pe,{htmlType:"button",className:l.className,variant:"main",color:l.color,size:48,width:"100%",disabled:l.disabled,onClick:l.onClick,children:l.label})]})}const wu=(e,t,a)=>{const r=new Date(Date.UTC(e,t,a));return`${r.getUTCFullYear()}-${String(r.getUTCMonth()+1).padStart(2,"0")}-${String(r.getUTCDate()).padStart(2,"0")}`},Bu=(e,t,a,r)=>({from:Li(e,t,a),to:new Date(Li(e,t,a+r).getTime()-1),fromYmd:wu(e,t,a),toYmd:wu(e,t,a+r-1)});function e4(e,t=0){if(e.period==="month"){const i=ca(e.monthRange),s=ra(),l=i?i.year:s.getFullYear(),u=(i?i.month1:s.getMonth()+1)-1+t,c=new Date(Date.UTC(l,u+1,0)).getUTCDate();return Bu(l,u,1,c)}const a=e.weekRanges.find(i=>i.value===e.weekRange);if(!a){const i=new Date,s=Ea();return{from:i,to:i,fromYmd:s,toYmd:s}}const r=bn(a.year,a.month-1);return Bu(a.year,a.month-1,r+(a.week+t)*7,7)}const Io={small:{diameter:96,strokeWidth:16},medium:{diameter:120,strokeWidth:18},large:{diameter:160,strokeWidth:22}};function ku(e){return!Number.isFinite(e)||e<=0?0:e>=1?100:Math.min(99,Math.max(1,Math.round(e*100)))}function Au({done:e,total:t,segments:a,color:r="var(--color-main)",size:i="medium",strokeWidth:s,label:l="%",hideCenter:u=!1,hideLabel:c=!1}){const d=typeof i=="number"?i:Io[i].diameter,m=s??(typeof i=="number"?12:Io[i].strokeWidth),p=d/2,f=(d-m)/2,y=2*Math.PI*f;if(a&&a.length>0){const _=a.reduce((g,A)=>{const b=g.length>0?g[g.length-1].acc:0,k=Number.isFinite(A.ratio)?A.ratio:0,v=Math.max(0,Math.min(k,1-b));return g.push({color:A.color,rotate:-90+b*360,dash:y*v,acc:b+v}),g},[]);return n.jsx("div",{className:"ring-chart",style:{width:d,height:d},children:n.jsxs("svg",{width:d,height:d,viewBox:`0 0 ${d} ${d}`,"aria-hidden":"true",children:[n.jsx("circle",{cx:p,cy:p,r:f,fill:"none",stroke:"var(--color-whiteLine)",strokeWidth:m}),_.map((g,A)=>g.dash>0&&n.jsx("circle",{cx:p,cy:p,r:f,fill:"none",stroke:g.color,strokeWidth:m,strokeDasharray:`${g.dash} ${y}`,strokeLinecap:"round",transform:`rotate(${g.rotate} ${p} ${p})`},A))]})})}const x=(t??0)>0?Math.min((e??0)/t,1):0,C=y*x,h=y-C;return n.jsxs("div",{className:"ring-chart",style:{width:d,height:d},children:[n.jsxs("svg",{width:d,height:d,viewBox:`0 0 ${d} ${d}`,"aria-hidden":"true",children:[n.jsx("circle",{cx:p,cy:p,r:f,fill:"none",stroke:"var(--color-whiteLine)",strokeWidth:m}),x>0&&n.jsx("circle",{cx:p,cy:p,r:f,fill:"none",stroke:r,strokeWidth:m,strokeDasharray:`${C} ${h}`,strokeLinecap:x<.02||x>.98?"butt":"round",transform:`rotate(-90 ${p} ${p})`})]}),!u&&n.jsxs("div",{className:`ring-chart__center${c?"":` ${d<=96?"ring-chart__center--small":i==="medium"?"ring-chart__center--medium":"ring-chart__center--large"}`}`,children:[n.jsx("span",{className:`ring-chart__pct ${d<=96?"h2":"h1"}`,children:ku(x)}),!c&&n.jsx("span",{className:`ring-chart__label ${d<=96?"caption-2":"caption-1"}${d<=96||i==="medium"?" ring-chart__label--tight":""}`,children:l})]})]})}function t4({titleKey:e,titleLevel:t,headRight:a,icon:r,showTotal:i,totalLabelKey:s,legend:l,loading:u,className:c,inGrid:d=!1,onClick:m,ariaLabel:p,tooltip:f,...y}){const{t:x}=xe.useTranslation();if(!e)return n.jsx(Au,{...y});const C=(y.total??0)>0?ku(Math.min((y.done??0)/y.total,1)):0,h=y.size==="small",_=typeof y.size=="number"?y.size:Io[y.size??"medium"].diameter,g=y.size==="large",A=[c,h?"manager-section--compact":g?"manager-section--full":""].filter(Boolean).join(" ")||void 0,b=r&&n.jsx("span",{className:"chart-section-icon",children:n.jsx(at,{icon:r,className:"chart-section-icon-inner"})});return n.jsx(Lo,{className:A,inGrid:d,onClick:m,ariaLabel:p,tooltip:f,title:x(e),titleLevel:t,titleClassName:h?"h5 chart-section-title--small":void 0,headRight:b||(h?void 0:a),subRow:(i||l)&&n.jsxs(n.Fragment,{children:[i?n.jsxs(Wa,{label:!h&&s?x(s):void 0,children:[n.jsx("span",{className:"barchart-total__num h0",children:C}),n.jsx("span",{className:"barchart-total__unit h5",children:"%"})]}):n.jsx("span",{}),l&&n.jsx(Mo,{items:l})]}),children:u?n.jsx("div",{className:"ring-chart-section-body ring-chart-section-body--offset",children:n.jsx("div",{className:"ring-chart ring-chart--loading",style:{width:_,height:_},"aria-busy":"true",children:n.jsx(za,{size:32})})}):n.jsx("div",{className:"ring-chart-section-body ring-chart-section-body--offset",children:n.jsx(Au,{...y,hideCenter:y.hideCenter??h})})})}function n4({label:e,value:t,change:a,changeType:r,icon:i,tooltip:s,onClick:l,children:u}){const c=o.useRef(null),{anchorRect:d,openAt:m,close:p}=Ta(),f=o.useCallback(()=>{s&&c.current&&m(c.current)},[s,m]),y=r??(a===void 0?void 0:a>0?"up":a<0?"down":"neutral"),x=a===void 0?void 0:a>0?`+${a}`:`${a}`,C=o.useCallback(h=>{l&&(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),l())},[l]);return n.jsxs("div",{ref:c,className:`manager-stat-card${l?" manager-stat-card--clickable":""}`,onClick:l,onKeyDown:l?C:void 0,onPointerEnter:f,onPointerLeave:p,onFocus:f,onBlur:p,role:l?"button":void 0,tabIndex:l?0:void 0,"aria-label":l?[e,t,x].filter(h=>h!==void 0&&h!=="").join(" "):void 0,children:[s&&d&&n.jsx(Bn,{anchorRect:{left:d.left,top:d.top+21,right:d.right,bottom:d.bottom,width:d.width,height:d.height},text:s}),n.jsxs("div",{className:"manager-stat-card__label-row",children:[n.jsx("span",{className:"manager-stat-card__label h5",children:e}),i&&n.jsx("span",{className:"manager-stat-card__icon",children:n.jsx(at,{icon:i,className:"manager-stat-card__icon-inner"})})]}),n.jsxs("div",{className:"manager-stat-card__content",children:[n.jsxs("div",{className:"manager-stat-card__left",children:[n.jsx("div",{className:"manager-stat-card__value h2",children:t}),x&&n.jsx("div",{className:`manager-stat-card__change manager-stat-card__change--${y??"neutral"} caption-1`,children:x})]}),u&&n.jsx("div",{className:"manager-stat-card__body",children:u})]})]})}function Nu({value:e,onChange:t,min:a=0,max:r=100,step:i=1,orientation:s="horizontal",size:l=24,disabled:u=!1,ariaLabel:c,length:d,className:m,label:p,formatValue:f,labelPos:y,labelAlign:x="right",showMinMax:C=!1,minLabel:h,maxLabel:_,showBgTick:g=!1,showFillTick:A=!1,tickStep:b,tickShape:k="dot"}){t&&!c&&St("Slider:unnamed","[ihab/Slider] \uC774\uB984\uC774 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 ariaLabel \uC744 \uC8FC\uC138\uC694. label prop \uC740 \uAC12 \uD45C\uAE30 \uBC29\uC2DD\uC774\uC9C0 \uC774\uB984\uC774 \uC544\uB2D9\uB2C8\uB2E4.");const v=Math.min(r,Math.max(a,e)),w=r>a?(v-a)/(r-a):0,B=s==="vertical",E=!t,D=W=>t?.(Number(W.target.value)),N=typeof d=="number"?`${d}px`:d,O={"--slider-ratio":String(w),"--slider-thumb":`${l}px`,...N?B?{height:N}:{width:N}:{}},P=b??i,G=(g||A)&&P>0&&r>a?Math.floor((r-a)/P+1e-6):0;if(G>0&&G<=100){const W=k!=="dash",I=re=>W?`radial-gradient(circle, ${re} 0.5px, transparent 1px)`:B?`linear-gradient(to bottom, transparent calc(50% - 2px), ${re} calc(50% - 2px), ${re} calc(50% + 2px), transparent calc(50% + 2px))`:`linear-gradient(to right, transparent calc(50% - 2px), ${re} calc(50% - 2px), ${re} calc(50% + 2px), transparent calc(50% + 2px))`,S=W?"2px":"4px",j=[],F=[],U=[];for(let re=0;re<=G;re++){const ne=re*P/(r-a);if(ne>1+1e-6)break;const le=`${((B?1-ne:ne)*100).toFixed(4)}%`,K=ne<=w+1e-6;if(K?!A:!g)continue;const oe=K?"var(--slider-tick-color-on-fill, var(--color-deepWhite))":"var(--slider-tick-color, var(--color-lightGray))";j.push(I(oe)),F.push(B?`${S} var(--slider-thumb)`:`var(--slider-thumb) ${S}`),U.push(B?`center ${le}`:`${le} center`)}j.push(B?"linear-gradient(to top, var(--slider-fill-color) var(--slider-fill), var(--color-darkWhite) var(--slider-fill))":"linear-gradient(to right, var(--slider-fill-color) var(--slider-fill), var(--color-darkWhite) var(--slider-fill))"),F.push("100% 100%"),U.push("0 0"),O.backgroundImage=j.join(", "),O.backgroundSize=F.join(", "),O.backgroundPosition=U.join(", "),O.backgroundRepeat="no-repeat"}const L=f?f(v):p==="percent"?`${Math.round(r>a?(v-a)/(r-a)*100:0)}%`:p==="count"?`${v} / ${r}`:v===a&&h?h:v===r&&_?_:void 0,M=n.jsx("input",{type:"range",className:_e("slider",`slider--${s}`,E&&"slider--static",!p&&!C&&m),min:a,max:r,step:i,value:v,disabled:u,readOnly:E,tabIndex:E?-1:void 0,"aria-label":c,"aria-valuetext":L,"aria-orientation":s,onChange:D,style:O});if(!p&&!C)return M;const $=n.jsx("span",{className:"slider-wrap__minmax caption-1",children:h??a}),Z=n.jsx("span",{className:"slider-wrap__minmax caption-1",children:_??r}),q=C?n.jsxs("div",{className:_e("slider-track-group",`slider-track-group--${s}`,!p&&m),children:[B?Z:$,M,B?$:Z]}):M;if(!p)return q;const z=y??(B?"bottom":"right"),V=`${Math.round(r>a?(v-a)/(r-a)*100:0)}%`,R=f?f(v):p==="percent"?V:p==="count"?`${v} / ${r}`:String(v),H=n.jsx("span",{className:"slider-wrap__value body-3b",children:R});return n.jsxs("div",{className:_e("slider-wrap",`slider-wrap--${s}`,`slider-wrap--label-${z}`,`slider-wrap--align-${x}`,m),children:[q,H]})}const a4=.86,r4=250,Fo=(e,t,a,r)=>Math.round(Math.min(r,Math.max(a,e-t))),Oo=(e,t,a,r)=>{const i=Fo(e,t,a,r);return`${i<0?"-":"+"}${Math.abs(i)} dB`};function zo({analyser:e,audioElement:t,orientation:a="horizontal",length:r,label:i,labelPos:s,labelAlign:l="right",floorDb:u=-60,refDb:c=-35,displayMin:d=-5,displayMax:m=25,className:p,ariaLabel:f}){const y=o.useRef(null),x=o.useRef(null),C=o.useRef(null),h=o.useRef(null),[_,g]=o.useState(null);o.useEffect(()=>{const v=M=>{const $=Oo(M,c,d,m);C.current&&(C.current.textContent=$);const Z=y.current;Z&&(Z.setAttribute("aria-valuenow",String(Fo(M,c,d,m))),Z.setAttribute("aria-valuetext",$))},w=e??zf(t)??(_&&_.el===t?_.node:null),B=x.current;if(!w||!B){B?.style.setProperty("--meter-level","0"),v(u);let M=!1;return!e&&t&&Ya(t).then($=>{!M&&$&&g({el:t,node:$})}),()=>{M=!0}}Jr();const E=new Float32Array(w.fftSize);let D=0,N=0,O=0,P=0,G=null;const L=M=>{const $=Wf(w,E);D=$>D?$:D*a4;const Z=D>1e-5?20*Math.log10(D):-1/0,q=Math.max(u,Z),z=q-c,V=Math.min(1,Math.max(0,(z-d)/(m-d)));if(B.style.setProperty("--meter-level",V.toFixed(3)),N+=q,O+=1,M-P>=r4){const R=N/O;G=G==null?R:G*.6+R*.4,v(G),N=0,O=0,P=M}h.current=requestAnimationFrame(L)};return h.current=requestAnimationFrame(L),()=>{h.current!=null&&cancelAnimationFrame(h.current),h.current=null}},[e,t,_,u,c,d,m]);const A=typeof r=="number"?`${r}px`:r,b=n.jsx("div",{className:"audio-meter__track",style:A?a==="vertical"?{height:A}:{width:A}:{},children:n.jsx("div",{ref:x,className:"audio-meter__fill"})}),k=s??(a==="vertical"?"bottom":"right");return n.jsxs("div",{ref:y,className:_e("audio-meter",`audio-meter--${a}`,i&&`audio-meter--label-${k}`,i&&`audio-meter--align-${l}`,p),role:"meter","aria-label":f,"aria-valuemin":d,"aria-valuemax":m,"aria-valuenow":Fo(u,c,d,m),"aria-valuetext":Oo(u,c,d,m),children:[b,i&&n.jsx("span",{ref:C,className:"audio-meter__value caption-2",children:Oo(u,c,d,m)})]})}const Eu=260;function Du({message:e,position:t,duration:a,onClose:r}){const[i,s]=o.useState(!1),[l,u]=o.useState(!1),c=o.useRef(l),d=o.useRef(i);o.useEffect(()=>{c.current=l},[l]),o.useEffect(()=>{d.current=i},[i]);const m=o.useRef(null),p=o.useRef(""),f=o.useRef(r);o.useEffect(()=>{f.current=r});const y=a,x=o.useRef(null),C=o.useRef(0),h=o.useRef(0),_=o.useRef(!1),g=o.useRef(null),A=o.useRef(null),b=o.useRef(null),k=o.useRef(null),v=o.useRef(()=>{});v.current=E=>{E<0||(C.current=Date.now(),h.current=E,x.current=setTimeout(()=>{x.current=null,s(!1),g.current=setTimeout(()=>{u(!1);try{f.current()}catch{}},Eu)},E))};const w=o.useCallback(()=>{_.current||!x.current||(_.current=!0,clearTimeout(x.current),x.current=null,h.current=Math.max(0,h.current-(Date.now()-C.current)))},[]),B=o.useCallback(()=>{_.current&&(_.current=!1,v.current(h.current))},[]);return o.useEffect(()=>{if(e!==p.current&&(x.current&&(clearTimeout(x.current),x.current=null),g.current&&(clearTimeout(g.current),g.current=null)),e){if(d.current)return y>0&&!x.current&&(_.current?h.current=y:v.current(y)),p.current=e,()=>{x.current&&(clearTimeout(x.current),x.current=null),g.current&&(clearTimeout(g.current),g.current=null)};const E=()=>{const D=m.current;if(D)try{D.classList.remove("is-visible"),D.style.transition="none",t==="top"?D.style.transform="translateX(-50%) translateY(-16px)":D.style.transform="translateX(-50%) translateY(16px)",D.style.opacity="0",D.offsetWidth,D.style.transition="",D.classList.add("is-visible"),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>{k.current=null;try{D.style.opacity="",D.style.transform="",D.style.transition=""}catch{}},60)}catch{}};c.current?(E(),s(!0)):(u(!0),A.current=requestAnimationFrame(()=>{b.current=requestAnimationFrame(()=>{E(),s(!0)})})),y>0&&(_.current=!1,v.current(y))}else s(!1),g.current=setTimeout(()=>u(!1),Eu);return p.current=e,()=>{x.current&&clearTimeout(x.current),g.current&&clearTimeout(g.current),A.current&&cancelAnimationFrame(A.current),b.current&&cancelAnimationFrame(b.current),k.current&&clearTimeout(k.current),x.current=null,g.current=null,A.current=null,b.current=null,k.current=null}},[e,y,t]),{mounted:l,showing:i,popupRef:m,pause:w,resume:B}}function da({message:e="",position:t="top",type:a="normal",onClose:r=()=>{},duration:i=2e3}){const{mounted:s,showing:l,popupRef:u,pause:c,resume:d}=Du({message:e,position:t,duration:i,onClose:r}),m=o.useRef(null),[p,f]=o.useState(!1);if(o.useEffect(()=>{l?f(!0):s||f(!1)},[l,s]),!s)return null;const y=a==="notice"||a==="warning"?a:"normal",x=n.jsx("div",{ref:u,className:`toast toast--${t} ${l?"is-visible":""}`,role:"status","aria-live":"polite",onPointerEnter:C=>{m.current=C.pointerType},onMouseEnter:()=>{m.current!=="touch"&&c()},onMouseLeave:d,onFocusCapture:c,onBlurCapture:d,children:n.jsx("div",{className:`toast__inner toast__inner--${y} body-2`,"aria-hidden":p||l?void 0:!0,children:n.jsx("span",{className:"toast__text",children:e})})});return typeof document<"u"?en.createPortal(x,document.body):x}const o4=24;function s4({value:e,max:t=100,size:a=8,color:r,trackColor:i,label:s,formatValue:l,labelPos:u,labelAlign:c="right",ariaLabel:d,className:m}){const p=Number.isFinite(t)&&t>0?t:1,f=Math.max(0,Math.min(Number.isFinite(e)?e:0,p)),y=f/p*100,x=Number.isFinite(t)&&t>0?t:0,C=u??(a>=o4?"inside":"bottom"),h=C==="center"?"inside":C,_=h==="inside"&&(c==="left"?y>=15:c==="center"?y>=50:y>=85),g={};return r&&(g["--progress-bar-fill"]=r),i&&(g["--progress-bar-track"]=i),n.jsxs("div",{className:_e("progress-bar",`progress-bar--${a}`,`progress-bar--label-${h}`,s&&`progress-bar--align-${c}`,s&&_&&"progress-bar--label-on-fill",m),style:g,children:[n.jsx("div",{className:"progress-bar__track",role:"progressbar","aria-valuenow":f,"aria-valuemin":0,"aria-valuemax":x,"aria-valuetext":s?l?l(f):s==="percent"?void 0:s==="raw"?String(f):`${f} / ${x}`:void 0,"aria-label":d,children:n.jsx("div",{className:"progress-bar__fill",style:{width:`${y}%`}})}),s&&n.jsx("span",{className:"progress-bar__label caption-1b",children:l?l(f):s==="percent"?`${Math.round(y)}%`:s==="raw"?String(f):`${f} / ${x}`})]})}const Su={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},i4="rgba(255, 255, 255, 0.16)";function Tu({max:e,index:t,inactiveBg:a,inactiveColor:r,transparent:i,variant:s="numbered",announce:l=!1,ariaLabel:u}){const{t:c}=xe.useTranslation(),d=ln("(max-width: 767px)");if(!Number.isInteger(e)||e<=0)return null;const m=Number.isInteger(t)?Math.max(0,Math.min(t,e-1)):0,p=u??c("progress.steps",{current:m+1,total:e,defaultValue:"\uC9C4\uD589 \uB2E8\uACC4 {{current}} / {{total}}"}),f={};if(a&&(f["--pi-inactive-bg"]=a),r&&(f["--pi-inactive-color"]=r),i&&(a||(f["--pi-inactive-bg"]=i4),r||(f["--pi-inactive-color"]="var(--color-white)")),s==="dot")return n.jsxs("div",{className:"progress-indicator progress-indicator--dot",style:f,role:l?"status":"img","aria-label":l?void 0:p,children:[l&&n.jsx("span",{style:Su,children:p}),Array.from({length:e}).map((x,C)=>n.jsx("span",{"aria-hidden":"true",className:`progress-indicator-dot--dot${C<m?" done":C===m?" active":""}`},C))]});const y=l?n.jsx("span",{role:"status",style:Su,children:p}):null;return d?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"progress-indicator progress-indicator--mobile",style:f,role:"list","aria-label":p,children:n.jsxs("span",{role:"listitem",className:"progress-indicator-dot active body-3",children:[m+1," / ",e]})}),y]}):n.jsxs(n.Fragment,{children:[y,n.jsx("div",{className:"progress-indicator",style:f,role:"list","aria-label":p,children:Array.from({length:e}).map((x,C)=>n.jsx("span",{role:"listitem","aria-current":C===m?"step":void 0,className:`progress-indicator-dot ${C<m?" done":C===m?" active":""} body-3`,children:C+1},C))})]})}function l4(e){if(!e)return[];const t=[];let a=0,r="";for(const i of e.trim()){if(i==="("?a++:i===")"&&a--,/\s/.test(i)&&a===0){r&&(t.push(r),r="");continue}r+=i}return r&&t.push(r),t}function u4({children:e,className:t,style:a,rowLabel:r,onRowClick:i}){return n.jsx("div",{role:"cell",className:t?`table-cell ${t}`:"table-cell",style:a,children:r&&i?n.jsx("button",{type:"button",className:"table-cell__row-button","aria-label":r,children:e}):e})}function Wo({variant:e="default",children:t,className:a,draggable:r,onClick:i,onMouseEnter:s,onMouseLeave:l,onDragStart:u,onDragEnd:c,expandedContent:d,colSpan:m,describedBy:p,rowHasButton:f}){const y=o.useCallback(x=>{i&&x.target===x.currentTarget&&(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),i())},[i]);return e==="loading"?n.jsx("div",{role:"presentation",className:"table-row-wrap",children:n.jsx("div",{role:"row",className:"table-row table-row--loading",children:n.jsx("div",{role:"cell","aria-colspan":m,className:"table-row__full-cell",children:n.jsx(za,{size:28})})})}):e==="empty"?n.jsx("div",{role:"presentation",className:"table-row-wrap",children:n.jsx("div",{role:"row",className:"table-row table-row--empty body-3",children:n.jsx("div",{role:"cell","aria-colspan":m,className:"table-row__full-cell",children:t})})}):n.jsxs("div",{role:"presentation",className:"table-row-wrap",children:[n.jsx("div",{className:a?`table-row ${a}`:"table-row",draggable:r,onClick:i,onKeyDown:i?y:void 0,onMouseEnter:s,onMouseLeave:l,onDragStart:u,onDragEnd:c,role:"row",tabIndex:i&&!f?0:void 0,"aria-describedby":i&&!f?p:void 0,children:t}),d&&n.jsx("div",{role:"row",className:"table-row-expand",children:n.jsx("div",{role:"cell","aria-colspan":m,className:"table-row-expand__cell",children:d})})]})}function c4({dir:e}){return n.jsx(e==="asc"?Vs:Hs,{className:"table-field__sort-arrow",size:16,strokeWidth:2})}function d4({children:e,onClick:t,className:a,sortDir:r,ariaSort:i,onResizeStart:s}){const l=n.jsxs(n.Fragment,{children:[e,r&&n.jsx(c4,{dir:r})]});return n.jsxs("div",{onClick:t,role:"columnheader","aria-sort":i,className:_e("table-field body-3",a,r?"table-field--sorted":"",s?"table-field--resizable":""),children:[t?n.jsx("button",{type:"button",className:"table-field__button",children:l}):l,s&&n.jsx("span",{className:"table-field__resizer",onPointerDown:s,onClick:u=>u.stopPropagation(),"aria-hidden":"true"})]})}function Ho({fields:e=[],headerGroups:t,items:a=[],renderRow:r,onRowClick:i,isRowClickable:s,onRowMouseEnter:l,onRowMouseLeave:u,onRowDragStart:c,onRowDragEnd:d,draggingId:m,gridTemplateColumns:p,mobileGridTemplateColumns:f,resizable:y=!1,resizeMode:x="grow",resizeStorageKey:C,size:h="small",title:_,icon:g,count:A,collapsed:b=!1,onToggleCollapse:k,headerActions:v,empty:w,loading:B,dragOver:E=!1,onDragOver:D,onDragLeave:N,onDrop:O,renderExpandedRow:P,expandedId:G}){const{t:L}=xe.useTranslation(),M=o.useId(),$=`table-title-${M}`,Z=`table-row-hint-${M}`,q=ln("(max-width: 767px)"),z=f&&q?f:null,V=y&&!q,R=48,H=o.useRef(()=>R),W=C?`table-cols:${C}`:null,I=o.useRef(null),S=o.useRef(null),j=o.useRef(null),F=o.useRef(null),[U,re]=o.useState(!1),[ne,le]=o.useState(0),K=o.useCallback(()=>{const se=j.current;se&&(re(se.scrollWidth>se.clientWidth+1),le(se.clientWidth))},[]),oe=o.useCallback((se,Ne)=>{const We=se.current;We&&S.current&&S.current.unobserve(We),se.current=Ne,Ne?(!S.current&&typeof ResizeObserver<"u"&&(S.current=new ResizeObserver(()=>K())),S.current?.observe(Ne)):!j.current&&!F.current&&(S.current?.disconnect(),S.current=null),K()},[K]),Ae=o.useCallback(se=>oe(j,se),[oe]),Y=o.useCallback(se=>oe(F,se),[oe]);o.useEffect(()=>{K()}),o.useEffect(()=>{if(typeof window>"u")return;const se=typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>K()):null;return window.addEventListener("resize",K),()=>{se!=null&&cancelAnimationFrame(se),window.removeEventListener("resize",K)}},[K]);const Q=o.useRef(()=>!1),me=o.useRef([]),De=o.useRef(null),be=se=>{if(!se||typeof window>"u")return null;try{const Ne=JSON.parse(window.localStorage.getItem(se)??"null");return Array.isArray(Ne)&&Ne.length>0&&Ne.every(We=>typeof We=="number"&&Number.isFinite(We)&&We>0)?Ne:null}catch{return null}},[te,ue]=o.useState(()=>be(W)),[fe,ge]=o.useState(W),[Ce,$e]=o.useState(()=>be(W)!==null);if(fe!==W){ge(W);const se=be(W);ue(se),$e(se!==null)}const He=o.useRef(te);o.useEffect(()=>{He.current=te},[te]);const Te=o.useCallback(se=>{const Ne=De.current;if(!Ne)return;const We=He.current;if(We){const nt=[...We];if(Ne.next!=null&&Ne.startWNext!=null){const Fe=se.clientX-Ne.startX,Ge=Math.max(H.current(Ne.index)-Ne.startW,Math.min(Ne.startWNext-H.current(Ne.next),Fe));nt[Ne.index]=Ne.startW+Ge,nt[Ne.next]=Ne.startWNext-Ge}else nt[Ne.index]=Math.max(H.current(Ne.index),Ne.startW+(se.clientX-Ne.startX));He.current=nt,ue(nt)}},[]),Ie=o.useCallback(()=>{if(De.current=null,window.removeEventListener("pointermove",Te),window.removeEventListener("pointerup",Ie),window.removeEventListener("pointercancel",Ie),document.body.style.cursor="",document.body.style.userSelect="",W&&He.current)try{window.localStorage.setItem(W,JSON.stringify(He.current))}catch{}},[Te,W]),qe=o.useCallback((se,Ne)=>{Ne.preventDefault(),Ne.stopPropagation();const We=I.current;if(!We)return;const nt=Array.from(We.children).map(Ge=>Ge.getBoundingClientRect().width),Fe=x==="fit"?e.findIndex((Ge,bt)=>bt>se&&Ge.resizable!==!1):-1;De.current=Fe>=0?{index:se,startX:Ne.clientX,startW:nt[se],next:Fe,startWNext:nt[Fe]}:{index:se,startX:Ne.clientX,startW:nt[se]},He.current=nt,ue(nt),$e(!0),window.addEventListener("pointermove",Te),window.addEventListener("pointerup",Ie),window.addEventListener("pointercancel",Ie),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[Te,Ie,x,e]),mt=o.useCallback(()=>{const se=I.current,Ne=se?.closest(".table-wrap");if(!se||!Ne)return null;const We=Ne.style.getPropertyValue("--table-grid-cols");Ne.style.setProperty("--table-grid-cols",e.map((et,ot)=>Q.current(ot)?me.current[ot]:"max-content").join(" "));const nt=Array.from(Ne.querySelectorAll(".table-row")).filter(et=>!et.classList.contains("table-row--loading")&&!et.classList.contains("table-row--empty")),Fe=e.map((et,ot)=>{let lt=se.children[ot]?.getBoundingClientRect().width??0;for(const jt of nt){const Wt=jt.children[ot];Wt&&(lt=Math.max(lt,Wt.getBoundingClientRect().width))}const st=Q.current(ot)?parseFloat(me.current[ot]):NaN;return Number.isFinite(st)?st:Math.max(H.current(ot),Math.ceil(lt))}),Ge=window.getComputedStyle(se),bt=se.clientWidth-(parseFloat(Ge.paddingLeft)||0)-(parseFloat(Ge.paddingRight)||0);We?Ne.style.setProperty("--table-grid-cols",We):Ne.style.removeProperty("--table-grid-cols");let Re=Fe;const tt=Fe.reduce((et,ot,lt)=>et+(Q.current(lt)?ot:0),0),xt=Fe.reduce((et,ot,lt)=>et+(Q.current(lt)?0:ot),0),Lt=bt-tt;if(bt>0&&xt>0&&Lt>0){const et=Lt/xt;Re=Fe.map((lt,st)=>Q.current(st)?lt:Math.max(H.current(st),Math.round(lt*et)));const ot=Math.round(Lt-Re.reduce((lt,st,jt)=>lt+(Q.current(jt)?0:st),0));if(ot!==0){let lt=-1;Re.forEach((st,jt)=>{!Q.current(jt)&&(lt<0||st>Re[lt])&&(lt=jt)}),lt>=0&&(Re[lt]=Math.max(H.current(lt),Re[lt]+ot))}}return Re},[e,x]),ct=(se,Ne)=>se!==null&&se.length===Ne.length&&se.every((We,nt)=>We===Ne[nt]),rt=o.useRef(mt);o.useEffect(()=>{rt.current=mt});const[ft,ke]=o.useState(0),Ve=a.length>0,we=`${W??""}|${ft}|${e.length}|${ne}`,Ue=!Ce&&V&&W!==null&&!B?`${we}|${Ve?1:0}`:null,Be=o.useRef(null);o.useEffect(()=>{if(Ue===null||!Ve||Be.current===we)return;const se=rt.current();se&&(Be.current=we,ue(Ne=>ct(Ne,se)?Ne:se))},[Ue]);const je=o.useCallback(()=>{if(W)try{window.localStorage.removeItem(W)}catch{}$e(!1);const se=rt.current();ue(se),He.current=se,ke(Ne=>Ne+1)},[W]);o.useEffect(()=>()=>{De.current&&(window.removeEventListener("pointermove",Te),window.removeEventListener("pointerup",Ie),window.removeEventListener("pointercancel",Ie),document.body.style.cursor="",document.body.style.userSelect="")},[Te,Ie]);const Se=l4(p),Xe=Se.filter(se=>/\b(auto|min-content|max-content)\b|fit-content\(/.test(se));Xe.length>0&&St(`table-content-track:${p}`,`[ihabdevteam-core] Table \uC758 gridTemplateColumns \uC5D0 \uB0B4\uC6A9\uC73C\uB85C \uD06C\uAE30\uAC00 \uC815\uD574\uC9C0\uB294 \uD2B8\uB799(${Xe.join(", ")})\uC774 \uC788\uC2B5\uB2C8\uB2E4. \uBA38\uB9AC\uC640 \uBAB8\uD1B5\uC740 \uC11C\uB85C \uB2E4\uB978 \uACA9\uC790\uB77C \uADF8 \uD2B8\uB799\uC774 \uAC01\uC790 \uB2E4\uB974\uAC8C \uD480\uB824 \uC5F4\uC774 \uC5B4\uAE0B\uB0A9\uB2C8\uB2E4. px \uC774\uB098 fr \uC744 \uC4F0\uC138\uC694. (\uBC1B\uC740 \uAC12: ${p})`);const Qe=e.findIndex(se=>!!se.sortDir);e.filter(se=>!!se.sortDir).length>1&&St("table-multi-sort","[ihabdevteam-core] Table \uC758 fields \uC5D0 sortDir \uC774 \uB458 \uC774\uC0C1 \uC788\uC2B5\uB2C8\uB2E4. aria-sort \uB294 \uD45C \uD558\uB098\uC5D0 \uD55C \uCE78\uB9CC \uAC00\uC9C8 \uC218 \uC788\uC5B4 \uCCAB \uCE78\uB9CC \uBC29\uD5A5\uC73C\uB85C \uC54C\uB9AC\uACE0 \uB098\uBA38\uC9C0\uB294 none \uC73C\uB85C \uB461\uB2C8\uB2E4.");const dt=se=>se===Qe?e[se].sortDir==="asc"?"ascending":"descending":e[se].onClick?"none":void 0,ht=se=>/^\d+(\.\d+)?px$/.test(Se[se]??""),wt=se=>{const Ne=Se[se]??"",We=/^minmax\(\s*(\d+(?:\.\d+)?)px\s*,/.exec(Ne)??/^(\d+(?:\.\d+)?)px$/.exec(Ne);return We?parseFloat(We[1]):R};Q.current=ht,H.current=wt,me.current=Se;const Ct=se=>x==="fit"&&!ht(se)?"fr":"px",Nt=te&&te.length===e.length&&!q,gt=z??(Nt?e.map((se,Ne)=>se.resizable===!1&&Se[Ne]?Se[Ne]:`${te[Ne]}${Ct(Ne)}`).join(" "):p),it=gt?{"--table-grid-cols":gt}:void 0,Ke=_!==void 0;return n.jsxs("div",{ref:Ae,className:`table-wrap table-wrap--${h}${V?" table-wrap--resizable":""}${E?" table-wrap--dragover":""}${b?" table-wrap--collapsed":""}`,style:it,onDragOver:D,onDragLeave:N,onDrop:O,tabIndex:U?0:void 0,role:U?"region":void 0,"aria-label":U?typeof _=="string"?_:L("table.scrollRegion","\uAC00\uB85C\uB85C \uAD74\uB9B4 \uC218 \uC788\uB294 \uD45C"):void 0,children:[!!i&&n.jsx("span",{id:Z,className:"table-row-hint",children:L("table.rowActionHint","\uC904\uC744 \uB204\uB974\uBA74 \uC790\uC138\uD788 \uBD05\uB2C8\uB2E4")}),n.jsxs("div",{ref:Y,role:"table","aria-labelledby":Ke&&typeof _=="string"?$:void 0,className:"table body-2",children:[Ke&&n.jsxs("div",{className:_e("table-header",k&&"table-header--clickable"),onClick:k,role:"caption",children:[k&&n.jsx(pe,{htmlType:"button",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:b?"chevron-right":"chevron-down",ariaLabel:b?L("common.expand","\uD3BC\uCE58\uAE30"):L("common.collapse","\uC811\uAE30"),ariaExpanded:!b,className:"table-header__chevron"}),g&&n.jsx(at,{icon:g,label:typeof _=="string"?_:void 0,className:"table-header__icon"}),n.jsx("span",{id:$,className:"table-header__title h5b",children:_}),A!==void 0&&n.jsx("span",{className:"table-header__count body-3b",children:A}),v&&n.jsx("span",{className:"table-header__actions",onClick:se=>se.stopPropagation(),children:v})]}),!b&&n.jsxs(n.Fragment,{children:[t&&t.length>0&&n.jsx("div",{role:"row",className:"table-fields table-fields--groups",children:t.map((se,Ne)=>n.jsx("div",{role:"columnheader","aria-colspan":se.span,className:_e("table-field body-3",se.className),style:{gridColumn:`span ${se.span}`},children:se.label},Ne))}),n.jsxs("div",{role:"presentation",className:_e("table-fields-strip",V&&"table-fields-strip--resizable"),children:[n.jsx("div",{role:"row",className:"table-fields",ref:I,children:e.map((se,Ne)=>n.jsx(d4,{onClick:se.onClick,className:se.className,sortDir:se.sortDir,ariaSort:dt(Ne),onResizeStart:V&&Ne<e.length-1&&se.resizable!==!1&&(x!=="fit"||e.some((We,nt)=>nt>Ne&&We.resizable!==!1))?We=>qe(Ne,We):void 0,children:se.label},Ne))}),V&&n.jsx(pe,{htmlType:"button",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:"chevrons-left-right-ellipsis",ariaLabel:L("table.resetColumns","\uCE78 \uB108\uBE44 \uCD08\uAE30\uD654"),showTooltipInfo:L("table.resetColumns","\uCE78 \uB108\uBE44 \uCD08\uAE30\uD654"),className:"table-fields__reset",onClick:je})]}),n.jsx("div",{role:"rowgroup",className:"table-body",children:B?n.jsx(Wo,{variant:"loading",colSpan:e.length||void 0}):a.length===0&&w?n.jsx(Wo,{variant:"empty",colSpan:e.length||void 0,children:w}):a.map((se,Ne)=>{const We=m!=null&&se.id===m,nt=!!i&&(s?s(se):!0),Fe=G!=null&&se.id!=null&&(G instanceof Set?G.has(se.id)||[...G].some(Ge=>String(Ge)===String(se.id)):String(se.id)===String(G));return n.jsx(Wo,{className:`${nt?" table-row--clickable":""}${c?" table-row--draggable":""}${We?" table-row--dragging":""}`.trim(),draggable:!!c,onClick:nt?()=>i(se):void 0,colSpan:e.length||void 0,rowHasButton:r(se).some(Ge=>!!Ge.rowLabel),describedBy:Z,onMouseEnter:l?Ge=>l(se,Ge):void 0,onMouseLeave:u?Ge=>u(se,Ge):void 0,onDragStart:c?Ge=>c(se,Ge):void 0,onDragEnd:d?Ge=>d(se,Ge):void 0,expandedContent:Fe&&P?P(se):void 0,children:r(se).map((Ge,bt)=>n.jsx(u4,{className:Ge.className,style:Ge.style,rowLabel:nt?Ge.rowLabel:void 0,onRowClick:nt?()=>i(se):void 0,children:Ge.content},bt))},se.id!=null?`${typeof se.id}:${se.id}`:`__idx:${Ne}`)})})]})]})]})}const p4={hearingAid:"hearingAid",cochlearImplant:"cochlearImplant",other:"other",\uBCF4\uCCAD\uAE30:"hearingAid",\uC778\uACF5\uC640\uC6B0:"cochlearImplant",\uAE30\uD0C0:"other"};function ju(e){return e?p4[e]??null:null}function Mu(e){switch(ju(e)){case"hearingAid":return"main";case"cochlearImplant":return"sub";default:return"default"}}function Lu(e,t){const a=ju(e);return a?t(`device.type.${a}`,{defaultValue:e??""}):e??""}const pa=e=>e==null?"":String(e).trim();function Vo(e,t,a,r){const i=pa(e),s=pa(t),l=pa(a);if(r&&i&&s&&l){const c=`${i.padStart(4,"0")}-${s.padStart(2,"0")}-${l.padStart(2,"0")}`,d=new Date(c);if(!Number.isNaN(d.getTime())&&d.toISOString().slice(0,10)===c){const m=Mi(c,r);if(m)return m}}const u=[i,s,l];for(;u.length>0&&u[u.length-1]==="";)u.pop();return u.join(".")}function m4(e,t,a){const r=pa(e);return r?`${r}-${pa(t).padStart(2,"0")}-${pa(a).padStart(2,"0")}`:""}function $u(e,t){return t!=="wornAt"?String(e[t]??""):m4(e.wornYear,e.wornMonth,e.wornDay)}function h4({rows:e,loading:t,onSelect:a,onDelete:r,onWear:i,onRelease:s,onAdd:l}){const{t:u,i18n:c}=xe.useTranslation(),d=h=>h==="left"?u("device.direction.left","\uC88C"):u("device.direction.right","\uC6B0"),{sort:m,field:p}=Vy(),f=o.useMemo(()=>{if(!m)return e;const{key:h,asc:_}=m;return[...e].sort((g,A)=>{if(h==="worn"){const b=Number(A.worn)-Number(g.worn);return _?b:-b}return yo($u(g,h),$u(A,h),_)})},[e,m]),{pageRows:y,pageSizeProps:x,paginationProps:C}=Hy(f,m);return n.jsxs("div",{className:"dlp-side-table",children:[n.jsx(jo,{count:{value:e.length,unit:u("customers.device.unit","\uAC1C")},pageSize:x,pagination:C,actions:l&&n.jsx(pe,{htmlType:"button",size:40,type:"bar",variant:"main",icon:"plus",label:u("customers.device.addButton","\uAE30\uAE30 \uCD94\uAC00"),onClick:l})}),n.jsx(Ho,{loading:t,resizable:!0,resizeMode:"fit",resizeStorageKey:"customer-device-history-v2",fields:[{...p(u("customers.device.wearingNow","\uCC29\uC6A9"),"worn"),resizable:!1},p(u("device.direction.label","\uBC29\uD5A5"),"side"),p(u("device.deviceType","\uC885\uB958"),"device"),p(u("device.brand","\uBE0C\uB79C\uB4DC"),"brand"),p(u("device.fitType","\uCC29\uC6A9\uD615\uD0DC"),"fitType"),p(u("device.productName","\uC81C\uD488\uBA85"),"productName"),p(u("device.wornDate","\uCC29\uC6A9\uC77C"),"wornAt"),...r?[{label:"",resizable:!1}]:[]],items:y.map((h,_)=>({id:h.id??`${h.side}-${_}`,row:h})),gridTemplateColumns:`56px 110px 110px minmax(120px, 1fr) 100px minmax(120px, 1fr) 110px${r?" 80px":""}`,renderRow:({row:h})=>[{content:n.jsx("span",{className:"dlp-worn-check",onClick:_=>_.stopPropagation(),children:n.jsx(fu,{checked:h.worn,disabled:h.worn?!s:!i,ariaLabel:h.worn?u("customers.device.unwear","\uCC29\uC6A9 \uD574\uC81C"):u("customers.device.wear","\uCC29\uC6A9"),onChange:_=>{_?i?.(h):s?.(h)}})})},{content:n.jsx("span",{children:d(h.side)})},{content:h.device?n.jsx(At,{size:"small",variant:Mu(h.device),fill:"soft",label:Lu(h.device,u)}):n.jsx("span",{})},{content:n.jsx("span",{children:h.brand})},{content:n.jsx("span",{children:h.fitType||"-"})},{content:n.jsx("span",{children:h.productName||"-"})},{content:n.jsx("span",{className:"dlp-date",children:Vo(h.wornYear,h.wornMonth,h.wornDay,c.language)||"-"})},...r?[{content:n.jsx("span",{className:"dlp-row-actions",children:n.jsx(pe,{htmlType:"button",size:28,type:"bar",variant:"transparent-gray",label:u("common.delete","\uC0AD\uC81C"),onClick:_=>{_?.stopPropagation(),r(h)}})})}]:[]],onRowClick:({row:h})=>a(h),empty:u("customers.device.historyEmpty","\uB4F1\uB85D\uB41C \uAE30\uAE30 \uC774\uB825\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.")})]})}function Ru(e,t){return e?{role:t?.role??"button",tabIndex:0,...t?.selected===void 0?{}:{"aria-selected":t.selected},onKeyDown:a=>{a.target===a.currentTarget&&(a.key!=="Enter"&&a.key!==" "||(a.preventDefault(),e(a)))}}:{}}function f4(e,t){return new Date(e,t+1,0).getDate()}function C4(e,t){return new Date(e,t,1).getDay()}function g4({visits:e=[],onVisitClick:t,onVisitMove:a,onDayClick:r,today:i}){const{t:s,i18n:l}=xe.useTranslation(),u=o.useMemo(()=>s("calendar.dow",{returnObjects:!0}),[s]),c=ro(i),[d,m]=o.useState(()=>Number(c.slice(0,4))),[p,f]=o.useState(()=>Number(c.slice(5,7))-1),[y,x]=o.useState(null),C=o.useRef(null),h=o.useMemo(()=>{const v={};return e.forEach(w=>{v[w.date]||(v[w.date]=[]),v[w.date].push(w)}),v},[e]),_=o.useMemo(()=>{const v=f4(d,p),w=C4(d,p),B=[];for(let E=0;E<w;E++)B.push(null);for(let E=1;E<=v;E++)B.push(E);for(;B.length<35;)B.push(null);return B},[d,p]),g=o.useCallback(()=>{p===0?(m(v=>v-1),f(11)):f(v=>v-1)},[p]),A=o.useCallback(()=>{p===11?(m(v=>v+1),f(0)):f(v=>v+1)},[p]),b=v=>`${d}-${String(p+1).padStart(2,"0")}-${String(v).padStart(2,"0")}`,k=v=>b(v)===c;return n.jsxs("div",{children:[n.jsxs("div",{className:"calendar-nav",children:[n.jsx("button",{type:"button",className:"calendar-nav__button",onClick:g,"aria-label":s("calendar.prevMonth","\uC774\uC804 \uB2EC"),children:n.jsx(at,{icon:"chevron-left",label:"",className:"",svgClassName:"calendar-nav__button-icon",size:18})}),n.jsx("span",{className:"calendar-nav__title h5","aria-live":"polite",children:tr(s,l.language,d,p+1)}),n.jsx("button",{type:"button",className:"calendar-nav__button",onClick:A,"aria-label":s("calendar.nextMonth","\uB2E4\uC74C \uB2EC"),children:n.jsx(at,{icon:"chevron-right",label:"",className:"",svgClassName:"calendar-nav__button-icon",size:18})}),n.jsxs("div",{className:"calendar-nav__legend",children:[n.jsx("span",{className:"calendar-nav__legend-dot calendar-nav__legend-dot--main"}),n.jsx("span",{className:"caption-1",children:s("calendar.legend.visited","\uBC29\uBB38")}),n.jsx("span",{className:"calendar-nav__legend-dot calendar-nav__legend-dot--sub"}),n.jsx("span",{className:"caption-1",children:s("calendar.legend.scheduled","\uC608\uC57D")}),n.jsx("span",{className:"calendar-nav__legend-dot calendar-nav__legend-dot--disabled"}),n.jsx("span",{className:"caption-1",children:s("calendar.legend.noVisit","\uBBF8\uBC29\uBB38")})]})]}),n.jsxs("div",{className:"calendar-grid",children:[u.map(v=>n.jsx("div",{className:"calendar-day-header body-3",children:v},v)),_.map((v,w)=>{if(v===null)return n.jsx("div",{className:"calendar-cell empty"},`empty-${w}`);const B=v,E=b(B),D=h[E]??[],N=Mi(E,l.language),O=y===E;return n.jsxs("div",{className:`calendar-cell${k(B)?" today":""}${O?" drag-over":""}${r?" calendar-cell--clickable":""}`,role:r?"button":void 0,tabIndex:r?0:void 0,"aria-label":r?s("calendar.addOnDate",{date:E}):void 0,"aria-current":k(B)?"date":void 0,onClick:r?()=>r(E):void 0,onKeyDown:r?P=>{P.target===P.currentTarget&&(P.key!=="Enter"&&P.key!==" "||(P.preventDefault(),r(E)))}:void 0,onDragOver:a?P=>{P.preventDefault(),x(E)}:void 0,onDragLeave:a?P=>{P.currentTarget.contains(P.relatedTarget)||x(null)}:void 0,onDrop:a?P=>{P.preventDefault(),C.current!=null&&(a(C.current,E),C.current=null),x(null)}:void 0,children:[n.jsx("div",{className:"calendar-cell__number body-3",children:B}),D.length>0&&(()=>{const P=[{key:"visited",label:s("calendar.legend.visited","\uBC29\uBB38"),count:D.filter(L=>(L.status??"visited")==="visited").length},{key:"scheduled",label:s("calendar.legend.scheduled","\uC608\uC57D"),count:D.filter(L=>L.status==="scheduled").length},{key:"noVisit",label:s("calendar.legend.noVisit","\uBBF8\uBC29\uBB38"),count:D.filter(L=>L.status==="noVisit").length}].filter(L=>L.count>0),G=P.length===1&&P[0].key==="visited"?s("calendar.visitCount",{count:D.length,defaultValue:"\uBC29\uBB38 {{count}}\uAC74"}):P.map(L=>s("calendar.statusCount",{label:L.label,count:L.count,defaultValue:"{{label}} {{count}}\uAC74"})).join(" \xB7 ");return n.jsxs("span",{className:"calendar-cell__visit-count caption-1","aria-label":`${N} ${G}`,children:[P.map(L=>n.jsx("span",{className:`calendar-cell__visit-dot calendar-cell__visit-dot--${L.key}`,"aria-hidden":"true"},L.key)),D.length]})})(),n.jsx("div",{className:"calendar-cell__badges",children:D.map((P,G)=>n.jsxs("div",{draggable:!!a,className:`calendar-visit-badge${P.status==="noVisit"?" calendar-visit-badge--no-visit":P.status==="scheduled"?" calendar-visit-badge--scheduled":""}${t?" calendar-visit-badge--clickable":""}${a?" calendar-visit-badge--draggable":""}`,onDragStart:a?L=>{C.current=P.id,L.dataTransfer.effectAllowed="move"}:void 0,onDragEnd:a?()=>{C.current=null,x(null)}:void 0,onClick:t?L=>{L.stopPropagation(),t(P)}:void 0,...Ru(t?()=>t(P):void 0),"aria-label":[N,P.time?Pi(P.time,s):null,P.customer,s(P.status==="noVisit"?"calendar.legend.noVisit":P.status==="scheduled"?"calendar.legend.scheduled":"calendar.legend.visited")].filter(Boolean).join(" "),children:[P.time&&n.jsx("span",{className:"calendar-visit-badge__time body-3",children:Pi(P.time,s)}),n.jsx("span",{className:"calendar-visit-badge__name body-3",children:P.customer}),P.status==="noVisit"&&n.jsx("span",{className:"calendar-visit-badge__no-visit caption-1",children:s("calendar.legend.noVisit","\uBBF8\uBC29\uBB38")})]},P.id??G))})]},B)})]})]})}const b4={page:"h3",pagePopup:"h4",popup:"h5"};function ma({type:e="page",title:t,headingLevel:a=2,icon:r,action:i,disc:s,children:l,inGrid:u=!1,className:c,style:d}){const m=b4[e],p=t||s||i||r,f=a?`h${a}`:"div";return n.jsxs("div",{className:_e("section",`section--${e}`,u&&"section--in-grid",c),style:d,children:[p&&n.jsxs("div",{className:"section__header",children:[n.jsxs("div",{className:"section__title-row",children:[r&&n.jsx(at,{icon:r,label:typeof t=="string"?t:void 0,className:"section__icon"}),n.jsxs("div",{className:"section__title-group",children:[t&&n.jsx(f,{className:`section__title ${m}`,children:t}),s&&n.jsx("div",{className:"section__disc body-3",children:s})]})]}),i&&n.jsx("div",{className:"section__action",children:i})]}),l]})}let qo=null,Pu=!1;function Iu(){if(Pu||typeof document>"u")return;Pu=!0,document.addEventListener("keydown",t=>{t.metaKey||t.ctrlKey||t.altKey||(qo="keyboard")},!0);const e=()=>{qo="pointer"};document.addEventListener("pointerdown",e,!0),document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,{capture:!0,passive:!0})}Iu();function hr(){return Iu(),qo==="keyboard"}const fr=20;function y4(e){const{t}=xe.useTranslation(),{type:a,trainingDatas:r,depth:i,renderPopup:s,completedIds:l,selectedIds:u,onItemComplete:c,size:d,useDescriptionTooltip:m,onRemove:p,onMore:f,sectionType:y="page"}=e||{},[,x]=o.useState(0),C=typeof r<"u"?Array.isArray(r)?r:[]:[],h=C.length,[_,g]=o.useState(Math.min(h,fr)),A=o.useMemo(()=>Array.isArray(i)?[...i,a?.label].filter(Boolean).join(" \xB7 "):[i||"",a?.label].filter(Boolean).join(" \xB7 "),[i,a?.label]);o.useEffect(()=>{g(Math.min(h,fr))},[h]),Nl("speechear.data.updated",()=>x(w=>w+1));const b=o.useRef(null),k=o.useRef(null);function v(){const w=document.activeElement;k.current=hr()&&w&&w.closest?.(".training-block__more")?_:null,g(B=>Math.min(h,B+fr))}return o.useEffect(()=>{const w=k.current;if(w==null)return;k.current=null;const B=document.activeElement;B&&B!==document.body||b.current?.querySelectorAll(".training-block-button")[w]?.focus()},[_]),n.jsxs(ma,{type:y,title:a?.label,icon:a?.icon,disc:a?.desc,className:"training-block",children:[n.jsx("div",{className:"training-list",ref:b,children:(C||[]).slice(0,_).map((w,B)=>{const E=w;return n.jsx(Do,{index:B,type:a,trainingData:E,depth:A,renderPopup:s,completedIds:l,selectedIds:u,size:d,useDescriptionTooltip:m,onRemove:typeof p=="function"&&u!=null&&E?.id!=null&&u.has(String(E.id))?()=>p(E):void 0,onComplete:typeof c=="function"&&E?.id!=null?()=>c(String(E.id)):void 0,onMore:typeof f=="function"?D=>f(E,D):void 0},E?.id!=null?`${a?.key||"t"}-${String(E.id)}`:`${a?.key||"t"}-${B}`)})}),h>fr&&_<h&&n.jsx("div",{className:"training-block__more",children:n.jsx(pe,{htmlType:"button",size:48,type:"bar",icon:"plus",onClick:v,ariaLabel:t("common.loadMore","\uB354\uBCF4\uAE30"),label:t("common.loadMore","\uB354\uBCF4\uAE30"),variant:"main"})})]})}function v4(e){let t=0;const a=r=>{Array.isArray(r)?r.forEach(a):r!=null&&r!==!1&&r!==!0&&r!==""&&t++};return a(e),t}function x4({gap:e=10,count:t,className:a,children:r}){const i=o.useRef(null),[s,l]=o.useState({width:0,card:0}),u=t??v4(r);o.useLayoutEffect(()=>{const f=i.current;if(!f)return;const y=()=>{const C=f.style.maxWidth;f.style.maxWidth="none";const h=f.clientWidth;f.style.maxWidth=C;const _=f.firstElementChild?.offsetWidth??0;l(g=>g.width===h&&g.card===_?g:{width:h,card:_})};if(y(),typeof ResizeObserver>"u")return;const x=new ResizeObserver(y);return x.observe(f),()=>x.disconnect()},[u,e]);const c=s.card>0?s.card:0,d=c>0?iC(s.width,c,e):0,m=d>0?lC(u,d):0,p={"--block-grid-gap":`${e}px`,...m>0?{"--block-grid-cols":m,"--block-grid-card":`${c}px`}:{}};return n.jsx("div",{ref:i,className:_e("training-block-grid",m>0&&"training-block-grid--measured",a),style:p,"data-cols":m>0?m:void 0,children:r})}function Uo(e){const t=o.useRef(null),[a,r]=o.useState(!!e),[i,s]=o.useState(!1);o.useEffect(()=>{s(!1);const c=t.current;r(!!e&&!(c?.complete&&c.naturalWidth>0))},[e]);const l=o.useCallback(()=>r(!1),[]),u=o.useCallback(()=>{r(!1),s(!0)},[]);return{imgRef:t,loading:a,failed:i,hasImage:!!e&&!i,onLoad:l,onError:u}}var _4='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="a" xmlns="http://www.w3.org/2000/svg" width="240" height="240" viewBox="0 0 240 240"><g opacity=".5"><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23fff"/></g><path d="M140,30h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84-3.88-7.1-6.08-15.25-6.08-23.92v-80c0-16.57,13.43-30,30-30h80c8.66,0,16.81,2.21,23.92,6.08-8.48-15.54-24.97-26.08-43.92-26.08Z" fill="%23fff"/><path d="M183.92,56.08c3.88,7.1,6.08,15.25,6.08,23.92v80c0,16.57-13.43,30-30,30h-80c-8.66,0-16.81-2.21-23.92-6.08,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%23fff"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></svg>';const w4=_4,Go=o.forwardRef(function({item:e,disabled:t=!1,onPlayDone:a,selectable:r=!1,selected:i=!1,onSelect:s,flipDelay:l=0,hideLabel:u=!1,hideAudio:c=!1,orderRank:d=null},m){const{t:p}=xe.useTranslation(),f=e.word||e.title||"",y=t||!f,x=e.audio??e.sound??e.audioKey,C=e.subLabel||e.pronunciation||"",h=e.colloquialLabel||"",[_,g]=o.useState({label:f,subLabel:C,colloquialLabel:h,homonum:e.homonum});f&&(_.label!==f||_.subLabel!==C||_.colloquialLabel!==h||!Object.is(_.homonum,e.homonum))&&g({label:f,subLabel:C,colloquialLabel:h,homonum:e.homonum});const A=o.useRef(null),b=ln("(max-width: 767px)"),[k,v]=o.useState(!1),w=`${typeof x=="string"?x:x?.src??""}\0${f}`,[B,E]=o.useState({for:"",url:""}),D=B.for===w?B.url:"",N=Di(),O=e.textOnly??(!e.image&&!!_.label&&!!N&&N.entries.length>0&&!N.byWord.has(_.label)),P=O?"":aa()?.(_.label,_.homonum)??e.image??"",{imgRef:G,loading:L,hasImage:M,onLoad:$,onError:Z}=Uo(P);o.useEffect(()=>{let j=!1;return(async()=>{if(x){if(typeof x=="string"){if(x.startsWith("http")||x.includes("/")){E({for:w,url:x});return}}else if(typeof x=="object"&&!Array.isArray(x)){const U=x.src;if(U){E({for:w,url:U});return}}}const F=Ba();if(F&&f)try{const U=await Promise.resolve(F(f));!j&&U&&E({for:w,url:U})}catch{}})(),()=>{j=!0}},[x,f,w]);const q=o.useRef(!0),z=o.useRef(null);o.useEffect(()=>(q.current=!0,()=>{q.current=!1,z.current&&ur(z.current),z.current=null;try{A.current?.pause()}catch{}A.current=null}),[]);const V=o.useCallback(()=>new Promise(j=>{if(typeof window<"u"&&window.speechSynthesis&&f){v(!0),window.speechSynthesis.cancel();const F=new SpeechSynthesisUtterance(f);F.lang="ko-KR",F.onend=()=>{v(!1);try{a?.()}catch{}j()},F.onerror=()=>{v(!1),j()},window.speechSynthesis.speak(F)}else j()}),[f,a]),R=o.useCallback(j=>{const F=cr(j,U=>{if(v(!1),U)try{a?.()}catch{}});return A.current=F.el,F.done},[a]),H=o.useCallback(async()=>{if(t||!q.current)return;const j=()=>{z.current===j&&(z.current=null);try{A.current?.pause()}catch{}try{window.speechSynthesis?.cancel()}catch{}v(!1)},F=lr(j);z.current=j;try{window.speechSynthesis?.cancel()}catch{}try{if(D&&(v(!0),await R(D)))return;const U=Yr();if(U&&f)try{const re=await Promise.resolve(U(f));if(!q.current||z.current!==j||re&&(v(!0),await R(re)))return}catch{}if(!q.current||z.current!==j)return;await V()}finally{F(),z.current===j&&(z.current=null)}},[t,D,f,R,V]);o.useImperativeHandle(m,()=>({play:()=>H()}),[H]);const W=j=>j.stopPropagation(),I=o.useCallback(j=>{if(j.stopPropagation(),!t){if(k){try{A.current?.pause()}catch{}try{window.speechSynthesis?.cancel()}catch{}v(!1);return}H()}},[t,k,H]),S=_e("training-word-card",t?"training-word-card--disabled":"",y?"training-word-card--flipped":"",r?"training-word-card--selectable":"",i?"training-word-card--selected":"");return n.jsx("div",{className:S,onClick:r&&!t?s:void 0,role:r?"button":void 0,"aria-pressed":r?i:void 0,tabIndex:r&&!t?0:void 0,"aria-disabled":r&&t?!0:void 0,onKeyDown:r&&!t?j=>{j.target===j.currentTarget&&(j.key==="Enter"||j.key===" "||j.key==="Spacebar")&&(j.preventDefault(),s?.())}:void 0,children:n.jsxs("div",{className:"training-word-card__flipper",style:{transitionDelay:y?"0ms":`${l}ms`},children:[n.jsxs("div",{className:"training-word-card__front",children:[i&&n.jsx("div",{className:"training-word-card__selected-badge",onClick:W,children:n.jsx(At,{type:"dot",size:40,position:"inline",animate:!0,icon:d!=null?void 0:"check",number:d??void 0,"aria-label":d!=null?p("training.nthSelected",{n:d}):p("training.selected","\uC120\uD0DD\uB428")})}),n.jsx("div",{className:"training-word-card__image-wrap",children:O?n.jsx("div",{className:"training-word-card__text-face",children:_.label}):M?n.jsxs(n.Fragment,{children:[L&&n.jsx("div",{className:"training-word-card__spinner"}),n.jsx("img",{ref:G,className:"training-word-card__image",src:P,alt:_.label||p("common.image","\uC774\uBBF8\uC9C0"),style:{opacity:L?0:1},onLoad:$,onError:Z})]}):n.jsx("div",{className:"training-word-card__placeholder"})}),!u&&n.jsxs("div",{className:"training-word-card__body",children:[!O&&n.jsx("div",{className:"training-word-card__word",children:_.label}),_.subLabel&&n.jsxs("div",{className:"training-word-card__pronunciation",children:["[",_.subLabel,"]"]}),_.colloquialLabel&&n.jsxs("div",{className:"training-word-card__colloquial caption-1",children:["[",_.colloquialLabel,"]"]})]}),!c&&n.jsx("div",{className:"training-word-card__bottom",onClick:r?W:void 0,children:n.jsx(pe,{htmlType:"button",size:b?40:48,type:b?"dot":"bar",icon:k?"pause":"play",label:b?void 0:p("training.playSound","\uC18C\uB9AC \uB4E3\uAE30"),selected:k,onClick:I,disabled:t,ariaLabel:p("training.playSound","\uC18C\uB9AC \uB4E3\uAE30")})})]}),n.jsx("div",{className:"training-word-card__back","aria-hidden":"true",children:n.jsx("span",{className:"training-word-card__disabled-symbol",style:{"--disabled-symbol-src":`url("${w4}")`}})})]})})}),B4=260;function Fn(e){const{t}=xe.useTranslation(),{title:a,subtitle:r,headerActions:i,headerSegment:s,children:l,buttons:u,footer:c,footerStart:d,footerEnd:m,footerNote:p,footerNoteDivider:f=!1,footerClassName:y="",footerLayout:x="center",onClose:C,closeDisabled:h=!1,beforeClose:_,closeOnBackdrop:g=!0,className:A="",ariaLabel:b,useTitle:k=!0,inline:v=!1,size:w,layer:B="modal",height:E,fillBody:D=!1,resetScrollKey:N}=e||{},[O,P]=o.useState(!1),G=o.useRef(!1),L=o.useRef(null),M=o.useId(),$=o.useRef(null);o.useEffect(()=>{},[v,a,b,A]),o.useEffect(()=>{N!==void 0&&$.current&&($.current.scrollTop=0)},[N]);const[Z,q]=o.useState(!1);o.useEffect(()=>{const K=$.current;if(!K)return;const oe=()=>q(K.scrollHeight>K.clientHeight+1);if(oe(),typeof ResizeObserver>"u")return;const Ae=new ResizeObserver(oe);Ae.observe(K);const Y=K.firstElementChild;return Y&&Ae.observe(Y),()=>Ae.disconnect()},[l,N]),o.useEffect(()=>{if(!v)return uu()},[v]),o.useEffect(()=>{if(v)return;const K=document.activeElement,oe=L.current;return co(oe,K),oe&&!oe.contains(document.activeElement)&&(oe.querySelector(Cn)??oe).focus(),()=>{const Ae=document.activeElement;(!Ae||Ae===document.body||oe&&oe.contains(Ae))&&po(K)?.focus?.()}},[v]),lo(L,!v);const z=o.useRef(!0),V=mo(),R=o.useRef(null);o.useEffect(()=>(z.current=!0,()=>{z.current=!1,R.current&&(clearTimeout(R.current),R.current=null)}),[]);const H=o.useCallback(()=>{!z.current||!G.current||(G.current=!1,P(!1))},[]),W=o.useCallback((K,oe=!1)=>{if(oe&&!z.current||G.current)return;G.current=!0,P(!0);const Ae=setTimeout(()=>{R.current===Ae&&(R.current=null);let Y;try{Y=K?K():void 0}catch{H();return}Y&&typeof Y.then=="function"&&Y.then(()=>{setTimeout(H,120)},H)},V?0:B4);oe&&(R.current=Ae)},[H,V]),I=o.useCallback(()=>{h||_&&_()===!1||W(C,!0)},[W,C,h,_]),S=o.useRef(I);o.useEffect(()=>{S.current=I});const j=!v&&!!C;o.useEffect(()=>{if(j)return Gn(()=>S.current())},[j]);const F=j&&g,U=o.useRef(!1),re=K=>{U.current=K.target===K.currentTarget},ne=K=>{const oe=U.current;U.current=!1,oe&&K.target===K.currentTarget&&I()},le=n.jsx("div",{className:`popup ${v?"popup--inline":""} ${B==="belowPagePopup"?"popup--below-page-popup":""} ${O?"popup--closing":""} ${A}`,onPointerDown:F?re:void 0,onClick:F?ne:void 0,onMouseDown:v?void 0:K=>{K.target===K.currentTarget&&K.preventDefault()},children:n.jsxs("div",{ref:L,className:`popup-panel${w?` popup-panel--${w}`:""}${E!=null?" popup-panel--has-height":""}${D?" popup-panel--fill-body":""}`,style:E!=null?{"--popup-height":typeof E=="number"?`${E}px`:E}:void 0,tabIndex:-1,role:v?void 0:"dialog","aria-modal":v?void 0:!0,"aria-labelledby":!v&&k&&a?M:void 0,"aria-label":!v&&!(k&&a)?b??(typeof a=="string"?a:void 0):void 0,children:[!k&&(i||C)?n.jsxs("div",{className:"popup-close-float",children:[i,C&&n.jsx(pe,{htmlType:"button",size:40,type:"dot",icon:"x",variant:"transparent-gray",useBorder:!1,onClick:I,disabled:h,ariaLabel:t("common.close","\uB2EB\uAE30")})]}):a||i||C?n.jsxs("div",{className:`popup-header${r?" popup-header--with-subtitle":""}`,children:[n.jsxs("div",{className:"popup-header-main",children:[a?n.jsx("h2",{id:M,className:"popup-title popup-title--left h2",children:a}):n.jsx("span",{id:M,className:"popup-title popup-title--left h2"}),r&&n.jsx("span",{className:"popup-subtitle body-3",children:r})]}),s&&n.jsx("div",{className:"popup-header-segment",children:n.jsx(gn,{size:40,ariaLabel:s.ariaLabel,options:s.options.map(K=>({key:K.key,label:K.label,disabled:K.disabled})),value:s.value,onChange:s.onChange})}),n.jsxs("div",{className:"popup-header-actions",children:[i,C&&n.jsx(pe,{htmlType:"button",size:40,type:"dot",icon:"x",variant:"transparent-gray",useBorder:!1,onClick:I,disabled:h,ariaLabel:t("common.close","\uB2EB\uAE30")})]})]}):null,n.jsx("div",{className:"popup-content",ref:$,tabIndex:Z?0:void 0,children:n.jsx("div",{className:"popup-content__inner",children:typeof l=="function"?l({animateThen:W,closeWithAnimation:I}):l})}),p!=null&&p!==!1&&n.jsx("div",{className:`popup-footer-note caption-1${f?" popup-footer-note--divider":""}`,role:"note",children:p}),d||m?n.jsxs("div",{className:`popup-footer popup-footer--bar${y?` ${y}`:""}`,children:[n.jsx("div",{className:"popup-footer__start",children:typeof d=="function"?d({animateThen:W,closeWithAnimation:I}):d}),n.jsx("div",{className:"popup-footer__end",children:typeof m=="function"?m({animateThen:W,closeWithAnimation:I}):m})]}):u?.length?n.jsx("div",{className:`popup-footer popup-footer--buttons${x!=="center"?` popup-footer--${x}`:""}`,children:u.map((K,oe)=>n.jsx(pe,{htmlType:"button",size:48,variant:K.variant??"default",label:K.label,disabled:K.disabled,onClick:()=>K.onClick?.({animateThen:W,closeWithAnimation:I})},oe))}):c?n.jsx("div",{className:`popup-footer${x!=="center"?` popup-footer--${x}`:""}${y?` ${y}`:""}`,children:typeof c=="function"?c({animateThen:W,closeWithAnimation:I}):c}):null]})});return v||typeof document>"u"?le:en.createPortal(le,document.body)}function Cr(e){return String(e)}const gr=["o","triangle","x"];function Fu(e,t){return e===t?null:t}const Ou={o:"circle",triangle:"triangle",x:"x"},zu={o:"main",triangle:"warn",x:"danger"};function k4(e){let t=0,a=0,r=0;for(const s of Object.values(e))s==="o"?t++:s==="triangle"?a++:s==="x"&&r++;const i=t+a+r;return{marked:i,o:t,triangle:a,x:r,rate:i===0?null:(t+a*.5)/i}}function Ko(e){const t={};for(const[a,r]of Object.entries(e))(r==="o"||r==="triangle"||r==="x")&&(t[a]=r);return t}function Wu(e){const t=[];let a=0;for(const r of e)t.push(a),a+=r;return t}function A4(e,t){return!t&&e>0}const ha={landscape:{width:1123,height:794,printSize:"A4 landscape",printW:"297mm",printH:"210mm"},portrait:{width:794,height:1123,printSize:"A4 portrait",printW:"210mm",printH:"297mm"}};function N4(e="landscape"){St("print-word-table-deprecated","[printWordTable] @deprecated \u2014 WordTablePopup renderButtons \uC758 print(\uB610\uB294 useWordTablePrint().print)\uB97C \uC4F0\uC138\uC694. \uC804\uC5ED \uC778\uC1C4\uB294 \uD654\uBA74\uC758 \uBAA8\uB4E0 \uB2E8\uC5B4\uD45C\uB97C \uD568\uAED8 \uCC0D\uC2B5\uB2C8\uB2E4.");const{printSize:t,printW:a,printH:r}=ha[e],i=document.createElement("style");i.textContent=`@page { size: ${t}; margin: 0; } .word-table { width: ${a} !important; height: ${r} !important; }`,document.head.appendChild(i);const s=()=>{document.head.removeChild(i),window.removeEventListener("afterprint",s)};window.addEventListener("afterprint",s),window.print()}function Hu(e,t){if(e.length===0)return[[]];const a=Math.max(1,Math.floor(t)),r=[];for(let i=0;i<e.length;i+=a)r.push(e.slice(i,i+a));return r}const E4={landscape:{1:{cols:1,rows:1},2:{cols:2,rows:1},3:{cols:3,rows:1},4:{cols:2,rows:2},5:{cols:3,rows:2},6:{cols:3,rows:2},7:{cols:4,rows:2},8:{cols:4,rows:2},9:{cols:5,rows:2},10:{cols:5,rows:2},11:{cols:4,rows:3},12:{cols:4,rows:3}},portrait:{1:{cols:1,rows:1},2:{cols:1,rows:2},3:{cols:1,rows:3},4:{cols:1,rows:4},5:{cols:1,rows:5},6:{cols:2,rows:3},7:{cols:2,rows:4},8:{cols:2,rows:4},9:{cols:2,rows:5},10:{cols:2,rows:5},11:{cols:3,rows:4},12:{cols:3,rows:4}}};function D4(e,t){const a=E4[e][t];if(a)return a;const r=Math.max(1,Math.ceil(t)),i=Math.max(1,Math.ceil(Math.sqrt(r*.707)));let s,l;return e==="landscape"?(l=i,s=Math.ceil(r/l)):(s=i,l=Math.ceil(r/s)),(e==="landscape"?s<l:l<s)&&([s,l]=[l,s]),{cols:s,rows:l}}const S4={show:"word-table-block__content--cut-show",dashed:"",corner:"word-table-block__content--cut-corner",hide:""},Vu={\uBA85:"\uBA85\uC0AC",\uB3D9:"\uB3D9\uC0AC",\uD615:"\uD615\uC6A9\uC0AC",\uBD80:"\uBD80\uC0AC",\uC218:"\uC218\uC0AC",\uAD00:"\uAD00\uD615\uC0AC",\uAC10:"\uAC10\uD0C4\uC0AC",\uC870:"\uC870\uC0AC",\uC811:"\uC811\uC0AC",\uC758:"\uC758\uC874\uBA85\uC0AC",\uB300:"\uB300\uBA85\uC0AC",\uBCF4\uB3D9:"\uBCF4\uC870\uB3D9\uC0AC",\uBCF4\uD615:"\uBCF4\uC870\uD615\uC6A9\uC0AC"},qu={\uACE0\uC720:"\uACE0\uC720\uC5B4",\uD55C\uC790:"\uD55C\uC790\uC5B4",\uC678\uB798:"\uC678\uB798\uC5B4",\uD63C\uC885:"\uD63C\uC885\uC5B4"},Yo={\uBA85:"noun",\uB3D9:"verb",\uD615:"adjective",\uBD80:"adverb",\uC218:"numeral",\uAD00:"determiner",\uAC10:"interjection",\uC870:"particle",\uC811:"affix",\uC758:"dependentNoun",\uB300:"pronoun",\uBCF4\uB3D9:"auxVerb",\uBCF4\uD615:"auxAdjective"},Zo={\uACE0\uC720:"native",\uD55C\uC790:"sino",\uC678\uB798:"foreign",\uD63C\uC885:"mixed"};function Uu(e){return Object.fromEntries(Object.entries(Vu).map(([t,a])=>[t,Yo[t]?e(`wordTable.pos.${Yo[t]}`,{defaultValue:a}):a]))}function Gu(e){return Object.fromEntries(Object.entries(qu).map(([t,a])=>[t,Zo[t]?e(`wordSearch.filter.type.${Zo[t]}`,{defaultValue:a}):a]))}const T4={pos:Yo,wordType:Zo};function Xo(e,t){return e?e.split("/").map(a=>t[a]??a).join("/"):""}function Ku(e,t,a,r){if(r!=="dashed")return{};const i=e%t,s=Math.floor(e/t),l=i<t-1,u=s<a-1;if(!l&&!u)return{};const c="#ddd",d=y=>`repeating-linear-gradient(to ${y}, ${c} 0, ${c} 5px, transparent 5px, transparent 10px)`,m=[],p=[],f=[];return l&&(m.push(d("bottom")),p.push("1px 100%"),f.push("right center")),u&&(m.push(d("right")),p.push("100% 1px"),f.push("center bottom")),{backgroundImage:m.join(", "),backgroundSize:p.join(", "),backgroundPosition:f.join(", "),backgroundRepeat:"no-repeat",printColorAdjust:"exact",WebkitPrintColorAdjust:"exact"}}const j4=280,M4=240,L4=280,$4=400,R4=120,P4=280;function Yu(e,t){const a=o.useRef(null),[r,i]=o.useState(1),[s,l]=o.useState(0),u=o.useCallback((c,d)=>{if(!(c>0))return;const m=c/e,p=t&&d>0?d/t:1/0,f=Math.min(1,m,p);i(f),l(Math.max(0,(c-e*f)/2))},[e,t]);return o.useEffect(()=>{const c=a.current;if(!c)return;const d=t?c.parentElement??c:c;if(u(d.clientWidth,d.clientHeight),typeof ResizeObserver>"u")return;const m=new ResizeObserver(([p])=>u(p.contentRect.width,p.contentRect.height));return m.observe(d),()=>m.disconnect()},[u,t]),{scalerRef:a,scale:r,offset:s}}const I4=24,F4={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},O4=400,Zu=8;function Xu({label:e,subLabel:t,colloquialLabel:a,homonum:r,showWord:i=!0,showImage:s=!0,showPronunciation:l=!0,showColloquial:u=!0,buttonSize:c=40,wordInfo:d,outerScale:m=1}){const{t:p}=xe.useTranslation(),f=o.useRef(null),y=o.useRef(null),x=o.useRef(null),[C,h]=o.useState(1),[_,g]=o.useState(!1),[A,b]=o.useState({for:"",url:""}),[k,v]=o.useState(null),w=t&&t.length>0?t:Ff()?.(e,r)??"",B=aa()?.(e,r)??"",{imgRef:E,loading:D,failed:N,onLoad:O,onError:P}=Uo(B),G=o.useCallback(()=>v(y.current?.getBoundingClientRect()??null),[]),L=o.useCallback(()=>v(null),[]),M=fo(!!k,j=>{j?G():L()},y),$=o.useMemo(()=>{if(!d)return null;const j=[];return d.grade&&j.push(p("wordTable.info.grade",{n:d.grade,defaultValue:"\uB09C\uC774\uB3C4: {{n}}\uB4F1\uAE09"})),d.syllables&&j.push(p("wordTable.info.syllables",{n:d.syllables,defaultValue:"\uC74C\uC808 \uC218: {{n}}\uC74C\uC808"})),d.pos&&j.push(p("wordTable.info.pos",{v:Xo(d.pos,Uu(p)),defaultValue:"\uD488\uC0AC: {{v}}"})),d.wordType&&j.push(p("wordTable.info.wordType",{v:Xo(d.wordType,Gu(p)),defaultValue:"\uC720\uD615: {{v}}"})),j.length?j:null},[d,p]),Z=w||e,q=A.for===Z?A.url:"";o.useEffect(()=>{const j=Ba(),F=w||e;if(!j||!F)return;let U=!1;return Promise.resolve(j(F)).then(re=>{!U&&re&&b({for:F,url:re})}),()=>{U=!0}},[w,e]);const z=o.useRef(null),V=o.useRef(null);o.useEffect(()=>()=>{x.current?.pause(),V.current?.()},[]);const R=o.useCallback(j=>{if(j.stopPropagation(),_){z.current?.();return}if(!q)return;g(!0);const F=cr(q,()=>{g(!1),V.current?.()});x.current=F.el,z.current=F.stop,V.current=lr(F.stop)},[_,q]),H=s&&!!B&&!N,W=H&&i?j4:H?L4:M4,I=H&&i?$4:H?P4:R4;o.useEffect(()=>{const j=f.current;if(!j||typeof ResizeObserver>"u")return;const F=new ResizeObserver(([U])=>{const{width:re,height:ne}=U.contentRect;h(Math.min(re/W,ne/I))});return F.observe(j),()=>F.disconnect()},[W,I]);const S=c*m<I4;return n.jsxs("div",{ref:f,className:_e("word-table-cell",S&&"word-table-cell--tap-too-small",H?"word-table-cell--with-image":""),"data-ref-w":W,"data-ref-h":I,children:[n.jsxs("div",{className:"word-table-cell__inner",style:{transform:`scale(${C})`},children:[H&&n.jsxs("div",{className:"word-table-cell__image-wrap",children:[D&&n.jsx("div",{className:"word-table-cell__spinner"}),n.jsx("img",{ref:E,className:"word-table-cell__image",src:B,alt:e,draggable:!1,style:{opacity:D?0:1},onLoad:O,onError:P})]}),i&&n.jsx("span",{className:"word-table-cell__word h0",children:e}),l&&w&&n.jsxs("span",{className:"word-table-cell__sub h3",children:["[",w,"]"]}),u&&a&&n.jsxs("span",{className:"word-table-cell__colloquial h5",children:["[",a,"]"]})]}),n.jsxs("div",{className:"word-table-cell__play-button","data-audio-src":q,children:[n.jsx("span",{"data-play-state":"play",style:{display:_?"none":void 0},children:n.jsx(pe,{htmlType:"button",size:c,type:"dot",icon:"play",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:p("common.play","\uC7AC\uC0DD"),ariaLabel:e?p("common.playFor",{name:e,defaultValue:`${e} \uC7AC\uC0DD`}):p("common.play","\uC7AC\uC0DD"),onClick:R})}),n.jsx("span",{"data-play-state":"pause",style:{display:_?void 0:"none"},children:n.jsx(pe,{htmlType:"button",size:c,type:"dot",icon:"pause",useBorder:!1,selected:!0,showTooltipInfo:p("common.pause","\uBA48\uCDA4"),ariaLabel:e?p("common.pauseFor",{name:e,defaultValue:`${e} \uBA48\uCDA4`}):p("common.pause","\uBA48\uCDA4"),onClick:R})})]}),d&&n.jsxs("div",{ref:y,className:"word-table-cell__info-button",onPointerEnter:j=>{ia(j)||G()},onPointerLeave:j=>{ia(j)||L()},onFocus:()=>{la()||G()},onBlur:L,children:[n.jsx(pe,{htmlType:"button",size:c,type:"dot",icon:"info",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:!1,ariaLabel:p("wordTable.wordInfo","{{word}} \uB0B1\uB9D0 \uC815\uBCF4",{word:e}),onClick:j=>{j.stopPropagation(),M.touchPress()}}),k&&$&&n.jsx(Kn,{anchorRect:k,items:$,showIndex:!1})]})]})}function fa({title:e,titleIcon:t,disc:a,className:r,orientation:i="landscape",contentTypes:s=["image","word","standardPron"],cutLine:l="show",showOutline:u=!0,showDivLine:c=!0,items:d,editCells:m,count:p,activeCell:f=null,onActivateCell:y,onRemoveCell:x,onRemoveItem:C,onReorder:h,renderCellAction:_,showFillerAdd:g=!1,contentRef:A,buttonSize:b=40,brand:k,code:v,pageNumber:w,pageNumberPosition:B="right",fitHeight:E=!1,scoring:D=!1,marks:N,onMarkClick:O,scoreIndexOffset:P=0}){const G=o.useCallback((Be,je)=>{O?.(P+Be,je)},[O,P]),L=(Be,je)=>{const Se=N?.[Cr(P+Be)]??null;return n.jsx("div",{className:_e("word-table-cell__score",Se?"word-table-cell__score--marked":""),style:Ve>1?{transform:`translateX(-50%) scale(${Ve})`,transformOrigin:"bottom center"}:void 0,children:gr.map(Xe=>n.jsx("span",{className:_e("word-table-cell__score-slot",Se===Xe?"word-table-cell__score-slot--on":""),children:n.jsx(pe,{htmlType:"button",size:b,type:"dot",shape:"pill",icon:Ou[Xe],variant:Se===Xe?zu[Xe]:"default",selected:Se===Xe,useBorder:!1,...ke?{}:{tabIndex:-1,role:"img"},showTooltipInfo:M(`wordTable.scoring.markName.${Xe}`,{defaultValue:Xe}),ariaLabel:M(`wordTable.scoring.${Xe}`,{word:je,defaultValue:`${je} ${Xe}`}),onClick:ke?Qe=>{Qe.stopPropagation(),G(Be,Xe)}:void 0})},Xe))})},{t:M}=xe.useTranslation(),$=m!==void 0,Z=e!=null||!!t||!!a,q=ln("(max-width: 767px)"),z=o.useRef(null),[V,R]=o.useState(null),H=d?.length??0,[W,I]=o.useState(null),[S,j]=o.useState(""),F=o.useRef(null),U=o.useRef(null),re=o.useRef(null),ne=o.useRef(null),le=o.useCallback(Be=>{U.current=Be,typeof A=="function"?A(Be):A&&(A.current=Be)},[A]),K=o.useCallback((Be,je)=>{F.current=je,h?.(Be,je),j(M("wordTable.reorder.moved",{n:je+1,total:H,defaultValue:"{{total}}\uCE78 \uAC00\uC6B4\uB370 {{n}}\uBC88\uC9F8\uB85C \uC62E\uAE40"}))},[h,M,H]);o.useEffect(()=>{const Be=F.current;Be!=null&&(F.current=null,U.current?.querySelectorAll(".word-table-block__card:not(.word-table-block__card--filler)")?.[Be]?.querySelector(".word-table-block__card-handle button")?.focus())}),o.useEffect(()=>()=>{ne.current?.()},[]);const oe=o.useCallback((Be,je)=>{if(!h||!Be.altKey||Be.ctrlKey||Be.metaKey)return;const Se=Be.key==="ArrowRight";if(!Se&&Be.key!=="ArrowLeft")return;Be.preventDefault();const Xe=je+(Se?1:-1);Xe<0||Xe>=H||K(je,Xe)},[h,H,K]),Ae=o.useCallback((Be,je)=>{if(!h||Be.pointerType==="mouse")return;const Se=Be.target.closest?.("button");if(Se&&!Se.closest(".word-table-block__card-handle"))return;ne.current?.();const Xe={x:Be.clientX,y:Be.clientY};let Qe=!1;const dt=se=>{Qe&&se.cancelable&&se.preventDefault()};let ht=null,wt=null;const Ct=()=>{const se=wt;if(!se)return;const Ne=document.elementFromPoint?.(se.x,se.y)?.closest?.("[data-wordtable-cell]"),We=Ne?Number(Ne.dataset.wordtableCell):NaN,nt=Number.isInteger(We)?We:null;re.current=nt,R(Fe=>Fe===nt?Fe:nt)},Nt=se=>{if(!Qe){(Math.abs(se.clientX-Xe.x)>Zu||Math.abs(se.clientY-Xe.y)>Zu)&&Ke();return}if(wt={x:se.clientX,y:se.clientY},typeof requestAnimationFrame>"u"){Ct();return}ht===null&&(ht=requestAnimationFrame(()=>{ht=null,Ct()}))},gt=()=>{ht!==null&&(cancelAnimationFrame(ht),ht=null,Ct());const se=re.current,Ne=Qe;Ke(),Ne&&se!=null&&se!==je&&K(je,se)},it=setTimeout(()=>{Qe=!0,I(je),re.current=je,R(je),window.addEventListener("touchmove",dt,{passive:!1})},O4);function Ke(){clearTimeout(it),window.removeEventListener("pointermove",Nt),window.removeEventListener("pointerup",gt),window.removeEventListener("pointercancel",gt),window.removeEventListener("touchmove",dt),Qe=!1,ht!==null&&(cancelAnimationFrame(ht),ht=null),re.current=null,ne.current=null,I(null),R(null)}ne.current=Ke,window.addEventListener("pointermove",Nt),window.addEventListener("pointerup",gt),window.addEventListener("pointercancel",gt)},[h,K]),{width:Y,height:Q}=ha[i],me=typeof E=="number"?E:E&&typeof E=="object"?q?E.narrow:E.wide:null,{scalerRef:De,scale:be,offset:te}=Yu(Y,E?Q:void 0),ue=$?m?.length??0:d?.length??0,fe=Math.max(p??ue,1),{cols:ge,rows:Ce}=D4(i,fe),$e={word:s.length===0||s.includes("word"),image:s.length===0||s.includes("image"),pron:s.length===0||s.includes("standardPron"),colloq:s.length===0||s.includes("colloquialPron")},He=$?(m??[]).some(Be=>Be!==null&&Be.length>1):(d??[]).some(Be=>(Be.words??[]).length>1),Te=!!k?.show,Ie=!!k?.show&&k?.top!==!1,qe=!!k?.show&&k?.bottom!==!1,mt=k?.copyright??"\xA9 IHAB, Inc. All rights reserved.",ct=_e("word-table-block__content",S4[l],u&&"word-table-block__content--outline",c&&He&&"word-table-block__content--div-line",!Te&&w&&B!=="none"&&"word-table-block__content--page-number",Ie&&"word-table-block__content--brand-top",qe&&"word-table-block__content--brand-bottom"),rt={transform:`scale(${1/be})`,transformOrigin:"center center"},ft=b*gr.length+4*(gr.length-1),ke=!!O,Ve=ke?Math.max(1,Math.min(1/be,Y/ge/ft)):1,we=n.jsxs("div",{ref:De,className:"word-table__scaler",style:{height:Q*be},children:[n.jsx("div",{className:_e("word-table",D&&!ke&&"word-table--score-readonly",!Z&&r),style:{width:Y,height:Q,transform:`scale(${be})`,transformOrigin:"top left",marginLeft:te},children:n.jsxs("div",{ref:le,className:ct,style:{gridTemplateColumns:`repeat(${ge}, 1fr)`,gridTemplateRows:`repeat(${Ce}, 1fr)`},children:[$?n.jsx(n.Fragment,{children:(m??[]).map((Be,je)=>n.jsx("div",{className:_e("word-table-block__edit-cell",Be?"word-table-block__edit-cell--filled":"word-table-block__edit-cell--empty",f===je?"word-table-block__edit-cell--active":""),style:Ku(je,ge,Ce,l),children:Be?n.jsxs(n.Fragment,{children:[Be.map((Se,Xe)=>n.jsxs(o.Fragment,{children:[Xe>0&&n.jsx("div",{className:"word-table-block__pair-divider"}),n.jsx(Xu,{outerScale:be,label:Se.word,subLabel:Se.pronunciation,colloquialLabel:Se.colloquialPronunciation,homonum:Se.homonum,showWord:$e.word,showImage:$e.image,showPronunciation:$e.pron,showColloquial:$e.colloq,buttonSize:b})]},Xe)),D&&L(je,Be.map(Se=>Se.word).join(" / ")),x&&n.jsx("div",{className:"word-table-block__card-close",children:n.jsx(pe,{htmlType:"button",size:b,type:"dot",icon:"x",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:Be.length>1?M("wordPrint.removePair","\uB300\uB9BD\uC30D \uBE7C\uAE30"):M("wordPrint.removeWord","\uB2E8\uC5B4 \uBE7C\uAE30"),ariaLabel:Be.length>1?M("wordPrint.removePair","\uB300\uB9BD\uC30D \uBE7C\uAE30"):M("wordPrint.removeWord","\uB2E8\uC5B4 \uBE7C\uAE30"),onClick:()=>x(je)})})]}):y&&n.jsx("div",{style:rt,children:n.jsx(pe,{htmlType:"button",size:"48",type:"bar",icon:"plus",label:M("wordTable.addWord","\uCD94\uAC00\uD558\uAE30"),onClick:()=>y(je)})})},je))}):n.jsxs(n.Fragment,{children:[(d??[]).map((Be,je)=>n.jsxs("div",{"data-wordtable-cell":h?je:void 0,className:`word-table-block__card${h?" word-table-block__card--draggable":""}${V===je?" word-table-block__card--drag-over":""}${W===je?" word-table-block__card--dragging":""}`,style:Ku(je,ge,Ce,l),draggable:!!h,onPointerDown:h?Se=>Ae(Se,je):void 0,onKeyDown:h?Se=>oe(Se,je):void 0,onDragStart:h?()=>{z.current=je}:void 0,onDragOver:h?Se=>{Se.preventDefault(),R(je)}:void 0,onDragLeave:h?()=>R(null):void 0,onDrop:h?Se=>{Se.preventDefault(),z.current!==null&&z.current!==je&&h(z.current,je),z.current=null,R(null)}:void 0,onDragEnd:h?()=>{z.current=null,R(null)}:void 0,children:[(Be.words??[]).map((Se,Xe)=>n.jsxs(o.Fragment,{children:[Xe>0&&n.jsx("div",{className:"word-table-block__pair-divider"}),n.jsx(Xu,{outerScale:be,label:Se.label,subLabel:Se.subLabel,colloquialLabel:Se.colloquialLabel,homonum:Se.homonum,showWord:$e.word,showImage:$e.image,showPronunciation:$e.pron,showColloquial:$e.colloq,buttonSize:b,wordInfo:Se.grade||Se.syllables!=null||Se.pos||Se.wordType?{grade:Se.grade,syllables:Se.syllables,pos:Se.pos,wordType:Se.wordType}:void 0})]},Xe)),D&&L(je,(Be.words??[]).map(Se=>Se.label).join(" / ")),h&&n.jsx("div",{className:"word-table-block__card-handle",children:n.jsx(pe,{htmlType:"button",size:b,type:"dot",icon:"grip-vertical",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:M("wordTable.reorder.hint","Alt + \u2190 \u2192 \uB85C \uC21C\uC11C \uBC14\uAFB8\uAE30"),ariaLabel:M("wordTable.reorder.handle",{word:(Be.words??[]).map(Se=>Se.label).join(" / "),defaultValue:"{{word}} \uC21C\uC11C \uBC14\uAFB8\uAE30 (Alt + \uD654\uC0B4\uD45C)"})})}),(_||C)&&n.jsxs("div",{className:"word-table-block__card-actions",children:[_?.(je,Be),C&&n.jsx("div",{className:"word-table-block__card-close",children:n.jsx(pe,{htmlType:"button",size:b,type:"dot",icon:"x",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:(Be.words??[]).length>1?M("wordPrint.removePair","\uB300\uB9BD\uC30D \uBE7C\uAE30"):M("wordPrint.removeWord","\uB2E8\uC5B4 \uBE7C\uAE30"),ariaLabel:(Be.words??[]).length>1?M("wordPrint.removePair","\uB300\uB9BD\uC30D \uBE7C\uAE30"):M("wordPrint.removeWord","\uB2E8\uC5B4 \uBE7C\uAE30"),onClick:()=>C(Be.id)})})]})]},Be.id)),Array.from({length:Math.max(0,ge*Ce-(d?.length??0))}).map((Be,je)=>{const Se=(d?.length??0)+je<fe;return n.jsx("div",{className:"word-table-block__card word-table-block__card--filler",children:g&&y&&Se&&n.jsx("div",{style:rt,children:n.jsx(pe,{htmlType:"button",size:b,type:"bar",icon:"plus",label:M("wordTable.addWord","\uCD94\uAC00\uD558\uAE30"),onClick:()=>y((d?.length??0)+je)})})},`filler-${je}`)})]}),Ie&&n.jsx(n.Fragment,{children:n.jsxs("div",{className:"word-table__band word-table__band--top",children:[n.jsx("img",{className:"word-table__brand-logo",src:k?.topLogo?.src??ir,alt:k?.topLogo?.alt??"\uB9D0\uADC0"}),(()=>{const Be=[k?.title&&n.jsx("span",{className:"word-table__paper-title",children:k.title},"t"),k?.owner&&n.jsx("span",{className:"word-table__owner",children:k.owner},"o"),v&&n.jsx("span",{className:"word-table__code",children:v},"c")].filter(Boolean);return Be.length===0?null:n.jsx("span",{className:"word-table__ident",children:Be.map((je,Se)=>n.jsxs(o.Fragment,{children:[Se>0&&n.jsx("span",{className:"word-table__ident-dot","aria-hidden":"true",children:"\xB7"}),je]},Se))})})()]})}),qe&&n.jsx(n.Fragment,{children:n.jsxs("div",{className:"word-table__band word-table__band--bottom",children:[n.jsxs("span",{className:"word-table__brand-by",children:[k?.bottomLogo?n.jsx("img",{className:"word-table__brand-logo--ihab word-table__brand-logo--given",src:k.bottomLogo.src,alt:k.bottomLogo.alt}):n.jsx("span",{className:"word-table__brand-logo--ihab",role:"img","aria-label":"IHAB"}),n.jsx("span",{className:"word-table__copyright",children:mt})]}),n.jsxs("span",{className:"word-table__band-end",children:[k?.link&&n.jsx("span",{className:"word-table__link",children:k.link}),w&&B!=="none"&&n.jsx("span",{className:"word-table__page-count",children:M("wordTable.filter.pageIndicator",{current:w.current,total:w.total})})]})]})}),!Te&&w&&B!=="none"&&n.jsx("span",{className:`word-table__page-number body-3 word-table__page-number--${B}`,children:M("wordTable.filter.pageIndicator",{current:w.current,total:w.total})})]})}),h&&n.jsx("span",{role:"status",style:F4,children:S})]}),Ue=me==null?we:n.jsx("div",{className:"word-table__frame",style:{height:me},children:we});return Z?n.jsx(ma,{type:"page",icon:t,title:e,disc:a,className:_e("word-table-block",r),children:Ue}):Ue}function z4(e,t,a){const r=[];for(const i of e??[]){if(i.type==="note"||i.type==="input")continue;const s=i.displayLabel??i.label,l=W4(i,t?.[i.label],a);l!==null&&r.push(`${s} ${l}`)}return r.join(" \xB7 ")}function W4(e,t,a){const r=(Array.isArray(t)?t:t===void 0?[]:[t]).filter(i=>i!==dn);return r.length===0?e.allOption?e.allLabel??a:null:r.map(i=>H4(e,i)).join(", ")}function H4(e,t){const a=[...e.items??[],...(e.groups??[]).flat()];for(const r of a)if(r!=null){if(typeof r=="string"){if(r===t)return r;continue}if(r.value===t)return r.displayLabel??r.labels?.join(" ")??r.value}return t}function Dn({title:e,titleLevel:t=2,headerAction:a,headerSummary:r,collapsible:i=!1,defaultCollapsed:s=!1,collapsed:l,onCollapsedChange:u,footer:c,sections:d,selected:m={},onSelect:p,align:f,sectionAlign:y,className:x}){const C=(f??(y==="vertical"?"newline":"inline"))==="inline",{t:h}=xe.useTranslation(),[_,g]=o.useState(s),A=l??_,b=()=>{const N=!A;g(N),u?.(N)},k=N=>{if(!i)return;const O=N.target;!O||typeof O.closest!="function"||O.closest(".filter-panel__collapse-toggle")||O.closest('button, a, input, select, textarea, label, [role="radiogroup"], [role="button"], [role="menu"]')||b()},v=o.useMemo(()=>r!==void 0||!A?"":z4(d,m,h("common.all","\uC804\uCCB4")),[r,A,d,m,h]),w=r??(v?n.jsx("span",{className:"filter-panel__header-summary body-3",children:v}):null),B=e||a||r||i,E=o.useId(),D=t?`h${t}`:"span";return n.jsxs("div",{className:_e("filter-panel",i?"filter-panel--collapsible":"",A?"filter-panel--collapsed":"",x),role:typeof e=="string"&&e?"group":void 0,"aria-labelledby":typeof e=="string"&&e?E:void 0,children:[B&&n.jsxs("div",{className:"filter-panel__header",onClick:i?k:void 0,children:[n.jsx("div",{className:"filter-panel__title-row",children:e&&n.jsx(D,{id:E,className:"filter-panel__title h4",children:e})}),n.jsxs("div",{className:"filter-panel__header-actions",children:[A?w:a,i&&n.jsx(pe,{htmlType:"button",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:A?"chevron-down":"chevron-up",className:"filter-panel__collapse-toggle",ariaLabel:A?h("common.expand","\uD3BC\uCE58\uAE30"):h("common.collapse","\uC811\uAE30"),showTooltipInfo:A?h("common.expand","\uD3BC\uCE58\uAE30"):h("common.collapse","\uC811\uAE30"),"aria-expanded":!A,onClick:b})]})]}),!A&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:_e("filter-panel__sections",C?"filter-panel__sections--row":""),children:d.map(N=>{const O=m[N.label],P=O===void 0||(Array.isArray(O)?O.length===0:!1),G=(N.items??[]).filter(M=>M!=null);N.allOption&&G.some(M=>(typeof M=="string"?M:M.value)===dn)&&St(`filter-panel-all-value:${N.label}`,`[FilterPanel] '${N.label}' \uC808\uC5D0 allOption \uACFC \uAC12 '${dn}' \uC778 \uBCF4\uAE30\uAC00 \uD568\uAED8 \uC788\uB2E4 \u2014 \uB450 \uC120\uD0DD\uC774 \uAD6C\uBCC4\uB418\uC9C0 \uC54A\uB294\uB2E4. \uBCF4\uAE30 \uAC12\uC744 \uBC14\uAFD4\uB77C.`);const L=M=>{const $=typeof M=="string"?M:M.value,Z=typeof M!="string"&&!!M.disabled,q=typeof M!="string"?M.labels:void 0,z=typeof M!="string"?M.displayLabel:void 0,V=typeof M!="string"?M.tooltip:void 0,R=typeof M!="string"?M.descriptionTooltip:void 0,H=typeof M!="string"?M.shape:void 0,W=Array.isArray(O)?O.includes($):O===$;return n.jsx(pe,{htmlType:"button",size:"keyboard",label:q??z??$,type:N.itemType??(q?"bar":$.length===1?"dot":void 0),selected:W,disabled:Z,shape:H,showTooltipInfo:!!V,tooltipInfoText:V,tooltipDescription:R,onClick:()=>p?.($,N.label)},$)};return n.jsxs(o.Fragment,{children:[N.groupLabel&&n.jsxs("div",{className:"filter-panel__group-label-row",children:[n.jsx("div",{className:"filter-panel__group-label body-2",children:N.groupLabel}),N.groupAction]}),n.jsxs("div",{className:_e("filter-panel__section",N.layout==="row"?"filter-panel__section--row":"",N.block?"filter-panel__section--block":""),children:[n.jsxs("div",{className:"filter-panel__section-label-row",children:[n.jsx("span",{className:"filter-panel__section-label body-3",children:N.displayLabel??N.label}),N.labelAction??(N.labelInfo?n.jsx(Pa,{...N.labelInfo}):null)]}),N.type==="note"?n.jsx("div",{className:"filter-panel__note body-3",children:N.content}):N.type==="input"?n.jsx(Xn,{className:"filter-panel__textfield",placeholder:N.placeholder,ariaLabel:N.displayLabel??N.label,value:m[N.label]??"",onChange:M=>p?.(M,N.label),error:N.error}):!N.multiple&&N.display==="segmented"?n.jsx(gn,{ariaLabel:N.displayLabel??N.label,options:[...N.allOption?[{key:dn,label:N.allLabel??h("common.all","\uC804\uCCB4"),disabled:N.allOptionDisabled}]:[],...G.map(M=>{const $=typeof M=="string"?M:M.value,Z=typeof M!="string"?M.displayLabel:void 0,q=typeof M!="string"?M.disabled:void 0;return{key:$,label:Z??$,disabled:q}})],value:P&&N.allOption?dn:m[N.label]??"",onChange:M=>p?.(M,N.label),size:32}):!N.multiple&&N.display==="dropdown"?n.jsx(pn,{className:"filter-panel__dropdown",ariaLabel:typeof N.label=="string"?N.label:void 0,size:40,options:[...N.allOption?[{value:dn,label:N.allLabel??h("common.all","\uC804\uCCB4"),disabled:N.allOptionDisabled}]:[],...G.map(M=>{const $=typeof M=="string"?M:M.value,Z=typeof M!="string"?M.displayLabel:void 0,q=typeof M!="string"?M.disabled:void 0;return{value:$,label:Z??$,disabled:q}})],value:P&&N.allOption?dn:m[N.label],onChange:M=>p?.(M,N.label)}):n.jsxs("div",{className:N.groups?"filter-panel__item-groups":"filter-panel__items",children:[N.allOption&&!N.groups&&n.jsx(pe,{htmlType:"button",size:"keyboard",label:N.allLabel??h("common.all","\uC804\uCCB4"),selected:P,disabled:N.allOptionDisabled,onClick:()=>p?.(dn,N.label)}),N.groups?N.groups.map((M,$)=>n.jsxs("div",{className:"filter-panel__item-group",children:[$===0&&N.allOption&&n.jsx(pe,{htmlType:"button",size:"keyboard",label:N.allLabel??h("common.all","\uC804\uCCB4"),selected:P,disabled:N.allOptionDisabled,onClick:()=>p?.(dn,N.label)}),M.filter(Z=>Z!=null).map(L)]},$)):G.map(L)]})]})]},N.label)})}),c!=null&&c!==!1&&n.jsx("div",{className:"filter-panel__footer body-3",children:c})]})]})}const V4=[1,2,3,4,5,6,7,8,9,10,11,12],Ju=[8,4,2,1],rn="show",yn="hide";function Qu(e,t){return{label:e("wordTable.filter.composition","\uAD6C\uC131"),items:[{value:"image",disabled:!t.hasImage,displayLabel:e("wordTable.filter.image","\uC774\uBBF8\uC9C0")},{value:"word",displayLabel:e("wordTable.filter.word","\uB2E8\uC5B4")},{value:"standardPron",displayLabel:e("wordTable.filter.standardPron","\uD45C\uC900 \uBC1C\uC74C")},{value:"colloquialPron",disabled:!t.hasColloquial,displayLabel:e("wordTable.filter.colloquialPron","\uAD6C\uC5B4\uCCB4 \uBC1C\uC74C")}],multiple:!0,allOption:!0}}function ec(e){return{label:e("wordTable.filter.paperOrientation","\uC6A9\uC9C0 \uBC29\uD5A5"),items:[{value:"landscape",displayLabel:e("wordTable.filter.landscape","\uAC00\uB85C")},{value:"portrait",displayLabel:e("wordTable.filter.portrait","\uC138\uB85C")}],display:"segmented"}}function tc(e){return{label:e("wordTable.filter.border","\uC678\uACFD\uC120"),items:[{value:rn,displayLabel:e("wordTable.filter.show","\uD45C\uC2DC")},{value:yn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function nc(e){return{label:e("wordTable.filter.topInfo","\uC0C1\uB2E8 \uC815\uBCF4"),items:[{value:rn,displayLabel:e("wordTable.filter.show","\uD45C\uC2DC")},{value:yn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function ac(e){return{label:e("wordTable.filter.bottomInfo","\uD558\uB2E8 \uC815\uBCF4"),items:[{value:rn,displayLabel:e("wordTable.filter.show","\uD45C\uC2DC")},{value:yn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function rc(e){return{label:e("wordTable.filter.cutLine","\uC808\uCDE8\uC120"),items:[{value:rn,displayLabel:e("wordTable.filter.show","\uD45C\uC2DC")},{value:"dashed",displayLabel:e("wordTable.filter.dotted","\uC810\uC120")},{value:"corner",displayLabel:e("wordTable.filter.corner","\uCF54\uB108")},{value:yn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function oc(e){return{label:e("wordPrint.divLine","\uB300\uB9BD\uC120"),items:[{value:rn,displayLabel:e("wordTable.filter.show","\uD45C\uC2DC")},{value:yn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function sc(e,t){return{label:e(t.hasPairs?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord"),items:[t.itemCount,...Ju.filter(a=>a<t.itemCount)].map(a=>({value:`${a}\uAC1C`,displayLabel:e("wordTable.filter.itemsPerPageOption",{count:a})})),display:"segmented"}}function ic(e,t){return e===t||!Ju.includes(e)?Number.POSITIVE_INFINITY:e}function q4(e){return{label:e("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638"),items:[{value:"left",displayLabel:e("wordTable.filter.pageNumberLeft","\uC67C\uCABD")},{value:"center",displayLabel:e("wordTable.filter.pageNumberCenter","\uC911\uC559")},{value:"right",displayLabel:e("wordTable.filter.pageNumberRight","\uC624\uB978\uCABD")},{value:yn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function lc(e){return e==="left"||e==="center"||e==="right"?e:"none"}function uc(e,t){return{[e("wordTable.filter.composition","\uAD6C\uC131")]:t.contentTypes,[e("wordTable.filter.paperOrientation","\uC6A9\uC9C0 \uBC29\uD5A5")]:t.orientation,[e("wordTable.filter.border","\uC678\uACFD\uC120")]:t.showOutline?rn:yn,[e("wordTable.filter.cutLine","\uC808\uCDE8\uC120")]:t.cutLine,[e("wordPrint.divLine","\uB300\uB9BD\uC120")]:t.showDivLine?rn:yn,...t.showTopInfo!=null?{[e("wordTable.filter.topInfo","\uC0C1\uB2E8 \uC815\uBCF4")]:t.showTopInfo?rn:yn}:{},...t.showBottomInfo!=null?{[e("wordTable.filter.bottomInfo","\uD558\uB2E8 \uC815\uBCF4")]:t.showBottomInfo?rn:yn}:{}}}function cc(e,t,a,r){return a===e("wordTable.filter.composition","\uAD6C\uC131")?t===dn?(r.setContentTypes(()=>[]),!0):(r.setContentTypes(i=>i.includes(t)?i.filter(s=>s!==t):[...i,t]),!0):a===e("wordTable.filter.paperOrientation","\uC6A9\uC9C0 \uBC29\uD5A5")?(r.setOrientation(t==="landscape"?"landscape":"portrait"),!0):a===e("wordTable.filter.border","\uC678\uACFD\uC120")?(r.setShowOutline(t===rn),!0):a===e("wordTable.filter.cutLine","\uC808\uCDE8\uC120")?(r.setCutLine(t),!0):a===e("wordPrint.divLine","\uB300\uB9BD\uC120")?(r.setShowDivLine(t===rn),!0):a===e("wordTable.filter.topInfo","\uC0C1\uB2E8 \uC815\uBCF4")?(r.setShowTopInfo?.(t===rn),!0):a===e("wordTable.filter.bottomInfo","\uD558\uB2E8 \uC815\uBCF4")?(r.setShowBottomInfo?.(t===rn),!0):!1}function U4(e){return"sections"in e}function Jo(e){const{t}=xe.useTranslation(),{title:a,className:r,collapsible:i,defaultCollapsed:s,collapsed:l,onCollapsedChange:u,headerSummary:c}=e,d={collapsible:i,defaultCollapsed:s,collapsed:l,onCollapsedChange:u,headerSummary:c};if(U4(e))return n.jsx(Dn,{className:r,title:a??t("wordTable.filterTitle","\uD45C \uC124\uC815"),sections:e.sections,selected:e.selected,onSelect:e.onSelect,...d,align:"inline"});const{hasImage:m,hasColloquial:p,contentTypes:f,orientation:y,showOutline:x,cutLine:C,showDivLine:h,setters:_,showCutLine:g=!1,showDivLine2:A=!1,middleSections:b=[],extraSelected:k={},onExtraSelect:v,showPaperBands:w=!1,showTopInfo:B=!0,showBottomInfo:E=!0}=e,D=[Qu(t,{hasImage:m,hasColloquial:p}),ec(t),...b,tc(t),...g?[rc(t)]:[],...A?[oc(t)]:[],...w?[nc(t),ac(t)]:[]],N={...uc(t,{contentTypes:f,orientation:y,showOutline:x,cutLine:C,showDivLine:h,showTopInfo:B,showBottomInfo:E}),...k},O=(P,G)=>{cc(t,P,G,_)||v?.(P,G)};return n.jsx(Dn,{className:r,title:a??t("wordTable.filterTitle","\uD45C \uC124\uC815"),sections:D,selected:N,onSelect:O,...d,sectionAlign:"horizontal"})}function Qo(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function G4(e){return Qo(e).replace(/"/g,""").replace(/'/g,"'")}function es(e){return e.replace(/[\\/:*?"<>|]/g,"_").trim()}let br=null,Ca=null;function K4(e,t,a,r="",i=""){if(e.length===0||Ca&&Ca.iframe.isConnected&&Date.now()-Ca.at<1e4)return;const s=r?es(r):"";br?.();let l=null;if(s){const d=document.title;document.title=s,l=()=>{document.title=d,window.removeEventListener("afterprint",l),br===l&&(br=null)},br=l,window.addEventListener("afterprint",l)}const u=document.createElement("iframe");u.style.cssText="position:fixed;left:-10000px;top:0;width:1200px;height:900px;border:0;",document.body.appendChild(u);const c=u.contentDocument;if(!c){u.remove();return}Ca={iframe:u,at:Date.now()},c.open(),c.write(ts(e,t,a,!0,s,i)),c.close(),u.contentWindow?.addEventListener("afterprint",()=>{l?.(),setTimeout(()=>{u.remove(),Ca?.iframe===u&&(Ca=null)},0)})}function ts(e,t,a,r=!1,i="",s=""){i=i?es(i):"";const l=Array.from(document.styleSheets).flatMap(p=>{try{return Array.from(p.cssRules).map(f=>f.cssText)}catch{return[]}}).join(`
|
|
860
860
|
`),u="light",c=(()=>{try{return document.documentElement.lang||""}catch{return""}})(),d=s?`<div class="paper-head">${Qo(s)}</div>`:"",m=e.map(p=>{const f=p.cloneNode(!0);return f.querySelectorAll('[data-play-state="play"]').forEach(y=>y.style.display=""),f.querySelectorAll('[data-play-state="pause"]').forEach(y=>y.style.display="none"),f.querySelectorAll(".word-table-cell__score-slot:not(.word-table-cell__score-slot--on)").forEach(y=>y.remove()),f.querySelectorAll(".word-table-cell__spinner").forEach(y=>y.remove()),f.querySelectorAll("img").forEach(y=>{y.style.opacity==="0"&&(y.setAttribute("onload","this.style.opacity=''"),y.setAttribute("onerror","this.style.visibility='hidden'"))}),`<div class="paper-wrap">${d}${f.outerHTML}</div>`}).join(`
|
|
861
861
|
`);return`<!DOCTYPE html>
|
|
862
|
-
<html${c?` lang="${
|
|
862
|
+
<html${c?` lang="${G4(c)}"`:""} data-theme="${u}">
|
|
863
863
|
<head>
|
|
864
864
|
<meta charset="utf-8">
|
|
865
865
|
${i?`<title>${Qo(i)}</title>`:""}
|
|
@@ -1063,17 +1063,17 @@ ${b.badge}`:b.badge:void 0;if(v&&c(b.code))return null;if(!b.badge&&!m)return p(
|
|
|
1063
1063
|
`:""}
|
|
1064
1064
|
<\/script>
|
|
1065
1065
|
</body>
|
|
1066
|
-
</html>`}const K4=1e3;function ns({getElements:e,paperW:t,paperH:a,fileName:r="",onPopupBlocked:i,header:s=""}){const{t:l}=xe.useTranslation(),u=o.useCallback(()=>{G4(e(),t,a,r,s)},[e,t,a,r,s]),c=o.useCallback(()=>{const m=e();if(m.length===0)return;const p=window.open("","_blank");if(!p){i?.();return}p.document.write(ts(m,t,a,!1,r,s)),p.document.close()},[e,t,a,r,i,s]),d=o.useCallback(()=>{const m=e();if(m.length===0)return;const p=ts(m,t,a,!1,r,s),f=new Blob([p],{type:"text/html;charset=utf-8"}),y=URL.createObjectURL(f),x=(r?es(r):"")||l("wordTable.printFileNameSingle","\uB2E8\uC5B4\uD45C"),C=Object.assign(document.createElement("a"),{href:y,download:`${x}.html`});document.body.appendChild(C),C.click(),document.body.removeChild(C),setTimeout(()=>URL.revokeObjectURL(y),K4)},[e,t,a,r,s,l]);return{print:u,openNewWindow:c,downloadHtml:d}}function dc(e,t){const{t:a}=xe.useTranslation(),r=t?.paperBands===!0,[i,s]=o.useState("landscape"),[l,u]=o.useState(["image","word","standardPron"]),[c,d]=o.useState("show"),[m,p]=o.useState(!0),[f,y]=o.useState(!0),[x,C]=o.useState(!0),[h,_]=o.useState(!0),[g,A]=o.useState(8),[b,k]=o.useState("right"),v=e.length,w=e.some(Z=>(Z.words??[]).length>1),B=e.some(Z=>(Z.words??[]).some(q=>!!q.colloquialLabel)),E=Math.min(g,Math.max(v,1)),D=o.useMemo(()=>Hu(e,E),[e,E]),N=D.length>1,O=E,[P,G]=o.useState(!1);o.useEffect(()=>{let Z=!1;if(!aa()){G(!1);return}return Promise.all(e.flatMap(q=>(q.words??[]).map(z=>wi(z.label,z.homonum)))).then(q=>{Z||G(q.some(Boolean))},()=>{}),()=>{Z=!0}},[e]);const L=o.useMemo(()=>[Qu(a,{hasImage:P,hasColloquial:B}),ec(a),...v>0?[sc(a,{hasPairs:w,itemCount:v})]:[],tc(a),...O>1?[rc(a)]:[],...w?[oc(a)]:[],...r?[nc(a),ac(a)]:[]],[a,P,B,v,w,N,O,r]),M={...uc(a,{contentTypes:l,orientation:i,showOutline:m,cutLine:c,showDivLine:h,showTopInfo:f,showBottomInfo:x}),...v>0?{[a(w?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord")]:`${E}\uAC1C`}:{},...N?{[a("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")]:b}:{}},$=o.useCallback((Z,q)=>{cc(a,Z,q,{setContentTypes:u,setOrientation:s,setShowOutline:p,setCutLine:d,setShowDivLine:_,setShowTopInfo:y,setShowBottomInfo:C})||(q===a("wordTable.filter.itemsPerPagePair","\uD398\uC774\uC9C0\uB2F9 \uB300\uB9BD\uC30D \uC218")||q===a("wordTable.filter.itemsPerPageWord","\uD398\uC774\uC9C0\uB2F9 \uB2E8\uC5B4 \uC218")?A(ic(parseInt(Z),v)):q===a("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")&&k(lc(Z)))},[a,v]);return{settings:{orientation:i,contentTypes:l,cutLine:c,showOutline:m,showDivLine:h,count:O,showTopInfo:f,showBottomInfo:x},filterSections:L,filterSelected:M,handleSelect:$,pages:D,isPaginated:N,pageNumberPosition:b}}function Y4({items:e,words:t,title:a,subtitle:r,emptyText:i,buttons:s,renderButtons:l,renderFooter:u,footerClassName:c,footerLayout:d,printFileName:m,showSettings:p,autoPrint:f,className:y,onClose:x,scoring:C=!1,onScoreChange:h,printHeader:_,brand:g,code:A,beforeClose:b}){const{t:k}=xe.useTranslation(),v=o.useMemo(()=>Array.isArray(e)?e:(Array.isArray(t)?t:[]).filter(oe=>typeof oe=="string"&&oe.length>0).map((oe,Ae)=>({id:`${oe}-${Ae}`,words:[{label:oe}]})),[e,t]),{settings:w,filterSections:B,filterSelected:E,handleSelect:D,pages:N,isPaginated:O,pageNumberPosition:P}=dc(v,{paperBands:!!g?.show}),G=o.useMemo(()=>Wu(N.map(oe=>oe.length)),[N]),[L,M]=o.useState({}),$=o.useCallback((oe,Ae)=>{M(Y=>({...Y,[Cr(oe)]:Fu(Y[Cr(oe)]??null,Ae)}))},[]),Z=o.useRef(h);o.useEffect(()=>{Z.current=h});const q=o.useRef(L);o.useEffect(()=>{q.current!==L&&(q.current=L,Z.current?.(Ko(L)))},[L]);const z=o.useMemo(()=>Ko(L),[L]),V=o.useRef(null),{toastMessage:R,toastKey:H,showWarning:W,clearToast:I}=Ll("warning"),S=o.useRef([]),j=o.useCallback(()=>O?S.current.filter(oe=>oe!==null):V.current?[V.current]:[],[O]),{print:F,openNewWindow:U}=ns({getElements:j,paperW:ha[w.orientation].width,paperH:ha[w.orientation].height,fileName:m??"",header:_??"",onPopupBlocked:()=>W(k("wordTable.popupBlocked","\uD31D\uC5C5\uC774 \uCC28\uB2E8\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uBE0C\uB77C\uC6B0\uC800 \uC124\uC815\uC5D0\uC11C \uD31D\uC5C5\uC744 \uD5C8\uC6A9\uD574 \uC8FC\uC138\uC694."))}),re=o.useMemo(()=>u?void 0:l?l({print:F,openNewWindow:U}):m?[{label:k("wordTable.openNewWindow","\uC0C8 \uCC3D\uC73C\uB85C \uBCF4\uAE30"),variant:"default",onClick:()=>U()},{label:k("wordTable.print","\uC778\uC1C4\uD558\uAE30"),variant:"default",onClick:()=>F()},...s??[]]:s,[u,l,m,s,k,F,U]),ne=o.useMemo(()=>u?u({print:F,openNewWindow:U}):void 0,[u,F,U]),le=o.useRef(!1),K=o.useRef(F);return o.useEffect(()=>{K.current=F},[F]),o.useEffect(()=>{if(!f||le.current)return;const oe=window.setTimeout(()=>{le.current=!0,K.current()},100);return()=>window.clearTimeout(oe)},[f]),n.jsxs(Fn,{title:a??k("keyWords.title","\uC8FC\uC694 \uB2E8\uC5B4"),subtitle:r,size:"large",className:_e("word-table-popup",y),buttons:re,footer:ne,footerClassName:c,footerLayout:d,beforeClose:b,onClose:x,children:[v.length>0?n.jsxs("div",{className:"word-table-popup__body",children:[p&&n.jsx(Jo,{sections:B,selected:E,onSelect:D}),O?n.jsx("div",{className:"word-table-popup__pages",children:N.map((oe,Ae)=>n.jsx(fa,{items:oe,orientation:w.orientation,contentTypes:w.contentTypes,cutLine:w.cutLine,showOutline:w.showOutline,showDivLine:w.showDivLine,count:w.count,contentRef:Y=>{S.current[Ae]=Y},pageNumber:{current:Ae+1,total:N.length},pageNumberPosition:P,brand:g&&{...g,top:w.showTopInfo,bottom:w.showBottomInfo},code:A,scoring:C,scoreIndexOffset:G[Ae],marks:z,onMarkClick:$},Ae))}):n.jsx("div",{className:"word-table-popup__table",children:n.jsx(fa,{items:v,orientation:w.orientation,contentTypes:w.contentTypes,cutLine:w.cutLine,showOutline:w.showOutline,showDivLine:w.showDivLine,count:w.count,contentRef:V,fitHeight:!0,scoring:C,marks:z,onMarkClick:$,brand:g&&{...g,top:w.showTopInfo,bottom:w.showBottomInfo},code:A})})]}):n.jsx("p",{className:"word-table-popup__empty body-3",children:i??k("keyWords.empty","\uCD94\uCD9C\uB41C \uC8FC\uC694 \uB2E8\uC5B4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")}),n.jsx(da,{message:R,position:"top",onClose:I},H)]})}const Z4=new Set(["x","triangle"]);function X4(e,t){const a=[];for(let r=0;r<e.length;r++){const i=t[String(r)];i&&Z4.has(i)&&a.push(e[r])}return a}const J4=/\s*(?:(\d+)차\s*)?복습\s*\d{2}\.\d{2}$/;function pc(e){const t=e.name.trim(),a=e.reviewRound;if(typeof a=="number"&&Number.isFinite(a)&&a>=0){const s=Math.floor(a);if(s===0)return{base:t,round:1};const l=(s===1?/\s*복습\s*\d{2}\.\d{2}$/:new RegExp(`(?:^|\\s)${s}\uCC28\\s*\uBCF5\uC2B5\\s*\\d{2}\\.\\d{2}$`)).exec(t);return{base:l?t.slice(0,l.index).trim():t,round:s+1}}let r=t,i=1;for(;;){const s=J4.exec(r);if(!s)break;i=Math.max(i,(s[1]?Number(s[1]):1)+1),r=r.slice(0,s.index).trim()}return{base:r,round:i}}function Q4(e,t){const[,a,r]=oo(t).split("-"),i=`${a}.${r}`,{base:s,round:l}=pc(typeof e=="string"?{name:e}:e),u=l>=2?`${l}\uCC28 `:"";return`${s||"\uB2E8\uC5B4\uD45C"} ${u}\uBCF5\uC2B5 ${i}`}function ex(e){return{reviewOf:e.reviewOf??e.id??void 0,reviewRound:pc(e).round}}function tx(e,t){const a={};for(const[r,i]of Object.entries(t)){if(i!=="o"&&i!=="triangle"&&i!=="x")continue;const s=Number(r),l=e[s];l&&(a[r]=l)}return a}function nx(e){return e.map(t=>t.label).join(" / ")}function ax(e){return e.map(t=>t.homonum!=null?`${t.label}#${t.homonum}`:t.label).join(" / ")}function mc(e){return e.split(" / ").map(t=>t.replace(/#\d+$/,"")).join(" / ")}function rx(e,t,a){const r=Ri(a);return[e.trim(),r,t.trim()].filter(Boolean).join(" \xB7 ")}function hc(e,t,a){return a===0?0:(e+t*.5)/a}function ox(e){const t=new Map,a=[...e].sort((i,s)=>i.scoredAt.localeCompare(s.scoredAt));for(const i of a)for(const[s,l]of Object.entries(i.marks)){const u=i.labels?.[s];if(!u)continue;const c=t.get(u)??{o:0,triangle:0,x:0,latest:l,latestAt:i.scoredAt};if(l==="o")c.o++;else if(l==="triangle")c.triangle++;else if(l==="x")c.x++;else continue;c.latest=l,c.latestAt=i.scoredAt,t.set(u,c)}const r=[];for(const[i,s]of t){const l=s.o+s.triangle+s.x;r.push({label:mc(i),key:i,tried:l,o:s.o,triangle:s.triangle,x:s.x,rate:hc(s.o,s.triangle,l),latest:s.latest,latestAt:s.latestAt})}return r.sort((i,s)=>i.rate-s.rate||s.tried-i.tried||an(i.label,s.label)||an(i.key??i.label,s.key??s.label)),r}function sx(e){const t=new Map;for(const r of e){const i=r.tableId??`name:${r.tableName}`,s=t.get(i)??{tableName:r.tableName,tableId:r.tableId,rows:[]};s.rows.push(r),t.set(i,s)}const a=[];for(const r of t.values()){const i=u=>Object.values(u.marks).filter(c=>c==="o"||c==="triangle"||c==="x").length,s=r.rows.filter(u=>i(u)>0).sort((u,c)=>u.scoredAt.localeCompare(c.scoredAt));if(s.length===0)continue;const l=s.map(u=>{const c=Object.values(u.marks),d=c.filter(p=>p==="o").length,m=c.filter(p=>p==="triangle").length;return hc(d,m,i(u))});a.push({tableName:r.tableName,tableId:r.tableId,rates:l,times:s.map(u=>u.scoredAt),delta:l.length>=2?l[l.length-1]-l[0]:null})}return a.sort((r,i)=>(i.times[i.times.length-1]??"").localeCompare(r.times[r.times.length-1]??"")),a}function ix(e,t=8){return e.filter(a=>a.latest!=="o").slice(0,t)}function lx(e,t){if(e==null||t==null||e===""||t==="")return 0;if(typeof e=="number"&&typeof t=="number")return e-t;const a=String(e),r=String(t);return+(a>r)-+(a<r)}function ux(e){const t=new Map;let a=0,r=0;const i=e.map((l,u)=>({r:l,at:u})).sort((l,u)=>l.r.answeredAt.localeCompare(u.r.answeredAt)||lx(l.r.id,u.r.id)||l.at-u.at).map(l=>l.r);for(const l of i){if(l.isCorrect==null)continue;const u=l.itemTitle?.trim();if(!u){r++;continue}a++;const c=l.itemId?.trim()||u,d=`${l.trainingType}|${c}`,m=t.get(d)??{trainingType:l.trainingType,itemId:c,title:u,tried:0,wrong:0,latestCorrect:l.isCorrect,latestAt:l.answeredAt,lastSelected:l.selected,setIds:[]};if(m.tried++,l.isCorrect||m.wrong++,m.title=u,m.latestCorrect=l.isCorrect,m.latestAt=l.answeredAt,m.lastSelected=l.selected,l.setId){const p=m.setIds.indexOf(l.setId);p>0&&m.setIds.splice(p,1),p!==0&&m.setIds.unshift(l.setId)}t.set(d,m)}const s=[...t.entries()].map(([l,u])=>({key:l,trainingType:u.trainingType,itemId:u.itemId,title:u.title,tried:u.tried,wrong:u.wrong,rate:u.tried===0?0:(u.tried-u.wrong)/u.tried,latestCorrect:u.latestCorrect,latestAt:u.latestAt,lastSelected:u.lastSelected,setIds:u.setIds}));return s.sort((l,u)=>l.rate-u.rate||u.tried-l.tried||an(l.title,u.title)),{items:s,counted:a,skippedNoTitle:r}}function cx(e,t=8){return e.filter(a=>!a.latestCorrect).slice(0,t)}function dx(e){const t=new Map;for(const r of e){const i=t.get(r.trainingType)??[];i.push(r),t.set(r.trainingType,i)}const a=[...t.entries()].map(([r,i])=>({trainingType:r,items:i,pending:i.filter(s=>!s.latestCorrect).length}));return a.sort((r,i)=>i.pending-r.pending||r.trainingType.localeCompare(i.trainingType)),a}const as=["LISTEN_IN_NOISE","SHORT_STORY","LONG_STORY","ORDERING_SENTENCE"];function px(e){const t=new Map;let a=0;for(const s of e){if(s.latestCorrect)continue;const l=s.setIds[0];if(!l){a++;continue}const u=`${s.trainingType}|${l}`,c=t.get(u)??{setId:l,trainingType:s.trainingType,pending:0};c.pending++,t.set(u,c)}const r=(s,l)=>l.pending-s.pending||s.trainingType.localeCompare(l.trainingType)||s.setId.localeCompare(l.setId),i=[...t.values()];return{sentence:i.filter(s=>as.includes(s.trainingType)).sort(r),word:i.filter(s=>!as.includes(s.trainingType)).sort(r),noSet:a}}function mx(e,t,a=5){const r=new Set(t);if(r.size===0)return[];const i=[];for(const s of e){const l=new Set,u=[];for(const c of s.cellLabels)r.has(c)&&!l.has(c)&&(l.add(c),u.push(c));u.length!==0&&i.push({id:s.id,name:s.name,kind:s.kind,covered:u,totalCells:s.cellLabels.length})}return i.sort((s,l)=>l.covered.length-s.covered.length||s.totalCells-l.totalCells||an(s.name,l.name)),i.slice(0,Math.max(0,a))}function hx(e,t){const a=new Set(e.flatMap(r=>r.covered));return t.filter(r=>!a.has(r))}function fx(e,t){const a=new Map;for(const i of e)for(const s of i.cells){const l=i.labelOf(s);a.has(l)||a.set(l,s)}const r=[];for(const i of t){const s=a.get(i);s!==void 0&&r.push(s)}return r}function rs(e,t,a){return typeof e=="string"&&e?e:t.replace(/\{\{(\w+)\}\}/g,(r,i)=>String(a[i]))}function Cx(e,t){const a=Number.isFinite(e)?Math.round(e):0;if(!a||a<=0)return"-";const r=Math.floor(a/60),i=a%60;return t?t(r,i):r>0&&i>0?rs(Rt.t("customers.duration.minSec",{m:r,s:i,defaultValue:"{{m}}\uBD84 {{s}}\uCD08"}),"{{m}}\uBD84 {{s}}\uCD08",{m:r,s:i}):r>0?rs(Rt.t("customers.duration.min",{m:r,defaultValue:"{{m}}\uBD84"}),"{{m}}\uBD84",{m:r}):rs(Rt.t("customers.duration.sec",{s:i,defaultValue:"{{s}}\uCD08"}),"{{s}}\uCD08",{s:i})}function gx(e,t){const a=[],r=new Set;for(const i of e){const s=t(i);r.has(s)||(r.add(s),a.push({key:s,value:i,pinned:!1}))}return a}function bx(e,t){return e.map(a=>a.key===t?{...a,pinned:!a.pinned}:a)}function yx(e,t){return e.filter(a=>a.key!==t)}function vx(e,t,a){const r=e.filter(d=>d.pinned),i=new Set(r.map(d=>d.key)),s=e.length-r.length,l=[],u=new Set(i);for(const d of t){if(l.length>=s)break;const m=a(d);u.has(m)||(u.add(m),l.push({key:m,value:d,pinned:!1}))}const c=[...l];return e.map(d=>d.pinned?d:c.shift()).filter(d=>d!==void 0)}function xx(e){return e.map(t=>t.value)}function _x(e){const{category:t={},isSelected:a=!1,onClick:r}=e||{},i=t?.key?` icon-grid-menu__button--${t.key}`:"",s=o.useId();return n.jsxs("div",{className:`icon-grid-menu__button-wrapper${i}`,children:[n.jsx("button",{className:`icon-grid-menu__button${a?" icon-grid-menu__button--selected":""}`,"data-key":t?.key,type:"button",onClick:a?void 0:r,"aria-pressed":a,"aria-labelledby":s,children:n.jsx(at,{icon:t.icon,label:t.label,className:"icon-grid-menu__button-icon",imgClassName:"icon-grid-menu__button-icon-image",maskClassName:"icon-grid-menu__button-icon-mask",svgClassName:"icon-grid-menu__button-icon-svg"})}),n.jsx("span",{id:s,className:"icon-grid-menu__button-label button-1",children:t.label})]})}function wx(e){const{categories:t=[],selected:a,onSelect:r,size:i="medium"}=e||{},s=a!==void 0,[l,u]=o.useState(()=>s?null:(t&&t[0]?.key)??null),c=s?a:l,d=o.useRef(r);o.useEffect(()=>{d.current=r});const m=o.useRef(!1),p=(t&&t[0]?.key)??null;o.useEffect(()=>{if(s||m.current||!p)return;m.current=!0;const y=l??p;l==null&&u(y),d.current?.(y)},[s,p]);const f=o.useCallback(y=>{const x=c===y?null:y;m.current=!0,s||u(x),r?.(x)},[c,s,r]);return n.jsx("div",{className:`icon-grid-menu icon-grid-menu--${i}`,children:(t||[]).map(y=>n.jsx(_x,{category:y,isSelected:c===y.key,onClick:()=>f(y.key)},y.key))})}function Bx({subs:e=[],selected:t,onSelect:a,size:r="medium"}){const i=r==="small"?32:40;return n.jsx("div",{className:`choice-chips choice-chips--${r}`,children:n.jsx("div",{className:"choice-chips__list",children:e.map(s=>n.jsx(pe,{htmlType:"button",size:i,type:"bar",label:s.label,selected:t===s.key,className:"choice-chips__button",onClick:()=>a?.(s.key)},s.key))})})}function kx({onTermsClick:e,onPrivacyClick:t,contact:a}={}){const r=a?.email??"support@ihab.co.kr",i=a?.tel??"031-380-3724",{t:s}=xe.useTranslation();return n.jsx("footer",{className:"site-footer",children:n.jsxs("div",{className:"safearea",children:[n.jsxs("div",{className:"site-footer__top",children:[n.jsx("div",{className:"site-footer__brand",children:n.jsx("div",{className:"site-footer__lead h3",children:s("footer.lead",`\uC544\uC774\uD574\uBE0C\uB294 \uC18C\uB9AC\uB97C \uD1B5\uD574
|
|
1066
|
+
</html>`}const Y4=1e3;function ns({getElements:e,paperW:t,paperH:a,fileName:r="",onPopupBlocked:i,header:s=""}){const{t:l}=xe.useTranslation(),u=o.useCallback(()=>{K4(e(),t,a,r,s)},[e,t,a,r,s]),c=o.useCallback(()=>{const m=e();if(m.length===0)return;const p=window.open("","_blank");if(!p){i?.();return}p.document.write(ts(m,t,a,!1,r,s)),p.document.close()},[e,t,a,r,i,s]),d=o.useCallback(()=>{const m=e();if(m.length===0)return;const p=ts(m,t,a,!1,r,s),f=new Blob([p],{type:"text/html;charset=utf-8"}),y=URL.createObjectURL(f),x=(r?es(r):"")||l("wordTable.printFileNameSingle","\uB2E8\uC5B4\uD45C"),C=Object.assign(document.createElement("a"),{href:y,download:`${x}.html`});document.body.appendChild(C),C.click(),document.body.removeChild(C),setTimeout(()=>URL.revokeObjectURL(y),Y4)},[e,t,a,r,s,l]);return{print:u,openNewWindow:c,downloadHtml:d}}function dc(e,t){const{t:a}=xe.useTranslation(),r=t?.paperBands===!0,[i,s]=o.useState("landscape"),[l,u]=o.useState(["image","word","standardPron"]),[c,d]=o.useState("show"),[m,p]=o.useState(!0),[f,y]=o.useState(!0),[x,C]=o.useState(!0),[h,_]=o.useState(!0),[g,A]=o.useState(8),[b,k]=o.useState("right"),v=e.length,w=e.some(Z=>(Z.words??[]).length>1),B=e.some(Z=>(Z.words??[]).some(q=>!!q.colloquialLabel)),E=Math.min(g,Math.max(v,1)),D=o.useMemo(()=>Hu(e,E),[e,E]),N=D.length>1,O=E,[P,G]=o.useState(!1);o.useEffect(()=>{let Z=!1;if(!aa()){G(!1);return}return Promise.all(e.flatMap(q=>(q.words??[]).map(z=>wi(z.label,z.homonum)))).then(q=>{Z||G(q.some(Boolean))},()=>{}),()=>{Z=!0}},[e]);const L=o.useMemo(()=>[Qu(a,{hasImage:P,hasColloquial:B}),ec(a),...v>0?[sc(a,{hasPairs:w,itemCount:v})]:[],tc(a),...O>1?[rc(a)]:[],...w?[oc(a)]:[],...r?[nc(a),ac(a)]:[]],[a,P,B,v,w,N,O,r]),M={...uc(a,{contentTypes:l,orientation:i,showOutline:m,cutLine:c,showDivLine:h,showTopInfo:f,showBottomInfo:x}),...v>0?{[a(w?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord")]:`${E}\uAC1C`}:{},...N?{[a("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")]:b}:{}},$=o.useCallback((Z,q)=>{cc(a,Z,q,{setContentTypes:u,setOrientation:s,setShowOutline:p,setCutLine:d,setShowDivLine:_,setShowTopInfo:y,setShowBottomInfo:C})||(q===a("wordTable.filter.itemsPerPagePair","\uD398\uC774\uC9C0\uB2F9 \uB300\uB9BD\uC30D \uC218")||q===a("wordTable.filter.itemsPerPageWord","\uD398\uC774\uC9C0\uB2F9 \uB2E8\uC5B4 \uC218")?A(ic(parseInt(Z),v)):q===a("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")&&k(lc(Z)))},[a,v]);return{settings:{orientation:i,contentTypes:l,cutLine:c,showOutline:m,showDivLine:h,count:O,showTopInfo:f,showBottomInfo:x},filterSections:L,filterSelected:M,handleSelect:$,pages:D,isPaginated:N,pageNumberPosition:b}}function Z4({items:e,words:t,title:a,subtitle:r,emptyText:i,buttons:s,renderButtons:l,renderFooter:u,footerClassName:c,footerLayout:d,printFileName:m,showSettings:p,autoPrint:f,className:y,onClose:x,scoring:C=!1,onScoreChange:h,printHeader:_,brand:g,code:A,beforeClose:b}){const{t:k}=xe.useTranslation(),v=o.useMemo(()=>Array.isArray(e)?e:(Array.isArray(t)?t:[]).filter(oe=>typeof oe=="string"&&oe.length>0).map((oe,Ae)=>({id:`${oe}-${Ae}`,words:[{label:oe}]})),[e,t]),{settings:w,filterSections:B,filterSelected:E,handleSelect:D,pages:N,isPaginated:O,pageNumberPosition:P}=dc(v,{paperBands:!!g?.show}),G=o.useMemo(()=>Wu(N.map(oe=>oe.length)),[N]),[L,M]=o.useState({}),$=o.useCallback((oe,Ae)=>{M(Y=>({...Y,[Cr(oe)]:Fu(Y[Cr(oe)]??null,Ae)}))},[]),Z=o.useRef(h);o.useEffect(()=>{Z.current=h});const q=o.useRef(L);o.useEffect(()=>{q.current!==L&&(q.current=L,Z.current?.(Ko(L)))},[L]);const z=o.useMemo(()=>Ko(L),[L]),V=o.useRef(null),{toastMessage:R,toastKey:H,showWarning:W,clearToast:I}=Ll("warning"),S=o.useRef([]),j=o.useCallback(()=>O?S.current.filter(oe=>oe!==null):V.current?[V.current]:[],[O]),{print:F,openNewWindow:U}=ns({getElements:j,paperW:ha[w.orientation].width,paperH:ha[w.orientation].height,fileName:m??"",header:_??"",onPopupBlocked:()=>W(k("wordTable.popupBlocked","\uD31D\uC5C5\uC774 \uCC28\uB2E8\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uBE0C\uB77C\uC6B0\uC800 \uC124\uC815\uC5D0\uC11C \uD31D\uC5C5\uC744 \uD5C8\uC6A9\uD574 \uC8FC\uC138\uC694."))}),re=o.useMemo(()=>u?void 0:l?l({print:F,openNewWindow:U}):m?[{label:k("wordTable.openNewWindow","\uC0C8 \uCC3D\uC73C\uB85C \uBCF4\uAE30"),variant:"default",onClick:()=>U()},{label:k("wordTable.print","\uC778\uC1C4\uD558\uAE30"),variant:"default",onClick:()=>F()},...s??[]]:s,[u,l,m,s,k,F,U]),ne=o.useMemo(()=>u?u({print:F,openNewWindow:U}):void 0,[u,F,U]),le=o.useRef(!1),K=o.useRef(F);return o.useEffect(()=>{K.current=F},[F]),o.useEffect(()=>{if(!f||le.current)return;const oe=window.setTimeout(()=>{le.current=!0,K.current()},100);return()=>window.clearTimeout(oe)},[f]),n.jsxs(Fn,{title:a??k("keyWords.title","\uC8FC\uC694 \uB2E8\uC5B4"),subtitle:r,size:"large",className:_e("word-table-popup",y),buttons:re,footer:ne,footerClassName:c,footerLayout:d,beforeClose:b,onClose:x,children:[v.length>0?n.jsxs("div",{className:"word-table-popup__body",children:[p&&n.jsx(Jo,{sections:B,selected:E,onSelect:D}),O?n.jsx("div",{className:"word-table-popup__pages",children:N.map((oe,Ae)=>n.jsx(fa,{items:oe,orientation:w.orientation,contentTypes:w.contentTypes,cutLine:w.cutLine,showOutline:w.showOutline,showDivLine:w.showDivLine,count:w.count,contentRef:Y=>{S.current[Ae]=Y},pageNumber:{current:Ae+1,total:N.length},pageNumberPosition:P,brand:g&&{...g,top:w.showTopInfo,bottom:w.showBottomInfo},code:A,scoring:C,scoreIndexOffset:G[Ae],marks:z,onMarkClick:$},Ae))}):n.jsx("div",{className:"word-table-popup__table",children:n.jsx(fa,{items:v,orientation:w.orientation,contentTypes:w.contentTypes,cutLine:w.cutLine,showOutline:w.showOutline,showDivLine:w.showDivLine,count:w.count,contentRef:V,fitHeight:!0,scoring:C,marks:z,onMarkClick:$,brand:g&&{...g,top:w.showTopInfo,bottom:w.showBottomInfo},code:A})})]}):n.jsx("p",{className:"word-table-popup__empty body-3",children:i??k("keyWords.empty","\uCD94\uCD9C\uB41C \uC8FC\uC694 \uB2E8\uC5B4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")}),n.jsx(da,{message:R,position:"top",onClose:I},H)]})}const X4=new Set(["x","triangle"]);function J4(e,t){const a=[];for(let r=0;r<e.length;r++){const i=t[String(r)];i&&X4.has(i)&&a.push(e[r])}return a}const Q4=/\s*(?:(\d+)차\s*)?복습\s*\d{2}\.\d{2}$/;function pc(e){const t=e.name.trim(),a=e.reviewRound;if(typeof a=="number"&&Number.isFinite(a)&&a>=0){const s=Math.floor(a);if(s===0)return{base:t,round:1};const l=(s===1?/\s*복습\s*\d{2}\.\d{2}$/:new RegExp(`(?:^|\\s)${s}\uCC28\\s*\uBCF5\uC2B5\\s*\\d{2}\\.\\d{2}$`)).exec(t);return{base:l?t.slice(0,l.index).trim():t,round:s+1}}let r=t,i=1;for(;;){const s=Q4.exec(r);if(!s)break;i=Math.max(i,(s[1]?Number(s[1]):1)+1),r=r.slice(0,s.index).trim()}return{base:r,round:i}}function ex(e,t){const[,a,r]=oo(t).split("-"),i=`${a}.${r}`,{base:s,round:l}=pc(typeof e=="string"?{name:e}:e),u=l>=2?`${l}\uCC28 `:"";return`${s||"\uB2E8\uC5B4\uD45C"} ${u}\uBCF5\uC2B5 ${i}`}function tx(e){return{reviewOf:e.reviewOf??e.id??void 0,reviewRound:pc(e).round}}function nx(e,t){const a={};for(const[r,i]of Object.entries(t)){if(i!=="o"&&i!=="triangle"&&i!=="x")continue;const s=Number(r),l=e[s];l&&(a[r]=l)}return a}function ax(e){return e.map(t=>t.label).join(" / ")}function rx(e){return e.map(t=>t.homonum!=null?`${t.label}#${t.homonum}`:t.label).join(" / ")}function mc(e){return e.split(" / ").map(t=>t.replace(/#\d+$/,"")).join(" / ")}function ox(e,t,a){const r=Ri(a);return[e.trim(),r,t.trim()].filter(Boolean).join(" \xB7 ")}function hc(e,t,a){return a===0?0:(e+t*.5)/a}function sx(e){const t=new Map,a=[...e].sort((i,s)=>i.scoredAt.localeCompare(s.scoredAt));for(const i of a)for(const[s,l]of Object.entries(i.marks)){const u=i.labels?.[s];if(!u)continue;const c=t.get(u)??{o:0,triangle:0,x:0,latest:l,latestAt:i.scoredAt};if(l==="o")c.o++;else if(l==="triangle")c.triangle++;else if(l==="x")c.x++;else continue;c.latest=l,c.latestAt=i.scoredAt,t.set(u,c)}const r=[];for(const[i,s]of t){const l=s.o+s.triangle+s.x;r.push({label:mc(i),key:i,tried:l,o:s.o,triangle:s.triangle,x:s.x,rate:hc(s.o,s.triangle,l),latest:s.latest,latestAt:s.latestAt})}return r.sort((i,s)=>i.rate-s.rate||s.tried-i.tried||an(i.label,s.label)||an(i.key??i.label,s.key??s.label)),r}function ix(e){const t=new Map;for(const r of e){const i=r.tableId??`name:${r.tableName}`,s=t.get(i)??{tableName:r.tableName,tableId:r.tableId,rows:[]};s.rows.push(r),t.set(i,s)}const a=[];for(const r of t.values()){const i=u=>Object.values(u.marks).filter(c=>c==="o"||c==="triangle"||c==="x").length,s=r.rows.filter(u=>i(u)>0).sort((u,c)=>u.scoredAt.localeCompare(c.scoredAt));if(s.length===0)continue;const l=s.map(u=>{const c=Object.values(u.marks),d=c.filter(p=>p==="o").length,m=c.filter(p=>p==="triangle").length;return hc(d,m,i(u))});a.push({tableName:r.tableName,tableId:r.tableId,rates:l,times:s.map(u=>u.scoredAt),delta:l.length>=2?l[l.length-1]-l[0]:null})}return a.sort((r,i)=>(i.times[i.times.length-1]??"").localeCompare(r.times[r.times.length-1]??"")),a}function lx(e,t=8){return e.filter(a=>a.latest!=="o").slice(0,t)}function ux(e,t){if(e==null||t==null||e===""||t==="")return 0;if(typeof e=="number"&&typeof t=="number")return e-t;const a=String(e),r=String(t);return+(a>r)-+(a<r)}function cx(e){const t=new Map;let a=0,r=0;const i=e.map((l,u)=>({r:l,at:u})).sort((l,u)=>l.r.answeredAt.localeCompare(u.r.answeredAt)||ux(l.r.id,u.r.id)||l.at-u.at).map(l=>l.r);for(const l of i){if(l.isCorrect==null)continue;const u=l.itemTitle?.trim();if(!u){r++;continue}a++;const c=l.itemId?.trim()||u,d=`${l.trainingType}|${c}`,m=t.get(d)??{trainingType:l.trainingType,itemId:c,title:u,tried:0,wrong:0,latestCorrect:l.isCorrect,latestAt:l.answeredAt,lastSelected:l.selected,setIds:[]};if(m.tried++,l.isCorrect||m.wrong++,m.title=u,m.latestCorrect=l.isCorrect,m.latestAt=l.answeredAt,m.lastSelected=l.selected,l.setId){const p=m.setIds.indexOf(l.setId);p>0&&m.setIds.splice(p,1),p!==0&&m.setIds.unshift(l.setId)}t.set(d,m)}const s=[...t.entries()].map(([l,u])=>({key:l,trainingType:u.trainingType,itemId:u.itemId,title:u.title,tried:u.tried,wrong:u.wrong,rate:u.tried===0?0:(u.tried-u.wrong)/u.tried,latestCorrect:u.latestCorrect,latestAt:u.latestAt,lastSelected:u.lastSelected,setIds:u.setIds}));return s.sort((l,u)=>l.rate-u.rate||u.tried-l.tried||an(l.title,u.title)),{items:s,counted:a,skippedNoTitle:r}}function dx(e,t=8){return e.filter(a=>!a.latestCorrect).slice(0,t)}function px(e){const t=new Map;for(const r of e){const i=t.get(r.trainingType)??[];i.push(r),t.set(r.trainingType,i)}const a=[...t.entries()].map(([r,i])=>({trainingType:r,items:i,pending:i.filter(s=>!s.latestCorrect).length}));return a.sort((r,i)=>i.pending-r.pending||r.trainingType.localeCompare(i.trainingType)),a}const as=["LISTEN_IN_NOISE","SHORT_STORY","LONG_STORY","ORDERING_SENTENCE"];function mx(e){const t=new Map;let a=0;for(const s of e){if(s.latestCorrect)continue;const l=s.setIds[0];if(!l){a++;continue}const u=`${s.trainingType}|${l}`,c=t.get(u)??{setId:l,trainingType:s.trainingType,pending:0};c.pending++,t.set(u,c)}const r=(s,l)=>l.pending-s.pending||s.trainingType.localeCompare(l.trainingType)||s.setId.localeCompare(l.setId),i=[...t.values()];return{sentence:i.filter(s=>as.includes(s.trainingType)).sort(r),word:i.filter(s=>!as.includes(s.trainingType)).sort(r),noSet:a}}function hx(e,t,a=5){const r=new Set(t);if(r.size===0)return[];const i=[];for(const s of e){const l=new Set,u=[];for(const c of s.cellLabels)r.has(c)&&!l.has(c)&&(l.add(c),u.push(c));u.length!==0&&i.push({id:s.id,name:s.name,kind:s.kind,covered:u,totalCells:s.cellLabels.length})}return i.sort((s,l)=>l.covered.length-s.covered.length||s.totalCells-l.totalCells||an(s.name,l.name)),i.slice(0,Math.max(0,a))}function fx(e,t){const a=new Set(e.flatMap(r=>r.covered));return t.filter(r=>!a.has(r))}function Cx(e,t){const a=new Map;for(const i of e)for(const s of i.cells){const l=i.labelOf(s);a.has(l)||a.set(l,s)}const r=[];for(const i of t){const s=a.get(i);s!==void 0&&r.push(s)}return r}function rs(e,t,a){return typeof e=="string"&&e?e:t.replace(/\{\{(\w+)\}\}/g,(r,i)=>String(a[i]))}function gx(e,t){const a=Number.isFinite(e)?Math.round(e):0;if(!a||a<=0)return"-";const r=Math.floor(a/60),i=a%60;return t?t(r,i):r>0&&i>0?rs(Rt.t("customers.duration.minSec",{m:r,s:i,defaultValue:"{{m}}\uBD84 {{s}}\uCD08"}),"{{m}}\uBD84 {{s}}\uCD08",{m:r,s:i}):r>0?rs(Rt.t("customers.duration.min",{m:r,defaultValue:"{{m}}\uBD84"}),"{{m}}\uBD84",{m:r}):rs(Rt.t("customers.duration.sec",{s:i,defaultValue:"{{s}}\uCD08"}),"{{s}}\uCD08",{s:i})}function bx(e,t){const a=[],r=new Set;for(const i of e){const s=t(i);r.has(s)||(r.add(s),a.push({key:s,value:i,pinned:!1}))}return a}function yx(e,t){return e.map(a=>a.key===t?{...a,pinned:!a.pinned}:a)}function vx(e,t){return e.filter(a=>a.key!==t)}function xx(e,t,a){const r=e.filter(d=>d.pinned),i=new Set(r.map(d=>d.key)),s=e.length-r.length,l=[],u=new Set(i);for(const d of t){if(l.length>=s)break;const m=a(d);u.has(m)||(u.add(m),l.push({key:m,value:d,pinned:!1}))}const c=[...l];return e.map(d=>d.pinned?d:c.shift()).filter(d=>d!==void 0)}function _x(e){return e.map(t=>t.value)}function wx(e){const{category:t={},isSelected:a=!1,onClick:r}=e||{},i=t?.key?` icon-grid-menu__button--${t.key}`:"",s=o.useId();return n.jsxs("div",{className:`icon-grid-menu__button-wrapper${i}`,children:[n.jsx("button",{className:`icon-grid-menu__button${a?" icon-grid-menu__button--selected":""}`,"data-key":t?.key,type:"button",onClick:a?void 0:r,"aria-pressed":a,"aria-labelledby":s,children:n.jsx(at,{icon:t.icon,label:t.label,className:"icon-grid-menu__button-icon",imgClassName:"icon-grid-menu__button-icon-image",maskClassName:"icon-grid-menu__button-icon-mask",svgClassName:"icon-grid-menu__button-icon-svg"})}),n.jsx("span",{id:s,className:"icon-grid-menu__button-label button-1",children:t.label})]})}function Bx(e){const{categories:t=[],selected:a,onSelect:r,size:i="medium"}=e||{},s=a!==void 0,[l,u]=o.useState(()=>s?null:(t&&t[0]?.key)??null),c=s?a:l,d=o.useRef(r);o.useEffect(()=>{d.current=r});const m=o.useRef(!1),p=(t&&t[0]?.key)??null;o.useEffect(()=>{if(s||m.current||!p)return;m.current=!0;const y=l??p;l==null&&u(y),d.current?.(y)},[s,p]);const f=o.useCallback(y=>{const x=c===y?null:y;m.current=!0,s||u(x),r?.(x)},[c,s,r]);return n.jsx("div",{className:`icon-grid-menu icon-grid-menu--${i}`,children:(t||[]).map(y=>n.jsx(wx,{category:y,isSelected:c===y.key,onClick:()=>f(y.key)},y.key))})}function kx({subs:e=[],selected:t,onSelect:a,size:r="medium"}){const i=r==="small"?32:40;return n.jsx("div",{className:`choice-chips choice-chips--${r}`,children:n.jsx("div",{className:"choice-chips__list",children:e.map(s=>n.jsx(pe,{htmlType:"button",size:i,type:"bar",label:s.label,selected:t===s.key,className:"choice-chips__button",onClick:()=>a?.(s.key)},s.key))})})}function Ax({onTermsClick:e,onPrivacyClick:t,contact:a}={}){const r=a?.email??"support@ihab.co.kr",i=a?.tel??"031-380-3724",{t:s}=xe.useTranslation();return n.jsx("footer",{className:"site-footer",children:n.jsxs("div",{className:"safearea",children:[n.jsxs("div",{className:"site-footer__top",children:[n.jsx("div",{className:"site-footer__brand",children:n.jsx("div",{className:"site-footer__lead h3",children:s("footer.lead",`\uC544\uC774\uD574\uBE0C\uB294 \uC18C\uB9AC\uB97C \uD1B5\uD574
|
|
1067
1067
|
\uC2E0\uB8B0\uB97C \uC313\uACE0
|
|
1068
1068
|
\uD68C\uBCF5\uC744 \uB3D5\uC2B5\uB2C8\uB2E4.`).split(`
|
|
1069
|
-
`).map((l,u,c)=>n.jsxs(o.Fragment,{children:[l,u<c.length-1&&n.jsx("br",{})]},u))})}),n.jsxs("div",{className:"site-footer__links",children:[n.jsxs("div",{className:"site-footer__column",children:[n.jsx("div",{className:"site-footer__column-title footer-title",children:s("footer.site.title","\uC0AC\uC774\uD2B8")}),n.jsxs("ul",{children:[n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://www.ihab.co.kr/",target:"_blank",rel:"noopener noreferrer",children:"IHAB"})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://speechear.ihab.co.kr/",target:"_blank",rel:"noopener noreferrer",children:s("footer.site.malgwi","\uB9D0\uADC0")})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://ihab-offcial-web.vercel.app/product/sound-localization",target:"_blank",rel:"noopener noreferrer",children:s("footer.site.soundDirection","\uC18C\uB9AC\uBC29\uD5A5\uC131\uC2DC\uC2A4\uD15C")})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://ihab-offcial-web.vercel.app/product/vr-sound-localization",target:"_blank",rel:"noopener noreferrer",children:s("footer.site.vrSoundDirection","VR\uC18C\uB9AC\uBC29\uD5A5\uC131\uC2DC\uC2A4\uD15C")})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://ihab-offcial-web.vercel.app/product/hearing-test-pro",target:"_blank",rel:"noopener noreferrer",children:s("footer.site.hearingTest","\uCCAD\uB825\uD14C\uC2A4\uD2B8 \uD504\uB85C")})})]})]}),n.jsxs("div",{className:"site-footer__column",children:[n.jsx("div",{className:"site-footer__column-title footer-title",children:s("footer.sns.title","SNS")}),n.jsxs("ul",{children:[n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://blog.naver.com/ihab_official",target:"_blank",rel:"noopener noreferrer",children:s("footer.sns.naverBlog","\uB124\uC774\uBC84 \uBE14\uB85C\uADF8")})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://www.instagram.com/ihab.official.yt/",target:"_blank",rel:"noopener noreferrer",children:"Instagram"})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://www.youtube.com/@%EC%95%84%EC%9D%B4%ED%95%B4%EB%B8%8C-%EA%B3%B5%EC%8B%9D%EC%B1%84%EB%84%90",target:"_blank",rel:"noopener noreferrer",children:"Youtube"})})]})]}),n.jsxs("div",{className:"site-footer__column",children:[n.jsx("div",{className:"site-footer__column-title footer-title",children:s("footer.policy.title","\uC815\uCC45")}),n.jsxs("ul",{children:[n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"#",onClick:l=>{e&&(l.preventDefault(),e())},children:s("footer.policy.terms","\uC774\uC6A9\uC57D\uAD00")})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"#",onClick:l=>{t&&(l.preventDefault(),t())},children:s("footer.policy.privacy","\uAC1C\uC778\uC815\uBCF4 \uCC98\uB9AC\uBC29\uCE68")})})]})]})]})]}),n.jsx("hr",{className:"site-footer__rule"}),n.jsxs("div",{className:"site-footer__bottom",children:[n.jsx("div",{className:"site-footer__brand",children:n.jsx("img",{src:Eo,alt:"IHAB",className:"site-footer__logo"})}),n.jsxs("div",{className:"site-footer__meta",children:[n.jsxs("div",{children:[n.jsx("span",{className:"footer-title",children:s("footer.ceo","\uB300\uD45C")})," ",n.jsx("span",{className:"footer-meta caption-1",children:s("footer.ceoName","\uD55C\uC9C0\uD61C")})]}),n.jsxs("div",{children:[n.jsx("span",{className:"footer-title",children:s("footer.address","\uC8FC\uC18C")})," ",n.jsx("span",{className:"footer-meta caption-1",children:s("footer.addressValue","\uAC15\uC6D0\uB3C4 \uCD98\uCC9C\uC2DC \uC2DC\uCCAD\uAE38 32 \uD574\uCC2C\uBE4C\uB529 3\uCE35 302\uD638")})]}),n.jsxs("div",{children:[n.jsx("span",{className:"footer-title",children:s("footer.support","\uACE0\uAC1D\uC13C\uD130")})," ",n.jsxs("span",{className:"footer-meta caption-1",children:[r," \xA0 ",i]})]})]})]}),n.jsx("div",{className:"site-footer__copyright footer-copyright caption-1",children:"\xA9 IHAB, Inc. All rights reserved."})]})})}function Ax({logo:e,logoAlt:t="",logoHref:a,links:r=[],actions:i,className:s,containerClassName:l,renderLink:u,menuLabel:c}){const{t:d}=xe.useTranslation(),m=c??{open:d("header.menuOpen","\uBA54\uB274 \uC5F4\uAE30"),close:d("header.menuClose","\uBA54\uB274 \uB2EB\uAE30")},[p,f]=o.useState(!1),y=o.useId(),x=o.useRef(null);o.useEffect(()=>{if(!p)return;const _=Gn(()=>{const b=document.getElementById(y);b&&b.contains(document.activeElement)&&x.current?.focus(),f(!1)}),g=typeof window<"u"&&window.matchMedia?window.matchMedia("(min-width: 961px)"):null,A=b=>{b.matches&&f(!1)};return g&&(g.matches&&f(!1),g.addEventListener?.("change",A)),()=>{_(),g?.removeEventListener?.("change",A)}},[p,y]);const C=l?`${l} landing-header__inner`:"landing-header__inner",h=(_,g)=>u?u(_,{onClick:g}):n.jsx("a",{href:_.href,onClick:g,"aria-current":_.current?"page":void 0,children:_.label});return n.jsxs("header",{className:s?`landing-header ${s}`:"landing-header",children:[n.jsxs("div",{className:C,children:[e!=null&&(()=>{const _=typeof e=="string"?n.jsx("img",{src:e,alt:t,className:"landing-header__logo"}):e;return a?n.jsx("a",{href:a,className:"landing-header__brand",children:_}):n.jsx("div",{className:"landing-header__brand",children:_})})(),r.length>0&&n.jsx("nav",{className:"landing-header__links",children:r.map((_,g)=>n.jsx("span",{children:h(_)},`${g}:${_.href}`))}),n.jsxs("div",{className:"landing-header__actions",children:[i,r.length>0&&n.jsx("button",{ref:x,type:"button",onClick:()=>f(_=>!_),"aria-expanded":p,"aria-controls":y,"aria-label":p?m.close:m.open,className:p?"landing-header__toggle landing-header__toggle--open":"landing-header__toggle",children:n.jsxs("span",{className:"landing-header__burger",children:[n.jsx("span",{}),n.jsx("span",{}),n.jsx("span",{})]})})]})]}),r.length>0&&n.jsx("nav",{id:y,hidden:!p,className:"landing-header__drawer",children:n.jsx("div",{className:l??void 0,children:r.map((_,g)=>n.jsx("span",{className:"landing-header__drawer-item",children:h(_,()=>f(!1))},`${g}:${_.href}`))})})]})}function Nx({children:e,action:t,onClick:a,className:r}){const i=a?"bottom-sticky__inner bottom-sticky__inner--clickable":"bottom-sticky__inner";return n.jsx("div",{className:r?`bottom-sticky ${r}`:"bottom-sticky",children:n.jsxs("div",{className:i,onClick:a,...Ru(a),children:[n.jsx("div",{className:"bottom-sticky__content",children:e}),t]})})}function Ex({mountedRef:e}){const t=o.useRef({phase:"sound",at:0}),a=o.useRef(0),r=o.useRef(null),i=o.useRef(null),s=o.useCallback(()=>{const C=t.current,h=C.phase!=="sound"&&C.at>0;i.current=h?{phase:C.phase,elapsed:Math.max(0,Date.now()-C.at)}:null},[]),l=o.useCallback(()=>{const C=i.current;return i.current=null,C},[]),u=o.useCallback(()=>{a.current+=1,t.current={phase:"sound",at:0}},[]),c=o.useCallback((C,h,_=0)=>{if(!(C>0))return Promise.resolve(!0);const g=a.current;return t.current={phase:h,at:Date.now()-Math.max(0,_)},new Promise(A=>{const b=setTimeout(()=>{r.current===b&&(r.current=null),A(!!e.current&&g===a.current)},C);r.current=b})},[e]),d=o.useCallback(()=>{t.current={phase:"sound",at:Date.now()}},[]),m=o.useCallback(()=>{t.current={phase:"sound",at:0}},[]),p=o.useCallback(()=>{const C=t.current;return C.phase!=="sound"&&C.at>0},[]),f=o.useCallback(()=>a.current,[]),y=o.useCallback(C=>C===a.current,[]),x=o.useCallback(()=>{a.current+=1},[]);return o.useEffect(()=>()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]),o.useMemo(()=>({positionRef:t,isRunning:p,generation:f,isCurrent:y,abort:u,waitPad:c,enterSound:d,leave:m,pause:s,resume:l,__bumpGenerationForTest:x}),[p,f,y,u,c,d,m,s,l,x])}const ga=9,Dx=e=>Math.round(Math.min(ga,Math.max(0,e))/ga*100),Sx=e=>e/100*ga,Va=2,fc=.1,Tx=e=>Math.min(Va,Math.max(0,e)),jx=.1,Mx=e=>Math.round(e*1e6)/1e6;function qa(e){const{noiseRatio:t}=e;if(typeof t=="number"&&Number.isFinite(t))return Tx(t);const a=Math.min(ga,Math.max(0,Number(e.level)||0))/ga,r=Number(e.mainVolume);return r>0?a>0?Mx(Math.min(Va,Math.max(jx,a/r))):0:1}const Cc=e=>Math.min(1,Math.max(0,Number(e.mainVolume)||0));function gc(e){return Cc(e)}function os(e){return Cc(e)*qa(e)}function ss(e,t=Rf()){const a=Number.isFinite(t)&&t>0?t:1;return Math.min(1,os(e)/a)}function Ua(e,t){const a={...e,...t??{}};return t&&"level"in t&&typeof t.noiseRatio!="number"&&(a.noiseRatio=qa({level:a.level,mainVolume:a.mainVolume})),a}const Ga={enabled:!0,type:"defaultNoise",level:4.5,noiseRatio:1,speed:1,mainVolume:1,mainSpeed:1},is=o.createContext(null);function yr(){return o.useContext(is)}const ls=e=>`${$f()}/${e}`,bc=e=>Array.from({length:10},(t,a)=>ls(`${e}-${String(a+1).padStart(2,"0")}.mp3`)),vr={get defaultNoise(){return ls("noise1.mp3")},get street(){return bc("noise2")},get restaurant(){return bc("noise3")},get buzz(){return ls("noise4.mp3")}};function Lx(e){const t=Math.floor(Math.random()*10);switch(e){case"defaultNoise":return vr.defaultNoise;case"street":return vr.street[t];case"restaurant":return vr.restaurant[t];case"buzz":return vr.buzz;default:return null}}function $x({noisePlayer:e,audioRef:t,playbackStateRef:a,sequencer:r}){const i=o.useRef(e?.registerAnalyser);i.current=e?.registerAnalyser;const s=o.useRef(null),[l,u]=o.useState(null),c=o.useRef(null),d=o.useRef(null),m=o.useRef(null),p=o.useRef(null),f=o.useRef(0),y=o.useRef(null),x=o.useCallback(()=>!!r?.isRunning(),[r]),C=o.useCallback(()=>{p.current!==null&&(cancelAnimationFrame(p.current),p.current=null),y.current!==null&&(clearTimeout(y.current),y.current=null)},[]),h=o.useCallback((k,v=250)=>{const w=s.current;if(!w)return;const B=d.current;if(B){d.current=null;try{w.pause()}catch{}w.src=B,w.load()}if(!w.src)return;f.current+=1,C();try{Jr(),Ya(w).then(O=>{if(s.current===w)try{i.current?.("noise",O)}catch{}})}catch{}const E=w.paused?0:Za(w);w.paused&&Pn(w,0),w.play().catch(()=>{});const D=performance.now(),N=()=>{const O=Math.min(1,(performance.now()-D)/v);try{Pn(w,E+(k-E)*O)}catch{}O<1?p.current=requestAnimationFrame(N):p.current=null};p.current=requestAnimationFrame(N)},[C]),_=o.useCallback((k=250,v)=>{const w=s.current;if(!w||w.paused){v?.();return}const B=++f.current;C();const E=performance.now(),D=Za(w),N=()=>{const O=Math.min(1,(performance.now()-E)/k);try{Pn(w,D*(1-O))}catch{}if(O<1)p.current=requestAnimationFrame(N);else{p.current=null,y.current!==null&&(clearTimeout(y.current),y.current=null);try{w.pause()}catch{}v?.()}};p.current=requestAnimationFrame(N),y.current=setTimeout(()=>{if(y.current=null,f.current===B){p.current!==null&&(cancelAnimationFrame(p.current),p.current=null);try{w.paused||(Pn(w,0),w.pause(),v?.())}catch{}}},k+150)},[C]);o.useEffect(()=>{const k=document.createElement("audio");return k.loop=!0,k.crossOrigin="anonymous",s.current=k,()=>{C();try{k.pause(),k.removeAttribute("src"),k.load()}catch{}s.current=null,c.current=null,d.current=null}},[C]);const g=e?ss(e.settings):0,A=!!e?.settings.enabled&&g>0;o.useEffect(()=>{if(!A)return;let k=0;const v=setInterval(()=>{const w=s.current;if(!w||w.paused){k=0;return}const B=t.current;if(B&&!B.paused&&!B.ended||x()||a.current==="playing"){k=0;return}k+=1,k>=2&&(k=0,_())},400);return()=>clearInterval(v)},[_,A,t,a,x]),o.useEffect(()=>{const k=()=>{const v=s.current;if(document.hidden){if(v&&!v.paused){C();try{v.pause()}catch{}}return}if(!v||!v.paused)return;const w=t.current,B=!!w&&!w.paused&&!w.ended||x()||a.current==="playing",E=m.current;B&&E?.enabled&&E.volume>0&&h(E.volume)};return document.addEventListener("visibilitychange",k),()=>document.removeEventListener("visibilitychange",k)},[C,h,t,a,x]),o.useEffect(()=>{m.current=e?{enabled:e.settings.enabled,volume:g,type:e.settings.type}:null},[e,e?.settings.enabled,g,e?.settings.type]);const b=o.useRef(null);return o.useEffect(()=>()=>{b.current?.(),b.current=null},[]),o.useEffect(()=>{const k=e?.settings,v=s.current;if(!v)return;const w=k?ss(k):0;if(!k||!k.enabled||w===0){_();return}if(c.current!==k.type){const B=Lx(k.type);B&&(c.current=k.type,u(B),d.current=B,_(150,()=>{if(d.current!==B)return;d.current=null,v.src=B,v.load();const E=t.current;if(E&&!E.paused||x()){b.current?.();const D=()=>{v.removeEventListener("canplay",D),b.current===N&&(b.current=null);const O=t.current,P=m.current;(O&&!O.paused&&!O.ended||x())&&P?.enabled&&P.volume>0&&h(P.volume)},N=()=>v.removeEventListener("canplay",D);b.current=N,v.addEventListener("canplay",D)}}))}else{const B=t.current,E=!!B&&!B.paused&&!B.ended||x()||a.current==="playing";if(E&&d.current)h(w);else if(E&&v.paused&&v.src)h(w);else if(!v.paused)if(!E)_();else{C();const D=Za(v),N=performance.now(),O=()=>{const P=Math.min(1,(performance.now()-N)/150);try{Pn(v,D+(w-D)*P)}catch{}P<1?p.current=requestAnimationFrame(O):p.current=null};p.current=requestAnimationFrame(O)}}},[e?.settings,e?.settings.enabled,g,e?.settings.type,C,h,_,t,a,m,x]),o.useEffect(()=>{const k=s.current;if(k)try{k.playbackRate=Math.min(1.25,Math.max(.75,e?.settings.speed??1))}catch{}},[e?.settings.speed]),{noiseAudioRef:s,activeNoiseUrl:l,noiseSettingsRef:m,cancelNoiseFade:C,fadeInNoise:h,fadeOutNoise:_}}function Rx({ttsText:e,playbackRate:t,mainVolume:a,fillRef:r,waveProgressRef:i,setProgress:s,setPlaybackState:l,setStateLocal:u,fadeInNoise:c,fadeOutNoise:d,noiseSettingsRef:m,onDoneRef:p,handleEndRef:f}){const y=o.useRef(null),x=o.useRef(0),C=o.useRef(null),h=o.useRef(0),_=o.useRef(!1);o.useEffect(()=>()=>{h.current++;try{if(C.current&&(cancelAnimationFrame(C.current),C.current=null),_.current&&window.speechSynthesis){try{window.speechSynthesis.cancel()}catch{}_.current=!1}}catch{}},[]);const g=(k,v=1)=>{try{const w=(k||"").trim().split(/\s+/).filter(Boolean).length||Math.max(1,(k||"").length);return Math.max(700,Math.round(w*300/Math.max(.25,v)))}catch{return 1200}},A=o.useCallback(k=>{if(typeof window>"u"||!window.speechSynthesis){try{typeof p.current=="function"&&p.current(!1)}catch{}return}const v=window.speechSynthesis,w=++h.current;try{try{v.cancel()}catch{}const B=k??e,E=Array.isArray(B)?B.filter(L=>!!L):[B||""];E.length===0&&E.push("");const D=Math.max(.3,Math.min(3,t));x.current=E.reduce((L,M)=>L+g(M,D||1),0),y.current=performance.now(),s(0),l("playing"),u("playMode");const N=m.current;N?.enabled&&(N?.volume??0)>0&&c(N.volume);const O=()=>{try{const L=y.current||performance.now(),M=performance.now()-L,$=x.current||1200,Z=Math.min(1,M/$);try{r.current&&(r.current.style.left=`${Z*100}%`),i.current&&i.current.style.setProperty("--progress",String(Z))}catch{}Z<1&&(C.current=requestAnimationFrame(O))}catch{}},P=()=>{if(w===h.current)try{C.current&&(cancelAnimationFrame(C.current),C.current=null),s(1),l("stopped");try{f.current?.()}catch{try{typeof p.current=="function"&&p.current(!0)}catch{}}}catch{}},G=L=>{const M=new SpeechSynthesisUtterance(E[L]);try{M.rate=D}catch{}try{M.volume=Math.max(0,Math.min(1,a))}catch{}M.onend=()=>{if(w===h.current){if(L<E.length-1){try{G(L+1)}catch{P()}return}P()}},M.onerror=()=>{P()},M.onstart=()=>{if(!(L>0))try{C.current&&(cancelAnimationFrame(C.current),C.current=null),C.current=requestAnimationFrame(O)}catch{}},_.current=!0,v.speak(M)};try{G(0)}catch{try{typeof p.current=="function"&&p.current(!0)}catch{}}}catch{try{typeof p.current=="function"&&p.current(!0)}catch{}}},[e,t,a,c,r,i,s,l,u,m,p,f]),b=o.useCallback(()=>{h.current++;try{if(window.speechSynthesis)try{window.speechSynthesis.cancel()}catch{}C.current&&(cancelAnimationFrame(C.current),C.current=null),d(),y.current=null}catch{}l("stopped"),u("active"),s(0)},[d,l,u,s]);return{startTTS:A,stopTTS:b}}const Px=.01,Ix=.3;async function Fx(e,t,a,r=!1){let i=null;try{const s=window.AudioContext||window.webkitAudioContext;i=new s;const l=await i.decodeAudioData(e.slice(0)),u=l.numberOfChannels>0?l.getChannelData(0):null;if(!u)return null;let c=0;if(r){const y=Math.floor(Ix*l.sampleRate),x=Math.min(u.length,y);for(;c<x&&Math.abs(u[c])<=Px;)c++;c>=x&&(c=0)}const d=u.length-c,m=a&&a>0?Math.min(d,Math.floor(a*l.sampleRate)):d,p=Math.max(t,m),f=Math.floor(p/t)||1;return new Array(t).fill(0).map((y,x)=>{const C=c+x*f,h=Math.min(C+f,c+p,u.length);let _=0;for(let g=C;g<h;g++){const A=Math.abs(u[g]);A>_&&(_=A)}return _})}catch{return null}finally{try{i?.close?.()}catch{}}}async function yc(e,t,a,r=!1){try{const i=await fetch(e);if(i.ok===!1)return null;const s=await i.arrayBuffer();return await Fx(s,t,a,r)}catch(i){try{const s=Ei(i)}catch{}return null}}const us=45,Ox=74,zx=2;function xr(e){const t=Math.min(2,Math.max(0,Number(e)||0));return t<=1?t*45:45+(t-1)*29}function _r(e){return xr(e)/45}const Wx=e=>Math.max(0,(typeof e=="number"&&Number.isFinite(e)?e:0)*1e3),vc=e=>Math.max(0,typeof e=="number"&&Number.isFinite(e)?e:0);function xc({durationsSec:e,leadInMs:t=0,tailMs:a=0}){const r=vc(t),i=vc(a),s=[];let l=0;return e.forEach((u,c)=>{for(const[d,m]of[["lead",r],["sound",Wx(u)],["tail",i]])s.push({kind:d,track:c,startMs:l,durMs:m}),l+=m}),{segments:s,totalMs:l,trackCount:e.length}}function _c(e,t){const a=(t|0)*3;if(t<0||a+2>=e.segments.length)return null;const[r,i,s]=[e.segments[a],e.segments[a+1],e.segments[a+2]];return{lead:r,sound:i,tail:s,totalMs:r.durMs+i.durMs+s.durMs}}function Hx(e,t){const a=_c(e,t.track);if(!a||!(a.totalMs>0))return 0;const r=a[t.kind],i=Math.min(Math.max(0,Number.isFinite(t.elapsedMs)?t.elapsedMs:0),r.durMs);return Math.max(0,Math.min(1,(r.startMs-a.lead.startMs+i)/a.totalMs))}function Vx(e,t,a){const r=Math.max(0,Math.floor(a)),i=_c(e,t);if(!i||r===0||!(i.totalMs>0)||i.lead.durMs===0&&i.tail.durMs===0||!(i.sound.durMs>0))return{lead:0,sound:r,tail:0};const s=Math.round(i.lead.durMs/i.totalMs*r),l=Math.round(i.tail.durMs/i.totalMs*r),u=Math.max(1,r-s-l),c=s+u+l-r;return{lead:Math.max(0,s-Math.ceil(c/2)),sound:u,tail:Math.max(0,l-Math.floor(c/2))}}function qx({currentTime:e,sources:t,index:a,audioDuration:r}){const i=a||0,s=Array.isArray(t)&&t.length>0?t[i]:void 0,l=s?s.duration||r||0:r||0;if(!(l>0))return 0;const u=Number.isFinite(e)?e:0;return Math.max(0,Math.min(1,u/l))}function Ux({phase:e,phaseElapsedMs:t,currentTime:a,trackDurationSec:r,leadInMs:i,tailMs:s}){const l=xc({durationsSec:[r],leadInMs:i,tailMs:s});return Hx(l,{track:0,kind:e,elapsedMs:e==="sound"?(Number.isFinite(a)?a:0)*1e3:t})}function Gx({bars:e,trackDurationSec:t,leadInMs:a,tailMs:r}){return Vx(xc({durationsSec:[t],leadInMs:a,tailMs:r}),0,e)}function Kx(e,t){if(!Array.isArray(e))return null;const a=t||0;return a<e.length-1?a+1:null}function Yx({ended:e,completedByEnd:t}){return!!e||!!t}function Zx(e){return e.map((t,a)=>({src:t.src,label:String(a+1),color:void 0,duration:t.duration||0}))}function Xx(e){return e.reduce((t,a)=>t+(a.duration||0),0)}function Jx(e,t,a){const r=Array.isArray(e)?e:e?[e]:[],i=[];for(const s of r)if(s){if(typeof s=="object"&&s!==null&&"src"in s&&s.src){const l=s;i.push({code:l.code??null,src:l.src});continue}if(typeof s=="string"&&(s.startsWith("http")||s.includes("/"))){i.push({code:null,src:s});continue}if(typeof s=="string"||typeof s=="number"){const l=String(s),u=a(l,t);u&&i.push({code:l,resolvedPath:u})}}return i}const wc=4,Qx=_r(wc/us);function e_(e){const{src:t,segments:a,progress:r=0,waveProgressRef:i,noiseSrc:s,noiseRatio:l=0,noiseSpeed:u=1,totalDuration:c=0,mainVolume:d=1,onReadyChange:m,showSoundWaveForm:p=!0,leadInMs:f=0,tailMs:y=0,trackDurationSec:x=0}=e,C=o.useRef(null),h=o.useRef(null),[_,g]=o.useState(null),[A,b]=o.useState(!1),[k,v]=o.useState(null),[w,B]=o.useState(2),[E,D]=o.useState(0),[N,O]=o.useState(null),[P,G]=o.useState(!1),[L,M]=o.useState(!1),$=3,Z=3,q=1,z=300,V=o.useRef(0),R=o.useCallback(()=>{const be=C.current,te=h&&h.current?h.current:be?be.closest(".audio-player__wave"):null,ue=te?te.getBoundingClientRect():be?be.getBoundingClientRect():null,fe=ue?ue.width:0,ge=ue?Math.max(100,ue.width):320,Ce=ue?ue.height:0,$e=Math.max(q,Math.min(z,Math.floor((ge+Z)/($+Z)))),He=$e*$,Te=Math.max(0,$e-1),Ie=Math.max(0,Te>0?(ge-He)/Te:Z);return{bars:$e,gap:Ie,height:Ce,width:fe}},[]),H=o.useRef(void 0),W=o.useRef(null),I=o.useCallback(async(be,te,{quiet:ue=!1}={})=>{const fe=++V.current,ge=()=>V.current===fe;try{if(ue||b(!1),H.current=be,!be){ge()&&g(null);return}let Ce=te;if(!Ce)try{for(let Te=0;Te<4&&!(C.current||h.current);Te++)await new Promise(Ie=>requestAnimationFrame(Ie));await new Promise(Te=>requestAnimationFrame(Te));const He=R();He.height>0&&D(He.height),Ce=He.bars,B(He.gap)}catch{Ce=120}W.current=Ce;const $e=await yc(be,Ce);if(!ge())return;if(!$e){g(null),b(!1);return}g($e),v(Ce),b(!0)}catch{if(!ge())return;g(null),b(!1)}},[b,g,D,B,v,R]);o.useEffect(()=>{const be=h.current;if(!be||typeof ResizeObserver>"u")return;let te=null;const ue=new ResizeObserver(()=>{te!==null&&cancelAnimationFrame(te),te=requestAnimationFrame(()=>{te=null;try{const fe=R();if(fe.width<=0||(fe.height>0&&D(fe.height),W.current===null||fe.bars===W.current))return;const ge=H.current;B(fe.gap),ge?I(ge,fe.bars,{quiet:!0}).catch(()=>{}):W.current=fe.bars}catch{}})});return ue.observe(be),()=>{ue.disconnect(),te!==null&&cancelAnimationFrame(te)}},[R,I]),o.useEffect(()=>{const be=a&&a[0]&&a[0].src||t||a&&a.length===1&&a[0]&&a[0].src;I(typeof be=="string"?be:void 0).catch(()=>{}),M(!1)},[t,a,I]),o.useEffect(()=>{let be=!1;if(G(!1),!s||!k){O(null);return}const te=c>0?c*(u||1):void 0;return yc(s,k,te,!0).then(ue=>{be||(O(ue),ue||G(!0))}).catch(()=>{be||(O(null),G(!0))}),()=>{be=!0}},[s,k,c,u]);const S=Math.max(0,Math.min(1,d)),j=o.useMemo(()=>_&&_.length&&Math.max(..._)||1,[_]),F=k||40,U=o.useMemo(()=>Gx({bars:F,trackDurationSec:x,leadInMs:f,tailMs:y}),[F,x,f,y]),re=o.useMemo(()=>Array.from({length:F}).map((be,te)=>{const ue=te>=U.lead&&te<U.lead+U.sound,fe=U.sound>0&&ue?Math.min(F-1,Math.round((te-U.lead)/U.sound*F)):-1,ge=ue?_&&_[fe]!=null?_[fe]:null:_?0:null,Ce=ge==null?null:Math.min(1,ge/j*S),$e=Ce!=null&&E>0&&xr(Ce)<=wc,He=Ce==null?.15:$e?0:_r(Ce),Te=$e,Ie=F>1?te/(F-1):0;return n.jsx("div",{className:Te?"audio-player__bar audio-player__bar--hidden":"audio-player__bar",style:{"--val":He,"--i":te,"--mix":Ie}},te)}),[F,_,j,S,E,U]),ne={"--progress":String(Math.max(0,Math.min(1,r)))},le=o.useMemo(()=>N&&N.length&&Math.max(...N.map(be=>Number.isFinite(be)?Math.abs(be):0))||1,[N]),K=S*Math.max(0,l),oe=!s||!N||!N.length?1:Math.max(1,K),Ae={"--bar-gap":`${w}px`,"--wave-h":`${xr(oe)}px`,"--wave-h1":`${us}px`},Y=A&&(s?!!N||P:!0);o.useEffect(()=>{Y&&M(!0)},[Y]);const Q=L?A:Y;o.useEffect(()=>{m?.(Q)},[Q,m]);const me=k||40,De=o.useMemo(()=>Array.from({length:me}).map((be,te)=>{const ue=N&&N[te]!=null?N[te]:null,fe=ue==null?0:Math.abs(ue)/le*K,ge=Math.max(Qx,_r(fe)),Ce=me>1?te/(me-1):0;return n.jsx("div",{className:"audio-player__bar",style:{"--val":ge,"--i":te,"--mix":Ce}},te)}),[me,N,le,K,E]);return n.jsxs("div",{className:"audio-player__wave",ref:h,style:Ae,children:[s&&n.jsx("div",{className:`audio-player__wave-noise ${Y?"is-ready":""}`,"aria-hidden":"true",children:De}),p&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:`audio-player__wave-inner audio-player__wave-unplayed ${Q?"is-ready":""}`,ref:C,children:re}),n.jsx("div",{className:`audio-player__wave-inner audio-player__wave-played ${Q?"is-ready":""}`,ref:i,style:ne,children:re})]})]})}const t_={idle:"\uB300\uAE30",synthesizing:"\uC18C\uB9AC\uB97C \uB9CC\uB4E4\uACE0 \uC788\uC2B5\uB2C8\uB2E4\u2026",resolving:"\uB9AC\uC18C\uC2A4 \uB9E4\uD551 \uC911\u2026",checking_exists:"\uD30C\uC77C \uC874\uC7AC \uD655\uC778\u2026",getting_signed_url:"\uC11C\uBA85 URL \uC870\uD68C\u2026",downloading:"\uB2E4\uC6B4\uB85C\uB4DC \uC911\u2026",measuring_duration:"\uC624\uB514\uC624 \uAE38\uC774 \uCE21\uC815\u2026",ready:"\uC900\uBE44 \uC644\uB8CC",error:"\uC624\uB958 \uBC1C\uC0DD"},Bc={idle:!1,synthesizing:!0,resolving:!0,checking_exists:!0,getting_signed_url:!0,downloading:!0,measuring_duration:!0,ready:!1,error:!0};function cs(e,t){return new Promise((a,r)=>{const i=document.createElement("audio");let s=!1;const l=()=>{try{i.removeAttribute("src"),i.load()}catch{}},u=()=>{if(s)return;s=!0;const d=isFinite(i.duration)&&i.duration||0;l(),a(d)},c=d=>{s||(s=!0,l(),t.rejectOnError?r(new Error(d)):a(0))};i.addEventListener("loadedmetadata",u),i.addEventListener("error",()=>c("audio load failed")),setTimeout(()=>c("audio load timeout"),t.timeoutMs),i.src=e})}const n_=2e3;function kc(e,t=n_){return new Promise(a=>{let r=!1;const i=()=>{r||(r=!0,a())};e.addEventListener("canplay",i,{once:!0}),e.addEventListener("error",i,{once:!0}),setTimeout(i,t)})}function a_({showSoundWaveForm:e,showNoiseWaveForm:t,timeoutMs:a=2500}){const r=o.useRef(!1),i=o.useRef([]),s=o.useCallback(c=>{if(r.current=c,!c||!i.current.length)return;const d=i.current;i.current=[];for(const m of d)m(!0)},[]),l=o.useCallback(()=>{r.current=!1},[]),u=o.useCallback(()=>!e&&!t||r.current?Promise.resolve(!0):new Promise(c=>{const d=p=>{clearTimeout(m),i.current=i.current.filter(f=>f!==d),c(p)},m=setTimeout(()=>d(!0),a);i.current.push(d)}),[e,t,a]);return o.useEffect(()=>()=>{const c=i.current;i.current=[];for(const d of c)d(!1)},[]),{onReadyChange:s,waitForReady:u,markNotReady:l}}function r_(){const e=o.useRef([]),t=o.useCallback(i=>(e.current.push(i),i),[]),a=o.useCallback(i=>{const s=new Set([...i].filter(Boolean));e.current=e.current.filter(l=>{if(s.has(l))return!0;try{URL.revokeObjectURL(l)}catch{}return!1})},[]),r=o.useCallback(()=>{a([])},[a]);return o.useEffect(()=>()=>{for(const i of e.current)try{URL.revokeObjectURL(i)}catch{}e.current=[]},[]),{track:t,keepOnly:a,revokeAll:r}}function o_({offsetY:e=8}={}){const t=o.useRef(null),[a,r]=o.useState(null),i=o.useCallback(()=>r(null),[]),s=o.useCallback(()=>{try{const l=t.current?.getBoundingClientRect();if(!l)return;r({left:l.left,right:l.right,width:l.width,height:l.height,x:l.x,top:l.top+e,bottom:l.bottom+e,y:l.y+e,toJSON:l.toJSON.bind(l)})}catch{}},[e]);return o.useEffect(()=>{if(a)return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[a,i]),{ref:t,rect:a,show:s,hide:i}}function s_(e){if(!e)return 0;const t=e.duration;if(Number.isFinite(t)&&t>0)return t;if(t===0)return 0;try{const a=e.seekable;if(a&&a.length>0){const r=a.end(a.length-1);if(Number.isFinite(r)&&r>0)return r}}catch{}return null}const i_=400,l_=2e3,Ac=5;function u_({audioRef:e,fillRef:t,waveProgressRef:a,sourcesRef:r,currentIndexRef:i,sequencer:s,leadInMs:l=0,tailMs:u=0}){const c=o.useRef(null),d=o.useRef(0),m=o.useRef(null),p=o.useCallback(()=>{c.current!==null&&(cancelAnimationFrame(c.current),c.current=null)},[]),f=o.useCallback(()=>{if(c.current!==null)return;let x=0;const C=()=>{if(Ln){const h=typeof performance<"u"&&performance.now?performance.now():Date.now();if(x>0&&h-x>i_){const _=m.current===null||h-m.current>l_;if(m.current=h,_&&d.current<Ac){d.current+=1;const g=d.current;let A=null;try{A=typeof document<"u"?document.visibilityState:null}catch{}St(`progress-ticker-slow-frames#${g}`,`[ihab-core] \uC9C4\uD589 \uC0AC\uC2AC\uC758 \uD2C0 \uC0AC\uC774\uAC00 ${Math.round(h-x)}ms \uC785\uB2C8\uB2E4(\uBCF4\uD1B5 16ms).`,A==="hidden"?"\uC774 \uCE78\uC774 **\uC228\uC5B4 \uC788\uC5B4** \uBE0C\uB77C\uC6B0\uC800\uAC00 \uD2C0\uC744 \uC904\uC600\uC2B5\uB2C8\uB2E4 \u2014 \uC7AC\uC0DD\uBC14\xB7\uD30C\uD615\uC740 \uD2C0\uB9C8\uB2E4 \uADF8\uB824\uC9C0\uBBC0\uB85C, \uC9C0\uAE08 \uC7AC\uB294 \uAC12\uC740 **\uC0AC\uB78C\uC774 \uBCF4\uB294 \uD654\uBA74\uACFC \uB2E4\uB985\uB2C8\uB2E4.** \uCE78\uC744 \uC55E\uC73C\uB85C \uAEBC\uB0B4\uACE0 \uB2E4\uC2DC \uC7AC\uC2ED\uC2DC\uC624.":"\uCE78\uC740 \uBCF4\uC774\uB294\uB370 \uD2C0\uC774 \uB290\uB9BD\uB2C8\uB2E4 \u2014 \uAC19\uC740 \uD654\uBA74\uC5D0\uC11C \uBB34\uAC70\uC6B4 \uC77C\uC774 \uB3C4\uB294\uC9C0 \uBCF4\uC2ED\uC2DC\uC624. \uC7AC\uC0DD\uBC14\xB7\uD30C\uD615\uC774 \uB04A\uACA8 \uBCF4\uC774\uB294 \uAC83\uC740 \uC774 \uD0D3\uC77C \uC218 \uC788\uC2B5\uB2C8\uB2E4.",g>=Ac?`(${g}\uBC88\uC9F8 \u2014 \uB354\uB294 \uC548 \uC54C\uB9BD\uB2C8\uB2E4)`:`(${g}\uBC88\uC9F8)`)}}x=h}try{const h=e.current,_=Array.isArray(r.current)?r.current[i.current||0]:void 0,g=!!_&&Number.isFinite(_.duration)&&(_.duration??0)>0,A=g?0:s_(h),b=t.current,k=(l||0)>0||(u||0)>0,v=k&&(s?.positionRef.current?.phase??"sound")!=="sound";if(A===null&&!v)try{b&&b.style.visibility!=="hidden"&&(b.style.visibility="hidden")}catch{}else{const w=g?_.duration:A||0;Ln&&v&&!(w>0)&&St("progress-ticker-pad-without-duration","[ihab-core] \uB738\uC774 \uB3C4\uB294\uB370 **\uC18C\uB9AC \uAE38\uC774\uB97C \uBAA8\uB985\uB2C8\uB2E4** \u2014 \uC7AC\uC0DD\uBC14\uAC00 \uB738\uB9CC\uC73C\uB85C \uC5B4\uB9BC\uC7A1\uC544 \uC6C0\uC9C1\uC785\uB2C8\uB2E4.","\uC18C\uB9AC \uAE38\uC774 \uC7AC\uAE30(measureAudioDuration)\uAC00 0 \uC744 \uC92C\uAC70\uB098 `<audio>` \uAC00 \uC544\uC9C1 \uC548 \uC2E4\uB838\uC2B5\uB2C8\uB2E4. \uAE38\uC774\uB97C \uC54C\uAC8C \uB418\uBA74 \uB9C8\uCEE4\uAC00 \uADF8 \uC21C\uAC04 **\uB4A4\uB85C \uBB3C\uB7EC\uB0A9\uB2C8\uB2E4**(\uC5B4\uB9BC\uC740 \uB298 \uCC38\uBCF4\uB2E4 \uD07D\uB2C8\uB2E4). \uC774 \uC904\uC774 \uBCF4\uC774\uBA74 \uADF8 \uC790\uB9AC\uB97C \uC54C\uB824 \uC8FC\uC2ED\uC2DC\uC624 \u2014 \uD3C9\uC18C \uAE38\uC5D0\uC11C\uB294 \uC548 \uB098\uC640\uC57C \uD569\uB2C8\uB2E4.");const B=k?Ux({phase:s?.positionRef.current?.phase??"sound",phaseElapsedMs:s?.positionRef.current?Math.max(0,Date.now()-s.positionRef.current.at):0,currentTime:h&&typeof h.currentTime=="number"?h.currentTime:0,trackDurationSec:w,leadInMs:l||0,tailMs:u||0}):qx({currentTime:h&&typeof h.currentTime=="number"?h.currentTime:0,sources:r.current,index:i.current,audioDuration:A??0});try{b&&(b.style.visibility&&(b.style.visibility=""),b.style.left=`${B*100}%`)}catch{}try{a.current?.style.setProperty("--progress",String(B))}catch{}}}catch{}c.current=requestAnimationFrame(C)};c.current=requestAnimationFrame(C)},[e,t,a,r,i,s,l,u]),y=o.useCallback(x=>{p();try{t.current&&(t.current.style.visibility="",t.current.style.left=`${x*100}%`)}catch{}try{a.current?.style.setProperty("--progress",String(x))}catch{}},[p,t,a]);return o.useEffect(()=>p,[p]),{start:f,stop:p,settleTo:y}}function ds({btnLabel:e,soundSrc:t,bucketPath:a,onDone:r,disabled:i=!1,ttsText:s=null,className:l,showSoundWaveForm:u=!0,showNoiseWaveForm:c=!0,leadInMs:d=0,tailMs:m=0}){const{t:p}=xe.useTranslation(),f=e,y=yr(),x=o.useRef(y?.registerAnalyser);o.useEffect(()=>{x.current=y?.registerAnalyser});const C=o.useRef(null),h=o.useRef(null),_=o.useRef(null),g=r_(),A=o.useRef(null),b=o.useRef(!1),k=o.useRef(null),{ref:v,rect:w,show:B,hide:E}=o_();o.useEffect(()=>()=>{x.current?.("main",null),x.current?.("noise",null)},[]);const[D,N]=o.useState(!1),[O,P]=o.useState("idle"),[G,L]=o.useState("stopped"),M=o.useRef("stopped");o.useEffect(()=>{M.current=G},[G]);const[$,Z]=o.useState(0),[q,z]=o.useState("active"),V=o.useRef(!1);o.useEffect(()=>{if(q!=="playMode"||!V.current)return;V.current=!1;const J=typeof document<"u"?document.activeElement:null;if(J&&J!==document.body)return;const de=_.current?.querySelectorAll("button")[1];try{de?.focus()}catch{}},[q]);const[R,H]=o.useState(null),[W,I]=o.useState(null),[S,j]=o.useState(0),[F,U]=o.useState(!1),[re,ne]=o.useState(0),le=y?.playbackRate??1,K=y?.mainVolume??1,oe=y?os(y.settings):0,Ae=y?gc(y.settings):K,[Y,Q]=o.useState("idle"),[me,De]=o.useState(""),[be]=o.useState("top"),te=o.useRef(null),ue=o.useRef(0),fe=o.useRef(null),ge=o.useRef(!0),Ce=Ex({mountedRef:ge}),$e=o.useRef(null),He=o.useRef(d),Te=o.useRef(m);o.useEffect(()=>{He.current=Math.max(0,d||0)},[d]),o.useEffect(()=>{Te.current=Math.max(0,m||0)},[m]);const{start:Ie,stop:qe,settleTo:mt}=u_({audioRef:C,fillRef:h,waveProgressRef:fe,sourcesRef:te,currentIndexRef:ue,sequencer:Ce,leadInMs:d,tailMs:m}),{onReadyChange:ct,waitForReady:rt,markNotReady:ft}=a_({showSoundWaveForm:u,showNoiseWaveForm:c}),ke=o.useRef(null),Ve=o.useRef(i),we=o.useRef(r),Ue=o.useRef(null),Be=o.useRef(!1),[je,Se]=o.useState(!1),Xe=o.useCallback(J=>{Be.current=J,Se(J)},[]),Qe=o.useRef(null),{activeNoiseUrl:dt,noiseSettingsRef:ht,fadeInNoise:wt,fadeOutNoise:Ct}=$x({noisePlayer:y,audioRef:C,playbackStateRef:M,sequencer:Ce}),{startTTS:Nt,stopTTS:gt}=Rx({ttsText:s,playbackRate:le,mainVolume:Ae,fillRef:h,waveProgressRef:fe,setProgress:Z,setPlaybackState:L,setStateLocal:z,fadeInNoise:wt,fadeOutNoise:Ct,noiseSettingsRef:ht,onDoneRef:we,handleEndRef:Qe});o.useEffect(()=>{Fe.current=gt});const it=J=>{if(typeof window>"u"||!window.speechSynthesis){try{De(p("training.ttsUnavailable","\uC774 \uAE30\uAE30\uC5D0\uC11C\uB294 \uC74C\uC131\uC744 \uB4E4\uB824\uC904 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."))}catch{}Nt(J);return}tt("tts"),Nt(J)},Ke=Array.isArray(t)?t.filter(Boolean):t?[t]:[],se=(!Ke||Ke.length===0)&&!!s,Ne=Array.isArray(R)&&R.length>0?R:Array.isArray(W)&&W.length>0?W:null,We=Math.max(Array.isArray(Ne)?Ne.length:0,Ke.length);o.useEffect(()=>(ge.current=!0,()=>{ge.current=!1}),[]);const nt=()=>{Ce.abort()},Fe=o.useRef(null),Ge=o.useRef(null),bt=o.useRef(null),Re=o.useRef(null);Re.current||(Re.current=()=>{bt.current=null;const J=C.current;if(Ge.current==="audio"&&J&&(!J.paused||Ce.isRunning())){nt();try{J.pause()}catch{}ge.current&&(L("paused"),qe(),Ct())}else if(Ge.current==="tts")try{Fe.current?.()}catch{}});const tt=J=>{Ge.current=J,bt.current=lr(Re.current)},xt=()=>{bt.current?.(),bt.current=null};o.useEffect(()=>()=>{Re.current&&ur(Re.current)},[]);const Lt=o.useRef(le);o.useEffect(()=>{Lt.current=le||1},[le]);const et=o.useCallback(J=>{const de=Lt.current||1;try{J.defaultPlaybackRate=de}catch{}try{J.playbackRate=de}catch{}},[]),ot=o.useCallback((J,de)=>{J.src=de,et(J),J.load(),et(J)},[et]),lt=o.useCallback(()=>{Ue.current&&(clearTimeout(Ue.current),Ue.current=null),Q("idle")},[]),st=o.useCallback(async(J,de=3,ae=50,ye=0)=>{lt();const Le=Ce.generation(),ze=!!J&&J.currentTime>0&&!J.ended,ut=Math.max(0,He.current-Math.max(0,ye));if(ut>0&&!ze){tt("audio"),Ie(),L("playing");const yt=ht.current;if(yt?.enabled&&(yt.volume??0)>0)try{wt(yt.volume)}catch{}if(!await Ce.waitPad(ut,"lead",ye)||!ge.current||!Ce.isCurrent(Le))return!1}Ce.enterSound();for(let yt=0;yt<de;yt++){if(!ge.current||!Ce.isCurrent(Le))return!1;try{return tt("audio"),await J.play(),!0}catch(he){if((he instanceof Error||typeof he=="object"&&he&&"name"in he?he.name:void 0)==="AbortError"){if(!Ce.isCurrent(Le))return!1;await new Promise(T=>setTimeout(T,ae));continue}try{De(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."))}catch{}return!1}}try{De(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."))}catch{}return!1},[p,Ie,Ce,wt,ht,lt]),jt=o.useCallback(J=>{const de=Ce.generation(),ae=Math.max(0,Te.current-Math.max(0,J));Ie();const ye=ht.current;if(ye?.enabled&&(ye.volume??0)>0)try{wt(ye.volume)}catch{}const Le=()=>{try{$e.current?.()}catch{}};if(ae<=0){Ce.leave(),Le();return}Ce.waitPad(ae,"tail",J).then(ze=>{Ce.leave(),ze&&Ce.isCurrent(de)&&Le()}).catch(()=>{})},[Ce,Ie,wt,ht]),Wt=o.useCallback(()=>{const J=C.current;if(!J)return;const de=()=>{L("playing"),z("playMode"),U(!0),Ie();try{Jr(),Ya(J).then(ze=>{if(ge.current)try{x.current?.("main",ze)}catch{}})}catch{}const Le=ht.current;Le?.enabled&&(Le?.volume??0)>0&&wt(Le.volume)},ae=()=>{Yx({ended:!!J?.ended,completedByEnd:Be.current})||(L("paused"),qe(),Ct())},ye=()=>{const Le=()=>{try{const ze=te.current,ut=Kx(ze,ue.current);if(ut!==null){ue.current=ut,j(ut),U(!0);const yt=ze?.[ut]&&ze[ut].src;if(yt&&J){ot(J,yt),st(J).catch(()=>{});return}}}catch{}L("stopped"),Z(1);try{if(J)try{J.currentTime=0}catch{}}catch{}qe(),U(!1),Ct();try{!Ve.current&&Qe.current&&Qe.current()}catch{}};if($e.current=Le,Te.current>0){Ie(),Ce.waitPad(Te.current,"tail").then(ze=>{Ce.leave(),ze&&Le()}).catch(()=>{});return}Le()};return J.addEventListener("play",de),J.addEventListener("pause",ae),J.addEventListener("ended",ye),()=>{try{J.removeEventListener("play",de),J.removeEventListener("pause",ae),J.removeEventListener("ended",ye),qe()}catch{}}},[wt,Ct,st,ht,Ie,qe,Ce]);o.useEffect(()=>Wt(),[Wt]),o.useEffect(()=>{Ve.current=i},[i]),o.useEffect(()=>{we.current=r},[r]),o.useEffect(()=>{if(i||q!=="active")return;const J=k.current;if(!J)return;let de=null;const ae=requestAnimationFrame(()=>{try{const ye=J.getTotalLength();if(!ye)return;const Le=ye*.2;J.style.strokeDasharray=`${ye-Le} ${Le}`;const ze="triFlow_"+Math.random().toString(36).slice(2);de=document.createElement("style"),de.textContent=`@keyframes ${ze}{from{stroke-dashoffset:0}to{stroke-dashoffset:-${ye}}}`,document.head.appendChild(de),J.style.animation=`${ze} 2.4s linear infinite`}catch{}});return()=>{cancelAnimationFrame(ae),de?.remove()}},[q,i]),o.useEffect(()=>{te.current=R},[R]),o.useEffect(()=>{ue.current=S},[S]),o.useEffect(()=>{const J=_.current,de=A.current;if(!J||!de)return;let ae=null;const ye=32,Le=60,ze=()=>{try{const yt=Array.from(J.querySelectorAll(":scope > .button"));let he=0;yt.forEach(Pe=>{if(Pe===de)return;const Ze=Pe.getBoundingClientRect();he+=Ze.width});const T=J.getBoundingClientRect().width,X=Math.max(0,Math.floor(T-he-8)),ce=We;if(!ce||X<=0){Array.from(de.children).forEach(Pe=>{try{Pe.style.width=""}catch{}});return}let Ee=Math.floor(X/ce);Ee>Le&&(Ee=Le),Ee<ye&&(Ee=Math.max(ye,Math.floor(X/ce))),Array.from(de.querySelectorAll(".button")).forEach(Pe=>{try{Pe.style.width=`${Ee}px`}catch{}})}catch{}},ut=requestAnimationFrame(ze);try{ae=new ResizeObserver(()=>{requestAnimationFrame(ze)}),ae.observe(J),ae.observe(de),window.addEventListener("resize",ze)}catch{}return()=>{try{cancelAnimationFrame(ut)}catch{}try{ae&&(ae.disconnect(),ae=null)}catch{}try{window.removeEventListener("resize",ze)}catch{}}},[R,W,We]),o.useEffect(()=>()=>{try{ke.current&&(clearTimeout(ke.current),ke.current=null),Ue.current&&(clearTimeout(Ue.current),Ue.current=null)}catch{}},[]);const mn=(J,de)=>{H(J),ne(de),ft(),I(Zx(J)),te.current=J},hn=()=>{z("playMode"),j(0),U(!0)},jn=async(J,de)=>{Xe(!1),b.current=!1,ot(J,de),await kc(J),await rt()!==!1&&(N(!1),hn(),await st(J))},zn=async(J,de=!1)=>{const ae=C.current;N(!0),P("measuring_duration");try{const ye=await cs(J,{timeoutMs:1e4,rejectOnError:!0});mn([{src:J,objectUrl:null,duration:ye}],ye),P("ready"),de&&ae&&await jn(ae,J)}finally{b.current=!1,N(!1)}},Wn=async(J,de=!1)=>{const ae=C.current;N(!0),P("measuring_duration");try{const ye=await Promise.all(J.map(ze=>cs(ze,{timeoutMs:1e4})));if(!ge.current)return;const Le=J.map((ze,ut)=>({src:ze,objectUrl:null,duration:ye[ut]||0}));mn(Le,Xx(Le)),P("ready"),de&&ae&&Le.length>0&&await jn(ae,Le[0].src)}finally{b.current=!1,N(!1)}},It=async(J=!1,de=!0)=>{const ae=C.current,ye=t?Array.isArray(t)?t:[t]:[];if(!ye||ye.length===0||!ye.some(Boolean))return!1;if(b.current)return null;b.current=!0,de&&N(!0),P("resolving");try{const Le=Jx(t,a,fi),ze=[];let ut=0;for(const yt of Le){let he=yt.src??null,T=null;if(!he&&yt.resolvedPath){try{P("getting_signed_url"),he=await Ci(yt.resolvedPath)}catch{he=null}if(!ge.current)return!1;if(!he)try{P("downloading");const ce=await gi(yt.resolvedPath);if(!ge.current)return!1;if(ce){const Ee=ce instanceof Blob?ce:new Blob([ce]);T=g.track(URL.createObjectURL(Ee)),he=T}}catch{P("error");try{De(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4.")),z("active")}catch{}}}if(!he)continue;let X=0;try{P("measuring_duration"),X=await cs(he,{timeoutMs:3e3})}catch{X=0}if(!ge.current){if(T)try{URL.revokeObjectURL(T)}catch{}for(const ce of ze)if(ce.objectUrl)try{URL.revokeObjectURL(ce.objectUrl)}catch{}return!1}ut+=X||0,ze.push({...yt,src:he,objectUrl:T,duration:X})}if(mn(ze,ut),ze.length>0&&J&&ae){const yt=ze[0];Xe(!1);try{g.keepOnly(ze.map(he=>he.objectUrl))}catch{}if(P("ready"),b.current=!1,yt.src&&ae)try{if(ot(ae,yt.src),await kc(ae),await rt()===!1)return!1;de&&N(!1),hn(),ae&&await st(ae)}catch{de&&N(!1)}else de&&N(!1);z("playMode"),j(0),U(!0)}return ze.length>0}finally{b.current=!1,de&&N(!1),P(Le=>Le==="ready"?"ready":"idle")}},vn=async J=>{const de=Ce.isRunning();if(J.paused&&!de){if(Be.current){await Ht();return}const ae=Ce.resume();if(ae){if(L("playing"),ae.phase==="tail"){jt(ae.elapsed);return}await st(J,3,50,ae.elapsed);return}await st(J),L("playing")}else Ce.pause(),nt(),J.pause(),L("paused"),de&&(qe(),Ct())},Ft=async()=>{const J=C.current;if(!(!J&&!se)){if(se){const de=window.speechSynthesis;if(q==="active"){const ae=Ba(),ye=Array.isArray(s)?s.filter(Boolean):s?[s]:[];if(ae&&ye.length>0){if(b.current)return;z("load"),N(!0),P("synthesizing"),b.current=!0;try{const Le=await Promise.all(ye.map(ze=>Promise.resolve(ae(ze))));Le.length>1?await Wn(Le,!0):await zn(Le[0],!0)}catch{b.current=!1,N(!1),z("active"),it(ye.length>0?ye:void 0)}return}it(ye.length>0?ye:void 0);return}if(q==="playMode"){const ae=!!de&&(de.speaking||de.paused)&&!(J&&(J.currentSrc||J.getAttribute("src")));if(J&&!ae){await vn(J);return}try{if(de&&de.paused)try{tt("tts"),de.resume(),L("playing")}catch{}else try{de.pause(),L("paused")}catch{}}catch{}}return}if(q==="active"){if(i&&Array.isArray(te.current)&&te.current.length>0){const ae=te.current[0];try{if(ae.src&&J)try{ot(J,ae.src),hn(),J&&await st(J)}catch{}hn();return}catch{}}z("load");let de;try{de=await It(!0)}catch{de=!1}if(de===!1&&ge.current){try{De(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."))}catch{}z("active")}return}if(q!=="load"&&(q==="playMode"||q==="active"))try{J&&await vn(J)}catch(de){(de instanceof Error||typeof de=="object"&&de&&"name"in de)&&de.name}}},Ht=async()=>{const J=C.current;if(J)try{const de=te.current;if(Array.isArray(de)&&de.length>1){await $t(0);return}Xe(!1);try{J.currentTime=0}catch{}J&&await st(J),L("playing"),z("playMode")}catch{}},Mn=()=>{nt(),xt(),Fe.current?.();const J=C.current;try{if(J){try{J.pause()}catch{}try{J.currentTime=0}catch{}}}catch{}Ct(),L("stopped"),z("active"),Z(0),U(!1)},on=async(J,{sameSegment:de=!1}={})=>{nt();const ae=Ce.generation(),ye=C.current,Le=te.current?.[J]?.src;try{if(Xe(!1),j(J),U(!0),ue.current=J,!Le||!ye||(de||ft(),ot(ye,Le),!de&&await rt()===!1)||!Ce.isCurrent(ae)||(await st(ye),!Ce.isCurrent(ae)))return;L("playing"),z("playMode")}catch{}},xn=async()=>{const J=te.current,de=ue.current||0;if(!J||de<=0){await Ht();return}await on(de-1)},Hn=async()=>{const J=te.current,de=ue.current||0;if(!J||de>=J.length-1){Mn();return}await on(de+1)},_n=()=>{if(Be.current)return;const J=200,de=340;Xe(!0),nt(),xt();try{Z(1)}catch{}mt(1);try{Q("hold")}catch{}try{const ae=C.current,ye=se&&!!ae?.src;if(!se||ye){if(ae){ae.pause();try{ae.currentTime=0}catch{}}}else gt();Ct()}catch{}try{L("stopped")}catch{}if(U(!1),!Ve.current)try{Ue.current&&(clearTimeout(Ue.current),Ue.current=null),Ue.current=setTimeout(()=>{try{Q("out")}catch{}Ue.current=setTimeout(()=>{try{typeof we.current=="function"&&we.current(!0)}catch{}try{Q("idle")}catch{}Ue.current=null},de)},J)}catch{}};o.useEffect(()=>{Qe.current=_n});const Vt=o.useCallback(()=>De(""),[]),$t=async J=>{(te.current||[])[J]&&await on(J,{sameSegment:J===ue.current})},qt=G==="playing",fn=o.useMemo(()=>{if(!W||W.length<=1)return W;const J=W[S];return J?[J]:W},[W,S]),Ot=i===!0;o.useEffect(()=>{try{const J=C.current;J&&typeof J.playbackRate=="number"&&et(J)}catch{}},[le,et]);const sn=o.useRef({raf:null,timer:null});o.useEffect(()=>{const J=C.current;if(!J)return;const de=Math.max(0,Math.min(1,Ae)),ae=sn.current,ye=()=>{ae.raf!==null&&(cancelAnimationFrame(ae.raf),ae.raf=null),ae.timer!==null&&(clearTimeout(ae.timer),ae.timer=null)};ye();const Le=Za(J);if(J.paused||Math.abs(Le-de)<.001||typeof requestAnimationFrame!="function"){try{Pn(J,de)}catch{}return}const ze=performance.now(),ut=()=>{const yt=Math.min(1,(performance.now()-ze)/150);try{Pn(J,Le+(de-Le)*yt)}catch{}ae.raf=yt<1?requestAnimationFrame(ut):null};return ae.raf=requestAnimationFrame(ut),ae.timer=setTimeout(()=>{ye();try{Pn(J,de)}catch{}},200),ye},[Ae]);const Dt=Y==="hold",ie=Y==="out",ve=q==="playMode"&&!D&&!je||Dt||ie,Me=G!=="stopped"||Dt||ie,Je=G==="paused",Oe=Math.max(0,Math.min(100,($||0)*100)),Ye=_e("audio-player__fill",ve?"is-visible":"",Me?"is-expanded":"",Je?"is-paused":"",ie?"is-out":"");return n.jsxs("div",{className:`audio-player ${Ot?"is-disabled":""}${l?` ${l}`:""}`,role:"group","aria-label":typeof f=="string"?f:void 0,children:[n.jsxs("div",{className:`audio-player__panel ${qt?"is-playing":""} ${D?"is-loading":""} ${q!=="default"?"is-revealed":""}`,children:[D?n.jsxs("div",{className:"audio-player__loading",role:Bc[O]?"status":void 0,"aria-live":Bc[O]?"polite":"off",children:[n.jsx("span",{className:"audio-player__loading-spinner","aria-hidden":"true"}),n.jsx("span",{className:"audio-player__loading-text",children:p(`training.audioStatus.${O}`,{defaultValue:t_[O]})})]}):null,q==="active"?n.jsx("button",{className:"audio-player__button",type:"button",disabled:Ot,onClick:()=>{V.current=hr(),E(),Ft()},"aria-label":typeof f=="string"?f:p("training.listen","\uB4E3\uAE30"),onMouseEnter:B,onMouseLeave:E,onFocus:B,onBlur:E,children:n.jsx("span",{ref:v,className:"audio-player__button-triangle-wrap",children:n.jsx("svg",{className:"audio-player__button-triangle",viewBox:"0 0 24 24","aria-hidden":"true",children:n.jsx("path",{ref:k,d:"M13.2 7.7 L16.5 9.85 Q20.2 12 16.5 14.15 L10 18.3 Q7 19.7 7 16.3 L7 7.7 Q7 4.3 10 5.7 L13.2 7.7"})})})}):null,w&&n.jsx(Bn,{anchorRect:w,text:typeof f=="string"&&f?f:p("training.listenLabel","\uBB38\uC7A5 \uB4E3\uAE30"),offset:8}),n.jsxs("div",{className:`audio-player__play ${q==="playMode"||qt?"is-visible":""}`,inert:!(q==="playMode"||qt)||void 0,children:[n.jsxs("div",{ref:_,className:"audio-player__buttons",children:[n.jsx(pe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"skip-back",onClick:xn,ariaLabel:p("training.prev","\uC774\uC804"),width:"60px",variant:"transparent-white","aria-hidden":"true",tabIndex:-1,disabled:q!=="playMode"}),n.jsx(pe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:qt?"pause":"play",onClick:Ft,ariaLabel:p("common.playPause","\uC7AC\uC0DD / \uBA48\uCDA4"),"aria-pressed":qt,width:"60px",variant:"transparent-white",disabled:q!=="playMode"}),n.jsx(pe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"square",onClick:Mn,ariaLabel:p("training.stop","\uC815\uC9C0"),width:"60px",variant:"transparent-white","aria-hidden":"true",tabIndex:-1,disabled:q!=="playMode"}),We>1?n.jsx("div",{ref:A,className:"audio-player__source-buttons",children:Array.from({length:We}).map((J,de)=>n.jsx(pe,{htmlType:"button",size:32,type:"dot",shape:"pill",useBorder:!1,label:String(de+1),onClick:()=>{try{$t(de)}catch{}},ariaLabel:p("training.sourcePlay",{n:de+1}),variant:"transparent-white",selected:F&&S===de,disabled:q!=="playMode"||!(Array.isArray(R)&&R[de]),showTooltipInfo:!0},de))}):null,!Array.isArray(R)||R.length<=1?n.jsx(pe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"repeat",onClick:Ht,ariaLabel:p("common.replay","\uB2E4\uC2DC\uB4E3\uAE30"),width:"60px",variant:"transparent-white",disabled:q!=="playMode"}):null,n.jsx(pe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"skip-forward",onClick:Hn,ariaLabel:p("training.next","\uB2E4\uC74C"),width:"60px",variant:"transparent-white","aria-hidden":!0,tabIndex:-1,disabled:q!=="playMode"}),n.jsx(pe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"check",onClick:_n,ariaLabel:p("common.done","\uC644\uB8CC"),width:"60px",variant:"transparent-white",disabled:q!=="playMode"})]}),n.jsxs("div",{className:"audio-player__slider",children:[n.jsx("div",{className:Ye,ref:h,style:{left:`${Oe}%`},"aria-hidden":"true"}),(u||c)&&n.jsx(e_,{segments:fn,progress:$,totalDuration:re,waveProgressRef:fe,showSoundWaveForm:u,leadInMs:d,tailMs:m,trackDurationSec:R?.[S]?.duration??0,noiseSrc:c&&y?.settings.enabled&&oe>0?dt:null,noiseRatio:y?qa(y.settings):0,noiseSpeed:y?.settings.speed??1,mainVolume:K,onReadyChange:ct})]})]}),n.jsx("audio",{ref:C,crossOrigin:"anonymous",preload:"auto"})]}),!u&&n.jsxs("p",{className:"audio-player__no-waveform caption-1",children:[n.jsx(at,{icon:"triangle-alert",size:14}),p("training.noSoundWaveform","\uC18C\uB9AC \uBE44\uAD50 \uBB38\uC81C\uB294 \uC6E8\uC774\uBE0C\uD3FC\uC744 \uD45C\uD604\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.")]}),n.jsx(da,{message:me,position:be,onClose:Vt})]})}function wr(e){const{t}=xe.useTranslation(),{text:a,label:r,anchorRect:i=null,onClose:s,closeOnOutsideClick:l=!0,isMobilePopup:u=!1}=e||{},[c,d]=o.useState(()=>{try{return localStorage.getItem("tooltip-theme")||"light"}catch{return"light"}});o.useEffect(()=>{try{localStorage.setItem("tooltip-theme",c)}catch{}},[c]);const{increase:m,decrease:p,canIncrease:f,canDecrease:y,fontSize:x,lineHeight:C}=Al({storageKey:"tooltip-fontScale"}),h=o.useCallback(()=>d(k=>k==="dark"?"light":"dark"),[]),_=o.useCallback(k=>{try{k.stopPropagation()}catch{}try{typeof s=="function"&&s()}catch{}},[s]),g=Array.isArray(a)?a:typeof a>"u"||a===null?[]:[a],A={fontSize:`${x}px`,lineHeight:`${C}px`,"--tt-line-height":`${C}px`,"--tt-marker-size":"28px"},b=n.jsxs("div",{className:`tooltip-textbox__root ${c==="dark"?"is-dark":""}`,children:[n.jsxs("div",{className:"tooltip-textbox__box",children:[r&&n.jsx("div",{className:"tooltip-textbox__label body-2b",children:r}),n.jsx("div",{className:"tooltip-textbox__text body-1",style:A,children:g.map((k,v)=>n.jsxs("div",{className:"tooltip-textbox__line",children:[g.length>1?n.jsx("div",{className:"tooltip-textbox__marker",children:n.jsx("span",{className:"tooltip-textbox__line-number button-1",children:v+1})}):null,n.jsx("span",{className:"tooltip-textbox__line-text",children:k})]},v))})]}),n.jsxs("div",{className:"tooltip-textbox__buttons",children:[n.jsx(pe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",useBorder:!1,width:48,icon:"minus",onClick:p,ariaLabel:t("training.fontSizeDecrease","\uAE00\uC790 \uD06C\uAE30 \uAC10\uC18C"),variant:c==="dark"?"transparent-white":"transparent-gray",disabled:!y}),n.jsx(pe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",useBorder:!1,width:48,icon:"plus",onClick:m,ariaLabel:t("training.fontSizeIncrease","\uAE00\uC790 \uD06C\uAE30 \uC99D\uAC00"),variant:c==="dark"?"transparent-white":"transparent-gray",disabled:!f}),n.jsx(pe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",useBorder:!1,width:48,icon:c==="dark"?"moon":"sun-medium",onClick:h,ariaLabel:t("training.toggleBackground","\uBC30\uACBD \uC804\uD658"),variant:c==="dark"?"transparent-white":"transparent-gray"}),n.jsx(pe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",useBorder:!1,width:48,icon:"x",onClick:_,ariaLabel:t("common.close","\uB2EB\uAE30"),variant:c==="dark"?"transparent-white":"transparent-gray"})]})]});return i?n.jsx(cn,{anchorRect:i,className:`tooltip-textbox ${c==="dark"?"is-dark":""}`,onClose:s,closeOnOutsideClick:l,isMobilePopup:u,ariaLabel:r||t("tooltip.textbox","\uBCF8\uBB38"),children:b}):n.jsx("div",{className:`tooltip-textbox ${c==="dark"?"is-dark":""}`,children:b})}function Nc({state:e="disabled"}){const{t}=xe.useTranslation();return n.jsxs("div",{className:`ts-bullet ts-bullet--${e}`,"aria-hidden":!0,children:[n.jsx("div",{className:"bullet__dot",children:n.jsx(at,{icon:"chevron-right",label:t("training.next","\uB2E4\uC74C"),className:"bullet__icon",imgClassName:"bullet__icon-img",maskClassName:"bullet__icon-mask",svgClassName:"bullet__icon-svg",wrapperStyle:{},size:20})}),n.jsx("div",{className:"ts-bullet__line"})]})}function Ec(e,t,a){const r=o.useRef(t),i=o.useRef(a);o.useEffect(()=>{r.current=t,i.current=a}),o.useEffect(()=>{if(!e||typeof document>"u")return;let s=null,l=10;const u=()=>{s=null;const c=r.current(),d=c?Array.from(c.querySelectorAll(Cn)).find(m=>!m.closest('[aria-hidden="true"]')):void 0;if(d){try{d.focus()}catch{}if(document.activeElement===d)return}--l>0&&(s=requestAnimationFrame(u))};return s=requestAnimationFrame(u),()=>{s!==null&&cancelAnimationFrame(s);const c=document.activeElement;if(!c||c===document.body||!document.contains(c)||c.closest(".tooltip-content")){const d=i.current();if(d)try{d.focus()}catch{}}}},[e])}function Dc({title:e,children:t,className:a="",state:r="disabled",usePreviewTextBtn:i=!1,onPreviewTextBtn:s,previewText:l=null,useFaded:u,usePlayAllBtn:c=!1,onPlayAll:d,playAllActive:m=!1}){const{t:p}=xe.useTranslation(),f=ln("(max-width: 767px)"),y=`training-step__title h4 ${u&&r==="disabled"?"training-step__title--faded":""} ${a}`.trim(),x=`training-step__title-row training-step__title-row--${r}`.trim(),C=o.useRef(null),[h,_]=o.useState(!1),[g,A]=o.useState(null),[b,k]=o.useState(null);Ec(h&&!!g,()=>{if(typeof document>"u")return null;const D=Array.from(document.querySelectorAll(".tooltip-content"));for(let N=D.length-1;N>=0;N--)if(D[N].querySelector(".tooltip-textbox__root"))return D[N];return null},()=>C.current?.querySelector("button")??null);const v=o.useRef(s);o.useEffect(()=>{v.current=s});const w=o.useMemo(()=>l==null?"":typeof l=="string"||typeof l=="number"?String(l):Array.isArray(l)&&l.every(D=>typeof D=="string"||typeof D=="number")?l.join(""):"",[l]),B=o.useCallback(()=>{_(!1),A(null),k(null)},[]);o.useEffect(()=>{if(!h)return;let D;try{typeof v.current=="function"&&(D=v.current())}catch{}if(D===!1){B();return}k(typeof D<"u"&&D!==null?D:null)},[w]);const E=o.useCallback(()=>{let D;try{typeof s=="function"&&(D=s())}catch{}if(D!==!1){if(k(typeof D<"u"&&D!==null?D:l),!C.current){_(N=>!N);return}if(h)_(!1),A(null),k(null);else{const N=C.current.getBoundingClientRect();A(N),_(!0)}}},[s,l,h]);return n.jsxs("div",{className:x,children:[n.jsx("p",{className:y,children:n.jsx("span",{className:"training-step__title-text",children:e??t})}),i||c?n.jsxs("div",{className:"title-controls",children:[n.jsxs("div",{className:"title-buttons",children:[c&&n.jsx(pe,{htmlType:"button",size:32,type:f?"dot":"bar",icon:"play-circle",label:f?void 0:p("training.playAll","\uBAA8\uB450 \uB4E3\uAE30"),ariaLabel:p("training.playAll","\uBAA8\uB450 \uB4E3\uAE30"),selected:m,onClick:d,variant:r==="disabled"?"disabled":"default",disabled:r==="disabled"||m,onDisabledClick:m&&r!=="disabled"?()=>{}:void 0}),i&&n.jsx("div",{ref:C,children:n.jsx(pe,{htmlType:"button",size:32,type:f?"dot":"bar",icon:"eye",label:f?void 0:p("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),ariaLabel:p("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),onClick:E,className:h?"is-selected":void 0,"aria-expanded":h,"aria-haspopup":"dialog",variant:r==="disabled"?"disabled":"default",disabled:!l&&typeof s!="function"})})]}),h&&n.jsx(wr,{text:b??l,label:p("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),anchorRect:g,onClose:B,closeOnOutsideClick:!1,isMobilePopup:!0})]}):null]})}function ps(e,t){return typeof t!="number"||typeof e!="number"?"disabled":e<t?"done":e===t?"active":"disabled"}function Jn({index:e,stepIndex:t,isLast:a=!1,title:r="",titleProps:i={},children:s,className:l="",onDone:u=void 0,useTitleFaded:c=void 0,lockedHint:d}){const{t:m}=xe.useTranslation(),[p,f]=o.useState(()=>ps(e,t));o.useEffect(()=>{const v=ps(e,t);if(v!==p){const w=setTimeout(()=>f(v),0);return()=>clearTimeout(w)}},[e,t,p]);const y=o.useCallback((...v)=>{ps(e,t)==="done"||p==="done"||typeof u=="function"&&u(...v)},[e,t,p,u]),[x,C]=o.useState(!1),[h,_]=o.useState({text:"",label:"\uBB38\uC7A5 \uB4E3\uAE30",anchorRect:null,backdrop:!1,alignX:null,alignY:null}),g=o.useCallback(v=>{if(!v)return null;try{const w=v;if(typeof v=="object"&&(w.currentTarget||w.target)&&(w.nativeEvent||w.type)){const D=w.currentTarget??w.target;if(D&&typeof D.getBoundingClientRect=="function")return D.getBoundingClientRect()}if(v instanceof DOMRect)return v;const B=v;if(B&&typeof B.getBoundingClientRect=="function")return B.getBoundingClientRect();const E=v?.current;return E&&typeof E.getBoundingClientRect=="function"?E.getBoundingClientRect():null}catch{return null}},[]),A=o.useCallback((v,{text:w="",label:B="\uBB38\uC7A5 \uB4E3\uAE30",backdrop:E=!1,alignX:D="center",alignY:N="top"}={})=>{const O=g(v);_({text:w,label:B,anchorRect:O,backdrop:E,alignX:D,alignY:N}),C(!0)},[g]),b=o.useCallback(()=>{C(!1),_(v=>({...v,anchorRect:null}))},[]),k=o.Children.map(s,v=>{if(o.isValidElement(v)){const w=v;if(typeof w.type=="string")return w;const B=w.props??{},E=typeof B.onDone=="function"?B.onDone:y,D=typeof B.disabled=="boolean";let N=p==="disabled";return D&&(N=!!B.disabled),o.cloneElement(w,{onDone:E,disabled:N,showTooltip:A,hideTooltip:b})}return v});return n.jsxs("div",{className:`training-step training-step--${p} ${a?"training-step--last":""} ${l}`,"aria-current":p==="active",children:[n.jsx(Nc,{state:p}),n.jsxs("div",{className:"training-step__content",children:[n.jsx(Dc,{state:p,title:r,...i,useFaded:c}),p==="disabled"&&d&&typeof e=="number"&&typeof t=="number"&&e===t+1&&n.jsx("p",{className:"training-step__locked-hint caption-1",role:"status",children:d}),k]}),x?n.jsx(cn,{anchorRect:h.anchorRect,backdrop:h.backdrop,onClose:b,ariaLabel:m("tooltip.textbox","\uBCF8\uBB38"),children:n.jsx(wr,{text:h.text,onClose:b})}):null]})}function Sc({context:e,state:t="disabled",theme:a="light"}){const{t:r}=xe.useTranslation(),[i,s]=o.useState("disabled"),[l,u]=o.useState(()=>{try{return localStorage.getItem("tooltip-theme")||a}catch{return a}});o.useEffect(()=>{try{localStorage.setItem("tooltip-theme",l)}catch{}},[l]);const c=()=>u(P=>P==="dark"?"light":"dark"),{increase:d,decrease:m,canIncrease:p,canDecrease:f,fontSize:y,lineHeight:x}=Al({storageKey:"textbox_fontScale"}),[C,h]=o.useState(""),_=o.useRef(null),g=o.useRef(!1),A=o.useCallback(()=>{g.current=hr()&&!!_.current&&_.current.contains(document.activeElement),s("active")},[]),b=o.useCallback(()=>h(""),[]),k=P=>{try{h(P)}catch{}},v=typeof navigator<"u"&&/Mobi|Android/i.test(navigator.userAgent||"");o.useEffect(()=>{if(t!=="disabled"){const P=setTimeout(()=>s(t),0);return()=>clearTimeout(P)}},[t]);const w=o.useMemo(()=>e&&typeof e=="object"?String(e.sentence??e.text??""):typeof e=="string"?e:"",[e]),[B,E]=o.useState(w);B!==w&&(E(w),s("disabled"));const D=t==="disabled"?i:t,N=D==="disabled"?"training-text-box--disabled":D==="active"?"training-text-box--active":D==="done"?"training-text-box--done":"",O=o.useMemo(()=>({fontSize:`${y}px`,lineHeight:`${x}px`}),[y,x]);return o.useEffect(()=>{if(D==="disabled"||!g.current)return;g.current=!1;const P=document.activeElement;P&&P!==document.body||_.current?.querySelector(".training-text-box__buttons button")?.focus()},[D]),n.jsxs("div",{ref:_,className:`training-text-box ${N} ${D!=="disabled"&&l==="dark"?"is-dark":""}`,children:[D==="disabled"&&n.jsx("div",{className:"training-text-box__preview",children:n.jsx(pe,{htmlType:"button",size:48,type:"bar",onClick:A,icon:"eye",ariaLabel:r("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),label:r("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),useBorder:!1})}),n.jsx("div",{className:"training-text-box__area","aria-hidden":D==="disabled",children:n.jsx("span",{className:"training-text-box__inner h3",style:O,children:w})}),D!=="disabled"&&n.jsxs("div",{className:"training-text-box__buttons","aria-hidden":D==="disabled",children:[n.jsx(pe,{htmlType:"button",size:32,type:"dot",onClick:m,onDisabledClick:()=>k(r("training.fontSizeMin","\uAE00\uC528 \uD06C\uAE30\uAC00 \uCD5C\uC18C\uC785\uB2C8\uB2E4.")),ariaLabel:r("training.fontSizeDecrease","\uAE00\uC790 \uD06C\uAE30 \uAC10\uC18C"),icon:"minus",variant:l==="dark"?"transparent-white":"transparent-gray",disabled:!f,useBorder:!1,showTooltipInfo:!0,...!v&&{width:"60px"}}),n.jsx(pe,{htmlType:"button",size:32,type:"dot",onClick:d,onDisabledClick:()=>k(r("training.fontSizeMax","\uAE00\uC528 \uD06C\uAE30\uAC00 \uCD5C\uB300\uC785\uB2C8\uB2E4.")),ariaLabel:r("training.fontSizeIncrease","\uAE00\uC790 \uD06C\uAE30 \uC99D\uAC00"),icon:"plus",variant:l==="dark"?"transparent-white":"transparent-gray",disabled:!p,useBorder:!1,showTooltipInfo:!0,...!v&&{width:"60px"}}),n.jsx(pe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",useBorder:!1,width:48,icon:l==="dark"?"moon":"sun-medium",onClick:c,ariaLabel:r("training.toggleBackground","\uBC30\uACBD \uC804\uD658"),variant:l==="dark"?"transparent-white":"transparent-gray"})]}),n.jsx(da,{message:C,position:"top",onClose:b})]})}function Qn(e){return e==="active"||e==="done"}function ms({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:i,useTitleFaded:s,onDone:l,onChange:u,answer:c,wrongAnswers:d,choices:m,multiSelect:p=!1,correctCount:f=0,useDisabledCovered:y=!1,choiceIcons:x,shuffleChoices:C=!0}){const{t:h}=xe.useTranslation(),_=i??h("training.selectConfirm","\uBB38\uC81C\uB97C \uBCF4\uACE0 \uD574\uB2F9\uD558\uB294 \uB0B4\uC6A9\uC744 \uC120\uD0DD\uD558\uC138\uC694."),g=typeof e=="number"?e:-1,A=typeof t!="number"?"disabled":g<t?"done":g===t?"active":"disabled",b=Array.isArray(m)&&m.length?m:typeof c<"u"?[c].concat(Array.isArray(d)?d:[]):void 0,k=d?d.join("||"):"",v=m?m.join("||"):"",[w,B]=o.useState(()=>Array.isArray(b)?C?Na(b):b.slice():void 0);o.useEffect(()=>{Array.isArray(b)&&b.length?B(C?Na(b):b.slice()):B(void 0)},[c,k,v,C]);const[E,D]=o.useState(null),[N,O]=o.useState(()=>new Set);o.useEffect(()=>{D(null),O(new Set)},[v,c,k]);const P=o.useRef(void 0);o.useEffect(()=>{const M=P.current;typeof M=="number"&&typeof t=="number"&&typeof e=="number"&&M>=e&&t<e&&(D(null),O(new Set)),P.current=t},[t,e]);const G=o.useCallback(M=>{if(!Qn(A))return;const $=w?.[M];if($==null)return;const Z=$;if(p){const q=new Set(N);q.has(Z)?q.delete(Z):q.add(Z),O(q),typeof u=="function"&&u({selectedValues:[...q],__ts:Date.now()}),typeof l=="function"&&l({selectedValues:[...q],__ts:Date.now()})}else D(Z),typeof u=="function"&&u({selectedIndex:M,selectedValue:Z,__ts:Date.now()}),typeof l=="function"&&l({selectedIndex:M,selectedValue:Z,__ts:Date.now()})},[w,A,p,u,N]),L=`training-step__buttons${Array.isArray(w)&&w.length>3?" training-step__buttons--wrap-3":""}`;return n.jsx(Jn,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:_,useTitleFaded:s,children:n.jsx("div",{className:L,children:Array.isArray(w)&&w.length>0?w.map((M,$)=>n.jsx(pe,{htmlType:"button",size:56,type:"bar",onClick:()=>G($),ariaLabel:String(M),label:M,useLabel:!0,icon:x?x[String(M)]:void 0,variant:"default",disabled:A==="disabled",selected:p?N.has(M):E===M,useDisabledCovered:y,minWidth:0},String(M))):null})})}function hs({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:i,onDone:s,onChange:l,context:u,demoSelected:c}){const{t:d}=xe.useTranslation(),m=i??d("training.confirmTitle","\uBB38\uC7A5\uC744 \uD655\uC778\uD558\uACE0 \uC798 \uB4E4\uB838\uB294\uC9C0 \uC120\uD0DD\uD558\uC138\uC694."),p=typeof e=="number"?e:-1,f=typeof t!="number"?"disabled":p<t?"done":p===t?"active":"disabled",y=u&&typeof u=="object"?u.sentence||"":typeof u=="string"?u:"",x=u&&typeof u=="object"?u.choices:void 0,[C,h]=o.useState(c??null),_=`${String(y)}\0${JSON.stringify(x??null)}`,[g,A]=o.useState(_);g!==_&&(A(_),c==null&&h(null));const[b,k]=o.useState(c);Object.is(b,c)||(k(c),h(c??null));const v=o.useRef(void 0);o.useEffect(()=>{const D=v.current;typeof D=="number"&&typeof t=="number"&&typeof e=="number"&&D>=e&&t<e&&c==null&&h(null),v.current=t},[t,e,c]);const w=o.useCallback(D=>{const N=typeof D=="object"&&D!==null?Object.assign({},D,{__ts:Date.now()}):{value:D,__ts:Date.now()};typeof l=="function"&&l(N),Qn(f)&&typeof s=="function"&&s(N)},[l,f,s]),B=o.useCallback(()=>{Qn(f)&&(h(!1),w(!1))},[w,f]),E=o.useCallback(()=>{Qn(f)&&(h(!0),w(!0))},[w,f]);return n.jsxs(Jn,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:m,onDone:s,useTitleFaded:!1,children:[n.jsx(Sc,{context:u,state:f}),n.jsx("div",{className:"training-step__buttons",children:Array.isArray(x)&&x.length>0?x.slice(0,6).map((D,N)=>n.jsx(pe,{htmlType:"button",size:56,type:"bar",onClick:()=>{Qn(f)&&(h(N),w&&w(N))},disabled:f==="disabled",ariaLabel:String(D),label:D,variant:f,selected:C===N},N)):n.jsxs(n.Fragment,{children:[n.jsx(pe,{htmlType:"button",size:56,type:"bar",onClick:B,disabled:f==="disabled",icon:"x",ariaLabel:d("training.notHeard","\uC548 \uB4E4\uB838\uC5B4\uC694."),label:d("training.notHeard","\uC548 \uB4E4\uB838\uC5B4\uC694."),variant:"default",selected:C===!1}),n.jsx(pe,{htmlType:"button",size:56,type:"bar",onClick:E,disabled:f==="disabled",icon:"circle",ariaLabel:d("training.heardWell","\uC798 \uB4E4\uB838\uC5B4\uC694."),label:d("training.heardWell","\uC798 \uB4E4\uB838\uC5B4\uC694."),variant:"default",selected:C===!0})]})})]})}function fs({index:e,stepIndex:t,isLast:a=!1,title:r,onDone:i,btnLabel:s,soundSrc:l,bucketPath:u,usePreviewTextBtn:c,previewText:d=null,onPreviewTextBtn:m,disabled:p,_pageIndex:f,showSoundWaveForm:y,showNoiseWaveForm:x,leadInMs:C,tailMs:h}){const{t:_}=xe.useTranslation(),g=r??_("training.listenTitle","\uC81C\uC2DC\uD558\uB294 \uBB38\uC7A5\uC744 \uB4E4\uC5B4\uC8FC\uC138\uC694."),A=p??(typeof t=="number"&&typeof e=="number"?e>t:!1);return n.jsx(Jn,{index:e,stepIndex:t,isLast:a,title:g,onDone:i,titleProps:{usePreviewTextBtn:c,previewText:d,onPreviewTextBtn:m},children:n.jsx(ds,{soundSrc:l,ttsText:l?null:d??g,bucketPath:u,btnLabel:s||_("training.listenButton","\uBB38\uC7A5 \uB4E3\uAE30"),disabled:A,className:"training-step__listen-sticky",showSoundWaveForm:y,showNoiseWaveForm:x,leadInMs:C,tailMs:h},`audio-p${f??0}-s${e}`)})}const c_=[];function Cs({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:i,onDone:s,onChange:l,context:u=c_}){const{t:c}=xe.useTranslation(),d=i??c("training.orderListDefault","\uBB38\uC7A5\uC744 \uB4E4\uC740 \uC21C\uC11C\uB300\uB85C \uBC30\uCE58\uD558\uC138\uC694."),m=I=>typeof I=="string"?I:I&&(I.context||I.sentence||I.question||"")||"",[p,f]=o.useState(Array.isArray(u)?u:[]),[y,x]=o.useState(()=>(p||[]).map((I,S)=>({id:S,text:m(I)}))),C=o.useMemo(()=>typeof t!="number"||typeof e!="number"?"disabled":e<t?"done":e===t?"active":"disabled",[t,e]),h=C!=="disabled",_=o.useRef(void 0),g=o.useRef(void 0);o.useEffect(()=>{if(_.current===u)return;_.current=u;const I=Array.isArray(u)?u:[];f(I);const S=(j=>{const F=(j||[]).map((le,K)=>({id:K,text:m(le)}));if(F.length<=1)return F;const U=(le,K)=>{if(le.length!==K.length)return!1;for(let oe=0;oe<le.length;oe++)if(le[oe].text!==K[oe].text)return!1;return!0};let re=Na(F),ne=0;for(;U(re,F)&&ne<20;)re=Na(F),ne+=1;return re})(I);x(S);try{if(typeof l=="function"){const j=S.filter((F,U)=>F.text===m(I[U])).length;l({shuffled:S,score:j,total:(I||[]).length,initial:!0,__ts:Date.now()})}if(typeof s=="function"&&C==="active"){const j=S.filter((F,U)=>F.text===m(I[U])).length;g.current=u,s({shuffled:S,score:j,total:(I||[]).length,initial:!0,__ts:Date.now()})}}catch{}},[u]),o.useEffect(()=>{if(C!=="active"||g.current===u||(g.current=u,typeof s!="function"))return;const I=Array.isArray(u)?u:[],S=y.filter((j,F)=>j.text===m(I[F])).length;s({shuffled:y,score:S,total:I.length,initial:!0,__ts:Date.now()})},[C,u]);const A=(I,S)=>{const j=[...y],F=I+S;if(F<0||F>=j.length)return;const U=j[F];j[F]=j[I],j[I]=U,Z(j);try{if(typeof s=="function"&&C==="active"){const re=j.filter((ne,le)=>ne.text===m(p[le])).length;s({shuffled:j,score:re,total:(p||[]).length,__ts:Date.now()})}}catch{}},[b,k]=o.useState(null),v=o.useRef(null),w=o.useRef(null),B=o.useRef(null),E=o.useRef(null),D=o.useRef(null),N=o.useRef({x:0,y:0}),O=o.useRef(null),P=o.useRef({dx:0,dy:0}),G=()=>{if(O.current!==null)return;const I=()=>{if(!v.current){O.current=null;return}O.current=requestAnimationFrame(I);const S=N.current,j=P.current||{dx:0,dy:0};v.current&&(v.current.style.transform=`translate3d(${S.x-j.dx}px, ${S.y-j.dy}px, 0)`)};O.current=requestAnimationFrame(I)},L=o.useRef(new Map),M=o.useRef(new Map),$=()=>{const I=new Map;return L.current.forEach((S,j)=>{S&&S.getBoundingClientRect&&I.set(j,S.getBoundingClientRect())}),I},Z=I=>{const S=$();x(I);try{if(typeof l=="function"){const j=I.filter((F,U)=>F.text===m(p[U])).length;l({shuffled:I,score:j,total:(p||[]).length,__ts:Date.now()})}}catch{}requestAnimationFrame(()=>{const j=$();I.forEach(F=>{const U=S.get(F.id),re=j.get(F.id),ne=L.current.get(F.id);if(!ne||!U||!re)return;const le=U.top-re.top;le&&(ne.style.transition="none",ne.style.transform=`translateY(${le}px)`,requestAnimationFrame(()=>{ne.style.transition="transform 420ms cubic-bezier(.22,.9,.39,1)",ne.style.transform="";const K=()=>{ne.style.transition="",ne.removeEventListener("transitionend",K)};ne.addEventListener("transitionend",K)}))})})},q=(I,S)=>{try{try{S.dataTransfer?.setData("text/plain",String(I))}catch{}try{S.dataTransfer&&(S.dataTransfer.effectAllowed="move")}catch{}try{const j=document.createElement("div");j.style.cssText="position:absolute;top:-9999px;left:-9999px;width:1px;height:1px;opacity:0;pointer-events:none;",document.body.appendChild(j),S.dataTransfer?.setDragImage(j,0,0),requestAnimationFrame(()=>{try{document.body.removeChild(j)}catch{}})}catch{}}catch{}k(I);try{const j=y[I],F=document.createElement("div");F.className="order-list__dragging-object order-list__dragging-object--visible",F.textContent=j&&j.text?j.text:"",document.body.appendChild(F),v.current=F;const U=L.current.get(j.id);let re=S.clientX||0,ne=S.clientY||0;try{if(U&&U.getBoundingClientRect){const Q=U.getBoundingClientRect();re=Q.left+Q.width/2,ne=Q.top+Q.height/2}}catch{}const le=F.getBoundingClientRect(),K=le.width/2,oe=le.height/2;P.current={dx:K,dy:oe},F.style.transition="none",N.current={x:re,y:ne},F.style.transform=`translate3d(${re-K}px, ${ne-oe}px, 0)`,requestAnimationFrame(()=>{try{F.style.transition=""}catch{}G()});const Ae=Q=>{const me=Q;N.current={x:me.clientX,y:me.clientY},G()};B.current=Ae,document.addEventListener("mousemove",Ae);const Y=Q=>{const me=Q;N.current={x:me.clientX,y:me.clientY},G()};w.current=Y,document.addEventListener("dragover",Y);try{S.dataTransfer?.setData("text/plain",String(I));try{S.dataTransfer?.setData("application/json",JSON.stringify({idx:I}))}catch{}}catch{}}catch{}},z=(I,S)=>{S.preventDefault();try{S.dataTransfer&&(S.dataTransfer.dropEffect="move")}catch{}try{D.current!==null&&(clearTimeout(D.current),D.current=null);const j=S.currentTarget&&S.currentTarget.closest?S.currentTarget.closest(".order-list__item"):null;if(j&&E.current!==j){if(E.current)try{E.current.classList.remove("drag-over")}catch{}try{j.classList.add("drag-over")}catch{}E.current=j}}catch{}},V=(I,S)=>{S.preventDefault();const j=S.dataTransfer?.getData("text/plain")||"",F=j?parseInt(j,10):b,U=I;if(typeof F!="number"||isNaN(F)||F===U){k(null),W(),R();return}const re=hC(y,F,U);Z(re),k(null),R();try{if(typeof s=="function"&&C==="active"){const ne=re.filter((le,K)=>le.text===m(p[K])).length;s({shuffled:re,score:ne,total:(p||[]).length,__ts:Date.now()})}}catch{}try{requestAnimationFrame(()=>{const ne=document.querySelectorAll(".order-list .order-list__item")[U];if(!ne)return;const le=ne.querySelector(".order-list__slot")||ne;try{le.classList.add("pulse"),le.offsetHeight,le.classList.add("to-dark");const K=()=>{le.classList.remove("pulse","to-dark"),le.removeEventListener("transitionend",K)};le.addEventListener("transitionend",K)}catch{}})}catch{}W()},R=()=>{if(v.current){try{document.body.removeChild(v.current)}catch{}v.current=null}w.current&&(document.removeEventListener("dragover",w.current),w.current=null),B.current&&(document.removeEventListener("mousemove",B.current),B.current=null),O.current!==null&&(cancelAnimationFrame(O.current),O.current=null)},H=()=>{k(null),W(),R()};o.useEffect(()=>()=>R(),[]);const W=()=>{try{if(D.current!==null&&(clearTimeout(D.current),D.current=null),E.current){try{E.current.classList.remove("drag-over")}catch{}E.current=null}document.querySelectorAll(".order-list .order-list__item").forEach(I=>I.classList.remove("drag-over"))}catch{}};return o.useEffect(()=>{try{const I=Math.max(1,(y||[]).length);y.forEach((S,j)=>{const F=M.current.get(S.id);if(!F)return;let U=50;I>1&&(U=Math.round(j/(I-1)*100));try{F.style.setProperty("--marker-pos",U+"%")}catch{}})}catch{}},[y]),o.useEffect(()=>()=>{R(),D.current!==null&&(clearTimeout(D.current),D.current=null)},[]),n.jsx(Jn,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:d,children:n.jsx("div",{className:"order-list",children:y.map((I,S)=>{const j=Math.max(1,(y||[]).length),F=j>1?Math.round(S/(j-1)*100):50;return n.jsx("div",{className:"order-list__item",children:n.jsxs("div",{className:"order-list__slot","data-disabled":C==="disabled","aria-disabled":C==="disabled",children:[C!=="disabled"?n.jsx("div",{className:"order-list__marker caption-1",style:{"--marker-pos":F+"%"},ref:U=>{const re=M.current;U?re.set(I.id,U):re.delete(I.id)},children:n.jsx("span",{className:"order-list__slot-number button-1",children:S+1})}):null,n.jsxs("div",{ref:U=>{const re=L.current;U?re.set(I.id,U):re.delete(I.id)},className:`order-list__draggable ${b===S?"dragging":""}`,"data-disabled":C==="disabled","aria-disabled":C==="disabled",tabIndex:C==="disabled"?-1:0,draggable:h,onDragStart:h?U=>q(S,U):void 0,onDragEnter:h?U=>z(S,U):void 0,onDragOver:h?U=>z(S,U):void 0,onDragLeave:h?()=>{try{D.current!==null&&clearTimeout(D.current),D.current=setTimeout(()=>{try{const U=document.querySelectorAll(".order-list .order-list__item");U&&U[S]&&(U[S].classList.remove("drag-over"),E.current===U[S]&&(E.current=null))}catch{}},80)}catch{}}:void 0,onDrop:h?U=>V(S,U):void 0,onDragEnd:h?H:void 0,children:[n.jsx("span",{className:"order-list__item-text body-2",children:I.text}),h?n.jsxs("span",{className:"order-list__item-buttons",children:[n.jsx(pe,{htmlType:"button",size:32,type:"dot",onClick:()=>A(S,-1),ariaLabel:c("training.up"),icon:"chevron-up",variant:"transparent-gray",width:48,useFaded:"true",disabled:S===0,useBorder:!1,useDisabledInvisible:!0}),n.jsx(pe,{htmlType:"button",size:32,type:"dot",onClick:()=>A(S,1),ariaLabel:c("training.down"),icon:"chevron-down",variant:"transparent-gray",width:48,useFaded:"true",disabled:S===y.length-1,useBorder:!1,useDisabledInvisible:!0})]}):null]})]})},I.id)})})})}const d_=8e3;function p_(e,t){return new Promise(a=>{let r=!1;const i=()=>{r||(r=!0,a())};e.then(i,i),setTimeout(i,t)})}function Tc({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:i,onDone:s,onChange:l,context:u=[],selectable:c=!1,hideLabel:d=!1,hideAudio:m=!1,maxCards:p,playAllGapMs:f=0}){const{t:y}=xe.useTranslation(),x=i??y("training.cardInstructions","\uB0B1\uB9D0 \uCE74\uB4DC\uB97C \uBCF4\uACE0 \uC18C\uB9AC\uB97C \uB4E3\uACE0 \uD655\uC778\uD558\uC138\uC694."),C=o.useMemo(()=>Array.isArray(u)?u:u&&u.items||[],[u]),h=p??3,_=(C||[]).slice(0,h);(C||[]).length>h&&console.warn(`TrainingStepCard: ${C.length} items passed but only ${h} shown`);const g=typeof e=="number"?e:-1,A=typeof t!="number"?"disabled":g<t?"done":g===t?"active":"disabled",[b,k]=o.useState(null),v=o.useRef([]),[w,B]=o.useState(!1),E=o.useRef(null),D=o.useRef(!0);o.useEffect(()=>(D.current=!0,()=>{D.current=!1}),[]);const N=o.useMemo(()=>C.map($=>$?.id??$?.word??"").join("|"),[C]);o.useEffect(()=>{k(null)},[N]);const O=o.useRef(void 0);o.useEffect(()=>{const $=O.current;typeof $=="number"&&typeof t=="number"&&typeof e=="number"&&$>=e&&t<e&&k(null),O.current=t},[t,e]);const P=o.useCallback(($,Z)=>{if(c)return;const q={item:$,index:Z,__ts:Date.now()};try{typeof l=="function"&&l(q)}catch{}if(A==="active"&&typeof s=="function")try{s(q)}catch{}},[c,l,A,s]),G=o.useRef(f);o.useEffect(()=>{G.current=Math.max(0,f||0)},[f]);const L=o.useCallback(async()=>{if(w||A==="disabled")return;B(!0);let $=!1;const Z=new Promise(q=>{E.current=()=>{$=!0,q()}});try{for(let q=0;q<_.length&&!(!D.current||$);q++){const z=v.current[q];if(!z)continue;await Promise.race([p_(z.play(),d_),Z]);const V=Math.max(0,G.current||0);V>0&&q<_.length-1&&!$&&D.current&&await Promise.race([new Promise(R=>{setTimeout(R,V)}),Z])}}finally{E.current=null,B(!1)}},[w,A,_.length]),M=o.useCallback(($,Z)=>{if(!Qn(A))return;k(Z);const q={selectedValue:$.word||$.title||"",selectedIndex:Z,item:$,__ts:Date.now()};try{typeof l=="function"&&l(q)}catch{}if(typeof s=="function")try{s(q)}catch{}},[l,A,s]);return n.jsx(Jn,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:x,onDone:s,titleProps:{usePlayAllBtn:!m&&_.length>0,onPlayAll:L,playAllActive:w},children:n.jsx("div",{className:"training-step__cards",onClickCapture:$=>{const Z=E.current;if(!Z)return;const q=$.target;q&&typeof q.closest=="function"&&q.closest(".training-word-card__bottom")&&Z()},children:_.length===0?n.jsx("div",{className:"training-step__empty",children:y("training.noCards","\uCE74\uB4DC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")}):_.map(($,Z)=>n.jsx(Go,{ref:q=>{v.current[Z]=q},item:$,disabled:A==="disabled",onPlayDone:()=>P($,Z),selectable:c,selected:c&&b===Z,onSelect:c?()=>M($,Z):void 0,flipDelay:Z*120,hideLabel:d,hideAudio:m},$&&$.id||Z))})})}const m_=160,jc=()=>{};function Sn(e){const t=o.useId();if(!("variant"in e)){const{label:g,sub:A,onClick:b,children:k,align:v="horizontal",icon:w,useFullWidth:B=!1}=e,E=D=>{b&&D.target===D.currentTarget&&(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),b())};return n.jsxs("div",{className:_e("panel-row",v==="vertical"?"panel-row--vertical":"",B?"panel-row--label-fixed panel-row--fill":"",b?"panel-row--clickable":""),onClick:b,onKeyDown:b?E:void 0,role:b?"button":void 0,tabIndex:b?0:void 0,children:[w!=null&&n.jsx("div",{className:"panel-row__icon",children:w}),g!=null&&n.jsxs("div",{className:"panel-row__left",children:[n.jsx("div",{className:"panel-row__label body-3",children:g}),A&&n.jsx("div",{className:"panel-row__sub caption-1",children:A})]}),n.jsx("div",{className:"panel-row__right",children:k})]})}if(e.variant==="description")return n.jsx("div",{className:"panel-row panel-row--block",children:n.jsx("p",{className:"panel-row__description body-3",children:e.children})});if(e.variant==="empty")return n.jsx("div",{className:"panel-row panel-row--empty body-3",children:e.children});if(e.variant==="loading")return n.jsx("div",{className:"panel-row panel-row--loading",children:n.jsx(za,{size:28})});if(e.variant==="custom"&&!e.label)return n.jsx("div",{className:"panel-row panel-row--block",children:e.children});const{variant:a,label:r,sub:i,onClick:s,required:l,error:u,align:c="horizontal",useFullWidth:d=!1,icon:m}=e,p=a==="button"?void 0:s;let f=null;const y=a==="toggle"?`panel-toggle-${t}`:void 0,x=u?`panel-error-${t}`:void 0,C=`panel-helper-${t}`;if(a==="toggle"){const g=e;f=n.jsx(hu,{checked:g.checked,onChange:g.onChange,id:y})}else if(a==="segmented"){const g=e;f=n.jsx(gn,{options:g.options,value:g.value,onChange:g.onChange,size:g.size??40,ariaLabel:r})}else if(a==="dropdown"){const g=e,A=g.dropdowns?.length?n.jsx("div",{className:`panel-row__dropdown-group${d?" panel-row__dropdown-group--full":""}`,children:g.dropdowns.map((b,k)=>n.jsx("div",{className:d?"panel-row__dropdown-item--full":void 0,children:n.jsx(pn,{options:b.options,value:b.value,onChange:b.onChange,placeholder:b.placeholder,block:d,error:!!u,ariaDescribedBy:x,ariaLabel:b.ariaLabel??([r,b.placeholder].filter(Boolean).join(" ")||void 0)})},k))}):n.jsx(pn,{options:g.options??[],value:g.value??"",onChange:g.onChange??jc,block:d,error:!!u,ariaLabel:r,ariaDescribedBy:x});f=u?n.jsxs("div",{className:`panel-row__dropdown-error-wrap${d?" panel-row__dropdown-error-wrap--full":""}`,children:[A,n.jsx("span",{id:x,className:"caption-1 panel-row__error",role:"alert",children:u})]}):A}else if(a==="button"){const g=e;g.buttons?.length?f=n.jsx("div",{className:"panel-row__button-group",children:g.buttons.map((A,b)=>n.jsx(pe,{htmlType:"button",size:A.btnSize??40,variant:A.btnVariant??"default",disabled:A.disabled,onClick:A.onClick,children:A.label},b))}):f=n.jsx(pe,{htmlType:"button",size:g.btnSize??40,variant:g.btnVariant??"default",disabled:g.disabled,onClick:g.onClick,children:g.buttonLabel})}else if(a==="text"){const g=e;f=n.jsx("span",{className:`panel-row__text body-2${d?" panel-row__text--full":""}`,style:g.valueColor?{color:g.valueColor}:void 0,children:g.value})}else if(a==="input"){const g=e;f=n.jsxs("div",{className:`panel-row__input-wrap${d?" panel-row__input-wrap--full":""}`,children:[n.jsx(Xn,{value:g.value,onChange:g.onChange??jc,onKeyDown:g.onKeyDown,onEnter:g.onEnter,placeholder:g.placeholder,ghostText:g.ghostText,ghostHint:g.ghostHint,inputMode:g.inputMode,readOnly:g.readOnly,disabled:g.disabled,type:g.type,autoComplete:g.autoComplete,maxLength:g.maxLength,showCount:g.showCount,multiline:g.multiline,rows:g.rows,fullWidth:d,error:u,ariaLabel:r,required:l,ariaDescribedBy:g.helperText?C:void 0}),g.helperText&&n.jsx("div",{id:C,className:"panel-row__helper caption-1",children:g.helperText})]})}else a==="custom"&&(f=e.children);u&&a!=="input"&&a!=="dropdown"&&(f=n.jsxs("div",{className:`panel-row__dropdown-error-wrap${d?" panel-row__dropdown-error-wrap--full":""}`,children:[f,n.jsx("span",{id:x,className:"caption-1 panel-row__error",role:"alert",children:u})]}));const h=a==="input"||a==="dropdown"||(a==="text"||a==="custom")&&d,_=g=>{p&&g.target===g.currentTarget&&(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),p())};return n.jsxs("div",{className:_e("panel-row",c==="vertical"?"panel-row--vertical":"",h?"panel-row--label-fixed":"",a==="text"?"panel-row--text":"",p?"panel-row--clickable":""),onClick:p,onKeyDown:p?_:void 0,role:p?"button":void 0,tabIndex:p?0:void 0,children:[m!=null&&n.jsx("div",{className:"panel-row__icon",children:m}),n.jsxs("div",{className:"panel-row__left",children:[y?n.jsxs("label",{htmlFor:y,className:"panel-row__label body-3",children:[r,l&&n.jsx("span",{className:"required-mark",children:"*"})]}):n.jsxs("div",{className:"panel-row__label body-3",children:[r,l&&n.jsx("span",{className:"required-mark",children:"*"})]}),i&&n.jsx("div",{className:"panel-row__sub caption-1",children:i})]}),n.jsx("div",{className:"panel-row__right",children:f})]})}function Mc(e){const t=e.productName||e.brand,a=[e.brand,e.fitType].filter(r=>!!r&&r!==t);return[...new Set(a)].join(" \xB7 ")}function h_({devices:e,onRelease:t,emptyLabel:a}){const{t:r,i18n:i}=xe.useTranslation();return n.jsx("div",{className:"panel-row panel-row--device",children:["left","right"].map(s=>{const l=e[s],u=s==="left"?r("device.direction.left","\uC88C"):r("device.direction.right","\uC6B0");return n.jsxs("div",{className:"panel-row__device-column",children:[n.jsxs("div",{className:"panel-row__device-head",children:[n.jsx("span",{className:"panel-row__device-side body-2b",children:u}),l&&t&&n.jsx(pe,{htmlType:"button",size:32,type:"dot",icon:"x",ariaLabel:`${u} ${r("customers.device.unwear","\uCC29\uC6A9 \uD574\uC81C")}`,showTooltipInfo:r("customers.device.unwear","\uCC29\uC6A9 \uD574\uC81C"),onClick:()=>t(s)})]}),l?n.jsxs("div",{className:"panel-row__device-info",children:[n.jsxs("span",{className:"panel-row__device-kind",children:[l.device&&n.jsx(At,{size:"small",variant:Mu(l.device),fill:"soft",label:Lu(l.device,r)}),Mc(l)&&n.jsx("span",{className:"panel-row__device-detail body-3",children:Mc(l)})]}),n.jsx("span",{className:"panel-row__device-name body-2b",children:l.productName||l.brand}),Vo(l.wornYear,l.wornMonth,l.wornDay,i.language)&&n.jsx("span",{className:"panel-row__device-date caption-1",children:r("customers.device.wornSince",{date:Vo(l.wornYear,l.wornMonth,l.wornDay,i.language)})})]}):n.jsx("span",{className:"panel-row__device-empty body-3",children:a??r("customers.device.notRegistered","\uBBF8\uB4F1\uB85D")})]},s)})})}function Br({title:e,titleLevel:t=2,icon:a,disc:r,actions:i,size:s="medium",minHeight:l,maxWidth:u,className:c,scrollable:d,scrollbarGutter:m="auto",compactRows:p=!1,useBorder:f=!0,useBg:y=!0,useRowBorder:x=!0,labelWidth:C,form:h=!1,loading:_,empty:g,children:A}){const b=_e("panel",`panel--${s}`,h?"panel--form":"",l!==void 0?"panel--fill":"",f?"":"panel--no-border",y?"":"panel--no-bg",x?"":"panel--no-row-border",p?"panel--compact-rows":"",c),k={};l!==void 0&&(k.minHeight=l),u!==void 0&&(k.maxWidth=typeof u=="number"?`${u}px`:u),C!==void 0&&(k["--panel-label-width"]=typeof C=="number"?`${C}px`:C);const v=t?`h${t}`:"div";return n.jsxs("div",{className:b,style:Object.keys(k).length?k:void 0,children:[(!!e||r!=null)&&n.jsxs("div",{className:_e("panel__header",r!=null?"panel__header--with-disc":""),children:[a&&n.jsx(at,{icon:a,label:typeof e=="string"?e:void 0,className:"panel__icon"}),n.jsxs("div",{className:"panel__title-group",children:[!!e&&n.jsx(v,{className:`panel__title ${r!=null?"body-3b":"h5b"}`,children:e}),r!=null&&n.jsx("p",{className:"panel__disc caption-1",children:r})]}),i&&n.jsx("div",{className:"panel__actions",children:i})]}),_?n.jsx(Sn,{variant:"loading"}):g!=null&&o.Children.toArray(A).length===0?n.jsx(Sn,{variant:"empty",children:g}):d?n.jsx("div",{className:_e("panel__body--scroll",m==="stable"&&"panel__body--gutter-stable"),children:A}):A]})}function f_({cols:e=2,layout:t="grid",gap:a=1,collapseAt:r,className:i,style:s,children:l}){const u=o.useRef(null),[c,d]=o.useState();o.useEffect(()=>{const p=u.current;if(r===void 0||!p||(d(p.clientWidth),typeof ResizeObserver>"u"))return;const f=new ResizeObserver(([y])=>d(y.contentRect.width));return f.observe(p),()=>f.disconnect()},[r]);const m=r!==void 0&&c!==void 0&&c<=r;return n.jsx("div",{ref:u,className:_e("panel-grid",t==="columns"&&"panel-grid--columns",i),style:{"--panel-grid-cols":m?1:e,"--panel-grid-gap":typeof a=="number"?`${a}px`:a,...s},children:l})}function C_(e){return[{label:e("training.noise.level.none","\uC5C6\uC74C"),value:0},{label:e("training.noise.level.weak","\uC57D\uD568"),value:1},{label:e("training.noise.level.medium","\uBCF4\uD1B5"),value:2},{label:e("training.noise.level.strong","\uAC15\uD568"),value:3},{label:e("training.noise.level.veryStrong","\uB9E4\uC6B0 \uAC15\uD568"),value:4}]}function Lc(e){return[{label:e("training.noise.type.default","\uAE30\uBCF8"),value:"defaultNoise",icon:"party-popper"},{label:e("training.noise.type.street","\uAE38\uAC70\uB9AC"),value:"street",icon:"car"},{label:e("training.noise.type.buzz","\uC640\uAE00\uC640\uAE00"),value:"buzz",icon:"message-square-more"},{label:e("training.noise.type.restaurant","\uC2DD\uB2F9"),value:"restaurant",icon:"coffee"}]}C_(Rt.t.bind(Rt)),Lc(Rt.t.bind(Rt));const kr="none",g_=.5,b_=1.5,y_=.25;function gs({title:e,valueLabel:t,value:a,min:r,max:i,step:s,tickStep:l,size:u,disabled:c,onChange:d}){return n.jsxs(Sn,{variant:"custom",label:e,useFullWidth:!0,children:[n.jsx(Nu,{value:a,onChange:d,min:r,max:i,step:s,size:u,showBgTick:!0,tickStep:l,ariaLabel:e,disabled:c,className:"noise-settings__slider-input"}),n.jsx("div",{className:_e("noise-settings__value","button-1",c?"noise-settings__value--disabled":""),children:t})]})}function $c({anchorRect:e,onClose:t,hideNoiseRows:a=!1}){const{t:r}=xe.useTranslation(),i=ln("(max-width: 767px)")?40:24,s=yr(),l=qa(s?.settings??Ga),u=s?.settings.type??"defaultNoise",c=s?.settings.enabled??!0,d=s?.playbackRate??1,m=s?.mainVolume??1,p=Math.round(m*100),f=o.useCallback(_=>{try{s?.setMainVolume(Math.max(0,Math.min(1,_/100)))}catch{}},[s]),y=o.useCallback(_=>{try{s?.setPlaybackRate(_)}catch{}},[s]),x=o.useCallback(_=>{const g=Math.min(Va,Math.max(0,Math.round(_*10)/10));try{s?.setSettings({noiseRatio:g})}catch{}},[s]),C=o.useCallback(_=>{try{_===kr?s?.setSettings({enabled:!1}):s?.setSettings({type:_,enabled:!0})}catch{}},[s]),h=[{key:kr,label:r("training.noise.type.none","\uC5C6\uC74C")},...Lc(r).map(_=>({key:_.value,label:_.label}))];return n.jsx(cn,{anchorRect:e,offset:12,onClose:t,ariaLabel:r("training.trainingSettingsTitle","\uD6C8\uB828 \uC124\uC815"),isMobilePopup:!1,closeOnOutsideClick:!1,header:n.jsxs("div",{className:"noise-settings__header",children:[n.jsx("span",{children:r("training.trainingSettingsTitle","\uD6C8\uB828 \uC124\uC815")}),n.jsx(pe,{htmlType:"button",size:40,type:"dot",icon:"x",variant:"transparent-gray",useBorder:!1,ariaLabel:r("common.close","\uB2EB\uAE30"),onClick:t})]}),children:n.jsxs(Br,{className:"noise-settings",useBorder:!1,labelWidth:72,children:[n.jsx(gs,{title:r("training.playVolumeTitle","\uC804\uCCB4 \uC18C\uB9AC"),valueLabel:`${p}%`,value:p,min:0,max:100,step:10,size:i,onChange:f}),n.jsx(gs,{title:r("training.playSpeedTitle","\uC7AC\uC0DD \uC18D\uB3C4"),valueLabel:`${d.toFixed(2)}x`,value:d,min:g_,max:b_,step:y_,size:i,onChange:y}),!a&&n.jsxs(n.Fragment,{children:[n.jsx(Sn,{variant:"custom",label:r("training.noiseTypeTitle","\uC18C\uC74C \uC885\uB958"),useFullWidth:!0,children:n.jsx(gn,{ariaLabel:r("training.noiseTypeTitle","\uC18C\uC74C \uC885\uB958"),size:40,shape:"rounded",options:h,value:c?u:kr,onChange:C})}),n.jsx(gs,{title:r("training.noiseRatioTitle","\uC18C\uC74C \uBE44\uC728"),valueLabel:r("training.noiseRatioValue","{{ratio}}\uBC30",{ratio:l.toFixed(1)}),value:l,min:0,max:Va,step:fc,size:i,disabled:!c,onChange:x})]}),a&&n.jsx("div",{className:"noise-settings__width-ghost","aria-hidden":"true",inert:!0,children:n.jsx(Sn,{variant:"custom",label:"\xA0",useFullWidth:!0,children:n.jsx(gn,{ariaLabel:"width-ghost",size:40,shape:"rounded",options:h,value:kr,onChange:()=>{}})})})]})})}function Rc({useNoiseSettingBtn:e=!1,onSettings:t,onNext:a,onResult:r,stepIndex:i=0,stepCount:s=0,pageIndex:l=0,pageCount:u=1,resultOpen:c=!1,hideNoiseRows:d=!1}){const{t:m}=xe.useTranslation(),[p,f]=o.useState(!1),[y,x]=o.useState(null),[C,h]=o.useState(!1),_=o.useRef(null),g=o.useRef(null),A=yr(),b=u>0,k=b&&l<u-1,v=!b||l>=u-1,w=i===Math.max(0,s);o.useEffect(()=>{e||(f(!1),x(null))},[e]);const B=o.useCallback(()=>{f(!1),x(null)},[]),E=o.useCallback(()=>{if(p){f(!1),x(null);return}const Z=_?.current?.getBoundingClientRect();Z&&x(Z),t?.(),f(!0)},[p,t]),D=o.useCallback(()=>{if(p){f(!1),x(null);return}const Z=g?.current?.getBoundingClientRect();Z&&x(Z),t?.(),f(!0)},[p,t]),N=ln("(max-width: 767px)"),O=o.useRef(null),[P,G]=o.useState(null),L=o.useCallback(()=>{h(Z=>{const q=!Z;return G(q?O.current?.getBoundingClientRect()??null:null),q})},[]),M=o.useCallback(()=>{h(!1),G(null)},[]);o.useEffect(()=>{c&&(h(!1),G(null))},[c]);const $=n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"pp-bottom__meter",children:[n.jsx("span",{className:"pp-bottom__meter-label caption-1",children:m("training.meter.sentence","\uC7AC\uC0DD")}),n.jsx(zo,{analyser:A?.mainAnalyser??null,orientation:"horizontal",length:112,label:"db",labelPos:"left",ariaLabel:m("training.meter.sentence","\uC7AC\uC0DD")})]}),n.jsxs("div",{className:"pp-bottom__meter",children:[n.jsx("span",{className:"pp-bottom__meter-label caption-1",children:m("training.meter.noise","\uC18C\uC74C")}),n.jsx(zo,{analyser:A?.noiseAnalyser??null,orientation:"horizontal",length:112,label:"db",labelPos:"left",ariaLabel:m("training.meter.noise","\uC18C\uC74C")})]})]});return Ec(e&&p,()=>typeof document<"u"?document.querySelector(".noise-settings__header")?.closest(".tooltip-content")??null:null,()=>[_.current,g.current].map(Z=>Z?.querySelector("button")??null).find(Z=>!!Z&&Z.getClientRects().length>0)??_.current?.querySelector("button")??null),n.jsxs("div",{className:"pp-bottom",children:[n.jsxs("div",{className:"pp-bottom__left",children:[e?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"pp-bottom__settings--desktop",children:n.jsx("div",{ref:_,className:"pp-bottom__tooltip-trigger","data-tooltip-ignore":!0,children:n.jsx(pe,{htmlType:"button",size:56,type:"bar",icon:"settings",onClick:E,className:p?"is-selected":void 0,"aria-expanded":p,"aria-haspopup":"dialog",ariaLabel:m("training.trainingSettingsTitle","\uD6C8\uB828 \uC124\uC815"),label:m("training.trainingSettingsTitle","\uD6C8\uB828 \uC124\uC815"),minWidth:140})})}),n.jsx("div",{className:"pp-bottom__settings--mobile",children:n.jsx("div",{ref:g,className:"pp-bottom__tooltip-trigger","data-tooltip-ignore":!0,children:n.jsx(pe,{htmlType:"button",size:56,type:"dot",shape:"pill",icon:"settings",onClick:D,className:p?"is-selected":void 0,"aria-expanded":p,"aria-haspopup":"dialog",ariaLabel:m("training.settings","\uC124\uC815")})})})]}):null,e&&n.jsx("div",{ref:O,className:"pp-bottom__meter-trigger","data-tooltip-ignore":!0,children:n.jsx(pe,{htmlType:"button",size:40,type:"dot",shape:"pill",icon:"audio-lines",onClick:L,selected:C,"aria-expanded":N?C:void 0,ariaLabel:m("training.meter.toggle","\uC624\uB514\uC624 \uBBF8\uD130 \uD45C\uC2DC")})}),e&&C&&!N&&n.jsx("div",{className:"pp-bottom__meters",children:$})]}),e&&C&&N&&P&&n.jsx(cn,{anchorRect:P,onClose:M,ariaLabel:m("training.meter.toggle","\uC624\uB514\uC624 \uBBF8\uD130 \uD45C\uC2DC"),children:n.jsx("div",{className:"pp-bottom__meters pp-bottom__meters--floating",children:$})}),n.jsxs("div",{className:"pp-bottom__right",children:[v&&n.jsx(pe,{htmlType:"button",size:56,type:"bar",icon:"check",onClick:typeof r=="function"?r:a,ariaLabel:m("training.viewResult","\uACB0\uACFC\uBCF4\uAE30"),label:m("training.viewResult","\uACB0\uACFC\uBCF4\uAE30"),variant:"main",disabled:!w}),k&&n.jsx(pe,{htmlType:"button",size:56,type:"bar",rightIcon:"chevron-right",align:"right",onClick:a,ariaLabel:m("training.nextQuestion","\uB2E4\uC74C \uBB38\uC81C"),label:m("training.nextQuestion","\uB2E4\uC74C \uBB38\uC81C"),variant:"main",disabled:!w})]}),e&&p&&n.jsx($c,{anchorRect:y,onClose:B,hideNoiseRows:d})]})}function Pc({title:e,subtitle:t,desc:a,depth:r,icon:i,wrapperStyle:s,iconTooltip:l,pageIndex:u,pageCount:c,progressMax:d,progressIndex:m,onBack:p,onClose:f}){const{t:y}=xe.useTranslation(),x=ln("(max-width: 767px)"),C=Number.isInteger(m)?m:u||0,h=Number.isInteger(d)?d:c||0,_=p||f,g=Array.isArray(r)?x?r[r.length-1]:r.join(" / "):r,A=typeof e=="string"?e.trim():e,b=typeof t=="string"?t.trim():t,k=!!(A||b),v=k?A||b:y("common.emptyTrainingName","\uD6C8\uB828 \uC774\uB984\uC774 \uBE44\uC5B4 \uC788\uC2B5\uB2C8\uB2E4."),w=g||(A?t:void 0),B=x&&typeof w=="string"&&(w.includes(" \xB7 ")||w.includes(" / "))?w.split(/\s[·/]\s/).pop():w,E=o.useMemo(()=>{const D=s&&typeof s=="object"?{...s}:{};return!("width"in D)&&!("height"in D)&&(D.width="40px",D.height="40px"),D},[s]);return n.jsxs("header",{className:"pp-title training-popup-title",children:[n.jsxs("div",{className:"pp-title__left",children:[_?n.jsx(pe,{htmlType:"button",size:48,type:"dot",icon:"chevron-left",ariaLabel:y("common.back","\uB4A4\uB85C"),onClick:_,useBorder:!1,iconSize:"large",iconColor:"--color-black",variant:"transparent-gray"}):null,n.jsx("div",{children:i?n.jsx(ou,{icon:i,label:e,tooltip:l,wrapperStyle:E}):null}),n.jsxs("div",{className:"pp-title__text",children:[B?n.jsx("span",{className:"pp-title__depth caption-1",children:B}):null,n.jsx("span",{className:`pp-title__title h2${k?"":" pp-title__title--empty"}`,children:v}),a?n.jsx("span",{className:"pp-title__description caption-1",children:a}):null]})]}),n.jsx(Tu,{max:Math.max(0,h??0),index:Math.max(0,C??0)})]})}function v_(){typeof window<"u"&&window.dispatchEvent(new CustomEvent("speechear.popup.close"))}function x_(e){return!e&&e!==0?[]:Array.isArray(e)?e.flatMap(t=>typeof t=="string"?t.split("|").map(a=>a.trim()).filter(Boolean):t||t===0?[String(t)]:[]):typeof e=="string"?e.split("|").map(t=>t.trim()).filter(Boolean):[String(e)]}const Ic=(e,t)=>{if(!t)return t;const a=typeof Rt?.t=="function"?Rt.t(e,{defaultValue:t}):void 0;return typeof a=="string"&&a?a:t};function Fc(e,t,a){const r=e,i=r?.title||r?.name||(Array.isArray(t)?t[t.length-1]:void 0)||a||"\uD6C8\uB828",s=Ii().find(u=>u.key===(r?.category_0||r?.category_main_code)),l=s?.subs?.find(u=>u.key===(r?.category_1||r?.category_sub_code));return{title:i,label:r?.title||i,depth:t,icon:s?.icon,wrapperStyle:s?.color?{"--t-item-fg":s.color}:void 0,iconTooltip:[s?Ic(`topic.${s.key}`,s.label):void 0,l?Ic(`topic.sub.${l.key}`,l.label):void 0].filter(Boolean).join(" / ")||void 0}}function bs(e){return e&&typeof e=="object"&&typeof e.__ts=="number"?e.__ts:0}function Oc(e,t,a){if(!e||typeof e!="object"||Array.isArray(e))return e;const r=e,i=typeof a=="number"&&a>0?a:Date.now();return{...r,...r.shownAt===void 0&&t?{shownAt:t}:{},...r.answeredAt===void 0?{answeredAt:new Date(i).toISOString()}:{}}}function __(e){const t=e;return Array.isArray(t?.items)?t.items:Array.isArray(e)?e:e?[e]:[]}function w_({idPrefix:e,trainingData:t,depth:a,fallbackTitle:r="\uD6C8\uB828",pages:i=[],emptyMessage:s,buildResults:l,metaPatch:u}){const c=Fc(t,a,r),d=typeof u=="function"?u(c)||{}:u||{},m=t?.id||t?.title||i.length;return{id:`${e}:${m}`,meta:{...c,...d},pages:i,emptyMessage:s,buildResults:l}}function B_(e){if(typeof e=="string")return e;if(e&&typeof e=="object"){const t=e;return t.context||t.sentence||t.question||""||""}return""}function k_(e){if(e&&typeof e=="object"){const t=e;if(Array.isArray(t.selectedValues))return t.selectedValues;if(t.selectedValue!==void 0)return t.selectedValue;if(t.selectedIndex!==void 0)return t.selectedIndex;if(t.value!==void 0)return t.value}return e}function A_(e,t=[]){if(Array.isArray(e))return e.join(", ");if(typeof e=="number"&&Array.isArray(t))return String(t[e]??"");if(typeof e=="string")return e}function zc(e,t){if(!(!e||typeof e!="object"))return e[`step-${t}`]}function N_(e,t,a,r){return zc(e,t*a+r)}function E_({payload:e,selected:t,choices:a=[],correctAnswers:r=[]}){if(e&&typeof e=="object"){const i=e;if(Array.isArray(i.selectedValues))return r.every(s=>i.selectedValues.includes(s))&&i.selectedValues.every(s=>r.includes(s));if(typeof i.correct=="boolean")return i.correct}if(r.length){if(typeof t=="number"&&Array.isArray(a)&&a.length)return r.some(i=>String(i)===String(a[t]));if(typeof t<"u")return r.some(i=>String(i)===String(t))}}function D_(e){return e?Array.isArray(e.items)?e.items.map(t=>{const a=t;return typeof t=="string"?{sentence:t}:{sentence:a.context||a.sentence||"",contextCode:a.contextCode||a.context_code}}):Array.isArray(e.sentences)?e.sentences.map(t=>{const a=t;return typeof t=="string"?{sentence:t}:{sentence:a.sentence||a.context||"",contextCode:a.contextCode}}):Array.isArray(e.contexts)?e.contexts:e.contextCode?[{contextCode:e.contextCode}]:[]:[]}const Wc=o.createContext(null);function S_(){const e=o.useContext(Wc);if(!e)throw new Error("useTrainingPagePopupContext must be used inside TrainingPagePopup");return e}function T_({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:i,choices:s=[],onDone:l,onChange:u}){const{t:c}=xe.useTranslation(),d=typeof e=="number"?e:-1,m=typeof t!="number"?"disabled":d<t?"done":d===t?"active":"disabled",[p,f]=o.useState(()=>s.map(()=>null)),y=JSON.stringify(s),x=s.length;o.useEffect(()=>{f(Array.from({length:x},()=>null))},[y]);const C=o.useRef(void 0);o.useEffect(()=>{const A=C.current;typeof A=="number"&&typeof t=="number"&&typeof e=="number"&&A>=e&&t<e&&f(Array.from({length:x},()=>null)),C.current=t},[t,e,x]);const h=o.useMemo(()=>p.filter(A=>A!==null).length+1,[p]),_=o.useCallback(A=>{if(!Qn(m))return;const b=p;let k;if(b[A]!=null){const w=b[A];k=b.map(B=>B!==null&&B>=w?null:B)}else k=[...b],k[A]=h;f(k);const v={selectedOrder:k,words:s,__ts:Date.now()};try{typeof u=="function"&&u(v)}catch{}if(b[A]==null&&k.length>0&&k.every(w=>w!==null))try{typeof l=="function"&&l(v)}catch{}},[m,p,h,u,l,s]),g=i??c("training.selectInOrder","\uB4E4\uC740 \uC21C\uC11C\uB300\uB85C \uCE74\uB4DC\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return n.jsx(Jn,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:g,onDone:l,children:n.jsx("div",{className:"training-step__cards",children:s.map((A,b)=>n.jsx(Go,{item:{word:A},disabled:m==="disabled",selectable:!0,selected:p[b]!==null,orderRank:p[b],onSelect:()=>_(b),flipDelay:b*120,hideLabel:!1,hideAudio:!0},`${A}-${b}`))})})}function Ar(e){return null}Ar.__isTrainingPage=!0;function ba(e,t){const a=S_();return{ctx:a,index:e,stepIndex:a.currentStepIndex,isLast:typeof e=="number"&&typeof t=="number"?e===t-1:!1,onDone:r=>a.handleStepDone(r,e),onChange:r=>a.handleStepChange(r,e)}}function Hc({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:i,isLast:s,onDone:l}=ba(e,t);return n.jsx(fs,{...a,index:r,stepIndex:i,isLast:s,onDone:l})}function Vc({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:i,isLast:s,onDone:l,onChange:u}=ba(e,t);return n.jsx(ms,{...a,index:r,stepIndex:i,isLast:s,onDone:l,onChange:u})}function qc({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:i,isLast:s,onDone:l,onChange:u}=ba(e,t);return n.jsx(hs,{...a,index:r,stepIndex:i,isLast:s,onDone:l,onChange:u})}function Uc({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:i,isLast:s,onDone:l,onChange:u}=ba(e,t);return n.jsx(Cs,{...a,index:r,stepIndex:i,isLast:s,onDone:l,onChange:u})}function Gc({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:i,isLast:s,onDone:l,onChange:u}=ba(e,t);return n.jsx(Tc,{...a,index:r,stepIndex:i,isLast:s,onDone:l,onChange:u})}function j_({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:i,isLast:s,onDone:l,onChange:u}=ba(e,t);return n.jsx(T_,{...a,index:r,stepIndex:i,isLast:s,onDone:l,onChange:u})}const Kc=3e4,M_=/^(https?:|blob:|data:audio|\/|\.\/)/;function Yc(e){return typeof e=="string"&&M_.test(e)?e:null}const L_=e=>typeof e=="string"&&e.trim()!==""?e:null,ys=Symbol("timed-out");function $_(e,t){if(t<=0)return Promise.resolve(ys);let a;return Promise.race([Promise.resolve(e),new Promise(r=>{a=setTimeout(()=>r(ys),t)})]).finally(()=>clearTimeout(a))}function R_(e){return e?Ba()||Yr()?!0:typeof window<"u"&&!!window.speechSynthesis:!1}function P_(e,t){const a=[],r=Yc(t);r&&a.push({kind:"raw",resolve:async()=>r});const i=(e??"").trim();if(!i)return a;for(const[s,l]of[["urlResolver",Ba()],["fallbackUrlResolver",Yr()]])l&&a.push({kind:s,resolve:async u=>{let c;try{c=await $_(l(i),u)}catch(m){return St(`question-sound-threw-${s}`,`[core] configureTTS \uC758 ${s} \uAC00 \uB358\uC84C\uB2E4 \u2014 \uADF8 \uCC28\uB840\uB294 \uAC74\uB108\uB6F4\uB2E4.`,m),null}return c===ys?(St(`question-sound-slow-${s}`,`[core] configureTTS \uC758 ${s} \uAC00 ${Kc}ms \uBC14\uD034 \uC548\uC5D0 \uC548 \uD480\uB838\uB2E4 \u2014 \uADF8 \uCC28\uB840\uB97C \uBC84\uB9AC\uACE0 \uB2E4\uC74C\uC73C\uB85C \uAC04\uB2E4. \uC11C\uBC84 \uD569\uC131\uC744 \uAE30\uB2E4\uB9AC\uB294 \uB9AC\uC878\uBC84\uB77C\uBA74 \uC774 \uC790\uB9AC\uAC00 \uAE38\uC5B4\uC9C4\uB2E4. \uC18C\uB9AC\uAC00 \uC544\uC608 \uC548 \uB098\uBA74 \uC5EC\uAE30\uBD80\uD130 \uBCF4\uB77C.`),null):L_(c)||(St(`question-sound-empty-${s}`,`[core] configureTTS \uC758 ${s} \uAC00 \uC8FC\uC18C\uB97C \uC548 \uC92C\uB2E4(\uBC1B\uC740 \uAC83: ${JSON.stringify(c)}) \u2014 \uADF8 \uCC28\uB840\uB294 \uAC74\uB108\uB6F4\uB2E4.`),null)}});return a}function I_(){return Date.now()+Kc}const F_=(e,t)=>Math.max(0,e-Date.now())/Math.max(1,t);function O_(e){St("question-sound-none",`[core] "${e}" \uC758 \uC18C\uB9AC \uC8FC\uC18C\uB97C \uD55C \uC790\uB9AC\uC5D0\uC11C\uB3C4 \uBABB \uC5BB\uC5C8\uB2E4 \u2014 \uBE0C\uB77C\uC6B0\uC800 \uB0AD\uB3C5\uC73C\uB85C \uAC04\uB2E4. configureTTS \uAC00 \uAC78\uB824 \uC788\uB294\uC9C0, \uB9AC\uC878\uBC84\uAC00 \uC8FC\uC18C\uB97C \uC8FC\uB294\uC9C0 \uC704 \uC904\uB4E4\uC744 \uBCF4\uB77C.`)}function Nr(...e){for(const t of e)if(typeof t=="string"){const a=t.trim();if(a.length)return a}else{if(typeof t=="number"||typeof t=="boolean")return String(t);if(Array.isArray(t)&&t.length)return t.join(", ");if(t&&typeof t=="object"){const a=t,r=[a.text,a.label,a.value];for(const i of r){if(typeof i=="string"&&i.trim().length)return i.trim();if(typeof i=="number"||typeof i=="boolean")return String(i)}}}return null}function z_(e){return Nr(e?.question,e?.q,e?.sentence,e?.text,e?.prompt,e?.wording)}function W_(e){return Yc(Nr(e?.questionSound,e?.soundSrc,e?.audioSrc,e?.sound,e?.audio,e?.src))}function Zc(e){if(!e)return;if(typeof e.decision=="boolean")return e.decision;if(typeof e.correct=="boolean")return e.correct;if(typeof e.heard=="boolean")return e.heard;if(typeof e.judgement=="boolean")return e.judgement;const t=Nr(e?.status,e?.result,e?.judge,e?.note);if(t){const a=t.toLowerCase();if(["ok","true","\uB9DE\uC74C","\uC815\uB2F5"].some(r=>a.includes(r)))return!0;if(["ng","false","\uD2C0\uB9BC","\uC624\uB2F5"].some(r=>a.includes(r)))return!1}}function Xc(e){const{score:t,contextsLength:a,results:r=[],subtitle:i,onReplay:s,onClose:l,inline:u=!1,pending:c=!1}=e||{},{t:d}=xe.useTranslation(),m=o.useId(),p=o.useCallback(()=>!c,[c]);o.useEffect(()=>{const D=a??0;if(t!=null&&D>0&&t/D>.5){const N=window.setTimeout(()=>{window.dispatchEvent(new CustomEvent("party:trigger",{detail:{count:140,strength:1.6,duration:2200}}))},0);return()=>window.clearTimeout(N)}},[t,a]);const f=o.useCallback(D=>{const N=Zc(D),O=Nr(D?.wording,D?.label);return N===!0?{variant:"main",label:O??d("training.result.heardWell","\uC798 \uB4E4\uC5C8\uC5B4\uC694")}:N===!1?{variant:"danger",label:O??d("training.result.notHeard","\uBABB \uB4E4\uC5C8\uC5B4\uC694")}:{variant:"disabled",label:O??d("training.result.notJudged","\uBBF8\uD310\uC815")}},[d]),y=a??0,x=t??0,C=o.useMemo(()=>Array.isArray(r)?r:[],[r]),h=o.useRef(null),[_,g]=o.useState(null),A=o.useCallback(()=>{h.current?.(),h.current=null,g(null)},[]);o.useEffect(()=>A,[A]);const b=o.useRef(0),k=(D,N)=>{if(!Ln)return;const O=Math.round(performance.now()-b.current);console.debug(`[core][\uB2E4\uC2DC\uB4E3\uAE30] +${O}ms ${D}`,N??"")},v=o.useRef(0),w=o.useCallback((D,N,O)=>{A();const P=++v.current,G=()=>v.current===P;b.current=Ln?performance.now():0,k(`\uB20C\uB800\uB2E4 \u2014 \uC904 ${D}`,{text:N,rawUrl:O}),g(D),h.current=()=>{k("\uBA48\uCD94\uAC1C\uAC00 \uBD88\uB838\uB2E4(\uC8FC\uC18C \uC5BB\uAE30 \uC804)"),v.current++,Gr()};const L=q=>{k("\uD2BC\uB2E4",q);const z=cr(q,V=>{k(`\uB05D\uB0AC\uB2E4 \u2014 ${V?"\uB05D\uAE4C\uC9C0 \uB4E4\uC5C8\uB2E4":"\uBABB \uD2C0\uC5C8\uAC70\uB098 \uBA48\uCDC4\uB2E4"}`,{mine:G()}),V&&G()&&(h.current=null,g(null))});return h.current=()=>{k("\uBA48\uCD94\uAC1C\uAC00 \uBD88\uB838\uB2E4(\uD2B8\uB294 \uC911)"),v.current++,z.stop(),Gr()},z.done},M=P_(N,O);k("\uCC28\uB840",M.map(q=>q.kind));const $=M[0]?.kind==="raw",Z=$?L(O):Promise.resolve(!1);(async()=>{if(await Z||!G())return;const q=I_(),z=$?M.slice(1):M;for(let V=0;V<z.length;V++){if(!G())return;k(`${z[V].kind} \uC5D0\uAC8C \uBB3B\uB294\uB2E4`);const R=await z[V].resolve(F_(q,z.length-V));if(k(`${z[V].kind} \uAC00 \uB2F5\uD588\uB2E4`,R),!G()||R&&(await L(R)||!G()))return}G()&&(k("\uC8FC\uC18C\uB97C \uD558\uB098\uB3C4 \uBABB \uC5BB\uC5C8\uB2E4 \u2014 \uB0AD\uB3C5\uC73C\uB85C \uAC04\uB2E4"),O_(N),h.current=()=>{v.current++,Gr()},k("\uB0AD\uB3C5\uD55C\uB2E4"),Df(N,{onEnd:()=>{G()&&(h.current=null,g(null))}}))})()},[A]),B=o.useMemo(()=>C.map(D=>{const N=D??{},O=z_(N)||d("training.result.noContent","(\uB0B4\uC6A9\uC5C6\uC74C)"),{variant:P,label:G}=f(N),L=Array.isArray(N.corrects)?N.corrects:[],M=L.length?L.join(", "):N.answer!=null&&N.answer!==""?String(N.answer):null,$=typeof N.selectedText=="string"?N.selectedText:null,Z=Zc(N)===!0,q=W_(N),z=!!q||R_(O);return{problem:O,variant:P,label:G,answer:M,selectedText:$,isCorrect:Z,sound:q,canHear:z}}),[C,f,d]),E=o.useMemo(()=>B.some(D=>D.answer!==null||D.selectedText!==null),[B]);return n.jsx(Fn,{onClose:l,closeOnBackdrop:!1,inline:u,ariaLabel:d("training.result.title","\uD6C8\uB828\uC744 \uBAA8\uB450 \uB9C8\uCCE4\uC2B5\uB2C8\uB2E4."),className:"popup--training-result",beforeClose:p,footerClassName:"trp-result__foot",footer:({animateThen:D,closeWithAnimation:N})=>n.jsxs(n.Fragment,{children:[c&&n.jsx("p",{id:m,className:"trp-actions__reason caption-1",role:"status",children:d("training.result.pendingDone","\uACB0\uACFC\uB97C \uACC4\uC0B0\uD558\uB294 \uC911\uC774\uB77C \uC544\uC9C1 \uC644\uB8CC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.")}),n.jsxs("div",{className:"trp-actions",children:[n.jsx(pe,{htmlType:"button",size:56,type:"bar",label:d("training.result.replay","\uB2E4\uC2DC\uD558\uAE30"),onClick:()=>D(s)}),n.jsx(pe,{htmlType:"button",size:56,type:"bar",label:d("training.result.done","\uC644\uB8CC"),variant:"main",onClick:N,disabled:c,onDisabledClick:c?()=>{}:void 0,"aria-describedby":c?m:void 0})]})]}),children:()=>n.jsxs("div",{className:"trp-result is-on",children:[n.jsxs("header",{className:"trp-result__head",children:[n.jsx("p",{className:"trp-result__eyebrow caption-1",children:d("training.result.eyebrow","\uD6C8\uB828 \uC644\uB8CC")}),n.jsx("h1",{className:"trp-result__title h2",children:d("training.result.title","\uD6C8\uB828\uC744 \uBAA8\uB450 \uB9C8\uCCE4\uC2B5\uB2C8\uB2E4.")}),i&&n.jsx("p",{className:"trp-result__subtitle body-3",children:i}),n.jsx("div",{className:"trp-score",children:n.jsxs("div",{className:"trp-score__figure","aria-label":d("training.result.scoreAria",{correct:x,total:y}),children:[n.jsx("span",{className:"trp-score__big",children:x}),n.jsx("span",{className:"trp-score__sep",children:"/"}),n.jsx("span",{className:"trp-score__total",children:y})]})})]}),B.length>0&&n.jsx("section",{className:"trp-result__body",children:n.jsxs("div",{className:`result-table${E?" result-table--answer":""}`,role:"table","aria-label":d("training.result.tableAriaLabel","\uBB38\uD56D\uBCC4 \uD310\uC815"),children:[n.jsxs("div",{className:"result-table__head caption-1",role:"row",children:[n.jsx("span",{role:"columnheader",children:d("common.col.problem","\uBB38\uC81C")}),E&&n.jsx("span",{role:"columnheader",children:d("training.result.colAnswerSelected","\uC815\uB2F5 \xB7 \uC120\uD0DD")}),n.jsx("span",{className:"col-right",role:"columnheader",children:d("training.result.colJudge","\uD310\uC815")})]}),B.map((D,N)=>n.jsxs("div",{className:"result-table__row",role:"row",children:[n.jsxs("div",{className:"trp-row__problem",children:[n.jsx("span",{className:"trp-row__no caption-1",children:String(N+1).padStart(2,"0")}),n.jsx("div",{className:"trp-row__q body-2",children:D.problem}),D.canHear&&n.jsx(pe,{htmlType:"button",size:32,type:"dot",useBorder:!1,icon:_===N?"square":"volume-2",className:"trp-row__replay",ariaLabel:_===N?d("training.result.replaySoundStop",{no:N+1,defaultValue:"{{no}}\uBC88 \uB4E3\uAE30 \uBA48\uCDA4"}):d("training.result.replaySound",{no:N+1,defaultValue:"{{no}}\uBC88 \uB2E4\uC2DC \uB4E3\uAE30"}),onClick:()=>_===N?A():w(N,D.problem,D.sound)})]}),E&&n.jsxs("div",{className:"trp-row__answers",children:[D.answer!==null&&n.jsxs("div",{className:"trp-row__answer-line",children:[n.jsx("span",{className:"trp-row__answer-label answer-correct caption-1",children:d("training.result.colAnswer","\uC815\uB2F5")}),n.jsx("span",{className:"trp-row__answer-value body-2",children:D.answer})]}),n.jsxs("div",{className:"trp-row__answer-line",children:[n.jsx("span",{className:`trp-row__answer-label answer-selected caption-1 ${D.isCorrect?"is-correct":"is-wrong"}`,children:d("training.result.colSelected","\uC120\uD0DD")}),n.jsx("span",{className:`trp-row__answer-value body-2 ${D.isCorrect?"is-correct":"is-wrong"}`,children:D.selectedText??"\u2014"})]})]}),n.jsx("div",{className:"trp-row__judge",children:n.jsx(At,{variant:D.variant,label:D.label,fill:"soft",minWidth:80})})]},N))]})})]})})}const vs=new Set;function H_(e){o.useEffect(()=>{if(!e||vs.has(e))return;vs.add(e);const t=()=>typeof document>"u"||document.visibilityState!=="hidden";let a=null,r=null,i=0,s=0;const l=()=>{const m=Date.now();a==null&&(a=m),r==null&&(r=m)},u=()=>{r!=null&&(i+=Date.now()-r,r=null)};t()&&l();const c=()=>{if(u(),a==null||i-s<1e3||s===0&&i<5e3)return;const m=a+s;s=i,gC({trainingType:e,startedAt:new Date(m).toISOString(),endedAt:new Date(a+i).toISOString()})},d=()=>{t()?l():c()};return typeof document<"u"&&document.addEventListener("visibilitychange",d),typeof window<"u"&&window.addEventListener("pagehide",c),()=>{typeof document<"u"&&document.removeEventListener("visibilitychange",d),typeof window<"u"&&window.removeEventListener("pagehide",c),c(),vs.delete(e)}},[e])}function Er(e,t){return e&&e.id||`page-${t??0}`}function Dr(e,t){return e&&e.key||`step-${t??0}`}function Sr(){return{pageIndex:0,stepIndex:0,answersByPage:{}}}function V_(e,t){return typeof e?.props=="function"?e.props(t)||{}:e?.props||{}}const q_=300,U_=()=>{try{return typeof window<"u"&&!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches}catch{return!1}},Tn=Object.freeze({}),Jc=new Set(["LISTEN_IN_NOISE","SHORT_STORY","LONG_STORY","ORDERING_SENTENCE"]);function xs(e){const t=e,a=t?.results||t?.answers||[],r=Array.isArray(a)&&a.length>0?a.length:null,i=Array.isArray(a)?a.filter(s=>s?.correct===!0||s?.isCorrect===!0||s?.score===1||s?.heard===!0||s?.judgement===!0).length:null;return{results:a,correct:r!=null?i:null,total:r}}const G_=e=>n.jsx(Xc,{score:e.score,contextsLength:e.contextsLength,results:e.results,onReplay:e.onReplay,onClose:e.onClose,pending:e.pending});function K_(e){const{scenario:t,title:a,subTitle:r,depth:i,icon:s,wrapperStyle:l,iconTooltip:u,pageIndex:c,pageCount:d,stepIndex:m,stepCount:p,onBack:f,onComplete:y,onRoundFinished:x,onNext:C,onSettings:h,useNoiseSetting:_=!0,children:g,ariaLabel:A,label:b,buildResults:k,onResult:v,typeKey:w,entryPoint:B,dailyTotal:E,itemRef:D,renderResultPopup:N,noiseOverride:O,hideNoiseRows:P=!1}=e;H_(w&&!Jc.has(w)?w:"");const G=o.useRef(0);o.useEffect(()=>{G.current=Date.now()},[]);const{t:L}=xe.useTranslation(),M=v,$=!!t,Z=t?.id||null,q=t?.meta||{},z=Array.isArray(t?.pages)?t.pages:[],V=Array.isArray(g)||o.isValidElement(g)&&typeof g!="function"?o.Children.toArray(g).filter(o.isValidElement):[],R=V.length>0,H=ie=>ie===Ar||ie?.__isTrainingPage===!0,W=R&&V.some(ie=>H(ie.type)),I=W?V.filter(ie=>H(ie.type)).map((ie,ve)=>{const Me=ie.props||{};return{id:`children-page-${ve}`,steps:o.Children.toArray(Me.children).filter(o.isValidElement),pageTop:Me.pageTop||Me.top||null,pageBottom:Me.pageBottom||Me.bottom||null}}):[{id:"children-page-0",steps:V}],S=R&&!$&&typeof g!="function",j=S?Math.max(1,I.length):0;o.useEffect(()=>{if(!(typeof document>"u"||!document.body)&&!document.body.classList.contains("ihabdevteam-core-scope"))return document.body.classList.add("ihabdevteam-core-scope"),()=>{document.body.classList.remove("ihabdevteam-core-scope")}},[]),o.useEffect(()=>{if(typeof document>"u"||!document.body)return;const ie=document.body;return ie.dataset.ihabTrainingPopupCount=String(Number(ie.dataset.ihabTrainingPopupCount||"0")+1),ie.classList.add("ihab-training-popup-open"),()=>{const ve=Number(ie.dataset.ihabTrainingPopupCount||"1")-1;ve>0?ie.dataset.ihabTrainingPopupCount=String(ve):(delete ie.dataset.ihabTrainingPopupCount,ie.classList.remove("ihab-training-popup-open"))}},[]),o.useEffect(()=>{if(!(typeof document>"u"||!document.body))return yv()},[]);const[F,U]=o.useState({...Ga,enabled:!1}),re=o.useRef(F);o.useEffect(()=>{re.current=F},[F]);const ne=o.useRef(O),le=o.useRef(!1),K=o.useRef(null);o.useEffect(()=>{let ie=!1;const ve=Me=>{if(ie)return;le.current=!0;const Je=Me?Ua({...Ga,enabled:!1},Me):{...Ga},Oe=K.current;K.current=null;const Ye=Oe?Ua(Je,Oe):Je;re.current=Ye,U(Ye),Oe&&!ne.current&&ji(Ye),er(Ye);const J=ne.current;if(J){const de=typeof J=="function"?J(Ye):J,ae=Ua(Ye,de);re.current=ae,U(ae),er(ae)}};return xC().then(ve),()=>{ie=!0}},[]);const[oe,Ae]=o.useState(null),[Y,Q]=o.useState(null),me=o.useCallback((ie,ve)=>{ie==="main"?Ae(ve):Q(ve)},[]),De=o.useRef(null),be=o.useRef(null),te=o.useCallback(()=>{be.current!==null&&(clearTimeout(be.current),be.current=null);const ie=De.current;De.current=null,ie&&ji(ie)},[]);o.useEffect(()=>{if(typeof window>"u")return;const ie=()=>{document.visibilityState==="hidden"&&te()};return window.addEventListener("pagehide",te),document.addEventListener("visibilitychange",ie),()=>{window.removeEventListener("pagehide",te),document.removeEventListener("visibilitychange",ie),te()}},[te]);const ue=o.useCallback(ie=>{const ve=Ua(re.current,ie);if(re.current=ve,U(ve),!le.current){K.current={...K.current??{},...ie},er(ve);return}ne.current||(De.current=ve,be.current!==null&&clearTimeout(be.current),be.current=setTimeout(te,q_)),er(ve)},[te]),fe=F.mainSpeed,ge=F.mainVolume,Ce=o.useCallback(ie=>ue({mainSpeed:ie}),[ue]),$e=o.useCallback(ie=>ue({mainVolume:ie}),[ue]),He=o.useMemo(()=>({settings:F,setSettings:ue,registerAnalyser:me,mainAnalyser:oe,noiseAnalyser:Y,playbackRate:fe,setPlaybackRate:Ce,mainVolume:ge,setMainVolume:$e}),[F,ue,me,oe,Y,fe,Ce,ge,$e]),Te=o.useRef(null),[Ie,qe]=o.useState(0),mt=o.useRef([]),[ct,rt]=o.useState("center"),[ft,ke]=o.useState(!1),Ve=o.useRef(!1),we=o.useRef(null),Ue=o.useCallback(ie=>{Ve.current||(Ve.current=!0,ke(!0),we.current=setTimeout(()=>{try{ie()}catch{Ve.current=!1,ke(!1)}},U_()?0:m_))},[]);o.useEffect(()=>()=>{we.current&&clearTimeout(we.current)},[]);const Be=o.useRef(f);o.useEffect(()=>{Be.current=f}),o.useEffect(()=>{const ie=Te.current,ve=document.activeElement;if(co(ie,ve),ie){const Me=Array.from(ie.querySelectorAll(Cn)).filter(Je=>!Je.closest('[aria-hidden="true"]'))[0];if(Me)try{Me.focus()}catch{}}return()=>{const Me=document.activeElement;if(!Me||Me===document.body||ie&&ie.contains(Me))try{po(ve)?.focus?.()}catch{}}},[]),o.useEffect(()=>Gn(()=>Ue(()=>{const ie=Be.current;typeof ie=="function"&&ie()})),[Ue]),lo(Te,!0);const[je,Se]=o.useState(!1),Xe=o.useRef(!1),[Qe,dt]=o.useState(null),ht=o.useRef(0),wt=o.useRef(0),Ct=()=>{ht.current+=1,wt.current+=1,dt(null)},[Nt,gt]=o.useState(""),[it,Ke]=o.useState(()=>Sr()),se=o.useRef(typeof c=="number"?c:null);o.useEffect(()=>{!$&&!S||(Ke(Sr()),Ct())},[$,Z,S]),o.useEffect(()=>{S&&Ke(ie=>{const ve=Math.max(0,Math.min(ie.pageIndex,Math.max(0,j-1)));return ve!==ie.pageIndex?{...ie,pageIndex:ve,stepIndex:0}:ie})},[S,j]);const Ne=S?Math.max(0,Math.min(it.pageIndex,j-1)):0,We=S?I[Ne]:null,nt=S&&We&&Array.isArray(We.steps)?We.steps:[],Fe=$?it.pageIndex:S?Ne:typeof c=="number"?c:0,Ge=$?z[Math.max(0,Math.min(it.pageIndex,Math.max(0,z.length-1)))]:null,bt=$&&Ge&&Array.isArray(Ge.steps)?Ge.steps:[],Re=$?bt.length:S?nt.length:typeof p=="number"?p:0,tt=$||S?Math.max(0,Math.min(it.stepIndex,Math.max(0,Re))):typeof m=="number"?m:0,xt=$?z.length:S?j:typeof d=="number"?d:0;o.useEffect(()=>{if(!$&&!S)return;const ie=$?Er(Ge,Fe):We?.id||`children-page-${Fe??0}`,ve=new Date().toISOString();for(let Me=0;Me<=tt;Me+=1){const Je=$?Dr(bt[Me],Me):`step-${Me}`,Oe=lt(ie,Je);ot.current.has(Oe)||ot.current.set(Oe,ve)}},[$,S,Fe,tt,We?.id]),o.useLayoutEffect(()=>{const ie=se.current;if(typeof Fe=="number"&&ie!==null&&Fe!==ie&&Fe>ie)try{gt(L("training.problemNotice",{n:Fe+1}))}catch{}se.current=typeof Fe=="number"?Fe:se.current},[Fe,c,L]),o.useLayoutEffect(()=>{const ie=Te.current;if(!ie)return;const ve=()=>ie.querySelector(".page-popup__scroll");let Me=null,Je=null,Oe=null;const Ye=Le=>{const ze=ve();if(!ze)return;const ut=ze.scrollHeight<=ze.clientHeight;if(rt(ut?"center":"top"),Le&&!Xe.current){Xe.current=!0;try{Se(!0)}catch{}try{ae.disconnect()}catch{}}},J=()=>{Me!==null&&cancelAnimationFrame(Me),Me=requestAnimationFrame(()=>{Je!==null&&clearTimeout(Je),Je=setTimeout(()=>Ye(!0),60)})},de=()=>{Oe!==null&&cancelAnimationFrame(Oe),Oe=requestAnimationFrame(()=>Ye(!1))};J(),window.addEventListener("resize",de);const ae=new MutationObserver(J);ae.observe(ie,{childList:!0,subtree:!0,attributes:!0});const ye=setTimeout(()=>{Xe.current||Ye(!0)},400);return()=>{window.removeEventListener("resize",de),Me!==null&&cancelAnimationFrame(Me),Je!==null&&clearTimeout(Je),Oe!==null&&cancelAnimationFrame(Oe),clearTimeout(ye);try{ae.disconnect()}catch{}}},[Te]);const Lt=o.useCallback(ie=>{Te.current&&(Te.current._childOnNext=ie)},[]),et=o.useCallback(ie=>{Te.current&&(Te.current._childOnResult=ie)},[]),ot=o.useRef(new Map),lt=(ie,ve)=>`${ie}\0${ve}`,st=o.useCallback((ie,ve,Me)=>{Ke(Je=>{const Oe=Je.answersByPage[ie]||{},Ye=Oe[ve],J=bs(Me),de=bs(Ye);if(Ye&&de>J)return Je;const ae=Oc(Me,ot.current.get(lt(ie,ve)),J);return{...Je,answersByPage:{...Je.answersByPage,[ie]:{...Oe,[ve]:ae}}}})},[Ke]),jt=o.useCallback((ie,ve,Me)=>{const Je=Er(Ge,Fe),Oe=Dr(ie,ve);st(Je,Oe,Me)},[Ge,Fe,st]),Wt=o.useCallback((ie,ve,Me)=>{const Je=Er(Ge,Fe),Oe=Dr(ie,ve);st(Je,Oe,Me),!Me?.allowChange&&ie?.autoAdvance!==!1&&Ke(Ye=>({...Ye,stepIndex:Math.max(Ye.stepIndex,ve+1)}))},[Ge,Fe,st,Ke]),mn=o.useCallback((ie,ve)=>{const Me=We?.id||`children-page-${Fe??0}`,Je=typeof ve=="number"?ve:tt??0,Oe=`step-${Je}`;st(Me,Oe,ie),ie?.allowChange||Ke(Ye=>({...Ye,stepIndex:Math.max(Ye.stepIndex,Je+1)}))},[We,Fe,tt,st,Ke]),hn=o.useCallback((ie,ve)=>{const Me=We?.id||`children-page-${Fe??0}`,Je=`step-${typeof ve=="number"?ve:tt??0}`;st(Me,Je,ie)},[We,Fe,tt,st]),jn=S?{currentPageIndex:Fe??0,currentStepIndex:tt??0,totalStepsInPage:nt.length,handleStepDone:mn,handleStepChange:hn}:null,zn=async()=>{const ie=typeof t?.buildResults=="function"?await Promise.resolve(t.buildResults({scenario:t,pages:z,flowState:it,answersByPage:it.answersByPage})):null;return typeof M=="function"&&await Promise.resolve(M(ie))||ie},Wn=async()=>{const ie=We?.id||`children-page-${it.pageIndex}`,ve=it.answersByPage[ie]||{},Me=W?(()=>{const Ye={};let J=0;return I.forEach(de=>{const ae=it.answersByPage[de.id]||{},ye=Array.isArray(de.steps)?de.steps.length:0;for(let Le=0;Le<ye;Le+=1){const ze=ae[`step-${Le}`];typeof ze<"u"&&(Ye[`step-${J+Le}`]=ze)}J+=ye}),Ye})():ve;if(typeof k=="function"){const Ye=await Promise.resolve(k(Me,{pageAnswers:ve,answersByPage:it.answersByPage,pages:I,currentPageId:ie}));return typeof M=="function"&&await Promise.resolve(M(Ye))||Ye}const Je=Object.entries(ve).map(([Ye,J],de)=>({index:de,key:Ye,payload:J})),Oe={results:Je,answers:Je,score:0};return typeof M=="function"&&await Promise.resolve(M(Oe))||Oe},It=()=>{const ie=++ht.current,ve=()=>ie!==ht.current;try{if(typeof document<"u"&&document.body){try{document.dispatchEvent(new CustomEvent("speechear-close-tooltips"))}catch{}document.dispatchEvent(new PointerEvent("pointerdown",{bubbles:!0,cancelable:!0})),document.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0}))}}catch{}if($){const Oe=zn();dt(Tn);const Ye=Oe;Promise.resolve(Ye).then(J=>{ve()||dt(J||{isEmpty:!0})}).catch(J=>{!ve()&&dt({isEmpty:!0})});return}if(S){const Oe=Wn();dt(Tn);const Ye=Oe;Promise.resolve(Ye).then(J=>{ve()||dt(J||{isEmpty:!0})}).catch(J=>{!ve()&&dt({isEmpty:!0})});return}const Me=Te.current&&Te.current._childOnResult,Je=Oe=>{try{return Oe?Oe():void 0}catch{return}};if(typeof Me=="function"){const Oe=Je(Me);try{typeof document>"u"?require("url").pathToFileURL(__filename).href:wn&&wn.tagName.toUpperCase()==="SCRIPT"&&wn.src||new URL("components.cjs.js",document.baseURI).href}catch{}Oe&&typeof Oe.then!="function"?dt(Oe):dt(Oe&&typeof Oe.then=="function"?Tn:{});const Ye=()=>{ve()||dt(J=>J===Tn?{}:J)};Promise.resolve(Oe).then(J=>{J&&!ve()?dt(J):Ye()}).catch(J=>{Ye()});return}if(typeof M=="function"){const Oe=Je(M);try{typeof document>"u"?require("url").pathToFileURL(__filename).href:wn&&wn.tagName.toUpperCase()==="SCRIPT"&&wn.src||new URL("components.cjs.js",document.baseURI).href}catch{}Oe&&typeof Oe.then!="function"?dt(Oe):dt(Oe&&typeof Oe.then=="function"?Tn:{});const Ye=()=>{ve()||dt(J=>J===Tn?{}:J)};Promise.resolve(Oe).then(J=>{try{typeof document>"u"?require("url").pathToFileURL(__filename).href:wn&&wn.tagName.toUpperCase()==="SCRIPT"&&wn.src||new URL("components.cjs.js",document.baseURI).href}catch{}J&&!ve()?dt(J):Ye()}).catch(J=>{console.error("viewResults external handler failed",J),Ye()});return}},vn=()=>{if($){if(typeof Fe=="number"&&typeof xt=="number"&&Fe<xt-1){Ke(ve=>({...ve,pageIndex:ve.pageIndex+1,stepIndex:0}));return}return It()}if(S){const ve=nt.length;if(typeof tt=="number"&&tt<ve-1){Ke(Me=>({...Me,stepIndex:Me.stepIndex+1}));return}if(typeof Fe=="number"&&typeof xt=="number"&&Fe<xt-1){Ke(Me=>({...Me,pageIndex:Me.pageIndex+1,stepIndex:0}));return}return It()}if(typeof C=="function"){try{C()}catch{}return}const ie=Te.current&&Te.current._childOnNext;if(typeof ie=="function"){try{ie()}catch{}return}},Ft=$?q.title||q.label||A||L("common.popup","\uD31D\uC5C5"):a||b||(Array.isArray(i)?i[i.length-1]:void 0)||A||L("common.popup","\uD31D\uC5C5"),Ht=A||Ft,Mn=$?q.title??q.label??Ft:a??b??Ft,on=(ie,ve)=>{const Me=Er(Ge,Fe),Je=Dr(ie,ve),Oe=it.answersByPage[Me]?.[Je],Ye=V_(ie,{page:Ge,pageIndex:Fe,step:ie,stepIndex:ve,storedPayload:Oe,answersByPage:it.answersByPage,flowState:it}),J={key:Je,index:ve,stepIndex:tt,isLast:ve===bt.length-1};switch(ie?.type){case"listen":return n.jsx(fs,{...J,...Ye,onDone:de=>Wt(ie,ve,de)});case"confirm":return n.jsx(ms,{...J,...Ye,onDone:de=>Wt(ie,ve,de),onChange:de=>jt(ie,ve,de)});case"confirmWithText":return n.jsx(hs,{...J,...Ye,onDone:de=>Wt(ie,ve,de),onChange:de=>jt(ie,ve,de)});case"orderList":return n.jsx(Cs,{...J,...Ye,onDone:de=>Wt(ie,ve,de),onChange:de=>jt(ie,ve,de)});default:return null}},xn=o.useRef(void 0);o.useEffect(()=>{const ie=xn.current;if(xn.current=Fe,ie===void 0||ie===Fe||!hr())return;const ve=Te.current;if(!ve)return;const Me=document.activeElement;if(!(!Me||Me===document.body||!ve.contains(Me)||Me.disabled===!0))return;const Je=ve.querySelector(`.training-steps ${Cn.split(", ").join(", .training-steps ")}`)??Array.from(ve.querySelectorAll(Cn)).find(Oe=>!Oe.closest('[aria-hidden="true"]'));try{Je?.focus()}catch{}},[Fe]);const Hn=$?z.length>0?n.jsx("div",{className:"training-steps",children:bt.map((ie,ve)=>on(ie,ve))},`replay-${Ie}`):n.jsx("div",{className:`page-popup__content page-popup__content--center${e.contentFull?" page-popup__content--full":""}`,children:n.jsx("div",{className:"pp-empty",children:t?.emptyMessage||L("training.noQuestions","\uBB38\uC81C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")})}):null,_n=S?n.jsxs(Wc.Provider,{value:jn,children:[We?.pageTop?n.jsx("div",{className:"training-page-top",children:We.pageTop}):null,n.jsx("div",{className:"training-steps",children:nt.map((ie,ve)=>{const Me=ie;return o.cloneElement(Me,{...Me.props,_stepIndex:ve,_totalSteps:nt.length,_stepKey:`step-${ve}`,_pageIndex:Fe})})},`replay-${Ie}`),We?.pageBottom?n.jsx("div",{className:"training-page-bottom",children:We.pageBottom}):null]}):null,Vt=o.useRef(-1),$t=o.useCallback(()=>{if(!w)return;const ie=Qe,{results:ve,correct:Me,total:Je}=xs(Qe),Oe={correct:Me,total:Je,attempt:mt.current.length+1,previousAttempts:[...mt.current]};if(Vt.current===wt.current)return Oe;Vt.current=wt.current,bC({items:vC(ve),category:Jc.has(w)?"sentence":"word",trainingType:w,entryPoint:B??"sentence",itemRef:D??null,correct:Me,total:Je,score:typeof ie?.score=="number"?ie.score:null,durationSeconds:Math.max(0,Math.round((Date.now()-G.current)/1e3)),dailyTotal:E??null});try{x?.(Oe)}catch{}return Oe},[w,B,E,D,Qe,x]);o.useEffect(()=>{!Qe||Qe===Tn||Qe?.isEmpty||(xs(Qe).total??0)>0&&$t()},[Qe,$t]);const qt=o.useCallback(()=>{const ie=$t();Ct(),Ue(()=>{typeof y=="function"&&y(ie),typeof f=="function"&&f()})},[y,f,$t,dt,Ue]),fn=o.useCallback(()=>gt(""),[gt]),Ot=o.useCallback(()=>{Ue(()=>{typeof f=="function"&&f()})},[f,Ue]),sn=n.jsxs("div",{className:`page-popup${ft?" page-popup--closing":""}`,role:"dialog","aria-modal":"true","aria-label":Ht,children:[n.jsxs("div",{ref:Te,className:`page-popup__panel ${je?"":"page-popup__panel--measuring"} ${ct==="center"?"page-popup__panel--center":ct==="top"?"page-popup__panel--top":""}`,children:[n.jsx(Pc,{title:Mn,subtitle:$?q.subtitle||q.label:Array.isArray(i)?i.join(" / "):void 0,desc:$?void 0:r,depth:$?q.depth:i,icon:$?q.icon:s,wrapperStyle:$?q.wrapperStyle:l,iconTooltip:$?q.iconTooltip:u,progressMax:xt,progressIndex:Fe,pageIndex:Fe,pageCount:xt,onBack:Ot,onClose:Ot}),n.jsx("div",{className:"page-popup__scroll",children:n.jsx("div",{className:`page-popup__content ${ct==="center"?"page-popup__content--center":"page-popup__content--top"}${e.contentFull?" page-popup__content--full":""}`,children:S?_n:$?Hn:typeof g=="function"?g({registerOnNext:Lt,registerOnResult:et,panelRef:Te,setResultOverlay:dt}):g})}),n.jsx(Rc,{onSettings:h,onNext:vn,onResult:It,useNoiseSettingBtn:!!($?q.useNoiseSetting??!0:_),stepIndex:tt,stepCount:Re,pageIndex:Fe,pageCount:xt,resultOpen:!!(Qe&&!Qe.isEmpty),hideNoiseRows:P})]}),Qe&&!Qe.isEmpty&&(N??G_)({score:Qe.score,results:Qe.results||Qe.answers||[],contextsLength:Qe.results?Qe.results.length:Qe.answers?Qe.answers.length:0,onReplay:()=>{if(G.current=Date.now(),Qe!==Tn){const{correct:ie,total:ve}=xs(Qe);mt.current.push({correct:ie,total:ve})}if(Ct(),qe(ie=>ie+1),$){if(Ke(Sr()),typeof t?.onReplay=="function")try{t.onReplay()}catch{}return}if(S){Ke(Sr());return}try{const ie=Te.current&&Te.current._childOnResult;typeof ie=="function"&&ie({replay:!0})}catch{}},onClose:qt,pending:Qe===Tn}),Qe?.isEmpty&&n.jsx("div",{className:"page-popup page-popup--result-empty",role:"dialog","aria-modal":"true","aria-label":L("training.result.eyebrow","\uD6C8\uB828 \uC644\uB8CC"),children:n.jsxs("div",{className:"page-popup__panel page-popup__panel--center",children:[n.jsx("div",{className:"page-popup__scroll",children:n.jsx("div",{className:`page-popup__content page-popup__content--center${e.contentFull?" page-popup__content--full":""}`,children:n.jsx("div",{className:"page-popup__empty",children:L("training.result.eyebrow","\uD6C8\uB828 \uC644\uB8CC")})})}),n.jsx("div",{className:"page-popup__bottom",children:n.jsx(pe,{htmlType:"button",variant:"main",size:48,onClick:qt,label:L("training.result.done","\uC644\uB8CC")})})]})}),n.jsx(da,{message:Nt,position:"top",onClose:fn})]}),Dt=n.jsx(is.Provider,{value:He,children:sn});return typeof document<"u"&&document.body?en.createPortal(Dt,document.body):Dt}const On=K_;On.Page=Ar,On.ListenStep=Hc,On.ConfirmStep=Vc,On.ConfirmWithTextStep=qc,On.OrderListStep=Uc,On.CardStep=Gc,On.CardOrderStep=j_;function Y_({label:e,homonum:t}){const a=aa()?.(e,t)??"",{imgRef:r,loading:i,hasImage:s,onLoad:l,onError:u}=Uo(a);return s?n.jsxs("div",{className:"tooltip-word-image__cell",children:[i&&n.jsx("div",{className:"tooltip-word-image__spinner"}),n.jsx("img",{ref:r,src:a,alt:e,draggable:!1,style:{opacity:i?0:1},onLoad:l,onError:u})]}):n.jsx("div",{className:"tooltip-word-image__cell tooltip-word-image__cell--text h3",children:n.jsx("span",{children:e})})}function Qc({words:e,anchorRect:t}){const a=o.useRef(null),[r,i]=o.useState(null);return o.useLayoutEffect(()=>{if(!t||!a.current)return;const{offsetWidth:s,offsetHeight:l}=a.current,u=window.innerWidth;let c=t.left+t.width/2-s/2,d=t.top-l-8;d<8&&(d=t.bottom+8),c=Math.max(8,Math.min(c,u-s-8)),i({left:c,top:d})},[t]),!t||e.length===0?null:en.createPortal(n.jsx("div",{ref:a,className:"tooltip-word-image",style:{visibility:r?"visible":"hidden",left:r?.left??0,top:r?.top??-9999},children:n.jsx("div",{className:"tooltip-word-image__cells",children:e.map(s=>n.jsx(Y_,{label:s.label,homonum:s.homonum},`${s.label}_${s.homonum??1}`))})}),document.body)}function Z_({titleIcon:e,resultCount:t,resultUnit:a,searchQuery:r,items:i,groups:s,selected:l=[],onSelect:u,maxSelect:c,onClearSelection:d,onPrint:m,onPrintEmpty:p,className:f,emptyHint:y,sectionType:x="page",disc:C}){const{t:h,i18n:_}=xe.useTranslation(),g=_.language?.startsWith("ko")??!1,{anchorRect:A,openAt:b,close:k}=Ta(),[v,w]=o.useState(null),B=o.useCallback(()=>{k(),w(null)},[k]);Jy(B,!!v);const E=(r??"").trim(),D=/^[^,[\]\s]+$/.test(E)?E:"",N=D.length>0,O=r===void 0&&t===void 0,P=N?"match":O?"original":"ganada",[G,L]=o.useState(()=>P),[M,$]=o.useState("50"),[Z,q]=o.useState(1),[z,V]=o.useState(N);z!==N&&(V(N),L(P));const R=G==="match"&&!N||G==="original"&&!O?P:G,H=o.useMemo(()=>[...N?[{value:"match",label:h("wordSearch.sort.match",{defaultValue:"\uC2DC\uC791 \uC6B0\uC120"})}]:[],...O?[{value:"original",label:h("wordSearch.sort.original",{defaultValue:"\uBC1B\uC740 \uC21C\uC11C"})}]:[],{value:"ganada",label:h("wordSearch.sort.ganada",{defaultValue:"\uAC00\uB098\uB2E4\uC21C \u2191"})},{value:"ganada_desc",label:h("wordSearch.sort.ganadaDesc",{defaultValue:"\uAC00\uB098\uB2E4\uC21C \u2193"})},{value:"syllable",label:h("wordSearch.sort.syllable",{defaultValue:"\uC74C\uC808 \uC218 \u2191"})},{value:"syllable_desc",label:h("wordSearch.sort.syllableDesc",{defaultValue:"\uC74C\uC808 \uC218 \u2193"})},{value:"grade",label:h("wordSearch.sort.grade",{defaultValue:"\uB4F1\uAE09\uC21C \u2191"})},{value:"grade_desc",label:h("wordSearch.sort.gradeDesc",{defaultValue:"\uB4F1\uAE09\uC21C \u2193"})}],[h,N,O]),W=o.useMemo(()=>["10","25","50","100"].map(te=>({value:te,label:h("wordSearch.pageSize",{count:Number(te),defaultValue:`${te}\uAC1C\uC529 \uBCF4\uAE30`})})),[h]),I=te=>te.words?.[0],S=o.useMemo(()=>{const te=[...D].length,ue=tC(D),fe=new Map;return ge=>{let Ce=fe.get(ge);return Ce===void 0&&(Ce=ue((ge.words?.[0]?.label??"").slice(0,te))?0:1,fe.set(ge,Ce)),Ce}},[D]),j=o.useCallback((te,ue)=>{const fe=$e=>I($e)?.label??"",ge=$e=>I($e)?.syllables??[...fe($e)].length,Ce=$e=>($e.words??[]).reduce((He,Te)=>{const Ie=parseInt(Te.grade??"",10);return Number.isFinite(Ie)&&Ie<He?Ie:He},999);switch(R){case"match":return S(te)-S(ue)||an(fe(te),fe(ue));case"ganada":return an(fe(te),fe(ue));case"ganada_desc":return an(fe(ue),fe(te));case"syllable":return ge(te)-ge(ue)||an(fe(te),fe(ue));case"syllable_desc":return ge(ue)-ge(te)||an(fe(te),fe(ue));case"grade":return Ce(te)-Ce(ue)||an(fe(te),fe(ue));case"grade_desc":return Ce(ue)-Ce(te)||an(fe(te),fe(ue));default:return 0}},[R,S]),F=o.useMemo(()=>i.slice().sort(j),[i,j]),U=Number(M)||10,re=o.useMemo(()=>(s??[]).flatMap(te=>te.items.slice().sort(j).map(ue=>({item:ue,label:te.label}))),[s,j]),ne=s?re.length:F.length,le=Math.max(1,Math.ceil(ne/U)),K=Math.min(Z,le),oe=o.useMemo(()=>F.slice((K-1)*U,K*U),[F,K,U]),Ae=o.useMemo(()=>{if(!s)return null;const te=re.slice((K-1)*U,K*U),ue=new Map;for(const{item:fe,label:ge}of te)ue.has(ge)||ue.set(ge,[]),ue.get(ge).push(fe);return[...ue.entries()].map(([fe,ge])=>({label:fe,items:ge}))},[s,re,K,U]);o.useEffect(()=>{q(1)},[G,M,ne,r]);const Y=ne>0?n.jsxs("div",{className:"word-search-result-block__toolbar",children:[n.jsx(pn,{size:40,options:H,value:R,onChange:L,ariaLabel:h("wordSearch.sort.aria",{defaultValue:"\uC815\uB82C"})}),n.jsx(pn,{size:40,options:W,value:M,onChange:$,ariaLabel:h("wordSearch.pageSizeAria",{defaultValue:"\uD398\uC774\uC9C0 \uD06C\uAE30"})}),n.jsx(dr,{page:K,totalPages:le,onChange:q})]}):void 0,Q=te=>{u&&u(te)},me=t!==void 0&&a?n.jsxs(n.Fragment,{children:[h("wordSearch.resultTitlePrefix","\uCD1D "),n.jsx("span",{style:{color:"var(--color-main)"},children:t}),h("wordSearch.resultTitleSuffix",{unit:g?dC(a):a})]}):void 0,De=t!==void 0&&t>0&&c!==void 0&&a?h("wordSearch.resultDisc",{unit:g?mC(a):a,max:c,selected:l.length}):void 0,be=C??De;return n.jsxs(ma,{type:x,className:_e("word-search-result-block",f),children:[n.jsxs("div",{className:"word-search-result-block__inner",children:[(me||Y||be)&&n.jsxs("div",{className:"word-search-result-block__head",children:[n.jsxs("div",{className:"word-search-result-block__head-main",children:[e&&n.jsx(at,{icon:e,className:"word-search-result-block__head-icon"}),me&&n.jsx("span",{className:"word-search-result-block__title h3",children:me})]}),Y&&n.jsx("div",{className:"word-search-result-block__head-actions",children:Y}),be&&n.jsx("div",{className:"word-search-result-block__head-disc body-3",children:be})]}),(s?s.length===0:i.length===0)&&n.jsxs("div",{className:"word-search-result-block__empty-wrap",children:[n.jsx("p",{className:"word-search-result-block__empty body-3",children:h("wordSearch.emptyResult","\uAC80\uC0C9 \uACB0\uACFC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")}),y&&n.jsx("p",{className:"word-search-result-block__empty-hint body-3",children:y})]}),s?(Ae??[]).map(te=>n.jsx("div",{className:"word-search-result-block__group",children:n.jsx("div",{className:"word-search-result-block__items",children:te.items.map(ue=>{const fe=l.includes(ue.id);return n.jsx("div",{onMouseEnter:ge=>{b(ge.currentTarget),w(ue.words??[])},onMouseLeave:B,children:n.jsx(pe,{htmlType:"button",size:"word",align:"grid",label:(ue.words??[]).map(ge=>ge.label),subLabel:(ue.words??[]).some(ge=>ge.subLabel)?(ue.words??[]).map(ge=>ge.subLabel):void 0,selected:fe,onClick:()=>Q(ue.id),minWidth:200})},ue.id)})})},te.label)):n.jsx("div",{className:"word-search-result-block__items",children:oe.map(te=>{const ue=l.includes(te.id);return n.jsx("div",{onMouseEnter:fe=>{b(fe.currentTarget),w(te.words??[])},onMouseLeave:B,children:n.jsx(pe,{htmlType:"button",size:"word",align:"grid",label:(te.words??[]).map(fe=>fe.label),subLabel:(te.words??[]).some(fe=>fe.subLabel)?(te.words??[]).map(fe=>fe.subLabel):void 0,selected:ue,onClick:()=>Q(te.id),minWidth:200})},te.id)})}),v&&A&&n.jsx(Qc,{words:v,anchorRect:A})]}),le>1&&n.jsx("div",{className:"word-search-result-block__pagination-bottom",children:n.jsx(dr,{page:K,totalPages:le,onChange:q})}),(d||m)&&n.jsxs("div",{className:"word-search-result-block__actions",children:[d&&n.jsx(pe,{htmlType:"button",size:"56",type:"bar",label:h("common.resetSelection","\uC120\uD0DD \uCD08\uAE30\uD654"),selected:!1,disabled:l.length===0,onClick:l.length===0?void 0:d}),m&&n.jsx("div",{onClick:l.length===0?p:void 0,children:n.jsx(pe,{htmlType:"button",size:"56",type:"bar",variant:"main",label:h("wordTable.title","\uB2E8\uC5B4 \uD45C \uB9CC\uB4E4\uAE30"),disabled:l.length===0,onClick:l.length===0?void 0:m})})]})]})}function X_(e,t){return t.map(a=>{const r=typeof a=="string"?a:a.label,i=typeof a=="string"?void 0:a.displayLabel;return{label:r,value:e[r]??"",displayLabel:i}})}function J_({sections:e,selectedList:t,count:a,onCountChange:r,maxCount:i=4,minCount:s=1,combinationSections:l,combinationSectionsForSlot:u,onSelect:c,placeholder:d="-",className:m,title:p,titleIcon:f,disc:y,showInfoButton:x=!0,onClearPhoneme:C,onSearch:h,onSearchEmpty:_,searchDisabled:g=!1,searchLabel:A,searchChecking:b=!1,pairMode:k=!1,sectionType:v="page",beforeSearchContent:w,beforeContent:B,afterContent:E,hideCountControl:D=!1,ordinal:N=!1}){const{t:O}=xe.useTranslation(),P=o.useMemo(()=>O("wordPairs.infoNotes",{returnObjects:!0}),[O]),G=o.useMemo(()=>Array.from({length:i-s+1},(S,j)=>{const F=s+j;return{key:String(F),label:O("wordPairs.count",{n:F})}}),[O,i,s]),L=o.useMemo(()=>O("wordPairs.ordinals",{returnObjects:!0}),[O]),M=o.useCallback(S=>N?O("wordPairs.phonemeOrdinalLabel",{ordinal:L[S-1]??S}):a===1?O("wordPairs.phonemeSingleLabel","\uC74C\uC808"):O("wordPairs.phonemeN",{n:S}),[N,L,a,O]),$=o.useCallback(S=>N?O("wordPairs.phonemeContrastOrdinalLabel",{ordinal:L[S-1]??S}):a===1?O("wordPairs.phonemeContrastSingleLabel","\uB300\uB9BD \uC74C\uC808"):O("wordPairs.phonemeContrast",{n:S}),[N,L,a,O]),Z=o.useCallback((S,j)=>j?n.jsxs(n.Fragment,{children:[S,n.jsx("span",{className:"phoneme-select-block__required",children:"*"})]}):S,[]),{anchorRect:q,toggleAt:z,close:V}=Ta(),R=o.useCallback(S=>r(Number(S)),[r]),H=ln("(max-width: 767px)"),W=o.useCallback(S=>X_(S,e).map(({label:j,value:F,displayLabel:U})=>{const re=!!F&&F!=="\uC5C6\uC74C";return n.jsxs("span",{className:_e("phoneme-select-block__cell-jamo-part",F?"":"phoneme-select-block__cell-jamo-part--empty",re?"":"phoneme-select-block__cell-jamo-part--no-label"),children:[n.jsx("span",{className:`phoneme-select-block__cell-jamo-char h1${F==="\uC5C6\uC74C"?" phoneme-select-block__cell-jamo-char--excluded":""}`,children:F==="\uC5C6\uC74C"?"x":F||d}),re&&n.jsx("span",{className:"phoneme-select-block__cell-jamo-label caption-2",children:U??j})]},j)}),[e,d]),I=n.jsxs(n.Fragment,{children:[n.jsx("div",{"data-tooltip-ignore":!0,children:n.jsx(pe,{htmlType:"button",size:40,type:H?"dot":void 0,icon:"info",label:H?void 0:O("wordPairs.caution","\uC720\uC758\uC0AC\uD56D"),ariaLabel:O("wordPairs.caution","\uC720\uC758\uC0AC\uD56D"),className:q?"is-selected":void 0,"aria-expanded":!!q,"aria-haspopup":"dialog",onClick:S=>z(S.currentTarget)})}),q&&n.jsx(Kn,{title:O("wordPairs.caution","\uC720\uC758\uC0AC\uD56D"),items:P,anchorRect:q,onClose:V})]});return n.jsxs(ma,{type:v,title:p,icon:f,disc:y,action:x?I:void 0,className:_e("phoneme-select-block",m),children:[B,!D&&n.jsx("div",{className:"phoneme-select-block__controls",children:n.jsx(gn,{options:G,value:String(a),onChange:R,size:40,ariaLabel:O("wordPairs.countLabel","\uC74C\uC18C \uAC1C\uC218"),className:"phoneme-select-block__count-control"})}),n.jsx("div",{className:"phoneme-select-block__cells",children:k?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"phoneme-select-block__cell-group",children:Array.from({length:a}).map((S,j)=>{const F=t[j*2]??{};return n.jsxs("div",{className:"phoneme-select-block__cell",children:[n.jsx("div",{className:"phoneme-select-block__cell-circle",children:n.jsx("div",{className:"phoneme-select-block__cell-jamo",children:W(F)})}),n.jsx("span",{className:"phoneme-select-block__cell-index caption-1",children:M(j+1)})]},j)})}),n.jsx("span",{className:"phoneme-select-block__cell-vs h3",children:O("wordPairs.phonemeSelect.vs","\uB300")}),n.jsx("div",{className:"phoneme-select-block__cell-group",children:Array.from({length:a}).map((S,j)=>{const F=t[j*2+1]??{};return n.jsxs("div",{className:"phoneme-select-block__cell",children:[n.jsx("div",{className:"phoneme-select-block__cell-circle",children:n.jsx("div",{className:"phoneme-select-block__cell-jamo",children:W(F)})}),n.jsx("span",{className:"phoneme-select-block__cell-index caption-1",children:$(j+1)})]},j)})})]}):t.map((S,j)=>n.jsxs("div",{className:"phoneme-select-block__cell",children:[n.jsx("div",{className:"phoneme-select-block__cell-circle",children:n.jsx("div",{className:"phoneme-select-block__cell-jamo",children:W(S)})}),n.jsx("span",{className:"phoneme-select-block__cell-index caption-1",children:M(j+1)})]},j))}),(l||u)&&n.jsx("div",{className:"phoneme-select-block__panels",children:n.jsx("div",{className:"phoneme-select-block__detail",children:k?n.jsxs("div",{className:"phoneme-select-block__pair-panels",children:[n.jsx("div",{className:"phoneme-select-block__panel-group",children:Array.from({length:a}).map((S,j)=>{const F=t[j*2]??{};return n.jsx(Dn,{title:Z(M(j+1),j===0),sections:u?u(F,j*2):l,selected:F,onSelect:c?.(j*2),align:"newline"},j)})}),n.jsx("div",{className:"phoneme-select-block__panel-group",children:Array.from({length:a}).map((S,j)=>{const F=t[j*2+1]??{};return n.jsx(Dn,{title:$(j+1),sections:u?u(F,j*2+1):l,selected:F,onSelect:c?.(j*2+1),align:"newline"},j)})})]}):t.map((S,j)=>n.jsx(Dn,{title:Z(M(j+1),j===0),sections:u?u(S,j):l,selected:S,onSelect:c?.(j),align:"newline"},j))})}),w&&n.jsx("div",{className:"phoneme-select-block__before-search",children:w}),(C||h||b)&&(()=>{const S=t.every(j=>{const F=Xf(j);return Object.entries(F).every(([U,re])=>!re||U==="coda"&&re===Bi)});return n.jsxs("div",{className:"phoneme-select-block__search-row",onClick:S?_:void 0,children:[C&&n.jsx(pe,{htmlType:"button",size:"56",type:"bar",label:O("wordPairs.resetOptions","\uAC80\uC0C9 \uC635\uC158 \uCD08\uAE30\uD654"),selected:!1,disabled:S,onClick:S?void 0:C}),h?n.jsx(pe,{htmlType:"button",size:"56",type:"bar",variant:"main",icon:b?n.jsx("span",{className:"phoneme-select-block__spinner","aria-hidden":"true"}):void 0,label:A??O("wordSearch.searchButton","\uAC80\uC0C9\uD558\uAE30"),disabled:S||g||b,onDisabledClick:b?()=>{}:void 0,"aria-busy":b||void 0,onClick:h}):b?n.jsxs("div",{className:"phoneme-select-block__checking","aria-busy":"true",children:[n.jsx("div",{className:"phoneme-select-block__spinner"}),n.jsx("span",{className:"button-1 phoneme-select-block__checking-label",children:A??O("wordSearch.searchButton","\uAC80\uC0C9\uD558\uAE30")})]}):null]})})(),E]})}function Q_({title:e,sections:t,selected:a,onSelect:r,collapsible:i,defaultCollapsed:s,collapsed:l,onCollapsedChange:u,headerSummary:c,headerAction:d,className:m}){const{t:p}=xe.useTranslation();return n.jsx(Dn,{className:m,title:e??p("wordSearch.filterTitle","\uB2E8\uC5B4 \uAC80\uC0C9 \uC124\uC815"),sections:t,selected:a,onSelect:r,collapsible:i,defaultCollapsed:s,collapsed:l,onCollapsedChange:u,headerSummary:c,headerAction:d,align:"inline"})}function ew({title:e,headerAction:t,sections:a,selected:r,onSelect:i,className:s}){const{t:l}=xe.useTranslation();return a.length===0?null:n.jsx(Dn,{className:s,title:e??l("training.filter.phonemeGroup",{defaultValue:"\uD6C8\uB828 \uC74C\uC808"}),headerAction:t,sections:a,selected:r,onSelect:i,align:"newline"})}function tw({title:e,mode:t,onModeChange:a,matchMode:r,onMatchModeChange:i,positionCount:s,onPositionCountChange:l,inputMode:u,onInputModeChange:c,className:d}){const{t:m}=xe.useTranslation(),p={searchMode:m("wordPairs.filter.searchModeLabel","\uB300\uB9BD \uBC29\uC2DD"),phonemeOrder:m("wordPairs.filter.phonemeOrder","\uC785\uB825 \uC74C\uC808 \uC704\uCE58"),count:m("wordPairs.filter.countLabel","\uC785\uB825 \uC74C\uC808 \uAC2F\uC218"),inputMode:m("wordPairs.filter.inputModeLabel","\uC785\uB825 \uBC29\uC2DD"),orderAny:m("wordPairs.filter.orderAny","\uBB34\uAD00"),orderMatch:m("wordPairs.filter.orderMatch","\uC77C\uCE58"),include:m("wordPairs.mode.include","\uC74C\uC18C \uD3EC\uD568"),pick:m("wordPairs.mode.pick","\uC74C\uC18C \uB300\uB9BD"),explicit:m("wordPairs.mode.contrast","\uC74C\uC18C \uB300\uB9BD \uC9C0\uC815"),charInput:m("wordPairs.input.char","\uAE00\uC790 \uC120\uD0DD"),pronInput:m("wordPairs.input.pron","\uBC1C\uC74C \uC120\uD0DD")},f=h=>m("wordPairs.count",{n:h}),y=[{label:p.searchMode,items:[p.include,p.pick,p.explicit],display:"segmented",labelAction:n.jsx(Pa,{title:m("wordPairs.mode.infoTitle","\uB300\uB9BD \uBC29\uC2DD"),items:[m("wordPairs.mode.infoInclude","\uC74C\uC18C \uD3EC\uD568 \u2014 \uC120\uD0DD\uD55C \uC74C\uC18C\uAC00 \uBAA8\uB450 \uB4E4\uC5B4\uAC04 \uB2E8\uC5B4\uC640 \uADF8 \uB300\uB9BD\uC30D\uC744 \uCC3E\uC544\uC694."),m("wordPairs.mode.infoPick","\uC74C\uC18C \uB300\uB9BD \u2014 \uC120\uD0DD\uD55C \uC74C\uC18C\uAC00 \uB300\uB9BD\uC30D \uB450 \uB2E8\uC5B4\uC758 \uC2E4\uC81C \uCC28\uC774\uC810\uC77C \uB54C\uB9CC \uB9E4\uCE6D\uB3FC\uC694."),m("wordPairs.mode.infoContrast","\uC74C\uC18C \uB300\uB9BD \uC9C0\uC815 \u2014 \uAE30\uC900 \uB2E8\uC5B4\uC640 \uB300\uB9BD \uB2E8\uC5B4\uC758 \uC74C\uC18C\uB97C \uAC01\uAC01 \uC9C1\uC811 \uC120\uD0DD\uD574 \uB300\uB9BD\uC30D\uC744 \uCC3E\uC544\uC694.")]})},{label:p.phonemeOrder,items:[p.orderAny,p.orderMatch],display:"segmented",labelAction:n.jsx(Pa,{items:m("wordPairs.filter.phonemeOrderInfo",{returnObjects:!0})})},{label:p.count,items:[f(1),f(2)],display:"segmented"},{label:p.inputMode,items:[p.charInput,p.pronInput],display:"segmented",labelAction:n.jsx(Pa,{title:m("wordPairs.input.infoTitle","\uC785\uB825 \uBC29\uC2DD"),items:[m("wordPairs.input.infoChar","\uAE00\uC790 \uC120\uD0DD \u2014 \uC120\uD0DD\uD55C \uC74C\uC18C\uB85C \uB2E8\uC5B4(\uAE00\uC790 \uAE30\uC900)\uB97C \uCC3E\uC740 \uD6C4, \uB2E8\uC5B4\uC758 \uD45C\uC900 \uBC1C\uC74C \uB300\uB9BD\uC30D\uC744 \uCC3E\uC2B5\uB2C8\uB2E4."),m("wordPairs.input.infoPron","\uBC1C\uC74C \uC120\uD0DD \u2014 \uC120\uD0DD\uD55C \uC74C\uC18C\uB85C \uD45C\uC900 \uBC1C\uC74C \uB300\uB9BD\uC30D\uC744 \uCC3E\uC2B5\uB2C8\uB2E4.")]})}],x={[p.searchMode]:t==="explicit"?p.explicit:t==="pick"?p.pick:p.include,[p.phonemeOrder]:r==="ordered"?p.orderMatch:p.orderAny,[p.count]:f(s),[p.inputMode]:u==="phoneme"?p.pronInput:p.charInput},C=(h,_)=>{_===p.searchMode?a(h===p.explicit?"explicit":h===p.pick?"pick":"include"):_===p.phonemeOrder?i(h===p.orderMatch?"ordered":"unordered"):_===p.count?l(h===f(2)?2:1):_===p.inputMode&&c(h===p.pronInput?"phoneme":"word")};return n.jsx(Dn,{className:d,title:e??m("wordPairs.filter.searchOptionsTitle","\uB300\uB9BD \uC124\uC815"),sections:y,selected:x,onSelect:C,align:"inline"})}function nw(e){const{title:t,items:a,columns:r,resizeStorageKey:i,gridTemplateColumns:s,mobileGridTemplateColumns:l,searchPlaceholder:u,searchFn:c,defaultSortKey:d,defaultSortAsc:m=!0,selectedId:p,selectedIds:f,onSelect:y,onClose:x,pageSizeOptions:C=[10,25,50,100],initialPageSize:h,emptyText:_,noMatchText:g,countLabel:A,topContent:b,className:k=""}=e,{t:v}=xe.useTranslation(),w=u??v("common.search","\uAC80\uC0C9"),B=_??v("common.emptyList","\uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."),E=g??v("common.noMatches","\uB9DE\uB294 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"),[D,N]=o.useState(""),[O,P]=o.useState(d??r[0]?.key??""),[G,L]=o.useState(m),[M,$]=o.useState(String(h??C[0]??10)),[Z,q]=o.useState(1);o.useEffect(()=>{q(1)},[D,M]);const z=c!==null,V=o.useCallback((ne,le)=>{if(!le)return!0;const K=le.toLowerCase();return r.some(oe=>{const Ae=ne[oe.key];return Ae==null?!1:String(Ae).toLowerCase().includes(K)})},[r]),R=c??V,H=o.useMemo(()=>{const ne=z?a.filter(le=>R(le,D)):a;return O?[...ne].sort((le,K)=>{const oe=le[O],Ae=K[O];return oe===Ae?0:yo(oe,Ae,G)}):ne},[a,D,O,G,z,R]),W=Math.max(1,Math.ceil(H.length/Number(M)));Z>W&&q(W);const I=Math.min(Z,W),S=H.slice((I-1)*Number(M),I*Number(M)),j=o.useCallback(ne=>{O===ne?L(le=>!le):(P(ne),L(!0)),q(1)},[O]),F=o.useMemo(()=>{if(typeof A=="function"){const ne=H.length,le=A(ne);if(typeof le=="string"){const K=le.lastIndexOf(String(ne));if(K>=0)return{prefix:le.slice(0,K),suffix:le.slice(K+String(ne).length)}}return{label:le}}if(typeof A=="string"&&A.includes("{n}")){const[ne,le]=A.split("{n}");return{prefix:ne,suffix:le}}return{prefix:v("common.totalCountPrefix","\uCD1D "),suffix:v("common.totalCountSuffix","\uAC1C")}},[A,H.length,v]),U=o.useMemo(()=>r.map(ne=>({label:ne.label,onClick:ne.sortable!==!1?()=>j(ne.key):void 0,className:ne.className,sortDir:ne.sortable!==!1&&O===ne.key?G?"asc":"desc":null})),[r,O,G,j]),re=o.useMemo(()=>C.map(ne=>({value:String(ne),label:v("common.pageSizeLabel",{n:ne})})),[C,v]);return n.jsxs(Fn,{className:`popup-list ${k}`,title:t,onClose:x,children:[b,"label"in F&&n.jsx("p",{className:"toolbar__count body-1",children:F.label}),n.jsx(jo,{count:"label"in F?void 0:{value:H.length,prefix:F.prefix,suffix:F.suffix},search:z?{value:D,onChange:N,placeholder:w}:void 0,pageSize:{options:re,value:M,onChange:$},pagination:{page:I,total:W,onChange:q}}),n.jsx(Ho,{size:"medium",gridTemplateColumns:s,mobileGridTemplateColumns:l,resizable:!0,resizeStorageKey:i,fields:U,items:S,onRowClick:y,renderRow:ne=>{const le=f!=null?ne.id!=null&&f.has(ne.id):p!=null&&ne.id===p;return r.map(K=>({content:K.render?K.render(ne):ne[K.key]??"",className:_e(K.className,le&&"popup-list__row--selected")}))},empty:z&&D!==""&&a.length>0?E:B})]})}function ed(e){const{title:t,message:a,topContent:r,details:i,children:s,confirmLabel:l,cancelLabel:u,hideCancel:c=!1,extraAction:d,confirmVariant:m="main",confirmDisabled:p=!1,onConfirm:f,closeOnConfirm:y=!0,onClose:x,inline:C,size:h="small",className:_,initialFocus:g="close"}=e,{t:A}=xe.useTranslation(),b=o.useRef(null);o.useEffect(()=>{if(C||g==="close")return;const D=b.current?.closest(".popup-panel"),N=Array.from(D?.querySelectorAll(".popup-footer--buttons button")??[]),O=g==="confirm"?N[N.length-1]:c?void 0:N[d?1:0];O&&!O.disabled&&O.focus()},[]);const k=o.useRef(!1),[v,w]=o.useState(!1),B=D=>{let N=!1;return{close:()=>{N=!0,D()},didClose:()=>N}},E=async D=>{if(k.current)return;k.current=!0;const N=typeof document<"u"?document.activeElement:null;w(!0);let O=!1;try{O=await D()}catch(P){typeof console<"u"&&console.error(P)}finally{O||(k.current=!1,w(!1),requestAnimationFrame(()=>{const P=document.activeElement;(!P||P===document.body)&&N?.isConnected&&N.focus()}))}};return n.jsxs(Fn,{title:t,onClose:x,closeDisabled:v,inline:C,size:h,className:_e("confirm-popup",r!=null&&"confirm-popup--has-top",_),buttons:[...d?[{label:d.label,variant:d.variant??"default",disabled:d.disabled||v,onClick:async({closeWithAnimation:D})=>{await E(async()=>{const N=B(D);await d.onClick(N.close);const O=d.closeOnClick??!0;return O&&D(),O||N.didClose()})}}]:[],...c?[]:[{label:u??A("common.cancel","\uCDE8\uC18C"),variant:"default",disabled:v,onClick:({closeWithAnimation:D})=>D()}],{label:l??A("common.confirm","\uD655\uC778"),variant:m,disabled:p||v,onClick:async({closeWithAnimation:D})=>{await E(async()=>{const N=B(D);return await f(N.close),y&&D(),y||N.didClose()})}}],children:[r!=null&&n.jsx("div",{className:"confirm-popup__top",children:r}),i&&i.length>0&&n.jsx(Br,{children:i.map((D,N)=>n.jsx(Sn,{label:D.label,children:n.jsx("span",{className:"panel-row__text body-2",children:D.value})},N))}),n.jsx("p",{ref:b,className:"body-2 confirm-popup__message",children:a}),s]})}function aw(e,t,a={}){const{t:r}=xe.useTranslation(),[i,s]=o.useState(!1),l=o.useRef(!1),u=o.useCallback(()=>{l.current=!0},[]),c=o.useCallback(()=>l.current?(l.current=!1,!0):e?(s(!0),!1):!0,[e]),d=i?n.jsx(ed,{title:a.title??r("common.discardConfirm.title","\uC785\uB825\uC744 \uCDE8\uC18C\uD560\uAE4C\uC694?"),message:a.message??r("common.discardConfirm.body","\uC800\uC7A5\uD558\uC9C0 \uC54A\uC73C\uBA74 \uC9C0\uAE08\uAE4C\uC9C0 \uC785\uB825\uD55C \uB0B4\uC6A9\uC774 \uC0AC\uB77C\uC9D1\uB2C8\uB2E4."),confirmLabel:a.confirmLabel??r("common.discardConfirm.confirm","\uC785\uB825 \uCDE8\uC18C"),confirmVariant:"danger",onConfirm:()=>{s(!1),t()},onClose:()=>s(!1)}):null;return{beforeClose:c,discardPopup:d,allowClose:u}}function rw({onApply:e,onCancel:t}){const{t:a}=xe.useTranslation(),[r,i]=o.useState(""),[s,l]=o.useState(!1),[u,c]=o.useState(null),d=o.useRef(null),m=o.useId();o.useEffect(()=>{d.current?.focus()},[]);const p=o.useCallback(async x=>{const C=r.trim();if(C){l(!0),c(null);try{await e(C),x()}catch(h){c(Ei(h)),l(!1),requestAnimationFrame(()=>d.current?.focus())}}},[r,e]),f=o.useCallback((x,C)=>{x.key==="Enter"&&!x.nativeEvent.isComposing&&p(C)},[p]),y=x=>{i(x.target.value),c(null)};return n.jsx(Fn,{className:"coupon-input-popup",title:a("usage.couponButton","\uCFE0\uD3F0 \uC785\uB825"),size:"small",onClose:t,closeDisabled:s,buttons:[{label:a("common.cancel","\uCDE8\uC18C"),variant:"default",disabled:s,onClick:({closeWithAnimation:x})=>x()},{label:a("coupons.applyButton","\uC801\uC6A9"),variant:"main",disabled:!r.trim()||s,onClick:({closeWithAnimation:x})=>{p(x)}}],children:({closeWithAnimation:x})=>n.jsxs(n.Fragment,{children:[n.jsx("input",{ref:d,className:"coupon-input-popup__input body-2","aria-label":a("coupons.input.label","\uCFE0\uD3F0 \uCF54\uB4DC"),"aria-invalid":u?!0:void 0,"aria-errormessage":u?m:void 0,"aria-describedby":u?m:void 0,placeholder:a("coupons.input.placeholder","\uCFE0\uD3F0 \uCF54\uB4DC \uC785\uB825"),value:r,onChange:y,onKeyDown:C=>f(C,x),disabled:s,autoComplete:"off",spellCheck:!1}),u&&n.jsx("p",{id:m,className:"coupon-input-popup__error caption-1",role:"alert",children:u})]})})}const td=["var(--color-main)","var(--color-sub)"],ow=2e3;function sw(e,t){if(!t.startsWith("var("))return t;try{const a=t.slice(4,-1).trim();return getComputedStyle(e).getPropertyValue(a).trim()||null}catch{return null}}function _s({active:e=!1,count:t=40,duration:a=2e3,strength:r=1,onComplete:i,trigger:s=0}){const l=o.useMemo(()=>{const C=Math.floor(t/2),h=t-C,_=(g,A)=>Array.from({length:g}).map((b,k)=>{const v=6+Math.random()*12,w=Math.round(Math.min(18,v*Math.min(1.5,1+r*.4))),B=td[Math.floor(Math.random()*td.length)],E=Math.random()*300,D=(360+Math.random()*260)*r*1.2,N=(A==="left"?-95+Math.random()*40:-85-Math.random()*40)*Math.PI/180,O=Math.cos(N)*D,P=Math.sin(N)*D*1.35,G=Math.random()*720-360,L=(1200+Math.random()*3e3)*Math.min(1.6,1+r*.3),M=Math.random()>.7?"50%":"3px";return{id:`${A}-${k}`,side:A,size:w,color:B,delay:E,vx:O,vy:P,angularVel:G,life:L,borderRadius:M}});return[..._(C,"left"),..._(h,"right")]},[t,r]),u=o.useRef(null),c=o.useRef({}),d=o.useRef(null),m=o.useRef(i);o.useEffect(()=>{m.current=i},[i]);const p=o.useRef(null),f=o.useRef(null),y=()=>{if(typeof document>"u")return null;let C=document.querySelector("[data-ihab-effect-root]");return C||(C=document.createElement("div"),C.className="app-effect",C.dataset.ihabEffectRoot="",C.style.position="fixed",C.style.inset="0",C.style.pointerEvents="none",C.style.zIndex="99998",document.body.appendChild(C)),C};if(typeof document<"u"&&f.current==null&&(f.current=y()),o.useEffect(()=>{if(!e)return;if(typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches){const V=setTimeout(()=>m.current?.(),0);return()=>clearTimeout(V)}const C=1200,h=performance.now(),_=f.current&&f.current!==document.body?f.current.getBoundingClientRect():null,g=Math.max(60,(window.innerHeight||800)*.05),A=V=>Math.max(40,(V||window.innerWidth)*.02),b=_?.width||window.innerWidth||375,k=_?.height||window.innerHeight||812,v=V=>{const R=[...V].sort((H,W)=>H-W);return R[Math.floor(R.length/2)]||1},w=v(l.map(V=>Math.abs(V.vy))),B=v(l.map(V=>Math.abs(V.vx))),E=Math.sqrt(2*C*(k*.72+g))/w,D=w*E/C,N=b*.5/(B*D),O=(V,R,H)=>Math.min(H,Math.max(R,V)),P=O(E,.8,2.4),G=O(N,.7,2.2),L=a>0?a/ow:1,M=l.map(V=>({...V,life:V.life*L,vx:V.vx*G,vy:V.vy*P,startTime:h+V.delay,ended:!1})),$=_?{x:_.left-A(_.width),y:_.top+_.height+g}:{x:-A(window.innerWidth),y:window.innerHeight+g},Z=_?{x:_.left+_.width+A(_.width),y:_.top+_.height+g}:{x:window.innerWidth+A(window.innerWidth),y:window.innerHeight+g},q=V=>{let R=!1;for(const H of M){const W=c.current[H.id];if(!W||!W)continue;if(V<H.startTime){W.style.display="none",R=!0;continue}if(!H._inited){const oe=H.side==="left"?$.x:Z.x,Ae=H.side==="left"?$.y:Z.y;W.style.left=`${oe}px`,W.style.top=`${Ae}px`,W.style.transform="translate3d(0px, 0px, 0)",W.style.display="block",W.style.zIndex="100000",typeof H.color=="string"&&H.color.startsWith("var(")&&(W.style.background=sw(W,H.color)??"#FF0060"),H._inited=!0}const I=(V-H.startTime)/1e3;if(I<0)continue;const S=H.life/1e3;if(I>=S){W.style.opacity="0",W.style.display="none",H.ended=!0;continue}R=!0;const j=H.side==="left"?$.x:Z.x,F=H.side==="left"?$.y:Z.y,U=j+H.vx*I,re=F+H.vy*I+.5*C*I*I,ne=(H.angularVel||0)*I,le=U-j,K=re-F;W.style.transform=`translate3d(${le}px, ${K}px, 0) rotate(${ne}deg)`,W.style.opacity=`${Math.max(0,1-I/S)}`}R?d.current=requestAnimationFrame(q):m.current?.()};d.current=requestAnimationFrame(q);const z=setTimeout(()=>{try{if((f.current?f.current.querySelectorAll(".confetti"):document.querySelectorAll(".confetti")).length===0&&!document.querySelector(".party-container")){const V=document.createElement("div");V.className="party-container",V.style.position="fixed",V.style.inset="0",V.style.pointerEvents="none",V.style.overflow="visible",V.style.zIndex="2147483647";for(const R of l){const H=document.createElement("span");H.className=`confetti confetti--${R.side}`,H.setAttribute("aria-hidden","true"),H.style.display="none",H.style.position="fixed",H.style.left="0px",H.style.top="0px",H.style.width=`${R.size}px`,H.style.height=`${Math.max(4,R.size*.6)}px`,H.style.background=R.color,H.style.borderRadius=R.borderRadius,H.style.transform="translate3d(0,0,0)",H.style.opacity="0",V.appendChild(H),c.current[R.id]=H}(document.body||f.current).appendChild(V),p.current=V}}catch{}},300);return()=>{if(d.current&&cancelAnimationFrame(d.current),clearTimeout(z),p.current){try{p.current.remove()}catch{}p.current=null}}},[e,a,s,l]),!e)return null;const x=n.jsx("div",{className:"party-container",ref:u,children:l.map(C=>n.jsx("span",{"aria-hidden":!0,ref:h=>{c.current[C.id]=h},className:`confetti confetti--${C.side}`,style:{width:`${C.size}px`,height:`${Math.max(4,C.size*.6)}px`,background:C.color,borderRadius:C.borderRadius}},`${C.id}-${s}`))});return typeof document<"u"?en.createPortal(x,f.current||document.body):x}const ws=e=>typeof e=="number"&&Number.isFinite(e)&&e>0?e:void 0;function iw({trigger:e=0,active:t=!1}){const[a,r]=o.useState(null);o.useEffect(()=>{if(typeof window>"u")return;const s=l=>{const u=l.detail??{};r(c=>({n:(c?.n??0)+1,count:ws(u.count),strength:ws(u.strength),duration:ws(u.duration)}))};return window.addEventListener("party:trigger",s),()=>window.removeEventListener("party:trigger",s)},[]);const i=o.useCallback(()=>r(null),[]);return n.jsxs(n.Fragment,{children:[n.jsx(_s,{active:t,trigger:e}),a&&n.jsx(_s,{active:!0,trigger:a.n,count:a.count,strength:a.strength,duration:a.duration,onComplete:i})]})}function lw({title:e,sub:t,rightAction:a,titleAction:r,badge:i,badgeVariant:s="default",documentTitle:l,onBack:u,backLabel:c,wrap:d=!1}){const{t:m}=xe.useTranslation();Iy(typeof e=="string"?e:l??null);const p=c??m("common.back","\uB4A4\uB85C");return n.jsxs("div",{className:d?"page-title page-title--wrap":"page-title",children:[n.jsxs("div",{className:"page-title__main",children:[n.jsxs("div",{className:"page-title__title-row",children:[u&&n.jsx(pe,{htmlType:"button",className:"page-title__back",size:48,type:"dot",icon:"chevron-left",iconSize:"large",useBorder:!1,iconColor:"var(--color-text-primary)",ariaLabel:p,showTooltipInfo:p,onClick:u}),n.jsx("h1",{className:"page-title__title h1",children:e}),i&&n.jsx("div",{className:"page-title__badge",children:n.jsx(At,{label:i,size:"small",variant:s,fill:"outline"})}),r?n.jsx("div",{className:"page-title__title-action",children:r}):null]}),t&&n.jsx("p",{className:"page-title__sub body-2",children:t})]}),a?n.jsx("div",{className:"page-title__action",children:a}):null]})}function uw(e){return e??""}const nd=o.createContext({words:[],loading:!1});function cw(){return o.useContext(nd)}function dw({words:e,loading:t,error:a,statusMessage:r,localVersion:i,remoteVersion:s,progress:l,clearAndRefetch:u,checkRemoteVersion:c,children:d}){const m=o.useMemo(()=>({words:e,loading:t,error:a,statusMessage:r,localVersion:i,remoteVersion:s,progress:l,clearAndRefetch:u,checkRemoteVersion:c}),[e,t,a,r,i,s,l,u,c]);return n.jsx(nd.Provider,{value:m,children:d})}function pw({items:e,actions:t,columns:a,flat:r=!1,className:i,style:s}){const l=a??e.length;return n.jsx("section",{className:_e("summary-strip",r&&"summary-strip--flat",i),style:{"--summary-strip-cols":String(l),...s},children:n.jsxs("div",{className:"summary-strip__row",children:[n.jsx("div",{className:"summary-strip__items",children:e.map((u,c)=>n.jsxs("div",{className:"summary-strip__item",children:[n.jsx("p",{className:"summary-strip__label caption-1",children:u.label}),n.jsx("p",{className:"summary-strip__value body-3b",title:typeof u.value=="string"||typeof u.value=="number"?String(u.value):void 0,children:u.value})]},c))}),t&&n.jsx("div",{className:"summary-strip__actions",children:t})]})})}const mw=(e,t)=>`${e} / ${t}`;function hw({blocks:e,sectionTitles:t,logo:a,footer:r,pageLabel:i=mw,pageWidth:s,pageHeight:l,margin:u,className:c,style:d}){const{t:m}=xe.useTranslation(),p=o.useRef(null),f=o.useRef(null),y=o.useRef(null),x=o.useRef(null),[C,h]=o.useState(null),[_,g]=o.useState(!1);o.useEffect(()=>{const L=p.current;if(!L)return;const M=()=>g(L.scrollWidth>L.clientWidth+1);if(M(),typeof ResizeObserver>"u")return;const $=new ResizeObserver(M);return $.observe(L),()=>$.disconnect()},[C]);const A=e.map(L=>`${L.id}\0${L.section??""}\0${L.group??""}`).join(""),b=C&&C.shape===A?C.pages:null,[k,v]=o.useState(0);o.useEffect(()=>{const L=x.current;if(!L||typeof ResizeObserver>"u")return;const M=new ResizeObserver(()=>v(L.offsetHeight));return M.observe(L),()=>M.disconnect()},[]);const[w,B]=o.useState(0);o.useEffect(()=>{const L=f.current;if(!L||typeof ResizeObserver>"u")return;let M=null;const $=typeof requestAnimationFrame=="function"?z=>requestAnimationFrame(z):z=>setTimeout(z,16),Z=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:z=>clearTimeout(z),q=new ResizeObserver(()=>{M==null&&(M=$(()=>{M=null,B(z=>z+1)}))});return Array.from(L.children).forEach(z=>q.observe(z)),()=>{q.disconnect(),M!=null&&Z(M)}},[A]),o.useLayoutEffect(()=>{const L=f.current,M=x.current;if(!L||!M)return;const $=S=>S.getBoundingClientRect().height||S.offsetHeight,Z=new Map;y.current?.querySelectorAll("[data-chrome-section]").forEach(S=>{Z.set(S.dataset.chromeSection??"",$(S))});const q=S=>$(M)-(Z.get(S??"")??0),z=Array.from(L.children).map(S=>$(S)),V=[];e.forEach((S,j)=>{const F=V[V.length-1],U=F?e[F[0]]:void 0;U&&S.group!=null&&U.group===S.group&&U.section===S.section?F.push(j):V.push([j])});const R=[];let H=[],W=0;const I=()=>{H.length&&R.push(H),H=[],W=0};V.forEach(S=>{const j=S.reduce((U,re)=>U+z[re],0),F=q(e[S[0]].section);H.length&&e[H[0]].section!==e[S[0]].section&&I(),j>F?S.forEach(U=>{H.length&&W+z[U]>F+.01&&I(),H.push(U),W+=z[U]}):(H.length&&W+j>F+.01&&I(),S.forEach(U=>H.push(U)),W+=j)}),I(),h(S=>S&&S.shape===A&&JSON.stringify(S.pages)===JSON.stringify(R)?S:{shape:A,pages:R})},[A,k,s,l,u,w]);const E=Eo,D=E,N=r??n.jsxs(n.Fragment,{children:[n.jsx("img",{src:D,alt:"IHAB",className:"report-doc__logo"}),"\xA9 IHAB, Inc. All rights reserved."]}),O=(L,M,$)=>({header:n.jsxs("div",{className:"report-doc__header",children:[n.jsx("h2",{className:"report-doc__title h3b",children:$!=null&&t?.[$]||null}),a]}),footer:n.jsxs("div",{className:"report-doc__footer caption-1",children:[n.jsx("span",{className:"report-doc__footer-left",children:N}),n.jsx("span",{className:"report-doc__page-no",children:i(L,M)})]})}),P=Array.from(new Set(e.map(L=>L.section??""))),G={...s?{"--report-page-w":s}:null,...l?{"--report-page-h":l}:null,...u?{"--report-margin":u}:null,...d};return n.jsxs("div",{ref:p,className:_e("report-doc",c),style:G,tabIndex:_?0:void 0,role:_?"group":void 0,"aria-label":_?m("report.previewRegion","\uBCF4\uACE0\uC11C \uBBF8\uB9AC\uBCF4\uAE30"):void 0,children:[n.jsxs("div",{className:"report-doc__measure","aria-hidden":!0,children:[n.jsx("div",{ref:x,className:"report-doc__ruler"}),n.jsx("div",{ref:y,children:P.map(L=>{const M=O(1,1,L||void 0);return n.jsxs("div",{"data-chrome-section":L,children:[M.header,M.footer]},L)})}),n.jsx("div",{ref:f,className:"report-doc__measure-blocks",children:e.map(L=>n.jsx("div",{children:L.content},L.id))})]}),b&&n.jsx("div",{className:"report-doc__pages",children:b.map((L,M)=>{const{header:$,footer:Z}=O(M+1,b.length,e[L[0]].section);return n.jsxs("section",{className:"report-doc__page",children:[$,L.map(q=>n.jsx("div",{children:e[q].content},e[q].id)),Z]},M)})})]})}function fw({title:e,fields:t,columns:a=4,className:r,style:i}){return n.jsxs("div",{className:_e("report-info",r),style:{"--report-info-cols":String(a),...i},children:[e&&n.jsx("p",{className:"report-info__title h5b",children:e}),n.jsx("div",{className:"report-info__grid",children:t.map((s,l)=>n.jsxs("div",{className:"report-info__field body-2",children:[n.jsx("span",{className:"report-info__label body-3",children:s.label}),n.jsx("span",{className:"report-info__value",children:s.value})]},l))})]})}const ea=new Map;let Tr=null;const Cw=12;function gw(e){for(let t=e.parentElement;t&&t!==document.body;t=t.parentElement){const a=window.getComputedStyle(t);if(a.transform&&a.transform!=="none"||a.filter&&a.filter!=="none"||a.perspective&&a.perspective!=="none"||/paint|layout|strict|content/.test(a.contain||""))return t}return document}function jr(){const e=new Map;for(const t of ea.keys()){if(!t.isConnected)continue;const a=gw(t),r=e.get(a)??[];r.push(t),e.set(a,r)}for(const t of e.values()){t.sort((r,i)=>r.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1);let a=0;for(const r of t){a>0?r.style.setProperty("--update-alert-stack-offset",`${a}px`):r.style.removeProperty("--update-alert-stack-offset");const i=r.getBoundingClientRect().height;i>0&&(a+=i+Cw)}}}function bw(e){return typeof window>"u"?()=>{}:(ea.set(e,(ea.get(e)??0)+1),ea.get(e)===1&&typeof ResizeObserver<"u"&&(Tr??(Tr=new ResizeObserver(()=>jr())),Tr.observe(e)),jr(),()=>{const t=(ea.get(e)??1)-1;if(t>0){ea.set(e,t),jr();return}ea.delete(e),Tr?.unobserve(e),e.style.removeProperty("--update-alert-stack-offset"),jr()})}function yw({title:e,message:t,actionLabel:a,onAction:r,icon:i,onClose:s,className:l=""}){const{t:u}=xe.useTranslation(),c=a??u("common.update","\uC5C5\uB370\uC774\uD2B8"),d=o.useRef(null),m=o.useRef(!1);return o.useLayoutEffect(()=>{const p=d.current,f=p?.parentElement?.closest(".update-alert-stack")??p,y=f?bw(f):null;return()=>{y?.(),m.current&&p&&p.contains(document.activeElement)&&ar(p)}},[]),n.jsxs("div",{ref:d,className:_e("update-alert",l),role:"alert",children:[s&&n.jsx("button",{type:"button",className:"update-alert__close",onClick:()=>{m.current=!0,s()},"aria-label":u("common.close","\uB2EB\uAE30"),children:"\xD7"}),n.jsxs("div",{className:"update-alert__top",children:[n.jsx("div",{className:"update-alert__icon",children:i??n.jsx($s,{size:20,strokeWidth:2})}),n.jsxs("div",{className:"update-alert__body",children:[n.jsx("div",{className:"update-alert__title h4",children:e}),n.jsx("div",{className:"update-alert__message body-3",children:t})]})]}),r&&n.jsx(pe,{htmlType:"button",size:32,variant:"main",shape:"pill",className:"update-alert__action",onClick:r,children:c})]})}function vw({title:e,titleLevel:t=3,description:a,topActions:r,children:i,footerLeft:s,footerRight:l,ariaLabel:u,onClick:c,draggable:d,onDragStart:m,onDragEnd:p,className:f}){const y=t?`h${t}`:"div",x=s!=null||l!=null,C=i!=null&&i!==!1,h=o.useCallback(_=>{c&&_.target===_.currentTarget&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),c())},[c]);return n.jsxs("div",{className:_e("training-card",c?"training-card--clickable":"",f),onClick:c,onKeyDown:c?h:void 0,role:c?"button":void 0,"aria-label":c?u??(typeof e=="string"?e:void 0):void 0,tabIndex:c?0:void 0,draggable:d,onDragStart:m,onDragEnd:p,children:[n.jsxs("div",{className:"training-card__header",children:[n.jsxs("div",{className:"training-card__title-row",children:[typeof e=="string"?n.jsx(y,{className:"training-card__title h4",children:e}):e,r!=null&&n.jsx("div",{className:"training-card__top-actions",onClick:_=>_.stopPropagation(),children:r})]}),a!=null?typeof a=="string"?n.jsx("p",{className:"training-card__description body-3",children:a}):a:n.jsx("p",{className:"training-card__description body-3","aria-hidden":"true",children:" "})]}),C&&n.jsx("div",{className:"training-card__body",children:i}),x&&n.jsxs("div",{className:"training-card__footer",children:[s!=null&&n.jsx("div",{className:"training-card__footer-left",children:s}),l!=null&&n.jsx("div",{className:"training-card__meta",children:l})]})]})}function xw({title:e,titleLevel:t=3,count:a,collapsed:r=!1,onToggle:i,beforeSort:s,sort:l,actions:u,empty:c=!1,emptyContent:d,dragOver:m=!1,onDragOver:p,onDragLeave:f,onDrop:y,children:x,className:C}){const{t:h}=xe.useTranslation(),_=o.useId(),g=t?`h${t}`:"span",A=i!=null,b=_e("training-card-group",m&&"training-card-group--dragover",r&&"training-card-group--collapsed",A&&"training-card-group--collapsible",C);return n.jsxs("div",{className:b,onDragOver:p,onDragLeave:f,onDrop:y,role:typeof e=="string"&&e?"group":void 0,"aria-labelledby":typeof e=="string"&&e?_:void 0,children:[n.jsxs("header",{className:"training-card-group__header",children:[A&&n.jsx(pe,{htmlType:"button",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:r?"chevron-right":"chevron-down",ariaLabel:typeof e=="string"&&e?r?h("common.expandFor",{name:e}):h("common.collapseFor",{name:e}):r?h("common.expand","\uD3BC\uCE58\uAE30"):h("common.collapse","\uC811\uAE30"),className:"training-card-group__chevron","aria-expanded":!r,onClick:i}),typeof e=="string"?n.jsx(g,{id:_,className:"training-card-group__title h5b",children:e}):e,a!==void 0&&n.jsx("span",{className:"training-card-group__count body-3b",children:a}),(s!=null||l||u!=null)&&n.jsxs("span",{className:"training-card-group__actions",onClick:k=>k.stopPropagation(),children:[s,l&&n.jsx(pn,{size:40,options:l.options,value:l.value,placeholder:l.placeholder,onChange:l.onChange,ariaLabel:typeof e=="string"&&e?h("common.sortFor",{name:e}):void 0}),u]})]}),!r&&(c?n.jsx("div",{className:"training-card-group__empty body-3",children:d}):n.jsx("div",{className:"training-card-group__grid",children:x}))]})}const _w="speechear:saved_word_tables";function ww(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.id=="string"&&typeof t.name=="string"&&Array.isArray(t.items)}function Bw(){try{const e=localStorage.getItem(_w);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(ww):[]}catch{return[]}}function ad(e){return{label:e.word,subLabel:e.pronunciation,colloquialLabel:e.colloquialPronunciation,homonum:e.homonum,grade:e.grade,syllables:[...e.word].length,pos:e.pos,wordType:e.wordType}}function Bs(e){return e.map(t=>t.homonum!=null?`${t.word}#${t.homonum}`:t.word).join("|")}function kw(e){const t=new Set;return e.map(a=>{let r=a.id;for(let i=2;t.has(r);i++)r=`${a.id}~${i}`;return t.add(r),r===a.id?a:{...a,id:r}})}function Aw({title:e,titleIcon:t,disc:a,filterTitle:r,filterCollapsible:i,filterDefaultCollapsed:s,filterCollapsed:l,onFilterCollapsedChange:u,filterHeaderSummary:c,brand:d,code:m,items:p,onSaveComplete:f,onLoad:y,onRemoveItem:x,onReset:C,resetLabel:h,saveButtonLabel:_,secondarySaveButtonLabel:g,onReorder:A,showCellCount:b,onAddItem:k,className:v,renderSavePopup:w,renderWordSearch:B,hideControls:E,saveOnly:D,tableName:N,nameValue:O,onNameChange:P,descriptionValue:G,onDescriptionChange:L,namePlaceholder:M,descriptionPlaceholder:$,existingNames:Z,editingName:q,onCancel:z,initialItemsPerPage:V,renderCellAction:R,actionsLeftExtra:H}){const{t:W}=xe.useTranslation(),I=h??W("wordPrint.clearAllSelection","\uBAA8\uB450 \uC120\uD0DD \uD574\uC81C"),S=p===void 0,j=!!P,[F,U]=o.useState([]),re=(O??"").trim(),ne=re||(M??"").trim(),le=(G??"").trim()||($??"").trim(),K=(Z??[]).map(ae=>ae.trim().toLowerCase()),oe=[q?.trim().toLowerCase(),...F].filter(ae=>!!ae),Ae=[...K];for(const ae of oe){const ye=Ae.indexOf(ae);ye!==-1&&Ae.splice(ye,1)}const Y=re!==""&&Ae.includes(re.toLowerCase()),[Q,me]=o.useState(Array(4).fill(null)),[De,be]=o.useState(4),[te,ue]=o.useState(null),fe=Q.slice(0,De),ge=!!d?.show,[Ce,$e]=o.useState(!0),[He,Te]=o.useState(!0),Ie=d&&{...d,top:Ce,bottom:He},[qe,mt]=o.useState("landscape"),[ct,rt]=o.useState(["image","word","standardPron"]),[ft,ke]=o.useState("show"),[Ve,we]=o.useState(!0),[Ue,Be]=o.useState(!0),je=o.useRef(null),Se=o.useRef([]),[Xe,Qe]=o.useState(V==="all"?Number.POSITIVE_INFINITY:V??8),[dt,ht]=o.useState("right"),[wt,Ct]=o.useState(!1),[Nt,gt]=o.useState(!1),{toastMessage:it,toastType:Ke,showWarning:se,clearToast:Ne}=Ll("warning"),We=o.useCallback(()=>ue(null),[ue]);k&&!S&&!b&&St("word-table-block-add-without-cell-count",'[WordTableBlock] \uD45C\uC2DC \uBAA8\uB4DC\uC5D0\uC11C onAddItem \uC740 showCellCount \uC640 \uD568\uAED8 \uC918\uC57C "\uCD94\uAC00\uD558\uAE30" \uCE78\uC774 \uC0DD\uAE34\uB2E4.');const[nt,Fe]=o.useState(()=>Math.max(p?.length??1,1)),Ge=S?De:b?Math.max(nt,p?.length??1,1):Math.max(p?.length??0,1),{width:bt,height:Re}=ha[qe],tt=!S&&!b,xt=p?.length??0,Lt=Math.min(Xe,Math.max(xt,1)),et=tt?Lt:Ge,ot=tt?Hu(p??[],et):null,lt=!!ot&&ot.length>1,st=S?fe.some(ae=>ae!==null&&ae.length>1):(p??[]).some(ae=>(ae.words??[]).length>1),jt=N?.trim()||`${Ri(Ea())} ${st?W("wordTable.printFileNamePair","\uB300\uB9BD\uC30D\uD45C"):W("wordTable.printFileNameSingle","\uB2E8\uC5B4\uD45C")}`,Wt=o.useCallback(()=>lt?Se.current.filter(ae=>ae!==null):je.current?[je.current]:[],[lt]),{print:mn,openNewWindow:hn,downloadHtml:jn}=ns({getElements:Wt,paperW:bt,paperH:Re,fileName:jt,onPopupBlocked:()=>{se(W("wordTable.popupBlocked","\uD31D\uC5C5\uC774 \uCC28\uB2E8\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uBE0C\uB77C\uC6B0\uC800 \uC124\uC815\uC5D0\uC11C \uD31D\uC5C5\uC744 \uD5C8\uC6A9\uD574 \uC8FC\uC138\uC694."))}}),zn=ae=>{be(ae),me(ye=>ye.length>=ae?ye:[...ye,...Array(ae-ye.length).fill(null)]),ue(null)},Wn=ae=>{me(ye=>{const Le=[...ye];return Le[ae]=null,Le}),te===ae&&ue(null)},It=ae=>{if(te===null)return;const ye=te;me(ze=>{const ut=[...ze];return ut[ye]=ae.length>0?ae:null,ut});const Le=fe.findIndex((ze,ut)=>ut>ye&&ze===null);ue(Le!==-1?Le:null)},vn=S?fe.some(ae=>ae?.some(ye=>!!ye.colloquialPronunciation)):(p??[]).some(ae=>(ae.words??[]).some(ye=>!!ye.colloquialLabel)),Ft=o.useMemo(()=>aa()?S?Q.slice(0,De).flatMap(ae=>(ae??[]).map(ye=>[ye.word,ye.homonum])):(p??[]).flatMap(ae=>(ae.words??[]).map(ye=>[ye.label,ye.homonum])):[],[S,Q,De,p]),[Ht,Mn]=o.useState(!1);o.useEffect(()=>{if(Ft.length===0)return;let ae=!1;return Promise.all(Ft.map(([ye,Le])=>wi(ye,Le))).then(ye=>{ae||Mn(ye.some(Boolean))},()=>{}),()=>{ae=!0}},[Ft]);const on=Ft.length>0&&Ht,xn=o.useMemo(()=>[...S||b?[{label:W("wordTable.filter.columns","\uCE78 \uC218"),items:H4.map(ae=>({value:`${ae}\uCE78`,displayLabel:W("wordTable.filter.column",{count:ae})})),display:"segmented"}]:[],...tt&&(p?.length??0)>0?[sc(W,{hasPairs:st,itemCount:xt})]:[],...lt?[V4(W)]:[]],[W,S,b,tt,p?.length,st,xt,lt]),Hn={...S||b?{[W("wordTable.filter.columns","\uCE78 \uC218")]:`${Ge}\uCE78`}:{},...tt&&(p?.length??0)>0?{[W(st?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord")]:`${Lt}\uAC1C`}:{},...lt?{[W("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")]:dt}:{}},_n=(ae,ye)=>{ye===W("wordTable.filter.columns","\uCE78 \uC218")?S?zn(parseInt(ae)):Fe(parseInt(ae)):ye===W(st?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord")?Qe(ic(parseInt(ae),xt)):ye===W("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")&&ht(lc(ae))},Vt=S?kw(fe.filter(ae=>ae!==null&&ae.length>0).map(ae=>({id:Bs(ae),words:ae.map(ad)}))):p??[],$t=()=>{S&&me(ae=>ae.length>De?ae.slice(0,De):ae)},qt=(ae=!1)=>{if(gt(ae),j&&f){const ye=ne.trim().toLowerCase();ye&&U(Le=>Le.includes(ye)?Le:[...Le,ye]),f(ne,Vt,le||void 0,ae),$t();return}if(D&&f){f("",Vt,void 0,ae),$t();return}if(f){Ct(!0);return}jn()},[fn,Ot]=o.useState(!1),[sn,Dt]=o.useState(""),ie=sn.trim(),ve=ie!==""&&K.includes(ie.toLowerCase()),Me=()=>{Dt(ne?W("wordTable.save.copyName",{name:ne,defaultValue:"{{name}} (\uBCF5\uC0AC)"}):""),Ot(!0)},Je=()=>{!ie||ve||!f||(f(ie,Vt,le||void 0,!0),$t(),Ot(!1))},Oe=Vt.length===0,Ye=Oe||j&&(ne===""||Y),J=()=>{if(Oe){se(W("wordTable.emptyItems","\uB2E8\uC5B4\uB97C 1\uAC1C \uC774\uC0C1 \uCD94\uAC00\uD574\uC8FC\uC138\uC694."));return}if(j&&ne===""){se(W("wordTable.save.nameRequired","\uD45C \uC774\uB984\uC744 \uC785\uB825\uD574 \uC8FC\uC138\uC694."));return}j&&Y&&se(W("wordTable.save.duplicateName","\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uC774\uB984\uC785\uB2C8\uB2E4."))},de=n.jsx(fa,{items:Vt,orientation:qe,contentTypes:ct,cutLine:ft,showOutline:Ve,showDivLine:Ue,count:Ge});return n.jsxs(n.Fragment,{children:[n.jsxs(ma,{type:"page",icon:t,title:e,disc:a,className:_e("word-table-block",v),children:[fn&&n.jsx(Fn,{size:"small",title:g??W("wordTable.saveAsNewButton","\uB2E4\uB978 \uC774\uB984\uC73C\uB85C \uC800\uC7A5"),onClose:()=>Ot(!1),footer:({closeWithAnimation:ae})=>n.jsxs(n.Fragment,{children:[n.jsx(pe,{htmlType:"button",size:48,type:"bar",label:W("common.cancel","\uCDE8\uC18C"),onClick:ae}),n.jsx(pe,{htmlType:"button",size:48,type:"bar",variant:"main",label:W("common.save","\uC800\uC7A5"),disabled:!ie||ve,onClick:Je})]}),children:n.jsx(Xn,{label:W("wordTable.save.nameLabel","\uC774\uB984"),value:sn,onChange:Dt,placeholder:W("wordTable.save.placeholder","\uC774 \uB2E8\uC5B4\uD45C\uC5D0 \uB300\uD55C \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694."),maxLength:40,size:48,fullWidth:!0,autoFocus:!0,onEnter:Je,error:ve?W("wordTable.save.duplicateName","\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uC774\uB984\uC785\uB2C8\uB2E4."):void 0})}),wt&&f&&w?.({defaultName:typeof e=="string"?e:W("wordTable.defaultName","\uB2E8\uC5B4 \uD45C"),preview:de,previewW:bt,previewH:Re,items:Vt,existingNames:Bw().map(ae=>ae.name),saveAsNew:Nt,onSave:(ae,ye)=>{f(ae,Vt,ye,Nt),$t(),Ct(!1)},onCancel:()=>Ct(!1)}),(S||k)&&te!==null&&B?.({cellIndex:te,onConfirm:S?It:ae=>{if(k){const ye=ae[0];if(ye){const Le=new Set((p??[]).map(ut=>ut.id));let ze=Bs([ye]);for(let ut=2;Le.has(ze);ut++)ze=`${Bs([ye])}~${ut}`;k({id:ze,words:[ad(ye)]})}}ue(null)},onClose:We}),!E&&n.jsx(Jo,{title:r,collapsible:i,defaultCollapsed:s,collapsed:l,onCollapsedChange:u,headerSummary:c,hasImage:on,hasColloquial:vn,contentTypes:ct,orientation:qe,showOutline:Ve,cutLine:ft,showDivLine:Ue,setters:{setContentTypes:rt,setOrientation:mt,setShowOutline:we,setCutLine:ke,setShowDivLine:Be,setShowTopInfo:$e,setShowBottomInfo:Te},showCutLine:(tt?et:Ge)>1,showDivLine2:st,middleSections:xn,extraSelected:Hn,onExtraSelect:_n,showPaperBands:ge,showTopInfo:Ce,showBottomInfo:He}),lt&&ot?n.jsx("div",{className:"word-table-block__pages",children:ot.map((ae,ye)=>n.jsx(fa,{orientation:qe,contentTypes:ct,cutLine:ft,showOutline:Ve,showDivLine:Ue,count:et,items:ae,onRemoveItem:x,onReorder:A&&((Le,ze)=>A(Le+ye*et,ze+ye*et)),renderCellAction:R&&((Le,ze)=>R(Le+ye*et,ze)),brand:Ie,code:m,contentRef:Le=>{Se.current[ye]=Le},pageNumber:{current:ye+1,total:ot.length},pageNumberPosition:dt},ye))}):n.jsx(fa,{orientation:qe,contentTypes:ct,cutLine:ft,showOutline:Ve,showDivLine:Ue,count:Ge,items:S?void 0:p??[],editCells:S?fe:void 0,activeCell:te,onActivateCell:S||k?ue:void 0,onRemoveCell:S?Wn:void 0,onRemoveItem:S?void 0:x,onReorder:S?void 0:A,renderCellAction:S?void 0:R,brand:Ie,code:m,showFillerAdd:!!k,contentRef:je}),!E&&!D&&(C||H!=null)&&n.jsxs("div",{className:"word-table-block__table-actions",children:[C&&n.jsx(pe,{htmlType:"button",size:48,type:"bar",label:I,onClick:C}),H]}),j&&!E&&n.jsxs(Br,{size:"medium",labelWidth:64,useBorder:!1,useRowBorder:!1,className:"word-table-block__meta",children:[n.jsx(Sn,{variant:"custom",label:W("wordTable.save.nameLabel","\uC774\uB984"),required:!0,align:"vertical",useFullWidth:!0,children:n.jsx(Xn,{required:!0,value:O??"",onChange:P,placeholder:M?M+W("wordTable.save.autoFillHint"," (Tab \uB610\uB294 space \uC785\uB825\uC2DC \uC790\uB3D9 \uC785\uB825)"):W("wordTable.save.placeholder","\uC774 \uB2E8\uC5B4\uD45C\uC5D0 \uB300\uD55C \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694."),ariaLabel:W("wordTable.save.nameLabel","\uC774\uB984"),maxLength:40,size:48,fullWidth:!0,error:Y?W("wordTable.save.duplicateName","\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uC774\uB984\uC785\uB2C8\uB2E4."):void 0,onKeyDown:ae=>{(ae.key==="Tab"&&!ae.shiftKey||ae.key===" ")&&!(O??"").trim()&&(M??"").trim()&&(ae.preventDefault(),P?.(M??""))}})}),n.jsx(Sn,{variant:"custom",label:W("wordTable.save.descriptionLabel","\uC124\uBA85"),align:"vertical",useFullWidth:!0,children:n.jsx(Xn,{value:G??"",onChange:L,placeholder:$?$+W("wordTable.save.autoFillHint"," (Tab \uB610\uB294 space \uC785\uB825\uC2DC \uC790\uB3D9 \uC785\uB825)"):W("wordTable.save.descriptionPlaceholder","\uC774 \uB2E8\uC5B4\uD45C\uC5D0 \uB300\uD55C \uC124\uBA85\uC744 \uC785\uB825\uD558\uC138\uC694."),ariaLabel:W("wordTable.save.descriptionLabel","\uC124\uBA85"),maxLength:200,multiline:!0,rows:2,fullWidth:!0,onKeyDown:ae=>{(ae.key==="Tab"&&!ae.shiftKey||ae.key===" ")&&!(G??"").trim()&&($??"").trim()&&(ae.preventDefault(),L?.($??""))}})})]})]}),!E&&n.jsxs("div",{className:"word-table-block__actions",children:[n.jsxs("div",{className:"word-table-block__actions-left",children:[!D&&y&&n.jsx(pe,{htmlType:"button",size:40,type:"bar",label:W("wordTable.load","\uBD88\uB7EC\uC624\uAE30"),onClick:y}),!D&&n.jsx(pe,{htmlType:"button",size:40,type:"bar",label:W("wordTable.openNewWindow","\uC0C8 \uCC3D\uC73C\uB85C \uBCF4\uAE30"),onClick:hn})]}),n.jsxs("div",{className:"word-table-block__actions-right",children:[z&&n.jsx(pe,{htmlType:"button",size:"56",type:"bar",label:W("common.cancel","\uCDE8\uC18C"),onClick:z}),!D&&n.jsx(pe,{htmlType:"button",size:"56",type:"bar",label:W("wordTable.print","\uC778\uC1C4\uD558\uAE30"),onClick:mn}),g&&n.jsx(pe,{htmlType:"button",size:"56",type:"bar",label:g,onClick:()=>j?Me():qt(!0),disabled:Oe,onDisabledClick:()=>{se(W("wordTable.emptyItems","\uB2E8\uC5B4\uB97C 1\uAC1C \uC774\uC0C1 \uCD94\uAC00\uD574\uC8FC\uC138\uC694."))}}),n.jsx(pe,{htmlType:"button",size:"56",type:"bar",variant:"main",label:_??W("wordTable.saveButton","\uC800\uC7A5\uD558\uAE30"),onClick:()=>qt(!1),disabled:Ye,onDisabledClick:J})]})]}),n.jsx(da,{message:it,type:Ke,onClose:Ne})]})}function rd({items:e,className:t}){const a=e.length,r=a<=3?1:2,i=Math.ceil(a/r)||1,s=r*i;return n.jsx("div",{className:_e("word-table-thumb",t),style:{gridTemplateColumns:`repeat(${r}, 1fr)`},children:Array.from({length:s},(l,u)=>{const c=e[u];return c?n.jsx("div",{className:"word-table-thumb__cell",children:(c.words?.length?c.words:[{label:c.id}]).map((d,m)=>n.jsxs(o.Fragment,{children:[m>0&&n.jsx("span",{className:"word-table-thumb__divider"}),n.jsx("span",{className:"word-table-thumb__word body-3",children:d.label})]},m))},u):n.jsx("div",{className:"word-table-thumb__cell word-table-thumb__cell--empty"},u)})})}function Nw({items:e,name:t,description:a,createdAt:r,code:i,published:s,publishedLabel:l,shared:u,sharedLabel:c,isNew:d,publisherName:m,publishedAt:p,likeCount:f,downloadCount:y,onPublisherClick:x,selected:C,onClick:h,onMore:_,titleNode:g,className:A}){const{t:b}=xe.useTranslation(),k=g!=null,v=m!=null||p!=null||f!=null||y!=null,w=B=>{B.target===B.currentTarget&&!k&&(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),h?.())};return n.jsxs("div",{className:_e("word-table-button",C?"word-table-button--selected":"",v?"":"word-table-button--no-footer",A),role:"button",tabIndex:0,"aria-label":i?`${t} (${i})`:t,onClick:k?void 0:h,onKeyDown:w,children:[d&&n.jsx("span",{className:"word-table-button__new-dot","aria-label":b("myWordTable.newBadge","\uC0C8\uB85C \uB9CC\uB4E0 \uD45C")}),n.jsx(rd,{items:e,className:"word-table-button__thumb"}),n.jsxs("div",{className:"word-table-button__info",children:[n.jsxs("div",{className:"word-table-button__info-text",children:[g??n.jsx("div",{className:"word-table-button__title h4",children:t}),a&&n.jsx("div",{className:"word-table-button__desc body-3",children:a})]}),_&&!k&&n.jsx(pe,{htmlType:"button",className:"word-table-button__more",size:32,type:"dot",variant:"transparent-gray",useBorder:!1,icon:"ellipsis",ariaLabel:b("common.moreFor",{name:t}),onClick:B=>{B.stopPropagation(),_(B)}})]}),(i||r||s||u)&&n.jsxs("div",{className:"word-table-button__meta-row",children:[n.jsx("span",{className:"word-table-button__meta-left",children:n.jsx("span",{className:"word-table-button__meta caption-1",children:r?$i(r,b):""})}),n.jsxs("span",{className:"word-table-button__meta-right",children:[(s||u)&&n.jsxs("span",{className:"word-table-button__badges",children:[s&&n.jsx(At,{className:"word-table-button__badge",size:"small",variant:"main",fill:"soft",iconLeft:"book-marked",label:l??b("myWordTable.publishedBadge","\uBC1C\uD589\uB428")}),u&&n.jsx(At,{className:"word-table-button__badge",size:"small",fill:"soft",iconLeft:"link",label:c??b("myWordTable.sharedBadge","\uACF5\uC720 \uC911")})]}),i&&n.jsx("span",{className:"word-table-button__code caption-1",children:i})]})]}),v&&n.jsxs("div",{className:"word-table-button__footer",children:[n.jsxs("span",{className:"word-table-button__store-by",children:[m&&(x?n.jsx("button",{className:"training-card__publisher body-4",type:"button","aria-label":b("wordTable.publisherFilter",{name:m,defaultValue:"{{name}} \uAC8C\uC2DC\uD55C \uAC83\uB9CC \uBCF4\uAE30"}),onClick:B=>{B.stopPropagation(),x()},children:m}):n.jsx("span",{className:"training-card__publisher training-card__publisher--static body-4",children:m})),p&&n.jsx("span",{className:"training-card__date body-4",children:$i(p,b)})]}),n.jsxs("span",{className:"word-table-button__store-stats",children:[f!=null&&n.jsx(At,{size:"small",fill:"soft",variant:"like",iconLeft:"heart",label:String(f),"aria-label":b("common.likeCount",{count:f,defaultValue:`\uC88B\uC544\uC694 ${f}`})}),y!=null&&n.jsx(At,{size:"small",fill:"soft",variant:"main",iconLeft:"download",label:String(y),"aria-label":b("common.downloadCount",{count:y,defaultValue:`\uAC00\uC838\uAC04 \uC218 ${y}`})})]})]})]})}/**
|
|
1069
|
+
`).map((l,u,c)=>n.jsxs(o.Fragment,{children:[l,u<c.length-1&&n.jsx("br",{})]},u))})}),n.jsxs("div",{className:"site-footer__links",children:[n.jsxs("div",{className:"site-footer__column",children:[n.jsx("div",{className:"site-footer__column-title footer-title",children:s("footer.site.title","\uC0AC\uC774\uD2B8")}),n.jsxs("ul",{children:[n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://www.ihab.co.kr/",target:"_blank",rel:"noopener noreferrer",children:"IHAB"})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://speechear.ihab.co.kr/",target:"_blank",rel:"noopener noreferrer",children:s("footer.site.malgwi","\uB9D0\uADC0")})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://ihab-offcial-web.vercel.app/product/sound-localization",target:"_blank",rel:"noopener noreferrer",children:s("footer.site.soundDirection","\uC18C\uB9AC\uBC29\uD5A5\uC131\uC2DC\uC2A4\uD15C")})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://ihab-offcial-web.vercel.app/product/vr-sound-localization",target:"_blank",rel:"noopener noreferrer",children:s("footer.site.vrSoundDirection","VR\uC18C\uB9AC\uBC29\uD5A5\uC131\uC2DC\uC2A4\uD15C")})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://ihab-offcial-web.vercel.app/product/hearing-test-pro",target:"_blank",rel:"noopener noreferrer",children:s("footer.site.hearingTest","\uCCAD\uB825\uD14C\uC2A4\uD2B8 \uD504\uB85C")})})]})]}),n.jsxs("div",{className:"site-footer__column",children:[n.jsx("div",{className:"site-footer__column-title footer-title",children:s("footer.sns.title","SNS")}),n.jsxs("ul",{children:[n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://blog.naver.com/ihab_official",target:"_blank",rel:"noopener noreferrer",children:s("footer.sns.naverBlog","\uB124\uC774\uBC84 \uBE14\uB85C\uADF8")})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://www.instagram.com/ihab.official.yt/",target:"_blank",rel:"noopener noreferrer",children:"Instagram"})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://www.youtube.com/@%EC%95%84%EC%9D%B4%ED%95%B4%EB%B8%8C-%EA%B3%B5%EC%8B%9D%EC%B1%84%EB%84%90",target:"_blank",rel:"noopener noreferrer",children:"Youtube"})})]})]}),n.jsxs("div",{className:"site-footer__column",children:[n.jsx("div",{className:"site-footer__column-title footer-title",children:s("footer.policy.title","\uC815\uCC45")}),n.jsxs("ul",{children:[n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"#",onClick:l=>{e&&(l.preventDefault(),e())},children:s("footer.policy.terms","\uC774\uC6A9\uC57D\uAD00")})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"#",onClick:l=>{t&&(l.preventDefault(),t())},children:s("footer.policy.privacy","\uAC1C\uC778\uC815\uBCF4 \uCC98\uB9AC\uBC29\uCE68")})})]})]})]})]}),n.jsx("hr",{className:"site-footer__rule"}),n.jsxs("div",{className:"site-footer__bottom",children:[n.jsx("div",{className:"site-footer__brand",children:n.jsx("img",{src:Eo,alt:"IHAB",className:"site-footer__logo"})}),n.jsxs("div",{className:"site-footer__meta",children:[n.jsxs("div",{children:[n.jsx("span",{className:"footer-title",children:s("footer.ceo","\uB300\uD45C")})," ",n.jsx("span",{className:"footer-meta caption-1",children:s("footer.ceoName","\uD55C\uC9C0\uD61C")})]}),n.jsxs("div",{children:[n.jsx("span",{className:"footer-title",children:s("footer.address","\uC8FC\uC18C")})," ",n.jsx("span",{className:"footer-meta caption-1",children:s("footer.addressValue","\uAC15\uC6D0\uB3C4 \uCD98\uCC9C\uC2DC \uC2DC\uCCAD\uAE38 32 \uD574\uCC2C\uBE4C\uB529 3\uCE35 302\uD638")})]}),n.jsxs("div",{children:[n.jsx("span",{className:"footer-title",children:s("footer.support","\uACE0\uAC1D\uC13C\uD130")})," ",n.jsxs("span",{className:"footer-meta caption-1",children:[r," \xA0 ",i]})]})]})]}),n.jsx("div",{className:"site-footer__copyright footer-copyright caption-1",children:"\xA9 IHAB, Inc. All rights reserved."})]})})}function Nx({logo:e,logoAlt:t="",logoHref:a,links:r=[],actions:i,className:s,containerClassName:l,renderLink:u,menuLabel:c}){const{t:d}=xe.useTranslation(),m=c??{open:d("header.menuOpen","\uBA54\uB274 \uC5F4\uAE30"),close:d("header.menuClose","\uBA54\uB274 \uB2EB\uAE30")},[p,f]=o.useState(!1),y=o.useId(),x=o.useRef(null);o.useEffect(()=>{if(!p)return;const _=Gn(()=>{const b=document.getElementById(y);b&&b.contains(document.activeElement)&&x.current?.focus(),f(!1)}),g=typeof window<"u"&&window.matchMedia?window.matchMedia("(min-width: 961px)"):null,A=b=>{b.matches&&f(!1)};return g&&(g.matches&&f(!1),g.addEventListener?.("change",A)),()=>{_(),g?.removeEventListener?.("change",A)}},[p,y]);const C=l?`${l} landing-header__inner`:"landing-header__inner",h=(_,g)=>u?u(_,{onClick:g}):n.jsx("a",{href:_.href,onClick:g,"aria-current":_.current?"page":void 0,children:_.label});return n.jsxs("header",{className:s?`landing-header ${s}`:"landing-header",children:[n.jsxs("div",{className:C,children:[e!=null&&(()=>{const _=typeof e=="string"?n.jsx("img",{src:e,alt:t,className:"landing-header__logo"}):e;return a?n.jsx("a",{href:a,className:"landing-header__brand",children:_}):n.jsx("div",{className:"landing-header__brand",children:_})})(),r.length>0&&n.jsx("nav",{className:"landing-header__links",children:r.map((_,g)=>n.jsx("span",{children:h(_)},`${g}:${_.href}`))}),n.jsxs("div",{className:"landing-header__actions",children:[i,r.length>0&&n.jsx("button",{ref:x,type:"button",onClick:()=>f(_=>!_),"aria-expanded":p,"aria-controls":y,"aria-label":p?m.close:m.open,className:p?"landing-header__toggle landing-header__toggle--open":"landing-header__toggle",children:n.jsxs("span",{className:"landing-header__burger",children:[n.jsx("span",{}),n.jsx("span",{}),n.jsx("span",{})]})})]})]}),r.length>0&&n.jsx("nav",{id:y,hidden:!p,className:"landing-header__drawer",children:n.jsx("div",{className:l??void 0,children:r.map((_,g)=>n.jsx("span",{className:"landing-header__drawer-item",children:h(_,()=>f(!1))},`${g}:${_.href}`))})})]})}function Ex({children:e,action:t,onClick:a,className:r}){const i=a?"bottom-sticky__inner bottom-sticky__inner--clickable":"bottom-sticky__inner";return n.jsx("div",{className:r?`bottom-sticky ${r}`:"bottom-sticky",children:n.jsxs("div",{className:i,onClick:a,...Ru(a),children:[n.jsx("div",{className:"bottom-sticky__content",children:e}),t]})})}function Dx({mountedRef:e}){const t=o.useRef({phase:"sound",at:0}),a=o.useRef(0),r=o.useRef(null),i=o.useRef(null),s=o.useCallback(()=>{const C=t.current,h=C.phase!=="sound"&&C.at>0;i.current=h?{phase:C.phase,elapsed:Math.max(0,Date.now()-C.at)}:null},[]),l=o.useCallback(()=>{const C=i.current;return i.current=null,C},[]),u=o.useCallback(()=>{a.current+=1,t.current={phase:"sound",at:0}},[]),c=o.useCallback((C,h,_=0)=>{if(!(C>0))return Promise.resolve(!0);const g=a.current;return t.current={phase:h,at:Date.now()-Math.max(0,_)},new Promise(A=>{const b=setTimeout(()=>{r.current===b&&(r.current=null),A(!!e.current&&g===a.current)},C);r.current=b})},[e]),d=o.useCallback(()=>{t.current={phase:"sound",at:Date.now()}},[]),m=o.useCallback(()=>{t.current={phase:"sound",at:0}},[]),p=o.useCallback(()=>{const C=t.current;return C.phase!=="sound"&&C.at>0},[]),f=o.useCallback(()=>a.current,[]),y=o.useCallback(C=>C===a.current,[]),x=o.useCallback(()=>{a.current+=1},[]);return o.useEffect(()=>()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]),o.useMemo(()=>({positionRef:t,isRunning:p,generation:f,isCurrent:y,abort:u,waitPad:c,enterSound:d,leave:m,pause:s,resume:l,__bumpGenerationForTest:x}),[p,f,y,u,c,d,m,s,l,x])}const ga=9,Sx=e=>Math.round(Math.min(ga,Math.max(0,e))/ga*100),Tx=e=>e/100*ga,Va=2,fc=.1,jx=e=>Math.min(Va,Math.max(0,e)),Mx=.1,Lx=e=>Math.round(e*1e6)/1e6;function qa(e){const{noiseRatio:t}=e;if(typeof t=="number"&&Number.isFinite(t))return jx(t);const a=Math.min(ga,Math.max(0,Number(e.level)||0))/ga,r=Number(e.mainVolume);return r>0?a>0?Lx(Math.min(Va,Math.max(Mx,a/r))):0:1}const Cc=e=>Math.min(1,Math.max(0,Number(e.mainVolume)||0));function gc(e){return Cc(e)}function os(e){return Cc(e)*qa(e)}function ss(e,t=Rf()){const a=Number.isFinite(t)&&t>0?t:1;return Math.min(1,os(e)/a)}function Ua(e,t){const a={...e,...t??{}};return t&&"level"in t&&typeof t.noiseRatio!="number"&&(a.noiseRatio=qa({level:a.level,mainVolume:a.mainVolume})),a}const Ga={enabled:!0,type:"defaultNoise",level:4.5,noiseRatio:1,speed:1,mainVolume:1,mainSpeed:1},is=o.createContext(null);function yr(){return o.useContext(is)}const ls=e=>`${$f()}/${e}`,bc=e=>Array.from({length:10},(t,a)=>ls(`${e}-${String(a+1).padStart(2,"0")}.mp3`)),vr={get defaultNoise(){return ls("noise1.mp3")},get street(){return bc("noise2")},get restaurant(){return bc("noise3")},get buzz(){return ls("noise4.mp3")}};function $x(e){const t=Math.floor(Math.random()*10);switch(e){case"defaultNoise":return vr.defaultNoise;case"street":return vr.street[t];case"restaurant":return vr.restaurant[t];case"buzz":return vr.buzz;default:return null}}function Rx({noisePlayer:e,audioRef:t,playbackStateRef:a,sequencer:r}){const i=o.useRef(e?.registerAnalyser);i.current=e?.registerAnalyser;const s=o.useRef(null),[l,u]=o.useState(null),c=o.useRef(null),d=o.useRef(null),m=o.useRef(null),p=o.useRef(null),f=o.useRef(0),y=o.useRef(null),x=o.useCallback(()=>!!r?.isRunning(),[r]),C=o.useCallback(()=>{p.current!==null&&(cancelAnimationFrame(p.current),p.current=null),y.current!==null&&(clearTimeout(y.current),y.current=null)},[]),h=o.useCallback((k,v=250)=>{const w=s.current;if(!w)return;const B=d.current;if(B){d.current=null;try{w.pause()}catch{}w.src=B,w.load()}if(!w.src)return;f.current+=1,C();try{Jr(),Ya(w).then(O=>{if(s.current===w)try{i.current?.("noise",O)}catch{}})}catch{}const E=w.paused?0:Za(w);w.paused&&Pn(w,0),w.play().catch(()=>{});const D=performance.now(),N=()=>{const O=Math.min(1,(performance.now()-D)/v);try{Pn(w,E+(k-E)*O)}catch{}O<1?p.current=requestAnimationFrame(N):p.current=null};p.current=requestAnimationFrame(N)},[C]),_=o.useCallback((k=250,v)=>{const w=s.current;if(!w||w.paused){v?.();return}const B=++f.current;C();const E=performance.now(),D=Za(w),N=()=>{const O=Math.min(1,(performance.now()-E)/k);try{Pn(w,D*(1-O))}catch{}if(O<1)p.current=requestAnimationFrame(N);else{p.current=null,y.current!==null&&(clearTimeout(y.current),y.current=null);try{w.pause()}catch{}v?.()}};p.current=requestAnimationFrame(N),y.current=setTimeout(()=>{if(y.current=null,f.current===B){p.current!==null&&(cancelAnimationFrame(p.current),p.current=null);try{w.paused||(Pn(w,0),w.pause(),v?.())}catch{}}},k+150)},[C]);o.useEffect(()=>{const k=document.createElement("audio");return k.loop=!0,k.crossOrigin="anonymous",s.current=k,()=>{C();try{k.pause(),k.removeAttribute("src"),k.load()}catch{}s.current=null,c.current=null,d.current=null}},[C]);const g=e?ss(e.settings):0,A=!!e?.settings.enabled&&g>0;o.useEffect(()=>{if(!A)return;let k=0;const v=setInterval(()=>{const w=s.current;if(!w||w.paused){k=0;return}const B=t.current;if(B&&!B.paused&&!B.ended||x()||a.current==="playing"){k=0;return}k+=1,k>=2&&(k=0,_())},400);return()=>clearInterval(v)},[_,A,t,a,x]),o.useEffect(()=>{const k=()=>{const v=s.current;if(document.hidden){if(v&&!v.paused){C();try{v.pause()}catch{}}return}if(!v||!v.paused)return;const w=t.current,B=!!w&&!w.paused&&!w.ended||x()||a.current==="playing",E=m.current;B&&E?.enabled&&E.volume>0&&h(E.volume)};return document.addEventListener("visibilitychange",k),()=>document.removeEventListener("visibilitychange",k)},[C,h,t,a,x]),o.useEffect(()=>{m.current=e?{enabled:e.settings.enabled,volume:g,type:e.settings.type}:null},[e,e?.settings.enabled,g,e?.settings.type]);const b=o.useRef(null);return o.useEffect(()=>()=>{b.current?.(),b.current=null},[]),o.useEffect(()=>{const k=e?.settings,v=s.current;if(!v)return;const w=k?ss(k):0;if(!k||!k.enabled||w===0){_();return}if(c.current!==k.type){const B=$x(k.type);B&&(c.current=k.type,u(B),d.current=B,_(150,()=>{if(d.current!==B)return;d.current=null,v.src=B,v.load();const E=t.current;if(E&&!E.paused||x()){b.current?.();const D=()=>{v.removeEventListener("canplay",D),b.current===N&&(b.current=null);const O=t.current,P=m.current;(O&&!O.paused&&!O.ended||x())&&P?.enabled&&P.volume>0&&h(P.volume)},N=()=>v.removeEventListener("canplay",D);b.current=N,v.addEventListener("canplay",D)}}))}else{const B=t.current,E=!!B&&!B.paused&&!B.ended||x()||a.current==="playing";if(E&&d.current)h(w);else if(E&&v.paused&&v.src)h(w);else if(!v.paused)if(!E)_();else{C();const D=Za(v),N=performance.now(),O=()=>{const P=Math.min(1,(performance.now()-N)/150);try{Pn(v,D+(w-D)*P)}catch{}P<1?p.current=requestAnimationFrame(O):p.current=null};p.current=requestAnimationFrame(O)}}},[e?.settings,e?.settings.enabled,g,e?.settings.type,C,h,_,t,a,m,x]),o.useEffect(()=>{const k=s.current;if(k)try{k.playbackRate=Math.min(1.25,Math.max(.75,e?.settings.speed??1))}catch{}},[e?.settings.speed]),{noiseAudioRef:s,activeNoiseUrl:l,noiseSettingsRef:m,cancelNoiseFade:C,fadeInNoise:h,fadeOutNoise:_}}function Px({ttsText:e,playbackRate:t,mainVolume:a,fillRef:r,waveProgressRef:i,setProgress:s,setPlaybackState:l,setStateLocal:u,fadeInNoise:c,fadeOutNoise:d,noiseSettingsRef:m,onDoneRef:p,handleEndRef:f}){const y=o.useRef(null),x=o.useRef(0),C=o.useRef(null),h=o.useRef(0),_=o.useRef(!1);o.useEffect(()=>()=>{h.current++;try{if(C.current&&(cancelAnimationFrame(C.current),C.current=null),_.current&&window.speechSynthesis){try{window.speechSynthesis.cancel()}catch{}_.current=!1}}catch{}},[]);const g=(k,v=1)=>{try{const w=(k||"").trim().split(/\s+/).filter(Boolean).length||Math.max(1,(k||"").length);return Math.max(700,Math.round(w*300/Math.max(.25,v)))}catch{return 1200}},A=o.useCallback(k=>{if(typeof window>"u"||!window.speechSynthesis){try{typeof p.current=="function"&&p.current(!1)}catch{}return}const v=window.speechSynthesis,w=++h.current;try{try{v.cancel()}catch{}const B=k??e,E=Array.isArray(B)?B.filter(L=>!!L):[B||""];E.length===0&&E.push("");const D=Math.max(.3,Math.min(3,t));x.current=E.reduce((L,M)=>L+g(M,D||1),0),y.current=performance.now(),s(0),l("playing"),u("playMode");const N=m.current;N?.enabled&&(N?.volume??0)>0&&c(N.volume);const O=()=>{try{const L=y.current||performance.now(),M=performance.now()-L,$=x.current||1200,Z=Math.min(1,M/$);try{r.current&&(r.current.style.left=`${Z*100}%`),i.current&&i.current.style.setProperty("--progress",String(Z))}catch{}Z<1&&(C.current=requestAnimationFrame(O))}catch{}},P=()=>{if(w===h.current)try{C.current&&(cancelAnimationFrame(C.current),C.current=null),s(1),l("stopped");try{f.current?.()}catch{try{typeof p.current=="function"&&p.current(!0)}catch{}}}catch{}},G=L=>{const M=new SpeechSynthesisUtterance(E[L]);try{M.rate=D}catch{}try{M.volume=Math.max(0,Math.min(1,a))}catch{}M.onend=()=>{if(w===h.current){if(L<E.length-1){try{G(L+1)}catch{P()}return}P()}},M.onerror=()=>{P()},M.onstart=()=>{if(!(L>0))try{C.current&&(cancelAnimationFrame(C.current),C.current=null),C.current=requestAnimationFrame(O)}catch{}},_.current=!0,v.speak(M)};try{G(0)}catch{try{typeof p.current=="function"&&p.current(!0)}catch{}}}catch{try{typeof p.current=="function"&&p.current(!0)}catch{}}},[e,t,a,c,r,i,s,l,u,m,p,f]),b=o.useCallback(()=>{h.current++;try{if(window.speechSynthesis)try{window.speechSynthesis.cancel()}catch{}C.current&&(cancelAnimationFrame(C.current),C.current=null),d(),y.current=null}catch{}l("stopped"),u("active"),s(0)},[d,l,u,s]);return{startTTS:A,stopTTS:b}}const Ix=.01,Fx=.3;async function Ox(e,t,a,r=!1){let i=null;try{const s=window.AudioContext||window.webkitAudioContext;i=new s;const l=await i.decodeAudioData(e.slice(0)),u=l.numberOfChannels>0?l.getChannelData(0):null;if(!u)return null;let c=0;if(r){const y=Math.floor(Fx*l.sampleRate),x=Math.min(u.length,y);for(;c<x&&Math.abs(u[c])<=Ix;)c++;c>=x&&(c=0)}const d=u.length-c,m=a&&a>0?Math.min(d,Math.floor(a*l.sampleRate)):d,p=Math.max(t,m),f=Math.floor(p/t)||1;return new Array(t).fill(0).map((y,x)=>{const C=c+x*f,h=Math.min(C+f,c+p,u.length);let _=0;for(let g=C;g<h;g++){const A=Math.abs(u[g]);A>_&&(_=A)}return _})}catch{return null}finally{try{i?.close?.()}catch{}}}async function yc(e,t,a,r=!1){try{const i=await fetch(e);if(i.ok===!1)return null;const s=await i.arrayBuffer();return await Ox(s,t,a,r)}catch(i){try{const s=Ei(i)}catch{}return null}}const us=45,zx=74,Wx=2;function xr(e){const t=Math.min(2,Math.max(0,Number(e)||0));return t<=1?t*45:45+(t-1)*29}function _r(e){return xr(e)/45}const Hx=e=>Math.max(0,(typeof e=="number"&&Number.isFinite(e)?e:0)*1e3),vc=e=>Math.max(0,typeof e=="number"&&Number.isFinite(e)?e:0);function xc({durationsSec:e,leadInMs:t=0,tailMs:a=0}){const r=vc(t),i=vc(a),s=[];let l=0;return e.forEach((u,c)=>{for(const[d,m]of[["lead",r],["sound",Hx(u)],["tail",i]])s.push({kind:d,track:c,startMs:l,durMs:m}),l+=m}),{segments:s,totalMs:l,trackCount:e.length}}function _c(e,t){const a=(t|0)*3;if(t<0||a+2>=e.segments.length)return null;const[r,i,s]=[e.segments[a],e.segments[a+1],e.segments[a+2]];return{lead:r,sound:i,tail:s,totalMs:r.durMs+i.durMs+s.durMs}}function Vx(e,t){const a=_c(e,t.track);if(!a||!(a.totalMs>0))return 0;const r=a[t.kind],i=Math.min(Math.max(0,Number.isFinite(t.elapsedMs)?t.elapsedMs:0),r.durMs);return Math.max(0,Math.min(1,(r.startMs-a.lead.startMs+i)/a.totalMs))}function qx(e,t,a){const r=Math.max(0,Math.floor(a)),i=_c(e,t);if(!i||r===0||!(i.totalMs>0)||i.lead.durMs===0&&i.tail.durMs===0||!(i.sound.durMs>0))return{lead:0,sound:r,tail:0};const s=Math.round(i.lead.durMs/i.totalMs*r),l=Math.round(i.tail.durMs/i.totalMs*r),u=Math.max(1,r-s-l),c=s+u+l-r;return{lead:Math.max(0,s-Math.ceil(c/2)),sound:u,tail:Math.max(0,l-Math.floor(c/2))}}function Ux({currentTime:e,sources:t,index:a,audioDuration:r}){const i=a||0,s=Array.isArray(t)&&t.length>0?t[i]:void 0,l=s?s.duration||r||0:r||0;if(!(l>0))return 0;const u=Number.isFinite(e)?e:0;return Math.max(0,Math.min(1,u/l))}function Gx({phase:e,phaseElapsedMs:t,currentTime:a,trackDurationSec:r,leadInMs:i,tailMs:s}){const l=xc({durationsSec:[r],leadInMs:i,tailMs:s});return Vx(l,{track:0,kind:e,elapsedMs:e==="sound"?(Number.isFinite(a)?a:0)*1e3:t})}function Kx({bars:e,trackDurationSec:t,leadInMs:a,tailMs:r}){return qx(xc({durationsSec:[t],leadInMs:a,tailMs:r}),0,e)}function Yx(e,t){if(!Array.isArray(e))return null;const a=t||0;return a<e.length-1?a+1:null}function Zx({ended:e,completedByEnd:t}){return!!e||!!t}function Xx(e){return e.map((t,a)=>({src:t.src,label:String(a+1),color:void 0,duration:t.duration||0}))}function Jx(e){return e.reduce((t,a)=>t+(a.duration||0),0)}function Qx(e,t,a){const r=Array.isArray(e)?e:e?[e]:[],i=[];for(const s of r)if(s){if(typeof s=="object"&&s!==null&&"src"in s&&s.src){const l=s;i.push({code:l.code??null,src:l.src});continue}if(typeof s=="string"&&(s.startsWith("http")||s.includes("/"))){i.push({code:null,src:s});continue}if(typeof s=="string"||typeof s=="number"){const l=String(s),u=a(l,t);u&&i.push({code:l,resolvedPath:u})}}return i}const wc=4,e_=_r(wc/us);function t_(e){const{src:t,segments:a,progress:r=0,waveProgressRef:i,noiseSrc:s,noiseRatio:l=0,noiseSpeed:u=1,totalDuration:c=0,mainVolume:d=1,onReadyChange:m,showSoundWaveForm:p=!0,leadInMs:f=0,tailMs:y=0,trackDurationSec:x=0}=e,C=o.useRef(null),h=o.useRef(null),[_,g]=o.useState(null),[A,b]=o.useState(!1),[k,v]=o.useState(null),[w,B]=o.useState(2),[E,D]=o.useState(0),[N,O]=o.useState(null),[P,G]=o.useState(!1),[L,M]=o.useState(!1),$=3,Z=3,q=1,z=300,V=o.useRef(0),R=o.useCallback(()=>{const be=C.current,te=h&&h.current?h.current:be?be.closest(".audio-player__wave"):null,ue=te?te.getBoundingClientRect():be?be.getBoundingClientRect():null,fe=ue?ue.width:0,ge=ue?Math.max(100,ue.width):320,Ce=ue?ue.height:0,$e=Math.max(q,Math.min(z,Math.floor((ge+Z)/($+Z)))),He=$e*$,Te=Math.max(0,$e-1),Ie=Math.max(0,Te>0?(ge-He)/Te:Z);return{bars:$e,gap:Ie,height:Ce,width:fe}},[]),H=o.useRef(void 0),W=o.useRef(null),I=o.useCallback(async(be,te,{quiet:ue=!1}={})=>{const fe=++V.current,ge=()=>V.current===fe;try{if(ue||b(!1),H.current=be,!be){ge()&&g(null);return}let Ce=te;if(!Ce)try{for(let Te=0;Te<4&&!(C.current||h.current);Te++)await new Promise(Ie=>requestAnimationFrame(Ie));await new Promise(Te=>requestAnimationFrame(Te));const He=R();He.height>0&&D(He.height),Ce=He.bars,B(He.gap)}catch{Ce=120}W.current=Ce;const $e=await yc(be,Ce);if(!ge())return;if(!$e){g(null),b(!1);return}g($e),v(Ce),b(!0)}catch{if(!ge())return;g(null),b(!1)}},[b,g,D,B,v,R]);o.useEffect(()=>{const be=h.current;if(!be||typeof ResizeObserver>"u")return;let te=null;const ue=new ResizeObserver(()=>{te!==null&&cancelAnimationFrame(te),te=requestAnimationFrame(()=>{te=null;try{const fe=R();if(fe.width<=0||(fe.height>0&&D(fe.height),W.current===null||fe.bars===W.current))return;const ge=H.current;B(fe.gap),ge?I(ge,fe.bars,{quiet:!0}).catch(()=>{}):W.current=fe.bars}catch{}})});return ue.observe(be),()=>{ue.disconnect(),te!==null&&cancelAnimationFrame(te)}},[R,I]),o.useEffect(()=>{const be=a&&a[0]&&a[0].src||t||a&&a.length===1&&a[0]&&a[0].src;I(typeof be=="string"?be:void 0).catch(()=>{}),M(!1)},[t,a,I]),o.useEffect(()=>{let be=!1;if(G(!1),!s||!k){O(null);return}const te=c>0?c*(u||1):void 0;return yc(s,k,te,!0).then(ue=>{be||(O(ue),ue||G(!0))}).catch(()=>{be||(O(null),G(!0))}),()=>{be=!0}},[s,k,c,u]);const S=Math.max(0,Math.min(1,d)),j=o.useMemo(()=>_&&_.length&&Math.max(..._)||1,[_]),F=k||40,U=o.useMemo(()=>Kx({bars:F,trackDurationSec:x,leadInMs:f,tailMs:y}),[F,x,f,y]),re=o.useMemo(()=>Array.from({length:F}).map((be,te)=>{const ue=te>=U.lead&&te<U.lead+U.sound,fe=U.sound>0&&ue?Math.min(F-1,Math.round((te-U.lead)/U.sound*F)):-1,ge=ue?_&&_[fe]!=null?_[fe]:null:_?0:null,Ce=ge==null?null:Math.min(1,ge/j*S),$e=Ce!=null&&E>0&&xr(Ce)<=wc,He=Ce==null?.15:$e?0:_r(Ce),Te=$e,Ie=F>1?te/(F-1):0;return n.jsx("div",{className:Te?"audio-player__bar audio-player__bar--hidden":"audio-player__bar",style:{"--val":He,"--i":te,"--mix":Ie}},te)}),[F,_,j,S,E,U]),ne={"--progress":String(Math.max(0,Math.min(1,r)))},le=o.useMemo(()=>N&&N.length&&Math.max(...N.map(be=>Number.isFinite(be)?Math.abs(be):0))||1,[N]),K=S*Math.max(0,l),oe=!s||!N||!N.length?1:Math.max(1,K),Ae={"--bar-gap":`${w}px`,"--wave-h":`${xr(oe)}px`,"--wave-h1":`${us}px`},Y=A&&(s?!!N||P:!0);o.useEffect(()=>{Y&&M(!0)},[Y]);const Q=L?A:Y;o.useEffect(()=>{m?.(Q)},[Q,m]);const me=k||40,De=o.useMemo(()=>Array.from({length:me}).map((be,te)=>{const ue=N&&N[te]!=null?N[te]:null,fe=ue==null?0:Math.abs(ue)/le*K,ge=Math.max(e_,_r(fe)),Ce=me>1?te/(me-1):0;return n.jsx("div",{className:"audio-player__bar",style:{"--val":ge,"--i":te,"--mix":Ce}},te)}),[me,N,le,K,E]);return n.jsxs("div",{className:"audio-player__wave",ref:h,style:Ae,children:[s&&n.jsx("div",{className:`audio-player__wave-noise ${Y?"is-ready":""}`,"aria-hidden":"true",children:De}),p&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:`audio-player__wave-inner audio-player__wave-unplayed ${Q?"is-ready":""}`,ref:C,children:re}),n.jsx("div",{className:`audio-player__wave-inner audio-player__wave-played ${Q?"is-ready":""}`,ref:i,style:ne,children:re})]})]})}const n_={idle:"\uB300\uAE30",synthesizing:"\uC18C\uB9AC\uB97C \uB9CC\uB4E4\uACE0 \uC788\uC2B5\uB2C8\uB2E4\u2026",resolving:"\uB9AC\uC18C\uC2A4 \uB9E4\uD551 \uC911\u2026",checking_exists:"\uD30C\uC77C \uC874\uC7AC \uD655\uC778\u2026",getting_signed_url:"\uC11C\uBA85 URL \uC870\uD68C\u2026",downloading:"\uB2E4\uC6B4\uB85C\uB4DC \uC911\u2026",measuring_duration:"\uC624\uB514\uC624 \uAE38\uC774 \uCE21\uC815\u2026",ready:"\uC900\uBE44 \uC644\uB8CC",error:"\uC624\uB958 \uBC1C\uC0DD"},Bc={idle:!1,synthesizing:!0,resolving:!0,checking_exists:!0,getting_signed_url:!0,downloading:!0,measuring_duration:!0,ready:!1,error:!0};function cs(e,t){return new Promise((a,r)=>{const i=document.createElement("audio");let s=!1;const l=()=>{try{i.removeAttribute("src"),i.load()}catch{}},u=()=>{if(s)return;s=!0;const d=isFinite(i.duration)&&i.duration||0;l(),a(d)},c=d=>{s||(s=!0,l(),t.rejectOnError?r(new Error(d)):a(0))};i.addEventListener("loadedmetadata",u),i.addEventListener("error",()=>c("audio load failed")),setTimeout(()=>c("audio load timeout"),t.timeoutMs),i.src=e})}const a_=2e3;function kc(e,t=a_){return new Promise(a=>{let r=!1;const i=()=>{r||(r=!0,a())};e.addEventListener("canplay",i,{once:!0}),e.addEventListener("error",i,{once:!0}),setTimeout(i,t)})}function r_({showSoundWaveForm:e,showNoiseWaveForm:t,timeoutMs:a=2500}){const r=o.useRef(!1),i=o.useRef([]),s=o.useCallback(c=>{if(r.current=c,!c||!i.current.length)return;const d=i.current;i.current=[];for(const m of d)m(!0)},[]),l=o.useCallback(()=>{r.current=!1},[]),u=o.useCallback(()=>!e&&!t||r.current?Promise.resolve(!0):new Promise(c=>{const d=p=>{clearTimeout(m),i.current=i.current.filter(f=>f!==d),c(p)},m=setTimeout(()=>d(!0),a);i.current.push(d)}),[e,t,a]);return o.useEffect(()=>()=>{const c=i.current;i.current=[];for(const d of c)d(!1)},[]),{onReadyChange:s,waitForReady:u,markNotReady:l}}function o_(){const e=o.useRef([]),t=o.useCallback(i=>(e.current.push(i),i),[]),a=o.useCallback(i=>{const s=new Set([...i].filter(Boolean));e.current=e.current.filter(l=>{if(s.has(l))return!0;try{URL.revokeObjectURL(l)}catch{}return!1})},[]),r=o.useCallback(()=>{a([])},[a]);return o.useEffect(()=>()=>{for(const i of e.current)try{URL.revokeObjectURL(i)}catch{}e.current=[]},[]),{track:t,keepOnly:a,revokeAll:r}}function s_({offsetY:e=8}={}){const t=o.useRef(null),[a,r]=o.useState(null),i=o.useCallback(()=>r(null),[]),s=o.useCallback(()=>{try{const l=t.current?.getBoundingClientRect();if(!l)return;r({left:l.left,right:l.right,width:l.width,height:l.height,x:l.x,top:l.top+e,bottom:l.bottom+e,y:l.y+e,toJSON:l.toJSON.bind(l)})}catch{}},[e]);return o.useEffect(()=>{if(a)return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[a,i]),{ref:t,rect:a,show:s,hide:i}}function i_(e){if(!e)return 0;const t=e.duration;if(Number.isFinite(t)&&t>0)return t;if(t===0)return 0;try{const a=e.seekable;if(a&&a.length>0){const r=a.end(a.length-1);if(Number.isFinite(r)&&r>0)return r}}catch{}return null}const l_=400,u_=2e3,Ac=5;function c_({audioRef:e,fillRef:t,waveProgressRef:a,sourcesRef:r,currentIndexRef:i,sequencer:s,leadInMs:l=0,tailMs:u=0}){const c=o.useRef(null),d=o.useRef(0),m=o.useRef(null),p=o.useCallback(()=>{c.current!==null&&(cancelAnimationFrame(c.current),c.current=null)},[]),f=o.useCallback(()=>{if(c.current!==null)return;let x=0;const C=()=>{if(Ln){const h=typeof performance<"u"&&performance.now?performance.now():Date.now();if(x>0&&h-x>l_){const _=m.current===null||h-m.current>u_;if(m.current=h,_&&d.current<Ac){d.current+=1;const g=d.current;let A=null;try{A=typeof document<"u"?document.visibilityState:null}catch{}St(`progress-ticker-slow-frames#${g}`,`[ihab-core] \uC9C4\uD589 \uC0AC\uC2AC\uC758 \uD2C0 \uC0AC\uC774\uAC00 ${Math.round(h-x)}ms \uC785\uB2C8\uB2E4(\uBCF4\uD1B5 16ms).`,A==="hidden"?"\uC774 \uCE78\uC774 **\uC228\uC5B4 \uC788\uC5B4** \uBE0C\uB77C\uC6B0\uC800\uAC00 \uD2C0\uC744 \uC904\uC600\uC2B5\uB2C8\uB2E4 \u2014 \uC7AC\uC0DD\uBC14\xB7\uD30C\uD615\uC740 \uD2C0\uB9C8\uB2E4 \uADF8\uB824\uC9C0\uBBC0\uB85C, \uC9C0\uAE08 \uC7AC\uB294 \uAC12\uC740 **\uC0AC\uB78C\uC774 \uBCF4\uB294 \uD654\uBA74\uACFC \uB2E4\uB985\uB2C8\uB2E4.** \uCE78\uC744 \uC55E\uC73C\uB85C \uAEBC\uB0B4\uACE0 \uB2E4\uC2DC \uC7AC\uC2ED\uC2DC\uC624.":"\uCE78\uC740 \uBCF4\uC774\uB294\uB370 \uD2C0\uC774 \uB290\uB9BD\uB2C8\uB2E4 \u2014 \uAC19\uC740 \uD654\uBA74\uC5D0\uC11C \uBB34\uAC70\uC6B4 \uC77C\uC774 \uB3C4\uB294\uC9C0 \uBCF4\uC2ED\uC2DC\uC624. \uC7AC\uC0DD\uBC14\xB7\uD30C\uD615\uC774 \uB04A\uACA8 \uBCF4\uC774\uB294 \uAC83\uC740 \uC774 \uD0D3\uC77C \uC218 \uC788\uC2B5\uB2C8\uB2E4.",g>=Ac?`(${g}\uBC88\uC9F8 \u2014 \uB354\uB294 \uC548 \uC54C\uB9BD\uB2C8\uB2E4)`:`(${g}\uBC88\uC9F8)`)}}x=h}try{const h=e.current,_=Array.isArray(r.current)?r.current[i.current||0]:void 0,g=!!_&&Number.isFinite(_.duration)&&(_.duration??0)>0,A=g?0:i_(h),b=t.current,k=(l||0)>0||(u||0)>0,v=k&&(s?.positionRef.current?.phase??"sound")!=="sound";if(A===null&&!v)try{b&&b.style.visibility!=="hidden"&&(b.style.visibility="hidden")}catch{}else{const w=g?_.duration:A||0;Ln&&v&&!(w>0)&&St("progress-ticker-pad-without-duration","[ihab-core] \uB738\uC774 \uB3C4\uB294\uB370 **\uC18C\uB9AC \uAE38\uC774\uB97C \uBAA8\uB985\uB2C8\uB2E4** \u2014 \uC7AC\uC0DD\uBC14\uAC00 \uB738\uB9CC\uC73C\uB85C \uC5B4\uB9BC\uC7A1\uC544 \uC6C0\uC9C1\uC785\uB2C8\uB2E4.","\uC18C\uB9AC \uAE38\uC774 \uC7AC\uAE30(measureAudioDuration)\uAC00 0 \uC744 \uC92C\uAC70\uB098 `<audio>` \uAC00 \uC544\uC9C1 \uC548 \uC2E4\uB838\uC2B5\uB2C8\uB2E4. \uAE38\uC774\uB97C \uC54C\uAC8C \uB418\uBA74 \uB9C8\uCEE4\uAC00 \uADF8 \uC21C\uAC04 **\uB4A4\uB85C \uBB3C\uB7EC\uB0A9\uB2C8\uB2E4**(\uC5B4\uB9BC\uC740 \uB298 \uCC38\uBCF4\uB2E4 \uD07D\uB2C8\uB2E4). \uC774 \uC904\uC774 \uBCF4\uC774\uBA74 \uADF8 \uC790\uB9AC\uB97C \uC54C\uB824 \uC8FC\uC2ED\uC2DC\uC624 \u2014 \uD3C9\uC18C \uAE38\uC5D0\uC11C\uB294 \uC548 \uB098\uC640\uC57C \uD569\uB2C8\uB2E4.");const B=k?Gx({phase:s?.positionRef.current?.phase??"sound",phaseElapsedMs:s?.positionRef.current?Math.max(0,Date.now()-s.positionRef.current.at):0,currentTime:h&&typeof h.currentTime=="number"?h.currentTime:0,trackDurationSec:w,leadInMs:l||0,tailMs:u||0}):Ux({currentTime:h&&typeof h.currentTime=="number"?h.currentTime:0,sources:r.current,index:i.current,audioDuration:A??0});try{b&&(b.style.visibility&&(b.style.visibility=""),b.style.left=`${B*100}%`)}catch{}try{a.current?.style.setProperty("--progress",String(B))}catch{}}}catch{}c.current=requestAnimationFrame(C)};c.current=requestAnimationFrame(C)},[e,t,a,r,i,s,l,u]),y=o.useCallback(x=>{p();try{t.current&&(t.current.style.visibility="",t.current.style.left=`${x*100}%`)}catch{}try{a.current?.style.setProperty("--progress",String(x))}catch{}},[p,t,a]);return o.useEffect(()=>p,[p]),{start:f,stop:p,settleTo:y}}function ds({btnLabel:e,soundSrc:t,bucketPath:a,onDone:r,disabled:i=!1,ttsText:s=null,className:l,showSoundWaveForm:u=!0,showNoiseWaveForm:c=!0,leadInMs:d=0,tailMs:m=0}){const{t:p}=xe.useTranslation(),f=e,y=yr(),x=o.useRef(y?.registerAnalyser);o.useEffect(()=>{x.current=y?.registerAnalyser});const C=o.useRef(null),h=o.useRef(null),_=o.useRef(null),g=o_(),A=o.useRef(null),b=o.useRef(!1),k=o.useRef(null),{ref:v,rect:w,show:B,hide:E}=s_();o.useEffect(()=>()=>{x.current?.("main",null),x.current?.("noise",null)},[]);const[D,N]=o.useState(!1),[O,P]=o.useState("idle"),[G,L]=o.useState("stopped"),M=o.useRef("stopped");o.useEffect(()=>{M.current=G},[G]);const[$,Z]=o.useState(0),[q,z]=o.useState("active"),V=o.useRef(!1);o.useEffect(()=>{if(q!=="playMode"||!V.current)return;V.current=!1;const J=typeof document<"u"?document.activeElement:null;if(J&&J!==document.body)return;const de=_.current?.querySelectorAll("button")[1];try{de?.focus()}catch{}},[q]);const[R,H]=o.useState(null),[W,I]=o.useState(null),[S,j]=o.useState(0),[F,U]=o.useState(!1),[re,ne]=o.useState(0),le=y?.playbackRate??1,K=y?.mainVolume??1,oe=y?os(y.settings):0,Ae=y?gc(y.settings):K,[Y,Q]=o.useState("idle"),[me,De]=o.useState(""),[be]=o.useState("top"),te=o.useRef(null),ue=o.useRef(0),fe=o.useRef(null),ge=o.useRef(!0),Ce=Dx({mountedRef:ge}),$e=o.useRef(null),He=o.useRef(d),Te=o.useRef(m);o.useEffect(()=>{He.current=Math.max(0,d||0)},[d]),o.useEffect(()=>{Te.current=Math.max(0,m||0)},[m]);const{start:Ie,stop:qe,settleTo:mt}=c_({audioRef:C,fillRef:h,waveProgressRef:fe,sourcesRef:te,currentIndexRef:ue,sequencer:Ce,leadInMs:d,tailMs:m}),{onReadyChange:ct,waitForReady:rt,markNotReady:ft}=r_({showSoundWaveForm:u,showNoiseWaveForm:c}),ke=o.useRef(null),Ve=o.useRef(i),we=o.useRef(r),Ue=o.useRef(null),Be=o.useRef(!1),[je,Se]=o.useState(!1),Xe=o.useCallback(J=>{Be.current=J,Se(J)},[]),Qe=o.useRef(null),{activeNoiseUrl:dt,noiseSettingsRef:ht,fadeInNoise:wt,fadeOutNoise:Ct}=Rx({noisePlayer:y,audioRef:C,playbackStateRef:M,sequencer:Ce}),{startTTS:Nt,stopTTS:gt}=Px({ttsText:s,playbackRate:le,mainVolume:Ae,fillRef:h,waveProgressRef:fe,setProgress:Z,setPlaybackState:L,setStateLocal:z,fadeInNoise:wt,fadeOutNoise:Ct,noiseSettingsRef:ht,onDoneRef:we,handleEndRef:Qe});o.useEffect(()=>{Fe.current=gt});const it=J=>{if(typeof window>"u"||!window.speechSynthesis){try{De(p("training.ttsUnavailable","\uC774 \uAE30\uAE30\uC5D0\uC11C\uB294 \uC74C\uC131\uC744 \uB4E4\uB824\uC904 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."))}catch{}Nt(J);return}tt("tts"),Nt(J)},Ke=Array.isArray(t)?t.filter(Boolean):t?[t]:[],se=(!Ke||Ke.length===0)&&!!s,Ne=Array.isArray(R)&&R.length>0?R:Array.isArray(W)&&W.length>0?W:null,We=Math.max(Array.isArray(Ne)?Ne.length:0,Ke.length);o.useEffect(()=>(ge.current=!0,()=>{ge.current=!1}),[]);const nt=()=>{Ce.abort()},Fe=o.useRef(null),Ge=o.useRef(null),bt=o.useRef(null),Re=o.useRef(null);Re.current||(Re.current=()=>{bt.current=null;const J=C.current;if(Ge.current==="audio"&&J&&(!J.paused||Ce.isRunning())){nt();try{J.pause()}catch{}ge.current&&(L("paused"),qe(),Ct())}else if(Ge.current==="tts")try{Fe.current?.()}catch{}});const tt=J=>{Ge.current=J,bt.current=lr(Re.current)},xt=()=>{bt.current?.(),bt.current=null};o.useEffect(()=>()=>{Re.current&&ur(Re.current)},[]);const Lt=o.useRef(le);o.useEffect(()=>{Lt.current=le||1},[le]);const et=o.useCallback(J=>{const de=Lt.current||1;try{J.defaultPlaybackRate=de}catch{}try{J.playbackRate=de}catch{}},[]),ot=o.useCallback((J,de)=>{J.src=de,et(J),J.load(),et(J)},[et]),lt=o.useCallback(()=>{Ue.current&&(clearTimeout(Ue.current),Ue.current=null),Q("idle")},[]),st=o.useCallback(async(J,de=3,ae=50,ye=0)=>{lt();const Le=Ce.generation(),ze=!!J&&J.currentTime>0&&!J.ended,ut=Math.max(0,He.current-Math.max(0,ye));if(ut>0&&!ze){tt("audio"),Ie(),L("playing");const yt=ht.current;if(yt?.enabled&&(yt.volume??0)>0)try{wt(yt.volume)}catch{}if(!await Ce.waitPad(ut,"lead",ye)||!ge.current||!Ce.isCurrent(Le))return!1}Ce.enterSound();for(let yt=0;yt<de;yt++){if(!ge.current||!Ce.isCurrent(Le))return!1;try{return tt("audio"),await J.play(),!0}catch(he){if((he instanceof Error||typeof he=="object"&&he&&"name"in he?he.name:void 0)==="AbortError"){if(!Ce.isCurrent(Le))return!1;await new Promise(T=>setTimeout(T,ae));continue}try{De(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."))}catch{}return!1}}try{De(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."))}catch{}return!1},[p,Ie,Ce,wt,ht,lt]),jt=o.useCallback(J=>{const de=Ce.generation(),ae=Math.max(0,Te.current-Math.max(0,J));Ie();const ye=ht.current;if(ye?.enabled&&(ye.volume??0)>0)try{wt(ye.volume)}catch{}const Le=()=>{try{$e.current?.()}catch{}};if(ae<=0){Ce.leave(),Le();return}Ce.waitPad(ae,"tail",J).then(ze=>{Ce.leave(),ze&&Ce.isCurrent(de)&&Le()}).catch(()=>{})},[Ce,Ie,wt,ht]),Wt=o.useCallback(()=>{const J=C.current;if(!J)return;const de=()=>{L("playing"),z("playMode"),U(!0),Ie();try{Jr(),Ya(J).then(ze=>{if(ge.current)try{x.current?.("main",ze)}catch{}})}catch{}const Le=ht.current;Le?.enabled&&(Le?.volume??0)>0&&wt(Le.volume)},ae=()=>{Zx({ended:!!J?.ended,completedByEnd:Be.current})||(L("paused"),qe(),Ct())},ye=()=>{const Le=()=>{try{const ze=te.current,ut=Yx(ze,ue.current);if(ut!==null){ue.current=ut,j(ut),U(!0);const yt=ze?.[ut]&&ze[ut].src;if(yt&&J){ot(J,yt),st(J).catch(()=>{});return}}}catch{}L("stopped"),Z(1);try{if(J)try{J.currentTime=0}catch{}}catch{}qe(),U(!1),Ct();try{!Ve.current&&Qe.current&&Qe.current()}catch{}};if($e.current=Le,Te.current>0){Ie(),Ce.waitPad(Te.current,"tail").then(ze=>{Ce.leave(),ze&&Le()}).catch(()=>{});return}Le()};return J.addEventListener("play",de),J.addEventListener("pause",ae),J.addEventListener("ended",ye),()=>{try{J.removeEventListener("play",de),J.removeEventListener("pause",ae),J.removeEventListener("ended",ye),qe()}catch{}}},[wt,Ct,st,ht,Ie,qe,Ce]);o.useEffect(()=>Wt(),[Wt]),o.useEffect(()=>{Ve.current=i},[i]),o.useEffect(()=>{we.current=r},[r]),o.useEffect(()=>{if(i||q!=="active")return;const J=k.current;if(!J)return;let de=null;const ae=requestAnimationFrame(()=>{try{const ye=J.getTotalLength();if(!ye)return;const Le=ye*.2;J.style.strokeDasharray=`${ye-Le} ${Le}`;const ze="triFlow_"+Math.random().toString(36).slice(2);de=document.createElement("style"),de.textContent=`@keyframes ${ze}{from{stroke-dashoffset:0}to{stroke-dashoffset:-${ye}}}`,document.head.appendChild(de),J.style.animation=`${ze} 2.4s linear infinite`}catch{}});return()=>{cancelAnimationFrame(ae),de?.remove()}},[q,i]),o.useEffect(()=>{te.current=R},[R]),o.useEffect(()=>{ue.current=S},[S]),o.useEffect(()=>{const J=_.current,de=A.current;if(!J||!de)return;let ae=null;const ye=32,Le=60,ze=()=>{try{const yt=Array.from(J.querySelectorAll(":scope > .button"));let he=0;yt.forEach(Pe=>{if(Pe===de)return;const Ze=Pe.getBoundingClientRect();he+=Ze.width});const T=J.getBoundingClientRect().width,X=Math.max(0,Math.floor(T-he-8)),ce=We;if(!ce||X<=0){Array.from(de.children).forEach(Pe=>{try{Pe.style.width=""}catch{}});return}let Ee=Math.floor(X/ce);Ee>Le&&(Ee=Le),Ee<ye&&(Ee=Math.max(ye,Math.floor(X/ce))),Array.from(de.querySelectorAll(".button")).forEach(Pe=>{try{Pe.style.width=`${Ee}px`}catch{}})}catch{}},ut=requestAnimationFrame(ze);try{ae=new ResizeObserver(()=>{requestAnimationFrame(ze)}),ae.observe(J),ae.observe(de),window.addEventListener("resize",ze)}catch{}return()=>{try{cancelAnimationFrame(ut)}catch{}try{ae&&(ae.disconnect(),ae=null)}catch{}try{window.removeEventListener("resize",ze)}catch{}}},[R,W,We]),o.useEffect(()=>()=>{try{ke.current&&(clearTimeout(ke.current),ke.current=null),Ue.current&&(clearTimeout(Ue.current),Ue.current=null)}catch{}},[]);const mn=(J,de)=>{H(J),ne(de),ft(),I(Xx(J)),te.current=J},hn=()=>{z("playMode"),j(0),U(!0)},jn=async(J,de)=>{Xe(!1),b.current=!1,ot(J,de),await kc(J),await rt()!==!1&&(N(!1),hn(),await st(J))},zn=async(J,de=!1)=>{const ae=C.current;N(!0),P("measuring_duration");try{const ye=await cs(J,{timeoutMs:1e4,rejectOnError:!0});mn([{src:J,objectUrl:null,duration:ye}],ye),P("ready"),de&&ae&&await jn(ae,J)}finally{b.current=!1,N(!1)}},Wn=async(J,de=!1)=>{const ae=C.current;N(!0),P("measuring_duration");try{const ye=await Promise.all(J.map(ze=>cs(ze,{timeoutMs:1e4})));if(!ge.current)return;const Le=J.map((ze,ut)=>({src:ze,objectUrl:null,duration:ye[ut]||0}));mn(Le,Jx(Le)),P("ready"),de&&ae&&Le.length>0&&await jn(ae,Le[0].src)}finally{b.current=!1,N(!1)}},It=async(J=!1,de=!0)=>{const ae=C.current,ye=t?Array.isArray(t)?t:[t]:[];if(!ye||ye.length===0||!ye.some(Boolean))return!1;if(b.current)return null;b.current=!0,de&&N(!0),P("resolving");try{const Le=Qx(t,a,fi),ze=[];let ut=0;for(const yt of Le){let he=yt.src??null,T=null;if(!he&&yt.resolvedPath){try{P("getting_signed_url"),he=await Ci(yt.resolvedPath)}catch{he=null}if(!ge.current)return!1;if(!he)try{P("downloading");const ce=await gi(yt.resolvedPath);if(!ge.current)return!1;if(ce){const Ee=ce instanceof Blob?ce:new Blob([ce]);T=g.track(URL.createObjectURL(Ee)),he=T}}catch{P("error");try{De(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4.")),z("active")}catch{}}}if(!he)continue;let X=0;try{P("measuring_duration"),X=await cs(he,{timeoutMs:3e3})}catch{X=0}if(!ge.current){if(T)try{URL.revokeObjectURL(T)}catch{}for(const ce of ze)if(ce.objectUrl)try{URL.revokeObjectURL(ce.objectUrl)}catch{}return!1}ut+=X||0,ze.push({...yt,src:he,objectUrl:T,duration:X})}if(mn(ze,ut),ze.length>0&&J&&ae){const yt=ze[0];Xe(!1);try{g.keepOnly(ze.map(he=>he.objectUrl))}catch{}if(P("ready"),b.current=!1,yt.src&&ae)try{if(ot(ae,yt.src),await kc(ae),await rt()===!1)return!1;de&&N(!1),hn(),ae&&await st(ae)}catch{de&&N(!1)}else de&&N(!1);z("playMode"),j(0),U(!0)}return ze.length>0}finally{b.current=!1,de&&N(!1),P(Le=>Le==="ready"?"ready":"idle")}},vn=async J=>{const de=Ce.isRunning();if(J.paused&&!de){if(Be.current){await Ht();return}const ae=Ce.resume();if(ae){if(L("playing"),ae.phase==="tail"){jt(ae.elapsed);return}await st(J,3,50,ae.elapsed);return}await st(J),L("playing")}else Ce.pause(),nt(),J.pause(),L("paused"),de&&(qe(),Ct())},Ft=async()=>{const J=C.current;if(!(!J&&!se)){if(se){const de=window.speechSynthesis;if(q==="active"){const ae=Ba(),ye=Array.isArray(s)?s.filter(Boolean):s?[s]:[];if(ae&&ye.length>0){if(b.current)return;z("load"),N(!0),P("synthesizing"),b.current=!0;try{const Le=await Promise.all(ye.map(ze=>Promise.resolve(ae(ze))));Le.length>1?await Wn(Le,!0):await zn(Le[0],!0)}catch{b.current=!1,N(!1),z("active"),it(ye.length>0?ye:void 0)}return}it(ye.length>0?ye:void 0);return}if(q==="playMode"){const ae=!!de&&(de.speaking||de.paused)&&!(J&&(J.currentSrc||J.getAttribute("src")));if(J&&!ae){await vn(J);return}try{if(de&&de.paused)try{tt("tts"),de.resume(),L("playing")}catch{}else try{de.pause(),L("paused")}catch{}}catch{}}return}if(q==="active"){if(i&&Array.isArray(te.current)&&te.current.length>0){const ae=te.current[0];try{if(ae.src&&J)try{ot(J,ae.src),hn(),J&&await st(J)}catch{}hn();return}catch{}}z("load");let de;try{de=await It(!0)}catch{de=!1}if(de===!1&&ge.current){try{De(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."))}catch{}z("active")}return}if(q!=="load"&&(q==="playMode"||q==="active"))try{J&&await vn(J)}catch(de){(de instanceof Error||typeof de=="object"&&de&&"name"in de)&&de.name}}},Ht=async()=>{const J=C.current;if(J)try{const de=te.current;if(Array.isArray(de)&&de.length>1){await $t(0);return}Xe(!1);try{J.currentTime=0}catch{}J&&await st(J),L("playing"),z("playMode")}catch{}},Mn=()=>{nt(),xt(),Fe.current?.();const J=C.current;try{if(J){try{J.pause()}catch{}try{J.currentTime=0}catch{}}}catch{}Ct(),L("stopped"),z("active"),Z(0),U(!1)},on=async(J,{sameSegment:de=!1}={})=>{nt();const ae=Ce.generation(),ye=C.current,Le=te.current?.[J]?.src;try{if(Xe(!1),j(J),U(!0),ue.current=J,!Le||!ye||(de||ft(),ot(ye,Le),!de&&await rt()===!1)||!Ce.isCurrent(ae)||(await st(ye),!Ce.isCurrent(ae)))return;L("playing"),z("playMode")}catch{}},xn=async()=>{const J=te.current,de=ue.current||0;if(!J||de<=0){await Ht();return}await on(de-1)},Hn=async()=>{const J=te.current,de=ue.current||0;if(!J||de>=J.length-1){Mn();return}await on(de+1)},_n=()=>{if(Be.current)return;const J=200,de=340;Xe(!0),nt(),xt();try{Z(1)}catch{}mt(1);try{Q("hold")}catch{}try{const ae=C.current,ye=se&&!!ae?.src;if(!se||ye){if(ae){ae.pause();try{ae.currentTime=0}catch{}}}else gt();Ct()}catch{}try{L("stopped")}catch{}if(U(!1),!Ve.current)try{Ue.current&&(clearTimeout(Ue.current),Ue.current=null),Ue.current=setTimeout(()=>{try{Q("out")}catch{}Ue.current=setTimeout(()=>{try{typeof we.current=="function"&&we.current(!0)}catch{}try{Q("idle")}catch{}Ue.current=null},de)},J)}catch{}};o.useEffect(()=>{Qe.current=_n});const Vt=o.useCallback(()=>De(""),[]),$t=async J=>{(te.current||[])[J]&&await on(J,{sameSegment:J===ue.current})},qt=G==="playing",fn=o.useMemo(()=>{if(!W||W.length<=1)return W;const J=W[S];return J?[J]:W},[W,S]),Ot=i===!0;o.useEffect(()=>{try{const J=C.current;J&&typeof J.playbackRate=="number"&&et(J)}catch{}},[le,et]);const sn=o.useRef({raf:null,timer:null});o.useEffect(()=>{const J=C.current;if(!J)return;const de=Math.max(0,Math.min(1,Ae)),ae=sn.current,ye=()=>{ae.raf!==null&&(cancelAnimationFrame(ae.raf),ae.raf=null),ae.timer!==null&&(clearTimeout(ae.timer),ae.timer=null)};ye();const Le=Za(J);if(J.paused||Math.abs(Le-de)<.001||typeof requestAnimationFrame!="function"){try{Pn(J,de)}catch{}return}const ze=performance.now(),ut=()=>{const yt=Math.min(1,(performance.now()-ze)/150);try{Pn(J,Le+(de-Le)*yt)}catch{}ae.raf=yt<1?requestAnimationFrame(ut):null};return ae.raf=requestAnimationFrame(ut),ae.timer=setTimeout(()=>{ye();try{Pn(J,de)}catch{}},200),ye},[Ae]);const Dt=Y==="hold",ie=Y==="out",ve=q==="playMode"&&!D&&!je||Dt||ie,Me=G!=="stopped"||Dt||ie,Je=G==="paused",Oe=Math.max(0,Math.min(100,($||0)*100)),Ye=_e("audio-player__fill",ve?"is-visible":"",Me?"is-expanded":"",Je?"is-paused":"",ie?"is-out":"");return n.jsxs("div",{className:`audio-player ${Ot?"is-disabled":""}${l?` ${l}`:""}`,role:"group","aria-label":typeof f=="string"?f:void 0,children:[n.jsxs("div",{className:`audio-player__panel ${qt?"is-playing":""} ${D?"is-loading":""} ${q!=="default"?"is-revealed":""}`,children:[D?n.jsxs("div",{className:"audio-player__loading",role:Bc[O]?"status":void 0,"aria-live":Bc[O]?"polite":"off",children:[n.jsx("span",{className:"audio-player__loading-spinner","aria-hidden":"true"}),n.jsx("span",{className:"audio-player__loading-text",children:p(`training.audioStatus.${O}`,{defaultValue:n_[O]})})]}):null,q==="active"?n.jsx("button",{className:"audio-player__button",type:"button",disabled:Ot,onClick:()=>{V.current=hr(),E(),Ft()},"aria-label":typeof f=="string"?f:p("training.listen","\uB4E3\uAE30"),onMouseEnter:B,onMouseLeave:E,onFocus:B,onBlur:E,children:n.jsx("span",{ref:v,className:"audio-player__button-triangle-wrap",children:n.jsx("svg",{className:"audio-player__button-triangle",viewBox:"0 0 24 24","aria-hidden":"true",children:n.jsx("path",{ref:k,d:"M13.2 7.7 L16.5 9.85 Q20.2 12 16.5 14.15 L10 18.3 Q7 19.7 7 16.3 L7 7.7 Q7 4.3 10 5.7 L13.2 7.7"})})})}):null,w&&n.jsx(Bn,{anchorRect:w,text:typeof f=="string"&&f?f:p("training.listenLabel","\uBB38\uC7A5 \uB4E3\uAE30"),offset:8}),n.jsxs("div",{className:`audio-player__play ${q==="playMode"||qt?"is-visible":""}`,inert:!(q==="playMode"||qt)||void 0,children:[n.jsxs("div",{ref:_,className:"audio-player__buttons",children:[n.jsx(pe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"skip-back",onClick:xn,ariaLabel:p("training.prev","\uC774\uC804"),width:"60px",variant:"transparent-white","aria-hidden":"true",tabIndex:-1,disabled:q!=="playMode"}),n.jsx(pe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:qt?"pause":"play",onClick:Ft,ariaLabel:p("common.playPause","\uC7AC\uC0DD / \uBA48\uCDA4"),"aria-pressed":qt,width:"60px",variant:"transparent-white",disabled:q!=="playMode"}),n.jsx(pe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"square",onClick:Mn,ariaLabel:p("training.stop","\uC815\uC9C0"),width:"60px",variant:"transparent-white","aria-hidden":"true",tabIndex:-1,disabled:q!=="playMode"}),We>1?n.jsx("div",{ref:A,className:"audio-player__source-buttons",children:Array.from({length:We}).map((J,de)=>n.jsx(pe,{htmlType:"button",size:32,type:"dot",shape:"pill",useBorder:!1,label:String(de+1),onClick:()=>{try{$t(de)}catch{}},ariaLabel:p("training.sourcePlay",{n:de+1}),variant:"transparent-white",selected:F&&S===de,disabled:q!=="playMode"||!(Array.isArray(R)&&R[de]),showTooltipInfo:!0},de))}):null,!Array.isArray(R)||R.length<=1?n.jsx(pe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"repeat",onClick:Ht,ariaLabel:p("common.replay","\uB2E4\uC2DC\uB4E3\uAE30"),width:"60px",variant:"transparent-white",disabled:q!=="playMode"}):null,n.jsx(pe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"skip-forward",onClick:Hn,ariaLabel:p("training.next","\uB2E4\uC74C"),width:"60px",variant:"transparent-white","aria-hidden":!0,tabIndex:-1,disabled:q!=="playMode"}),n.jsx(pe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"check",onClick:_n,ariaLabel:p("common.done","\uC644\uB8CC"),width:"60px",variant:"transparent-white",disabled:q!=="playMode"})]}),n.jsxs("div",{className:"audio-player__slider",children:[n.jsx("div",{className:Ye,ref:h,style:{left:`${Oe}%`},"aria-hidden":"true"}),(u||c)&&n.jsx(t_,{segments:fn,progress:$,totalDuration:re,waveProgressRef:fe,showSoundWaveForm:u,leadInMs:d,tailMs:m,trackDurationSec:R?.[S]?.duration??0,noiseSrc:c&&y?.settings.enabled&&oe>0?dt:null,noiseRatio:y?qa(y.settings):0,noiseSpeed:y?.settings.speed??1,mainVolume:K,onReadyChange:ct})]})]}),n.jsx("audio",{ref:C,crossOrigin:"anonymous",preload:"auto"})]}),!u&&n.jsxs("p",{className:"audio-player__no-waveform caption-1",children:[n.jsx(at,{icon:"triangle-alert",size:14}),p("training.noSoundWaveform","\uC18C\uB9AC \uBE44\uAD50 \uBB38\uC81C\uB294 \uC6E8\uC774\uBE0C\uD3FC\uC744 \uD45C\uD604\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.")]}),n.jsx(da,{message:me,position:be,onClose:Vt})]})}function wr(e){const{t}=xe.useTranslation(),{text:a,label:r,anchorRect:i=null,onClose:s,closeOnOutsideClick:l=!0,isMobilePopup:u=!1}=e||{},[c,d]=o.useState(()=>{try{return localStorage.getItem("tooltip-theme")||"light"}catch{return"light"}});o.useEffect(()=>{try{localStorage.setItem("tooltip-theme",c)}catch{}},[c]);const{increase:m,decrease:p,canIncrease:f,canDecrease:y,fontSize:x,lineHeight:C}=Al({storageKey:"tooltip-fontScale"}),h=o.useCallback(()=>d(k=>k==="dark"?"light":"dark"),[]),_=o.useCallback(k=>{try{k.stopPropagation()}catch{}try{typeof s=="function"&&s()}catch{}},[s]),g=Array.isArray(a)?a:typeof a>"u"||a===null?[]:[a],A={fontSize:`${x}px`,lineHeight:`${C}px`,"--tt-line-height":`${C}px`,"--tt-marker-size":"28px"},b=n.jsxs("div",{className:`tooltip-textbox__root ${c==="dark"?"is-dark":""}`,children:[n.jsxs("div",{className:"tooltip-textbox__box",children:[r&&n.jsx("div",{className:"tooltip-textbox__label body-2b",children:r}),n.jsx("div",{className:"tooltip-textbox__text body-1",style:A,children:g.map((k,v)=>n.jsxs("div",{className:"tooltip-textbox__line",children:[g.length>1?n.jsx("div",{className:"tooltip-textbox__marker",children:n.jsx("span",{className:"tooltip-textbox__line-number button-1",children:v+1})}):null,n.jsx("span",{className:"tooltip-textbox__line-text",children:k})]},v))})]}),n.jsxs("div",{className:"tooltip-textbox__buttons",children:[n.jsx(pe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",useBorder:!1,width:48,icon:"minus",onClick:p,ariaLabel:t("training.fontSizeDecrease","\uAE00\uC790 \uD06C\uAE30 \uAC10\uC18C"),variant:c==="dark"?"transparent-white":"transparent-gray",disabled:!y}),n.jsx(pe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",useBorder:!1,width:48,icon:"plus",onClick:m,ariaLabel:t("training.fontSizeIncrease","\uAE00\uC790 \uD06C\uAE30 \uC99D\uAC00"),variant:c==="dark"?"transparent-white":"transparent-gray",disabled:!f}),n.jsx(pe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",useBorder:!1,width:48,icon:c==="dark"?"moon":"sun-medium",onClick:h,ariaLabel:t("training.toggleBackground","\uBC30\uACBD \uC804\uD658"),variant:c==="dark"?"transparent-white":"transparent-gray"}),n.jsx(pe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",useBorder:!1,width:48,icon:"x",onClick:_,ariaLabel:t("common.close","\uB2EB\uAE30"),variant:c==="dark"?"transparent-white":"transparent-gray"})]})]});return i?n.jsx(cn,{anchorRect:i,className:`tooltip-textbox ${c==="dark"?"is-dark":""}`,onClose:s,closeOnOutsideClick:l,isMobilePopup:u,ariaLabel:r||t("tooltip.textbox","\uBCF8\uBB38"),children:b}):n.jsx("div",{className:`tooltip-textbox ${c==="dark"?"is-dark":""}`,children:b})}function Nc({state:e="disabled"}){const{t}=xe.useTranslation();return n.jsxs("div",{className:`ts-bullet ts-bullet--${e}`,"aria-hidden":!0,children:[n.jsx("div",{className:"bullet__dot",children:n.jsx(at,{icon:"chevron-right",label:t("training.next","\uB2E4\uC74C"),className:"bullet__icon",imgClassName:"bullet__icon-img",maskClassName:"bullet__icon-mask",svgClassName:"bullet__icon-svg",wrapperStyle:{},size:20})}),n.jsx("div",{className:"ts-bullet__line"})]})}function Ec(e,t,a){const r=o.useRef(t),i=o.useRef(a);o.useEffect(()=>{r.current=t,i.current=a}),o.useEffect(()=>{if(!e||typeof document>"u")return;let s=null,l=10;const u=()=>{s=null;const c=r.current(),d=c?Array.from(c.querySelectorAll(Cn)).find(m=>!m.closest('[aria-hidden="true"]')):void 0;if(d){try{d.focus()}catch{}if(document.activeElement===d)return}--l>0&&(s=requestAnimationFrame(u))};return s=requestAnimationFrame(u),()=>{s!==null&&cancelAnimationFrame(s);const c=document.activeElement;if(!c||c===document.body||!document.contains(c)||c.closest(".tooltip-content")){const d=i.current();if(d)try{d.focus()}catch{}}}},[e])}function Dc({title:e,children:t,className:a="",state:r="disabled",usePreviewTextBtn:i=!1,onPreviewTextBtn:s,previewText:l=null,useFaded:u,usePlayAllBtn:c=!1,onPlayAll:d,playAllActive:m=!1}){const{t:p}=xe.useTranslation(),f=ln("(max-width: 767px)"),y=`training-step__title h4 ${u&&r==="disabled"?"training-step__title--faded":""} ${a}`.trim(),x=`training-step__title-row training-step__title-row--${r}`.trim(),C=o.useRef(null),[h,_]=o.useState(!1),[g,A]=o.useState(null),[b,k]=o.useState(null);Ec(h&&!!g,()=>{if(typeof document>"u")return null;const D=Array.from(document.querySelectorAll(".tooltip-content"));for(let N=D.length-1;N>=0;N--)if(D[N].querySelector(".tooltip-textbox__root"))return D[N];return null},()=>C.current?.querySelector("button")??null);const v=o.useRef(s);o.useEffect(()=>{v.current=s});const w=o.useMemo(()=>l==null?"":typeof l=="string"||typeof l=="number"?String(l):Array.isArray(l)&&l.every(D=>typeof D=="string"||typeof D=="number")?l.join(""):"",[l]),B=o.useCallback(()=>{_(!1),A(null),k(null)},[]);o.useEffect(()=>{if(!h)return;let D;try{typeof v.current=="function"&&(D=v.current())}catch{}if(D===!1){B();return}k(typeof D<"u"&&D!==null?D:null)},[w]);const E=o.useCallback(()=>{let D;try{typeof s=="function"&&(D=s())}catch{}if(D!==!1){if(k(typeof D<"u"&&D!==null?D:l),!C.current){_(N=>!N);return}if(h)_(!1),A(null),k(null);else{const N=C.current.getBoundingClientRect();A(N),_(!0)}}},[s,l,h]);return n.jsxs("div",{className:x,children:[n.jsx("p",{className:y,children:n.jsx("span",{className:"training-step__title-text",children:e??t})}),i||c?n.jsxs("div",{className:"title-controls",children:[n.jsxs("div",{className:"title-buttons",children:[c&&n.jsx(pe,{htmlType:"button",size:32,type:f?"dot":"bar",icon:"play-circle",label:f?void 0:p("training.playAll","\uBAA8\uB450 \uB4E3\uAE30"),ariaLabel:p("training.playAll","\uBAA8\uB450 \uB4E3\uAE30"),selected:m,onClick:d,variant:r==="disabled"?"disabled":"default",disabled:r==="disabled"||m,onDisabledClick:m&&r!=="disabled"?()=>{}:void 0}),i&&n.jsx("div",{ref:C,children:n.jsx(pe,{htmlType:"button",size:32,type:f?"dot":"bar",icon:"eye",label:f?void 0:p("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),ariaLabel:p("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),onClick:E,className:h?"is-selected":void 0,"aria-expanded":h,"aria-haspopup":"dialog",variant:r==="disabled"?"disabled":"default",disabled:!l&&typeof s!="function"})})]}),h&&n.jsx(wr,{text:b??l,label:p("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),anchorRect:g,onClose:B,closeOnOutsideClick:!1,isMobilePopup:!0})]}):null]})}function ps(e,t){return typeof t!="number"||typeof e!="number"?"disabled":e<t?"done":e===t?"active":"disabled"}function Jn({index:e,stepIndex:t,isLast:a=!1,title:r="",titleProps:i={},children:s,className:l="",onDone:u=void 0,useTitleFaded:c=void 0,lockedHint:d}){const{t:m}=xe.useTranslation(),[p,f]=o.useState(()=>ps(e,t));o.useEffect(()=>{const v=ps(e,t);if(v!==p){const w=setTimeout(()=>f(v),0);return()=>clearTimeout(w)}},[e,t,p]);const y=o.useCallback((...v)=>{ps(e,t)==="done"||p==="done"||typeof u=="function"&&u(...v)},[e,t,p,u]),[x,C]=o.useState(!1),[h,_]=o.useState({text:"",label:"\uBB38\uC7A5 \uB4E3\uAE30",anchorRect:null,backdrop:!1,alignX:null,alignY:null}),g=o.useCallback(v=>{if(!v)return null;try{const w=v;if(typeof v=="object"&&(w.currentTarget||w.target)&&(w.nativeEvent||w.type)){const D=w.currentTarget??w.target;if(D&&typeof D.getBoundingClientRect=="function")return D.getBoundingClientRect()}if(v instanceof DOMRect)return v;const B=v;if(B&&typeof B.getBoundingClientRect=="function")return B.getBoundingClientRect();const E=v?.current;return E&&typeof E.getBoundingClientRect=="function"?E.getBoundingClientRect():null}catch{return null}},[]),A=o.useCallback((v,{text:w="",label:B="\uBB38\uC7A5 \uB4E3\uAE30",backdrop:E=!1,alignX:D="center",alignY:N="top"}={})=>{const O=g(v);_({text:w,label:B,anchorRect:O,backdrop:E,alignX:D,alignY:N}),C(!0)},[g]),b=o.useCallback(()=>{C(!1),_(v=>({...v,anchorRect:null}))},[]),k=o.Children.map(s,v=>{if(o.isValidElement(v)){const w=v;if(typeof w.type=="string")return w;const B=w.props??{},E=typeof B.onDone=="function"?B.onDone:y,D=typeof B.disabled=="boolean";let N=p==="disabled";return D&&(N=!!B.disabled),o.cloneElement(w,{onDone:E,disabled:N,showTooltip:A,hideTooltip:b})}return v});return n.jsxs("div",{className:`training-step training-step--${p} ${a?"training-step--last":""} ${l}`,"aria-current":p==="active",children:[n.jsx(Nc,{state:p}),n.jsxs("div",{className:"training-step__content",children:[n.jsx(Dc,{state:p,title:r,...i,useFaded:c}),p==="disabled"&&d&&typeof e=="number"&&typeof t=="number"&&e===t+1&&n.jsx("p",{className:"training-step__locked-hint caption-1",role:"status",children:d}),k]}),x?n.jsx(cn,{anchorRect:h.anchorRect,backdrop:h.backdrop,onClose:b,ariaLabel:m("tooltip.textbox","\uBCF8\uBB38"),children:n.jsx(wr,{text:h.text,onClose:b})}):null]})}function Sc({context:e,state:t="disabled",theme:a="light"}){const{t:r}=xe.useTranslation(),[i,s]=o.useState("disabled"),[l,u]=o.useState(()=>{try{return localStorage.getItem("tooltip-theme")||a}catch{return a}});o.useEffect(()=>{try{localStorage.setItem("tooltip-theme",l)}catch{}},[l]);const c=()=>u(P=>P==="dark"?"light":"dark"),{increase:d,decrease:m,canIncrease:p,canDecrease:f,fontSize:y,lineHeight:x}=Al({storageKey:"textbox_fontScale"}),[C,h]=o.useState(""),_=o.useRef(null),g=o.useRef(!1),A=o.useCallback(()=>{g.current=hr()&&!!_.current&&_.current.contains(document.activeElement),s("active")},[]),b=o.useCallback(()=>h(""),[]),k=P=>{try{h(P)}catch{}},v=typeof navigator<"u"&&/Mobi|Android/i.test(navigator.userAgent||"");o.useEffect(()=>{if(t!=="disabled"){const P=setTimeout(()=>s(t),0);return()=>clearTimeout(P)}},[t]);const w=o.useMemo(()=>e&&typeof e=="object"?String(e.sentence??e.text??""):typeof e=="string"?e:"",[e]),[B,E]=o.useState(w);B!==w&&(E(w),s("disabled"));const D=t==="disabled"?i:t,N=D==="disabled"?"training-text-box--disabled":D==="active"?"training-text-box--active":D==="done"?"training-text-box--done":"",O=o.useMemo(()=>({fontSize:`${y}px`,lineHeight:`${x}px`}),[y,x]);return o.useEffect(()=>{if(D==="disabled"||!g.current)return;g.current=!1;const P=document.activeElement;P&&P!==document.body||_.current?.querySelector(".training-text-box__buttons button")?.focus()},[D]),n.jsxs("div",{ref:_,className:`training-text-box ${N} ${D!=="disabled"&&l==="dark"?"is-dark":""}`,children:[D==="disabled"&&n.jsx("div",{className:"training-text-box__preview",children:n.jsx(pe,{htmlType:"button",size:48,type:"bar",onClick:A,icon:"eye",ariaLabel:r("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),label:r("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),useBorder:!1})}),n.jsx("div",{className:"training-text-box__area","aria-hidden":D==="disabled",children:n.jsx("span",{className:"training-text-box__inner h3",style:O,children:w})}),D!=="disabled"&&n.jsxs("div",{className:"training-text-box__buttons","aria-hidden":D==="disabled",children:[n.jsx(pe,{htmlType:"button",size:32,type:"dot",onClick:m,onDisabledClick:()=>k(r("training.fontSizeMin","\uAE00\uC528 \uD06C\uAE30\uAC00 \uCD5C\uC18C\uC785\uB2C8\uB2E4.")),ariaLabel:r("training.fontSizeDecrease","\uAE00\uC790 \uD06C\uAE30 \uAC10\uC18C"),icon:"minus",variant:l==="dark"?"transparent-white":"transparent-gray",disabled:!f,useBorder:!1,showTooltipInfo:!0,...!v&&{width:"60px"}}),n.jsx(pe,{htmlType:"button",size:32,type:"dot",onClick:d,onDisabledClick:()=>k(r("training.fontSizeMax","\uAE00\uC528 \uD06C\uAE30\uAC00 \uCD5C\uB300\uC785\uB2C8\uB2E4.")),ariaLabel:r("training.fontSizeIncrease","\uAE00\uC790 \uD06C\uAE30 \uC99D\uAC00"),icon:"plus",variant:l==="dark"?"transparent-white":"transparent-gray",disabled:!p,useBorder:!1,showTooltipInfo:!0,...!v&&{width:"60px"}}),n.jsx(pe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",useBorder:!1,width:48,icon:l==="dark"?"moon":"sun-medium",onClick:c,ariaLabel:r("training.toggleBackground","\uBC30\uACBD \uC804\uD658"),variant:l==="dark"?"transparent-white":"transparent-gray"})]}),n.jsx(da,{message:C,position:"top",onClose:b})]})}function Qn(e){return e==="active"||e==="done"}function ms({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:i,useTitleFaded:s,onDone:l,onChange:u,answer:c,wrongAnswers:d,choices:m,multiSelect:p=!1,correctCount:f=0,useDisabledCovered:y=!1,choiceIcons:x,shuffleChoices:C=!0}){const{t:h}=xe.useTranslation(),_=i??h("training.selectConfirm","\uBB38\uC81C\uB97C \uBCF4\uACE0 \uD574\uB2F9\uD558\uB294 \uB0B4\uC6A9\uC744 \uC120\uD0DD\uD558\uC138\uC694."),g=typeof e=="number"?e:-1,A=typeof t!="number"?"disabled":g<t?"done":g===t?"active":"disabled",b=Array.isArray(m)&&m.length?m:typeof c<"u"?[c].concat(Array.isArray(d)?d:[]):void 0,k=d?d.join("||"):"",v=m?m.join("||"):"",[w,B]=o.useState(()=>Array.isArray(b)?C?Na(b):b.slice():void 0);o.useEffect(()=>{Array.isArray(b)&&b.length?B(C?Na(b):b.slice()):B(void 0)},[c,k,v,C]);const[E,D]=o.useState(null),[N,O]=o.useState(()=>new Set);o.useEffect(()=>{D(null),O(new Set)},[v,c,k]);const P=o.useRef(void 0);o.useEffect(()=>{const M=P.current;typeof M=="number"&&typeof t=="number"&&typeof e=="number"&&M>=e&&t<e&&(D(null),O(new Set)),P.current=t},[t,e]);const G=o.useCallback(M=>{if(!Qn(A))return;const $=w?.[M];if($==null)return;const Z=$;if(p){const q=new Set(N);q.has(Z)?q.delete(Z):q.add(Z),O(q),typeof u=="function"&&u({selectedValues:[...q],__ts:Date.now()}),typeof l=="function"&&l({selectedValues:[...q],__ts:Date.now()})}else D(Z),typeof u=="function"&&u({selectedIndex:M,selectedValue:Z,__ts:Date.now()}),typeof l=="function"&&l({selectedIndex:M,selectedValue:Z,__ts:Date.now()})},[w,A,p,u,N]),L=`training-step__buttons${Array.isArray(w)&&w.length>3?" training-step__buttons--wrap-3":""}`;return n.jsx(Jn,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:_,useTitleFaded:s,children:n.jsx("div",{className:L,children:Array.isArray(w)&&w.length>0?w.map((M,$)=>n.jsx(pe,{htmlType:"button",size:56,type:"bar",onClick:()=>G($),ariaLabel:String(M),label:M,useLabel:!0,icon:x?x[String(M)]:void 0,variant:"default",disabled:A==="disabled",selected:p?N.has(M):E===M,useDisabledCovered:y,minWidth:0},String(M))):null})})}function hs({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:i,onDone:s,onChange:l,context:u,demoSelected:c}){const{t:d}=xe.useTranslation(),m=i??d("training.confirmTitle","\uBB38\uC7A5\uC744 \uD655\uC778\uD558\uACE0 \uC798 \uB4E4\uB838\uB294\uC9C0 \uC120\uD0DD\uD558\uC138\uC694."),p=typeof e=="number"?e:-1,f=typeof t!="number"?"disabled":p<t?"done":p===t?"active":"disabled",y=u&&typeof u=="object"?u.sentence||"":typeof u=="string"?u:"",x=u&&typeof u=="object"?u.choices:void 0,[C,h]=o.useState(c??null),_=`${String(y)}\0${JSON.stringify(x??null)}`,[g,A]=o.useState(_);g!==_&&(A(_),c==null&&h(null));const[b,k]=o.useState(c);Object.is(b,c)||(k(c),h(c??null));const v=o.useRef(void 0);o.useEffect(()=>{const D=v.current;typeof D=="number"&&typeof t=="number"&&typeof e=="number"&&D>=e&&t<e&&c==null&&h(null),v.current=t},[t,e,c]);const w=o.useCallback(D=>{const N=typeof D=="object"&&D!==null?Object.assign({},D,{__ts:Date.now()}):{value:D,__ts:Date.now()};typeof l=="function"&&l(N),Qn(f)&&typeof s=="function"&&s(N)},[l,f,s]),B=o.useCallback(()=>{Qn(f)&&(h(!1),w(!1))},[w,f]),E=o.useCallback(()=>{Qn(f)&&(h(!0),w(!0))},[w,f]);return n.jsxs(Jn,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:m,onDone:s,useTitleFaded:!1,children:[n.jsx(Sc,{context:u,state:f}),n.jsx("div",{className:"training-step__buttons",children:Array.isArray(x)&&x.length>0?x.slice(0,6).map((D,N)=>n.jsx(pe,{htmlType:"button",size:56,type:"bar",onClick:()=>{Qn(f)&&(h(N),w&&w(N))},disabled:f==="disabled",ariaLabel:String(D),label:D,variant:f,selected:C===N},N)):n.jsxs(n.Fragment,{children:[n.jsx(pe,{htmlType:"button",size:56,type:"bar",onClick:B,disabled:f==="disabled",icon:"x",ariaLabel:d("training.notHeard","\uC548 \uB4E4\uB838\uC5B4\uC694."),label:d("training.notHeard","\uC548 \uB4E4\uB838\uC5B4\uC694."),variant:"default",selected:C===!1}),n.jsx(pe,{htmlType:"button",size:56,type:"bar",onClick:E,disabled:f==="disabled",icon:"circle",ariaLabel:d("training.heardWell","\uC798 \uB4E4\uB838\uC5B4\uC694."),label:d("training.heardWell","\uC798 \uB4E4\uB838\uC5B4\uC694."),variant:"default",selected:C===!0})]})})]})}function fs({index:e,stepIndex:t,isLast:a=!1,title:r,onDone:i,btnLabel:s,soundSrc:l,bucketPath:u,usePreviewTextBtn:c,previewText:d=null,onPreviewTextBtn:m,disabled:p,_pageIndex:f,showSoundWaveForm:y,showNoiseWaveForm:x,leadInMs:C,tailMs:h}){const{t:_}=xe.useTranslation(),g=r??_("training.listenTitle","\uC81C\uC2DC\uD558\uB294 \uBB38\uC7A5\uC744 \uB4E4\uC5B4\uC8FC\uC138\uC694."),A=p??(typeof t=="number"&&typeof e=="number"?e>t:!1);return n.jsx(Jn,{index:e,stepIndex:t,isLast:a,title:g,onDone:i,titleProps:{usePreviewTextBtn:c,previewText:d,onPreviewTextBtn:m},children:n.jsx(ds,{soundSrc:l,ttsText:l?null:d??g,bucketPath:u,btnLabel:s||_("training.listenButton","\uBB38\uC7A5 \uB4E3\uAE30"),disabled:A,className:"training-step__listen-sticky",showSoundWaveForm:y,showNoiseWaveForm:x,leadInMs:C,tailMs:h},`audio-p${f??0}-s${e}`)})}const d_=[];function Cs({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:i,onDone:s,onChange:l,context:u=d_}){const{t:c}=xe.useTranslation(),d=i??c("training.orderListDefault","\uBB38\uC7A5\uC744 \uB4E4\uC740 \uC21C\uC11C\uB300\uB85C \uBC30\uCE58\uD558\uC138\uC694."),m=I=>typeof I=="string"?I:I&&(I.context||I.sentence||I.question||"")||"",[p,f]=o.useState(Array.isArray(u)?u:[]),[y,x]=o.useState(()=>(p||[]).map((I,S)=>({id:S,text:m(I)}))),C=o.useMemo(()=>typeof t!="number"||typeof e!="number"?"disabled":e<t?"done":e===t?"active":"disabled",[t,e]),h=C!=="disabled",_=o.useRef(void 0),g=o.useRef(void 0);o.useEffect(()=>{if(_.current===u)return;_.current=u;const I=Array.isArray(u)?u:[];f(I);const S=(j=>{const F=(j||[]).map((le,K)=>({id:K,text:m(le)}));if(F.length<=1)return F;const U=(le,K)=>{if(le.length!==K.length)return!1;for(let oe=0;oe<le.length;oe++)if(le[oe].text!==K[oe].text)return!1;return!0};let re=Na(F),ne=0;for(;U(re,F)&&ne<20;)re=Na(F),ne+=1;return re})(I);x(S);try{if(typeof l=="function"){const j=S.filter((F,U)=>F.text===m(I[U])).length;l({shuffled:S,score:j,total:(I||[]).length,initial:!0,__ts:Date.now()})}if(typeof s=="function"&&C==="active"){const j=S.filter((F,U)=>F.text===m(I[U])).length;g.current=u,s({shuffled:S,score:j,total:(I||[]).length,initial:!0,__ts:Date.now()})}}catch{}},[u]),o.useEffect(()=>{if(C!=="active"||g.current===u||(g.current=u,typeof s!="function"))return;const I=Array.isArray(u)?u:[],S=y.filter((j,F)=>j.text===m(I[F])).length;s({shuffled:y,score:S,total:I.length,initial:!0,__ts:Date.now()})},[C,u]);const A=(I,S)=>{const j=[...y],F=I+S;if(F<0||F>=j.length)return;const U=j[F];j[F]=j[I],j[I]=U,Z(j);try{if(typeof s=="function"&&C==="active"){const re=j.filter((ne,le)=>ne.text===m(p[le])).length;s({shuffled:j,score:re,total:(p||[]).length,__ts:Date.now()})}}catch{}},[b,k]=o.useState(null),v=o.useRef(null),w=o.useRef(null),B=o.useRef(null),E=o.useRef(null),D=o.useRef(null),N=o.useRef({x:0,y:0}),O=o.useRef(null),P=o.useRef({dx:0,dy:0}),G=()=>{if(O.current!==null)return;const I=()=>{if(!v.current){O.current=null;return}O.current=requestAnimationFrame(I);const S=N.current,j=P.current||{dx:0,dy:0};v.current&&(v.current.style.transform=`translate3d(${S.x-j.dx}px, ${S.y-j.dy}px, 0)`)};O.current=requestAnimationFrame(I)},L=o.useRef(new Map),M=o.useRef(new Map),$=()=>{const I=new Map;return L.current.forEach((S,j)=>{S&&S.getBoundingClientRect&&I.set(j,S.getBoundingClientRect())}),I},Z=I=>{const S=$();x(I);try{if(typeof l=="function"){const j=I.filter((F,U)=>F.text===m(p[U])).length;l({shuffled:I,score:j,total:(p||[]).length,__ts:Date.now()})}}catch{}requestAnimationFrame(()=>{const j=$();I.forEach(F=>{const U=S.get(F.id),re=j.get(F.id),ne=L.current.get(F.id);if(!ne||!U||!re)return;const le=U.top-re.top;le&&(ne.style.transition="none",ne.style.transform=`translateY(${le}px)`,requestAnimationFrame(()=>{ne.style.transition="transform 420ms cubic-bezier(.22,.9,.39,1)",ne.style.transform="";const K=()=>{ne.style.transition="",ne.removeEventListener("transitionend",K)};ne.addEventListener("transitionend",K)}))})})},q=(I,S)=>{try{try{S.dataTransfer?.setData("text/plain",String(I))}catch{}try{S.dataTransfer&&(S.dataTransfer.effectAllowed="move")}catch{}try{const j=document.createElement("div");j.style.cssText="position:absolute;top:-9999px;left:-9999px;width:1px;height:1px;opacity:0;pointer-events:none;",document.body.appendChild(j),S.dataTransfer?.setDragImage(j,0,0),requestAnimationFrame(()=>{try{document.body.removeChild(j)}catch{}})}catch{}}catch{}k(I);try{const j=y[I],F=document.createElement("div");F.className="order-list__dragging-object order-list__dragging-object--visible",F.textContent=j&&j.text?j.text:"",document.body.appendChild(F),v.current=F;const U=L.current.get(j.id);let re=S.clientX||0,ne=S.clientY||0;try{if(U&&U.getBoundingClientRect){const Q=U.getBoundingClientRect();re=Q.left+Q.width/2,ne=Q.top+Q.height/2}}catch{}const le=F.getBoundingClientRect(),K=le.width/2,oe=le.height/2;P.current={dx:K,dy:oe},F.style.transition="none",N.current={x:re,y:ne},F.style.transform=`translate3d(${re-K}px, ${ne-oe}px, 0)`,requestAnimationFrame(()=>{try{F.style.transition=""}catch{}G()});const Ae=Q=>{const me=Q;N.current={x:me.clientX,y:me.clientY},G()};B.current=Ae,document.addEventListener("mousemove",Ae);const Y=Q=>{const me=Q;N.current={x:me.clientX,y:me.clientY},G()};w.current=Y,document.addEventListener("dragover",Y);try{S.dataTransfer?.setData("text/plain",String(I));try{S.dataTransfer?.setData("application/json",JSON.stringify({idx:I}))}catch{}}catch{}}catch{}},z=(I,S)=>{S.preventDefault();try{S.dataTransfer&&(S.dataTransfer.dropEffect="move")}catch{}try{D.current!==null&&(clearTimeout(D.current),D.current=null);const j=S.currentTarget&&S.currentTarget.closest?S.currentTarget.closest(".order-list__item"):null;if(j&&E.current!==j){if(E.current)try{E.current.classList.remove("drag-over")}catch{}try{j.classList.add("drag-over")}catch{}E.current=j}}catch{}},V=(I,S)=>{S.preventDefault();const j=S.dataTransfer?.getData("text/plain")||"",F=j?parseInt(j,10):b,U=I;if(typeof F!="number"||isNaN(F)||F===U){k(null),W(),R();return}const re=hC(y,F,U);Z(re),k(null),R();try{if(typeof s=="function"&&C==="active"){const ne=re.filter((le,K)=>le.text===m(p[K])).length;s({shuffled:re,score:ne,total:(p||[]).length,__ts:Date.now()})}}catch{}try{requestAnimationFrame(()=>{const ne=document.querySelectorAll(".order-list .order-list__item")[U];if(!ne)return;const le=ne.querySelector(".order-list__slot")||ne;try{le.classList.add("pulse"),le.offsetHeight,le.classList.add("to-dark");const K=()=>{le.classList.remove("pulse","to-dark"),le.removeEventListener("transitionend",K)};le.addEventListener("transitionend",K)}catch{}})}catch{}W()},R=()=>{if(v.current){try{document.body.removeChild(v.current)}catch{}v.current=null}w.current&&(document.removeEventListener("dragover",w.current),w.current=null),B.current&&(document.removeEventListener("mousemove",B.current),B.current=null),O.current!==null&&(cancelAnimationFrame(O.current),O.current=null)},H=()=>{k(null),W(),R()};o.useEffect(()=>()=>R(),[]);const W=()=>{try{if(D.current!==null&&(clearTimeout(D.current),D.current=null),E.current){try{E.current.classList.remove("drag-over")}catch{}E.current=null}document.querySelectorAll(".order-list .order-list__item").forEach(I=>I.classList.remove("drag-over"))}catch{}};return o.useEffect(()=>{try{const I=Math.max(1,(y||[]).length);y.forEach((S,j)=>{const F=M.current.get(S.id);if(!F)return;let U=50;I>1&&(U=Math.round(j/(I-1)*100));try{F.style.setProperty("--marker-pos",U+"%")}catch{}})}catch{}},[y]),o.useEffect(()=>()=>{R(),D.current!==null&&(clearTimeout(D.current),D.current=null)},[]),n.jsx(Jn,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:d,children:n.jsx("div",{className:"order-list",children:y.map((I,S)=>{const j=Math.max(1,(y||[]).length),F=j>1?Math.round(S/(j-1)*100):50;return n.jsx("div",{className:"order-list__item",children:n.jsxs("div",{className:"order-list__slot","data-disabled":C==="disabled","aria-disabled":C==="disabled",children:[C!=="disabled"?n.jsx("div",{className:"order-list__marker caption-1",style:{"--marker-pos":F+"%"},ref:U=>{const re=M.current;U?re.set(I.id,U):re.delete(I.id)},children:n.jsx("span",{className:"order-list__slot-number button-1",children:S+1})}):null,n.jsxs("div",{ref:U=>{const re=L.current;U?re.set(I.id,U):re.delete(I.id)},className:`order-list__draggable ${b===S?"dragging":""}`,"data-disabled":C==="disabled","aria-disabled":C==="disabled",tabIndex:C==="disabled"?-1:0,draggable:h,onDragStart:h?U=>q(S,U):void 0,onDragEnter:h?U=>z(S,U):void 0,onDragOver:h?U=>z(S,U):void 0,onDragLeave:h?()=>{try{D.current!==null&&clearTimeout(D.current),D.current=setTimeout(()=>{try{const U=document.querySelectorAll(".order-list .order-list__item");U&&U[S]&&(U[S].classList.remove("drag-over"),E.current===U[S]&&(E.current=null))}catch{}},80)}catch{}}:void 0,onDrop:h?U=>V(S,U):void 0,onDragEnd:h?H:void 0,children:[n.jsx("span",{className:"order-list__item-text body-2",children:I.text}),h?n.jsxs("span",{className:"order-list__item-buttons",children:[n.jsx(pe,{htmlType:"button",size:32,type:"dot",onClick:()=>A(S,-1),ariaLabel:c("training.up"),icon:"chevron-up",variant:"transparent-gray",width:48,useFaded:"true",disabled:S===0,useBorder:!1,useDisabledInvisible:!0}),n.jsx(pe,{htmlType:"button",size:32,type:"dot",onClick:()=>A(S,1),ariaLabel:c("training.down"),icon:"chevron-down",variant:"transparent-gray",width:48,useFaded:"true",disabled:S===y.length-1,useBorder:!1,useDisabledInvisible:!0})]}):null]})]})},I.id)})})})}const p_=8e3;function m_(e,t){return new Promise(a=>{let r=!1;const i=()=>{r||(r=!0,a())};e.then(i,i),setTimeout(i,t)})}function Tc({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:i,onDone:s,onChange:l,context:u=[],selectable:c=!1,hideLabel:d=!1,hideAudio:m=!1,maxCards:p,playAllGapMs:f=0}){const{t:y}=xe.useTranslation(),x=i??y("training.cardInstructions","\uB0B1\uB9D0 \uCE74\uB4DC\uB97C \uBCF4\uACE0 \uC18C\uB9AC\uB97C \uB4E3\uACE0 \uD655\uC778\uD558\uC138\uC694."),C=o.useMemo(()=>Array.isArray(u)?u:u&&u.items||[],[u]),h=p??3,_=(C||[]).slice(0,h);(C||[]).length>h&&console.warn(`TrainingStepCard: ${C.length} items passed but only ${h} shown`);const g=typeof e=="number"?e:-1,A=typeof t!="number"?"disabled":g<t?"done":g===t?"active":"disabled",[b,k]=o.useState(null),v=o.useRef([]),[w,B]=o.useState(!1),E=o.useRef(null),D=o.useRef(!0);o.useEffect(()=>(D.current=!0,()=>{D.current=!1}),[]);const N=o.useMemo(()=>C.map($=>$?.id??$?.word??"").join("|"),[C]);o.useEffect(()=>{k(null)},[N]);const O=o.useRef(void 0);o.useEffect(()=>{const $=O.current;typeof $=="number"&&typeof t=="number"&&typeof e=="number"&&$>=e&&t<e&&k(null),O.current=t},[t,e]);const P=o.useCallback(($,Z)=>{if(c)return;const q={item:$,index:Z,__ts:Date.now()};try{typeof l=="function"&&l(q)}catch{}if(A==="active"&&typeof s=="function")try{s(q)}catch{}},[c,l,A,s]),G=o.useRef(f);o.useEffect(()=>{G.current=Math.max(0,f||0)},[f]);const L=o.useCallback(async()=>{if(w||A==="disabled")return;B(!0);let $=!1;const Z=new Promise(q=>{E.current=()=>{$=!0,q()}});try{for(let q=0;q<_.length&&!(!D.current||$);q++){const z=v.current[q];if(!z)continue;await Promise.race([m_(z.play(),p_),Z]);const V=Math.max(0,G.current||0);V>0&&q<_.length-1&&!$&&D.current&&await Promise.race([new Promise(R=>{setTimeout(R,V)}),Z])}}finally{E.current=null,B(!1)}},[w,A,_.length]),M=o.useCallback(($,Z)=>{if(!Qn(A))return;k(Z);const q={selectedValue:$.word||$.title||"",selectedIndex:Z,item:$,__ts:Date.now()};try{typeof l=="function"&&l(q)}catch{}if(typeof s=="function")try{s(q)}catch{}},[l,A,s]);return n.jsx(Jn,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:x,onDone:s,titleProps:{usePlayAllBtn:!m&&_.length>0,onPlayAll:L,playAllActive:w},children:n.jsx("div",{className:"training-step__cards",onClickCapture:$=>{const Z=E.current;if(!Z)return;const q=$.target;q&&typeof q.closest=="function"&&q.closest(".training-word-card__bottom")&&Z()},children:_.length===0?n.jsx("div",{className:"training-step__empty",children:y("training.noCards","\uCE74\uB4DC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")}):_.map(($,Z)=>n.jsx(Go,{ref:q=>{v.current[Z]=q},item:$,disabled:A==="disabled",onPlayDone:()=>P($,Z),selectable:c,selected:c&&b===Z,onSelect:c?()=>M($,Z):void 0,flipDelay:Z*120,hideLabel:d,hideAudio:m},$&&$.id||Z))})})}const h_=160,jc=()=>{};function Sn(e){const t=o.useId();if(!("variant"in e)){const{label:g,sub:A,onClick:b,children:k,align:v="horizontal",icon:w,useFullWidth:B=!1}=e,E=D=>{b&&D.target===D.currentTarget&&(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),b())};return n.jsxs("div",{className:_e("panel-row",v==="vertical"?"panel-row--vertical":"",B?"panel-row--label-fixed panel-row--fill":"",b?"panel-row--clickable":""),onClick:b,onKeyDown:b?E:void 0,role:b?"button":void 0,tabIndex:b?0:void 0,children:[w!=null&&n.jsx("div",{className:"panel-row__icon",children:w}),g!=null&&n.jsxs("div",{className:"panel-row__left",children:[n.jsx("div",{className:"panel-row__label body-3",children:g}),A&&n.jsx("div",{className:"panel-row__sub caption-1",children:A})]}),n.jsx("div",{className:"panel-row__right",children:k})]})}if(e.variant==="description")return n.jsx("div",{className:"panel-row panel-row--block",children:n.jsx("p",{className:"panel-row__description body-3",children:e.children})});if(e.variant==="empty")return n.jsx("div",{className:"panel-row panel-row--empty body-3",children:e.children});if(e.variant==="loading")return n.jsx("div",{className:"panel-row panel-row--loading",children:n.jsx(za,{size:28})});if(e.variant==="custom"&&!e.label)return n.jsx("div",{className:"panel-row panel-row--block",children:e.children});const{variant:a,label:r,sub:i,onClick:s,required:l,error:u,align:c="horizontal",useFullWidth:d=!1,icon:m}=e,p=a==="button"?void 0:s;let f=null;const y=a==="toggle"?`panel-toggle-${t}`:void 0,x=u?`panel-error-${t}`:void 0,C=`panel-helper-${t}`;if(a==="toggle"){const g=e;f=n.jsx(hu,{checked:g.checked,onChange:g.onChange,id:y})}else if(a==="segmented"){const g=e;f=n.jsx(gn,{options:g.options,value:g.value,onChange:g.onChange,size:g.size??40,ariaLabel:r})}else if(a==="dropdown"){const g=e,A=g.dropdowns?.length?n.jsx("div",{className:`panel-row__dropdown-group${d?" panel-row__dropdown-group--full":""}`,children:g.dropdowns.map((b,k)=>n.jsx("div",{className:d?"panel-row__dropdown-item--full":void 0,children:n.jsx(pn,{options:b.options,value:b.value,onChange:b.onChange,placeholder:b.placeholder,block:d,error:!!u,ariaDescribedBy:x,ariaLabel:b.ariaLabel??([r,b.placeholder].filter(Boolean).join(" ")||void 0)})},k))}):n.jsx(pn,{options:g.options??[],value:g.value??"",onChange:g.onChange??jc,block:d,error:!!u,ariaLabel:r,ariaDescribedBy:x});f=u?n.jsxs("div",{className:`panel-row__dropdown-error-wrap${d?" panel-row__dropdown-error-wrap--full":""}`,children:[A,n.jsx("span",{id:x,className:"caption-1 panel-row__error",role:"alert",children:u})]}):A}else if(a==="button"){const g=e;g.buttons?.length?f=n.jsx("div",{className:"panel-row__button-group",children:g.buttons.map((A,b)=>n.jsx(pe,{htmlType:"button",size:A.btnSize??40,variant:A.btnVariant??"default",disabled:A.disabled,onClick:A.onClick,children:A.label},b))}):f=n.jsx(pe,{htmlType:"button",size:g.btnSize??40,variant:g.btnVariant??"default",disabled:g.disabled,onClick:g.onClick,children:g.buttonLabel})}else if(a==="text"){const g=e;f=n.jsx("span",{className:`panel-row__text body-2${d?" panel-row__text--full":""}`,style:g.valueColor?{color:g.valueColor}:void 0,children:g.value})}else if(a==="input"){const g=e;f=n.jsxs("div",{className:`panel-row__input-wrap${d?" panel-row__input-wrap--full":""}`,children:[n.jsx(Xn,{value:g.value,onChange:g.onChange??jc,onKeyDown:g.onKeyDown,onEnter:g.onEnter,placeholder:g.placeholder,ghostText:g.ghostText,ghostHint:g.ghostHint,inputMode:g.inputMode,readOnly:g.readOnly,disabled:g.disabled,type:g.type,autoComplete:g.autoComplete,maxLength:g.maxLength,showCount:g.showCount,multiline:g.multiline,rows:g.rows,fullWidth:d,error:u,ariaLabel:r,required:l,ariaDescribedBy:g.helperText?C:void 0}),g.helperText&&n.jsx("div",{id:C,className:"panel-row__helper caption-1",children:g.helperText})]})}else a==="custom"&&(f=e.children);u&&a!=="input"&&a!=="dropdown"&&(f=n.jsxs("div",{className:`panel-row__dropdown-error-wrap${d?" panel-row__dropdown-error-wrap--full":""}`,children:[f,n.jsx("span",{id:x,className:"caption-1 panel-row__error",role:"alert",children:u})]}));const h=a==="input"||a==="dropdown"||(a==="text"||a==="custom")&&d,_=g=>{p&&g.target===g.currentTarget&&(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),p())};return n.jsxs("div",{className:_e("panel-row",c==="vertical"?"panel-row--vertical":"",h?"panel-row--label-fixed":"",a==="text"?"panel-row--text":"",p?"panel-row--clickable":""),onClick:p,onKeyDown:p?_:void 0,role:p?"button":void 0,tabIndex:p?0:void 0,children:[m!=null&&n.jsx("div",{className:"panel-row__icon",children:m}),n.jsxs("div",{className:"panel-row__left",children:[y?n.jsxs("label",{htmlFor:y,className:"panel-row__label body-3",children:[r,l&&n.jsx("span",{className:"required-mark",children:"*"})]}):n.jsxs("div",{className:"panel-row__label body-3",children:[r,l&&n.jsx("span",{className:"required-mark",children:"*"})]}),i&&n.jsx("div",{className:"panel-row__sub caption-1",children:i})]}),n.jsx("div",{className:"panel-row__right",children:f})]})}function Mc(e){const t=e.productName||e.brand,a=[e.brand,e.fitType].filter(r=>!!r&&r!==t);return[...new Set(a)].join(" \xB7 ")}function f_({devices:e,onRelease:t,emptyLabel:a}){const{t:r,i18n:i}=xe.useTranslation();return n.jsx("div",{className:"panel-row panel-row--device",children:["left","right"].map(s=>{const l=e[s],u=s==="left"?r("device.direction.left","\uC88C"):r("device.direction.right","\uC6B0");return n.jsxs("div",{className:"panel-row__device-column",children:[n.jsxs("div",{className:"panel-row__device-head",children:[n.jsx("span",{className:"panel-row__device-side body-2b",children:u}),l&&t&&n.jsx(pe,{htmlType:"button",size:32,type:"dot",icon:"x",ariaLabel:`${u} ${r("customers.device.unwear","\uCC29\uC6A9 \uD574\uC81C")}`,showTooltipInfo:r("customers.device.unwear","\uCC29\uC6A9 \uD574\uC81C"),onClick:()=>t(s)})]}),l?n.jsxs("div",{className:"panel-row__device-info",children:[n.jsxs("span",{className:"panel-row__device-kind",children:[l.device&&n.jsx(At,{size:"small",variant:Mu(l.device),fill:"soft",label:Lu(l.device,r)}),Mc(l)&&n.jsx("span",{className:"panel-row__device-detail body-3",children:Mc(l)})]}),n.jsx("span",{className:"panel-row__device-name body-2b",children:l.productName||l.brand}),Vo(l.wornYear,l.wornMonth,l.wornDay,i.language)&&n.jsx("span",{className:"panel-row__device-date caption-1",children:r("customers.device.wornSince",{date:Vo(l.wornYear,l.wornMonth,l.wornDay,i.language)})})]}):n.jsx("span",{className:"panel-row__device-empty body-3",children:a??r("customers.device.notRegistered","\uBBF8\uB4F1\uB85D")})]},s)})})}function Br({title:e,titleLevel:t=2,icon:a,disc:r,actions:i,size:s="medium",minHeight:l,maxWidth:u,className:c,scrollable:d,scrollbarGutter:m="auto",compactRows:p=!1,useBorder:f=!0,useBg:y=!0,useRowBorder:x=!0,labelWidth:C,form:h=!1,loading:_,empty:g,children:A}){const b=_e("panel",`panel--${s}`,h?"panel--form":"",l!==void 0?"panel--fill":"",f?"":"panel--no-border",y?"":"panel--no-bg",x?"":"panel--no-row-border",p?"panel--compact-rows":"",c),k={};l!==void 0&&(k.minHeight=l),u!==void 0&&(k.maxWidth=typeof u=="number"?`${u}px`:u),C!==void 0&&(k["--panel-label-width"]=typeof C=="number"?`${C}px`:C);const v=t?`h${t}`:"div";return n.jsxs("div",{className:b,style:Object.keys(k).length?k:void 0,children:[(!!e||r!=null)&&n.jsxs("div",{className:_e("panel__header",r!=null?"panel__header--with-disc":""),children:[a&&n.jsx(at,{icon:a,label:typeof e=="string"?e:void 0,className:"panel__icon"}),n.jsxs("div",{className:"panel__title-group",children:[!!e&&n.jsx(v,{className:`panel__title ${r!=null?"body-3b":"h5b"}`,children:e}),r!=null&&n.jsx("p",{className:"panel__disc caption-1",children:r})]}),i&&n.jsx("div",{className:"panel__actions",children:i})]}),_?n.jsx(Sn,{variant:"loading"}):g!=null&&o.Children.toArray(A).length===0?n.jsx(Sn,{variant:"empty",children:g}):d?n.jsx("div",{className:_e("panel__body--scroll",m==="stable"&&"panel__body--gutter-stable"),children:A}):A]})}function C_({cols:e=2,layout:t="grid",gap:a=1,collapseAt:r,className:i,style:s,children:l}){const u=o.useRef(null),[c,d]=o.useState();o.useEffect(()=>{const p=u.current;if(r===void 0||!p||(d(p.clientWidth),typeof ResizeObserver>"u"))return;const f=new ResizeObserver(([y])=>d(y.contentRect.width));return f.observe(p),()=>f.disconnect()},[r]);const m=r!==void 0&&c!==void 0&&c<=r;return n.jsx("div",{ref:u,className:_e("panel-grid",t==="columns"&&"panel-grid--columns",i),style:{"--panel-grid-cols":m?1:e,"--panel-grid-gap":typeof a=="number"?`${a}px`:a,...s},children:l})}function g_(e){return[{label:e("training.noise.level.none","\uC5C6\uC74C"),value:0},{label:e("training.noise.level.weak","\uC57D\uD568"),value:1},{label:e("training.noise.level.medium","\uBCF4\uD1B5"),value:2},{label:e("training.noise.level.strong","\uAC15\uD568"),value:3},{label:e("training.noise.level.veryStrong","\uB9E4\uC6B0 \uAC15\uD568"),value:4}]}function Lc(e){return[{label:e("training.noise.type.default","\uAE30\uBCF8"),value:"defaultNoise",icon:"party-popper"},{label:e("training.noise.type.street","\uAE38\uAC70\uB9AC"),value:"street",icon:"car"},{label:e("training.noise.type.buzz","\uC640\uAE00\uC640\uAE00"),value:"buzz",icon:"message-square-more"},{label:e("training.noise.type.restaurant","\uC2DD\uB2F9"),value:"restaurant",icon:"coffee"}]}g_(Rt.t.bind(Rt)),Lc(Rt.t.bind(Rt));const kr="none",b_=.5,y_=1.5,v_=.25;function gs({title:e,valueLabel:t,value:a,min:r,max:i,step:s,tickStep:l,size:u,disabled:c,onChange:d}){return n.jsxs(Sn,{variant:"custom",label:e,useFullWidth:!0,children:[n.jsx(Nu,{value:a,onChange:d,min:r,max:i,step:s,size:u,showBgTick:!0,tickStep:l,ariaLabel:e,disabled:c,className:"noise-settings__slider-input"}),n.jsx("div",{className:_e("noise-settings__value","button-1",c?"noise-settings__value--disabled":""),children:t})]})}function $c({anchorRect:e,onClose:t,hideNoiseRows:a=!1}){const{t:r}=xe.useTranslation(),i=ln("(max-width: 767px)")?40:24,s=yr(),l=qa(s?.settings??Ga),u=s?.settings.type??"defaultNoise",c=s?.settings.enabled??!0,d=s?.playbackRate??1,m=s?.mainVolume??1,p=Math.round(m*100),f=o.useCallback(_=>{try{s?.setMainVolume(Math.max(0,Math.min(1,_/100)))}catch{}},[s]),y=o.useCallback(_=>{try{s?.setPlaybackRate(_)}catch{}},[s]),x=o.useCallback(_=>{const g=Math.min(Va,Math.max(0,Math.round(_*10)/10));try{s?.setSettings({noiseRatio:g})}catch{}},[s]),C=o.useCallback(_=>{try{_===kr?s?.setSettings({enabled:!1}):s?.setSettings({type:_,enabled:!0})}catch{}},[s]),h=[{key:kr,label:r("training.noise.type.none","\uC5C6\uC74C")},...Lc(r).map(_=>({key:_.value,label:_.label}))];return n.jsx(cn,{anchorRect:e,offset:12,onClose:t,ariaLabel:r("training.trainingSettingsTitle","\uD6C8\uB828 \uC124\uC815"),isMobilePopup:!1,closeOnOutsideClick:!1,header:n.jsxs("div",{className:"noise-settings__header",children:[n.jsx("span",{children:r("training.trainingSettingsTitle","\uD6C8\uB828 \uC124\uC815")}),n.jsx(pe,{htmlType:"button",size:40,type:"dot",icon:"x",variant:"transparent-gray",useBorder:!1,ariaLabel:r("common.close","\uB2EB\uAE30"),onClick:t})]}),children:n.jsxs(Br,{className:"noise-settings",useBorder:!1,labelWidth:72,children:[n.jsx(gs,{title:r("training.playVolumeTitle","\uC804\uCCB4 \uC18C\uB9AC"),valueLabel:`${p}%`,value:p,min:0,max:100,step:10,size:i,onChange:f}),n.jsx(gs,{title:r("training.playSpeedTitle","\uC7AC\uC0DD \uC18D\uB3C4"),valueLabel:`${d.toFixed(2)}x`,value:d,min:b_,max:y_,step:v_,size:i,onChange:y}),!a&&n.jsxs(n.Fragment,{children:[n.jsx(Sn,{variant:"custom",label:r("training.noiseTypeTitle","\uC18C\uC74C \uC885\uB958"),useFullWidth:!0,children:n.jsx(gn,{ariaLabel:r("training.noiseTypeTitle","\uC18C\uC74C \uC885\uB958"),size:40,shape:"rounded",options:h,value:c?u:kr,onChange:C})}),n.jsx(gs,{title:r("training.noiseRatioTitle","\uC18C\uC74C \uBE44\uC728"),valueLabel:r("training.noiseRatioValue","{{ratio}}\uBC30",{ratio:l.toFixed(1)}),value:l,min:0,max:Va,step:fc,size:i,disabled:!c,onChange:x})]}),a&&n.jsx("div",{className:"noise-settings__width-ghost","aria-hidden":"true",inert:!0,children:n.jsx(Sn,{variant:"custom",label:"\xA0",useFullWidth:!0,children:n.jsx(gn,{ariaLabel:"width-ghost",size:40,shape:"rounded",options:h,value:kr,onChange:()=>{}})})})]})})}function Rc({useNoiseSettingBtn:e=!1,onSettings:t,onNext:a,onResult:r,stepIndex:i=0,stepCount:s=0,pageIndex:l=0,pageCount:u=1,resultOpen:c=!1,hideNoiseRows:d=!1}){const{t:m}=xe.useTranslation(),[p,f]=o.useState(!1),[y,x]=o.useState(null),[C,h]=o.useState(!1),_=o.useRef(null),g=o.useRef(null),A=yr(),b=u>0,k=b&&l<u-1,v=!b||l>=u-1,w=i===Math.max(0,s);o.useEffect(()=>{e||(f(!1),x(null))},[e]);const B=o.useCallback(()=>{f(!1),x(null)},[]),E=o.useCallback(()=>{if(p){f(!1),x(null);return}const Z=_?.current?.getBoundingClientRect();Z&&x(Z),t?.(),f(!0)},[p,t]),D=o.useCallback(()=>{if(p){f(!1),x(null);return}const Z=g?.current?.getBoundingClientRect();Z&&x(Z),t?.(),f(!0)},[p,t]),N=ln("(max-width: 767px)"),O=o.useRef(null),[P,G]=o.useState(null),L=o.useCallback(()=>{h(Z=>{const q=!Z;return G(q?O.current?.getBoundingClientRect()??null:null),q})},[]),M=o.useCallback(()=>{h(!1),G(null)},[]);o.useEffect(()=>{c&&(h(!1),G(null))},[c]);const $=n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"pp-bottom__meter",children:[n.jsx("span",{className:"pp-bottom__meter-label caption-1",children:m("training.meter.sentence","\uC7AC\uC0DD")}),n.jsx(zo,{analyser:A?.mainAnalyser??null,orientation:"horizontal",length:112,label:"db",labelPos:"left",ariaLabel:m("training.meter.sentence","\uC7AC\uC0DD")})]}),n.jsxs("div",{className:"pp-bottom__meter",children:[n.jsx("span",{className:"pp-bottom__meter-label caption-1",children:m("training.meter.noise","\uC18C\uC74C")}),n.jsx(zo,{analyser:A?.noiseAnalyser??null,orientation:"horizontal",length:112,label:"db",labelPos:"left",ariaLabel:m("training.meter.noise","\uC18C\uC74C")})]})]});return Ec(e&&p,()=>typeof document<"u"?document.querySelector(".noise-settings__header")?.closest(".tooltip-content")??null:null,()=>[_.current,g.current].map(Z=>Z?.querySelector("button")??null).find(Z=>!!Z&&Z.getClientRects().length>0)??_.current?.querySelector("button")??null),n.jsxs("div",{className:"pp-bottom",children:[n.jsxs("div",{className:"pp-bottom__left",children:[e?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"pp-bottom__settings--desktop",children:n.jsx("div",{ref:_,className:"pp-bottom__tooltip-trigger","data-tooltip-ignore":!0,children:n.jsx(pe,{htmlType:"button",size:56,type:"bar",icon:"settings",onClick:E,className:p?"is-selected":void 0,"aria-expanded":p,"aria-haspopup":"dialog",ariaLabel:m("training.trainingSettingsTitle","\uD6C8\uB828 \uC124\uC815"),label:m("training.trainingSettingsTitle","\uD6C8\uB828 \uC124\uC815"),minWidth:140})})}),n.jsx("div",{className:"pp-bottom__settings--mobile",children:n.jsx("div",{ref:g,className:"pp-bottom__tooltip-trigger","data-tooltip-ignore":!0,children:n.jsx(pe,{htmlType:"button",size:56,type:"dot",shape:"pill",icon:"settings",onClick:D,className:p?"is-selected":void 0,"aria-expanded":p,"aria-haspopup":"dialog",ariaLabel:m("training.settings","\uC124\uC815")})})})]}):null,e&&n.jsx("div",{ref:O,className:"pp-bottom__meter-trigger","data-tooltip-ignore":!0,children:n.jsx(pe,{htmlType:"button",size:40,type:"dot",shape:"pill",icon:"audio-lines",onClick:L,selected:C,"aria-expanded":N?C:void 0,ariaLabel:m("training.meter.toggle","\uC624\uB514\uC624 \uBBF8\uD130 \uD45C\uC2DC")})}),e&&C&&!N&&n.jsx("div",{className:"pp-bottom__meters",children:$})]}),e&&C&&N&&P&&n.jsx(cn,{anchorRect:P,onClose:M,ariaLabel:m("training.meter.toggle","\uC624\uB514\uC624 \uBBF8\uD130 \uD45C\uC2DC"),children:n.jsx("div",{className:"pp-bottom__meters pp-bottom__meters--floating",children:$})}),n.jsxs("div",{className:"pp-bottom__right",children:[v&&n.jsx(pe,{htmlType:"button",size:56,type:"bar",icon:"check",onClick:typeof r=="function"?r:a,ariaLabel:m("training.viewResult","\uACB0\uACFC\uBCF4\uAE30"),label:m("training.viewResult","\uACB0\uACFC\uBCF4\uAE30"),variant:"main",disabled:!w}),k&&n.jsx(pe,{htmlType:"button",size:56,type:"bar",rightIcon:"chevron-right",align:"right",onClick:a,ariaLabel:m("training.nextQuestion","\uB2E4\uC74C \uBB38\uC81C"),label:m("training.nextQuestion","\uB2E4\uC74C \uBB38\uC81C"),variant:"main",disabled:!w})]}),e&&p&&n.jsx($c,{anchorRect:y,onClose:B,hideNoiseRows:d})]})}function Pc({title:e,subtitle:t,desc:a,depth:r,icon:i,wrapperStyle:s,iconTooltip:l,pageIndex:u,pageCount:c,progressMax:d,progressIndex:m,onBack:p,onClose:f}){const{t:y}=xe.useTranslation(),x=ln("(max-width: 767px)"),C=Number.isInteger(m)?m:u||0,h=Number.isInteger(d)?d:c||0,_=p||f,g=Array.isArray(r)?x?r[r.length-1]:r.join(" / "):r,A=typeof e=="string"?e.trim():e,b=typeof t=="string"?t.trim():t,k=!!(A||b),v=k?A||b:y("common.emptyTrainingName","\uD6C8\uB828 \uC774\uB984\uC774 \uBE44\uC5B4 \uC788\uC2B5\uB2C8\uB2E4."),w=g||(A?t:void 0),B=x&&typeof w=="string"&&(w.includes(" \xB7 ")||w.includes(" / "))?w.split(/\s[·/]\s/).pop():w,E=o.useMemo(()=>{const D=s&&typeof s=="object"?{...s}:{};return!("width"in D)&&!("height"in D)&&(D.width="40px",D.height="40px"),D},[s]);return n.jsxs("header",{className:"pp-title training-popup-title",children:[n.jsxs("div",{className:"pp-title__left",children:[_?n.jsx(pe,{htmlType:"button",size:48,type:"dot",icon:"chevron-left",ariaLabel:y("common.back","\uB4A4\uB85C"),onClick:_,useBorder:!1,iconSize:"large",iconColor:"--color-black",variant:"transparent-gray"}):null,n.jsx("div",{children:i?n.jsx(ou,{icon:i,label:e,tooltip:l,wrapperStyle:E}):null}),n.jsxs("div",{className:"pp-title__text",children:[B?n.jsx("span",{className:"pp-title__depth caption-1",children:B}):null,n.jsx("span",{className:`pp-title__title h2${k?"":" pp-title__title--empty"}`,children:v}),a?n.jsx("span",{className:"pp-title__description caption-1",children:a}):null]})]}),n.jsx(Tu,{max:Math.max(0,h??0),index:Math.max(0,C??0)})]})}function x_(){typeof window<"u"&&window.dispatchEvent(new CustomEvent("speechear.popup.close"))}function __(e){return!e&&e!==0?[]:Array.isArray(e)?e.flatMap(t=>typeof t=="string"?t.split("|").map(a=>a.trim()).filter(Boolean):t||t===0?[String(t)]:[]):typeof e=="string"?e.split("|").map(t=>t.trim()).filter(Boolean):[String(e)]}const Ic=(e,t)=>{if(!t)return t;const a=typeof Rt?.t=="function"?Rt.t(e,{defaultValue:t}):void 0;return typeof a=="string"&&a?a:t};function Fc(e,t,a){const r=e,i=r?.title||r?.name||(Array.isArray(t)?t[t.length-1]:void 0)||a||"\uD6C8\uB828",s=Ii().find(u=>u.key===(r?.category_0||r?.category_main_code)),l=s?.subs?.find(u=>u.key===(r?.category_1||r?.category_sub_code));return{title:i,label:r?.title||i,depth:t,icon:s?.icon,wrapperStyle:s?.color?{"--t-item-fg":s.color}:void 0,iconTooltip:[s?Ic(`topic.${s.key}`,s.label):void 0,l?Ic(`topic.sub.${l.key}`,l.label):void 0].filter(Boolean).join(" / ")||void 0}}function bs(e){return e&&typeof e=="object"&&typeof e.__ts=="number"?e.__ts:0}function Oc(e,t,a){if(!e||typeof e!="object"||Array.isArray(e))return e;const r=e,i=typeof a=="number"&&a>0?a:Date.now();return{...r,...r.shownAt===void 0&&t?{shownAt:t}:{},...r.answeredAt===void 0?{answeredAt:new Date(i).toISOString()}:{}}}function w_(e){const t=e;return Array.isArray(t?.items)?t.items:Array.isArray(e)?e:e?[e]:[]}function B_({idPrefix:e,trainingData:t,depth:a,fallbackTitle:r="\uD6C8\uB828",pages:i=[],emptyMessage:s,buildResults:l,metaPatch:u}){const c=Fc(t,a,r),d=typeof u=="function"?u(c)||{}:u||{},m=t?.id||t?.title||i.length;return{id:`${e}:${m}`,meta:{...c,...d},pages:i,emptyMessage:s,buildResults:l}}function k_(e){if(typeof e=="string")return e;if(e&&typeof e=="object"){const t=e;return t.context||t.sentence||t.question||""||""}return""}function A_(e){if(e&&typeof e=="object"){const t=e;if(Array.isArray(t.selectedValues))return t.selectedValues;if(t.selectedValue!==void 0)return t.selectedValue;if(t.selectedIndex!==void 0)return t.selectedIndex;if(t.value!==void 0)return t.value}return e}function N_(e,t=[]){if(Array.isArray(e))return e.join(", ");if(typeof e=="number"&&Array.isArray(t))return String(t[e]??"");if(typeof e=="string")return e}function zc(e,t){if(!(!e||typeof e!="object"))return e[`step-${t}`]}function E_(e,t,a,r){return zc(e,t*a+r)}function D_({payload:e,selected:t,choices:a=[],correctAnswers:r=[]}){if(e&&typeof e=="object"){const i=e;if(Array.isArray(i.selectedValues))return r.every(s=>i.selectedValues.includes(s))&&i.selectedValues.every(s=>r.includes(s));if(typeof i.correct=="boolean")return i.correct}if(r.length){if(typeof t=="number"&&Array.isArray(a)&&a.length)return r.some(i=>String(i)===String(a[t]));if(typeof t<"u")return r.some(i=>String(i)===String(t))}}function S_(e){return e?Array.isArray(e.items)?e.items.map(t=>{const a=t;return typeof t=="string"?{sentence:t}:{sentence:a.context||a.sentence||"",contextCode:a.contextCode||a.context_code}}):Array.isArray(e.sentences)?e.sentences.map(t=>{const a=t;return typeof t=="string"?{sentence:t}:{sentence:a.sentence||a.context||"",contextCode:a.contextCode}}):Array.isArray(e.contexts)?e.contexts:e.contextCode?[{contextCode:e.contextCode}]:[]:[]}const Wc=o.createContext(null);function T_(){const e=o.useContext(Wc);if(!e)throw new Error("useTrainingPagePopupContext must be used inside TrainingPagePopup");return e}function j_({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:i,choices:s=[],onDone:l,onChange:u}){const{t:c}=xe.useTranslation(),d=typeof e=="number"?e:-1,m=typeof t!="number"?"disabled":d<t?"done":d===t?"active":"disabled",[p,f]=o.useState(()=>s.map(()=>null)),y=JSON.stringify(s),x=s.length;o.useEffect(()=>{f(Array.from({length:x},()=>null))},[y]);const C=o.useRef(void 0);o.useEffect(()=>{const A=C.current;typeof A=="number"&&typeof t=="number"&&typeof e=="number"&&A>=e&&t<e&&f(Array.from({length:x},()=>null)),C.current=t},[t,e,x]);const h=o.useMemo(()=>p.filter(A=>A!==null).length+1,[p]),_=o.useCallback(A=>{if(!Qn(m))return;const b=p;let k;if(b[A]!=null){const w=b[A];k=b.map(B=>B!==null&&B>=w?null:B)}else k=[...b],k[A]=h;f(k);const v={selectedOrder:k,words:s,__ts:Date.now()};try{typeof u=="function"&&u(v)}catch{}if(b[A]==null&&k.length>0&&k.every(w=>w!==null))try{typeof l=="function"&&l(v)}catch{}},[m,p,h,u,l,s]),g=i??c("training.selectInOrder","\uB4E4\uC740 \uC21C\uC11C\uB300\uB85C \uCE74\uB4DC\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return n.jsx(Jn,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:g,onDone:l,children:n.jsx("div",{className:"training-step__cards",children:s.map((A,b)=>n.jsx(Go,{item:{word:A},disabled:m==="disabled",selectable:!0,selected:p[b]!==null,orderRank:p[b],onSelect:()=>_(b),flipDelay:b*120,hideLabel:!1,hideAudio:!0},`${A}-${b}`))})})}function Ar(e){return null}Ar.__isTrainingPage=!0;function ba(e,t){const a=T_();return{ctx:a,index:e,stepIndex:a.currentStepIndex,isLast:typeof e=="number"&&typeof t=="number"?e===t-1:!1,onDone:r=>a.handleStepDone(r,e),onChange:r=>a.handleStepChange(r,e)}}function Hc({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:i,isLast:s,onDone:l}=ba(e,t);return n.jsx(fs,{...a,index:r,stepIndex:i,isLast:s,onDone:l})}function Vc({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:i,isLast:s,onDone:l,onChange:u}=ba(e,t);return n.jsx(ms,{...a,index:r,stepIndex:i,isLast:s,onDone:l,onChange:u})}function qc({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:i,isLast:s,onDone:l,onChange:u}=ba(e,t);return n.jsx(hs,{...a,index:r,stepIndex:i,isLast:s,onDone:l,onChange:u})}function Uc({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:i,isLast:s,onDone:l,onChange:u}=ba(e,t);return n.jsx(Cs,{...a,index:r,stepIndex:i,isLast:s,onDone:l,onChange:u})}function Gc({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:i,isLast:s,onDone:l,onChange:u}=ba(e,t);return n.jsx(Tc,{...a,index:r,stepIndex:i,isLast:s,onDone:l,onChange:u})}function M_({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:i,isLast:s,onDone:l,onChange:u}=ba(e,t);return n.jsx(j_,{...a,index:r,stepIndex:i,isLast:s,onDone:l,onChange:u})}const Kc=3e4,L_=/^(https?:|blob:|data:audio|\/|\.\/)/;function Yc(e){return typeof e=="string"&&L_.test(e)?e:null}const $_=e=>typeof e=="string"&&e.trim()!==""?e:null,ys=Symbol("timed-out");function R_(e,t){if(t<=0)return Promise.resolve(ys);let a;return Promise.race([Promise.resolve(e),new Promise(r=>{a=setTimeout(()=>r(ys),t)})]).finally(()=>clearTimeout(a))}function P_(e){return e?Ba()||Yr()?!0:typeof window<"u"&&!!window.speechSynthesis:!1}function I_(e,t){const a=[],r=Yc(t);r&&a.push({kind:"raw",resolve:async()=>r});const i=(e??"").trim();if(!i)return a;for(const[s,l]of[["urlResolver",Ba()],["fallbackUrlResolver",Yr()]])l&&a.push({kind:s,resolve:async u=>{let c;try{c=await R_(l(i),u)}catch(m){return St(`question-sound-threw-${s}`,`[core] configureTTS \uC758 ${s} \uAC00 \uB358\uC84C\uB2E4 \u2014 \uADF8 \uCC28\uB840\uB294 \uAC74\uB108\uB6F4\uB2E4.`,m),null}return c===ys?(St(`question-sound-slow-${s}`,`[core] configureTTS \uC758 ${s} \uAC00 ${Kc}ms \uBC14\uD034 \uC548\uC5D0 \uC548 \uD480\uB838\uB2E4 \u2014 \uADF8 \uCC28\uB840\uB97C \uBC84\uB9AC\uACE0 \uB2E4\uC74C\uC73C\uB85C \uAC04\uB2E4. \uC11C\uBC84 \uD569\uC131\uC744 \uAE30\uB2E4\uB9AC\uB294 \uB9AC\uC878\uBC84\uB77C\uBA74 \uC774 \uC790\uB9AC\uAC00 \uAE38\uC5B4\uC9C4\uB2E4. \uC18C\uB9AC\uAC00 \uC544\uC608 \uC548 \uB098\uBA74 \uC5EC\uAE30\uBD80\uD130 \uBCF4\uB77C.`),null):$_(c)||(St(`question-sound-empty-${s}`,`[core] configureTTS \uC758 ${s} \uAC00 \uC8FC\uC18C\uB97C \uC548 \uC92C\uB2E4(\uBC1B\uC740 \uAC83: ${JSON.stringify(c)}) \u2014 \uADF8 \uCC28\uB840\uB294 \uAC74\uB108\uB6F4\uB2E4.`),null)}});return a}function F_(){return Date.now()+Kc}const O_=(e,t)=>Math.max(0,e-Date.now())/Math.max(1,t);function z_(e){St("question-sound-none",`[core] "${e}" \uC758 \uC18C\uB9AC \uC8FC\uC18C\uB97C \uD55C \uC790\uB9AC\uC5D0\uC11C\uB3C4 \uBABB \uC5BB\uC5C8\uB2E4 \u2014 \uBE0C\uB77C\uC6B0\uC800 \uB0AD\uB3C5\uC73C\uB85C \uAC04\uB2E4. configureTTS \uAC00 \uAC78\uB824 \uC788\uB294\uC9C0, \uB9AC\uC878\uBC84\uAC00 \uC8FC\uC18C\uB97C \uC8FC\uB294\uC9C0 \uC704 \uC904\uB4E4\uC744 \uBCF4\uB77C.`)}function Nr(...e){for(const t of e)if(typeof t=="string"){const a=t.trim();if(a.length)return a}else{if(typeof t=="number"||typeof t=="boolean")return String(t);if(Array.isArray(t)&&t.length)return t.join(", ");if(t&&typeof t=="object"){const a=t,r=[a.text,a.label,a.value];for(const i of r){if(typeof i=="string"&&i.trim().length)return i.trim();if(typeof i=="number"||typeof i=="boolean")return String(i)}}}return null}function W_(e){return Nr(e?.question,e?.q,e?.sentence,e?.text,e?.prompt,e?.wording)}function H_(e){return Yc(Nr(e?.questionSound,e?.soundSrc,e?.audioSrc,e?.sound,e?.audio,e?.src))}function Zc(e){if(!e)return;if(typeof e.decision=="boolean")return e.decision;if(typeof e.correct=="boolean")return e.correct;if(typeof e.heard=="boolean")return e.heard;if(typeof e.judgement=="boolean")return e.judgement;const t=Nr(e?.status,e?.result,e?.judge,e?.note);if(t){const a=t.toLowerCase();if(["ok","true","\uB9DE\uC74C","\uC815\uB2F5"].some(r=>a.includes(r)))return!0;if(["ng","false","\uD2C0\uB9BC","\uC624\uB2F5"].some(r=>a.includes(r)))return!1}}function Xc(e){const{score:t,contextsLength:a,results:r=[],subtitle:i,onReplay:s,onClose:l,inline:u=!1,pending:c=!1}=e||{},{t:d}=xe.useTranslation(),m=o.useId(),p=o.useCallback(()=>!c,[c]);o.useEffect(()=>{const D=a??0;if(t!=null&&D>0&&t/D>.5){const N=window.setTimeout(()=>{window.dispatchEvent(new CustomEvent("party:trigger",{detail:{count:140,strength:1.6,duration:2200}}))},0);return()=>window.clearTimeout(N)}},[t,a]);const f=o.useCallback(D=>{const N=Zc(D),O=Nr(D?.wording,D?.label);return N===!0?{variant:"main",label:O??d("training.result.heardWell","\uC798 \uB4E4\uC5C8\uC5B4\uC694")}:N===!1?{variant:"danger",label:O??d("training.result.notHeard","\uBABB \uB4E4\uC5C8\uC5B4\uC694")}:{variant:"disabled",label:O??d("training.result.notJudged","\uBBF8\uD310\uC815")}},[d]),y=a??0,x=t??0,C=o.useMemo(()=>Array.isArray(r)?r:[],[r]),h=o.useRef(null),[_,g]=o.useState(null),A=o.useCallback(()=>{h.current?.(),h.current=null,g(null)},[]);o.useEffect(()=>A,[A]);const b=o.useRef(0),k=(D,N)=>{if(!Ln)return;const O=Math.round(performance.now()-b.current);console.debug(`[core][\uB2E4\uC2DC\uB4E3\uAE30] +${O}ms ${D}`,N??"")},v=o.useRef(0),w=o.useCallback((D,N,O)=>{A();const P=++v.current,G=()=>v.current===P;b.current=Ln?performance.now():0,k(`\uB20C\uB800\uB2E4 \u2014 \uC904 ${D}`,{text:N,rawUrl:O}),g(D),h.current=()=>{k("\uBA48\uCD94\uAC1C\uAC00 \uBD88\uB838\uB2E4(\uC8FC\uC18C \uC5BB\uAE30 \uC804)"),v.current++,Gr()};const L=q=>{k("\uD2BC\uB2E4",q);const z=cr(q,V=>{k(`\uB05D\uB0AC\uB2E4 \u2014 ${V?"\uB05D\uAE4C\uC9C0 \uB4E4\uC5C8\uB2E4":"\uBABB \uD2C0\uC5C8\uAC70\uB098 \uBA48\uCDC4\uB2E4"}`,{mine:G()}),V&&G()&&(h.current=null,g(null))});return h.current=()=>{k("\uBA48\uCD94\uAC1C\uAC00 \uBD88\uB838\uB2E4(\uD2B8\uB294 \uC911)"),v.current++,z.stop(),Gr()},z.done},M=I_(N,O);k("\uCC28\uB840",M.map(q=>q.kind));const $=M[0]?.kind==="raw",Z=$?L(O):Promise.resolve(!1);(async()=>{if(await Z||!G())return;const q=F_(),z=$?M.slice(1):M;for(let V=0;V<z.length;V++){if(!G())return;k(`${z[V].kind} \uC5D0\uAC8C \uBB3B\uB294\uB2E4`);const R=await z[V].resolve(O_(q,z.length-V));if(k(`${z[V].kind} \uAC00 \uB2F5\uD588\uB2E4`,R),!G()||R&&(await L(R)||!G()))return}G()&&(k("\uC8FC\uC18C\uB97C \uD558\uB098\uB3C4 \uBABB \uC5BB\uC5C8\uB2E4 \u2014 \uB0AD\uB3C5\uC73C\uB85C \uAC04\uB2E4"),z_(N),h.current=()=>{v.current++,Gr()},k("\uB0AD\uB3C5\uD55C\uB2E4"),Df(N,{onEnd:()=>{G()&&(h.current=null,g(null))}}))})()},[A]),B=o.useMemo(()=>C.map(D=>{const N=D??{},O=W_(N)||d("training.result.noContent","(\uB0B4\uC6A9\uC5C6\uC74C)"),{variant:P,label:G}=f(N),L=Array.isArray(N.corrects)?N.corrects:[],M=L.length?L.join(", "):N.answer!=null&&N.answer!==""?String(N.answer):null,$=typeof N.selectedText=="string"?N.selectedText:null,Z=Zc(N)===!0,q=H_(N),z=!!q||P_(O);return{problem:O,variant:P,label:G,answer:M,selectedText:$,isCorrect:Z,sound:q,canHear:z}}),[C,f,d]),E=o.useMemo(()=>B.some(D=>D.answer!==null||D.selectedText!==null),[B]);return n.jsx(Fn,{onClose:l,closeOnBackdrop:!1,inline:u,ariaLabel:d("training.result.title","\uD6C8\uB828\uC744 \uBAA8\uB450 \uB9C8\uCCE4\uC2B5\uB2C8\uB2E4."),className:"popup--training-result",beforeClose:p,footerClassName:"trp-result__foot",footer:({animateThen:D,closeWithAnimation:N})=>n.jsxs(n.Fragment,{children:[c&&n.jsx("p",{id:m,className:"trp-actions__reason caption-1",role:"status",children:d("training.result.pendingDone","\uACB0\uACFC\uB97C \uACC4\uC0B0\uD558\uB294 \uC911\uC774\uB77C \uC544\uC9C1 \uC644\uB8CC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.")}),n.jsxs("div",{className:"trp-actions",children:[n.jsx(pe,{htmlType:"button",size:56,type:"bar",label:d("training.result.replay","\uB2E4\uC2DC\uD558\uAE30"),onClick:()=>D(s)}),n.jsx(pe,{htmlType:"button",size:56,type:"bar",label:d("training.result.done","\uC644\uB8CC"),variant:"main",onClick:N,disabled:c,onDisabledClick:c?()=>{}:void 0,"aria-describedby":c?m:void 0})]})]}),children:()=>n.jsxs("div",{className:"trp-result is-on",children:[n.jsxs("header",{className:"trp-result__head",children:[n.jsx("p",{className:"trp-result__eyebrow caption-1",children:d("training.result.eyebrow","\uD6C8\uB828 \uC644\uB8CC")}),n.jsx("h1",{className:"trp-result__title h2",children:d("training.result.title","\uD6C8\uB828\uC744 \uBAA8\uB450 \uB9C8\uCCE4\uC2B5\uB2C8\uB2E4.")}),i&&n.jsx("p",{className:"trp-result__subtitle body-3",children:i}),n.jsx("div",{className:"trp-score",children:n.jsxs("div",{className:"trp-score__figure","aria-label":d("training.result.scoreAria",{correct:x,total:y}),children:[n.jsx("span",{className:"trp-score__big",children:x}),n.jsx("span",{className:"trp-score__sep",children:"/"}),n.jsx("span",{className:"trp-score__total",children:y})]})})]}),B.length>0&&n.jsx("section",{className:"trp-result__body",children:n.jsxs("div",{className:`result-table${E?" result-table--answer":""}`,role:"table","aria-label":d("training.result.tableAriaLabel","\uBB38\uD56D\uBCC4 \uD310\uC815"),children:[n.jsxs("div",{className:"result-table__head caption-1",role:"row",children:[n.jsx("span",{role:"columnheader",children:d("common.col.problem","\uBB38\uC81C")}),E&&n.jsx("span",{role:"columnheader",children:d("training.result.colAnswerSelected","\uC815\uB2F5 \xB7 \uC120\uD0DD")}),n.jsx("span",{className:"col-right",role:"columnheader",children:d("training.result.colJudge","\uD310\uC815")})]}),B.map((D,N)=>n.jsxs("div",{className:"result-table__row",role:"row",children:[n.jsxs("div",{className:"trp-row__problem",children:[n.jsx("span",{className:"trp-row__no caption-1",children:String(N+1).padStart(2,"0")}),n.jsx("div",{className:"trp-row__q body-2",children:D.problem}),D.canHear&&n.jsx(pe,{htmlType:"button",size:32,type:"dot",useBorder:!1,icon:_===N?"square":"volume-2",className:"trp-row__replay",ariaLabel:_===N?d("training.result.replaySoundStop",{no:N+1,defaultValue:"{{no}}\uBC88 \uB4E3\uAE30 \uBA48\uCDA4"}):d("training.result.replaySound",{no:N+1,defaultValue:"{{no}}\uBC88 \uB2E4\uC2DC \uB4E3\uAE30"}),onClick:()=>_===N?A():w(N,D.problem,D.sound)})]}),E&&n.jsxs("div",{className:"trp-row__answers",children:[D.answer!==null&&n.jsxs("div",{className:"trp-row__answer-line",children:[n.jsx("span",{className:"trp-row__answer-label answer-correct caption-1",children:d("training.result.colAnswer","\uC815\uB2F5")}),n.jsx("span",{className:"trp-row__answer-value body-2",children:D.answer})]}),n.jsxs("div",{className:"trp-row__answer-line",children:[n.jsx("span",{className:`trp-row__answer-label answer-selected caption-1 ${D.isCorrect?"is-correct":"is-wrong"}`,children:d("training.result.colSelected","\uC120\uD0DD")}),n.jsx("span",{className:`trp-row__answer-value body-2 ${D.isCorrect?"is-correct":"is-wrong"}`,children:D.selectedText??"\u2014"})]})]}),n.jsx("div",{className:"trp-row__judge",children:n.jsx(At,{variant:D.variant,label:D.label,fill:"soft",minWidth:80})})]},N))]})})]})})}const vs=new Set;function V_(e){o.useEffect(()=>{if(!e||vs.has(e))return;vs.add(e);const t=()=>typeof document>"u"||document.visibilityState!=="hidden";let a=null,r=null,i=0,s=0;const l=()=>{const m=Date.now();a==null&&(a=m),r==null&&(r=m)},u=()=>{r!=null&&(i+=Date.now()-r,r=null)};t()&&l();const c=()=>{if(u(),a==null||i-s<1e3||s===0&&i<5e3)return;const m=a+s;s=i,gC({trainingType:e,startedAt:new Date(m).toISOString(),endedAt:new Date(a+i).toISOString()})},d=()=>{t()?l():c()};return typeof document<"u"&&document.addEventListener("visibilitychange",d),typeof window<"u"&&window.addEventListener("pagehide",c),()=>{typeof document<"u"&&document.removeEventListener("visibilitychange",d),typeof window<"u"&&window.removeEventListener("pagehide",c),c(),vs.delete(e)}},[e])}function Er(e,t){return e&&e.id||`page-${t??0}`}function Dr(e,t){return e&&e.key||`step-${t??0}`}function Sr(){return{pageIndex:0,stepIndex:0,answersByPage:{}}}function q_(e,t){return typeof e?.props=="function"?e.props(t)||{}:e?.props||{}}const U_=300,G_=()=>{try{return typeof window<"u"&&!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches}catch{return!1}},Tn=Object.freeze({}),Jc=new Set(["LISTEN_IN_NOISE","SHORT_STORY","LONG_STORY","ORDERING_SENTENCE"]);function xs(e){const t=e,a=t?.results||t?.answers||[],r=Array.isArray(a)&&a.length>0?a.length:null,i=Array.isArray(a)?a.filter(s=>s?.correct===!0||s?.isCorrect===!0||s?.score===1||s?.heard===!0||s?.judgement===!0).length:null;return{results:a,correct:r!=null?i:null,total:r}}const K_=e=>n.jsx(Xc,{score:e.score,contextsLength:e.contextsLength,results:e.results,onReplay:e.onReplay,onClose:e.onClose,pending:e.pending});function Y_(e){const{scenario:t,title:a,subTitle:r,depth:i,icon:s,wrapperStyle:l,iconTooltip:u,pageIndex:c,pageCount:d,stepIndex:m,stepCount:p,onBack:f,onComplete:y,onRoundFinished:x,onNext:C,onSettings:h,useNoiseSetting:_=!0,children:g,ariaLabel:A,label:b,buildResults:k,onResult:v,typeKey:w,entryPoint:B,dailyTotal:E,itemRef:D,renderResultPopup:N,noiseOverride:O,hideNoiseRows:P=!1}=e;V_(w&&!Jc.has(w)?w:"");const G=o.useRef(0);o.useEffect(()=>{G.current=Date.now()},[]);const{t:L}=xe.useTranslation(),M=v,$=!!t,Z=t?.id||null,q=t?.meta||{},z=Array.isArray(t?.pages)?t.pages:[],V=Array.isArray(g)||o.isValidElement(g)&&typeof g!="function"?o.Children.toArray(g).filter(o.isValidElement):[],R=V.length>0,H=ie=>ie===Ar||ie?.__isTrainingPage===!0,W=R&&V.some(ie=>H(ie.type)),I=W?V.filter(ie=>H(ie.type)).map((ie,ve)=>{const Me=ie.props||{};return{id:`children-page-${ve}`,steps:o.Children.toArray(Me.children).filter(o.isValidElement),pageTop:Me.pageTop||Me.top||null,pageBottom:Me.pageBottom||Me.bottom||null}}):[{id:"children-page-0",steps:V}],S=R&&!$&&typeof g!="function",j=S?Math.max(1,I.length):0;o.useEffect(()=>{if(!(typeof document>"u"||!document.body)&&!document.body.classList.contains("ihabdevteam-core-scope"))return document.body.classList.add("ihabdevteam-core-scope"),()=>{document.body.classList.remove("ihabdevteam-core-scope")}},[]),o.useEffect(()=>{if(typeof document>"u"||!document.body)return;const ie=document.body;return ie.dataset.ihabTrainingPopupCount=String(Number(ie.dataset.ihabTrainingPopupCount||"0")+1),ie.classList.add("ihab-training-popup-open"),()=>{const ve=Number(ie.dataset.ihabTrainingPopupCount||"1")-1;ve>0?ie.dataset.ihabTrainingPopupCount=String(ve):(delete ie.dataset.ihabTrainingPopupCount,ie.classList.remove("ihab-training-popup-open"))}},[]),o.useEffect(()=>{if(!(typeof document>"u"||!document.body))return vv()},[]);const[F,U]=o.useState({...Ga,enabled:!1}),re=o.useRef(F);o.useEffect(()=>{re.current=F},[F]);const ne=o.useRef(O),le=o.useRef(!1),K=o.useRef(null);o.useEffect(()=>{let ie=!1;const ve=Me=>{if(ie)return;le.current=!0;const Je=Me?Ua({...Ga,enabled:!1},Me):{...Ga},Oe=K.current;K.current=null;const Ye=Oe?Ua(Je,Oe):Je;re.current=Ye,U(Ye),Oe&&!ne.current&&ji(Ye),er(Ye);const J=ne.current;if(J){const de=typeof J=="function"?J(Ye):J,ae=Ua(Ye,de);re.current=ae,U(ae),er(ae)}};return xC().then(ve),()=>{ie=!0}},[]);const[oe,Ae]=o.useState(null),[Y,Q]=o.useState(null),me=o.useCallback((ie,ve)=>{ie==="main"?Ae(ve):Q(ve)},[]),De=o.useRef(null),be=o.useRef(null),te=o.useCallback(()=>{be.current!==null&&(clearTimeout(be.current),be.current=null);const ie=De.current;De.current=null,ie&&ji(ie)},[]);o.useEffect(()=>{if(typeof window>"u")return;const ie=()=>{document.visibilityState==="hidden"&&te()};return window.addEventListener("pagehide",te),document.addEventListener("visibilitychange",ie),()=>{window.removeEventListener("pagehide",te),document.removeEventListener("visibilitychange",ie),te()}},[te]);const ue=o.useCallback(ie=>{const ve=Ua(re.current,ie);if(re.current=ve,U(ve),!le.current){K.current={...K.current??{},...ie},er(ve);return}ne.current||(De.current=ve,be.current!==null&&clearTimeout(be.current),be.current=setTimeout(te,U_)),er(ve)},[te]),fe=F.mainSpeed,ge=F.mainVolume,Ce=o.useCallback(ie=>ue({mainSpeed:ie}),[ue]),$e=o.useCallback(ie=>ue({mainVolume:ie}),[ue]),He=o.useMemo(()=>({settings:F,setSettings:ue,registerAnalyser:me,mainAnalyser:oe,noiseAnalyser:Y,playbackRate:fe,setPlaybackRate:Ce,mainVolume:ge,setMainVolume:$e}),[F,ue,me,oe,Y,fe,Ce,ge,$e]),Te=o.useRef(null),[Ie,qe]=o.useState(0),mt=o.useRef([]),[ct,rt]=o.useState("center"),[ft,ke]=o.useState(!1),Ve=o.useRef(!1),we=o.useRef(null),Ue=o.useCallback(ie=>{Ve.current||(Ve.current=!0,ke(!0),we.current=setTimeout(()=>{try{ie()}catch{Ve.current=!1,ke(!1)}},G_()?0:h_))},[]);o.useEffect(()=>()=>{we.current&&clearTimeout(we.current)},[]);const Be=o.useRef(f);o.useEffect(()=>{Be.current=f}),o.useEffect(()=>{const ie=Te.current,ve=document.activeElement;if(co(ie,ve),ie){const Me=Array.from(ie.querySelectorAll(Cn)).filter(Je=>!Je.closest('[aria-hidden="true"]'))[0];if(Me)try{Me.focus()}catch{}}return()=>{const Me=document.activeElement;if(!Me||Me===document.body||ie&&ie.contains(Me))try{po(ve)?.focus?.()}catch{}}},[]),o.useEffect(()=>Gn(()=>Ue(()=>{const ie=Be.current;typeof ie=="function"&&ie()})),[Ue]),lo(Te,!0);const[je,Se]=o.useState(!1),Xe=o.useRef(!1),[Qe,dt]=o.useState(null),ht=o.useRef(0),wt=o.useRef(0),Ct=()=>{ht.current+=1,wt.current+=1,dt(null)},[Nt,gt]=o.useState(""),[it,Ke]=o.useState(()=>Sr()),se=o.useRef(typeof c=="number"?c:null);o.useEffect(()=>{!$&&!S||(Ke(Sr()),Ct())},[$,Z,S]),o.useEffect(()=>{S&&Ke(ie=>{const ve=Math.max(0,Math.min(ie.pageIndex,Math.max(0,j-1)));return ve!==ie.pageIndex?{...ie,pageIndex:ve,stepIndex:0}:ie})},[S,j]);const Ne=S?Math.max(0,Math.min(it.pageIndex,j-1)):0,We=S?I[Ne]:null,nt=S&&We&&Array.isArray(We.steps)?We.steps:[],Fe=$?it.pageIndex:S?Ne:typeof c=="number"?c:0,Ge=$?z[Math.max(0,Math.min(it.pageIndex,Math.max(0,z.length-1)))]:null,bt=$&&Ge&&Array.isArray(Ge.steps)?Ge.steps:[],Re=$?bt.length:S?nt.length:typeof p=="number"?p:0,tt=$||S?Math.max(0,Math.min(it.stepIndex,Math.max(0,Re))):typeof m=="number"?m:0,xt=$?z.length:S?j:typeof d=="number"?d:0;o.useEffect(()=>{if(!$&&!S)return;const ie=$?Er(Ge,Fe):We?.id||`children-page-${Fe??0}`,ve=new Date().toISOString();for(let Me=0;Me<=tt;Me+=1){const Je=$?Dr(bt[Me],Me):`step-${Me}`,Oe=lt(ie,Je);ot.current.has(Oe)||ot.current.set(Oe,ve)}},[$,S,Fe,tt,We?.id]),o.useLayoutEffect(()=>{const ie=se.current;if(typeof Fe=="number"&&ie!==null&&Fe!==ie&&Fe>ie)try{gt(L("training.problemNotice",{n:Fe+1}))}catch{}se.current=typeof Fe=="number"?Fe:se.current},[Fe,c,L]),o.useLayoutEffect(()=>{const ie=Te.current;if(!ie)return;const ve=()=>ie.querySelector(".page-popup__scroll");let Me=null,Je=null,Oe=null;const Ye=Le=>{const ze=ve();if(!ze)return;const ut=ze.scrollHeight<=ze.clientHeight;if(rt(ut?"center":"top"),Le&&!Xe.current){Xe.current=!0;try{Se(!0)}catch{}try{ae.disconnect()}catch{}}},J=()=>{Me!==null&&cancelAnimationFrame(Me),Me=requestAnimationFrame(()=>{Je!==null&&clearTimeout(Je),Je=setTimeout(()=>Ye(!0),60)})},de=()=>{Oe!==null&&cancelAnimationFrame(Oe),Oe=requestAnimationFrame(()=>Ye(!1))};J(),window.addEventListener("resize",de);const ae=new MutationObserver(J);ae.observe(ie,{childList:!0,subtree:!0,attributes:!0});const ye=setTimeout(()=>{Xe.current||Ye(!0)},400);return()=>{window.removeEventListener("resize",de),Me!==null&&cancelAnimationFrame(Me),Je!==null&&clearTimeout(Je),Oe!==null&&cancelAnimationFrame(Oe),clearTimeout(ye);try{ae.disconnect()}catch{}}},[Te]);const Lt=o.useCallback(ie=>{Te.current&&(Te.current._childOnNext=ie)},[]),et=o.useCallback(ie=>{Te.current&&(Te.current._childOnResult=ie)},[]),ot=o.useRef(new Map),lt=(ie,ve)=>`${ie}\0${ve}`,st=o.useCallback((ie,ve,Me)=>{Ke(Je=>{const Oe=Je.answersByPage[ie]||{},Ye=Oe[ve],J=bs(Me),de=bs(Ye);if(Ye&&de>J)return Je;const ae=Oc(Me,ot.current.get(lt(ie,ve)),J);return{...Je,answersByPage:{...Je.answersByPage,[ie]:{...Oe,[ve]:ae}}}})},[Ke]),jt=o.useCallback((ie,ve,Me)=>{const Je=Er(Ge,Fe),Oe=Dr(ie,ve);st(Je,Oe,Me)},[Ge,Fe,st]),Wt=o.useCallback((ie,ve,Me)=>{const Je=Er(Ge,Fe),Oe=Dr(ie,ve);st(Je,Oe,Me),!Me?.allowChange&&ie?.autoAdvance!==!1&&Ke(Ye=>({...Ye,stepIndex:Math.max(Ye.stepIndex,ve+1)}))},[Ge,Fe,st,Ke]),mn=o.useCallback((ie,ve)=>{const Me=We?.id||`children-page-${Fe??0}`,Je=typeof ve=="number"?ve:tt??0,Oe=`step-${Je}`;st(Me,Oe,ie),ie?.allowChange||Ke(Ye=>({...Ye,stepIndex:Math.max(Ye.stepIndex,Je+1)}))},[We,Fe,tt,st,Ke]),hn=o.useCallback((ie,ve)=>{const Me=We?.id||`children-page-${Fe??0}`,Je=`step-${typeof ve=="number"?ve:tt??0}`;st(Me,Je,ie)},[We,Fe,tt,st]),jn=S?{currentPageIndex:Fe??0,currentStepIndex:tt??0,totalStepsInPage:nt.length,handleStepDone:mn,handleStepChange:hn}:null,zn=async()=>{const ie=typeof t?.buildResults=="function"?await Promise.resolve(t.buildResults({scenario:t,pages:z,flowState:it,answersByPage:it.answersByPage})):null;return typeof M=="function"&&await Promise.resolve(M(ie))||ie},Wn=async()=>{const ie=We?.id||`children-page-${it.pageIndex}`,ve=it.answersByPage[ie]||{},Me=W?(()=>{const Ye={};let J=0;return I.forEach(de=>{const ae=it.answersByPage[de.id]||{},ye=Array.isArray(de.steps)?de.steps.length:0;for(let Le=0;Le<ye;Le+=1){const ze=ae[`step-${Le}`];typeof ze<"u"&&(Ye[`step-${J+Le}`]=ze)}J+=ye}),Ye})():ve;if(typeof k=="function"){const Ye=await Promise.resolve(k(Me,{pageAnswers:ve,answersByPage:it.answersByPage,pages:I,currentPageId:ie}));return typeof M=="function"&&await Promise.resolve(M(Ye))||Ye}const Je=Object.entries(ve).map(([Ye,J],de)=>({index:de,key:Ye,payload:J})),Oe={results:Je,answers:Je,score:0};return typeof M=="function"&&await Promise.resolve(M(Oe))||Oe},It=()=>{const ie=++ht.current,ve=()=>ie!==ht.current;try{if(typeof document<"u"&&document.body){try{document.dispatchEvent(new CustomEvent("speechear-close-tooltips"))}catch{}document.dispatchEvent(new PointerEvent("pointerdown",{bubbles:!0,cancelable:!0})),document.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0}))}}catch{}if($){const Oe=zn();dt(Tn);const Ye=Oe;Promise.resolve(Ye).then(J=>{ve()||dt(J||{isEmpty:!0})}).catch(J=>{!ve()&&dt({isEmpty:!0})});return}if(S){const Oe=Wn();dt(Tn);const Ye=Oe;Promise.resolve(Ye).then(J=>{ve()||dt(J||{isEmpty:!0})}).catch(J=>{!ve()&&dt({isEmpty:!0})});return}const Me=Te.current&&Te.current._childOnResult,Je=Oe=>{try{return Oe?Oe():void 0}catch{return}};if(typeof Me=="function"){const Oe=Je(Me);try{typeof document>"u"?require("url").pathToFileURL(__filename).href:wn&&wn.tagName.toUpperCase()==="SCRIPT"&&wn.src||new URL("components.cjs.js",document.baseURI).href}catch{}Oe&&typeof Oe.then!="function"?dt(Oe):dt(Oe&&typeof Oe.then=="function"?Tn:{});const Ye=()=>{ve()||dt(J=>J===Tn?{}:J)};Promise.resolve(Oe).then(J=>{J&&!ve()?dt(J):Ye()}).catch(J=>{Ye()});return}if(typeof M=="function"){const Oe=Je(M);try{typeof document>"u"?require("url").pathToFileURL(__filename).href:wn&&wn.tagName.toUpperCase()==="SCRIPT"&&wn.src||new URL("components.cjs.js",document.baseURI).href}catch{}Oe&&typeof Oe.then!="function"?dt(Oe):dt(Oe&&typeof Oe.then=="function"?Tn:{});const Ye=()=>{ve()||dt(J=>J===Tn?{}:J)};Promise.resolve(Oe).then(J=>{try{typeof document>"u"?require("url").pathToFileURL(__filename).href:wn&&wn.tagName.toUpperCase()==="SCRIPT"&&wn.src||new URL("components.cjs.js",document.baseURI).href}catch{}J&&!ve()?dt(J):Ye()}).catch(J=>{console.error("viewResults external handler failed",J),Ye()});return}},vn=()=>{if($){if(typeof Fe=="number"&&typeof xt=="number"&&Fe<xt-1){Ke(ve=>({...ve,pageIndex:ve.pageIndex+1,stepIndex:0}));return}return It()}if(S){const ve=nt.length;if(typeof tt=="number"&&tt<ve-1){Ke(Me=>({...Me,stepIndex:Me.stepIndex+1}));return}if(typeof Fe=="number"&&typeof xt=="number"&&Fe<xt-1){Ke(Me=>({...Me,pageIndex:Me.pageIndex+1,stepIndex:0}));return}return It()}if(typeof C=="function"){try{C()}catch{}return}const ie=Te.current&&Te.current._childOnNext;if(typeof ie=="function"){try{ie()}catch{}return}},Ft=$?q.title||q.label||A||L("common.popup","\uD31D\uC5C5"):a||b||(Array.isArray(i)?i[i.length-1]:void 0)||A||L("common.popup","\uD31D\uC5C5"),Ht=A||Ft,Mn=$?q.title??q.label??Ft:a??b??Ft,on=(ie,ve)=>{const Me=Er(Ge,Fe),Je=Dr(ie,ve),Oe=it.answersByPage[Me]?.[Je],Ye=q_(ie,{page:Ge,pageIndex:Fe,step:ie,stepIndex:ve,storedPayload:Oe,answersByPage:it.answersByPage,flowState:it}),J={key:Je,index:ve,stepIndex:tt,isLast:ve===bt.length-1};switch(ie?.type){case"listen":return n.jsx(fs,{...J,...Ye,onDone:de=>Wt(ie,ve,de)});case"confirm":return n.jsx(ms,{...J,...Ye,onDone:de=>Wt(ie,ve,de),onChange:de=>jt(ie,ve,de)});case"confirmWithText":return n.jsx(hs,{...J,...Ye,onDone:de=>Wt(ie,ve,de),onChange:de=>jt(ie,ve,de)});case"orderList":return n.jsx(Cs,{...J,...Ye,onDone:de=>Wt(ie,ve,de),onChange:de=>jt(ie,ve,de)});default:return null}},xn=o.useRef(void 0);o.useEffect(()=>{const ie=xn.current;if(xn.current=Fe,ie===void 0||ie===Fe||!hr())return;const ve=Te.current;if(!ve)return;const Me=document.activeElement;if(!(!Me||Me===document.body||!ve.contains(Me)||Me.disabled===!0))return;const Je=ve.querySelector(`.training-steps ${Cn.split(", ").join(", .training-steps ")}`)??Array.from(ve.querySelectorAll(Cn)).find(Oe=>!Oe.closest('[aria-hidden="true"]'));try{Je?.focus()}catch{}},[Fe]);const Hn=$?z.length>0?n.jsx("div",{className:"training-steps",children:bt.map((ie,ve)=>on(ie,ve))},`replay-${Ie}`):n.jsx("div",{className:`page-popup__content page-popup__content--center${e.contentFull?" page-popup__content--full":""}`,children:n.jsx("div",{className:"pp-empty",children:t?.emptyMessage||L("training.noQuestions","\uBB38\uC81C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")})}):null,_n=S?n.jsxs(Wc.Provider,{value:jn,children:[We?.pageTop?n.jsx("div",{className:"training-page-top",children:We.pageTop}):null,n.jsx("div",{className:"training-steps",children:nt.map((ie,ve)=>{const Me=ie;return o.cloneElement(Me,{...Me.props,_stepIndex:ve,_totalSteps:nt.length,_stepKey:`step-${ve}`,_pageIndex:Fe})})},`replay-${Ie}`),We?.pageBottom?n.jsx("div",{className:"training-page-bottom",children:We.pageBottom}):null]}):null,Vt=o.useRef(-1),$t=o.useCallback(()=>{if(!w)return;const ie=Qe,{results:ve,correct:Me,total:Je}=xs(Qe),Oe={correct:Me,total:Je,attempt:mt.current.length+1,previousAttempts:[...mt.current]};if(Vt.current===wt.current)return Oe;Vt.current=wt.current,bC({items:vC(ve),category:Jc.has(w)?"sentence":"word",trainingType:w,entryPoint:B??"sentence",itemRef:D??null,correct:Me,total:Je,score:typeof ie?.score=="number"?ie.score:null,durationSeconds:Math.max(0,Math.round((Date.now()-G.current)/1e3)),dailyTotal:E??null});try{x?.(Oe)}catch{}return Oe},[w,B,E,D,Qe,x]);o.useEffect(()=>{!Qe||Qe===Tn||Qe?.isEmpty||(xs(Qe).total??0)>0&&$t()},[Qe,$t]);const qt=o.useCallback(()=>{const ie=$t();Ct(),Ue(()=>{typeof y=="function"&&y(ie),typeof f=="function"&&f()})},[y,f,$t,dt,Ue]),fn=o.useCallback(()=>gt(""),[gt]),Ot=o.useCallback(()=>{Ue(()=>{typeof f=="function"&&f()})},[f,Ue]),sn=n.jsxs("div",{className:`page-popup${ft?" page-popup--closing":""}`,role:"dialog","aria-modal":"true","aria-label":Ht,children:[n.jsxs("div",{ref:Te,className:`page-popup__panel ${je?"":"page-popup__panel--measuring"} ${ct==="center"?"page-popup__panel--center":ct==="top"?"page-popup__panel--top":""}`,children:[n.jsx(Pc,{title:Mn,subtitle:$?q.subtitle||q.label:Array.isArray(i)?i.join(" / "):void 0,desc:$?void 0:r,depth:$?q.depth:i,icon:$?q.icon:s,wrapperStyle:$?q.wrapperStyle:l,iconTooltip:$?q.iconTooltip:u,progressMax:xt,progressIndex:Fe,pageIndex:Fe,pageCount:xt,onBack:Ot,onClose:Ot}),n.jsx("div",{className:"page-popup__scroll",children:n.jsx("div",{className:`page-popup__content ${ct==="center"?"page-popup__content--center":"page-popup__content--top"}${e.contentFull?" page-popup__content--full":""}`,children:S?_n:$?Hn:typeof g=="function"?g({registerOnNext:Lt,registerOnResult:et,panelRef:Te,setResultOverlay:dt}):g})}),n.jsx(Rc,{onSettings:h,onNext:vn,onResult:It,useNoiseSettingBtn:!!($?q.useNoiseSetting??!0:_),stepIndex:tt,stepCount:Re,pageIndex:Fe,pageCount:xt,resultOpen:!!(Qe&&!Qe.isEmpty),hideNoiseRows:P})]}),Qe&&!Qe.isEmpty&&(N??K_)({score:Qe.score,results:Qe.results||Qe.answers||[],contextsLength:Qe.results?Qe.results.length:Qe.answers?Qe.answers.length:0,onReplay:()=>{if(G.current=Date.now(),Qe!==Tn){const{correct:ie,total:ve}=xs(Qe);mt.current.push({correct:ie,total:ve})}if(Ct(),qe(ie=>ie+1),$){if(Ke(Sr()),typeof t?.onReplay=="function")try{t.onReplay()}catch{}return}if(S){Ke(Sr());return}try{const ie=Te.current&&Te.current._childOnResult;typeof ie=="function"&&ie({replay:!0})}catch{}},onClose:qt,pending:Qe===Tn}),Qe?.isEmpty&&n.jsx("div",{className:"page-popup page-popup--result-empty",role:"dialog","aria-modal":"true","aria-label":L("training.result.eyebrow","\uD6C8\uB828 \uC644\uB8CC"),children:n.jsxs("div",{className:"page-popup__panel page-popup__panel--center",children:[n.jsx("div",{className:"page-popup__scroll",children:n.jsx("div",{className:`page-popup__content page-popup__content--center${e.contentFull?" page-popup__content--full":""}`,children:n.jsx("div",{className:"page-popup__empty",children:L("training.result.eyebrow","\uD6C8\uB828 \uC644\uB8CC")})})}),n.jsx("div",{className:"page-popup__bottom",children:n.jsx(pe,{htmlType:"button",variant:"main",size:48,onClick:qt,label:L("training.result.done","\uC644\uB8CC")})})]})}),n.jsx(da,{message:Nt,position:"top",onClose:fn})]}),Dt=n.jsx(is.Provider,{value:He,children:sn});return typeof document<"u"&&document.body?en.createPortal(Dt,document.body):Dt}const On=Y_;On.Page=Ar,On.ListenStep=Hc,On.ConfirmStep=Vc,On.ConfirmWithTextStep=qc,On.OrderListStep=Uc,On.CardStep=Gc,On.CardOrderStep=M_;function Z_({label:e,homonum:t}){const a=aa()?.(e,t)??"",{imgRef:r,loading:i,hasImage:s,onLoad:l,onError:u}=Uo(a);return s?n.jsxs("div",{className:"tooltip-word-image__cell",children:[i&&n.jsx("div",{className:"tooltip-word-image__spinner"}),n.jsx("img",{ref:r,src:a,alt:e,draggable:!1,style:{opacity:i?0:1},onLoad:l,onError:u})]}):n.jsx("div",{className:"tooltip-word-image__cell tooltip-word-image__cell--text h3",children:n.jsx("span",{children:e})})}function Qc({words:e,anchorRect:t}){const a=o.useRef(null),[r,i]=o.useState(null);return o.useLayoutEffect(()=>{if(!t||!a.current)return;const{offsetWidth:s,offsetHeight:l}=a.current,u=window.innerWidth;let c=t.left+t.width/2-s/2,d=t.top-l-8;d<8&&(d=t.bottom+8),c=Math.max(8,Math.min(c,u-s-8)),i({left:c,top:d})},[t]),!t||e.length===0?null:en.createPortal(n.jsx("div",{ref:a,className:"tooltip-word-image",style:{visibility:r?"visible":"hidden",left:r?.left??0,top:r?.top??-9999},children:n.jsx("div",{className:"tooltip-word-image__cells",children:e.map(s=>n.jsx(Z_,{label:s.label,homonum:s.homonum},`${s.label}_${s.homonum??1}`))})}),document.body)}function X_({titleIcon:e,resultCount:t,resultUnit:a,searchQuery:r,items:i,groups:s,selected:l=[],onSelect:u,maxSelect:c,onClearSelection:d,onPrint:m,onPrintEmpty:p,className:f,emptyHint:y,sectionType:x="page",disc:C}){const{t:h,i18n:_}=xe.useTranslation(),g=_.language?.startsWith("ko")??!1,{anchorRect:A,openAt:b,close:k}=Ta(),[v,w]=o.useState(null),B=o.useCallback(()=>{k(),w(null)},[k]);Jy(B,!!v);const E=(r??"").trim(),D=/^[^,[\]\s]+$/.test(E)?E:"",N=D.length>0,O=r===void 0&&t===void 0,P=N?"match":O?"original":"ganada",[G,L]=o.useState(()=>P),[M,$]=o.useState("50"),[Z,q]=o.useState(1),[z,V]=o.useState(N);z!==N&&(V(N),L(P));const R=G==="match"&&!N||G==="original"&&!O?P:G,H=o.useMemo(()=>[...N?[{value:"match",label:h("wordSearch.sort.match",{defaultValue:"\uC2DC\uC791 \uC6B0\uC120"})}]:[],...O?[{value:"original",label:h("wordSearch.sort.original",{defaultValue:"\uBC1B\uC740 \uC21C\uC11C"})}]:[],{value:"ganada",label:h("wordSearch.sort.ganada",{defaultValue:"\uAC00\uB098\uB2E4\uC21C \u2191"})},{value:"ganada_desc",label:h("wordSearch.sort.ganadaDesc",{defaultValue:"\uAC00\uB098\uB2E4\uC21C \u2193"})},{value:"syllable",label:h("wordSearch.sort.syllable",{defaultValue:"\uC74C\uC808 \uC218 \u2191"})},{value:"syllable_desc",label:h("wordSearch.sort.syllableDesc",{defaultValue:"\uC74C\uC808 \uC218 \u2193"})},{value:"grade",label:h("wordSearch.sort.grade",{defaultValue:"\uB4F1\uAE09\uC21C \u2191"})},{value:"grade_desc",label:h("wordSearch.sort.gradeDesc",{defaultValue:"\uB4F1\uAE09\uC21C \u2193"})}],[h,N,O]),W=o.useMemo(()=>["10","25","50","100"].map(te=>({value:te,label:h("wordSearch.pageSize",{count:Number(te),defaultValue:`${te}\uAC1C\uC529 \uBCF4\uAE30`})})),[h]),I=te=>te.words?.[0],S=o.useMemo(()=>{const te=[...D].length,ue=tC(D),fe=new Map;return ge=>{let Ce=fe.get(ge);return Ce===void 0&&(Ce=ue((ge.words?.[0]?.label??"").slice(0,te))?0:1,fe.set(ge,Ce)),Ce}},[D]),j=o.useCallback((te,ue)=>{const fe=$e=>I($e)?.label??"",ge=$e=>I($e)?.syllables??[...fe($e)].length,Ce=$e=>($e.words??[]).reduce((He,Te)=>{const Ie=parseInt(Te.grade??"",10);return Number.isFinite(Ie)&&Ie<He?Ie:He},999);switch(R){case"match":return S(te)-S(ue)||an(fe(te),fe(ue));case"ganada":return an(fe(te),fe(ue));case"ganada_desc":return an(fe(ue),fe(te));case"syllable":return ge(te)-ge(ue)||an(fe(te),fe(ue));case"syllable_desc":return ge(ue)-ge(te)||an(fe(te),fe(ue));case"grade":return Ce(te)-Ce(ue)||an(fe(te),fe(ue));case"grade_desc":return Ce(ue)-Ce(te)||an(fe(te),fe(ue));default:return 0}},[R,S]),F=o.useMemo(()=>i.slice().sort(j),[i,j]),U=Number(M)||10,re=o.useMemo(()=>(s??[]).flatMap(te=>te.items.slice().sort(j).map(ue=>({item:ue,label:te.label}))),[s,j]),ne=s?re.length:F.length,le=Math.max(1,Math.ceil(ne/U)),K=Math.min(Z,le),oe=o.useMemo(()=>F.slice((K-1)*U,K*U),[F,K,U]),Ae=o.useMemo(()=>{if(!s)return null;const te=re.slice((K-1)*U,K*U),ue=new Map;for(const{item:fe,label:ge}of te)ue.has(ge)||ue.set(ge,[]),ue.get(ge).push(fe);return[...ue.entries()].map(([fe,ge])=>({label:fe,items:ge}))},[s,re,K,U]);o.useEffect(()=>{q(1)},[G,M,ne,r]);const Y=ne>0?n.jsxs("div",{className:"word-search-result-block__toolbar",children:[n.jsx(pn,{size:40,options:H,value:R,onChange:L,ariaLabel:h("wordSearch.sort.aria",{defaultValue:"\uC815\uB82C"})}),n.jsx(pn,{size:40,options:W,value:M,onChange:$,ariaLabel:h("wordSearch.pageSizeAria",{defaultValue:"\uD398\uC774\uC9C0 \uD06C\uAE30"})}),n.jsx(dr,{page:K,totalPages:le,onChange:q})]}):void 0,Q=te=>{u&&u(te)},me=t!==void 0&&a?n.jsxs(n.Fragment,{children:[h("wordSearch.resultTitlePrefix","\uCD1D "),n.jsx("span",{style:{color:"var(--color-main)"},children:t}),h("wordSearch.resultTitleSuffix",{unit:g?dC(a):a})]}):void 0,De=t!==void 0&&t>0&&c!==void 0&&a?h("wordSearch.resultDisc",{unit:g?mC(a):a,max:c,selected:l.length}):void 0,be=C??De;return n.jsxs(ma,{type:x,className:_e("word-search-result-block",f),children:[n.jsxs("div",{className:"word-search-result-block__inner",children:[(me||Y||be)&&n.jsxs("div",{className:"word-search-result-block__head",children:[n.jsxs("div",{className:"word-search-result-block__head-main",children:[e&&n.jsx(at,{icon:e,className:"word-search-result-block__head-icon"}),me&&n.jsx("span",{className:"word-search-result-block__title h3",children:me})]}),Y&&n.jsx("div",{className:"word-search-result-block__head-actions",children:Y}),be&&n.jsx("div",{className:"word-search-result-block__head-disc body-3",children:be})]}),(s?s.length===0:i.length===0)&&n.jsxs("div",{className:"word-search-result-block__empty-wrap",children:[n.jsx("p",{className:"word-search-result-block__empty body-3",children:h("wordSearch.emptyResult","\uAC80\uC0C9 \uACB0\uACFC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")}),y&&n.jsx("p",{className:"word-search-result-block__empty-hint body-3",children:y})]}),s?(Ae??[]).map(te=>n.jsx("div",{className:"word-search-result-block__group",children:n.jsx("div",{className:"word-search-result-block__items",children:te.items.map(ue=>{const fe=l.includes(ue.id);return n.jsx("div",{onMouseEnter:ge=>{b(ge.currentTarget),w(ue.words??[])},onMouseLeave:B,children:n.jsx(pe,{htmlType:"button",size:"word",align:"grid",label:(ue.words??[]).map(ge=>ge.label),subLabel:(ue.words??[]).some(ge=>ge.subLabel)?(ue.words??[]).map(ge=>ge.subLabel):void 0,selected:fe,onClick:()=>Q(ue.id),minWidth:200})},ue.id)})})},te.label)):n.jsx("div",{className:"word-search-result-block__items",children:oe.map(te=>{const ue=l.includes(te.id);return n.jsx("div",{onMouseEnter:fe=>{b(fe.currentTarget),w(te.words??[])},onMouseLeave:B,children:n.jsx(pe,{htmlType:"button",size:"word",align:"grid",label:(te.words??[]).map(fe=>fe.label),subLabel:(te.words??[]).some(fe=>fe.subLabel)?(te.words??[]).map(fe=>fe.subLabel):void 0,selected:ue,onClick:()=>Q(te.id),minWidth:200})},te.id)})}),v&&A&&n.jsx(Qc,{words:v,anchorRect:A})]}),le>1&&n.jsx("div",{className:"word-search-result-block__pagination-bottom",children:n.jsx(dr,{page:K,totalPages:le,onChange:q})}),(d||m)&&n.jsxs("div",{className:"word-search-result-block__actions",children:[d&&n.jsx(pe,{htmlType:"button",size:"56",type:"bar",label:h("common.resetSelection","\uC120\uD0DD \uCD08\uAE30\uD654"),selected:!1,disabled:l.length===0,onClick:l.length===0?void 0:d}),m&&n.jsx("div",{onClick:l.length===0?p:void 0,children:n.jsx(pe,{htmlType:"button",size:"56",type:"bar",variant:"main",label:h("wordTable.title","\uB2E8\uC5B4 \uD45C \uB9CC\uB4E4\uAE30"),disabled:l.length===0,onClick:l.length===0?void 0:m})})]})]})}function J_(e,t){return t.map(a=>{const r=typeof a=="string"?a:a.label,i=typeof a=="string"?void 0:a.displayLabel;return{label:r,value:e[r]??"",displayLabel:i}})}function Q_({sections:e,selectedList:t,count:a,onCountChange:r,maxCount:i=4,minCount:s=1,combinationSections:l,combinationSectionsForSlot:u,onSelect:c,placeholder:d="-",className:m,title:p,titleIcon:f,disc:y,showInfoButton:x=!0,onClearPhoneme:C,onSearch:h,onSearchEmpty:_,searchDisabled:g=!1,searchLabel:A,searchChecking:b=!1,pairMode:k=!1,sectionType:v="page",beforeSearchContent:w,beforeContent:B,afterContent:E,hideCountControl:D=!1,ordinal:N=!1}){const{t:O}=xe.useTranslation(),P=o.useMemo(()=>O("wordPairs.infoNotes",{returnObjects:!0}),[O]),G=o.useMemo(()=>Array.from({length:i-s+1},(S,j)=>{const F=s+j;return{key:String(F),label:O("wordPairs.count",{n:F})}}),[O,i,s]),L=o.useMemo(()=>O("wordPairs.ordinals",{returnObjects:!0}),[O]),M=o.useCallback(S=>N?O("wordPairs.phonemeOrdinalLabel",{ordinal:L[S-1]??S}):a===1?O("wordPairs.phonemeSingleLabel","\uC74C\uC808"):O("wordPairs.phonemeN",{n:S}),[N,L,a,O]),$=o.useCallback(S=>N?O("wordPairs.phonemeContrastOrdinalLabel",{ordinal:L[S-1]??S}):a===1?O("wordPairs.phonemeContrastSingleLabel","\uB300\uB9BD \uC74C\uC808"):O("wordPairs.phonemeContrast",{n:S}),[N,L,a,O]),Z=o.useCallback((S,j)=>j?n.jsxs(n.Fragment,{children:[S,n.jsx("span",{className:"phoneme-select-block__required",children:"*"})]}):S,[]),{anchorRect:q,toggleAt:z,close:V}=Ta(),R=o.useCallback(S=>r(Number(S)),[r]),H=ln("(max-width: 767px)"),W=o.useCallback(S=>J_(S,e).map(({label:j,value:F,displayLabel:U})=>{const re=!!F&&F!=="\uC5C6\uC74C";return n.jsxs("span",{className:_e("phoneme-select-block__cell-jamo-part",F?"":"phoneme-select-block__cell-jamo-part--empty",re?"":"phoneme-select-block__cell-jamo-part--no-label"),children:[n.jsx("span",{className:`phoneme-select-block__cell-jamo-char h1${F==="\uC5C6\uC74C"?" phoneme-select-block__cell-jamo-char--excluded":""}`,children:F==="\uC5C6\uC74C"?"x":F||d}),re&&n.jsx("span",{className:"phoneme-select-block__cell-jamo-label caption-2",children:U??j})]},j)}),[e,d]),I=n.jsxs(n.Fragment,{children:[n.jsx("div",{"data-tooltip-ignore":!0,children:n.jsx(pe,{htmlType:"button",size:40,type:H?"dot":void 0,icon:"info",label:H?void 0:O("wordPairs.caution","\uC720\uC758\uC0AC\uD56D"),ariaLabel:O("wordPairs.caution","\uC720\uC758\uC0AC\uD56D"),className:q?"is-selected":void 0,"aria-expanded":!!q,"aria-haspopup":"dialog",onClick:S=>z(S.currentTarget)})}),q&&n.jsx(Kn,{title:O("wordPairs.caution","\uC720\uC758\uC0AC\uD56D"),items:P,anchorRect:q,onClose:V})]});return n.jsxs(ma,{type:v,title:p,icon:f,disc:y,action:x?I:void 0,className:_e("phoneme-select-block",m),children:[B,!D&&n.jsx("div",{className:"phoneme-select-block__controls",children:n.jsx(gn,{options:G,value:String(a),onChange:R,size:40,ariaLabel:O("wordPairs.countLabel","\uC74C\uC18C \uAC1C\uC218"),className:"phoneme-select-block__count-control"})}),n.jsx("div",{className:"phoneme-select-block__cells",children:k?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"phoneme-select-block__cell-group",children:Array.from({length:a}).map((S,j)=>{const F=t[j*2]??{};return n.jsxs("div",{className:"phoneme-select-block__cell",children:[n.jsx("div",{className:"phoneme-select-block__cell-circle",children:n.jsx("div",{className:"phoneme-select-block__cell-jamo",children:W(F)})}),n.jsx("span",{className:"phoneme-select-block__cell-index caption-1",children:M(j+1)})]},j)})}),n.jsx("span",{className:"phoneme-select-block__cell-vs h3",children:O("wordPairs.phonemeSelect.vs","\uB300")}),n.jsx("div",{className:"phoneme-select-block__cell-group",children:Array.from({length:a}).map((S,j)=>{const F=t[j*2+1]??{};return n.jsxs("div",{className:"phoneme-select-block__cell",children:[n.jsx("div",{className:"phoneme-select-block__cell-circle",children:n.jsx("div",{className:"phoneme-select-block__cell-jamo",children:W(F)})}),n.jsx("span",{className:"phoneme-select-block__cell-index caption-1",children:$(j+1)})]},j)})})]}):t.map((S,j)=>n.jsxs("div",{className:"phoneme-select-block__cell",children:[n.jsx("div",{className:"phoneme-select-block__cell-circle",children:n.jsx("div",{className:"phoneme-select-block__cell-jamo",children:W(S)})}),n.jsx("span",{className:"phoneme-select-block__cell-index caption-1",children:M(j+1)})]},j))}),(l||u)&&n.jsx("div",{className:"phoneme-select-block__panels",children:n.jsx("div",{className:"phoneme-select-block__detail",children:k?n.jsxs("div",{className:"phoneme-select-block__pair-panels",children:[n.jsx("div",{className:"phoneme-select-block__panel-group",children:Array.from({length:a}).map((S,j)=>{const F=t[j*2]??{};return n.jsx(Dn,{title:Z(M(j+1),j===0),sections:u?u(F,j*2):l,selected:F,onSelect:c?.(j*2),align:"newline"},j)})}),n.jsx("div",{className:"phoneme-select-block__panel-group",children:Array.from({length:a}).map((S,j)=>{const F=t[j*2+1]??{};return n.jsx(Dn,{title:$(j+1),sections:u?u(F,j*2+1):l,selected:F,onSelect:c?.(j*2+1),align:"newline"},j)})})]}):t.map((S,j)=>n.jsx(Dn,{title:Z(M(j+1),j===0),sections:u?u(S,j):l,selected:S,onSelect:c?.(j),align:"newline"},j))})}),w&&n.jsx("div",{className:"phoneme-select-block__before-search",children:w}),(C||h||b)&&(()=>{const S=t.every(j=>{const F=Xf(j);return Object.entries(F).every(([U,re])=>!re||U==="coda"&&re===Bi)});return n.jsxs("div",{className:"phoneme-select-block__search-row",onClick:S?_:void 0,children:[C&&n.jsx(pe,{htmlType:"button",size:"56",type:"bar",label:O("wordPairs.resetOptions","\uAC80\uC0C9 \uC635\uC158 \uCD08\uAE30\uD654"),selected:!1,disabled:S,onClick:S?void 0:C}),h?n.jsx(pe,{htmlType:"button",size:"56",type:"bar",variant:"main",icon:b?n.jsx("span",{className:"phoneme-select-block__spinner","aria-hidden":"true"}):void 0,label:A??O("wordSearch.searchButton","\uAC80\uC0C9\uD558\uAE30"),disabled:S||g||b,onDisabledClick:b?()=>{}:void 0,"aria-busy":b||void 0,onClick:h}):b?n.jsxs("div",{className:"phoneme-select-block__checking","aria-busy":"true",children:[n.jsx("div",{className:"phoneme-select-block__spinner"}),n.jsx("span",{className:"button-1 phoneme-select-block__checking-label",children:A??O("wordSearch.searchButton","\uAC80\uC0C9\uD558\uAE30")})]}):null]})})(),E]})}function ew({title:e,sections:t,selected:a,onSelect:r,collapsible:i,defaultCollapsed:s,collapsed:l,onCollapsedChange:u,headerSummary:c,headerAction:d,className:m}){const{t:p}=xe.useTranslation();return n.jsx(Dn,{className:m,title:e??p("wordSearch.filterTitle","\uB2E8\uC5B4 \uAC80\uC0C9 \uC124\uC815"),sections:t,selected:a,onSelect:r,collapsible:i,defaultCollapsed:s,collapsed:l,onCollapsedChange:u,headerSummary:c,headerAction:d,align:"inline"})}function tw({title:e,headerAction:t,sections:a,selected:r,onSelect:i,className:s}){const{t:l}=xe.useTranslation();return a.length===0?null:n.jsx(Dn,{className:s,title:e??l("training.filter.phonemeGroup",{defaultValue:"\uD6C8\uB828 \uC74C\uC808"}),headerAction:t,sections:a,selected:r,onSelect:i,align:"newline"})}function nw({title:e,mode:t,onModeChange:a,matchMode:r,onMatchModeChange:i,positionCount:s,onPositionCountChange:l,inputMode:u,onInputModeChange:c,className:d}){const{t:m}=xe.useTranslation(),p={searchMode:m("wordPairs.filter.searchModeLabel","\uB300\uB9BD \uBC29\uC2DD"),phonemeOrder:m("wordPairs.filter.phonemeOrder","\uC785\uB825 \uC74C\uC808 \uC704\uCE58"),count:m("wordPairs.filter.countLabel","\uC785\uB825 \uC74C\uC808 \uAC2F\uC218"),inputMode:m("wordPairs.filter.inputModeLabel","\uC785\uB825 \uBC29\uC2DD"),orderAny:m("wordPairs.filter.orderAny","\uBB34\uAD00"),orderMatch:m("wordPairs.filter.orderMatch","\uC77C\uCE58"),include:m("wordPairs.mode.include","\uC74C\uC18C \uD3EC\uD568"),pick:m("wordPairs.mode.pick","\uC74C\uC18C \uB300\uB9BD"),explicit:m("wordPairs.mode.contrast","\uC74C\uC18C \uB300\uB9BD \uC9C0\uC815"),charInput:m("wordPairs.input.char","\uAE00\uC790 \uC120\uD0DD"),pronInput:m("wordPairs.input.pron","\uBC1C\uC74C \uC120\uD0DD")},f=h=>m("wordPairs.count",{n:h}),y=[{label:p.searchMode,items:[p.include,p.pick,p.explicit],display:"segmented",labelAction:n.jsx(Pa,{title:m("wordPairs.mode.infoTitle","\uB300\uB9BD \uBC29\uC2DD"),items:[m("wordPairs.mode.infoInclude","\uC74C\uC18C \uD3EC\uD568 \u2014 \uC120\uD0DD\uD55C \uC74C\uC18C\uAC00 \uBAA8\uB450 \uB4E4\uC5B4\uAC04 \uB2E8\uC5B4\uC640 \uADF8 \uB300\uB9BD\uC30D\uC744 \uCC3E\uC544\uC694."),m("wordPairs.mode.infoPick","\uC74C\uC18C \uB300\uB9BD \u2014 \uC120\uD0DD\uD55C \uC74C\uC18C\uAC00 \uB300\uB9BD\uC30D \uB450 \uB2E8\uC5B4\uC758 \uC2E4\uC81C \uCC28\uC774\uC810\uC77C \uB54C\uB9CC \uB9E4\uCE6D\uB3FC\uC694."),m("wordPairs.mode.infoContrast","\uC74C\uC18C \uB300\uB9BD \uC9C0\uC815 \u2014 \uAE30\uC900 \uB2E8\uC5B4\uC640 \uB300\uB9BD \uB2E8\uC5B4\uC758 \uC74C\uC18C\uB97C \uAC01\uAC01 \uC9C1\uC811 \uC120\uD0DD\uD574 \uB300\uB9BD\uC30D\uC744 \uCC3E\uC544\uC694.")]})},{label:p.phonemeOrder,items:[p.orderAny,p.orderMatch],display:"segmented",labelAction:n.jsx(Pa,{items:m("wordPairs.filter.phonemeOrderInfo",{returnObjects:!0})})},{label:p.count,items:[f(1),f(2)],display:"segmented"},{label:p.inputMode,items:[p.charInput,p.pronInput],display:"segmented",labelAction:n.jsx(Pa,{title:m("wordPairs.input.infoTitle","\uC785\uB825 \uBC29\uC2DD"),items:[m("wordPairs.input.infoChar","\uAE00\uC790 \uC120\uD0DD \u2014 \uC120\uD0DD\uD55C \uC74C\uC18C\uB85C \uB2E8\uC5B4(\uAE00\uC790 \uAE30\uC900)\uB97C \uCC3E\uC740 \uD6C4, \uB2E8\uC5B4\uC758 \uD45C\uC900 \uBC1C\uC74C \uB300\uB9BD\uC30D\uC744 \uCC3E\uC2B5\uB2C8\uB2E4."),m("wordPairs.input.infoPron","\uBC1C\uC74C \uC120\uD0DD \u2014 \uC120\uD0DD\uD55C \uC74C\uC18C\uB85C \uD45C\uC900 \uBC1C\uC74C \uB300\uB9BD\uC30D\uC744 \uCC3E\uC2B5\uB2C8\uB2E4.")]})}],x={[p.searchMode]:t==="explicit"?p.explicit:t==="pick"?p.pick:p.include,[p.phonemeOrder]:r==="ordered"?p.orderMatch:p.orderAny,[p.count]:f(s),[p.inputMode]:u==="phoneme"?p.pronInput:p.charInput},C=(h,_)=>{_===p.searchMode?a(h===p.explicit?"explicit":h===p.pick?"pick":"include"):_===p.phonemeOrder?i(h===p.orderMatch?"ordered":"unordered"):_===p.count?l(h===f(2)?2:1):_===p.inputMode&&c(h===p.pronInput?"phoneme":"word")};return n.jsx(Dn,{className:d,title:e??m("wordPairs.filter.searchOptionsTitle","\uB300\uB9BD \uC124\uC815"),sections:y,selected:x,onSelect:C,align:"inline"})}function aw(e){const{title:t,items:a,columns:r,resizeStorageKey:i,gridTemplateColumns:s,mobileGridTemplateColumns:l,searchPlaceholder:u,searchFn:c,defaultSortKey:d,defaultSortAsc:m=!0,selectedId:p,selectedIds:f,onSelect:y,onClose:x,pageSizeOptions:C=[10,25,50,100],initialPageSize:h,emptyText:_,noMatchText:g,countLabel:A,topContent:b,className:k=""}=e,{t:v}=xe.useTranslation(),w=u??v("common.search","\uAC80\uC0C9"),B=_??v("common.emptyList","\uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."),E=g??v("common.noMatches","\uB9DE\uB294 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"),[D,N]=o.useState(""),[O,P]=o.useState(d??r[0]?.key??""),[G,L]=o.useState(m),[M,$]=o.useState(String(h??C[0]??10)),[Z,q]=o.useState(1);o.useEffect(()=>{q(1)},[D,M]);const z=c!==null,V=o.useCallback((ne,le)=>{if(!le)return!0;const K=le.toLowerCase();return r.some(oe=>{const Ae=ne[oe.key];return Ae==null?!1:String(Ae).toLowerCase().includes(K)})},[r]),R=c??V,H=o.useMemo(()=>{const ne=z?a.filter(le=>R(le,D)):a;return O?[...ne].sort((le,K)=>{const oe=le[O],Ae=K[O];return oe===Ae?0:yo(oe,Ae,G)}):ne},[a,D,O,G,z,R]),W=Math.max(1,Math.ceil(H.length/Number(M)));Z>W&&q(W);const I=Math.min(Z,W),S=H.slice((I-1)*Number(M),I*Number(M)),j=o.useCallback(ne=>{O===ne?L(le=>!le):(P(ne),L(!0)),q(1)},[O]),F=o.useMemo(()=>{if(typeof A=="function"){const ne=H.length,le=A(ne);if(typeof le=="string"){const K=le.lastIndexOf(String(ne));if(K>=0)return{prefix:le.slice(0,K),suffix:le.slice(K+String(ne).length)}}return{label:le}}if(typeof A=="string"&&A.includes("{n}")){const[ne,le]=A.split("{n}");return{prefix:ne,suffix:le}}return{prefix:v("common.totalCountPrefix","\uCD1D "),suffix:v("common.totalCountSuffix","\uAC1C")}},[A,H.length,v]),U=o.useMemo(()=>r.map(ne=>({label:ne.label,onClick:ne.sortable!==!1?()=>j(ne.key):void 0,className:ne.className,sortDir:ne.sortable!==!1&&O===ne.key?G?"asc":"desc":null})),[r,O,G,j]),re=o.useMemo(()=>C.map(ne=>({value:String(ne),label:v("common.pageSizeLabel",{n:ne})})),[C,v]);return n.jsxs(Fn,{className:`popup-list ${k}`,title:t,onClose:x,children:[b,"label"in F&&n.jsx("p",{className:"toolbar__count body-1",children:F.label}),n.jsx(jo,{count:"label"in F?void 0:{value:H.length,prefix:F.prefix,suffix:F.suffix},search:z?{value:D,onChange:N,placeholder:w}:void 0,pageSize:{options:re,value:M,onChange:$},pagination:{page:I,total:W,onChange:q}}),n.jsx(Ho,{size:"medium",gridTemplateColumns:s,mobileGridTemplateColumns:l,resizable:!0,resizeStorageKey:i,fields:U,items:S,onRowClick:y,renderRow:ne=>{const le=f!=null?ne.id!=null&&f.has(ne.id):p!=null&&ne.id===p;return r.map(K=>({content:K.render?K.render(ne):ne[K.key]??"",className:_e(K.className,le&&"popup-list__row--selected")}))},empty:z&&D!==""&&a.length>0?E:B})]})}function ed(e){const{title:t,message:a,topContent:r,details:i,children:s,confirmLabel:l,cancelLabel:u,hideCancel:c=!1,extraAction:d,confirmVariant:m="main",confirmDisabled:p=!1,onConfirm:f,closeOnConfirm:y=!0,onClose:x,inline:C,size:h="small",className:_,initialFocus:g="close"}=e,{t:A}=xe.useTranslation(),b=o.useRef(null);o.useEffect(()=>{if(C||g==="close")return;const D=b.current?.closest(".popup-panel"),N=Array.from(D?.querySelectorAll(".popup-footer--buttons button")??[]),O=g==="confirm"?N[N.length-1]:c?void 0:N[d?1:0];O&&!O.disabled&&O.focus()},[]);const k=o.useRef(!1),[v,w]=o.useState(!1),B=D=>{let N=!1;return{close:()=>{N=!0,D()},didClose:()=>N}},E=async D=>{if(k.current)return;k.current=!0;const N=typeof document<"u"?document.activeElement:null;w(!0);let O=!1;try{O=await D()}catch(P){typeof console<"u"&&console.error(P)}finally{O||(k.current=!1,w(!1),requestAnimationFrame(()=>{const P=document.activeElement;(!P||P===document.body)&&N?.isConnected&&N.focus()}))}};return n.jsxs(Fn,{title:t,onClose:x,closeDisabled:v,inline:C,size:h,className:_e("confirm-popup",r!=null&&"confirm-popup--has-top",_),buttons:[...d?[{label:d.label,variant:d.variant??"default",disabled:d.disabled||v,onClick:async({closeWithAnimation:D})=>{await E(async()=>{const N=B(D);await d.onClick(N.close);const O=d.closeOnClick??!0;return O&&D(),O||N.didClose()})}}]:[],...c?[]:[{label:u??A("common.cancel","\uCDE8\uC18C"),variant:"default",disabled:v,onClick:({closeWithAnimation:D})=>D()}],{label:l??A("common.confirm","\uD655\uC778"),variant:m,disabled:p||v,onClick:async({closeWithAnimation:D})=>{await E(async()=>{const N=B(D);return await f(N.close),y&&D(),y||N.didClose()})}}],children:[r!=null&&n.jsx("div",{className:"confirm-popup__top",children:r}),i&&i.length>0&&n.jsx(Br,{children:i.map((D,N)=>n.jsx(Sn,{label:D.label,children:n.jsx("span",{className:"panel-row__text body-2",children:D.value})},N))}),n.jsx("p",{ref:b,className:"body-2 confirm-popup__message",children:a}),s]})}function rw(e,t,a={}){const{t:r}=xe.useTranslation(),[i,s]=o.useState(!1),l=o.useRef(!1),u=o.useCallback(()=>{l.current=!0},[]),c=o.useCallback(()=>l.current?(l.current=!1,!0):e?(s(!0),!1):!0,[e]),d=i?n.jsx(ed,{title:a.title??r("common.discardConfirm.title","\uC785\uB825\uC744 \uCDE8\uC18C\uD560\uAE4C\uC694?"),message:a.message??r("common.discardConfirm.body","\uC800\uC7A5\uD558\uC9C0 \uC54A\uC73C\uBA74 \uC9C0\uAE08\uAE4C\uC9C0 \uC785\uB825\uD55C \uB0B4\uC6A9\uC774 \uC0AC\uB77C\uC9D1\uB2C8\uB2E4."),confirmLabel:a.confirmLabel??r("common.discardConfirm.confirm","\uC785\uB825 \uCDE8\uC18C"),confirmVariant:"danger",onConfirm:()=>{s(!1),t()},onClose:()=>s(!1)}):null;return{beforeClose:c,discardPopup:d,allowClose:u}}function ow({onApply:e,onCancel:t}){const{t:a}=xe.useTranslation(),[r,i]=o.useState(""),[s,l]=o.useState(!1),[u,c]=o.useState(null),d=o.useRef(null),m=o.useId();o.useEffect(()=>{d.current?.focus()},[]);const p=o.useCallback(async x=>{const C=r.trim();if(C){l(!0),c(null);try{await e(C),x()}catch(h){c(Ei(h)),l(!1),requestAnimationFrame(()=>d.current?.focus())}}},[r,e]),f=o.useCallback((x,C)=>{x.key==="Enter"&&!x.nativeEvent.isComposing&&p(C)},[p]),y=x=>{i(x.target.value),c(null)};return n.jsx(Fn,{className:"coupon-input-popup",title:a("usage.couponButton","\uCFE0\uD3F0 \uC785\uB825"),size:"small",onClose:t,closeDisabled:s,buttons:[{label:a("common.cancel","\uCDE8\uC18C"),variant:"default",disabled:s,onClick:({closeWithAnimation:x})=>x()},{label:a("coupons.applyButton","\uC801\uC6A9"),variant:"main",disabled:!r.trim()||s,onClick:({closeWithAnimation:x})=>{p(x)}}],children:({closeWithAnimation:x})=>n.jsxs(n.Fragment,{children:[n.jsx("input",{ref:d,className:"coupon-input-popup__input body-2","aria-label":a("coupons.input.label","\uCFE0\uD3F0 \uCF54\uB4DC"),"aria-invalid":u?!0:void 0,"aria-errormessage":u?m:void 0,"aria-describedby":u?m:void 0,placeholder:a("coupons.input.placeholder","\uCFE0\uD3F0 \uCF54\uB4DC \uC785\uB825"),value:r,onChange:y,onKeyDown:C=>f(C,x),disabled:s,autoComplete:"off",spellCheck:!1}),u&&n.jsx("p",{id:m,className:"coupon-input-popup__error caption-1",role:"alert",children:u})]})})}const td=["var(--color-main)","var(--color-sub)"],sw=2e3;function iw(e,t){if(!t.startsWith("var("))return t;try{const a=t.slice(4,-1).trim();return getComputedStyle(e).getPropertyValue(a).trim()||null}catch{return null}}function _s({active:e=!1,count:t=40,duration:a=2e3,strength:r=1,onComplete:i,trigger:s=0}){const l=o.useMemo(()=>{const C=Math.floor(t/2),h=t-C,_=(g,A)=>Array.from({length:g}).map((b,k)=>{const v=6+Math.random()*12,w=Math.round(Math.min(18,v*Math.min(1.5,1+r*.4))),B=td[Math.floor(Math.random()*td.length)],E=Math.random()*300,D=(360+Math.random()*260)*r*1.2,N=(A==="left"?-95+Math.random()*40:-85-Math.random()*40)*Math.PI/180,O=Math.cos(N)*D,P=Math.sin(N)*D*1.35,G=Math.random()*720-360,L=(1200+Math.random()*3e3)*Math.min(1.6,1+r*.3),M=Math.random()>.7?"50%":"3px";return{id:`${A}-${k}`,side:A,size:w,color:B,delay:E,vx:O,vy:P,angularVel:G,life:L,borderRadius:M}});return[..._(C,"left"),..._(h,"right")]},[t,r]),u=o.useRef(null),c=o.useRef({}),d=o.useRef(null),m=o.useRef(i);o.useEffect(()=>{m.current=i},[i]);const p=o.useRef(null),f=o.useRef(null),y=()=>{if(typeof document>"u")return null;let C=document.querySelector("[data-ihab-effect-root]");return C||(C=document.createElement("div"),C.className="app-effect",C.dataset.ihabEffectRoot="",C.style.position="fixed",C.style.inset="0",C.style.pointerEvents="none",C.style.zIndex="99998",document.body.appendChild(C)),C};if(typeof document<"u"&&f.current==null&&(f.current=y()),o.useEffect(()=>{if(!e)return;if(typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches){const V=setTimeout(()=>m.current?.(),0);return()=>clearTimeout(V)}const C=1200,h=performance.now(),_=f.current&&f.current!==document.body?f.current.getBoundingClientRect():null,g=Math.max(60,(window.innerHeight||800)*.05),A=V=>Math.max(40,(V||window.innerWidth)*.02),b=_?.width||window.innerWidth||375,k=_?.height||window.innerHeight||812,v=V=>{const R=[...V].sort((H,W)=>H-W);return R[Math.floor(R.length/2)]||1},w=v(l.map(V=>Math.abs(V.vy))),B=v(l.map(V=>Math.abs(V.vx))),E=Math.sqrt(2*C*(k*.72+g))/w,D=w*E/C,N=b*.5/(B*D),O=(V,R,H)=>Math.min(H,Math.max(R,V)),P=O(E,.8,2.4),G=O(N,.7,2.2),L=a>0?a/sw:1,M=l.map(V=>({...V,life:V.life*L,vx:V.vx*G,vy:V.vy*P,startTime:h+V.delay,ended:!1})),$=_?{x:_.left-A(_.width),y:_.top+_.height+g}:{x:-A(window.innerWidth),y:window.innerHeight+g},Z=_?{x:_.left+_.width+A(_.width),y:_.top+_.height+g}:{x:window.innerWidth+A(window.innerWidth),y:window.innerHeight+g},q=V=>{let R=!1;for(const H of M){const W=c.current[H.id];if(!W||!W)continue;if(V<H.startTime){W.style.display="none",R=!0;continue}if(!H._inited){const oe=H.side==="left"?$.x:Z.x,Ae=H.side==="left"?$.y:Z.y;W.style.left=`${oe}px`,W.style.top=`${Ae}px`,W.style.transform="translate3d(0px, 0px, 0)",W.style.display="block",W.style.zIndex="100000",typeof H.color=="string"&&H.color.startsWith("var(")&&(W.style.background=iw(W,H.color)??"#FF0060"),H._inited=!0}const I=(V-H.startTime)/1e3;if(I<0)continue;const S=H.life/1e3;if(I>=S){W.style.opacity="0",W.style.display="none",H.ended=!0;continue}R=!0;const j=H.side==="left"?$.x:Z.x,F=H.side==="left"?$.y:Z.y,U=j+H.vx*I,re=F+H.vy*I+.5*C*I*I,ne=(H.angularVel||0)*I,le=U-j,K=re-F;W.style.transform=`translate3d(${le}px, ${K}px, 0) rotate(${ne}deg)`,W.style.opacity=`${Math.max(0,1-I/S)}`}R?d.current=requestAnimationFrame(q):m.current?.()};d.current=requestAnimationFrame(q);const z=setTimeout(()=>{try{if((f.current?f.current.querySelectorAll(".confetti"):document.querySelectorAll(".confetti")).length===0&&!document.querySelector(".party-container")){const V=document.createElement("div");V.className="party-container",V.style.position="fixed",V.style.inset="0",V.style.pointerEvents="none",V.style.overflow="visible",V.style.zIndex="2147483647";for(const R of l){const H=document.createElement("span");H.className=`confetti confetti--${R.side}`,H.setAttribute("aria-hidden","true"),H.style.display="none",H.style.position="fixed",H.style.left="0px",H.style.top="0px",H.style.width=`${R.size}px`,H.style.height=`${Math.max(4,R.size*.6)}px`,H.style.background=R.color,H.style.borderRadius=R.borderRadius,H.style.transform="translate3d(0,0,0)",H.style.opacity="0",V.appendChild(H),c.current[R.id]=H}(document.body||f.current).appendChild(V),p.current=V}}catch{}},300);return()=>{if(d.current&&cancelAnimationFrame(d.current),clearTimeout(z),p.current){try{p.current.remove()}catch{}p.current=null}}},[e,a,s,l]),!e)return null;const x=n.jsx("div",{className:"party-container",ref:u,children:l.map(C=>n.jsx("span",{"aria-hidden":!0,ref:h=>{c.current[C.id]=h},className:`confetti confetti--${C.side}`,style:{width:`${C.size}px`,height:`${Math.max(4,C.size*.6)}px`,background:C.color,borderRadius:C.borderRadius}},`${C.id}-${s}`))});return typeof document<"u"?en.createPortal(x,f.current||document.body):x}const ws=e=>typeof e=="number"&&Number.isFinite(e)&&e>0?e:void 0;function lw({trigger:e=0,active:t=!1}){const[a,r]=o.useState(null);o.useEffect(()=>{if(typeof window>"u")return;const s=l=>{const u=l.detail??{};r(c=>({n:(c?.n??0)+1,count:ws(u.count),strength:ws(u.strength),duration:ws(u.duration)}))};return window.addEventListener("party:trigger",s),()=>window.removeEventListener("party:trigger",s)},[]);const i=o.useCallback(()=>r(null),[]);return n.jsxs(n.Fragment,{children:[n.jsx(_s,{active:t,trigger:e}),a&&n.jsx(_s,{active:!0,trigger:a.n,count:a.count,strength:a.strength,duration:a.duration,onComplete:i})]})}function uw({title:e,sub:t,rightAction:a,titleAction:r,badge:i,badgeVariant:s="default",documentTitle:l,onBack:u,backLabel:c,wrap:d=!1}){const{t:m}=xe.useTranslation();Iy(typeof e=="string"?e:l??null);const p=c??m("common.back","\uB4A4\uB85C");return n.jsxs("div",{className:d?"page-title page-title--wrap":"page-title",children:[n.jsxs("div",{className:"page-title__main",children:[n.jsxs("div",{className:"page-title__title-row",children:[u&&n.jsx(pe,{htmlType:"button",className:"page-title__back",size:48,type:"dot",icon:"chevron-left",iconSize:"large",useBorder:!1,iconColor:"var(--color-text-primary)",ariaLabel:p,showTooltipInfo:p,onClick:u}),n.jsx("h1",{className:"page-title__title h1",children:e}),i&&n.jsx("div",{className:"page-title__badge",children:n.jsx(At,{label:i,size:"small",variant:s,fill:"outline"})}),r?n.jsx("div",{className:"page-title__title-action",children:r}):null]}),t&&n.jsx("p",{className:"page-title__sub body-2",children:t})]}),a?n.jsx("div",{className:"page-title__action",children:a}):null]})}function cw(e){return e??""}const nd=o.createContext({words:[],loading:!1});function dw(){return o.useContext(nd)}function pw({words:e,loading:t,error:a,statusMessage:r,localVersion:i,remoteVersion:s,progress:l,clearAndRefetch:u,checkRemoteVersion:c,children:d}){const m=o.useMemo(()=>({words:e,loading:t,error:a,statusMessage:r,localVersion:i,remoteVersion:s,progress:l,clearAndRefetch:u,checkRemoteVersion:c}),[e,t,a,r,i,s,l,u,c]);return n.jsx(nd.Provider,{value:m,children:d})}function mw({items:e,actions:t,columns:a,flat:r=!1,className:i,style:s}){const l=a??e.length;return n.jsx("section",{className:_e("summary-strip",r&&"summary-strip--flat",i),style:{"--summary-strip-cols":String(l),...s},children:n.jsxs("div",{className:"summary-strip__row",children:[n.jsx("div",{className:"summary-strip__items",children:e.map((u,c)=>n.jsxs("div",{className:"summary-strip__item",children:[n.jsx("p",{className:"summary-strip__label caption-1",children:u.label}),n.jsx("p",{className:"summary-strip__value body-3b",title:typeof u.value=="string"||typeof u.value=="number"?String(u.value):void 0,children:u.value})]},c))}),t&&n.jsx("div",{className:"summary-strip__actions",children:t})]})})}const hw=(e,t)=>`${e} / ${t}`;function fw({blocks:e,sectionTitles:t,logo:a,footer:r,pageLabel:i=hw,pageWidth:s,pageHeight:l,margin:u,className:c,style:d}){const{t:m}=xe.useTranslation(),p=o.useRef(null),f=o.useRef(null),y=o.useRef(null),x=o.useRef(null),[C,h]=o.useState(null),[_,g]=o.useState(!1);o.useEffect(()=>{const L=p.current;if(!L)return;const M=()=>g(L.scrollWidth>L.clientWidth+1);if(M(),typeof ResizeObserver>"u")return;const $=new ResizeObserver(M);return $.observe(L),()=>$.disconnect()},[C]);const A=e.map(L=>`${L.id}\0${L.section??""}\0${L.group??""}`).join(""),b=C&&C.shape===A?C.pages:null,[k,v]=o.useState(0);o.useEffect(()=>{const L=x.current;if(!L||typeof ResizeObserver>"u")return;const M=new ResizeObserver(()=>v(L.offsetHeight));return M.observe(L),()=>M.disconnect()},[]);const[w,B]=o.useState(0);o.useEffect(()=>{const L=f.current;if(!L||typeof ResizeObserver>"u")return;let M=null;const $=typeof requestAnimationFrame=="function"?z=>requestAnimationFrame(z):z=>setTimeout(z,16),Z=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:z=>clearTimeout(z),q=new ResizeObserver(()=>{M==null&&(M=$(()=>{M=null,B(z=>z+1)}))});return Array.from(L.children).forEach(z=>q.observe(z)),()=>{q.disconnect(),M!=null&&Z(M)}},[A]),o.useLayoutEffect(()=>{const L=f.current,M=x.current;if(!L||!M)return;const $=S=>S.getBoundingClientRect().height||S.offsetHeight,Z=new Map;y.current?.querySelectorAll("[data-chrome-section]").forEach(S=>{Z.set(S.dataset.chromeSection??"",$(S))});const q=S=>$(M)-(Z.get(S??"")??0),z=Array.from(L.children).map(S=>$(S)),V=[];e.forEach((S,j)=>{const F=V[V.length-1],U=F?e[F[0]]:void 0;U&&S.group!=null&&U.group===S.group&&U.section===S.section?F.push(j):V.push([j])});const R=[];let H=[],W=0;const I=()=>{H.length&&R.push(H),H=[],W=0};V.forEach(S=>{const j=S.reduce((U,re)=>U+z[re],0),F=q(e[S[0]].section);H.length&&e[H[0]].section!==e[S[0]].section&&I(),j>F?S.forEach(U=>{H.length&&W+z[U]>F+.01&&I(),H.push(U),W+=z[U]}):(H.length&&W+j>F+.01&&I(),S.forEach(U=>H.push(U)),W+=j)}),I(),h(S=>S&&S.shape===A&&JSON.stringify(S.pages)===JSON.stringify(R)?S:{shape:A,pages:R})},[A,k,s,l,u,w]);const E=Eo,D=E,N=r??n.jsxs(n.Fragment,{children:[n.jsx("img",{src:D,alt:"IHAB",className:"report-doc__logo"}),"\xA9 IHAB, Inc. All rights reserved."]}),O=(L,M,$)=>({header:n.jsxs("div",{className:"report-doc__header",children:[n.jsx("h2",{className:"report-doc__title h3b",children:$!=null&&t?.[$]||null}),a]}),footer:n.jsxs("div",{className:"report-doc__footer caption-1",children:[n.jsx("span",{className:"report-doc__footer-left",children:N}),n.jsx("span",{className:"report-doc__page-no",children:i(L,M)})]})}),P=Array.from(new Set(e.map(L=>L.section??""))),G={...s?{"--report-page-w":s}:null,...l?{"--report-page-h":l}:null,...u?{"--report-margin":u}:null,...d};return n.jsxs("div",{ref:p,className:_e("report-doc",c),style:G,tabIndex:_?0:void 0,role:_?"group":void 0,"aria-label":_?m("report.previewRegion","\uBCF4\uACE0\uC11C \uBBF8\uB9AC\uBCF4\uAE30"):void 0,children:[n.jsxs("div",{className:"report-doc__measure","aria-hidden":!0,children:[n.jsx("div",{ref:x,className:"report-doc__ruler"}),n.jsx("div",{ref:y,children:P.map(L=>{const M=O(1,1,L||void 0);return n.jsxs("div",{"data-chrome-section":L,children:[M.header,M.footer]},L)})}),n.jsx("div",{ref:f,className:"report-doc__measure-blocks",children:e.map(L=>n.jsx("div",{children:L.content},L.id))})]}),b&&n.jsx("div",{className:"report-doc__pages",children:b.map((L,M)=>{const{header:$,footer:Z}=O(M+1,b.length,e[L[0]].section);return n.jsxs("section",{className:"report-doc__page",children:[$,L.map(q=>n.jsx("div",{children:e[q].content},e[q].id)),Z]},M)})})]})}function Cw({title:e,fields:t,columns:a=4,className:r,style:i}){return n.jsxs("div",{className:_e("report-info",r),style:{"--report-info-cols":String(a),...i},children:[e&&n.jsx("p",{className:"report-info__title h5b",children:e}),n.jsx("div",{className:"report-info__grid",children:t.map((s,l)=>n.jsxs("div",{className:"report-info__field body-2",children:[n.jsx("span",{className:"report-info__label body-3",children:s.label}),n.jsx("span",{className:"report-info__value",children:s.value})]},l))})]})}const ea=new Map;let Tr=null;const gw=12;function bw(e){for(let t=e.parentElement;t&&t!==document.body;t=t.parentElement){const a=window.getComputedStyle(t);if(a.transform&&a.transform!=="none"||a.filter&&a.filter!=="none"||a.perspective&&a.perspective!=="none"||/paint|layout|strict|content/.test(a.contain||""))return t}return document}function jr(){const e=new Map;for(const t of ea.keys()){if(!t.isConnected)continue;const a=bw(t),r=e.get(a)??[];r.push(t),e.set(a,r)}for(const t of e.values()){t.sort((r,i)=>r.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1);let a=0;for(const r of t){a>0?r.style.setProperty("--update-alert-stack-offset",`${a}px`):r.style.removeProperty("--update-alert-stack-offset");const i=r.getBoundingClientRect().height;i>0&&(a+=i+gw)}}}function yw(e){return typeof window>"u"?()=>{}:(ea.set(e,(ea.get(e)??0)+1),ea.get(e)===1&&typeof ResizeObserver<"u"&&(Tr??(Tr=new ResizeObserver(()=>jr())),Tr.observe(e)),jr(),()=>{const t=(ea.get(e)??1)-1;if(t>0){ea.set(e,t),jr();return}ea.delete(e),Tr?.unobserve(e),e.style.removeProperty("--update-alert-stack-offset"),jr()})}function vw({title:e,message:t,actionLabel:a,onAction:r,icon:i,onClose:s,className:l=""}){const{t:u}=xe.useTranslation(),c=a??u("common.update","\uC5C5\uB370\uC774\uD2B8"),d=o.useRef(null),m=o.useRef(!1);return o.useLayoutEffect(()=>{const p=d.current,f=p?.parentElement?.closest(".update-alert-stack")??p,y=f?yw(f):null;return()=>{y?.(),m.current&&p&&p.contains(document.activeElement)&&ar(p)}},[]),n.jsxs("div",{ref:d,className:_e("update-alert",l),role:"alert",children:[s&&n.jsx("button",{type:"button",className:"update-alert__close",onClick:()=>{m.current=!0,s()},"aria-label":u("common.close","\uB2EB\uAE30"),children:"\xD7"}),n.jsxs("div",{className:"update-alert__top",children:[n.jsx("div",{className:"update-alert__icon",children:i??n.jsx($s,{size:20,strokeWidth:2})}),n.jsxs("div",{className:"update-alert__body",children:[n.jsx("div",{className:"update-alert__title h4",children:e}),n.jsx("div",{className:"update-alert__message body-3",children:t})]})]}),r&&n.jsx(pe,{htmlType:"button",size:32,variant:"main",shape:"pill",className:"update-alert__action",onClick:r,children:c})]})}function xw({title:e,titleLevel:t=3,description:a,topActions:r,children:i,footerLeft:s,footerRight:l,ariaLabel:u,onClick:c,draggable:d,onDragStart:m,onDragEnd:p,className:f}){const y=t?`h${t}`:"div",x=s!=null||l!=null,C=i!=null&&i!==!1,h=o.useCallback(_=>{c&&_.target===_.currentTarget&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),c())},[c]);return n.jsxs("div",{className:_e("training-card",c?"training-card--clickable":"",f),onClick:c,onKeyDown:c?h:void 0,role:c?"button":void 0,"aria-label":c?u??(typeof e=="string"?e:void 0):void 0,tabIndex:c?0:void 0,draggable:d,onDragStart:m,onDragEnd:p,children:[n.jsxs("div",{className:"training-card__header",children:[n.jsxs("div",{className:"training-card__title-row",children:[typeof e=="string"?n.jsx(y,{className:"training-card__title h4",children:e}):e,r!=null&&n.jsx("div",{className:"training-card__top-actions",onClick:_=>_.stopPropagation(),children:r})]}),a!=null?typeof a=="string"?n.jsx("p",{className:"training-card__description body-3",children:a}):a:n.jsx("p",{className:"training-card__description body-3","aria-hidden":"true",children:" "})]}),C&&n.jsx("div",{className:"training-card__body",children:i}),x&&n.jsxs("div",{className:"training-card__footer",children:[s!=null&&n.jsx("div",{className:"training-card__footer-left",children:s}),l!=null&&n.jsx("div",{className:"training-card__meta",children:l})]})]})}function _w({title:e,titleLevel:t=3,count:a,collapsed:r=!1,onToggle:i,beforeSort:s,sort:l,actions:u,empty:c=!1,emptyContent:d,dragOver:m=!1,onDragOver:p,onDragLeave:f,onDrop:y,children:x,className:C}){const{t:h}=xe.useTranslation(),_=o.useId(),g=t?`h${t}`:"span",A=i!=null,b=_e("training-card-group",m&&"training-card-group--dragover",r&&"training-card-group--collapsed",A&&"training-card-group--collapsible",C);return n.jsxs("div",{className:b,onDragOver:p,onDragLeave:f,onDrop:y,role:typeof e=="string"&&e?"group":void 0,"aria-labelledby":typeof e=="string"&&e?_:void 0,children:[n.jsxs("header",{className:"training-card-group__header",children:[A&&n.jsx(pe,{htmlType:"button",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:r?"chevron-right":"chevron-down",ariaLabel:typeof e=="string"&&e?r?h("common.expandFor",{name:e}):h("common.collapseFor",{name:e}):r?h("common.expand","\uD3BC\uCE58\uAE30"):h("common.collapse","\uC811\uAE30"),className:"training-card-group__chevron","aria-expanded":!r,onClick:i}),typeof e=="string"?n.jsx(g,{id:_,className:"training-card-group__title h5b",children:e}):e,a!==void 0&&n.jsx("span",{className:"training-card-group__count body-3b",children:a}),(s!=null||l||u!=null)&&n.jsxs("span",{className:"training-card-group__actions",onClick:k=>k.stopPropagation(),children:[s,l&&n.jsx(pn,{size:40,options:l.options,value:l.value,placeholder:l.placeholder,onChange:l.onChange,ariaLabel:typeof e=="string"&&e?h("common.sortFor",{name:e}):void 0}),u]})]}),!r&&(c?n.jsx("div",{className:"training-card-group__empty body-3",children:d}):n.jsx("div",{className:"training-card-group__grid",children:x}))]})}const ww="speechear:saved_word_tables";function Bw(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.id=="string"&&typeof t.name=="string"&&Array.isArray(t.items)}function kw(){try{const e=localStorage.getItem(ww);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(Bw):[]}catch{return[]}}function ad(e){return{label:e.word,subLabel:e.pronunciation,colloquialLabel:e.colloquialPronunciation,homonum:e.homonum,grade:e.grade,syllables:[...e.word].length,pos:e.pos,wordType:e.wordType}}function Bs(e){return e.map(t=>t.homonum!=null?`${t.word}#${t.homonum}`:t.word).join("|")}function Aw(e){const t=new Set;return e.map(a=>{let r=a.id;for(let i=2;t.has(r);i++)r=`${a.id}~${i}`;return t.add(r),r===a.id?a:{...a,id:r}})}function Nw({title:e,titleIcon:t,disc:a,filterTitle:r,filterCollapsible:i,filterDefaultCollapsed:s,filterCollapsed:l,onFilterCollapsedChange:u,filterHeaderSummary:c,brand:d,code:m,items:p,onSaveComplete:f,onLoad:y,onRemoveItem:x,onReset:C,resetLabel:h,saveButtonLabel:_,secondarySaveButtonLabel:g,onReorder:A,showCellCount:b,onAddItem:k,className:v,renderSavePopup:w,renderWordSearch:B,hideControls:E,saveOnly:D,tableName:N,nameValue:O,onNameChange:P,descriptionValue:G,onDescriptionChange:L,namePlaceholder:M,descriptionPlaceholder:$,existingNames:Z,editingName:q,onCancel:z,initialItemsPerPage:V,renderCellAction:R,actionsLeftExtra:H}){const{t:W}=xe.useTranslation(),I=h??W("wordPrint.clearAllSelection","\uBAA8\uB450 \uC120\uD0DD \uD574\uC81C"),S=p===void 0,j=!!P,[F,U]=o.useState([]),re=(O??"").trim(),ne=re||(M??"").trim(),le=(G??"").trim()||($??"").trim(),K=(Z??[]).map(ae=>ae.trim().toLowerCase()),oe=[q?.trim().toLowerCase(),...F].filter(ae=>!!ae),Ae=[...K];for(const ae of oe){const ye=Ae.indexOf(ae);ye!==-1&&Ae.splice(ye,1)}const Y=re!==""&&Ae.includes(re.toLowerCase()),[Q,me]=o.useState(Array(4).fill(null)),[De,be]=o.useState(4),[te,ue]=o.useState(null),fe=Q.slice(0,De),ge=!!d?.show,[Ce,$e]=o.useState(!0),[He,Te]=o.useState(!0),Ie=d&&{...d,top:Ce,bottom:He},[qe,mt]=o.useState("landscape"),[ct,rt]=o.useState(["image","word","standardPron"]),[ft,ke]=o.useState("show"),[Ve,we]=o.useState(!0),[Ue,Be]=o.useState(!0),je=o.useRef(null),Se=o.useRef([]),[Xe,Qe]=o.useState(V==="all"?Number.POSITIVE_INFINITY:V??8),[dt,ht]=o.useState("right"),[wt,Ct]=o.useState(!1),[Nt,gt]=o.useState(!1),{toastMessage:it,toastType:Ke,showWarning:se,clearToast:Ne}=Ll("warning"),We=o.useCallback(()=>ue(null),[ue]);k&&!S&&!b&&St("word-table-block-add-without-cell-count",'[WordTableBlock] \uD45C\uC2DC \uBAA8\uB4DC\uC5D0\uC11C onAddItem \uC740 showCellCount \uC640 \uD568\uAED8 \uC918\uC57C "\uCD94\uAC00\uD558\uAE30" \uCE78\uC774 \uC0DD\uAE34\uB2E4.');const[nt,Fe]=o.useState(()=>Math.max(p?.length??1,1)),Ge=S?De:b?Math.max(nt,p?.length??1,1):Math.max(p?.length??0,1),{width:bt,height:Re}=ha[qe],tt=!S&&!b,xt=p?.length??0,Lt=Math.min(Xe,Math.max(xt,1)),et=tt?Lt:Ge,ot=tt?Hu(p??[],et):null,lt=!!ot&&ot.length>1,st=S?fe.some(ae=>ae!==null&&ae.length>1):(p??[]).some(ae=>(ae.words??[]).length>1),jt=N?.trim()||`${Ri(Ea())} ${st?W("wordTable.printFileNamePair","\uB300\uB9BD\uC30D\uD45C"):W("wordTable.printFileNameSingle","\uB2E8\uC5B4\uD45C")}`,Wt=o.useCallback(()=>lt?Se.current.filter(ae=>ae!==null):je.current?[je.current]:[],[lt]),{print:mn,openNewWindow:hn,downloadHtml:jn}=ns({getElements:Wt,paperW:bt,paperH:Re,fileName:jt,onPopupBlocked:()=>{se(W("wordTable.popupBlocked","\uD31D\uC5C5\uC774 \uCC28\uB2E8\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uBE0C\uB77C\uC6B0\uC800 \uC124\uC815\uC5D0\uC11C \uD31D\uC5C5\uC744 \uD5C8\uC6A9\uD574 \uC8FC\uC138\uC694."))}}),zn=ae=>{be(ae),me(ye=>ye.length>=ae?ye:[...ye,...Array(ae-ye.length).fill(null)]),ue(null)},Wn=ae=>{me(ye=>{const Le=[...ye];return Le[ae]=null,Le}),te===ae&&ue(null)},It=ae=>{if(te===null)return;const ye=te;me(ze=>{const ut=[...ze];return ut[ye]=ae.length>0?ae:null,ut});const Le=fe.findIndex((ze,ut)=>ut>ye&&ze===null);ue(Le!==-1?Le:null)},vn=S?fe.some(ae=>ae?.some(ye=>!!ye.colloquialPronunciation)):(p??[]).some(ae=>(ae.words??[]).some(ye=>!!ye.colloquialLabel)),Ft=o.useMemo(()=>aa()?S?Q.slice(0,De).flatMap(ae=>(ae??[]).map(ye=>[ye.word,ye.homonum])):(p??[]).flatMap(ae=>(ae.words??[]).map(ye=>[ye.label,ye.homonum])):[],[S,Q,De,p]),[Ht,Mn]=o.useState(!1);o.useEffect(()=>{if(Ft.length===0)return;let ae=!1;return Promise.all(Ft.map(([ye,Le])=>wi(ye,Le))).then(ye=>{ae||Mn(ye.some(Boolean))},()=>{}),()=>{ae=!0}},[Ft]);const on=Ft.length>0&&Ht,xn=o.useMemo(()=>[...S||b?[{label:W("wordTable.filter.columns","\uCE78 \uC218"),items:V4.map(ae=>({value:`${ae}\uCE78`,displayLabel:W("wordTable.filter.column",{count:ae})})),display:"segmented"}]:[],...tt&&(p?.length??0)>0?[sc(W,{hasPairs:st,itemCount:xt})]:[],...lt?[q4(W)]:[]],[W,S,b,tt,p?.length,st,xt,lt]),Hn={...S||b?{[W("wordTable.filter.columns","\uCE78 \uC218")]:`${Ge}\uCE78`}:{},...tt&&(p?.length??0)>0?{[W(st?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord")]:`${Lt}\uAC1C`}:{},...lt?{[W("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")]:dt}:{}},_n=(ae,ye)=>{ye===W("wordTable.filter.columns","\uCE78 \uC218")?S?zn(parseInt(ae)):Fe(parseInt(ae)):ye===W(st?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord")?Qe(ic(parseInt(ae),xt)):ye===W("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")&&ht(lc(ae))},Vt=S?Aw(fe.filter(ae=>ae!==null&&ae.length>0).map(ae=>({id:Bs(ae),words:ae.map(ad)}))):p??[],$t=()=>{S&&me(ae=>ae.length>De?ae.slice(0,De):ae)},qt=(ae=!1)=>{if(gt(ae),j&&f){const ye=ne.trim().toLowerCase();ye&&U(Le=>Le.includes(ye)?Le:[...Le,ye]),f(ne,Vt,le||void 0,ae),$t();return}if(D&&f){f("",Vt,void 0,ae),$t();return}if(f){Ct(!0);return}jn()},[fn,Ot]=o.useState(!1),[sn,Dt]=o.useState(""),ie=sn.trim(),ve=ie!==""&&K.includes(ie.toLowerCase()),Me=()=>{Dt(ne?W("wordTable.save.copyName",{name:ne,defaultValue:"{{name}} (\uBCF5\uC0AC)"}):""),Ot(!0)},Je=()=>{!ie||ve||!f||(f(ie,Vt,le||void 0,!0),$t(),Ot(!1))},Oe=Vt.length===0,Ye=Oe||j&&(ne===""||Y),J=()=>{if(Oe){se(W("wordTable.emptyItems","\uB2E8\uC5B4\uB97C 1\uAC1C \uC774\uC0C1 \uCD94\uAC00\uD574\uC8FC\uC138\uC694."));return}if(j&&ne===""){se(W("wordTable.save.nameRequired","\uD45C \uC774\uB984\uC744 \uC785\uB825\uD574 \uC8FC\uC138\uC694."));return}j&&Y&&se(W("wordTable.save.duplicateName","\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uC774\uB984\uC785\uB2C8\uB2E4."))},de=n.jsx(fa,{items:Vt,orientation:qe,contentTypes:ct,cutLine:ft,showOutline:Ve,showDivLine:Ue,count:Ge});return n.jsxs(n.Fragment,{children:[n.jsxs(ma,{type:"page",icon:t,title:e,disc:a,className:_e("word-table-block",v),children:[fn&&n.jsx(Fn,{size:"small",title:g??W("wordTable.saveAsNewButton","\uB2E4\uB978 \uC774\uB984\uC73C\uB85C \uC800\uC7A5"),onClose:()=>Ot(!1),footer:({closeWithAnimation:ae})=>n.jsxs(n.Fragment,{children:[n.jsx(pe,{htmlType:"button",size:48,type:"bar",label:W("common.cancel","\uCDE8\uC18C"),onClick:ae}),n.jsx(pe,{htmlType:"button",size:48,type:"bar",variant:"main",label:W("common.save","\uC800\uC7A5"),disabled:!ie||ve,onClick:Je})]}),children:n.jsx(Xn,{label:W("wordTable.save.nameLabel","\uC774\uB984"),value:sn,onChange:Dt,placeholder:W("wordTable.save.placeholder","\uC774 \uB2E8\uC5B4\uD45C\uC5D0 \uB300\uD55C \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694."),maxLength:40,size:48,fullWidth:!0,autoFocus:!0,onEnter:Je,error:ve?W("wordTable.save.duplicateName","\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uC774\uB984\uC785\uB2C8\uB2E4."):void 0})}),wt&&f&&w?.({defaultName:typeof e=="string"?e:W("wordTable.defaultName","\uB2E8\uC5B4 \uD45C"),preview:de,previewW:bt,previewH:Re,items:Vt,existingNames:kw().map(ae=>ae.name),saveAsNew:Nt,onSave:(ae,ye)=>{f(ae,Vt,ye,Nt),$t(),Ct(!1)},onCancel:()=>Ct(!1)}),(S||k)&&te!==null&&B?.({cellIndex:te,onConfirm:S?It:ae=>{if(k){const ye=ae[0];if(ye){const Le=new Set((p??[]).map(ut=>ut.id));let ze=Bs([ye]);for(let ut=2;Le.has(ze);ut++)ze=`${Bs([ye])}~${ut}`;k({id:ze,words:[ad(ye)]})}}ue(null)},onClose:We}),!E&&n.jsx(Jo,{title:r,collapsible:i,defaultCollapsed:s,collapsed:l,onCollapsedChange:u,headerSummary:c,hasImage:on,hasColloquial:vn,contentTypes:ct,orientation:qe,showOutline:Ve,cutLine:ft,showDivLine:Ue,setters:{setContentTypes:rt,setOrientation:mt,setShowOutline:we,setCutLine:ke,setShowDivLine:Be,setShowTopInfo:$e,setShowBottomInfo:Te},showCutLine:(tt?et:Ge)>1,showDivLine2:st,middleSections:xn,extraSelected:Hn,onExtraSelect:_n,showPaperBands:ge,showTopInfo:Ce,showBottomInfo:He}),lt&&ot?n.jsx("div",{className:"word-table-block__pages",children:ot.map((ae,ye)=>n.jsx(fa,{orientation:qe,contentTypes:ct,cutLine:ft,showOutline:Ve,showDivLine:Ue,count:et,items:ae,onRemoveItem:x,onReorder:A&&((Le,ze)=>A(Le+ye*et,ze+ye*et)),renderCellAction:R&&((Le,ze)=>R(Le+ye*et,ze)),brand:Ie,code:m,contentRef:Le=>{Se.current[ye]=Le},pageNumber:{current:ye+1,total:ot.length},pageNumberPosition:dt},ye))}):n.jsx(fa,{orientation:qe,contentTypes:ct,cutLine:ft,showOutline:Ve,showDivLine:Ue,count:Ge,items:S?void 0:p??[],editCells:S?fe:void 0,activeCell:te,onActivateCell:S||k?ue:void 0,onRemoveCell:S?Wn:void 0,onRemoveItem:S?void 0:x,onReorder:S?void 0:A,renderCellAction:S?void 0:R,brand:Ie,code:m,showFillerAdd:!!k,contentRef:je}),!E&&!D&&(C||H!=null)&&n.jsxs("div",{className:"word-table-block__table-actions",children:[C&&n.jsx(pe,{htmlType:"button",size:48,type:"bar",label:I,onClick:C}),H]}),j&&!E&&n.jsxs(Br,{size:"medium",labelWidth:64,useBorder:!1,useRowBorder:!1,className:"word-table-block__meta",children:[n.jsx(Sn,{variant:"custom",label:W("wordTable.save.nameLabel","\uC774\uB984"),required:!0,align:"vertical",useFullWidth:!0,children:n.jsx(Xn,{required:!0,value:O??"",onChange:P,placeholder:M?M+W("wordTable.save.autoFillHint"," (Tab \uB610\uB294 space \uC785\uB825\uC2DC \uC790\uB3D9 \uC785\uB825)"):W("wordTable.save.placeholder","\uC774 \uB2E8\uC5B4\uD45C\uC5D0 \uB300\uD55C \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694."),ariaLabel:W("wordTable.save.nameLabel","\uC774\uB984"),maxLength:40,size:48,fullWidth:!0,error:Y?W("wordTable.save.duplicateName","\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uC774\uB984\uC785\uB2C8\uB2E4."):void 0,onKeyDown:ae=>{(ae.key==="Tab"&&!ae.shiftKey||ae.key===" ")&&!(O??"").trim()&&(M??"").trim()&&(ae.preventDefault(),P?.(M??""))}})}),n.jsx(Sn,{variant:"custom",label:W("wordTable.save.descriptionLabel","\uC124\uBA85"),align:"vertical",useFullWidth:!0,children:n.jsx(Xn,{value:G??"",onChange:L,placeholder:$?$+W("wordTable.save.autoFillHint"," (Tab \uB610\uB294 space \uC785\uB825\uC2DC \uC790\uB3D9 \uC785\uB825)"):W("wordTable.save.descriptionPlaceholder","\uC774 \uB2E8\uC5B4\uD45C\uC5D0 \uB300\uD55C \uC124\uBA85\uC744 \uC785\uB825\uD558\uC138\uC694."),ariaLabel:W("wordTable.save.descriptionLabel","\uC124\uBA85"),maxLength:200,multiline:!0,rows:2,fullWidth:!0,onKeyDown:ae=>{(ae.key==="Tab"&&!ae.shiftKey||ae.key===" ")&&!(G??"").trim()&&($??"").trim()&&(ae.preventDefault(),L?.($??""))}})})]})]}),!E&&n.jsxs("div",{className:"word-table-block__actions",children:[n.jsxs("div",{className:"word-table-block__actions-left",children:[!D&&y&&n.jsx(pe,{htmlType:"button",size:40,type:"bar",label:W("wordTable.load","\uBD88\uB7EC\uC624\uAE30"),onClick:y}),!D&&n.jsx(pe,{htmlType:"button",size:40,type:"bar",label:W("wordTable.openNewWindow","\uC0C8 \uCC3D\uC73C\uB85C \uBCF4\uAE30"),onClick:hn})]}),n.jsxs("div",{className:"word-table-block__actions-right",children:[z&&n.jsx(pe,{htmlType:"button",size:"56",type:"bar",label:W("common.cancel","\uCDE8\uC18C"),onClick:z}),!D&&n.jsx(pe,{htmlType:"button",size:"56",type:"bar",label:W("wordTable.print","\uC778\uC1C4\uD558\uAE30"),onClick:mn}),g&&n.jsx(pe,{htmlType:"button",size:"56",type:"bar",label:g,onClick:()=>j?Me():qt(!0),disabled:Oe,onDisabledClick:()=>{se(W("wordTable.emptyItems","\uB2E8\uC5B4\uB97C 1\uAC1C \uC774\uC0C1 \uCD94\uAC00\uD574\uC8FC\uC138\uC694."))}}),n.jsx(pe,{htmlType:"button",size:"56",type:"bar",variant:"main",label:_??W("wordTable.saveButton","\uC800\uC7A5\uD558\uAE30"),onClick:()=>qt(!1),disabled:Ye,onDisabledClick:J})]})]}),n.jsx(da,{message:it,type:Ke,onClose:Ne})]})}function rd({items:e,className:t}){const a=e.length,r=a<=3?1:2,i=Math.ceil(a/r)||1,s=r*i;return n.jsx("div",{className:_e("word-table-thumb",t),style:{gridTemplateColumns:`repeat(${r}, 1fr)`},children:Array.from({length:s},(l,u)=>{const c=e[u];return c?n.jsx("div",{className:"word-table-thumb__cell",children:(c.words?.length?c.words:[{label:c.id}]).map((d,m)=>n.jsxs(o.Fragment,{children:[m>0&&n.jsx("span",{className:"word-table-thumb__divider"}),n.jsx("span",{className:"word-table-thumb__word body-3",children:d.label})]},m))},u):n.jsx("div",{className:"word-table-thumb__cell word-table-thumb__cell--empty"},u)})})}function Ew({items:e,name:t,description:a,createdAt:r,code:i,published:s,publishedLabel:l,shared:u,sharedLabel:c,isNew:d,publisherName:m,publishedAt:p,likeCount:f,downloadCount:y,onPublisherClick:x,selected:C,onClick:h,onMore:_,titleNode:g,className:A}){const{t:b}=xe.useTranslation(),k=g!=null,v=m!=null||p!=null||f!=null||y!=null,w=B=>{B.target===B.currentTarget&&!k&&(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),h?.())};return n.jsxs("div",{className:_e("word-table-button",C?"word-table-button--selected":"",v?"":"word-table-button--no-footer",A),role:"button",tabIndex:0,"aria-label":i?`${t} (${i})`:t,onClick:k?void 0:h,onKeyDown:w,children:[d&&n.jsx("span",{className:"word-table-button__new-dot","aria-label":b("myWordTable.newBadge","\uC0C8\uB85C \uB9CC\uB4E0 \uD45C")}),n.jsx(rd,{items:e,className:"word-table-button__thumb"}),n.jsxs("div",{className:"word-table-button__info",children:[n.jsxs("div",{className:"word-table-button__info-text",children:[g??n.jsx("div",{className:"word-table-button__title h4",children:t}),a&&n.jsx("div",{className:"word-table-button__desc body-3",children:a})]}),_&&!k&&n.jsx(pe,{htmlType:"button",className:"word-table-button__more",size:32,type:"dot",variant:"transparent-gray",useBorder:!1,icon:"ellipsis",ariaLabel:b("common.moreFor",{name:t}),onClick:B=>{B.stopPropagation(),_(B)}})]}),(i||r||s||u)&&n.jsxs("div",{className:"word-table-button__meta-row",children:[n.jsx("span",{className:"word-table-button__meta-left",children:n.jsx("span",{className:"word-table-button__meta caption-1",children:r?$i(r,b):""})}),n.jsxs("span",{className:"word-table-button__meta-right",children:[(s||u)&&n.jsxs("span",{className:"word-table-button__badges",children:[s&&n.jsx(At,{className:"word-table-button__badge",size:"small",variant:"main",fill:"soft",iconLeft:"book-marked",label:l??b("myWordTable.publishedBadge","\uBC1C\uD589\uB428")}),u&&n.jsx(At,{className:"word-table-button__badge",size:"small",fill:"soft",iconLeft:"link",label:c??b("myWordTable.sharedBadge","\uACF5\uC720 \uC911")})]}),i&&n.jsx("span",{className:"word-table-button__code caption-1",children:i})]})]}),v&&n.jsxs("div",{className:"word-table-button__footer",children:[n.jsxs("span",{className:"word-table-button__store-by",children:[m&&(x?n.jsx("button",{className:"training-card__publisher body-4",type:"button","aria-label":b("wordTable.publisherFilter",{name:m,defaultValue:"{{name}} \uAC8C\uC2DC\uD55C \uAC83\uB9CC \uBCF4\uAE30"}),onClick:B=>{B.stopPropagation(),x()},children:m}):n.jsx("span",{className:"training-card__publisher training-card__publisher--static body-4",children:m})),p&&n.jsx("span",{className:"training-card__date body-4",children:$i(p,b)})]}),n.jsxs("span",{className:"word-table-button__store-stats",children:[f!=null&&n.jsx(At,{size:"small",fill:"soft",variant:"like",iconLeft:"heart",label:String(f),"aria-label":b("common.likeCount",{count:f,defaultValue:`\uC88B\uC544\uC694 ${f}`})}),y!=null&&n.jsx(At,{size:"small",fill:"soft",variant:"main",iconLeft:"download",label:String(y),"aria-label":b("common.downloadCount",{count:y,defaultValue:`\uAC00\uC838\uAC04 \uC218 ${y}`})})]})]})]})}/**
|
|
1070
1070
|
* @license lucide-react v1.38.0 - ISC
|
|
1071
1071
|
*
|
|
1072
1072
|
* This source code is licensed under the ISC license.
|
|
1073
1073
|
* See the LICENSE file in the root directory of this source tree.
|
|
1074
|
-
*/const
|
|
1074
|
+
*/const Dw=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Sw=ee("image",Dw);/**
|
|
1075
1075
|
* @license lucide-react v1.38.0 - ISC
|
|
1076
1076
|
*
|
|
1077
1077
|
* This source code is licensed under the ISC license.
|
|
1078
1078
|
* See the LICENSE file in the root directory of this source tree.
|
|
1079
|
-
*/const Sw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Tw=ee("circle-x",Sw);function jw(e){return{idle:0,"word-download":1,"image-list":2,"image-match":2,"pair-build":3,done:4}[e]??0}function ks({icon:e,label:t,state:a,pct:r,subText:i}){const{t:s}=xe.useTranslation(),l=a==="done",u=a==="pending",c=a==="error",d=l?100:r??0;return n.jsxs("div",{className:"wdup-phase-card",children:[n.jsx("div",{className:`wdup-phase-card__icon${l?" wdup-phase-card__icon--done":c?" wdup-phase-card__icon--error":""}`,children:l?n.jsx(Fs,{size:22,color:"white",strokeWidth:2.5}):c?n.jsx(Tw,{size:22,color:"white",strokeWidth:2.5}):n.jsx("span",{className:`wdup-phase-card__icon-inner${u?" wdup-phase-card__icon-inner--pending":""}`,children:e})}),n.jsxs("div",{className:"wdup-phase-card__body",children:[n.jsxs("div",{className:"wdup-phase-card__top",children:[n.jsx("span",{className:`wdup-phase-card__label body-2${u?" wdup-phase-card__label--pending":""}`,children:t}),l?n.jsx(At,{variant:"sub",fill:"soft",size:"small",label:s("common.done","\uC644\uB8CC")}):c?n.jsx(At,{variant:"danger",fill:"soft",size:"small",label:s("common.failed","\uC2E4\uD328")}):(i||r!==void 0)&&n.jsxs("span",{className:"wdup-phase-card__sub body-3",children:[i,i&&r!==void 0?` \xB7 ${r}%`:r!==void 0?`${r}%`:""]})]}),!u&&n.jsx("div",{className:"wdup-bar",children:n.jsx("div",{className:`wdup-bar__fill${l?" wdup-bar__fill--done":c?" wdup-bar__fill--error":""}${a==="active"&&r===void 0?" wdup-bar__fill--indeterminate":""}`,style:{width:r!==void 0||l||c?`${c?100:d}%`:void 0}})})]})]})}function Mw({title:e,progress:t,onDone:a,onRetry:r,onClose:i,inline:s}){const{t:l}=xe.useTranslation(),{phase:u,error:c,wordCount:d,imagePage:m,imageDone:p,imageTotal:f,pairPercent:y}=t,x=jw(u),C=u==="done",h=!!c;function _(w){return h&&x===w?"error":x>w?"done":x===w?"active":"pending"}const g=_(1),A=_(2),b=_(3),k=u==="image-match"&&f?Math.round((p??0)/f*100):void 0,v=o.useMemo(()=>{if(A!=="done"){if(u==="image-list")return l("wordData.checkingPage",{page:m??1});if(u==="image-match"&&f)return l("wordData.imageCount",{done:so(p),total:so(f)})}},[A,u,m,f,p,l]);return n.jsx(Fn,{inline:s,className:"popup--word-data-update",title:e,footer:h&&r?n.jsx(pe,{htmlType:"button",size:56,variant:"main",onClick:r,children:l("common.retry","\uB2E4\uC2DC \uC2DC\uB3C4")}):h?n.jsx(pe,{htmlType:"button",size:56,variant:"main",onClick:i??a,children:l("common.close","\uB2EB\uAE30")}):n.jsx(pe,{htmlType:"button",size:56,variant:"main",disabled:!C,onClick:a,children:l("common.done","\uC644\uB8CC")}),children:n.jsxs("div",{className:"wdup-cards",children:[n.jsx(ks,{icon:n.jsx(Ls,{size:22,color:"var(--color-main, #29b6c8)",strokeWidth:1.8}),label:l("wordData.phaseWordDownload","\uB2E8\uC5B4 \uB370\uC774\uD130 \uB2E4\uC6B4\uB85C\uB4DC"),state:g,subText:g==="active"?l("wordData.downloadingCount",{n:so(d),count:d}):void 0}),n.jsx(ks,{icon:n.jsx(Dw,{size:22,color:"var(--color-main, #29b6c8)",strokeWidth:1.8}),label:l("wordData.phaseImageCheck","\uC774\uBBF8\uC9C0 \uD655\uC778"),state:A,pct:k,subText:v}),n.jsx(ks,{icon:n.jsx(Ps,{size:22,color:"var(--color-main, #29b6c8)",strokeWidth:1.8}),label:l("wordData.phasePairAnalysis","\uB2E8\uC5B4\uC30D \uBD84\uC11D"),state:b,pct:b==="active"?y??0:void 0,subText:void 0})]})})}function Lw({enabled:e=!1,renderResultPopup:t}={}){const{t:a}=xe.useTranslation(),[r,i]=o.useState(null),[s,l]=o.useState(null),u=y=>{let x=null;y==="noise"?x={score:3,contextsLength:5,results:[{sentence:"\uBB38\uC7A5 A",judgement:!0,wording:"\uC798 \uB4E4\uB9BC",useAnswer:!1},{sentence:"\uBB38\uC7A5 B",judgement:!1,wording:"\uC548 \uB4E4\uB9BC",useAnswer:!1},{sentence:"\uBB38\uC7A5 C",judgement:!0,wording:"\uC798 \uB4E4\uB9BC",useAnswer:!1},{sentence:"\uBB38\uC7A5 D",judgement:null,wording:"\uC548 \uD568",useAnswer:!1},{sentence:"\uBB38\uC7A5 E",judgement:!1,wording:"\uC548 \uB4E4\uB9BC",useAnswer:!1}]}:y==="short"?x={score:2,contextsLength:3,results:[{sentence:"\uBE44\uBE54\uBC25 \uC124\uBA85",answer:"\uBE44\uBE54\uBC25",selected:"\uBE44\uBE54\uBC25",selectedText:"\uBE44\uBE54\uBC25",correct:!0},{sentence:"\uBCF4\uC308 \uC124\uBA85",answer:"\uBCF4\uC308",selected:"\uC871\uBC1C",selectedText:"\uC871\uBC1C",correct:!1},{sentence:"\uCE7C\uAD6D\uC218 \uC124\uBA85",answer:"\uCE7C\uAD6D\uC218",selected:void 0,selectedText:void 0,correct:void 0}]}:y==="long"?x={score:4,contextsLength:4,results:[{sentence:"\uAE34 \uC774\uC57C\uAE30 1",answer:"\uC815\uB2F5 \uD14D\uC2A4\uD2B8 1",selectedText:"\uC815\uB2F5 \uD14D\uC2A4\uD2B8 1",correct:!0},{sentence:"\uAE34 \uC774\uC57C\uAE30 2",answer:"\uC815\uB2F5 \uD14D\uC2A4\uD2B8 2",selectedText:"\uC120\uD0DD \uD14D\uC2A4\uD2B8 2",correct:!1},{sentence:"\uAE34 \uC774\uC57C\uAE30 3",answer:"\uC815\uB2F5 \uD14D\uC2A4\uD2B8 3",selectedText:void 0,correct:void 0},{sentence:"\uAE34 \uC774\uC57C\uAE30 4",answer:"\uC815\uB2F5 \uD14D\uC2A4\uD2B8 4",selectedText:"\uC815\uB2F5 \uD14D\uC2A4\uD2B8 4",correct:!0}]}:y==="order"&&(x={score:1,contextsLength:2,results:[{sentence:"\uC21C\uC11C \uBB38\uC81C 1",answer:"1,2,3",selectedText:"1,2,3",correct:!0},{sentence:"\uC21C\uC11C \uBB38\uC81C 2",answer:"A,B,C",selectedText:"B,A,C",correct:!1}]}),l(x),i(y)},c=o.useCallback(()=>{i(null),l(null)},[]),d=o.useCallback(()=>u("noise"),[]),m=o.useCallback(()=>u("short"),[]),p=o.useCallback(()=>u("long"),[]),f=o.useCallback(()=>u("order"),[]);return e?n.jsxs("div",{className:"debug-result-launcher",children:[n.jsxs("div",{className:"debug-buttons",children:[n.jsx("button",{type:"button",className:"debug-button",onClick:d,children:a("debug.showResult",{type:"Noise",defaultValue:"{{type}} \uACB0\uACFC\uBCF4\uAE30"})}),n.jsx("button",{type:"button",className:"debug-button",onClick:m,children:a("debug.showResult",{type:"ShortStory",defaultValue:"{{type}} \uACB0\uACFC\uBCF4\uAE30"})}),n.jsx("button",{type:"button",className:"debug-button",onClick:p,children:a("debug.showResult",{type:"LongStory",defaultValue:"{{type}} \uACB0\uACFC\uBCF4\uAE30"})}),n.jsx("button",{type:"button",className:"debug-button",onClick:f,children:a("debug.showResult",{type:"Order",defaultValue:"{{type}} \uACB0\uACFC\uBCF4\uAE30"})})]}),r&&s?t?.({score:s.score,contextsLength:s.contextsLength,results:s.results,onReplay:c,onClose:c}):null]}):null}exports.Accordion=i2,exports.ActionCard=Ny,exports.Alert=X2,exports.AppHeader=m2,exports.AudioMeter=zo,exports.AudioPlayer=ds,exports.Avatar=rv,exports.Badge=At,exports.BarChart=Yv,exports.BarChartControls=xu,exports.Board=_v,exports.BottomNav=Il,exports.BrandIdentity=Hl,exports.BrandLogo=Wv,exports.Breadcrumb=iv,exports.BulkBar=$v,exports.Button=pe,exports.CORE_VERSION=gy,exports.Calendar=C4,exports.CardStep=Gc,exports.ChartLegend=Mo,exports.ChartSection=Lo,exports.ChartTotal=Wa,exports.Checkbox=fu,exports.ChoiceChips=Bx,exports.CircleBadge=G2,exports.CodeBox=Mv,exports.ColorPicker=pv,exports.CompanyMeta=Ev,exports.ConfirmPopup=ed,exports.ConfirmStep=Vc,exports.ConfirmWithTextStep=qc,exports.ContrastFilterPanel=tw,exports.CoreScope=Ey,exports.CountTile=bv,exports.CouponInputPopup=rw,exports.DEFAULT_NOISE_SETTINGS=Ga,exports.DatePicker=zv,exports.DebugResultLauncher=Lw,exports.DescriptionTooltip=Kn,exports.DeviceSideTable=m4,exports.Dialog=xv,exports.Divider=K2,exports.Dropdown=pn,exports.EffectPartyPopper=_s,exports.EffectPartyPopperHost=iw,exports.EmptyState=ky,exports.ErrorState=Ay,exports.FILTER_ALL_VALUE=dn,exports.FileUpload=sv,exports.FilterPanel=Dn,exports.FilterSectionInfo=Pa,exports.Footer=kx,exports.GameIntro=Jv,exports.Header=Vl,exports.Icon=at,exports.IconGridMenu=wx,exports.IconRenderer=at,exports.InfoTooltip=Bn,exports.ItemActions=Pv,exports.LEVEL_MAX=ga,exports.LINE_CHART_HOVER_DELAY_MS=_u,exports.LandingBottomSticky=Nx,exports.LandingHeader=Ax,exports.LineChart=Xv,exports.ListPopup=nw,exports.ListenStep=Hc,exports.Loader=za,exports.MARKS=gr,exports.MARK_ICON=Ou,exports.MARK_VARIANT=zu,exports.MediaQueryOverrideContext=Gi,exports.MenuTooltip=La,exports.NOISE_RATIO_MAX=Va,exports.NOISE_RATIO_STEP=fc,exports.NoisePlayerContext=is,exports.NoiseSettingsTooltip=$c,exports.NoticeBox=Dy,exports.OrderListStep=Uc,exports.PASS_CARD_BG_VARS=Zn,exports.POS_LABEL=Vu,exports.PROMO_BANNER_BG_COMPONENTS=kl,exports.PROMO_BANNER_BG_OPTIONS=Ry,exports.PROMO_BANNER_BG_VARS=Sa,exports.Page=Ar,exports.PageTitle=lw,exports.Pagination=dr,exports.Panel=Br,exports.PanelGrid=f_,exports.PanelRow=Sn,exports.PanelRowDevice=h_,exports.PassCard=eu,exports.PassCardBg=H2,exports.PassCardBgIHAB=V2,exports.PassCardBgLeftColorGrid=q2,exports.PassCardBgTwoCircle=Yl,exports.PaymentPlan=W2,exports.PersonCard=wv,exports.PhonemeFilterPanel=ew,exports.PhonemeSelectBlock=J_,exports.Popup=Fn,exports.ProgressBar=o4,exports.ProgressIndicator=Tu,exports.PromoBanner=r2,exports.PromoBannerBgDark=cl,exports.PromoBannerBgDeep=rl,exports.PromoBannerBgDiagonal=hl,exports.PromoBannerBgDots=Cl,exports.PromoBannerBgInstagram=Bl,exports.PromoBannerBgMain=Ji,exports.PromoBannerBgNaver=_l,exports.PromoBannerBgOutline=bl,exports.PromoBannerBgRadial=pl,exports.PromoBannerBgSoft=el,exports.PromoBannerBgSoftSub=sl,exports.PromoBannerBgSub=nl,exports.PromoBannerBgSuccess=vl,exports.PromoBannerBgWarm=ll,exports.PublicationCard=kv,exports.Radio=ru,exports.RadioGroup=Y2,exports.Rating=uv,exports.ReportDocument=hw,exports.ReportInfoPanel=fw,exports.RingChart=e4,exports.SENTENCE_TRAINING_TYPES=as,exports.SearchSummary=ev,exports.Section=ma,exports.SectionHeadFloat=gu,exports.SectionHeader=Nv,exports.SegmentedControl=gn,exports.ShortcutBadge=au,exports.SideNav=Wl,exports.Slider=Nu,exports.SoundCompass=U2,exports.SplashLogo=Av,exports.StatChart=t4,exports.SummaryStrip=pw,exports.TRAINING_TOOLTIP_HOVER_DELAY_MS=su,exports.Table=Ho,exports.TableFilterPanel=Jo,exports.Tabs=tv,exports.TextBoxTooltip=wr,exports.TextField=Xn,exports.Timeline=Bv,exports.Toast=da,exports.Toggle=hu,exports.Toolbar=jo,exports.Tooltip=cn,exports.TooltipInfo=Bn,exports.TooltipTextBox=wr,exports.TopBanner=o2,exports.TrainingBlock=b4,exports.TrainingBlockButton=Do,exports.TrainingBlockGrid=v4,exports.TrainingCard=vw,exports.TrainingCardGroup=xw,exports.TrainingPagePopup=On,exports.TrainingPagePopupBottom=Rc,exports.TrainingPagePopupTitle=Pc,exports.TrainingResultPopup=Xc,exports.TrainingStep=Jn,exports.TrainingStepAudioPlayer=ds,exports.TrainingStepBullet=Nc,exports.TrainingStepCard=Tc,exports.TrainingStepConfirm=ms,exports.TrainingStepConfirmWithText=hs,exports.TrainingStepListen=fs,exports.TrainingStepOrderList=Cs,exports.TrainingStepTextBox=Sc,exports.TrainingStepTitle=Dc,exports.TrainingTooltip=iu,exports.TrainingWordCard=Go,exports.UpdateAlert=yw,exports.WAVE_A_MAX=zx,exports.WAVE_H1_PX=us,exports.WAVE_HMAX_PX=Ox,exports.WORD_LABEL_I18N_KEYS=S4,exports.WORD_TABLE_PAPER=ha,exports.WORD_TYPE_LABEL=qu,exports.WordDataProvider=dw,exports.WordDataUpdatePopup=Mw,exports.WordImageTooltip=Qc,exports.WordSearchFilterPanel=Q_,exports.WordSearchResultBlock=Z_,exports.WordTable=fa,exports.WordTableBlock=Aw,exports.WordTableButton=Nw,exports.WordTablePopup=Y4,exports.WordTableThumbnail=rd,exports.buildMonthChartData=Vv,exports.cellKey=ax,exports.cellLabel=nx,exports.cellsForLabels=fx,exports.clearPassCardBgTheme=Nn,exports.clearPromoBannerBgTheme=Kt,exports.closeTrainingPopup=v_,exports.companyTypeLabel=uw,exports.createTrainingScenario=w_,exports.cx=_e,exports.deriveNoiseContexts=D_,exports.derivePassCard=Ul,exports.draftValues=xx,exports.effectiveNoiseVolume=os,exports.effectiveSpeechVolume=gc,exports.expandSlashLabel=Xo,exports.formatDuration=Cx,exports.getControlDateRange=Qv,exports.getPayloadTimestamp=bs,exports.getPromoBannerBgTheme=go,exports.getSelectedFromPayload=k_,exports.getSelectedText=A_,exports.getStepPayload=zc,exports.getSteppedPayload=N_,exports.injectPassCardBgTheme=An,exports.injectPromoBannerBgTheme=Gt,exports.isSelectionCorrect=E_,exports.labelOfCellKey=mc,exports.labelsForSave=tx,exports.levelToPct=Dx,exports.markAfterClick=Fu,exports.marksForSave=Ko,exports.mergeNoiseSettings=Ua,exports.missesByType=dx,exports.monthKeyOf=Ha,exports.monthKeyOfDate=$o,exports.nextFocus=ix,exports.nextMisses=cx,exports.noiseElementVolume=ss,exports.noiseRatioOf=qa,exports.pageStartIndexes=Wu,exports.parseMonthKey=ca,exports.passCardBgIhabTheme=tu,exports.passCardBgLeftColorGridTheme=nu,exports.passCardBgTwoCircleTheme=Kl,exports.pctToLevel=Sx,exports.posLabels=Uu,exports.printWordTable=A4,exports.promoBannerBgDarkTheme=ul,exports.promoBannerBgDeepTheme=al,exports.promoBannerBgDiagonalTheme=ml,exports.promoBannerBgDotsTheme=fl,exports.promoBannerBgInstagramTheme=wl,exports.promoBannerBgMainTheme=Xi,exports.promoBannerBgNaverTheme=xl,exports.promoBannerBgOutlineTheme=gl,exports.promoBannerBgRadialTheme=dl,exports.promoBannerBgSoftSubTheme=ol,exports.promoBannerBgSoftTheme=Qi,exports.promoBannerBgSubTheme=tl,exports.promoBannerBgSuccessTheme=yl,exports.promoBannerBgWarmTheme=il,exports.recommendTables=mx,exports.regenerateUnpinned=vx,exports.removeItem=yx,exports.resolveTrainingItems=__,exports.resolveTrainingPopupMeta=Fc,exports.reviewCells=X4,exports.reviewMeta=ex,exports.reviewSetPlan=px,exports.reviewTableName=Q4,exports.scoreKey=Cr,exports.scoreSheetHeader=rx,exports.shouldConfirmDiscard=k4,exports.splitTrainingVariants=x_,exports.summarize=B4,exports.summarizeMisses=ux,exports.tableTrends=sx,exports.toDraft=gx,exports.toTrainingText=B_,exports.togglePin=bx,exports.uncoveredLabels=hx,exports.useAnchoredMenu=Ma,exports.useBarChartControl=vu,exports.useCalendarMonth=Cu,exports.useComboboxSuggestions=pu,exports.useDiscardGuard=aw,exports.useFitScale=Yu,exports.useNoisePlayer=yr,exports.useSoundCompassExam=e2,exports.useToastLifecycle=Du,exports.useWordData=cw,exports.useWordTableDisplaySettings=dc,exports.useWordTablePrint=ns,exports.waveBarPx=xr,exports.waveBarVal=_r,exports.weakItems=ox,exports.weekValueOf=Ro,exports.withStepTimes=Oc,exports.wordTypeLabels=Gu;
|
|
1079
|
+
*/const Tw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],jw=ee("circle-x",Tw);function Mw(e){return{idle:0,"word-download":1,"image-list":2,"image-match":2,"pair-build":3,done:4}[e]??0}function ks({icon:e,label:t,state:a,pct:r,subText:i}){const{t:s}=xe.useTranslation(),l=a==="done",u=a==="pending",c=a==="error",d=l?100:r??0;return n.jsxs("div",{className:"wdup-phase-card",children:[n.jsx("div",{className:`wdup-phase-card__icon${l?" wdup-phase-card__icon--done":c?" wdup-phase-card__icon--error":""}`,children:l?n.jsx(Fs,{size:22,color:"white",strokeWidth:2.5}):c?n.jsx(jw,{size:22,color:"white",strokeWidth:2.5}):n.jsx("span",{className:`wdup-phase-card__icon-inner${u?" wdup-phase-card__icon-inner--pending":""}`,children:e})}),n.jsxs("div",{className:"wdup-phase-card__body",children:[n.jsxs("div",{className:"wdup-phase-card__top",children:[n.jsx("span",{className:`wdup-phase-card__label body-2${u?" wdup-phase-card__label--pending":""}`,children:t}),l?n.jsx(At,{variant:"sub",fill:"soft",size:"small",label:s("common.done","\uC644\uB8CC")}):c?n.jsx(At,{variant:"danger",fill:"soft",size:"small",label:s("common.failed","\uC2E4\uD328")}):(i||r!==void 0)&&n.jsxs("span",{className:"wdup-phase-card__sub body-3",children:[i,i&&r!==void 0?` \xB7 ${r}%`:r!==void 0?`${r}%`:""]})]}),!u&&n.jsx("div",{className:"wdup-bar",children:n.jsx("div",{className:`wdup-bar__fill${l?" wdup-bar__fill--done":c?" wdup-bar__fill--error":""}${a==="active"&&r===void 0?" wdup-bar__fill--indeterminate":""}`,style:{width:r!==void 0||l||c?`${c?100:d}%`:void 0}})})]})]})}function Lw({title:e,progress:t,onDone:a,onRetry:r,onClose:i,inline:s}){const{t:l}=xe.useTranslation(),{phase:u,error:c,wordCount:d,imagePage:m,imageDone:p,imageTotal:f,pairPercent:y}=t,x=Mw(u),C=u==="done",h=!!c;function _(w){return h&&x===w?"error":x>w?"done":x===w?"active":"pending"}const g=_(1),A=_(2),b=_(3),k=u==="image-match"&&f?Math.round((p??0)/f*100):void 0,v=o.useMemo(()=>{if(A!=="done"){if(u==="image-list")return l("wordData.checkingPage",{page:m??1});if(u==="image-match"&&f)return l("wordData.imageCount",{done:so(p),total:so(f)})}},[A,u,m,f,p,l]);return n.jsx(Fn,{inline:s,className:"popup--word-data-update",title:e,footer:h&&r?n.jsx(pe,{htmlType:"button",size:56,variant:"main",onClick:r,children:l("common.retry","\uB2E4\uC2DC \uC2DC\uB3C4")}):h?n.jsx(pe,{htmlType:"button",size:56,variant:"main",onClick:i??a,children:l("common.close","\uB2EB\uAE30")}):n.jsx(pe,{htmlType:"button",size:56,variant:"main",disabled:!C,onClick:a,children:l("common.done","\uC644\uB8CC")}),children:n.jsxs("div",{className:"wdup-cards",children:[n.jsx(ks,{icon:n.jsx(Ls,{size:22,color:"var(--color-main, #29b6c8)",strokeWidth:1.8}),label:l("wordData.phaseWordDownload","\uB2E8\uC5B4 \uB370\uC774\uD130 \uB2E4\uC6B4\uB85C\uB4DC"),state:g,subText:g==="active"?l("wordData.downloadingCount",{n:so(d),count:d}):void 0}),n.jsx(ks,{icon:n.jsx(Sw,{size:22,color:"var(--color-main, #29b6c8)",strokeWidth:1.8}),label:l("wordData.phaseImageCheck","\uC774\uBBF8\uC9C0 \uD655\uC778"),state:A,pct:k,subText:v}),n.jsx(ks,{icon:n.jsx(Ps,{size:22,color:"var(--color-main, #29b6c8)",strokeWidth:1.8}),label:l("wordData.phasePairAnalysis","\uB2E8\uC5B4\uC30D \uBD84\uC11D"),state:b,pct:b==="active"?y??0:void 0,subText:void 0})]})})}function $w({enabled:e=!1,renderResultPopup:t}={}){const{t:a}=xe.useTranslation(),[r,i]=o.useState(null),[s,l]=o.useState(null),u=y=>{let x=null;y==="noise"?x={score:3,contextsLength:5,results:[{sentence:"\uBB38\uC7A5 A",judgement:!0,wording:"\uC798 \uB4E4\uB9BC",useAnswer:!1},{sentence:"\uBB38\uC7A5 B",judgement:!1,wording:"\uC548 \uB4E4\uB9BC",useAnswer:!1},{sentence:"\uBB38\uC7A5 C",judgement:!0,wording:"\uC798 \uB4E4\uB9BC",useAnswer:!1},{sentence:"\uBB38\uC7A5 D",judgement:null,wording:"\uC548 \uD568",useAnswer:!1},{sentence:"\uBB38\uC7A5 E",judgement:!1,wording:"\uC548 \uB4E4\uB9BC",useAnswer:!1}]}:y==="short"?x={score:2,contextsLength:3,results:[{sentence:"\uBE44\uBE54\uBC25 \uC124\uBA85",answer:"\uBE44\uBE54\uBC25",selected:"\uBE44\uBE54\uBC25",selectedText:"\uBE44\uBE54\uBC25",correct:!0},{sentence:"\uBCF4\uC308 \uC124\uBA85",answer:"\uBCF4\uC308",selected:"\uC871\uBC1C",selectedText:"\uC871\uBC1C",correct:!1},{sentence:"\uCE7C\uAD6D\uC218 \uC124\uBA85",answer:"\uCE7C\uAD6D\uC218",selected:void 0,selectedText:void 0,correct:void 0}]}:y==="long"?x={score:4,contextsLength:4,results:[{sentence:"\uAE34 \uC774\uC57C\uAE30 1",answer:"\uC815\uB2F5 \uD14D\uC2A4\uD2B8 1",selectedText:"\uC815\uB2F5 \uD14D\uC2A4\uD2B8 1",correct:!0},{sentence:"\uAE34 \uC774\uC57C\uAE30 2",answer:"\uC815\uB2F5 \uD14D\uC2A4\uD2B8 2",selectedText:"\uC120\uD0DD \uD14D\uC2A4\uD2B8 2",correct:!1},{sentence:"\uAE34 \uC774\uC57C\uAE30 3",answer:"\uC815\uB2F5 \uD14D\uC2A4\uD2B8 3",selectedText:void 0,correct:void 0},{sentence:"\uAE34 \uC774\uC57C\uAE30 4",answer:"\uC815\uB2F5 \uD14D\uC2A4\uD2B8 4",selectedText:"\uC815\uB2F5 \uD14D\uC2A4\uD2B8 4",correct:!0}]}:y==="order"&&(x={score:1,contextsLength:2,results:[{sentence:"\uC21C\uC11C \uBB38\uC81C 1",answer:"1,2,3",selectedText:"1,2,3",correct:!0},{sentence:"\uC21C\uC11C \uBB38\uC81C 2",answer:"A,B,C",selectedText:"B,A,C",correct:!1}]}),l(x),i(y)},c=o.useCallback(()=>{i(null),l(null)},[]),d=o.useCallback(()=>u("noise"),[]),m=o.useCallback(()=>u("short"),[]),p=o.useCallback(()=>u("long"),[]),f=o.useCallback(()=>u("order"),[]);return e?n.jsxs("div",{className:"debug-result-launcher",children:[n.jsxs("div",{className:"debug-buttons",children:[n.jsx("button",{type:"button",className:"debug-button",onClick:d,children:a("debug.showResult",{type:"Noise",defaultValue:"{{type}} \uACB0\uACFC\uBCF4\uAE30"})}),n.jsx("button",{type:"button",className:"debug-button",onClick:m,children:a("debug.showResult",{type:"ShortStory",defaultValue:"{{type}} \uACB0\uACFC\uBCF4\uAE30"})}),n.jsx("button",{type:"button",className:"debug-button",onClick:p,children:a("debug.showResult",{type:"LongStory",defaultValue:"{{type}} \uACB0\uACFC\uBCF4\uAE30"})}),n.jsx("button",{type:"button",className:"debug-button",onClick:f,children:a("debug.showResult",{type:"Order",defaultValue:"{{type}} \uACB0\uACFC\uBCF4\uAE30"})})]}),r&&s?t?.({score:s.score,contextsLength:s.contextsLength,results:s.results,onReplay:c,onClose:c}):null]}):null}exports.Accordion=l2,exports.ActionCard=Ny,exports.Alert=J2,exports.AppHeader=h2,exports.AudioMeter=zo,exports.AudioPlayer=ds,exports.Avatar=ov,exports.Badge=At,exports.BarChart=Zv,exports.BarChartControls=xu,exports.Board=wv,exports.BottomNav=Il,exports.BrandIdentity=Hl,exports.BrandLogo=Hv,exports.Breadcrumb=lv,exports.BulkBar=Rv,exports.Button=pe,exports.CORE_VERSION=gy,exports.Calendar=g4,exports.CardStep=Gc,exports.ChartLegend=Mo,exports.ChartSection=Lo,exports.ChartTotal=Wa,exports.Checkbox=fu,exports.ChoiceChips=kx,exports.CircleBadge=K2,exports.CodeBox=Lv,exports.ColorPicker=mv,exports.CompanyMeta=Dv,exports.ConfirmPopup=ed,exports.ConfirmStep=Vc,exports.ConfirmWithTextStep=qc,exports.ContrastFilterPanel=nw,exports.CoreScope=Ey,exports.CountTile=yv,exports.CouponInputPopup=ow,exports.DEFAULT_NOISE_SETTINGS=Ga,exports.DatePicker=Wv,exports.DebugResultLauncher=$w,exports.DescriptionTooltip=Kn,exports.DeviceSideTable=h4,exports.Dialog=_v,exports.Divider=Y2,exports.Dropdown=pn,exports.EffectPartyPopper=_s,exports.EffectPartyPopperHost=lw,exports.EmptyState=ky,exports.ErrorState=Ay,exports.FILTER_ALL_VALUE=dn,exports.FileUpload=iv,exports.FilterPanel=Dn,exports.FilterSectionInfo=Pa,exports.Footer=Ax,exports.GameIntro=Qv,exports.Header=Vl,exports.Icon=at,exports.IconGridMenu=Bx,exports.IconRenderer=at,exports.InfoTooltip=Bn,exports.ItemActions=Iv,exports.LEVEL_MAX=ga,exports.LINE_CHART_HOVER_DELAY_MS=_u,exports.LandingBottomSticky=Ex,exports.LandingHeader=Nx,exports.LineChart=Jv,exports.ListPopup=aw,exports.ListenStep=Hc,exports.Loader=za,exports.MARKS=gr,exports.MARK_ICON=Ou,exports.MARK_VARIANT=zu,exports.MediaQueryOverrideContext=Gi,exports.MenuTooltip=La,exports.NOISE_RATIO_MAX=Va,exports.NOISE_RATIO_STEP=fc,exports.NoisePlayerContext=is,exports.NoiseSettingsTooltip=$c,exports.NoticeBox=Dy,exports.OrderListStep=Uc,exports.PASS_CARD_BG_VARS=Zn,exports.POS_LABEL=Vu,exports.PROMO_BANNER_BG_COMPONENTS=kl,exports.PROMO_BANNER_BG_OPTIONS=Ry,exports.PROMO_BANNER_BG_VARS=Sa,exports.Page=Ar,exports.PageTitle=uw,exports.Pagination=dr,exports.Panel=Br,exports.PanelGrid=C_,exports.PanelRow=Sn,exports.PanelRowDevice=f_,exports.PassCard=eu,exports.PassCardBg=V2,exports.PassCardBgIHAB=q2,exports.PassCardBgLeftColorGrid=U2,exports.PassCardBgTwoCircle=Yl,exports.PaymentPlan=H2,exports.PersonCard=Bv,exports.PhonemeFilterPanel=tw,exports.PhonemeSelectBlock=Q_,exports.Popup=Fn,exports.ProgressBar=s4,exports.ProgressIndicator=Tu,exports.PromoBanner=o2,exports.PromoBannerBgDark=cl,exports.PromoBannerBgDeep=rl,exports.PromoBannerBgDiagonal=hl,exports.PromoBannerBgDots=Cl,exports.PromoBannerBgInstagram=Bl,exports.PromoBannerBgMain=Ji,exports.PromoBannerBgNaver=_l,exports.PromoBannerBgOutline=bl,exports.PromoBannerBgRadial=pl,exports.PromoBannerBgSoft=el,exports.PromoBannerBgSoftSub=sl,exports.PromoBannerBgSub=nl,exports.PromoBannerBgSuccess=vl,exports.PromoBannerBgWarm=ll,exports.PublicationCard=Av,exports.Radio=ru,exports.RadioGroup=Z2,exports.Rating=cv,exports.ReportDocument=fw,exports.ReportInfoPanel=Cw,exports.RingChart=t4,exports.SENTENCE_TRAINING_TYPES=as,exports.SearchSummary=tv,exports.Section=ma,exports.SectionHeadFloat=gu,exports.SectionHeader=Ev,exports.SegmentedControl=gn,exports.ShortcutBadge=au,exports.SideNav=Wl,exports.Slider=Nu,exports.SoundCompass=G2,exports.SplashLogo=Nv,exports.StatChart=n4,exports.SummaryStrip=mw,exports.TRAINING_TOOLTIP_HOVER_DELAY_MS=su,exports.Table=Ho,exports.TableFilterPanel=Jo,exports.Tabs=nv,exports.TextBoxTooltip=wr,exports.TextField=Xn,exports.Timeline=kv,exports.Toast=da,exports.Toggle=hu,exports.Toolbar=jo,exports.Tooltip=cn,exports.TooltipInfo=Bn,exports.TooltipTextBox=wr,exports.TopBanner=s2,exports.TrainingBlock=y4,exports.TrainingBlockButton=Do,exports.TrainingBlockGrid=x4,exports.TrainingCard=xw,exports.TrainingCardGroup=_w,exports.TrainingPagePopup=On,exports.TrainingPagePopupBottom=Rc,exports.TrainingPagePopupTitle=Pc,exports.TrainingResultPopup=Xc,exports.TrainingStep=Jn,exports.TrainingStepAudioPlayer=ds,exports.TrainingStepBullet=Nc,exports.TrainingStepCard=Tc,exports.TrainingStepConfirm=ms,exports.TrainingStepConfirmWithText=hs,exports.TrainingStepListen=fs,exports.TrainingStepOrderList=Cs,exports.TrainingStepTextBox=Sc,exports.TrainingStepTitle=Dc,exports.TrainingTooltip=iu,exports.TrainingWordCard=Go,exports.UpdateAlert=vw,exports.WAVE_A_MAX=Wx,exports.WAVE_H1_PX=us,exports.WAVE_HMAX_PX=zx,exports.WORD_LABEL_I18N_KEYS=T4,exports.WORD_TABLE_PAPER=ha,exports.WORD_TYPE_LABEL=qu,exports.WordDataProvider=pw,exports.WordDataUpdatePopup=Lw,exports.WordImageTooltip=Qc,exports.WordSearchFilterPanel=ew,exports.WordSearchResultBlock=X_,exports.WordTable=fa,exports.WordTableBlock=Nw,exports.WordTableButton=Ew,exports.WordTablePopup=Z4,exports.WordTableThumbnail=rd,exports.buildMonthChartData=qv,exports.cellKey=rx,exports.cellLabel=ax,exports.cellsForLabels=Cx,exports.clearPassCardBgTheme=Nn,exports.clearPromoBannerBgTheme=Kt,exports.closeTrainingPopup=x_,exports.companyTypeLabel=cw,exports.createTrainingScenario=B_,exports.cx=_e,exports.deriveNoiseContexts=S_,exports.derivePassCard=Ul,exports.draftValues=_x,exports.effectiveNoiseVolume=os,exports.effectiveSpeechVolume=gc,exports.expandSlashLabel=Xo,exports.formatDuration=gx,exports.getControlDateRange=e4,exports.getPayloadTimestamp=bs,exports.getPromoBannerBgTheme=go,exports.getSelectedFromPayload=A_,exports.getSelectedText=N_,exports.getStepPayload=zc,exports.getSteppedPayload=E_,exports.injectPassCardBgTheme=An,exports.injectPromoBannerBgTheme=Gt,exports.isSelectionCorrect=D_,exports.labelOfCellKey=mc,exports.labelsForSave=nx,exports.levelToPct=Sx,exports.markAfterClick=Fu,exports.marksForSave=Ko,exports.mergeNoiseSettings=Ua,exports.missesByType=px,exports.monthKeyOf=Ha,exports.monthKeyOfDate=$o,exports.nextFocus=lx,exports.nextMisses=dx,exports.noiseElementVolume=ss,exports.noiseRatioOf=qa,exports.pageStartIndexes=Wu,exports.parseMonthKey=ca,exports.passCardBgIhabTheme=tu,exports.passCardBgLeftColorGridTheme=nu,exports.passCardBgTwoCircleTheme=Kl,exports.pctToLevel=Tx,exports.posLabels=Uu,exports.printWordTable=N4,exports.promoBannerBgDarkTheme=ul,exports.promoBannerBgDeepTheme=al,exports.promoBannerBgDiagonalTheme=ml,exports.promoBannerBgDotsTheme=fl,exports.promoBannerBgInstagramTheme=wl,exports.promoBannerBgMainTheme=Xi,exports.promoBannerBgNaverTheme=xl,exports.promoBannerBgOutlineTheme=gl,exports.promoBannerBgRadialTheme=dl,exports.promoBannerBgSoftSubTheme=ol,exports.promoBannerBgSoftTheme=Qi,exports.promoBannerBgSubTheme=tl,exports.promoBannerBgSuccessTheme=yl,exports.promoBannerBgWarmTheme=il,exports.recommendTables=hx,exports.regenerateUnpinned=xx,exports.removeItem=vx,exports.resolveTrainingItems=w_,exports.resolveTrainingPopupMeta=Fc,exports.reviewCells=J4,exports.reviewMeta=tx,exports.reviewSetPlan=mx,exports.reviewTableName=ex,exports.scoreKey=Cr,exports.scoreSheetHeader=ox,exports.shouldConfirmDiscard=A4,exports.splitTrainingVariants=__,exports.summarize=k4,exports.summarizeMisses=cx,exports.tableTrends=ix,exports.toDraft=bx,exports.toTrainingText=k_,exports.togglePin=yx,exports.uncoveredLabels=fx,exports.useAnchoredMenu=Ma,exports.useBarChartControl=vu,exports.useCalendarMonth=Cu,exports.useComboboxSuggestions=pu,exports.useDiscardGuard=rw,exports.useFitScale=Yu,exports.useNoisePlayer=yr,exports.useSoundCompassExam=e2,exports.useToastLifecycle=Du,exports.useWordData=dw,exports.useWordTableDisplaySettings=dc,exports.useWordTablePrint=ns,exports.waveBarPx=xr,exports.waveBarVal=_r,exports.weakItems=sx,exports.weekValueOf=Ro,exports.withStepTimes=Oc,exports.wordTypeLabels=Gu;
|