@truefoundry/trueforge 0.1.0-rc.0 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/dist/_frontend/assets/ConnectorSettings-H37ZFC6Z-BoDzRBt-.js +1 -0
  2. package/dist/_frontend/assets/ConnectorSettings-H37ZFC6Z-BoDzRBt-.js.br +0 -0
  3. package/dist/_frontend/assets/ConnectorSettings-H37ZFC6Z-BoDzRBt-.js.gz +0 -0
  4. package/dist/_frontend/assets/{DockLayout-WRF7EQLD-BRAhcSNV.js → DockLayout-KEMFRWIR-2H2_fGVk.js} +1 -1
  5. package/dist/_frontend/assets/{DrawerLayout-X2UXYTOS-D60ziyi9.js → DrawerLayout-ZVWCKEIS-DFGUqK6q.js} +2 -2
  6. package/dist/_frontend/assets/DrawerLayout-ZVWCKEIS-DFGUqK6q.js.br +0 -0
  7. package/dist/_frontend/assets/DrawerLayout-ZVWCKEIS-DFGUqK6q.js.gz +0 -0
  8. package/dist/_frontend/assets/ModelSettings-QJMYHCMD-DaR_pzAb.js +1 -0
  9. package/dist/_frontend/assets/ModelSettings-QJMYHCMD-DaR_pzAb.js.br +0 -0
  10. package/dist/_frontend/assets/ModelSettings-QJMYHCMD-DaR_pzAb.js.gz +0 -0
  11. package/dist/_frontend/assets/SandboxSettings-BUBMLW7Q-ChiNe2Y8.js +1 -0
  12. package/dist/_frontend/assets/SandboxSettings-BUBMLW7Q-ChiNe2Y8.js.br +0 -0
  13. package/dist/_frontend/assets/SandboxSettings-BUBMLW7Q-ChiNe2Y8.js.gz +0 -0
  14. package/dist/_frontend/assets/SettingsBuilder-26XSGIHK-DmgjXL0m.js +2 -0
  15. package/dist/_frontend/assets/SettingsBuilder-26XSGIHK-DmgjXL0m.js.br +0 -0
  16. package/dist/_frontend/assets/SettingsBuilder-26XSGIHK-DmgjXL0m.js.gz +0 -0
  17. package/dist/_frontend/assets/{SidebarLayout-M7HEOZVK-owseAySg.js → SidebarLayout-F3XFXW7B-BQV8bkzL.js} +2 -2
  18. package/dist/_frontend/assets/SidebarLayout-F3XFXW7B-BQV8bkzL.js.br +0 -0
  19. package/dist/_frontend/assets/SidebarLayout-F3XFXW7B-BQV8bkzL.js.gz +0 -0
  20. package/dist/_frontend/assets/{SkillSettings-MXK4ZEI7-CrK7D1D-.js → SkillSettings-IRMGDFRG-ChKre3S8.js} +1 -1
  21. package/dist/_frontend/assets/SkillSettings-IRMGDFRG-ChKre3S8.js.br +0 -0
  22. package/dist/_frontend/assets/SkillSettings-IRMGDFRG-ChKre3S8.js.gz +0 -0
  23. package/dist/_frontend/assets/{WidgetLayout-7MDOKLHU-OdQcbsJk.js → WidgetLayout-SZMABKIR-BRKArpEm.js} +1 -1
  24. package/dist/_frontend/assets/WidgetLayout-SZMABKIR-BRKArpEm.js.br +0 -0
  25. package/dist/_frontend/assets/WidgetLayout-SZMABKIR-BRKArpEm.js.gz +0 -0
  26. package/dist/_frontend/assets/{chunk-NBMP2XNL-DdVXEaJy.js → chunk-7EEOWDLE-BIwInB6G.js} +2 -2
  27. package/dist/_frontend/assets/chunk-7EEOWDLE-BIwInB6G.js.br +0 -0
  28. package/dist/_frontend/assets/chunk-7EEOWDLE-BIwInB6G.js.gz +0 -0
  29. package/dist/_frontend/assets/{chunk-WFC3W4C3-DXFwnpmH.js → chunk-LRQHHZDX-eb14Z2nA.js} +1 -1
  30. package/dist/_frontend/assets/chunk-LRQHHZDX-eb14Z2nA.js.br +0 -0
  31. package/dist/_frontend/assets/chunk-LRQHHZDX-eb14Z2nA.js.gz +0 -0
  32. package/dist/_frontend/assets/{cssMode-BIIwADkQ.js → cssMode-Bb1lR8Ti.js} +1 -1
  33. package/dist/_frontend/assets/cssMode-Bb1lR8Ti.js.br +0 -0
  34. package/dist/_frontend/assets/cssMode-Bb1lR8Ti.js.gz +0 -0
  35. package/dist/_frontend/assets/{freemarker2-DWtRl63b.js → freemarker2-BrrF7mKG.js} +1 -1
  36. package/dist/_frontend/assets/freemarker2-BrrF7mKG.js.br +0 -0
  37. package/dist/_frontend/assets/freemarker2-BrrF7mKG.js.gz +0 -0
  38. package/dist/_frontend/assets/{handlebars-CJJYL_TE.js → handlebars-WQ7HMT1b.js} +1 -1
  39. package/dist/_frontend/assets/handlebars-WQ7HMT1b.js.br +0 -0
  40. package/dist/_frontend/assets/handlebars-WQ7HMT1b.js.gz +0 -0
  41. package/dist/_frontend/assets/{html-CIyPQjdd.js → html-CoOPnhCb.js} +1 -1
  42. package/dist/_frontend/assets/html-CoOPnhCb.js.br +0 -0
  43. package/dist/_frontend/assets/html-CoOPnhCb.js.gz +0 -0
  44. package/dist/_frontend/assets/{htmlMode-CDsupPvj.js → htmlMode-BW7taYty.js} +1 -1
  45. package/dist/_frontend/assets/htmlMode-BW7taYty.js.br +0 -0
  46. package/dist/_frontend/assets/htmlMode-BW7taYty.js.gz +0 -0
  47. package/dist/_frontend/assets/{index-B8NomNE2.js → index-ChCGltYc.js} +242 -232
  48. package/dist/_frontend/assets/index-ChCGltYc.js.br +0 -0
  49. package/dist/_frontend/assets/index-ChCGltYc.js.gz +0 -0
  50. package/dist/_frontend/assets/{index-CKMEtdQA.js → index-DFQqb6R1.js} +3 -3
  51. package/dist/_frontend/assets/index-DFQqb6R1.js.br +0 -0
  52. package/dist/_frontend/assets/index-DFQqb6R1.js.gz +0 -0
  53. package/dist/_frontend/assets/{javascript-CPSnXnaS.js → javascript-CPINtbIt.js} +1 -1
  54. package/dist/_frontend/assets/{jsonMode-DRy4DQT3.js → jsonMode-C8qDzOfb.js} +1 -1
  55. package/dist/_frontend/assets/jsonMode-C8qDzOfb.js.br +0 -0
  56. package/dist/_frontend/assets/jsonMode-C8qDzOfb.js.gz +0 -0
  57. package/dist/_frontend/assets/{liquid-a-xIf2lN.js → liquid-zGC9H1Dt.js} +1 -1
  58. package/dist/_frontend/assets/liquid-zGC9H1Dt.js.br +0 -0
  59. package/dist/_frontend/assets/liquid-zGC9H1Dt.js.gz +0 -0
  60. package/dist/_frontend/assets/{lspLanguageFeatures-Tavpp1a0.js → lspLanguageFeatures-B6VPH2Sv.js} +1 -1
  61. package/dist/_frontend/assets/lspLanguageFeatures-B6VPH2Sv.js.br +0 -0
  62. package/dist/_frontend/assets/lspLanguageFeatures-B6VPH2Sv.js.gz +0 -0
  63. package/dist/_frontend/assets/{mdx-D3wOHh0p.js → mdx-BrQrGCP9.js} +1 -1
  64. package/dist/_frontend/assets/mdx-BrQrGCP9.js.br +0 -0
  65. package/dist/_frontend/assets/mdx-BrQrGCP9.js.gz +0 -0
  66. package/dist/_frontend/assets/{python-8zlVof3q.js → python-zKGpYLwR.js} +1 -1
  67. package/dist/_frontend/assets/python-zKGpYLwR.js.br +0 -0
  68. package/dist/_frontend/assets/python-zKGpYLwR.js.gz +0 -0
  69. package/dist/_frontend/assets/{razor-q_HfjjpC.js → razor-BJ38lYsd.js} +1 -1
  70. package/dist/_frontend/assets/razor-BJ38lYsd.js.br +0 -0
  71. package/dist/_frontend/assets/razor-BJ38lYsd.js.gz +0 -0
  72. package/dist/_frontend/assets/{tsMode-DOOZolwq.js → tsMode-dPLqGMg8.js} +1 -1
  73. package/dist/_frontend/assets/tsMode-dPLqGMg8.js.br +0 -0
  74. package/dist/_frontend/assets/tsMode-dPLqGMg8.js.gz +0 -0
  75. package/dist/_frontend/assets/{typescript-CmhvHmNu.js → typescript-BJlivWry.js} +1 -1
  76. package/dist/_frontend/assets/typescript-BJlivWry.js.br +0 -0
  77. package/dist/_frontend/assets/typescript-BJlivWry.js.gz +0 -0
  78. package/dist/_frontend/assets/{workers-CfU2h0GU.js → workers-fMwav4jB.js} +1 -1
  79. package/dist/_frontend/assets/workers-fMwav4jB.js.br +0 -0
  80. package/dist/_frontend/assets/workers-fMwav4jB.js.gz +0 -0
  81. package/dist/_frontend/assets/{xml-D3jhgOra.js → xml-DZW470wi.js} +1 -1
  82. package/dist/_frontend/assets/xml-DZW470wi.js.br +0 -0
  83. package/dist/_frontend/assets/xml-DZW470wi.js.gz +0 -0
  84. package/dist/_frontend/assets/{yaml-B-q42846.js → yaml-Bs1DumYp.js} +1 -1
  85. package/dist/_frontend/assets/yaml-Bs1DumYp.js.br +0 -0
  86. package/dist/_frontend/assets/yaml-Bs1DumYp.js.gz +0 -0
  87. package/dist/_frontend/index.html +1 -1
  88. package/dist/_frontend/index.html.br +0 -0
  89. package/dist/_frontend/index.html.gz +0 -0
  90. package/dist/main.js +120 -79
  91. package/dist/main.js.map +1 -1
  92. package/dist/postgres/migrations/20260815_000002_mcp_server_description.js +23 -0
  93. package/dist/postgres/migrations/20260815_000002_mcp_server_description.js.map +1 -0
  94. package/dist/sqlite/migrations/20260815_000002_mcp_server_description.js +21 -0
  95. package/dist/sqlite/migrations/20260815_000002_mcp_server_description.js.map +1 -0
  96. package/package.json +2 -2
  97. package/dist/_frontend/assets/ConnectorSettings-CLBEWGQJ-BjMXOS3R.js +0 -1
  98. package/dist/_frontend/assets/ConnectorSettings-CLBEWGQJ-BjMXOS3R.js.br +0 -0
  99. package/dist/_frontend/assets/ConnectorSettings-CLBEWGQJ-BjMXOS3R.js.gz +0 -0
  100. package/dist/_frontend/assets/DrawerLayout-X2UXYTOS-D60ziyi9.js.br +0 -0
  101. package/dist/_frontend/assets/DrawerLayout-X2UXYTOS-D60ziyi9.js.gz +0 -0
  102. package/dist/_frontend/assets/ModelSettings-IJ55QJQO-BFV2nfxB.js +0 -1
  103. package/dist/_frontend/assets/ModelSettings-IJ55QJQO-BFV2nfxB.js.br +0 -0
  104. package/dist/_frontend/assets/ModelSettings-IJ55QJQO-BFV2nfxB.js.gz +0 -0
  105. package/dist/_frontend/assets/SandboxSettings-S5XGZWOL-BUQpWdqg.js +0 -1
  106. package/dist/_frontend/assets/SandboxSettings-S5XGZWOL-BUQpWdqg.js.br +0 -0
  107. package/dist/_frontend/assets/SandboxSettings-S5XGZWOL-BUQpWdqg.js.gz +0 -0
  108. package/dist/_frontend/assets/SettingsBuilder-64Y33NP3-BQNwNwxh.js +0 -2
  109. package/dist/_frontend/assets/SettingsBuilder-64Y33NP3-BQNwNwxh.js.br +0 -0
  110. package/dist/_frontend/assets/SettingsBuilder-64Y33NP3-BQNwNwxh.js.gz +0 -0
  111. package/dist/_frontend/assets/SidebarLayout-M7HEOZVK-owseAySg.js.br +0 -0
  112. package/dist/_frontend/assets/SidebarLayout-M7HEOZVK-owseAySg.js.gz +0 -0
  113. package/dist/_frontend/assets/SkillSettings-MXK4ZEI7-CrK7D1D-.js.br +0 -0
  114. package/dist/_frontend/assets/SkillSettings-MXK4ZEI7-CrK7D1D-.js.gz +0 -0
  115. package/dist/_frontend/assets/WidgetLayout-7MDOKLHU-OdQcbsJk.js.br +0 -0
  116. package/dist/_frontend/assets/WidgetLayout-7MDOKLHU-OdQcbsJk.js.gz +0 -0
  117. package/dist/_frontend/assets/chunk-NBMP2XNL-DdVXEaJy.js.br +0 -2
  118. package/dist/_frontend/assets/chunk-NBMP2XNL-DdVXEaJy.js.gz +0 -0
  119. package/dist/_frontend/assets/chunk-WFC3W4C3-DXFwnpmH.js.br +0 -0
  120. package/dist/_frontend/assets/chunk-WFC3W4C3-DXFwnpmH.js.gz +0 -0
  121. package/dist/_frontend/assets/cssMode-BIIwADkQ.js.br +0 -0
  122. package/dist/_frontend/assets/cssMode-BIIwADkQ.js.gz +0 -0
  123. package/dist/_frontend/assets/freemarker2-DWtRl63b.js.br +0 -0
  124. package/dist/_frontend/assets/freemarker2-DWtRl63b.js.gz +0 -0
  125. package/dist/_frontend/assets/handlebars-CJJYL_TE.js.br +0 -0
  126. package/dist/_frontend/assets/handlebars-CJJYL_TE.js.gz +0 -0
  127. package/dist/_frontend/assets/html-CIyPQjdd.js.br +0 -0
  128. package/dist/_frontend/assets/html-CIyPQjdd.js.gz +0 -0
  129. package/dist/_frontend/assets/htmlMode-CDsupPvj.js.br +0 -0
  130. package/dist/_frontend/assets/htmlMode-CDsupPvj.js.gz +0 -0
  131. package/dist/_frontend/assets/index-B8NomNE2.js.br +0 -0
  132. package/dist/_frontend/assets/index-B8NomNE2.js.gz +0 -0
  133. package/dist/_frontend/assets/index-CKMEtdQA.js.br +0 -0
  134. package/dist/_frontend/assets/index-CKMEtdQA.js.gz +0 -0
  135. package/dist/_frontend/assets/jsonMode-DRy4DQT3.js.br +0 -0
  136. package/dist/_frontend/assets/jsonMode-DRy4DQT3.js.gz +0 -0
  137. package/dist/_frontend/assets/liquid-a-xIf2lN.js.br +0 -0
  138. package/dist/_frontend/assets/liquid-a-xIf2lN.js.gz +0 -0
  139. package/dist/_frontend/assets/lspLanguageFeatures-Tavpp1a0.js.br +0 -0
  140. package/dist/_frontend/assets/lspLanguageFeatures-Tavpp1a0.js.gz +0 -0
  141. package/dist/_frontend/assets/mdx-D3wOHh0p.js.br +0 -0
  142. package/dist/_frontend/assets/mdx-D3wOHh0p.js.gz +0 -0
  143. package/dist/_frontend/assets/python-8zlVof3q.js.br +0 -0
  144. package/dist/_frontend/assets/python-8zlVof3q.js.gz +0 -0
  145. package/dist/_frontend/assets/razor-q_HfjjpC.js.br +0 -0
  146. package/dist/_frontend/assets/razor-q_HfjjpC.js.gz +0 -0
  147. package/dist/_frontend/assets/tsMode-DOOZolwq.js.br +0 -0
  148. package/dist/_frontend/assets/tsMode-DOOZolwq.js.gz +0 -0
  149. package/dist/_frontend/assets/typescript-CmhvHmNu.js.br +0 -0
  150. package/dist/_frontend/assets/typescript-CmhvHmNu.js.gz +0 -0
  151. package/dist/_frontend/assets/workers-CfU2h0GU.js.br +0 -0
  152. package/dist/_frontend/assets/workers-CfU2h0GU.js.gz +0 -0
  153. package/dist/_frontend/assets/xml-D3jhgOra.js.br +0 -0
  154. package/dist/_frontend/assets/xml-D3jhgOra.js.gz +0 -0
  155. package/dist/_frontend/assets/yaml-B-q42846.js.br +0 -0
  156. package/dist/_frontend/assets/yaml-B-q42846.js.gz +0 -0
@@ -0,0 +1 @@
1
+ import{s as J,t as de,r,v as H,j as e,w as oe,B as z,I as w,y as X,E as Q,F as ce,e as P,x as G}from"./index-ChCGltYc.js";var me=[{value:"dcr",label:"OAuth"},{value:"none",label:"None"},{value:"header",label:"API Key"}],$=Q("h-11 shadow-sm"),L=()=>e.jsx("span",{className:"ml-0.5 text-failure-bg","aria-hidden":!0,children:"*"}),ue=({open:n,onOpenChange:u,onAdd:m,busy:j=!1,error:o})=>{const[f,y]=r.useState(""),[h,x]=r.useState(""),[p,S]=r.useState(""),[i,b]=r.useState("dcr"),[v,F]=r.useState(""),[k,M]=r.useState(""),A=()=>{y(""),x(""),S(""),b("dcr"),F(""),M("")},a=l=>{l||A(),u(l)},N=!!f.trim()&&!!p.trim()&&!!h.trim()&&(i!=="header"||!!v.trim()),E=async l=>{if(l.preventDefault(),!N||j)return;const I=i==="header"?{type:"header",apiKey:v.trim(),...k.trim()?{headerName:k.trim()}:{}}:{type:i};try{await m({name:f.trim(),url:h.trim(),description:p.trim(),auth:I}),A(),u(!1)}catch{}};return e.jsx(X,{open:n,onOpenChange:a,title:"Add MCP server",description:"Point at a remote MCP endpoint. It then behaves like any other connector.",contentSized:!0,headerIcon:e.jsx("span",{className:"flex size-11 shrink-0 items-center justify-center rounded-lg border border-border bg-secondary-bg text-text-primary","aria-hidden":!0,children:e.jsx(w,{name:"mcp-server",className:"size-6"})}),children:e.jsxs("form",{className:"flex flex-col overflow-y-auto p-5 md:p-6",onSubmit:l=>void E(l),children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"mcp-server-name",className:"mb-1.5 block text-sm font-medium text-text-primary",children:["Name",e.jsx(L,{})]}),e.jsx("input",{id:"mcp-server-name",type:"text",required:!0,value:f,onChange:l=>{y(l.target.value)},placeholder:"analytics-postgres-mcp",autoFocus:!0,className:$})]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"mcp-server-description",className:"mb-1.5 block text-sm font-medium text-text-primary",children:["Description",e.jsx(L,{})]}),e.jsx("textarea",{id:"mcp-server-description",value:p,onChange:l=>{S(l.target.value)},placeholder:"Query analytics from Postgres",required:!0,rows:3,className:Q("resize-y py-2.5 shadow-sm")})]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"mcp-server-url",className:"mb-1.5 block text-sm font-medium text-text-primary",children:["URL",e.jsx(L,{})]}),e.jsx("input",{id:"mcp-server-url",type:"url",required:!0,value:h,onChange:l=>{x(l.target.value)},placeholder:"https://mcp.example.com/mcp",className:$})]}),e.jsxs("fieldset",{children:[e.jsxs("legend",{className:"mb-1.5 text-sm font-medium text-text-primary",children:["Auth type",e.jsx(L,{})]}),e.jsx("div",{className:"flex w-full flex-row rounded-md border border-border bg-secondary-bg/40 p-1",children:me.map(l=>e.jsxs("label",{className:`flex h-8 flex-1 cursor-pointer items-center justify-center rounded-sm text-sm font-medium transition-colors ${i===l.value?"bg-dropdown-selected-item-bg text-dropdown-selected-item-text shadow-sm":"text-text-secondary hover:text-text-primary"}`,children:[e.jsx("input",{type:"radio",name:"mcp-auth-type",value:l.value,checked:i===l.value,onChange:()=>{b(l.value)},className:"sr-only"}),l.label]},l.value))})]}),i==="dcr"?e.jsxs("div",{className:"flex gap-1.5 bg-secondary-bg/40 p-2 rounded-md",children:[e.jsx(w,{name:"info",className:"size-3.5 mt-1 text-text-secondary"}),e.jsx("div",{className:"text-xs text-text-secondary leading-5.5",children:"Sign-in only — the server must support dynamic client registration. Manual OAuth (client ID / secret) isn't supported yet."})]}):null,i==="header"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"mcp-server-api-key",className:"mb-1.5 block text-sm font-medium text-text-primary",children:["API key",e.jsx(L,{})]}),e.jsx("input",{id:"mcp-server-api-key",type:"password",required:!0,value:v,onChange:l=>{F(l.target.value)},placeholder:"Paste the server token",className:$})]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"mcp-server-header-name",className:"mb-1.5 block text-sm font-medium text-text-primary",children:["Header name ",e.jsx("span",{className:"font-normal text-text-secondary",children:"(optional)"})]}),e.jsx("input",{id:"mcp-server-header-name",type:"text",value:k,onChange:l=>{M(l.target.value)},placeholder:"Authorization",className:$})]})]}):null]}),e.jsxs("div",{className:"mt-6 space-y-3",children:[o?e.jsx("p",{className:"text-failure-bg text-sm",children:o}):null,e.jsx(z,{type:"submit",size:"lg",disabled:!N||j,className:"w-full shrink-0",children:"Add"})]})]})})},xe=ue,_={dcr:"OAuth2",header:"API Key",none:"No Auth"};function he({text:n}){const u=r.useRef(null),[m,j]=r.useState(!1),[o,f]=r.useState(!1),[y,h]=r.useState(16);return r.useLayoutEffect(()=>{j(!1),h(16)},[n]),r.useLayoutEffect(()=>{const x=u.current;if(!x)return;if(!m){h(16),f(x.scrollWidth>x.clientWidth+1);return}h(16);const p=requestAnimationFrame(()=>{h(x.scrollHeight)});return()=>cancelAnimationFrame(p)},[n,m]),n?e.jsxs("div",{className:"relative min-w-0",children:[e.jsxs("p",{ref:u,style:{maxHeight:y},className:P("mt-0.5 overflow-hidden font-mono text-xs leading-4 text-text-secondary transition-[max-height] duration-300 ease-in-out",!m&&"whitespace-nowrap",!m&&o&&"pr-[5.75rem]"),children:[n,m&&o?e.jsxs(e.Fragment,{children:[" ",e.jsx("button",{type:"button",className:"cursor-pointer font-mono text-xs font-medium text-text-primary/80 hover:text-text-primary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-focus-ring","aria-expanded":!0,onClick:()=>j(!1),children:"Show less"})]}):null]}),!m&&o?e.jsxs("button",{type:"button",className:"absolute top-0.5 right-0 cursor-pointer bg-card-bg pl-1.5 font-mono text-xs font-medium leading-4 text-text-primary/80 hover:text-text-primary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-focus-ring","aria-expanded":!1,onClick:()=>j(!0),children:[e.jsx("span",{"aria-hidden":!0,className:"text-text-secondary",children:"…"}),e.jsx("span",{className:"ml-1",children:"Read more"})]}):null]}):null}var pe=({connector:n,onBack:u,onConnectorRefreshed:m,onDisconnect:j,busy:o=!1})=>{const{connectorCatalog:f}=J(),{handleAuthorize:y,isOAuthLoading:h}=ce(),[x,p]=r.useState([]),[S,i]=r.useState(!0),[b,v]=r.useState(null),[F,k]=r.useState(!1);r.useEffect(()=>{let a=!1;return p([]),v(null),i(!0),f.getToolsByConnectorId({id:n.id}).then(N=>{a||p(N)}).catch(N=>{a||v(H(N,"Failed to load connector tools"))}).finally(()=>{a||i(!1)}),()=>{a=!0}},[n.authenticated,n.id,f]);const M=async()=>{k(!0),v(null);try{const a=await f.getConnector({id:n.id});m(a)}catch(a){v(H(a,"Failed to refresh connector details"))}finally{k(!1)}},A=h||F;return e.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[e.jsxs("button",{type:"button",onClick:u,className:"mb-3 inline-flex w-fit items-center gap-1 rounded-md py-1 pr-2 text-sm text-text-secondary hover:text-text-primary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-focus-ring",children:[e.jsx(w,{name:"chevron-left",className:"size-3.5"}),"Connectors"]}),e.jsxs("div",{className:"flex flex-1 flex-col overflow-y-auto pb-1",children:[e.jsxs("header",{className:"flex items-start gap-3",children:[e.jsx("span",{className:"flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-secondary-bg","aria-hidden":!0,children:e.jsx(w,{name:"mcp-server",className:"size-5 text-text-primary"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h4",{className:"text-lg font-semibold text-text-primary",children:n.name}),e.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-sm",children:[e.jsxs("span",{className:P("flex items-center gap-1.5 text-xs font-medium",n.authenticated?"text-success-bg":"text-text-primary"),children:[e.jsx("span",{className:P("h-1.5 w-1.5 rounded-full",n.authenticated?"bg-success-bg":"bg-primary-button-bg")}),n.authenticated?"Connected":"Not authenticated"]}),e.jsxs("span",{className:"text-text-secondary",children:["· ",n.description]})]}),e.jsx("span",{className:"mt-2 inline-flex items-center rounded-full border border-border bg-secondary-bg/40 px-2 py-0.5 text-xs font-medium text-text-secondary",children:_[n.auth.type]??_.none})]}),n.auth.type==="dcr"&&!n.authenticated?e.jsx(z,{variant:"outline",size:"sm",type:"button",disabled:o||A,onClick:()=>{y(n.id,a=>{a&&M()})},children:A?"Connecting…":"Connect"}):n.auth.type==="dcr"&&!n.requiresAuth?e.jsx(z,{variant:"outline",size:"sm",type:"button",disabled:o,onClick:j,children:"Disconnect"}):null]}),e.jsx("section",{className:"mt-6","aria-labelledby":"connector-tools-heading",children:S?e.jsx("div",{className:"rounded-xl border border-dashed border-border p-6 text-center text-sm text-text-secondary",children:"Loading tools…"}):b?e.jsxs("div",{className:"rounded-xl border border-failure-bg/30 bg-failure-bg/10 p-6 text-center text-sm text-failure-bg",children:[b,n.auth.type==="dcr"&&!n.authenticated&&e.jsx("div",{className:"font-bold mt-1",children:"Click Connect and authenticate successfully to view tools."})]}):x.length>0?e.jsxs(e.Fragment,{children:[e.jsxs("h5",{id:"connector-tools-heading",className:"mb-2 text-[0.8125rem] font-semibold text-text-primary",children:["Tools ",e.jsxs("span",{className:"font-normal text-text-secondary",children:["· ",x.length]})]}),e.jsx("div",{className:"overflow-hidden rounded-xl border border-border bg-card-bg",children:x.map(a=>e.jsx("article",{className:"flex min-h-12 items-start gap-3 border-b border-border px-3 py-2 last:border-b-0",children:e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h6",{className:"text-sm font-medium text-text-primary",children:a.name}),e.jsx(he,{text:a.description})]})},a.id))})]}):e.jsx("div",{className:"rounded-xl border border-dashed border-border p-6 text-center text-sm text-text-secondary",children:"No tools reported for this connector."})})]})]})},fe=pe,be=()=>{const{connectorCatalog:n}=J(),u=de(),[m,j]=r.useState(""),[o,f]=r.useState({ordered:[],authStatusById:new Map}),[y,h]=r.useState(!0),[x,p]=r.useState(null),[S,i]=r.useState(null),[b,v]=r.useState(!1),[F,k]=r.useState([]),[M,A]=r.useState(!1),[a,N]=r.useState(null),[E,l]=r.useState(null),[I,R]=r.useState(""),W=r.useMemo(()=>(F??[]).reduce((t,s)=>(t[s.name]=s.logo??"",t),{}),[F]),K=r.useCallback(async()=>{h(!0),p(null);try{const[t,s]=await Promise.all([n.listConnectors(),n.getConnectorCatalog()]);k(s);const d=t??[],g=new Set(d.map(c=>c.id)),C=[...d.map(c=>({connector:c,isConfigured:!0})),...s.filter(c=>!g.has(c.id)).map(c=>({connector:c,isConfigured:!1}))];f({ordered:C,authStatusById:new Map(C.map(c=>[c.connector.id,c.isConfigured?c.connector.authenticated:!1]))}),l(c=>c?t.find(ie=>ie.id===c.id)??null:null)}catch(t){p(H(t,"Failed to load connectors"))}finally{h(!1)}},[n]);r.useEffect(()=>{K()},[K]);const B=m.trim().toLowerCase(),T=r.useMemo(()=>B?o.ordered.filter(({connector:t})=>{var s;return t.name.toLowerCase().includes(B)||(((s=t.description)==null?void 0:s.toLowerCase().includes(B))??!1)||t.url.toLowerCase().includes(B)}):o.ordered,[o.ordered,B]),D=r.useMemo(()=>{const t=[];for(const s of T)if(s.isConfigured){const d=o.authStatusById.get(s.connector.id)??s.connector.authenticated;t.push(d===s.connector.authenticated?s.connector:{...s.connector,authenticated:d})}return t},[o.authStatusById,T]),O=r.useMemo(()=>{const t=[];for(const s of T)s.isConfigured||t.push(s.connector);return t},[T]),q=async(t,s=p)=>{v(!0),p(null);try{await t(),await K()}catch(d){throw s(H(d,"Request failed")),d}finally{v(!1)}},U=()=>{N(null),R(""),i(null)},V=async(t,s)=>{const d=s??(t.auth.type==="header"?{type:"header",...t.auth.headerName?{headerName:t.auth.headerName}:{}}:t.auth.type==="dcr"?{type:"dcr"}:{type:"none"});await n.createConnector({name:t.name,description:t.description??t.url,url:t.url,auth:d})},Z=t=>{if(t.auth.type==="header"){R(""),i(null),N(t);return}q(async()=>{await V(t)}).catch(()=>{})},ee=t=>{if(t.preventDefault(),!a||!I.trim())return;const s=a;i(null),q(async()=>{const d={type:"header",apiKey:I.trim(),...s.auth.type==="header"&&s.auth.headerName?{headerName:s.auth.headerName}:{}},g=o.ordered.find(({connector:c})=>c.id===s.id),C=g!=null&&g.isConfigured?g.connector:void 0;C?await n.updateConnector({id:C.id,name:C.name,description:C.description,url:C.url,auth:d}):await V(s,d),U(),setTimeout(()=>{u==null||u.showSuccess({title:`${s.name} ${C?"updated":"connected"}`})},100)},i).catch(()=>{})},te=async t=>{i(null),await q(async()=>{await n.createConnector({...t})},i),setTimeout(()=>{u==null||u.showSuccess({title:`${t.name} added`})},0)},se=t=>{q(async()=>{await n.disconnectConnector({id:t.id}),l(null)}).catch(()=>{})},ae=t=>{l(s=>(s==null?void 0:s.id)===t.id?t:s),f(s=>{const d=new Map(s.authStatusById);return d.set(t.id,t.authenticated),{ordered:s.ordered.map(g=>g.isConfigured&&g.connector.id===t.id?{connector:t,isConfigured:!0}:g),authStatusById:d}})},re=(t,s)=>{const d=W[t.name],g=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-secondary-bg","aria-hidden":!0,children:d?e.jsx(G,{src:d,alt:t.name,className:"size-4.5"}):e.jsx(w,{name:"mcp-server",className:"size-4.5 text-text-primary"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h5",{className:"truncate text-sm font-medium text-text-primary",children:t.name}),e.jsx("p",{className:"mt-0.5 line-clamp-2 text-sm text-text-secondary sm:truncate",children:t.description})]})]});return e.jsxs("article",{className:"flex min-h-16 w-full items-center gap-3 border-b border-border p-3 text-left last:border-b-0 cursor-pointer transition-colors hover:bg-ghost-button-hover/60",onClick:()=>{l(t)},children:[e.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:g}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("span",{className:P("flex items-center gap-1.5 rounded-full border border-border bg-secondary-bg/40 px-2 py-0.5 text-xs font-medium",t.authenticated?"text-success-bg":"text-text-primary"),children:[e.jsx("span",{className:P("h-1.5 w-1.5 rounded-full",t.authenticated?"bg-success-bg":"bg-primary-button-bg")}),t.authenticated?"Connected":"Added"]})}),t.auth.type==="header"?e.jsxs(z,{variant:"secondary",size:"sm",type:"button",disabled:b,onClick:c=>{c.stopPropagation(),R(""),N(t)},children:[e.jsx(w,{name:"wrench",className:"size-3"}),"Replace Key"]}):null,e.jsx(w,{name:"chevron-right",className:"size-4"})]})]},t.id)},ne=t=>{const s=W[t.name];return e.jsxs("article",{className:"flex min-h-16 w-full items-center gap-3 border-b border-border p-3 text-left last:border-b-0",children:[e.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-secondary-bg","aria-hidden":!0,children:s?e.jsx(G,{src:s,alt:t.name,className:"size-4.5"}):e.jsx(w,{name:"mcp-server",className:"size-4.5 text-text-primary"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h5",{className:"truncate text-sm font-medium text-text-primary",children:t.name}),e.jsx("p",{className:"mt-0.5 line-clamp-2 text-sm text-text-secondary sm:truncate",children:t.description??t.url})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[e.jsx("span",{className:"hidden text-xs text-text-secondary sm:inline",children:_[t.auth.type]??_.none}),e.jsx(z,{variant:"secondary",size:"sm",type:"button",disabled:b,onClick:()=>{Z(t)},children:t.auth.type==="dcr"?"Add":"Connect"})]})]},t.id)},Y=r.useMemo(()=>a!==null&&o.ordered.some(t=>t.isConfigured&&t.connector.id===a.id),[a,o.ordered]);if(E)return e.jsx(fe,{connector:E,busy:b,onBack:()=>{l(null)},onConnectorRefreshed:ae,onDisconnect:()=>{se(E)}});const le=D.length>0||O.length>0;return e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"text-xl font-semibold tracking-tight text-text-primary",children:"Connectors"}),e.jsx("p",{className:"mt-1 text-sm text-text-secondary",children:"Connect tools your agents can use."}),x?e.jsx("p",{className:"mt-3 rounded-md border border-failure-bg/30 bg-failure-bg/10 px-3 py-2 text-sm text-failure-bg",children:x}):null,e.jsx("div",{className:"mt-4 flex-1 overflow-y-hidden",children:e.jsxs("div",{className:"flex h-full flex-col gap-3",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx("div",{className:"flex-1",children:e.jsx(oe,{query:m,setQuery:j,placeholder:"Search connectors"})}),e.jsxs(z,{variant:"secondary",type:"button",onClick:()=>{i(null),A(!0)},children:[e.jsx(w,{name:"plus",size:"1rem",className:"mr-1"}),"Add MCP Server"]})]}),e.jsxs("div",{className:"flex flex-1 flex-col gap-5 overflow-y-auto pb-1",children:[y?e.jsx("p",{className:"py-8 text-center text-sm text-text-secondary",children:"Loading…"}):null,!y&&D.length>0?e.jsxs("section",{"aria-labelledby":"connected-connectors-heading",children:[e.jsxs("h4",{id:"connected-connectors-heading",className:"mb-2 text-[0.8125rem] font-semibold uppercase text-text-secondary",children:["Configured · ",D.length]}),e.jsx("div",{className:"overflow-hidden rounded-xl border border-border bg-card-bg",children:D.map(t=>re(t))})]}):null,!y&&O.length>0?e.jsxs("section",{"aria-labelledby":"available-connectors-heading",children:[e.jsxs("h4",{id:"available-connectors-heading",className:"mb-2 text-[0.8125rem] font-semibold uppercase text-text-secondary",children:["Available · ",O.length]}),e.jsx("div",{className:"overflow-hidden rounded-xl border border-border bg-card-bg",children:O.map(t=>ne(t))})]}):null,!y&&!le?e.jsx("div",{className:"flex flex-1 items-center justify-center rounded-xl border border-dashed border-border p-8 text-center text-sm text-text-secondary",children:m.trim()?`No connectors match “${m.trim()}”.`:"No connectors yet."}):null]}),e.jsx(X,{open:a!==null,onOpenChange:t=>{t||U()},title:`${Y?"Replace key for":"Connect"} ${(a==null?void 0:a.name)??"connector"}`,description:a==null?void 0:a.url,contentSized:!0,className:"md:max-w-xl",children:e.jsxs("form",{onSubmit:ee,children:[e.jsxs("div",{className:"space-y-5 px-5 py-5",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"flex size-12 shrink-0 items-center justify-center overflow-hidden rounded-xl border border-border bg-secondary-bg","aria-hidden":!0,children:e.jsx(w,{name:"mcp-server",className:"size-6 text-text-primary"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"font-medium text-text-primary",children:a==null?void 0:a.name}),e.jsx("p",{className:"truncate text-sm text-text-secondary",children:a==null?void 0:a.description})]})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"connector-api-key",className:"mb-2 block text-xs font-semibold uppercase tracking-wide text-text-secondary",children:"API key / token"}),e.jsx("input",{id:"connector-api-key",type:"password",value:I,onChange:t=>{R(t.target.value)},placeholder:`Paste the token from ${(a==null?void 0:a.name)??"the provider"}`,autoFocus:!0,required:!0,className:Q("h-11")})]}),S?e.jsx("p",{className:"text-failure-bg text-sm",children:S}):null]}),e.jsxs("footer",{className:"flex justify-end gap-2 border-t border-border px-5 py-4",children:[e.jsx(z,{variant:"ghost",type:"button",onClick:U,disabled:b,children:"Cancel"}),e.jsx(z,{type:"submit",disabled:!I.trim()||b,children:Y?"Replace Key":"Connect"})]})]})}),e.jsx(xe,{open:M,onOpenChange:t=>{A(t),t||i(null)},onAdd:te,busy:b,error:S})]})})]})},ye=be;export{ye as default};
@@ -1 +1 @@
1
- import{S as a}from"./chunk-NBMP2XNL-DdVXEaJy.js";import{j as o,C as t,e as l}from"./index-B8NomNE2.js";import"./chunk-WFC3W4C3-DXFwnpmH.js";function n({className:r}){return o.jsx(t,{children:o.jsx("div",{"data-aui-compact-layout":!0,className:l("ml-auto flex h-full w-full max-w-[min(400px,100%)] min-h-0 min-w-0 flex-col border-l border-border bg-primary-bg shadow-[-4px_0_24px_color-mix(in_oklab,var(--shadow-color)_6%,transparent)]",r),children:o.jsx(a,{})})})}export{n as DockLayout};
1
+ import{S as a}from"./chunk-7EEOWDLE-BIwInB6G.js";import{j as o,C as t,e as l}from"./index-ChCGltYc.js";import"./chunk-LRQHHZDX-eb14Z2nA.js";function n({className:r}){return o.jsx(t,{children:o.jsx("div",{"data-aui-compact-layout":!0,className:l("ml-auto flex h-full w-full max-w-[min(400px,100%)] min-h-0 min-w-0 flex-col border-l border-border bg-primary-bg shadow-[-4px_0_24px_color-mix(in_oklab,var(--shadow-color)_6%,transparent)]",r),children:o.jsx(a,{})})})}export{n as DockLayout};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SettingsBuilder-64Y33NP3-BQNwNwxh.js","assets/index-B8NomNE2.js","assets/index-DEKCw40W.css"])))=>i.map(i=>d[i]);
2
- import{u as N,a as v,c,r as a,j as e,I as m,f as S,S as C,g as E,T as k,e as O,_ as R}from"./index-B8NomNE2.js";import{N as T,S as A}from"./chunk-WFC3W4C3-DXFwnpmH.js";var _=a.lazy(()=>R(()=>import("./SettingsBuilder-64Y33NP3-BQNwNwxh.js"),__vite__mapDeps([0,1,2])));function z({className:p}){const b=N(),s=v(),h=c("ClearChatButton"),j=c("SaveAgentButton"),g=c("SelectAgentEmptyState"),[n,r]=a.useState(!1),u=a.useRef(null),d=a.useRef(null),f=a.useRef(null),l=a.useRef(!1),y=(s==null?void 0:s.mode.status)==="idle",o=(s==null?void 0:s.settingsOpen)===!0;a.useEffect(()=>{if(!n)return;const t=i=>{i.key==="Escape"&&r(!1)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[n]),a.useEffect(()=>{var i,x;const t=f.current;if(n){l.current=!0,t&&(t.inert=!0),(i=d.current)==null||i.focus();return}l.current&&(t&&(t.inert=!1),(x=u.current)==null||x.focus(),l.current=!1)},[n]);const w=()=>{s!=null&&s.isComposerEnabled?s.openDraft():(s==null||s.setSettingsOpen(!1),b.threads().switchToNewThread()),r(!1)};return e.jsxs("div",{className:O("relative flex h-full min-h-0 w-full flex-col bg-primary-bg",p),children:[e.jsxs("header",{className:"flex shrink-0 items-center gap-1 border-b border-border bg-topbar-bg px-2 py-1.5",children:[o?e.jsx("span",{className:"min-w-0 flex-1"}):e.jsxs(e.Fragment,{children:[e.jsx(T,{}),e.jsx("span",{className:"min-w-0 flex-1"}),e.jsx(h,{}),e.jsx(j,{})]}),e.jsx(A,{},"shell-actions"),o?null:e.jsxs(e.Fragment,{children:[(s==null?void 0:s.isNewChatEnabled)!==!1?e.jsx("button",{type:"button","aria-label":"New chat",title:"New chat",className:S({variant:"ghost",size:"icon"}),onClick:w,children:e.jsx(m,{name:"plus"})}):null,e.jsx("button",{ref:u,type:"button","aria-label":"Sessions","aria-expanded":n,className:"text-text-secondary hover:text-text-primary inline-flex size-8 cursor-pointer items-center justify-center rounded-md",onClick:()=>r(t=>!t),children:e.jsx(m,{name:"clock-rotate-left"})})]})]}),e.jsx("div",{ref:f,className:"min-h-0 min-w-0 flex-1",children:o?e.jsx(a.Suspense,{fallback:e.jsxs("div",{className:"flex h-full items-center justify-center",role:"status","aria-live":"polite","aria-busy":"true",children:[e.jsx(C,{size:28,className:"text-text-primary"}),e.jsx("span",{className:"sr-only",children:"Loading"})]}),children:e.jsx(_,{})}):y?e.jsx(g,{}):e.jsx(E,{})}),n?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button","aria-label":"Close sessions",className:"absolute inset-0 z-[9] cursor-pointer bg-[var(--overlay)]",onClick:()=>r(!1)}),e.jsx("div",{ref:d,className:"absolute inset-y-0 right-0 z-10 flex w-full max-w-80 flex-col border-l border-border bg-sidebar-bg shadow-lg outline-none",role:"dialog","aria-label":"Sessions",tabIndex:-1,children:e.jsx(k,{onThreadOpen:()=>r(!1)})})]}):null]})}export{z as DrawerLayout};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SettingsBuilder-26XSGIHK-DmgjXL0m.js","assets/index-ChCGltYc.js","assets/index-DEKCw40W.css"])))=>i.map(i=>d[i]);
2
+ import{u as N,a as v,c,r as a,j as e,I as m,f as S,S as C,g as E,T as k,e as O,_ as R}from"./index-ChCGltYc.js";import{N as T,S as A}from"./chunk-LRQHHZDX-eb14Z2nA.js";var _=a.lazy(()=>R(()=>import("./SettingsBuilder-26XSGIHK-DmgjXL0m.js"),__vite__mapDeps([0,1,2])));function z({className:p}){const b=N(),s=v(),h=c("ClearChatButton"),j=c("SaveAgentButton"),g=c("SelectAgentEmptyState"),[n,r]=a.useState(!1),u=a.useRef(null),d=a.useRef(null),f=a.useRef(null),l=a.useRef(!1),y=(s==null?void 0:s.mode.status)==="idle",o=(s==null?void 0:s.settingsOpen)===!0;a.useEffect(()=>{if(!n)return;const t=i=>{i.key==="Escape"&&r(!1)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[n]),a.useEffect(()=>{var i,x;const t=f.current;if(n){l.current=!0,t&&(t.inert=!0),(i=d.current)==null||i.focus();return}l.current&&(t&&(t.inert=!1),(x=u.current)==null||x.focus(),l.current=!1)},[n]);const w=()=>{s!=null&&s.isComposerEnabled?s.openDraft():(s==null||s.setSettingsOpen(!1),b.threads().switchToNewThread()),r(!1)};return e.jsxs("div",{className:O("relative flex h-full min-h-0 w-full flex-col bg-primary-bg",p),children:[e.jsxs("header",{className:"flex shrink-0 items-center gap-1 border-b border-border bg-topbar-bg px-2 py-1.5",children:[o?e.jsx("span",{className:"min-w-0 flex-1"}):e.jsxs(e.Fragment,{children:[e.jsx(T,{}),e.jsx("span",{className:"min-w-0 flex-1"}),e.jsx(h,{}),e.jsx(j,{})]}),e.jsx(A,{},"shell-actions"),o?null:e.jsxs(e.Fragment,{children:[(s==null?void 0:s.isNewChatEnabled)!==!1?e.jsx("button",{type:"button","aria-label":"New chat",title:"New chat",className:S({variant:"ghost",size:"icon"}),onClick:w,children:e.jsx(m,{name:"plus"})}):null,e.jsx("button",{ref:u,type:"button","aria-label":"Sessions","aria-expanded":n,className:"text-text-secondary hover:text-text-primary inline-flex size-8 cursor-pointer items-center justify-center rounded-md",onClick:()=>r(t=>!t),children:e.jsx(m,{name:"clock-rotate-left"})})]})]}),e.jsx("div",{ref:f,className:"min-h-0 min-w-0 flex-1",children:o?e.jsx(a.Suspense,{fallback:e.jsxs("div",{className:"flex h-full items-center justify-center",role:"status","aria-live":"polite","aria-busy":"true",children:[e.jsx(C,{size:28,className:"text-text-primary"}),e.jsx("span",{className:"sr-only",children:"Loading"})]}),children:e.jsx(_,{})}):y?e.jsx(g,{}):e.jsx(E,{})}),n?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button","aria-label":"Close sessions",className:"absolute inset-0 z-[9] cursor-pointer bg-[var(--overlay)]",onClick:()=>r(!1)}),e.jsx("div",{ref:d,className:"absolute inset-y-0 right-0 z-10 flex w-full max-w-80 flex-col border-l border-border bg-sidebar-bg shadow-lg outline-none",role:"dialog","aria-label":"Sessions",tabIndex:-1,children:e.jsx(k,{onThreadOpen:()=>r(!1)})})]}):null]})}export{z as DrawerLayout};
@@ -0,0 +1 @@
1
+ import{s as be,t as fe,r as o,v as Y,j as e,w as ge,B,I as P,x as ie,y as xe,A as ye,z as ve,e as L,D as je,E as Ne}from"./index-ChCGltYc.js";var me=Ne("h-11 shadow-sm"),we=({open:n,onOpenChange:l,onSave:b,title:k,description:p,initialBaseUrl:E="",baseUrlPlaceholder:d="https://api.openai.com/v1",requireApiKey:c=!0,submitLabel:S="Save",busy:O=!1,error:F})=>{const[M,$]=o.useState(""),[y,x]=o.useState(""),[w,A]=o.useState(!1),U=()=>{$(""),x(""),A(!1)};o.useEffect(()=>{n&&($(""),x(E),A(!1))},[n,E]);const X=i=>{i||U(),l(i)},T=M.trim(),G=!c||!!T,v=async i=>{if(i.preventDefault(),!(!G||O))try{await b({apiKey:T,baseUrl:y.trim()}),U(),l(!1)}catch{}};return e.jsx(xe,{open:n,onOpenChange:X,title:k,description:p,contentSized:!0,children:e.jsxs("form",{className:"flex flex-col overflow-y-auto p-5 md:p-6",onSubmit:v,children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"model-provider-api-key",className:"mb-1.5 block text-sm font-medium text-text-primary",children:["API key",c?null:e.jsx("span",{className:"font-normal text-text-secondary",children:" (optional)"})]}),e.jsx("input",{id:"model-provider-api-key",type:"password",required:c,value:M,onChange:i=>{$(i.target.value)},placeholder:c?"Enter API key":"Enter a new key",autoFocus:!0,className:me}),c?null:e.jsx("p",{className:"mt-1.5 text-xs text-text-secondary",children:"Leave blank to keep the current key; enter a new one to replace it."})]}),e.jsxs(ye,{expanded:w,onChange:(i,K)=>A(K),className:"rounded-md border border-border",children:[e.jsx(ve,{className:"px-3 py-2.5",children:e.jsxs("span",{className:"flex w-full items-center justify-between text-sm font-medium text-text-primary",children:["Advanced · custom endpoint",e.jsx(P,{name:"chevron-down",className:L("size-4 shrink-0 text-text-secondary transition-transform duration-200",w?"rotate-0":"-rotate-90")})]})}),e.jsxs(je,{className:"space-y-1.5 border-t border-border px-3 pb-3 pt-4",children:[e.jsx("label",{htmlFor:"model-provider-base-url",className:"block text-sm font-medium text-text-primary",children:"Base URL"}),e.jsx("input",{id:"model-provider-base-url",type:"url",value:y,onChange:i=>{x(i.target.value)},placeholder:d,className:me}),e.jsx("p",{className:"text-xs text-text-secondary",children:"Leave blank unless you use a regional or proxy endpoint."})]})]})]}),e.jsxs("div",{className:"mt-6 space-y-3",children:[F?e.jsx("p",{className:"text-failure-bg text-sm",children:F}):null,e.jsx(B,{type:"submit",size:"lg",disabled:!G||O,className:"w-full shrink-0",children:S})]})]})})},Ce=we,ke="128000",Ee="4096",pe=()=>({id:"",name:"",advancedExpanded:!0,contextLength:"",maxOutputTokens:""}),ue=n=>(n==null?void 0:n.models.map(l=>{var b,k,p,E,d;return{id:l.id,name:l.name,advancedExpanded:!0,reasoningEfforts:(b=l.properties)==null?void 0:b.reasoningEfforts,contextLength:((p=(k=l.properties)==null?void 0:k.contextLength)==null?void 0:p.toString())??"",maxOutputTokens:((d=(E=l.properties)==null?void 0:E.maxOutputTokens)==null?void 0:d.toString())??"",nameDirty:!0}}))??[pe()],Q="h-11 w-full rounded-md border border-border/70 bg-secondary-bg px-3 text-sm text-text-primary outline-none transition-colors placeholder:text-text-secondary/70 focus-visible:border-focus-ring focus-visible:ring-2 focus-visible:ring-focus-ring/50",V="border-failure-bg focus-visible:border-failure-bg focus-visible:ring-failure-bg";function ce(n){const l=n.trim();if(l==="")return null;const b=Number(l);return Number.isInteger(b)&&b>0?b:null}function Se(n){return n.replace(/([a-zA-Z])(\d)/g,"$1-$2").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^[^a-z]+/,"").slice(0,64).replace(/-+$/g,"")}var re=()=>e.jsx("span",{className:"ml-0.5 text-failure-bg","aria-hidden":!0,children:"*"}),ee=({children:n})=>e.jsx("p",{className:"mt-1 text-xs text-failure-bg",children:n}),ne=({children:n})=>e.jsx("p",{className:"mt-1 text-xs text-text-secondary",children:n}),Me=({open:n,onOpenChange:l,onSubmit:b,reasoningEffortOptions:k,busy:p=!1,error:E,isEditMode:d=!1,initialValues:c})=>{const[S,O]=o.useState((c==null?void 0:c.name)??""),[F,M]=o.useState((c==null?void 0:c.baseUrl)??""),[$,y]=o.useState(""),[x,w]=o.useState(()=>ue(c)),[A,U]=o.useState(!1),[X,T]=o.useState(!1),G=()=>{O((c==null?void 0:c.name)??""),M((c==null?void 0:c.baseUrl)??""),y(""),w(ue(c)),U(!1),T(!1)},v=s=>{s||G(),l(s)},i=(s,r)=>{w(g=>g.map((u,j)=>j===s?{...u,...r}:u))},K=()=>{U(!0),T(!0),w(s=>s.map(r=>({...r,idTouched:!0,contextTouched:!0,maxTouched:!0})))},f=S.trim(),D=f?null:"Name is required.",_=F.trim();let h=null;if(!_)h="Base URL is required.";else try{new URL(_)}catch{h="Enter a valid URL."}const W=s=>s.id.trim()?null:"Model ID is required.",te=s=>s.name.trim()?null:"Model name is required.",q=s=>ce(s.contextLength)==null?"Set the model's context window.":null,Z=s=>ce(s.maxOutputTokens)==null?"Set the max output tokens.":null,oe=!D&&!h&&x.every(s=>!W(s)&&!te(s)),se=A&&D,H=X&&h,I=async()=>{if(K(),!oe||p)return;const s=x.findIndex(r=>q(r)||Z(r));if(s!==-1){i(s,{advancedExpanded:!0});const r=x[s],g=r&&q(r)?"context-length":"max-output-tokens";setTimeout(()=>{var j;const u=document.getElementById(`custom-provider-model-${s}-${g}`);(j=u==null?void 0:u.scrollIntoView)==null||j.call(u,{block:"center",behavior:"smooth"}),u==null||u.focus()},0);return}try{await b({name:f,baseUrl:_,apiKey:$.trim(),models:x.map(r=>{var R;const g={};(R=r.reasoningEfforts)!=null&&R.length&&(g.reasoningEfforts=r.reasoningEfforts);const u=ce(r.contextLength);u!=null&&(g.contextLength=u);const j=ce(r.maxOutputTokens);return j!=null&&(g.maxOutputTokens=j),{id:r.id.trim(),name:r.name.trim(),...Object.keys(g).length>0?{properties:g}:{}}})}),v(!1)}catch{}};return e.jsx(xe,{open:n,onOpenChange:v,title:d?`Edit ${(c==null?void 0:c.name)??S}`:"Add custom provider",description:d?"Update the endpoint, credentials, and models for this provider.":"Connect any OpenAI-compatible endpoint, whether it's a local model, a proxy, or your own hosted service.",contentSized:!0,children:e.jsxs("form",{className:"flex min-h-0 flex-1 flex-col",onSubmit:s=>{s.preventDefault(),I()},children:[e.jsxs("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto px-5 pt-4 pb-8",children:[e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"custom-provider-name",className:"mb-1.5 block text-sm font-medium text-text-primary",children:["Name",e.jsx(re,{})]}),e.jsx("input",{id:"custom-provider-name",type:"text",value:S,onChange:s=>O(s.target.value),onBlur:()=>U(!0),placeholder:"local-llama",autoFocus:!d,readOnly:d,"aria-readonly":d,"aria-invalid":se?!0:void 0,className:L(Q,d&&"cursor-not-allowed bg-secondary-bg/60 text-text-secondary",se&&V)}),d?e.jsx(ne,{children:"Provider names cannot be changed after creation."}):null,se?e.jsx(ee,{children:D}):null]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"custom-provider-base-url",className:"mb-1.5 block text-sm font-medium text-text-primary",children:["Base URL",e.jsx(re,{})]}),e.jsx("input",{id:"custom-provider-base-url",type:"text",value:F,onChange:s=>M(s.target.value),onBlur:()=>T(!0),placeholder:"http://localhost:11434/v1",autoFocus:d,"aria-invalid":H?!0:void 0,className:L(Q,H&&V)}),H?e.jsx(ee,{children:h}):_?null:e.jsx(ne,{children:"OpenAI-compatible endpoint, usually ending in /v1."})]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"custom-provider-api-key",className:"mb-1.5 block text-sm font-medium text-text-primary",children:["API key",e.jsx("span",{className:"font-normal text-text-secondary",children:" (optional)"})]}),e.jsx("input",{id:"custom-provider-api-key",type:"password",value:$,onChange:s=>y(s.target.value),placeholder:"sk-…",className:Q}),e.jsx(ne,{children:d?"Leave blank to keep the saved key, or enter a new key to replace it.":"Leave blank if your endpoint needs no key (e.g. a local model)."})]}),e.jsxs("fieldset",{className:"m-0 min-w-0 border-0 p-0",children:[e.jsxs("legend",{className:"float-left mb-2 w-full p-0 text-sm font-medium text-text-primary",children:["Models",e.jsx(re,{})]}),e.jsx("div",{className:"clear-both",children:x.map((s,r)=>{const g=W(s),u=s.idTouched&&g,j=te(s),R=!!j&&s.nameDirty,le=q(s),C=Z(s),z=s.contextTouched&&le,ae=s.maxTouched&&C;return e.jsxs("div",{className:L("pb-6",r>0?"border-t border-border pt-6":"pt-1"),style:r>0?{borderTopWidth:"0.5px"}:void 0,children:[e.jsxs("div",{className:"grid grid-cols-[1fr_1fr_2rem] items-end gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("label",{htmlFor:`custom-provider-model-${r}-id`,className:"mb-1 block text-xs font-normal text-text-secondary",children:"Model ID"}),e.jsx("input",{id:`custom-provider-model-${r}-id`,type:"text",value:s.id,onChange:t=>{const a=t.target.value;i(r,{id:a,...s.nameDirty?{}:{name:Se(a)}})},onBlur:()=>i(r,{idTouched:!0}),placeholder:"llama3.1:70b","aria-invalid":u?!0:void 0,className:L(Q,"font-mono",u&&V)})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("label",{htmlFor:`custom-provider-model-${r}-name`,className:"mb-1 block text-xs font-normal text-text-secondary",children:"Model name"}),e.jsx("input",{id:`custom-provider-model-${r}-name`,type:"text",value:s.name,onChange:t=>i(r,{name:t.target.value,nameDirty:!0}),placeholder:"llama-3-1-70b","aria-invalid":R?!0:void 0,className:L(Q,R&&V)})]}),e.jsx("button",{type:"button","aria-label":`Remove model ${r+1}`,disabled:x.length===1||p,className:"mb-0.5 flex size-9 items-center justify-center rounded-md text-text-secondary transition-colors hover:text-text-primary disabled:opacity-40",onClick:()=>w(t=>t.filter((a,m)=>m!==r)),children:e.jsx(P,{name:"trash",className:"size-4"})})]}),u?e.jsx(ee,{children:g}):null,R?e.jsx(ee,{children:j}):null,e.jsxs("div",{className:"mt-2",children:[e.jsxs("button",{type:"button","aria-expanded":s.advancedExpanded,"aria-controls":`custom-provider-model-${r}-advanced`,className:"flex cursor-pointer items-center gap-1.5 text-sm font-medium text-text-primary",onClick:()=>i(r,{advancedExpanded:!s.advancedExpanded}),children:[e.jsx(P,{name:"chevron-down",className:L("size-4 text-text-secondary transition-transform",s.advancedExpanded?"":"-rotate-90")}),"Advanced"]}),s.advancedExpanded?e.jsxs("div",{id:`custom-provider-model-${r}-advanced`,className:"mt-3 space-y-4 pl-6",children:[e.jsxs("div",{children:[e.jsxs("label",{htmlFor:`custom-provider-model-${r}-context-length`,className:"mb-1.5 block text-xs font-medium text-text-secondary",children:["Context length",e.jsx(re,{})]}),e.jsx("input",{id:`custom-provider-model-${r}-context-length`,type:"number",min:1,inputMode:"numeric",value:s.contextLength,onChange:t=>i(r,{contextLength:t.target.value}),onBlur:()=>i(r,{contextTouched:!0}),placeholder:ke,"aria-invalid":z?!0:void 0,className:L(Q,z&&V)}),z?e.jsx(ee,{children:le}):s.contextLength.trim()===""?e.jsx(ne,{children:"Model's total token window."}):null]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:`custom-provider-model-${r}-max-output-tokens`,className:"mb-1.5 block text-xs font-medium text-text-secondary",children:["Max output tokens",e.jsx(re,{})]}),e.jsx("input",{id:`custom-provider-model-${r}-max-output-tokens`,type:"number",min:1,inputMode:"numeric",value:s.maxOutputTokens,onChange:t=>i(r,{maxOutputTokens:t.target.value}),onBlur:()=>i(r,{maxTouched:!0}),placeholder:Ee,"aria-invalid":ae?!0:void 0,className:L(Q,ae&&V)}),ae?e.jsx(ee,{children:C}):s.maxOutputTokens.trim()===""?e.jsx(ne,{children:"Longest reply the model allows — use its real limit."}):null]}),k&&k.length>0?e.jsxs("div",{children:[e.jsxs("label",{className:"flex w-fit cursor-pointer items-center gap-2 select-none",children:[e.jsx("input",{type:"checkbox",className:"size-4 shrink-0 cursor-pointer accent-primary-button-bg disabled:cursor-not-allowed disabled:opacity-50",checked:s.reasoningEfforts!==void 0,"aria-label":`Enable reasoning effort for model ${r+1}`,disabled:p,onChange:t=>i(r,{reasoningEfforts:t.target.checked?[]:void 0})}),e.jsx("span",{className:"text-text-secondary text-xs font-medium",children:"Reasoning effort"})]}),s.reasoningEfforts!==void 0?e.jsx("div",{role:"group","aria-label":`Supported reasoning efforts for model ${r+1}`,className:"mt-2 flex flex-wrap gap-2",children:k.map(t=>{var m;const a=((m=s.reasoningEfforts)==null?void 0:m.includes(t))??!1;return e.jsx("button",{type:"button","aria-pressed":a,disabled:p,className:L("rounded-full border px-3 py-1 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring/40 disabled:opacity-50",a?"border-primary-button-bg bg-primary-button-bg text-primary-button-text":"border-border text-text-secondary hover:bg-ghost-button-hover"),onClick:()=>{var J;return i(r,{reasoningEfforts:a?(J=s.reasoningEfforts)==null?void 0:J.filter(de=>de!==t):[...s.reasoningEfforts??[],t]})},children:t},t)})}):null]}):null]}):null]})]},r)})}),e.jsxs(B,{variant:"secondary",size:"sm",type:"button",className:"mt-4 w-fit",onClick:()=>w(s=>[...s,pe()]),children:[e.jsx(P,{name:"plus",className:"size-3.5"}),"Add model"]})]})]}),e.jsxs("div",{className:"shrink-0 space-y-3 border-t border-border px-5 py-4",children:[E?e.jsx("p",{className:"text-failure-bg text-sm",children:E}):null,e.jsx(B,{type:"submit",size:"lg",disabled:!oe||p,className:"w-full",children:d?"Save changes":"Add provider"})]})]})})},Ue=Me;function Te(n){return"baseUrl"in n&&typeof n.baseUrl=="string"?n.baseUrl:""}var Le=()=>{const{modelCatalog:n}=be(),l=fe(),[b,k]=o.useState(""),[p,E]=o.useState([]),[d,c]=o.useState([]),[S,O]=o.useState(!0),[F,M]=o.useState(null),[$,y]=o.useState(null),[x,w]=o.useState(!1),[A,U]=o.useState(null),[X,T]=o.useState(null),[G,v]=o.useState(null),[i,K]=o.useState(!1),[f,D]=o.useState(null),_=o.useMemo(()=>(d??[]).reduce((t,a)=>(t[a.name]=a.logo??"",t),{}),[d]),h=b.trim().toLowerCase(),W=o.useCallback(async()=>{O(!0),M(null);try{const[t,a]=await Promise.all([n.listModelProviders(),n.getModelProviderCatalog()]);E(t),c(a)}catch(t){M(Y(t,"Failed to load model providers"))}finally{O(!1)}},[n]);o.useEffect(()=>{W()},[W]);const te=o.useMemo(()=>new Set(p.map(t=>t.type)),[p]),q=o.useMemo(()=>p.filter(t=>{var a;return((a=t.name)==null?void 0:a.toLowerCase().includes(h))||t.models.some(m=>m.name.toLowerCase().includes(h)||m.id.toLowerCase().includes(h))}),[p,h]),Z=o.useMemo(()=>d.filter(t=>t.type!=="custom"&&!te.has(t.type)&&(t.name.toLowerCase().includes(h)||t.models.some(a=>a.name.toLowerCase().includes(h)||a.id.toLowerCase().includes(h)))),[d,te,h]),oe=o.useMemo(()=>{var t;return(t=d.find(a=>a.type==="custom"))==null?void 0:t.supportedReasoningEfforts},[d]),se=o.useMemo(()=>{const t=new Map;for(const a of d)t.set(a.type,a.models);return t},[d]),H=()=>{U(null),T(null),v(null)},I=async(t,a)=>{w(!0),M(null);try{await t(),await W(),H()}catch(m){throw a?a(m):l==null?M(Y(m,"Request failed")):l.showError(m),m}finally{w(!1)}},s=async(t,a)=>{v(null),await I(async()=>{await n.createModelProvider({type:t.type,name:t.name,...a.baseUrl?{baseUrl:a.baseUrl}:{},apiKey:a.apiKey,models:t.models})},m=>v(Y(m,"Request failed")))},r=async(t,a)=>{v(null),await I(async()=>{await n.updateModelProvider({id:t.id,type:t.type,name:t.name,...a.baseUrl?{baseUrl:a.baseUrl}:{},apiKey:a.apiKey,models:t.models})},m=>v(Y(m,"Request failed"))),l==null||l.showSuccess({title:`${t.name} updated`})},g=t=>{n.deleteModelProvider&&I(async()=>{await n.deleteModelProvider({id:t.id})}).catch(()=>{})},u=(t,a)=>{I(async()=>{await n.updateModelProvider({id:t.id,type:t.type,name:t.name,...t.baseUrl?{baseUrl:t.baseUrl}:{},apiKey:"",models:a})}).catch(()=>{})},j=async t=>{y(null),await I(async()=>{await n.createModelProvider({type:"custom",name:t.name,baseUrl:t.baseUrl,apiKey:t.apiKey,models:t.models})},a=>y(Y(a,"Request failed"))),setTimeout(()=>{l==null||l.showSuccess({title:`${t.name} added`})},0)},R=async t=>{if(!f)return;const a=f;y(null),await I(async()=>{await n.updateModelProvider({id:a.id,type:a.type,name:a.name,baseUrl:t.baseUrl,apiKey:t.apiKey,models:t.models})},m=>y(Y(m,"Request failed"))),setTimeout(()=>{l==null||l.showSuccess({title:"Model provider updated",description:`${a.name} was updated successfully.`})},0)},le=f?{name:f.name,baseUrl:f.baseUrl??"",models:f.models}:void 0,C=A!=null?p.find(t=>t.id===A)??null:null,z=X!=null?d.find(t=>t.type===X)??null:null,ae=C!=null||z!=null;return e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"text-xl font-semibold tracking-tight text-text-primary",children:"Models"}),e.jsx("p",{className:"mt-1 text-sm text-text-secondary",children:"Connect providers and choose which models are available."}),F?e.jsx("p",{className:"mt-3 rounded-md border border-failure-bg/30 bg-failure-bg/10 px-3 py-2 text-sm text-failure-bg",children:F}):null,e.jsx("div",{className:"mt-4 flex-1 overflow-y-hidden",children:e.jsxs("div",{className:"flex h-full flex-col gap-3",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx("div",{className:"flex-1",children:e.jsx(ge,{query:b,setQuery:k,placeholder:"Search providers and models"})}),e.jsxs(B,{variant:"secondary",type:"button",onClick:()=>{y(null),D(null),K(!0)},children:[e.jsx(P,{name:"plus",size:"1rem",className:"mr-1"}),"Add Custom Provider"]})]}),e.jsxs("div",{className:"flex flex-1 flex-col gap-2 overflow-y-auto",children:[S?e.jsx("p",{className:"py-8 text-center text-sm text-text-secondary",children:"Loading…"}):null,!S&&q.length>0?e.jsxs("section",{"aria-labelledby":"configured-providers-heading",children:[e.jsx("div",{id:"configured-providers-heading",className:"mb-2 text-[0.8125rem] font-semibold uppercase text-text-secondary",children:"Configured"}),e.jsx("div",{className:"overflow-hidden rounded-xl border border-border bg-card-bg",children:q.map(t=>{const a=se.get(t.type)??[],m=new Set(t.models.map(N=>N.id)),J=a.filter(N=>!m.has(N.id)),de=_[t.name];return e.jsxs("article",{className:"border-b border-border p-3 last:border-b-0",children:[e.jsxs("header",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[e.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-border bg-secondary-bg text-text-primary","aria-hidden":!0,children:de?e.jsx(ie,{src:de,alt:t.name,className:"size-4.5"}):e.jsx(P,{name:"cpu",className:"size-4.5"})}),e.jsx("h5",{className:"truncate text-base font-medium text-text-primary",children:t.name})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2.5 sm:justify-end",children:[e.jsxs("span",{className:"flex items-center gap-1.5 rounded-full border border-border bg-secondary-bg/40 px-2 py-0.5 text-xs font-medium text-success-bg",children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-success-bg"}),"Connected"]}),e.jsxs(B,{variant:"secondary",size:"sm",className:"text-[0.8125rem]",type:"button","aria-label":`Edit ${t.name}`,title:`Edit ${t.name}`,disabled:x,onClick:()=>{t.type==="custom"?(H(),y(null),D(t),K(!0)):(v(null),T(null),U(t.id))},children:[e.jsx(P,{name:"wrench",className:"size-3.5"}),"Edit"]}),n.deleteModelProvider?e.jsx(B,{variant:"outline",size:"sm",className:"transition-colors hover:bg-failure-bg/10 hover:text-failure-bg",type:"button",disabled:x,onClick:()=>{g(t)},children:"Remove"}):null]})]}),e.jsxs("div",{className:"mt-3 overflow-hidden rounded-lg border border-border bg-secondary-bg/30",children:[t.models.map(N=>e.jsxs("div",{className:"flex min-h-10 items-center gap-3 border-b border-border px-3 py-2 text-sm text-text-primary last:border-b-0",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate",children:N.name}),e.jsx("button",{type:"button","aria-label":`Remove ${N.name}`,disabled:x,className:"inline-flex size-7 shrink-0 items-center justify-center rounded-md text-text-secondary hover:bg-ghost-button-hover hover:text-ghost-button-text focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-focus-ring disabled:opacity-50",onClick:()=>{u(t,t.models.filter(he=>he.id!==N.id))},children:e.jsx(P,{name:"trash",className:"size-3.5"})})]},N.id)),J.length>0?e.jsxs("section",{children:[e.jsxs("div",{className:"border-b border-border bg-secondary-bg/40 px-3 py-2 text-xs font-semibold uppercase tracking-wide text-text-secondary",children:["Available to add · ",J.length]}),J.map(N=>e.jsxs("div",{className:"flex min-h-12 items-center gap-3 border-b border-border px-3 py-2 text-sm text-text-primary last:border-b-0",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate",children:N.name}),e.jsx(B,{variant:"outline",size:"sm",type:"button",disabled:x,onClick:()=>{u(t,[...t.models,N])},children:"Add"})]},N.id))]}):null]})]},t.id)})})]}):null,!S&&Z.length>0?e.jsxs("section",{"aria-labelledby":"available-providers-heading",className:"mt-2",children:[e.jsx("div",{id:"available-providers-heading",className:"mb-2 text-[0.8125rem] font-semibold uppercase text-text-secondary",children:"Available"}),e.jsx("div",{className:"overflow-hidden rounded-xl border border-border bg-card-bg",children:Z.map(t=>{const a=_[t.name];return e.jsx("article",{className:"border-b border-border p-3 last:border-b-0",children:e.jsxs("header",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[e.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg border border-border bg-secondary-bg text-text-primary","aria-hidden":!0,children:a?e.jsx(ie,{src:a,alt:t.name,className:"size-4.5"}):e.jsx(P,{name:"cpu",className:"size-4.5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h5",{className:"truncate text-base font-medium text-text-primary",children:t.name}),e.jsx("p",{className:"truncate text-sm text-text-secondary",children:t.models.map(m=>m.name).join(" · ")})]})]}),e.jsxs(B,{variant:"secondary",type:"button",disabled:x,onClick:()=>{v(null),U(null),T(t.type)},children:[e.jsx(P,{name:"wrench",className:"size-4"}),"Configure"]})]})},t.type)})})]}):null,!S&&q.length===0&&Z.length===0?e.jsx("div",{className:"flex flex-1 items-center justify-center rounded-xl border border-dashed border-border p-8 text-center text-sm text-text-secondary",children:h?`No providers match “${b.trim()}”.`:"No model providers yet."}):null]}),e.jsx(Ce,{open:ae,onOpenChange:t=>{t||H()},onSave:t=>{if(C)return r(C,t);if(z)return s(z,t)},title:C?"Edit Provider Details":"Configure Provider Details",initialBaseUrl:C?C.baseUrl??"":z?Te(z):"",requireApiKey:C==null,submitLabel:C?"Save":"Create",busy:x,error:G}),e.jsx(Ue,{open:i,onOpenChange:t=>{K(t),t||(y(null),D(null))},isEditMode:f!==null,initialValues:le,onSubmit:f?R:j,reasoningEffortOptions:oe,busy:x,error:$},(f==null?void 0:f.id)??"add-custom-provider")]})})]})},ze=Le;export{ze as default};
@@ -0,0 +1 @@
1
+ import{s as G,t as H,r,v as q,j as e,S as Y,I as N,i as J,B as O,y as Q,A as W,z as X,e as Z,D as ee,E as te}from"./index-ChCGltYc.js";var se={execTimeoutMs:3e5,autoStopIntervalInMinutes:15,autoArchiveIntervalInMinutes:10080,autoDeleteIntervalInMinutes:43200},F=te("h-11 shadow-sm");function U(s){if(s.trim()==="")return null;const l=Number(s);return!Number.isFinite(l)||l<0?null:l}var ae=({open:s,onOpenChange:l,onSave:d,title:g,description:I,initialConfig:R=null,requireApiKey:y=!0,busy:w=!1,error:C})=>{const[m,k]=r.useState(""),[u,x]=r.useState(""),[M,i]=r.useState(""),[p,o]=r.useState(""),[b,f]=r.useState(""),[A,v]=r.useState(!1),S=()=>{k(""),x(""),i(""),o(""),f(""),v(!1)};r.useEffect(()=>{if(!s)return;const a=R??se;k(String(a.execTimeoutMs)),x(String(a.autoStopIntervalInMinutes)),i(String(a.autoArchiveIntervalInMinutes)),o(String(a.autoDeleteIntervalInMinutes)),f(""),v(!1)},[s,R]);const B=a=>{a||S(),l(a)},h=U(m),P=U(u),T=U(M),z=U(p),_=b.trim(),K=(!y||!!_)&&h!=null&&P!=null&&T!=null&&z!=null,E=async a=>{if(a.preventDefault(),!(!K||w||h==null||P==null||T==null||z==null))try{await d({execTimeoutMs:h,autoStopIntervalInMinutes:P,autoArchiveIntervalInMinutes:T,autoDeleteIntervalInMinutes:z,apiKey:_}),S(),l(!1)}catch{}};return e.jsx(Q,{open:s,onOpenChange:B,title:g,description:I,contentSized:!0,headerIcon:e.jsx("span",{className:"flex size-11 shrink-0 items-center justify-center rounded-lg border border-border bg-secondary-bg text-text-primary","aria-hidden":!0,children:e.jsx(N,{name:"cube",className:"size-6"})}),children:e.jsxs("form",{className:"flex flex-col overflow-y-auto p-5 md:p-6",onSubmit:E,children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"sandbox-api-key",className:"mb-1.5 block text-sm font-medium text-text-primary",children:["API key",y?null:e.jsx("span",{className:"font-normal text-text-secondary",children:" (optional)"})]}),e.jsx("input",{id:"sandbox-api-key",type:"password",required:y,value:b,onChange:a=>{f(a.target.value)},placeholder:y?"dtn_...":"Leave blank to keep existing",autoFocus:!0,className:F})]}),e.jsxs(W,{expanded:A,onChange:(a,t)=>v(t),className:"rounded-md border border-border",children:[e.jsx(X,{className:"px-3 py-2.5",children:e.jsxs("span",{className:"flex w-full items-center justify-between text-sm font-medium text-text-primary",children:["Advanced settings",e.jsx(N,{name:"chevron-down",className:Z("size-4 shrink-0 text-text-secondary transition-transform duration-200",A?"rotate-0":"-rotate-90")})]})}),e.jsxs(ee,{className:"space-y-4 border-t border-border px-3 pb-3 pt-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"sandbox-exec-timeout",className:"mb-1.5 block text-sm font-medium text-text-primary",children:"Exec timeout (ms)"}),e.jsx("input",{id:"sandbox-exec-timeout",type:"number",min:0,required:!0,value:m,onChange:a=>{k(a.target.value)},placeholder:"300000",className:F})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"sandbox-auto-stop",className:"mb-1.5 block text-sm font-medium text-text-primary",children:"Auto-stop interval (minutes)"}),e.jsx("input",{id:"sandbox-auto-stop",type:"number",min:0,required:!0,value:u,onChange:a=>{x(a.target.value)},placeholder:"15",className:F})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"sandbox-auto-archive",className:"mb-1.5 block text-sm font-medium text-text-primary",children:"Auto-archive interval (minutes)"}),e.jsx("input",{id:"sandbox-auto-archive",type:"number",min:0,required:!0,value:M,onChange:a=>{i(a.target.value)},placeholder:"10080",className:F})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"sandbox-auto-delete",className:"mb-1.5 block text-sm font-medium text-text-primary",children:"Auto-delete interval (minutes)"}),e.jsx("input",{id:"sandbox-auto-delete",type:"number",min:0,required:!0,value:p,onChange:a=>{o(a.target.value)},placeholder:"43200",className:F})]})]})]})]}),e.jsxs("div",{className:"mt-6 space-y-3",children:[C?e.jsx("p",{className:"text-failure-bg text-sm",children:C}):null,e.jsx(O,{type:"submit",size:"lg",disabled:!K||w,className:"w-full shrink-0",children:"Save"})]})]})})},ne=ae,re=1e4,D=({execTimeoutMs:s,autoStopIntervalInMinutes:l,autoArchiveIntervalInMinutes:d,autoDeleteIntervalInMinutes:g})=>({execTimeoutMs:s,autoStopIntervalInMinutes:l,autoArchiveIntervalInMinutes:d,autoDeleteIntervalInMinutes:g}),le=s=>{switch(s){case"pending":return{label:"Syncing image...",className:"text-warning-bg"};case"ready":return{label:"Connected",className:"text-success-bg"};case"failed":return{label:"Sync failed",className:"text-failure-bg"};default:return{label:s,className:"text-text-secondary"}}},ie=()=>{const{sandboxCatalog:s}=G(),l=H(),[d,g]=r.useState([]),[I,R]=r.useState([]),[y,w]=r.useState(!0),[C,m]=r.useState(null),[k,u]=r.useState(null),[x,M]=r.useState(!1),[i,p]=r.useState(null),[o,b]=r.useState(null),f=r.useCallback(async({quiet:t=!1}={})=>{if(s){t||w(!0),m(null);try{const[n,c]=await Promise.all([s.listSandboxProviders(),s.getSandboxProviderCatalog()]);g(n),R(c)}catch(n){m(q(n,"Failed to load sandbox providers"))}finally{t||w(!1)}}},[s]);r.useEffect(()=>{f()},[f]);const A=d.some(t=>t.snapshotSyncStatus.status==="pending");r.useEffect(()=>{if(!s||!A)return;const t=s;let n=!1,c;function j(){c=window.setTimeout(()=>{$()},re)}async function $(){try{const L=await t.listSandboxProviders();if(n)return;g(L),m(null),L.some(V=>V.snapshotSyncStatus.status==="pending")&&j()}catch(L){if(n)return;m(q(L,"Failed to refresh sandbox providers")),j()}}return j(),()=>{n=!0,c!==void 0&&window.clearTimeout(c)}},[s,A]);const v=d.length>0,S=r.useMemo(()=>{if(v)return[];const t=new Set(d.map(n=>n.data.catalogId));return I.filter(n=>!t.has(n.id))},[I,d,v]),B=r.useMemo(()=>o?D(o):i?D(i):null,[o,i]);if(!s)return e.jsx("p",{className:"text-sm text-text-secondary",children:"Sandbox provider catalog is not available."});const h=async(t,n=m)=>{M(!0),m(null);try{await t(),await f({quiet:!0})}catch(c){throw n(q(c,"Request failed")),c}finally{M(!1)}},P=async t=>{i&&(u(null),await h(async()=>{await s.createSandboxProvider({catalogId:i.id,name:i.name,type:i.type,...D(t),apiKey:t.apiKey})},u),p(null),setTimeout(()=>{l==null||l.showSuccess({title:`${i.name} configured`})},0))},T=async t=>{o&&(u(null),await h(async()=>{await s.updateSandboxProvider({id:o.id,...D(t),...t.apiKey?{apiKey:t.apiKey}:{}})},u),b(null),setTimeout(()=>{l==null||l.showSuccess({title:`${o.name} updated`})},0))},z=t=>{h(async()=>{await s.updateSandboxProvider({id:t.id,...D(t)})}).catch(()=>{})},_=t=>{const n=s.deleteSandboxProvider;n&&h(async()=>{await n({id:t.id})}).catch(()=>{})},K=i!=null||o!=null,E=o!=null,a=o?`Update ${o.name}`:i?`Configure ${i.name}`:"Configure sandbox provider";return e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"text-xl font-semibold tracking-tight text-text-primary",children:"Sandbox providers"}),e.jsx("p",{className:"mt-1 text-sm text-text-secondary",children:"Choose a provider that runs sandboxes for code, files and shell commands. Only one can be active at a time."}),C?e.jsx("p",{className:"mt-3 rounded-md border border-failure-bg/30 bg-failure-bg/10 px-3 py-2 text-sm text-failure-bg",children:C}):null,e.jsx("div",{className:"mt-4 flex-1 overflow-y-auto",children:y?e.jsx("p",{className:"text-sm text-text-secondary",children:"Loading sandbox providers…"}):e.jsxs("div",{className:"space-y-6",children:[d.length>0?e.jsxs("section",{children:[e.jsxs("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-text-secondary",children:["Configured · ",d.length]}),e.jsx("div",{className:"overflow-hidden rounded-xl border border-border bg-card-bg",children:d.map(t=>{const n=t.data,c=le(t.snapshotSyncStatus.status),j=t.snapshotSyncStatus.statusReason,$=e.jsxs("span",{className:`inline-flex items-center gap-1.5 text-sm font-medium ${c.className}`,children:[t.snapshotSyncStatus.status==="pending"?e.jsx(Y,{size:16,"aria-label":"Syncing snapshot image"}):t.snapshotSyncStatus.status==="ready"?e.jsx("span",{className:"size-2 rounded-full bg-success-bg","aria-hidden":!0}):t.snapshotSyncStatus.status==="failed"?e.jsx(N,{name:"triangle-exclamation",className:"size-4"}):null,c.label]});return e.jsxs("article",{className:"flex flex-col gap-3 border-b border-border p-3 last:border-b-0 sm:flex-row sm:items-center",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[e.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg border border-border bg-secondary-bg text-text-primary","aria-hidden":!0,children:e.jsx(N,{name:"cube",className:"size-4.5"})}),e.jsx("div",{className:"min-w-0",children:e.jsx("h5",{className:"truncate text-sm font-medium text-text-primary",children:n.name})})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2.5 sm:justify-end",children:[$,j?e.jsx(J,{content:j,children:e.jsx("button",{type:"button","aria-label":"Snapshot sync status details",className:"inline-flex text-text-secondary transition-colors hover:text-text-primary",children:e.jsx(N,{name:"info",className:"size-4"})})}):null,t.snapshotSyncStatus.status==="failed"?e.jsx(O,{variant:"ghost",size:"sm",type:"button",disabled:x,onClick:()=>{z(n)},children:"Retry"}):null,e.jsx(O,{variant:"secondary",size:"sm",type:"button",disabled:x,onClick:()=>{u(null),p(null),b(n)},children:"Update"}),s.deleteSandboxProvider?e.jsx(O,{variant:"ghost",size:"sm",className:"text-text-secondary",type:"button",disabled:x,onClick:()=>{_(n)},children:"Remove"}):null]})]},n.id)})})]}):null,v?null:e.jsxs("section",{children:[e.jsxs("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-text-secondary",children:["Available · ",S.length]}),S.length===0?e.jsx("p",{className:"text-sm text-text-secondary",children:I.length>0?"All catalog providers are configured.":"No sandbox providers in the catalog."}):e.jsx("div",{className:"overflow-hidden rounded-xl border border-border bg-card-bg",children:S.map(t=>e.jsxs("article",{className:"flex flex-col gap-3 border-b border-border p-3 last:border-b-0 sm:flex-row sm:items-center",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[e.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg border border-border bg-secondary-bg text-text-primary","aria-hidden":!0,children:e.jsx(N,{name:"cube",className:"size-4.5"})}),e.jsx("div",{className:"min-w-0",children:e.jsx("h5",{className:"truncate text-sm font-medium text-text-primary",children:t.name})})]}),e.jsx(O,{variant:"secondary",type:"button",disabled:x,onClick:()=>{u(null),b(null),p(t)},children:"Configure"})]},t.id))})]})]})}),e.jsx(ne,{open:K,onOpenChange:t=>{t||(u(null),p(null),b(null))},onSave:E?T:P,title:a,description:E?"Update this sandbox provider. Leave API key blank to keep the existing key.":"Configure this sandbox provider. API key is never stored in the catalog.",initialConfig:B,requireApiKey:!E,busy:x,error:k})]})},de=ie;export{de as default};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ModelSettings-QJMYHCMD-DaR_pzAb.js","assets/index-ChCGltYc.js","assets/index-DEKCw40W.css","assets/ConnectorSettings-H37ZFC6Z-BoDzRBt-.js","assets/SkillSettings-IRMGDFRG-ChKre3S8.js","assets/SandboxSettings-BUBMLW7Q-ChiNe2Y8.js"])))=>i.map(i=>d[i]);
2
+ import{n as g,k as v,o as y,p as j,q as S,r as l,j as e,I as p,f as _,e as f,_ as u,S as k}from"./index-ChCGltYc.js";var w=l.lazy(()=>u(()=>import("./ModelSettings-QJMYHCMD-DaR_pzAb.js"),__vite__mapDeps([0,1,2]))),E=l.lazy(()=>u(()=>import("./ConnectorSettings-H37ZFC6Z-BoDzRBt-.js"),__vite__mapDeps([3,1,2]))),N=l.lazy(()=>u(()=>import("./SkillSettings-IRMGDFRG-ChKre3S8.js"),__vite__mapDeps([4,1,2]))),C=l.lazy(()=>u(()=>import("./SandboxSettings-BUBMLW7Q-ChiNe2Y8.js"),__vite__mapDeps([5,1,2])));function L(){return e.jsxs("div",{className:"flex flex-1 items-center justify-center py-8",role:"status","aria-live":"polite","aria-busy":"true",children:[e.jsx(k,{size:20,className:"text-text-secondary"}),e.jsx("span",{className:"sr-only",children:"Loading"})]})}var O=()=>{const{settingsOpen:a,settingsSection:t,setSettingsOpen:r}=g(),n=v(),d=y(),{refresh:m}=j(),i=S(),o=(n==null?void 0:n.skillCatalog)!=null,c=(n==null?void 0:n.sandboxCatalog)!=null,x=l.useCallback(()=>{r(!1),m(),d==null||d()},[m,d,r]);l.useEffect(()=>{!o&&t==="skills"&&r(a,"models"),!c&&t==="sandbox"&&r(a,"models")},[o,c,t,a,r]),l.useEffect(()=>{if(!a)return;const s=b=>{b.key==="Escape"&&(b.stopImmediatePropagation(),x())};return window.addEventListener("keydown",s,!0),()=>window.removeEventListener("keydown",s,!0)},[x,a]);const h=l.useMemo(()=>{const s=[{id:"models",label:"Models",icon:"cpu"},{id:"connectors",label:"Connectors",icon:"plug"}];return o&&s.push({id:"skills",label:"Skills",icon:"lightbulb"}),c&&s.push({id:"sandbox",label:"Sandbox providers",icon:"cube"}),s},[o,c]);return!a||!n?null:e.jsxs("div",{className:"flex h-full min-h-0 w-full flex-col bg-primary-bg",children:[e.jsxs("header",{className:"flex shrink-0 items-center gap-2 border-b border-border px-2 py-1.5",children:[e.jsx("button",{type:"button","aria-label":"Back",title:"Back",className:_({variant:"ghost",size:"icon"}),onClick:x,children:e.jsx(p,{name:"arrow-left"})}),e.jsx("h1",{className:"text-lg font-semibold tracking-tight text-text-primary",children:"Settings"})]}),e.jsxs("div",{className:f("flex min-h-0 flex-1 flex-col",!i&&"md:flex-row"),children:[e.jsx("nav",{"aria-label":"Settings sections",className:f("flex w-full gap-1 border-b border-border bg-secondary-bg/40 p-2",i?"min-w-0":"justify-center md:w-48 md:flex-col md:justify-start md:border-b-0 md:border-r"),children:h.map(s=>e.jsxs("button",{type:"button","aria-current":t===s.id?"page":void 0,...i?{title:s.label}:{},className:f("flex min-h-9 items-center gap-2 rounded-md px-3 text-sm font-medium transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-focus-ring",i?"min-w-0 flex-1 justify-center gap-1.5 px-1.5":"shrink-0",t===s.id?"bg-primary-button-bg text-primary-button-text":"text-text-secondary hover:bg-ghost-button-hover/60 hover:text-text-primary"),onClick:()=>{r(!0,s.id)},children:[e.jsx(p,{name:s.icon,className:"h-4 w-4 shrink-0"}),i?e.jsx("span",{className:"truncate",children:s.label}):s.label]},s.id))}),e.jsx("section",{className:"flex flex-col h-full flex-1 overflow-y-hidden px-6 py-4",children:e.jsx("div",{className:"w-full max-w-210 h-full min-h-0 flex flex-col mx-auto",children:e.jsxs(l.Suspense,{fallback:e.jsx(L,{}),children:[t==="models"?e.jsx(w,{}):null,t==="connectors"?e.jsx(E,{}):null,t==="skills"&&o?e.jsx(N,{}):null,t==="sandbox"&&c?e.jsx(C,{}):null]})})})]})]})},I=O;export{I as default};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SettingsBuilder-64Y33NP3-BQNwNwxh.js","assets/index-B8NomNE2.js","assets/index-DEKCw40W.css"])))=>i.map(i=>d[i]);
2
- import{u as T,a as _,b as I,c,r as n,d as D,j as e,e as r,I as u,f,T as v,S as H,g as P,_ as F}from"./index-B8NomNE2.js";import{S as y,N as M}from"./chunk-WFC3W4C3-DXFwnpmH.js";var V=n.lazy(()=>F(()=>import("./SettingsBuilder-64Y33NP3-BQNwNwxh.js"),__vite__mapDeps([0,1,2]))),w=!1;function G({className:C}){const S=T(),s=_(),p=I(),b=c("BrandLogo"),k=c("AgentsLibraryButton"),E=c("ClearChatButton"),B=c("SaveAgentButton"),L=c("SelectAgentEmptyState"),[a,A]=n.useState(w),z=t=>{A(l=>{const o=typeof t=="function"?t(l):t;return w=o,o})},[i,d]=n.useState(!1),h=n.useRef(null),j=n.useRef(null),g=n.useRef(null),x=n.useRef(!1),N=(s==null?void 0:s.mode.status)==="idle",m=(s==null?void 0:s.settingsOpen)===!0,O=D();n.useEffect(()=>{if(!i)return;const t=l=>{l.key==="Escape"&&d(!1)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[i]),n.useEffect(()=>{var l,o;const t=g.current;if(i){x.current=!0,t&&(t.inert=!0),(l=j.current)==null||l.focus();return}x.current&&(t&&(t.inert=!1),(o=h.current)==null||o.focus(),x.current=!1)},[i]);const R=()=>{if(s!=null&&s.isComposerEnabled){s.openDraft();return}s==null||s.setSettingsOpen(!1),Promise.resolve(S.threads().switchToNewThread()).catch(()=>{})};return e.jsxs("div",{className:r("relative flex h-full min-h-0 w-full min-w-0",C),children:[e.jsxs("aside",{className:r("hidden min-h-0 shrink-0 flex-col border-r border-border bg-sidebar-bg transition-[width] duration-300 ease-in-out md:flex",a?"w-16":"w-64"),children:[e.jsxs("div",{className:r("flex shrink-0 items-center px-3 py-3",a?"flex-col gap-3":"justify-between gap-2"),children:[e.jsxs("div",{className:r("flex min-w-0 items-center text-text-primary",a?"justify-center":"gap-2"),children:[e.jsx(b,{className:"size-5 shrink-0 object-contain"}),a?null:e.jsx("span",{className:"truncate text-lg font-semibold tracking-tight",children:p})]}),e.jsx("button",{type:"button","aria-label":a?"Expand sidebar":"Collapse sidebar",title:a?"Expand sidebar":"Collapse sidebar","aria-expanded":!a,className:f({variant:"ghost",size:"icon"}),onClick:()=>z(t=>!t),children:e.jsx(u,{name:a?"panel-left-open":"panel-left-close"})})]}),e.jsxs("nav",{className:"flex min-h-0 flex-1 flex-col items-center gap-2 px-3",hidden:!a,"aria-label":"Sidebar",children:[(s==null?void 0:s.isNewChatEnabled)!==!1?e.jsx("button",{type:"button","aria-label":"Start new chat",title:"New chat",className:f({variant:"ghost",size:"icon"}),onClick:R,children:e.jsx(u,{name:"square-pen"})}):null,e.jsx(k,{compact:!0})]}),e.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",hidden:a,children:e.jsx(v,{})}),e.jsx("footer",{className:r("flex shrink-0 border-t border-border px-3 py-2",a?"flex-col items-center gap-2":"items-center gap-1"),children:e.jsx(y,{className:a?"flex-col":void 0})})]}),e.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col bg-primary-bg",children:[e.jsxs("header",{className:r("flex shrink-0 items-center gap-1 border-b border-border bg-topbar-bg px-2 py-1.5",(m||N||!O)&&"md:hidden"),children:[m?e.jsx("span",{className:"min-w-0 flex-1"}):e.jsxs(e.Fragment,{children:[e.jsx("button",{ref:h,type:"button","aria-label":"Sessions","aria-expanded":i,className:r(f({variant:"ghost",size:"icon"}),"md:hidden"),onClick:()=>d(!0),children:e.jsx(u,{name:"bars"})}),e.jsx(M,{}),e.jsx("span",{className:"min-w-0 flex-1"}),e.jsx(E,{}),e.jsx(B,{})]}),e.jsx("div",{className:"md:hidden",children:e.jsx(y,{})},"mobile-shell-actions")]}),e.jsx("div",{ref:g,className:"min-h-0 min-w-0 flex-1",children:m?e.jsx(n.Suspense,{fallback:e.jsxs("div",{className:"flex h-full items-center justify-center",role:"status","aria-live":"polite","aria-busy":"true",children:[e.jsx(H,{size:28,className:"text-text-primary"}),e.jsx("span",{className:"sr-only",children:"Loading"})]}),children:e.jsx(V,{})}):N?e.jsx(L,{}):e.jsx(P,{})})]}),i?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button","aria-label":"Close sessions",className:"absolute inset-0 z-[9] cursor-pointer bg-[var(--overlay)] md:hidden",onClick:()=>d(!1)}),e.jsxs("div",{ref:j,className:"absolute inset-y-0 left-0 z-10 flex w-full max-w-80 flex-col border-r border-border bg-sidebar-bg shadow-lg outline-none md:hidden",role:"dialog","aria-label":"Sessions",tabIndex:-1,children:[e.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-3 text-text-primary",children:[e.jsx(b,{className:"size-5 shrink-0 object-contain"}),e.jsx("span",{className:"truncate text-lg font-semibold tracking-tight",children:p})]}),e.jsx(v,{onThreadOpen:()=>d(!1)})]})]}):null]})}export{G as SidebarLayout};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SettingsBuilder-26XSGIHK-DmgjXL0m.js","assets/index-ChCGltYc.js","assets/index-DEKCw40W.css"])))=>i.map(i=>d[i]);
2
+ import{u as T,a as _,b as I,c,r as n,d as D,j as e,e as r,I as u,f,T as v,S as H,g as P,_ as F}from"./index-ChCGltYc.js";import{S as y,N as M}from"./chunk-LRQHHZDX-eb14Z2nA.js";var V=n.lazy(()=>F(()=>import("./SettingsBuilder-26XSGIHK-DmgjXL0m.js"),__vite__mapDeps([0,1,2]))),w=!1;function G({className:C}){const S=T(),s=_(),p=I(),b=c("BrandLogo"),k=c("AgentsLibraryButton"),E=c("ClearChatButton"),B=c("SaveAgentButton"),L=c("SelectAgentEmptyState"),[a,A]=n.useState(w),z=t=>{A(l=>{const o=typeof t=="function"?t(l):t;return w=o,o})},[i,d]=n.useState(!1),h=n.useRef(null),j=n.useRef(null),g=n.useRef(null),x=n.useRef(!1),N=(s==null?void 0:s.mode.status)==="idle",m=(s==null?void 0:s.settingsOpen)===!0,O=D();n.useEffect(()=>{if(!i)return;const t=l=>{l.key==="Escape"&&d(!1)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[i]),n.useEffect(()=>{var l,o;const t=g.current;if(i){x.current=!0,t&&(t.inert=!0),(l=j.current)==null||l.focus();return}x.current&&(t&&(t.inert=!1),(o=h.current)==null||o.focus(),x.current=!1)},[i]);const R=()=>{if(s!=null&&s.isComposerEnabled){s.openDraft();return}s==null||s.setSettingsOpen(!1),Promise.resolve(S.threads().switchToNewThread()).catch(()=>{})};return e.jsxs("div",{className:r("relative flex h-full min-h-0 w-full min-w-0",C),children:[e.jsxs("aside",{className:r("hidden min-h-0 shrink-0 flex-col border-r border-border bg-sidebar-bg transition-[width] duration-300 ease-in-out md:flex",a?"w-16":"w-64"),children:[e.jsxs("div",{className:r("flex shrink-0 items-center px-3 py-3",a?"flex-col gap-3":"justify-between gap-2"),children:[e.jsxs("div",{className:r("flex min-w-0 items-center text-text-primary",a?"justify-center":"gap-2"),children:[e.jsx(b,{className:"size-5 shrink-0 object-contain"}),a?null:e.jsx("span",{className:"truncate text-lg font-semibold tracking-tight",children:p})]}),e.jsx("button",{type:"button","aria-label":a?"Expand sidebar":"Collapse sidebar",title:a?"Expand sidebar":"Collapse sidebar","aria-expanded":!a,className:f({variant:"ghost",size:"icon"}),onClick:()=>z(t=>!t),children:e.jsx(u,{name:a?"panel-left-open":"panel-left-close"})})]}),e.jsxs("nav",{className:"flex min-h-0 flex-1 flex-col items-center gap-2 px-3",hidden:!a,"aria-label":"Sidebar",children:[(s==null?void 0:s.isNewChatEnabled)!==!1?e.jsx("button",{type:"button","aria-label":"Start new chat",title:"New chat",className:f({variant:"ghost",size:"icon"}),onClick:R,children:e.jsx(u,{name:"square-pen"})}):null,e.jsx(k,{compact:!0})]}),e.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",hidden:a,children:e.jsx(v,{})}),e.jsx("footer",{className:r("flex shrink-0 border-t border-border px-3 py-2",a?"flex-col items-center gap-2":"items-center gap-1"),children:e.jsx(y,{className:a?"flex-col":void 0})})]}),e.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col bg-primary-bg",children:[e.jsxs("header",{className:r("flex shrink-0 items-center gap-1 border-b border-border bg-topbar-bg px-2 py-1.5",(m||N||!O)&&"md:hidden"),children:[m?e.jsx("span",{className:"min-w-0 flex-1"}):e.jsxs(e.Fragment,{children:[e.jsx("button",{ref:h,type:"button","aria-label":"Sessions","aria-expanded":i,className:r(f({variant:"ghost",size:"icon"}),"md:hidden"),onClick:()=>d(!0),children:e.jsx(u,{name:"bars"})}),e.jsx(M,{}),e.jsx("span",{className:"min-w-0 flex-1"}),e.jsx(E,{}),e.jsx(B,{})]}),e.jsx("div",{className:"md:hidden",children:e.jsx(y,{})},"mobile-shell-actions")]}),e.jsx("div",{ref:g,className:"min-h-0 min-w-0 flex-1",children:m?e.jsx(n.Suspense,{fallback:e.jsxs("div",{className:"flex h-full items-center justify-center",role:"status","aria-live":"polite","aria-busy":"true",children:[e.jsx(H,{size:28,className:"text-text-primary"}),e.jsx("span",{className:"sr-only",children:"Loading"})]}),children:e.jsx(V,{})}):N?e.jsx(L,{}):e.jsx(P,{})})]}),i?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button","aria-label":"Close sessions",className:"absolute inset-0 z-[9] cursor-pointer bg-[var(--overlay)] md:hidden",onClick:()=>d(!1)}),e.jsxs("div",{ref:j,className:"absolute inset-y-0 left-0 z-10 flex w-full max-w-80 flex-col border-r border-border bg-sidebar-bg shadow-lg outline-none md:hidden",role:"dialog","aria-label":"Sessions",tabIndex:-1,children:[e.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-3 text-text-primary",children:[e.jsx(b,{className:"size-5 shrink-0 object-contain"}),e.jsx("span",{className:"truncate text-lg font-semibold tracking-tight",children:p})]}),e.jsx(v,{onThreadOpen:()=>d(!1)})]})]}):null]})}export{G as SidebarLayout};
@@ -1 +1 @@
1
- import{p as D,q as H,r as a,s as E,j as e,t as $,B as R,I as F,w as Q,z as v}from"./index-B8NomNE2.js";var _=({open:l,onOpenChange:o,onImport:c,busy:k=!1,error:d})=>{const[h,b]=a.useState(""),[p,m]=a.useState(""),[u,f]=a.useState(""),[i,y]=a.useState(""),[n,x]=a.useState(""),N=()=>{b(""),m(""),f(""),y(""),x("")},S=()=>{N(),o(!1)},w=async s=>{if(s.preventDefault(),!(!h.trim()||!p.trim()||!u.trim()||!i.trim()||!n.trim()||k))try{await c({name:h.trim(),description:p.trim(),repoURL:u.trim(),path:i.trim(),ref:n.trim()}),S()}catch{}},g=!!(h.trim()&&p.trim()&&u.trim()&&i.trim()&&n.trim())&&!k;return e.jsx(Q,{open:l,onOpenChange:s=>{s||S()},title:"Import from GitHub",description:"Import a skill from a SKILL.md file in a GitHub repository.",headerIcon:e.jsx("span",{className:"flex size-11 shrink-0 items-center justify-center rounded-lg border border-border bg-secondary-bg text-text-primary",children:e.jsx(F,{name:"github",className:"size-5"})}),contentSized:!0,className:"md:max-w-2xl",children:e.jsx("form",{onSubmit:s=>void w(s),children:e.jsxs("div",{className:"space-y-5 px-5 py-5 md:px-6",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"skill-name",className:"mb-2 block text-sm font-semibold text-text-primary",children:"Name"}),e.jsx("input",{id:"skill-name",value:h,onChange:s=>{b(s.target.value)},placeholder:"release-notes",autoFocus:!0,required:!0,className:v("h-11")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"skill-description",className:"mb-2 block text-sm font-semibold text-text-primary",children:"Description"}),e.jsx("textarea",{id:"skill-description",value:p,onChange:s=>{m(s.target.value)},placeholder:"Generate release notes from merged pull requests",required:!0,rows:3,className:v("resize-y py-2.5")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"skill-repo-url",className:"mb-2 block text-sm font-semibold text-text-primary",children:"Repository URL"}),e.jsx("input",{id:"skill-repo-url",type:"url",value:u,onChange:s=>{f(s.target.value)},placeholder:"https://github.com/org/repo",required:!0,className:v("h-11")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"skill-path",className:"mb-2 block text-sm font-semibold text-text-primary",children:"Folder containing the SKILL.md"}),e.jsx("input",{id:"skill-path",value:i,onChange:s=>{y(s.target.value)},placeholder:"skills/release-notes",required:!0,className:v("h-11")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"skill-ref",className:"mb-2 block text-sm font-semibold text-text-primary",children:"Branch"}),e.jsx("input",{id:"skill-ref",value:n,onChange:s=>{x(s.target.value)},placeholder:"main",required:!0,className:v("h-11")})]}),e.jsxs("div",{className:"space-y-3",children:[d?e.jsx("p",{className:"text-failure-bg text-sm",children:d}):null,e.jsx(R,{type:"submit",disabled:!g,className:"w-full",children:"Import"})]})]})})})},K=_,q=(l,o,c)=>!l||o.toLowerCase().includes(l)||c.toLowerCase().includes(l),P=l=>"catalogId"in l,T=()=>{const{skillCatalog:l}=D(),o=H(),[c,k]=a.useState(""),[d,h]=a.useState([]),[b,p]=a.useState([]),[m,u]=a.useState(!0),[f,i]=a.useState(null),[y,n]=a.useState(null),[x,N]=a.useState(!1),[S,w]=a.useState(!1),g=a.useCallback(async()=>{if(l){u(!0),i(null);try{const[t,r]=await Promise.all([l.listSkills(),l.getSkillCatalog()]);h(t),p(r)}catch(t){i(E(t,"Failed to load skills"))}finally{u(!1)}}},[l]);a.useEffect(()=>{g()},[g]);const s=c.trim().toLowerCase(),C=a.useMemo(()=>d.filter(t=>q(s,t.name,t.description)),[d,s]),I=a.useMemo(()=>{const t=new Set(d.flatMap(r=>P(r)?[r.catalogId]:[]));return b.filter(r=>!t.has(r.id)&&q(s,r.name,r.description))},[b,d,s]),L=async(t,r=i)=>{N(!0),i(null);try{await t(),await g()}catch(j){throw r(E(j,"Request failed")),j}finally{N(!1)}};if(!l)return e.jsx("p",{className:"text-sm text-text-secondary",children:"Skills catalog is not available."});const B=t=>{L(async()=>{await l.createSkill({catalogId:t.id,name:t.name,description:t.description,repoURL:t.repoURL,path:t.path,ref:t.ref})}).catch(()=>{})},G=t=>{const r=l.deleteSkill;r&&L(async()=>{await r({id:t.id})}).catch(()=>{})},M=async t=>{n(null),await L(async()=>{await l.createSkill(t)},n),setTimeout(()=>{o==null||o.showSuccess({title:`${t.name} imported`})},0)},z=({key:t,name:r,description:j,action:O})=>e.jsxs("article",{className:"flex min-h-16 items-center gap-3 border-b border-border p-3 last:border-b-0",children:[e.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg border border-border bg-secondary-bg","aria-hidden":!0,children:e.jsx(F,{name:"lightbulb",className:"size-4.5 text-text-primary"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h5",{className:"truncate text-sm font-medium text-text-primary",children:r}),j?e.jsx("p",{className:"mt-0.5 truncate text-sm text-text-secondary",children:j}):null]}),O]},t),U=C.length>0||I.length>0;return e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"text-xl font-semibold tracking-tight text-text-primary",children:"Skills"}),e.jsx("p",{className:"mt-1 text-sm text-text-secondary",children:"Use built-in skills or import custom skills from GitHub."}),f?e.jsx("p",{className:"mt-3 rounded-md border border-failure-bg/30 bg-failure-bg/10 px-3 py-2 text-sm text-failure-bg",children:f}):null,e.jsxs("div",{className:"mt-4 flex min-h-0 flex-1 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx($,{query:c,setQuery:k,placeholder:"Search skills"})}),e.jsxs(R,{variant:"secondary",type:"button",className:"shrink-0",disabled:x,onClick:()=>{n(null),w(!0)},children:[e.jsx(F,{name:"github",className:"size-4"}),"Import from GitHub"]})]}),e.jsxs("div",{className:"flex flex-1 flex-col gap-5 overflow-y-auto pb-1",children:[m?e.jsx("p",{className:"py-8 text-center text-sm text-text-secondary",children:"Loading…"}):null,!m&&C.length>0?e.jsxs("section",{"aria-labelledby":"enabled-skills-heading",children:[e.jsxs("h4",{id:"enabled-skills-heading",className:"mb-2 text-[0.8125rem] font-semibold uppercase text-text-secondary",children:["Enabled · ",C.length]}),e.jsx("div",{className:"overflow-hidden rounded-xl border border-border bg-card-bg",children:C.map(t=>z({key:t.id,name:t.name,description:t.description,action:l.deleteSkill?e.jsx(R,{variant:"outline",size:"sm",type:"button",disabled:x,"aria-label":`Remove ${t.name}`,onClick:()=>{G(t)},children:"Remove"}):null}))})]}):null,!m&&I.length>0?e.jsxs("section",{"aria-labelledby":"available-skills-heading",children:[e.jsxs("h4",{id:"available-skills-heading",className:"mb-2 text-[0.8125rem] font-semibold uppercase text-text-secondary",children:["Available · ",I.length]}),e.jsx("div",{className:"overflow-hidden rounded-xl border border-border bg-card-bg",children:I.map(t=>z({key:t.id,name:t.name,description:t.description,action:e.jsx(R,{variant:"outline",size:"sm",type:"button",disabled:x,"aria-label":`Enable ${t.name}`,onClick:()=>{B(t)},children:"Enable"})}))})]}):null,!m&&!U?e.jsx("div",{className:"flex flex-1 items-center justify-center rounded-xl border border-dashed border-border p-8 text-center text-sm text-text-secondary",children:s?`No skills match “${c.trim()}”.`:"No skills yet."}):null]})]}),e.jsx(K,{open:S,onOpenChange:t=>{w(t),t||n(null)},onImport:M,busy:x,error:y})]})},J=T;export{J as default};
1
+ import{s as D,t as H,r as a,v as z,j as e,w as $,B as R,I as F,y as Q,E as v}from"./index-ChCGltYc.js";var _=({open:l,onOpenChange:o,onImport:c,busy:k=!1,error:d})=>{const[h,b]=a.useState(""),[p,m]=a.useState(""),[u,f]=a.useState(""),[i,y]=a.useState(""),[n,x]=a.useState(""),N=()=>{b(""),m(""),f(""),y(""),x("")},S=()=>{N(),o(!1)},w=async s=>{if(s.preventDefault(),!(!h.trim()||!p.trim()||!u.trim()||!i.trim()||!n.trim()||k))try{await c({name:h.trim(),description:p.trim(),repoURL:u.trim(),path:i.trim(),ref:n.trim()}),S()}catch{}},g=!!(h.trim()&&p.trim()&&u.trim()&&i.trim()&&n.trim())&&!k;return e.jsx(Q,{open:l,onOpenChange:s=>{s||S()},title:"Import from GitHub",description:"Import a skill from a SKILL.md file in a GitHub repository.",headerIcon:e.jsx("span",{className:"flex size-11 shrink-0 items-center justify-center rounded-lg border border-border bg-secondary-bg text-text-primary",children:e.jsx(F,{name:"github",className:"size-5"})}),contentSized:!0,className:"md:max-w-2xl",children:e.jsx("form",{onSubmit:s=>void w(s),children:e.jsxs("div",{className:"space-y-5 px-5 py-5 md:px-6",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"skill-name",className:"mb-2 block text-sm font-semibold text-text-primary",children:"Name"}),e.jsx("input",{id:"skill-name",value:h,onChange:s=>{b(s.target.value)},placeholder:"release-notes",autoFocus:!0,required:!0,className:v("h-11")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"skill-description",className:"mb-2 block text-sm font-semibold text-text-primary",children:"Description"}),e.jsx("textarea",{id:"skill-description",value:p,onChange:s=>{m(s.target.value)},placeholder:"Generate release notes from merged pull requests",required:!0,rows:3,className:v("resize-y py-2.5")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"skill-repo-url",className:"mb-2 block text-sm font-semibold text-text-primary",children:"Repository URL"}),e.jsx("input",{id:"skill-repo-url",type:"url",value:u,onChange:s=>{f(s.target.value)},placeholder:"https://github.com/org/repo",required:!0,className:v("h-11")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"skill-path",className:"mb-2 block text-sm font-semibold text-text-primary",children:"Folder containing the SKILL.md"}),e.jsx("input",{id:"skill-path",value:i,onChange:s=>{y(s.target.value)},placeholder:"skills/release-notes",required:!0,className:v("h-11")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"skill-ref",className:"mb-2 block text-sm font-semibold text-text-primary",children:"Branch"}),e.jsx("input",{id:"skill-ref",value:n,onChange:s=>{x(s.target.value)},placeholder:"main",required:!0,className:v("h-11")})]}),e.jsxs("div",{className:"space-y-3",children:[d?e.jsx("p",{className:"text-failure-bg text-sm",children:d}):null,e.jsx(R,{type:"submit",disabled:!g,className:"w-full",children:"Import"})]})]})})})},K=_,B=(l,o,c)=>!l||o.toLowerCase().includes(l)||c.toLowerCase().includes(l),P=l=>"catalogId"in l,T=()=>{const{skillCatalog:l}=D(),o=H(),[c,k]=a.useState(""),[d,h]=a.useState([]),[b,p]=a.useState([]),[m,u]=a.useState(!0),[f,i]=a.useState(null),[y,n]=a.useState(null),[x,N]=a.useState(!1),[S,w]=a.useState(!1),g=a.useCallback(async()=>{if(l){u(!0),i(null);try{const[t,r]=await Promise.all([l.listSkills(),l.getSkillCatalog()]);h(t),p(r)}catch(t){i(z(t,"Failed to load skills"))}finally{u(!1)}}},[l]);a.useEffect(()=>{g()},[g]);const s=c.trim().toLowerCase(),C=a.useMemo(()=>d.filter(t=>B(s,t.name,t.description)),[d,s]),I=a.useMemo(()=>{const t=new Set(d.flatMap(r=>P(r)?[r.catalogId]:[]));return b.filter(r=>!t.has(r.id)&&B(s,r.name,r.description))},[b,d,s]),L=async(t,r=i)=>{N(!0),i(null);try{await t(),await g()}catch(j){throw r(z(j,"Request failed")),j}finally{N(!1)}};if(!l)return e.jsx("p",{className:"text-sm text-text-secondary",children:"Skills catalog is not available."});const G=t=>{L(async()=>{await l.createSkill({catalogId:t.id,name:t.name,description:t.description,repoURL:t.repoURL,path:t.path,ref:t.ref})}).catch(()=>{})},M=t=>{const r=l.deleteSkill;r&&L(async()=>{await r({id:t.id})}).catch(()=>{})},U=async t=>{n(null),await L(async()=>{await l.createSkill(t)},n),setTimeout(()=>{o==null||o.showSuccess({title:`${t.name} imported`})},0)},E=({key:t,name:r,description:j,action:O})=>e.jsxs("article",{className:"flex min-h-16 items-center gap-3 border-b border-border p-3 last:border-b-0",children:[e.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg border border-border bg-secondary-bg","aria-hidden":!0,children:e.jsx(F,{name:"lightbulb",className:"size-4.5 text-text-primary"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h5",{className:"truncate text-sm font-medium text-text-primary",children:r}),j?e.jsx("p",{className:"mt-0.5 truncate text-sm text-text-secondary",children:j}):null]}),O]},t),q=C.length>0||I.length>0;return e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"text-xl font-semibold tracking-tight text-text-primary",children:"Skills"}),e.jsx("p",{className:"mt-1 text-sm text-text-secondary",children:"Use built-in skills or import custom skills from GitHub."}),f?e.jsx("p",{className:"mt-3 rounded-md border border-failure-bg/30 bg-failure-bg/10 px-3 py-2 text-sm text-failure-bg",children:f}):null,e.jsxs("div",{className:"mt-4 flex min-h-0 flex-1 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx($,{query:c,setQuery:k,placeholder:"Search skills"})}),e.jsxs(R,{variant:"secondary",type:"button",className:"shrink-0",disabled:x,onClick:()=>{n(null),w(!0)},children:[e.jsx(F,{name:"github",className:"size-4"}),"Import from GitHub"]})]}),e.jsxs("div",{className:"flex flex-1 flex-col gap-5 overflow-y-auto pb-1",children:[m?e.jsx("p",{className:"py-8 text-center text-sm text-text-secondary",children:"Loading…"}):null,!m&&C.length>0?e.jsxs("section",{"aria-labelledby":"enabled-skills-heading",children:[e.jsxs("h4",{id:"enabled-skills-heading",className:"mb-2 text-[0.8125rem] font-semibold uppercase text-text-secondary",children:["Enabled · ",C.length]}),e.jsx("div",{className:"overflow-hidden rounded-xl border border-border bg-card-bg",children:C.map(t=>E({key:t.id,name:t.name,description:t.description,action:l.deleteSkill?e.jsx(R,{variant:"outline",size:"sm",type:"button",disabled:x,"aria-label":`Remove ${t.name}`,onClick:()=>{M(t)},children:"Remove"}):null}))})]}):null,!m&&I.length>0?e.jsxs("section",{"aria-labelledby":"available-skills-heading",children:[e.jsxs("h4",{id:"available-skills-heading",className:"mb-2 text-[0.8125rem] font-semibold uppercase text-text-secondary",children:["Available · ",I.length]}),e.jsx("div",{className:"overflow-hidden rounded-xl border border-border bg-card-bg",children:I.map(t=>E({key:t.id,name:t.name,description:t.description,action:e.jsx(R,{variant:"outline",size:"sm",type:"button",disabled:x,"aria-label":`Enable ${t.name}`,onClick:()=>{G(t)},children:"Enable"})}))})]}):null,!m&&!q?e.jsx("div",{className:"flex flex-1 items-center justify-center rounded-xl border border-dashed border-border p-8 text-center text-sm text-text-secondary",children:s?`No skills match “${c.trim()}”.`:"No skills yet."}):null]})]}),e.jsx(K,{open:S,onOpenChange:t=>{w(t),t||n(null)},onImport:U,busy:x,error:y})]})},J=T;export{J as default};
@@ -1 +1 @@
1
- import{S as d}from"./chunk-NBMP2XNL-DdVXEaJy.js";import{c as x,r,j as e,C as f,I as p,f as b,e as h}from"./index-B8NomNE2.js";import"./chunk-WFC3W4C3-DXFwnpmH.js";function w({className:u}){const m=x("BrandLogo"),[a,o]=r.useState(!1),i=r.useRef(null),s=r.useRef(null),l=r.useRef(!1);return r.useEffect(()=>{if(!a)return;const t=n=>{var c;n.key==="Escape"&&!((c=s.current)!=null&&c.querySelector("dialog[open]"))&&o(!1)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[a]),r.useEffect(()=>{var t,n;if(a){l.current=!0,(t=s.current)==null||t.focus();return}l.current&&((n=i.current)==null||n.focus(),l.current=!1)},[a]),e.jsxs("div",{className:h("pointer-events-none relative h-full min-h-0 w-full",u),children:[a?e.jsx("div",{ref:s,"data-aui-compact-layout":!0,className:"pointer-events-auto absolute right-[max(1.25rem,env(safe-area-inset-right,0px))] bottom-[calc(5.25rem+env(safe-area-inset-bottom,0px))] z-[19] flex h-[min(560px,calc(100%-6.5rem-env(safe-area-inset-bottom,0px)))] max-h-[calc(100%-6.5rem)] w-[min(380px,calc(100%-2.5rem))] flex-col overflow-hidden rounded-xl border border-border bg-primary-bg shadow-[0_16px_48px_color-mix(in_oklab,var(--shadow-color)_14%,transparent)] outline-none",role:"dialog","aria-modal":!0,"aria-label":"Chat",tabIndex:-1,children:e.jsx(f,{children:e.jsx(d,{threadHeaderEnd:e.jsx("button",{type:"button","aria-label":"Close",title:"Close",className:b({variant:"ghost",size:"icon"}),onClick:()=>o(!1),children:e.jsx(p,{name:"xmark"})})})})}):null,e.jsx("button",{ref:i,type:"button",className:"pointer-events-auto absolute right-[max(1.25rem,env(safe-area-inset-right,0px))] bottom-[max(1.25rem,env(safe-area-inset-bottom,0px))] z-20 flex size-14 cursor-pointer items-center justify-center rounded-full text-sm font-medium shadow-[0_8px_24px_color-mix(in_oklab,var(--primary-button-bg)_45%,transparent)]",style:{backgroundColor:"var(--primary-button-bg)",color:"var(--primary-button-text)"},"aria-expanded":a,"aria-label":a?"Close chat":"Open chat",onClick:()=>o(t=>!t),children:a?e.jsx("span",{"aria-hidden":!0,className:"text-xl leading-none",children:"×"}):e.jsx(m,{className:"size-6"})})]})}export{w as WidgetLayout};
1
+ import{S as d}from"./chunk-7EEOWDLE-BIwInB6G.js";import{c as x,r,j as e,C as f,I as p,f as b,e as h}from"./index-ChCGltYc.js";import"./chunk-LRQHHZDX-eb14Z2nA.js";function w({className:u}){const m=x("BrandLogo"),[a,o]=r.useState(!1),i=r.useRef(null),s=r.useRef(null),l=r.useRef(!1);return r.useEffect(()=>{if(!a)return;const t=n=>{var c;n.key==="Escape"&&!((c=s.current)!=null&&c.querySelector("dialog[open]"))&&o(!1)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[a]),r.useEffect(()=>{var t,n;if(a){l.current=!0,(t=s.current)==null||t.focus();return}l.current&&((n=i.current)==null||n.focus(),l.current=!1)},[a]),e.jsxs("div",{className:h("pointer-events-none relative h-full min-h-0 w-full",u),children:[a?e.jsx("div",{ref:s,"data-aui-compact-layout":!0,className:"pointer-events-auto absolute right-[max(1.25rem,env(safe-area-inset-right,0px))] bottom-[calc(5.25rem+env(safe-area-inset-bottom,0px))] z-[19] flex h-[min(560px,calc(100%-6.5rem-env(safe-area-inset-bottom,0px)))] max-h-[calc(100%-6.5rem)] w-[min(380px,calc(100%-2.5rem))] flex-col overflow-hidden rounded-xl border border-border bg-primary-bg shadow-[0_16px_48px_color-mix(in_oklab,var(--shadow-color)_14%,transparent)] outline-none",role:"dialog","aria-modal":!0,"aria-label":"Chat",tabIndex:-1,children:e.jsx(f,{children:e.jsx(d,{threadHeaderEnd:e.jsx("button",{type:"button","aria-label":"Close",title:"Close",className:b({variant:"ghost",size:"icon"}),onClick:()=>o(!1),children:e.jsx(p,{name:"xmark"})})})})}):null,e.jsx("button",{ref:i,type:"button",className:"pointer-events-auto absolute right-[max(1.25rem,env(safe-area-inset-right,0px))] bottom-[max(1.25rem,env(safe-area-inset-bottom,0px))] z-20 flex size-14 cursor-pointer items-center justify-center rounded-full text-sm font-medium shadow-[0_8px_24px_color-mix(in_oklab,var(--primary-button-bg)_45%,transparent)]",style:{backgroundColor:"var(--primary-button-bg)",color:"var(--primary-button-text)"},"aria-expanded":a,"aria-label":a?"Close chat":"Open chat",onClick:()=>o(t=>!t),children:a?e.jsx("span",{"aria-hidden":!0,className:"text-xl leading-none",children:"×"}):e.jsx(m,{className:"size-6"})})]})}export{w as WidgetLayout};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SettingsBuilder-64Y33NP3-BQNwNwxh.js","assets/index-B8NomNE2.js","assets/index-DEKCw40W.css"])))=>i.map(i=>d[i]);
2
- import{r as t,u as m,a as j,c as n,j as e,S as p,T as f,I as S,f as v,g as b,e as g,_ as N}from"./index-B8NomNE2.js";import{N as y,S as A}from"./chunk-WFC3W4C3-DXFwnpmH.js";var C=t.lazy(()=>N(()=>import("./SettingsBuilder-64Y33NP3-BQNwNwxh.js"),__vite__mapDeps([0,1,2])));function E({className:l,threadHeaderEnd:o}){const[c,r]=t.useState("thread"),i=m(),s=j(),d=n("ClearChatButton"),x=n("SaveAgentButton"),u=n("SelectAgentEmptyState"),a=(s==null?void 0:s.mode.status)==="idle",h=(s==null?void 0:s.settingsOpen)===!0;return t.useEffect(()=>{a||Promise.resolve(i.threads().switchToNewThread()).catch(()=>{})},[i,a]),e.jsxs("div",{className:g("flex h-full min-h-0 flex-col",l),children:[h?e.jsx("div",{className:"min-h-0 flex-1",children:e.jsx(t.Suspense,{fallback:e.jsxs("div",{className:"flex h-full items-center justify-center",role:"status","aria-live":"polite","aria-busy":"true",children:[e.jsx(p,{size:28,className:"text-text-primary"}),e.jsx("span",{className:"sr-only",children:"Loading"})]}),children:e.jsx(C,{})})}):c==="list"?e.jsx(f,{onThreadOpen:()=>r("thread")}):e.jsxs(e.Fragment,{children:[e.jsxs("header",{className:"flex shrink-0 items-center gap-1 border-b border-border px-2 py-1.5",children:[e.jsx("button",{type:"button","aria-label":"Sessions",title:"Sessions",className:v({variant:"ghost",size:"icon"}),onClick:()=>r("list"),children:e.jsx(S,{name:"clock-rotate-left"})}),e.jsx(y,{}),e.jsx("span",{className:"min-w-0 flex-1"}),e.jsx(d,{}),e.jsx(x,{}),o]}),e.jsx("div",{className:"min-h-0 flex-1",children:a?e.jsx(u,{}):e.jsx(b,{})})]}),e.jsx("footer",{className:"flex shrink-0 justify-end border-t border-border px-2 py-1.5",children:e.jsx(A,{},"shell-actions")})]})}export{E as S};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SettingsBuilder-26XSGIHK-DmgjXL0m.js","assets/index-ChCGltYc.js","assets/index-DEKCw40W.css"])))=>i.map(i=>d[i]);
2
+ import{r as t,u as m,a as j,c as n,j as e,S as p,T as f,I as S,f as v,g as b,e as g,_ as N}from"./index-ChCGltYc.js";import{N as y,S as A}from"./chunk-LRQHHZDX-eb14Z2nA.js";var C=t.lazy(()=>N(()=>import("./SettingsBuilder-26XSGIHK-DmgjXL0m.js"),__vite__mapDeps([0,1,2])));function E({className:l,threadHeaderEnd:o}){const[c,r]=t.useState("thread"),i=m(),s=j(),d=n("ClearChatButton"),x=n("SaveAgentButton"),u=n("SelectAgentEmptyState"),a=(s==null?void 0:s.mode.status)==="idle",h=(s==null?void 0:s.settingsOpen)===!0;return t.useEffect(()=>{a||Promise.resolve(i.threads().switchToNewThread()).catch(()=>{})},[i,a]),e.jsxs("div",{className:g("flex h-full min-h-0 flex-col",l),children:[h?e.jsx("div",{className:"min-h-0 flex-1",children:e.jsx(t.Suspense,{fallback:e.jsxs("div",{className:"flex h-full items-center justify-center",role:"status","aria-live":"polite","aria-busy":"true",children:[e.jsx(p,{size:28,className:"text-text-primary"}),e.jsx("span",{className:"sr-only",children:"Loading"})]}),children:e.jsx(C,{})})}):c==="list"?e.jsx(f,{onThreadOpen:()=>r("thread")}):e.jsxs(e.Fragment,{children:[e.jsxs("header",{className:"flex shrink-0 items-center gap-1 border-b border-border px-2 py-1.5",children:[e.jsx("button",{type:"button","aria-label":"Sessions",title:"Sessions",className:v({variant:"ghost",size:"icon"}),onClick:()=>r("list"),children:e.jsx(S,{name:"clock-rotate-left"})}),e.jsx(y,{}),e.jsx("span",{className:"min-w-0 flex-1"}),e.jsx(d,{}),e.jsx(x,{}),o]}),e.jsx("div",{className:"min-h-0 flex-1",children:a?e.jsx(u,{}):e.jsx(b,{})})]}),e.jsx("footer",{className:"flex shrink-0 justify-end border-t border-border px-2 py-1.5",children:e.jsx(A,{},"shell-actions")})]})}export{E as S};
@@ -1 +1 @@
1
- import{h,j as e,I as n,i as u,e as o,a as g,k as x,l as p,m as b,c as S,f as r}from"./index-B8NomNE2.js";function k({className:a}){const t=h();return t===null?null:e.jsxs("h1",{className:o("flex min-w-0 items-center gap-1.5 px-1 text-sm font-medium text-text-primary",a),children:[e.jsx(n,{name:"robot",className:"size-3.5 shrink-0"}),e.jsx("span",{className:"truncate",title:t.name,children:t.name}),t.isEditing?e.jsx(u,{content:"Try changes here, then choose Update agent to save.",side:"bottom",children:e.jsxs("span",{className:"border-warning-bg/40 bg-warning-bg/10 text-warning-bg inline-flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium",children:[e.jsx(n,{name:"pencil",className:"size-3"}),"Editing"]})}):null]})}function f({className:a}){var l;const t=g(),c=x(),i=p(),{mode:s,setTheme:m}=b(),d=S("ShellActionsActionSlot");return e.jsxs("div",{className:o("flex shrink-0 items-center gap-1 text-text-primary",a),children:[e.jsx("button",{type:"button","aria-label":s==="dark"?"Switch to light theme":"Switch to dark theme",title:s==="dark"?"Light theme":"Dark theme",className:r({variant:"ghost",size:"icon"}),onClick:()=>m(s==="dark"?"light":"dark"),children:e.jsx(n,{name:s==="dark"?"sun":"moon"})}),t!=null&&c!=null&&((l=i==null?void 0:i.settings)==null?void 0:l.enabled)!==!1?e.jsx("button",{type:"button","aria-label":"Settings",title:"Settings","aria-expanded":t.settingsOpen,className:r({variant:"ghost",size:"icon"}),onClick:()=>t.setSettingsOpen(!0),children:e.jsx(n,{name:"settings"})}):null,e.jsx(d,{})]})}export{k as N,f as S};
1
+ import{h,j as e,I as n,i as u,e as o,a as g,k as x,l as p,m as b,c as S,f as r}from"./index-ChCGltYc.js";function k({className:a}){const t=h();return t===null?null:e.jsxs("h1",{className:o("flex min-w-0 items-center gap-1.5 px-1 text-sm font-medium text-text-primary",a),children:[e.jsx(n,{name:"robot",className:"size-3.5 shrink-0"}),e.jsx("span",{className:"truncate",title:t.name,children:t.name}),t.isEditing?e.jsx(u,{content:"Try changes here, then choose Update agent to save.",side:"bottom",children:e.jsxs("span",{className:"border-warning-bg/40 bg-warning-bg/10 text-warning-bg inline-flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium",children:[e.jsx(n,{name:"pencil",className:"size-3"}),"Editing"]})}):null]})}function f({className:a}){var l;const t=g(),c=x(),i=p(),{mode:s,setTheme:m}=b(),d=S("ShellActionsActionSlot");return e.jsxs("div",{className:o("flex shrink-0 items-center gap-1 text-text-primary",a),children:[e.jsx("button",{type:"button","aria-label":s==="dark"?"Switch to light theme":"Switch to dark theme",title:s==="dark"?"Light theme":"Dark theme",className:r({variant:"ghost",size:"icon"}),onClick:()=>m(s==="dark"?"light":"dark"),children:e.jsx(n,{name:s==="dark"?"sun":"moon"})}),t!=null&&c!=null&&((l=i==null?void 0:i.settings)==null?void 0:l.enabled)!==!1?e.jsx("button",{type:"button","aria-label":"Settings",title:"Settings","aria-expanded":t.settingsOpen,className:r({variant:"ghost",size:"icon"}),onClick:()=>t.setSettingsOpen(!0),children:e.jsx(n,{name:"settings"})}):null,e.jsx(d,{})]})}export{k as N,f as S};
@@ -1 +1 @@
1
- import{c as h}from"./workers-CfU2h0GU.js";import{C as c,H as u,D as p,a as m,R as f,b as _,c as w,d as k,F as v,e as D,S as P,f as R,g as I}from"./lspLanguageFeatures-Tavpp1a0.js";import{h as y,i as T,j as U,t as x,k as j}from"./lspLanguageFeatures-Tavpp1a0.js";import{l as s}from"./index-CKMEtdQA.js";import"./index-B8NomNE2.js";const C=120*1e3;class W{constructor(n){this._defaults=n,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>C&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=h({moduleId:"vs/language/css/cssWorker",createWorker:()=>new Worker(new URL("/assets/css.worker-CqwWTjeG.js",import.meta.url),{type:"module"}),label:this._defaults.languageId,createData:{options:this._defaults.options,languageId:this._defaults.languageId}}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...n){let e;return this._getClient().then(a=>{e=a}).then(a=>{if(this._worker)return this._worker.withSyncedResources(n)}).then(a=>e)}}function L(o){const n=[],e=[],a=new W(o);n.push(a);const r=(...t)=>a.getLanguageServiceWorker(...t);function l(){const{languageId:t,modeConfiguration:i}=o;g(e),i.completionItems&&e.push(s.registerCompletionItemProvider(t,new c(r,["/","-",":"]))),i.hovers&&e.push(s.registerHoverProvider(t,new u(r))),i.documentHighlights&&e.push(s.registerDocumentHighlightProvider(t,new p(r))),i.definitions&&e.push(s.registerDefinitionProvider(t,new m(r))),i.references&&e.push(s.registerReferenceProvider(t,new f(r))),i.documentSymbols&&e.push(s.registerDocumentSymbolProvider(t,new _(r))),i.rename&&e.push(s.registerRenameProvider(t,new w(r))),i.colors&&e.push(s.registerColorProvider(t,new k(r))),i.foldingRanges&&e.push(s.registerFoldingRangeProvider(t,new v(r))),i.diagnostics&&e.push(new D(t,r,o.onDidChange)),i.selectionRanges&&e.push(s.registerSelectionRangeProvider(t,new P(r))),i.documentFormattingEdits&&e.push(s.registerDocumentFormattingEditProvider(t,new R(r))),i.documentRangeFormattingEdits&&e.push(s.registerDocumentRangeFormattingEditProvider(t,new I(r)))}return l(),n.push(d(e)),d(n)}function d(o){return{dispose:()=>g(o)}}function g(o){for(;o.length;)o.pop().dispose()}export{c as CompletionAdapter,m as DefinitionAdapter,D as DiagnosticsAdapter,k as DocumentColorAdapter,R as DocumentFormattingEditProvider,p as DocumentHighlightAdapter,y as DocumentLinkAdapter,I as DocumentRangeFormattingEditProvider,_ as DocumentSymbolAdapter,v as FoldingRangeAdapter,u as HoverAdapter,f as ReferenceAdapter,w as RenameAdapter,P as SelectionRangeAdapter,W as WorkerManager,T as fromPosition,U as fromRange,L as setupMode,x as toRange,j as toTextEdit};
1
+ import{c as h}from"./workers-fMwav4jB.js";import{C as c,H as u,D as p,a as m,R as f,b as _,c as w,d as k,F as v,e as D,S as P,f as R,g as I}from"./lspLanguageFeatures-B6VPH2Sv.js";import{h as y,i as T,j as U,t as x,k as j}from"./lspLanguageFeatures-B6VPH2Sv.js";import{l as s}from"./index-DFQqb6R1.js";import"./index-ChCGltYc.js";const C=120*1e3;class W{constructor(n){this._defaults=n,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>C&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=h({moduleId:"vs/language/css/cssWorker",createWorker:()=>new Worker(new URL("/assets/css.worker-CqwWTjeG.js",import.meta.url),{type:"module"}),label:this._defaults.languageId,createData:{options:this._defaults.options,languageId:this._defaults.languageId}}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...n){let e;return this._getClient().then(a=>{e=a}).then(a=>{if(this._worker)return this._worker.withSyncedResources(n)}).then(a=>e)}}function L(o){const n=[],e=[],a=new W(o);n.push(a);const r=(...t)=>a.getLanguageServiceWorker(...t);function l(){const{languageId:t,modeConfiguration:i}=o;g(e),i.completionItems&&e.push(s.registerCompletionItemProvider(t,new c(r,["/","-",":"]))),i.hovers&&e.push(s.registerHoverProvider(t,new u(r))),i.documentHighlights&&e.push(s.registerDocumentHighlightProvider(t,new p(r))),i.definitions&&e.push(s.registerDefinitionProvider(t,new m(r))),i.references&&e.push(s.registerReferenceProvider(t,new f(r))),i.documentSymbols&&e.push(s.registerDocumentSymbolProvider(t,new _(r))),i.rename&&e.push(s.registerRenameProvider(t,new w(r))),i.colors&&e.push(s.registerColorProvider(t,new k(r))),i.foldingRanges&&e.push(s.registerFoldingRangeProvider(t,new v(r))),i.diagnostics&&e.push(new D(t,r,o.onDidChange)),i.selectionRanges&&e.push(s.registerSelectionRangeProvider(t,new P(r))),i.documentFormattingEdits&&e.push(s.registerDocumentFormattingEditProvider(t,new R(r))),i.documentRangeFormattingEdits&&e.push(s.registerDocumentRangeFormattingEditProvider(t,new I(r)))}return l(),n.push(d(e)),d(n)}function d(o){return{dispose:()=>g(o)}}function g(o){for(;o.length;)o.pop().dispose()}export{c as CompletionAdapter,m as DefinitionAdapter,D as DiagnosticsAdapter,k as DocumentColorAdapter,R as DocumentFormattingEditProvider,p as DocumentHighlightAdapter,y as DocumentLinkAdapter,I as DocumentRangeFormattingEditProvider,_ as DocumentSymbolAdapter,v as FoldingRangeAdapter,u as HoverAdapter,f as ReferenceAdapter,w as RenameAdapter,P as SelectionRangeAdapter,W as WorkerManager,T as fromPosition,U as fromRange,L as setupMode,x as toRange,j as toTextEdit};
@@ -1,3 +1,3 @@
1
- import{l as c}from"./index-CKMEtdQA.js";import"./index-B8NomNE2.js";const s=["assign","flush","ftl","return","global","import","include","break","continue","local","nested","nt","setting","stop","t","lt","rt","fallback"],d=["attempt","autoesc","autoEsc","compress","comment","escape","noescape","function","if","list","items","sep","macro","noparse","noParse","noautoesc","noAutoEsc","outputformat","switch","visit","recurse"],r={close:">",id:"angle",open:"<"},a={close:"\\]",id:"bracket",open:"\\["},F={close:"[>\\]]",id:"auto",open:"[<\\[]"},k={close:"\\}",id:"dollar",open1:"\\$",open2:"\\{"},p={close:"\\]",id:"bracket",open1:"\\[",open2:"="};function l(t){return{brackets:[["<",">"],["[","]"],["(",")"],["{","}"]],comments:{blockComment:[`${t.open}--`,`--${t.close}`]},autoCloseBefore:`
1
+ import{l as c}from"./index-DFQqb6R1.js";import"./index-ChCGltYc.js";const s=["assign","flush","ftl","return","global","import","include","break","continue","local","nested","nt","setting","stop","t","lt","rt","fallback"],d=["attempt","autoesc","autoEsc","compress","comment","escape","noescape","function","if","list","items","sep","macro","noparse","noParse","noautoesc","noAutoEsc","outputformat","switch","visit","recurse"],r={close:">",id:"angle",open:"<"},a={close:"\\]",id:"bracket",open:"\\["},F={close:"[>\\]]",id:"auto",open:"[<\\[]"},k={close:"\\}",id:"dollar",open1:"\\$",open2:"\\{"},p={close:"\\]",id:"bracket",open1:"\\[",open2:"="};function l(t){return{brackets:[["<",">"],["[","]"],["(",")"],["{","}"]],comments:{blockComment:[`${t.open}--`,`--${t.close}`]},autoCloseBefore:`
2
2
  \r }]),.:;=`,autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string"]}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],folding:{markers:{start:new RegExp(`${t.open}#(?:${d.join("|")})([^/${t.close}]*(?!/)${t.close})[^${t.open}]*$`),end:new RegExp(`${t.open}/#(?:${d.join("|")})[\\r\\n\\t ]*>`)}},onEnterRules:[{beforeText:new RegExp(`${t.open}#(?!(?:${s.join("|")}))([a-zA-Z_]+)([^/${t.close}]*(?!/)${t.close})[^${t.open}]*$`),afterText:new RegExp(`^${t.open}/#([a-zA-Z_]+)[\\r\\n\\t ]*${t.close}$`),action:{indentAction:c.IndentAction.IndentOutdent}},{beforeText:new RegExp(`${t.open}#(?!(?:${s.join("|")}))([a-zA-Z_]+)([^/${t.close}]*(?!/)${t.close})[^${t.open}]*$`),action:{indentAction:c.IndentAction.Indent}}]}}function g(){return{brackets:[["<",">"],["[","]"],["(",")"],["{","}"]],autoCloseBefore:`
3
3
  \r }]),.:;=`,autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string"]}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],folding:{markers:{start:new RegExp(`[<\\[]#(?:${d.join("|")})([^/>\\]]*(?!/)[>\\]])[^<\\[]*$`),end:new RegExp(`[<\\[]/#(?:${d.join("|")})[\\r\\n\\t ]*>`)}},onEnterRules:[{beforeText:new RegExp(`[<\\[]#(?!(?:${s.join("|")}))([a-zA-Z_]+)([^/>\\]]*(?!/)[>\\]])[^[<\\[]]*$`),afterText:new RegExp("^[<\\[]/#([a-zA-Z_]+)[\\r\\n\\t ]*[>\\]]$"),action:{indentAction:c.IndentAction.IndentOutdent}},{beforeText:new RegExp(`[<\\[]#(?!(?:${s.join("|")}))([a-zA-Z_]+)([^/>\\]]*(?!/)[>\\]])[^[<\\[]]*$`),action:{indentAction:c.IndentAction.Indent}}]}}function _(t,n){const i=`_${t.id}_${n.id}`,e=u=>u.replace(/__id__/g,i),o=u=>{const m=u.source.replace(/__id__/g,i);return new RegExp(m,u.flags)};return{unicode:!0,includeLF:!1,start:e("default__id__"),ignoreCase:!1,defaultToken:"invalid",tokenPostfix:".freemarker2",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],[e("open__id__")]:new RegExp(t.open),[e("close__id__")]:new RegExp(t.close),[e("iOpen1__id__")]:new RegExp(n.open1),[e("iOpen2__id__")]:new RegExp(n.open2),[e("iClose__id__")]:new RegExp(n.close),[e("startTag__id__")]:o(/(@open__id__)(#)/),[e("endTag__id__")]:o(/(@open__id__)(\/#)/),[e("startOrEndTag__id__")]:o(/(@open__id__)(\/?#)/),[e("closeTag1__id__")]:o(/((?:@blank)*)(@close__id__)/),[e("closeTag2__id__")]:o(/((?:@blank)*\/?)(@close__id__)/),blank:/[ \t\n\r]/,keywords:["false","true","in","as","using"],directiveStartCloseTag1:/attempt|recover|sep|auto[eE]sc|no(?:autoe|AutoE)sc|compress|default|no[eE]scape|comment|no[pP]arse/,directiveStartCloseTag2:/else|break|continue|return|stop|flush|t|lt|rt|nt|nested|recurse|fallback|ftl/,directiveStartBlank:/if|else[iI]f|list|for[eE]ach|switch|case|assign|global|local|include|import|function|macro|transform|visit|stop|return|call|setting|output[fF]ormat|nested|recurse|escape|ftl|items/,directiveEndCloseTag1:/if|list|items|sep|recover|attempt|for[eE]ach|local|global|assign|function|macro|output[fF]ormat|auto[eE]sc|no(?:autoe|AutoE)sc|compress|transform|switch|escape|no[eE]scape/,escapedChar:/\\(?:[ntrfbgla\\'"\{=]|(?:x[0-9A-Fa-f]{1,4}))/,asciiDigit:/[0-9]/,integer:/[0-9]+/,nonEscapedIdStartChar:/[\$@-Z_a-z\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u1FFF\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183-\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3006\u3031-\u3035\u303B-\u303C\u3040-\u318F\u31A0-\u31BA\u31F0-\u31FF\u3300-\u337F\u3400-\u4DB5\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5-\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,escapedIdChar:/\\[\-\.:#]/,idStartChar:/(?:@nonEscapedIdStartChar)|(?:@escapedIdChar)/,id:/(?:@idStartChar)(?:(?:@idStartChar)|(?:@asciiDigit))*/,specialHashKeys:/\*\*|\*|false|true|in|as|using/,namedSymbols:/&lt;=|&gt;=|\\lte|\\lt|&lt;|\\gte|\\gt|&gt;|&amp;&amp;|\\and|-&gt;|->|==|!=|\+=|-=|\*=|\/=|%=|\+\+|--|<=|&&|\|\||:|\.\.\.|\.\.\*|\.\.<|\.\.!|\?\?|=|<|\+|-|\*|\/|%|\||\.\.|\?|!|&|\.|,|;/,arrows:["->","-&gt;"],delimiters:[";",":",",","."],stringOperators:["lte","lt","gte","gt"],noParseTags:["noparse","noParse","comment"],tokenizer:{[e("default__id__")]:[{include:e("@directive_token__id__")},{include:e("@interpolation_and_text_token__id__")}],[e("fmExpression__id__.directive")]:[{include:e("@blank_and_expression_comment_token__id__")},{include:e("@directive_end_token__id__")},{include:e("@expression_token__id__")}],[e("fmExpression__id__.interpolation")]:[{include:e("@blank_and_expression_comment_token__id__")},{include:e("@expression_token__id__")},{include:e("@greater_operators_token__id__")}],[e("inParen__id__.plain")]:[{include:e("@blank_and_expression_comment_token__id__")},{include:e("@directive_end_token__id__")},{include:e("@expression_token__id__")}],[e("inParen__id__.gt")]:[{include:e("@blank_and_expression_comment_token__id__")},{include:e("@expression_token__id__")},{include:e("@greater_operators_token__id__")}],[e("noSpaceExpression__id__")]:[{include:e("@no_space_expression_end_token__id__")},{include:e("@directive_end_token__id__")},{include:e("@expression_token__id__")}],[e("unifiedCall__id__")]:[{include:e("@unified_call_token__id__")}],[e("singleString__id__")]:[{include:e("@string_single_token__id__")}],[e("doubleString__id__")]:[{include:e("@string_double_token__id__")}],[e("rawSingleString__id__")]:[{include:e("@string_single_raw_token__id__")}],[e("rawDoubleString__id__")]:[{include:e("@string_double_raw_token__id__")}],[e("expressionComment__id__")]:[{include:e("@expression_comment_token__id__")}],[e("noParse__id__")]:[{include:e("@no_parse_token__id__")}],[e("terseComment__id__")]:[{include:e("@terse_comment_token__id__")}],[e("directive_token__id__")]:[[o(/(?:@startTag__id__)(@directiveStartCloseTag1)(?:@closeTag1__id__)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{cases:{"@noParseTags":{token:"tag",next:e("@noParse__id__.$3")},"@default":{token:"tag"}}},{token:"delimiter.directive"},{token:"@brackets.directive"}]],[o(/(?:@startTag__id__)(@directiveStartCloseTag2)(?:@closeTag2__id__)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:"delimiter.directive"},{token:"@brackets.directive"}]],[o(/(?:@startTag__id__)(@directiveStartBlank)(@blank)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:"",next:e("@fmExpression__id__.directive")}]],[o(/(?:@endTag__id__)(@directiveEndCloseTag1)(?:@closeTag1__id__)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:"delimiter.directive"},{token:"@brackets.directive"}]],[o(/(@open__id__)(@)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive",next:e("@unifiedCall__id__")}]],[o(/(@open__id__)(\/@)((?:(?:@id)(?:\.(?:@id))*)?)(?:@closeTag1__id__)/),[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:"delimiter.directive"},{token:"@brackets.directive"}]],[o(/(@open__id__)#--/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:{token:"comment",next:e("@terseComment__id__")}],[o(/(?:@startOrEndTag__id__)([a-zA-Z_]+)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag.invalid",next:e("@fmExpression__id__.directive")}]]],[e("interpolation_and_text_token__id__")]:[[o(/(@iOpen1__id__)(@iOpen2__id__)/),[{token:n.id==="bracket"?"@brackets.interpolation":"delimiter.interpolation"},{token:n.id==="bracket"?"delimiter.interpolation":"@brackets.interpolation",next:e("@fmExpression__id__.interpolation")}]],[/[\$#<\[\{]|(?:@blank)+|[^\$<#\[\{\n\r\t ]+/,{token:"source"}]],[e("string_single_token__id__")]:[[/[^'\\]/,{token:"string"}],[/@escapedChar/,{token:"string.escape"}],[/'/,{token:"string",next:"@pop"}]],[e("string_double_token__id__")]:[[/[^"\\]/,{token:"string"}],[/@escapedChar/,{token:"string.escape"}],[/"/,{token:"string",next:"@pop"}]],[e("string_single_raw_token__id__")]:[[/[^']+/,{token:"string.raw"}],[/'/,{token:"string.raw",next:"@pop"}]],[e("string_double_raw_token__id__")]:[[/[^"]+/,{token:"string.raw"}],[/"/,{token:"string.raw",next:"@pop"}]],[e("expression_token__id__")]:[[/(r?)(['"])/,{cases:{"r'":[{token:"keyword"},{token:"string.raw",next:e("@rawSingleString__id__")}],'r"':[{token:"keyword"},{token:"string.raw",next:e("@rawDoubleString__id__")}],"'":[{token:"source"},{token:"string",next:e("@singleString__id__")}],'"':[{token:"source"},{token:"string",next:e("@doubleString__id__")}]}}],[/(?:@integer)(?:\.(?:@integer))?/,{cases:{"(?:@integer)":{token:"number"},"@default":{token:"number.float"}}}],[/(\.)(@blank*)(@specialHashKeys)/,[{token:"delimiter"},{token:""},{token:"identifier"}]],[/(?:@namedSymbols)/,{cases:{"@arrows":{token:"meta.arrow"},"@delimiters":{token:"delimiter"},"@default":{token:"operators"}}}],[/@id/,{cases:{"@keywords":{token:"keyword.$0"},"@stringOperators":{token:"operators"},"@default":{token:"identifier"}}}],[/[\[\]\(\)\{\}]/,{cases:{"\\[":{cases:{"$S2==gt":{token:"@brackets",next:e("@inParen__id__.gt")},"@default":{token:"@brackets",next:e("@inParen__id__.plain")}}},"\\]":{cases:{...n.id==="bracket"?{"$S2==interpolation":{token:"@brackets.interpolation",next:"@popall"}}:{},...t.id==="bracket"?{"$S2==directive":{token:"@brackets.directive",next:"@popall"}}:{},[e("$S1==inParen__id__")]:{token:"@brackets",next:"@pop"},"@default":{token:"@brackets"}}},"\\(":{token:"@brackets",next:e("@inParen__id__.gt")},"\\)":{cases:{[e("$S1==inParen__id__")]:{token:"@brackets",next:"@pop"},"@default":{token:"@brackets"}}},"\\{":{cases:{"$S2==gt":{token:"@brackets",next:e("@inParen__id__.gt")},"@default":{token:"@brackets",next:e("@inParen__id__.plain")}}},"\\}":{cases:{...n.id==="bracket"?{}:{"$S2==interpolation":{token:"@brackets.interpolation",next:"@popall"}},[e("$S1==inParen__id__")]:{token:"@brackets",next:"@pop"},"@default":{token:"@brackets"}}}}}],[/\$\{/,{token:"delimiter.invalid"}]],[e("blank_and_expression_comment_token__id__")]:[[/(?:@blank)+/,{token:""}],[/[<\[][#!]--/,{token:"comment",next:e("@expressionComment__id__")}]],[e("directive_end_token__id__")]:[[/>/,t.id==="bracket"?{token:"operators"}:{token:"@brackets.directive",next:"@popall"}],[o(/(\/)(@close__id__)/),[{token:"delimiter.directive"},{token:"@brackets.directive",next:"@popall"}]]],[e("greater_operators_token__id__")]:[[/>/,{token:"operators"}],[/>=/,{token:"operators"}]],[e("no_space_expression_end_token__id__")]:[[/(?:@blank)+/,{token:"",switchTo:e("@fmExpression__id__.directive")}]],[e("unified_call_token__id__")]:[[/(@id)((?:@blank)+)/,[{token:"tag"},{token:"",next:e("@fmExpression__id__.directive")}]],[o(/(@id)(\/?)(@close__id__)/),[{token:"tag"},{token:"delimiter.directive"},{token:"@brackets.directive",next:"@popall"}]],[/./,{token:"@rematch",next:e("@noSpaceExpression__id__")}]],[e("no_parse_token__id__")]:[[o(/(@open__id__)(\/#?)([a-zA-Z]+)((?:@blank)*)(@close__id__)/),{cases:{"$S2==$3":[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:""},{token:"@brackets.directive",next:"@popall"}],"$S2==comment":[{token:"comment"},{token:"comment"},{token:"comment"},{token:"comment"},{token:"comment"}],"@default":[{token:"source"},{token:"source"},{token:"source"},{token:"source"},{token:"source"}]}}],[/[^<\[\-]+|[<\[\-]/,{cases:{"$S2==comment":{token:"comment"},"@default":{token:"source"}}}]],[e("expression_comment_token__id__")]:[[/--[>\]]/,{token:"comment",next:"@pop"}],[/[^\->\]]+|[>\]\-]/,{token:"comment"}]],[e("terse_comment_token__id__")]:[[o(/--(?:@close__id__)/),{token:"comment",next:"@popall"}],[/[^<\[\-]+|[<\[\-]/,{token:"comment"}]]}}}function A(t){const n=_(r,t),i=_(a,t),e=_(F,t);return{...n,...i,...e,unicode:!0,includeLF:!1,start:`default_auto_${t.id}`,ignoreCase:!1,defaultToken:"invalid",tokenPostfix:".freemarker2",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],tokenizer:{...n.tokenizer,...i.tokenizer,...e.tokenizer}}}const x={conf:l(r),language:_(r,k)},$={conf:l(a),language:_(a,k)},E={conf:l(r),language:_(r,p)},B={conf:l(a),language:_(a,p)},D={conf:g(),language:A(k)},C={conf:g(),language:A(p)};export{E as TagAngleInterpolationBracket,x as TagAngleInterpolationDollar,C as TagAutoInterpolationBracket,D as TagAutoInterpolationDollar,B as TagBracketInterpolationBracket,$ as TagBracketInterpolationDollar};
@@ -1 +1 @@
1
- import{l as e}from"./index-CKMEtdQA.js";import"./index-B8NomNE2.js";const t=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],m={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:["{{!--","--}}"]},brackets:[["<!--","-->"],["<",">"],["{{","}}"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/(\w[\w\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:e.IndentAction.Indent}}]},r={defaultToken:"",tokenPostfix:"",tokenizer:{root:[[/\{\{!--/,"comment.block.start.handlebars","@commentBlock"],[/\{\{!/,"comment.start.handlebars","@comment"],[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.root"}],[/<!DOCTYPE/,"metatag.html","@doctype"],[/<!--/,"comment.html","@commentHtml"],[/(<)(\w+)(\/>)/,["delimiter.html","tag.html","delimiter.html"]],[/(<)(script)/,["delimiter.html",{token:"tag.html",next:"@script"}]],[/(<)(style)/,["delimiter.html",{token:"tag.html",next:"@style"}]],[/(<)([:\w]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/(<\/)(\w+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/</,"delimiter.html"],[/\{/,"delimiter.html"],[/[^<{]+/]],doctype:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.comment"}],[/[^>]+/,"metatag.content.html"],[/>/,"metatag.html","@pop"]],comment:[[/\}\}/,"comment.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentBlock:[[/--\}\}/,"comment.block.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentHtml:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.comment"}],[/-->/,"comment.html","@pop"],[/[^-]+/,"comment.content.html"],[/./,"comment.content.html"]],otherTag:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.otherTag"}],[/\/?>/,"delimiter.html","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.script"}],[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],scriptAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterType"}],[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.scriptEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],style:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.style"}],[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],styleAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterType"}],[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.styleEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],handlebarsInSimpleState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3"}],{include:"handlebarsRoot"}],handlebarsInEmbeddedState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}],{include:"handlebarsRoot"}],handlebarsRoot:[[/"[^"]*"/,"string.handlebars"],[/[#/][^\s}]+/,"keyword.helper.handlebars"],[/else\b/,"keyword.helper.handlebars"],[/[\s]+/],[/[^}]/,"variable.parameter.handlebars"]]}};export{m as conf,r as language};
1
+ import{l as e}from"./index-DFQqb6R1.js";import"./index-ChCGltYc.js";const t=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],m={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:["{{!--","--}}"]},brackets:[["<!--","-->"],["<",">"],["{{","}}"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/(\w[\w\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:e.IndentAction.Indent}}]},r={defaultToken:"",tokenPostfix:"",tokenizer:{root:[[/\{\{!--/,"comment.block.start.handlebars","@commentBlock"],[/\{\{!/,"comment.start.handlebars","@comment"],[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.root"}],[/<!DOCTYPE/,"metatag.html","@doctype"],[/<!--/,"comment.html","@commentHtml"],[/(<)(\w+)(\/>)/,["delimiter.html","tag.html","delimiter.html"]],[/(<)(script)/,["delimiter.html",{token:"tag.html",next:"@script"}]],[/(<)(style)/,["delimiter.html",{token:"tag.html",next:"@style"}]],[/(<)([:\w]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/(<\/)(\w+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/</,"delimiter.html"],[/\{/,"delimiter.html"],[/[^<{]+/]],doctype:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.comment"}],[/[^>]+/,"metatag.content.html"],[/>/,"metatag.html","@pop"]],comment:[[/\}\}/,"comment.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentBlock:[[/--\}\}/,"comment.block.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentHtml:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.comment"}],[/-->/,"comment.html","@pop"],[/[^-]+/,"comment.content.html"],[/./,"comment.content.html"]],otherTag:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.otherTag"}],[/\/?>/,"delimiter.html","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.script"}],[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],scriptAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterType"}],[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.scriptEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],style:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.style"}],[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],styleAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterType"}],[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.styleEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],handlebarsInSimpleState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3"}],{include:"handlebarsRoot"}],handlebarsInEmbeddedState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}],{include:"handlebarsRoot"}],handlebarsRoot:[[/"[^"]*"/,"string.handlebars"],[/[#/][^\s}]+/,"keyword.helper.handlebars"],[/else\b/,"keyword.helper.handlebars"],[/[\s]+/],[/[^}]/,"variable.parameter.handlebars"]]}};export{m as conf,r as language};
@@ -1 +1 @@
1
- import{l as e}from"./index-CKMEtdQA.js";import"./index-B8NomNE2.js";const t=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],r={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:["<!--","-->"]},brackets:[["<!--","-->"],["<",">"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${t.join("|")}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:e.IndentAction.Indent}}],folding:{markers:{start:new RegExp("^\\s*<!--\\s*#region\\b.*-->"),end:new RegExp("^\\s*<!--\\s*#endregion\\b.*-->")}}},o={defaultToken:"",tokenPostfix:".html",ignoreCase:!0,tokenizer:{root:[[/<!DOCTYPE/,"metatag","@doctype"],[/<!--/,"comment","@comment"],[/(<)((?:[\w\-]+:)?[\w\-]+)(\s*)(\/>)/,["delimiter","tag","","delimiter"]],[/(<)(script)/,["delimiter",{token:"tag",next:"@script"}]],[/(<)(style)/,["delimiter",{token:"tag",next:"@style"}]],[/(<)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/(<\/)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/</,"delimiter"],[/[^<]+/]],doctype:[[/[^>]+/,"metatag.content"],[/>/,"metatag","@pop"]],comment:[[/-->/,"comment","@pop"],[/[^-]+/,"comment.content"],[/./,"comment.content"]],otherTag:[[/\/?>/,"delimiter","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],scriptAfterType:[[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/"module"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.text/javascript"}],[/'module'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.text/javascript"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/>/,{token:"delimiter",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]],style:[[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],styleAfterType:[[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/>/,{token:"delimiter",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]]}};export{r as conf,o as language};
1
+ import{l as e}from"./index-DFQqb6R1.js";import"./index-ChCGltYc.js";const t=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],r={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:["<!--","-->"]},brackets:[["<!--","-->"],["<",">"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${t.join("|")}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:e.IndentAction.Indent}}],folding:{markers:{start:new RegExp("^\\s*<!--\\s*#region\\b.*-->"),end:new RegExp("^\\s*<!--\\s*#endregion\\b.*-->")}}},o={defaultToken:"",tokenPostfix:".html",ignoreCase:!0,tokenizer:{root:[[/<!DOCTYPE/,"metatag","@doctype"],[/<!--/,"comment","@comment"],[/(<)((?:[\w\-]+:)?[\w\-]+)(\s*)(\/>)/,["delimiter","tag","","delimiter"]],[/(<)(script)/,["delimiter",{token:"tag",next:"@script"}]],[/(<)(style)/,["delimiter",{token:"tag",next:"@style"}]],[/(<)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/(<\/)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/</,"delimiter"],[/[^<]+/]],doctype:[[/[^>]+/,"metatag.content"],[/>/,"metatag","@pop"]],comment:[[/-->/,"comment","@pop"],[/[^-]+/,"comment.content"],[/./,"comment.content"]],otherTag:[[/\/?>/,"delimiter","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],scriptAfterType:[[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/"module"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.text/javascript"}],[/'module'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.text/javascript"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/>/,{token:"delimiter",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]],style:[[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],styleAfterType:[[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/>/,{token:"delimiter",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]]}};export{r as conf,o as language};