wiki-viewer 1.8.0 → 1.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/standalone/.github/workflows/publish.yml +1 -1
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/api/wiki/upload/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0269d2e._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0pqaawz._.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/middleware-manifest.json +1 -1
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/static/chunks/{0l4842ez-0_66.js → 16r--8~rpehcz.js} +1 -1
- package/.next/standalone/agents/bootstrap-prompt.md +3 -1
- package/.next/standalone/agents/wiki-viewer-skill/SKILL.md +38 -11
- package/.next/standalone/package.json +1 -1
- package/.next/standalone/packages/wiki-viewer-mcp/README.md +6 -5
- package/.next/standalone/packages/wiki-viewer-mcp/dist/http-client.js +4 -0
- package/.next/standalone/packages/wiki-viewer-mcp/dist/index.js +4 -0
- package/.next/standalone/packages/wiki-viewer-mcp/package-lock.json +2 -2
- package/.next/standalone/packages/wiki-viewer-mcp/package.json +1 -1
- package/.next/standalone/packages/wiki-viewer-mcp/src/http-client.ts +6 -0
- package/.next/standalone/packages/wiki-viewer-mcp/src/index.ts +5 -0
- package/.next/standalone/src/app/api/agents/install/route.ts +20 -2
- package/.next/standalone/src/app/page.tsx +51 -1
- package/.next/standalone/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- /package/.next/standalone/.next/static/{t7B6nXaoD1jo9f61t3aeK → t_k0ztuf0V-iA-kgeez18}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{t7B6nXaoD1jo9f61t3aeK → t_k0ztuf0V-iA-kgeez18}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{t7B6nXaoD1jo9f61t3aeK → t_k0ztuf0V-iA-kgeez18}/_ssgManifest.js +0 -0
|
@@ -126,6 +126,6 @@ TOKEN=<paste token here>
|
|
|
126
126
|
# 3. Read snapshot
|
|
127
127
|
curl -s -H "Authorization: Bearer $TOKEN" \\
|
|
128
128
|
-H "X-Agent-Id: ai:claude" \\
|
|
129
|
-
${b}/api/agent/files/${a??"<path/to/file.md>"}`;await navigator.clipboard.writeText(d),c(!0),setTimeout(()=>c(!1),1500)},[a])}}(a??null),[i,j]=(0,$.useState)(""),k=(0,$.useRef)(null),l="http://localhost:3000",m=(0,$.useCallback)(()=>Gs,[]),n=(0,$.useCallback)(()=>i.replace(/\$WIKI_URL/g,l),[i,l]),o=(0,$.useCallback)(()=>`npx wiki-viewer-mcp register --url ${l} --id ai:myagent --name "My Agent"`,[l]),p=(0,$.useCallback)(()=>JSON.stringify({servers:{"wiki-viewer":{command:"npx",args:["wiki-viewer-mcp"],env:{WIKI_VIEWER_URL:l,WIKI_VIEWER_TOKEN:"<token from register>",WIKI_VIEWER_AGENT_ID:"ai:myagent"}}}},null,2),[l]),q=Gt(m),r=Gt(n),s=Gt(o),t=Gt(p);return((0,$.useEffect)(()=>{if(b)return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a);function a(a){"Escape"===a.key&&c()}},[b,c]),(0,$.useEffect)(()=>{b&&k.current?.focus()},[b]),(0,$.useEffect)(()=>{if(!b)return;f();let a=setInterval(()=>void f(),1e4);return()=>clearInterval(a)},[b,f]),(0,$.useEffect)(()=>{b&&fetch("/api/agents/install").then(a=>a.json()).then(a=>{a.bootstrapPrompt&&j(a.bootstrapPrompt)}).catch(()=>void 0)},[b]),b)?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20 backdrop-blur-[1px]",onClick:c,"aria-hidden":!0}),(0,Z.jsxs)("aside",{ref:k,tabIndex:-1,role:"dialog","aria-modal":"true","aria-label":"AI Agent Panel",className:"fixed right-0 top-0 bottom-0 z-50 flex w-80 flex-col border-l border-border bg-background shadow-xl outline-none",children:[(0,Z.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3 shrink-0",children:[(0,Z.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Z.jsx)(af,{className:"h-4 w-4 text-muted-foreground"}),(0,Z.jsx)("span",{className:"text-sm font-semibold",children:"AI Agent"})]}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",onClick:c,title:"Close panel (Esc)",children:(0,Z.jsx)(aD,{className:"h-3.5 w-3.5"})})]}),(0,Z.jsxs)("div",{className:"flex-1 overflow-y-auto space-y-5 px-4 py-4",children:[(0,Z.jsxs)("section",{className:"rounded-md border border-border bg-muted/30 p-3",children:[(0,Z.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Work with this wiki using AI"}),(0,Z.jsxs)("p",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:["Connect Claude, Cursor, ChatGPT, and more. Pick by what you want — each option gives a copy-paste setup. You approve every assistant in ",(0,Z.jsx)("span",{className:"font-medium text-foreground/80",children:"Agents"})," below before it gets access."]})]}),(0,Z.jsxs)("section",{className:"space-y-3",children:[(0,Z.jsxs)("div",{className:"rounded-md border border-border bg-muted/40 p-3 space-y-1.5",children:[(0,Z.jsx)("p",{className:"text-xs font-semibold text-foreground",children:"Co-write docs with you"}),(0,Z.jsx)("p",{className:"text-[10px] text-muted-foreground/70",children:"Edits arrive as suggestions with comments you accept or revert. No MCP needed."}),(0,Z.jsx)(bU,{size:"sm",variant:"outline",className:"h-7 w-full text-xs gap-1.5",onClick:()=>void r.copy(),disabled:!i,children:r.copied?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ag,{className:"h-3.5 w-3.5 text-green-500"})," Copied!"]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Da,{className:"h-3.5 w-3.5"})," Paste into any chatbot"]})}),(0,Z.jsxs)("p",{className:"text-[10px] text-muted-foreground/50 pt-1",children:["Or install once so it sticks"," ",(0,Z.jsx)("span",{className:"text-muted-foreground/40",children:"· Claude, OpenCode"}),":"]}),(0,Z.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Z.jsx)("code",{className:"flex-1 text-[10px] font-mono text-foreground/80 truncate bg-muted rounded px-1 py-0.5",children:Gs}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0 shrink-0",title:"Copy this command",onClick:()=>void q.copy(),children:q.copied?(0,Z.jsx)(ag,{className:"h-3.5 w-3.5 text-green-500"}):(0,Z.jsx)(Da,{className:"h-3.5 w-3.5"})})]})]}),(0,Z.jsxs)("div",{className:"rounded-md border border-border bg-muted/40 p-3 space-y-1.5",children:[(0,Z.jsxs)("p",{className:"text-xs font-semibold text-foreground",children:["Edit files directly"," ",(0,Z.jsx)("span",{className:"font-normal text-muted-foreground/60",children:"· Claude Code, Cursor, Codex"})]}),(0,Z.jsx)("p",{className:"text-[10px] text-muted-foreground/70",children:"Native read / search / edit tools over MCP. Run to request access:"}),(0,Z.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Z.jsx)("code",{className:"flex-1 text-[10px] font-mono text-foreground/80 truncate bg-muted rounded px-1 py-0.5",children:o()}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0 shrink-0",title:"Copy this command",onClick:()=>void s.copy(),children:s.copied?(0,Z.jsx)(ag,{className:"h-3.5 w-3.5 text-green-500"}):(0,Z.jsx)(Da,{className:"h-3.5 w-3.5"})})]}),(0,Z.jsxs)("p",{className:"text-[10px] text-muted-foreground/50",children:["Approve in ",(0,Z.jsx)("span",{className:"font-medium text-foreground/70",children:"Agents"}),", then add to your tool:"]}),(0,Z.jsx)(bU,{size:"sm",variant:"outline",className:"h-7 w-full text-xs gap-1.5",onClick:()=>void t.copy(),children:t.copied?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ag,{className:"h-3.5 w-3.5 text-green-500"})," Copied!"]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Da,{className:"h-3.5 w-3.5"})," Copy config (mcp.json)"]})})]}),(0,Z.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[(0,Z.jsx)("span",{className:"text-[10px] text-muted-foreground/50",children:"For developers:"}),(0,Z.jsxs)("button",{type:"button",onClick:()=>void h(),className:"inline-flex items-center gap-1 text-[10px] text-primary hover:underline",children:[g?(0,Z.jsx)(ag,{className:"h-3 w-3 text-green-500"}):(0,Z.jsx)(Da,{className:"h-3 w-3"})," curl example"]}),(0,Z.jsxs)("a",{href:"/api/agents/skill",target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-[10px] text-primary hover:underline",children:[(0,Z.jsx)(w$,{className:"h-3 w-3"})," skill"]}),(0,Z.jsxs)("a",{href:"/api/agents/install",target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-[10px] text-primary hover:underline",children:[(0,Z.jsx)(w$,{className:"h-3 w-3"})," install JSON"]})]})]}),(0,Z.jsx)(Gq,{}),(0,Z.jsxs)("section",{className:"space-y-2",children:[(0,Z.jsxs)("h3",{className:"text-xs font-semibold uppercase tracking-widest text-muted-foreground",children:["Active Connections"," ",(0,Z.jsx)("span",{className:"normal-case font-normal text-muted-foreground/50",children:"(last 5 min)"})]}),(0,Z.jsx)("div",{className:"rounded-md border border-border bg-muted/40 p-3",children:0===e.length?(0,Z.jsxs)("p",{className:"text-xs text-muted-foreground/60 flex items-center gap-1.5",children:[(0,Z.jsx)(Gi,{className:"h-3.5 w-3.5"}),"No recent activity"]}):(0,Z.jsx)("ul",{className:"space-y-1.5",children:e.map(a=>(0,Z.jsxs)("li",{className:"flex items-center justify-between text-xs",children:[(0,Z.jsx)("span",{className:"font-mono text-foreground/80 truncate",children:a.by}),(0,Z.jsxs)("span",{className:"text-muted-foreground shrink-0",children:[a.opCount," op",1!==a.opCount?"s":""]})]},a.by))})})]}),(0,Z.jsxs)("section",{className:"space-y-2",children:[(0,Z.jsx)("h3",{className:"text-xs font-semibold uppercase tracking-widest text-muted-foreground",children:"Recent Activity"}),(0,Z.jsx)("div",{className:"rounded-md border border-border bg-muted/40 px-3 py-1 max-h-72 overflow-y-auto",children:0===d.length?(0,Z.jsx)("p",{className:"text-xs text-muted-foreground/60 py-2",children:"No events recorded"}):d.map(a=>(0,Z.jsx)(Gr,{event:a},`${a.path}-${a.id}`))})]}),(0,Z.jsx)("section",{children:(0,Z.jsx)("a",{href:"/docs/agent-collab-plan.md",target:"_blank",rel:"noreferrer",className:"text-xs text-primary underline hover:no-underline",children:"Agent collaboration docs →"})})]})]})]}):null}var Gv=/[\\\/_+.#"@\[\(\{&]/,Gw=/[\\\/_+.#"@\[\(\{&]/g,Gx=/[\s-]/,Gy=/[\s-]/g;function Gz(a){return a.toLowerCase().replace(Gy," ")}var GA='[cmdk-group=""]',GB='[cmdk-group-items=""]',GC='[cmdk-item=""]',GD=`${GC}:not([aria-disabled="true"])`,GE="cmdk-item-select",GF="data-value",GG=(a,b,c)=>{var d;return d=a,function a(b,c,d,e,f,g,h){if(g===c.length)return f===b.length?1:.99;var i=`${f},${g}`;if(void 0!==h[i])return h[i];for(var j,k,l,m,n=e.charAt(g),o=d.indexOf(n,f),p=0;o>=0;)(j=a(b,c,d,e,o+1,g+1,h))>p&&(o===f?j*=1:Gv.test(b.charAt(o-1))?(j*=.8,(l=b.slice(f,o-1).match(Gw))&&f>0&&(j*=Math.pow(.999,l.length))):Gx.test(b.charAt(o-1))?(j*=.9,(m=b.slice(f,o-1).match(Gy))&&f>0&&(j*=Math.pow(.999,m.length))):(j*=.17,f>0&&(j*=Math.pow(.999,o-f))),b.charAt(o)!==c.charAt(g)&&(j*=.9999)),(j<.1&&d.charAt(o-1)===e.charAt(g+1)||e.charAt(g+1)===e.charAt(g)&&d.charAt(o-1)!==e.charAt(g))&&.1*(k=a(b,c,d,e,o+1,g+2,h))>j&&(j=.1*k),j>p&&(p=j),o=d.indexOf(n,o+1);return h[i]=p,p}(d=c&&c.length>0?`${d+" "+c.join(" ")}`:d,b,Gz(d),Gz(b),0,0,{})},GH=$.createContext(void 0),GI=$.createContext(void 0),GJ=$.createContext(void 0),GK=$.forwardRef((a,b)=>{let c=GU(()=>{var b,c;return{search:"",value:null!=(c=null!=(b=a.value)?b:a.defaultValue)?c:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),d=GU(()=>new Set),e=GU(()=>new Map),f=GU(()=>new Map),g=GU(()=>new Set),h=GS(a),{label:i,children:j,value:k,onValueChange:l,filter:m,shouldFilter:n,loop:o,disablePointerSelection:p=!1,vimBindings:q=!0,...r}=a,s=b$(),t=b$(),u=b$(),v=$.useRef(null),w=GX();GT(()=>{if(void 0!==k){let a=k.trim();c.current.value=a,x.emit()}},[k]),GT(()=>{w(6,D)},[]);let x=$.useMemo(()=>({subscribe:a=>(g.current.add(a),()=>g.current.delete(a)),snapshot:()=>c.current,setState:(a,b,d)=>{var e,f,g,i;if(!Object.is(c.current[a],b)){if(c.current[a]=b,"search"===a)C(),A(),w(1,B);else if("value"===a){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let a=document.getElementById(u);a?a.focus():null==(e=document.getElementById(s))||e.focus()}if(w(7,()=>{var a;c.current.selectedItemId=null==(a=E())?void 0:a.id,x.emit()}),d||w(5,D),(null==(f=h.current)?void 0:f.value)!==void 0){null==(i=(g=h.current).onValueChange)||i.call(g,null!=b?b:"");return}}x.emit()}},emit:()=>{g.current.forEach(a=>a())}}),[]),y=$.useMemo(()=>({value:(a,b,d)=>{var e;b!==(null==(e=f.current.get(a))?void 0:e.value)&&(f.current.set(a,{value:b,keywords:d}),c.current.filtered.items.set(a,z(b,d)),w(2,()=>{A(),x.emit()}))},item:(a,b)=>(d.current.add(a),b&&(e.current.has(b)?e.current.get(b).add(a):e.current.set(b,new Set([a]))),w(3,()=>{C(),A(),c.current.value||B(),x.emit()}),()=>{f.current.delete(a),d.current.delete(a),c.current.filtered.items.delete(a);let b=E();w(4,()=>{C(),(null==b?void 0:b.getAttribute("id"))===a&&B(),x.emit()})}),group:a=>(e.current.has(a)||e.current.set(a,new Set),()=>{f.current.delete(a),e.current.delete(a)}),filter:()=>h.current.shouldFilter,label:i||a["aria-label"],getDisablePointerSelection:()=>h.current.disablePointerSelection,listId:s,inputId:u,labelId:t,listInnerRef:v}),[]);function z(a,b){var d,e;let f=null!=(e=null==(d=h.current)?void 0:d.filter)?e:GG;return a?f(a,c.current.search,b):0}function A(){if(!c.current.search||!1===h.current.shouldFilter)return;let a=c.current.filtered.items,b=[];c.current.filtered.groups.forEach(c=>{let d=e.current.get(c),f=0;d.forEach(b=>{f=Math.max(a.get(b),f)}),b.push([c,f])});let d=v.current;F().sort((b,c)=>{var d,e;let f=b.getAttribute("id"),g=c.getAttribute("id");return(null!=(d=a.get(g))?d:0)-(null!=(e=a.get(f))?e:0)}).forEach(a=>{let b=a.closest(GB);b?b.appendChild(a.parentElement===b?a:a.closest(`${GB} > *`)):d.appendChild(a.parentElement===d?a:a.closest(`${GB} > *`))}),b.sort((a,b)=>b[1]-a[1]).forEach(a=>{var b;let c=null==(b=v.current)?void 0:b.querySelector(`${GA}[${GF}="${encodeURIComponent(a[0])}"]`);null==c||c.parentElement.appendChild(c)})}function B(){let a=F().find(a=>"true"!==a.getAttribute("aria-disabled")),b=null==a?void 0:a.getAttribute(GF);x.setState("value",b||void 0)}function C(){var a,b,g,i;if(!c.current.search||!1===h.current.shouldFilter){c.current.filtered.count=d.current.size;return}c.current.filtered.groups=new Set;let j=0;for(let e of d.current){let d=z(null!=(b=null==(a=f.current.get(e))?void 0:a.value)?b:"",null!=(i=null==(g=f.current.get(e))?void 0:g.keywords)?i:[]);c.current.filtered.items.set(e,d),d>0&&j++}for(let[a,b]of e.current)for(let d of b)if(c.current.filtered.items.get(d)>0){c.current.filtered.groups.add(a);break}c.current.filtered.count=j}function D(){var a,b,c;let d=E();d&&((null==(a=d.parentElement)?void 0:a.firstChild)===d&&(null==(c=null==(b=d.closest(GA))?void 0:b.querySelector('[cmdk-group-heading=""]'))||c.scrollIntoView({block:"nearest"})),d.scrollIntoView({block:"nearest"}))}function E(){var a;return null==(a=v.current)?void 0:a.querySelector(`${GC}[aria-selected="true"]`)}function F(){var a;return Array.from((null==(a=v.current)?void 0:a.querySelectorAll(GD))||[])}function G(a){let b=F()[a];b&&x.setState("value",b.getAttribute(GF))}function H(a){var b;let c=E(),d=F(),e=d.findIndex(a=>a===c),f=d[e+a];null!=(b=h.current)&&b.loop&&(f=e+a<0?d[d.length-1]:e+a===d.length?d[0]:d[e+a]),f&&x.setState("value",f.getAttribute(GF))}function I(a){let b=E(),c=null==b?void 0:b.closest(GA),d;for(;c&&!d;)d=null==(c=a>0?function(a,b){let c=a.nextElementSibling;for(;c;){if(c.matches(b))return c;c=c.nextElementSibling}}(c,GA):function(a,b){let c=a.previousElementSibling;for(;c;){if(c.matches(b))return c;c=c.previousElementSibling}}(c,GA))?void 0:c.querySelector(GD);d?x.setState("value",d.getAttribute(GF)):H(a)}let J=()=>G(F().length-1),K=a=>{a.preventDefault(),a.metaKey?J():a.altKey?I(1):H(1)},L=a=>{a.preventDefault(),a.metaKey?G(0):a.altKey?I(-1):H(-1)};return $.createElement(xg.div,{ref:b,tabIndex:-1,...r,"cmdk-root":"",onKeyDown:a=>{var b;null==(b=r.onKeyDown)||b.call(r,a);let c=a.nativeEvent.isComposing||229===a.keyCode;if(!(a.defaultPrevented||c))switch(a.key){case"n":case"j":q&&a.ctrlKey&&K(a);break;case"ArrowDown":K(a);break;case"p":case"k":q&&a.ctrlKey&&L(a);break;case"ArrowUp":L(a);break;case"Home":a.preventDefault(),G(0);break;case"End":a.preventDefault(),J();break;case"Enter":{a.preventDefault();let b=E();if(b){let a=new Event(GE);b.dispatchEvent(a)}}}}},$.createElement("label",{"cmdk-label":"",htmlFor:y.inputId,id:y.labelId,style:GZ},i),GY(a,a=>$.createElement(GI.Provider,{value:x},$.createElement(GH.Provider,{value:y},a))))}),GL=$.forwardRef((a,b)=>{var c,d;let e=b$(),f=$.useRef(null),g=$.useContext(GJ),h=$.useContext(GH),i=GS(a),j=null!=(d=null==(c=i.current)?void 0:c.forceMount)?d:null==g?void 0:g.forceMount;GT(()=>{if(!j)return h.item(e,null==g?void 0:g.id)},[j]);let k=GW(e,f,[a.value,a.children,f],a.keywords),l=$.useContext(GI),m=GV(a=>a.value&&a.value===k.current),n=GV(a=>!!j||!1===h.filter()||!a.search||a.filtered.items.get(e)>0);function o(){var a,b;p(),null==(b=(a=i.current).onSelect)||b.call(a,k.current)}function p(){l.setState("value",k.current,!0)}if($.useEffect(()=>{let b=f.current;if(!(!b||a.disabled))return b.addEventListener(GE,o),()=>b.removeEventListener(GE,o)},[n,a.onSelect,a.disabled]),!n)return null;let{disabled:q,value:r,onSelect:s,forceMount:t,keywords:u,...v}=a;return $.createElement(xg.div,{ref:aF(f,b),...v,id:e,"cmdk-item":"",role:"option","aria-disabled":!!q,"aria-selected":!!m,"data-disabled":!!q,"data-selected":!!m,onPointerMove:q||h.getDisablePointerSelection()?void 0:p,onClick:q?void 0:o},a.children)}),GM=$.forwardRef((a,b)=>{let{heading:c,children:d,forceMount:e,...f}=a,g=b$(),h=$.useRef(null),i=$.useRef(null),j=b$(),k=$.useContext(GH),l=GV(a=>!!e||!1===k.filter()||!a.search||a.filtered.groups.has(g));GT(()=>k.group(g),[]),GW(g,h,[a.value,a.heading,i]);let m=$.useMemo(()=>({id:g,forceMount:e}),[e]);return $.createElement(xg.div,{ref:aF(h,b),...f,"cmdk-group":"",role:"presentation",hidden:!l||void 0},c&&$.createElement("div",{ref:i,"cmdk-group-heading":"","aria-hidden":!0,id:j},c),GY(a,a=>$.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":c?j:void 0},$.createElement(GJ.Provider,{value:m},a))))}),GN=$.forwardRef((a,b)=>{let{alwaysRender:c,...d}=a,e=$.useRef(null),f=GV(a=>!a.search);return c||f?$.createElement(xg.div,{ref:aF(e,b),...d,"cmdk-separator":"",role:"separator"}):null}),GO=$.forwardRef((a,b)=>{let{onValueChange:c,...d}=a,e=null!=a.value,f=$.useContext(GI),g=GV(a=>a.search),h=GV(a=>a.selectedItemId),i=$.useContext(GH);return $.useEffect(()=>{null!=a.value&&f.setState("search",a.value)},[a.value]),$.createElement(xg.input,{ref:b,...d,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":i.listId,"aria-labelledby":i.labelId,"aria-activedescendant":h,id:i.inputId,type:"text",value:e?a.value:g,onChange:a=>{e||f.setState("search",a.target.value),null==c||c(a.target.value)}})}),GP=$.forwardRef((a,b)=>{let{children:c,label:d="Suggestions",...e}=a,f=$.useRef(null),g=$.useRef(null),h=GV(a=>a.selectedItemId),i=$.useContext(GH);return $.useEffect(()=>{if(g.current&&f.current){let a=g.current,b=f.current,c,d=new ResizeObserver(()=>{c=requestAnimationFrame(()=>{let c=a.offsetHeight;b.style.setProperty("--cmdk-list-height",c.toFixed(1)+"px")})});return d.observe(a),()=>{cancelAnimationFrame(c),d.unobserve(a)}}},[]),$.createElement(xg.div,{ref:aF(f,b),...e,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":h,"aria-label":d,id:i.listId},GY(a,a=>$.createElement("div",{ref:aF(g,i.listInnerRef),"cmdk-list-sizer":""},a)))}),GQ=$.forwardRef((a,b)=>{let{open:c,onOpenChange:d,overlayClassName:e,contentClassName:f,container:g,...h}=a;return $.createElement(c8,{open:c,onOpenChange:d},$.createElement(dd,{container:g},$.createElement(df,{"cmdk-overlay":"",className:e}),$.createElement(dj,{"aria-label":a.label,"cmdk-dialog":"",className:f},$.createElement(GK,{ref:b,...h}))))}),GR=Object.assign(GK,{List:GP,Item:GL,Input:GO,Group:GM,Separator:GN,Dialog:GQ,Empty:$.forwardRef((a,b)=>GV(a=>0===a.filtered.count)?$.createElement(xg.div,{ref:b,...a,"cmdk-empty":"",role:"presentation"}):null),Loading:$.forwardRef((a,b)=>{let{progress:c,children:d,label:e="Loading...",...f}=a;return $.createElement(xg.div,{ref:b,...f,"cmdk-loading":"",role:"progressbar","aria-valuenow":c,"aria-valuemin":0,"aria-valuemax":100,"aria-label":e},GY(a,a=>$.createElement("div",{"aria-hidden":!0},a)))})});function GS(a){let b=$.useRef(a);return GT(()=>{b.current=a}),b}var GT=$.useEffect;function GU(a){let b=$.useRef();return void 0===b.current&&(b.current=a()),b}function GV(a){let b=$.useContext(GI),c=()=>a(b.snapshot());return $.useSyncExternalStore(b.subscribe,c,c)}function GW(a,b,c,d=[]){let e=$.useRef(),f=$.useContext(GH);return GT(()=>{var g;let h=(()=>{var a;for(let b of c){if("string"==typeof b)return b.trim();if("object"==typeof b&&"current"in b)return b.current?null==(a=b.current.textContent)?void 0:a.trim():e.current}})(),i=d.map(a=>a.trim());f.value(a,h,i),null==(g=b.current)||g.setAttribute(GF,h),e.current=h}),e}var GX=()=>{let[a,b]=$.useState(),c=GU(()=>new Map);return GT(()=>{c.current.forEach(a=>a()),c.current=new Map},[a]),(a,d)=>{c.current.set(a,d),b({})}};function GY({asChild:a,children:b},c){let d;return a&&$.isValidElement(b)?$.cloneElement("function"==typeof(d=b.type)?d(b.props):"render"in d?d.render(b.props):b,{ref:b.ref},c(b.props.children)):c(b)}var GZ={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};let G$=ad("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),G_=$.forwardRef(({className:a,...b},c)=>(0,Z.jsx)(GR,{ref:c,className:bS("flex h-full w-full flex-col overflow-hidden rounded-sm bg-popover text-popover-foreground",a),...b}));function G0({children:a,shouldFilter:b,...c}){return(0,Z.jsx)(c8,{...c,children:(0,Z.jsxs)(dB,{className:"overflow-hidden p-0 shadow-golden max-w-lg",children:[(0,Z.jsx)(dE,{className:"sr-only",children:"Search"}),(0,Z.jsx)(G_,{shouldFilter:b,className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-normal [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:a})]})})}G_.displayName=GR.displayName;let G1=$.forwardRef(({className:a,...b},c)=>(0,Z.jsxs)("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[(0,Z.jsx)(G$,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),(0,Z.jsx)(GR.Input,{ref:c,className:bS("flex h-11 w-full rounded-sm bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",a),...b})]}));G1.displayName=GR.Input.displayName;let G2=$.forwardRef(({className:a,...b},c)=>(0,Z.jsx)(GR.List,{ref:c,className:bS("max-h-[300px] overflow-y-auto overflow-x-hidden",a),...b}));G2.displayName=GR.List.displayName;let G3=$.forwardRef((a,b)=>(0,Z.jsx)(GR.Empty,{ref:b,className:"py-6 text-center text-sm text-muted-foreground",...a}));G3.displayName=GR.Empty.displayName;let G4=$.forwardRef(({className:a,...b},c)=>(0,Z.jsx)(GR.Group,{ref:c,className:bS("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-normal [&_[cmdk-group-heading]]:text-muted-foreground",a),...b}));G4.displayName=GR.Group.displayName,$.forwardRef(({className:a,...b},c)=>(0,Z.jsx)(GR.Separator,{ref:c,className:bS("-mx-1 h-px bg-border",a),...b})).displayName=GR.Separator.displayName;let G5=$.forwardRef(({className:a,...b},c)=>(0,Z.jsx)(GR.Item,{ref:c,className:bS("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",a),...b}));G5.displayName=GR.Item.displayName;let G6=null,G7=u1(a=>({query:"",results:[],loading:!1,truncated:!1,open:!1,setQuery:b=>a({query:b}),setOpen:b=>a({open:b}),clear:()=>{G6?.abort(),a({query:"",results:[],loading:!1,truncated:!1})},search:async b=>{G6?.abort();let c=new AbortController;if(G6=c,!b.trim())return void a({results:[],loading:!1,truncated:!1});a({loading:!0});try{let d=await dJ("/api/wiki/search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:b,limit:30}),signal:c.signal});if(!d.ok)return void a({results:[],loading:!1,truncated:!1});let e=await d.json();if(c.signal.aborted)return;a({results:e.matches??[],truncated:!!e.truncated,loading:!1})}catch(b){"AbortError"!==b.name&&a({loading:!1})}}}));function G8({html:a}){let b=function(a){let b,c=[],d=/<mark>([\s\S]*?)<\/mark>/g,e=0;for(;null!==(b=d.exec(a));)b.index>e&&c.push({text:a.slice(e,b.index),mark:!1}),c.push({text:b[1]??"",mark:!0}),e=b.index+b[0].length;return e<a.length&&c.push({text:a.slice(e),mark:!1}),c}(a);return(0,Z.jsx)(Z.Fragment,{children:b.map((a,b)=>a.mark?(0,Z.jsx)("mark",{className:"bg-yellow-200 dark:bg-yellow-700 rounded-[2px] px-[1px]",children:a.text},b):(0,Z.jsx)("span",{children:a.text},b))})}function G9({onOpenFile:a}){let b=G7(a=>a.open),c=G7(a=>a.setOpen),d=G7(a=>a.query),e=G7(a=>a.setQuery),f=G7(a=>a.results),g=G7(a=>a.loading),h=G7(a=>a.truncated),i=G7(a=>a.search);return(0,$.useEffect)(()=>{function a(a){(a.metaKey||a.ctrlKey)&&"k"===a.key.toLowerCase()&&(a.preventDefault(),c(!b))}return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[b,c]),(0,$.useEffect)(()=>{if(!b)return;let a=setTimeout(()=>{i(d)},120);return()=>clearTimeout(a)},[d,b,i]),(0,Z.jsxs)(G0,{open:b,onOpenChange:c,shouldFilter:!1,children:[(0,Z.jsx)(G1,{placeholder:"Search files…",value:d,onValueChange:e}),(0,Z.jsxs)(G2,{children:[g&&(0,Z.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"Searching…"}),!g&&""!==d.trim()&&0===f.length&&(0,Z.jsx)(G3,{children:"No matches."}),f.length>0&&(0,Z.jsx)(G4,{heading:h?"Top results (refine query for more)":"Results",children:f.map(b=>(0,Z.jsx)(G5,{value:b.path,onSelect:()=>{a(b.path),c(!1)},children:(0,Z.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,Z.jsx)("span",{className:"truncate font-mono text-xs",children:b.path}),b.snippet&&(0,Z.jsx)("span",{className:"truncate text-xs text-muted-foreground",children:(0,Z.jsx)(G8,{html:b.snippet})})]})},b.path))})]})]})}function Ha({onOpenFile:a}){let b=G7(a=>a.query),c=G7(a=>a.setQuery),d=G7(a=>a.results),e=G7(a=>a.loading),f=G7(a=>a.search),g=G7(a=>a.clear),[h,i]=(0,$.useState)(0),j=(0,$.useRef)(null);function k(b){let c=d[b];c&&(a(c.path),g())}return(0,$.useEffect)(()=>{i(0)},[d]),(0,$.useEffect)(()=>{let a=j.current?.querySelector(`[data-idx="${h}"]`);a?.scrollIntoView({block:"nearest"})},[h]),(0,Z.jsxs)("div",{className:"flex flex-col gap-1 px-2 py-1.5",children:[(0,Z.jsxs)("div",{className:"relative",children:[(0,Z.jsx)(G$,{className:"pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 opacity-50"}),(0,Z.jsx)("input",{type:"text",className:"w-full rounded-sm border bg-transparent py-1 pl-7 pr-2 text-xs outline-none focus:ring-1 focus:ring-ring",placeholder:"Search… (⌘K)",value:b,onChange:a=>{c(a.target.value),f(a.target.value)},onKeyDown:a=>{"Escape"===a.key?g():0!==d.length&&("ArrowDown"===a.key?(a.preventDefault(),i(a=>(a+1)%d.length)):"ArrowUp"===a.key?(a.preventDefault(),i(a=>(a-1+d.length)%d.length)):"Enter"===a.key&&(a.preventDefault(),k(h)))}})]}),""!==b.trim()&&(0,Z.jsxs)("div",{ref:j,className:"max-h-64 overflow-y-auto rounded-sm border bg-popover",children:[e&&(0,Z.jsx)("div",{className:"px-2 py-1 text-xs text-muted-foreground",children:"Searching…"}),!e&&0===d.length&&(0,Z.jsx)("div",{className:"px-2 py-1 text-xs text-muted-foreground",children:"No matches"}),d.map((a,b)=>(0,Z.jsxs)("button",{type:"button","data-idx":b,onClick:()=>k(b),onMouseEnter:()=>i(b),className:`block w-full px-2 py-1 text-left ${b===h?"bg-accent":"hover:bg-accent"}`,children:[(0,Z.jsx)("div",{className:"truncate font-mono text-xs",children:a.path}),a.snippet&&(0,Z.jsx)("div",{className:"truncate text-[10px] text-muted-foreground",children:(0,Z.jsx)(G8,{html:a.snippet})})]},a.path))]})]})}function Hb({className:a}){let b=vh(a=>a.width),c=vh(a=>a.setWidth);return(0,Z.jsxs)(FK,{children:[(0,Z.jsx)(FM,{asChild:!0,children:(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:`h-7 w-7 p-0 ${a??""}`,title:`Content width: ${vf[b]}`,children:(0,Z.jsx)(wN,{className:"h-3.5 w-3.5"})})}),(0,Z.jsx)(FZ,{align:"end",className:"w-36",children:vg.map(a=>(0,Z.jsxs)(F$,{onClick:()=>c(a),className:"flex items-center justify-between text-xs",children:[vf[a],a===b&&(0,Z.jsx)(ag,{className:"h-3.5 w-3.5"})]},a))})]})}function Hc(a){return a.split(".").pop()?.toLowerCase()??""}function Hd(a,b){if("node-app"===b)return"node-app";if("app"===b)return"app";if("dir"===b)return"fallback";let c=Hc(a);return c?["md","markdown"].includes(c)?"editor":"txt"===c?"text":["csv","tsv"].includes(c)?"csv":"pdf"===c?"pdf":["mmd","mermaid"].includes(c)?"mermaid":"ipynb"===c?"notebook":["png","jpg","jpeg","gif","webp","svg","avif","ico","bmp"].includes(c)?"image":["mp4","webm","mov","m4v","mp3","wav","ogg","m4a","aac"].includes(c)?"media":"docx"===c?"docx":["xlsx","xlsm"].includes(c)?"xlsx":"pptx"===c?"pptx":"html"===c?"html":["py","js","ts","tsx","jsx","go","rs","java","c","cpp","h","sh","bash","zsh","rb","php","swift","kt","lua","sql","yaml","yml","toml","json","xml","css","scss"].includes(c)?"source":"fallback":"fallback"}let He=new Set(["txt","md","markdown","json","yaml","yml","toml","csv","tsv","xml","html","css","js","ts","tsx","jsx","sh","bash","zsh","rb","py","go","rs","java","c","cpp","h","php","swift","kt","lua","sql","scss","mmd","mermaid","ini","env","log","conf"]);function Hf(a){let b=Hd(a,"file");return"editor"===b||"text"===b||He.has(Hc(a))}function Hg(a){return["md","markdown"].includes(Hc(a))}function Hh(a){return"image"===Hd(a,"file")}async function Hi(a){let b=await dJ(`/api/wiki?dir=${encodeURIComponent(a)}`);return b.ok?(await b.json()).entries.map(b=>({name:b.name,path:a?`${a}/${b.name}`:b.name,type:b.type,size:b.size,modifiedAt:b.modifiedAt,expanded:!1})):[]}function Hj(a,b,c){return a.map(a=>a.path===b?c(a):a.children?{...a,children:Hj(a.children,b,c)}:a)}a.s(["default",0,function(){let a;vi(a=>a.loadedAt),(0,$.useEffect)(()=>{vi.getState().load()},[]);let[b,c]=(0,$.useState)(null),[d,e]=(0,$.useState)(null),[f,g]=(0,$.useState)(()=>null),[h,i]=(0,$.useState)([]),[j,k]=(0,$.useState)(!1),[l,m]=(0,$.useState)(!1),n=(0,$.useCallback)(async()=>{try{let a=await fetch("/api/system/workspaces");if(!a.ok)throw Error("Failed");let b=await a.json();if(i(b.workspaces),k(b.isAdmin),b.workspaces.length>0){c(!0);let a=new URLSearchParams(window.location.search).get("ws"),d=a?b.workspaces.find(b=>b.id===a):null,f=d??[...b.workspaces].sort((a,b)=>(b.lastOpenedAt??b.createdAt).localeCompare(a.lastOpenedAt??a.createdAt))[0];if(g(f.id),e(f.rootDir),!d){let a=new URL(location.href);a.searchParams.set("ws",f.id),history.replaceState(null,"",a.toString())}}else c(!1)}catch{c(!1)}},[]);(0,$.useEffect)(()=>{n()},[n]);let o=vb(a=>a.currentPath),p=(0,$.useRef)(null),q=(0,$.useRef)(!1),[r,s]=(0,$.useState)([]),[t,u]=(0,$.useState)(!1),[v,w]=(0,$.useState)(!1),x=(0,$.useRef)(!1),[y,z]=(0,$.useState)(!1),[A,B]=(0,$.useState)(!1),[C,D]=(0,$.useState)(null),E=(0,$.useRef)(null),F=(0,$.useRef)(""),[G,H]=(0,$.useState)(null),[I,J]=(0,$.useState)(""),[K,L]=(0,$.useState)(null),[M,N]=(0,$.useState)(null),[O,P]=(0,$.useState)(""),[Q,R]=(0,$.useState)(null),[S,T]=(0,$.useState)(null),[U,V]=(0,$.useState)(!1),[W,X]=(0,$.useState)(null),[Y,_]=(0,$.useState)(!1),[aa,ab]=(0,$.useState)(0),[ac,ad]=(0,$.useState)(!1),[aE,aF]=(0,$.useState)(!1),[aG,aH]=(0,$.useState)(null),[aI,aJ]=(0,$.useState)(0),[aK,aL]=(0,$.useState)(!1),[aM,aN]=(0,$.useState)(!1),[aO,aP]=(0,$.useState)(""),[aQ,aR]=(0,$.useState)(!1),[aS,aT]=(0,$.useState)(null),aU=(0,$.useRef)(null),[aV,aW]=(0,$.useState)(null),aX=(0,$.useRef)(null),aY=(0,$.useRef)(!1),aZ=(0,$.useRef)(async()=>{});(0,$.useEffect)(()=>{t||x.current||(x.current=!0,w(!0),Hi("").then(a=>{s(a),u(!0),w(!1)}).catch(()=>{x.current=!1,w(!1)}))},[t]);let a$=(0,$.useCallback)(async a=>{let b=a.split("/");if(b.length<=1)return;let c=[],d="";for(let a=0;a<b.length-1;a++)d=d?`${d}/${b[a]}`:b[a],c.push({prefix:d,children:await Hi(d)});s(a=>{let b=a;for(let{prefix:a,children:d}of c)b=Hj(b,a,a=>({...a,children:d,expanded:!0}));return b})},[]),a_=(0,$.useCallback)(async a=>{let b=await Hi(a);""===a?s(a=>{let c=new Map(a.map(a=>[a.path,a]));return b.map(a=>{let b=c.get(a.path);return b&&("dir"===b.type||"app"===b.type)?{...a,expanded:b.expanded,children:b.children}:a})}):s(c=>Hj(c,a,a=>({...a,children:b,expanded:!0})))},[]),a0=(0,$.useCallback)(a=>{let b=[];for(let c of a)("dir"===c.type||"app"===c.type)&&c.expanded&&c.children&&(b.push(c.path),b.push(...a0(c.children)));return b},[]),a1=(0,$.useCallback)(async()=>{z(!0);try{let a=a0(r),b=await Hi("");for(let c of(s(b),a)){let a=await Hi(c);s(b=>Hj(b,c,b=>({...b,children:a,expanded:!0})))}}finally{z(!1)}},[r,a0]),a2=(0,$.useCallback)(async()=>{if(W&&(["editor","text"].includes(Hd(W.name,W.nodeType))||Hf(W.name))){aL(!0);try{let a=await dJ(`/api/wiki/content?path=${encodeURIComponent(W.path)}`);if(a.ok){let b=await a.json();aH(b.content),aJ(Number(a.headers.get("X-Wiki-Revision")??0))}}catch{}aL(!1)}},[W]);async function a3(a){if("dir"===a.type||"app"===a.type)if(a.expanded)s(b=>Hj(b,a.path,a=>({...a,expanded:!1})));else if(void 0===a.children){s(b=>Hj(b,a.path,a=>({...a,loading:!0})));let b=await Hi(a.path);s(c=>Hj(c,a.path,a=>({...a,loading:!1,children:b,expanded:!0})))}else s(b=>Hj(b,a.path,a=>({...a,expanded:!0})))}async function a4(a){if(X({path:a.path,name:a.name,nodeType:"app"===a.type?"app":"node-app"===a.type?"node-app":"file"}),aN(!1),aT(null),aH(null),aJ(0),["editor","text"].includes(Hd(a.name,a.type))||Hf(a.name)){aL(!0);try{let b=await dJ(`/api/wiki/content?path=${encodeURIComponent(a.path)}`);if(b.ok){let a=await b.json();aH(a.content),aJ(Number(b.headers.get("X-Wiki-Revision")??0))}}catch{}aL(!1)}}(0,$.useEffect)(()=>{aX.current=W},[W]),(0,$.useEffect)(()=>{aY.current=aM},[aM]),(0,$.useEffect)(()=>{aZ.current=a2},[a2]),(0,$.useEffect)(()=>{if(!b)return;let a=new Map,c=new EventSource("/api/wiki/watch");return c.onmessage=b=>{var c;let d;try{d=JSON.parse(b.data)}catch{return}let{type:e,path:f}=d,g=f.split("/");if(c=g.length>1?g.slice(0,-1).join("/"):"",a.has(c)&&clearTimeout(a.get(c)),a.set(c,setTimeout(()=>{a.delete(c),a_(c)},300)),"change"===e&&aX.current?.path===f&&!aY.current){let b=`__file__${f}`;a.has(b)&&clearTimeout(a.get(b)),a.set(b,setTimeout(()=>{a.delete(b),aZ.current()},400))}},()=>{for(let b of(c.close(),a.values()))clearTimeout(b)}},[b,a_]),(0,$.useEffect)(()=>{_(!1)},[]);let a5=(0,$.useCallback)(a=>{let b=a.split("/").pop()??a;a$(a),a4({path:a,name:b,type:"file"})},[a$]);(0,$.useEffect)(()=>{if(!o||W&&W.path===o)return;let a=o.split("/").pop()??o;a4({path:o,name:a,type:"file"})},[o]),(0,$.useEffect)(()=>{},[W]),(0,$.useEffect)(()=>{if(q.current||!t)return;let a=p.current;if(!a){q.current=!0;return}q.current=!0,(async()=>{let b=a.split("/"),c=b[b.length-1],d=b.slice(0,-1).join("/"),e=(await Hi(d)).find(b=>b.path===a);e&&(await a$(a),a4({path:a,name:c,type:e.type,modifiedAt:e.modifiedAt}))})()},[t,a$]);let a6=(0,$.useCallback)(async a=>{if(a===f)return;try{await fetch(`/api/system/workspaces/${a}/open`,{method:"POST"})}catch{}let b=new URL(location.href);b.searchParams.set("ws",a),b.searchParams.delete("path"),history.pushState(null,"",b.toString()),X(null),aH(null),aN(!1),s([]),u(!1),x.current=!1,vi.getState().invalidate();let c=h.find(b=>b.id===a);c&&e(c.rootDir),g(a)},[f,h]);async function a7(){if(!W)return;aR(!0),aT(null);let a=await dJ("/api/wiki/content",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:W.path,content:aO,baseRevision:aI})});if(a.ok){let b=await a.json();"number"==typeof b.revision&&aJ(b.revision),aH(aO),aN(!1)}else aT((await a.json()).error??"Save failed");aR(!1)}let a8=(0,$.useCallback)(async(a,b)=>{let c=Array.from(a);if(c.length){B(!0),D(null);try{for(let a of c){let c=new FormData;c.append("file",a),c.append("dir",b);let d=await dJ("/api/wiki/upload",{method:"POST",body:c});if(!d.ok){let a=await d.json();D(a.error??"Upload failed"),C$(a.error??"Upload failed");break}}await a_(b)}catch{D("Upload failed.")}finally{B(!1),E.current&&(E.current.value="")}}},[a_]);function a9(a){F.current=a,E.current?.click()}async function ba(){let a=I.trim();if(!a||null===G)return;L(null);let b=G?`${G}/${a}`:a,c=await dJ("/api/wiki/folder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:b})});c.ok?(H(null),J(""),await a_(G),""!==G&&s(a=>Hj(a,G,a=>({...a,expanded:!0})))):L((await c.json()).error??"Failed")}async function bb(){let a=O.trim();if(!a||null===M)return;R(null);let b=a.includes(".")?a:`${a}.md`,c=M?`${M}/${b}`:b,d=await dJ("/api/wiki/new-file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:c})});d.ok?(N(null),P(""),await a_(M),""!==M&&s(a=>Hj(a,M,a=>({...a,expanded:!0}))),a4({path:c,name:b,type:"file",modifiedAt:new Date().toISOString()})):R((await d.json()).error??"Failed")}async function bc(){S&&(await dJ("/api/wiki",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:S})}),(W?.path===S||W?.path.startsWith(`${S}/`))&&(X(null),aH(null)),s(a=>(function a(b,c){return b.filter(a=>a.path!==c).map(b=>b.children?{...b,children:a(b.children,c)}:b)})(a,S)),T(null))}function bd(a,b,c){a.preventDefault(),a.stopPropagation();let d=aU.current;!d||d.path===b||b.startsWith(`${d.path}/`)||(a.dataTransfer.dropEffect="move",aW("root"===c?"":b))}async function be(a,b){a.preventDefault(),a.stopPropagation(),aW(null);let c=aU.current;if(aU.current=null,!c||c.path===b||b.startsWith(`${c.path}/`))return;let d=b?`${b}/${c.name}`:c.name;if(d!==c.path&&(await dJ("/api/wiki/move",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:c.path,to:d})})).ok){let a=c.path.includes("/")?c.path.split("/").slice(0,-1).join("/"):"";await a_(a),b!==a&&await a_(b),W?.path===c.path&&X({path:d,name:c.name,nodeType:W.nodeType})}}let bf=W?Hd(W.name,W.nodeType):null,bg=vh(a=>a.width),bh=null===bf||"editor"===bf||"text"===bf||"source"===bf||"notebook"===bf||"fallback"===bf,bi=bh?vd[bg]:"";return(0,Z.jsxs)("div",{className:"flex h-screen gap-0 overflow-hidden bg-background",children:[null===b&&(0,Z.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,Z.jsx)(as,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),!1===b&&(0,Z.jsx)(El,{onSelect:a=>{let b=new URL(location.href);b.searchParams.set("ws",a),b.searchParams.delete("path"),history.replaceState(null,"",b.toString()),u(!1),x.current=!1,g(a),c(!0),n()}}),!0===b&&l&&(0,Z.jsxs)("div",{className:"flex-1 flex flex-col",children:[(0,Z.jsx)("div",{className:"flex items-center justify-end border-b px-3 py-2 bg-muted shrink-0",children:(0,Z.jsxs)(bU,{size:"sm",variant:"ghost",className:"h-7 gap-1.5 text-xs",onClick:()=>m(!1),children:[(0,Z.jsx)(aD,{className:"h-3.5 w-3.5"})," Cancel"]})}),(0,Z.jsx)(El,{onSelect:a=>{m(!1),n(),a6(a)}})]}),!0===b&&!l&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(G9,{onOpenFile:a5}),!ac&&(0,Z.jsxs)(Ga,{className:"flex flex-col w-72 shrink-0 overflow-hidden rounded-none border-r border-l-0 border-t-0 border-b-0",children:[(0,Z.jsxs)("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b bg-muted shrink-0",children:[(0,Z.jsxs)("div",{className:"flex min-w-0 items-center gap-1.5",children:[(0,Z.jsx)("img",{src:"/logo.svg",alt:"Wiki Viewer",className:"h-5 w-5 shrink-0"}),(0,Z.jsx)("span",{className:"truncate text-xs font-semibold tracking-tight",children:"Wiki Viewer"})]}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 shrink-0",title:"Collapse sidebar",onClick:()=>ad(!0),children:(0,Z.jsx)(au,{className:"h-3.5 w-3.5"})})]}),(0,Z.jsxs)("div",{className:"flex items-center justify-between gap-1 px-3 py-1.5 border-b bg-muted/50 shrink-0",children:[(0,Z.jsxs)(FK,{children:[(0,Z.jsx)(FM,{asChild:!0,children:(0,Z.jsxs)(bU,{size:"sm",variant:"ghost",className:"h-7 gap-1 px-2 text-xs",disabled:A,children:[A?(0,Z.jsx)(as,{className:"h-3.5 w-3.5 animate-spin"}):(0,Z.jsx)(ax,{className:"h-3.5 w-3.5"}),"New",(0,Z.jsx)(ah,{className:"h-3 w-3 opacity-60"})]})}),(0,Z.jsxs)(FZ,{align:"start",className:"w-44",children:[(0,Z.jsxs)(F$,{onClick:()=>{N(""),P(""),R(null)},children:[(0,Z.jsx)(al,{className:"mr-2 h-3.5 w-3.5"}),"New file"]}),(0,Z.jsxs)(F$,{onClick:()=>{H(""),J(""),L(null)},children:[(0,Z.jsx)(ap,{className:"mr-2 h-3.5 w-3.5"}),"New folder"]}),(0,Z.jsxs)(F$,{onClick:()=>a9(""),disabled:A,children:[(0,Z.jsx)(aC,{className:"mr-2 h-3.5 w-3.5"}),"Upload"]})]})]}),(0,Z.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",title:"Refresh tree",onClick:a1,disabled:y,children:y?(0,Z.jsx)(as,{className:"h-3.5 w-3.5 animate-spin"}):(0,Z.jsx)(ay,{className:"h-3.5 w-3.5"})}),(0,Z.jsx)(F3,{}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",title:"AI Agent panel",onClick:()=>u2.getState().toggle(),children:(0,Z.jsx)(af,{className:"h-3.5 w-3.5"})}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",title:"Settings",onClick:()=>aF(!0),children:(0,Z.jsx)(az,{className:"h-3.5 w-3.5"})})]})]}),C&&(0,Z.jsxs)("div",{className:"flex items-center gap-1.5 px-3 py-1.5 text-xs text-destructive bg-destructive/10 shrink-0",children:[(0,Z.jsx)(ae,{className:"h-3.5 w-3.5 shrink-0"}),C]}),""===G&&(0,Z.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-1 border-b shrink-0",children:[(0,Z.jsx)(an,{className:"h-4 w-4 shrink-0 text-warning"}),(0,Z.jsx)("input",{className:"flex-1 bg-transparent text-sm outline-none border-b border-border min-w-0",placeholder:"Folder name",value:I,onChange:a=>J(a.target.value),onKeyDown:a=>{"Enter"===a.key&&ba(),"Escape"===a.key&&(H(null),J(""))}}),K&&(0,Z.jsx)("span",{className:"text-xs text-destructive",children:K}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:ba,children:(0,Z.jsx)(ag,{className:"h-3 w-3"})}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:()=>{H(null),J("")},children:(0,Z.jsx)(aD,{className:"h-3 w-3"})})]}),""===M&&(0,Z.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-1 border-b shrink-0",children:[(0,Z.jsx)(am,{className:"h-4 w-4 shrink-0 text-accent"}),(0,Z.jsx)("input",{autoFocus:!0,className:"flex-1 bg-transparent text-sm outline-none border-b border-border min-w-0",placeholder:"filename (default .md)",value:O,onChange:a=>P(a.target.value),onKeyDown:a=>{"Enter"===a.key&&bb(),"Escape"===a.key&&(N(null),P(""))}}),Q&&(0,Z.jsx)("span",{className:"text-xs text-destructive",children:Q}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:bb,children:(0,Z.jsx)(ag,{className:"h-3 w-3"})}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:()=>{N(null),P("")},children:(0,Z.jsx)(aD,{className:"h-3 w-3"})})]}),(0,Z.jsx)("div",{className:"border-b",children:(0,Z.jsx)(Ha,{onOpenFile:a5})}),(0,Z.jsx)("div",{className:bS("flex-1 overflow-auto py-1",""===aV&&"ring-2 ring-inset ring-primary bg-primary/5"),onDragOver:a=>bd(a,"","root"),onDragLeave:a=>{a.currentTarget.contains(a.relatedTarget)||aW(null)},onDrop:a=>be(a,""),children:v?(0,Z.jsx)("div",{className:"flex justify-center py-6",children:(0,Z.jsx)(as,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):0===r.length?(0,Z.jsxs)("div",{className:"flex flex-col items-center gap-3 px-4 py-8 text-center",children:[(0,Z.jsx)("div",{className:"rounded-full bg-muted p-3",children:(0,Z.jsx)(am,{className:"h-6 w-6 text-muted-foreground"})}),(0,Z.jsxs)("div",{className:"space-y-1",children:[(0,Z.jsx)("p",{className:"text-sm font-medium",children:"No files yet"}),(0,Z.jsx)("p",{className:"text-xs text-muted-foreground",children:"Upload files or add them to the configured directory"})]}),(0,Z.jsxs)(bU,{size:"sm",variant:"outline",className:"w-full gap-1.5 max-w-[180px]",onClick:()=>a9(""),disabled:A,children:[A?(0,Z.jsx)(as,{className:"h-3.5 w-3.5 animate-spin"}):(0,Z.jsx)(aC,{className:"h-3.5 w-3.5"}),"Upload Files"]})]}):function a(b,c=0){return b.map(b=>(0,Z.jsxs)("div",{children:[(0,Z.jsxs)("div",{role:"treeitem",tabIndex:0,draggable:!0,onKeyDown:a=>{("Enter"===a.key||" "===a.key)&&(a.preventDefault(),"dir"===b.type?a3(b):"app"===b.type?(a4(b),a3(b)):a4(b))},onDragStart:a=>{aU.current=b,a.dataTransfer.effectAllowed="move",a.dataTransfer.setData("text/plain",b.path)},onDragOver:a=>"dir"===b.type?bd(a,b.path,"dir"):a.preventDefault(),onDragLeave:()=>aW(null),onDrop:a=>"dir"===b.type?be(a,b.path):a.preventDefault(),className:bS("flex items-center gap-1.5 rounded-sm px-2 py-1 text-sm cursor-pointer group transition-colors select-none",W?.path===b.path?"bg-accent-soft text-foreground font-medium":"hover:bg-muted",aV===b.path&&"ring-2 ring-primary bg-primary-soft",b.name.startsWith(".")&&"opacity-40"),style:{paddingLeft:`${14*c+8}px`},onClick:()=>{"dir"===b.type?a3(b):"app"===b.type?(a4(b),a3(b)):a4(b)},children:["dir"===b.type||"app"===b.type?b.loading?(0,Z.jsx)(as,{className:"h-3.5 w-3.5 shrink-0 animate-spin text-muted-foreground"}):b.expanded?(0,Z.jsx)(ah,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):(0,Z.jsx)(ai,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):(0,Z.jsx)("span",{className:"w-3.5 shrink-0"}),"dir"===b.type?b.expanded?(0,Z.jsx)(ao,{className:bS("h-4 w-4 shrink-0",W?.path!==b.path&&"text-warning")}):(0,Z.jsx)(an,{className:bS("h-4 w-4 shrink-0",W?.path!==b.path&&"text-warning")}):"app"===b.type?(0,Z.jsx)(aq,{className:bS("h-4 w-4 shrink-0",W?.path!==b.path&&"text-foreground/70")}):"node-app"===b.type?(0,Z.jsx)(aA,{className:bS("h-4 w-4 shrink-0",W?.path!==b.path&&"text-emerald-500")}):"html"===Hd(b.name,"file")?(0,Z.jsx)(aq,{className:bS("h-4 w-4 shrink-0",W?.path!==b.path&&"text-foreground/60")}):Hh(b.name)?(0,Z.jsx)(ar,{className:bS("h-4 w-4 shrink-0",W?.path!==b.path&&"text-sunshine-700")}):Hf(b.name)?(0,Z.jsx)(am,{className:bS("h-4 w-4 shrink-0",W?.path!==b.path&&"text-foreground/70")}):(0,Z.jsx)(ak,{className:bS("h-4 w-4 shrink-0",W?.path!==b.path&&"text-foreground/60")}),(0,Z.jsx)("span",{className:"flex-1 truncate",children:b.name}),(0,Z.jsxs)("div",{className:"flex items-center gap-0.5 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:a=>a.stopPropagation(),onKeyDown:a=>a.stopPropagation(),children:["dir"===b.type&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0 text-muted-foreground hover:text-foreground",title:"New file here (default .md)",onClick:async()=>{b.expanded||await a3(b),N(b.path),P(""),R(null)},children:(0,Z.jsx)(al,{className:"h-3 w-3"})}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0 text-muted-foreground hover:text-foreground",title:"Upload here",onClick:()=>a9(b.path),children:(0,Z.jsx)(aC,{className:"h-3 w-3"})}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0 text-muted-foreground hover:text-foreground",title:"New subfolder",onClick:()=>{H(b.path),J(""),L(null)},children:(0,Z.jsx)(ap,{className:"h-3 w-3"})})]}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0 text-muted-foreground hover:text-foreground",title:"file"===b.type?"Download":"Download as zip",onClick:()=>{let a,c;return a=`/api/wiki/download?path=${encodeURIComponent(b.path)}`,void((c=document.createElement("a")).href=a,c.download="file"===b.type?b.name:`${b.name}.zip`,document.body.appendChild(c),c.click(),c.remove())},children:(0,Z.jsx)(aj,{className:"h-3 w-3"})}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0 text-destructive hover:text-destructive",title:"Delete",onClick:()=>{T(b.path),V("file"!==b.type)},children:(0,Z.jsx)(aB,{className:"h-3 w-3"})})]})]}),G===b.path&&"dir"===b.type&&(0,Z.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-1",style:{paddingLeft:`${(c+1)*14+8}px`},children:[(0,Z.jsx)("span",{className:"w-3.5 shrink-0"}),(0,Z.jsx)(an,{className:"h-4 w-4 shrink-0 text-warning"}),(0,Z.jsx)("input",{className:"flex-1 bg-transparent text-sm outline-none border-b border-border min-w-0",placeholder:"Folder name",value:I,onChange:a=>J(a.target.value),onKeyDown:a=>{"Enter"===a.key&&ba(),"Escape"===a.key&&(H(null),J(""))}}),K&&(0,Z.jsx)("span",{className:"text-xs text-destructive",children:K}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:ba,children:(0,Z.jsx)(ag,{className:"h-3 w-3"})}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:()=>{H(null),J("")},children:(0,Z.jsx)(aD,{className:"h-3 w-3"})})]}),M===b.path&&"dir"===b.type&&(0,Z.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-1",style:{paddingLeft:`${(c+1)*14+8}px`},children:[(0,Z.jsx)("span",{className:"w-3.5 shrink-0"}),(0,Z.jsx)(am,{className:"h-4 w-4 shrink-0 text-accent"}),(0,Z.jsx)("input",{autoFocus:!0,className:"flex-1 bg-transparent text-sm outline-none border-b border-border min-w-0",placeholder:"filename (default .md)",value:O,onChange:a=>P(a.target.value),onKeyDown:a=>{"Enter"===a.key&&bb(),"Escape"===a.key&&(N(null),P(""))}}),Q&&(0,Z.jsx)("span",{className:"text-xs text-destructive",children:Q}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:bb,children:(0,Z.jsx)(ag,{className:"h-3 w-3"})}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:()=>{N(null),P("")},children:(0,Z.jsx)(aD,{className:"h-3 w-3"})})]}),("dir"===b.type||"app"===b.type)&&b.expanded&&b.children&&b.children.length>0&&a(b.children,c+1),("dir"===b.type||"app"===b.type)&&b.expanded&&b.children?.length===0&&(0,Z.jsx)("div",{className:"text-xs text-muted-foreground/50 py-0.5",style:{paddingLeft:`${(c+1)*14+8+14+6+16+6}px`},children:"Empty"})]},b.path))}(r)}),(0,Z.jsx)("div",{className:"border-t px-2 py-2 bg-muted shrink-0",children:(0,Z.jsxs)(FK,{children:[(0,Z.jsx)(FM,{asChild:!0,children:(0,Z.jsxs)(bU,{size:"sm",variant:"ghost",className:"w-full h-auto justify-between gap-2 px-2 py-1.5 text-left",title:d??"",children:[(0,Z.jsxs)("span",{className:"flex flex-col min-w-0",children:[(0,Z.jsx)("span",{className:"truncate text-xs font-medium",children:h.find(a=>a.id===f)?.name??"Workspace"}),(0,Z.jsx)("span",{className:"truncate text-[10px] text-muted-foreground font-mono",children:d??""})]}),(0,Z.jsx)(ah,{className:"h-3.5 w-3.5 shrink-0 opacity-60"})]})}),(0,Z.jsxs)(FZ,{align:"start",className:"w-60",children:[h.map(a=>(0,Z.jsxs)(F$,{onClick:()=>void a6(a.id),className:bS("gap-2",a.id===f&&"font-medium"),children:[a.id===f?(0,Z.jsx)(ag,{className:"h-3.5 w-3.5 shrink-0"}):(0,Z.jsx)("span",{className:"w-3.5 shrink-0"}),(0,Z.jsxs)("span",{className:"flex flex-col min-w-0",children:[(0,Z.jsx)("span",{className:"truncate",children:a.name}),(0,Z.jsx)("span",{className:"truncate text-[10px] text-muted-foreground font-mono",children:a.rootDir})]})]},a.id)),j&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(F_,{}),(0,Z.jsxs)(F$,{onClick:()=>m(!0),children:[(0,Z.jsx)(ap,{className:"mr-2 h-3.5 w-3.5"}),"Add workspace…"]})]})]})]})})]}),(0,Z.jsxs)("div",{className:"flex-1 flex flex-col min-w-0 relative",children:[ac&&(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"absolute left-0 top-1/2 -translate-y-1/2 z-10 h-7 w-7 p-0 rounded-full bg-background/50 backdrop-blur-xl backdrop-saturate-150 border border-white/[0.08] text-foreground/60 hover:text-foreground/90 hover:bg-background/70 shadow-[0_0_12px_rgba(0,0,0,0.15)] [transform:translate(-50%,-50%)_translateZ(0)]",title:"Show sidebar",onClick:()=>ad(!1),children:(0,Z.jsx)(av,{className:"h-3.5 w-3.5"})}),W?"node-app"===bf?(0,Z.jsx)(Eg,{path:W.path,title:W.name}):"app"===bf||"html"===bf?(a="html"===bf?`/api/assets/${W.path}`:void 0,Y?(0,Z.jsx)(Ec,{path:W.path,title:W.name,src:a,fullscreen:!0,onExit:()=>_(!1)}):(0,Z.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden min-w-0",children:[(0,Z.jsxs)("div",{className:"flex items-center justify-between px-4 py-2 border-b bg-muted shrink-0",children:[(0,Z.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,Z.jsx)(aq,{className:"h-4 w-4 shrink-0 text-accent"}),(0,Z.jsx)("span",{className:"text-sm font-normal truncate",title:W.path,children:W.path})]}),(0,Z.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:["html"===bf&&!aM&&null!==aG&&(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",title:"Edit source",onClick:()=>{aN(!0),aP(aG),aT(null)},children:(0,Z.jsx)(aw,{className:"h-3.5 w-3.5"})}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",title:"Refresh",onClick:()=>ab(a=>a+1),children:(0,Z.jsx)(ay,{className:"h-3.5 w-3.5"})}),(0,Z.jsxs)(bU,{size:"sm",variant:"ghost",className:"h-7 gap-1.5 text-xs",onClick:()=>_(!0),children:[(0,Z.jsx)(at,{className:"h-3.5 w-3.5"}),"Open fullscreen"]}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",onClick:()=>{X(null),aN(!1)},children:(0,Z.jsx)(aD,{className:"h-3.5 w-3.5"})})]})]}),aM&&"html"===bf?(0,Z.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden min-h-0",children:[(0,Z.jsx)("textarea",{value:aO,onChange:a=>aP(a.target.value),spellCheck:!1,className:"flex-1 w-full min-h-0 resize-none bg-background text-foreground px-4 py-3 font-mono text-[13px] leading-relaxed outline-none border-0"}),(0,Z.jsxs)("div",{className:"border-t px-4 py-2 flex items-center justify-end gap-2 bg-muted shrink-0",children:[aS&&(0,Z.jsx)("span",{className:"text-xs text-destructive mr-auto",children:aS}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",onClick:()=>{aN(!1),aT(null)},children:"Cancel"}),(0,Z.jsxs)(bU,{size:"sm",className:"gap-1",onClick:a7,disabled:aQ,children:[aQ&&(0,Z.jsx)(as,{className:"h-3 w-3 animate-spin"}),"Save"]})]})]}):(0,Z.jsx)(Ec,{path:W.path,title:W.name,src:a},aa)]})):(0,Z.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden min-w-0",children:[(0,Z.jsxs)("div",{className:"flex items-center justify-between px-4 py-2 border-b bg-muted shrink-0",children:[(0,Z.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[Hh(W.name)?(0,Z.jsx)(ar,{className:"h-4 w-4 shrink-0 text-sunshine-700"}):Hf(W.name)?(0,Z.jsx)(am,{className:"h-4 w-4 shrink-0 text-accent"}):(0,Z.jsx)(ak,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),(0,Z.jsx)("span",{className:"text-sm font-normal truncate",title:W.path,children:W.path})]}),(0,Z.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[Hf(W.name)&&!aM&&null!==aG&&(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",onClick:()=>{aN(!0),aP(aG),aT(null),Hg(W.name)&&vb.getState().loadPage(W.path)},children:(0,Z.jsx)(aw,{className:"h-3.5 w-3.5"})}),Hf(W.name)&&!aM&&null!==aG&&(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",title:"Refresh",onClick:a2,disabled:aK,children:aK?(0,Z.jsx)(as,{className:"h-3.5 w-3.5 animate-spin"}):(0,Z.jsx)(ay,{className:"h-3.5 w-3.5"})}),bh&&(0,Z.jsx)(Hb,{}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",onClick:()=>{X(null),aH(null),aN(!1)},children:(0,Z.jsx)(aD,{className:"h-3.5 w-3.5"})})]})]}),aM?(0,Z.jsx)("div",{className:"flex-1 flex flex-col overflow-hidden min-h-0",children:Hg(W.name)?(0,Z.jsx)(C6,{}):(0,Z.jsx)("textarea",{value:aO,onChange:a=>aP(a.target.value),spellCheck:!1,className:"flex-1 w-full min-h-0 resize-none bg-background text-foreground px-4 py-3 font-mono text-[13px] leading-relaxed outline-none border-0"})}):(0,Z.jsx)("div",{className:"flex-1 overflow-auto p-4 min-h-0",children:(0,Z.jsx)("div",{className:bS("mx-auto w-full",bi),children:aK?(0,Z.jsx)("div",{className:"flex justify-center py-8",children:(0,Z.jsx)(as,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):"csv"===bf?(0,Z.jsx)(dN,{path:W.path,title:W.name}):"pdf"===bf?(0,Z.jsx)(D7,{path:W.path,title:W.name}):"mermaid"===bf?(0,Z.jsx)(Df,{path:W.path,title:W.name}):"notebook"===bf?(0,Z.jsx)(D2,{path:W.path,title:W.name}):"image"===bf?(0,Z.jsx)(C8,{path:W.path,title:W.name}):"media"===bf?(0,Z.jsx)(C9,{path:W.path,title:W.name,type:["mp4","webm","mov","m4v"].includes(Hc(W.name))?"video":"audio"}):"docx"===bf?(0,Z.jsx)(D4,{path:W.path,title:W.name}):"xlsx"===bf?(0,Z.jsx)(D6,{path:W.path,title:W.name}):"pptx"===bf?(0,Z.jsx)(D5,{path:W.path,title:W.name}):"source"===bf?(0,Z.jsx)(Eb,{path:W.path,title:W.name}):"fallback"===bf?(0,Z.jsx)(C7,{path:W.path,title:W.name}):null!==aG?["md","markdown"].includes(Hc(W.name))?(()=>{let{data:a,body:b}=function(a){let b=Gg.exec(a);if(!b)return{data:{},body:a};let c=b[1],d=a.slice(b[0].length),e=c.split(/\r?\n/).find(a=>""!==a.trim())??"";if(/^\s*(#{1,6}\s|<|>|-\s|\*\s|\d+\.\s)/.test(e))return{data:{},body:a};let f={},g=c.split(/\r?\n/),h=0;for(;h<g.length;){let a=g[h];if(!a||/^\s*#/.test(a)){h+=1;continue}let b=/^([A-Za-z_][\w-]*)\s*:\s*(.*)$/.exec(a);if(!b){h+=1;continue}let c=b[1],d=b[2];if(""===d.trim()){let a=[],b=h+1;for(;b<g.length&&/^\s+-\s+/.test(g[b]);){let c=/^\s+-\s+(.*)$/.exec(g[b]);c&&a.push(Gh(c[1])),b+=1}if(a.length>0){f[c]=a,h=b;continue}f[c]="",h+=1;continue}f[c]=Gh(d),h+=1}return 0===Object.keys(f).length?{data:{},body:a}:{data:f,body:d}}(aG);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Ge,{data:a}),(0,Z.jsx)(Gf,{markdown:b,pagePath:W.path,onNavigate:(a,b)=>{a4({path:a,name:a.split("/").pop()??a,type:"file"}),b&&setTimeout(()=>{document.getElementById(b)?.scrollIntoView({behavior:"smooth"})},200)}})]})})():(0,Z.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-words leading-relaxed",children:aG}):Hf(W.name)?(0,Z.jsx)("p",{className:"text-sm text-muted-foreground",children:"Could not load file."}):(0,Z.jsx)("p",{className:"text-sm text-muted-foreground",children:"Preview not available for this file type."})})}),aM&&(0,Z.jsxs)("div",{className:"border-t px-4 py-2 flex items-center justify-end gap-2 bg-muted shrink-0",children:[aS&&(0,Z.jsx)("span",{className:"text-xs text-destructive mr-auto",children:aS}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",onClick:()=>{aN(!1),aT(null)},children:"Cancel"}),(0,Z.jsxs)(bU,{size:"sm",className:"gap-1",onClick:a7,disabled:aQ,children:[aQ&&(0,Z.jsx)(as,{className:"h-3 w-3 animate-spin"}),"Save"]})]})]}):(0,Z.jsx)("div",{className:"flex-1 flex flex-col items-center justify-center",children:(0,Z.jsxs)("div",{className:"flex flex-col items-center gap-2 text-center px-4",children:[(0,Z.jsx)(am,{className:"h-8 w-8 text-muted-foreground"}),(0,Z.jsx)("p",{className:"text-sm text-muted-foreground",children:"Select a file to view or edit"})]})})]}),(0,Z.jsx)(F9,{open:aE,onOpenChange:aF}),(0,Z.jsx)(Gu,{currentPath:W?.path}),(0,Z.jsx)("input",{ref:E,type:"file",multiple:!0,className:"hidden",onChange:a=>{a.target.files&&a8(a.target.files,F.current)}}),(0,Z.jsx)(dG,{open:!!S,onOpenChange:a=>{a||T(null)},title:U?"Delete folder?":"Delete file?",description:U?`"${S?.split("/").pop()}" and all its contents will be permanently deleted.`:`"${S?.split("/").pop()}" will be permanently removed.`,onConfirm:bc})]})]},f??"none")}],240777)}];
|
|
129
|
+
${b}/api/agent/files/${a??"<path/to/file.md>"}`;await navigator.clipboard.writeText(d),c(!0),setTimeout(()=>c(!1),1500)},[a])}}(a??null),[i,j]=(0,$.useState)(""),k=(0,$.useRef)(null),l="http://localhost:3000",m=(0,$.useCallback)(()=>Gs,[]),n=(0,$.useCallback)(()=>i.replace(/\$WIKI_URL/g,l),[i,l]),o=(0,$.useCallback)(()=>`npx wiki-viewer-mcp register --url ${l} --id ai:myagent --name "My Agent"`,[l]),p=(0,$.useCallback)(()=>JSON.stringify({servers:{"wiki-viewer":{command:"npx",args:["wiki-viewer-mcp"],env:{WIKI_VIEWER_URL:l,WIKI_VIEWER_TOKEN:"<token from register>",WIKI_VIEWER_AGENT_ID:"ai:myagent"}}}},null,2),[l]),q=Gt(m),r=Gt(n),s=Gt(o),t=Gt(p);return((0,$.useEffect)(()=>{if(b)return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a);function a(a){"Escape"===a.key&&c()}},[b,c]),(0,$.useEffect)(()=>{b&&k.current?.focus()},[b]),(0,$.useEffect)(()=>{if(!b)return;f();let a=setInterval(()=>void f(),1e4);return()=>clearInterval(a)},[b,f]),(0,$.useEffect)(()=>{b&&fetch("/api/agents/install").then(a=>a.json()).then(a=>{a.bootstrapPrompt&&j(a.bootstrapPrompt)}).catch(()=>void 0)},[b]),b)?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20 backdrop-blur-[1px]",onClick:c,"aria-hidden":!0}),(0,Z.jsxs)("aside",{ref:k,tabIndex:-1,role:"dialog","aria-modal":"true","aria-label":"AI Agent Panel",className:"fixed right-0 top-0 bottom-0 z-50 flex w-80 flex-col border-l border-border bg-background shadow-xl outline-none",children:[(0,Z.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3 shrink-0",children:[(0,Z.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Z.jsx)(af,{className:"h-4 w-4 text-muted-foreground"}),(0,Z.jsx)("span",{className:"text-sm font-semibold",children:"AI Agent"})]}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",onClick:c,title:"Close panel (Esc)",children:(0,Z.jsx)(aD,{className:"h-3.5 w-3.5"})})]}),(0,Z.jsxs)("div",{className:"flex-1 overflow-y-auto space-y-5 px-4 py-4",children:[(0,Z.jsxs)("section",{className:"rounded-md border border-border bg-muted/30 p-3",children:[(0,Z.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Work with this wiki using AI"}),(0,Z.jsxs)("p",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:["Connect Claude, Cursor, ChatGPT, and more. Pick by what you want — each option gives a copy-paste setup. You approve every assistant in ",(0,Z.jsx)("span",{className:"font-medium text-foreground/80",children:"Agents"})," below before it gets access."]})]}),(0,Z.jsxs)("section",{className:"space-y-3",children:[(0,Z.jsxs)("div",{className:"rounded-md border border-border bg-muted/40 p-3 space-y-1.5",children:[(0,Z.jsx)("p",{className:"text-xs font-semibold text-foreground",children:"Co-write docs with you"}),(0,Z.jsx)("p",{className:"text-[10px] text-muted-foreground/70",children:"Edits arrive as suggestions with comments you accept or revert. No MCP needed."}),(0,Z.jsx)(bU,{size:"sm",variant:"outline",className:"h-7 w-full text-xs gap-1.5",onClick:()=>void r.copy(),disabled:!i,children:r.copied?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ag,{className:"h-3.5 w-3.5 text-green-500"})," Copied!"]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Da,{className:"h-3.5 w-3.5"})," Paste into any chatbot"]})}),(0,Z.jsxs)("p",{className:"text-[10px] text-muted-foreground/50 pt-1",children:["Or install once so it sticks"," ",(0,Z.jsx)("span",{className:"text-muted-foreground/40",children:"· Claude, OpenCode"}),":"]}),(0,Z.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Z.jsx)("code",{className:"flex-1 text-[10px] font-mono text-foreground/80 truncate bg-muted rounded px-1 py-0.5",children:Gs}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0 shrink-0",title:"Copy this command",onClick:()=>void q.copy(),children:q.copied?(0,Z.jsx)(ag,{className:"h-3.5 w-3.5 text-green-500"}):(0,Z.jsx)(Da,{className:"h-3.5 w-3.5"})})]})]}),(0,Z.jsxs)("div",{className:"rounded-md border border-border bg-muted/40 p-3 space-y-1.5",children:[(0,Z.jsxs)("p",{className:"text-xs font-semibold text-foreground",children:["Edit files directly"," ",(0,Z.jsx)("span",{className:"font-normal text-muted-foreground/60",children:"· Claude Code, Cursor, Codex"})]}),(0,Z.jsx)("p",{className:"text-[10px] text-muted-foreground/70",children:"Native read / search / edit tools over MCP. Run to request access:"}),(0,Z.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Z.jsx)("code",{className:"flex-1 text-[10px] font-mono text-foreground/80 truncate bg-muted rounded px-1 py-0.5",children:o()}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0 shrink-0",title:"Copy this command",onClick:()=>void s.copy(),children:s.copied?(0,Z.jsx)(ag,{className:"h-3.5 w-3.5 text-green-500"}):(0,Z.jsx)(Da,{className:"h-3.5 w-3.5"})})]}),(0,Z.jsxs)("p",{className:"text-[10px] text-muted-foreground/50",children:["Approve in ",(0,Z.jsx)("span",{className:"font-medium text-foreground/70",children:"Agents"}),", then add to your tool:"]}),(0,Z.jsx)(bU,{size:"sm",variant:"outline",className:"h-7 w-full text-xs gap-1.5",onClick:()=>void t.copy(),children:t.copied?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ag,{className:"h-3.5 w-3.5 text-green-500"})," Copied!"]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Da,{className:"h-3.5 w-3.5"})," Copy config (mcp.json)"]})})]}),(0,Z.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[(0,Z.jsx)("span",{className:"text-[10px] text-muted-foreground/50",children:"For developers:"}),(0,Z.jsxs)("button",{type:"button",onClick:()=>void h(),className:"inline-flex items-center gap-1 text-[10px] text-primary hover:underline",children:[g?(0,Z.jsx)(ag,{className:"h-3 w-3 text-green-500"}):(0,Z.jsx)(Da,{className:"h-3 w-3"})," curl example"]}),(0,Z.jsxs)("a",{href:"/api/agents/skill",target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-[10px] text-primary hover:underline",children:[(0,Z.jsx)(w$,{className:"h-3 w-3"})," skill"]}),(0,Z.jsxs)("a",{href:"/api/agents/install",target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-[10px] text-primary hover:underline",children:[(0,Z.jsx)(w$,{className:"h-3 w-3"})," install JSON"]})]})]}),(0,Z.jsx)(Gq,{}),(0,Z.jsxs)("section",{className:"space-y-2",children:[(0,Z.jsxs)("h3",{className:"text-xs font-semibold uppercase tracking-widest text-muted-foreground",children:["Active Connections"," ",(0,Z.jsx)("span",{className:"normal-case font-normal text-muted-foreground/50",children:"(last 5 min)"})]}),(0,Z.jsx)("div",{className:"rounded-md border border-border bg-muted/40 p-3",children:0===e.length?(0,Z.jsxs)("p",{className:"text-xs text-muted-foreground/60 flex items-center gap-1.5",children:[(0,Z.jsx)(Gi,{className:"h-3.5 w-3.5"}),"No recent activity"]}):(0,Z.jsx)("ul",{className:"space-y-1.5",children:e.map(a=>(0,Z.jsxs)("li",{className:"flex items-center justify-between text-xs",children:[(0,Z.jsx)("span",{className:"font-mono text-foreground/80 truncate",children:a.by}),(0,Z.jsxs)("span",{className:"text-muted-foreground shrink-0",children:[a.opCount," op",1!==a.opCount?"s":""]})]},a.by))})})]}),(0,Z.jsxs)("section",{className:"space-y-2",children:[(0,Z.jsx)("h3",{className:"text-xs font-semibold uppercase tracking-widest text-muted-foreground",children:"Recent Activity"}),(0,Z.jsx)("div",{className:"rounded-md border border-border bg-muted/40 px-3 py-1 max-h-72 overflow-y-auto",children:0===d.length?(0,Z.jsx)("p",{className:"text-xs text-muted-foreground/60 py-2",children:"No events recorded"}):d.map(a=>(0,Z.jsx)(Gr,{event:a},`${a.path}-${a.id}`))})]}),(0,Z.jsx)("section",{children:(0,Z.jsx)("a",{href:"/docs/agent-collab-plan.md",target:"_blank",rel:"noreferrer",className:"text-xs text-primary underline hover:no-underline",children:"Agent collaboration docs →"})})]})]})]}):null}var Gv=/[\\\/_+.#"@\[\(\{&]/,Gw=/[\\\/_+.#"@\[\(\{&]/g,Gx=/[\s-]/,Gy=/[\s-]/g;function Gz(a){return a.toLowerCase().replace(Gy," ")}var GA='[cmdk-group=""]',GB='[cmdk-group-items=""]',GC='[cmdk-item=""]',GD=`${GC}:not([aria-disabled="true"])`,GE="cmdk-item-select",GF="data-value",GG=(a,b,c)=>{var d;return d=a,function a(b,c,d,e,f,g,h){if(g===c.length)return f===b.length?1:.99;var i=`${f},${g}`;if(void 0!==h[i])return h[i];for(var j,k,l,m,n=e.charAt(g),o=d.indexOf(n,f),p=0;o>=0;)(j=a(b,c,d,e,o+1,g+1,h))>p&&(o===f?j*=1:Gv.test(b.charAt(o-1))?(j*=.8,(l=b.slice(f,o-1).match(Gw))&&f>0&&(j*=Math.pow(.999,l.length))):Gx.test(b.charAt(o-1))?(j*=.9,(m=b.slice(f,o-1).match(Gy))&&f>0&&(j*=Math.pow(.999,m.length))):(j*=.17,f>0&&(j*=Math.pow(.999,o-f))),b.charAt(o)!==c.charAt(g)&&(j*=.9999)),(j<.1&&d.charAt(o-1)===e.charAt(g+1)||e.charAt(g+1)===e.charAt(g)&&d.charAt(o-1)!==e.charAt(g))&&.1*(k=a(b,c,d,e,o+1,g+2,h))>j&&(j=.1*k),j>p&&(p=j),o=d.indexOf(n,o+1);return h[i]=p,p}(d=c&&c.length>0?`${d+" "+c.join(" ")}`:d,b,Gz(d),Gz(b),0,0,{})},GH=$.createContext(void 0),GI=$.createContext(void 0),GJ=$.createContext(void 0),GK=$.forwardRef((a,b)=>{let c=GU(()=>{var b,c;return{search:"",value:null!=(c=null!=(b=a.value)?b:a.defaultValue)?c:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),d=GU(()=>new Set),e=GU(()=>new Map),f=GU(()=>new Map),g=GU(()=>new Set),h=GS(a),{label:i,children:j,value:k,onValueChange:l,filter:m,shouldFilter:n,loop:o,disablePointerSelection:p=!1,vimBindings:q=!0,...r}=a,s=b$(),t=b$(),u=b$(),v=$.useRef(null),w=GX();GT(()=>{if(void 0!==k){let a=k.trim();c.current.value=a,x.emit()}},[k]),GT(()=>{w(6,D)},[]);let x=$.useMemo(()=>({subscribe:a=>(g.current.add(a),()=>g.current.delete(a)),snapshot:()=>c.current,setState:(a,b,d)=>{var e,f,g,i;if(!Object.is(c.current[a],b)){if(c.current[a]=b,"search"===a)C(),A(),w(1,B);else if("value"===a){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let a=document.getElementById(u);a?a.focus():null==(e=document.getElementById(s))||e.focus()}if(w(7,()=>{var a;c.current.selectedItemId=null==(a=E())?void 0:a.id,x.emit()}),d||w(5,D),(null==(f=h.current)?void 0:f.value)!==void 0){null==(i=(g=h.current).onValueChange)||i.call(g,null!=b?b:"");return}}x.emit()}},emit:()=>{g.current.forEach(a=>a())}}),[]),y=$.useMemo(()=>({value:(a,b,d)=>{var e;b!==(null==(e=f.current.get(a))?void 0:e.value)&&(f.current.set(a,{value:b,keywords:d}),c.current.filtered.items.set(a,z(b,d)),w(2,()=>{A(),x.emit()}))},item:(a,b)=>(d.current.add(a),b&&(e.current.has(b)?e.current.get(b).add(a):e.current.set(b,new Set([a]))),w(3,()=>{C(),A(),c.current.value||B(),x.emit()}),()=>{f.current.delete(a),d.current.delete(a),c.current.filtered.items.delete(a);let b=E();w(4,()=>{C(),(null==b?void 0:b.getAttribute("id"))===a&&B(),x.emit()})}),group:a=>(e.current.has(a)||e.current.set(a,new Set),()=>{f.current.delete(a),e.current.delete(a)}),filter:()=>h.current.shouldFilter,label:i||a["aria-label"],getDisablePointerSelection:()=>h.current.disablePointerSelection,listId:s,inputId:u,labelId:t,listInnerRef:v}),[]);function z(a,b){var d,e;let f=null!=(e=null==(d=h.current)?void 0:d.filter)?e:GG;return a?f(a,c.current.search,b):0}function A(){if(!c.current.search||!1===h.current.shouldFilter)return;let a=c.current.filtered.items,b=[];c.current.filtered.groups.forEach(c=>{let d=e.current.get(c),f=0;d.forEach(b=>{f=Math.max(a.get(b),f)}),b.push([c,f])});let d=v.current;F().sort((b,c)=>{var d,e;let f=b.getAttribute("id"),g=c.getAttribute("id");return(null!=(d=a.get(g))?d:0)-(null!=(e=a.get(f))?e:0)}).forEach(a=>{let b=a.closest(GB);b?b.appendChild(a.parentElement===b?a:a.closest(`${GB} > *`)):d.appendChild(a.parentElement===d?a:a.closest(`${GB} > *`))}),b.sort((a,b)=>b[1]-a[1]).forEach(a=>{var b;let c=null==(b=v.current)?void 0:b.querySelector(`${GA}[${GF}="${encodeURIComponent(a[0])}"]`);null==c||c.parentElement.appendChild(c)})}function B(){let a=F().find(a=>"true"!==a.getAttribute("aria-disabled")),b=null==a?void 0:a.getAttribute(GF);x.setState("value",b||void 0)}function C(){var a,b,g,i;if(!c.current.search||!1===h.current.shouldFilter){c.current.filtered.count=d.current.size;return}c.current.filtered.groups=new Set;let j=0;for(let e of d.current){let d=z(null!=(b=null==(a=f.current.get(e))?void 0:a.value)?b:"",null!=(i=null==(g=f.current.get(e))?void 0:g.keywords)?i:[]);c.current.filtered.items.set(e,d),d>0&&j++}for(let[a,b]of e.current)for(let d of b)if(c.current.filtered.items.get(d)>0){c.current.filtered.groups.add(a);break}c.current.filtered.count=j}function D(){var a,b,c;let d=E();d&&((null==(a=d.parentElement)?void 0:a.firstChild)===d&&(null==(c=null==(b=d.closest(GA))?void 0:b.querySelector('[cmdk-group-heading=""]'))||c.scrollIntoView({block:"nearest"})),d.scrollIntoView({block:"nearest"}))}function E(){var a;return null==(a=v.current)?void 0:a.querySelector(`${GC}[aria-selected="true"]`)}function F(){var a;return Array.from((null==(a=v.current)?void 0:a.querySelectorAll(GD))||[])}function G(a){let b=F()[a];b&&x.setState("value",b.getAttribute(GF))}function H(a){var b;let c=E(),d=F(),e=d.findIndex(a=>a===c),f=d[e+a];null!=(b=h.current)&&b.loop&&(f=e+a<0?d[d.length-1]:e+a===d.length?d[0]:d[e+a]),f&&x.setState("value",f.getAttribute(GF))}function I(a){let b=E(),c=null==b?void 0:b.closest(GA),d;for(;c&&!d;)d=null==(c=a>0?function(a,b){let c=a.nextElementSibling;for(;c;){if(c.matches(b))return c;c=c.nextElementSibling}}(c,GA):function(a,b){let c=a.previousElementSibling;for(;c;){if(c.matches(b))return c;c=c.previousElementSibling}}(c,GA))?void 0:c.querySelector(GD);d?x.setState("value",d.getAttribute(GF)):H(a)}let J=()=>G(F().length-1),K=a=>{a.preventDefault(),a.metaKey?J():a.altKey?I(1):H(1)},L=a=>{a.preventDefault(),a.metaKey?G(0):a.altKey?I(-1):H(-1)};return $.createElement(xg.div,{ref:b,tabIndex:-1,...r,"cmdk-root":"",onKeyDown:a=>{var b;null==(b=r.onKeyDown)||b.call(r,a);let c=a.nativeEvent.isComposing||229===a.keyCode;if(!(a.defaultPrevented||c))switch(a.key){case"n":case"j":q&&a.ctrlKey&&K(a);break;case"ArrowDown":K(a);break;case"p":case"k":q&&a.ctrlKey&&L(a);break;case"ArrowUp":L(a);break;case"Home":a.preventDefault(),G(0);break;case"End":a.preventDefault(),J();break;case"Enter":{a.preventDefault();let b=E();if(b){let a=new Event(GE);b.dispatchEvent(a)}}}}},$.createElement("label",{"cmdk-label":"",htmlFor:y.inputId,id:y.labelId,style:GZ},i),GY(a,a=>$.createElement(GI.Provider,{value:x},$.createElement(GH.Provider,{value:y},a))))}),GL=$.forwardRef((a,b)=>{var c,d;let e=b$(),f=$.useRef(null),g=$.useContext(GJ),h=$.useContext(GH),i=GS(a),j=null!=(d=null==(c=i.current)?void 0:c.forceMount)?d:null==g?void 0:g.forceMount;GT(()=>{if(!j)return h.item(e,null==g?void 0:g.id)},[j]);let k=GW(e,f,[a.value,a.children,f],a.keywords),l=$.useContext(GI),m=GV(a=>a.value&&a.value===k.current),n=GV(a=>!!j||!1===h.filter()||!a.search||a.filtered.items.get(e)>0);function o(){var a,b;p(),null==(b=(a=i.current).onSelect)||b.call(a,k.current)}function p(){l.setState("value",k.current,!0)}if($.useEffect(()=>{let b=f.current;if(!(!b||a.disabled))return b.addEventListener(GE,o),()=>b.removeEventListener(GE,o)},[n,a.onSelect,a.disabled]),!n)return null;let{disabled:q,value:r,onSelect:s,forceMount:t,keywords:u,...v}=a;return $.createElement(xg.div,{ref:aF(f,b),...v,id:e,"cmdk-item":"",role:"option","aria-disabled":!!q,"aria-selected":!!m,"data-disabled":!!q,"data-selected":!!m,onPointerMove:q||h.getDisablePointerSelection()?void 0:p,onClick:q?void 0:o},a.children)}),GM=$.forwardRef((a,b)=>{let{heading:c,children:d,forceMount:e,...f}=a,g=b$(),h=$.useRef(null),i=$.useRef(null),j=b$(),k=$.useContext(GH),l=GV(a=>!!e||!1===k.filter()||!a.search||a.filtered.groups.has(g));GT(()=>k.group(g),[]),GW(g,h,[a.value,a.heading,i]);let m=$.useMemo(()=>({id:g,forceMount:e}),[e]);return $.createElement(xg.div,{ref:aF(h,b),...f,"cmdk-group":"",role:"presentation",hidden:!l||void 0},c&&$.createElement("div",{ref:i,"cmdk-group-heading":"","aria-hidden":!0,id:j},c),GY(a,a=>$.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":c?j:void 0},$.createElement(GJ.Provider,{value:m},a))))}),GN=$.forwardRef((a,b)=>{let{alwaysRender:c,...d}=a,e=$.useRef(null),f=GV(a=>!a.search);return c||f?$.createElement(xg.div,{ref:aF(e,b),...d,"cmdk-separator":"",role:"separator"}):null}),GO=$.forwardRef((a,b)=>{let{onValueChange:c,...d}=a,e=null!=a.value,f=$.useContext(GI),g=GV(a=>a.search),h=GV(a=>a.selectedItemId),i=$.useContext(GH);return $.useEffect(()=>{null!=a.value&&f.setState("search",a.value)},[a.value]),$.createElement(xg.input,{ref:b,...d,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":i.listId,"aria-labelledby":i.labelId,"aria-activedescendant":h,id:i.inputId,type:"text",value:e?a.value:g,onChange:a=>{e||f.setState("search",a.target.value),null==c||c(a.target.value)}})}),GP=$.forwardRef((a,b)=>{let{children:c,label:d="Suggestions",...e}=a,f=$.useRef(null),g=$.useRef(null),h=GV(a=>a.selectedItemId),i=$.useContext(GH);return $.useEffect(()=>{if(g.current&&f.current){let a=g.current,b=f.current,c,d=new ResizeObserver(()=>{c=requestAnimationFrame(()=>{let c=a.offsetHeight;b.style.setProperty("--cmdk-list-height",c.toFixed(1)+"px")})});return d.observe(a),()=>{cancelAnimationFrame(c),d.unobserve(a)}}},[]),$.createElement(xg.div,{ref:aF(f,b),...e,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":h,"aria-label":d,id:i.listId},GY(a,a=>$.createElement("div",{ref:aF(g,i.listInnerRef),"cmdk-list-sizer":""},a)))}),GQ=$.forwardRef((a,b)=>{let{open:c,onOpenChange:d,overlayClassName:e,contentClassName:f,container:g,...h}=a;return $.createElement(c8,{open:c,onOpenChange:d},$.createElement(dd,{container:g},$.createElement(df,{"cmdk-overlay":"",className:e}),$.createElement(dj,{"aria-label":a.label,"cmdk-dialog":"",className:f},$.createElement(GK,{ref:b,...h}))))}),GR=Object.assign(GK,{List:GP,Item:GL,Input:GO,Group:GM,Separator:GN,Dialog:GQ,Empty:$.forwardRef((a,b)=>GV(a=>0===a.filtered.count)?$.createElement(xg.div,{ref:b,...a,"cmdk-empty":"",role:"presentation"}):null),Loading:$.forwardRef((a,b)=>{let{progress:c,children:d,label:e="Loading...",...f}=a;return $.createElement(xg.div,{ref:b,...f,"cmdk-loading":"",role:"progressbar","aria-valuenow":c,"aria-valuemin":0,"aria-valuemax":100,"aria-label":e},GY(a,a=>$.createElement("div",{"aria-hidden":!0},a)))})});function GS(a){let b=$.useRef(a);return GT(()=>{b.current=a}),b}var GT=$.useEffect;function GU(a){let b=$.useRef();return void 0===b.current&&(b.current=a()),b}function GV(a){let b=$.useContext(GI),c=()=>a(b.snapshot());return $.useSyncExternalStore(b.subscribe,c,c)}function GW(a,b,c,d=[]){let e=$.useRef(),f=$.useContext(GH);return GT(()=>{var g;let h=(()=>{var a;for(let b of c){if("string"==typeof b)return b.trim();if("object"==typeof b&&"current"in b)return b.current?null==(a=b.current.textContent)?void 0:a.trim():e.current}})(),i=d.map(a=>a.trim());f.value(a,h,i),null==(g=b.current)||g.setAttribute(GF,h),e.current=h}),e}var GX=()=>{let[a,b]=$.useState(),c=GU(()=>new Map);return GT(()=>{c.current.forEach(a=>a()),c.current=new Map},[a]),(a,d)=>{c.current.set(a,d),b({})}};function GY({asChild:a,children:b},c){let d;return a&&$.isValidElement(b)?$.cloneElement("function"==typeof(d=b.type)?d(b.props):"render"in d?d.render(b.props):b,{ref:b.ref},c(b.props.children)):c(b)}var GZ={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};let G$=ad("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),G_=$.forwardRef(({className:a,...b},c)=>(0,Z.jsx)(GR,{ref:c,className:bS("flex h-full w-full flex-col overflow-hidden rounded-sm bg-popover text-popover-foreground",a),...b}));function G0({children:a,shouldFilter:b,...c}){return(0,Z.jsx)(c8,{...c,children:(0,Z.jsxs)(dB,{className:"overflow-hidden p-0 shadow-golden max-w-lg",children:[(0,Z.jsx)(dE,{className:"sr-only",children:"Search"}),(0,Z.jsx)(G_,{shouldFilter:b,className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-normal [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:a})]})})}G_.displayName=GR.displayName;let G1=$.forwardRef(({className:a,...b},c)=>(0,Z.jsxs)("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[(0,Z.jsx)(G$,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),(0,Z.jsx)(GR.Input,{ref:c,className:bS("flex h-11 w-full rounded-sm bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",a),...b})]}));G1.displayName=GR.Input.displayName;let G2=$.forwardRef(({className:a,...b},c)=>(0,Z.jsx)(GR.List,{ref:c,className:bS("max-h-[300px] overflow-y-auto overflow-x-hidden",a),...b}));G2.displayName=GR.List.displayName;let G3=$.forwardRef((a,b)=>(0,Z.jsx)(GR.Empty,{ref:b,className:"py-6 text-center text-sm text-muted-foreground",...a}));G3.displayName=GR.Empty.displayName;let G4=$.forwardRef(({className:a,...b},c)=>(0,Z.jsx)(GR.Group,{ref:c,className:bS("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-normal [&_[cmdk-group-heading]]:text-muted-foreground",a),...b}));G4.displayName=GR.Group.displayName,$.forwardRef(({className:a,...b},c)=>(0,Z.jsx)(GR.Separator,{ref:c,className:bS("-mx-1 h-px bg-border",a),...b})).displayName=GR.Separator.displayName;let G5=$.forwardRef(({className:a,...b},c)=>(0,Z.jsx)(GR.Item,{ref:c,className:bS("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",a),...b}));G5.displayName=GR.Item.displayName;let G6=null,G7=u1(a=>({query:"",results:[],loading:!1,truncated:!1,open:!1,setQuery:b=>a({query:b}),setOpen:b=>a({open:b}),clear:()=>{G6?.abort(),a({query:"",results:[],loading:!1,truncated:!1})},search:async b=>{G6?.abort();let c=new AbortController;if(G6=c,!b.trim())return void a({results:[],loading:!1,truncated:!1});a({loading:!0});try{let d=await dJ("/api/wiki/search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:b,limit:30}),signal:c.signal});if(!d.ok)return void a({results:[],loading:!1,truncated:!1});let e=await d.json();if(c.signal.aborted)return;a({results:e.matches??[],truncated:!!e.truncated,loading:!1})}catch(b){"AbortError"!==b.name&&a({loading:!1})}}}));function G8({html:a}){let b=function(a){let b,c=[],d=/<mark>([\s\S]*?)<\/mark>/g,e=0;for(;null!==(b=d.exec(a));)b.index>e&&c.push({text:a.slice(e,b.index),mark:!1}),c.push({text:b[1]??"",mark:!0}),e=b.index+b[0].length;return e<a.length&&c.push({text:a.slice(e),mark:!1}),c}(a);return(0,Z.jsx)(Z.Fragment,{children:b.map((a,b)=>a.mark?(0,Z.jsx)("mark",{className:"bg-yellow-200 dark:bg-yellow-700 rounded-[2px] px-[1px]",children:a.text},b):(0,Z.jsx)("span",{children:a.text},b))})}function G9({onOpenFile:a}){let b=G7(a=>a.open),c=G7(a=>a.setOpen),d=G7(a=>a.query),e=G7(a=>a.setQuery),f=G7(a=>a.results),g=G7(a=>a.loading),h=G7(a=>a.truncated),i=G7(a=>a.search);return(0,$.useEffect)(()=>{function a(a){(a.metaKey||a.ctrlKey)&&"k"===a.key.toLowerCase()&&(a.preventDefault(),c(!b))}return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[b,c]),(0,$.useEffect)(()=>{if(!b)return;let a=setTimeout(()=>{i(d)},120);return()=>clearTimeout(a)},[d,b,i]),(0,Z.jsxs)(G0,{open:b,onOpenChange:c,shouldFilter:!1,children:[(0,Z.jsx)(G1,{placeholder:"Search files…",value:d,onValueChange:e}),(0,Z.jsxs)(G2,{children:[g&&(0,Z.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"Searching…"}),!g&&""!==d.trim()&&0===f.length&&(0,Z.jsx)(G3,{children:"No matches."}),f.length>0&&(0,Z.jsx)(G4,{heading:h?"Top results (refine query for more)":"Results",children:f.map(b=>(0,Z.jsx)(G5,{value:b.path,onSelect:()=>{a(b.path),c(!1)},children:(0,Z.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,Z.jsx)("span",{className:"truncate font-mono text-xs",children:b.path}),b.snippet&&(0,Z.jsx)("span",{className:"truncate text-xs text-muted-foreground",children:(0,Z.jsx)(G8,{html:b.snippet})})]})},b.path))})]})]})}function Ha({onOpenFile:a}){let b=G7(a=>a.query),c=G7(a=>a.setQuery),d=G7(a=>a.results),e=G7(a=>a.loading),f=G7(a=>a.search),g=G7(a=>a.clear),[h,i]=(0,$.useState)(0),j=(0,$.useRef)(null);function k(b){let c=d[b];c&&(a(c.path),g())}return(0,$.useEffect)(()=>{i(0)},[d]),(0,$.useEffect)(()=>{let a=j.current?.querySelector(`[data-idx="${h}"]`);a?.scrollIntoView({block:"nearest"})},[h]),(0,Z.jsxs)("div",{className:"flex flex-col gap-1 px-2 py-1.5",children:[(0,Z.jsxs)("div",{className:"relative",children:[(0,Z.jsx)(G$,{className:"pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 opacity-50"}),(0,Z.jsx)("input",{type:"text",className:"w-full rounded-sm border bg-transparent py-1 pl-7 pr-2 text-xs outline-none focus:ring-1 focus:ring-ring",placeholder:"Search… (⌘K)",value:b,onChange:a=>{c(a.target.value),f(a.target.value)},onKeyDown:a=>{"Escape"===a.key?g():0!==d.length&&("ArrowDown"===a.key?(a.preventDefault(),i(a=>(a+1)%d.length)):"ArrowUp"===a.key?(a.preventDefault(),i(a=>(a-1+d.length)%d.length)):"Enter"===a.key&&(a.preventDefault(),k(h)))}})]}),""!==b.trim()&&(0,Z.jsxs)("div",{ref:j,className:"max-h-64 overflow-y-auto rounded-sm border bg-popover",children:[e&&(0,Z.jsx)("div",{className:"px-2 py-1 text-xs text-muted-foreground",children:"Searching…"}),!e&&0===d.length&&(0,Z.jsx)("div",{className:"px-2 py-1 text-xs text-muted-foreground",children:"No matches"}),d.map((a,b)=>(0,Z.jsxs)("button",{type:"button","data-idx":b,onClick:()=>k(b),onMouseEnter:()=>i(b),className:`block w-full px-2 py-1 text-left ${b===h?"bg-accent":"hover:bg-accent"}`,children:[(0,Z.jsx)("div",{className:"truncate font-mono text-xs",children:a.path}),a.snippet&&(0,Z.jsx)("div",{className:"truncate text-[10px] text-muted-foreground",children:(0,Z.jsx)(G8,{html:a.snippet})})]},a.path))]})]})}function Hb({className:a}){let b=vh(a=>a.width),c=vh(a=>a.setWidth);return(0,Z.jsxs)(FK,{children:[(0,Z.jsx)(FM,{asChild:!0,children:(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:`h-7 w-7 p-0 ${a??""}`,title:`Content width: ${vf[b]}`,children:(0,Z.jsx)(wN,{className:"h-3.5 w-3.5"})})}),(0,Z.jsx)(FZ,{align:"end",className:"w-36",children:vg.map(a=>(0,Z.jsxs)(F$,{onClick:()=>c(a),className:"flex items-center justify-between text-xs",children:[vf[a],a===b&&(0,Z.jsx)(ag,{className:"h-3.5 w-3.5"})]},a))})]})}function Hc(a){return a.split(".").pop()?.toLowerCase()??""}function Hd(a,b){if("node-app"===b)return"node-app";if("app"===b)return"app";if("dir"===b)return"fallback";let c=Hc(a);return c?["md","markdown"].includes(c)?"editor":"txt"===c?"text":["csv","tsv"].includes(c)?"csv":"pdf"===c?"pdf":["mmd","mermaid"].includes(c)?"mermaid":"ipynb"===c?"notebook":["png","jpg","jpeg","gif","webp","svg","avif","ico","bmp"].includes(c)?"image":["mp4","webm","mov","m4v","mp3","wav","ogg","m4a","aac"].includes(c)?"media":"docx"===c?"docx":["xlsx","xlsm"].includes(c)?"xlsx":"pptx"===c?"pptx":"html"===c?"html":["py","js","ts","tsx","jsx","go","rs","java","c","cpp","h","sh","bash","zsh","rb","php","swift","kt","lua","sql","yaml","yml","toml","json","xml","css","scss"].includes(c)?"source":"fallback":"fallback"}let He=new Set(["txt","md","markdown","json","yaml","yml","toml","csv","tsv","xml","html","css","js","ts","tsx","jsx","sh","bash","zsh","rb","py","go","rs","java","c","cpp","h","php","swift","kt","lua","sql","scss","mmd","mermaid","ini","env","log","conf"]);function Hf(a){let b=Hd(a,"file");return"editor"===b||"text"===b||He.has(Hc(a))}function Hg(a){return["md","markdown"].includes(Hc(a))}function Hh(a){return"image"===Hd(a,"file")}async function Hi(a){let b=await dJ(`/api/wiki?dir=${encodeURIComponent(a)}`);return b.ok?(await b.json()).entries.map(b=>({name:b.name,path:a?`${a}/${b.name}`:b.name,type:b.type,size:b.size,modifiedAt:b.modifiedAt,expanded:!1})):[]}function Hj(a,b,c){return a.map(a=>a.path===b?c(a):a.children?{...a,children:Hj(a.children,b,c)}:a)}a.s(["default",0,function(){let a;vi(a=>a.loadedAt),(0,$.useEffect)(()=>{vi.getState().load()},[]);let[b,c]=(0,$.useState)(null),[d,e]=(0,$.useState)(null),[f,g]=(0,$.useState)(()=>null),[h,i]=(0,$.useState)([]),[j,k]=(0,$.useState)(!1),[l,m]=(0,$.useState)(!1),[n,o]=(0,$.useState)(null),p=(0,$.useCallback)(async()=>{try{let a=await fetch("/api/system/workspaces");if(!a.ok)throw Error("Failed");let b=await a.json();if(i(b.workspaces),k(b.isAdmin),b.workspaces.length>0){c(!0);let a=new URLSearchParams(window.location.search).get("ws"),d=a?b.workspaces.find(b=>b.id===a):null,f=d??[...b.workspaces].sort((a,b)=>(b.lastOpenedAt??b.createdAt).localeCompare(a.lastOpenedAt??a.createdAt))[0];if(g(f.id),e(f.rootDir),!d){let a=new URL(location.href);a.searchParams.set("ws",f.id),history.replaceState(null,"",a.toString())}}else c(!1)}catch{c(!1)}},[]);(0,$.useEffect)(()=>{p()},[p]);let q=vb(a=>a.currentPath),r=(0,$.useRef)(null),s=(0,$.useRef)(!1),[t,u]=(0,$.useState)([]),[v,w]=(0,$.useState)(!1),[x,y]=(0,$.useState)(!1),z=(0,$.useRef)(!1),[A,B]=(0,$.useState)(!1),[C,D]=(0,$.useState)(!1),[E,F]=(0,$.useState)(null),G=(0,$.useRef)(null),H=(0,$.useRef)(""),[I,J]=(0,$.useState)(null),[K,L]=(0,$.useState)(""),[M,N]=(0,$.useState)(null),[O,P]=(0,$.useState)(null),[Q,R]=(0,$.useState)(""),[S,T]=(0,$.useState)(null),[U,V]=(0,$.useState)(null),[W,X]=(0,$.useState)(!1),[Y,_]=(0,$.useState)(null),[aa,ab]=(0,$.useState)(!1),[ac,ad]=(0,$.useState)(0),[aE,aF]=(0,$.useState)(!1),[aG,aH]=(0,$.useState)(!1),[aI,aJ]=(0,$.useState)(null),[aK,aL]=(0,$.useState)(0),[aM,aN]=(0,$.useState)(!1),[aO,aP]=(0,$.useState)(!1),[aQ,aR]=(0,$.useState)(""),[aS,aT]=(0,$.useState)(!1),[aU,aV]=(0,$.useState)(null),aW=(0,$.useRef)(null),[aX,aY]=(0,$.useState)(null),aZ=(0,$.useRef)(null),a$=(0,$.useRef)(!1),a_=(0,$.useRef)(async()=>{});(0,$.useEffect)(()=>{v||z.current||(z.current=!0,y(!0),Hi("").then(a=>{u(a),w(!0),y(!1)}).catch(()=>{z.current=!1,y(!1)}))},[v]);let a0=(0,$.useCallback)(async a=>{let b=a.split("/");if(b.length<=1)return;let c=[],d="";for(let a=0;a<b.length-1;a++)d=d?`${d}/${b[a]}`:b[a],c.push({prefix:d,children:await Hi(d)});u(a=>{let b=a;for(let{prefix:a,children:d}of c)b=Hj(b,a,a=>({...a,children:d,expanded:!0}));return b})},[]),a1=(0,$.useCallback)(async a=>{let b=await Hi(a);""===a?u(a=>{let c=new Map(a.map(a=>[a.path,a]));return b.map(a=>{let b=c.get(a.path);return b&&("dir"===b.type||"app"===b.type)?{...a,expanded:b.expanded,children:b.children}:a})}):u(c=>Hj(c,a,a=>({...a,children:b,expanded:!0})))},[]),a2=(0,$.useCallback)(a=>{let b=[];for(let c of a)("dir"===c.type||"app"===c.type)&&c.expanded&&c.children&&(b.push(c.path),b.push(...a2(c.children)));return b},[]),a3=(0,$.useCallback)(async()=>{B(!0);try{let a=a2(t),b=await Hi("");for(let c of(u(b),a)){let a=await Hi(c);u(b=>Hj(b,c,b=>({...b,children:a,expanded:!0})))}}finally{B(!1)}},[t,a2]),a4=(0,$.useCallback)(async()=>{if(Y&&(["editor","text"].includes(Hd(Y.name,Y.nodeType))||Hf(Y.name))){aN(!0);try{let a=await dJ(`/api/wiki/content?path=${encodeURIComponent(Y.path)}`);if(a.ok){let b=await a.json();aJ(b.content),aL(Number(a.headers.get("X-Wiki-Revision")??0))}}catch{}aN(!1)}},[Y]);async function a5(a){if("dir"===a.type||"app"===a.type)if(a.expanded)u(b=>Hj(b,a.path,a=>({...a,expanded:!1})));else if(void 0===a.children){u(b=>Hj(b,a.path,a=>({...a,loading:!0})));let b=await Hi(a.path);u(c=>Hj(c,a.path,a=>({...a,loading:!1,children:b,expanded:!0})))}else u(b=>Hj(b,a.path,a=>({...a,expanded:!0})))}async function a6(a){if(_({path:a.path,name:a.name,nodeType:"app"===a.type?"app":"node-app"===a.type?"node-app":"file"}),aP(!1),aV(null),aJ(null),aL(0),["editor","text"].includes(Hd(a.name,a.type))||Hf(a.name)){aN(!0);try{let b=await dJ(`/api/wiki/content?path=${encodeURIComponent(a.path)}`);if(b.ok){let a=await b.json();aJ(a.content),aL(Number(b.headers.get("X-Wiki-Revision")??0))}}catch{}aN(!1)}}(0,$.useEffect)(()=>{aZ.current=Y},[Y]),(0,$.useEffect)(()=>{a$.current=aO},[aO]),(0,$.useEffect)(()=>{a_.current=a4},[a4]),(0,$.useEffect)(()=>{if(!b)return;let a=new Map,c=new EventSource("/api/wiki/watch");return c.onmessage=b=>{var c;let d;try{d=JSON.parse(b.data)}catch{return}let{type:e,path:f}=d,g=f.split("/");if(c=g.length>1?g.slice(0,-1).join("/"):"",a.has(c)&&clearTimeout(a.get(c)),a.set(c,setTimeout(()=>{a.delete(c),a1(c)},300)),"change"===e&&aZ.current?.path===f&&!a$.current){let b=`__file__${f}`;a.has(b)&&clearTimeout(a.get(b)),a.set(b,setTimeout(()=>{a.delete(b),a_.current()},400))}},()=>{for(let b of(c.close(),a.values()))clearTimeout(b)}},[b,a1]),(0,$.useEffect)(()=>{ab(!1)},[]);let a7=(0,$.useCallback)(a=>{let b=a.split("/").pop()??a;a0(a),a6({path:a,name:b,type:"file"})},[a0]);(0,$.useEffect)(()=>{if(!q||Y&&Y.path===q)return;let a=q.split("/").pop()??q;a6({path:q,name:a,type:"file"})},[q]),(0,$.useEffect)(()=>{},[Y]),(0,$.useEffect)(()=>{if(s.current||!v)return;let a=r.current;if(!a){s.current=!0;return}s.current=!0,(async()=>{let b=a.split("/"),c=b[b.length-1],d=b.slice(0,-1).join("/"),e=(await Hi(d)).find(b=>b.path===a);e&&(await a0(a),a6({path:a,name:c,type:e.type,modifiedAt:e.modifiedAt}))})()},[v,a0]);let a8=(0,$.useCallback)(async a=>{if(a===f)return;try{await fetch(`/api/system/workspaces/${a}/open`,{method:"POST"})}catch{}let b=new URL(location.href);b.searchParams.set("ws",a),b.searchParams.delete("path"),history.pushState(null,"",b.toString()),_(null),aJ(null),aP(!1),u([]),w(!1),z.current=!1,vi.getState().invalidate();let c=h.find(b=>b.id===a);c&&e(c.rootDir),g(a)},[f,h]),a9=(0,$.useCallback)(async()=>{if(n)try{if(!(await fetch(`/api/system/workspaces/${n}`,{method:"DELETE"})).ok)throw Error("Failed");if(n===f){let a=h.filter(a=>a.id!==n);if(a.length>0){let b=[...a].sort((a,b)=>(b.lastOpenedAt??b.createdAt).localeCompare(a.lastOpenedAt??a.createdAt))[0];await a8(b.id)}else c(!1)}await p()}catch{}finally{o(null)}},[n,f,h,a8,p]);async function ba(){if(!Y)return;aT(!0),aV(null);let a=await dJ("/api/wiki/content",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:Y.path,content:aQ,baseRevision:aK})});if(a.ok){let b=await a.json();"number"==typeof b.revision&&aL(b.revision),aJ(aQ),aP(!1)}else aV((await a.json()).error??"Save failed");aT(!1)}let bb=(0,$.useCallback)(async(a,b)=>{let c=Array.from(a);if(c.length){D(!0),F(null);try{for(let a of c){let c=new FormData;c.append("file",a),c.append("dir",b);let d=await dJ("/api/wiki/upload",{method:"POST",body:c});if(!d.ok){let a=await d.json();F(a.error??"Upload failed"),C$(a.error??"Upload failed");break}}await a1(b)}catch{F("Upload failed.")}finally{D(!1),G.current&&(G.current.value="")}}},[a1]);function bc(a){H.current=a,G.current?.click()}async function bd(){let a=K.trim();if(!a||null===I)return;N(null);let b=I?`${I}/${a}`:a,c=await dJ("/api/wiki/folder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:b})});c.ok?(J(null),L(""),await a1(I),""!==I&&u(a=>Hj(a,I,a=>({...a,expanded:!0})))):N((await c.json()).error??"Failed")}async function be(){let a=Q.trim();if(!a||null===O)return;T(null);let b=a.includes(".")?a:`${a}.md`,c=O?`${O}/${b}`:b,d=await dJ("/api/wiki/new-file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:c})});d.ok?(P(null),R(""),await a1(O),""!==O&&u(a=>Hj(a,O,a=>({...a,expanded:!0}))),a6({path:c,name:b,type:"file",modifiedAt:new Date().toISOString()})):T((await d.json()).error??"Failed")}async function bf(){U&&(await dJ("/api/wiki",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:U})}),(Y?.path===U||Y?.path.startsWith(`${U}/`))&&(_(null),aJ(null)),u(a=>(function a(b,c){return b.filter(a=>a.path!==c).map(b=>b.children?{...b,children:a(b.children,c)}:b)})(a,U)),V(null))}function bg(a,b,c){a.preventDefault(),a.stopPropagation();let d=aW.current;!d||d.path===b||b.startsWith(`${d.path}/`)||(a.dataTransfer.dropEffect="move",aY("root"===c?"":b))}async function bh(a,b){a.preventDefault(),a.stopPropagation(),aY(null);let c=aW.current;if(aW.current=null,!c||c.path===b||b.startsWith(`${c.path}/`))return;let d=b?`${b}/${c.name}`:c.name;if(d!==c.path&&(await dJ("/api/wiki/move",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:c.path,to:d})})).ok){let a=c.path.includes("/")?c.path.split("/").slice(0,-1).join("/"):"";await a1(a),b!==a&&await a1(b),Y?.path===c.path&&_({path:d,name:c.name,nodeType:Y.nodeType})}}let bi=Y?Hd(Y.name,Y.nodeType):null,bj=vh(a=>a.width),bk=null===bi||"editor"===bi||"text"===bi||"source"===bi||"notebook"===bi||"fallback"===bi,bl=bk?vd[bj]:"";return(0,Z.jsxs)("div",{className:"flex h-screen gap-0 overflow-hidden bg-background",children:[null===b&&(0,Z.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,Z.jsx)(as,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),!1===b&&(0,Z.jsx)(El,{onSelect:a=>{let b=new URL(location.href);b.searchParams.set("ws",a),b.searchParams.delete("path"),history.replaceState(null,"",b.toString()),w(!1),z.current=!1,g(a),c(!0),p()}}),!0===b&&l&&(0,Z.jsxs)("div",{className:"flex-1 flex flex-col",children:[(0,Z.jsx)("div",{className:"flex items-center justify-end border-b px-3 py-2 bg-muted shrink-0",children:(0,Z.jsxs)(bU,{size:"sm",variant:"ghost",className:"h-7 gap-1.5 text-xs",onClick:()=>m(!1),children:[(0,Z.jsx)(aD,{className:"h-3.5 w-3.5"})," Cancel"]})}),(0,Z.jsx)(El,{onSelect:a=>{m(!1),p(),a8(a)}})]}),!0===b&&!l&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(G9,{onOpenFile:a7}),!aE&&(0,Z.jsxs)(Ga,{className:"flex flex-col w-72 shrink-0 overflow-hidden rounded-none border-r border-l-0 border-t-0 border-b-0",children:[(0,Z.jsxs)("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b bg-muted shrink-0",children:[(0,Z.jsxs)("div",{className:"flex min-w-0 items-center gap-1.5",children:[(0,Z.jsx)("img",{src:"/logo.svg",alt:"Wiki Viewer",className:"h-5 w-5 shrink-0"}),(0,Z.jsx)("span",{className:"truncate text-xs font-semibold tracking-tight",children:"Wiki Viewer"})]}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 shrink-0",title:"Collapse sidebar",onClick:()=>aF(!0),children:(0,Z.jsx)(au,{className:"h-3.5 w-3.5"})})]}),(0,Z.jsxs)("div",{className:"flex items-center justify-between gap-1 px-3 py-1.5 border-b bg-muted/50 shrink-0",children:[(0,Z.jsxs)(FK,{children:[(0,Z.jsx)(FM,{asChild:!0,children:(0,Z.jsxs)(bU,{size:"sm",variant:"ghost",className:"h-7 gap-1 px-2 text-xs",disabled:C,children:[C?(0,Z.jsx)(as,{className:"h-3.5 w-3.5 animate-spin"}):(0,Z.jsx)(ax,{className:"h-3.5 w-3.5"}),"New",(0,Z.jsx)(ah,{className:"h-3 w-3 opacity-60"})]})}),(0,Z.jsxs)(FZ,{align:"start",className:"w-44",children:[(0,Z.jsxs)(F$,{onClick:()=>{P(""),R(""),T(null)},children:[(0,Z.jsx)(al,{className:"mr-2 h-3.5 w-3.5"}),"New file"]}),(0,Z.jsxs)(F$,{onClick:()=>{J(""),L(""),N(null)},children:[(0,Z.jsx)(ap,{className:"mr-2 h-3.5 w-3.5"}),"New folder"]}),(0,Z.jsxs)(F$,{onClick:()=>bc(""),disabled:C,children:[(0,Z.jsx)(aC,{className:"mr-2 h-3.5 w-3.5"}),"Upload"]})]})]}),(0,Z.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",title:"Refresh tree",onClick:a3,disabled:A,children:A?(0,Z.jsx)(as,{className:"h-3.5 w-3.5 animate-spin"}):(0,Z.jsx)(ay,{className:"h-3.5 w-3.5"})}),(0,Z.jsx)(F3,{}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",title:"AI Agent panel",onClick:()=>u2.getState().toggle(),children:(0,Z.jsx)(af,{className:"h-3.5 w-3.5"})}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",title:"Settings",onClick:()=>aH(!0),children:(0,Z.jsx)(az,{className:"h-3.5 w-3.5"})})]})]}),E&&(0,Z.jsxs)("div",{className:"flex items-center gap-1.5 px-3 py-1.5 text-xs text-destructive bg-destructive/10 shrink-0",children:[(0,Z.jsx)(ae,{className:"h-3.5 w-3.5 shrink-0"}),E]}),""===I&&(0,Z.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-1 border-b shrink-0",children:[(0,Z.jsx)(an,{className:"h-4 w-4 shrink-0 text-warning"}),(0,Z.jsx)("input",{className:"flex-1 bg-transparent text-sm outline-none border-b border-border min-w-0",placeholder:"Folder name",value:K,onChange:a=>L(a.target.value),onKeyDown:a=>{"Enter"===a.key&&bd(),"Escape"===a.key&&(J(null),L(""))}}),M&&(0,Z.jsx)("span",{className:"text-xs text-destructive",children:M}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:bd,children:(0,Z.jsx)(ag,{className:"h-3 w-3"})}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:()=>{J(null),L("")},children:(0,Z.jsx)(aD,{className:"h-3 w-3"})})]}),""===O&&(0,Z.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-1 border-b shrink-0",children:[(0,Z.jsx)(am,{className:"h-4 w-4 shrink-0 text-accent"}),(0,Z.jsx)("input",{autoFocus:!0,className:"flex-1 bg-transparent text-sm outline-none border-b border-border min-w-0",placeholder:"filename (default .md)",value:Q,onChange:a=>R(a.target.value),onKeyDown:a=>{"Enter"===a.key&&be(),"Escape"===a.key&&(P(null),R(""))}}),S&&(0,Z.jsx)("span",{className:"text-xs text-destructive",children:S}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:be,children:(0,Z.jsx)(ag,{className:"h-3 w-3"})}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:()=>{P(null),R("")},children:(0,Z.jsx)(aD,{className:"h-3 w-3"})})]}),(0,Z.jsx)("div",{className:"border-b",children:(0,Z.jsx)(Ha,{onOpenFile:a7})}),(0,Z.jsx)("div",{className:bS("flex-1 overflow-auto py-1",""===aX&&"ring-2 ring-inset ring-primary bg-primary/5"),onDragOver:a=>bg(a,"","root"),onDragLeave:a=>{a.currentTarget.contains(a.relatedTarget)||aY(null)},onDrop:a=>bh(a,""),children:x?(0,Z.jsx)("div",{className:"flex justify-center py-6",children:(0,Z.jsx)(as,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):0===t.length?(0,Z.jsxs)("div",{className:"flex flex-col items-center gap-3 px-4 py-8 text-center",children:[(0,Z.jsx)("div",{className:"rounded-full bg-muted p-3",children:(0,Z.jsx)(am,{className:"h-6 w-6 text-muted-foreground"})}),(0,Z.jsxs)("div",{className:"space-y-1",children:[(0,Z.jsx)("p",{className:"text-sm font-medium",children:"No files yet"}),(0,Z.jsx)("p",{className:"text-xs text-muted-foreground",children:"Upload files or add them to the configured directory"})]}),(0,Z.jsxs)(bU,{size:"sm",variant:"outline",className:"w-full gap-1.5 max-w-[180px]",onClick:()=>bc(""),disabled:C,children:[C?(0,Z.jsx)(as,{className:"h-3.5 w-3.5 animate-spin"}):(0,Z.jsx)(aC,{className:"h-3.5 w-3.5"}),"Upload Files"]})]}):function a(b,c=0){return b.map(b=>(0,Z.jsxs)("div",{children:[(0,Z.jsxs)("div",{role:"treeitem",tabIndex:0,draggable:!0,onKeyDown:a=>{("Enter"===a.key||" "===a.key)&&(a.preventDefault(),"dir"===b.type?a5(b):"app"===b.type?(a6(b),a5(b)):a6(b))},onDragStart:a=>{aW.current=b,a.dataTransfer.effectAllowed="move",a.dataTransfer.setData("text/plain",b.path)},onDragOver:a=>"dir"===b.type?bg(a,b.path,"dir"):a.preventDefault(),onDragLeave:()=>aY(null),onDrop:a=>"dir"===b.type?bh(a,b.path):a.preventDefault(),className:bS("flex items-center gap-1.5 rounded-sm px-2 py-1 text-sm cursor-pointer group transition-colors select-none",Y?.path===b.path?"bg-accent-soft text-foreground font-medium":"hover:bg-muted",aX===b.path&&"ring-2 ring-primary bg-primary-soft",b.name.startsWith(".")&&"opacity-40"),style:{paddingLeft:`${14*c+8}px`},onClick:()=>{"dir"===b.type?a5(b):"app"===b.type?(a6(b),a5(b)):a6(b)},children:["dir"===b.type||"app"===b.type?b.loading?(0,Z.jsx)(as,{className:"h-3.5 w-3.5 shrink-0 animate-spin text-muted-foreground"}):b.expanded?(0,Z.jsx)(ah,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):(0,Z.jsx)(ai,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):(0,Z.jsx)("span",{className:"w-3.5 shrink-0"}),"dir"===b.type?b.expanded?(0,Z.jsx)(ao,{className:bS("h-4 w-4 shrink-0",Y?.path!==b.path&&"text-warning")}):(0,Z.jsx)(an,{className:bS("h-4 w-4 shrink-0",Y?.path!==b.path&&"text-warning")}):"app"===b.type?(0,Z.jsx)(aq,{className:bS("h-4 w-4 shrink-0",Y?.path!==b.path&&"text-foreground/70")}):"node-app"===b.type?(0,Z.jsx)(aA,{className:bS("h-4 w-4 shrink-0",Y?.path!==b.path&&"text-emerald-500")}):"html"===Hd(b.name,"file")?(0,Z.jsx)(aq,{className:bS("h-4 w-4 shrink-0",Y?.path!==b.path&&"text-foreground/60")}):Hh(b.name)?(0,Z.jsx)(ar,{className:bS("h-4 w-4 shrink-0",Y?.path!==b.path&&"text-sunshine-700")}):Hf(b.name)?(0,Z.jsx)(am,{className:bS("h-4 w-4 shrink-0",Y?.path!==b.path&&"text-foreground/70")}):(0,Z.jsx)(ak,{className:bS("h-4 w-4 shrink-0",Y?.path!==b.path&&"text-foreground/60")}),(0,Z.jsx)("span",{className:"flex-1 truncate",children:b.name}),(0,Z.jsxs)("div",{className:"flex items-center gap-0.5 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:a=>a.stopPropagation(),onKeyDown:a=>a.stopPropagation(),children:["dir"===b.type&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0 text-muted-foreground hover:text-foreground",title:"New file here (default .md)",onClick:async()=>{b.expanded||await a5(b),P(b.path),R(""),T(null)},children:(0,Z.jsx)(al,{className:"h-3 w-3"})}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0 text-muted-foreground hover:text-foreground",title:"Upload here",onClick:()=>bc(b.path),children:(0,Z.jsx)(aC,{className:"h-3 w-3"})}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0 text-muted-foreground hover:text-foreground",title:"New subfolder",onClick:()=>{J(b.path),L(""),N(null)},children:(0,Z.jsx)(ap,{className:"h-3 w-3"})})]}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0 text-muted-foreground hover:text-foreground",title:"file"===b.type?"Download":"Download as zip",onClick:()=>{let a,c;return a=`/api/wiki/download?path=${encodeURIComponent(b.path)}`,void((c=document.createElement("a")).href=a,c.download="file"===b.type?b.name:`${b.name}.zip`,document.body.appendChild(c),c.click(),c.remove())},children:(0,Z.jsx)(aj,{className:"h-3 w-3"})}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0 text-destructive hover:text-destructive",title:"Delete",onClick:()=>{V(b.path),X("file"!==b.type)},children:(0,Z.jsx)(aB,{className:"h-3 w-3"})})]})]}),I===b.path&&"dir"===b.type&&(0,Z.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-1",style:{paddingLeft:`${(c+1)*14+8}px`},children:[(0,Z.jsx)("span",{className:"w-3.5 shrink-0"}),(0,Z.jsx)(an,{className:"h-4 w-4 shrink-0 text-warning"}),(0,Z.jsx)("input",{className:"flex-1 bg-transparent text-sm outline-none border-b border-border min-w-0",placeholder:"Folder name",value:K,onChange:a=>L(a.target.value),onKeyDown:a=>{"Enter"===a.key&&bd(),"Escape"===a.key&&(J(null),L(""))}}),M&&(0,Z.jsx)("span",{className:"text-xs text-destructive",children:M}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:bd,children:(0,Z.jsx)(ag,{className:"h-3 w-3"})}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:()=>{J(null),L("")},children:(0,Z.jsx)(aD,{className:"h-3 w-3"})})]}),O===b.path&&"dir"===b.type&&(0,Z.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-1",style:{paddingLeft:`${(c+1)*14+8}px`},children:[(0,Z.jsx)("span",{className:"w-3.5 shrink-0"}),(0,Z.jsx)(am,{className:"h-4 w-4 shrink-0 text-accent"}),(0,Z.jsx)("input",{autoFocus:!0,className:"flex-1 bg-transparent text-sm outline-none border-b border-border min-w-0",placeholder:"filename (default .md)",value:Q,onChange:a=>R(a.target.value),onKeyDown:a=>{"Enter"===a.key&&be(),"Escape"===a.key&&(P(null),R(""))}}),S&&(0,Z.jsx)("span",{className:"text-xs text-destructive",children:S}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:be,children:(0,Z.jsx)(ag,{className:"h-3 w-3"})}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:()=>{P(null),R("")},children:(0,Z.jsx)(aD,{className:"h-3 w-3"})})]}),("dir"===b.type||"app"===b.type)&&b.expanded&&b.children&&b.children.length>0&&a(b.children,c+1),("dir"===b.type||"app"===b.type)&&b.expanded&&b.children?.length===0&&(0,Z.jsx)("div",{className:"text-xs text-muted-foreground/50 py-0.5",style:{paddingLeft:`${(c+1)*14+8+14+6+16+6}px`},children:"Empty"})]},b.path))}(t)}),(0,Z.jsx)("div",{className:"border-t px-2 py-2 bg-muted shrink-0",children:(0,Z.jsxs)(FK,{children:[(0,Z.jsx)(FM,{asChild:!0,children:(0,Z.jsxs)(bU,{size:"sm",variant:"ghost",className:"w-full h-auto justify-between gap-2 px-2 py-1.5 text-left",title:d??"",children:[(0,Z.jsxs)("span",{className:"flex flex-col min-w-0",children:[(0,Z.jsx)("span",{className:"truncate text-xs font-medium",children:h.find(a=>a.id===f)?.name??"Workspace"}),(0,Z.jsx)("span",{className:"truncate text-[10px] text-muted-foreground font-mono",children:d??""})]}),(0,Z.jsx)(ah,{className:"h-3.5 w-3.5 shrink-0 opacity-60"})]})}),(0,Z.jsxs)(FZ,{align:"start",className:"w-60",children:[h.map(a=>(0,Z.jsxs)(F$,{onClick:()=>void a8(a.id),className:bS("gap-2",a.id===f&&"font-medium"),children:[a.id===f?(0,Z.jsx)(ag,{className:"h-3.5 w-3.5 shrink-0"}):(0,Z.jsx)("span",{className:"w-3.5 shrink-0"}),(0,Z.jsxs)("span",{className:"flex flex-col min-w-0 flex-1",children:[(0,Z.jsx)("span",{className:"truncate",children:a.name}),(0,Z.jsx)("span",{className:"truncate text-[10px] text-muted-foreground font-mono",children:a.rootDir})]}),j&&(0,Z.jsx)("button",{className:"ml-auto shrink-0 rounded p-0.5 text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors",title:"Delete workspace (does not delete files)",onClick:b=>{b.stopPropagation(),o(a.id)},children:(0,Z.jsx)(aB,{className:"h-3.5 w-3.5"})})]},a.id)),j&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(F_,{}),(0,Z.jsxs)(F$,{onClick:()=>m(!0),children:[(0,Z.jsx)(ap,{className:"mr-2 h-3.5 w-3.5"}),"Add workspace…"]})]})]})]})})]}),(0,Z.jsxs)("div",{className:"flex-1 flex flex-col min-w-0 relative",children:[aE&&(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"absolute left-0 top-1/2 -translate-y-1/2 z-10 h-7 w-7 p-0 rounded-full bg-background/50 backdrop-blur-xl backdrop-saturate-150 border border-white/[0.08] text-foreground/60 hover:text-foreground/90 hover:bg-background/70 shadow-[0_0_12px_rgba(0,0,0,0.15)] [transform:translate(-50%,-50%)_translateZ(0)]",title:"Show sidebar",onClick:()=>aF(!1),children:(0,Z.jsx)(av,{className:"h-3.5 w-3.5"})}),Y?"node-app"===bi?(0,Z.jsx)(Eg,{path:Y.path,title:Y.name}):"app"===bi||"html"===bi?(a="html"===bi?`/api/assets/${Y.path}`:void 0,aa?(0,Z.jsx)(Ec,{path:Y.path,title:Y.name,src:a,fullscreen:!0,onExit:()=>ab(!1)}):(0,Z.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden min-w-0",children:[(0,Z.jsxs)("div",{className:"flex items-center justify-between px-4 py-2 border-b bg-muted shrink-0",children:[(0,Z.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,Z.jsx)(aq,{className:"h-4 w-4 shrink-0 text-accent"}),(0,Z.jsx)("span",{className:"text-sm font-normal truncate",title:Y.path,children:Y.path})]}),(0,Z.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:["html"===bi&&!aO&&null!==aI&&(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",title:"Edit source",onClick:()=>{aP(!0),aR(aI),aV(null)},children:(0,Z.jsx)(aw,{className:"h-3.5 w-3.5"})}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",title:"Refresh",onClick:()=>ad(a=>a+1),children:(0,Z.jsx)(ay,{className:"h-3.5 w-3.5"})}),(0,Z.jsxs)(bU,{size:"sm",variant:"ghost",className:"h-7 gap-1.5 text-xs",onClick:()=>ab(!0),children:[(0,Z.jsx)(at,{className:"h-3.5 w-3.5"}),"Open fullscreen"]}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",onClick:()=>{_(null),aP(!1)},children:(0,Z.jsx)(aD,{className:"h-3.5 w-3.5"})})]})]}),aO&&"html"===bi?(0,Z.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden min-h-0",children:[(0,Z.jsx)("textarea",{value:aQ,onChange:a=>aR(a.target.value),spellCheck:!1,className:"flex-1 w-full min-h-0 resize-none bg-background text-foreground px-4 py-3 font-mono text-[13px] leading-relaxed outline-none border-0"}),(0,Z.jsxs)("div",{className:"border-t px-4 py-2 flex items-center justify-end gap-2 bg-muted shrink-0",children:[aU&&(0,Z.jsx)("span",{className:"text-xs text-destructive mr-auto",children:aU}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",onClick:()=>{aP(!1),aV(null)},children:"Cancel"}),(0,Z.jsxs)(bU,{size:"sm",className:"gap-1",onClick:ba,disabled:aS,children:[aS&&(0,Z.jsx)(as,{className:"h-3 w-3 animate-spin"}),"Save"]})]})]}):(0,Z.jsx)(Ec,{path:Y.path,title:Y.name,src:a},ac)]})):(0,Z.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden min-w-0",children:[(0,Z.jsxs)("div",{className:"flex items-center justify-between px-4 py-2 border-b bg-muted shrink-0",children:[(0,Z.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[Hh(Y.name)?(0,Z.jsx)(ar,{className:"h-4 w-4 shrink-0 text-sunshine-700"}):Hf(Y.name)?(0,Z.jsx)(am,{className:"h-4 w-4 shrink-0 text-accent"}):(0,Z.jsx)(ak,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),(0,Z.jsx)("span",{className:"text-sm font-normal truncate",title:Y.path,children:Y.path})]}),(0,Z.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[Hf(Y.name)&&!aO&&null!==aI&&(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",onClick:()=>{aP(!0),aR(aI),aV(null),Hg(Y.name)&&vb.getState().loadPage(Y.path)},children:(0,Z.jsx)(aw,{className:"h-3.5 w-3.5"})}),Hf(Y.name)&&!aO&&null!==aI&&(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",title:"Refresh",onClick:a4,disabled:aM,children:aM?(0,Z.jsx)(as,{className:"h-3.5 w-3.5 animate-spin"}):(0,Z.jsx)(ay,{className:"h-3.5 w-3.5"})}),bk&&(0,Z.jsx)(Hb,{}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",onClick:()=>{_(null),aJ(null),aP(!1)},children:(0,Z.jsx)(aD,{className:"h-3.5 w-3.5"})})]})]}),aO?(0,Z.jsx)("div",{className:"flex-1 flex flex-col overflow-hidden min-h-0",children:Hg(Y.name)?(0,Z.jsx)(C6,{}):(0,Z.jsx)("textarea",{value:aQ,onChange:a=>aR(a.target.value),spellCheck:!1,className:"flex-1 w-full min-h-0 resize-none bg-background text-foreground px-4 py-3 font-mono text-[13px] leading-relaxed outline-none border-0"})}):(0,Z.jsx)("div",{className:"flex-1 overflow-auto p-4 min-h-0",children:(0,Z.jsx)("div",{className:bS("mx-auto w-full",bl),children:aM?(0,Z.jsx)("div",{className:"flex justify-center py-8",children:(0,Z.jsx)(as,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):"csv"===bi?(0,Z.jsx)(dN,{path:Y.path,title:Y.name}):"pdf"===bi?(0,Z.jsx)(D7,{path:Y.path,title:Y.name}):"mermaid"===bi?(0,Z.jsx)(Df,{path:Y.path,title:Y.name}):"notebook"===bi?(0,Z.jsx)(D2,{path:Y.path,title:Y.name}):"image"===bi?(0,Z.jsx)(C8,{path:Y.path,title:Y.name}):"media"===bi?(0,Z.jsx)(C9,{path:Y.path,title:Y.name,type:["mp4","webm","mov","m4v"].includes(Hc(Y.name))?"video":"audio"}):"docx"===bi?(0,Z.jsx)(D4,{path:Y.path,title:Y.name}):"xlsx"===bi?(0,Z.jsx)(D6,{path:Y.path,title:Y.name}):"pptx"===bi?(0,Z.jsx)(D5,{path:Y.path,title:Y.name}):"source"===bi?(0,Z.jsx)(Eb,{path:Y.path,title:Y.name}):"fallback"===bi?(0,Z.jsx)(C7,{path:Y.path,title:Y.name}):null!==aI?["md","markdown"].includes(Hc(Y.name))?(()=>{let{data:a,body:b}=function(a){let b=Gg.exec(a);if(!b)return{data:{},body:a};let c=b[1],d=a.slice(b[0].length),e=c.split(/\r?\n/).find(a=>""!==a.trim())??"";if(/^\s*(#{1,6}\s|<|>|-\s|\*\s|\d+\.\s)/.test(e))return{data:{},body:a};let f={},g=c.split(/\r?\n/),h=0;for(;h<g.length;){let a=g[h];if(!a||/^\s*#/.test(a)){h+=1;continue}let b=/^([A-Za-z_][\w-]*)\s*:\s*(.*)$/.exec(a);if(!b){h+=1;continue}let c=b[1],d=b[2];if(""===d.trim()){let a=[],b=h+1;for(;b<g.length&&/^\s+-\s+/.test(g[b]);){let c=/^\s+-\s+(.*)$/.exec(g[b]);c&&a.push(Gh(c[1])),b+=1}if(a.length>0){f[c]=a,h=b;continue}f[c]="",h+=1;continue}f[c]=Gh(d),h+=1}return 0===Object.keys(f).length?{data:{},body:a}:{data:f,body:d}}(aI);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Ge,{data:a}),(0,Z.jsx)(Gf,{markdown:b,pagePath:Y.path,onNavigate:(a,b)=>{a6({path:a,name:a.split("/").pop()??a,type:"file"}),b&&setTimeout(()=>{document.getElementById(b)?.scrollIntoView({behavior:"smooth"})},200)}})]})})():(0,Z.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-words leading-relaxed",children:aI}):Hf(Y.name)?(0,Z.jsx)("p",{className:"text-sm text-muted-foreground",children:"Could not load file."}):(0,Z.jsx)("p",{className:"text-sm text-muted-foreground",children:"Preview not available for this file type."})})}),aO&&(0,Z.jsxs)("div",{className:"border-t px-4 py-2 flex items-center justify-end gap-2 bg-muted shrink-0",children:[aU&&(0,Z.jsx)("span",{className:"text-xs text-destructive mr-auto",children:aU}),(0,Z.jsx)(bU,{size:"sm",variant:"ghost",onClick:()=>{aP(!1),aV(null)},children:"Cancel"}),(0,Z.jsxs)(bU,{size:"sm",className:"gap-1",onClick:ba,disabled:aS,children:[aS&&(0,Z.jsx)(as,{className:"h-3 w-3 animate-spin"}),"Save"]})]})]}):(0,Z.jsx)("div",{className:"flex-1 flex flex-col items-center justify-center",children:(0,Z.jsxs)("div",{className:"flex flex-col items-center gap-2 text-center px-4",children:[(0,Z.jsx)(am,{className:"h-8 w-8 text-muted-foreground"}),(0,Z.jsx)("p",{className:"text-sm text-muted-foreground",children:"Select a file to view or edit"})]})})]}),(0,Z.jsx)(F9,{open:aG,onOpenChange:aH}),(0,Z.jsx)(Gu,{currentPath:Y?.path}),(0,Z.jsx)("input",{ref:G,type:"file",multiple:!0,className:"hidden",onChange:a=>{a.target.files&&bb(a.target.files,H.current)}}),(0,Z.jsx)(dG,{open:!!U,onOpenChange:a=>{a||V(null)},title:W?"Delete folder?":"Delete file?",description:W?`"${U?.split("/").pop()}" and all its contents will be permanently deleted.`:`"${U?.split("/").pop()}" will be permanently removed.`,onConfirm:bf}),(0,Z.jsx)(dG,{open:!!n,onOpenChange:a=>{a||o(null)},title:"Delete workspace?",description:`"${h.find(a=>a.id===n)?.name??""}" will be removed from the workspace list. Files on disk are NOT deleted.`,onConfirm:a9})]})]},f??"none")}],240777)}];
|
|
130
130
|
|
|
131
131
|
//# sourceMappingURL=_0pqaawz._.js.map
|
|
@@ -7,9 +7,9 @@ globalThis.__BUILD_MANIFEST = {
|
|
|
7
7
|
"static/chunks/03~yq9q893hmn.js"
|
|
8
8
|
],
|
|
9
9
|
"lowPriorityFiles": [
|
|
10
|
-
"static/
|
|
11
|
-
"static/
|
|
12
|
-
"static/
|
|
10
|
+
"static/t_k0ztuf0V-iA-kgeez18/_buildManifest.js",
|
|
11
|
+
"static/t_k0ztuf0V-iA-kgeez18/_ssgManifest.js",
|
|
12
|
+
"static/t_k0ztuf0V-iA-kgeez18/_clientMiddlewareManifest.js"
|
|
13
13
|
],
|
|
14
14
|
"rootMainFiles": [
|
|
15
15
|
"static/chunks/0ocp.6r7w_saw.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"wasm": [],
|
|
20
20
|
"assets": [],
|
|
21
21
|
"env": {
|
|
22
|
-
"__NEXT_BUILD_ID": "
|
|
22
|
+
"__NEXT_BUILD_ID": "t_k0ztuf0V-iA-kgeez18",
|
|
23
23
|
"NEXT_SERVER_ACTIONS_ENCRYPTION_KEY": "gd9VieOH2QNTXQqx/YwRTjjD3FcJAdLmkNlJmMeKqqc=",
|
|
24
24
|
"__NEXT_PREVIEW_MODE_ID": "0f414c3745367a780bbeef59b5fbad98",
|
|
25
25
|
"__NEXT_PREVIEW_MODE_ENCRYPTION_KEY": "cd89de44248cc24f172ca51d8ef8cb8a68e06cf2b1e7520dfecb7e9632546eeb",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/chunks/0c_~zevf2n0r4.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/0ocp.6r7w_saw.js"/><script src="/_next/static/chunks/0quh-cfcrp2ib.js" async=""></script><script src="/_next/static/chunks/0vp-ahhagxptc.js" async=""></script><script src="/_next/static/chunks/turbopack-12~z-mr7b9b50.js" async=""></script><script src="/_next/static/chunks/0umlolnxs~j3r.js" async=""></script><script src="/_next/static/chunks/057umwogp53v_.js" async=""></script><script src="/_next/static/chunks/0ky8fha87kp0_.js" async=""></script><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>404: This page could not be found.</title><meta name="theme-color" content="#0c0a09"/><title>Wiki Viewer</title><meta name="description" content="Local file browser, viewer, and editor"/><link rel="manifest" href="/manifest.webmanifest"/><meta name="mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-title" content="Wiki"/><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/><link rel="icon" href="/icon-192.png"/><link rel="apple-touch-icon" href="/icon-192.png"/><script src="/_next/static/chunks/03~yq9q893hmn.js" noModule=""></script></head><body class="inter_5901b7c6-module__ec5Qua__variable font-sans antialiased"><div hidden=""><!--$--><!--/$--></div><script>((a,b,c,d,e,f,g,h)=>{let i=document.documentElement,j=["light","dark"];function k(b){var c;(Array.isArray(a)?a:[a]).forEach(a=>{let c="class"===a,d=c&&f?e.map(a=>f[a]||a):e;c?(i.classList.remove(...d),i.classList.add(f&&f[b]?f[b]:b)):i.setAttribute(a,b)}),c=b,h&&j.includes(c)&&(i.style.colorScheme=c)}if(d)k(d);else try{let a=localStorage.getItem(b)||c,d=g&&"system"===a?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":a;k(d)}catch(a){}})("class","theme","system",null,["light","dark"],null,true,true)</script><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><section aria-label="Notifications alt+T" tabindex="-1" aria-live="polite" aria-relevant="additions text" aria-atomic="false"></section><script src="/_next/static/chunks/0ocp.6r7w_saw.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[427423,[\"/_next/static/chunks/0umlolnxs~j3r.js\",\"/_next/static/chunks/057umwogp53v_.js\",\"/_next/static/chunks/0ky8fha87kp0_.js\"],\"ThemeProvider\"]\n3:I[902063,[\"/_next/static/chunks/0umlolnxs~j3r.js\",\"/_next/static/chunks/057umwogp53v_.js\",\"/_next/static/chunks/0ky8fha87kp0_.js\"],\"default\"]\n4:I[259666,[\"/_next/static/chunks/0umlolnxs~j3r.js\",\"/_next/static/chunks/057umwogp53v_.js\",\"/_next/static/chunks/0ky8fha87kp0_.js\"],\"default\"]\n5:I[187014,[\"/_next/static/chunks/0umlolnxs~j3r.js\",\"/_next/static/chunks/057umwogp53v_.js\",\"/_next/static/chunks/0ky8fha87kp0_.js\"],\"Toaster\"]\n6:I[62711,[\"/_next/static/chunks/0umlolnxs~j3r.js\",\"/_next/static/chunks/057umwogp53v_.js\",\"/_next/static/chunks/0ky8fha87kp0_.js\"],\"OutletBoundary\"]\n7:\"$Sreact.suspense\"\na:I[62711,[\"/_next/static/chunks/0umlolnxs~j3r.js\",\"/_next/static/chunks/057umwogp53v_.js\",\"/_next/static/chunks/0ky8fha87kp0_.js\"],\"ViewportBoundary\"]\nc:I[62711,[\"/_next/static/chunks/0umlolnxs~j3r.js\",\"/_next/static/chunks/057umwogp53v_.js\",\"/_next/static/chunks/0ky8fha87kp0_.js\"],\"MetadataBoundary\"]\ne:I[514743,[\"/_next/static/chunks/0umlolnxs~j3r.js\",\"/_next/static/chunks/057umwogp53v_.js\",\"/_next/static/chunks/0ky8fha87kp0_.js\"],\"default\",1]\n:HL[\"/_next/static/chunks/0c_~zevf2n0r4.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",16],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0c_~zevf2n0r4.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/0umlolnxs~j3r.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/057umwogp53v_.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-2\",{\"src\":\"/_next/static/chunks/0ky8fha87kp0_.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"children\":[\"$\",\"body\",null,{\"className\":\"inter_5901b7c6-module__ec5Qua__variable font-sans antialiased\",\"children\":[\"$\",\"$L2\",null,{\"children\":[[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}],[\"$\",\"$L5\",null,{\"theme\":\"system\",\"position\":\"bottom-right\",\"toastOptions\":{\"className\":\"border-border bg-card text-card-foreground\"}}]]}]}]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:0:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:0:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:0:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:0:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$7\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@8\"}]}]]}],{},null,false,null]},null,false,\"$@9\"]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$La\",null,{\"children\":\"$Lb\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$Lc\",null,{\"children\":[\"$\",\"$7\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Ld\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$e\",[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0c_~zevf2n0r4.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"t7B6nXaoD1jo9f61t3aeK\"}\n"])</script><script>self.__next_f.push([1,"f:[]\n9:\"$Wf\"\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"2\",{\"name\":\"theme-color\",\"content\":\"#0c0a09\"}]]\n"])</script><script>self.__next_f.push([1,"10:I[319772,[\"/_next/static/chunks/0umlolnxs~j3r.js\",\"/_next/static/chunks/057umwogp53v_.js\",\"/_next/static/chunks/0ky8fha87kp0_.js\"],\"IconMark\"]\n8:null\nd:[[\"$\",\"title\",\"0\",{\"children\":\"Wiki Viewer\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Local file browser, viewer, and editor\"}],[\"$\",\"link\",\"2\",{\"rel\":\"manifest\",\"href\":\"/manifest.webmanifest\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"meta\",\"3\",{\"name\":\"mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",\"4\",{\"name\":\"apple-mobile-web-app-title\",\"content\":\"Wiki\"}],[\"$\",\"meta\",\"5\",{\"name\":\"apple-mobile-web-app-status-bar-style\",\"content\":\"black-translucent\"}],[\"$\",\"link\",\"6\",{\"rel\":\"icon\",\"href\":\"/icon-192.png\"}],[\"$\",\"link\",\"7\",{\"rel\":\"apple-touch-icon\",\"href\":\"/icon-192.png\"}],[\"$\",\"$L10\",\"8\",{}]]\n"])</script></body></html>
|
|
1
|
+
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/chunks/0c_~zevf2n0r4.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/0ocp.6r7w_saw.js"/><script src="/_next/static/chunks/0quh-cfcrp2ib.js" async=""></script><script src="/_next/static/chunks/0vp-ahhagxptc.js" async=""></script><script src="/_next/static/chunks/turbopack-12~z-mr7b9b50.js" async=""></script><script src="/_next/static/chunks/0umlolnxs~j3r.js" async=""></script><script src="/_next/static/chunks/057umwogp53v_.js" async=""></script><script src="/_next/static/chunks/0ky8fha87kp0_.js" async=""></script><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>404: This page could not be found.</title><meta name="theme-color" content="#0c0a09"/><title>Wiki Viewer</title><meta name="description" content="Local file browser, viewer, and editor"/><link rel="manifest" href="/manifest.webmanifest"/><meta name="mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-title" content="Wiki"/><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/><link rel="icon" href="/icon-192.png"/><link rel="apple-touch-icon" href="/icon-192.png"/><script src="/_next/static/chunks/03~yq9q893hmn.js" noModule=""></script></head><body class="inter_5901b7c6-module__ec5Qua__variable font-sans antialiased"><div hidden=""><!--$--><!--/$--></div><script>((a,b,c,d,e,f,g,h)=>{let i=document.documentElement,j=["light","dark"];function k(b){var c;(Array.isArray(a)?a:[a]).forEach(a=>{let c="class"===a,d=c&&f?e.map(a=>f[a]||a):e;c?(i.classList.remove(...d),i.classList.add(f&&f[b]?f[b]:b)):i.setAttribute(a,b)}),c=b,h&&j.includes(c)&&(i.style.colorScheme=c)}if(d)k(d);else try{let a=localStorage.getItem(b)||c,d=g&&"system"===a?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":a;k(d)}catch(a){}})("class","theme","system",null,["light","dark"],null,true,true)</script><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><section aria-label="Notifications alt+T" tabindex="-1" aria-live="polite" aria-relevant="additions text" aria-atomic="false"></section><script src="/_next/static/chunks/0ocp.6r7w_saw.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[427423,[\"/_next/static/chunks/0umlolnxs~j3r.js\",\"/_next/static/chunks/057umwogp53v_.js\",\"/_next/static/chunks/0ky8fha87kp0_.js\"],\"ThemeProvider\"]\n3:I[902063,[\"/_next/static/chunks/0umlolnxs~j3r.js\",\"/_next/static/chunks/057umwogp53v_.js\",\"/_next/static/chunks/0ky8fha87kp0_.js\"],\"default\"]\n4:I[259666,[\"/_next/static/chunks/0umlolnxs~j3r.js\",\"/_next/static/chunks/057umwogp53v_.js\",\"/_next/static/chunks/0ky8fha87kp0_.js\"],\"default\"]\n5:I[187014,[\"/_next/static/chunks/0umlolnxs~j3r.js\",\"/_next/static/chunks/057umwogp53v_.js\",\"/_next/static/chunks/0ky8fha87kp0_.js\"],\"Toaster\"]\n6:I[62711,[\"/_next/static/chunks/0umlolnxs~j3r.js\",\"/_next/static/chunks/057umwogp53v_.js\",\"/_next/static/chunks/0ky8fha87kp0_.js\"],\"OutletBoundary\"]\n7:\"$Sreact.suspense\"\na:I[62711,[\"/_next/static/chunks/0umlolnxs~j3r.js\",\"/_next/static/chunks/057umwogp53v_.js\",\"/_next/static/chunks/0ky8fha87kp0_.js\"],\"ViewportBoundary\"]\nc:I[62711,[\"/_next/static/chunks/0umlolnxs~j3r.js\",\"/_next/static/chunks/057umwogp53v_.js\",\"/_next/static/chunks/0ky8fha87kp0_.js\"],\"MetadataBoundary\"]\ne:I[514743,[\"/_next/static/chunks/0umlolnxs~j3r.js\",\"/_next/static/chunks/057umwogp53v_.js\",\"/_next/static/chunks/0ky8fha87kp0_.js\"],\"default\",1]\n:HL[\"/_next/static/chunks/0c_~zevf2n0r4.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",16],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0c_~zevf2n0r4.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/0umlolnxs~j3r.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/057umwogp53v_.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-2\",{\"src\":\"/_next/static/chunks/0ky8fha87kp0_.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"children\":[\"$\",\"body\",null,{\"className\":\"inter_5901b7c6-module__ec5Qua__variable font-sans antialiased\",\"children\":[\"$\",\"$L2\",null,{\"children\":[[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}],[\"$\",\"$L5\",null,{\"theme\":\"system\",\"position\":\"bottom-right\",\"toastOptions\":{\"className\":\"border-border bg-card text-card-foreground\"}}]]}]}]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:0:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:0:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:0:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:0:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$7\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@8\"}]}]]}],{},null,false,null]},null,false,\"$@9\"]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$La\",null,{\"children\":\"$Lb\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$Lc\",null,{\"children\":[\"$\",\"$7\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Ld\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$e\",[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0c_~zevf2n0r4.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"t_k0ztuf0V-iA-kgeez18\"}\n"])</script><script>self.__next_f.push([1,"f:[]\n9:\"$Wf\"\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"2\",{\"name\":\"theme-color\",\"content\":\"#0c0a09\"}]]\n"])</script><script>self.__next_f.push([1,"10:I[319772,[\"/_next/static/chunks/0umlolnxs~j3r.js\",\"/_next/static/chunks/057umwogp53v_.js\",\"/_next/static/chunks/0ky8fha87kp0_.js\"],\"IconMark\"]\n8:null\nd:[[\"$\",\"title\",\"0\",{\"children\":\"Wiki Viewer\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Local file browser, viewer, and editor\"}],[\"$\",\"link\",\"2\",{\"rel\":\"manifest\",\"href\":\"/manifest.webmanifest\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"meta\",\"3\",{\"name\":\"mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",\"4\",{\"name\":\"apple-mobile-web-app-title\",\"content\":\"Wiki\"}],[\"$\",\"meta\",\"5\",{\"name\":\"apple-mobile-web-app-status-bar-style\",\"content\":\"black-translucent\"}],[\"$\",\"link\",\"6\",{\"rel\":\"icon\",\"href\":\"/icon-192.png\"}],[\"$\",\"link\",\"7\",{\"rel\":\"apple-touch-icon\",\"href\":\"/icon-192.png\"}],[\"$\",\"$L10\",\"8\",{}]]\n"])</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/0ocp.6r7w_saw.js"/><script src="/_next/static/chunks/0quh-cfcrp2ib.js" async=""></script><script src="/_next/static/chunks/0vp-ahhagxptc.js" async=""></script><script src="/_next/static/chunks/turbopack-12~z-mr7b9b50.js" async=""></script><script src="/_next/static/chunks/057umwogp53v_.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: This page couldn’t load</title><link rel="manifest" href="/manifest.webmanifest"/><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/03~yq9q893hmn.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/0ocp.6r7w_saw.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[902063,[\"/_next/static/chunks/057umwogp53v_.js\"],\"default\"]\n3:I[259666,[\"/_next/static/chunks/057umwogp53v_.js\"],\"default\"]\n4:I[62711,[\"/_next/static/chunks/057umwogp53v_.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[62711,[\"/_next/static/chunks/057umwogp53v_.js\"],\"ViewportBoundary\"]\na:I[62711,[\"/_next/static/chunks/057umwogp53v_.js\"],\"MetadataBoundary\"]\nc:I[514743,[\"/_next/static/chunks/057umwogp53v_.js\"],\"default\",1]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$@7\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"
|
|
1
|
+
<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/0ocp.6r7w_saw.js"/><script src="/_next/static/chunks/0quh-cfcrp2ib.js" async=""></script><script src="/_next/static/chunks/0vp-ahhagxptc.js" async=""></script><script src="/_next/static/chunks/turbopack-12~z-mr7b9b50.js" async=""></script><script src="/_next/static/chunks/057umwogp53v_.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: This page couldn’t load</title><link rel="manifest" href="/manifest.webmanifest"/><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/03~yq9q893hmn.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/0ocp.6r7w_saw.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[902063,[\"/_next/static/chunks/057umwogp53v_.js\"],\"default\"]\n3:I[259666,[\"/_next/static/chunks/057umwogp53v_.js\"],\"default\"]\n4:I[62711,[\"/_next/static/chunks/057umwogp53v_.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[62711,[\"/_next/static/chunks/057umwogp53v_.js\"],\"ViewportBoundary\"]\na:I[62711,[\"/_next/static/chunks/057umwogp53v_.js\"],\"MetadataBoundary\"]\nc:I[514743,[\"/_next/static/chunks/057umwogp53v_.js\"],\"default\",1]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$@7\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"t_k0ztuf0V-iA-kgeez18\"}\n"])</script><script>self.__next_f.push([1,"d:[]\n7:\"$Wd\"\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\nb:[[\"$\",\"link\",\"0\",{\"rel\":\"manifest\",\"href\":\"/manifest.webmanifest\",\"crossOrigin\":\"$undefined\"}]]\n"])</script></body></html>
|