usi-csa-bridge 1.27.4 → 1.28.1
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/index.js +1 -1
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
(()=>{"use strict";var e={516(e,t,o){o.d(t,{D:()=>i,g:()=>n});const n="{datetime}{_title}{_sente}{_gote}";function i(e){return e.replaceAll(/[<>:"/\\|?*]/g,"_")}},176(e,t,o){o.d(t,{vr:()=>c,QT:()=>h,KM:()=>m,Nj:()=>u});var n=o(953),i=o.n(n);const[a,s]=[i().convert,i().detect];function r(e,t){const o=t?.autoDetect?function(e,t){return s(e)||t||"UTF8"}(e,t.encoding):t?.encoding;return"ASCII"===o||"UTF8"===o?(new TextDecoder).decode(e):a(e,{type:"string",from:o,to:"UNICODE"})}var c,l=o(113);function h(e){const t=e.toLowerCase();for(const e of Object.values(c))if(t.endsWith(e))return e}function d(e){switch(e){default:return"UTF8";case c.KIF:case c.KI2:return"SJIS"}}function u(e,t,o){const n=r(e,{encoding:d(t),autoDetect:o?.autoDetect});switch(t){case c.KIF:case c.KIFU:return(0,l.importKIF)(n);case c.KI2:case c.KI2U:return(0,l.importKI2)(n);case c.CSA:return(0,l.importCSA)(n);case c.SFEN:return new Error(".sfen file import is not supported");case c.JKF:return(0,l.importJKFString)(n)}}function m(e,t,o){const n=!o.useUTF8ForKifAndKi2||t!==c.KIF&&t!==c.KI2?d(t):"UTF8";let i;switch(t){case c.KIF:case c.KIFU:i=(0,l.exportKIF)(e,o);break;case c.KI2:case c.KI2U:i=(0,l.exportKI2)(e,o);break;case c.CSA:i=(0,l.exportCSA)(e,{...o,v3:o.csa?.v3?{milliseconds:!0}:void 0});break;case c.SFEN:throw new Error(".sfen file export is not supported");case c.JKF:i=(0,l.exportJKFString)(e)}const s=function(e,t){return"ASCII"===t||"UTF8"===t?(new TextEncoder).encode(e):new Uint8Array(a(e,{type:"arraybuffer",from:"UNICODE",to:t}))}(i,n);let h=!1;if("SJIS"===n&&o.detectGarbled){r(s,{encoding:"SJIS"})!==i&&(h=!0)}return{data:s,garbled:h}}!function(e){e.KIF=".kif",e.KIFU=".kifu",e.KI2=".ki2",e.KI2U=".ki2u",e.CSA=".csa",e.SFEN=".sfen",e.JKF=".jkf"}(c||(c={}))},690(e,t,o){o.d(t,{OW:()=>r,Rr:()=>s,j5:()=>i,kt:()=>n});var n,i,a=o(113);function s(){return{id:"",myColor:a.Color.BLACK,toMove:a.Color.BLACK,position:"",players:{black:{time:{timeUnitMs:1e3,totalTime:0,byoyomi:0,delay:0,increment:0}},white:{time:{timeUnitMs:1e3,totalTime:0,byoyomi:0,delay:0,increment:0}}}}}function r(){return{black:{time:0},white:{time:0}}}!function(e){e.UNKNOWN="unknown",e.RESIGN="resign",e.SENNICHITE="sennichite",e.OUTE_SENNICHITE="oute_sennichite",e.ILLEGAL_MOVE="illegal_move",e.ILLEGAL_ACTION="illegal_action",e.TIME_UP="time_up",e.JISHOGI="jishogi",e.MAX_MOVES="max_moves"}(n||(n={})),function(e){e.WIN="win",e.LOSE="lose",e.DRAW="draw",e.CENSORED="censored",e.CHUDAN="chudan"}(i||(i={}))},178(e,t,o){var n;o.d(t,{q:()=>n}),function(e){e.WIN="win",e.LOSE="lose",e.DRAW="draw"}(n||(n={}))},408(e,t,o){o.d(t,{X:()=>i,m:()=>n});const n=1e4;function i(e,t){const o=[],n=e.clone();for(const e of t){const t=n.createMoveByUSI(e);if(!t||!n.doMove(t))break;o.push(t)}return o}},789(e,t,o){function n(e=new Date){return e.toLocaleDateString("ja-JP",{year:"numeric",month:"2-digit",day:"2-digit"})}function i(e=new Date){return e.toLocaleTimeString("ja-JP",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function a(e=new Date){return i(e)+"."+String(e.getTime()%1e3).padStart(3,"0")}o.d(t,{ln:()=>i,ng:()=>a,sq:()=>n})},211(e,t,o){function n(e){return"/"===e||"\\"===e||/^[A-Za-z]:[\\/]{1}$/.test(e)?e:e.endsWith("\\")||e.endsWith("/")?e.slice(0,-1):e}o.d(t,{w:()=>n})},685(e,t,o){function n(e){switch(e%100){case 11:case 12:case 13:return e+"th"}switch(e%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd";default:return e+"th"}}o.d(t,{IE:()=>n})},1(e,t,o){var n;o.d(t,{TM:()=>n,cB:()=>g,xC:()=>S,t:()=>l}),function(e){e.JA="ja",e.EN="en",e.ZH_TW="zh_tw",e.VI="vi"}(n||(n={}));var i=o(685);const a={shogiHome:"ShogiHome",clear:"Clear",open:"Open",openNewInstance:"Open New ShogiHome Instance",saveOverwrite:"Overwrite",newRecord:"New Record",newRecordKeepInitialPosition:"New Record (Keep Initial Position)",newRecordHirateSetup:"New Record (Hirate Setup)",openRecord:"Open Record",saveRecord:"Save Record",saveRecordAs:"Save Record As",openAutoSaveDirectory:"Open Auto-Save Directory",exportPositionDiagram:"Export Position Diagram",positionImage:"Position Image",batchConversion:"Batch Conversion",recordFileBatchConversion:"Record File Batch Conversion",close:"Close",quit:"Quit",reload:"Reload",editing:"Edit",copyAsKIF:"Copy (KIF)",copyAsKI2:"Copy (KI2)",copyAsCSA:"Copy (CSA)",copyAsUSI:"Copy (USI)",copyAsSFEN:"Copy (SFEN)",copyAsBOD:"Copy (BOD)",copyAsJKF:"Copy (JKF)",copyAsUSEN:"Copy (USEN)",copy:"Copy",cut:"Cut",paste:"Paste",copyRecordAll:"Copy Record (All)",copyRecordFromCurrentPosition:"Copy Record (From Current Position)",asKIF:"As KIF",asKI2:"As KI2",asCSA:"As CSA",asUSI:"As USI",asUSIUntilCurrentMove:"As USI (Until Current Move)",asUSIAll:"As USI (All)",asJSONKifuFormat:"As JSON Kifu",asUSEN:"As USEN",copyPosition:"Copy Position",asSFEN:"SFEN",asBOD:"BOD",pasteRecordOrPosition:"Paste Record/Position",pasteRecordMerge:"Paste Record (Merge)",toRootPosition:"to Root Position",toCurrentPosition:"to Current Position",addSpecialMove:"Add Special Move",deleteMoves:"Delete Moves from Current Position",view:"View",openLayoutManager:"Open Layout Manager",openMonitorWindow:"Open Monitor Window",toggleFullScreen:"Toggle Full Screen",defaultFontSize:"Default Font Size",increaseFontSize:"Increase Font Size",decreaseFontSize:"Decrease Font Size",settings:"Settings",config:"Config",debug:"Debug",toggleDevTools:"Toggle DevTools",logFile:"Log File",openAppLog:"Open App Log",openUSILog:"Open USI Log",openCSALog:"Open CSA Log",tailAppLog:"Tail App Log",tailUSILog:"Tail USI Log",tailCSALog:"Tail CSA Log",copyAppLogTailCommand:"Copy App Log Tail Command",copyUSILogTailCommand:"Copy USI Log Tail Command",copyCSALogTailCommand:"Copy CSA Log Tail Command",reloadCustomPieceImage:"Reload Custom Piece Image",statisticsReport:"Statistics Report",launchUSIEngine:"Launch USI Engine",connectToCSAServer:"Connect to CSA Server",adminMode:"Admin Mode",inAdminModeManuallyInvokeCommandsAtPrompt:"In admin mode, manually invoke commands at the prompt.",setoptionAndPrecedingCommandsAreSentAutomatically:"'setoption' and preceding commands are sent automatically.",serverMustSupportShogiServerX1ModeLogIn:"Server must support shogi-server's x1 mode login.",folders:"Folders",notification:"Notification",notificationTest:"Test Notification",thisIsTestNotification:"This is a test notification.",app:"App",log:"Log",cache:"Cache",help:"Help",openWebsite:"Open Website",openUserGuide:"Open User Guide",openLatestReleasePage:"Open Latest Release Page",openStableReleasePage:"Open Stable Release Page",license:"License",inputs:"Inputs",outputs:"Outputs",format:"Format",formats:"Formats",subdirectories:"Subdirectories",separate:"Separate",merge:"Merge",createSubdirectories:"Create Subdirectories",nameConflictAction:"Name Conflict Action",numberSuffix:"Number Suffix",skip:"Skip",convert:"Convert",openLogFile:"Open Log File",success:"Success",failed:"Failed",skipped:"Skipped",game:"Game",player:"Player",server:"Server",selectFromHistory:"Select from History",noHistory:"Empty",saveHistory:"Save History",version:"Version",gameProgress:"Game Progress",allGamesCompleted:"All Games Completed",wins:"Wins",winsOnBlack:"Wins(Black)",winsOnWhite:"Wins(White)",draws:"Draws",validGames:"Valid Games",invalidGames:"Invalid Games",eloRatingDiff:"Elo Rating Diff",ignoreDraws:"Ignore Draws",zValue:"Z Value",significance5pc:"5% Significance",significance1pc:"1% Significance",gameEnded:"Game Ended",offlineGame:"Offline Game",csaOnlineGame:"CSA Online Game",csaProtocolOnlineGame:"Online Game (CSA Protocol)",csaProtocolV121:"CSA Protocol 1.2.1 Standard",csaProtocolV121WithPVComments:"CSA Protocol 1.2.1 with PV Comments",host:"Host",portNumber:"Port",password:"Password",revealPassword:"Reveal Password",keepaliveInitialDelay:"Keepalive Initial Delay",blankLinePing:"Blank Line Ping",blankLinePingInitialDelay:"Blank Line Ping Initial Delay",blankLinePingInterval:"Blank Line Ping Interval",logout:"Logout",calculateJishogiPoints:"Calculate Jishogi Points",jishogiPoints:"Jishogi Points",displayGameResults:"Display Game Results",interrupt:"Interrupt",stopGame:"Stop Game",resign:"Resign",draw:"Draw",impass:"Impass",repetitionDraw:"Repetition Draw",repetition:"Repetition",mate:"Mate",noMate:"No Mate",blackWin:"Black Win",whiteWin:"White Win",all:"All",others:"Others",minRate:"Min Rate",mateSearch:"Mate Search",startMateSearch:"Start Mate Search",stopMateSearch:"Stop Mate Search",noMateFound:"No mate.",timePerPosition:"Time per Position",timeout:"Timeout",foulWin:"Foul Win",foulLose:"Foul Lose",enteringOfKing:"Entering of King",winByDefault:"Win by Default",loseByDefault:"Lose by Default",winByDeclaration:"Win by Declaration",declareWin:"Declare Win",research:"Research",startResearch:"Start Research",endResearch:"End Research",startEndResearch:"Start/End Research",recordAnalysis:"Record Analysis",analysis:"Analyze",analyze:"Analyze",stopAnalysis:"Stop Analysis",searchDuplicatePositions:"Search Duplicate Positions",duplicatePositionSearch:"Duplicate Position Search",duplicatePositions:"Duplicate Positions",duplicatePos:"Duplicate",via:"Via",lastMove:"Last Move",nextMoves:"Next Moves",goToThisPosition:"Go to This Position",noDuplicatePositions:"No Duplicate Positions",nDuplicatePositionsFound:e=>`${e} Duplicate Positions Found`,appearanceCount:"Appearance Count",showList:"Show List",setupPosition:"Setup Position",startPositionSetup:"Start Position Setup",completePositionSetup:"Complete Setup",changeTurn:"Change Turn",initializePosition:"Initialize Position",changePieceSet:"Change Piece Set",setAllPiecesToStandardCounts:"Set All Pieces to Standard Counts",setAllPiecesToZero:"Set All Pieces to Zero",appSettings:"Preferences",language:"Languages",theme:"Theme",standard:"Standard",green:"Green",cherryBlossom:"Cherry Blossom",customImage:"Custom Image",autumn:"Autumn",snow:"Snow",darkGreen:"Dark Green",dark:"Dark",boardLayout:"Board Layout",compact:"Compact",portrait:"Portrait",piece:"Piece",singleKanjiPiece:"Single Kanji",singleKanjiWoodPiece:"Single Kanji (Wood)",singleKanjiGothicPiece:"Single Kanji (Gothic)",singleKanjiDarkPiece:"Single Kanji (Dark)",singleKanjiGothicDarkPiece:"Single Kanji (Gothic, Dark)",imageHasMarginsRemoveForLargerDisplay:"Image has margins (remove for larger display)",backgroundImage:"Background Image",board:"Board",pieceStand:"Piece Stand",woodTexture:"Wood Texture",lightWoodyTexture:e=>`Light Wood Texture (${e})`,warmWoodTexture:e=>`Warm Wood Texture (${e})`,resin:"Resin",transparent:"Transparent",boardOpacity:"Board Opacity",pieceStandOpacity:"Piece Stand Opacity",recordOpacity:"Record Opacity",promotionSelector:"Promotion Selector",centeredHorizontal:"Centered Horizontal",promoteFirstVertical:"Promote First Vertical",promoteFirstHorizontal:"Promote First Horizontal",showFileAndRank:"Show File & Rank",showLeftControls:"Show Left Controls",showRightControls:"Show Right Controls",tabViewStyle:"Tab View Style",oneColumn:"1 Column",twoColumns:"2 Columns",sounds:"Sounds",pieceSoundVolume:"Piece Sound Volume",clockSoundVolume:"Clock Sound Volume",clockSoundPitch:"Clock Sound Pitch",clockSoundTarget:"Clock Sound Target",anyTurn:"Any",onlyHumanTurn:"Human",defaultRecordFileFormat:"Default Record Format",textEncoding:"Text Encoding",strict:"Strict",autoDetect:"Auto Detect",newlineCharacter:"Newline Character",old90sMac:"90's Mac",autoSaving:"Auto-Save",recordFileName:"Record File Name",select:"Select",shuffle:"Shuffle",csaV3Output:"CSA V3 Output",alwaysOutputUTF8:"Always Output UTF-8",someOldShogiAppsCannotReadUTF8KifFiles:"Some older Shogi applications may not be able to read KIF/KI2 files encoded in UTF-8.",strictDecodingMayFailToReadUTF8KifFiles:"When text encoding is set to Strict, loading KIF/KI2 files written in UTF-8 may fail.",positionOfUSIOutput:"Position of USI Output",movesOfUSIOutput:"Moves of USI Output",onlySFEN:"Only SFEN",minimal:"Minimal",pasteDialog:"Paste Dialog",liveDuplicatePositionDetection:"Live Duplicate Position Detection",onTheFlyThreshold:"On-the-fly Threshold",usiProtocol:"USI Protocol",translateOptionName:"Translate Option Name",functionalOnJapaneseOnly:"Functional on Japanese Only",maxStartupTime:"Max Startup Time",forDevelopers:"For Developers",enableAppLog:"Enable App Log",enableUSILog:"Enable USI Log",enableCSALog:"Enable CSA Log",logLevel:"Log Level",manageEngines:"Manage Engines",flipBoard:"Flip Board",elapsedTimeChart:"Elapsed Time Chart",shortcutKeys:"Shortcut Keys",useUpDownToMove1Ply:"Use ↑/↓ to Move 1 Ply",useLeftRightToMove1Ply:"Use ←/→ to Move 1 Ply",file:"File",folder:"Folder",recordFile:"Record File",executableFile:"Executable",imageFile:"Image",unsaved:"Unsaved",remove:"Remove",deleteMove:"Delete Move",recordProperties:"Record Properties",comments:"Comments",commentsAndBookmarks:"Comments & Bookmarks",branches:"Branches",branchListMode:"Branch List Mode",previousMoveBranches:"Sibling Branches",nextMoveBranches:"Next Move Branches",bookmark:"Bookmark",bookmarkList:"Bookmarks",useBookmarkAsHeader:"Use Bookmark as Header",moveComments:"Move Comments",searchLog:"Search Log",pv:"PV",mateShort:"M",displayPVShort:"Play",evaluation:"Evaluation",rawScore:"Raw Score",score:"Score",estimatedWinRate:"Estimated Win Rate",evaluationAndEstimatedWinRateAndPV:"Evaluation & Estimated Win Rate & PV",swapEachTurnChange:"Swap Each Turn Change",alwaysSenteIsPositive:"Always Sente is Positive",signOfEvaluation:"Sign of Evaluation",showArrowScore:"Show Score on Arrows",arrowScoreDiffRange:"Arrow Score Range",maxArrows:"Max Arrows",winRateCoefficient:"Win Rate Coefficient",nodeCountFormat:"Node Count Format",plainNumber:"Plain",commaSeparated:"Comma Separated",monitor:"Monitor",hideTabView:"Hide",expandTabView:"Expand Tab View",sente:"Sente",senteOrShitate:"Sente (Shitate)",shitate:"Shitate",gote:"Gote",goteOrUwate:"Gote (Uwate)",uwate:"Uwate",targetEngine:"Target Engine",baseEngine:"Base Engine",swapSenteGote:"Swap Sente/Gote",pieceToss:"Piece Toss",currentPosition:"Current Position",positionList:"Position List",enableEngineTimeout:"Enable Engine Timeout",setDifferentTimeForGote:"Set different time for Gote",nextTurn:"Next Move",elapsedTime:"Elapsed Time",elapsed:"Elapsed",rank:"Rank",depth:"Depth",searchEngine:"Search Engine",ponder:"Ponder",numberOfThreads:"Threads",threads:"Threads",suggestionsCount:"Suggestions Count",startPosition:"Position",beginFromThisPosition:"Begin from this position",maxMoves:"Max Moves",gameRepetition:"Repeat",parallelism:"Parallelism",parallelGame:"Parallel Game",jishogi:"Jishogi",rule24:"24-point rule",rule27:"27-point rule",tryRule:"TRY rule",autoRelogin:"Auto Re-Login",restartItEveryGame:"Restart it Every Game",swapTurnWhenGameRepetition:"Swap Turns When Repeat",outputComments:"Output Comments",saveRecordAutomatically:"Save Record Automatically",adjustBoardToHumanPlayer:"Adjust Board to Human Player",adjustBoardAutomatically:"Adjust Board Automatically",command:"Command",startGame:"Start Game",cancelGame:"Cancel Game",allottedTime:"Allotted Time",byoyomi:"Byoyomi",increments:"Increments",startEndCriteria:"Start/End Criteria",descending:"Descending",endCriteria1Move:"End Criteria for 1 Move",outputSettings:"Output Settings",noOutputs:"No Outputs",insertCommentToTop:"Insert to Top",appendCommentToBottom:"Append to Bottom",insertToComment:"Ins. to Comment",insertToRecord:"Ins. to Record",overwrite:"Overwrite",fromPrefix:"from",fromSuffix:"",toPrefix:"to",toSuffix:"",plyPrefix:"",plySuffix:"th move",hoursSuffix:"h",minutesSuffix:"min",secondsSuffix:"sec",eg:"e.g.",totalMoves:"Total Moves",detailSettings:"Detail Settings",engineManagement:"Engine Management",engineName:"Engine Name",author:"Author",earlyPonder:"Early Pondering",enginePath:"Engine Path",openDirectory:"Open Directory",replaceEnginePath:"Replace Engine Path",displayName:"Display Name",frontendBook:"Frontend Book",showAllOptions:"Show All Options",invoke:"Invoke",resetToEngineDefaultValues:"Reset to default values",defaultValue:"Default Value",freeTextUnsafe:"Free Text (Unsafe)",noEngineRegistered:"No engine",duplicate:"Copy",add:"Add",compareAndMerge:"Compare & Merge",compareEngineSettings:"Compare Engine Settings",noDifference:"No Difference",mergeToLeft:"Merge to Left",mergeToRight:"Merge to Right",recommended:"Recommended",import:"Import",saveAndClose:"Save & Close",save:"Save",saveAs:"Save As",history:"History",clearHistory:"Clear History",userFile:"User File",automaticBackup:"Automatic Backup",restore:"Restore",loadRecordFromWeb:"Load Record from Web",backToMainBranch:"Back to Main Branch",fetchLatestData:"Fetch Latest Data",sourceURL:"Source URL",ok:"OK",cancel:"Cancel",back:"Back",doNotShowAgain:"Do not show again",name:"Name",prediction:"Prediction",best:"Best",nodes:"Nodes",hashUsage:"Hash Usage",stop:"Stop",resume:"Resume",noHandicap:"No Handicap",lanceHandicap:"Lance Handicap",rightLanceHandicap:"Right Lance Handicap",bishopHandicap:"Bishop Handicap",rookHandicap:"Rook Handicap",rookLanceHandicap:"Rook-Lance Handicap",twoPiecesHandicap:"2 Pieces Handicap",fourPiecesHandicap:"4 Pieces Handicap",sixPiecesHandicap:"6 Pieces Handicap",eightPiecesHandicap:"8 Pieces Handicap",tenPiecesHandicap:"10 Pieces Handicap",tsumeShogi:"Tsume Shogi",doubleKingTsumeShogi:"2-Kings Tsume Shogi",startDateTime:"Start",endDateTime:"End",gameDate:"Date",tournament:"Tournament",strategy:"Strategy",gameTitle:"Title",timeLimit:"Time Limit",blackTimeLimit:"Time Limit (Sente)",whiteTimeLimit:"Time Limit (Gote)",place:"Place",postedOn:"Posted On",note:"Note",senteShortName:"Sente(short)",goteShortName:"Gote(short)",scorekeeper:"Scorekeeper",opusNo:"Opus No.",opusName:"Opus Name",publishedBy:"Published By",publishedOn:"Published On",source:"Source",numberOfMoves:"Number of Moves",integrity:"Integrity",recordCategory:"Category",award:"Award",filterByOptionName:"Filter by Option Name",filterByEngineName:"Filter by Engine Name",bookStyle:"Book Style",bookStyleDiagram:"Book Style Diagram",gameStyle:"Game Style",thin:"Thin",bold:"Bold",extraBold:"Extra Bold",playerName:"Player Name",typeface:"Typeface",weight:"Weight",handLabel:"Hand Label",header:"Header",vertical:"Vertical",size:"Size",none:"None",bgCover:"Cover",bgContain:"Contain",bgTile:"Tile",inaccuracy:"Inaccuracy",dubious:"Dubious",mistake:"Mistake",blunder:"Blunder",inaccuracyThreshold:"Inaccuracy Threshold",dubiousThreshold:"Dubious Threshold",mistakeThreshold:"Mistake Threshold",blunderThreshold:"Blunder Threshold",maxPVLength:"Max PV Length",commentFormat:"Comment Format",gothic:"Gothic",mincho:"Mincho",appVersion:"App Version",installed:"Installed",stable:"Stable",latest:"Latest",backgroundColor:"Background Color",dialogPosition:"Dialog Position",alignLeft:"Left",alignRight:"Right",alignCenter:"Center",dialogBackdrop:"Dialog Backdrop",record:"Record",book:"Book",chart:"Chart",analytics:"Analytics",controlGroup:"Control Group",left:"Left",top:"Top",width:"Width",height:"Height",newCustomProfile:"New Custom Profile",addCustomLayoutProfile:"Add Custom Layout Profile",duplicateCurrentProfile:"Duplicate Current Profile",removeCurrentProfile:"Remove Current Profile",exportProfileToClipboard:"Export Profile to Clipboard",importProfileFromClipboard:"Import Profile from Clipboard",profileExportedToClipboard:"Profile exported to clipboard.",profileImported:"Profile imported.",failedToImportProfile:"Failed to import profile.",rightControlBox:"Right Control Box",leftControlBox:"Left Control Box",topControlBox:"Top Control Box",legends:"Legends",historyMode:"History Mode",headers:"Headers",playButton:"Play Button",insert:"Insert",bringForward:"Bring Forward",sendBackward:"Send Backward",move:"Move",bookMove:"Book Move",play:"Play",edit:"Edit",addMoves:"Add Moves",flippedBook:"Flipped Book",addBookMoves:"Add Book Moves",fromCurrentRecord:"From Current Record",fromFile:"From File",fromDirectory:"From Directory",noMoves:"No Moves",register:"Register",update:"Update",currentMove:"Current Move",branchFrom:e=>`Branch from ${e}th Move`,allPlayers:"All Players",blackPlayerOnly:"Black Player Only",whitePlayerOnly:"White Player Only",filterByName:"Filter by Name",enterPartOfPlayerNameHere:"Enter part of player name here",freq:"Freq.",frequency:"Frequency",new:"New",duplicated:"Duplicated",moveEntry:"Entry",updatedAt:"Updated At",createdAt:"Created At",lastSent:"Last Sent",lastReceived:"Last Received",protocolVersion:"Protocol Version",prompt:"Prompt",openPrompt:"Open Prompt",forceQuit:"Force Quit",forceClose:"Force Close",blankLine:"Blank Line",autoScroll:"Auto Scroll",showTimestamp:"Show Timestamp",highlightByPartialMatch:"Highlight by Partial Match",csaServer:"CSA Server",usiEngine:"USI Engine",noRunningUSIEngine:"No running USI engine.",noConnectedCSAServer:"No connected CSA server.",willBeRemovedFromTheListSoon:"This session is closed, will be removed from the list soon.",typeCommandHereAndPressEnter:"Type command here and press Enter.",allowBlankLine:"Allow Blank Line",removeSpaceFromBothEnds:"Remove Space from Both Ends",collapseSequentialSpaces:"Collapse Sequential Spaces",typeCustomTitleHere:"Type custom title here",displayEmptyElements:"Display Empty Elements",share:"Share",waitingForNewGame:"Waiting for new game.",waitingForPlayerSetup:"Waiting for player setup.",insertedComment:"Inserted comment.",conversionCompleted:"Conversion completed.",human:"Human",randomPlayer:"Random Player",beginner:"Beginner",staticRook:"Static Rook",rangingRook:"Ranging Rook",pleaseSelectEngines:"Please select engines.",thisItemCannotBeMerged:"This item cannot be merged.",tryingToConnectAndLoginToCSAServer:"Trying to connect and login to CSA server.",inBrowserLogsOutputToConsoleAndIgnoreThisSetting:"*In web browser version, it will output logs to console and ignore this setting.",shouldRestartToApplyLogSettings:"*You should restart this app to apply log settings.",canOpenLogDirectoryFromMenu:'*You can open log directory from "Debug" - "Open Log Directory" menu.',hasNoOldLogCleanUpFeature:"*This app has no clean-up feature. Please remove old logs manually.",shouldRestartToApplyLowLevelSettings:"*You should restart this app to apply low-level settings.",processingPleaseWait:"Processing, please wait.",importingFollowingRecordOrPosition:"Importing the following record(or position).",supportsKIF_KI2_CSA_USI_SFEN_JKF_USEN:"*Supports KIF, KI2, CSA, USI, SFEN, JKF, and USEN.",pleasePasteRecordIntoTextArea:"*Please paste record data into the text area.",pleaseSpecifyPlainTextURL:"*Please specify plain text URL.",redirectNotSupported:"*Redirect is not supported.",desktopVersionPastesAutomatically:"*In desktop version, it will paste automatically from clipboard.",asNewFile:"as New File",mergeToRootPosition:"Merge to Root Position",mergeToCurrentPosition:"Merge to Current Position",failedToMergeRecordWithDifferentInitialPosition:"Failed to merge record with different initial position.",failedToMergeRecordWithDifferentTurn:"Failed to merge record with different turn.",earlyPonderFeatureSendsPonderhitCommandWithYaneuraOusNonStandardOptions:'Early ponder feature sends "ponderhit" command with YaneuraOu\'s non-standard options.',ifYourEngineNotSupportTheOptionsItMayCauseUnexpectedBehavior:"If your engine does not support the options, it may cause unexpected behavior.",someLogsDisabled:"Some log settings are disabled.",logsRecommendedForCSAProtocol:"Log settings are recommended for CSA protocol.",pleaseEnableLogsAndRestart:"Please enable log settings and restart this app.",hwaEnabled:"HWA(Hardware Acceleration) Enabled",hwaIsNotRecommendedForLongGames:"HWA is not recommended for long games.",pleaseDisableHWAAndRestart:"Please disable HWA in app settings and restart this app.",notSendPVOnStandardCSAProtocol:"Client do not send PV on standard CSA protocol.",passwordWillSavedPlaintextBecauseOSSideEncryptionNotAvailable:"Password will saved as plaintext because OS side encryption is not available.",pleaseUncheckSaveHistoryIfNotWantSave:"Please uncheck Save History, if you don't want to save.",floodgatePasswordShouldStartWithGameName:"Floodgate's password should start with game name.",thisIsNotFloodgateOfficialGameName:"This is not Floodgate official game name.",yourPasswordDoesNotMeetFloodgateRequirementsDoYouStillWantToContinue:"Your password does not meet Floodgate's requirements. Do you still want to continue?",whenNewVersionIsAvailableItWillBeNotified:"When new version is available, it will be notified.",pleaseCheckMessageThisIsTestNotificationByAboveButton:'Please check the message "This is test notification." by above button.',ifNotWorkYouShouldAllowNotificationOnOSSetting:"If it does not work, you should allow notification on OS setting.",translationHelpNeeded:"We'd like your help to translate.",restartRequiredAfterLocaleChange:"You should restart this app to change the language.",createDesktopShortcut:"Create desktop shortcut",desktopShortcutCreated:"Desktop shortcut created.",areYouSureWantToResign:"Are you sure you want to resign?",areYouSureWantToDoDeclaration:"Are you sure you want to do declaration?",areYouSureWantToQuitGames:"Are you sure you want to quit games?",areYouSureWantToRequestQuit:"You have possibility to be loser. Are you sure you want to request quit?",areYouSureWantToClearRecord:"Are you sure you want to clear record?",areYouSureWantToDiscardPosition:"Are you sure you want to discard the position?",areYouSureWantToOpenFileInsteadOfCurrentRecord:"Are you sure you want to open the file instead of current record?",areYouSureWantToClearHistory:"Are you sure you want to clear history?",areYouSureWantToRemoveCurrentProfile:"Are you sure you want to remove current profile?",yamlFormatSettingsCopiedToClipboard:"YAML format settings copied to clipboard.",jsonFormatSettingsCopiedToClipboard:"JSON format settings copied to clipboard.",usiCsaBridgeCommandCopiedToClipboard:"usi-csa-bridge command copied to clipboard.",copiedToClipboard:"Copied to clipboard.",pastedFromClipboard:"Pasted from clipboard.",youCanNotCloseAppWhileCSAOnlineGame:"You cannot close app while CSA online game.",fileExtensionNotSupported:"File extension is not supported.",errorOccuredWhileDisconnectingFromCSAServer:"An error occured while disconnecting from CSA server.",failedToConnectToCSAServer:"Failed to connect to CSA server.",errorOccuredWhileLogoutFromCSAServer:"An error occured while logout from CSA server.",disconnectedFromCSAServer:"Disconnected from CSA server.",csaServerLoginDenied:"CSA server login denied.",thisFeatureNotAvailableOnWebApp:"This feature is not available on web app.",failedToStartNewGame:"Failed to start new game.",errorOccuredWhileEndingGame:"An error occured while ending game.",failedToSendGoCommand:"Failed to send go-command.",failedToSendPonderCommand:"Failed to send ponder-command.",failedToSendStopCommand:"Failed to send stop-command.",failedToShutdownEngines:"Failed to shutdown engines.",failedToCheckUpdates:"Failed to check updates.",failedToSaveRecord:"Failed to save record.",failedToParseSFEN:"Failed to parse SFEN.",failedToDetectRecordFormat:"Failed to detect record format.",unknown:"Unknown",unknownFileExtension:"Unknown file extension.",emptyRecordInput:"Empty record input.",invalidPieceName:"Invalid piece name",invalidTurn:"Invalid turn",invalidMove:"Invalid move",invalidMoveNumber:"Invalid move number",invalidDestination:"Invalid destination",pieceNotExists:"Piece not exists",invalidLine:"Invalid line",invalidBoard:"Invalid board",invalidHandPiece:"Invalid hand piece",invalidUSI:"Invalid USI",engineProcessWasClosedUnexpectedly:"The engine process was closed unexpectedly.",backgroundImageFileNotSelected:"Background image file is not selected.",pieceImageFileNotSelected:"Piece image file is not selected.",boardImageFileNotSelected:"Board image file is not selected.",pieceStandImageFileNotSelected:"Piece stand image file is not selected.",pieceSoundVolumeMustBe0To100Percent:"Piece sound volume must be 0% to 100%.",clockSoundVolumeMustBe0To100Percent:"Clock sound volume must be 0% to 100%.",clockSoundPitchMustBe220To880Hz:"Clock sound pitch must be 220Hz to 880Hz.",engineTimeoutMustBe1To300Seconds:"Engine timeout must be 1 to 300 seconds.",coefficientInSigmoidMustBeGreaterThan0:"Coefficient in sigmoid must be greater than 0.",inaccuracyThresholdMustBe1To100Percent:"Inaccuracy must be 1% to 100%.",dubiousThresholdMustBe1To100Percent:"Dubious threshold must be 1% to 100%.",mistakeThresholdMustBe1To100Percent:"Mistake threshold must be 1% to 100%.",blunderThresholdMustBe1To100Percent:"Blunder threshold must be 1% to 100%.",recordSavedWithGarbledCharacters:"The record has saved with some garbled characters.",pleaseConsiderToUseKIFU:"Please consider to use KIFU(UTF-8).",youCanChangeDefaultRecordFileFormatFromAppSettings:"You can change default record file format from App Settings.",inaccuracyThresholdMustBeLessThanDubiousThreshold:"Inaccuracy threshold must be less than dubious threshold.",dubiousThresholdMustBeLessThanMistakeThreshold:"Dubious threshold must be less than mistake threshold.",mistakeThresholdMustBeLessThanBlunderThreshold:"Mistake threshold must be less than blunder threshold.",thisEngineNotSupportsMateSearch:"This engine does not support mate search.",pleaseEndActiveFeaturesBeforeOpenRecord:"Please end active features before open record.",bothTimeLimitAndByoyomiAreNotSet:"Both time limit and byoyomi are not set.",canNotUseByoyomiWithFischer:"You cannot use Byoyomi with Fischer.",repeatsMustBeOneIfHumanPlayerIncluded:"The number of repeats must be 1, if a human player is included.",parallelismMustBeOneIfHumanPlayerIncluded:"Parallelism must be 1 if a human player is included.",parallelismMustBeOneIfCurrentPositionIsUsed:"Parallelism must be 1 if current position is used.",parallelismMustLessThanOrEqualToRepeats:"Parallelism must be less than or equal to the number of repeats.",protocolVersionNotSelected:"Protocol version is not selected.",hostNameIsEmpty:"Host name is empty.",invalidPortNumber:"Invalid port number.",idIsEmpty:"ID is empty.",idContainsSpace:"ID contains space.",passwordContainsSpace:"Password contains space.",tcpKeepaliveInitialDelayMustBePositive:"TCP keepalive initial delay must be positive.",blankLinePingInitialDelayMustBeGreaterThanOrEqualTo30:"Blank line ping initial delay must be >=30.",blankLinePingIntervalMustBeGreaterThanOrEqualTo30:"Blank line ping interval must be >=30.",engineNotSelected:"Engine is not selected.",forExportingConversionLogPleaseEnableAppLogsAndSetLogLevelDebugAndRestart:"For exporting conversion log, please enable app logs, set log level to DEBUG and restart this app.",sourceDirectoryNotSpecified:"Source directory is not specified.",sourceFileMustBeSFEN:"Source file must have a .sfen extension.",sourceFormatsNotSpecified:"Source formats are not specified.",destinationDirectoryNotSpecified:"Destination directory is not specified.",destinationFileNotSpecified:"Destination file is not specified.",anyUnsavedDataWillBeLostDoYouReallyWantToResetBookData:"Any unsaved data will be lost. Do you really want to reset book data?",bookMovesWereImported:"Book moves were imported.",anyBookMovesAreUnsavedDoYouReallyWantToDiscardThemAndCloseTheApp:"Any book moves are unsaved. Do you really want to discard them and close the app?",cannotOverwriteOnTheFlyBook:"On-the-fly books cannot be overwritten.",pleaseSpecifyOtherFileName:"Please specify another file name.",sourceRecordFileNotSet:"Source record file is not set.",sourceDirectoryNotSet:"Source directory is not set.",minPlyMustBeLessThanMaxPly:"Min ply must be less than max ply.",playerNameNotSet:"Player name is not set.",incompatibleOptionsWillBeDiscardedDoYouReallyWantToReplaceTheEnginePath:"Incompatible options will be discarded. Do you really want to replace the engine path?",largeSuggestionsCountMayCausePerformanceDegradation:"Large suggestions count may cause performance degradation.",doYouReallyWantToIncreaseTheSuggestionsCount:"Do you really want to increase the suggestions count?",recommendLowerSettingsForDailyUse:"Recommend lower settings for daily use.",checkEngineCompatibilityForNumaEnvironments:"This machine may have multiple CPU sockets or processor groups (NUMA). Not all engines handle NUMA environments optimally. Please check whether your engine supports NUMA.",aiPerformanceMayDegrade:"AI performance may degrade.",yourPCMayBecomeSlow:"Your PC may become slow.",increasingItMayImproveAIPerformance:"Increasing it may improve AI performance.",totalNumber:e=>`Total: ${e}`,number:e=>""+e,tryToReloginToCSAServerNSecondsLater:e=>`Try to relogin to the CSA server in ${e} seconds.`,mateInNPlyDoYouWantToDisplay:e=>`Mate in ${e} ply. Do you want to display it?`,insertedNMovesToRecord:e=>`Inserted ${e} moves to the record.`,errorsOccurred:e=>e>=2?`${e} errors have occurred.`:`${e} error has occurred.`,between:(e,t)=>`between ${e} and ${t}`,addNthEngine:e=>`Add ${(0,i.IE)(e)} engine`,copyOf:e=>`${e} (copy)`,keepLatest:e=>`keep latest ${e}`,followingDataNotSavedBecauseNotSupporetedBy:e=>`The following data was not saved because it is not supporeted by "${e}".`,areYouSureWantToDeleteFollowingMove:e=>`Are you sure you want to delete th ${e}th move and the following moves?`,failedToOpenDirectory:e=>`Failed to open directory of the file: ${e}`,unexpectedEventSenderPleaseReport:e=>`Unexpected event sender. Please report this error message to developer. [${e}]`,unexpectedHTTPMethodPleaseReport:e=>`Unexpected HTTP method. Please report this error message to developer. [${e}]`,unexpectedRequestURLPleaseReport:e=>`Unexpected request URL. Please report this error message to developer. [${e}]`,noResponseFromEnginePleaseExtendTimeout:e=>`No response from the engine for ${e} seconds. Please extend the timeout in the app settings if your engine is slow.`,stableVersionReleased:e=>`Stable version ${e} released!`,latestVersionReleased:e=>`Latest version ${e} released!`,doYouReallyWantToRemoveBookMove:e=>`Do you really want to remove the book move "${e}"?`,unexpectedRecordFileExtension:e=>`Unexpected record file extension: [${e}]`,fileNotFound:e=>`File not found. [${e}]`,directoryNotFound:e=>`Directory not found. [${e}]`,youCanExitFullScreenByPressing:e=>`You can exit full screen by pressing ${e} key.`,skippedMovesInMerge:(e,t)=>`${e} / ${t} moves were skipped in the merge.`,cpuUsageExceedsNPercent:e=>`CPU usage exceeds ${e}%.`,totalNumberOfThreadsExceedsNPercentOfCpuCores:e=>`The total number of threads exceeds ${e}% of CPU cores.`,memoryUsageExceedsNPercent:e=>`Memory usage exceeds ${e}%.`,memoryUsageIsLessThanNPercent:e=>`Memory usage is less than ${e}%.`,totalUSIHashExceedsNPercentOfMemory:e=>`The total USI_Hash exceeds ${e}% of memory.`},s={shogiHome:"ShogiHome",clear:"初期化",open:"開く",openNewInstance:"新しい ShogiHome ウィンドウを開く",saveOverwrite:"上書き保存",newRecord:"新規棋譜",newRecordKeepInitialPosition:"新規棋譜 (同じ初形)",newRecordHirateSetup:"新規棋譜(平手初形)",openRecord:"棋譜を開く",saveRecord:"棋譜を上書き保存",saveRecordAs:"棋譜を名前を付けて保存",openAutoSaveDirectory:"自動保存先を開く",exportPositionDiagram:"局面図を出力",positionImage:"局面図",batchConversion:"一括変換",recordFileBatchConversion:"棋譜ファイル一括変換",close:"閉じる",quit:"終了",reload:"再読み込み",editing:"編集",copyAsKIF:"コピー・KIF",copyAsKI2:"コピー・KI2",copyAsCSA:"コピー・CSA",copyAsUSI:"コピー・USI",copyAsSFEN:"コピー・SFEN",copyAsBOD:"コピー・BOD",copyAsJKF:"コピー・JKF",copyAsUSEN:"コピー・USEN",copy:"コピー",cut:"切り取り",paste:"貼り付け",copyRecordAll:"棋譜コピー(初手から)",copyRecordFromCurrentPosition:"棋譜コピー(現在の局面から)",asKIF:"KIF形式",asKI2:"KI2形式",asCSA:"CSA形式",asUSI:"USI形式",asUSIUntilCurrentMove:"USI形式(現在の指し手まで)",asUSIAll:"USI形式(全て)",asJSONKifuFormat:"JSON棋譜フォーマット",asUSEN:"USEN",copyPosition:"局面コピー",asSFEN:"SFEN形式",asBOD:"BOD形式",pasteRecordOrPosition:"棋譜・局面貼り付け",pasteRecordMerge:"棋譜貼り付け(マージ)",toRootPosition:"棋譜の先頭へ",toCurrentPosition:"現在の位置へ",addSpecialMove:"特殊な指し手",deleteMoves:"現在の位置から棋譜を削除",view:"表示",openLayoutManager:"レイアウトマネージャー",openMonitorWindow:"監視ウィンドウ",toggleFullScreen:"全画面表示切り替え",defaultFontSize:"標準の文字サイズ",increaseFontSize:"文字を拡大",decreaseFontSize:"文字を縮小",settings:"設定",config:"設定",debug:"デバッグ",toggleDevTools:"開発者ツール表示切り替え",logFile:"ログファイル",openAppLog:"アプリログを開く",openUSILog:"USI通信ログを開く",openCSALog:"CSA通信ログを開く",tailAppLog:"アプリログをTailする",tailUSILog:"USI通信ログをTailする",tailCSALog:"CSA通信ログをTailする",copyAppLogTailCommand:"アプリログのTailコマンドをコピー",copyUSILogTailCommand:"USI通信ログのTailコマンドをコピー",copyCSALogTailCommand:"CSA通信ログのTailコマンドをコピー",reloadCustomPieceImage:"カスタム駒画像をリロード",statisticsReport:"統計情報",launchUSIEngine:"USIエンジンを起動",connectToCSAServer:"CSAサーバーに接続",adminMode:"管理モード",inAdminModeManuallyInvokeCommandsAtPrompt:"管理モードではプロンプトから手動でコマンドを実行する必要があります。",setoptionAndPrecedingCommandsAreSentAutomatically:"setoptionコマンドまでのコマンドは自動で送信されます。",serverMustSupportShogiServerX1ModeLogIn:"サーバーは shogi-server の拡張モード (x1) ログインをサポートしている必要があります。",folders:"各種フォルダ",notification:"通知",notificationTest:"通知テスト",thisIsTestNotification:"これは通知のテストです。",app:"アプリ",log:"ログ",cache:"キャッシュ",help:"ヘルプ",openWebsite:"Webサイトを開く",openUserGuide:"使い方を開く",openLatestReleasePage:"最新版リリースページを開く",openStableReleasePage:"安定版リリースページを開く",license:"ライセンス",inputs:"入力",outputs:"出力",format:"フォーマット",formats:"フォーマット",subdirectories:"サブディレクトリ",separate:"個別",merge:"マージ",createSubdirectories:"サブディレクトリ作成",nameConflictAction:"名前衝突時の動作",numberSuffix:"番号付与",skip:"スキップ",convert:"変換",openLogFile:"ログファイルを開く",success:"成功",failed:"失敗",skipped:"スキップ",game:"対局",player:"プレイヤー",server:"サーバー",selectFromHistory:"履歴から選ぶ",noHistory:"履歴がありません",saveHistory:"履歴に保存する",version:"バージョン",gameProgress:"対局の経過",allGamesCompleted:"連続対局終了",wins:"勝ち数",winsOnBlack:"勝ち数(先手)",winsOnWhite:"勝ち数(後手)",draws:"引き分け",validGames:"有効対局数",invalidGames:"無効対局数",eloRatingDiff:"レーティング差",ignoreDraws:"引き分け無効",zValue:"Z値",significance5pc:"有意水準5%",significance1pc:"有意水準1%",gameEnded:"対局終了",offlineGame:"ローカル対局",csaOnlineGame:"通信対局(CSA)",csaProtocolOnlineGame:"通信対局(CSAプロトコル)",csaProtocolV121:"CSAプロトコル1.2.1 標準",csaProtocolV121WithPVComments:"CSAプロトコル1.2.1 読み筋コメント付き",host:"接続先ホスト",portNumber:"ポート番号",password:"パスワード",revealPassword:"パスワードを表示する",keepaliveInitialDelay:"Keepalive初期遅延",blankLinePing:"空行Ping",blankLinePingInitialDelay:"空行Ping初期遅延",blankLinePingInterval:"空行Ping間隔",logout:"ログアウト",calculateJishogiPoints:"持将棋の点数を計算",jishogiPoints:"持将棋の点数",displayGameResults:"戦績確認",interrupt:"中断",stopGame:"対局中断",resign:"投了",draw:"引き分け",impass:"持将棋",repetitionDraw:"千日手",repetition:"千日手",mate:"詰み",noMate:"不詰",blackWin:"先手勝ち",whiteWin:"後手勝ち",all:"全て",others:"その他",minRate:"最小レート",mateSearch:"詰み探索",startMateSearch:"詰み探索開始",stopMateSearch:"詰み探索終了",noMateFound:"詰みが見つかりませんでした。",timePerPosition:"思考時間",timeout:"時間切れ",foulWin:"反則勝ち",foulLose:"反則負け",enteringOfKing:"入玉勝ち",winByDefault:"不戦勝",loseByDefault:"不戦敗",winByDeclaration:"宣言勝ち",declareWin:"勝ち宣言",research:"検討",startResearch:"検討開始",endResearch:"検討終了",startEndResearch:"検討開始/終了",recordAnalysis:"棋譜解析",analysis:"解析",analyze:"解析開始",stopAnalysis:"解析中断",searchDuplicatePositions:"同一局面を検索",duplicatePositionSearch:"同一局面検索",duplicatePositions:"同一局面",duplicatePos:"同一局面",via:"経路",lastMove:"直前の指し手",nextMoves:"次の指し手",goToThisPosition:"この局面へ移動",noDuplicatePositions:"重複する局面はありません。",nDuplicatePositionsFound:e=>`${e} 件の重複する局面が見つかりました。`,appearanceCount:"出現数",showList:"一覧を表示",setupPosition:"局面編集",startPositionSetup:"局面編集開始",completePositionSetup:"局面編集終了",changeTurn:"手番変更",initializePosition:"局面の初期化",changePieceSet:"駒の増減",setAllPiecesToStandardCounts:"全ての駒を平手の枚数にする",setAllPiecesToZero:"全ての駒を0にする",appSettings:"アプリ設定",language:"言語",theme:"テーマ",standard:"標準",green:"緑",cherryBlossom:"桜",customImage:"カスタム画像",autumn:"紅葉",snow:"雪",darkGreen:"深緑",dark:"ダーク",boardLayout:"盤レイアウト",compact:"コンパクト",portrait:"ポートレイト",piece:"駒",singleKanjiPiece:"一文字駒",singleKanjiWoodPiece:"一文字駒(木目)",singleKanjiGothicPiece:"一文字駒(ゴシック体)",singleKanjiDarkPiece:"一文字駒(ダーク)",singleKanjiGothicDarkPiece:"一文字駒(ゴシック体・ダーク)",imageHasMarginsRemoveForLargerDisplay:"画像に余白が含まれている(除去して大きく表示)",backgroundImage:"背景画像",board:"盤",pieceStand:"駒台",woodTexture:"木目",lightWoodyTexture:e=>`木目(明${e})`,warmWoodTexture:e=>`木目(暖${e})`,resin:"樹脂",transparent:"透過表示",boardOpacity:"盤の不透明度",pieceStandOpacity:"駒台の不透明度",recordOpacity:"棋譜の不透明度",promotionSelector:"成・不成の表示",centeredHorizontal:"水平・中央寄せ",promoteFirstVertical:"垂直・成優先",promoteFirstHorizontal:"水平・成優先",showFileAndRank:"段・筋を表示",showLeftControls:"左側操作ボタンを表示",showRightControls:"右側操作ボタンを表示",tabViewStyle:"タブビューの形式",oneColumn:"1列",twoColumns:"2列",sounds:"音",pieceSoundVolume:"駒音の大きさ",clockSoundVolume:"時計音の大きさ",clockSoundPitch:"時計音の高さ",clockSoundTarget:"時計音の対象",anyTurn:"全ての手番",onlyHumanTurn:"人間の手番のみ",defaultRecordFileFormat:"デフォルトの保存形式",textEncoding:"文字コード",strict:"厳格",autoDetect:"自動判定",newlineCharacter:"改行文字",old90sMac:"90年代Mac",autoSaving:"自動保存",recordFileName:"棋譜ファイル名",select:"選択",shuffle:"シャッフル",csaV3Output:"CSA V3 で出力",alwaysOutputUTF8:"常に UTF-8 で出力",someOldShogiAppsCannotReadUTF8KifFiles:"一部の古い将棋アプリでは UTF-8 の KIF・KI2 ファイルを読み込めない場合があります。",strictDecodingMayFailToReadUTF8KifFiles:"文字コードの設定が「厳格」の場合、UTF-8 で書き出した KIF・KI2 ファイルの読み込みに失敗する可能性があります。",positionOfUSIOutput:"USI の局面表記",movesOfUSIOutput:"USI の指し手表記",onlySFEN:"SFEN のみ",minimal:"最小限",pasteDialog:"貼り付けダイアログ",liveDuplicatePositionDetection:"同一局面を常に検出",onTheFlyThreshold:"On-the-fly 閾値",usiProtocol:"USIプロトコル",translateOptionName:"オプション名を翻訳",functionalOnJapaneseOnly:"日本語選択時のみ有効",maxStartupTime:"最大起動待ち時間",forDevelopers:"開発者向け",enableAppLog:"アプリログを出力",enableUSILog:"USI通信ログを出力",enableCSALog:"CSA通信ログを出力",logLevel:"ログレベル",manageEngines:"エンジン設定",flipBoard:"盤面反転",elapsedTimeChart:"消費時間チャート",shortcutKeys:"ショートカットキー",useUpDownToMove1Ply:"↑/↓キーで1手移動",useLeftRightToMove1Ply:"←/→キーで1手移動",file:"ファイル",folder:"フォルダ",recordFile:"棋譜ファイル",executableFile:"実行可能ファイル",imageFile:"画像ファイル",unsaved:"未保存",remove:"削除",deleteMove:"指し手削除",recordProperties:"棋譜情報",comments:"コメント",commentsAndBookmarks:"コメント・しおり",branches:"分岐",branchListMode:"分岐の表示",previousMoveBranches:"着手した手",nextMoveBranches:"次の手",bookmark:"しおり",bookmarkList:"しおり一覧",useBookmarkAsHeader:"しおりを見出しに使う",moveComments:"指し手コメント",searchLog:"思考",pv:"読み筋",mateShort:"詰",displayPVShort:"再現",evaluation:"評価値",rawScore:"評価値",score:"評価値",estimatedWinRate:"期待勝率",evaluationAndEstimatedWinRateAndPV:"評価値・期待勝率・読み筋",swapEachTurnChange:"手番側有利がプラスの値",alwaysSenteIsPositive:"先手有利がプラスの値",signOfEvaluation:"評価値の符号",showArrowScore:"矢印に評価値を表示",arrowScoreDiffRange:"矢印の評価値範囲",maxArrows:"矢印の表示数",winRateCoefficient:"勝率換算係数",nodeCountFormat:"ノード数表記",plainNumber:"装飾無し",commaSeparated:"カンマ区切り",monitor:"監視",hideTabView:"最小化",expandTabView:"タブビューを再表示",sente:"先手",senteOrShitate:"先手(下手)",shitate:"下手",gote:"後手",goteOrUwate:"後手(上手)",uwate:"上手",targetEngine:"検査対象エンジン",baseEngine:"基準エンジン",swapSenteGote:"先後入れ替え",pieceToss:"振り駒",currentPosition:"現在の局面",positionList:"局面集",enableEngineTimeout:"エンジンの時間切れあり",setDifferentTimeForGote:"後手に異なる時間を設定",nextTurn:"次の手番",elapsedTime:"消費時間",elapsed:"経過時間",rank:"順位",depth:"深さ",searchEngine:"エンジン",ponder:"先読み(Ponder)",numberOfThreads:"スレッド数",threads:"スレッド",suggestionsCount:"候補手の数",startPosition:"開始局面",beginFromThisPosition:"この局面から開始",maxMoves:"最大手数",gameRepetition:"連続対局",parallelism:"並列数",parallelGame:"並列対局",jishogi:"持将棋",rule24:"24点法",rule27:"27点法",tryRule:"トライルール",autoRelogin:"自動で再ログインする",restartItEveryGame:"1局ごとに再起動する",swapTurnWhenGameRepetition:"1局ごとに手番を入れ替える",outputComments:"コメントを出力する",saveRecordAutomatically:"棋譜を自動で保存する",adjustBoardToHumanPlayer:"人を手前に表示する",adjustBoardAutomatically:"盤面の向きを自動調整",command:"コマンド",startGame:"対局開始",cancelGame:"対局をキャンセル",allottedTime:"持ち時間",byoyomi:"秒読み",increments:"増加",startEndCriteria:"開始・終了条件",descending:"逆順",endCriteria1Move:"局面ごとの終了条件",outputSettings:"出力設定",noOutputs:"出力しない",insertCommentToTop:"前方に加筆する",appendCommentToBottom:"末尾に加筆する",insertToComment:"コメントに挿入",insertToRecord:"棋譜に挿入",overwrite:"上書きする",fromPrefix:"",fromSuffix:"から",toPrefix:"",toSuffix:"まで",plyPrefix:"",plySuffix:"手目",hoursSuffix:"時間",minutesSuffix:"分",secondsSuffix:"秒",eg:"例:",totalMoves:"総手数",detailSettings:"詳細設定",engineManagement:"エンジン管理",engineName:"エンジン名",author:"作者",earlyPonder:"早期Ponder",enginePath:"場所",openDirectory:"フォルダを開く",replaceEnginePath:"エンジン再選択",displayName:"表示名",frontendBook:"定跡 (GUI拡張)",showAllOptions:"全てのオプションを表示",invoke:"実行",resetToEngineDefaultValues:"エンジンの既定値に戻す",defaultValue:"既定値",freeTextUnsafe:"自由入力(非推奨)",noEngineRegistered:"エンジンが登録されていません。",duplicate:"複製",add:"追加",compareAndMerge:"比較・マージ",compareEngineSettings:"エンジン設定の比較",noDifference:"差分なし",mergeToLeft:"左へマージ",mergeToRight:"右へマージ",recommended:"推奨",import:"取り込む",saveAndClose:"保存して閉じる",save:"保存",saveAs:"保存",history:"履歴",clearHistory:"履歴をクリア",userFile:"ユーザーのファイル",automaticBackup:"自動バックアップ",restore:"復元",loadRecordFromWeb:"Webの棋譜を取得",backToMainBranch:"本譜に戻る",fetchLatestData:"最新データを取得",sourceURL:"ソースURL",ok:"OK",cancel:"キャンセル",back:"戻る",doNotShowAgain:"次回から表示を省略",name:"名前",prediction:"予想",best:"最善",nodes:"Node数",hashUsage:"Hash使用率",stop:"停止",resume:"再開",noHandicap:"平手",lanceHandicap:"香落ち",rightLanceHandicap:"右香落ち",bishopHandicap:"角落ち",rookHandicap:"飛車落ち",rookLanceHandicap:"飛車香落ち",twoPiecesHandicap:"二枚落ち",fourPiecesHandicap:"四枚落ち",sixPiecesHandicap:"六枚落ち",eightPiecesHandicap:"八枚落ち",tenPiecesHandicap:"十枚落ち",tsumeShogi:"詰将棋",doubleKingTsumeShogi:"双玉詰将棋",startDateTime:"開始日時",endDateTime:"終了日時",gameDate:"対局日",tournament:"棋戦",strategy:"戦型",gameTitle:"表題",timeLimit:"持ち時間",blackTimeLimit:"先手の持ち時間",whiteTimeLimit:"後手の持ち時間",place:"場所",postedOn:"掲載",note:"備考",senteShortName:"先手省略名",goteShortName:"後手省略名",scorekeeper:"記録係",opusNo:"作品番号",opusName:"作品名",publishedBy:"発表誌",publishedOn:"発表年月",source:"出典",numberOfMoves:"手数",integrity:"完全性",recordCategory:"分類",award:"受賞",filterByOptionName:"オプション名で検索",filterByEngineName:"エンジン名で検索",bookStyle:"書籍風",bookStyleDiagram:"書籍風局面図",gameStyle:"対局画面風",thin:"細",bold:"太",extraBold:"極太",playerName:"対局者名",typeface:"書体",weight:"太さ",handLabel:"持ち駒ラベル",header:"見出し",vertical:"垂直方向",size:"サイズ",none:"なし",bgCover:"1枚で表示",bgContain:"拡大して表示",bgTile:"タイル状に表示",inaccuracy:"緩手",dubious:"疑問手",mistake:"悪手",blunder:"大悪手",inaccuracyThreshold:"緩手の閾値",dubiousThreshold:"疑問手の閾値",mistakeThreshold:"悪手の閾値",blunderThreshold:"大悪手の閾値",maxPVLength:"読み筋表示手数",commentFormat:"コメントの形式",gothic:"ゴシック体",mincho:"明朝体",appVersion:"アプリバージョン",installed:"インストール済み",stable:"安定版",latest:"最新版",backgroundColor:"背景色",dialogPosition:"ダイアログ表示位置",alignLeft:"左",alignRight:"右",alignCenter:"中央",dialogBackdrop:"ダイアログ表示中の暗転",record:"棋譜",book:"定跡",chart:"グラフ",analytics:"解析",controlGroup:"メニュー",left:"左",top:"上",width:"幅",height:"高さ",newCustomProfile:"新規カスタムプロファイル",addCustomLayoutProfile:"新規レイアウトプロファイル",duplicateCurrentProfile:"現在のプロファイルを複製",removeCurrentProfile:"現在のプロファイルを削除",exportProfileToClipboard:"プロファイルをクリップボードに出力",importProfileFromClipboard:"クリップボードからプロファイルを取り込む",profileExportedToClipboard:"プロファイルをクリップボードに出力しました。",profileImported:"プロファイルを取り込みました。",failedToImportProfile:"プロファイルの取り込みに失敗しました。",rightControlBox:"右側メニュー",leftControlBox:"左側メニュー",topControlBox:"操作ボタン",legends:"凡例",historyMode:"履歴モード",headers:"ヘッダー",playButton:"再現ボタン",insert:"挿入",bringForward:"前面へ",sendBackward:"背面へ",move:"指し手",bookMove:"定跡手",play:"着手",edit:"編集",addMoves:"指し手追加",flippedBook:"反転も検索",addBookMoves:"定跡手追加",fromCurrentRecord:"現在の棋譜から",fromFile:"ファイルから",fromDirectory:"フォルダから",noMoves:"指し手がありません。",register:"登録",update:"更新",currentMove:"現在の手",branchFrom:e=>`${e}手目から分岐`,allPlayers:"全ての対局者",blackPlayerOnly:"先手のみ",whitePlayerOnly:"後手のみ",filterByName:"名前でフィルタ",enterPartOfPlayerNameHere:"ここに対局者名の一部を入力",freq:"出現頻度",frequency:"出現頻度",new:"新規",duplicated:"重複",moveEntry:"登録手数",updatedAt:"更新日時",createdAt:"作成日時",lastSent:"最終送信",lastReceived:"最終受信",protocolVersion:"プロトコルバージョン",prompt:"プロンプト",openPrompt:"プロンプトを開く",forceQuit:"強制Quit",forceClose:"強制Close",blankLine:"空行",autoScroll:"自動スクロール",showTimestamp:"タイムスタンプを表示",highlightByPartialMatch:"部分一致でハイライト",csaServer:"CSAサーバー",usiEngine:"USIエンジン",noRunningUSIEngine:"稼働中のUSIエンジンはありません。",noConnectedCSAServer:"接続中のCSAサーバーはありません。",willBeRemovedFromTheListSoon:"セッションが終了したため、まもなく一覧から削除されます。",typeCommandHereAndPressEnter:"コマンドを入力してEnter",allowBlankLine:"空行を許可",removeSpaceFromBothEnds:"両端の空白を削除",collapseSequentialSpaces:"連続する空白をまとめる",typeCustomTitleHere:"ここに見出しを入力",displayEmptyElements:"未入力の項目を表示",share:"シェア",waitingForNewGame:"対局開始を待っています。",waitingForPlayerSetup:"対局者の準備を待っています。",insertedComment:"コメントを挿入しました。",conversionCompleted:"変換が完了しました。",human:"人",randomPlayer:"ランダムプレイヤー",beginner:"初心者",staticRook:"居飛車",rangingRook:"振り飛車",pleaseSelectEngines:"エンジンを選択してください。",thisItemCannotBeMerged:"この項目はマージできません。",tryingToConnectAndLoginToCSAServer:"CSAサーバーへの接続とログインを試みています。",inBrowserLogsOutputToConsoleAndIgnoreThisSetting:"※ブラウザ版ではログがコンソールに出力され、ここでの設定は無視されます。",shouldRestartToApplyLogSettings:"※ログ設定の変更を反映するにはアプリの再起動が必要です。",canOpenLogDirectoryFromMenu:"※ログの出力先は「デバッグ」-「ログファイルの場所を開く」で開きます。",hasNoOldLogCleanUpFeature:"※現在、古いログファイルの自動削除機能はありません。",shouldRestartToApplyLowLevelSettings:"※低レベルの設定を反映するにはアプリの再起動が必要です。",processingPleaseWait:"処理中です。お待ちください。",importingFollowingRecordOrPosition:"以下の棋譜(または局面)を取り込みます。",supportsKIF_KI2_CSA_USI_SFEN_JKF_USEN:"※KIF形式/KI2形式/CSA形式/USI/SFEN/JKF/USENに対応しています。",pleasePasteRecordIntoTextArea:"※テキストエリアに棋譜を貼り付けてください。",pleaseSpecifyPlainTextURL:"※プレーンテキストのURLを指定してください。",redirectNotSupported:"※リダイレクトはサポートされていません。",desktopVersionPastesAutomatically:"※インストールアプリ版では自動的に貼り付けられます。",asNewFile:"新規ファイル",mergeToRootPosition:"棋譜の先頭へマージ",mergeToCurrentPosition:"現在の位置へマージ",failedToMergeRecordWithDifferentInitialPosition:"初期局面が異なるため棋譜をマージできませんでした。",failedToMergeRecordWithDifferentTurn:"手番が異なるため棋譜をマージできませんでした。",earlyPonderFeatureSendsPonderhitCommandWithYaneuraOusNonStandardOptions:"早期Ponder機能は、やねうら王の独自オプションでponderhitコマンドを送信します。",ifYourEngineNotSupportTheOptionsItMayCauseUnexpectedBehavior:"エンジンがこのオプションに対応していない場合、予期しない動作を引き起こす可能性があります。",someLogsDisabled:"一部のログが無効になっています。",logsRecommendedForCSAProtocol:"CSAプロトコルを使用した対局では各種ログの出力を推奨します。",pleaseEnableLogsAndRestart:"アプリ設定からログを有効にしてアプリを再起動してください。",hwaEnabled:"HWA(ハードウェアアクセラレーション)が有効です。",hwaIsNotRecommendedForLongGames:"長時間の対局ではHWAの無効化を推奨します。",pleaseDisableHWAAndRestart:"アプリ設定からHWAを無効にしてアプリを再起動してください。",notSendPVOnStandardCSAProtocol:"標準のCSAプロトコルでは評価値や読み筋が送信されません。",passwordWillSavedPlaintextBecauseOSSideEncryptionNotAvailable:"OSの暗号化機能が利用できないため、入力したパスワードは平文で保存されます。",pleaseUncheckSaveHistoryIfNotWantSave:"保存したくない場合は「履歴に保存する」のチェックを外してください。",floodgatePasswordShouldStartWithGameName:"Floodgateのパスワードはゲーム名で始まる必要があります。",thisIsNotFloodgateOfficialGameName:"これはFloodgate公式のゲーム名ではありません。",yourPasswordDoesNotMeetFloodgateRequirementsDoYouStillWantToContinue:"パスワードがFloodgateの要件を満たしていない可能性があります。続行しますか?",whenNewVersionIsAvailableItWillBeNotified:"新しいバージョンが利用可能になると通知されます。",pleaseCheckMessageThisIsTestNotificationByAboveButton:"上のボタンで「これは通知のテストです。」というメッセージを確認してください。",ifNotWorkYouShouldAllowNotificationOnOSSetting:"表示されない場合はOSの設定で通知を許可してください。",translationHelpNeeded:"翻訳の改善にご協力ください。",restartRequiredAfterLocaleChange:"言語の変更には再起動が必要です。",createDesktopShortcut:"デスクトップにショートカットを作成",desktopShortcutCreated:"デスクトップにショートカットを作成しました。",areYouSureWantToResign:"投了しますか?",areYouSureWantToDoDeclaration:"宣言しますか?",areYouSureWantToQuitGames:"連続対局を中断しますか?",areYouSureWantToRequestQuit:"中断を要求すると負けになる可能性があります。よろしいですか?",areYouSureWantToClearRecord:"現在の棋譜は削除されます。よろしいですか?",areYouSureWantToDiscardPosition:"現在の局面は破棄されます。よろしいですか?",areYouSureWantToOpenFileInsteadOfCurrentRecord:"現在の棋譜を閉じて別のファイルを開きます。よろしいですか?",areYouSureWantToClearHistory:"履歴をクリアします。よろしいですか?",areYouSureWantToRemoveCurrentProfile:"現在のプロファイルを削除します。よろしいですか?",yamlFormatSettingsCopiedToClipboard:"YAML形式の設定をクリップボードにコピーしました。",jsonFormatSettingsCopiedToClipboard:"JSON形式の設定をクリップボードにコピーしました。",usiCsaBridgeCommandCopiedToClipboard:"usi-csa-bridge コマンドをクリップボードにコピーしました。",copiedToClipboard:"クリップボードにコピーしました。",pastedFromClipboard:"クリップボードから貼り付けました。",youCanNotCloseAppWhileCSAOnlineGame:"CSAプロトコル使用中はアプリを終了できません。",fileExtensionNotSupported:"取り扱いできないファイル拡張子です。",errorOccuredWhileDisconnectingFromCSAServer:"CSAサーバーからの切断中にエラーが発生しました。",failedToConnectToCSAServer:"CSAサーバーに接続できませんでした。",errorOccuredWhileLogoutFromCSAServer:"CSAサーバーからのログアウト中にエラーが発生しました。",disconnectedFromCSAServer:"CSAサーバーへの接続が切れました。",csaServerLoginDenied:"CSAサーバーへのログインが拒否されました。",thisFeatureNotAvailableOnWebApp:"Web版では利用できない機能です。",failedToStartNewGame:"対局の開始に失敗しました。",errorOccuredWhileEndingGame:"対局の終了中にエラーが発生しました。",failedToSendGoCommand:"goコマンドを送信できませんでした。",failedToSendPonderCommand:"ponderコマンドを送信できませんでした。",failedToSendStopCommand:"stopコマンドを送信できませんでした。",failedToShutdownEngines:"エンジンを正常に終了できませんでした。",failedToCheckUpdates:"アップデートの確認ができませんでした。",failedToSaveRecord:"棋譜の保存に失敗しました。",failedToParseSFEN:"SFENの読み込みに失敗しました。",failedToDetectRecordFormat:"棋譜形式を判別できませんでした。",unknown:"不明",unknownFileExtension:"不明なファイル形式です。",emptyRecordInput:"棋譜が入力されていません。",invalidPieceName:"不正な駒",invalidTurn:"不正な手番",invalidMove:"不正な指し手",invalidMoveNumber:"不正な手数",invalidDestination:"不正な移動先",pieceNotExists:"存在しない駒",invalidLine:"不正な行",invalidBoard:"不正な盤面",invalidHandPiece:"不正な持ち駒",invalidUSI:"不正なUSI",engineProcessWasClosedUnexpectedly:"エンジンプロセスが予期せず終了しました。",backgroundImageFileNotSelected:"背景画像のファイルが選択されていません。",pieceImageFileNotSelected:"駒画像のファイルが選択されていません。",boardImageFileNotSelected:"盤面画像のファイルが選択されていません。",pieceStandImageFileNotSelected:"駒台画像のファイルが選択されていません。",pieceSoundVolumeMustBe0To100Percent:"駒音の大きさには0%~100%の値を指定してください。",clockSoundVolumeMustBe0To100Percent:"時計音の大きさには0%~100%の値を指定してください。",clockSoundPitchMustBe220To880Hz:"時計音の高さには220Hz~880Hzの値を指定してください。",engineTimeoutMustBe1To300Seconds:"エンジンのタイムアウト時間には1秒~300秒の値を指定してください。",coefficientInSigmoidMustBeGreaterThan0:"勝率換算係数には0より大きい値を指定してください。",inaccuracyThresholdMustBe1To100Percent:"緩手には1%~100%の値を指定してください。",dubiousThresholdMustBe1To100Percent:"疑問手には1%~100%の値を指定してください。",mistakeThresholdMustBe1To100Percent:"悪手には1%~100%の閾値を指定してください。",blunderThresholdMustBe1To100Percent:"大悪手には1%~100%の値を指定してください。",recordSavedWithGarbledCharacters:"保存した棋譜の一部が文字化けしている可能性があります。",pleaseConsiderToUseKIFU:"KIFU形式(UTF-8)で保存することをお勧めします。",youCanChangeDefaultRecordFileFormatFromAppSettings:"デフォルトの棋譜形式はアプリ設定で変更可能です。",inaccuracyThresholdMustBeLessThanDubiousThreshold:"緩手には疑問手より小さい値を指定してください。",dubiousThresholdMustBeLessThanMistakeThreshold:"疑問手には悪手より小さい値を指定してください。",mistakeThresholdMustBeLessThanBlunderThreshold:"悪手には大悪手より小さい値を指定してください。",thisEngineNotSupportsMateSearch:"このエンジンは詰将棋探索をサポートしていません。",pleaseEndActiveFeaturesBeforeOpenRecord:"棋譜を開くには現在利用している機能を終了してください。",bothTimeLimitAndByoyomiAreNotSet:"持ち時間と秒読みが両方とも0です。",canNotUseByoyomiWithFischer:"秒読みとフィッシャールールは併用できません。",repeatsMustBeOneIfHumanPlayerIncluded:"人が対局する場合、連続対局の回数は1以外を設定できません。",parallelismMustBeOneIfHumanPlayerIncluded:"人が対局する場合、並列実行数は1以外を設定できません。",parallelismMustBeOneIfCurrentPositionIsUsed:"現在の局面を開始局面にする場合、並列実行数は1以外を設定できません。",parallelismMustLessThanOrEqualToRepeats:"並列実行数は連続対局の回数以下にしてください。",protocolVersionNotSelected:"プロトコルのバージョンを選択してください。",hostNameIsEmpty:"ホスト名が空です。",invalidPortNumber:"無効なポート番号です。",idIsEmpty:"IDが空です。",idContainsSpace:"IDに空白が含まれています。",passwordContainsSpace:"パスワードに空白が含まれています。",tcpKeepaliveInitialDelayMustBePositive:"TCP Keepaliveの初期遅延時間には正の値を指定してください。",blankLinePingInitialDelayMustBeGreaterThanOrEqualTo30:"空行送信の初期遅延時間には30秒以上を指定してください。",blankLinePingIntervalMustBeGreaterThanOrEqualTo30:"空行送信の間隔には30秒以上を指定してください。",engineNotSelected:"エンジンが選択されていません。",forExportingConversionLogPleaseEnableAppLogsAndSetLogLevelDebugAndRestart:"変換ログを出力するにはアプリログを有効にし、ログレベルをデバッグに設定してアプリを再起動してください。",sourceDirectoryNotSpecified:"入力ディレクトリが指定されていません。",sourceFileMustBeSFEN:"入力ファイルは .sfen 形式でなければなりません。",sourceFormatsNotSpecified:"入力の対象フォーマットが指定されていません。",destinationDirectoryNotSpecified:"出力ディレクトリが指定されていません。",destinationFileNotSpecified:"出力ファイルが指定されていません。",anyUnsavedDataWillBeLostDoYouReallyWantToResetBookData:"保存していない内容は失われます。定跡を初期化しますか?",bookMovesWereImported:"定跡データをインポートしました。",anyBookMovesAreUnsavedDoYouReallyWantToDiscardThemAndCloseTheApp:"保存されていない定跡があります。破棄してアプリを終了しますか?",cannotOverwriteOnTheFlyBook:"On-the-fly モードで読み込み中の定跡は上書き保存できません。",pleaseSpecifyOtherFileName:"別のファイル名を指定してください。",sourceRecordFileNotSet:"棋譜ファイルが指定されていません。",sourceDirectoryNotSet:"フォルダを選択してください。",minPlyMustBeLessThanMaxPly:"最小手数は最大手数より小さくしてください。",playerNameNotSet:"対局者名が設定されていません。",incompatibleOptionsWillBeDiscardedDoYouReallyWantToReplaceTheEnginePath:"互換性のないオプションがある場合それらは破棄されます。エンジンを置き換えますか?",largeSuggestionsCountMayCausePerformanceDegradation:"候補手を増やしすぎると動作が重くなる可能性があります。",doYouReallyWantToIncreaseTheSuggestionsCount:"本当に候補手の数を増やしますか?",recommendLowerSettingsForDailyUse:"日常利用のPCでは低めの設定を推奨します。",checkEngineCompatibilityForNumaEnvironments:"このPCは複数のCPUソケットまたはプロセッサーグループ(NUMA)を持つ可能性があります。NUMA環境に対応していないエンジンでは性能が低下する場合があります。エンジンのNUMA対応状況をご確認ください。",aiPerformanceMayDegrade:"AIの性能が低下する可能性があります。",yourPCMayBecomeSlow:"PCの動作が重くなる可能性があります。",increasingItMayImproveAIPerformance:"大きくすることでAIの性能が向上する可能性があります。",totalNumber:e=>`合計 ${e} 件`,number:e=>`${e} 件`,tryToReloginToCSAServerNSecondsLater:e=>`CSAサーバーへのログインを${e}秒後に再試行します。`,mateInNPlyDoYouWantToDisplay:e=>`${e}手で詰みました。再生画面を表示しますか?`,insertedNMovesToRecord:e=>`${e}手を棋譜に挿入しました。`,errorsOccurred:e=>`${e} 種類のエラーが発生しました。`,between:(e,t)=>`${e} から ${t} まで`,addNthEngine:e=>`${e} 個目のエンジンを追加`,copyOf:e=>`${e} のコピー`,keepLatest:e=>`最新${e}件まで`,followingDataNotSavedBecauseNotSupporetedBy:e=>`以下の情報は ${e} 形式では対応していないため保存されませんでした。`,areYouSureWantToDeleteFollowingMove:e=>`${e}手目以降を削除します。よろしいですか?`,failedToOpenDirectory:e=>`ファイルの場所を開けませんでした: ${e}`,unexpectedEventSenderPleaseReport:e=>`予期せぬイベントの送信元です。このエラーメッセージを開発者に報告してください。 [${e}]`,unexpectedHTTPMethodPleaseReport:e=>`予期せぬHTTPメソッドです。このエラーメッセージを開発者に報告してください。 [${e}]`,unexpectedRequestURLPleaseReport:e=>`予期せぬURLへのリクエストです。このエラーメッセージを開発者に報告してください。 [${e}]`,noResponseFromEnginePleaseExtendTimeout:e=>`${e}秒以内にエンジンから応答がありませんでした。エンジンの起動が重い場合はアプリ設定で待ち時間を延長してください。`,stableVersionReleased:e=>`安定版 ${e} がリリースされました!`,latestVersionReleased:e=>`最新版 ${e} がリリースされました!`,doYouReallyWantToRemoveBookMove:e=>`定跡手 ${e} を削除します。よろしいですか?`,unexpectedRecordFileExtension:e=>`サポートされていない棋譜の拡張子です。 [${e}]`,fileNotFound:e=>`ファイルが見つかりません。 [${e}]`,directoryNotFound:e=>`フォルダが見つかりません。 [${e}]`,youCanExitFullScreenByPressing:e=>`全画面表示を終了するには ${e} キーを押してください。`,skippedMovesInMerge:(e,t)=>`${t}手中、${e}手がマージできませんでした。`,cpuUsageExceedsNPercent:e=>`全CPUコアの${e}%を超えています。`,totalNumberOfThreadsExceedsNPercentOfCpuCores:e=>`スレッド数の合計がCPUコア数の${e}%を超えています。`,memoryUsageExceedsNPercent:e=>`全メモリの${e}%を超えています。`,memoryUsageIsLessThanNPercent:e=>`全メモリの${e}%未満です。`,totalUSIHashExceedsNPercentOfMemory:e=>`USI_Hash の合計が全メモリの${e}%を超えています。`},r={shogiHome:"ShogiHome",clear:"清除",open:"開啟",openNewInstance:"開啟新的 ShogiHome 視窗",saveOverwrite:"覆蓋檔案",newRecord:"新棋譜",newRecordKeepInitialPosition:"新棋譜(保留初手局面)",newRecordHirateSetup:"新棋譜(平手初形)",openRecord:"打開棋譜",saveRecord:"保存棋譜",saveRecordAs:"另存棋譜",openAutoSaveDirectory:"打開自動保存目錄",exportPositionDiagram:"輸出局面圖",positionImage:"局面圖",batchConversion:"棋譜大量轉換",recordFileBatchConversion:"棋譜大量轉換",close:"關閉",quit:"離開",reload:"重新載入",editing:"編輯",copyAsKIF:"複製KIF棋譜",copyAsKI2:"複製KI2棋譜",copyAsCSA:"複製CSA棋譜",copyAsUSI:"複製USI棋譜",copyAsSFEN:"複製SFEN局面",copyAsBOD:"複製BOD局面",copyAsJKF:"複製JKF棋譜",copyAsUSEN:"複製USEN棋譜",copy:"拷貝",cut:"剪下",paste:"貼上",copyRecordAll:"複製棋譜(自初手局面)",copyRecordFromCurrentPosition:"複製棋譜(自目前局面)",asKIF:"KIF形式",asKI2:"KI2形式",asCSA:"CSA形式",asUSI:"USI形式",asUSIUntilCurrentMove:"USI形式(到目前手數為止)",asUSIAll:"USI形式(全部)",asJSONKifuFormat:"JSON Kifu Format",asUSEN:"USEN形式",copyPosition:"複製局面",asSFEN:"SFEN形式",asBOD:"BOD形式",pasteRecordOrPosition:"貼上棋譜、局面",pasteRecordMerge:"棋譜貼上(合併)",toRootPosition:"自棋譜開頭合併",toCurrentPosition:"自目前局面合併",addSpecialMove:"特殊手",deleteMoves:"刪除現在位置後的棋譜",view:"表示",openLayoutManager:"開啟佈局管理員",openMonitorWindow:"監視視窗",toggleFullScreen:"切換全螢幕",defaultFontSize:"預設字體尺寸",increaseFontSize:"增加字體尺寸",decreaseFontSize:"縮小字體尺寸",settings:"設定",config:"設定",debug:"偵錯",toggleDevTools:"打開/關閉開發者工具顯示",logFile:"紀錄檔",openAppLog:"開啟程式紀錄檔",openUSILog:"開啟USI通訊紀錄檔",openCSALog:"開啟CSA通訊紀錄檔",tailAppLog:"即時顯示程式紀錄",tailUSILog:"即時顯示USI通訊紀錄",tailCSALog:"即時顯示CSA通訊紀錄",copyAppLogTailCommand:"複製即時顯示程式紀錄指令",copyUSILogTailCommand:"複製即時顯示USI通訊紀錄指令",copyCSALogTailCommand:"複製即時顯示CSA通訊紀錄指令",reloadCustomPieceImage:"重整自訂棋駒圖片",statisticsReport:"統計情報",launchUSIEngine:"啟動USI引擎",connectToCSAServer:"連接CSA伺服器",adminMode:"管理模式",inAdminModeManuallyInvokeCommandsAtPrompt:"在管理模式下,您需要手動輸入指令方可執行。",setoptionAndPrecedingCommandsAreSentAutomatically:"setoption 之前的指令將會被自動發送。",serverMustSupportShogiServerX1ModeLogIn:"對應的 shogi-server 必須支援擴展 (x1) 登入模式。",folders:"資料夾",notification:"通知",notificationTest:"通知測試",thisIsTestNotification:"這是測試用的通知。",app:"軟體",log:"紀錄檔",cache:"快取",help:"協助",openWebsite:"官方網站",openUserGuide:"使用教學",openLatestReleasePage:"前往最新版發布頁面",openStableReleasePage:"前往安定版發布頁面",license:"授權條款",inputs:"輸入目錄",outputs:"輸出目錄",format:"格式",formats:"格式",subdirectories:"子目錄",separate:"個別",merge:"合併",createSubdirectories:"建立子目錄",nameConflictAction:"名稱衝突處理方式",numberSuffix:"附加編號",skip:"跳過該檔案",convert:"開始轉換",openLogFile:"打開記錄檔案",success:"成功",failed:"失敗",skipped:"跳過",game:"對局",player:"玩家",server:"伺服器",selectFromHistory:"從紀錄選取",noHistory:"目前沒有紀錄",saveHistory:"保存紀錄",version:"版本",gameProgress:"對局過程",allGamesCompleted:"連續對局結束",wins:"勝利數目",winsOnBlack:"勝場(先手)",winsOnWhite:"勝場(後手)",draws:"平手數目",validGames:"有效對局數",invalidGames:"無效對局數",eloRatingDiff:"等級分相差",ignoreDraws:"忽略平手對局",zValue:"Z值",significance5pc:"顯著性水準5%",significance1pc:"顯著性水準1%",gameEnded:"對局結束",offlineGame:"本地(單機)對局",csaOnlineGame:"通訊對局(CSA)",csaProtocolOnlineGame:"通訊對局(CSA協定)",csaProtocolV121:"CSA協定 1.2.1 標準",csaProtocolV121WithPVComments:"CSA協定 1.2.1 +思考註解",host:"連接之伺服器",portNumber:"連接埠號碼",password:"密碼",revealPassword:"顯示密碼",keepaliveInitialDelay:"Keepalive初始延遲",blankLinePing:"空行Ping",blankLinePingInitialDelay:"空行Ping初始延遲",blankLinePingInterval:"空行Ping間隔",logout:"登出",calculateJishogiPoints:"計算持將棋點數",jishogiPoints:"持將棋點數",displayGameResults:"確認戰績",interrupt:"中斷",stopGame:"對局中斷",resign:"投了",draw:"平手",impass:"持將棋",repetitionDraw:"千日手",repetition:"千日手",mate:"詰死",noMate:"無詰",blackWin:"先手勝利",whiteWin:"後手勝利",all:"全部",others:"其他",minRate:"最低等級分",mateSearch:"詰搜尋",startMateSearch:"開始詰搜尋",stopMateSearch:"結束詰搜尋",noMateFound:"在目前的盤面中找不到詰。",timePerPosition:"思考時間",timeout:"時間耗盡",foulWin:"反則勝利",foulLose:"反則敗北",enteringOfKing:"入玉勝利",winByDefault:"不戰勝",loseByDefault:"不戰敗",winByDeclaration:"勝利宣言",declareWin:"勝利宣言",research:"檢討",startResearch:"檢討開始",endResearch:"結束檢討",startEndResearch:"檢討開始/結束",recordAnalysis:"棋譜解析",analysis:"解析",analyze:"解析開始",stopAnalysis:"中斷解析",searchDuplicatePositions:"同一局面を検索",duplicatePositionSearch:"同一局面検索",duplicatePositions:"同一局面",duplicatePos:"同一局面",via:"経路",lastMove:"直前の指し手",nextMoves:"次の指し手",goToThisPosition:"この局面へ移動",noDuplicatePositions:"重複する局面はありません。",nDuplicatePositionsFound:e=>`${e} 件の重複する局面が見つかりました。`,appearanceCount:"出現数",showList:"一覧を表示",setupPosition:"編輯局面",startPositionSetup:"開始編輯局面",completePositionSetup:"結束編輯局面",changeTurn:"變更手番",initializePosition:"初始化局面",changePieceSet:"調整棋駒數",setAllPiecesToStandardCounts:"全ての駒を平手の枚数にする",setAllPiecesToZero:"全ての駒を0にする",appSettings:"程式設定",language:"語言",theme:"主題",standard:"標準",green:"綠色",cherryBlossom:"櫻花",customImage:"自定義圖片",autumn:"紅葉",snow:"雪",darkGreen:"深綠",dark:"深色主題",boardLayout:"棋盤設計",compact:"緊湊",portrait:"直向",piece:"棋駒",singleKanjiPiece:"一文字駒",singleKanjiWoodPiece:"一文字駒(木目)",singleKanjiGothicPiece:"一文字駒(黑體)",singleKanjiDarkPiece:"一文字駒(深色)",singleKanjiGothicDarkPiece:"一文字駒(黑體・深色)",imageHasMarginsRemoveForLargerDisplay:"圖片含有透明邊界(去除後圖片會略為放大)",backgroundImage:"背景圖片",board:"棋盤",pieceStand:"駒台",woodTexture:"木目",lightWoodyTexture:e=>`木目(亮色${e})`,warmWoodTexture:e=>`木目(暖色${e})`,resin:"樹脂",transparent:"透明",boardOpacity:"盤面不透明度",pieceStandOpacity:"駒台不透明度",recordOpacity:"棋譜不透明度",promotionSelector:"成變、不成對話框顯示",centeredHorizontal:"水平置中",promoteFirstVertical:"垂直(成變優先)",promoteFirstHorizontal:"水平(成變優先)",showFileAndRank:"顯示段・筋",showLeftControls:"顯示左側操作按鈕",showRightControls:"顯示右側操作按鈕",tabViewStyle:"分頁顯示形式",oneColumn:"1列",twoColumns:"2列",sounds:"音效",pieceSoundVolume:"棋駒音效",clockSoundVolume:"棋鐘音效大小",clockSoundPitch:"棋鐘音效頻率",clockSoundTarget:"棋鐘音效對象",anyTurn:"所有手番",onlyHumanTurn:"只有玩家手番",defaultRecordFileFormat:"預設保存格式",textEncoding:"文字編碼",strict:"檔案原始編碼",autoDetect:"自動判定",newlineCharacter:"換行符號",old90sMac:"90年代Mac",autoSaving:"自動保存",recordFileName:"棋譜檔案名稱",select:"選擇",shuffle:"隨機",csaV3Output:"使用 CSA V3 輸出",alwaysOutputUTF8:"常に UTF-8 で出力",someOldShogiAppsCannotReadUTF8KifFiles:"一部の古い将棋アプリでは UTF-8 の KIF・KI2 ファイルを読み込めない場合があります。",strictDecodingMayFailToReadUTF8KifFiles:"文字コードの設定が「厳格」の場合、UTF-8 で書き出した KIF・KI2 ファイルの読み込みに失敗する可能性があります。",positionOfUSIOutput:"USI 局面紀錄格式",movesOfUSIOutput:"USI 棋譜紀錄格式",onlySFEN:"只有 SFEN",minimal:"最小限",pasteDialog:"貼上視窗",liveDuplicatePositionDetection:"同一局面を常に検出",onTheFlyThreshold:"On-the-fly 閾値",usiProtocol:"USI協定",translateOptionName:"選項名稱翻譯",functionalOnJapaneseOnly:"只有在日文選擇時有效",maxStartupTime:"最大起動等待時間",forDevelopers:"開發者用",enableAppLog:"輸出程式紀錄",enableUSILog:"輸出USI通訊紀錄",enableCSALog:"輸出CSA通訊紀錄",logLevel:"紀錄等級",manageEngines:"引擎設定",flipBoard:"盤面反轉",elapsedTimeChart:"消費時間圖表",shortcutKeys:"快捷鍵",useUpDownToMove1Ply:"使用↑/↓鍵移動1手",useLeftRightToMove1Ply:"使用←/→鍵移動1手",file:"檔案",folder:"フォルダ",recordFile:"棋譜檔案",executableFile:"可執行檔案",imageFile:"圖片檔案",unsaved:"未保存",remove:"刪除",deleteMove:"刪除該手",recordProperties:"棋譜情報",comments:"備註",commentsAndBookmarks:"備註・書籤",branches:"分支",branchListMode:"分岐の表示",previousMoveBranches:"着手した手",nextMoveBranches:"次の手",bookmark:"書籤",bookmarkList:"書籤一覽",useBookmarkAsHeader:"將書籤名稱作為標題",moveComments:"棋步備註",searchLog:"思考",pv:"預測手順",mateShort:"詰",displayPVShort:"再現",evaluation:"評價值",rawScore:"評價値",score:"評價値",estimatedWinRate:"期待勝率",evaluationAndEstimatedWinRateAndPV:"評價値・期待勝率・預測手順",swapEachTurnChange:"手番側有利時為正值",alwaysSenteIsPositive:"先手有利時為正值",signOfEvaluation:"評價值符號",showArrowScore:"矢印に評価値を表示",arrowScoreDiffRange:"矢印の評価値範囲",maxArrows:"箭頭顯示數量",winRateCoefficient:"勝率換算係數",nodeCountFormat:"節點數格式",plainNumber:"純數字",commaSeparated:"逗號分隔",monitor:"引擎監視",hideTabView:"最小化",expandTabView:"展開分頁",sente:"先手",senteOrShitate:"先手(下手)",shitate:"下手",gote:"後手",goteOrUwate:"後手(上手)",uwate:"上手",targetEngine:"検査対象エンジン",baseEngine:"基準エンジン",swapSenteGote:"先後交換",pieceToss:"振駒",currentPosition:"現在局面",positionList:"局面列表",enableEngineTimeout:"開啟引擎時間限制",setDifferentTimeForGote:"先後手時間不相同",nextTurn:"手番",elapsedTime:"消費時間",elapsed:"經過時間",rank:"順位",depth:"深度",searchEngine:"引擎",ponder:"對方手番時運算 (Ponder)",numberOfThreads:"執行緒數",threads:"スレッド",suggestionsCount:"候補手數量",startPosition:"開始局面",beginFromThisPosition:"自此局面開始",maxMoves:"最大手數",gameRepetition:"連續對局",parallelism:"並列数",parallelGame:"並列対局",jishogi:"持將棋",rule24:"24點法",rule27:"27點法",tryRule:"Try Rule",autoRelogin:"自動重新登入",restartItEveryGame:"每局重新啟動",swapTurnWhenGameRepetition:"每局交換手番",outputComments:"輸出備註",saveRecordAutomatically:"自動保存棋譜",adjustBoardToHumanPlayer:"調整到玩家所在方向",adjustBoardAutomatically:"自動調整盤面方向",command:"指令",startGame:"對局開始",cancelGame:"取消對局",allottedTime:"持時間",byoyomi:"讀秒",increments:"增秒",startEndCriteria:"開始・結束條件",descending:"倒序",endCriteria1Move:"局面結束條件",outputSettings:"輸出設定",noOutputs:"不輸出",insertCommentToTop:"加入到前方",appendCommentToBottom:"在後方新增",insertToComment:"加入到備註欄",insertToRecord:"加入到棋譜",overwrite:"覆寫原檔案",fromPrefix:"從",fromSuffix:"",toPrefix:"到",toSuffix:"",plyPrefix:"第",plySuffix:"手",hoursSuffix:"小時",minutesSuffix:"分",secondsSuffix:"秒",eg:"e.g.",totalMoves:"総手数",detailSettings:"詳細設定",engineManagement:"引擎管理",engineName:"引擎名稱",author:"作者",earlyPonder:"預先Ponder",enginePath:"場所",openDirectory:"開啟資料夾",replaceEnginePath:"重新選擇引擎",displayName:"表示名稱",frontendBook:"定跡 (GUI拡張)",showAllOptions:"全てのオプションを表示",invoke:"執行",resetToEngineDefaultValues:"回復至引擎預設設定",defaultValue:"預設値",freeTextUnsafe:"自由輸入(不建議)",noEngineRegistered:"尚未登錄引擎。",duplicate:"複製",add:"追加",compareAndMerge:"比較並合併",compareEngineSettings:"引擎設定比較",noDifference:"無更改",mergeToLeft:"合併至左側",mergeToRight:"合併至右側",recommended:"推薦",import:"匯入",saveAndClose:"保存並關閉",save:"保存",saveAs:"另存為",history:"歷史紀錄",clearHistory:"清除歷史紀錄",userFile:"使用者檔案",automaticBackup:"自動備份",restore:"復原",loadRecordFromWeb:"從網際網路取得棋譜",backToMainBranch:"回到本譜",fetchLatestData:"取得最新資料",sourceURL:"來源網址",ok:"OK",cancel:"取消",back:"返回",doNotShowAgain:"不再顯示",name:"名稱",prediction:"預測",best:"最善",nodes:"Node數",hashUsage:"Hash使用率",stop:"停止",resume:"重新開始",noHandicap:"平手",lanceHandicap:"香落",rightLanceHandicap:"右香落",bishopHandicap:"角落",rookHandicap:"飛車落",rookLanceHandicap:"飛車香落",twoPiecesHandicap:"二枚落",fourPiecesHandicap:"四枚落",sixPiecesHandicap:"六枚落",eightPiecesHandicap:"八枚落",tenPiecesHandicap:"十枚落",tsumeShogi:"詰將棋",doubleKingTsumeShogi:"雙玉詰將棋",startDateTime:"開始日時",endDateTime:"結束日時",gameDate:"對局日",tournament:"棋戰",strategy:"戰型",gameTitle:"標題",timeLimit:"限時",blackTimeLimit:"先手限時",whiteTimeLimit:"後手限時",place:"地點",postedOn:"登錄於",note:"備註",senteShortName:"先手省略名",goteShortName:"後手省略名",scorekeeper:"記錄員",opusNo:"作品編號",opusName:"作品名",publishedBy:"發表於",publishedOn:"發表年月",source:"來源",numberOfMoves:"手數",integrity:"完全性",recordCategory:"分類",award:"受賞",filterByOptionName:"搜尋設定名稱",filterByEngineName:"搜尋引擎名稱",bookStyle:"書籍風",bookStyleDiagram:"書籍風局面図",gameStyle:"對局畫面風",thin:"細",bold:"粗",extraBold:"特粗",playerName:"對局者名稱",typeface:"字體",weight:"字體粗細",handLabel:"持駒標題",header:"標題",vertical:"垂直調整",size:"大小",none:"無",bgCover:"圖片置中",bgContain:"擴大表示",bgTile:"磁磚狀表示",inaccuracy:"緩手",dubious:"疑問手",mistake:"惡手",blunder:"大惡手",inaccuracyThreshold:"緩手閾値",dubiousThreshold:"疑問手閾値",mistakeThreshold:"惡手閾値",blunderThreshold:"大惡手閾値",maxPVLength:"PV表示手數",commentFormat:"註解形式",gothic:"黑體",mincho:"明體",appVersion:"軟體版本",installed:"已安裝",stable:"安定版",latest:"最新版",backgroundColor:"背景顏色",dialogPosition:"對話窗顯示位置",alignLeft:"左側",alignRight:"右側",alignCenter:"置中",dialogBackdrop:"對話窗背景",record:"棋譜",book:"定跡",chart:"圖表",analytics:"解析",controlGroup:"選單",left:"左方間隔",top:"上方間隔",width:"寬度",height:"高度",newCustomProfile:"新增佈局設定",addCustomLayoutProfile:"新增佈局設定",duplicateCurrentProfile:"複製目前佈局設定",removeCurrentProfile:"移除該佈局設定",exportProfileToClipboard:"將佈局設定複製至剪貼板",importProfileFromClipboard:"自剪貼板匯入佈局設定",profileExportedToClipboard:"該佈局已複製至剪貼板。",profileImported:"該佈局已成功匯入。",failedToImportProfile:"佈局匯入失敗。",rightControlBox:"右側選單",leftControlBox:"左側選單",topControlBox:"操作按鈕",legends:"圖例",historyMode:"歷史模式",headers:"解析表頭",playButton:"再現按鈕",insert:"插入",bringForward:"移至前方",sendBackward:"移至後方",move:"著手",bookMove:"定跡手",play:"著手",edit:"編輯",addMoves:"新增該手",flippedBook:"亦檢索先後逆局面",addBookMoves:"增加定跡手",fromCurrentRecord:"從現在棋譜",fromFile:"從檔案",fromDirectory:"從檔案目錄",noMoves:"沒有棋步。",register:"登錄",update:"更新",currentMove:"目前棋步",branchFrom:e=>`自${e}手目分岐`,allPlayers:"所有對局者",blackPlayerOnly:"僅先手",whitePlayerOnly:"僅後手",filterByName:"使用名稱過濾",enterPartOfPlayerNameHere:"輸入對局者名稱",freq:"出現次數",frequency:"出現次數",new:"新增",duplicated:"重複",moveEntry:"匯入手數",updatedAt:"更新時間",createdAt:"建立時間",lastSent:"最後送出",lastReceived:"最後接收",protocolVersion:"協定版本",prompt:"指令",openPrompt:"打開指令視窗",forceQuit:"強制退出",forceClose:"強制關閉",blankLine:"空行",autoScroll:"自動捲動",showTimestamp:"顯示時間戳章",highlightByPartialMatch:"反白部分一致部分",csaServer:"CSA伺服器",usiEngine:"USI引擎",noRunningUSIEngine:"目前沒有啟動中的USI引擎。",noConnectedCSAServer:"尚未連接CSA伺服器。",willBeRemovedFromTheListSoon:"由於 Session 結束,將會自一覽清除。",typeCommandHereAndPressEnter:"輸入指令後按下 Enter 以發送",allowBlankLine:"允許空行",removeSpaceFromBothEnds:"消除前後空白",collapseSequentialSpaces:"整理連續空白",typeCustomTitleHere:"輸入自定義標題",displayEmptyElements:"顯示未定義資料",share:"分享",waitingForNewGame:"正在等待下一場對局開始。",waitingForPlayerSetup:"正在等待對局者準備。",insertedComment:"已加入備註。",conversionCompleted:"轉換完成。",human:"人",randomPlayer:"隨機玩家",beginner:"初學者",staticRook:"居飛車",rangingRook:"振飛車",pleaseSelectEngines:"請選擇引擎。",thisItemCannotBeMerged:"該項目無法被合併。",tryingToConnectAndLoginToCSAServer:"正在連接並登入CSA伺服器。",inBrowserLogsOutputToConsoleAndIgnoreThisSetting:"※在瀏覽器版本中紀錄會於 console 中顯示,並無視此處的設定。",shouldRestartToApplyLogSettings:"※您需要重新啟動本程式以使用變更後的紀錄設定。",canOpenLogDirectoryFromMenu:"※紀錄的輸出檔案可以在「偵錯」-「開啟紀錄檔案資料夾」開啟。",hasNoOldLogCleanUpFeature:"※現在並沒有舊紀錄的自動刪除機制。",shouldRestartToApplyLowLevelSettings:"※您需要重新啟動本應用程式以反映底層設定。",processingPleaseWait:"現在處理中。請稍待一會。",importingFollowingRecordOrPosition:"將匯入以下棋譜(局面)。",supportsKIF_KI2_CSA_USI_SFEN_JKF_USEN:"※支援KIF/KI2/CSA/USI/SFEN/JKF/USEN形式。",pleasePasteRecordIntoTextArea:"※請在文字輸入區域貼上您的棋譜。",pleaseSpecifyPlainTextURL:"※請輸入您要使用的URL。",redirectNotSupported:"※無法使用重新導向連結。",desktopVersionPastesAutomatically:"※安裝程式版將會自動貼上棋譜。",asNewFile:"視為新檔案",mergeToRootPosition:"自棋譜開頭合併",mergeToCurrentPosition:"自目前局面合併",failedToMergeRecordWithDifferentInitialPosition:"無法合併初始盤面不同之棋譜。",failedToMergeRecordWithDifferentTurn:"無法合併手番不同之棋譜。",earlyPonderFeatureSendsPonderhitCommandWithYaneuraOusNonStandardOptions:"早期 Ponder 機能將會發送やねうら王自行定義之 ponderhit 指令。",ifYourEngineNotSupportTheOptionsItMayCauseUnexpectedBehavior:"若您的引擎不支援該指令,可能會有預期外之行為發生。",someLogsDisabled:"部份 log 已被無效化。",logsRecommendedForCSAProtocol:"若使用CSA協定對局,建議輸出各項紀錄。",pleaseEnableLogsAndRestart:"請在程式設定中開啟紀錄並重新啟動本程式。",hwaEnabled:"HWA(ハードウェアアクセラレーション)が有効です。",hwaIsNotRecommendedForLongGames:"長時間の対局ではHWAの無効化を推奨します。",pleaseDisableHWAAndRestart:"アプリ設定からHWAを無効にしてアプリを再起動してください。",notSendPVOnStandardCSAProtocol:"在標準的CSA協定中不會送出評價值以及思考棋步。",passwordWillSavedPlaintextBecauseOSSideEncryptionNotAvailable:"由於無法使用系統的加密機能,輸入的密碼將會以明文保存。",pleaseUncheckSaveHistoryIfNotWantSave:"若不想保存密碼,請不要將「保存紀錄」勾選。",floodgatePasswordShouldStartWithGameName:"Floodgate密碼必須以對局名稱開頭。",thisIsNotFloodgateOfficialGameName:"這不是Floodgate官方之對局名稱。",yourPasswordDoesNotMeetFloodgateRequirementsDoYouStillWantToContinue:"密碼可能不符合Floodgate之要求。您仍要繼續嗎?",whenNewVersionIsAvailableItWillBeNotified:"將會在新版本發布時進行通知。",pleaseCheckMessageThisIsTestNotificationByAboveButton:"上方按鈕會發送「這是測試用的通知。」的通知訊息。",ifNotWorkYouShouldAllowNotificationOnOSSetting:"若無法顯示,請在使用的作業系統中許可本程式的通知。",translationHelpNeeded:"我們正在招募翻譯人員。",restartRequiredAfterLocaleChange:"更改語言後,請重新啟動本程式。",createDesktopShortcut:"デスクトップにショートカットを作成",desktopShortcutCreated:"デスクトップにショートカットを作成しました。",areYouSureWantToResign:"確定要投了嗎?",areYouSureWantToDoDeclaration:"確定要進行勝利宣言嗎?",areYouSureWantToQuitGames:"要中斷連續對局嗎?",areYouSureWantToRequestQuit:"若提出中斷要求,可能會被判負。請問您要繼續嗎?",areYouSureWantToClearRecord:"將會刪除現在的棋譜。請問您要繼續嗎?",areYouSureWantToDiscardPosition:"將不會保存現在的局面。請問您要繼續嗎?",areYouSureWantToOpenFileInsteadOfCurrentRecord:"會將現在的棋譜關閉並開啟別的檔案,請問您要繼續嗎?",areYouSureWantToClearHistory:"將清除紀錄。請問您要繼續嗎?",areYouSureWantToRemoveCurrentProfile:"將移除現在的設定。請問您要繼續嗎?",yamlFormatSettingsCopiedToClipboard:"已將 YAML 格式之設定複製到剪貼板。",jsonFormatSettingsCopiedToClipboard:"已將 JSON 格式之設定複製到剪貼板。",usiCsaBridgeCommandCopiedToClipboard:"已將 usi-csa-bridge 指令複製到剪貼板。",copiedToClipboard:"クリップボードにコピーしました。",pastedFromClipboard:"クリップボードから貼り付けました。",youCanNotCloseAppWhileCSAOnlineGame:"由於CSA協定正在使用中,本程式無法被關閉。",fileExtensionNotSupported:"無法使用該副檔名。",errorOccuredWhileDisconnectingFromCSAServer:"在與CSA伺服器中斷連線時發生錯誤。",failedToConnectToCSAServer:"無法連接CSA伺服器。",errorOccuredWhileLogoutFromCSAServer:"在登出 CSA 伺服器時發生錯誤。",disconnectedFromCSAServer:"與CSA伺服器的連接結束。",csaServerLoginDenied:"您對CSA伺服器的登入被拒絕。",thisFeatureNotAvailableOnWebApp:"Web版無法使用本機能",failedToStartNewGame:"對局開始失敗。",errorOccuredWhileEndingGame:"在對局結束時發生錯誤。",failedToSendGoCommand:"無法送出go指令。",failedToSendPonderCommand:"無法送出ponder指令。",failedToSendStopCommand:"無法送出stop指令。",failedToShutdownEngines:"引擎無法正常結束。",failedToCheckUpdates:"無法確認更新。",failedToSaveRecord:"棋譜保存失敗。",failedToParseSFEN:"SFEN讀取失敗。",failedToDetectRecordFormat:"無法判別棋譜形式。",unknown:"未知",unknownFileExtension:"未知的檔案形式。",emptyRecordInput:"您尚未輸入棋譜。",invalidPieceName:"不合法的棋駒",invalidTurn:"不合法的手番",invalidMove:"不合法的棋步",invalidMoveNumber:"不合法的手數",invalidDestination:"不合法的移動目的地",pieceNotExists:"不存在的棋駒",invalidLine:"不存在的行",invalidBoard:"不合法的盤面",invalidHandPiece:"不合法的持駒",invalidUSI:"不合法的USI",engineProcessWasClosedUnexpectedly:"引擎進程意外結束。",backgroundImageFileNotSelected:"尚未選取背景圖片。",pieceImageFileNotSelected:"尚未選取棋駒圖片。",boardImageFileNotSelected:"尚未選取盤面圖片。",pieceStandImageFileNotSelected:"尚未選取駒台圖片。",pieceSoundVolumeMustBe0To100Percent:"請在0%~100%之間指定棋駒音效大小。",clockSoundVolumeMustBe0To100Percent:"請在0%~100%之間指定棋鐘音效大小。",clockSoundPitchMustBe220To880Hz:"請在220Hz~880Hz之間指定棋鐘音效頻率。",engineTimeoutMustBe1To300Seconds:"請在1秒~300秒之間指定引擎執行最長時間。",coefficientInSigmoidMustBeGreaterThan0:"請將勝率換算係數填為大於0之值。",inaccuracyThresholdMustBe1To100Percent:"請在0%~100%之間指定緩手門檻。",dubiousThresholdMustBe1To100Percent:"請在0%~100%之間指定疑問手門檻。",mistakeThresholdMustBe1To100Percent:"請在0%~100%之間指定惡手門檻。",blunderThresholdMustBe1To100Percent:"請在0%~100%之間指定大惡手門檻。",recordSavedWithGarbledCharacters:"保存的棋譜有部分可能會造成亂碼。",pleaseConsiderToUseKIFU:"建議您使用KIFU形式(UTF-8)儲存您的棋譜。",youCanChangeDefaultRecordFileFormatFromAppSettings:"預設棋譜檔案格式可以在程式設定中進行更動。",inaccuracyThresholdMustBeLessThanDubiousThreshold:"緩手門檻應小於疑問手門檻。",dubiousThresholdMustBeLessThanMistakeThreshold:"疑問手門檻應小於惡手門檻。",mistakeThresholdMustBeLessThanBlunderThreshold:"惡手門檻應小於大惡手門檻。",thisEngineNotSupportsMateSearch:"這個引擎不支援詰將棋搜索。",pleaseEndActiveFeaturesBeforeOpenRecord:"請關閉現正運行的功能再開啟棋譜。",bothTimeLimitAndByoyomiAreNotSet:"持時間與讀秒尚未設置。",canNotUseByoyomiWithFischer:"讀秒與 Fischer 選項無法同時併用。",repeatsMustBeOneIfHumanPlayerIncluded:"若要與人對局,連續對局次數僅能設為 1 。",parallelismMustBeOneIfHumanPlayerIncluded:"人が対局する場合、並列実行数は1以外を設定できません。",parallelismMustBeOneIfCurrentPositionIsUsed:"現在の局面を開始局面にする場合、並列実行数は1以外を設定できません。",parallelismMustLessThanOrEqualToRepeats:"並列実行数は連続対局の回数以下にしてください。",protocolVersionNotSelected:"請選擇協定版本。",hostNameIsEmpty:"主機名稱為空。",invalidPortNumber:"不可用的連接埠號碼。",idIsEmpty:"ID 為空。",idContainsSpace:"ID 含有空白字符。",passwordContainsSpace:"密碼含有空白字符。",tcpKeepaliveInitialDelayMustBePositive:"請輸入正確的TCP Keepalive初始延遲時間。",blankLinePingInitialDelayMustBeGreaterThanOrEqualTo30:"請輸入正確的空行輸出初始延遲時間。",blankLinePingIntervalMustBeGreaterThanOrEqualTo30:"請輸入正確的空行輸出間隔時間。",engineNotSelected:"尚未選擇引擎。",forExportingConversionLogPleaseEnableAppLogsAndSetLogLevelDebugAndRestart:"如要監看轉換紀錄,請在程式設定內設定 log level 到 Debug 並重新啟動本程式。",sourceDirectoryNotSpecified:"輸入目錄尚未被指定。",sourceFileMustBeSFEN:"入力ファイルは .sfen 形式でなければなりません。",sourceFormatsNotSpecified:"輸入格式尚未被指定。",destinationDirectoryNotSpecified:"輸出格式尚未被指定。",destinationFileNotSpecified:"輸出檔案尚未被指定。",anyUnsavedDataWillBeLostDoYouReallyWantToResetBookData:"未保存內容可能會丟失。您確認要重置定跡嗎?",bookMovesWereImported:"已完成匯入定跡。",anyBookMovesAreUnsavedDoYouReallyWantToDiscardThemAndCloseTheApp:"存在尚未保存的定跡。您確定要捨棄並關閉本程式嗎?",cannotOverwriteOnTheFlyBook:"On-the-fly モードで読み込み中の定跡は上書き保存できません。",pleaseSpecifyOtherFileName:"別のファイル名を指定してください。",sourceRecordFileNotSet:"尚未指定棋譜檔案。",sourceDirectoryNotSet:"請選擇目錄。",minPlyMustBeLessThanMaxPly:"最小手數應小於最大手數。",playerNameNotSet:"尚未設定對局者名稱。",incompatibleOptionsWillBeDiscardedDoYouReallyWantToReplaceTheEnginePath:"不相容的設定將自動被移除。您確認要更換引擎嗎?",largeSuggestionsCountMayCausePerformanceDegradation:"增加候補手可能會導致效能下降。",doYouReallyWantToIncreaseTheSuggestionsCount:"您確定要增加候選手數嗎?",recommendLowerSettingsForDailyUse:"日常利用のPCでは低めの設定を推奨します。",checkEngineCompatibilityForNumaEnvironments:"このPCは複数のCPUソケットまたはプロセッサーグループ(NUMA)を持つ可能性があります。NUMA環境に対応していないエンジンでは性能が低下する場合があります。エンジンのNUMA対応状況をご確認ください。",aiPerformanceMayDegrade:"AIの性能が低下する可能性があります。",yourPCMayBecomeSlow:"PCの動作が重くなる可能性があります。",increasingItMayImproveAIPerformance:"大きくすることでAIの性能が向上する可能性があります。",totalNumber:e=>`總計 ${e} 筆`,number:e=>`${e} 筆`,tryToReloginToCSAServerNSecondsLater:e=>`請在${e}秒後再次嘗試登入 CSA 伺服器。`,mateInNPlyDoYouWantToDisplay:e=>`尋找到${e}手詰。要顯示結果嗎?`,insertedNMovesToRecord:e=>`已加入${e}手到棋譜。`,errorsOccurred:e=>`發生 ${e} 個錯誤。`,between:(e,t)=>`自 ${e} 到 ${t} `,addNthEngine:e=>`追加第 ${e} 個引擎`,copyOf:e=>`${e} 的拷貝`,keepLatest:e=>`到最新${e}件`,followingDataNotSavedBecauseNotSupporetedBy:e=>`以下的資料由於 ${e} 格式無法支援的原因無法保存。`,areYouSureWantToDeleteFollowingMove:e=>`將會刪除${e}手目以後的棋譜。請問您要繼續嗎?`,failedToOpenDirectory:e=>`無法開啟檔案目錄:${e}`,unexpectedEventSenderPleaseReport:e=>`無法預期的事件發送方已發生。請將該錯誤訊息告知開發者,謝謝。 [${e}]`,unexpectedHTTPMethodPleaseReport:e=>`無法預期的 HTTP 方法。請將該錯誤訊息告知開發者,謝謝。 [${e}]`,unexpectedRequestURLPleaseReport:e=>`無法從 URL 獲取資訊。請將該錯誤訊息告知開發者,謝謝。 [${e}]`,noResponseFromEnginePleaseExtendTimeout:e=>`引擎在${e}秒内沒有回應。若引擎的啟動時間稍長,請在設定中調整引擎最長等待時間。`,stableVersionReleased:e=>`安定版 ${e} 已經發布!`,latestVersionReleased:e=>`最新版 ${e} 已經發布!`,doYouReallyWantToRemoveBookMove:e=>`將移除定跡手 ${e}。確認移除嗎?`,unexpectedRecordFileExtension:e=>`該檔案為不支援的棋譜副檔名。 [${e}]`,fileNotFound:e=>`無法找到該檔案。 [${e}]`,directoryNotFound:e=>`無法找到該目錄。 [${e}]`,youCanExitFullScreenByPressing:e=>`請按下${e}鍵以結束全螢幕顯示。`,skippedMovesInMerge:(e,t)=>`${t}手內之${e}手無法被合併。`,cpuUsageExceedsNPercent:e=>`全CPUコアの${e}%を超えています。`,totalNumberOfThreadsExceedsNPercentOfCpuCores:e=>`スレッド数の合計がCPUコア数の${e}%を超えています。`,memoryUsageExceedsNPercent:e=>`全メモリの${e}%を超えています。`,memoryUsageIsLessThanNPercent:e=>`全メモリの${e}%未満です。`,totalUSIHashExceedsNPercentOfMemory:e=>`USI_Hash の合計が全メモリの${e}%を超えています。`},c={shogiHome:"ShogiHome",clear:"Ván mới",open:"Mở",openNewInstance:"Mở một cửa sổ ShogiHome mới",saveOverwrite:"Ghi đè",newRecord:"Kỳ phổ mới",newRecordKeepInitialPosition:"Kỳ phổ mới (giữ thế trận hiện tại)",newRecordHirateSetup:"Kỳ phổ mới (thế cờ ban đầu)",openRecord:"Mở kỳ phổ",saveRecord:"Lưu kỳ phổ",saveRecordAs:"Lưu kỳ phổ như",openAutoSaveDirectory:"Mở thư mục lưu tự động",exportPositionDiagram:"Xuất ảnh thế cờ",positionImage:"Ảnh thế cờ",batchConversion:"Chuyển đổi số lượng lớn",recordFileBatchConversion:"Chuyển đổi kỳ phổ số lượng lớn",close:"Đóng",quit:"Thoát",reload:"Tải lại",editing:"Sửa",copyAsKIF:"Sao chép (KIF)",copyAsKI2:"Sao chép (KI2)",copyAsCSA:"Sao chép (CSA)",copyAsUSI:"Sao chép (USI)",copyAsSFEN:"Sao chép (SFEN)",copyAsBOD:"Sao chép (BOD)",copyAsJKF:"Sao chép (JKF)",copyAsUSEN:"Sao chép (USEN)",copy:"Sao chép",cut:"Cắt",paste:"Dán",copyRecordAll:"Sao chép kỳ phổ (từ nước đầu tiên)",copyRecordFromCurrentPosition:"Sao chép kỳ phổ (từ thế cờ hiện tại)",asKIF:"dưới dạng KIF",asKI2:"dưới dạng KI2",asCSA:"dưới dạng CSA",asUSI:"dưới dạng USI",asUSIUntilCurrentMove:"dưới dạng USI (cho tới nước hiện tại)",asUSIAll:"dưới dạng USI (toàn bộ)",asJSONKifuFormat:"dưới dạng kỳ phổ JSON",asUSEN:"dưới dạng USEN",copyPosition:"Sao chép thế cờ",asSFEN:"dưới dạng SFEN",asBOD:"dưới dạng BOD",pasteRecordOrPosition:"Dán kỳ phổ/thế cờ",pasteRecordMerge:"Dán kỳ phổ (sáp nhập)",toRootPosition:"Về thế cờ ban đầu",toCurrentPosition:"Đến thế trận hiện tại",addSpecialMove:"Chèn nước đi đặc biệt",deleteMoves:"Xóa từ nước hiện tại trở đi",view:"Hiển thị",openLayoutManager:"Mở trình quản lý bố cục",openMonitorWindow:"Mở cửa sổ quản lý",toggleFullScreen:"Bật/tắt toàn màn hình",defaultFontSize:"Cỡ chữ tiêu chuẩn",increaseFontSize:"Cỡ chữ lớn",decreaseFontSize:"Cỡ chữ nhỏ",settings:"Cài đặt",config:"Thiết lập",debug:"Gỡ lỗi",toggleDevTools:"Bật/tắt công cụ nhà phát triển",logFile:"Tệp log",openAppLog:"Mở log ứng dụng",openUSILog:"Mở log USI",openCSALog:"Mở log CSA",tailAppLog:"Kết thúc log ứng dụng",tailUSILog:"Kết thúc log USI",tailCSALog:"Kết thúc log CSA",copyAppLogTailCommand:"Sao chép lệnh kết thúc log ứng dụng",copyUSILogTailCommand:"Sao chép lệnh kết thúc log USI",copyCSALogTailCommand:"Sao chép lệnh kết thúc log CSA",reloadCustomPieceImage:"Tải lại ảnh quân tùy chỉnh",statisticsReport:"Thống kê",launchUSIEngine:"Khởi động phần mềm shogi",connectToCSAServer:"Kết nối với máy chủ CSA",adminMode:"Chế độ nâng cao",inAdminModeManuallyInvokeCommandsAtPrompt:"Trong chế độ nâng cao, bạn phải tự nhập lệnh tại ô nhắc lệnh.",setoptionAndPrecedingCommandsAreSentAutomatically:'"setoption" và các lệnh trước đó sẽ được gửi tự động',serverMustSupportShogiServerX1ModeLogIn:"Máy chủ phải hỗ trợ phương thức đăng nhập x1-mode của shogi-server.",folders:"Thư mục",notification:"Thông báo",notificationTest:"Thử thông báo",thisIsTestNotification:"Đây là thông báo thử",app:"Ứng dụng",log:"Log",cache:"Bộ nhớ đệm",help:"Trợ giúp",openWebsite:"Mở trang web",openUserGuide:"Mở hướng dẫn sử dụng",openLatestReleasePage:"Mở trang của bản mới nhất",openStableReleasePage:"Mở trang của bản ổn định",license:"Giấy phép",inputs:"Đầu vào",outputs:"Đầu ra",format:"Định dạng",formats:"Định dạng",subdirectories:"Thư mục con",separate:"Riêng biệt",merge:"Sáp nhập",createSubdirectories:"Tạo thư mục con",nameConflictAction:"Hành động xung đột tên",numberSuffix:"Hậu tố số",skip:"Bỏ qua",convert:"Chuyển đổi",openLogFile:"Mở tệp log",success:"Thành công",failed:"Thất bại",skipped:"Bỏ qua",game:"Chơi",player:"Kỳ thủ",server:"Máy chủ",selectFromHistory:"Chọn từ lịch sử",noHistory:"Trống",saveHistory:"Lưu lịch sử",version:"Phiên bản",gameProgress:"Tiến triển ván đấu",allGamesCompleted:"Tất cả các ván đã kết thúc",wins:"Thắng",winsOnBlack:"Số ván thắng (Tiên)",winsOnWhite:"Số ván thắng (Hậu)",draws:"Hòa",validGames:"Ván hợp lệ",invalidGames:"Ván không hợp lệ",eloRatingDiff:"Khoảng cách Elo",ignoreDraws:"Bỏ qua ván hòa",zValue:"Giá trị Z",significance5pc:"Độ nổi bật 5%",significance1pc:"Độ nổi bật 1%",gameEnded:"Ván đã kết thúc",offlineGame:"Ván ngoại tuyến",csaOnlineGame:"Ván CSA trực tuyến",csaProtocolOnlineGame:"Ván trực tuyến (phương thức CSA)",csaProtocolV121:"Phương thức CSA tiêu chuẩn 1.2.1",csaProtocolV121WithPVComments:"Phương thức CSA 1.2.1 có bình luận PV",host:"Tên máy chủ",portNumber:"Cổng",password:"Mật khẩu",revealPassword:"Hiện mật khẩu",keepaliveInitialDelay:"Trì hoãn keepalive ban đầu",blankLinePing:"Ping dòng trống",blankLinePingInitialDelay:"Trì hoãn ping dòng trống ban đầu",blankLinePingInterval:"Khoảng thời gian ping dòng trống",logout:"Đăng xuất",calculateJishogiPoints:"Tính điểm bế tắc",jishogiPoints:"Điểm bế tắc",displayGameResults:"Hiển thị kết quả",interrupt:"Dừng",stopGame:"Dừng ván đấu",resign:"Xin thua",draw:"Hòa",impass:"Bế tắc",repetitionDraw:"Hòa do lặp nước",repetition:"Hòa do lặp nước",mate:"Chiếu hết",noMate:"Không chiếu hết",blackWin:"Tiên thắng",whiteWin:"Hậu thắng",all:"Tất cả",others:"Khác",minRate:"Elo thấp nhất",mateSearch:"Tìm chiếu hết",startMateSearch:"Bắt đầu tìm chiếu hết",stopMateSearch:"Dừng tìm chiếu hết",noMateFound:"Không có chiếu hết.",timePerPosition:"Thời gian suy nghĩ",timeout:"Hết giờ",foulWin:"Thắng do nước đi phạm luật",foulLose:"Thua do nước đi phạm luật",enteringOfKing:"Thắng do nhập Ngọc",winByDefault:"Xử thắng",loseByDefault:"Xử thua",winByDeclaration:"Thắng do tuyên bố",declareWin:"Tuyên bố chiến thắng",research:"Tính toán",startResearch:"Bắt đầu tính toán",endResearch:"Dừng tính toán",startEndResearch:"Bắt đầu/Dừng tính toán",recordAnalysis:"Phân tích kỳ phổ",analysis:"Phân tích",analyze:"Phân tích",stopAnalysis:"Dừng phân tích",searchDuplicatePositions:"Tìm thế cờ lặp lại",duplicatePositionSearch:"Tìm thế cờ lặp lại",duplicatePositions:"Thế cờ lặp lại",duplicatePos:"Lặp lại",via:"Thông qua",lastMove:"Nước liền trước",nextMoves:"Nước liền sau",goToThisPosition:"Đi đến thế cờ này",noDuplicatePositions:"Không có thế cờ lặp lại.",nDuplicatePositionsFound:e=>`Tìm thấy ${e} thế cờ lặp lại.`,appearanceCount:"Số lần lặp lại",showList:"Hiện tất cả",setupPosition:"Xếp thế cờ",startPositionSetup:"Bắt đầu xếp thế cờ",completePositionSetup:"Hoàn tất xếp thế cờ",changeTurn:"Đổi lượt đi",initializePosition:"Đặt lại thế cờ",changePieceSet:"Tăng giảm quân",setAllPiecesToStandardCounts:"Đặt lại số lượng quân",setAllPiecesToZero:"Đặt tất cả số quân thành 0",appSettings:"Cài đặt ứng dụng",language:"Ngôn ngữ",theme:"Chủ đề",standard:"Tiêu chuẩn",green:"Xanh lá",cherryBlossom:"Hoa anh đào",customImage:"Ảnh tùy chọn",autumn:"Mùa thu",snow:"Tuyết rơi",darkGreen:"Xanh lá đậm",dark:"Tối",boardLayout:"Bố cục bàn cờ",compact:"Gọn",portrait:"Dọc",piece:"Quân",singleKanjiPiece:"Nhất tự",singleKanjiWoodPiece:"Nhất tự (Gỗ)",singleKanjiGothicPiece:"Nhất tự (Gothic)",singleKanjiDarkPiece:"Nhất tự (Tối)",singleKanjiGothicDarkPiece:"Nhất tự (Gothic, Tối)",imageHasMarginsRemoveForLargerDisplay:"Ảnh có lề (loại bỏ để hiển thị lớn hơn)",backgroundImage:"Ảnh nền",board:"Bàn cờ",pieceStand:"Komadai",woodTexture:"Vân gỗ",lightWoodyTexture:e=>`Vân gỗ (Nhẹ ${e})`,warmWoodTexture:e=>`Vân gỗ (Ấm ${e})`,resin:"Nhựa cây ",transparent:"Trong suốt",boardOpacity:"Độ đục bàn cờ",pieceStandOpacity:"Độ đục komadai",recordOpacity:"Độ đục kỳ phổ",promotionSelector:"Chọn phong cấp",centeredHorizontal:"Ngang, căn giữa",promoteFirstVertical:"Dọc, ưu tiên phong cấp",promoteFirstHorizontal:"Ngang, ưu tiên phong cấp",showFileAndRank:"Hiện hàng và cột",showLeftControls:"Hiện điều khiển bên trái",showRightControls:"Hiện điều khiển bên phải",tabViewStyle:"Hiện thẻ",oneColumn:"1 cột",twoColumns:"2 cột",sounds:"Âm thanh",pieceSoundVolume:"Âm lượng quân",clockSoundVolume:"Âm lượng đồng hồ",clockSoundPitch:"Cao độ đồng hồ",clockSoundTarget:"Nước đi có tiếng đồng hồ",anyTurn:"Tất cả",onlyHumanTurn:"Nước của người chơi",defaultRecordFileFormat:"Định dạng kỳ phổ mặc định",textEncoding:"Bộ mã chữ",strict:"Bắt buộc",autoDetect:"Tự động",newlineCharacter:"Ký tự dòng mới",old90sMac:"Mac năm 90",autoSaving:"Tự động lưu",recordFileName:"Tên tệp kỳ phổ",select:"Chọn",shuffle:"Trộn",csaV3Output:"Xuất dưới dạng CSA v3",alwaysOutputUTF8:"Luôn xuất kỳ phổ UTF-8",someOldShogiAppsCannotReadUTF8KifFiles:"Một số phần mềm shogi cũ có thể không đọc được tệp KIF/KI2 có mã hóa UTF-8.",strictDecodingMayFailToReadUTF8KifFiles:"Chế độ mã hóa nghiêm khắc có thể không đọc được tệp KIF/KI2 có mã hóa UTF-8.",positionOfUSIOutput:"Định dạng thế cờ USI",movesOfUSIOutput:"Định dạng kỳ phổ USI",onlySFEN:"Chỉ SFEN",minimal:"Nhỏ nhất",pasteDialog:"Hộp thoại dán",liveDuplicatePositionDetection:"Tự động tìm thế cờ lặp lại",onTheFlyThreshold:"Giá trị On-the-fly",usiProtocol:"Định dạng USI",translateOptionName:"Dịch tên tùy chọn",functionalOnJapaneseOnly:"Chỉ dùng cho bản tiếng Nhật",maxStartupTime:"Thời gian khởi động tối đa",forDevelopers:"Dành cho nhà phát triển",enableAppLog:"Bật log ứng dụng",enableUSILog:"Bật log USI",enableCSALog:"Bật log CSA",logLevel:"Mức độ log",manageEngines:"Quản lý phần mềm",flipBoard:"Xoay bàn cờ",elapsedTimeChart:"Biểu đồ thời gian",shortcutKeys:"Phím tắt",useUpDownToMove1Ply:"Tiến/lùi nước bằng phím ↑/↓",useLeftRightToMove1Ply:"Tiến/lùi nước bằng phím ←/→",file:"Tệp",folder:"Tập tin",recordFile:"Tệp kỳ phổ",executableFile:"Tệp phần mềm",imageFile:"Tệp ảnh",unsaved:"Chưa lưu",remove:"Xóa",deleteMove:"Xóa nước đi",recordProperties:"Thuộc tính kỳ phổ",comments:"Bình luận",commentsAndBookmarks:"Bình luận & đánh dấu",branches:"Nhánh",branchListMode:"Hiển thị các nhánh",previousMoveBranches:"Các nước đã đi",nextMoveBranches:"Nước tiếp theo",bookmark:"Đánh dấu",bookmarkList:"Đánh dấu",useBookmarkAsHeader:"Sử dụng đánh dấu làm đầu đề",moveComments:"Bình luận nước đi",searchLog:"Lịch sử tìm kiếm",pv:"PV",mateShort:"M",displayPVShort:"Đi",evaluation:"Đánh giá",rawScore:"Đ.giá",score:"Đ.giá",estimatedWinRate:"Tỷ lệ thắng ước tính",evaluationAndEstimatedWinRateAndPV:"Đánh giá & tỷ lệ thắng ước tính & PV",swapEachTurnChange:"Đổi mỗi lượt",alwaysSenteIsPositive:"Tiên luôn dương",signOfEvaluation:"Dấu giá trị đánh giá",showArrowScore:"矢印に評価値を表示",arrowScoreDiffRange:"矢印の評価値範囲",maxArrows:"Số mũi tên hiển thị",winRateCoefficient:"Hệ số tỷ lệ thắng",nodeCountFormat:"Hiển thị số node",plainNumber:"Số thường",commaSeparated:"Chia bằng dấu phẩy",monitor:"Theo dõi",hideTabView:"Ẩn",expandTabView:"Mở hiển thị thẻ",sente:"Tiên thủ",senteOrShitate:"Tiên thủ (Hạ thủ)",shitate:"Hạ thủ",gote:"Hậu thủ",goteOrUwate:"Hậu thủ (Thượng thủ)",uwate:"Thượng thủ",targetEngine:"Phần mềm được kiểm tra",baseEngine:"Phần mềm so sánh",swapSenteGote:"Đổi Tiên/Hậu",pieceToss:"Furigoma",currentPosition:"Thế cờ hiện tại",positionList:"Danh sách thế cờ",enableEngineTimeout:"Bật hết giờ phần mềm",setDifferentTimeForGote:"Đặt thời gian khác cho Hậu",nextTurn:"Lượt đi",elapsedTime:"Thời gian dùng tổng cộng",elapsed:"T.gian",rank:"Hạng",depth:"Độ sâu",searchEngine:"Phần mềm",ponder:"Đọc trước",numberOfThreads:"Luồng",threads:"Luồng",suggestionsCount:"Số nước đề xuất",startPosition:"Thế cờ ban đầu",beginFromThisPosition:"Bắt đầu từ thế cờ này",maxMoves:"Số nước tối đa",gameRepetition:"Lặp lại thế cờ",parallelism:"Số ván song song",parallelGame:"Ván song song",jishogi:"Bế tắc",rule24:"Luật 24 điểm",rule27:"Luật 27 điểm",tryRule:"Luật Try",autoRelogin:"Tự động đăng nhập lại",restartItEveryGame:"Khởi động lại mỗi ván",swapTurnWhenGameRepetition:"Đổi lượt đi khi lặp lại nước đi",outputComments:"Xuất bình luận",saveRecordAutomatically:"Tự động lưu kỳ phổ",adjustBoardToHumanPlayer:"Tự động xoay bàn cờ về hướng người chơi",adjustBoardAutomatically:"Tự động xoay bàn cờ",command:"Lệnh",startGame:"Bắt đầu ván cờ",cancelGame:"Hủy ván cờ",allottedTime:"Thời gian",byoyomi:"Byoyomi",increments:"Cộng thời gian",startEndCriteria:"Điều kiện bắt đầu/kết thúc",descending:"Đảo thứ tự",endCriteria1Move:"Điều kiện kết thúc cho mỗi nước đi",outputSettings:"Tùy chọn xuất",noOutputs:"Không xuất",insertCommentToTop:"Chèn phía trước",appendCommentToBottom:"Chèn phía sau",insertToComment:"Chèn vào bình luận",insertToRecord:"Chèn vào kỳ phổ",overwrite:"Ghi đè",fromPrefix:"từ",fromSuffix:"",toPrefix:"tới",toSuffix:"",plyPrefix:"Nước thứ ",plySuffix:"",hoursSuffix:"h",minutesSuffix:"p",secondsSuffix:"s",eg:"vd.",totalMoves:"Tổng số nước",detailSettings:"Cài đặt chi tiết",engineManagement:"Quản lý phần mềm",engineName:"Tên phần mềm",author:"Tác giả",earlyPonder:"Tính nhanh",enginePath:"Đường dẫn phần mềm",openDirectory:"Mở đường dẫn",replaceEnginePath:"Chọn lại đường dẫn phần mềm",displayName:"Tên hiển thị",frontendBook:"Định thức (mở rộng GUI)",showAllOptions:"Hiển thị tất cả cài đặt",invoke:"Thực hiện",resetToEngineDefaultValues:"Đặt lại về giá trị ban đầu",defaultValue:"Giá trị mặc định",freeTextUnsafe:"Nhập tự do (không hỗ trợ)",noEngineRegistered:"Không có phần mềm",duplicate:"Sao chép",add:"Thêm",compareAndMerge:"So sánh/sáp nhập",compareEngineSettings:"So sánh cài đặt phần mềm",noDifference:"Không khác nhau",mergeToLeft:"Sáp nhập sang trái",mergeToRight:"Sáp nhập sang phải",recommended:"Đề xuất",import:"Nhập",saveAndClose:"Lưu và đóng",save:"Lưu",saveAs:"Lưu thành",history:"Lịch sử",clearHistory:"Xóa lịch sử",userFile:"Tệp người dùng",automaticBackup:"Sao lưu tự động",restore:"Khôi phục",loadRecordFromWeb:"Tải kỳ phổ từ mạng",backToMainBranch:"Trở về biến chính",fetchLatestData:"Lấy dữ liệu mới nhất",sourceURL:"URL nguồn",ok:"OK",cancel:"Hủy",back:"Quay lại",doNotShowAgain:"Không hiện lại lần sau",name:"Tên",prediction:"Dự đoán",best:"Tốt nhất",nodes:"Số thế cờ",hashUsage:"Sử dụng hash",stop:"Dừng",resume:"Tiếp tục",noHandicap:"Không chấp",lanceHandicap:"Chấp Thương",rightLanceHandicap:"Chấp Thương phải",bishopHandicap:"Chấp Tượng",rookHandicap:"Chấp Xe",rookLanceHandicap:"Chấp Xe + Thương",twoPiecesHandicap:"Chấp 2 quân",fourPiecesHandicap:"Chấp 4 quân",sixPiecesHandicap:"Chấp 6 quân",eightPiecesHandicap:"Chấp 8 quân",tenPiecesHandicap:"Chấp 10 quân",tsumeShogi:"Tsumeshogi",doubleKingTsumeShogi:"Tsumeshogi 2 vua",startDateTime:"Bắt đầu",endDateTime:"Kết thúc",gameDate:"Ngày",tournament:"Giải đấu",strategy:"Chiến pháp",gameTitle:"Tiêu đề",timeLimit:"Thời gian",blackTimeLimit:"Thời gian (Tiên)",whiteTimeLimit:"Thời gian (Hậu)",place:"Địa điểm",postedOn:"Đăng tại",note:"Ghi chú",senteShortName:"Tiên thủ (ngắn)",goteShortName:"Hậu thủ (ngắn)",scorekeeper:"Người ghi chép",opusNo:"Số hiệu",opusName:"Tên tác phẩm",publishedBy:"Xuất bản bởi",publishedOn:"Ngày xuất bản",source:"Nguồn",numberOfMoves:"Số nước đi",integrity:"Trạng thái",recordCategory:"Thể loại",award:"Giải thưởng",filterByOptionName:"Lọc theo tên tùy chọn",filterByEngineName:"Lọc theo tên phần mềm",bookStyle:"Kiểu sách",bookStyleDiagram:"Hình cờ kiểu sách",gameStyle:"Kiểu bàn cờ",thin:"Mảnh",bold:"Đậm",extraBold:"Siêu đậm",playerName:"Tên kỳ thủ",typeface:"Kiểu chữ",weight:"Độ đậm nhạt",handLabel:"Tên quân trên tay",header:"Đầu đề",vertical:"Dọc",size:"Kích cỡ",none:"Không",bgCover:"Hiện đơn",bgContain:"Phóng to",bgTile:"Mảnh ghép",inaccuracy:"Nước đi không chính xác",dubious:"Nước đi không tốt",mistake:"Sai lầm",blunder:"Sai lầm ngớ ngẩn",inaccuracyThreshold:"Ngưỡng nước không chính xác",dubiousThreshold:"Ngưỡng nước không tốt",mistakeThreshold:"Ngưỡng nước sai lầm",blunderThreshold:"Ngưỡng nước sai lầm ngớ ngẩn",maxPVLength:"Số nước đọc hiển thị",commentFormat:"Định dạng chú thích",gothic:"Gothic",mincho:"Minh thể",appVersion:"Phiên bản ứng dụng",installed:"Được cài đặt",stable:"Ổn định",latest:"Mới nhất",backgroundColor:"Màu nền",dialogPosition:"Vị trí hộp thoại",alignLeft:"Trái",alignRight:"Phải",alignCenter:"Giữa",dialogBackdrop:"Nền hộp thoại",record:"Kỳ phổ",book:"Định thức",chart:"Đồ thị",analytics:"Phân tích",controlGroup:"Menu",left:"Trái",top:"Trên",width:"Chiều rộng",height:"Chiều cao",newCustomProfile:"Cài đặt mới",addCustomLayoutProfile:"Thêm cài đặt",duplicateCurrentProfile:"Sao chép cài đặt hiện tại",removeCurrentProfile:"Xóa cài đặt hiện tại",exportProfileToClipboard:"Sao chép cài đặt",importProfileFromClipboard:"Dán cài đặt",profileExportedToClipboard:"Đã xuất cài đặt.",profileImported:"Đã nhập cài đặt.",failedToImportProfile:"Nhập cài đặt thất bại.",rightControlBox:"Menu bên phải",leftControlBox:"Menu bên trái",topControlBox:"Menu bên trên",legends:"Chú giải",historyMode:"Chế độ lịch sử",headers:"Đầu đề",playButton:"Nút phát lại",insert:"Chèn",bringForward:"Đưa lên trên",sendBackward:"Đẩy xuống dưới",move:"Nước đi",bookMove:"Nước định thức",play:"Chơi",edit:"Sửa",addMoves:"Thêm nước đi",flippedBook:"Sử dụng book lật ngược",addBookMoves:"Thêm định thức",fromCurrentRecord:"Từ kỳ phổ này",fromFile:"Từ tệp",fromDirectory:"Từ thư mục",noMoves:"Không tìm thấy nước đi.",register:"Đăng ký",update:"Cập nhật",currentMove:"Nước hiện tại",branchFrom:e=>`Phân nhánh từ nước thứ ${e}`,allPlayers:"Tất cả kỳ thủ",blackPlayerOnly:"Chỉ Tiên",whitePlayerOnly:"Chỉ Hậu",filterByName:"Lọc bằng tên",enterPartOfPlayerNameHere:"Nhập một phần tên kỳ thủ",freq:"Tần suất",frequency:"Tần suất xuất hiện",new:"Mới",duplicated:"Trùng lặp",moveEntry:"Nước đã được lưu",updatedAt:"Cập nhật lúc",createdAt:"Tạo lúc",lastSent:"Gửi lần cuối",lastReceived:"Nhận lần cuối",protocolVersion:"Phiên bản phương thức",prompt:"Nhắc lệnh",openPrompt:"Mở nhắc lệnh",forceQuit:"Buộc thoát",forceClose:"Buộc đóng",blankLine:"Dòng trống",autoScroll:"Tự động lướt",showTimestamp:"Hiện dấu thời gian",highlightByPartialMatch:"Đánh dấu trùng một phần",csaServer:"Máy chủ CSA",usiEngine:"Phần mềm USI",noRunningUSIEngine:"Không có phần mềm USI đang chạy.",noConnectedCSAServer:"Không kết nối với máy chủ CSA nào.",willBeRemovedFromTheListSoon:"Trình này đã đóng và sắp bị xóa khỏi danh sách.",typeCommandHereAndPressEnter:"Nhập lệnh tại đây và nhấn Enter.",allowBlankLine:"Cho phép dòng trống",removeSpaceFromBothEnds:"Xóa dấu cách ở hai đầu",collapseSequentialSpaces:"Gộp dấu cách liền nhau",typeCustomTitleHere:"Nhập tiêu đề",displayEmptyElements:"Hiện các mục trống",share:"Chia sẻ",waitingForNewGame:"Đang chờ ván mới.",waitingForPlayerSetup:"Đang chờ người chơi chuẩn bị.",insertedComment:"Đã chèn bình luận.",conversionCompleted:"Chuyển đổi hoàn tất.",human:"Người",randomPlayer:"Người chơi ngẫu nhiên",beginner:"Người mới học",staticRook:"Cư Phi Xa",rangingRook:"Chấn Phi Xa",pleaseSelectEngines:"Vui lòng chọn phần mềm.",thisItemCannotBeMerged:"Mục này không thể sáp nhập.",tryingToConnectAndLoginToCSAServer:"Đang kết nối và đăng nhập vào máy chủ CSA.",inBrowserLogsOutputToConsoleAndIgnoreThisSetting:"*Bản trình duyệt sẽ xuất log ra trình nhắc lệnh và bỏ qua cài đặt này.",shouldRestartToApplyLogSettings:"*Khởi động lại ứng dụng để áp dụng các cài đặt log.",canOpenLogDirectoryFromMenu:'*Bạn có thể mở đường dẫn log qua menu "Gỡ lỗi" - "Mở đường dẫn log".',hasNoOldLogCleanUpFeature:"*Ứng dụng này không có tính năng dọn dẹp. Vui lòng tự xóa log cũ.",shouldRestartToApplyLowLevelSettings:"※ Vui lòng khởi động lại ứng dụng để cập nhật cài đặt mức độ thấp hơn.",processingPleaseWait:"Đang tải, vui lòng chờ.",importingFollowingRecordOrPosition:"Đang nhập kỳ phổ (hoặc thế cờ) dưới đây.",supportsKIF_KI2_CSA_USI_SFEN_JKF_USEN:"*Hỗ trợ KIF, KI2, CSA, USI, SFEN, JKF, và USEN.",pleasePasteRecordIntoTextArea:"*Dán dữ liệu kỳ phổ vào vùng nhập chữ.",pleaseSpecifyPlainTextURL:"*Vui lòng nhập URL thô.",redirectNotSupported:"*Không hỗ trợ chuyển hướng.",desktopVersionPastesAutomatically:"*Bản máy tính sẽ tự động dán.",asNewFile:"Tệp mới",mergeToRootPosition:"Sáp nhập vào thế cờ ban đầu",mergeToCurrentPosition:"Sáp nhập vào thế cờ hiện tại",failedToMergeRecordWithDifferentInitialPosition:"Sáp nhập thất bại do thế cờ bắt đầu khác nhau.",failedToMergeRecordWithDifferentTurn:"Sáp nhập thất bại do lượt đi khác nhau.",earlyPonderFeatureSendsPonderhitCommandWithYaneuraOusNonStandardOptions:'Tính năng tính nhanh gửi lệnh "ponderhit" với các tùy chọn riêng củaYaneuraOu.',ifYourEngineNotSupportTheOptionsItMayCauseUnexpectedBehavior:"Phần mềm của bạn có thể báo lỗi nếu không hỗ trợ cài đặt này.",someLogsDisabled:"Một số tùy chọn log đã bị tắt.",logsRecommendedForCSAProtocol:"Chúng tôi đề xuất bật tùy chọn log cho phương thức CSA.",pleaseEnableLogsAndRestart:"Vui lòng bật tùy chọn log và khởi động lại ứng dụng.",hwaEnabled:"Đã bật gia tốc phần cứng (HWA).",hwaIsNotRecommendedForLongGames:"Vui lòng tắt HWA nếu ván cờ kéo dài.",pleaseDisableHWAAndRestart:"Vui lòng tắt HWA trong mục cài đặt và khởi động lại ứng dụng.",notSendPVOnStandardCSAProtocol:"PV không được gửi trong phương thức CSA tiêu chuẩn.",passwordWillSavedPlaintextBecauseOSSideEncryptionNotAvailable:"Mật khẩu sẽ được lưu thô vì hệ điều hành không hỗ trợ mã hóa.",pleaseUncheckSaveHistoryIfNotWantSave:"Vui lòng bỏ chọn lưu lịch sử nếu không muốn lưu.",floodgatePasswordShouldStartWithGameName:"Mật khẩu Floodgate phải bắt đầu bằng tên ván đấu. ",thisIsNotFloodgateOfficialGameName:"Đây không phải tên một ván đấu Floodgate chính thức.",yourPasswordDoesNotMeetFloodgateRequirementsDoYouStillWantToContinue:"Mật khẩu của bạn không đạt điều kiện của Floodgate. Bạn vẫn muốn tiếp tục chứ?",whenNewVersionIsAvailableItWillBeNotified:"Sẽ có thông báo khi có phiên bản mới.",pleaseCheckMessageThisIsTestNotificationByAboveButton:'Vui lòng thử tin nhắn "Đây là thông báo thử." bằng nút trên.',ifNotWorkYouShouldAllowNotificationOnOSSetting:"Nếu nó không hoạt động, vui lòng cho phép thông báo trong tùy chọn hệ điều hành.",translationHelpNeeded:"Chúng tôi cần bạn giúp đỡ phiên dịch.",restartRequiredAfterLocaleChange:"Khởi động lại ứng dụng để áp dụng ngôn ngữ.",createDesktopShortcut:"Tạo lối tắt trên desktop",desktopShortcutCreated:"Đã tạo lối tắt trên desktop.",areYouSureWantToResign:"Bạn có thật sự muốn đầu hàng không?",areYouSureWantToDoDeclaration:"Bạn có thật sự muốn tuyên bố không?",areYouSureWantToQuitGames:"Bạn có thật sự muốn bỏ ván không?",areYouSureWantToRequestQuit:"Bạn có thể bị xử thua. Bạn có thật sự muốn yêu cầu rời ván không?",areYouSureWantToClearRecord:"Bạn có thật sự muốn xóa kỳ phổ không?",areYouSureWantToDiscardPosition:"Bạn có thật sự muốn xóa thế cờ không?",areYouSureWantToOpenFileInsteadOfCurrentRecord:"Bạn có thật sự muốn ghi đè thế cờ hiện tại không?",areYouSureWantToClearHistory:"Bạn có thật sự muốn xóa lịch sử không?",areYouSureWantToRemoveCurrentProfile:"Bạn có thật sự muốn xóa cài đặt hiện tại không?",yamlFormatSettingsCopiedToClipboard:"Cài đặt đã được sao chép dưới dạng YAML.",jsonFormatSettingsCopiedToClipboard:"Cài đặt đã được sao chép dưới dạng JSON.",usiCsaBridgeCommandCopiedToClipboard:"Lệnh usi-csa-bridge đã được sao chép.",copiedToClipboard:"Đã sao chép vào bảng tạm.",pastedFromClipboard:"Đã dán từ bảng tạm.",youCanNotCloseAppWhileCSAOnlineGame:"Bạn không thể đóng ứng dụng trong khi đang có ván CSA.",fileExtensionNotSupported:"Không hỗ trợ định dạng này.",errorOccuredWhileDisconnectingFromCSAServer:"Đã có lỗi trong khi ngắt kết nối khỏi máy chủ CSA.",failedToConnectToCSAServer:"Kết nối với máy chủ CSA thất bại.",errorOccuredWhileLogoutFromCSAServer:"Đã có lỗi trong khi đăng xuất khỏi máy chủ CSA.",disconnectedFromCSAServer:"Đã ngắt kết nối khỏi máy chủ CSA.",csaServerLoginDenied:"Đăng nhập vào máy chủ CSA bị từ chối.",thisFeatureNotAvailableOnWebApp:"Tính năng này không có sẵn trên trình duyệt.",failedToStartNewGame:"Bắt đầu ván mới thất bại.",errorOccuredWhileEndingGame:"Đã có lỗi trong khi kết thúc ván.",failedToSendGoCommand:"Gửi lệnh go thất bại.",failedToSendPonderCommand:"Gửi lệnh ponder thất bại.",failedToSendStopCommand:"Gửi lệnh stop thất bại.",failedToShutdownEngines:"Dừng phần mềm thất bại.",failedToCheckUpdates:"Kiểm tra cập nhật thất bại.",failedToSaveRecord:"Lưu kỳ phổ thất bại.",failedToParseSFEN:"Đọc SFEN thất bại.",failedToDetectRecordFormat:"Xác định định dạng kỳ phổ thất bại.",unknown:"Không rõ",unknownFileExtension:"Định dạng tệp không rõ.",emptyRecordInput:"Kỳ phổ trống.",invalidPieceName:"Tên quân không hợp lệ",invalidTurn:"Lượt đi không hợp lệ",invalidMove:"Nước đi không hợp lệ",invalidMoveNumber:"Số nước đi không hợp lệ",invalidDestination:"Điểm đến không hợp lệ",pieceNotExists:"Quân cờ không tồn tại",invalidLine:"Dòng không hợp lại",invalidBoard:"Bàn cờ không hợp lệ",invalidHandPiece:"Quân trên tay không hợp lệ",invalidUSI:"USI không hợp lệ",engineProcessWasClosedUnexpectedly:"Phần mềm đã bị đóng bất ngờ.",backgroundImageFileNotSelected:"Chưa chọn ảnh nền.",pieceImageFileNotSelected:"Chưa chọn ảnh quân cờ.",boardImageFileNotSelected:"Chưa chọn ảnh bàn cờ.",pieceStandImageFileNotSelected:"Chưa chọn ảnh komadai.",pieceSoundVolumeMustBe0To100Percent:"Âm lượng quân phải từ 0% đến 100%.",clockSoundVolumeMustBe0To100Percent:"Âm lượng đồng hồ phải từ 0% đến 100%.",clockSoundPitchMustBe220To880Hz:"Cao độ đồng hồ phải từ 220Hz đến 880Hz.",engineTimeoutMustBe1To300Seconds:"Hết giờ phần mềm phải từ 1 đến 300 giây.",coefficientInSigmoidMustBeGreaterThan0:"Hệ số phải lớn hơn 0.",inaccuracyThresholdMustBe1To100Percent:"Ngưỡng khó hiểu phải từ 1% đến 100%.",dubiousThresholdMustBe1To100Percent:"Ngưỡng không chính xác phải từ 1% đến 100%.",mistakeThresholdMustBe1To100Percent:"Ngưỡng sai lầm phải từ 1% đến 100%.",blunderThresholdMustBe1To100Percent:"Ngưỡng sai lầm ngớ ngẩn phải từ 1% đến 100%.",recordSavedWithGarbledCharacters:"Kỳ phổ bị lưu với một số ký tự lỗi.",pleaseConsiderToUseKIFU:"Vui lòng cân nhắc sử dụng định dạng KIFU (UTF-8).",youCanChangeDefaultRecordFileFormatFromAppSettings:"Bạn có thể đổi định dạng mặc định trong cài đặt ứng dụng.",inaccuracyThresholdMustBeLessThanDubiousThreshold:"Ngưỡng khó hiểu phải nhỏ hơn ngưỡng không chính xác.",dubiousThresholdMustBeLessThanMistakeThreshold:"Ngưỡng không chính xác phải nhỏ hơn ngưỡng sai lầm.",mistakeThresholdMustBeLessThanBlunderThreshold:"Ngưỡng sai lầm phải nhỏ hơn ngưỡng sai lầm ngớ ngẩn.",thisEngineNotSupportsMateSearch:"Phần mềm này không hỗ trợ đọc chiếu hết.",pleaseEndActiveFeaturesBeforeOpenRecord:"Vui lòng đóng các tính năng đang chạy trước khi mở kỳ phổ.",bothTimeLimitAndByoyomiAreNotSet:"Thời gian và byoyomi chưa được đặt.",canNotUseByoyomiWithFischer:"Bạn không thể dùng byoyomi với chế độ Fischer.",repeatsMustBeOneIfHumanPlayerIncluded:"Nếu có người chơi, số lần lặp lại phải là 1.",parallelismMustBeOneIfHumanPlayerIncluded:"Nếu có người thi đấu, số ván song song phải là 1.",parallelismMustBeOneIfCurrentPositionIsUsed:"Nếu bắt đầu bằng thế cờ hiện tại, số ván song song phải là 1.",parallelismMustLessThanOrEqualToRepeats:"Vui lòng đặt số ván song song không quá số ván liên tục.",protocolVersionNotSelected:"Chưa chọn phiên bản phương thức.",hostNameIsEmpty:"Tên máy chủ trống.",invalidPortNumber:"Cổng không hợp lệ.",idIsEmpty:"Tên người dùng trống.",idContainsSpace:"Tên người dùng chứa dấu cách.",passwordContainsSpace:"Mật khẩu chứa dấu cách.",tcpKeepaliveInitialDelayMustBePositive:"Trì hoãn giữ kết nối TCP ban đầu phải dương.",blankLinePingInitialDelayMustBeGreaterThanOrEqualTo30:"Trì hoãn ping dòng trống ban đầu phải >=30.",blankLinePingIntervalMustBeGreaterThanOrEqualTo30:"Thời gian ping dòng trống phải >=30.",engineNotSelected:"Chưa chọn phần mềm.",forExportingConversionLogPleaseEnableAppLogsAndSetLogLevelDebugAndRestart:"Để xuất log chuyển đổi, vui lòng bật log ứng dụng, đặt cấp độ log thành DEBUG và khởi động lại ứng dụng.",sourceDirectoryNotSpecified:"Đường dẫn nguồn chưa được đặt.",sourceFileMustBeSFEN:"Tên tập tin phải có đuôi .sfen.",sourceFormatsNotSpecified:"Định dạng nguồn chưa được đặt.",destinationDirectoryNotSpecified:"Đường dẫn đến chưa được đặt.",destinationFileNotSpecified:"Tệp đến chưa được đặt.",anyUnsavedDataWillBeLostDoYouReallyWantToResetBookData:"Tất cả dữ liệu chưa lưu sẽ bị mất. Bạn có muốn đặt lại dữ liệu định thức?",bookMovesWereImported:"Dữ liệu định thức đã được nhập thành công.",anyBookMovesAreUnsavedDoYouReallyWantToDiscardThemAndCloseTheApp:"Có các nước định thức chưa lưu. Bạn có muốn hủy bỏ chúng và đóng ứng dụng?",cannotOverwriteOnTheFlyBook:"Không thể ghi đè lên sách đang sử dụng chế độ On-the-fly.",pleaseSpecifyOtherFileName:"Vui lòng chọn tên tệp khác.",sourceRecordFileNotSet:"Chưa chỉ định tệp kỳ phổ gốc.",sourceDirectoryNotSet:"Vui lòng chọn một tập tin.",minPlyMustBeLessThanMaxPly:"Số nước ít nhất phải nhỏ hơn số nước lớn nhất.",playerNameNotSet:"Tên người chơi chưa được đặt.",incompatibleOptionsWillBeDiscardedDoYouReallyWantToReplaceTheEnginePath:"Các cài đặt không tương thích sẽ bị xóa bỏ. Bạn có thực sự muốn thay đổi đường dẫn phần mềm?",largeSuggestionsCountMayCausePerformanceDegradation:"Số nước đề xuất quá lớn có thể làm ứng dụng chậm đi đáng kể.",doYouReallyWantToIncreaseTheSuggestionsCount:"Bạn có thực sự muốn tăng số nước đề xuất?",recommendLowerSettingsForDailyUse:"Nên sử dụng cài đặt thấp hơn cho PC thông thường.",checkEngineCompatibilityForNumaEnvironments:"Máy tính này có thể có nhiều ổ CPU hoặc nhóm vi xử lý (NUMA). Các phần mềm không hỗ trợ NUMA có thể bị suy yếu. Vui lòng kiểm tra nếu phần mềm bạn dùng hỗ trợ NUMA.",aiPerformanceMayDegrade:"Tính năng phần mềm có thể suy giảm.",yourPCMayBecomeSlow:"Thao tác PC có thể bị chậm lại.",increasingItMayImproveAIPerformance:"Có thể cải thiện tính năng phần mềm bằng cách tăng lên.",totalNumber:e=>`Tổng: ${e}`,number:e=>""+e,tryToReloginToCSAServerNSecondsLater:e=>`Vui lòng đăng nhập lại sau ${e} giây.`,mateInNPlyDoYouWantToDisplay:e=>`Có chiếu hết trong ${e} nước. Bạn có muốn hiển thị?`,insertedNMovesToRecord:e=>`Đã chèn ${e} nước vào kỳ phổ.`,errorsOccurred:e=>`Đã có ${e} lỗi xảy ra.`,between:(e,t)=>`từ ${e} đến ${t}`,addNthEngine:e=>`Thêm phần mềm thứ ${e}`,copyOf:e=>`Bản sao của ${e}`,keepLatest:e=>`${e} bản mới nhất`,followingDataNotSavedBecauseNotSupporetedBy:e=>`Dữ liệu sau không được lưu vì không được định dạng "${e}" hỗ trợ.`,areYouSureWantToDeleteFollowingMove:e=>`Bạn có muốn xóa nước thứ ${e} trở đi không?`,failedToOpenDirectory:e=>`Mở tệp: ${e} thất bại`,unexpectedEventSenderPleaseReport:e=>`Nguồn sự kiện ngoài dự tính. Vui lòng báo cáo lỗi này cho nhà phát triển. [${e}]`,unexpectedHTTPMethodPleaseReport:e=>`Phương thức HTTP ngoài dự tính. Vui lòng báo cáo lỗi này cho nhà phát triển. [${e}]`,unexpectedRequestURLPleaseReport:e=>`URL yêu cầu ngoài dự tính. Vui lòng báo cáo lỗi này cho nhà phát triển. [${e}]`,noResponseFromEnginePleaseExtendTimeout:e=>`Không có phản hồi từ phần mềm sau ${e} giây. Vui lòng kéo dài thời gian hết giờ nếu phần mềm của bạn chậm.`,stableVersionReleased:e=>`Phiên bản ổn định ${e} đã ra mắt!`,latestVersionReleased:e=>`Phiên bản mới nhất ${e} đã ra mắt!`,doYouReallyWantToRemoveBookMove:e=>`Bạn có thực sự muốn xóa nước định thức ${e}?`,unexpectedRecordFileExtension:e=>`Định dạng kỳ phổ không được hỗ trợ. [${e}]`,fileNotFound:e=>`Không tìm thấy tệp. [${e}]`,directoryNotFound:e=>`Không tìm thấy tập tin. [${e}]`,youCanExitFullScreenByPressing:e=>`Bạn có thể thoát chế độ toàn màn hình bằng cách nhấn phím ${e}.`,skippedMovesInMerge:(e,t)=>`Trong ${t} nước, đã không thể sáp nhập ${e} nước.`,cpuUsageExceedsNPercent:e=>`Đang sử dụng quá ${e}% CPU.`,totalNumberOfThreadsExceedsNPercentOfCpuCores:e=>`Số luồng vượt quá ${e}% số lõi CPU.`,memoryUsageExceedsNPercent:e=>`Sử dụng RAM vượt quá ${e}%.`,memoryUsageIsLessThanNPercent:e=>`Sử dụng RAM ít hơn ${e}%.`,totalUSIHashExceedsNPercentOfMemory:e=>`Tổng USI_HASH vượt quá ${e}% RAM.`},l=s;function h(e){Object.entries(function(e){switch(e){case n.JA:return s;case n.EN:return a;case n.ZH_TW:return r;case n.VI:return c;default:return s}}(e)).forEach(([e,t])=>{l[e]=t})}const d={USI_Ponder:"相手番思考",Ponder:"相手番思考",USI_Hash:"ハッシュ",Hash:"ハッシュ",Clear_Hash:"ハッシュクリア",Threads:"スレッド",NumberOfThreads:"スレッド数",thread_num_per_gpu:"GPUあたりのスレッド数",ThreadIdOffset:"スレッドIDオフセット",MultiPV:"マルチPV(候補手の表示件数)",BookFile:"定跡ファイル",Book_File:"定跡ファイル",Book_Enable:"定跡あり",BookEvalDiff:"定跡の評価値差",book_file_name:"定跡ファイル名",use_book:"定跡を使用",BookPvMoves:"定跡PV手数",TinyBook:"小さい定跡",BookMoves:"定跡利用手数",BookMaxPly:"定跡最大手数",BookIgnoreRate:"定跡不使用率",RandomBookSelect:"ランダム定跡選択",IgnoreBookPly:"定跡の手数を無視",DepthLimit:"最大深さ",NarrowBook:"定跡手を限定",WriteDebugLog:"デバッグログ出力",Write_Debug_Log:"デバッグログ出力",ResignValue:"投了基準値",ResignScore:"投了基準値",PvInterval:"PV出力間隔",NodesLimit:"最大ノード数",USI_OwnBook:"定跡を使用",OwnBook:"定跡を使用",EvalDir:"評価関数のフォルダ",Eval_Dir:"評価関数のフォルダ",EvalFile:"評価関数ファイル",EvalHash:"評価値ハッシュ",Eval_Hash:"評価値ハッシュ",EvalSaveDir:"評価関数保存フォルダ",EvalShare:"評価値共有",BookDir:"定跡ファイルのフォルダ",Stochastic_Ponder:"確率的相手番思考",MinimumThinkingTime:"最小思考時間",Minimum_Thinking_Time:"最小思考時間",MinThinkingTime:"最小思考時間",MaxMovesToDraw:"強制引き分け手数",SlowMover:"長考",Slow_Mover:"長考",OutputFailLHPV:"Fail Low/Highを出力",NetworkDelay:"通信遅延",NetworkDelay2:"通信遅延2",FV_SCALE:"評価値スケール",UseBook:"定跡を使用",MaxDepth:"最大深さ",MarginMs:"マージン(ミリ秒)",Time_Margin:"時間マージン",ByoyomiMargin:"秒読みマージン",Byoyomi_Margin:"秒読みマージン",byoyomi_margin:"秒読みマージン",Move_Overhead:"着手オーバーヘッド",FischerMargin:"フィッシャーマージン",SuddenDeathMargin:"切れ負けマージン",Snappy:"素早く指す",EnteringKingRule:"入玉ルール",Do_YoTsume_Search:"余詰めを探索",gpu_num:"GPU数",ConsiderationMode:"検討モード",ConsiderBookMoveCount:"定跡出現率を使用",GenerateAllLegalMoves:"全合法手を生成",DrawScore:"引き分けのスコア",DrawValue:"引き分けの値",DrawValueBlack:"引き分けの値・先手",DrawValueWhite:"引き分けの値・後手",LargePageEnable:"LargePageを使用",SkillLevel:"スキルレベル",Skill_Level:"スキルレベル",BookOnTheFly:"定跡直接読み込み(大規模定跡)",BookDepthLimit:"定跡深さ制限",BookEvalBlackLimit:"定跡評価値制限・先手",BookEvalWhiteLimit:"定跡評価値制限・後手"},u={};function m(e){Object.keys(u).forEach(e=>{delete u[e]}),Object.entries(function(e){switch(e){case n.JA:return d;case n.EN:default:return{}}}(e)).forEach(([e,t])=>{u[e]=t})}var p=o(113);function g(e){return e instanceof p.InvalidPieceNameError?new Error(`${l.invalidPieceName}: ${e.data}`):e instanceof p.InvalidTurnError?new Error(`${l.invalidTurn}: ${e.data}`):e instanceof p.InvalidMoveError?new Error(`${l.invalidMove}: ${e.data}`):e instanceof p.InvalidMoveNumberError?new Error(`${l.invalidMoveNumber}: ${e.data}`):e instanceof p.InvalidDestinationError?new Error(`${l.invalidDestination}: ${e.data}`):e instanceof p.PieceNotExistsError?new Error(`${l.pieceNotExists}: ${e.data}`):e instanceof p.InvalidLineError?new Error(`${l.invalidLine}: ${e.data}`):e instanceof p.InvalidBoardError?new Error(`${l.invalidBoard}: ${e.data}`):e instanceof p.InvalidHandPieceError?new Error(`${l.invalidHandPiece}: ${e.data}`):e instanceof p.InvalidUSIError?new Error(`${l.invalidUSI}: ${e.data}`):e}function S(e){h(e),m(e)}},698(e,t,o){var n,i;o.d(t,{$:()=>i,F:()=>n}),function(e){e.APP="app",e.USI="usi",e.CSA="csa"}(n||(n={})),function(e){e.DEBUG="debug",e.INFO="info",e.WARN="warn",e.ERROR="error"}(i||(i={}))},389(e,t,o){var n,i;o.d(t,{F:()=>i,Q:()=>n}),function(e){e.NONE="none",e.INSERT="insert",e.APPEND="append",e.OVERWRITE="overwrite"}(n||(n={})),function(e){e.SHOGIHOME="shogihome",e.FLOODGATE="floodgate",e.CSA3="csa3",e.SHOGIGUI="shogigui"}(i||(i={}))},265(e,t,o){o.d(t,{$P:()=>f,VX:()=>S,_B:()=>m,eA:()=>g,uU:()=>y,xv:()=>T});var n=o(186),i=o(347),a=o(1),s=o(591),r=o(953),c=o.n(r),l=o(211),h=o(389);const[d,u]=[c().base64Decode,c().base64Encode];var m;function p(){return{protocolVersion:m.V121_FLOODGATE,host:"",port:4081,id:"",password:"",tcpKeepalive:{initialDelay:10}}}function g(){return{player:{name:a.t.human,uri:n.He},server:p(),autoFlip:!0,enableComment:!0,enableAutoSave:!0,autoSaveDirectory:"",repeat:1,autoRelogin:!0,restartPlayerEveryGame:!1,searchCommentFormat:h.F.SHOGIHOME}}function S(e){const t=(0,i.$)(e.player);if(t)return t;const o=function(e){if(e.protocolVersion!==m.V121&&e.protocolVersion!==m.V121_FLOODGATE&&e.protocolVersion!==m.V121_X1)return new Error(a.t.protocolVersionNotSelected);if(""===e.host)return new Error(a.t.hostNameIsEmpty);if(e.port<0||e.port>65535)return new Error(a.t.invalidPortNumber);if(""===e.id)return new Error(a.t.idIsEmpty);if(e.id.indexOf(" ")>=0)return new Error(a.t.idContainsSpace);if(e.password.indexOf(" ")>=0)return new Error(a.t.passwordContainsSpace);if(e.tcpKeepalive.initialDelay<=0)return new Error(a.t.tcpKeepaliveInitialDelayMustBePositive);if(e.blankLinePing){if(e.blankLinePing.initialDelay<30)return new Error(a.t.blankLinePingInitialDelayMustBeGreaterThanOrEqualTo30);if(e.blankLinePing.interval<30)return new Error(a.t.blankLinePingIntervalMustBeGreaterThanOrEqualTo30)}}(e.server);return o||(e.server.protocolVersion!==m.V121&&e.server.protocolVersion!==m.V121_FLOODGATE?new Error("protocolVersion must be v121 or v121_floodgate"):!Number.isInteger(e.repeat)||e.repeat<1?new Error("repeat must be a positive integer"):void 0)}function y(e){return{player:{name:a.t.human,uri:n.He},serverHistory:[],autoFlip:!0,enableComment:!0,enableAutoSave:!!e?.autoSaveDirectory,autoSaveDirectory:(0,l.w)(e?.autoSaveDirectory||""),repeat:1,autoRelogin:!0,restartPlayerEveryGame:!1}}!function(e){e.V121="v121",e.V121_FLOODGATE="v121_floodgate",e.V121_X1="v121_x1"}(m||(m={}));function f(e,t){const o=(0,s.X1)(e.usi,t?.playerURI);return{player:{name:e.usi.name,uri:o.uri,usi:o},server:e.server,autoFlip:!0,enableComment:e.enableComment,enableAutoSave:e.saveRecordFile,autoSaveDirectory:t?.autoSaveDirectory||"",repeat:e.repeat,autoRelogin:e.autoRelogin,restartPlayerEveryGame:e.restartPlayerEveryGame,searchCommentFormat:e.searchCommentFormat||h.F.SHOGIHOME}}async function T(e){const t=new Uint8Array(d(e)),o=new DecompressionStream("gzip");return new Blob([t]).stream().pipeThrough(o),JSON.parse(await new Response(o.readable).text())}},347(e,t,o){o.d(t,{$:()=>r,w:()=>s});var n=o(1),i=o(591),a=o(186);function s(){return{name:n.t.human,uri:a.He}}function r(e){if(!e.name)return new Error("player name is required");if(!e.uri)return new Error("player URI is required");if(a.Em(e.uri)){if(!e.usi)return new Error("USI is required");const t=(0,i.wb)(e.usi);if(t)return t}else if(a.b0(e.uri)){if(!a.iM.some(t=>t===e.uri))return new Error("invalid player URI")}else if(e.uri!==a.He)return new Error("invalid player URI")}},591(e,t,o){o.d(t,{Br:()=>d,If:()=>h,J3:()=>m,Lo:()=>g,X1:()=>k,YZ:()=>l,aW:()=>u,my:()=>p,pk:()=>S,wb:()=>E,z4:()=>A});var n=o(186),i=o(1),a=o(953),s=o.n(a);const[r,c]=[s().base64Decode,s().base64Encode],l="USI_Ponder",h="USI_Hash",d="USI_MultiPV",u="MultiPV";function m(e){if(e&&"button"!==e.type)return void 0!==e.value?e.value:"string"!==e.type&&"filename"!==e.type||"<empty>"!==e.default?e.default:""}function p(e){return"true"===m(e.options[l])}function g(e){const t=m(e.options[d])||m(e.options[u]);return"number"==typeof t?t:void 0}function S(e){return"true"===m(e.options.Stochastic_Ponder)}var y;function f(e){switch(e){case"game":return i.t.game;case"research":return i.t.research;case"mate":return i.t.mateSearch}}function T(e){switch(e){case y.GAME:return f("game");case y.RESEARCH:return f("research");case y.MATE:return f("mate")}}function v(e){return Object.entries(e).filter(([e,t])=>t&&T(e)).map(([e])=>T(e))}function C(e){switch(e){case f("game"):return y.GAME;case f("research"):return y.RESEARCH;case f("mate"):return y.MATE}}function b(e){const t={[y.GAME]:!1,[y.RESEARCH]:!1,[y.MATE]:!1};for(const o of e){const e=C(o);e&&(t[e]=!0)}return t}function E(e){if(!n.Em(e.uri))return new Error("invalid engine URI");if(!e.name&&!e.defaultName)return new Error("engine name is required");if(!e.path)return new Error("engine path is required");for(const t in e.options){const o=e.options[t];if(!["check","spin","combo","button","string","filename"].includes(o.type))return new Error(`invalid option type: name=[${t}] type=[${o.type}]`);if(!P(o))return new Error(`invalid option value: name=[${t}] type=[${o.type}]`+("button"!==o.type?` value=[${o.value}]`:""))}}function P(e){if("button"===e.type||void 0===e.value)return!0;switch(e.type){case"check":if("true"!==e.value&&"false"!==e.value)return!1;break;case"spin":if("number"!=typeof e.value)return!1;if(void 0!==e.min&&e.value<e.min&&e.value!==e.default)return!1;if(void 0!==e.max&&e.value>e.max&&e.value!==e.default)return!1;break;case"string":case"filename":case"combo":if("string"!=typeof e.value)return!1}return!0}!function(e){e.GAME="game",e.RESEARCH="research",e.MATE="mate"}(y||(y={}));const I={blue:"#1565C0",green:"#2E7D32",orange:"#D84315",brown:"#5D4037",purple:"#7B1FA2",indigo:"#303F9F",amber:"#EF6C00",gray:"#616161",pink:"#C2185B"};class A{engines={};tagColorMapping={};constructor(e){if(e){const t=JSON.parse(e);Object.keys(t.engines).filter(n.Em).forEach(e=>{const o={uri:"",name:"",defaultName:"",author:"",path:"",options:{},labels:{game:!0,research:!0,mate:!0},tags:[f("game"),f("research"),f("mate")],enableEarlyPonder:!1,extraBook:{enabled:!1,filePath:"",onTheFly:!1}},n=t.engines[e];this.engines[e]={...o,...n,uri:e,labels:{...o.labels,...n.labels},tags:n.tags||v(n.labels||{})}}),this.tagColorMapping=t.tagColorMapping||{},this.updateTagColorMapping()}}hasEngine(e){return!!this.engines[e]}addEngine(e){this.engines[e.uri]=e,this.updateTagColorMapping()}updateEngine(e){return!!this.engines[e.uri]&&(this.engines[e.uri]=e,this.updateTagColorMapping(),!0)}removeEngine(e){return!!this.engines[e]&&(delete this.engines[e],this.updateTagColorMapping(),!0)}getEngine(e){return this.engines[e]}get engineList(){return Object.values(this.engines).sort((e,t)=>e.name!==t.name?e.name>t.name?1:-1:e.defaultName!==t.defaultName?e.defaultName>t.defaultName?1:-1:e.uri>t.uri?1:-1)}get tagList(){return Object.entries(this.tagColorMapping).map(([e,t])=>({name:e,color:I[t]})).sort((e,t)=>e.name>t.name?1:-1)}getTagColor(e){const t=this.tagColorMapping[e]||"blue";return I[t]||I.blue}addTag(e,t){this.engines[e]&&(this.engines[e].tags=this.engines[e].tags||[],this.engines[e].tags.includes(t)||this.engines[e].tags.push(t),this.updateTagColorMapping(),this.engines[e].labels=b(this.engines[e].tags))}removeTag(e,t){this.engines[e]&&(this.engines[e].tags=this.engines[e].tags?.filter(e=>e!==t),this.updateTagColorMapping(),this.engines[e].labels=b(this.engines[e].tags||[]))}updateTagColorMapping(){const e=new Set;for(const t of Object.values(this.engines))for(const o of t.tags??[])e.add(o);const t=Object.keys(I),o=new Set(Object.values(this.tagColorMapping)),n=t.filter(e=>!o.has(e));let i=Object.keys(this.tagColorMapping).length;for(const o of e)if(!this.tagColorMapping[o]){const e=n.shift()??t[i%t.length];this.tagColorMapping[o]=e,i++}for(const t of Object.keys(this.tagColorMapping))e.has(t)||delete this.tagColorMapping[t]}get json(){return JSON.stringify(this)}get jsonWithIndent(){return JSON.stringify(this,void 0,2)}getClone(){return new A(this.json)}}function k(e,t){const o={};for(const t in e.options){const n=e.options[t];switch(n.type){case"check":o[t]={name:t,type:"check",order:0,value:n.value?"true":"false"};break;case"spin":o[t]={name:t,type:"spin",order:0,value:n.value};break;case"combo":o[t]={name:t,type:"combo",order:0,value:n.value,vars:[n.value]};break;default:o[t]={name:t,type:n.type,order:0,value:n.value}}}return{uri:t||(0,n.A7)(),name:e.name,defaultName:e.name,author:"",path:e.path,options:o,enableEarlyPonder:e.enableEarlyPonder,extraBook:e.extraBook,labels:{}}}},186(e,t,o){o.d(t,{A7:()=>m,DI:()=>r,Em:()=>u,He:()=>n,KY:()=>h,b0:()=>d,iM:()=>c,ke:()=>a,m7:()=>p,y3:()=>s});o(1);const n="es://human",i="es://basic-engine/",a=`${i}static_rook/v1`,s=`${i}ranging_rook/v1`,r=`${i}random`,c=[a,s,r],l="es://usi-engine/",h="es://layout-profile/standard";function d(e){return e.startsWith(i)}function u(e){return e.startsWith(l)}function m(){const e=Date.now(),t=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16);return l+`${e}/${t}`}function p(e){return`es://temp-file/${Date.now()}/${Math.floor(Math.random()*16**6).toString(16).padStart(6,"0")}/${e}`}},348(e,t,o){o.r(t),o.d(t,{CSAGameManager:()=>y,CSAGameState:()=>g,loginRetryIntervalSeconds:()=>p,onCSAClose:()=>P,onCSAGameResult:()=>E,onCSAGameSummary:()=>T,onCSAMove:()=>b,onCSAReject:()=>v,onCSAStart:()=>C});var n=o(676),i=o(690),a=o(154),s=o(265),r=o(113),c=o(389),l=o(518),h=o(1),d=o(178),u=o(128),m=o(186);const p=10;var g,S;!function(e){e[e.OFFLINE=0]="OFFLINE",e[e.PLAYER_SETUP=1]="PLAYER_SETUP",e[e.WAITING_LOGIN=2]="WAITING_LOGIN",e[e.LOGIN_FAILED=3]="LOGIN_FAILED",e[e.LOGIN_RETRY_INTERVAL=4]="LOGIN_RETRY_INTERVAL",e[e.READY=5]="READY",e[e.GAME=6]="GAME"}(g||(g={})),function(e){e[e.DO_NOT_RELOGIN=0]="DO_NOT_RELOGIN",e[e.RELOGIN_WITH_INTERVAL=1]="RELOGIN_WITH_INTERVAL",e[e.RELOGIN_IMMEDIATELY=2]="RELOGIN_IMMEDIATELY"}(S||(S={}));class y{recordManager;blackClock;whiteClock;_state=g.OFFLINE;_settings=(0,s.eA)();_sessionID=0;stopRequested=!1;repeat=0;player;gameSummary=(0,i.Rr)();searchInfo;playerBuilder=(0,a.c)();retryTimer;onSaveRecord=()=>{};onGameNext=()=>{};onNewGame=()=>{};onClosed=()=>{};onLoginRetry=()=>{};onFlipBoard=()=>{};onPieceBeat=()=>{};onBeepShort=()=>{};onBeepUnlimited=()=>{};onStopBeep=()=>{};onError=()=>{};constructor(e,t,o){this.recordManager=e,this.blackClock=t,this.whiteClock=o}on(e,t){switch(e){case"saveRecord":this.onSaveRecord=t;break;case"gameNext":this.onGameNext=t;break;case"newGame":this.onNewGame=t;break;case"closed":this.onClosed=t;break;case"loginRetry":this.onLoginRetry=t;break;case"flipBoard":this.onFlipBoard=t;break;case"pieceBeat":this.onPieceBeat=t;break;case"beepShort":this.onBeepShort=t;break;case"beepUnlimited":this.onBeepUnlimited=t;break;case"stopBeep":this.onStopBeep=t;break;case"error":this.onError=t}return this}get state(){return this._state}get settings(){return this._settings}get sessionID(){return this._sessionID}get usiSessionID(){return this.player instanceof u.USIPlayer?this.player.sessionID:0}get isMyTurn(){return this.recordManager.record.position.color===this.gameSummary.myColor}get waitingForHumanPlayerMove(){return this.isMyTurn&&this.settings.player.uri===m.He}async login(e,t){if(this.sessionID)throw new Error("CSAGameManager#login: session already exists");if(this._state!==g.OFFLINE)throw new Error("CSAGameManager#login: unexpected state");this._state=g.PLAYER_SETUP,this._settings=e,this.playerBuilder=t,this.repeat=0;try{this.player=await this.playerBuilder.build(this._settings.player,e=>this.recordManager.updateSearchInfo(l.K.OPPONENT,e))}catch(e){throw this._state=g.OFFLINE,e}this.doLogin().catch(this.onError)}async relogin(){if(this.settings.restartPlayerEveryGame){this._state=g.PLAYER_SETUP,this.player&&(await this.player.close(),this.player=void 0);try{this.player=await this.playerBuilder.build(this._settings.player,e=>this.recordManager.updateSearchInfo(l.K.OPPONENT,e))}catch(e){throw this._state=g.LOGIN_FAILED,this.close(S.RELOGIN_WITH_INTERVAL),e}}await this.doLogin()}async doLogin(){if(!this.player)throw new Error("CSAGameManager#login: player is not initialized");try{this._state=g.PLAYER_SETUP,await this.player.readyNewGame(),this._state=g.WAITING_LOGIN;const e=await n.Ay.csaLogin(this._settings.server);this._sessionID=e,this._state=g.READY,function(e,t){f[e]=t}(this.sessionID,this),this.onGameNext()}catch(e){throw this._state=g.LOGIN_FAILED,this.close(S.RELOGIN_WITH_INTERVAL),new Error(`CSAGameManager#login: ${h.t.failedToStartNewGame}: ${e}`)}}stop(){this.sessionID&&(this.stopRequested=!0,n.Ay.csaStop(this.sessionID))}logout(){this.close(S.DO_NOT_RELOGIN)}close(e){if(this._state!==g.OFFLINE&&this._state!==g.WAITING_LOGIN){var t;if(this._state===g.GAME&&this.settings.enableAutoSave&&this.onSaveRecord(this.settings.autoSaveDirectory),this.stopRequested&&(e=S.DO_NOT_RELOGIN,this.stopRequested=!1),this.sessionID&&(t=this.sessionID,delete f[t],n.Ay.csaLogout(this.sessionID).catch(e=>{this.onError(new Error(`CSAGameManager#close: ${h.t.errorOccuredWhileLogoutFromCSAServer}: ${e}`))}),this._sessionID=0),this.blackClock.stop(),this.whiteClock.stop(),this._state=g.OFFLINE,this.retryTimer&&(clearTimeout(this.retryTimer),this.retryTimer=void 0),e===S.DO_NOT_RELOGIN||this.repeat>=this.settings.repeat)return this.player&&(this.player.close().catch(e=>{this.onError(new Error(`CSAGameManager#close: ${h.t.failedToShutdownEngines}: ${e}`))}),this.player=void 0),void this.onClosed();e===S.RELOGIN_IMMEDIATELY?this.relogin().catch(this.onError):(this._state=g.LOGIN_RETRY_INTERVAL,this.onLoginRetry(),this.retryTimer=setTimeout(()=>this.relogin().catch(this.onError),1e3*p))}}onGameSummary(e){this.gameSummary=e;const t=this.recordManager.importRecord(this.gameSummary.position,{type:r.RecordFormatType.CSA});if(t)return this.onError(`CSAGameManager#onGameSummary: ${t}`),void this.close(S.DO_NOT_RELOGIN);this.recordManager.changePly(Number.MAX_SAFE_INTEGER),n.Ay.csaAgree(this.sessionID,this.gameSummary.id)}onReject(){this.close(S.RELOGIN_WITH_INTERVAL)}onStart(e){this.repeat++,this.onNewGame(this.repeat);const t=this.gameSummary.players.black.time,o=this.gameSummary.players.white.time;this.recordManager.setGameStartMetadata({gameTitle:this.gameSummary.id,blackName:this.gameSummary.players.black.playerName,whiteName:this.gameSummary.players.white.playerName,blackTimeLimit:{timeSeconds:t.totalTime*t.timeUnitMs/1e3,byoyomi:t.byoyomi*t.timeUnitMs/1e3,increment:t.increment*t.timeUnitMs/1e3},whiteTimeLimit:{timeSeconds:o.totalTime*o.timeUnitMs/1e3,byoyomi:o.byoyomi*o.timeUnitMs/1e3,increment:o.increment*o.timeUnitMs/1e3}}),this.settings.autoFlip&&this.onFlipBoard&&this.onFlipBoard(this.gameSummary.myColor===r.Color.WHITE),this._state=g.GAME,this.next(e)}onMove(e,t){const o=this.isMyTurn,n=(0,r.parseCSAMove)(this.recordManager.record.position,e);if(n instanceof Error)this.onError(`CSAGameManager#onMove: 解釈できない指し手 [${e}]: ${n.message}`);else{if(this.recordManager.appendMove({move:n,moveOption:{ignoreValidation:!0},elapsedMs:this.parseElapsedMs(n.color,e)}),o&&this.searchInfo&&this.recordManager.updateSearchInfo(l.K.PLAYER,this.searchInfo),o&&this.searchInfo&&this.settings.enableComment){const e=this.gameSummary.players[n.color].playerName;this.recordManager.appendSearchComment(l.K.PLAYER,this.settings.searchCommentFormat,this.searchInfo,c.Q.APPEND,{engineName:e})}this.onPieceBeat(),this.next(t)}}parseElapsedMs(e,t){const o=this.gameSummary.players[e].time,n=/^.*,T([0-9]+)$/.exec(t);return n?Number(parseInt(n[1]))*o.timeUnitMs:0}onGameResult(e,t){if(this.recordManager.appendMove({move:this.gameResultToSpecialMove(e,t)}),this.player){let e;switch(t){case i.j5.WIN:e=d.q.WIN;break;case i.j5.LOSE:e=d.q.LOSE;break;case i.j5.DRAW:case i.j5.CENSORED:case i.j5.CHUDAN:e=d.q.DRAW}this.player.gameover(e)}this.close(S.RELOGIN_IMMEDIATELY)}gameResultToSpecialMove(e,t){const o=this.recordManager.record.position.color;switch(e){case i.kt.RESIGN:return r.SpecialMoveType.RESIGN;case i.kt.SENNICHITE:return r.SpecialMoveType.REPETITION_DRAW;case i.kt.OUTE_SENNICHITE:case i.kt.ILLEGAL_MOVE:case i.kt.ILLEGAL_ACTION:switch(t){case i.j5.WIN:return o===this.gameSummary.myColor?r.SpecialMoveType.FOUL_WIN:r.SpecialMoveType.FOUL_LOSE;case i.j5.LOSE:return o===this.gameSummary.myColor?r.SpecialMoveType.FOUL_LOSE:r.SpecialMoveType.FOUL_WIN}break;case i.kt.TIME_UP:return r.SpecialMoveType.TIMEOUT;case i.kt.JISHOGI:return r.SpecialMoveType.ENTERING_OF_KING;case i.kt.MAX_MOVES:return r.SpecialMoveType.IMPASS}return t===i.j5.DRAW?r.SpecialMoveType.DRAW:r.SpecialMoveType.INTERRUPT}onClose(){this.close(this.settings.autoRelogin?S.RELOGIN_WITH_INTERVAL:S.DO_NOT_RELOGIN)}next(e){this.blackClock.stop(),this.whiteClock.stop(),this.syncClock(e),this.startClock();this.recordManager.record.position.color===this.gameSummary.myColor?this.startSearch(e):this.startPonder()}syncClock(e){const t={onBeepShort:()=>this.onBeepShort(),onBeepUnlimited:()=>this.onBeepUnlimited(),onStopBeep:()=>this.onStopBeep()},o=this.gameSummary.players.black.time;this.blackClock.setup({...t,timeMs:e.black.time*o.timeUnitMs,byoyomi:o.byoyomi*o.timeUnitMs/1e3});const n=this.gameSummary.players.white.time;this.whiteClock.setup({...t,timeMs:e.white.time*n.timeUnitMs,byoyomi:n.byoyomi*n.timeUnitMs/1e3})}startClock(){this.recordManager.record.position.color===r.Color.BLACK?this.blackClock.start():this.whiteClock.start()}startSearch(e){this.player?this.player.startSearch(this.recordManager.record.position,this.recordManager.record.usi,this.buildTimeStates(e),{onMove:this.onPlayerMove.bind(this),onResign:this.onPlayerResign.bind(this),onWin:this.onPlayerWin.bind(this),onError:this.onPlayerError.bind(this)}).catch(e=>{this.onError(new Error(`CSAGameManager#startSearch: ${h.t.failedToSendGoCommand}: ${e}`))}):this.onError("CSAGameManager#startSearch: player is not initialized")}startPonder(){this.player?this.player.startPonder(this.recordManager.record.position,this.recordManager.record.usi,this.buildTimeStates()).catch(e=>{this.onError(new Error(`CSAGameManager#startPonder: ${h.t.failedToSendPonderCommand}: ${e}`))}):this.onError("CSAGameManager#startPonder: player is not initialized")}startEarlyPonder(e){if(!this.player)return void this.onError("CSAGameManager#startEarlyPonder: player is not initialized");const t=this.recordManager.record.position.clone(),o=this.recordManager.record.usi+" "+e.usi;t.doMove(e)?this.player.startPonder(t,o,this.buildTimeStates()).catch(e=>{this.onError(new Error(`CSAGameManager#startEarlyPonder: ${h.t.failedToSendPonderCommand}: ${e}`))}):this.onError("CSAGameManager#startEarlyPonder: failed to make a move")}buildTimeStates(e){const t=this.gameSummary.players.black.time,o=this.gameSummary.players.white.time;return{black:{timeMs:e?e.black.time*t.timeUnitMs:this.blackClock.timeMs,byoyomi:t.byoyomi*t.timeUnitMs/1e3,increment:t.increment*t.timeUnitMs/1e3},white:{timeMs:e?e.white.time*o.timeUnitMs:this.whiteClock.timeMs,byoyomi:o.byoyomi*o.timeUnitMs/1e3,increment:o.increment*o.timeUnitMs/1e3}}}onPlayerMove(e,t){let o,i;switch(this.searchInfo=t,this._settings.server.protocolVersion){case s._B.V121:break;case s._B.V121_FLOODGATE:o=t?.score,t?.pv?.forEach(e=>{i=i?i+" ":"",i+=(0,r.formatCSAMove)(e)})}n.Ay.csaMove(this.sessionID,(0,r.formatCSAMove)(e),o,i),this.settings.player.usi?.enableEarlyPonder&&this.startEarlyPonder(e)}onPlayerResign(){n.Ay.csaResign(this.sessionID)}onPlayerWin(){n.Ay.csaWin(this.sessionID)}onPlayerError(e){this.onError(e)}}const f={};function T(e,t){f[e]?.onGameSummary(t)}function v(e){f[e]?.onReject()}function C(e,t){f[e]?.onStart(t)}function b(e,t,o){f[e]?.onMove(t,o)}function E(e,t,o){f[e]?.onGameResult(t,o)}function P(e){f[e]?.onClose()}},578(e,t,o){o.d(t,{P8:()=>s,OL:()=>r});var n=o(113),i=o(789),a=o(516);function s(e){return e.substring(Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"))+1)}function r(e,t={}){const o=e.metadata,s=function(e){const t=e.getStandardMetadata(n.RecordMetadataKey.START_DATETIME)||e.getStandardMetadata(n.RecordMetadataKey.DATE);if(t)return t.trim().replaceAll(" ","_").replaceAll("/","").replaceAll(":","")}(o)||(0,i.sq)().replaceAll("/",""),r=function(e){return e.getStandardMetadata(n.RecordMetadataKey.TITLE)||e.getStandardMetadata(n.RecordMetadataKey.TOURNAMENT)||e.getStandardMetadata(n.RecordMetadataKey.OPUS_NAME)||e.getStandardMetadata(n.RecordMetadataKey.OPUS_NO)||e.getStandardMetadata(n.RecordMetadataKey.PLACE)||e.getStandardMetadata(n.RecordMetadataKey.POSTED_ON)||e.getStandardMetadata(n.RecordMetadataKey.AUTHOR)}(o),c=(0,n.getBlackPlayerName)(o),l=(0,n.getWhitePlayerName)(o),h=Math.floor(1048576*Math.random()).toString(16).toUpperCase().padStart(5,"0");let d=0;for(let t=e.first.next;t&&t.move instanceof n.Move;t=t.next)d=t.ply;const u={datetime:s,title:r||"",sente:c||"",gote:l||"",ply:d.toString(),hex5:h};for(const e in u){const t=u[e];u["_"+e]=t?"_"+t:"",u[e+"_"]=t?t+"_":""}let m=t.template||a.g;m=(0,a.D)(m);for(const e in u){const t=u[e];m=(0,a.D)(m.replaceAll("{"+e+"}",t))}return m=m.trim(),t.extension?m+=t.extension.startsWith(".")?t.extension:"."+t.extension:m+=".kif",m}},676(e,t,o){o.d(t,{Ay:()=>te});var n=o(591),i=o(389);function a(){return{startCriteria:{enableNumber:!1,number:20},endCriteria:{enableNumber:!1,number:100},perMoveCriteria:{maxSeconds:5},descending:!1,commentBehavior:i.Q.INSERT}}var s,r,c,l,h,d,u,m,p,g,S,y,f,T,v,C,b,E,P,I,A,k,M,N,w,R=o(1),O=o(698),F=o(176),D=o(516),L=o(186);function B(e){return{language:R.TM.JA,thema:h.STANDARD,backgroundImageType:d.NONE,boardLayoutType:s.STANDARD,pieceImage:u.HITOMOJI_WOOD,kingPieceType:m.GYOKU_AND_OSHO,deletePieceImageMargin:!1,boardImage:p.LIGHT2,boardGridColor:null,pieceStandImage:g.DARK_WOOD,promotionSelectorStyle:S.HORIZONTAL,enableTransparent:!1,boardOpacity:1,pieceStandOpacity:1,recordOpacity:1,boardLabelType:y.STANDARD,leftSideControlType:f.STANDARD,rightSideControlType:T.STANDARD,pieceVolume:30,clockVolume:30,clockPitch:500,clockSoundTarget:I.ONLY_USER,recordShortcutKeys:A.VERTICAL,boardFlipping:!1,tabPaneType:v.DOUBLE_V2,tab:C.RECORD_INFO,tab2:C.CHART,topPaneHeightPercentage:60,topPanePreviousHeightPercentage:60,bottomLeftPaneWidthPercentage:60,defaultRecordFileFormat:F.vr.KIF,textDecodingRule:b.AUTO_DETECT,returnCode:e?.returnCode||"\r\n",autoSaveDirectory:e?.autoSaveDirectory||"",recordFileNameTemplate:D.g,useCSAV3:!1,useUTF8ForKifAndKi2:!1,enableUSIFileStartpos:!0,enableUSIFileResign:!1,enableUSIFileSpecialMoves:!1,showPasteDialog:!0,liveDuplicatePositionDetection:!0,bookOnTheFlyThresholdMB:64,flippedBook:!0,translateEngineOptionName:!0,engineTimeoutSeconds:10,nodeCountFormat:E.COMMA_SEPARATED,showEngineOptionDetails:!1,evaluationViewFrom:P.EACH,maxArrowsPerEngine:3,arrowScoreDiffRange:100,showArrowScore:!0,coefficientInSigmoid:600,badMoveLevelThreshold1:5,badMoveLevelThreshold2:10,badMoveLevelThreshold3:20,badMoveLevelThreshold4:50,maxPVTextLength:15,searchCommentFormat:i.F.SHOGIHOME,showElapsedTimeInRecordView:!0,showCommentInRecordView:!0,branchListMode:w.SIBLING,enableAppLog:!1,enableUSILog:!1,enableCSALog:!1,logLevel:O.$.INFO,positionImageStyle:k.BOOK,positionImageSize:500,positionImageTypeface:M.GOTHIC,positionImageHandLabelType:N.PLAYER_NAME,useBookmarkAsPositionImageHeader:!1,positionImageHeader:"",positionImageCharacterY:0,positionImageFontScale:1,positionImageFontWeight:r.W400X,lastRecordFilePath:"",lastBookFilePath:"",lastUSIEngineFilePath:"",lastImageExportFilePath:"",lastOtherFilePath:"",emptyRecordInfoVisibility:!0,enableHardwareAcceleration:!0}}!function(e){e.STANDARD="standard",e.COMPACT="compact",e.PORTRAIT="portrait"}(s||(s={})),function(e){e.W400="400",e.W400X="400+",e.W700X="700+"}(r||(r={})),function(e){e.RAW="raw",e.WIN_RATE="winRate"}(c||(c={})),function(e){e.LEFT="left",e.CENTER="center",e.RIGHT="right"}(l||(l={})),function(e){e.STANDARD="standard",e.CHERRY_BLOSSOM="cherry-blossom",e.AUTUMN="autumn",e.SNOW="snow",e.DARK_GREEN="dark-green",e.DARK="dark"}(h||(h={})),function(e){e.NONE="none",e.COVER="cover",e.CONTAIN="contain",e.TILE="tile"}(d||(d={})),function(e){e.HITOMOJI="hitomoji",e.HITOMOJI_WOOD="hitomojiWood",e.HITOMOJI_DARK="hitomojiDark",e.HITOMOJI_GOTHIC="hitomojiGothic",e.HITOMOJI_GOTHIC_DARK="hitomojiGothicDark",e.CUSTOM_IMAGE="custom-image"}(u||(u={})),function(e){e.GYOKU_AND_OSHO="gyokuAndOsho",e.GYOKU_AND_GYOKU="gyokuAndGyoku"}(m||(m={})),function(e){e.LIGHT="light",e.LIGHT2="light2",e.LIGHT3="light3",e.WARM="warm",e.WARM2="warm2",e.RESIN="resin",e.RESIN2="resin2",e.RESIN3="resin3",e.GREEN="green",e.CHERRY_BLOSSOM="cherry-blossom",e.AUTUMN="autumn",e.SNOW="snow",e.DARK_GREEN="dark-green",e.DARK="dark",e.CUSTOM_IMAGE="custom-image"}(p||(p={})),function(e){e.STANDARD="standard",e.DARK_WOOD="dark-wood",e.GREEN="green",e.CHERRY_BLOSSOM="cherry-blossom",e.AUTUMN="autumn",e.SNOW="snow",e.DARK_GREEN="dark-green",e.DARK="dark",e.CUSTOM_IMAGE="custom-image"}(g||(g={})),function(e){e.HORIZONTAL="horizontal",e.VERTICAL_PREFER_BOTTOM="verticalPreferBottom",e.HORIZONTAL_PREFER_RIGHT="horizontalPreferRight"}(S||(S={})),function(e){e.NONE="none",e.STANDARD="standard"}(y||(y={})),function(e){e.NONE="none",e.STANDARD="standard"}(f||(f={})),function(e){e.NONE="none",e.STANDARD="standard"}(T||(T={})),function(e){e.SINGLE="single",e.DOUBLE="double",e.DOUBLE_V2="doubleV2"}(v||(v={})),function(e){e.RECORD_INFO="recordInfo",e.COMMENT="comment",e.SEARCH="search",e.PV="pv",e.CHART="chart",e.PERCENTAGE_CHART="percentageChart",e.MONITOR="monitor",e.INVISIBLE="invisible"}(C||(C={})),function(e){e.STRICT="strict",e.AUTO_DETECT="autoDetect"}(b||(b={})),function(e){e.PLAIN="plain",e.COMMA_SEPARATED="commaSeparated",e.COMPACT="compact",e.JAPANESE="japanese"}(E||(E={})),function(e){e.BLACK="black",e.EACH="each"}(P||(P={})),function(e){e.ALL="all",e.ONLY_USER="onlyUser"}(I||(I={})),function(e){e.VERTICAL="vertical",e.HORIZONTAL="horizontal"}(A||(A={})),function(e){e.BOOK="book",e.GAME="game"}(k||(k={})),function(e){e.GOTHIC="gothic",e.MINCHO="mincho"}(M||(M={})),function(e){e.PLAYER_NAME="playerName",e.SENTE_GOTE="senteGote",e.MOCHIGOMA="mochigoma",e.TSUME_SHOGI="tsumeShogi",e.NONE="none"}(N||(N={})),function(e){e.SIBLING="sibling",e.NEXT_MOVE="nextMove"}(w||(w={}));var U,_=o(113),G=o(347),H=o(211);!function(e){e.NONE="none",e.GENERAL24="general24",e.GENERAL27="general27",e.TRY="try"}(U||(U={}));U.GENERAL24,U.GENERAL27;function W(e){return{black:(0,G.w)(),white:(0,G.w)(),timeLimit:{timeSeconds:0,byoyomi:30,increment:0},startPosition:_.InitialPositionType.STANDARD,startPositionSFEN:"",startPositionListFile:"",startPositionListOrder:"sequential",enableEngineTimeout:!1,humanIsFront:!0,enableComment:!0,enableAutoSave:!!e?.autoSaveDirectory,autoSaveDirectory:(0,H.w)(e?.autoSaveDirectory||""),repeat:1,parallelism:1,swapPlayers:!1,maxMoves:1e3,jishogiRule:U.GENERAL27,searchCommentFormat:i.F.SHOGIHOME,sprtEnabled:!1,sprt:{elo0:.5,elo1:2.5,alpha:.05,beta:.05,maxGames:1e5}}}var x,K,$,V,Y=o(265);function J(){return{sourceType:x.DIRECTORY,source:"",sourceFormats:[F.vr.KIF,F.vr.KIFU,F.vr.KI2,F.vr.KI2U,F.vr.CSA,F.vr.JKF],subdirectories:!0,singleFileSource:"",destinationType:K.DIRECTORY,destination:"",createSubdirectories:!0,destinationFormat:F.vr.KIF,fileNameConflictAction:$.NUMBER_SUFFIX,singleFileDestination:"",enableUSIResign:!0}}!function(e){e.DIRECTORY="directory",e.SINGLE_FILE="singleFile"}(x||(x={})),function(e){e.DIRECTORY="directory",e.SINGLE_FILE="singleFile"}(K||(K={})),function(e){e.OVERWRITE="overwrite",e.NUMBER_SUFFIX="numberSuffix",e.SKIP="skip"}($||($={})),function(e){e.USER="user",e.BACKUP="backup",e.BACKUP_V2="backupV2"}(V||(V={}));var q,j=o(578);!function(e){e.APP_SETTINGS="appSetting",e.RESEARCH_SETTINGS="researchSetting",e.BATCH_CONVERSION_SETTINGS="batchConversionSetting",e.ANALYSIS_SETTINGS="analysisSetting",e.GAME_SETTINGS="gameSetting",e.MATE_SEARCH_SETTINGS="mateSearchSetting",e.CSA_GAME_SETTINGS_HISTORY="csaGameSettingHistory"}(q||(q={}));const z=new Map,X={updateAppState(){},fetchProcessArgs:async()=>JSON.stringify({}),onClosable(){},onClose(){},onSendError(){},onSendMessage(){},onMenuEvent(){},async loadAppSettings(){const e=localStorage.getItem(q.APP_SETTINGS);return e?JSON.stringify({...B(),...JSON.parse(e)}):JSON.stringify(B())},async saveAppSettings(e){localStorage.setItem(q.APP_SETTINGS,e)},async loadBatchConversionSettings(){const e=localStorage.getItem(q.BATCH_CONVERSION_SETTINGS);return e?JSON.stringify({...J(),...JSON.parse(e)}):JSON.stringify(J())},async saveBatchConversionSettings(e){localStorage.setItem(q.BATCH_CONVERSION_SETTINGS,e)},async loadResearchSettings(){const e=localStorage.getItem(q.RESEARCH_SETTINGS);return e?JSON.stringify({enableMaxSeconds:!1,maxSeconds:10,overrideMultiPV:!1,multiPV:1,...JSON.parse(e)}):JSON.stringify({enableMaxSeconds:!1,maxSeconds:10,overrideMultiPV:!1,multiPV:1})},async saveResearchSettings(e){localStorage.setItem(q.RESEARCH_SETTINGS,e)},async loadAnalysisSettings(){const e=localStorage.getItem(q.ANALYSIS_SETTINGS);return e?JSON.stringify({...a(),...JSON.parse(e)}):JSON.stringify(a())},async saveAnalysisSettings(e){localStorage.setItem(q.ANALYSIS_SETTINGS,e)},async loadGameSettings(){const e=localStorage.getItem(q.GAME_SETTINGS);return e?JSON.stringify({...W(),...JSON.parse(e)}):JSON.stringify({...W(),enableAutoSave:!1})},async saveGameSettings(e){localStorage.setItem(q.GAME_SETTINGS,e)},async loadCSAGameSettingsHistory(){const e=localStorage.getItem(q.CSA_GAME_SETTINGS_HISTORY);return e?JSON.stringify({...(0,Y.uU)(),...JSON.parse(e)}):JSON.stringify((0,Y.uU)())},async saveCSAGameSettingsHistory(e){localStorage.setItem(q.CSA_GAME_SETTINGS_HISTORY,e)},async loadMateSearchSettings(){const e=localStorage.getItem(q.MATE_SEARCH_SETTINGS);return e?JSON.stringify({enableMaxSeconds:!1,maxSeconds:10,...JSON.parse(e)}):JSON.stringify({enableMaxSeconds:!1,maxSeconds:10})},async saveMateSearchSettings(e){localStorage.setItem(q.MATE_SEARCH_SETTINGS,e)},loadUSIEngines:async()=>(new n.z4).json,async saveUSIEngines(){},async loadBookImportSettings(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async saveBookImportSettings(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},onUpdateAppSettings(){},async showOpenRecordDialog(e){const t=document.createElement("input");return t.setAttribute("type","file"),t.setAttribute("accept",e.join(",")),new Promise((e,o)=>{t.click(),t.onchange=()=>{const n=t.files?.[0];n?n.arrayBuffer().then(t=>{const o=L.m7(n.name);z.clear(),z.set(o,t),e(o)}).catch(e=>{o(e)}):o(new Error("invalid file"))},t.oncancel=()=>{e("")}})},showSaveRecordDialog:async e=>e,async showSaveMergedRecordDialog(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async openRecord(e){const t=z.get(e);return t?new Uint8Array(t):Promise.reject(new Error("invalid URI"))},async saveRecord(e,t){const o=new Blob([new Uint8Array(t)],{type:"application/octet-stream"}),n=URL.createObjectURL(o),i=document.createElement("a");i.href=n,i.download=(0,j.P8)(e),i.click(),URL.revokeObjectURL(n)},loadRecordFileHistory:async()=>JSON.stringify({entries:[]}),addRecordFileHistory(){},async clearRecordFileHistory(){},async saveRecordFileBackup(){},async loadRecordFileBackup(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async loadRemoteTextFile(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async convertRecordFiles(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async showSelectSFENDialog(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async loadSFENFile(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},onOpenRecord(){},async showOpenBookDialog(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async showSaveBookDialog(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async clearBook(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async openBook(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async openBookAsNewSession(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async closeBookSession(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async saveBook(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},searchBookMoves:async()=>"[]",async updateBookMove(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async removeBookMove(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async updateBookMoveOrder(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async importBookMoves(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async showSelectUSIEngineDialog(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async getUSIEngineInfo(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async getUSIEngineMetadata(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async sendUSIOptionButtonSignal(){},async usiLaunch(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async usiReady(){},async usiSetOption(){},async usiGo(){},async usiGoPonder(){},async usiPonderHit(){},async usiGoInfinite(){},async usiGoMate(){},async usiStop(){},async usiGameover(){},async usiQuit(){},onUSIBestMove(){},onUSICheckmate(){},onUSICheckmateNotImplemented(){},onUSICheckmateTimeout(){},onUSINoMate(){},onUSIInfo(){},async csaLogin(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async csaLogout(){},async csaAgree(){},async csaMove(){},async csaResign(){},async csaWin(){},async csaStop(){},onCSAGameSummary(){},onCSAReject(){},onCSAStart(){},onCSAMove(){},onCSAGameResult(){},onCSAClose(){},collectSessionStates:async()=>JSON.stringify({os:{version:"-",arch:"-",cpuTotalTime:0,cpuIdleTime:0,memoryTotal:0,memoryFree:0},usiSessions:[],csaSessions:[]}),async setupPrompt(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async openPrompt(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},invokePromptCommand(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},onPromptCommand(){},async showSelectImageDialog(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async cropPieceImage(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async exportCaptureAsPNG(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async exportCaptureAsJPEG(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},loadLayoutProfileList:async()=>[L.KY,JSON.stringify({profiles:[]})],updateLayoutProfileList(){},onUpdateLayoutProfile(){},createDesktopShortcutForLayoutProfile(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},openLogFile(){},log(e,t){switch(e){case O.$.DEBUG:console.debug(t);break;case O.$.INFO:console.log(t);break;case O.$.WARN:console.warn(t);break;case O.$.ERROR:console.error(t)}},async showSelectFileDialog(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async showSelectDirectoryDialog(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},openExplorer(){},openWebBrowser(e){window.open(e,"_blank")},getMachineSpec:async()=>JSON.stringify({cpuCores:1,memory:1048576}),isEncryptionAvailable:async()=>!1,getVersionStatus:async()=>JSON.stringify({}),sendTestNotification(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},getPathForFile:e=>e.name,onProgress(){}};function Q(){return window}Q().electronShogi;const Z=Q().electronShogiAPI||X,ee={...Z,fetchProcessArgs:async()=>JSON.parse(await Z.fetchProcessArgs()),loadAppSettings:async()=>JSON.parse(await Z.loadAppSettings()),saveAppSettings:e=>Z.saveAppSettings(JSON.stringify(e)),loadBatchConversionSettings:async()=>JSON.parse(await Z.loadBatchConversionSettings()),saveBatchConversionSettings:e=>Z.saveBatchConversionSettings(JSON.stringify(e)),loadResearchSettings:async()=>JSON.parse(await Z.loadResearchSettings()),saveResearchSettings:e=>Z.saveResearchSettings(JSON.stringify(e)),loadAnalysisSettings:async()=>JSON.parse(await Z.loadAnalysisSettings()),saveAnalysisSettings:e=>Z.saveAnalysisSettings(JSON.stringify(e)),loadGameSettings:async()=>JSON.parse(await Z.loadGameSettings()),saveGameSettings:e=>Z.saveGameSettings(JSON.stringify(e)),loadCSAGameSettingsHistory:async()=>JSON.parse(await Z.loadCSAGameSettingsHistory()),saveCSAGameSettingsHistory:e=>Z.saveCSAGameSettingsHistory(JSON.stringify(e)),loadMateSearchSettings:async()=>JSON.parse(await Z.loadMateSearchSettings()),saveMateSearchSettings:e=>Z.saveMateSearchSettings(JSON.stringify(e)),loadRecordFileHistory:async()=>JSON.parse(await Z.loadRecordFileHistory()),loadUSIEngines:async()=>new n.z4(await Z.loadUSIEngines()),saveUSIEngines:e=>Z.saveUSIEngines(e.json),loadBookImportSettings:async()=>JSON.parse(await Z.loadBookImportSettings()),saveBookImportSettings:e=>Z.saveBookImportSettings(JSON.stringify(e)),convertRecordFiles:async e=>JSON.parse(await Z.convertRecordFiles(JSON.stringify(e))),openBook:(e,t,o)=>Z.openBook(e,t,JSON.stringify(o)),openBookAsNewSession:async(e,t)=>await Z.openBookAsNewSession(e,JSON.stringify(t)),searchBookMoves:async(e,t)=>JSON.parse(await Z.searchBookMoves(e,t)),updateBookMove:(e,t,o)=>Z.updateBookMove(e,t,JSON.stringify(o)),importBookMoves:async(e,t)=>JSON.parse(await Z.importBookMoves(e,JSON.stringify(t))),async getUSIEngineInfo(e,t){const o=await Z.getUSIEngineInfo(e,t);return JSON.parse(o)},async getUSIEngineMetadata(e){const t=await Z.getUSIEngineMetadata(e);return JSON.parse(t)},usiLaunch:(e,t)=>Z.usiLaunch(JSON.stringify(e),JSON.stringify(t||{})),usiReady:e=>Z.usiReady(e),usiGo:(e,t,o)=>Z.usiGo(e,t,JSON.stringify(o)),usiGoPonder:(e,t,o)=>Z.usiGoPonder(e,t,JSON.stringify(o)),usiPonderHit:(e,t)=>Z.usiPonderHit(e,JSON.stringify(t)),csaLogin:e=>Z.csaLogin(JSON.stringify(e)),collectSessionStates:async()=>JSON.parse(await Z.collectSessionStates()),setupPrompt:async(e,t)=>JSON.parse(await Z.setupPrompt(e,t)),exportCaptureAsPNG:e=>Z.exportCaptureAsPNG(e.json),exportCaptureAsJPEG:e=>Z.exportCaptureAsJPEG(e.json),async loadLayoutProfileList(){const[e,t]=await Z.loadLayoutProfileList();return[e,JSON.parse(t)]},updateLayoutProfileList(e,t){Z.updateLayoutProfileList(e,JSON.stringify(t))},getMachineSpec:async()=>JSON.parse(await Z.getMachineSpec()),getVersionStatus:async()=>JSON.parse(await Z.getVersionStatus())},te=ee},154(e,t,o){o.d(t,{c:()=>d});const n=new class{searchHandler;isEngine(){return!1}async readyNewGame(){}async startSearch(e,t,o,n){this.searchHandler=n}async startPonder(){}async startMateSearch(){}async stop(){}async gameover(){}async close(){this.searchHandler=void 0}doMove(e){const t=this.searchHandler;this.searchHandler=void 0,t?.onMove(e)}resign(){const e=this.searchHandler;this.searchHandler=void 0,e?.onResign()}win(){const e=this.searchHandler;this.searchHandler=void 0,e?.onWin()}};var i=o(128),a=o(113),s=o(186);const r={[a.PieceType.PAWN]:100,[a.PieceType.LANCE]:300,[a.PieceType.KNIGHT]:400,[a.PieceType.SILVER]:500,[a.PieceType.GOLD]:600,[a.PieceType.BISHOP]:700,[a.PieceType.ROOK]:800,[a.PieceType.KING]:0,[a.PieceType.PROM_PAWN]:400,[a.PieceType.PROM_LANCE]:500,[a.PieceType.PROM_KNIGHT]:500,[a.PieceType.PROM_SILVER]:600,[a.PieceType.HORSE]:1200,[a.PieceType.DRAGON]:1500};class c{uri;timer;constructor(e){this.uri=e}isEngine(){return!0}async readyNewGame(){}async startSearch(e,t,o,n){this.timer=setTimeout(()=>{let o=null;if(this.uri===s.DI)o=this.searchRandom(e);else{const n=a.Record.newByUSI(t);if(n instanceof a.Record){const t=e=>n.getRepetitionCount(e)>=1;o=this.search(this.uri,e.clone(),2,t)[0]}}null===o?n.onResign():n.onMove(o)},500)}async startPonder(){}async startMateSearch(){}async stop(){clearTimeout(this.timer)}async gameover(){}async close(){clearTimeout(this.timer)}searchRandom(e){const t=l(e);for(let o=t.length;o>0;o--){const n=Math.floor(Math.random()*o),i=t[n];if(e.isValidMove(i))return i;t[n]=t[o-1]}return null}search(e,t,o,n){const i=l(t);let a=null,s=-1/0;for(const r of i){let i=new h(e,t,r).evaluate();t.doMove(r)&&(i-=n&&n(t)?1e3:o>1?this.search(e,t,o-1)[1]:this.see(t,r.to),t.undoMove(r),i+=10*Math.random(),i>s&&(s=i,a=r))}return a?[a,s]:[null,0]}see(e,t){const o=[],n=[e.board.at(t).type];for(const i of e.listAttackers(t)){const t=e.board.at(i);t.color===e.color?o.push(t.type):n.push(t.type)}return o.sort((e,t)=>r[e]-r[t]),n.sort((e,t)=>r[e]-r[t]),this.seeSearch(0,o,0,n,0)}seeSearch(e,t,o,n,i){if(o>=t.length)return 0;let s=e+r[n[i]]+r[(0,a.unpromotedPieceType)(n[i])];return s<=0?0:(s-=this.seeSearch(-s,n,i+1,t,o),Math.max(s,0))}}function l(e){const t=[];function o(o,n,i){const s=e.board.at(n);if(s?.color===e.color)return;const r=new a.Move(o,n,!1,e.color,i,s?.type||null);(0,a.isPromotable)(i)&&((0,a.isPromotableRank)(e.color,o.rank)||(0,a.isPromotableRank)(e.color,n.rank))&&(t.push(r.withPromote()),i!==a.PieceType.KNIGHT&&i!==a.PieceType.SILVER)||t.push(r)}for(const t of e.board.listNonEmptySquares()){const n=e.board.at(t);if(n.color!==e.color)continue;const i=(0,a.movableDirections)(n);for(const s of i){switch((0,a.resolveMoveType)(n,s)){case a.MoveType.SHORT:{const e=t.neighbor(s);e.valid&&o(t,e,n.type);break}case a.MoveType.LONG:for(let i=t.neighbor(s);i.valid&&(o(t,i,n.type),!e.board.at(i));i=i.neighbor(s));}}}for(const o of a.handPieceTypes)if(e.hand(e.color).count(o))for(const n of a.Square.all)if(!e.board.at(n)){const i=new a.Move(o,n,!1,e.color,o,null);t.push(i)}return t}class h{playerURI;position;move;drop;from;to;whiteHand;constructor(e,t,o){this.playerURI=e,this.position=t,this.move=o,o.from instanceof a.Square?(this.drop=!1,this.from=t.color===a.Color.BLACK?o.from:o.from.opposite):this.drop=!0,this.to=t.color===a.Color.BLACK?o.to:o.to.opposite,this.whiteHand=this.position.color===a.Color.BLACK?this.position.whiteHand:this.position.blackHand}isTo(e,t){return this.to.equals(new a.Square(e,t))}at(e,t){let o=e instanceof a.Square?e:new a.Square(e,t);return this.position.color===a.Color.WHITE&&(o=o.opposite),this.position.board.at(o)}evaluate(){let e=0;if(this.move.capturedPieceType){const t=this.move.capturedPieceType;e+=r[t]+r[(0,a.unpromotedPieceType)(t)]}if(this.move.promote){const t=this.move.pieceType;e+=r[(0,a.promotedPieceType)(t)]-r[t]}switch(this.move.pieceType){case a.PieceType.PAWN:4===this.to.rank?e+=this.drop?10:20:this.drop||1!==this.to.file&&9!==this.to.file?!this.drop&&this.isTo(3,6)&&this.at(4,6)?e+=30:!this.drop&&this.isTo(5,6)&&this.at(4,6)?.type===a.PieceType.BISHOP&&(e+=50):e+=10;break;case a.PieceType.SILVER:this.from&&this.to.rank<this.from.rank&&this.to.rank>=7&&this.to.file>=2&&this.to.file<=8&&(e+=20);break;case a.PieceType.BISHOP:this.drop&&this.to.rank>=4&&(this.to.file+this.to.rank)%2!=0?e-=200:1===this.to.file||9===this.to.file?e-=500:this.drop&&1===this.to.rank?e-=50:!this.isTo(4,6)||this.at(5,5)||this.at(6,4)||this.at(7,3)||(e+=100);break;case a.PieceType.ROOK:7===this.to.rank&&(e-=20)}if(!this.from||this.move.pieceType!==a.PieceType.PAWN&&this.move.pieceType!==a.PieceType.SILVER&&this.move.pieceType!==a.PieceType.GOLD&&this.move.pieceType!==a.PieceType.PROM_PAWN&&this.move.pieceType!==a.PieceType.PROM_LANCE&&this.move.pieceType!==a.PieceType.PROM_KNIGHT&&this.move.pieceType!==a.PieceType.PROM_SILVER||(this.to.rank<this.from.rank?e+=this.to.rank-3:this.to.rank>this.from.rank&&(e+=3-this.to.rank)),this.to.rank<=4&&this.drop)switch(this.move.pieceType){case a.PieceType.PAWN:e+=3*this.to.rank;break;case a.PieceType.LANCE:case a.PieceType.KNIGHT:e+=2*this.to.rank;break;case a.PieceType.SILVER:case a.PieceType.GOLD:e+=this.to.rank+40-40;break;case a.PieceType.BISHOP:e-=100;break;case a.PieceType.ROOK:e+=500}switch(this.playerURI){case s.ke:e+=this.evaluateStaticRook();break;case s.y3:e+=this.evaluateRangingRook()}return e}evaluateStaticRook(){let e=0;switch(this.move.pieceType){case a.PieceType.PAWN:this.drop?this.isTo(8,7)?e+=200:this.isTo(8,8)&&(e+=50):this.isTo(2,6)||this.isTo(2,5)?e+=50:this.isTo(7,6)?e+=100:this.isTo(6,6)?e+=20:this.drop||3!==this.to.file||(e+=20);break;case a.PieceType.LANCE:case a.PieceType.KNIGHT:e-=50;break;case a.PieceType.SILVER:this.from&&this.from.rank>this.to.rank&&(this.isTo(8,8)||this.isTo(7,7)?e+=100:this.isTo(6,8)||this.isTo(6,7)||this.isTo(3,8)||this.isTo(3,7)||this.isTo(3,5)||this.isTo(4,6)?e+=20:(this.isTo(2,7)||this.isTo(2,6))&&(e+=10));break;case a.PieceType.GOLD:this.drop||(this.isTo(7,8)?e+=80:this.isTo(5,8)?e+=20:this.isTo(6,7)&&this.from&&this.from.file<=6&&(e+=30));break;case a.PieceType.BISHOP:this.at(this.to)?.type===a.PieceType.BISHOP&&(e+=200);break;case a.PieceType.KING:6===this.to.file&&this.from&&5===this.from.file?e+=30:7===this.to.file&&this.from&&6===this.from.file?e+=100:this.to.file<=4&&(e-=1e3)}return e}evaluateRangingRook(){let e=0;switch(this.move.pieceType){case a.PieceType.PAWN:this.drop?this.isTo(8,7)?e+=200:this.isTo(8,8)&&(e+=50):this.isTo(7,6)?e+=100:this.isTo(6,6)&&0===this.whiteHand.count(a.PieceType.BISHOP)?e+=90:this.isTo(6,5)&&this.at(7,8)?(e+=20,this.at(7,5)&&(e+=200)):this.isTo(7,5)?e-=150:1===this.to.file?(e+=40,this.at(1,4)&&(e+=50)):9===this.to.file&&this.at(9,4)&&(e+=50);break;case a.PieceType.LANCE:case a.PieceType.KNIGHT:e-=50;break;case a.PieceType.SILVER:this.from instanceof a.Square&&this.from.rank>this.to.rank&&this.at(7,6)&&(this.isTo(7,8)?e+=40:this.isTo(6,7)?e+=30:this.isTo(5,6)?e+=10:this.isTo(6,5)?e+=this.at(6,6)?.type===a.PieceType.PAWN?-10:20:(this.isTo(4,5)||this.isTo(3,8))&&(e+=10));break;case a.PieceType.GOLD:!this.drop&&this.isTo(7,8)&&(e+=20);break;case a.PieceType.BISHOP:!this.drop&&this.isTo(7,7)&&(e+=70,this.at(8,5)&&(e+=50));break;case a.PieceType.ROOK:!this.drop&&this.isTo(6,8)&&(e+=80);break;case a.PieceType.KING:this.to.file>=5?e-=1e3:this.from&&this.from.file>this.to.file&&this.to.file>=2&&(e+=60+5*(4-this.to.file))}return e}}function d(e){return{async build(t,o){if(t.uri===s.He)return n;if(s.b0(t.uri))return new c(t.uri);if(s.Em(t.uri)&&t.usi){const n=new i.USIPlayer(t.usi,e,o);return await n.launch(),n}throw new Error("defaultPlayerBuilder#build: 予期せぬプレイヤーURIです: "+t.uri)}}}},128(e,t,o){o.r(t),o.d(t,{USIPlayer:()=>u,isActiveUSIPlayerSession:()=>v,onUSIBestMove:()=>p,onUSICheckmate:()=>g,onUSICheckmateNotImplemented:()=>S,onUSICheckmateTimeout:()=>y,onUSIInfo:()=>T,onUSINoMate:()=>f,setOnStartSearchHandler:()=>h,setOnUpdateUSIInfoHandler:()=>d});var n=o(676),i=o(408),a=o(591),s=o(113),r=o(698);let c=()=>{},l=()=>{};function h(e){c=e}function d(e){l=e}class u{engine;launchOptions;onSearchInfo;_sessionID=0;usi;position;searchHandler;mateHandler;ponder;ponderMove;info;usiInfoTimeout;customMultiPV;bookSessionID;constructor(e,t,o){this.engine=e,this.launchOptions=t,this.onSearchInfo=o}get name(){return this.engine.name}get sessionID(){return this._sessionID}async launch(){try{this.engine.extraBook?.enabled&&this.engine.extraBook.filePath&&(this.bookSessionID=await n.Ay.openBookAsNewSession(this.engine.extraBook.filePath,{forceOnTheFly:this.engine.extraBook.onTheFly})),this._sessionID=await n.Ay.usiLaunch(this.engine,this.launchOptions),m[this.sessionID]=this}catch(e){throw this.bookSessionID&&await n.Ay.closeBookSession(this.bookSessionID),e}}isEngine(){return!0}async readyNewGame(){await n.Ay.usiReady(this.sessionID)}async startSearch(e,t,o,i){this.clearHandlers(),this.searchHandler=i,this.usi=t,this.position=e.clone(),await this.searchBook()||(this.ponderMove&&this.ponder===this.usi?n.Ay.usiPonderHit(this.sessionID,o):(this.info=void 0,await n.Ay.usiGo(this.sessionID,this.usi,o),c(this.sessionID,this.position)),this.ponderMove=void 0,this.ponder=void 0)}async startPonder(e,t,o){if(!(0,a.my)(this.engine))return;if(this.ponderMove)return;const i=t;if(!this.ponder||!this.ponder.startsWith(i))return;const s=e.createMoveByUSI(this.ponder.slice(i.length+1));s&&e.isValidMove(s)&&(this.clearHandlers(),this.usi=this.ponder,this.position=e.clone(),this.stochasticPonder||this.position.doMove(s),this.info=void 0,this.ponderMove=s,await n.Ay.usiGoPonder(this.sessionID,this.ponder,o),c(this.sessionID,this.position))}async startMateSearch(e,t,o,i){this.clearHandlers(),this.usi=t,this.info=void 0,this.position=e.clone(),this.mateHandler=i,await n.Ay.usiGoMate(this.sessionID,this.usi,o),c(this.sessionID,this.position)}async startResearch(e,t){this.clearHandlers(),this.usi=t,this.info=void 0,this.position=e.clone(),await this.searchBook()||(await n.Ay.usiGoInfinite(this.sessionID,t),c(this.sessionID,this.position))}async searchBook(){if(!this.bookSessionID||!this.position)return!1;try{const e=await n.Ay.searchBookMoves(this.bookSessionID,this.position.sfen);if(0===e.length)return!1;if(this.ponderMove&&(await n.Ay.usiStop(this.sessionID),this.ponderMove=void 0,this.ponder=void 0),c(this.sessionID,this.position),l&&this.usi)for(let t=0;t<e.length;t++){const o=e[t];if(this.position.createMoveByUSI(o.usi)){const e={multipv:t+1,depth:o.depth,scoreCP:o.score,nodes:o.count,currmove:o.usi,pv:o.usi2?[o.usi,o.usi2]:[o.usi]};l(this.sessionID,this.position,this.name,e)}}const t=this.searchHandler;if(this.clearHandlers(),t){const o=e[0],i=this.position.createMoveByUSI(o.usi);if(!i)return n.Ay.log(r.$.ERROR,`Failed to search book moves: invalid move from book: ${o.usi}`),!1;t.onMove(i)}return!0}catch(e){return n.Ay.log(r.$.ERROR,`Failed to search book moves: ${e}`),!1}}async stop(){await n.Ay.usiStop(this.sessionID)}async gameover(e){await n.Ay.usiGameover(this.sessionID,e)}async close(){this.clearHandlers(),await n.Ay.usiQuit(this.sessionID),delete m[this.sessionID],this.bookSessionID&&await n.Ay.closeBookSession(this.bookSessionID)}clearHandlers(){this.searchHandler=void 0,this.mateHandler=void 0}onBestMove(e,t,o){const n=this.searchHandler;if(this.clearHandlers(),!n||!this.position)return;if(e!==this.usi)return;if("resign"===t)return void n.onResign();if("win"===t)return void n.onWin();const i=this.position.createMoveByUSI(t);if(!i)return n.onError("エンジンから不明な指し手を受信しました:"+t),void n.onResign();const a=e.indexOf(" moves ")>0;if(this.ponder=o&&`${e}${a?"":" moves"} ${t} ${o}`,this.flushUSIInfo(),this.info?.pv&&this.info.pv.length>=1&&this.info.pv[0].equals(i)){const e={...this.info,pv:this.info.pv.slice(1)};n.onMove(i,e)}else n.onMove(i)}onCheckmate(e,t){if(e!==this.usi||!this.position)return;l(this.sessionID,this.position,this.name,{pv:t});const o=this.mateHandler;if(this.clearHandlers(),!o)return;const n=this.position,i=[];for(const e of t){const t=n.createMoveByUSI(e);if(!t)return void o.onError("エンジンから不明な指し手を受信しました:"+e);if(i.push(t),!n.doMove(t))return void o.onError("エンジンから無効な指し手を受信しました:"+e)}o.onCheckmate(i)}onCheckmateNotImplemented(){const e=this.mateHandler;this.clearHandlers(),e?.onNotImplemented()}onCheckmateTimeout(e){if(e!==this.usi||!this.position)return;const t=this.mateHandler;this.clearHandlers(),t?.onTimeout()}onNoMate(e){if(e!==this.usi||!this.position)return;const t=this.mateHandler;this.clearHandlers(),t?.onNoMate()}onUSIInfo(e,t){if(e!==this.usi||!this.position)return;if(l(this.sessionID,this.position,this.name,t,this.ponderMove),t.multipv&&1!==t.multipv)return;const o=this.position.color===s.Color.BLACK?1:-1,n=t.pv&&t.pv.length>=1?t.pv:t.currmove?[t.currmove]:void 0;this.info={usi:e,depth:t.depth??this.info?.depth,nodes:t.nodes??this.info?.nodes,score:(t.scoreCP&&t.scoreCP*o)??this.info?.score,mate:(t.scoreMate&&t.scoreMate*o)??this.info?.mate,pv:(n&&(0,i.X)(this.position,n))??this.info?.pv},this.ponderMove||this.usiInfoTimeout||(this.usiInfoTimeout=window.setTimeout(()=>{this.flushUSIInfo()},500))}flushUSIInfo(){this.usiInfoTimeout&&(clearTimeout(this.usiInfoTimeout),this.usiInfoTimeout=void 0),this.info&&this.onSearchInfo?.(this.info)}get multiPV(){return this.customMultiPV||(0,a.Lo)(this.engine)}async setMultiPV(e){const t=this.engine.options[a.Br]||this.engine.options[a.aW];if(!t||"spin"!==t.type)throw new Error("The engine does not support MultiPV option.");if(t.min&&e<t.min||t.max&&e>t.max)throw new Error("The MultiPV value is out of range.");await n.Ay.usiSetOption(this.sessionID,t.name,e.toFixed(0)),this.customMultiPV=e}get stochasticPonder(){return(0,a.pk)(this.engine)}}const m={};function p(e,t,o,n){m[e]?.onBestMove(t,o,n)}function g(e,t,o){m[e]?.onCheckmate(t,o)}function S(e){m[e]?.onCheckmateNotImplemented()}function y(e,t){m[e]?.onCheckmateTimeout(t)}function f(e,t){m[e]?.onNoMate(t)}function T(e,t,o){m[e]?.onUSIInfo(t,o)}function v(e){return!!m[e]}},518(e,t,o){o.d(t,{B:()=>A,K:()=>a});var n=o(789),i=o(113);var a,s=o(389),r=o(1),c=o(176),l=o(408),h=o(676),d=o(698);function u(e){const t=/^\*詰み=(先手勝ち|後手勝ち)(?::([0-9]+)手)?/.exec(e);if(t)return Number(t[2]||l.m)*("先手勝ち"===t[1]?1:-1)}function m(e){const t=/^#詰み=(先手勝ち|後手勝ち)(?::([0-9]+)手)?/.exec(e);if(t)return Number(t[2]||l.m)*("先手勝ち"===t[1]?1:-1)}function p(e){const t=/^\*評価値=([+-]?[.0-9]+)/.exec(e);return t?Number(t[1]):void 0}function g(e){const t=/^#評価値=([+-]?[.0-9]+)/.exec(e);return t?Number(t[1]):void 0}function S(e){const t=/^\* *([+-]?[.0-9]+)/.exec(e);return t?Number(t[1]):void 0}function y(e){const t=/^\*対局 .* 評価値 ([+-]?[0-9]+)/.exec(e);return t?Number(t[1]):void 0}function f(e){const t=/^\*解析 .* 評価値 ([+-]?[0-9]+)/.exec(e);return t?Number(t[1]):void 0}function T(e){const t=/^\* .* 評価値 ([+-]?[0-9]+)/.exec(e);return t?Number(t[1]):void 0}function v(e){const t=/^#(?:形勢|指し手)\[([+-]?[0-9]+)\]/.exec(e);return t?Number(t[1]):void 0}function C(e){e.forEach(e=>{const t=e.customData||{},o=e.comment.split("\n");for(const e of o){const o=u(e);void 0!==o&&(t.playerSearchInfo={...t.playerSearchInfo,mate:o});const n=m(e);void 0!==n&&(t.researchInfo={...t.researchInfo,mate:n});const i=p(e)??S(e)??y(e);void 0!==i&&(t.playerSearchInfo={...t.playerSearchInfo,score:i});const a=g(e)??f(e)??T(e)??v(e);void 0!==a&&(t.researchInfo={...t.researchInfo,score:a})}e.customData=t})}function b(e){let t=`* ${void 0!==e.mate?e.mate>0?3e4:-3e4:void 0!==e.score?e.score:0}`;for(const o of e.pv||[])t+=" "+(0,i.formatCSAMove)(o);return t}function E(e,t){const o=t.indexOf(" ",t.indexOf(" ")+1)+1,n=[],a=e.clone();for(let e=o;e<t.length;e+=8){const o=t.substring(e,e+7),s=(0,i.parseCSAMove)(a,o);if(s instanceof Error||!a.doMove(s,{ignoreValidation:!1}))break;n.push(s)}return n}function P(e){return e.timeSeconds+"+"+e.byoyomi+"+"+e.increment}function I(e){return function(e){const t=Math.floor(e/60),o=e%60;return String(t).padStart(2,"0")+":"+String(o).padStart(2,"0")}(e.timeSeconds)+"+"+String(e.byoyomi).padStart(2,"0")}!function(e){e[e.PLAYER=0]="PLAYER",e[e.OPPONENT=1]="OPPONENT",e[e.RESEARCHER=2]="RESEARCHER",e[e.RESEARCHER_2=3]="RESEARCHER_2",e[e.RESEARCHER_3=4]="RESEARCHER_3",e[e.RESEARCHER_4=5]="RESEARCHER_4"}(a||(a={}));class A{_record;_recordFilePath;_unsaved=!1;_sourceURL;_positionCounts=new Map;changePositionHandler=null;updateTreeHandler=null;updateCommentHandler=null;updateBookmarkHandler=null;updateCustomDataHandler=null;backupHandler=null;constructor(e=new i.Record){this._record=e,this.resetPositionCounts(),this.bindRecordHandlers()}get record(){return this._record}get recordFilePath(){return this._recordFilePath}get unsaved(){return this._unsaved}get sourceURL(){return this._sourceURL}get positionCounts(){return this._positionCounts}updateRecordFilePath(e){this._unsaved=!1,e!==this._recordFilePath&&(this._recordFilePath=e,e&&h.Ay.addRecordFileHistory(e))}async saveBackup(){if(!this.unsaved)return;const e=this.onBackup(),t=(0,i.exportKIF)(this.record,e||{});await h.Ay.saveRecordFileBackup(t)}saveBackupOnBackground(){this.saveBackup().catch(e=>{h.Ay.log(d.$.ERROR,`RecordManager#saveBackupOnBackground: failed to save backup: ${e}`)})}clearRecord(e){this.saveBackupOnBackground(),this._record.clear(e),this._unsaved=!1,this._recordFilePath=void 0,this._sourceURL=void 0,this.onChangePosition(),this.onUpdateTree()}replaceRecord(e,t){this.saveBackupOnBackground(),this._record=e,this.resetPositionCounts(),this.bindRecordHandlers(),this.updateRecordFilePath(t?.path),this._unsaved=!t?.markAsSaved,this._sourceURL=void 0,C(this._record),this.onChangePosition(),this.onUpdateTree()}reset(){this.clearRecord()}resetByInitialPositionType(e){this.resetBySFEN((0,i.initialPositionTypeToSFEN)(e))}resetBySFEN(e){const t=new i.Position;return!!t.resetBySFEN(e)&&(this.clearRecord(t),!0)}resetByUSEN(e,t,o){const n=i.Record.newByUSEN(e,t,o);if(n instanceof Error)return n;this.replaceRecord(n,{markAsSaved:!0})}resetByCurrentPosition(){this.clearRecord(this._record.position)}parseRecordData(e,t){let o;switch(t||(0,i.detectRecordFormat)(e)){case i.RecordFormatType.SFEN:{const t=i.Position.newBySFEN(e);o=t?new i.Record(t):new Error(r.t.failedToParseSFEN);break}case i.RecordFormatType.USI:o=i.Record.newByUSI(e);break;case i.RecordFormatType.KIF:o=(0,i.importKIF)(e);break;case i.RecordFormatType.KI2:o=(0,i.importKI2)(e);break;case i.RecordFormatType.CSA:o=(0,i.importCSA)(e);break;case i.RecordFormatType.JKF:o=(0,i.importJKFString)(e);break;case i.RecordFormatType.USEN:o=i.Record.newByUSEN(e);break;default:o=new Error(r.t.failedToDetectRecordFormat)}return o instanceof Error?(0,r.cB)(o):o}importRecord(e,t){const o=this.parseRecordData(e,t?.type);if(o instanceof Error)return o;switch(t?.mode||"standard"){case"standard":this.replaceRecord(o,t);break;case"mergeIntoRoot":return this.mergeRecord(o);case"mergeIntoCurrent":return this.mergeRecordIntoCurrent(o)}}importRecordFromBuffer(e,t,o){const n=(0,c.QT)(t);if(!n)return new Error(`${r.t.unknownFileExtension}: ${t}`);const i=(0,c.Nj)(e,n,o);if(i instanceof Error)return(0,r.cB)(i);this.replaceRecord(i,{path:t,markAsSaved:!0})}async importRecordFromRemoteURL(e){const t=!!e;if(!(e=e||this._sourceURL))throw new Error("RecordManager#importRecordFromRemoteURL: source URL is not set");const o=await h.Ay.loadRemoteTextFile(e),n=this.parseRecordData(o);if(n instanceof Error)throw n;if(t)return this.replaceRecord(n),void(this._sourceURL=e);const i=this.mergeRecord(n);if(i)throw i}exportRecordAsBuffer(e,t){const o=(0,c.QT)(e);if(!o)return new Error(`${r.t.unknownFileExtension}: ${e}`);const n=(0,c.KM)(this._record,o,t);return this.updateRecordFilePath(e),n}applyPosition(e){this._record.clear(e),this._unsaved=!0,this._recordFilePath=void 0,this.onChangePosition()}swapNextTurn(){const e=this.record.position.clone();e.setColor((0,i.reverseColor)(e.color)),this.applyPosition(e)}changePosition(e){const t=this.record.position.clone();t.edit(e),this.applyPosition(t)}changePieceSet(e){const t=this.record.position.clone(),o=(0,i.countExistingPieces)(this.record.position),n={king:e.king-o.king,rook:e.rook-(o.rook+o.dragon),bishop:e.bishop-(o.bishop+o.horse),gold:e.gold-o.gold,silver:e.silver-(o.silver+o.promSilver),knight:e.knight-(o.knight+o.promKnight),lance:e.lance-(o.lance+o.promLance),pawn:e.pawn-(o.pawn+o.promPawn)};Object.entries(n).filter(([,e])=>e<0).forEach(([e,o])=>{const n=e;for(let e=0;e>o;e--){const e=i.Square.all.find(e=>t.board.at(e)?.unpromoted().type===n);e?t.board.remove(e):n!==i.PieceType.KING&&(t.blackHand.count(n)>t.whiteHand.count(n)?t.blackHand.reduce(n,1):t.whiteHand.reduce(n,1))}}),Object.entries(n).filter(([,e])=>e>0).forEach(([e,o])=>{const n=e;for(let e=0;e<o;e++){const e=i.Square.all.find(e=>!t.board.at(e));e?t.board.set(e,new i.Piece(i.Color.BLACK,n)):n!==i.PieceType.KING&&(t.blackHand.count(n)<=t.whiteHand.count(n)?t.blackHand.add(n,1):t.whiteHand.add(n,1))}}),this.applyPosition(t)}goForward(){this._record.goForward()}goBack(){this._record.goBack()}changePly(e){this._record.goto(e)}changeBranch(e){return this._record.switchBranchByIndex(e)}changeNode(e){return this._record.gotoNode(e)}swapWithNextBranch(){return!!this._record.swapWithNextBranch()&&(this._unsaved=!0,!0)}swapWithPreviousBranch(){return!!this._record.swapWithPreviousBranch()&&(this._unsaved=!0,!0)}resetAllBranchSelection(){this._record.resetAllBranchSelection()}removeCurrentMove(){return!!this._record.removeCurrentMove()&&(this._unsaved=!0,this.onUpdateTree(),!0)}removeNextMove(){return!!this._record.removeNextMove()&&(this._unsaved=!0,this.onUpdateTree(),!0)}jumpToBookmark(e){return this._record.jumpToBookmark(e)}updateComment(e){this._record.current.comment=e,this._unsaved=!0,this.onUpdateComment()}updateBookmark(e){this._record.current.bookmark=e,this._unsaved=!0,this.onUpdateBookmark()}appendComment(e,t){if(!e)return;const o=this._record.current.comment,n=this.record.current.comment?"\n":"";switch(t){case s.Q.NONE:break;case s.Q.INSERT:this._record.current.comment=e+n+o;break;case s.Q.APPEND:this._record.current.comment=o+n+e;break;case s.Q.OVERWRITE:this._record.current.comment=e}this._unsaved=!0,this.onUpdateComment()}appendSearchComment(e,t,o,n,r){let c;switch(t){case s.F.SHOGIHOME:c=function(e,t,o,n){const s=t===a.PLAYER?"*":"#";let r="";o.mate&&(r+=`${s}詰み=${o.mate>=0?"先手勝ち":"後手勝ち"}`,Math.abs(o.mate)!==l.m&&(r+=`:${Math.abs(o.mate)}手`),r+="\n");var c;return void 0!==o.score&&(r+=((c=o.score)>=1500?"先手勝勢":c>=600?"先手優勢":c>=400?"先手有利":c>=200?"先手有望":c>-200?"互角":c>-400?"後手有望":c>-600?"後手有利":c>-1500?"後手優勢":"後手勝勢")+"\n",r+=`${s}評価値=${o.score}\n`),o.pv&&0!==o.pv.length&&(r+=`${s}読み筋=${(0,i.formatPV)(e,o.pv)}\n`),o.depth&&(r+=`${s}深さ=${o.depth}\n`),o.nodes&&(r+=`${s}ノード数=${o.nodes}\n`),r&&n?.engineName&&(r+=`${s}エンジン=${n.engineName}\n`),r}(this.record.position,e,o,r);break;case s.F.FLOODGATE:c=b(o);break;case s.F.CSA3:c=function(e){return b(e)+(void 0!==e.nodes?` #${e.nodes}`:"")}(o);break;case s.F.SHOGIGUI:c=function(e,t){let o="*"+(e===a.PLAYER?"対局":"解析");if(void 0!==t.depth&&(o+=` 深さ ${t.depth}`),void 0!==t.nodes&&(o+=` ノード数 ${t.nodes}`),void 0!==t.score?o+=` 評価値 ${t.score}`:void 0!==t.mate&&(o+=" 評価値 "+(t.mate>0?3e4:-3e4)),t.pv?.length){o+=" 読み筋";for(const e of t.pv)o+=" "+(e.color===i.Color.BLACK?"▲":"△")+(0,i.formatKIFMove)(e)}return o}(e,o)}r?.header&&(c=r.header+"\n"+c),this.appendComment(c,n),this._unsaved=!0}get inCommentPVs(){return function(e,t){const o=[];for(const n of t.split("\n")){let t;if(/^[#*]読み筋=/.test(n))t=(0,i.parsePV)(e,n.substring(5));else if(/^\*.* 読み筋 /.test(n)){const o=n.substring(n.indexOf(" 読み筋 ")+5),a=e.color===i.Color.BLACK?"▲":"△";t=(0,i.parsePV)(e,o.substring(o.indexOf(a)))}else if(/^#(?:指し手|形勢)\[/.test(n)){const o=n.substring(n.indexOf("]")+1),a=e.color===i.Color.BLACK?"▲":"△";t=(0,i.parsePV)(e,o.substring(o.indexOf(a)))}else/^\* -?[0-9]+ /.test(n)&&(t=E(e,n));t?.length&&o.push(t)}return o}(this.record.position,this.record.current.comment)}setGameStartMetadata(e){e.gameTitle&&this._record.metadata.setStandardMetadata(i.RecordMetadataKey.TITLE,e.gameTitle),e.blackName&&this._record.metadata.setStandardMetadata(i.RecordMetadataKey.BLACK_NAME,e.blackName),e.whiteName&&this._record.metadata.setStandardMetadata(i.RecordMetadataKey.WHITE_NAME,e.whiteName),this._record.metadata.setStandardMetadata(i.RecordMetadataKey.DATE,(0,n.sq)()),this._record.metadata.setStandardMetadata(i.RecordMetadataKey.START_DATETIME,(0,n.ln)());const t=e.blackTimeLimit.increment||e.whiteTimeLimit.increment?P:I,o=t(e.blackTimeLimit),a=t(e.whiteTimeLimit);o===a?this._record.metadata.setStandardMetadata(i.RecordMetadataKey.TIME_LIMIT,o):(this._record.metadata.setStandardMetadata(i.RecordMetadataKey.BLACK_TIME_LIMIT,o),this._record.metadata.setStandardMetadata(i.RecordMetadataKey.WHITE_TIME_LIMIT,a)),this._unsaved=!0}setGameEndMetadata(){this._record.metadata.setStandardMetadata(i.RecordMetadataKey.END_DATETIME,(0,n.ln)()),this._unsaved=!0}updateSearchInfo(e,t){const o=this.record.current.customData||{};switch(e){case a.PLAYER:o.playerSearchInfo=t;break;case a.OPPONENT:o.opponentSearchInfo=t;break;case a.RESEARCHER:(t.depth||0)>=(o.researchInfo?.depth||0)&&(o.researchInfo=t);break;case a.RESEARCHER_2:(t.depth||0)>=(o.researchInfo2?.depth||0)&&(o.researchInfo2=t);break;case a.RESEARCHER_3:(t.depth||0)>=(o.researchInfo3?.depth||0)&&(o.researchInfo3=t);break;case a.RESEARCHER_4:(t.depth||0)>=(o.researchInfo4?.depth||0)&&(o.researchInfo4=t)}this._record.current.customData=o,this.onUpdateCustomData()}appendMove(e){return!!this._record.append(e.move,e.moveOption)&&(void 0!==e.elapsedMs&&this._record.current.setElapsedMs(e.elapsedMs),this._unsaved=!0,!0)}appendMovesSilently(e,t){this.unbindChangePositionHandler();try{let o=0;const n=this._record.current.ply;for(const n of e){if(!this._record.append(n,t))break;o++}return this._record.goto(n),this._unsaved=!0,this.onUpdateTree(),o}finally{this.bindRecordHandlers()}}mergeRecord(e){if(this._record.initialPosition.sfen!==e.initialPosition.sfen)return new Error(r.t.failedToMergeRecordWithDifferentInitialPosition);this._record.merge(e),this._unsaved=!0,C(this._record),this.onUpdateTree()}mergeRecordIntoCurrent(e){if(this._record.position.color!==e.initialPosition.color)return new Error(r.t.failedToMergeRecordWithDifferentTurn);const{successCount:t,skipCount:o}=this._record.mergeIntoCurrentPosition(e);return this._unsaved=!0,C(this._record),this.onUpdateTree(),o>0?new Error(r.t.skippedMovesInMerge(o,t+o)):void 0}updateStandardMetadata(e){this._record.metadata.setStandardMetadata(e.key,e.value),this._unsaved=!0}on(e,t){switch(e){case"changePosition":this.changePositionHandler=t;break;case"updateTree":this.updateTreeHandler=t;break;case"updateComment":this.updateCommentHandler=t;break;case"updateBookmark":this.updateBookmarkHandler=t;break;case"updateCustomData":this.updateCustomDataHandler=t;break;case"backup":this.backupHandler=t}return this}onChangePosition(){this.changePositionHandler&&this.changePositionHandler()}onUpdateTree(){this.updateTreeHandler&&this.updateTreeHandler()}onUpdateComment(){this.updateCommentHandler&&this.updateCommentHandler()}onUpdateBookmark(){this.updateBookmarkHandler&&this.updateBookmarkHandler()}onUpdateCustomData(){this.updateCustomDataHandler&&this.updateCustomDataHandler()}onBackup(){return this.backupHandler?this.backupHandler():null}resetPositionCounts(){this._positionCounts.clear(),this._record.forEach(e=>{this.addPositionCount(e)})}isPositionCountTarget(e){return 0===e.ply||e.move instanceof i.Move}addPositionCount(e){if(!this.isPositionCountTarget(e))return;const t=this._positionCounts.get(e.sfen)||0;this._positionCounts.set(e.sfen,t+1)}reducePositionCount(e){if(!this.isPositionCountTarget(e))return;const t=this._positionCounts.get(e.sfen)||0;t>1?this._positionCounts.set(e.sfen,t-1):this._positionCounts.delete(e.sfen)}bindRecordHandlers(){this._record.on("changePosition",this.onChangePosition.bind(this)),this._record.on("clear",this.resetPositionCounts.bind(this)),this._record.on("addNode",e=>{this.addPositionCount(e)}),this._record.on("removeNode",e=>{this.reducePositionCount(e)})}unbindChangePositionHandler(){this._record.on("changePosition",()=>{})}}},953(e){e.exports=require("encoding-japanese")},113(e){e.exports=require("tsshogi")}},t={};function o(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,o),a.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n=o(698),i=o(1);const a=require("node:path");var s=o.n(a);const r=require("node:child_process"),c=require("log4js");var l=o.n(c),h=o(789);const d=require("node:fs");var u=o.n(d);require("node:os");const m=function(e){switch(e){case"logs":return s().join(process.cwd(),"logs");case"exe":return process.argv[1];default:return process.cwd()}}("logs");const p=(0,h.ln)().replaceAll(" ","_").replaceAll("/","").replaceAll(":",""),g=s().join(m,`app-${p}.log`),S=s().join(m,`usi-${p}.log`),y=s().join(m,`csa-${p}.log`),f={appenders:{stdout:{type:"stdout"},recording:{type:"recording"}},categories:{default:{appenders:["stdout"],level:"info"}}};function T(e){switch(e){case n.F.APP:return g;case n.F.USI:return S;case n.F.CSA:return y}}const v="stdout",C={[n.F.APP]:[v],[n.F.USI]:[v],[n.F.CSA]:[v]},b={[n.F.APP]:n.$.INFO,[n.F.USI]:n.$.INFO,[n.F.CSA]:n.$.INFO};function E(e,t,o){C[e]=t.map(t=>"file"===t?e:t),b[e]=o}const P={};function I(e){if(P[e])return P[e];f.appenders[e]||(f.appenders[e]={type:"file",filename:T(e)},f.categories[e]={appenders:C[e],level:b[e]});const t=l().configure(f).getLogger(e);return P[e]=t,t}function A(){return I(n.F.APP)}var k=o(113),M=o(690),N=o(265);const w=require("node:net");var R=o.n(w);const O=require("node:readline");class F{socket;readline;constructor(e,t,o,n={keepaliveInitialDelay:0}){this.socket=R().createConnection({port:t,host:e},o.onConnect).setKeepAlive(!0,1e3*n.keepaliveInitialDelay).on("error",o.onError).on("end",o.onFIN).on("close",e=>{this.closeReadline(),o.onClose(e)}),this.readline=(0,O.createInterface)(this.socket),this.readline.on("line",o.onRead)}write(e){this.socket.write(e+"\n")}end(){this.socket.end()}closeReadline(){this.readline&&(this.readline.close(),this.readline=null)}}var D,L;function B(e,t){const o=new Date;return{type:e,command:t,dateTime:(0,h.ng)(o),timeMs:o.getTime()}}function U(e,t,o,n){Array.isArray(t)||(t=[t]);for(const o of t)e.commands.push(o);if(e.commands.length>o){const t=Math.max(n,e.commands.length-o);e.discarded+=t,e.commands.splice(0,t)}}!function(e){e.SEND="send",e.RECEIVE="receive",e.SYSTEM="system"}(D||(D={})),function(e){e.IDLE="idle",e.CONNECTING="connecting",e.CONNECTED="connected",e.WAITING_GAME_SUMMARY="waitingGameSummary",e.GAME_SUMMARY="gameSummary",e.GAME_TIME="gameTime",e.GAME_TIME_B="gameTimeB",e.GAME_TIME_W="gameTimeW",e.GAME_POSITION="gamePosition",e.READY="ready",e.WAITING_START="waitingStart",e.WAITING_REJECT="waitingReject",e.PLAYING="playing",e.WAITING_LOGOUT="waitingLogout",e.WAITING_CLOSE="waitingClose",e.CLOSED="closed"}(L||(L={}));class _{_sessionID;_settings;logger;_state=L.IDLE;gameSummaryCallback;rejectCallback;startCallback;moveCallback;gameResultCallback;closeCallback;errorCallback;commandCallback;socket;gameSummary=(0,M.Rr)();playerStates=(0,M.OW)();specialMove=M.kt.UNKNOWN;_lastReceived;_lastSent;_commandHistory={discarded:0,commands:[]};_createdMs=Date.now();_loggedInMs;blankLinePingTimeout=null;constructor(e,t,o){this._sessionID=e,this._settings=t,this.logger=o}get sessionID(){return this._sessionID}get settings(){return this._settings}get state(){return this._state}get lastReceived(){return this._lastReceived}get lastSent(){return this._lastSent}get commandHistory(){return this._commandHistory}get createdMs(){return this._createdMs}get loggedInMs(){return this._loggedInMs}on(e,t){switch(e){case"gameSummary":this.gameSummaryCallback=t;break;case"reject":this.rejectCallback=t;break;case"start":this.startCallback=t;break;case"move":this.moveCallback=t;break;case"gameResult":this.gameResultCallback=t;break;case"close":this.closeCallback=t;break;case"error":this.errorCallback=t;break;case"command":this.commandCallback=t}return this}login(){this.logger.info("sid=%d: connecting to %s:%d",this.sessionID,this.settings.host,this.settings.port),this._state=L.CONNECTING,this.socket=new F(this.settings.host,this.settings.port,{onConnect:this.onConnect.bind(this),onError:this.onConnectionError.bind(this),onFIN:this.onFIN.bind(this),onClose:this.onClose.bind(this),onRead:this.onRead.bind(this)},{keepaliveInitialDelay:this.settings.tcpKeepalive.initialDelay})}logout(){if(this.settings.protocolVersion===N._B.V121_FLOODGATE)this.socket&&(this.logger.info("sid=%d: disconnect",this.sessionID),this.socket.end(),this._state=L.WAITING_CLOSE);else this.state!==L.WAITING_GAME_SUMMARY&&this.state!==L.GAME_SUMMARY&&this.state!==L.GAME_TIME&&this.state!==L.GAME_TIME_B&&this.state!==L.GAME_TIME_W&&this.state!==L.GAME_POSITION&&this.state!==L.READY||(this.send("LOGOUT"),this._state=L.WAITING_LOGOUT)}agree(e){this.state===L.READY&&e===this.gameSummary.id&&(this._state=L.WAITING_START,this.send(`AGREE ${this.gameSummary.id}`))}reject(e){this.state===L.READY&&e===this.gameSummary.id&&(this._state=L.WAITING_REJECT,this.send(`REJECT ${this.gameSummary.id}`))}doMove(e,t,o){if(this.state!==L.PLAYING)return;let n=e;void 0!==t&&(n+=`,'* ${Math.round(t)}`,void 0!==o&&(n+=` ${o}`)),this.send(n)}resign(){this.state===L.PLAYING&&this.send("%TORYO")}win(){this.state===L.PLAYING&&this.send("%KACHI")}stop(){this.state===L.PLAYING&&this.send("%CHUDAN")}send(e){this.socket?(this.socket.write(e),this._lastSent=B(D.SEND,this.hideSecureValues(e)),this.updateCommendHistory(this._lastSent),this.commandCallback?.(this._lastSent),this.logger.info("sid=%d: > %s",this.sessionID,this.hideSecureValues(e)),this.setBlankLinePing(e)):this.logger.error("sid=%d: failed to send command caused by invalid socket: %s",this.sessionID,e)}hideSecureValues(e){return this.settings.password&&(e=e.replaceAll(this.settings.password,"*****")),e}onConnect(){this.logger.info("sid=%d: connected",this.sessionID),this._state=L.CONNECTED;let e="";this.settings.protocolVersion===N._B.V121_X1&&(e=" x1"),this.send(`LOGIN ${this.settings.id} ${this.settings.password}${e}`)}onConnectionError(e){if(this.state===L.CLOSED)return;this.onError(e),this._state=L.CLOSED,this.closeCallback?.();const t=B(D.SYSTEM,"connection error");this.updateCommendHistory(t),this.commandCallback?.(t)}onError(e){this.logger.error("sid=%d: error: %s %s",this.sessionID,e.name,e.message),this.errorCallback?.(e)}onFIN(){this.logger.info("sid=%d: FIN packet received",this.sessionID),this.clearBlankLinePing()}onClose(e){if(this.clearBlankLinePing(),this.state===L.CLOSED)return;switch(this.state){case L.WAITING_GAME_SUMMARY:case L.WAITING_LOGOUT:case L.WAITING_CLOSE:e?this.onError(new Error(i.t.errorOccuredWhileDisconnectingFromCSAServer)):this.logger.info("sid=%d: socket closed",this.sessionID);break;case L.CONNECTING:this.onError(new Error(i.t.failedToConnectToCSAServer));break;default:this.onError(new Error(i.t.disconnectedFromCSAServer))}this._state=L.CLOSED,this.closeCallback?.();const t=B(D.SYSTEM,e?"closed (error)":"closed");this.updateCommendHistory(t),this.commandCallback?.(t)}onRead(e){this.setBlankLinePing(),this._lastReceived=B(D.RECEIVE,e),this.updateCommendHistory(this._lastReceived),this.commandCallback?.(this._lastReceived),this.logger.info("sid=%d: < %s",this.sessionID,e),""!==e&&(this.state===L.GAME_SUMMARY?this.onGameSummary(e):this.state===L.GAME_TIME?this.onGameTime(e):this.state===L.GAME_TIME_B?this.onGameTime(e,k.Color.BLACK):this.state===L.GAME_TIME_W?this.onGameTime(e,k.Color.WHITE):this.state===L.GAME_POSITION?this.onGamePosition(e):this.state===L.PLAYING?this.onMove(e):/^LOGIN:.* OK$/.test(e)?this.onLoginOK():"LOGIN:incorrect"===e?this.onLoginIncorrect():"LOGOUT:completed"===e?this.onLogout():"BEGIN Game_Summary"===e?this.onBeginGameSummary():e.startsWith("REJECT:")?this.onReject():e.startsWith("START:")?this.onStart():this.logger.warn("sid=%d: unknown command received",this.sessionID))}onLoginOK(){this._loggedInMs=Date.now(),this.logger.info("sid=%d: login ok",this.sessionID),this._state=L.WAITING_GAME_SUMMARY}onLoginIncorrect(){this.onError(new Error(i.t.csaServerLoginDenied)),this.socket&&this.socket.end()}onLogout(){this.logger.info("sid=%d: logout",this.sessionID),this._state=L.WAITING_CLOSE}onBeginGameSummary(){this._state=L.GAME_SUMMARY,this.gameSummary=(0,M.Rr)()}onEndGameSummary(){const e=this.gameSummary.players.black.time,t=this.gameSummary.players.white.time;this.playerStates.black.time=e.totalTime+e.increment,this.playerStates.white.time=t.totalTime+t.increment;const o=(0,k.importCSA)(this.gameSummary.position);if(o instanceof Error)return this.onError(new Error("invalid game position received from CSA server")),void this.logout();for(const e of o.moves){if((0,k.isKnownSpecialMove)(e.move)&&e.move.type===k.SpecialMoveType.START)continue;const t=(0,k.reverseColor)(e.nextColor);this.updateTime(t,e.elapsedMs)}this._state=L.READY,this.gameSummaryCallback?.(this.gameSummary)}onGameSummary(e){switch(e){case"END Game_Summary":return void this.onEndGameSummary();case"BEGIN Time":return void(this._state=L.GAME_TIME);case"BEGIN Time+":return void(this._state=L.GAME_TIME_B);case"BEGIN Time-":return void(this._state=L.GAME_TIME_W);case"BEGIN Position":return void(this._state=L.GAME_POSITION)}const[t,o]=e.split(":",2);switch(t){case"Protocol_Version":case"Protocol_Mode":case"Format":case"Declaration":case"Rematch_On_Draw":case"Max_Moves":break;case"Game_ID":this.gameSummary.id=o;break;case"Name+":this.gameSummary.players.black.playerName=o;break;case"Name-":this.gameSummary.players.white.playerName=o;break;case"Your_Turn":this.gameSummary.myColor="+"===o?k.Color.BLACK:k.Color.WHITE;break;case"To_Move":this.gameSummary.toMove="+"===o?k.Color.BLACK:k.Color.WHITE;break;default:this.logger.warn("sid=%d: unknown command received",this.sessionID)}}onGameTime(e,t){switch(e){case"END Time":case"END Time+":case"END Time-":return void(this._state=L.GAME_SUMMARY)}const o=t?[this.gameSummary.players[t].time]:[this.gameSummary.players.black.time,this.gameSummary.players.white.time],[n,i]=e.split(":",2);switch(n){case"Least_Time_Per_Move":case"Time_Roundup":break;case"Time_Unit":for(const e of o)i.endsWith("msec")?e.timeUnitMs=Number(i.slice(0,-4)):i.endsWith("sec")?e.timeUnitMs=1e3*Number(i.slice(0,-3)):i.endsWith("min")&&(e.timeUnitMs=60*Number(i.slice(0,-3))*1e3);break;case"Total_Time":for(const e of o)e.totalTime=Number(i);break;case"Byoyomi":for(const e of o)e.byoyomi=Number(i);break;case"Delay":for(const e of o)e.delay=Number(i);break;case"Increment":for(const e of o)e.increment=Number(i);break;default:this.logger.warn("sid=%d: unknown command received",this.sessionID)}}onGamePosition(e){"END Position"!==e?this.gameSummary.position+=e+"\n":this._state=L.GAME_SUMMARY}onReject(){this._state=L.WAITING_GAME_SUMMARY,this.rejectCallback?.()}onStart(){this._state=L.PLAYING,this.startCallback?.(this.playerStates)}onMove(e){e.startsWith("+")?this.onMoveWithColor(e,k.Color.BLACK):e.startsWith("-")?this.onMoveWithColor(e,k.Color.WHITE):e.startsWith("#")?this.onEndingCommand(e):e.startsWith("%")||this.logger.warn("sid=%d: unknown move command received",this.sessionID)}onMoveWithColor(e,t){const o=/^.*,T([0-9]+)$/.exec(e);if(o){const e=Number(o[1]);this.updateTime(t,1e3*e)}else this.logger.error("sid=%d: invalid move format",this.sessionID);this.moveCallback?.(e,this.playerStates)}updateTime(e,t){const o=this.gameSummary.players[e].time,n=t/o.timeUnitMs,i=this.playerStates[e].time-n+o.increment;this.playerStates[e].time=Math.max(i,0)}onEndingCommand(e){switch(e){case"#RESIGN":this.specialMove=M.kt.RESIGN;break;case"#SENNICHITE":this.specialMove=M.kt.SENNICHITE;break;case"#OUTE_SENNICHITE":this.specialMove=M.kt.OUTE_SENNICHITE;break;case"#ILLEGAL_MOVE":this.specialMove=M.kt.ILLEGAL_MOVE;break;case"#ILLEGAL_ACTION":this.specialMove=M.kt.ILLEGAL_ACTION;break;case"#TIME_UP":this.specialMove=M.kt.TIME_UP;break;case"#JISHOGI":this.specialMove=M.kt.JISHOGI;break;case"#MAX_MOVES":this.specialMove=M.kt.MAX_MOVES;break;case"#WIN":this.onGameResult(M.j5.WIN);break;case"#LOSE":this.onGameResult(M.j5.LOSE);break;case"#DRAW":this.onGameResult(M.j5.DRAW);break;case"#CENSORED":this.onGameResult(M.j5.CENSORED);break;case"#CHUDAN":this.onGameResult(M.j5.CHUDAN)}}onGameResult(e){this._state=L.WAITING_GAME_SUMMARY,this.gameResultCallback?.(this.specialMove,e)}invoke(e,t){switch(e){case D.SEND:this.send(t);break;case D.RECEIVE:this.onRead(t)}}setBlankLinePing(e){this.settings.blankLinePing&&(this.clearBlankLinePing(),this.blankLinePingTimeout=setTimeout(()=>{this.send("")},1e3*(""===e?this.settings.blankLinePing.interval:this.settings.blankLinePing.initialDelay)))}clearBlankLinePing(){this.blankLinePingTimeout&&(clearTimeout(this.blankLinePingTimeout),this.blankLinePingTimeout=null)}updateCommendHistory(e){U(this._commandHistory,e,100,10)}}let G;let H=0;const W=new Map;let x=2e4;function K(e){const t=(H+=1,H),o=new _(t,e,I(n.F.CSA)).on("gameSummary",e=>G.onCSAGameSummary(t,e)).on("reject",()=>G.onCSAReject(t)).on("start",e=>G.onCSAStart(t,e)).on("move",(e,o)=>G.onCSAMove(t,e,o)).on("gameResult",(e,o)=>G.onCSAGameResult(t,e,o)).on("close",()=>{!function(e){setTimeout(()=>{W.delete(e)},x)}(t),G.onCSAClose(t)}).on("error",G.sendError).on("command",e=>{G.sendPromptCommand(t,e)});return function(e){W.set(e.sessionID,e)}(o),o.login(),t}var $=o(591),V=o(408);const Y="win32"===process.platform;class J{handle;readline=null;constructor(e){const t={cwd:s().dirname(e)};Y&&(e.endsWith(".bat")||e.endsWith(".cmd"))?this.handle=(0,r.spawn)("cmd.exe",["/c",e],t):this.handle=(0,r.spawn)(e,t),this.handle.on("close",this.onClose.bind(this))}get pid(){return this.handle.pid}on(e,t){switch(e){case"receive":null===this.readline&&(this.readline=(0,O.createInterface)(this.handle.stdout)),this.readline.on("line",t);break;case"close":this.handle.on("close",(e,o)=>{this.onClose(),t(e,o)});break;default:this.handle.on(e,t)}return this}send(e){this.handle.stdin.write(e+"\n")}kill(){this.onClose(),this.handle.kill()}onClose(){null!==this.readline&&this.readline.close()}}var q,j;function z(e){switch(e){case"+":case"+0":case"0":return+V.m;case"-":case"-0":return-V.m;default:return Number(e)}}function X(e){return e?`btime ${e.btime} wtime ${e.wtime} `+(0!==e.binc||0!==e.winc?`binc ${e.binc} winc ${e.winc}`:`byoyomi ${e.byoyomi}`):"infinite"}!function(e){e.WIN="win",e.LOSE="lose",e.DRAW="draw"}(q||(q={})),function(e){e.WaitingForUSIOK="waitingForUSIOK",e.NotReady="notReady",e.WaitingForReadyOK="waitingForReadyOK",e.Ready="ready",e.WaitingForBestMove="waitingForBestMove",e.Ponder="ponder",e.WaitingForPonderBestMove="waitingForPonderBestMove",e.WaitingForCheckmate="waitingForCheckmate",e.WillQuit="willQuit",e.QuitCompleted="quitCompleted"}(j||(j={}));class Q{_path;sessionID;logger;option;process=null;_name="NO NAME";_author="";_engineOptions={};_state=j.WaitingForUSIOK;_currentPosition="";invalidBestMoveCount=0;reservedSetOptionCommands=[];reservedGoCommand;launchTimeout;quitTimeout;_lastReceived;_lastSent;_commandHistory={discarded:0,commands:[]};readyStartTimeMs=0;goTimeMs=0;timeoutCallback;errorCallback;closeCallback;usiOkCallback;readyCallback;bestMoveCallback;goEndCallback;checkmateCallback;checkmateNotImplementedCallback;checkmateTimeoutCallback;checkmateEndCallback;noMateCallback;infoCallback;commandCallback;constructor(e,t,o,n){this._path=e,this.sessionID=t,this.logger=o,this.option=n}get path(){return this._path}get name(){return this._name}get author(){return this._author}get engineOptions(){return this._engineOptions}get state(){return this._state}get currentPosition(){return this._currentPosition}get lastReceived(){return this._lastReceived}get lastSent(){return this._lastSent}get commandHistory(){return this._commandHistory}get pid(){return this.process?.pid}on(e,t){switch(e){case"timeout":this.timeoutCallback=t;break;case"error":this.errorCallback=t;break;case"close":this.closeCallback=t;break;case"usiok":this.usiOkCallback=t;break;case"ready":this.readyCallback=t;break;case"bestmove":this.bestMoveCallback=t;break;case"goEnd":this.goEndCallback=t;break;case"checkmate":this.checkmateCallback=t;break;case"checkmateNotImplemented":this.checkmateNotImplementedCallback=t;break;case"checkmateTimeout":this.checkmateTimeoutCallback=t;break;case"checkmateEnd":this.checkmateEndCallback=t;break;case"noMate":this.noMateCallback=t;break;case"info":this.infoCallback=t;break;case"command":this.commandCallback=t}return this}launch(){this.logger.info("sid=%d: launch: %s",this.sessionID,this.path),this.setLaunchTimeout(),this.process=new J(this.path),this.process.on("error",this.onError.bind(this)),this.process.on("close",this.onClose.bind(this)),this.process.on("receive",this.onReceive.bind(this)),this.send("usi")}quit(){if(this.state!==j.WillQuit){switch(this.state){case j.WaitingForBestMove:case j.WaitingForPonderBestMove:if(this.goEndCallback){const e=Date.now()-this.goTimeMs;this.goEndCallback(e)}break;case j.WaitingForCheckmate:if(this.checkmateEndCallback){const e=Date.now()-this.goTimeMs;this.checkmateEndCallback(e)}}this._state=j.WillQuit,this.clearLaunchTimeout(),this.logger.info("sid=%d: quit USI engine",this.sessionID),this.setQuitTimeout(),this.send("quit")}}setOption(e,t){this.state===j.WaitingForBestMove||this.state===j.WaitingForPonderBestMove||this.state===j.WaitingForCheckmate?this.reservedSetOptionCommands.push({name:e,value:t}):this.setOptionImmediately(e,t)}setOptionImmediately(e,t){void 0!==t?this.send(`setoption name ${e} value ${t}`):this.send(`setoption name ${e}`)}flushReservedSetOptionCommands(){for(const e of this.reservedSetOptionCommands)this.setOptionImmediately(e.name,e.value);this.reservedSetOptionCommands=[]}ready(){if(this.state!==j.WaitingForReadyOK){if(this.state!==j.Ready&&this.state!==j.WaitingForBestMove&&this.state!==j.Ponder&&this.state!==j.WaitingForPonderBestMove&&this.state!==j.WaitingForCheckmate||this.gameover(q.DRAW),this.state!==j.NotReady)return this.logger.warn("sid=%d: ready: unexpected state: %s",this.sessionID,this.state),new Error("unexpected state");this.send("isready"),this._state=j.WaitingForReadyOK,this.readyStartTimeMs=Date.now()}}go(e,t){switch(this.reservedGoCommand={position:e,timeState:t},this.state){case j.Ready:this.sendReservedGoCommands();break;case j.WaitingForBestMove:case j.Ponder:case j.WaitingForCheckmate:this.stop()}}goPonder(e,t){this.state===j.Ready?(this.reservedGoCommand={position:e,timeState:this.option.enableEarlyPonder?void 0:t,ponder:!0},this.sendReservedGoCommands()):this.logger.warn("sid=%d: goPonder: unexpected state: %s",this.sessionID,this.state)}goMate(e,t){this.state===j.Ready?(this.reservedGoCommand={position:e,mate:!0,mateLimit:t?1e3*t:void 0},this.sendReservedGoCommands()):this.logger.warn("sid=%d: goMate: unexpected state: %s",this.sessionID,this.state)}ponderHit(e){this.state===j.Ponder?(this.option.enableEarlyPonder?this.send("ponderhit "+X(e)):this.send("ponderhit"),this._state=j.WaitingForBestMove):this.logger.warn("sid=%d: ponderHit: unexpected state: %s",this.sessionID,this.state)}stop(){this.state===j.WaitingForBestMove||this.state===j.Ponder||this.state===j.WaitingForCheckmate?"stop"!==this.lastSent?.command&&(this.send("stop"),this.state===j.Ponder&&(this._state=j.WaitingForPonderBestMove)):this.logger.warn("sid=%d: stop: unexpected state: %s",this.sessionID,this.state)}gameover(e){switch(this.state){case j.WaitingForUSIOK:case j.NotReady:case j.WaitingForReadyOK:case j.WillQuit:return void this.logger.warn("sid=%d: gameover: unexpected state: %s",this.sessionID,this.state);case j.WaitingForBestMove:case j.Ponder:this.stop(),this.invalidBestMoveCount++;break;case j.WaitingForPonderBestMove:this.invalidBestMoveCount++;break;case j.WaitingForCheckmate:this.stop();case j.Ready:}this.send("gameover "+e),this._state=j.NotReady,this.reservedGoCommand=void 0}setLaunchTimeout(){this.launchTimeout=setTimeout(()=>{this.timeoutCallback?.(),this.quit()},this.option.timeout||1e4)}clearLaunchTimeout(){this.launchTimeout&&(clearTimeout(this.launchTimeout),this.launchTimeout=void 0)}setQuitTimeout(){this.quitTimeout=setTimeout(()=>{this.process&&(this.process.kill(),this.process=null)},5e3)}clearQuitTimeout(){this.quitTimeout&&(clearTimeout(this.quitTimeout),this.quitTimeout=void 0)}onError(e){this.errorCallback?.(e),this.quit()}onClose(e,t){this.logger.info("sid=%d: engine process closed: close=%s signal=%s",this.sessionID,e,t),this.state!==j.WillQuit&&this.errorCallback?.(new Error("closed unexpectedly")),this._state=j.QuitCompleted,this.clearLaunchTimeout(),this.clearQuitTimeout(),this.process=null,this.closeCallback?.();const o=B(D.SYSTEM,`closed: close=${e} signal=${t}`);this.updateCommendHistory(o),this.commandCallback?.(o)}sendReservedGoCommands(){if(!this.reservedGoCommand)return;this.send(this.reservedGoCommand.position);let e="",t="";if(this.reservedGoCommand.ponder)e="ponder",t=(o=this.reservedGoCommand.timeState)?X(o):"";else if(this.reservedGoCommand.mate){e="mate";const o=this.reservedGoCommand.mateLimit;t=o?Math.floor(o).toFixed(0):"infinite"}else t=X(this.reservedGoCommand.timeState);var o;this.send("go"+(e?" "+e:"")+(t?" "+t:"")),this._currentPosition=this.reservedGoCommand.position,this._state=this.reservedGoCommand.ponder?j.Ponder:this.reservedGoCommand.mate?j.WaitingForCheckmate:j.WaitingForBestMove,this.reservedGoCommand=void 0,this.goTimeMs=Date.now()}send(e){this.process&&(this.process.send(e),this._lastSent=B(D.SEND,e),this.updateCommendHistory(this._lastSent),this.commandCallback?.(this._lastSent),this.logger.info("sid=%d: > %s",this.sessionID,e))}onReceive(e){if(this._lastReceived=B(D.RECEIVE,e),this.updateCommendHistory(this._lastReceived),this.commandCallback?.(this._lastReceived),this.logger.info("sid=%d: < %s",this.sessionID,e),this.state!==j.WillQuit)if(e.startsWith("id name "))this.onIDName(e.substring(8));else if(e.startsWith("id author "))this.onIDAuthor(e.substring(10));else if(e.startsWith("option "))this.onOption(e.substring(7));else if("usiok"===e)this.onUSIOk();else if("readyok"===e)this.onReadyOk();else if(e.startsWith("bestmove "))this.onBestMove(e.substring(9));else if(e.startsWith("checkmate "))this.onCheckmate(e.substring(10));else if(e.startsWith("info ")&&!this.option.discardUSIInfo&&this.infoCallback){const t=e.substring(5);this.infoCallback?.(this.currentPosition,function(e){const t={},o=e.split(" ");for(let n=0;n<e.length;n+=1)switch(o[n]){case"depth":t.depth=Number(o[n+1]),n+=1;break;case"seldepth":t.seldepth=Number(o[n+1]),n+=1;break;case"time":t.timeMs=Number(o[n+1]),n+=1;break;case"nodes":t.nodes=Number(o[n+1]),n+=1;break;case"pv":t.pv=o.slice(n+1),n=o.length;break;case"multipv":t.multipv=Number(o[n+1]),n+=1;break;case"score":switch(o[n+1]){case"cp":t.scoreCP=Number(o[n+2]),n+=2;break;case"mate":t.scoreMate=z(o[n+2]),n+=2}break;case"lowerbound":t.lowerbound=!0;break;case"upperbound":t.upperbound=!0;break;case"currmove":t.currmove=o[n+1],n+=1;break;case"hashfull":t.hashfullPerMill=Number(o[n+1]),n+=1;break;case"nps":t.nps=Number(o[n+1]),n+=1;break;case"string":t.string=o.slice(n+1).join(" "),n=o.length}return t}(t))}}onIDName(e){this._name=e}onIDAuthor(e){this._author=e}onOption(e){const t=e.split(" ");if(t.length<4||"name"!==t[0]||"type"!==t[2])return void this.logger.error("sid=%d: invalid option command",this.sessionID);const o=t[1],n=t[3],i=100+Object.keys(this._engineOptions).length,a="combo"===n?{name:o,type:n,order:i,vars:[]}:{name:o,type:n,order:i};if("button"!==a.type)for(let e=4;e+1<t.length;e+=2)switch(t[e]){case"default":a.default="spin"===a.type?Number(t[e+1]):t[e+1];break;case"min":"spin"===a.type&&(a.min=Number(t[e+1]));break;case"max":"spin"===a.type&&(a.max=Number(t[e+1]));break;case"var":"combo"===a.type&&a.vars.push(t[e+1])}this._engineOptions[a.name]=a}onUSIOk(){this.state===j.WaitingForUSIOK?(this.engineOptions[$.If]||(this._engineOptions[$.If]={name:$.If,type:"spin",order:1,default:32}),this.engineOptions[$.YZ]||(this._engineOptions[$.YZ]={name:$.YZ,type:"check",order:2,default:"true"}),this.option.engineOptions&&this.option.engineOptions.forEach(e=>{const t=(0,$.J3)(e);void 0!==t&&this.setOption(e.name,t)}),this.clearLaunchTimeout(),this._state=j.NotReady,this.usiOkCallback?.()):this.logger.warn("sid=%d: onUSIOk: unexpected state: %s",this.sessionID,this.state)}onReadyOk(){if(this.state!==j.WaitingForReadyOK)return void this.logger.warn("sid=%d: onReadyOk: unexpected state: %s",this.sessionID,this.state);this._state=j.Ready;const e=Date.now()-this.readyStartTimeMs;this.readyCallback?.(e),this.send("usinewgame"),this.sendReservedGoCommands()}onBestMove(e){if(this.flushReservedSetOptionCommands(),this.invalidBestMoveCount>0)return this.invalidBestMoveCount--,void this.logger.warn("sid=%d: onBestMove: ignore bestmove: %s",this.sessionID,e);const t=Date.now()-this.goTimeMs;if(this.state!==j.WaitingForBestMove&&this.state!==j.WaitingForPonderBestMove)return this.logger.warn("sid=%d: onBestMove: unexpected state: %s",this.sessionID,this.state),void this.goEndCallback?.(t);if(this.bestMoveCallback&&this.state===j.WaitingForBestMove){const t=e.split(" "),o=t[0],n=t.length>=3&&"ponder"===t[1]&&t[2]||void 0;this.bestMoveCallback(this.currentPosition,o,n)}this._state=j.Ready,this._currentPosition="",this.sendReservedGoCommands(),this.goEndCallback?.(t)}onCheckmate(e){this.flushReservedSetOptionCommands();const t=Date.now()-this.goTimeMs;return this.state!==j.WaitingForCheckmate?(this.logger.warn("sid=%d: onCheckmate: unexpected state: %s",this.sessionID,this.state),void this.checkmateEndCallback?.(t)):(this._state=j.Ready,"notimplemented"===e.trim()?(this.checkmateNotImplementedCallback?.(),void this.checkmateEndCallback?.(t)):"timeout"===e.trim()?(this.checkmateTimeoutCallback?.(this.currentPosition),void this.checkmateEndCallback?.(t)):"nomate"===e.trim()?(this.noMateCallback?.(this.currentPosition),void this.checkmateEndCallback?.(t)):(this.checkmateCallback?.(this.currentPosition,e.trim().split(" ")),void this.checkmateEndCallback?.(t)))}invoke(e,t){switch(e){case D.SEND:this.send(t);break;case D.RECEIVE:this.onReceive(t)}}updateCommendHistory(e){U(this._commandHistory,e,100,10)}}o(186);var Z=o(178);function ee(e){const t=process.env.PORTABLE_EXECUTABLE_DIR;return t?s().resolve(t,e):e}let te;function oe(e){return new Error(i.t.noResponseFromEnginePleaseExtendTimeout(e))}function ne(e,t){return t?new Error(`${e}: ${i.t.lastReceived}=[${t}]`):new Error(e)}let ie=0;function ae(){return ie+=1,ie}const se=new Map;let re=2e4;function ce(e){const t=se.get(e);if(!t)throw new Error("No engine session: SessionID="+e);return t}function le(e){const t=ce(e);if(t.stats.totalNodeCount+=t.statsTempData?.nodes??0,t.statsTempData?.nps&&(t.stats.npsSampleCount+=1,t.stats.meanNPS=(t.stats.meanNPS*(t.stats.npsSampleCount-1)+t.statsTempData.nps)/t.stats.npsSampleCount),t.statsTempData?.hashfullPerMill){const e=t.statsTempData.hashfullPerMill/10;t.stats.hashUsageSampleCount+=1,t.stats.meanHashUsagePercent=(t.stats.meanHashUsagePercent*(t.stats.hashUsageSampleCount-1)+e)/t.stats.hashUsageSampleCount,e>=50&&(t.stats.hashUsageOver50PercentCount+=1),e>=70&&(t.stats.hashUsageOver70PercentCount+=1),e>=90&&(t.stats.hashUsageOver90PercentCount+=1)}}function he(e,t){const o=ae(),i=t?.timeoutSeconds||10,a=new Q(ee(e.path),o,I(n.F.USI),{timeout:1e3*i,engineOptions:Object.values(e.options),enableEarlyPonder:e.enableEarlyPonder,discardUSIInfo:t?.discardUSIInfo}),s=function(e,t){return{process:e,engine:t,createdMs:Date.now(),stats:{runCount:0,totalUptimeMs:0,gameCount:0,totalReadyTimeMs:0,winCount:0,loseCount:0,drawCount:0,goCount:0,goPonderCount:0,ponderHitCount:0,goInfiniteCount:0,goMateCount:0,totalGoTimeMs:0,totalMateTimeMs:0,totalNodeCount:0,maxNPS:0,npsSampleCount:0,meanNPS:0,maxDepth:0,maxDepthTimeMs:0,maxSelDepth:0,depth20Count:0,depth20TotalTimeMs:0,depth30Count:0,depth30TotalTimeMs:0,depth40Count:0,depth40TotalTimeMs:0,depth50Count:0,depth50TotalTimeMs:0,maxHashUsagePercent:0,hashUsageSampleCount:0,meanHashUsagePercent:0,hashUsageOver50PercentCount:0,hashUsageOver70PercentCount:0,hashUsageOver90PercentCount:0}}}(a,e);return se.set(o,s),new Promise((t,n)=>{a.on("close",()=>{!function(e){const t=ce(e),o=Date.now();t.stats.totalUptimeMs+=o-t.createdMs}(o),te?.onEngineProcessStats(o,e.uri,s.stats,s.createdMs),setTimeout(()=>{se.delete(o)},re)}).on("error",e=>{const t=a.lastReceived?.command;n(ne(e.message,t))}).on("timeout",()=>n(oe(i))).on("bestmove",(e,t,n)=>{te?.onUSIBestMove(o,e,t,n)}).on("checkmate",(e,t)=>{te?.onUSICheckmate(o,e,t)}).on("checkmateNotImplemented",()=>{te?.onUSICheckmateNotImplemented(o)}).on("checkmateTimeout",e=>{te?.onUSICheckmateTimeout(o,e)}).on("noMate",e=>{te?.onUSINoMate(o,e)}).on("goEnd",e=>{!function(e,t){ce(e).stats.totalGoTimeMs+=t,le(e)}(o,e)}).on("checkmateEnd",e=>{!function(e,t){ce(e).stats.totalMateTimeMs+=t,le(e)}(o,e)}).on("usiok",()=>{t(o),function(e){ce(e).stats.runCount+=1}(o)}).on("command",e=>{te?.sendPromptCommand(o,e)}),a.launch()})}function de(e){const t=ce(e).process;return new Promise((o,n)=>{t.on("ready",t=>{o(),function(e,t){const o=ce(e);o.stats.gameCount+=1,o.stats.totalReadyTimeMs+=t}(e,t)}).on("error",e=>{const o=t.lastReceived?.command;n(ne(e.message,o))});const i=t.ready();if(i){const e=t.lastReceived?.command;n(ne(i.message,e))}})}function ue(e,t){const o=t.black,n=t.white,i=t[e].byoyomi;return{btime:o.timeMs-1e3*o.increment,wtime:n.timeMs-1e3*n.increment,byoyomi:1e3*i,binc:0===i?1e3*o.increment:0,winc:0===i?1e3*n.increment:0}}function me(e,t,o){te?.onUSIInfo(e,t,o),function(e,t){const o=ce(e);o.stats.maxNPS=Math.max(o.stats.maxNPS,t.nps??0),t.depth&&(!o.stats.maxDepth||o.stats.maxDepth<t.depth)&&(o.stats.maxDepth=t.depth,o.stats.maxDepthTimeMs=t.timeMs??0,o.stats.maxSelDepth=t.seldepth??t.depth),t.depth&&((o.statsTempData?.depth??0)<20&&t.depth>=20&&(o.stats.depth20Count+=1,o.stats.depth20TotalTimeMs+=t.timeMs??0),(o.statsTempData?.depth??0)<30&&t.depth>=30&&(o.stats.depth30Count+=1,o.stats.depth30TotalTimeMs+=t.timeMs??0),(o.statsTempData?.depth??0)<40&&t.depth>=40&&(o.stats.depth40Count+=1,o.stats.depth40TotalTimeMs+=t.timeMs??0),(o.statsTempData?.depth??0)<50&&t.depth>=50&&(o.stats.depth50Count+=1,o.stats.depth50TotalTimeMs+=t.timeMs??0)),o.stats.maxHashUsagePercent=Math.max(o.stats.maxHashUsagePercent,(t.hashfullPerMill??0)/10),o.statsTempData={nodes:t.nodes??o.statsTempData?.nodes,nps:t.nps??o.statsTempData?.nps,depth:Math.max(t.depth||0,o.statsTempData?.depth||0),hashfullPerMill:t.hashfullPerMill??o.statsTempData?.hashfullPerMill}}(e,o)}function pe(e,t,o){const n=ce(e),i=(0,k.getNextColorFromUSI)(t);n.process.go(t,ue(i,o)),n.process.on("info",(t,o)=>me(e,t,o)),function(e){const t=ce(e);t.stats.goCount+=1,t.statsTempData=void 0}(e)}function ge(e,t,o){const n=ce(e),i=(0,k.getNextColorFromUSI)(t);n.process.goPonder(t,ue(i,o)),n.process.on("info",(t,o)=>me(e,t,o)),function(e){const t=ce(e);t.stats.goPonderCount+=1,t.statsTempData=void 0}(e)}function Se(e,t){const o=ce(e);o.process.go(t),o.process.on("info",(t,o)=>me(e,t,o)),function(e){const t=ce(e);t.stats.goInfiniteCount+=1,t.statsTempData=void 0}(e)}function ye(e,t,o){const n=ce(e);n.process.goMate(t,o),n.process.on("info",(t,o)=>me(e,t,o)),function(e){const t=ce(e);t.stats.goMateCount+=1,t.statsTempData=void 0}(e)}function fe(e,t){const o=ce(e),n=(0,k.getNextColorFromUSI)(o.process.currentPosition);o.process.ponderHit(ue(n,t)),function(e){const t=ce(e);t.stats.ponderHitCount+=1,t.statsTempData=void 0}(e)}function Te(e,t){const o=ce(e);switch(t){case Z.q.WIN:o.process.gameover(q.WIN);break;case Z.q.LOSE:o.process.gameover(q.LOSE);break;case Z.q.DRAW:o.process.gameover(q.DRAW)}!function(e,t){const o=ce(e);switch(t){case Z.q.WIN:o.stats.winCount+=1;break;case Z.q.LOSE:o.stats.loseCount+=1;break;case Z.q.DRAW:o.stats.drawCount+=1}}(e,t)}function ve(e){if(!function(e){return se.has(e)}(e))return;ce(e).process.quit()}const Ce={updateAppState(){},fetchProcessArgs:async()=>"null",onClosable(){},onClose(){},onSendError(){},onSendMessage(){},onMenuEvent(){},async loadAppSettings(){throw new Error("This feature is not available on command line tool")},async saveAppSettings(){throw new Error("This feature is not available on command line tool")},async loadBatchConversionSettings(){throw new Error("This feature is not available on command line tool")},async saveBatchConversionSettings(){throw new Error("This feature is not available on command line tool")},async loadResearchSettings(){throw new Error("This feature is not available on command line tool")},async saveResearchSettings(){throw new Error("This feature is not available on command line tool")},async loadAnalysisSettings(){throw new Error("This feature is not available on command line tool")},async saveAnalysisSettings(){throw new Error("This feature is not available on command line tool")},async loadGameSettings(){throw new Error("This feature is not available on command line tool")},async saveGameSettings(){throw new Error("This feature is not available on command line tool")},async loadCSAGameSettingsHistory(){throw new Error("This feature is not available on command line tool")},async saveCSAGameSettingsHistory(){throw new Error("This feature is not available on command line tool")},async loadMateSearchSettings(){throw new Error("This feature is not available on command line tool")},async saveMateSearchSettings(){throw new Error("This feature is not available on command line tool")},async loadUSIEngines(){throw new Error("This feature is not available on command line tool")},async saveUSIEngines(){},async loadBookImportSettings(){throw new Error("This feature is not available on command line tool")},async saveBookImportSettings(){throw new Error("This feature is not available on command line tool")},onUpdateAppSettings(){},async showOpenRecordDialog(){throw new Error("This feature is not available on command line tool")},async showSaveRecordDialog(){throw new Error("This feature is not available on command line tool")},async showSaveMergedRecordDialog(){throw new Error("This feature is not available on command line tool")},async openRecord(){throw new Error("This feature is not available on command line tool")},async saveRecord(){throw new Error("This feature is not available on command line tool")},async loadRecordFileHistory(){throw new Error("This feature is not available on command line tool")},addRecordFileHistory(){},async clearRecordFileHistory(){},async saveRecordFileBackup(){},async loadRecordFileBackup(){throw new Error("This feature is not available on command line tool")},async loadRemoteTextFile(){throw new Error("This feature is not available on command line tool")},async convertRecordFiles(){throw new Error("This feature is not available on command line tool")},async showSelectSFENDialog(){throw new Error("This feature is not available on command line tool")},async loadSFENFile(){throw new Error("This feature is not available on command line tool")},onOpenRecord(){},async showOpenBookDialog(){throw new Error("This feature is not available on command line tool")},async showSaveBookDialog(){throw new Error("This feature is not available on command line tool")},async clearBook(){throw new Error("This feature is not available on command line tool")},async openBook(){throw new Error("This feature is not available on command line tool")},async openBookAsNewSession(){throw new Error("This feature is not available on command line tool")},async closeBookSession(){throw new Error("This feature is not available on command line tool")},async saveBook(){throw new Error("This feature is not available on command line tool")},async searchBookMoves(){throw new Error("This feature is not available on command line tool")},async updateBookMove(){throw new Error("This feature is not available on command line tool")},async removeBookMove(){throw new Error("This feature is not available on command line tool")},async updateBookMoveOrder(){throw new Error("This feature is not available on command line tool")},async importBookMoves(){throw new Error("This feature is not available on command line tool")},async showSelectUSIEngineDialog(){throw new Error("This feature is not available on command line tool")},async getUSIEngineInfo(){throw new Error("This feature is not available on command line tool")},async getUSIEngineMetadata(){throw new Error("This feature is not available on command line tool")},async sendUSIOptionButtonSignal(){},async usiLaunch(e,t){const o=JSON.parse(e),n=JSON.parse(t);return await he(o,n)},usiReady:async e=>await de(e),async usiSetOption(e,t,o){!function(e,t,o){ce(e).process.setOption(t,o)}(e,t,o)},async usiGo(e,t,o){pe(e,t,JSON.parse(o))},async usiGoPonder(e,t,o){ge(e,t,JSON.parse(o))},async usiPonderHit(e,t){fe(e,JSON.parse(t))},async usiGoInfinite(e,t){Se(e,t)},async usiGoMate(e,t,o){ye(e,t,o)},async usiStop(e){!function(e){ce(e).process.stop()}(e)},async usiGameover(e,t){Te(e,t)},async usiQuit(e){ve(e)},onUSIBestMove(){},onUSICheckmate(){},onUSICheckmateNotImplemented(){},onUSICheckmateTimeout(){},onUSINoMate(){},onUSIInfo(){},csaLogin:async e=>K(JSON.parse(e)),async csaLogout(e){!function(e){W.get(e)?.logout()}(e)},async csaAgree(e,t){!function(e,t){W.get(e)?.agree(t)}(e,t)},async csaMove(e,t,o,n){!function(e,t,o,n){W.get(e)?.doMove(t,o,n)}(e,t,o,n)},async csaResign(e){!function(e){W.get(e)?.resign()}(e)},async csaWin(e){!function(e){W.get(e)?.win()}(e)},async csaStop(e){!function(e){W.get(e)?.stop()}(e)},onCSAGameSummary(){},onCSAReject(){},onCSAStart(){},onCSAMove(){},onCSAGameResult(){},onCSAClose(){},async collectSessionStates(){throw new Error("This feature is not available on command line tool")},async setupPrompt(){throw new Error("This feature is not available on command line tool")},async openPrompt(){throw new Error("This feature is not available on command line tool")},invokePromptCommand(){throw new Error("This feature is not available on command line tool")},onPromptCommand(){},async showSelectImageDialog(){throw new Error("This feature is not available on command line tool")},async cropPieceImage(){throw new Error("This feature is not available on command line tool")},async exportCaptureAsPNG(){throw new Error("This feature is not available on command line tool")},async exportCaptureAsJPEG(){throw new Error("This feature is not available on command line tool")},async loadLayoutProfileList(){throw new Error("This feature is not available on command line tool")},updateLayoutProfileList(){},onUpdateLayoutProfile(){},createDesktopShortcutForLayoutProfile(){throw new Error("This feature is not available on command line tool")},openLogFile(){},log(e,t){switch(e){case n.$.DEBUG:console.debug(t);break;case n.$.INFO:console.log(t);break;case n.$.WARN:console.warn(t);break;case n.$.ERROR:console.error(t)}},async showSelectFileDialog(){throw new Error("This feature is not available on command line tool")},async showSelectDirectoryDialog(){throw new Error("This feature is not available on command line tool")},openExplorer(){throw new Error("This feature is not available on command line tool")},openWebBrowser(){throw new Error("This feature is not available on command line tool")},async getMachineSpec(){throw new Error("This feature is not available on command line tool")},isEncryptionAvailable:async()=>!1,async getVersionStatus(){throw new Error("This feature is not available on command line tool")},sendTestNotification(){throw new Error("This feature is not available on command line tool")},getPathForFile(){throw new Error("This feature is not available on command line tool")},onProgress(){}};global.window={...global,electronShogiAPI:Ce};const be=require("yaml");var Ee=o.n(be);class Pe{_settings={timeMs:0,byoyomi:0,increment:0};_timeMs=0;_byoyomi=0;_elapsedMs=0;timerHandle=0;timerStart=0;lastTimeMs=0;setup(e){this._settings=e,this._timeMs=e.timeMs||0,this._byoyomi=e.byoyomi||0,this._elapsedMs=0}get settings(){return this._settings}get time(){return Math.ceil(this._timeMs/1e3)}get timeMs(){return this._timeMs}get byoyomi(){return this._byoyomi}get elapsedMs(){return this._elapsedMs}start(){this.clearTimer(),this.timerStart=Date.now(),this.lastTimeMs=this._timeMs,this._byoyomi=this.settings.byoyomi||0,this._elapsedMs=0,this.timerHandle=window.setInterval(()=>{const e=this.timeMs,t=this.byoyomi;this._elapsedMs=Date.now()-this.timerStart;const o=this.lastTimeMs-this._elapsedMs;o>=0?this._timeMs=o:(this._timeMs=0,this._byoyomi=Math.max(Math.ceil((this.settings.byoyomi||0)+o/1e3),0)),0!==this.timeMs||0!==this.byoyomi?this.fireBeep(e,t):this.timeout()},100)}fireBeep(e,t){let o=Math.ceil(this.timeMs/1e3),n=Math.ceil(e/1e3);0!==o&&0!==this.byoyomi||(0!==o||0===n?(0!==this.byoyomi&&(o=this.byoyomi,n=t),o!==n&&(o<=5?this.settings.onBeepUnlimited&&this.settings.onBeepUnlimited():(o<=10||20===o||30===o||60===o)&&this.settings.onBeepShort&&this.settings.onBeepShort())):this.settings.onBeepShort&&this.settings.onBeepShort())}pause(){this.clearTimer()}stop(){this.clearTimer(),this.incrementTime()}timeout(){this.clearTimer(),this.settings.onTimeout?.()}clearTimer(){this.timerHandle&&(window.clearInterval(this.timerHandle),this.timerHandle=0),this.settings.onStopBeep?.()}incrementTime(){this._timeMs+=1e3*(this.settings.increment||0)}}var Ie=o(518),Ae=o(348),ke=o(154),Me=o(578),Ne=o(176),we=o(685);async function Re(e){try{return await d.promises.lstat(e),!0}catch{return!1}}var Oe=o(516);const Fe=new class{valueKeys=[];stringRestrictions=new Map;numberKeys=[];numberRestrictions=new Map;flagKeys=[];values=new Map;numbers=new Map;flags=new Map;bareArgs=[];help;constructor(e,t){"string"==typeof t&&(t=[t]),this.help="Usage:\n";for(const o of t||[""])this.help+=` ${e} [options] ${o}\n`;this.help+="\nOptions:\n"}value(e,t,o,n){const i="--"+e;return this.help+=` ${i} VALUE\n`,this.help+=` ${t}\n`,this.help+=` (default: ${o})\n`,this.valueKeys.push(i),n&&this.stringRestrictions.set(i,n),()=>{const e=this.values.get(i);return void 0!==e?e:o}}valueOrNull(e,t,o){const n="--"+e;return this.help+=` ${n} VALUE\n`,this.help+=` ${t}\n`,this.valueKeys.push(n),o&&this.stringRestrictions.set(n,o),()=>{const e=this.values.get(n);return void 0!==e?e:null}}number(e,t,o,n){const i="--"+e;return this.help+=` ${i} VALUE\n`,this.help+=` ${t}\n`,this.help+=` (default: ${o})\n`,this.numberKeys.push(i),n&&this.numberRestrictions.set(i,n),()=>{const e=this.numbers.get(i);return void 0!==e?e:o}}numberOrNull(e,t,o){const n="--"+e;return this.help+=` ${n} VALUE\n`,this.help+=` ${t}\n`,this.numberKeys.push(n),o&&this.numberRestrictions.set(n,o),()=>{const e=this.numbers.get(n);return void 0!==e?e:null}}flag(e,t){const o="--"+e;return this.help+=` ${o}\n`,this.help+=` ${t}\n`,this.flagKeys.push(o),()=>this.flags.get(o)||!1}parse(){let e=0;for(let t=2;t<process.argv.length;t++){const o=process.argv[t];if(t===e)this.bareArgs.push(o);else if(this.valueKeys.includes(o)){const e=process.argv[++t],n=this.stringRestrictions.get(o);n&&(n.includes(e)||this.onError(`${o} option must be one of: ${n.join(", ")}`)),this.values.set(o,e)}else if(this.numberKeys.includes(o)){const e=Number(process.argv[++t]);Number.isNaN(e)&&this.onError(`${o} option must be a number: ${process.argv[t]}`);const n=this.numberRestrictions.get(o);n?.min&&e<n.min&&this.onError(`${o} option must be greater than or equal to ${n.min}`),n?.max&&e>n.max&&this.onError(`${o} option must be less than or equal to ${n.max}`),this.numbers.set(o,e)}else this.flagKeys.includes(o)?this.flags.set(o,!0):"--"===o?e=t+1:"--help"===o?(this.showHelp(),process.exit(0)):o.startsWith("-")?this.onError(`Unknown option: ${o}`):this.bareArgs.push(o)}}get args(){return this.bareArgs}showHelp(){console.log(this.help)}onError(e){console.error(e),process.exit(1)}}("usi-csa-bridge",["path/to/csa_game_config.yaml","path/to/csa_game_config.json","--base64 <base64>"]),De=Fe.valueOrNull("base64","Base64 of gzip compressed JSON config."),Le=Fe.number("engine-timeout","Maximum time[seconds] of USI engine execution.",180,{min:1}),Be=Fe.valueOrNull("protocol-version","Overwrite server.protocolVersion setting."),Ue=Fe.valueOrNull("host","Overwrite server.host setting."),_e=Fe.numberOrNull("port","Overwrite server.port setting.",{min:1024,max:49151}),Ge=Fe.valueOrNull("id","Overwrite server.id setting."),He=Fe.valueOrNull("password","Overwrite server.password setting."),We=Fe.flag("save-record","Save record file after game end."),xe=Fe.value("record-dir","Directory to save records.","records"),Ke=Fe.valueOrNull("record-file-name-template","Overwrite recordFileNameTemplate setting."),$e=Fe.valueOrNull("record-file-format","Overwrite recordFileFormat setting."),Ve=Fe.value("return-code","Return code which one of LF or CRLF. It is used for record file.","win32"===process.platform?"CRLF":"LF",["LF","CRLF"]),Ye=Fe.flag("csa-v3","Use CSA V3 format for record file."),Je=Fe.numberOrNull("repeat","Overwrite repeat setting.",{min:1}),qe=Fe.flag("app-log-file","Enable application log file."),je=Fe.flag("usi-log-file","Enable USI log file."),ze=Fe.flag("csa-log-file","Enable CSA log file."),Xe=Fe.flag("all-log-file","Enable all log files."),Qe=Fe.flag("disable-stdout-log","Disable stdout log. Should be used with --XXX-log-file."),Ze=Fe.value("log-level",`Log level which one of: ${Object.values(n.$).join(", ")}`,n.$.INFO,[n.$.DEBUG,n.$.INFO,n.$.WARN,n.$.ERROR]),et=Fe.value("lang",`Language which one of: ${Object.values(i.TM).join(", ")}`,i.TM.JA,[i.TM.JA,i.TM.EN,i.TM.ZH_TW,i.TM.VI]);Fe.parse(),function(e){(0,i.xC)(e.language);const t=e.stdoutLog?["file","stdout"]:["file"],a=e.appLogFile?t:["stdout"],s=e.usiLogFile?t:["stdout"],r=e.csaLogFile?t:["stdout"];E(n.F.APP,a,e.logLevel),E(n.F.USI,s,e.logLevel),E(n.F.CSA,r,e.logLevel),re=0,function(e){x=e}(0),function(e){if(te)throw new Error("handlers already set");te=e}({...o(128),onEngineProcessStats:()=>{},sendPromptCommand:()=>{}}),function(e){if(G)throw new Error("handlers already set");G=e}({...o(348),sendPromptCommand:()=>{},sendError:e=>{A().error(e)}}),process.on("uncaughtException",(e,t)=>{A().error(new Error(`${t} ${e}`))})}({appLogFile:qe()||Xe(),usiLogFile:je()||Xe(),csaLogFile:ze()||Xe(),stdoutLog:!Qe(),logLevel:Ze(),language:et()}),async function(){const e=Fe.args[0];let t;const o=De();if(o?t=await(0,N.xv)(o):(e||(A().error("config file is not specified."),Fe.showHelp(),process.exit(1)),t=e.endsWith(".json")?JSON.parse(u().readFileSync(e,"utf-8")):Ee().parse(u().readFileSync(e,"utf-8"))),t.server.protocolVersion=Be()||t.server.protocolVersion,t.server.host=Ue()||t.server.host,t.server.port=_e()||t.server.port,t.server.id=Ge()||t.server.id,t.server.password=He()||t.server.password,t.saveRecordFile=We()||t.saveRecordFile,t.repeat=Je()||t.repeat,e&&!await Re(t.usi.path)){const o=s().resolve(s().dirname(e),t.usi.path);await Re(o)||(A().error(`usi engine is not found: ${t.usi.path}`),process.exit(1)),t.usi.path=o}const n=(0,N.$P)(t,{autoSaveDirectory:xe()}),i=(0,N.VX)(n);i&&(A().error(i),process.exit(1));const a=new Ie.B,r=new Pe,c=new Pe,l=new Ae.CSAGameManager(a,r,c),h=(0,ke.c)({timeoutSeconds:Le()});l.on("gameNext",function(){A().info("waiting for new game...")}).on("newGame",function(e){A().info(`${(0,we.IE)(e)} game started.`)}).on("closed",function(){A().info("completed. will exit after some seconds...")}).on("saveRecord",function(e){const o=(0,Me.OL)(a.record,{template:Ke()||t.recordFileNameTemplate||Oe.g,extension:$e()||t.recordFileFormat||Ne.vr.KIF}),n=s().join(e,o);u().promises.mkdir(e,{recursive:!0}).then(()=>{const e=a.exportRecordAsBuffer(n,{returnCode:d,csa:{v3:Ye()}});if(!(e instanceof Error))return u().promises.writeFile(n,e.data);A().error(e)}).then(()=>{A().info("record saved: %s",n)}).catch(e=>{A().error(e)})}).on("loginRetry",function(){A().warn(`Retry login after ${Ae.loginRetryIntervalSeconds} seconds...`)}).on("error",function(e){A().error(e)}).login(n,h).catch(function(e){A().error(e),process.exit(1)});const d="CRLF"===Ve()?"\r\n":"\n"}(),module.exports={}})();
|
|
2
|
+
(()=>{"use strict";var e={516(e,t,o){o.d(t,{D:()=>i,g:()=>n});const n="{datetime}{_title}{_sente}{_gote}";function i(e){return e.replaceAll(/[<>:"/\\|?*]/g,"_")}},176(e,t,o){o.d(t,{vr:()=>c,QT:()=>h,KM:()=>m,Nj:()=>u});var n=o(953),i=o.n(n);const[a,s]=[i().convert,i().detect];function r(e,t){const o=t?.autoDetect?function(e,t){return s(e)||t||"UTF8"}(e,t.encoding):t?.encoding;return"ASCII"===o||"UTF8"===o?(new TextDecoder).decode(e):a(e,{type:"string",from:o,to:"UNICODE"})}var c,l=o(113);function h(e){const t=e.toLowerCase();for(const e of Object.values(c))if(t.endsWith(e))return e}function d(e){switch(e){default:return"UTF8";case c.KIF:case c.KI2:return"SJIS"}}function u(e,t,o){const n=r(e,{encoding:d(t),autoDetect:o?.autoDetect});switch(t){case c.KIF:case c.KIFU:return(0,l.importKIF)(n);case c.KI2:case c.KI2U:return(0,l.importKI2)(n);case c.CSA:return(0,l.importCSA)(n);case c.SFEN:return new Error(".sfen file import is not supported");case c.JKF:return(0,l.importJKFString)(n)}}function m(e,t,o){const n=!o.useUTF8ForKifAndKi2||t!==c.KIF&&t!==c.KI2?d(t):"UTF8";let i;switch(t){case c.KIF:case c.KIFU:i=(0,l.exportKIF)(e,o);break;case c.KI2:case c.KI2U:i=(0,l.exportKI2)(e,o);break;case c.CSA:i=(0,l.exportCSA)(e,{...o,v3:o.csa?.v3?{milliseconds:!0}:void 0});break;case c.SFEN:throw new Error(".sfen file export is not supported");case c.JKF:i=(0,l.exportJKFString)(e)}const s=function(e,t){return"ASCII"===t||"UTF8"===t?(new TextEncoder).encode(e):new Uint8Array(a(e,{type:"arraybuffer",from:"UNICODE",to:t}))}(i,n);let h=!1;if("SJIS"===n&&o.detectGarbled){r(s,{encoding:"SJIS"})!==i&&(h=!0)}return{data:s,garbled:h}}!function(e){e.KIF=".kif",e.KIFU=".kifu",e.KI2=".ki2",e.KI2U=".ki2u",e.CSA=".csa",e.SFEN=".sfen",e.JKF=".jkf"}(c||(c={}))},690(e,t,o){o.d(t,{OW:()=>r,Rr:()=>s,j5:()=>i,kt:()=>n});var n,i,a=o(113);function s(){return{id:"",myColor:a.Color.BLACK,toMove:a.Color.BLACK,position:"",players:{black:{time:{timeUnitMs:1e3,totalTime:0,byoyomi:0,delay:0,increment:0}},white:{time:{timeUnitMs:1e3,totalTime:0,byoyomi:0,delay:0,increment:0}}}}}function r(){return{black:{time:0},white:{time:0}}}!function(e){e.UNKNOWN="unknown",e.RESIGN="resign",e.SENNICHITE="sennichite",e.OUTE_SENNICHITE="oute_sennichite",e.ILLEGAL_MOVE="illegal_move",e.ILLEGAL_ACTION="illegal_action",e.TIME_UP="time_up",e.JISHOGI="jishogi",e.MAX_MOVES="max_moves"}(n||(n={})),function(e){e.WIN="win",e.LOSE="lose",e.DRAW="draw",e.CENSORED="censored",e.CHUDAN="chudan"}(i||(i={}))},178(e,t,o){var n;o.d(t,{q:()=>n}),function(e){e.WIN="win",e.LOSE="lose",e.DRAW="draw"}(n||(n={}))},408(e,t,o){o.d(t,{X:()=>i,m:()=>n});const n=1e4;function i(e,t){const o=[],n=e.clone();for(const e of t){const t=n.createMoveByUSI(e);if(!t||!n.doMove(t))break;o.push(t)}return o}},789(e,t,o){function n(e=new Date){return e.toLocaleDateString("ja-JP",{year:"numeric",month:"2-digit",day:"2-digit"})}function i(e=new Date){return e.toLocaleTimeString("ja-JP",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function a(e=new Date){return i(e)+"."+String(e.getTime()%1e3).padStart(3,"0")}o.d(t,{ln:()=>i,ng:()=>a,sq:()=>n})},211(e,t,o){function n(e){return"/"===e||"\\"===e||/^[A-Za-z]:[\\/]{1}$/.test(e)?e:e.endsWith("\\")||e.endsWith("/")?e.slice(0,-1):e}o.d(t,{w:()=>n})},685(e,t,o){function n(e){switch(e%100){case 11:case 12:case 13:return e+"th"}switch(e%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd";default:return e+"th"}}o.d(t,{IE:()=>n})},1(e,t,o){var n;o.d(t,{TM:()=>n,cB:()=>g,xC:()=>S,t:()=>l}),function(e){e.JA="ja",e.EN="en",e.ZH_TW="zh_tw",e.VI="vi"}(n||(n={}));var i=o(685);const a={shogiHome:"ShogiHome",clear:"Clear",open:"Open",openNewInstance:"Open New ShogiHome Instance",saveOverwrite:"Overwrite",newRecord:"New Record",newRecordKeepInitialPosition:"New Record (Keep Initial Position)",newRecordHirateSetup:"New Record (Hirate Setup)",openRecord:"Open Record",saveRecord:"Save Record",saveRecordAs:"Save Record As",openAutoSaveDirectory:"Open Auto-Save Directory",exportPositionDiagram:"Export Position Diagram",positionImage:"Position Image",batchConversion:"Batch Conversion",recordFileBatchConversion:"Record File Batch Conversion",close:"Close",quit:"Quit",reload:"Reload",editing:"Edit",copyAsKIF:"Copy (KIF)",copyAsKI2:"Copy (KI2)",copyAsCSA:"Copy (CSA)",copyAsUSI:"Copy (USI)",copyAsSFEN:"Copy (SFEN)",copyAsBOD:"Copy (BOD)",copyAsJKF:"Copy (JKF)",copyAsUSEN:"Copy (USEN)",copy:"Copy",cut:"Cut",paste:"Paste",copyRecordAll:"Copy Record (All)",copyRecordFromCurrentPosition:"Copy Record (From Current Position)",asKIF:"As KIF",asKI2:"As KI2",asCSA:"As CSA",asUSI:"As USI",asUSIUntilCurrentMove:"As USI (Until Current Move)",asUSIAll:"As USI (All)",asJSONKifuFormat:"As JSON Kifu",asUSEN:"As USEN",copyPosition:"Copy Position",asSFEN:"SFEN",asBOD:"BOD",pasteRecordOrPosition:"Paste Record/Position",pasteRecordMerge:"Paste Record (Merge)",toRootPosition:"to Root Position",toCurrentPosition:"to Current Position",addSpecialMove:"Add Special Move",deleteMoves:"Delete Moves from Current Position",view:"View",openLayoutManager:"Open Layout Manager",openMonitorWindow:"Open Monitor Window",toggleFullScreen:"Toggle Full Screen",defaultFontSize:"Default Font Size",increaseFontSize:"Increase Font Size",decreaseFontSize:"Decrease Font Size",settings:"Settings",config:"Config",debug:"Debug",toggleDevTools:"Toggle DevTools",logFile:"Log File",openAppLog:"Open App Log",openUSILog:"Open USI Log",openCSALog:"Open CSA Log",tailAppLog:"Tail App Log",tailUSILog:"Tail USI Log",tailCSALog:"Tail CSA Log",copyAppLogTailCommand:"Copy App Log Tail Command",copyUSILogTailCommand:"Copy USI Log Tail Command",copyCSALogTailCommand:"Copy CSA Log Tail Command",reloadCustomPieceImage:"Reload Custom Piece Image",statisticsReport:"Statistics Report",launchUSIEngine:"Launch USI Engine",connectToCSAServer:"Connect to CSA Server",adminMode:"Admin Mode",inAdminModeManuallyInvokeCommandsAtPrompt:"In admin mode, manually invoke commands at the prompt.",setoptionAndPrecedingCommandsAreSentAutomatically:"'setoption' and preceding commands are sent automatically.",serverMustSupportShogiServerX1ModeLogIn:"Server must support shogi-server's x1 mode login.",folders:"Folders",notification:"Notification",notificationTest:"Test Notification",thisIsTestNotification:"This is a test notification.",app:"App",log:"Log",cache:"Cache",help:"Help",openWebsite:"Open Website",openUserGuide:"Open User Guide",openLatestReleasePage:"Open Latest Release Page",openStableReleasePage:"Open Stable Release Page",license:"License",inputs:"Inputs",outputs:"Outputs",format:"Format",formats:"Formats",subdirectories:"Subdirectories",separate:"Separate",merge:"Merge",createSubdirectories:"Create Subdirectories",nameConflictAction:"Name Conflict Action",numberSuffix:"Number Suffix",skip:"Skip",convert:"Convert",openLogFile:"Open Log File",success:"Success",failed:"Failed",skipped:"Skipped",game:"Game",player:"Player",server:"Server",selectFromHistory:"Select from History",noHistory:"Empty",saveHistory:"Save History",version:"Version",gameProgress:"Game Progress",allGamesCompleted:"All Games Completed",wins:"Wins",winsOnBlack:"Wins(Black)",winsOnWhite:"Wins(White)",draws:"Draws",validGames:"Valid Games",invalidGames:"Invalid Games",eloRatingDiff:"Elo Rating Diff",ignoreDraws:"Ignore Draws",zValue:"Z Value",significance5pc:"5% Significance",significance1pc:"1% Significance",gameEnded:"Game Ended",offlineGame:"Offline Game",csaOnlineGame:"CSA Online Game",csaProtocolOnlineGame:"Online Game (CSA Protocol)",csaProtocolV121:"CSA Protocol 1.2.1 Standard",csaProtocolV121WithPVComments:"CSA Protocol 1.2.1 with PV Comments",host:"Host",portNumber:"Port",password:"Password",revealPassword:"Reveal Password",keepaliveInitialDelay:"Keepalive Initial Delay",blankLinePing:"Blank Line Ping",blankLinePingInitialDelay:"Blank Line Ping Initial Delay",blankLinePingInterval:"Blank Line Ping Interval",logout:"Logout",calculateJishogiPoints:"Calculate Jishogi Points",jishogiPoints:"Jishogi Points",displayGameResults:"Display Game Results",interrupt:"Interrupt",stopGame:"Stop Game",resign:"Resign",draw:"Draw",impass:"Impass",repetitionDraw:"Repetition Draw",repetition:"Repetition",mate:"Mate",noMate:"No Mate",blackWin:"Black Win",whiteWin:"White Win",all:"All",others:"Others",minRate:"Min Rate",mateSearch:"Mate Search",startMateSearch:"Start Mate Search",stopMateSearch:"Stop Mate Search",noMateFound:"No mate.",timePerPosition:"Time per Position",timeout:"Timeout",foulWin:"Foul Win",foulLose:"Foul Lose",enteringOfKing:"Entering of King",winByDefault:"Win by Default",loseByDefault:"Lose by Default",winByDeclaration:"Win by Declaration",declareWin:"Declare Win",research:"Research",startResearch:"Start Research",endResearch:"End Research",startEndResearch:"Start/End Research",recordAnalysis:"Record Analysis",analysis:"Analyze",analyze:"Analyze",stopAnalysis:"Stop Analysis",searchDuplicatePositions:"Search Duplicate Positions",duplicatePositionSearch:"Duplicate Position Search",duplicatePositions:"Duplicate Positions",duplicatePos:"Duplicate",via:"Via",lastMove:"Last Move",nextMoves:"Next Moves",goToThisPosition:"Go to This Position",noDuplicatePositions:"No Duplicate Positions",nDuplicatePositionsFound:e=>`${e} Duplicate Positions Found`,appearanceCount:"Appearance Count",showList:"Show List",setupPosition:"Setup Position",startPositionSetup:"Start Position Setup",completePositionSetup:"Complete Setup",changeTurn:"Change Turn",initializePosition:"Initialize Position",changePieceSet:"Change Piece Set",setAllPiecesToStandardCounts:"Set All Pieces to Standard Counts",setAllPiecesToZero:"Set All Pieces to Zero",appSettings:"Preferences",language:"Languages",theme:"Theme",standard:"Standard",green:"Green",cherryBlossom:"Cherry Blossom",customImage:"Custom Image",autumn:"Autumn",snow:"Snow",classic:"Classic",beige:"Beige",darkGreen:"Dark Green",dark:"Dark",boardLayout:"Board Layout",compact:"Compact",portrait:"Portrait",piece:"Piece",singleKanjiPiece:"Single Kanji",singleKanjiWoodPiece:"Single Kanji (Wood)",singleKanjiGothicPiece:"Single Kanji (Gothic)",singleKanjiDarkPiece:"Single Kanji (Dark)",singleKanjiGothicDarkPiece:"Single Kanji (Gothic, Dark)",twoKanjiPiece:"Two Kanji",imageHasMarginsRemoveForLargerDisplay:"Image has margins (remove for larger display)",backgroundImage:"Background Image",board:"Board",pieceStand:"Piece Stand",woodTexture:"Wood Texture",lightWoodyTexture:e=>`Light Wood Texture (${e})`,warmWoodTexture:e=>`Warm Wood Texture (${e})`,resin:"Resin",transparent:"Transparent",boardOpacity:"Board Opacity",pieceStandOpacity:"Piece Stand Opacity",recordOpacity:"Record Opacity",promotionSelector:"Promotion Selector",centeredHorizontal:"Centered Horizontal",promoteFirstVertical:"Promote First Vertical",promoteFirstHorizontal:"Promote First Horizontal",enableDragAndDrop:"Drag & Drop",showFileAndRank:"Show File & Rank",showLeftControls:"Show Left Controls",showRightControls:"Show Right Controls",tabViewStyle:"Tab View Style",oneColumn:"1 Column",twoColumns:"2 Columns",sounds:"Sounds",pieceSoundVolume:"Piece Sound Volume",clockSoundVolume:"Clock Sound Volume",clockSoundPitch:"Clock Sound Pitch",clockSoundTarget:"Clock Sound Target",anyTurn:"Any",onlyHumanTurn:"Human",defaultRecordFileFormat:"Default Record Format",textEncoding:"Text Encoding",strict:"Strict",autoDetect:"Auto Detect",newlineCharacter:"Newline Character",old90sMac:"90's Mac",autoSaving:"Auto-Save",recordFileName:"Record File Name",select:"Select",shuffle:"Shuffle",csaV3Output:"CSA V3 Output",alwaysOutputUTF8:"Always Output UTF-8",someOldShogiAppsCannotReadUTF8KifFiles:"Some older Shogi applications may not be able to read KIF/KI2 files encoded in UTF-8.",strictDecodingMayFailToReadUTF8KifFiles:"When text encoding is set to Strict, loading KIF/KI2 files written in UTF-8 may fail.",positionOfUSIOutput:"Position of USI Output",movesOfUSIOutput:"Moves of USI Output",onlySFEN:"Only SFEN",minimal:"Minimal",pasteDialog:"Paste Dialog",liveDuplicatePositionDetection:"Live Duplicate Position Detection",onTheFlyThreshold:"On-the-fly Threshold",usiProtocol:"USI Protocol",translateOptionName:"Translate Option Name",functionalOnJapaneseOnly:"Functional on Japanese Only",maxStartupTime:"Max Startup Time",forDevelopers:"For Developers",enableAppLog:"Enable App Log",enableUSILog:"Enable USI Log",enableCSALog:"Enable CSA Log",logLevel:"Log Level",manageEngines:"Manage Engines",flipBoard:"Flip Board",elapsedTimeChart:"Elapsed Time Chart",controls:"Controls",useUpDownToMove1Ply:"Use ↑/↓ to Move 1 Ply",useLeftRightToMove1Ply:"Use ←/→ to Move 1 Ply",file:"File",folder:"Folder",recordFile:"Record File",executableFile:"Executable",imageFile:"Image",unsaved:"Unsaved",remove:"Remove",deleteMove:"Delete Move",recordProperties:"Record Properties",comments:"Comments",commentsAndBookmarks:"Comments & Bookmarks",branches:"Branches",branchListMode:"Branch List Mode",previousMoveBranches:"Sibling Branches",nextMoveBranches:"Next Move Branches",bookmark:"Bookmark",bookmarkList:"Bookmarks",useBookmarkAsHeader:"Use Bookmark as Header",moveComments:"Move Comments",searchLog:"Search Log",pv:"PV",mateShort:"M",displayPVShort:"Play",evaluation:"Evaluation",rawScore:"Raw Score",score:"Score",estimatedWinRate:"Estimated Win Rate",evaluationAndEstimatedWinRateAndPV:"Evaluation & Estimated Win Rate & PV",swapEachTurnChange:"Swap Each Turn Change",alwaysSenteIsPositive:"Always Sente is Positive",signOfEvaluation:"Sign of Evaluation",showArrowScore:"Show Score on Arrows",arrowScoreDiffRange:"Arrow Score Range",maxArrows:"Max Arrows",winRateCoefficient:"Win Rate Coefficient",nodeCountFormat:"Node Count Format",plainNumber:"Plain",commaSeparated:"Comma Separated",monitor:"Monitor",hideTabView:"Hide",expandTabView:"Expand Tab View",sente:"Sente",senteOrShitate:"Sente (Shitate)",shitate:"Shitate",gote:"Gote",goteOrUwate:"Gote (Uwate)",uwate:"Uwate",targetEngine:"Target Engine",baseEngine:"Base Engine",swapSenteGote:"Swap Sente/Gote",pieceToss:"Piece Toss",currentPosition:"Current Position",positionList:"Position List",enableEngineTimeout:"Enable Engine Timeout",setDifferentTimeForGote:"Set different time for Gote",nextTurn:"Next Move",elapsedTime:"Elapsed Time",elapsed:"Elapsed",rank:"Rank",depth:"Depth",searchEngine:"Search Engine",ponder:"Ponder",numberOfThreads:"Threads",threads:"Threads",suggestionsCount:"Suggestions Count",startPosition:"Position",beginFromThisPosition:"Begin from this position",maxMoves:"Max Moves",gameRepetition:"Repeat",parallelism:"Parallelism",parallelGame:"Parallel Game",jishogi:"Jishogi",rule24:"24-point rule",rule27:"27-point rule",tryRule:"TRY rule",autoRelogin:"Auto Re-Login",restartItEveryGame:"Restart it Every Game",swapTurnWhenGameRepetition:"Swap Turns When Repeat",outputComments:"Output Comments",saveRecordAutomatically:"Save Record Automatically",adjustBoardToHumanPlayer:"Adjust Board to Human Player",adjustBoardAutomatically:"Adjust Board Automatically",command:"Command",startGame:"Start Game",cancelGame:"Cancel Game",allottedTime:"Allotted Time",byoyomi:"Byoyomi",increments:"Increments",startEndCriteria:"Start/End Criteria",descending:"Descending",endCriteria1Move:"End Criteria for 1 Move",outputSettings:"Output Settings",noOutputs:"No Outputs",insertCommentToTop:"Insert to Top",appendCommentToBottom:"Append to Bottom",insertToComment:"Ins. to Comment",insertToRecord:"Ins. to Record",overwrite:"Overwrite",fromPrefix:"from",fromSuffix:"",toPrefix:"to",toSuffix:"",plyPrefix:"",plySuffix:"th move",hoursSuffix:"h",minutesSuffix:"min",secondsSuffix:"sec",eg:"e.g.",totalMoves:"Total Moves",detailSettings:"Detail Settings",engineManagement:"Engine Management",engineName:"Engine Name",author:"Author",earlyPonder:"Early Pondering",enginePath:"Engine Path",openDirectory:"Open Directory",replaceEnginePath:"Replace Engine Path",displayName:"Display Name",frontendBook:"Frontend Book",showAllOptions:"Show All Options",invoke:"Invoke",resetToEngineDefaultValues:"Reset to default values",defaultValue:"Default Value",freeTextUnsafe:"Free Text (Unsafe)",noEngineRegistered:"No engine",duplicate:"Copy",add:"Add",compareAndMerge:"Compare & Merge",compareEngineSettings:"Compare Engine Settings",noDifference:"No Difference",mergeToLeft:"Merge to Left",mergeToRight:"Merge to Right",recommended:"Recommended",import:"Import",saveAndClose:"Save & Close",save:"Save",saveAs:"Save As",history:"History",clearHistory:"Clear History",userFile:"User File",automaticBackup:"Automatic Backup",restore:"Restore",loadRecordFromWeb:"Load Record from Web",backToMainBranch:"Back to Main Branch",fetchLatestData:"Fetch Latest Data",sourceURL:"Source URL",ok:"OK",cancel:"Cancel",back:"Back",doNotShowAgain:"Do not show again",name:"Name",prediction:"Prediction",best:"Best",nodes:"Nodes",hashUsage:"Hash Usage",stop:"Stop",resume:"Resume",noHandicap:"No Handicap",lanceHandicap:"Lance Handicap",rightLanceHandicap:"Right Lance Handicap",bishopHandicap:"Bishop Handicap",rookHandicap:"Rook Handicap",rookLanceHandicap:"Rook-Lance Handicap",twoPiecesHandicap:"2 Pieces Handicap",fourPiecesHandicap:"4 Pieces Handicap",sixPiecesHandicap:"6 Pieces Handicap",eightPiecesHandicap:"8 Pieces Handicap",tenPiecesHandicap:"10 Pieces Handicap",tsumeShogi:"Tsume Shogi",doubleKingTsumeShogi:"2-Kings Tsume Shogi",startDateTime:"Start",endDateTime:"End",gameDate:"Date",tournament:"Tournament",strategy:"Strategy",gameTitle:"Title",timeLimit:"Time Limit",blackTimeLimit:"Time Limit (Sente)",whiteTimeLimit:"Time Limit (Gote)",place:"Place",postedOn:"Posted On",note:"Note",senteShortName:"Sente(short)",goteShortName:"Gote(short)",scorekeeper:"Scorekeeper",opusNo:"Opus No.",opusName:"Opus Name",publishedBy:"Published By",publishedOn:"Published On",source:"Source",numberOfMoves:"Number of Moves",integrity:"Integrity",recordCategory:"Category",award:"Award",filterByOptionName:"Filter by Option Name",filterByEngineName:"Filter by Engine Name",bookStyle:"Book Style",bookStyleDiagram:"Book Style Diagram",gameStyle:"Game Style",thin:"Thin",bold:"Bold",extraBold:"Extra Bold",playerName:"Player Name",typeface:"Typeface",weight:"Weight",handLabel:"Hand Label",header:"Header",vertical:"Vertical",size:"Size",none:"None",bgCover:"Cover",bgContain:"Contain",bgTile:"Tile",inaccuracy:"Inaccuracy",dubious:"Dubious",mistake:"Mistake",blunder:"Blunder",inaccuracyThreshold:"Inaccuracy Threshold",dubiousThreshold:"Dubious Threshold",mistakeThreshold:"Mistake Threshold",blunderThreshold:"Blunder Threshold",maxPVLength:"Max PV Length",commentFormat:"Comment Format",gothic:"Gothic",mincho:"Mincho",appVersion:"App Version",installed:"Installed",stable:"Stable",latest:"Latest",backgroundColor:"Background Color",dialogPosition:"Dialog Position",alignLeft:"Left",alignRight:"Right",alignCenter:"Center",dialogBackdrop:"Dialog Backdrop",record:"Record",book:"Book",bookInfo:"Book Information",resetBook:"Initialize Book",moveEvaluation:"Move Evaluation",forced:"Forced",goodMove:"Good",yane2016BookFile:"YaneuraOu Book File",shogiGUIBookFile:"ShogiGUI Book File",aperyBookFile:"Apery Book File",loadingMode:"Loading Mode",positionCount:"Position Count",chart:"Chart",analytics:"Analytics",controlGroup:"Control Group",left:"Left",top:"Top",width:"Width",height:"Height",newCustomProfile:"New Custom Profile",addCustomLayoutProfile:"Add Custom Layout Profile",duplicateCurrentProfile:"Duplicate Current Profile",removeCurrentProfile:"Remove Current Profile",exportProfileToClipboard:"Export Profile to Clipboard",importProfileFromClipboard:"Import Profile from Clipboard",editLayoutWithDragAndDrop:"Edit with Drag and Drop",profileExportedToClipboard:"Profile exported to clipboard.",profileImported:"Profile imported.",failedToImportProfile:"Failed to import profile.",rightControlBox:"Right Control Box",leftControlBox:"Left Control Box",topControlBox:"Top Control Box",legends:"Legends",historyMode:"History Mode",headers:"Headers",playButton:"Play Button",insert:"Insert",bringForward:"Bring Forward",sendBackward:"Send Backward",move:"Move",bookMove:"Book Move",play:"Play",edit:"Edit",addMoves:"Add Moves",export:"Export",flippedBook:"Flipped Book",addBookMoves:"Add Book Moves",fromCurrentRecord:"From Current Record",fromFile:"From File",fromDirectory:"From Directory",noMoves:"No Moves",register:"Register",update:"Update",importAll:"Register All",doYouWantToImportAllMoves:"Do you want to import all available moves?",importedMoves:e=>`Imported ${e} move(s).`,currentMove:"Current Move",branchFrom:e=>`Branch from ${e}th Move`,allPlayers:"All Players",blackPlayerOnly:"Black Player Only",whitePlayerOnly:"White Player Only",filterByName:"Filter by Name",importScoreFromComment:"Import scores from comments",enterPartOfPlayerNameHere:"Enter part of player name here",freq:"Freq.",frequency:"Frequency",new:"New",duplicated:"Duplicated",moveEntry:"Entry",updatedAt:"Updated At",createdAt:"Created At",lastSent:"Last Sent",lastReceived:"Last Received",protocolVersion:"Protocol Version",prompt:"Prompt",openPrompt:"Open Prompt",forceQuit:"Force Quit",forceClose:"Force Close",blankLine:"Blank Line",autoScroll:"Auto Scroll",showTimestamp:"Show Timestamp",highlightByPartialMatch:"Highlight by Partial Match",csaServer:"CSA Server",usiEngine:"USI Engine",noRunningUSIEngine:"No running USI engine.",noConnectedCSAServer:"No connected CSA server.",willBeRemovedFromTheListSoon:"This session is closed, will be removed from the list soon.",typeCommandHereAndPressEnter:"Type command here and press Enter.",allowBlankLine:"Allow Blank Line",removeSpaceFromBothEnds:"Remove Space from Both Ends",collapseSequentialSpaces:"Collapse Sequential Spaces",typeCustomTitleHere:"Type custom title here",displayEmptyElements:"Display Empty Elements",share:"Share",waitingForNewGame:"Waiting for new game.",waitingForPlayerSetup:"Waiting for player setup.",insertedComment:"Inserted comment.",conversionCompleted:"Conversion completed.",human:"Human",randomPlayer:"Random Player",beginner:"Beginner",staticRook:"Static Rook",rangingRook:"Ranging Rook",pleaseSelectEngines:"Please select engines.",thisItemCannotBeMerged:"This item cannot be merged.",tryingToConnectAndLoginToCSAServer:"Trying to connect and login to CSA server.",inBrowserLogsOutputToConsoleAndIgnoreThisSetting:"*In web browser version, it will output logs to console and ignore this setting.",shouldRestartToApplyLogSettings:"*You should restart this app to apply log settings.",canOpenLogDirectoryFromMenu:'*You can open log directory from "Debug" - "Open Log Directory" menu.',hasNoOldLogCleanUpFeature:"*This app has no clean-up feature. Please remove old logs manually.",shouldRestartToApplyLowLevelSettings:"*You should restart this app to apply low-level settings.",processingPleaseWait:"Processing, please wait.",importingFollowingRecordOrPosition:"Importing the following record(or position).",supportsKIF_KI2_CSA_USI_SFEN_JKF_USEN:"*Supports KIF, KI2, CSA, USI, SFEN, JKF, and USEN.",pleasePasteRecordIntoTextArea:"*Please paste record data into the text area.",pleaseSpecifyPlainTextURL:"*Please specify plain text URL.",redirectNotSupported:"*Redirect is not supported.",desktopVersionPastesAutomatically:"*In desktop version, it will paste automatically from clipboard.",asNewFile:"as New File",mergeToRootPosition:"Merge to Root Position",mergeToCurrentPosition:"Merge to Current Position",failedToMergeRecordWithDifferentInitialPosition:"Failed to merge record with different initial position.",failedToMergeRecordWithDifferentTurn:"Failed to merge record with different turn.",earlyPonderFeatureSendsPonderhitCommandWithYaneuraOusNonStandardOptions:'Early ponder feature sends "ponderhit" command with YaneuraOu\'s non-standard options.',ifYourEngineNotSupportTheOptionsItMayCauseUnexpectedBehavior:"If your engine does not support the options, it may cause unexpected behavior.",someLogsDisabled:"Some log settings are disabled.",logsRecommendedForCSAProtocol:"Log settings are recommended for CSA protocol.",blankLinePingRecommendedToPreventTimeout:"It is recommended to enable Blank Line Ping to prevent connection timeout.",pleaseEnableLogsAndRestart:"Please enable log settings and restart this app.",hwaEnabled:"HWA(Hardware Acceleration) Enabled",hwaIsNotRecommendedForLongGames:"HWA is not recommended for long games.",pleaseDisableHWAAndRestart:"Please disable HWA in app settings and restart this app.",notSendPVOnStandardCSAProtocol:"Client do not send PV on standard CSA protocol.",passwordWillSavedPlaintextBecauseOSSideEncryptionNotAvailable:"Password will saved as plaintext because OS side encryption is not available.",pleaseUncheckSaveHistoryIfNotWantSave:"Please uncheck Save History, if you don't want to save.",floodgatePasswordShouldStartWithGameName:"Floodgate's password should start with game name.",thisIsNotFloodgateOfficialGameName:"This is not Floodgate official game name.",yourPasswordDoesNotMeetFloodgateRequirementsDoYouStillWantToContinue:"Your password does not meet Floodgate's requirements. Do you still want to continue?",translationHelpNeeded:"We'd like your help to translate.",restartRequiredAfterLocaleChange:"You should restart this app to change the language.",createDesktopShortcut:"Create desktop shortcut",desktopShortcutCreated:"Desktop shortcut created.",areYouSureWantToResign:"Are you sure you want to resign?",areYouSureWantToDoDeclaration:"Are you sure you want to do declaration?",areYouSureWantToQuitGames:"Are you sure you want to quit games?",areYouSureWantToRequestQuit:"You have possibility to be loser. Are you sure you want to request quit?",areYouSureWantToClearRecord:"Are you sure you want to clear record?",areYouSureWantToDiscardPosition:"Are you sure you want to discard the position?",areYouSureWantToOpenFileInsteadOfCurrentRecord:"Are you sure you want to open the file instead of current record?",areYouSureWantToClearHistory:"Are you sure you want to clear history?",areYouSureWantToRemoveCurrentProfile:"Are you sure you want to remove current profile?",yamlFormatSettingsCopiedToClipboard:"YAML format settings copied to clipboard.",jsonFormatSettingsCopiedToClipboard:"JSON format settings copied to clipboard.",usiCsaBridgeCommandCopiedToClipboard:"usi-csa-bridge command copied to clipboard.",copiedToClipboard:"Copied to clipboard.",pastedFromClipboard:"Pasted from clipboard.",youCanNotCloseAppWhileCSAOnlineGame:"You cannot close app while CSA online game.",fileExtensionNotSupported:"File extension is not supported.",errorOccuredWhileDisconnectingFromCSAServer:"An error occured while disconnecting from CSA server.",failedToConnectToCSAServer:"Failed to connect to CSA server.",errorOccuredWhileLogoutFromCSAServer:"An error occured while logout from CSA server.",disconnectedFromCSAServer:"Disconnected from CSA server.",csaServerLoginDenied:"CSA server login denied.",thisFeatureNotAvailableOnWebApp:"This feature is not available on web app.",failedToStartNewGame:"Failed to start new game.",errorOccuredWhileEndingGame:"An error occured while ending game.",failedToSendGoCommand:"Failed to send go-command.",failedToSendPonderCommand:"Failed to send ponder-command.",failedToSendStopCommand:"Failed to send stop-command.",failedToShutdownEngines:"Failed to shutdown engines.",failedToCheckUpdates:"Failed to check updates.",failedToSaveRecord:"Failed to save record.",failedToParseSFEN:"Failed to parse SFEN.",failedToDetectRecordFormat:"Failed to detect record format.",unknown:"Unknown",unknownFileExtension:"Unknown file extension.",emptyRecordInput:"Empty record input.",invalidPieceName:"Invalid piece name",invalidTurn:"Invalid turn",invalidMove:"Invalid move",invalidMoveNumber:"Invalid move number",invalidDestination:"Invalid destination",pieceNotExists:"Piece not exists",invalidLine:"Invalid line",invalidBoard:"Invalid board",invalidHandPiece:"Invalid hand piece",invalidUSI:"Invalid USI",engineProcessWasClosedUnexpectedly:"The engine process was closed unexpectedly.",backgroundImageFileNotSelected:"Background image file is not selected.",pieceImageFileNotSelected:"Piece image file is not selected.",boardImageFileNotSelected:"Board image file is not selected.",pieceStandImageFileNotSelected:"Piece stand image file is not selected.",pieceSoundVolumeMustBe0To100Percent:"Piece sound volume must be 0% to 100%.",clockSoundVolumeMustBe0To100Percent:"Clock sound volume must be 0% to 100%.",clockSoundPitchMustBe220To880Hz:"Clock sound pitch must be 220Hz to 880Hz.",engineTimeoutMustBe1To300Seconds:"Engine timeout must be 1 to 300 seconds.",coefficientInSigmoidMustBeGreaterThan0:"Coefficient in sigmoid must be greater than 0.",inaccuracyThresholdMustBe1To100Percent:"Inaccuracy must be 1% to 100%.",dubiousThresholdMustBe1To100Percent:"Dubious threshold must be 1% to 100%.",mistakeThresholdMustBe1To100Percent:"Mistake threshold must be 1% to 100%.",blunderThresholdMustBe1To100Percent:"Blunder threshold must be 1% to 100%.",recordSavedWithGarbledCharacters:"The record has saved with some garbled characters.",pleaseConsiderToUseKIFU:"Please consider to use KIFU(UTF-8).",youCanChangeDefaultRecordFileFormatFromAppSettings:"You can change default record file format from App Settings.",inaccuracyThresholdMustBeLessThanDubiousThreshold:"Inaccuracy threshold must be less than dubious threshold.",dubiousThresholdMustBeLessThanMistakeThreshold:"Dubious threshold must be less than mistake threshold.",mistakeThresholdMustBeLessThanBlunderThreshold:"Mistake threshold must be less than blunder threshold.",thisEngineNotSupportsMateSearch:"This engine does not support mate search.",pleaseEndActiveFeaturesBeforeOpenRecord:"Please end active features before open record.",bothTimeLimitAndByoyomiAreNotSet:"Both time limit and byoyomi are not set.",canNotUseByoyomiWithFischer:"You cannot use Byoyomi with Fischer.",repeatsMustBeOneIfHumanPlayerIncluded:"The number of repeats must be 1, if a human player is included.",parallelismMustBeOneIfHumanPlayerIncluded:"Parallelism must be 1 if a human player is included.",parallelismMustBeOneIfCurrentPositionIsUsed:"Parallelism must be 1 if current position is used.",parallelismMustLessThanOrEqualToRepeats:"Parallelism must be less than or equal to the number of repeats.",protocolVersionNotSelected:"Protocol version is not selected.",hostNameIsEmpty:"Host name is empty.",invalidPortNumber:"Invalid port number.",idIsEmpty:"ID is empty.",idContainsSpace:"ID contains space.",passwordContainsSpace:"Password contains space.",tcpKeepaliveInitialDelayMustBePositive:"TCP keepalive initial delay must be positive.",blankLinePingInitialDelayMustBeGreaterThanOrEqualTo30:"Blank line ping initial delay must be >=30.",blankLinePingIntervalMustBeGreaterThanOrEqualTo30:"Blank line ping interval must be >=30.",engineNotSelected:"Engine is not selected.",forExportingConversionLogPleaseEnableAppLogsAndSetLogLevelDebugAndRestart:"For exporting conversion log, please enable app logs, set log level to DEBUG and restart this app.",sourceDirectoryNotSpecified:"Source directory is not specified.",sourceFileMustBeSFEN:"Source file must have a .sfen extension.",sourceFormatsNotSpecified:"Source formats are not specified.",destinationDirectoryNotSpecified:"Destination directory is not specified.",destinationFileNotSpecified:"Destination file is not specified.",anyUnsavedDataWillBeLostDoYouReallyWantToResetBookData:"Any unsaved data will be lost. Do you really want to reset book data?",bookMovesWereImported:"Book moves were imported.",anyBookMovesAreUnsavedDoYouReallyWantToDiscardThemAndCloseTheApp:"Any book moves are unsaved. Do you really want to discard them and close the app?",cannotOverwriteOnTheFlyBook:"On-the-fly books cannot be overwritten.",pleaseSpecifyOtherFileName:"Please specify another file name.",memoryShortageOnBookConversionMayLoseUnsavedData:"Memory shortage during book data conversion may cause loss of unsaved data.",cannotConvertAperyBookToOtherFormat:"Apery book cannot be converted to other formats.",sourceRecordFileNotSet:"Source record file is not set.",sourceDirectoryNotSet:"Source directory is not set.",minPlyMustBeLessThanMaxPly:"Min ply must be less than max ply.",playerNameNotSet:"Player name is not set.",incompatibleOptionsWillBeDiscardedDoYouReallyWantToReplaceTheEnginePath:"Incompatible options will be discarded. Do you really want to replace the engine path?",largeSuggestionsCountMayCausePerformanceDegradation:"Large suggestions count may cause performance degradation.",doYouReallyWantToIncreaseTheSuggestionsCount:"Do you really want to increase the suggestions count?",recommendLowerSettingsForDailyUse:"Recommend lower settings for daily use.",checkEngineCompatibilityForNumaEnvironments:"This machine may have multiple CPU sockets or processor groups (NUMA). Not all engines handle NUMA environments optimally. Please check whether your engine supports NUMA.",aiPerformanceMayDegrade:"AI performance may degrade.",yourPCMayBecomeSlow:"Your PC may become slow.",increasingItMayImproveAIPerformance:"Increasing it may improve AI performance.",totalNumber:e=>`Total: ${e}`,number:e=>""+e,tryToReloginToCSAServerNSecondsLater:e=>`Try to relogin to the CSA server in ${e} seconds.`,mateInNPlyDoYouWantToDisplay:e=>`Mate in ${e} ply. Do you want to display it?`,insertedNMovesToRecord:e=>`Inserted ${e} moves to the record.`,errorsOccurred:e=>e>=2?`${e} errors have occurred.`:`${e} error has occurred.`,between:(e,t)=>`between ${e} and ${t}`,addNthEngine:e=>`Add ${(0,i.IE)(e)} engine`,copyOf:e=>`${e} (copy)`,keepLatest:e=>`keep latest ${e}`,followingDataNotSavedBecauseNotSupporetedBy:e=>`The following data was not saved because it is not supporeted by "${e}".`,areYouSureWantToDeleteFollowingMove:e=>`Are you sure you want to delete th ${e}th move and the following moves?`,failedToOpenDirectory:e=>`Failed to open directory of the file: ${e}`,unexpectedEventSenderPleaseReport:e=>`Unexpected event sender. Please report this error message to developer. [${e}]`,unexpectedHTTPMethodPleaseReport:e=>`Unexpected HTTP method. Please report this error message to developer. [${e}]`,unexpectedRequestURLPleaseReport:e=>`Unexpected request URL. Please report this error message to developer. [${e}]`,noResponseFromEnginePleaseExtendTimeout:e=>`No response from the engine for ${e} seconds. Please extend the timeout in the app settings if your engine is slow.`,stableVersionReleased:e=>`Stable version ${e} released!`,latestVersionReleased:e=>`Latest version ${e} released!`,doYouReallyWantToRemoveBookMove:e=>`Do you really want to remove the book move "${e}"?`,unexpectedRecordFileExtension:e=>`Unexpected record file extension: [${e}]`,fileNotFound:e=>`File not found. [${e}]`,directoryNotFound:e=>`Directory not found. [${e}]`,youCanExitFullScreenByPressing:e=>`You can exit full screen by pressing ${e} key.`,skippedMovesInMerge:(e,t)=>`${e} / ${t} moves were skipped in the merge.`,cpuUsageExceedsNPercent:e=>`CPU usage exceeds ${e}%.`,totalNumberOfThreadsExceedsNPercentOfCpuCores:e=>`The total number of threads exceeds ${e}% of CPU cores.`,memoryUsageExceedsNPercent:e=>`Memory usage exceeds ${e}%.`,memoryUsageIsLessThanNPercent:e=>`Memory usage is less than ${e}%.`,totalUSIHashExceedsNPercentOfMemory:e=>`The total USI_Hash exceeds ${e}% of memory.`,heapUsageExceedsNGBMayHang:e=>`Memory usage has exceeded ${e} GB. If the upward trend continues, the app may hang.`},s={shogiHome:"ShogiHome",clear:"初期化",open:"開く",openNewInstance:"新しい ShogiHome ウィンドウを開く",saveOverwrite:"上書き保存",newRecord:"新規棋譜",newRecordKeepInitialPosition:"新規棋譜 (同じ初形)",newRecordHirateSetup:"新規棋譜(平手初形)",openRecord:"棋譜を開く",saveRecord:"棋譜を上書き保存",saveRecordAs:"棋譜を名前を付けて保存",openAutoSaveDirectory:"自動保存先を開く",exportPositionDiagram:"局面図を出力",positionImage:"局面図",batchConversion:"一括変換",recordFileBatchConversion:"棋譜ファイル一括変換",close:"閉じる",quit:"終了",reload:"再読み込み",editing:"編集",copyAsKIF:"コピー・KIF",copyAsKI2:"コピー・KI2",copyAsCSA:"コピー・CSA",copyAsUSI:"コピー・USI",copyAsSFEN:"コピー・SFEN",copyAsBOD:"コピー・BOD",copyAsJKF:"コピー・JKF",copyAsUSEN:"コピー・USEN",copy:"コピー",cut:"切り取り",paste:"貼り付け",copyRecordAll:"棋譜コピー(初手から)",copyRecordFromCurrentPosition:"棋譜コピー(現在の局面から)",asKIF:"KIF形式",asKI2:"KI2形式",asCSA:"CSA形式",asUSI:"USI形式",asUSIUntilCurrentMove:"USI形式(現在の指し手まで)",asUSIAll:"USI形式(全て)",asJSONKifuFormat:"JSON棋譜フォーマット",asUSEN:"USEN",copyPosition:"局面コピー",asSFEN:"SFEN形式",asBOD:"BOD形式",pasteRecordOrPosition:"棋譜・局面貼り付け",pasteRecordMerge:"棋譜貼り付け(マージ)",toRootPosition:"棋譜の先頭へ",toCurrentPosition:"現在の位置へ",addSpecialMove:"特殊な指し手",deleteMoves:"現在の位置から棋譜を削除",view:"表示",openLayoutManager:"レイアウトマネージャー",openMonitorWindow:"監視ウィンドウ",toggleFullScreen:"全画面表示切り替え",defaultFontSize:"標準の文字サイズ",increaseFontSize:"文字を拡大",decreaseFontSize:"文字を縮小",settings:"設定",config:"設定",debug:"デバッグ",toggleDevTools:"開発者ツール表示切り替え",logFile:"ログファイル",openAppLog:"アプリログを開く",openUSILog:"USI通信ログを開く",openCSALog:"CSA通信ログを開く",tailAppLog:"アプリログをTailする",tailUSILog:"USI通信ログをTailする",tailCSALog:"CSA通信ログをTailする",copyAppLogTailCommand:"アプリログのTailコマンドをコピー",copyUSILogTailCommand:"USI通信ログのTailコマンドをコピー",copyCSALogTailCommand:"CSA通信ログのTailコマンドをコピー",reloadCustomPieceImage:"カスタム駒画像をリロード",statisticsReport:"統計情報",launchUSIEngine:"USIエンジンを起動",connectToCSAServer:"CSAサーバーに接続",adminMode:"管理モード",inAdminModeManuallyInvokeCommandsAtPrompt:"管理モードではプロンプトから手動でコマンドを実行する必要があります。",setoptionAndPrecedingCommandsAreSentAutomatically:"setoptionコマンドまでのコマンドは自動で送信されます。",serverMustSupportShogiServerX1ModeLogIn:"サーバーは shogi-server の拡張モード (x1) ログインをサポートしている必要があります。",folders:"各種フォルダ",notification:"通知",notificationTest:"通知テスト",thisIsTestNotification:"これは通知のテストです。",app:"アプリ",log:"ログ",cache:"キャッシュ",help:"ヘルプ",openWebsite:"Webサイトを開く",openUserGuide:"使い方を開く",openLatestReleasePage:"最新版リリースページを開く",openStableReleasePage:"安定版リリースページを開く",license:"ライセンス",inputs:"入力",outputs:"出力",format:"フォーマット",formats:"フォーマット",subdirectories:"サブディレクトリ",separate:"個別",merge:"マージ",createSubdirectories:"サブディレクトリ作成",nameConflictAction:"名前衝突時の動作",numberSuffix:"番号付与",skip:"スキップ",convert:"変換",openLogFile:"ログファイルを開く",success:"成功",failed:"失敗",skipped:"スキップ",game:"対局",player:"プレイヤー",server:"サーバー",selectFromHistory:"履歴から選ぶ",noHistory:"履歴がありません",saveHistory:"履歴に保存する",version:"バージョン",gameProgress:"対局の経過",allGamesCompleted:"連続対局終了",wins:"勝ち数",winsOnBlack:"勝ち数(先手)",winsOnWhite:"勝ち数(後手)",draws:"引き分け",validGames:"有効対局数",invalidGames:"無効対局数",eloRatingDiff:"レーティング差",ignoreDraws:"引き分け無効",zValue:"Z値",significance5pc:"有意水準5%",significance1pc:"有意水準1%",gameEnded:"対局終了",offlineGame:"ローカル対局",csaOnlineGame:"通信対局(CSA)",csaProtocolOnlineGame:"通信対局(CSAプロトコル)",csaProtocolV121:"CSAプロトコル1.2.1 標準",csaProtocolV121WithPVComments:"CSAプロトコル1.2.1 読み筋コメント付き",host:"接続先ホスト",portNumber:"ポート番号",password:"パスワード",revealPassword:"パスワードを表示する",keepaliveInitialDelay:"Keepalive初期遅延",blankLinePing:"空行Ping",blankLinePingInitialDelay:"空行Ping初期遅延",blankLinePingInterval:"空行Ping間隔",logout:"ログアウト",calculateJishogiPoints:"持将棋の点数を計算",jishogiPoints:"持将棋の点数",displayGameResults:"戦績確認",interrupt:"中断",stopGame:"対局中断",resign:"投了",draw:"引き分け",impass:"持将棋",repetitionDraw:"千日手",repetition:"千日手",mate:"詰み",noMate:"不詰",blackWin:"先手勝ち",whiteWin:"後手勝ち",all:"全て",others:"その他",minRate:"最小レート",mateSearch:"詰み探索",startMateSearch:"詰み探索開始",stopMateSearch:"詰み探索終了",noMateFound:"詰みが見つかりませんでした。",timePerPosition:"思考時間",timeout:"時間切れ",foulWin:"反則勝ち",foulLose:"反則負け",enteringOfKing:"入玉勝ち",winByDefault:"不戦勝",loseByDefault:"不戦敗",winByDeclaration:"宣言勝ち",declareWin:"勝ち宣言",research:"検討",startResearch:"検討開始",endResearch:"検討終了",startEndResearch:"検討開始/終了",recordAnalysis:"棋譜解析",analysis:"解析",analyze:"解析開始",stopAnalysis:"解析中断",searchDuplicatePositions:"同一局面を検索",duplicatePositionSearch:"同一局面検索",duplicatePositions:"同一局面",duplicatePos:"同一局面",via:"経路",lastMove:"直前の指し手",nextMoves:"次の指し手",goToThisPosition:"この局面へ移動",noDuplicatePositions:"重複する局面はありません。",nDuplicatePositionsFound:e=>`${e} 件の重複する局面が見つかりました。`,appearanceCount:"出現数",showList:"一覧を表示",setupPosition:"局面編集",startPositionSetup:"局面編集開始",completePositionSetup:"局面編集終了",changeTurn:"手番変更",initializePosition:"局面の初期化",changePieceSet:"駒の増減",setAllPiecesToStandardCounts:"全ての駒を平手の枚数にする",setAllPiecesToZero:"全ての駒を0にする",appSettings:"アプリ設定",language:"言語",theme:"テーマ",standard:"標準",green:"緑",cherryBlossom:"桜",customImage:"カスタム画像",autumn:"紅葉",snow:"雪",classic:"クラシック",beige:"ベージュ",darkGreen:"深緑",dark:"ダーク",boardLayout:"盤レイアウト",compact:"コンパクト",portrait:"ポートレイト",piece:"駒",singleKanjiPiece:"一文字駒",singleKanjiWoodPiece:"一文字駒(木目)",singleKanjiGothicPiece:"一文字駒(ゴシック体)",singleKanjiDarkPiece:"一文字駒(ダーク)",singleKanjiGothicDarkPiece:"一文字駒(ゴシック体・ダーク)",twoKanjiPiece:"二文字駒",imageHasMarginsRemoveForLargerDisplay:"画像に余白が含まれている(除去して大きく表示)",backgroundImage:"背景画像",board:"盤",pieceStand:"駒台",woodTexture:"木目",lightWoodyTexture:e=>`木目(明${e})`,warmWoodTexture:e=>`木目(暖${e})`,resin:"樹脂",transparent:"透過表示",boardOpacity:"盤の不透明度",pieceStandOpacity:"駒台の不透明度",recordOpacity:"棋譜の不透明度",promotionSelector:"成・不成の表示",centeredHorizontal:"水平・中央寄せ",promoteFirstVertical:"垂直・成優先",promoteFirstHorizontal:"水平・成優先",enableDragAndDrop:"駒のドラッグ操作",showFileAndRank:"段・筋を表示",showLeftControls:"左側操作ボタンを表示",showRightControls:"右側操作ボタンを表示",tabViewStyle:"タブビューの形式",oneColumn:"1列",twoColumns:"2列",sounds:"音",pieceSoundVolume:"駒音の大きさ",clockSoundVolume:"時計音の大きさ",clockSoundPitch:"時計音の高さ",clockSoundTarget:"時計音の対象",anyTurn:"全ての手番",onlyHumanTurn:"人間の手番のみ",defaultRecordFileFormat:"デフォルトの保存形式",textEncoding:"文字コード",strict:"厳格",autoDetect:"自動判定",newlineCharacter:"改行文字",old90sMac:"90年代Mac",autoSaving:"自動保存",recordFileName:"棋譜ファイル名",select:"選択",shuffle:"シャッフル",csaV3Output:"CSA V3 で出力",alwaysOutputUTF8:"常に UTF-8 で出力",someOldShogiAppsCannotReadUTF8KifFiles:"一部の古い将棋アプリでは UTF-8 の KIF・KI2 ファイルを読み込めない場合があります。",strictDecodingMayFailToReadUTF8KifFiles:"文字コードの設定が「厳格」の場合、UTF-8 で書き出した KIF・KI2 ファイルの読み込みに失敗する可能性があります。",positionOfUSIOutput:"USI の局面表記",movesOfUSIOutput:"USI の指し手表記",onlySFEN:"SFEN のみ",minimal:"最小限",pasteDialog:"貼り付けダイアログ",liveDuplicatePositionDetection:"同一局面を常に検出",onTheFlyThreshold:"On-the-fly 閾値",usiProtocol:"USIプロトコル",translateOptionName:"オプション名を翻訳",functionalOnJapaneseOnly:"日本語選択時のみ有効",maxStartupTime:"最大起動待ち時間",forDevelopers:"開発者向け",enableAppLog:"アプリログを出力",enableUSILog:"USI通信ログを出力",enableCSALog:"CSA通信ログを出力",logLevel:"ログレベル",manageEngines:"エンジン設定",flipBoard:"盤面反転",elapsedTimeChart:"消費時間チャート",controls:"操作",useUpDownToMove1Ply:"↑/↓キーで1手移動",useLeftRightToMove1Ply:"←/→キーで1手移動",file:"ファイル",folder:"フォルダ",recordFile:"棋譜ファイル",executableFile:"実行可能ファイル",imageFile:"画像ファイル",unsaved:"未保存",remove:"削除",deleteMove:"指し手削除",recordProperties:"棋譜情報",comments:"コメント",commentsAndBookmarks:"コメント・しおり",branches:"分岐",branchListMode:"分岐の表示",previousMoveBranches:"着手した手",nextMoveBranches:"次の手",bookmark:"しおり",bookmarkList:"しおり一覧",useBookmarkAsHeader:"しおりを見出しに使う",moveComments:"指し手コメント",searchLog:"思考",pv:"読み筋",mateShort:"詰",displayPVShort:"再現",evaluation:"評価値",rawScore:"評価値",score:"評価値",estimatedWinRate:"期待勝率",evaluationAndEstimatedWinRateAndPV:"評価値・期待勝率・読み筋",swapEachTurnChange:"手番側有利がプラスの値",alwaysSenteIsPositive:"先手有利がプラスの値",signOfEvaluation:"評価値の符号",showArrowScore:"矢印に評価値を表示",arrowScoreDiffRange:"矢印の評価値範囲",maxArrows:"矢印の表示数",winRateCoefficient:"勝率換算係数",nodeCountFormat:"ノード数表記",plainNumber:"装飾無し",commaSeparated:"カンマ区切り",monitor:"監視",hideTabView:"最小化",expandTabView:"タブビューを再表示",sente:"先手",senteOrShitate:"先手(下手)",shitate:"下手",gote:"後手",goteOrUwate:"後手(上手)",uwate:"上手",targetEngine:"検査対象エンジン",baseEngine:"基準エンジン",swapSenteGote:"先後入れ替え",pieceToss:"振り駒",currentPosition:"現在の局面",positionList:"局面集",enableEngineTimeout:"エンジンの時間切れあり",setDifferentTimeForGote:"後手に異なる時間を設定",nextTurn:"次の手番",elapsedTime:"消費時間",elapsed:"経過時間",rank:"順位",depth:"深さ",searchEngine:"エンジン",ponder:"先読み(Ponder)",numberOfThreads:"スレッド数",threads:"スレッド",suggestionsCount:"候補手の数",startPosition:"開始局面",beginFromThisPosition:"この局面から開始",maxMoves:"最大手数",gameRepetition:"連続対局",parallelism:"並列数",parallelGame:"並列対局",jishogi:"持将棋",rule24:"24点法",rule27:"27点法",tryRule:"トライルール",autoRelogin:"自動で再ログインする",restartItEveryGame:"1局ごとに再起動する",swapTurnWhenGameRepetition:"1局ごとに手番を入れ替える",outputComments:"コメントを出力する",saveRecordAutomatically:"棋譜を自動で保存する",adjustBoardToHumanPlayer:"人を手前に表示する",adjustBoardAutomatically:"盤面の向きを自動調整",command:"コマンド",startGame:"対局開始",cancelGame:"対局をキャンセル",allottedTime:"持ち時間",byoyomi:"秒読み",increments:"増加",startEndCriteria:"開始・終了条件",descending:"逆順",endCriteria1Move:"局面ごとの終了条件",outputSettings:"出力設定",noOutputs:"出力しない",insertCommentToTop:"前方に加筆する",appendCommentToBottom:"末尾に加筆する",insertToComment:"コメントに挿入",insertToRecord:"棋譜に挿入",overwrite:"上書きする",fromPrefix:"",fromSuffix:"から",toPrefix:"",toSuffix:"まで",plyPrefix:"",plySuffix:"手目",hoursSuffix:"時間",minutesSuffix:"分",secondsSuffix:"秒",eg:"例:",totalMoves:"総手数",detailSettings:"詳細設定",engineManagement:"エンジン管理",engineName:"エンジン名",author:"作者",earlyPonder:"早期Ponder",enginePath:"場所",openDirectory:"フォルダを開く",replaceEnginePath:"エンジン再選択",displayName:"表示名",frontendBook:"定跡 (GUI拡張)",showAllOptions:"全てのオプションを表示",invoke:"実行",resetToEngineDefaultValues:"エンジンの既定値に戻す",defaultValue:"既定値",freeTextUnsafe:"自由入力(非推奨)",noEngineRegistered:"エンジンが登録されていません。",duplicate:"複製",add:"追加",compareAndMerge:"比較・マージ",compareEngineSettings:"エンジン設定の比較",noDifference:"差分なし",mergeToLeft:"左へマージ",mergeToRight:"右へマージ",recommended:"推奨",import:"取り込む",saveAndClose:"保存して閉じる",save:"保存",saveAs:"保存",history:"履歴",clearHistory:"履歴をクリア",userFile:"ユーザーのファイル",automaticBackup:"自動バックアップ",restore:"復元",loadRecordFromWeb:"Webの棋譜を取得",backToMainBranch:"本譜に戻る",fetchLatestData:"最新データを取得",sourceURL:"ソースURL",ok:"OK",cancel:"キャンセル",back:"戻る",doNotShowAgain:"次回から表示を省略",name:"名前",prediction:"予想",best:"最善",nodes:"Node数",hashUsage:"Hash使用率",stop:"停止",resume:"再開",noHandicap:"平手",lanceHandicap:"香落ち",rightLanceHandicap:"右香落ち",bishopHandicap:"角落ち",rookHandicap:"飛車落ち",rookLanceHandicap:"飛車香落ち",twoPiecesHandicap:"二枚落ち",fourPiecesHandicap:"四枚落ち",sixPiecesHandicap:"六枚落ち",eightPiecesHandicap:"八枚落ち",tenPiecesHandicap:"十枚落ち",tsumeShogi:"詰将棋",doubleKingTsumeShogi:"双玉詰将棋",startDateTime:"開始日時",endDateTime:"終了日時",gameDate:"対局日",tournament:"棋戦",strategy:"戦型",gameTitle:"表題",timeLimit:"持ち時間",blackTimeLimit:"先手の持ち時間",whiteTimeLimit:"後手の持ち時間",place:"場所",postedOn:"掲載",note:"備考",senteShortName:"先手省略名",goteShortName:"後手省略名",scorekeeper:"記録係",opusNo:"作品番号",opusName:"作品名",publishedBy:"発表誌",publishedOn:"発表年月",source:"出典",numberOfMoves:"手数",integrity:"完全性",recordCategory:"分類",award:"受賞",filterByOptionName:"オプション名で検索",filterByEngineName:"エンジン名で検索",bookStyle:"書籍風",bookStyleDiagram:"書籍風局面図",gameStyle:"対局画面風",thin:"細",bold:"太",extraBold:"極太",playerName:"対局者名",typeface:"書体",weight:"太さ",handLabel:"持ち駒ラベル",header:"見出し",vertical:"垂直方向",size:"サイズ",none:"なし",bgCover:"1枚で表示",bgContain:"拡大して表示",bgTile:"タイル状に表示",inaccuracy:"緩手",dubious:"疑問手",mistake:"悪手",blunder:"大悪手",inaccuracyThreshold:"緩手の閾値",dubiousThreshold:"疑問手の閾値",mistakeThreshold:"悪手の閾値",blunderThreshold:"大悪手の閾値",maxPVLength:"読み筋表示手数",commentFormat:"コメントの形式",gothic:"ゴシック体",mincho:"明朝体",appVersion:"アプリバージョン",installed:"インストール済み",stable:"安定版",latest:"最新版",backgroundColor:"背景色",dialogPosition:"ダイアログ表示位置",alignLeft:"左",alignRight:"右",alignCenter:"中央",dialogBackdrop:"ダイアログ表示中の暗転",record:"棋譜",book:"定跡",bookInfo:"定跡の情報",resetBook:"定跡の初期化",moveEvaluation:"指し手評価",forced:"絶対手",goodMove:"好手",yane2016BookFile:"やねうら王定跡ファイル",shogiGUIBookFile:"ShogiGUI 定跡ファイル",aperyBookFile:"Apery 定跡ファイル",loadingMode:"読み込みモード",positionCount:"局面数",chart:"グラフ",analytics:"解析",controlGroup:"メニュー",left:"左",top:"上",width:"幅",height:"高さ",newCustomProfile:"新規カスタムプロファイル",addCustomLayoutProfile:"新規レイアウトプロファイル",duplicateCurrentProfile:"現在のプロファイルを複製",removeCurrentProfile:"現在のプロファイルを削除",exportProfileToClipboard:"プロファイルをクリップボードに出力",importProfileFromClipboard:"クリップボードからプロファイルを取り込む",editLayoutWithDragAndDrop:"ドラッグで編集",profileExportedToClipboard:"プロファイルをクリップボードに出力しました。",profileImported:"プロファイルを取り込みました。",failedToImportProfile:"プロファイルの取り込みに失敗しました。",rightControlBox:"右側メニュー",leftControlBox:"左側メニュー",topControlBox:"操作ボタン",legends:"凡例",historyMode:"履歴モード",headers:"ヘッダー",playButton:"再現ボタン",insert:"挿入",bringForward:"前面へ",sendBackward:"背面へ",move:"指し手",bookMove:"定跡手",play:"着手",edit:"編集",addMoves:"指し手追加",export:"エクスポート",flippedBook:"反転も検索",addBookMoves:"定跡手追加",fromCurrentRecord:"現在の棋譜から",fromFile:"ファイルから",fromDirectory:"フォルダから",noMoves:"指し手がありません。",register:"登録",update:"更新",importAll:"全て反映",doYouWantToImportAllMoves:"全ての手を反映しますか?",importedMoves:e=>`${e}手を定跡に反映しました。`,currentMove:"現在の手",branchFrom:e=>`${e}手目から分岐`,allPlayers:"全ての対局者",blackPlayerOnly:"先手のみ",whitePlayerOnly:"後手のみ",filterByName:"名前でフィルタ",importScoreFromComment:"コメントから評価値を取り込む",enterPartOfPlayerNameHere:"ここに対局者名の一部を入力",freq:"出現頻度",frequency:"出現頻度",new:"新規",duplicated:"重複",moveEntry:"登録手数",updatedAt:"更新日時",createdAt:"作成日時",lastSent:"最終送信",lastReceived:"最終受信",protocolVersion:"プロトコルバージョン",prompt:"プロンプト",openPrompt:"プロンプトを開く",forceQuit:"強制Quit",forceClose:"強制Close",blankLine:"空行",autoScroll:"自動スクロール",showTimestamp:"タイムスタンプを表示",highlightByPartialMatch:"部分一致でハイライト",csaServer:"CSAサーバー",usiEngine:"USIエンジン",noRunningUSIEngine:"稼働中のUSIエンジンはありません。",noConnectedCSAServer:"接続中のCSAサーバーはありません。",willBeRemovedFromTheListSoon:"セッションが終了したため、まもなく一覧から削除されます。",typeCommandHereAndPressEnter:"コマンドを入力してEnter",allowBlankLine:"空行を許可",removeSpaceFromBothEnds:"両端の空白を削除",collapseSequentialSpaces:"連続する空白をまとめる",typeCustomTitleHere:"ここに見出しを入力",displayEmptyElements:"未入力の項目を表示",share:"シェア",waitingForNewGame:"対局開始を待っています。",waitingForPlayerSetup:"対局者の準備を待っています。",insertedComment:"コメントを挿入しました。",conversionCompleted:"変換が完了しました。",human:"人",randomPlayer:"ランダムプレイヤー",beginner:"初心者",staticRook:"居飛車",rangingRook:"振り飛車",pleaseSelectEngines:"エンジンを選択してください。",thisItemCannotBeMerged:"この項目はマージできません。",tryingToConnectAndLoginToCSAServer:"CSAサーバーへの接続とログインを試みています。",inBrowserLogsOutputToConsoleAndIgnoreThisSetting:"※ブラウザ版ではログがコンソールに出力され、ここでの設定は無視されます。",shouldRestartToApplyLogSettings:"※ログ設定の変更を反映するにはアプリの再起動が必要です。",canOpenLogDirectoryFromMenu:"※ログの出力先は「デバッグ」-「ログファイルの場所を開く」で開きます。",hasNoOldLogCleanUpFeature:"※現在、古いログファイルの自動削除機能はありません。",shouldRestartToApplyLowLevelSettings:"※低レベルの設定を反映するにはアプリの再起動が必要です。",processingPleaseWait:"処理中です。お待ちください。",importingFollowingRecordOrPosition:"以下の棋譜(または局面)を取り込みます。",supportsKIF_KI2_CSA_USI_SFEN_JKF_USEN:"※KIF形式/KI2形式/CSA形式/USI/SFEN/JKF/USENに対応しています。",pleasePasteRecordIntoTextArea:"※テキストエリアに棋譜を貼り付けてください。",pleaseSpecifyPlainTextURL:"※プレーンテキストのURLを指定してください。",redirectNotSupported:"※リダイレクトはサポートされていません。",desktopVersionPastesAutomatically:"※インストールアプリ版では自動的に貼り付けられます。",asNewFile:"新規ファイル",mergeToRootPosition:"棋譜の先頭へマージ",mergeToCurrentPosition:"現在の位置へマージ",failedToMergeRecordWithDifferentInitialPosition:"初期局面が異なるため棋譜をマージできませんでした。",failedToMergeRecordWithDifferentTurn:"手番が異なるため棋譜をマージできませんでした。",earlyPonderFeatureSendsPonderhitCommandWithYaneuraOusNonStandardOptions:"早期Ponder機能は、やねうら王の独自オプションでponderhitコマンドを送信します。",ifYourEngineNotSupportTheOptionsItMayCauseUnexpectedBehavior:"エンジンがこのオプションに対応していない場合、予期しない動作を引き起こす可能性があります。",someLogsDisabled:"一部のログが無効になっています。",logsRecommendedForCSAProtocol:"CSAプロトコルを使用した対局では各種ログの出力を推奨します。",blankLinePingRecommendedToPreventTimeout:"接続のタイムアウトを防止するために、空行 Ping を有効にすることを推奨します。",pleaseEnableLogsAndRestart:"アプリ設定からログを有効にしてアプリを再起動してください。",hwaEnabled:"HWA(ハードウェアアクセラレーション)が有効です。",hwaIsNotRecommendedForLongGames:"長時間の対局ではHWAの無効化を推奨します。",pleaseDisableHWAAndRestart:"アプリ設定からHWAを無効にしてアプリを再起動してください。",notSendPVOnStandardCSAProtocol:"標準のCSAプロトコルでは評価値や読み筋が送信されません。",passwordWillSavedPlaintextBecauseOSSideEncryptionNotAvailable:"OSの暗号化機能が利用できないため、入力したパスワードは平文で保存されます。",pleaseUncheckSaveHistoryIfNotWantSave:"保存したくない場合は「履歴に保存する」のチェックを外してください。",floodgatePasswordShouldStartWithGameName:"Floodgateのパスワードはゲーム名で始まる必要があります。",thisIsNotFloodgateOfficialGameName:"これはFloodgate公式のゲーム名ではありません。",yourPasswordDoesNotMeetFloodgateRequirementsDoYouStillWantToContinue:"パスワードがFloodgateの要件を満たしていない可能性があります。続行しますか?",translationHelpNeeded:"翻訳の改善にご協力ください。",restartRequiredAfterLocaleChange:"言語の変更には再起動が必要です。",createDesktopShortcut:"デスクトップにショートカットを作成",desktopShortcutCreated:"デスクトップにショートカットを作成しました。",areYouSureWantToResign:"投了しますか?",areYouSureWantToDoDeclaration:"宣言しますか?",areYouSureWantToQuitGames:"連続対局を中断しますか?",areYouSureWantToRequestQuit:"中断を要求すると負けになる可能性があります。よろしいですか?",areYouSureWantToClearRecord:"現在の棋譜は削除されます。よろしいですか?",areYouSureWantToDiscardPosition:"現在の局面は破棄されます。よろしいですか?",areYouSureWantToOpenFileInsteadOfCurrentRecord:"現在の棋譜を閉じて別のファイルを開きます。よろしいですか?",areYouSureWantToClearHistory:"履歴をクリアします。よろしいですか?",areYouSureWantToRemoveCurrentProfile:"現在のプロファイルを削除します。よろしいですか?",yamlFormatSettingsCopiedToClipboard:"YAML形式の設定をクリップボードにコピーしました。",jsonFormatSettingsCopiedToClipboard:"JSON形式の設定をクリップボードにコピーしました。",usiCsaBridgeCommandCopiedToClipboard:"usi-csa-bridge コマンドをクリップボードにコピーしました。",copiedToClipboard:"クリップボードにコピーしました。",pastedFromClipboard:"クリップボードから貼り付けました。",youCanNotCloseAppWhileCSAOnlineGame:"CSAプロトコル使用中はアプリを終了できません。",fileExtensionNotSupported:"取り扱いできないファイル拡張子です。",errorOccuredWhileDisconnectingFromCSAServer:"CSAサーバーからの切断中にエラーが発生しました。",failedToConnectToCSAServer:"CSAサーバーに接続できませんでした。",errorOccuredWhileLogoutFromCSAServer:"CSAサーバーからのログアウト中にエラーが発生しました。",disconnectedFromCSAServer:"CSAサーバーへの接続が切れました。",csaServerLoginDenied:"CSAサーバーへのログインが拒否されました。",thisFeatureNotAvailableOnWebApp:"Web版では利用できない機能です。",failedToStartNewGame:"対局の開始に失敗しました。",errorOccuredWhileEndingGame:"対局の終了中にエラーが発生しました。",failedToSendGoCommand:"goコマンドを送信できませんでした。",failedToSendPonderCommand:"ponderコマンドを送信できませんでした。",failedToSendStopCommand:"stopコマンドを送信できませんでした。",failedToShutdownEngines:"エンジンを正常に終了できませんでした。",failedToCheckUpdates:"アップデートの確認ができませんでした。",failedToSaveRecord:"棋譜の保存に失敗しました。",failedToParseSFEN:"SFENの読み込みに失敗しました。",failedToDetectRecordFormat:"棋譜形式を判別できませんでした。",unknown:"不明",unknownFileExtension:"不明なファイル形式です。",emptyRecordInput:"棋譜が入力されていません。",invalidPieceName:"不正な駒",invalidTurn:"不正な手番",invalidMove:"不正な指し手",invalidMoveNumber:"不正な手数",invalidDestination:"不正な移動先",pieceNotExists:"存在しない駒",invalidLine:"不正な行",invalidBoard:"不正な盤面",invalidHandPiece:"不正な持ち駒",invalidUSI:"不正なUSI",engineProcessWasClosedUnexpectedly:"エンジンプロセスが予期せず終了しました。",backgroundImageFileNotSelected:"背景画像のファイルが選択されていません。",pieceImageFileNotSelected:"駒画像のファイルが選択されていません。",boardImageFileNotSelected:"盤面画像のファイルが選択されていません。",pieceStandImageFileNotSelected:"駒台画像のファイルが選択されていません。",pieceSoundVolumeMustBe0To100Percent:"駒音の大きさには0%~100%の値を指定してください。",clockSoundVolumeMustBe0To100Percent:"時計音の大きさには0%~100%の値を指定してください。",clockSoundPitchMustBe220To880Hz:"時計音の高さには220Hz~880Hzの値を指定してください。",engineTimeoutMustBe1To300Seconds:"エンジンのタイムアウト時間には1秒~300秒の値を指定してください。",coefficientInSigmoidMustBeGreaterThan0:"勝率換算係数には0より大きい値を指定してください。",inaccuracyThresholdMustBe1To100Percent:"緩手には1%~100%の値を指定してください。",dubiousThresholdMustBe1To100Percent:"疑問手には1%~100%の値を指定してください。",mistakeThresholdMustBe1To100Percent:"悪手には1%~100%の閾値を指定してください。",blunderThresholdMustBe1To100Percent:"大悪手には1%~100%の値を指定してください。",recordSavedWithGarbledCharacters:"保存した棋譜の一部が文字化けしている可能性があります。",pleaseConsiderToUseKIFU:"KIFU形式(UTF-8)で保存することをお勧めします。",youCanChangeDefaultRecordFileFormatFromAppSettings:"デフォルトの棋譜形式はアプリ設定で変更可能です。",inaccuracyThresholdMustBeLessThanDubiousThreshold:"緩手には疑問手より小さい値を指定してください。",dubiousThresholdMustBeLessThanMistakeThreshold:"疑問手には悪手より小さい値を指定してください。",mistakeThresholdMustBeLessThanBlunderThreshold:"悪手には大悪手より小さい値を指定してください。",thisEngineNotSupportsMateSearch:"このエンジンは詰将棋探索をサポートしていません。",pleaseEndActiveFeaturesBeforeOpenRecord:"棋譜を開くには現在利用している機能を終了してください。",bothTimeLimitAndByoyomiAreNotSet:"持ち時間と秒読みが両方とも0です。",canNotUseByoyomiWithFischer:"秒読みとフィッシャールールは併用できません。",repeatsMustBeOneIfHumanPlayerIncluded:"人が対局する場合、連続対局の回数は1以外を設定できません。",parallelismMustBeOneIfHumanPlayerIncluded:"人が対局する場合、並列実行数は1以外を設定できません。",parallelismMustBeOneIfCurrentPositionIsUsed:"現在の局面を開始局面にする場合、並列実行数は1以外を設定できません。",parallelismMustLessThanOrEqualToRepeats:"並列実行数は連続対局の回数以下にしてください。",protocolVersionNotSelected:"プロトコルのバージョンを選択してください。",hostNameIsEmpty:"ホスト名が空です。",invalidPortNumber:"無効なポート番号です。",idIsEmpty:"IDが空です。",idContainsSpace:"IDに空白が含まれています。",passwordContainsSpace:"パスワードに空白が含まれています。",tcpKeepaliveInitialDelayMustBePositive:"TCP Keepaliveの初期遅延時間には正の値を指定してください。",blankLinePingInitialDelayMustBeGreaterThanOrEqualTo30:"空行送信の初期遅延時間には30秒以上を指定してください。",blankLinePingIntervalMustBeGreaterThanOrEqualTo30:"空行送信の間隔には30秒以上を指定してください。",engineNotSelected:"エンジンが選択されていません。",forExportingConversionLogPleaseEnableAppLogsAndSetLogLevelDebugAndRestart:"変換ログを出力するにはアプリログを有効にし、ログレベルをデバッグに設定してアプリを再起動してください。",sourceDirectoryNotSpecified:"入力ディレクトリが指定されていません。",sourceFileMustBeSFEN:"入力ファイルは .sfen 形式でなければなりません。",sourceFormatsNotSpecified:"入力の対象フォーマットが指定されていません。",destinationDirectoryNotSpecified:"出力ディレクトリが指定されていません。",destinationFileNotSpecified:"出力ファイルが指定されていません。",anyUnsavedDataWillBeLostDoYouReallyWantToResetBookData:"保存していない内容は失われます。定跡を初期化しますか?",bookMovesWereImported:"定跡データをインポートしました。",anyBookMovesAreUnsavedDoYouReallyWantToDiscardThemAndCloseTheApp:"保存されていない定跡があります。破棄してアプリを終了しますか?",cannotOverwriteOnTheFlyBook:"On-the-fly モードで読み込み中の定跡は上書き保存できません。",pleaseSpecifyOtherFileName:"別のファイル名を指定してください。",memoryShortageOnBookConversionMayLoseUnsavedData:"定跡データの変換中にメモリが不足すると保存していないデータは失われる可能性があります。",cannotConvertAperyBookToOtherFormat:"Apery 定跡は他の形式に変換できません。",sourceRecordFileNotSet:"棋譜ファイルが指定されていません。",sourceDirectoryNotSet:"フォルダを選択してください。",minPlyMustBeLessThanMaxPly:"最小手数は最大手数より小さくしてください。",playerNameNotSet:"対局者名が設定されていません。",incompatibleOptionsWillBeDiscardedDoYouReallyWantToReplaceTheEnginePath:"互換性のないオプションがある場合それらは破棄されます。エンジンを置き換えますか?",largeSuggestionsCountMayCausePerformanceDegradation:"候補手を増やしすぎると動作が重くなる可能性があります。",doYouReallyWantToIncreaseTheSuggestionsCount:"本当に候補手の数を増やしますか?",recommendLowerSettingsForDailyUse:"日常利用のPCでは低めの設定を推奨します。",checkEngineCompatibilityForNumaEnvironments:"このPCは複数のCPUソケットまたはプロセッサーグループ(NUMA)を持つ可能性があります。NUMA環境に対応していないエンジンでは性能が低下する場合があります。エンジンのNUMA対応状況をご確認ください。",aiPerformanceMayDegrade:"AIの性能が低下する可能性があります。",yourPCMayBecomeSlow:"PCの動作が重くなる可能性があります。",increasingItMayImproveAIPerformance:"大きくすることでAIの性能が向上する可能性があります。",totalNumber:e=>`合計 ${e} 件`,number:e=>`${e} 件`,tryToReloginToCSAServerNSecondsLater:e=>`CSAサーバーへのログインを${e}秒後に再試行します。`,mateInNPlyDoYouWantToDisplay:e=>`${e}手で詰みました。再生画面を表示しますか?`,insertedNMovesToRecord:e=>`${e}手を棋譜に挿入しました。`,errorsOccurred:e=>`${e} 種類のエラーが発生しました。`,between:(e,t)=>`${e} から ${t} まで`,addNthEngine:e=>`${e} 個目のエンジンを追加`,copyOf:e=>`${e} のコピー`,keepLatest:e=>`最新${e}件まで`,followingDataNotSavedBecauseNotSupporetedBy:e=>`以下の情報は ${e} 形式では対応していないため保存されませんでした。`,areYouSureWantToDeleteFollowingMove:e=>`${e}手目以降を削除します。よろしいですか?`,failedToOpenDirectory:e=>`ファイルの場所を開けませんでした: ${e}`,unexpectedEventSenderPleaseReport:e=>`予期せぬイベントの送信元です。このエラーメッセージを開発者に報告してください。 [${e}]`,unexpectedHTTPMethodPleaseReport:e=>`予期せぬHTTPメソッドです。このエラーメッセージを開発者に報告してください。 [${e}]`,unexpectedRequestURLPleaseReport:e=>`予期せぬURLへのリクエストです。このエラーメッセージを開発者に報告してください。 [${e}]`,noResponseFromEnginePleaseExtendTimeout:e=>`${e}秒以内にエンジンから応答がありませんでした。エンジンの起動が重い場合はアプリ設定で待ち時間を延長してください。`,stableVersionReleased:e=>`安定版 ${e} がリリースされました!`,latestVersionReleased:e=>`最新版 ${e} がリリースされました!`,doYouReallyWantToRemoveBookMove:e=>`定跡手 ${e} を削除します。よろしいですか?`,unexpectedRecordFileExtension:e=>`サポートされていない棋譜の拡張子です。 [${e}]`,fileNotFound:e=>`ファイルが見つかりません。 [${e}]`,directoryNotFound:e=>`フォルダが見つかりません。 [${e}]`,youCanExitFullScreenByPressing:e=>`全画面表示を終了するには ${e} キーを押してください。`,skippedMovesInMerge:(e,t)=>`${t}手中、${e}手がマージできませんでした。`,cpuUsageExceedsNPercent:e=>`全CPUコアの${e}%を超えています。`,totalNumberOfThreadsExceedsNPercentOfCpuCores:e=>`スレッド数の合計がCPUコア数の${e}%を超えています。`,memoryUsageExceedsNPercent:e=>`全メモリの${e}%を超えています。`,memoryUsageIsLessThanNPercent:e=>`全メモリの${e}%未満です。`,totalUSIHashExceedsNPercentOfMemory:e=>`USI_Hash の合計が全メモリの${e}%を超えています。`,heapUsageExceedsNGBMayHang:e=>`メモリ使用量が ${e}GB を超えました。増加傾向が続くとハングアップする可能性があります。`},r={shogiHome:"ShogiHome",clear:"清除",open:"開啟",openNewInstance:"開啟新的 ShogiHome 視窗",saveOverwrite:"覆蓋檔案",newRecord:"新棋譜",newRecordKeepInitialPosition:"新棋譜(保留初手局面)",newRecordHirateSetup:"新棋譜(平手初形)",openRecord:"打開棋譜",saveRecord:"保存棋譜",saveRecordAs:"另存棋譜",openAutoSaveDirectory:"打開自動保存目錄",exportPositionDiagram:"輸出局面圖",positionImage:"局面圖",batchConversion:"棋譜大量轉換",recordFileBatchConversion:"棋譜大量轉換",close:"關閉",quit:"離開",reload:"重新載入",editing:"編輯",copyAsKIF:"複製KIF棋譜",copyAsKI2:"複製KI2棋譜",copyAsCSA:"複製CSA棋譜",copyAsUSI:"複製USI棋譜",copyAsSFEN:"複製SFEN局面",copyAsBOD:"複製BOD局面",copyAsJKF:"複製JKF棋譜",copyAsUSEN:"複製USEN棋譜",copy:"拷貝",cut:"剪下",paste:"貼上",copyRecordAll:"複製棋譜(自初手局面)",copyRecordFromCurrentPosition:"複製棋譜(自目前局面)",asKIF:"KIF形式",asKI2:"KI2形式",asCSA:"CSA形式",asUSI:"USI形式",asUSIUntilCurrentMove:"USI形式(到目前手數為止)",asUSIAll:"USI形式(全部)",asJSONKifuFormat:"JSON Kifu Format",asUSEN:"USEN形式",copyPosition:"複製局面",asSFEN:"SFEN形式",asBOD:"BOD形式",pasteRecordOrPosition:"貼上棋譜、局面",pasteRecordMerge:"棋譜貼上(合併)",toRootPosition:"自棋譜開頭合併",toCurrentPosition:"自目前局面合併",addSpecialMove:"特殊手",deleteMoves:"刪除現在位置後的棋譜",view:"表示",openLayoutManager:"開啟佈局管理員",openMonitorWindow:"監視視窗",toggleFullScreen:"切換全螢幕",defaultFontSize:"預設字體尺寸",increaseFontSize:"增加字體尺寸",decreaseFontSize:"縮小字體尺寸",settings:"設定",config:"設定",debug:"偵錯",toggleDevTools:"打開/關閉開發者工具顯示",logFile:"紀錄檔",openAppLog:"開啟程式紀錄檔",openUSILog:"開啟USI通訊紀錄檔",openCSALog:"開啟CSA通訊紀錄檔",tailAppLog:"即時顯示程式紀錄",tailUSILog:"即時顯示USI通訊紀錄",tailCSALog:"即時顯示CSA通訊紀錄",copyAppLogTailCommand:"複製即時顯示程式紀錄指令",copyUSILogTailCommand:"複製即時顯示USI通訊紀錄指令",copyCSALogTailCommand:"複製即時顯示CSA通訊紀錄指令",reloadCustomPieceImage:"重整自訂棋駒圖片",statisticsReport:"統計情報",launchUSIEngine:"啟動USI引擎",connectToCSAServer:"連接CSA伺服器",adminMode:"管理模式",inAdminModeManuallyInvokeCommandsAtPrompt:"在管理模式下,您需要手動輸入指令方可執行。",setoptionAndPrecedingCommandsAreSentAutomatically:"setoption 之前的指令將會被自動發送。",serverMustSupportShogiServerX1ModeLogIn:"對應的 shogi-server 必須支援擴展 (x1) 登入模式。",folders:"資料夾",notification:"通知",notificationTest:"通知測試",thisIsTestNotification:"這是測試用的通知。",app:"軟體",log:"紀錄檔",cache:"快取",help:"協助",openWebsite:"官方網站",openUserGuide:"使用教學",openLatestReleasePage:"前往最新版發布頁面",openStableReleasePage:"前往安定版發布頁面",license:"授權條款",inputs:"輸入目錄",outputs:"輸出目錄",format:"格式",formats:"格式",subdirectories:"子目錄",separate:"個別",merge:"合併",createSubdirectories:"建立子目錄",nameConflictAction:"名稱衝突處理方式",numberSuffix:"附加編號",skip:"跳過該檔案",convert:"開始轉換",openLogFile:"打開記錄檔案",success:"成功",failed:"失敗",skipped:"跳過",game:"對局",player:"玩家",server:"伺服器",selectFromHistory:"從紀錄選取",noHistory:"目前沒有紀錄",saveHistory:"保存紀錄",version:"版本",gameProgress:"對局過程",allGamesCompleted:"連續對局結束",wins:"勝利數目",winsOnBlack:"勝場(先手)",winsOnWhite:"勝場(後手)",draws:"平手數目",validGames:"有效對局數",invalidGames:"無效對局數",eloRatingDiff:"等級分相差",ignoreDraws:"忽略平手對局",zValue:"Z值",significance5pc:"顯著性水準5%",significance1pc:"顯著性水準1%",gameEnded:"對局結束",offlineGame:"本地(單機)對局",csaOnlineGame:"通訊對局(CSA)",csaProtocolOnlineGame:"通訊對局(CSA協定)",csaProtocolV121:"CSA協定 1.2.1 標準",csaProtocolV121WithPVComments:"CSA協定 1.2.1 +思考註解",host:"連接之伺服器",portNumber:"連接埠號碼",password:"密碼",revealPassword:"顯示密碼",keepaliveInitialDelay:"Keepalive初始延遲",blankLinePing:"空行Ping",blankLinePingInitialDelay:"空行Ping初始延遲",blankLinePingInterval:"空行Ping間隔",logout:"登出",calculateJishogiPoints:"計算持將棋點數",jishogiPoints:"持將棋點數",displayGameResults:"確認戰績",interrupt:"中斷",stopGame:"對局中斷",resign:"投了",draw:"平手",impass:"持將棋",repetitionDraw:"千日手",repetition:"千日手",mate:"詰死",noMate:"無詰",blackWin:"先手勝利",whiteWin:"後手勝利",all:"全部",others:"其他",minRate:"最低等級分",mateSearch:"詰搜尋",startMateSearch:"開始詰搜尋",stopMateSearch:"結束詰搜尋",noMateFound:"在目前的盤面中找不到詰。",timePerPosition:"思考時間",timeout:"時間耗盡",foulWin:"反則勝利",foulLose:"反則敗北",enteringOfKing:"入玉勝利",winByDefault:"不戰勝",loseByDefault:"不戰敗",winByDeclaration:"勝利宣言",declareWin:"勝利宣言",research:"檢討",startResearch:"檢討開始",endResearch:"結束檢討",startEndResearch:"檢討開始/結束",recordAnalysis:"棋譜解析",analysis:"解析",analyze:"解析開始",stopAnalysis:"中斷解析",searchDuplicatePositions:"同一局面を検索",duplicatePositionSearch:"同一局面検索",duplicatePositions:"同一局面",duplicatePos:"同一局面",via:"経路",lastMove:"直前の指し手",nextMoves:"次の指し手",goToThisPosition:"この局面へ移動",noDuplicatePositions:"重複する局面はありません。",nDuplicatePositionsFound:e=>`${e} 件の重複する局面が見つかりました。`,appearanceCount:"出現数",showList:"一覧を表示",setupPosition:"編輯局面",startPositionSetup:"開始編輯局面",completePositionSetup:"結束編輯局面",changeTurn:"變更手番",initializePosition:"初始化局面",changePieceSet:"調整棋駒數",setAllPiecesToStandardCounts:"全ての駒を平手の枚数にする",setAllPiecesToZero:"全ての駒を0にする",appSettings:"程式設定",language:"語言",theme:"主題",standard:"標準",green:"綠色",cherryBlossom:"櫻花",customImage:"自定義圖片",autumn:"紅葉",snow:"雪",classic:"クラシック",beige:"ベージュ",darkGreen:"深綠",dark:"深色主題",boardLayout:"棋盤設計",compact:"緊湊",portrait:"直向",piece:"棋駒",singleKanjiPiece:"一文字駒",singleKanjiWoodPiece:"一文字駒(木目)",singleKanjiGothicPiece:"一文字駒(黑體)",singleKanjiDarkPiece:"一文字駒(深色)",singleKanjiGothicDarkPiece:"一文字駒(黑體・深色)",twoKanjiPiece:"二文字駒",imageHasMarginsRemoveForLargerDisplay:"圖片含有透明邊界(去除後圖片會略為放大)",backgroundImage:"背景圖片",board:"棋盤",pieceStand:"駒台",woodTexture:"木目",lightWoodyTexture:e=>`木目(亮色${e})`,warmWoodTexture:e=>`木目(暖色${e})`,resin:"樹脂",transparent:"透明",boardOpacity:"盤面不透明度",pieceStandOpacity:"駒台不透明度",recordOpacity:"棋譜不透明度",promotionSelector:"成變、不成對話框顯示",centeredHorizontal:"水平置中",promoteFirstVertical:"垂直(成變優先)",promoteFirstHorizontal:"水平(成變優先)",enableDragAndDrop:"駒のドラッグ操作",showFileAndRank:"顯示段・筋",showLeftControls:"顯示左側操作按鈕",showRightControls:"顯示右側操作按鈕",tabViewStyle:"分頁顯示形式",oneColumn:"1列",twoColumns:"2列",sounds:"音效",pieceSoundVolume:"棋駒音效",clockSoundVolume:"棋鐘音效大小",clockSoundPitch:"棋鐘音效頻率",clockSoundTarget:"棋鐘音效對象",anyTurn:"所有手番",onlyHumanTurn:"只有玩家手番",defaultRecordFileFormat:"預設保存格式",textEncoding:"文字編碼",strict:"檔案原始編碼",autoDetect:"自動判定",newlineCharacter:"換行符號",old90sMac:"90年代Mac",autoSaving:"自動保存",recordFileName:"棋譜檔案名稱",select:"選擇",shuffle:"隨機",csaV3Output:"使用 CSA V3 輸出",alwaysOutputUTF8:"常に UTF-8 で出力",someOldShogiAppsCannotReadUTF8KifFiles:"一部の古い将棋アプリでは UTF-8 の KIF・KI2 ファイルを読み込めない場合があります。",strictDecodingMayFailToReadUTF8KifFiles:"文字コードの設定が「厳格」の場合、UTF-8 で書き出した KIF・KI2 ファイルの読み込みに失敗する可能性があります。",positionOfUSIOutput:"USI 局面紀錄格式",movesOfUSIOutput:"USI 棋譜紀錄格式",onlySFEN:"只有 SFEN",minimal:"最小限",pasteDialog:"貼上視窗",liveDuplicatePositionDetection:"同一局面を常に検出",onTheFlyThreshold:"On-the-fly 閾値",usiProtocol:"USI協定",translateOptionName:"選項名稱翻譯",functionalOnJapaneseOnly:"只有在日文選擇時有效",maxStartupTime:"最大起動等待時間",forDevelopers:"開發者用",enableAppLog:"輸出程式紀錄",enableUSILog:"輸出USI通訊紀錄",enableCSALog:"輸出CSA通訊紀錄",logLevel:"紀錄等級",manageEngines:"引擎設定",flipBoard:"盤面反轉",elapsedTimeChart:"消費時間圖表",controls:"操作",useUpDownToMove1Ply:"使用↑/↓鍵移動1手",useLeftRightToMove1Ply:"使用←/→鍵移動1手",file:"檔案",folder:"フォルダ",recordFile:"棋譜檔案",executableFile:"可執行檔案",imageFile:"圖片檔案",unsaved:"未保存",remove:"刪除",deleteMove:"刪除該手",recordProperties:"棋譜情報",comments:"備註",commentsAndBookmarks:"備註・書籤",branches:"分支",branchListMode:"分岐の表示",previousMoveBranches:"着手した手",nextMoveBranches:"次の手",bookmark:"書籤",bookmarkList:"書籤一覽",useBookmarkAsHeader:"將書籤名稱作為標題",moveComments:"棋步備註",searchLog:"思考",pv:"預測手順",mateShort:"詰",displayPVShort:"再現",evaluation:"評價值",rawScore:"評價値",score:"評價値",estimatedWinRate:"期待勝率",evaluationAndEstimatedWinRateAndPV:"評價値・期待勝率・預測手順",swapEachTurnChange:"手番側有利時為正值",alwaysSenteIsPositive:"先手有利時為正值",signOfEvaluation:"評價值符號",showArrowScore:"矢印に評価値を表示",arrowScoreDiffRange:"矢印の評価値範囲",maxArrows:"箭頭顯示數量",winRateCoefficient:"勝率換算係數",nodeCountFormat:"節點數格式",plainNumber:"純數字",commaSeparated:"逗號分隔",monitor:"引擎監視",hideTabView:"最小化",expandTabView:"展開分頁",sente:"先手",senteOrShitate:"先手(下手)",shitate:"下手",gote:"後手",goteOrUwate:"後手(上手)",uwate:"上手",targetEngine:"検査対象エンジン",baseEngine:"基準エンジン",swapSenteGote:"先後交換",pieceToss:"振駒",currentPosition:"現在局面",positionList:"局面列表",enableEngineTimeout:"開啟引擎時間限制",setDifferentTimeForGote:"先後手時間不相同",nextTurn:"手番",elapsedTime:"消費時間",elapsed:"經過時間",rank:"順位",depth:"深度",searchEngine:"引擎",ponder:"對方手番時運算 (Ponder)",numberOfThreads:"執行緒數",threads:"スレッド",suggestionsCount:"候補手數量",startPosition:"開始局面",beginFromThisPosition:"自此局面開始",maxMoves:"最大手數",gameRepetition:"連續對局",parallelism:"並列数",parallelGame:"並列対局",jishogi:"持將棋",rule24:"24點法",rule27:"27點法",tryRule:"Try Rule",autoRelogin:"自動重新登入",restartItEveryGame:"每局重新啟動",swapTurnWhenGameRepetition:"每局交換手番",outputComments:"輸出備註",saveRecordAutomatically:"自動保存棋譜",adjustBoardToHumanPlayer:"調整到玩家所在方向",adjustBoardAutomatically:"自動調整盤面方向",command:"指令",startGame:"對局開始",cancelGame:"取消對局",allottedTime:"持時間",byoyomi:"讀秒",increments:"增秒",startEndCriteria:"開始・結束條件",descending:"倒序",endCriteria1Move:"局面結束條件",outputSettings:"輸出設定",noOutputs:"不輸出",insertCommentToTop:"加入到前方",appendCommentToBottom:"在後方新增",insertToComment:"加入到備註欄",insertToRecord:"加入到棋譜",overwrite:"覆寫原檔案",fromPrefix:"從",fromSuffix:"",toPrefix:"到",toSuffix:"",plyPrefix:"第",plySuffix:"手",hoursSuffix:"小時",minutesSuffix:"分",secondsSuffix:"秒",eg:"e.g.",totalMoves:"総手数",detailSettings:"詳細設定",engineManagement:"引擎管理",engineName:"引擎名稱",author:"作者",earlyPonder:"預先Ponder",enginePath:"場所",openDirectory:"開啟資料夾",replaceEnginePath:"重新選擇引擎",displayName:"表示名稱",frontendBook:"定跡 (GUI拡張)",showAllOptions:"全てのオプションを表示",invoke:"執行",resetToEngineDefaultValues:"回復至引擎預設設定",defaultValue:"預設値",freeTextUnsafe:"自由輸入(不建議)",noEngineRegistered:"尚未登錄引擎。",duplicate:"複製",add:"追加",compareAndMerge:"比較並合併",compareEngineSettings:"引擎設定比較",noDifference:"無更改",mergeToLeft:"合併至左側",mergeToRight:"合併至右側",recommended:"推薦",import:"匯入",saveAndClose:"保存並關閉",save:"保存",saveAs:"另存為",history:"歷史紀錄",clearHistory:"清除歷史紀錄",userFile:"使用者檔案",automaticBackup:"自動備份",restore:"復原",loadRecordFromWeb:"從網際網路取得棋譜",backToMainBranch:"回到本譜",fetchLatestData:"取得最新資料",sourceURL:"來源網址",ok:"OK",cancel:"取消",back:"返回",doNotShowAgain:"不再顯示",name:"名稱",prediction:"預測",best:"最善",nodes:"Node數",hashUsage:"Hash使用率",stop:"停止",resume:"重新開始",noHandicap:"平手",lanceHandicap:"香落",rightLanceHandicap:"右香落",bishopHandicap:"角落",rookHandicap:"飛車落",rookLanceHandicap:"飛車香落",twoPiecesHandicap:"二枚落",fourPiecesHandicap:"四枚落",sixPiecesHandicap:"六枚落",eightPiecesHandicap:"八枚落",tenPiecesHandicap:"十枚落",tsumeShogi:"詰將棋",doubleKingTsumeShogi:"雙玉詰將棋",startDateTime:"開始日時",endDateTime:"結束日時",gameDate:"對局日",tournament:"棋戰",strategy:"戰型",gameTitle:"標題",timeLimit:"限時",blackTimeLimit:"先手限時",whiteTimeLimit:"後手限時",place:"地點",postedOn:"登錄於",note:"備註",senteShortName:"先手省略名",goteShortName:"後手省略名",scorekeeper:"記錄員",opusNo:"作品編號",opusName:"作品名",publishedBy:"發表於",publishedOn:"發表年月",source:"來源",numberOfMoves:"手數",integrity:"完全性",recordCategory:"分類",award:"受賞",filterByOptionName:"搜尋設定名稱",filterByEngineName:"搜尋引擎名稱",bookStyle:"書籍風",bookStyleDiagram:"書籍風局面図",gameStyle:"對局畫面風",thin:"細",bold:"粗",extraBold:"特粗",playerName:"對局者名稱",typeface:"字體",weight:"字體粗細",handLabel:"持駒標題",header:"標題",vertical:"垂直調整",size:"大小",none:"無",bgCover:"圖片置中",bgContain:"擴大表示",bgTile:"磁磚狀表示",inaccuracy:"緩手",dubious:"疑問手",mistake:"惡手",blunder:"大惡手",inaccuracyThreshold:"緩手閾値",dubiousThreshold:"疑問手閾値",mistakeThreshold:"惡手閾値",blunderThreshold:"大惡手閾値",maxPVLength:"PV表示手數",commentFormat:"註解形式",gothic:"黑體",mincho:"明體",appVersion:"軟體版本",installed:"已安裝",stable:"安定版",latest:"最新版",backgroundColor:"背景顏色",dialogPosition:"對話窗顯示位置",alignLeft:"左側",alignRight:"右側",alignCenter:"置中",dialogBackdrop:"對話窗背景",record:"棋譜",book:"定跡",bookInfo:"定跡の情報",resetBook:"定跡の初期化",moveEvaluation:"指し手評価",forced:"絶対手",goodMove:"好手",yane2016BookFile:"やねうら王定跡ファイル",shogiGUIBookFile:"ShogiGUI 定跡ファイル",aperyBookFile:"Apery 定跡ファイル",loadingMode:"読み込みモード",positionCount:"局面数",chart:"圖表",analytics:"解析",controlGroup:"選單",left:"左方間隔",top:"上方間隔",width:"寬度",height:"高度",newCustomProfile:"新增佈局設定",addCustomLayoutProfile:"新增佈局設定",duplicateCurrentProfile:"複製目前佈局設定",removeCurrentProfile:"移除該佈局設定",exportProfileToClipboard:"將佈局設定複製至剪貼板",importProfileFromClipboard:"自剪貼板匯入佈局設定",editLayoutWithDragAndDrop:"ドラッグで編集",profileExportedToClipboard:"該佈局已複製至剪貼板。",profileImported:"該佈局已成功匯入。",failedToImportProfile:"佈局匯入失敗。",rightControlBox:"右側選單",leftControlBox:"左側選單",topControlBox:"操作按鈕",legends:"圖例",historyMode:"歷史模式",headers:"解析表頭",playButton:"再現按鈕",insert:"插入",bringForward:"移至前方",sendBackward:"移至後方",move:"著手",bookMove:"定跡手",play:"著手",edit:"編輯",addMoves:"新增該手",export:"エクスポート",flippedBook:"亦檢索先後逆局面",addBookMoves:"增加定跡手",fromCurrentRecord:"從現在棋譜",fromFile:"從檔案",fromDirectory:"從檔案目錄",noMoves:"沒有棋步。",register:"登錄",update:"更新",importAll:"全て反映",doYouWantToImportAllMoves:"全ての手を反映しますか?",importedMoves:e=>`${e}手を定跡に反映しました。`,currentMove:"目前棋步",branchFrom:e=>`自${e}手目分岐`,allPlayers:"所有對局者",blackPlayerOnly:"僅先手",whitePlayerOnly:"僅後手",filterByName:"使用名稱過濾",importScoreFromComment:"コメントから評価値を取り込む",enterPartOfPlayerNameHere:"輸入對局者名稱",freq:"出現次數",frequency:"出現次數",new:"新增",duplicated:"重複",moveEntry:"匯入手數",updatedAt:"更新時間",createdAt:"建立時間",lastSent:"最後送出",lastReceived:"最後接收",protocolVersion:"協定版本",prompt:"指令",openPrompt:"打開指令視窗",forceQuit:"強制退出",forceClose:"強制關閉",blankLine:"空行",autoScroll:"自動捲動",showTimestamp:"顯示時間戳章",highlightByPartialMatch:"反白部分一致部分",csaServer:"CSA伺服器",usiEngine:"USI引擎",noRunningUSIEngine:"目前沒有啟動中的USI引擎。",noConnectedCSAServer:"尚未連接CSA伺服器。",willBeRemovedFromTheListSoon:"由於 Session 結束,將會自一覽清除。",typeCommandHereAndPressEnter:"輸入指令後按下 Enter 以發送",allowBlankLine:"允許空行",removeSpaceFromBothEnds:"消除前後空白",collapseSequentialSpaces:"整理連續空白",typeCustomTitleHere:"輸入自定義標題",displayEmptyElements:"顯示未定義資料",share:"分享",waitingForNewGame:"正在等待下一場對局開始。",waitingForPlayerSetup:"正在等待對局者準備。",insertedComment:"已加入備註。",conversionCompleted:"轉換完成。",human:"人",randomPlayer:"隨機玩家",beginner:"初學者",staticRook:"居飛車",rangingRook:"振飛車",pleaseSelectEngines:"請選擇引擎。",thisItemCannotBeMerged:"該項目無法被合併。",tryingToConnectAndLoginToCSAServer:"正在連接並登入CSA伺服器。",inBrowserLogsOutputToConsoleAndIgnoreThisSetting:"※在瀏覽器版本中紀錄會於 console 中顯示,並無視此處的設定。",shouldRestartToApplyLogSettings:"※您需要重新啟動本程式以使用變更後的紀錄設定。",canOpenLogDirectoryFromMenu:"※紀錄的輸出檔案可以在「偵錯」-「開啟紀錄檔案資料夾」開啟。",hasNoOldLogCleanUpFeature:"※現在並沒有舊紀錄的自動刪除機制。",shouldRestartToApplyLowLevelSettings:"※您需要重新啟動本應用程式以反映底層設定。",processingPleaseWait:"現在處理中。請稍待一會。",importingFollowingRecordOrPosition:"將匯入以下棋譜(局面)。",supportsKIF_KI2_CSA_USI_SFEN_JKF_USEN:"※支援KIF/KI2/CSA/USI/SFEN/JKF/USEN形式。",pleasePasteRecordIntoTextArea:"※請在文字輸入區域貼上您的棋譜。",pleaseSpecifyPlainTextURL:"※請輸入您要使用的URL。",redirectNotSupported:"※無法使用重新導向連結。",desktopVersionPastesAutomatically:"※安裝程式版將會自動貼上棋譜。",asNewFile:"視為新檔案",mergeToRootPosition:"自棋譜開頭合併",mergeToCurrentPosition:"自目前局面合併",failedToMergeRecordWithDifferentInitialPosition:"無法合併初始盤面不同之棋譜。",failedToMergeRecordWithDifferentTurn:"無法合併手番不同之棋譜。",earlyPonderFeatureSendsPonderhitCommandWithYaneuraOusNonStandardOptions:"早期 Ponder 機能將會發送やねうら王自行定義之 ponderhit 指令。",ifYourEngineNotSupportTheOptionsItMayCauseUnexpectedBehavior:"若您的引擎不支援該指令,可能會有預期外之行為發生。",someLogsDisabled:"部份 log 已被無效化。",logsRecommendedForCSAProtocol:"若使用CSA協定對局,建議輸出各項紀錄。",blankLinePingRecommendedToPreventTimeout:"接続のタイムアウトを防止するために、空行 Ping を有効にすることを推奨します。",pleaseEnableLogsAndRestart:"請在程式設定中開啟紀錄並重新啟動本程式。",hwaEnabled:"HWA(ハードウェアアクセラレーション)が有効です。",hwaIsNotRecommendedForLongGames:"長時間の対局ではHWAの無効化を推奨します。",pleaseDisableHWAAndRestart:"アプリ設定からHWAを無効にしてアプリを再起動してください。",notSendPVOnStandardCSAProtocol:"在標準的CSA協定中不會送出評價值以及思考棋步。",passwordWillSavedPlaintextBecauseOSSideEncryptionNotAvailable:"由於無法使用系統的加密機能,輸入的密碼將會以明文保存。",pleaseUncheckSaveHistoryIfNotWantSave:"若不想保存密碼,請不要將「保存紀錄」勾選。",floodgatePasswordShouldStartWithGameName:"Floodgate密碼必須以對局名稱開頭。",thisIsNotFloodgateOfficialGameName:"這不是Floodgate官方之對局名稱。",yourPasswordDoesNotMeetFloodgateRequirementsDoYouStillWantToContinue:"密碼可能不符合Floodgate之要求。您仍要繼續嗎?",translationHelpNeeded:"我們正在招募翻譯人員。",restartRequiredAfterLocaleChange:"更改語言後,請重新啟動本程式。",createDesktopShortcut:"デスクトップにショートカットを作成",desktopShortcutCreated:"デスクトップにショートカットを作成しました。",areYouSureWantToResign:"確定要投了嗎?",areYouSureWantToDoDeclaration:"確定要進行勝利宣言嗎?",areYouSureWantToQuitGames:"要中斷連續對局嗎?",areYouSureWantToRequestQuit:"若提出中斷要求,可能會被判負。請問您要繼續嗎?",areYouSureWantToClearRecord:"將會刪除現在的棋譜。請問您要繼續嗎?",areYouSureWantToDiscardPosition:"將不會保存現在的局面。請問您要繼續嗎?",areYouSureWantToOpenFileInsteadOfCurrentRecord:"會將現在的棋譜關閉並開啟別的檔案,請問您要繼續嗎?",areYouSureWantToClearHistory:"將清除紀錄。請問您要繼續嗎?",areYouSureWantToRemoveCurrentProfile:"將移除現在的設定。請問您要繼續嗎?",yamlFormatSettingsCopiedToClipboard:"已將 YAML 格式之設定複製到剪貼板。",jsonFormatSettingsCopiedToClipboard:"已將 JSON 格式之設定複製到剪貼板。",usiCsaBridgeCommandCopiedToClipboard:"已將 usi-csa-bridge 指令複製到剪貼板。",copiedToClipboard:"クリップボードにコピーしました。",pastedFromClipboard:"クリップボードから貼り付けました。",youCanNotCloseAppWhileCSAOnlineGame:"由於CSA協定正在使用中,本程式無法被關閉。",fileExtensionNotSupported:"無法使用該副檔名。",errorOccuredWhileDisconnectingFromCSAServer:"在與CSA伺服器中斷連線時發生錯誤。",failedToConnectToCSAServer:"無法連接CSA伺服器。",errorOccuredWhileLogoutFromCSAServer:"在登出 CSA 伺服器時發生錯誤。",disconnectedFromCSAServer:"與CSA伺服器的連接結束。",csaServerLoginDenied:"您對CSA伺服器的登入被拒絕。",thisFeatureNotAvailableOnWebApp:"Web版無法使用本機能",failedToStartNewGame:"對局開始失敗。",errorOccuredWhileEndingGame:"在對局結束時發生錯誤。",failedToSendGoCommand:"無法送出go指令。",failedToSendPonderCommand:"無法送出ponder指令。",failedToSendStopCommand:"無法送出stop指令。",failedToShutdownEngines:"引擎無法正常結束。",failedToCheckUpdates:"無法確認更新。",failedToSaveRecord:"棋譜保存失敗。",failedToParseSFEN:"SFEN讀取失敗。",failedToDetectRecordFormat:"無法判別棋譜形式。",unknown:"未知",unknownFileExtension:"未知的檔案形式。",emptyRecordInput:"您尚未輸入棋譜。",invalidPieceName:"不合法的棋駒",invalidTurn:"不合法的手番",invalidMove:"不合法的棋步",invalidMoveNumber:"不合法的手數",invalidDestination:"不合法的移動目的地",pieceNotExists:"不存在的棋駒",invalidLine:"不存在的行",invalidBoard:"不合法的盤面",invalidHandPiece:"不合法的持駒",invalidUSI:"不合法的USI",engineProcessWasClosedUnexpectedly:"引擎進程意外結束。",backgroundImageFileNotSelected:"尚未選取背景圖片。",pieceImageFileNotSelected:"尚未選取棋駒圖片。",boardImageFileNotSelected:"尚未選取盤面圖片。",pieceStandImageFileNotSelected:"尚未選取駒台圖片。",pieceSoundVolumeMustBe0To100Percent:"請在0%~100%之間指定棋駒音效大小。",clockSoundVolumeMustBe0To100Percent:"請在0%~100%之間指定棋鐘音效大小。",clockSoundPitchMustBe220To880Hz:"請在220Hz~880Hz之間指定棋鐘音效頻率。",engineTimeoutMustBe1To300Seconds:"請在1秒~300秒之間指定引擎執行最長時間。",coefficientInSigmoidMustBeGreaterThan0:"請將勝率換算係數填為大於0之值。",inaccuracyThresholdMustBe1To100Percent:"請在0%~100%之間指定緩手門檻。",dubiousThresholdMustBe1To100Percent:"請在0%~100%之間指定疑問手門檻。",mistakeThresholdMustBe1To100Percent:"請在0%~100%之間指定惡手門檻。",blunderThresholdMustBe1To100Percent:"請在0%~100%之間指定大惡手門檻。",recordSavedWithGarbledCharacters:"保存的棋譜有部分可能會造成亂碼。",pleaseConsiderToUseKIFU:"建議您使用KIFU形式(UTF-8)儲存您的棋譜。",youCanChangeDefaultRecordFileFormatFromAppSettings:"預設棋譜檔案格式可以在程式設定中進行更動。",inaccuracyThresholdMustBeLessThanDubiousThreshold:"緩手門檻應小於疑問手門檻。",dubiousThresholdMustBeLessThanMistakeThreshold:"疑問手門檻應小於惡手門檻。",mistakeThresholdMustBeLessThanBlunderThreshold:"惡手門檻應小於大惡手門檻。",thisEngineNotSupportsMateSearch:"這個引擎不支援詰將棋搜索。",pleaseEndActiveFeaturesBeforeOpenRecord:"請關閉現正運行的功能再開啟棋譜。",bothTimeLimitAndByoyomiAreNotSet:"持時間與讀秒尚未設置。",canNotUseByoyomiWithFischer:"讀秒與 Fischer 選項無法同時併用。",repeatsMustBeOneIfHumanPlayerIncluded:"若要與人對局,連續對局次數僅能設為 1 。",parallelismMustBeOneIfHumanPlayerIncluded:"人が対局する場合、並列実行数は1以外を設定できません。",parallelismMustBeOneIfCurrentPositionIsUsed:"現在の局面を開始局面にする場合、並列実行数は1以外を設定できません。",parallelismMustLessThanOrEqualToRepeats:"並列実行数は連続対局の回数以下にしてください。",protocolVersionNotSelected:"請選擇協定版本。",hostNameIsEmpty:"主機名稱為空。",invalidPortNumber:"不可用的連接埠號碼。",idIsEmpty:"ID 為空。",idContainsSpace:"ID 含有空白字符。",passwordContainsSpace:"密碼含有空白字符。",tcpKeepaliveInitialDelayMustBePositive:"請輸入正確的TCP Keepalive初始延遲時間。",blankLinePingInitialDelayMustBeGreaterThanOrEqualTo30:"請輸入正確的空行輸出初始延遲時間。",blankLinePingIntervalMustBeGreaterThanOrEqualTo30:"請輸入正確的空行輸出間隔時間。",engineNotSelected:"尚未選擇引擎。",forExportingConversionLogPleaseEnableAppLogsAndSetLogLevelDebugAndRestart:"如要監看轉換紀錄,請在程式設定內設定 log level 到 Debug 並重新啟動本程式。",sourceDirectoryNotSpecified:"輸入目錄尚未被指定。",sourceFileMustBeSFEN:"入力ファイルは .sfen 形式でなければなりません。",sourceFormatsNotSpecified:"輸入格式尚未被指定。",destinationDirectoryNotSpecified:"輸出格式尚未被指定。",destinationFileNotSpecified:"輸出檔案尚未被指定。",anyUnsavedDataWillBeLostDoYouReallyWantToResetBookData:"未保存內容可能會丟失。您確認要重置定跡嗎?",bookMovesWereImported:"已完成匯入定跡。",anyBookMovesAreUnsavedDoYouReallyWantToDiscardThemAndCloseTheApp:"存在尚未保存的定跡。您確定要捨棄並關閉本程式嗎?",cannotOverwriteOnTheFlyBook:"On-the-fly モードで読み込み中の定跡は上書き保存できません。",pleaseSpecifyOtherFileName:"別のファイル名を指定してください。",memoryShortageOnBookConversionMayLoseUnsavedData:"定跡データの変換中にメモリが不足すると保存していないデータは失われる可能性があります。",cannotConvertAperyBookToOtherFormat:"Apery 定跡は他の形式に変換できません。",sourceRecordFileNotSet:"尚未指定棋譜檔案。",sourceDirectoryNotSet:"請選擇目錄。",minPlyMustBeLessThanMaxPly:"最小手數應小於最大手數。",playerNameNotSet:"尚未設定對局者名稱。",incompatibleOptionsWillBeDiscardedDoYouReallyWantToReplaceTheEnginePath:"不相容的設定將自動被移除。您確認要更換引擎嗎?",largeSuggestionsCountMayCausePerformanceDegradation:"增加候補手可能會導致效能下降。",doYouReallyWantToIncreaseTheSuggestionsCount:"您確定要增加候選手數嗎?",recommendLowerSettingsForDailyUse:"日常利用のPCでは低めの設定を推奨します。",checkEngineCompatibilityForNumaEnvironments:"このPCは複数のCPUソケットまたはプロセッサーグループ(NUMA)を持つ可能性があります。NUMA環境に対応していないエンジンでは性能が低下する場合があります。エンジンのNUMA対応状況をご確認ください。",aiPerformanceMayDegrade:"AIの性能が低下する可能性があります。",yourPCMayBecomeSlow:"PCの動作が重くなる可能性があります。",increasingItMayImproveAIPerformance:"大きくすることでAIの性能が向上する可能性があります。",totalNumber:e=>`總計 ${e} 筆`,number:e=>`${e} 筆`,tryToReloginToCSAServerNSecondsLater:e=>`請在${e}秒後再次嘗試登入 CSA 伺服器。`,mateInNPlyDoYouWantToDisplay:e=>`尋找到${e}手詰。要顯示結果嗎?`,insertedNMovesToRecord:e=>`已加入${e}手到棋譜。`,errorsOccurred:e=>`發生 ${e} 個錯誤。`,between:(e,t)=>`自 ${e} 到 ${t} `,addNthEngine:e=>`追加第 ${e} 個引擎`,copyOf:e=>`${e} 的拷貝`,keepLatest:e=>`到最新${e}件`,followingDataNotSavedBecauseNotSupporetedBy:e=>`以下的資料由於 ${e} 格式無法支援的原因無法保存。`,areYouSureWantToDeleteFollowingMove:e=>`將會刪除${e}手目以後的棋譜。請問您要繼續嗎?`,failedToOpenDirectory:e=>`無法開啟檔案目錄:${e}`,unexpectedEventSenderPleaseReport:e=>`無法預期的事件發送方已發生。請將該錯誤訊息告知開發者,謝謝。 [${e}]`,unexpectedHTTPMethodPleaseReport:e=>`無法預期的 HTTP 方法。請將該錯誤訊息告知開發者,謝謝。 [${e}]`,unexpectedRequestURLPleaseReport:e=>`無法從 URL 獲取資訊。請將該錯誤訊息告知開發者,謝謝。 [${e}]`,noResponseFromEnginePleaseExtendTimeout:e=>`引擎在${e}秒内沒有回應。若引擎的啟動時間稍長,請在設定中調整引擎最長等待時間。`,stableVersionReleased:e=>`安定版 ${e} 已經發布!`,latestVersionReleased:e=>`最新版 ${e} 已經發布!`,doYouReallyWantToRemoveBookMove:e=>`將移除定跡手 ${e}。確認移除嗎?`,unexpectedRecordFileExtension:e=>`該檔案為不支援的棋譜副檔名。 [${e}]`,fileNotFound:e=>`無法找到該檔案。 [${e}]`,directoryNotFound:e=>`無法找到該目錄。 [${e}]`,youCanExitFullScreenByPressing:e=>`請按下${e}鍵以結束全螢幕顯示。`,skippedMovesInMerge:(e,t)=>`${t}手內之${e}手無法被合併。`,cpuUsageExceedsNPercent:e=>`全CPUコアの${e}%を超えています。`,totalNumberOfThreadsExceedsNPercentOfCpuCores:e=>`スレッド数の合計がCPUコア数の${e}%を超えています。`,memoryUsageExceedsNPercent:e=>`全メモリの${e}%を超えています。`,memoryUsageIsLessThanNPercent:e=>`全メモリの${e}%未満です。`,totalUSIHashExceedsNPercentOfMemory:e=>`USI_Hash の合計が全メモリの${e}%を超えています。`,heapUsageExceedsNGBMayHang:e=>`メモリ使用量が ${e}GB を超えました。増加傾向が続くとハングアップする可能性があります。`},c={shogiHome:"ShogiHome",clear:"Ván mới",open:"Mở",openNewInstance:"Mở một cửa sổ ShogiHome mới",saveOverwrite:"Ghi đè",newRecord:"Kỳ phổ mới",newRecordKeepInitialPosition:"Kỳ phổ mới (giữ thế trận hiện tại)",newRecordHirateSetup:"Kỳ phổ mới (thế cờ ban đầu)",openRecord:"Mở kỳ phổ",saveRecord:"Lưu kỳ phổ",saveRecordAs:"Lưu kỳ phổ như",openAutoSaveDirectory:"Mở thư mục lưu tự động",exportPositionDiagram:"Xuất ảnh thế cờ",positionImage:"Ảnh thế cờ",batchConversion:"Chuyển đổi số lượng lớn",recordFileBatchConversion:"Chuyển đổi kỳ phổ số lượng lớn",close:"Đóng",quit:"Thoát",reload:"Tải lại",editing:"Sửa",copyAsKIF:"Sao chép (KIF)",copyAsKI2:"Sao chép (KI2)",copyAsCSA:"Sao chép (CSA)",copyAsUSI:"Sao chép (USI)",copyAsSFEN:"Sao chép (SFEN)",copyAsBOD:"Sao chép (BOD)",copyAsJKF:"Sao chép (JKF)",copyAsUSEN:"Sao chép (USEN)",copy:"Sao chép",cut:"Cắt",paste:"Dán",copyRecordAll:"Sao chép kỳ phổ (từ nước đầu tiên)",copyRecordFromCurrentPosition:"Sao chép kỳ phổ (từ thế cờ hiện tại)",asKIF:"dưới dạng KIF",asKI2:"dưới dạng KI2",asCSA:"dưới dạng CSA",asUSI:"dưới dạng USI",asUSIUntilCurrentMove:"dưới dạng USI (cho tới nước hiện tại)",asUSIAll:"dưới dạng USI (toàn bộ)",asJSONKifuFormat:"dưới dạng kỳ phổ JSON",asUSEN:"dưới dạng USEN",copyPosition:"Sao chép thế cờ",asSFEN:"dưới dạng SFEN",asBOD:"dưới dạng BOD",pasteRecordOrPosition:"Dán kỳ phổ/thế cờ",pasteRecordMerge:"Dán kỳ phổ (sáp nhập)",toRootPosition:"Về thế cờ ban đầu",toCurrentPosition:"Đến thế trận hiện tại",addSpecialMove:"Chèn nước đi đặc biệt",deleteMoves:"Xóa từ nước hiện tại trở đi",view:"Hiển thị",openLayoutManager:"Mở trình quản lý bố cục",openMonitorWindow:"Mở cửa sổ quản lý",toggleFullScreen:"Bật/tắt toàn màn hình",defaultFontSize:"Cỡ chữ tiêu chuẩn",increaseFontSize:"Cỡ chữ lớn",decreaseFontSize:"Cỡ chữ nhỏ",settings:"Cài đặt",config:"Thiết lập",debug:"Gỡ lỗi",toggleDevTools:"Bật/tắt công cụ nhà phát triển",logFile:"Tệp log",openAppLog:"Mở log ứng dụng",openUSILog:"Mở log USI",openCSALog:"Mở log CSA",tailAppLog:"Kết thúc log ứng dụng",tailUSILog:"Kết thúc log USI",tailCSALog:"Kết thúc log CSA",copyAppLogTailCommand:"Sao chép lệnh kết thúc log ứng dụng",copyUSILogTailCommand:"Sao chép lệnh kết thúc log USI",copyCSALogTailCommand:"Sao chép lệnh kết thúc log CSA",reloadCustomPieceImage:"Tải lại ảnh quân tùy chỉnh",statisticsReport:"Thống kê",launchUSIEngine:"Khởi động phần mềm shogi",connectToCSAServer:"Kết nối với máy chủ CSA",adminMode:"Chế độ nâng cao",inAdminModeManuallyInvokeCommandsAtPrompt:"Trong chế độ nâng cao, bạn phải tự nhập lệnh tại ô nhắc lệnh.",setoptionAndPrecedingCommandsAreSentAutomatically:'"setoption" và các lệnh trước đó sẽ được gửi tự động',serverMustSupportShogiServerX1ModeLogIn:"Máy chủ phải hỗ trợ phương thức đăng nhập x1-mode của shogi-server.",folders:"Thư mục",notification:"Thông báo",notificationTest:"Thử thông báo",thisIsTestNotification:"Đây là thông báo thử",app:"Ứng dụng",log:"Log",cache:"Bộ nhớ đệm",help:"Trợ giúp",openWebsite:"Mở trang web",openUserGuide:"Mở hướng dẫn sử dụng",openLatestReleasePage:"Mở trang của bản mới nhất",openStableReleasePage:"Mở trang của bản ổn định",license:"Giấy phép",inputs:"Đầu vào",outputs:"Đầu ra",format:"Định dạng",formats:"Định dạng",subdirectories:"Thư mục con",separate:"Riêng biệt",merge:"Sáp nhập",createSubdirectories:"Tạo thư mục con",nameConflictAction:"Hành động xung đột tên",numberSuffix:"Hậu tố số",skip:"Bỏ qua",convert:"Chuyển đổi",openLogFile:"Mở tệp log",success:"Thành công",failed:"Thất bại",skipped:"Bỏ qua",game:"Chơi",player:"Kỳ thủ",server:"Máy chủ",selectFromHistory:"Chọn từ lịch sử",noHistory:"Trống",saveHistory:"Lưu lịch sử",version:"Phiên bản",gameProgress:"Tiến triển ván đấu",allGamesCompleted:"Tất cả các ván đã kết thúc",wins:"Thắng",winsOnBlack:"Số ván thắng (Tiên)",winsOnWhite:"Số ván thắng (Hậu)",draws:"Hòa",validGames:"Ván hợp lệ",invalidGames:"Ván không hợp lệ",eloRatingDiff:"Khoảng cách Elo",ignoreDraws:"Bỏ qua ván hòa",zValue:"Giá trị Z",significance5pc:"Độ nổi bật 5%",significance1pc:"Độ nổi bật 1%",gameEnded:"Ván đã kết thúc",offlineGame:"Ván ngoại tuyến",csaOnlineGame:"Ván CSA trực tuyến",csaProtocolOnlineGame:"Ván trực tuyến (phương thức CSA)",csaProtocolV121:"Phương thức CSA tiêu chuẩn 1.2.1",csaProtocolV121WithPVComments:"Phương thức CSA 1.2.1 có bình luận PV",host:"Tên máy chủ",portNumber:"Cổng",password:"Mật khẩu",revealPassword:"Hiện mật khẩu",keepaliveInitialDelay:"Trì hoãn keepalive ban đầu",blankLinePing:"Ping dòng trống",blankLinePingInitialDelay:"Trì hoãn ping dòng trống ban đầu",blankLinePingInterval:"Khoảng thời gian ping dòng trống",logout:"Đăng xuất",calculateJishogiPoints:"Tính điểm bế tắc",jishogiPoints:"Điểm bế tắc",displayGameResults:"Hiển thị kết quả",interrupt:"Dừng",stopGame:"Dừng ván đấu",resign:"Xin thua",draw:"Hòa",impass:"Bế tắc",repetitionDraw:"Hòa do lặp nước",repetition:"Hòa do lặp nước",mate:"Chiếu hết",noMate:"Không chiếu hết",blackWin:"Tiên thắng",whiteWin:"Hậu thắng",all:"Tất cả",others:"Khác",minRate:"Elo thấp nhất",mateSearch:"Tìm chiếu hết",startMateSearch:"Bắt đầu tìm chiếu hết",stopMateSearch:"Dừng tìm chiếu hết",noMateFound:"Không có chiếu hết.",timePerPosition:"Thời gian suy nghĩ",timeout:"Hết giờ",foulWin:"Thắng do nước đi phạm luật",foulLose:"Thua do nước đi phạm luật",enteringOfKing:"Thắng do nhập Ngọc",winByDefault:"Xử thắng",loseByDefault:"Xử thua",winByDeclaration:"Thắng do tuyên bố",declareWin:"Tuyên bố chiến thắng",research:"Tính toán",startResearch:"Bắt đầu tính toán",endResearch:"Dừng tính toán",startEndResearch:"Bắt đầu/Dừng tính toán",recordAnalysis:"Phân tích kỳ phổ",analysis:"Phân tích",analyze:"Phân tích",stopAnalysis:"Dừng phân tích",searchDuplicatePositions:"Tìm thế cờ lặp lại",duplicatePositionSearch:"Tìm thế cờ lặp lại",duplicatePositions:"Thế cờ lặp lại",duplicatePos:"Lặp lại",via:"Thông qua",lastMove:"Nước liền trước",nextMoves:"Nước liền sau",goToThisPosition:"Đi đến thế cờ này",noDuplicatePositions:"Không có thế cờ lặp lại.",nDuplicatePositionsFound:e=>`Tìm thấy ${e} thế cờ lặp lại.`,appearanceCount:"Số lần lặp lại",showList:"Hiện tất cả",setupPosition:"Xếp thế cờ",startPositionSetup:"Bắt đầu xếp thế cờ",completePositionSetup:"Hoàn tất xếp thế cờ",changeTurn:"Đổi lượt đi",initializePosition:"Đặt lại thế cờ",changePieceSet:"Tăng giảm quân",setAllPiecesToStandardCounts:"Đặt lại số lượng quân",setAllPiecesToZero:"Đặt tất cả số quân thành 0",appSettings:"Cài đặt ứng dụng",language:"Ngôn ngữ",theme:"Chủ đề",standard:"Tiêu chuẩn",green:"Xanh lá",cherryBlossom:"Hoa anh đào",customImage:"Ảnh tùy chọn",autumn:"Mùa thu",snow:"Tuyết rơi",classic:"クラシック",beige:"ベージュ",darkGreen:"Xanh lá đậm",dark:"Tối",boardLayout:"Bố cục bàn cờ",compact:"Gọn",portrait:"Dọc",piece:"Quân",singleKanjiPiece:"Nhất tự",singleKanjiWoodPiece:"Nhất tự (Gỗ)",singleKanjiGothicPiece:"Nhất tự (Gothic)",singleKanjiDarkPiece:"Nhất tự (Tối)",singleKanjiGothicDarkPiece:"Nhất tự (Gothic, Tối)",twoKanjiPiece:"二文字駒",imageHasMarginsRemoveForLargerDisplay:"Ảnh có lề (loại bỏ để hiển thị lớn hơn)",backgroundImage:"Ảnh nền",board:"Bàn cờ",pieceStand:"Komadai",woodTexture:"Vân gỗ",lightWoodyTexture:e=>`Vân gỗ (Nhẹ ${e})`,warmWoodTexture:e=>`Vân gỗ (Ấm ${e})`,resin:"Nhựa cây ",transparent:"Trong suốt",boardOpacity:"Độ đục bàn cờ",pieceStandOpacity:"Độ đục komadai",recordOpacity:"Độ đục kỳ phổ",promotionSelector:"Chọn phong cấp",centeredHorizontal:"Ngang, căn giữa",promoteFirstVertical:"Dọc, ưu tiên phong cấp",promoteFirstHorizontal:"Ngang, ưu tiên phong cấp",enableDragAndDrop:"駒のドラッグ操作",showFileAndRank:"Hiện hàng và cột",showLeftControls:"Hiện điều khiển bên trái",showRightControls:"Hiện điều khiển bên phải",tabViewStyle:"Hiện thẻ",oneColumn:"1 cột",twoColumns:"2 cột",sounds:"Âm thanh",pieceSoundVolume:"Âm lượng quân",clockSoundVolume:"Âm lượng đồng hồ",clockSoundPitch:"Cao độ đồng hồ",clockSoundTarget:"Nước đi có tiếng đồng hồ",anyTurn:"Tất cả",onlyHumanTurn:"Nước của người chơi",defaultRecordFileFormat:"Định dạng kỳ phổ mặc định",textEncoding:"Bộ mã chữ",strict:"Bắt buộc",autoDetect:"Tự động",newlineCharacter:"Ký tự dòng mới",old90sMac:"Mac năm 90",autoSaving:"Tự động lưu",recordFileName:"Tên tệp kỳ phổ",select:"Chọn",shuffle:"Trộn",csaV3Output:"Xuất dưới dạng CSA v3",alwaysOutputUTF8:"Luôn xuất kỳ phổ UTF-8",someOldShogiAppsCannotReadUTF8KifFiles:"Một số phần mềm shogi cũ có thể không đọc được tệp KIF/KI2 có mã hóa UTF-8.",strictDecodingMayFailToReadUTF8KifFiles:"Chế độ mã hóa nghiêm khắc có thể không đọc được tệp KIF/KI2 có mã hóa UTF-8.",positionOfUSIOutput:"Định dạng thế cờ USI",movesOfUSIOutput:"Định dạng kỳ phổ USI",onlySFEN:"Chỉ SFEN",minimal:"Nhỏ nhất",pasteDialog:"Hộp thoại dán",liveDuplicatePositionDetection:"Tự động tìm thế cờ lặp lại",onTheFlyThreshold:"Giá trị On-the-fly",usiProtocol:"Định dạng USI",translateOptionName:"Dịch tên tùy chọn",functionalOnJapaneseOnly:"Chỉ dùng cho bản tiếng Nhật",maxStartupTime:"Thời gian khởi động tối đa",forDevelopers:"Dành cho nhà phát triển",enableAppLog:"Bật log ứng dụng",enableUSILog:"Bật log USI",enableCSALog:"Bật log CSA",logLevel:"Mức độ log",manageEngines:"Quản lý phần mềm",flipBoard:"Xoay bàn cờ",elapsedTimeChart:"Biểu đồ thời gian",controls:"操作",useUpDownToMove1Ply:"Tiến/lùi nước bằng phím ↑/↓",useLeftRightToMove1Ply:"Tiến/lùi nước bằng phím ←/→",file:"Tệp",folder:"Tập tin",recordFile:"Tệp kỳ phổ",executableFile:"Tệp phần mềm",imageFile:"Tệp ảnh",unsaved:"Chưa lưu",remove:"Xóa",deleteMove:"Xóa nước đi",recordProperties:"Thuộc tính kỳ phổ",comments:"Bình luận",commentsAndBookmarks:"Bình luận & đánh dấu",branches:"Nhánh",branchListMode:"Hiển thị các nhánh",previousMoveBranches:"Các nước đã đi",nextMoveBranches:"Nước tiếp theo",bookmark:"Đánh dấu",bookmarkList:"Đánh dấu",useBookmarkAsHeader:"Sử dụng đánh dấu làm đầu đề",moveComments:"Bình luận nước đi",searchLog:"Lịch sử tìm kiếm",pv:"PV",mateShort:"M",displayPVShort:"Đi",evaluation:"Đánh giá",rawScore:"Đ.giá",score:"Đ.giá",estimatedWinRate:"Tỷ lệ thắng ước tính",evaluationAndEstimatedWinRateAndPV:"Đánh giá & tỷ lệ thắng ước tính & PV",swapEachTurnChange:"Đổi mỗi lượt",alwaysSenteIsPositive:"Tiên luôn dương",signOfEvaluation:"Dấu giá trị đánh giá",showArrowScore:"矢印に評価値を表示",arrowScoreDiffRange:"矢印の評価値範囲",maxArrows:"Số mũi tên hiển thị",winRateCoefficient:"Hệ số tỷ lệ thắng",nodeCountFormat:"Hiển thị số node",plainNumber:"Số thường",commaSeparated:"Chia bằng dấu phẩy",monitor:"Theo dõi",hideTabView:"Ẩn",expandTabView:"Mở hiển thị thẻ",sente:"Tiên thủ",senteOrShitate:"Tiên thủ (Hạ thủ)",shitate:"Hạ thủ",gote:"Hậu thủ",goteOrUwate:"Hậu thủ (Thượng thủ)",uwate:"Thượng thủ",targetEngine:"Phần mềm được kiểm tra",baseEngine:"Phần mềm so sánh",swapSenteGote:"Đổi Tiên/Hậu",pieceToss:"Furigoma",currentPosition:"Thế cờ hiện tại",positionList:"Danh sách thế cờ",enableEngineTimeout:"Bật hết giờ phần mềm",setDifferentTimeForGote:"Đặt thời gian khác cho Hậu",nextTurn:"Lượt đi",elapsedTime:"Thời gian dùng tổng cộng",elapsed:"T.gian",rank:"Hạng",depth:"Độ sâu",searchEngine:"Phần mềm",ponder:"Đọc trước",numberOfThreads:"Luồng",threads:"Luồng",suggestionsCount:"Số nước đề xuất",startPosition:"Thế cờ ban đầu",beginFromThisPosition:"Bắt đầu từ thế cờ này",maxMoves:"Số nước tối đa",gameRepetition:"Lặp lại thế cờ",parallelism:"Số ván song song",parallelGame:"Ván song song",jishogi:"Bế tắc",rule24:"Luật 24 điểm",rule27:"Luật 27 điểm",tryRule:"Luật Try",autoRelogin:"Tự động đăng nhập lại",restartItEveryGame:"Khởi động lại mỗi ván",swapTurnWhenGameRepetition:"Đổi lượt đi khi lặp lại nước đi",outputComments:"Xuất bình luận",saveRecordAutomatically:"Tự động lưu kỳ phổ",adjustBoardToHumanPlayer:"Tự động xoay bàn cờ về hướng người chơi",adjustBoardAutomatically:"Tự động xoay bàn cờ",command:"Lệnh",startGame:"Bắt đầu ván cờ",cancelGame:"Hủy ván cờ",allottedTime:"Thời gian",byoyomi:"Byoyomi",increments:"Cộng thời gian",startEndCriteria:"Điều kiện bắt đầu/kết thúc",descending:"Đảo thứ tự",endCriteria1Move:"Điều kiện kết thúc cho mỗi nước đi",outputSettings:"Tùy chọn xuất",noOutputs:"Không xuất",insertCommentToTop:"Chèn phía trước",appendCommentToBottom:"Chèn phía sau",insertToComment:"Chèn vào bình luận",insertToRecord:"Chèn vào kỳ phổ",overwrite:"Ghi đè",fromPrefix:"từ",fromSuffix:"",toPrefix:"tới",toSuffix:"",plyPrefix:"Nước thứ ",plySuffix:"",hoursSuffix:"h",minutesSuffix:"p",secondsSuffix:"s",eg:"vd.",totalMoves:"Tổng số nước",detailSettings:"Cài đặt chi tiết",engineManagement:"Quản lý phần mềm",engineName:"Tên phần mềm",author:"Tác giả",earlyPonder:"Tính nhanh",enginePath:"Đường dẫn phần mềm",openDirectory:"Mở đường dẫn",replaceEnginePath:"Chọn lại đường dẫn phần mềm",displayName:"Tên hiển thị",frontendBook:"Định thức (mở rộng GUI)",showAllOptions:"Hiển thị tất cả cài đặt",invoke:"Thực hiện",resetToEngineDefaultValues:"Đặt lại về giá trị ban đầu",defaultValue:"Giá trị mặc định",freeTextUnsafe:"Nhập tự do (không hỗ trợ)",noEngineRegistered:"Không có phần mềm",duplicate:"Sao chép",add:"Thêm",compareAndMerge:"So sánh/sáp nhập",compareEngineSettings:"So sánh cài đặt phần mềm",noDifference:"Không khác nhau",mergeToLeft:"Sáp nhập sang trái",mergeToRight:"Sáp nhập sang phải",recommended:"Đề xuất",import:"Nhập",saveAndClose:"Lưu và đóng",save:"Lưu",saveAs:"Lưu thành",history:"Lịch sử",clearHistory:"Xóa lịch sử",userFile:"Tệp người dùng",automaticBackup:"Sao lưu tự động",restore:"Khôi phục",loadRecordFromWeb:"Tải kỳ phổ từ mạng",backToMainBranch:"Trở về biến chính",fetchLatestData:"Lấy dữ liệu mới nhất",sourceURL:"URL nguồn",ok:"OK",cancel:"Hủy",back:"Quay lại",doNotShowAgain:"Không hiện lại lần sau",name:"Tên",prediction:"Dự đoán",best:"Tốt nhất",nodes:"Số thế cờ",hashUsage:"Sử dụng hash",stop:"Dừng",resume:"Tiếp tục",noHandicap:"Không chấp",lanceHandicap:"Chấp Thương",rightLanceHandicap:"Chấp Thương phải",bishopHandicap:"Chấp Tượng",rookHandicap:"Chấp Xe",rookLanceHandicap:"Chấp Xe + Thương",twoPiecesHandicap:"Chấp 2 quân",fourPiecesHandicap:"Chấp 4 quân",sixPiecesHandicap:"Chấp 6 quân",eightPiecesHandicap:"Chấp 8 quân",tenPiecesHandicap:"Chấp 10 quân",tsumeShogi:"Tsumeshogi",doubleKingTsumeShogi:"Tsumeshogi 2 vua",startDateTime:"Bắt đầu",endDateTime:"Kết thúc",gameDate:"Ngày",tournament:"Giải đấu",strategy:"Chiến pháp",gameTitle:"Tiêu đề",timeLimit:"Thời gian",blackTimeLimit:"Thời gian (Tiên)",whiteTimeLimit:"Thời gian (Hậu)",place:"Địa điểm",postedOn:"Đăng tại",note:"Ghi chú",senteShortName:"Tiên thủ (ngắn)",goteShortName:"Hậu thủ (ngắn)",scorekeeper:"Người ghi chép",opusNo:"Số hiệu",opusName:"Tên tác phẩm",publishedBy:"Xuất bản bởi",publishedOn:"Ngày xuất bản",source:"Nguồn",numberOfMoves:"Số nước đi",integrity:"Trạng thái",recordCategory:"Thể loại",award:"Giải thưởng",filterByOptionName:"Lọc theo tên tùy chọn",filterByEngineName:"Lọc theo tên phần mềm",bookStyle:"Kiểu sách",bookStyleDiagram:"Hình cờ kiểu sách",gameStyle:"Kiểu bàn cờ",thin:"Mảnh",bold:"Đậm",extraBold:"Siêu đậm",playerName:"Tên kỳ thủ",typeface:"Kiểu chữ",weight:"Độ đậm nhạt",handLabel:"Tên quân trên tay",header:"Đầu đề",vertical:"Dọc",size:"Kích cỡ",none:"Không",bgCover:"Hiện đơn",bgContain:"Phóng to",bgTile:"Mảnh ghép",inaccuracy:"Nước đi không chính xác",dubious:"Nước đi không tốt",mistake:"Sai lầm",blunder:"Sai lầm ngớ ngẩn",inaccuracyThreshold:"Ngưỡng nước không chính xác",dubiousThreshold:"Ngưỡng nước không tốt",mistakeThreshold:"Ngưỡng nước sai lầm",blunderThreshold:"Ngưỡng nước sai lầm ngớ ngẩn",maxPVLength:"Số nước đọc hiển thị",commentFormat:"Định dạng chú thích",gothic:"Gothic",mincho:"Minh thể",appVersion:"Phiên bản ứng dụng",installed:"Được cài đặt",stable:"Ổn định",latest:"Mới nhất",backgroundColor:"Màu nền",dialogPosition:"Vị trí hộp thoại",alignLeft:"Trái",alignRight:"Phải",alignCenter:"Giữa",dialogBackdrop:"Nền hộp thoại",record:"Kỳ phổ",book:"Định thức",bookInfo:"定跡の情報",resetBook:"定跡の初期化",moveEvaluation:"指し手評価",forced:"絶対手",goodMove:"好手",yane2016BookFile:"やねうら王定跡ファイル",shogiGUIBookFile:"ShogiGUI 定跡ファイル",aperyBookFile:"Apery 定跡ファイル",loadingMode:"読み込みモード",positionCount:"局面数",chart:"Đồ thị",analytics:"Phân tích",controlGroup:"Menu",left:"Trái",top:"Trên",width:"Chiều rộng",height:"Chiều cao",newCustomProfile:"Cài đặt mới",addCustomLayoutProfile:"Thêm cài đặt",duplicateCurrentProfile:"Sao chép cài đặt hiện tại",removeCurrentProfile:"Xóa cài đặt hiện tại",exportProfileToClipboard:"Sao chép cài đặt",importProfileFromClipboard:"Dán cài đặt",editLayoutWithDragAndDrop:"ドラッグで編集",profileExportedToClipboard:"Đã xuất cài đặt.",profileImported:"Đã nhập cài đặt.",failedToImportProfile:"Nhập cài đặt thất bại.",rightControlBox:"Menu bên phải",leftControlBox:"Menu bên trái",topControlBox:"Menu bên trên",legends:"Chú giải",historyMode:"Chế độ lịch sử",headers:"Đầu đề",playButton:"Nút phát lại",insert:"Chèn",bringForward:"Đưa lên trên",sendBackward:"Đẩy xuống dưới",move:"Nước đi",bookMove:"Nước định thức",play:"Chơi",edit:"Sửa",addMoves:"Thêm nước đi",export:"エクスポート",flippedBook:"Sử dụng book lật ngược",addBookMoves:"Thêm định thức",fromCurrentRecord:"Từ kỳ phổ này",fromFile:"Từ tệp",fromDirectory:"Từ thư mục",noMoves:"Không tìm thấy nước đi.",register:"Đăng ký",update:"Cập nhật",importAll:"全て反映",doYouWantToImportAllMoves:"全ての手を反映しますか?",importedMoves:e=>`${e}手を定跡に反映しました。`,currentMove:"Nước hiện tại",branchFrom:e=>`Phân nhánh từ nước thứ ${e}`,allPlayers:"Tất cả kỳ thủ",blackPlayerOnly:"Chỉ Tiên",whitePlayerOnly:"Chỉ Hậu",filterByName:"Lọc bằng tên",importScoreFromComment:"コメントから評価値を取り込む",enterPartOfPlayerNameHere:"Nhập một phần tên kỳ thủ",freq:"Tần suất",frequency:"Tần suất xuất hiện",new:"Mới",duplicated:"Trùng lặp",moveEntry:"Nước đã được lưu",updatedAt:"Cập nhật lúc",createdAt:"Tạo lúc",lastSent:"Gửi lần cuối",lastReceived:"Nhận lần cuối",protocolVersion:"Phiên bản phương thức",prompt:"Nhắc lệnh",openPrompt:"Mở nhắc lệnh",forceQuit:"Buộc thoát",forceClose:"Buộc đóng",blankLine:"Dòng trống",autoScroll:"Tự động lướt",showTimestamp:"Hiện dấu thời gian",highlightByPartialMatch:"Đánh dấu trùng một phần",csaServer:"Máy chủ CSA",usiEngine:"Phần mềm USI",noRunningUSIEngine:"Không có phần mềm USI đang chạy.",noConnectedCSAServer:"Không kết nối với máy chủ CSA nào.",willBeRemovedFromTheListSoon:"Trình này đã đóng và sắp bị xóa khỏi danh sách.",typeCommandHereAndPressEnter:"Nhập lệnh tại đây và nhấn Enter.",allowBlankLine:"Cho phép dòng trống",removeSpaceFromBothEnds:"Xóa dấu cách ở hai đầu",collapseSequentialSpaces:"Gộp dấu cách liền nhau",typeCustomTitleHere:"Nhập tiêu đề",displayEmptyElements:"Hiện các mục trống",share:"Chia sẻ",waitingForNewGame:"Đang chờ ván mới.",waitingForPlayerSetup:"Đang chờ người chơi chuẩn bị.",insertedComment:"Đã chèn bình luận.",conversionCompleted:"Chuyển đổi hoàn tất.",human:"Người",randomPlayer:"Người chơi ngẫu nhiên",beginner:"Người mới học",staticRook:"Cư Phi Xa",rangingRook:"Chấn Phi Xa",pleaseSelectEngines:"Vui lòng chọn phần mềm.",thisItemCannotBeMerged:"Mục này không thể sáp nhập.",tryingToConnectAndLoginToCSAServer:"Đang kết nối và đăng nhập vào máy chủ CSA.",inBrowserLogsOutputToConsoleAndIgnoreThisSetting:"*Bản trình duyệt sẽ xuất log ra trình nhắc lệnh và bỏ qua cài đặt này.",shouldRestartToApplyLogSettings:"*Khởi động lại ứng dụng để áp dụng các cài đặt log.",canOpenLogDirectoryFromMenu:'*Bạn có thể mở đường dẫn log qua menu "Gỡ lỗi" - "Mở đường dẫn log".',hasNoOldLogCleanUpFeature:"*Ứng dụng này không có tính năng dọn dẹp. Vui lòng tự xóa log cũ.",shouldRestartToApplyLowLevelSettings:"※ Vui lòng khởi động lại ứng dụng để cập nhật cài đặt mức độ thấp hơn.",processingPleaseWait:"Đang tải, vui lòng chờ.",importingFollowingRecordOrPosition:"Đang nhập kỳ phổ (hoặc thế cờ) dưới đây.",supportsKIF_KI2_CSA_USI_SFEN_JKF_USEN:"*Hỗ trợ KIF, KI2, CSA, USI, SFEN, JKF, và USEN.",pleasePasteRecordIntoTextArea:"*Dán dữ liệu kỳ phổ vào vùng nhập chữ.",pleaseSpecifyPlainTextURL:"*Vui lòng nhập URL thô.",redirectNotSupported:"*Không hỗ trợ chuyển hướng.",desktopVersionPastesAutomatically:"*Bản máy tính sẽ tự động dán.",asNewFile:"Tệp mới",mergeToRootPosition:"Sáp nhập vào thế cờ ban đầu",mergeToCurrentPosition:"Sáp nhập vào thế cờ hiện tại",failedToMergeRecordWithDifferentInitialPosition:"Sáp nhập thất bại do thế cờ bắt đầu khác nhau.",failedToMergeRecordWithDifferentTurn:"Sáp nhập thất bại do lượt đi khác nhau.",earlyPonderFeatureSendsPonderhitCommandWithYaneuraOusNonStandardOptions:'Tính năng tính nhanh gửi lệnh "ponderhit" với các tùy chọn riêng củaYaneuraOu.',ifYourEngineNotSupportTheOptionsItMayCauseUnexpectedBehavior:"Phần mềm của bạn có thể báo lỗi nếu không hỗ trợ cài đặt này.",someLogsDisabled:"Một số tùy chọn log đã bị tắt.",logsRecommendedForCSAProtocol:"Chúng tôi đề xuất bật tùy chọn log cho phương thức CSA.",blankLinePingRecommendedToPreventTimeout:"接続のタイムアウトを防止するために、空行 Ping を有効にすることを推奨します。",pleaseEnableLogsAndRestart:"Vui lòng bật tùy chọn log và khởi động lại ứng dụng.",hwaEnabled:"Đã bật gia tốc phần cứng (HWA).",hwaIsNotRecommendedForLongGames:"Vui lòng tắt HWA nếu ván cờ kéo dài.",pleaseDisableHWAAndRestart:"Vui lòng tắt HWA trong mục cài đặt và khởi động lại ứng dụng.",notSendPVOnStandardCSAProtocol:"PV không được gửi trong phương thức CSA tiêu chuẩn.",passwordWillSavedPlaintextBecauseOSSideEncryptionNotAvailable:"Mật khẩu sẽ được lưu thô vì hệ điều hành không hỗ trợ mã hóa.",pleaseUncheckSaveHistoryIfNotWantSave:"Vui lòng bỏ chọn lưu lịch sử nếu không muốn lưu.",floodgatePasswordShouldStartWithGameName:"Mật khẩu Floodgate phải bắt đầu bằng tên ván đấu. ",thisIsNotFloodgateOfficialGameName:"Đây không phải tên một ván đấu Floodgate chính thức.",yourPasswordDoesNotMeetFloodgateRequirementsDoYouStillWantToContinue:"Mật khẩu của bạn không đạt điều kiện của Floodgate. Bạn vẫn muốn tiếp tục chứ?",translationHelpNeeded:"Chúng tôi cần bạn giúp đỡ phiên dịch.",restartRequiredAfterLocaleChange:"Khởi động lại ứng dụng để áp dụng ngôn ngữ.",createDesktopShortcut:"Tạo lối tắt trên desktop",desktopShortcutCreated:"Đã tạo lối tắt trên desktop.",areYouSureWantToResign:"Bạn có thật sự muốn đầu hàng không?",areYouSureWantToDoDeclaration:"Bạn có thật sự muốn tuyên bố không?",areYouSureWantToQuitGames:"Bạn có thật sự muốn bỏ ván không?",areYouSureWantToRequestQuit:"Bạn có thể bị xử thua. Bạn có thật sự muốn yêu cầu rời ván không?",areYouSureWantToClearRecord:"Bạn có thật sự muốn xóa kỳ phổ không?",areYouSureWantToDiscardPosition:"Bạn có thật sự muốn xóa thế cờ không?",areYouSureWantToOpenFileInsteadOfCurrentRecord:"Bạn có thật sự muốn ghi đè thế cờ hiện tại không?",areYouSureWantToClearHistory:"Bạn có thật sự muốn xóa lịch sử không?",areYouSureWantToRemoveCurrentProfile:"Bạn có thật sự muốn xóa cài đặt hiện tại không?",yamlFormatSettingsCopiedToClipboard:"Cài đặt đã được sao chép dưới dạng YAML.",jsonFormatSettingsCopiedToClipboard:"Cài đặt đã được sao chép dưới dạng JSON.",usiCsaBridgeCommandCopiedToClipboard:"Lệnh usi-csa-bridge đã được sao chép.",copiedToClipboard:"Đã sao chép vào bảng tạm.",pastedFromClipboard:"Đã dán từ bảng tạm.",youCanNotCloseAppWhileCSAOnlineGame:"Bạn không thể đóng ứng dụng trong khi đang có ván CSA.",fileExtensionNotSupported:"Không hỗ trợ định dạng này.",errorOccuredWhileDisconnectingFromCSAServer:"Đã có lỗi trong khi ngắt kết nối khỏi máy chủ CSA.",failedToConnectToCSAServer:"Kết nối với máy chủ CSA thất bại.",errorOccuredWhileLogoutFromCSAServer:"Đã có lỗi trong khi đăng xuất khỏi máy chủ CSA.",disconnectedFromCSAServer:"Đã ngắt kết nối khỏi máy chủ CSA.",csaServerLoginDenied:"Đăng nhập vào máy chủ CSA bị từ chối.",thisFeatureNotAvailableOnWebApp:"Tính năng này không có sẵn trên trình duyệt.",failedToStartNewGame:"Bắt đầu ván mới thất bại.",errorOccuredWhileEndingGame:"Đã có lỗi trong khi kết thúc ván.",failedToSendGoCommand:"Gửi lệnh go thất bại.",failedToSendPonderCommand:"Gửi lệnh ponder thất bại.",failedToSendStopCommand:"Gửi lệnh stop thất bại.",failedToShutdownEngines:"Dừng phần mềm thất bại.",failedToCheckUpdates:"Kiểm tra cập nhật thất bại.",failedToSaveRecord:"Lưu kỳ phổ thất bại.",failedToParseSFEN:"Đọc SFEN thất bại.",failedToDetectRecordFormat:"Xác định định dạng kỳ phổ thất bại.",unknown:"Không rõ",unknownFileExtension:"Định dạng tệp không rõ.",emptyRecordInput:"Kỳ phổ trống.",invalidPieceName:"Tên quân không hợp lệ",invalidTurn:"Lượt đi không hợp lệ",invalidMove:"Nước đi không hợp lệ",invalidMoveNumber:"Số nước đi không hợp lệ",invalidDestination:"Điểm đến không hợp lệ",pieceNotExists:"Quân cờ không tồn tại",invalidLine:"Dòng không hợp lại",invalidBoard:"Bàn cờ không hợp lệ",invalidHandPiece:"Quân trên tay không hợp lệ",invalidUSI:"USI không hợp lệ",engineProcessWasClosedUnexpectedly:"Phần mềm đã bị đóng bất ngờ.",backgroundImageFileNotSelected:"Chưa chọn ảnh nền.",pieceImageFileNotSelected:"Chưa chọn ảnh quân cờ.",boardImageFileNotSelected:"Chưa chọn ảnh bàn cờ.",pieceStandImageFileNotSelected:"Chưa chọn ảnh komadai.",pieceSoundVolumeMustBe0To100Percent:"Âm lượng quân phải từ 0% đến 100%.",clockSoundVolumeMustBe0To100Percent:"Âm lượng đồng hồ phải từ 0% đến 100%.",clockSoundPitchMustBe220To880Hz:"Cao độ đồng hồ phải từ 220Hz đến 880Hz.",engineTimeoutMustBe1To300Seconds:"Hết giờ phần mềm phải từ 1 đến 300 giây.",coefficientInSigmoidMustBeGreaterThan0:"Hệ số phải lớn hơn 0.",inaccuracyThresholdMustBe1To100Percent:"Ngưỡng khó hiểu phải từ 1% đến 100%.",dubiousThresholdMustBe1To100Percent:"Ngưỡng không chính xác phải từ 1% đến 100%.",mistakeThresholdMustBe1To100Percent:"Ngưỡng sai lầm phải từ 1% đến 100%.",blunderThresholdMustBe1To100Percent:"Ngưỡng sai lầm ngớ ngẩn phải từ 1% đến 100%.",recordSavedWithGarbledCharacters:"Kỳ phổ bị lưu với một số ký tự lỗi.",pleaseConsiderToUseKIFU:"Vui lòng cân nhắc sử dụng định dạng KIFU (UTF-8).",youCanChangeDefaultRecordFileFormatFromAppSettings:"Bạn có thể đổi định dạng mặc định trong cài đặt ứng dụng.",inaccuracyThresholdMustBeLessThanDubiousThreshold:"Ngưỡng khó hiểu phải nhỏ hơn ngưỡng không chính xác.",dubiousThresholdMustBeLessThanMistakeThreshold:"Ngưỡng không chính xác phải nhỏ hơn ngưỡng sai lầm.",mistakeThresholdMustBeLessThanBlunderThreshold:"Ngưỡng sai lầm phải nhỏ hơn ngưỡng sai lầm ngớ ngẩn.",thisEngineNotSupportsMateSearch:"Phần mềm này không hỗ trợ đọc chiếu hết.",pleaseEndActiveFeaturesBeforeOpenRecord:"Vui lòng đóng các tính năng đang chạy trước khi mở kỳ phổ.",bothTimeLimitAndByoyomiAreNotSet:"Thời gian và byoyomi chưa được đặt.",canNotUseByoyomiWithFischer:"Bạn không thể dùng byoyomi với chế độ Fischer.",repeatsMustBeOneIfHumanPlayerIncluded:"Nếu có người chơi, số lần lặp lại phải là 1.",parallelismMustBeOneIfHumanPlayerIncluded:"Nếu có người thi đấu, số ván song song phải là 1.",parallelismMustBeOneIfCurrentPositionIsUsed:"Nếu bắt đầu bằng thế cờ hiện tại, số ván song song phải là 1.",parallelismMustLessThanOrEqualToRepeats:"Vui lòng đặt số ván song song không quá số ván liên tục.",protocolVersionNotSelected:"Chưa chọn phiên bản phương thức.",hostNameIsEmpty:"Tên máy chủ trống.",invalidPortNumber:"Cổng không hợp lệ.",idIsEmpty:"Tên người dùng trống.",idContainsSpace:"Tên người dùng chứa dấu cách.",passwordContainsSpace:"Mật khẩu chứa dấu cách.",tcpKeepaliveInitialDelayMustBePositive:"Trì hoãn giữ kết nối TCP ban đầu phải dương.",blankLinePingInitialDelayMustBeGreaterThanOrEqualTo30:"Trì hoãn ping dòng trống ban đầu phải >=30.",blankLinePingIntervalMustBeGreaterThanOrEqualTo30:"Thời gian ping dòng trống phải >=30.",engineNotSelected:"Chưa chọn phần mềm.",forExportingConversionLogPleaseEnableAppLogsAndSetLogLevelDebugAndRestart:"Để xuất log chuyển đổi, vui lòng bật log ứng dụng, đặt cấp độ log thành DEBUG và khởi động lại ứng dụng.",sourceDirectoryNotSpecified:"Đường dẫn nguồn chưa được đặt.",sourceFileMustBeSFEN:"Tên tập tin phải có đuôi .sfen.",sourceFormatsNotSpecified:"Định dạng nguồn chưa được đặt.",destinationDirectoryNotSpecified:"Đường dẫn đến chưa được đặt.",destinationFileNotSpecified:"Tệp đến chưa được đặt.",anyUnsavedDataWillBeLostDoYouReallyWantToResetBookData:"Tất cả dữ liệu chưa lưu sẽ bị mất. Bạn có muốn đặt lại dữ liệu định thức?",bookMovesWereImported:"Dữ liệu định thức đã được nhập thành công.",anyBookMovesAreUnsavedDoYouReallyWantToDiscardThemAndCloseTheApp:"Có các nước định thức chưa lưu. Bạn có muốn hủy bỏ chúng và đóng ứng dụng?",cannotOverwriteOnTheFlyBook:"Không thể ghi đè lên sách đang sử dụng chế độ On-the-fly.",pleaseSpecifyOtherFileName:"Vui lòng chọn tên tệp khác.",memoryShortageOnBookConversionMayLoseUnsavedData:"定跡データの変換中にメモリが不足すると保存していないデータは失われる可能性があります。",cannotConvertAperyBookToOtherFormat:"Apery 定跡は他の形式に変換できません。",sourceRecordFileNotSet:"Chưa chỉ định tệp kỳ phổ gốc.",sourceDirectoryNotSet:"Vui lòng chọn một tập tin.",minPlyMustBeLessThanMaxPly:"Số nước ít nhất phải nhỏ hơn số nước lớn nhất.",playerNameNotSet:"Tên người chơi chưa được đặt.",incompatibleOptionsWillBeDiscardedDoYouReallyWantToReplaceTheEnginePath:"Các cài đặt không tương thích sẽ bị xóa bỏ. Bạn có thực sự muốn thay đổi đường dẫn phần mềm?",largeSuggestionsCountMayCausePerformanceDegradation:"Số nước đề xuất quá lớn có thể làm ứng dụng chậm đi đáng kể.",doYouReallyWantToIncreaseTheSuggestionsCount:"Bạn có thực sự muốn tăng số nước đề xuất?",recommendLowerSettingsForDailyUse:"Nên sử dụng cài đặt thấp hơn cho PC thông thường.",checkEngineCompatibilityForNumaEnvironments:"Máy tính này có thể có nhiều ổ CPU hoặc nhóm vi xử lý (NUMA). Các phần mềm không hỗ trợ NUMA có thể bị suy yếu. Vui lòng kiểm tra nếu phần mềm bạn dùng hỗ trợ NUMA.",aiPerformanceMayDegrade:"Tính năng phần mềm có thể suy giảm.",yourPCMayBecomeSlow:"Thao tác PC có thể bị chậm lại.",increasingItMayImproveAIPerformance:"Có thể cải thiện tính năng phần mềm bằng cách tăng lên.",totalNumber:e=>`Tổng: ${e}`,number:e=>""+e,tryToReloginToCSAServerNSecondsLater:e=>`Vui lòng đăng nhập lại sau ${e} giây.`,mateInNPlyDoYouWantToDisplay:e=>`Có chiếu hết trong ${e} nước. Bạn có muốn hiển thị?`,insertedNMovesToRecord:e=>`Đã chèn ${e} nước vào kỳ phổ.`,errorsOccurred:e=>`Đã có ${e} lỗi xảy ra.`,between:(e,t)=>`từ ${e} đến ${t}`,addNthEngine:e=>`Thêm phần mềm thứ ${e}`,copyOf:e=>`Bản sao của ${e}`,keepLatest:e=>`${e} bản mới nhất`,followingDataNotSavedBecauseNotSupporetedBy:e=>`Dữ liệu sau không được lưu vì không được định dạng "${e}" hỗ trợ.`,areYouSureWantToDeleteFollowingMove:e=>`Bạn có muốn xóa nước thứ ${e} trở đi không?`,failedToOpenDirectory:e=>`Mở tệp: ${e} thất bại`,unexpectedEventSenderPleaseReport:e=>`Nguồn sự kiện ngoài dự tính. Vui lòng báo cáo lỗi này cho nhà phát triển. [${e}]`,unexpectedHTTPMethodPleaseReport:e=>`Phương thức HTTP ngoài dự tính. Vui lòng báo cáo lỗi này cho nhà phát triển. [${e}]`,unexpectedRequestURLPleaseReport:e=>`URL yêu cầu ngoài dự tính. Vui lòng báo cáo lỗi này cho nhà phát triển. [${e}]`,noResponseFromEnginePleaseExtendTimeout:e=>`Không có phản hồi từ phần mềm sau ${e} giây. Vui lòng kéo dài thời gian hết giờ nếu phần mềm của bạn chậm.`,stableVersionReleased:e=>`Phiên bản ổn định ${e} đã ra mắt!`,latestVersionReleased:e=>`Phiên bản mới nhất ${e} đã ra mắt!`,doYouReallyWantToRemoveBookMove:e=>`Bạn có thực sự muốn xóa nước định thức ${e}?`,unexpectedRecordFileExtension:e=>`Định dạng kỳ phổ không được hỗ trợ. [${e}]`,fileNotFound:e=>`Không tìm thấy tệp. [${e}]`,directoryNotFound:e=>`Không tìm thấy tập tin. [${e}]`,youCanExitFullScreenByPressing:e=>`Bạn có thể thoát chế độ toàn màn hình bằng cách nhấn phím ${e}.`,skippedMovesInMerge:(e,t)=>`Trong ${t} nước, đã không thể sáp nhập ${e} nước.`,cpuUsageExceedsNPercent:e=>`Đang sử dụng quá ${e}% CPU.`,totalNumberOfThreadsExceedsNPercentOfCpuCores:e=>`Số luồng vượt quá ${e}% số lõi CPU.`,memoryUsageExceedsNPercent:e=>`Sử dụng RAM vượt quá ${e}%.`,memoryUsageIsLessThanNPercent:e=>`Sử dụng RAM ít hơn ${e}%.`,totalUSIHashExceedsNPercentOfMemory:e=>`Tổng USI_HASH vượt quá ${e}% RAM.`,heapUsageExceedsNGBMayHang:e=>`メモリ使用量が ${e}GB を超えました。増加傾向が続くとハングアップする可能性があります。`},l=s;function h(e){Object.entries(function(e){switch(e){case n.JA:return s;case n.EN:return a;case n.ZH_TW:return r;case n.VI:return c;default:return s}}(e)).forEach(([e,t])=>{l[e]=t})}const d={USI_Ponder:"相手番思考",Ponder:"相手番思考",USI_Hash:"ハッシュ",Hash:"ハッシュ",Clear_Hash:"ハッシュクリア",Threads:"スレッド",NumberOfThreads:"スレッド数",thread_num_per_gpu:"GPUあたりのスレッド数",ThreadIdOffset:"スレッドIDオフセット",MultiPV:"マルチPV(候補手の表示件数)",BookFile:"定跡ファイル",Book_File:"定跡ファイル",Book_Enable:"定跡あり",BookEvalDiff:"定跡の評価値差",book_file_name:"定跡ファイル名",use_book:"定跡を使用",BookPvMoves:"定跡PV手数",TinyBook:"小さい定跡",BookMoves:"定跡利用手数",BookMaxPly:"定跡最大手数",BookIgnoreRate:"定跡不使用率",RandomBookSelect:"ランダム定跡選択",IgnoreBookPly:"定跡の手数を無視",DepthLimit:"最大深さ",NarrowBook:"定跡手を限定",WriteDebugLog:"デバッグログ出力",Write_Debug_Log:"デバッグログ出力",ResignValue:"投了基準値",ResignScore:"投了基準値",PvInterval:"PV出力間隔",NodesLimit:"最大ノード数",USI_OwnBook:"定跡を使用",OwnBook:"定跡を使用",EvalDir:"評価関数のフォルダ",Eval_Dir:"評価関数のフォルダ",EvalFile:"評価関数ファイル",EvalHash:"評価値ハッシュ",Eval_Hash:"評価値ハッシュ",EvalSaveDir:"評価関数保存フォルダ",EvalShare:"評価値共有",BookDir:"定跡ファイルのフォルダ",Stochastic_Ponder:"確率的相手番思考",MinimumThinkingTime:"最小思考時間",Minimum_Thinking_Time:"最小思考時間",MinThinkingTime:"最小思考時間",MaxMovesToDraw:"強制引き分け手数",SlowMover:"長考",Slow_Mover:"長考",OutputFailLHPV:"Fail Low/Highを出力",NetworkDelay:"通信遅延",NetworkDelay2:"通信遅延2",FV_SCALE:"評価値スケール",UseBook:"定跡を使用",MaxDepth:"最大深さ",MarginMs:"マージン(ミリ秒)",Time_Margin:"時間マージン",ByoyomiMargin:"秒読みマージン",Byoyomi_Margin:"秒読みマージン",byoyomi_margin:"秒読みマージン",Move_Overhead:"着手オーバーヘッド",FischerMargin:"フィッシャーマージン",SuddenDeathMargin:"切れ負けマージン",Snappy:"素早く指す",EnteringKingRule:"入玉ルール",Do_YoTsume_Search:"余詰めを探索",gpu_num:"GPU数",ConsiderationMode:"検討モード",ConsiderBookMoveCount:"定跡出現率を使用",GenerateAllLegalMoves:"全合法手を生成",DrawScore:"引き分けのスコア",DrawValue:"引き分けの値",DrawValueBlack:"引き分けの値・先手",DrawValueWhite:"引き分けの値・後手",LargePageEnable:"LargePageを使用",SkillLevel:"スキルレベル",Skill_Level:"スキルレベル",BookOnTheFly:"定跡直接読み込み(大規模定跡)",BookDepthLimit:"定跡深さ制限",BookEvalBlackLimit:"定跡評価値制限・先手",BookEvalWhiteLimit:"定跡評価値制限・後手"},u={};function m(e){Object.keys(u).forEach(e=>{delete u[e]}),Object.entries(function(e){switch(e){case n.JA:return d;case n.EN:default:return{}}}(e)).forEach(([e,t])=>{u[e]=t})}var p=o(113);function g(e){return e instanceof p.InvalidPieceNameError?new Error(`${l.invalidPieceName}: ${e.data}`):e instanceof p.InvalidTurnError?new Error(`${l.invalidTurn}: ${e.data}`):e instanceof p.InvalidMoveError?new Error(`${l.invalidMove}: ${e.data}`):e instanceof p.InvalidMoveNumberError?new Error(`${l.invalidMoveNumber}: ${e.data}`):e instanceof p.InvalidDestinationError?new Error(`${l.invalidDestination}: ${e.data}`):e instanceof p.PieceNotExistsError?new Error(`${l.pieceNotExists}: ${e.data}`):e instanceof p.InvalidLineError?new Error(`${l.invalidLine}: ${e.data}`):e instanceof p.InvalidBoardError?new Error(`${l.invalidBoard}: ${e.data}`):e instanceof p.InvalidHandPieceError?new Error(`${l.invalidHandPiece}: ${e.data}`):e instanceof p.InvalidUSIError?new Error(`${l.invalidUSI}: ${e.data}`):e}function S(e){h(e),m(e)}},698(e,t,o){var n,i;o.d(t,{$:()=>i,F:()=>n}),function(e){e.APP="app",e.USI="usi",e.CSA="csa"}(n||(n={})),function(e){e.DEBUG="debug",e.INFO="info",e.WARN="warn",e.ERROR="error"}(i||(i={}))},170(e,t,o){var n;o.d(t,{K:()=>n}),function(e){e[e.PLAYER=0]="PLAYER",e[e.OPPONENT=1]="OPPONENT",e[e.RESEARCHER=2]="RESEARCHER",e[e.RESEARCHER_2=3]="RESEARCHER_2",e[e.RESEARCHER_3=4]="RESEARCHER_3",e[e.RESEARCHER_4=5]="RESEARCHER_4"}(n||(n={}))},389(e,t,o){var n,i;o.d(t,{F:()=>i,Q:()=>n}),function(e){e.NONE="none",e.INSERT="insert",e.APPEND="append",e.OVERWRITE="overwrite"}(n||(n={})),function(e){e.SHOGIHOME="shogihome",e.FLOODGATE="floodgate",e.CSA3="csa3",e.SHOGIGUI="shogigui"}(i||(i={}))},265(e,t,o){o.d(t,{$P:()=>f,VX:()=>S,_B:()=>m,eA:()=>g,uU:()=>y,xv:()=>T});var n=o(186),i=o(347),a=o(1),s=o(591),r=o(953),c=o.n(r),l=o(211),h=o(389);const[d,u]=[c().base64Decode,c().base64Encode];var m;function p(){return{protocolVersion:m.V121_FLOODGATE,host:"",port:4081,id:"",password:"",tcpKeepalive:{initialDelay:10},blankLinePing:{initialDelay:40,interval:40}}}function g(){return{player:{name:a.t.human,uri:n.He},server:p(),autoFlip:!0,enableComment:!0,enableAutoSave:!0,autoSaveDirectory:"",repeat:1,autoRelogin:!0,restartPlayerEveryGame:!1,searchCommentFormat:h.F.SHOGIHOME}}function S(e){const t=(0,i.$)(e.player);if(t)return t;const o=function(e){if(e.protocolVersion!==m.V121&&e.protocolVersion!==m.V121_FLOODGATE&&e.protocolVersion!==m.V121_X1)return new Error(a.t.protocolVersionNotSelected);if(""===e.host)return new Error(a.t.hostNameIsEmpty);if(e.port<0||e.port>65535)return new Error(a.t.invalidPortNumber);if(""===e.id)return new Error(a.t.idIsEmpty);if(e.id.indexOf(" ")>=0)return new Error(a.t.idContainsSpace);if(e.password.indexOf(" ")>=0)return new Error(a.t.passwordContainsSpace);if(e.tcpKeepalive.initialDelay<=0)return new Error(a.t.tcpKeepaliveInitialDelayMustBePositive);if(e.blankLinePing){if(e.blankLinePing.initialDelay<30)return new Error(a.t.blankLinePingInitialDelayMustBeGreaterThanOrEqualTo30);if(e.blankLinePing.interval<30)return new Error(a.t.blankLinePingIntervalMustBeGreaterThanOrEqualTo30)}}(e.server);return o||(e.server.protocolVersion!==m.V121&&e.server.protocolVersion!==m.V121_FLOODGATE?new Error("protocolVersion must be v121 or v121_floodgate"):!Number.isInteger(e.repeat)||e.repeat<1?new Error("repeat must be a positive integer"):void 0)}function y(e){return{player:{name:a.t.human,uri:n.He},serverHistory:[],autoFlip:!0,enableComment:!0,enableAutoSave:!!e?.autoSaveDirectory,autoSaveDirectory:(0,l.w)(e?.autoSaveDirectory||""),repeat:1,autoRelogin:!0,restartPlayerEveryGame:!1}}!function(e){e.V121="v121",e.V121_FLOODGATE="v121_floodgate",e.V121_X1="v121_x1"}(m||(m={}));function f(e,t){const o=(0,s.X1)(e.usi,t?.playerURI);return{player:{name:e.usi.name,uri:o.uri,usi:o},server:e.server,autoFlip:!0,enableComment:e.enableComment,enableAutoSave:e.saveRecordFile,autoSaveDirectory:t?.autoSaveDirectory||"",repeat:e.repeat,autoRelogin:e.autoRelogin,restartPlayerEveryGame:e.restartPlayerEveryGame,searchCommentFormat:e.searchCommentFormat||h.F.SHOGIHOME}}async function T(e){const t=new Uint8Array(d(e)),o=new DecompressionStream("gzip");return new Blob([t]).stream().pipeThrough(o),JSON.parse(await new Response(o.readable).text())}},347(e,t,o){o.d(t,{$:()=>r,w:()=>s});var n=o(1),i=o(591),a=o(186);function s(){return{name:n.t.human,uri:a.He}}function r(e){if(!e.name)return new Error("player name is required");if(!e.uri)return new Error("player URI is required");if(a.Em(e.uri)){if(!e.usi)return new Error("USI is required");const t=(0,i.wb)(e.usi);if(t)return t}else if(a.b0(e.uri)){if(!a.iM.some(t=>t===e.uri))return new Error("invalid player URI")}else if(e.uri!==a.He)return new Error("invalid player URI")}},591(e,t,o){o.d(t,{Br:()=>d,If:()=>h,J3:()=>m,Lo:()=>g,X1:()=>A,YZ:()=>l,aW:()=>u,my:()=>p,pk:()=>S,wb:()=>E,z4:()=>k});var n=o(186),i=o(1),a=o(953),s=o.n(a);const[r,c]=[s().base64Decode,s().base64Encode],l="USI_Ponder",h="USI_Hash",d="USI_MultiPV",u="MultiPV";function m(e){if(e&&"button"!==e.type)return void 0!==e.value?e.value:"string"!==e.type&&"filename"!==e.type||"<empty>"!==e.default?e.default:""}function p(e){return"true"===m(e.options[l])}function g(e){const t=m(e.options[d])||m(e.options[u]);return"number"==typeof t?t:void 0}function S(e){return"true"===m(e.options.Stochastic_Ponder)}var y;function f(e){switch(e){case"game":return i.t.game;case"research":return i.t.research;case"mate":return i.t.mateSearch}}function T(e){switch(e){case y.GAME:return f("game");case y.RESEARCH:return f("research");case y.MATE:return f("mate")}}function v(e){return Object.entries(e).filter(([e,t])=>t&&T(e)).map(([e])=>T(e))}function C(e){switch(e){case f("game"):return y.GAME;case f("research"):return y.RESEARCH;case f("mate"):return y.MATE}}function b(e){const t={[y.GAME]:!1,[y.RESEARCH]:!1,[y.MATE]:!1};for(const o of e){const e=C(o);e&&(t[e]=!0)}return t}function E(e){if(!n.Em(e.uri))return new Error("invalid engine URI");if(!e.name&&!e.defaultName)return new Error("engine name is required");if(!e.path)return new Error("engine path is required");for(const t in e.options){const o=e.options[t];if(!["check","spin","combo","button","string","filename"].includes(o.type))return new Error(`invalid option type: name=[${t}] type=[${o.type}]`);if(!P(o))return new Error(`invalid option value: name=[${t}] type=[${o.type}]`+("button"!==o.type?` value=[${o.value}]`:""))}}function P(e){if("button"===e.type||void 0===e.value)return!0;switch(e.type){case"check":if("true"!==e.value&&"false"!==e.value)return!1;break;case"spin":if("number"!=typeof e.value)return!1;if(void 0!==e.min&&e.value<e.min&&e.value!==e.default)return!1;if(void 0!==e.max&&e.value>e.max&&e.value!==e.default)return!1;break;case"string":case"filename":case"combo":if("string"!=typeof e.value)return!1}return!0}!function(e){e.GAME="game",e.RESEARCH="research",e.MATE="mate"}(y||(y={}));const I={blue:"#1565C0",green:"#2E7D32",orange:"#D84315",brown:"#5D4037",purple:"#7B1FA2",indigo:"#303F9F",amber:"#EF6C00",gray:"#616161",pink:"#C2185B"};class k{engines={};tagColorMapping={};constructor(e){if(e){const t=JSON.parse(e);Object.keys(t.engines).filter(n.Em).forEach(e=>{const o={uri:"",name:"",defaultName:"",author:"",path:"",options:{},labels:{game:!0,research:!0,mate:!0},tags:[f("game"),f("research"),f("mate")],enableEarlyPonder:!1,extraBook:{enabled:!1,filePath:"",onTheFly:!1}},n=t.engines[e];this.engines[e]={...o,...n,uri:e,labels:{...o.labels,...n.labels},tags:n.tags||v(n.labels||{})}}),this.tagColorMapping=t.tagColorMapping||{},this.updateTagColorMapping()}}hasEngine(e){return!!this.engines[e]}addEngine(e){this.engines[e.uri]=e,this.updateTagColorMapping()}updateEngine(e){return!!this.engines[e.uri]&&(this.engines[e.uri]=e,this.updateTagColorMapping(),!0)}removeEngine(e){return!!this.engines[e]&&(delete this.engines[e],this.updateTagColorMapping(),!0)}getEngine(e){return this.engines[e]}get engineList(){return Object.values(this.engines).sort((e,t)=>e.name!==t.name?e.name>t.name?1:-1:e.defaultName!==t.defaultName?e.defaultName>t.defaultName?1:-1:e.uri>t.uri?1:-1)}get tagList(){return Object.entries(this.tagColorMapping).map(([e,t])=>({name:e,color:I[t]})).sort((e,t)=>e.name>t.name?1:-1)}getTagColor(e){const t=this.tagColorMapping[e]||"blue";return I[t]||I.blue}addTag(e,t){this.engines[e]&&(this.engines[e].tags=this.engines[e].tags||[],this.engines[e].tags.includes(t)||this.engines[e].tags.push(t),this.updateTagColorMapping(),this.engines[e].labels=b(this.engines[e].tags))}removeTag(e,t){this.engines[e]&&(this.engines[e].tags=this.engines[e].tags?.filter(e=>e!==t),this.updateTagColorMapping(),this.engines[e].labels=b(this.engines[e].tags||[]))}updateTagColorMapping(){const e=new Set;for(const t of Object.values(this.engines))for(const o of t.tags??[])e.add(o);const t=Object.keys(I),o=new Set(Object.values(this.tagColorMapping)),n=t.filter(e=>!o.has(e));let i=Object.keys(this.tagColorMapping).length;for(const o of e)if(!this.tagColorMapping[o]){const e=n.shift()??t[i%t.length];this.tagColorMapping[o]=e,i++}for(const t of Object.keys(this.tagColorMapping))e.has(t)||delete this.tagColorMapping[t]}get json(){return JSON.stringify(this)}get jsonWithIndent(){return JSON.stringify(this,void 0,2)}getClone(){return new k(this.json)}}function A(e,t){const o={};for(const t in e.options){const n=e.options[t];switch(n.type){case"check":o[t]={name:t,type:"check",order:0,value:n.value?"true":"false"};break;case"spin":o[t]={name:t,type:"spin",order:0,value:n.value};break;case"combo":o[t]={name:t,type:"combo",order:0,value:n.value,vars:[n.value]};break;default:o[t]={name:t,type:n.type,order:0,value:n.value}}}return{uri:t||(0,n.A7)(),name:e.name,defaultName:e.name,author:"",path:e.path,options:o,enableEarlyPonder:e.enableEarlyPonder,extraBook:e.extraBook,labels:{}}}},186(e,t,o){o.d(t,{A7:()=>m,DI:()=>r,Em:()=>u,He:()=>n,KY:()=>h,b0:()=>d,iM:()=>c,ke:()=>a,m7:()=>p,y3:()=>s});o(1);const n="es://human",i="es://basic-engine/",a=`${i}static_rook/v1`,s=`${i}ranging_rook/v1`,r=`${i}random`,c=[a,s,r],l="es://usi-engine/",h="es://layout-profile/standard";function d(e){return e.startsWith(i)}function u(e){return e.startsWith(l)}function m(){const e=Date.now(),t=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16);return l+`${e}/${t}`}function p(e){return`es://temp-file/${Date.now()}/${Math.floor(Math.random()*16**6).toString(16).padStart(6,"0")}/${e}`}},348(e,t,o){o.r(t),o.d(t,{CSAGameManager:()=>y,CSAGameState:()=>g,loginRetryIntervalSeconds:()=>p,onCSAClose:()=>P,onCSAGameResult:()=>E,onCSAGameSummary:()=>T,onCSAMove:()=>b,onCSAReject:()=>v,onCSAStart:()=>C});var n=o(676),i=o(690),a=o(154),s=o(265),r=o(113),c=o(389),l=o(170),h=o(1),d=o(178),u=o(128),m=o(186);const p=10;var g,S;!function(e){e[e.OFFLINE=0]="OFFLINE",e[e.PLAYER_SETUP=1]="PLAYER_SETUP",e[e.WAITING_LOGIN=2]="WAITING_LOGIN",e[e.LOGIN_FAILED=3]="LOGIN_FAILED",e[e.LOGIN_RETRY_INTERVAL=4]="LOGIN_RETRY_INTERVAL",e[e.READY=5]="READY",e[e.GAME=6]="GAME"}(g||(g={})),function(e){e[e.DO_NOT_RELOGIN=0]="DO_NOT_RELOGIN",e[e.RELOGIN_WITH_INTERVAL=1]="RELOGIN_WITH_INTERVAL",e[e.RELOGIN_IMMEDIATELY=2]="RELOGIN_IMMEDIATELY"}(S||(S={}));class y{recordManager;blackClock;whiteClock;_state=g.OFFLINE;_settings=(0,s.eA)();_sessionID=0;stopRequested=!1;repeat=0;player;gameSummary=(0,i.Rr)();searchInfo;playerBuilder=(0,a.c)();retryTimer;onSaveRecord=()=>{};onGameNext=()=>{};onNewGame=()=>{};onClosed=()=>{};onLoginRetry=()=>{};onFlipBoard=()=>{};onPieceBeat=()=>{};onBeepShort=()=>{};onBeepUnlimited=()=>{};onStopBeep=()=>{};onError=()=>{};constructor(e,t,o){this.recordManager=e,this.blackClock=t,this.whiteClock=o}on(e,t){switch(e){case"saveRecord":this.onSaveRecord=t;break;case"gameNext":this.onGameNext=t;break;case"newGame":this.onNewGame=t;break;case"closed":this.onClosed=t;break;case"loginRetry":this.onLoginRetry=t;break;case"flipBoard":this.onFlipBoard=t;break;case"pieceBeat":this.onPieceBeat=t;break;case"beepShort":this.onBeepShort=t;break;case"beepUnlimited":this.onBeepUnlimited=t;break;case"stopBeep":this.onStopBeep=t;break;case"error":this.onError=t}return this}get state(){return this._state}get settings(){return this._settings}get sessionID(){return this._sessionID}get usiSessionID(){return this.player instanceof u.USIPlayer?this.player.sessionID:0}get isMyTurn(){return this.recordManager.record.position.color===this.gameSummary.myColor}get waitingForHumanPlayerMove(){return this.isMyTurn&&this.settings.player.uri===m.He}async login(e,t){if(this.sessionID)throw new Error("CSAGameManager#login: session already exists");if(this._state!==g.OFFLINE)throw new Error("CSAGameManager#login: unexpected state");this._state=g.PLAYER_SETUP,this._settings=e,this.playerBuilder=t,this.repeat=0;try{this.player=await this.playerBuilder.build(this._settings.player,e=>this.recordManager.updateSearchInfo(l.K.OPPONENT,e))}catch(e){throw this._state=g.OFFLINE,e}this.doLogin().catch(this.onError)}async relogin(){if(this.settings.restartPlayerEveryGame){this._state=g.PLAYER_SETUP,this.player&&(await this.player.close(),this.player=void 0);try{this.player=await this.playerBuilder.build(this._settings.player,e=>this.recordManager.updateSearchInfo(l.K.OPPONENT,e))}catch(e){throw this._state=g.LOGIN_FAILED,this.close(S.RELOGIN_WITH_INTERVAL),e}}await this.doLogin()}async doLogin(){if(!this.player)throw new Error("CSAGameManager#login: player is not initialized");try{this._state=g.PLAYER_SETUP,await this.player.readyNewGame(),this._state=g.WAITING_LOGIN;const e=await n.Ay.csaLogin(this._settings.server);this._sessionID=e,this._state=g.READY,function(e,t){f[e]=t}(this.sessionID,this),this.onGameNext()}catch(e){throw this._state=g.LOGIN_FAILED,this.close(S.RELOGIN_WITH_INTERVAL),new Error(`CSAGameManager#login: ${h.t.failedToStartNewGame}: ${e}`)}}stop(){this.sessionID&&(this.stopRequested=!0,n.Ay.csaStop(this.sessionID))}logout(){this.close(S.DO_NOT_RELOGIN)}close(e){if(this._state!==g.OFFLINE&&this._state!==g.WAITING_LOGIN){var t;if(this._state===g.GAME&&this.settings.enableAutoSave&&this.onSaveRecord(this.settings.autoSaveDirectory),this.stopRequested&&(e=S.DO_NOT_RELOGIN,this.stopRequested=!1),this.sessionID&&(t=this.sessionID,delete f[t],n.Ay.csaLogout(this.sessionID).catch(e=>{this.onError(new Error(`CSAGameManager#close: ${h.t.errorOccuredWhileLogoutFromCSAServer}: ${e}`))}),this._sessionID=0),this.blackClock.stop(),this.whiteClock.stop(),this._state=g.OFFLINE,this.retryTimer&&(clearTimeout(this.retryTimer),this.retryTimer=void 0),e===S.DO_NOT_RELOGIN||this.repeat>=this.settings.repeat)return this.player&&(this.player.close().catch(e=>{this.onError(new Error(`CSAGameManager#close: ${h.t.failedToShutdownEngines}: ${e}`))}),this.player=void 0),void this.onClosed();e===S.RELOGIN_IMMEDIATELY?this.relogin().catch(this.onError):(this._state=g.LOGIN_RETRY_INTERVAL,this.onLoginRetry(),this.retryTimer=setTimeout(()=>this.relogin().catch(this.onError),1e3*p))}}onGameSummary(e){this.gameSummary=e;const t=this.recordManager.importRecord(this.gameSummary.position,{type:r.RecordFormatType.CSA});if(t)return this.onError(`CSAGameManager#onGameSummary: ${t}`),void this.close(S.DO_NOT_RELOGIN);this.recordManager.changePly(Number.MAX_SAFE_INTEGER),n.Ay.csaAgree(this.sessionID,this.gameSummary.id)}onReject(){this.close(S.RELOGIN_WITH_INTERVAL)}onStart(e){this.repeat++,this.onNewGame(this.repeat);const t=this.gameSummary.players.black.time,o=this.gameSummary.players.white.time;this.recordManager.setGameStartMetadata({gameTitle:this.gameSummary.id,blackName:this.gameSummary.players.black.playerName,whiteName:this.gameSummary.players.white.playerName,blackTimeLimit:{timeSeconds:t.totalTime*t.timeUnitMs/1e3,byoyomi:t.byoyomi*t.timeUnitMs/1e3,increment:t.increment*t.timeUnitMs/1e3},whiteTimeLimit:{timeSeconds:o.totalTime*o.timeUnitMs/1e3,byoyomi:o.byoyomi*o.timeUnitMs/1e3,increment:o.increment*o.timeUnitMs/1e3}}),this.settings.autoFlip&&this.onFlipBoard&&this.onFlipBoard(this.gameSummary.myColor===r.Color.WHITE),this._state=g.GAME,this.next(e)}onMove(e,t){const o=this.isMyTurn,n=(0,r.parseCSAMove)(this.recordManager.record.position,e);if(n instanceof Error)this.onError(`CSAGameManager#onMove: 解釈できない指し手 [${e}]: ${n.message}`);else{if(this.recordManager.appendMove({move:n,moveOption:{ignoreValidation:!0},elapsedMs:this.parseElapsedMs(n.color,e)}),o&&this.searchInfo&&this.recordManager.updateSearchInfo(l.K.PLAYER,this.searchInfo),o&&this.searchInfo&&this.settings.enableComment){const e=this.gameSummary.players[n.color].playerName;this.recordManager.appendSearchComment(l.K.PLAYER,this.settings.searchCommentFormat,this.searchInfo,c.Q.APPEND,{engineName:e})}this.onPieceBeat(),this.next(t)}}parseElapsedMs(e,t){const o=this.gameSummary.players[e].time,n=/^.*,T([0-9]+)$/.exec(t);return n?Number(parseInt(n[1]))*o.timeUnitMs:0}onGameResult(e,t){if(this.recordManager.appendMove({move:this.gameResultToSpecialMove(e,t)}),this.player){let e;switch(t){case i.j5.WIN:e=d.q.WIN;break;case i.j5.LOSE:e=d.q.LOSE;break;case i.j5.DRAW:case i.j5.CENSORED:case i.j5.CHUDAN:e=d.q.DRAW}this.player.gameover(e)}this.close(S.RELOGIN_IMMEDIATELY)}gameResultToSpecialMove(e,t){const o=this.recordManager.record.position.color;switch(e){case i.kt.RESIGN:return r.SpecialMoveType.RESIGN;case i.kt.SENNICHITE:return r.SpecialMoveType.REPETITION_DRAW;case i.kt.OUTE_SENNICHITE:case i.kt.ILLEGAL_MOVE:case i.kt.ILLEGAL_ACTION:switch(t){case i.j5.WIN:return o===this.gameSummary.myColor?r.SpecialMoveType.FOUL_WIN:r.SpecialMoveType.FOUL_LOSE;case i.j5.LOSE:return o===this.gameSummary.myColor?r.SpecialMoveType.FOUL_LOSE:r.SpecialMoveType.FOUL_WIN}break;case i.kt.TIME_UP:return r.SpecialMoveType.TIMEOUT;case i.kt.JISHOGI:return r.SpecialMoveType.ENTERING_OF_KING;case i.kt.MAX_MOVES:return r.SpecialMoveType.IMPASS}return t===i.j5.DRAW?r.SpecialMoveType.DRAW:r.SpecialMoveType.INTERRUPT}onClose(){this.close(this.settings.autoRelogin?S.RELOGIN_WITH_INTERVAL:S.DO_NOT_RELOGIN)}next(e){this.blackClock.stop(),this.whiteClock.stop(),this.syncClock(e),this.startClock();this.recordManager.record.position.color===this.gameSummary.myColor?this.startSearch(e):this.startPonder()}syncClock(e){const t={onBeepShort:()=>this.onBeepShort(),onBeepUnlimited:()=>this.onBeepUnlimited(),onStopBeep:()=>this.onStopBeep()},o=this.gameSummary.players.black.time;this.blackClock.setup({...t,timeMs:e.black.time*o.timeUnitMs,byoyomi:o.byoyomi*o.timeUnitMs/1e3});const n=this.gameSummary.players.white.time;this.whiteClock.setup({...t,timeMs:e.white.time*n.timeUnitMs,byoyomi:n.byoyomi*n.timeUnitMs/1e3})}startClock(){this.recordManager.record.position.color===r.Color.BLACK?this.blackClock.start():this.whiteClock.start()}startSearch(e){this.player?this.player.startSearch(this.recordManager.record.position,this.recordManager.record.usi,this.buildTimeStates(e),{onMove:this.onPlayerMove.bind(this),onResign:this.onPlayerResign.bind(this),onWin:this.onPlayerWin.bind(this),onError:this.onPlayerError.bind(this)}).catch(e=>{this.onError(new Error(`CSAGameManager#startSearch: ${h.t.failedToSendGoCommand}: ${e}`))}):this.onError("CSAGameManager#startSearch: player is not initialized")}startPonder(){this.player?this.player.startPonder(this.recordManager.record.position,this.recordManager.record.usi,this.buildTimeStates()).catch(e=>{this.onError(new Error(`CSAGameManager#startPonder: ${h.t.failedToSendPonderCommand}: ${e}`))}):this.onError("CSAGameManager#startPonder: player is not initialized")}startEarlyPonder(e){if(!this.player)return void this.onError("CSAGameManager#startEarlyPonder: player is not initialized");const t=this.recordManager.record.position.clone(),o=this.recordManager.record.usi+" "+e.usi;t.doMove(e)?this.player.startPonder(t,o,this.buildTimeStates()).catch(e=>{this.onError(new Error(`CSAGameManager#startEarlyPonder: ${h.t.failedToSendPonderCommand}: ${e}`))}):this.onError("CSAGameManager#startEarlyPonder: failed to make a move")}buildTimeStates(e){const t=this.gameSummary.players.black.time,o=this.gameSummary.players.white.time;return{black:{timeMs:e?e.black.time*t.timeUnitMs:this.blackClock.timeMs,byoyomi:t.byoyomi*t.timeUnitMs/1e3,increment:t.increment*t.timeUnitMs/1e3},white:{timeMs:e?e.white.time*o.timeUnitMs:this.whiteClock.timeMs,byoyomi:o.byoyomi*o.timeUnitMs/1e3,increment:o.increment*o.timeUnitMs/1e3}}}onPlayerMove(e,t){let o,i;switch(this.searchInfo=t,this._settings.server.protocolVersion){case s._B.V121:break;case s._B.V121_FLOODGATE:o=t?.score,t?.pv?.forEach(e=>{i=i?i+" ":"",i+=(0,r.formatCSAMove)(e)})}n.Ay.csaMove(this.sessionID,(0,r.formatCSAMove)(e),o,i),this.settings.player.usi?.enableEarlyPonder&&this.startEarlyPonder(e)}onPlayerResign(){n.Ay.csaResign(this.sessionID)}onPlayerWin(){n.Ay.csaWin(this.sessionID)}onPlayerError(e){this.onError(e)}}const f={};function T(e,t){f[e]?.onGameSummary(t)}function v(e){f[e]?.onReject()}function C(e,t){f[e]?.onStart(t)}function b(e,t,o){f[e]?.onMove(t,o)}function E(e,t,o){f[e]?.onGameResult(t,o)}function P(e){f[e]?.onClose()}},578(e,t,o){o.d(t,{P8:()=>s,OL:()=>r});var n=o(113),i=o(789),a=o(516);function s(e){return e.substring(Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"))+1)}function r(e,t={}){const o=e.metadata,s=function(e){const t=e.getStandardMetadata(n.RecordMetadataKey.START_DATETIME)||e.getStandardMetadata(n.RecordMetadataKey.DATE);if(t)return t.trim().replaceAll(" ","_").replaceAll("/","").replaceAll(":","")}(o)||(0,i.sq)().replaceAll("/",""),r=function(e){return e.getStandardMetadata(n.RecordMetadataKey.TITLE)||e.getStandardMetadata(n.RecordMetadataKey.TOURNAMENT)||e.getStandardMetadata(n.RecordMetadataKey.OPUS_NAME)||e.getStandardMetadata(n.RecordMetadataKey.OPUS_NO)||e.getStandardMetadata(n.RecordMetadataKey.PLACE)||e.getStandardMetadata(n.RecordMetadataKey.POSTED_ON)||e.getStandardMetadata(n.RecordMetadataKey.AUTHOR)}(o),c=(0,n.getBlackPlayerName)(o),l=(0,n.getWhitePlayerName)(o),h=Math.floor(1048576*Math.random()).toString(16).toUpperCase().padStart(5,"0");let d=0;for(let t=e.first.next;t&&t.move instanceof n.Move;t=t.next)d=t.ply;const u={datetime:s,title:r||"",sente:c||"",gote:l||"",ply:d.toString(),hex5:h};for(const e in u){const t=u[e];u["_"+e]=t?"_"+t:"",u[e+"_"]=t?t+"_":""}let m=t.template||a.g;m=(0,a.D)(m);for(const e in u){const t=u[e];m=(0,a.D)(m.replaceAll("{"+e+"}",t))}return m=m.trim(),t.extension?m+=t.extension.startsWith(".")?t.extension:"."+t.extension:m+=".kif",m}},676(e,t,o){o.d(t,{Ay:()=>te});var n=o(591),i=o(389);function a(){return{startCriteria:{enableNumber:!1,number:20},endCriteria:{enableNumber:!1,number:100},perMoveCriteria:{maxSeconds:5},descending:!1,commentBehavior:i.Q.INSERT}}var s,r,c,l,h,d,u,m,p,g,S,y,f,T,v,C,b,E,P,I,k,A,M,N,w,R=o(1),O=o(698),F=o(176),D=o(516),L=o(186);function B(e){return{language:R.TM.JA,thema:h.STANDARD,backgroundImageType:d.NONE,boardLayoutType:s.STANDARD,pieceImage:u.HITOMOJI_WOOD,kingPieceType:m.GYOKU_AND_OSHO,deletePieceImageMargin:!1,boardImage:p.LIGHT2,boardGridColor:null,pieceStandImage:g.DARK_WOOD,promotionSelectorStyle:S.HORIZONTAL,enableTransparent:!1,boardOpacity:1,pieceStandOpacity:1,recordOpacity:1,boardLabelType:y.STANDARD,leftSideControlType:f.STANDARD,rightSideControlType:T.STANDARD,pieceVolume:30,clockVolume:30,clockPitch:500,clockSoundTarget:I.ONLY_USER,recordShortcutKeys:k.VERTICAL,boardFlipping:!1,enableDragAndDrop:!0,tabPaneType:v.DOUBLE_V2,tab:C.RECORD_INFO,tab2:C.CHART,topPaneHeightPercentage:60,topPanePreviousHeightPercentage:60,bottomLeftPaneWidthPercentage:60,defaultRecordFileFormat:F.vr.KIF,textDecodingRule:b.AUTO_DETECT,returnCode:e?.returnCode||"\r\n",autoSaveDirectory:e?.autoSaveDirectory||"",recordFileNameTemplate:D.g,useCSAV3:!1,useUTF8ForKifAndKi2:!1,enableUSIFileStartpos:!0,enableUSIFileResign:!1,enableUSIFileSpecialMoves:!1,showPasteDialog:!0,liveDuplicatePositionDetection:!0,bookOnTheFlyThresholdMB:64,yaneBookOnTheFlyThresholdMB:64,aperyBookOnTheFlyThresholdMB:64,sbkOnTheFlyThresholdMB:16,flippedBook:!0,translateEngineOptionName:!0,engineTimeoutSeconds:10,nodeCountFormat:E.COMMA_SEPARATED,showEngineOptionDetails:!1,evaluationViewFrom:P.EACH,maxArrowsPerEngine:3,arrowScoreDiffRange:100,showArrowScore:!0,coefficientInSigmoid:600,badMoveLevelThreshold1:5,badMoveLevelThreshold2:10,badMoveLevelThreshold3:20,badMoveLevelThreshold4:50,maxPVTextLength:15,searchCommentFormat:i.F.SHOGIHOME,showElapsedTimeInRecordView:!0,showCommentInRecordView:!0,branchListMode:w.SIBLING,enableAppLog:!1,enableUSILog:!1,enableCSALog:!1,logLevel:O.$.INFO,positionImageStyle:A.BOOK,positionImageSize:500,positionImageTypeface:M.GOTHIC,positionImageHandLabelType:N.PLAYER_NAME,useBookmarkAsPositionImageHeader:!1,positionImageHeader:"",positionImageCharacterY:0,positionImageFontScale:1,positionImageFontWeight:r.W400X,lastRecordFilePath:"",lastBookFilePath:"",lastUSIEngineFilePath:"",lastImageExportFilePath:"",lastOtherFilePath:"",emptyRecordInfoVisibility:!0,enableHardwareAcceleration:!0}}!function(e){e.STANDARD="standard",e.COMPACT="compact",e.PORTRAIT="portrait"}(s||(s={})),function(e){e.W400="400",e.W400X="400+",e.W700X="700+"}(r||(r={})),function(e){e.RAW="raw",e.WIN_RATE="winRate"}(c||(c={})),function(e){e.LEFT="left",e.CENTER="center",e.RIGHT="right"}(l||(l={})),function(e){e.STANDARD="standard",e.CHERRY_BLOSSOM="cherry-blossom",e.AUTUMN="autumn",e.SNOW="snow",e.CLASSIC="classic",e.BEIGE="beige",e.DARK_GREEN="dark-green",e.DARK="dark"}(h||(h={})),function(e){e.NONE="none",e.COVER="cover",e.CONTAIN="contain",e.TILE="tile"}(d||(d={})),function(e){e.HITOMOJI="hitomoji",e.HITOMOJI_WOOD="hitomojiWood",e.HITOMOJI_DARK="hitomojiDark",e.HITOMOJI_GOTHIC="hitomojiGothic",e.HITOMOJI_GOTHIC_DARK="hitomojiGothicDark",e.FUTAMOJI="futamoji",e.CUSTOM_IMAGE="custom-image"}(u||(u={})),function(e){e.GYOKU_AND_OSHO="gyokuAndOsho",e.GYOKU_AND_GYOKU="gyokuAndGyoku"}(m||(m={})),function(e){e.LIGHT="light",e.LIGHT2="light2",e.LIGHT3="light3",e.WARM="warm",e.WARM2="warm2",e.RESIN="resin",e.RESIN2="resin2",e.RESIN3="resin3",e.GREEN="green",e.CHERRY_BLOSSOM="cherry-blossom",e.AUTUMN="autumn",e.SNOW="snow",e.DARK_GREEN="dark-green",e.DARK="dark",e.CUSTOM_IMAGE="custom-image"}(p||(p={})),function(e){e.STANDARD="standard",e.DARK_WOOD="dark-wood",e.GREEN="green",e.CHERRY_BLOSSOM="cherry-blossom",e.AUTUMN="autumn",e.SNOW="snow",e.DARK_GREEN="dark-green",e.DARK="dark",e.CUSTOM_IMAGE="custom-image"}(g||(g={})),function(e){e.HORIZONTAL="horizontal",e.VERTICAL_PREFER_BOTTOM="verticalPreferBottom",e.HORIZONTAL_PREFER_RIGHT="horizontalPreferRight"}(S||(S={})),function(e){e.NONE="none",e.STANDARD="standard"}(y||(y={})),function(e){e.NONE="none",e.STANDARD="standard"}(f||(f={})),function(e){e.NONE="none",e.STANDARD="standard"}(T||(T={})),function(e){e.SINGLE="single",e.DOUBLE="double",e.DOUBLE_V2="doubleV2"}(v||(v={})),function(e){e.RECORD_INFO="recordInfo",e.COMMENT="comment",e.SEARCH="search",e.PV="pv",e.CHART="chart",e.PERCENTAGE_CHART="percentageChart",e.MONITOR="monitor",e.INVISIBLE="invisible"}(C||(C={})),function(e){e.STRICT="strict",e.AUTO_DETECT="autoDetect"}(b||(b={})),function(e){e.PLAIN="plain",e.COMMA_SEPARATED="commaSeparated",e.COMPACT="compact",e.JAPANESE="japanese"}(E||(E={})),function(e){e.BLACK="black",e.EACH="each"}(P||(P={})),function(e){e.ALL="all",e.ONLY_USER="onlyUser"}(I||(I={})),function(e){e.VERTICAL="vertical",e.HORIZONTAL="horizontal"}(k||(k={})),function(e){e.BOOK="book",e.GAME="game"}(A||(A={})),function(e){e.GOTHIC="gothic",e.MINCHO="mincho"}(M||(M={})),function(e){e.PLAYER_NAME="playerName",e.SENTE_GOTE="senteGote",e.MOCHIGOMA="mochigoma",e.TSUME_SHOGI="tsumeShogi",e.NONE="none"}(N||(N={})),function(e){e.SIBLING="sibling",e.NEXT_MOVE="nextMove"}(w||(w={}));var U,_=o(113),G=o(347),H=o(211);!function(e){e.NONE="none",e.GENERAL24="general24",e.GENERAL27="general27",e.TRY="try"}(U||(U={}));U.GENERAL24,U.GENERAL27;function W(e){return{black:(0,G.w)(),white:(0,G.w)(),timeLimit:{timeSeconds:0,byoyomi:30,increment:0},startPosition:_.InitialPositionType.STANDARD,startPositionSFEN:"",startPositionListFile:"",startPositionListOrder:"sequential",enableEngineTimeout:!1,humanIsFront:!0,enableComment:!0,enableAutoSave:!!e?.autoSaveDirectory,autoSaveDirectory:(0,H.w)(e?.autoSaveDirectory||""),repeat:1,parallelism:1,swapPlayers:!1,maxMoves:1e3,jishogiRule:U.GENERAL27,searchCommentFormat:i.F.SHOGIHOME,sprtEnabled:!1,sprt:{elo0:.5,elo1:2.5,alpha:.05,beta:.05,maxGames:1e5}}}var x,K,$,V,Y=o(265);function J(){return{sourceType:x.DIRECTORY,source:"",sourceFormats:[F.vr.KIF,F.vr.KIFU,F.vr.KI2,F.vr.KI2U,F.vr.CSA,F.vr.JKF],subdirectories:!0,singleFileSource:"",destinationType:K.DIRECTORY,destination:"",createSubdirectories:!0,destinationFormat:F.vr.KIF,fileNameConflictAction:$.NUMBER_SUFFIX,singleFileDestination:"",enableUSIResign:!0}}!function(e){e.DIRECTORY="directory",e.SINGLE_FILE="singleFile"}(x||(x={})),function(e){e.DIRECTORY="directory",e.SINGLE_FILE="singleFile"}(K||(K={})),function(e){e.OVERWRITE="overwrite",e.NUMBER_SUFFIX="numberSuffix",e.SKIP="skip"}($||($={})),function(e){e.USER="user",e.BACKUP="backup",e.BACKUP_V2="backupV2"}(V||(V={}));var j,q=o(578);!function(e){e.APP_SETTINGS="appSetting",e.RESEARCH_SETTINGS="researchSetting",e.BATCH_CONVERSION_SETTINGS="batchConversionSetting",e.ANALYSIS_SETTINGS="analysisSetting",e.GAME_SETTINGS="gameSetting",e.MATE_SEARCH_SETTINGS="mateSearchSetting",e.CSA_GAME_SETTINGS_HISTORY="csaGameSettingHistory"}(j||(j={}));const z=new Map,X={updateAppState(){},fetchProcessArgs:async()=>JSON.stringify({}),onClosable(){},onClose(){},onSendError(){},onSendMessage(){},onSendNotification(){},onMenuEvent(){},async loadAppSettings(){const e=localStorage.getItem(j.APP_SETTINGS);return e?JSON.stringify({...B(),...JSON.parse(e)}):JSON.stringify(B())},async saveAppSettings(e){localStorage.setItem(j.APP_SETTINGS,e)},async loadBatchConversionSettings(){const e=localStorage.getItem(j.BATCH_CONVERSION_SETTINGS);return e?JSON.stringify({...J(),...JSON.parse(e)}):JSON.stringify(J())},async saveBatchConversionSettings(e){localStorage.setItem(j.BATCH_CONVERSION_SETTINGS,e)},async loadResearchSettings(){const e=localStorage.getItem(j.RESEARCH_SETTINGS);return e?JSON.stringify({enableMaxSeconds:!1,maxSeconds:10,overrideMultiPV:!1,multiPV:1,...JSON.parse(e)}):JSON.stringify({enableMaxSeconds:!1,maxSeconds:10,overrideMultiPV:!1,multiPV:1})},async saveResearchSettings(e){localStorage.setItem(j.RESEARCH_SETTINGS,e)},async loadAnalysisSettings(){const e=localStorage.getItem(j.ANALYSIS_SETTINGS);return e?JSON.stringify({...a(),...JSON.parse(e)}):JSON.stringify(a())},async saveAnalysisSettings(e){localStorage.setItem(j.ANALYSIS_SETTINGS,e)},async loadGameSettings(){const e=localStorage.getItem(j.GAME_SETTINGS);return e?JSON.stringify({...W(),...JSON.parse(e)}):JSON.stringify({...W(),enableAutoSave:!1})},async saveGameSettings(e){localStorage.setItem(j.GAME_SETTINGS,e)},async loadCSAGameSettingsHistory(){const e=localStorage.getItem(j.CSA_GAME_SETTINGS_HISTORY);return e?JSON.stringify({...(0,Y.uU)(),...JSON.parse(e)}):JSON.stringify((0,Y.uU)())},async saveCSAGameSettingsHistory(e){localStorage.setItem(j.CSA_GAME_SETTINGS_HISTORY,e)},async loadMateSearchSettings(){const e=localStorage.getItem(j.MATE_SEARCH_SETTINGS);return e?JSON.stringify({enableMaxSeconds:!1,maxSeconds:10,...JSON.parse(e)}):JSON.stringify({enableMaxSeconds:!1,maxSeconds:10})},async saveMateSearchSettings(e){localStorage.setItem(j.MATE_SEARCH_SETTINGS,e)},loadUSIEngines:async()=>(new n.z4).json,async saveUSIEngines(){},async loadBookImportSettings(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async saveBookImportSettings(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},onUpdateAppSettings(){},async showOpenRecordDialog(e){const t=document.createElement("input");return t.setAttribute("type","file"),t.setAttribute("accept",e.join(",")),new Promise((e,o)=>{t.click(),t.onchange=()=>{const n=t.files?.[0];n?n.arrayBuffer().then(t=>{const o=L.m7(n.name);z.clear(),z.set(o,t),e(o)}).catch(e=>{o(e)}):o(new Error("invalid file"))},t.oncancel=()=>{e("")}})},showSaveRecordDialog:async e=>e,async showSaveMergedRecordDialog(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async openRecord(e){const t=z.get(e);return t?new Uint8Array(t):Promise.reject(new Error("invalid URI"))},async saveRecord(e,t){const o=new Blob([new Uint8Array(t)],{type:"application/octet-stream"}),n=URL.createObjectURL(o),i=document.createElement("a");i.href=n,i.download=(0,q.P8)(e),i.click(),URL.revokeObjectURL(n)},loadRecordFileHistory:async()=>JSON.stringify({entries:[]}),addRecordFileHistory(){},async clearRecordFileHistory(){},async saveRecordFileBackup(){},async loadRecordFileBackup(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async loadRemoteTextFile(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async convertRecordFiles(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async showSelectSFENDialog(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async loadSFENFile(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},onOpenRecord(){},async showOpenBookDialog(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async showSaveBookDialog(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async clearBook(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async openBook(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async openBookAsNewSession(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async closeBookSession(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async saveBook(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async exportBook(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},getBookFormat:async()=>"yane2016",searchBookMoves:async()=>"[]",async updateBookMove(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async removeBookMove(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async updateBookMoveOrder(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async importBookMoves(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async showSelectUSIEngineDialog(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async getUSIEngineInfo(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async getUSIEngineMetadata(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async sendUSIOptionButtonSignal(){},async usiLaunch(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async usiReady(){},async usiSetOption(){},async usiGo(){},async usiGoPonder(){},async usiPonderHit(){},async usiGoInfinite(){},async usiGoMate(){},async usiStop(){},async usiGameover(){},async usiQuit(){},onUSIBestMove(){},onUSICheckmate(){},onUSICheckmateNotImplemented(){},onUSICheckmateTimeout(){},onUSINoMate(){},onUSIInfo(){},async csaLogin(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async csaLogout(){},async csaAgree(){},async csaMove(){},async csaResign(){},async csaWin(){},async csaStop(){},onCSAGameSummary(){},onCSAReject(){},onCSAStart(){},onCSAMove(){},onCSAGameResult(){},onCSAClose(){},collectSessionStates:async()=>JSON.stringify({os:{version:"-",arch:"-",cpuTotalTime:0,cpuIdleTime:0,memoryTotal:0,memoryFree:0},usiSessions:[],csaSessions:[]}),async setupPrompt(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async openPrompt(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},invokePromptCommand(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},onPromptCommand(){},async showSelectImageDialog(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async cropPieceImage(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async exportCaptureAsPNG(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async exportCaptureAsJPEG(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},loadLayoutProfileList:async()=>[L.KY,JSON.stringify({profiles:[]})],updateLayoutProfileList(){},onUpdateLayoutProfile(){},createDesktopShortcutForLayoutProfile(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},openLogFile(){},log(e,t){switch(e){case O.$.DEBUG:console.debug(t);break;case O.$.INFO:console.log(t);break;case O.$.WARN:console.warn(t);break;case O.$.ERROR:console.error(t)}},async showSelectFileDialog(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},async showSelectDirectoryDialog(){throw new Error(R.t.thisFeatureNotAvailableOnWebApp)},openExplorer(){},openWebBrowser(e){window.open(e,"_blank")},getMachineSpec:async()=>JSON.stringify({cpuCores:1,memory:1048576}),isEncryptionAvailable:async()=>!1,getVersionStatus:async()=>JSON.stringify({}),getPathForFile:e=>e.name,onProgress(){}};function Q(){return window}Q().electronShogi;const Z=Q().electronShogiAPI||X,ee={...Z,fetchProcessArgs:async()=>JSON.parse(await Z.fetchProcessArgs()),loadAppSettings:async()=>JSON.parse(await Z.loadAppSettings()),saveAppSettings:e=>Z.saveAppSettings(JSON.stringify(e)),loadBatchConversionSettings:async()=>JSON.parse(await Z.loadBatchConversionSettings()),saveBatchConversionSettings:e=>Z.saveBatchConversionSettings(JSON.stringify(e)),loadResearchSettings:async()=>JSON.parse(await Z.loadResearchSettings()),saveResearchSettings:e=>Z.saveResearchSettings(JSON.stringify(e)),loadAnalysisSettings:async()=>JSON.parse(await Z.loadAnalysisSettings()),saveAnalysisSettings:e=>Z.saveAnalysisSettings(JSON.stringify(e)),loadGameSettings:async()=>JSON.parse(await Z.loadGameSettings()),saveGameSettings:e=>Z.saveGameSettings(JSON.stringify(e)),loadCSAGameSettingsHistory:async()=>JSON.parse(await Z.loadCSAGameSettingsHistory()),saveCSAGameSettingsHistory:e=>Z.saveCSAGameSettingsHistory(JSON.stringify(e)),loadMateSearchSettings:async()=>JSON.parse(await Z.loadMateSearchSettings()),saveMateSearchSettings:e=>Z.saveMateSearchSettings(JSON.stringify(e)),loadRecordFileHistory:async()=>JSON.parse(await Z.loadRecordFileHistory()),loadUSIEngines:async()=>new n.z4(await Z.loadUSIEngines()),saveUSIEngines:e=>Z.saveUSIEngines(e.json),loadBookImportSettings:async()=>JSON.parse(await Z.loadBookImportSettings()),saveBookImportSettings:e=>Z.saveBookImportSettings(JSON.stringify(e)),convertRecordFiles:async e=>JSON.parse(await Z.convertRecordFiles(JSON.stringify(e))),getBookFormat:async e=>await Z.getBookFormat(e),openBook:(e,t,o)=>Z.openBook(e,t,JSON.stringify(o)),openBookAsNewSession:async(e,t)=>await Z.openBookAsNewSession(e,JSON.stringify(t)),searchBookMoves:async(e,t)=>JSON.parse(await Z.searchBookMoves(e,t)),updateBookMove:(e,t,o)=>Z.updateBookMove(e,t,JSON.stringify(o)),importBookMoves:async(e,t)=>JSON.parse(await Z.importBookMoves(e,JSON.stringify(t))),async getUSIEngineInfo(e,t){const o=await Z.getUSIEngineInfo(e,t);return JSON.parse(o)},async getUSIEngineMetadata(e){const t=await Z.getUSIEngineMetadata(e);return JSON.parse(t)},usiLaunch:(e,t)=>Z.usiLaunch(JSON.stringify(e),JSON.stringify(t||{})),usiReady:e=>Z.usiReady(e),usiGo:(e,t,o)=>Z.usiGo(e,t,JSON.stringify(o)),usiGoPonder:(e,t,o)=>Z.usiGoPonder(e,t,JSON.stringify(o)),usiPonderHit:(e,t)=>Z.usiPonderHit(e,JSON.stringify(t)),csaLogin:e=>Z.csaLogin(JSON.stringify(e)),collectSessionStates:async()=>JSON.parse(await Z.collectSessionStates()),setupPrompt:async(e,t)=>JSON.parse(await Z.setupPrompt(e,t)),exportCaptureAsPNG:e=>Z.exportCaptureAsPNG(e.json),exportCaptureAsJPEG:e=>Z.exportCaptureAsJPEG(e.json),async loadLayoutProfileList(){const[e,t]=await Z.loadLayoutProfileList();return[e,JSON.parse(t)]},updateLayoutProfileList(e,t){Z.updateLayoutProfileList(e,JSON.stringify(t))},getMachineSpec:async()=>JSON.parse(await Z.getMachineSpec()),getVersionStatus:async()=>JSON.parse(await Z.getVersionStatus())},te=ee},154(e,t,o){o.d(t,{c:()=>d});const n=new class{searchHandler;isEngine(){return!1}async readyNewGame(){}async startSearch(e,t,o,n){this.searchHandler=n}async startPonder(){}async startMateSearch(){}async stop(){}async gameover(){}async close(){this.searchHandler=void 0}doMove(e){const t=this.searchHandler;this.searchHandler=void 0,t?.onMove(e)}resign(){const e=this.searchHandler;this.searchHandler=void 0,e?.onResign()}win(){const e=this.searchHandler;this.searchHandler=void 0,e?.onWin()}};var i=o(128),a=o(113),s=o(186);const r={[a.PieceType.PAWN]:100,[a.PieceType.LANCE]:300,[a.PieceType.KNIGHT]:400,[a.PieceType.SILVER]:500,[a.PieceType.GOLD]:600,[a.PieceType.BISHOP]:700,[a.PieceType.ROOK]:800,[a.PieceType.KING]:0,[a.PieceType.PROM_PAWN]:400,[a.PieceType.PROM_LANCE]:500,[a.PieceType.PROM_KNIGHT]:500,[a.PieceType.PROM_SILVER]:600,[a.PieceType.HORSE]:1200,[a.PieceType.DRAGON]:1500};class c{uri;timer;constructor(e){this.uri=e}isEngine(){return!0}async readyNewGame(){}async startSearch(e,t,o,n){this.timer=setTimeout(()=>{let o=null;if(this.uri===s.DI)o=this.searchRandom(e);else{const n=a.Record.newByUSI(t);if(n instanceof a.Record){const t=e=>n.getRepetitionCount(e)>=1;o=this.search(this.uri,e.clone(),2,t)[0]}}null===o?n.onResign():n.onMove(o)},500)}async startPonder(){}async startMateSearch(){}async stop(){clearTimeout(this.timer)}async gameover(){}async close(){clearTimeout(this.timer)}searchRandom(e){const t=l(e);for(let o=t.length;o>0;o--){const n=Math.floor(Math.random()*o),i=t[n];if(e.isValidMove(i))return i;t[n]=t[o-1]}return null}search(e,t,o,n){const i=l(t);let a=null,s=-1/0;for(const r of i){let i=new h(e,t,r).evaluate();t.doMove(r)&&(i-=n&&n(t)?1e3:o>1?this.search(e,t,o-1)[1]:this.see(t,r.to),t.undoMove(r),i+=10*Math.random(),i>s&&(s=i,a=r))}return a?[a,s]:[null,0]}see(e,t){const o=[],n=[e.board.at(t).type];for(const i of e.listAttackers(t)){const t=e.board.at(i);t.color===e.color?o.push(t.type):n.push(t.type)}return o.sort((e,t)=>r[e]-r[t]),n.sort((e,t)=>r[e]-r[t]),this.seeSearch(0,o,0,n,0)}seeSearch(e,t,o,n,i){if(o>=t.length)return 0;let s=e+r[n[i]]+r[(0,a.unpromotedPieceType)(n[i])];return s<=0?0:(s-=this.seeSearch(-s,n,i+1,t,o),Math.max(s,0))}}function l(e){const t=[];function o(o,n,i){const s=e.board.at(n);if(s?.color===e.color)return;const r=new a.Move(o,n,!1,e.color,i,s?.type||null);(0,a.isPromotable)(i)&&((0,a.isPromotableRank)(e.color,o.rank)||(0,a.isPromotableRank)(e.color,n.rank))&&(t.push(r.withPromote()),i!==a.PieceType.KNIGHT&&i!==a.PieceType.SILVER)||t.push(r)}for(const t of e.board.listNonEmptySquares()){const n=e.board.at(t);if(n.color!==e.color)continue;const i=(0,a.movableDirections)(n);for(const s of i){switch((0,a.resolveMoveType)(n,s)){case a.MoveType.SHORT:{const e=t.neighbor(s);e.valid&&o(t,e,n.type);break}case a.MoveType.LONG:for(let i=t.neighbor(s);i.valid&&(o(t,i,n.type),!e.board.at(i));i=i.neighbor(s));}}}for(const o of a.handPieceTypes)if(e.hand(e.color).count(o))for(const n of a.Square.all)if(!e.board.at(n)){const i=new a.Move(o,n,!1,e.color,o,null);t.push(i)}return t}class h{playerURI;position;move;drop;from;to;whiteHand;constructor(e,t,o){this.playerURI=e,this.position=t,this.move=o,o.from instanceof a.Square?(this.drop=!1,this.from=t.color===a.Color.BLACK?o.from:o.from.opposite):this.drop=!0,this.to=t.color===a.Color.BLACK?o.to:o.to.opposite,this.whiteHand=this.position.color===a.Color.BLACK?this.position.whiteHand:this.position.blackHand}isTo(e,t){return this.to.equals(new a.Square(e,t))}at(e,t){let o=e instanceof a.Square?e:new a.Square(e,t);return this.position.color===a.Color.WHITE&&(o=o.opposite),this.position.board.at(o)}evaluate(){let e=0;if(this.move.capturedPieceType){const t=this.move.capturedPieceType;e+=r[t]+r[(0,a.unpromotedPieceType)(t)]}if(this.move.promote){const t=this.move.pieceType;e+=r[(0,a.promotedPieceType)(t)]-r[t]}switch(this.move.pieceType){case a.PieceType.PAWN:4===this.to.rank?e+=this.drop?10:20:this.drop||1!==this.to.file&&9!==this.to.file?!this.drop&&this.isTo(3,6)&&this.at(4,6)?e+=30:!this.drop&&this.isTo(5,6)&&this.at(4,6)?.type===a.PieceType.BISHOP&&(e+=50):e+=10;break;case a.PieceType.SILVER:this.from&&this.to.rank<this.from.rank&&this.to.rank>=7&&this.to.file>=2&&this.to.file<=8&&(e+=20);break;case a.PieceType.BISHOP:this.drop&&this.to.rank>=4&&(this.to.file+this.to.rank)%2!=0?e-=200:1===this.to.file||9===this.to.file?e-=500:this.drop&&1===this.to.rank?e-=50:!this.isTo(4,6)||this.at(5,5)||this.at(6,4)||this.at(7,3)||(e+=100);break;case a.PieceType.ROOK:7===this.to.rank&&(e-=20)}if(!this.from||this.move.pieceType!==a.PieceType.PAWN&&this.move.pieceType!==a.PieceType.SILVER&&this.move.pieceType!==a.PieceType.GOLD&&this.move.pieceType!==a.PieceType.PROM_PAWN&&this.move.pieceType!==a.PieceType.PROM_LANCE&&this.move.pieceType!==a.PieceType.PROM_KNIGHT&&this.move.pieceType!==a.PieceType.PROM_SILVER||(this.to.rank<this.from.rank?e+=this.to.rank-3:this.to.rank>this.from.rank&&(e+=3-this.to.rank)),this.to.rank<=4&&this.drop)switch(this.move.pieceType){case a.PieceType.PAWN:e+=3*this.to.rank;break;case a.PieceType.LANCE:case a.PieceType.KNIGHT:e+=2*this.to.rank;break;case a.PieceType.SILVER:case a.PieceType.GOLD:e+=this.to.rank+40-40;break;case a.PieceType.BISHOP:e-=100;break;case a.PieceType.ROOK:e+=500}switch(this.playerURI){case s.ke:e+=this.evaluateStaticRook();break;case s.y3:e+=this.evaluateRangingRook()}return e}evaluateStaticRook(){let e=0;switch(this.move.pieceType){case a.PieceType.PAWN:this.drop?this.isTo(8,7)?e+=200:this.isTo(8,8)&&(e+=50):this.isTo(2,6)||this.isTo(2,5)?e+=50:this.isTo(7,6)?e+=100:this.isTo(6,6)?e+=20:this.drop||3!==this.to.file||(e+=20);break;case a.PieceType.LANCE:case a.PieceType.KNIGHT:e-=50;break;case a.PieceType.SILVER:this.from&&this.from.rank>this.to.rank&&(this.isTo(8,8)||this.isTo(7,7)?e+=100:this.isTo(6,8)||this.isTo(6,7)||this.isTo(3,8)||this.isTo(3,7)||this.isTo(3,5)||this.isTo(4,6)?e+=20:(this.isTo(2,7)||this.isTo(2,6))&&(e+=10));break;case a.PieceType.GOLD:this.drop||(this.isTo(7,8)?e+=80:this.isTo(5,8)?e+=20:this.isTo(6,7)&&this.from&&this.from.file<=6&&(e+=30));break;case a.PieceType.BISHOP:this.at(this.to)?.type===a.PieceType.BISHOP&&(e+=200);break;case a.PieceType.KING:6===this.to.file&&this.from&&5===this.from.file?e+=30:7===this.to.file&&this.from&&6===this.from.file?e+=100:this.to.file<=4&&(e-=1e3)}return e}evaluateRangingRook(){let e=0;switch(this.move.pieceType){case a.PieceType.PAWN:this.drop?this.isTo(8,7)?e+=200:this.isTo(8,8)&&(e+=50):this.isTo(7,6)?e+=100:this.isTo(6,6)&&0===this.whiteHand.count(a.PieceType.BISHOP)?e+=90:this.isTo(6,5)&&this.at(7,8)?(e+=20,this.at(7,5)&&(e+=200)):this.isTo(7,5)?e-=150:1===this.to.file?(e+=40,this.at(1,4)&&(e+=50)):9===this.to.file&&this.at(9,4)&&(e+=50);break;case a.PieceType.LANCE:case a.PieceType.KNIGHT:e-=50;break;case a.PieceType.SILVER:this.from instanceof a.Square&&this.from.rank>this.to.rank&&this.at(7,6)&&(this.isTo(7,8)?e+=40:this.isTo(6,7)?e+=30:this.isTo(5,6)?e+=10:this.isTo(6,5)?e+=this.at(6,6)?.type===a.PieceType.PAWN?-10:20:(this.isTo(4,5)||this.isTo(3,8))&&(e+=10));break;case a.PieceType.GOLD:!this.drop&&this.isTo(7,8)&&(e+=20);break;case a.PieceType.BISHOP:!this.drop&&this.isTo(7,7)&&(e+=70,this.at(8,5)&&(e+=50));break;case a.PieceType.ROOK:!this.drop&&this.isTo(6,8)&&(e+=80);break;case a.PieceType.KING:this.to.file>=5?e-=1e3:this.from&&this.from.file>this.to.file&&this.to.file>=2&&(e+=60+5*(4-this.to.file))}return e}}function d(e){return{async build(t,o){if(t.uri===s.He)return n;if(s.b0(t.uri))return new c(t.uri);if(s.Em(t.uri)&&t.usi){const n=new i.USIPlayer(t.usi,e,o);return await n.launch(),n}throw new Error("defaultPlayerBuilder#build: 予期せぬプレイヤーURIです: "+t.uri)}}}},128(e,t,o){o.r(t),o.d(t,{USIPlayer:()=>u,isActiveUSIPlayerSession:()=>v,onUSIBestMove:()=>p,onUSICheckmate:()=>g,onUSICheckmateNotImplemented:()=>S,onUSICheckmateTimeout:()=>y,onUSIInfo:()=>T,onUSINoMate:()=>f,setOnStartSearchHandler:()=>h,setOnUpdateUSIInfoHandler:()=>d});var n=o(676),i=o(408),a=o(591),s=o(113),r=o(698);let c=()=>{},l=()=>{};function h(e){c=e}function d(e){l=e}class u{engine;launchOptions;onSearchInfo;_sessionID=0;usi;position;searchHandler;mateHandler;ponder;ponderMove;info;usiInfoTimeout;customMultiPV;bookSessionID;constructor(e,t,o){this.engine=e,this.launchOptions=t,this.onSearchInfo=o}get name(){return this.engine.name}get sessionID(){return this._sessionID}async launch(){try{this.engine.extraBook?.enabled&&this.engine.extraBook.filePath&&(this.bookSessionID=await n.Ay.openBookAsNewSession(this.engine.extraBook.filePath,{forceOnTheFly:this.engine.extraBook.onTheFly})),this._sessionID=await n.Ay.usiLaunch(this.engine,this.launchOptions),m[this.sessionID]=this}catch(e){throw this.bookSessionID&&await n.Ay.closeBookSession(this.bookSessionID),e}}isEngine(){return!0}async readyNewGame(){await n.Ay.usiReady(this.sessionID)}async startSearch(e,t,o,i){this.clearHandlers(),this.searchHandler=i,this.usi=t,this.position=e.clone(),await this.searchBook()||(this.ponderMove&&this.ponder===this.usi?n.Ay.usiPonderHit(this.sessionID,o):(this.info=void 0,await n.Ay.usiGo(this.sessionID,this.usi,o),c(this.sessionID,this.position)),this.ponderMove=void 0,this.ponder=void 0)}async startPonder(e,t,o){if(!(0,a.my)(this.engine))return;if(this.ponderMove)return;const i=t;if(!this.ponder||!this.ponder.startsWith(i))return;const s=e.createMoveByUSI(this.ponder.slice(i.length+1));s&&e.isValidMove(s)&&(this.clearHandlers(),this.usi=this.ponder,this.position=e.clone(),this.stochasticPonder||this.position.doMove(s),this.info=void 0,this.ponderMove=s,await n.Ay.usiGoPonder(this.sessionID,this.ponder,o),c(this.sessionID,this.position))}async startMateSearch(e,t,o,i){this.clearHandlers(),this.usi=t,this.info=void 0,this.position=e.clone(),this.mateHandler=i,await n.Ay.usiGoMate(this.sessionID,this.usi,o),c(this.sessionID,this.position)}async startResearch(e,t){this.clearHandlers(),this.usi=t,this.info=void 0,this.position=e.clone(),await this.searchBook()||(await n.Ay.usiGoInfinite(this.sessionID,t),c(this.sessionID,this.position))}async searchBook(){if(!this.bookSessionID||!this.position)return!1;try{const e=await n.Ay.searchBookMoves(this.bookSessionID,this.position.sfen);if(0===e.length)return!1;if(this.ponderMove&&(await n.Ay.usiStop(this.sessionID),this.ponderMove=void 0,this.ponder=void 0),c(this.sessionID,this.position),l&&this.usi)for(let t=0;t<e.length;t++){const o=e[t];if(this.position.createMoveByUSI(o.usi)){const e={multipv:t+1,depth:o.depth,scoreCP:o.score,nodes:o.count,currmove:o.usi,pv:o.usi2?[o.usi,o.usi2]:[o.usi]};l(this.sessionID,this.position,this.name,e)}}const t=e[0],o=this.position.createMoveByUSI(t.usi);if(!o)return n.Ay.log(r.$.ERROR,`Failed to search book moves: invalid move from book: ${t.usi}`),!1;const i=this.searchHandler;return this.clearHandlers(),i&&i.onMove(o),!0}catch(e){return n.Ay.log(r.$.ERROR,`Failed to search book moves: ${e}`),!1}}async stop(){await n.Ay.usiStop(this.sessionID)}async gameover(e){await n.Ay.usiGameover(this.sessionID,e)}async close(){this.clearHandlers(),await n.Ay.usiQuit(this.sessionID),delete m[this.sessionID],this.bookSessionID&&await n.Ay.closeBookSession(this.bookSessionID)}clearHandlers(){this.searchHandler=void 0,this.mateHandler=void 0}onBestMove(e,t,o){const n=this.searchHandler;if(this.clearHandlers(),!n||!this.position)return;if(e!==this.usi)return;if("resign"===t)return void n.onResign();if("win"===t)return void n.onWin();const i=this.position.createMoveByUSI(t);if(!i)return n.onError("エンジンから不明な指し手を受信しました:"+t),void n.onResign();const a=e.indexOf(" moves ")>0;if(this.ponder=o&&`${e}${a?"":" moves"} ${t} ${o}`,this.flushUSIInfo(),this.info?.pv&&this.info.pv.length>=1&&this.info.pv[0].equals(i)){const e={...this.info,pv:this.info.pv.slice(1)};n.onMove(i,e)}else n.onMove(i)}onCheckmate(e,t){if(e!==this.usi||!this.position)return;l(this.sessionID,this.position,this.name,{pv:t});const o=this.mateHandler;if(this.clearHandlers(),!o)return;const n=this.position,i=[];for(const e of t){const t=n.createMoveByUSI(e);if(!t)return void o.onError("エンジンから不明な指し手を受信しました:"+e);if(i.push(t),!n.doMove(t))return void o.onError("エンジンから無効な指し手を受信しました:"+e)}o.onCheckmate(i)}onCheckmateNotImplemented(){const e=this.mateHandler;this.clearHandlers(),e?.onNotImplemented()}onCheckmateTimeout(e){if(e!==this.usi||!this.position)return;const t=this.mateHandler;this.clearHandlers(),t?.onTimeout()}onNoMate(e){if(e!==this.usi||!this.position)return;const t=this.mateHandler;this.clearHandlers(),t?.onNoMate()}onUSIInfo(e,t){if(e!==this.usi||!this.position)return;if(l(this.sessionID,this.position,this.name,t,this.ponderMove),t.multipv&&1!==t.multipv)return;const o=this.position.color===s.Color.BLACK?1:-1,n=t.pv&&t.pv.length>=1?t.pv:t.currmove?[t.currmove]:void 0;this.info={usi:e,depth:t.depth??this.info?.depth,nodes:t.nodes??this.info?.nodes,score:(t.scoreCP&&t.scoreCP*o)??this.info?.score,mate:(t.scoreMate&&t.scoreMate*o)??this.info?.mate,pv:(n&&(0,i.X)(this.position,n))??this.info?.pv},this.ponderMove||this.usiInfoTimeout||(this.usiInfoTimeout=window.setTimeout(()=>{this.flushUSIInfo()},500))}flushUSIInfo(){this.usiInfoTimeout&&(clearTimeout(this.usiInfoTimeout),this.usiInfoTimeout=void 0),this.info&&this.onSearchInfo?.(this.info)}get multiPV(){return this.customMultiPV||(0,a.Lo)(this.engine)}async setMultiPV(e){const t=this.engine.options[a.Br]||this.engine.options[a.aW];if(!t||"spin"!==t.type)throw new Error("The engine does not support MultiPV option.");if(t.min&&e<t.min||t.max&&e>t.max)throw new Error("The MultiPV value is out of range.");await n.Ay.usiSetOption(this.sessionID,t.name,e.toFixed(0)),this.customMultiPV=e}get stochasticPonder(){return(0,a.pk)(this.engine)}}const m={};function p(e,t,o,n){m[e]?.onBestMove(t,o,n)}function g(e,t,o){m[e]?.onCheckmate(t,o)}function S(e){m[e]?.onCheckmateNotImplemented()}function y(e,t){m[e]?.onCheckmateTimeout(t)}function f(e,t){m[e]?.onNoMate(t)}function T(e,t,o){m[e]?.onUSIInfo(t,o)}function v(e){return!!m[e]}},953(e){e.exports=require("encoding-japanese")},113(e){e.exports=require("tsshogi")}},t={};function o(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,o),a.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n=o(698),i=o(1);const a=require("node:path");var s=o.n(a);const r=require("node:child_process"),c=require("log4js");var l=o.n(c),h=o(789);const d=require("node:fs");var u=o.n(d);require("node:os");const m=function(e){switch(e){case"logs":return s().join(process.cwd(),"logs");case"exe":return process.argv[1];default:return process.cwd()}}("logs");const p=(0,h.ln)().replaceAll(" ","_").replaceAll("/","").replaceAll(":",""),g=s().join(m,`app-${p}.log`),S=s().join(m,`usi-${p}.log`),y=s().join(m,`csa-${p}.log`),f={appenders:{stdout:{type:"stdout"},recording:{type:"recording"}},categories:{default:{appenders:["stdout"],level:"info"}}};function T(e){switch(e){case n.F.APP:return g;case n.F.USI:return S;case n.F.CSA:return y}}const v="stdout",C={[n.F.APP]:[v],[n.F.USI]:[v],[n.F.CSA]:[v]},b={[n.F.APP]:n.$.INFO,[n.F.USI]:n.$.INFO,[n.F.CSA]:n.$.INFO};function E(e,t,o){C[e]=t.map(t=>"file"===t?e:t),b[e]=o}const P={};function I(e){if(P[e])return P[e];f.appenders[e]||(f.appenders[e]={type:"file",filename:T(e)},f.categories[e]={appenders:C[e],level:b[e]});const t=l().configure(f).getLogger(e);return P[e]=t,t}function k(){return I(n.F.APP)}var A=o(113),M=o(690),N=o(265);const w=require("node:net");var R=o.n(w);const O=require("node:readline");class F{socket;readline;constructor(e,t,o,n={keepaliveInitialDelay:0,noDelay:!0}){this.socket=R().createConnection({port:t,host:e},o.onConnect).setKeepAlive(!0,1e3*n.keepaliveInitialDelay).setNoDelay(n.noDelay).on("error",o.onError).on("end",o.onFIN).on("close",e=>{this.closeReadline(),o.onClose(e)}),this.readline=(0,O.createInterface)(this.socket),this.readline.on("line",o.onRead)}write(e){this.socket.write(e+"\n")}end(){this.socket.end()}closeReadline(){this.readline&&(this.readline.close(),this.readline=null)}}var D,L;function B(e,t){const o=new Date;return{type:e,command:t,dateTime:(0,h.ng)(o),timeMs:o.getTime()}}function U(e,t,o,n){Array.isArray(t)||(t=[t]);for(const o of t)e.commands.push(o);if(e.commands.length>o){const t=Math.max(n,e.commands.length-o);e.discarded+=t,e.commands.splice(0,t)}}!function(e){e.SEND="send",e.RECEIVE="receive",e.SYSTEM="system"}(D||(D={})),function(e){e.IDLE="idle",e.CONNECTING="connecting",e.CONNECTED="connected",e.WAITING_GAME_SUMMARY="waitingGameSummary",e.GAME_SUMMARY="gameSummary",e.GAME_TIME="gameTime",e.GAME_TIME_B="gameTimeB",e.GAME_TIME_W="gameTimeW",e.GAME_POSITION="gamePosition",e.READY="ready",e.WAITING_START="waitingStart",e.WAITING_REJECT="waitingReject",e.PLAYING="playing",e.WAITING_LOGOUT="waitingLogout",e.WAITING_CLOSE="waitingClose",e.CLOSED="closed"}(L||(L={}));class _{_sessionID;_settings;logger;_state=L.IDLE;gameSummaryCallback;rejectCallback;startCallback;moveCallback;gameResultCallback;closeCallback;errorCallback;commandCallback;socket;gameSummary=(0,M.Rr)();playerStates=(0,M.OW)();specialMove=M.kt.UNKNOWN;_lastReceived;_lastSent;_commandHistory={discarded:0,commands:[]};_createdMs=Date.now();_loggedInMs;blankLinePingTimeout=null;constructor(e,t,o){this._sessionID=e,this._settings=t,this.logger=o}get sessionID(){return this._sessionID}get settings(){return this._settings}get state(){return this._state}get lastReceived(){return this._lastReceived}get lastSent(){return this._lastSent}get commandHistory(){return this._commandHistory}get createdMs(){return this._createdMs}get loggedInMs(){return this._loggedInMs}on(e,t){switch(e){case"gameSummary":this.gameSummaryCallback=t;break;case"reject":this.rejectCallback=t;break;case"start":this.startCallback=t;break;case"move":this.moveCallback=t;break;case"gameResult":this.gameResultCallback=t;break;case"close":this.closeCallback=t;break;case"error":this.errorCallback=t;break;case"command":this.commandCallback=t}return this}login(){this.logger.info("sid=%d: connecting to %s:%d",this.sessionID,this.settings.host,this.settings.port),this._state=L.CONNECTING;const e={keepaliveInitialDelay:this.settings.tcpKeepalive.initialDelay,noDelay:!0};this.socket=new F(this.settings.host,this.settings.port,{onConnect:this.onConnect.bind(this),onError:this.onConnectionError.bind(this),onFIN:this.onFIN.bind(this),onClose:this.onClose.bind(this),onRead:this.onRead.bind(this)},e)}logout(){if(this.settings.protocolVersion===N._B.V121_FLOODGATE)this.socket&&(this.logger.info("sid=%d: disconnect",this.sessionID),this.socket.end(),this._state=L.WAITING_CLOSE);else this.state!==L.WAITING_GAME_SUMMARY&&this.state!==L.GAME_SUMMARY&&this.state!==L.GAME_TIME&&this.state!==L.GAME_TIME_B&&this.state!==L.GAME_TIME_W&&this.state!==L.GAME_POSITION&&this.state!==L.READY||(this.send("LOGOUT"),this._state=L.WAITING_LOGOUT)}agree(e){this.state===L.READY&&e===this.gameSummary.id&&(this._state=L.WAITING_START,this.send(`AGREE ${this.gameSummary.id}`))}reject(e){this.state===L.READY&&e===this.gameSummary.id&&(this._state=L.WAITING_REJECT,this.send(`REJECT ${this.gameSummary.id}`))}doMove(e,t,o){if(this.state!==L.PLAYING)return;let n=e;void 0!==t&&(n+=`,'* ${Math.round(t)}`,void 0!==o&&(n+=` ${o}`)),this.send(n)}resign(){this.state===L.PLAYING&&this.send("%TORYO")}win(){this.state===L.PLAYING&&this.send("%KACHI")}stop(){this.state===L.PLAYING&&this.send("%CHUDAN")}send(e){this.socket?(this.socket.write(e),this._lastSent=B(D.SEND,this.hideSecureValues(e)),this.updateCommendHistory(this._lastSent),this.commandCallback?.(this._lastSent),this.logger.info("sid=%d: > %s",this.sessionID,this.hideSecureValues(e)),this.setBlankLinePing(e)):this.logger.error("sid=%d: failed to send command caused by invalid socket: %s",this.sessionID,e)}hideSecureValues(e){return this.settings.password&&(e=e.replaceAll(this.settings.password,"*****")),e}onConnect(){this.logger.info("sid=%d: connected",this.sessionID),this._state=L.CONNECTED;let e="";this.settings.protocolVersion===N._B.V121_X1&&(e=" x1"),this.send(`LOGIN ${this.settings.id} ${this.settings.password}${e}`)}onConnectionError(e){if(this.state===L.CLOSED)return;this.onError(e),this._state=L.CLOSED,this.closeCallback?.();const t=B(D.SYSTEM,"connection error");this.updateCommendHistory(t),this.commandCallback?.(t)}onError(e){this.logger.error("sid=%d: error: %s %s",this.sessionID,e.name,e.message),this.errorCallback?.(e)}onFIN(){this.logger.info("sid=%d: FIN packet received",this.sessionID),this.clearBlankLinePing()}onClose(e){if(this.clearBlankLinePing(),this.state===L.CLOSED)return;switch(this.state){case L.WAITING_GAME_SUMMARY:case L.WAITING_LOGOUT:case L.WAITING_CLOSE:e?this.onError(new Error(i.t.errorOccuredWhileDisconnectingFromCSAServer)):this.logger.info("sid=%d: socket closed",this.sessionID);break;case L.CONNECTING:this.onError(new Error(i.t.failedToConnectToCSAServer));break;default:this.onError(new Error(i.t.disconnectedFromCSAServer))}this._state=L.CLOSED,this.closeCallback?.();const t=B(D.SYSTEM,e?"closed (error)":"closed");this.updateCommendHistory(t),this.commandCallback?.(t)}onRead(e){this.setBlankLinePing(),this._lastReceived=B(D.RECEIVE,e),this.updateCommendHistory(this._lastReceived),this.commandCallback?.(this._lastReceived),this.logger.info("sid=%d: < %s",this.sessionID,e),""!==e&&(this.state===L.GAME_SUMMARY?this.onGameSummary(e):this.state===L.GAME_TIME?this.onGameTime(e):this.state===L.GAME_TIME_B?this.onGameTime(e,A.Color.BLACK):this.state===L.GAME_TIME_W?this.onGameTime(e,A.Color.WHITE):this.state===L.GAME_POSITION?this.onGamePosition(e):this.state===L.PLAYING?this.onMove(e):/^LOGIN:.* OK$/.test(e)?this.onLoginOK():"LOGIN:incorrect"===e?this.onLoginIncorrect():"LOGOUT:completed"===e?this.onLogout():"BEGIN Game_Summary"===e?this.onBeginGameSummary():e.startsWith("REJECT:")?this.onReject():e.startsWith("START:")?this.onStart():this.logger.warn("sid=%d: unknown command received",this.sessionID))}onLoginOK(){this._loggedInMs=Date.now(),this.logger.info("sid=%d: login ok",this.sessionID),this._state=L.WAITING_GAME_SUMMARY}onLoginIncorrect(){this.onError(new Error(i.t.csaServerLoginDenied)),this.socket&&this.socket.end()}onLogout(){this.logger.info("sid=%d: logout",this.sessionID),this._state=L.WAITING_CLOSE}onBeginGameSummary(){this._state=L.GAME_SUMMARY,this.gameSummary=(0,M.Rr)()}onEndGameSummary(){const e=this.gameSummary.players.black.time,t=this.gameSummary.players.white.time;this.playerStates.black.time=e.totalTime+e.increment,this.playerStates.white.time=t.totalTime+t.increment;const o=(0,A.importCSA)(this.gameSummary.position);if(o instanceof Error)return this.onError(new Error("invalid game position received from CSA server")),void this.logout();for(const e of o.moves){if((0,A.isKnownSpecialMove)(e.move)&&e.move.type===A.SpecialMoveType.START)continue;const t=(0,A.reverseColor)(e.nextColor);this.updateTime(t,e.elapsedMs)}this._state=L.READY,this.gameSummaryCallback?.(this.gameSummary)}onGameSummary(e){switch(e){case"END Game_Summary":return void this.onEndGameSummary();case"BEGIN Time":return void(this._state=L.GAME_TIME);case"BEGIN Time+":return void(this._state=L.GAME_TIME_B);case"BEGIN Time-":return void(this._state=L.GAME_TIME_W);case"BEGIN Position":return void(this._state=L.GAME_POSITION)}const[t,o]=e.split(":",2);switch(t){case"Protocol_Version":case"Protocol_Mode":case"Format":case"Declaration":case"Rematch_On_Draw":case"Max_Moves":break;case"Game_ID":this.gameSummary.id=o;break;case"Name+":this.gameSummary.players.black.playerName=o;break;case"Name-":this.gameSummary.players.white.playerName=o;break;case"Your_Turn":this.gameSummary.myColor="+"===o?A.Color.BLACK:A.Color.WHITE;break;case"To_Move":this.gameSummary.toMove="+"===o?A.Color.BLACK:A.Color.WHITE;break;default:this.logger.warn("sid=%d: unknown command received",this.sessionID)}}onGameTime(e,t){switch(e){case"END Time":case"END Time+":case"END Time-":return void(this._state=L.GAME_SUMMARY)}const o=t?[this.gameSummary.players[t].time]:[this.gameSummary.players.black.time,this.gameSummary.players.white.time],[n,i]=e.split(":",2);switch(n){case"Least_Time_Per_Move":case"Time_Roundup":break;case"Time_Unit":for(const e of o)i.endsWith("msec")?e.timeUnitMs=Number(i.slice(0,-4)):i.endsWith("sec")?e.timeUnitMs=1e3*Number(i.slice(0,-3)):i.endsWith("min")&&(e.timeUnitMs=60*Number(i.slice(0,-3))*1e3);break;case"Total_Time":for(const e of o)e.totalTime=Number(i);break;case"Byoyomi":for(const e of o)e.byoyomi=Number(i);break;case"Delay":for(const e of o)e.delay=Number(i);break;case"Increment":for(const e of o)e.increment=Number(i);break;default:this.logger.warn("sid=%d: unknown command received",this.sessionID)}}onGamePosition(e){"END Position"!==e?this.gameSummary.position+=e+"\n":this._state=L.GAME_SUMMARY}onReject(){this._state=L.WAITING_GAME_SUMMARY,this.rejectCallback?.()}onStart(){this._state=L.PLAYING,this.startCallback?.(this.playerStates)}onMove(e){e.startsWith("+")?this.onMoveWithColor(e,A.Color.BLACK):e.startsWith("-")?this.onMoveWithColor(e,A.Color.WHITE):e.startsWith("#")?this.onEndingCommand(e):e.startsWith("%")||this.logger.warn("sid=%d: unknown move command received",this.sessionID)}onMoveWithColor(e,t){const o=/^.*,T([0-9]+)$/.exec(e);if(o){const e=Number(o[1]);this.updateTime(t,1e3*e)}else this.logger.error("sid=%d: invalid move format",this.sessionID);this.moveCallback?.(e,this.playerStates)}updateTime(e,t){const o=this.gameSummary.players[e].time,n=t/o.timeUnitMs,i=this.playerStates[e].time-n+o.increment;this.playerStates[e].time=Math.max(i,0)}onEndingCommand(e){switch(e){case"#RESIGN":this.specialMove=M.kt.RESIGN;break;case"#SENNICHITE":this.specialMove=M.kt.SENNICHITE;break;case"#OUTE_SENNICHITE":this.specialMove=M.kt.OUTE_SENNICHITE;break;case"#ILLEGAL_MOVE":this.specialMove=M.kt.ILLEGAL_MOVE;break;case"#ILLEGAL_ACTION":this.specialMove=M.kt.ILLEGAL_ACTION;break;case"#TIME_UP":this.specialMove=M.kt.TIME_UP;break;case"#JISHOGI":this.specialMove=M.kt.JISHOGI;break;case"#MAX_MOVES":this.specialMove=M.kt.MAX_MOVES;break;case"#WIN":this.onGameResult(M.j5.WIN);break;case"#LOSE":this.onGameResult(M.j5.LOSE);break;case"#DRAW":this.onGameResult(M.j5.DRAW);break;case"#CENSORED":this.onGameResult(M.j5.CENSORED);break;case"#CHUDAN":this.onGameResult(M.j5.CHUDAN)}}onGameResult(e){this._state=L.WAITING_GAME_SUMMARY,this.gameResultCallback?.(this.specialMove,e)}invoke(e,t){switch(e){case D.SEND:this.send(t);break;case D.RECEIVE:this.onRead(t)}}setBlankLinePing(e){this.settings.blankLinePing&&(this.clearBlankLinePing(),this.blankLinePingTimeout=setTimeout(()=>{this.send("")},1e3*(""===e?this.settings.blankLinePing.interval:this.settings.blankLinePing.initialDelay)))}clearBlankLinePing(){this.blankLinePingTimeout&&(clearTimeout(this.blankLinePingTimeout),this.blankLinePingTimeout=null)}updateCommendHistory(e){U(this._commandHistory,e,100,10)}}let G;let H=0;const W=new Map;let x=2e4;function K(e){const t=(H+=1,H),o=new _(t,e,I(n.F.CSA)).on("gameSummary",e=>G.onCSAGameSummary(t,e)).on("reject",()=>G.onCSAReject(t)).on("start",e=>G.onCSAStart(t,e)).on("move",(e,o)=>G.onCSAMove(t,e,o)).on("gameResult",(e,o)=>G.onCSAGameResult(t,e,o)).on("close",()=>{!function(e){setTimeout(()=>{W.delete(e)},x)}(t),G.onCSAClose(t)}).on("error",G.sendError).on("command",e=>{G.sendPromptCommand(t,e)});return function(e){W.set(e.sessionID,e)}(o),o.login(),t}var $=o(591),V=o(408);const Y="win32"===process.platform;class J{handle;readline=null;constructor(e){const t={cwd:s().dirname(e)};Y&&(e.endsWith(".bat")||e.endsWith(".cmd"))?this.handle=(0,r.spawn)("cmd.exe",["/c",e],t):this.handle=(0,r.spawn)(e,t),this.handle.on("close",this.onClose.bind(this))}get pid(){return this.handle.pid}on(e,t){switch(e){case"receive":null===this.readline&&(this.readline=(0,O.createInterface)(this.handle.stdout)),this.readline.on("line",t);break;case"close":this.handle.on("close",(e,o)=>{this.onClose(),t(e,o)});break;default:this.handle.on(e,t)}return this}send(e){this.handle.stdin.write(e+"\n")}kill(){this.onClose(),this.handle.kill()}onClose(){null!==this.readline&&this.readline.close()}}var j,q;function z(e){switch(e){case"+":case"+0":case"0":return+V.m;case"-":case"-0":return-V.m;default:return Number(e)}}function X(e){return e?`btime ${e.btime} wtime ${e.wtime} `+(0!==e.binc||0!==e.winc?`binc ${e.binc} winc ${e.winc}`:`byoyomi ${e.byoyomi}`):"infinite"}!function(e){e.WIN="win",e.LOSE="lose",e.DRAW="draw"}(j||(j={})),function(e){e.WaitingForUSIOK="waitingForUSIOK",e.NotReady="notReady",e.WaitingForReadyOK="waitingForReadyOK",e.Ready="ready",e.WaitingForBestMove="waitingForBestMove",e.Ponder="ponder",e.WaitingForPonderBestMove="waitingForPonderBestMove",e.WaitingForCheckmate="waitingForCheckmate",e.WillQuit="willQuit",e.QuitCompleted="quitCompleted"}(q||(q={}));class Q{_path;sessionID;logger;option;process=null;_name="NO NAME";_author="";_engineOptions={};_state=q.WaitingForUSIOK;_currentPosition="";invalidBestMoveCount=0;reservedSetOptionCommands=[];reservedGoCommand;launchTimeout;quitTimeout;_lastReceived;_lastSent;_commandHistory={discarded:0,commands:[]};readyStartTimeMs=0;goTimeMs=0;timeoutCallback;errorCallback;closeCallback;usiOkCallback;readyCallback;bestMoveCallback;goEndCallback;checkmateCallback;checkmateNotImplementedCallback;checkmateTimeoutCallback;checkmateEndCallback;noMateCallback;infoCallback;commandCallback;constructor(e,t,o,n){this._path=e,this.sessionID=t,this.logger=o,this.option=n}get path(){return this._path}get name(){return this._name}get author(){return this._author}get engineOptions(){return this._engineOptions}get state(){return this._state}get currentPosition(){return this._currentPosition}get lastReceived(){return this._lastReceived}get lastSent(){return this._lastSent}get commandHistory(){return this._commandHistory}get pid(){return this.process?.pid}on(e,t){switch(e){case"timeout":this.timeoutCallback=t;break;case"error":this.errorCallback=t;break;case"close":this.closeCallback=t;break;case"usiok":this.usiOkCallback=t;break;case"ready":this.readyCallback=t;break;case"bestmove":this.bestMoveCallback=t;break;case"goEnd":this.goEndCallback=t;break;case"checkmate":this.checkmateCallback=t;break;case"checkmateNotImplemented":this.checkmateNotImplementedCallback=t;break;case"checkmateTimeout":this.checkmateTimeoutCallback=t;break;case"checkmateEnd":this.checkmateEndCallback=t;break;case"noMate":this.noMateCallback=t;break;case"info":this.infoCallback=t;break;case"command":this.commandCallback=t}return this}launch(){this.logger.info("sid=%d: launch: %s",this.sessionID,this.path),this.setLaunchTimeout(),this.process=new J(this.path),this.process.on("error",this.onError.bind(this)),this.process.on("close",this.onClose.bind(this)),this.process.on("receive",this.onReceive.bind(this)),this.send("usi")}quit(){if(this.state!==q.WillQuit){switch(this.state){case q.WaitingForBestMove:case q.WaitingForPonderBestMove:if(this.goEndCallback){const e=Date.now()-this.goTimeMs;this.goEndCallback(e)}break;case q.WaitingForCheckmate:if(this.checkmateEndCallback){const e=Date.now()-this.goTimeMs;this.checkmateEndCallback(e)}}this._state=q.WillQuit,this.clearLaunchTimeout(),this.logger.info("sid=%d: quit USI engine",this.sessionID),this.setQuitTimeout(),this.send("quit")}}setOption(e,t){this.state===q.WaitingForBestMove||this.state===q.WaitingForPonderBestMove||this.state===q.WaitingForCheckmate?this.reservedSetOptionCommands.push({name:e,value:t}):this.setOptionImmediately(e,t)}setOptionImmediately(e,t){void 0!==t?this.send(`setoption name ${e} value ${t}`):this.send(`setoption name ${e}`)}flushReservedSetOptionCommands(){for(const e of this.reservedSetOptionCommands)this.setOptionImmediately(e.name,e.value);this.reservedSetOptionCommands=[]}ready(){if(this.state!==q.WaitingForReadyOK){if(this.state!==q.Ready&&this.state!==q.WaitingForBestMove&&this.state!==q.Ponder&&this.state!==q.WaitingForPonderBestMove&&this.state!==q.WaitingForCheckmate||this.gameover(j.DRAW),this.state!==q.NotReady)return this.logger.warn("sid=%d: ready: unexpected state: %s",this.sessionID,this.state),new Error("unexpected state");this.send("isready"),this._state=q.WaitingForReadyOK,this.readyStartTimeMs=Date.now()}}go(e,t){switch(this.reservedGoCommand={position:e,timeState:t},this.state){case q.Ready:this.sendReservedGoCommands();break;case q.WaitingForBestMove:case q.Ponder:case q.WaitingForCheckmate:this.stop()}}goPonder(e,t){this.state===q.Ready||this.state===q.WaitingForBestMove?(this.reservedGoCommand={position:e,timeState:this.option.enableEarlyPonder?void 0:t,ponder:!0},this.state===q.Ready&&this.sendReservedGoCommands()):this.logger.warn("sid=%d: goPonder: unexpected state: %s",this.sessionID,this.state)}goMate(e,t){this.state===q.Ready?(this.reservedGoCommand={position:e,mate:!0,mateLimit:t?1e3*t:void 0},this.sendReservedGoCommands()):this.logger.warn("sid=%d: goMate: unexpected state: %s",this.sessionID,this.state)}ponderHit(e){this.state===q.Ponder?(this.option.enableEarlyPonder?this.send("ponderhit "+X(e)):this.send("ponderhit"),this._state=q.WaitingForBestMove):this.logger.warn("sid=%d: ponderHit: unexpected state: %s",this.sessionID,this.state)}stop(){this.state===q.WaitingForBestMove||this.state===q.Ponder||this.state===q.WaitingForCheckmate?"stop"!==this.lastSent?.command&&(this.send("stop"),this.state===q.Ponder&&(this._state=q.WaitingForPonderBestMove)):this.logger.warn("sid=%d: stop: unexpected state: %s",this.sessionID,this.state)}gameover(e){switch(this.state){case q.WaitingForUSIOK:case q.NotReady:case q.WaitingForReadyOK:case q.WillQuit:return void this.logger.warn("sid=%d: gameover: unexpected state: %s",this.sessionID,this.state);case q.WaitingForBestMove:case q.Ponder:this.stop(),this.invalidBestMoveCount++;break;case q.WaitingForPonderBestMove:this.invalidBestMoveCount++;break;case q.WaitingForCheckmate:this.stop();case q.Ready:}this.send("gameover "+e),this._state=q.NotReady,this.reservedGoCommand=void 0}setLaunchTimeout(){this.launchTimeout=setTimeout(()=>{this.timeoutCallback?.(),this.quit()},this.option.timeout||1e4)}clearLaunchTimeout(){this.launchTimeout&&(clearTimeout(this.launchTimeout),this.launchTimeout=void 0)}setQuitTimeout(){this.quitTimeout=setTimeout(()=>{this.process&&(this.process.kill(),this.process=null)},5e3)}clearQuitTimeout(){this.quitTimeout&&(clearTimeout(this.quitTimeout),this.quitTimeout=void 0)}onError(e){this.errorCallback?.(e),this.quit()}onClose(e,t){this.logger.info("sid=%d: engine process closed: close=%s signal=%s",this.sessionID,e,t),this.state!==q.WillQuit&&this.errorCallback?.(new Error("closed unexpectedly")),this._state=q.QuitCompleted,this.clearLaunchTimeout(),this.clearQuitTimeout(),this.process=null,this.closeCallback?.();const o=B(D.SYSTEM,`closed: close=${e} signal=${t}`);this.updateCommendHistory(o),this.commandCallback?.(o)}sendReservedGoCommands(){if(!this.reservedGoCommand)return;this.send(this.reservedGoCommand.position);let e="",t="";if(this.reservedGoCommand.ponder)e="ponder",t=(o=this.reservedGoCommand.timeState)?X(o):"";else if(this.reservedGoCommand.mate){e="mate";const o=this.reservedGoCommand.mateLimit;t=o?Math.floor(o).toFixed(0):"infinite"}else t=X(this.reservedGoCommand.timeState);var o;this.send("go"+(e?" "+e:"")+(t?" "+t:"")),this._currentPosition=this.reservedGoCommand.position,this._state=this.reservedGoCommand.ponder?q.Ponder:this.reservedGoCommand.mate?q.WaitingForCheckmate:q.WaitingForBestMove,this.reservedGoCommand=void 0,this.goTimeMs=Date.now()}send(e){this.process&&(this.process.send(e),this._lastSent=B(D.SEND,e),this.updateCommendHistory(this._lastSent),this.commandCallback?.(this._lastSent),this.logger.info("sid=%d: > %s",this.sessionID,e))}onReceive(e){if(this._lastReceived=B(D.RECEIVE,e),this.updateCommendHistory(this._lastReceived),this.commandCallback?.(this._lastReceived),this.logger.info("sid=%d: < %s",this.sessionID,e),this.state!==q.WillQuit)if(e.startsWith("id name "))this.onIDName(e.substring(8));else if(e.startsWith("id author "))this.onIDAuthor(e.substring(10));else if(e.startsWith("option "))this.onOption(e.substring(7));else if("usiok"===e)this.onUSIOk();else if("readyok"===e)this.onReadyOk();else if(e.startsWith("bestmove "))this.onBestMove(e.substring(9));else if(e.startsWith("checkmate "))this.onCheckmate(e.substring(10));else if(e.startsWith("info ")&&!this.option.discardUSIInfo&&this.infoCallback){const t=e.substring(5);this.infoCallback?.(this.currentPosition,function(e){const t={},o=e.split(" ");for(let n=0;n<e.length;n+=1)switch(o[n]){case"depth":t.depth=Number(o[n+1]),n+=1;break;case"seldepth":t.seldepth=Number(o[n+1]),n+=1;break;case"time":t.timeMs=Number(o[n+1]),n+=1;break;case"nodes":t.nodes=Number(o[n+1]),n+=1;break;case"pv":t.pv=o.slice(n+1),n=o.length;break;case"multipv":t.multipv=Number(o[n+1]),n+=1;break;case"score":switch(o[n+1]){case"cp":t.scoreCP=Number(o[n+2]),n+=2;break;case"mate":t.scoreMate=z(o[n+2]),n+=2}break;case"lowerbound":t.lowerbound=!0;break;case"upperbound":t.upperbound=!0;break;case"currmove":t.currmove=o[n+1],n+=1;break;case"hashfull":t.hashfullPerMill=Number(o[n+1]),n+=1;break;case"nps":t.nps=Number(o[n+1]),n+=1;break;case"string":t.string=o.slice(n+1).join(" "),n=o.length}return t}(t))}}onIDName(e){this._name=e}onIDAuthor(e){this._author=e}onOption(e){const t=e.split(" ");if(t.length<4||"name"!==t[0]||"type"!==t[2])return void this.logger.error("sid=%d: invalid option command",this.sessionID);const o=t[1],n=t[3],i=100+Object.keys(this._engineOptions).length,a="combo"===n?{name:o,type:n,order:i,vars:[]}:{name:o,type:n,order:i};if("button"!==a.type)for(let e=4;e+1<t.length;e+=2)switch(t[e]){case"default":a.default="spin"===a.type?Number(t[e+1]):t[e+1];break;case"min":"spin"===a.type&&(a.min=Number(t[e+1]));break;case"max":"spin"===a.type&&(a.max=Number(t[e+1]));break;case"var":"combo"===a.type&&a.vars.push(t[e+1])}this._engineOptions[a.name]=a}onUSIOk(){this.state===q.WaitingForUSIOK?(this.engineOptions[$.If]||(this._engineOptions[$.If]={name:$.If,type:"spin",order:1,default:32}),this.engineOptions[$.YZ]||(this._engineOptions[$.YZ]={name:$.YZ,type:"check",order:2,default:"true"}),this.option.engineOptions&&this.option.engineOptions.forEach(e=>{const t=(0,$.J3)(e);void 0!==t&&this.setOption(e.name,t)}),this.clearLaunchTimeout(),this._state=q.NotReady,this.usiOkCallback?.()):this.logger.warn("sid=%d: onUSIOk: unexpected state: %s",this.sessionID,this.state)}onReadyOk(){if(this.state!==q.WaitingForReadyOK)return void this.logger.warn("sid=%d: onReadyOk: unexpected state: %s",this.sessionID,this.state);this._state=q.Ready;const e=Date.now()-this.readyStartTimeMs;this.readyCallback?.(e),this.send("usinewgame"),this.sendReservedGoCommands()}onBestMove(e){if(this.flushReservedSetOptionCommands(),this.invalidBestMoveCount>0)return this.invalidBestMoveCount--,void this.logger.warn("sid=%d: onBestMove: ignore bestmove: %s",this.sessionID,e);const t=Date.now()-this.goTimeMs;if(this.state!==q.WaitingForBestMove&&this.state!==q.WaitingForPonderBestMove)return this.logger.warn("sid=%d: onBestMove: unexpected state: %s",this.sessionID,this.state),void this.goEndCallback?.(t);if(this.bestMoveCallback&&this.state===q.WaitingForBestMove){const t=e.split(" "),o=t[0],n=t.length>=3&&"ponder"===t[1]&&t[2]||void 0;this.bestMoveCallback(this.currentPosition,o,n)}this._state=q.Ready,this._currentPosition="",this.sendReservedGoCommands(),this.goEndCallback?.(t)}onCheckmate(e){this.flushReservedSetOptionCommands();const t=Date.now()-this.goTimeMs;return this.state!==q.WaitingForCheckmate?(this.logger.warn("sid=%d: onCheckmate: unexpected state: %s",this.sessionID,this.state),void this.checkmateEndCallback?.(t)):(this._state=q.Ready,"notimplemented"===e.trim()?(this.checkmateNotImplementedCallback?.(),void this.checkmateEndCallback?.(t)):"timeout"===e.trim()?(this.checkmateTimeoutCallback?.(this.currentPosition),void this.checkmateEndCallback?.(t)):"nomate"===e.trim()?(this.noMateCallback?.(this.currentPosition),void this.checkmateEndCallback?.(t)):(this.checkmateCallback?.(this.currentPosition,e.trim().split(" ")),void this.checkmateEndCallback?.(t)))}invoke(e,t){switch(e){case D.SEND:this.send(t);break;case D.RECEIVE:this.onReceive(t)}}updateCommendHistory(e){U(this._commandHistory,e,100,10)}}o(186);var Z=o(178);function ee(e){const t=process.env.PORTABLE_EXECUTABLE_DIR;return t?s().resolve(t,e):e}let te;function oe(e){return new Error(i.t.noResponseFromEnginePleaseExtendTimeout(e))}function ne(e,t){return t?new Error(`${e}: ${i.t.lastReceived}=[${t}]`):new Error(e)}let ie=0;function ae(){return ie+=1,ie}const se=new Map;let re=2e4;function ce(e){const t=se.get(e);if(!t)throw new Error("No engine session: SessionID="+e);return t}function le(e){const t=ce(e);if(t.stats.totalNodeCount+=t.statsTempData?.nodes??0,t.statsTempData?.nps&&(t.stats.npsSampleCount+=1,t.stats.meanNPS=(t.stats.meanNPS*(t.stats.npsSampleCount-1)+t.statsTempData.nps)/t.stats.npsSampleCount),t.statsTempData?.hashfullPerMill){const e=t.statsTempData.hashfullPerMill/10;t.stats.hashUsageSampleCount+=1,t.stats.meanHashUsagePercent=(t.stats.meanHashUsagePercent*(t.stats.hashUsageSampleCount-1)+e)/t.stats.hashUsageSampleCount,e>=50&&(t.stats.hashUsageOver50PercentCount+=1),e>=70&&(t.stats.hashUsageOver70PercentCount+=1),e>=90&&(t.stats.hashUsageOver90PercentCount+=1)}}function he(e,t){const o=ae(),i=t?.timeoutSeconds||10,a=new Q(ee(e.path),o,I(n.F.USI),{timeout:1e3*i,engineOptions:Object.values(e.options),enableEarlyPonder:e.enableEarlyPonder,discardUSIInfo:t?.discardUSIInfo}),s=function(e,t){return{process:e,engine:t,createdMs:Date.now(),stats:{runCount:0,totalUptimeMs:0,gameCount:0,totalReadyTimeMs:0,winCount:0,loseCount:0,drawCount:0,goCount:0,goPonderCount:0,ponderHitCount:0,goInfiniteCount:0,goMateCount:0,totalGoTimeMs:0,totalMateTimeMs:0,totalNodeCount:0,maxNPS:0,npsSampleCount:0,meanNPS:0,maxDepth:0,maxDepthTimeMs:0,maxSelDepth:0,depth20Count:0,depth20TotalTimeMs:0,depth30Count:0,depth30TotalTimeMs:0,depth40Count:0,depth40TotalTimeMs:0,depth50Count:0,depth50TotalTimeMs:0,maxHashUsagePercent:0,hashUsageSampleCount:0,meanHashUsagePercent:0,hashUsageOver50PercentCount:0,hashUsageOver70PercentCount:0,hashUsageOver90PercentCount:0}}}(a,e);return se.set(o,s),new Promise((t,n)=>{a.on("close",()=>{!function(e){const t=ce(e),o=Date.now();t.stats.totalUptimeMs+=o-t.createdMs}(o),te?.onEngineProcessStats(o,e.uri,s.stats,s.createdMs),setTimeout(()=>{se.delete(o)},re)}).on("error",e=>{const t=a.lastReceived?.command;n(ne(e.message,t))}).on("timeout",()=>n(oe(i))).on("bestmove",(e,t,n)=>{te?.onUSIBestMove(o,e,t,n)}).on("checkmate",(e,t)=>{te?.onUSICheckmate(o,e,t)}).on("checkmateNotImplemented",()=>{te?.onUSICheckmateNotImplemented(o)}).on("checkmateTimeout",e=>{te?.onUSICheckmateTimeout(o,e)}).on("noMate",e=>{te?.onUSINoMate(o,e)}).on("goEnd",e=>{!function(e,t){ce(e).stats.totalGoTimeMs+=t,le(e)}(o,e)}).on("checkmateEnd",e=>{!function(e,t){ce(e).stats.totalMateTimeMs+=t,le(e)}(o,e)}).on("usiok",()=>{t(o),function(e){ce(e).stats.runCount+=1}(o)}).on("command",e=>{te?.sendPromptCommand(o,e)}),a.launch()})}function de(e){const t=ce(e).process;return new Promise((o,n)=>{t.on("ready",t=>{o(),function(e,t){const o=ce(e);o.stats.gameCount+=1,o.stats.totalReadyTimeMs+=t}(e,t)}).on("error",e=>{const o=t.lastReceived?.command;n(ne(e.message,o))});const i=t.ready();if(i){const e=t.lastReceived?.command;n(ne(i.message,e))}})}function ue(e,t){const o=t.black,n=t.white,i=t[e].byoyomi;return{btime:o.timeMs-1e3*o.increment,wtime:n.timeMs-1e3*n.increment,byoyomi:1e3*i,binc:0===i?1e3*o.increment:0,winc:0===i?1e3*n.increment:0}}function me(e,t,o){te?.onUSIInfo(e,t,o),function(e,t){const o=ce(e);o.stats.maxNPS=Math.max(o.stats.maxNPS,t.nps??0),t.depth&&(!o.stats.maxDepth||o.stats.maxDepth<t.depth)&&(o.stats.maxDepth=t.depth,o.stats.maxDepthTimeMs=t.timeMs??0,o.stats.maxSelDepth=t.seldepth??t.depth),t.depth&&((o.statsTempData?.depth??0)<20&&t.depth>=20&&(o.stats.depth20Count+=1,o.stats.depth20TotalTimeMs+=t.timeMs??0),(o.statsTempData?.depth??0)<30&&t.depth>=30&&(o.stats.depth30Count+=1,o.stats.depth30TotalTimeMs+=t.timeMs??0),(o.statsTempData?.depth??0)<40&&t.depth>=40&&(o.stats.depth40Count+=1,o.stats.depth40TotalTimeMs+=t.timeMs??0),(o.statsTempData?.depth??0)<50&&t.depth>=50&&(o.stats.depth50Count+=1,o.stats.depth50TotalTimeMs+=t.timeMs??0)),o.stats.maxHashUsagePercent=Math.max(o.stats.maxHashUsagePercent,(t.hashfullPerMill??0)/10),o.statsTempData={nodes:t.nodes??o.statsTempData?.nodes,nps:t.nps??o.statsTempData?.nps,depth:Math.max(t.depth||0,o.statsTempData?.depth||0),hashfullPerMill:t.hashfullPerMill??o.statsTempData?.hashfullPerMill}}(e,o)}function pe(e,t,o){const n=ce(e),i=(0,A.getNextColorFromUSI)(t);n.process.go(t,ue(i,o)),n.process.on("info",(t,o)=>me(e,t,o)),function(e){const t=ce(e);t.stats.goCount+=1,t.statsTempData=void 0}(e)}function ge(e,t,o){const n=ce(e),i=(0,A.getNextColorFromUSI)(t);n.process.goPonder(t,ue(i,o)),n.process.on("info",(t,o)=>me(e,t,o)),function(e){const t=ce(e);t.stats.goPonderCount+=1,t.statsTempData=void 0}(e)}function Se(e,t){const o=ce(e);o.process.go(t),o.process.on("info",(t,o)=>me(e,t,o)),function(e){const t=ce(e);t.stats.goInfiniteCount+=1,t.statsTempData=void 0}(e)}function ye(e,t,o){const n=ce(e);n.process.goMate(t,o),n.process.on("info",(t,o)=>me(e,t,o)),function(e){const t=ce(e);t.stats.goMateCount+=1,t.statsTempData=void 0}(e)}function fe(e,t){const o=ce(e),n=(0,A.getNextColorFromUSI)(o.process.currentPosition);o.process.ponderHit(ue(n,t)),function(e){const t=ce(e);t.stats.ponderHitCount+=1,t.statsTempData=void 0}(e)}function Te(e,t){const o=ce(e);switch(t){case Z.q.WIN:o.process.gameover(j.WIN);break;case Z.q.LOSE:o.process.gameover(j.LOSE);break;case Z.q.DRAW:o.process.gameover(j.DRAW)}!function(e,t){const o=ce(e);switch(t){case Z.q.WIN:o.stats.winCount+=1;break;case Z.q.LOSE:o.stats.loseCount+=1;break;case Z.q.DRAW:o.stats.drawCount+=1}}(e,t)}function ve(e){if(!function(e){return se.has(e)}(e))return;ce(e).process.quit()}const Ce={updateAppState(){},fetchProcessArgs:async()=>"null",onClosable(){},onClose(){},onSendError(){},onSendMessage(){},onSendNotification(){},onMenuEvent(){},async loadAppSettings(){throw new Error("This feature is not available on command line tool")},async saveAppSettings(){throw new Error("This feature is not available on command line tool")},async loadBatchConversionSettings(){throw new Error("This feature is not available on command line tool")},async saveBatchConversionSettings(){throw new Error("This feature is not available on command line tool")},async loadResearchSettings(){throw new Error("This feature is not available on command line tool")},async saveResearchSettings(){throw new Error("This feature is not available on command line tool")},async loadAnalysisSettings(){throw new Error("This feature is not available on command line tool")},async saveAnalysisSettings(){throw new Error("This feature is not available on command line tool")},async loadGameSettings(){throw new Error("This feature is not available on command line tool")},async saveGameSettings(){throw new Error("This feature is not available on command line tool")},async loadCSAGameSettingsHistory(){throw new Error("This feature is not available on command line tool")},async saveCSAGameSettingsHistory(){throw new Error("This feature is not available on command line tool")},async loadMateSearchSettings(){throw new Error("This feature is not available on command line tool")},async saveMateSearchSettings(){throw new Error("This feature is not available on command line tool")},async loadUSIEngines(){throw new Error("This feature is not available on command line tool")},async saveUSIEngines(){},async loadBookImportSettings(){throw new Error("This feature is not available on command line tool")},async saveBookImportSettings(){throw new Error("This feature is not available on command line tool")},onUpdateAppSettings(){},async showOpenRecordDialog(){throw new Error("This feature is not available on command line tool")},async showSaveRecordDialog(){throw new Error("This feature is not available on command line tool")},async showSaveMergedRecordDialog(){throw new Error("This feature is not available on command line tool")},async openRecord(){throw new Error("This feature is not available on command line tool")},async saveRecord(){throw new Error("This feature is not available on command line tool")},async loadRecordFileHistory(){throw new Error("This feature is not available on command line tool")},addRecordFileHistory(){},async clearRecordFileHistory(){},async saveRecordFileBackup(){},async loadRecordFileBackup(){throw new Error("This feature is not available on command line tool")},async loadRemoteTextFile(){throw new Error("This feature is not available on command line tool")},async convertRecordFiles(){throw new Error("This feature is not available on command line tool")},async showSelectSFENDialog(){throw new Error("This feature is not available on command line tool")},async loadSFENFile(){throw new Error("This feature is not available on command line tool")},onOpenRecord(){},async showOpenBookDialog(){throw new Error("This feature is not available on command line tool")},async showSaveBookDialog(){throw new Error("This feature is not available on command line tool")},async clearBook(){throw new Error("This feature is not available on command line tool")},async openBook(){throw new Error("This feature is not available on command line tool")},async openBookAsNewSession(){throw new Error("This feature is not available on command line tool")},async closeBookSession(){throw new Error("This feature is not available on command line tool")},async saveBook(){throw new Error("This feature is not available on command line tool")},async exportBook(){throw new Error("This feature is not available on command line tool")},async getBookFormat(){throw new Error("This feature is not available on command line tool")},async searchBookMoves(){throw new Error("This feature is not available on command line tool")},async updateBookMove(){throw new Error("This feature is not available on command line tool")},async removeBookMove(){throw new Error("This feature is not available on command line tool")},async updateBookMoveOrder(){throw new Error("This feature is not available on command line tool")},async importBookMoves(){throw new Error("This feature is not available on command line tool")},async showSelectUSIEngineDialog(){throw new Error("This feature is not available on command line tool")},async getUSIEngineInfo(){throw new Error("This feature is not available on command line tool")},async getUSIEngineMetadata(){throw new Error("This feature is not available on command line tool")},async sendUSIOptionButtonSignal(){},async usiLaunch(e,t){const o=JSON.parse(e),n=JSON.parse(t);return await he(o,n)},usiReady:async e=>await de(e),async usiSetOption(e,t,o){!function(e,t,o){ce(e).process.setOption(t,o)}(e,t,o)},async usiGo(e,t,o){pe(e,t,JSON.parse(o))},async usiGoPonder(e,t,o){ge(e,t,JSON.parse(o))},async usiPonderHit(e,t){fe(e,JSON.parse(t))},async usiGoInfinite(e,t){Se(e,t)},async usiGoMate(e,t,o){ye(e,t,o)},async usiStop(e){!function(e){ce(e).process.stop()}(e)},async usiGameover(e,t){Te(e,t)},async usiQuit(e){ve(e)},onUSIBestMove(){},onUSICheckmate(){},onUSICheckmateNotImplemented(){},onUSICheckmateTimeout(){},onUSINoMate(){},onUSIInfo(){},csaLogin:async e=>K(JSON.parse(e)),async csaLogout(e){!function(e){W.get(e)?.logout()}(e)},async csaAgree(e,t){!function(e,t){W.get(e)?.agree(t)}(e,t)},async csaMove(e,t,o,n){!function(e,t,o,n){W.get(e)?.doMove(t,o,n)}(e,t,o,n)},async csaResign(e){!function(e){W.get(e)?.resign()}(e)},async csaWin(e){!function(e){W.get(e)?.win()}(e)},async csaStop(e){!function(e){W.get(e)?.stop()}(e)},onCSAGameSummary(){},onCSAReject(){},onCSAStart(){},onCSAMove(){},onCSAGameResult(){},onCSAClose(){},async collectSessionStates(){throw new Error("This feature is not available on command line tool")},async setupPrompt(){throw new Error("This feature is not available on command line tool")},async openPrompt(){throw new Error("This feature is not available on command line tool")},invokePromptCommand(){throw new Error("This feature is not available on command line tool")},onPromptCommand(){},async showSelectImageDialog(){throw new Error("This feature is not available on command line tool")},async cropPieceImage(){throw new Error("This feature is not available on command line tool")},async exportCaptureAsPNG(){throw new Error("This feature is not available on command line tool")},async exportCaptureAsJPEG(){throw new Error("This feature is not available on command line tool")},async loadLayoutProfileList(){throw new Error("This feature is not available on command line tool")},updateLayoutProfileList(){},onUpdateLayoutProfile(){},createDesktopShortcutForLayoutProfile(){throw new Error("This feature is not available on command line tool")},openLogFile(){},log(e,t){switch(e){case n.$.DEBUG:console.debug(t);break;case n.$.INFO:console.log(t);break;case n.$.WARN:console.warn(t);break;case n.$.ERROR:console.error(t)}},async showSelectFileDialog(){throw new Error("This feature is not available on command line tool")},async showSelectDirectoryDialog(){throw new Error("This feature is not available on command line tool")},openExplorer(){throw new Error("This feature is not available on command line tool")},openWebBrowser(){throw new Error("This feature is not available on command line tool")},async getMachineSpec(){throw new Error("This feature is not available on command line tool")},isEncryptionAvailable:async()=>!1,async getVersionStatus(){throw new Error("This feature is not available on command line tool")},getPathForFile(){throw new Error("This feature is not available on command line tool")},onProgress(){}};global.window={...global,electronShogiAPI:Ce};const be=require("yaml");var Ee=o.n(be);class Pe{_settings={timeMs:0,byoyomi:0,increment:0};_timeMs=0;_byoyomi=0;_elapsedMs=0;timerHandle=0;timerStart=0;lastTimeMs=0;setup(e){this._settings=e,this._timeMs=e.timeMs||0,this._byoyomi=e.byoyomi||0,this._elapsedMs=0}get settings(){return this._settings}get time(){return Math.ceil(this._timeMs/1e3)}get timeMs(){return this._timeMs}get byoyomi(){return this._byoyomi}get elapsedMs(){return this._elapsedMs}start(){this.clearTimer(),this.timerStart=Date.now(),this.lastTimeMs=this._timeMs,this._byoyomi=this.settings.byoyomi||0,this._elapsedMs=0,this.timerHandle=window.setInterval(()=>{const e=this.timeMs,t=this.byoyomi;this._elapsedMs=Date.now()-this.timerStart;const o=this.lastTimeMs-this._elapsedMs;o>=0?this._timeMs=o:(this._timeMs=0,this._byoyomi=Math.max(Math.ceil((this.settings.byoyomi||0)+o/1e3),0)),0!==this.timeMs||0!==this.byoyomi?this.fireBeep(e,t):this.timeout()},100)}fireBeep(e,t){let o=Math.ceil(this.timeMs/1e3),n=Math.ceil(e/1e3);0!==o&&0!==this.byoyomi||(0!==o||0===n?(0!==this.byoyomi&&(o=this.byoyomi,n=t),o!==n&&(o<=5?this.settings.onBeepUnlimited&&this.settings.onBeepUnlimited():(o<=10||20===o||30===o||60===o)&&this.settings.onBeepShort&&this.settings.onBeepShort())):this.settings.onBeepShort&&this.settings.onBeepShort())}pause(){this.clearTimer()}stop(){this.clearTimer(),this.incrementTime()}timeout(){this.clearTimer(),this.settings.onTimeout?.()}clearTimer(){this.timerHandle&&(window.clearInterval(this.timerHandle),this.timerHandle=0),this.settings.onStopBeep?.()}incrementTime(){this._timeMs+=1e3*(this.settings.increment||0)}}var Ie=o(389),ke=o(176),Ae=o(676);var Me=o(170);function Ne(e){const t=/^\*詰み=(先手勝ち|後手勝ち)(?::([0-9]+)手)?/.exec(e);if(t)return Number(t[2]||V.m)*("先手勝ち"===t[1]?1:-1)}function we(e){const t=/^#詰み=(先手勝ち|後手勝ち)(?::([0-9]+)手)?/.exec(e);if(t)return Number(t[2]||V.m)*("先手勝ち"===t[1]?1:-1)}function Re(e){const t=/^\*評価値=([+-]?[0-9]+(?:\.[0-9]+)?)/.exec(e);return t?Number(t[1]):void 0}function Oe(e){const t=/^#評価値=([+-]?[0-9]+(?:\.[0-9]+)?)/.exec(e);return t?Number(t[1]):void 0}function Fe(e){const t=/^\* *([+-]?[0-9]+(?:\.[0-9]+)?)/.exec(e);return t?Number(t[1]):void 0}function De(e){const t=/^\*対局 .* 評価値 ([+-]?[0-9]+)/.exec(e);return t?Number(t[1]):void 0}function Le(e){const t=/^\*解析 .* 評価値 ([+-]?[0-9]+)/.exec(e);return t?Number(t[1]):void 0}function Be(e){const t=/^\* .* 評価値 ([+-]?[0-9]+)/.exec(e);return t?Number(t[1]):void 0}function Ue(e){const t=/^#(?:形勢|指し手)\[([+-]?[0-9]+)\]/.exec(e);return t?Number(t[1]):void 0}function _e(e){const t=/^\*深さ=([0-9]+)/.exec(e);return t?Number(t[1]):void 0}function Ge(e){const t=/^#深さ=([0-9]+)/.exec(e);return t?Number(t[1]):void 0}function He(e){if(!/^\*対局 /.test(e))return;const t=/ 深さ ([0-9]+)/.exec(e);return t?Number(t[1]):void 0}function We(e){if(!/^\*解析 /.test(e))return;const t=/ 深さ ([0-9]+)/.exec(e);return t?Number(t[1]):void 0}function xe(e){let t=`* ${void 0!==e.mate?e.mate>0?3e4:-3e4:void 0!==e.score?e.score:0}`;for(const o of e.pv||[])t+=" "+(0,A.formatCSAMove)(o);return t}function Ke(e,t){const o=t.indexOf(" ",t.indexOf(" ")+1)+1,n=[],i=e.clone();for(let e=o;e<t.length;e+=8){const o=t.substring(e,e+7),a=(0,A.parseCSAMove)(i,o);if(a instanceof Error||!i.doMove(a,{ignoreValidation:!1}))break;n.push(a)}return n}function $e(e){e.forEach(e=>{e.customData=function(e,t={}){const o={...t},n=e.split("\n");for(const e of n){const t=Ne(e);void 0!==t&&(o.playerSearchInfo={...o.playerSearchInfo,mate:t});const n=we(e);void 0!==n&&(o.researchInfo={...o.researchInfo,mate:n});const i=Re(e)??Fe(e)??De(e);void 0!==i&&(o.playerSearchInfo={...o.playerSearchInfo,score:i});const a=Oe(e)??Le(e)??Be(e)??Ue(e);void 0!==a&&(o.researchInfo={...o.researchInfo,score:a});const s=_e(e)??He(e);void 0!==s&&(o.playerSearchInfo={...o.playerSearchInfo,depth:s});const r=Ge(e)??We(e);void 0!==r&&(o.researchInfo={...o.researchInfo,depth:r})}return o}(e.comment,e.customData)})}function Ve(e){return e.timeSeconds+"+"+e.byoyomi+"+"+e.increment}function Ye(e){return function(e){const t=Math.floor(e/60),o=e%60;return String(t).padStart(2,"0")+":"+String(o).padStart(2,"0")}(e.timeSeconds)+"+"+String(e.byoyomi).padStart(2,"0")}class Je{_record;_recordFilePath;_unsaved=!1;_sourceURL;_positionCounts=new Map;changePositionHandler=null;updateTreeHandler=null;updateCommentHandler=null;updateBookmarkHandler=null;updateCustomDataHandler=null;backupHandler=null;constructor(e=new A.Record){this._record=e,this.resetPositionCounts(),this.bindRecordHandlers()}get record(){return this._record}get recordFilePath(){return this._recordFilePath}get unsaved(){return this._unsaved}get sourceURL(){return this._sourceURL}get positionCounts(){return this._positionCounts}updateRecordFilePath(e){this._unsaved=!1,e!==this._recordFilePath&&(this._recordFilePath=e,e&&Ae.Ay.addRecordFileHistory(e))}async saveBackup(){if(!this.unsaved)return;const e=this.onBackup(),t=(0,A.exportKIF)(this.record,e||{});await Ae.Ay.saveRecordFileBackup(t)}saveBackupOnBackground(){this.saveBackup().catch(e=>{Ae.Ay.log(n.$.ERROR,`RecordManager#saveBackupOnBackground: failed to save backup: ${e}`)})}clearRecord(e){this.saveBackupOnBackground(),this._record.clear(e),this._unsaved=!1,this._recordFilePath=void 0,this._sourceURL=void 0,this.onChangePosition(),this.onUpdateTree()}replaceRecord(e,t){this.saveBackupOnBackground(),this._record=e,this.resetPositionCounts(),this.bindRecordHandlers(),this.updateRecordFilePath(t?.path),this._unsaved=!t?.markAsSaved,this._sourceURL=void 0,$e(this._record),this.onChangePosition(),this.onUpdateTree()}reset(){this.clearRecord()}resetByInitialPositionType(e){this.resetBySFEN((0,A.initialPositionTypeToSFEN)(e))}resetBySFEN(e){const t=new A.Position;return!!t.resetBySFEN(e)&&(this.clearRecord(t),!0)}resetByUSEN(e,t,o){const n=A.Record.newByUSEN(e,t,o);if(n instanceof Error)return n;this.replaceRecord(n,{markAsSaved:!0})}resetByCurrentPosition(){this.clearRecord(this._record.position)}parseRecordData(e,t){let o;switch(t||(0,A.detectRecordFormat)(e)){case A.RecordFormatType.SFEN:{const t=A.Position.newBySFEN(e);o=t?new A.Record(t):new Error(i.t.failedToParseSFEN);break}case A.RecordFormatType.USI:o=A.Record.newByUSI(e);break;case A.RecordFormatType.KIF:o=(0,A.importKIF)(e);break;case A.RecordFormatType.KI2:o=(0,A.importKI2)(e);break;case A.RecordFormatType.CSA:o=(0,A.importCSA)(e);break;case A.RecordFormatType.JKF:o=(0,A.importJKFString)(e);break;case A.RecordFormatType.USEN:o=A.Record.newByUSEN(e);break;default:o=new Error(i.t.failedToDetectRecordFormat)}return o instanceof Error?(0,i.cB)(o):o}importRecord(e,t){const o=this.parseRecordData(e,t?.type);if(o instanceof Error)return o;switch(t?.mode||"standard"){case"standard":this.replaceRecord(o,t);break;case"mergeIntoRoot":return this.mergeRecord(o);case"mergeIntoCurrent":return this.mergeRecordIntoCurrent(o)}}importRecordFromBuffer(e,t,o){const n=(0,ke.QT)(t);if(!n)return new Error(`${i.t.unknownFileExtension}: ${t}`);const a=(0,ke.Nj)(e,n,o);if(a instanceof Error)return(0,i.cB)(a);this.replaceRecord(a,{path:t,markAsSaved:!0})}async importRecordFromRemoteURL(e){const t=!!e;if(!(e=e||this._sourceURL))throw new Error("RecordManager#importRecordFromRemoteURL: source URL is not set");const o=await Ae.Ay.loadRemoteTextFile(e),n=this.parseRecordData(o);if(n instanceof Error)throw n;if(t)return this.replaceRecord(n),void(this._sourceURL=e);const i=this.mergeRecord(n);if(i)throw i}exportRecordAsBuffer(e,t){const o=(0,ke.QT)(e);if(!o)return new Error(`${i.t.unknownFileExtension}: ${e}`);const n=(0,ke.KM)(this._record,o,t);return this.updateRecordFilePath(e),n}applyPosition(e){this._record.clear(e),this._unsaved=!0,this._recordFilePath=void 0,this.onChangePosition()}swapNextTurn(){const e=this.record.position.clone();e.setColor((0,A.reverseColor)(e.color)),this.applyPosition(e)}changePosition(e){const t=this.record.position.clone();t.edit(e),this.applyPosition(t)}changePieceSet(e){const t=this.record.position.clone(),o=(0,A.countExistingPieces)(this.record.position),n={king:e.king-o.king,rook:e.rook-(o.rook+o.dragon),bishop:e.bishop-(o.bishop+o.horse),gold:e.gold-o.gold,silver:e.silver-(o.silver+o.promSilver),knight:e.knight-(o.knight+o.promKnight),lance:e.lance-(o.lance+o.promLance),pawn:e.pawn-(o.pawn+o.promPawn)};Object.entries(n).filter(([,e])=>e<0).forEach(([e,o])=>{const n=e;for(let e=0;e>o;e--){const e=A.Square.all.find(e=>t.board.at(e)?.unpromoted().type===n);e?t.board.remove(e):n!==A.PieceType.KING&&(t.blackHand.count(n)>t.whiteHand.count(n)?t.blackHand.reduce(n,1):t.whiteHand.reduce(n,1))}}),Object.entries(n).filter(([,e])=>e>0).forEach(([e,o])=>{const n=e;for(let e=0;e<o;e++){const e=A.Square.all.find(e=>!t.board.at(e));e?t.board.set(e,new A.Piece(A.Color.BLACK,n)):n!==A.PieceType.KING&&(t.blackHand.count(n)<=t.whiteHand.count(n)?t.blackHand.add(n,1):t.whiteHand.add(n,1))}}),this.applyPosition(t)}goForward(){this._record.goForward()}goBack(){this._record.goBack()}changePly(e){this._record.goto(e)}changeBranch(e){return this._record.switchBranchByIndex(e)}changeNode(e){return this._record.gotoNode(e)}swapWithNextBranch(){return!!this._record.swapWithNextBranch()&&(this._unsaved=!0,!0)}swapWithPreviousBranch(){return!!this._record.swapWithPreviousBranch()&&(this._unsaved=!0,!0)}resetAllBranchSelection(){this._record.resetAllBranchSelection()}removeCurrentMove(){return!!this._record.removeCurrentMove()&&(this._unsaved=!0,this.onUpdateTree(),!0)}removeNextMove(){return!!this._record.removeNextMove()&&(this._unsaved=!0,this.onUpdateTree(),!0)}jumpToBookmark(e){return this._record.jumpToBookmark(e)}updateComment(e){this._record.current.comment=e,this._unsaved=!0,this.onUpdateComment()}updateBookmark(e){this._record.current.bookmark=e,this._unsaved=!0,this.onUpdateBookmark()}appendComment(e,t){if(!e)return;const o=this._record.current.comment,n=this.record.current.comment?"\n":"";switch(t){case Ie.Q.NONE:break;case Ie.Q.INSERT:this._record.current.comment=e+n+o;break;case Ie.Q.APPEND:this._record.current.comment=o+n+e;break;case Ie.Q.OVERWRITE:this._record.current.comment=e}this._unsaved=!0,this.onUpdateComment()}appendSearchComment(e,t,o,n,i){let a;switch(t){case Ie.F.SHOGIHOME:a=function(e,t,o,n){const i=t===Me.K.PLAYER?"*":"#";let a="";o.mate&&(a+=`${i}詰み=${o.mate>=0?"先手勝ち":"後手勝ち"}`,Math.abs(o.mate)!==V.m&&(a+=`:${Math.abs(o.mate)}手`),a+="\n");var s;return void 0!==o.score&&(a+=((s=o.score)>=1500?"先手勝勢":s>=600?"先手優勢":s>=400?"先手有利":s>=200?"先手有望":s>-200?"互角":s>-400?"後手有望":s>-600?"後手有利":s>-1500?"後手優勢":"後手勝勢")+"\n",a+=`${i}評価値=${o.score}\n`),o.pv&&0!==o.pv.length&&(a+=`${i}読み筋=${(0,A.formatPV)(e,o.pv)}\n`),o.depth&&(a+=`${i}深さ=${o.depth}\n`),o.nodes&&(a+=`${i}ノード数=${o.nodes}\n`),a&&n?.engineName&&(a+=`${i}エンジン=${n.engineName}\n`),a}(this.record.position,e,o,i);break;case Ie.F.FLOODGATE:a=xe(o);break;case Ie.F.CSA3:a=function(e){return xe(e)+(void 0!==e.nodes?` #${e.nodes}`:"")}(o);break;case Ie.F.SHOGIGUI:a=function(e,t){let o="*"+(e===Me.K.PLAYER?"対局":"解析");if(void 0!==t.depth&&(o+=` 深さ ${t.depth}`),void 0!==t.nodes&&(o+=` ノード数 ${t.nodes}`),void 0!==t.score?o+=` 評価値 ${t.score}`:void 0!==t.mate&&(o+=" 評価値 "+(t.mate>0?3e4:-3e4)),t.pv?.length){o+=" 読み筋";for(const e of t.pv)o+=" "+(e.color===A.Color.BLACK?"▲":"△")+(0,A.formatKIFMove)(e)}return o}(e,o)}i?.header&&(a=i.header+"\n"+a),this.appendComment(a,n),this._unsaved=!0}get inCommentPVs(){return function(e,t){const o=[];for(const n of t.split("\n")){let t;if(/^[#*]読み筋=/.test(n))t=(0,A.parsePV)(e,n.substring(5));else if(/^\*.* 読み筋 /.test(n)){const o=n.substring(n.indexOf(" 読み筋 ")+5),i=e.color===A.Color.BLACK?"▲":"△";t=(0,A.parsePV)(e,o.substring(o.indexOf(i)))}else if(/^#(?:指し手|形勢)\[/.test(n)){const o=n.substring(n.indexOf("]")+1),i=e.color===A.Color.BLACK?"▲":"△";t=(0,A.parsePV)(e,o.substring(o.indexOf(i)))}else/^\* -?[0-9]+ /.test(n)&&(t=Ke(e,n));t?.length&&o.push(t)}return o}(this.record.position,this.record.current.comment)}setGameStartMetadata(e){e.gameTitle&&this._record.metadata.setStandardMetadata(A.RecordMetadataKey.TITLE,e.gameTitle),e.blackName&&this._record.metadata.setStandardMetadata(A.RecordMetadataKey.BLACK_NAME,e.blackName),e.whiteName&&this._record.metadata.setStandardMetadata(A.RecordMetadataKey.WHITE_NAME,e.whiteName),this._record.metadata.setStandardMetadata(A.RecordMetadataKey.DATE,(0,h.sq)()),this._record.metadata.setStandardMetadata(A.RecordMetadataKey.START_DATETIME,(0,h.ln)());const t=e.blackTimeLimit.increment||e.whiteTimeLimit.increment?Ve:Ye,o=t(e.blackTimeLimit),n=t(e.whiteTimeLimit);o===n?this._record.metadata.setStandardMetadata(A.RecordMetadataKey.TIME_LIMIT,o):(this._record.metadata.setStandardMetadata(A.RecordMetadataKey.BLACK_TIME_LIMIT,o),this._record.metadata.setStandardMetadata(A.RecordMetadataKey.WHITE_TIME_LIMIT,n)),this._unsaved=!0}setGameEndMetadata(){this._record.metadata.setStandardMetadata(A.RecordMetadataKey.END_DATETIME,(0,h.ln)()),this._unsaved=!0}updateSearchInfo(e,t){const o=this.record.current.customData||{};switch(e){case Me.K.PLAYER:o.playerSearchInfo=t;break;case Me.K.OPPONENT:o.opponentSearchInfo=t;break;case Me.K.RESEARCHER:(t.depth||0)>=(o.researchInfo?.depth||0)&&(o.researchInfo=t);break;case Me.K.RESEARCHER_2:(t.depth||0)>=(o.researchInfo2?.depth||0)&&(o.researchInfo2=t);break;case Me.K.RESEARCHER_3:(t.depth||0)>=(o.researchInfo3?.depth||0)&&(o.researchInfo3=t);break;case Me.K.RESEARCHER_4:(t.depth||0)>=(o.researchInfo4?.depth||0)&&(o.researchInfo4=t)}this._record.current.customData=o,this.onUpdateCustomData()}appendMove(e){return!!this._record.append(e.move,e.moveOption)&&(void 0!==e.elapsedMs&&this._record.current.setElapsedMs(e.elapsedMs),this._unsaved=!0,!0)}appendMovesSilently(e,t){this.unbindChangePositionHandler();try{let o=0;const n=this._record.current.ply;for(const n of e){if(!this._record.append(n,t))break;o++}return this._record.goto(n),this._unsaved=!0,this.onUpdateTree(),o}finally{this.bindRecordHandlers()}}mergeRecord(e){if(this._record.initialPosition.sfen!==e.initialPosition.sfen)return new Error(i.t.failedToMergeRecordWithDifferentInitialPosition);this._record.merge(e),this._unsaved=!0,$e(this._record),this.onUpdateTree()}mergeRecordIntoCurrent(e){if(this._record.position.color!==e.initialPosition.color)return new Error(i.t.failedToMergeRecordWithDifferentTurn);const{successCount:t,skipCount:o}=this._record.mergeIntoCurrentPosition(e);return this._unsaved=!0,$e(this._record),this.onUpdateTree(),o>0?new Error(i.t.skippedMovesInMerge(o,t+o)):void 0}updateStandardMetadata(e){this._record.metadata.setStandardMetadata(e.key,e.value),this._unsaved=!0}on(e,t){switch(e){case"changePosition":this.changePositionHandler=t;break;case"updateTree":this.updateTreeHandler=t;break;case"updateComment":this.updateCommentHandler=t;break;case"updateBookmark":this.updateBookmarkHandler=t;break;case"updateCustomData":this.updateCustomDataHandler=t;break;case"backup":this.backupHandler=t}return this}onChangePosition(){this.changePositionHandler&&this.changePositionHandler()}onUpdateTree(){this.updateTreeHandler&&this.updateTreeHandler()}onUpdateComment(){this.updateCommentHandler&&this.updateCommentHandler()}onUpdateBookmark(){this.updateBookmarkHandler&&this.updateBookmarkHandler()}onUpdateCustomData(){this.updateCustomDataHandler&&this.updateCustomDataHandler()}onBackup(){return this.backupHandler?this.backupHandler():null}resetPositionCounts(){this._positionCounts.clear(),this._record.forEach(e=>{this.addPositionCount(e)})}isPositionCountTarget(e){return 0===e.ply||e.move instanceof A.Move}addPositionCount(e){if(!this.isPositionCountTarget(e))return;const t=this._positionCounts.get(e.sfen)||0;this._positionCounts.set(e.sfen,t+1)}reducePositionCount(e){if(!this.isPositionCountTarget(e))return;const t=this._positionCounts.get(e.sfen)||0;t>1?this._positionCounts.set(e.sfen,t-1):this._positionCounts.delete(e.sfen)}bindRecordHandlers(){this._record.on("changePosition",this.onChangePosition.bind(this)),this._record.on("clear",this.resetPositionCounts.bind(this)),this._record.on("addNode",e=>{this.addPositionCount(e)}),this._record.on("removeNode",e=>{this.reducePositionCount(e)})}unbindChangePositionHandler(){this._record.on("changePosition",()=>{})}}var je=o(348),qe=o(154),ze=o(578),Xe=o(685);async function Qe(e){try{return await d.promises.lstat(e),!0}catch{return!1}}var Ze=o(516);const et=new class{valueKeys=[];stringRestrictions=new Map;numberKeys=[];numberRestrictions=new Map;flagKeys=[];values=new Map;numbers=new Map;flags=new Map;bareArgs=[];help;constructor(e,t){"string"==typeof t&&(t=[t]),this.help="Usage:\n";for(const o of t||[""])this.help+=` ${e} [options] ${o}\n`;this.help+="\nOptions:\n"}value(e,t,o,n){const i="--"+e;return this.help+=` ${i} VALUE\n`,this.help+=` ${t}\n`,this.help+=` (default: ${o})\n`,this.valueKeys.push(i),n&&this.stringRestrictions.set(i,n),()=>{const e=this.values.get(i);return void 0!==e?e:o}}valueOrNull(e,t,o){const n="--"+e;return this.help+=` ${n} VALUE\n`,this.help+=` ${t}\n`,this.valueKeys.push(n),o&&this.stringRestrictions.set(n,o),()=>{const e=this.values.get(n);return void 0!==e?e:null}}number(e,t,o,n){const i="--"+e;return this.help+=` ${i} VALUE\n`,this.help+=` ${t}\n`,this.help+=` (default: ${o})\n`,this.numberKeys.push(i),n&&this.numberRestrictions.set(i,n),()=>{const e=this.numbers.get(i);return void 0!==e?e:o}}numberOrNull(e,t,o){const n="--"+e;return this.help+=` ${n} VALUE\n`,this.help+=` ${t}\n`,this.numberKeys.push(n),o&&this.numberRestrictions.set(n,o),()=>{const e=this.numbers.get(n);return void 0!==e?e:null}}flag(e,t){const o="--"+e;return this.help+=` ${o}\n`,this.help+=` ${t}\n`,this.flagKeys.push(o),()=>this.flags.get(o)||!1}parse(){let e=0;for(let t=2;t<process.argv.length;t++){const o=process.argv[t];if(t===e)this.bareArgs.push(o);else if(this.valueKeys.includes(o)){const e=process.argv[++t],n=this.stringRestrictions.get(o);n&&(n.includes(e)||this.onError(`${o} option must be one of: ${n.join(", ")}`)),this.values.set(o,e)}else if(this.numberKeys.includes(o)){const e=Number(process.argv[++t]);Number.isNaN(e)&&this.onError(`${o} option must be a number: ${process.argv[t]}`);const n=this.numberRestrictions.get(o);n?.min&&e<n.min&&this.onError(`${o} option must be greater than or equal to ${n.min}`),n?.max&&e>n.max&&this.onError(`${o} option must be less than or equal to ${n.max}`),this.numbers.set(o,e)}else this.flagKeys.includes(o)?this.flags.set(o,!0):"--"===o?e=t+1:"--help"===o?(this.showHelp(),process.exit(0)):o.startsWith("-")?this.onError(`Unknown option: ${o}`):this.bareArgs.push(o)}}get args(){return this.bareArgs}showHelp(){console.log(this.help)}onError(e){console.error(e),process.exit(1)}}("usi-csa-bridge",["path/to/csa_game_config.yaml","path/to/csa_game_config.json","--base64 <base64>"]),tt=et.valueOrNull("base64","Base64 of gzip compressed JSON config."),ot=et.number("engine-timeout","Maximum time[seconds] of USI engine execution.",180,{min:1}),nt=et.valueOrNull("protocol-version","Overwrite server.protocolVersion setting."),it=et.valueOrNull("host","Overwrite server.host setting."),at=et.numberOrNull("port","Overwrite server.port setting.",{min:1024,max:49151}),st=et.valueOrNull("id","Overwrite server.id setting."),rt=et.valueOrNull("password","Overwrite server.password setting."),ct=et.flag("save-record","Save record file after game end."),lt=et.value("record-dir","Directory to save records.","records"),ht=et.valueOrNull("record-file-name-template","Overwrite recordFileNameTemplate setting."),dt=et.valueOrNull("record-file-format","Overwrite recordFileFormat setting."),ut=et.value("return-code","Return code which one of LF or CRLF. It is used for record file.","win32"===process.platform?"CRLF":"LF",["LF","CRLF"]),mt=et.flag("csa-v3","Use CSA V3 format for record file."),pt=et.numberOrNull("repeat","Overwrite repeat setting.",{min:1}),gt=et.flag("app-log-file","Enable application log file."),St=et.flag("usi-log-file","Enable USI log file."),yt=et.flag("csa-log-file","Enable CSA log file."),ft=et.flag("all-log-file","Enable all log files."),Tt=et.flag("disable-stdout-log","Disable stdout log. Should be used with --XXX-log-file."),vt=et.value("log-level",`Log level which one of: ${Object.values(n.$).join(", ")}`,n.$.INFO,[n.$.DEBUG,n.$.INFO,n.$.WARN,n.$.ERROR]),Ct=et.value("lang",`Language which one of: ${Object.values(i.TM).join(", ")}`,i.TM.JA,[i.TM.JA,i.TM.EN,i.TM.ZH_TW,i.TM.VI]);et.parse(),function(e){(0,i.xC)(e.language);const t=e.stdoutLog?["file","stdout"]:["file"],a=e.appLogFile?t:["stdout"],s=e.usiLogFile?t:["stdout"],r=e.csaLogFile?t:["stdout"];E(n.F.APP,a,e.logLevel),E(n.F.USI,s,e.logLevel),E(n.F.CSA,r,e.logLevel),re=0,function(e){x=e}(0),function(e){if(te)throw new Error("handlers already set");te=e}({...o(128),onEngineProcessStats:()=>{},sendPromptCommand:()=>{}}),function(e){if(G)throw new Error("handlers already set");G=e}({...o(348),sendPromptCommand:()=>{},sendError:e=>{k().error(e)}}),process.on("uncaughtException",(e,t)=>{k().error(new Error(`${t} ${e}`))})}({appLogFile:gt()||ft(),usiLogFile:St()||ft(),csaLogFile:yt()||ft(),stdoutLog:!Tt(),logLevel:vt(),language:Ct()}),async function(){const e=et.args[0];let t;const o=tt();if(o?t=await(0,N.xv)(o):(e||(k().error("config file is not specified."),et.showHelp(),process.exit(1)),t=e.endsWith(".json")?JSON.parse(u().readFileSync(e,"utf-8")):Ee().parse(u().readFileSync(e,"utf-8"))),t.server.protocolVersion=nt()||t.server.protocolVersion,t.server.host=it()||t.server.host,t.server.port=at()||t.server.port,t.server.id=st()||t.server.id,t.server.password=rt()||t.server.password,t.saveRecordFile=ct()||t.saveRecordFile,t.repeat=pt()||t.repeat,e&&!await Qe(t.usi.path)){const o=s().resolve(s().dirname(e),t.usi.path);await Qe(o)||(k().error(`usi engine is not found: ${t.usi.path}`),process.exit(1)),t.usi.path=o}const n=(0,N.$P)(t,{autoSaveDirectory:lt()}),i=(0,N.VX)(n);i&&(k().error(i),process.exit(1));const a=new Je,r=new Pe,c=new Pe,l=new je.CSAGameManager(a,r,c),h=(0,qe.c)({timeoutSeconds:ot()});l.on("gameNext",function(){k().info("waiting for new game...")}).on("newGame",function(e){k().info(`${(0,Xe.IE)(e)} game started.`)}).on("closed",function(){k().info("completed. will exit after some seconds...")}).on("saveRecord",function(e){const o=(0,ze.OL)(a.record,{template:ht()||t.recordFileNameTemplate||Ze.g,extension:dt()||t.recordFileFormat||ke.vr.KIF}),n=s().join(e,o);u().promises.mkdir(e,{recursive:!0}).then(()=>{const e=a.exportRecordAsBuffer(n,{returnCode:d,csa:{v3:mt()}});if(!(e instanceof Error))return u().promises.writeFile(n,e.data);k().error(e)}).then(()=>{k().info("record saved: %s",n)}).catch(e=>{k().error(e)})}).on("loginRetry",function(){k().warn(`Retry login after ${je.loginRetryIntervalSeconds} seconds...`)}).on("error",function(e){k().error(e)}).login(n,h).catch(function(e){k().error(e),process.exit(1)});const d="CRLF"===ut()?"\r\n":"\n"}(),module.exports={}})();
|