@kaitranntt/ccs 7.79.0 → 7.79.1-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/shared/toml-object.d.ts.map +1 -1
- package/dist/shared/toml-object.js +6 -2
- package/dist/shared/toml-object.js.map +1 -1
- package/dist/ui/assets/accounts-C-sOjvWS.js +1 -0
- package/dist/ui/assets/{alert-dialog-DOkcpleU.js → alert-dialog-BrOo6Lh3.js} +1 -1
- package/dist/ui/assets/api-CXdC3ABc.js +4 -0
- package/dist/ui/assets/auth-section-XJ5PohAT.js +1 -0
- package/dist/ui/assets/backups-section-DjMi9NN5.js +1 -0
- package/dist/ui/assets/channels-dD6o7KFj.js +1 -0
- package/dist/ui/assets/{charts-CeK2xCSo.js → charts-eIPy2oG6.js} +34 -34
- package/dist/ui/assets/{checkbox-C-I3i4Q4.js → checkbox-CVS69doq.js} +1 -1
- package/dist/ui/assets/claude-extension-D47wkgfq.js +1 -0
- package/dist/ui/assets/{cliproxy-IfhUOGN4.js → cliproxy-CXgzAe6X.js} +1 -1
- package/dist/ui/assets/{cliproxy-ai-providers-DyDkgHp7.js → cliproxy-ai-providers-POOrpQVc.js} +1 -1
- package/dist/ui/assets/cliproxy-control-panel-BWa_KiNM.js +1 -0
- package/dist/ui/assets/code-highlight-ClSMkeL5.js +1 -0
- package/dist/ui/assets/codex-CYyPdHS4.js +30 -0
- package/dist/ui/assets/{confirm-dialog-CC1GlhTa.js → confirm-dialog-BuxHs897.js} +1 -1
- package/dist/ui/assets/copilot-BQ4Cltbo.js +3 -0
- package/dist/ui/assets/cursor-BVUNUVux.js +1 -0
- package/dist/ui/assets/droid-Bw34FF6c.js +2 -0
- package/dist/ui/assets/globalenv-section-B4UDGHiP.js +1 -0
- package/dist/ui/assets/health-30TwUdp_.js +1 -0
- package/dist/ui/assets/index-BUBCzEHD.js +1 -0
- package/dist/ui/assets/index-BjQ5PWH7.js +1 -0
- package/dist/ui/assets/index-BxIFAuoV.js +1 -0
- package/dist/ui/assets/index-ByGCSVsI.js +1 -0
- package/dist/ui/assets/index-C6j8gpEb.js +56 -0
- package/dist/ui/assets/index-DtiygQmg.js +1 -0
- package/dist/ui/assets/index-nSsKQx8t.css +1 -0
- package/dist/ui/assets/index-s94_IKNx.js +1 -0
- package/dist/ui/assets/logs-CDD_WQvt.js +1 -0
- package/dist/ui/assets/{masked-input-dygs7T1G.js → masked-input-DpM1vKP_.js} +1 -1
- package/dist/ui/assets/{proxy-status-widget-EU0qf73i.js → proxy-status-widget-7iMiOpQe.js} +1 -1
- package/dist/ui/assets/{raw-json-settings-editor-panel-DV6AQbQf.js → raw-json-settings-editor-panel-D-zQkcvr.js} +1 -1
- package/dist/ui/assets/{searchable-select-ZehCX5PV.js → searchable-select-B8Kp0x8p.js} +1 -1
- package/dist/ui/assets/{separator-DJy3ImQI.js → separator-DlXQBF83.js} +1 -1
- package/dist/ui/assets/shared-D_h3QKy6.js +8 -0
- package/dist/ui/assets/{table-CgmEQVhj.js → table-Dyt0FuBK.js} +1 -1
- package/dist/ui/assets/updates-DfIV0IC0.js +1 -0
- package/dist/ui/assets/{use-accounts-BG5kGe9H.js → use-accounts-Dy2ogHT-.js} +1 -1
- package/dist/ui/index.html +3 -3
- package/package.json +1 -1
- package/scripts/verify-bundle.js +4 -1
- package/dist/ui/assets/accounts-ODg4vRYO.js +0 -1
- package/dist/ui/assets/api-BT_0qMeR.js +0 -4
- package/dist/ui/assets/auth-section-CeSiLsXy.js +0 -1
- package/dist/ui/assets/backups-section-iVmpYvyb.js +0 -1
- package/dist/ui/assets/channels-zZKhs8WR.js +0 -1
- package/dist/ui/assets/claude-extension-BAoBvPvA.js +0 -1
- package/dist/ui/assets/cliproxy-control-panel-CLsxYShw.js +0 -1
- package/dist/ui/assets/code-highlight-D4E79GKQ.js +0 -3
- package/dist/ui/assets/codex-BUQaneEo.js +0 -30
- package/dist/ui/assets/copilot-BohFv0NM.js +0 -3
- package/dist/ui/assets/cursor-C1IOfCtR.js +0 -1
- package/dist/ui/assets/droid-CZbjGOaK.js +0 -2
- package/dist/ui/assets/globalenv-section-Bqi0fVGe.js +0 -1
- package/dist/ui/assets/health-CiA0mNhQ.js +0 -1
- package/dist/ui/assets/index-9xFrS28W.js +0 -1
- package/dist/ui/assets/index-B71yJlMj.css +0 -1
- package/dist/ui/assets/index-BB0thfeB.js +0 -72
- package/dist/ui/assets/index-BWwOcbRZ.js +0 -1
- package/dist/ui/assets/index-CdqlhnY2.js +0 -1
- package/dist/ui/assets/index-Clx3EIEh.js +0 -1
- package/dist/ui/assets/index-Cp5UeBTW.js +0 -1
- package/dist/ui/assets/index-sEOc1fZf.js +0 -1
- package/dist/ui/assets/logs-WziPXnEI.js +0 -1
- package/dist/ui/assets/shared-CnZ8AED_.js +0 -8
- package/dist/ui/assets/updates-C24j_PKK.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-nu4wz29m.js";import{r as W}from"./react-vendor-Bjx91N7w.js";import{a as q,bf as Ce,B as f,d as P,n as te,C as x,j as p,k as v,_ as j,b as g,I as G,r as ne,s as ie,t as le,v as de,w as re,x as $,Q as we,R as Ve,U as oe,V as ce,c as fe,W as ke}from"./index-BB0thfeB.js";import{u as J,a as K,b as M}from"./tanstack-bhJxV1h8.js";import{t as C}from"./notifications-B4_o8bcr.js";import{aa as De,a9 as Be,L as Q,au as Ie,at as Te,R as Re,T as ue,ai as Ae,a7 as qe}from"./icons-DzKUh8vG.js";import"./utils-CzKF5WmX.js";import"./form-utils-CuHzLhJZ.js";import"./code-highlight-D4E79GKQ.js";const U=["claude-extension-bindings"];async function w(s,n){const t=await fetch(Ce(s),{headers:{"Content-Type":"application/json"},...n});if(!t.ok){const l=await t.json().catch(()=>null);throw new Error(l?.error||`Request failed (${t.status})`)}return t.status===204?void 0:await t.json()}function Ue(){return J({queryKey:["claude-extension-options"],queryFn:()=>w("/claude-extension/profiles")})}function Fe(s,n="vscode"){return J({queryKey:["claude-extension-setup",s,n],enabled:!!s,queryFn:()=>w(`/claude-extension/setup?profile=${encodeURIComponent(s||"")}&host=${encodeURIComponent(n)}`)})}function Le(){return J({queryKey:U,queryFn:()=>w("/claude-extension/bindings")})}function Oe(s){return J({queryKey:["claude-extension-binding-status",s],enabled:!!s,queryFn:()=>w(`/claude-extension/bindings/${encodeURIComponent(s||"")}/verify`)})}function Qe(){const s=K();return M({mutationFn:n=>w("/claude-extension/bindings",{method:"POST",body:JSON.stringify(n)}),onSuccess:()=>{s.invalidateQueries({queryKey:U}),C.success("Binding created")},onError:n=>C.error(n.message)})}function $e(){const s=K(),{t:n}=q();return M({mutationFn:({id:t,binding:l})=>w(`/claude-extension/bindings/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify(l)}),onSuccess:(t,l)=>{s.invalidateQueries({queryKey:U}),s.invalidateQueries({queryKey:["claude-extension-binding-status",l.id]}),C.success(n("claudeExtensionPage.bindingSaved"))},onError:t=>C.error(t.message)})}function Je(){const s=K(),{t:n}=q();return M({mutationFn:t=>w(`/claude-extension/bindings/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{s.invalidateQueries({queryKey:U}),C.success(n("claudeExtensionPage.bindingDeleted"))},onError:t=>C.error(t.message)})}function pe(s,n){const t=K();return M({mutationFn:({id:l,target:S})=>w(`/claude-extension/bindings/${encodeURIComponent(l)}/${s}`,{method:"POST",body:JSON.stringify({target:S})}),onSuccess:l=>{t.invalidateQueries({queryKey:U}),t.setQueryData(["claude-extension-binding-status",l.bindingId],l),C.success(n)},onError:l=>C.error(l.message)})}function Ke(){const{t:s}=q();return pe("apply",s("claudeExtensionPage.bindingApplied"))}function Me(){const{t:s}=q();return pe("reset",s("claudeExtensionPage.managedValuesRemoved"))}const He=[];function xe(s){return{name:"",profile:s,host:"vscode",ideSettingsPath:"",notes:""}}function T(s){return{name:s.name,profile:s.profile,host:s.host,ideSettingsPath:s.ideSettingsPath||"",notes:s.notes||""}}function _e(s){return{name:s.name.trim(),profile:s.profile.trim(),host:s.host,ideSettingsPath:s.ideSettingsPath.trim()||void 0,notes:s.notes.trim()||void 0}}function ge(s){return s?.state==="applied"}function ze({state:s}){const n=s==="applied"?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":s==="drifted"?"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300":s==="missing"?"border-destructive/30 bg-destructive/10 text-destructive":"border-border bg-muted text-muted-foreground";return e.jsx(f,{variant:"outline",className:n,children:s})}function We(s){return s.replace(/[\\/]/g,"$&")}function o({label:s,value:n,mono:t=!1,copyValue:l}){const S=typeof l=="string"&&l.trim().length>0;return e.jsxs("div",{className:"grid gap-2 text-sm sm:grid-cols-[112px_minmax(0,1fr)] sm:items-start",children:[e.jsx("span",{className:"text-muted-foreground",children:s}),S?e.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[e.jsx("div",{className:"min-w-0 flex-1 rounded-md border bg-muted/25 px-3 py-2",children:e.jsx("span",{className:"block text-left font-mono text-xs leading-5 [overflow-wrap:anywhere]",children:We(n)})}),e.jsx($,{value:l,label:`Copy ${s.toLowerCase()}`,className:"shrink-0"})]}):e.jsx("span",{className:fe("text-left sm:text-right",t&&"font-mono text-xs leading-5 [overflow-wrap:anywhere]"),children:n})]})}function me({title:s,description:n,value:t}){return e.jsxs(x,{className:"border-border/60 bg-card/80",children:[e.jsx(p,{className:"pb-3",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(v,{className:"text-base",children:s}),e.jsx(j,{className:"mt-1",children:n})]}),e.jsx($,{value:t,label:`Copy ${s}`})]})}),e.jsx(g,{children:e.jsx("pre",{className:"max-h-[360px] overflow-auto rounded-lg border bg-muted/30 p-4 text-xs leading-6",children:t})})]})}function he({title:s,description:n,status:t,applyLabel:l,resetLabel:S,onApply:F,onReset:m,disabled:b,busy:V}){return e.jsxs(x,{className:"border-border/60 bg-card/80",children:[e.jsx(p,{className:"pb-3",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(v,{className:"text-base",children:s}),e.jsx(j,{className:"mt-1",children:n})]}),t?e.jsx(ze,{state:t.state}):null]})}),e.jsxs(g,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{label:"Path",value:t?.path||"Save a binding first",mono:!0,copyValue:t?.path}),e.jsx(o,{label:"File",value:t?t.exists?"Present":"Not created yet":"Unavailable"})]}),e.jsx("div",{className:"rounded-lg border bg-muted/25 p-3 text-sm text-muted-foreground",children:t?.message||ke.t("claudeExtensionPage.verifyAfterSaving",{defaultValue:"Verify the binding after saving to inspect the current file state."})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(P,{size:"sm",className:"flex-1",onClick:F,disabled:b||V,children:[V?e.jsx(Q,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):null,l]}),e.jsx(P,{size:"sm",variant:"outline",className:"flex-1",onClick:m,disabled:b||V,children:S})]})]})]})}function Ge({binding:s,isSelected:n,onSelect:t}){return e.jsx("button",{onClick:t,className:fe("w-full rounded-lg border px-3 py-3 text-left transition-colors",n?"border-primary/40 bg-primary/10":"border-border/60 bg-card hover:bg-muted/40"),children:e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-sm font-medium",children:s.name}),e.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[s.profile," · ",s.host]})]}),e.jsx(f,{variant:"outline",className:"shrink-0",children:s.usesDefaultIdeSettingsPath?"Default path":"Custom path"})]})})}function ls(){const{t:s}=q(),n=Ue(),t=Le(),l=Qe(),S=$e(),F=Je(),m=Ke(),b=Me(),V=n.data?.profiles??[],Y=n.data?.hosts??[],E=t.data?.bindings??He,ve=V[0]?.name??"default",[je,D]=W.useState(!1),[L,B]=W.useState(null),[X,k]=W.useState(()=>xe("default")),c=je||E.length===0,N=!c&&E.length>0?E.find(a=>a.id===L)??(L?null:E[0]):null,h=N?.id??null,d=c||!N||L?X:T(N),Z=Fe(d.profile,d.host),R=Oe(c?void 0:h||void 0),r=Y.find(a=>a.id===d.host),H=V.find(a=>a.name===d.profile),_=n.error||t.error||Z.error||R.error,be=`${E.length} saved`,ee=l.isPending||S.isPending,Ne=m.isPending&&m.variables?.target==="shared"||b.isPending&&b.variables?.target==="shared",ye=m.isPending&&m.variables?.target==="ide"||b.isPending&&b.variables?.target==="ide",se=d.name.trim().length>0&&d.profile.trim().length>0,i=Z.data,u=R.data,ae=Math.max((i?.env.length??0)-6,0),Pe=i?.env.slice(0,6)??[];function z(){D(!0),B(null),k(xe(ve))}async function Se(){if(!se)return;const a=_e(d);if(!c&&h){const O=await S.mutateAsync({id:h,binding:a});D(!1),B(O.binding.id),k(T(O.binding));return}const y=await l.mutateAsync(a);D(!1),B(y.binding.id),k(T(y.binding))}async function Ee(){if(!h||!N||!window.confirm(s("claudeExtensionPage.deleteBindingConfirm",{name:N.name,defaultValue:'Delete binding "{{name}}"?'})))return;await F.mutateAsync(h);const a=E.filter(y=>y.id!==h);a.length>0?(B(a[0].id),D(!1),k(T(a[0]))):z()}function A(a,y){if(!c&&N&&!L){B(N.id),k({...T(N),[a]:y}),D(!1);return}k(O=>({...O,[a]:y}))}function I(a,y){if(h){if(y==="apply"){m.mutate({id:h,target:a});return}b.mutate({id:h,target:a})}}return e.jsxs("div",{className:"flex h-full min-h-0 overflow-hidden",children:[e.jsxs("div",{className:"flex w-[348px] shrink-0 flex-col border-r bg-muted/30 xl:w-[372px]",children:[e.jsx("div",{className:"border-b bg-background p-4",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"rounded-lg border bg-muted/40 p-2",children:e.jsx(De,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"font-semibold",children:s("claudeExtensionPage.title")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("claudeExtensionPage.savedBindingsSubtitle",{defaultValue:"Saved IDE bindings for CCS profiles"})})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(f,{variant:"secondary",children:be}),r?e.jsx(f,{variant:"outline",children:r.label}):null]})]}),e.jsxs(P,{size:"sm",onClick:z,className:"gap-1.5",children:[e.jsx(Be,{className:"h-3.5 w-3.5"}),s("claudeExtensionPage.new",{defaultValue:"New"})]})]})}),e.jsx(te,{className:"flex-1",children:e.jsxs("div",{className:"space-y-4 p-5",children:[e.jsxs(x,{className:"border-border/60 bg-card/80",children:[e.jsxs(p,{children:[e.jsx(v,{className:"text-base",children:c?s("claudeExtensionPage.createBinding",{defaultValue:"Create binding"}):s("claudeExtensionPage.bindingEditor",{defaultValue:"Binding editor"})}),e.jsx(j,{children:s("claudeExtensionPage.bindingEditorDescription",{defaultValue:"Save a profile + IDE path once, then apply or reset it from the dashboard."})})]}),e.jsxs(g,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm font-medium",children:s("settingsPage.thinkingSection.bindingName")}),e.jsx(G,{value:d.name,onChange:a=>A("name",a.target.value),placeholder:s("claudeExtensionPage.bindingNamePlaceholder",{defaultValue:"VS Code · work profile"})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm font-medium",children:s("claudeExtensionPage.ccsProfile",{defaultValue:"CCS profile"})}),e.jsxs(ne,{value:d.profile,onValueChange:a=>A("profile",a),children:[e.jsx(ie,{children:e.jsx(le,{placeholder:s("claudeExtensionPage.selectProfile",{defaultValue:"Select a profile"})})}),e.jsx(de,{children:V.map(a=>e.jsxs(re,{value:a.name,children:[a.label," (",a.profileType,")"]},a.name))})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:H?.description||s("claudeExtensionPage.chooseProfileHint",{defaultValue:"Choose which CCS profile the IDE should inherit."})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm font-medium",children:s("settingsPage.thinkingSection.ideHost")}),e.jsxs(ne,{value:d.host,onValueChange:a=>A("host",a),children:[e.jsx(ie,{children:e.jsx(le,{placeholder:s("claudeExtensionPage.selectHost",{defaultValue:"Select a host"})})}),e.jsx(de,{children:Y.map(a=>e.jsx(re,{value:a.id,children:a.label},a.id))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm font-medium",children:s("settingsPage.thinkingSection.ideSettingsPath")}),e.jsx(G,{value:d.ideSettingsPath,onChange:a=>A("ideSettingsPath",a.target.value),placeholder:r?.defaultSettingsPath||s("claudeExtensionPage.ideSettingsPathPlaceholder",{defaultValue:"Leave blank for the default user settings path"})}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[s("claudeExtensionPage.ideSettingsPathHint",{defaultValue:"Leave blank to use the default user settings path for"})," ",r?.label||"this IDE","."]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm font-medium",children:s("settingsPage.thinkingSection.notes")}),e.jsx(G,{value:d.notes,onChange:a=>A("notes",a.target.value),placeholder:s("claudeExtensionPage.notesPlaceholder",{defaultValue:"Optional reminder for this machine or workspace"})})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(P,{className:"flex-1 gap-1.5",onClick:()=>void Se(),disabled:!se||ee,children:[ee?e.jsx(Q,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(Ie,{className:"h-3.5 w-3.5"}),c?s("claudeExtensionPage.create",{defaultValue:"Create"}):s("claudeExtensionPage.save",{defaultValue:"Save"})]}),e.jsx(P,{variant:"outline",onClick:z,children:s("claudeExtensionPage.resetForm",{defaultValue:"Reset form"})})]}),c?null:e.jsxs(P,{variant:"outline",className:"w-full gap-1.5 text-destructive hover:text-destructive",onClick:()=>void Ee(),disabled:F.isPending,children:[e.jsx(Te,{className:"h-3.5 w-3.5"}),s("claudeExtensionPage.deleteBinding",{defaultValue:"Delete binding"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"px-1 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s("claudeExtensionPage.savedBindings",{defaultValue:"Saved bindings"})}),e.jsx("div",{className:"space-y-2",children:E.length>0?E.map(a=>e.jsx(Ge,{binding:a,isSelected:a.id===h&&!c,onSelect:()=>{D(!1),B(a.id),k(T(a))}},a.id)):e.jsx(x,{className:"border-dashed border-border/60 bg-card/60",children:e.jsx(g,{className:"pt-6 text-sm text-muted-foreground",children:s("claudeExtensionPage.emptyBindings",{defaultValue:"No saved bindings yet. Create one to manage apply, reset, and drift checks from the dashboard."})})})})]})]})})]}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx(te,{className:"h-full",children:e.jsxs("div",{className:"w-full space-y-6 p-6 xl:p-7 2xl:p-8",children:[e.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[H?e.jsx(f,{variant:"outline",children:H.label}):null,r?e.jsx(f,{variant:"outline",children:r.label}):null,c?e.jsx(f,{variant:"secondary",children:s("settingsPage.thinkingSection.draft")}):null,u?.sharedSettings&&ge(u.sharedSettings)&&ge(u.ideSettings)?e.jsx(f,{className:"bg-emerald-600 hover:bg-emerald-600",children:s("settingsPage.thinkingSection.inSync")}):null]}),e.jsxs("div",{className:"max-w-5xl",children:[e.jsx("h2",{className:"text-2xl font-semibold tracking-tight",children:N?.name||s("claudeExtensionPage.defaultBindingName",{defaultValue:"Claude extension binding"})}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:s("claudeExtensionPage.bindingDescription",{defaultValue:"Manage the shared Claude settings file and the IDE-local settings file as two scoped targets."})})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(P,{variant:"outline",onClick:()=>void R.refetch(),disabled:c||R.isFetching,children:[R.isFetching?e.jsx(Q,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):e.jsx(Re,{className:"mr-1.5 h-3.5 w-3.5"}),s("claudeExtensionPage.verify",{defaultValue:"Verify"})]}),i?e.jsx($,{value:i.sharedSettings.command,label:"Copy persist command"}):null]})]}),_?e.jsx(x,{className:"border-destructive/40 bg-destructive/5",children:e.jsxs(g,{className:"flex items-start gap-3 pt-6 text-sm text-destructive",children:[e.jsx(ue,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsx("div",{children:_.message})]})}):null,_?null:e.jsxs(we,{defaultValue:"overview",className:"flex flex-col gap-6",children:[e.jsxs(Ve,{className:"w-full justify-start",children:[e.jsx(oe,{value:"overview",children:s("claudeExtensionPage.overview",{defaultValue:"Overview"})})," ",e.jsx(oe,{value:"advanced",children:s("settingsPage.thinkingSection.advanced")})]}),e.jsxs(ce,{value:"overview",className:"mt-0 space-y-6",children:[e.jsxs("div",{className:"grid gap-6 xl:grid-cols-2",children:[e.jsx(he,{title:s("claudeExtensionPage.sharedClaudeSettings",{defaultValue:"Shared Claude settings"}),description:s("claudeExtensionPage.sharedClaudeSettingsDescription",{defaultValue:"Writes the managed env block inside ~/.claude/settings.json so CLI and IDE behavior stay aligned."}),status:u?.sharedSettings,applyLabel:s("claudeExtensionPage.applyShared",{defaultValue:"Apply shared"}),resetLabel:s("claudeExtensionPage.resetShared",{defaultValue:"Reset shared"}),onApply:()=>I("shared","apply"),onReset:()=>I("shared","reset"),disabled:c,busy:Ne}),e.jsx(he,{title:`${r?.label||"IDE"} settings.json`,description:"Writes only the Anthropic extension keys so unrelated editor preferences stay untouched.",status:u?.ideSettings,applyLabel:s("claudeExtensionPage.applyIde",{defaultValue:"Apply IDE"}),resetLabel:s("claudeExtensionPage.resetIde",{defaultValue:"Reset IDE"}),onApply:()=>I("ide","apply"),onReset:()=>I("ide","reset"),disabled:c,busy:ye})]}),e.jsxs("div",{className:"grid gap-6 xl:grid-cols-[minmax(0,1.15fr)_minmax(320px,0.85fr)]",children:[e.jsxs(x,{className:"border-border/60 bg-card/80",children:[e.jsxs(p,{children:[e.jsx(v,{className:"text-base",children:s("settingsPage.thinkingSection.resolvedBinding")}),e.jsx(j,{children:s("claudeExtensionPage.resolvedBindingDescription",{defaultValue:"The binding uses the same profile resolution as `ccs persist` and `ccs env`."})})]}),e.jsxs(g,{className:"space-y-3",children:[e.jsx(o,{label:s("claudeExtensionPage.profile",{defaultValue:"Profile"}),value:i?.profile.label||d.profile||"Not selected"}),e.jsx(o,{label:s("claudeExtensionPage.profileType",{defaultValue:"Profile type"}),value:i?.profile.profileType||"Unknown"}),e.jsx(o,{label:"IDE host",value:r?.label||"Not selected"}),e.jsx(o,{label:s("claudeExtensionPage.idePathMode",{defaultValue:"IDE path mode"}),value:d.ideSettingsPath.trim()?s("claudeExtensionPage.customPath",{defaultValue:"Custom path"}):s("claudeExtensionPage.defaultUserPath",{defaultValue:"Default user path"})}),e.jsx(o,{label:s("claudeExtensionPage.effectiveIdePath",{defaultValue:"Effective IDE path"}),value:u?.ideSettings.path||d.ideSettingsPath.trim()||r?.defaultSettingsPath||"Unavailable",mono:!0,copyValue:u?.ideSettings.path||d.ideSettingsPath.trim()||r?.defaultSettingsPath}),e.jsx(o,{label:s("claudeExtensionPage.persistCommand",{defaultValue:"Persist command"}),value:i?.sharedSettings.command||s("claudeExtensionPage.saveValidBindingFirst",{defaultValue:"Save a valid binding first"}),mono:!0}),d.notes.trim()?e.jsx(o,{label:s("settingsPage.thinkingSection.notes"),value:d.notes.trim()}):null]})]}),e.jsxs(x,{className:"border-border/60 bg-card/80",children:[e.jsxs(p,{children:[e.jsx(v,{className:"text-base",children:s("settingsPage.thinkingSection.managedPayload")}),e.jsx(j,{children:s("claudeExtensionPage.managedPayloadDescription",{defaultValue:"Keep the main view short. The full JSON stays in the Advanced tab."})})]}),e.jsxs(g,{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap gap-2",children:[Pe.map(a=>e.jsx(f,{variant:"secondary",className:"font-mono text-[10px]",children:a.name},a.name)),ae>0?e.jsxs(f,{variant:"outline",children:["+",ae," more"]}):null]}),e.jsx("div",{className:"rounded-lg border bg-muted/25 p-4 text-sm",children:i?.env.length?e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"font-medium",children:s("claudeExtensionPage.envInjected",{count:i.env.length,defaultValue:"CCS will inject {{count}} environment values."})}),e.jsx("div",{className:"text-muted-foreground",children:s("claudeExtensionPage.envInjectedDescription",{defaultValue:"The IDE-local target receives the extension schema. The shared target receives the same env block through Claude settings."})})]}):e.jsx("div",{className:"text-muted-foreground",children:s("claudeExtensionPage.nativeDefaultsDescription",{defaultValue:"This profile resolves to native Claude defaults, so apply/reset mainly clears existing CCS-managed overrides."})})}),c?e.jsx("div",{className:"rounded-lg border border-dashed bg-muted/15 p-4 text-sm text-muted-foreground",children:s("claudeExtensionPage.saveDraftToUnlock",{defaultValue:"Save this draft to unlock apply, reset, and verify actions."})}):e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(P,{className:"flex-1",onClick:()=>I("all","apply"),disabled:m.isPending,children:[m.isPending&&m.variables?.target==="all"?e.jsx(Q,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):null,s("claudeExtensionPage.applyBothTargets",{defaultValue:"Apply both targets"})]}),e.jsx(P,{variant:"outline",className:"flex-1",onClick:()=>I("all","reset"),disabled:b.isPending,children:s("claudeExtensionPage.resetBothTargets",{defaultValue:"Reset both targets"})})]})]})]})]}),i&&(i.warnings.length>0||i.notes.length>0)?e.jsxs("div",{className:"grid gap-6 xl:grid-cols-2",children:[e.jsxs(x,{className:"border-border/60 bg-card/80",children:[e.jsxs(p,{children:[e.jsx(v,{className:"text-base",children:s("settingsPage.thinkingSection.warnings")}),e.jsx(j,{children:"Operational details that can break the binding even when JSON is correct."})]}),e.jsx(g,{className:"space-y-3",children:i.warnings.length>0?i.warnings.map(a=>e.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-amber-400/40 bg-amber-50/60 p-3 text-sm dark:bg-amber-950/10",children:[e.jsx(ue,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-600"}),e.jsx("span",{children:a})]},a)):e.jsx("div",{className:"rounded-lg border bg-muted/20 p-3 text-sm text-muted-foreground",children:"No runtime warnings for this binding."})})]}),e.jsxs(x,{className:"border-border/60 bg-card/80",children:[e.jsxs(p,{children:[e.jsx(v,{className:"text-base",children:s("settingsPage.thinkingSection.notes")}),e.jsx(j,{children:"Short context from CCS about account continuity and host-specific behavior."})]}),e.jsx(g,{className:"space-y-3",children:i.notes.length>0?i.notes.map(a=>e.jsxs("div",{className:"flex items-start gap-3 rounded-lg border bg-muted/30 p-3 text-sm",children:[e.jsx(Ae,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),e.jsx("span",{children:a})]},a)):e.jsx("div",{className:"rounded-lg border bg-muted/20 p-3 text-sm text-muted-foreground",children:"No extra notes for this binding."})})]})]}):null]}),e.jsx(ce,{value:"advanced",className:"mt-0 space-y-6",children:i?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-6 xl:grid-cols-2",children:[e.jsx(me,{title:s("claudeExtensionPage.sharedSettingsJson",{defaultValue:"Shared Claude settings JSON"}),description:s("claudeExtensionPage.sharedSettingsJsonDescription",{defaultValue:"Managed env block for ~/.claude/settings.json."}),value:i.sharedSettings.json}),e.jsx(me,{title:`${r?.label||"IDE"} settings JSON`,description:s("claudeExtensionPage.ideSettingsJsonDescription",{label:r?.settingsTargetLabel||"settings.json",defaultValue:"Anthropic extension snippet for {{label}}."}),value:i.ideSettings.json})]}),e.jsxs(x,{className:"border-border/60 bg-card/80",children:[e.jsx(p,{children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(v,{className:"text-base",children:s("claudeExtensionPage.resolvedEnvironmentPayload",{defaultValue:"Resolved environment payload"})}),e.jsx(j,{children:s("claudeExtensionPage.resolvedEnvironmentPayloadDescription",{defaultValue:"Exact environment values that the extension receives after CCS expands this profile."})})]}),e.jsx($,{value:JSON.stringify(i.env,null,2),label:s("claudeExtensionPage.copyEnvironmentPayload",{defaultValue:"Copy environment payload"})})]})}),e.jsx(g,{children:i.env.length>0?e.jsx("pre",{className:"max-h-[420px] overflow-auto rounded-lg border bg-muted/30 p-4 text-xs leading-6",children:JSON.stringify(i.env,null,2)}):e.jsx("div",{className:"rounded-lg border bg-muted/20 p-4 text-sm text-muted-foreground",children:"No env payload. This binding resolves to native Claude defaults."})})]}),e.jsxs("div",{className:"grid gap-6 xl:grid-cols-2",children:[e.jsxs(x,{className:"border-border/60 bg-card/80",children:[e.jsxs(p,{children:[e.jsx(v,{className:"text-base",children:"Shared target metadata"}),e.jsx(j,{children:"Useful when debugging drift or comparing with manual edits."})]}),e.jsxs(g,{className:"space-y-3",children:[e.jsx(o,{label:"Target path",value:u?.sharedSettings.path||i.sharedSettings.path,mono:!0,copyValue:u?.sharedSettings.path||i.sharedSettings.path}),e.jsx(o,{label:"Command",value:i.sharedSettings.command,mono:!0}),e.jsx(o,{label:"Current state",value:u?.sharedSettings.state||"Not verified"})]})]}),e.jsxs(x,{className:"border-border/60 bg-card/80",children:[e.jsxs(p,{children:[e.jsx(v,{className:"text-base",children:"IDE target metadata"}),e.jsx(j,{children:"Current file path plus the extension setting key used for this host."})]}),e.jsxs(g,{className:"space-y-3",children:[e.jsx(o,{label:"Target path",value:u?.ideSettings.path||d.ideSettingsPath.trim()||r?.defaultSettingsPath||i.ideSettings.path,mono:!0,copyValue:u?.ideSettings.path||d.ideSettingsPath.trim()||r?.defaultSettingsPath||i.ideSettings.path}),e.jsx(o,{label:"Settings key",value:r?.settingsKey||"Unknown",mono:!0}),e.jsx(o,{label:"Current state",value:u?.ideSettings.state||"Not verified"})]})]})]})]}):e.jsx(x,{className:"border-border/60 bg-card/80",children:e.jsxs(g,{className:"flex min-h-[240px] items-center justify-center gap-3 text-sm text-muted-foreground",children:[e.jsx(qe,{className:"h-5 w-5"}),"Choose a profile and IDE host to preview the generated payload."]})})})]})]})})})]})}export{ls as ClaudeExtensionPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-nu4wz29m.js";import{r as s}from"./react-vendor-Bjx91N7w.js";import{u as S}from"./tanstack-bhJxV1h8.js";import{a as D,bf as g,Y as I}from"./index-BB0thfeB.js";import{C as _}from"./default-ports-1QQSffYX.js";import{G as Q,R as $,w as X}from"./icons-DzKUh8vG.js";import"./notifications-B4_o8bcr.js";import"./utils-CzKF5WmX.js";import"./form-utils-CuHzLhJZ.js";import"./code-highlight-D4E79GKQ.js";const k="cli-proxy-auth",O="isLoggedIn",U="apiBase",K="apiUrl",F="managementKey";function A(a){return a.startsWith("/")?new URL(a.replace(/\/$/,""),window.location.origin).href:a.replace(/\/$/,"")}function J(a,u){window.localStorage.removeItem(k),window.localStorage.setItem(U,a),window.localStorage.setItem(K,a),window.localStorage.setItem(F,u),window.localStorage.setItem(O,"true")}function T(){window.localStorage.removeItem(k),window.localStorage.removeItem(U),window.localStorage.removeItem(K),window.localStorage.removeItem(F),window.localStorage.removeItem(O)}function V({port:a=_}){const{t:u}=D(),f=s.useRef(null),[M,N]=s.useState(null),[B,Y]=s.useState(0),[L,v]=s.useState(null),[G,E]=s.useState(!1),{data:l,error:w}=S({queryKey:["cliproxy-server-config"],queryFn:()=>I.cliproxyServer.get(),staleTime:3e4});s.useEffect(()=>{w&&console.warn("[ControlPanelEmbed] Config fetch failed, using local mode:",w)},[w]);const j=!!(l?.remote?.enabled&&l?.remote?.host),{data:y,error:x}=S({queryKey:["auth-tokens-raw",j?"remote":"local"],enabled:l!==void 0&&!j,queryFn:async()=>{try{const t=await fetch(g("/settings/auth/tokens/raw"));if(!t.ok)throw new Error("Failed to fetch auth tokens");const n=await t.json(),o=n.managementSecret.value.trim();if(!o)throw new Error("Management secret missing");return J(A(g("/cliproxy-local/")),o),n}catch(t){throw T(),t}},staleTime:3e4}),{managementUrl:R,checkUrl:h,authToken:b,isRemote:i,displayHost:c}=s.useMemo(()=>{const t=l?.remote,n=l?.local?.port??a;if(t?.enabled&&t?.host){const o=t.protocol||"http",m=t.port||(o==="https"?443:_),p=o==="https"&&m===443||o==="http"&&m===80?"":`:${m}`,r=`${o}://${t.host}${p}`;return{managementUrl:`${r}/management.html`,checkUrl:`${r}/`,authToken:t.auth_token||void 0,isRemote:!0,displayHost:`${t.host}${p}`}}return{managementUrl:g("/cliproxy-local/management.html"),checkUrl:g("/cliproxy-local/"),authToken:y?.managementSecret?.value||void 0,isRemote:!1,displayHost:`localhost:${n}`}},[l,y,a]),C=`${R}:${i?"remote":"local"}:${h}:${b??"missing"}:${B}`,P=l!==void 0&&(i||!!y||!!x);s.useEffect(()=>{x&&console.warn("[ControlPanelEmbed] Failed to preload local control panel session, falling back to manual login:",x)},[x]),s.useEffect(()=>{if(!i)return()=>{T()}},[i]);const H=!P||!(M===C),q=()=>{if(!(!i||!f.current?.contentWindow||!b))try{const t=A(h),n=new URL(`${t}/`).origin;if(new URL(f.current.src,window.location.origin).origin!==n){console.warn("[ControlPanelEmbed] Remote iframe origin mismatch, skipping postMessage");return}f.current.contentWindow.postMessage({type:"ccs-auto-login",apiBase:t,managementKey:b},n)}catch(t){console.debug("[ControlPanelEmbed] Remote postMessage bootstrap failed:",t)}};s.useEffect(()=>{const t=new AbortController;let n=!1;const o=(r,d)=>{n||(E(r),v(d))},m=async()=>{try{if(i){const r=l?.remote,d=await I.cliproxyServer.test({host:r?.host??"",port:r?.port,protocol:r?.protocol??"http",authToken:r?.auth_token});d?.reachable?o(!0,null):o(!1,d?.error?`Remote CLIProxy at ${c}: ${d.error}`:`Remote CLIProxy at ${c} returned an error`)}else(await fetch(h,{signal:t.signal})).ok?o(!0,null):o(!1,"CLIProxy returned an error")}catch(r){if(r instanceof Error&&r.name==="AbortError")return;o(!1,i?`Remote CLIProxy at ${c} is not reachable`:"CLIProxy is not running")}},p=setTimeout(()=>t.abort(),2e3);return m().finally(()=>clearTimeout(p)),()=>{n=!0,t.abort()}},[h,i,c,l]);const W=()=>{N(C),q()},z=()=>{N(null),Y(t=>t+1),v(null),E(!1)};return!G&&L?e.jsxs("div",{className:"flex-1 flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Q,{className:"w-5 h-5 text-primary"}),e.jsx("h2",{className:"font-semibold",children:u("cliproxyHeader.cliproxyControlPanel")})]}),e.jsxs("button",{className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm border rounded-md hover:bg-muted",onClick:z,children:[e.jsx($,{className:"w-4 h-4"}),"Retry"]})]}),e.jsx("div",{className:"flex-1 flex items-center justify-center bg-muted/20",children:e.jsxs("div",{className:"text-center max-w-md px-8",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-destructive/10 flex items-center justify-center mx-auto mb-6",children:e.jsx(X,{className:"w-8 h-8 text-destructive"})}),e.jsx("h3",{className:"text-lg font-semibold mb-2",children:u("cliproxyHeader.cliproxyNotAvailable")}),e.jsx("p",{className:"text-muted-foreground mb-4",children:L}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Start a CLIProxy session with"," ",e.jsx("code",{className:"bg-muted px-1 rounded",children:"ccs gemini"})," or run"," ",e.jsx("code",{className:"bg-muted px-1 rounded",children:"ccs config"})," which auto-starts it."]})]})})]}):e.jsx("div",{className:"flex-1 flex flex-col",children:e.jsxs("div",{className:"flex-1 flex flex-col relative",children:[H&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/80 z-10",children:e.jsxs("div",{className:"text-center",children:[e.jsx($,{className:"w-8 h-8 animate-spin text-primary mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:i?`Loading Control Panel from ${c}...`:"Loading Control Panel..."})]})}),P?e.jsx("iframe",{ref:f,src:R,className:"flex-1 w-full border-0",title:"CLIProxy Management Panel",onLoad:W},C):null]})})}function me(){return e.jsx("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:e.jsx(V,{})})}export{me as CliproxyControlPanelPage};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{r as P}from"./react-vendor-Bjx91N7w.js";import{c as ae}from"./utils-CzKF5WmX.js";var ue=Object.create,Z=Object.defineProperty,ce=Object.defineProperties,pe=Object.getOwnPropertyDescriptor,ge=Object.getOwnPropertyDescriptors,ne=Object.getOwnPropertyNames,G=Object.getOwnPropertySymbols,de=Object.getPrototypeOf,K=Object.prototype.hasOwnProperty,re=Object.prototype.propertyIsEnumerable,Q=(e,t,n)=>t in e?Z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,L=(e,t)=>{for(var n in t||(t={}))K.call(t,n)&&Q(e,n,t[n]);if(G)for(var n of G(t))re.call(t,n)&&Q(e,n,t[n]);return e},q=(e,t)=>ce(e,ge(t)),oe=(e,t)=>{var n={};for(var i in e)K.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&G)for(var i of G(e))t.indexOf(i)<0&&re.call(e,i)&&(n[i]=e[i]);return n},ye=(e,t)=>function(){return t||(0,e[ne(e)[0]])((t={exports:{}}).exports,t),t.exports},fe=(e,t)=>{for(var n in t)Z(e,n,{get:t[n],enumerable:!0})},be=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let f of ne(t))!K.call(e,f)&&f!==n&&Z(e,f,{get:()=>t[f],enumerable:!(i=pe(t,f))||i.enumerable});return e},me=(e,t,n)=>(n=e!=null?ue(de(e)):{},be(!e||!e.__esModule?Z(n,"default",{value:e,enumerable:!0}):n,e)),he=ye({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(e,t){var n=(function(){var i=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,f=0,h={},c={util:{encode:function r(a){return a instanceof m?new m(a.type,r(a.content),a.alias):Array.isArray(a)?a.map(r):a.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(r){return Object.prototype.toString.call(r).slice(8,-1)},objId:function(r){return r.__id||Object.defineProperty(r,"__id",{value:++f}),r.__id},clone:function r(a,s){s=s||{};var u,l;switch(c.util.type(a)){case"Object":if(l=c.util.objId(a),s[l])return s[l];u={},s[l]=u;for(var y in a)a.hasOwnProperty(y)&&(u[y]=r(a[y],s));return u;case"Array":return l=c.util.objId(a),s[l]?s[l]:(u=[],s[l]=u,a.forEach(function(k,w){u[w]=r(k,s)}),u);default:return a}},getLanguage:function(r){for(;r;){var a=i.exec(r.className);if(a)return a[1].toLowerCase();r=r.parentElement}return"none"},setLanguage:function(r,a){r.className=r.className.replace(RegExp(i,"gi"),""),r.classList.add("language-"+a)},isActive:function(r,a,s){for(var u="no-"+a;r;){var l=r.classList;if(l.contains(a))return!0;if(l.contains(u))return!1;r=r.parentElement}return!!s}},languages:{plain:h,plaintext:h,text:h,txt:h,extend:function(r,a){var s=c.util.clone(c.languages[r]);for(var u in a)s[u]=a[u];return s},insertBefore:function(r,a,s,u){u=u||c.languages;var l=u[r],y={};for(var k in l)if(l.hasOwnProperty(k)){if(k==a)for(var w in s)s.hasOwnProperty(w)&&(y[w]=s[w]);s.hasOwnProperty(k)||(y[k]=l[k])}var A=u[r];return u[r]=y,c.languages.DFS(c.languages,function(x,_){_===A&&x!=r&&(this[x]=y)}),y},DFS:function r(a,s,u,l){l=l||{};var y=c.util.objId;for(var k in a)if(a.hasOwnProperty(k)){s.call(a,k,a[k],u||k);var w=a[k],A=c.util.type(w);A==="Object"&&!l[y(w)]?(l[y(w)]=!0,r(w,s,null,l)):A==="Array"&&!l[y(w)]&&(l[y(w)]=!0,r(w,s,k,l))}}},plugins:{},highlight:function(r,a,s){var u={code:r,grammar:a,language:s};if(c.hooks.run("before-tokenize",u),!u.grammar)throw new Error('The language "'+u.language+'" has no grammar.');return u.tokens=c.tokenize(u.code,u.grammar),c.hooks.run("after-tokenize",u),m.stringify(c.util.encode(u.tokens),u.language)},tokenize:function(r,a){var s=a.rest;if(s){for(var u in s)a[u]=s[u];delete a.rest}var l=new b;return d(l,l.head,r),g(r,l,a,l.head,0),E(l)},hooks:{all:{},add:function(r,a){var s=c.hooks.all;s[r]=s[r]||[],s[r].push(a)},run:function(r,a){var s=c.hooks.all[r];if(!(!s||!s.length))for(var u=0,l;l=s[u++];)l(a)}},Token:m};function m(r,a,s,u){this.type=r,this.content=a,this.alias=s,this.length=(u||"").length|0}m.stringify=function r(a,s){if(typeof a=="string")return a;if(Array.isArray(a)){var u="";return a.forEach(function(A){u+=r(A,s)}),u}var l={type:a.type,content:r(a.content,s),tag:"span",classes:["token",a.type],attributes:{},language:s},y=a.alias;y&&(Array.isArray(y)?Array.prototype.push.apply(l.classes,y):l.classes.push(y)),c.hooks.run("wrap",l);var k="";for(var w in l.attributes)k+=" "+w+'="'+(l.attributes[w]||"").replace(/"/g,""")+'"';return"<"+l.tag+' class="'+l.classes.join(" ")+'"'+k+">"+l.content+"</"+l.tag+">"};function p(r,a,s,u){r.lastIndex=a;var l=r.exec(s);if(l&&u&&l[1]){var y=l[1].length;l.index+=y,l[0]=l[0].slice(y)}return l}function g(r,a,s,u,l,y){for(var k in s)if(!(!s.hasOwnProperty(k)||!s[k])){var w=s[k];w=Array.isArray(w)?w:[w];for(var A=0;A<w.length;++A){if(y&&y.cause==k+","+A)return;var x=w[A],_=x.inside,F=!!x.lookbehind,D=!!x.greedy,N=x.alias;if(D&&!x.pattern.global){var I=x.pattern.toString().match(/[imsuy]*$/)[0];x.pattern=RegExp(x.pattern.source,I+"g")}for(var V=x.pattern||x,S=u.next,O=l;S!==a.tail&&!(y&&O>=y.reach);O+=S.value.length,S=S.next){var B=S.value;if(a.length>r.length)return;if(!(B instanceof m)){var j=1,R;if(D){if(R=p(V,O,r,F),!R||R.index>=r.length)break;var z=R.index,le=R.index+R[0].length,C=O;for(C+=S.value.length;z>=C;)S=S.next,C+=S.value.length;if(C-=S.value.length,O=C,S.value instanceof m)continue;for(var $=S;$!==a.tail&&(C<le||typeof $.value=="string");$=$.next)j++,C+=$.value.length;j--,B=r.slice(O,C),R.index-=O}else if(R=p(V,0,B,F),!R)continue;var z=R.index,M=R[0],W=B.slice(0,z),X=B.slice(z+M.length),H=O+B.length;y&&H>y.reach&&(y.reach=H);var U=S.prev;W&&(U=d(a,U,W),O+=W.length),v(a,U,j);var ie=new m(k,_?c.tokenize(M,_):M,N,M);if(S=d(a,U,ie),X&&d(a,S,X),j>1){var Y={cause:k+","+A,reach:H};g(r,a,s,S.prev,O,Y),y&&Y.reach>y.reach&&(y.reach=Y.reach)}}}}}}function b(){var r={value:null,prev:null,next:null},a={value:null,prev:r,next:null};r.next=a,this.head=r,this.tail=a,this.length=0}function d(r,a,s){var u=a.next,l={value:s,prev:a,next:u};return a.next=l,u.prev=l,r.length++,l}function v(r,a,s){for(var u=a.next,l=0;l<s&&u!==r.tail;l++)u=u.next;a.next=u,u.prev=a,r.length-=l}function E(r){for(var a=[],s=r.head.next;s!==r.tail;)a.push(s.value),s=s.next;return a}return c})();t.exports=n,n.default=n}}),o=me(he());o.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},o.languages.markup.tag.inside["attr-value"].inside.entity=o.languages.markup.entity,o.languages.markup.doctype.inside["internal-subset"].inside=o.languages.markup,o.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&/,"&"))}),Object.defineProperty(o.languages.markup.tag,"addInlined",{value:function(e,i){var n={},n=(n["language-"+i]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:o.languages[i]},n.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}}),i=(n["language-"+i]={pattern:/[\s\S]+/,inside:o.languages[i]},{});i[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:n},o.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(o.languages.markup.tag,"addAttribute",{value:function(e,t){o.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:o.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),o.languages.html=o.languages.markup,o.languages.mathml=o.languages.markup,o.languages.svg=o.languages.markup,o.languages.xml=o.languages.extend("markup",{}),o.languages.ssml=o.languages.xml,o.languages.atom=o.languages.xml,o.languages.rss=o.languages.xml,(function(e){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,i="(?:[^\\\\-]|"+n.source+")",i=RegExp(i+"-"+i),f={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};e.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:i,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:n}},"special-escape":t,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":f}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":f}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}})(o),o.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},o.languages.javascript=o.languages.extend("clike",{"class-name":[o.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),o.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,o.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:o.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:o.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:o.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:o.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:o.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),o.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:o.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),o.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),o.languages.markup&&(o.languages.markup.tag.addInlined("script","javascript"),o.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),o.languages.js=o.languages.javascript,o.languages.actionscript=o.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),o.languages.actionscript["class-name"].alias="function",delete o.languages.actionscript.parameter,delete o.languages.actionscript["literal-property"],o.languages.markup&&o.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:o.languages.markup}}),(function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript})(o),(function(e){var t=e.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(t,"addSupport",{value:function(n,i){(n=typeof n=="string"?[n]:n).forEach(function(f){var h=function(d){d.inside||(d.inside={}),d.inside.rest=i},c="doc-comment";if(m=e.languages[f]){var m,p=m[c];if((p=p||(m=e.languages.insertBefore(f,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[c])instanceof RegExp&&(p=m[c]={pattern:p}),Array.isArray(p))for(var g=0,b=p.length;g<b;g++)p[g]instanceof RegExp&&(p[g]={pattern:p[g]}),h(p[g]);else h(p)}})}}),t.addSupport(["java","javascript","php"],t)})(o),(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,t=(e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css,e.languages.markup);t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))})(o),(function(e){var t=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,t=(e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:t={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+t.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[t,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=t,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,number:n})})(o),(function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,i="(?:"+n.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+n.source+")?)",f=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),h=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function c(m,p){p=(p||"").replace(/m/g,"")+"m";var g=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return i}).replace(/<<value>>/g,function(){return m});return RegExp(g,p)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return i})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return i}).replace(/<<key>>/g,function(){return"(?:"+f+"|"+h+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:c(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:c(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:c(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:c(h),lookbehind:!0,greedy:!0},number:{pattern:c(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml})(o),(function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(g){return g=g.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+g+")")}var i=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,f=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return i}),h=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,c=(e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+f+h+"(?:"+f+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+f+h+")(?:"+f+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(i),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+f+")"+h+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+f+"$"),inside:{"table-header":{pattern:RegExp(i),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(g){["url","bold","italic","strike","code-snippet"].forEach(function(b){g!==b&&(e.languages.markdown[g].inside.content.inside[b]=e.languages.markdown[b])})}),e.hooks.add("after-tokenize",function(g){g.language!=="markdown"&&g.language!=="md"||(function b(d){if(d&&typeof d!="string")for(var v=0,E=d.length;v<E;v++){var r,a=d[v];a.type!=="code"?b(a.content):(r=a.content[1],a=a.content[3],r&&a&&r.type==="code-language"&&a.type==="code-block"&&typeof r.content=="string"&&(r=r.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),r="language-"+(r=(/[a-z][\w-]*/i.exec(r)||[""])[0].toLowerCase()),a.alias?typeof a.alias=="string"?a.alias=[a.alias,r]:a.alias.push(r):a.alias=[r]))}})(g.tokens)}),e.hooks.add("wrap",function(g){if(g.type==="code-block"){for(var b="",d=0,v=g.classes.length;d<v;d++){var E=g.classes[d],E=/language-(.+)/.exec(E);if(E){b=E[1];break}}var r,a=e.languages[b];a?g.content=e.highlight((function(s){return s=s.replace(c,""),s=s.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(u,l){var y;return(l=l.toLowerCase())[0]==="#"?(y=l[1]==="x"?parseInt(l.slice(2),16):Number(l.slice(1)),p(y)):m[l]||u})})(g.content),a,b):b&&b!=="none"&&e.plugins.autoloader&&(r="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random()),g.attributes.id=r,e.plugins.autoloader.loadLanguages(b,function(){var s=document.getElementById(r);s&&(s.innerHTML=e.highlight(s.textContent,e.languages[b],b))}))}}),RegExp(e.languages.markup.tag.pattern.source,"gi")),m={amp:"&",lt:"<",gt:">",quot:'"'},p=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown})(o),o.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:o.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},o.hooks.add("after-tokenize",function(e){if(e.language==="graphql")for(var t=e.tokens.filter(function(r){return typeof r!="string"&&r.type!=="comment"&&r.type!=="scalar"}),n=0;n<t.length;){var i=t[n++];if(i.type==="keyword"&&i.content==="mutation"){var f=[];if(d(["definition-mutation","punctuation"])&&b(1).content==="("){n+=2;var h=v(/^\($/,/^\)$/);if(h===-1)continue;for(;n<h;n++){var c=b(0);c.type==="variable"&&(E(c,"variable-input"),f.push(c.content))}n=h+1}if(d(["punctuation","property-query"])&&b(0).content==="{"&&(n++,E(b(0),"property-mutation"),0<f.length)){var m=v(/^\{$/,/^\}$/);if(m!==-1)for(var p=n;p<m;p++){var g=t[p];g.type==="variable"&&0<=f.indexOf(g.content)&&E(g,"variable-input")}}}}function b(r){return t[n+r]}function d(r,a){a=a||0;for(var s=0;s<r.length;s++){var u=b(s+a);if(!u||u.type!==r[s])return}return 1}function v(r,a){for(var s=1,u=n;u<t.length;u++){var l=t[u],y=l.content;if(l.type==="punctuation"&&typeof y=="string"){if(r.test(y))s++;else if(a.test(y)&&--s===0)return u}}return-1}function E(r,a){var s=r.alias;s?Array.isArray(s)||(r.alias=s=[s]):r.alias=s=[],s.push(a)}}),o.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},(function(e){var t=e.languages.javascript["template-string"],n=t.pattern.source,i=t.inside.interpolation,f=i.inside["interpolation-punctuation"],h=i.pattern.source;function c(d,v){if(e.languages[d])return{pattern:RegExp("((?:"+v+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:d}}}}function m(d,v,E){return d={code:d,grammar:v,language:E},e.hooks.run("before-tokenize",d),d.tokens=e.tokenize(d.code,d.grammar),e.hooks.run("after-tokenize",d),d.tokens}function p(d,v,E){var s=e.tokenize(d,{interpolation:{pattern:RegExp(h),lookbehind:!0}}),r=0,a={},s=m(s.map(function(l){if(typeof l=="string")return l;for(var y,k,l=l.content;d.indexOf((k=r++,y="___"+E.toUpperCase()+"_"+k+"___"))!==-1;);return a[y]=l,y}).join(""),v,E),u=Object.keys(a);return r=0,(function l(y){for(var k=0;k<y.length;k++){if(r>=u.length)return;var w,A,x,_,F,D,N,I=y[k];typeof I=="string"||typeof I.content=="string"?(w=u[r],(N=(D=typeof I=="string"?I:I.content).indexOf(w))!==-1&&(++r,A=D.substring(0,N),F=a[w],x=void 0,(_={})["interpolation-punctuation"]=f,(_=e.tokenize(F,_)).length===3&&((x=[1,1]).push.apply(x,m(_[1],e.languages.javascript,"javascript")),_.splice.apply(_,x)),x=new e.Token("interpolation",_,i.alias,F),_=D.substring(N+w.length),F=[],A&&F.push(A),F.push(x),_&&(l(D=[_]),F.push.apply(F,D)),typeof I=="string"?(y.splice.apply(y,[k,1].concat(F)),k+=F.length-1):I.content=F)):(N=I.content,Array.isArray(N)?l(N):l([N]))}})(s),new e.Token(E,s,"language-"+E,d)}e.languages.javascript["template-string"]=[c("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),c("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),c("svg",/\bsvg/.source),c("markdown",/\b(?:markdown|md)/.source),c("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),c("sql",/\bsql/.source),t].filter(Boolean);var g={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function b(d){return typeof d=="string"?d:Array.isArray(d)?d.map(b).join(""):b(d.content)}e.hooks.add("after-tokenize",function(d){d.language in g&&(function v(E){for(var r=0,a=E.length;r<a;r++){var s,u,l,y=E[r];typeof y!="string"&&(s=y.content,Array.isArray(s)?y.type==="template-string"?(y=s[1],s.length===3&&typeof y!="string"&&y.type==="embedded-code"&&(u=b(y),y=y.alias,y=Array.isArray(y)?y[0]:y,l=e.languages[y])&&(s[1]=p(u,l,y))):v(s):typeof s!="string"&&v([s]))}})(d.tokens)})})(o),(function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript})(o),(function(e){var t=e.languages.javascript,n=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,i="(@(?:arg|argument|param|property)\\s+(?:"+n+"\\s+)?)";e.languages.jsdoc=e.languages.extend("javadoclike",{parameter:{pattern:RegExp(i+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(i+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:t,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g,function(){return n})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+n),lookbehind:!0,inside:{string:t.string,number:t.number,boolean:t.boolean,keyword:e.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:t,alias:"language-javascript"}}}}),e.languages.javadoclike.addSupport("javascript",e.languages.jsdoc)})(o),(function(e){e.languages.flow=e.languages.extend("javascript",{}),e.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),e.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete e.languages.flow.parameter,e.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(e.languages.flow.keyword)||(e.languages.flow.keyword=[e.languages.flow.keyword]),e.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})})(o),o.languages.n4js=o.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),o.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),o.languages.n4jsd=o.languages.n4js,(function(e){function t(c,m){return RegExp(c.replace(/<ID>/g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),m)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:t(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:t(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],i=0;i<n.length;i++){var h=n[i],f=e.languages.javascript[h],h=(f=e.util.type(f)==="RegExp"?e.languages.javascript[h]={pattern:f}:f).inside||{};(f.inside=h)["maybe-class-name"]=/^[A-Z][\s\S]*/}})(o),(function(e){var t=e.util.clone(e.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,i=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,f=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function h(p,g){return p=p.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return i}).replace(/<SPREAD>/g,function(){return f}),RegExp(p,g)}f=h(f).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=h(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:h(/<SPREAD>/.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:h(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);function c(p){for(var g=[],b=0;b<p.length;b++){var d=p[b],v=!1;typeof d!="string"&&(d.type==="tag"&&d.content[0]&&d.content[0].type==="tag"?d.content[0].content[0].content==="</"?0<g.length&&g[g.length-1].tagName===m(d.content[0].content[1])&&g.pop():d.content[d.content.length-1].content!=="/>"&&g.push({tagName:m(d.content[0].content[1]),openedBraces:0}):0<g.length&&d.type==="punctuation"&&d.content==="{"?g[g.length-1].openedBraces++:0<g.length&&0<g[g.length-1].openedBraces&&d.type==="punctuation"&&d.content==="}"?g[g.length-1].openedBraces--:v=!0),(v||typeof d=="string")&&0<g.length&&g[g.length-1].openedBraces===0&&(v=m(d),b<p.length-1&&(typeof p[b+1]=="string"||p[b+1].type==="plain-text")&&(v+=m(p[b+1]),p.splice(b+1,1)),0<b&&(typeof p[b-1]=="string"||p[b-1].type==="plain-text")&&(v=m(p[b-1])+v,p.splice(b-1,1),b--),p[b]=new e.Token("plain-text",v,null,v)),d.content&&typeof d.content!="string"&&c(d.content)}}var m=function(p){return p?typeof p=="string"?p:typeof p.content=="string"?p.content:p.content.map(m).join(""):""};e.hooks.add("after-tokenize",function(p){p.language!=="jsx"&&p.language!=="tsx"||c(p.tokens)})})(o),(function(e){var t=e.util.clone(e.languages.typescript),t=(e.languages.tsx=e.languages.extend("jsx",t),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"],e.languages.tsx.tag);t.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+t.pattern.source+")",t.pattern.flags),t.lookbehind=!0})(o),o.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},o.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=o.languages.swift}),(function(e){e.languages.kotlin=e.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:e.languages.kotlin}};e.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete e.languages.kotlin.string,e.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),e.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin})(o),o.languages.c=o.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),o.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),o.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},o.languages.c.string],char:o.languages.c.char,comment:o.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:o.languages.c}}}}),o.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete o.languages.c.boolean,o.languages.objectivec=o.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete o.languages.objectivec["class-name"],o.languages.objc=o.languages.objectivec,o.languages.reason=o.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),o.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete o.languages.reason.function,(function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string})(o),o.languages.go=o.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),o.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete o.languages.go["class-name"],(function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])})(o),o.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},o.languages.python["string-interpolation"].inside.interpolation.inside.rest=o.languages.python,o.languages.py=o.languages.python,o.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},o.languages.webmanifest=o.languages.json;var ve={};fe(ve,{dracula:()=>we,duotoneDark:()=>xe,duotoneLight:()=>Se,github:()=>Fe,gruvboxMaterialDark:()=>at,gruvboxMaterialLight:()=>rt,jettwaveDark:()=>Ye,jettwaveLight:()=>Ve,nightOwl:()=>Re,nightOwlLight:()=>Oe,oceanicNext:()=>Ne,okaidia:()=>Ce,oneDark:()=>Qe,oneLight:()=>et,palenight:()=>$e,shadesOfPurple:()=>je,synthwave84:()=>Me,ultramin:()=>Ge,vsDark:()=>se,vsLight:()=>We});var ke={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},we=ke,Ee={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},xe=Ee,Ae={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},Se=Ae,_e={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},Fe=_e,Te={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},Re=Te,Ie={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},Oe=Ie,T={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",tag:"#fc929e",function:"#79b6f2",className:"#FAC863"},Le={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:T.keyword}},{types:["attr-value"],style:{color:T.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:T.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:T.primitive}},{types:["boolean"],style:{color:T.boolean}},{types:["tag"],style:{color:T.tag}},{types:["string"],style:{color:T.string}},{types:["punctuation"],style:{color:T.string}},{types:["selector","char","builtin","inserted"],style:{color:T.char}},{types:["function"],style:{color:T.function}},{types:["operator","entity","url","variable"],style:{color:T.variable}},{types:["keyword"],style:{color:T.keyword}},{types:["atrule","class-name"],style:{color:T.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},Ne=Le,De={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},Ce=De,Be={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},$e=Be,Pe={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},je=Pe,ze={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},Me=ze,Ue={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},Ge=Ue,Ze={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},se=Ze,qe={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},We=qe,He={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},Ye=He,Ke={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},Ve=Ke,Xe={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},Qe=Xe,Je={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},et=Je,tt={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},at=tt,nt={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},rt=nt,ot=e=>P.useCallback(t=>{var n=t,{className:i,style:f,line:h}=n,c=oe(n,["className","style","line"]);const m=q(L({},c),{className:ae("token-line",i)});return typeof e=="object"&&"plain"in e&&(m.style=e.plain),typeof f=="object"&&(m.style=L(L({},m.style||{}),f)),m},[e]),st=e=>{const t=P.useCallback(({types:n,empty:i})=>{if(e!=null){{if(n.length===1&&n[0]==="plain")return i!=null?{display:"inline-block"}:void 0;if(n.length===1&&i!=null)return e[n[0]]}return Object.assign(i!=null?{display:"inline-block"}:{},...n.map(f=>e[f]))}},[e]);return P.useCallback(n=>{var i=n,{token:f,className:h,style:c}=i,m=oe(i,["token","className","style"]);const p=q(L({},m),{className:ae("token",...f.types,h),children:f.content,style:t(f)});return c!=null&&(p.style=L(L({},p.style||{}),c)),p},[t])},lt=/\r\n|\r|\n/,J=e=>{e.length===0?e.push({types:["plain"],content:`
|
|
2
|
-
`,empty:!0}):e.length===1&&e[0].content===""&&(e[0].content=`
|
|
3
|
-
`,e[0].empty=!0)},ee=(e,t)=>{const n=e.length;return n>0&&e[n-1]===t?e:e.concat(t)},it=e=>{const t=[[]],n=[e],i=[0],f=[e.length];let h=0,c=0,m=[];const p=[m];for(;c>-1;){for(;(h=i[c]++)<f[c];){let g,b=t[c];const v=n[c][h];if(typeof v=="string"?(b=c>0?b:["plain"],g=v):(b=ee(b,v.type),v.alias&&(b=ee(b,v.alias)),g=v.content),typeof g!="string"){c++,t.push(b),n.push(g),i.push(0),f.push(g.length);continue}const E=g.split(lt),r=E.length;m.push({types:b,content:E[0]});for(let a=1;a<r;a++)J(m),p.push(m=[]),m.push({types:b,content:E[a]})}c--,t.pop(),n.pop(),i.pop(),f.pop()}return J(m),p},te=it,ut=({prism:e,code:t,grammar:n,language:i})=>P.useMemo(()=>{if(n==null)return te([t]);const f={code:t,grammar:n,language:i,tokens:[]};return e.hooks.run("before-tokenize",f),f.tokens=e.tokenize(t,n),e.hooks.run("after-tokenize",f),te(f.tokens)},[t,n,i,e]),ct=(e,t)=>{const{plain:n}=e,i=e.styles.reduce((f,h)=>{const{languages:c,style:m}=h;return c&&!c.includes(t)||h.types.forEach(p=>{const g=L(L({},f[p]),m);f[p]=g}),f},{});return i.root=n,i.plain=q(L({},n),{backgroundColor:void 0}),i},pt=ct,gt=({children:e,language:t,code:n,theme:i,prism:f})=>{const h=t.toLowerCase(),c=pt(i,h),m=ot(c),p=st(c),g=f.languages[h],b=ut({prism:f,language:h,code:n,grammar:g});return e({tokens:b,className:`prism-code language-${h}`,style:c!=null?c.root:{},getLineProps:m,getTokenProps:p})},ft=e=>P.createElement(gt,q(L({},e),{prism:e.prism||o,theme:e.theme||se,code:e.code,language:e.language}));export{ft as H,ve as t};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-nu4wz29m.js";import{r as N}from"./react-vendor-Bjx91N7w.js";import{t as U}from"./notifications-B4_o8bcr.js";import{C as I,j as F,k as W,B as _,b as K,a as E,d as y,aI as J,r as P,s as D,t as O,v as L,w as b,I as S,n as fe,W as C,bf as se,bg as Pe,c as De,bm as He,bn as ve,bo as Qe,Q as Je,R as Ze,U as ae,V as oe,bh as be}from"./index-BB0thfeB.js";import{aa as es,aS as ss,at as re,L as z,n as rs,aT as ts,aU as ns,aC as as,w as os,a7 as ls,aV as is,aW as cs,aX as ds,ai as me,p as we,$ as xs,m as us,o as ms,_ as ps,S as hs,aN as Ne,aY as fs,x as gs,I as js,T as vs,N as bs}from"./icons-DzKUh8vG.js";import{S as ee}from"./separator-DJy3ImQI.js";import{a as ws,u as Ce,b as ye}from"./tanstack-bhJxV1h8.js";import"./code-highlight-D4E79GKQ.js";import{T as Ns,a as Cs,b as Se,c as le,d as ys,e as ie}from"./table-CgmEQVhj.js";import{R as Ss}from"./raw-json-settings-editor-panel-DV6AQbQf.js";import"./utils-CzKF5WmX.js";import"./form-utils-CuHzLhJZ.js";function Z({title:r,icon:s,badge:t,description:l,disabledReason:o,children:n}){return e.jsxs(I,{children:[e.jsxs(F,{className:"pb-2",children:[e.jsxs(W,{className:"flex items-center gap-2 text-base",children:[s,r,t?e.jsx(_,{variant:"outline",className:"text-[10px] font-normal",children:t}):null]}),l?e.jsx("p",{className:"text-xs text-muted-foreground",children:l}):null]}),e.jsxs(K,{className:"space-y-3",children:[o?e.jsx("p",{className:"text-xs text-amber-600",children:o}):null,n]})]})}function _s({catalog:r,state:s,disabled:t=!1,disabledReason:l,onToggle:o}){const{t:n}=E(),a=new Set(r.map(i=>i.name)),c=Object.entries(s).filter(([i])=>!a.has(i)).sort(([i],[d])=>i.localeCompare(d));return e.jsxs(Z,{title:n("codex.features"),badge:"features",icon:e.jsx(es,{className:"h-4 w-4"}),description:n("codex.featuresDesc"),disabledReason:l,children:[e.jsx("div",{className:"space-y-2",children:r.map(i=>{const d=s[i.name]??null;return e.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border px-3 py-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"text-sm font-medium",children:i.label}),e.jsx(_,{variant:"outline",className:"font-mono text-[10px]",children:i.name})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:i.description})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[d!==null?e.jsx(y,{variant:"outline",size:"sm",onClick:()=>o(i.name,null),disabled:t,children:n("codex.useDefault")}):null,e.jsx(J,{checked:d===!0,onCheckedChange:m=>o(i.name,m),disabled:t})]})]},i.name)})}),c.length>0?e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:n("codex.configOnlyFlags")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:n("codex.configOnlyFlagsDesc")})]}),c.map(([i,d])=>e.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-dashed px-3 py-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"text-sm font-medium",children:i}),e.jsx(_,{variant:"secondary",className:"text-[10px]",children:n("codex.existing")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:n(d===null?"codex.nonBooleanForm":"codex.discoveredFromFile")})]}),d===null?e.jsx(_,{variant:"outline",children:n("codex.rawOnly")}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(y,{variant:"outline",size:"sm",onClick:()=>o(i,null),disabled:t,children:n("codex.useDefault")}),e.jsx(J,{checked:d===!0,onCheckedChange:m=>o(i,m),disabled:t})]})]},i))]}):null]})}const ks={name:"",transport:"stdio",command:null,args:[],url:null,enabled:!0,required:!1,startupTimeoutSec:null,toolTimeoutSec:null,enabledTools:[],disabledTools:[],isCcsManaged:!1,managementSurface:null};function ce(r){return r.join(", ")}function de(r){return r.split(",").map(s=>s.trim()).filter(Boolean)}function Ts({initialDraft:r,isNew:s,disabled:t,saving:l,canDelete:o,onSave:n,onDelete:a}){const{t:c}=E(),[i,d]=N.useState(r),m=s&&i.name.trim()==="ccs_browser";return e.jsxs(e.Fragment,{children:[m?e.jsxs("div",{className:"rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-900 dark:text-amber-200",children:[e.jsx("strong",{children:"ccs_browser"})," is reserved for the CCS-managed browser tooling path. Configure it from ",e.jsx("code",{children:"Settings > Browser"})," instead of creating it here."]}):null,e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(S,{value:i.name,onChange:p=>d(x=>({...x,name:p.target.value})),placeholder:"playwright",disabled:t||!s}),e.jsxs(P,{value:i.transport,onValueChange:p=>d(x=>({...x,transport:p})),disabled:t,children:[e.jsx(D,{children:e.jsx(O,{})}),e.jsxs(L,{children:[e.jsx(b,{value:"stdio",children:c("codex.stdio")}),e.jsx(b,{value:"streamable-http",children:c("codex.streamableHttp")})]})]}),i.transport==="stdio"?e.jsxs(e.Fragment,{children:[e.jsx(S,{value:i.command??"",onChange:p=>d(x=>({...x,command:p.target.value||null})),placeholder:"npx",disabled:t}),e.jsx(S,{value:ce(i.args),onChange:p=>d(x=>({...x,args:de(p.target.value)})),placeholder:"@playwright/mcp@latest, --flag",disabled:t})]}):e.jsx(S,{className:"sm:col-span-2",value:i.url??"",onChange:p=>d(x=>({...x,url:p.target.value||null})),placeholder:"https://example.test/mcp",disabled:t}),e.jsx(S,{type:"number",min:1,value:i.startupTimeoutSec??"",onChange:p=>d(x=>({...x,startupTimeoutSec:p.target.value?Number(p.target.value):null})),placeholder:"Startup timeout (sec)",disabled:t}),e.jsx(S,{type:"number",min:1,value:i.toolTimeoutSec??"",onChange:p=>d(x=>({...x,toolTimeoutSec:p.target.value?Number(p.target.value):null})),placeholder:"Tool timeout (sec)",disabled:t}),e.jsx(S,{value:ce(i.enabledTools),onChange:p=>d(x=>({...x,enabledTools:de(p.target.value)})),placeholder:"enabled_tools",disabled:t}),e.jsx(S,{value:ce(i.disabledTools),onChange:p=>d(x=>({...x,disabledTools:de(p.target.value)})),placeholder:"disabled_tools",disabled:t})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("label",{className:"flex items-center justify-between rounded-md border px-3 py-2 text-sm",children:["Enabled",e.jsx(J,{checked:i.enabled,onCheckedChange:p=>d(x=>({...x,enabled:p})),disabled:t})]}),e.jsxs("label",{className:"flex items-center justify-between rounded-md border px-3 py-2 text-sm",children:["Required",e.jsx(J,{checked:i.required,onCheckedChange:p=>d(x=>({...x,required:p})),disabled:t})]})]}),e.jsxs("div",{className:"flex justify-between gap-2",children:[e.jsxs(y,{variant:"outline",onClick:a,disabled:t||l||!o,children:[e.jsx(re,{className:"mr-2 h-4 w-4"}),"Delete"]}),e.jsxs(y,{onClick:()=>n(i.name,{transport:i.transport,command:i.command,args:i.args,url:i.url,enabled:i.enabled,required:i.required,startupTimeoutSec:i.startupTimeoutSec,toolTimeoutSec:i.toolTimeoutSec,enabledTools:i.enabledTools,disabledTools:i.disabledTools}),disabled:t||l||i.name.trim().length===0||m,children:[l?e.jsx(z,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Save MCP server"]})]})]})}function Es({entries:r,disabled:s=!1,disabledReason:t,saving:l=!1,onSave:o,onDelete:n}){const{t:a}=E(),[c,i]=N.useState("new"),d=N.useMemo(()=>r.find(j=>j.name===c)??null,[r,c]),m=d??ks,p=JSON.stringify(m),x=d?.isCcsManaged&&d.managementSurface==="browser-settings";return e.jsxs(Z,{title:"MCP servers",badge:"mcp_servers",icon:e.jsx(ss,{className:"h-4 w-4"}),description:"Manage the safe MCP transport fields. Keep auth headers and bearer tokens in raw TOML.",disabledReason:t,children:[x?e.jsxs("div",{className:"rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-900 dark:text-amber-200",children:[e.jsx("strong",{children:d?.name})," is CCS-managed. Configure browser tooling from"," ",e.jsx("code",{children:"Settings > Browser"}),"; the generic MCP editor is read-only for this entry."]}):null,e.jsxs(P,{value:c,onValueChange:i,disabled:s,children:[e.jsx(D,{children:e.jsx(O,{placeholder:"Select MCP server"})}),e.jsxs(L,{children:[e.jsx(b,{value:"new",children:a("codex.createNewMcpServer")}),r.map(j=>e.jsx(b,{value:j.name,children:j.isCcsManaged?`${j.name} (CCS managed)`:j.name},j.name))]})]}),e.jsx(Ts,{initialDraft:m,isNew:c==="new",disabled:s||!!x,saving:l,canDelete:d!==null&&!x,onDelete:async()=>{d&&(await n(d.name),i("new"))},onSave:async(j,h)=>{await o(j,h),i(j)}},p)]})}const Ps={name:"",displayName:null,baseUrl:null,envKey:null,wireApi:"responses",requiresOpenaiAuth:!1,supportsWebsockets:!1},Ds={name:"cliproxy",displayName:"CLIProxy Codex",baseUrl:"http://127.0.0.1:8317/api/provider/codex",envKey:"CLIPROXY_API_KEY",wireApi:"responses",requiresOpenaiAuth:!1,supportsWebsockets:!1};function Os({initialDraft:r,isNew:s,disabled:t,saving:l,canDelete:o,onSave:n,onDelete:a}){const{t:c}=E(),[i,d]=N.useState(r);return e.jsxs(e.Fragment,{children:[s&&e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 rounded-md border border-dashed px-3 py-2 text-xs text-muted-foreground",children:[e.jsxs("p",{children:["Quick start: apply the CLIProxy Codex preset here, then set"," ",e.jsx("strong",{children:c("codex.defaultProvider")})," to ",e.jsx("code",{children:"cliproxy"})," in Top-level settings."]}),e.jsx(y,{variant:"outline",size:"sm",onClick:()=>d(Ds),disabled:t,children:"Use CLIProxy Codex preset"})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(S,{value:i.name,onChange:m=>d(p=>({...p,name:m.target.value})),placeholder:"Provider id",disabled:t||!s}),e.jsx(S,{value:i.displayName??"",onChange:m=>d(p=>({...p,displayName:m.target.value||null})),placeholder:"Display name",disabled:t}),e.jsx(S,{value:i.baseUrl??"",onChange:m=>d(p=>({...p,baseUrl:m.target.value||null})),placeholder:"http://127.0.0.1:8317/api/provider/codex",disabled:t}),e.jsx(S,{value:i.envKey??"",onChange:m=>d(p=>({...p,envKey:m.target.value||null})),placeholder:"CLIPROXY_API_KEY",disabled:t})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[e.jsxs(P,{value:i.wireApi??"responses",onValueChange:m=>d(p=>({...p,wireApi:m})),disabled:t,children:[e.jsx(D,{children:e.jsx(O,{})}),e.jsx(L,{children:e.jsx(b,{value:"responses",children:c("codex.responses")})})]}),e.jsxs("label",{className:"flex items-center justify-between rounded-md border px-3 py-2 text-sm",children:["Requires OpenAI auth",e.jsx(J,{checked:i.requiresOpenaiAuth,onCheckedChange:m=>d(p=>({...p,requiresOpenaiAuth:m})),disabled:t})]}),e.jsxs("label",{className:"flex items-center justify-between rounded-md border px-3 py-2 text-sm",children:["Supports websockets",e.jsx(J,{checked:i.supportsWebsockets,onCheckedChange:m=>d(p=>({...p,supportsWebsockets:m})),disabled:t})]})]}),e.jsxs("div",{className:"flex justify-between gap-2",children:[e.jsxs(y,{variant:"outline",onClick:a,disabled:t||l||!o,children:[e.jsx(re,{className:"mr-2 h-4 w-4"}),"Delete"]}),e.jsxs(y,{onClick:()=>n(i.name,{displayName:i.displayName,baseUrl:i.baseUrl,envKey:i.envKey,wireApi:i.wireApi,requiresOpenaiAuth:i.requiresOpenaiAuth,supportsWebsockets:i.supportsWebsockets}),disabled:t||l||i.name.trim().length===0,children:[l?e.jsx(z,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Save provider"]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["If you want plain native ",e.jsx("code",{children:"codex"})," to default to CLIProxy, save a provider named"," ",e.jsx("code",{children:"cliproxy"})," with ",e.jsx("code",{children:"CLIPROXY_API_KEY"})," here, then pick"," ",e.jsx("code",{children:"cliproxy"})," in the ",e.jsx("strong",{children:c("codex.defaultProvider")})," control above."]})]})}function Ls({entries:r,disabled:s=!1,disabledReason:t,saving:l=!1,onSave:o,onDelete:n}){const{t:a}=E(),[c,i]=N.useState("new"),d=N.useMemo(()=>r.find(x=>x.name===c)??null,[r,c]),m=d??Ps,p=JSON.stringify(m);return e.jsxs(Z,{title:"Model providers",badge:"model_providers",icon:e.jsx(rs,{className:"h-4 w-4"}),description:"Edit the common provider fields CCS can support safely. Keep secret migration and inline bearer tokens in raw TOML.",disabledReason:t,children:[e.jsxs(P,{value:c,onValueChange:i,disabled:s,children:[e.jsx(D,{children:e.jsx(O,{placeholder:"Select provider"})}),e.jsxs(L,{children:[e.jsx(b,{value:"new",children:a("codex.createNewProvider")}),r.map(x=>e.jsx(b,{value:x.name,children:x.name},x.name))]})]}),e.jsx(Os,{initialDraft:m,isNew:c==="new",disabled:s,saving:l,canDelete:d!==null,onDelete:async()=>{d&&(await n(d.name),i("new"))},onSave:async(x,j)=>{await o(x,j),i(x)}},p)]})}function As({initialName:r,initialModel:s,initialProvider:t,initialEffort:l,providerNames:o,activeProfile:n,selectedEntryName:a,disabled:c,saving:i,onSave:d,onDelete:m,onSetActive:p}){const{t:x}=E(),[j,h]=N.useState(r),[w,M]=N.useState(s),[q,u]=N.useState(t),[v,G]=N.useState(l);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(S,{value:j,onChange:g=>h(g.target.value),placeholder:"deep-review",disabled:c||a!==null}),e.jsx(S,{value:w??"",onChange:g=>M(g.target.value||null),placeholder:"gpt-5.4",disabled:c}),e.jsxs(P,{value:q??"__unset__",onValueChange:g=>u(g==="__unset__"?null:g),disabled:c,children:[e.jsx(D,{children:e.jsx(O,{placeholder:x("codex.useGlobalProvider")})}),e.jsxs(L,{children:[e.jsx(b,{value:"__unset__",children:x("codex.useGlobalProvider")}),o.map(g=>e.jsx(b,{value:g,children:g},g))]})]}),e.jsxs(P,{value:v??"__unset__",onValueChange:g=>G(g==="__unset__"?null:g),disabled:c,children:[e.jsx(D,{children:e.jsx(O,{placeholder:x("codex.useGlobalEffort")})}),e.jsxs(L,{children:[e.jsx(b,{value:"__unset__",children:x("codex.useGlobalEffort")}),["minimal","low","medium","high","xhigh"].map(g=>e.jsx(b,{value:g,children:g},g))]})]})]}),e.jsxs("div",{className:"flex justify-between gap-2",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(y,{variant:"outline",onClick:m,disabled:c||i||!a,children:[e.jsx(re,{className:"mr-2 h-4 w-4"}),"Delete"]}),e.jsx(y,{variant:"outline",onClick:p,disabled:c||i||!a||a===n,children:"Set active"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(y,{variant:"outline",onClick:()=>d(j,{model:w,modelProvider:q,modelReasoningEffort:v},!1),disabled:c||i||j.trim().length===0,children:[i?e.jsx(z,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Save profile"]}),e.jsxs(y,{onClick:()=>d(j,{model:w,modelProvider:q,modelReasoningEffort:v},!0),disabled:c||i||j.trim().length===0,children:[i?e.jsx(z,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Save + activate"]})]})]})]})}function Ms({activeProfile:r,entries:s,providerNames:t,disabled:l=!1,disabledReason:o,saving:n=!1,onSave:a,onDelete:c,onSetActive:i}){const{t:d}=E(),[m,p]=N.useState("new"),x=N.useMemo(()=>s.find(h=>h.name===m)??null,[s,m]),j=JSON.stringify(x??{name:"",values:{}});return e.jsxs(Z,{title:d("codex.profiles"),badge:"profiles",icon:e.jsx(ts,{className:"h-4 w-4"}),description:"Create reusable Codex overlays and set the active default profile.",disabledReason:o,children:[e.jsxs(P,{value:m,onValueChange:p,disabled:l,children:[e.jsx(D,{children:e.jsx(O,{placeholder:"Select profile"})}),e.jsxs(L,{children:[e.jsx(b,{value:"new",children:d("codex.createNewProfile")}),s.map(h=>e.jsxs(b,{value:h.name,children:[h.name,h.name===r?" (active)":""]},h.name))]})]}),e.jsx(As,{initialName:x?.name??"",initialModel:x?.values.model??null,initialProvider:x?.values.modelProvider??null,initialEffort:x?.values.modelReasoningEffort??null,providerNames:t,activeProfile:r,selectedEntryName:x?.name??null,disabled:l,saving:n,onDelete:async()=>{x&&(await c(x.name),p("new"))},onSetActive:async()=>{x&&await i(x.name)},onSave:async(h,w,M)=>{await a(h,w,M),p(h)}},j)]})}function Rs({workspacePath:r,disabled:s,saving:t,onSave:l}){const{t:o}=E(),[n,a]=N.useState(r),[c,i]=N.useState("trusted");return e.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_160px_auto]",children:[e.jsx(S,{value:n,onChange:d=>a(d.target.value),placeholder:"~/repo or /absolute/path",disabled:s}),e.jsxs(P,{value:c,onValueChange:i,disabled:s,children:[e.jsx(D,{children:e.jsx(O,{})}),e.jsxs(L,{children:[e.jsx(b,{value:"trusted",children:o("codex.trusted")}),e.jsx(b,{value:"untrusted",children:o("codex.untrusted")})]})]}),e.jsxs(y,{onClick:()=>l(n,c),disabled:s||t,children:[t?e.jsx(z,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Save trust"]})]})}function Is({workspacePath:r,entries:s,disabled:t=!1,disabledReason:l,saving:o=!1,onSave:n}){const{t:a}=E();return e.jsxs(Z,{title:"Project trust",badge:"projects",icon:e.jsx(ns,{className:"h-4 w-4"}),description:"Trust current workspaces or remove stale trust entries without opening raw TOML.",disabledReason:l,children:[e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Paths must be absolute or start with ",e.jsx("code",{children:"~/"}),". Relative paths are rejected so CCS does not trust the wrong folder."]}),e.jsx(Rs,{workspacePath:r,disabled:t,saving:o,onSave:n},r),e.jsx(y,{variant:"outline",className:"w-full justify-start",onClick:()=>n(r,"trusted"),disabled:t||o,children:"Trust current workspace"}),e.jsx("div",{className:"space-y-2",children:s.length===0?e.jsx("p",{className:"text-xs text-muted-foreground",children:a("codex.noProjectTrustEntries")}):s.map(c=>e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border px-3 py-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:c.path}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["trust_level = ",c.trustLevel]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(y,{variant:"ghost",size:"sm",onClick:()=>n(c.path,c.trustLevel==="trusted"?"untrusted":"trusted"),disabled:t||o,children:"Toggle"}),e.jsx(y,{variant:"ghost",size:"icon",onClick:()=>n(c.path,null),disabled:t||o,children:e.jsx(re,{className:"h-4 w-4"})})]})]},c.path))})]})}const A="__unset__",Fs=105e4,Ws=272e3,_e=8e5,ke=7e5,Ks=new Intl.NumberFormat("en-US");function X(r){return r??A}function Y(r,s){return s&&!r.includes(s)?[s,...r]:r}function xe(r){return Ks.format(r)}function qs(r){return r?.trim().toLowerCase().startsWith("gpt-5.4")??!1}function Us(r,s){const t={};return s.model!==r.model&&(t.model=s.model),s.modelReasoningEffort!==r.modelReasoningEffort&&(t.modelReasoningEffort=s.modelReasoningEffort),s.modelContextWindow!==r.modelContextWindow&&(t.modelContextWindow=s.modelContextWindow),s.modelAutoCompactTokenLimit!==r.modelAutoCompactTokenLimit&&(t.modelAutoCompactTokenLimit=s.modelAutoCompactTokenLimit),s.modelProvider!==r.modelProvider&&(t.modelProvider=s.modelProvider),s.approvalPolicy!==r.approvalPolicy&&(t.approvalPolicy=s.approvalPolicy),s.sandboxMode!==r.sandboxMode&&(t.sandboxMode=s.sandboxMode),s.webSearch!==r.webSearch&&(t.webSearch=s.webSearch),s.toolOutputTokenLimit!==r.toolOutputTokenLimit&&(t.toolOutputTokenLimit=s.toolOutputTokenLimit),s.personality!==r.personality&&(t.personality=s.personality),t}function Vs({initialValues:r,providerNames:s,disabled:t,saving:l,onSave:o}){const{t:n}=E(),[a,c]=N.useState(r),i=Y(["minimal","low","medium","high","xhigh"],a.modelReasoningEffort),d=Y(s,a.modelProvider),m=Y(["on-request","never","untrusted"],a.approvalPolicy),p=Y(["read-only","workspace-write","danger-full-access"],a.sandboxMode),x=Y(["cached","live","disabled"],a.webSearch),j=Y(["none","friendly","pragmatic"],a.personality),h=Us(r,a),w=Object.keys(h).length>0,M=qs(a.model),q=u=>{const v=u.trim();return v.length>0?Number(v):null};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n("codex.model")}),e.jsx(S,{value:a.model??"",onChange:u=>c(v=>({...v,model:u.target.value||null})),placeholder:"gpt-5.5",disabled:t})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n("codex.reasoningEffort")}),e.jsxs(P,{value:X(a.modelReasoningEffort),onValueChange:u=>c(v=>({...v,modelReasoningEffort:u===A?null:u})),disabled:t,children:[e.jsx(D,{children:e.jsx(O,{placeholder:n("codex.useDefault")})}),e.jsxs(L,{children:[e.jsx(b,{value:A,children:n("codex.useDefault")}),i.map(u=>e.jsx(b,{value:u,children:u},u))]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n("codex.defaultProvider")}),e.jsxs(P,{value:X(a.modelProvider),onValueChange:u=>c(v=>({...v,modelProvider:u===A?null:u})),disabled:t,children:[e.jsx(D,{children:e.jsx(O,{placeholder:n("codex.useCodexDefault")})}),e.jsxs(L,{children:[e.jsx(b,{value:A,children:n("codex.useCodexDefault")}),d.map(u=>e.jsx(b,{value:u,children:u},u))]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n("codex.approvalPolicy")}),e.jsxs(P,{value:X(a.approvalPolicy),onValueChange:u=>c(v=>({...v,approvalPolicy:u===A?null:u})),disabled:t,children:[e.jsx(D,{children:e.jsx(O,{placeholder:n("codex.useDefault")})}),e.jsxs(L,{children:[e.jsx(b,{value:A,children:n("codex.useDefault")}),m.map(u=>e.jsx(b,{value:u,children:u},u))]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n("codex.sandboxMode")}),e.jsxs(P,{value:X(a.sandboxMode),onValueChange:u=>c(v=>({...v,sandboxMode:u===A?null:u})),disabled:t,children:[e.jsx(D,{children:e.jsx(O,{placeholder:n("codex.useDefault")})}),e.jsxs(L,{children:[e.jsx(b,{value:A,children:n("codex.useDefault")}),p.map(u=>e.jsx(b,{value:u,children:u},u))]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n("codex.webSearch")}),e.jsxs(P,{value:X(a.webSearch),onValueChange:u=>c(v=>({...v,webSearch:u===A?null:u})),disabled:t,children:[e.jsx(D,{children:e.jsx(O,{placeholder:n("codex.useDefault")})}),e.jsxs(L,{children:[e.jsx(b,{value:A,children:n("codex.useDefault")}),x.map(u=>e.jsx(b,{value:u,children:u},u))]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n("codex.toolOutputTokenLimit")}),e.jsx(S,{type:"number",min:1,value:a.toolOutputTokenLimit??"",onChange:u=>c(v=>({...v,toolOutputTokenLimit:u.target.value?Number(u.target.value):null})),placeholder:"25000",disabled:t})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n("codex.personality")}),e.jsxs(P,{value:X(a.personality),onValueChange:u=>c(v=>({...v,personality:u===A?null:u})),disabled:t,children:[e.jsx(D,{children:e.jsx(O,{placeholder:n("codex.useDefault")})}),e.jsxs(L,{children:[e.jsx(b,{value:A,children:n("codex.useDefault")}),j.map(u=>e.jsx(b,{value:u,children:u},u))]})]})]})]}),e.jsxs("div",{className:"space-y-4 rounded-xl border border-amber-500/30 bg-amber-500/5 p-4 shadow-sm dark:bg-amber-400/5",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(os,{className:"h-4 w-4 text-amber-600 dark:text-amber-300"}),e.jsx("p",{className:"text-sm font-semibold",children:n("codex.longContextOverride")}),e.jsx(_,{variant:"outline",className:"border-amber-500/40 bg-background/80 text-[10px] uppercase tracking-[0.16em] text-amber-700 dark:text-amber-300",children:"Manual opt-in only"}),e.jsx(_,{variant:"secondary",className:"text-[10px] uppercase tracking-[0.16em] text-muted-foreground",children:M?"GPT-5.4 long-context selected":"GPT-5.4 long-context reference"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Draft values only. Nothing applies until Save."})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(y,{type:"button",variant:"outline",size:"sm",disabled:t,onClick:()=>c(u=>({...u,modelContextWindow:_e,modelAutoCompactTokenLimit:ke})),children:"Fill cautious pair"}),e.jsx(y,{type:"button",variant:"outline",size:"sm",disabled:t,onClick:()=>c(u=>({...u,modelContextWindow:Fs})),children:"Set official max window"}),e.jsx(y,{type:"button",variant:"ghost",size:"sm",disabled:t,onClick:()=>c(u=>({...u,modelContextWindow:null,modelAutoCompactTokenLimit:null})),children:"Clear"})]})]}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-3",children:[e.jsxs("div",{className:"rounded-lg border bg-background/85 px-3 py-3 shadow-sm shadow-black/5",children:[e.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:"Official max"}),e.jsx("p",{className:"mt-1 font-mono text-base font-semibold text-foreground",children:"1.05M / 1M"}),e.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:n("codex.gptContextCap")})]}),e.jsxs("div",{className:"rounded-lg border bg-background/85 px-3 py-3 shadow-sm shadow-black/5",children:[e.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:"Standard window"}),e.jsx("p",{className:"mt-1 font-mono text-base font-semibold text-foreground",children:xe(Ws)}),e.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:n("codex.normalUsageWindow")})]}),e.jsxs("div",{className:"rounded-lg border bg-background/85 px-3 py-3 shadow-sm shadow-black/5",children:[e.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:"Above 272K"}),e.jsx("p",{className:"mt-1 font-mono text-base font-semibold text-foreground",children:n("codex.counts2x")}),e.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:n("codex.usageLimitCost")})]})]}),e.jsxs("div",{className:"space-y-3 rounded-lg border bg-background/75 px-3 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:"One cautious pair"}),e.jsxs("div",{className:"rounded-full border bg-background px-2.5 py-1 font-mono text-[11px] font-medium",children:["Context ",xe(_e)]}),e.jsxs("div",{className:"rounded-full border bg-background px-2.5 py-1 font-mono text-[11px] font-medium",children:["Auto-compact ",xe(ke)]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.jsx(_,{variant:"outline",className:"border-border/70 bg-background/80 text-[10px] uppercase tracking-[0.14em] text-muted-foreground",children:"Not official"}),e.jsx(_,{variant:"outline",className:"border-border/70 bg-background/80 text-[10px] uppercase tracking-[0.14em] text-muted-foreground",children:"Draft only"})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground",children:[e.jsx("span",{children:n("codex.quickFillWarning")}),!M&&a.model?e.jsxs("span",{children:[e.jsx("code",{children:a.model})," should be checked separately."]}):null]})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n("codex.modelContextWindow")}),e.jsx(S,{"aria-label":n("codex.modelContextWindow"),type:"number",min:1,value:a.modelContextWindow??"",onChange:u=>c(v=>({...v,modelContextWindow:q(u.target.value)})),placeholder:"Unset",disabled:t}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Writes ",e.jsx("code",{children:"model_context_window"}),". Leave unset to keep Codex defaults."]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n("codex.autoCompactTokenLimit")}),e.jsx(S,{"aria-label":n("codex.autoCompactTokenLimit"),type:"number",min:1,value:a.modelAutoCompactTokenLimit??"",onChange:u=>c(v=>({...v,modelAutoCompactTokenLimit:q(u.target.value)})),placeholder:"Unset",disabled:t}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Writes ",e.jsx("code",{children:"model_auto_compact_token_limit"}),". Leave unset to keep model defaults."]})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground",children:[e.jsx("span",{className:"text-[10px] uppercase tracking-[0.14em]",children:"Docs"}),e.jsx("a",{href:"https://platform.openai.com/docs/models",target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"GPT-5 model guide"}),e.jsx("a",{href:"https://openai.com/index/introducing-gpt-5-5/",target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Release notes"}),e.jsx("a",{href:"https://developers.openai.com/codex/config-reference",target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Config reference"})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(y,{onClick:()=>o(h),disabled:t||l||!w,children:[l?e.jsx(z,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Save top-level settings"]})})]})}function Bs({values:r,providerNames:s,disabled:t=!1,disabledReason:l,saving:o=!1,onSave:n}){return e.jsx(Z,{title:"Top-level controls",badge:"config.toml",icon:e.jsx(as,{className:"h-4 w-4"}),description:"Structured controls for the stable top-level Codex settings users touch most often. Unsupported upstream shapes stay untouched and should be edited in raw TOML.",disabledReason:l,children:e.jsx(Vs,{initialValues:r,providerNames:s,disabled:t,saving:o,onSave:n},JSON.stringify(r))})}function Gs({workspacePath:r,activeProfile:s,topLevelSettings:t,projectTrustEntries:l,profileEntries:o,modelProviderEntries:n,mcpServerEntries:a,featureCatalog:c,featureState:i,disabled:d,disabledReason:m,saving:p,onPatch:x}){const{t:j}=E();return e.jsx(fe,{className:"h-full",children:e.jsxs("div",{className:"space-y-6 pr-1 pb-6",children:[e.jsxs("div",{className:"group relative overflow-hidden rounded-xl border border-border/80 bg-background/50 p-5 shadow-sm transition-all hover:bg-background hover:shadow-md dark:border-border/60",children:[e.jsx("div",{className:"absolute inset-x-0 -top-px h-px bg-gradient-to-r from-transparent via-foreground/15 to-transparent transition-opacity group-hover:via-foreground/30"}),e.jsxs("div",{className:"flex flex-col gap-6 lg:flex-row lg:items-start lg:justify-between",children:[e.jsxs("div",{className:"flex-1 space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg border border-primary/20 bg-primary/10 text-primary transition-colors group-hover:border-primary/30",children:e.jsx(ls,{className:"h-4 w-4"})}),e.jsx("div",{children:e.jsx("h2",{className:"text-base font-semibold tracking-tight text-foreground",children:j("codex.controlCenter")})})]}),e.jsxs("ul",{className:"grid gap-3 sm:grid-cols-2 text-sm text-muted-foreground",children:[e.jsxs("li",{className:"flex items-start gap-2.5",children:[e.jsx(is,{className:"h-4 w-4 shrink-0 text-muted-foreground/60 mt-0.5"}),e.jsxs("span",{className:"leading-relaxed",children:["Writes exclusively to user-layer"," ",e.jsx("code",{className:"text-[11px] bg-muted/70 px-1.5 py-0.5 rounded border border-border/50",children:"config.toml"})]})]}),e.jsxs("li",{className:"flex items-start gap-2.5",children:[e.jsx(cs,{className:"h-4 w-4 shrink-0 text-muted-foreground/60 mt-0.5"}),e.jsx("span",{className:"leading-relaxed",children:"Does not reflect repo trust layers or CLI overrides"})]})]})]}),e.jsx("div",{className:"shrink-0 lg:w-[280px]",children:e.jsx("div",{className:"relative overflow-hidden rounded-lg border border-amber-500/20 bg-amber-500/5 p-4 transition-colors group-hover:border-amber-500/30 group-hover:bg-amber-500/10 dark:border-amber-400/10 dark:bg-amber-400/5",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(ds,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-600 dark:text-amber-400"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[11px] font-bold text-amber-700 dark:text-amber-300 uppercase tracking-wider",children:"Formatting Note"}),e.jsx("p",{className:"text-[13px] leading-relaxed text-amber-800/80 dark:text-amber-200/70",children:"Saves normalize TOML formatting and strip comments. Switch to the raw editor if exact layout matters."})]})]})})})]})]}),e.jsx(Bs,{values:t,providerNames:n.map(h=>h.name),disabled:d,disabledReason:m,saving:p,onSave:h=>x({kind:"top-level",values:h},j("toasts.codexSaved"))}),e.jsx(Is,{workspacePath:r,entries:l,disabled:d,disabledReason:m,saving:p,onSave:(h,w)=>x({kind:"project-trust",path:h,trustLevel:w},w?"Saved project trust entry.":"Removed project trust entry.")}),e.jsx(Ms,{activeProfile:s,entries:o,providerNames:n.map(h=>h.name),disabled:d,disabledReason:m,saving:p,onSave:(h,w,M)=>x({kind:"profile",action:"upsert",name:h,values:w,setAsActive:M},"Saved profile."),onDelete:h=>x({kind:"profile",action:"delete",name:h},"Deleted profile."),onSetActive:h=>x({kind:"profile",action:"set-active",name:h},"Set active profile.")}),e.jsx(Ls,{entries:n,disabled:d,disabledReason:m,saving:p,onSave:(h,w)=>x({kind:"model-provider",action:"upsert",name:h,values:w},"Saved model provider."),onDelete:h=>x({kind:"model-provider",action:"delete",name:h},"Deleted model provider.")}),e.jsx(Es,{entries:a,disabled:d,disabledReason:m,saving:p,onSave:(h,w)=>x({kind:"mcp-server",action:"upsert",name:h,values:w},"Saved MCP server."),onDelete:h=>x({kind:"mcp-server",action:"delete",name:h},"Deleted MCP server.")}),e.jsx(_s,{catalog:c,state:i,disabled:d,disabledReason:m,onToggle:(h,w)=>x({kind:"feature",feature:h,enabled:w},"Saved feature toggle.")})]})})}const Oe=`model_provider = "cliproxy"
|
|
2
|
-
|
|
3
|
-
[model_providers.cliproxy]
|
|
4
|
-
name = "CLIProxy Codex"
|
|
5
|
-
base_url = "http://127.0.0.1:8317/api/provider/codex"
|
|
6
|
-
env_key = "CLIPROXY_API_KEY"
|
|
7
|
-
wire_api = "responses"
|
|
8
|
-
requires_openai_auth = false
|
|
9
|
-
supports_websockets = false`,$s=["multi_agent","unified_exec","shell_snapshot","apply_patch_freeform","js_repl","runtime_metrics","prevent_idle_sleep","fast_mode","apps","smart_approvals"];function zs(){return[{name:"multi_agent",label:C.t("codex.featureMultiAgentLabel"),description:C.t("codex.featureMultiAgentDesc")},{name:"unified_exec",label:C.t("codex.featureUnifiedExecLabel"),description:C.t("codex.featureUnifiedExecDesc")},{name:"shell_snapshot",label:C.t("codex.featureShellSnapshotLabel"),description:C.t("codex.featureShellSnapshotDesc")},{name:"apply_patch_freeform",label:C.t("codex.featureApplyPatchLabel"),description:C.t("codex.featureApplyPatchDesc")},{name:"js_repl",label:C.t("codex.featureJsReplLabel"),description:C.t("codex.featureJsReplDesc")},{name:"runtime_metrics",label:C.t("codex.featureRuntimeMetricsLabel"),description:C.t("codex.featureRuntimeMetricsDesc")},{name:"prevent_idle_sleep",label:C.t("codex.featurePreventIdleSleepLabel"),description:C.t("codex.featurePreventIdleSleepDesc")},{name:"fast_mode",label:C.t("codex.featureFastModeLabel"),description:C.t("codex.featureFastModeDesc")},{name:"apps",label:C.t("codex.featureAppsLabel"),description:C.t("codex.featureAppsDesc")},{name:"smart_approvals",label:C.t("codex.featureSmartApprovalsLabel"),description:C.t("codex.featureSmartApprovalsDesc")}]}function B(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)?r:null}function T(r){return typeof r=="string"&&r.trim().length>0?r.trim():null}function Q(r){return typeof r=="number"&&Number.isFinite(r)?r:null}function ue(r){return Array.isArray(r)?r.filter(s=>typeof s=="string").map(s=>s.trim()):[]}function Le(r){return{model:T(r?.model),modelReasoningEffort:T(r?.model_reasoning_effort),modelContextWindow:Q(r?.model_context_window),modelAutoCompactTokenLimit:Q(r?.model_auto_compact_token_limit),modelProvider:T(r?.model_provider),approvalPolicy:T(r?.approval_policy),sandboxMode:T(r?.sandbox_mode),webSearch:T(r?.web_search),toolOutputTokenLimit:Q(r?.tool_output_token_limit),personality:T(r?.personality)}}function Xs(r){const s=B(r?.projects);return s?Object.entries(s).map(([t,l])=>{const o=T(B(l)?.trust_level);return o?{path:t,trustLevel:o}:null}).filter(t=>t!==null).sort((t,l)=>t.path.localeCompare(l.path)):[]}function Ys(r){const s=B(r?.profiles);return s?Object.entries(s).map(([t,l])=>({name:t,values:Le(B(l))})).sort((t,l)=>t.name.localeCompare(l.name)):[]}function Hs(r){const s=B(r?.model_providers);return s?Object.entries(s).map(([t,l])=>{const o=B(l);return o?{name:t,displayName:T(o.name),baseUrl:T(o.base_url),envKey:T(o.env_key),wireApi:T(o.wire_api),requiresOpenaiAuth:o.requires_openai_auth===!0,supportsWebsockets:o.supports_websockets===!0}:null}).filter(t=>t!==null).sort((t,l)=>t.name.localeCompare(l.name)):[]}function Qs(r){const s=B(r?.mcp_servers);return s?Object.entries(s).map(([t,l])=>{const o=B(l);if(!o)return null;const n=T(o.command)?"stdio":"streamable-http",a=Q(o.startup_timeout_ms);return{name:t,transport:n,command:T(o.command),args:ue(o.args),url:T(o.url),enabled:o.enabled!==!1,required:o.required===!0,startupTimeoutSec:Q(o.startup_timeout_sec)??(a!==null?a/1e3:null),toolTimeoutSec:Q(o.tool_timeout_sec),enabledTools:ue(o.enabled_tools),disabledTools:ue(o.disabled_tools),isCcsManaged:t==="ccs_browser",managementSurface:t==="ccs_browser"?"browser-settings":null}}).filter(t=>t!==null).sort((t,l)=>t.name.localeCompare(l.name)):[]}function Js(r){const s=B(r?.features),t={};for(const l of $s){const o=s?.[l];t[l]=typeof o=="boolean"?o:null}if(s)for(const[l,o]of Object.entries(s))l in t||(t[l]=typeof o=="boolean"?o:null);return t}const Zs=[{id:"codex-config-basic",label:"Codex Config Basics",url:"https://developers.openai.com/codex/config-basic",description:"Official user-layer setup, config location, and baseline configuration behavior."},{id:"codex-config-advanced",label:"Codex Config Advanced",url:"https://developers.openai.com/codex/config-advanced",description:"Layering, trust, profiles, and advanced config behavior."},{id:"codex-config-reference",label:"Codex Config Reference",url:"https://developers.openai.com/codex/config-reference",description:"Canonical upstream config surface for providers, MCP, features, and trust."},{id:"codex-releases",label:"Codex GitHub Releases",url:"https://github.com/openai/codex/releases",description:"Track upstream release notes and fast-moving CLI changes."}],er=[{provider:"openai",label:"OpenAI Responses API",apiFormat:"Responses API",url:"https://platform.openai.com/docs/api-reference/responses"}];function sr(r){const s=/https?:\/\/[^\s)]+/g,t=[];let l=0,o;for(;(o=s.exec(r))!==null;){const[n]=o,a=o.index;a>l&&t.push(r.slice(l,a)),t.push(e.jsx("a",{href:n,target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:n},`${n}-${a}`)),l=a+n.length}return l<r.length&&t.push(r.slice(l)),t.length>0?t:[r]}function rr({diagnostics:r}){const{t:s}=E(),t=r.docsReference??{notes:[],links:[],providerDocs:[],providerValues:[],settingsHierarchy:[]},l=t.links.length>0?t.links:Zs,o=t.providerDocs.length>0?t.providerDocs:er;return e.jsx(fe,{className:"h-full",children:e.jsxs("div",{className:"space-y-4 pr-1",children:[e.jsxs(I,{children:[e.jsx(F,{className:"pb-2",children:e.jsxs(W,{className:"flex items-center gap-2 text-base",children:[e.jsx(me,{className:"h-4 w-4"}),"CCS bridge recipe"]})}),e.jsxs(K,{className:"space-y-3 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("p",{children:[e.jsx("strong",{children:s("codex.builtInLabel")})," ",s("codex.builtInCcsxpDesc")]}),e.jsxs("p",{children:[e.jsx("strong",{children:s("codex.nativeRecipeLabel")})," ",s("codex.nativeRecipeDesc")]}),e.jsxs("p",{children:[e.jsx("strong",{children:s("codex.managedBridgeLabel")})," ",s("codex.managedBridgeDesc")]})]}),e.jsx("pre",{className:"overflow-x-auto rounded-md border bg-muted/20 p-3 text-xs text-foreground",children:Oe}),e.jsxs("ol",{className:"ml-4 list-decimal space-y-1.5 [&>li]:pl-1",children:[e.jsxs("li",{children:["Save the ",e.jsx("code",{children:"cliproxy"})," provider in your user config."]}),e.jsxs("li",{children:["Set top-level ",e.jsx("code",{children:"model_provider"})," to ",e.jsx("code",{children:"cliproxy"}),"."]}),e.jsxs("li",{children:["Export ",e.jsx("code",{children:"CLIPROXY_API_KEY"})," before launching native Codex."]})]}),e.jsxs("p",{children:["CCS-managed browser tooling belongs to ",e.jsx("code",{children:"Settings > Browser"}),". Do not edit the ",e.jsx("code",{children:"ccs_browser"})," entry from the generic MCP card unless you are intentionally overriding the managed path in raw TOML."]})]})]}),e.jsxs(I,{children:[e.jsx(F,{className:"pb-2",children:e.jsxs(W,{className:"flex items-center gap-2 text-base",children:[e.jsx(me,{className:"h-4 w-4"}),"Upstream notes"]})}),e.jsxs(K,{className:"space-y-2 text-sm",children:[t.notes.length>0&&e.jsx("ul",{className:"ml-4 list-disc space-y-1.5 text-muted-foreground [&>li]:pl-1",children:t.notes.map((n,a)=>e.jsx("li",{children:sr(n)},`${a}-${n}`))}),e.jsx(ee,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:s("codex.codexDocs")}),e.jsx("div",{className:"space-y-1.5",children:l.map(n=>e.jsxs("a",{href:n.url,target:"_blank",rel:"noreferrer",className:"block rounded-md border px-2.5 py-2 transition-colors hover:bg-muted/50",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs font-medium",children:n.label}),e.jsx(we,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),e.jsx("p",{className:"mt-0.5 text-[11px] text-muted-foreground",children:n.description}),e.jsx("p",{className:"mt-1 break-all font-mono text-[11px] text-muted-foreground/90 underline underline-offset-2",children:n.url})]},n.id))})]}),e.jsx(ee,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:"Provider / bridge reference"}),e.jsx("div",{className:"space-y-1.5",children:o.map(n=>e.jsxs("a",{href:n.url,target:"_blank",rel:"noreferrer",className:"block rounded-md border px-2.5 py-2 transition-colors hover:bg-muted/50",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs font-medium",children:n.label}),e.jsx(we,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),e.jsxs("p",{className:"mt-0.5 text-[11px] text-muted-foreground",children:["provider: ",n.provider," | format: ",n.apiFormat]}),e.jsx("p",{className:"mt-1 break-all font-mono text-[11px] text-muted-foreground/90 underline underline-offset-2",children:n.url})]},`${n.provider}-${n.url}`))})]}),t.providerValues.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(ee,{}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Provider values: ",t.providerValues.join(", ")]})]}),t.settingsHierarchy.length>0&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Settings hierarchy: ",t.settingsHierarchy.join(" -> ")]})]})]})]})})}function tr(r,s){let t=r.slice(0,s).split(/\r\n|\n|\r/g);return[t.length,t.pop().length+1]}function nr(r,s,t){let l=r.split(/\r\n|\n|\r/g),o="",n=(Math.log10(s+1)|0)+1;for(let a=s-1;a<=s+1;a++){let c=l[a-1];c&&(o+=a.toString().padEnd(n," "),o+=": ",o+=c,o+=`
|
|
10
|
-
`,a===s&&(o+=" ".repeat(n+t+2),o+=`^
|
|
11
|
-
`))}return o}class f extends Error{line;column;codeblock;constructor(s,t){const[l,o]=tr(t.toml,t.ptr),n=nr(t.toml,l,o);super(`Invalid TOML document: ${s}
|
|
12
|
-
|
|
13
|
-
${n}`,t),this.line=l,this.column=o,this.codeblock=n}}function ar(r,s){let t=0;for(;r[s-++t]==="\\";);return--t&&t%2}function pe(r,s=0,t=r.length){let l=r.indexOf(`
|
|
14
|
-
`,s);return r[l-1]==="\r"&&l--,l<=t?l:-1}function te(r,s){for(let t=s;t<r.length;t++){let l=r[t];if(l===`
|
|
15
|
-
`)return t;if(l==="\r"&&r[t+1]===`
|
|
16
|
-
`)return t+1;if(l<" "&&l!==" "||l==="")throw new f("control characters are not allowed in comments",{toml:r,ptr:s})}return r.length}function V(r,s,t,l){let o;for(;;){for(;(o=r[s])===" "||o===" "||!t&&(o===`
|
|
17
|
-
`||o==="\r"&&r[s+1]===`
|
|
18
|
-
`);)s++;if(l||o!=="#")break;s=te(r,s)}return s}function or(r,s,t,l,o=!1){if(!l)return s=pe(r,s),s<0?r.length:s;for(let n=s;n<r.length;n++){let a=r[n];if(a==="#")n=pe(r,n);else{if(a===t)return n+1;if(a===l||o&&(a===`
|
|
19
|
-
`||a==="\r"&&r[n+1]===`
|
|
20
|
-
`))return n}}throw new f("cannot find end of structure",{toml:r,ptr:s})}function Ae(r,s){let t=r[s],l=t===r[s+1]&&r[s+1]===r[s+2]?r.slice(s,s+3):t;s+=l.length-1;do s=r.indexOf(l,++s);while(s>-1&&t!=="'"&&ar(r,s));return s>-1&&(s+=l.length,l.length>1&&(r[s]===t&&s++,r[s]===t&&s++)),s}let lr=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;class H extends Date{#s=!1;#r=!1;#e=null;constructor(s){let t=!0,l=!0,o="Z";if(typeof s=="string"){let n=s.match(lr);n?(n[1]||(t=!1,s=`0000-01-01T${s}`),l=!!n[2],l&&s[10]===" "&&(s=s.replace(" ","T")),n[2]&&+n[2]>23?s="":(o=n[3]||null,s=s.toUpperCase(),!o&&l&&(s+="Z"))):s=""}super(s),isNaN(this.getTime())||(this.#s=t,this.#r=l,this.#e=o)}isDateTime(){return this.#s&&this.#r}isLocal(){return!this.#s||!this.#r||!this.#e}isDate(){return this.#s&&!this.#r}isTime(){return this.#r&&!this.#s}isValid(){return this.#s||this.#r}toISOString(){let s=super.toISOString();if(this.isDate())return s.slice(0,10);if(this.isTime())return s.slice(11,23);if(this.#e===null)return s.slice(0,-1);if(this.#e==="Z")return s;let t=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return t=this.#e[0]==="-"?t:-t,new Date(this.getTime()-t*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(s,t="Z"){let l=new H(s);return l.#e=t,l}static wrapAsLocalDateTime(s){let t=new H(s);return t.#e=null,t}static wrapAsLocalDate(s){let t=new H(s);return t.#r=!1,t.#e=null,t}static wrapAsLocalTime(s){let t=new H(s);return t.#s=!1,t.#e=null,t}}let ir=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,cr=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,dr=/^[+-]?0[0-9_]/,xr=/^[0-9a-f]{2,8}$/i,Te={b:"\b",t:" ",n:`
|
|
21
|
-
`,f:"\f",r:"\r",e:"\x1B",'"':'"',"\\":"\\"};function Me(r,s=0,t=r.length){let l=r[s]==="'",o=r[s++]===r[s]&&r[s]===r[s+1];o&&(t-=2,r[s+=2]==="\r"&&s++,r[s]===`
|
|
22
|
-
`&&s++);let n=0,a,c="",i=s;for(;s<t-1;){let d=r[s++];if(d===`
|
|
23
|
-
`||d==="\r"&&r[s]===`
|
|
24
|
-
`){if(!o)throw new f("newlines are not allowed in strings",{toml:r,ptr:s-1})}else if(d<" "&&d!==" "||d==="")throw new f("control characters are not allowed in strings",{toml:r,ptr:s-1});if(a){if(a=!1,d==="x"||d==="u"||d==="U"){let m=r.slice(s,s+=d==="x"?2:d==="u"?4:8);if(!xr.test(m))throw new f("invalid unicode escape",{toml:r,ptr:n});try{c+=String.fromCodePoint(parseInt(m,16))}catch{throw new f("invalid unicode escape",{toml:r,ptr:n})}}else if(o&&(d===`
|
|
25
|
-
`||d===" "||d===" "||d==="\r")){if(s=V(r,s-1,!0),r[s]!==`
|
|
26
|
-
`&&r[s]!=="\r")throw new f("invalid escape: only line-ending whitespace may be escaped",{toml:r,ptr:n});s=V(r,s)}else if(d in Te)c+=Te[d];else throw new f("unrecognized escape sequence",{toml:r,ptr:n});i=s}else!l&&d==="\\"&&(n=s-1,a=!0,c+=r.slice(i,n))}return c+r.slice(i,t-1)}function ur(r,s,t,l){if(r==="true")return!0;if(r==="false")return!1;if(r==="-inf")return-1/0;if(r==="inf"||r==="+inf")return 1/0;if(r==="nan"||r==="+nan"||r==="-nan")return NaN;if(r==="-0")return l?0n:0;let o=ir.test(r);if(o||cr.test(r)){if(dr.test(r))throw new f("leading zeroes are not allowed",{toml:s,ptr:t});r=r.replace(/_/g,"");let a=+r;if(isNaN(a))throw new f("invalid number",{toml:s,ptr:t});if(o){if((o=!Number.isSafeInteger(a))&&!l)throw new f("integer value cannot be represented losslessly",{toml:s,ptr:t});(o||l===!0)&&(a=BigInt(r))}return a}const n=new H(r);if(!n.isValid())throw new f("invalid value",{toml:s,ptr:t});return n}function mr(r,s,t){let l=r.slice(s,t),o=l.indexOf("#");return o>-1&&(te(r,o),l=l.slice(0,o)),[l.trimEnd(),o]}function ge(r,s,t,l,o){if(l===0)throw new f("document contains excessively nested structures. aborting.",{toml:r,ptr:s});let n=r[s];if(n==="["||n==="{"){let[i,d]=n==="["?fr(r,s,l,o):hr(r,s,l,o);if(t){if(d=V(r,d),r[d]===",")d++;else if(r[d]!==t)throw new f("expected comma or end of structure",{toml:r,ptr:d})}return[i,d]}let a;if(n==='"'||n==="'"){a=Ae(r,s);let i=Me(r,s,a);if(t){if(a=V(r,a),r[a]&&r[a]!==","&&r[a]!==t&&r[a]!==`
|
|
27
|
-
`&&r[a]!=="\r")throw new f("unexpected character encountered",{toml:r,ptr:a});a+=+(r[a]===",")}return[i,a]}a=or(r,s,",",t);let c=mr(r,s,a-+(r[a-1]===","));if(!c[0])throw new f("incomplete key-value declaration: no value specified",{toml:r,ptr:s});return t&&c[1]>-1&&(a=V(r,s+c[1]),a+=+(r[a]===",")),[ur(c[0],r,s,o),a]}let pr=/^[a-zA-Z0-9-_]+[ \t]*$/;function he(r,s,t="="){let l=s-1,o=[],n=r.indexOf(t,s);if(n<0)throw new f("incomplete key-value: cannot find end of key",{toml:r,ptr:s});do{let a=r[s=++l];if(a!==" "&&a!==" ")if(a==='"'||a==="'"){if(a===r[s+1]&&a===r[s+2])throw new f("multiline strings are not allowed in keys",{toml:r,ptr:s});let c=Ae(r,s);if(c<0)throw new f("unfinished string encountered",{toml:r,ptr:s});l=r.indexOf(".",c);let i=r.slice(c,l<0||l>n?n:l),d=pe(i);if(d>-1)throw new f("newlines are not allowed in keys",{toml:r,ptr:s+l+d});if(i.trimStart())throw new f("found extra tokens after the string part",{toml:r,ptr:c});if(n<c&&(n=r.indexOf(t,c),n<0))throw new f("incomplete key-value: cannot find end of key",{toml:r,ptr:s});o.push(Me(r,s,c))}else{l=r.indexOf(".",s);let c=r.slice(s,l<0||l>n?n:l);if(!pr.test(c))throw new f("only letter, numbers, dashes and underscores are allowed in keys",{toml:r,ptr:s});o.push(c.trimEnd())}}while(l+1&&l<n);return[o,V(r,n+1,!0,!0)]}function hr(r,s,t,l){let o={},n=new Set,a;for(s++;(a=r[s++])!=="}"&&a;){if(a===",")throw new f("expected value, found comma",{toml:r,ptr:s-1});if(a==="#")s=te(r,s);else if(a!==" "&&a!==" "&&a!==`
|
|
28
|
-
`&&a!=="\r"){let c,i=o,d=!1,[m,p]=he(r,s-1);for(let h=0;h<m.length;h++){if(h&&(i=d?i[c]:i[c]={}),c=m[h],(d=Object.hasOwn(i,c))&&(typeof i[c]!="object"||n.has(i[c])))throw new f("trying to redefine an already defined value",{toml:r,ptr:s});!d&&c==="__proto__"&&Object.defineProperty(i,c,{enumerable:!0,configurable:!0,writable:!0})}if(d)throw new f("trying to redefine an already defined value",{toml:r,ptr:s});let[x,j]=ge(r,p,"}",t-1,l);n.add(x),i[c]=x,s=j}}if(!a)throw new f("unfinished table encountered",{toml:r,ptr:s});return[o,s]}function fr(r,s,t,l){let o=[],n;for(s++;(n=r[s++])!=="]"&&n;){if(n===",")throw new f("expected value, found comma",{toml:r,ptr:s-1});if(n==="#")s=te(r,s);else if(n!==" "&&n!==" "&&n!==`
|
|
29
|
-
`&&n!=="\r"){let a=ge(r,s-1,"]",t-1,l);o.push(a[0]),s=a[1]}}if(!n)throw new f("unfinished array encountered",{toml:r,ptr:s});return[o,s]}function Ee(r,s,t,l){let o=s,n=t,a,c=!1,i;for(let d=0;d<r.length;d++){if(d){if(o=c?o[a]:o[a]={},n=(i=n[a]).c,l===0&&(i.t===1||i.t===2))return null;if(i.t===2){let m=o.length-1;o=o[m],n=n[m].c}}if(a=r[d],(c=Object.hasOwn(o,a))&&n[a]?.t===0&&n[a]?.d)return null;c||(a==="__proto__"&&(Object.defineProperty(o,a,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(n,a,{enumerable:!0,configurable:!0,writable:!0})),n[a]={t:d<r.length-1&&l===2?3:l,d:!1,i:0,c:{}})}if(i=n[a],i.t!==l&&!(l===1&&i.t===3)||(l===2&&(i.d||(i.d=!0,o[a]=[]),o[a].push(o={}),i.c[i.i++]=i={t:1,d:!1,i:0,c:{}}),i.d))return null;if(i.d=!0,l===1)o=c?o[a]:o[a]={};else if(l===0&&c)return null;return[a,o,i.c]}function gr(r,{maxDepth:s=1e3,integersAsBigInt:t}={}){let l={},o={},n=l,a=o;for(let c=V(r,0);c<r.length;){if(r[c]==="["){let i=r[++c]==="[",d=he(r,c+=+i,"]");if(i){if(r[d[1]-1]!=="]")throw new f("expected end of table declaration",{toml:r,ptr:d[1]-1});d[1]++}let m=Ee(d[0],l,o,i?2:1);if(!m)throw new f("trying to redefine an already defined table or value",{toml:r,ptr:c});a=m[2],n=m[1],c=d[1]}else{let i=he(r,c),d=Ee(i[0],n,a,0);if(!d)throw new f("trying to redefine an already defined table or value",{toml:r,ptr:c});let m=ge(r,i[1],void 0,s,t);d[1][d[0]]=m[0],c=m[1]}if(c=V(r,c,!0),r[c]&&r[c]!==`
|
|
30
|
-
`&&r[c]!=="\r")throw new f("each key-value declaration must be followed by an end-of-line",{toml:r,ptr:c});c=V(r,c)}return l}function jr(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}function vr(r){if(!r.trim())return{};const t=gr(r);if(!jr(t))throw new Error("TOML root must be a table.");return t}function Re(r){try{return{config:vr(r),parseError:null}}catch(s){return{config:null,parseError:s.message}}}async function br(){const r=await fetch(se("/codex/diagnostics"));if(!r.ok)throw new Error("Failed to fetch Codex diagnostics");return r.json()}async function wr(){const r=await fetch(se("/codex/config/raw"));if(!r.ok)throw new Error("Failed to fetch Codex raw config");return r.json()}async function Nr(r){const s=await fetch(se("/codex/config/raw"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(s.status===409)throw new Pe("Codex raw config changed externally");if(!s.ok){const t=await s.json().catch(()=>null);throw new Error(t?.error||"Failed to save Codex raw config")}return s.json()}async function Cr(r){const s=await fetch(se("/codex/config/patch"),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(s.status===409)throw new Pe("Codex config changed externally");if(!s.ok){const t=await s.json().catch(()=>null);throw new Error(t?.error||"Failed to patch Codex config")}return s.json()}function yr(){const r=ws(),s=Ce({queryKey:["codex-diagnostics"],queryFn:br,refetchInterval:1e4}),t=Ce({queryKey:["codex-raw-config"],queryFn:wr}),l=ye({mutationFn:Nr,onSuccess:(n,a)=>{r.setQueryData(["codex-raw-config"],c=>{const i=c?.path??"$CODEX_HOME/config.toml",d=c?.resolvedPath??i,m=Re(a.rawText);return{path:i,resolvedPath:d,exists:!0,mtime:n.mtime,rawText:a.rawText,config:m.config,parseError:m.parseError,readError:null}}),r.invalidateQueries({queryKey:["codex-diagnostics"]})}}),o=ye({mutationFn:Cr,onSuccess:n=>{r.setQueryData(["codex-raw-config"],n),r.invalidateQueries({queryKey:["codex-diagnostics"]})}});return N.useMemo(()=>({diagnostics:s.data,diagnosticsLoading:s.isLoading,diagnosticsError:s.error,refetchDiagnostics:s.refetch,rawConfig:t.data,rawConfigLoading:t.isLoading,rawConfigError:t.error,refetchRawConfig:t.refetch,saveRawConfig:l.mutate,saveRawConfigAsync:l.mutateAsync,isSavingRawConfig:l.isPending,patchConfig:o.mutate,patchConfigAsync:o.mutateAsync,isPatchingConfig:o.isPending}),[s.data,s.isLoading,s.error,s.refetch,t.data,t.isLoading,t.error,t.refetch,l.mutate,l.mutateAsync,l.isPending,o.mutate,o.mutateAsync,o.isPending])}const Sr=[{label:"Start Default",command:"ccs",description:"Launch Claude with default profile"},{label:"GLM Profile",command:"ccs glm",description:"Switch to GLM model"},{label:"Health Check",command:"ccs doctor",description:"Run system diagnostics"},{label:"Delegate Task",command:'ccs glm -p "your task"',description:"Delegate to GLM profile"}];function _r({snippets:r=Sr}){const[s,t]=N.useState(null),{t:l}=E(),o=async(n,a)=>{await navigator.clipboard.writeText(n),t(a),setTimeout(()=>t(null),2e3)};return e.jsxs(I,{children:[e.jsx(F,{className:"pb-3",children:e.jsxs(W,{className:"text-lg flex items-center gap-2",children:[e.jsx(xs,{className:"w-5 h-5 text-muted-foreground"}),l("quickCommands.title")]})}),e.jsx(K,{children:e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:r.map((n,a)=>e.jsxs("div",{className:De("group flex items-center justify-between gap-2 px-3 py-2","rounded-lg border bg-muted/30 hover:bg-muted/50 transition-colors"),children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:n.label}),e.jsx("code",{className:"text-sm font-mono font-medium truncate block",children:n.command})]}),e.jsx(y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>o(n.command,a),title:n.description,children:s===a?e.jsx(us,{className:"h-4 w-4 text-green-600"}):e.jsx(ms,{className:"h-4 w-4"})})]},a))})})]})}function kr(r){return!r||!Number.isFinite(r)?"N/A":new Date(r).toLocaleString()}function Tr(r){return!r||r<=0?"0 B":r<1024?`${r} B`:r<1024*1024?`${(r/1024).toFixed(1)} KB`:`${(r/(1024*1024)).toFixed(2)} MB`}function k({label:r,value:s,mono:t=!1}){return e.jsxs("div",{className:"flex items-start justify-between gap-3 text-sm",children:[e.jsx("span",{className:"text-muted-foreground shrink-0",children:r}),e.jsx("span",{className:De("text-right break-all",t&&"font-mono text-xs"),children:s})]})}function Er({diagnostics:r}){const{t:s}=E(),t=r.config.activeProfile?`codex --profile ${r.config.activeProfile}`:"codex",l=r.binary.supportsConfigOverrides;return e.jsx(fe,{className:"h-full",children:e.jsxs("div",{className:"space-y-4 pr-1",children:[e.jsxs(I,{children:[e.jsx(F,{className:"pb-2",children:e.jsxs(W,{className:"flex items-center gap-2 text-base",children:[e.jsx(ps,{className:"h-4 w-4"}),s("codex.howCodexWorks")]})}),e.jsx(K,{className:"text-sm text-muted-foreground",children:e.jsxs("ul",{className:"ml-4 list-disc space-y-1.5 [&>li]:pl-1",children:[e.jsx("li",{children:s("codex.nativeDesc")}),e.jsxs("li",{children:[e.jsx("strong",{children:s("codex.nativeConfigLabel")})," ",s("codex.nativeConfigDesc")]}),e.jsxs("li",{children:[e.jsx("strong",{children:s("codex.transientOverridesLabel")})," ",s("codex.transientOverridesDesc")]}),e.jsxs("li",{children:[e.jsx("strong",{children:s("codex.cliproxyDefaultLabel")})," ",s("codex.cliproxyDefaultDesc")]}),e.jsx("li",{children:s("codex.apiProfilesDefault")})]})})]}),e.jsxs(I,{children:[e.jsx(F,{className:"pb-2",children:e.jsxs(W,{className:"flex items-center gap-2 text-base",children:[e.jsx(hs,{className:"h-4 w-4"}),s("codex.runtimeInstall")]})}),e.jsxs(K,{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:s("codex.status")}),e.jsx(_,{variant:r.binary.installed?"default":"secondary",children:r.binary.installed?s("codex.detected"):s("codex.notFound")})]}),e.jsx(k,{label:s("codex.detectionSource"),value:r.binary.source,mono:!0}),e.jsx(k,{label:s("codex.binaryPath"),value:r.binary.path||s("codex.notFound"),mono:!0}),e.jsx(k,{label:s("codex.installDirectory"),value:r.binary.installDir||"N/A",mono:!0}),e.jsx(k,{label:s("codex.versionLabel"),value:r.binary.version||"Unknown",mono:!0}),e.jsx(k,{label:s("codex.nativeAliases"),value:"ccs-codex, ccsx",mono:!0}),e.jsx(k,{label:s("codex.ccsProviderShortcut"),value:"ccsxp",mono:!0}),e.jsxs("div",{className:"flex items-center justify-between rounded-md border px-3 py-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:s("codex.configOverrideSupport")}),e.jsx(_,{variant:r.binary.supportsConfigOverrides?"default":"secondary",children:r.binary.supportsConfigOverrides?s("codex.available"):s("codex.missing")})]})]})]}),e.jsxs(I,{children:[e.jsx(F,{className:"pb-2",children:e.jsxs(W,{className:"flex items-center gap-2 text-base",children:[e.jsx(Ne,{className:"h-4 w-4"}),s("codex.cliproxyNativeCodex")]})}),e.jsx(K,{className:"space-y-3 text-sm text-muted-foreground",children:l?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{children:e.jsx("strong",{children:s("codex.twoSupportedPaths")})}),e.jsxs("ul",{className:"ml-4 list-disc space-y-1 [&>li]:pl-1",children:[e.jsxs("li",{children:[e.jsx("strong",{children:s("codex.builtInLabel")})," ",s("codex.builtInCcsxpDesc")]}),e.jsxs("li",{children:[e.jsx("strong",{children:s("codex.nativeRecipeLabel")})," ",s("codex.nativeRecipeDesc")]})]})]}),e.jsxs("div",{className:"rounded-md border bg-muted/20 p-3",children:[e.jsx("p",{className:"font-medium text-foreground",children:s("codex.codexNativeRecipe")}),e.jsx("pre",{className:"mt-2 overflow-x-auto rounded-md bg-background p-3 text-xs text-foreground",children:Oe})]}),e.jsxs("ol",{className:"ml-4 list-decimal space-y-1.5 [&>li]:pl-1",children:[e.jsx("li",{children:s("codex.saveProviderNamedCliproxy")}),e.jsx("li",{children:s("codex.inTopLevelSetDefault")}),e.jsx("li",{children:s("codex.exportCliproxyApiKey")})]})]}):e.jsx("p",{children:s("codex.noConfigOverrides")})})]}),e.jsxs(I,{children:[e.jsx(F,{className:"pb-2",children:e.jsxs(W,{className:"flex items-center gap-2 text-base",children:[e.jsx(fs,{className:"h-4 w-4"}),s("codex.configFile")]})}),e.jsx(K,{className:"space-y-3",children:e.jsxs("div",{className:"rounded-md border p-3 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"font-medium text-sm",children:s("codex.userConfig")}),r.file.exists?e.jsx(gs,{className:"h-4 w-4 text-green-600"}):e.jsx(js,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsx(k,{label:s("codex.path"),value:r.file.path,mono:!0}),e.jsx(k,{label:s("codex.resolved"),value:r.file.resolvedPath,mono:!0}),e.jsx(k,{label:s("codex.size"),value:Tr(r.file.sizeBytes)}),e.jsx(k,{label:s("codex.lastModified"),value:kr(r.file.mtimeMs)}),r.file.parseError&&e.jsxs("p",{className:"text-xs text-amber-600",children:[s("codex.tomlWarning"),": ",r.file.parseError]}),r.file.readError&&e.jsxs("p",{className:"text-xs text-destructive",children:[s("codex.readWarning"),": ",r.file.readError]})]})})]}),e.jsxs(I,{children:[e.jsx(F,{className:"pb-2",children:e.jsxs(W,{className:"flex items-center gap-2 text-base",children:[e.jsx(me,{className:"h-4 w-4"}),s("codex.currentUserLayerSummary")]})}),e.jsxs(K,{className:"space-y-3",children:[e.jsx(k,{label:s("codex.model"),value:r.config.model||s("codex.notSet"),mono:!0}),e.jsx(k,{label:s("codex.defaultProvider"),value:r.config.modelProvider||s("codex.notSet"),mono:!0}),e.jsx(k,{label:s("codex.activeProfile"),value:r.config.activeProfile||s("codex.notSet"),mono:!0}),e.jsx(k,{label:s("codex.approvalPolicy"),value:r.config.approvalPolicy||s("codex.notSet"),mono:!0}),e.jsx(k,{label:s("codex.sandboxMode"),value:r.config.sandboxMode||s("codex.notSet"),mono:!0}),e.jsx(k,{label:s("codex.webSearch"),value:r.config.webSearch||s("codex.notSet"),mono:!0}),e.jsx(ee,{}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[e.jsx(_,{variant:"outline",className:"justify-center",children:s("codex.providersCount",{count:r.config.modelProviderCount})}),e.jsx(_,{variant:"outline",className:"justify-center",children:s("codex.profilesCount",{count:r.config.profileCount})}),e.jsx(_,{variant:"outline",className:"justify-center",children:s("codex.enabledFeaturesCount",{count:r.config.enabledFeatures.length})}),e.jsx(_,{variant:"outline",className:"justify-center",children:s("codex.mcpServersCount",{count:r.config.mcpServerCount})})]}),r.config.topLevelKeys.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:s("codex.userLayerKeysPresent")}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:r.config.topLevelKeys.map(o=>e.jsx(_,{variant:"secondary",className:"font-mono text-[10px]",children:o},o))})]})]})]}),e.jsx(_r,{snippets:[{label:s("codex.nativeShortAlias"),command:"ccsx",description:"Launch the short native Codex runtime alias."},{label:s("codex.ccsCodexShortcut"),command:'ccsxp "your prompt"',description:l?s("codex.runBuiltInCodex"):"Requires a Codex build that exposes --config overrides."},{label:s("codex.explicitProviderRoute"),command:'ccs codex --target codex "your prompt"',description:l?s("codex.runBuiltInCodexExplicit"):"Requires a Codex build that exposes --config overrides."},{label:r.config.activeProfile?"Inspect active profile":s("codex.openNativeCodex"),command:t,description:r.config.activeProfile?"Inspect the active named profile directly in native Codex.":"Open native Codex without forcing a named profile overlay."}]}),e.jsxs(I,{children:[e.jsx(F,{className:"pb-2",children:e.jsxs(W,{className:"flex items-center gap-2 text-base",children:[e.jsx(Ne,{className:"h-4 w-4"}),s("codex.runtimeVsProvider")]})}),e.jsxs(K,{className:"grid gap-3 md:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col rounded-md border p-3 text-sm",children:[e.jsx("p",{className:"font-medium text-foreground",children:s("codex.nativeCodexRuntime")}),e.jsxs("ul",{className:"mt-2 flex-grow list-disc space-y-1.5 pl-4 text-muted-foreground [&>li]:pl-1",children:[e.jsx("li",{children:e.jsx("code",{children:"ccs-codex"})}),e.jsx("li",{children:e.jsx("code",{children:"ccsx"})}),e.jsx("li",{children:e.jsx("code",{children:"--target codex"})})]}),e.jsx(_,{variant:"secondary",className:"mt-4 w-fit justify-center font-normal",children:s("codex.honorsSavedNativeConfig")})]}),e.jsxs("div",{className:"flex flex-col rounded-md border p-3 text-sm",children:[e.jsx("p",{className:"font-medium text-foreground",children:s("codex.ccsCodexProvider")}),l?e.jsxs(e.Fragment,{children:[e.jsxs("ul",{className:"mt-2 flex-grow list-disc space-y-1.5 pl-4 text-muted-foreground [&>li]:pl-1",children:[e.jsx("li",{children:e.jsx("code",{children:"ccsxp"})}),e.jsx("li",{children:e.jsx("code",{children:"ccs codex --target codex"})})]}),e.jsx("p",{className:"mt-4 text-muted-foreground",children:s("codex.transientOverridesDesc")})]}):e.jsx("p",{className:"mt-2 text-muted-foreground",children:s("codex.unavailableNoConfig")})]})]})]}),e.jsxs(I,{children:[e.jsx(F,{className:"pb-2",children:e.jsx(W,{className:"text-base",children:s("codex.supportedFlows")})}),e.jsx(K,{children:e.jsxs(Ns,{children:[e.jsx(Cs,{children:e.jsxs(Se,{children:[e.jsx(le,{children:s("codex.flow")}),e.jsx(le,{children:s("codex.status")}),e.jsx(le,{children:s("codex.notes")})]})}),e.jsx(ys,{children:r.supportMatrix.map(o=>e.jsxs(Se,{children:[e.jsx(ie,{className:"font-mono text-xs",children:o.label}),e.jsx(ie,{children:e.jsx(_,{variant:o.supported?"default":"secondary",children:o.supported?s("codex.yes"):s("codex.no")})}),e.jsx(ie,{className:"text-xs text-muted-foreground",children:o.notes})]},o.id))})]})})]}),r.warnings.length>0&&e.jsxs(I,{className:"border-amber-200 bg-amber-50/50 dark:bg-amber-950/20",children:[e.jsx(F,{className:"pb-2",children:e.jsxs(W,{className:"flex items-center gap-2 text-base",children:[e.jsx(vs,{className:"h-4 w-4 text-amber-600"}),s("codex.warningsTitle")]})}),e.jsx(K,{className:"space-y-1.5",children:r.warnings.map(o=>e.jsxs("p",{className:"text-sm text-amber-800 dark:text-amber-300",children:["- ",o]},o))})]})]})})}function Ur(){const{t:r}=E(),s=zs(),{diagnostics:t,diagnosticsLoading:l,diagnosticsError:o,refetchDiagnostics:n,rawConfig:a,rawConfigLoading:c,rawConfigError:i,refetchRawConfig:d,saveRawConfigAsync:m,isSavingRawConfig:p,patchConfigAsync:x,isPatchingConfig:j}=yr(),[h,w]=N.useState(null),M=a?.rawText??"",q=h??M,u=h!==null&&h!==M,v=Re(q),G=v.parseError?{valid:!1,error:v.parseError}:{valid:!0},g=a?.config??null,Ie=c||!a||u||a?.parseError!==null||a?.readError!==null,Fe=i?"Structured controls unavailable: failed to load the current config.toml.":a?.readError?`Structured controls unavailable: ${a.readError}`:u?G.valid?"Save or discard raw TOML edits before using structured controls.":"Fix or discard raw TOML edits before using structured controls.":a?.parseError?`Structured controls disabled: ${a.parseError}`:null,We=N.useMemo(()=>Le(g),[g]),Ke=N.useMemo(()=>Xs(g),[g]),qe=N.useMemo(()=>Ys(g),[g]),Ue=N.useMemo(()=>Hs(g),[g]),Ve=N.useMemo(()=>Qs(g),[g]),Be=N.useMemo(()=>Js(g),[g]),Ge=R=>{if(R===M){w(null);return}w(R)},$e=async()=>{try{if((await Promise.all([n(),d()])).some($=>!$||$.status==="error"||$.isError||$.error)){U.error(r("toasts.codexRefreshFailed"));return}w(null)}catch(R){U.error(R.message||r("toasts.codexRefreshError"))}},ze=async()=>{if(!G.valid){U.error(r("toasts.codexFixToml"));return}try{await m({rawText:q,expectedMtime:a?.exists?a.mtime:void 0}),w(null),U.success(r("toasts.codexSaved")),await n()}catch(R){be(R)?U.error(r("toasts.codexChangedExternally")):U.error(R.message||r("toasts.codexSaveFailed"))}},Xe=async(R,je)=>{try{await x({...R,expectedMtime:a?.exists?a.mtime:void 0}),w(null),U.success(je)}catch($){be($)?U.error(r("toasts.codexChangedExternally")):U.error($.message||r("toasts.codexUpdateFailed"))}},ne="mt-0 h-full border-0 p-0 data-[state=inactive]:hidden",Ye=()=>l?e.jsxs("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:[e.jsx(z,{className:"mr-2 h-5 w-5 animate-spin"}),"Loading Codex diagnostics..."]}):o||!t?e.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-destructive",children:"Failed to load Codex diagnostics."}):e.jsxs(Je,{defaultValue:"overview",className:"flex h-full flex-col",children:[e.jsx("div",{className:"shrink-0 px-4 pt-4",children:e.jsxs(Ze,{className:"grid w-full grid-cols-3",children:[e.jsx(ae,{value:"overview",children:r("codexPage.overview")}),e.jsx(ae,{value:"controls",children:r("codexPage.controlCenter")}),e.jsx(ae,{value:"docs",children:r("codexPage.docs")})]})}),e.jsxs("div",{className:"flex-1 min-h-0 overflow-hidden px-4 pb-4 pt-3",children:[e.jsx(oe,{value:"overview",className:ne,children:e.jsx(Er,{diagnostics:t})}),e.jsx(oe,{value:"controls",className:ne,children:e.jsx(Gs,{workspacePath:t.workspacePath,activeProfile:t.config.activeProfile,topLevelSettings:We,projectTrustEntries:Ke,profileEntries:qe,modelProviderEntries:Ue,mcpServerEntries:Ve,featureCatalog:s,featureState:Be,disabled:Ie,disabledReason:Fe,saving:j,onPatch:Xe})}),e.jsx(oe,{value:"docs",className:ne,children:e.jsx(rr,{diagnostics:t})})]})]});return e.jsx("div",{className:"h-full min-h-0 overflow-hidden",children:e.jsxs(He,{direction:"horizontal",className:"h-full",children:[e.jsx(ve,{defaultSize:45,minSize:35,children:e.jsx("div",{className:"h-full border-r bg-muted/20",children:Ye()})}),e.jsx(Qe,{className:"group flex w-2 cursor-col-resize items-center justify-center bg-border transition-colors hover:bg-primary/20",children:e.jsx(bs,{className:"h-3 w-3 text-muted-foreground group-hover:text-primary"})}),e.jsx(ve,{defaultSize:55,minSize:35,children:e.jsx(Ss,{title:"Codex config.toml",pathLabel:a?.path||t?.file.path||"$CODEX_HOME/config.toml",loading:c,parseWarning:G.valid?a?.parseError:G.error,readWarning:a?.readError,value:q,dirty:u,readOnly:!!a?.readError,saving:p,saveDisabled:!u||p||c||!G.valid||!!a?.readError,onChange:R=>{Ge(R)},onSave:ze,onRefresh:$e,onDiscard:()=>w(null),language:"toml",exactText:!0,loadingLabel:"Loading config.toml...",parseWarningLabel:"TOML warning",ownershipNotice:e.jsxs("div",{className:"rounded-md border border-amber-200 bg-amber-50/60 px-3 py-2 text-sm text-amber-900 dark:bg-amber-950/20 dark:text-amber-300",children:[e.jsx("p",{className:"font-medium",children:"This file is upstream-owned by Codex CLI."}),e.jsxs("p",{children:["CCS does not keep ",e.jsx("code",{children:"~/.codex/config.toml"})," in sync for you."]}),e.jsxs("p",{children:["CCS-backed Codex launches may apply transient ",e.jsx("code",{children:"-c"})," overrides and",e.jsx("code",{children:" CCS_CODEX_API_KEY"}),"; those effective values may not appear here."]})]})})})]})})}export{Ur as CodexPage};
|