cli-link 0.0.6 → 0.0.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 (57) hide show
  1. package/README.md +56 -14
  2. package/dist/client/assets/History-D2xDopni.js +4 -0
  3. package/dist/client/assets/ImageViewer-DuegU_fC.js +1 -0
  4. package/dist/client/assets/MarkdownRenderer-CsyizEL3.js +1 -0
  5. package/dist/client/assets/{PageTopBar-C8j-5s_3.js → PageTopBar-CQwjO6Af.js} +1 -1
  6. package/dist/client/assets/Session-B0s5zBGg.js +7 -0
  7. package/dist/client/assets/Settings-CfHFmJdV.js +1 -0
  8. package/dist/client/assets/Workspace-Cfl0mbNE.js +4 -0
  9. package/dist/client/assets/WorkspaceLinkedText-DCVYd9x-.js +2 -0
  10. package/dist/client/assets/c-BIGW1oBm.js +1 -0
  11. package/dist/client/assets/cpp-DIPi6g--.js +1 -0
  12. package/dist/client/assets/csharp-DSvCPggb.js +1 -0
  13. package/dist/client/assets/dart-bE4Kk8sk.js +1 -0
  14. package/dist/client/assets/dotenv-Da5cRb03.js +1 -0
  15. package/dist/client/assets/go-C27-OAKa.js +1 -0
  16. package/dist/client/assets/graphql-pNE0_Gx8.js +1 -0
  17. package/dist/client/assets/groovy-gcz8RCvz.js +1 -0
  18. package/dist/client/assets/index-BCg3ymV3.css +1 -0
  19. package/dist/client/assets/index-CrJqHlc8.js +2 -0
  20. package/dist/client/assets/java-VnEXKtx_.js +148 -0
  21. package/dist/client/assets/jsx-g9-lgVsj.js +1 -0
  22. package/dist/client/assets/kotlin-BdnUsdx6.js +1 -0
  23. package/dist/client/assets/less-B1dDrJ26.js +1 -0
  24. package/dist/client/assets/lua-BaeVxFsk.js +1 -0
  25. package/dist/client/assets/makefile-CHLpvVh8.js +1 -0
  26. package/dist/client/assets/php-BcCyJq-p.js +1 -0
  27. package/dist/client/assets/properties-DTPjHERo.js +1 -0
  28. package/dist/client/assets/ruby-BwImf3Ka.js +1 -0
  29. package/dist/client/assets/rust-B1yitclQ.js +1 -0
  30. package/dist/client/assets/scss-lMagJa-5.js +1 -0
  31. package/dist/client/assets/sql-CRqJ_cUM.js +1 -0
  32. package/dist/client/assets/svelte-B4a9v_or.js +1 -0
  33. package/dist/client/assets/swift-D82vCrfD.js +1 -0
  34. package/dist/client/assets/toml-vGWfd6FD.js +1 -0
  35. package/dist/client/assets/{vendor-icons-CNN4EKVi.js → vendor-icons-CMXJHDEv.js} +125 -65
  36. package/dist/client/assets/vendor-markdown--d-T3AbU.js +37 -0
  37. package/dist/client/assets/{vendor-motion-n6Lx6G4a.js → vendor-motion-D0ZmPdi9.js} +1 -1
  38. package/dist/client/assets/{vendor-react-DSV5aFEg.js → vendor-react-CcDXZHn_.js} +1 -1
  39. package/dist/client/assets/{vendor-virtual-CcftJrIC.js → vendor-virtual-DJI7OicV.js} +1 -1
  40. package/dist/client/assets/vue-DBXACu8K.js +1 -0
  41. package/dist/client/assets/workspace-return-FrQUv7g3.js +1 -0
  42. package/dist/client/index.html +4 -4
  43. package/dist/server/cli-manager.js +151 -26
  44. package/dist/server/codex-history.js +119 -17
  45. package/dist/server/index.js +906 -57
  46. package/dist/server/store.js +369 -27
  47. package/package.json +3 -3
  48. package/dist/client/assets/History-BxJVDFpN.js +0 -3
  49. package/dist/client/assets/MarkdownRenderer-BO-KS_L1.js +0 -1
  50. package/dist/client/assets/Session-CQFXA2Sr.js +0 -11
  51. package/dist/client/assets/Settings-DYmjRmoN.js +0 -1
  52. package/dist/client/assets/Workspace-D8kv9euM.js +0 -8
  53. package/dist/client/assets/WorkspaceLinkedText-DQyPLk-X.js +0 -2
  54. package/dist/client/assets/code-highlight-CEcsuMpw.js +0 -1
  55. package/dist/client/assets/index-BXT2BylN.css +0 -1
  56. package/dist/client/assets/index-DOgH1Kf3.js +0 -2
  57. package/dist/client/assets/vendor-markdown-BDwu-Ux6.js +0 -35
@@ -0,0 +1 @@
1
+ import{r as l,j as e,u as he}from"./vendor-react-CcDXZHn_.js";import{i as ne,j as pe,p as fe,b as le,u as be,k as ke,c as y}from"./index-CrJqHlc8.js";import{A as je,m as ie}from"./vendor-motion-D0ZmPdi9.js";import{X as de,o as we,a7 as Ne,j as te,a8 as ce,a9 as K,i as ve,g as $,e as Ce,D as ye,F as Se,aa as Le,ab as Ie,ac as Ae,x as oe,a6 as z,d as Pe,M as Te,ad as De,p as Re,T as Ee,ae as Me,af as _e,ag as We,s as Fe,ah as Oe}from"./vendor-icons-CMXJHDEv.js";import{P as Be}from"./PageTopBar-CQwjO6Af.js";function qe(){const[r,a]=l.useState(()=>ne());l.useEffect(()=>pe(()=>{a(ne())}),[]);const s=l.useCallback(async()=>fe(),[]);return{...r,promptInstall:s}}const ue="agentpilot_favorite_workdirs",Ue=30,$e={home:e.jsx(Ie,{className:"w-4 h-4"}),desktop:e.jsx(Le,{className:"w-4 h-4"}),documents:e.jsx(Se,{className:"w-4 h-4"}),downloads:e.jsx(ye,{className:"w-4 h-4"})},Ge={favorite:"常用",recent:"最近",quick:"快捷",current:"当前目录"},X={favorite:4,recent:3,quick:2,current:1};function xe(){if(typeof window>"u")return[];try{const r=JSON.parse(window.localStorage.getItem(ue)||"[]");return Array.isArray(r)?r.filter(a=>typeof a=="string"):[]}catch{return[]}}function Qe(r){typeof window>"u"||window.localStorage.setItem(ue,JSON.stringify(r))}function me(r){const a=r.split(/[\\/]/).filter(Boolean);return a[a.length-1]||r||"工作目录"}function re(r){return r.replace(/^\/Users\/[^/]+/,"~").replace(/\/+/g,"/")}function ae(r){return r.toLowerCase().replace(/\\/g,"/").trim()}function He(r){return r.split(/[\\/._\-\s]+/).filter(Boolean).map(a=>a[0]).join("").toLowerCase()}function Je(r){const a=r.trim();return a==="~"||a.startsWith("~/")||a.startsWith("/")||a.startsWith("./")||a.startsWith("../")||a.includes("/")||a.includes("\\")}function Ke(r,a){const s=ae(a);if(!s)return 1;const c=ae(r.name),g=ae(r.path),E=He(r.path);return s.split(/\s+/).filter(Boolean).every(L=>c.includes(L)||g.includes(L)||E.includes(L))?c===s?120:g===s?115:c.startsWith(s)?100:g.endsWith(`/${s}`)?95:c.includes(s)?80:g.includes(s)?60:E.startsWith(s)?45:30:0}function ze(r){const a=new Map;for(const s of r){const c=a.get(s.path);(!c||X[s.source]>X[c.source])&&a.set(s.path,s)}return Array.from(a.values())}const Xe=({open:r,currentDir:a,onSelect:s,onClose:c})=>{const[g,E]=l.useState(a),[m,L]=l.useState([]),[M,V]=l.useState(""),[G,N]=l.useState(!1),[I,Y]=l.useState([]),[_,v]=l.useState([]),[h,C]=l.useState(()=>xe()),[p,f]=l.useState(""),[A,u]=l.useState(!1),[O,Q]=l.useState(!1),[P,o]=l.useState(""),T=l.useCallback(async t=>{u(!0),o("");try{const i=await le.listDir(t);return E(i.dir),L(i.dirs),V(i.parent),N(i.isRoot),Y(i.quickAccess),!0}catch(i){return o(i.message||"加载失败"),!1}finally{u(!1)}},[]),x=l.useCallback(async()=>{Q(!0);try{const t=await le.fetchWorkdirs();v(t.workdirs)}catch{v([])}finally{Q(!1)}},[]);l.useEffect(()=>{r&&(f(""),C(xe()),T(a),x())},[r,a,T,x]);const b=l.useMemo(()=>{const t=new Map(_.map(i=>[i.path,i]));return h.map(i=>{const n=t.get(i);return{name:(n==null?void 0:n.name)||me(i),path:i,source:"favorite"}})},[h,_]),D=l.useMemo(()=>_.map(t=>({name:t.name,path:t.path,source:h.includes(t.path)?"favorite":"recent"})),[h,_]),R=l.useMemo(()=>{const t=p.trim();return t?ze([...b,...D,...I.map(n=>({name:n.name,path:n.path,source:"quick"})),...m.map(n=>({name:n.name,path:n.path,source:"current"}))]).map(n=>({...n,score:Ke(n,t)+X[n.source]*5})).filter(n=>n.score>X[n.source]*5).sort((n,w)=>(w.score||0)-(n.score||0)||n.name.localeCompare(w.name)).slice(0,24):[]},[m,b,D,p,I]),B=l.useMemo(()=>D.filter(t=>t.path!==g&&t.source==="recent").slice(0,8),[g,D]),k=p.trim(),q=k.length>0&&Je(k),W=async t=>{await T(t)&&f("")},H=()=>{s(g),c()},J=async()=>{if(!q)return;await T(k)&&f("")},Z=async()=>{if(k){if(q){await J();return}R[0]&&await W(R[0].path)}},ee=t=>{C(i=>{const n=i.includes(t)?i.filter(w=>w!==t):[t,...i].slice(0,Ue);return Qe(n),n})},j=(t,i)=>{const n=h.includes(t);return e.jsx("button",{type:"button",onClick:()=>ee(t),className:`p-2 rounded-lg transition-colors flex-shrink-0 ${n?"text-amber-500 hover:bg-amber-50 dark:text-amber-400 dark:hover:bg-amber-950":"text-gray-300 hover:text-amber-500 hover:bg-gray-50 dark:text-gray-600 dark:hover:text-amber-400 dark:hover:bg-gray-800"}`,"aria-label":n?`取消收藏 ${i}`:`收藏 ${i}`,title:n?"取消收藏":"收藏",children:e.jsx(K,{className:"w-4 h-4",fill:n?"currentColor":"none"})})},F=(t,i={})=>e.jsxs("div",{className:"w-full flex items-center rounded-lg hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors",children:[e.jsxs("button",{type:"button",onClick:()=>W(t.path),className:"min-w-0 flex-1 flex items-center gap-3 px-3 py-3 text-left",children:[e.jsx("span",{className:"text-gray-500 dark:text-gray-400 flex-shrink-0",children:i.icon||e.jsx(te,{className:"w-5 h-5 text-amber-500 dark:text-amber-400"})}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block text-sm text-gray-700 dark:text-gray-300 truncate",children:t.name}),e.jsx("span",{className:"block text-[11px] text-gray-400 dark:text-gray-500 font-mono truncate",children:i.showSource?`${Ge[t.source]} · ${re(t.path)}`:re(t.path)})]}),e.jsx(Ce,{className:"w-4 h-4 text-gray-300 dark:text-gray-600 flex-shrink-0"})]}),j(t.path,t.name)]},`${t.source}-${t.path}`);return e.jsx(je,{children:r&&e.jsxs(e.Fragment,{children:[e.jsx(ie.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/50 z-40",onClick:c}),e.jsxs(ie.div,{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"},transition:{type:"spring",damping:25,stiffness:300},className:"fixed bottom-0 left-0 right-0 bg-white dark:bg-gray-900 rounded-t-2xl z-50 flex flex-col",style:{maxHeight:"84vh"},children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 dark:border-gray-800",children:[e.jsx("h3",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:"选择工作目录"}),e.jsx("button",{onClick:c,className:"p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",children:e.jsx(de,{className:"w-5 h-5"})})]}),e.jsxs("div",{className:"px-4 py-3 border-b border-gray-100 dark:border-gray-800 space-y-2",children:[e.jsxs("div",{className:"relative",children:[e.jsx(we,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"}),e.jsx("input",{type:"text",value:p,onChange:t=>f(t.target.value),onKeyDown:t=>{t.key==="Enter"&&(t.preventDefault(),Z())},placeholder:"搜索目录或粘贴路径",className:"w-full rounded-lg border border-gray-200 bg-gray-50 py-2 pl-9 pr-9 text-sm text-gray-900 outline-none transition-colors focus:border-primary-500 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-100"}),p&&e.jsx("button",{type:"button",onClick:()=>f(""),className:"absolute right-2 top-1/2 -translate-y-1/2 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-700 dark:hover:text-gray-300","aria-label":"清空搜索",children:e.jsx(de,{className:"h-4 w-4"})})]}),q&&e.jsxs("button",{type:"button",onClick:J,className:"w-full flex items-center gap-2 rounded-lg border border-dashed border-primary-200 bg-primary-50 px-3 py-2 text-left text-sm text-primary-700 transition-colors hover:bg-primary-100 dark:border-primary-800 dark:bg-primary-950 dark:text-primary-300 dark:hover:bg-primary-900",children:[e.jsx(Ne,{className:"w-4 h-4 flex-shrink-0"}),e.jsxs("span",{className:"min-w-0 flex-1 truncate",children:["跳转到 ",k]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm font-mono text-primary-600 dark:text-primary-400 bg-primary-50 dark:bg-primary-950 rounded-lg px-3 py-2",children:[e.jsx(te,{className:"w-4 h-4 flex-shrink-0"}),e.jsx("span",{className:"min-w-0 flex-1 overflow-x-auto whitespace-nowrap",children:re(g)}),j(g,me(g))]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto overscroll-contain",children:p.trim()?e.jsxs("div",{className:"px-4 py-2",children:[e.jsx("div",{className:"text-xs font-medium text-gray-400 dark:text-gray-500 uppercase tracking-wider mb-1",children:"匹配结果"}),R.length===0?e.jsx("div",{className:"px-3 py-4 text-center text-sm text-gray-400",children:"没有匹配目录"}):e.jsx("div",{className:"space-y-0.5",children:R.map(t=>F(t,{showSource:!0,icon:t.source==="recent"?e.jsx(ce,{className:"w-5 h-5 text-blue-500 dark:text-blue-400"}):t.source==="favorite"?e.jsx(K,{className:"w-5 h-5 text-amber-500 dark:text-amber-400",fill:"currentColor"}):void 0}))})]}):e.jsxs(e.Fragment,{children:[b.length>0&&e.jsxs("div",{className:"px-4 py-2",children:[e.jsx("div",{className:"text-xs font-medium text-gray-400 dark:text-gray-500 uppercase tracking-wider mb-1",children:"常用目录"}),e.jsx("div",{className:"space-y-0.5",children:b.slice(0,8).map(t=>F(t,{icon:e.jsx(K,{className:"w-5 h-5 text-amber-500 dark:text-amber-400",fill:"currentColor"})}))})]}),(B.length>0||O)&&e.jsxs("div",{className:"px-4 py-2",children:[e.jsx("div",{className:"text-xs font-medium text-gray-400 dark:text-gray-500 uppercase tracking-wider mb-1",children:"最近使用"}),O?e.jsx("div",{className:"px-3 py-3 text-sm text-gray-400",children:"加载最近目录..."}):e.jsx("div",{className:"space-y-0.5",children:B.map(t=>F(t,{icon:t.source==="favorite"?e.jsx(K,{className:"w-5 h-5 text-amber-500 dark:text-amber-400",fill:"currentColor"}):e.jsx(ce,{className:"w-5 h-5 text-blue-500 dark:text-blue-400"})}))})]}),I.length>0&&e.jsxs("div",{className:"px-4 py-2",children:[e.jsx("div",{className:"text-xs font-medium text-gray-400 dark:text-gray-500 uppercase tracking-wider mb-1",children:"快捷访问"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:I.map(t=>e.jsxs("button",{onClick:()=>W(t.path),className:"flex items-center gap-2 px-3 py-2.5 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors text-left",children:[e.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:$e[t.icon]||e.jsx(te,{className:"w-4 h-4"})}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 truncate",children:t.name})]},t.path))})]}),e.jsxs("div",{className:"px-4 py-2",children:[e.jsx("div",{className:"text-xs font-medium text-gray-400 dark:text-gray-500 uppercase tracking-wider mb-1",children:"目录列表"}),!G&&e.jsxs("button",{onClick:()=>W(M),className:"w-full flex items-center gap-3 px-3 py-3 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors text-left",children:[e.jsx(ve,{className:"w-5 h-5 text-gray-400"}),e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:"返回上级目录"})]}),A&&e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx("div",{className:"w-6 h-6 border-2 border-primary-600 border-t-transparent rounded-full animate-spin"})}),P&&e.jsx("div",{className:"px-3 py-4 text-center text-sm text-red-500",children:P}),!A&&!P&&m.length===0&&e.jsx("div",{className:"px-3 py-4 text-center text-sm text-gray-400",children:"此目录下没有子目录"}),!A&&!P&&m.map(t=>F({...t,source:"current"}))]})]})}),e.jsx("div",{className:"px-4 py-3 border-t border-gray-100 dark:border-gray-800 bg-white dark:bg-gray-900 pb-safe",children:e.jsxs("button",{onClick:H,className:"w-full py-3 flex items-center justify-center gap-2 text-sm font-medium text-white bg-primary-600 rounded-xl hover:bg-primary-700 transition-colors active:scale-[0.98]",children:[e.jsx($,{className:"w-4 h-4"}),"使用此目录"]})})]})]})})},Ve=["--dangerously-bypass-approvals-and-sandbox","-m","gpt-5.5","-c",'model_reasoning_effort="xhigh"',"-c",'service_tier="priority"'],U={claude:{label:"Claude Code",command:"claude",cliArgs:["--dangerously-skip-permissions"],dangerArg:"--dangerously-skip-permissions"},codex:{label:"Codex CLI",command:"codex",cliArgs:Ve,dangerArg:"--dangerously-bypass-approvals-and-sandbox",modelLabel:"GPT-5.5",intelligenceLabel:"xhigh",speedLabel:"priority"}};function ge(r){var c;const a=r||"";return a.trim()?(((c=a.split(/[\\/]/).pop())==null?void 0:c.toLowerCase())||a.toLowerCase()).includes("codex")?"codex":"claude":"codex"}function Ye(r){const a=document.createElement("textarea");a.value=r,a.setAttribute("readonly",""),a.style.position="fixed",a.style.top="-9999px",document.body.appendChild(a),a.select();try{return document.execCommand("copy")}finally{document.body.removeChild(a)}}async function Ze(r){var a;try{if((a=navigator.clipboard)!=null&&a.writeText)return await navigator.clipboard.writeText(r),!0}catch{}return Ye(r)}function et(r){return r==="connected"?"已连接":r==="connecting"?"连接中":r==="reconnecting"?"重连中":"已断开"}function tt(r){return r==="idle"?"空闲":r==="running"?"进行中":r==="confirm"?"等待确认":r==="question"?"等待回答":"未连接"}const it=()=>{const r=he(),{connectionStatus:a,cliConfig:s,startCLI:c,restartCLI:g,setConfirmMode:E,status:m,newSession:L}=be(),{theme:M,toggleTheme:V}=ke(),{canPromptInstall:G,isInstalled:N,isInstalling:I,isIos:Y,promptInstall:_}=qe(),[v,h]=l.useState("codex"),[C,p]=l.useState("key"),[f,A]=l.useState("codex"),[u,O]=l.useState("~"),[Q,P]=l.useState(!1),[o,T]=l.useState(null),x=a==="connected",b=m==="running"||m==="confirm"||m==="question",D=window.location.origin,R=window.location.hostname||"localhost",B=window.location.port||(window.location.protocol==="https:"?"443":"80");l.useEffect(()=>{if(s){const d=s.cliType||ge(s.cliCommand);h(d),p(s.confirmMode),A(s.cliCommand),O(s.workDir)}},[s]),l.useEffect(()=>{if(!o)return;const d=window.setTimeout(()=>T(null),1200);return()=>window.clearTimeout(d)},[o]);const k=(d=u,S=v,se=f)=>({cliType:S,cliCommand:se,workDir:d,confirmMode:C,cliArgs:U[S].cliArgs}),q=()=>{c(k())},W=()=>{g(),r("/session")},H=d=>{p(d),x&&E(d)},J=d=>{const S=U[d].command;d===v&&S===f||(h(d),A(S),x&&!b&&c(k(u,d,S)))},Z=d=>{O(d),x&&c(k(d))},ee=d=>{A(d),h(ge(d))},j=U[v],F=et(a),t=tt(m),i=C==="auto"?"自动通过":"手动确认",n=(s==null?void 0:s.workDir)===u&&(s!=null&&s.isGitRepo)?s.gitBranch||"HEAD":"",w=async(d,S)=>{await Ze(S)&&T(d)};return e.jsxs("div",{className:"flex flex-col h-full bg-gray-50 dark:bg-gray-950 overflow-y-auto",children:[e.jsx(Be,{title:"设置",className:"sticky top-0"}),e.jsxs("div",{className:"w-full max-w-3xl mx-auto p-4 space-y-5 pb-8",children:[e.jsxs("section",{children:[e.jsx("h2",{className:"text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider mb-2 px-1",children:"当前状态"}),e.jsx("div",{className:"bg-white dark:bg-gray-900 rounded-xl border border-gray-100 dark:border-gray-800 shadow-sm overflow-hidden",children:e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("div",{className:y("w-10 h-10 rounded-full flex items-center justify-center flex-shrink-0",x?"bg-green-50 dark:bg-green-950 text-green-600 dark:text-green-400":"bg-red-50 dark:bg-red-950 text-red-600 dark:text-red-400"),children:e.jsx(Ae,{className:"w-5 h-5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:x?"AgentPilot 可用":"AgentPilot 未连接"}),e.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 truncate",children:[j.label," · ",t]})]})]}),e.jsxs("span",{className:y("inline-flex w-fit items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-medium",x?"bg-green-50 dark:bg-green-950 text-green-700 dark:text-green-400":"bg-red-50 dark:bg-red-950 text-red-700 dark:text-red-400"),children:[e.jsx("span",{className:y("h-2 w-2 rounded-full",x?"bg-green-500":"bg-red-500")}),F]})]}),e.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[e.jsxs("span",{className:y("rounded-full px-2.5 py-1 text-xs font-medium",m==="running"?"bg-primary-50 dark:bg-primary-950 text-primary-700 dark:text-primary-300":m==="confirm"?"bg-orange-50 dark:bg-orange-950 text-orange-700 dark:text-orange-400":m==="question"?"bg-blue-50 dark:bg-blue-950 text-blue-700 dark:text-blue-400":"bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400"),children:["CLI ",t]}),e.jsx("span",{className:"rounded-full bg-gray-100 dark:bg-gray-800 px-2.5 py-1 text-xs font-medium text-gray-700 dark:text-gray-300",children:j.label}),e.jsx("span",{className:"rounded-full bg-amber-50 dark:bg-amber-950 px-2.5 py-1 text-xs font-medium text-amber-700 dark:text-amber-400",children:"权限已跳过"}),e.jsx("span",{className:"rounded-full bg-gray-100 dark:bg-gray-800 px-2.5 py-1 text-xs font-medium text-gray-700 dark:text-gray-300",children:i}),n&&e.jsxs("span",{className:"inline-flex max-w-full items-center gap-1 rounded-full bg-gray-100 dark:bg-gray-800 px-2.5 py-1 text-xs font-medium text-gray-700 dark:text-gray-300",children:[e.jsx(oe,{className:"h-3 w-3 flex-shrink-0"}),e.jsx("span",{className:"truncate",children:n})]})]}),e.jsxs("div",{className:"mt-4 space-y-3",children:[e.jsxs("div",{className:"flex flex-col gap-1.5 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:"访问地址"}),e.jsxs("div",{className:"flex min-w-0 items-center gap-2 sm:justify-end",children:[e.jsx("span",{className:"truncate text-sm font-mono text-gray-900 dark:text-gray-100",children:D}),e.jsx("button",{type:"button",onClick:()=>w("serverUrl",D),className:"flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-md text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-800 dark:hover:text-gray-300",title:o==="serverUrl"?"已复制":"复制访问地址","aria-label":o==="serverUrl"?"已复制访问地址":"复制访问地址",children:o==="serverUrl"?e.jsx($,{className:"w-3.5 h-3.5"}):e.jsx(z,{className:"w-3.5 h-3.5"})})]})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:"主机"}),e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"truncate text-sm font-mono text-gray-900 dark:text-gray-100",children:R}),e.jsx("button",{type:"button",onClick:()=>w("host",R),className:"flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-md text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-800 dark:hover:text-gray-300",title:o==="host"?"已复制":"复制主机","aria-label":o==="host"?"已复制主机":"复制主机",children:o==="host"?e.jsx($,{className:"w-3.5 h-3.5"}):e.jsx(z,{className:"w-3.5 h-3.5"})})]})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:"端口"}),e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"truncate text-sm font-mono text-gray-900 dark:text-gray-100",children:B}),e.jsx("button",{type:"button",onClick:()=>w("port",B),className:"flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-md text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-800 dark:hover:text-gray-300",title:o==="port"?"已复制":"复制端口","aria-label":o==="port"?"已复制端口":"复制端口",children:o==="port"?e.jsx($,{className:"w-3.5 h-3.5"}):e.jsx(z,{className:"w-3.5 h-3.5"})})]})]})]}),e.jsxs("div",{className:"flex flex-col gap-1.5 sm:flex-row sm:items-start sm:justify-between",children:[e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:"工作目录"}),e.jsxs("div",{className:"flex min-w-0 items-start gap-2 sm:max-w-[75%] sm:justify-end",children:[e.jsx("span",{className:"min-w-0 break-all text-sm font-mono leading-relaxed text-gray-900 dark:text-gray-100",children:u}),e.jsx("button",{type:"button",onClick:()=>w("workDir",u),className:"flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-md text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-800 dark:hover:text-gray-300",title:o==="workDir"?"已复制":"复制工作目录","aria-label":o==="workDir"?"已复制工作目录":"复制工作目录",children:o==="workDir"?e.jsx($,{className:"w-3.5 h-3.5"}):e.jsx(z,{className:"w-3.5 h-3.5"})})]})]}),n&&e.jsxs("div",{className:"flex flex-col gap-1.5 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Git 分支"}),e.jsxs("span",{className:"inline-flex w-fit max-w-full min-w-0 items-center gap-1.5 rounded-full bg-gray-100 px-2.5 py-1 text-sm font-medium text-gray-700 dark:bg-gray-800 dark:text-gray-300",children:[e.jsx(oe,{className:"h-3.5 w-3.5 flex-shrink-0"}),e.jsx("span",{className:"min-w-0 break-all",children:n})]})]})]}),e.jsx("div",{className:"mt-4 rounded-lg border border-amber-200 bg-amber-50 p-3 dark:border-amber-800 dark:bg-amber-950",children:e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsx(Pe,{className:"w-4 h-4 text-amber-600 dark:text-amber-400 flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-amber-800 dark:text-amber-300",children:"危险模式已启用"}),e.jsxs("div",{className:"mt-1 text-xs leading-relaxed text-amber-700 dark:text-amber-400",children:["使用 ",e.jsx("span",{className:"font-mono break-all",children:j.dangerArg})," 运行,CLI 可以直接读写文件并执行命令。仅在可信环境中使用。"]})]})]})}),e.jsxs("div",{className:"mt-4 grid gap-2 sm:grid-cols-[minmax(0,1fr)_auto]",children:[e.jsxs("button",{type:"button",onClick:()=>{x?(L(),r("/session")):q()},className:"w-full py-2.5 flex items-center justify-center gap-2 text-sm font-medium text-white bg-primary-600 rounded-lg hover:bg-primary-700 transition-colors",children:[x?e.jsx(Te,{className:"w-4 h-4"}):e.jsx(De,{className:"w-4 h-4"}),x?"新开会话":"启动 CLI"]}),x&&e.jsxs("button",{type:"button",onClick:W,className:"w-full py-2.5 px-4 flex items-center justify-center gap-2 text-sm font-medium text-red-600 dark:text-red-400 bg-white dark:bg-gray-900 border border-red-100 dark:border-red-800 rounded-lg hover:bg-red-50 dark:hover:bg-red-950 transition-colors sm:w-auto",children:[e.jsx(Re,{className:"w-4 h-4"}),"重启 CLI"]})]})]})})]}),e.jsxs("section",{children:[e.jsx("h2",{className:"text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider mb-2 px-1",children:"Agent CLI"}),e.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-xl border border-gray-100 dark:border-gray-800 shadow-sm overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b border-gray-50 dark:border-gray-800 flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-primary-50 dark:bg-primary-950 text-primary-600 dark:text-primary-400 flex items-center justify-center",children:e.jsx(Ee,{className:"w-5 h-5"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:"Agent 配置"}),e.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:"选择 CLI、启动命令和工作目录"})]})]}),e.jsxs("div",{className:"divide-y divide-gray-50 dark:divide-gray-800",children:[e.jsxs("div",{className:"w-full p-4 space-y-2",children:[e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:"当前 Agent"}),e.jsx("div",{className:"grid grid-cols-2 gap-2 rounded-lg bg-gray-50 dark:bg-gray-800 p-1 border border-gray-200 dark:border-gray-700",children:Object.keys(U).map(d=>e.jsx("button",{type:"button",onClick:()=>J(d),disabled:b,className:y("py-2 px-3 rounded-md text-sm font-medium transition-colors",v===d?"bg-white dark:bg-gray-900 text-primary-700 dark:text-primary-300 shadow-sm":"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200",b&&"opacity-60 cursor-not-allowed"),children:U[d].label},d))}),b&&e.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:"CLI 正在处理任务时暂不可切换 Agent。"})]}),e.jsxs("div",{className:"w-full p-4 space-y-2",children:[e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:"启动命令"}),e.jsx("input",{type:"text",value:f,onChange:d=>ee(d.target.value),className:"w-full text-sm text-gray-900 dark:text-gray-100 font-mono bg-gray-50 dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg px-3 py-2 focus:outline-none focus:border-primary-500 disabled:cursor-not-allowed disabled:opacity-70",disabled:x&&m!=="disconnected"}),x&&m!=="disconnected"&&e.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:"已连接时命令会被锁定,重启 CLI 后按当前配置生效。"})]}),e.jsxs("div",{className:"w-full p-4 space-y-2",children:[e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:"工作目录"}),e.jsxs("button",{type:"button",onClick:()=>P(!0),className:"w-full flex items-start gap-2 text-sm text-gray-900 dark:text-gray-100 font-mono bg-gray-50 dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg px-3 py-2 text-left hover:border-primary-500 transition-colors",children:[e.jsx(Me,{className:"w-4 h-4 text-amber-500 flex-shrink-0 mt-0.5"}),e.jsx("span",{className:"min-w-0 flex-1 break-all leading-relaxed",children:u})]}),e.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:"选择后会作为新会话的默认工作目录。"})]}),e.jsxs("div",{className:"w-full p-4 space-y-2",children:[e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:"确认模式"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 rounded-lg bg-gray-50 dark:bg-gray-800 p-1 border border-gray-200 dark:border-gray-700",children:[e.jsx("button",{type:"button",onClick:()=>H("key"),className:y("py-2 px-3 rounded-md text-sm font-medium transition-colors",C==="key"?"bg-white dark:bg-gray-900 text-primary-700 dark:text-primary-300 shadow-sm":"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200"),children:"手动确认"}),e.jsx("button",{type:"button",onClick:()=>H("auto"),className:y("py-2 px-3 rounded-md text-sm font-medium transition-colors",C==="auto"?"bg-white dark:bg-gray-900 text-amber-700 dark:text-amber-300 shadow-sm":"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200"),children:"自动通过"})]}),e.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:["CLI 仍发出权限请求时,",C==="auto"?"系统会自动通过。":"需要你在对话页确认。"]})]}),v==="codex"&&e.jsxs("div",{className:"w-full p-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:"模型档位"}),e.jsxs("div",{className:"flex flex-wrap gap-1.5 sm:justify-end",children:[e.jsx("span",{className:"text-xs px-2 py-1 rounded-full bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300",children:j.modelLabel}),e.jsxs("span",{className:"text-xs px-2 py-1 rounded-full bg-green-50 dark:bg-green-950 text-green-700 dark:text-green-400",children:["推理强度 ",j.intelligenceLabel]}),e.jsxs("span",{className:"text-xs px-2 py-1 rounded-full bg-blue-50 dark:bg-blue-950 text-blue-700 dark:text-blue-400",children:["服务层级 ",j.speedLabel]})]})]})]})]})]}),e.jsxs("section",{children:[e.jsx("h2",{className:"text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider mb-2 px-1",children:"应用设置"}),e.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-xl border border-gray-100 dark:border-gray-800 shadow-sm overflow-hidden divide-y divide-gray-50 dark:divide-gray-800",children:[e.jsxs("div",{className:"p-4 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[M==="dark"?e.jsx("div",{className:"w-10 h-10 rounded-full bg-gray-800 text-gray-300 flex items-center justify-center",children:e.jsx(_e,{className:"w-5 h-5"})}):e.jsx("div",{className:"w-10 h-10 rounded-full bg-yellow-50 text-yellow-600 flex items-center justify-center",children:e.jsx(We,{className:"w-5 h-5"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:M==="dark"?"深色模式":"浅色模式"}),e.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:"切换界面主题"})]})]}),e.jsx("button",{onClick:V,className:y("relative inline-flex h-7 w-12 items-center rounded-full transition-colors",M==="dark"?"bg-primary-600":"bg-gray-300"),"aria-label":"切换界面主题",children:e.jsx("span",{className:y("inline-block h-5 w-5 transform rounded-full bg-white transition-transform shadow-sm",M==="dark"?"translate-x-6":"translate-x-1")})})]}),e.jsxs("div",{className:"p-4 flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("div",{className:y("w-10 h-10 rounded-full flex items-center justify-center flex-shrink-0",N?"bg-green-50 dark:bg-green-950 text-green-600 dark:text-green-400":"bg-primary-50 dark:bg-primary-950 text-primary-600 dark:text-primary-400"),children:N?e.jsx(Fe,{className:"w-5 h-5"}):e.jsx(Oe,{className:"w-5 h-5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:N?"已安装为独立 App":"添加到主屏幕"}),e.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 leading-relaxed",children:N?"当前正在独立窗口中运行":G?"从桌面或主屏幕直接启动 AgentPilot":Y?"打开分享菜单后选择“添加到主屏幕”":"使用浏览器菜单安装 AgentPilot"})]})]}),G?e.jsxs("button",{type:"button",onClick:_,disabled:I,className:"flex items-center justify-center gap-1.5 rounded-lg bg-primary-600 px-3 py-2 text-sm font-medium text-white hover:bg-primary-700 disabled:cursor-not-allowed disabled:opacity-60 transition-colors flex-shrink-0",children:[e.jsx(ye,{className:"w-4 h-4"}),I?"安装中":"安装"]}):e.jsx("span",{className:y("text-xs px-2 py-1 rounded-full font-medium flex-shrink-0",N?"bg-green-50 dark:bg-green-950 text-green-700 dark:text-green-400":"bg-gray-100 dark:bg-gray-800 text-gray-500 dark:text-gray-400"),children:N?"已完成":"浏览器菜单"})]})]})]}),e.jsxs("div",{className:"text-center pt-4 pb-8",children:[e.jsx("div",{className:"text-sm font-semibold text-gray-400 dark:text-gray-600",children:"AgentPilot"}),e.jsx("div",{className:"text-xs text-gray-300 dark:text-gray-600 mt-1",children:"AI Agent 遥控器"}),e.jsx("div",{className:"text-[10px] text-gray-300 dark:text-gray-700 mt-2",children:"v0.1.0"})]})]}),e.jsx(Xe,{open:Q,currentDir:u,onSelect:Z,onClose:()=>P(!1)})]})};export{it as Settings};
@@ -0,0 +1,4 @@
1
+ import{u as is,b as ls,d as ds,r as n,j as e,R as ft}from"./vendor-react-CcDXZHn_.js";import{u as os,b as N,c as k}from"./index-CrJqHlc8.js";import{g as At,r as cs,S as xs,a as ms,u as gs,H as us}from"./java-VnEXKtx_.js";import{P as hs}from"./PageTopBar-CQwjO6Af.js";import{Z as ps}from"./ImageViewer-DuegU_fC.js";import{r as bs,s as fs}from"./workspace-return-FrQUv7g3.js";import{F as Be,G as le,v as Ne,w as yt,p as ys,e as ve,d as L,L as A,i as ks,j as kt,x as ye,y as Ge,D as Et,q as js,z as ws,E as Ns,X as vs,J as Cs,K as Ss,N as jt,O as Fs,Q as Ds,U as Ls,V as As,W as wt,Y as Es,_ as Is,$ as $s,a0 as Ws,a1 as Ps,a2 as Ts,a3 as Hs}from"./vendor-icons-CMXJHDEv.js";import{A as ke,m as Nt}from"./vendor-motion-D0ZmPdi9.js";import"./vendor-markdown--d-T3AbU.js";const Rs=22e4,zs=3e3,Gs=18e4;function Ce(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/1024/1024).toFixed(1)} MB`}function B(t){const s=t.split("/").filter(Boolean);return s[s.length-1]||t||"工作目录"}function Re(t){return t?t.replace(/^\/Users\/[^/]+/,"~"):"未选择工作目录"}function vt(t){return t||"."}function It(t){const s=new Date(t);return Number.isNaN(s.getTime())?t:new Intl.DateTimeFormat("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).format(s)}function Ct(t){const s=new Date(t);return Number.isNaN(s.getTime())?t:new Intl.DateTimeFormat("zh-CN",{month:"2-digit",day:"2-digit"}).format(s)}function $t(t){const s=[];for(const r of t.replace(/\\/g,"/").replace(/^\/+/,"").split("/"))if(!(!r||r===".")){if(r===".."){if(s.length===0)return"";s.pop();continue}s.push(r)}return s.join("/")}function Ms(t){const s=$t(t),r=s.lastIndexOf("/");return r>0?s.slice(0,r):""}function Bs(t){if(!t)return null;const s=Number(t);return Number.isSafeInteger(s)&&s>0?s:null}function Se(t){const s=B(t).toLowerCase(),r=ms(t);return s==="package.json"||s.endsWith("lock.json")||s==="pnpm-lock.yaml"?{Icon:Ss,className:"text-orange-500 dark:text-orange-400",label:"包配置"}:s.startsWith("dockerfile")?{Icon:jt,className:"text-blue-600 dark:text-blue-400",label:"Dockerfile"}:s==="makefile"||[".sh",".bash",".zsh"].includes(r)?{Icon:jt,className:"text-slate-700 dark:text-slate-300",label:"脚本"}:s.startsWith(".env")||[".ini",".conf",".toml",".properties",".plist"].includes(r)?{Icon:Fs,className:"text-gray-600 dark:text-gray-400",label:"配置"}:[".json"].includes(r)?{Icon:Ds,className:"text-yellow-600 dark:text-yellow-400",label:"JSON"}:[".ts",".tsx",".js",".jsx",".mjs",".vue",".svelte"].includes(r)?{Icon:Ls,className:"text-sky-600 dark:text-sky-400",label:"前端代码"}:[".go",".rs",".py",".rb",".php",".java",".kt",".swift",".c",".cc",".cpp",".h",".hpp",".cs",".lua",".dart"].includes(r)?{Icon:As,className:"text-primary-600 dark:text-primary-400",label:"代码"}:[".css",".scss",".less"].includes(r)?{Icon:wt,className:"text-pink-600 dark:text-pink-400",label:"样式"}:[".png",".jpg",".jpeg",".gif",".webp",".ico",".bmp",".avif",".svg"].includes(r)?{Icon:Es,className:"text-emerald-600 dark:text-emerald-400",label:r===".svg"?"SVG":"图片"}:[".html",".xml"].includes(r)?{Icon:Is,className:"text-orange-600 dark:text-orange-400",label:"标记"}:[".md",".mdx",".txt",".log",".rst"].includes(r)?{Icon:Ne,className:"text-gray-600 dark:text-gray-400",label:"文档"}:[".sql",".db",".sqlite"].includes(r)?{Icon:$s,className:"text-indigo-600 dark:text-indigo-400",label:"数据"}:[".zip",".gz",".tar",".tgz",".rar",".7z"].includes(r)?{Icon:Ws,className:"text-amber-600 dark:text-amber-400",label:"压缩包"}:[".mp3",".wav",".ogg",".m4a"].includes(r)?{Icon:Ps,className:"text-purple-600 dark:text-purple-400",label:"音频"}:[".mp4",".mov",".avi",".webm"].includes(r)?{Icon:Ts,className:"text-purple-600 dark:text-purple-400",label:"视频"}:[".csv",".tsv",".xls",".xlsx"].includes(r)?{Icon:Hs,className:"text-green-700 dark:text-green-400",label:"表格"}:[".yaml",".yml"].includes(r)?{Icon:wt,className:"text-red-600 dark:text-red-400",label:"YAML"}:{Icon:Be,className:"text-gray-500 dark:text-gray-400",label:"文件"}}function Wt(t){return t.includes("D")?"text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-950/50 border-red-100 dark:border-red-900":t.includes("A")||t==="??"?"text-green-700 dark:text-green-400 bg-green-50 dark:bg-green-950/50 border-green-100 dark:border-green-900":t.includes("R")||t.includes("C")?"text-blue-700 dark:text-blue-400 bg-blue-50 dark:bg-blue-950/50 border-blue-100 dark:border-blue-900":t.includes("U")?"text-orange-700 dark:text-orange-400 bg-orange-50 dark:bg-orange-950/50 border-orange-100 dark:border-orange-900":"text-amber-700 dark:text-amber-400 bg-amber-50 dark:bg-amber-950/50 border-amber-100 dark:border-amber-900"}function Z(t){return t.hasUnstaged??(t.status==="??"||t.worktreeStatus!==" "&&t.worktreeStatus!=="?"&&t.worktreeStatus!=="!")}function M(t){return t.hasStaged??(t.indexStatus!==" "&&t.indexStatus!=="?"&&t.indexStatus!=="!")}function Pt(){return{fileCount:0,stagedFileCount:0,unstagedFileCount:0,additions:0,deletions:0,stagedAdditions:0,stagedDeletions:0,unstagedAdditions:0,unstagedDeletions:0}}function St(t){const s=Pt();return{fileCount:Number((t==null?void 0:t.fileCount)??s.fileCount),stagedFileCount:Number((t==null?void 0:t.stagedFileCount)??s.stagedFileCount),unstagedFileCount:Number((t==null?void 0:t.unstagedFileCount)??s.unstagedFileCount),additions:Number((t==null?void 0:t.additions)??s.additions),deletions:Number((t==null?void 0:t.deletions)??s.deletions),stagedAdditions:Number((t==null?void 0:t.stagedAdditions)??s.stagedAdditions),stagedDeletions:Number((t==null?void 0:t.stagedDeletions)??s.stagedDeletions),unstagedAdditions:Number((t==null?void 0:t.unstagedAdditions)??s.unstagedAdditions),unstagedDeletions:Number((t==null?void 0:t.unstagedDeletions)??s.unstagedDeletions)}}function Ft(t=0,s=0){return`+${t} -${s}`}function _s(t){const s=t.toLowerCase(),r=B(s);return s.includes("/pages/workspace")||r.startsWith("workspace.")?"workspace":s.includes("/pages/settings")||r.startsWith("settings.")?"settings":s.includes("/pages/session")||r.startsWith("session.")?"session":s.includes("/pages/history")||r.startsWith("history.")?"history":s.includes("markdown")?"markdown":s.startsWith("server/")?"server":s.startsWith("codebase/src/components/")?"ui":s.startsWith("codebase/src/hooks/")?"hooks":s.startsWith("docs/")||r==="readme.md"||r.endsWith(".md")?"docs":r.includes("package")||r.includes("lock")||r.includes("config")||s.startsWith("scripts/")?"build":""}function Us(t){const s=t.map(r=>r.path.toLowerCase());return s.length===0?"chore":s.every(r=>r.startsWith("docs/")||r.endsWith(".md"))?"docs":s.every(r=>r.includes("test")||r.includes("spec"))?"test":s.every(r=>[".css",".scss",".less"].some(c=>r.endsWith(c)))?"style":s.some(r=>r.includes("package")||r.includes("lock")||r.includes("config"))?"build":t.some(r=>r.status.includes("A")||r.status==="??")?"feat":"refactor"}function Vs(t){if(t.length===0)return"";const s=Us(t),r=Array.from(new Set(t.map(i=>_s(i.path)).filter(Boolean))),c=r.length===1?r[0]:r.length>1?"app":"",g={app:"update app changes",build:"update build configuration",docs:"update documentation",history:"update history view",hooks:"update shared hooks",markdown:"update markdown rendering",server:"update server behavior",session:"update session flow",settings:"update settings experience",ui:"update ui components",workspace:"update workspace review flow"}[c]||(t.length===1?`update ${B(t[0].path).replace(/\.[^.]+$/,"").toLowerCase()}`:"update staged changes");return`${s}${c?`(${c})`:""}: ${g}`}function je(t){return t.replace(/^"|"$/g,"").replace(/^[ab]\//,"").replace(/^\/dev\/null$/,"/dev/null")}function Ks(t){const s=t.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?/);return s?{oldLine:Number(s[1]),newLine:Number(s[2])}:{oldLine:0,newLine:0}}function Os(t){const s=[];let r=null,c=null,x=0,g=0;const i=()=>(r||(r={oldPath:"",newPath:"",meta:[],hunks:[],additions:0,deletions:0},s.push(r)),r);for(const l of t.split(`
2
+ `)){if(l.startsWith("diff --git ")){const h=l.split(" ");r={oldPath:je(h[2]||""),newPath:je(h[3]||h[2]||""),meta:[],hunks:[],additions:0,deletions:0},s.push(r),c=null;continue}if(l.startsWith("--- ")&&!l.startsWith("--- 已")){i().oldPath=je(l.slice(4).trim());continue}if(l.startsWith("+++ ")){i().newPath=je(l.slice(4).trim());continue}if(l.startsWith("@@")){const h=i();c={header:l,lines:[]},h.hunks.push(c);const p=Ks(l);x=p.oldLine,g=p.newLine;continue}if(!c){l.trim()&&i().meta.push(l);continue}const b=i();l.startsWith("+")?(c.lines.push({kind:"add",newLine:g,content:l.slice(1)}),b.additions+=1,g+=1):l.startsWith("-")?(c.lines.push({kind:"delete",oldLine:x,content:l.slice(1)}),b.deletions+=1,x+=1):l.startsWith(" ")?(c.lines.push({kind:"context",oldLine:x,newLine:g,content:l.slice(1)}),x+=1,g+=1):l.startsWith("\\")?c.lines.push({kind:"note",content:l}):l.trim()&&c.lines.push({kind:"meta",content:l})}return s.filter(l=>l.hunks.length>0||l.meta.length>0)}const _e=({path:t,className:s="w-4 h-4 flex-shrink-0"})=>{const r=Se(t),c=r.Icon;return e.jsx(c,{className:k(s,r.className),"aria-label":r.label})},ma=()=>{var ut,ht,pt,bt;const{cliConfig:t,connectionStatus:s}=os(),r=is(),c=ls(),[x,g]=ds(),[i,l]=n.useState("files"),[b,h]=n.useState(""),[p,D]=n.useState(null),[f,de]=n.useState(!1),[oe,_]=n.useState(""),[T,Fe]=n.useState(null),[Ht,De]=n.useState(null),[j,Le]=n.useState(null),[Ue,Ve]=n.useState(!1),[Ke,Oe]=n.useState(""),[Q,Ae]=n.useState(!1),[qe,ee]=n.useState(""),[o,Rt]=n.useState(null),[Ee,Xe]=n.useState(!1),[Je,Ye]=n.useState(""),[v,zt]=n.useState(null),[Ie,Ze]=n.useState(!1),[Qe,et]=n.useState(""),[tt,U]=n.useState(""),[E,$e]=n.useState(null),[S,We]=n.useState(null),[Gt,ce]=n.useState(!1),[te,z]=n.useState(""),[Mt,st]=n.useState(!1),[Bt,at]=n.useState(!1),[_t,I]=n.useState(""),[Ut,se]=n.useState(""),[w,V]=n.useState(null),[Vt,rt]=n.useState(!1),[nt,it]=n.useState(""),[m,K]=n.useState(null),[ae,re]=n.useState("unstaged"),[O,xe]=n.useState(null),[Kt,lt]=n.useState(!1),[dt,me]=n.useState(""),[H,ne]=n.useState(null),$=(t==null?void 0:t.workDir)||"",F=s==="connected",q=n.useMemo(()=>{const a=c.state;return(a==null?void 0:a.workspaceReturnAnchor)||bs()},[c.state]),ge=$t(x.get("file")||""),ot=Bs(x.get("line")),Ot=(j==null?void 0:j.name)||(T?B(T):""),qt=w?B(w):"",Xt=(H==null?void 0:H.shortHash)||((ut=v==null?void 0:v.commits.find(a=>a.hash===O))==null?void 0:ut.shortHash)||(O==null?void 0:O.slice(0,8))||"",C=w?(o==null?void 0:o.files.find(a=>a.path===w))||(m==null?void 0:m.files.find(a=>a.path===w)):void 0,Jt=!!(o!=null&&o.files.some(Z)),Yt=!!(o!=null&&o.files.some(M)),W=(o==null?void 0:o.files.filter(M).length)||0,ue=(o==null?void 0:o.summary)||Pt(),ct=n.useMemo(()=>(o==null?void 0:o.files.filter(Z))||[],[o==null?void 0:o.files]),he=n.useMemo(()=>(o==null?void 0:o.files.filter(M))||[],[o==null?void 0:o.files]),X=n.useMemo(()=>Vs(he),[he]),pe=(ae==="staged"?m==null?void 0:m.stagedDiff:m==null?void 0:m.unstagedDiff)||(!(m!=null&&m.stagedDiff)&&!(m!=null&&m.unstagedDiff)?m==null?void 0:m.diff:""),Zt=(ae==="staged"?m==null?void 0:m.stagedTruncated:m==null?void 0:m.unstagedTruncated)||(!(m!=null&&m.stagedDiff)&&!(m!=null&&m.unstagedDiff)?m==null?void 0:m.truncated:void 0),xt=C?Z(C):!!((ht=m==null?void 0:m.unstagedDiff)!=null&&ht.trim()),mt=C?M(C):!!((pt=m==null?void 0:m.stagedDiff)!=null&&pt.trim());n.useEffect(()=>{h(""),Fe(null),De(null),V(null),xe(null),Le(null),ee(""),Ae(!1),K(null),re("unstaged"),ne(null),me(""),U(""),$e(null),We(null),ce(!1),z(""),I(""),se("")},[$]);const Pe=n.useCallback(async(a=b)=>{de(!0),_("");try{const d=await N.listWorkdir(a);D({workDir:d.workDir,path:d.path||"",parent:d.parent||"",isRoot:!!d.isRoot,dirs:d.dirs||[],files:d.files||[]}),h(d.path||"")}catch(d){_(d instanceof Error?d.message:"加载失败")}finally{de(!1)}},[b]),P=n.useCallback(async()=>{Xe(!0),Ye(""),U("");try{const a=await N.getWorkdirChanges();Rt({workDir:a.workDir,isGitRepo:!!a.isGitRepo,branch:a.branch||"",files:a.files||[],summary:St(a.summary),diff:a.diff||"",stagedDiff:a.stagedDiff||"",unstagedDiff:a.unstagedDiff||"",diffPath:a.diffPath,truncated:!!a.truncated,stagedTruncated:!!a.stagedTruncated,unstagedTruncated:!!a.unstagedTruncated})}catch(a){Ye(a instanceof Error?a.message:"加载失败")}finally{Xe(!1)}},[]),ie=n.useCallback(async()=>{Ze(!0),et("");try{const a=await N.getWorkdirCommits();zt({workDir:a.workDir,isGitRepo:!!a.isGitRepo,branch:a.branch||"",commits:a.commits||[]})}catch(a){et(a instanceof Error?a.message:"加载失败")}finally{Ze(!1)}},[]);n.useEffect(()=>{!F||i!=="files"||Pe(b)},[F,i,b,$,Pe]),n.useEffect(()=>{!F||i!=="changes"||P()},[F,i,$,P]),n.useEffect(()=>{!F||i!=="commits"||ie()},[F,i,$,ie]);const Te=n.useCallback(async(a,d=null)=>{Fe(a),De(d),Le(null),Oe(""),ee(""),Ve(!0);try{const u=await N.readWorkdirFile(a);Le(u)}catch(u){Oe(u instanceof Error?u.message:"读取失败")}finally{Ve(!1)}},[]);n.useEffect(()=>{!F||!ge||(l("files"),V(null),K(null),xe(null),ne(null),h(Ms(ge)),Te(ge,ot))},[F,ot,ge,Te,$]);const Qt=n.useCallback(()=>{if(Fe(null),De(null),ee(""),!x.has("file")&&!x.has("line"))return;const a=new URLSearchParams(x);a.delete("file"),a.delete("line"),g(a,{replace:!0})},[x,g]),be=n.useCallback(()=>{if(T){Ae(!0),ee("");try{const a=document.createElement("a");a.href=N.getWorkdirFileDownloadUrl(T),a.download=B(T)||"download",document.body.appendChild(a),a.click(),a.remove()}catch(a){ee(a instanceof Error?a.message:"下载失败")}finally{window.setTimeout(()=>Ae(!1),800)}}},[T]),J=n.useCallback(async a=>{const d=o==null?void 0:o.files.find(u=>u.path===a);V(a),re(d&&!Z(d)&&M(d)?"staged":"unstaged"),K(null),it(""),rt(!0);try{const u=await N.getWorkdirChanges(a),fe=u.files||[],Y=fe.find(ns=>ns.path===a);Y&&re(!Z(Y)&&M(Y)?"staged":"unstaged"),K({workDir:u.workDir,isGitRepo:!!u.isGitRepo,branch:u.branch||"",files:fe,summary:St(u.summary),diff:u.diff||"",stagedDiff:u.stagedDiff||"",unstagedDiff:u.unstagedDiff||"",diffPath:u.diffPath,truncated:!!u.truncated,stagedTruncated:!!u.stagedTruncated,unstagedTruncated:!!u.unstagedTruncated})}catch(u){it(u instanceof Error?u.message:"读取失败")}finally{rt(!1)}},[o==null?void 0:o.files]),es=n.useCallback(async a=>{xe(a),ne(null),me(""),lt(!0);try{const d=await N.getWorkdirCommit(a);ne({workDir:d.workDir,isGitRepo:!!d.isGitRepo,hash:d.hash,shortHash:d.shortHash,authorName:d.authorName,authorEmail:d.authorEmail,date:d.date,subject:d.subject,body:d.body||"",files:d.files||[],diff:d.diff||"",truncated:!!d.truncated})}catch(d){me(d instanceof Error?d.message:"读取失败")}finally{lt(!1)}},[]),G=n.useCallback(async(a,d)=>{if(!(d==="discard"&&!window.confirm(`确定清空 ${a} 的全部未提交改动吗?此操作会丢弃已暂存和未暂存改动,并删除未跟踪文件。`))){$e(`${d}:${a}`),U("");try{d==="stage"?await N.stageWorkdirChanges(a):d==="unstage"?await N.unstageWorkdirChanges(a):await N.discardWorkdirChanges(a),await P(),d==="discard"&&w===a?(V(null),K(null)):w===a&&await J(a)}catch(u){U(u instanceof Error?u.message:d==="stage"?"暂存失败":d==="unstage"?"取消暂存失败":"清空失败")}finally{$e(null)}}},[P,J,w]),He=n.useCallback(async a=>{if(a==="discard"){const d=(o==null?void 0:o.files.length)||0;if(!window.confirm(`确定清空当前工作区的 ${d} 个文件改动吗?此操作会丢弃已暂存和未暂存改动,并删除未跟踪文件。`))return}We(a),U("");try{a==="stage"?await N.stageWorkdirChanges():a==="unstage"?await N.unstageWorkdirChanges():await N.discardWorkdirChanges(),await P(),a==="discard"?(V(null),K(null),ce(!1),z("")):w&&await J(w)}catch(d){U(d instanceof Error?d.message:a==="stage"?"暂存失败":a==="unstage"?"取消暂存失败":"清空失败")}finally{We(null)}},[o==null?void 0:o.files.length,P,J,w]),ts=n.useCallback(()=>{ce(!0),I(""),se(""),z(a=>a.trim()?a:X)},[X]),ss=n.useCallback(async()=>{if(W===0){I("请先暂存要提交的文件");return}!te.trim()&&X&&z(X),at(!0),I(""),se("");try{const a=await N.generateWorkdirCommitMessage();z(a.message||X||"")}catch(a){I(a instanceof Error?a.message:"生成提交信息失败")}finally{at(!1)}},[te,X,W]),as=n.useCallback(async()=>{const a=te.trim();if(!a){I("提交信息不能为空");return}if(W===0){I("请先暂存要提交的文件");return}st(!0),I(""),se("");try{const d=await N.commitWorkdirChanges(a);se(`已提交 ${d.commitHash}`),z(""),await P(),await ie()}catch(d){I(d instanceof Error?d.message:"提交失败")}finally{st(!1)}},[te,P,ie,W]),gt=n.useCallback(()=>{if(!q){r("/session",{replace:!0});return}fs(q),r(q.sourceRoute,{replace:!0})},[r,q]),rs=n.useMemo(()=>{const a=b.split("/").filter(Boolean);return a.map((d,u)=>({label:d,path:a.slice(0,u+1).join("/")}))},[b]);return e.jsxs("div",{className:"flex flex-col h-full bg-gray-50 dark:bg-gray-950 relative",children:[e.jsx(hs,{title:B($),meta:e.jsx("span",{className:"text-[10px] text-gray-500 dark:text-gray-400 font-mono truncate max-w-[220px]",title:Re($),children:Re($)}),actions:e.jsxs(e.Fragment,{children:[q&&e.jsx("button",{type:"button",onClick:gt,className:"w-9 h-9 rounded-full border border-primary-100 dark:border-primary-900 bg-primary-50 dark:bg-primary-950/40 flex items-center justify-center text-primary-600 dark:text-primary-300 active:scale-95 transition-all",title:"返回对话位置","aria-label":"返回对话位置",children:e.jsx(yt,{className:"w-4 h-4"})}),e.jsx("button",{type:"button",onClick:()=>i==="files"?Pe(b):i==="changes"?P():ie(),disabled:!F||f||Ee||Ie,className:"w-9 h-9 rounded-full border border-gray-200 dark:border-gray-800 flex items-center justify-center text-gray-500 dark:text-gray-400 disabled:opacity-40 active:scale-95 transition-all",title:"刷新",children:e.jsx(ys,{className:k("w-4 h-4",(f||Ee||Ie)&&"animate-spin")})})]}),bottom:e.jsx("div",{className:"px-4 pb-3",children:e.jsxs("div",{className:"grid grid-cols-3 p-1 rounded-xl bg-gray-100 dark:bg-gray-800",children:[e.jsxs("button",{type:"button",onClick:()=>l("files"),className:k("h-9 rounded-lg flex items-center justify-center gap-2 text-sm font-medium transition-colors",i==="files"?"bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 shadow-sm":"text-gray-500 dark:text-gray-400"),children:[e.jsx(Be,{className:"w-4 h-4"}),"文件"]}),e.jsxs("button",{type:"button",onClick:()=>l("changes"),className:k("h-9 rounded-lg flex items-center justify-center gap-2 text-sm font-medium transition-colors",i==="changes"?"bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 shadow-sm":"text-gray-500 dark:text-gray-400"),children:[e.jsx(le,{className:"w-4 h-4"}),"变更"]}),e.jsxs("button",{type:"button",onClick:()=>l("commits"),className:k("h-9 rounded-lg flex items-center justify-center gap-2 text-sm font-medium transition-colors",i==="commits"?"bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 shadow-sm":"text-gray-500 dark:text-gray-400"),children:[e.jsx(Ne,{className:"w-4 h-4"}),"提交"]})]})})}),i==="files"?e.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"px-4 py-2 bg-white dark:bg-gray-900 border-b border-gray-100 dark:border-gray-800 overflow-x-auto hide-scrollbar flex items-center gap-1 text-xs",children:[e.jsx("button",{onClick:()=>h(""),className:k("px-2 py-1 rounded-md flex-shrink-0",b?"text-gray-500 dark:text-gray-400":"text-primary-600 bg-primary-50 dark:bg-primary-950"),children:"."}),rs.map(a=>e.jsxs(ft.Fragment,{children:[e.jsx(ve,{className:"w-3 h-3 text-gray-300 flex-shrink-0"}),e.jsx("button",{onClick:()=>h(a.path),className:"px-2 py-1 rounded-md text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 whitespace-nowrap",children:a.label})]},a.path))]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:F?f?e.jsx(y,{icon:e.jsx(A,{className:"w-5 h-5 animate-spin"}),title:"正在加载"}):oe?e.jsx(y,{icon:e.jsx(L,{className:"w-5 h-5"}),title:oe,danger:!0}):p&&(p.dirs.length>0||p.files.length>0||!p.isRoot)?e.jsxs("div",{className:"py-2",children:[!p.isRoot&&e.jsxs("button",{onClick:()=>h(p.parent),className:"w-full px-4 py-3 flex items-center gap-3 text-left hover:bg-white dark:hover:bg-gray-900 transition-colors",children:[e.jsx(ks,{className:"w-4 h-4 text-gray-400"}),e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:"返回上级"})]}),p.dirs.map(a=>e.jsxs("button",{onClick:()=>h(a.path),className:"w-full px-4 py-3 flex items-center gap-3 text-left hover:bg-white dark:hover:bg-gray-900 transition-colors",children:[e.jsx(kt,{className:"w-4 h-4 text-amber-500 flex-shrink-0"}),e.jsx("span",{className:"text-sm text-gray-800 dark:text-gray-200 flex-1 truncate",children:a.name}),e.jsx(ve,{className:"w-4 h-4 text-gray-300 dark:text-gray-600 flex-shrink-0"})]},a.path)),p.files.map(a=>e.jsxs("button",{onClick:()=>Te(a.path),className:"w-full px-4 py-3 flex items-center gap-3 text-left hover:bg-white dark:hover:bg-gray-900 transition-colors",children:[e.jsx(_e,{path:a.path}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-sm text-gray-800 dark:text-gray-200 truncate",children:a.name}),e.jsxs("div",{className:"text-[11px] text-gray-400 dark:text-gray-500 font-mono truncate",children:[Ce(a.size),a.ext?` · ${a.ext}`:""]})]})]},a.path))]}):e.jsx(y,{icon:e.jsx(kt,{className:"w-5 h-5"}),title:"空目录"}):e.jsx(y,{icon:e.jsx(L,{className:"w-5 h-5"}),title:"连接已断开"})})]}):i==="changes"?e.jsx("div",{className:"flex-1 overflow-y-auto",children:F?Ee?e.jsx(y,{icon:e.jsx(A,{className:"w-5 h-5 animate-spin"}),title:"正在加载"}):Je?e.jsx(y,{icon:e.jsx(L,{className:"w-5 h-5"}),title:Je,danger:!0}):o&&!o.isGitRepo?e.jsx(y,{icon:e.jsx(ye,{className:"w-5 h-5"}),title:"非 Git 仓库"}):o&&o.files.length>0?e.jsxs("div",{className:"py-2",children:[e.jsxs("div",{className:"px-4 py-2 flex items-center justify-between gap-3 text-xs text-gray-500 dark:text-gray-400",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx(ye,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsx("span",{className:"truncate",children:o.branch||"HEAD"})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 flex-wrap",children:[Jt&&e.jsx(R,{variant:"stage",label:`暂存 ${ue.unstagedFileCount}`,loading:S==="stage",disabled:S!==null,onClick:()=>He("stage")}),Yt&&e.jsx(R,{variant:"unstage",label:`取消 ${ue.stagedFileCount}`,loading:S==="unstage",disabled:S!==null,onClick:()=>He("unstage")}),e.jsx(R,{variant:"discard",label:`清空 ${ue.fileCount}`,loading:S==="discard",disabled:S!==null,onClick:()=>He("discard")}),e.jsxs("button",{type:"button",onClick:ts,disabled:W===0||S!==null,className:k("h-7 px-2.5 rounded-md border flex items-center gap-1.5 text-xs font-medium active:scale-95 transition-all disabled:active:scale-100",W>0?"border-primary-200 dark:border-primary-900 bg-primary-50 dark:bg-primary-950/40 text-primary-700 dark:text-primary-300":"border-gray-200 dark:border-gray-800 bg-gray-50 dark:bg-gray-900 text-gray-400 dark:text-gray-500 disabled:opacity-70"),title:W>0?`提交 ${W} 个已暂存文件`:"请先暂存要提交的文件","aria-label":"提交代码",children:[e.jsx(Ge,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"提交"})]})]})]}),e.jsx(Xs,{summary:ue}),tt&&e.jsxs("div",{className:"mx-4 mb-2 px-3 py-2 rounded-md border border-red-100 dark:border-red-900 bg-red-50 dark:bg-red-950/40 flex items-center gap-2 text-xs text-red-600 dark:text-red-300",children:[e.jsx(L,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsx("span",{className:"min-w-0 truncate",children:tt})]}),ct.length>0&&e.jsx(Dt,{title:"未暂存",description:"工作区还有待确认的修改",files:ct,scope:"unstaged",actionKey:E,busy:E!==null||S!==null,onOpen:J,onAction:G,onDiscard:a=>G(a,"discard")}),he.length>0&&e.jsx(Dt,{title:"已暂存",description:"将进入下一次 commit",files:he,scope:"staged",actionKey:E,busy:E!==null||S!==null,onOpen:J,onAction:G,onDiscard:a=>G(a,"discard")})]}):e.jsx(y,{icon:e.jsx(le,{className:"w-5 h-5"}),title:"工作区干净"}):e.jsx(y,{icon:e.jsx(L,{className:"w-5 h-5"}),title:"连接已断开"})}):e.jsx("div",{className:"flex-1 overflow-y-auto",children:F?Ie?e.jsx(y,{icon:e.jsx(A,{className:"w-5 h-5 animate-spin"}),title:"正在加载"}):Qe?e.jsx(y,{icon:e.jsx(L,{className:"w-5 h-5"}),title:Qe,danger:!0}):v&&!v.isGitRepo?e.jsx(y,{icon:e.jsx(ye,{className:"w-5 h-5"}),title:"非 Git 仓库"}):v&&v.commits.length>0?e.jsxs("div",{className:"py-2",children:[e.jsxs("div",{className:"px-4 py-2 flex items-center justify-between gap-3 text-xs text-gray-500 dark:text-gray-400",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx(ye,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsx("span",{className:"truncate",children:v.branch||"HEAD"})]}),e.jsxs("span",{className:"flex-shrink-0",children:[v.commits.length," 条提交"]})]}),v.commits.map((a,d)=>{var Y;const u=Ct(a.date),fe=Ct(((Y=v.commits[d-1])==null?void 0:Y.date)||"");return e.jsxs(ft.Fragment,{children:[u!==fe&&e.jsx("div",{className:"px-4 pt-3 pb-1 text-[11px] font-medium text-gray-400 dark:text-gray-500",children:u}),e.jsxs("button",{type:"button",onClick:()=>es(a.hash),className:"w-full px-4 py-3 flex items-center gap-3 text-left hover:bg-white dark:hover:bg-gray-900 transition-colors",children:[e.jsx("span",{className:"w-20 h-6 rounded-full border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 text-gray-600 dark:text-gray-300 font-mono text-[11px] flex items-center justify-center flex-shrink-0",children:a.shortHash}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 truncate",children:a.subject||"(无提交信息)"}),e.jsxs("div",{className:"mt-0.5 flex items-center gap-2 min-w-0 text-[11px] text-gray-500 dark:text-gray-400",children:[e.jsx("span",{className:"truncate",children:a.authorName||a.authorEmail||"unknown"}),e.jsx("span",{className:"flex-shrink-0",children:"·"}),e.jsx("span",{className:"flex-shrink-0",children:It(a.date)})]})]}),e.jsx(ve,{className:"w-4 h-4 text-gray-300 dark:text-gray-600 flex-shrink-0"})]})]},a.hash)})]}):e.jsx(y,{icon:e.jsx(Ne,{className:"w-5 h-5"}),title:"暂无 commit 记录"}):e.jsx(y,{icon:e.jsx(L,{className:"w-5 h-5"}),title:"连接已断开"})}),e.jsx(ke,{children:T&&e.jsx(we,{title:Ot,subtitle:vt(T),onClose:Qt,actions:e.jsxs(e.Fragment,{children:[q&&e.jsx("button",{type:"button",onClick:gt,className:"w-8 h-8 rounded-full flex items-center justify-center text-primary-600 dark:text-primary-300 bg-primary-50 dark:bg-primary-950/50 hover:bg-primary-100 dark:hover:bg-primary-950 disabled:opacity-40 active:scale-95 transition-all",title:"返回对话位置","aria-label":"返回对话位置",children:e.jsx(yt,{className:"w-4 h-4"})}),e.jsx("button",{type:"button",onClick:()=>void be(),disabled:!j||Ue||Q,className:"w-8 h-8 rounded-full flex items-center justify-center text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-900 disabled:opacity-40 disabled:hover:bg-transparent active:scale-95 transition-all",title:"下载","aria-label":"下载文件",children:Q?e.jsx(A,{className:"w-4 h-4 animate-spin"}):e.jsx(Et,{className:"w-4 h-4"})})]}),children:e.jsxs("div",{className:"h-full min-h-0 flex flex-col",children:[qe&&e.jsx("div",{className:"px-4 py-2 border-b border-red-100 dark:border-red-950 bg-red-50 dark:bg-red-950/30 text-xs text-red-600 dark:text-red-300 flex-shrink-0",children:qe}),e.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:Ue?e.jsx(y,{icon:e.jsx(A,{className:"w-5 h-5 animate-spin"}),title:"正在读取",compact:!0}):Ke?e.jsx(y,{icon:e.jsx(L,{className:"w-5 h-5"}),title:Ke,danger:!0,compact:!0}):j!=null&&j.tooLarge?e.jsx(ze,{file:j,title:`文件过大:${Ce(j.size)}`,downloading:Q,onDownload:be}):j!=null&&j.isImage?j.dataUrl?e.jsx(Js,{file:j}):e.jsx(ze,{file:j,title:"图片预览不可用",downloading:Q,onDownload:be}):j!=null&&j.isBinary?e.jsx(ze,{file:j,title:"二进制文件",downloading:Q,onDownload:be}):e.jsx(Zs,{file:j,targetLine:Ht})})]})})}),e.jsx(ke,{children:w&&e.jsx(we,{title:qt,subtitle:vt(w),onClose:()=>V(null),actions:C?e.jsxs("div",{className:"flex items-center gap-1.5",children:[Z(C)&&e.jsx(R,{variant:"stage",label:"暂存",loading:E===`stage:${w}`,disabled:E!==null||S!==null,onClick:()=>G(w,"stage")}),M(C)&&e.jsx(R,{variant:"unstage",label:"取消",loading:E===`unstage:${w}`,disabled:E!==null||S!==null,onClick:()=>G(w,"unstage")}),e.jsx(R,{variant:"discard",label:"清空",loading:E===`discard:${w}`,disabled:E!==null||S!==null,onClick:()=>G(w,"discard")})]}):void 0,children:e.jsxs("div",{className:"h-full min-h-0 flex flex-col",children:[m&&(xt||mt)&&e.jsx("div",{className:"px-4 py-2 border-b border-gray-100 dark:border-gray-800 bg-white dark:bg-gray-950 flex-shrink-0",children:e.jsxs("div",{className:"grid grid-cols-2 p-1 rounded-lg bg-gray-100 dark:bg-gray-900",children:[e.jsxs("button",{type:"button",onClick:()=>re("unstaged"),disabled:!xt,className:k("h-8 rounded-md text-xs font-medium transition-colors disabled:opacity-40",ae==="unstaged"?"bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 shadow-sm":"text-gray-500 dark:text-gray-400"),children:["未暂存 ",C?Ft(C.unstagedAdditions,C.unstagedDeletions):""]}),e.jsxs("button",{type:"button",onClick:()=>re("staged"),disabled:!mt,className:k("h-8 rounded-md text-xs font-medium transition-colors disabled:opacity-40",ae==="staged"?"bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 shadow-sm":"text-gray-500 dark:text-gray-400"),children:["已暂存 ",C?Ft(C.stagedAdditions,C.stagedDeletions):""]})]})}),e.jsx("div",{className:"flex-1 min-h-0",children:Vt?e.jsx(y,{icon:e.jsx(A,{className:"w-5 h-5 animate-spin"}),title:"正在读取",compact:!0}):nt?e.jsx(y,{icon:e.jsx(L,{className:"w-5 h-5"}),title:nt,danger:!0,compact:!0}):pe!=null&&pe.trim()?e.jsx(Tt,{diff:pe,truncated:Zt}):e.jsx(y,{icon:e.jsx(le,{className:"w-5 h-5"}),title:ae==="staged"?"暂无已暂存 diff":"暂无未暂存 diff",compact:!0})})]})})}),e.jsx(ke,{children:O&&e.jsx(we,{title:Xt,subtitle:(H==null?void 0:H.subject)||((bt=v==null?void 0:v.commits.find(a=>a.hash===O))==null?void 0:bt.subject)||"commit 详情",onClose:()=>{xe(null),ne(null),me("")},children:Kt?e.jsx(y,{icon:e.jsx(A,{className:"w-5 h-5 animate-spin"}),title:"正在读取",compact:!0}):dt?e.jsx(y,{icon:e.jsx(L,{className:"w-5 h-5"}),title:dt,danger:!0,compact:!0}):H?e.jsx(Ys,{commit:H}):e.jsx(y,{icon:e.jsx(Ne,{className:"w-5 h-5"}),title:"暂无 commit 详情",compact:!0})})}),e.jsx(ke,{children:Gt&&e.jsx(we,{title:"提交代码",subtitle:o!=null&&o.branch?`当前分支:${o.branch}`:Re($),onClose:()=>ce(!1),children:e.jsx(qs,{message:te,onMessageChange:z,onGenerate:ss,onCommit:as,aiLoading:Bt,commitLoading:Mt,error:_t,result:Ut,changedCount:(o==null?void 0:o.files.length)||0,stagedCount:W})})})]})},y=({icon:t,title:s,danger:r=!1,compact:c=!1})=>e.jsxs("div",{className:k("flex flex-col items-center justify-center gap-2 text-center",c?"h-full min-h-[220px]":"h-full min-h-[360px]"),children:[e.jsx("div",{className:k(r?"text-red-500 dark:text-red-400":"text-gray-400 dark:text-gray-600"),children:t}),e.jsx("div",{className:k("text-sm",r?"text-red-500 dark:text-red-400":"text-gray-400 dark:text-gray-600"),children:s})]}),qs=({message:t,onMessageChange:s,onGenerate:r,onCommit:c,aiLoading:x,commitLoading:g,error:i,result:l,changedCount:b,stagedCount:h})=>{const p=x||g;return e.jsxs("div",{className:"h-full bg-white dark:bg-gray-950 flex flex-col",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-gray-50 dark:bg-gray-900/70 flex items-center justify-between gap-3 flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 text-xs text-gray-500 dark:text-gray-400",children:[e.jsx(le,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsxs("span",{className:"truncate",children:[h," 个已暂存 / ",b," 个文件"]})]}),e.jsxs("button",{type:"button",onClick:r,disabled:p||h===0,className:"h-8 px-3 rounded-md border border-violet-200 dark:border-violet-900 bg-violet-50 dark:bg-violet-950/40 text-violet-700 dark:text-violet-300 flex items-center gap-1.5 text-xs font-medium disabled:opacity-60 active:scale-95 transition-all",title:"AI 生成提交信息","aria-label":"AI 生成提交信息",children:[x?e.jsx(A,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(Cs,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"AI 生成"})]})]}),e.jsxs("div",{className:"flex-1 min-h-0 p-4 flex flex-col gap-3",children:[e.jsx("label",{className:"text-xs font-medium text-gray-500 dark:text-gray-400",htmlFor:"workspace-commit-message",children:"Commit 信息"}),e.jsx("textarea",{id:"workspace-commit-message",value:t,onChange:D=>s(D.target.value),placeholder:"feat(scope): describe the change",className:"flex-1 min-h-[220px] resize-none rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-950 px-3 py-2 text-sm leading-6 font-mono text-gray-900 dark:text-gray-100 placeholder:text-gray-400 dark:placeholder:text-gray-600 focus:outline-none focus:ring-2 focus:ring-primary-500/40"}),i&&e.jsxs("div",{className:"px-3 py-2 rounded-md border border-red-100 dark:border-red-900 bg-red-50 dark:bg-red-950/40 flex items-center gap-2 text-xs text-red-600 dark:text-red-300",children:[e.jsx(L,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsx("span",{className:"min-w-0",children:i})]}),l&&e.jsxs("div",{className:"px-3 py-2 rounded-md border border-green-100 dark:border-green-900 bg-green-50 dark:bg-green-950/40 flex items-center gap-2 text-xs text-green-700 dark:text-green-300",children:[e.jsx(Ge,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsx("span",{className:"min-w-0",children:l})]}),e.jsxs("button",{type:"button",onClick:c,disabled:p||!t.trim()||h===0,className:"h-10 rounded-lg bg-primary-600 text-white text-sm font-medium flex items-center justify-center gap-2 disabled:opacity-50 active:scale-[0.99] transition-all",children:[g?e.jsx(A,{className:"w-4 h-4 animate-spin"}):e.jsx(Ge,{className:"w-4 h-4"}),e.jsx("span",{children:"提交代码"})]})]})]})},Me=({additions:t,deletions:s})=>e.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono font-medium",children:[e.jsxs("span",{className:"text-green-700 dark:text-green-400",children:["+",t]}),e.jsxs("span",{className:"text-red-700 dark:text-red-400",children:["-",s]})]}),Xs=({summary:t})=>e.jsx("div",{className:"px-4 pb-2",children:e.jsxs("div",{className:"rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 px-3 py-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[11px] text-gray-500 dark:text-gray-400",children:"工作区变更"}),e.jsxs("div",{className:"mt-0.5 text-sm font-semibold text-gray-900 dark:text-gray-100",children:[t.fileCount," 个文件"]})]}),e.jsx("div",{className:"text-xs flex-shrink-0",children:e.jsx(Me,{additions:t.additions,deletions:t.deletions})})]}),e.jsxs("div",{className:"mt-2 flex flex-wrap gap-2 text-[11px]",children:[e.jsxs("span",{className:"rounded-full border border-amber-200 dark:border-amber-900 bg-amber-50 dark:bg-amber-950/40 px-2 py-1 text-amber-700 dark:text-amber-300",children:["待确认 ",t.unstagedFileCount]}),e.jsxs("span",{className:k("rounded-full border px-2 py-1",t.stagedFileCount>0?"border-green-200 dark:border-green-900 bg-green-50 dark:bg-green-950/40 text-green-700 dark:text-green-300":"border-gray-200 dark:border-gray-800 bg-gray-50 dark:bg-gray-950 text-gray-500 dark:text-gray-400"),children:["可提交 ",t.stagedFileCount]}),(t.stagedFileCount>0||t.unstagedFileCount>0)&&e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-gray-200 dark:border-gray-800 bg-gray-50 dark:bg-gray-950 px-2 py-1 text-gray-500 dark:text-gray-400",children:["已暂存 ",e.jsx(Me,{additions:t.stagedAdditions,deletions:t.stagedDeletions})]})]})]})}),Dt=({title:t,description:s,files:r,scope:c,actionKey:x,busy:g,onOpen:i,onAction:l,onDiscard:b})=>{const h=c==="unstaged",p=h?"stage":"unstage",D=h?"暂存":"取消";return e.jsxs("section",{className:"mt-2",children:[e.jsxs("div",{className:"px-4 py-2 flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-xs font-semibold text-gray-700 dark:text-gray-200",children:t}),e.jsx("div",{className:"text-[11px] text-gray-400 dark:text-gray-500 truncate",children:s})]}),e.jsxs("span",{className:"text-[11px] text-gray-500 dark:text-gray-400 flex-shrink-0",children:[r.length," 个文件"]})]}),r.map(f=>{const de=h?f.unstagedAdditions:f.stagedAdditions,oe=h?f.unstagedDeletions:f.stagedDeletions;return e.jsxs("div",{className:"w-full px-4 py-3 flex items-center gap-2 sm:gap-3 text-left hover:bg-white dark:hover:bg-gray-900 transition-colors",children:[e.jsxs("button",{type:"button",onClick:()=>i(f.path),className:"min-w-0 flex-1 flex items-center gap-2 sm:gap-3 text-left",children:[e.jsx("span",{className:k("w-12 sm:w-14 h-6 rounded-full border flex items-center justify-center text-[11px] font-medium flex-shrink-0",Wt(f.status)),children:f.label}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(_e,{path:f.path,className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsx("div",{className:"text-sm text-gray-800 dark:text-gray-200 truncate",children:f.name})]}),e.jsxs("div",{className:"mt-0.5 flex items-center gap-2 min-w-0 text-[11px]",children:[e.jsx("span",{className:"font-mono text-gray-400 dark:text-gray-500 truncate",title:f.path,children:f.path}),e.jsxs("span",{className:"font-medium text-green-700 dark:text-green-400 flex-shrink-0",children:["+",de]}),e.jsxs("span",{className:"font-medium text-red-700 dark:text-red-400 flex-shrink-0",children:["-",oe]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[e.jsx(R,{variant:p,label:D,loading:x===`${p}:${f.path}`,disabled:g,compact:!0,onClick:_=>{_.stopPropagation(),l(f.path,p)}}),e.jsx(R,{variant:"discard",label:"清空",loading:x===`discard:${f.path}`,disabled:g,compact:!0,onClick:_=>{_.stopPropagation(),b(f.path)}})]}),e.jsx(ve,{className:"hidden sm:block w-4 h-4 text-gray-300 dark:text-gray-600 flex-shrink-0"})]},`${c}-${f.status}-${f.path}`)})]})},R=({variant:t,label:s,loading:r,disabled:c=!1,compact:x=!1,onClick:g})=>{const i=t==="stage",l=t==="discard";return e.jsxs("button",{type:"button",onClick:g,disabled:c||r,className:k("h-7 rounded-md border flex items-center justify-center gap-1.5 text-xs font-medium flex-shrink-0 disabled:opacity-60 active:scale-95 transition-all",x?"w-8 px-0 sm:w-auto sm:px-2.5":"px-2.5",l?"border-red-200 dark:border-red-900 bg-red-50 dark:bg-red-950/40 text-red-700 dark:text-red-300":i?"border-green-200 dark:border-green-900 bg-green-50 dark:bg-green-950/40 text-green-700 dark:text-green-300":"border-gray-200 dark:border-gray-800 bg-gray-50 dark:bg-gray-900 text-gray-600 dark:text-gray-300"),title:s,"aria-label":s,children:[r?e.jsx(A,{className:"w-3.5 h-3.5 animate-spin"}):l?e.jsx(js,{className:"w-3.5 h-3.5"}):i?e.jsx(ws,{className:"w-3.5 h-3.5"}):e.jsx(Ns,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:k(x&&"sr-only sm:not-sr-only"),children:s})]})},ze=({file:t,title:s,downloading:r,onDownload:c})=>{const x=Se(t.path||t.name||""),g=x.Icon;return e.jsxs("div",{className:"h-full bg-white dark:bg-gray-950 flex flex-col items-center justify-center gap-4 px-6 text-center",children:[e.jsx("div",{className:"w-14 h-14 rounded-2xl border border-gray-200 dark:border-gray-800 bg-gray-50 dark:bg-gray-900 flex items-center justify-center",children:e.jsx(g,{className:k("w-7 h-7",x.className)})}),e.jsxs("div",{className:"max-w-full space-y-1",children:[e.jsx("div",{className:"text-sm font-medium text-gray-800 dark:text-gray-200",children:s}),e.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400 font-mono truncate max-w-[280px]",children:[t.mimeType||x.label," · ",Ce(t.size)]})]}),e.jsxs("button",{type:"button",onClick:()=>void c(),disabled:r,className:"h-10 px-4 rounded-lg bg-primary-600 text-white text-sm font-medium flex items-center justify-center gap-2 disabled:opacity-60 active:scale-[0.99] transition-all",children:[r?e.jsx(A,{className:"w-4 h-4 animate-spin"}):e.jsx(Et,{className:"w-4 h-4"}),e.jsx("span",{children:"下载文件"})]})]})},Js=({file:t})=>{const s=Se(t.path||t.name||""),r=s.Icon;return e.jsxs("div",{className:"h-full overflow-hidden bg-white dark:bg-gray-950 flex flex-col",children:[e.jsxs("div",{className:"px-4 py-2 border-b border-gray-100 dark:border-gray-800 bg-gray-50 dark:bg-gray-900/70 flex items-center justify-between gap-3 flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(r,{className:k("w-4 h-4 flex-shrink-0",s.className)}),e.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 truncate",children:s.label})]}),e.jsxs("div",{className:"flex items-center gap-2 min-w-0 text-[11px] font-mono text-gray-400 dark:text-gray-500",children:[t.mimeType&&e.jsx("span",{className:"truncate",children:t.mimeType}),e.jsx("span",{className:"flex-shrink-0",children:Ce(t.size)})]})]}),e.jsx("div",{className:"flex-1 min-h-0 workspace-image-canvas",children:e.jsx(ps,{src:t.dataUrl||"",alt:t.name,resetKey:t.path||t.name,className:"h-full min-h-[320px]",imageClassName:"rounded border border-gray-200/80 bg-white/80 shadow-sm dark:border-gray-800/80 dark:bg-gray-950/80",padding:16})})]})},Ys=({commit:t})=>e.jsxs("div",{className:"h-full bg-white dark:bg-gray-950 flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-gray-50 dark:bg-gray-900/70 flex-shrink-0",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 break-words",children:t.subject||"(无提交信息)"}),e.jsxs("div",{className:"mt-1 flex items-center gap-2 min-w-0 text-[11px] text-gray-500 dark:text-gray-400",children:[e.jsx("span",{className:"font-mono flex-shrink-0",children:t.shortHash}),e.jsx("span",{className:"flex-shrink-0",children:"·"}),e.jsx("span",{className:"truncate",children:t.authorName||t.authorEmail||"unknown"}),e.jsx("span",{className:"flex-shrink-0",children:"·"}),e.jsx("span",{className:"flex-shrink-0",children:It(t.date)})]})]}),e.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400 flex-shrink-0",children:[t.files.length," 个文件"]})]}),t.body&&e.jsx("div",{className:"mt-3 rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-950 px-3 py-2 text-xs leading-5 text-gray-700 dark:text-gray-300 whitespace-pre-wrap break-words",children:t.body})]}),t.files.length>0&&e.jsx("div",{className:"max-h-40 overflow-y-auto border-b border-gray-100 dark:border-gray-800 bg-white dark:bg-gray-950 flex-shrink-0",children:t.files.map(s=>e.jsxs("div",{className:"px-4 py-2 flex items-center gap-3 border-b border-gray-50 dark:border-gray-900 last:border-b-0",children:[e.jsx("span",{className:k("w-14 h-6 rounded-full border flex items-center justify-center text-[11px] font-medium flex-shrink-0",Wt(s.status)),children:s.label}),e.jsx(_e,{path:s.path,className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-xs text-gray-800 dark:text-gray-200 truncate",children:s.path}),s.oldPath&&s.oldPath!==s.path&&e.jsxs("div",{className:"text-[11px] text-gray-400 dark:text-gray-500 font-mono truncate",children:[s.oldPath," ","->"," ",s.path]})]})]},`${s.status}-${s.oldPath||""}-${s.path}`))}),e.jsx("div",{className:"flex-1 min-h-0",children:t.diff?e.jsx(Tt,{diff:t.diff,truncated:t.truncated}):e.jsx(y,{icon:e.jsx(le,{className:"w-5 h-5"}),title:"暂无 diff 内容",compact:!0})})]}),Zs=({file:t,targetLine:s})=>{const r=At((t==null?void 0:t.path)||(t==null?void 0:t.name)||""),c=Se((t==null?void 0:t.path)||(t==null?void 0:t.name)||""),x=c.Icon,g=n.useMemo(()=>((t==null?void 0:t.content)??"").split(`
3
+ `),[t==null?void 0:t.content]),i=Math.max(2,String(g.length).length)+1,l=!!t&&(t.content.length>Rs||g.length>zs),b=n.useMemo(()=>t?cs(r,t.content):"",[t,r]),h=!!b&&!l,p=n.useRef(null);return n.useEffect(()=>{if(!t||!s)return;const D=requestAnimationFrame(()=>{var f;(f=p.current)==null||f.scrollIntoView({block:"center",inline:"nearest"})});return()=>cancelAnimationFrame(D)},[t,s]),t?e.jsxs("div",{className:"h-full overflow-hidden bg-white dark:bg-gray-950 flex flex-col",children:[e.jsxs("div",{className:"px-4 py-2 border-b border-gray-100 dark:border-gray-800 bg-gray-50 dark:bg-gray-900/70 flex items-center justify-between gap-3 flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(x,{className:k("w-4 h-4 flex-shrink-0",c.className)}),e.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 truncate",children:c.label})]}),e.jsxs("div",{className:"flex items-center gap-2 min-w-0 text-[11px] font-mono text-gray-400 dark:text-gray-500",children:[s&&e.jsxs("span",{className:"flex-shrink-0",children:["L",s]}),(b||r)&&e.jsx("span",{className:"flex-shrink-0",children:b||r}),l&&e.jsx("span",{className:"flex-shrink-0",title:"文件较大,已关闭语法高亮以保持滚动流畅",children:"plain"})]})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto bg-white dark:bg-gray-950 workspace-code-preview",children:e.jsx(xs,{content:t.content,language:b||r,highlight:h,lineNumberWidth:i,targetLine:s,targetLineRef:p})})]}):e.jsx(y,{icon:e.jsx(Be,{className:"w-5 h-5"}),title:"暂无文件内容",compact:!0})},Tt=({diff:t,truncated:s})=>{const[r,c]=n.useState(!0),x=n.useMemo(()=>Os(t),[t]),g=n.useMemo(()=>x.reduce((i,l)=>({additions:i.additions+l.additions,deletions:i.deletions+l.deletions}),{additions:0,deletions:0}),[x]);return x.length===0?e.jsx("pre",{className:"min-h-full overflow-auto p-4 text-[12px] leading-5 font-mono text-gray-800 dark:text-gray-200 whitespace-pre-wrap break-words bg-white dark:bg-gray-950",children:t}):e.jsxs("div",{className:"h-full overflow-y-auto bg-white dark:bg-gray-950",children:[e.jsxs("div",{className:"sticky top-0 z-10 border-b border-gray-100 dark:border-gray-800 bg-white/95 dark:bg-gray-950/95 backdrop-blur px-4 py-2 flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:[x.length," 个文件"]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium",children:[e.jsx("button",{type:"button",onClick:()=>c(i=>!i),"aria-pressed":r,className:k("h-7 px-2 rounded-md border text-[11px] font-medium active:scale-95 transition-all",r?"border-primary-200 dark:border-primary-900 bg-primary-50 dark:bg-primary-950/40 text-primary-700 dark:text-primary-300":"border-gray-200 dark:border-gray-800 bg-gray-50 dark:bg-gray-900 text-gray-500 dark:text-gray-400"),title:r?"隐藏行号":"显示行号","aria-label":r?"隐藏行号":"显示行号",children:"行号"}),e.jsx(Me,{additions:g.additions,deletions:g.deletions})]})]}),s&&e.jsx("div",{className:"mx-4 mt-3 rounded-lg border border-amber-200 dark:border-amber-900 bg-amber-50 dark:bg-amber-950/40 px-3 py-2 text-xs text-amber-800 dark:text-amber-300",children:"diff 内容过长,已截断。"}),e.jsx("div",{className:"pb-4",children:x.map((i,l)=>{const b=i.newPath||i.oldPath||"",h=At(b);return e.jsxs("div",{className:"border-b border-gray-100 dark:border-gray-800 last:border-b-0",children:[e.jsxs("div",{className:"px-4 py-3 bg-gray-50 dark:bg-gray-900/70 border-b border-gray-100 dark:border-gray-800",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 truncate",children:b||"变更文件"}),i.oldPath&&i.newPath&&i.oldPath!==i.newPath&&e.jsxs("div",{className:"text-[11px] text-gray-500 dark:text-gray-400 font-mono truncate mt-1",children:[i.oldPath," ","->"," ",i.newPath]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium flex-shrink-0",children:[h&&e.jsx("span",{className:"text-gray-400 dark:text-gray-500",children:h}),e.jsxs("span",{className:"text-green-700 dark:text-green-400",children:["+",i.additions]}),e.jsxs("span",{className:"text-red-700 dark:text-red-400",children:["-",i.deletions]})]})]}),i.meta.length>0&&e.jsx("div",{className:"mt-2 space-y-1",children:i.meta.map((p,D)=>e.jsx("div",{className:"text-[11px] leading-4 text-gray-500 dark:text-gray-400 font-mono truncate",children:p},`${p}-${D}`))})]}),i.hunks.map((p,D)=>e.jsxs("div",{children:[e.jsx("div",{className:"px-4 py-2 bg-primary-50 dark:bg-primary-950/30 text-[11px] font-mono text-primary-700 dark:text-primary-300 border-b border-primary-100 dark:border-primary-900 overflow-x-auto hide-scrollbar",children:p.header}),e.jsx(ea,{hunk:p,language:h,showLineNumbers:r})]},`${p.header}-${D}`))]},`${b}-${l}`)})})]})};function Lt(t){return t.kind==="add"||t.kind==="delete"||t.kind==="context"}function Qs(t,s){if(!t)return null;const r=[...t];for(;r.length>s&&r[r.length-1].length===0;)r.pop();for(;r.length<s;)r.push([]);return r}const ea=({hunk:t,language:s,showLineNumbers:r})=>{const c=n.useMemo(()=>t.lines.map(l=>Lt(l)?l.content:"").join(`
4
+ `),[t.lines]),x=!!s&&c.length<=Gs,{lines:g}=gs(c,s,x),i=n.useMemo(()=>Qs(g,t.lines.length),[t.lines.length,g]);return e.jsx("div",{className:"font-mono text-[12px] leading-5",children:t.lines.map((l,b)=>e.jsx(ta,{line:l,showLineNumbers:r,highlightedTokens:Lt(l)?i==null?void 0:i[b]:void 0},`${l.kind}-${l.oldLine}-${l.newLine}-${b}`))})},ta=({line:t,showLineNumbers:s,highlightedTokens:r})=>{const c=t.kind==="add",x=t.kind==="delete",g=t.kind==="note",i=c?"+":x?"-":g?"\\":" ";return e.jsxs("div",{className:k("grid min-w-0 border-b border-transparent",s?"grid-cols-[2.25rem_2.25rem_1.1rem_minmax(0,1fr)] sm:grid-cols-[2.75rem_2.75rem_1.25rem_minmax(0,1fr)]":"grid-cols-[1.25rem_minmax(0,1fr)]",c&&"bg-green-50 dark:bg-green-950/35",x&&"bg-red-50 dark:bg-red-950/35",t.kind==="meta"&&"bg-gray-50 dark:bg-gray-900/70",g&&"bg-gray-50 dark:bg-gray-900/70 text-gray-500 dark:text-gray-400 italic"),children:[s&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-1.5 sm:px-2 py-0.5 text-right text-[11px] text-gray-400 dark:text-gray-600 select-none border-r border-gray-100 dark:border-gray-800",children:t.oldLine??""}),e.jsx("div",{className:"px-1.5 sm:px-2 py-0.5 text-right text-[11px] text-gray-400 dark:text-gray-600 select-none border-r border-gray-100 dark:border-gray-800",children:t.newLine??""})]}),e.jsx("div",{className:k("px-1 py-0.5 text-center select-none",c&&"text-green-700 dark:text-green-400",x&&"text-red-700 dark:text-red-400",!c&&!x&&"text-gray-400 dark:text-gray-600"),children:i}),e.jsx("div",{className:k("py-0.5 pr-4 whitespace-pre-wrap break-words min-w-0",c&&"text-green-900 dark:text-green-100",x&&"text-red-900 dark:text-red-100",!c&&!x&&"text-gray-800 dark:text-gray-200"),children:r!=null&&r.length?e.jsx(us,{tokens:r}):t.content||" "})]})},we=({title:t,subtitle:s,onClose:r,actions:c,children:x})=>e.jsxs(e.Fragment,{children:[e.jsx(Nt.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:r,className:"absolute inset-0 bg-black/40 z-40"}),e.jsxs(Nt.div,{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"},transition:{type:"spring",damping:25,stiffness:220},className:"absolute inset-0 sm:top-auto sm:h-[86%] bg-white dark:bg-gray-950 rounded-none sm:rounded-t-2xl z-50 flex flex-col shadow-xl overflow-hidden",children:[e.jsx("div",{className:"flex justify-center pt-3 pb-2 flex-shrink-0",onClick:r,children:e.jsx("div",{className:"w-12 h-1.5 bg-gray-300 dark:bg-gray-700 rounded-full"})}),e.jsxs("div",{className:"px-4 pb-3 border-b border-gray-100 dark:border-gray-800 flex items-start justify-between gap-3 flex-shrink-0",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h2",{className:"text-base font-semibold text-gray-900 dark:text-gray-100 truncate",children:t}),e.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 font-mono truncate mt-0.5",children:s})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[c,e.jsx("button",{onClick:r,className:"w-8 h-8 rounded-full flex items-center justify-center text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-900 flex-shrink-0",title:"关闭","aria-label":"关闭",children:e.jsx(vs,{className:"w-5 h-5"})})]})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:x})]})]});export{ma as Workspace};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkdownRenderer-CsyizEL3.js","assets/vendor-react-CcDXZHn_.js","assets/index-CrJqHlc8.js","assets/vendor-icons-CMXJHDEv.js","assets/index-BCg3ymV3.css","assets/java-VnEXKtx_.js","assets/vendor-markdown--d-T3AbU.js","assets/workspace-return-FrQUv7g3.js"])))=>i.map(i=>d[i]);
2
+ import{_ as T,u as j,c as E}from"./index-CrJqHlc8.js";import{j as l,r as h,R as A,u as L,b as S}from"./vendor-react-CcDXZHn_.js";import{s as b}from"./workspace-return-FrQUv7g3.js";function z(t){return t.type==="system_group"}function C(t){return t.type==="tool_group"}function B(t){return t.type==="process_group"}function gt(t){return z(t)||C(t)||B(t)}function N(t){return!!t.details&&Object.keys(t.details).length>0}function m(t){return N(t)||t.content!=="系统消息"}function I(t){const e=t.filter(m);if(e.length===0)return null;const n=e[0],r=e[e.length-1];return{id:`system-group-${n.id}`,type:"system_group",content:r.content,time:e.length>1?`${n.time} - ${r.time}`:r.time,messages:e}}function G(t){const e=t[0],n=t[t.length-1];return{id:`tool-group-${e.id}`,type:"tool_group",content:n.content,time:t.length>1?`${e.time} - ${n.time}`:n.time,messages:t}}function x(t){const e=t.filter(s=>s.type!=="system"||m(s));if(e.length===0)return null;const n=e[0],r=e[e.length-1],o=new Map([["思考",0],["说明",0],["执行",0],["观察",0],["元信息",0]]);for(const s of e)s.type==="thinking"?o.set("思考",(o.get("思考")||0)+1):s.type==="ai"?o.set("说明",(o.get("说明")||0)+1):s.type==="tool"?(o.set("执行",(o.get("执行")||0)+1),s.toolResult&&o.set("观察",(o.get("观察")||0)+1)):s.type==="system"&&o.set("元信息",(o.get("元信息")||0)+1);const i=Array.from(o.entries()).filter(([,s])=>s>0).map(([s,c])=>`${c} ${s}`).join(" · ");return{id:`process-group-${n.id}`,type:"process_group",content:i||`${e.length} 个步骤`,time:e.length>1?`${n.time} - ${r.time}`:r.time,messages:e}}function g(t){return t.type==="ai"||t.type==="thinking"||t.type==="tool"||t.type==="system"}function R(t){var n;const e=(n=t.details)==null?void 0:n.assistantPhase;return typeof e=="string"?e:""}function _(t){return t.type==="ai"&&R(t)==="final"}function D(t){return t.type==="ai"&&R(t)==="progress"}function O(t){return p(t)||t.type==="system"?!1:t.type==="ai"||t.type==="tool"||t.type==="confirm"||t.type==="question"||t.type==="error"}function v(t,e){const n=t[e];return n.type!=="ai"||D(n)?!1:_(n)?!0:!t.slice(e+1).some(O)}function H(t,e){for(let n=t.length-1;n>=0;n-=1)if(_(t[n]))return n;if(!e)return-1;for(let n=t.length-1;n>=0;n-=1)if(v(t,n))return n;return-1}function U(t){var e;return t.type==="system"&&((e=t.details)==null?void 0:e.subtype)==="result"}function p(t){var e;return t.type==="system"&&((e=t.details)==null?void 0:e.subtype)==="result"}function K(t,e){return{id:t.id,type:"ai_response",content:t.content,time:t.time,message:t,resultMessage:e}}function Z(t){const e=[];let n=[],r=[];const o=()=>{if(n.length===0)return;const s=I(n);s&&e.push(s),n=[]},i=()=>{r.length!==0&&(r.length===1?e.push(r[0]):e.push(G(r)),r=[])};for(const s of t){if(s.type==="system"){if(i(),!m(s))continue;n.push(s);continue}if(s.type==="tool"){o(),r.push(s);continue}o(),i(),e.push(s)}return o(),i(),e}function q(t,e){const n=[],r=t.some(U),i=H(t,e||r);let s=[];const c=()=>{if(s.length===0)return;const u=x(s);u&&n.push(u),s=[]};if(i!==-1){const u=t.filter(p),a=u[u.length-1],d=t.filter((y,f)=>f!==i&&g(y)&&!p(y)),w=x(d);w&&n.push(w);for(const[y,f]of t.entries())y===i||g(f)||p(f)||n.push(f);return n.push(a?K(t[i],a):t[i]),n}return t.forEach(u=>{if(p(u)){c(),n.push(u);return}if(g(u)){s.push(u);return}c(),n.push(u)}),c(),n}function J(t,e={}){const n=[];let r=[],o=[];const i=e.finalizeCurrentTurn??!0,s=()=>{r.length!==0&&(n.push(...Z(r)),r=[])},c=u=>{o.length!==0&&(n.push(...q(o,u)),o=[])};for(const u of t){if(u.type==="user"){s(),c(!0),n.push(u),o=[];continue}if(n.length===0){r.push(u);continue}o.push(u)}return s(),c(i),n}function mt(t,e={}){return J(t,e)}const Q=A.lazy(()=>T(()=>import("./MarkdownRenderer-CsyizEL3.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])));function kt({children:t,enableWorkspaceLinks:e=!0,isStreaming:n=!1}){return n?l.jsx(X,{content:t}):l.jsx(h.Suspense,{fallback:l.jsx(V,{content:t}),children:l.jsx(Q,{enableWorkspaceLinks:e,children:t})})}function V({content:t}){return l.jsx("span",{className:"whitespace-pre-wrap break-words",children:t})}function X({content:t}){return l.jsx("span",{className:"markdown-streaming-text whitespace-pre-wrap break-words",children:t})}const Y=/^(?:\/|\.{1,2}\/|~\/)?(?:(?:[\w.@+-]+\/)+)?[\w.@+-]+\.[A-Za-z][A-Za-z0-9_-]*$/,tt=/(^|[^\w@:/?#&=.-])((?:\/|\.{1,2}\/|~\/)?(?:(?:[\w.@+-]+\/)+)?[\w.@+-]+\.[A-Za-z][A-Za-z0-9_-]*)(?::(\d+)(?::\d+)?|#L(\d+))?(?![\w/:-])/g,et=/^(.+?)(?::(\d+)(?::\d+)?|#L(\d+))?$/,nt=new Set(["agents.md","readme.md","todo.md","changelog.md","package.json","pnpm-lock.yaml","package-lock.json","yarn.lock","tsconfig.json","vite.config.ts","vite.config.js","tailwind.config.js","postcss.config.js","index.html"]);function k(t){try{return decodeURIComponent(t)}catch{return t}}function M(t){return t.replace(/^["'<]+/,"").replace(/[>"')\],.;]+$/,"")}function W(t){return t?t.replace(/\\/g,"/").replace(/\/+$/,"")||"/":""}function rt(t){const e=W(t),n=e.match(/^(\/Users\/[^/]+)(?:\/|$)/);if(n)return n[1];const r=e.match(/^(\/home\/[^/]+)(?:\/|$)/);return r?r[1]:""}function $(t){const e=[];for(const n of t.replace(/^\.\/+/,"").split("/"))if(!(!n||n===".")){if(n===".."){if(e.length===0)return null;e.pop();continue}e.push(n)}return e.join("/")}function st(t){if(!t)return null;const e=Number(t);return Number.isSafeInteger(e)&&e>0?e:null}function ot(t){return t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("~/")||t.includes("/")}function it(t){return!t.includes("/")&&nt.has(t.toLowerCase())}function ut(t,e){return!!(e!=null&&e.allowBarePathWithoutLine)||ot(t)||it(t)}function ct(t){let e=M(k(t).trim()).replace(/\\/g,"/");return e.startsWith("file://")&&(e=e.slice(7)),Y.test(e)}function lt(t,e){const n=new URLSearchParams({file:t});return e&&n.set("line",String(e)),`/workspace?${n.toString()}`}function at(t){return t.line?`打开 ${t.path}:${t.line}`:`打开 ${t.path}`}function P(t,e,n,r){const o=st(e);if(e&&!o)return null;let i=M(k(t).trim()).replace(/\\/g,"/");if(!i||(i.startsWith("file://")&&(i=i.slice(7)),/^[a-z][a-z0-9+.-]*:/i.test(i))||!o&&!ut(i,r))return null;const s=rt(n);i.startsWith("~/")&&s&&(i=`${s}${i.slice(1)}`);const c=W(n);let u;if(i.startsWith("/")){if(!c)return null;const a=i.replace(/\/+$/,"");if(a!==c&&!a.startsWith(`${c}/`))return null;u=$(a.slice(c.length).replace(/^\/+/,""))}else u=$(i);return u?{path:u,line:o,href:lt(u,o)}:null}function Mt(t,e){const n=M(k(t).trim());if(!n||n.startsWith("/workspace?"))return null;const r=n.match(et);return!r||!ct(r[1])?null:P(r[1],r[2]||r[3],e,{allowBarePathWithoutLine:!0})}function ft(t,e){const n=[];let r=0;for(const o of t.matchAll(tt)){const i=o[0],s=o[1]||"",c=i.slice(s.length),u=(o.index||0)+s.length,a=(o.index||0)+i.length,d=P(o[2],o[3]||o[4],e);d&&(u>r&&n.push({type:"text",text:t.slice(r,u)}),n.push({type:"link",text:c,target:d}),r=a)}return r<t.length&&n.push({type:"text",text:t.slice(r)}),n.length>0?n:[{type:"text",text:t}]}const F=h.createContext(null);function wt({value:t,children:e}){return l.jsx(F.Provider,{value:t,children:e})}function pt(){const t=L(),e=S(),n=h.useContext(F);return h.useCallback((r,o)=>{if(r.button!==0||r.metaKey||r.ctrlKey||r.shiftKey||r.altKey)return!1;r.preventDefault();const i=(n==null?void 0:n.createReturnAnchor(r.currentTarget))||null,s=i?{...i,sourceRoute:`${e.pathname}${e.search}${e.hash}`,createdAt:Date.now()}:null;return s?(b(s),t(o,{state:{workspaceReturnAnchor:s}})):t(o),!0},[e.hash,e.pathname,e.search,t,n])}function xt({children:t,linkClassName:e}){const{cliConfig:n}=j(),r=pt(),o=h.useMemo(()=>ft(t,n==null?void 0:n.workDir),[t,n==null?void 0:n.workDir]);return l.jsx(l.Fragment,{children:o.map((i,s)=>i.type==="text"?l.jsx(A.Fragment,{children:i.text},s):l.jsx("a",{href:i.target.href,className:E("font-mono underline underline-offset-2 decoration-current/50 hover:decoration-current",e),title:at(i.target),onClick:c=>{r(c,i.target.href)},children:i.text},`${i.target.href}-${s}`))})}export{kt as M,wt as W,xt as a,at as f,mt as g,gt as i,Mt as p,ft as s,pt as u};
@@ -0,0 +1 @@
1
+ const e=Object.freeze(JSON.parse(`{"displayName":"C","name":"c","patterns":[{"include":"#preprocessor-rule-enabled"},{"include":"#preprocessor-rule-disabled"},{"include":"#preprocessor-rule-conditional"},{"include":"#predefined_macros"},{"include":"#comments"},{"include":"#switch_statement"},{"include":"#anon_pattern_1"},{"include":"#storage_types"},{"include":"#anon_pattern_2"},{"include":"#anon_pattern_3"},{"include":"#anon_pattern_4"},{"include":"#anon_pattern_5"},{"include":"#anon_pattern_6"},{"include":"#anon_pattern_7"},{"include":"#operators"},{"include":"#numbers"},{"include":"#strings"},{"include":"#anon_pattern_range_1"},{"include":"#anon_pattern_range_2"},{"include":"#anon_pattern_range_3"},{"include":"#pragma-mark"},{"include":"#anon_pattern_range_4"},{"include":"#anon_pattern_range_5"},{"include":"#anon_pattern_range_6"},{"include":"#anon_pattern_8"},{"include":"#anon_pattern_9"},{"include":"#anon_pattern_10"},{"include":"#anon_pattern_11"},{"include":"#anon_pattern_12"},{"include":"#anon_pattern_13"},{"include":"#block"},{"include":"#parens"},{"include":"#anon_pattern_range_7"},{"include":"#line_continuation_character"},{"include":"#anon_pattern_range_8"},{"include":"#anon_pattern_range_9"},{"include":"#anon_pattern_14"},{"include":"#anon_pattern_15"}],"repository":{"access-method":{"begin":"([A-Z_a-z][0-9A-Z_a-z]*|(?<=[])]))\\\\s*(?:(\\\\.)|(->))((?:[A-Z_a-z][0-9A-Z_a-z]*\\\\s*(?:\\\\.|->))*)\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)(\\\\()","beginCaptures":{"1":{"name":"variable.object.c"},"2":{"name":"punctuation.separator.dot-access.c"},"3":{"name":"punctuation.separator.pointer-access.c"},"4":{"patterns":[{"match":"\\\\.","name":"punctuation.separator.dot-access.c"},{"match":"->","name":"punctuation.separator.pointer-access.c"},{"match":"[A-Z_a-z][0-9A-Z_a-z]*","name":"variable.object.c"},{"match":".+","name":"everything.else.c"}]},"5":{"name":"entity.name.function.member.c"},"6":{"name":"punctuation.section.arguments.begin.bracket.round.function.member.c"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.arguments.end.bracket.round.function.member.c"}},"name":"meta.function-call.member.c","patterns":[{"include":"#function-call-innards"}]},"anon_pattern_1":{"match":"\\\\b(break|continue|do|else|for|goto|if|_Pragma|return|while)\\\\b","name":"keyword.control.c"},"anon_pattern_10":{"match":"\\\\b((?:int8|int16|int32|int64|uint8|uint16|uint32|uint64|int_least8|int_least16|int_least32|int_least64|uint_least8|uint_least16|uint_least32|uint_least64|int_fast8|int_fast16|int_fast32|int_fast64|uint_fast8|uint_fast16|uint_fast32|uint_fast64|intptr|uintptr|intmax|uintmax)_t)\\\\b","name":"support.type.stdint.c"},"anon_pattern_11":{"match":"\\\\b(noErr|kNilOptions|kInvalidID|kVariableLengthArray)\\\\b","name":"support.constant.mac-classic.c"},"anon_pattern_12":{"match":"\\\\b(AbsoluteTime|Boolean|Byte|ByteCount|ByteOffset|BytePtr|CompTimeValue|ConstLogicalAddress|ConstStrFileNameParam|ConstStringPtr|Duration|Fixed|FixedPtr|Float32|Float32Point|Float64|Float80|Float96|FourCharCode|Fract|FractPtr|Handle|ItemCount|LogicalAddress|OptionBits|OSErr|OSStatus|OSType|OSTypePtr|PhysicalAddress|ProcessSerialNumber|ProcessSerialNumberPtr|ProcHandle|Ptr|ResType|ResTypePtr|ShortFixed|ShortFixedPtr|SignedByte|SInt16|SInt32|SInt64|SInt8|Size|StrFileName|StringHandle|StringPtr|TimeBase|TimeRecord|TimeScale|TimeValue|TimeValue64|UInt16|UInt32|UInt64|UInt8|UniChar|UniCharCount|UniCharCountPtr|UniCharPtr|UnicodeScalarValue|UniversalProcHandle|UniversalProcPtr|UnsignedFixed|UnsignedFixedPtr|UnsignedWide|UTF16Char|UTF32Char|UTF8Char)\\\\b","name":"support.type.mac-classic.c"},"anon_pattern_13":{"match":"\\\\b([0-9A-Z_a-z]+_t)\\\\b","name":"support.type.posix-reserved.c"},"anon_pattern_14":{"match":";","name":"punctuation.terminator.statement.c"},"anon_pattern_15":{"match":",","name":"punctuation.separator.delimiter.c"},"anon_pattern_2":{"match":"typedef","name":"keyword.other.typedef.c"},"anon_pattern_3":{"match":"\\\\b(const|extern|register|restrict|static|volatile|inline)\\\\b","name":"storage.modifier.c"},"anon_pattern_4":{"match":"\\\\bk[A-Z]\\\\w*\\\\b","name":"constant.other.variable.mac-classic.c"},"anon_pattern_5":{"match":"\\\\bg[A-Z]\\\\w*\\\\b","name":"variable.other.readwrite.global.mac-classic.c"},"anon_pattern_6":{"match":"\\\\bs[A-Z]\\\\w*\\\\b","name":"variable.other.readwrite.static.mac-classic.c"},"anon_pattern_7":{"match":"\\\\b(NULL|true|false|TRUE|FALSE)\\\\b","name":"constant.language.c"},"anon_pattern_8":{"match":"\\\\b(u_char|u_short|u_int|u_long|ushort|uint|u_quad_t|quad_t|qaddr_t|caddr_t|daddr_t|div_t|dev_t|fixpt_t|blkcnt_t|blksize_t|gid_t|in_addr_t|in_port_t|ino_t|key_t|mode_t|nlink_t|id_t|pid_t|off_t|segsz_t|swblk_t|uid_t|id_t|clock_t|size_t|ssize_t|time_t|useconds_t|suseconds_t)\\\\b","name":"support.type.sys-types.c"},"anon_pattern_9":{"match":"\\\\b(pthread_(?:attr_|cond_|condattr_|mutex_|mutexattr_|once_|rwlock_|rwlockattr_||key_)t)\\\\b","name":"support.type.pthread.c"},"anon_pattern_range_1":{"begin":"((?:(?>\\\\s+)|(/\\\\*)((?>(?:[^*]|(?>\\\\*+)[^/])*)((?>\\\\*+)/)))+?|(?:(?:(?:(?:\\\\b|(?<=\\\\W))|(?=\\\\W))|\\\\A)|\\\\Z))((#)\\\\s*define)\\\\b\\\\s+((?<!\\\\w)[A-Z_a-z]\\\\w*(?!\\\\w))(?:(\\\\()([^()\\\\\\\\]+)(\\\\)))?","beginCaptures":{"1":{"patterns":[{"include":"#inline_comment"}]},"2":{"name":"comment.block.c punctuation.definition.comment.begin.c"},"3":{"name":"comment.block.c"},"4":{"patterns":[{"match":"\\\\*/","name":"comment.block.c punctuation.definition.comment.end.c"},{"match":"\\\\*","name":"comment.block.c"}]},"5":{"name":"keyword.control.directive.define.c"},"6":{"name":"punctuation.definition.directive.c"},"7":{"name":"entity.name.function.preprocessor.c"},"8":{"name":"punctuation.definition.parameters.begin.c"},"9":{"patterns":[{"captures":{"1":{"name":"variable.parameter.preprocessor.c"}},"match":"(?<=[(,])\\\\s*((?<!\\\\w)[A-Z_a-z]\\\\w*(?!\\\\w))\\\\s*"},{"match":",","name":"punctuation.separator.parameters.c"},{"match":"\\\\.\\\\.\\\\.","name":"ellipses.c punctuation.vararg-ellipses.variable.parameter.preprocessor.c"}]},"10":{"name":"punctuation.definition.parameters.end.c"}},"end":"(?<!\\\\\\\\)(?=\\\\n)","name":"meta.preprocessor.macro.c","patterns":[{"include":"#preprocessor-rule-define-line-contents"}]},"anon_pattern_range_2":{"begin":"^\\\\s*((#)\\\\s*(error|warning))\\\\b\\\\s*","beginCaptures":{"1":{"name":"keyword.control.directive.diagnostic.$3.c"},"2":{"name":"punctuation.definition.directive.c"}},"end":"(?<!\\\\\\\\)(?=\\\\n)","name":"meta.preprocessor.diagnostic.c","patterns":[{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.c"}},"end":"\\"|(?<!\\\\\\\\)(?=\\\\s*\\\\n)","endCaptures":{"0":{"name":"punctuation.definition.string.end.c"}},"name":"string.quoted.double.c","patterns":[{"include":"#line_continuation_character"}]},{"begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.c"}},"end":"'|(?<!\\\\\\\\)(?=\\\\s*\\\\n)","endCaptures":{"0":{"name":"punctuation.definition.string.end.c"}},"name":"string.quoted.single.c","patterns":[{"include":"#line_continuation_character"}]},{"begin":"[^\\"']","end":"(?<!\\\\\\\\)(?=\\\\s*\\\\n)","name":"string.unquoted.single.c","patterns":[{"include":"#line_continuation_character"},{"include":"#comments"}]}]},"anon_pattern_range_3":{"begin":"^\\\\s*((#)\\\\s*(i(?:nclude(?:_next)?|mport)))\\\\b\\\\s*","beginCaptures":{"1":{"name":"keyword.control.directive.$3.c"},"2":{"name":"punctuation.definition.directive.c"}},"end":"(?=/[*/])|(?<!\\\\\\\\)(?=\\\\n)","name":"meta.preprocessor.include.c","patterns":[{"include":"#line_continuation_character"},{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.c"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.c"}},"name":"string.quoted.double.include.c"},{"begin":"<","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.c"}},"end":">","endCaptures":{"0":{"name":"punctuation.definition.string.end.c"}},"name":"string.quoted.other.lt-gt.include.c"}]},"anon_pattern_range_4":{"begin":"^\\\\s*((#)\\\\s*line)\\\\b","beginCaptures":{"1":{"name":"keyword.control.directive.line.c"},"2":{"name":"punctuation.definition.directive.c"}},"end":"(?=/[*/])|(?<!\\\\\\\\)(?=\\\\n)","name":"meta.preprocessor.c","patterns":[{"include":"#strings"},{"include":"#numbers"},{"include":"#line_continuation_character"}]},"anon_pattern_range_5":{"begin":"^\\\\s*((#)\\\\s*undef)\\\\b","beginCaptures":{"1":{"name":"keyword.control.directive.undef.c"},"2":{"name":"punctuation.definition.directive.c"}},"end":"(?=/[*/])|(?<!\\\\\\\\)(?=\\\\n)","name":"meta.preprocessor.c","patterns":[{"match":"[$A-Z_a-z][$\\\\w]*","name":"entity.name.function.preprocessor.c"},{"include":"#line_continuation_character"}]},"anon_pattern_range_6":{"begin":"^\\\\s*((#)\\\\s*pragma)\\\\b","beginCaptures":{"1":{"name":"keyword.control.directive.pragma.c"},"2":{"name":"punctuation.definition.directive.c"}},"end":"(?=/[*/])|(?<!\\\\\\\\)(?=\\\\n)","name":"meta.preprocessor.pragma.c","patterns":[{"include":"#strings"},{"match":"[$A-Z_a-z][-$\\\\w]*","name":"entity.other.attribute-name.pragma.preprocessor.c"},{"include":"#numbers"},{"include":"#line_continuation_character"}]},"anon_pattern_range_7":{"begin":"(?<!\\\\w)(?!\\\\s*(?:atomic_uint_least64_t|atomic_uint_least16_t|atomic_uint_least32_t|atomic_uint_least8_t|atomic_int_least16_t|atomic_uint_fast64_t|atomic_uint_fast32_t|atomic_int_least64_t|atomic_int_least32_t|pthread_rwlockattr_t|atomic_uint_fast16_t|pthread_mutexattr_t|atomic_int_fast16_t|atomic_uint_fast8_t|atomic_int_fast64_t|atomic_int_least8_t|atomic_int_fast32_t|atomic_int_fast8_t|pthread_condattr_t|pthread_rwlock_t|atomic_uintptr_t|atomic_ptrdiff_t|atomic_uintmax_t|atomic_intmax_t|atomic_char32_t|atomic_intptr_t|atomic_char16_t|pthread_mutex_t|pthread_cond_t|atomic_wchar_t|uint_least64_t|uint_least32_t|uint_least16_t|pthread_once_t|pthread_attr_t|uint_least8_t|int_least32_t|int_least16_t|pthread_key_t|uint_fast32_t|uint_fast64_t|uint_fast16_t|atomic_size_t|atomic_ushort|atomic_ullong|int_least64_t|atomic_ulong|int_least8_t|int_fast16_t|int_fast32_t|int_fast64_t|uint_fast8_t|memory_order|atomic_schar|atomic_uchar|atomic_short|atomic_llong|thread_local|atomic_bool|atomic_uint|atomic_long|int_fast8_t|suseconds_t|atomic_char|atomic_int|useconds_t|_Imaginary|uintmax_t|in_addr_t|in_port_t|_Noreturn|blksize_t|pthread_t|uintptr_t|volatile|u_quad_t|blkcnt_t|intmax_t|intptr_t|_Complex|uint16_t|uint32_t|uint64_t|_Alignof|_Alignas|continue|unsigned|restrict|intmax_t|register|int64_t|qaddr_t|segsz_t|_Atomic|alignas|default|caddr_t|nlink_t|typedef|u_short|fixpt_t|clock_t|swblk_t|ssize_t|alignof|daddr_t|int16_t|int32_t|uint8_t|struct|mode_t|size_t|time_t|ushort|u_long|u_char|int8_t|double|signed|static|extern|inline|return|switch|xor_eq|and_eq|bitand|not_eq|sizeof|quad_t|uid_t|bitor|union|off_t|key_t|ino_t|compl|u_int|short|const|false|while|float|pid_t|break|_Bool|or_eq|div_t|dev_t|gid_t|id_t|long|case|goto|else|bool|auto|id_t|enum|uint|true|NULL|void|char|for|not|int|and|xor|do|or|if)\\\\s*\\\\()(?=[A-Z_a-z]\\\\w*\\\\s*\\\\()","end":"(?!\\\\G)(?<=\\\\))","name":"meta.function.c","patterns":[{"include":"#function-innards"}]},"anon_pattern_range_8":{"begin":"([A-Z_a-z][0-9A-Z_a-z]*|(?<=[])]))?(\\\\[)(?!])","beginCaptures":{"1":{"name":"variable.object.c"},"2":{"name":"punctuation.definition.begin.bracket.square.c"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.end.bracket.square.c"}},"name":"meta.bracket.square.access.c","patterns":[{"include":"#function-call-innards"}]},"anon_pattern_range_9":{"match":"\\\\[\\\\s*]","name":"storage.modifier.array.bracket.square.c"},"backslash_escapes":{"match":"\\\\\\\\([\\"'?\\\\\\\\abefnprtv]|[0-3][0-7]{0,2}|[4-7]\\\\d?|x\\\\h{0,2}|u\\\\h{0,4}|U\\\\h{0,8})","name":"constant.character.escape.c"},"block":{"patterns":[{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.block.begin.bracket.curly.c"}},"end":"}|(?=\\\\s*#\\\\s*e(?:lif|lse|ndif)\\\\b)","endCaptures":{"0":{"name":"punctuation.section.block.end.bracket.curly.c"}},"name":"meta.block.c","patterns":[{"include":"#block_innards"}]}]},"block_comment":{"patterns":[{"begin":"\\\\s*+(/\\\\*)","beginCaptures":{"1":{"name":"punctuation.definition.comment.begin.c"}},"end":"\\\\*/","endCaptures":{"0":{"name":"punctuation.definition.comment.end.c"}},"name":"comment.block.c"},{"begin":"\\\\s*+(/\\\\*)","beginCaptures":{"1":{"name":"punctuation.definition.comment.begin.c"}},"end":"\\\\*/","endCaptures":{"0":{"name":"punctuation.definition.comment.end.c"}},"name":"comment.block.c"}]},"block_innards":{"patterns":[{"include":"#preprocessor-rule-enabled-block"},{"include":"#preprocessor-rule-disabled-block"},{"include":"#preprocessor-rule-conditional-block"},{"include":"#method_access"},{"include":"#member_access"},{"include":"#c_function_call"},{"begin":"(?=\\\\s)(?<!else|new|return)(?<=\\\\w)\\\\s+(and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas)((?:[A-Z_a-z][0-9A-Z_a-z]*+|::)++|(?<=operator)(?:[-!\\\\&*+<=>]+|\\\\(\\\\)|\\\\[]))\\\\s*(\\\\()","beginCaptures":{"1":{"name":"variable.other.c"},"2":{"name":"punctuation.section.parens.begin.bracket.round.initialization.c"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.parens.end.bracket.round.initialization.c"}},"name":"meta.initialization.c","patterns":[{"include":"#function-call-innards"}]},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.block.begin.bracket.curly.c"}},"end":"}|(?=\\\\s*#\\\\s*e(?:lif|lse|ndif)\\\\b)","endCaptures":{"0":{"name":"punctuation.section.block.end.bracket.curly.c"}},"patterns":[{"include":"#block_innards"}]},{"include":"#parens-block"},{"include":"$self"}]},"c_conditional_context":{"patterns":[{"include":"$self"},{"include":"#block_innards"}]},"c_function_call":{"begin":"(?!(?:while|for|do|if|else|switch|catch|enumerate|return|typeid|alignof|alignas|sizeof|[cr]?iterate|and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas)\\\\s*\\\\()(?=(?:[A-Z_a-z][0-9A-Z_a-z]*+|::)++\\\\s*\\\\(|(?<=operator)(?:[-!\\\\&*+<=>]+|\\\\(\\\\)|\\\\[])\\\\s*\\\\()","end":"(?<=\\\\))(?!\\\\w)","name":"meta.function-call.c","patterns":[{"include":"#function-call-innards"}]},"case_statement":{"begin":"((?>(?:(?>(?<!\\\\s)\\\\s+)|(/\\\\*)((?>(?:[^*]|(?>\\\\*+)[^/])*)((?>\\\\*+)/)))+|(?:(?:(?:(?:\\\\b|(?<=\\\\W))|(?=\\\\W))|\\\\A)|\\\\Z)))((?<!\\\\w)case(?!\\\\w))","beginCaptures":{"1":{"patterns":[{"include":"#inline_comment"}]},"2":{"name":"comment.block.c punctuation.definition.comment.begin.c"},"3":{"name":"comment.block.c"},"4":{"patterns":[{"match":"\\\\*/","name":"comment.block.c punctuation.definition.comment.end.c"},{"match":"\\\\*","name":"comment.block.c"}]},"5":{"name":"keyword.control.case.c"}},"end":"(:)","endCaptures":{"1":{"name":"punctuation.separator.colon.case.c"}},"name":"meta.conditional.case.c","patterns":[{"include":"#evaluation_context"},{"include":"#c_conditional_context"}]},"comments":{"patterns":[{"patterns":[{"patterns":[{"begin":"^(?>\\\\s*)(//[!/]+)","beginCaptures":{"1":{"name":"punctuation.definition.comment.documentation.c"}},"end":"(?<=\\\\n)(?<!\\\\\\\\\\\\n)","name":"comment.line.double-slash.documentation.c","patterns":[{"include":"#line_continuation_character"},{"match":"(?<=[!*/\\\\s])[@\\\\\\\\](?:callergraph|callgraph|else|endif|f\\\\$|f\\\\[|f]|hidecallergraph|hidecallgraph|hiderefby|hiderefs|hideinitializer|htmlinclude|n|nosubgrouping|private|privatesection|protected|protectedsection|public|publicsection|pure|showinitializer|showrefby|showrefs|tableofcontents|[\\"-%.<=>]|::|\\\\||---??)\\\\b(?:\\\\{[^}]*})?","name":"storage.type.class.doxygen.c"},{"captures":{"1":{"name":"storage.type.class.doxygen.c"},"2":{"name":"markup.italic.doxygen.c"}},"match":"((?<=[!*/\\\\s])[@\\\\\\\\](?:a|em?))\\\\s+(\\\\S+)"},{"captures":{"1":{"name":"storage.type.class.doxygen.c"},"2":{"name":"markup.bold.doxygen.c"}},"match":"((?<=[!*/\\\\s])[@\\\\\\\\]b)\\\\s+(\\\\S+)"},{"captures":{"1":{"name":"storage.type.class.doxygen.c"},"2":{"name":"markup.inline.raw.string.c"}},"match":"((?<=[!*/\\\\s])[@\\\\\\\\][cp])\\\\s+(\\\\S+)"},{"match":"(?<=[!*/\\\\s])[@\\\\\\\\](?:a|anchor|[bc]|cite|copybrief|copydetail|copydoc|def|dir|dontinclude|em??|emoji|enum|example|extends|file|idlexcept|implements|include|includedoc|includelineno|latexinclude|link|memberof|namespace|p|package|ref|refitem|related|relates|relatedalso|relatesalso|verbinclude)\\\\b(?:\\\\{[^}]*})?","name":"storage.type.class.doxygen.c"},{"match":"(?<=[!*/\\\\s])[@\\\\\\\\](?:addindex|addtogroup|category|class|defgroup|diafile|dotfile|elseif|fn|headerfile|if|ifnot|image|ingroup|interface|line|mainpage|mscfile|name|overload|page|property|protocol|section|skip|skipline|snippet|snippetdoc|snippetlineno|struct|subpage|subsection|subsubsection|typedef|union|until|vhdlflow|weakgroup)\\\\b(?:\\\\{[^}]*})?","name":"storage.type.class.doxygen.c"},{"captures":{"1":{"name":"storage.type.class.doxygen.c"},"2":{"patterns":[{"match":"in|out","name":"keyword.other.parameter.direction.$0.c"}]},"3":{"name":"variable.parameter.c"}},"match":"((?<=[!*/\\\\s])[@\\\\\\\\]param)(?:\\\\s*\\\\[((?:,?\\\\s*(?:in|out)\\\\s*)+)])?\\\\s+\\\\b(\\\\w+)\\\\b"},{"match":"(?<=[!*/\\\\s])[@\\\\\\\\](?:arg|attention|authors??|brief|bug|copyright|date|deprecated|details|exception|invariant|li|note|par|paragraph|param|post|pre|remarks??|result|returns??|retval|sa|see|short|since|test|throw|todo|tparam|version|warning|xrefitem)\\\\b(?:\\\\{[^}]*})?","name":"storage.type.class.doxygen.c"},{"match":"(?<=[!*/\\\\s])[@\\\\\\\\](?:code|cond|docbookonly|dot|htmlonly|internal|latexonly|link|manonly|msc|parblock|rtfonly|secreflist|uml|verbatim|xmlonly|endcode|endcond|enddocbookonly|enddot|endhtmlonly|endinternal|endlatexonly|endlink|endmanonly|endmsc|endparblock|endrtfonly|endsecreflist|enduml|endverbatim|endxmlonly)\\\\b(?:\\\\{[^}]*})?","name":"storage.type.class.doxygen.c"},{"match":"\\\\b[A-Z]+:|@[_a-z]+:","name":"storage.type.class.gtkdoc"}]},{"captures":{"1":{"name":"punctuation.definition.comment.begin.documentation.c"},"2":{"patterns":[{"match":"(?<=[!*/\\\\s])[@\\\\\\\\](?:callergraph|callgraph|else|endif|f\\\\$|f\\\\[|f]|hidecallergraph|hidecallgraph|hiderefby|hiderefs|hideinitializer|htmlinclude|n|nosubgrouping|private|privatesection|protected|protectedsection|public|publicsection|pure|showinitializer|showrefby|showrefs|tableofcontents|[\\"-%.<=>]|::|\\\\||---??)\\\\b(?:\\\\{[^}]*})?","name":"storage.type.class.doxygen.c"},{"captures":{"1":{"name":"storage.type.class.doxygen.c"},"2":{"name":"markup.italic.doxygen.c"}},"match":"((?<=[!*/\\\\s])[@\\\\\\\\](?:a|em?))\\\\s+(\\\\S+)"},{"captures":{"1":{"name":"storage.type.class.doxygen.c"},"2":{"name":"markup.bold.doxygen.c"}},"match":"((?<=[!*/\\\\s])[@\\\\\\\\]b)\\\\s+(\\\\S+)"},{"captures":{"1":{"name":"storage.type.class.doxygen.c"},"2":{"name":"markup.inline.raw.string.c"}},"match":"((?<=[!*/\\\\s])[@\\\\\\\\][cp])\\\\s+(\\\\S+)"},{"match":"(?<=[!*/\\\\s])[@\\\\\\\\](?:a|anchor|[bc]|cite|copybrief|copydetail|copydoc|def|dir|dontinclude|em??|emoji|enum|example|extends|file|idlexcept|implements|include|includedoc|includelineno|latexinclude|link|memberof|namespace|p|package|ref|refitem|related|relates|relatedalso|relatesalso|verbinclude)\\\\b(?:\\\\{[^}]*})?","name":"storage.type.class.doxygen.c"},{"match":"(?<=[!*/\\\\s])[@\\\\\\\\](?:addindex|addtogroup|category|class|defgroup|diafile|dotfile|elseif|fn|headerfile|if|ifnot|image|ingroup|interface|line|mainpage|mscfile|name|overload|page|property|protocol|section|skip|skipline|snippet|snippetdoc|snippetlineno|struct|subpage|subsection|subsubsection|typedef|union|until|vhdlflow|weakgroup)\\\\b(?:\\\\{[^}]*})?","name":"storage.type.class.doxygen.c"},{"captures":{"1":{"name":"storage.type.class.doxygen.c"},"2":{"patterns":[{"match":"in|out","name":"keyword.other.parameter.direction.$0.c"}]},"3":{"name":"variable.parameter.c"}},"match":"((?<=[!*/\\\\s])[@\\\\\\\\]param)(?:\\\\s*\\\\[((?:,?\\\\s*(?:in|out)\\\\s*)+)])?\\\\s+\\\\b(\\\\w+)\\\\b"},{"match":"(?<=[!*/\\\\s])[@\\\\\\\\](?:arg|attention|authors??|brief|bug|copyright|date|deprecated|details|exception|invariant|li|note|par|paragraph|param|post|pre|remarks??|result|returns??|retval|sa|see|short|since|test|throw|todo|tparam|version|warning|xrefitem)\\\\b(?:\\\\{[^}]*})?","name":"storage.type.class.doxygen.c"},{"match":"(?<=[!*/\\\\s])[@\\\\\\\\](?:code|cond|docbookonly|dot|htmlonly|internal|latexonly|link|manonly|msc|parblock|rtfonly|secreflist|uml|verbatim|xmlonly|endcode|endcond|enddocbookonly|enddot|endhtmlonly|endinternal|endlatexonly|endlink|endmanonly|endmsc|endparblock|endrtfonly|endsecreflist|enduml|endverbatim|endxmlonly)\\\\b(?:\\\\{[^}]*})?","name":"storage.type.class.doxygen.c"},{"match":"\\\\b[A-Z]+:|@[_a-z]+:","name":"storage.type.class.gtkdoc"}]},"3":{"name":"punctuation.definition.comment.end.documentation.c"}},"match":"(/\\\\*[!*]+(?=\\\\s))(.+)([!*]*\\\\*/)","name":"comment.block.documentation.c"},{"begin":"((?>\\\\s*)/\\\\*[!*]+(?:(?:\\\\n|$)|(?=\\\\s)))","beginCaptures":{"1":{"name":"punctuation.definition.comment.begin.documentation.c"}},"end":"([!*]*\\\\*/)","endCaptures":{"1":{"name":"punctuation.definition.comment.end.documentation.c"}},"name":"comment.block.documentation.c","patterns":[{"match":"(?<=[!*/\\\\s])[@\\\\\\\\](?:callergraph|callgraph|else|endif|f\\\\$|f\\\\[|f]|hidecallergraph|hidecallgraph|hiderefby|hiderefs|hideinitializer|htmlinclude|n|nosubgrouping|private|privatesection|protected|protectedsection|public|publicsection|pure|showinitializer|showrefby|showrefs|tableofcontents|[\\"-%.<=>]|::|\\\\||---??)\\\\b(?:\\\\{[^}]*})?","name":"storage.type.class.doxygen.c"},{"captures":{"1":{"name":"storage.type.class.doxygen.c"},"2":{"name":"markup.italic.doxygen.c"}},"match":"((?<=[!*/\\\\s])[@\\\\\\\\](?:a|em?))\\\\s+(\\\\S+)"},{"captures":{"1":{"name":"storage.type.class.doxygen.c"},"2":{"name":"markup.bold.doxygen.c"}},"match":"((?<=[!*/\\\\s])[@\\\\\\\\]b)\\\\s+(\\\\S+)"},{"captures":{"1":{"name":"storage.type.class.doxygen.c"},"2":{"name":"markup.inline.raw.string.c"}},"match":"((?<=[!*/\\\\s])[@\\\\\\\\][cp])\\\\s+(\\\\S+)"},{"match":"(?<=[!*/\\\\s])[@\\\\\\\\](?:a|anchor|[bc]|cite|copybrief|copydetail|copydoc|def|dir|dontinclude|em??|emoji|enum|example|extends|file|idlexcept|implements|include|includedoc|includelineno|latexinclude|link|memberof|namespace|p|package|ref|refitem|related|relates|relatedalso|relatesalso|verbinclude)\\\\b(?:\\\\{[^}]*})?","name":"storage.type.class.doxygen.c"},{"match":"(?<=[!*/\\\\s])[@\\\\\\\\](?:addindex|addtogroup|category|class|defgroup|diafile|dotfile|elseif|fn|headerfile|if|ifnot|image|ingroup|interface|line|mainpage|mscfile|name|overload|page|property|protocol|section|skip|skipline|snippet|snippetdoc|snippetlineno|struct|subpage|subsection|subsubsection|typedef|union|until|vhdlflow|weakgroup)\\\\b(?:\\\\{[^}]*})?","name":"storage.type.class.doxygen.c"},{"captures":{"1":{"name":"storage.type.class.doxygen.c"},"2":{"patterns":[{"match":"in|out","name":"keyword.other.parameter.direction.$0.c"}]},"3":{"name":"variable.parameter.c"}},"match":"((?<=[!*/\\\\s])[@\\\\\\\\]param)(?:\\\\s*\\\\[((?:,?\\\\s*(?:in|out)\\\\s*)+)])?\\\\s+\\\\b(\\\\w+)\\\\b"},{"match":"(?<=[!*/\\\\s])[@\\\\\\\\](?:arg|attention|authors??|brief|bug|copyright|date|deprecated|details|exception|invariant|li|note|par|paragraph|param|post|pre|remarks??|result|returns??|retval|sa|see|short|since|test|throw|todo|tparam|version|warning|xrefitem)\\\\b(?:\\\\{[^}]*})?","name":"storage.type.class.doxygen.c"},{"match":"(?<=[!*/\\\\s])[@\\\\\\\\](?:code|cond|docbookonly|dot|htmlonly|internal|latexonly|link|manonly|msc|parblock|rtfonly|secreflist|uml|verbatim|xmlonly|endcode|endcond|enddocbookonly|enddot|endhtmlonly|endinternal|endlatexonly|endlink|endmanonly|endmsc|endparblock|endrtfonly|endsecreflist|enduml|endverbatim|endxmlonly)\\\\b(?:\\\\{[^}]*})?","name":"storage.type.class.doxygen.c"},{"match":"\\\\b[A-Z]+:|@[_a-z]+:","name":"storage.type.class.gtkdoc"}]},{"captures":{"1":{"name":"meta.toc-list.banner.block.c"}},"match":"^/\\\\* =(\\\\s*.*?)\\\\s*= \\\\*/$\\\\n?","name":"comment.block.banner.c"},{"begin":"(/\\\\*)","beginCaptures":{"1":{"name":"punctuation.definition.comment.begin.c"}},"end":"(\\\\*/)","endCaptures":{"1":{"name":"punctuation.definition.comment.end.c"}},"name":"comment.block.c"},{"captures":{"1":{"name":"meta.toc-list.banner.line.c"}},"match":"^// =(\\\\s*.*?)\\\\s*=$\\\\n?","name":"comment.line.banner.c"},{"begin":"((?:^[\\\\t ]+)?)(?=//)","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.c"}},"end":"(?!\\\\G)","patterns":[{"begin":"(//)","beginCaptures":{"1":{"name":"punctuation.definition.comment.c"}},"end":"(?=\\\\n)","name":"comment.line.double-slash.c","patterns":[{"include":"#line_continuation_character"}]}]}]},{"include":"#block_comment"},{"include":"#line_comment"}]},{"include":"#block_comment"},{"include":"#line_comment"}]},"default_statement":{"begin":"((?>(?:(?>(?<!\\\\s)\\\\s+)|(/\\\\*)((?>(?:[^*]|(?>\\\\*+)[^/])*)((?>\\\\*+)/)))+|(?:(?:(?:(?:\\\\b|(?<=\\\\W))|(?=\\\\W))|\\\\A)|\\\\Z)))((?<!\\\\w)default(?!\\\\w))","beginCaptures":{"1":{"patterns":[{"include":"#inline_comment"}]},"2":{"name":"comment.block.c punctuation.definition.comment.begin.c"},"3":{"name":"comment.block.c"},"4":{"patterns":[{"match":"\\\\*/","name":"comment.block.c punctuation.definition.comment.end.c"},{"match":"\\\\*","name":"comment.block.c"}]},"5":{"name":"keyword.control.default.c"}},"end":"(:)","endCaptures":{"1":{"name":"punctuation.separator.colon.case.default.c"}},"name":"meta.conditional.case.c","patterns":[{"include":"#evaluation_context"},{"include":"#c_conditional_context"}]},"disabled":{"begin":"^\\\\s*#\\\\s*if(n?def)?\\\\b.*$","end":"^\\\\s*#\\\\s*endif\\\\b","patterns":[{"include":"#disabled"},{"include":"#pragma-mark"}]},"evaluation_context":{"patterns":[{"include":"#function-call-innards"},{"include":"$self"}]},"function-call-innards":{"patterns":[{"include":"#comments"},{"include":"#storage_types"},{"include":"#method_access"},{"include":"#member_access"},{"include":"#operators"},{"begin":"(?!(?:while|for|do|if|else|switch|catch|enumerate|return|typeid|alignof|alignas|sizeof|[cr]?iterate|and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas)\\\\s*\\\\()((?:[A-Z_a-z][0-9A-Z_a-z]*+|::)++|(?<=operator)(?:[-!\\\\&*+<=>]+|\\\\(\\\\)|\\\\[]))\\\\s*(\\\\()","beginCaptures":{"1":{"name":"entity.name.function.c"},"2":{"name":"punctuation.section.arguments.begin.bracket.round.c"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.arguments.end.bracket.round.c"}},"patterns":[{"include":"#function-call-innards"}]},{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.parens.begin.bracket.round.c"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.parens.end.bracket.round.c"}},"patterns":[{"include":"#function-call-innards"}]},{"include":"#block_innards"}]},"function-innards":{"patterns":[{"include":"#comments"},{"include":"#storage_types"},{"include":"#operators"},{"include":"#vararg_ellipses"},{"begin":"(?!(?:while|for|do|if|else|switch|catch|enumerate|return|typeid|alignof|alignas|sizeof|[cr]?iterate|and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas)\\\\s*\\\\()((?:[A-Z_a-z][0-9A-Z_a-z]*+|::)++|(?<=operator)(?:[-!\\\\&*+<=>]+|\\\\(\\\\)|\\\\[]))\\\\s*(\\\\()","beginCaptures":{"1":{"name":"entity.name.function.c"},"2":{"name":"punctuation.section.parameters.begin.bracket.round.c"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.parameters.end.bracket.round.c"}},"name":"meta.function.definition.parameters.c","patterns":[{"include":"#probably_a_parameter"},{"include":"#function-innards"}]},{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.parens.begin.bracket.round.c"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.parens.end.bracket.round.c"}},"patterns":[{"include":"#function-innards"}]},{"include":"$self"}]},"inline_comment":{"patterns":[{"patterns":[{"captures":{"1":{"name":"comment.block.c punctuation.definition.comment.begin.c"},"2":{"name":"comment.block.c"},"3":{"patterns":[{"match":"\\\\*/","name":"comment.block.c punctuation.definition.comment.end.c"},{"match":"\\\\*","name":"comment.block.c"}]}},"match":"(/\\\\*)((?>(?:[^*]|(?>\\\\*+)[^/])*)((?>\\\\*+)/))"},{"captures":{"1":{"name":"comment.block.c punctuation.definition.comment.begin.c"},"2":{"name":"comment.block.c"},"3":{"patterns":[{"match":"\\\\*/","name":"comment.block.c punctuation.definition.comment.end.c"},{"match":"\\\\*","name":"comment.block.c"}]}},"match":"(/\\\\*)((?:[^*]|\\\\*++[^/])*+(\\\\*++/))"}]},{"captures":{"1":{"name":"comment.block.c punctuation.definition.comment.begin.c"},"2":{"name":"comment.block.c"},"3":{"patterns":[{"match":"\\\\*/","name":"comment.block.c punctuation.definition.comment.end.c"},{"match":"\\\\*","name":"comment.block.c"}]}},"match":"(/\\\\*)((?:[^*]|\\\\*++[^/])*+(\\\\*++/))"}]},"line_comment":{"patterns":[{"begin":"\\\\s*+(//)","beginCaptures":{"1":{"name":"punctuation.definition.comment.c"}},"end":"(?<=\\\\n)(?<!\\\\\\\\\\\\n)","endCaptures":{},"name":"comment.line.double-slash.c","patterns":[{"include":"#line_continuation_character"}]},{"begin":"\\\\s*+(//)","beginCaptures":{"1":{"name":"punctuation.definition.comment.c"}},"end":"(?<=\\\\n)(?<!\\\\\\\\\\\\n)","endCaptures":{},"name":"comment.line.double-slash.c","patterns":[{"include":"#line_continuation_character"}]}]},"line_continuation_character":{"patterns":[{"captures":{"1":{"name":"constant.character.escape.line-continuation.c"}},"match":"(\\\\\\\\)\\\\n"}]},"member_access":{"captures":{"1":{"name":"variable.other.object.access.c"},"2":{"name":"punctuation.separator.dot-access.c"},"3":{"name":"punctuation.separator.pointer-access.c"},"4":{"patterns":[{"include":"#member_access"},{"include":"#method_access"},{"captures":{"1":{"name":"variable.other.object.access.c"},"2":{"name":"punctuation.separator.dot-access.c"},"3":{"name":"punctuation.separator.pointer-access.c"}},"match":"((?:[A-Z_a-z]\\\\w*|(?<=[])]))\\\\s*)(?:(\\\\.\\\\*?)|(->\\\\*?))"}]},"5":{"name":"variable.other.member.c"}},"match":"((?:[A-Z_a-z]\\\\w*|(?<=[])]))\\\\s*)(?:(\\\\.\\\\*?)|(->\\\\*?))((?:[A-Z_a-z]\\\\w*\\\\s*(?:\\\\.\\\\*?|->\\\\*?)\\\\s*)*)\\\\s*\\\\b((?!(?:atomic_uint_least64_t|atomic_uint_least16_t|atomic_uint_least32_t|atomic_uint_least8_t|atomic_int_least16_t|atomic_uint_fast64_t|atomic_uint_fast32_t|atomic_int_least64_t|atomic_int_least32_t|pthread_rwlockattr_t|atomic_uint_fast16_t|pthread_mutexattr_t|atomic_int_fast16_t|atomic_uint_fast8_t|atomic_int_fast64_t|atomic_int_least8_t|atomic_int_fast32_t|atomic_int_fast8_t|pthread_condattr_t|atomic_uintptr_t|atomic_ptrdiff_t|pthread_rwlock_t|atomic_uintmax_t|pthread_mutex_t|atomic_intmax_t|atomic_intptr_t|atomic_char32_t|atomic_char16_t|pthread_attr_t|atomic_wchar_t|uint_least64_t|uint_least32_t|uint_least16_t|pthread_cond_t|pthread_once_t|uint_fast64_t|uint_fast16_t|atomic_size_t|uint_least8_t|int_least64_t|int_least32_t|int_least16_t|pthread_key_t|atomic_ullong|atomic_ushort|uint_fast32_t|atomic_schar|atomic_short|uint_fast8_t|int_fast64_t|int_fast32_t|int_fast16_t|atomic_ulong|atomic_llong|int_least8_t|atomic_uchar|memory_order|suseconds_t|int_fast8_t|atomic_bool|atomic_char|atomic_uint|atomic_long|atomic_int|useconds_t|_Imaginary|blksize_t|pthread_t|in_addr_t|uintptr_t|in_port_t|uintmax_t|blkcnt_t|uint16_t|unsigned|_Complex|uint32_t|intptr_t|intmax_t|uint64_t|u_quad_t|int64_t|int32_t|ssize_t|caddr_t|clock_t|uint8_t|u_short|swblk_t|segsz_t|int16_t|fixpt_t|daddr_t|nlink_t|qaddr_t|size_t|time_t|mode_t|signed|quad_t|ushort|u_long|u_char|double|int8_t|ino_t|uid_t|pid_t|_Bool|float|dev_t|div_t|short|gid_t|off_t|u_int|key_t|id_t|uint|long|void|char|bool|id_t|int)\\\\b)[A-Z_a-z]\\\\w*\\\\b(?!\\\\())"},"method_access":{"begin":"((?:[A-Z_a-z]\\\\w*|(?<=[])]))\\\\s*)(?:(\\\\.\\\\*?)|(->\\\\*?))((?:[A-Z_a-z]\\\\w*\\\\s*(?:\\\\.\\\\*?|->\\\\*?)\\\\s*)*)\\\\s*([A-Z_a-z]\\\\w*)(\\\\()","beginCaptures":{"1":{"name":"variable.other.object.access.c"},"2":{"name":"punctuation.separator.dot-access.c"},"3":{"name":"punctuation.separator.pointer-access.c"},"4":{"patterns":[{"include":"#member_access"},{"include":"#method_access"},{"captures":{"1":{"name":"variable.other.object.access.c"},"2":{"name":"punctuation.separator.dot-access.c"},"3":{"name":"punctuation.separator.pointer-access.c"}},"match":"((?:[A-Z_a-z]\\\\w*|(?<=[])]))\\\\s*)(?:(\\\\.\\\\*?)|(->\\\\*?))"}]},"5":{"name":"entity.name.function.member.c"},"6":{"name":"punctuation.section.arguments.begin.bracket.round.function.member.c"}},"contentName":"meta.function-call.member.c","end":"(\\\\))","endCaptures":{"1":{"name":"punctuation.section.arguments.end.bracket.round.function.member.c"}},"patterns":[{"include":"#function-call-innards"}]},"numbers":{"captures":{"0":{"patterns":[{"begin":"(?=.)","end":"$","patterns":[{"captures":{"1":{"name":"keyword.other.unit.hexadecimal.c"},"2":{"name":"constant.numeric.hexadecimal.c","patterns":[{"match":"(?<=\\\\h)'(?=\\\\h)","name":"punctuation.separator.constant.numeric"}]},"3":{"name":"punctuation.separator.constant.numeric"},"4":{"name":"constant.numeric.hexadecimal.c"},"5":{"name":"constant.numeric.hexadecimal.c","patterns":[{"match":"(?<=\\\\h)'(?=\\\\h)","name":"punctuation.separator.constant.numeric"}]},"6":{"name":"punctuation.separator.constant.numeric"},"8":{"name":"keyword.other.unit.exponent.hexadecimal.c"},"9":{"name":"keyword.operator.plus.exponent.hexadecimal.c"},"10":{"name":"keyword.operator.minus.exponent.hexadecimal.c"},"11":{"name":"constant.numeric.exponent.hexadecimal.c","patterns":[{"match":"(?<=\\\\h)'(?=\\\\h)","name":"punctuation.separator.constant.numeric"}]},"12":{"name":"keyword.other.unit.suffix.floating-point.c"}},"match":"\\\\G(0[Xx])(\\\\h(?:\\\\h|((?<=\\\\h)'(?=\\\\h)))*)?((?<=\\\\h)\\\\.|\\\\.(?=\\\\h))(\\\\h(?:\\\\h|((?<=\\\\h)'(?=\\\\h)))*)?((?<!')([Pp])(\\\\+?)(-?)([0-9](?:[0-9]|(?<=\\\\h)'(?=\\\\h))*))?([FLfl](?!\\\\w))?$"},{"captures":{"2":{"name":"constant.numeric.decimal.c","patterns":[{"match":"(?<=\\\\h)'(?=\\\\h)","name":"punctuation.separator.constant.numeric"}]},"3":{"name":"punctuation.separator.constant.numeric"},"4":{"name":"constant.numeric.decimal.point.c"},"5":{"name":"constant.numeric.decimal.c","patterns":[{"match":"(?<=\\\\h)'(?=\\\\h)","name":"punctuation.separator.constant.numeric"}]},"6":{"name":"punctuation.separator.constant.numeric"},"8":{"name":"keyword.other.unit.exponent.decimal.c"},"9":{"name":"keyword.operator.plus.exponent.decimal.c"},"10":{"name":"keyword.operator.minus.exponent.decimal.c"},"11":{"name":"constant.numeric.exponent.decimal.c","patterns":[{"match":"(?<=\\\\h)'(?=\\\\h)","name":"punctuation.separator.constant.numeric"}]},"12":{"name":"keyword.other.unit.suffix.floating-point.c"}},"match":"\\\\G((?=[.0-9])(?!0[BXbx]))([0-9](?:[0-9]|((?<=\\\\h)'(?=\\\\h)))*)?((?<=[0-9])\\\\.|\\\\.(?=[0-9]))([0-9](?:[0-9]|((?<=\\\\h)'(?=\\\\h)))*)?((?<!')([Ee])(\\\\+?)(-?)([0-9](?:[0-9]|(?<=\\\\h)'(?=\\\\h))*))?([FLfl](?!\\\\w))?$"},{"captures":{"1":{"name":"keyword.other.unit.binary.c"},"2":{"name":"constant.numeric.binary.c","patterns":[{"match":"(?<=\\\\h)'(?=\\\\h)","name":"punctuation.separator.constant.numeric"}]},"3":{"name":"punctuation.separator.constant.numeric"},"4":{"name":"keyword.other.unit.suffix.integer.c"}},"match":"\\\\G(0[Bb])([01](?:[01]|((?<=\\\\h)'(?=\\\\h)))*)((?:(?:(?:(?:(?:[Uu]|[Uu]ll?)|[Uu]LL?)|ll?[Uu]?)|LL?[Uu]?)|[Ff])(?!\\\\w))?$"},{"captures":{"1":{"name":"keyword.other.unit.octal.c"},"2":{"name":"constant.numeric.octal.c","patterns":[{"match":"(?<=\\\\h)'(?=\\\\h)","name":"punctuation.separator.constant.numeric"}]},"3":{"name":"punctuation.separator.constant.numeric"},"4":{"name":"keyword.other.unit.suffix.integer.c"}},"match":"\\\\G(0)((?:[0-7]|((?<=\\\\h)'(?=\\\\h)))+)((?:(?:(?:(?:(?:[Uu]|[Uu]ll?)|[Uu]LL?)|ll?[Uu]?)|LL?[Uu]?)|[Ff])(?!\\\\w))?$"},{"captures":{"1":{"name":"keyword.other.unit.hexadecimal.c"},"2":{"name":"constant.numeric.hexadecimal.c","patterns":[{"match":"(?<=\\\\h)'(?=\\\\h)","name":"punctuation.separator.constant.numeric"}]},"3":{"name":"punctuation.separator.constant.numeric"},"5":{"name":"keyword.other.unit.exponent.hexadecimal.c"},"6":{"name":"keyword.operator.plus.exponent.hexadecimal.c"},"7":{"name":"keyword.operator.minus.exponent.hexadecimal.c"},"8":{"name":"constant.numeric.exponent.hexadecimal.c","patterns":[{"match":"(?<=\\\\h)'(?=\\\\h)","name":"punctuation.separator.constant.numeric"}]},"9":{"name":"keyword.other.unit.suffix.integer.c"}},"match":"\\\\G(0[Xx])(\\\\h(?:\\\\h|((?<=\\\\h)'(?=\\\\h)))*)((?<!')([Pp])(\\\\+?)(-?)([0-9](?:[0-9]|(?<=\\\\h)'(?=\\\\h))*))?((?:(?:(?:(?:(?:[Uu]|[Uu]ll?)|[Uu]LL?)|ll?[Uu]?)|LL?[Uu]?)|[Ff])(?!\\\\w))?$"},{"captures":{"2":{"name":"constant.numeric.decimal.c","patterns":[{"match":"(?<=\\\\h)'(?=\\\\h)","name":"punctuation.separator.constant.numeric"}]},"3":{"name":"punctuation.separator.constant.numeric"},"5":{"name":"keyword.other.unit.exponent.decimal.c"},"6":{"name":"keyword.operator.plus.exponent.decimal.c"},"7":{"name":"keyword.operator.minus.exponent.decimal.c"},"8":{"name":"constant.numeric.exponent.decimal.c","patterns":[{"match":"(?<=\\\\h)'(?=\\\\h)","name":"punctuation.separator.constant.numeric"}]},"9":{"name":"keyword.other.unit.suffix.integer.c"}},"match":"\\\\G((?=[.0-9])(?!0[BXbx]))([0-9](?:[0-9]|((?<=\\\\h)'(?=\\\\h)))*)((?<!')([Ee])(\\\\+?)(-?)([0-9](?:[0-9]|(?<=\\\\h)'(?=\\\\h))*))?((?:(?:(?:(?:(?:[Uu]|[Uu]ll?)|[Uu]LL?)|ll?[Uu]?)|LL?[Uu]?)|[Ff])(?!\\\\w))?$"},{"match":"(?:['.0-9A-Z_a-z]|(?<=[EPep])[-+])+","name":"invalid.illegal.constant.numeric"}]}]}},"match":"(?<!\\\\w)\\\\.?\\\\d(?:['.0-9A-Z_a-z]|(?<=[EPep])[-+])*"},"operators":{"patterns":[{"match":"(?<![$\\\\w])(sizeof)(?![$\\\\w])","name":"keyword.operator.sizeof.c"},{"match":"--","name":"keyword.operator.decrement.c"},{"match":"\\\\+\\\\+","name":"keyword.operator.increment.c"},{"match":"(?:[-%*+]|(?<!\\\\()/)=","name":"keyword.operator.assignment.compound.c"},{"match":"(?:[\\\\&^]|<<|>>|\\\\|)=","name":"keyword.operator.assignment.compound.bitwise.c"},{"match":"<<|>>","name":"keyword.operator.bitwise.shift.c"},{"match":"!=|<=|>=|==|[<>]","name":"keyword.operator.comparison.c"},{"match":"&&|!|\\\\|\\\\|","name":"keyword.operator.logical.c"},{"match":"[\\\\&^|~]","name":"keyword.operator.c"},{"match":"=","name":"keyword.operator.assignment.c"},{"match":"[-%*+/]","name":"keyword.operator.c"},{"begin":"(\\\\?)","beginCaptures":{"1":{"name":"keyword.operator.ternary.c"}},"end":"(:)","endCaptures":{"1":{"name":"keyword.operator.ternary.c"}},"patterns":[{"include":"#function-call-innards"},{"include":"$self"}]}]},"parens":{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.parens.begin.bracket.round.c"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.parens.end.bracket.round.c"}},"name":"meta.parens.c","patterns":[{"include":"$self"}]},"parens-block":{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.parens.begin.bracket.round.c"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.parens.end.bracket.round.c"}},"name":"meta.parens.block.c","patterns":[{"include":"#block_innards"},{"match":"(?-im:(?<!:):(?!:))","name":"punctuation.range-based.c"}]},"pragma-mark":{"captures":{"1":{"name":"meta.preprocessor.pragma.c"},"2":{"name":"keyword.control.directive.pragma.pragma-mark.c"},"3":{"name":"punctuation.definition.directive.c"},"4":{"name":"entity.name.tag.pragma-mark.c"}},"match":"^\\\\s*(((#)\\\\s*pragma\\\\s+mark)\\\\s+(.*))","name":"meta.section.c"},"predefined_macros":{"patterns":[{"captures":{"1":{"name":"entity.name.other.preprocessor.macro.predefined.$1.c"}},"match":"\\\\b(__cplusplus|__DATE__|__FILE__|__LINE__|__STDC__|__STDC_HOSTED__|__STDC_NO_COMPLEX__|__STDC_VERSION__|__STDCPP_THREADS__|__TIME__|NDEBUG|__OBJC__|__ASSEMBLER__|__ATOM__|__AVX__|__AVX2__|_CHAR_UNSIGNED|__CLR_VER|_CONTROL_FLOW_GUARD|__COUNTER__|__cplusplus_cli|__cplusplus_winrt|_CPPRTTI|_CPPUNWIND|_DEBUG|_DLL|__FUNCDNAME__|__FUNCSIG__|__FUNCTION__|_INTEGRAL_MAX_BITS|__INTELLISENSE__|_ISO_VOLATILE|_KERNEL_MODE|_M_AMD64|_M_ARM|_M_ARM_ARMV7VE|_M_ARM_FP|_M_ARM64|_M_CEE|_M_CEE_PURE|_M_CEE_SAFE|_M_FP_EXCEPT|_M_FP_FAST|_M_FP_PRECISE|_M_FP_STRICT|_M_IX86|_M_IX86_FP|_M_X64|_MANAGED|_MSC_BUILD|_MSC_EXTENSIONS|_MSC_FULL_VER|_MSC_VER|_MSVC_LANG|__MSVC_RUNTIME_CHECKS|_MT|_NATIVE_WCHAR_T_DEFINED|_OPENMP|_PREFAST|__TIMESTAMP__|_VC_NO_DEFAULTLIB|_WCHAR_T_DEFINED|_WIN32|_WIN64|_WINRT_DLL|_ATL_VER|_MFC_VER|__GFORTRAN__|__GNUC__|__GNUC_MINOR__|__GNUC_PATCHLEVEL__|__GNUG__|__STRICT_ANSI__|__BASE_FILE__|__INCLUDE_LEVEL__|__ELF__|__VERSION__|__OPTIMIZE__|__OPTIMIZE_SIZE__|__NO_INLINE__|__GNUC_STDC_INLINE__|__CHAR_UNSIGNED__|__WCHAR_UNSIGNED__|__REGISTER_PREFIX__|__SIZE_TYPE__|__PTRDIFF_TYPE__|__WCHAR_TYPE__|__WINT_TYPE__|__INTMAX_TYPE__|__UINTMAX_TYPE__|__SIG_ATOMIC_TYPE__|__INT8_TYPE__|__INT16_TYPE__|__INT32_TYPE__|__INT64_TYPE__|__UINT8_TYPE__|__UINT16_TYPE__|__UINT32_TYPE__|__UINT64_TYPE__|__INT_LEAST8_TYPE__|__INT_LEAST16_TYPE__|__INT_LEAST32_TYPE__|__INT_LEAST64_TYPE__|__UINT_LEAST8_TYPE__|__UINT_LEAST16_TYPE__|__UINT_LEAST32_TYPE__|__UINT_LEAST64_TYPE__|__INT_FAST8_TYPE__|__INT_FAST16_TYPE__|__INT_FAST32_TYPE__|__INT_FAST64_TYPE__|__UINT_FAST8_TYPE__|__UINT_FAST16_TYPE__|__UINT_FAST32_TYPE__|__UINT_FAST64_TYPE__|__INTPTR_TYPE__|__UINTPTR_TYPE__|__CHAR_BIT__|__SCHAR_MAX__|__WCHAR_MAX__|__SHRT_MAX__|__INT_MAX__|__LONG_MAX__|__LONG_LONG_MAX__|__WINT_MAX__|__SIZE_MAX__|__PTRDIFF_MAX__|__INTMAX_MAX__|__UINTMAX_MAX__|__SIG_ATOMIC_MAX__|__INT8_MAX__|__INT16_MAX__|__INT32_MAX__|__INT64_MAX__|__UINT8_MAX__|__UINT16_MAX__|__UINT32_MAX__|__UINT64_MAX__|__INT_LEAST8_MAX__|__INT_LEAST16_MAX__|__INT_LEAST32_MAX__|__INT_LEAST64_MAX__|__UINT_LEAST8_MAX__|__UINT_LEAST16_MAX__|__UINT_LEAST32_MAX__|__UINT_LEAST64_MAX__|__INT_FAST8_MAX__|__INT_FAST16_MAX__|__INT_FAST32_MAX__|__INT_FAST64_MAX__|__UINT_FAST8_MAX__|__UINT_FAST16_MAX__|__UINT_FAST32_MAX__|__UINT_FAST64_MAX__|__INTPTR_MAX__|__UINTPTR_MAX__|__WCHAR_MIN__|__WINT_MIN__|__SIG_ATOMIC_MIN__|__SCHAR_WIDTH__|__SHRT_WIDTH__|__INT_WIDTH__|__LONG_WIDTH__|__LONG_LONG_WIDTH__|__PTRDIFF_WIDTH__|__SIG_ATOMIC_WIDTH__|__SIZE_WIDTH__|__WCHAR_WIDTH__|__WINT_WIDTH__|__INT_LEAST8_WIDTH__|__INT_LEAST16_WIDTH__|__INT_LEAST32_WIDTH__|__INT_LEAST64_WIDTH__|__INT_FAST8_WIDTH__|__INT_FAST16_WIDTH__|__INT_FAST32_WIDTH__|__INT_FAST64_WIDTH__|__INTPTR_WIDTH__|__INTMAX_WIDTH__|__SIZEOF_INT__|__SIZEOF_LONG__|__SIZEOF_LONG_LONG__|__SIZEOF_SHORT__|__SIZEOF_POINTER__|__SIZEOF_FLOAT__|__SIZEOF_DOUBLE__|__SIZEOF_LONG_DOUBLE__|__SIZEOF_SIZE_T__|__SIZEOF_WCHAR_T__|__SIZEOF_WINT_T__|__SIZEOF_PTRDIFF_T__|__BYTE_ORDER__|__ORDER_LITTLE_ENDIAN__|__ORDER_BIG_ENDIAN__|__ORDER_PDP_ENDIAN__|__FLOAT_WORD_ORDER__|__DEPRECATED|__EXCEPTIONS|__GXX_RTTI|__USING_SJLJ_EXCEPTIONS__|__GXX_EXPERIMENTAL_CXX0X__|__GXX_WEAK__|__NEXT_RUNTIME__|__LP64__|_LP64|__SSP__|__SSP_ALL__|__SSP_STRONG__|__SSP_EXPLICIT__|__SANITIZE_ADDRESS__|__SANITIZE_THREAD__|__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1|__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2|__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4|__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8|__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16|__HAVE_SPECULATION_SAFE_VALUE|__GCC_HAVE_DWARF2_CFI_ASM|__FP_FAST_FMAF??|__FP_FAST_FMAL|__FP_FAST_FMAF16|__FP_FAST_FMAF32|__FP_FAST_FMAF64|__FP_FAST_FMAF128|__FP_FAST_FMAF32X|__FP_FAST_FMAF64X|__FP_FAST_FMAF128X|__GCC_IEC_559|__GCC_IEC_559_COMPLEX|__NO_MATH_ERRNO__|__has_builtin|__has_feature|__has_extension|__has_cpp_attribute|__has_c_attribute|__has_attribute|__has_declspec_attribute|__is_identifier|__has_include|__has_include_next|__has_warning|__BASE_FILE__|__FILE_NAME__|__clang__|__clang_major__|__clang_minor__|__clang_patchlevel__|__clang_version__|__fp16|_Float16)\\\\b"},{"match":"\\\\b__([A-Z_]+)__\\\\b","name":"entity.name.other.preprocessor.macro.predefined.probably.$1.c"}]},"preprocessor-rule-conditional":{"patterns":[{"begin":"^\\\\s*((#)\\\\s*if(?:n?def)?)\\\\b","beginCaptures":{"0":{"name":"meta.preprocessor.c"},"1":{"name":"keyword.control.directive.conditional.c"},"2":{"name":"punctuation.definition.directive.c"}},"end":"^\\\\s*((#)\\\\s*endif)\\\\b","endCaptures":{"0":{"name":"meta.preprocessor.c"},"1":{"name":"keyword.control.directive.conditional.c"},"2":{"name":"punctuation.definition.directive.c"}},"patterns":[{"begin":"\\\\G(?=.)(?!/(?:/|\\\\*(?!.*\\\\\\\\\\\\s*\\\\n)))","end":"(?=//)|(?=/\\\\*(?!.*\\\\\\\\\\\\s*\\\\n))|(?<!\\\\\\\\)(?=\\\\n)","name":"meta.preprocessor.c","patterns":[{"include":"#preprocessor-rule-conditional-line"}]},{"include":"#preprocessor-rule-enabled-elif"},{"include":"#preprocessor-rule-enabled-else"},{"include":"#preprocessor-rule-disabled-elif"},{"begin":"^\\\\s*((#)\\\\s*elif)\\\\b","beginCaptures":{"1":{"name":"keyword.control.directive.conditional.c"},"2":{"name":"punctuation.definition.directive.c"}},"end":"(?=//)|(?=/\\\\*(?!.*\\\\\\\\\\\\s*\\\\n))|(?<!\\\\\\\\)(?=\\\\n)","name":"meta.preprocessor.c","patterns":[{"include":"#preprocessor-rule-conditional-line"}]},{"include":"$self"}]},{"captures":{"0":{"name":"invalid.illegal.stray-$1.c"}},"match":"^\\\\s*#\\\\s*(e(?:lse|lif|ndif))\\\\b"}]},"preprocessor-rule-conditional-block":{"patterns":[{"begin":"^\\\\s*((#)\\\\s*if(?:n?def)?)\\\\b","beginCaptures":{"0":{"name":"meta.preprocessor.c"},"1":{"name":"keyword.control.directive.conditional.c"},"2":{"name":"punctuation.definition.directive.c"}},"end":"^\\\\s*((#)\\\\s*endif)\\\\b","endCaptures":{"0":{"name":"meta.preprocessor.c"},"1":{"name":"keyword.control.directive.conditional.c"},"2":{"name":"punctuation.definition.directive.c"}},"patterns":[{"begin":"\\\\G(?=.)(?!/(?:/|\\\\*(?!.*\\\\\\\\\\\\s*\\\\n)))","end":"(?=//)|(?=/\\\\*(?!.*\\\\\\\\\\\\s*\\\\n))|(?<!\\\\\\\\)(?=\\\\n)","name":"meta.preprocessor.c","patterns":[{"include":"#preprocessor-rule-conditional-line"}]},{"include":"#preprocessor-rule-enabled-elif-block"},{"include":"#preprocessor-rule-enabled-else-block"},{"include":"#preprocessor-rule-disabled-elif"},{"begin":"^\\\\s*((#)\\\\s*elif)\\\\b","beginCaptures":{"1":{"name":"keyword.control.directive.conditional.c"},"2":{"name":"punctuation.definition.directive.c"}},"end":"(?=//)|(?=/\\\\*(?!.*\\\\\\\\\\\\s*\\\\n))|(?<!\\\\\\\\)(?=\\\\n)","name":"meta.preprocessor.c","patterns":[{"include":"#preprocessor-rule-conditional-line"}]},{"include":"#block_innards"}]},{"captures":{"0":{"name":"invalid.illegal.stray-$1.c"}},"match":"^\\\\s*#\\\\s*(e(?:lse|lif|ndif))\\\\b"}]},"preprocessor-rule-conditional-line":{"patterns":[{"match":"\\\\bdefined\\\\b(?:\\\\s*$|(?=\\\\s*\\\\(*\\\\s*(?!defined\\\\b)[$A-Z_a-z][$\\\\w]*\\\\b\\\\s*\\\\)*\\\\s*(?:\\\\n|//|/\\\\*|[:?]|&&|\\\\|\\\\||\\\\\\\\\\\\s*\\\\n)))","name":"keyword.control.directive.conditional.c"},{"match":"\\\\bdefined\\\\b","name":"invalid.illegal.macro-name.c"},{"include":"#comments"},{"include":"#strings"},{"include":"#numbers"},{"begin":"\\\\?","beginCaptures":{"0":{"name":"keyword.operator.ternary.c"}},"end":":","endCaptures":{"0":{"name":"keyword.operator.ternary.c"}},"patterns":[{"include":"#preprocessor-rule-conditional-line"}]},{"include":"#operators"},{"match":"\\\\b(NULL|true|false|TRUE|FALSE)\\\\b","name":"constant.language.c"},{"match":"[$A-Z_a-z][$\\\\w]*","name":"entity.name.function.preprocessor.c"},{"include":"#line_continuation_character"},{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.parens.begin.bracket.round.c"}},"end":"\\\\)|(?=//)|(?=/\\\\*(?!.*\\\\\\\\\\\\s*\\\\n))|(?<!\\\\\\\\)(?=\\\\n)","endCaptures":{"0":{"name":"punctuation.section.parens.end.bracket.round.c"}},"patterns":[{"include":"#preprocessor-rule-conditional-line"}]}]},"preprocessor-rule-define-line-blocks":{"patterns":[{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.block.begin.bracket.curly.c"}},"end":"}|(?=\\\\s*#\\\\s*e(?:lif|lse|ndif)\\\\b)|(?<!\\\\\\\\)(?=\\\\s*\\\\n)","endCaptures":{"0":{"name":"punctuation.section.block.end.bracket.curly.c"}},"patterns":[{"include":"#preprocessor-rule-define-line-blocks"},{"include":"#preprocessor-rule-define-line-contents"}]},{"include":"#preprocessor-rule-define-line-contents"}]},"preprocessor-rule-define-line-contents":{"patterns":[{"include":"#vararg_ellipses"},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.block.begin.bracket.curly.c"}},"end":"}|(?=\\\\s*#\\\\s*e(?:lif|lse|ndif)\\\\b)|(?<!\\\\\\\\)(?=\\\\s*\\\\n)","endCaptures":{"0":{"name":"punctuation.section.block.end.bracket.curly.c"}},"name":"meta.block.c","patterns":[{"include":"#preprocessor-rule-define-line-blocks"}]},{"match":"\\\\(","name":"punctuation.section.parens.begin.bracket.round.c"},{"match":"\\\\)","name":"punctuation.section.parens.end.bracket.round.c"},{"begin":"(?!(?:while|for|do|if|else|switch|catch|enumerate|return|typeid|alignof|alignas|sizeof|[cr]?iterate|and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas|asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void)\\\\s*\\\\()(?=(?:[A-Z_a-z][0-9A-Z_a-z]*+|::)++\\\\s*\\\\(|(?<=operator)(?:[-!\\\\&*+<=>]+|\\\\(\\\\)|\\\\[])\\\\s*\\\\()","end":"(?<=\\\\))(?!\\\\w)|(?<!\\\\\\\\)(?=\\\\s*\\\\n)","name":"meta.function.c","patterns":[{"include":"#preprocessor-rule-define-line-functions"}]},{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.c"}},"end":"\\"|(?<!\\\\\\\\)(?=\\\\s*\\\\n)","endCaptures":{"0":{"name":"punctuation.definition.string.end.c"}},"name":"string.quoted.double.c","patterns":[{"include":"#string_escaped_char"},{"include":"#string_placeholder"},{"include":"#line_continuation_character"}]},{"begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.c"}},"end":"'|(?<!\\\\\\\\)(?=\\\\s*\\\\n)","endCaptures":{"0":{"name":"punctuation.definition.string.end.c"}},"name":"string.quoted.single.c","patterns":[{"include":"#string_escaped_char"},{"include":"#line_continuation_character"}]},{"include":"#method_access"},{"include":"#member_access"},{"include":"$self"}]},"preprocessor-rule-define-line-functions":{"patterns":[{"include":"#comments"},{"include":"#storage_types"},{"include":"#vararg_ellipses"},{"include":"#method_access"},{"include":"#member_access"},{"include":"#operators"},{"begin":"(?!(?:while|for|do|if|else|switch|catch|enumerate|return|typeid|alignof|alignas|sizeof|[cr]?iterate|and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas)\\\\s*\\\\()((?:[A-Z_a-z][0-9A-Z_a-z]*+|::)++|(?<=operator)(?:[-!\\\\&*+<=>]+|\\\\(\\\\)|\\\\[]))\\\\s*(\\\\()","beginCaptures":{"1":{"name":"entity.name.function.c"},"2":{"name":"punctuation.section.arguments.begin.bracket.round.c"}},"end":"(\\\\))|(?<!\\\\\\\\)(?=\\\\s*\\\\n)","endCaptures":{"1":{"name":"punctuation.section.arguments.end.bracket.round.c"}},"patterns":[{"include":"#preprocessor-rule-define-line-functions"}]},{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.parens.begin.bracket.round.c"}},"end":"(\\\\))|(?<!\\\\\\\\)(?=\\\\s*\\\\n)","endCaptures":{"1":{"name":"punctuation.section.parens.end.bracket.round.c"}},"patterns":[{"include":"#preprocessor-rule-define-line-functions"}]},{"include":"#preprocessor-rule-define-line-contents"}]},"preprocessor-rule-disabled":{"patterns":[{"begin":"^\\\\s*((#)\\\\s*if)\\\\b(?=\\\\s*\\\\(*\\\\b0+\\\\b\\\\)*\\\\s*(?:$|//|/\\\\*))","beginCaptures":{"0":{"name":"meta.preprocessor.c"},"1":{"name":"keyword.control.directive.conditional.c"},"2":{"name":"punctuation.definition.directive.c"}},"end":"^\\\\s*((#)\\\\s*endif)\\\\b","endCaptures":{"0":{"name":"meta.preprocessor.c"},"1":{"name":"keyword.control.directive.conditional.c"},"2":{"name":"punctuation.definition.directive.c"}},"patterns":[{"begin":"\\\\G(?=.)(?!/(?:/|\\\\*(?!.*\\\\\\\\\\\\s*\\\\n)))","end":"(?=//)|(?=/\\\\*(?!.*\\\\\\\\\\\\s*\\\\n))|(?=\\\\n)","name":"meta.preprocessor.c","patterns":[{"include":"#preprocessor-rule-conditional-line"}]},{"include":"#comments"},{"include":"#preprocessor-rule-enabled-elif"},{"include":"#preprocessor-rule-enabled-else"},{"include":"#preprocessor-rule-disabled-elif"},{"begin":"^\\\\s*((#)\\\\s*elif)\\\\b","beginCaptures":{"0":{"name":"meta.preprocessor.c"},"1":{"name":"keyword.control.directive.conditional.c"},"2":{"name":"punctuation.definition.directive.c"}},"end":"(?=^\\\\s*((#)\\\\s*e(?:lif|lse|ndif))\\\\b)","patterns":[{"begin":"\\\\G(?=.)(?!/(?:/|\\\\*(?!.*\\\\\\\\\\\\s*\\\\n)))","end":"(?=//)|(?=/\\\\*(?!.*\\\\\\\\\\\\s*\\\\n))|(?<!\\\\\\\\)(?=\\\\n)","name":"meta.preprocessor.c","patterns":[{"include":"#preprocessor-rule-conditional-line"}]},{"include":"$self"}]},{"begin":"\\\\n","contentName":"comment.block.preprocessor.if-branch.c","end":"(?=^\\\\s*((#)\\\\s*e(?:lse|lif|ndif))\\\\b)","patterns":[{"include":"#disabled"},{"include":"#pragma-mark"}]}]}]},"preprocessor-rule-disabled-block":{"patterns":[{"begin":"^\\\\s*((#)\\\\s*if)\\\\b(?=\\\\s*\\\\(*\\\\b0+\\\\b\\\\)*\\\\s*(?:$|//|/\\\\*))","beginCaptures":{"0":{"name":"meta.preprocessor.c"},"1":{"name":"keyword.control.directive.conditional.c"},"2":{"name":"punctuation.definition.directive.c"}},"end":"^\\\\s*((#)\\\\s*endif)\\\\b","endCaptures":{"0":{"name":"meta.preprocessor.c"},"1":{"name":"keyword.control.directive.conditional.c"},"2":{"name":"punctuation.definition.directive.c"}},"patterns":[{"begin":"\\\\G(?=.)(?!/(?:/|\\\\*(?!.*\\\\\\\\\\\\s*\\\\n)))","end":"(?=//)|(?=/\\\\*(?!.*\\\\\\\\\\\\s*\\\\n))|(?=\\\\n)","name":"meta.preprocessor.c","patterns":[{"include":"#preprocessor-rule-conditional-line"}]},{"include":"#comments"},{"include":"#preprocessor-rule-enabled-elif-block"},{"include":"#preprocessor-rule-enabled-else-block"},{"include":"#preprocessor-rule-disabled-elif"},{"begin":"^\\\\s*((#)\\\\s*elif)\\\\b","beginCaptures":{"0":{"name":"meta.preprocessor.c"},"1":{"name":"keyword.control.directive.conditional.c"},"2":{"name":"punctuation.definition.directive.c"}},"end":"(?=^\\\\s*((#)\\\\s*e(?:lif|lse|ndif))\\\\b)","patterns":[{"begin":"\\\\G(?=.)(?!/(?:/|\\\\*(?!.*\\\\\\\\\\\\s*\\\\n)))","end":"(?=//)|(?=/\\\\*(?!.*\\\\\\\\\\\\s*\\\\n))|(?<!\\\\\\\\)(?=\\\\n)","name":"meta.preprocessor.c","patterns":[{"include":"#preprocessor-rule-conditional-line"}]},{"include":"#block_innards"}]},{"begin":"\\\\n","contentName":"comment.block.preprocessor.if-branch.in-block.c","end":"(?=^\\\\s*((#)\\\\s*e(?:lse|lif|ndif))\\\\b)","patterns":[{"include":"#disabled"},{"include":"#pragma-mark"}]}]}]},"preprocessor-rule-disabled-elif":{"begin":"^\\\\s*((#)\\\\s*elif)\\\\b(?=\\\\s*\\\\(*\\\\b0+\\\\b\\\\)*\\\\s*(?:$|//|/\\\\*))","beginCaptures":{"0":{"name":"meta.preprocessor.c"},"1":{"name":"keyword.control.directive.conditional.c"},"2":{"name":"punctuation.definition.directive.c"}},"end":"(?=^\\\\s*((#)\\\\s*e(?:lif|lse|ndif))\\\\b)","patterns":[{"begin":"\\\\G(?=.)(?!/(?:/|\\\\*(?!.*\\\\\\\\\\\\s*\\\\n)))","end":"(?=//)|(?=/\\\\*(?!.*\\\\\\\\\\\\s*\\\\n))|(?<!\\\\\\\\)(?=\\\\n)","name":"meta.preprocessor.c","patterns":[{"include":"#preprocessor-rule-conditional-line"}]},{"include":"#comments"},{"begin":"\\\\n","contentName":"comment.block.preprocessor.elif-branch.c","end":"(?=^\\\\s*((#)\\\\s*e(?:lse|lif|ndif))\\\\b)","patterns":[{"include":"#disabled"},{"include":"#pragma-mark"}]}]},"preprocessor-rule-enabled":{"patterns":[{"begin":"^\\\\s*((#)\\\\s*if)\\\\b(?=\\\\s*\\\\(*\\\\b0*1\\\\b\\\\)*\\\\s*(?:$|//|/\\\\*))","beginCaptures":{"0":{"name":"meta.preprocessor.c"},"1":{"name":"keyword.control.directive.conditional.c"},"2":{"name":"punctuation.definition.directive.c"},"3":{"name":"constant.numeric.preprocessor.c"}},"end":"^\\\\s*((#)\\\\s*endif)\\\\b","endCaptures":{"0":{"name":"meta.preprocessor.c"},"1":{"name":"keyword.control.directive.conditional.c"},"2":{"name":"punctuation.definition.directive.c"}},"patterns":[{"begin":"\\\\G(?=.)(?!/(?:/|\\\\*(?!.*\\\\\\\\\\\\s*\\\\n)))","end":"(?=//)|(?=/\\\\*(?!.*\\\\\\\\\\\\s*\\\\n))|(?=\\\\n)","name":"meta.preprocessor.c","patterns":[{"include":"#preprocessor-rule-conditional-line"}]},{"include":"#comments"},{"begin":"^\\\\s*((#)\\\\s*else)\\\\b","beginCaptures":{"0":{"name":"meta.preprocessor.c"},"1":{"name":"keyword.control.directive.conditional.c"},"2":{"name":"punctuation.definition.directive.c"}},"contentName":"comment.block.preprocessor.else-branch.c","end":"(?=^\\\\s*((#)\\\\s*endif)\\\\b)","patterns":[{"include":"#disabled"},{"include":"#pragma-mark"}]},{"begin":"^\\\\s*((#)\\\\s*elif)\\\\b","beginCaptures":{"0":{"name":"meta.preprocessor.c"},"1":{"name":"keyword.control.directive.conditional.c"},"2":{"name":"punctuation.definition.directive.c"}},"contentName":"comment.block.preprocessor.if-branch.c","end":"(?=^\\\\s*((#)\\\\s*e(?:lse|lif|ndif))\\\\b)","patterns":[{"include":"#disabled"},{"include":"#pragma-mark"}]},{"begin":"\\\\n","end":"(?=^\\\\s*((#)\\\\s*e(?:lse|lif|ndif))\\\\b)","patterns":[{"include":"$self"}]}]}]},"preprocessor-rule-enabled-block":{"patterns":[{"begin":"^\\\\s*((#)\\\\s*if)\\\\b(?=\\\\s*\\\\(*\\\\b0*1\\\\b\\\\)*\\\\s*(?:$|//|/\\\\*))","beginCaptures":{"0":{"name":"meta.preprocessor.c"},"1":{"name":"keyword.control.directive.conditional.c"},"2":{"name":"punctuation.definition.directive.c"}},"end":"^\\\\s*((#)\\\\s*endif)\\\\b","endCaptures":{"0":{"name":"meta.preprocessor.c"},"1":{"name":"keyword.control.directive.conditional.c"},"2":{"name":"punctuation.definition.directive.c"}},"patterns":[{"begin":"\\\\G(?=.)(?!/(?:/|\\\\*(?!.*\\\\\\\\\\\\s*\\\\n)))","end":"(?=//)|(?=/\\\\*(?!.*\\\\\\\\\\\\s*\\\\n))|(?=\\\\n)","name":"meta.preprocessor.c","patterns":[{"include":"#preprocessor-rule-conditional-line"}]},{"include":"#comments"},{"begin":"^\\\\s*((#)\\\\s*else)\\\\b","beginCaptures":{"0":{"name":"meta.preprocessor.c"},"1":{"name":"keyword.control.directive.conditional.c"},"2":{"name":"punctuation.definition.directive.c"}},"contentName":"comment.block.preprocessor.else-branch.in-block.c","end":"(?=^\\\\s*((#)\\\\s*endif)\\\\b)","patterns":[{"include":"#disabled"},{"include":"#pragma-mark"}]},{"begin":"^\\\\s*((#)\\\\s*elif)\\\\b","beginCaptures":{"0":{"name":"meta.preprocessor.c"},"1":{"name":"keyword.control.directive.conditional.c"},"2":{"name":"punctuation.definition.directive.c"}},"contentName":"comment.block.preprocessor.if-branch.in-block.c","end":"(?=^\\\\s*((#)\\\\s*e(?:lse|lif|ndif))\\\\b)","patterns":[{"include":"#disabled"},{"include":"#pragma-mark"}]},{"begin":"\\\\n","end":"(?=^\\\\s*((#)\\\\s*e(?:lse|lif|ndif))\\\\b)","patterns":[{"include":"#block_innards"}]}]}]},"preprocessor-rule-enabled-elif":{"begin":"^\\\\s*((#)\\\\s*elif)\\\\b(?=\\\\s*\\\\(*\\\\b0*1\\\\b\\\\)*\\\\s*(?:$|//|/\\\\*))","beginCaptures":{"0":{"name":"meta.preprocessor.c"},"1":{"name":"keyword.control.directive.conditional.c"},"2":{"name":"punctuation.definition.directive.c"}},"end":"(?=^\\\\s*((#)\\\\s*endif)\\\\b)","patterns":[{"begin":"\\\\G(?=.)(?!/(?:/|\\\\*(?!.*\\\\\\\\\\\\s*\\\\n)))","end":"(?=//)|(?=/\\\\*(?!.*\\\\\\\\\\\\s*\\\\n))|(?<!\\\\\\\\)(?=\\\\n)","name":"meta.preprocessor.c","patterns":[{"include":"#preprocessor-rule-conditional-line"}]},{"include":"#comments"},{"begin":"\\\\n","end":"(?=^\\\\s*((#)\\\\s*endif)\\\\b)","patterns":[{"begin":"^\\\\s*((#)\\\\s*(else))\\\\b","beginCaptures":{"0":{"name":"meta.preprocessor.c"},"1":{"name":"keyword.control.directive.conditional.c"},"2":{"name":"punctuation.definition.directive.c"}},"contentName":"comment.block.preprocessor.elif-branch.c","end":"(?=^\\\\s*((#)\\\\s*endif)\\\\b)","patterns":[{"include":"#disabled"},{"include":"#pragma-mark"}]},{"begin":"^\\\\s*((#)\\\\s*(elif))\\\\b","beginCaptures":{"0":{"name":"meta.preprocessor.c"},"1":{"name":"keyword.control.directive.conditional.c"},"2":{"name":"punctuation.definition.directive.c"}},"contentName":"comment.block.preprocessor.elif-branch.c","end":"(?=^\\\\s*((#)\\\\s*e(?:lse|lif|ndif))\\\\b)","patterns":[{"include":"#disabled"},{"include":"#pragma-mark"}]},{"include":"$self"}]}]},"preprocessor-rule-enabled-elif-block":{"begin":"^\\\\s*((#)\\\\s*elif)\\\\b(?=\\\\s*\\\\(*\\\\b0*1\\\\b\\\\)*\\\\s*(?:$|//|/\\\\*))","beginCaptures":{"0":{"name":"meta.preprocessor.c"},"1":{"name":"keyword.control.directive.conditional.c"},"2":{"name":"punctuation.definition.directive.c"}},"end":"(?=^\\\\s*((#)\\\\s*endif)\\\\b)","patterns":[{"begin":"\\\\G(?=.)(?!/(?:/|\\\\*(?!.*\\\\\\\\\\\\s*\\\\n)))","end":"(?=//)|(?=/\\\\*(?!.*\\\\\\\\\\\\s*\\\\n))|(?<!\\\\\\\\)(?=\\\\n)","name":"meta.preprocessor.c","patterns":[{"include":"#preprocessor-rule-conditional-line"}]},{"include":"#comments"},{"begin":"\\\\n","end":"(?=^\\\\s*((#)\\\\s*endif)\\\\b)","patterns":[{"begin":"^\\\\s*((#)\\\\s*(else))\\\\b","beginCaptures":{"0":{"name":"meta.preprocessor.c"},"1":{"name":"keyword.control.directive.conditional.c"},"2":{"name":"punctuation.definition.directive.c"}},"contentName":"comment.block.preprocessor.elif-branch.in-block.c","end":"(?=^\\\\s*((#)\\\\s*endif)\\\\b)","patterns":[{"include":"#disabled"},{"include":"#pragma-mark"}]},{"begin":"^\\\\s*((#)\\\\s*(elif))\\\\b","beginCaptures":{"0":{"name":"meta.preprocessor.c"},"1":{"name":"keyword.control.directive.conditional.c"},"2":{"name":"punctuation.definition.directive.c"}},"contentName":"comment.block.preprocessor.elif-branch.c","end":"(?=^\\\\s*((#)\\\\s*e(?:lse|lif|ndif))\\\\b)","patterns":[{"include":"#disabled"},{"include":"#pragma-mark"}]},{"include":"#block_innards"}]}]},"preprocessor-rule-enabled-else":{"begin":"^\\\\s*((#)\\\\s*else)\\\\b","beginCaptures":{"0":{"name":"meta.preprocessor.c"},"1":{"name":"keyword.control.directive.conditional.c"},"2":{"name":"punctuation.definition.directive.c"}},"end":"(?=^\\\\s*((#)\\\\s*endif)\\\\b)","patterns":[{"include":"$self"}]},"preprocessor-rule-enabled-else-block":{"begin":"^\\\\s*((#)\\\\s*else)\\\\b","beginCaptures":{"0":{"name":"meta.preprocessor.c"},"1":{"name":"keyword.control.directive.conditional.c"},"2":{"name":"punctuation.definition.directive.c"}},"end":"(?=^\\\\s*((#)\\\\s*endif)\\\\b)","patterns":[{"include":"#block_innards"}]},"probably_a_parameter":{"captures":{"1":{"name":"variable.parameter.probably.c"}},"match":"(?<=[0-9A-Z_a-z] |[]\\\\&)*>])\\\\s*([A-Z_a-z]\\\\w*)\\\\s*(?=(?:\\\\[]\\\\s*)?[),])"},"static_assert":{"begin":"((?>(?:(?>(?<!\\\\s)\\\\s+)|(/\\\\*)((?>(?:[^*]|(?>\\\\*+)[^/])*)((?>\\\\*+)/)))+|(?:(?:(?:(?:\\\\b|(?<=\\\\W))|(?=\\\\W))|\\\\A)|\\\\Z)))((?<!\\\\w)static_assert|_Static_assert(?!\\\\w))((?>(?:(?>(?<!\\\\s)\\\\s+)|(/\\\\*)((?>(?:[^*]|(?>\\\\*+)[^/])*)((?>\\\\*+)/)))+|(?:(?:(?:(?:\\\\b|(?<=\\\\W))|(?=\\\\W))|\\\\A)|\\\\Z)))(\\\\()","beginCaptures":{"1":{"patterns":[{"include":"#inline_comment"}]},"2":{"name":"comment.block.c punctuation.definition.comment.begin.c"},"3":{"name":"comment.block.c"},"4":{"patterns":[{"match":"\\\\*/","name":"comment.block.c punctuation.definition.comment.end.c"},{"match":"\\\\*","name":"comment.block.c"}]},"5":{"name":"keyword.other.static_assert.c"},"6":{"patterns":[{"include":"#inline_comment"}]},"7":{"name":"comment.block.c punctuation.definition.comment.begin.c"},"8":{"name":"comment.block.c"},"9":{"patterns":[{"match":"\\\\*/","name":"comment.block.c punctuation.definition.comment.end.c"},{"match":"\\\\*","name":"comment.block.c"}]},"10":{"name":"punctuation.section.arguments.begin.bracket.round.static_assert.c"}},"end":"(\\\\))","endCaptures":{"1":{"name":"punctuation.section.arguments.end.bracket.round.static_assert.c"}},"patterns":[{"begin":"(,)\\\\s*(?=(?:L|u8?|U\\\\s*\\")?)","beginCaptures":{"1":{"name":"punctuation.separator.delimiter.comma.c"}},"end":"(?=\\\\))","name":"meta.static_assert.message.c","patterns":[{"include":"#string_context"}]},{"include":"#evaluation_context"}]},"storage_types":{"patterns":[{"match":"(?-im:(?<!\\\\w)(?:unsigned|signed|double|_Bool|short|float|long|void|char|bool|int)(?!\\\\w))","name":"storage.type.built-in.primitive.c"},{"match":"(?-im:(?<!\\\\w)(?:atomic_uint_least64_t|atomic_uint_least16_t|atomic_uint_least32_t|pthread_rwlockattr_t|atomic_uint_fast64_t|atomic_uint_fast32_t|atomic_uint_fast16_t|atomic_int_least64_t|atomic_int_least32_t|atomic_int_least16_t|atomic_uint_least8_t|atomic_uint_fast8_t|atomic_int_least8_t|atomic_int_fast16_t|pthread_mutexattr_t|atomic_int_fast32_t|atomic_int_fast64_t|atomic_int_fast8_t|pthread_condattr_t|atomic_ptrdiff_t|pthread_rwlock_t|atomic_uintptr_t|atomic_uintmax_t|atomic_intmax_t|atomic_intptr_t|atomic_char32_t|atomic_char16_t|pthread_mutex_t|pthread_cond_t|atomic_wchar_t|uint_least64_t|uint_least32_t|uint_least16_t|pthread_once_t|pthread_attr_t|int_least32_t|pthread_key_t|int_least16_t|int_least64_t|uint_least8_t|uint_fast16_t|uint_fast32_t|uint_fast64_t|atomic_ushort|atomic_ullong|atomic_size_t|int_fast16_t|int_fast64_t|uint_fast8_t|atomic_short|atomic_uchar|atomic_schar|int_least8_t|memory_order|atomic_llong|atomic_ulong|int_fast32_t|atomic_long|atomic_uint|atomic_char|int_fast8_t|suseconds_t|atomic_bool|atomic_int|_Imaginary|useconds_t|in_port_t|uintmax_t|pthread_t|blksize_t|in_addr_t|uintptr_t|blkcnt_t|uint16_t|uint32_t|uint64_t|u_quad_t|_Complex|intptr_t|intmax_t|segsz_t|u_short|nlink_t|uint8_t|int64_t|int32_t|int16_t|fixpt_t|daddr_t|caddr_t|qaddr_t|ssize_t|clock_t|swblk_t|u_long|mode_t|int8_t|time_t|ushort|u_char|quad_t|size_t|pid_t|gid_t|uid_t|dev_t|div_t|off_t|u_int|key_t|ino_t|uint|id_t)(?!\\\\w))","name":"storage.type.built-in.c"},{"match":"(?-im:\\\\b(enum|struct|union)\\\\b)","name":"storage.type.$1.c"},{"begin":"\\\\b(__asm__|asm)\\\\b\\\\s*((?:volatile)?)","beginCaptures":{"1":{"name":"storage.type.asm.c"},"2":{"name":"storage.modifier.c"}},"end":"(?!\\\\G)","name":"meta.asm.c","patterns":[{"captures":{"1":{"patterns":[{"include":"#inline_comment"}]},"2":{"name":"comment.block.c punctuation.definition.comment.begin.c"},"3":{"name":"comment.block.c"},"4":{"patterns":[{"match":"\\\\*/","name":"comment.block.c punctuation.definition.comment.end.c"},{"match":"\\\\*","name":"comment.block.c"}]}},"match":"^((?:(?>\\\\s+)|(/\\\\*)((?>(?:[^*]|(?>\\\\*+)[^/])*)((?>\\\\*+)/)))+?|(?:(?:(?:(?:\\\\b|(?<=\\\\W))|(?=\\\\W))|\\\\A)|\\\\Z))(?:\\\\n|$)"},{"include":"#comments"},{"begin":"(((?:(?>\\\\s+)|(/\\\\*)((?>(?:[^*]|(?>\\\\*+)[^/])*)((?>\\\\*+)/)))+?|(?:(?:(?:(?:\\\\b|(?<=\\\\W))|(?=\\\\W))|\\\\A)|\\\\Z))\\\\()","beginCaptures":{"1":{"name":"punctuation.section.parens.begin.bracket.round.assembly.c"},"2":{"patterns":[{"include":"#inline_comment"}]},"3":{"name":"comment.block.c punctuation.definition.comment.begin.c"},"4":{"name":"comment.block.c"},"5":{"patterns":[{"match":"\\\\*/","name":"comment.block.c punctuation.definition.comment.end.c"},{"match":"\\\\*","name":"comment.block.c"}]}},"end":"(\\\\))","endCaptures":{"1":{"name":"punctuation.section.parens.end.bracket.round.assembly.c"}},"patterns":[{"begin":"(R?)(\\")","beginCaptures":{"1":{"name":"meta.encoding.c"},"2":{"name":"punctuation.definition.string.begin.assembly.c"}},"contentName":"meta.embedded.assembly.c","end":"(\\")","endCaptures":{"1":{"name":"punctuation.definition.string.end.assembly.c"}},"name":"string.quoted.double.c","patterns":[{"include":"source.asm"},{"include":"source.x86"},{"include":"source.x86_64"},{"include":"source.arm"},{"include":"#backslash_escapes"},{"include":"#string_escaped_char"}]},{"begin":"(\\\\()","beginCaptures":{"1":{"name":"punctuation.section.parens.begin.bracket.round.assembly.inner.c"}},"end":"(\\\\))","endCaptures":{"1":{"name":"punctuation.section.parens.end.bracket.round.assembly.inner.c"}},"patterns":[{"include":"#evaluation_context"}]},{"captures":{"1":{"patterns":[{"include":"#inline_comment"}]},"2":{"name":"comment.block.c punctuation.definition.comment.begin.c"},"3":{"name":"comment.block.c"},"4":{"patterns":[{"match":"\\\\*/","name":"comment.block.c punctuation.definition.comment.end.c"},{"match":"\\\\*","name":"comment.block.c"}]},"5":{"name":"variable.other.asm.label.c"},"6":{"patterns":[{"include":"#inline_comment"}]},"7":{"name":"comment.block.c punctuation.definition.comment.begin.c"},"8":{"name":"comment.block.c"},"9":{"patterns":[{"match":"\\\\*/","name":"comment.block.c punctuation.definition.comment.end.c"},{"match":"\\\\*","name":"comment.block.c"}]}},"match":"\\\\[((?:(?>\\\\s+)|(/\\\\*)((?>(?:[^*]|(?>\\\\*+)[^/])*)((?>\\\\*+)/)))+?|(?:(?:(?:(?:\\\\b|(?<=\\\\W))|(?=\\\\W))|\\\\A)|\\\\Z))([A-Z_a-z]\\\\w*)((?:(?>\\\\s+)|(/\\\\*)((?>(?:[^*]|(?>\\\\*+)[^/])*)((?>\\\\*+)/)))+?|(?:(?:(?:(?:\\\\b|(?<=\\\\W))|(?=\\\\W))|\\\\A)|\\\\Z))]"},{"match":":","name":"punctuation.separator.delimiter.colon.assembly.c"},{"include":"#comments"}]}]}]},"string_escaped_char":{"patterns":[{"match":"\\\\\\\\([\\"'?\\\\\\\\abefnprtv]|[0-3]\\\\d{0,2}|[4-7]\\\\d?|x\\\\h{0,2}|u\\\\h{0,4}|U\\\\h{0,8})","name":"constant.character.escape.c"},{"match":"\\\\\\\\.","name":"invalid.illegal.unknown-escape.c"}]},"string_placeholder":{"patterns":[{"match":"%(\\\\d+\\\\$)?[- #'+0]*[,:;_]?((-?\\\\d+)|\\\\*(-?\\\\d+\\\\$)?)?(\\\\.((-?\\\\d+)|\\\\*(-?\\\\d+\\\\$)?)?)?(hh?|ll|[Ljlqtz]|vh|vl?|hv|hl)?[%AC-GOSUXac-ginopsux]","name":"constant.other.placeholder.c"},{"captures":{"1":{"name":"invalid.illegal.placeholder.c"}},"match":"(%)(?!\\"\\\\s*(PRI|SCN))"}]},"strings":{"patterns":[{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.c"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.c"}},"name":"string.quoted.double.c","patterns":[{"include":"#string_escaped_char"},{"include":"#string_placeholder"},{"include":"#line_continuation_character"}]},{"begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.c"}},"end":"'","endCaptures":{"0":{"name":"punctuation.definition.string.end.c"}},"name":"string.quoted.single.c","patterns":[{"include":"#string_escaped_char"},{"include":"#line_continuation_character"}]}]},"switch_conditional_parentheses":{"begin":"((?>(?:(?>(?<!\\\\s)\\\\s+)|(/\\\\*)((?>(?:[^*]|(?>\\\\*+)[^/])*)((?>\\\\*+)/)))+|(?:(?:(?:(?:\\\\b|(?<=\\\\W))|(?=\\\\W))|\\\\A)|\\\\Z)))(\\\\()","beginCaptures":{"1":{"patterns":[{"include":"#inline_comment"}]},"2":{"name":"comment.block.c punctuation.definition.comment.begin.c"},"3":{"name":"comment.block.c"},"4":{"patterns":[{"match":"\\\\*/","name":"comment.block.c punctuation.definition.comment.end.c"},{"match":"\\\\*","name":"comment.block.c"}]},"5":{"name":"punctuation.section.parens.begin.bracket.round.conditional.switch.c"}},"end":"(\\\\))","endCaptures":{"1":{"name":"punctuation.section.parens.end.bracket.round.conditional.switch.c"}},"name":"meta.conditional.switch.c","patterns":[{"include":"#evaluation_context"},{"include":"#c_conditional_context"}]},"switch_statement":{"begin":"(((?>(?:(?>(?<!\\\\s)\\\\s+)|(/\\\\*)((?>(?:[^*]|(?>\\\\*+)[^/])*)((?>\\\\*+)/)))+|(?:(?:(?:(?:\\\\b|(?<=\\\\W))|(?=\\\\W))|\\\\A)|\\\\Z)))((?<!\\\\w)switch(?!\\\\w)))","beginCaptures":{"1":{"name":"meta.head.switch.c"},"2":{"patterns":[{"include":"#inline_comment"}]},"3":{"name":"comment.block.c punctuation.definition.comment.begin.c"},"4":{"name":"comment.block.c"},"5":{"patterns":[{"match":"\\\\*/","name":"comment.block.c punctuation.definition.comment.end.c"},{"match":"\\\\*","name":"comment.block.c"}]},"6":{"name":"keyword.control.switch.c"}},"end":"(?<=}|%>|\\\\?\\\\?>)|(?=[];=>\\\\[])","name":"meta.block.switch.c","patterns":[{"begin":"\\\\G ?","end":"(\\\\{|<%|\\\\?\\\\?<|(?=;))","endCaptures":{"1":{"name":"punctuation.section.block.begin.bracket.curly.switch.c"}},"name":"meta.head.switch.c","patterns":[{"include":"#switch_conditional_parentheses"},{"include":"$self"}]},{"begin":"(?<=\\\\{|<%|\\\\?\\\\?<)","end":"(}|%>|\\\\?\\\\?>)","endCaptures":{"1":{"name":"punctuation.section.block.end.bracket.curly.switch.c"}},"name":"meta.body.switch.c","patterns":[{"include":"#default_statement"},{"include":"#case_statement"},{"include":"$self"},{"include":"#block_innards"}]},{"begin":"(?<=}|%>|\\\\?\\\\?>)[\\\\n\\\\s]*","end":"[\\\\n\\\\s]*(?=;)","name":"meta.tail.switch.c","patterns":[{"include":"$self"}]}]},"vararg_ellipses":{"match":"(?<!\\\\.)\\\\.\\\\.\\\\.(?!\\\\.)","name":"punctuation.vararg-ellipses.c"}},"scopeName":"source.c"}`)),n=[e];export{n as default};