coder-config 0.49.9-beta → 0.50.1-beta
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/lib/constants.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coder-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.50.1-beta",
|
|
4
4
|
"description": "Configuration manager for AI coding tools - Claude Code, Gemini CLI, Codex CLI, Antigravity. Manage MCPs, rules, permissions, memory, and workstreams.",
|
|
5
5
|
"author": "regression.io",
|
|
6
6
|
"main": "config-loader.js",
|
|
@@ -628,19 +628,19 @@ Co-Authored-By: AI <ai@example.com>`,className:"font-mono text-sm min-h-[80px]"}
|
|
|
628
628
|
`]):D.type==="done"?(E.close(),v(D.success?"success":"error"),A(D.success)):D.type==="error"&&(j(O=>[...O,`Error: ${D.message}
|
|
629
629
|
`]),E.close(),v("error"),A(!1))},E.onerror=()=>{E.close(),j(M=>[...M,`Connection error - is Claude Code installed?
|
|
630
630
|
`]),v("error"),A(!1)}});await new Promise(A=>setTimeout(A,500))}const N=await me.addProject(n,c||void 0,!1);N.error?q.error(N.error):(q.success(`Added project: ${N.project.name}`),s==null||s(N.project),r(!1))}catch(N){q.error("Failed to add project: "+N.message)}finally{m(!1)}},k=N=>{localStorage.setItem(Hm,N),N==="never"?g(!1):N==="always"&&g(!0),q.success(`Preference saved: ${N==="always"?"Always":N==="never"?"Never":"Ask each time"} run claude /init`)};return t.jsxs(t.Fragment,{children:[t.jsx(bt,{open:e,onOpenChange:r,children:t.jsxs(ft,{className:"sm:max-w-md",children:[t.jsxs(mt,{children:[t.jsxs(pt,{className:"flex items-center gap-2",children:[t.jsx(Xi,{className:"w-5 h-5 text-indigo-500"}),"Add Project"]}),t.jsx(rr,{children:"Register a project folder to quickly switch between projects in the UI."})]}),t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(lt,{htmlFor:"path",children:"Project Path"}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(Ze,{id:"path",value:n,onChange:N=>o(N.target.value),placeholder:"/path/to/project",className:"font-mono text-sm flex-1"}),t.jsx(se,{variant:"outline",size:"icon",onClick:()=>u(!0),title:"Browse",children:t.jsx(Xi,{className:"w-4 h-4"})})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(lt,{htmlFor:"name",children:"Display Name"}),t.jsx(Ze,{id:"name",value:c,onChange:N=>d(N.target.value),placeholder:"Auto-filled from folder name"}),t.jsx("p",{className:"text-xs text-gray-500",children:"Optional. Leave empty to use folder name."})]}),t.jsxs("div",{className:"border-t pt-4",children:[t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx(Dc,{id:"claudeInit",checked:h,onCheckedChange:g,className:"mt-0.5"}),t.jsxs("div",{className:"flex-1",children:[t.jsxs(lt,{htmlFor:"claudeInit",className:"flex items-center gap-2 cursor-pointer",children:[t.jsx(Wt,{className:"w-4 h-4 text-orange-500"}),"Initialize with Claude Code"]}),t.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Run ",t.jsx("code",{className:"bg-gray-100 dark:bg-gray-800 px-1 rounded",children:"claude /init"})," to create CLAUDE.md"]})]})]}),t.jsxs("div",{className:"flex gap-2 mt-3",children:[t.jsx(se,{variant:"ghost",size:"sm",className:"text-xs h-7",onClick:()=>k("always"),children:"Always"}),t.jsx(se,{variant:"ghost",size:"sm",className:"text-xs h-7",onClick:()=>k("never"),children:"Never"}),t.jsx(se,{variant:"ghost",size:"sm",className:"text-xs h-7",onClick:()=>k("ask"),children:"Ask each time"})]})]})]}),S&&t.jsxs("div",{className:"border rounded-lg overflow-hidden bg-slate-950",children:[t.jsx("div",{className:"flex items-center gap-2 px-3 py-2 bg-slate-900 border-b border-slate-800",children:S==="running"?t.jsxs(t.Fragment,{children:[t.jsx(Qe,{className:"w-4 h-4 animate-spin text-blue-400"}),t.jsx("span",{className:"text-sm text-slate-300",children:"Running claude -p /init..."})]}):S==="success"?t.jsxs(t.Fragment,{children:[t.jsx(Oo,{className:"w-4 h-4 text-green-400"}),t.jsx("span",{className:"text-sm text-green-400",children:"Initialized successfully"})]}):t.jsxs(t.Fragment,{children:[t.jsx(Ba,{className:"w-4 h-4 text-red-400"}),t.jsx("span",{className:"text-sm text-red-400",children:"Initialization failed"})]})}),t.jsxs("div",{ref:y,className:"p-3 font-mono text-xs text-slate-300 max-h-48 overflow-y-auto whitespace-pre-wrap",children:[w.map((N,P)=>t.jsx("span",{children:N},P)),S==="running"&&t.jsx("span",{className:"animate-pulse",children:"_"})]})]}),t.jsxs(kt,{children:[t.jsx(se,{variant:"outline",onClick:()=>r(!1),disabled:S==="running",children:"Cancel"}),t.jsx(se,{onClick:b,disabled:f||!n,children:f?t.jsxs(t.Fragment,{children:[t.jsx(Qe,{className:"w-4 h-4 mr-2 animate-spin"}),S==="running"?"Initializing...":"Adding..."]}):"Add Project"})]})]})}),t.jsx(wx,{open:l,onOpenChange:u,onSelect:x,type:"directory",initialPath:"~",title:"Select Project Folder"})]})}const EN=_.createContext({theme:"auto",setTheme:()=>{},resolvedTheme:"light"});function O8({children:e}){const[r,s]=_.useState(()=>{try{return localStorage.getItem("claude-config-theme")||"auto"}catch{return"auto"}}),[n,o]=_.useState("light");_.useEffect(()=>{const d=window.document.documentElement,l=m=>{let h;m==="auto"?h=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":h=m,o(h),h==="dark"?d.classList.add("dark"):d.classList.remove("dark")};l(r);const u=window.matchMedia("(prefers-color-scheme: dark)"),f=()=>{r==="auto"&&l("auto")};return u.addEventListener("change",f),()=>u.removeEventListener("change",f)},[r]);const c=d=>{s(d);try{localStorage.setItem("claude-config-theme",d)}catch{}};return t.jsx(EN.Provider,{value:{theme:r,setTheme:c,resolvedTheme:n},children:e})}function F8(){return _.useContext(EN)}function B8(){const{theme:e,setTheme:r,resolvedTheme:s}=F8(),n=s==="dark"?$b:Hb;return t.jsxs(Nn,{children:[t.jsx(En,{asChild:!0,children:t.jsxs(se,{variant:"ghost",size:"sm",className:"w-9 px-0",children:[t.jsx(n,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),t.jsxs(un,{align:"end",children:[t.jsxs(Pt,{onClick:()=>r("light"),className:e==="light"?"bg-accent":"",children:[t.jsx(Hb,{className:"mr-2 h-4 w-4"}),"Light"]}),t.jsxs(Pt,{onClick:()=>r("dark"),className:e==="dark"?"bg-accent":"",children:[t.jsx($b,{className:"mr-2 h-4 w-4"}),"Dark"]}),t.jsxs(Pt,{onClick:()=>r("auto"),className:e==="auto"?"bg-accent":"",children:[t.jsx(pC,{className:"mr-2 h-4 w-4"}),"System"]})]})]})}var $8=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],z8=$8.reduce((e,r)=>{const s=eh(`Primitive.${r}`),n=_.forwardRef((o,c)=>{const{asChild:d,...l}=o,u=d?s:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),t.jsx(u,{...l,ref:c})});return n.displayName=`Primitive.${r}`,{...e,[r]:n}},{}),H8="Separator",Mw="horizontal",W8=["horizontal","vertical"],PN=_.forwardRef((e,r)=>{const{decorative:s,orientation:n=Mw,...o}=e,c=U8(n)?n:Mw,l=s?{role:"none"}:{"aria-orientation":c==="vertical"?c:void 0,role:"separator"};return t.jsx(z8.div,{"data-orientation":c,...l,...o,ref:r})});PN.displayName=H8;function U8(e){return W8.includes(e)}var AN=PN;const TN=_.forwardRef(({className:e,orientation:r="horizontal",decorative:s=!0,...n},o)=>t.jsx(AN,{ref:o,decorative:s,orientation:r,className:Ne("shrink-0 bg-border",r==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));TN.displayName=AN.displayName;const Iw=e=>{let r;const s=new Set,n=(f,m)=>{const h=typeof f=="function"?f(r):f;if(!Object.is(h,r)){const g=r;r=m??(typeof h!="object"||h===null)?h:Object.assign({},r,h),s.forEach(w=>w(r,g))}},o=()=>r,l={setState:n,getState:o,getInitialState:()=>u,subscribe:f=>(s.add(f),()=>s.delete(f))},u=r=e(n,o,l);return l},V8=(e=>e?Iw(e):Iw),G8=e=>e;function q8(e,r=G8){const s=Ae.useSyncExternalStore(e.subscribe,Ae.useCallback(()=>r(e.getState()),[e,r]),Ae.useCallback(()=>r(e.getInitialState()),[e,r]));return Ae.useDebugValue(s),s}const Dw=e=>{const r=V8(e),s=n=>q8(r,n);return Object.assign(s,r),s},Nh=(e=>e?Dw(e):Dw),Dx=Nh((e,r)=>({projects:[],activeProject:null,loading:!1,error:null,fetch:async()=>{e({loading:!0,error:null});try{const n=(await me.getProjects()).projects||[],o=n.find(c=>c.isActive)||null;return e({projects:n,activeProject:o,loading:!1}),n}catch(s){return e({error:s.message,loading:!1}),[]}},add:async(s,n,o=!1)=>{try{const c=await me.addProject(s,n,o);if(c.success||c.project){const d=c.project||{path:s,name:n,exists:!0};return e(l=>({projects:[...l.projects,d]})),{success:!0,project:d}}return{success:!1,error:c.error}}catch(c){return{success:!1,error:c.message}}},remove:async s=>{try{const n=await me.removeProject(s);return n.success?(e(o=>{var c;return{projects:o.projects.filter(d=>d.id!==s),activeProject:((c=o.activeProject)==null?void 0:c.id)===s?null:o.activeProject}}),{success:!0}):{success:!1,error:n.error}}catch(n){return{success:!1,error:n.message}}},update:async(s,n)=>{try{const o=await me.updateProject(s,n);return o.success?(e(c=>({projects:c.projects.map(d=>d.id===s?{...d,...o.project}:d)})),{success:!0,project:o.project}):{success:!1,error:o.error}}catch(o){return{success:!1,error:o.message}}},setActive:async s=>{try{const n=await me.setActiveProject(s);return n.success?(e(o=>({projects:o.projects.map(c=>({...c,isActive:c.id===s})),activeProject:n.project})),n):{success:!1,error:n.error}}catch(n){return{success:!1,error:n.message}}},clearActive:()=>{e(s=>({projects:s.projects.map(n=>({...n,isActive:!1})),activeProject:null}))}})),RN=Nh((e,r)=>({workstreams:[],activeId:null,loading:!1,error:null,fetch:async()=>{e({loading:!0,error:null});try{const s=await me.getWorkstreams();return e({workstreams:s.workstreams||[],activeId:s.activeId||null,loading:!1}),s.workstreams||[]}catch(s){return e({error:s.message,loading:!1}),[]}},getActiveWorkstream:()=>{const{workstreams:s,activeId:n}=r();return n?s.find(o=>o.id===n):null},create:async(s,n=[],o="")=>{try{const c=await me.createWorkstream({name:s,projects:n,rules:o});return c.success||c.workstream?(e(d=>({workstreams:[...d.workstreams,c.workstream]})),{success:!0,workstream:c.workstream}):{success:!1,error:c.error}}catch(c){return{success:!1,error:c.message}}},update:async(s,n)=>{try{const o=await me.updateWorkstream(s,n);return o.success||o.workstream?(e(c=>({workstreams:c.workstreams.map(d=>d.id===s?{...d,...o.workstream}:d)})),{success:!0,workstream:o.workstream}):{success:!1,error:o.error}}catch(o){return{success:!1,error:o.message}}},delete:async s=>{try{const n=await me.deleteWorkstream(s);return n.success?(e(o=>({workstreams:o.workstreams.filter(c=>c.id!==s),activeId:o.activeId===s?null:o.activeId})),{success:!0}):{success:!1,error:n.error}}catch(n){return{success:!1,error:n.message}}},setActive:async s=>{try{const n=await me.setActiveWorkstream(s);return n.success?(e({activeId:s}),{success:!0}):{success:!1,error:n.error}}catch(n){return{success:!1,error:n.message}}},addProject:async(s,n)=>{try{const o=await me.addProjectToWorkstream(s,n);return o.success?(e(c=>({workstreams:c.workstreams.map(d=>d.id===s?{...d,projects:[...d.projects||[],n]}:d)})),{success:!0}):{success:!1,error:o.error}}catch(o){return{success:!1,error:o.message}}},removeProject:async(s,n)=>{try{const o=await me.removeProjectFromWorkstream(s,n);return o.success?(e(c=>({workstreams:c.workstreams.map(d=>d.id===s?{...d,projects:(d.projects||[]).filter(l=>l!==n)}:d)})),{success:!0}):{success:!1,error:o.error}}catch(o){return{success:!1,error:o.message}}},getWorkstreamsForProject:s=>r().workstreams.filter(n=>{var o;return(o=n.projects)==null?void 0:o.includes(s)}),countWorkstreamsForProject:s=>r().getWorkstreamsForProject(s).length}));Nh((e,r)=>({loops:[],activeLoop:null,config:{},history:[],loading:!1,error:null,fetch:async()=>{var s;e({loading:!0,error:null});try{const n=await me.getLoops();return e({loops:n.loops||[],activeLoop:n.activeId?(s=n.loops)==null?void 0:s.find(o=>o.id===n.activeId):null,config:n.config||{},loading:!1}),n.loops||[]}catch(n){return e({error:n.message,loading:!1}),[]}},fetchOne:async s=>{try{const n=await me.getLoop(s);return n.loop?(e(o=>({loops:o.loops.map(c=>c.id===s?n.loop:c)})),n):{error:n.error}}catch(n){return{error:n.message}}},create:async(s,n={})=>{try{const o=await me.createLoop({task:s,...n});return o.loop?(e(c=>({loops:[...c.loops,o.loop]})),{success:!0,loop:o.loop}):{success:!1,error:o.error}}catch(o){return{success:!1,error:o.message}}},update:async(s,n)=>{try{const o=await me.updateLoop(s,n);return o.loop?(e(c=>{var d;return{loops:c.loops.map(l=>l.id===s?o.loop:l),activeLoop:((d=c.activeLoop)==null?void 0:d.id)===s?o.loop:c.activeLoop}}),{success:!0,loop:o.loop}):{success:!1,error:o.error}}catch(o){return{success:!1,error:o.message}}},delete:async s=>{try{const n=await me.deleteLoop(s);return n.success?(e(o=>{var c;return{loops:o.loops.filter(d=>d.id!==s),activeLoop:((c=o.activeLoop)==null?void 0:c.id)===s?null:o.activeLoop}}),{success:!0}):{success:!1,error:n.error}}catch(n){return{success:!1,error:n.message}}},start:async s=>{try{const n=await me.startLoop(s);return n.loop?(e(o=>({loops:o.loops.map(c=>c.id===s?n.loop:c),activeLoop:n.loop})),{success:!0,loop:n.loop}):{success:!1,error:n.error}}catch(n){return{success:!1,error:n.message}}},pause:async s=>{try{const n=await me.pauseLoop(s);return n.loop?(e(o=>{var c;return{loops:o.loops.map(d=>d.id===s?n.loop:d),activeLoop:((c=o.activeLoop)==null?void 0:c.id)===s?n.loop:o.activeLoop}}),{success:!0,loop:n.loop}):{success:!1,error:n.error}}catch(n){return{success:!1,error:n.message}}},cancel:async s=>{try{const n=await me.cancelLoop(s);return n.loop?(e(o=>{var c;return{loops:o.loops.map(d=>d.id===s?n.loop:d),activeLoop:((c=o.activeLoop)==null?void 0:c.id)===s?null:o.activeLoop}}),{success:!0,loop:n.loop}):{success:!1,error:n.error}}catch(n){return{success:!1,error:n.message}}},complete:async s=>{try{const n=await me.completeLoop(s);return n.loop?(e(o=>{var c;return{loops:o.loops.filter(d=>d.id!==s),activeLoop:((c=o.activeLoop)==null?void 0:c.id)===s?null:o.activeLoop}}),{success:!0,loop:n.loop}):{success:!1,error:n.error}}catch(n){return{success:!1,error:n.message}}},fetchHistory:async()=>{try{const s=await me.getLoopHistory();return e({history:s.history||[]}),s.history||[]}catch{return[]}},updateConfig:async s=>{try{const n=await me.updateLoopConfig(s);return n.config?(e({config:n.config}),{success:!0,config:n.config}):{success:!1,error:n.error}}catch(n){return{success:!1,error:n.message}}},setActiveLoop:s=>{e({activeLoop:s})},clearActiveLoop:()=>{e({activeLoop:null})}}));const Lw=Nh((e,r)=>({appConfig:null,loading:!1,error:null,version:null,latestVersion:null,updateAvailable:!1,fetch:async()=>{e({loading:!0,error:null});try{const s=await me.getConfig();return e({appConfig:s.config||{},loading:!1}),s.config}catch(s){return e({error:s.message,loading:!1}),null}},save:async s=>{try{const n=await me.saveConfig(s);return n.success?(e({appConfig:s}),{success:!0}):{success:!1,error:n.error}}catch(n){return{success:!1,error:n.message}}},update:async s=>{const o={...r().appConfig||{},...s};return r().save(o)},checkVersion:async()=>{try{const s=await me.checkVersion();return e({version:s.installedVersion,latestVersion:s.latestVersion,updateAvailable:s.updateAvailable||!1}),s}catch(s){return{error:s.message}}},isFeatureEnabled:s=>{var o;const n=r().appConfig;return((o=n==null?void 0:n.experimental)==null?void 0:o[s])===!0},isToolEnabled:s=>{const n=r().appConfig;return((n==null?void 0:n.enabledTools)||["claude"]).includes(s)},getEnabledTools:()=>{const s=r().appConfig;return(s==null?void 0:s.enabledTools)||["claude"]},setExperimentalFeature:async(s,n)=>{const o=r().appConfig||{},c={...o.experimental||{},[s]:n};return r().save({...o,experimental:c})},setEnabledTools:async s=>{const n=r().appConfig||{};return r().save({...n,enabledTools:s})}}));function K8(e,r){const s={};return(e[e.length-1]===""?[...e,""]:e).join((s.padRight?" ":"")+","+(s.padLeft===!1?"":" ")).trim()}const Y8=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,X8=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,J8={};function Ow(e,r){return(J8.jsx?X8:Y8).test(e)}const Q8=/[ \t\n\f\r]/g;function Z8(e){return typeof e=="object"?e.type==="text"?Fw(e.value):!1:Fw(e)}function Fw(e){return e.replace(Q8,"")===""}class Vc{constructor(r,s,n){this.normal=s,this.property=r,n&&(this.space=n)}}Vc.prototype.normal={};Vc.prototype.property={};Vc.prototype.space=void 0;function MN(e,r){const s={},n={};for(const o of e)Object.assign(s,o.property),Object.assign(n,o.normal);return new Vc(s,n,r)}function zp(e){return e.toLowerCase()}class Os{constructor(r,s){this.attribute=s,this.property=r}}Os.prototype.attribute="";Os.prototype.booleanish=!1;Os.prototype.boolean=!1;Os.prototype.commaOrSpaceSeparated=!1;Os.prototype.commaSeparated=!1;Os.prototype.defined=!1;Os.prototype.mustUseProperty=!1;Os.prototype.number=!1;Os.prototype.overloadedBoolean=!1;Os.prototype.property="";Os.prototype.spaceSeparated=!1;Os.prototype.space=void 0;let e7=0;const yt=qo(),Cr=qo(),Hp=qo(),Re=qo(),Yt=qo(),Ha=qo(),Us=qo();function qo(){return 2**++e7}const Wp=Object.freeze(Object.defineProperty({__proto__:null,boolean:yt,booleanish:Cr,commaOrSpaceSeparated:Us,commaSeparated:Ha,number:Re,overloadedBoolean:Hp,spaceSeparated:Yt},Symbol.toStringTag,{value:"Module"})),Wm=Object.keys(Wp);class Lx extends Os{constructor(r,s,n,o){let c=-1;if(super(r,s),Bw(this,"space",o),typeof n=="number")for(;++c<Wm.length;){const d=Wm[c];Bw(this,Wm[c],(n&Wp[d])===Wp[d])}}}Lx.prototype.defined=!0;function Bw(e,r,s){s&&(e[r]=s)}function cl(e){const r={},s={};for(const[n,o]of Object.entries(e.properties)){const c=new Lx(n,e.transform(e.attributes||{},n),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(c.mustUseProperty=!0),r[n]=c,s[zp(n)]=n,s[zp(c.attribute)]=n}return new Vc(r,s,e.space)}const IN=cl({properties:{ariaActiveDescendant:null,ariaAtomic:Cr,ariaAutoComplete:null,ariaBusy:Cr,ariaChecked:Cr,ariaColCount:Re,ariaColIndex:Re,ariaColSpan:Re,ariaControls:Yt,ariaCurrent:null,ariaDescribedBy:Yt,ariaDetails:null,ariaDisabled:Cr,ariaDropEffect:Yt,ariaErrorMessage:null,ariaExpanded:Cr,ariaFlowTo:Yt,ariaGrabbed:Cr,ariaHasPopup:null,ariaHidden:Cr,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Yt,ariaLevel:Re,ariaLive:null,ariaModal:Cr,ariaMultiLine:Cr,ariaMultiSelectable:Cr,ariaOrientation:null,ariaOwns:Yt,ariaPlaceholder:null,ariaPosInSet:Re,ariaPressed:Cr,ariaReadOnly:Cr,ariaRelevant:null,ariaRequired:Cr,ariaRoleDescription:Yt,ariaRowCount:Re,ariaRowIndex:Re,ariaRowSpan:Re,ariaSelected:Cr,ariaSetSize:Re,ariaSort:null,ariaValueMax:Re,ariaValueMin:Re,ariaValueNow:Re,ariaValueText:null,role:null},transform(e,r){return r==="role"?r:"aria-"+r.slice(4).toLowerCase()}});function DN(e,r){return r in e?e[r]:r}function LN(e,r){return DN(e,r.toLowerCase())}const t7=cl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ha,acceptCharset:Yt,accessKey:Yt,action:null,allow:null,allowFullScreen:yt,allowPaymentRequest:yt,allowUserMedia:yt,alt:null,as:null,async:yt,autoCapitalize:null,autoComplete:Yt,autoFocus:yt,autoPlay:yt,blocking:Yt,capture:null,charSet:null,checked:yt,cite:null,className:Yt,cols:Re,colSpan:null,content:null,contentEditable:Cr,controls:yt,controlsList:Yt,coords:Re|Ha,crossOrigin:null,data:null,dateTime:null,decoding:null,default:yt,defer:yt,dir:null,dirName:null,disabled:yt,download:Hp,draggable:Cr,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:yt,formTarget:null,headers:Yt,height:Re,hidden:Hp,high:Re,href:null,hrefLang:null,htmlFor:Yt,httpEquiv:Yt,id:null,imageSizes:null,imageSrcSet:null,inert:yt,inputMode:null,integrity:null,is:null,isMap:yt,itemId:null,itemProp:Yt,itemRef:Yt,itemScope:yt,itemType:Yt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:yt,low:Re,manifest:null,max:null,maxLength:Re,media:null,method:null,min:null,minLength:Re,multiple:yt,muted:yt,name:null,nonce:null,noModule:yt,noValidate:yt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:yt,optimum:Re,pattern:null,ping:Yt,placeholder:null,playsInline:yt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:yt,referrerPolicy:null,rel:Yt,required:yt,reversed:yt,rows:Re,rowSpan:Re,sandbox:Yt,scope:null,scoped:yt,seamless:yt,selected:yt,shadowRootClonable:yt,shadowRootDelegatesFocus:yt,shadowRootMode:null,shape:null,size:Re,sizes:null,slot:null,span:Re,spellCheck:Cr,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Re,step:null,style:null,tabIndex:Re,target:null,title:null,translate:null,type:null,typeMustMatch:yt,useMap:null,value:Cr,width:Re,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Yt,axis:null,background:null,bgColor:null,border:Re,borderColor:null,bottomMargin:Re,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:yt,declare:yt,event:null,face:null,frame:null,frameBorder:null,hSpace:Re,leftMargin:Re,link:null,longDesc:null,lowSrc:null,marginHeight:Re,marginWidth:Re,noResize:yt,noHref:yt,noShade:yt,noWrap:yt,object:null,profile:null,prompt:null,rev:null,rightMargin:Re,rules:null,scheme:null,scrolling:Cr,standby:null,summary:null,text:null,topMargin:Re,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Re,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:yt,disableRemotePlayback:yt,prefix:null,property:null,results:Re,security:null,unselectable:null},space:"html",transform:LN}),r7=cl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Us,accentHeight:Re,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Re,amplitude:Re,arabicForm:null,ascent:Re,attributeName:null,attributeType:null,azimuth:Re,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Re,by:null,calcMode:null,capHeight:Re,className:Yt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Re,diffuseConstant:Re,direction:null,display:null,dur:null,divisor:Re,dominantBaseline:null,download:yt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Re,enableBackground:null,end:null,event:null,exponent:Re,externalResourcesRequired:null,fill:null,fillOpacity:Re,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ha,g2:Ha,glyphName:Ha,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Re,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Re,horizOriginX:Re,horizOriginY:Re,id:null,ideographic:Re,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Re,k:Re,k1:Re,k2:Re,k3:Re,k4:Re,kernelMatrix:Us,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Re,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Re,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Re,overlineThickness:Re,paintOrder:null,panose1:null,path:null,pathLength:Re,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Yt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Re,pointsAtY:Re,pointsAtZ:Re,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Us,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Us,rev:Us,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Us,requiredFeatures:Us,requiredFonts:Us,requiredFormats:Us,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Re,specularExponent:Re,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Re,strikethroughThickness:Re,string:null,stroke:null,strokeDashArray:Us,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Re,strokeOpacity:Re,strokeWidth:null,style:null,surfaceScale:Re,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Us,tabIndex:Re,tableValues:null,target:null,targetX:Re,targetY:Re,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Us,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Re,underlineThickness:Re,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Re,values:null,vAlphabetic:Re,vMathematical:Re,vectorEffect:null,vHanging:Re,vIdeographic:Re,version:null,vertAdvY:Re,vertOriginX:Re,vertOriginY:Re,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Re,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:DN}),ON=cl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,r){return"xlink:"+r.slice(5).toLowerCase()}}),FN=cl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:LN}),BN=cl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,r){return"xml:"+r.slice(3).toLowerCase()}}),s7={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},n7=/[A-Z]/g,$w=/-[a-z]/g,i7=/^data[-\w.:]+$/i;function o7(e,r){const s=zp(r);let n=r,o=Os;if(s in e.normal)return e.property[e.normal[s]];if(s.length>4&&s.slice(0,4)==="data"&&i7.test(r)){if(r.charAt(4)==="-"){const c=r.slice(5).replace($w,l7);n="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=r.slice(4);if(!$w.test(c)){let d=c.replace(n7,a7);d.charAt(0)!=="-"&&(d="-"+d),r="data"+d}}o=Lx}return new o(n,r)}function a7(e){return"-"+e.toLowerCase()}function l7(e){return e.charAt(1).toUpperCase()}const c7=MN([IN,t7,ON,FN,BN],"html"),Ox=MN([IN,r7,ON,FN,BN],"svg");function d7(e){return e.join(" ").trim()}var Ea={},Um,zw;function u7(){if(zw)return Um;zw=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,s=/^\s*/,n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
|
|
631
|
-
`,f="/",m="*",h="",g="comment",w="declaration";function j(v,y){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];y=y||{};var x=1,b=1;function k(X){var W=X.match(r);W&&(x+=W.length);var $=X.lastIndexOf(u);b=~$?X.length-$:b+X.length}function N(){var X={line:x,column:b};return function(W){return W.position=new P(X),M(),W}}function P(X){this.start=X,this.end={line:x,column:b},this.source=y.source}P.prototype.content=v;function A(X){var W=new Error(y.source+":"+x+":"+b+": "+X);if(W.reason=X,W.filename=y.source,W.line=x,W.column=b,W.source=v,!y.silent)throw W}function E(X){var W=X.exec(v);if(W){var $=W[0];return k($),v=v.slice($.length),W}}function M(){E(s)}function D(X){var W;for(X=X||[];W=O();)W!==!1&&X.push(W);return X}function O(){var X=N();if(!(f!=v.charAt(0)||m!=v.charAt(1))){for(var W=2;h!=v.charAt(W)&&(m!=v.charAt(W)||f!=v.charAt(W+1));)++W;if(W+=2,h===v.charAt(W-1))return A("End of comment missing");var $=v.slice(2,W-2);return b+=2,k($),v=v.slice(W),b+=2,X({type:g,comment:$})}}function z(){var X=N(),W=E(n);if(W){if(O(),!E(o))return A("property missing ':'");var $=E(c),Y=X({type:w,property:S(W[0].replace(e,h)),value:$?S($[0].replace(e,h)):h});return E(d),Y}}function U(){var X=[];D(X);for(var W;W=z();)W!==!1&&(X.push(W),D(X));return X}return M(),U()}function S(v){return v?v.replace(l,h):h}return Um=j,Um}var Hw;function h7(){if(Hw)return Ea;Hw=1;var e=Ea&&Ea.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Ea,"__esModule",{value:!0}),Ea.default=s;const r=e(u7());function s(n,o){let c=null;if(!n||typeof n!="string")return c;const d=(0,r.default)(n),l=typeof o=="function";return d.forEach(u=>{if(u.type!=="declaration")return;const{property:f,value:m}=u;l?o(f,m,u):m&&(c=c||{},c[f]=m)}),c}return Ea}var ql={},Ww;function f7(){if(Ww)return ql;Ww=1,Object.defineProperty(ql,"__esModule",{value:!0}),ql.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,s=/^[^-]+$/,n=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,c=function(f){return!f||s.test(f)||e.test(f)},d=function(f,m){return m.toUpperCase()},l=function(f,m){return"".concat(m,"-")},u=function(f,m){return m===void 0&&(m={}),c(f)?f:(f=f.toLowerCase(),m.reactCompat?f=f.replace(o,l):f=f.replace(n,l),f.replace(r,d))};return ql.camelCase=u,ql}var Kl,Uw;function m7(){if(Uw)return Kl;Uw=1;var e=Kl&&Kl.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},r=e(h7()),s=f7();function n(o,c){var d={};return!o||typeof o!="string"||(0,r.default)(o,function(l,u){l&&u&&(d[(0,s.camelCase)(l,c)]=u)}),d}return n.default=n,Kl=n,Kl}var p7=m7();const g7=Cc(p7),$N=zN("end"),Fx=zN("start");function zN(e){return r;function r(s){const n=s&&s.position&&s.position[e]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function x7(e){const r=Fx(e),s=$N(e);if(r&&s)return{start:r,end:s}}function ac(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Vw(e.position):"start"in e||"end"in e?Vw(e):"line"in e||"column"in e?Up(e):""}function Up(e){return Gw(e&&e.line)+":"+Gw(e&&e.column)}function Vw(e){return Up(e&&e.start)+"-"+Up(e&&e.end)}function Gw(e){return e&&typeof e=="number"?e:1}class ds extends Error{constructor(r,s,n){super(),typeof s=="string"&&(n=s,s=void 0);let o="",c={},d=!1;if(s&&("line"in s&&"column"in s?c={place:s}:"start"in s&&"end"in s?c={place:s}:"type"in s?c={ancestors:[s],place:s.position}:c={...s}),typeof r=="string"?o=r:!c.cause&&r&&(d=!0,o=r.message,c.cause=r),!c.ruleId&&!c.source&&typeof n=="string"){const u=n.indexOf(":");u===-1?c.ruleId=n:(c.source=n.slice(0,u),c.ruleId=n.slice(u+1))}if(!c.place&&c.ancestors&&c.ancestors){const u=c.ancestors[c.ancestors.length-1];u&&(c.place=u.position)}const l=c.place&&"start"in c.place?c.place.start:c.place;this.ancestors=c.ancestors||void 0,this.cause=c.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=l?l.line:void 0,this.name=ac(c.place)||"1:1",this.place=c.place||void 0,this.reason=this.message,this.ruleId=c.ruleId||void 0,this.source=c.source||void 0,this.stack=d&&c.cause&&typeof c.cause.stack=="string"?c.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ds.prototype.file="";ds.prototype.name="";ds.prototype.reason="";ds.prototype.message="";ds.prototype.stack="";ds.prototype.column=void 0;ds.prototype.line=void 0;ds.prototype.ancestors=void 0;ds.prototype.cause=void 0;ds.prototype.fatal=void 0;ds.prototype.place=void 0;ds.prototype.ruleId=void 0;ds.prototype.source=void 0;const Bx={}.hasOwnProperty,v7=new Map,y7=/[A-Z]/g,b7=new Set(["table","tbody","thead","tfoot","tr"]),w7=new Set(["td","th"]),HN="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function _7(e,r){if(!r||r.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const s=r.filePath||void 0;let n;if(r.development){if(typeof r.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=A7(s,r.jsxDEV)}else{if(typeof r.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof r.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=P7(s,r.jsx,r.jsxs)}const o={Fragment:r.Fragment,ancestors:[],components:r.components||{},create:n,elementAttributeNameCase:r.elementAttributeNameCase||"react",evaluater:r.createEvaluater?r.createEvaluater():void 0,filePath:s,ignoreInvalidStyle:r.ignoreInvalidStyle||!1,passKeys:r.passKeys!==!1,passNode:r.passNode||!1,schema:r.space==="svg"?Ox:c7,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},c=WN(o,e,void 0);return c&&typeof c!="string"?c:o.create(e,o.Fragment,{children:c||void 0},void 0)}function WN(e,r,s){if(r.type==="element")return S7(e,r,s);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return C7(e,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return j7(e,r,s);if(r.type==="mdxjsEsm")return k7(e,r);if(r.type==="root")return N7(e,r,s);if(r.type==="text")return E7(e,r)}function S7(e,r,s){const n=e.schema;let o=n;r.tagName.toLowerCase()==="svg"&&n.space==="html"&&(o=Ox,e.schema=o),e.ancestors.push(r);const c=VN(e,r.tagName,!1),d=T7(e,r);let l=zx(e,r);return b7.has(r.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!Z8(u):!0})),UN(e,d,c,r),$x(d,l),e.ancestors.pop(),e.schema=n,e.create(r,c,d,s)}function C7(e,r){if(r.data&&r.data.estree&&e.evaluater){const n=r.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Sc(e,r.position)}function k7(e,r){if(r.data&&r.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(r.data.estree);Sc(e,r.position)}function j7(e,r,s){const n=e.schema;let o=n;r.name==="svg"&&n.space==="html"&&(o=Ox,e.schema=o),e.ancestors.push(r);const c=r.name===null?e.Fragment:VN(e,r.name,!0),d=R7(e,r),l=zx(e,r);return UN(e,d,c,r),$x(d,l),e.ancestors.pop(),e.schema=n,e.create(r,c,d,s)}function N7(e,r,s){const n={};return $x(n,zx(e,r)),e.create(r,e.Fragment,n,s)}function E7(e,r){return r.value}function UN(e,r,s,n){typeof s!="string"&&s!==e.Fragment&&e.passNode&&(r.node=n)}function $x(e,r){if(r.length>0){const s=r.length>1?r:r[0];s&&(e.children=s)}}function P7(e,r,s){return n;function n(o,c,d,l){const f=Array.isArray(d.children)?s:r;return l?f(c,d,l):f(c,d)}}function A7(e,r){return s;function s(n,o,c,d){const l=Array.isArray(c.children),u=Fx(n);return r(o,c,d,l,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function T7(e,r){const s={};let n,o;for(o in r.properties)if(o!=="children"&&Bx.call(r.properties,o)){const c=M7(e,o,r.properties[o]);if(c){const[d,l]=c;e.tableCellAlignToStyle&&d==="align"&&typeof l=="string"&&w7.has(r.tagName)?n=l:s[d]=l}}if(n){const c=s.style||(s.style={});c[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return s}function R7(e,r){const s={};for(const n of r.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&e.evaluater){const c=n.data.estree.body[0];c.type;const d=c.expression;d.type;const l=d.properties[0];l.type,Object.assign(s,e.evaluater.evaluateExpression(l.argument))}else Sc(e,r.position);else{const o=n.name;let c;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&e.evaluater){const l=n.value.data.estree.body[0];l.type,c=e.evaluater.evaluateExpression(l.expression)}else Sc(e,r.position);else c=n.value===null?!0:n.value;s[o]=c}return s}function zx(e,r){const s=[];let n=-1;const o=e.passKeys?new Map:v7;for(;++n<r.children.length;){const c=r.children[n];let d;if(e.passKeys){const u=c.type==="element"?c.tagName:c.type==="mdxJsxFlowElement"||c.type==="mdxJsxTextElement"?c.name:void 0;if(u){const f=o.get(u)||0;d=u+"-"+f,o.set(u,f+1)}}const l=WN(e,c,d);l!==void 0&&s.push(l)}return s}function M7(e,r,s){const n=o7(e.schema,r);if(!(s==null||typeof s=="number"&&Number.isNaN(s))){if(Array.isArray(s)&&(s=n.commaSeparated?K8(s):d7(s)),n.property==="style"){let o=typeof s=="object"?s:I7(e,String(s));return e.stylePropertyNameCase==="css"&&(o=D7(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&n.space?s7[n.property]||n.property:n.attribute,s]}}function I7(e,r){try{return g7(r,{reactCompat:!0})}catch(s){if(e.ignoreInvalidStyle)return{};const n=s,o=new ds("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=HN+"#cannot-parse-style-attribute",o}}function VN(e,r,s){let n;if(!s)n={type:"Literal",value:r};else if(r.includes(".")){const o=r.split(".");let c=-1,d;for(;++c<o.length;){const l=Ow(o[c])?{type:"Identifier",name:o[c]}:{type:"Literal",value:o[c]};d=d?{type:"MemberExpression",object:d,property:l,computed:!!(c&&l.type==="Literal"),optional:!1}:l}n=d}else n=Ow(r)&&!/^[a-z]/.test(r)?{type:"Identifier",name:r}:{type:"Literal",value:r};if(n.type==="Literal"){const o=n.value;return Bx.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(n);Sc(e)}function Sc(e,r){const s=new ds("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:r,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=HN+"#cannot-handle-mdx-estrees-without-createevaluater",s}function D7(e){const r={};let s;for(s in e)Bx.call(e,s)&&(r[L7(s)]=e[s]);return r}function L7(e){let r=e.replace(y7,O7);return r.slice(0,3)==="ms-"&&(r="-"+r),r}function O7(e){return"-"+e.toLowerCase()}const Vm={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},F7={};function B7(e,r){const s=F7,n=typeof s.includeImageAlt=="boolean"?s.includeImageAlt:!0,o=typeof s.includeHtml=="boolean"?s.includeHtml:!0;return GN(e,n,o)}function GN(e,r,s){if($7(e)){if("value"in e)return e.type==="html"&&!s?"":e.value;if(r&&"alt"in e&&e.alt)return e.alt;if("children"in e)return qw(e.children,r,s)}return Array.isArray(e)?qw(e,r,s):""}function qw(e,r,s){const n=[];let o=-1;for(;++o<e.length;)n[o]=GN(e[o],r,s);return n.join("")}function $7(e){return!!(e&&typeof e=="object")}const Kw=document.createElement("i");function Hx(e){const r="&"+e+";";Kw.innerHTML=r;const s=Kw.textContent;return s.charCodeAt(s.length-1)===59&&e!=="semi"||s===r?!1:s}function Jn(e,r,s,n){const o=e.length;let c=0,d;if(r<0?r=-r>o?0:o+r:r=r>o?o:r,s=s>0?s:0,n.length<1e4)d=Array.from(n),d.unshift(r,s),e.splice(...d);else for(s&&e.splice(r,s);c<n.length;)d=n.slice(c,c+1e4),d.unshift(r,0),e.splice(...d),c+=1e4,r+=1e4}function ln(e,r){return e.length>0?(Jn(e,e.length,0,r),e):r}const Yw={}.hasOwnProperty;function z7(e){const r={};let s=-1;for(;++s<e.length;)H7(r,e[s]);return r}function H7(e,r){let s;for(s in r){const o=(Yw.call(e,s)?e[s]:void 0)||(e[s]={}),c=r[s];let d;if(c)for(d in c){Yw.call(o,d)||(o[d]=[]);const l=c[d];W7(o[d],Array.isArray(l)?l:l?[l]:[])}}}function W7(e,r){let s=-1;const n=[];for(;++s<r.length;)(r[s].add==="after"?e:n).push(r[s]);Jn(e,0,0,n)}function qN(e,r){const s=Number.parseInt(e,r);return s<9||s===11||s>13&&s<32||s>126&&s<160||s>55295&&s<57344||s>64975&&s<65008||(s&65535)===65535||(s&65535)===65534||s>1114111?"�":String.fromCodePoint(s)}function Wa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Wn=no(/[A-Za-z]/),Gs=no(/[\dA-Za-z]/),U7=no(/[#-'*+\--9=?A-Z^-~]/);function Vp(e){return e!==null&&(e<32||e===127)}const Gp=no(/\d/),V7=no(/[\dA-Fa-f]/),G7=no(/[!-/:-@[-`{-~]/);function dt(e){return e!==null&&e<-2}function Ds(e){return e!==null&&(e<0||e===32)}function $t(e){return e===-2||e===-1||e===32}const q7=no(new RegExp("\\p{P}|\\p{S}","u")),K7=no(/\s/);function no(e){return r;function r(s){return s!==null&&s>-1&&e.test(String.fromCharCode(s))}}function dl(e){const r=[];let s=-1,n=0,o=0;for(;++s<e.length;){const c=e.charCodeAt(s);let d="";if(c===37&&Gs(e.charCodeAt(s+1))&&Gs(e.charCodeAt(s+2)))o=2;else if(c<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(c))||(d=String.fromCharCode(c));else if(c>55295&&c<57344){const l=e.charCodeAt(s+1);c<56320&&l>56319&&l<57344?(d=String.fromCharCode(c,l),o=1):d="�"}else d=String.fromCharCode(c);d&&(r.push(e.slice(n,s),encodeURIComponent(d)),n=s+o+1,d=""),o&&(s+=o,o=0)}return r.join("")+e.slice(n)}function Xt(e,r,s,n){const o=n?n-1:Number.POSITIVE_INFINITY;let c=0;return d;function d(u){return $t(u)?(e.enter(s),l(u)):r(u)}function l(u){return $t(u)&&c++<o?(e.consume(u),l):(e.exit(s),r(u))}}const Y7={tokenize:X7};function X7(e){const r=e.attempt(this.parser.constructs.contentInitial,n,o);let s;return r;function n(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Xt(e,r,"linePrefix")}function o(l){return e.enter("paragraph"),c(l)}function c(l){const u=e.enter("chunkText",{contentType:"text",previous:s});return s&&(s.next=u),s=u,d(l)}function d(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return dt(l)?(e.consume(l),e.exit("chunkText"),c):(e.consume(l),d)}}const J7={tokenize:Q7},Xw={tokenize:Z7};function Q7(e){const r=this,s=[];let n=0,o,c,d;return l;function l(b){if(n<s.length){const k=s[n];return r.containerState=k[1],e.attempt(k[0].continuation,u,f)(b)}return f(b)}function u(b){if(n++,r.containerState._closeFlow){r.containerState._closeFlow=void 0,o&&x();const k=r.events.length;let N=k,P;for(;N--;)if(r.events[N][0]==="exit"&&r.events[N][1].type==="chunkFlow"){P=r.events[N][1].end;break}y(n);let A=k;for(;A<r.events.length;)r.events[A][1].end={...P},A++;return Jn(r.events,N+1,0,r.events.slice(k)),r.events.length=A,f(b)}return l(b)}function f(b){if(n===s.length){if(!o)return g(b);if(o.currentConstruct&&o.currentConstruct.concrete)return j(b);r.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return r.containerState={},e.check(Xw,m,h)(b)}function m(b){return o&&x(),y(n),g(b)}function h(b){return r.parser.lazy[r.now().line]=n!==s.length,d=r.now().offset,j(b)}function g(b){return r.containerState={},e.attempt(Xw,w,j)(b)}function w(b){return n++,s.push([r.currentConstruct,r.containerState]),g(b)}function j(b){if(b===null){o&&x(),y(0),e.consume(b);return}return o=o||r.parser.flow(r.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:c}),S(b)}function S(b){if(b===null){v(e.exit("chunkFlow"),!0),y(0),e.consume(b);return}return dt(b)?(e.consume(b),v(e.exit("chunkFlow")),n=0,r.interrupt=void 0,l):(e.consume(b),S)}function v(b,k){const N=r.sliceStream(b);if(k&&N.push(null),b.previous=c,c&&(c.next=b),c=b,o.defineSkip(b.start),o.write(N),r.parser.lazy[b.start.line]){let P=o.events.length;for(;P--;)if(o.events[P][1].start.offset<d&&(!o.events[P][1].end||o.events[P][1].end.offset>d))return;const A=r.events.length;let E=A,M,D;for(;E--;)if(r.events[E][0]==="exit"&&r.events[E][1].type==="chunkFlow"){if(M){D=r.events[E][1].end;break}M=!0}for(y(n),P=A;P<r.events.length;)r.events[P][1].end={...D},P++;Jn(r.events,E+1,0,r.events.slice(A)),r.events.length=P}}function y(b){let k=s.length;for(;k-- >b;){const N=s[k];r.containerState=N[1],N[0].exit.call(r,e)}s.length=b}function x(){o.write([null]),c=void 0,o=void 0,r.containerState._closeFlow=void 0}}function Z7(e,r,s){return Xt(e,e.attempt(this.parser.constructs.document,r,s),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Jw(e){if(e===null||Ds(e)||K7(e))return 1;if(q7(e))return 2}function Wx(e,r,s){const n=[];let o=-1;for(;++o<e.length;){const c=e[o].resolveAll;c&&!n.includes(c)&&(r=c(r,s),n.push(c))}return r}const qp={name:"attention",resolveAll:e9,tokenize:t9};function e9(e,r){let s=-1,n,o,c,d,l,u,f,m;for(;++s<e.length;)if(e[s][0]==="enter"&&e[s][1].type==="attentionSequence"&&e[s][1]._close){for(n=s;n--;)if(e[n][0]==="exit"&&e[n][1].type==="attentionSequence"&&e[n][1]._open&&r.sliceSerialize(e[n][1]).charCodeAt(0)===r.sliceSerialize(e[s][1]).charCodeAt(0)){if((e[n][1]._close||e[s][1]._open)&&(e[s][1].end.offset-e[s][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[s][1].end.offset-e[s][1].start.offset)%3))continue;u=e[n][1].end.offset-e[n][1].start.offset>1&&e[s][1].end.offset-e[s][1].start.offset>1?2:1;const h={...e[n][1].end},g={...e[s][1].start};Qw(h,-u),Qw(g,u),d={type:u>1?"strongSequence":"emphasisSequence",start:h,end:{...e[n][1].end}},l={type:u>1?"strongSequence":"emphasisSequence",start:{...e[s][1].start},end:g},c={type:u>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[s][1].start}},o={type:u>1?"strong":"emphasis",start:{...d.start},end:{...l.end}},e[n][1].end={...d.start},e[s][1].start={...l.end},f=[],e[n][1].end.offset-e[n][1].start.offset&&(f=ln(f,[["enter",e[n][1],r],["exit",e[n][1],r]])),f=ln(f,[["enter",o,r],["enter",d,r],["exit",d,r],["enter",c,r]]),f=ln(f,Wx(r.parser.constructs.insideSpan.null,e.slice(n+1,s),r)),f=ln(f,[["exit",c,r],["enter",l,r],["exit",l,r],["exit",o,r]]),e[s][1].end.offset-e[s][1].start.offset?(m=2,f=ln(f,[["enter",e[s][1],r],["exit",e[s][1],r]])):m=0,Jn(e,n-1,s-n+3,f),s=n+f.length-m-2;break}}for(s=-1;++s<e.length;)e[s][1].type==="attentionSequence"&&(e[s][1].type="data");return e}function t9(e,r){const s=this.parser.constructs.attentionMarkers.null,n=this.previous,o=Jw(n);let c;return d;function d(u){return c=u,e.enter("attentionSequence"),l(u)}function l(u){if(u===c)return e.consume(u),l;const f=e.exit("attentionSequence"),m=Jw(u),h=!m||m===2&&o||s.includes(u),g=!o||o===2&&m||s.includes(n);return f._open=!!(c===42?h:h&&(o||!g)),f._close=!!(c===42?g:g&&(m||!h)),r(u)}}function Qw(e,r){e.column+=r,e.offset+=r,e._bufferIndex+=r}const r9={name:"autolink",tokenize:s9};function s9(e,r,s){let n=0;return o;function o(w){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),c}function c(w){return Wn(w)?(e.consume(w),d):w===64?s(w):f(w)}function d(w){return w===43||w===45||w===46||Gs(w)?(n=1,l(w)):f(w)}function l(w){return w===58?(e.consume(w),n=0,u):(w===43||w===45||w===46||Gs(w))&&n++<32?(e.consume(w),l):(n=0,f(w))}function u(w){return w===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),r):w===null||w===32||w===60||Vp(w)?s(w):(e.consume(w),u)}function f(w){return w===64?(e.consume(w),m):U7(w)?(e.consume(w),f):s(w)}function m(w){return Gs(w)?h(w):s(w)}function h(w){return w===46?(e.consume(w),n=0,m):w===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),r):g(w)}function g(w){if((w===45||Gs(w))&&n++<63){const j=w===45?g:h;return e.consume(w),j}return s(w)}}const Eh={partial:!0,tokenize:n9};function n9(e,r,s){return n;function n(c){return $t(c)?Xt(e,o,"linePrefix")(c):o(c)}function o(c){return c===null||dt(c)?r(c):s(c)}}const KN={continuation:{tokenize:o9},exit:a9,name:"blockQuote",tokenize:i9};function i9(e,r,s){const n=this;return o;function o(d){if(d===62){const l=n.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(d),e.exit("blockQuoteMarker"),c}return s(d)}function c(d){return $t(d)?(e.enter("blockQuotePrefixWhitespace"),e.consume(d),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),r):(e.exit("blockQuotePrefix"),r(d))}}function o9(e,r,s){const n=this;return o;function o(d){return $t(d)?Xt(e,c,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):c(d)}function c(d){return e.attempt(KN,r,s)(d)}}function a9(e){e.exit("blockQuote")}const YN={name:"characterEscape",tokenize:l9};function l9(e,r,s){return n;function n(c){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(c),e.exit("escapeMarker"),o}function o(c){return G7(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),r):s(c)}}const XN={name:"characterReference",tokenize:c9};function c9(e,r,s){const n=this;let o=0,c,d;return l;function l(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),u}function u(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),c=31,d=Gs,m(h))}function f(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),c=6,d=V7,m):(e.enter("characterReferenceValue"),c=7,d=Gp,m(h))}function m(h){if(h===59&&o){const g=e.exit("characterReferenceValue");return d===Gs&&!Hx(n.sliceSerialize(g))?s(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),r)}return d(h)&&o++<c?(e.consume(h),m):s(h)}}const Zw={partial:!0,tokenize:u9},e_={concrete:!0,name:"codeFenced",tokenize:d9};function d9(e,r,s){const n=this,o={partial:!0,tokenize:N};let c=0,d=0,l;return u;function u(P){return f(P)}function f(P){const A=n.events[n.events.length-1];return c=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,l=P,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(P)}function m(P){return P===l?(d++,e.consume(P),m):d<3?s(P):(e.exit("codeFencedFenceSequence"),$t(P)?Xt(e,h,"whitespace")(P):h(P))}function h(P){return P===null||dt(P)?(e.exit("codeFencedFence"),n.interrupt?r(P):e.check(Zw,S,k)(P)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(P))}function g(P){return P===null||dt(P)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(P)):$t(P)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Xt(e,w,"whitespace")(P)):P===96&&P===l?s(P):(e.consume(P),g)}function w(P){return P===null||dt(P)?h(P):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),j(P))}function j(P){return P===null||dt(P)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(P)):P===96&&P===l?s(P):(e.consume(P),j)}function S(P){return e.attempt(o,k,v)(P)}function v(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),y}function y(P){return c>0&&$t(P)?Xt(e,x,"linePrefix",c+1)(P):x(P)}function x(P){return P===null||dt(P)?e.check(Zw,S,k)(P):(e.enter("codeFlowValue"),b(P))}function b(P){return P===null||dt(P)?(e.exit("codeFlowValue"),x(P)):(e.consume(P),b)}function k(P){return e.exit("codeFenced"),r(P)}function N(P,A,E){let M=0;return D;function D(W){return P.enter("lineEnding"),P.consume(W),P.exit("lineEnding"),O}function O(W){return P.enter("codeFencedFence"),$t(W)?Xt(P,z,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):z(W)}function z(W){return W===l?(P.enter("codeFencedFenceSequence"),U(W)):E(W)}function U(W){return W===l?(M++,P.consume(W),U):M>=d?(P.exit("codeFencedFenceSequence"),$t(W)?Xt(P,X,"whitespace")(W):X(W)):E(W)}function X(W){return W===null||dt(W)?(P.exit("codeFencedFence"),A(W)):E(W)}}}function u9(e,r,s){const n=this;return o;function o(d){return d===null?s(d):(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c)}function c(d){return n.parser.lazy[n.now().line]?s(d):r(d)}}const Gm={name:"codeIndented",tokenize:f9},h9={partial:!0,tokenize:m9};function f9(e,r,s){const n=this;return o;function o(f){return e.enter("codeIndented"),Xt(e,c,"linePrefix",5)(f)}function c(f){const m=n.events[n.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?d(f):s(f)}function d(f){return f===null?u(f):dt(f)?e.attempt(h9,d,u)(f):(e.enter("codeFlowValue"),l(f))}function l(f){return f===null||dt(f)?(e.exit("codeFlowValue"),d(f)):(e.consume(f),l)}function u(f){return e.exit("codeIndented"),r(f)}}function m9(e,r,s){const n=this;return o;function o(d){return n.parser.lazy[n.now().line]?s(d):dt(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),o):Xt(e,c,"linePrefix",5)(d)}function c(d){const l=n.events[n.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?r(d):dt(d)?o(d):s(d)}}const p9={name:"codeText",previous:x9,resolve:g9,tokenize:v9};function g9(e){let r=e.length-4,s=3,n,o;if((e[s][1].type==="lineEnding"||e[s][1].type==="space")&&(e[r][1].type==="lineEnding"||e[r][1].type==="space")){for(n=s;++n<r;)if(e[n][1].type==="codeTextData"){e[s][1].type="codeTextPadding",e[r][1].type="codeTextPadding",s+=2,r-=2;break}}for(n=s-1,r++;++n<=r;)o===void 0?n!==r&&e[n][1].type!=="lineEnding"&&(o=n):(n===r||e[n][1].type==="lineEnding")&&(e[o][1].type="codeTextData",n!==o+2&&(e[o][1].end=e[n-1][1].end,e.splice(o+2,n-o-2),r-=n-o-2,n=o+2),o=void 0);return e}function x9(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function v9(e,r,s){let n=0,o,c;return d;function d(h){return e.enter("codeText"),e.enter("codeTextSequence"),l(h)}function l(h){return h===96?(e.consume(h),n++,l):(e.exit("codeTextSequence"),u(h))}function u(h){return h===null?s(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),u):h===96?(c=e.enter("codeTextSequence"),o=0,m(h)):dt(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),u):(e.enter("codeTextData"),f(h))}function f(h){return h===null||h===32||h===96||dt(h)?(e.exit("codeTextData"),u(h)):(e.consume(h),f)}function m(h){return h===96?(e.consume(h),o++,m):o===n?(e.exit("codeTextSequence"),e.exit("codeText"),r(h)):(c.type="codeTextData",f(h))}}class y9{constructor(r){this.left=r?[...r]:[],this.right=[]}get(r){if(r<0||r>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+r+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return r<this.left.length?this.left[r]:this.right[this.right.length-r+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(r,s){const n=s??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(r,n):r>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(r,s,n){const o=s||0;this.setCursor(Math.trunc(r));const c=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return n&&Yl(this.left,n),c.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(r){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(r)}pushMany(r){this.setCursor(Number.POSITIVE_INFINITY),Yl(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),Yl(this.right,r.reverse())}setCursor(r){if(!(r===this.left.length||r>this.left.length&&this.right.length===0||r<0&&this.left.length===0))if(r<this.left.length){const s=this.left.splice(r,Number.POSITIVE_INFINITY);Yl(this.right,s.reverse())}else{const s=this.right.splice(this.left.length+this.right.length-r,Number.POSITIVE_INFINITY);Yl(this.left,s.reverse())}}}function Yl(e,r){let s=0;if(r.length<1e4)e.push(...r);else for(;s<r.length;)e.push(...r.slice(s,s+1e4)),s+=1e4}function JN(e){const r={};let s=-1,n,o,c,d,l,u,f;const m=new y9(e);for(;++s<m.length;){for(;s in r;)s=r[s];if(n=m.get(s),s&&n[1].type==="chunkFlow"&&m.get(s-1)[1].type==="listItemPrefix"&&(u=n[1]._tokenizer.events,c=0,c<u.length&&u[c][1].type==="lineEndingBlank"&&(c+=2),c<u.length&&u[c][1].type==="content"))for(;++c<u.length&&u[c][1].type!=="content";)u[c][1].type==="chunkText"&&(u[c][1]._isInFirstContentOfListItem=!0,c++);if(n[0]==="enter")n[1].contentType&&(Object.assign(r,b9(m,s)),s=r[s],f=!0);else if(n[1]._container){for(c=s,o=void 0;c--;)if(d=m.get(c),d[1].type==="lineEnding"||d[1].type==="lineEndingBlank")d[0]==="enter"&&(o&&(m.get(o)[1].type="lineEndingBlank"),d[1].type="lineEnding",o=c);else if(!(d[1].type==="linePrefix"||d[1].type==="listItemIndent"))break;o&&(n[1].end={...m.get(o)[1].start},l=m.slice(o,s),l.unshift(n),m.splice(o,s-o+1,l))}}return Jn(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!f}function b9(e,r){const s=e.get(r)[1],n=e.get(r)[2];let o=r-1;const c=[];let d=s._tokenizer;d||(d=n.parser[s.contentType](s.start),s._contentTypeTextTrailing&&(d._contentTypeTextTrailing=!0));const l=d.events,u=[],f={};let m,h,g=-1,w=s,j=0,S=0;const v=[S];for(;w;){for(;e.get(++o)[1]!==w;);c.push(o),w._tokenizer||(m=n.sliceStream(w),w.next||m.push(null),h&&d.defineSkip(w.start),w._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(m),w._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),h=w,w=w.next}for(w=s;++g<l.length;)l[g][0]==="exit"&&l[g-1][0]==="enter"&&l[g][1].type===l[g-1][1].type&&l[g][1].start.line!==l[g][1].end.line&&(S=g+1,v.push(S),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(d.events=[],w?(w._tokenizer=void 0,w.previous=void 0):v.pop(),g=v.length;g--;){const y=l.slice(v[g],v[g+1]),x=c.pop();u.push([x,x+y.length-1]),e.splice(x,2,y)}for(u.reverse(),g=-1;++g<u.length;)f[j+u[g][0]]=j+u[g][1],j+=u[g][1]-u[g][0]-1;return f}const w9={resolve:S9,tokenize:C9},_9={partial:!0,tokenize:k9};function S9(e){return JN(e),e}function C9(e,r){let s;return n;function n(l){return e.enter("content"),s=e.enter("chunkContent",{contentType:"content"}),o(l)}function o(l){return l===null?c(l):dt(l)?e.check(_9,d,c)(l):(e.consume(l),o)}function c(l){return e.exit("chunkContent"),e.exit("content"),r(l)}function d(l){return e.consume(l),e.exit("chunkContent"),s.next=e.enter("chunkContent",{contentType:"content",previous:s}),s=s.next,o}}function k9(e,r,s){const n=this;return o;function o(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),Xt(e,c,"linePrefix")}function c(d){if(d===null||dt(d))return s(d);const l=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?r(d):e.interrupt(n.parser.constructs.flow,s,r)(d)}}function QN(e,r,s,n,o,c,d,l,u){const f=u||Number.POSITIVE_INFINITY;let m=0;return h;function h(y){return y===60?(e.enter(n),e.enter(o),e.enter(c),e.consume(y),e.exit(c),g):y===null||y===32||y===41||Vp(y)?s(y):(e.enter(n),e.enter(d),e.enter(l),e.enter("chunkString",{contentType:"string"}),S(y))}function g(y){return y===62?(e.enter(c),e.consume(y),e.exit(c),e.exit(o),e.exit(n),r):(e.enter(l),e.enter("chunkString",{contentType:"string"}),w(y))}function w(y){return y===62?(e.exit("chunkString"),e.exit(l),g(y)):y===null||y===60||dt(y)?s(y):(e.consume(y),y===92?j:w)}function j(y){return y===60||y===62||y===92?(e.consume(y),w):w(y)}function S(y){return!m&&(y===null||y===41||Ds(y))?(e.exit("chunkString"),e.exit(l),e.exit(d),e.exit(n),r(y)):m<f&&y===40?(e.consume(y),m++,S):y===41?(e.consume(y),m--,S):y===null||y===32||y===40||Vp(y)?s(y):(e.consume(y),y===92?v:S)}function v(y){return y===40||y===41||y===92?(e.consume(y),S):S(y)}}function ZN(e,r,s,n,o,c){const d=this;let l=0,u;return f;function f(w){return e.enter(n),e.enter(o),e.consume(w),e.exit(o),e.enter(c),m}function m(w){return l>999||w===null||w===91||w===93&&!u||w===94&&!l&&"_hiddenFootnoteSupport"in d.parser.constructs?s(w):w===93?(e.exit(c),e.enter(o),e.consume(w),e.exit(o),e.exit(n),r):dt(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),h(w))}function h(w){return w===null||w===91||w===93||dt(w)||l++>999?(e.exit("chunkString"),m(w)):(e.consume(w),u||(u=!$t(w)),w===92?g:h)}function g(w){return w===91||w===92||w===93?(e.consume(w),l++,h):h(w)}}function e2(e,r,s,n,o,c){let d;return l;function l(g){return g===34||g===39||g===40?(e.enter(n),e.enter(o),e.consume(g),e.exit(o),d=g===40?41:g,u):s(g)}function u(g){return g===d?(e.enter(o),e.consume(g),e.exit(o),e.exit(n),r):(e.enter(c),f(g))}function f(g){return g===d?(e.exit(c),u(d)):g===null?s(g):dt(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),Xt(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(g))}function m(g){return g===d||g===null||dt(g)?(e.exit("chunkString"),f(g)):(e.consume(g),g===92?h:m)}function h(g){return g===d||g===92?(e.consume(g),m):m(g)}}function lc(e,r){let s;return n;function n(o){return dt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s=!0,n):$t(o)?Xt(e,n,s?"linePrefix":"lineSuffix")(o):r(o)}}const j9={name:"definition",tokenize:E9},N9={partial:!0,tokenize:P9};function E9(e,r,s){const n=this;let o;return c;function c(w){return e.enter("definition"),d(w)}function d(w){return ZN.call(n,e,l,s,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function l(w){return o=Wa(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),u):s(w)}function u(w){return Ds(w)?lc(e,f)(w):f(w)}function f(w){return QN(e,m,s,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function m(w){return e.attempt(N9,h,h)(w)}function h(w){return $t(w)?Xt(e,g,"whitespace")(w):g(w)}function g(w){return w===null||dt(w)?(e.exit("definition"),n.parser.defined.push(o),r(w)):s(w)}}function P9(e,r,s){return n;function n(l){return Ds(l)?lc(e,o)(l):s(l)}function o(l){return e2(e,c,s,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function c(l){return $t(l)?Xt(e,d,"whitespace")(l):d(l)}function d(l){return l===null||dt(l)?r(l):s(l)}}const A9={name:"hardBreakEscape",tokenize:T9};function T9(e,r,s){return n;function n(c){return e.enter("hardBreakEscape"),e.consume(c),o}function o(c){return dt(c)?(e.exit("hardBreakEscape"),r(c)):s(c)}}const R9={name:"headingAtx",resolve:M9,tokenize:I9};function M9(e,r){let s=e.length-2,n=3,o,c;return e[n][1].type==="whitespace"&&(n+=2),s-2>n&&e[s][1].type==="whitespace"&&(s-=2),e[s][1].type==="atxHeadingSequence"&&(n===s-1||s-4>n&&e[s-2][1].type==="whitespace")&&(s-=n+1===s?2:4),s>n&&(o={type:"atxHeadingText",start:e[n][1].start,end:e[s][1].end},c={type:"chunkText",start:e[n][1].start,end:e[s][1].end,contentType:"text"},Jn(e,n,s-n+1,[["enter",o,r],["enter",c,r],["exit",c,r],["exit",o,r]])),e}function I9(e,r,s){let n=0;return o;function o(m){return e.enter("atxHeading"),c(m)}function c(m){return e.enter("atxHeadingSequence"),d(m)}function d(m){return m===35&&n++<6?(e.consume(m),d):m===null||Ds(m)?(e.exit("atxHeadingSequence"),l(m)):s(m)}function l(m){return m===35?(e.enter("atxHeadingSequence"),u(m)):m===null||dt(m)?(e.exit("atxHeading"),r(m)):$t(m)?Xt(e,l,"whitespace")(m):(e.enter("atxHeadingText"),f(m))}function u(m){return m===35?(e.consume(m),u):(e.exit("atxHeadingSequence"),l(m))}function f(m){return m===null||m===35||Ds(m)?(e.exit("atxHeadingText"),l(m)):(e.consume(m),f)}}const D9=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],t_=["pre","script","style","textarea"],L9={concrete:!0,name:"htmlFlow",resolveTo:B9,tokenize:$9},O9={partial:!0,tokenize:H9},F9={partial:!0,tokenize:z9};function B9(e){let r=e.length;for(;r--&&!(e[r][0]==="enter"&&e[r][1].type==="htmlFlow"););return r>1&&e[r-2][1].type==="linePrefix"&&(e[r][1].start=e[r-2][1].start,e[r+1][1].start=e[r-2][1].start,e.splice(r-2,2)),e}function $9(e,r,s){const n=this;let o,c,d,l,u;return f;function f(F){return m(F)}function m(F){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(F),h}function h(F){return F===33?(e.consume(F),g):F===47?(e.consume(F),c=!0,S):F===63?(e.consume(F),o=3,n.interrupt?r:T):Wn(F)?(e.consume(F),d=String.fromCharCode(F),v):s(F)}function g(F){return F===45?(e.consume(F),o=2,w):F===91?(e.consume(F),o=5,l=0,j):Wn(F)?(e.consume(F),o=4,n.interrupt?r:T):s(F)}function w(F){return F===45?(e.consume(F),n.interrupt?r:T):s(F)}function j(F){const re="CDATA[";return F===re.charCodeAt(l++)?(e.consume(F),l===re.length?n.interrupt?r:z:j):s(F)}function S(F){return Wn(F)?(e.consume(F),d=String.fromCharCode(F),v):s(F)}function v(F){if(F===null||F===47||F===62||Ds(F)){const re=F===47,de=d.toLowerCase();return!re&&!c&&t_.includes(de)?(o=1,n.interrupt?r(F):z(F)):D9.includes(d.toLowerCase())?(o=6,re?(e.consume(F),y):n.interrupt?r(F):z(F)):(o=7,n.interrupt&&!n.parser.lazy[n.now().line]?s(F):c?x(F):b(F))}return F===45||Gs(F)?(e.consume(F),d+=String.fromCharCode(F),v):s(F)}function y(F){return F===62?(e.consume(F),n.interrupt?r:z):s(F)}function x(F){return $t(F)?(e.consume(F),x):D(F)}function b(F){return F===47?(e.consume(F),D):F===58||F===95||Wn(F)?(e.consume(F),k):$t(F)?(e.consume(F),b):D(F)}function k(F){return F===45||F===46||F===58||F===95||Gs(F)?(e.consume(F),k):N(F)}function N(F){return F===61?(e.consume(F),P):$t(F)?(e.consume(F),N):b(F)}function P(F){return F===null||F===60||F===61||F===62||F===96?s(F):F===34||F===39?(e.consume(F),u=F,A):$t(F)?(e.consume(F),P):E(F)}function A(F){return F===u?(e.consume(F),u=null,M):F===null||dt(F)?s(F):(e.consume(F),A)}function E(F){return F===null||F===34||F===39||F===47||F===60||F===61||F===62||F===96||Ds(F)?N(F):(e.consume(F),E)}function M(F){return F===47||F===62||$t(F)?b(F):s(F)}function D(F){return F===62?(e.consume(F),O):s(F)}function O(F){return F===null||dt(F)?z(F):$t(F)?(e.consume(F),O):s(F)}function z(F){return F===45&&o===2?(e.consume(F),$):F===60&&o===1?(e.consume(F),Y):F===62&&o===4?(e.consume(F),B):F===63&&o===3?(e.consume(F),T):F===93&&o===5?(e.consume(F),L):dt(F)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(O9,G,U)(F)):F===null||dt(F)?(e.exit("htmlFlowData"),U(F)):(e.consume(F),z)}function U(F){return e.check(F9,X,G)(F)}function X(F){return e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),W}function W(F){return F===null||dt(F)?U(F):(e.enter("htmlFlowData"),z(F))}function $(F){return F===45?(e.consume(F),T):z(F)}function Y(F){return F===47?(e.consume(F),d="",K):z(F)}function K(F){if(F===62){const re=d.toLowerCase();return t_.includes(re)?(e.consume(F),B):z(F)}return Wn(F)&&d.length<8?(e.consume(F),d+=String.fromCharCode(F),K):z(F)}function L(F){return F===93?(e.consume(F),T):z(F)}function T(F){return F===62?(e.consume(F),B):F===45&&o===2?(e.consume(F),T):z(F)}function B(F){return F===null||dt(F)?(e.exit("htmlFlowData"),G(F)):(e.consume(F),B)}function G(F){return e.exit("htmlFlow"),r(F)}}function z9(e,r,s){const n=this;return o;function o(d){return dt(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):s(d)}function c(d){return n.parser.lazy[n.now().line]?s(d):r(d)}}function H9(e,r,s){return n;function n(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Eh,r,s)}}const W9={name:"htmlText",tokenize:U9};function U9(e,r,s){const n=this;let o,c,d;return l;function l(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),u}function u(T){return T===33?(e.consume(T),f):T===47?(e.consume(T),N):T===63?(e.consume(T),b):Wn(T)?(e.consume(T),E):s(T)}function f(T){return T===45?(e.consume(T),m):T===91?(e.consume(T),c=0,j):Wn(T)?(e.consume(T),x):s(T)}function m(T){return T===45?(e.consume(T),w):s(T)}function h(T){return T===null?s(T):T===45?(e.consume(T),g):dt(T)?(d=h,Y(T)):(e.consume(T),h)}function g(T){return T===45?(e.consume(T),w):h(T)}function w(T){return T===62?$(T):T===45?g(T):h(T)}function j(T){const B="CDATA[";return T===B.charCodeAt(c++)?(e.consume(T),c===B.length?S:j):s(T)}function S(T){return T===null?s(T):T===93?(e.consume(T),v):dt(T)?(d=S,Y(T)):(e.consume(T),S)}function v(T){return T===93?(e.consume(T),y):S(T)}function y(T){return T===62?$(T):T===93?(e.consume(T),y):S(T)}function x(T){return T===null||T===62?$(T):dt(T)?(d=x,Y(T)):(e.consume(T),x)}function b(T){return T===null?s(T):T===63?(e.consume(T),k):dt(T)?(d=b,Y(T)):(e.consume(T),b)}function k(T){return T===62?$(T):b(T)}function N(T){return Wn(T)?(e.consume(T),P):s(T)}function P(T){return T===45||Gs(T)?(e.consume(T),P):A(T)}function A(T){return dt(T)?(d=A,Y(T)):$t(T)?(e.consume(T),A):$(T)}function E(T){return T===45||Gs(T)?(e.consume(T),E):T===47||T===62||Ds(T)?M(T):s(T)}function M(T){return T===47?(e.consume(T),$):T===58||T===95||Wn(T)?(e.consume(T),D):dt(T)?(d=M,Y(T)):$t(T)?(e.consume(T),M):$(T)}function D(T){return T===45||T===46||T===58||T===95||Gs(T)?(e.consume(T),D):O(T)}function O(T){return T===61?(e.consume(T),z):dt(T)?(d=O,Y(T)):$t(T)?(e.consume(T),O):M(T)}function z(T){return T===null||T===60||T===61||T===62||T===96?s(T):T===34||T===39?(e.consume(T),o=T,U):dt(T)?(d=z,Y(T)):$t(T)?(e.consume(T),z):(e.consume(T),X)}function U(T){return T===o?(e.consume(T),o=void 0,W):T===null?s(T):dt(T)?(d=U,Y(T)):(e.consume(T),U)}function X(T){return T===null||T===34||T===39||T===60||T===61||T===96?s(T):T===47||T===62||Ds(T)?M(T):(e.consume(T),X)}function W(T){return T===47||T===62||Ds(T)?M(T):s(T)}function $(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),r):s(T)}function Y(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),K}function K(T){return $t(T)?Xt(e,L,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):L(T)}function L(T){return e.enter("htmlTextData"),d(T)}}const Ux={name:"labelEnd",resolveAll:K9,resolveTo:Y9,tokenize:X9},V9={tokenize:J9},G9={tokenize:Q9},q9={tokenize:Z9};function K9(e){let r=-1;const s=[];for(;++r<e.length;){const n=e[r][1];if(s.push(e[r]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){const o=n.type==="labelImage"?4:2;n.type="data",r+=o}}return e.length!==s.length&&Jn(e,0,e.length,s),e}function Y9(e,r){let s=e.length,n=0,o,c,d,l;for(;s--;)if(o=e[s][1],c){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[s][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(d){if(e[s][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(c=s,o.type!=="labelLink")){n=2;break}}else o.type==="labelEnd"&&(d=s);const u={type:e[c][1].type==="labelLink"?"link":"image",start:{...e[c][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[c][1].start},end:{...e[d][1].end}},m={type:"labelText",start:{...e[c+n+2][1].end},end:{...e[d-2][1].start}};return l=[["enter",u,r],["enter",f,r]],l=ln(l,e.slice(c+1,c+n+3)),l=ln(l,[["enter",m,r]]),l=ln(l,Wx(r.parser.constructs.insideSpan.null,e.slice(c+n+4,d-3),r)),l=ln(l,[["exit",m,r],e[d-2],e[d-1],["exit",f,r]]),l=ln(l,e.slice(d+1)),l=ln(l,[["exit",u,r]]),Jn(e,c,e.length,l),e}function X9(e,r,s){const n=this;let o=n.events.length,c,d;for(;o--;)if((n.events[o][1].type==="labelImage"||n.events[o][1].type==="labelLink")&&!n.events[o][1]._balanced){c=n.events[o][1];break}return l;function l(g){return c?c._inactive?h(g):(d=n.parser.defined.includes(Wa(n.sliceSerialize({start:c.end,end:n.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(g),e.exit("labelMarker"),e.exit("labelEnd"),u):s(g)}function u(g){return g===40?e.attempt(V9,m,d?m:h)(g):g===91?e.attempt(G9,m,d?f:h)(g):d?m(g):h(g)}function f(g){return e.attempt(q9,m,h)(g)}function m(g){return r(g)}function h(g){return c._balanced=!0,s(g)}}function J9(e,r,s){return n;function n(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),o}function o(h){return Ds(h)?lc(e,c)(h):c(h)}function c(h){return h===41?m(h):QN(e,d,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function d(h){return Ds(h)?lc(e,u)(h):m(h)}function l(h){return s(h)}function u(h){return h===34||h===39||h===40?e2(e,f,s,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):m(h)}function f(h){return Ds(h)?lc(e,m)(h):m(h)}function m(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),r):s(h)}}function Q9(e,r,s){const n=this;return o;function o(l){return ZN.call(n,e,c,d,"reference","referenceMarker","referenceString")(l)}function c(l){return n.parser.defined.includes(Wa(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?r(l):s(l)}function d(l){return s(l)}}function Z9(e,r,s){return n;function n(c){return e.enter("reference"),e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),o}function o(c){return c===93?(e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),e.exit("reference"),r):s(c)}}const e$={name:"labelStartImage",resolveAll:Ux.resolveAll,tokenize:t$};function t$(e,r,s){const n=this;return o;function o(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),c}function c(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),d):s(l)}function d(l){return l===94&&"_hiddenFootnoteSupport"in n.parser.constructs?s(l):r(l)}}const r$={name:"labelStartLink",resolveAll:Ux.resolveAll,tokenize:s$};function s$(e,r,s){const n=this;return o;function o(d){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelLink"),c}function c(d){return d===94&&"_hiddenFootnoteSupport"in n.parser.constructs?s(d):r(d)}}const qm={name:"lineEnding",tokenize:n$};function n$(e,r){return s;function s(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),Xt(e,r,"linePrefix")}}const wu={name:"thematicBreak",tokenize:i$};function i$(e,r,s){let n=0,o;return c;function c(f){return e.enter("thematicBreak"),d(f)}function d(f){return o=f,l(f)}function l(f){return f===o?(e.enter("thematicBreakSequence"),u(f)):n>=3&&(f===null||dt(f))?(e.exit("thematicBreak"),r(f)):s(f)}function u(f){return f===o?(e.consume(f),n++,u):(e.exit("thematicBreakSequence"),$t(f)?Xt(e,l,"whitespace")(f):l(f))}}const Ts={continuation:{tokenize:c$},exit:u$,name:"list",tokenize:l$},o$={partial:!0,tokenize:h$},a$={partial:!0,tokenize:d$};function l$(e,r,s){const n=this,o=n.events[n.events.length-1];let c=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,d=0;return l;function l(w){const j=n.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(j==="listUnordered"?!n.containerState.marker||w===n.containerState.marker:Gp(w)){if(n.containerState.type||(n.containerState.type=j,e.enter(j,{_container:!0})),j==="listUnordered")return e.enter("listItemPrefix"),w===42||w===45?e.check(wu,s,f)(w):f(w);if(!n.interrupt||w===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(w)}return s(w)}function u(w){return Gp(w)&&++d<10?(e.consume(w),u):(!n.interrupt||d<2)&&(n.containerState.marker?w===n.containerState.marker:w===41||w===46)?(e.exit("listItemValue"),f(w)):s(w)}function f(w){return e.enter("listItemMarker"),e.consume(w),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||w,e.check(Eh,n.interrupt?s:m,e.attempt(o$,g,h))}function m(w){return n.containerState.initialBlankLine=!0,c++,g(w)}function h(w){return $t(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),g):s(w)}function g(w){return n.containerState.size=c+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,r(w)}}function c$(e,r,s){const n=this;return n.containerState._closeFlow=void 0,e.check(Eh,o,c);function o(l){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,Xt(e,r,"listItemIndent",n.containerState.size+1)(l)}function c(l){return n.containerState.furtherBlankLines||!$t(l)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,d(l)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(a$,r,d)(l))}function d(l){return n.containerState._closeFlow=!0,n.interrupt=void 0,Xt(e,e.attempt(Ts,r,s),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function d$(e,r,s){const n=this;return Xt(e,o,"listItemIndent",n.containerState.size+1);function o(c){const d=n.events[n.events.length-1];return d&&d[1].type==="listItemIndent"&&d[2].sliceSerialize(d[1],!0).length===n.containerState.size?r(c):s(c)}}function u$(e){e.exit(this.containerState.type)}function h$(e,r,s){const n=this;return Xt(e,o,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(c){const d=n.events[n.events.length-1];return!$t(c)&&d&&d[1].type==="listItemPrefixWhitespace"?r(c):s(c)}}const r_={name:"setextUnderline",resolveTo:f$,tokenize:m$};function f$(e,r){let s=e.length,n,o,c;for(;s--;)if(e[s][0]==="enter"){if(e[s][1].type==="content"){n=s;break}e[s][1].type==="paragraph"&&(o=s)}else e[s][1].type==="content"&&e.splice(s,1),!c&&e[s][1].type==="definition"&&(c=s);const d={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",c?(e.splice(o,0,["enter",d,r]),e.splice(c+1,0,["exit",e[n][1],r]),e[n][1].end={...e[c][1].end}):e[n][1]=d,e.push(["exit",d,r]),e}function m$(e,r,s){const n=this;let o;return c;function c(f){let m=n.events.length,h;for(;m--;)if(n.events[m][1].type!=="lineEnding"&&n.events[m][1].type!=="linePrefix"&&n.events[m][1].type!=="content"){h=n.events[m][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||h)?(e.enter("setextHeadingLine"),o=f,d(f)):s(f)}function d(f){return e.enter("setextHeadingLineSequence"),l(f)}function l(f){return f===o?(e.consume(f),l):(e.exit("setextHeadingLineSequence"),$t(f)?Xt(e,u,"lineSuffix")(f):u(f))}function u(f){return f===null||dt(f)?(e.exit("setextHeadingLine"),r(f)):s(f)}}const p$={tokenize:g$};function g$(e){const r=this,s=e.attempt(Eh,n,e.attempt(this.parser.constructs.flowInitial,o,Xt(e,e.attempt(this.parser.constructs.flow,o,e.attempt(w9,o)),"linePrefix")));return s;function n(c){if(c===null){e.consume(c);return}return e.enter("lineEndingBlank"),e.consume(c),e.exit("lineEndingBlank"),r.currentConstruct=void 0,s}function o(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),r.currentConstruct=void 0,s}}const x$={resolveAll:r2()},v$=t2("string"),y$=t2("text");function t2(e){return{resolveAll:r2(e==="text"?b$:void 0),tokenize:r};function r(s){const n=this,o=this.parser.constructs[e],c=s.attempt(o,d,l);return d;function d(m){return f(m)?c(m):l(m)}function l(m){if(m===null){s.consume(m);return}return s.enter("data"),s.consume(m),u}function u(m){return f(m)?(s.exit("data"),c(m)):(s.consume(m),u)}function f(m){if(m===null)return!0;const h=o[m];let g=-1;if(h)for(;++g<h.length;){const w=h[g];if(!w.previous||w.previous.call(n,n.previous))return!0}return!1}}}function r2(e){return r;function r(s,n){let o=-1,c;for(;++o<=s.length;)c===void 0?s[o]&&s[o][1].type==="data"&&(c=o,o++):(!s[o]||s[o][1].type!=="data")&&(o!==c+2&&(s[c][1].end=s[o-1][1].end,s.splice(c+2,o-c-2),o=c+2),c=void 0);return e?e(s,n):s}}function b$(e,r){let s=0;for(;++s<=e.length;)if((s===e.length||e[s][1].type==="lineEnding")&&e[s-1][1].type==="data"){const n=e[s-1][1],o=r.sliceStream(n);let c=o.length,d=-1,l=0,u;for(;c--;){const f=o[c];if(typeof f=="string"){for(d=f.length;f.charCodeAt(d-1)===32;)l++,d--;if(d)break;d=-1}else if(f===-2)u=!0,l++;else if(f!==-1){c++;break}}if(r._contentTypeTextTrailing&&s===e.length&&(l=0),l){const f={type:s===e.length||u||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?d:n.start._bufferIndex+d,_index:n.start._index+c,line:n.end.line,column:n.end.column-l,offset:n.end.offset-l},end:{...n.end}};n.end={...f.start},n.start.offset===n.end.offset?Object.assign(n,f):(e.splice(s,0,["enter",f,r],["exit",f,r]),s+=2)}s++}return e}const w$={42:Ts,43:Ts,45:Ts,48:Ts,49:Ts,50:Ts,51:Ts,52:Ts,53:Ts,54:Ts,55:Ts,56:Ts,57:Ts,62:KN},_$={91:j9},S$={[-2]:Gm,[-1]:Gm,32:Gm},C$={35:R9,42:wu,45:[r_,wu],60:L9,61:r_,95:wu,96:e_,126:e_},k$={38:XN,92:YN},j$={[-5]:qm,[-4]:qm,[-3]:qm,33:e$,38:XN,42:qp,60:[r9,W9],91:r$,92:[A9,YN],93:Ux,95:qp,96:p9},N$={null:[qp,x$]},E$={null:[42,95]},P$={null:[]},A$=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:E$,contentInitial:_$,disable:P$,document:w$,flow:C$,flowInitial:S$,insideSpan:N$,string:k$,text:j$},Symbol.toStringTag,{value:"Module"}));function T$(e,r,s){let n={_bufferIndex:-1,_index:0,line:s&&s.line||1,column:s&&s.column||1,offset:s&&s.offset||0};const o={},c=[];let d=[],l=[];const u={attempt:A(N),check:A(P),consume:x,enter:b,exit:k,interrupt:A(P,{interrupt:!0})},f={code:null,containerState:{},defineSkip:S,events:[],now:j,parser:e,previous:null,sliceSerialize:g,sliceStream:w,write:h};let m=r.tokenize.call(f,u);return r.resolveAll&&c.push(r),f;function h(O){return d=ln(d,O),v(),d[d.length-1]!==null?[]:(E(r,0),f.events=Wx(c,f.events,f),f.events)}function g(O,z){return M$(w(O),z)}function w(O){return R$(d,O)}function j(){const{_bufferIndex:O,_index:z,line:U,column:X,offset:W}=n;return{_bufferIndex:O,_index:z,line:U,column:X,offset:W}}function S(O){o[O.line]=O.column,D()}function v(){let O;for(;n._index<d.length;){const z=d[n._index];if(typeof z=="string")for(O=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===O&&n._bufferIndex<z.length;)y(z.charCodeAt(n._bufferIndex));else y(z)}}function y(O){m=m(O)}function x(O){dt(O)?(n.line++,n.column=1,n.offset+=O===-3?2:1,D()):O!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===d[n._index].length&&(n._bufferIndex=-1,n._index++)),f.previous=O}function b(O,z){const U=z||{};return U.type=O,U.start=j(),f.events.push(["enter",U,f]),l.push(U),U}function k(O){const z=l.pop();return z.end=j(),f.events.push(["exit",z,f]),z}function N(O,z){E(O,z.from)}function P(O,z){z.restore()}function A(O,z){return U;function U(X,W,$){let Y,K,L,T;return Array.isArray(X)?G(X):"tokenize"in X?G([X]):B(X);function B(ue){return J;function J(H){const oe=H!==null&&ue[H],ie=H!==null&&ue.null,Z=[...Array.isArray(oe)?oe:oe?[oe]:[],...Array.isArray(ie)?ie:ie?[ie]:[]];return G(Z)(H)}}function G(ue){return Y=ue,K=0,ue.length===0?$:F(ue[K])}function F(ue){return J;function J(H){return T=M(),L=ue,ue.partial||(f.currentConstruct=ue),ue.name&&f.parser.constructs.disable.null.includes(ue.name)?de():ue.tokenize.call(z?Object.assign(Object.create(f),z):f,u,re,de)(H)}}function re(ue){return O(L,T),W}function de(ue){return T.restore(),++K<Y.length?F(Y[K]):$}}}function E(O,z){O.resolveAll&&!c.includes(O)&&c.push(O),O.resolve&&Jn(f.events,z,f.events.length-z,O.resolve(f.events.slice(z),f)),O.resolveTo&&(f.events=O.resolveTo(f.events,f))}function M(){const O=j(),z=f.previous,U=f.currentConstruct,X=f.events.length,W=Array.from(l);return{from:X,restore:$};function $(){n=O,f.previous=z,f.currentConstruct=U,f.events.length=X,l=W,D()}}function D(){n.line in o&&n.column<2&&(n.column=o[n.line],n.offset+=o[n.line]-1)}}function R$(e,r){const s=r.start._index,n=r.start._bufferIndex,o=r.end._index,c=r.end._bufferIndex;let d;if(s===o)d=[e[s].slice(n,c)];else{if(d=e.slice(s,o),n>-1){const l=d[0];typeof l=="string"?d[0]=l.slice(n):d.shift()}c>0&&d.push(e[o].slice(0,c))}return d}function M$(e,r){let s=-1;const n=[];let o;for(;++s<e.length;){const c=e[s];let d;if(typeof c=="string")d=c;else switch(c){case-5:{d="\r";break}case-4:{d=`
|
|
631
|
+
`,f="/",m="*",h="",g="comment",w="declaration";function j(v,y){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];y=y||{};var x=1,b=1;function k(X){var W=X.match(r);W&&(x+=W.length);var $=X.lastIndexOf(u);b=~$?X.length-$:b+X.length}function N(){var X={line:x,column:b};return function(W){return W.position=new P(X),M(),W}}function P(X){this.start=X,this.end={line:x,column:b},this.source=y.source}P.prototype.content=v;function A(X){var W=new Error(y.source+":"+x+":"+b+": "+X);if(W.reason=X,W.filename=y.source,W.line=x,W.column=b,W.source=v,!y.silent)throw W}function E(X){var W=X.exec(v);if(W){var $=W[0];return k($),v=v.slice($.length),W}}function M(){E(s)}function D(X){var W;for(X=X||[];W=O();)W!==!1&&X.push(W);return X}function O(){var X=N();if(!(f!=v.charAt(0)||m!=v.charAt(1))){for(var W=2;h!=v.charAt(W)&&(m!=v.charAt(W)||f!=v.charAt(W+1));)++W;if(W+=2,h===v.charAt(W-1))return A("End of comment missing");var $=v.slice(2,W-2);return b+=2,k($),v=v.slice(W),b+=2,X({type:g,comment:$})}}function z(){var X=N(),W=E(n);if(W){if(O(),!E(o))return A("property missing ':'");var $=E(c),Y=X({type:w,property:S(W[0].replace(e,h)),value:$?S($[0].replace(e,h)):h});return E(d),Y}}function U(){var X=[];D(X);for(var W;W=z();)W!==!1&&(X.push(W),D(X));return X}return M(),U()}function S(v){return v?v.replace(l,h):h}return Um=j,Um}var Hw;function h7(){if(Hw)return Ea;Hw=1;var e=Ea&&Ea.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Ea,"__esModule",{value:!0}),Ea.default=s;const r=e(u7());function s(n,o){let c=null;if(!n||typeof n!="string")return c;const d=(0,r.default)(n),l=typeof o=="function";return d.forEach(u=>{if(u.type!=="declaration")return;const{property:f,value:m}=u;l?o(f,m,u):m&&(c=c||{},c[f]=m)}),c}return Ea}var ql={},Ww;function f7(){if(Ww)return ql;Ww=1,Object.defineProperty(ql,"__esModule",{value:!0}),ql.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,s=/^[^-]+$/,n=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,c=function(f){return!f||s.test(f)||e.test(f)},d=function(f,m){return m.toUpperCase()},l=function(f,m){return"".concat(m,"-")},u=function(f,m){return m===void 0&&(m={}),c(f)?f:(f=f.toLowerCase(),m.reactCompat?f=f.replace(o,l):f=f.replace(n,l),f.replace(r,d))};return ql.camelCase=u,ql}var Kl,Uw;function m7(){if(Uw)return Kl;Uw=1;var e=Kl&&Kl.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},r=e(h7()),s=f7();function n(o,c){var d={};return!o||typeof o!="string"||(0,r.default)(o,function(l,u){l&&u&&(d[(0,s.camelCase)(l,c)]=u)}),d}return n.default=n,Kl=n,Kl}var p7=m7();const g7=Cc(p7),$N=zN("end"),Fx=zN("start");function zN(e){return r;function r(s){const n=s&&s.position&&s.position[e]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function x7(e){const r=Fx(e),s=$N(e);if(r&&s)return{start:r,end:s}}function ac(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Vw(e.position):"start"in e||"end"in e?Vw(e):"line"in e||"column"in e?Up(e):""}function Up(e){return Gw(e&&e.line)+":"+Gw(e&&e.column)}function Vw(e){return Up(e&&e.start)+"-"+Up(e&&e.end)}function Gw(e){return e&&typeof e=="number"?e:1}class ds extends Error{constructor(r,s,n){super(),typeof s=="string"&&(n=s,s=void 0);let o="",c={},d=!1;if(s&&("line"in s&&"column"in s?c={place:s}:"start"in s&&"end"in s?c={place:s}:"type"in s?c={ancestors:[s],place:s.position}:c={...s}),typeof r=="string"?o=r:!c.cause&&r&&(d=!0,o=r.message,c.cause=r),!c.ruleId&&!c.source&&typeof n=="string"){const u=n.indexOf(":");u===-1?c.ruleId=n:(c.source=n.slice(0,u),c.ruleId=n.slice(u+1))}if(!c.place&&c.ancestors&&c.ancestors){const u=c.ancestors[c.ancestors.length-1];u&&(c.place=u.position)}const l=c.place&&"start"in c.place?c.place.start:c.place;this.ancestors=c.ancestors||void 0,this.cause=c.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=l?l.line:void 0,this.name=ac(c.place)||"1:1",this.place=c.place||void 0,this.reason=this.message,this.ruleId=c.ruleId||void 0,this.source=c.source||void 0,this.stack=d&&c.cause&&typeof c.cause.stack=="string"?c.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ds.prototype.file="";ds.prototype.name="";ds.prototype.reason="";ds.prototype.message="";ds.prototype.stack="";ds.prototype.column=void 0;ds.prototype.line=void 0;ds.prototype.ancestors=void 0;ds.prototype.cause=void 0;ds.prototype.fatal=void 0;ds.prototype.place=void 0;ds.prototype.ruleId=void 0;ds.prototype.source=void 0;const Bx={}.hasOwnProperty,v7=new Map,y7=/[A-Z]/g,b7=new Set(["table","tbody","thead","tfoot","tr"]),w7=new Set(["td","th"]),HN="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function _7(e,r){if(!r||r.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const s=r.filePath||void 0;let n;if(r.development){if(typeof r.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=A7(s,r.jsxDEV)}else{if(typeof r.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof r.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=P7(s,r.jsx,r.jsxs)}const o={Fragment:r.Fragment,ancestors:[],components:r.components||{},create:n,elementAttributeNameCase:r.elementAttributeNameCase||"react",evaluater:r.createEvaluater?r.createEvaluater():void 0,filePath:s,ignoreInvalidStyle:r.ignoreInvalidStyle||!1,passKeys:r.passKeys!==!1,passNode:r.passNode||!1,schema:r.space==="svg"?Ox:c7,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},c=WN(o,e,void 0);return c&&typeof c!="string"?c:o.create(e,o.Fragment,{children:c||void 0},void 0)}function WN(e,r,s){if(r.type==="element")return S7(e,r,s);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return C7(e,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return j7(e,r,s);if(r.type==="mdxjsEsm")return k7(e,r);if(r.type==="root")return N7(e,r,s);if(r.type==="text")return E7(e,r)}function S7(e,r,s){const n=e.schema;let o=n;r.tagName.toLowerCase()==="svg"&&n.space==="html"&&(o=Ox,e.schema=o),e.ancestors.push(r);const c=VN(e,r.tagName,!1),d=T7(e,r);let l=zx(e,r);return b7.has(r.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!Z8(u):!0})),UN(e,d,c,r),$x(d,l),e.ancestors.pop(),e.schema=n,e.create(r,c,d,s)}function C7(e,r){if(r.data&&r.data.estree&&e.evaluater){const n=r.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Sc(e,r.position)}function k7(e,r){if(r.data&&r.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(r.data.estree);Sc(e,r.position)}function j7(e,r,s){const n=e.schema;let o=n;r.name==="svg"&&n.space==="html"&&(o=Ox,e.schema=o),e.ancestors.push(r);const c=r.name===null?e.Fragment:VN(e,r.name,!0),d=R7(e,r),l=zx(e,r);return UN(e,d,c,r),$x(d,l),e.ancestors.pop(),e.schema=n,e.create(r,c,d,s)}function N7(e,r,s){const n={};return $x(n,zx(e,r)),e.create(r,e.Fragment,n,s)}function E7(e,r){return r.value}function UN(e,r,s,n){typeof s!="string"&&s!==e.Fragment&&e.passNode&&(r.node=n)}function $x(e,r){if(r.length>0){const s=r.length>1?r:r[0];s&&(e.children=s)}}function P7(e,r,s){return n;function n(o,c,d,l){const f=Array.isArray(d.children)?s:r;return l?f(c,d,l):f(c,d)}}function A7(e,r){return s;function s(n,o,c,d){const l=Array.isArray(c.children),u=Fx(n);return r(o,c,d,l,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function T7(e,r){const s={};let n,o;for(o in r.properties)if(o!=="children"&&Bx.call(r.properties,o)){const c=M7(e,o,r.properties[o]);if(c){const[d,l]=c;e.tableCellAlignToStyle&&d==="align"&&typeof l=="string"&&w7.has(r.tagName)?n=l:s[d]=l}}if(n){const c=s.style||(s.style={});c[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return s}function R7(e,r){const s={};for(const n of r.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&e.evaluater){const c=n.data.estree.body[0];c.type;const d=c.expression;d.type;const l=d.properties[0];l.type,Object.assign(s,e.evaluater.evaluateExpression(l.argument))}else Sc(e,r.position);else{const o=n.name;let c;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&e.evaluater){const l=n.value.data.estree.body[0];l.type,c=e.evaluater.evaluateExpression(l.expression)}else Sc(e,r.position);else c=n.value===null?!0:n.value;s[o]=c}return s}function zx(e,r){const s=[];let n=-1;const o=e.passKeys?new Map:v7;for(;++n<r.children.length;){const c=r.children[n];let d;if(e.passKeys){const u=c.type==="element"?c.tagName:c.type==="mdxJsxFlowElement"||c.type==="mdxJsxTextElement"?c.name:void 0;if(u){const f=o.get(u)||0;d=u+"-"+f,o.set(u,f+1)}}const l=WN(e,c,d);l!==void 0&&s.push(l)}return s}function M7(e,r,s){const n=o7(e.schema,r);if(!(s==null||typeof s=="number"&&Number.isNaN(s))){if(Array.isArray(s)&&(s=n.commaSeparated?K8(s):d7(s)),n.property==="style"){let o=typeof s=="object"?s:I7(e,String(s));return e.stylePropertyNameCase==="css"&&(o=D7(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&n.space?s7[n.property]||n.property:n.attribute,s]}}function I7(e,r){try{return g7(r,{reactCompat:!0})}catch(s){if(e.ignoreInvalidStyle)return{};const n=s,o=new ds("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=HN+"#cannot-parse-style-attribute",o}}function VN(e,r,s){let n;if(!s)n={type:"Literal",value:r};else if(r.includes(".")){const o=r.split(".");let c=-1,d;for(;++c<o.length;){const l=Ow(o[c])?{type:"Identifier",name:o[c]}:{type:"Literal",value:o[c]};d=d?{type:"MemberExpression",object:d,property:l,computed:!!(c&&l.type==="Literal"),optional:!1}:l}n=d}else n=Ow(r)&&!/^[a-z]/.test(r)?{type:"Identifier",name:r}:{type:"Literal",value:r};if(n.type==="Literal"){const o=n.value;return Bx.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(n);Sc(e)}function Sc(e,r){const s=new ds("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:r,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=HN+"#cannot-handle-mdx-estrees-without-createevaluater",s}function D7(e){const r={};let s;for(s in e)Bx.call(e,s)&&(r[L7(s)]=e[s]);return r}function L7(e){let r=e.replace(y7,O7);return r.slice(0,3)==="ms-"&&(r="-"+r),r}function O7(e){return"-"+e.toLowerCase()}const Vm={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},F7={};function B7(e,r){const s=F7,n=typeof s.includeImageAlt=="boolean"?s.includeImageAlt:!0,o=typeof s.includeHtml=="boolean"?s.includeHtml:!0;return GN(e,n,o)}function GN(e,r,s){if($7(e)){if("value"in e)return e.type==="html"&&!s?"":e.value;if(r&&"alt"in e&&e.alt)return e.alt;if("children"in e)return qw(e.children,r,s)}return Array.isArray(e)?qw(e,r,s):""}function qw(e,r,s){const n=[];let o=-1;for(;++o<e.length;)n[o]=GN(e[o],r,s);return n.join("")}function $7(e){return!!(e&&typeof e=="object")}const Kw=document.createElement("i");function Hx(e){const r="&"+e+";";Kw.innerHTML=r;const s=Kw.textContent;return s.charCodeAt(s.length-1)===59&&e!=="semi"||s===r?!1:s}function Jn(e,r,s,n){const o=e.length;let c=0,d;if(r<0?r=-r>o?0:o+r:r=r>o?o:r,s=s>0?s:0,n.length<1e4)d=Array.from(n),d.unshift(r,s),e.splice(...d);else for(s&&e.splice(r,s);c<n.length;)d=n.slice(c,c+1e4),d.unshift(r,0),e.splice(...d),c+=1e4,r+=1e4}function ln(e,r){return e.length>0?(Jn(e,e.length,0,r),e):r}const Yw={}.hasOwnProperty;function z7(e){const r={};let s=-1;for(;++s<e.length;)H7(r,e[s]);return r}function H7(e,r){let s;for(s in r){const o=(Yw.call(e,s)?e[s]:void 0)||(e[s]={}),c=r[s];let d;if(c)for(d in c){Yw.call(o,d)||(o[d]=[]);const l=c[d];W7(o[d],Array.isArray(l)?l:l?[l]:[])}}}function W7(e,r){let s=-1;const n=[];for(;++s<r.length;)(r[s].add==="after"?e:n).push(r[s]);Jn(e,0,0,n)}function qN(e,r){const s=Number.parseInt(e,r);return s<9||s===11||s>13&&s<32||s>126&&s<160||s>55295&&s<57344||s>64975&&s<65008||(s&65535)===65535||(s&65535)===65534||s>1114111?"�":String.fromCodePoint(s)}function Wa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Wn=no(/[A-Za-z]/),Gs=no(/[\dA-Za-z]/),U7=no(/[#-'*+\--9=?A-Z^-~]/);function Vp(e){return e!==null&&(e<32||e===127)}const Gp=no(/\d/),V7=no(/[\dA-Fa-f]/),G7=no(/[!-/:-@[-`{-~]/);function dt(e){return e!==null&&e<-2}function Ds(e){return e!==null&&(e<0||e===32)}function $t(e){return e===-2||e===-1||e===32}const q7=no(new RegExp("\\p{P}|\\p{S}","u")),K7=no(/\s/);function no(e){return r;function r(s){return s!==null&&s>-1&&e.test(String.fromCharCode(s))}}function dl(e){const r=[];let s=-1,n=0,o=0;for(;++s<e.length;){const c=e.charCodeAt(s);let d="";if(c===37&&Gs(e.charCodeAt(s+1))&&Gs(e.charCodeAt(s+2)))o=2;else if(c<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(c))||(d=String.fromCharCode(c));else if(c>55295&&c<57344){const l=e.charCodeAt(s+1);c<56320&&l>56319&&l<57344?(d=String.fromCharCode(c,l),o=1):d="�"}else d=String.fromCharCode(c);d&&(r.push(e.slice(n,s),encodeURIComponent(d)),n=s+o+1,d=""),o&&(s+=o,o=0)}return r.join("")+e.slice(n)}function Xt(e,r,s,n){const o=n?n-1:Number.POSITIVE_INFINITY;let c=0;return d;function d(u){return $t(u)?(e.enter(s),l(u)):r(u)}function l(u){return $t(u)&&c++<o?(e.consume(u),l):(e.exit(s),r(u))}}const Y7={tokenize:X7};function X7(e){const r=e.attempt(this.parser.constructs.contentInitial,n,o);let s;return r;function n(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Xt(e,r,"linePrefix")}function o(l){return e.enter("paragraph"),c(l)}function c(l){const u=e.enter("chunkText",{contentType:"text",previous:s});return s&&(s.next=u),s=u,d(l)}function d(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return dt(l)?(e.consume(l),e.exit("chunkText"),c):(e.consume(l),d)}}const J7={tokenize:Q7},Xw={tokenize:Z7};function Q7(e){const r=this,s=[];let n=0,o,c,d;return l;function l(b){if(n<s.length){const k=s[n];return r.containerState=k[1],e.attempt(k[0].continuation,u,f)(b)}return f(b)}function u(b){if(n++,r.containerState._closeFlow){r.containerState._closeFlow=void 0,o&&x();const k=r.events.length;let N=k,P;for(;N--;)if(r.events[N][0]==="exit"&&r.events[N][1].type==="chunkFlow"){P=r.events[N][1].end;break}y(n);let A=k;for(;A<r.events.length;)r.events[A][1].end={...P},A++;return Jn(r.events,N+1,0,r.events.slice(k)),r.events.length=A,f(b)}return l(b)}function f(b){if(n===s.length){if(!o)return g(b);if(o.currentConstruct&&o.currentConstruct.concrete)return j(b);r.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return r.containerState={},e.check(Xw,m,h)(b)}function m(b){return o&&x(),y(n),g(b)}function h(b){return r.parser.lazy[r.now().line]=n!==s.length,d=r.now().offset,j(b)}function g(b){return r.containerState={},e.attempt(Xw,w,j)(b)}function w(b){return n++,s.push([r.currentConstruct,r.containerState]),g(b)}function j(b){if(b===null){o&&x(),y(0),e.consume(b);return}return o=o||r.parser.flow(r.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:c}),S(b)}function S(b){if(b===null){v(e.exit("chunkFlow"),!0),y(0),e.consume(b);return}return dt(b)?(e.consume(b),v(e.exit("chunkFlow")),n=0,r.interrupt=void 0,l):(e.consume(b),S)}function v(b,k){const N=r.sliceStream(b);if(k&&N.push(null),b.previous=c,c&&(c.next=b),c=b,o.defineSkip(b.start),o.write(N),r.parser.lazy[b.start.line]){let P=o.events.length;for(;P--;)if(o.events[P][1].start.offset<d&&(!o.events[P][1].end||o.events[P][1].end.offset>d))return;const A=r.events.length;let E=A,M,D;for(;E--;)if(r.events[E][0]==="exit"&&r.events[E][1].type==="chunkFlow"){if(M){D=r.events[E][1].end;break}M=!0}for(y(n),P=A;P<r.events.length;)r.events[P][1].end={...D},P++;Jn(r.events,E+1,0,r.events.slice(A)),r.events.length=P}}function y(b){let k=s.length;for(;k-- >b;){const N=s[k];r.containerState=N[1],N[0].exit.call(r,e)}s.length=b}function x(){o.write([null]),c=void 0,o=void 0,r.containerState._closeFlow=void 0}}function Z7(e,r,s){return Xt(e,e.attempt(this.parser.constructs.document,r,s),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Jw(e){if(e===null||Ds(e)||K7(e))return 1;if(q7(e))return 2}function Wx(e,r,s){const n=[];let o=-1;for(;++o<e.length;){const c=e[o].resolveAll;c&&!n.includes(c)&&(r=c(r,s),n.push(c))}return r}const qp={name:"attention",resolveAll:e$,tokenize:t$};function e$(e,r){let s=-1,n,o,c,d,l,u,f,m;for(;++s<e.length;)if(e[s][0]==="enter"&&e[s][1].type==="attentionSequence"&&e[s][1]._close){for(n=s;n--;)if(e[n][0]==="exit"&&e[n][1].type==="attentionSequence"&&e[n][1]._open&&r.sliceSerialize(e[n][1]).charCodeAt(0)===r.sliceSerialize(e[s][1]).charCodeAt(0)){if((e[n][1]._close||e[s][1]._open)&&(e[s][1].end.offset-e[s][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[s][1].end.offset-e[s][1].start.offset)%3))continue;u=e[n][1].end.offset-e[n][1].start.offset>1&&e[s][1].end.offset-e[s][1].start.offset>1?2:1;const h={...e[n][1].end},g={...e[s][1].start};Qw(h,-u),Qw(g,u),d={type:u>1?"strongSequence":"emphasisSequence",start:h,end:{...e[n][1].end}},l={type:u>1?"strongSequence":"emphasisSequence",start:{...e[s][1].start},end:g},c={type:u>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[s][1].start}},o={type:u>1?"strong":"emphasis",start:{...d.start},end:{...l.end}},e[n][1].end={...d.start},e[s][1].start={...l.end},f=[],e[n][1].end.offset-e[n][1].start.offset&&(f=ln(f,[["enter",e[n][1],r],["exit",e[n][1],r]])),f=ln(f,[["enter",o,r],["enter",d,r],["exit",d,r],["enter",c,r]]),f=ln(f,Wx(r.parser.constructs.insideSpan.null,e.slice(n+1,s),r)),f=ln(f,[["exit",c,r],["enter",l,r],["exit",l,r],["exit",o,r]]),e[s][1].end.offset-e[s][1].start.offset?(m=2,f=ln(f,[["enter",e[s][1],r],["exit",e[s][1],r]])):m=0,Jn(e,n-1,s-n+3,f),s=n+f.length-m-2;break}}for(s=-1;++s<e.length;)e[s][1].type==="attentionSequence"&&(e[s][1].type="data");return e}function t$(e,r){const s=this.parser.constructs.attentionMarkers.null,n=this.previous,o=Jw(n);let c;return d;function d(u){return c=u,e.enter("attentionSequence"),l(u)}function l(u){if(u===c)return e.consume(u),l;const f=e.exit("attentionSequence"),m=Jw(u),h=!m||m===2&&o||s.includes(u),g=!o||o===2&&m||s.includes(n);return f._open=!!(c===42?h:h&&(o||!g)),f._close=!!(c===42?g:g&&(m||!h)),r(u)}}function Qw(e,r){e.column+=r,e.offset+=r,e._bufferIndex+=r}const r$={name:"autolink",tokenize:s$};function s$(e,r,s){let n=0;return o;function o(w){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),c}function c(w){return Wn(w)?(e.consume(w),d):w===64?s(w):f(w)}function d(w){return w===43||w===45||w===46||Gs(w)?(n=1,l(w)):f(w)}function l(w){return w===58?(e.consume(w),n=0,u):(w===43||w===45||w===46||Gs(w))&&n++<32?(e.consume(w),l):(n=0,f(w))}function u(w){return w===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),r):w===null||w===32||w===60||Vp(w)?s(w):(e.consume(w),u)}function f(w){return w===64?(e.consume(w),m):U7(w)?(e.consume(w),f):s(w)}function m(w){return Gs(w)?h(w):s(w)}function h(w){return w===46?(e.consume(w),n=0,m):w===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),r):g(w)}function g(w){if((w===45||Gs(w))&&n++<63){const j=w===45?g:h;return e.consume(w),j}return s(w)}}const Eh={partial:!0,tokenize:n$};function n$(e,r,s){return n;function n(c){return $t(c)?Xt(e,o,"linePrefix")(c):o(c)}function o(c){return c===null||dt(c)?r(c):s(c)}}const KN={continuation:{tokenize:o$},exit:a$,name:"blockQuote",tokenize:i$};function i$(e,r,s){const n=this;return o;function o(d){if(d===62){const l=n.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(d),e.exit("blockQuoteMarker"),c}return s(d)}function c(d){return $t(d)?(e.enter("blockQuotePrefixWhitespace"),e.consume(d),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),r):(e.exit("blockQuotePrefix"),r(d))}}function o$(e,r,s){const n=this;return o;function o(d){return $t(d)?Xt(e,c,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):c(d)}function c(d){return e.attempt(KN,r,s)(d)}}function a$(e){e.exit("blockQuote")}const YN={name:"characterEscape",tokenize:l$};function l$(e,r,s){return n;function n(c){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(c),e.exit("escapeMarker"),o}function o(c){return G7(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),r):s(c)}}const XN={name:"characterReference",tokenize:c$};function c$(e,r,s){const n=this;let o=0,c,d;return l;function l(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),u}function u(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),c=31,d=Gs,m(h))}function f(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),c=6,d=V7,m):(e.enter("characterReferenceValue"),c=7,d=Gp,m(h))}function m(h){if(h===59&&o){const g=e.exit("characterReferenceValue");return d===Gs&&!Hx(n.sliceSerialize(g))?s(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),r)}return d(h)&&o++<c?(e.consume(h),m):s(h)}}const Zw={partial:!0,tokenize:u$},e_={concrete:!0,name:"codeFenced",tokenize:d$};function d$(e,r,s){const n=this,o={partial:!0,tokenize:N};let c=0,d=0,l;return u;function u(P){return f(P)}function f(P){const A=n.events[n.events.length-1];return c=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,l=P,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(P)}function m(P){return P===l?(d++,e.consume(P),m):d<3?s(P):(e.exit("codeFencedFenceSequence"),$t(P)?Xt(e,h,"whitespace")(P):h(P))}function h(P){return P===null||dt(P)?(e.exit("codeFencedFence"),n.interrupt?r(P):e.check(Zw,S,k)(P)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(P))}function g(P){return P===null||dt(P)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(P)):$t(P)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Xt(e,w,"whitespace")(P)):P===96&&P===l?s(P):(e.consume(P),g)}function w(P){return P===null||dt(P)?h(P):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),j(P))}function j(P){return P===null||dt(P)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(P)):P===96&&P===l?s(P):(e.consume(P),j)}function S(P){return e.attempt(o,k,v)(P)}function v(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),y}function y(P){return c>0&&$t(P)?Xt(e,x,"linePrefix",c+1)(P):x(P)}function x(P){return P===null||dt(P)?e.check(Zw,S,k)(P):(e.enter("codeFlowValue"),b(P))}function b(P){return P===null||dt(P)?(e.exit("codeFlowValue"),x(P)):(e.consume(P),b)}function k(P){return e.exit("codeFenced"),r(P)}function N(P,A,E){let M=0;return D;function D(W){return P.enter("lineEnding"),P.consume(W),P.exit("lineEnding"),O}function O(W){return P.enter("codeFencedFence"),$t(W)?Xt(P,z,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):z(W)}function z(W){return W===l?(P.enter("codeFencedFenceSequence"),U(W)):E(W)}function U(W){return W===l?(M++,P.consume(W),U):M>=d?(P.exit("codeFencedFenceSequence"),$t(W)?Xt(P,X,"whitespace")(W):X(W)):E(W)}function X(W){return W===null||dt(W)?(P.exit("codeFencedFence"),A(W)):E(W)}}}function u$(e,r,s){const n=this;return o;function o(d){return d===null?s(d):(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c)}function c(d){return n.parser.lazy[n.now().line]?s(d):r(d)}}const Gm={name:"codeIndented",tokenize:f$},h$={partial:!0,tokenize:m$};function f$(e,r,s){const n=this;return o;function o(f){return e.enter("codeIndented"),Xt(e,c,"linePrefix",5)(f)}function c(f){const m=n.events[n.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?d(f):s(f)}function d(f){return f===null?u(f):dt(f)?e.attempt(h$,d,u)(f):(e.enter("codeFlowValue"),l(f))}function l(f){return f===null||dt(f)?(e.exit("codeFlowValue"),d(f)):(e.consume(f),l)}function u(f){return e.exit("codeIndented"),r(f)}}function m$(e,r,s){const n=this;return o;function o(d){return n.parser.lazy[n.now().line]?s(d):dt(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),o):Xt(e,c,"linePrefix",5)(d)}function c(d){const l=n.events[n.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?r(d):dt(d)?o(d):s(d)}}const p$={name:"codeText",previous:x$,resolve:g$,tokenize:v$};function g$(e){let r=e.length-4,s=3,n,o;if((e[s][1].type==="lineEnding"||e[s][1].type==="space")&&(e[r][1].type==="lineEnding"||e[r][1].type==="space")){for(n=s;++n<r;)if(e[n][1].type==="codeTextData"){e[s][1].type="codeTextPadding",e[r][1].type="codeTextPadding",s+=2,r-=2;break}}for(n=s-1,r++;++n<=r;)o===void 0?n!==r&&e[n][1].type!=="lineEnding"&&(o=n):(n===r||e[n][1].type==="lineEnding")&&(e[o][1].type="codeTextData",n!==o+2&&(e[o][1].end=e[n-1][1].end,e.splice(o+2,n-o-2),r-=n-o-2,n=o+2),o=void 0);return e}function x$(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function v$(e,r,s){let n=0,o,c;return d;function d(h){return e.enter("codeText"),e.enter("codeTextSequence"),l(h)}function l(h){return h===96?(e.consume(h),n++,l):(e.exit("codeTextSequence"),u(h))}function u(h){return h===null?s(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),u):h===96?(c=e.enter("codeTextSequence"),o=0,m(h)):dt(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),u):(e.enter("codeTextData"),f(h))}function f(h){return h===null||h===32||h===96||dt(h)?(e.exit("codeTextData"),u(h)):(e.consume(h),f)}function m(h){return h===96?(e.consume(h),o++,m):o===n?(e.exit("codeTextSequence"),e.exit("codeText"),r(h)):(c.type="codeTextData",f(h))}}class y${constructor(r){this.left=r?[...r]:[],this.right=[]}get(r){if(r<0||r>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+r+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return r<this.left.length?this.left[r]:this.right[this.right.length-r+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(r,s){const n=s??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(r,n):r>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(r,s,n){const o=s||0;this.setCursor(Math.trunc(r));const c=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return n&&Yl(this.left,n),c.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(r){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(r)}pushMany(r){this.setCursor(Number.POSITIVE_INFINITY),Yl(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),Yl(this.right,r.reverse())}setCursor(r){if(!(r===this.left.length||r>this.left.length&&this.right.length===0||r<0&&this.left.length===0))if(r<this.left.length){const s=this.left.splice(r,Number.POSITIVE_INFINITY);Yl(this.right,s.reverse())}else{const s=this.right.splice(this.left.length+this.right.length-r,Number.POSITIVE_INFINITY);Yl(this.left,s.reverse())}}}function Yl(e,r){let s=0;if(r.length<1e4)e.push(...r);else for(;s<r.length;)e.push(...r.slice(s,s+1e4)),s+=1e4}function JN(e){const r={};let s=-1,n,o,c,d,l,u,f;const m=new y$(e);for(;++s<m.length;){for(;s in r;)s=r[s];if(n=m.get(s),s&&n[1].type==="chunkFlow"&&m.get(s-1)[1].type==="listItemPrefix"&&(u=n[1]._tokenizer.events,c=0,c<u.length&&u[c][1].type==="lineEndingBlank"&&(c+=2),c<u.length&&u[c][1].type==="content"))for(;++c<u.length&&u[c][1].type!=="content";)u[c][1].type==="chunkText"&&(u[c][1]._isInFirstContentOfListItem=!0,c++);if(n[0]==="enter")n[1].contentType&&(Object.assign(r,b$(m,s)),s=r[s],f=!0);else if(n[1]._container){for(c=s,o=void 0;c--;)if(d=m.get(c),d[1].type==="lineEnding"||d[1].type==="lineEndingBlank")d[0]==="enter"&&(o&&(m.get(o)[1].type="lineEndingBlank"),d[1].type="lineEnding",o=c);else if(!(d[1].type==="linePrefix"||d[1].type==="listItemIndent"))break;o&&(n[1].end={...m.get(o)[1].start},l=m.slice(o,s),l.unshift(n),m.splice(o,s-o+1,l))}}return Jn(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!f}function b$(e,r){const s=e.get(r)[1],n=e.get(r)[2];let o=r-1;const c=[];let d=s._tokenizer;d||(d=n.parser[s.contentType](s.start),s._contentTypeTextTrailing&&(d._contentTypeTextTrailing=!0));const l=d.events,u=[],f={};let m,h,g=-1,w=s,j=0,S=0;const v=[S];for(;w;){for(;e.get(++o)[1]!==w;);c.push(o),w._tokenizer||(m=n.sliceStream(w),w.next||m.push(null),h&&d.defineSkip(w.start),w._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(m),w._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),h=w,w=w.next}for(w=s;++g<l.length;)l[g][0]==="exit"&&l[g-1][0]==="enter"&&l[g][1].type===l[g-1][1].type&&l[g][1].start.line!==l[g][1].end.line&&(S=g+1,v.push(S),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(d.events=[],w?(w._tokenizer=void 0,w.previous=void 0):v.pop(),g=v.length;g--;){const y=l.slice(v[g],v[g+1]),x=c.pop();u.push([x,x+y.length-1]),e.splice(x,2,y)}for(u.reverse(),g=-1;++g<u.length;)f[j+u[g][0]]=j+u[g][1],j+=u[g][1]-u[g][0]-1;return f}const w$={resolve:S$,tokenize:C$},_$={partial:!0,tokenize:k$};function S$(e){return JN(e),e}function C$(e,r){let s;return n;function n(l){return e.enter("content"),s=e.enter("chunkContent",{contentType:"content"}),o(l)}function o(l){return l===null?c(l):dt(l)?e.check(_$,d,c)(l):(e.consume(l),o)}function c(l){return e.exit("chunkContent"),e.exit("content"),r(l)}function d(l){return e.consume(l),e.exit("chunkContent"),s.next=e.enter("chunkContent",{contentType:"content",previous:s}),s=s.next,o}}function k$(e,r,s){const n=this;return o;function o(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),Xt(e,c,"linePrefix")}function c(d){if(d===null||dt(d))return s(d);const l=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?r(d):e.interrupt(n.parser.constructs.flow,s,r)(d)}}function QN(e,r,s,n,o,c,d,l,u){const f=u||Number.POSITIVE_INFINITY;let m=0;return h;function h(y){return y===60?(e.enter(n),e.enter(o),e.enter(c),e.consume(y),e.exit(c),g):y===null||y===32||y===41||Vp(y)?s(y):(e.enter(n),e.enter(d),e.enter(l),e.enter("chunkString",{contentType:"string"}),S(y))}function g(y){return y===62?(e.enter(c),e.consume(y),e.exit(c),e.exit(o),e.exit(n),r):(e.enter(l),e.enter("chunkString",{contentType:"string"}),w(y))}function w(y){return y===62?(e.exit("chunkString"),e.exit(l),g(y)):y===null||y===60||dt(y)?s(y):(e.consume(y),y===92?j:w)}function j(y){return y===60||y===62||y===92?(e.consume(y),w):w(y)}function S(y){return!m&&(y===null||y===41||Ds(y))?(e.exit("chunkString"),e.exit(l),e.exit(d),e.exit(n),r(y)):m<f&&y===40?(e.consume(y),m++,S):y===41?(e.consume(y),m--,S):y===null||y===32||y===40||Vp(y)?s(y):(e.consume(y),y===92?v:S)}function v(y){return y===40||y===41||y===92?(e.consume(y),S):S(y)}}function ZN(e,r,s,n,o,c){const d=this;let l=0,u;return f;function f(w){return e.enter(n),e.enter(o),e.consume(w),e.exit(o),e.enter(c),m}function m(w){return l>999||w===null||w===91||w===93&&!u||w===94&&!l&&"_hiddenFootnoteSupport"in d.parser.constructs?s(w):w===93?(e.exit(c),e.enter(o),e.consume(w),e.exit(o),e.exit(n),r):dt(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),h(w))}function h(w){return w===null||w===91||w===93||dt(w)||l++>999?(e.exit("chunkString"),m(w)):(e.consume(w),u||(u=!$t(w)),w===92?g:h)}function g(w){return w===91||w===92||w===93?(e.consume(w),l++,h):h(w)}}function e2(e,r,s,n,o,c){let d;return l;function l(g){return g===34||g===39||g===40?(e.enter(n),e.enter(o),e.consume(g),e.exit(o),d=g===40?41:g,u):s(g)}function u(g){return g===d?(e.enter(o),e.consume(g),e.exit(o),e.exit(n),r):(e.enter(c),f(g))}function f(g){return g===d?(e.exit(c),u(d)):g===null?s(g):dt(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),Xt(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(g))}function m(g){return g===d||g===null||dt(g)?(e.exit("chunkString"),f(g)):(e.consume(g),g===92?h:m)}function h(g){return g===d||g===92?(e.consume(g),m):m(g)}}function lc(e,r){let s;return n;function n(o){return dt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s=!0,n):$t(o)?Xt(e,n,s?"linePrefix":"lineSuffix")(o):r(o)}}const j$={name:"definition",tokenize:E$},N$={partial:!0,tokenize:P$};function E$(e,r,s){const n=this;let o;return c;function c(w){return e.enter("definition"),d(w)}function d(w){return ZN.call(n,e,l,s,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function l(w){return o=Wa(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),u):s(w)}function u(w){return Ds(w)?lc(e,f)(w):f(w)}function f(w){return QN(e,m,s,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function m(w){return e.attempt(N$,h,h)(w)}function h(w){return $t(w)?Xt(e,g,"whitespace")(w):g(w)}function g(w){return w===null||dt(w)?(e.exit("definition"),n.parser.defined.push(o),r(w)):s(w)}}function P$(e,r,s){return n;function n(l){return Ds(l)?lc(e,o)(l):s(l)}function o(l){return e2(e,c,s,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function c(l){return $t(l)?Xt(e,d,"whitespace")(l):d(l)}function d(l){return l===null||dt(l)?r(l):s(l)}}const A$={name:"hardBreakEscape",tokenize:T$};function T$(e,r,s){return n;function n(c){return e.enter("hardBreakEscape"),e.consume(c),o}function o(c){return dt(c)?(e.exit("hardBreakEscape"),r(c)):s(c)}}const R$={name:"headingAtx",resolve:M$,tokenize:I$};function M$(e,r){let s=e.length-2,n=3,o,c;return e[n][1].type==="whitespace"&&(n+=2),s-2>n&&e[s][1].type==="whitespace"&&(s-=2),e[s][1].type==="atxHeadingSequence"&&(n===s-1||s-4>n&&e[s-2][1].type==="whitespace")&&(s-=n+1===s?2:4),s>n&&(o={type:"atxHeadingText",start:e[n][1].start,end:e[s][1].end},c={type:"chunkText",start:e[n][1].start,end:e[s][1].end,contentType:"text"},Jn(e,n,s-n+1,[["enter",o,r],["enter",c,r],["exit",c,r],["exit",o,r]])),e}function I$(e,r,s){let n=0;return o;function o(m){return e.enter("atxHeading"),c(m)}function c(m){return e.enter("atxHeadingSequence"),d(m)}function d(m){return m===35&&n++<6?(e.consume(m),d):m===null||Ds(m)?(e.exit("atxHeadingSequence"),l(m)):s(m)}function l(m){return m===35?(e.enter("atxHeadingSequence"),u(m)):m===null||dt(m)?(e.exit("atxHeading"),r(m)):$t(m)?Xt(e,l,"whitespace")(m):(e.enter("atxHeadingText"),f(m))}function u(m){return m===35?(e.consume(m),u):(e.exit("atxHeadingSequence"),l(m))}function f(m){return m===null||m===35||Ds(m)?(e.exit("atxHeadingText"),l(m)):(e.consume(m),f)}}const D$=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],t_=["pre","script","style","textarea"],L$={concrete:!0,name:"htmlFlow",resolveTo:B$,tokenize:$$},O$={partial:!0,tokenize:H$},F$={partial:!0,tokenize:z$};function B$(e){let r=e.length;for(;r--&&!(e[r][0]==="enter"&&e[r][1].type==="htmlFlow"););return r>1&&e[r-2][1].type==="linePrefix"&&(e[r][1].start=e[r-2][1].start,e[r+1][1].start=e[r-2][1].start,e.splice(r-2,2)),e}function $$(e,r,s){const n=this;let o,c,d,l,u;return f;function f(F){return m(F)}function m(F){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(F),h}function h(F){return F===33?(e.consume(F),g):F===47?(e.consume(F),c=!0,S):F===63?(e.consume(F),o=3,n.interrupt?r:T):Wn(F)?(e.consume(F),d=String.fromCharCode(F),v):s(F)}function g(F){return F===45?(e.consume(F),o=2,w):F===91?(e.consume(F),o=5,l=0,j):Wn(F)?(e.consume(F),o=4,n.interrupt?r:T):s(F)}function w(F){return F===45?(e.consume(F),n.interrupt?r:T):s(F)}function j(F){const re="CDATA[";return F===re.charCodeAt(l++)?(e.consume(F),l===re.length?n.interrupt?r:z:j):s(F)}function S(F){return Wn(F)?(e.consume(F),d=String.fromCharCode(F),v):s(F)}function v(F){if(F===null||F===47||F===62||Ds(F)){const re=F===47,de=d.toLowerCase();return!re&&!c&&t_.includes(de)?(o=1,n.interrupt?r(F):z(F)):D$.includes(d.toLowerCase())?(o=6,re?(e.consume(F),y):n.interrupt?r(F):z(F)):(o=7,n.interrupt&&!n.parser.lazy[n.now().line]?s(F):c?x(F):b(F))}return F===45||Gs(F)?(e.consume(F),d+=String.fromCharCode(F),v):s(F)}function y(F){return F===62?(e.consume(F),n.interrupt?r:z):s(F)}function x(F){return $t(F)?(e.consume(F),x):D(F)}function b(F){return F===47?(e.consume(F),D):F===58||F===95||Wn(F)?(e.consume(F),k):$t(F)?(e.consume(F),b):D(F)}function k(F){return F===45||F===46||F===58||F===95||Gs(F)?(e.consume(F),k):N(F)}function N(F){return F===61?(e.consume(F),P):$t(F)?(e.consume(F),N):b(F)}function P(F){return F===null||F===60||F===61||F===62||F===96?s(F):F===34||F===39?(e.consume(F),u=F,A):$t(F)?(e.consume(F),P):E(F)}function A(F){return F===u?(e.consume(F),u=null,M):F===null||dt(F)?s(F):(e.consume(F),A)}function E(F){return F===null||F===34||F===39||F===47||F===60||F===61||F===62||F===96||Ds(F)?N(F):(e.consume(F),E)}function M(F){return F===47||F===62||$t(F)?b(F):s(F)}function D(F){return F===62?(e.consume(F),O):s(F)}function O(F){return F===null||dt(F)?z(F):$t(F)?(e.consume(F),O):s(F)}function z(F){return F===45&&o===2?(e.consume(F),$):F===60&&o===1?(e.consume(F),Y):F===62&&o===4?(e.consume(F),B):F===63&&o===3?(e.consume(F),T):F===93&&o===5?(e.consume(F),L):dt(F)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(O$,G,U)(F)):F===null||dt(F)?(e.exit("htmlFlowData"),U(F)):(e.consume(F),z)}function U(F){return e.check(F$,X,G)(F)}function X(F){return e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),W}function W(F){return F===null||dt(F)?U(F):(e.enter("htmlFlowData"),z(F))}function $(F){return F===45?(e.consume(F),T):z(F)}function Y(F){return F===47?(e.consume(F),d="",K):z(F)}function K(F){if(F===62){const re=d.toLowerCase();return t_.includes(re)?(e.consume(F),B):z(F)}return Wn(F)&&d.length<8?(e.consume(F),d+=String.fromCharCode(F),K):z(F)}function L(F){return F===93?(e.consume(F),T):z(F)}function T(F){return F===62?(e.consume(F),B):F===45&&o===2?(e.consume(F),T):z(F)}function B(F){return F===null||dt(F)?(e.exit("htmlFlowData"),G(F)):(e.consume(F),B)}function G(F){return e.exit("htmlFlow"),r(F)}}function z$(e,r,s){const n=this;return o;function o(d){return dt(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):s(d)}function c(d){return n.parser.lazy[n.now().line]?s(d):r(d)}}function H$(e,r,s){return n;function n(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Eh,r,s)}}const W$={name:"htmlText",tokenize:U$};function U$(e,r,s){const n=this;let o,c,d;return l;function l(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),u}function u(T){return T===33?(e.consume(T),f):T===47?(e.consume(T),N):T===63?(e.consume(T),b):Wn(T)?(e.consume(T),E):s(T)}function f(T){return T===45?(e.consume(T),m):T===91?(e.consume(T),c=0,j):Wn(T)?(e.consume(T),x):s(T)}function m(T){return T===45?(e.consume(T),w):s(T)}function h(T){return T===null?s(T):T===45?(e.consume(T),g):dt(T)?(d=h,Y(T)):(e.consume(T),h)}function g(T){return T===45?(e.consume(T),w):h(T)}function w(T){return T===62?$(T):T===45?g(T):h(T)}function j(T){const B="CDATA[";return T===B.charCodeAt(c++)?(e.consume(T),c===B.length?S:j):s(T)}function S(T){return T===null?s(T):T===93?(e.consume(T),v):dt(T)?(d=S,Y(T)):(e.consume(T),S)}function v(T){return T===93?(e.consume(T),y):S(T)}function y(T){return T===62?$(T):T===93?(e.consume(T),y):S(T)}function x(T){return T===null||T===62?$(T):dt(T)?(d=x,Y(T)):(e.consume(T),x)}function b(T){return T===null?s(T):T===63?(e.consume(T),k):dt(T)?(d=b,Y(T)):(e.consume(T),b)}function k(T){return T===62?$(T):b(T)}function N(T){return Wn(T)?(e.consume(T),P):s(T)}function P(T){return T===45||Gs(T)?(e.consume(T),P):A(T)}function A(T){return dt(T)?(d=A,Y(T)):$t(T)?(e.consume(T),A):$(T)}function E(T){return T===45||Gs(T)?(e.consume(T),E):T===47||T===62||Ds(T)?M(T):s(T)}function M(T){return T===47?(e.consume(T),$):T===58||T===95||Wn(T)?(e.consume(T),D):dt(T)?(d=M,Y(T)):$t(T)?(e.consume(T),M):$(T)}function D(T){return T===45||T===46||T===58||T===95||Gs(T)?(e.consume(T),D):O(T)}function O(T){return T===61?(e.consume(T),z):dt(T)?(d=O,Y(T)):$t(T)?(e.consume(T),O):M(T)}function z(T){return T===null||T===60||T===61||T===62||T===96?s(T):T===34||T===39?(e.consume(T),o=T,U):dt(T)?(d=z,Y(T)):$t(T)?(e.consume(T),z):(e.consume(T),X)}function U(T){return T===o?(e.consume(T),o=void 0,W):T===null?s(T):dt(T)?(d=U,Y(T)):(e.consume(T),U)}function X(T){return T===null||T===34||T===39||T===60||T===61||T===96?s(T):T===47||T===62||Ds(T)?M(T):(e.consume(T),X)}function W(T){return T===47||T===62||Ds(T)?M(T):s(T)}function $(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),r):s(T)}function Y(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),K}function K(T){return $t(T)?Xt(e,L,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):L(T)}function L(T){return e.enter("htmlTextData"),d(T)}}const Ux={name:"labelEnd",resolveAll:K$,resolveTo:Y$,tokenize:X$},V$={tokenize:J$},G$={tokenize:Q$},q$={tokenize:Z$};function K$(e){let r=-1;const s=[];for(;++r<e.length;){const n=e[r][1];if(s.push(e[r]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){const o=n.type==="labelImage"?4:2;n.type="data",r+=o}}return e.length!==s.length&&Jn(e,0,e.length,s),e}function Y$(e,r){let s=e.length,n=0,o,c,d,l;for(;s--;)if(o=e[s][1],c){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[s][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(d){if(e[s][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(c=s,o.type!=="labelLink")){n=2;break}}else o.type==="labelEnd"&&(d=s);const u={type:e[c][1].type==="labelLink"?"link":"image",start:{...e[c][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[c][1].start},end:{...e[d][1].end}},m={type:"labelText",start:{...e[c+n+2][1].end},end:{...e[d-2][1].start}};return l=[["enter",u,r],["enter",f,r]],l=ln(l,e.slice(c+1,c+n+3)),l=ln(l,[["enter",m,r]]),l=ln(l,Wx(r.parser.constructs.insideSpan.null,e.slice(c+n+4,d-3),r)),l=ln(l,[["exit",m,r],e[d-2],e[d-1],["exit",f,r]]),l=ln(l,e.slice(d+1)),l=ln(l,[["exit",u,r]]),Jn(e,c,e.length,l),e}function X$(e,r,s){const n=this;let o=n.events.length,c,d;for(;o--;)if((n.events[o][1].type==="labelImage"||n.events[o][1].type==="labelLink")&&!n.events[o][1]._balanced){c=n.events[o][1];break}return l;function l(g){return c?c._inactive?h(g):(d=n.parser.defined.includes(Wa(n.sliceSerialize({start:c.end,end:n.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(g),e.exit("labelMarker"),e.exit("labelEnd"),u):s(g)}function u(g){return g===40?e.attempt(V$,m,d?m:h)(g):g===91?e.attempt(G$,m,d?f:h)(g):d?m(g):h(g)}function f(g){return e.attempt(q$,m,h)(g)}function m(g){return r(g)}function h(g){return c._balanced=!0,s(g)}}function J$(e,r,s){return n;function n(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),o}function o(h){return Ds(h)?lc(e,c)(h):c(h)}function c(h){return h===41?m(h):QN(e,d,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function d(h){return Ds(h)?lc(e,u)(h):m(h)}function l(h){return s(h)}function u(h){return h===34||h===39||h===40?e2(e,f,s,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):m(h)}function f(h){return Ds(h)?lc(e,m)(h):m(h)}function m(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),r):s(h)}}function Q$(e,r,s){const n=this;return o;function o(l){return ZN.call(n,e,c,d,"reference","referenceMarker","referenceString")(l)}function c(l){return n.parser.defined.includes(Wa(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?r(l):s(l)}function d(l){return s(l)}}function Z$(e,r,s){return n;function n(c){return e.enter("reference"),e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),o}function o(c){return c===93?(e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),e.exit("reference"),r):s(c)}}const e9={name:"labelStartImage",resolveAll:Ux.resolveAll,tokenize:t9};function t9(e,r,s){const n=this;return o;function o(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),c}function c(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),d):s(l)}function d(l){return l===94&&"_hiddenFootnoteSupport"in n.parser.constructs?s(l):r(l)}}const r9={name:"labelStartLink",resolveAll:Ux.resolveAll,tokenize:s9};function s9(e,r,s){const n=this;return o;function o(d){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelLink"),c}function c(d){return d===94&&"_hiddenFootnoteSupport"in n.parser.constructs?s(d):r(d)}}const qm={name:"lineEnding",tokenize:n9};function n9(e,r){return s;function s(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),Xt(e,r,"linePrefix")}}const wu={name:"thematicBreak",tokenize:i9};function i9(e,r,s){let n=0,o;return c;function c(f){return e.enter("thematicBreak"),d(f)}function d(f){return o=f,l(f)}function l(f){return f===o?(e.enter("thematicBreakSequence"),u(f)):n>=3&&(f===null||dt(f))?(e.exit("thematicBreak"),r(f)):s(f)}function u(f){return f===o?(e.consume(f),n++,u):(e.exit("thematicBreakSequence"),$t(f)?Xt(e,l,"whitespace")(f):l(f))}}const Ts={continuation:{tokenize:c9},exit:u9,name:"list",tokenize:l9},o9={partial:!0,tokenize:h9},a9={partial:!0,tokenize:d9};function l9(e,r,s){const n=this,o=n.events[n.events.length-1];let c=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,d=0;return l;function l(w){const j=n.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(j==="listUnordered"?!n.containerState.marker||w===n.containerState.marker:Gp(w)){if(n.containerState.type||(n.containerState.type=j,e.enter(j,{_container:!0})),j==="listUnordered")return e.enter("listItemPrefix"),w===42||w===45?e.check(wu,s,f)(w):f(w);if(!n.interrupt||w===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(w)}return s(w)}function u(w){return Gp(w)&&++d<10?(e.consume(w),u):(!n.interrupt||d<2)&&(n.containerState.marker?w===n.containerState.marker:w===41||w===46)?(e.exit("listItemValue"),f(w)):s(w)}function f(w){return e.enter("listItemMarker"),e.consume(w),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||w,e.check(Eh,n.interrupt?s:m,e.attempt(o9,g,h))}function m(w){return n.containerState.initialBlankLine=!0,c++,g(w)}function h(w){return $t(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),g):s(w)}function g(w){return n.containerState.size=c+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,r(w)}}function c9(e,r,s){const n=this;return n.containerState._closeFlow=void 0,e.check(Eh,o,c);function o(l){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,Xt(e,r,"listItemIndent",n.containerState.size+1)(l)}function c(l){return n.containerState.furtherBlankLines||!$t(l)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,d(l)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(a9,r,d)(l))}function d(l){return n.containerState._closeFlow=!0,n.interrupt=void 0,Xt(e,e.attempt(Ts,r,s),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function d9(e,r,s){const n=this;return Xt(e,o,"listItemIndent",n.containerState.size+1);function o(c){const d=n.events[n.events.length-1];return d&&d[1].type==="listItemIndent"&&d[2].sliceSerialize(d[1],!0).length===n.containerState.size?r(c):s(c)}}function u9(e){e.exit(this.containerState.type)}function h9(e,r,s){const n=this;return Xt(e,o,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(c){const d=n.events[n.events.length-1];return!$t(c)&&d&&d[1].type==="listItemPrefixWhitespace"?r(c):s(c)}}const r_={name:"setextUnderline",resolveTo:f9,tokenize:m9};function f9(e,r){let s=e.length,n,o,c;for(;s--;)if(e[s][0]==="enter"){if(e[s][1].type==="content"){n=s;break}e[s][1].type==="paragraph"&&(o=s)}else e[s][1].type==="content"&&e.splice(s,1),!c&&e[s][1].type==="definition"&&(c=s);const d={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",c?(e.splice(o,0,["enter",d,r]),e.splice(c+1,0,["exit",e[n][1],r]),e[n][1].end={...e[c][1].end}):e[n][1]=d,e.push(["exit",d,r]),e}function m9(e,r,s){const n=this;let o;return c;function c(f){let m=n.events.length,h;for(;m--;)if(n.events[m][1].type!=="lineEnding"&&n.events[m][1].type!=="linePrefix"&&n.events[m][1].type!=="content"){h=n.events[m][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||h)?(e.enter("setextHeadingLine"),o=f,d(f)):s(f)}function d(f){return e.enter("setextHeadingLineSequence"),l(f)}function l(f){return f===o?(e.consume(f),l):(e.exit("setextHeadingLineSequence"),$t(f)?Xt(e,u,"lineSuffix")(f):u(f))}function u(f){return f===null||dt(f)?(e.exit("setextHeadingLine"),r(f)):s(f)}}const p9={tokenize:g9};function g9(e){const r=this,s=e.attempt(Eh,n,e.attempt(this.parser.constructs.flowInitial,o,Xt(e,e.attempt(this.parser.constructs.flow,o,e.attempt(w$,o)),"linePrefix")));return s;function n(c){if(c===null){e.consume(c);return}return e.enter("lineEndingBlank"),e.consume(c),e.exit("lineEndingBlank"),r.currentConstruct=void 0,s}function o(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),r.currentConstruct=void 0,s}}const x9={resolveAll:r2()},v9=t2("string"),y9=t2("text");function t2(e){return{resolveAll:r2(e==="text"?b9:void 0),tokenize:r};function r(s){const n=this,o=this.parser.constructs[e],c=s.attempt(o,d,l);return d;function d(m){return f(m)?c(m):l(m)}function l(m){if(m===null){s.consume(m);return}return s.enter("data"),s.consume(m),u}function u(m){return f(m)?(s.exit("data"),c(m)):(s.consume(m),u)}function f(m){if(m===null)return!0;const h=o[m];let g=-1;if(h)for(;++g<h.length;){const w=h[g];if(!w.previous||w.previous.call(n,n.previous))return!0}return!1}}}function r2(e){return r;function r(s,n){let o=-1,c;for(;++o<=s.length;)c===void 0?s[o]&&s[o][1].type==="data"&&(c=o,o++):(!s[o]||s[o][1].type!=="data")&&(o!==c+2&&(s[c][1].end=s[o-1][1].end,s.splice(c+2,o-c-2),o=c+2),c=void 0);return e?e(s,n):s}}function b9(e,r){let s=0;for(;++s<=e.length;)if((s===e.length||e[s][1].type==="lineEnding")&&e[s-1][1].type==="data"){const n=e[s-1][1],o=r.sliceStream(n);let c=o.length,d=-1,l=0,u;for(;c--;){const f=o[c];if(typeof f=="string"){for(d=f.length;f.charCodeAt(d-1)===32;)l++,d--;if(d)break;d=-1}else if(f===-2)u=!0,l++;else if(f!==-1){c++;break}}if(r._contentTypeTextTrailing&&s===e.length&&(l=0),l){const f={type:s===e.length||u||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?d:n.start._bufferIndex+d,_index:n.start._index+c,line:n.end.line,column:n.end.column-l,offset:n.end.offset-l},end:{...n.end}};n.end={...f.start},n.start.offset===n.end.offset?Object.assign(n,f):(e.splice(s,0,["enter",f,r],["exit",f,r]),s+=2)}s++}return e}const w9={42:Ts,43:Ts,45:Ts,48:Ts,49:Ts,50:Ts,51:Ts,52:Ts,53:Ts,54:Ts,55:Ts,56:Ts,57:Ts,62:KN},_9={91:j$},S9={[-2]:Gm,[-1]:Gm,32:Gm},C9={35:R$,42:wu,45:[r_,wu],60:L$,61:r_,95:wu,96:e_,126:e_},k9={38:XN,92:YN},j9={[-5]:qm,[-4]:qm,[-3]:qm,33:e9,38:XN,42:qp,60:[r$,W$],91:r9,92:[A$,YN],93:Ux,95:qp,96:p$},N9={null:[qp,x9]},E9={null:[42,95]},P9={null:[]},A9=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:E9,contentInitial:_9,disable:P9,document:w9,flow:C9,flowInitial:S9,insideSpan:N9,string:k9,text:j9},Symbol.toStringTag,{value:"Module"}));function T9(e,r,s){let n={_bufferIndex:-1,_index:0,line:s&&s.line||1,column:s&&s.column||1,offset:s&&s.offset||0};const o={},c=[];let d=[],l=[];const u={attempt:A(N),check:A(P),consume:x,enter:b,exit:k,interrupt:A(P,{interrupt:!0})},f={code:null,containerState:{},defineSkip:S,events:[],now:j,parser:e,previous:null,sliceSerialize:g,sliceStream:w,write:h};let m=r.tokenize.call(f,u);return r.resolveAll&&c.push(r),f;function h(O){return d=ln(d,O),v(),d[d.length-1]!==null?[]:(E(r,0),f.events=Wx(c,f.events,f),f.events)}function g(O,z){return M9(w(O),z)}function w(O){return R9(d,O)}function j(){const{_bufferIndex:O,_index:z,line:U,column:X,offset:W}=n;return{_bufferIndex:O,_index:z,line:U,column:X,offset:W}}function S(O){o[O.line]=O.column,D()}function v(){let O;for(;n._index<d.length;){const z=d[n._index];if(typeof z=="string")for(O=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===O&&n._bufferIndex<z.length;)y(z.charCodeAt(n._bufferIndex));else y(z)}}function y(O){m=m(O)}function x(O){dt(O)?(n.line++,n.column=1,n.offset+=O===-3?2:1,D()):O!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===d[n._index].length&&(n._bufferIndex=-1,n._index++)),f.previous=O}function b(O,z){const U=z||{};return U.type=O,U.start=j(),f.events.push(["enter",U,f]),l.push(U),U}function k(O){const z=l.pop();return z.end=j(),f.events.push(["exit",z,f]),z}function N(O,z){E(O,z.from)}function P(O,z){z.restore()}function A(O,z){return U;function U(X,W,$){let Y,K,L,T;return Array.isArray(X)?G(X):"tokenize"in X?G([X]):B(X);function B(ue){return J;function J(H){const oe=H!==null&&ue[H],ie=H!==null&&ue.null,Z=[...Array.isArray(oe)?oe:oe?[oe]:[],...Array.isArray(ie)?ie:ie?[ie]:[]];return G(Z)(H)}}function G(ue){return Y=ue,K=0,ue.length===0?$:F(ue[K])}function F(ue){return J;function J(H){return T=M(),L=ue,ue.partial||(f.currentConstruct=ue),ue.name&&f.parser.constructs.disable.null.includes(ue.name)?de():ue.tokenize.call(z?Object.assign(Object.create(f),z):f,u,re,de)(H)}}function re(ue){return O(L,T),W}function de(ue){return T.restore(),++K<Y.length?F(Y[K]):$}}}function E(O,z){O.resolveAll&&!c.includes(O)&&c.push(O),O.resolve&&Jn(f.events,z,f.events.length-z,O.resolve(f.events.slice(z),f)),O.resolveTo&&(f.events=O.resolveTo(f.events,f))}function M(){const O=j(),z=f.previous,U=f.currentConstruct,X=f.events.length,W=Array.from(l);return{from:X,restore:$};function $(){n=O,f.previous=z,f.currentConstruct=U,f.events.length=X,l=W,D()}}function D(){n.line in o&&n.column<2&&(n.column=o[n.line],n.offset+=o[n.line]-1)}}function R9(e,r){const s=r.start._index,n=r.start._bufferIndex,o=r.end._index,c=r.end._bufferIndex;let d;if(s===o)d=[e[s].slice(n,c)];else{if(d=e.slice(s,o),n>-1){const l=d[0];typeof l=="string"?d[0]=l.slice(n):d.shift()}c>0&&d.push(e[o].slice(0,c))}return d}function M9(e,r){let s=-1;const n=[];let o;for(;++s<e.length;){const c=e[s];let d;if(typeof c=="string")d=c;else switch(c){case-5:{d="\r";break}case-4:{d=`
|
|
632
632
|
`;break}case-3:{d=`\r
|
|
633
|
-
`;break}case-2:{d=r?" ":" ";break}case-1:{if(!r&&o)continue;d=" ";break}default:d=String.fromCharCode(c)}o=c===-2,n.push(d)}return n.join("")}function I$(e){const n={constructs:z7([A$,...(e||{}).extensions||[]]),content:o(Y7),defined:[],document:o(J7),flow:o(p$),lazy:{},string:o(v$),text:o(y$)};return n;function o(c){return d;function d(l){return T$(n,c,l)}}}function D$(e){for(;!JN(e););return e}const s_=/[\0\t\n\r]/g;function L$(){let e=1,r="",s=!0,n;return o;function o(c,d,l){const u=[];let f,m,h,g,w;for(c=r+(typeof c=="string"?c.toString():new TextDecoder(d||void 0).decode(c)),h=0,r="",s&&(c.charCodeAt(0)===65279&&h++,s=void 0);h<c.length;){if(s_.lastIndex=h,f=s_.exec(c),g=f&&f.index!==void 0?f.index:c.length,w=c.charCodeAt(g),!f){r=c.slice(h);break}if(w===10&&h===g&&n)u.push(-3),n=void 0;else switch(n&&(u.push(-5),n=void 0),h<g&&(u.push(c.slice(h,g)),e+=g-h),w){case 0:{u.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,u.push(-2);e++<m;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:n=!0,e=1}h=g+1}return l&&(n&&u.push(-5),r&&u.push(r),u.push(null)),u}}const O$=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function F$(e){return e.replace(O$,B$)}function B$(e,r,s){if(r)return r;if(s.charCodeAt(0)===35){const o=s.charCodeAt(1),c=o===120||o===88;return qN(s.slice(c?2:1),c?16:10)}return Hx(s)||e}const s2={}.hasOwnProperty;function $$(e,r,s){return r&&typeof r=="object"&&(s=r,r=void 0),z$(s)(D$(I$(s).document().write(L$()(e,r,!0))))}function z$(e){const r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c($e),autolinkProtocol:M,autolinkEmail:M,atxHeading:c(Fe),blockQuote:c(ie),characterEscape:M,characterReference:M,codeFenced:c(Z),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:c(Z,d),codeText:c(le,d),codeTextData:M,data:M,codeFlowValue:M,definition:c(ee),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:c(_e),hardBreakEscape:c(he),hardBreakTrailing:c(he),htmlFlow:c(we,d),htmlFlowData:M,htmlText:c(we,d),htmlTextData:M,image:c(Oe),label:d,link:c($e),listItem:c(xt),listItemValue:g,listOrdered:c(Ke,h),listUnordered:c(Ke),paragraph:c(Ce),reference:F,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:c(Fe),strong:c(pe),thematicBreak:c(De)},exit:{atxHeading:u(),atxHeadingSequence:N,autolink:u(),autolinkEmail:oe,autolinkProtocol:H,blockQuote:u(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:de,characterReferenceMarkerNumeric:de,characterReferenceValue:ue,characterReference:J,codeFenced:u(v),codeFencedFence:S,codeFencedFenceInfo:w,codeFencedFenceMeta:j,codeFlowValue:D,codeIndented:u(y),codeText:u(W),codeTextData:D,data:D,definition:u(),definitionDestinationString:k,definitionLabelString:x,definitionTitleString:b,emphasis:u(),hardBreakEscape:u(z),hardBreakTrailing:u(z),htmlFlow:u(U),htmlFlowData:D,htmlText:u(X),htmlTextData:D,image:u(Y),label:L,labelText:K,lineEnding:O,link:u($),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:re,resourceDestinationString:T,resourceTitleString:B,resource:G,setextHeading:u(E),setextHeadingLineSequence:A,setextHeadingText:P,strong:u(),thematicBreak:u()}};n2(r,(e||{}).mdastExtensions||[]);const s={};return n;function n(fe){let Se={type:"root",children:[]};const Te={stack:[Se],tokenStack:[],config:r,enter:l,exit:f,buffer:d,resume:m,data:s},He=[];let Ye=-1;for(;++Ye<fe.length;)if(fe[Ye][1].type==="listOrdered"||fe[Ye][1].type==="listUnordered")if(fe[Ye][0]==="enter")He.push(Ye);else{const Et=He.pop();Ye=o(fe,Et,Ye)}for(Ye=-1;++Ye<fe.length;){const Et=r[fe[Ye][0]];s2.call(Et,fe[Ye][1].type)&&Et[fe[Ye][1].type].call(Object.assign({sliceSerialize:fe[Ye][2].sliceSerialize},Te),fe[Ye][1])}if(Te.tokenStack.length>0){const Et=Te.tokenStack[Te.tokenStack.length-1];(Et[1]||n_).call(Te,void 0,Et[0])}for(Se.position={start:Wi(fe.length>0?fe[0][1].start:{line:1,column:1,offset:0}),end:Wi(fe.length>0?fe[fe.length-2][1].end:{line:1,column:1,offset:0})},Ye=-1;++Ye<r.transforms.length;)Se=r.transforms[Ye](Se)||Se;return Se}function o(fe,Se,Te){let He=Se-1,Ye=-1,Et=!1,at,ur,Ir,Ur;for(;++He<=Te;){const Jt=fe[He];switch(Jt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Jt[0]==="enter"?Ye++:Ye--,Ur=void 0;break}case"lineEndingBlank":{Jt[0]==="enter"&&(at&&!Ur&&!Ye&&!Ir&&(Ir=He),Ur=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ur=void 0}if(!Ye&&Jt[0]==="enter"&&Jt[1].type==="listItemPrefix"||Ye===-1&&Jt[0]==="exit"&&(Jt[1].type==="listUnordered"||Jt[1].type==="listOrdered")){if(at){let Nr=He;for(ur=void 0;Nr--;){const Vt=fe[Nr];if(Vt[1].type==="lineEnding"||Vt[1].type==="lineEndingBlank"){if(Vt[0]==="exit")continue;ur&&(fe[ur][1].type="lineEndingBlank",Et=!0),Vt[1].type="lineEnding",ur=Nr}else if(!(Vt[1].type==="linePrefix"||Vt[1].type==="blockQuotePrefix"||Vt[1].type==="blockQuotePrefixWhitespace"||Vt[1].type==="blockQuoteMarker"||Vt[1].type==="listItemIndent"))break}Ir&&(!ur||Ir<ur)&&(at._spread=!0),at.end=Object.assign({},ur?fe[ur][1].start:Jt[1].end),fe.splice(ur||He,0,["exit",at,Jt[2]]),He++,Te++}if(Jt[1].type==="listItemPrefix"){const Nr={type:"listItem",_spread:!1,start:Object.assign({},Jt[1].start),end:void 0};at=Nr,fe.splice(He,0,["enter",Nr,Jt[2]]),He++,Te++,Ir=void 0,Ur=!0}}}return fe[Se][1]._spread=Et,Te}function c(fe,Se){return Te;function Te(He){l.call(this,fe(He),He),Se&&Se.call(this,He)}}function d(){this.stack.push({type:"fragment",children:[]})}function l(fe,Se,Te){this.stack[this.stack.length-1].children.push(fe),this.stack.push(fe),this.tokenStack.push([Se,Te||void 0]),fe.position={start:Wi(Se.start),end:void 0}}function u(fe){return Se;function Se(Te){fe&&fe.call(this,Te),f.call(this,Te)}}function f(fe,Se){const Te=this.stack.pop(),He=this.tokenStack.pop();if(He)He[0].type!==fe.type&&(Se?Se.call(this,fe,He[0]):(He[1]||n_).call(this,fe,He[0]));else throw new Error("Cannot close `"+fe.type+"` ("+ac({start:fe.start,end:fe.end})+"): it’s not open");Te.position.end=Wi(fe.end)}function m(){return B7(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function g(fe){if(this.data.expectingFirstListItemValue){const Se=this.stack[this.stack.length-2];Se.start=Number.parseInt(this.sliceSerialize(fe),10),this.data.expectingFirstListItemValue=void 0}}function w(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.lang=fe}function j(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.meta=fe}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=fe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=fe.replace(/(\r?\n|\r)$/g,"")}function x(fe){const Se=this.resume(),Te=this.stack[this.stack.length-1];Te.label=Se,Te.identifier=Wa(this.sliceSerialize(fe)).toLowerCase()}function b(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.title=fe}function k(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.url=fe}function N(fe){const Se=this.stack[this.stack.length-1];if(!Se.depth){const Te=this.sliceSerialize(fe).length;Se.depth=Te}}function P(){this.data.setextHeadingSlurpLineEnding=!0}function A(fe){const Se=this.stack[this.stack.length-1];Se.depth=this.sliceSerialize(fe).codePointAt(0)===61?1:2}function E(){this.data.setextHeadingSlurpLineEnding=void 0}function M(fe){const Te=this.stack[this.stack.length-1].children;let He=Te[Te.length-1];(!He||He.type!=="text")&&(He=be(),He.position={start:Wi(fe.start),end:void 0},Te.push(He)),this.stack.push(He)}function D(fe){const Se=this.stack.pop();Se.value+=this.sliceSerialize(fe),Se.position.end=Wi(fe.end)}function O(fe){const Se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Te=Se.children[Se.children.length-1];Te.position.end=Wi(fe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(Se.type)&&(M.call(this,fe),D.call(this,fe))}function z(){this.data.atHardBreak=!0}function U(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=fe}function X(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=fe}function W(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=fe}function $(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=Se,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function Y(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=Se,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function K(fe){const Se=this.sliceSerialize(fe),Te=this.stack[this.stack.length-2];Te.label=F$(Se),Te.identifier=Wa(Se).toLowerCase()}function L(){const fe=this.stack[this.stack.length-1],Se=this.resume(),Te=this.stack[this.stack.length-1];if(this.data.inReference=!0,Te.type==="link"){const He=fe.children;Te.children=He}else Te.alt=Se}function T(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.url=fe}function B(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.title=fe}function G(){this.data.inReference=void 0}function F(){this.data.referenceType="collapsed"}function re(fe){const Se=this.resume(),Te=this.stack[this.stack.length-1];Te.label=Se,Te.identifier=Wa(this.sliceSerialize(fe)).toLowerCase(),this.data.referenceType="full"}function de(fe){this.data.characterReferenceType=fe.type}function ue(fe){const Se=this.sliceSerialize(fe),Te=this.data.characterReferenceType;let He;Te?(He=qN(Se,Te==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):He=Hx(Se);const Ye=this.stack[this.stack.length-1];Ye.value+=He}function J(fe){const Se=this.stack.pop();Se.position.end=Wi(fe.end)}function H(fe){D.call(this,fe);const Se=this.stack[this.stack.length-1];Se.url=this.sliceSerialize(fe)}function oe(fe){D.call(this,fe);const Se=this.stack[this.stack.length-1];Se.url="mailto:"+this.sliceSerialize(fe)}function ie(){return{type:"blockquote",children:[]}}function Z(){return{type:"code",lang:null,meta:null,value:""}}function le(){return{type:"inlineCode",value:""}}function ee(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function _e(){return{type:"emphasis",children:[]}}function Fe(){return{type:"heading",depth:0,children:[]}}function he(){return{type:"break"}}function we(){return{type:"html",value:""}}function Oe(){return{type:"image",title:null,url:"",alt:null}}function $e(){return{type:"link",title:null,url:"",children:[]}}function Ke(fe){return{type:"list",ordered:fe.type==="listOrdered",start:null,spread:fe._spread,children:[]}}function xt(fe){return{type:"listItem",spread:fe._spread,checked:null,children:[]}}function Ce(){return{type:"paragraph",children:[]}}function pe(){return{type:"strong",children:[]}}function be(){return{type:"text",value:""}}function De(){return{type:"thematicBreak"}}}function Wi(e){return{line:e.line,column:e.column,offset:e.offset}}function n2(e,r){let s=-1;for(;++s<r.length;){const n=r[s];Array.isArray(n)?n2(e,n):H$(e,n)}}function H$(e,r){let s;for(s in r)if(s2.call(r,s))switch(s){case"canContainEols":{const n=r[s];n&&e[s].push(...n);break}case"transforms":{const n=r[s];n&&e[s].push(...n);break}case"enter":case"exit":{const n=r[s];n&&Object.assign(e[s],n);break}}}function n_(e,r){throw e?new Error("Cannot close `"+e.type+"` ("+ac({start:e.start,end:e.end})+"): a different token (`"+r.type+"`, "+ac({start:r.start,end:r.end})+") is open"):new Error("Cannot close document, a token (`"+r.type+"`, "+ac({start:r.start,end:r.end})+") is still open")}function W$(e){const r=this;r.parser=s;function s(n){return $$(n,{...r.data("settings"),...e,extensions:r.data("micromarkExtensions")||[],mdastExtensions:r.data("fromMarkdownExtensions")||[]})}}function U$(e,r){const s={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(r),!0)};return e.patch(r,s),e.applyData(r,s)}function V$(e,r){const s={type:"element",tagName:"br",properties:{},children:[]};return e.patch(r,s),[e.applyData(r,s),{type:"text",value:`
|
|
634
|
-
`}]}function
|
|
635
|
-
`:"",n={},o=r.lang?r.lang.split(/\s+/):[];o.length>0&&(n.className=["language-"+o[0]]);let c={type:"element",tagName:"code",properties:n,children:[{type:"text",value:s}]};return r.meta&&(c.data={meta:r.meta}),e.patch(r,c),c=e.applyData(r,c),c={type:"element",tagName:"pre",properties:{},children:[c]},e.patch(r,c),c}function
|
|
633
|
+
`;break}case-2:{d=r?" ":" ";break}case-1:{if(!r&&o)continue;d=" ";break}default:d=String.fromCharCode(c)}o=c===-2,n.push(d)}return n.join("")}function I9(e){const n={constructs:z7([A9,...(e||{}).extensions||[]]),content:o(Y7),defined:[],document:o(J7),flow:o(p9),lazy:{},string:o(v9),text:o(y9)};return n;function o(c){return d;function d(l){return T9(n,c,l)}}}function D9(e){for(;!JN(e););return e}const s_=/[\0\t\n\r]/g;function L9(){let e=1,r="",s=!0,n;return o;function o(c,d,l){const u=[];let f,m,h,g,w;for(c=r+(typeof c=="string"?c.toString():new TextDecoder(d||void 0).decode(c)),h=0,r="",s&&(c.charCodeAt(0)===65279&&h++,s=void 0);h<c.length;){if(s_.lastIndex=h,f=s_.exec(c),g=f&&f.index!==void 0?f.index:c.length,w=c.charCodeAt(g),!f){r=c.slice(h);break}if(w===10&&h===g&&n)u.push(-3),n=void 0;else switch(n&&(u.push(-5),n=void 0),h<g&&(u.push(c.slice(h,g)),e+=g-h),w){case 0:{u.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,u.push(-2);e++<m;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:n=!0,e=1}h=g+1}return l&&(n&&u.push(-5),r&&u.push(r),u.push(null)),u}}const O9=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function F9(e){return e.replace(O9,B9)}function B9(e,r,s){if(r)return r;if(s.charCodeAt(0)===35){const o=s.charCodeAt(1),c=o===120||o===88;return qN(s.slice(c?2:1),c?16:10)}return Hx(s)||e}const s2={}.hasOwnProperty;function $9(e,r,s){return r&&typeof r=="object"&&(s=r,r=void 0),z9(s)(D9(I9(s).document().write(L9()(e,r,!0))))}function z9(e){const r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c($e),autolinkProtocol:M,autolinkEmail:M,atxHeading:c(Fe),blockQuote:c(ie),characterEscape:M,characterReference:M,codeFenced:c(Z),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:c(Z,d),codeText:c(le,d),codeTextData:M,data:M,codeFlowValue:M,definition:c(ee),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:c(_e),hardBreakEscape:c(he),hardBreakTrailing:c(he),htmlFlow:c(we,d),htmlFlowData:M,htmlText:c(we,d),htmlTextData:M,image:c(Oe),label:d,link:c($e),listItem:c(xt),listItemValue:g,listOrdered:c(Ke,h),listUnordered:c(Ke),paragraph:c(Ce),reference:F,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:c(Fe),strong:c(pe),thematicBreak:c(De)},exit:{atxHeading:u(),atxHeadingSequence:N,autolink:u(),autolinkEmail:oe,autolinkProtocol:H,blockQuote:u(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:de,characterReferenceMarkerNumeric:de,characterReferenceValue:ue,characterReference:J,codeFenced:u(v),codeFencedFence:S,codeFencedFenceInfo:w,codeFencedFenceMeta:j,codeFlowValue:D,codeIndented:u(y),codeText:u(W),codeTextData:D,data:D,definition:u(),definitionDestinationString:k,definitionLabelString:x,definitionTitleString:b,emphasis:u(),hardBreakEscape:u(z),hardBreakTrailing:u(z),htmlFlow:u(U),htmlFlowData:D,htmlText:u(X),htmlTextData:D,image:u(Y),label:L,labelText:K,lineEnding:O,link:u($),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:re,resourceDestinationString:T,resourceTitleString:B,resource:G,setextHeading:u(E),setextHeadingLineSequence:A,setextHeadingText:P,strong:u(),thematicBreak:u()}};n2(r,(e||{}).mdastExtensions||[]);const s={};return n;function n(fe){let Se={type:"root",children:[]};const Te={stack:[Se],tokenStack:[],config:r,enter:l,exit:f,buffer:d,resume:m,data:s},He=[];let Ye=-1;for(;++Ye<fe.length;)if(fe[Ye][1].type==="listOrdered"||fe[Ye][1].type==="listUnordered")if(fe[Ye][0]==="enter")He.push(Ye);else{const Et=He.pop();Ye=o(fe,Et,Ye)}for(Ye=-1;++Ye<fe.length;){const Et=r[fe[Ye][0]];s2.call(Et,fe[Ye][1].type)&&Et[fe[Ye][1].type].call(Object.assign({sliceSerialize:fe[Ye][2].sliceSerialize},Te),fe[Ye][1])}if(Te.tokenStack.length>0){const Et=Te.tokenStack[Te.tokenStack.length-1];(Et[1]||n_).call(Te,void 0,Et[0])}for(Se.position={start:Wi(fe.length>0?fe[0][1].start:{line:1,column:1,offset:0}),end:Wi(fe.length>0?fe[fe.length-2][1].end:{line:1,column:1,offset:0})},Ye=-1;++Ye<r.transforms.length;)Se=r.transforms[Ye](Se)||Se;return Se}function o(fe,Se,Te){let He=Se-1,Ye=-1,Et=!1,at,ur,Ir,Ur;for(;++He<=Te;){const Jt=fe[He];switch(Jt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Jt[0]==="enter"?Ye++:Ye--,Ur=void 0;break}case"lineEndingBlank":{Jt[0]==="enter"&&(at&&!Ur&&!Ye&&!Ir&&(Ir=He),Ur=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ur=void 0}if(!Ye&&Jt[0]==="enter"&&Jt[1].type==="listItemPrefix"||Ye===-1&&Jt[0]==="exit"&&(Jt[1].type==="listUnordered"||Jt[1].type==="listOrdered")){if(at){let Nr=He;for(ur=void 0;Nr--;){const Vt=fe[Nr];if(Vt[1].type==="lineEnding"||Vt[1].type==="lineEndingBlank"){if(Vt[0]==="exit")continue;ur&&(fe[ur][1].type="lineEndingBlank",Et=!0),Vt[1].type="lineEnding",ur=Nr}else if(!(Vt[1].type==="linePrefix"||Vt[1].type==="blockQuotePrefix"||Vt[1].type==="blockQuotePrefixWhitespace"||Vt[1].type==="blockQuoteMarker"||Vt[1].type==="listItemIndent"))break}Ir&&(!ur||Ir<ur)&&(at._spread=!0),at.end=Object.assign({},ur?fe[ur][1].start:Jt[1].end),fe.splice(ur||He,0,["exit",at,Jt[2]]),He++,Te++}if(Jt[1].type==="listItemPrefix"){const Nr={type:"listItem",_spread:!1,start:Object.assign({},Jt[1].start),end:void 0};at=Nr,fe.splice(He,0,["enter",Nr,Jt[2]]),He++,Te++,Ir=void 0,Ur=!0}}}return fe[Se][1]._spread=Et,Te}function c(fe,Se){return Te;function Te(He){l.call(this,fe(He),He),Se&&Se.call(this,He)}}function d(){this.stack.push({type:"fragment",children:[]})}function l(fe,Se,Te){this.stack[this.stack.length-1].children.push(fe),this.stack.push(fe),this.tokenStack.push([Se,Te||void 0]),fe.position={start:Wi(Se.start),end:void 0}}function u(fe){return Se;function Se(Te){fe&&fe.call(this,Te),f.call(this,Te)}}function f(fe,Se){const Te=this.stack.pop(),He=this.tokenStack.pop();if(He)He[0].type!==fe.type&&(Se?Se.call(this,fe,He[0]):(He[1]||n_).call(this,fe,He[0]));else throw new Error("Cannot close `"+fe.type+"` ("+ac({start:fe.start,end:fe.end})+"): it’s not open");Te.position.end=Wi(fe.end)}function m(){return B7(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function g(fe){if(this.data.expectingFirstListItemValue){const Se=this.stack[this.stack.length-2];Se.start=Number.parseInt(this.sliceSerialize(fe),10),this.data.expectingFirstListItemValue=void 0}}function w(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.lang=fe}function j(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.meta=fe}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=fe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=fe.replace(/(\r?\n|\r)$/g,"")}function x(fe){const Se=this.resume(),Te=this.stack[this.stack.length-1];Te.label=Se,Te.identifier=Wa(this.sliceSerialize(fe)).toLowerCase()}function b(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.title=fe}function k(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.url=fe}function N(fe){const Se=this.stack[this.stack.length-1];if(!Se.depth){const Te=this.sliceSerialize(fe).length;Se.depth=Te}}function P(){this.data.setextHeadingSlurpLineEnding=!0}function A(fe){const Se=this.stack[this.stack.length-1];Se.depth=this.sliceSerialize(fe).codePointAt(0)===61?1:2}function E(){this.data.setextHeadingSlurpLineEnding=void 0}function M(fe){const Te=this.stack[this.stack.length-1].children;let He=Te[Te.length-1];(!He||He.type!=="text")&&(He=be(),He.position={start:Wi(fe.start),end:void 0},Te.push(He)),this.stack.push(He)}function D(fe){const Se=this.stack.pop();Se.value+=this.sliceSerialize(fe),Se.position.end=Wi(fe.end)}function O(fe){const Se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Te=Se.children[Se.children.length-1];Te.position.end=Wi(fe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(Se.type)&&(M.call(this,fe),D.call(this,fe))}function z(){this.data.atHardBreak=!0}function U(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=fe}function X(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=fe}function W(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=fe}function $(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=Se,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function Y(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=Se,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function K(fe){const Se=this.sliceSerialize(fe),Te=this.stack[this.stack.length-2];Te.label=F9(Se),Te.identifier=Wa(Se).toLowerCase()}function L(){const fe=this.stack[this.stack.length-1],Se=this.resume(),Te=this.stack[this.stack.length-1];if(this.data.inReference=!0,Te.type==="link"){const He=fe.children;Te.children=He}else Te.alt=Se}function T(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.url=fe}function B(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.title=fe}function G(){this.data.inReference=void 0}function F(){this.data.referenceType="collapsed"}function re(fe){const Se=this.resume(),Te=this.stack[this.stack.length-1];Te.label=Se,Te.identifier=Wa(this.sliceSerialize(fe)).toLowerCase(),this.data.referenceType="full"}function de(fe){this.data.characterReferenceType=fe.type}function ue(fe){const Se=this.sliceSerialize(fe),Te=this.data.characterReferenceType;let He;Te?(He=qN(Se,Te==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):He=Hx(Se);const Ye=this.stack[this.stack.length-1];Ye.value+=He}function J(fe){const Se=this.stack.pop();Se.position.end=Wi(fe.end)}function H(fe){D.call(this,fe);const Se=this.stack[this.stack.length-1];Se.url=this.sliceSerialize(fe)}function oe(fe){D.call(this,fe);const Se=this.stack[this.stack.length-1];Se.url="mailto:"+this.sliceSerialize(fe)}function ie(){return{type:"blockquote",children:[]}}function Z(){return{type:"code",lang:null,meta:null,value:""}}function le(){return{type:"inlineCode",value:""}}function ee(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function _e(){return{type:"emphasis",children:[]}}function Fe(){return{type:"heading",depth:0,children:[]}}function he(){return{type:"break"}}function we(){return{type:"html",value:""}}function Oe(){return{type:"image",title:null,url:"",alt:null}}function $e(){return{type:"link",title:null,url:"",children:[]}}function Ke(fe){return{type:"list",ordered:fe.type==="listOrdered",start:null,spread:fe._spread,children:[]}}function xt(fe){return{type:"listItem",spread:fe._spread,checked:null,children:[]}}function Ce(){return{type:"paragraph",children:[]}}function pe(){return{type:"strong",children:[]}}function be(){return{type:"text",value:""}}function De(){return{type:"thematicBreak"}}}function Wi(e){return{line:e.line,column:e.column,offset:e.offset}}function n2(e,r){let s=-1;for(;++s<r.length;){const n=r[s];Array.isArray(n)?n2(e,n):H9(e,n)}}function H9(e,r){let s;for(s in r)if(s2.call(r,s))switch(s){case"canContainEols":{const n=r[s];n&&e[s].push(...n);break}case"transforms":{const n=r[s];n&&e[s].push(...n);break}case"enter":case"exit":{const n=r[s];n&&Object.assign(e[s],n);break}}}function n_(e,r){throw e?new Error("Cannot close `"+e.type+"` ("+ac({start:e.start,end:e.end})+"): a different token (`"+r.type+"`, "+ac({start:r.start,end:r.end})+") is open"):new Error("Cannot close document, a token (`"+r.type+"`, "+ac({start:r.start,end:r.end})+") is still open")}function W9(e){const r=this;r.parser=s;function s(n){return $9(n,{...r.data("settings"),...e,extensions:r.data("micromarkExtensions")||[],mdastExtensions:r.data("fromMarkdownExtensions")||[]})}}function U9(e,r){const s={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(r),!0)};return e.patch(r,s),e.applyData(r,s)}function V9(e,r){const s={type:"element",tagName:"br",properties:{},children:[]};return e.patch(r,s),[e.applyData(r,s),{type:"text",value:`
|
|
634
|
+
`}]}function G9(e,r){const s=r.value?r.value+`
|
|
635
|
+
`:"",n={},o=r.lang?r.lang.split(/\s+/):[];o.length>0&&(n.className=["language-"+o[0]]);let c={type:"element",tagName:"code",properties:n,children:[{type:"text",value:s}]};return r.meta&&(c.data={meta:r.meta}),e.patch(r,c),c=e.applyData(r,c),c={type:"element",tagName:"pre",properties:{},children:[c]},e.patch(r,c),c}function q9(e,r){const s={type:"element",tagName:"del",properties:{},children:e.all(r)};return e.patch(r,s),e.applyData(r,s)}function K9(e,r){const s={type:"element",tagName:"em",properties:{},children:e.all(r)};return e.patch(r,s),e.applyData(r,s)}function Y9(e,r){const s=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=String(r.identifier).toUpperCase(),o=dl(n.toLowerCase()),c=e.footnoteOrder.indexOf(n);let d,l=e.footnoteCounts.get(n);l===void 0?(l=0,e.footnoteOrder.push(n),d=e.footnoteOrder.length):d=c+1,l+=1,e.footnoteCounts.set(n,l);const u={type:"element",tagName:"a",properties:{href:"#"+s+"fn-"+o,id:s+"fnref-"+o+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(r,u);const f={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(r,f),e.applyData(r,f)}function X9(e,r){const s={type:"element",tagName:"h"+r.depth,properties:{},children:e.all(r)};return e.patch(r,s),e.applyData(r,s)}function J9(e,r){if(e.options.allowDangerousHtml){const s={type:"raw",value:r.value};return e.patch(r,s),e.applyData(r,s)}}function i2(e,r){const s=r.referenceType;let n="]";if(s==="collapsed"?n+="[]":s==="full"&&(n+="["+(r.label||r.identifier)+"]"),r.type==="imageReference")return[{type:"text",value:"!["+r.alt+n}];const o=e.all(r),c=o[0];c&&c.type==="text"?c.value="["+c.value:o.unshift({type:"text",value:"["});const d=o[o.length-1];return d&&d.type==="text"?d.value+=n:o.push({type:"text",value:n}),o}function Q9(e,r){const s=String(r.identifier).toUpperCase(),n=e.definitionById.get(s);if(!n)return i2(e,r);const o={src:dl(n.url||""),alt:r.alt};n.title!==null&&n.title!==void 0&&(o.title=n.title);const c={type:"element",tagName:"img",properties:o,children:[]};return e.patch(r,c),e.applyData(r,c)}function Z9(e,r){const s={src:dl(r.url)};r.alt!==null&&r.alt!==void 0&&(s.alt=r.alt),r.title!==null&&r.title!==void 0&&(s.title=r.title);const n={type:"element",tagName:"img",properties:s,children:[]};return e.patch(r,n),e.applyData(r,n)}function ez(e,r){const s={type:"text",value:r.value.replace(/\r?\n|\r/g," ")};e.patch(r,s);const n={type:"element",tagName:"code",properties:{},children:[s]};return e.patch(r,n),e.applyData(r,n)}function tz(e,r){const s=String(r.identifier).toUpperCase(),n=e.definitionById.get(s);if(!n)return i2(e,r);const o={href:dl(n.url||"")};n.title!==null&&n.title!==void 0&&(o.title=n.title);const c={type:"element",tagName:"a",properties:o,children:e.all(r)};return e.patch(r,c),e.applyData(r,c)}function rz(e,r){const s={href:dl(r.url)};r.title!==null&&r.title!==void 0&&(s.title=r.title);const n={type:"element",tagName:"a",properties:s,children:e.all(r)};return e.patch(r,n),e.applyData(r,n)}function sz(e,r,s){const n=e.all(r),o=s?nz(s):o2(r),c={},d=[];if(typeof r.checked=="boolean"){const m=n[0];let h;m&&m.type==="element"&&m.tagName==="p"?h=m:(h={type:"element",tagName:"p",properties:{},children:[]},n.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:r.checked,disabled:!0},children:[]}),c.className=["task-list-item"]}let l=-1;for(;++l<n.length;){const m=n[l];(o||l!==0||m.type!=="element"||m.tagName!=="p")&&d.push({type:"text",value:`
|
|
636
636
|
`}),m.type==="element"&&m.tagName==="p"&&!o?d.push(...m.children):d.push(m)}const u=n[n.length-1];u&&(o||u.type!=="element"||u.tagName!=="p")&&d.push({type:"text",value:`
|
|
637
|
-
`});const f={type:"element",tagName:"li",properties:c,children:d};return e.patch(r,f),e.applyData(r,f)}function nz(e){let r=!1;if(e.type==="list"){r=e.spread||!1;const s=e.children;let n=-1;for(;!r&&++n<s.length;)r=o2(s[n])}return r}function o2(e){const r=e.spread;return r??e.children.length>1}function iz(e,r){const s={},n=e.all(r);let o=-1;for(typeof r.start=="number"&&r.start!==1&&(s.start=r.start);++o<n.length;){const d=n[o];if(d.type==="element"&&d.tagName==="li"&&d.properties&&Array.isArray(d.properties.className)&&d.properties.className.includes("task-list-item")){s.className=["contains-task-list"];break}}const c={type:"element",tagName:r.ordered?"ol":"ul",properties:s,children:e.wrap(n,!0)};return e.patch(r,c),e.applyData(r,c)}function oz(e,r){const s={type:"element",tagName:"p",properties:{},children:e.all(r)};return e.patch(r,s),e.applyData(r,s)}function az(e,r){const s={type:"root",children:e.wrap(e.all(r))};return e.patch(r,s),e.applyData(r,s)}function lz(e,r){const s={type:"element",tagName:"strong",properties:{},children:e.all(r)};return e.patch(r,s),e.applyData(r,s)}function cz(e,r){const s=e.all(r),n=s.shift(),o=[];if(n){const d={type:"element",tagName:"thead",properties:{},children:e.wrap([n],!0)};e.patch(r.children[0],d),o.push(d)}if(s.length>0){const d={type:"element",tagName:"tbody",properties:{},children:e.wrap(s,!0)},l=Fx(r.children[1]),u=$N(r.children[r.children.length-1]);l&&u&&(d.position={start:l,end:u}),o.push(d)}const c={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(r,c),e.applyData(r,c)}function dz(e,r,s){const n=s?s.children:void 0,c=(n?n.indexOf(r):1)===0?"th":"td",d=s&&s.type==="table"?s.align:void 0,l=d?d.length:r.children.length;let u=-1;const f=[];for(;++u<l;){const h=r.children[u],g={},w=d?d[u]:void 0;w&&(g.align=w);let j={type:"element",tagName:c,properties:g,children:[]};h&&(j.children=e.all(h),e.patch(h,j),j=e.applyData(h,j)),f.push(j)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(r,m),e.applyData(r,m)}function uz(e,r){const s={type:"element",tagName:"td",properties:{},children:e.all(r)};return e.patch(r,s),e.applyData(r,s)}const i_=9,o_=32;function hz(e){const r=String(e),s=/\r?\n|\r/g;let n=s.exec(r),o=0;const c=[];for(;n;)c.push(a_(r.slice(o,n.index),o>0,!0),n[0]),o=n.index+n[0].length,n=s.exec(r);return c.push(a_(r.slice(o),o>0,!1)),c.join("")}function a_(e,r,s){let n=0,o=e.length;if(r){let c=e.codePointAt(n);for(;c===i_||c===o_;)n++,c=e.codePointAt(n)}if(s){let c=e.codePointAt(o-1);for(;c===i_||c===o_;)o--,c=e.codePointAt(o-1)}return o>n?e.slice(n,o):""}function fz(e,r){const s={type:"text",value:hz(String(r.value))};return e.patch(r,s),e.applyData(r,s)}function mz(e,r){const s={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(r,s),e.applyData(r,s)}const pz={blockquote:
|
|
637
|
+
`});const f={type:"element",tagName:"li",properties:c,children:d};return e.patch(r,f),e.applyData(r,f)}function nz(e){let r=!1;if(e.type==="list"){r=e.spread||!1;const s=e.children;let n=-1;for(;!r&&++n<s.length;)r=o2(s[n])}return r}function o2(e){const r=e.spread;return r??e.children.length>1}function iz(e,r){const s={},n=e.all(r);let o=-1;for(typeof r.start=="number"&&r.start!==1&&(s.start=r.start);++o<n.length;){const d=n[o];if(d.type==="element"&&d.tagName==="li"&&d.properties&&Array.isArray(d.properties.className)&&d.properties.className.includes("task-list-item")){s.className=["contains-task-list"];break}}const c={type:"element",tagName:r.ordered?"ol":"ul",properties:s,children:e.wrap(n,!0)};return e.patch(r,c),e.applyData(r,c)}function oz(e,r){const s={type:"element",tagName:"p",properties:{},children:e.all(r)};return e.patch(r,s),e.applyData(r,s)}function az(e,r){const s={type:"root",children:e.wrap(e.all(r))};return e.patch(r,s),e.applyData(r,s)}function lz(e,r){const s={type:"element",tagName:"strong",properties:{},children:e.all(r)};return e.patch(r,s),e.applyData(r,s)}function cz(e,r){const s=e.all(r),n=s.shift(),o=[];if(n){const d={type:"element",tagName:"thead",properties:{},children:e.wrap([n],!0)};e.patch(r.children[0],d),o.push(d)}if(s.length>0){const d={type:"element",tagName:"tbody",properties:{},children:e.wrap(s,!0)},l=Fx(r.children[1]),u=$N(r.children[r.children.length-1]);l&&u&&(d.position={start:l,end:u}),o.push(d)}const c={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(r,c),e.applyData(r,c)}function dz(e,r,s){const n=s?s.children:void 0,c=(n?n.indexOf(r):1)===0?"th":"td",d=s&&s.type==="table"?s.align:void 0,l=d?d.length:r.children.length;let u=-1;const f=[];for(;++u<l;){const h=r.children[u],g={},w=d?d[u]:void 0;w&&(g.align=w);let j={type:"element",tagName:c,properties:g,children:[]};h&&(j.children=e.all(h),e.patch(h,j),j=e.applyData(h,j)),f.push(j)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(r,m),e.applyData(r,m)}function uz(e,r){const s={type:"element",tagName:"td",properties:{},children:e.all(r)};return e.patch(r,s),e.applyData(r,s)}const i_=9,o_=32;function hz(e){const r=String(e),s=/\r?\n|\r/g;let n=s.exec(r),o=0;const c=[];for(;n;)c.push(a_(r.slice(o,n.index),o>0,!0),n[0]),o=n.index+n[0].length,n=s.exec(r);return c.push(a_(r.slice(o),o>0,!1)),c.join("")}function a_(e,r,s){let n=0,o=e.length;if(r){let c=e.codePointAt(n);for(;c===i_||c===o_;)n++,c=e.codePointAt(n)}if(s){let c=e.codePointAt(o-1);for(;c===i_||c===o_;)o--,c=e.codePointAt(o-1)}return o>n?e.slice(n,o):""}function fz(e,r){const s={type:"text",value:hz(String(r.value))};return e.patch(r,s),e.applyData(r,s)}function mz(e,r){const s={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(r,s),e.applyData(r,s)}const pz={blockquote:U9,break:V9,code:G9,delete:q9,emphasis:K9,footnoteReference:Y9,heading:X9,html:J9,imageReference:Q9,image:Z9,inlineCode:ez,linkReference:tz,link:rz,listItem:sz,list:iz,paragraph:oz,root:az,strong:lz,table:cz,tableCell:uz,tableRow:dz,text:fz,thematicBreak:mz,toml:lu,yaml:lu,definition:lu,footnoteDefinition:lu};function lu(){}const a2=-1,Ph=0,cc=1,Wu=2,Vx=3,Gx=4,qx=5,Kx=6,l2=7,c2=8,l_=typeof self=="object"?self:globalThis,gz=(e,r)=>{const s=(o,c)=>(e.set(c,o),o),n=o=>{if(e.has(o))return e.get(o);const[c,d]=r[o];switch(c){case Ph:case a2:return s(d,o);case cc:{const l=s([],o);for(const u of d)l.push(n(u));return l}case Wu:{const l=s({},o);for(const[u,f]of d)l[n(u)]=n(f);return l}case Vx:return s(new Date(d),o);case Gx:{const{source:l,flags:u}=d;return s(new RegExp(l,u),o)}case qx:{const l=s(new Map,o);for(const[u,f]of d)l.set(n(u),n(f));return l}case Kx:{const l=s(new Set,o);for(const u of d)l.add(n(u));return l}case l2:{const{name:l,message:u}=d;return s(new l_[l](u),o)}case c2:return s(BigInt(d),o);case"BigInt":return s(Object(BigInt(d)),o);case"ArrayBuffer":return s(new Uint8Array(d).buffer,d);case"DataView":{const{buffer:l}=new Uint8Array(d);return s(new DataView(l),d)}}return s(new l_[c](d),o)};return n},c_=e=>gz(new Map,e)(0),Pa="",{toString:xz}={},{keys:vz}=Object,Xl=e=>{const r=typeof e;if(r!=="object"||!e)return[Ph,r];const s=xz.call(e).slice(8,-1);switch(s){case"Array":return[cc,Pa];case"Object":return[Wu,Pa];case"Date":return[Vx,Pa];case"RegExp":return[Gx,Pa];case"Map":return[qx,Pa];case"Set":return[Kx,Pa];case"DataView":return[cc,s]}return s.includes("Array")?[cc,s]:s.includes("Error")?[l2,s]:[Wu,s]},cu=([e,r])=>e===Ph&&(r==="function"||r==="symbol"),yz=(e,r,s,n)=>{const o=(d,l)=>{const u=n.push(d)-1;return s.set(l,u),u},c=d=>{if(s.has(d))return s.get(d);let[l,u]=Xl(d);switch(l){case Ph:{let m=d;switch(u){case"bigint":l=c2,m=d.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);m=null;break;case"undefined":return o([a2],d)}return o([l,m],d)}case cc:{if(u){let g=d;return u==="DataView"?g=new Uint8Array(d.buffer):u==="ArrayBuffer"&&(g=new Uint8Array(d)),o([u,[...g]],d)}const m=[],h=o([l,m],d);for(const g of d)m.push(c(g));return h}case Wu:{if(u)switch(u){case"BigInt":return o([u,d.toString()],d);case"Boolean":case"Number":case"String":return o([u,d.valueOf()],d)}if(r&&"toJSON"in d)return c(d.toJSON());const m=[],h=o([l,m],d);for(const g of vz(d))(e||!cu(Xl(d[g])))&&m.push([c(g),c(d[g])]);return h}case Vx:return o([l,d.toISOString()],d);case Gx:{const{source:m,flags:h}=d;return o([l,{source:m,flags:h}],d)}case qx:{const m=[],h=o([l,m],d);for(const[g,w]of d)(e||!(cu(Xl(g))||cu(Xl(w))))&&m.push([c(g),c(w)]);return h}case Kx:{const m=[],h=o([l,m],d);for(const g of d)(e||!cu(Xl(g)))&&m.push(c(g));return h}}const{message:f}=d;return o([l,{name:u,message:f}],d)};return c},d_=(e,{json:r,lossy:s}={})=>{const n=[];return yz(!(r||s),!!r,new Map,n)(e),n},Uu=typeof structuredClone=="function"?(e,r)=>r&&("json"in r||"lossy"in r)?c_(d_(e,r)):structuredClone(e):(e,r)=>c_(d_(e,r));function bz(e,r){const s=[{type:"text",value:"↩"}];return r>1&&s.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(r)}]}),s}function wz(e,r){return"Back to reference "+(e+1)+(r>1?"-"+r:"")}function _z(e){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=e.options.footnoteBackContent||bz,n=e.options.footnoteBackLabel||wz,o=e.options.footnoteLabel||"Footnotes",c=e.options.footnoteLabelTagName||"h2",d=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let u=-1;for(;++u<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[u]);if(!f)continue;const m=e.all(f),h=String(f.identifier).toUpperCase(),g=dl(h.toLowerCase());let w=0;const j=[],S=e.footnoteCounts.get(h);for(;S!==void 0&&++w<=S;){j.length>0&&j.push({type:"text",value:" "});let x=typeof s=="string"?s:s(u,w);typeof x=="string"&&(x={type:"text",value:x}),j.push({type:"element",tagName:"a",properties:{href:"#"+r+"fnref-"+g+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof n=="string"?n:n(u,w),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const v=m[m.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const x=v.children[v.children.length-1];x&&x.type==="text"?x.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...j)}else m.push(...j);const y={type:"element",tagName:"li",properties:{id:r+"fn-"+g},children:e.wrap(m,!0)};e.patch(f,y),l.push(y)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{...Uu(d),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
638
638
|
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
|
|
639
639
|
`}]}}const d2=(function(e){if(e==null)return jz;if(typeof e=="function")return Ah(e);if(typeof e=="object")return Array.isArray(e)?Sz(e):Cz(e);if(typeof e=="string")return kz(e);throw new Error("Expected function, string, or object as test")});function Sz(e){const r=[];let s=-1;for(;++s<e.length;)r[s]=d2(e[s]);return Ah(n);function n(...o){let c=-1;for(;++c<r.length;)if(r[c].apply(this,o))return!0;return!1}}function Cz(e){const r=e;return Ah(s);function s(n){const o=n;let c;for(c in e)if(o[c]!==r[c])return!1;return!0}}function kz(e){return Ah(r);function r(s){return s&&s.type===e}}function Ah(e){return r;function r(s,n,o){return!!(Nz(s)&&e.call(this,s,typeof n=="number"?n:void 0,o||void 0))}}function jz(){return!0}function Nz(e){return e!==null&&typeof e=="object"&&"type"in e}const u2=[],Ez=!0,u_=!1,Pz="skip";function Az(e,r,s,n){let o;typeof r=="function"&&typeof s!="function"?(n=s,s=r):o=r;const c=d2(o),d=n?-1:1;l(e,void 0,[])();function l(u,f,m){const h=u&&typeof u=="object"?u:{};if(typeof h.type=="string"){const w=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(u.type+(w?"<"+w+">":""))+")"})}return g;function g(){let w=u2,j,S,v;if((!r||c(u,f,m[m.length-1]||void 0))&&(w=Tz(s(u,m)),w[0]===u_))return w;if("children"in u&&u.children){const y=u;if(y.children&&w[0]!==Pz)for(S=(n?y.children.length:-1)+d,v=m.concat(y);S>-1&&S<y.children.length;){const x=y.children[S];if(j=l(x,S,v)(),j[0]===u_)return j;S=typeof j[1]=="number"?j[1]:S+d}}return w}}}function Tz(e){return Array.isArray(e)?e:typeof e=="number"?[Ez,e]:e==null?u2:[e]}function h2(e,r,s,n){let o,c,d;typeof r=="function"&&typeof s!="function"?(c=void 0,d=r,o=s):(c=r,d=s,o=n),Az(e,c,l,o);function l(u,f){const m=f[f.length-1],h=m?m.children.indexOf(u):void 0;return d(u,h,m)}}const Kp={}.hasOwnProperty,Rz={};function Mz(e,r){const s=r||Rz,n=new Map,o=new Map,c=new Map,d={...pz,...s.handlers},l={all:f,applyData:Dz,definitionById:n,footnoteById:o,footnoteCounts:c,footnoteOrder:[],handlers:d,one:u,options:s,patch:Iz,wrap:Oz};return h2(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const h=m.type==="definition"?n:o,g=String(m.identifier).toUpperCase();h.has(g)||h.set(g,m)}}),l;function u(m,h){const g=m.type,w=l.handlers[g];if(Kp.call(l.handlers,g)&&w)return w(l,m,h);if(l.options.passThrough&&l.options.passThrough.includes(g)){if("children"in m){const{children:S,...v}=m,y=Uu(v);return y.children=l.all(m),y}return Uu(m)}return(l.options.unknownHandler||Lz)(l,m,h)}function f(m){const h=[];if("children"in m){const g=m.children;let w=-1;for(;++w<g.length;){const j=l.one(g[w],m);if(j){if(w&&g[w-1].type==="break"&&(!Array.isArray(j)&&j.type==="text"&&(j.value=h_(j.value)),!Array.isArray(j)&&j.type==="element")){const S=j.children[0];S&&S.type==="text"&&(S.value=h_(S.value))}Array.isArray(j)?h.push(...j):h.push(j)}}}return h}}function Iz(e,r){e.position&&(r.position=x7(e))}function Dz(e,r){let s=r;if(e&&e.data){const n=e.data.hName,o=e.data.hChildren,c=e.data.hProperties;if(typeof n=="string")if(s.type==="element")s.tagName=n;else{const d="children"in s?s.children:[s];s={type:"element",tagName:n,properties:{},children:d}}s.type==="element"&&c&&Object.assign(s.properties,Uu(c)),"children"in s&&s.children&&o!==null&&o!==void 0&&(s.children=o)}return s}function Lz(e,r){const s=r.data||{},n="value"in r&&!(Kp.call(s,"hProperties")||Kp.call(s,"hChildren"))?{type:"text",value:r.value}:{type:"element",tagName:"div",properties:{},children:e.all(r)};return e.patch(r,n),e.applyData(r,n)}function Oz(e,r){const s=[];let n=-1;for(r&&s.push({type:"text",value:`
|
|
640
640
|
`});++n<e.length;)n&&s.push({type:"text",value:`
|
|
641
641
|
`}),s.push(e[n]);return r&&e.length>0&&s.push({type:"text",value:`
|
|
642
642
|
`}),s}function h_(e){let r=0,s=e.charCodeAt(r);for(;s===9||s===32;)r++,s=e.charCodeAt(r);return e.slice(r)}function f_(e,r){const s=Mz(e,r),n=s.one(e,void 0),o=_z(s),c=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return o&&c.children.push({type:"text",value:`
|
|
643
|
-
`},o),c}function Fz(e,r){return e&&"run"in e?async function(s,n){const o=f_(s,{file:n,...r});await e.run(o,n)}:function(s,n){return f_(s,{file:n,...e||r})}}function m_(e){if(e)throw e}var Km,p_;function Bz(){if(p_)return Km;p_=1;var e=Object.prototype.hasOwnProperty,r=Object.prototype.toString,s=Object.defineProperty,n=Object.getOwnPropertyDescriptor,o=function(f){return typeof Array.isArray=="function"?Array.isArray(f):r.call(f)==="[object Array]"},c=function(f){if(!f||r.call(f)!=="[object Object]")return!1;var m=e.call(f,"constructor"),h=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!m&&!h)return!1;var g;for(g in f);return typeof g>"u"||e.call(f,g)},d=function(f,m){s&&m.name==="__proto__"?s(f,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):f[m.name]=m.newValue},l=function(f,m){if(m==="__proto__")if(e.call(f,m)){if(n)return n(f,m).value}else return;return f[m]};return Km=function u(){var f,m,h,g,w,j,S=arguments[0],v=1,y=arguments.length,x=!1;for(typeof S=="boolean"&&(x=S,S=arguments[1]||{},v=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});v<y;++v)if(f=arguments[v],f!=null)for(m in f)h=l(S,m),g=l(f,m),S!==g&&(x&&g&&(c(g)||(w=o(g)))?(w?(w=!1,j=h&&o(h)?h:[]):j=h&&c(h)?h:{},d(S,{name:m,newValue:u(x,j,g)})):typeof g<"u"&&d(S,{name:m,newValue:g}));return S},Km}var $z=Bz();const Ym=Cc($z);function Yp(e){if(typeof e!="object"||e===null)return!1;const r=Object.getPrototypeOf(e);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function zz(){const e=[],r={run:s,use:n};return r;function s(...o){let c=-1;const d=o.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);l(null,...o);function l(u,...f){const m=e[++c];let h=-1;if(u){d(u);return}for(;++h<o.length;)(f[h]===null||f[h]===void 0)&&(f[h]=o[h]);o=f,m?Hz(m,l)(...f):d(null,...f)}}function n(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),r}}function Hz(e,r){let s;return n;function n(...d){const l=e.length>d.length;let u;l&&d.push(o);try{u=e.apply(this,d)}catch(f){const m=f;if(l&&s)throw m;return o(m)}l||(u&&u.then&&typeof u.then=="function"?u.then(c,o):u instanceof Error?o(u):c(u))}function o(d,...l){s||(s=!0,r(d,...l))}function c(d){o(null,d)}}const Bn={basename:Wz,dirname:Uz,extname:Vz,join:Gz,sep:"/"};function Wz(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');Gc(e);let s=0,n=-1,o=e.length,c;if(r===void 0||r.length===0||r.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(c){s=o+1;break}}else n<0&&(c=!0,n=o+1);return n<0?"":e.slice(s,n)}if(r===e)return"";let d=-1,l=r.length-1;for(;o--;)if(e.codePointAt(o)===47){if(c){s=o+1;break}}else d<0&&(c=!0,d=o+1),l>-1&&(e.codePointAt(o)===r.codePointAt(l--)?l<0&&(n=o):(l=-1,n=d));return s===n?n=d:n<0&&(n=e.length),e.slice(s,n)}function Uz(e){if(Gc(e),e.length===0)return".";let r=-1,s=e.length,n;for(;--s;)if(e.codePointAt(s)===47){if(n){r=s;break}}else n||(n=!0);return r<0?e.codePointAt(0)===47?"/":".":r===1&&e.codePointAt(0)===47?"//":e.slice(0,r)}function Vz(e){Gc(e);let r=e.length,s=-1,n=0,o=-1,c=0,d;for(;r--;){const l=e.codePointAt(r);if(l===47){if(d){n=r+1;break}continue}s<0&&(d=!0,s=r+1),l===46?o<0?o=r:c!==1&&(c=1):o>-1&&(c=-1)}return o<0||s<0||c===0||c===1&&o===s-1&&o===n+1?"":e.slice(o,s)}function Gz(...e){let r=-1,s;for(;++r<e.length;)Gc(e[r]),e[r]&&(s=s===void 0?e[r]:s+"/"+e[r]);return s===void 0?".":qz(s)}function qz(e){Gc(e);const r=e.codePointAt(0)===47;let s=Kz(e,!r);return s.length===0&&!r&&(s="."),s.length>0&&e.codePointAt(e.length-1)===47&&(s+="/"),r?"/"+s:s}function Kz(e,r){let s="",n=0,o=-1,c=0,d=-1,l,u;for(;++d<=e.length;){if(d<e.length)l=e.codePointAt(d);else{if(l===47)break;l=47}if(l===47){if(!(o===d-1||c===1))if(o!==d-1&&c===2){if(s.length<2||n!==2||s.codePointAt(s.length-1)!==46||s.codePointAt(s.length-2)!==46){if(s.length>2){if(u=s.lastIndexOf("/"),u!==s.length-1){u<0?(s="",n=0):(s=s.slice(0,u),n=s.length-1-s.lastIndexOf("/")),o=d,c=0;continue}}else if(s.length>0){s="",n=0,o=d,c=0;continue}}r&&(s=s.length>0?s+"/..":"..",n=2)}else s.length>0?s+="/"+e.slice(o+1,d):s=e.slice(o+1,d),n=d-o-1;o=d,c=0}else l===46&&c>-1?c++:c=-1}return s}function Gc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Yz={cwd:Xz};function Xz(){return"/"}function Xp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Jz(e){if(typeof e=="string")e=new URL(e);else if(!Xp(e)){const r=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw r.code="ERR_INVALID_ARG_TYPE",r}if(e.protocol!=="file:"){const r=new TypeError("The URL must be of scheme file");throw r.code="ERR_INVALID_URL_SCHEME",r}return Qz(e)}function Qz(e){if(e.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const r=e.pathname;let s=-1;for(;++s<r.length;)if(r.codePointAt(s)===37&&r.codePointAt(s+1)===50){const n=r.codePointAt(s+2);if(n===70||n===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(r)}const Xm=["history","path","basename","stem","extname","dirname"];class f2{constructor(r){let s;r?Xp(r)?s={path:r}:typeof r=="string"||Zz(r)?s={value:r}:s=r:s={},this.cwd="cwd"in s?"":Yz.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Xm.length;){const c=Xm[n];c in s&&s[c]!==void 0&&s[c]!==null&&(this[c]=c==="history"?[...s[c]]:s[c])}let o;for(o in s)Xm.includes(o)||(this[o]=s[o])}get basename(){return typeof this.path=="string"?Bn.basename(this.path):void 0}set basename(r){Qm(r,"basename"),Jm(r,"basename"),this.path=Bn.join(this.dirname||"",r)}get dirname(){return typeof this.path=="string"?Bn.dirname(this.path):void 0}set dirname(r){g_(this.basename,"dirname"),this.path=Bn.join(r||"",this.basename)}get extname(){return typeof this.path=="string"?Bn.extname(this.path):void 0}set extname(r){if(Jm(r,"extname"),g_(this.dirname,"extname"),r){if(r.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(r.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Bn.join(this.dirname,this.stem+(r||""))}get path(){return this.history[this.history.length-1]}set path(r){Xp(r)&&(r=Jz(r)),Qm(r,"path"),this.path!==r&&this.history.push(r)}get stem(){return typeof this.path=="string"?Bn.basename(this.path,this.extname):void 0}set stem(r){Qm(r,"stem"),Jm(r,"stem"),this.path=Bn.join(this.dirname||"",r+(this.extname||""))}fail(r,s,n){const o=this.message(r,s,n);throw o.fatal=!0,o}info(r,s,n){const o=this.message(r,s,n);return o.fatal=void 0,o}message(r,s,n){const o=new ds(r,s,n);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(r){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(r||void 0).decode(this.value)}}function Jm(e,r){if(e&&e.includes(Bn.sep))throw new Error("`"+r+"` cannot be a path: did not expect `"+Bn.sep+"`")}function Qm(e,r){if(!e)throw new Error("`"+r+"` cannot be empty")}function g_(e,r){if(!e)throw new Error("Setting `"+r+"` requires `path` to be set too")}function Zz(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const eH=(function(e){const n=this.constructor.prototype,o=n[e],c=function(){return o.apply(c,arguments)};return Object.setPrototypeOf(c,n),c}),tH={}.hasOwnProperty;class Yx extends eH{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=zz()}copy(){const r=new Yx;let s=-1;for(;++s<this.attachers.length;){const n=this.attachers[s];r.use(...n)}return r.data(Ym(!0,{},this.namespace)),r}data(r,s){return typeof r=="string"?arguments.length===2?(tp("data",this.frozen),this.namespace[r]=s,this):tH.call(this.namespace,r)&&this.namespace[r]||void 0:r?(tp("data",this.frozen),this.namespace=r,this):this.namespace}freeze(){if(this.frozen)return this;const r=this;for(;++this.freezeIndex<this.attachers.length;){const[s,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);const o=s.call(r,...n);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(r){this.freeze();const s=du(r),n=this.parser||this.Parser;return Zm("parse",n),n(String(s),s)}process(r,s){const n=this;return this.freeze(),Zm("process",this.parser||this.Parser),ep("process",this.compiler||this.Compiler),s?o(void 0,s):new Promise(o);function o(c,d){const l=du(r),u=n.parse(l);n.run(u,l,function(m,h,g){if(m||!h||!g)return f(m);const w=h,j=n.stringify(w,g);nH(j)?g.value=j:g.result=j,f(m,g)});function f(m,h){m||!h?d(m):c?c(h):s(void 0,h)}}}processSync(r){let s=!1,n;return this.freeze(),Zm("processSync",this.parser||this.Parser),ep("processSync",this.compiler||this.Compiler),this.process(r,o),v_("processSync","process",s),n;function o(c,d){s=!0,m_(c),n=d}}run(r,s,n){x_(r),this.freeze();const o=this.transformers;return!n&&typeof s=="function"&&(n=s,s=void 0),n?c(void 0,n):new Promise(c);function c(d,l){const u=du(s);o.run(r,u,f);function f(m,h,g){const w=h||r;m?l(m):d?d(w):n(void 0,w,g)}}}runSync(r,s){let n=!1,o;return this.run(r,s,c),v_("runSync","run",n),o;function c(d,l){m_(d),o=l,n=!0}}stringify(r,s){this.freeze();const n=du(s),o=this.compiler||this.Compiler;return ep("stringify",o),x_(r),o(r,n)}use(r,...s){const n=this.attachers,o=this.namespace;if(tp("use",this.frozen),r!=null)if(typeof r=="function")u(r,s);else if(typeof r=="object")Array.isArray(r)?l(r):d(r);else throw new TypeError("Expected usable value, not `"+r+"`");return this;function c(f){if(typeof f=="function")u(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[m,...h]=f;u(m,h)}else d(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function d(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(f.plugins),f.settings&&(o.settings=Ym(!0,o.settings,f.settings))}function l(f){let m=-1;if(f!=null)if(Array.isArray(f))for(;++m<f.length;){const h=f[m];c(h)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function u(f,m){let h=-1,g=-1;for(;++h<n.length;)if(n[h][0]===f){g=h;break}if(g===-1)n.push([f,...m]);else if(m.length>0){let[w,...j]=m;const S=n[g][1];Yp(S)&&Yp(w)&&(w=Ym(!0,S,w)),n[g]=[f,w,...j]}}}}const rH=new Yx().freeze();function Zm(e,r){if(typeof r!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ep(e,r){if(typeof r!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function tp(e,r){if(r)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function x_(e){if(!Yp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function v_(e,r,s){if(!s)throw new Error("`"+e+"` finished async. Use `"+r+"` instead")}function du(e){return sH(e)?e:new f2(e)}function sH(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function nH(e){return typeof e=="string"||iH(e)}function iH(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const oH="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",y_=[],b_={allowDangerousHtml:!0},aH=/^(https?|ircs?|mailto|xmpp)$/i,lH=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function cH(e){const r=dH(e),s=uH(e);return hH(r.runSync(r.parse(s),s),e)}function dH(e){const r=e.rehypePlugins||y_,s=e.remarkPlugins||y_,n=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...b_}:b_;return rH().use(W$).use(s).use(Fz,n).use(r)}function uH(e){const r=e.children||"",s=new f2;return typeof r=="string"&&(s.value=r),s}function hH(e,r){const s=r.allowedElements,n=r.allowElement,o=r.components,c=r.disallowedElements,d=r.skipHtml,l=r.unwrapDisallowed,u=r.urlTransform||fH;for(const m of lH)Object.hasOwn(r,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+oH+m.id,void 0);return h2(e,f),_7(e,{Fragment:t.Fragment,components:o,ignoreInvalidStyle:!0,jsx:t.jsx,jsxs:t.jsxs,passKeys:!0,passNode:!0});function f(m,h,g){if(m.type==="raw"&&g&&typeof h=="number")return d?g.children.splice(h,1):g.children[h]={type:"text",value:m.value},h;if(m.type==="element"){let w;for(w in Vm)if(Object.hasOwn(Vm,w)&&Object.hasOwn(m.properties,w)){const j=m.properties[w],S=Vm[w];(S===null||S.includes(m.tagName))&&(m.properties[w]=u(String(j||""),w,m))}}if(m.type==="element"){let w=s?!s.includes(m.tagName):c?c.includes(m.tagName):!1;if(!w&&n&&typeof h=="number"&&(w=!n(m,h,g)),w&&g&&typeof h=="number")return l&&m.children?g.children.splice(h,1,...m.children):g.children.splice(h,1),h}}}function fH(e){const r=e.indexOf(":"),s=e.indexOf("?"),n=e.indexOf("#"),o=e.indexOf("/");return r===-1||o!==-1&&r>o||s!==-1&&r>s||n!==-1&&r>n||aH.test(e.slice(0,r))?e:""}function mH({onConfigChange:e}){var T,B,G;const[r,s]=_.useState(null),[n,o]=_.useState(""),[c,d]=_.useState({open:!1,field:null,type:"directory"}),[l,u]=_.useState(!0),[f,m]=_.useState(!1),[h,g]=_.useState(null),[w,j]=_.useState(!1),[S,v]=_.useState(null),[y,x]=_.useState([]),[b,k]=_.useState({open:!1,content:"",loading:!1}),[N,P]=_.useState({open:!1,feature:null}),[A,E]=_.useState({open:!1});_.useEffect(()=>{W(),M(),D()},[]);const M=async()=>{try{const F=await me.checkVersion();g(F)}catch(F){console.error("Failed to load version info:",F)}},D=async()=>{try{const F=await me.getProject();v(F.dir),O(F.dir)}catch(F){console.error("Failed to load project info:",F)}},O=async F=>{if(F)try{const re=await me.getHiddenSubprojects(F);x(re.hidden||[])}catch(re){console.error("Failed to load hidden sub-projects:",re)}},z=async F=>{if(S)try{const re=await me.unhideSubproject(S,F);re.success?(q.success("Sub-project unhidden"),O(S)):q.error(re.error||"Failed to unhide")}catch(re){q.error("Failed to unhide: "+re.message)}},U=async()=>{if(!(h!=null&&h.updateAvailable)){q.error("No update available");return}j(!0);try{const F=await me.performUpdate({updateMethod:h.updateMethod,sourcePath:h.sourcePath,channel:h.channel});if(F.success){q.success(`Updated to v${F.newVersion}! Restarting server...`);try{await me.restartServer()}catch{}let re=0;const de=setInterval(async()=>{re++;try{await me.checkVersion(),clearInterval(de),q.success("Server restarted! Reloading..."),setTimeout(()=>window.location.reload(),500)}catch{re>30&&(clearInterval(de),q.info("Server restarting. Please refresh the page."),j(!1))}},500)}else q.error("Update failed: "+F.error),j(!1)}catch(F){q.error("Update failed: "+F.message),j(!1)}},X=async()=>{k(F=>({...F,open:!0,loading:!0}));try{const F=await me.getChangelog();F.success?k(re=>({...re,content:F.content,loading:!1})):(q.error("Failed to load changelog"),k(re=>({...re,open:!1,loading:!1})))}catch(F){q.error("Failed to load changelog: "+F.message),k(re=>({...re,open:!1,loading:!1}))}},W=async()=>{try{u(!0);const F=await me.getConfig();s(F.config),o(F.path)}catch{q.error("Failed to load settings")}finally{u(!1)}},$=async()=>{m(!0);try{await me.saveConfig(r),q.success("Preferences saved!")}catch{q.error("Failed to save preferences")}finally{m(!1)}},Y=(F,re)=>{s(de=>({...de,[F]:re}))},K=(F,re,de)=>{s(ue=>({...ue,[F]:{...ue[F],[re]:de}}))},L=async F=>{const re=(r==null?void 0:r.enabledTools)||["claude"];let de;if(re.includes(F)){if(re.length<=1){q.error("At least one tool must be enabled");return}de=re.filter(J=>J!==F)}else de=[...re,F];const ue={...r,enabledTools:de};s(ue);try{await me.saveConfig(ue),e==null||e(ue);const J={claude:"Claude Code",gemini:"Gemini CLI",antigravity:"Antigravity",codex:"Codex CLI"}[F]||F;q.success(`${J} ${de.includes(F)?"enabled":"disabled"}`)}catch{s(r),q.error("Failed to save preference")}};return l?t.jsx("div",{className:"flex items-center justify-center h-64",children:t.jsx(Qe,{className:"w-8 h-8 animate-spin text-primary"})}):t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-10 h-10 rounded-lg bg-muted flex items-center justify-center",children:t.jsx(bC,{className:"w-5 h-5 text-muted-foreground"})}),t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"coder-config Preferences"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Tool settings for this configuration manager"})]})]}),t.jsxs("div",{className:"bg-card rounded-xl border border-border p-6 shadow-sm",children:[t.jsxs("div",{className:"flex items-center justify-between mb-6",children:[t.jsx("div",{children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["Stored in: ",t.jsx("code",{className:"bg-muted px-2 py-0.5 rounded",children:n})]})}),t.jsxs(se,{onClick:$,disabled:f,children:[f?t.jsx(Qe,{className:"w-4 h-4 mr-2 animate-spin"}):t.jsx(bs,{className:"w-4 h-4 mr-2"}),"Save"]})]}),t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"border-b border-border pb-6",children:[t.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[t.jsx(Yr,{className:"w-4 h-4"}),"Directories"]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium text-foreground",children:"MCP Tools Directories"}),t.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Folders containing local MCP tool repositories for discovery"}),t.jsxs("div",{className:"space-y-2",children:[((r==null?void 0:r.toolsDirs)||(r!=null&&r.toolsDir?[r.toolsDir]:[])).map((F,re)=>t.jsxs("div",{className:"flex gap-2",children:[t.jsx(Ze,{value:F||"",onChange:de=>{const ue=[...(r==null?void 0:r.toolsDirs)||(r!=null&&r.toolsDir?[r.toolsDir]:[])];ue[re]=de.target.value,Y("toolsDirs",ue),r!=null&&r.toolsDir&&s(J=>{const{toolsDir:H,...oe}=J;return{...oe,toolsDirs:ue}})},placeholder:"~/mcp-tools",className:"font-mono flex-1"}),t.jsx(se,{variant:"outline",size:"icon",onClick:()=>d({open:!0,field:"toolsDirs",type:"directory",index:re}),title:"Browse...",children:t.jsx(Xi,{className:"w-4 h-4"})}),t.jsx(se,{variant:"outline",size:"icon",onClick:()=>{const ue=((r==null?void 0:r.toolsDirs)||(r!=null&&r.toolsDir?[r.toolsDir]:[])).filter((J,H)=>H!==re);s(J=>{const{toolsDir:H,...oe}=J;return{...oe,toolsDirs:ue.length>0?ue:void 0}})},title:"Remove",className:"text-destructive hover:text-destructive",children:t.jsx(Un,{className:"w-4 h-4"})})]},re)),t.jsxs(se,{variant:"outline",size:"sm",onClick:()=>d({open:!0,field:"toolsDirs",type:"directory",index:-1}),className:"mt-2",children:[t.jsx(fi,{className:"w-4 h-4 mr-2"}),"Add Tools Folder"]})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium text-foreground",children:"Global Registry Path"}),t.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Path to the global MCP registry file"}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(Ze,{value:(r==null?void 0:r.registryPath)||"",onChange:F=>Y("registryPath",F.target.value),placeholder:"~/.claude/registry.json",className:"font-mono flex-1"}),t.jsx(se,{variant:"outline",size:"icon",onClick:()=>d({open:!0,field:"registryPath",type:"file"}),title:"Browse...",children:t.jsx(Xi,{className:"w-4 h-4"})})]})]})]})]}),t.jsxs("div",{className:"border-b border-border pb-6",children:[t.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[t.jsx(JM,{className:"w-4 h-4"}),"User Interface"]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium text-foreground",children:"Default Port"}),t.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Port for the web UI server"}),t.jsx(Ze,{type:"number",value:((T=r==null?void 0:r.ui)==null?void 0:T.port)||3333,onChange:F=>K("ui","port",parseInt(F.target.value)||3333),placeholder:"3333",className:"w-32"})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium text-foreground",children:"Open Browser on Start"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Automatically open browser when starting the UI"})]}),t.jsx(_t,{checked:((B=r==null?void 0:r.ui)==null?void 0:B.openBrowser)??!0,onCheckedChange:F=>K("ui","openBrowser",F)})]})]})]}),t.jsxs("div",{className:"border-b border-border pb-6",children:[t.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[t.jsx(T5,{className:"w-4 h-4"}),"AI Assistant"]}),t.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"Choose which AI assistant to use for features like MCP creation and tool import."}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs("label",{className:`flex items-center gap-3 p-3 rounded-lg cursor-pointer border-2 transition-colors ${((r==null?void 0:r.aiAssistant)||"claude")==="claude"?"border-orange-500 bg-orange-500/5":"border-transparent bg-muted/50 hover:bg-muted"}`,onClick:()=>Y("aiAssistant","claude"),children:[t.jsx("input",{type:"radio",name:"aiAssistant",value:"claude",checked:((r==null?void 0:r.aiAssistant)||"claude")==="claude",onChange:()=>Y("aiAssistant","claude"),className:"sr-only"}),t.jsx("div",{className:"w-8 h-8 rounded-md bg-orange-500/10 flex items-center justify-center",children:t.jsx(Wt,{className:"w-4 h-4 text-orange-500"})}),t.jsxs("div",{className:"flex-1",children:[t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Claude Code"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Anthropic's AI coding assistant • Command: ",t.jsx("code",{className:"text-xs",children:"claude"})]})]}),((r==null?void 0:r.aiAssistant)||"claude")==="claude"&&t.jsx("div",{className:"w-2 h-2 rounded-full bg-orange-500"})]}),t.jsxs("label",{className:`flex items-center gap-3 p-3 rounded-lg cursor-pointer border-2 transition-colors ${(r==null?void 0:r.aiAssistant)==="gemini"?"border-blue-500 bg-blue-500/5":"border-transparent bg-muted/50 hover:bg-muted"}`,onClick:()=>Y("aiAssistant","gemini"),children:[t.jsx("input",{type:"radio",name:"aiAssistant",value:"gemini",checked:(r==null?void 0:r.aiAssistant)==="gemini",onChange:()=>Y("aiAssistant","gemini"),className:"sr-only"}),t.jsx("div",{className:"w-8 h-8 rounded-md bg-blue-500/10 flex items-center justify-center",children:t.jsx(Ut,{className:"w-4 h-4 text-blue-500"})}),t.jsxs("div",{className:"flex-1",children:[t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Gemini CLI"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Google's AI coding assistant • Command: ",t.jsx("code",{className:"text-xs",children:"gemini"})]})]}),(r==null?void 0:r.aiAssistant)==="gemini"&&t.jsx("div",{className:"w-2 h-2 rounded-full bg-blue-500"})]})]})]}),t.jsxs("div",{className:"border-b border-border pb-6",children:[t.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[t.jsx(eM,{className:"w-4 h-4"}),"Enabled AI Tools"]}),t.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"Select which AI coding tools to generate MCP configurations for. The Apply button will update all enabled tools."}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-8 h-8 rounded-md bg-orange-500/10 flex items-center justify-center",children:t.jsx(Wt,{className:"w-4 h-4 text-orange-500"})}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium text-foreground",children:"Claude Code"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Anthropic's AI coding assistant • Output: ",t.jsx("code",{className:"text-xs",children:".mcp.json"})]})]})]}),t.jsx(_t,{checked:((r==null?void 0:r.enabledTools)||["claude"]).includes("claude"),onCheckedChange:()=>L("claude")})]}),t.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-8 h-8 rounded-md bg-blue-500/10 flex items-center justify-center",children:t.jsx(Wt,{className:"w-4 h-4 text-blue-500"})}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium text-foreground",children:"Gemini CLI"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Google's terminal AI coding assistant • Output: ",t.jsx("code",{className:"text-xs",children:"~/.gemini/settings.json"})]})]})]}),t.jsx(_t,{checked:((r==null?void 0:r.enabledTools)||["claude"]).includes("gemini"),onCheckedChange:()=>L("gemini")})]}),t.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-8 h-8 rounded-md bg-purple-500/10 flex items-center justify-center",children:t.jsx(Wt,{className:"w-4 h-4 text-purple-500"})}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium text-foreground",children:"Antigravity"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Google's AI IDE • Output: ",t.jsx("code",{className:"text-xs",children:"~/.gemini/antigravity/mcp_config.json"})]})]})]}),t.jsx(_t,{checked:((r==null?void 0:r.enabledTools)||["claude"]).includes("antigravity"),onCheckedChange:()=>L("antigravity")})]}),t.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-8 h-8 rounded-md bg-green-500/10 flex items-center justify-center",children:t.jsx(Wt,{className:"w-4 h-4 text-green-500"})}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium text-foreground",children:"Codex CLI"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["OpenAI's terminal coding assistant • Output: ",t.jsx("code",{className:"text-xs",children:".codex/mcp.json"})]})]})]}),t.jsx(_t,{checked:((r==null?void 0:r.enabledTools)||["claude"]).includes("codex"),onCheckedChange:()=>L("codex")})]}),t.jsxs("p",{className:"text-xs text-muted-foreground italic",children:["Note: Antigravity does not support environment variable interpolation (",t.jsx("code",{children:"${VAR}"}),"). Variables are resolved to actual values when generating its config."]})]})]}),y.length>0&&t.jsxs("div",{children:[t.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[t.jsx(fC,{className:"w-4 h-4"}),"Hidden Sub-projects"]}),t.jsx("div",{className:"space-y-2",children:y.map(F=>t.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Yr,{className:"w-4 h-4 text-muted-foreground"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:F.name}),t.jsx("p",{className:"text-xs text-muted-foreground font-mono",children:F.dir.replace(S+"/","")})]})]}),t.jsxs(se,{size:"sm",variant:"outline",onClick:()=>z(F.dir),className:"h-7",children:[t.jsx(Lg,{className:"w-3 h-3 mr-1"}),"Unhide"]})]},F.dir))})]}),t.jsxs("div",{className:"border-b border-border pb-6",children:[t.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[t.jsx(Sm,{className:"w-4 h-4"}),"Experimental Features"]}),t.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"These features are experimental and may change or be removed in future versions."}),t.jsx("div",{className:"space-y-4",children:t.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg border border-yellow-500/20",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-8 h-8 rounded-md bg-yellow-500/10 flex items-center justify-center",children:t.jsx(Sm,{className:"w-4 h-4 text-yellow-500"})}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium text-foreground",children:"Ralph Loops"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Autonomous development loops with Claude Code"})]})]}),t.jsx(_t,{checked:((G=r==null?void 0:r.experimental)==null?void 0:G.ralphLoops)||!1,onCheckedChange:F=>{if(F)P({open:!0,feature:"ralphLoops"});else{const re={...r,experimental:{...r==null?void 0:r.experimental,ralphLoops:!1}};s(re),me.saveConfig(re),e==null||e(re),q.success("Ralph Loops disabled")}}})]})})]}),t.jsxs("div",{children:[t.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[t.jsx(zr,{className:"w-4 h-4"}),"About"]}),t.jsxs("div",{className:"bg-muted rounded-lg p-4 space-y-3",children:[t.jsxs("div",{className:"flex justify-between text-sm",children:[t.jsx("span",{className:"text-muted-foreground",children:"Installed Version"}),t.jsx("span",{className:"font-medium font-mono text-foreground",children:(h==null?void 0:h.installedVersion)||"Loading..."})]}),(h==null?void 0:h.updateAvailable)&&t.jsx("div",{className:"p-3 bg-green-500/10 border border-green-500/20 rounded-lg",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-green-600 dark:text-green-400",children:"Update Available!"}),t.jsxs("p",{className:"text-xs text-green-600/80 dark:text-green-400/80",children:["Version ",h.latestVersion," via ",h.updateMethod==="npm"?"npm":h.sourcePath]})]}),t.jsxs(se,{size:"sm",onClick:U,disabled:w,className:"bg-green-600 hover:bg-green-700 text-white",children:[w?t.jsx(Qe,{className:"w-4 h-4 mr-2 animate-spin"}):t.jsx(xi,{className:"w-4 h-4 mr-2"}),"Update Now"]})]})}),!(h!=null&&h.updateAvailable)&&(h==null?void 0:h.latestVersion)&&t.jsxs("div",{className:"flex justify-between text-sm",children:[t.jsx("span",{className:"text-muted-foreground",children:"Latest Version"}),t.jsxs("span",{className:"font-mono text-green-600 dark:text-green-400",children:[h.latestVersion," ✓"]})]}),(h==null?void 0:h.sourcePath)&&!(h!=null&&h.updateAvailable)&&t.jsxs("div",{className:"flex items-center justify-between text-sm",children:[t.jsx("span",{className:"text-muted-foreground",children:"Dev Source"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("code",{className:"text-xs text-muted-foreground",children:h.sourcePath}),t.jsx(se,{size:"sm",variant:"outline",onClick:U,disabled:w,className:"h-7",children:w?t.jsx(Qe,{className:"w-3 h-3 animate-spin"}):t.jsx(Mr,{className:"w-3 h-3"})})]})]}),t.jsxs("div",{className:"flex justify-between text-sm",children:[t.jsx("span",{className:"text-muted-foreground",children:"Install Location"}),t.jsx("code",{className:"text-xs text-muted-foreground",children:(h==null?void 0:h.installDir)||"~/.coder-config"})]}),t.jsxs("div",{className:"flex items-center justify-between text-sm pt-2",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:"Auto-Update"}),t.jsx("p",{className:"text-xs text-muted-foreground/70",children:"Automatically install updates when available"})]}),t.jsx(_t,{checked:(r==null?void 0:r.autoUpdate)||!1,onCheckedChange:F=>{Y("autoUpdate",F),me.saveConfig({...r,autoUpdate:F}),q.success(F?"Auto-update enabled":"Auto-update disabled")}})]}),t.jsxs("div",{className:"flex items-center justify-between text-sm pt-2",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:"Release Channel"}),t.jsx("p",{className:"text-xs text-muted-foreground/70",children:(r==null?void 0:r.releaseChannel)==="beta"?t.jsxs("span",{className:"text-yellow-500 flex items-center gap-1",children:[t.jsx(Gi,{className:"w-3 h-3"}),"Beta builds may have bugs"]}):"Stable releases (recommended)"})]}),t.jsxs("select",{value:(r==null?void 0:r.releaseChannel)||"stable",onChange:F=>{const re=F.target.value;re==="beta"?E({open:!0}):(Y("releaseChannel",re),me.saveConfig({...r,releaseChannel:re}),q.success("Switched to stable releases"))},className:"bg-background border border-border rounded px-2 py-1 text-sm",children:[t.jsx("option",{value:"stable",children:"Stable"}),t.jsx("option",{value:"beta",children:"Beta"})]})]}),t.jsxs("div",{className:"border-t border-border pt-3 mt-3 space-y-2",children:[t.jsxs("div",{className:"flex justify-between text-sm",children:[t.jsx("span",{className:"text-muted-foreground",children:"Documentation"}),t.jsx("a",{href:"https://github.com/regression-io/coder-config",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"GitHub"})]}),t.jsxs("div",{className:"flex justify-between text-sm",children:[t.jsx("span",{className:"text-muted-foreground",children:"What's New"}),t.jsxs("button",{onClick:X,className:"text-primary hover:underline flex items-center gap-1",children:[t.jsx(Au,{className:"w-3 h-3"}),"Changelog"]})]}),t.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["After updating, restart the server with ",t.jsx("code",{className:"bg-muted-foreground/10 px-1 rounded",children:"coder-config ui"})]})]})]})]})]})]}),t.jsx(wx,{open:c.open,onOpenChange:F=>d(re=>({...re,open:F})),onSelect:F=>{if(c.field==="toolsDirs"){const re=(r==null?void 0:r.toolsDirs)||(r!=null&&r.toolsDir?[r.toolsDir]:[]);if(c.index===-1)s(de=>{const{toolsDir:ue,...J}=de;return{...J,toolsDirs:[...re,F]}});else{const de=[...re];de[c.index]=F,s(ue=>{const{toolsDir:J,...H}=ue;return{...H,toolsDirs:de}})}}else c.field&&Y(c.field,F)},type:c.type,initialPath:c.field==="toolsDirs"&&c.index>=0?((r==null?void 0:r.toolsDirs)||(r!=null&&r.toolsDir?[r.toolsDir]:[]))[c.index]||"~":(r==null?void 0:r[c.field])||"~",title:c.type==="directory"?"Select Directory":"Select File"}),t.jsx(bt,{open:b.open,onOpenChange:F=>k(re=>({...re,open:F})),children:t.jsxs(ft,{className:"max-w-2xl max-h-[80vh] flex flex-col overflow-hidden",children:[t.jsx(mt,{className:"flex-shrink-0",children:t.jsxs(pt,{className:"flex items-center gap-2",children:[t.jsx(Au,{className:"w-5 h-5"}),"Changelog"]})}),b.loading?t.jsx("div",{className:"flex items-center justify-center py-12",children:t.jsx(Qe,{className:"w-6 h-6 animate-spin text-primary"})}):t.jsx(Xs,{className:"h-[60vh]",children:t.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none pr-4",children:t.jsx(cH,{components:{h1:({children:F})=>t.jsx("h1",{className:"text-xl font-bold text-foreground mb-4",children:F}),h2:({children:F})=>t.jsx("h2",{className:"text-lg font-semibold text-foreground mt-6 mb-3 pb-2 border-b border-border",children:F}),h3:({children:F})=>t.jsx("h3",{className:"text-base font-medium text-foreground mt-4 mb-2",children:F}),p:({children:F})=>t.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:F}),ul:({children:F})=>t.jsx("ul",{className:"text-sm text-muted-foreground list-disc pl-5 mb-3 space-y-1",children:F}),li:({children:F})=>t.jsx("li",{className:"text-sm",children:F}),code:({children:F})=>t.jsx("code",{className:"bg-muted px-1 py-0.5 rounded text-xs font-mono",children:F}),hr:()=>t.jsx("hr",{className:"my-4 border-border"}),strong:({children:F})=>t.jsx("strong",{className:"font-semibold text-foreground",children:F})},children:b.content})})})]})}),t.jsx(bt,{open:N.open,onOpenChange:F=>P(re=>({...re,open:F})),children:t.jsxs(ft,{className:"max-w-md",children:[t.jsxs(mt,{children:[t.jsxs(pt,{className:"flex items-center gap-2 text-yellow-600 dark:text-yellow-400",children:[t.jsx(Gi,{className:"w-5 h-5"}),"Experimental Feature Warning"]}),t.jsx(rr,{className:"pt-2",children:t.jsxs("div",{className:"space-y-3 text-sm text-muted-foreground",children:[t.jsxs("p",{children:[t.jsx("strong",{className:"text-foreground",children:"Ralph Loops"})," is an experimental feature that enables autonomous development loops with Claude Code."]}),t.jsxs("div",{className:"bg-yellow-500/10 border border-yellow-500/20 rounded-lg p-3",children:[t.jsx("p",{className:"text-yellow-700 dark:text-yellow-300 font-medium mb-2",children:"Please be aware:"}),t.jsxs("ul",{className:"list-disc pl-4 space-y-1 text-yellow-600 dark:text-yellow-400",children:[t.jsx("li",{children:"This feature runs Claude autonomously with minimal intervention"}),t.jsx("li",{children:"It may make many API calls and incur costs"}),t.jsx("li",{children:"Always review generated code before committing"}),t.jsx("li",{children:"This feature may change or be removed in future versions"})]})]}),t.jsx("p",{children:"Do you want to enable Ralph Loops?"})]})})]}),t.jsxs(kt,{className:"gap-2 sm:gap-0",children:[t.jsx(se,{variant:"outline",onClick:()=>P({open:!1,feature:null}),children:"Cancel"}),t.jsxs(se,{variant:"default",className:"bg-yellow-600 hover:bg-yellow-700 text-white",onClick:()=>{const F={...r,experimental:{...r==null?void 0:r.experimental,ralphLoops:!0}};s(F),me.saveConfig(F),e==null||e(F),q.success("Ralph Loops enabled"),P({open:!1,feature:null})},children:[t.jsx(Sm,{className:"w-4 h-4 mr-2"}),"Enable Feature"]})]})]})}),t.jsx(bt,{open:A.open,onOpenChange:F=>E({open:F}),children:t.jsxs(ft,{className:"max-w-md",children:[t.jsxs(mt,{children:[t.jsxs(pt,{className:"flex items-center gap-2 text-red-600 dark:text-red-400",children:[t.jsx(Gi,{className:"w-5 h-5"}),"Switch to Beta Channel?"]}),t.jsx(rr,{className:"pt-2",children:t.jsxs("div",{className:"space-y-3 text-sm text-muted-foreground",children:[t.jsxs("p",{children:["You are about to switch to ",t.jsx("strong",{className:"text-foreground",children:"beta releases"}),"."]}),t.jsxs("div",{className:"bg-red-500/10 border border-red-500/20 rounded-lg p-3",children:[t.jsx("p",{className:"text-red-700 dark:text-red-300 font-medium mb-2",children:"Warning:"}),t.jsxs("ul",{className:"list-disc pl-4 space-y-1 text-red-600 dark:text-red-400",children:[t.jsxs("li",{children:[t.jsx("strong",{children:"Things may break"})," - beta releases are not fully tested"]}),t.jsxs("li",{children:[t.jsx("strong",{children:"Data loss possible"})," - bugs could corrupt your configuration"]}),t.jsxs("li",{children:[t.jsx("strong",{children:"Frequent changes"})," - behavior may change unexpectedly"]}),t.jsxs("li",{children:[t.jsx("strong",{children:"No rollback"})," - you'll need to manually downgrade if issues occur"]})]})]}),t.jsx("p",{className:"text-yellow-600 dark:text-yellow-400",children:"Only enable this if you're comfortable debugging issues and reporting bugs."})]})})]}),t.jsxs(kt,{className:"gap-2 sm:gap-0",children:[t.jsx(se,{variant:"outline",onClick:()=>E({open:!1}),children:"Stay on Stable"}),t.jsxs(se,{variant:"destructive",onClick:()=>{Y("releaseChannel","beta"),me.saveConfig({...r,releaseChannel:"beta"}),q.warning("Switched to beta releases - expect bugs!"),E({open:!1})},children:[t.jsx(Gi,{className:"w-4 h-4 mr-2"}),"Switch to Beta"]})]})]})})]})}function pH(){const[e,r]=_.useState(null),[s,n]=_.useState({}),[o,c]=_.useState(!0);_.useEffect(()=>{d()},[]);const d=async()=>{try{c(!0);const[u,f]=await Promise.all([me.getClaudeSettings(),me.getRegistry()]);r(u.settings),n(f.mcpServers||{})}catch(u){console.error("Failed to load Claude settings:",u)}finally{c(!1)}},l=async u=>{try{await me.saveClaudeSettings(u),r(u),q.success("Claude Code settings saved!")}catch(f){q.error("Failed to save settings: "+f.message)}};return o?t.jsx("div",{className:"flex items-center justify-center h-64",children:t.jsx(Qe,{className:"w-8 h-8 animate-spin text-indigo-600"})}):t.jsxs("div",{className:"space-y-6",children:[t.jsx("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 p-6 shadow-sm",children:t.jsx(kN,{settings:e,onSave:l,loading:o,settingsPath:"~/.claude/settings.json",mcpServers:s})}),t.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-4 border border-transparent dark:border-slate-800",children:[t.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:"CLI Commands"}),t.jsxs("div",{className:"space-y-1 text-sm text-gray-600 dark:text-slate-400 font-mono",children:[t.jsx("p",{children:"coder-config init # Initialize project"}),t.jsx("p",{children:"coder-config apply # Generate .mcp.json from config"}),t.jsx("p",{children:"coder-config show # Show current project config"})]})]})]})}function gH(){const[e,r]=_.useState(null),[s,n]=_.useState(!0);_.useEffect(()=>{o()},[]);const o=async()=>{try{n(!0);const d=await me.getGeminiSettings();r(d.settings)}catch(d){console.error("Failed to load Gemini settings:",d)}finally{n(!1)}},c=async d=>{try{await me.saveGeminiSettings(d),r(d),q.success("Gemini CLI settings saved!")}catch(l){q.error("Failed to save settings: "+l.message)}};return s?t.jsx("div",{className:"flex items-center justify-center h-64",children:t.jsx(Qe,{className:"w-8 h-8 animate-spin text-blue-600"})}):t.jsxs("div",{className:"space-y-6",children:[t.jsx("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 p-6 shadow-sm",children:t.jsx(jN,{settings:e,onSave:c,loading:s,settingsPath:"~/.gemini/settings.json"})}),t.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-4 border border-transparent dark:border-slate-800",children:[t.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:"CLI Commands"}),t.jsxs("div",{className:"space-y-1 text-sm text-gray-600 dark:text-slate-400 font-mono",children:[t.jsx("p",{children:"coder-config apply # Generate settings for all tools"}),t.jsx("p",{children:"coder-config apply --gemini # Generate Gemini settings only"})]})]})]})}const xH=[{id:"off",name:"Off",description:"Never auto-execute; requires allow list"},{id:"auto",name:"Auto",description:"Safety model determines execution"},{id:"turbo",name:"Turbo",description:"Auto-execute unless in deny list",dangerous:!0}],vH=[{id:"always-proceed",name:"Always Proceed",description:"Agent never requests review"},{id:"agent-decides",name:"Agent Decides",description:"Agent determines when review is needed"},{id:"request-review",name:"Request Review",description:"Agent always requests review"}],yH=[{id:"always-proceed",name:"Always Proceed",description:"Maximum autonomy",dangerous:!0},{id:"request-review",name:"Request Review",description:"Ask before browser JavaScript"},{id:"disabled",name:"Disabled",description:"Never run browser JavaScript"}];function bH({settings:e,onSave:r,loading:s,settingsPath:n}){const[o,c]=_.useState(e||{}),[d,l]=_.useState(!1),[u,f]=_.useState("rich"),[m,h]=_.useState(JSON.stringify(e||{},null,2)),[g,w]=_.useState({open:!1,name:"",json:""}),[j,S]=_.useState({}),v=async()=>{l(!0);try{if(u==="json")try{const A=JSON.parse(m);await r(A),c(A)}catch{q.error("Invalid JSON"),l(!1);return}else await r(o),h(JSON.stringify(o,null,2));q.success("Settings saved")}finally{l(!1)}},y=(A,E)=>{c(M=>({...M,[A]:E}))},x=(A,E)=>(o==null?void 0:o[A])??E,b=o.mcpServers||{},k=()=>{const{name:A,json:E}=g;if(!A.trim()){q.error("Please enter a name for the MCP");return}let M;try{M=JSON.parse(E)}catch{q.error("Invalid JSON configuration");return}if(!M.command){q.error('MCP config must have a "command" field');return}c(D=>({...D,mcpServers:{...D.mcpServers,[A.trim()]:M}})),w({open:!1,name:"",json:""}),q.success(`Added MCP: ${A}`)},N=A=>{c(E=>{const{[A]:M,...D}=E.mcpServers||{};return{...E,mcpServers:D}}),q.success(`Removed MCP: ${A}`)},P=A=>{S(E=>({...E,[A]:!E[A]}))};return t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-10 h-10 rounded-lg bg-purple-500/10 flex items-center justify-center",children:t.jsx(Ac,{className:"w-5 h-5 text-purple-500"})}),t.jsxs("div",{children:[t.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:["Antigravity Settings",t.jsx(tt,{variant:"outline",className:"text-xs font-normal text-purple-600 border-purple-300 dark:border-purple-700",children:"Google"})]}),t.jsxs("p",{className:"text-sm text-muted-foreground",children:["Stored in: ",t.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-xs",children:n})]})]})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("div",{className:"flex bg-muted rounded-lg p-1",children:[t.jsx("button",{className:`px-3 py-1 text-sm rounded-md transition-colors ${u==="rich"?"bg-background shadow-sm":"text-muted-foreground hover:text-foreground"}`,onClick:()=>f("rich"),children:"Settings"}),t.jsx("button",{className:`px-3 py-1 text-sm rounded-md transition-colors ${u==="json"?"bg-background shadow-sm":"text-muted-foreground hover:text-foreground"}`,onClick:()=>{h(JSON.stringify(o,null,2)),f("json")},children:"JSON"})]}),t.jsxs(se,{onClick:v,disabled:d||s,children:[d?t.jsx(Qe,{className:"w-4 h-4 mr-2 animate-spin"}):t.jsx(bs,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),u==="json"?t.jsx("div",{className:"border border-border rounded-lg bg-card overflow-hidden",children:t.jsx(ht,{value:m,onChange:A=>h(A.target.value),className:"font-mono text-sm min-h-[500px] border-0 rounded-none resize-none",placeholder:"{ }"})}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[t.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[t.jsx(Qn,{className:"w-4 h-4 text-purple-500"}),"Security Policies"]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium text-foreground",children:"Terminal Command Execution"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Control how the agent executes shell commands"})]}),t.jsxs(kr,{value:x("terminalPolicy","auto"),onValueChange:A=>y("terminalPolicy",A),children:[t.jsx(yr,{className:"w-44",children:t.jsx(jr,{})}),t.jsx(br,{children:xH.map(A=>t.jsx(Mt,{value:A.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{children:A.name}),A.dangerous&&t.jsx(tt,{variant:"destructive",className:"text-xs",children:"Risk"})]})},A.id))})]})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium text-foreground",children:"Review Policy"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"When the agent should request human review"})]}),t.jsxs(kr,{value:x("reviewPolicy","agent-decides"),onValueChange:A=>y("reviewPolicy",A),children:[t.jsx(yr,{className:"w-44",children:t.jsx(jr,{})}),t.jsx(br,{children:vH.map(A=>t.jsx(Mt,{value:A.id,children:A.name},A.id))})]})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium text-foreground",children:"JavaScript Execution"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Control browser JavaScript execution"})]}),t.jsxs(kr,{value:x("jsPolicy","request-review"),onValueChange:A=>y("jsPolicy",A),children:[t.jsx(yr,{className:"w-44",children:t.jsx(jr,{})}),t.jsx(br,{children:yH.map(A=>t.jsx(Mt,{value:A.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{children:A.name}),A.dangerous&&t.jsx(tt,{variant:"destructive",className:"text-xs",children:"Risk"})]})},A.id))})]})]})]})]}),t.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsxs("h3",{className:"text-sm font-medium text-foreground flex items-center gap-2",children:[t.jsx(ys,{className:"w-4 h-4 text-purple-500"}),"MCP Servers",t.jsx(tt,{variant:"secondary",className:"text-xs",children:Object.keys(b).length})]}),t.jsxs(se,{size:"sm",variant:"outline",onClick:()=>w({open:!0,name:"",json:`{
|
|
643
|
+
`},o),c}function Fz(e,r){return e&&"run"in e?async function(s,n){const o=f_(s,{file:n,...r});await e.run(o,n)}:function(s,n){return f_(s,{file:n,...e||r})}}function m_(e){if(e)throw e}var Km,p_;function Bz(){if(p_)return Km;p_=1;var e=Object.prototype.hasOwnProperty,r=Object.prototype.toString,s=Object.defineProperty,n=Object.getOwnPropertyDescriptor,o=function(f){return typeof Array.isArray=="function"?Array.isArray(f):r.call(f)==="[object Array]"},c=function(f){if(!f||r.call(f)!=="[object Object]")return!1;var m=e.call(f,"constructor"),h=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!m&&!h)return!1;var g;for(g in f);return typeof g>"u"||e.call(f,g)},d=function(f,m){s&&m.name==="__proto__"?s(f,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):f[m.name]=m.newValue},l=function(f,m){if(m==="__proto__")if(e.call(f,m)){if(n)return n(f,m).value}else return;return f[m]};return Km=function u(){var f,m,h,g,w,j,S=arguments[0],v=1,y=arguments.length,x=!1;for(typeof S=="boolean"&&(x=S,S=arguments[1]||{},v=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});v<y;++v)if(f=arguments[v],f!=null)for(m in f)h=l(S,m),g=l(f,m),S!==g&&(x&&g&&(c(g)||(w=o(g)))?(w?(w=!1,j=h&&o(h)?h:[]):j=h&&c(h)?h:{},d(S,{name:m,newValue:u(x,j,g)})):typeof g<"u"&&d(S,{name:m,newValue:g}));return S},Km}var $z=Bz();const Ym=Cc($z);function Yp(e){if(typeof e!="object"||e===null)return!1;const r=Object.getPrototypeOf(e);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function zz(){const e=[],r={run:s,use:n};return r;function s(...o){let c=-1;const d=o.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);l(null,...o);function l(u,...f){const m=e[++c];let h=-1;if(u){d(u);return}for(;++h<o.length;)(f[h]===null||f[h]===void 0)&&(f[h]=o[h]);o=f,m?Hz(m,l)(...f):d(null,...f)}}function n(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),r}}function Hz(e,r){let s;return n;function n(...d){const l=e.length>d.length;let u;l&&d.push(o);try{u=e.apply(this,d)}catch(f){const m=f;if(l&&s)throw m;return o(m)}l||(u&&u.then&&typeof u.then=="function"?u.then(c,o):u instanceof Error?o(u):c(u))}function o(d,...l){s||(s=!0,r(d,...l))}function c(d){o(null,d)}}const Bn={basename:Wz,dirname:Uz,extname:Vz,join:Gz,sep:"/"};function Wz(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');Gc(e);let s=0,n=-1,o=e.length,c;if(r===void 0||r.length===0||r.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(c){s=o+1;break}}else n<0&&(c=!0,n=o+1);return n<0?"":e.slice(s,n)}if(r===e)return"";let d=-1,l=r.length-1;for(;o--;)if(e.codePointAt(o)===47){if(c){s=o+1;break}}else d<0&&(c=!0,d=o+1),l>-1&&(e.codePointAt(o)===r.codePointAt(l--)?l<0&&(n=o):(l=-1,n=d));return s===n?n=d:n<0&&(n=e.length),e.slice(s,n)}function Uz(e){if(Gc(e),e.length===0)return".";let r=-1,s=e.length,n;for(;--s;)if(e.codePointAt(s)===47){if(n){r=s;break}}else n||(n=!0);return r<0?e.codePointAt(0)===47?"/":".":r===1&&e.codePointAt(0)===47?"//":e.slice(0,r)}function Vz(e){Gc(e);let r=e.length,s=-1,n=0,o=-1,c=0,d;for(;r--;){const l=e.codePointAt(r);if(l===47){if(d){n=r+1;break}continue}s<0&&(d=!0,s=r+1),l===46?o<0?o=r:c!==1&&(c=1):o>-1&&(c=-1)}return o<0||s<0||c===0||c===1&&o===s-1&&o===n+1?"":e.slice(o,s)}function Gz(...e){let r=-1,s;for(;++r<e.length;)Gc(e[r]),e[r]&&(s=s===void 0?e[r]:s+"/"+e[r]);return s===void 0?".":qz(s)}function qz(e){Gc(e);const r=e.codePointAt(0)===47;let s=Kz(e,!r);return s.length===0&&!r&&(s="."),s.length>0&&e.codePointAt(e.length-1)===47&&(s+="/"),r?"/"+s:s}function Kz(e,r){let s="",n=0,o=-1,c=0,d=-1,l,u;for(;++d<=e.length;){if(d<e.length)l=e.codePointAt(d);else{if(l===47)break;l=47}if(l===47){if(!(o===d-1||c===1))if(o!==d-1&&c===2){if(s.length<2||n!==2||s.codePointAt(s.length-1)!==46||s.codePointAt(s.length-2)!==46){if(s.length>2){if(u=s.lastIndexOf("/"),u!==s.length-1){u<0?(s="",n=0):(s=s.slice(0,u),n=s.length-1-s.lastIndexOf("/")),o=d,c=0;continue}}else if(s.length>0){s="",n=0,o=d,c=0;continue}}r&&(s=s.length>0?s+"/..":"..",n=2)}else s.length>0?s+="/"+e.slice(o+1,d):s=e.slice(o+1,d),n=d-o-1;o=d,c=0}else l===46&&c>-1?c++:c=-1}return s}function Gc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Yz={cwd:Xz};function Xz(){return"/"}function Xp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Jz(e){if(typeof e=="string")e=new URL(e);else if(!Xp(e)){const r=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw r.code="ERR_INVALID_ARG_TYPE",r}if(e.protocol!=="file:"){const r=new TypeError("The URL must be of scheme file");throw r.code="ERR_INVALID_URL_SCHEME",r}return Qz(e)}function Qz(e){if(e.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const r=e.pathname;let s=-1;for(;++s<r.length;)if(r.codePointAt(s)===37&&r.codePointAt(s+1)===50){const n=r.codePointAt(s+2);if(n===70||n===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(r)}const Xm=["history","path","basename","stem","extname","dirname"];class f2{constructor(r){let s;r?Xp(r)?s={path:r}:typeof r=="string"||Zz(r)?s={value:r}:s=r:s={},this.cwd="cwd"in s?"":Yz.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Xm.length;){const c=Xm[n];c in s&&s[c]!==void 0&&s[c]!==null&&(this[c]=c==="history"?[...s[c]]:s[c])}let o;for(o in s)Xm.includes(o)||(this[o]=s[o])}get basename(){return typeof this.path=="string"?Bn.basename(this.path):void 0}set basename(r){Qm(r,"basename"),Jm(r,"basename"),this.path=Bn.join(this.dirname||"",r)}get dirname(){return typeof this.path=="string"?Bn.dirname(this.path):void 0}set dirname(r){g_(this.basename,"dirname"),this.path=Bn.join(r||"",this.basename)}get extname(){return typeof this.path=="string"?Bn.extname(this.path):void 0}set extname(r){if(Jm(r,"extname"),g_(this.dirname,"extname"),r){if(r.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(r.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Bn.join(this.dirname,this.stem+(r||""))}get path(){return this.history[this.history.length-1]}set path(r){Xp(r)&&(r=Jz(r)),Qm(r,"path"),this.path!==r&&this.history.push(r)}get stem(){return typeof this.path=="string"?Bn.basename(this.path,this.extname):void 0}set stem(r){Qm(r,"stem"),Jm(r,"stem"),this.path=Bn.join(this.dirname||"",r+(this.extname||""))}fail(r,s,n){const o=this.message(r,s,n);throw o.fatal=!0,o}info(r,s,n){const o=this.message(r,s,n);return o.fatal=void 0,o}message(r,s,n){const o=new ds(r,s,n);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(r){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(r||void 0).decode(this.value)}}function Jm(e,r){if(e&&e.includes(Bn.sep))throw new Error("`"+r+"` cannot be a path: did not expect `"+Bn.sep+"`")}function Qm(e,r){if(!e)throw new Error("`"+r+"` cannot be empty")}function g_(e,r){if(!e)throw new Error("Setting `"+r+"` requires `path` to be set too")}function Zz(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const eH=(function(e){const n=this.constructor.prototype,o=n[e],c=function(){return o.apply(c,arguments)};return Object.setPrototypeOf(c,n),c}),tH={}.hasOwnProperty;class Yx extends eH{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=zz()}copy(){const r=new Yx;let s=-1;for(;++s<this.attachers.length;){const n=this.attachers[s];r.use(...n)}return r.data(Ym(!0,{},this.namespace)),r}data(r,s){return typeof r=="string"?arguments.length===2?(tp("data",this.frozen),this.namespace[r]=s,this):tH.call(this.namespace,r)&&this.namespace[r]||void 0:r?(tp("data",this.frozen),this.namespace=r,this):this.namespace}freeze(){if(this.frozen)return this;const r=this;for(;++this.freezeIndex<this.attachers.length;){const[s,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);const o=s.call(r,...n);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(r){this.freeze();const s=du(r),n=this.parser||this.Parser;return Zm("parse",n),n(String(s),s)}process(r,s){const n=this;return this.freeze(),Zm("process",this.parser||this.Parser),ep("process",this.compiler||this.Compiler),s?o(void 0,s):new Promise(o);function o(c,d){const l=du(r),u=n.parse(l);n.run(u,l,function(m,h,g){if(m||!h||!g)return f(m);const w=h,j=n.stringify(w,g);nH(j)?g.value=j:g.result=j,f(m,g)});function f(m,h){m||!h?d(m):c?c(h):s(void 0,h)}}}processSync(r){let s=!1,n;return this.freeze(),Zm("processSync",this.parser||this.Parser),ep("processSync",this.compiler||this.Compiler),this.process(r,o),v_("processSync","process",s),n;function o(c,d){s=!0,m_(c),n=d}}run(r,s,n){x_(r),this.freeze();const o=this.transformers;return!n&&typeof s=="function"&&(n=s,s=void 0),n?c(void 0,n):new Promise(c);function c(d,l){const u=du(s);o.run(r,u,f);function f(m,h,g){const w=h||r;m?l(m):d?d(w):n(void 0,w,g)}}}runSync(r,s){let n=!1,o;return this.run(r,s,c),v_("runSync","run",n),o;function c(d,l){m_(d),o=l,n=!0}}stringify(r,s){this.freeze();const n=du(s),o=this.compiler||this.Compiler;return ep("stringify",o),x_(r),o(r,n)}use(r,...s){const n=this.attachers,o=this.namespace;if(tp("use",this.frozen),r!=null)if(typeof r=="function")u(r,s);else if(typeof r=="object")Array.isArray(r)?l(r):d(r);else throw new TypeError("Expected usable value, not `"+r+"`");return this;function c(f){if(typeof f=="function")u(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[m,...h]=f;u(m,h)}else d(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function d(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(f.plugins),f.settings&&(o.settings=Ym(!0,o.settings,f.settings))}function l(f){let m=-1;if(f!=null)if(Array.isArray(f))for(;++m<f.length;){const h=f[m];c(h)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function u(f,m){let h=-1,g=-1;for(;++h<n.length;)if(n[h][0]===f){g=h;break}if(g===-1)n.push([f,...m]);else if(m.length>0){let[w,...j]=m;const S=n[g][1];Yp(S)&&Yp(w)&&(w=Ym(!0,S,w)),n[g]=[f,w,...j]}}}}const rH=new Yx().freeze();function Zm(e,r){if(typeof r!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ep(e,r){if(typeof r!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function tp(e,r){if(r)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function x_(e){if(!Yp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function v_(e,r,s){if(!s)throw new Error("`"+e+"` finished async. Use `"+r+"` instead")}function du(e){return sH(e)?e:new f2(e)}function sH(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function nH(e){return typeof e=="string"||iH(e)}function iH(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const oH="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",y_=[],b_={allowDangerousHtml:!0},aH=/^(https?|ircs?|mailto|xmpp)$/i,lH=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function cH(e){const r=dH(e),s=uH(e);return hH(r.runSync(r.parse(s),s),e)}function dH(e){const r=e.rehypePlugins||y_,s=e.remarkPlugins||y_,n=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...b_}:b_;return rH().use(W9).use(s).use(Fz,n).use(r)}function uH(e){const r=e.children||"",s=new f2;return typeof r=="string"&&(s.value=r),s}function hH(e,r){const s=r.allowedElements,n=r.allowElement,o=r.components,c=r.disallowedElements,d=r.skipHtml,l=r.unwrapDisallowed,u=r.urlTransform||fH;for(const m of lH)Object.hasOwn(r,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+oH+m.id,void 0);return h2(e,f),_7(e,{Fragment:t.Fragment,components:o,ignoreInvalidStyle:!0,jsx:t.jsx,jsxs:t.jsxs,passKeys:!0,passNode:!0});function f(m,h,g){if(m.type==="raw"&&g&&typeof h=="number")return d?g.children.splice(h,1):g.children[h]={type:"text",value:m.value},h;if(m.type==="element"){let w;for(w in Vm)if(Object.hasOwn(Vm,w)&&Object.hasOwn(m.properties,w)){const j=m.properties[w],S=Vm[w];(S===null||S.includes(m.tagName))&&(m.properties[w]=u(String(j||""),w,m))}}if(m.type==="element"){let w=s?!s.includes(m.tagName):c?c.includes(m.tagName):!1;if(!w&&n&&typeof h=="number"&&(w=!n(m,h,g)),w&&g&&typeof h=="number")return l&&m.children?g.children.splice(h,1,...m.children):g.children.splice(h,1),h}}}function fH(e){const r=e.indexOf(":"),s=e.indexOf("?"),n=e.indexOf("#"),o=e.indexOf("/");return r===-1||o!==-1&&r>o||s!==-1&&r>s||n!==-1&&r>n||aH.test(e.slice(0,r))?e:""}function mH({onConfigChange:e}){var T,B,G;const[r,s]=_.useState(null),[n,o]=_.useState(""),[c,d]=_.useState({open:!1,field:null,type:"directory"}),[l,u]=_.useState(!0),[f,m]=_.useState(!1),[h,g]=_.useState(null),[w,j]=_.useState(!1),[S,v]=_.useState(null),[y,x]=_.useState([]),[b,k]=_.useState({open:!1,content:"",loading:!1}),[N,P]=_.useState({open:!1,feature:null}),[A,E]=_.useState({open:!1});_.useEffect(()=>{W(),M(),D()},[]);const M=async()=>{try{const F=await me.checkVersion();g(F)}catch(F){console.error("Failed to load version info:",F)}},D=async()=>{try{const F=await me.getProject();v(F.dir),O(F.dir)}catch(F){console.error("Failed to load project info:",F)}},O=async F=>{if(F)try{const re=await me.getHiddenSubprojects(F);x(re.hidden||[])}catch(re){console.error("Failed to load hidden sub-projects:",re)}},z=async F=>{if(S)try{const re=await me.unhideSubproject(S,F);re.success?(q.success("Sub-project unhidden"),O(S)):q.error(re.error||"Failed to unhide")}catch(re){q.error("Failed to unhide: "+re.message)}},U=async()=>{if(!(h!=null&&h.updateAvailable)){q.error("No update available");return}j(!0);try{const F=await me.performUpdate({updateMethod:h.updateMethod,sourcePath:h.sourcePath,channel:h.channel});if(F.success){q.success(`Updated to v${F.newVersion}! Restarting server...`);try{await me.restartServer()}catch{}let re=0;const de=setInterval(async()=>{re++;try{await me.checkVersion(),clearInterval(de),q.success("Server restarted! Reloading..."),setTimeout(()=>window.location.reload(),500)}catch{re>30&&(clearInterval(de),q.info("Server restarting. Please refresh the page."),j(!1))}},500)}else q.error("Update failed: "+F.error),j(!1)}catch(F){q.error("Update failed: "+F.message),j(!1)}},X=async()=>{k(F=>({...F,open:!0,loading:!0}));try{const F=await me.getChangelog();F.success?k(re=>({...re,content:F.content,loading:!1})):(q.error("Failed to load changelog"),k(re=>({...re,open:!1,loading:!1})))}catch(F){q.error("Failed to load changelog: "+F.message),k(re=>({...re,open:!1,loading:!1}))}},W=async()=>{try{u(!0);const F=await me.getConfig();s(F.config),o(F.path)}catch{q.error("Failed to load settings")}finally{u(!1)}},$=async()=>{m(!0);try{await me.saveConfig(r),q.success("Preferences saved!")}catch{q.error("Failed to save preferences")}finally{m(!1)}},Y=(F,re)=>{s(de=>({...de,[F]:re}))},K=(F,re,de)=>{s(ue=>({...ue,[F]:{...ue[F],[re]:de}}))},L=async F=>{const re=(r==null?void 0:r.enabledTools)||["claude"];let de;if(re.includes(F)){if(re.length<=1){q.error("At least one tool must be enabled");return}de=re.filter(J=>J!==F)}else de=[...re,F];const ue={...r,enabledTools:de};s(ue);try{await me.saveConfig(ue),e==null||e(ue);const J={claude:"Claude Code",gemini:"Gemini CLI",antigravity:"Antigravity",codex:"Codex CLI"}[F]||F;q.success(`${J} ${de.includes(F)?"enabled":"disabled"}`)}catch{s(r),q.error("Failed to save preference")}};return l?t.jsx("div",{className:"flex items-center justify-center h-64",children:t.jsx(Qe,{className:"w-8 h-8 animate-spin text-primary"})}):t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-10 h-10 rounded-lg bg-muted flex items-center justify-center",children:t.jsx(bC,{className:"w-5 h-5 text-muted-foreground"})}),t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"coder-config Preferences"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Tool settings for this configuration manager"})]})]}),t.jsxs("div",{className:"bg-card rounded-xl border border-border p-6 shadow-sm",children:[t.jsxs("div",{className:"flex items-center justify-between mb-6",children:[t.jsx("div",{children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["Stored in: ",t.jsx("code",{className:"bg-muted px-2 py-0.5 rounded",children:n})]})}),t.jsxs(se,{onClick:$,disabled:f,children:[f?t.jsx(Qe,{className:"w-4 h-4 mr-2 animate-spin"}):t.jsx(bs,{className:"w-4 h-4 mr-2"}),"Save"]})]}),t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"border-b border-border pb-6",children:[t.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[t.jsx(Yr,{className:"w-4 h-4"}),"Directories"]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium text-foreground",children:"MCP Tools Directories"}),t.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Folders containing local MCP tool repositories for discovery"}),t.jsxs("div",{className:"space-y-2",children:[((r==null?void 0:r.toolsDirs)||(r!=null&&r.toolsDir?[r.toolsDir]:[])).map((F,re)=>t.jsxs("div",{className:"flex gap-2",children:[t.jsx(Ze,{value:F||"",onChange:de=>{const ue=[...(r==null?void 0:r.toolsDirs)||(r!=null&&r.toolsDir?[r.toolsDir]:[])];ue[re]=de.target.value,Y("toolsDirs",ue),r!=null&&r.toolsDir&&s(J=>{const{toolsDir:H,...oe}=J;return{...oe,toolsDirs:ue}})},placeholder:"~/mcp-tools",className:"font-mono flex-1"}),t.jsx(se,{variant:"outline",size:"icon",onClick:()=>d({open:!0,field:"toolsDirs",type:"directory",index:re}),title:"Browse...",children:t.jsx(Xi,{className:"w-4 h-4"})}),t.jsx(se,{variant:"outline",size:"icon",onClick:()=>{const ue=((r==null?void 0:r.toolsDirs)||(r!=null&&r.toolsDir?[r.toolsDir]:[])).filter((J,H)=>H!==re);s(J=>{const{toolsDir:H,...oe}=J;return{...oe,toolsDirs:ue.length>0?ue:void 0}})},title:"Remove",className:"text-destructive hover:text-destructive",children:t.jsx(Un,{className:"w-4 h-4"})})]},re)),t.jsxs(se,{variant:"outline",size:"sm",onClick:()=>d({open:!0,field:"toolsDirs",type:"directory",index:-1}),className:"mt-2",children:[t.jsx(fi,{className:"w-4 h-4 mr-2"}),"Add Tools Folder"]})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium text-foreground",children:"Global Registry Path"}),t.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Path to the global MCP registry file"}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(Ze,{value:(r==null?void 0:r.registryPath)||"",onChange:F=>Y("registryPath",F.target.value),placeholder:"~/.claude/registry.json",className:"font-mono flex-1"}),t.jsx(se,{variant:"outline",size:"icon",onClick:()=>d({open:!0,field:"registryPath",type:"file"}),title:"Browse...",children:t.jsx(Xi,{className:"w-4 h-4"})})]})]})]})]}),t.jsxs("div",{className:"border-b border-border pb-6",children:[t.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[t.jsx(JM,{className:"w-4 h-4"}),"User Interface"]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium text-foreground",children:"Default Port"}),t.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Port for the web UI server"}),t.jsx(Ze,{type:"number",value:((T=r==null?void 0:r.ui)==null?void 0:T.port)||3333,onChange:F=>K("ui","port",parseInt(F.target.value)||3333),placeholder:"3333",className:"w-32"})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium text-foreground",children:"Open Browser on Start"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Automatically open browser when starting the UI"})]}),t.jsx(_t,{checked:((B=r==null?void 0:r.ui)==null?void 0:B.openBrowser)??!0,onCheckedChange:F=>K("ui","openBrowser",F)})]})]})]}),t.jsxs("div",{className:"border-b border-border pb-6",children:[t.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[t.jsx(T5,{className:"w-4 h-4"}),"AI Assistant"]}),t.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"Choose which AI assistant to use for features like MCP creation and tool import."}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs("label",{className:`flex items-center gap-3 p-3 rounded-lg cursor-pointer border-2 transition-colors ${((r==null?void 0:r.aiAssistant)||"claude")==="claude"?"border-orange-500 bg-orange-500/5":"border-transparent bg-muted/50 hover:bg-muted"}`,onClick:()=>Y("aiAssistant","claude"),children:[t.jsx("input",{type:"radio",name:"aiAssistant",value:"claude",checked:((r==null?void 0:r.aiAssistant)||"claude")==="claude",onChange:()=>Y("aiAssistant","claude"),className:"sr-only"}),t.jsx("div",{className:"w-8 h-8 rounded-md bg-orange-500/10 flex items-center justify-center",children:t.jsx(Wt,{className:"w-4 h-4 text-orange-500"})}),t.jsxs("div",{className:"flex-1",children:[t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Claude Code"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Anthropic's AI coding assistant • Command: ",t.jsx("code",{className:"text-xs",children:"claude"})]})]}),((r==null?void 0:r.aiAssistant)||"claude")==="claude"&&t.jsx("div",{className:"w-2 h-2 rounded-full bg-orange-500"})]}),t.jsxs("label",{className:`flex items-center gap-3 p-3 rounded-lg cursor-pointer border-2 transition-colors ${(r==null?void 0:r.aiAssistant)==="gemini"?"border-blue-500 bg-blue-500/5":"border-transparent bg-muted/50 hover:bg-muted"}`,onClick:()=>Y("aiAssistant","gemini"),children:[t.jsx("input",{type:"radio",name:"aiAssistant",value:"gemini",checked:(r==null?void 0:r.aiAssistant)==="gemini",onChange:()=>Y("aiAssistant","gemini"),className:"sr-only"}),t.jsx("div",{className:"w-8 h-8 rounded-md bg-blue-500/10 flex items-center justify-center",children:t.jsx(Ut,{className:"w-4 h-4 text-blue-500"})}),t.jsxs("div",{className:"flex-1",children:[t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Gemini CLI"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Google's AI coding assistant • Command: ",t.jsx("code",{className:"text-xs",children:"gemini"})]})]}),(r==null?void 0:r.aiAssistant)==="gemini"&&t.jsx("div",{className:"w-2 h-2 rounded-full bg-blue-500"})]})]})]}),t.jsxs("div",{className:"border-b border-border pb-6",children:[t.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[t.jsx(eM,{className:"w-4 h-4"}),"Enabled AI Tools"]}),t.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"Select which AI coding tools to generate MCP configurations for. The Apply button will update all enabled tools."}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-8 h-8 rounded-md bg-orange-500/10 flex items-center justify-center",children:t.jsx(Wt,{className:"w-4 h-4 text-orange-500"})}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium text-foreground",children:"Claude Code"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Anthropic's AI coding assistant • Output: ",t.jsx("code",{className:"text-xs",children:".mcp.json"})]})]})]}),t.jsx(_t,{checked:((r==null?void 0:r.enabledTools)||["claude"]).includes("claude"),onCheckedChange:()=>L("claude")})]}),t.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-8 h-8 rounded-md bg-blue-500/10 flex items-center justify-center",children:t.jsx(Wt,{className:"w-4 h-4 text-blue-500"})}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium text-foreground",children:"Gemini CLI"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Google's terminal AI coding assistant • Output: ",t.jsx("code",{className:"text-xs",children:"~/.gemini/settings.json"})]})]})]}),t.jsx(_t,{checked:((r==null?void 0:r.enabledTools)||["claude"]).includes("gemini"),onCheckedChange:()=>L("gemini")})]}),t.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-8 h-8 rounded-md bg-purple-500/10 flex items-center justify-center",children:t.jsx(Wt,{className:"w-4 h-4 text-purple-500"})}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium text-foreground",children:"Antigravity"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Google's AI IDE • Output: ",t.jsx("code",{className:"text-xs",children:"~/.gemini/antigravity/mcp_config.json"})]})]})]}),t.jsx(_t,{checked:((r==null?void 0:r.enabledTools)||["claude"]).includes("antigravity"),onCheckedChange:()=>L("antigravity")})]}),t.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-8 h-8 rounded-md bg-green-500/10 flex items-center justify-center",children:t.jsx(Wt,{className:"w-4 h-4 text-green-500"})}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium text-foreground",children:"Codex CLI"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["OpenAI's terminal coding assistant • Output: ",t.jsx("code",{className:"text-xs",children:".codex/mcp.json"})]})]})]}),t.jsx(_t,{checked:((r==null?void 0:r.enabledTools)||["claude"]).includes("codex"),onCheckedChange:()=>L("codex")})]}),t.jsxs("p",{className:"text-xs text-muted-foreground italic",children:["Note: Antigravity does not support environment variable interpolation (",t.jsx("code",{children:"${VAR}"}),"). Variables are resolved to actual values when generating its config."]})]})]}),y.length>0&&t.jsxs("div",{children:[t.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[t.jsx(fC,{className:"w-4 h-4"}),"Hidden Sub-projects"]}),t.jsx("div",{className:"space-y-2",children:y.map(F=>t.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Yr,{className:"w-4 h-4 text-muted-foreground"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:F.name}),t.jsx("p",{className:"text-xs text-muted-foreground font-mono",children:F.dir.replace(S+"/","")})]})]}),t.jsxs(se,{size:"sm",variant:"outline",onClick:()=>z(F.dir),className:"h-7",children:[t.jsx(Lg,{className:"w-3 h-3 mr-1"}),"Unhide"]})]},F.dir))})]}),t.jsxs("div",{className:"border-b border-border pb-6",children:[t.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[t.jsx(Sm,{className:"w-4 h-4"}),"Experimental Features"]}),t.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"These features are experimental and may change or be removed in future versions."}),t.jsx("div",{className:"space-y-4",children:t.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg border border-yellow-500/20",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-8 h-8 rounded-md bg-yellow-500/10 flex items-center justify-center",children:t.jsx(Sm,{className:"w-4 h-4 text-yellow-500"})}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium text-foreground",children:"Ralph Loops"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Autonomous development loops with Claude Code"})]})]}),t.jsx(_t,{checked:((G=r==null?void 0:r.experimental)==null?void 0:G.ralphLoops)||!1,onCheckedChange:F=>{if(F)P({open:!0,feature:"ralphLoops"});else{const re={...r,experimental:{...r==null?void 0:r.experimental,ralphLoops:!1}};s(re),me.saveConfig(re),e==null||e(re),q.success("Ralph Loops disabled")}}})]})})]}),t.jsxs("div",{children:[t.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[t.jsx(zr,{className:"w-4 h-4"}),"About"]}),t.jsxs("div",{className:"bg-muted rounded-lg p-4 space-y-3",children:[t.jsxs("div",{className:"flex justify-between text-sm",children:[t.jsx("span",{className:"text-muted-foreground",children:"Installed Version"}),t.jsx("span",{className:"font-medium font-mono text-foreground",children:(h==null?void 0:h.installedVersion)||"Loading..."})]}),(h==null?void 0:h.updateAvailable)&&t.jsx("div",{className:"p-3 bg-green-500/10 border border-green-500/20 rounded-lg",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-green-600 dark:text-green-400",children:"Update Available!"}),t.jsxs("p",{className:"text-xs text-green-600/80 dark:text-green-400/80",children:["Version ",h.latestVersion," via ",h.updateMethod==="npm"?"npm":h.sourcePath]})]}),t.jsxs(se,{size:"sm",onClick:U,disabled:w,className:"bg-green-600 hover:bg-green-700 text-white",children:[w?t.jsx(Qe,{className:"w-4 h-4 mr-2 animate-spin"}):t.jsx(xi,{className:"w-4 h-4 mr-2"}),"Update Now"]})]})}),!(h!=null&&h.updateAvailable)&&(h==null?void 0:h.latestVersion)&&t.jsxs("div",{className:"flex justify-between text-sm",children:[t.jsx("span",{className:"text-muted-foreground",children:"Latest Version"}),t.jsxs("span",{className:"font-mono text-green-600 dark:text-green-400",children:[h.latestVersion," ✓"]})]}),(h==null?void 0:h.sourcePath)&&!(h!=null&&h.updateAvailable)&&t.jsxs("div",{className:"flex items-center justify-between text-sm",children:[t.jsx("span",{className:"text-muted-foreground",children:"Dev Source"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("code",{className:"text-xs text-muted-foreground",children:h.sourcePath}),t.jsx(se,{size:"sm",variant:"outline",onClick:U,disabled:w,className:"h-7",children:w?t.jsx(Qe,{className:"w-3 h-3 animate-spin"}):t.jsx(Mr,{className:"w-3 h-3"})})]})]}),t.jsxs("div",{className:"flex justify-between text-sm",children:[t.jsx("span",{className:"text-muted-foreground",children:"Install Location"}),t.jsx("code",{className:"text-xs text-muted-foreground",children:(h==null?void 0:h.installDir)||"~/.coder-config"})]}),t.jsxs("div",{className:"flex items-center justify-between text-sm pt-2",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:"Auto-Update"}),t.jsx("p",{className:"text-xs text-muted-foreground/70",children:"Automatically install updates when available"})]}),t.jsx(_t,{checked:(r==null?void 0:r.autoUpdate)||!1,onCheckedChange:F=>{Y("autoUpdate",F),me.saveConfig({...r,autoUpdate:F}),q.success(F?"Auto-update enabled":"Auto-update disabled")}})]}),t.jsxs("div",{className:"flex items-center justify-between text-sm pt-2",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:"Release Channel"}),t.jsx("p",{className:"text-xs text-muted-foreground/70",children:(r==null?void 0:r.releaseChannel)==="beta"?t.jsxs("span",{className:"text-yellow-500 flex items-center gap-1",children:[t.jsx(Gi,{className:"w-3 h-3"}),"Beta builds may have bugs"]}):"Stable releases (recommended)"})]}),t.jsxs("select",{value:(r==null?void 0:r.releaseChannel)||"stable",onChange:F=>{const re=F.target.value;re==="beta"?E({open:!0}):(Y("releaseChannel",re),me.saveConfig({...r,releaseChannel:re}),q.success("Switched to stable releases"))},className:"bg-background border border-border rounded px-2 py-1 text-sm",children:[t.jsx("option",{value:"stable",children:"Stable"}),t.jsx("option",{value:"beta",children:"Beta"})]})]}),t.jsxs("div",{className:"border-t border-border pt-3 mt-3 space-y-2",children:[t.jsxs("div",{className:"flex justify-between text-sm",children:[t.jsx("span",{className:"text-muted-foreground",children:"Documentation"}),t.jsx("a",{href:"https://github.com/regression-io/coder-config",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"GitHub"})]}),t.jsxs("div",{className:"flex justify-between text-sm",children:[t.jsx("span",{className:"text-muted-foreground",children:"What's New"}),t.jsxs("button",{onClick:X,className:"text-primary hover:underline flex items-center gap-1",children:[t.jsx(Au,{className:"w-3 h-3"}),"Changelog"]})]}),t.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["After updating, restart the server with ",t.jsx("code",{className:"bg-muted-foreground/10 px-1 rounded",children:"coder-config ui"})]})]})]})]})]})]}),t.jsx(wx,{open:c.open,onOpenChange:F=>d(re=>({...re,open:F})),onSelect:F=>{if(c.field==="toolsDirs"){const re=(r==null?void 0:r.toolsDirs)||(r!=null&&r.toolsDir?[r.toolsDir]:[]);if(c.index===-1)s(de=>{const{toolsDir:ue,...J}=de;return{...J,toolsDirs:[...re,F]}});else{const de=[...re];de[c.index]=F,s(ue=>{const{toolsDir:J,...H}=ue;return{...H,toolsDirs:de}})}}else c.field&&Y(c.field,F)},type:c.type,initialPath:c.field==="toolsDirs"&&c.index>=0?((r==null?void 0:r.toolsDirs)||(r!=null&&r.toolsDir?[r.toolsDir]:[]))[c.index]||"~":(r==null?void 0:r[c.field])||"~",title:c.type==="directory"?"Select Directory":"Select File"}),t.jsx(bt,{open:b.open,onOpenChange:F=>k(re=>({...re,open:F})),children:t.jsxs(ft,{className:"max-w-2xl max-h-[80vh] flex flex-col overflow-hidden",children:[t.jsx(mt,{className:"flex-shrink-0",children:t.jsxs(pt,{className:"flex items-center gap-2",children:[t.jsx(Au,{className:"w-5 h-5"}),"Changelog"]})}),b.loading?t.jsx("div",{className:"flex items-center justify-center py-12",children:t.jsx(Qe,{className:"w-6 h-6 animate-spin text-primary"})}):t.jsx(Xs,{className:"h-[60vh]",children:t.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none pr-4",children:t.jsx(cH,{components:{h1:({children:F})=>t.jsx("h1",{className:"text-xl font-bold text-foreground mb-4",children:F}),h2:({children:F})=>t.jsx("h2",{className:"text-lg font-semibold text-foreground mt-6 mb-3 pb-2 border-b border-border",children:F}),h3:({children:F})=>t.jsx("h3",{className:"text-base font-medium text-foreground mt-4 mb-2",children:F}),p:({children:F})=>t.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:F}),ul:({children:F})=>t.jsx("ul",{className:"text-sm text-muted-foreground list-disc pl-5 mb-3 space-y-1",children:F}),li:({children:F})=>t.jsx("li",{className:"text-sm",children:F}),code:({children:F})=>t.jsx("code",{className:"bg-muted px-1 py-0.5 rounded text-xs font-mono",children:F}),hr:()=>t.jsx("hr",{className:"my-4 border-border"}),strong:({children:F})=>t.jsx("strong",{className:"font-semibold text-foreground",children:F})},children:b.content})})})]})}),t.jsx(bt,{open:N.open,onOpenChange:F=>P(re=>({...re,open:F})),children:t.jsxs(ft,{className:"max-w-md",children:[t.jsxs(mt,{children:[t.jsxs(pt,{className:"flex items-center gap-2 text-yellow-600 dark:text-yellow-400",children:[t.jsx(Gi,{className:"w-5 h-5"}),"Experimental Feature Warning"]}),t.jsx(rr,{className:"pt-2",children:t.jsxs("div",{className:"space-y-3 text-sm text-muted-foreground",children:[t.jsxs("p",{children:[t.jsx("strong",{className:"text-foreground",children:"Ralph Loops"})," is an experimental feature that enables autonomous development loops with Claude Code."]}),t.jsxs("div",{className:"bg-yellow-500/10 border border-yellow-500/20 rounded-lg p-3",children:[t.jsx("p",{className:"text-yellow-700 dark:text-yellow-300 font-medium mb-2",children:"Please be aware:"}),t.jsxs("ul",{className:"list-disc pl-4 space-y-1 text-yellow-600 dark:text-yellow-400",children:[t.jsx("li",{children:"This feature runs Claude autonomously with minimal intervention"}),t.jsx("li",{children:"It may make many API calls and incur costs"}),t.jsx("li",{children:"Always review generated code before committing"}),t.jsx("li",{children:"This feature may change or be removed in future versions"})]})]}),t.jsx("p",{children:"Do you want to enable Ralph Loops?"})]})})]}),t.jsxs(kt,{className:"gap-2 sm:gap-0",children:[t.jsx(se,{variant:"outline",onClick:()=>P({open:!1,feature:null}),children:"Cancel"}),t.jsxs(se,{variant:"default",className:"bg-yellow-600 hover:bg-yellow-700 text-white",onClick:()=>{const F={...r,experimental:{...r==null?void 0:r.experimental,ralphLoops:!0}};s(F),me.saveConfig(F),e==null||e(F),q.success("Ralph Loops enabled"),P({open:!1,feature:null})},children:[t.jsx(Sm,{className:"w-4 h-4 mr-2"}),"Enable Feature"]})]})]})}),t.jsx(bt,{open:A.open,onOpenChange:F=>E({open:F}),children:t.jsxs(ft,{className:"max-w-md",children:[t.jsxs(mt,{children:[t.jsxs(pt,{className:"flex items-center gap-2 text-red-600 dark:text-red-400",children:[t.jsx(Gi,{className:"w-5 h-5"}),"Switch to Beta Channel?"]}),t.jsx(rr,{className:"pt-2",children:t.jsxs("div",{className:"space-y-3 text-sm text-muted-foreground",children:[t.jsxs("p",{children:["You are about to switch to ",t.jsx("strong",{className:"text-foreground",children:"beta releases"}),"."]}),t.jsxs("div",{className:"bg-red-500/10 border border-red-500/20 rounded-lg p-3",children:[t.jsx("p",{className:"text-red-700 dark:text-red-300 font-medium mb-2",children:"Warning:"}),t.jsxs("ul",{className:"list-disc pl-4 space-y-1 text-red-600 dark:text-red-400",children:[t.jsxs("li",{children:[t.jsx("strong",{children:"Things may break"})," - beta releases are not fully tested"]}),t.jsxs("li",{children:[t.jsx("strong",{children:"Data loss possible"})," - bugs could corrupt your configuration"]}),t.jsxs("li",{children:[t.jsx("strong",{children:"Frequent changes"})," - behavior may change unexpectedly"]}),t.jsxs("li",{children:[t.jsx("strong",{children:"No rollback"})," - you'll need to manually downgrade if issues occur"]})]})]}),t.jsx("p",{className:"text-yellow-600 dark:text-yellow-400",children:"Only enable this if you're comfortable debugging issues and reporting bugs."})]})})]}),t.jsxs(kt,{className:"gap-2 sm:gap-0",children:[t.jsx(se,{variant:"outline",onClick:()=>E({open:!1}),children:"Stay on Stable"}),t.jsxs(se,{variant:"destructive",onClick:()=>{Y("releaseChannel","beta"),me.saveConfig({...r,releaseChannel:"beta"}),q.warning("Switched to beta releases - expect bugs!"),E({open:!1})},children:[t.jsx(Gi,{className:"w-4 h-4 mr-2"}),"Switch to Beta"]})]})]})})]})}function pH(){const[e,r]=_.useState(null),[s,n]=_.useState({}),[o,c]=_.useState(!0);_.useEffect(()=>{d()},[]);const d=async()=>{try{c(!0);const[u,f]=await Promise.all([me.getClaudeSettings(),me.getRegistry()]);r(u.settings),n(f.mcpServers||{})}catch(u){console.error("Failed to load Claude settings:",u)}finally{c(!1)}},l=async u=>{try{await me.saveClaudeSettings(u),r(u),q.success("Claude Code settings saved!")}catch(f){q.error("Failed to save settings: "+f.message)}};return o?t.jsx("div",{className:"flex items-center justify-center h-64",children:t.jsx(Qe,{className:"w-8 h-8 animate-spin text-indigo-600"})}):t.jsxs("div",{className:"space-y-6",children:[t.jsx("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 p-6 shadow-sm",children:t.jsx(kN,{settings:e,onSave:l,loading:o,settingsPath:"~/.claude/settings.json",mcpServers:s})}),t.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-4 border border-transparent dark:border-slate-800",children:[t.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:"CLI Commands"}),t.jsxs("div",{className:"space-y-1 text-sm text-gray-600 dark:text-slate-400 font-mono",children:[t.jsx("p",{children:"coder-config init # Initialize project"}),t.jsx("p",{children:"coder-config apply # Generate .mcp.json from config"}),t.jsx("p",{children:"coder-config show # Show current project config"})]})]})]})}function gH(){const[e,r]=_.useState(null),[s,n]=_.useState(!0);_.useEffect(()=>{o()},[]);const o=async()=>{try{n(!0);const d=await me.getGeminiSettings();r(d.settings)}catch(d){console.error("Failed to load Gemini settings:",d)}finally{n(!1)}},c=async d=>{try{await me.saveGeminiSettings(d),r(d),q.success("Gemini CLI settings saved!")}catch(l){q.error("Failed to save settings: "+l.message)}};return s?t.jsx("div",{className:"flex items-center justify-center h-64",children:t.jsx(Qe,{className:"w-8 h-8 animate-spin text-blue-600"})}):t.jsxs("div",{className:"space-y-6",children:[t.jsx("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 p-6 shadow-sm",children:t.jsx(jN,{settings:e,onSave:c,loading:s,settingsPath:"~/.gemini/settings.json"})}),t.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-4 border border-transparent dark:border-slate-800",children:[t.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:"CLI Commands"}),t.jsxs("div",{className:"space-y-1 text-sm text-gray-600 dark:text-slate-400 font-mono",children:[t.jsx("p",{children:"coder-config apply # Generate settings for all tools"}),t.jsx("p",{children:"coder-config apply --gemini # Generate Gemini settings only"})]})]})]})}const xH=[{id:"off",name:"Off",description:"Never auto-execute; requires allow list"},{id:"auto",name:"Auto",description:"Safety model determines execution"},{id:"turbo",name:"Turbo",description:"Auto-execute unless in deny list",dangerous:!0}],vH=[{id:"always-proceed",name:"Always Proceed",description:"Agent never requests review"},{id:"agent-decides",name:"Agent Decides",description:"Agent determines when review is needed"},{id:"request-review",name:"Request Review",description:"Agent always requests review"}],yH=[{id:"always-proceed",name:"Always Proceed",description:"Maximum autonomy",dangerous:!0},{id:"request-review",name:"Request Review",description:"Ask before browser JavaScript"},{id:"disabled",name:"Disabled",description:"Never run browser JavaScript"}];function bH({settings:e,onSave:r,loading:s,settingsPath:n}){const[o,c]=_.useState(e||{}),[d,l]=_.useState(!1),[u,f]=_.useState("rich"),[m,h]=_.useState(JSON.stringify(e||{},null,2)),[g,w]=_.useState({open:!1,name:"",json:""}),[j,S]=_.useState({}),v=async()=>{l(!0);try{if(u==="json")try{const A=JSON.parse(m);await r(A),c(A)}catch{q.error("Invalid JSON"),l(!1);return}else await r(o),h(JSON.stringify(o,null,2));q.success("Settings saved")}finally{l(!1)}},y=(A,E)=>{c(M=>({...M,[A]:E}))},x=(A,E)=>(o==null?void 0:o[A])??E,b=o.mcpServers||{},k=()=>{const{name:A,json:E}=g;if(!A.trim()){q.error("Please enter a name for the MCP");return}let M;try{M=JSON.parse(E)}catch{q.error("Invalid JSON configuration");return}if(!M.command){q.error('MCP config must have a "command" field');return}c(D=>({...D,mcpServers:{...D.mcpServers,[A.trim()]:M}})),w({open:!1,name:"",json:""}),q.success(`Added MCP: ${A}`)},N=A=>{c(E=>{const{[A]:M,...D}=E.mcpServers||{};return{...E,mcpServers:D}}),q.success(`Removed MCP: ${A}`)},P=A=>{S(E=>({...E,[A]:!E[A]}))};return t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-10 h-10 rounded-lg bg-purple-500/10 flex items-center justify-center",children:t.jsx(Ac,{className:"w-5 h-5 text-purple-500"})}),t.jsxs("div",{children:[t.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:["Antigravity Settings",t.jsx(tt,{variant:"outline",className:"text-xs font-normal text-purple-600 border-purple-300 dark:border-purple-700",children:"Google"})]}),t.jsxs("p",{className:"text-sm text-muted-foreground",children:["Stored in: ",t.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-xs",children:n})]})]})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("div",{className:"flex bg-muted rounded-lg p-1",children:[t.jsx("button",{className:`px-3 py-1 text-sm rounded-md transition-colors ${u==="rich"?"bg-background shadow-sm":"text-muted-foreground hover:text-foreground"}`,onClick:()=>f("rich"),children:"Settings"}),t.jsx("button",{className:`px-3 py-1 text-sm rounded-md transition-colors ${u==="json"?"bg-background shadow-sm":"text-muted-foreground hover:text-foreground"}`,onClick:()=>{h(JSON.stringify(o,null,2)),f("json")},children:"JSON"})]}),t.jsxs(se,{onClick:v,disabled:d||s,children:[d?t.jsx(Qe,{className:"w-4 h-4 mr-2 animate-spin"}):t.jsx(bs,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),u==="json"?t.jsx("div",{className:"border border-border rounded-lg bg-card overflow-hidden",children:t.jsx(ht,{value:m,onChange:A=>h(A.target.value),className:"font-mono text-sm min-h-[500px] border-0 rounded-none resize-none",placeholder:"{ }"})}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[t.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[t.jsx(Qn,{className:"w-4 h-4 text-purple-500"}),"Security Policies"]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium text-foreground",children:"Terminal Command Execution"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Control how the agent executes shell commands"})]}),t.jsxs(kr,{value:x("terminalPolicy","auto"),onValueChange:A=>y("terminalPolicy",A),children:[t.jsx(yr,{className:"w-44",children:t.jsx(jr,{})}),t.jsx(br,{children:xH.map(A=>t.jsx(Mt,{value:A.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{children:A.name}),A.dangerous&&t.jsx(tt,{variant:"destructive",className:"text-xs",children:"Risk"})]})},A.id))})]})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium text-foreground",children:"Review Policy"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"When the agent should request human review"})]}),t.jsxs(kr,{value:x("reviewPolicy","agent-decides"),onValueChange:A=>y("reviewPolicy",A),children:[t.jsx(yr,{className:"w-44",children:t.jsx(jr,{})}),t.jsx(br,{children:vH.map(A=>t.jsx(Mt,{value:A.id,children:A.name},A.id))})]})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium text-foreground",children:"JavaScript Execution"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Control browser JavaScript execution"})]}),t.jsxs(kr,{value:x("jsPolicy","request-review"),onValueChange:A=>y("jsPolicy",A),children:[t.jsx(yr,{className:"w-44",children:t.jsx(jr,{})}),t.jsx(br,{children:yH.map(A=>t.jsx(Mt,{value:A.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{children:A.name}),A.dangerous&&t.jsx(tt,{variant:"destructive",className:"text-xs",children:"Risk"})]})},A.id))})]})]})]})]}),t.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsxs("h3",{className:"text-sm font-medium text-foreground flex items-center gap-2",children:[t.jsx(ys,{className:"w-4 h-4 text-purple-500"}),"MCP Servers",t.jsx(tt,{variant:"secondary",className:"text-xs",children:Object.keys(b).length})]}),t.jsxs(se,{size:"sm",variant:"outline",onClick:()=>w({open:!0,name:"",json:`{
|
|
644
644
|
"command": "npx",
|
|
645
645
|
"args": ["-y", "@example/mcp-server"]
|
|
646
646
|
}`}),children:[t.jsx(It,{className:"w-4 h-4 mr-1"}),"Add MCP"]})]}),t.jsx("div",{className:"space-y-2",children:Object.keys(b).length===0?t.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No MCP servers configured"}):Object.entries(b).map(([A,E])=>t.jsxs(Hc,{open:j[A],onOpenChange:()=>P(A),children:[t.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border bg-background group",children:[t.jsxs(Wc,{className:"flex items-center gap-2 flex-1 text-left",children:[j[A]?t.jsx(pr,{className:"w-4 h-4 text-muted-foreground"}):t.jsx(vs,{className:"w-4 h-4 text-muted-foreground"}),t.jsx(ys,{className:"w-4 h-4 text-purple-500"}),t.jsx("span",{className:"font-medium text-sm",children:A}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:E.command})]}),t.jsx(se,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 text-destructive hover:text-destructive",onClick:()=>N(A),children:t.jsx(ws,{className:"w-4 h-4"})})]}),t.jsx(Uc,{children:t.jsx("div",{className:"mt-2 ml-6 p-3 rounded-lg bg-muted/50 border",children:t.jsx("pre",{className:"text-xs font-mono text-muted-foreground overflow-x-auto",children:JSON.stringify(E,null,2)})})})]},A))})]}),t.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[t.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[t.jsx(Ji,{className:"w-4 h-4 text-purple-500"}),"Browser Settings"]}),t.jsx("div",{className:"space-y-4",children:t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium text-foreground",children:"URL Allowlist"}),t.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Domains the agent can visit (one per line)"}),t.jsx(ht,{value:x("browserAllowlist",""),onChange:A=>y("browserAllowlist",A.target.value),placeholder:`github.com
|
|
@@ -3722,6 +3722,6 @@ Everything you can do in the UI, you can do from the command line. Some power us
|
|
|
3722
3722
|
Thanks for using Coder Config. The goal is to make AI coding assistants work the way you want them to, without the friction of scattered configuration files and forgotten context. Hopefully this tool helps.
|
|
3723
3723
|
|
|
3724
3724
|
Happy coding.
|
|
3725
|
-
`}},JW={...$W,...zW,...HW,...WW,...UW,...VW,...GW,...qW,...KW,...YW,...XW},uu={welcome:{bg:"bg-violet-500",light:"bg-violet-100 dark:bg-violet-950",text:"text-violet-600 dark:text-violet-400"},"first-project":{bg:"bg-blue-500",light:"bg-blue-100 dark:bg-blue-950",text:"text-blue-600 dark:text-blue-400"},"rules-guide":{bg:"bg-emerald-500",light:"bg-emerald-100 dark:bg-emerald-950",text:"text-emerald-600 dark:text-emerald-400"},"mcp-guide":{bg:"bg-orange-500",light:"bg-orange-100 dark:bg-orange-950",text:"text-orange-600 dark:text-orange-400"},"permissions-guide":{bg:"bg-green-500",light:"bg-green-100 dark:bg-green-950",text:"text-green-600 dark:text-green-400"},"memory-guide":{bg:"bg-pink-500",light:"bg-pink-100 dark:bg-pink-950",text:"text-pink-600 dark:text-pink-400"},"plugins-guide":{bg:"bg-purple-500",light:"bg-purple-100 dark:bg-purple-950",text:"text-purple-600 dark:text-purple-400"},"workstreams-guide":{bg:"bg-cyan-500",light:"bg-cyan-100 dark:bg-cyan-950",text:"text-cyan-600 dark:text-cyan-400"},"loops-guide":{bg:"bg-teal-500",light:"bg-teal-100 dark:bg-teal-950",text:"text-teal-600 dark:text-teal-400"},"multi-tool-guide":{bg:"bg-amber-500",light:"bg-amber-100 dark:bg-amber-950",text:"text-amber-600 dark:text-amber-400"},"next-steps":{bg:"bg-rose-500",light:"bg-rose-100 dark:bg-rose-950",text:"text-rose-600 dark:text-rose-400"}},E_="claude-config-tutorial-visited",rp="claude-config-tutorial-active";function QW(){const[e,r]=_.useState(()=>{try{return localStorage.getItem(rp)||"intro"}catch{return"intro"}}),[s,n]=_.useState(()=>{try{const b=localStorage.getItem(rp)||"intro",k={welcome:!0};for(const N of Ta)N.subsections.some(P=>P.id===b)&&(k[N.id]=!0);return k}catch{return{welcome:!0}}}),[o,c]=_.useState(()=>{try{return JSON.parse(localStorage.getItem(E_)||"[]")}catch{return[]}}),d=_.useRef(null);_.useEffect(()=>{if(d.current){const b=d.current.querySelector("[data-radix-scroll-area-viewport]");b&&(b.scrollTop=0)}},[e]),_.useEffect(()=>{if(e&&(localStorage.setItem(rp,e),!o.includes(e))){const b=[...o,e];c(b),localStorage.setItem(E_,JSON.stringify(b))}},[e,o]);const l=b=>{n(k=>({...k,[b]:!k[b]}))},u=JW[e],f=Ta.flatMap(b=>b.subsections.length>0?b.subsections.map(k=>k.id):[b.id]),m=f.indexOf(e),h=m>0?f[m-1]:null,g=m<f.length-1?f[m+1]:null,w=Math.round(o.length/f.length*100),S=(()=>{for(const b of Ta)if(b.id===e||b.subsections.some(k=>k.id===e))return b;return Ta[0]})(),v=uu[S.id]||uu.welcome,y=b=>{for(const k of Ta){if(k.id===b)return k.title;const N=k.subsections.find(P=>P.id===b);if(N)return N.title}return""},x=b=>({__html:T2(b)});return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:"w-72 border-r border-border bg-muted/30 flex flex-col",children:[t.jsxs("div",{className:"p-4 border-b border-border bg-gradient-to-r from-indigo-500/10 to-purple-500/10",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center shadow-lg",children:t.jsx(Pu,{className:"w-5 h-5 text-white"})}),t.jsxs("div",{children:[t.jsx("h2",{className:"font-semibold text-foreground",children:"Tutorial"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Step-by-step guide"})]})]}),t.jsxs("div",{className:"mt-3",children:[t.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground mb-1",children:[t.jsx("span",{children:"Progress"}),t.jsxs("span",{children:[w,"% complete"]})]}),t.jsx(F2,{value:w,className:"h-2"})]})]}),t.jsx(Xs,{className:"flex-1",children:t.jsx("div",{className:"p-2",children:Ta.map((b,k)=>{const N=b.icon,P=uu[b.id]||uu.welcome,A=e===b.id||b.subsections.some(M=>M.id===e),E=b.subsections.length>0?b.subsections.every(M=>o.includes(M.id)):o.includes(b.id);return t.jsxs("div",{className:"mb-1",children:[t.jsxs("button",{className:Ne("w-full flex items-center gap-2 px-3 py-2.5 text-sm rounded-lg hover:bg-accent text-left transition-all",A&&"bg-accent"),onClick:()=>{b.subsections.length>0?(l(b.id),s[b.id]||r(b.subsections[0].id)):r(b.id)},children:[t.jsx("span",{className:Ne("w-7 h-7 rounded-lg flex items-center justify-center transition-colors",A?P.bg+" text-white":P.light),children:E?t.jsx(Oo,{className:"w-4 h-4"}):t.jsx(N,{className:Ne("w-4 h-4",!A&&P.text)})}),t.jsx("span",{className:Ne("flex-1",A&&"font-medium"),children:b.title}),b.subsections.length>0&&t.jsx(vs,{className:Ne("w-4 h-4 text-muted-foreground transition-transform",s[b.id]&&"rotate-90")})]}),b.subsections.length>0&&s[b.id]&&t.jsx("div",{className:"ml-4 mt-1 space-y-0.5 border-l-2 border-border pl-3",children:b.subsections.map(M=>{const D=e===M.id,O=o.includes(M.id);return t.jsxs("button",{className:Ne("w-full text-left px-3 py-1.5 text-sm rounded-md hover:bg-accent text-foreground flex items-center gap-2",D&&"bg-accent font-medium",D&&P.text),onClick:()=>r(M.id),children:[O&&!D&&t.jsx(Oo,{className:"w-3 h-3 text-green-500"}),t.jsx("span",{className:Ne(!O&&!D&&"ml-5"),children:M.title})]},M.id)})})]},b.id)})})})]}),t.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[t.jsx("div",{className:Ne("px-8 py-4 border-b border-border",v.light),children:t.jsxs("div",{className:"max-w-3xl mx-auto flex items-center gap-3",children:[t.jsx("div",{className:Ne("w-10 h-10 rounded-xl flex items-center justify-center",v.bg,"text-white"),children:t.jsx(S.icon,{className:"w-5 h-5"})}),t.jsxs("div",{children:[t.jsx("p",{className:Ne("text-sm font-medium",v.text),children:S.title}),t.jsx("h1",{className:"text-lg font-semibold text-foreground",children:(u==null?void 0:u.title)||y(e)})]})]})}),t.jsx(Xs,{className:"flex-1",ref:d,children:t.jsx("div",{className:"max-w-3xl mx-auto p-8",children:u?t.jsx("div",{className:"prose prose-sm max-w-none dark:prose-invert prose-headings:text-foreground prose-p:text-muted-foreground prose-strong:text-foreground [&_:not(pre)>code]:text-primary [&_:not(pre)>code]:bg-muted [&_:not(pre)>code]:px-1 [&_:not(pre)>code]:py-0.5 [&_:not(pre)>code]:rounded [&_pre]:bg-zinc-900 [&_pre]:text-zinc-100 [&_pre]:border [&_pre]:border-zinc-700 [&_pre_code]:text-zinc-100 [&_pre_code]:bg-transparent [&_pre_code]:p-0",dangerouslySetInnerHTML:x(u.content)}):t.jsxs("div",{className:"text-center text-muted-foreground py-12",children:[t.jsx(Pu,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),t.jsx("p",{children:"Select a topic from the sidebar"})]})})}),t.jsx("div",{className:"border-t border-border p-4 bg-muted/30",children:t.jsxs("div",{className:"max-w-3xl mx-auto flex items-center justify-between",children:[h?t.jsxs(se,{variant:"ghost",onClick:()=>r(h),className:"flex items-center gap-2",children:[t.jsx(F5,{className:"w-4 h-4"}),t.jsx("span",{className:"max-w-[150px] truncate",children:y(h)})]}):t.jsx("div",{}),t.jsxs("span",{className:"text-xs text-muted-foreground",children:[m+1," of ",f.length]}),g?t.jsxs(se,{onClick:()=>r(g),className:Ne("flex items-center gap-2",v.bg,"hover:opacity-90"),children:[t.jsx("span",{className:"max-w-[150px] truncate",children:y(g)}),t.jsx(Dg,{className:"w-4 h-4"})]}):t.jsx(se,{variant:"outline",onClick:()=>r("intro"),className:"flex items-center gap-2",children:"Start Over"})]})})]})]})}function ZW(){const[e,r]=_.useState(null),[s,n]=_.useState(!0),[o,c]=_.useState(!1),[d,l]=_.useState(!1),[u,f]=_.useState(!1),[m,h]=_.useState(null);_.useEffect(()=>{g()},[]);const g=async()=>{try{n(!0);const k=await me.getSessionStatus();r(k)}catch{q.error("Failed to load session status")}finally{n(!1)}},w=async()=>{var k,N;c(!0);try{const P=await me.installSessionAll();P.success?(q.success("Session persistence installed!"),g()):q.error(((k=P.hooks)==null?void 0:k.error)||((N=P.command)==null?void 0:N.error)||"Installation failed")}catch{q.error("Installation failed")}finally{c(!1)}},j=async()=>{c(!0);try{const k=await me.installSessionHooks();k.success?(q.success("Session hooks installed!"),g()):q.error(k.error||"Failed to install hooks")}catch{q.error("Failed to install hooks")}finally{c(!1)}},S=async()=>{c(!0);try{const k=await me.installFlushCommand();k.success?(q.success(k.alreadyInstalled?"/flush command already installed":"/flush command installed!"),g()):q.error(k.error||"Failed to install command")}catch{q.error("Failed to install command")}finally{c(!1)}},v=async()=>{l(!0);try{const k=await me.clearSessionContext();k.success?(q.success(k.cleared?"Session context cleared":"No context to clear"),g()):q.error("Failed to clear context")}catch{q.error("Failed to clear context")}finally{l(!1)}},y=async()=>{try{const k=await me.getSessionContext();h(k.content),f(!0)}catch{q.error("Failed to load context")}},x=k=>k===null?"Unknown":k<60?`${k} minutes ago`:k<1440?`${Math.floor(k/60)} hours ago`:`${Math.floor(k/1440)} days ago`;if(s)return t.jsx("div",{className:"flex items-center justify-center h-64",children:t.jsx(Qe,{className:"w-8 h-8 animate-spin text-indigo-600"})});const b=(e==null?void 0:e.hooksInstalled)&&(e==null?void 0:e.flushCommandInstalled)&&(e==null?void 0:e.permissionInstalled);return t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 p-5 shadow-sm",children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"p-2 rounded-lg bg-indigo-100 dark:bg-indigo-950",children:t.jsx(bs,{className:"w-5 h-5 text-indigo-600 dark:text-indigo-400"})}),t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Session Persistence"}),t.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:"Save and restore Claude Code session context"})]})]}),t.jsx(se,{variant:"ghost",size:"sm",onClick:g,children:t.jsx(Mr,{className:"w-4 h-4"})})]}),t.jsxs("p",{className:"text-sm text-gray-600 dark:text-slate-400",children:["Session persistence allows you to save your current Claude Code context using the ",t.jsx("code",{className:"bg-gray-100 dark:bg-slate-800 px-1.5 py-0.5 rounded text-indigo-600 dark:text-indigo-400",children:"/flush"})," command, and automatically restore it when you start a new session."]})]}),t.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[t.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-slate-700",children:t.jsx("h3",{className:"font-medium text-gray-900 dark:text-white",children:"Installation Status"})}),t.jsxs("div",{className:"divide-y divide-gray-100 dark:divide-slate-800",children:[t.jsxs("div",{className:"p-4 flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[e!=null&&e.hooksInstalled?t.jsx(Rt,{className:"w-5 h-5 text-green-500"}):t.jsx(Is,{className:"w-5 h-5 text-amber-500"}),t.jsxs("div",{children:[t.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"Session Hooks"}),t.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400",children:"Auto-restore context on session start, preserve on session end"})]})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(tt,{variant:e!=null&&e.hooksInstalled?"default":"secondary",children:e!=null&&e.hooksInstalled?"Installed":"Not Installed"}),!(e!=null&&e.hooksInstalled)&&t.jsx(se,{variant:"outline",size:"sm",onClick:j,disabled:o,children:o?t.jsx(Qe,{className:"w-4 h-4 animate-spin"}):"Install"})]})]}),t.jsxs("div",{className:"p-4 flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[e!=null&&e.flushCommandInstalled?t.jsx(Rt,{className:"w-5 h-5 text-green-500"}):t.jsx(Is,{className:"w-5 h-5 text-amber-500"}),t.jsxs("div",{children:[t.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"/flush Command"}),t.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400",children:"Adds the /flush command to save session context"})]})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(tt,{variant:e!=null&&e.flushCommandInstalled?"default":"secondary",children:e!=null&&e.flushCommandInstalled?"Installed":"Not Installed"}),!(e!=null&&e.flushCommandInstalled)&&t.jsx(se,{variant:"outline",size:"sm",onClick:S,disabled:o,children:o?t.jsx(Qe,{className:"w-4 h-4 animate-spin"}):"Install"})]})]}),t.jsxs("div",{className:"p-4 flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[e!=null&&e.permissionInstalled?t.jsx(Rt,{className:"w-5 h-5 text-green-500"}):t.jsx(Is,{className:"w-5 h-5 text-amber-500"}),t.jsxs("div",{children:[t.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"Write Permission"}),t.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400",children:"Allows Claude to write session context without prompting"})]})]}),t.jsx(tt,{variant:e!=null&&e.permissionInstalled?"default":"secondary",children:e!=null&&e.permissionInstalled?"Granted":"Not Granted"})]})]}),!b&&t.jsx("div",{className:"p-4 bg-gray-50 dark:bg-slate-900 border-t border-gray-200 dark:border-slate-800",children:t.jsxs(se,{onClick:w,disabled:o,className:"w-full bg-indigo-600 hover:bg-indigo-700 text-white",children:[o?t.jsx(Qe,{className:"w-4 h-4 mr-2 animate-spin"}):t.jsx(xi,{className:"w-4 h-4 mr-2"}),"Install All"]})})]}),t.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[t.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-slate-700 flex items-center justify-between",children:[t.jsx("h3",{className:"font-medium text-gray-900 dark:text-white",children:"Saved Context"}),(e==null?void 0:e.hasSavedContext)&&t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(se,{variant:"outline",size:"sm",onClick:y,children:[t.jsx(zr,{className:"w-4 h-4 mr-2"}),"View"]}),t.jsx(se,{variant:"outline",size:"sm",onClick:v,disabled:d,className:"text-red-600 hover:text-red-700 hover:bg-red-50 dark:hover:bg-red-950",children:d?t.jsx(Qe,{className:"w-4 h-4 animate-spin"}):t.jsx(ws,{className:"w-4 h-4"})})]})]}),t.jsx("div",{className:"p-4",children:e!=null&&e.hasSavedContext?t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[t.jsx(oc,{className:"w-4 h-4 text-gray-400"}),t.jsx("span",{className:"text-gray-600 dark:text-slate-400",children:"Last saved:"}),t.jsx("span",{className:"text-gray-900 dark:text-white",children:x(e.contextAge)})]}),e.contextPreview&&t.jsx("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-3",children:t.jsx("pre",{className:"text-xs text-gray-600 dark:text-slate-400 whitespace-pre-wrap overflow-hidden",children:e.contextPreview})}),t.jsxs("div",{className:"text-xs text-gray-500 dark:text-slate-500",children:["Storage: ",e.sessionDir]})]}):t.jsxs("div",{className:"text-center py-6",children:[t.jsx(bs,{className:"w-12 h-12 text-gray-300 dark:text-slate-600 mx-auto mb-3"}),t.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400",children:"No saved context"}),t.jsxs("p",{className:"text-xs text-gray-400 dark:text-slate-500 mt-1",children:["Use ",t.jsx("code",{className:"bg-gray-100 dark:bg-slate-800 px-1 rounded",children:"/flush"})," in Claude Code to save your session"]})]})})]}),(e==null?void 0:e.lastSession)&&t.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[t.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-slate-700",children:t.jsx("h3",{className:"font-medium text-gray-900 dark:text-white",children:"Last Session"})}),t.jsxs("div",{className:"p-4 space-y-2",children:[e.lastSession.session_id&&t.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[t.jsx("span",{className:"text-gray-500 dark:text-slate-400 w-20",children:"ID:"}),t.jsx("code",{className:"text-xs bg-gray-100 dark:bg-slate-800 px-2 py-0.5 rounded",children:e.lastSession.session_id})]}),e.lastSession.cwd&&t.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[t.jsx("span",{className:"text-gray-500 dark:text-slate-400 w-20",children:"Directory:"}),t.jsx("span",{className:"text-gray-900 dark:text-white font-mono text-xs",children:e.lastSession.cwd})]}),e.lastSession.timestamp&&t.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[t.jsx("span",{className:"text-gray-500 dark:text-slate-400 w-20",children:"Ended:"}),t.jsx("span",{className:"text-gray-900 dark:text-white",children:e.lastSession.timestamp})]}),e.lastSession.reason&&t.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[t.jsx("span",{className:"text-gray-500 dark:text-slate-400 w-20",children:"Reason:"}),t.jsx(tt,{variant:"secondary",children:e.lastSession.reason})]})]})]}),t.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-4 border border-transparent dark:border-slate-800",children:[t.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:"How to Use"}),t.jsxs("ol",{className:"space-y-2 text-sm text-gray-600 dark:text-slate-400",children:[t.jsxs("li",{className:"flex gap-2",children:[t.jsx("span",{className:"font-medium text-indigo-600 dark:text-indigo-400",children:"1."}),"Install session hooks and the /flush command above"]}),t.jsxs("li",{className:"flex gap-2",children:[t.jsx("span",{className:"font-medium text-indigo-600 dark:text-indigo-400",children:"2."}),"Use ",t.jsx("code",{className:"bg-white dark:bg-slate-800 px-1.5 py-0.5 rounded",children:"/flush"})," in Claude Code before ending a session"]}),t.jsxs("li",{className:"flex gap-2",children:[t.jsx("span",{className:"font-medium text-indigo-600 dark:text-indigo-400",children:"3."}),"Your context is automatically restored when you start a new session"]})]})]}),t.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-4 border border-transparent dark:border-slate-800",children:[t.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:"CLI Commands"}),t.jsxs("div",{className:"space-y-1 text-sm text-gray-600 dark:text-slate-400 font-mono",children:[t.jsx("p",{children:"coder-config session # Show session status"}),t.jsx("p",{children:"coder-config session install-hooks # Install session hooks"}),t.jsx("p",{children:"coder-config session clear # Clear saved context"})]})]}),t.jsx(bt,{open:u,onOpenChange:f,children:t.jsxs(ft,{className:"max-w-2xl max-h-[80vh] overflow-hidden flex flex-col",children:[t.jsxs(mt,{children:[t.jsx(pt,{children:"Saved Context"}),t.jsx(rr,{children:"This context will be restored on your next Claude Code session"})]}),t.jsx("div",{className:"flex-1 overflow-auto py-4",children:t.jsx("pre",{className:"text-sm text-gray-700 dark:text-slate-300 whitespace-pre-wrap bg-gray-50 dark:bg-slate-900 p-4 rounded-lg",children:m||"No content"})}),t.jsx(kt,{children:t.jsx(se,{variant:"ghost",onClick:()=>f(!1),children:"Close"})})]})})]})}const eU=[{id:"model",label:"Model Name",preview:"claude-opus-4-6"},{id:"context-bar",label:"Context Bar",preview:"●●●●○○○○○○ 37%",hasStyle:!0},{id:"ctx-pct",label:"Context %",preview:"37% ctx"},{id:"ctx-tokens",label:"Token Counts",preview:"74.4K/200.0K"},{id:"ctx-remaining",label:"Context Remaining",preview:"63% ctx left"},{id:"lines-changed",label:"Lines Changed",preview:"+146 -13"},{id:"git-branch",label:"Git Branch",preview:"main"},{id:"duration",label:"Duration",preview:"5h 32m"},{id:"cost",label:"Cost (API equiv.)",preview:"$0.142"}],Jp={prefix:"* ",separator:" | ",blocks:[{id:"model",enabled:!0},{id:"context-bar",enabled:!0,style:"dots"},{id:"ctx-pct",enabled:!1},{id:"ctx-tokens",enabled:!1},{id:"ctx-remaining",enabled:!1},{id:"lines-changed",enabled:!1},{id:"git-branch",enabled:!1},{id:"duration",enabled:!1},{id:"cost",enabled:!1}]};function tU(e){const{prefix:r="* ",separator:s=" | ",blocks:n=[]}=e,o=[];for(const c of n.filter(d=>d.enabled))switch(c.id){case"model":o.push("claude-opus-4-6");break;case"context-bar":{const d=c.style==="blocks"?"█":"●",l=c.style==="blocks"?"░":"○";o.push(`ctx ${d.repeat(4)}${l.repeat(6)} 37%`);break}case"ctx-pct":o.push("37% ctx");break;case"ctx-tokens":o.push("74.4K/200.0K");break;case"ctx-remaining":o.push("63% ctx left");break;case"lines-changed":o.push("+146 -13");break;case"git-branch":o.push("main");break;case"duration":o.push("5h 32m");break;case"cost":o.push("$0.142");break}return o.length?r+o.join(s):"(empty)"}function Qp(e){const{prefix:r="* ",separator:s=" | ",blocks:n=[]}=e,o=n.filter(f=>f.enabled),c=["#!/bin/bash",`# CONFIG: ${JSON.stringify(e)}`,"input=$(cat)"],d=f=>o.some(m=>m.id===f);d("model")&&c.push(`MODEL=$(echo "$input" | jq -r '.model.display_name // "?"')`),(d("context-bar")||d("ctx-pct")||d("ctx-remaining"))&&c.push(`PCT=$(echo "$input" | jq -r '.context_window.used_percentage // 0' | cut -d. -f1)`),d("ctx-remaining")&&c.push(`REM=$(echo "$input" | jq -r '.context_window.remaining_percentage // 0' | cut -d. -f1)`),d("ctx-tokens")&&(c.push(`CTX_USED=$(echo "$input" | jq -r '((.context_window.current_usage.input_tokens // 0) + (.context_window.current_usage.cache_creation_input_tokens // 0) + (.context_window.current_usage.cache_read_input_tokens // 0))')`),c.push(`CTX_MAX=$(echo "$input" | jq -r '.context_window.context_window_size // 200000')`),c.push('CTX_K=$(awk "BEGIN {printf \\"%.1fK\\", $CTX_USED/1000}")'),c.push('MAX_K=$(awk "BEGIN {printf \\"%.1fK\\", $CTX_MAX/1000}")')),d("lines-changed")&&(c.push(`LINES_ADD=$(echo "$input" | jq -r '.cost.total_lines_added // 0')`),c.push(`LINES_REM=$(echo "$input" | jq -r '.cost.total_lines_removed // 0')`)),d("duration")&&(c.push(`DUR_MS=$(echo "$input" | jq -r '.cost.total_duration_ms // 0')`),c.push("HOURS=$((DUR_MS / 3600000)); MINS=$(((DUR_MS % 3600000) / 60000)); SECS=$(((DUR_MS % 60000) / 1000))")),d("cost")&&(c.push(`COST=$(echo "$input" | jq -r '.cost.total_cost_usd // 0')`),c.push("COST_FMT=$(printf '$%.3f' $COST)")),d("git-branch")&&c.push("BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo '')");const l=o.find(f=>f.id==="context-bar");if(l){const f=l.style==="blocks"?"█":"●",m=l.style==="blocks"?"░":"○";c.push("FILLED=$((PCT / 10)); EMPTY=$((10 - FILLED))"),c.push(`BAR=""; for ((i=0; i<FILLED; i++)); do BAR="$BAR${f}"; done`),c.push(` for ((i=0; i<EMPTY; i++)); do BAR="$BAR${m}"; done`)}let u=!0;for(const f of o){const m=(h,g)=>{u?(c.push(`OUT="${r}${h}"`),u=!1):g?c.push(`${g} && OUT="$OUT${s}${h}"`):c.push(`OUT="$OUT${s}${h}"`)};switch(f.id){case"model":m("$MODEL");break;case"context-bar":m("ctx $BAR $PCT%");break;case"ctx-pct":m("$PCT% ctx");break;case"ctx-tokens":m("$CTX_K/$MAX_K");break;case"ctx-remaining":m("$REM% ctx left");break;case"lines-changed":m("+$LINES_ADD -$LINES_REM",'[ "$LINES_ADD" != "0" ] || [ "$LINES_REM" != "0" ]');break;case"git-branch":m("$BRANCH",'[ -n "$BRANCH" ]');break;case"duration":u?(c.push(`[ "$HOURS" -gt 0 ] && OUT="${r}\${HOURS}h \${MINS}m" || OUT="${r}\${MINS}m \${SECS}s"`),u=!1):c.push(`[ "$HOURS" -gt 0 ] && OUT="$OUT${s}\${HOURS}h \${MINS}m" || OUT="$OUT${s}\${MINS}m \${SECS}s"`);break;case"cost":m("$COST_FMT");break}}return u&&c.push('OUT=""'),c.push('echo "$OUT"'),c.join(`
|
|
3725
|
+
`}},JW={...$W,...zW,...HW,...WW,...UW,...VW,...GW,...qW,...KW,...YW,...XW},uu={welcome:{bg:"bg-violet-500",light:"bg-violet-100 dark:bg-violet-950",text:"text-violet-600 dark:text-violet-400"},"first-project":{bg:"bg-blue-500",light:"bg-blue-100 dark:bg-blue-950",text:"text-blue-600 dark:text-blue-400"},"rules-guide":{bg:"bg-emerald-500",light:"bg-emerald-100 dark:bg-emerald-950",text:"text-emerald-600 dark:text-emerald-400"},"mcp-guide":{bg:"bg-orange-500",light:"bg-orange-100 dark:bg-orange-950",text:"text-orange-600 dark:text-orange-400"},"permissions-guide":{bg:"bg-green-500",light:"bg-green-100 dark:bg-green-950",text:"text-green-600 dark:text-green-400"},"memory-guide":{bg:"bg-pink-500",light:"bg-pink-100 dark:bg-pink-950",text:"text-pink-600 dark:text-pink-400"},"plugins-guide":{bg:"bg-purple-500",light:"bg-purple-100 dark:bg-purple-950",text:"text-purple-600 dark:text-purple-400"},"workstreams-guide":{bg:"bg-cyan-500",light:"bg-cyan-100 dark:bg-cyan-950",text:"text-cyan-600 dark:text-cyan-400"},"loops-guide":{bg:"bg-teal-500",light:"bg-teal-100 dark:bg-teal-950",text:"text-teal-600 dark:text-teal-400"},"multi-tool-guide":{bg:"bg-amber-500",light:"bg-amber-100 dark:bg-amber-950",text:"text-amber-600 dark:text-amber-400"},"next-steps":{bg:"bg-rose-500",light:"bg-rose-100 dark:bg-rose-950",text:"text-rose-600 dark:text-rose-400"}},E_="claude-config-tutorial-visited",rp="claude-config-tutorial-active";function QW(){const[e,r]=_.useState(()=>{try{return localStorage.getItem(rp)||"intro"}catch{return"intro"}}),[s,n]=_.useState(()=>{try{const b=localStorage.getItem(rp)||"intro",k={welcome:!0};for(const N of Ta)N.subsections.some(P=>P.id===b)&&(k[N.id]=!0);return k}catch{return{welcome:!0}}}),[o,c]=_.useState(()=>{try{return JSON.parse(localStorage.getItem(E_)||"[]")}catch{return[]}}),d=_.useRef(null);_.useEffect(()=>{if(d.current){const b=d.current.querySelector("[data-radix-scroll-area-viewport]");b&&(b.scrollTop=0)}},[e]),_.useEffect(()=>{if(e&&(localStorage.setItem(rp,e),!o.includes(e))){const b=[...o,e];c(b),localStorage.setItem(E_,JSON.stringify(b))}},[e,o]);const l=b=>{n(k=>({...k,[b]:!k[b]}))},u=JW[e],f=Ta.flatMap(b=>b.subsections.length>0?b.subsections.map(k=>k.id):[b.id]),m=f.indexOf(e),h=m>0?f[m-1]:null,g=m<f.length-1?f[m+1]:null,w=Math.round(o.length/f.length*100),S=(()=>{for(const b of Ta)if(b.id===e||b.subsections.some(k=>k.id===e))return b;return Ta[0]})(),v=uu[S.id]||uu.welcome,y=b=>{for(const k of Ta){if(k.id===b)return k.title;const N=k.subsections.find(P=>P.id===b);if(N)return N.title}return""},x=b=>({__html:T2(b)});return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:"w-72 border-r border-border bg-muted/30 flex flex-col",children:[t.jsxs("div",{className:"p-4 border-b border-border bg-gradient-to-r from-indigo-500/10 to-purple-500/10",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center shadow-lg",children:t.jsx(Pu,{className:"w-5 h-5 text-white"})}),t.jsxs("div",{children:[t.jsx("h2",{className:"font-semibold text-foreground",children:"Tutorial"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Step-by-step guide"})]})]}),t.jsxs("div",{className:"mt-3",children:[t.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground mb-1",children:[t.jsx("span",{children:"Progress"}),t.jsxs("span",{children:[w,"% complete"]})]}),t.jsx(F2,{value:w,className:"h-2"})]})]}),t.jsx(Xs,{className:"flex-1",children:t.jsx("div",{className:"p-2",children:Ta.map((b,k)=>{const N=b.icon,P=uu[b.id]||uu.welcome,A=e===b.id||b.subsections.some(M=>M.id===e),E=b.subsections.length>0?b.subsections.every(M=>o.includes(M.id)):o.includes(b.id);return t.jsxs("div",{className:"mb-1",children:[t.jsxs("button",{className:Ne("w-full flex items-center gap-2 px-3 py-2.5 text-sm rounded-lg hover:bg-accent text-left transition-all",A&&"bg-accent"),onClick:()=>{b.subsections.length>0?(l(b.id),s[b.id]||r(b.subsections[0].id)):r(b.id)},children:[t.jsx("span",{className:Ne("w-7 h-7 rounded-lg flex items-center justify-center transition-colors",A?P.bg+" text-white":P.light),children:E?t.jsx(Oo,{className:"w-4 h-4"}):t.jsx(N,{className:Ne("w-4 h-4",!A&&P.text)})}),t.jsx("span",{className:Ne("flex-1",A&&"font-medium"),children:b.title}),b.subsections.length>0&&t.jsx(vs,{className:Ne("w-4 h-4 text-muted-foreground transition-transform",s[b.id]&&"rotate-90")})]}),b.subsections.length>0&&s[b.id]&&t.jsx("div",{className:"ml-4 mt-1 space-y-0.5 border-l-2 border-border pl-3",children:b.subsections.map(M=>{const D=e===M.id,O=o.includes(M.id);return t.jsxs("button",{className:Ne("w-full text-left px-3 py-1.5 text-sm rounded-md hover:bg-accent text-foreground flex items-center gap-2",D&&"bg-accent font-medium",D&&P.text),onClick:()=>r(M.id),children:[O&&!D&&t.jsx(Oo,{className:"w-3 h-3 text-green-500"}),t.jsx("span",{className:Ne(!O&&!D&&"ml-5"),children:M.title})]},M.id)})})]},b.id)})})})]}),t.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[t.jsx("div",{className:Ne("px-8 py-4 border-b border-border",v.light),children:t.jsxs("div",{className:"max-w-3xl mx-auto flex items-center gap-3",children:[t.jsx("div",{className:Ne("w-10 h-10 rounded-xl flex items-center justify-center",v.bg,"text-white"),children:t.jsx(S.icon,{className:"w-5 h-5"})}),t.jsxs("div",{children:[t.jsx("p",{className:Ne("text-sm font-medium",v.text),children:S.title}),t.jsx("h1",{className:"text-lg font-semibold text-foreground",children:(u==null?void 0:u.title)||y(e)})]})]})}),t.jsx(Xs,{className:"flex-1",ref:d,children:t.jsx("div",{className:"max-w-3xl mx-auto p-8",children:u?t.jsx("div",{className:"prose prose-sm max-w-none dark:prose-invert prose-headings:text-foreground prose-p:text-muted-foreground prose-strong:text-foreground [&_:not(pre)>code]:text-primary [&_:not(pre)>code]:bg-muted [&_:not(pre)>code]:px-1 [&_:not(pre)>code]:py-0.5 [&_:not(pre)>code]:rounded [&_pre]:bg-zinc-900 [&_pre]:text-zinc-100 [&_pre]:border [&_pre]:border-zinc-700 [&_pre_code]:text-zinc-100 [&_pre_code]:bg-transparent [&_pre_code]:p-0",dangerouslySetInnerHTML:x(u.content)}):t.jsxs("div",{className:"text-center text-muted-foreground py-12",children:[t.jsx(Pu,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),t.jsx("p",{children:"Select a topic from the sidebar"})]})})}),t.jsx("div",{className:"border-t border-border p-4 bg-muted/30",children:t.jsxs("div",{className:"max-w-3xl mx-auto flex items-center justify-between",children:[h?t.jsxs(se,{variant:"ghost",onClick:()=>r(h),className:"flex items-center gap-2",children:[t.jsx(F5,{className:"w-4 h-4"}),t.jsx("span",{className:"max-w-[150px] truncate",children:y(h)})]}):t.jsx("div",{}),t.jsxs("span",{className:"text-xs text-muted-foreground",children:[m+1," of ",f.length]}),g?t.jsxs(se,{onClick:()=>r(g),className:Ne("flex items-center gap-2",v.bg,"hover:opacity-90"),children:[t.jsx("span",{className:"max-w-[150px] truncate",children:y(g)}),t.jsx(Dg,{className:"w-4 h-4"})]}):t.jsx(se,{variant:"outline",onClick:()=>r("intro"),className:"flex items-center gap-2",children:"Start Over"})]})})]})]})}function ZW(){const[e,r]=_.useState(null),[s,n]=_.useState(!0),[o,c]=_.useState(!1),[d,l]=_.useState(!1),[u,f]=_.useState(!1),[m,h]=_.useState(null);_.useEffect(()=>{g()},[]);const g=async()=>{try{n(!0);const k=await me.getSessionStatus();r(k)}catch{q.error("Failed to load session status")}finally{n(!1)}},w=async()=>{var k,N;c(!0);try{const P=await me.installSessionAll();P.success?(q.success("Session persistence installed!"),g()):q.error(((k=P.hooks)==null?void 0:k.error)||((N=P.command)==null?void 0:N.error)||"Installation failed")}catch{q.error("Installation failed")}finally{c(!1)}},j=async()=>{c(!0);try{const k=await me.installSessionHooks();k.success?(q.success("Session hooks installed!"),g()):q.error(k.error||"Failed to install hooks")}catch{q.error("Failed to install hooks")}finally{c(!1)}},S=async()=>{c(!0);try{const k=await me.installFlushCommand();k.success?(q.success(k.alreadyInstalled?"/flush command already installed":"/flush command installed!"),g()):q.error(k.error||"Failed to install command")}catch{q.error("Failed to install command")}finally{c(!1)}},v=async()=>{l(!0);try{const k=await me.clearSessionContext();k.success?(q.success(k.cleared?"Session context cleared":"No context to clear"),g()):q.error("Failed to clear context")}catch{q.error("Failed to clear context")}finally{l(!1)}},y=async()=>{try{const k=await me.getSessionContext();h(k.content),f(!0)}catch{q.error("Failed to load context")}},x=k=>k===null?"Unknown":k<60?`${k} minutes ago`:k<1440?`${Math.floor(k/60)} hours ago`:`${Math.floor(k/1440)} days ago`;if(s)return t.jsx("div",{className:"flex items-center justify-center h-64",children:t.jsx(Qe,{className:"w-8 h-8 animate-spin text-indigo-600"})});const b=(e==null?void 0:e.hooksInstalled)&&(e==null?void 0:e.flushCommandInstalled)&&(e==null?void 0:e.permissionInstalled);return t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 p-5 shadow-sm",children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"p-2 rounded-lg bg-indigo-100 dark:bg-indigo-950",children:t.jsx(bs,{className:"w-5 h-5 text-indigo-600 dark:text-indigo-400"})}),t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Session Persistence"}),t.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:"Save and restore Claude Code session context"})]})]}),t.jsx(se,{variant:"ghost",size:"sm",onClick:g,children:t.jsx(Mr,{className:"w-4 h-4"})})]}),t.jsxs("p",{className:"text-sm text-gray-600 dark:text-slate-400",children:["Session persistence allows you to save your current Claude Code context using the ",t.jsx("code",{className:"bg-gray-100 dark:bg-slate-800 px-1.5 py-0.5 rounded text-indigo-600 dark:text-indigo-400",children:"/flush"})," command, and automatically restore it when you start a new session."]})]}),t.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[t.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-slate-700",children:t.jsx("h3",{className:"font-medium text-gray-900 dark:text-white",children:"Installation Status"})}),t.jsxs("div",{className:"divide-y divide-gray-100 dark:divide-slate-800",children:[t.jsxs("div",{className:"p-4 flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[e!=null&&e.hooksInstalled?t.jsx(Rt,{className:"w-5 h-5 text-green-500"}):t.jsx(Is,{className:"w-5 h-5 text-amber-500"}),t.jsxs("div",{children:[t.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"Session Hooks"}),t.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400",children:"Auto-restore context on session start, preserve on session end"})]})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(tt,{variant:e!=null&&e.hooksInstalled?"default":"secondary",children:e!=null&&e.hooksInstalled?"Installed":"Not Installed"}),!(e!=null&&e.hooksInstalled)&&t.jsx(se,{variant:"outline",size:"sm",onClick:j,disabled:o,children:o?t.jsx(Qe,{className:"w-4 h-4 animate-spin"}):"Install"})]})]}),t.jsxs("div",{className:"p-4 flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[e!=null&&e.flushCommandInstalled?t.jsx(Rt,{className:"w-5 h-5 text-green-500"}):t.jsx(Is,{className:"w-5 h-5 text-amber-500"}),t.jsxs("div",{children:[t.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"/flush Command"}),t.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400",children:"Adds the /flush command to save session context"})]})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(tt,{variant:e!=null&&e.flushCommandInstalled?"default":"secondary",children:e!=null&&e.flushCommandInstalled?"Installed":"Not Installed"}),!(e!=null&&e.flushCommandInstalled)&&t.jsx(se,{variant:"outline",size:"sm",onClick:S,disabled:o,children:o?t.jsx(Qe,{className:"w-4 h-4 animate-spin"}):"Install"})]})]}),t.jsxs("div",{className:"p-4 flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[e!=null&&e.permissionInstalled?t.jsx(Rt,{className:"w-5 h-5 text-green-500"}):t.jsx(Is,{className:"w-5 h-5 text-amber-500"}),t.jsxs("div",{children:[t.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"Write Permission"}),t.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400",children:"Allows Claude to write session context without prompting"})]})]}),t.jsx(tt,{variant:e!=null&&e.permissionInstalled?"default":"secondary",children:e!=null&&e.permissionInstalled?"Granted":"Not Granted"})]})]}),!b&&t.jsx("div",{className:"p-4 bg-gray-50 dark:bg-slate-900 border-t border-gray-200 dark:border-slate-800",children:t.jsxs(se,{onClick:w,disabled:o,className:"w-full bg-indigo-600 hover:bg-indigo-700 text-white",children:[o?t.jsx(Qe,{className:"w-4 h-4 mr-2 animate-spin"}):t.jsx(xi,{className:"w-4 h-4 mr-2"}),"Install All"]})})]}),t.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[t.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-slate-700 flex items-center justify-between",children:[t.jsx("h3",{className:"font-medium text-gray-900 dark:text-white",children:"Saved Context"}),(e==null?void 0:e.hasSavedContext)&&t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(se,{variant:"outline",size:"sm",onClick:y,children:[t.jsx(zr,{className:"w-4 h-4 mr-2"}),"View"]}),t.jsx(se,{variant:"outline",size:"sm",onClick:v,disabled:d,className:"text-red-600 hover:text-red-700 hover:bg-red-50 dark:hover:bg-red-950",children:d?t.jsx(Qe,{className:"w-4 h-4 animate-spin"}):t.jsx(ws,{className:"w-4 h-4"})})]})]}),t.jsx("div",{className:"p-4",children:e!=null&&e.hasSavedContext?t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[t.jsx(oc,{className:"w-4 h-4 text-gray-400"}),t.jsx("span",{className:"text-gray-600 dark:text-slate-400",children:"Last saved:"}),t.jsx("span",{className:"text-gray-900 dark:text-white",children:x(e.contextAge)})]}),e.contextPreview&&t.jsx("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-3",children:t.jsx("pre",{className:"text-xs text-gray-600 dark:text-slate-400 whitespace-pre-wrap overflow-hidden",children:e.contextPreview})}),t.jsxs("div",{className:"text-xs text-gray-500 dark:text-slate-500",children:["Storage: ",e.sessionDir]})]}):t.jsxs("div",{className:"text-center py-6",children:[t.jsx(bs,{className:"w-12 h-12 text-gray-300 dark:text-slate-600 mx-auto mb-3"}),t.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400",children:"No saved context"}),t.jsxs("p",{className:"text-xs text-gray-400 dark:text-slate-500 mt-1",children:["Use ",t.jsx("code",{className:"bg-gray-100 dark:bg-slate-800 px-1 rounded",children:"/flush"})," in Claude Code to save your session"]})]})})]}),(e==null?void 0:e.lastSession)&&t.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[t.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-slate-700",children:t.jsx("h3",{className:"font-medium text-gray-900 dark:text-white",children:"Last Session"})}),t.jsxs("div",{className:"p-4 space-y-2",children:[e.lastSession.session_id&&t.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[t.jsx("span",{className:"text-gray-500 dark:text-slate-400 w-20",children:"ID:"}),t.jsx("code",{className:"text-xs bg-gray-100 dark:bg-slate-800 px-2 py-0.5 rounded",children:e.lastSession.session_id})]}),e.lastSession.cwd&&t.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[t.jsx("span",{className:"text-gray-500 dark:text-slate-400 w-20",children:"Directory:"}),t.jsx("span",{className:"text-gray-900 dark:text-white font-mono text-xs",children:e.lastSession.cwd})]}),e.lastSession.timestamp&&t.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[t.jsx("span",{className:"text-gray-500 dark:text-slate-400 w-20",children:"Ended:"}),t.jsx("span",{className:"text-gray-900 dark:text-white",children:e.lastSession.timestamp})]}),e.lastSession.reason&&t.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[t.jsx("span",{className:"text-gray-500 dark:text-slate-400 w-20",children:"Reason:"}),t.jsx(tt,{variant:"secondary",children:e.lastSession.reason})]})]})]}),t.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-4 border border-transparent dark:border-slate-800",children:[t.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:"How to Use"}),t.jsxs("ol",{className:"space-y-2 text-sm text-gray-600 dark:text-slate-400",children:[t.jsxs("li",{className:"flex gap-2",children:[t.jsx("span",{className:"font-medium text-indigo-600 dark:text-indigo-400",children:"1."}),"Install session hooks and the /flush command above"]}),t.jsxs("li",{className:"flex gap-2",children:[t.jsx("span",{className:"font-medium text-indigo-600 dark:text-indigo-400",children:"2."}),"Use ",t.jsx("code",{className:"bg-white dark:bg-slate-800 px-1.5 py-0.5 rounded",children:"/flush"})," in Claude Code before ending a session"]}),t.jsxs("li",{className:"flex gap-2",children:[t.jsx("span",{className:"font-medium text-indigo-600 dark:text-indigo-400",children:"3."}),"Your context is automatically restored when you start a new session"]})]})]}),t.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-4 border border-transparent dark:border-slate-800",children:[t.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:"CLI Commands"}),t.jsxs("div",{className:"space-y-1 text-sm text-gray-600 dark:text-slate-400 font-mono",children:[t.jsx("p",{children:"coder-config session # Show session status"}),t.jsx("p",{children:"coder-config session install-hooks # Install session hooks"}),t.jsx("p",{children:"coder-config session clear # Clear saved context"})]})]}),t.jsx(bt,{open:u,onOpenChange:f,children:t.jsxs(ft,{className:"max-w-2xl max-h-[80vh] overflow-hidden flex flex-col",children:[t.jsxs(mt,{children:[t.jsx(pt,{children:"Saved Context"}),t.jsx(rr,{children:"This context will be restored on your next Claude Code session"})]}),t.jsx("div",{className:"flex-1 overflow-auto py-4",children:t.jsx("pre",{className:"text-sm text-gray-700 dark:text-slate-300 whitespace-pre-wrap bg-gray-50 dark:bg-slate-900 p-4 rounded-lg",children:m||"No content"})}),t.jsx(kt,{children:t.jsx(se,{variant:"ghost",onClick:()=>f(!1),children:"Close"})})]})})]})}const eU=[{id:"model",label:"Model Name",preview:"claude-opus-4-6"},{id:"context-bar",label:"Context Bar",preview:"●●●●○○○○○○ 37%",hasStyle:!0},{id:"ctx-pct",label:"Context %",preview:"37% ctx"},{id:"ctx-tokens",label:"Token Counts",preview:"74.4K/200.0K"},{id:"ctx-remaining",label:"Context Remaining",preview:"63% ctx left"},{id:"lines-changed",label:"Lines Changed",preview:"+146 -13"},{id:"git-branch",label:"Git Branch",preview:"main"},{id:"duration",label:"Duration",preview:"5h 32m"},{id:"cost",label:"Cost (API equiv.)",preview:"$0.142"}],Jp={prefix:"* ",separator:" | ",blocks:[{id:"model",enabled:!0},{id:"context-bar",enabled:!0,style:"dots"},{id:"ctx-pct",enabled:!1},{id:"ctx-tokens",enabled:!1},{id:"ctx-remaining",enabled:!1},{id:"lines-changed",enabled:!1},{id:"git-branch",enabled:!1},{id:"duration",enabled:!1},{id:"cost",enabled:!1}]};function tU(e){const{prefix:r="* ",separator:s=" | ",blocks:n=[]}=e,o=[];for(const c of n.filter(d=>d.enabled))switch(c.id){case"model":o.push("claude-opus-4-6");break;case"context-bar":{const d=c.style==="blocks"?"█":"●",l=c.style==="blocks"?"░":"○";o.push(`ctx ${d.repeat(4)}${l.repeat(6)} 37%`);break}case"ctx-pct":o.push("37% ctx");break;case"ctx-tokens":o.push("74.4K/200.0K");break;case"ctx-remaining":o.push("63% ctx left");break;case"lines-changed":o.push("+146 -13");break;case"git-branch":o.push("main");break;case"duration":o.push("5h 32m");break;case"cost":o.push("$0.142");break}return o.length?r+o.join(s):"(empty)"}function Qp(e){const{prefix:r="* ",separator:s=" | ",blocks:n=[]}=e,o=n.filter(f=>f.enabled),c=["#!/bin/bash",`# CONFIG: ${JSON.stringify(e)}`,"input=$(cat)"],d=f=>o.some(m=>m.id===f);d("model")&&c.push(`MODEL=$(echo "$input" | jq -r '.model.display_name // "?"')`),(d("context-bar")||d("ctx-pct")||d("ctx-remaining"))&&c.push(`PCT=$(echo "$input" | jq -r '.context_window.used_percentage // 0' | cut -d. -f1)`),d("ctx-remaining")&&c.push(`REM=$(echo "$input" | jq -r '.context_window.remaining_percentage // 0' | cut -d. -f1)`),d("ctx-tokens")&&(c.push(`CTX_USED=$(echo "$input" | jq -r '((.context_window.current_usage.input_tokens // 0) + (.context_window.current_usage.cache_creation_input_tokens // 0) + (.context_window.current_usage.cache_read_input_tokens // 0))')`),c.push(`CTX_MAX=$(echo "$input" | jq -r '.context_window.context_window_size // 200000')`),c.push('CTX_K=$(awk "BEGIN {printf \\"%.1fK\\", $CTX_USED/1000}")'),c.push('MAX_K=$(awk "BEGIN {printf \\"%.1fK\\", $CTX_MAX/1000}")')),d("lines-changed")&&(c.push(`LINES_ADD=$(echo "$input" | jq -r '.cost.total_lines_added // 0')`),c.push(`LINES_REM=$(echo "$input" | jq -r '.cost.total_lines_removed // 0')`)),d("duration")&&(c.push(`DUR_MS=$(echo "$input" | jq -r '.cost.total_duration_ms // 0')`),c.push("HOURS=$((DUR_MS / 3600000)); MINS=$(((DUR_MS % 3600000) / 60000)); SECS=$(((DUR_MS % 60000) / 1000))")),d("cost")&&(c.push(`COST=$(echo "$input" | jq -r '.cost.total_cost_usd // 0')`),c.push("COST_FMT=$(printf '$%.3f' $COST)")),d("git-branch")&&c.push("BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo '')");const l=o.find(f=>f.id==="context-bar");if(l){const f=l.style==="blocks"?"█":"●",m=l.style==="blocks"?"░":"○";c.push("FILLED=$((PCT / 10)); EMPTY=$((10 - FILLED))"),c.push(`BAR=""; [ "$FILLED" -gt 0 ] && BAR="$BAR$(printf '${f}%.0s' $(seq 1 $FILLED))"`),c.push(` [ "$EMPTY" -gt 0 ] && BAR="$BAR$(printf '${m}%.0s' $(seq 1 $EMPTY))"`)}let u=!0;for(const f of o){const m=(h,g)=>{u?(c.push(`OUT="${r}${h}"`),u=!1):g?c.push(`${g} && OUT="$OUT${s}${h}"`):c.push(`OUT="$OUT${s}${h}"`)};switch(f.id){case"model":m("$MODEL");break;case"context-bar":m("ctx $BAR $PCT%");break;case"ctx-pct":m("$PCT% ctx");break;case"ctx-tokens":m("$CTX_K/$MAX_K");break;case"ctx-remaining":m("$REM% ctx left");break;case"lines-changed":m("+$LINES_ADD -$LINES_REM",'[ "$LINES_ADD" != "0" ] || [ "$LINES_REM" != "0" ]');break;case"git-branch":m("$BRANCH",'[ -n "$BRANCH" ]');break;case"duration":u?(c.push(`[ "$HOURS" -gt 0 ] && OUT="${r}\${HOURS}h \${MINS}m" || OUT="${r}\${MINS}m \${SECS}s"`),u=!1):c.push(`[ "$HOURS" -gt 0 ] && OUT="$OUT${s}\${HOURS}h \${MINS}m" || OUT="$OUT${s}\${MINS}m \${SECS}s"`);break;case"cost":m("$COST_FMT");break}}return u&&c.push('OUT=""'),c.push('echo "$OUT"'),c.join(`
|
|
3726
3726
|
`)+`
|
|
3727
3727
|
`}function hu(e){const r=e==null?void 0:e.match(/^# CONFIG: (.+)$/m);if(!r)return null;try{return JSON.parse(r[1])}catch{return null}}function P_({value:e,onChange:r}){const[s,n]=_.useState("visual"),[o,c]=_.useState(()=>hu(e)||Jp);_.useEffect(()=>{const m=hu(e);m&&c(m)},[e]);const d=m=>{c(m),r(Qp(m))},l=m=>{if(m==="raw")r(Qp(o));else{const h=hu(e);h&&c(h)}n(m)},u=(m,h)=>{const g=[...o.blocks],w=m+h;w<0||w>=g.length||([g[m],g[w]]=[g[w],g[m]],d({...o,blocks:g}))},f=!!hu(e);return t.jsxs("div",{className:"space-y-2",children:[t.jsx("div",{className:"flex gap-1 bg-gray-100 dark:bg-slate-800 rounded-lg p-1 w-fit",children:[["visual","Visual"],["raw","Raw Bash"]].map(([m,h])=>t.jsx("button",{onClick:()=>l(m),className:`px-3 py-1 rounded text-xs font-medium transition-colors ${s===m?"bg-white dark:bg-slate-700 text-gray-900 dark:text-white shadow-sm":"text-gray-500 dark:text-slate-400 hover:text-gray-700 dark:hover:text-slate-300"}`,children:h},m))}),s==="visual"?t.jsxs("div",{className:"space-y-2",children:[!f&&(e==null?void 0:e.trim())&&t.jsxs("p",{className:"text-xs text-amber-500 dark:text-amber-400",children:["This script wasn't generated by the visual editor — showing template."," ",t.jsx("button",{onClick:()=>d(Jp),className:"underline hover:no-underline",children:"Reset to default"})]}),t.jsx("div",{className:"px-2 py-1.5 bg-gray-950 rounded font-mono text-[11px] border border-gray-800 text-gray-300 truncate whitespace-pre",children:tU(o)}),t.jsx("div",{className:"flex gap-2",children:[["Prefix","prefix"],["Separator","separator"]].map(([m,h])=>t.jsxs("label",{className:"flex-1",children:[t.jsx("span",{className:"text-xs text-gray-500 dark:text-slate-400 block mb-0.5",children:m}),t.jsx("input",{type:"text",value:o[h],onChange:g=>d({...o,[h]:g.target.value}),className:"w-full text-xs px-2 py-1 rounded border border-gray-200 dark:border-slate-700 bg-white dark:bg-slate-900 text-gray-900 dark:text-white font-mono"})]},h))}),t.jsx("div",{className:"space-y-0.5",children:o.blocks.map((m,h)=>{const g=eU.find(w=>w.id===m.id);return g?t.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded bg-gray-50 dark:bg-slate-900 border border-gray-100 dark:border-slate-800",children:[t.jsxs("div",{className:"flex flex-col -my-0.5 shrink-0",children:[t.jsx("button",{onClick:()=>u(h,-1),disabled:h===0,className:"text-gray-300 dark:text-slate-700 hover:text-gray-600 dark:hover:text-slate-400 disabled:opacity-30 disabled:cursor-not-allowed leading-none",children:t.jsx(hC,{className:"w-3 h-3"})}),t.jsx("button",{onClick:()=>u(h,1),disabled:h===o.blocks.length-1,className:"text-gray-300 dark:text-slate-700 hover:text-gray-600 dark:hover:text-slate-400 disabled:opacity-30 disabled:cursor-not-allowed leading-none",children:t.jsx(pr,{className:"w-3 h-3"})})]}),t.jsx("input",{type:"checkbox",checked:m.enabled,onChange:w=>d({...o,blocks:o.blocks.map(j=>j.id===m.id?{...j,enabled:w.target.checked}:j)}),className:"rounded shrink-0 accent-indigo-500"}),t.jsx("span",{className:`flex-1 text-xs font-medium ${m.enabled?"text-gray-900 dark:text-white":"text-gray-400 dark:text-slate-600"}`,children:g.label}),t.jsx("span",{className:"text-[10px] text-gray-400 dark:text-slate-600 font-mono shrink-0 hidden sm:block",children:g.preview}),m.id==="context-bar"&&m.enabled&&t.jsxs("select",{value:m.style||"dots",onChange:w=>d({...o,blocks:o.blocks.map(j=>j.id==="context-bar"?{...j,style:w.target.value}:j)}),className:"text-xs px-1.5 py-0.5 rounded border border-gray-200 dark:border-slate-700 bg-white dark:bg-slate-900 text-gray-900 dark:text-white shrink-0",children:[t.jsx("option",{value:"dots",children:"●○ dots"}),t.jsx("option",{value:"blocks",children:"█░ blocks"})]})]},m.id):null})})]}):t.jsx(ht,{value:e,onChange:m=>r(m.target.value),className:"font-mono text-xs h-48 resize-y bg-gray-950 dark:bg-black text-green-400 border-gray-800",spellCheck:!1,autoFocus:!0})]})}const rU=["Built-in","Simple","Git","Cost","Custom"];function sU(e){const r={};for(const s of e)r[s.category]||(r[s.category]=[]),r[s.category].push(s);return r}const nU=Qp(Jp);function iU(){const[e,r]=_.useState([]),[s,n]=_.useState("disabled"),[o,c]=_.useState(nU),[d,l]=_.useState(null),[u,f]=_.useState(""),[m,h]=_.useState(!0),[g,w]=_.useState(!1);_.useEffect(()=>{j()},[]);const j=async()=>{try{h(!0);const[b,k]=await Promise.all([me.getStatuslinePresets(),me.getCurrentStatusline()]);r(b.presets||[]),n(k.presetId||"disabled"),k.presetId==="custom"&&k.scriptContent&&c(k.scriptContent)}catch(b){q.error("Failed to load statuslines: "+b.message)}finally{h(!1)}},S=async b=>{if(!(b.id==="custom"||b.id===d)){w(!0);try{await me.setStatusline(b.id),n(b.id),q.success(b.id==="disabled"?"Statusline disabled":`Applied "${b.name}"`)}catch(k){q.error("Failed to apply: "+k.message)}finally{w(!1)}}},v=async(b,k)=>{if(k.stopPropagation(),b.id==="custom"){f(o),l("custom");return}try{const N=await me.getPresetScript(b.id);f(N.scriptContent||""),l(b.id)}catch(N){q.error("Failed to load script: "+N.message)}},y=async(b,k=u)=>{w(!0);try{const N=await me.setStatusline(b,k);if(N.success===!1)throw new Error(N.error||"Save failed");n(b),b==="custom"&&c(k),l(null),q.success("Script saved and applied")}catch(N){q.error("Failed to save: "+N.message)}finally{w(!1)}};if(m)return t.jsx("div",{className:"flex items-center justify-center h-64",children:t.jsx(Qe,{className:"w-8 h-8 animate-spin text-indigo-600"})});const x=sU(e);return t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 p-6 shadow-sm",children:[t.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white flex items-center gap-2",children:[t.jsx(Ut,{className:"w-5 h-5 text-indigo-500"}),"Statusline"]}),t.jsxs("p",{className:"text-sm text-gray-500 dark:text-slate-400 mt-1",children:["Claude Code runs a shell script after each response and displays the output in the status bar. Scripts receive JSON session data via stdin. Requires"," ",t.jsx("code",{className:"bg-gray-100 dark:bg-slate-800 px-1 rounded text-xs",children:"jq"}),"."]}),t.jsx("p",{className:"text-xs text-amber-600 dark:text-amber-400 mt-2",children:"⚡ Changes apply to the next interaction in your Claude Code session (no restart needed)."})]}),rU.filter(b=>x[b]).map(b=>t.jsxs("div",{children:[t.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-slate-500 mb-3 px-1",children:b}),t.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:x[b].map(k=>{const N=s===k.id,P=k.id==="custom",A=k.id==="disabled",E=d===k.id,M=!A;return t.jsxs("div",{onClick:()=>!P&&!E&&S(k),className:["rounded-xl border p-4 transition-all",P||E?"cursor-default":"cursor-pointer hover:border-indigo-400 dark:hover:border-indigo-500",N?"border-indigo-500 bg-indigo-50 dark:bg-indigo-950/40 shadow-sm":"border-gray-200 dark:border-slate-800 bg-white dark:bg-slate-950"].join(" "),children:[t.jsxs("div",{className:"flex items-start justify-between gap-2",children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-white truncate",children:k.name}),N&&!E&&t.jsx(Rt,{className:"w-4 h-4 text-indigo-500 shrink-0"})]}),t.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-0.5",children:k.description})]}),M&&t.jsx("button",{onClick:D=>E?(D.stopPropagation(),l(null)):v(k,D),className:"p-1 rounded hover:bg-gray-100 dark:hover:bg-slate-800 text-gray-400 hover:text-gray-600 dark:hover:text-slate-300 shrink-0",title:E?"Close editor":"Edit script",children:E?t.jsx(Un,{className:"w-3.5 h-3.5"}):t.jsx(sl,{className:"w-3.5 h-3.5"})})]}),!E&&!P&&!A&&k.preview&&t.jsx("div",{className:"mt-3 px-2 py-1.5 bg-gray-950 dark:bg-black rounded font-mono text-[11px] border border-gray-800 whitespace-pre text-gray-300 truncate",children:k.preview}),!E&&A&&t.jsx("div",{className:"mt-3 px-2 py-1.5 bg-gray-950 dark:bg-black rounded font-mono text-[11px] border border-gray-800 text-gray-600 italic",children:"(no status bar)"}),E&&t.jsxs("div",{className:"mt-3 space-y-2",onClick:D=>D.stopPropagation(),children:[t.jsx(P_,{value:u,onChange:f}),t.jsxs("div",{className:"flex gap-2",children:[t.jsxs(se,{size:"sm",className:"flex-1",onClick:()=>y(k.id),disabled:g||!u.trim(),children:[g?t.jsx(Qe,{className:"w-3 h-3 animate-spin mr-1"}):null,"Save & Apply"]}),t.jsx(se,{size:"sm",variant:"outline",onClick:()=>l(null),children:"Cancel"})]})]}),P&&!E&&t.jsxs("div",{className:"mt-3 space-y-2",onClick:D=>D.stopPropagation(),children:[t.jsx(P_,{value:o,onChange:c}),t.jsxs(se,{size:"sm",className:"w-full",onClick:()=>y("custom",o),disabled:g||!o.trim(),children:[g&&s==="custom"?t.jsx(Qe,{className:"w-3 h-3 animate-spin mr-1"}):null,"Apply Custom Script"]})]})]},k.id)})})]},b)),t.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-4 border border-transparent dark:border-slate-800 space-y-2",children:[t.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"How it works"}),t.jsxs("p",{className:"text-xs text-gray-600 dark:text-slate-400",children:["Scripts are saved to ",t.jsx("code",{className:"bg-gray-100 dark:bg-slate-800 px-1 rounded",children:"~/.claude/statuslines/"})," and referenced in ",t.jsx("code",{className:"bg-gray-100 dark:bg-slate-800 px-1 rounded",children:"~/.claude/settings.json"})," as"," ",t.jsx("code",{className:"bg-gray-100 dark:bg-slate-800 px-1 rounded",children:"statusLine.command"}),". Claude Code pipes JSON session data to the script on each turn."]}),t.jsxs("p",{className:"text-xs text-gray-500 dark:text-slate-500",children:["Test a script:"," ",t.jsx("code",{className:"bg-gray-100 dark:bg-slate-800 px-1 rounded font-mono",children:`echo '{"model":{"display_name":"opus-4-6"},"context_window":{"used_percentage":37,"remaining_percentage":63}}' | ~/.claude/statuslines/full.sh`})]})]})]})}const oU=[{id:"projects",label:"All Projects",icon:$n,section:"Projects"},{id:"explorer",label:"Project Explorer",icon:Xi,section:"Projects"},{id:"workstreams",label:"Workstreams",icon:yC,section:"Projects"},{id:"registry",label:"MCP Registry",icon:Yn,section:"Tools"},{id:"plugins",label:"Plugins",icon:Fo,section:"Tools"},{id:"memory",label:"Memory",icon:Lo,section:"Tools"},{id:"claude-settings",label:"Claude Code",icon:Qn,section:"Configuration",tool:"claude"},{id:"gemini-settings",label:"Gemini CLI",icon:Ut,section:"Configuration",tool:"gemini"},{id:"codex-settings",label:"Codex CLI",icon:Ut,section:"Configuration",isNew:!0,tool:"codex"},{id:"antigravity-settings",label:"Antigravity",icon:Ac,section:"Configuration",tool:"antigravity"},{id:"create-mcp",label:"Create MCP",icon:Hr,section:"Developer"},{id:"loops",label:"Ralph Loops",icon:pc,section:"Developer",isNew:!0},{id:"statuslines",label:"Statusline",icon:WM,section:"System",isNew:!0},{id:"sessions",label:"Sessions",icon:bs,section:"System"},{id:"preferences",label:"Preferences",icon:bC,section:"System"},{id:"tutorial",label:"Tutorial",icon:Pu,section:"Help"},{id:"docs",label:"Docs & Help",icon:Do,section:"Help"}],A_=(e,r)=>{try{const s=localStorage.getItem(`claude-config-${e}`);return s?JSON.parse(s):r}catch{return r}},aU=(e,r)=>{try{localStorage.setItem(`claude-config-${e}`,JSON.stringify(r))}catch{}};function lU(){const{projects:e,activeProject:r,fetch:s,setActive:n}=Dx(),{appConfig:o,version:c,fetch:d,checkVersion:l}=Lw(),[u,f]=_.useState(()=>A_("currentView","explorer")),[m,h]=_.useState(!0),[g,w]=_.useState({dir:"",subprojects:[],hierarchy:[]}),[j,S]=_.useState([]),[v,y]=_.useState({mcpServers:{}}),[x,b]=_.useState([]),[k,N]=_.useState([]),[P,A]=_.useState(null),[E,M]=_.useState(null),[D,O]=_.useState(!1),[z,U]=_.useState({title:"",type:""}),[X,W]=_.useState(""),[$,Y]=_.useState(""),K=_.useRef({}),[L,T]=_.useState(null),[B,G]=_.useState(!1),[F,re]=_.useState(!1),[de,ue]=_.useState(null),[J,H]=_.useState(!1),oe=_.useRef(null);_.useEffect(()=>{aU("currentView",u)},[u]);const ie=_.useCallback(async()=>{try{const[pe,be,De,fe,Se]=await Promise.all([me.getProject(),me.getConfigs(),me.getRegistry(),me.getRules(),me.getCommands()]);w(pe),S(be),y(De),b(fe),N(Se),be.length>0&&!P&&A(be[be.length-1])}catch(pe){q.error("Failed to load data: "+pe.message)}finally{h(!1)}},[P]),Z=_.useCallback(async(pe=!1)=>{try{const be=await s(),De=be==null?void 0:be.find(fe=>fe.isActive);if(pe&&De){const fe=await me.getSubprojects(De.path);ue({dir:De.path,subprojects:fe.subprojects||[]})}pe&&!De&&(A_("currentView",null)||f("projects"))}catch{console.log("Projects API not available")}},[s]),le=async pe=>{try{const be=await n(pe);be.success?(w({dir:be.dir,hierarchy:be.hierarchy,subprojects:be.subprojects}),ue({dir:be.dir,subprojects:be.subprojects}),await ie(),q.success(`Switched to ${be.project.name}`)):q.error(be.error||"Failed to switch project")}catch(be){q.error("Failed to switch project: "+be.message)}},ee=()=>{s()};_.useEffect(()=>{ie(),Z(!0),(async()=>{try{const[be]=await Promise.all([l(),d()]);!oe.current&&(be!=null&&be.installedVersion)&&(oe.current=be.installedVersion);const De=Lw.getState().appConfig;if(be!=null&&be.updateAvailable&&(be==null?void 0:be.updateMethod)==="npm")if(De!=null&&De.autoUpdate){q.info(`Auto-updating to v${be.latestVersion}...`),G(!0);const fe=await me.performUpdate({updateMethod:be.updateMethod,targetVersion:be.latestVersion,channel:be.channel});if(fe.success){q.success(`Updated to v${fe.newVersion}! Restarting server...`);try{await me.restartServer()}catch{}let Se=0;const Te=setInterval(async()=>{Se++;try{await me.checkVersion(),clearInterval(Te),q.success("Server restarted! Reloading..."),setTimeout(()=>window.location.reload(),500)}catch{Se>30&&(clearInterval(Te),q.info("Server restarting. Please refresh the page."),G(!1))}},500)}else q.error("Auto-update failed: "+fe.error),G(!1),T(be)}else T(be)}catch{}})()},[]),_.useEffect(()=>{const be=setInterval(async()=>{if(oe.current)try{const De=await me.checkVersion();De!=null&&De.installedVersion&&De.installedVersion!==oe.current&&(console.log(`[stale-ui] Server updated to v${De.installedVersion}, refreshing...`),window.location.reload())}catch{}},3e4);return()=>clearInterval(be)},[]);const _e=(pe,be)=>{if(!pe||!be)return!1;const De=Te=>Te.split(".").map(He=>parseInt(He,10)||0),fe=De(pe),Se=De(be);for(let Te=0;Te<Math.max(fe.length,Se.length);Te++){if((fe[Te]||0)>(Se[Te]||0))return!0;if((fe[Te]||0)<(Se[Te]||0))return!1}return!1},Fe=async(pe,be="npm",De)=>{G(!0);const fe=await me.performUpdate({updateMethod:be,targetVersion:pe,channel:De});if(fe.success){q.success(`Updated to v${fe.newVersion}! Restarting server...`),T(null);try{await me.restartServer()}catch{}let Se=0;const Te=setInterval(async()=>{Se++;try{await me.checkVersion(),clearInterval(Te),q.success("Server restarted! Reloading..."),setTimeout(()=>window.location.reload(),500)}catch{Se>30&&(clearInterval(Te),q.info("Server restarting. Please refresh the page."),G(!1))}},500);return!0}else return q.error("Update failed: "+fe.error),G(!1),!1},he=async()=>{H(!0);try{const pe=await me.checkVersion(),be=pe==null?void 0:pe.installedVersion,De=pe==null?void 0:pe.latestVersion;if(be&&oe.current&&be!==oe.current){q.info(`Refreshing to v${be}...`),setTimeout(()=>window.location.reload(),500);return}_e(De,be)&&(o!=null&&o.autoUpdate?(H(!1),q.info(`Auto-updating to v${De}...`),await Fe(De,(pe==null?void 0:pe.updateMethod)||"npm",pe==null?void 0:pe.channel)):(T({...pe,updateAvailable:!0}),q.info(`Update available: v${De}`)))}catch{q.error("Failed to check for updates")}finally{H(!1)}},we=async()=>{if(L!=null&&L.updateAvailable){G(!0);try{const pe=await me.performUpdate({updateMethod:L.updateMethod,sourcePath:L.sourcePath,targetVersion:L.latestVersion,channel:L.channel});if(pe.success){q.success(`Updated to v${pe.newVersion}! Restarting server...`),T(null),setVersion(pe.newVersion);try{await me.restartServer()}catch{}let be=0;const De=setInterval(async()=>{be++;try{await me.checkVersion(),clearInterval(De),q.success("Server restarted! Reloading..."),setTimeout(()=>window.location.reload(),500)}catch{be>30&&(clearInterval(De),q.info("Server restarting. Please refresh the page."),G(!1))}},500)}else q.error("Update failed: "+pe.error),G(!1)}catch(pe){q.error("Update failed: "+pe.message),G(!1)}}};_.useEffect(()=>{const pe=async()=>{try{const{hashes:De}=await me.getFileHashes(),fe=K.current,Se=Object.keys(De).some(He=>fe[He]!==De[He])||Object.keys(fe).some(He=>!De[He]),Te=fe.__subprojects__!==De.__subprojects__;if(Se&&Object.keys(fe).length>0&&(await ie(),Te&&de))try{const He=await me.getSubprojects(de.dir);ue(Ye=>({...Ye,subprojects:He.subprojects||[]}))}catch{}K.current=De}catch{}},be=setInterval(pe,2e3);return pe(),()=>clearInterval(be)},[ie,de]);const Oe=new Set;j.forEach(pe=>{var be,De;(((be=pe.config)==null?void 0:be.include)||[]).forEach(fe=>Oe.add(fe)),Object.keys(((De=pe.config)==null?void 0:De.mcpServers)||{}).forEach(fe=>Oe.add(fe))});const $e={mcps:Oe.size,rules:x.length,commands:k.length},Ke=async()=>{try{const pe=await me.applyConfig(g.dir);if(pe.tools){const be=Object.entries(pe.tools).filter(([,De])=>De).map(([De])=>De==="claude"?"Claude Code":"Antigravity");be.length>0?q.success(`Config applied to: ${be.join(", ")}`):q.warning("No tools were updated")}else q.success("Configuration applied successfully!")}catch(pe){q.error("Failed to apply config: "+pe.message)}},xt=async()=>{h(!0),await ie(),q.success("Data refreshed")};if(m)return t.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[t.jsx(Qe,{className:"w-8 h-8 animate-spin text-primary"}),t.jsx("p",{className:"text-muted-foreground",children:"Loading configuration..."})]})});const Ce=()=>{switch(u){case"explorer":return t.jsx(I8,{project:g,onRefresh:ie});case"registry":return t.jsx(ZH,{registry:v,searchQuery:X,setSearchQuery:W,onUpdate:ie});case"plugins":return t.jsx(NW,{});case"memory":return t.jsx(eW,{project:g,onUpdate:ie});case"create-mcp":return t.jsx(AH,{project:g});case"claude-settings":return t.jsx(pH,{});case"gemini-settings":return t.jsx(gH,{});case"codex-settings":return t.jsx(EH,{});case"antigravity-settings":return t.jsx(wH,{});case"statuslines":return t.jsx(iU,{});case"sessions":return t.jsx(ZW,{});case"preferences":return t.jsx(mH,{onConfigChange:()=>d()});case"projects":return t.jsx(iW,{onProjectSwitch:pe=>{w({dir:pe.dir,hierarchy:pe.hierarchy,subprojects:pe.subprojects}),ue({dir:pe.dir,subprojects:pe.subprojects}),ie(),Z()}});case"workstreams":return t.jsx(EW,{onWorkstreamChange:pe=>{q.success(`Switched to workstream: ${pe.name}`)}});case"loops":return t.jsx(PW,{activeProject:r});case"docs":return t.jsx(kW,{});case"tutorial":return t.jsx(QW,{});default:return null}};return t.jsxs("div",{className:"min-h-screen bg-background",children:[t.jsx("header",{className:"h-16 bg-card border-b border-border sticky top-0 z-50 shadow-sm",children:t.jsxs("div",{className:"h-full px-6 flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center shadow-lg shadow-indigo-500/20",children:t.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 128 128",children:[t.jsx("circle",{cx:"64",cy:"64",r:"52",fill:"none",stroke:"white",strokeWidth:"10",strokeDasharray:"24 12"}),t.jsx("circle",{cx:"64",cy:"64",r:"28",fill:"white"}),t.jsx("circle",{cx:"64",cy:"64",r:"12",fill:"#7c3aed"})]})}),t.jsx("div",{children:t.jsxs("h1",{className:"text-xl font-bold text-foreground",children:["Coder ",t.jsx("span",{className:"text-primary",children:"Config"})]})}),L&&t.jsxs("button",{onClick:we,disabled:B,className:"ml-3 px-2.5 py-1 text-xs font-medium bg-green-100 text-green-700 hover:bg-green-200 rounded-full flex items-center gap-1.5 transition-colors disabled:opacity-50",children:[B?t.jsx(Qe,{className:"w-3 h-3 animate-spin"}):t.jsx(xi,{className:"w-3 h-3"}),B?"Updating...":`Update to v${L.latestVersion}`]})]}),t.jsx(TN,{orientation:"vertical",className:"h-6"}),t.jsx(D8,{projects:e,activeProject:r,onSwitch:le,onAddClick:()=>re(!0),onManageClick:()=>f("projects")})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(B8,{}),t.jsx(se,{variant:"ghost",size:"sm",onClick:xt,children:t.jsx(Mr,{className:"w-4 h-4"})}),t.jsxs(se,{onClick:Ke,variant:"ghost",size:"sm",className:"gap-2 text-muted-foreground hover:text-foreground",title:"Config auto-applies on save. Click to manually re-apply.",children:[t.jsx(Ac,{className:"w-4 h-4"}),"Re-apply"]})]})]})}),t.jsxs("div",{className:"flex",children:[t.jsxs("aside",{className:"w-64 h-[calc(100vh-64px)] border-r border-border bg-card sticky top-16 flex flex-col",children:[t.jsx(Xs,{className:"flex-1 py-4",children:["Projects","Tools","Configuration","Developer","System","Help"].map(pe=>t.jsxs("div",{className:"mb-6",children:[t.jsx("h3",{className:"px-4 mb-2 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:pe}),t.jsx("div",{className:"space-y-0.5",children:oU.filter(be=>be.section===pe).filter(be=>{var De;return be.id!=="loops"||((De=o==null?void 0:o.experimental)==null?void 0:De.ralphLoops)}).filter(be=>!be.tool||((o==null?void 0:o.enabledTools)||["claude"]).includes(be.tool)).map(be=>{const De=be.icon,fe=u===be.id;return t.jsxs("button",{onClick:()=>f(be.id),className:`w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-all duration-200 border-l-2 ${fe?"bg-accent border-primary text-primary font-medium":"border-transparent text-muted-foreground hover:text-foreground hover:bg-accent"}`,children:[t.jsx(De,{className:"w-4 h-4"}),t.jsx("span",{className:"flex-1 text-left",children:be.label}),be.badge&&t.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full font-medium ${fe?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:$e[be.badge]}),be.isNew&&t.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded font-medium bg-green-500/20 text-green-600 dark:text-green-400",children:"new"})]},be.id)})})]},pe))}),t.jsx("div",{className:"px-4 py-3 border-t border-border",children:t.jsxs("button",{onClick:he,disabled:J,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1",title:"Check for updates",children:[J?t.jsx(Qe,{className:"w-3 h-3 animate-spin"}):null,c?`v${c}`:""]})})]}),t.jsx("main",{style:["explorer","docs","tutorial"].includes(u)?{}:{zoom:.9},className:Ne("flex-1 overflow-auto",["explorer","docs","tutorial"].includes(u)?"h-[calc(100vh-64px)]":"p-6"),children:t.jsx(D_,{mode:"wait",children:t.jsx(Oa.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:["explorer","docs","tutorial"].includes(u)?"h-full":"",children:Ce()},u)})})]}),t.jsx(NN,{open:F,onOpenChange:re,onAdded:ee}),t.jsx(L8,{onStartTutorial:()=>f("tutorial")})]})}function cU(){const[e,r]=_.useState(!1),[s,n]=_.useState(!1),[o,c]=_.useState(!1),d=_.useCallback(async()=>{n(!0);try{await me.restartServer(),q.info("Server restarting... page will reload."),setTimeout(()=>{window.location.reload()},2e3)}catch(u){q.error("Failed to restart: "+u.message),n(!1)}},[]),l=_.useCallback(()=>{c(!0),r(!1),q.dismiss("update-available")},[]);return _.useEffect(()=>{let u;const f=async()=>{try{const m=await me.getVersion();console.log("[Update Check]",m),m.needsRestart&&!o&&r(!0)}catch{}};return f(),u=setInterval(f,3e4),()=>clearInterval(u)},[o]),t.jsx(O8,{children:t.jsxs("div",{className:"min-h-screen bg-background",children:[e&&!s&&t.jsxs("div",{className:"fixed top-0 left-0 right-0 z-50 bg-blue-600 text-white px-4 py-2 flex items-center justify-center gap-2 shadow-lg cursor-pointer hover:bg-blue-700 transition-colors",onClick:d,children:[t.jsx(Mr,{className:"w-4 h-4"}),t.jsx("span",{className:"text-sm font-medium",children:"Update available — click to restart"}),t.jsx("button",{onClick:u=>{u.stopPropagation(),l()},className:"absolute right-3 p-1 hover:bg-blue-500 rounded",children:t.jsx(Un,{className:"w-4 h-4"})})]}),s&&t.jsxs("div",{className:"fixed top-0 left-0 right-0 z-50 bg-amber-600 text-white px-4 py-2 flex items-center justify-center gap-2",children:[t.jsx(Mr,{className:"w-4 h-4 animate-spin"}),t.jsx("span",{className:"text-sm font-medium",children:"Restarting server..."})]}),t.jsx(lU,{}),t.jsx(KP,{position:"bottom-right",richColors:!0})]})})}wP.createRoot(document.getElementById("root")).render(t.jsx(cU,{}));
|
package/ui/dist/index.html
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
<!-- PWA Manifest -->
|
|
21
21
|
<link rel="manifest" href="/manifest.json">
|
|
22
|
-
<script type="module" crossorigin src="/assets/index-
|
|
22
|
+
<script type="module" crossorigin src="/assets/index-CHcgvyNB.js"></script>
|
|
23
23
|
<link rel="stylesheet" crossorigin href="/assets/index-BiF3i3y5.css">
|
|
24
24
|
</head>
|
|
25
25
|
<body>
|
package/ui/routes/statuslines.js
CHANGED
|
@@ -39,8 +39,8 @@ input=$(cat)
|
|
|
39
39
|
MODEL=$(echo "$input" | jq -r '.model.display_name // "?"')
|
|
40
40
|
PCT=$(echo "$input" | jq -r '.context_window.used_percentage // 0' | cut -d. -f1)
|
|
41
41
|
FILLED=$((PCT / 10)); EMPTY=$((10 - FILLED))
|
|
42
|
-
BAR="";
|
|
43
|
-
|
|
42
|
+
BAR=""; [ "$FILLED" -gt 0 ] && BAR="$BAR$(printf '●%.0s' $(seq 1 $FILLED))"
|
|
43
|
+
[ "$EMPTY" -gt 0 ] && BAR="$BAR$(printf '○%.0s' $(seq 1 $EMPTY))"
|
|
44
44
|
echo "* $MODEL ctx $BAR $PCT%"
|
|
45
45
|
`,
|
|
46
46
|
|
|
@@ -52,8 +52,8 @@ PCT=$(echo "$input" | jq -r '.context_window.used_percentage // 0' | cut -d. -f1
|
|
|
52
52
|
LINES_ADD=$(echo "$input" | jq -r '.cost.total_lines_added // 0')
|
|
53
53
|
LINES_REM=$(echo "$input" | jq -r '.cost.total_lines_removed // 0')
|
|
54
54
|
FILLED=$((PCT / 10)); EMPTY=$((10 - FILLED))
|
|
55
|
-
BAR="";
|
|
56
|
-
|
|
55
|
+
BAR=""; [ "$FILLED" -gt 0 ] && BAR="$BAR$(printf '●%.0s' $(seq 1 $FILLED))"
|
|
56
|
+
[ "$EMPTY" -gt 0 ] && BAR="$BAR$(printf '○%.0s' $(seq 1 $EMPTY))"
|
|
57
57
|
BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo '')
|
|
58
58
|
OUT="* $MODEL | ctx $BAR $PCT%"
|
|
59
59
|
[ -n "$BRANCH" ] && OUT="$OUT | $BRANCH"
|
|
@@ -75,8 +75,8 @@ DUR_MS=$(echo "$input" | jq -r '.cost.total_duration_ms // 0')
|
|
|
75
75
|
COST=$(echo "$input" | jq -r '.cost.total_cost_usd // 0')
|
|
76
76
|
|
|
77
77
|
FILLED=$((PCT / 10)); EMPTY=$((10 - FILLED))
|
|
78
|
-
BAR="";
|
|
79
|
-
|
|
78
|
+
BAR=""; [ "$FILLED" -gt 0 ] && BAR="$BAR$(printf '●%.0s' $(seq 1 $FILLED))"
|
|
79
|
+
[ "$EMPTY" -gt 0 ] && BAR="$BAR$(printf '○%.0s' $(seq 1 $EMPTY))"
|
|
80
80
|
|
|
81
81
|
CTX_K=$(awk "BEGIN {printf \\"%.1fK\\", $CTX_USED/1000}")
|
|
82
82
|
MAX_K=$(awk "BEGIN {printf \\"%.1fK\\", $CTX_MAX/1000}")
|
|
@@ -116,8 +116,8 @@ CYAN='\\033[36m'; RESET='\\033[0m'
|
|
|
116
116
|
[ "$PCT" -ge 90 ] && BAR_COLOR="$RED" || { [ "$PCT" -ge 70 ] && BAR_COLOR="$YELLOW" || BAR_COLOR="$GREEN"; }
|
|
117
117
|
|
|
118
118
|
FILLED=$((PCT / 10)); EMPTY=$((10 - FILLED))
|
|
119
|
-
BAR="";
|
|
120
|
-
|
|
119
|
+
BAR=""; [ "$FILLED" -gt 0 ] && BAR="$BAR$(printf '█%.0s' $(seq 1 $FILLED))"
|
|
120
|
+
[ "$EMPTY" -gt 0 ] && BAR="$BAR$(printf '░%.0s' $(seq 1 $EMPTY))"
|
|
121
121
|
|
|
122
122
|
MINS=$((DUR_MS / 60000)); SECS=$(((DUR_MS % 60000) / 1000))
|
|
123
123
|
COST_FMT=$(printf '$%.3f' $COST)
|