PageSourceSearch

https://phasoric.com/assets/MarkdownReadingView-Dm-n8cMl.js

js phasoric.com collected 2026-09-24 14:53:03 UTC 24,527 bytes, 3 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/db-Dgd9zlNH.js","assets/rolldown-runtime-BNNRdYrd.js","assets/react-vendor-BqQF_9sx.js","assets/index-BQuIkJiK.js","assets/platform-capabilities-Bjt71t6g.js","assets/comparison-positioning-DbkxE00R.js","assets/context-sales-routes-BmilJBIO.js","assets/domain-plugin-catalog-lNnBMB9_.js","assets/plan-entitlements-D-LMrELD.js","assets/index-DNsQKlv_.css","assets/storage-vendor-HZzIgsIR.js","assets/note-trust-Y3C29qxz.js","assets/semantic-links-BmhOhVmH.js","assets/semantic-note-DyLW_AZF.js","assets/task-utils-NfCAvgr9.js","assets/safe-frontmatter-BdZqnLng.js","assets/desktop-vault-binding-CVzuZYam.js","assets/pdf-inspector-service-CqXAgNzJ.js","assets/document-ingestion-Cbdeg90e.js","assets/mermaid.core-BPTCjTZF.js","assets/chunk-Y2CYZVJY-CrVYBJys.js","assets/src-YqdjUCWQ.js","assets/graph-vendor-3ZH9KQNv.js","assets/chunk-O7XYJQB3-Cch5upsJ.js","assets/markdown-security-D0lLXh53.js","assets/knowledge-model-DWJuoUAe.js","assets/attachments-0D7dZ0Hd.js","assets/dexie-batching-DceqOBeq.js","assets/cloud-sources-0yR8nunz.js","assets/metadata-sync-BmUSMven.js","assets/permanent-memory-BEUfT4yj.js","assets/onboarding-C3SgsVj9.js","assets/workspace-bootstrap-BlZDnksD.js","assets/client-BHTBpyJq.js","assets/resource-model-DDr_1WO_.js","assets/document-lifecycle-B8JPtiKu.js","assets/ocr-coordinator-B-26Rdlv.js","assets/local-inference-telemetry-scF-VAO0.js","assets/source-manifest-Du9PY7Qn.js","assets/intelligence-content-hash-CEhOl9kW.js","assets/es-DGYe5jVL.js","assets/ocr-vendor-CVm_LEwM.js","assets/chunk-742MDFTN-5-VjX7Sc.js","assets/chunk-ZIGJFQKS-ZlHKWwKB.js","assets/dist-DT1f2cKv.js","assets/chunk-MBY4JIJT-Bfy4Tt_x.js","assets/chunk-DUW6YSOI-BgZRZDB6.js","assets/chunk-7PRAP22T-COyO4YCZ.js","assets/chunk-7INBJB4K-BeKArz-G.js","assets/chunk-J5ZVWO5B-DHwRsH4r.js","assets/rough.esm-CSuoPZ5o.js","assets/chunk-5DYCD2WN-zI1p7pxi.js","assets/chunk-Z7XXMR3K-ChgAr0Se.js","assets/chunk-UA2S7LBM-DMpdcxml.js"])))=>i.map(i=>d[i]);
2import{o as O,r as U}from"./rolldown-runtime-BNNRdYrd.js";import{_ as N,b as P,r as I}from"./react-vendor-BqQF_9sx.js";import{t as M}from"./download-Bzen7iqR.js";import{t as L}from"./external-link-C8Z7ByNT.js";import{t as A}from"./folder-open-CtrjMwyb.js";import{t as D}from"./link-2-BMM81MrN.js";import{t as W}from"./list-tree-BaLxgvqI.js";import{a as z,n as V,t as B}from"./markdown-security-D0lLXh53.js";import{c as q,s as F}from"./desktop-vault-binding-CVzuZYam.js";import{h as C}from"./attachments-0D7dZ0Hd.js";import{i as J,r as G,t as R}from"./lib-BzX1fJbu.js";import{t as H}from"./lib-C_hW9AGM.js";import{i as E,n as T,r as K}from"./portable-markdown-DmB4LRe5.js";import{a as X,n as Y}from"./noteExport-BrLLFL-D.js";import{n as Q}from"./desktop-vault-Cj0Xjt1b.js";var b=O(P(),1),e=I();function k(a=""){return!!a&&!/^[a-z][a-z\d+.-]*:|^\/\/|^#/i.test(a)}function S({target:a,notePath:r,label:s,image:o=!1,wiki:d=!1}){const[c,m]=(0,b.useState)(null),[u,i]=(0,b.useState)("");return(0,b.useEffect)(()=>{let n=!0,p;const f=async()=>{const t=await Q(a.split("|")[0],r,{wiki:d});if(!t)throw new Error("This local asset is unavailable.");if(!n){URL.revokeObjectURL(t.url);return}p&&URL.revokeObjectURL(p),p=t.url,m(t),i("")},g=()=>{f().catch(t=>{n&&i(t.message)})};return g(),window.addEventListener("desktop-vault-assets-changed",g),()=>{n=!1,p&&URL.revokeObjectURL(p),window.removeEventListener("desktop-vault-assets-changed",g)}},[a,r,d]),u?(0,e.jsxs)("span",{className:"text-xs text-amber-200",title:u,children:[s||a," · unavailable"]}):c?o||c.mimeType.startsWith("image/")?(0,e.jsx)("img",{src:c.url,alt:s||a,className:"my-5 block h-auto max-w-full rounded-xl"}):c.mimeType.startsWith("audio/")?(0,e.jsx)("audio",{controls:!0,src:c.url,className:"my-3 max-w-full"}):c.mimeType.startsWith("video/")?(0,e.jsx)("video",{controls:!0,src:c.url,className:"my-3 max-w-full"}):(0,e.jsx)("a",{href:c.url,download:a.split("/").at(-1),className:"text-cyan-200 underline",children:s||a}):(0,e.jsxs)("span",{className:"text-xs text-basalt-500",children:["Loading ",s||a,"…"]})}var Le=U({MarkdownReadingView:()=>ce});function Z(a){const r=String(a||"").match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/);if(!r)return{body:a||"",properties:[]};const s=r[1].split(/\r?\n/).map(o=>{const d=o.indexOf(":");return d<1?null:[o.slice(0,d).trim(),o.slice(d+1).trim().replace(/^['"]|['"]$/g,"")]}
2).filter(Boolean);return{body:String(a||"").slice(r[0].length),properties:s}}function ee(a){return a.replace(/(?:^|\s)\^basalt-task-[a-z0-9][a-z0-9_-]{2,79}\s*$/gim,"").replace(/!\[\[([^\]]+)\]\]/g,(r,s)=>`[Embedded: ${s}](#basalt-transclude=${encodeURIComponent(s)})`).replace(/\[\[([^\]|]+)(?:\|([^\]]+))?\]\]/g,(r,s,o)=>`[${o||s}](#basalt-note=${encodeURIComponent(s)})`)}function te({target:a,onNoteClick:r}){const[s,o]=(0,b.useState)(null),[d,c]=(0,b.useState)(!0);return(0,b.useEffect)(()=>{let m=!0;return(async()=>{const{db:u}=await N(async()=>{const{db:p}=await import("./db-Dgd9zlNH.js").then(f=>f.i);return{db:p}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16])),i=String(a||"").replace(/\.md$/,"").toLowerCase();let n=await u.notes.get(a);if(n||(n=await u.notes.get(`${a}.md`)),n||(n=await u.notes.where("title").equalsIgnoreCase(i).first()),!n){const p=await u.noteHeaders.filter(f=>{const g=String(f.path||"").replace(/\.md$/,"").toLowerCase();return g===i||g.endsWith("/"+i)||String(f.title||"").toLowerCase()===i}).first();p&&(n=await u.notes.get(p.path))}return n||(n=await u.notes.filter(p=>{const f=String(p.path||"").replace(/\.md$/,"").toLowerCase();return f===i||f.endsWith("/"+i)||String(p.title||"").toLowerCase()===i}).first()),n})().then(u=>{if(m){if(u){const i=(u.content||"").replace(/^---[\s\S]*?---\r?\n?/,"").trim();o({title:u.title,path:u.path,excerpt:i.slice(0,500)})}else o(null);c(!1)}}).catch(()=>{m&&c(!1)}),()=>{m=!1}},[a]),(0,e.jsxs)("div",{className:"my-3 rounded-xl border border-accent-purple/30 bg-accent-purple/[.035] p-3.5 text-xs",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between border-b border-accent-purple/20 pb-1.5 mb-2 font-mono text-[11px] text-accent-purple",children:[(0,e.jsxs)("span",{className:"font-bold flex items-center gap-1.5",children:[(0,e.jsx)("span",{children:"📄 Embedded:"}),(0,e.jsx)("button",{type:"button",onClick:()=>r?.(s?.path||a),className:"underline hover:text-white transition-colors",children:s?.title||a})]}),(0,e.jsx)("button",{type:"button",onClick:()=>r?.(s?.path||a),className:"text-[10px] text-accent-cyan hover:underline",children:"Open →"})]}),d?(0,e.jsx)("div",{className:"text-basalt-500 italic",children:"Loading embedded note…"}):s?(0,e.jsxs)("div",{className:"whitespace-pre-wrap text-basalt-300 leading-relaxed font-sans max-h-48 overflow-y-auto",children:[s.excerpt,s.excerpt.length>=500?"…":""]}):(0,e.jsxs)("div",{className:"text-basalt-500 italic",children:['Embedded note "',a,'" not found.']})]})}function ae(a){try{const r=new URL(a);if(r.hostname==="youtu.be")return{provider:"YouTube",src:`https://www.youtube-nocookie.com/embed/${r.pathname.slice(1)}`};if(/^(www\.)?youtube\.com$/.test(r.hostname)&&r.searchParams.get("v"))return{provider:"YouTube",src:`https://www.youtube-nocookie.com/embed/${r.searchParams.get("v")}`};if(/^(www\.)?vimeo\.com$/.test(r.hostname)&&/^\/\d+/.test(r.pathname))return{provider:"Vimeo",src:`https://player.vimeo.com/video/${r.pathname.split("/")[1]}`};if(r.hostname==="open.spotify.com"&&/^\/(track|episode|album|playlist)\//.test(r.pathname))return{provider:"Spotify",src:`https://open.spotify.com/embed${r.pathname}`}}catch{}return null}function re({href:a,label:r}){const s=ae(a);if(s)return(0,e.jsxs)("div",{className:"my-5 overflow-hidden rounded-xl border border-basalt-800 bg-black/30",children:[(0,e.jsx)("iframe",{src:s.src,title:`${s.provider} embed`,loading:"lazy",allow:"autoplay; encrypted-media; picture-in-picture",sandbox:"allow-scripts allow-same-origin allow-presentation",referrerPolicy:"no-referrer",allowFullScreen:!0,className:"aspect-video w-full border-0"}),(0,e.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 text-[9px] text-basalt-500",children:[(0,e.jsxs)("span",{children:[s.provider," embed"]}),(0,e.jsxs)("a",{href:a,target:"_blank",rel:"noreferrer",className:"text-cyan-300",children:["Open source ",(0,e.jsx)(L,{className:"inline",size:10})]})]})]});try{const o=new URL(a);return(0,e.jsxs)("a",{href:a,target:"_blank",rel:"noreferrer",className:"my-4 flex items-center gap-3 rounded-xl border border-basalt-800 bg-white/[.025] p-4 no-underline transition hover:border-cyan-300/25",children:[(0,e.jsx)("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-cyan-300/[.07] text-cyan-300",children:(0,e.jsx)(D,{size:15})}),(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsx)("strong",{className:"block truncate text-xs text-white",children:r||o.hostname}),(0,e.jsxs)("span",{className:"mt-1 block truncate font-mono text-[9px] text-basalt-600",children:[o.hostname,o.pathname!=="/"?o.pathname:""]})]}
2),(0,e.jsx)(L,{className:"shrink-0 text-basalt-600",size:13})]})}catch{return null}}function se({url:a,name:r,href:s,blob:o}){const[d,c]=(0,b.useState)([]),[m,u]=(0,b.useState)(!1),[i,n]=(0,b.useState)(1),[p,f]=(0,b.useState)(null),[g,t]=(0,b.useState)(!1),l=(0,b.useMemo)(()=>String(s||r).replace(/[^a-z0-9]/gi,"_"),[s,r]);(0,b.useEffect)(()=>{const y=String(s||"").match(/#page=(\d+)/i);y&&n(Number(y[1])),o&&N(()=>import("./pdf-inspector-service-CqXAgNzJ.js").then(w=>w.n).then(w=>{w.extractPdfOutline(o).then($=>c($||[])).catch(()=>{});const v=w.getPdfReadingProgress(l);v&&v.pageNum&&!y&&(n(v.pageNum),f(v))}),__vite__mapDeps([17,1,18,2])).catch(()=>{})},[o,s,l]);const x=y=>{n(y),N(()=>import("./pdf-inspector-service-CqXAgNzJ.js").then(w=>w.n).then(w=>{w.savePdfReadingProgress(l,y,Math.max(d.length,10));const v=w.getPdfReadingProgress(l);v&&f(v)}),__vite__mapDeps([17,1,18,2])).catch(()=>{})},h=()=>{if(g)window.speechSynthesis.cancel(),t(!1);else{const y=`Reading page ${i} of ${r}. ${d.find(v=>v.pageNum===i)?.title||""}`,w=new SpeechSynthesisUtterance(y);w.onend=()=>t(!1),w.onerror=()=>t(!1),t(!0),window.speechSynthesis.speak(w)}},j=i>1?`${a}#page=${i}`:a;return(0,e.jsxs)("div",{className:"my-4 overflow-hidden rounded-xl border border-basalt-800 bg-black/20",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-3 border-b border-basalt-800 px-3 py-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 truncate",children:[(0,e.jsx)("span",{className:"truncate text-xs text-basalt-300",children:r}),p&&(0,e.jsxs)("span",{className:"rounded bg-basalt-900 border border-basalt-800 px-1.5 py-0.5 text-[9px] text-accent-cyan font-mono",children:["p. ",i," (",p.percent,"%)"]}),d.length>0&&(0,e.jsx)("button",{onClick:()=>u(!m),className:"rounded bg-basalt-800 px-2 py-0.5 text-[10px] text-accent-cyan hover:bg-basalt-700",children:m?"Hide Outline":`Outline (${d.length})`}),(0,e.jsx)("button",{onClick:h,className:`rounded px-2 py-0.5 text-[10px] font-mono ${g?"bg-amber-500/20 text-amber-300 border border-amber-500/40":"bg-basalt-800 text-basalt-300 hover:text-white"}`,children:g?"■ Stop Audio":"▶ Read Aloud"})]}),(0,e.jsxs)("a",{href:j,target:"_blank",rel:"noreferrer",className:"inline-flex shrink-0 items-center gap-1.5 text-[10px] text-accent-cyan",children:[(0,e.jsx)(A,{size:12}),"Open"]})]}),m&&d.length>0&&(0,e.jsxs)("div",{className:"max-h-48 overflow-y-auto border-b border-basalt-800 bg-basalt-900/60 p-2 text-xs",children:[(0,e.jsx)("div",{className:"mb-1 font-semibold text-basalt-400 text-[10px] uppercase tracking-wider",children:"Document Outline"}),d.map((y,w)=>(0,e.jsxs)("button",{onClick:()=>{x(y.pageNum),u(!1)},className:`block w-full text-left truncate py-0.5 hover:text-accent-cyan ${y.level===1?"font-medium text-basalt-200":"pl-3 text-basalt-400 text-[11px]"}`,children:[y.title," ",(0,e.jsxs)("span",{className:"text-[9px] text-basalt-500",children:["(p. ",y.pageNum,")"]})]},w))]}),(0,e.jsx)("iframe",{src:j,title:r,sandbox:"allow-same-origin allow-downloads",referrerPolicy:"no-referrer",className:"h-[min(70vh,48rem)] w-full border-0"})]})}function ne({href:a,label:r,resolver:s}){const[o,d]=(0,b.useState)({url:"",type:"",name:"",local:!1,failed:!1,blob:null}),c=o.url;return(0,b.useEffect)(()=>{let m="",u=!0;d({url:"",type:"",name:"",local:!1,failed:!1,blob:null});const i=a.slice(20).split("#")[0];return(s?Promise.resolve(s(i)).then(async n=>{const p=await fetch(n,{method:"HEAD",credentials:"include"});if(!p.ok)throw new Error("Attachment unavailable");return{url:n,mimeType:p.headers.get("Content-Type")||"",name:r||"attachment",local:!1}}):C(i)).then(n=>{if(!n?.blob&&!n?.url)throw new Error("Attachment unavailable");m=n.url||URL.createObjectURL(n.blob),u&&d({url:m,type:n.mimeType||n.blob?.type||"",name:n.name||r||"attachment",local:n.local,failed:!1,blob:n.blob})}).catch(()=>{u&&d({url:"",type:"",name:"",local:!1,failed:!0,blob:null})}),()=>{u=!1,m?.startsWith("blob:")&&URL.revokeObjectURL(m)}},[a,r,s]),o.failed?(0,e.jsx)("span",{className:"text-red-300",children:"Attachment unavailable"}):c?o.type.startsWith("audio/")?(0,e.jsx)("audio",{controls:!0,preload:"metadata",src:c,className:"my-3 w-full","aria-label":r||"Audio attachment"}):o.type.startsWith("video/")?(0,e.jsx)("video",{controls:!0,preload:"metadata",src:c,className:"my-3 max-h-[32rem] w-full rounded-xl","aria-label":r||"Video attachment"}):o.type==="application/pdf"?(0,e.jsx)(se,{url:c,name:o.name,href:a,blob:o.blob}):o.local?(0,e.jsxs)("a",{href:c,target:"_blank",rel:"noreferrer",className:"my-3 inline-flex items-center gap-2 rounded-lg border border-basalt-800 px-3 py-2 text-xs text-accent-cyan",children:[(0,e.jsx)(A,{size:13}),r||o.name||"Open attachment"]}):(0,e.jsxs)("a",{href:c,download:o.name||r||"attachment",className:"my-3 inline-flex items-center gap-2 rounded-lg border border-basalt-800 px-3 py-2 text-xs text-accent-cyan",children:[(0,e.jsx)(M,{size:13}),r||o.name||"Download attachment"]}):(0,e.jsx)("span",{className:"text-basalt-600",children:"Loading attachment…"})}function oe({src:a,alt:r,resolver:s}){const[o,d]=(0,b.useState)({url:"",failed:!1,unsupported:!1}),c=E(r);return(0,b.useEffect)(()=>{let m="",u=!0;d({url:"",failed:!1,unsupported:!1});const i=a.slice(20);return Promise.resolve(s?Promise.resolve(s(i)).then(n=>({url:n})):C(i)).then(async n=>{if(!n?.url&&!n?.blob)throw new Error("Attachment unavailable");if(/image\/(?:hei[cf]|heic)/i.test(n.mimeType||n.blob?.type||"")&&n.blob&&globalThis.createImageBitmap)try{const p=await createImageBitmap(n.blob),f=document.createElement("canvas");f.width=p.width,f.height=p.height,f.getContext("2d").drawImage(p,0,0),p.close();const g=await new Promise(t=>f.toBlob(t,"image/png"));g&&(m=URL.createObjectURL(g))}catch{}m||=n.url||URL.createObjectURL(n.blob),u&&d({url:m,failed:!m,unsupported:!1})}).catch(()=>{u&&d({url:"",failed:!0,unsupported:!1})}),()=>{u=!1,m?.startsWith("blob:")&&URL.revokeObjectURL(m)}},[s,a]),o.failed||o.unsupported?(0,e.jsx)("span",{role:"img","aria-label":c.alt||"Unavailable image",className:"my-4 block rounded-xl border border-red-400/15 bg-red-400/5 p-4 text-xs text-red-300",children:"Image attachment unavailable in this browser. The original file remains preserved."}):o.url?(0,e.jsx)("img",{src:o.url,alt:c.alt,loading:"lazy",onError:()=>d(m=>({...m,unsupported:!0}
2)),style:T(c),className:"my-5 block h-auto max-w-full rounded-xl border border-basalt-800"}):(0,e.jsx)("span",{className:"my-4 block rounded-xl border border-basalt-800 p-4 text-xs text-basalt-600",children:"Loading image..."})}function le({code:a}){const[r,s]=(0,b.useState)({svg:"",error:""}),o=b.useRef(`reading_mermaid_${crypto.randomUUID().replaceAll("-","")}`);return(0,b.useEffect)(()=>{let d=!0;if(!B(a)){s({svg:"",error:"Mermaid diagram exceeds the safe rendering limit."});return}return N(()=>import("./mermaid.core-BPTCjTZF.js").then(c=>(c.default.initialize({startOnLoad:!1,theme:"dark",securityLevel:"strict"}),c.default.render(o.current,a))),__vite__mapDeps([19,2,1,20,21,22,23,24,0,3,4,5,6,7,8,9,10,11,12,13,14,15,16,25,26,27,28,29,30,31,32,33,34,35,18,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53])).then(({svg:c})=>{d&&s({svg:V(c),error:""})}).catch(c=>{d&&s({svg:"",error:c.message})}),()=>{d=!1}},[a]),r.error?(0,e.jsx)("pre",{className:"my-4 overflow-auto rounded-xl border border-amber-300/15 p-4 text-[10px] text-amber-200",children:(0,e.jsx)("code",{children:a})}):r.svg?(0,e.jsx)("div",{className:"my-5 overflow-auto rounded-xl border border-white/[.07] bg-black/20 p-4",dangerouslySetInnerHTML:{__html:r.svg}}):(0,e.jsx)("div",{className:"my-4 rounded-xl border border-white/[.06] p-5 text-xs text-basalt-600",children:"Rendering Mermaid diagram…"})}function ie(a){return a.startsWith("basalt-attachment://")||a.startsWith("phasoric-context://")?a:J(a)}function _(a){return(a?.children||[]).map(r=>r.value||_(r)).join("")}function ce({value:a,settings:r,onNoteClick:s,onContextReferenceClick:o,attachmentResolver:d,allowRichEmbeds:c=!0,notePath:m}){const u=!!(m&&F()),i=(0,b.useMemo)(()=>Z(a),[a]),n=(0,b.useMemo)(()=>ee(i.body),[i.body]),p=r?.strictLineBreaks?[R,H]:[R],f=(0,b.useMemo)(()=>Y(i.body),[i.body]),g=Object.fromEntries([1,2,3,4,5,6].map(t=>[`h${t}`,({children:l})=>{const x=`h${t}`;return(0,e.jsx)(x,{id:X(b.Children.toArray(l).join("")),children:l})}]));return(0,e.jsx)("div",{className:"h-full overflow-y-auto rounded-lg border border-basalt-800/40 bg-basalt-950",children:(0,e.jsxs)("article",{className:`basalt-reading-view mx-auto min-h-full px-6 py-8 sm:px-10 ${r?.readableLineLength!==!1?"max-w-4xl":"max-w-none"}`,children:[r?.propertiesDisplay==="visible"&&i.properties.length>0&&(0,e.jsx)("dl",{className:"mb-8 grid gap-x-6 gap-y-2 rounded-xl border border-basalt-800 bg-basalt-900/40 p-4 text-xs sm:grid-cols-[9rem_1fr]",children:i.properties.map(([t,l])=>(0,e.jsxs)(b.Fragment,{children:[(0,e.jsx)("dt",{className:"font-mono text-basalt-500",children:t}),(0,e.jsx)("dd",{className:"text-basalt-200",children:l})]},t))}),r?.propertiesDisplay==="source"&&i.properties.length>0&&(0,e.jsx)("pre",{className:"mb-8 overflow-x-auto rounded-xl border border-basalt-800 bg-black/30 p-4 text-xs text-basalt-400",children:a.match(/^---[\s\S]*?---/)?.[0]}),f.length>1&&(0,e.jsxs)("details",{onKeyDown:t=>{if(!["ArrowDown","ArrowUp"].includes(t.key))return;const l=[...t.currentTarget.querySelectorAll("a")],x=l.indexOf(i.activeElement),h=l[(Math.max(0,x)+(t.key==="ArrowDown"?1:-1)+l.length)%l.length];h&&(t.preventDefault(),h.focus())},className:"sticky top-2 z-10 mb-8 rounded-xl border border-basalt-800 bg-basalt-950/95 p-4 shadow-xl backdrop-blur",children:[(0,e.jsxs)("summary",{className:"flex cursor-pointer items-center gap-2 text-[10px] font-bold uppercase tracking-wider text-basalt-400",children:[(0,e.jsx)(W,{size:13}),"Document outline"]}),(0,e.jsx)("ol",{className:"mt-4 max-h-52 space-y-1.5 overflow-y-auto",children:f.map(t=>(0,e.jsx)("li",{style:{paddingLeft:`${Math.max(0,t.level-1)*12}px`},children:(0,e.jsx)("a",{href:`#${t.slug}`,className:"text-[11px] text-basalt-400 hover:text-cyan-200",children:t.text})},t.id))})]}),(0,e.jsx)(G,{remarkPlugins:p,urlTransform:ie,components:{...g,p:({node:t,children:l})=>{const x=t?.children?.length===1?t.children[0]:null,h=x?.tagName==="a"?x.properties?.href:"",j=x?_(x):"";return c&&/^https?:\/\//i.test(h||"")?(0,e.jsx)(re,{href:h,label:j}):(0,e.jsx)("p",{children:l})},blockquote:({node:t,children:l})=>{const x=K(_(t));if(!x)return(0,e.jsx)("blockquote",{children:l});if(x.type==="TOGGLE")return(0,e.jsxs)("details",{className:"my-5 rounded-xl border border-violet-300/20 bg-violet-300/[.035] p-4",children:[(0,e.jsx)("summary",{className:"cursor-pointer text-sm font-semibold text-violet-100",children:x.title}),(0,e.jsx)("div",{className:"mt-3 whitespace-pre-wrap text-sm text-basalt-300",children:x.body})]});const h=x.type==="CAUTION"||x.type==="WARNING"?"border-amber-300/30 bg-amber-300/[.04]":x.type==="TIP"?"border-emerald-300/30 bg-emerald-300/[.04]":"border-cyan-300/30 bg-cyan-300/[.04]";return(0,e.jsxs)("aside",{className:`my-5 rounded-r-xl border-l-4 p-4 ${h}`,children:[(0,e.jsx)("div",{className:"text-[10px] font-bold uppercase tracking-wider",children:x.title}),(0,e.jsx)("div",{className:"mt-2 text-sm text-basalt-300",children:x.body})]})},code:({className:t,children:l,...x})=>t==="language-mermaid"?(0,e.jsx)(le,{code:String(l).replace(/\n$/,"")}):(0,e.jsx)("code",{className:t,...x,children:l}),a:({href:t,children:l,...x})=>{if(t?.startsWith("phasoric-context://")){const h=b.Children.toArray(l).join(""),j=z(t,h),y="inline-flex min-h-7 items-center rounded-full border border-violet-300/20 bg-violet-300/[.06] px-2 align-middle text-xs font-semibold text-violet-100";return o&&j?(0,e.jsx)("button",{type:"button",onClick:()=>o(j),className:`${y} hover:border-violet-300/40`,title:`${j.kind} · stable @ context`,children:l}):(0,e.jsx)("span",{className:y,title:j?`${j.kind} · stable @ context`:"Stable @ context",children:l})}if(t?.startsWith("#basalt-transclude=")){const h=decodeURIComponent(t.slice(19));return u&&/\.(?:png|jpe?g|gif|webp|svg|avif|bmp|ico|pdf|mp3|wav|mp4|ogg|m4a|webm|mov|flac)(?:\||$)/i.test(h)?(0,e.jsx)(S,{target:h,notePath:m,wiki:!0}):(0,e.jsx)(te,{target:h,onNoteClick:s})}if(t?.startsWith("#basalt-note=")){const h=decodeURIComponent(t.slice(13));return(0,e.jsx)("button",{type:"button",className:"font-semibold text-accent-cyan hover:underline hover:bg-accent-cyan/10 rounded px-1",onClick:()=>s?.(h),onMouseEnter:j=>{const y=j.currentTarget.getBoundingClientRect();window.dispatchEvent(new CustomEvent("basalt-show-note-tooltip",{detail:{name:h,position:{x:y.left,y:y.bottom}}}))},onMouseLeave:()=>window.dispatchEvent(new CustomEvent("basalt-hide-note-tooltip")),children:l})}if(t?.startsWith("basalt-attachment://"))return(0,e.jsx)(ne,{href:t,label:b.Children.toArray(l).join(""),resolver:d});if(u&&k(t)&&/\.md(?:#|$)/i.test(t)){const h=q(t,m);return h?(0,e.jsx)("button",{type:"button",onClick:()=>s?.(h),className:"text-accent-cyan hover:underline",children:l}):(0,e.jsx)("span",{children:l})}return u&&k(t)&&!/\.md(?:#|$)/i.test(t)?(0,e.jsx)(S,{target:t,label:b.Children.toArray(l).join(""),notePath:m}):(0,e.jsx)("a",{href:t,target:"_blank",rel:"noreferrer",className:"text-accent-cyan hover:underline",...x,children:l})},img:({src:t,alt:l})=>u&&k(t)?(0,e.jsx)(S,{target:t,label:l,notePath:m,image:!0}):t?.startsWith("basalt-attachment://")?(0,e.jsx)(oe,{src:t,alt:l,resolver:d}):(()=>{const x=E(l);return(0,e.jsx)("img",{src:t,alt:x.alt,loading:"lazy",referrerPolicy:"no-referrer",style:T(x),className:"my-5 block h-auto max-w-full rounded-xl"})})(),input:t=>(0,e.jsx)("input",{...t,readOnly:!0,className:"mr-2 accent-cyan-300"}),table:({children:t,...l})=>(0,e.jsx)(de,{...l,children:t})},children:n})]})})}function de({children:a,...r}){const s=b.useRef(null),[o,d]=(0,b.useState)(""),c=m=>{if(!s.current)return;const u=s.current,i=Array.from(u.querySelectorAll("tr"));if(!i.length)return;const n=Array.from(i[0].querySelectorAll("th, td")).map(p=>p.textContent.trim());if(m==="csv"){const p=i.map(f=>Array.from(f.querySelectorAll("th, td")).map(g=>`"${g.textContent.trim().replace(/"/g,'""')}"`).join(","));navigator.clipboard.writeText(p.join(`
3`)),d("CSV")}else if(m==="json"){const p=i.slice(1).map(f=>
3{const g=Array.from(f.querySelectorAll("td")).map(l=>l.textContent.trim()),t={};return n.forEach((l,x)=>{t[l||`col_${x}`]=g[x]||""}),t});navigator.clipboard.writeText(JSON.stringify(p,null,2)),d("JSON")}setTimeout(()=>d(""),2e3)};return(0,e.jsxs)("div",{className:"group relative my-5 overflow-x-auto rounded-xl border border-basalt-800 bg-basalt-900/30 p-2",children:[(0,e.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-2 border-b border-basalt-800/40 pb-1.5 text-[10px]",children:[(0,e.jsx)("span",{className:"font-mono uppercase tracking-wider text-basalt-500",children:"Table Data"}),(0,e.jsxs)("div",{className:"flex gap-1.5",children:[(0,e.jsx)("button",{onClick:()=>c("csv"),className:"rounded bg-basalt-800 px-2 py-0.5 text-accent-cyan hover:bg-basalt-700",children:o==="CSV"?"✓ Copied CSV":"Export CSV"}),(0,e.jsx)("button",{onClick:()=>c("json"),className:"rounded bg-basalt-800 px-2 py-0.5 text-accent-cyan hover:bg-basalt-700",children:o==="JSON"?"✓ Copied JSON":"Export JSON"})]})]}),(0,e.jsx)("table",{ref:s,className:"w-full text-left font-mono text-xs",...r,children:a})]})}export{Le as n,ce as t};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.