copilot-operator 0.1.50 → 0.1.52
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/README.md +587 -574
- package/dist/src/api/operator.controller.js +119 -1023
- package/dist/src/api/operator.service.js +346 -2553
- package/dist/src/config/schema.js +13 -0
- package/dist/src/orchestrator/hold.js +49 -0
- package/dist/src/orchestrator/leadRunner.js +559 -0
- package/dist/src/orchestrator/taskRunner.js +211 -39
- package/dist/src/plan/kerrigan.js +232 -0
- package/dist/src/plan/systemGuide.js +758 -3757
- package/dist/src/protocol/leadSchema.js +156 -0
- package/dist/src/protocol/parser.js +1 -1
- package/dist/src/session/chatNotice.js +191 -0
- package/dist/src/session/checkpoint.js +19 -0
- package/dist/src/session/compose.js +1 -1
- package/dist/src/session/store.js +17 -126
- package/dist/src/session/workspace.js +52 -5
- package/dist/src/transport/chatTransport.js +1 -1
- package/dist/src/transport/copilotTransport.js +135 -1
- package/dist/web/404.html +13 -16
- package/dist/web/_next/static/_1zhoDsMOPAH2xW702E5A/_buildManifest.js +1 -0
- package/dist/web/_next/static/chunks/134-ddd50a7fbb536ec8.js +1 -0
- package/dist/web/_next/static/chunks/163.dbd7d36584d0bb37.js +1 -0
- package/dist/web/_next/static/chunks/220.35531b39410e1a9f.js +1 -0
- package/dist/web/_next/static/chunks/548.71ac96c94136659b.js +1 -0
- package/dist/web/_next/static/chunks/584.6df695c5b86a75aa.js +1 -0
- package/dist/web/_next/static/chunks/67.9ed79e2fbfb56f26.js +1 -0
- package/dist/web/_next/static/chunks/714.1e2338736a70b9c7.js +1 -0
- package/dist/web/_next/static/chunks/747.d2c1249d736dc03b.js +1 -0
- package/dist/web/_next/static/chunks/77.a200abef0f5b4a7f.js +1 -0
- package/dist/web/_next/static/chunks/808-bc7d7eac6d823291.js +1 -0
- package/dist/web/_next/static/chunks/921-dc5538cd779c6432.js +1 -0
- package/dist/web/_next/static/chunks/app/defaults/page-edd7534ca9ecf366.js +1 -0
- package/dist/web/_next/static/chunks/app/layout-8f99a164d76897a0.js +1 -0
- package/dist/web/_next/static/chunks/app/page-4bed816eda370d0c.js +1 -0
- package/dist/web/_next/static/chunks/app/system/page-1cf9e75e76da59ed.js +1 -0
- package/dist/web/_next/static/chunks/webpack-77147e31d2125631.js +1 -0
- package/dist/web/_next/static/css/3bea264adc472bc8.css +1 -0
- package/dist/web/defaults.html +13 -16
- package/dist/web/defaults.txt +22 -23
- package/dist/web/index.html +13 -16
- package/dist/web/index.txt +22 -23
- package/dist/web/system.html +13 -16
- package/dist/web/system.txt +22 -23
- package/package.json +5 -23
- package/prompts/lead1.md +116 -0
- package/dist/src/api/saveToDesktop.js +0 -157
- package/dist/src/plan/brief.js +0 -2003
- package/dist/src/plan/changes.js +0 -217
- package/dist/src/plan/script.js +0 -1014
- package/dist/src/session/debugExport.js +0 -165
- package/dist/src/session/exportRecord.js +0 -277
- package/dist/src/session/metrics.js +0 -95
- package/dist/src/vcs/prepareFromRemote.js +0 -288
- package/dist/src/vcs/remoteAuth.js +0 -117
- package/dist/src/vcs/startChoice.js +0 -367
- package/dist/src/vcs/syncCommand.js +0 -97
- package/dist/web/_next/static/chunks/197-f7c33a0114fc3db3.js +0 -1
- package/dist/web/_next/static/chunks/499-751e0be9d4f86e2d.js +0 -1
- package/dist/web/_next/static/chunks/534-56c68930a1a3c10f.js +0 -1
- package/dist/web/_next/static/chunks/549-c32dd718a1809d4d.js +0 -1
- package/dist/web/_next/static/chunks/699-9d031f8c145a0465.js +0 -1
- package/dist/web/_next/static/chunks/867-0e5d0d5472bf185f.js +0 -1
- package/dist/web/_next/static/chunks/app/appearance/page-a18019cdc395de3d.js +0 -1
- package/dist/web/_next/static/chunks/app/defaults/page-614be29d185a2947.js +0 -1
- package/dist/web/_next/static/chunks/app/history/page-95bab4c1b1ff9339.js +0 -1
- package/dist/web/_next/static/chunks/app/import/page-8ef75fc08638e75f.js +0 -1
- package/dist/web/_next/static/chunks/app/layout-a1314921eeba8ad5.js +0 -1
- package/dist/web/_next/static/chunks/app/level1/page-dd3ebf37d29dce4f.js +0 -1
- package/dist/web/_next/static/chunks/app/page-4d8f0851fe672925.js +0 -1
- package/dist/web/_next/static/chunks/app/presets/page-93ab518db67e52a2.js +0 -1
- package/dist/web/_next/static/chunks/app/sessions/page-28376d2e4a9b4738.js +0 -1
- package/dist/web/_next/static/chunks/app/sessions/view/page-adb64f8ba3d8c06e.js +0 -1
- package/dist/web/_next/static/chunks/app/system/page-227a259e383ca2a0.js +0 -1
- package/dist/web/_next/static/chunks/webpack-0f31b926d9a9c5a4.js +0 -1
- package/dist/web/_next/static/css/4335e4ce269ba1ea.css +0 -1
- package/dist/web/_next/static/z74_FBfnnXW5IJCHTgTH2/_buildManifest.js +0 -1
- package/dist/web/appearance.html +0 -16
- package/dist/web/appearance.txt +0 -26
- package/dist/web/history.html +0 -16
- package/dist/web/history.txt +0 -26
- package/dist/web/import.html +0 -16
- package/dist/web/import.txt +0 -26
- package/dist/web/level1.html +0 -16
- package/dist/web/level1.txt +0 -26
- package/dist/web/presets.html +0 -19
- package/dist/web/presets.txt +0 -26
- package/dist/web/sessions/view.html +0 -16
- package/dist/web/sessions/view.txt +0 -26
- package/dist/web/sessions.html +0 -16
- package/dist/web/sessions.txt +0 -26
- package/prompts/organisation.bg.md +0 -43
- package/prompts/organisation.en.md +0 -43
- package/prompts/persona.bg.md +0 -17
- package/prompts/persona.en.md +0 -17
- package/prompts/work.bg.md +0 -19
- package/prompts/work.en.md +0 -19
- /package/dist/web/_next/static/{z74_FBfnnXW5IJCHTgTH2 → _1zhoDsMOPAH2xW702E5A}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[921],{5549:(e,t,o)=>{o.d(t,{FH:()=>h});let a="/api",n="cop-api-token";function s(){try{let e=/(?:^#|&)token=([0-9a-f]{16,})/i.exec(window.location.hash);if(e)return window.localStorage.setItem(n,e[1]),window.history.replaceState(null,"",window.location.pathname+window.location.search),e[1];return window.localStorage.getItem(n)||""}catch(e){return""}}function i(e){let t=s();return t?"".concat(e).concat(e.includes("?")?"&":"?","token=").concat(encodeURIComponent(t)):e}async function r(e,t){let o,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=void 0===n.timeoutMs?3e4:n.timeoutMs;try{var r;o=await fetch("".concat(a).concat(e),{...t,...null!==i&&!(null==t?void 0:t.signal)?{signal:AbortSignal.timeout(i)}:{},headers:{"content-type":"application/json",...s()?{"x-cop-token":s()}:{},...null!=(r=null==t?void 0:t.headers)?r:{}}})}catch(t){if("TimeoutError"===t.name)throw Error("The API did not answer within ".concat(Math.round((null!=i?i:0)/1e3)," s (").concat(e.split("?")[0],"). It may be busy; try again."));throw t}if(!o.ok){let e="".concat(o.status," ").concat(o.statusText);try{let t=await o.json();(null==t?void 0:t.message)&&(e=Array.isArray(t.message)?t.message.join("; "):t.message)}catch(e){}throw Object.assign(Error(e),{status:o.status})}let h=await o.text();return h?JSON.parse(h):void 0}let h={doctor:()=>r("/doctor"),settings:()=>r("/settings"),saveSettings:e=>r("/settings",{method:"PUT",body:JSON.stringify(e)}),level1:()=>r("/level1"),sessions:()=>r("/sessions"),session:e=>r("/sessions/".concat(e)),updateSession:(e,t)=>r("/sessions/".concat(e),{method:"PUT",body:JSON.stringify(t)}),taskChanges:(e,t,o)=>r("/sessions/".concat(e,"/tasks/").concat(t,"/changes").concat(o?"?run=".concat(encodeURIComponent(o)):"")),taskChangeFile:(e,t,o,a)=>r("/sessions/".concat(e,"/tasks/").concat(t,"/changes/file?path=").concat(encodeURIComponent(o)).concat(a?"&run=".concat(encodeURIComponent(a)):"")),taskStory:(e,t,o)=>r("/sessions/".concat(e,"/tasks/").concat(t,"/story").concat(o?"?run=".concat(encodeURIComponent(o)):"")),start:(e,t)=>r("/sessions/".concat(e,"/start"),{method:"POST",body:JSON.stringify({mode:t})},{timeoutMs:12e4}),startFailures:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return r("/start/failures".concat(e?"?unanswered=1":""))},startFailureUrl:e=>i("".concat(a,"/start/failures/").concat(encodeURIComponent(e),"/report")),terminalUrl:()=>i("".concat(a,"/terminal")),stop:e=>r("/sessions/".concat(e,"/stop"),{method:"POST",body:"{}"}),pause:e=>r("/sessions/".concat(e,"/pause"),{method:"POST",body:"{}"}),resume:e=>r("/sessions/".concat(e,"/resume"),{method:"POST",body:"{}"}),approvals:e=>r("/approvals".concat(e?"?session=".concat(encodeURIComponent(e)):"")),workspace:()=>r("/workspace"),workspaceFiles:()=>r("/workspace/files"),workspaceFile:e=>r("/workspace/file?path=".concat(encodeURIComponent(e))),saveWorkspaceFile:(e,t,o)=>r("/workspace/file",{method:"PUT",body:JSON.stringify({path:e,text:t,...o?{base:o}:{}})}),workspaceGit:()=>r("/workspace/git"),workspaceCommit:e=>r("/workspace/git/commit?sha=".concat(encodeURIComponent(e))),workspaceGitFile:(e,t,o)=>r("/workspace/git/file?area=".concat(e,"&path=").concat(encodeURIComponent(t)).concat(o?"&commit=".concat(encodeURIComponent(o)):"")),chatThreads:()=>r("/chat/threads"),chatSend:(e,t,o,a,n,s,i,h)=>r("/chat",{method:"POST",body:JSON.stringify({text:e,...t?{threadId:t}:{},...o?{model:o}:{},...a?{manualModel:!0}:{},...n?{lang:n}:{},...s?{planMode:!0}:{},...void 0!==i?{review:i}:{},...h?{lead:!0,...h.workerManualModel?{workerManualModel:!0}:h.workerModel?{workerModel:h.workerModel}:{}}:{}})}),answerQuestion:(e,t)=>r("/approvals/".concat(e,"/answer"),{method:"POST",body:JSON.stringify({text:t})}),chatRewind:(e,t)=>r("/chat/".concat(e,"/rewind"),{method:"POST",body:JSON.stringify({taskId:t})}),sessionEvents:e=>r("/sessions/".concat(e,"/events")),decidePlan:(e,t,o)=>r("/approvals/".concat(e,"/plan"),{method:"POST",body:JSON.stringify({action:t,...(null==o?void 0:o.trim())?{note:o}:{}})}),decide:(e,t)=>r("/approvals/".concat(e),{method:"POST",body:JSON.stringify({action:t})}),browseFolder:e=>r("/browse-folder",{method:"POST",body:JSON.stringify({start:e})},{timeoutMs:null}),activity:()=>r("/activity"),kerrigan:e=>r("/kerrigan?lang=".concat(encodeURIComponent(e))),taskExchangeUrl:(e,t)=>i("".concat(a,"/sessions/").concat(encodeURIComponent(e),"/tasks/").concat(encodeURIComponent(t),"/exchange")),project:()=>r("/project"),setProject:e=>r("/project",{method:"PUT",body:JSON.stringify(e)}),models:()=>r("/models"),setDefaultModel:e=>r("/models/default",{method:"PUT",body:JSON.stringify({model:e})}),setDefaultReviewModel:e=>r("/models/review-default",{method:"PUT",body:JSON.stringify({model:e})}),refreshModels:()=>r("/models/refresh",{method:"POST",body:"{}"},{timeoutMs:null}),login:e=>r("/login",{method:"POST",body:JSON.stringify({account:(null==e?void 0:e.trim())||void 0})},{timeoutMs:null})}},8205:(e,t,o)=>{o.d(t,{LanguageProvider:()=>c,W3:()=>u,Ym:()=>w,kj:()=>p});var a=o(3365),n=o(1521),s=o(9051),i=o(9755);let r={en:()=>Promise.resolve().then(o.bind(o,9051)).then(e=>e.en),bg:()=>o.e(747).then(o.bind(o,9747)).then(e=>e.bg),de:()=>o.e(163).then(o.bind(o,2163)).then(e=>e.de),es:()=>o.e(548).then(o.bind(o,1548)).then(e=>e.es),fr:()=>o.e(584).then(o.bind(o,8584)).then(e=>e.fr),pt:()=>o.e(220).then(o.bind(o,7220)).then(e=>e.pt),ja:()=>o.e(77).then(o.bind(o,1077)).then(e=>e.ja),ko:()=>o.e(714).then(o.bind(o,714)).then(e=>e.ko),ar:()=>o.e(67).then(o.bind(o,9067)).then(e=>e.ar)},h="cop.locale",d=s.en,l=(0,n.createContext)({locale:"en",setLocale:()=>void 0,table:d});function c(e){let{children:t}=e,[o,s]=(0,n.useState)("en"),[c,p]=(0,n.useState)(d),w=(0,n.useRef)({en:d}),u=(0,n.useRef)("en"),m=(0,n.useCallback)(async e=>{var t,o,a;u.current=e;let n=w.current[e];if(!n)try{n=await (null!=(t=r[e])?t:r.en)(),w.current[e]=n}catch(e){return}u.current===e&&(p(n),s(e),document.documentElement.lang=e,document.documentElement.dir=null!=(a=null==(o=(0,i.eX)(e))?void 0:o.dir)?a:"ltr")},[]);return(0,n.useEffect)(()=>{var e,t,o;let a="en";try{let o=window.localStorage.getItem(h);a=null!=(t=null!=(e=(0,i.Od)(o))?e:(0,i.Od)(navigator.language))?t:"en"}catch(e){a=null!=(o=(0,i.Od)(navigator.language))?o:"en"}m(a)},[m]),(0,a.jsx)(l.Provider,{value:{locale:o,setLocale:e=>{try{window.localStorage.setItem(h,e)}catch(e){}m(e)},table:c},children:t})}function p(){let{locale:e,table:t}=(0,n.useContext)(l);return{t:function(e){var o,a;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=null!=(a=null!=(o=t[e])?o:d[e])?a:e;for(let[e,t]of Object.entries(n))s=s.split("{".concat(e,"}")).join(String(t));return s},locale:e}}function w(){return(0,n.useContext)(l)}function u(){let{locale:e}=(0,n.useContext)(l);return t=>{var o;return t?new Date(t).toLocaleString(null==(o=(0,i.eX)(e))?void 0:o.dateLocale,{hour12:!1}):""}}},9051:(e,t,o)=>{o.r(t),o.d(t,{en:()=>a});let a={"nav.label":"Main","nav.live":"live","nav.liveTitle":"The chat is working right now. Open it to watch.","nav.system":"System","nav.workbench":"Chat","chat.askRun":"Run","chat.askRunAll":"Run this and the rest","chat.askSkip":"Skip","chat.askTitle":"Run this command?","chat.changed":"{n} file(s) changed:","chat.example1":"Explain how this project is laid out and how to run its tests.","chat.example2":"Run the tests and fix what fails.","chat.example3":"Add a README section that says how to start the project locally.","chat.exit":"exit {code}","chat.input":"Message to the chat","chat.lookAbove":"Waiting for an answer on the card at the top.","chat.mode":"How commands run","chat.modeAsk":"Ask before each command","chat.modeAuto":"Run commands without asking","chat.modeWhy":"Whether each command the chat sends waits for you, or runs at once; the list of forbidden commands applies either way.","git.title":"Git","git.refresh":"Read the folder's git again","git.noFolder":"No project folder is open.","git.notRepo":"The project folder is not a git repository.","git.upstream":"{name}: {ahead} ahead, {behind} behind","git.staged":"Staged changes","git.changes":"Changes","git.noChanges":"Nothing has changed since the last commit.","git.commits":"Commits","git.noCommits":"No commits yet.","git.commitFiles":"The files of {sha}","git.more":"The newest {n} are shown.","git.workingTree":"Working tree","git.index":"Index","git.status.M":"modified","git.status.A":"added","git.status.D":"deleted","git.status.R":"renamed","git.status.C":"copied","git.status.T":"type changed","git.status.U":"untracked","git.status.conflict":"in conflict","copy.copy":"Copy","copy.copied":"Copied","copy.failed":"Not copied","chat.foldOpen":"Show the whole message","chat.foldClose":"Fold the message to its first lines","chat.copyMessage":"Copy your message","chat.copyReply":"Copy what the chat said","chat.copySummary":"Copy how it ended","chat.copyCommand":"Copy the command and what it printed","chat.newChat":"New chat","chat.newChatWhy":"The next message starts a new conversation in Copilot, with nothing of this one in it. This one stays in the list, to go back to.","chat.newChatRunning":'A task is running. "New chat" comes on once it stops: press "Stop", or close the Copilot browser window.',"chat.newChatFresh":"This is a new chat already: write the first message below and it begins.","chat.exchange":"⤓ JSON","chat.exchangeWhy":"Everything between the bot and Copilot for this message, as a JSON file: every message sent, every reply, every command that ran with its whole output and exit code.","chat.newThread":"New conversation","chat.notStarted":"It did not start: {reason}","chat.notStartedYet":"Not started. The message is kept in the conversation; send another or start it from its session.","chat.noted":"Added to what it is doing: it gets this with its next report.","chat.openFolder":"Open a folder","chat.placeholder":"Ask for a change in {folder}… (Enter sends, Shift+Enter a new line)","chat.placeholderNoFolder":"Open a folder first","chat.placeholderRunning":"Add to what it is doing… it gets this with its next report","chat.queued":"Waiting to start.","chat.running":"running…","chat.send":"Send","chat.sendNote":"Add to it","chat.sendWhy":"Enter","chat.stop":"Stop","chat.review":"Review","chat.reviewWhy":"When Copilot says the work is done, a conversation of its own checks it — reads the changes, runs the checks — and sends back what it finds, until it passes or the review rounds in Settings are spent. On unless you untick it. Of this conversation, or of the next one.","chat.lead":"Two chats","chat.leadWhy":"A lead and a worker, for a task too big for one go: your message goes to a lead, which restates it to check it understands it, has a worker look at the project, plans, gives the worker one subtask at a time and judges what it reports, until the result is ready in the form you asked for. The worker runs the commands. Both are conversations in the same Copilot window. Say clearly what you want, and in which form you want the result. For a new conversation; a started one keeps how it began.","chat.leadModel":"Lead","chat.workerModel":"Worker","chat.workerSameModel":"The lead's model","lead.who":"The lead","lead.understood":"The lead understands the task as","lead.plan":"The lead's plan (version {v})","lead.subtask":"Subtask {n}: {title}","lead.readOnly":"reads only","lead.fresh":"a new worker","lead.thinking":"The lead is deciding the next step…","lead.working":"The worker is on subtask {n}…","lead.subtasks":"{n} of {max} subtasks","lead.question":"The lead asks you","lead.answer":"Your answer","lead.answerPlaceholder":"Write your answer, or choose one of the options above.","lead.send":"Send the answer","lead.stop":"Stop the task","lead.stopConfirm":"Stop this task at the lead's question? It ends as stopped; what was done so far stays.","lead.answered":"You answered","lead.evidence":"What shows it","chat.pause":"Pause","chat.pauseWhy":"Holds the work where it is: a reply Copilot is writing and a command that is running are let finish, then nothing more is sent to Copilot and no other command runs until you press Continue. The conversation and the browser window stay as they are, and the time paused does not count against the time limit.","chat.resume":"Continue","chat.resumeWhy":"Goes on with the work from where it was paused.","chat.pausedNote":"Paused: nothing is sent to Copilot and nothing runs until you press Continue.","chat.stopping":"Stopping… An answer Copilot is writing is waited for first; then nothing more is sent.","chat.rewind":"Go back to before this message","chat.rewindConfirm":"Put the folder back exactly as it was before this message, and take it and what came after it out of the conversation ({n} message(s))? The folder as it is now is kept in a safety copy in git.","chat.rewound":"Back to before that message: the folder is as it was then, and the message is in the box to send again or change.","chat.model":"Model","chat.modelDefault":"As in Settings ({model})","chat.modelByHand":"Set the model by hand","chat.readModels":"Read the latest models from Copilot","chat.modelsReading":"Reading the models from Copilot… (the browser opens for a moment)","chat.modelsRead":"The list of models is the one Copilot offers now.","chat.thread":"Conversation","chat.turn":"Message: {text}","chat.waitingTurn":"Waiting for the message before it to finish.","chat.welcome":"Ask for a change in {folder}","chat.welcomeWhy":"Copilot answers with commands; they run here in {dir}, on the branch it is on ({branch}), and their output goes back to it, until it is done. The folder is kept before each message: you can go back to any of them.","chat.working":"Working… message {n}","wb.fileOnDisk":"{path} — as it is on disk, read-only","wb.welcomeChat":"The open folder is {dir}. Write in the chat on the right what to change: Copilot runs commands here until it is done.","wb.binary":"binary","wb.chatPanel":"Chat","theme.system":"System","wb.appearance":"Appearance: theme and text","ap.smaller":"Smaller text","ap.larger":"Larger text","wb.terminalInfoLabel":"What the Terminal shows","wb.terminalInfo":"Every command Copilot had run for the latest message of the conversation open in the chat, in the order they ran: the command, how it ended (its exit code) and everything it printed. While the message is being worked on, it follows the newest command.\n\nNothing is typed here: it shows what ran on this machine, in the open folder. A new chat starts it empty.","wb.problemsInfoLabel":"What the Problems show","wb.problemsInfo":'What did not go well in the conversation open in the chat: a message that ended unfinished, stopped or at a limit, and why; a check that did not pass. Press one to bring its message into view in the chat.\n\n"Seen" takes a problem off the list and the count, in this browser only; the message itself keeps it. The number on the tab counts the ones not seen yet.',"wb.outputInfoLabel":"What the Output shows","wb.outputInfo":"The bot's own log of the conversation open in the chat, newest at the bottom, each line with its time: the browser opening and the sign-in, the model, each message sent to Copilot and its answer arriving, the commands asked for and run, a stop, an error.\n\nRed lines are errors, yellow ones warnings. It is what to read when something did not go as expected.","wb.pickChat":"Write a message in the chat: what it runs shows here.","wb.problemShow":"Show its message in the chat","wb.cmdThread":"Open the conversation “{name}” in the chat","kerrigan.button":"Kerrigan","kerrigan.menu":"Kerrigan: save or copy","kerrigan.save":"Save as a file","kerrigan.copy":"Copy to the clipboard","kerrigan.saved":"Saved as {name}. Give it to a chat at the start of a conversation.","kerrigan.copied":"Copied ({n} characters). Paste it at the start of a conversation with a chat of your choice.","kerrigan.copyFailed":'The browser would not copy it. Use "Save as a file" instead.',"kerrigan.failed":"Kerrigan could not be read: {reason}","kerrigan.infoLabel":"What is Kerrigan?","kerrigan.info":'Kerrigan is a helper you may use or not. The button gives you a text — a persona — to paste at the start of a conversation with any chat you like: Microsoft Copilot, ChatGPT or another. With it, that chat knows what copilot-operator is and how it works, knows your projects with the level 2 you write for each in Settings, and helps you write a task for it: what to ask for in one message, which files and folders to name, how to say what "done" looks like and how to check it, what to leave alone. When something in the program is unclear, it explains it and leads you through it until the task is done.\n\nYou then copy the message it helped you write into the chat here. The chat here does not need Kerrigan and works just as well without her; this button sends nothing anywhere.',"ap.night":"Night light","chat.planMode":"Plan mode","chat.planModeWhy":"Copilot first looks at the project without changing anything and proposes a plan; the work starts once you approve it here.","chat.planShown":"The approved plan (version {v})","ed.save":"Save","ed.revert":"Undo my changes","ed.saved":"Saved.","ed.clean":"No changes","ed.unsaved":"Not saved","ed.language":"Language","ed.langAuto":"Automatic ({name})","ed.label":"The text of {path}","ed.changedOnDisk":"The file changed on disk after you opened it (the chat, or another program, changed it).","ed.reload":"Read it again (my changes are lost)","ed.saveOver":"Save over it","ed.closeUnsaved":'"{name}" has changes that are not saved. Close it and lose them?',"wb.chatTab":"Chat","wb.closeTab":"Close {name}","wb.cmdChat":"Write in the chat","wb.cmdCommits":"Show Git: the changes and the commits","wb.cmdFiles":"Show the repository’s files","wb.cmdGo":"Go to: {page}","wb.cmdPanel":"Show or hide the panel","wb.cmdProblems":"Show the problems","wb.cmdSide":"Show or hide the explorer","wb.editor":"Editor","wb.explorer":"Explorer","wb.files":"Files","wb.idle":"Nothing is running","wb.keys":"Ctrl+K: find anything \xb7 Ctrl+B: explorer \xb7 Ctrl+J: panel \xb7 Ctrl+L: write to the chat","wb.loading":"Reading…","wb.modelDefault":"the chat’s default model","wb.modelNow":"The model the session runs on","wb.noEvents":"Nothing has happened in this session yet.","wb.noProblems":"No problems in this session.","wb.problemSeen":"Seen","wb.problemSeenWhy":"Takes it off the list and the count, in this browser. It is still on its task, and shows again if a later run of the task has it again.","wb.problemsAllSeen":"Seen all","wb.problemsShowSeen":"Show the {n} seen","wb.problemsHideSeen":"Hide the seen","wb.problemsNoneNew":"Nothing new: every problem here has been seen.","wb.newChatTerminal":"A new chat: its commands show here once it runs.","wb.newChatProblems":"A new chat: nothing has gone wrong in it.","wb.newChatOutput":"A new chat: what it does shows here once it runs.","wb.noSteps":"This task ran no commands yet.","wb.noTabs":"Open a file from the explorer.","wb.openRunning":"Show the conversation that is running in the chat","wb.openTabs":"Open tabs","wb.output":"Output","wb.palette":"Find a command, a page or a conversation","wb.paletteNone":"Nothing found.","wb.palettePlaceholder":"Type to find…","wb.paletteWhy":"Every command, page and conversation of the chat, by a few letters (Ctrl+K)","wb.panel":"Panel","wb.problems":"Problems","wb.refresh":"Read again","wb.resize":"Drag to resize","wb.runningLine":"{session} › {task} \xb7 message {n}/{max} \xb7 {m}/{maxm} min","wb.pausedTag":"paused","wb.runningNow":"running…","wb.status":"Status","wb.terminal":"Terminal","wb.toggleChat":"Show or hide the chat","wb.tooLarge":"Too large to show.","wb.viewCommits":"Git","wb.viewFiles":"Files","wb.views":"Views","wb.waiting":"{n} waiting for you","wb.welcome":"Welcome","wb.welcomeWhy":"Open a folder: the chat on the right works in it, and its files and git are on the left.","dialog.confirmTitle":"Are you sure?","dialog.noticeTitle":"Notice","dialog.ok":"OK","dialog.cancel":"Cancel","exec.title":"Execution","exec.intro":"How a task runs: how long it may go on, what happens at a limit, and what may run without you. Saved in data/settings.json; applies to tasks started from now on.","exec.maxIterations":"Most messages to the chat in one task","exec.maxIterationsUnit":'messages, then the task stops as "limit reached"',"exec.maxIterationsWhy":"Each message is one round: the chat sends steps, the runner runs them and reports back. This stops a task that goes round in circles; it is not what limits traffic — that is the hourly cap, which waits instead of stopping. A task that stops here can be continued in the same chat.","exec.maxSubtasks":"Most subtasks the lead may give","exec.maxSubtasksUnit":"subtasks for one message with two chats","exec.maxSubtasksWhy":"In a conversation with two chats, the lead gives the worker one subtask at a time; each is a task of the worker's, with the limits above. This bounds the whole message: when they run out, the lead is told to deliver what it has. Applies to messages started from now on.","exec.maxRunMinutes":"Longest a task may run","exec.maxRunMinutesUnit":"minutes","exec.maxRunMinutesWhy":"Counted from the task's first message, waits for the hourly cap included. A task that stops here can be continued in the same chat.","exec.replyTimeout":"How long to wait for a reply from the chat","exec.replyTimeoutUnit":"seconds (900 = 15 minutes)","exec.replyTimeoutWhy":'From sending a message to the reply having finished. A reply not finished by then ends the task as failed — "Copilot did not finish a reply within …" — with a screenshot of the chat in the run folder. The slower models and long answers can take several minutes. Applies to runs started from now on.',"startdlg.title":"Where the work starts","pm.cardTitle":"Plan for “{title}”, waiting for approval","pm.cardWhy":"Nothing has been changed yet. The work starts once you approve this plan.","pm.note":"Note for the chat (optional when approving; says what to change when asking for another plan)","pm.notePlaceholder":"e.g. Keep the old endpoint working; do not touch the migrations.","pm.approve":"Approve and start the work","pm.revise":"Ask for another plan","pm.reviseWhy":"The chat makes a new plan with your note; the same card comes back with it.","pm.reviseNeedsNote":"Say in the note what the new plan should change.","pm.stop":"Stop the task","pm.stopConfirm":"Stop this task without doing the work? It ends as stopped and can be run again.","pm.version":"Plan version {n}, {at}","pm.approvedByOperator":"Approved by the operator, {at}.","pm.approvedAuto":"Approved by the runner, {at}.","pm.approvedNote":"Note: {note}","pm.existing":"Already there","pm.approach":"Approach","pm.steps":"Steps","pm.files":"Files it expects to change","pm.verification":"How it will show the work is done","pm.risks":"Risks","pm.revisions":"Earlier versions, and what was asked to change","pm.revision":"Version {n} ({at}):","startfail.laterSession":"A session of a run that was going could not begin:","startdlg.goStep":"Start, asking before each command","startdlg.goUnattended":"Start without asking","startfail.title":"The work did not start","startfail.where":"Where it stopped: {stage}.","startfail.stage.refused":"the start was not let in, before anything opened","startfail.stage.branch":"the branch chosen to start from","startfail.stage.preflight":"the version control check, before the browser opened","startfail.stage.browser":"opening the browser (Edge), its profile or the chat","startfail.stage.run":"the run, before its first task began","startfail.stage.at-turn":"this session's turn in the run, before its first task","startfail.stage.error":"the bot itself, while starting","startfail.when":"{when}, run {run}","startfail.whenNoRun":"{when}","startfail.download":"Download what happened (error, run record and terminal)","startfail.terminal":"Download what the terminal showed","startfail.downloadWhy":"A text file with the error, where it stopped, the run's own record, the sessions' events and every line the bot's console printed from the press to a few seconds after. Secret-shaped text is taken out.","startfail.dismiss":"Close this notice","startfail.later":"This run was accepted and then could not begin:","sys.terminalWhy":"The bot's console — what npm start or cop start printed — as a text file: the latest lines, each with its time, secret-shaped text taken out. Everything since the bot started is also in the data folder, logs\\terminal.log.","exec.autoContinue":"Keep going after a limit","exec.autoContinueUnit":"times per task, then it waits for “Continue” (0 = stop at the limit)","exec.autoContinueWhy":"A task stopped by a limit below — messages, minutes, the wait for a reply, replies in the wrong shape, rounds of fixing failed checks or review findings — is carried on at once in its own chat, from where it got to, as “Continue” would, this many times. So the work goes on until the task is done, and the limits still bound it: a task gets at most this number plus one of each. A task that blocked (the chat says it needs something) goes to a fresh chat, then waits for you; a task you stopped is never carried on.","exec.maxReviewRounds":"Rounds of fixing after a failed review","exec.maxReviewRoundsUnit":'rounds, then the task ends "blocked" with the review\'s findings',"exec.maxReviewRoundsWhy":"When the independent review fails the work, its findings go back to the chat to fix, and the work is reviewed again. This is how many times. It is a separate limit from the approaches above: those count how the chat gives up, these count reviews. 3 or 4 gives the work one or two more chances; more rarely helps — a finding that survives several fixes usually means the task itself has to be worded differently.","exec.minApproaches":"Approaches the chat must try before it may give up","exec.minApproachesUnit":'different approaches, then "blocked" is accepted',"exec.minApproachesWhy":'A task ends "blocked" when the chat says it cannot finish and lists what it tried. With fewer approaches than this, the runner sends it back asking for another, different one. The format\'s own minimum is 2. Three "blocked" replies in a row with nothing new tried are accepted anyway.',"exec.retryBlocked":"When a task ends blocked, run it again in a fresh conversation","exec.retryBlockedTimes":"times, then accept the verdict","exec.retryBlockedWhy":"The runner cannot tell why a task blocked: the prompt, the machine, or the chat itself — a long conversation whose early turns Copilot can no longer see. A fresh chat, with the contract sent again, cures a cause in the chat and nothing else. A task that comes back done was blocked by the chat; one that blocks again was not, and both attempts stay on its record. 0 turns this off.","exec.isolation":"Where the bot runs","exec.isolationNone":"Nowhere in particular — this account","exec.isolationNoneAccepted":"This account — I accept unattended runs without isolation","exec.isolationAccount":"A separate low-privilege Windows account","exec.isolationSandbox":"Windows Sandbox","exec.isolationVm":"A virtual machine","exec.isolationWhy":'Commands written by the model run as whoever this process is. Saying so here is what lets a run go unattended: with "nowhere in particular" chosen, a run without a person watching is refused, because nobody watching and nothing containing is the combination this will not be — unless you choose "I accept unattended runs without isolation", which allows it on your responsibility and is recorded with every run as exactly that. It is your statement, not a check — the runner records it, notes the account it actually holds, and says so when the two disagree.',"exec.startMode":"Starting a run without supervision","exec.startModeAsk":'Ask "are you sure" every time',"exec.startModeAuto":"Start it without asking","exec.startModeWhy":'With "Run commands without asking" chosen under the chat\'s box, the first message of a conversation asks "are you sure" before it starts. Choose "Start it without asking" and it simply starts — you decided once, here. The list of forbidden commands still applies, and a run on this machine can only go without supervision if "Where the bot runs" above allows it.',"exec.networkFetch":"A command that downloads, in a run without supervision","exec.networkFetchAsk":"Wait for me on the approval screen","exec.networkFetchRefuse":"Refuse it and tell the chat why — the run never waits","exec.networkFetchRun":"Run it without asking","exec.networkFetchWhy":"Invoke-WebRequest, curl, wget and the like. Waiting for you is the one stop a run without supervision still makes. Refusing sends the chat the reason and what to do instead (the project’s package manager, or writing the file with a step), so the run goes on without you. Running it means a later step can run what arrived without anyone having read it — choose it only on a machine where that is acceptable; every task records the choice. npm, dotnet, pip and git are never held, and a step-by-step run shows every command whatever is chosen here.","exec.saved":"Saved. Applies to runs started from now on.","diff.open":"See the changes ({n} file(s))","diff.openWhy":"Every file this attempt changed, before on the left and after on the right, with the differences marked.","diff.title":'Changes in "{title}"',"diff.summary":"{n} file(s), +{a} −{r}","diff.keys":"n / p: next and previous change \xb7 ] / [: next and previous file \xb7 Esc: close","diff.close":"Close","diff.loading":"reading…","diff.nothing":"The commit changed no file.","diff.files":"Changed files","diff.binaryShort":"binary","diff.added":"new file","diff.deleted":"deleted","diff.renamed":"renamed","diff.prevChange":"Previous change","diff.nextChange":"Next change","diff.changeN":"change {i} of {n}","diff.prevFile":"Previous file","diff.nextFile":"Next file","diff.whole":"Show the whole file","diff.wrap":"Wrap long lines","diff.binary":"A binary file: its contents are not shown.","diff.tooLarge":"Over 2 MB: too large to show here.","diff.eol":"The line endings changed ({from} → {to}); the lines themselves are compared without them.","diff.sameText":"The text is the same; only the file mode or the line endings changed.","diff.before":"Before","diff.after":"After","diff.gap":"⋯ {n} unchanged line(s) — show them","scroll.top":"To the top of the page","scroll.bottom":"To the bottom of the page","sys.profileBot":"In use by the bot's own run right now ({n} Edge process(es)). That is expected while a session runs.","lang.label":"Language","lang.menu":"The language of the interface","a11y.skip":"Skip to the content","theme.light":"Light","theme.dark":"Dark","status.queued":"queued","status.running":"running","status.waiting-approval":"waiting for approval","status.done":"done","status.blocked":"not done","status.failed":"failed","status.aborted":"aborted","status.limit-reached":"limit reached","session.unattendedConfirm":"This runs on its own: the commands Copilot writes will be executed without asking you, until the queue is finished. The list of forbidden commands still applies. Start it?","approval.title":"Step {n} is waiting for you","approval.modelTitle":"Choose the model — the bot could not","approval.manualTitle":"Choose the model for this run","approval.reviewModelTitle":"This is the model for the REVIEW","approval.reviewModelWhy":"A conversation of its own now checks the work. Choose a model different from the one the work was done with — a stronger one if you can: a second pair of eyes catches more mistakes when it does not think like the first.","approval.leadModelTitle":"This is the model for the LEAD","approval.leadModelWhy":"The lead understands the task, plans, directs the worker and judges what it reports: choose the strongest reasoning model you have.","approval.workerModelTitle":"This is the model for the WORKER","approval.workerModelWhy":"The worker runs the commands of each subtask and reports back: choose a model good at code and at following instructions.","approval.manualAsk":'In the Copilot window, open the model picker and choose "{model}". Then press "Ready — continue".',"approval.manualAskAny":'In the Copilot window, open the model picker and choose the model you want. Then press "Ready — continue".',"approval.manualReady":"Ready — continue","def.manualModel":"Choose the model by hand at the start of each run","def.manualModelWhy":'The bot leaves the model picker alone. At the start of a run, and of a review, a card appears here asking you to choose the model in the Copilot window and press "Ready"; the bot checks it and goes on. A conversation already on the model is not asked about — the chat keeps its model. On by default: turn it off to let the bot choose the model itself.',"approval.modelAsk":'In the Copilot window, open the model picker and choose "{model}". Then press the button below: the bot checks the picker and goes on.',"approval.modelShown":"The picker shows now: {shown}","approval.modelWhy":"Why the bot could not: {why} (asked {tries} time(s))","approval.modelChosen":"I chose it — check and continue","approval.modelAsItIs":"Continue on the model it is on","approval.modelStop":"Stop","approval.run":"Run","approval.runAll":"Run this and the rest without asking","approval.runAllWhy":"Answers this step with Run and stops asking for every step after it, for the rest of this run. Commands on the deny list are still refused, and a command that downloads from the internet does what Settings → Execution says (by default it still asks).","approval.runAllConfirm":"From here on, commands written by Copilot will run without asking, until this run ends. Commands on the deny list are still refused, and a command that downloads from the internet does what Settings → Execution says (by default it still asks). Continue?","approval.network":"This command downloads from the internet. A run that does not ask still stops for this one (unless Settings → Execution says otherwise), because a later step could run what arrived. Run it only if you know what it fetches and why.","approval.skip":"Skip","approval.abort":"Abort task","model.refresh":"Read the list from Copilot","model.refreshConfirm":"This opens the bot’s Edge window, reads the model picker and closes it again. It cannot run while a session is running. Continue?","model.refreshing":"opening the chat and reading the picker…","model.refreshed":"read {n} model(s) from the chat","model.readAt":"Read {t}: {n} option(s).","model.neverRead":"The list has never been read on this machine. Press the button to read it from the chat.","model.none":"The chat did not offer a model picker.","model.notInList":"{name} (saved, not in the list that was read)","model.unavailable":"not available","vcs.commit":"Commit when a task finishes","mirror.browse":"Browse…","checks.kind.exit-zero":"the command succeeds","sys.machine":"This machine","sys.loading":"Loading…","sys.version":"copilot-operator version","sys.node":"Node","sys.edge":"Edge","sys.edgeMissing":"not found","sys.profile":"Bot profile","sys.profileMissing":"(not created yet: run cop login)","sys.profileInUse":"Profile in use","sys.profileHeld":"Edge is holding the profile (pids {pids}). A run would fail. Close that Edge window.","sys.profileUnknown":"could not check","sys.profileFree":"free","sys.desktop":"Desktop","sys.desktopSynced":"(backed up by OneDrive)","sys.desktopLocal":"(not backed up by OneDrive; what is saved there stays local)","sys.cwd":"Fallback folder for commands (a session runs in its own project folder)","sys.runs":"Runs folder","sys.data":"Data folder","sys.mode":"Default mode","sys.settings":"Settings","sys.settingsHint":"Read from {file} next to the project. It has the same shape as {example}; anything missing takes the default. Edit the file and restart the API.","sys.asSaved":"As saved","sys.resolved":"Resolved paths","sys.signin":"Sign-in","sys.signinHint":"Signing in is done once, from the terminal, so that the bot never handles credentials:","ap.theme":"Theme","ap.size":"Text size","ap.sizeSmall":"Small","ap.sizeNormal":"Normal","ap.sizeLarge":"Large","ap.sizeHuge":"Larger","ap.sizeGiant":"Largest","ap.contrast":"Higher contrast","ap.motion":"Less motion","ap.links":"Underline every link","ap.focus":"Thick focus outline","ap.reset":"Back to the defaults","nav.defaults":"Settings","def.title":"Settings","def.intro":"The folders the chat works in, the sign-in to Copilot, the models, and how a task runs. Each field has an ⓘ beside its name that says what it is for and how it helps.","def.autoSave":"Everything on this page saves itself as you change it. There is nothing to press.","def.savedAutomatically":"saved as you type","def.saveAnyway":"Save","def.saveAnywayWhy":"It is already saved. This button exists for the comfort of pressing one.","info.about":"About “{name}”","l1.title":"The base prompt (level 1)","l1.readOnly":"read only","l1.what":"This text is for reading. It describes the agent Copilot becomes in the chat: it works through a task step by step with commands, reports what each one did, and takes every task to its end — done, or blocked with what it needs. It comes with the bot and changes only when the bot is updated. If something about the chat is unclear, Kerrigan (the button on the chat's home screen) can guide you through it until the task is done.","l1.show":"Show the whole text","l1.failed":"The base prompt could not be read: {reason}","proj.namePlaceholder":"the folder's own name","proj.nameSaved":"Name saved.","def.reviewTitle":"Model for the review","def.reviewIntro":'When Copilot says a task is done, a conversation of its own reviews the work, unless "Review" under the chat\'s box is unticked. It reads the changes, runs the checks and sends back what it finds.',"def.reviewInfo":"The model the review's conversation is put on. Best a different one from the work's, and a stronger one: a second pair of eyes catches more mistakes when it does not think like the first. With the model chosen by hand, the card that asks for it says it is the review's.","def.reviewField":"Review model","def.reviewNone":"None chosen here","def.reviewSaved":"The review will run on {name}.","def.reviewCleared":"Cleared: the review is not put on a model of its own.","def.reviewSame":"This is the same model as the one doing the work. A different one would catch more.","login.title":"Sign in to Copilot","login.intro":'The bot works in an Edge profile of its own, which has to be signed in to Microsoft 365 Copilot before the chat can work or the models can be read — what "cop login" does in a terminal. The window opens and you sign in there yourself; the bot never types a password. It closes when the chat appears.',"login.account":"Account (optional)","login.accountWhy":"Empty: whatever account you sign in with. With an address, the profile is signed out first and Microsoft is asked for that account, because Edge on a work machine otherwise signs in with whichever account Windows knows.","login.button":"Sign in to Copilot","login.busy":"Waiting for you to sign in…","login.waiting":"An Edge window has opened. Sign in there; this page waits until the chat appears.","def.modelTitle":"Model for new conversations","def.modelIntro":"The model a new chat conversation starts on, unless one is chosen under the chat's box.","def.modelInfo":'Chosen by the exact name Copilot\'s own picker shows, from the list read from it last ("Read the list from Copilot"); the list belongs to Microsoft and differs per tenant. A conversation that chose its own under the chat\'s box keeps it. With "Choose the model by hand at the start of each run" ticked, nothing is chosen for you: a card asks you to choose it in the Copilot window.',"def.modelField":"Model","def.modelNone":"Leave the chat on whatever it is set to","def.modelSaved":"New conversations will start on {name}.","def.modelCleared":"Cleared. New conversations leave the chat on whatever it is set to.","proj.title":"Projects","proj.intro":'The first project is the folder the chat works in; "Open a folder" on the chat\'s screen changes it too. The others are the rest of the repositories you work in. Kerrigan knows every one of them, with what you write in its level 2.',"proj.saved":"The chat works in {dir}.","proj.clear":"Clear","proj.cleared":"Cleared. No folder is open for the chat.","proj.none":"No folder is set for the chat: type one here or open one from the chat's screen.","proj.isRepo":"This folder is a git repository: each message can be undone, and its changes shown.","proj.notRepoWhy":'It can still be a project: the files are there and the chat can work in it. Without git, though, a message cannot be undone and its changes cannot be shown; "git init" in the folder fixes that.',"proj.isDefault":"the chat's folder","proj.isDefaultWhy":"The chat works in this one: its commands run here, and the explorer shows it.","proj.entryName":"Name","proj.entryDir":"Folder","proj.nameInfo":"What you call the project. Kerrigan and the lists use it. Left empty, it is the folder's own name.","proj.dirInfo":"The project's folder on this machine. For the first project, it is where the chat's commands run and what the explorer shows. Best a git repository: then each message can be undone and its changes shown.","proj.level2":"Level 2 template (for Kerrigan)","proj.level2Info":"Notes about this project, in your own words: what it is, its stack and versions, its conventions, how it is built and how its tests run, what must not be touched. They become part of Kerrigan: when you save or copy her, she knows this project and helps you write tasks that fit it. The bot sends them nowhere by itself. Up to {n} characters.","proj.level2Placeholder":"e.g. A .NET 8 web API with a React front end in /web. Build: dotnet build. Tests: dotnet test. Never edit the migrations in /db.","proj.level2Saved":"Level 2 of {name} saved: Kerrigan has it.","proj.level2Count":"{n} / {max} characters","proj.branch":"Branch: {name}","proj.detached":"No branch (a detached HEAD)","proj.branchInfo":"The branch checked out in this folder right now, read from git each time the page opens. The chat works on whatever is checked out and makes no branch of its own: switch it in git when you want the work elsewhere.","proj.addTitle":"Add another project","proj.othersIntro":"Another repository you work in — a front end, a back end, the tests — with a short name. Kerrigan knows it, with its level 2.","proj.otherAdd":"Add","proj.otherRemove":"Remove","proj.othersSaved":"Saved: {n} other project(s).","proj.otherRepo":"git repository","proj.otherNotRepo":"not a git repository","approval.tabTitle":"waiting for you","approval.waitingHere":"A step is waiting for your decision","approval.waitingHereWhy":"Shown on every page while a step waits, so a run never looks stuck because the page that asks is not the one open."}},9755:(e,t,o)=>{o.d(t,{Od:()=>s,Yj:()=>a,eX:()=>n});let a=[{code:"en",english:"English",native:"English",flag:"gb",dir:"ltr",dateLocale:"en-GB"},{code:"bg",english:"Bulgarian",native:"Български",flag:"bg",dir:"ltr",dateLocale:"bg-BG"},{code:"de",english:"German",native:"Deutsch",flag:"de",dir:"ltr",dateLocale:"de-DE"},{code:"es",english:"Spanish",native:"Espa\xf1ol",flag:"es",dir:"ltr",dateLocale:"es-ES"},{code:"fr",english:"French",native:"Fran\xe7ais",flag:"fr",dir:"ltr",dateLocale:"fr-FR"},{code:"pt",english:"Portuguese",native:"Portugu\xeas",flag:"pt",dir:"ltr",dateLocale:"pt-PT"},{code:"ja",english:"Japanese",native:"日本語",flag:"jp",dir:"ltr",dateLocale:"ja-JP"},{code:"ko",english:"Korean",native:"한국어",flag:"kr",dir:"ltr",dateLocale:"ko-KR"},{code:"ar",english:"Arabic",native:"العربية",flag:"sa",dir:"rtl",dateLocale:"ar"}],n=e=>a.find(t=>t.code===e);function s(e){var t,o,a;return null!=(a=null==(t=n(null!=(o=(null!=e?e:"").toLowerCase().split(/[-_]/)[0])?o:""))?void 0:t.code)?a:null}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[189],{1035:(e,t,l)=>{"use strict";l.d(t,{DialogHost:()=>c,Z:()=>d});var n=l(3365),a=l(1521),i=l(8205),r=l(4969);let o=null,s=[];function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(l=>{var n;return n={kind:"confirm",message:e,...t,resolve:l},void(o?o(n):s.push(n))})}function c(e){var t,l;let{children:d}=e,{t:c}=(0,i.kj)(),[u,m]=(0,a.useState)([]),h=(0,a.useRef)(null),v=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(o=e=>m(t=>[...t,e]),s.length>0){let e=s.splice(0,s.length);m(t=>[...t,...e])}return()=>{o=null}},[]);let x=u[0],p=(0,a.useCallback)(e=>{x&&(x.resolve(e),m(e=>e.slice(1)))},[x]);return(0,r.V)(v,!!x,h),(0,a.useEffect)(()=>{if(!x)return;let e=e=>{"Escape"===e.key&&(e.preventDefault(),p(!1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[x,p]),(0,n.jsxs)(n.Fragment,{children:[d,x&&(0,n.jsx)("div",{className:"modal-backdrop",onClick:()=>p(!1),role:"presentation",children:(0,n.jsxs)("div",{ref:v,className:"modal".concat(x.danger?" danger":""),role:"confirm"===x.kind?"alertdialog":"dialog","aria-modal":"true","aria-labelledby":"modal-title","aria-describedby":"modal-body",onClick:e=>e.stopPropagation(),children:[(0,n.jsx)("h2",{id:"modal-title",children:null!=(t=x.title)?t:c("confirm"===x.kind?"dialog.confirmTitle":"dialog.noticeTitle")}),(0,n.jsx)("div",{id:"modal-body",className:"modal-body",children:x.message}),(0,n.jsxs)("div",{className:"row modal-actions",children:["confirm"===x.kind&&(0,n.jsx)("button",{type:"button",className:"quiet",onClick:()=>p(!1),children:c("dialog.cancel")}),(0,n.jsx)("button",{ref:h,type:"button",className:x.danger?"danger":"primary",onClick:()=>p(!0),children:null!=(l=x.okLabel)?l:c("dialog.ok")})]})]})})]})}},1272:(e,t,l)=>{"use strict";l.d(t,{O:()=>a});var n=l(3365);function a(){return(0,n.jsxs)("svg",{className:"branch-ico",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[(0,n.jsx)("path",{d:"M4.5 3.5v9M4.5 10c0-3 7-2.5 7-5.5",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),(0,n.jsx)("circle",{cx:"4.5",cy:"3",r:"1.7",fill:"currentColor"}),(0,n.jsx)("circle",{cx:"4.5",cy:"13",r:"1.7",fill:"currentColor"}),(0,n.jsx)("circle",{cx:"11.5",cy:"4.2",r:"1.7",fill:"currentColor"})]})}},1896:(e,t,l)=>{Promise.resolve().then(l.bind(l,3197))},3197:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>u});var n=l(3365),a=l(1521),i=l(5549),r=l(8205),o=l(1035),s=l(4784),d=l(5462),c=l(1272);function u(){let{t:e}=(0,r.kj)(),[t,l]=(0,a.useState)(null),[s,d]=(0,a.useState)(!1),[c,u]=(0,a.useState)("");(0,a.useEffect)(()=>{i.FH.models().then(l).catch(()=>void 0)},[]);let m=async()=>{if(await (0,o.Z)(e("model.refreshConfirm"))){d(!0),u(e("model.refreshing"));try{var t;let n=await i.FH.models().then(()=>i.FH.refreshModels());l(n),u(0===n.options.length?null!=(t=n.note)?t:e("model.none"):e("model.refreshed",{n:n.options.length}))}catch(e){u(e.message)}finally{d(!1)}}},h={catalogue:t,setCatalogue:l,refreshModels:m,refreshing:s,refreshMsg:c};return(0,n.jsxs)("div",{className:"settings",children:[(0,n.jsxs)("div",{className:"panel",children:[(0,n.jsx)("h2",{children:e("def.title")}),(0,n.jsx)("p",{className:"muted small",children:e("def.intro")}),(0,n.jsx)("p",{className:"why",children:e("def.autoSave")})]}),(0,n.jsx)(j,{}),(0,n.jsx)(b,{}),(0,n.jsx)(y,{}),(0,n.jsx)(w,{...h}),(0,n.jsx)(N,{...h}),(0,n.jsx)(S,{})]})}function m(e){let{htmlFor:t,label:l,info:a,as:i="label"}=e,{t:o}=(0,r.kj)();return(0,n.jsxs)("div",{className:"field-label",children:["label"===i?(0,n.jsx)("label",{htmlFor:t,children:l}):(0,n.jsx)("span",{className:"field-name",children:l}),(0,n.jsx)(d.q,{label:o("info.about",{name:l}),text:a})]})}function h(e){let{id:t,label:l,info:a,unit:i,children:r}=e;return(0,n.jsxs)("div",{className:"settings-field",children:[(0,n.jsx)(m,{htmlFor:t,label:l,info:a}),(0,n.jsxs)("div",{className:"field-control",children:[r,i&&(0,n.jsx)("span",{className:"unit",children:i})]})]})}function v(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:900,l=(0,a.useRef)(null),n=(0,a.useRef)(null),i=(0,a.useRef)(e);return i.current=e,(0,a.useEffect)(()=>()=>{l.current&&clearTimeout(l.current),n.current&&i.current(n.current.value)},[]),e=>{l.current&&clearTimeout(l.current),n.current={value:e},l.current=setTimeout(()=>{n.current=null,i.current(e)},t)}}function x(e){let{id:t,value:l,min:i,max:r,onChange:o,disabled:s}=e,[d,c]=(0,a.useState)(String(l));return(0,a.useEffect)(()=>c(e=>p(e)===l?e:String(l)),[l]),(0,n.jsx)("input",{id:t,type:"number",className:"number",min:i,max:r,step:1,value:d,onChange:e=>{c(e.target.value);let t=p(e.target.value);null!==t&&t>=i&&t<=r&&o(t)},onBlur:()=>{let e=p(d),t=null===e?l:Math.max(i,Math.min(r,e));c(String(t)),t!==l&&o(t)},disabled:s})}function p(e){if(""===e.trim())return null;let t=Number(e);return Number.isInteger(t)?t:null}function f(e){let{msg:t,onSave:l}=e,{t:a}=(0,r.kj)();return(0,n.jsxs)("div",{className:"row saved-note",children:[l&&(0,n.jsx)("button",{className:"quiet",onClick:l,title:a("def.saveAnywayWhy"),children:a("def.saveAnyway")}),(0,n.jsx)("span",{className:"muted small",role:"status",children:t||a("def.savedAutomatically")})]})}function j(){let{t:e}=(0,r.kj)(),[t,l]=(0,a.useState)(null),[o,s]=(0,a.useState)("");return(0,a.useEffect)(()=>{i.FH.level1().then(e=>l(e.content)).catch(t=>s(e("l1.failed",{reason:t.message})))},[]),(0,n.jsxs)("section",{className:"panel",id:"level1","aria-labelledby":"level1-title",children:[(0,n.jsxs)("div",{className:"row section-title",children:[(0,n.jsx)("h2",{id:"level1-title",children:e("l1.title")}),(0,n.jsx)("span",{className:"badge",children:e("l1.readOnly")})]}),(0,n.jsx)("div",{className:"callout",role:"note",children:e("l1.what")}),o&&(0,n.jsx)("div",{className:"err",children:o}),(0,n.jsxs)("details",{className:"l1-text",children:[(0,n.jsx)("summary",{children:e("l1.show")}),(0,n.jsx)("pre",{className:"l1-pre",children:null!=t?t:"…"})]})]})}function b(){var e,t;let{t:l}=(0,r.kj)(),[o,s]=(0,a.useState)(null),[d,c]=(0,a.useState)(""),[u,h]=(0,a.useState)(""),[x,p]=(0,a.useState)(""),[j,b]=(0,a.useState)(""),[y,w]=(0,a.useState)(!1),[k,N]=(0,a.useState)(""),[S,C]=(0,a.useState)(""),R=(0,a.useCallback)(async()=>{try{let e=await i.FH.project();s(e),c(e.rootDir),h(e.name),b("")}catch(e){b(e.message)}},[]);(0,a.useEffect)(()=>{R()},[R]);let F=async(e,t)=>{w(!0),p("");try{let l=await i.FH.setProject(e);return s(l),c(l.rootDir),p(t(l)),b(""),!0}catch(e){return b(e.message),!1}finally{w(!1)}},M=e=>F({rootDir:e},e=>e.rootDir?l("proj.saved",{dir:e.rootDir}):l("proj.cleared")),E=e=>F({name:e},()=>l("proj.nameSaved")),D=v(M),I=v(E),L=async(e,t)=>{w(!0);try{var l;let n=await i.FH.browseFolder(t.trim()||void 0);n.ok?e(n.path):n.cancelled||b(null!=(l=n.reason)?l:"")}catch(e){b(e.message)}finally{w(!1)}},H=null!=(e=null==o?void 0:o.others)?e:[],A=e=>e.map(e=>({name:e.name,rootDir:e.rootDir,level2:e.level2})),W=(e,t,l)=>F({others:A(H.map(l=>l.name===e.name?{...l,...t}:l))},l),B=async()=>{await F({others:[...A(H),{name:k.trim(),rootDir:S.trim(),level2:""}]},e=>l("proj.othersSaved",{n:e.others.length}))&&(N(""),C(""))};return(0,n.jsxs)("section",{className:"panel",id:"project","aria-labelledby":"project-title",children:[(0,n.jsx)("h2",{id:"project-title",children:l("proj.title")}),(0,n.jsx)("p",{className:"muted small",children:l("proj.intro")}),j&&(0,n.jsx)("div",{className:"err",children:j}),(0,n.jsx)(g,{name:u,dir:d,repoOk:!!(null==o?void 0:o.repoOk),repoProblem:null==o?void 0:o.repoProblem,branch:null==o?void 0:o.branch,level2:null!=(t=null==o?void 0:o.level2)?t:"",isDefault:!0,busy:y,onNameInput:e=>{h(e),I(e)},onName:e=>void E(e),onDirInput:e=>{c(e),D(e)},onDir:e=>void M(e),onBrowse:()=>void L(e=>void M(e),d),onLevel2:e=>F({level2:e},()=>l("proj.level2Saved",{name:u||d})),onRemove:(null==o?void 0:o.rootDir)?()=>void M(""):void 0,removeLabel:l("proj.clear")}),o&&!o.rootDir&&(0,n.jsx)("p",{className:"muted small",children:l("proj.none")}),H.map((e,t)=>(0,n.jsx)(g,{name:e.name,dir:e.rootDir,repoOk:e.repoOk,repoProblem:e.repoProblem,branch:e.branch,level2:e.level2,busy:y,onName:t=>void W(e,{name:t},()=>l("proj.nameSaved")),onDir:t=>void W(e,{rootDir:t},()=>l("proj.othersSaved",{n:H.length})),onBrowse:()=>void L(t=>void W(e,{rootDir:t},()=>l("proj.othersSaved",{n:H.length})),e.rootDir),onLevel2:t=>W(e,{level2:t},()=>l("proj.level2Saved",{name:e.name})),onRemove:()=>{let t;t=e.name,F({others:A(H.filter(e=>e.name!==t))},e=>l("proj.othersSaved",{n:e.others.length}))},removeLabel:l("proj.otherRemove")},"other-".concat(t))),(0,n.jsx)(f,{msg:x}),(0,n.jsx)("h3",{id:"others",children:l("proj.addTitle")}),(0,n.jsx)("p",{className:"muted small",children:l("proj.othersIntro")}),(0,n.jsxs)("div",{className:"project-fields add-project",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(m,{htmlFor:"new-project-name",label:l("proj.entryName"),info:l("proj.nameInfo")}),(0,n.jsx)("input",{id:"new-project-name",type:"text",value:k,onChange:e=>N(e.target.value),placeholder:l("proj.entryName"),disabled:y})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(m,{htmlFor:"new-project-dir",label:l("proj.entryDir"),info:l("proj.dirInfo")}),(0,n.jsxs)("div",{className:"input-with-buttons",children:[(0,n.jsx)("input",{id:"new-project-dir",type:"text",value:S,onChange:e=>C(e.target.value),placeholder:"C:\\Projects\\my-app-tests",disabled:y}),(0,n.jsx)("button",{onClick:()=>void L(e=>C(e),S),disabled:y,children:l("mirror.browse")}),(0,n.jsx)("button",{className:"primary",onClick:()=>void B(),disabled:y||!k.trim()||!S.trim(),children:l("proj.otherAdd")})]})]})]})]})}function g(e){var t;let{name:l,dir:i,repoOk:o,repoProblem:s,branch:u,level2:h,isDefault:x=!1,busy:p,onNameInput:f,onName:j,onDirInput:b,onDir:g,onBrowse:y,onLevel2:w,onRemove:k,removeLabel:N}=e,{t:S}=(0,r.kj)(),C=(0,a.useId)(),[R,F]=(0,a.useState)(l),[M,E]=(0,a.useState)(i),[D,I]=(0,a.useState)(h),L=(0,a.useRef)(!1);(0,a.useEffect)(()=>F(l),[l]),(0,a.useEffect)(()=>E(i),[i]),(0,a.useEffect)(()=>{L.current||I(h)},[h]);let H=v(async e=>{L.current=!1,e!==h&&await w(e)},1200);return(0,n.jsxs)("div",{className:"panel inner project-entry",children:[(0,n.jsxs)("div",{className:"row project-tags",children:[x&&(0,n.jsx)("span",{className:"chip",title:S("proj.isDefaultWhy"),children:S("proj.isDefault")}),i&&(0,n.jsx)("span",{className:"badge ".concat(o?"done":""),title:o?S("proj.isRepo"):s,children:S(o?"proj.otherRepo":"proj.otherNotRepo")}),i&&o&&u&&(0,n.jsxs)("span",{className:"branch-tag",children:[(0,n.jsxs)("span",{className:"badge branch",children:[(0,n.jsx)(c.O,{})," ","HEAD"===u?S("proj.detached"):S("proj.branch",{name:u})]}),(0,n.jsx)(d.q,{label:S("info.about",{name:S("proj.branch",{name:u})}),text:S("proj.branchInfo")})]})]}),i&&!o&&(0,n.jsx)("p",{className:"muted small",children:s||S("proj.notRepoWhy")}),(0,n.jsxs)("div",{className:"project-fields",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(m,{htmlFor:"".concat(C,"-name"),label:S("proj.entryName"),info:S("proj.nameInfo")}),(0,n.jsx)("input",{id:"".concat(C,"-name"),type:"text",value:R,onChange:e=>{F(e.target.value),null==f||f(e.target.value)},onBlur:()=>{(R!==l||f)&&j(R)},placeholder:i?null!=(t=i.replace(/[\\/]+$/,"").split(/[\\/]/).pop())?t:"":S("proj.namePlaceholder")})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(m,{htmlFor:"".concat(C,"-dir"),label:S("proj.entryDir"),info:S("proj.dirInfo")}),(0,n.jsxs)("div",{className:"input-with-buttons",children:[(0,n.jsx)("input",{id:"".concat(C,"-dir"),type:"text",value:M,onChange:e=>{E(e.target.value),null==b||b(e.target.value)},onBlur:()=>{(M!==i||b)&&g(M)},placeholder:"C:\\Projects\\my-app"}),(0,n.jsx)("button",{onClick:y,disabled:p,children:S("mirror.browse")}),k&&(0,n.jsx)("button",{className:"quiet",onClick:k,disabled:p,children:N})]})]})]}),(0,n.jsxs)("div",{className:"project-level2",children:[(0,n.jsx)(m,{htmlFor:"".concat(C,"-level2"),label:S("proj.level2"),info:S("proj.level2Info",{n:8e3.toLocaleString()})}),(0,n.jsx)("textarea",{id:"".concat(C,"-level2"),className:"prose",rows:4,maxLength:8e3,value:D,onChange:e=>{L.current=!0,I(e.target.value),H(e.target.value)},placeholder:S("proj.level2Placeholder")}),(0,n.jsx)("span",{className:"muted small",children:S("proj.level2Count",{n:D.length.toLocaleString(),max:8e3.toLocaleString()})})]})]})}function y(){let{t:e}=(0,r.kj)(),[t,l]=(0,a.useState)(""),[o,s]=(0,a.useState)(!1),[d,c]=(0,a.useState)(""),[u,m]=(0,a.useState)(""),v=async()=>{s(!0),m(""),c(e("login.waiting"));try{let e=await i.FH.login(t);e.ok?c(e.message):(c(""),m(e.message))}catch(e){c(""),m(e.message)}finally{s(!1)}};return(0,n.jsxs)("section",{className:"panel",id:"login","aria-labelledby":"login-title",children:[(0,n.jsx)("h2",{id:"login-title",children:e("login.title")}),(0,n.jsx)("p",{className:"muted small",children:e("login.intro")}),u&&(0,n.jsx)("div",{className:"err",children:u}),(0,n.jsxs)(h,{id:"login-account",label:e("login.account"),info:e("login.accountWhy"),children:[(0,n.jsx)("input",{id:"login-account",type:"email",value:t,onChange:e=>l(e.target.value),placeholder:"name@company.com",disabled:o}),(0,n.jsx)("button",{className:"primary",onClick:()=>void v(),disabled:o,children:o?e("login.busy"):e("login.button")})]}),d&&(0,n.jsx)("div",{className:"small",role:"status",children:d})]})}function w(e){var t;let{catalogue:l,setCatalogue:o,refreshModels:d,refreshing:c,refreshMsg:u}=e,{t:m}=(0,r.kj)(),v=(0,r.W3)(),[x,p]=(0,a.useState)(""),[j,b]=(0,a.useState)(""),[g,y]=(0,a.useState)(!1),w=null!=(t=null==l?void 0:l.defaultModel)?t:"",N=async e=>{y(!0),p("");try{let t=await i.FH.setDefaultModel(e);l&&o({...l,defaultModel:t.defaultModel}),p(t.defaultModel?m("def.modelSaved",{name:t.defaultModel}):m("def.modelCleared")),b("")}catch(e){b(e.message)}finally{y(!1)}};return(0,n.jsxs)("section",{className:"panel",id:"model","aria-labelledby":"model-title",children:[(0,n.jsx)("h2",{id:"model-title",children:m("def.modelTitle")}),(0,n.jsx)("p",{className:"muted small",children:m("def.modelIntro")}),j&&(0,n.jsx)("div",{className:"err",children:j}),(0,n.jsxs)(h,{id:"default-model",label:m("def.modelField"),info:m("def.modelInfo"),children:[(0,n.jsx)(s.Yb,{id:"default-model",chosen:w,onChange:e=>void N(e),none:m("def.modelNone"),catalogue:l,disabled:g||c}),(0,n.jsx)("button",{className:"quiet",onClick:()=>void N(""),disabled:g||!w,children:m("proj.clear")}),(0,n.jsx)("button",{onClick:()=>void d(),disabled:g||c,children:m("model.refresh")})]}),(0,n.jsx)("p",{className:"muted small field-after",children:(null==l?void 0:l.readAt)?m("model.readAt",{t:v(l.readAt),n:l.options.length}):m("model.neverRead")}),(0,n.jsx)(k,{}),(0,n.jsx)(f,{msg:x||u})]})}function k(){let{t:e}=(0,r.kj)(),[t,l]=(0,a.useState)(null),[o,s]=(0,a.useState)("");(0,a.useEffect)(()=>{i.FH.settings().then(e=>{var t,n,a;let i=null==(t=e.raw.copilot)?void 0:t.manualModel,r=null==(a=e.defaults)||null==(n=a.copilot)?void 0:n.manualModel;l("boolean"==typeof i?i:!1!==r)}).catch(e=>s(e.message))},[]);let c=async e=>{l(e);try{var t;let l=await i.FH.settings();await i.FH.saveSettings({...l.raw,copilot:{...null!=(t=l.raw.copilot)?t:{},manualModel:e}}),s("")}catch(e){s(e.message)}};return(0,n.jsxs)("div",{className:"settings-field",children:[(0,n.jsxs)("div",{className:"field-label check-label",children:[(0,n.jsx)("input",{id:"manual-model",type:"checkbox",checked:!0===t,disabled:null===t,onChange:e=>void c(e.target.checked)}),(0,n.jsx)("label",{htmlFor:"manual-model",children:e("def.manualModel")}),(0,n.jsx)(d.q,{label:e("info.about",{name:e("def.manualModel")}),text:e("def.manualModelWhy")})]}),o&&(0,n.jsx)("div",{className:"err",children:o})]})}function N(e){var t,l;let{catalogue:o,setCatalogue:d,refreshModels:c,refreshing:u,refreshMsg:m}=e,{t:v}=(0,r.kj)(),[x,p]=(0,a.useState)(""),[j,b]=(0,a.useState)(""),[g,y]=(0,a.useState)(!1),w=null!=(t=null==o?void 0:o.defaultReviewModel)?t:"",k=async e=>{y(!0),p("");try{let t=await i.FH.setDefaultReviewModel(e);o&&d({...o,defaultReviewModel:t.defaultReviewModel}),p(t.defaultReviewModel?v("def.reviewSaved",{name:t.defaultReviewModel}):v("def.reviewCleared")),b("")}catch(e){b(e.message)}finally{y(!1)}},N=""!==w&&w===(null!=(l=null==o?void 0:o.defaultModel)?l:"");return(0,n.jsxs)("section",{className:"panel",id:"review","aria-labelledby":"review-title",children:[(0,n.jsx)("h2",{id:"review-title",children:v("def.reviewTitle")}),(0,n.jsx)("p",{className:"muted small",children:v("def.reviewIntro")}),j&&(0,n.jsx)("div",{className:"err",children:j}),(0,n.jsxs)(h,{id:"default-review-model",label:v("def.reviewField"),info:v("def.reviewInfo"),children:[(0,n.jsx)(s.Yb,{id:"default-review-model",chosen:w,onChange:e=>void k(e),none:v("def.reviewNone"),catalogue:o,disabled:g||u}),(0,n.jsx)("button",{className:"quiet",onClick:()=>void k(""),disabled:g||!w,children:v("proj.clear")}),(0,n.jsx)("button",{onClick:()=>void c(),disabled:g||u,children:v("model.refresh")})]}),N&&(0,n.jsx)("p",{className:"why field-after warned-text",children:v("def.reviewSame")}),(0,n.jsx)(f,{msg:x||m})]})}function S(){let{t:e}=(0,r.kj)(),[t,l]=(0,a.useState)(null),o=(0,a.useRef)(null),s=(0,a.useRef)(Promise.resolve()),[d,c]=(0,a.useState)(2),[u,m]=(0,a.useState)(3),[p,j]=(0,a.useState)(2),[b,g]=(0,a.useState)(2),[y,w]=(0,a.useState)(60),[k,N]=(0,a.useState)(240),[S,C]=(0,a.useState)(20),[R,F]=(0,a.useState)(900),[M,E]=(0,a.useState)("none"),[D,I]=(0,a.useState)("confirm"),[L,H]=(0,a.useState)("ask"),[A,W]=(0,a.useState)(""),[B,T]=(0,a.useState)("");(0,a.useEffect)(()=>{i.FH.settings().then(e=>{var t,n,a,i,r,s;o.current=e.raw,l(e.raw);let d=null!=(t=e.raw.limits)?t:{};m("number"==typeof d.autoContinue?d.autoContinue:3),c("number"==typeof d.retryBlockedInFreshChat?d.retryBlockedInFreshChat:2),j("number"==typeof d.minApproachesBeforeBlocked?d.minApproachesBeforeBlocked:2),g("number"==typeof d.maxReviewRounds?d.maxReviewRounds:2),w("number"==typeof d.maxIterations?d.maxIterations:60),N("number"==typeof d.maxRunMinutes?d.maxRunMinutes:240),C("number"==typeof d.maxSubtasks?d.maxSubtasks:20);let u=null!=(n=e.raw.copilot)?n:{};F("number"==typeof u.replyTimeoutSec?u.replyTimeoutSec:900);let h=null!=(a=e.raw.execution)?a:{};E(null!=(i=h.isolation)?i:"none"),I(null!=(r=h.mode)?r:"confirm"),H(null!=(s=h.networkFetch)?s:"ask")}).catch(e=>T(e.message))},[]);let P=(t,n,a)=>{let r=async()=>{var r;if(!o.current)return;let s=await i.FH.settings().then(e=>e.raw).catch(()=>o.current),d={...s,[t]:{...null!=(r=s[t])?r:{},[n]:a}};W("");try{await i.FH.saveSettings(d),o.current=d,l(d),W(e("exec.saved")),T("")}catch(e){T(e.message)}},d=s.current.then(r);return s.current=d.catch(()=>void 0),d},q=v(e=>P("limits","retryBlockedInFreshChat",e)),O=v(e=>P("limits","autoContinue",e)),U=v(e=>P("limits","minApproachesBeforeBlocked",e)),_=v(e=>P("limits","maxReviewRounds",e)),V=v(e=>P("limits","maxIterations",e)),Y=v(e=>P("limits","maxRunMinutes",e)),z=v(e=>P("limits","maxSubtasks",e)),K=v(e=>P("copilot","replyTimeoutSec",e)),Z=(e,t)=>P("execution",e,t),$=[{id:"auto-continue",label:e("exec.autoContinue"),info:e("exec.autoContinueWhy"),unit:e("exec.autoContinueUnit"),value:u,min:0,max:20,set:m,later:O},{id:"min-approaches",label:e("exec.minApproaches"),info:e("exec.minApproachesWhy"),unit:e("exec.minApproachesUnit"),value:p,min:2,max:20,set:j,later:U},{id:"max-review-rounds",label:e("exec.maxReviewRounds"),info:e("exec.maxReviewRoundsWhy"),unit:e("exec.maxReviewRoundsUnit"),value:b,min:1,max:6,set:g,later:_},{id:"retry-blocked",label:e("exec.retryBlocked"),info:e("exec.retryBlockedWhy"),unit:e("exec.retryBlockedTimes"),value:d,min:0,max:5,set:c,later:q},{id:"max-iterations",label:e("exec.maxIterations"),info:e("exec.maxIterationsWhy"),unit:e("exec.maxIterationsUnit"),value:y,min:5,max:200,set:w,later:V},{id:"max-minutes",label:e("exec.maxRunMinutes"),info:e("exec.maxRunMinutesWhy"),unit:e("exec.maxRunMinutesUnit"),value:k,min:10,max:1440,set:N,later:Y},{id:"max-subtasks",label:e("exec.maxSubtasks"),info:e("exec.maxSubtasksWhy"),unit:e("exec.maxSubtasksUnit"),value:S,min:1,max:100,set:C,later:z},{id:"reply-timeout",label:e("exec.replyTimeout"),info:e("exec.replyTimeoutWhy"),unit:e("exec.replyTimeoutUnit"),value:R,min:60,max:10800,set:F,later:K}];return(0,n.jsxs)("section",{className:"panel",id:"execution","aria-labelledby":"execution-title",children:[(0,n.jsx)("h2",{id:"execution-title",children:e("exec.title")}),(0,n.jsx)("p",{className:"muted small",children:e("exec.intro")}),B&&(0,n.jsx)("div",{className:"err",children:B}),$.map(e=>(0,n.jsx)(h,{id:e.id,label:e.label,info:e.info,unit:e.unit,children:(0,n.jsx)(x,{id:e.id,value:e.value,min:e.min,max:e.max,onChange:t=>{e.set(t),e.later(t)},disabled:!t})},e.id)),(0,n.jsx)(h,{id:"isolation",label:e("exec.isolation"),info:e("exec.isolationWhy"),children:(0,n.jsxs)("select",{id:"isolation",value:M,onChange:e=>{let t=e.target.value;E(t),Z("isolation",t)},disabled:!t,children:[(0,n.jsx)("option",{value:"none",children:e("exec.isolationNone")}),(0,n.jsx)("option",{value:"none-accepted",children:e("exec.isolationNoneAccepted")}),(0,n.jsx)("option",{value:"separate-account",children:e("exec.isolationAccount")}),(0,n.jsx)("option",{value:"sandbox",children:e("exec.isolationSandbox")}),(0,n.jsx)("option",{value:"vm",children:e("exec.isolationVm")})]})}),(0,n.jsx)(h,{id:"start-mode",label:e("exec.startMode"),info:e("exec.startModeWhy"),children:(0,n.jsxs)("select",{id:"start-mode",value:D,onChange:e=>{let t=e.target.value;I(t),Z("mode",t)},disabled:!t,children:[(0,n.jsx)("option",{value:"confirm",children:e("exec.startModeAsk")}),(0,n.jsx)("option",{value:"unattended",children:e("exec.startModeAuto")})]})}),(0,n.jsx)(h,{id:"network-fetch",label:e("exec.networkFetch"),info:e("exec.networkFetchWhy"),children:(0,n.jsxs)("select",{id:"network-fetch",value:L,onChange:e=>{let t=e.target.value;H(t),Z("networkFetch",t)},disabled:!t,children:[(0,n.jsx)("option",{value:"ask",children:e("exec.networkFetchAsk")}),(0,n.jsx)("option",{value:"refuse",children:e("exec.networkFetchRefuse")}),(0,n.jsx)("option",{value:"run",children:e("exec.networkFetchRun")})]})}),(0,n.jsx)(f,{msg:A})]})}},4784:(e,t,l)=>{"use strict";l.d(t,{Yb:()=>s,u:()=>o});var n=l(3365),a=l(1521),i=l(5549),r=l(8205);let o="::by-hand::";function s(e){var t,l,s;let{id:d,chosen:c,onChange:u,none:m,byHand:h,catalogue:v,disabled:x=!1,style:p}=e,{t:f}=(0,r.kj)(),j=function(e){let[t,l]=(0,a.useState)(null);return(0,a.useEffect)(()=>{if(void 0!==e)return;let t=!0;return i.FH.models().then(e=>{t&&l(e)}).catch(()=>void 0),()=>{t=!1}},[e]),void 0!==e?e:t}(v),b=null!=(t=null==j?void 0:j.options)?t:[],g=e=>e.toLowerCase().replace(/[-‐‑‒–—_]+/g," ").replace(/\s+/g," ").trim(),y=c&&c!==o?b.find(e=>g(e.name)===g(c)):void 0,w=null!=(l=null==y?void 0:y.name)?l:c,k=!!y||c===o&&void 0!==h,N=b.filter(e=>!e.group),S=new Map;for(let e of b)e.group&&S.set(e.group,[...null!=(s=S.get(e.group))?s:[],e]);return(0,n.jsxs)("select",{id:d,value:w,onChange:e=>u(e.target.value),disabled:x,style:{width:"auto",minWidth:280,...p},children:[void 0!==h&&(0,n.jsx)("option",{value:o,children:h}),void 0!==m&&(0,n.jsx)("option",{value:"",children:m}),c&&!k&&(0,n.jsx)("option",{value:c,children:f("model.notInList",{name:c})}),N.map(e=>(0,n.jsxs)("option",{value:e.name,disabled:e.disabled,children:[e.name,e.disabled?" — ".concat(f("model.unavailable")):""]},e.name)),[...S.entries()].map(e=>{let[t,l]=e;return(0,n.jsx)("optgroup",{label:t,children:l.map(e=>(0,n.jsxs)("option",{value:e.name,disabled:e.disabled,children:[e.name,e.disabled?" — ".concat(f("model.unavailable")):""]},e.name))},t)})]})}},4969:(e,t,l)=>{"use strict";l.d(t,{V:()=>i});var n=l(1521);let a='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function i(e,t,l){(0,n.useEffect)(()=>{var n,i;if(!t)return;let r=document.activeElement instanceof HTMLElement?document.activeElement:null,o=e.current,s=null!=(i=null!=(n=null==l?void 0:l.current)?n:null==o?void 0:o.querySelector(a))?i:null;null==s||s.focus();let d=e=>{if("Tab"!==e.key||!o)return;let t=Array.from(o.querySelectorAll(a)).filter(e=>null!==e.offsetParent);if(0===t.length)return;let l=t[0],n=t[t.length-1],i=o.contains(document.activeElement);e.shiftKey&&(document.activeElement===l||!i)?(e.preventDefault(),n.focus()):e.shiftKey||document.activeElement!==n&&i||(e.preventDefault(),l.focus())};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d),r&&document.contains(r)&&r.focus()}},[e,t,l])}},5462:(e,t,l)=>{"use strict";l.d(t,{f:()=>i,q:()=>r});var n=l(3365),a=l(1521);function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"below",[t,l]=(0,a.useState)(!1),n=(0,a.useRef)(null),i=(0,a.useRef)(null),r=(0,a.useId)(),[o,s]=(0,a.useState)({visibility:"hidden"}),d=(0,a.useCallback)(()=>l(!1),[]),c=(0,a.useCallback)(()=>l(e=>!e),[]);return(0,a.useLayoutEffect)(()=>{var l;let a,r;if(!t)return void s({visibility:"hidden"});let o=null==(l=n.current)?void 0:l.getBoundingClientRect(),d=i.current;if(!o||!d)return;let c=d.offsetWidth,u=d.offsetHeight;"right"===e?(a=o.right+6,r=Math.min(o.top,window.innerHeight-u-8)):(a=Math.min(o.left,window.innerWidth-c-8),r=o.bottom+6+u>window.innerHeight-8?o.top-6-u:o.bottom+6),s({left:Math.max(8,a),top:Math.max(8,r)})},[t,e]),(0,a.useEffect)(()=>{if(!t)return;let e=e=>{var t,a;let r=e.target;(null==(t=i.current)?void 0:t.contains(r))||(null==(a=n.current)?void 0:a.contains(r))||l(!1)},a=e=>{var t;"Escape"===e.key&&(l(!1),null==(t=n.current)||t.focus())},r=()=>l(!1);return document.addEventListener("pointerdown",e,!0),document.addEventListener("keydown",a),window.addEventListener("resize",r),()=>{document.removeEventListener("pointerdown",e,!0),document.removeEventListener("keydown",a),window.removeEventListener("resize",r)}},[t]),{open:t,setOpen:l,toggle:c,close:d,anchor:n,panel:i,style:o,id:r}}function r(e){let{label:t,text:l}=e,a=i("below");return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{ref:a.anchor,type:"button",className:"info-btn","aria-label":t,title:t,"aria-expanded":a.open,"aria-controls":a.open?a.id:void 0,onClick:a.toggle,children:"i"}),a.open&&(0,n.jsxs)("div",{ref:a.panel,id:a.id,role:"dialog","aria-label":t,className:"pop info-pop",style:a.style,children:[(0,n.jsx)("p",{className:"pop-title",children:t}),l.split(/\n\s*\n/).map(e=>(0,n.jsx)("p",{children:e},e))]})]})}}},e=>{e.O(0,[921,347,131,358],()=>e(e.s=1896)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{952:()=>{},4529:(e,t,s)=>{Promise.resolve().then(s.bind(s,1035)),Promise.resolve().then(s.t.bind(s,952,23)),Promise.resolve().then(s.bind(s,8214)),Promise.resolve().then(s.bind(s,7712)),Promise.resolve().then(s.bind(s,8300)),Promise.resolve().then(s.bind(s,8078)),Promise.resolve().then(s.bind(s,8205))},7712:(e,t,s)=>{"use strict";s.d(t,{ScrollJump:()=>a});var l=s(3365),n=s(1521),r=s(8205);function a(){let{t:e}=(0,r.kj)(),[t,s]=(0,n.useState)({long:!1,atTop:!0,atBottom:!1});return((0,n.useEffect)(()=>{let e=()=>{let e=document.documentElement;s({long:e.scrollHeight>2*window.innerHeight,atTop:window.scrollY<200,atBottom:window.innerHeight+window.scrollY>=e.scrollHeight-200})};e(),window.addEventListener("scroll",e,{passive:!0}),window.addEventListener("resize",e);let t=new ResizeObserver(e);return t.observe(document.body),()=>{window.removeEventListener("scroll",e),window.removeEventListener("resize",e),t.disconnect()}},[]),t.long)?(0,l.jsxs)("div",{className:"scroll-jump",children:[!t.atTop&&(0,l.jsx)("button",{type:"button","aria-label":e("scroll.top"),title:e("scroll.top"),onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),children:"↑"}),!t.atBottom&&(0,l.jsx)("button",{type:"button","aria-label":e("scroll.bottom"),title:e("scroll.bottom"),onClick:()=>window.scrollTo({top:document.documentElement.scrollHeight,behavior:"smooth"}),children:"↓"})]}):null}},8214:(e,t,s)=>{"use strict";s.d(t,{SkipLink:()=>v,s:()=>f});var l=s(3365),n=s(1521),r=s(8197),a=s.n(r),i=s(1702),o=s(5549),c=s(7527),d=s(8205),h=s(6575);let m={workbench:(0,l.jsx)("path",{d:"M4 5h16v11H9l-5 4zM8 9h8M8 12h5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round"}),defaults:(0,l.jsx)("path",{d:"M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zm8.5 4 1.5 1-1.6 2.8-1.8-.4a7 7 0 0 1-1.5 1.5l.4 1.8L14.7 21l-1-1.5a7 7 0 0 1-3.4 0l-1 1.5-2.8-1.6.4-1.8A7 7 0 0 1 5.4 16l-1.8.4L2 13.6 3.5 12.6V11.4L2 10.4l1.6-2.8 1.8.4A7 7 0 0 1 6.9 6.5l-.4-1.8L9.3 3l1 1.5a7 7 0 0 1 3.4 0l1-1.5 2.8 1.6-.4 1.8a7 7 0 0 1 1.5 1.5l1.8-.4L22 10.4l-1.5 1z"}),system:(0,l.jsx)("path",{d:"M4 5h16v10H4zM2 19h20M9 15v4M15 15v4",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round"})},u=[{href:"/",label:"nav.workbench",icon:"workbench"},{href:"/defaults",label:"nav.defaults",icon:"defaults"},{href:"/system",label:"nav.system",icon:"system"}];function v(){let{t:e}=(0,d.kj)();return(0,l.jsx)("a",{className:"skip-link",href:"#main",children:e("a11y.skip")})}function f(){let{t:e}=(0,d.kj)(),t=(0,i.usePathname)(),s=function(){let[e,t]=(0,n.useState)(0);return(0,c.z)(()=>o.FH.activity().then(e=>t(e.sessions)).catch(()=>void 0),4e3),e}();return(0,l.jsxs)("nav",{"aria-label":e("nav.label"),children:[u.map(n=>(0,l.jsxs)(a(),{href:n.href,"aria-current":t===n.href?"page":void 0,children:[(0,l.jsx)("svg",{className:"nav-icon",viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor","aria-hidden":"true",children:m[n.icon]}),(0,l.jsx)("span",{children:e(n.label)}),"/"===n.href&&s>0&&(0,l.jsxs)("span",{className:"live",title:e("nav.liveTitle",{n:s}),children:[(0,l.jsx)("span",{className:"dot","aria-hidden":"true"}),e("nav.live")]})]},n.href)),(0,l.jsx)(h.c,{})]})}},8300:(e,t,s)=>{"use strict";s.d(t,{Shell:()=>j});var l=s(3365),n=s(8197),r=s.n(n),a=s(1702),i=s(8214),o=s(6657),c=s(1521),d=s(5549),h=s(8205),m=s(7527);function u(e){var t,s;let{failure:n,reason:r,onDismiss:a,intro:i,children:o}=e,{t:c}=(0,h.kj)(),m=(0,h.W3)(),u=null!=(s=null!=(t=null==n?void 0:n.message)?t:r)?s:"";return(0,l.jsxs)("div",{className:"notice caution start-failure",role:"alert",style:{overflowWrap:"anywhere"},children:[i&&(0,l.jsx)("p",{className:"small",style:{marginTop:0},children:i}),(0,l.jsx)("strong",{children:c("startfail.title")}),n&&(0,l.jsx)("p",{className:"small",style:{margin:"4px 0"},children:c("startfail.where",{stage:c("startfail.stage.".concat(n.stage))})}),(0,l.jsx)("pre",{className:"sync-cmd small",style:{margin:"6px 0"},children:u}),o,n&&(0,l.jsxs)("p",{className:"muted small",style:{margin:"4px 0"},children:[n.runId?c("startfail.when",{when:m(n.at),run:n.runId}):c("startfail.whenNoRun",{when:m(n.at)}),n.sessions.length>0?" \xb7 ".concat(n.sessions.map(e=>'"'.concat(e,'"')).join(", ")):""]}),(0,l.jsxs)("div",{className:"row",style:{marginTop:6},children:[n&&(0,l.jsx)("a",{className:"button-link",href:d.FH.startFailureUrl(n.id),download:!0,children:c("startfail.download")}),(0,l.jsx)("a",{className:n?"button-link":"button-link plain",href:d.FH.terminalUrl(),download:!0,children:c("startfail.terminal")}),a&&(0,l.jsx)("button",{type:"button",className:"quiet",onClick:a,children:c("startfail.dismiss")})]}),(0,l.jsx)("p",{className:"why",children:c("startfail.downloadWhy")})]})}let v="cop.startFailure.dismissed";function f(){try{var e;let t=JSON.parse(null!=(e=window.localStorage.getItem(v))?e:"[]");return Array.isArray(t)?t.filter(e=>"string"==typeof e):[]}catch(e){return[]}}function w(){let{t:e}=(0,h.kj)(),[t,s]=(0,c.useState)([]),[n,r]=(0,c.useState)([]);(0,m.z)(()=>d.FH.startFailures(!0).then(e=>{s(e),r(f())}).catch(()=>void 0),5e3);let a=t.find(e=>!n.includes(e.id));return a?(0,l.jsx)("div",{style:{marginBottom:12},children:(0,l.jsx)(u,{failure:a,intro:e("at-turn"===a.stage?"startfail.laterSession":"startfail.later"),onDismiss:()=>{let e=[...new Set([...f(),a.id])].slice(-50);try{window.localStorage.setItem(v,JSON.stringify(e))}catch(e){}r(e)}})}):null}function j(e){let{children:t}=e;return"/"===(0,a.usePathname)()?(0,l.jsxs)("div",{className:"wb-root",children:[(0,l.jsx)(o.U,{}),(0,l.jsx)(w,{}),(0,l.jsx)("main",{id:"main",className:"wb-main",children:t})]}):(0,l.jsxs)("div",{className:"wrap",children:[(0,l.jsxs)("header",{className:"top",children:[(0,l.jsx)("h1",{children:(0,l.jsx)(r(),{href:"/",children:"copilot-operator"})}),(0,l.jsx)(i.s,{})]}),(0,l.jsx)(o.U,{}),(0,l.jsx)(w,{}),(0,l.jsx)("main",{id:"main",children:t})]})}}},e=>{e.O(0,[353,134,921,808,347,131,358],()=>e(e.s=4529)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[974],{1272:(e,t,l)=>{"use strict";l.d(t,{O:()=>s});var a=l(3365);function s(){return(0,a.jsxs)("svg",{className:"branch-ico",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[(0,a.jsx)("path",{d:"M4.5 3.5v9M4.5 10c0-3 7-2.5 7-5.5",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),(0,a.jsx)("circle",{cx:"4.5",cy:"3",r:"1.7",fill:"currentColor"}),(0,a.jsx)("circle",{cx:"4.5",cy:"13",r:"1.7",fill:"currentColor"}),(0,a.jsx)("circle",{cx:"11.5",cy:"4.2",r:"1.7",fill:"currentColor"})]})}},4784:(e,t,l)=>{"use strict";l.d(t,{Yb:()=>c,u:()=>r});var a=l(3365),s=l(1521),n=l(5549),i=l(8205);let r="::by-hand::";function c(e){var t,l,c;let{id:o,chosen:d,onChange:u,none:h,byHand:p,catalogue:m,disabled:f=!1,style:x}=e,{t:b}=(0,i.kj)(),w=function(e){let[t,l]=(0,s.useState)(null);return(0,s.useEffect)(()=>{if(void 0!==e)return;let t=!0;return n.FH.models().then(e=>{t&&l(e)}).catch(()=>void 0),()=>{t=!1}},[e]),void 0!==e?e:t}(m),v=null!=(t=null==w?void 0:w.options)?t:[],g=e=>e.toLowerCase().replace(/[-‐‑‒–—_]+/g," ").replace(/\s+/g," ").trim(),j=d&&d!==r?v.find(e=>g(e.name)===g(d)):void 0,y=null!=(l=null==j?void 0:j.name)?l:d,k=!!j||d===r&&void 0!==p,N=v.filter(e=>!e.group),C=new Map;for(let e of v)e.group&&C.set(e.group,[...null!=(c=C.get(e.group))?c:[],e]);return(0,a.jsxs)("select",{id:o,value:y,onChange:e=>u(e.target.value),disabled:f,style:{width:"auto",minWidth:280,...x},children:[void 0!==p&&(0,a.jsx)("option",{value:r,children:p}),void 0!==h&&(0,a.jsx)("option",{value:"",children:h}),d&&!k&&(0,a.jsx)("option",{value:d,children:b("model.notInList",{name:d})}),N.map(e=>(0,a.jsxs)("option",{value:e.name,disabled:e.disabled,children:[e.name,e.disabled?" — ".concat(b("model.unavailable")):""]},e.name)),[...C.entries()].map(e=>{let[t,l]=e;return(0,a.jsx)("optgroup",{label:t,children:l.map(e=>(0,a.jsxs)("option",{value:e.name,disabled:e.disabled,children:[e.name,e.disabled?" — ".concat(b("model.unavailable")):""]},e.name))},t)})]})}},5704:(e,t,l)=>{Promise.resolve().then(l.bind(l,9397))},9397:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>e2});var a=l(3365),s=l(1521),n=l(8197),i=l.n(n),r=l(5549),c=l(7527),o=l(8205),d=l(6575);let u=[{id:"plain",name:"Plain text"},{id:"typescript",name:"TypeScript"},{id:"javascript",name:"JavaScript"},{id:"json",name:"JSON"},{id:"html",name:"HTML"},{id:"xml",name:"XML"},{id:"css",name:"CSS"},{id:"scss",name:"SCSS"},{id:"markdown",name:"Markdown"},{id:"powershell",name:"PowerShell"},{id:"batch",name:"Batch (cmd)"},{id:"shell",name:"Shell"},{id:"python",name:"Python"},{id:"csharp",name:"C#"},{id:"java",name:"Java"},{id:"kotlin",name:"Kotlin"},{id:"go",name:"Go"},{id:"rust",name:"Rust"},{id:"c",name:"C"},{id:"cpp",name:"C++"},{id:"swift",name:"Swift"},{id:"dart",name:"Dart"},{id:"php",name:"PHP"},{id:"ruby",name:"Ruby"},{id:"lua",name:"Lua"},{id:"sql",name:"SQL"},{id:"yaml",name:"YAML"},{id:"toml",name:"TOML"},{id:"ini",name:"INI / config"},{id:"dockerfile",name:"Dockerfile"},{id:"makefile",name:"Makefile"},{id:"vue",name:"Vue"}],h={ts:"typescript",tsx:"typescript",mts:"typescript",cts:"typescript",js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",json:"json",jsonc:"json",json5:"json",webmanifest:"json",har:"json",css:"css",scss:"scss",sass:"scss",less:"scss",html:"html",htm:"html",xhtml:"html",svelte:"html",vue:"vue",xml:"xml",svg:"xml",xsd:"xml",xsl:"xml",csproj:"xml",props:"xml",targets:"xml",config:"xml",resx:"xml",plist:"xml",vbproj:"xml",fsproj:"xml",nuspec:"xml",md:"markdown",markdown:"markdown",mdx:"markdown",ps1:"powershell",psm1:"powershell",psd1:"powershell",bat:"batch",cmd:"batch",sh:"shell",bash:"shell",zsh:"shell",py:"python",pyw:"python",pyi:"python",cs:"csharp",csx:"csharp",java:"java",kt:"kotlin",kts:"kotlin",gradle:"kotlin",go:"go",rs:"rust",c:"c",h:"c",cpp:"cpp",cc:"cpp",cxx:"cpp",hpp:"cpp",hh:"cpp",hxx:"cpp",swift:"swift",dart:"dart",php:"php",rb:"ruby",lua:"lua",sql:"sql",yml:"yaml",yaml:"yaml",toml:"toml",ini:"ini",cfg:"ini",conf:"ini",properties:"ini",env:"ini",editorconfig:"ini",gitconfig:"ini",npmrc:"ini",dockerfile:"dockerfile",mk:"makefile"},p={dockerfile:"dockerfile",containerfile:"dockerfile",makefile:"makefile",gnumakefile:"makefile",".gitignore":"shell",".gitattributes":"shell",".dockerignore":"shell",".npmignore":"shell",".prettierignore":"shell",".eslintignore":"shell",".env":"ini",".editorconfig":"ini",".npmrc":"ini",".gitconfig":"ini",".babelrc":"json",".prettierrc":"json",".eslintrc":"json","tsconfig.json":"json","package.json":"json",gemfile:"ruby",rakefile:"ruby",jenkinsfile:"java"};function m(e){var t;let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=e.split("/").pop().toLowerCase();if(p[a])return p[a];if(a.startsWith(".env."))return"ini";if(a.startsWith("dockerfile."))return"dockerfile";let s=a.lastIndexOf(".");if(s>0&&h[a.slice(s+1)])return h[a.slice(s+1)];let n=null!=(t=l.slice(0,200).split(/\r?\n/)[0])?t:"",i=/^#!.*\b(python\d?|node|deno|bun|bash|sh|zsh|pwsh|powershell|ruby|php|lua)\b/.exec(n);if(i){let e=i[1];return e.startsWith("python")?"python":"node"===e||"deno"===e||"bun"===e?"javascript":"pwsh"===e||"powershell"===e?"powershell":"ruby"===e?"ruby":"php"===e?"php":"lua"===e?"lua":"shell"}let r=l.trimStart().slice(0,100);if(/^<\?xml\b/.test(r))return"xml";if(/^<!doctype html|^<html\b/i.test(r))return"html";if(/^[{[]/.test(r))try{return JSON.parse(l),"json"}catch(e){}return"plain"}let f=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),x=(e,t)=>'<span class="hl-'.concat(e,'">').concat(f(t),"</span>"),b=e=>new Set(e.split(/\s+/).filter(Boolean)),w=b("break case catch class const continue debugger default delete do else export extends finally for from function if import in instanceof let new of return super switch this throw try typeof var void while with yield async await static get set as satisfies"),v=new Set([...w,...b("interface type enum implements namespace module declare abstract private protected public readonly keyof infer is asserts override accessor unique")]),g=b("string number boolean bigint symbol object unknown any never void undefined Record Partial Required Readonly Pick Omit Promise Array Map Set Date Error RegExp"),j=b("true false null undefined NaN Infinity"),y={typescript:{line:["//"],block:[["/*","*/"]],quotes:['"',"'","`"],multiline:["`"],keywords:v,types:g,literals:j,calls:!0,sigil:/^@[A-Za-z_]\w*/},javascript:{line:["//"],block:[["/*","*/"]],quotes:['"',"'","`"],multiline:["`"],keywords:w,literals:j,calls:!0},csharp:{line:["//"],block:[["/*","*/"]],quotes:['"',"'"],calls:!0,literals:b("true false null"),keywords:b("abstract as base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual volatile while async await var record init required get set value where yield partial"),types:b("bool byte char decimal double float int long object sbyte short string uint ulong ushort void dynamic Task List Dictionary")},java:{line:["//"],block:[["/*","*/"]],quotes:['"',"'"],calls:!0,literals:b("true false null"),keywords:b("abstract assert break case catch class const continue default do else enum extends final finally for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while var record sealed permits yield"),types:b("boolean byte char double float int long short void String Object List Map Integer"),sigil:/^@[A-Za-z_]\w*/},kotlin:{line:["//"],block:[["/*","*/"]],quotes:['"',"'"],calls:!0,literals:b("true false null"),keywords:b("as break class continue do else for fun if in interface is object package return super this throw try typealias typeof val var when while by catch constructor delegate dynamic field file finally get import init param property receiver set setparam where actual abstract annotation companion const crossinline data enum expect external final infix inline inner internal lateinit noinline open operator out override private protected public reified sealed suspend tailrec vararg"),types:b("Int Long Short Byte Double Float Boolean Char String Unit Any Nothing List Map Set"),sigil:/^@[A-Za-z_]\w*/},go:{line:["//"],block:[["/*","*/"]],quotes:['"',"'","`"],multiline:["`"],calls:!0,literals:b("true false nil iota"),keywords:b("break case chan const continue default defer else fallthrough for func go goto if import interface map package range return select struct switch type var"),types:b("bool byte complex64 complex128 error float32 float64 int int8 int16 int32 int64 rune string uint uint8 uint16 uint32 uint64 uintptr any")},rust:{line:["//"],block:[["/*","*/"]],quotes:['"'],calls:!0,literals:b("true false None Some Ok Err"),keywords:b("as async await break const continue crate dyn else enum extern fn for if impl in let loop match mod move mut pub ref return self Self static struct super trait type unsafe use where while"),types:b("bool char f32 f64 i8 i16 i32 i64 i128 isize str u8 u16 u32 u64 u128 usize String Vec Option Result Box"),sigil:/^#!?\[[^\]]*\]/},c:{line:["//"],block:[["/*","*/"]],quotes:['"',"'"],calls:!0,literals:b("true false NULL"),keywords:b("auto break case const continue default do else enum extern for goto if inline register restrict return sizeof static struct switch typedef union volatile while"),types:b("char double float int long short signed unsigned void size_t bool"),sigil:/^#\s*\w+/},cpp:{line:["//"],block:[["/*","*/"]],quotes:['"',"'"],calls:!0,literals:b("true false nullptr NULL"),keywords:b("alignas alignof and asm auto break case catch class const constexpr const_cast continue decltype default delete do dynamic_cast else enum explicit export extern for friend goto if inline mutable namespace new noexcept not operator or private protected public register reinterpret_cast return sizeof static static_assert static_cast struct switch template this thread_local throw try typedef typeid typename union using virtual volatile while override final concept requires co_await co_return co_yield"),types:b("bool char double float int long short signed unsigned void wchar_t size_t string vector map std"),sigil:/^#\s*\w+/},swift:{line:["//"],block:[["/*","*/"]],quotes:['"'],calls:!0,literals:b("true false nil"),keywords:b("associatedtype class deinit enum extension fileprivate func import init inout internal let open operator private protocol public rethrows static struct subscript typealias var break case continue default defer do else fallthrough for guard if in repeat return switch where while as catch is self Self super throw throws try async await some any"),types:b("Int Double Float Bool String Character Array Dictionary Set Optional Void"),sigil:/^@[A-Za-z_]\w*/},dart:{line:["//"],block:[["/*","*/"]],quotes:['"',"'"],calls:!0,literals:b("true false null"),keywords:b("abstract as assert async await break case catch class const continue covariant default deferred do dynamic else enum export extends extension external factory final finally for get hide if implements import in interface is late library mixin new on operator part required rethrow return set show static super switch sync this throw try typedef var void while with yield"),types:b("int double num bool String List Map Set Future Stream Object"),sigil:/^@[A-Za-z_]\w*/},php:{line:["//","#"],block:[["/*","*/"]],quotes:['"',"'"],calls:!0,caseless:!0,literals:b("true false null"),keywords:b("abstract and array as break callable case catch class clone const continue declare default do echo else elseif empty enddeclare endfor endforeach endif endswitch endwhile enum extends final finally fn for foreach function global goto if implements include include_once instanceof insteadof interface isset list match namespace new or print private protected public readonly require require_once return static switch throw trait try unset use var while xor yield"),sigil:/^\$[A-Za-z_]\w*/},lua:{line:["--"],block:[["--[[","]]"]],quotes:['"',"'"],calls:!0,literals:b("true false nil"),keywords:b("and break do else elseif end for function goto if in local not or repeat return then until while")},powershell:{line:["#"],block:[["<#","#>"]],quotes:['"',"'"],multiline:['"',"'"],caseless:!0,calls:!1,literals:b("$true $false $null"),keywords:b("begin break catch class continue data define do dynamicparam else elseif end enum exit filter finally for foreach from function hidden if in inlinescript param process return sequence static switch throw trap try until using var while workflow -and -or -not -xor -eq -ne -gt -ge -lt -le -like -notlike -match -notmatch -contains -notcontains -in -notin -replace -split -join -is -isnot -as -band -bor -f"),sigil:/^\$(?:\{[^}]*\}|[A-Za-z_][\w:]*|[?^$_])/},python:{line:["#"],quotes:['"""',"'''",'"',"'"],multiline:['"""',"'''"],calls:!0,literals:b("True False None"),keywords:b("and as assert async await break class continue def del elif else except finally for from global if import in is lambda nonlocal not or pass raise return try while with yield match case"),types:b("int float str bool list dict set tuple bytes object type self cls"),sigil:/^@[A-Za-z_][\w.]*/},ruby:{line:["#"],block:[["=begin","=end"]],quotes:['"',"'"],calls:!0,literals:b("true false nil"),keywords:b("alias and begin break case class def defined? do else elsif end ensure for if in module next not or redo rescue retry return self super then undef unless until when while yield require require_relative attr_accessor attr_reader attr_writer"),sigil:/^(?:@@?|\$)[A-Za-z_]\w*|^:[A-Za-z_]\w*/},shell:{line:["#"],quotes:['"',"'"],multiline:['"',"'"],literals:b("true false"),keywords:b("if then else elif fi case esac for select while until do done in function time coproc return exit export local readonly declare unset shift source alias echo cd"),sigil:/^\$(?:\{[^}]*\}|[A-Za-z_]\w*|[0-9@#?$!*-])/},batch:{line:["REM ","rem ","::"],quotes:['"'],caseless:!0,keywords:b("call cd chdir cls copy del dir echo else endlocal errorlevel exist exit for goto if in md mkdir move not off on pause popd pushd rd rem ren rmdir set setlocal shift start title type"),sigil:/^%[^%\s]+%|^%%?[A-Za-z0-9~]/},dockerfile:{line:["#"],quotes:['"',"'"],caseless:!0,keywords:b("from as run cmd label maintainer expose env add copy entrypoint volume user workdir arg onbuild stopsignal healthcheck shell"),sigil:/^\$(?:\{[^}]*\}|[A-Za-z_]\w*)/},makefile:{line:["#"],quotes:['"',"'"],keywords:b("ifeq ifneq ifdef ifndef else endif include define endef export override .PHONY"),sigil:/^\$(?:\([^)]*\)|\{[^}]*\}|[@<^*?%])/},sql:{line:["--"],block:[["/*","*/"]],quotes:["'",'"'],caseless:!0,calls:!0,literals:b("true false null"),keywords:b("select from where and or not insert into values update set delete create table view index drop alter add column primary key foreign references join left right inner outer full on as group by order having limit offset union all distinct case when then else end exists in is like between with returning begin commit rollback transaction grant revoke default constraint unique check if replace truncate procedure function trigger declare"),types:b("int integer bigint smallint decimal numeric float real double varchar char text date time timestamp boolean bool uuid json jsonb blob")}};function k(e,t){let l="",a=0,s=e.length,n=l=>t.caseless?e.substr(a,l.length).toLowerCase()===l.toLowerCase():e.startsWith(l,a),i=[...t.quotes].sort((e,t)=>t.length-e.length);for(;a<s;){var r,c,o,d,u,h,p;let m=e[a],b=null==(r=t.block)?void 0:r.find(e=>{let[t]=e;return n(t)});if(b){let t=e.indexOf(b[1],a+b[0].length),n=t<0?s:t+b[1].length;l+=x("com",e.slice(a,n)),a=n;continue}if(null==(c=t.line)?void 0:c.find(e=>n(e))){let t=e.indexOf("\n",a),n=t<0?s:t;l+=x("com",e.slice(a,n)),a=n;continue}let w=i.find(t=>e.startsWith(t,a));if(w){let n=a+w.length,i=null==(o=t.multiline)?void 0:o.includes(w),r=t!==y.powershell&&t!==y.batch&&(t!==y.shell&&t!==y.sql||"'"!==w);for(;n<s;){if("\\"===e[n]&&r){n+=2;continue}if(e.startsWith(w,n)){n+=w.length;break}if("\n"===e[n]&&!i)break;n+=1}l+=x("str",e.slice(a,Math.min(n,s))),a=Math.min(n,s);continue}if(t.sigil&&/[$@#%:[]/.test(m)){let s=t.sigil.exec(e.slice(a,a+200));if(s){let e=s[0];l+=x("@"===m||"#"===m||"["===m?"meta":"var",e),a+=e.length;continue}}if(/[0-9]/.test(m)||"."===m&&/[0-9]/.test(null!=(d=e[a+1])?d:"")){let t=null!=(u=e[a-1])?u:"";if(!/[\w$]/.test(t)){let t=/^(?:0[xX][\da-fA-F_]+|0[bB][01_]+|0[oO][0-7_]+|(?:\d[\d_]*\.?\d*|\.\d+)(?:[eE][+-]?\d+)?)[a-zA-Z]*/.exec(e.slice(a,a+64));if(t){l+=x("num",t[0]),a+=t[0].length;continue}}}if(/[A-Za-z_$-]/.test(m)){let s=/^-?[A-Za-z_$][\w$-]*\??/.exec(e.slice(a,a+120));if(s&&!(s[0].startsWith("-")&&!t.caseless)){let n=s[0];t!==y.powershell&&n.includes("-")&&(n=n.split("-")[0]||n.slice(0,1)),n||(n=m);let i=t.caseless?n.toLowerCase():n,r=(null==(h=t.literals)?void 0:h.has(i))?"lit":t.keywords.has(i)?"kw":(null==(p=t.types)?void 0:p.has(i))?"type":null;r?l+=x(r,n):t.calls&&"("===e[a+n.length]?l+=x("fn",n):/^[A-Z][a-z]\w*$/.test(n)&&t.types?l+=x("type",n):t===y.powershell&&/^[A-Z][a-z]+-[A-Z]\w*$/.test(n)?l+=x("fn",n):l+=f(n),a+=n.length;continue}}l+=f(m),a+=1}return l}function N(e,t){let l="",a=0,s=e.length;for(;a<s;){if(e.startsWith("\x3c!--",a)){let t=e.indexOf("--\x3e",a+4),n=t<0?s:t+3;l+=x("com",e.slice(a,n)),a=n;continue}if(e.startsWith("<![CDATA[",a)){let t=e.indexOf("]]>",a),n=t<0?s:t+3;l+=x("str",e.slice(a,n)),a=n;continue}let n=/^<\/?[A-Za-z!?][\w:.-]*/.exec(e.slice(a,a+100));if(n){let i=n[0];for(l+=x(i.startsWith("<!")||i.startsWith("<?")?"meta":"tag",i),a+=i.length;a<s&&">"!==e[a];){let t=/^[\s/?]+/.exec(e.slice(a,a+50));if(t){l+=f(t[0]),a+=t[0].length;continue}if('"'===e[a]||"'"===e[a]){let t=e.indexOf(e[a],a+1),n=t<0?s:t+1;l+=x("str",e.slice(a,n)),a=n;continue}let n=/^[^\s=>/"']+/.exec(e.slice(a,a+100));if(n){l+=x("attr",n[0]),a+=n[0].length;continue}l+=f(e[a]),a+=1}a<s&&(l+=x("tag",">"),a+=1);let r=i.toLowerCase();if(t&&("<script"===r||"<style"===r)){let t="<script"===r?"</script":"</style",n=e.toLowerCase().indexOf(t,a),i=n<0?s:n,c=e.slice(a,i);l+="<script"===r?k(c,y.javascript):C(c,!1),a=i}continue}if("&"===e[a]){let t=/^&[#\w]+;/.exec(e.slice(a,a+12));if(t){l+=x("lit",t[0]),a+=t[0].length;continue}}let i=e.indexOf("<",a+1),r=e.indexOf("&",a+1),c=Math.min(i<0?s:i,r<0?s:r);l+=f(e.slice(a,c)),a=c}return l}function C(e,t){let l="",a=0,s=e.length,n=0,i=!1;for(;a<s;){var r;let c=e[a];if(e.startsWith("/*",a)){let t=e.indexOf("*/",a+2),n=t<0?s:t+2;l+=x("com",e.slice(a,n)),a=n;continue}if(t&&e.startsWith("//",a)){let t=e.indexOf("\n",a),n=t<0?s:t;l+=x("com",e.slice(a,n)),a=n;continue}if('"'===c||"'"===c){let t=a+1;for(;t<s&&e[t]!==c&&"\n"!==e[t];)t+="\\"===e[t]?2:1;l+=x("str",e.slice(a,t+1)),a=t+1;continue}if("@"===c){let t=/^@[\w-]+/.exec(e.slice(a,a+40));if(t){l+=x("kw",t[0]),a+=t[0].length;continue}}if("$"===c&&t){let t=/^\$[\w-]+/.exec(e.slice(a,a+60));if(t){l+=x("var",t[0]),a+=t[0].length;continue}}if("{"===c&&(n+=1),"}"===c&&(n=Math.max(0,n-1),i=!1),";"===c&&(i=!1),":"===c&&n>0){l+=f(c),a+=1,i=!0;continue}if("#"===c&&i){let t=/^#[\da-fA-F]{3,8}\b/.exec(e.slice(a,a+12));if(t){l+=x("num",t[0]),a+=t[0].length;continue}}if(/[\d.]/.test(c)&&i&&!/[\w-]/.test(null!=(r=e[a-1])?r:"")){let t=/^-?(?:\d+\.?\d*|\.\d+)(?:%|[a-zA-Z]+)?/.exec(e.slice(a,a+20));if(t){l+=x("num",t[0]),a+=t[0].length;continue}}if(/[A-Za-z_-]/.test(c)){let t=/^-?-?[A-Za-z_][\w-]*/.exec(e.slice(a,a+80));if(t){let s=t[0];l+=n>0&&!i&&/^\s*:/.test(e.slice(a+s.length,a+s.length+10))?x("prop",s):i?/^(important|inherit|initial|unset|none|auto)$/.test(s)?x("lit",s):"("===e[a+s.length]?x("fn",s):f(s):x("tag",s),a+=s.length;continue}}l+=f(c),a+=1}return l}function S(e,t){switch(t){case"plain":return f(e);case"json":return e.replace(/("(?:[^"\\\n]|\\.)*")(\s*:)?|\/\/[^\n]*|\/\*[\s\S]*?\*\/|\b(true|false|null)\b|-?\b\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b|[&<>]/g,(e,t,l,a)=>void 0!==t?l?x("prop",t)+f(l):x("str",t):e.startsWith("//")||e.startsWith("/*")?x("com",e):a?x("lit",e):/^[&<>]$/.test(e)?f(e):x("num",e));case"html":case"vue":return N(e,!0);case"xml":return N(e,!1);case"css":return C(e,!1);case"scss":return C(e,!0);case"yaml":return e.split("\n").map(e=>{let t=/^(\s*(?:- )?)([^#:'"\n][^:#\n]*?)(:)(\s|$)(.*)$/.exec(e),l=e=>e.replace(/(#.*$)|("(?:[^"\\]|\\.)*"|'[^']*')|(\b(?:true|false|null|yes|no|on|off|~)\b)|(-?\b\d+(?:\.\d+)?\b)|([&*][\w-]+)|([&<>])/gi,(e,t,l,a,s,n,i)=>t?x("com",t):l?x("str",l):a?x("lit",a):s?x("num",s):n?x("var",n):i?f(i):f(e));return/^\s*#/.test(e)?x("com",e):/^\s*---|^\s*\.\.\./.test(e)?x("meta",e):t?f(t[1])+x("prop",t[2])+f(t[3])+f(t[4])+l(t[5]):l(e)}).join("\n");case"ini":case"toml":return e.split("\n").map(e=>{if(/^\s*[#;]/.test(e))return x("com",e);let t=/^(\s*)(\[\[?[^\]]*\]\]?)(.*)$/.exec(e);if(t)return f(t[1])+x("head",t[2])+f(t[3]);let l=/^(\s*)([^=:\s][^=:]*?)(\s*[=:]\s*)(.*)$/.exec(e);if(l){let e=l[4],t=/^(".*"|'.*')$/.test(e.trim())?x("str",e):/^-?\d+(\.\d+)?$/.test(e.trim())?x("num",e):/^(true|false|yes|no|on|off)$/i.test(e.trim())?x("lit",e):f(e);return f(l[1])+x("prop",l[2])+f(l[3])+t}return f(e)}).join("\n");case"markdown":return function(e){let t=e.split("\n"),l=[],a=null;for(let e of t){if(a){e.trimStart().startsWith(a.mark)?(l.push(a.body.length?S(a.body.join("\n"),a.lang):""),l.push(x("code",e)),a=null):a.body.push(e);continue}let t=/^(\s*)(```+|~~~+)\s*([\w+#-]*)/.exec(e);if(t){var s,n,i;let r=t[3]?null!=(i=h[t[3].toLowerCase()])?i:null!=(n=null==(s=u.find(e=>e.name.toLowerCase()===t[3].toLowerCase()))?void 0:s.id)?n:"plain":"plain";a={mark:t[2],lang:r,body:[]},l.push(x("code",e));continue}if(/^\s{0,3}#{1,6}\s/.test(e)){l.push(x("head",e));continue}if(/^\s*>/.test(e)){l.push(x("com",e));continue}let r=f(e);r=r.replace(/^(\s*)([-*+]|\d+[.)])(\s)/,(e,t,l,a)=>"".concat(t,'<span class="hl-kw">').concat(l,"</span>").concat(a)).replace(/(`+)([^`]+?)\1/g,e=>'<span class="hl-code">'.concat(e,"</span>")).replace(RegExp("(\\*\\*|__)(?=\\S)(.+?)(?<=\\S)\\1","g"),e=>'<span class="hl-head">'.concat(e,"</span>")).replace(RegExp("(^|[^*\\w])(\\*|_)(?=\\S)(.+?)(?<=\\S)\\2(?!\\w)","g"),(e,t,l,a)=>"".concat(t,'<span class="hl-em">').concat(l).concat(a).concat(l,"</span>")).replace(/(!?\[[^\]]*\])(\([^)]*\))/g,(e,t,l)=>'<span class="hl-str">'.concat(t,'</span><span class="hl-link">').concat(l,"</span>")),l.push(r)}return a&&l.push(S(a.body.join("\n"),a.lang)),l.join("\n")}(e);default:{let l=y[t];return l?k(e,l):f(e)}}}let F={typescript:{text:"TS",color:"#3178c6"},javascript:{text:"JS",color:"#b89a00"},json:{text:"{}",color:"#c48c12"},html:{text:"<>",color:"#e34c26"},xml:{text:"<>",color:"#e37933"},css:{text:"#",color:"#2f6fe0"},scss:{text:"S",color:"#cd6799"},markdown:{text:"M↓",color:"#3f7fbf"},powershell:{text:"PS",color:"#2a7bd0"},batch:{text:"BAT",color:"#7c8a96"},shell:{text:"$_",color:"#4a9e22"},python:{text:"PY",color:"#3d7fbf"},csharp:{text:"C#",color:"#9b4dca"},java:{text:"J",color:"#b07219"},kotlin:{text:"K",color:"#7f52ff"},go:{text:"GO",color:"#00a3cc"},rust:{text:"RS",color:"#c4561f"},c:{text:"C",color:"#6f8aa6"},cpp:{text:"C++",color:"#d6336c"},swift:{text:"SW",color:"#f05138"},dart:{text:"DT",color:"#0a85d6"},php:{text:"PHP",color:"#777bb4"},ruby:{text:"RB",color:"#cc342d"},lua:{text:"LUA",color:"#5466d6"},sql:{text:"SQL",color:"#d48a00"},yaml:{text:"Y",color:"#cb3a3a"},toml:{text:"T",color:"#b5562a"},ini:{glyph:"gear",color:"#7c8a96"},dockerfile:{text:"D",color:"#2496ed"},makefile:{text:"MK",color:"#7c8a96"},vue:{text:"V",color:"#3fae7c"}},M={glyph:"image",color:"#a074c4"},O={glyph:"archive",color:"#a07d3e"},L={png:M,jpg:M,jpeg:M,gif:M,webp:M,ico:M,bmp:M,svg:{text:"SVG",color:"#d6922d"},pdf:{text:"PDF",color:"#d03b35"},csv:{text:"CSV",color:"#2e8a55"},xlsx:{text:"XLS",color:"#2e8a55"},docx:{text:"DOC",color:"#3a6cc0"},pptx:{text:"PPT",color:"#d04a26"},zip:O,gz:O,"7z":O,tgz:O,txt:{text:"TXT",color:"#7c8a96"},log:{text:"LOG",color:"#7c8a96"},lock:{glyph:"lock",color:"#7c8a96"},exe:{text:"EXE",color:"#7c8a96"},dll:{text:"DLL",color:"#7c8a96"},sln:{text:"SLN",color:"#9b4dca"},csproj:{text:"C#",color:"#9b4dca"},tsx:{text:"TSX",color:"#3178c6"},jsx:{text:"JSX",color:"#b89a00"}},z={glyph:"git",color:"#f14e32"},q={".gitignore":z,".gitattributes":z,".gitmodules":z,"package.json":{text:"npm",color:"#cb3837"},"package-lock.json":{text:"npm",color:"#cb3837"},license:{text:"\xa9",color:"#7c8a96"},"license.md":{text:"\xa9",color:"#7c8a96"},"license.txt":{text:"\xa9",color:"#7c8a96"},".env":{glyph:"gear",color:"#c49a10"}};function I(e){let{glyph:t}=e;switch(t){case"image":return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("circle",{cx:"11",cy:"4.5",r:"1.8",fill:"currentColor"}),(0,a.jsx)("path",{d:"M1 14 6 7l3.5 4.5L11.5 9 15 14z",fill:"currentColor"})]});case"git":return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("path",{d:"M4.5 3v10M4.5 9.5c0-2.5 7-2 7-5",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),(0,a.jsx)("circle",{cx:"4.5",cy:"3",r:"1.9",fill:"currentColor"}),(0,a.jsx)("circle",{cx:"4.5",cy:"13",r:"1.9",fill:"currentColor"}),(0,a.jsx)("circle",{cx:"11.5",cy:"4.5",r:"1.9",fill:"currentColor"})]});case"lock":return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("path",{d:"M5 7V5a3 3 0 0 1 6 0v2",fill:"none",stroke:"currentColor",strokeWidth:"1.8"}),(0,a.jsx)("rect",{x:"3",y:"7",width:"10",height:"8",rx:"1.5",fill:"currentColor"})]});case"gear":return(0,a.jsx)("path",{d:"M8 5.2a2.8 2.8 0 1 0 0 5.6 2.8 2.8 0 0 0 0-5.6zM7 1h2l.4 1.9 1.3.6 1.7-1 1.4 1.4-1 1.7.6 1.3L15 7v2l-1.9.4-.6 1.3 1 1.7-1.4 1.4-1.7-1-1.3.6L9 15H7l-.4-1.9-1.3-.6-1.7 1-1.4-1.4 1-1.7-.6-1.3L1 9V7l1.9-.4.6-1.3-1-1.7 1.4-1.4 1.7 1 1.3-.6z",fill:"currentColor",fillRule:"evenodd"});case"archive":return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("path",{d:"M2 4h12v10H2z",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),(0,a.jsx)("path",{d:"M8 4v1.5M8 7v1.5M8 10v1.5",stroke:"currentColor",strokeWidth:"1.6"}),(0,a.jsx)("path",{d:"M1.5 1.5h13V4h-13z",fill:"currentColor"})]})}}function E(e){var t;let{path:l}=e,s=function(e){var t;let l=e.split("/").pop().toLowerCase();if(q[l])return q[l];let a=l.lastIndexOf("."),s=a>0?l.slice(a+1):"";return L[s]?L[s]:null!=(t=F[m(e)])?t:null}(l);if(!s)return(0,a.jsxs)("svg",{className:"file-ico",viewBox:"0 0 16 16","aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M3.5 1.5h6l3 3v10h-9z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),(0,a.jsx)("path",{d:"M9.5 1.5v3h3",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})]});if(s.glyph)return(0,a.jsx)("svg",{className:"file-ico",viewBox:"0 0 16 16","aria-hidden":"true",style:{color:s.color},children:(0,a.jsx)(I,{glyph:s.glyph})});let n=null!=(t=s.text)?t:"",i=n.length>=3?9.2:2===n.length?11.5:15;return(0,a.jsx)("svg",{className:"file-ico",viewBox:"0 0 16 16","aria-hidden":"true",children:(0,a.jsx)("text",{x:"8",y:"8.6",textAnchor:"middle",dominantBaseline:"middle",fontFamily:"'Segoe UI', system-ui, sans-serif",fontWeight:"800",fontSize:i,fill:s.color,...n.length>=2?{textLength:n.length>=3?16:15,lengthAdjust:"spacingAndGlyphs"}:{},children:n})})}var H=l(1272);function A(e){let{view:t,onOpen:l,workspace:s,onOpenFolder:n}=e;return"commits"===t?(0,a.jsx)(D,{workspace:s,onOpen:l,onOpenFolder:n}):(0,a.jsx)(T,{workspace:s,onOpen:l,onOpenFolder:n})}function W(e){let{title:t,children:l}=e;return(0,a.jsxs)("div",{className:"wb-side-head",children:[(0,a.jsx)("h2",{children:t}),(0,a.jsx)("span",{className:"grow"}),l]})}let R=(e,t)=>e.localeCompare(t,void 0,{sensitivity:"base"});function T(e){let{workspace:t,onOpen:l,onOpenFolder:n}=e,{t:i}=(0,o.kj)(),[d,u]=(0,s.useState)(null),[h,p]=(0,s.useState)(""),[m,f]=(0,s.useState)(new Set),x=()=>(null==t?void 0:t.ok)?r.FH.workspaceFiles().then(e=>{u(e.files),p("")}).catch(e=>p(e.message)):Promise.resolve();(0,s.useEffect)(()=>{u(null),x()},[null==t?void 0:t.dir,null==t?void 0:t.ok]),(0,c.z)(x,6e3,!!(null==t?void 0:t.ok));let b=(e,t)=>(0,a.jsxs)(a.Fragment,{children:[[...e.dirs.keys()].sort(R).map(l=>{let s=t?"".concat(t,"/").concat(l):l;return(0,a.jsxs)("li",{role:"treeitem","aria-expanded":m.has(s),children:[(0,a.jsxs)("button",{type:"button",className:"wb-row",onClick:()=>f(e=>{let t=new Set(e);return t.has(s)?t.delete(s):t.add(s),t}),children:[(0,a.jsx)("span",{className:"wb-chev","aria-hidden":"true",children:m.has(s)?"▾":"▸"}),(0,a.jsx)("span",{className:"wb-row-name",children:l})]}),m.has(s)&&(0,a.jsx)("ul",{role:"group",children:b(e.dirs.get(l),s)})]},"d:".concat(s))}),[...e.files].sort((e,t)=>R(e.split("/").pop(),t.split("/").pop())).map(e=>(0,a.jsx)("li",{role:"treeitem",children:(0,a.jsxs)("button",{type:"button",className:"wb-row file",onClick:()=>l({kind:"file",path:e}),title:e,children:[(0,a.jsx)(E,{path:e}),(0,a.jsx)("span",{className:"wb-row-name",children:e.split("/").pop()})]})},"f:".concat(e)))]});return(0,a.jsxs)("div",{className:"wb-tree",children:[(0,a.jsxs)(W,{title:(null==t?void 0:t.ok)?t.name:i("wb.files"),children:[(0,a.jsx)("button",{type:"button",className:"wb-icon-btn",onClick:n,title:i("chat.openFolder"),"aria-label":i("chat.openFolder"),children:"⋯"}),(0,a.jsx)("button",{type:"button",className:"wb-icon-btn",onClick:()=>void x(),title:i("wb.refresh"),"aria-label":i("wb.refresh"),children:"↻"})]}),t?t.ok?h?(0,a.jsx)("p",{className:"err small wb-pad",children:h}):d?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{className:"muted small wb-pad",title:t.dir,children:t.branch?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(H.O,{})," ",t.branch]}):t.dir}),(0,a.jsx)("ul",{className:"wb-tree-list",role:"tree","aria-label":i("wb.files"),children:b(function(e){let t={dirs:new Map,files:[]};for(let l of e){let e=l.split("/"),a=t;for(let t of e.slice(0,-1)){let e=a.dirs.get(t);e||(e={dirs:new Map,files:[]},a.dirs.set(t,e)),a=e}a.files.push(l)}return t}(d),"")})]}):(0,a.jsx)("p",{className:"muted small wb-pad",children:i("wb.loading")}):(0,a.jsxs)("div",{className:"wb-pad",children:[(0,a.jsx)("p",{className:"small",children:t.problem}),(0,a.jsx)("button",{type:"button",className:"primary",onClick:n,children:i("chat.openFolder")})]}):(0,a.jsx)("p",{className:"muted small wb-pad",children:i("wb.loading")})]})}function D(e){var t;let{workspace:l,onOpen:n,onOpenFolder:i}=e,{t:d}=(0,o.kj)(),u=(0,o.W3)(),[h,p]=(0,s.useState)(null),[m,f]=(0,s.useState)(""),[x,b]=(0,s.useState)(new Set),[w,v]=(0,s.useState)(""),[g,j]=(0,s.useState)(new Map),y=(0,s.useCallback)(()=>r.FH.workspaceGit().then(e=>{p(e),f("")}).catch(e=>f(e.message)),[]);(0,s.useEffect)(()=>{p(null),(null==l?void 0:l.ok)&&y()},[y,null==l?void 0:l.ok,null==l?void 0:l.dir]),(0,c.z)(y,5e3,!!(null==l?void 0:l.ok));let k=(e,t,l)=>{let s,i=e.path.lastIndexOf("/");return(0,a.jsx)("li",{children:(0,a.jsxs)("button",{type:"button",className:"wb-row wb-git-file",onClick:()=>n({kind:"diff",area:t,path:e.path,...l?{commit:l}:{}}),title:"".concat(e.oldPath?"".concat(e.oldPath," → "):"").concat(e.path," \xb7 ").concat((s=e.status,d("git.status.".concat("!"===s?"conflict":s)))),children:[(0,a.jsx)(E,{path:e.path}),(0,a.jsx)("span",{className:"wb-row-name",children:e.path.slice(i+1)}),i>=0&&(0,a.jsx)("span",{className:"muted wb-git-dir",children:e.path.slice(0,i)}),(0,a.jsx)("span",{className:"grow"}),(0,a.jsx)("span",{className:"wb-git-counts",children:e.added<0?d("diff.binaryShort"):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("span",{className:"plus",children:["+",e.added]})," ",(0,a.jsxs)("span",{className:"minus",children:["−",e.removed]})]})}),(0,a.jsx)("span",{className:"wb-git-status s-".concat("!"===e.status?"conflict":e.status),"aria-hidden":"true",children:e.status})]})},"".concat(t,":").concat(null!=l?l:"",":").concat(e.path))},N=(e,t,l,s)=>(0,a.jsxs)("div",{className:"wb-git-section",children:[(0,a.jsxs)("button",{type:"button",className:"wb-git-head","aria-expanded":!x.has(e),onClick:()=>b(t=>new Set(t.has(e)?[...t].filter(t=>t!==e):[...t,e])),children:[(0,a.jsx)("span",{"aria-hidden":"true",children:x.has(e)?"▸":"▾"})," ",t,null!==l&&(0,a.jsx)("span",{className:"wb-badge",children:l})]}),!x.has(e)&&s]});return(0,a.jsxs)("div",{className:"wb-tree",children:[(0,a.jsx)(W,{title:d("git.title"),children:(0,a.jsx)("button",{type:"button",className:"wb-icon-btn",onClick:()=>void y(),title:d("git.refresh"),"aria-label":d("git.refresh"),disabled:!(null==l?void 0:l.ok),children:"↻"})}),(null==l?void 0:l.ok)?m?(0,a.jsx)("p",{className:"err small wb-pad",children:m}):h?h.isRepo?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("p",{className:"small wb-pad wb-git-branch",children:[(0,a.jsx)(H.O,{})," ",(0,a.jsx)("strong",{children:null!=(t=h.branch)?t:"HEAD"}),h.upstream&&(0,a.jsxs)("span",{className:"muted",children:[" \xb7 ",d("git.upstream",{name:h.upstream.name,ahead:h.upstream.ahead,behind:h.upstream.behind})]})]}),h.staged.length>0&&N("staged",d("git.staged"),h.staged.length,(0,a.jsx)("ul",{className:"wb-git-files",children:h.staged.map(e=>k(e,"staged"))})),N("changes",d("git.changes"),h.changes.length,0===h.changes.length?(0,a.jsx)("p",{className:"muted small wb-pad",children:d("git.noChanges")}):(0,a.jsx)("ul",{className:"wb-git-files",children:h.changes.map(e=>k(e,"changes"))})),N("commits",d("git.commits"),null,0===h.commits.length?(0,a.jsx)("p",{className:"muted small wb-pad",children:d("git.noCommits")}):(0,a.jsx)("ul",{className:"wb-commits",children:h.commits.map(e=>{let t=g.get(e.sha);return(0,a.jsxs)("li",{children:[(0,a.jsxs)("button",{type:"button",className:"wb-row","aria-expanded":w===e.sha,onClick:()=>(e=>{if(w===e)return void v("");v(e),g.has(e)||r.FH.workspaceCommit(e).then(t=>j(l=>new Map(l).set(e,t.files))).catch(t=>j(l=>new Map(l).set(e,t.message)))})(e.sha),title:e.subject,children:[(0,a.jsx)("span",{"aria-hidden":"true",children:w===e.sha?"▾":"▸"}),(0,a.jsx)("code",{children:e.short}),(0,a.jsx)("span",{className:"wb-row-name",children:e.subject})]}),(0,a.jsxs)("div",{className:"muted wb-commit-meta",children:[e.author," \xb7 ",u(e.at)]}),w===e.sha&&(void 0===t?(0,a.jsx)("p",{className:"muted small wb-pad",children:d("wb.loading")}):"string"==typeof t?(0,a.jsx)("p",{className:"err small wb-pad",children:t}):(0,a.jsx)("ul",{className:"wb-git-files nested","aria-label":d("git.commitFiles",{sha:e.short}),children:t.map(t=>k(t,"commit",e.sha))}))]},e.sha)})})),h.moreCommits&&(0,a.jsx)("p",{className:"muted small wb-pad",children:d("git.more",{n:h.commits.length})})]}):(0,a.jsx)("p",{className:"muted small wb-pad",children:d("git.notRepo")}):(0,a.jsx)("p",{className:"muted small wb-pad",children:d("wb.loading")}):(0,a.jsxs)("div",{className:"wb-pad",children:[(0,a.jsx)("p",{className:"muted small",children:d("git.noFolder")}),(0,a.jsx)("button",{type:"button",onClick:i,children:d("chat.openFolder")})]})]})}function _(e){var t,l,n,i,d;let{path:h,onDirty:p}=e,{t:f}=(0,o.kj)(),[x,b]=(0,s.useState)(null),[w,v]=(0,s.useState)(""),[g,j]=(0,s.useState)(""),[y,k]=(0,s.useState)(""),[N,C]=(0,s.useState)(!1),[F,M]=(0,s.useState)(!1),[O,L]=(0,s.useState)("auto"),z=(0,s.useRef)(null),q=(0,s.useRef)(null),I=(0,s.useRef)(null),H=!!x&&null!==x.text&&w!==x.text;(0,s.useEffect)(()=>null==p?void 0:p(h,H),[h,H,p]);let A=(0,s.useCallback)(async()=>{try{var e;let t=await r.FH.workspaceFile(h);b(t),v(null!=(e=t.text)?e:""),M(!1),j("")}catch(e){j(e.message)}},[h]);(0,s.useEffect)(()=>{b(null),k(""),M(!1),A()},[A]),(0,c.z)(async()=>{if(!(null==x?void 0:x.version)||N)return;let e=await r.FH.workspaceFile(h).catch(()=>null);if((null==e?void 0:e.version)&&e.version!==x.version)if(H)M(!0);else{var t;b(e),v(null!=(t=e.text)?t:"")}},4e3,!!x);let W="auto"===O?m(h,null!=(t=null==x?void 0:x.text)?t:""):O,R=(0,s.useMemo)(()=>w.length>4e5?S(w,"plain"):S(w,W),[w,W]),T=(0,s.useMemo)(()=>{let e=w.split("\n").length,t="";for(let l=1;l<=e;l+=1)t+="".concat(l,"\n");return t},[w]),D=async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(x&&!N){C(!0),k("");try{let t=await r.FH.saveWorkspaceFile(h,w,e?void 0:x.version);b({...x,text:w,version:t.version,size:t.size}),M(!1),k(f("ed.saved"))}catch(e){409===e.status?M(!0):k(e.message)}finally{C(!1)}}},_=()=>{let e=z.current;e&&(q.current&&(q.current.scrollTop=e.scrollTop,q.current.scrollLeft=e.scrollLeft),I.current&&(I.current.scrollTop=e.scrollTop))};return((0,s.useEffect)(_,[R]),g&&!x)?(0,a.jsx)("p",{className:"err small",children:g}):x?x.binary||x.tooLarge?(0,a.jsxs)("div",{className:"wb-file",children:[(0,a.jsx)("p",{className:"muted small",children:f("wb.fileOnDisk",{path:x.path})}),(0,a.jsx)("p",{className:"muted",children:x.binary?f("wb.binary"):f("wb.tooLarge")})]}):(0,a.jsxs)("div",{className:"ed",children:[(0,a.jsxs)("div",{className:"ed-bar",children:[(0,a.jsx)(E,{path:h}),(0,a.jsx)("span",{className:"ed-path",title:x.path,children:x.path}),(0,a.jsx)("span",{className:"small ".concat(H?"ed-dirty":"muted"),role:"status",children:H?f("ed.unsaved"):y||f("ed.clean")}),(0,a.jsx)("span",{className:"grow"}),(0,a.jsx)("label",{htmlFor:"ed-lang-".concat(h),className:"sr-only",children:f("ed.language")}),(0,a.jsxs)("select",{id:"ed-lang-".concat(h),className:"ed-lang",value:O,onChange:e=>L(e.target.value),title:f("ed.language"),children:[(0,a.jsx)("option",{value:"auto",children:f("ed.langAuto",{name:(n=m(h,null!=(l=x.text)?l:""),null!=(d=null==(i=u.find(e=>e.id===n))?void 0:i.name)?d:n)})}),u.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name},e.id))]}),(0,a.jsx)("button",{type:"button",className:"quiet small",disabled:!H||N,onClick:()=>{var e;v(null!=(e=x.text)?e:""),k("")},children:f("ed.revert")}),(0,a.jsx)("button",{type:"button",className:"primary small",disabled:!H||N,onClick:()=>void D(),title:"Ctrl+S",children:f("ed.save")})]}),F&&(0,a.jsxs)("div",{className:"notice caution small ed-conflict",role:"alert",children:[(0,a.jsx)("span",{children:f("ed.changedOnDisk")}),(0,a.jsx)("button",{type:"button",className:"small",onClick:()=>void A(),children:f("ed.reload")}),(0,a.jsx)("button",{type:"button",className:"small danger",onClick:()=>void D(!0),children:f("ed.saveOver")})]}),(0,a.jsxs)("div",{className:"ed-body",children:[(0,a.jsx)("pre",{ref:I,className:"ed-gutter","aria-hidden":"true",children:T}),(0,a.jsxs)("div",{className:"ed-area",children:[(0,a.jsx)("pre",{ref:q,className:"ed-shown","aria-hidden":"true",children:(0,a.jsx)("code",{dangerouslySetInnerHTML:{__html:"".concat(R,"\n")}})}),(0,a.jsx)("textarea",{ref:z,className:"ed-input",value:w,onChange:e=>v(e.target.value),onScroll:_,onKeyDown:e=>{(e.ctrlKey||e.metaKey)&&"s"===e.key.toLowerCase()?(e.preventDefault(),D()):"Tab"!==e.key||e.ctrlKey||e.altKey||e.metaKey?"Escape"===e.key&&e.currentTarget.blur():(e.preventDefault(),((e,t)=>{let l=/^\t/m.test(e.value)&&!/^ {2,}\S/m.test(e.value)?" ":" ",{selectionStart:a,selectionEnd:s,value:n}=e;if(a===s&&!t){document.execCommand("insertText",!1,l)||e.setRangeText(l,a,s,"end"),v(e.value);return}let i=n.lastIndexOf("\n",a-1)+1,r=s>a&&"\n"===n[s-1]?s-1:s,c=n.slice(i,r).split("\n").map(e=>t?e.replace(" "===l?/^\t/:/^ {1,2}/,""):l+e).join("\n");e.setSelectionRange(i,r),document.execCommand("insertText",!1,c)||e.setRangeText(c,i,r,"select"),e.setSelectionRange(i,i+c.length),v(e.value)})(e.currentTarget,e.shiftKey))},spellCheck:!1,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",wrap:"off","aria-label":f("ed.label",{path:x.path})})]})]})]}):(0,a.jsx)("p",{className:"muted small",children:f("wb.loading")})}function P(e){if(null===e||""===e)return[];let t=e.split(/\r?\n/);return""===t[t.length-1]&&t.pop(),t}function $(e,t){let l=function(e,t){let l=0;for(;l<e.length&&l<t.length&&e[l]===t[l];)l+=1;let a=e.length,s=t.length;for(;a>l&&s>l&&e[a-1]===t[s-1];)a-=1,s-=1;let n=[];for(let e=0;e<l;e+=1)n.push({kind:"same",a:e,b:e});for(let i of function(e,t){let l=e.length,a=t.length;if(0===l)return t.map((e,t)=>({kind:"add",b:t}));if(0===a)return e.map((e,t)=>({kind:"del",a:t}));let s=l+a,n=s+1,i=new Int32Array(2*s+3),r=[];for(let c=0;c<=Math.min(s,2e3);c+=1){r.push(i.slice(n-c-1,n+c+2));for(let s=-c;s<=c;s+=2){let o=s===-c||s!==c&&i[n+s-1]<i[n+s+1]?i[n+s+1]:i[n+s-1]+1,d=o-s;for(;o<l&&d<a&&e[o]===t[d];)o+=1,d+=1;if(i[n+s]=o,o>=l&&d>=a)return function(e,t,l,a){let s=[],n=t.length,i=l.length;for(let t=a;t>0;t-=1){let l=e[t],a=e=>l[e+t+1],r=n-i,c=r===-t||r!==t&&a(r-1)<a(r+1)?r+1:r-1,o=a(c),d=o-c;for(;n>o&&i>d;)n-=1,i-=1,s.push({kind:"same",a:n,b:i});n===o?s.push({kind:"add",b:d}):s.push({kind:"del",a:o}),n=o,i=d}for(;n>0&&i>0;)n-=1,i-=1,s.push({kind:"same",a:n,b:i});return s.reverse()}(r,e,t,c)}}return[...e.map((e,t)=>({kind:"del",a:t})),...t.map((e,t)=>({kind:"add",b:t}))]}(e.slice(l,a),t.slice(l,s)))n.push({kind:i.kind,...void 0!==i.a?{a:i.a+l}:{},...void 0!==i.b?{b:i.b+l}:{}});for(let t=0;a+t<e.length;t+=1)n.push({kind:"same",a:a+t,b:s+t});return n}(e,t),a=[];for(let s=0;s<l.length;){let n=l[s];if("same"===n.kind){a.push({kind:"same",left:{no:n.a+1,text:e[n.a]},right:{no:n.b+1,text:t[n.b]}}),s+=1;continue}let i=[],r=[];for(;s<l.length&&"same"!==l[s].kind;){let e=l[s];"del"===e.kind?i.push(e.a):r.push(e.b),s+=1}let c=Math.max(i.length,r.length);for(let l=0;l<c;l+=1){let s=i[l],n=r[l];a.push({kind:void 0!==s&&void 0!==n?"change":void 0!==s?"del":"add",...void 0!==s?{left:{no:s+1,text:e[s]}}:{},...void 0!==n?{right:{no:n+1,text:t[n]}}:{}})}}return a}function Z(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(a)return e.map((e,t)=>({type:"row",row:e,index:t}));let s=[];for(let a=0;a<e.length;){if("same"!==e[a].kind){s.push({type:"row",row:e[a],index:a}),a+=1;continue}let n=a;for(;n<e.length&&"same"===e[n].kind;)n+=1;let i=0===a?0:t,r=n===e.length?0:t,c=n-a-i-r;if(c>1&&!l.has(a+i)){for(let t=a;t<a+i;t+=1)s.push({type:"row",row:e[t],index:t});s.push({type:"gap",from:a+i,count:c});for(let t=n-r;t<n;t+=1)s.push({type:"row",row:e[t],index:t})}else for(let t=a;t<n;t+=1)s.push({type:"row",row:e[t],index:t});a=n}return s}var B=l(4969);function K(e){let{sessionId:t,taskId:l,runId:n,title:i,files:r}=e,{t:c}=(0,o.kj)(),[d,u]=(0,s.useState)(!1);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{type:"button",className:"linkish",onClick:()=>u(!0),title:c("diff.openWhy"),children:c("diff.open",{n:r})}),d&&(0,a.jsx)(U,{sessionId:t,taskId:l,runId:n,title:i,onClose:()=>u(!1)})]})}function U(e){var t,l,n,i,c,d,u;let{sessionId:h,taskId:p,runId:m,title:f,onClose:x}=e,{t:b}=(0,o.kj)(),[w,v]=(0,s.useState)(null),[g,j]=(0,s.useState)(""),[y,k]=(0,s.useState)(0),[N,C]=(0,s.useState)(new Map),[S,F]=(0,s.useState)(!1),[M,O]=(0,s.useState)(!0),[L,z]=(0,s.useState)(new Map),[q,I]=(0,s.useState)(-1),E=(0,s.useRef)(null),H=(0,s.useRef)(null),A=(0,s.useRef)(null);(0,B.V)(H,!0,A),(0,s.useEffect)(()=>{r.FH.taskChanges(h,p,m).then(v).catch(e=>j(e.message))},[h,p,m]);let W=null!=(n=null==w?void 0:w.files)?n:[],R=W[y];(0,s.useEffect)(()=>{!R||N.has(R.path)||r.FH.taskChangeFile(h,p,R.path,m).then(e=>C(t=>new Map(t).set(R.path,e))).catch(e=>C(t=>new Map(t).set(R.path,e.message)))},[R,N,h,p,m]);let T=R?N.get(R.path):void 0,D=(0,s.useMemo)(()=>!T||"string"==typeof T||T.binary||T.tooLarge?[]:$(P(T.before),P(T.after)),[T]),_=R&&L.get(R.path)||new Set,K=(0,s.useMemo)(()=>Z(D,3,_,S),[D,_,S]),U=(0,s.useMemo)(()=>D.flatMap((e,t)=>"same"!==e.kind&&(0===t||"same"===D[t-1].kind)?[t]:[]),[D]);(0,s.useEffect)(()=>{I(-1),E.current&&(E.current.scrollTop=0)},[y]);let Y=(0,s.useCallback)(e=>{var t;if(0===U.length)return;let l=q<0?1===e?0:U.length-1:Math.min(U.length-1,Math.max(0,q+e));I(l);let a=null==(t=E.current)?void 0:t.querySelector('[data-row="'.concat(U[l],'"]'));null==a||a.scrollIntoView({block:"center"})},[q,U]),G=(0,s.useCallback)(e=>k(t=>Math.min(Math.max(0,t+e),Math.max(0,W.length-1))),[W.length]);(0,s.useEffect)(()=>{let e=e=>{if(!e.ctrlKey&&!e.metaKey&&!e.altKey){if("Escape"===e.key)x();else if("n"===e.key)Y(1);else if("p"===e.key)Y(-1);else if("]"===e.key)G(1);else{if("["!==e.key)return;G(-1)}e.preventDefault()}};window.addEventListener("keydown",e);let t=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{window.removeEventListener("keydown",e),document.body.style.overflow=t}},[Y,G,x]);let Q=W.reduce((e,t)=>({added:e.added+Math.max(0,t.added),removed:e.removed+Math.max(0,t.removed)}),{added:0,removed:0});return(0,a.jsxs)("div",{ref:H,className:"diff-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"diff-title",children:[(0,a.jsxs)("div",{className:"diff-head",children:[(0,a.jsx)("h2",{id:"diff-title",children:b("diff.title",{title:f})}),(null==w?void 0:w.ok)&&(0,a.jsxs)("span",{className:"muted small",children:[w.branch?"".concat(w.branch," \xb7 "):"",null==(t=w.base)?void 0:t.slice(0,8)," → ",null==(l=w.commit)?void 0:l.slice(0,8)," \xb7 ",b("diff.summary",{n:W.length,a:Q.added,r:Q.removed})]}),(0,a.jsx)("span",{className:"grow"}),(0,a.jsx)("span",{className:"muted small",children:b("diff.keys")}),(0,a.jsx)("button",{ref:A,type:"button",onClick:x,children:b("diff.close")})]}),g&&(0,a.jsx)("div",{className:"err",style:{padding:12},children:g}),!w&&!g&&(0,a.jsx)("div",{className:"muted",style:{padding:12},children:b("diff.loading")}),w&&!w.ok&&(0,a.jsx)("div",{className:"notice caution",style:{margin:12},children:w.problem}),(null==w?void 0:w.ok)&&0===W.length&&(0,a.jsx)("div",{className:"notice",style:{margin:12},children:b("diff.nothing")}),(null==w?void 0:w.ok)&&W.length>0&&(0,a.jsxs)("div",{className:"diff-body",children:[(0,a.jsx)("nav",{className:"diff-files","aria-label":b("diff.files"),children:W.map((e,t)=>{let l=e.path.lastIndexOf("/");return(0,a.jsxs)("button",{type:"button",className:"diff-file".concat(t===y?" on":""),onClick:()=>k(t),title:e.oldPath?"".concat(e.oldPath," → ").concat(e.path):e.path,children:[(0,a.jsx)("span",{className:"diff-status s-".concat(e.status),children:e.status}),(0,a.jsxs)("span",{className:"diff-path",children:[l>=0&&(0,a.jsx)("span",{className:"muted",children:e.path.slice(0,l+1)}),(0,a.jsx)("strong",{children:e.path.slice(l+1)})]}),(0,a.jsx)("span",{className:"diff-counts",children:e.added<0?b("diff.binaryShort"):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("span",{className:"plus",children:["+",e.added]})," ",(0,a.jsxs)("span",{className:"minus",children:["−",e.removed]})]})})]},e.path)})}),(0,a.jsxs)("div",{className:"diff-main",children:[R&&(0,a.jsxs)("div",{className:"diff-toolbar",children:[(0,a.jsxs)("div",{className:"diff-title-row",children:[(0,a.jsx)("strong",{className:"diff-name",children:R.oldPath?"".concat(R.oldPath," → ").concat(R.path):R.path}),(0,a.jsx)("span",{className:"muted small",children:"A"===R.status?b("diff.added"):"D"===R.status?b("diff.deleted"):"R"===R.status?b("diff.renamed"):""})]}),(0,a.jsx)(V,{changes:U.length,onChange:Y,files:{at:y,count:W.length,onFile:G},whole:S,onWhole:F,wrap:M,onWrap:O})]}),(0,a.jsxs)("div",{className:"diff-scroll",ref:E,children:[void 0===T&&(0,a.jsx)("div",{className:"muted",style:{padding:12},children:b("diff.loading")}),"string"==typeof T&&(0,a.jsx)("div",{className:"err",style:{padding:12},children:T}),T&&"string"!=typeof T&&T.binary&&(0,a.jsx)("div",{className:"notice",style:{margin:12},children:b("diff.binary")}),T&&"string"!=typeof T&&T.tooLarge&&(0,a.jsx)("div",{className:"notice",style:{margin:12},children:b("diff.tooLarge")}),T&&"string"!=typeof T&&!T.binary&&!T.tooLarge&&(0,a.jsxs)(a.Fragment,{children:[(null!=(i=T.before)?i:"").includes("\r\n")!==(null!=(c=T.after)?c:"").includes("\r\n")&&null!==T.before&&null!==T.after&&(0,a.jsx)("div",{className:"notice small",style:{margin:8},children:b("diff.eol",{from:(null!=(d=T.before)?d:"").includes("\r\n")?"CRLF":"LF",to:(null!=(u=T.after)?u:"").includes("\r\n")?"CRLF":"LF"})}),D.length>0&&0===U.length&&(0,a.jsx)("div",{className:"notice small",style:{margin:8},children:b("diff.sameText")}),(0,a.jsxs)("table",{className:"diff-table".concat(M?"":" nowrap"),children:[(0,a.jsxs)("colgroup",{children:[(0,a.jsx)("col",{className:"num"}),(0,a.jsx)("col",{}),(0,a.jsx)("col",{className:"num"}),(0,a.jsx)("col",{})]}),(0,a.jsx)(J,{changes:U.length,at:q}),(0,a.jsx)("tbody",{children:K.map(e=>"gap"===e.type?(0,a.jsx)("tr",{className:"diff-gap",children:(0,a.jsx)("td",{colSpan:4,children:(0,a.jsx)("button",{type:"button",className:"linkish small",onClick:()=>{var t;return t=e.from,void(R&&z(e=>{var l;return new Map(e).set(R.path,new Set([...null!=(l=e.get(R.path))?l:[],t]))}))},children:b("diff.gap",{n:e.count})})})},"g".concat(e.from)):(0,a.jsx)(X,{row:e.row,index:e.index,current:q>=0&&U[q]===e.index},e.index))})]})]})]})]})]})]})}function V(e){let{changes:t,onChange:l,files:s,whole:n,onWhole:i,wrap:r,onWrap:c}=e,{t:d}=(0,o.kj)();return(0,a.jsxs)("div",{className:"diff-tools",children:[(0,a.jsxs)("span",{className:"diff-pair",children:[(0,a.jsx)("button",{type:"button",className:"quiet",onClick:()=>l(-1),disabled:0===t,children:d("diff.prevChange")}),(0,a.jsx)("button",{type:"button",className:"quiet",onClick:()=>l(1),disabled:0===t,children:d("diff.nextChange")})]}),s&&s.count>1&&(0,a.jsxs)("span",{className:"diff-pair",children:[(0,a.jsx)("button",{type:"button",className:"quiet",onClick:()=>s.onFile(-1),disabled:0===s.at,children:d("diff.prevFile")}),(0,a.jsx)("button",{type:"button",className:"quiet",onClick:()=>s.onFile(1),disabled:s.at>=s.count-1,children:d("diff.nextFile")})]}),(0,a.jsxs)("span",{className:"diff-pair",children:[(0,a.jsxs)("label",{className:"option-inline",children:[(0,a.jsx)("input",{type:"checkbox",checked:n,onChange:e=>i(e.target.checked)})," ",d("diff.whole")]}),(0,a.jsxs)("label",{className:"option-inline",children:[(0,a.jsx)("input",{type:"checkbox",checked:r,onChange:e=>c(e.target.checked)})," ",d("diff.wrap")]})]})]})}function J(e){let{changes:t,at:l}=e,{t:s}=(0,o.kj)();return(0,a.jsxs)("thead",{children:[t>0&&(0,a.jsx)("tr",{className:"diff-where",children:(0,a.jsx)("th",{colSpan:4,children:s("diff.changeN",{i:l<0?"–":l+1,n:t})})}),(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{colSpan:2,children:s("diff.before")}),(0,a.jsx)("th",{colSpan:2,children:s("diff.after")})]})]})}function X(e){var t,l,n,i;let{row:r,index:c,current:o}=e,d="change"===r.kind?function(e,t){let l=0;for(;l<e.length&&l<t.length&&e[l]===t[l];)l+=1;let a=e.length,s=t.length;for(;a>l&&s>l&&e[a-1]===t[s-1];)a-=1,s-=1;return{start:l,leftEnd:a,rightEnd:s}}(r.left.text,r.right.text):null,u=e=>{let t=r[e];if(!t)return null;if(!d)return t.text;let l="left"===e?d.leftEnd:d.rightEnd;return(0,a.jsxs)(s.Fragment,{children:[t.text.slice(0,d.start),(0,a.jsx)("mark",{children:t.text.slice(d.start,l)}),t.text.slice(l)]})};return(0,a.jsxs)("tr",{className:"diff-row ".concat(r.kind).concat(o?" current":""),"data-row":c,children:[(0,a.jsx)("td",{className:"num",children:null!=(n=null==(t=r.left)?void 0:t.no)?n:""}),(0,a.jsx)("td",{className:"code l".concat(r.left?"":" empty"),children:u("left")}),(0,a.jsx)("td",{className:"num",children:null!=(i=null==(l=r.right)?void 0:l.no)?i:""}),(0,a.jsx)("td",{className:"code r".concat(r.right?"":" empty"),children:u("right")})]})}function Y(e){var t;let{area:l,path:n,commit:i}=e,{t:d}=(0,o.kj)(),[u,h]=(0,s.useState)(null),[p,m]=(0,s.useState)(""),[f,x]=(0,s.useState)(!1),[b,w]=(0,s.useState)(!0),[v,g]=(0,s.useState)(new Set),[j,y]=(0,s.useState)(-1),k=(0,s.useRef)(null),N=(0,s.useCallback)(()=>r.FH.workspaceGitFile(l,n,i).then(e=>{h(e),m("")}).catch(e=>m(e.message)),[l,n,i]);(0,s.useEffect)(()=>{h(null),m(""),g(new Set),y(-1),N()},[N]),(0,c.z)(N,5e3,"commit"!==l);let C=(0,s.useMemo)(()=>!u||u.binary||u.tooLarge?[]:$(P(u.before),P(u.after)),[u]),S=(0,s.useMemo)(()=>Z(C,3,v,f),[C,v,f]),F=(0,s.useMemo)(()=>C.flatMap((e,t)=>"same"!==e.kind&&(0===t||"same"===C[t-1].kind)?[t]:[]),[C]),M="commit"===l?(null!=i?i:"").slice(0,7):d("staged"===l?"git.index":"git.workingTree"),O=null!=(t=null==u?void 0:u.status)?t:"";return(0,a.jsxs)("div",{className:"wb-gitdiff",children:[(0,a.jsxs)("div",{className:"diff-toolbar",children:[(0,a.jsxs)("div",{className:"diff-title-row",children:[(0,a.jsx)("strong",{className:"diff-name",children:(null==u?void 0:u.oldPath)?"".concat(u.oldPath," → ").concat(n):n}),(0,a.jsxs)("span",{className:"muted small",children:[M,O?" \xb7 ".concat(d("git.status.".concat("!"===O?"conflict":O))):""]})]}),(0,a.jsx)(V,{changes:F.length,onChange:e=>{var t,l;if(0===F.length)return;let a=j<0?1===e?0:F.length-1:Math.min(F.length-1,Math.max(0,j+e));y(a),null==(l=k.current)||null==(t=l.querySelector('[data-row="'.concat(F[a],'"]')))||t.scrollIntoView({block:"center"})},whole:f,onWhole:x,wrap:b,onWrap:w})]}),(0,a.jsxs)("div",{className:"diff-scroll",ref:k,children:[p&&(0,a.jsx)("div",{className:"err",style:{padding:12},children:p}),!u&&!p&&(0,a.jsx)("div",{className:"muted",style:{padding:12},children:d("diff.loading")}),(null==u?void 0:u.binary)&&(0,a.jsx)("div",{className:"notice",style:{margin:12},children:d("diff.binary")}),(null==u?void 0:u.tooLarge)&&(0,a.jsx)("div",{className:"notice",style:{margin:12},children:d("diff.tooLarge")}),u&&!u.binary&&!u.tooLarge&&(0,a.jsxs)(a.Fragment,{children:[C.length>0&&0===F.length&&(0,a.jsx)("div",{className:"notice small",style:{margin:8},children:d("diff.sameText")}),(0,a.jsxs)("table",{className:"diff-table".concat(b?"":" nowrap"),children:[(0,a.jsxs)("colgroup",{children:[(0,a.jsx)("col",{className:"num"}),(0,a.jsx)("col",{}),(0,a.jsx)("col",{className:"num"}),(0,a.jsx)("col",{})]}),(0,a.jsx)(J,{changes:F.length,at:j}),(0,a.jsx)("tbody",{children:S.map(e=>"gap"===e.type?(0,a.jsx)("tr",{className:"diff-gap",children:(0,a.jsx)("td",{colSpan:4,children:(0,a.jsx)("button",{type:"button",className:"linkish small",onClick:()=>g(t=>new Set([...t,e.from])),children:d("diff.gap",{n:e.count})})})},"g".concat(e.from)):(0,a.jsx)(X,{row:e.row,index:e.index,current:j>=0&&F[j]===e.index},e.index))})]})]})]})]})}function G(e,t){let[l,a]=(0,s.useState)(null),n=(0,s.useRef)(!0),[i,r]=(0,s.useState)(!0),c=(0,s.useCallback)(e=>a(e),[]);return(0,s.useLayoutEffect)(()=>{if(!l)return;let e=()=>{let e=l.scrollHeight-l.scrollTop-l.clientHeight<=24;n.current=e,r(e)};return l.addEventListener("scroll",e,{passive:!0}),()=>l.removeEventListener("scroll",e)},[l]),(0,s.useLayoutEffect)(()=>{l&&e&&n.current&&(l.scrollTop=l.scrollHeight)},[l,e,t]),{ref:c,following:i,follow:(0,s.useCallback)(()=>{n.current=!0,r(!0),l&&(l.scrollTop=l.scrollHeight)},[l])}}var Q=l(1035),ee=l(4784);async function et(e){try{return await navigator.clipboard.writeText(e),!0}catch(e){}try{let t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select();let l=document.execCommand("copy");return t.remove(),l}catch(e){return!1}}function el(e){let{text:t,what:l,className:n=""}=e,{t:i}=(0,o.kj)(),[r,c]=(0,s.useState)(""),d=(0,s.useRef)(void 0);(0,s.useEffect)(()=>()=>window.clearTimeout(d.current),[]);let u=async()=>{c(await et(t)?"copied":"failed"),window.clearTimeout(d.current),d.current=window.setTimeout(()=>c(""),2e3)};return(0,a.jsx)("button",{type:"button",className:"quiet small copy-btn ".concat(n).trim(),onClick:()=>void u(),title:i(l),"aria-label":i(l),children:(0,a.jsx)("span",{"aria-live":"polite",children:i("copied"===r?"copy.copied":"failed"===r?"copy.failed":"copy.copy")})})}function ea(e,t){let l,s=[],n=/(`[^`\n]+`)|(\*\*[^*\n]+\*\*)|(\*[^*\n]+\*)/g,i=0,r=0;for(;null!==(l=n.exec(e));){l.index>i&&s.push(e.slice(i,l.index));let n=l[0],c="".concat(t,"-i").concat(r+=1);n.startsWith("`")?s.push((0,a.jsx)("code",{children:n.slice(1,-1)},c)):n.startsWith("**")?s.push((0,a.jsx)("strong",{children:n.slice(2,-2)},c)):s.push((0,a.jsx)("em",{children:n.slice(1,-1)},c)),i=l.index+n.length}return i<e.length&&s.push(e.slice(i)),s}function es(e){let t=/^\s*[-*•]\s+(.*)$/.exec(e);if(t)return t[1];let l=/^\s*\d+[.)]\s+(.*)$/.exec(e);return l?l[1]:null}function en(e){let{text:t,className:l}=e,n=[],i=t.replace(/\r\n/g,"\n").split("\n"),r=0,c=0;for(;r<i.length;){let e=i[r];if(e.trim().startsWith("```")){let e=[];for(r+=1;r<i.length&&!i[r].trim().startsWith("```");)e.push(i[r++]);r+=1,e.length>0&&n.push((0,a.jsx)("pre",{children:e.join("\n")},"b".concat(c+=1)));continue}if(null!==es(e)){let e=[];for(;r<i.length&&null!==es(i[r]);)e.push(es(i[r++]));n.push((0,a.jsx)("ul",{children:e.map((e,t)=>(0,a.jsx)("li",{children:ea(e,"b".concat(c,"-").concat(t))},t))},"b".concat(c+=1)));continue}if(""===e.trim()){r+=1;continue}let t=[];for(;r<i.length&&""!==i[r].trim()&&null===es(i[r])&&!i[r].trim().startsWith("```");)t.push(i[r++]);let l=c+=1;n.push((0,a.jsx)("p",{children:t.map((e,t)=>(0,a.jsxs)(s.Fragment,{children:[t>0&&(0,a.jsx)("br",{}),ea(e,"b".concat(l,"-").concat(t))]},t))},"b".concat(l)))}return(0,a.jsx)("div",{className:"rich ".concat(null!=l?l:""),children:n})}var ei=l(6657),er=l(9717);let ec="cop.chat.thread",eo="cop.chat.mode",ed="cop.chat.plan",eu="cop.chat.review",eh="cop.chat.lead",ep=(e,t)=>{try{t?window.localStorage.setItem(e,t):window.localStorage.removeItem(e)}catch(e){}},em=e=>{try{var t;return null!=(t=window.localStorage.getItem(e))?t:""}catch(e){return""}};function ef(e){var t,l,n,i,d,u,h,p,m,f,x,b,w;let{workspace:v,composeAsk:g,showThread:j,onOpenFile:y,onChange:k,onOpenFolder:N,onTurn:C}=e,{t:S,locale:F}=(0,o.kj)(),M=function(){let[e,t]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{let e=!0;return r.FH.settings().then(l=>{var a;let s=null!=(a=l.raw.execution)?a:{};e&&t("unattended"===s.mode)}).catch(()=>void 0),()=>{e=!1}},[]),e}(),[O,L]=(0,s.useState)([]),[z,q]=(0,s.useState)(""),[I,E]=(0,s.useState)(null),[H,A]=(0,s.useState)("confirm"),[W,R]=(0,s.useState)(!1),[T,D]=(0,s.useState)(!0),[_,P]=(0,s.useState)(!1),[$,Z]=(0,s.useState)(""),[B,K]=(0,s.useState)(null),[U,V]=(0,s.useState)(""),[J,X]=(0,s.useState)(!1),[Y,et]=(0,s.useState)(""),[el,ea]=(0,s.useState)([]),[es,en]=(0,s.useState)(null),[ei,er]=(0,s.useState)(""),[ef,eb]=(0,s.useState)(!1),ew=(0,s.useRef)(null),eg=!!I&&"idle"!==I.status,ej=null!=(h=null==es?void 0:es.defaultModel)?h:"",ey=I?!I.manualModel&&(I.model||ej)?null!=(p=I.model)?p:"":ee.u:"",ek=ei!==ee.u&&(ei||ej)?ei:ee.u;(0,s.useEffect)(()=>{q(em(ec)),R("on"===em(ed)),D("off"!==em(eu)),P("on"===em(eh));let e=em(eo);"confirm"===e||"unattended"===e?A(e):r.FH.settings().then(e=>{var t;return A((null==(t=e.raw.execution)?void 0:t.mode)==="unattended"?"unattended":"confirm")}).catch(()=>void 0)},[]),(0,s.useEffect)(()=>{var e;g>0&&(null==(e=ew.current)||e.focus())},[g]),(0,s.useEffect)(()=>{(null==j?void 0:j.id)&&eq(j.id)},[null==j?void 0:j.n]),(0,s.useEffect)(()=>{r.FH.models().then(en).catch(()=>void 0)},[]);let eN=(0,s.useCallback)(()=>r.FH.chatThreads().then(L).catch(()=>void 0),[]);(0,c.z)(eN,5e3);let eS=(0,s.useCallback)(()=>z?r.FH.session(z).then(e=>E("chat"===e.kind?e:null)).catch(e=>{404===e.status&&(E(null),q(""),ep(ec,""))}):Promise.resolve(E(null)),[z]);(0,s.useEffect)(()=>{eS()},[eS]),(0,c.z)(eS,eg?1500:5e3,!!z);let eF=(0,s.useRef)(new Set),eM=()=>z&&eg?r.FH.approvals(z).then(e=>ea(e.filter(e=>!eF.current.has(e.id)))).catch(()=>void 0):Promise.resolve(ea([]));(0,c.z)(eM,1500,!!z);let eO=(e,t)=>{t&&(eF.current.add(e),ea(t=>t.filter(t=>t.id!==e))),eM()},eL=null!=(m=null==I||null==(t=I.lead)?void 0:t.workerSessionId)?m:"",ez=(0,s.useCallback)(()=>eL?r.FH.session(eL).then(K).catch(()=>void 0):Promise.resolve(K(null)),[eL]);(0,s.useEffect)(()=>{ez()},[ez]),(0,c.z)(ez,eg?1500:1e4,!!eL);let eq=e=>{q(e),ep(ec,e),et("")},eI=e=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("label",{htmlFor:"cs-model",className:"sr-only",children:S("chat.model")}),(0,a.jsx)(ee.Yb,{id:"cs-model",chosen:I?ey:ek,onChange:e=>void eR(e),byHand:S("chat.modelByHand"),none:(null==es?void 0:es.defaultModel)?S("chat.modelDefault",{model:es.defaultModel}):void 0,catalogue:es,disabled:eg,style:{minWidth:0,maxWidth:e}}),(0,a.jsx)("button",{type:"button",className:"wb-icon-btn",onClick:()=>void eP(),disabled:ef||eg,title:S("chat.readModels"),"aria-label":S("chat.readModels"),children:"↻"})]}),eE=eg||O.some(e=>e.running)?S("chat.newChatRunning"):I?"":S("chat.newChatFresh"),eH=async()=>{let e=U.trim();if(e&&!J){X(!0),et("");try{var t;let l=!z,a=l&&ei===ee.u,s=l&&_?{workerModel:$===ee.u?void 0:$||void 0,workerManualModel:$===ee.u}:void 0,n=await r.FH.chatSend(e,z||void 0,l&&!a&&ei||void 0,a,F,l&&W,l?!s&&T:void 0,s);if(V(""),eq(n.threadId),n.noted)return void et(S("chat.noted"));if("unattended"===H&&l&&!M&&!await (0,Q.Z)(S("session.unattendedConfirm")))return void et(S("chat.notStartedYet"));let i=await r.FH.start(n.threadId,H);i.started||et(S("chat.notStarted",{reason:null!=(t=i.reason)?t:""}))}catch(e){et(e.message)}finally{X(!1),eS(),eN(),k()}}},eA=async e=>{if(I&&!J&&await (0,Q.Z)(S("chat.rewindConfirm",{n:I.tasks.length-I.tasks.indexOf(e)}))){X(!0),et("");try{var t;let l=await r.FH.chatRewind(I.id,e.id);V(l.text),et(S("chat.rewound")),null==(t=ew.current)||t.focus()}catch(e){et(e.message)}finally{X(!1),eS(),k()}}},eW=async e=>{if(I){E(t=>{var l;if(!t)return t;let{review:a,workerModel:s,workerManualModel:n,...i}=e;return{...t,...i,...a?{review:{...null!=(l=t.review)?l:{enabled:!0,model:""},...a}}:{},...t.lead&&(void 0!==s||void 0!==n)?{lead:{...t.lead,workerManualModel:n||void 0,workerModel:n?void 0:s||void 0}}:{}}});try{await r.FH.updateSession(I.id,e)}catch(e){et(e.message)}finally{eS()}}},eR=async e=>{if(!I)return void er(e);await eW(e===ee.u?{model:"",manualModel:!0}:{model:e,manualModel:!1})},eT=I?!!I.lead:_,eD=I?(null==(l=I.lead)?void 0:l.workerManualModel)?ee.u:null!=(f=null==(n=I.lead)?void 0:n.workerModel)?f:"":$,e_=async e=>{if(!I)return void Z(e);await eW(e===ee.u?{workerModel:"",workerManualModel:!0}:{workerModel:e,workerManualModel:!1})},eP=async()=>{eb(!0),et(S("chat.modelsReading"));try{en(await r.FH.refreshModels()),et(S("chat.modelsRead"))}catch(e){et(e.message)}finally{eb(!1)}},e$=I?"approve"===I.planMode:W,eZ=async e=>{if(!I){R(e),ep(ed,e?"on":"");return}await eW({planMode:e?"approve":"off"})},eB=I?(null==(i=I.review)?void 0:i.enabled)!==!1:T,eK=async e=>{if(!I){D(e),ep(eu,e?"":"off");return}await eW({review:{enabled:e}})},eU=eg&&!!(null==I?void 0:I.paused),eV=async()=>{if(!I)return;let e=!I.paused;E(t=>t?{...t,paused:e}:t);try{await (e?r.FH.pause(I.id):r.FH.resume(I.id))}catch(e){et(e.message)}finally{eS()}},eJ=null==I?void 0:I.tasks.at(-1),eX=null==eJ||null==(u=eJ.lead)||null==(d=u.rounds.filter(e=>e.subtask).at(-1))?void 0:d.subtask;(0,s.useEffect)(()=>{C(z?I&&eJ?eX&&eL?{sessionId:eL,taskId:eX.taskId}:{sessionId:I.id,taskId:eJ.id}:null:"new")},[z,null==I?void 0:I.id,null==eJ?void 0:eJ.id,null==eX?void 0:eX.taskId,eL]);let{ref:eY}=G(!0,"".concat(null!=(x=null==I?void 0:I.tasks.length)?x:0,":").concat(null!=(b=null==eJ?void 0:eJ.status)?b:"",":").concat(null!=(w=null==eJ?void 0:eJ.iterations)?w:0));return(0,a.jsxs)("div",{className:"cs",children:[(0,a.jsxs)("div",{className:"cs-head",children:[(0,a.jsx)("label",{htmlFor:"cs-thread",className:"sr-only",children:S("chat.thread")}),(0,a.jsxs)("select",{id:"cs-thread",dir:"auto",value:z,onChange:e=>eq(e.target.value),children:[(0,a.jsx)("option",{value:"",children:S("chat.newThread")}),O.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name.replace(/^chat: /,"")},e.id))]}),(0,a.jsxs)("span",{className:"cs-new-wrap",children:[(0,a.jsx)("button",{type:"button",className:"cs-new","aria-disabled":!!eE||void 0,"aria-describedby":eE?"cs-new-tip":void 0,onClick:()=>{var e;eE||(eq(""),E(null),null==(e=ew.current)||e.focus())},title:eE?void 0:S("chat.newChatWhy"),children:S("chat.newChat")}),eE&&(0,a.jsx)("span",{id:"cs-new-tip",role:"tooltip",className:"cs-new-tip",children:eE})]})]}),(0,a.jsxs)("div",{className:"cs-body",ref:eY,"aria-live":"polite",children:[I?I.tasks.map(e=>I.lead?(0,a.jsx)(eC,{session:I,task:e,worker:B,approvals:el,onDecided:eO,onOpenFile:y,onRewind:eg||J?void 0:()=>void eA(e)},e.id):(0,a.jsx)(ev,{session:I,task:e,approvals:el.filter(t=>t.taskId===e.id),onDecided:eO,onOpenFile:y,onRewind:eg||J?void 0:()=>void eA(e)},e.id)):(0,a.jsx)(ex,{workspace:v,onPick:e=>{var t;V(e),null==(t=ew.current)||t.focus()},onOpenFolder:N}),eU&&(0,a.jsx)("p",{className:"cs-system cs-paused",role:"status",children:S("chat.pausedNote")}),Y&&(0,a.jsx)("p",{className:"cs-system",role:"status",children:Y})]}),(0,a.jsxs)("div",{className:"cs-compose",children:[(0,a.jsx)("label",{htmlFor:"cs-input",className:"sr-only",children:S("chat.input")}),(0,a.jsx)("textarea",{id:"cs-input",ref:ew,value:U,onChange:e=>V(e.target.value),placeholder:eg?S("chat.placeholderRunning"):(null==v?void 0:v.ok)?S("chat.placeholder",{folder:v.name}):S("chat.placeholderNoFolder"),disabled:J||!(null==v?void 0:v.ok),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),eH())}}),eT?(0,a.jsxs)("div",{className:"cs-models",children:[(0,a.jsx)("span",{className:"cs-pick-label","aria-hidden":"true",children:S("chat.leadModel")}),(0,a.jsx)("div",{className:"cs-bar",children:eI("90%")}),(0,a.jsx)("label",{htmlFor:"cs-worker-model",className:"cs-pick-label",children:S("chat.workerModel")}),(0,a.jsx)("div",{className:"cs-bar",children:(0,a.jsx)(ee.Yb,{id:"cs-worker-model",chosen:eD,onChange:e=>void e_(e),byHand:S("chat.modelByHand"),none:S("chat.workerSameModel"),catalogue:es,disabled:eg,style:{minWidth:0,maxWidth:"90%"}})})]}):(0,a.jsx)("div",{className:"cs-bar",children:eI("48%")}),(0,a.jsxs)("div",{className:"cs-bar",children:[(0,a.jsx)("label",{htmlFor:"cs-mode",className:"sr-only",children:S("chat.mode")}),(0,a.jsxs)("select",{id:"cs-mode",value:H,onChange:e=>{let t=e.target.value;A(t),ep(eo,t)},disabled:eg,title:S("chat.modeWhy"),children:[(0,a.jsx)("option",{value:"confirm",children:S("chat.modeAsk")}),(0,a.jsx)("option",{value:"unattended",children:S("chat.modeAuto")})]}),(0,a.jsxs)("label",{className:"cs-plan-toggle",title:S("chat.planModeWhy"),children:[(0,a.jsx)("input",{type:"checkbox",checked:e$,disabled:eg,onChange:e=>void eZ(e.target.checked)}),(0,a.jsx)("span",{children:S("chat.planMode")})]}),(0,a.jsxs)("label",{className:"cs-plan-toggle cs-lead-toggle",title:S("chat.leadWhy"),children:[(0,a.jsx)("input",{type:"checkbox",checked:eT,disabled:eg||!!I,onChange:e=>{var t;return t=e.target.checked,void(!I&&(P(t),ep(eh,t?"on":"")))}}),(0,a.jsx)("span",{children:S("chat.lead")})]}),!eT&&(0,a.jsxs)("label",{className:"cs-plan-toggle cs-review-toggle",title:S("chat.reviewWhy"),children:[(0,a.jsx)("input",{type:"checkbox",checked:eB,disabled:eg,onChange:e=>void eK(e.target.checked)}),(0,a.jsx)("span",{children:S("chat.review")})]}),(0,a.jsxs)("span",{className:"cs-actions",children:[eg&&(0,a.jsx)("button",{type:"button",className:"cs-pause",onClick:()=>void eV(),title:eU?S("chat.resumeWhy"):S("chat.pauseWhy"),children:eU?S("chat.resume"):S("chat.pause")}),eg&&(0,a.jsx)("button",{type:"button",className:"danger",onClick:()=>{I&&r.FH.stop(I.id).then(()=>et(S("chat.stopping"))).catch(e=>et(e.message))},children:S("chat.stop")}),(0,a.jsx)("button",{type:"button",className:"primary",disabled:J||!U.trim()||!(null==v?void 0:v.ok),onClick:()=>void eH(),title:S("chat.sendWhy"),children:eg?S("chat.sendNote"):S("chat.send")})]})]})]})]})}function ex(e){var t;let{workspace:l,onPick:s,onOpenFolder:n}=e,{t:i}=(0,o.kj)();if(!l)return(0,a.jsx)("p",{className:"muted small",children:i("wb.loading")});if(!l.ok)return(0,a.jsxs)("div",{className:"cs-welcome",children:[(0,a.jsx)("p",{children:l.problem}),(0,a.jsx)("button",{type:"button",className:"primary",onClick:n,children:i("chat.openFolder")})]});let r=[i("chat.example1"),i("chat.example2"),i("chat.example3")];return(0,a.jsxs)("div",{className:"cs-welcome",children:[(0,a.jsx)("h3",{children:i("chat.welcome",{folder:l.name})}),(0,a.jsx)("p",{className:"muted small",children:i("chat.welcomeWhy",{dir:l.dir,branch:null!=(t=l.branch)?t:"—"})}),(0,a.jsx)("ul",{className:"cs-examples",children:r.map(e=>(0,a.jsx)("li",{children:(0,a.jsx)("button",{type:"button",className:"linkish",onClick:()=>s(e),children:e})},e))})]})}function eb(e,t){var l;let[a,n]=(0,s.useState)(null),i=(null==t?void 0:t.status)==="running"||(null==t?void 0:t.status)==="waiting-approval",o=()=>t&&(t.startedAt||i)?r.FH.taskStory(e,t.id,t.runId).then(n).catch(()=>void 0):Promise.resolve();(0,s.useEffect)(()=>{o()},[e,null==t?void 0:t.id,null==t?void 0:t.runId,null==t?void 0:t.status]),(0,c.z)(o,i?1500:6e4,!!i);let d=[],u=e=>e.forEach(e=>"review"===e.kind?u(e.entries):d.push(e));return u(null!=(l=null==a?void 0:a.entries)?l:[]),d}function ew(e){let{entries:t}=e;return(0,a.jsx)(a.Fragment,{children:t.map((e,t)=>{var l;return"reply"===e.kind?(null==(l=e.notes)?void 0:l.trim())?(0,a.jsxs)("div",{className:"cs-bot",children:[(0,a.jsx)(en,{text:e.notes}),(0,a.jsx)("div",{className:"cs-copy-row",children:(0,a.jsx)(el,{text:e.notes,what:"chat.copyReply"})})]},t):null:"step"===e.kind?(0,a.jsx)(ek,{step:e},t):null})})}function ev(e){var t,l,s,n;let{session:i,task:c,approvals:d,onDecided:u,onOpenFile:h,onRewind:p}=e,{t:m}=(0,o.kj)(),f="running"===c.status||"waiting-approval"===c.status,x=eb(i.id,c);return(0,a.jsxs)("section",{className:"cs-turn",id:"cs-turn-".concat(c.id),"aria-label":m("chat.turn",{text:c.title}),children:[(0,a.jsxs)("div",{className:"cs-user-row",children:[p&&(c.checkpoint||"queued"===c.status)&&(0,a.jsx)("button",{type:"button",className:"wb-icon-btn cs-rewind",onClick:p,title:m("chat.rewind"),"aria-label":m("chat.rewind"),children:"↶"}),(0,a.jsxs)("div",{className:"cs-user",children:[(0,a.jsx)(ey,{children:(0,a.jsx)(en,{text:c.prompt})}),(0,a.jsx)("div",{className:"cs-copy-row",children:(0,a.jsx)(el,{text:c.prompt,what:"chat.copyMessage"})})]})]}),"queued"===c.status&&(0,a.jsx)("p",{className:"muted small cs-system",children:m("idle"===i.status?"chat.queued":"chat.waitingTurn")}),(0,a.jsx)(ew,{entries:x}),(null==(t=c.plan)?void 0:t.approved)&&!d.some(e=>e.plan)&&(0,a.jsxs)("details",{className:"cs-plan",children:[(0,a.jsx)("summary",{children:m("chat.planShown",{v:c.plan.version})}),(0,a.jsx)(er.D,{plan:c.plan})]}),d.map(e=>(0,a.jsx)(eN,{approval:e,onDecided:u},e.id)),f&&(0,a.jsxs)("p",{className:"cs-working",role:"status",children:[(0,a.jsx)("span",{className:"wb-live","aria-hidden":"true"})," ",m("chat.working",{n:c.iterations})]}),!f&&"queued"!==c.status&&(0,a.jsx)(eg,{task:c}),c.runId&&(0,a.jsx)("div",{className:"cs-exchange",children:(0,a.jsx)("a",{className:"button-link quiet small",href:r.FH.taskExchangeUrl(i.id,c.id),download:!0,title:m("chat.exchangeWhy"),children:m("chat.exchange")})}),(null!=(n=null==(s=c.vcs)||null==(l=s.files)?void 0:l.length)?n:0)>0&&!f&&(0,a.jsxs)("div",{className:"cs-files",children:[(0,a.jsx)("span",{className:"small",children:m("chat.changed",{n:c.vcs.files.length})}),c.vcs.files.slice(0,12).map(e=>(0,a.jsxs)("button",{type:"button",className:"cs-file",onClick:()=>h(e.path),title:e.path,children:[(0,a.jsx)(E,{path:e.path})," ",e.path.split("/").pop()," ",(0,a.jsx)("span",{className:"muted",children:e.added>=0?"+".concat(e.added," −").concat(e.removed):""})]},e.path)),(0,a.jsx)(K,{sessionId:i.id,taskId:c.id,runId:c.runId,title:c.title,files:c.vcs.files.length})]})]})}function eg(e){let{task:t}=e,l=(0,s.useRef)(null),[n,i]=(0,s.useState)(!1),r=[t.summary,"done"!==t.status?t.reason:""].filter(Boolean).join("\n\n");return(0,s.useEffect)(()=>{let e=l.current;if(!e)return;let t=()=>{let t=window.getComputedStyle(e),l=parseFloat(t.lineHeight)||1.45*parseFloat(t.fontSize);i(e.scrollHeight>l*ej)};t();let a=new ResizeObserver(t);return a.observe(e),()=>a.disconnect()},[]),(0,a.jsxs)("div",{className:"cs-end s-".concat(t.status),children:[(0,a.jsx)(e0,{status:t.status}),(0,a.jsxs)("div",{className:"grow",ref:l,children:[t.summary?(0,a.jsx)(en,{text:t.summary}):null,"done"!==t.status&&t.reason?(0,a.jsx)("p",{className:"small",children:t.reason}):null,r&&n&&(0,a.jsx)("div",{className:"cs-copy-row cs-copy-bottom",children:(0,a.jsx)(el,{text:r,what:"chat.copySummary"})})]}),r&&(0,a.jsx)(el,{text:r,what:"chat.copySummary"})]})}let ej=6;function ey(e){let{children:t}=e,{t:l}=(0,o.kj)(),n=(0,s.useRef)(null),[i,r]=(0,s.useState)(0),[c,d]=(0,s.useState)(!1),[u,h]=(0,s.useState)(!1);(0,s.useEffect)(()=>{let e=n.current;if(!e)return;let t=()=>{let t=window.getComputedStyle(e),l=parseFloat(t.lineHeight)||1.45*parseFloat(t.fontSize),a=Math.round(3*l);r(a),d(e.scrollHeight>a+.6*l)};t();let l=new ResizeObserver(t);return l.observe(e),()=>l.disconnect()},[]);let p=c&&!u;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{ref:n,className:"cs-fold".concat(p?" folded":""),style:p?{maxHeight:i}:void 0,children:[t,p&&(0,a.jsxs)("div",{className:"cs-fold-blur","aria-hidden":"true",children:[(0,a.jsx)("span",{}),(0,a.jsx)("span",{}),(0,a.jsx)("span",{})]})]}),c&&(0,a.jsx)("button",{type:"button",className:"cs-fold-toggle","aria-expanded":u,"aria-label":l(u?"chat.foldClose":"chat.foldOpen"),title:l(u?"chat.foldClose":"chat.foldOpen"),onClick:()=>h(!u),children:u?"▴":"▾"})]})}function ek(e){let{step:t}=e,{t:l}=(0,o.kj)(),n=!t.outcome,[i,r]=(0,s.useState)(null),c=null!=i?i:n||t.failed;return(0,a.jsxs)("div",{className:"cs-cmd".concat(t.failed?" bad":""),children:[(0,a.jsxs)("div",{className:"cs-cmd-row",children:[(0,a.jsxs)("button",{type:"button",className:"cs-cmd-head","aria-expanded":c,onClick:()=>r(!c),children:[(0,a.jsx)("span",{className:"cs-cmd-ico","aria-hidden":"true",children:n?"⟳":t.failed?"✗":"✓"}),(0,a.jsx)("code",{className:"wb-row-name",children:t.command}),(0,a.jsx)("span",{className:"muted small",children:n?l("chat.running"):void 0!==t.exitCode?l("chat.exit",{code:t.exitCode}):t.outcome})]}),(0,a.jsx)(el,{text:t.output?"$ ".concat(t.command,"\n").concat(t.output):t.command,what:"chat.copyCommand"})]}),c&&t.output&&(0,a.jsx)("pre",{className:"cs-out",children:t.output})]})}function eN(e){let{approval:t,onDecided:l}=e,{t:n}=(0,o.kj)(),[i,c]=(0,s.useState)(!1),d=async e=>{c(!0);let a=!1;try{await r.FH.decide(t.id,e),a=!0}finally{c(!1),l(t.id,a)}};return t.plan?(0,a.jsx)("div",{className:"cs-plan-ask",children:(0,a.jsx)(ei.M,{approval:t,onDecided:e=>l(t.id,e)})}):t.question?(0,a.jsx)(eM,{approval:t,onDecided:l}):t.model?(0,a.jsx)("p",{className:"cs-system small",children:n("chat.lookAbove")}):(0,a.jsxs)("div",{className:"cs-ask",role:"group","aria-label":n("chat.askTitle"),children:[(0,a.jsx)("p",{className:"small",children:(0,a.jsx)("strong",{children:n("chat.askTitle")})}),(0,a.jsx)("pre",{className:"cs-out",children:t.description}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("button",{type:"button",className:"primary",disabled:i,onClick:()=>void d("run"),children:n("chat.askRun")}),!t.network&&(0,a.jsx)("button",{type:"button",disabled:i,onClick:()=>void d("run-all"),children:n("chat.askRunAll")}),(0,a.jsx)("button",{type:"button",disabled:i,onClick:()=>void d("skip"),children:n("chat.askSkip")})]})]})}function eC(e){var t,l,n,i,c,d,u,h,p,m,f,x,b;let{session:w,task:v,worker:g,approvals:j,onDecided:y,onOpenFile:k,onRewind:N}=e,{t:C}=(0,o.kj)(),S="running"===v.status||"waiting-approval"===v.status,F=null!=(m=null==(t=v.lead)?void 0:t.rounds)?m:[],M=null==(l=F.filter(e=>"plan"===e.status).at(-1))?void 0:l.n,O=j.filter(e=>e.taskId===v.id),L=(null==(n=F.at(-1))?void 0:n.subtask)&&(null==g?void 0:g.tasks.find(e=>{var t,l;return e.id===(null==(l=F.at(-1))||null==(t=l.subtask)?void 0:t.taskId)&&("running"===e.status||"waiting-approval"===e.status)}));return(0,a.jsxs)("section",{className:"cs-turn cs-lead-turn",id:"cs-turn-".concat(v.id),"aria-label":C("chat.turn",{text:v.title}),children:[(0,a.jsxs)("div",{className:"cs-user-row",children:[N&&(v.checkpoint||"queued"===v.status)&&(0,a.jsx)("button",{type:"button",className:"wb-icon-btn cs-rewind",onClick:N,title:C("chat.rewind"),"aria-label":C("chat.rewind"),children:"↶"}),(0,a.jsxs)("div",{className:"cs-user",children:[(0,a.jsx)(ey,{children:(0,a.jsx)(en,{text:v.prompt})}),(0,a.jsx)("div",{className:"cs-copy-row",children:(0,a.jsx)(el,{text:v.prompt,what:"chat.copyMessage"})})]})]}),"queued"===v.status&&(0,a.jsx)("p",{className:"muted small cs-system",children:"idle"===w.status?C("chat.queued"):C("chat.waitingTurn")}),F.map(e=>{var t;return(0,a.jsxs)(s.Fragment,{children:[e.understanding&&(0,a.jsx)(eS,{who:C("lead.understood"),text:e.understanding}),e.notes&&(0,a.jsx)(eS,{who:C("lead.who"),text:e.notes}),"plan"===e.status&&e.n===M&&v.plan&&!O.some(e=>e.plan)&&(0,a.jsxs)("details",{className:"cs-plan",children:[(0,a.jsx)("summary",{children:C("lead.plan",{v:v.plan.version})}),(0,a.jsx)(er.D,{plan:v.plan})]}),e.subtask&&(0,a.jsx)(eF,{round:e,worker:g,approvals:j.filter(t=>{var l;return t.taskId===(null==(l=e.subtask)?void 0:l.taskId)}),onDecided:y,onOpenFile:k}),(null==(t=e.question)?void 0:t.answer)!==void 0&&(0,a.jsxs)("div",{className:"cs-bot cs-lead-qa",children:[(0,a.jsx)("p",{className:"cs-who",children:C("lead.question")}),(0,a.jsx)(en,{text:e.question.text}),(0,a.jsx)("p",{className:"cs-who",children:C("lead.answered")}),(0,a.jsx)(en,{text:e.question.answer})]})]},e.n)}),O.map(e=>(0,a.jsx)(eN,{approval:e,onDecided:y},e.id)),S&&(0,a.jsxs)("p",{className:"cs-working",role:"status",children:[(0,a.jsx)("span",{className:"wb-live","aria-hidden":"true"})," ",L?C("lead.working",{n:null!=(f=null==(c=F.at(-1))||null==(i=c.subtask)?void 0:i.n)?f:0}):C("lead.thinking"),v.lead?(0,a.jsxs)("span",{className:"muted small",children:[" \xb7 ",C("lead.subtasks",{n:v.lead.subtasks,max:v.lead.maxSubtasks})]}):null]}),!S&&"queued"!==v.status&&(0,a.jsx)(eg,{task:v}),!S&&(null!=(x=null==(u=v.lead)||null==(d=u.evidence)?void 0:d.length)?x:0)>0&&(0,a.jsxs)("div",{className:"cs-evidence",children:[(0,a.jsx)("p",{className:"cs-who",children:C("lead.evidence")}),(0,a.jsx)("ul",{children:v.lead.evidence.map(e=>(0,a.jsx)("li",{children:(0,a.jsx)(en,{text:e})},e))})]}),v.runId&&(0,a.jsx)("div",{className:"cs-exchange",children:(0,a.jsx)("a",{className:"button-link quiet small",href:r.FH.taskExchangeUrl(w.id,v.id),download:!0,title:C("chat.exchangeWhy"),children:C("chat.exchange")})}),(null!=(b=null==(p=v.vcs)||null==(h=p.files)?void 0:h.length)?b:0)>0&&!S&&(0,a.jsxs)("div",{className:"cs-files",children:[(0,a.jsx)("span",{className:"small",children:C("chat.changed",{n:v.vcs.files.length})}),v.vcs.files.slice(0,12).map(e=>(0,a.jsxs)("button",{type:"button",className:"cs-file",onClick:()=>k(e.path),title:e.path,children:[(0,a.jsx)(E,{path:e.path})," ",e.path.split("/").pop()," ",(0,a.jsx)("span",{className:"muted",children:e.added>=0?"+".concat(e.added," −").concat(e.removed):""})]},e.path)),(0,a.jsx)(K,{sessionId:w.id,taskId:v.id,runId:v.runId,title:v.title,files:v.vcs.files.length})]})]})}function eS(e){let{who:t,text:l}=e;return(0,a.jsxs)("div",{className:"cs-bot cs-lead-say",children:[(0,a.jsx)("p",{className:"cs-who",children:t}),(0,a.jsx)(en,{text:l}),(0,a.jsx)("div",{className:"cs-copy-row",children:(0,a.jsx)(el,{text:l,what:"chat.copyReply"})})]})}function eF(e){var t,l,s,n,i,r;let{round:c,worker:d,approvals:u,onDecided:h,onOpenFile:p}=e,{t:m}=(0,o.kj)(),f=c.subtask,x=null==d?void 0:d.tasks.find(e=>e.id===f.taskId),b=(null==x?void 0:x.status)==="running"||(null==x?void 0:x.status)==="waiting-approval",w=eb(null!=(s=null==d?void 0:d.id)?s:"",x);return(0,a.jsxs)("details",{className:"cs-subtask s-".concat(null!=(n=null==x?void 0:x.status)?n:"queued"),open:b||u.length>0||void 0,children:[(0,a.jsxs)("summary",{children:[(0,a.jsx)(e0,{status:null!=(i=null==x?void 0:x.status)?i:"queued"})," ",(0,a.jsx)("span",{children:m("lead.subtask",{n:f.n,title:f.title})}),f.readOnly&&(0,a.jsx)("span",{className:"badge",children:m("lead.readOnly")}),f.fresh&&(0,a.jsx)("span",{className:"badge",children:m("lead.fresh")})]}),(0,a.jsxs)("div",{className:"cs-subtask-body",children:[(0,a.jsx)(ew,{entries:w}),u.map(e=>(0,a.jsx)(eN,{approval:e,onDecided:h},e.id)),x&&!b&&"queued"!==x.status&&(0,a.jsx)(eg,{task:x}),x&&(null!=(r=null==(l=x.vcs)||null==(t=l.files)?void 0:t.length)?r:0)>0&&!b&&(0,a.jsx)("div",{className:"cs-files",children:x.vcs.files.slice(0,8).map(e=>(0,a.jsxs)("button",{type:"button",className:"cs-file",onClick:()=>p(e.path),title:e.path,children:[(0,a.jsx)(E,{path:e.path})," ",e.path.split("/").pop()]},e.path))})]})]})}function eM(e){let{approval:t,onDecided:l}=e,{t:n}=(0,o.kj)(),i=(0,s.useId)(),[c,d]=(0,s.useState)(""),[u,h]=(0,s.useState)(!1),[p,m]=(0,s.useState)(""),f=t.question,x=async e=>{if(!e.trim())return;h(!0),m("");let a=!1;try{await r.FH.answerQuestion(t.id,e),a=!0}catch(e){m(e.message)}finally{h(!1),l(t.id,a)}},b=async()=>{if(!await (0,Q.Z)(n("lead.stopConfirm")))return;h(!0);let e=!1;try{await r.FH.decide(t.id,"abort"),e=!0}finally{h(!1),l(t.id,e)}};return(0,a.jsxs)("div",{className:"cs-ask cs-question",role:"group","aria-label":n("lead.question"),children:[(0,a.jsx)("p",{className:"small",children:(0,a.jsx)("strong",{children:n("lead.question")})}),(0,a.jsx)(en,{text:f.text}),f.why&&(0,a.jsx)("p",{className:"muted small",children:f.why}),f.options.length>0&&(0,a.jsx)("div",{className:"row cs-options",children:f.options.map(e=>(0,a.jsx)("button",{type:"button",disabled:u,onClick:()=>void x(e),children:e},e))}),(0,a.jsx)("label",{htmlFor:"".concat(i,"-answer"),className:"small",children:n("lead.answer")}),(0,a.jsx)("textarea",{id:"".concat(i,"-answer"),className:"prose",rows:3,value:c,onChange:e=>d(e.target.value),placeholder:n("lead.answerPlaceholder"),disabled:u}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("button",{type:"button",className:"primary",disabled:u||!c.trim(),onClick:()=>void x(c),children:n("lead.send")}),(0,a.jsx)("button",{type:"button",className:"danger",disabled:u,onClick:()=>void b(),children:n("lead.stop")})]}),p&&(0,a.jsx)("p",{className:"err",role:"alert",children:p})]})}function eO(e){let{workspace:t,composeAsk:l,showThread:s,onOpenFile:n,onOpenFolder:i,onTurn:r,onChange:c,onClose:d}=e,{t:u}=(0,o.kj)();return(0,a.jsxs)("div",{className:"wb-chat-inner",children:[(0,a.jsxs)("div",{className:"wb-chat-tabs",role:"tablist","aria-label":u("wb.chatPanel"),children:[(0,a.jsx)("button",{type:"button",role:"tab","aria-selected":!0,className:"on",children:u("wb.chatTab")}),(0,a.jsx)("span",{className:"grow"}),(0,a.jsx)("button",{type:"button",className:"wb-icon-btn","aria-label":u("wb.toggleChat"),title:u("wb.toggleChat"),onClick:d,children:"\xd7"})]}),(0,a.jsx)(ef,{workspace:t,composeAsk:l,showThread:s,onOpenFile:n,onChange:c,onOpenFolder:i,onTurn:r})]})}var eL=l(5462);let ez=[{tab:"terminal",label:"wb.terminal",infoLabel:"wb.terminalInfoLabel",info:"wb.terminalInfo"},{tab:"problems",label:"wb.problems",infoLabel:"wb.problemsInfoLabel",info:"wb.problemsInfo"},{tab:"output",label:"wb.output",infoLabel:"wb.outputInfoLabel",info:"wb.outputInfo"}];function eq(e){let{open:t,onToggle:l,tab:n,onTab:i,session:r,task:c,newChat:d=!1,onShowMessage:u}=e,{t:h}=(0,o.kj)(),p=r?function(e){let t=[];return e.tasks.forEach((l,a)=>{var s,n,i,r;let c="".concat(a+1,". ").concat(l.title),o=function(a,s){var n;let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c;t.push({key:"".concat(e.id,"|").concat(l.id,"|a").concat(null!=(n=l.attempt)?n:1,"|").concat(a,"|").concat(s),taskId:l.id,kind:a,text:s,where:i})};for(let e of null!=(i=l.checkResults)?i:[])e.passed||o("error","".concat(e.name,": ").concat(e.detail.slice(0,160)));if((null==(s=l.review)?void 0:s.verdict)==="fail")for(let e of null!=(r=l.review.findings)?r:[])o("error",e.what.slice(0,200),e.where?"".concat(c," \xb7 ").concat(e.where):c);["failed","blocked","limit-reached","aborted"].includes(l.status)&&l.reason&&o("warn",l.reason.slice(0,200)),(null==(n=l.vcs)?void 0:n.problem)&&o("warn",l.vcs.problem.slice(0,200))}),t}(r):[],[m,f]=(0,s.useState)(()=>new Set),[x,b]=(0,s.useState)(!1);(0,s.useEffect)(()=>f(eE()),[]);let w=e=>f(function(e){let t=[...new Set([...eE(),...e.filter(e=>e)])].slice(-500);try{window.localStorage.setItem(eI,JSON.stringify(t))}catch(e){}return new Set(t)}(e)),v=p.filter(e=>!m.has(e.key)),g=x?p:v,j=p.length-v.length;return(0,a.jsxs)("section",{className:"wb-bottom","aria-label":h("wb.panel"),children:[(0,a.jsxs)("div",{className:"wb-bottom-tabs",role:"tablist","aria-label":h("wb.panel"),children:[ez.map(e=>{let{tab:l,label:r,infoLabel:c,info:o}=e;return(0,a.jsxs)(s.Fragment,{children:[(0,a.jsxs)("button",{type:"button",role:"tab","aria-selected":t&&n===l,className:t&&n===l?"on":"",onClick:()=>i(l),children:[h(r),"problems"===l&&v.length>0&&(0,a.jsx)("span",{className:"wb-badge",children:v.length})]}),(0,a.jsx)(eL.q,{label:h(c),text:h(o)})]},l)}),(0,a.jsx)("span",{className:"grow"}),(0,a.jsx)("button",{type:"button",className:"wb-icon-btn","aria-label":h("wb.cmdPanel"),title:"".concat(h("wb.cmdPanel")," (Ctrl+J)"),onClick:l,children:t?"▾":"▴"})]}),t&&(0,a.jsx)("div",{className:"wb-bottom-body",role:"tabpanel",children:"terminal"===n?d?(0,a.jsx)("p",{className:"muted small wb-pad",children:h("wb.newChatTerminal")}):(0,a.jsx)(eH,{session:r,task:c}):"problems"===n?0===p.length?(0,a.jsx)("p",{className:"muted small wb-pad",children:d?h("wb.newChatProblems"):r?h("wb.noProblems"):h("wb.pickChat")}):(0,a.jsxs)(a.Fragment,{children:[0===g.length?(0,a.jsx)("p",{className:"muted small wb-pad",children:h("wb.problemsNoneNew")}):(0,a.jsx)("ul",{className:"wb-problems",children:g.map(e=>(0,a.jsxs)("li",{className:m.has(e.key)?"seen":void 0,children:[(0,a.jsxs)("button",{type:"button",className:"wb-row",onClick:()=>u(e.taskId),title:h("wb.problemShow"),children:[(0,a.jsx)("span",{className:"wb-sev ".concat(e.kind),"aria-hidden":"true",children:"error"===e.kind?"✗":"⚠"}),(0,a.jsx)("span",{className:"wb-row-name",children:e.text}),(0,a.jsx)("span",{className:"muted",children:e.where})]}),!m.has(e.key)&&(0,a.jsx)("button",{type:"button",className:"quiet small wb-seen",onClick:()=>w([e.key]),title:h("wb.problemSeenWhy"),children:h("wb.problemSeen")})]},e.key))}),(v.length>1||j>0)&&(0,a.jsxs)("div",{className:"row wb-pad",children:[v.length>1&&(0,a.jsx)("button",{type:"button",className:"quiet small",onClick:()=>w(v.map(e=>e.key)),title:h("wb.problemSeenWhy"),children:h("wb.problemsAllSeen")}),j>0&&(0,a.jsx)("button",{type:"button",className:"quiet small",onClick:()=>b(!x),children:x?h("wb.problemsHideSeen"):h("wb.problemsShowSeen",{n:j})})]})]}):d?(0,a.jsx)("p",{className:"muted small wb-pad",children:h("wb.newChatOutput")}):(0,a.jsx)(eA,{session:r})})]})}let eI="cop.problems.seen";function eE(){try{var e;let t=JSON.parse(null!=(e=window.localStorage.getItem(eI))?e:"[]");return new Set(Array.isArray(t)?t.filter(e=>"string"==typeof e):[])}catch(e){return new Set}}function eH(e){var t,l;let{session:n,task:i}=e,{t:d}=(0,o.kj)(),[u,h]=(0,s.useState)(null),p=(null==i?void 0:i.status)==="running"||(null==i?void 0:i.status)==="waiting-approval",{ref:m}=G(!!p,null!=(t=null==u?void 0:u.entries.length)?t:0),f=()=>n&&i&&(i.startedAt||p)?r.FH.taskStory(n.id,i.id,i.runId).then(h).catch(()=>void 0):Promise.resolve();if((0,s.useEffect)(()=>{h(null),f()},[null==i?void 0:i.id,null==i?void 0:i.runId]),(0,c.z)(f,p?2e3:15e3,!!n&&!!i),!i)return(0,a.jsx)("p",{className:"muted small wb-pad",children:d("wb.pickChat")});let x=[],b=e=>e.forEach(e=>"step"===e.kind?x.push(e):"review"===e.kind?b(e.entries):void 0);return(b(null!=(l=null==u?void 0:u.entries)?l:[]),0===x.length)?(0,a.jsx)("p",{className:"muted small wb-pad",children:u?d("wb.noSteps"):d("wb.loading")}):(0,a.jsx)("div",{ref:m,className:"wb-terminal","aria-live":"off",children:x.map((e,t)=>(0,a.jsxs)("div",{className:e.failed?"bad":"",children:[(0,a.jsxs)("div",{className:"wb-cmd",children:[(0,a.jsx)("span",{"aria-hidden":"true",children:"$ "}),e.command,(0,a.jsxs)("span",{className:"muted",children:[" ",e.outcome?"".concat(e.outcome).concat(void 0!==e.exitCode?" (".concat(e.exitCode,")"):""):d("wb.runningNow")]})]}),e.output&&(0,a.jsx)("pre",{children:e.output})]},t))})}function eA(e){let{session:t}=e,{t:l}=(0,o.kj)(),n=(0,o.W3)(),[i,d]=(0,s.useState)([]),{ref:u}=G(!0,i.length),h=()=>t?r.FH.sessionEvents(t.id).then(d).catch(()=>void 0):Promise.resolve();return((0,s.useEffect)(()=>{d([]),h()},[null==t?void 0:t.id]),(0,c.z)(h,3e3,!!t),t)?(0,a.jsx)("div",{ref:u,className:"wb-terminal",children:0===i.length?(0,a.jsx)("p",{className:"muted small",children:l("wb.noEvents")}):i.map((e,t)=>{var l;return(0,a.jsxs)("div",{className:"error"===e.level?"bad":"warn"===e.level?"warnline":"",children:[(0,a.jsxs)("span",{className:"muted",children:[n(e.at)," "]}),null!=(l=e.message)?l:e.type]},t)})}):(0,a.jsx)("p",{className:"muted small wb-pad",children:l("wb.pickChat")})}function eW(e){var t,l;let{sessions:n,session:i,workspace:d,onShowThread:u}=e,{t:h}=(0,o.kj)(),p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,[l,a]=(0,s.useState)(()=>Date.now());return(0,s.useEffect)(()=>{if(!e)return;a(Date.now());let l=window.setInterval(()=>a(Date.now()),t);return()=>window.clearInterval(l)},[e,t]),l}(!0,5e3),[m,f]=(0,s.useState)(0),[x,b]=(0,s.useState)({iterations:60,minutes:240});(0,s.useEffect)(()=>{r.FH.settings().then(e=>{var t,l,a;let s=null!=(t=e.raw.limits)?t:{};b({iterations:null!=(l=s.maxIterations)?l:60,minutes:null!=(a=s.maxRunMinutes)?a:240})}).catch(()=>void 0)},[]),(0,c.z)(()=>r.FH.approvals().then(e=>f(e.length)).catch(()=>void 0),3e3);let w=n.find(e=>"idle"!==e.status),v=null==w?void 0:w.tasks.find(e=>"running"===e.status||"waiting-approval"===e.status),g=(null==v?void 0:v.startedAt)?Math.floor((p-Date.parse(v.startedAt))/6e4):0;return(0,a.jsxs)("footer",{className:"wb-statusbar","aria-label":h("wb.status"),children:[(null==d?void 0:d.ok)&&(0,a.jsxs)("span",{title:d.dir,children:[(0,a.jsx)(H.O,{})," ",d.branch?"".concat(d.name," \xb7 ").concat(d.branch):d.name]}),w&&v?(0,a.jsxs)("button",{type:"button",className:"wb-status-btn",onClick:()=>u(w.id),title:h("wb.openRunning"),children:[(0,a.jsx)("span",{className:w.paused?"wb-live paused":"wb-live","aria-hidden":"true"})," ",h("wb.runningLine",{session:w.name.replace(/^chat: /,""),task:v.title,n:v.iterations,max:x.iterations,m:g,maxm:x.minutes}),w.paused&&(0,a.jsxs)("strong",{className:"wb-paused",children:[" \xb7 ",h("wb.pausedTag")]})]}):(0,a.jsx)("span",{children:h("wb.idle")}),(0,a.jsx)("span",{className:"grow"}),m>0&&(0,a.jsx)("button",{type:"button",className:"wb-status-btn warn",onClick:()=>{var e;return null==(e=document.querySelector(".approval-banner"))?void 0:e.scrollIntoView({block:"start"})},children:h("wb.waiting",{n:m})}),i&&(0,a.jsx)("span",{title:h("wb.modelNow"),children:null!=(l=null!=(t=i.modelInUse)?t:i.model)?l:h("wb.modelDefault")})]})}var eR=l(1702);function eT(e){let{commands:t,onClose:l}=e,{t:n}=(0,o.kj)(),i=(0,eR.useRouter)(),[r,c]=(0,s.useState)(""),[d,u]=(0,s.useState)(0),h=(0,s.useRef)(null);(0,s.useEffect)(()=>{var e;return null==(e=h.current)?void 0:e.focus()},[]);let p=(0,s.useMemo)(()=>{let e=r.toLowerCase().split(/\s+/).filter(Boolean);return t.filter(t=>e.every(e=>{var l;return"".concat(t.label," ").concat(null!=(l=t.hint)?l:"").toLowerCase().includes(e)})).slice(0,60)},[r,t]),m=0===p.length?-1:Math.min(d,p.length-1),f=e=>{var t;e&&(l(),e.href?i.push(e.href):null==(t=e.run)||t.call(e))};return(0,a.jsx)("div",{className:"modal-backdrop",role:"presentation",onClick:l,children:(0,a.jsxs)("div",{className:"wb-palette",role:"dialog","aria-modal":"true","aria-label":n("wb.palette"),onClick:e=>e.stopPropagation(),children:[(0,a.jsx)("input",{ref:h,type:"text",role:"combobox","aria-expanded":"true","aria-controls":"wb-palette-list","aria-activedescendant":m>=0?"wb-cmd-".concat(m):void 0,"aria-label":n("wb.palette"),placeholder:n("wb.palettePlaceholder"),value:r,onChange:e=>{c(e.target.value),u(0)},onKeyDown:e=>{"Escape"===e.key?l():"ArrowDown"===e.key?(e.preventDefault(),u(Math.min(p.length-1,m+1))):"ArrowUp"===e.key?(e.preventDefault(),u(Math.max(0,m-1))):"Enter"===e.key&&(e.preventDefault(),f(p[m]))}}),(0,a.jsxs)("ul",{id:"wb-palette-list",role:"listbox","aria-label":n("wb.palette"),children:[0===p.length&&(0,a.jsx)("li",{className:"muted small",children:n("wb.paletteNone")}),p.map((e,t)=>(0,a.jsxs)("li",{id:"wb-cmd-".concat(t),role:"option","aria-selected":t===m,className:t===m?"on":"",onMouseEnter:()=>u(t),onClick:()=>f(e),children:[(0,a.jsx)("span",{className:"wb-row-name",children:e.label}),e.hint&&(0,a.jsx)("span",{className:"muted small",children:e.hint})]},e.id))]})]})})}var eD=l(8078);let e_=[{value:"system",label:"theme.system"},{value:"light",label:"theme.light"},{value:"dark",label:"theme.dark"}],eP={small:"ap.sizeSmall",normal:"ap.sizeNormal",large:"ap.sizeLarge",huge:"ap.sizeHuge",giant:"ap.sizeGiant"},e$=[{name:"nightLight",label:"ap.night"},{name:"underlineLinks",label:"ap.links"},{name:"reduceMotion",label:"ap.motion"},{name:"highContrast",label:"ap.contrast"},{name:"strongFocus",label:"ap.focus"}];function eZ(){let{t:e}=(0,o.kj)(),{appearance:t,set:l,reset:s,loaded:n}=(0,eD.KP)(),i=(0,eL.f)("right"),r=eD.Xm.indexOf(t.textSize);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{ref:i.anchor,type:"button",className:"wb-act".concat(i.open?" on":""),"aria-label":e("wb.appearance"),title:e("wb.appearance"),"aria-expanded":i.open,"aria-controls":i.open?i.id:void 0,onClick:i.toggle,children:(0,a.jsxs)("svg",{viewBox:"0 0 24 24",width:"22",height:"22",fill:"none",stroke:"currentColor",strokeWidth:"1.8","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"8.5"}),(0,a.jsx)("path",{d:"M12 3.5a8.5 8.5 0 0 1 0 17z",fill:"currentColor",stroke:"none"})]})}),i.open&&(0,a.jsxs)("div",{ref:i.panel,id:i.id,role:"dialog","aria-label":e("wb.appearance"),className:"pop wb-appear",style:i.style,children:[(0,a.jsx)("p",{className:"pop-title",children:e("wb.appearance")}),(0,a.jsx)("p",{className:"wb-appear-label",id:"".concat(i.id,"-theme"),children:e("ap.theme")}),(0,a.jsx)("div",{className:"segmented",role:"group","aria-labelledby":"".concat(i.id,"-theme"),children:e_.map(s=>(0,a.jsx)("button",{type:"button","aria-pressed":n&&t.theme===s.value,onClick:()=>l({theme:s.value}),children:e(s.label)},s.value))}),(0,a.jsx)("p",{className:"wb-appear-label",id:"".concat(i.id,"-size"),children:e("ap.size")}),(0,a.jsxs)("div",{className:"wb-appear-size",role:"group","aria-labelledby":"".concat(i.id,"-size"),children:[(0,a.jsx)("button",{type:"button","aria-label":e("ap.smaller"),title:e("ap.smaller"),disabled:r<=0,onClick:()=>l({textSize:eD.Xm[r-1]}),children:"A−"}),(0,a.jsx)("span",{"aria-live":"polite",children:e(eP[t.textSize])}),(0,a.jsx)("button",{type:"button","aria-label":e("ap.larger"),title:e("ap.larger"),disabled:r>=eD.Xm.length-1,onClick:()=>l({textSize:eD.Xm[r+1]}),children:"A+"})]}),e$.map(s=>(0,a.jsxs)("label",{className:"wb-appear-aid",children:[(0,a.jsx)("input",{type:"checkbox",checked:t[s.name],onChange:e=>l({[s.name]:e.target.checked})}),(0,a.jsx)("span",{children:e(s.label)})]},s.name)),(0,a.jsx)("div",{className:"row",children:(0,a.jsx)("button",{type:"button",className:"quiet small",onClick:s,children:e("ap.reset")})})]})]})}function eB(){let{t:e,locale:t}=(0,o.kj)(),l=(0,eL.f)("below"),[n,i]=(0,s.useState)(""),c=async()=>{try{let l=await r.FH.kerrigan(t);return l.filled?l:{...l,text:l.text.replace(/⟦([\w.-]+)⟧/g,(t,l)=>e(l))}}catch(t){return i(e("kerrigan.failed",{reason:t.message})),null}},d=async()=>{l.close();let t=await c();if(!t)return;let a=URL.createObjectURL(new Blob([t.text],{type:"text/markdown;charset=utf-8"})),s=document.createElement("a");s.href=a,s.download=t.fileName,s.click(),URL.revokeObjectURL(a),i(e("kerrigan.saved",{name:t.fileName}))},u=async()=>{l.close();let t=await c();t&&i(await et(t.text)?e("kerrigan.copied",{n:t.text.length}):e("kerrigan.copyFailed"))};return(0,a.jsxs)("div",{className:"kerrigan",children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsxs)("button",{ref:l.anchor,type:"button",className:"primary","aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.id:void 0,onClick:()=>{l.open||c(),l.toggle()},children:[e("kerrigan.button")," ",(0,a.jsx)("span",{"aria-hidden":"true",children:"▾"})]}),(0,a.jsx)(eL.q,{label:e("kerrigan.infoLabel"),text:e("kerrigan.info")})]}),l.open&&(0,a.jsxs)("div",{ref:l.panel,id:l.id,role:"menu","aria-label":e("kerrigan.menu"),className:"pop menu",style:l.style,children:[(0,a.jsx)("button",{type:"button",role:"menuitem",onClick:()=>void d(),children:e("kerrigan.save")}),(0,a.jsx)("button",{type:"button",role:"menuitem",onClick:()=>void u(),children:e("kerrigan.copy")})]}),n&&(0,a.jsx)("p",{className:"small",role:"status",children:n})]})}let eK=e=>{var t;return"diff"===e.kind?"d:".concat(e.area,":").concat(null!=(t=e.commit)?t:"",":").concat(e.path):"f:".concat(e.path)},eU={side:290,chat:420,bottom:240,sideOpen:!0,chatOpen:!0,bottomOpen:!0},eV="cop.workbench.layout";function eJ(){return(0,a.jsx)(s.Suspense,{fallback:null,children:(0,a.jsx)(eX,{})})}function eX(){let{t:e}=(0,o.kj)(),[t,l]=(0,s.useState)(null),[n,u]=(0,s.useState)([]),[h,p]=(0,s.useState)(""),[m,f]=(0,s.useState)("files"),[x,b]=(0,s.useState)(""),[w,v]=(0,s.useState)(null),[g,j]=(0,s.useState)(null),[y,k]=(0,s.useState)("terminal"),[N,C]=(0,s.useState)(eU),[S,F]=(0,s.useState)(!1),[M,O]=(0,s.useState)(0),[L,z]=(0,s.useState)(null),[q,I]=(0,s.useState)(new Set),H=(0,s.useCallback)((e,t)=>{I(l=>{if(l.has(e)===t)return l;let a=new Set(l);return t?a.add(e):a.delete(e),a})},[]),W=(0,s.useCallback)(()=>r.FH.sessions().then(e=>l(e.filter(e=>"chat"===e.kind))).catch(()=>void 0),[]);(0,c.z)(W,3e3);let R=(0,s.useCallback)(()=>r.FH.workspace().then(v).catch(()=>void 0),[]);(0,c.z)(R,1e4);let T=(0,s.useCallback)(async()=>{try{var e;let t=await r.FH.browseFolder((null==w?void 0:w.dir)||void 0);if(!t.ok)return;let l=await r.FH.settings();await r.FH.saveSettings({...l.raw,project:{...null!=(e=l.raw.project)?e:{},rootDir:t.path}}),await R()}catch(e){b(e.message)}},[null==w?void 0:w.dir,R]);(0,s.useEffect)(()=>C(function(){try{let e=window.localStorage.getItem(eV);return e?{...eU,...JSON.parse(e)}:eU}catch(e){return eU}}()),[]),(0,s.useEffect)(()=>{try{window.localStorage.setItem(eV,JSON.stringify(N))}catch(e){}},[N]);let D=(0,s.useCallback)(e=>{u(t=>t.some(t=>eK(t)===eK(e))?t:[...t,e]),p(eK(e))},[]),P=async t=>{let l=n.find(e=>eK(e)===t);if((null==l?void 0:l.kind)==="file"&&q.has(l.path)){var a;if(!await (0,Q.Z)(e("ed.closeUnsaved",{name:null!=(a=l.path.split("/").pop())?a:l.path})))return;H(l.path,!1)}u(e=>{let l=e.findIndex(e=>eK(e)===t),a=e.filter(e=>eK(e)!==t);return t===h&&p(a[Math.max(0,l-1)]?eK(a[Math.max(0,l-1)]):""),a})},$=n.find(e=>eK(e)===h),Z=g&&"new"!==g?null==t?void 0:t.find(e=>e.id===g.sessionId):void 0,B=g&&"new"!==g?null==Z?void 0:Z.tasks.find(e=>e.id===g.taskId):void 0,K=e=>C(t=>({...t,...e})),U=()=>{K({chatOpen:!0}),O(e=>e+1)};(0,s.useEffect)(()=>{let e=e=>{if(!(e.ctrlKey||e.metaKey))return;let t=e.key.toLowerCase();"k"===t||"p"===t&&e.shiftKey?(e.preventDefault(),F(!0)):"b"!==t||e.shiftKey?"j"===t?(e.preventDefault(),K({bottomOpen:!N.bottomOpen})):"l"===t&&(e.preventDefault(),U()):(e.preventDefault(),K({sideOpen:!N.sideOpen}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[N]);let V=(0,s.useMemo)(()=>[{id:"chat",label:e("wb.cmdChat"),hint:"Ctrl+L",run:U},{id:"side",label:e("wb.cmdSide"),hint:"Ctrl+B",run:()=>K({sideOpen:!N.sideOpen})},{id:"panel",label:e("wb.cmdPanel"),hint:"Ctrl+J",run:()=>K({bottomOpen:!N.bottomOpen})},{id:"files",label:e("wb.cmdFiles"),run:()=>{K({sideOpen:!0}),f("files")}},{id:"commits",label:e("wb.cmdCommits"),run:()=>{K({sideOpen:!0}),f("commits")}},{id:"problems",label:e("wb.cmdProblems"),run:()=>{K({bottomOpen:!0}),k("problems")}},...[["/defaults","nav.defaults"],["/system","nav.system"]].map(t=>{let[l,a]=t;return{id:"go:".concat(l),label:e("wb.cmdGo",{page:e(a)}),href:l}}),...(null!=t?t:[]).map(t=>({id:"c:".concat(t.id),label:e("wb.cmdThread",{name:t.name.replace(/^chat: /,"")}),run:()=>{K({chatOpen:!0}),z(e=>{var l;return{id:t.id,n:(null!=(l=null==e?void 0:e.n)?l:0)+1}})}}))],[t,e,N]),J={"--wb-side":N.sideOpen?"".concat(N.side,"px"):"0px","--wb-chat":N.chatOpen?"".concat(N.chat,"px"):"0px","--wb-bottom":N.bottomOpen?"".concat(N.bottom,"px"):"34px"};return(0,a.jsxs)("div",{className:"wb",style:J,children:[(0,a.jsxs)("header",{className:"wb-top",children:[(0,a.jsx)("span",{className:"wb-brand",children:"copilot-operator"}),(0,a.jsxs)("button",{type:"button",className:"wb-search",onClick:()=>F(!0),title:e("wb.paletteWhy"),children:[(0,a.jsx)("span",{children:e("wb.palette")}),(0,a.jsx)("kbd",{children:"Ctrl+K"})]}),(0,a.jsxs)("nav",{className:"wb-menu","aria-label":e("nav.label"),children:[(0,a.jsx)(i(),{href:"/defaults",children:e("nav.defaults")}),(0,a.jsx)(i(),{href:"/system",children:e("nav.system")}),(0,a.jsx)(d.c,{})]})]}),(0,a.jsxs)("div",{className:"wb-body".concat(N.sideOpen?"":" no-side").concat(N.chatOpen?"":" no-chat"),children:[(0,a.jsx)(eG,{side:m,sideOpen:N.sideOpen,onSide:e=>{e===m&&N.sideOpen?K({sideOpen:!1}):(f(e),K({sideOpen:!0}))},chatOpen:N.chatOpen,onChat:()=>K({chatOpen:!N.chatOpen})}),(0,a.jsx)("aside",{className:"wb-side","aria-label":e("wb.explorer"),hidden:!N.sideOpen,children:(0,a.jsx)(A,{view:m,onOpen:D,workspace:w,onOpenFolder:()=>void T()})}),N.sideOpen&&(0,a.jsx)(eQ,{axis:"x",label:e("wb.resize"),onDrag:e=>K({side:eY(N.side+e,180,560)})}),(0,a.jsxs)("section",{className:"wb-center","aria-label":e("wb.editor"),children:[(0,a.jsxs)("div",{className:"wb-tabs",role:"tablist","aria-label":e("wb.openTabs"),children:[0===n.length&&(0,a.jsx)("span",{className:"muted small wb-tabs-empty",children:e("wb.noTabs")}),n.map(t=>{var l,s;let n=eK(t),i="diff"===t.kind?"".concat(t.path.split("/").pop()," (").concat("commit"===t.area?(null!=(l=t.commit)?l:"").slice(0,7):e("staged"===t.area?"git.index":"git.workingTree"),")"):null!=(s=t.path.split("/").pop())?s:t.path;return(0,a.jsxs)("div",{className:"wb-tab".concat(n===h?" active":""),children:[(0,a.jsxs)("button",{type:"button",role:"tab","aria-selected":n===h,onClick:()=>p(n),title:t.path,children:["diff"===t.kind?(0,a.jsx)("span",{className:"wb-ico","aria-hidden":"true",children:"\xb1"}):(0,a.jsx)(E,{path:t.path}),(0,a.jsx)("span",{className:"wb-tab-label",children:i}),"file"===t.kind&&q.has(t.path)&&(0,a.jsx)("span",{className:"wb-unsaved",title:e("ed.unsaved"),"aria-label":e("ed.unsaved"),children:"●"})]}),(0,a.jsx)("button",{type:"button",className:"wb-tab-close","aria-label":e("wb.closeTab",{name:i}),onClick:()=>void P(n),children:"\xd7"})]},n)})]}),(0,a.jsxs)("div",{className:"wb-editor",role:"tabpanel",children:[$?"diff"===$.kind?(0,a.jsx)(Y,{area:$.area,path:$.path,commit:$.commit},eK($)):null:(0,a.jsx)(e1,{workspace:w,problem:x}),n.map(e=>"file"===e.kind?(0,a.jsx)("div",{className:"wb-file-pane",hidden:eK(e)!==h,children:(0,a.jsx)(_,{path:e.path,onDirty:H})},eK(e)):null)]}),N.bottomOpen&&(0,a.jsx)(eQ,{axis:"y",label:e("wb.resize"),onDrag:e=>K({bottom:eY(N.bottom-e,90,700)})}),(0,a.jsx)(eq,{open:N.bottomOpen,onToggle:()=>K({bottomOpen:!N.bottomOpen}),tab:y,onTab:e=>{k(e),K({bottomOpen:!0})},session:Z,task:B,newChat:"new"===g,onShowMessage:e=>{K({chatOpen:!0}),window.setTimeout(()=>{var t;return null==(t=document.getElementById("cs-turn-".concat(e)))?void 0:t.scrollIntoView({block:"start",behavior:"smooth"})},50)}})]}),N.chatOpen&&(0,a.jsx)(eQ,{axis:"x",label:e("wb.resize"),onDrag:e=>K({chat:eY(N.chat-e,300,820)})}),(0,a.jsx)("aside",{className:"wb-chat","aria-label":e("wb.chatPanel"),hidden:!N.chatOpen,children:(0,a.jsx)(eO,{workspace:w,composeAsk:M,showThread:L,onOpenFile:e=>D({kind:"file",path:e}),onOpenFolder:()=>void T(),onTurn:j,onChange:()=>void W(),onClose:()=>K({chatOpen:!1})})})]}),(0,a.jsx)(eW,{sessions:null!=t?t:[],session:Z,workspace:w,onShowThread:e=>{K({chatOpen:!0}),z(t=>{var l;return{id:e,n:(null!=(l=null==t?void 0:t.n)?l:0)+1}})}}),S&&(0,a.jsx)(eT,{commands:V,onClose:()=>F(!1)})]})}let eY=(e,t,l)=>Math.max(t,Math.min(l,e));function eG(e){let{side:t,sideOpen:l,onSide:s,chatOpen:n,onChat:i}=e,{t:r}=(0,o.kj)(),c=(e,n,i)=>(0,a.jsx)("button",{type:"button",className:"wb-act".concat(l&&t===e?" on":""),"aria-pressed":l&&t===e,"aria-label":n,title:n,onClick:()=>s(e),children:(0,a.jsx)("svg",{viewBox:"0 0 24 24",width:"22",height:"22",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i})});return(0,a.jsxs)("nav",{className:"wb-activity","aria-label":r("wb.views"),children:[c("files",r("wb.viewFiles"),(0,a.jsx)("path",{d:"M4 4h6l2 2h8v14H4z"})),c("commits",r("wb.viewCommits"),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"3"}),(0,a.jsx)("path",{d:"M12 3v6M12 15v6"})]})),(0,a.jsx)("span",{className:"grow"}),(0,a.jsx)("button",{type:"button",className:"wb-act".concat(n?" on":""),"aria-pressed":n,"aria-label":r("wb.toggleChat"),title:"".concat(r("wb.toggleChat")," (Ctrl+L)"),onClick:i,children:(0,a.jsx)("svg",{viewBox:"0 0 24 24",width:"22",height:"22",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinejoin:"round","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M4 5h16v11H9l-5 4z"})})}),(0,a.jsx)(eZ,{})]})}function eQ(e){let{axis:t,label:l,onDrag:n}=e,i=(0,s.useRef)(null);return(0,a.jsx)("div",{className:"wb-split ".concat(t),role:"separator","aria-orientation":"x"===t?"vertical":"horizontal","aria-label":l,tabIndex:0,onPointerDown:e=>{i.current="x"===t?e.clientX:e.clientY,e.target.setPointerCapture(e.pointerId)},onPointerMove:e=>{if(null===i.current)return;let l="x"===t?e.clientX:e.clientY;n(l-i.current),i.current=l},onPointerUp:()=>i.current=null,onKeyDown:e=>{let l=e.shiftKey?40:12;("x"===t&&"ArrowLeft"===e.key||"y"===t&&"ArrowUp"===e.key)&&n(-l),("x"===t&&"ArrowRight"===e.key||"y"===t&&"ArrowDown"===e.key)&&n(l)}})}function e0(e){var t;let{status:l}=e,{t:s}=(0,o.kj)();return(0,a.jsx)("span",{className:"wb-status s-".concat(l),title:s("status.".concat(l)),"aria-label":s("status.".concat(l)),role:"img",children:null!=(t=({done:"✓",failed:"✗",blocked:"⊘","limit-reached":"⏸",aborted:"■",queued:"○",running:"●","waiting-approval":"◐"})[l])?t:"\xb7"})}function e1(e){let{workspace:t,problem:l}=e,{t:s}=(0,o.kj)();return(0,a.jsxs)("div",{className:"wb-welcome",children:[(0,a.jsx)("h2",{children:(null==t?void 0:t.ok)?t.name:s("wb.welcome")}),(0,a.jsx)("p",{className:"muted",children:(null==t?void 0:t.ok)?s("wb.welcomeChat",{dir:t.dir}):s("wb.welcomeWhy")}),l&&(0,a.jsx)("p",{className:"err small",children:l}),(0,a.jsx)(eB,{}),(0,a.jsx)("p",{className:"muted small",children:s("wb.keys")})]})}function e2(){return(0,a.jsx)(eJ,{})}}},e=>{e.O(0,[134,921,808,347,131,358],()=>e(e.s=5704)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[186],{3134:(s,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>t});var r=n(3365),l=n(1521),i=n(5549),d=n(8205);function t(){var s;let{t:e}=(0,d.kj)(),[n,t]=(0,l.useState)(null),[c,a]=(0,l.useState)(null),[h,x]=(0,l.useState)("");(0,l.useEffect)(()=>{i.FH.doctor().then(t).catch(s=>x(s.message)),i.FH.settings().then(a).catch(s=>x(s.message))},[]);let j=null==n?void 0:n.profileHeldBy;return(0,r.jsxs)(r.Fragment,{children:[h&&(0,r.jsx)("div",{className:"panel err",children:h}),(0,r.jsxs)("div",{className:"panel",children:[(0,r.jsx)("h2",{children:e("sys.machine")}),!n&&(0,r.jsx)("div",{className:"muted",children:e("sys.loading")}),n&&(0,r.jsx)("table",{children:(0,r.jsxs)("tbody",{children:[(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:e("sys.version")}),(0,r.jsx)("td",{children:String(null!=(s=n.version)?s:"—")})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:e("sys.node")}),(0,r.jsx)("td",{children:String(n.node)})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:e("sys.edge")}),(0,r.jsx)("td",{children:n.edge?String(n.edge):(0,r.jsx)("span",{className:"err",children:e("sys.edgeMissing")})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:e("sys.profile")}),(0,r.jsxs)("td",{children:[String(n.profileDir)," ",n.profileExists?"":(0,r.jsx)("span",{className:"muted",children:e("sys.profileMissing")})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:e("sys.profileInUse")}),(0,r.jsx)("td",{children:Array.isArray(j)&&j.length>0&&n.botRunning?(0,r.jsx)("span",{className:"muted",children:e("sys.profileBot",{n:j.length})}):Array.isArray(j)&&j.length>0?(0,r.jsx)("span",{className:"err",children:e("sys.profileHeld",{pids:j.join(", ")})}):"unknown"===j?(0,r.jsx)("span",{className:"muted",children:e("sys.profileUnknown")}):e("sys.profileFree")})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:e("sys.desktop")}),(0,r.jsxs)("td",{children:[String(n.desktop)," ",(0,r.jsx)("span",{className:"muted",children:e(n.desktopSynced?"sys.desktopSynced":"sys.desktopLocal")})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:e("sys.cwd")}),(0,r.jsx)("td",{children:String(n.cwd)})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:e("sys.runs")}),(0,r.jsx)("td",{children:String(n.runsDir)})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:e("sys.data")}),(0,r.jsx)("td",{children:String(n.dataDir)})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:e("sys.mode")}),(0,r.jsx)("td",{children:String(n.mode)})]})]})}),(0,r.jsx)("div",{className:"row",style:{marginTop:10},children:(0,r.jsx)("a",{className:"button-link plain",href:i.FH.terminalUrl(),download:!0,children:e("startfail.terminal")})}),(0,r.jsx)("p",{className:"why",children:e("sys.terminalWhy")})]}),(0,r.jsxs)("div",{className:"panel",children:[(0,r.jsx)("h2",{children:e("sys.settings")}),(0,r.jsx)("p",{className:"muted small",children:e("sys.settingsHint",{file:"data/settings.json",example:"run.example.yaml"})}),c&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h3",{children:e("sys.asSaved")}),(0,r.jsx)("pre",{className:"tall",children:JSON.stringify(c.raw,null,2)}),(0,r.jsx)("h3",{children:e("sys.resolved")}),(0,r.jsx)("pre",{children:JSON.stringify(c.resolved,null,2)})]})]}),(0,r.jsxs)("div",{className:"panel",children:[(0,r.jsx)("h2",{children:e("sys.signin")}),(0,r.jsx)("p",{className:"muted small",children:e("sys.signinHint")}),(0,r.jsx)("pre",{children:"npx tsx src/cli.ts login --account you@yourtenant.org"})]})]})}},5323:(s,e,n)=>{Promise.resolve().then(n.bind(n,3134))}},s=>{s.O(0,[921,347,131,358],()=>s(s.s=5323)),_N_E=s.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e={},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var a=t[o]={exports:{}},i=!0;try{e[o](a,a.exports,r),i=!1}finally{i&&delete t[o]}return a.exports}r.m=e,(()=>{var e=[];r.O=(t,o,n,a)=>{if(o){a=a||0;for(var i=e.length;i>0&&e[i-1][2]>a;i--)e[i]=e[i-1];e[i]=[o,n,a];return}for(var f=1/0,i=0;i<e.length;i++){for(var[o,n,a]=e[i],u=!0,c=0;c<o.length;c++)(!1&a||f>=a)&&Object.keys(r.O).every(e=>r.O[e](o[c]))?o.splice(c--,1):(u=!1,a<f&&(f=a));if(u){e.splice(i--,1);var l=n();void 0!==l&&(t=l)}}return t}})(),r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;r.t=function(o,n){if(1&n&&(o=this(o)),8&n||"object"==typeof o&&o&&(4&n&&o.__esModule||16&n&&"function"==typeof o.then))return o;var a=Object.create(null);r.r(a);var i={};e=e||[null,t({}),t([]),t(t)];for(var f=2&n&&o;"object"==typeof f&&!~e.indexOf(f);f=t(f))Object.getOwnPropertyNames(f).forEach(e=>i[e]=()=>o[e]);return i.default=()=>o,r.d(a,i),a}})(),r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((t,o)=>(r.f[o](e,t),t),[])),r.u=e=>"static/chunks/"+e+"."+({12:"f1f4d35b52633e8d",67:"9ed79e2fbfb56f26",77:"a200abef0f5b4a7f",163:"dbd7d36584d0bb37",220:"35531b39410e1a9f",489:"158bbe303a595fba",548:"71ac96c94136659b",584:"6df695c5b86a75aa",714:"1e2338736a70b9c7",747:"d2c1249d736dc03b"})[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={},t="_N_E:";r.l=(o,n,a,i)=>{if(e[o])return void e[o].push(n);if(void 0!==a)for(var f,u,c=document.getElementsByTagName("script"),l=0;l<c.length;l++){var d=c[l];if(d.getAttribute("src")==o||d.getAttribute("data-webpack")==t+a){f=d;break}}f||(u=!0,(f=document.createElement("script")).charset="utf-8",f.timeout=120,r.nc&&f.setAttribute("nonce",r.nc),f.setAttribute("data-webpack",t+a),f.src=r.tu(o)),e[o]=[n];var s=(t,r)=>{f.onerror=f.onload=null,clearTimeout(p);var n=e[o];if(delete e[o],f.parentNode&&f.parentNode.removeChild(f),n&&n.forEach(e=>e(r)),t)return t(r)},p=setTimeout(s.bind(null,void 0,{type:"timeout",target:f}),12e4);f.onerror=s.bind(null,f.onerror),f.onload=s.bind(null,f.onload),u&&document.head.appendChild(f)}})(),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:e=>e},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("nextjs#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="/_next/",(()=>{var e={68:0,353:0};r.f.j=(t,o)=>{var n=r.o(e,t)?e[t]:void 0;if(0!==n)if(n)o.push(n[2]);else if(/^(353|68)$/.test(t))e[t]=0;else{var a=new Promise((r,o)=>n=e[t]=[r,o]);o.push(n[2]=a);var i=r.p+r.u(t),f=Error();r.l(i,o=>{if(r.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var a=o&&("load"===o.type?"missing":o.type),i=o&&o.target&&o.target.src;f.message="Loading chunk "+t+" failed.\n("+a+": "+i+")",f.name="ChunkLoadError",f.type=a,f.request=i,n[1](f)}},"chunk-"+t,t)}},r.O.j=t=>0===e[t];var t=(t,o)=>{var n,a,[i,f,u]=o,c=0;if(i.some(t=>0!==e[t])){for(n in f)r.o(f,n)&&(r.m[n]=f[n]);if(u)var l=u(r)}for(t&&t(o);c<i.length;c++)a=i[c],r.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return r.O(l)},o=self.webpackChunk_N_E=self.webpackChunk_N_E||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})()})();
|