@testmuai/kane-cli 0.2.6 → 0.2.8

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.
Files changed (49) hide show
  1. package/dist/{ChromeProfilePicker-GFXYO62T.js → ChromeProfilePicker-GJA52BNZ.js} +1 -1
  2. package/dist/{CliFeedbackPrompt-F3ZTTEUY.js → CliFeedbackPrompt-4OSH6D53.js} +1 -1
  3. package/dist/{CliUploadProgress-DNE54O2E.js → CliUploadProgress-UORYVN7R.js} +1 -1
  4. package/dist/ConfigView-DHYUHQTK.js +2 -0
  5. package/dist/FolderPicker-TXCV7G4Y.js +2 -0
  6. package/dist/{HelpView-WVCLJJMT.js → HelpView-64BD2OKB.js} +1 -1
  7. package/dist/{LinksBox-I4PYUQY7.js → LinksBox-DNJBK25G.js} +1 -1
  8. package/dist/{LoginWizard-ZGXMGBNJ.js → LoginWizard-X5DLBHLV.js} +1 -1
  9. package/dist/{ProfilesView-AUJOUVYZ.js → ProfilesView-N4G4L2VO.js} +1 -1
  10. package/dist/ProjectPicker-XL67H337.js +2 -0
  11. package/dist/{WhoamiView-CY65SJE3.js → WhoamiView-JYNYZVTK.js} +1 -1
  12. package/dist/{build-MFETN2BY.js → build-JIKYOZUH.js} +1 -1
  13. package/dist/{changelog-CHSXQF3G.js → changelog-IPUSJH3G.js} +1 -1
  14. package/dist/{chunk-WSRUIIRY.js → chunk-BCTJUECQ.js} +1 -1
  15. package/dist/{chunk-Q7JVDEOV.js → chunk-C44QQJR4.js} +1 -1
  16. package/dist/chunk-CLF6GATH.js +2 -0
  17. package/dist/chunk-DSCYZSVU.js +106 -0
  18. package/dist/{chunk-3C7VPJXD.js → chunk-E4454TNP.js} +1 -1
  19. package/dist/{devtools-4SYFVOFF.js → chunk-E47GFYXA.js} +3 -3
  20. package/dist/chunk-GCZ4YXN4.js +2 -0
  21. package/dist/chunk-HFQ7T5KT.js +2 -0
  22. package/dist/chunk-KEU7JQAB.js +2 -0
  23. package/dist/{chunk-6HRAVME7.js → chunk-LACJLE5X.js} +1 -1
  24. package/dist/chunk-LDQZDX3F.js +2 -0
  25. package/dist/{chunk-OIERCP6B.js → chunk-M7JR2ZX5.js} +1 -1
  26. package/dist/chunk-MJYMADLM.js +2 -0
  27. package/dist/{chunk-EWT2AY54.js → chunk-MYZUROOZ.js} +1 -1
  28. package/dist/{chunk-PSB4TGW4.js → chunk-RFGE6ULZ.js} +9 -9
  29. package/dist/{chunk-Y4NPKZOF.js → chunk-RWLPN2OC.js} +1 -1
  30. package/dist/{chunk-5BRNKEYT.js → chunk-U3KZXIN2.js} +1 -1
  31. package/dist/{chunk-O7HXQ753.js → chunk-UL7ZRTTG.js} +1 -1
  32. package/dist/{chunk-ATLXF7HN.js → chunk-YXQQ33RG.js} +1 -1
  33. package/dist/devtools-6FR6UXUE.js +2 -0
  34. package/dist/index.js +56 -54
  35. package/dist/{logging-O5R56LPM.js → logging-32VNKE6C.js} +1 -1
  36. package/dist/login-flow-TNDBDANY.js +2 -0
  37. package/dist/{pipeline-NXUVAHY5.js → pipeline-QHJGNZ7H.js} +1 -1
  38. package/dist/{tms-client-T4HO73MT.js → tms-client-VH42IFUF.js} +1 -1
  39. package/dist/{updater-WVTXO7SS.js → updater-VR2G73FF.js} +1 -1
  40. package/dist/{version-check-SR6WBC6M.js → version-check-RN63L7BF.js} +1 -1
  41. package/package.json +5 -4
  42. package/dist/ConfigView-MTU2VXM3.js +0 -2
  43. package/dist/FolderPicker-VVQBL3YD.js +0 -2
  44. package/dist/ProjectPicker-3WKERA5V.js +0 -2
  45. package/dist/chunk-36GHKMI7.js +0 -2
  46. package/dist/chunk-6SF4L62W.js +0 -2
  47. package/dist/chunk-CW5PVMPK.js +0 -2
  48. package/dist/chunk-KMHVGLJY.js +0 -2
  49. package/dist/chunk-THEP5K6T.js +0 -2
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b,c}from"./chunk-O7HXQ753.js";import"./chunk-HCBYKLMW.js";import"./chunk-OIERCP6B.js";import"./chunk-Q7JVDEOV.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{c as ChromeProfilePicker,b as formatChromeProfileLine,a as listChromeProfiles};
2
+ import{a,b,c}from"./chunk-UL7ZRTTG.js";import"./chunk-HCBYKLMW.js";import"./chunk-M7JR2ZX5.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{c as ChromeProfilePicker,b as formatChromeProfileLine,a as listChromeProfiles};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as r}from"./chunk-3C7VPJXD.js";import"./chunk-HCBYKLMW.js";import"./chunk-OIERCP6B.js";import{c as e}from"./chunk-Q7JVDEOV.js";import{a as i}from"./chunk-6YGTRKDT.js";import{e as m}from"./chunk-UR6MHSHU.js";var t=m(i(),1);async function d(){return new Promise(o=>{let c=e(t.default.createElement(r,{onSubmit:n=>{c.unmount(),o(n)}}),{stdout:process.stderr,exitOnCtrlC:!1})})}export{d as renderFeedbackPrompt};
2
+ import{a as r}from"./chunk-E4454TNP.js";import"./chunk-HCBYKLMW.js";import"./chunk-M7JR2ZX5.js";import{c as e}from"./chunk-C44QQJR4.js";import{a as i}from"./chunk-6YGTRKDT.js";import{e as m}from"./chunk-UR6MHSHU.js";var t=m(i(),1);async function d(){return new Promise(o=>{let c=e(t.default.createElement(r,{onSubmit:n=>{c.unmount(),o(n)}}),{stdout:process.stderr,exitOnCtrlC:!1})})}export{d as renderFeedbackPrompt};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{c as P,d as g,e as f}from"./chunk-5BRNKEYT.js";import{a as c}from"./chunk-HCBYKLMW.js";import"./chunk-OIERCP6B.js";import{c as d}from"./chunk-Q7JVDEOV.js";import{a as h}from"./chunk-6YGTRKDT.js";import{e as p}from"./chunk-UR6MHSHU.js";var e=p(h(),1);var m=p(c(),1);function w({pipeline:t,buildShareUrl:r,onDone:o}){let[n,i]=(0,e.useState)(P()),[S,l]=(0,e.useState)("uploading"),[U,R]=(0,e.useState)(),[C,E]=(0,e.useState)();return(0,e.useEffect)(()=>{let x=t.config.onProgress;t.config.onProgress=(s,u,a)=>{x(s,u,a),i(y=>g(y,s,u,a))},t.execute().then(s=>{s.success?(R(r?.(s)),l("success")):(E(s.error),l("failed")),setTimeout(()=>o(s),1500)})},[]),(0,m.jsx)(f,{steps:n,status:S,testUrl:U,error:C})}async function O(t,r){return new Promise(o=>{let n=d(e.default.createElement(w,{pipeline:t,buildShareUrl:r,onDone:i=>{n.unmount(),o(i)}}),{stdout:process.stderr,exitOnCtrlC:!1})})}export{O as renderUploadProgress};
2
+ import{c as P,d as g,e as f}from"./chunk-U3KZXIN2.js";import{a as c}from"./chunk-HCBYKLMW.js";import"./chunk-M7JR2ZX5.js";import{c as d}from"./chunk-C44QQJR4.js";import{a as h}from"./chunk-6YGTRKDT.js";import{e as p}from"./chunk-UR6MHSHU.js";var e=p(h(),1);var m=p(c(),1);function w({pipeline:t,buildShareUrl:r,onDone:o}){let[n,i]=(0,e.useState)(P()),[S,l]=(0,e.useState)("uploading"),[U,R]=(0,e.useState)(),[C,E]=(0,e.useState)();return(0,e.useEffect)(()=>{let x=t.config.onProgress;t.config.onProgress=(s,u,a)=>{x(s,u,a),i(y=>g(y,s,u,a))},t.execute().then(s=>{s.success?(R(r?.(s)),l("success")):(E(s.error),l("failed")),setTimeout(()=>o(s),1500)})},[]),(0,m.jsx)(f,{steps:n,status:S,testUrl:U,error:C})}async function O(t,r){return new Promise(o=>{let n=d(e.default.createElement(w,{pipeline:t,buildShareUrl:r,onDone:i=>{n.unmount(),o(i)}}),{stdout:process.stderr,exitOnCtrlC:!1})})}export{O as renderUploadProgress};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as d,b as l,c as r}from"./chunk-MYZUROOZ.js";import{a as m}from"./chunk-HCBYKLMW.js";import{t as o}from"./chunk-M7JR2ZX5.js";import{a as t,j as u}from"./chunk-C44QQJR4.js";import{a as h}from"./chunk-6YGTRKDT.js";import{e as n}from"./chunk-UR6MHSHU.js";var f=n(h(),1);var e=n(m(),1);function S({model:c,mode:s,authLabel:g,profile:b,env:p,defaultUrl:i,projectId:v,folderId:x,windowSize:w,chromeProfile:B}){let{exit:a}=u();return(0,f.useEffect)(()=>{let C=setTimeout(()=>a(),50);return()=>clearTimeout(C)},[a]),(0,e.jsx)(t,{flexDirection:"column",children:(0,e.jsx)(d,{title:"Configuration",children:(0,e.jsxs)(t,{flexDirection:"column",paddingY:1,children:[(0,e.jsx)(r,{label:"Auth"}),(0,e.jsx)(l,{label:" method",value:g}),(0,e.jsx)(l,{label:" profile",value:b}),(0,e.jsx)(l,{label:" env",value:p}),(0,e.jsx)(r,{label:"Defaults"}),(0,e.jsx)(l,{label:" url",value:i??"(none)",valueColor:i?o.cyan:o.dimmed}),(0,e.jsx)(l,{label:" model",value:c}),(0,e.jsx)(l,{label:" mode",value:s}),(0,e.jsx)(l,{label:" window",value:w}),(0,e.jsx)(l,{label:" project",value:v??"(none)"}),(0,e.jsx)(l,{label:" folder",value:x??"(none)"}),(0,e.jsx)(r,{label:"Paths"}),(0,e.jsx)(l,{label:" chrome",value:B,valueColor:o.dimmed})]})})})}export{S as ConfigView};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a,b}from"./chunk-MJYMADLM.js";import"./chunk-KEU7JQAB.js";import"./chunk-LDQZDX3F.js";import"./chunk-HCBYKLMW.js";import"./chunk-M7JR2ZX5.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-HFQ7T5KT.js";import"./chunk-DXKKUGFG.js";import"./chunk-UR6MHSHU.js";export{b as FolderPicker,a as formatFolderLine};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as f}from"./chunk-HCBYKLMW.js";import{a as h,b as l,t}from"./chunk-OIERCP6B.js";import{a as n,b as o,j as x,k as p}from"./chunk-Q7JVDEOV.js";import{a as T}from"./chunk-6YGTRKDT.js";import{e as u}from"./chunk-UR6MHSHU.js";var b=u(T(),1);var e=u(f(),1),w="https://www.testmuai.com/support/docs/kane-cli-introduction",B="https://github.com/LambdaTest/kane-cli/issues";function L(){let{exit:c}=x(),{stdout:i}=p(),s=i?.columns??80;return(0,b.useEffect)(()=>{let d=setTimeout(()=>c(),50);return()=>clearTimeout(d)},[c]),(0,e.jsxs)(n,{flexDirection:"column",children:[(0,e.jsxs)(n,{paddingX:1,paddingTop:1,flexDirection:"column",children:[(0,e.jsx)(o,{color:t.purple,bold:!0,children:l}),(0,e.jsxs)(n,{children:[(0,e.jsx)(o,{color:t.dimmed,children:"Browser automation powered by AI "}),(0,e.jsxs)(o,{color:t.muted,children:[" v",h]})]})]}),(0,e.jsx)(o,{children:" "}),(0,e.jsx)(m,{title:"USAGE",children:(0,e.jsxs)(o,{color:t.cyan,children:[" $ ",l," ","<command>"," [flags]"]})}),(0,e.jsxs)(m,{title:"COMMANDS",children:[(0,e.jsx)(a,{cmd:"run",args:"<objective>",desc:"Run a browser automation task",highlight:!0}),(0,e.jsx)(a,{cmd:"login",desc:"Auth setup (interactive, --oauth, or --username)"}),(0,e.jsx)(a,{cmd:"logout",desc:"Revoke tokens + delete profile"}),(0,e.jsx)(a,{cmd:"whoami",desc:"Show authenticated identity"}),(0,e.jsx)(a,{cmd:"config",args:"show|set-\u2026|reset",desc:"Manage configuration"}),(0,e.jsx)(a,{cmd:"profiles",args:"list|switch|delete",desc:"Manage auth profiles"})]}),(0,e.jsxs)(m,{title:"RUN FLAGS",children:[(0,e.jsx)(r,{long:"--max-steps",arg:"<n>",desc:"Max agent steps (default: 30)"}),(0,e.jsx)(r,{long:"--timeout",arg:"<sec>",desc:"Kill run after N seconds"}),(0,e.jsx)(r,{long:"--headless",desc:"No visible browser window"}),(0,e.jsx)(r,{long:"--variables",arg:"<json>",desc:"Inline variables as JSON"}),(0,e.jsx)(r,{long:"--variables-file",arg:"<path>",desc:"Load variables from file"}),(0,e.jsx)(r,{long:"--ws-endpoint",arg:"<url>",desc:"Remote browser (LambdaTest)"}),(0,e.jsx)(r,{long:"--cdp-endpoint",arg:"<url>",desc:"Connect to existing Chrome CDP"}),(0,e.jsx)(r,{long:"--cft",desc:"Use Playwright Chromium instead of managed Chrome"}),(0,e.jsx)(r,{long:"--global-context",arg:"<file>",desc:"Override global context markdown"}),(0,e.jsx)(r,{long:"--local-context",arg:"<file>",desc:"Override local context markdown"}),(0,e.jsx)(r,{long:"--username",arg:"<user>",desc:"Basic auth (skip OAuth)"}),(0,e.jsx)(r,{long:"--access-key",arg:"<key>",desc:"Basic auth access key"}),(0,e.jsx)(r,{long:"--env",arg:"<name>",desc:"Environment (prod or stage)"}),(0,e.jsx)(r,{long:"--agent",desc:"NDJSON output (no UI)",highlight:!0})]}),(0,e.jsxs)(m,{title:"EXAMPLES",children:[(0,e.jsx)(g,{label:"Search",cmd:`${l} run "Search for laptop"`}),(0,e.jsx)(g,{label:"Headless",cmd:`${l} run "Verify login" --headless`}),(0,e.jsx)(g,{label:"Variables",cmd:`${l} run "Login as {{user}}" --variables '{"user":{"value":"alice"}}'`}),(0,e.jsx)(g,{label:"Agent",cmd:`${l} run "Add to cart" --agent | jq .status`})]}),(0,e.jsxs)(n,{flexDirection:"column",marginTop:0,paddingX:1,children:[(0,e.jsx)(o,{color:t.muted,children:"\u2500".repeat(Math.min(s-2,70))}),(0,e.jsxs)(n,{gap:3,children:[(0,e.jsxs)(n,{children:[(0,e.jsx)(o,{color:t.dimmed,children:"Docs "}),(0,e.jsx)(o,{color:t.cyan,underline:!0,children:w})]}),(0,e.jsxs)(n,{children:[(0,e.jsx)(o,{color:t.dimmed,children:"Bugs "}),(0,e.jsx)(o,{color:t.cyan,underline:!0,children:B})]})]})]}),(0,e.jsx)(o,{children:" "})]})}function m({title:c,children:i}){return(0,e.jsxs)(n,{flexDirection:"column",marginBottom:1,children:[(0,e.jsx)(n,{marginLeft:1,children:(0,e.jsx)(o,{bold:!0,color:t.dimmed,children:c})}),i]})}function a({cmd:c,args:i,desc:s,highlight:d}){return(0,e.jsxs)(n,{marginLeft:2,children:[(0,e.jsx)(n,{width:12,children:(0,e.jsx)(o,{color:d?t.purple:t.green,bold:!0,children:c})}),(0,e.jsx)(n,{width:28,children:i?(0,e.jsx)(o,{color:t.dimmed,children:i}):null}),(0,e.jsx)(o,{color:t.dimmed,children:s})]})}function r({long:c,arg:i,desc:s,highlight:d}){return(0,e.jsxs)(n,{marginLeft:2,children:[(0,e.jsxs)(n,{width:26,children:[(0,e.jsx)(o,{color:d?t.purple:t.cyan,children:c}),i&&(0,e.jsxs)(o,{color:t.dimmed,children:[" ",i]})]}),(0,e.jsx)(o,{color:t.dimmed,children:s})]})}function g({label:c,cmd:i}){return(0,e.jsxs)(n,{marginLeft:2,flexDirection:"column",children:[(0,e.jsxs)(o,{color:t.dimmed,children:["# ",c]}),(0,e.jsxs)(o,{color:t.cyan,children:["$ ",i]})]})}export{L as HelpView};
2
+ import{a as f}from"./chunk-HCBYKLMW.js";import{a as h,b as l,t}from"./chunk-M7JR2ZX5.js";import{a as n,b as o,j as x,k as p}from"./chunk-C44QQJR4.js";import{a as T}from"./chunk-6YGTRKDT.js";import{e as u}from"./chunk-UR6MHSHU.js";var b=u(T(),1);var e=u(f(),1),w="https://www.testmuai.com/support/docs/kane-cli-introduction",B="https://github.com/LambdaTest/kane-cli/issues";function L(){let{exit:c}=x(),{stdout:i}=p(),s=i?.columns??80;return(0,b.useEffect)(()=>{let d=setTimeout(()=>c(),50);return()=>clearTimeout(d)},[c]),(0,e.jsxs)(n,{flexDirection:"column",children:[(0,e.jsxs)(n,{paddingX:1,paddingTop:1,flexDirection:"column",children:[(0,e.jsx)(o,{color:t.purple,bold:!0,children:l}),(0,e.jsxs)(n,{children:[(0,e.jsx)(o,{color:t.dimmed,children:"Browser automation powered by AI "}),(0,e.jsxs)(o,{color:t.muted,children:[" v",h]})]})]}),(0,e.jsx)(o,{children:" "}),(0,e.jsx)(m,{title:"USAGE",children:(0,e.jsxs)(o,{color:t.cyan,children:[" $ ",l," ","<command>"," [flags]"]})}),(0,e.jsxs)(m,{title:"COMMANDS",children:[(0,e.jsx)(a,{cmd:"run",args:"<objective>",desc:"Run a browser automation task",highlight:!0}),(0,e.jsx)(a,{cmd:"login",desc:"Auth setup (interactive, --oauth, or --username)"}),(0,e.jsx)(a,{cmd:"logout",desc:"Revoke tokens + delete profile"}),(0,e.jsx)(a,{cmd:"whoami",desc:"Show authenticated identity"}),(0,e.jsx)(a,{cmd:"config",args:"show|set-\u2026|reset",desc:"Manage configuration"}),(0,e.jsx)(a,{cmd:"profiles",args:"list|switch|delete",desc:"Manage auth profiles"})]}),(0,e.jsxs)(m,{title:"RUN FLAGS",children:[(0,e.jsx)(r,{long:"--max-steps",arg:"<n>",desc:"Max agent steps (default: 30)"}),(0,e.jsx)(r,{long:"--timeout",arg:"<sec>",desc:"Kill run after N seconds"}),(0,e.jsx)(r,{long:"--headless",desc:"No visible browser window"}),(0,e.jsx)(r,{long:"--variables",arg:"<json>",desc:"Inline variables as JSON"}),(0,e.jsx)(r,{long:"--variables-file",arg:"<path>",desc:"Load variables from file"}),(0,e.jsx)(r,{long:"--ws-endpoint",arg:"<url>",desc:"Remote browser (LambdaTest)"}),(0,e.jsx)(r,{long:"--cdp-endpoint",arg:"<url>",desc:"Connect to existing Chrome CDP"}),(0,e.jsx)(r,{long:"--cft",desc:"Use Playwright Chromium instead of managed Chrome"}),(0,e.jsx)(r,{long:"--global-context",arg:"<file>",desc:"Override global context markdown"}),(0,e.jsx)(r,{long:"--local-context",arg:"<file>",desc:"Override local context markdown"}),(0,e.jsx)(r,{long:"--username",arg:"<user>",desc:"Basic auth (skip OAuth)"}),(0,e.jsx)(r,{long:"--access-key",arg:"<key>",desc:"Basic auth access key"}),(0,e.jsx)(r,{long:"--env",arg:"<name>",desc:"Environment (prod or stage)"}),(0,e.jsx)(r,{long:"--agent",desc:"NDJSON output (no UI)",highlight:!0})]}),(0,e.jsxs)(m,{title:"EXAMPLES",children:[(0,e.jsx)(g,{label:"Search",cmd:`${l} run "Search for laptop"`}),(0,e.jsx)(g,{label:"Headless",cmd:`${l} run "Verify login" --headless`}),(0,e.jsx)(g,{label:"Variables",cmd:`${l} run "Login as {{user}}" --variables '{"user":{"value":"alice"}}'`}),(0,e.jsx)(g,{label:"Agent",cmd:`${l} run "Add to cart" --agent | jq .status`})]}),(0,e.jsxs)(n,{flexDirection:"column",marginTop:0,paddingX:1,children:[(0,e.jsx)(o,{color:t.muted,children:"\u2500".repeat(Math.min(s-2,70))}),(0,e.jsxs)(n,{gap:3,children:[(0,e.jsxs)(n,{children:[(0,e.jsx)(o,{color:t.dimmed,children:"Docs "}),(0,e.jsx)(o,{color:t.cyan,underline:!0,children:w})]}),(0,e.jsxs)(n,{children:[(0,e.jsx)(o,{color:t.dimmed,children:"Bugs "}),(0,e.jsx)(o,{color:t.cyan,underline:!0,children:B})]})]})]}),(0,e.jsx)(o,{children:" "})]})}function m({title:c,children:i}){return(0,e.jsxs)(n,{flexDirection:"column",marginBottom:1,children:[(0,e.jsx)(n,{marginLeft:1,children:(0,e.jsx)(o,{bold:!0,color:t.dimmed,children:c})}),i]})}function a({cmd:c,args:i,desc:s,highlight:d}){return(0,e.jsxs)(n,{marginLeft:2,children:[(0,e.jsx)(n,{width:12,children:(0,e.jsx)(o,{color:d?t.purple:t.green,bold:!0,children:c})}),(0,e.jsx)(n,{width:28,children:i?(0,e.jsx)(o,{color:t.dimmed,children:i}):null}),(0,e.jsx)(o,{color:t.dimmed,children:s})]})}function r({long:c,arg:i,desc:s,highlight:d}){return(0,e.jsxs)(n,{marginLeft:2,children:[(0,e.jsxs)(n,{width:26,children:[(0,e.jsx)(o,{color:d?t.purple:t.cyan,children:c}),i&&(0,e.jsxs)(o,{color:t.dimmed,children:[" ",i]})]}),(0,e.jsx)(o,{color:t.dimmed,children:s})]})}function g({label:c,cmd:i}){return(0,e.jsxs)(n,{marginLeft:2,flexDirection:"column",children:[(0,e.jsxs)(o,{color:t.dimmed,children:["# ",c]}),(0,e.jsxs)(o,{color:t.cyan,children:["$ ",i]})]})}export{L as HelpView};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a}from"./chunk-ATLXF7HN.js";import"./chunk-HCBYKLMW.js";import"./chunk-OIERCP6B.js";import"./chunk-Q7JVDEOV.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as LinksBox};
2
+ import{a}from"./chunk-YXQQ33RG.js";import"./chunk-HCBYKLMW.js";import"./chunk-M7JR2ZX5.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as LinksBox};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b}from"./chunk-6HRAVME7.js";import"./chunk-HCBYKLMW.js";import"./chunk-OIERCP6B.js";import"./chunk-Q7JVDEOV.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{b as LoginWizard,a as getWizardSteps};
2
+ import{a,b}from"./chunk-LACJLE5X.js";import"./chunk-HCBYKLMW.js";import"./chunk-M7JR2ZX5.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{b as LoginWizard,a as getWizardSteps};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b}from"./chunk-WSRUIIRY.js";import"./chunk-HCBYKLMW.js";import"./chunk-OIERCP6B.js";import"./chunk-Q7JVDEOV.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{b as ProfilesView,a as formatProfileLine};
2
+ import{a,b}from"./chunk-BCTJUECQ.js";import"./chunk-HCBYKLMW.js";import"./chunk-M7JR2ZX5.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{b as ProfilesView,a as formatProfileLine};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a,b}from"./chunk-CLF6GATH.js";import"./chunk-KEU7JQAB.js";import"./chunk-LDQZDX3F.js";import"./chunk-HCBYKLMW.js";import"./chunk-M7JR2ZX5.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-HFQ7T5KT.js";import"./chunk-DXKKUGFG.js";import"./chunk-UR6MHSHU.js";export{b as ProjectPicker,a as formatProjectLine};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as s,b as o}from"./chunk-EWT2AY54.js";import{a as x}from"./chunk-HCBYKLMW.js";import{t as i}from"./chunk-OIERCP6B.js";import{a as r,b as n,j as u}from"./chunk-Q7JVDEOV.js";import{a as B}from"./chunk-6YGTRKDT.js";import{e as t}from"./chunk-UR6MHSHU.js";var p=t(B(),1);var e=t(x(),1);function R({profile:f,env:g,authenticated:a,authMethod:v,username:m,tokenStatus:l,expiresAt:c}){let{exit:d}=u();return(0,p.useEffect)(()=>{let b=setTimeout(()=>d(),50);return()=>clearTimeout(b)},[d]),(0,e.jsx)(r,{flexDirection:"column",children:(0,e.jsx)(s,{title:"Identity",variant:a?"success":"warning",children:(0,e.jsxs)(r,{flexDirection:"column",paddingY:1,children:[(0,e.jsx)(r,{children:a?(0,e.jsx)(n,{color:i.green,bold:!0,children:"\u2713 Authenticated"}):(0,e.jsx)(n,{color:i.yellow,bold:!0,children:"\u26A0 Not logged in"})}),(0,e.jsxs)(r,{flexDirection:"column",marginTop:1,children:[(0,e.jsx)(o,{label:"Profile",value:f}),(0,e.jsx)(o,{label:"Environment",value:g}),(0,e.jsx)(o,{label:"Method",value:v}),m&&(0,e.jsx)(o,{label:"User",value:m}),l&&(0,e.jsx)(o,{label:"Token",value:l,valueColor:l==="valid"?i.green:l==="expired"?i.red:i.dimmed}),c&&(0,e.jsx)(o,{label:"Expires",value:c})]})]})})})}export{R as WhoamiView};
2
+ import{a as s,b as o}from"./chunk-MYZUROOZ.js";import{a as x}from"./chunk-HCBYKLMW.js";import{t as i}from"./chunk-M7JR2ZX5.js";import{a as r,b as n,j as u}from"./chunk-C44QQJR4.js";import{a as B}from"./chunk-6YGTRKDT.js";import{e as t}from"./chunk-UR6MHSHU.js";var p=t(B(),1);var e=t(x(),1);function R({profile:f,env:g,authenticated:a,authMethod:v,username:m,tokenStatus:l,expiresAt:c}){let{exit:d}=u();return(0,p.useEffect)(()=>{let b=setTimeout(()=>d(),50);return()=>clearTimeout(b)},[d]),(0,e.jsx)(r,{flexDirection:"column",children:(0,e.jsx)(s,{title:"Identity",variant:a?"success":"warning",children:(0,e.jsxs)(r,{flexDirection:"column",paddingY:1,children:[(0,e.jsx)(r,{children:a?(0,e.jsx)(n,{color:i.green,bold:!0,children:"\u2713 Authenticated"}):(0,e.jsx)(n,{color:i.yellow,bold:!0,children:"\u26A0 Not logged in"})}),(0,e.jsxs)(r,{flexDirection:"column",marginTop:1,children:[(0,e.jsx)(o,{label:"Profile",value:f}),(0,e.jsx)(o,{label:"Environment",value:g}),(0,e.jsx)(o,{label:"Method",value:v}),m&&(0,e.jsx)(o,{label:"User",value:m}),l&&(0,e.jsx)(o,{label:"Token",value:l,valueColor:l==="valid"?i.green:l==="expired"?i.red:i.dimmed}),c&&(0,e.jsx)(o,{label:"Expires",value:c})]})]})})})}export{R as WhoamiView};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"./chunk-Q7JVDEOV.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as Box,f as Newline,g as Spacer,d as Static,b as Text,e as Transform,o as measureElement,c as render,j as useApp,m as useFocus,n as useFocusManager,i as useInput,l as useStderr,h as useStdin,k as useStdout};
2
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as Box,f as Newline,g as Spacer,d as Static,b as Text,e as Transform,o as measureElement,c as render,j as useApp,m as useFocus,n as useFocusManager,i as useInput,l as useStderr,h as useStdin,k as useStdout};
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{c as i,f as c}from"./chunk-OIERCP6B.js";import"./chunk-UR6MHSHU.js";import{readFileSync as h,writeFileSync as g,mkdirSync as u}from"fs";import{join as d}from"path";var l=d(i,"changelog-cache.json"),f=3600*1e3;function p(){try{let e=JSON.parse(h(l,"utf-8"));if(Date.now()-e.cachedAt<f)return e}catch{}return null}function y(e){try{u(i,{recursive:!0}),g(l,JSON.stringify({entries:e,cachedAt:Date.now()}))}catch{}}async function E(e){try{let t=p();if(t){let r=t.entries;return e?.all?r:r.slice(0,5)}let n=new AbortController,o=setTimeout(()=>n.abort(),5e3),a=await fetch(`${c}?per_page=30`,{headers:{Accept:"application/vnd.github+json"},signal:n.signal});if(clearTimeout(o),!a.ok)return[];let s=(await a.json()).map(r=>({version:r.tag_name.replace(/^v/,""),date:r.published_at?r.published_at.slice(0,10):"",body:r.body??""}));return y(s),e?.all?s:s.slice(0,5)}catch{return[]}}function A(e){if(e.length===0)return"Could not fetch changelog. Visit https://github.com/LambdaTest/kane-cli/releases";let t=["kane-cli Changelog","\u2500".repeat(40),""];for(let n of e){if(t.push(`v${n.version} (${n.date})`),n.body){let o=n.body.split(`
2
+ import{c as i,f as c}from"./chunk-M7JR2ZX5.js";import"./chunk-UR6MHSHU.js";import{readFileSync as h,writeFileSync as g,mkdirSync as u}from"fs";import{join as d}from"path";var l=d(i,"changelog-cache.json"),f=3600*1e3;function p(){try{let e=JSON.parse(h(l,"utf-8"));if(Date.now()-e.cachedAt<f)return e}catch{}return null}function y(e){try{u(i,{recursive:!0}),g(l,JSON.stringify({entries:e,cachedAt:Date.now()}))}catch{}}async function E(e){try{let t=p();if(t){let r=t.entries;return e?.all?r:r.slice(0,5)}let n=new AbortController,o=setTimeout(()=>n.abort(),5e3),a=await fetch(`${c}?per_page=30`,{headers:{Accept:"application/vnd.github+json"},signal:n.signal});if(clearTimeout(o),!a.ok)return[];let s=(await a.json()).map(r=>({version:r.tag_name.replace(/^v/,""),date:r.published_at?r.published_at.slice(0,10):"",body:r.body??""}));return y(s),e?.all?s:s.slice(0,5)}catch{return[]}}function A(e){if(e.length===0)return"Could not fetch changelog. Visit https://github.com/LambdaTest/kane-cli/releases";let t=["kane-cli Changelog","\u2500".repeat(40),""];for(let n of e){if(t.push(`v${n.version} (${n.date})`),n.body){let o=n.body.split(`
3
3
  `).filter(a=>a.trim());for(let a of o)t.push(` ${a}`)}t.push("")}return t.join(`
4
4
  `)}export{E as fetchChangelog,A as formatChangelog};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as P}from"./chunk-HCBYKLMW.js";import{t as i}from"./chunk-OIERCP6B.js";import{a,b as l,i as h}from"./chunk-Q7JVDEOV.js";import{a as w}from"./chunk-6YGTRKDT.js";import{e as b}from"./chunk-UR6MHSHU.js";var A=b(w(),1);var o=b(P(),1);function B(n,d,f,m,p){let x=f==="basic"&&m?`basic (${m})`:f,s=20,c=`${n} [${d}]`,u="\xB7".repeat(Math.max(2,s-c.length+3));return{label:`${c} ${u} ${x}`,profile:n,env:d,isActive:p}}function y({creds:n,onSwitch:d,onCancel:f}){let m=n.listProfiles(),p=n.getActiveProfile(),x=n.getDefaultEnv(),s=m.map(e=>{let t=n.loadBasicAuth(e.profile,e.env),r=n.loadCredentials(e.profile,e.env)!==null,g=t?"basic":r?"oauth":"none",v=t?t.username:null,T=e.profile===p&&e.env===x;return B(e.profile,e.env,g,v,T)}),[c,u]=(0,A.useState)(()=>{let e=s.findIndex(t=>t.isActive);return e>=0?e:0});return h((e,t)=>{if(t.escape){f();return}if(t.upArrow){u(r=>Math.max(0,r-1));return}if(t.downArrow){u(r=>Math.min(s.length-1,r+1));return}if(t.return&&s[c]){let r=s[c];r.isActive||d(r.profile,r.env),f();return}}),s.length===0?(0,o.jsxs)(a,{flexDirection:"column",borderStyle:"round",borderColor:i.primary,paddingX:2,paddingY:1,children:[(0,o.jsx)(l,{color:i.primary,bold:!0,children:"Profiles"}),(0,o.jsx)(a,{marginTop:1,children:(0,o.jsx)(l,{color:i.dim,children:"No profiles \u2014 use Login to create one"})}),(0,o.jsx)(a,{marginTop:1,children:(0,o.jsx)(l,{color:i.dim,children:"esc back"})})]}):(0,o.jsxs)(a,{flexDirection:"column",borderStyle:"round",borderColor:i.primary,paddingX:2,paddingY:1,children:[(0,o.jsx)(l,{color:i.primary,bold:!0,children:"Profiles"}),(0,o.jsx)(a,{flexDirection:"column",marginTop:1,children:s.map((e,t)=>{let r=t===c,g=r?"\u276F ":" ",v=e.isActive?i.statusPass:r?i.primary:void 0;return(0,o.jsxs)(l,{color:v,children:[g,e.label,e.isActive?" \u25CF active":""]},`${e.profile}-${e.env}`)})}),(0,o.jsx)(a,{marginTop:1,children:(0,o.jsx)(l,{color:i.dim,children:"\u2191\u2193 navigate \xB7 \u21B5 switch \xB7 esc back"})})]})}export{B as a,y as b};
2
+ import{a as P}from"./chunk-HCBYKLMW.js";import{t as i}from"./chunk-M7JR2ZX5.js";import{a,b as l,i as h}from"./chunk-C44QQJR4.js";import{a as w}from"./chunk-6YGTRKDT.js";import{e as b}from"./chunk-UR6MHSHU.js";var A=b(w(),1);var o=b(P(),1);function B(n,d,f,m,p){let x=f==="basic"&&m?`basic (${m})`:f,s=20,c=`${n} [${d}]`,u="\xB7".repeat(Math.max(2,s-c.length+3));return{label:`${c} ${u} ${x}`,profile:n,env:d,isActive:p}}function y({creds:n,onSwitch:d,onCancel:f}){let m=n.listProfiles(),p=n.getActiveProfile(),x=n.getDefaultEnv(),s=m.map(e=>{let t=n.loadBasicAuth(e.profile,e.env),r=n.loadCredentials(e.profile,e.env)!==null,g=t?"basic":r?"oauth":"none",v=t?t.username:null,T=e.profile===p&&e.env===x;return B(e.profile,e.env,g,v,T)}),[c,u]=(0,A.useState)(()=>{let e=s.findIndex(t=>t.isActive);return e>=0?e:0});return h((e,t)=>{if(t.escape){f();return}if(t.upArrow){u(r=>Math.max(0,r-1));return}if(t.downArrow){u(r=>Math.min(s.length-1,r+1));return}if(t.return&&s[c]){let r=s[c];r.isActive||d(r.profile,r.env),f();return}}),s.length===0?(0,o.jsxs)(a,{flexDirection:"column",borderStyle:"round",borderColor:i.primary,paddingX:2,paddingY:1,children:[(0,o.jsx)(l,{color:i.primary,bold:!0,children:"Profiles"}),(0,o.jsx)(a,{marginTop:1,children:(0,o.jsx)(l,{color:i.dim,children:"No profiles \u2014 use Login to create one"})}),(0,o.jsx)(a,{marginTop:1,children:(0,o.jsx)(l,{color:i.dim,children:"esc back"})})]}):(0,o.jsxs)(a,{flexDirection:"column",borderStyle:"round",borderColor:i.primary,paddingX:2,paddingY:1,children:[(0,o.jsx)(l,{color:i.primary,bold:!0,children:"Profiles"}),(0,o.jsx)(a,{flexDirection:"column",marginTop:1,children:s.map((e,t)=>{let r=t===c,g=r?"\u276F ":" ",v=e.isActive?i.statusPass:r?i.primary:void 0;return(0,o.jsxs)(l,{color:v,children:[g,e.label,e.isActive?" \u25CF active":""]},`${e.profile}-${e.env}`)})}),(0,o.jsx)(a,{marginTop:1,children:(0,o.jsx)(l,{color:i.dim,children:"\u2191\u2193 navigate \xB7 \u21B5 switch \xB7 esc back"})})]})}export{B as a,y as b};
@@ -140,7 +140,7 @@ Check the render method of %s.`,Ce(uA)||"Unknown"));var D=La(g,d);D.payload={ele
140
140
  `,`
141
141
  `).split(`
142
142
  `).map(B=>QS(B,l,c)).join(`
143
- `)}function Zc(a){return Number.isInteger(a)?a>=4352&&(a<=4447||a===9001||a===9002||11904<=a&&a<=12871&&a!==12351||12880<=a&&a<=19903||19968<=a&&a<=42182||43360<=a&&a<=43388||44032<=a&&a<=55203||63744<=a&&a<=64255||65040<=a&&a<=65049||65072<=a&&a<=65131||65281<=a&&a<=65376||65504<=a&&a<=65510||110592<=a&&a<=110593||127488<=a&&a<=127569||131072<=a&&a<=262141):!1}var pS=/^[\uD800-\uDBFF][\uDC00-\uDFFF]$/,$D=["\x1B","\x9B"],gE=a=>`${$D[0]}[${a}m`,ZD=(a,l,c)=>{let B=[];a=[...a];for(let C of a){let y=C;C.includes(";")&&(C=C.split(";")[0][0]+"0");let m=Zt.codes.get(Number.parseInt(C,10));if(m){let N=a.indexOf(m.toString());N===-1?B.push(gE(l?m:y)):a.splice(N,1)}else if(l){B.push(gE(0));break}else B.push(gE(y))}if(l&&(B=B.filter((C,y)=>B.indexOf(C)===y),c!==void 0)){let C=gE(Zt.codes.get(Number.parseInt(c,10)));B=B.reduce((y,m)=>m===C?[m,...y]:[...y,m],[])}return B.join("")};function ca(a,l,c){let B=[...a],C=[],y=typeof c=="number"?c:B.length,m=!1,N,k=0,F="";for(let[Z,X]of B.entries()){let ge=!1;if($D.includes(X)){let we=/\d[^m]*/.exec(a.slice(Z,Z+18));N=we&&we.length>0?we[0]:void 0,k<y&&(m=!0,N!==void 0&&C.push(N))}else m&&X==="m"&&(m=!1,ge=!0);if(!m&&!ge&&k++,!pS.test(X)&&Zc(X.codePointAt())&&(k++,typeof c!="number"&&y++),k>l&&k<=y)F+=X;else if(k===l&&!m&&N!==void 0)F=ZD(C);else if(k>=y){F+=ZD(C,!0,N);break}}return F}function EE(a,l,c){if(a.charAt(l)===" ")return l;let B=c?1:-1;for(let C=0;C<=3;C++){let y=l+C*B;if(a.charAt(y)===" ")return y}return l}function bI(a,l,c={}){let{position:B="end",space:C=!1,preferTruncationOnSpace:y=!1}=c,{truncationCharacter:m="\u2026"}=c;if(typeof a!="string")throw new TypeError(`Expected \`input\` to be a string, got ${typeof a}`);if(typeof l!="number")throw new TypeError(`Expected \`columns\` to be a number, got ${typeof l}`);if(l<1)return"";if(l===1)return m;let N=Mn(a);if(N<=l)return a;if(B==="start"){if(y){let k=EE(a,N-l+1,!0);return m+ca(a,k,N).trim()}return C===!0&&(m+=" "),m+ca(a,N-l+Mn(m),N)}if(B==="middle"){C===!0&&(m=` ${m} `);let k=Math.floor(l/2);if(y){let F=EE(a,k),Z=EE(a,N-(l-k)+1,!0);return ca(a,0,F)+m+ca(a,Z,N).trim()}return ca(a,0,k)+m+ca(a,N-(l-k)+Mn(m),N)}if(B==="end"){if(y){let k=EE(a,l-1);return ca(a,0,k)+m}return C===!0&&(m=` ${m}`),ca(a,0,l-Mn(m))+m}throw new Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${B}`)}var eh={},DS=(a,l,c)=>{let B=a+String(l)+String(c),C=eh[B];if(C)return C;let y=a;if(c==="wrap"&&(y=JI(a,l,{trim:!1,hard:!0})),c.startsWith("truncate")){let m="end";c==="truncate-middle"&&(m="middle"),c==="truncate-start"&&(m="start"),y=bI(a,l,{position:m})}return eh[B]=y,y},dE=DS;var th=a=>{let l="";for(let c=0;c<a.childNodes.length;c++){let B=a.childNodes[c];if(B===void 0)continue;let C="";B.nodeName==="#text"?C=B.nodeValue:((B.nodeName==="ink-text"||B.nodeName==="ink-virtual-text")&&(C=th(B)),C.length>0&&typeof B.internal_transform=="function"&&(C=B.internal_transform(C,c))),l+=C}return l},BE=th;var IE=a=>{let l={nodeName:a,style:{},attributes:{},childNodes:[],parentNode:void 0,yogaNode:a==="ink-virtual-text"?void 0:Qe.Node.create()};return a==="ink-text"&&l.yogaNode?.setMeasureFunc(hS.bind(null,l)),l},CE=(a,l)=>{l.parentNode&&$c(l.parentNode,l),l.parentNode=a,a.childNodes.push(l),l.yogaNode&&a.yogaNode?.insertChild(l.yogaNode,a.yogaNode.getChildCount()),(a.nodeName==="ink-text"||a.nodeName==="ink-virtual-text")&&QE(a)},KI=(a,l,c)=>{l.parentNode&&$c(l.parentNode,l),l.parentNode=a;let B=a.childNodes.indexOf(c);if(B>=0){a.childNodes.splice(B,0,l),l.yogaNode&&a.yogaNode?.insertChild(l.yogaNode,B);return}a.childNodes.push(l),l.yogaNode&&a.yogaNode?.insertChild(l.yogaNode,a.yogaNode.getChildCount()),(a.nodeName==="ink-text"||a.nodeName==="ink-virtual-text")&&QE(a)},$c=(a,l)=>{l.yogaNode&&l.parentNode?.yogaNode?.removeChild(l.yogaNode),l.parentNode=void 0;let c=a.childNodes.indexOf(l);c>=0&&a.childNodes.splice(c,1),(a.nodeName==="ink-text"||a.nodeName==="ink-virtual-text")&&QE(a)},YI=(a,l,c)=>{a.attributes[l]=c},zI=(a,l)=>{a.style=l},Ah=a=>{let l={nodeName:"#text",nodeValue:a,yogaNode:void 0,parentNode:void 0,style:{}};return ef(l,a),l},hS=function(a,l){let c=a.nodeName==="#text"?a.nodeValue:BE(a),B=TI(c);if(B.width<=l||B.width>=1&&l>0&&l<1)return B;let C=a.style?.textWrap??"wrap",y=dE(c,l,C);return TI(y)},nh=a=>{if(a?.parentNode)return a.yogaNode??nh(a.parentNode)},QE=a=>{nh(a)?.markDirty()},ef=(a,l)=>{typeof l!="string"&&(l=String(l)),a.nodeValue=l,QE(a)};var vS=(a,l)=>{"position"in l&&a.setPositionType(l.position==="absolute"?Qe.POSITION_TYPE_ABSOLUTE:Qe.POSITION_TYPE_RELATIVE)},yS=(a,l)=>{"margin"in l&&a.setMargin(Qe.EDGE_ALL,l.margin??0),"marginX"in l&&a.setMargin(Qe.EDGE_HORIZONTAL,l.marginX??0),"marginY"in l&&a.setMargin(Qe.EDGE_VERTICAL,l.marginY??0),"marginLeft"in l&&a.setMargin(Qe.EDGE_START,l.marginLeft||0),"marginRight"in l&&a.setMargin(Qe.EDGE_END,l.marginRight||0),"marginTop"in l&&a.setMargin(Qe.EDGE_TOP,l.marginTop||0),"marginBottom"in l&&a.setMargin(Qe.EDGE_BOTTOM,l.marginBottom||0)},FS=(a,l)=>{"padding"in l&&a.setPadding(Qe.EDGE_ALL,l.padding??0),"paddingX"in l&&a.setPadding(Qe.EDGE_HORIZONTAL,l.paddingX??0),"paddingY"in l&&a.setPadding(Qe.EDGE_VERTICAL,l.paddingY??0),"paddingLeft"in l&&a.setPadding(Qe.EDGE_LEFT,l.paddingLeft||0),"paddingRight"in l&&a.setPadding(Qe.EDGE_RIGHT,l.paddingRight||0),"paddingTop"in l&&a.setPadding(Qe.EDGE_TOP,l.paddingTop||0),"paddingBottom"in l&&a.setPadding(Qe.EDGE_BOTTOM,l.paddingBottom||0)},SS=(a,l)=>{"flexGrow"in l&&a.setFlexGrow(l.flexGrow??0),"flexShrink"in l&&a.setFlexShrink(typeof l.flexShrink=="number"?l.flexShrink:1),"flexWrap"in l&&(l.flexWrap==="nowrap"&&a.setFlexWrap(Qe.WRAP_NO_WRAP),l.flexWrap==="wrap"&&a.setFlexWrap(Qe.WRAP_WRAP),l.flexWrap==="wrap-reverse"&&a.setFlexWrap(Qe.WRAP_WRAP_REVERSE)),"flexDirection"in l&&(l.flexDirection==="row"&&a.setFlexDirection(Qe.FLEX_DIRECTION_ROW),l.flexDirection==="row-reverse"&&a.setFlexDirection(Qe.FLEX_DIRECTION_ROW_REVERSE),l.flexDirection==="column"&&a.setFlexDirection(Qe.FLEX_DIRECTION_COLUMN),l.flexDirection==="column-reverse"&&a.setFlexDirection(Qe.FLEX_DIRECTION_COLUMN_REVERSE)),"flexBasis"in l&&(typeof l.flexBasis=="number"?a.setFlexBasis(l.flexBasis):typeof l.flexBasis=="string"?a.setFlexBasisPercent(Number.parseInt(l.flexBasis,10)):a.setFlexBasis(Number.NaN)),"alignItems"in l&&((l.alignItems==="stretch"||!l.alignItems)&&a.setAlignItems(Qe.ALIGN_STRETCH),l.alignItems==="flex-start"&&a.setAlignItems(Qe.ALIGN_FLEX_START),l.alignItems==="center"&&a.setAlignItems(Qe.ALIGN_CENTER),l.alignItems==="flex-end"&&a.setAlignItems(Qe.ALIGN_FLEX_END)),"alignSelf"in l&&((l.alignSelf==="auto"||!l.alignSelf)&&a.setAlignSelf(Qe.ALIGN_AUTO),l.alignSelf==="flex-start"&&a.setAlignSelf(Qe.ALIGN_FLEX_START),l.alignSelf==="center"&&a.setAlignSelf(Qe.ALIGN_CENTER),l.alignSelf==="flex-end"&&a.setAlignSelf(Qe.ALIGN_FLEX_END)),"justifyContent"in l&&((l.justifyContent==="flex-start"||!l.justifyContent)&&a.setJustifyContent(Qe.JUSTIFY_FLEX_START),l.justifyContent==="center"&&a.setJustifyContent(Qe.JUSTIFY_CENTER),l.justifyContent==="flex-end"&&a.setJustifyContent(Qe.JUSTIFY_FLEX_END),l.justifyContent==="space-between"&&a.setJustifyContent(Qe.JUSTIFY_SPACE_BETWEEN),l.justifyContent==="space-around"&&a.setJustifyContent(Qe.JUSTIFY_SPACE_AROUND),l.justifyContent==="space-evenly"&&a.setJustifyContent(Qe.JUSTIFY_SPACE_EVENLY))},RS=(a,l)=>{"width"in l&&(typeof l.width=="number"?a.setWidth(l.width):typeof l.width=="string"?a.setWidthPercent(Number.parseInt(l.width,10)):a.setWidthAuto()),"height"in l&&(typeof l.height=="number"?a.setHeight(l.height):typeof l.height=="string"?a.setHeightPercent(Number.parseInt(l.height,10)):a.setHeightAuto()),"minWidth"in l&&(typeof l.minWidth=="string"?a.setMinWidthPercent(Number.parseInt(l.minWidth,10)):a.setMinWidth(l.minWidth??0)),"minHeight"in l&&(typeof l.minHeight=="string"?a.setMinHeightPercent(Number.parseInt(l.minHeight,10)):a.setMinHeight(l.minHeight??0))},xS=(a,l)=>{"display"in l&&a.setDisplay(l.display==="flex"?Qe.DISPLAY_FLEX:Qe.DISPLAY_NONE)},wS=(a,l)=>{if("borderStyle"in l){let c=l.borderStyle?1:0;l.borderTop!==!1&&a.setBorder(Qe.EDGE_TOP,c),l.borderBottom!==!1&&a.setBorder(Qe.EDGE_BOTTOM,c),l.borderLeft!==!1&&a.setBorder(Qe.EDGE_LEFT,c),l.borderRight!==!1&&a.setBorder(Qe.EDGE_RIGHT,c)}},NS=(a,l)=>{"gap"in l&&a.setGap(Qe.GUTTER_ALL,l.gap??0),"columnGap"in l&&a.setGap(Qe.GUTTER_COLUMN,l.columnGap??0),"rowGap"in l&&a.setGap(Qe.GUTTER_ROW,l.rowGap??0)},US=(a,l={})=>{vS(a,l),yS(a,l),FS(a,l),SS(a,l),RS(a,l),xS(a,l),wS(a,l),NS(a,l)},_I=US;if(MS.env.DEV==="true")try{await import("./devtools-4SYFVOFF.js")}catch(a){if(a.code==="ERR_MODULE_NOT_FOUND")console.warn(`
143
+ `)}function Zc(a){return Number.isInteger(a)?a>=4352&&(a<=4447||a===9001||a===9002||11904<=a&&a<=12871&&a!==12351||12880<=a&&a<=19903||19968<=a&&a<=42182||43360<=a&&a<=43388||44032<=a&&a<=55203||63744<=a&&a<=64255||65040<=a&&a<=65049||65072<=a&&a<=65131||65281<=a&&a<=65376||65504<=a&&a<=65510||110592<=a&&a<=110593||127488<=a&&a<=127569||131072<=a&&a<=262141):!1}var pS=/^[\uD800-\uDBFF][\uDC00-\uDFFF]$/,$D=["\x1B","\x9B"],gE=a=>`${$D[0]}[${a}m`,ZD=(a,l,c)=>{let B=[];a=[...a];for(let C of a){let y=C;C.includes(";")&&(C=C.split(";")[0][0]+"0");let m=Zt.codes.get(Number.parseInt(C,10));if(m){let N=a.indexOf(m.toString());N===-1?B.push(gE(l?m:y)):a.splice(N,1)}else if(l){B.push(gE(0));break}else B.push(gE(y))}if(l&&(B=B.filter((C,y)=>B.indexOf(C)===y),c!==void 0)){let C=gE(Zt.codes.get(Number.parseInt(c,10)));B=B.reduce((y,m)=>m===C?[m,...y]:[...y,m],[])}return B.join("")};function ca(a,l,c){let B=[...a],C=[],y=typeof c=="number"?c:B.length,m=!1,N,k=0,F="";for(let[Z,X]of B.entries()){let ge=!1;if($D.includes(X)){let we=/\d[^m]*/.exec(a.slice(Z,Z+18));N=we&&we.length>0?we[0]:void 0,k<y&&(m=!0,N!==void 0&&C.push(N))}else m&&X==="m"&&(m=!1,ge=!0);if(!m&&!ge&&k++,!pS.test(X)&&Zc(X.codePointAt())&&(k++,typeof c!="number"&&y++),k>l&&k<=y)F+=X;else if(k===l&&!m&&N!==void 0)F=ZD(C);else if(k>=y){F+=ZD(C,!0,N);break}}return F}function EE(a,l,c){if(a.charAt(l)===" ")return l;let B=c?1:-1;for(let C=0;C<=3;C++){let y=l+C*B;if(a.charAt(y)===" ")return y}return l}function bI(a,l,c={}){let{position:B="end",space:C=!1,preferTruncationOnSpace:y=!1}=c,{truncationCharacter:m="\u2026"}=c;if(typeof a!="string")throw new TypeError(`Expected \`input\` to be a string, got ${typeof a}`);if(typeof l!="number")throw new TypeError(`Expected \`columns\` to be a number, got ${typeof l}`);if(l<1)return"";if(l===1)return m;let N=Mn(a);if(N<=l)return a;if(B==="start"){if(y){let k=EE(a,N-l+1,!0);return m+ca(a,k,N).trim()}return C===!0&&(m+=" "),m+ca(a,N-l+Mn(m),N)}if(B==="middle"){C===!0&&(m=` ${m} `);let k=Math.floor(l/2);if(y){let F=EE(a,k),Z=EE(a,N-(l-k)+1,!0);return ca(a,0,F)+m+ca(a,Z,N).trim()}return ca(a,0,k)+m+ca(a,N-(l-k)+Mn(m),N)}if(B==="end"){if(y){let k=EE(a,l-1);return ca(a,0,k)+m}return C===!0&&(m=` ${m}`),ca(a,0,l-Mn(m))+m}throw new Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${B}`)}var eh={},DS=(a,l,c)=>{let B=a+String(l)+String(c),C=eh[B];if(C)return C;let y=a;if(c==="wrap"&&(y=JI(a,l,{trim:!1,hard:!0})),c.startsWith("truncate")){let m="end";c==="truncate-middle"&&(m="middle"),c==="truncate-start"&&(m="start"),y=bI(a,l,{position:m})}return eh[B]=y,y},dE=DS;var th=a=>{let l="";for(let c=0;c<a.childNodes.length;c++){let B=a.childNodes[c];if(B===void 0)continue;let C="";B.nodeName==="#text"?C=B.nodeValue:((B.nodeName==="ink-text"||B.nodeName==="ink-virtual-text")&&(C=th(B)),C.length>0&&typeof B.internal_transform=="function"&&(C=B.internal_transform(C,c))),l+=C}return l},BE=th;var IE=a=>{let l={nodeName:a,style:{},attributes:{},childNodes:[],parentNode:void 0,yogaNode:a==="ink-virtual-text"?void 0:Qe.Node.create()};return a==="ink-text"&&l.yogaNode?.setMeasureFunc(hS.bind(null,l)),l},CE=(a,l)=>{l.parentNode&&$c(l.parentNode,l),l.parentNode=a,a.childNodes.push(l),l.yogaNode&&a.yogaNode?.insertChild(l.yogaNode,a.yogaNode.getChildCount()),(a.nodeName==="ink-text"||a.nodeName==="ink-virtual-text")&&QE(a)},KI=(a,l,c)=>{l.parentNode&&$c(l.parentNode,l),l.parentNode=a;let B=a.childNodes.indexOf(c);if(B>=0){a.childNodes.splice(B,0,l),l.yogaNode&&a.yogaNode?.insertChild(l.yogaNode,B);return}a.childNodes.push(l),l.yogaNode&&a.yogaNode?.insertChild(l.yogaNode,a.yogaNode.getChildCount()),(a.nodeName==="ink-text"||a.nodeName==="ink-virtual-text")&&QE(a)},$c=(a,l)=>{l.yogaNode&&l.parentNode?.yogaNode?.removeChild(l.yogaNode),l.parentNode=void 0;let c=a.childNodes.indexOf(l);c>=0&&a.childNodes.splice(c,1),(a.nodeName==="ink-text"||a.nodeName==="ink-virtual-text")&&QE(a)},YI=(a,l,c)=>{a.attributes[l]=c},zI=(a,l)=>{a.style=l},Ah=a=>{let l={nodeName:"#text",nodeValue:a,yogaNode:void 0,parentNode:void 0,style:{}};return ef(l,a),l},hS=function(a,l){let c=a.nodeName==="#text"?a.nodeValue:BE(a),B=TI(c);if(B.width<=l||B.width>=1&&l>0&&l<1)return B;let C=a.style?.textWrap??"wrap",y=dE(c,l,C);return TI(y)},nh=a=>{if(a?.parentNode)return a.yogaNode??nh(a.parentNode)},QE=a=>{nh(a)?.markDirty()},ef=(a,l)=>{typeof l!="string"&&(l=String(l)),a.nodeValue=l,QE(a)};var vS=(a,l)=>{"position"in l&&a.setPositionType(l.position==="absolute"?Qe.POSITION_TYPE_ABSOLUTE:Qe.POSITION_TYPE_RELATIVE)},yS=(a,l)=>{"margin"in l&&a.setMargin(Qe.EDGE_ALL,l.margin??0),"marginX"in l&&a.setMargin(Qe.EDGE_HORIZONTAL,l.marginX??0),"marginY"in l&&a.setMargin(Qe.EDGE_VERTICAL,l.marginY??0),"marginLeft"in l&&a.setMargin(Qe.EDGE_START,l.marginLeft||0),"marginRight"in l&&a.setMargin(Qe.EDGE_END,l.marginRight||0),"marginTop"in l&&a.setMargin(Qe.EDGE_TOP,l.marginTop||0),"marginBottom"in l&&a.setMargin(Qe.EDGE_BOTTOM,l.marginBottom||0)},FS=(a,l)=>{"padding"in l&&a.setPadding(Qe.EDGE_ALL,l.padding??0),"paddingX"in l&&a.setPadding(Qe.EDGE_HORIZONTAL,l.paddingX??0),"paddingY"in l&&a.setPadding(Qe.EDGE_VERTICAL,l.paddingY??0),"paddingLeft"in l&&a.setPadding(Qe.EDGE_LEFT,l.paddingLeft||0),"paddingRight"in l&&a.setPadding(Qe.EDGE_RIGHT,l.paddingRight||0),"paddingTop"in l&&a.setPadding(Qe.EDGE_TOP,l.paddingTop||0),"paddingBottom"in l&&a.setPadding(Qe.EDGE_BOTTOM,l.paddingBottom||0)},SS=(a,l)=>{"flexGrow"in l&&a.setFlexGrow(l.flexGrow??0),"flexShrink"in l&&a.setFlexShrink(typeof l.flexShrink=="number"?l.flexShrink:1),"flexWrap"in l&&(l.flexWrap==="nowrap"&&a.setFlexWrap(Qe.WRAP_NO_WRAP),l.flexWrap==="wrap"&&a.setFlexWrap(Qe.WRAP_WRAP),l.flexWrap==="wrap-reverse"&&a.setFlexWrap(Qe.WRAP_WRAP_REVERSE)),"flexDirection"in l&&(l.flexDirection==="row"&&a.setFlexDirection(Qe.FLEX_DIRECTION_ROW),l.flexDirection==="row-reverse"&&a.setFlexDirection(Qe.FLEX_DIRECTION_ROW_REVERSE),l.flexDirection==="column"&&a.setFlexDirection(Qe.FLEX_DIRECTION_COLUMN),l.flexDirection==="column-reverse"&&a.setFlexDirection(Qe.FLEX_DIRECTION_COLUMN_REVERSE)),"flexBasis"in l&&(typeof l.flexBasis=="number"?a.setFlexBasis(l.flexBasis):typeof l.flexBasis=="string"?a.setFlexBasisPercent(Number.parseInt(l.flexBasis,10)):a.setFlexBasis(Number.NaN)),"alignItems"in l&&((l.alignItems==="stretch"||!l.alignItems)&&a.setAlignItems(Qe.ALIGN_STRETCH),l.alignItems==="flex-start"&&a.setAlignItems(Qe.ALIGN_FLEX_START),l.alignItems==="center"&&a.setAlignItems(Qe.ALIGN_CENTER),l.alignItems==="flex-end"&&a.setAlignItems(Qe.ALIGN_FLEX_END)),"alignSelf"in l&&((l.alignSelf==="auto"||!l.alignSelf)&&a.setAlignSelf(Qe.ALIGN_AUTO),l.alignSelf==="flex-start"&&a.setAlignSelf(Qe.ALIGN_FLEX_START),l.alignSelf==="center"&&a.setAlignSelf(Qe.ALIGN_CENTER),l.alignSelf==="flex-end"&&a.setAlignSelf(Qe.ALIGN_FLEX_END)),"justifyContent"in l&&((l.justifyContent==="flex-start"||!l.justifyContent)&&a.setJustifyContent(Qe.JUSTIFY_FLEX_START),l.justifyContent==="center"&&a.setJustifyContent(Qe.JUSTIFY_CENTER),l.justifyContent==="flex-end"&&a.setJustifyContent(Qe.JUSTIFY_FLEX_END),l.justifyContent==="space-between"&&a.setJustifyContent(Qe.JUSTIFY_SPACE_BETWEEN),l.justifyContent==="space-around"&&a.setJustifyContent(Qe.JUSTIFY_SPACE_AROUND),l.justifyContent==="space-evenly"&&a.setJustifyContent(Qe.JUSTIFY_SPACE_EVENLY))},RS=(a,l)=>{"width"in l&&(typeof l.width=="number"?a.setWidth(l.width):typeof l.width=="string"?a.setWidthPercent(Number.parseInt(l.width,10)):a.setWidthAuto()),"height"in l&&(typeof l.height=="number"?a.setHeight(l.height):typeof l.height=="string"?a.setHeightPercent(Number.parseInt(l.height,10)):a.setHeightAuto()),"minWidth"in l&&(typeof l.minWidth=="string"?a.setMinWidthPercent(Number.parseInt(l.minWidth,10)):a.setMinWidth(l.minWidth??0)),"minHeight"in l&&(typeof l.minHeight=="string"?a.setMinHeightPercent(Number.parseInt(l.minHeight,10)):a.setMinHeight(l.minHeight??0))},xS=(a,l)=>{"display"in l&&a.setDisplay(l.display==="flex"?Qe.DISPLAY_FLEX:Qe.DISPLAY_NONE)},wS=(a,l)=>{if("borderStyle"in l){let c=l.borderStyle?1:0;l.borderTop!==!1&&a.setBorder(Qe.EDGE_TOP,c),l.borderBottom!==!1&&a.setBorder(Qe.EDGE_BOTTOM,c),l.borderLeft!==!1&&a.setBorder(Qe.EDGE_LEFT,c),l.borderRight!==!1&&a.setBorder(Qe.EDGE_RIGHT,c)}},NS=(a,l)=>{"gap"in l&&a.setGap(Qe.GUTTER_ALL,l.gap??0),"columnGap"in l&&a.setGap(Qe.GUTTER_COLUMN,l.columnGap??0),"rowGap"in l&&a.setGap(Qe.GUTTER_ROW,l.rowGap??0)},US=(a,l={})=>{vS(a,l),yS(a,l),FS(a,l),SS(a,l),RS(a,l),xS(a,l),wS(a,l),NS(a,l)},_I=US;if(MS.env.DEV==="true")try{await import("./devtools-6FR6UXUE.js")}catch(a){if(a.code==="ERR_MODULE_NOT_FOUND")console.warn(`
144
144
  The environment variable DEV is set to true, so Ink tried to import \`react-devtools-core\`,
145
145
  but this failed as it was not installed. Debugging with React Devtools requires it.
146
146
 
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as S}from"./chunk-KEU7JQAB.js";import{a as E}from"./chunk-LDQZDX3F.js";import{a as R}from"./chunk-HCBYKLMW.js";import{t as s}from"./chunk-M7JR2ZX5.js";import{a as m,b as i,i as L}from"./chunk-C44QQJR4.js";import{a as O}from"./chunk-6YGTRKDT.js";import{a as w}from"./chunk-HFQ7T5KT.js";import{e as b}from"./chunk-UR6MHSHU.js";var o=b(O(),1);var e=b(R(),1);function U(r,p,u){return{id:r,label:`${p} (${r})`,isActive:r===u}}function q({resolver:r,currentProjectId:p,env:u,onSelect:N,onCancel:y}){let[I,A]=(0,o.useState)([]),[_,h]=(0,o.useState)(!0),[$,j]=(0,o.useState)(null),[l,f]=(0,o.useState)("list"),[v,T]=(0,o.useState)(""),[B,d]=(0,o.useState)(null),g=(0,o.useRef)(!1);return(0,o.useEffect)(()=>{if(!r){j("Login first to browse projects"),h(!1);return}(async()=>{try{let t=r.cached??await r.resolve();if(!t){j("Login first to browse projects"),h(!1);return}let n=E(u),x=(await new w(n.tmsBaseUrl,t.username,t.access_key).listProjects()).map(P=>U(P.project_id,P.name,p));A(x),x.length===0&&(g.current=!0,f("naming"))}catch(t){j(t instanceof Error?t.message:String(t))}finally{h(!1)}})()},[r,p,u]),L((t,n)=>{if(l==="naming"){if(n.escape){T(""),d(null),g.current?y():f("list");return}if(n.return){let c=v.trim();if(!c){d("Name cannot be empty");return}d(null),f("creating"),(async()=>{try{if(!r)throw new Error("Not authenticated");let a=r.cached??await r.resolve();if(!a)throw new Error("Not authenticated");let x=E(u),C=await new w(x.tmsBaseUrl,a.username,a.access_key).createProject(c);N(C.id,C.name)}catch(a){d(a instanceof Error?a.message:String(a)),f("naming")}})();return}if(n.backspace||n.delete){T(c=>c.slice(0,-1));return}n.tab||n.ctrl||n.meta||t&&T(c=>c+t)}}),l==="naming"||l==="creating"?(0,e.jsxs)(m,{flexDirection:"column",borderStyle:"round",borderColor:s.primary,paddingX:2,paddingY:1,children:[(0,e.jsx)(i,{color:s.primary,bold:!0,children:"Create new project"}),g.current&&(0,e.jsx)(m,{marginTop:1,children:(0,e.jsx)(i,{color:s.dim,children:"No projects yet \u2014 let's create one."})}),(0,e.jsxs)(m,{marginTop:1,children:[(0,e.jsx)(i,{color:s.dim,children:"Name: "}),(0,e.jsx)(i,{children:v}),l==="naming"&&(0,e.jsx)(i,{inverse:!0,children:" "})]}),B&&(0,e.jsx)(m,{marginTop:1,children:(0,e.jsx)(i,{color:s.red,children:B})}),l==="creating"&&(0,e.jsx)(m,{marginTop:1,children:(0,e.jsx)(i,{color:s.dim,children:"Creating..."})}),l==="naming"&&(0,e.jsx)(m,{marginTop:1,children:(0,e.jsxs)(i,{color:s.dim,children:["\u21B5 create \xB7 esc ",g.current?"cancel":"back"]})})]}):(0,e.jsx)(S,{title:"Projects",items:I,loading:_,error:$,itemNoun:"projects",onTab:()=>{g.current=!1,f("naming")},extraHint:"tab to create new",onSelect:t=>{let n=t.label.replace(` (${t.id})`,"");N(t.id,n)},onCancel:y})}export{U as a,q as b};
@@ -0,0 +1,106 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as V}from"./chunk-LDQZDX3F.js";import{c as K,l as _,m as B,n as E,o as Y,p as G,q as X,r as q}from"./chunk-M7JR2ZX5.js";import{createServer as qe}from"http";import{randomBytes as Ve}from"crypto";import{URL as Qe}from"url";import ce from"process";import{Buffer as le}from"buffer";import de from"path";import{fileURLToPath as Ue}from"url";import{promisify as He}from"util";import fe from"child_process";import je,{constants as ze}from"fs/promises";import re from"process";import te,{constants as Se}from"fs/promises";import ee from"process";import be from"os";import L from"fs";import ve from"fs";import Q from"fs";var T;function we(){try{return Q.statSync("/.dockerenv"),!0}catch{return!1}}function ye(){try{return Q.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function F(){return T===void 0&&(T=we()||ye()),T}var O,xe=()=>{try{return ve.statSync("/run/.containerenv"),!0}catch{return!1}};function h(){return O===void 0&&(O=xe()||F()),O}var Z=()=>{if(ee.platform!=="linux")return!1;if(be.release().toLowerCase().includes("microsoft"))return!h();try{if(L.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft"))return!h()}catch{}return L.existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")||L.existsSync("/run/WSL")?!h():!1},m=ee.env.__IS_WSL_TEST__?Z:Z();var Pe=(()=>{let o="/mnt/",e;return async function(){if(e)return e;let r="/etc/wsl.conf",t=!1;try{await te.access(r,Se.F_OK),t=!0}catch{}if(!t)return o;let i=await te.readFile(r,{encoding:"utf8"}),n=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(i);return n?(e=n.groups.mountPoint.trim(),e=e.endsWith("/")?e:`${e}/`,e):o}})(),Ce=async()=>`${await Pe()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`,I=async()=>m?Ce():`${re.env.SYSTEMROOT||re.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;function p(o,e,r){let t=i=>Object.defineProperty(o,e,{value:i,enumerable:!0,writable:!0});return Object.defineProperty(o,e,{configurable:!0,enumerable:!0,get(){let i=r();return t(i),i},set(i){t(i)}}),o}import{promisify as $e}from"util";import N from"process";import{execFile as Re}from"child_process";import{promisify as Ae}from"util";import ke from"process";import{execFile as _e}from"child_process";var Be=Ae(_e);async function M(){if(ke.platform!=="darwin")throw new Error("macOS only");let{stdout:o}=await Be("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]),r=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(o)?.groups.id??"com.apple.Safari";return r==="com.apple.safari"?"com.apple.Safari":r}import Ee from"process";import{promisify as Te}from"util";import{execFile as Fe,execFileSync as Pr}from"child_process";var Oe=Te(Fe);async function oe(o,{humanReadableOutput:e=!0,signal:r}={}){if(Ee.platform!=="darwin")throw new Error("macOS only");let t=e?[]:["-ss"],i={};r&&(i.signal=r);let{stdout:n}=await Oe("osascript",["-e",o,t],i);return n.trim()}async function $(o){return oe(`tell application "Finder" to set app_path to application file id "${o}" as string
3
+ tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}import{promisify as Le}from"util";import{execFile as Ie}from"child_process";var Me=Le(Ie),P={MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},MSEdgeBHTML:{name:"Edge Beta",id:"com.microsoft.edge.beta"},MSEdgeDHTML:{name:"Edge Dev",id:"com.microsoft.edge.dev"},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},ChromeBHTML:{name:"Chrome Beta",id:"com.google.chrome.beta"},ChromeDHTML:{name:"Chrome Dev",id:"com.google.chrome.dev"},ChromiumHTM:{name:"Chromium",id:"org.chromium.Chromium"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveDHTML:{name:"Brave Dev",id:"com.brave.Browser.dev"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},OperaStable:{name:"Opera",id:"com.operasoftware.Opera"},VivaldiHTM:{name:"Vivaldi",id:"com.vivaldi.Vivaldi"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"}},Er=new Map(Object.entries(P)),R=class extends Error{};async function D(o=Me){let{stdout:e}=await o("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),r=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(e);if(!r)throw new R(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:t}=r.groups,i=t.lastIndexOf("."),n=t.lastIndexOf("-"),a=i===-1?void 0:t.slice(0,i),s=n===-1?void 0:t.slice(0,n);return P[t]??P[a]??P[s]??{name:t,id:t}}var De=$e(Re),Ne=o=>o.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase());async function U(){if(N.platform==="darwin"){let o=await M();return{name:await $(o),id:o}}if(N.platform==="linux"){let{stdout:o}=await De("xdg-mime",["query","default","x-scheme-handler/http"]),e=o.trim();return{name:Ne(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(N.platform==="win32")return D();throw new Error("Only macOS, Linux, and Windows are supported")}var We=He(fe.execFile),H=de.dirname(Ue(import.meta.url)),ie=de.join(H,"xdg-open"),{platform:v,arch:ne}=ce;async function Je(){let o=await I(),e=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,r=le.from(e,"utf16le").toString("base64"),{stdout:t}=await We(o,["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand",r],{encoding:"utf8"}),i=t.trim(),n={ChromeHTML:"com.google.chrome",BraveHTML:"com.brave.Browser",MSEdgeHTM:"com.microsoft.edge",FirefoxURL:"org.mozilla.firefox"};return n[i]?{id:n[i]}:{}}var se=async(o,e)=>{let r;for(let t of o)try{return await e(t)}catch(i){r=i}throw r},C=async o=>{if(o={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...o},Array.isArray(o.app))return se(o.app,s=>C({...o,app:s}));let{name:e,arguments:r=[]}=o.app??{};if(r=[...r],Array.isArray(e))return se(e,s=>C({...o,app:{name:s,arguments:r}}));if(e==="browser"||e==="browserPrivate"){let s={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.Browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge"},c={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},l=m?await Je():await U();if(l.id in s){let f=s[l.id];return e==="browserPrivate"&&r.push(c[f]),C({...o,app:{name:w[f],arguments:r}})}throw new Error(`${l.name} is not supported as a default browser`)}let t,i=[],n={};if(v==="darwin")t="open",o.wait&&i.push("--wait-apps"),o.background&&i.push("--background"),o.newInstance&&i.push("--new"),e&&i.push("-a",e);else if(v==="win32"||m&&!h()&&!e){t=await I(),i.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),m||(n.windowsVerbatimArguments=!0);let s=["Start"];o.wait&&s.push("-Wait"),e?(s.push(`"\`"${e}\`""`),o.target&&r.push(o.target)):o.target&&s.push(`"${o.target}"`),r.length>0&&(r=r.map(c=>`"\`"${c}\`""`),s.push("-ArgumentList",r.join(","))),o.target=le.from(s.join(" "),"utf16le").toString("base64")}else{if(e)t=e;else{let s=!H||H==="/",c=!1;try{await je.access(ie,ze.X_OK),c=!0}catch{}t=ce.versions.electron??(v==="android"||s||!c)?"xdg-open":ie}r.length>0&&i.push(...r),o.wait||(n.stdio="ignore",n.detached=!0)}v==="darwin"&&r.length>0&&i.push("--args",...r),o.target&&i.push(o.target);let a=fe.spawn(t,i,n);return o.wait?new Promise((s,c)=>{a.once("error",c),a.once("close",l=>{if(!o.allowNonzeroExitCode&&l>0){c(new Error(`Exited with code ${l}`));return}s(a)})}):(a.unref(),a)},Ke=(o,e)=>{if(typeof o!="string")throw new TypeError("Expected a `target`");return C({...e,target:o})};function ae(o){if(typeof o=="string"||Array.isArray(o))return o;let{[ne]:e}=o;if(!e)throw new Error(`${ne} is not supported`);return e}function A({[v]:o},{wsl:e}){if(e&&m)return ae(e);if(!o)throw new Error(`${v} is not supported`);return ae(o)}var w={};p(w,"chrome",()=>A({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));p(w,"brave",()=>A({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}}));p(w,"firefox",()=>A({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));p(w,"edge",()=>A({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));p(w,"browser",()=>"browser");p(w,"browserPrivate",()=>"browserPrivate");var ue=Ke;import{createHash as Ye,randomBytes as Ge}from"crypto";var x=class{authBaseUrl;consentUrl;constructor(e="prod"){let r=V(e);this.authBaseUrl=r.authBaseUrl,this.consentUrl=r.consentUrl}static generatePkce(){let e=Ge(96).toString("base64url").slice(0,128),r=Ye("sha256").update(e).digest("base64url");return[e,r]}buildAuthorizationUrl(e,r,t,i){let n=new URLSearchParams({response_type:"code",client_id:e,redirect_uri:i,scope:q,code_challenge:r,code_challenge_method:"S256",state:t});return`${this.consentUrl}/oauth2?${n.toString()}`}async registerClient(e){let r=await fetch(`${this.authBaseUrl}/oauth2/register`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_name:X,redirect_uris:[e],grant_types:["authorization_code"],response_types:["code"],client_type:"public",application_type:"native"})});if(!r.ok)throw new Error(`DCR failed: ${r.status} ${await r.text()}`);return r.json()}async exchangeCode(e,r,t,i){let n=await fetch(`${this.authBaseUrl}/oauth2/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grant_type:"authorization_code",code:e,redirect_uri:i,client_id:r,code_verifier:t})});if(!n.ok)throw new Error(`Token exchange failed: ${n.status}`);return n.json()}async refreshToken(e,r){let t=await fetch(`${this.authBaseUrl}/oauth2/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:e,client_id:r})});if(!t.ok)throw new Error(`Token refresh failed: ${t.status}`);return t.json()}async revokeToken(e,r,t="access_token"){await fetch(`${this.authBaseUrl}/oauth2/revoke`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e,token_type_hint:t,client_id:r})})}async validateToken(e){let r=new AbortController,t=setTimeout(()=>r.abort(),1e4);try{let i=await fetch(`${this.authBaseUrl}/api/user`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json","Content-Type":"application/json"},signal:r.signal});return clearTimeout(t),i.ok}catch{return clearTimeout(t),!1}}};import{readFileSync as b,writeFileSync as me,mkdirSync as pe,readdirSync as j,unlinkSync as u,existsSync as z,chmodSync as ge}from"fs";import{join as d,dirname as Xe}from"path";var k=class{baseDir;profilesDir;configFile;constructor(e=K){this.baseDir=e,this.profilesDir=d(e,"profiles"),this.configFile=d(e,"config.json")}readConfig(){try{return JSON.parse(b(this.configFile,"utf-8"))}catch{return{}}}writeConfig(e){pe(this.baseDir,{recursive:!0,mode:448}),me(this.configFile,JSON.stringify(e,null,2)+`
4
+ `),ge(this.configFile,384)}getActiveProfile(){return this.readConfig().active_profile??null}setActiveProfile(e){let r=this.readConfig();r.active_profile=e,this.writeConfig(r)}getDefaultEnv(){return this.readConfig().default_env??"prod"}setDefaultEnv(e){let r=this.readConfig();r.default_env=e,this.writeConfig(r)}credentialsPath(e,r){return d(this.profilesDir,e,r,"credentials")}clientPath(e,r){return d(this.profilesDir,e,r,"client.json")}basicAuthPath(e,r){return d(this.profilesDir,e,r,"basic-auth")}profileConfigPath(e,r){return d(this.profilesDir,e,r,"profile-config.json")}saveProfileConfig(e,r,t){let i=this.loadProfileConfig(e,r)??{};this.writeSecure(this.profileConfigPath(e,r),{...i,...t})}loadProfileConfig(e,r){try{return JSON.parse(b(this.profileConfigPath(e,r),"utf-8"))}catch{return null}}writeSecure(e,r){try{pe(Xe(e),{recursive:!0,mode:448}),me(e,JSON.stringify(r,null,2)+`
5
+ `),ge(e,384)}catch(t){let i=t instanceof Error?t.message:String(t);process.stderr.write(`[auth] Failed to save credentials: ${i}
6
+ `)}}saveCredentials(e,r,t){this.writeSecure(this.credentialsPath(e,r),t)}loadCredentials(e,r){try{return JSON.parse(b(this.credentialsPath(e,r),"utf-8"))}catch{return null}}saveClient(e,r,t){this.writeSecure(this.clientPath(e,r),t)}loadClient(e,r){try{return JSON.parse(b(this.clientPath(e,r),"utf-8"))}catch{return null}}getActiveCredentials(){let e=this.getActiveProfile();if(!e)return{credentials:null,profile:null,env:null};let r=this.getDefaultEnv();return{credentials:this.loadCredentials(e,r),profile:e,env:r}}saveBasicAuth(e,r,t){this.writeSecure(this.basicAuthPath(e,r),t)}loadBasicAuth(e,r){try{return JSON.parse(b(this.basicAuthPath(e,r),"utf-8"))}catch{return null}}deleteBasicAuth(e,r){try{u(this.basicAuthPath(e,r))}catch{}}resolveAuth(){let e=this.getActiveProfile();if(!e)return null;let r=this.getDefaultEnv(),t=this.loadBasicAuth(e,r);return t?{method:"basic",...t,profile:e,env:r}:this.loadCredentials(e,r)?{method:"oauth",profile:e,env:r}:null}listProfiles(){let e=[];try{for(let r of j(this.profilesDir)){let t=d(this.profilesDir,r);try{for(let i of j(t)){let n=d(t,i),a=z(d(n,"credentials")),s=z(d(n,"client.json")),c=z(d(n,"basic-auth"));(a||s||c)&&e.push({profile:r,env:i})}}catch{}}}catch{}return e}deleteProfile(e,r){try{u(this.credentialsPath(e,r))}catch{}if(this.getActiveProfile()===e){let t=this.readConfig();delete t.active_profile,this.writeConfig(t)}}deleteProfileFull(e,r){if(r){try{u(this.credentialsPath(e,r))}catch{}try{u(this.clientPath(e,r))}catch{}try{u(this.basicAuthPath(e,r))}catch{}try{u(this.profileConfigPath(e,r))}catch{}}else try{let t=d(this.profilesDir,e);for(let i of j(t)){try{u(d(t,i,"credentials"))}catch{}try{u(d(t,i,"client.json"))}catch{}try{u(d(t,i,"basic-auth"))}catch{}try{u(d(t,i,"profile-config.json"))}catch{}}}catch{}}};var he=class{profile;environment;creds;oauth;constructor(e="default",r="prod",t){this.profile=e,this.environment=r,this.creds=t??new k,this.oauth=new x(r)}async login(){let{server:e,port:r}=await this.startCallbackServer(),t=G(r);try{let i=this.creds.loadClient(this.profile,this.environment),n=i?.redirect_uris;(!i||!n?.includes(t))&&(i=await this.oauth.registerClient(t),this.creds.saveClient(this.profile,this.environment,i));let a=i.client_id,[s,c]=x.generatePkce(),l=Ve(32).toString("hex"),f=this.oauth.buildAuthorizationUrl(a,c,l,t),g=await this.waitForCallback(e,r,f,l);if(!g)throw new Error("Login cancelled or timed out");let y=await this.oauth.exchangeCode(g,a,s,t),S={access_token:y.access_token,refresh_token:y.refresh_token,expires_at:Math.floor(Date.now()/1e3)+y.expires_in,scope:y.scope??"*"};return this.creds.saveCredentials(this.profile,this.environment,S),this.creds.setActiveProfile(this.profile),S}catch(i){throw e.close(),i}}startCallbackServer(){return new Promise((e,r)=>{let t=B,i=()=>{let n=qe();n.on("error",a=>{a.code==="EADDRINUSE"&&t<E?(t++,i()):r(new Error(`Failed to start callback server: ${a.message}. Ports ${B}-${E} are all in use.`))}),n.listen(t,_,()=>{e({server:n,port:t})})};i()})}waitForCallback(e,r,t,i){return new Promise(n=>{let a=!1,s=setTimeout(()=>c(null),12e4),c=l=>{a||(a=!0,clearTimeout(s),e.close(),n(l))};e.on("request",(l,f)=>{let g=new Qe(l.url??"/",`http://${_}:${r}`);if(g.pathname!==Y){f.writeHead(404),f.end();return}let y=g.searchParams.get("state"),S=g.searchParams.get("code");if(g.searchParams.get("error")){f.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),f.end(W({state:"error",title:"Login failed",message:"We couldn't complete the sign-in. You can close this tab and try again from your terminal."})),c(null);return}if(y!==i){f.writeHead(400,{"Content-Type":"text/html; charset=utf-8"}),f.end(W({state:"error",title:"Invalid state",message:"The sign-in response didn't match this session. Please return to your terminal and try again."})),c(null);return}f.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),f.end(W({state:"success",title:"You're signed in",message:"Head back to your terminal \u2014 KaneAI is ready when you are.",autoClose:!0})),c(S)}),ue(t).catch(l=>{let f=l instanceof Error?l.message:String(l);process.stderr.write(`[auth] Could not open browser: ${f}
7
+ Please open this URL manually: ${t}
8
+ `)})})}};function W(o){let e=o.state==="success",r=e?"#22c55e":"#ef4444",t=e?"rgba(34, 197, 94, 0.12)":"rgba(239, 68, 68, 0.12)",i=e?'<svg viewBox="0 0 24 24" width="36" height="36" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12.5l4.5 4.5L19 7"/></svg>':'<svg viewBox="0 0 24 24" width="36" height="36" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 6l12 12M18 6L6 18"/></svg>',n=o.autoClose?"<script>setTimeout(function(){try{window.close();}catch(e){}}, 1500);</script>":"";return`<!doctype html>
9
+ <html lang="en">
10
+ <head>
11
+ <meta charset="utf-8" />
12
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
13
+ <title>${J(o.title)} \xB7 KaneAI</title>
14
+ <style>
15
+ :root {
16
+ color-scheme: light dark;
17
+ --bg: #f7f7f8;
18
+ --card: #ffffff;
19
+ --fg: #0a0a0a;
20
+ --muted: #6b7280;
21
+ --border: rgba(0, 0, 0, 0.06);
22
+ --shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
23
+ }
24
+ @media (prefers-color-scheme: dark) {
25
+ :root {
26
+ --bg: #0a0a0a;
27
+ --card: #141416;
28
+ --fg: #f5f5f7;
29
+ --muted: #9ca3af;
30
+ --border: rgba(255, 255, 255, 0.08);
31
+ --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
32
+ }
33
+ }
34
+ * { box-sizing: border-box; }
35
+ html, body { height: 100%; }
36
+ body {
37
+ margin: 0;
38
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
39
+ background: var(--bg);
40
+ color: var(--fg);
41
+ display: flex;
42
+ align-items: center;
43
+ justify-content: center;
44
+ padding: 24px;
45
+ -webkit-font-smoothing: antialiased;
46
+ }
47
+ .card {
48
+ width: 100%;
49
+ max-width: 420px;
50
+ background: var(--card);
51
+ border: 1px solid var(--border);
52
+ border-radius: 16px;
53
+ box-shadow: var(--shadow);
54
+ padding: 40px 32px 32px;
55
+ text-align: center;
56
+ animation: rise 280ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
57
+ }
58
+ @keyframes rise {
59
+ from { opacity: 0; transform: translateY(8px); }
60
+ to { opacity: 1; transform: translateY(0); }
61
+ }
62
+ .icon {
63
+ width: 64px;
64
+ height: 64px;
65
+ margin: 0 auto 20px;
66
+ border-radius: 999px;
67
+ display: flex;
68
+ align-items: center;
69
+ justify-content: center;
70
+ background: ${t};
71
+ color: ${r};
72
+ }
73
+ h1 {
74
+ font-size: 22px;
75
+ font-weight: 600;
76
+ letter-spacing: -0.01em;
77
+ margin: 0 0 8px;
78
+ }
79
+ p {
80
+ margin: 0;
81
+ color: var(--muted);
82
+ font-size: 14.5px;
83
+ line-height: 1.5;
84
+ }
85
+ .brand {
86
+ margin-top: 28px;
87
+ padding-top: 20px;
88
+ border-top: 1px solid var(--border);
89
+ font-size: 12px;
90
+ letter-spacing: 0.08em;
91
+ text-transform: uppercase;
92
+ color: var(--muted);
93
+ }
94
+ .brand strong { color: var(--fg); font-weight: 600; letter-spacing: 0.08em; }
95
+ </style>
96
+ </head>
97
+ <body>
98
+ <main class="card" role="status" aria-live="polite">
99
+ <div class="icon">${i}</div>
100
+ <h1>${J(o.title)}</h1>
101
+ <p>${J(o.message)}</p>
102
+ <div class="brand"><strong>KaneAI</strong> \xB7 CLI</div>
103
+ </main>
104
+ ${n}
105
+ </body>
106
+ </html>`}function J(o){return o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}export{k as a,x as b,he as c};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as m}from"./chunk-HCBYKLMW.js";import{t}from"./chunk-OIERCP6B.js";import{a as p,b as r,i as a}from"./chunk-Q7JVDEOV.js";import{a as f}from"./chunk-6YGTRKDT.js";import{e as s}from"./chunk-UR6MHSHU.js";var c=s(f(),1);var e=s(m(),1);function R({onSubmit:n}){let[o,l]=(0,c.useState)(0),u=(0,c.useRef)(!1);return a((x,i)=>{u.current||(i.leftArrow||i.rightArrow?l(d=>d===0?1:0):i.return?(u.current=!0,n(o===0?"positive":"negative")):i.escape&&(u.current=!0,n(null)))}),(0,e.jsxs)(p,{marginTop:1,children:[(0,e.jsx)(r,{color:t.secondary,children:"Rate this session: "}),(0,e.jsx)(r,{color:o===0?t.primary:t.dim,children:o===0?"[ \u{1F44D} ]":" \u{1F44D} "}),(0,e.jsx)(r,{children:" "}),(0,e.jsx)(r,{color:o===1?t.primary:t.dim,children:o===1?"[ \u{1F44E} ]":" \u{1F44E} "}),(0,e.jsx)(r,{color:t.dim,children:" \u2190/\u2192 select \xB7 Enter submit \xB7 Esc skip"})]})}export{R as a};
2
+ import{a as m}from"./chunk-HCBYKLMW.js";import{t}from"./chunk-M7JR2ZX5.js";import{a as p,b as r,i as a}from"./chunk-C44QQJR4.js";import{a as f}from"./chunk-6YGTRKDT.js";import{e as s}from"./chunk-UR6MHSHU.js";var c=s(f(),1);var e=s(m(),1);function R({onSubmit:n}){let[o,l]=(0,c.useState)(0),u=(0,c.useRef)(!1);return a((x,i)=>{u.current||(i.leftArrow||i.rightArrow?l(d=>d===0?1:0):i.return?(u.current=!0,n(o===0?"positive":"negative")):i.escape&&(u.current=!0,n(null)))}),(0,e.jsxs)(p,{marginTop:1,children:[(0,e.jsx)(r,{color:t.secondary,children:"Rate this session: "}),(0,e.jsx)(r,{color:o===0?t.primary:t.dim,children:o===0?"[ \u{1F44D} ]":" \u{1F44D} "}),(0,e.jsx)(r,{children:" "}),(0,e.jsx)(r,{color:o===1?t.primary:t.dim,children:o===1?"[ \u{1F44E} ]":" \u{1F44E} "}),(0,e.jsx)(r,{color:t.dim,children:" \u2190/\u2192 select \xB7 Enter submit \xB7 Esc skip"})]})}export{R as a};