diff --git a/demo/aiui/assets/BrowsePage-IaSGp-tG.js b/demo/aiui/assets/BrowsePage-gmAlMEXj.js similarity index 82% rename from demo/aiui/assets/BrowsePage-IaSGp-tG.js rename to demo/aiui/assets/BrowsePage-gmAlMEXj.js index 347aa704..ff60340d 100644 --- a/demo/aiui/assets/BrowsePage-IaSGp-tG.js +++ b/demo/aiui/assets/BrowsePage-gmAlMEXj.js @@ -1,2 +1,2 @@ -import{a as E,c as o,F as b,g as M,b as s,e,n as F,t as p,E as g,i as y,r as w,J as P,k as D,D as T,o as L,G as H,Q as z,V as S,W as j}from"./index-CqBtvLD5.js";const V={class:"space-y-0.5"},A=["onClick"],O={key:1,class:"w-3 shrink-0"},I=["d"],R={class:"text-sm truncate"},N={key:0,class:"pl-4 ml-[18px] border-l border-white/5"},W="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",G="M5 19a2 2 0 01-2-2V7a2 2 0 012-2h4l2 2h4a2 2 0 012 2v1M5 19h14a2 2 0 002-2v-5a2 2 0 00-2-2H9a2 2 0 00-2 2v5a2 2 0 01-2 2z",U="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4",X="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z",q="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z",J=E({__name:"FileTree",props:{items:{}},emits:["selectFile"],setup(m,{emit:_}){const h=w(new Set),v=_;function n(l){if(l.isDirectory){const a=new Set(h.value);a.has(l.path)?a.delete(l.path):a.add(l.path),h.value=a}else v("selectFile",l)}const r=new Set(["ts","tsx","js","jsx","vue","svelte","py","rs","go","java","c","cpp","h","hpp","rb","php","swift","kt","cs","css","scss","less","html","xml","yaml","yml","toml","json","sh","bash","zsh","sql","md","mdx"]),c=new Set(["png","jpg","jpeg","gif","svg","webp","ico","bmp","avif"]);function x(l){return l.split(".").pop()?.toLowerCase()??""}function k(l){if(l.isDirectory)return"text-yellow-500/70";const a=x(l.name);return r.has(a)?"text-blue-400/70":c.has(a)?"text-green-400/70":"text-white/40"}function $(l){if(l.isDirectory)return h.value.has(l.path)?G:W;const a=x(l.name);return r.has(a)?U:c.has(a)?X:q}return(l,a)=>{const C=P("FileTree",!0);return s(),o("div",V,[(s(!0),o(b,null,M(m.items,u=>(s(),o("div",{key:u.path},[e("button",{class:F(["w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left transition-colors min-h-[32px]",u.isDirectory?"hover:bg-white/5 text-white/70 hover:text-white/80":"hover:bg-white/8 text-white/60 hover:text-white/80"]),onClick:i=>n(u)},[u.isDirectory?(s(),o("svg",{key:0,class:F(["w-3 h-3 text-white/30 shrink-0 transition-transform duration-150",{"rotate-90":h.value.has(u.path)}]),fill:"currentColor",viewBox:"0 0 20 20"},[...a[1]||(a[1]=[e("path",{"fill-rule":"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z","clip-rule":"evenodd"},null,-1)])],2)):(s(),o("span",O)),(s(),o("svg",{class:F(["w-4 h-4 shrink-0",k(u)]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:$(u)},null,8,I)],2)),e("span",R,p(u.name),1)],10,A),u.isDirectory&&u.children?.length&&h.value.has(u.path)?(s(),o("div",N,[g(C,{items:u.children,onSelectFile:a[0]||(a[0]=i=>l.$emit("selectFile",i))},null,8,["items"])])):y("",!0)]))),128))])}}}),K={class:"h-full flex flex-col"},Q={class:"flex items-center justify-between px-4 py-3 border-b border-white/5 shrink-0"},Y={class:"min-w-0 flex-1"},Z={class:"text-sm font-medium text-white/80 truncate"},ee={class:"text-xs text-white/30 truncate mt-0.5"},te={class:"flex items-center gap-2 shrink-0 ml-3"},se={class:"text-xs text-white/25 font-mono"},oe={class:"flex-1 overflow-auto"},ne={class:"text-xs font-mono leading-relaxed w-full"},le={class:"text-white/20 text-right pr-4 pl-4 py-0 select-none align-top whitespace-nowrap sticky left-0 bg-[#0a0a0a]"},ae={class:"text-white/70 pr-4 py-0 whitespace-pre"},B=E({__name:"FilePreview",props:{file:{}},emits:["close"],setup(m){const _=m,h=D(()=>_.file.content.split(` -`));function v(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}return(n,r)=>(s(),o("div",K,[e("div",Q,[e("div",Y,[e("p",Z,p(m.file.name),1),e("p",ee,p(m.file.path),1)]),e("div",te,[e("span",se,p(v(m.file.size)),1),e("button",{class:"min-w-[32px] min-h-[32px] flex items-center justify-center rounded-md text-white/40 hover:text-white/70 hover:bg-white/10 transition-colors","aria-label":"Close preview",onClick:r[0]||(r[0]=c=>n.$emit("close"))},[...r[1]||(r[1]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])])]),e("div",oe,[e("table",ne,[e("tbody",null,[(s(!0),o(b,null,M(h.value,(c,x)=>(s(),o("tr",{key:x,class:"hover:bg-white/3"},[e("td",le,p(x+1),1),e("td",ae,p(c),1)]))),128))])])])]))}}),ie={class:"h-full flex flex-col bg-[#0a0a0a]"},re={class:"glass shrink-0 px-4 py-3 flex items-center gap-3 border-b border-white/5"},ce={class:"px-4 py-2 flex items-center gap-1 text-xs text-white/40 shrink-0"},ue={class:"text-white/60 min-h-[28px] px-1 flex items-center"},he={class:"flex-1 overflow-hidden flex"},de={class:"flex-1 overflow-y-auto px-2 py-2"},pe={key:0,class:"flex items-center justify-center h-32"},ve={key:1,class:"flex items-center justify-center h-32"},fe={class:"text-sm text-red-400/70"},xe={key:2,class:"space-y-1"},we=["onClick"],me={class:"min-w-0 flex-1"},_e={class:"text-sm text-white/80 truncate group-hover:text-white/90"},ke={class:"text-xs text-white/25 truncate"},ge={key:0,class:"w-[400px] xl:w-[500px] border-l border-white/5 overflow-y-auto shrink-0"},ye={key:0,class:"fixed inset-0 z-50 bg-[#0a0a0a] overflow-y-auto"},Ce=E({__name:"BrowsePage",setup(m){const _=w([]),h=w([]),v=w(!0),n=w(""),r=w(null),c=w(null),x=w(window.innerWidth),k=D(()=>x.value<1024);async function $(){v.value=!0,n.value="";try{const i=await j("/api/fs/list");if(!i.ok)throw new Error(`Failed to load: ${i.status}`);const t=await i.json();_.value=t.projects??[]}catch(i){n.value=i instanceof Error?i.message:"Failed to load projects"}finally{v.value=!1}}async function l(i){r.value=i,c.value=null,v.value=!0,n.value="";try{const t=await j(`/api/fs/tree?path=${encodeURIComponent(i.path)}`);if(!t.ok)throw new Error(`Failed to load: ${t.status}`);const d=await t.json();h.value=d.files??[]}catch(t){n.value=t instanceof Error?t.message:"Failed to load files"}finally{v.value=!1}}function a(){r.value=null,c.value=null,h.value=[]}async function C(i){if(!r.value)return;const t=r.value.path+"/"+i.path;try{const d=await j(`/api/fs/read?path=${encodeURIComponent(t)}`);if(!d.ok){if(d.status===413){n.value="File too large to preview (max 1MB)";return}throw new Error(`Failed to read: ${d.status}`)}const f=await d.json();c.value={name:i.name,path:i.path,content:f.content,size:f.size}}catch(d){n.value=d instanceof Error?d.message:"Failed to read file"}}function u(){x.value=window.innerWidth}return T(()=>{$(),window.addEventListener("resize",u)}),L(()=>{window.removeEventListener("resize",u)}),(i,t)=>{const d=P("router-link");return s(),o("div",ie,[e("header",re,[g(d,{to:"/",class:"min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg text-white/60 hover:text-white/80 hover:bg-white/10 transition-colors","aria-label":"Back to chat"},{default:H(()=>[...t[2]||(t[2]=[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),_:1}),t[3]||(t[3]=e("h1",{class:"text-white/90 text-base font-medium truncate"},"Files",-1))]),e("nav",ce,[e("button",{class:"hover:text-white/70 transition-colors min-h-[28px] px-1",onClick:a}," Projects "),r.value?(s(),o(b,{key:0},[t[4]||(t[4]=e("span",{class:"text-white/20"},"/",-1)),e("span",ue,p(r.value.name),1)],64)):y("",!0)]),e("main",he,[e("div",de,[v.value?(s(),o("div",pe,[...t[5]||(t[5]=[e("span",{class:"text-sm text-white/50"},"Loading...",-1)])])):n.value?(s(),o("div",ve,[e("span",fe,p(n.value),1)])):r.value?(s(),z(J,{key:3,items:h.value,onSelectFile:C},null,8,["items"])):(s(),o("div",xe,[(s(!0),o(b,null,M(_.value,f=>(s(),o("button",{key:f.path,class:"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-left hover:bg-white/5 transition-colors group",onClick:be=>l(f)},[t[6]||(t[6]=e("svg",{class:"w-5 h-5 text-white/30 shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})],-1)),e("div",me,[e("p",_e,p(f.name),1),e("p",ke,p(f.language),1)])],8,we))),128))]))]),c.value&&!k.value?(s(),o("aside",ge,[g(B,{file:c.value,onClose:t[0]||(t[0]=f=>c.value=null)},null,8,["file"])])):y("",!0)]),(s(),z(S,{to:"body"},[c.value&&k.value?(s(),o("div",ye,[g(B,{file:c.value,onClose:t[1]||(t[1]=f=>c.value=null)},null,8,["file"])])):y("",!0)]))])}}});export{Ce as default}; +import{a as M,c as o,F as b,g as E,b as s,e,n as F,t as p,L as g,i as y,r as w,P as B,k as D,K as L,o as T,M as H,Q as z,V as S,W as j}from"./index-xgP_Yxxn.js";const V={class:"space-y-0.5"},A=["onClick"],O={key:1,class:"w-3 shrink-0"},I=["d"],R={class:"text-sm truncate"},N={key:0,class:"pl-4 ml-[18px] border-l border-white/5"},W="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",U="M5 19a2 2 0 01-2-2V7a2 2 0 012-2h4l2 2h4a2 2 0 012 2v1M5 19h14a2 2 0 002-2v-5a2 2 0 00-2-2H9a2 2 0 00-2 2v5a2 2 0 01-2 2z",G="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4",K="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z",X="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z",q=M({__name:"FileTree",props:{items:{}},emits:["selectFile"],setup(m,{emit:_}){const h=w(new Set),v=_;function n(l){if(l.isDirectory){const a=new Set(h.value);a.has(l.path)?a.delete(l.path):a.add(l.path),h.value=a}else v("selectFile",l)}const r=new Set(["ts","tsx","js","jsx","vue","svelte","py","rs","go","java","c","cpp","h","hpp","rb","php","swift","kt","cs","css","scss","less","html","xml","yaml","yml","toml","json","sh","bash","zsh","sql","md","mdx"]),c=new Set(["png","jpg","jpeg","gif","svg","webp","ico","bmp","avif"]);function x(l){return l.split(".").pop()?.toLowerCase()??""}function k(l){if(l.isDirectory)return"text-yellow-500/70";const a=x(l.name);return r.has(a)?"text-blue-400/70":c.has(a)?"text-green-400/70":"text-white/40"}function $(l){if(l.isDirectory)return h.value.has(l.path)?U:W;const a=x(l.name);return r.has(a)?G:c.has(a)?K:X}return(l,a)=>{const C=B("FileTree",!0);return s(),o("div",V,[(s(!0),o(b,null,E(m.items,u=>(s(),o("div",{key:u.path},[e("button",{class:F(["w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left transition-colors min-h-[32px]",u.isDirectory?"hover:bg-white/5 text-white/70 hover:text-white/80":"hover:bg-white/8 text-white/60 hover:text-white/80"]),onClick:i=>n(u)},[u.isDirectory?(s(),o("svg",{key:0,class:F(["w-3 h-3 text-white/30 shrink-0 transition-transform duration-150",{"rotate-90":h.value.has(u.path)}]),fill:"currentColor",viewBox:"0 0 20 20"},[...a[1]||(a[1]=[e("path",{"fill-rule":"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z","clip-rule":"evenodd"},null,-1)])],2)):(s(),o("span",O)),(s(),o("svg",{class:F(["w-4 h-4 shrink-0",k(u)]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:$(u)},null,8,I)],2)),e("span",R,p(u.name),1)],10,A),u.isDirectory&&u.children?.length&&h.value.has(u.path)?(s(),o("div",N,[g(C,{items:u.children,onSelectFile:a[0]||(a[0]=i=>l.$emit("selectFile",i))},null,8,["items"])])):y("",!0)]))),128))])}}}),Q={class:"h-full flex flex-col"},J={class:"flex items-center justify-between px-4 py-3 border-b border-white/5 shrink-0"},Y={class:"min-w-0 flex-1"},Z={class:"text-sm font-medium text-white/80 truncate"},ee={class:"text-xs text-white/30 truncate mt-0.5"},te={class:"flex items-center gap-2 shrink-0 ml-3"},se={class:"text-xs text-white/25 font-mono"},oe={class:"flex-1 overflow-auto"},ne={class:"text-xs font-mono leading-relaxed w-full"},le={class:"text-white/20 text-right pr-4 pl-4 py-0 select-none align-top whitespace-nowrap sticky left-0 bg-[#0a0a0a]"},ae={class:"text-white/70 pr-4 py-0 whitespace-pre"},P=M({__name:"FilePreview",props:{file:{}},emits:["close"],setup(m){const _=m,h=D(()=>_.file.content.split(` +`));function v(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}return(n,r)=>(s(),o("div",Q,[e("div",J,[e("div",Y,[e("p",Z,p(m.file.name),1),e("p",ee,p(m.file.path),1)]),e("div",te,[e("span",se,p(v(m.file.size)),1),e("button",{class:"min-w-[32px] min-h-[32px] flex items-center justify-center rounded-md text-white/40 hover:text-white/70 hover:bg-white/10 transition-colors","aria-label":"Close preview",onClick:r[0]||(r[0]=c=>n.$emit("close"))},[...r[1]||(r[1]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])])]),e("div",oe,[e("table",ne,[e("tbody",null,[(s(!0),o(b,null,E(h.value,(c,x)=>(s(),o("tr",{key:x,class:"hover:bg-white/3"},[e("td",le,p(x+1),1),e("td",ae,p(c),1)]))),128))])])])]))}}),ie={class:"h-full flex flex-col bg-[#0a0a0a]"},re={class:"glass shrink-0 px-4 py-3 flex items-center gap-3 border-b border-white/5"},ce={class:"px-4 py-2 flex items-center gap-1 text-xs text-white/40 shrink-0"},ue={class:"text-white/60 min-h-[28px] px-1 flex items-center"},he={class:"flex-1 overflow-hidden flex"},de={class:"flex-1 overflow-y-auto px-2 py-2"},pe={key:0,class:"flex items-center justify-center h-32"},ve={key:1,class:"flex items-center justify-center h-32"},fe={class:"text-sm text-red-400/70"},xe={key:2,class:"space-y-1"},we=["onClick"],me={class:"min-w-0 flex-1"},_e={class:"text-sm text-white/80 truncate group-hover:text-white/90"},ke={class:"text-xs text-white/25 truncate"},ge={key:0,class:"w-[400px] xl:w-[500px] border-l border-white/5 overflow-y-auto shrink-0"},ye={key:0,class:"fixed inset-0 z-50 bg-[#0a0a0a] overflow-y-auto"},Ce=M({__name:"BrowsePage",setup(m){const _=w([]),h=w([]),v=w(!0),n=w(""),r=w(null),c=w(null),x=w(window.innerWidth),k=D(()=>x.value<1024);async function $(){v.value=!0,n.value="";try{const i=await j("/api/fs/list");if(!i.ok)throw new Error(`Failed to load: ${i.status}`);const t=await i.json();_.value=t.projects??[]}catch(i){n.value=i instanceof Error?i.message:"Failed to load projects"}finally{v.value=!1}}async function l(i){r.value=i,c.value=null,v.value=!0,n.value="";try{const t=await j(`/api/fs/tree?path=${encodeURIComponent(i.path)}`);if(!t.ok)throw new Error(`Failed to load: ${t.status}`);const d=await t.json();h.value=d.files??[]}catch(t){n.value=t instanceof Error?t.message:"Failed to load files"}finally{v.value=!1}}function a(){r.value=null,c.value=null,h.value=[]}async function C(i){if(!r.value)return;const t=r.value.path+"/"+i.path;try{const d=await j(`/api/fs/read?path=${encodeURIComponent(t)}`);if(!d.ok){if(d.status===413){n.value="File too large to preview (max 1MB)";return}throw new Error(`Failed to read: ${d.status}`)}const f=await d.json();c.value={name:i.name,path:i.path,content:f.content,size:f.size}}catch(d){n.value=d instanceof Error?d.message:"Failed to read file"}}function u(){x.value=window.innerWidth}return L(()=>{$(),window.addEventListener("resize",u)}),T(()=>{window.removeEventListener("resize",u)}),(i,t)=>{const d=B("router-link");return s(),o("div",ie,[e("header",re,[g(d,{to:"/",class:"min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg text-white/60 hover:text-white/80 hover:bg-white/10 transition-colors","aria-label":"Back to chat"},{default:H(()=>[...t[2]||(t[2]=[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),_:1}),t[3]||(t[3]=e("h1",{class:"text-white/90 text-base font-medium truncate"},"Files",-1))]),e("nav",ce,[e("button",{class:"hover:text-white/70 transition-colors min-h-[28px] px-1",onClick:a}," Projects "),r.value?(s(),o(b,{key:0},[t[4]||(t[4]=e("span",{class:"text-white/20"},"/",-1)),e("span",ue,p(r.value.name),1)],64)):y("",!0)]),e("main",he,[e("div",de,[v.value?(s(),o("div",pe,[...t[5]||(t[5]=[e("span",{class:"text-sm text-white/50"},"Loading...",-1)])])):n.value?(s(),o("div",ve,[e("span",fe,p(n.value),1)])):r.value?(s(),z(q,{key:3,items:h.value,onSelectFile:C},null,8,["items"])):(s(),o("div",xe,[(s(!0),o(b,null,E(_.value,f=>(s(),o("button",{key:f.path,class:"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-left hover:bg-white/5 transition-colors group",onClick:be=>l(f)},[t[6]||(t[6]=e("svg",{class:"w-5 h-5 text-white/30 shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})],-1)),e("div",me,[e("p",_e,p(f.name),1),e("p",ke,p(f.language),1)])],8,we))),128))]))]),c.value&&!k.value?(s(),o("aside",ge,[g(P,{file:c.value,onClose:t[0]||(t[0]=f=>c.value=null)},null,8,["file"])])):y("",!0)]),(s(),z(S,{to:"body"},[c.value&&k.value?(s(),o("div",ye,[g(P,{file:c.value,onClose:t[1]||(t[1]=f=>c.value=null)},null,8,["file"])])):y("",!0)]))])}}});export{Ce as default}; diff --git a/demo/aiui/assets/ChatPage-C05pM21P.js b/demo/aiui/assets/ChatPage-C05pM21P.js deleted file mode 100644 index 2f232ee8..00000000 --- a/demo/aiui/assets/ChatPage-C05pM21P.js +++ /dev/null @@ -1,258 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/useNostr-CZatyrb1.js","assets/index-CqBtvLD5.js","assets/index-D1RpahE8.css","assets/ThreadNode-B0koBP1i.js"])))=>i.map(i=>d[i]); -import{a as G,Z as Vt,$ as rt,p as Ne,b as s,c as n,e,h as W,u as t,n as i,t as u,f as re,w as Q,v as J,F as D,g as N,i as v,j as Z,r as S,k as B,a0 as Ut,a1 as ct,H as se,a2 as dt,a3 as ut,a4 as ht,a5 as xt,U as Ie,a6 as qt,a7 as Gt,J as Ot,Q as q,D as ne,a8 as ae,a9 as ye,z as we,_ as pt,A as ie,B as Pe,d as Ht,aa as Wt,E as te,ab as Kt,ac as Yt,ad as Qt,S as Jt,q as Zt,ae as Xt,o as es,G as ue,af as Le,ag as ts}from"./index-CqBtvLD5.js";import{u as ss}from"./chat-D6vURcTH.js";import{u as $e,a as xe,e as He,d as gt,M as ns,b as ls,s as os,c as as,f as be,_ as tt}from"./ChatWindow.vue_vue_type_script_setup_true_lang-BS0iEVVD.js";import{_ as is}from"./FilmGrid.vue_vue_type_script_setup_true_lang-Cl2ukq8v.js";import{u as ze}from"./useContentImages-CXWJDBMs.js";import{_ as rs}from"./SongGrid.vue_vue_type_script_setup_true_lang-Bx4BvItY.js";import{useNostr as De}from"./useNostr-CZatyrb1.js";import{u as bt,_ as cs}from"./FilmDetail.vue_vue_type_script_setup_true_lang-Ckw7Dobw.js";import{_ as ds}from"./SongDetail.vue_vue_type_script_setup_true_lang-D619ywdc.js";const us={class:"h-full flex flex-col"},hs={class:"flex items-center justify-between gap-2"},xs={class:"flex items-center gap-2 shrink-0"},ps={key:0,class:"flex flex-wrap gap-1.5"},gs=["onClick"],bs={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-4 pb-16"},vs={class:"grid grid-cols-2 sm:grid-cols-3 gap-4"},fs=["aria-label","onClick"],ms={class:"cover-card flex-1 min-h-0 relative"},ws={key:0,class:"absolute inset-0 animate-shimmer"},ys=["src","alt","onError"],ks=["src","alt"],$s={key:3,class:"absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent pointer-events-none"},_s={class:"absolute bottom-0 left-0 right-0 p-2"},Cs={class:"text-xs font-semibold text-white/90 leading-tight truncate"},js={class:"text-xs text-white/40 truncate mt-0.5"},Ss={key:4,class:"absolute top-1.5 left-1.5"},Ms={class:"text-xs px-1.5 py-0.5 rounded bg-black/60 text-amber-400 backdrop-blur-sm font-medium"},Ts={key:5,class:"absolute top-1.5 right-1.5"},Is={class:"text-xs px-1 py-0.5 rounded bg-black/60 text-white/70 backdrop-blur-sm"},Ds={key:0,class:"flex items-center justify-center py-12"},Bs=G({__name:"BookGrid",props:{books:{},title:{default:"Recommended Books"}},emits:["selectBook"],setup(o){const c=o,{isDark:l}=Z(),m=S(""),g=S(null),{coverSrc:b,fallbackSrc:p,onError:w,isLoading:$}=ze({items:Ne(c,"books"),id:d=>d.id,existingUrl:d=>d.coverUrl,fetch:d=>rt(d.title,d.author),fallback:d=>Vt(d.title,d.author)}),_=B(()=>{const d=new Map;for(const a of c.books)for(const r of a.genres??[])d.set(r,(d.get(r)??0)+1);return[...d.entries()].sort((a,r)=>r[1]-a[1]).slice(0,8).map(([a])=>a)}),f=B(()=>{let d=c.books;if(m.value){const a=m.value.toLowerCase();d=d.filter(r=>r.title.toLowerCase().includes(a)||r.author.toLowerCase().includes(a)||(r.genres??[]).some(h=>h.toLowerCase().includes(a)))}return g.value&&(d=d.filter(a=>(a.genres??[]).includes(g.value))),d});return(d,a)=>(s(),n("div",us,[e("div",{class:"p-4 space-y-3",style:W(t(l)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("div",hs,[e("h3",{class:i(["text-sm font-bold",t(l)?"text-white/90":"text-gray-900"])},u(o.title),3),e("div",xs,[e("span",{class:i(["text-xs font-mono",t(l)?"text-white/30":"text-gray-400"])},u(f.value.length)+" books ",3),re(d.$slots,"header-actions")])]),Q(e("input",{"onUpdate:modelValue":a[0]||(a[0]=r=>m.value=r),type:"text",placeholder:"Search books...",class:i(["w-full px-3 py-2 rounded-lg text-base outline-none transition-colors",t(l)?"bg-white/5 text-white/80 placeholder:text-white/25 focus:bg-white/10":"bg-black/3 text-gray-800 placeholder:text-gray-400 focus:bg-black/5"])},null,2),[[J,m.value]]),_.value.length>0?(s(),n("div",ps,[(s(!0),n(D,null,N(_.value,r=>(s(),n("button",{key:r,class:i(["text-xs px-2 py-1 rounded-md transition-all duration-150",g.value===r?"nav-tab-active":t(l)?"text-white/40 hover:text-white/70 hover:bg-white/5":"text-gray-500 hover:text-gray-800 hover:bg-black/5"]),onClick:h=>g.value=g.value===r?null:r},u(r),11,gs))),128))])):v("",!0)],4),e("div",bs,[e("div",vs,[(s(!0),n(D,null,N(f.value,r=>(s(),n("button",{key:r.id,class:"group flex flex-col items-stretch text-left w-full path-glass-bubble rounded-2xl overflow-hidden transition-all duration-200 hover:brightness-105","aria-label":`${r.title} by ${r.author}`,onClick:h=>d.$emit("selectBook",r)},[e("div",ms,[e("div",{class:i(["aspect-[2/3] relative w-full overflow-hidden rounded-[10px]",t(b)(r)?"":t(l)?"bg-white/[0.06]":"bg-black/[0.04]"])},[t($)(r)?(s(),n("div",ws)):v("",!0),t(b)(r)?(s(),n("img",{key:1,src:t(b)(r),alt:`${r.title} by ${r.author}`,class:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-110",loading:"lazy",onError:h=>t(w)(r)},null,40,ys)):t($)(r)?v("",!0):(s(),n("img",{key:2,src:t(p)(r),alt:r.title,class:"w-full h-full object-cover"},null,8,ks)),t(b)(r)?(s(),n("div",$s)):v("",!0),e("div",_s,[e("p",Cs,u(r.title),1),e("p",js,u(r.author),1)]),r.rating?(s(),n("div",Ss,[e("span",Ms," ★ "+u(r.rating.toFixed(1)),1)])):v("",!0),r.year?(s(),n("div",Ts,[e("span",Is,u(r.year),1)])):v("",!0)],2)])],8,fs))),128))]),f.value.length===0?(s(),n("div",Ds,[e("p",{class:i(["text-sm",t(l)?"text-white/30":"text-gray-400"])}," No books match your search ",2)])):v("",!0)])]))}}),Ls={class:"h-full flex flex-col"},Ps={class:"flex items-center justify-between gap-2"},Ns={class:"flex items-center gap-2 shrink-0"},zs={key:0,class:"flex flex-wrap gap-1.5"},Es=["onClick"],As={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-4 pb-16"},Fs={class:"grid grid-cols-2 sm:grid-cols-3 gap-4"},Rs=["aria-label","onClick"],Vs={class:"cover-card flex-1 min-h-0 relative"},Us={key:0,class:"absolute inset-0 animate-shimmer"},qs=["src","alt","onError"],Gs=["src","alt"],Os={key:3,class:"absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent pointer-events-none"},Hs={class:"absolute bottom-0 left-0 right-0 p-2"},Ws={class:"text-xs font-semibold text-white/90 leading-tight truncate"},Ks={class:"text-xs text-white/40 truncate mt-0.5"},Ys={key:4,class:"absolute top-1.5 left-1.5"},Qs={class:"text-xs px-1.5 py-0.5 rounded bg-black/60 text-amber-400 backdrop-blur-sm font-medium"},Js={key:5,class:"absolute top-1.5 right-1.5"},Zs={class:"absolute top-1.5 right-1.5 flex gap-0.5 flex-wrap justify-end max-w-[60%]"},Xs={key:0,class:"flex items-center justify-center py-12"},en=G({__name:"TVSeriesGrid",props:{series:{},title:{default:"Recommended TV Series"}},emits:["selectSeries"],setup(o){const c=o,{isDark:l}=Z(),m=S(""),g=S(null),{coverSrc:b,fallbackSrc:p,onError:w,isLoading:$}=ze({items:Ne(c,"series"),id:a=>a.id,existingUrl:a=>a.posterUrl||a.backdropUrl,fetch:a=>ct(a.title,a.year).then(r=>r.posterUrl),fallback:a=>Ut(a.title,a.year)});function _(a){return a.year?a.endYear&&a.endYear!==a.year?`${a.year}–${a.endYear}`:a.status==="ongoing"?`${a.year}–`:String(a.year):""}const f=B(()=>{const a=new Map;for(const r of c.series)for(const h of r.genres??[])a.set(h,(a.get(h)??0)+1);return[...a.entries()].sort((r,h)=>h[1]-r[1]).slice(0,8).map(([r])=>r)}),d=B(()=>{let a=c.series;if(m.value){const r=m.value.toLowerCase();a=a.filter(h=>h.title.toLowerCase().includes(r)||(h.creator??"").toLowerCase().includes(r)||(h.network??"").toLowerCase().includes(r)||(h.genres??[]).some(M=>M.toLowerCase().includes(r)))}return g.value&&(a=a.filter(r=>(r.genres??[]).includes(g.value))),a});return(a,r)=>(s(),n("div",Ls,[e("div",{class:"p-4 space-y-3",style:W(t(l)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("div",Ps,[e("h3",{class:i(["text-sm font-bold",t(l)?"text-white/90":"text-gray-900"])},u(o.title),3),e("div",Ns,[e("span",{class:i(["text-xs font-mono",t(l)?"text-white/30":"text-gray-400"])},u(d.value.length)+" series ",3),re(a.$slots,"header-actions")])]),Q(e("input",{"onUpdate:modelValue":r[0]||(r[0]=h=>m.value=h),type:"text",placeholder:"Search TV series...",class:i(["w-full px-3 py-2 rounded-lg text-base outline-none transition-colors",t(l)?"bg-white/5 text-white/80 placeholder:text-white/25 focus:bg-white/10":"bg-black/3 text-gray-800 placeholder:text-gray-400 focus:bg-black/5"])},null,2),[[J,m.value]]),f.value.length>0?(s(),n("div",zs,[(s(!0),n(D,null,N(f.value,h=>(s(),n("button",{key:h,class:i(["text-xs px-2 py-1 rounded-md transition-all duration-150",g.value===h?"nav-tab-active":t(l)?"text-white/40 hover:text-white/70 hover:bg-white/5":"text-gray-500 hover:text-gray-800 hover:bg-black/5"]),onClick:M=>g.value=g.value===h?null:h},u(h),11,Es))),128))])):v("",!0)],4),e("div",As,[e("div",Fs,[(s(!0),n(D,null,N(d.value,h=>(s(),n("button",{key:h.id,class:"group flex flex-col items-stretch text-left w-full path-glass-bubble rounded-2xl overflow-hidden transition-all duration-200 hover:brightness-105","aria-label":h.title,onClick:M=>a.$emit("selectSeries",h)},[e("div",Vs,[e("div",{class:i(["aspect-[2/3] relative w-full overflow-hidden rounded-[10px]",t(b)(h)?"":t(l)?"bg-white/[0.06]":"bg-black/[0.04]"])},[t($)(h)?(s(),n("div",Us)):v("",!0),t(b)(h)?(s(),n("img",{key:1,src:t(b)(h),alt:`${h.title} — TV Series`,class:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-110",loading:"lazy",onError:M=>t(w)(h)},null,40,qs)):t($)(h)?v("",!0):(s(),n("img",{key:2,src:t(p)(h),alt:h.title,class:"w-full h-full object-cover"},null,8,Gs)),t(b)(h)?(s(),n("div",Os)):v("",!0),e("div",Hs,[e("p",Ws,u(h.title),1),e("p",Ks,[se(u(_(h)),1),h.seasons?(s(),n(D,{key:0},[se(" · "+u(h.seasons)+"S",1)],64)):v("",!0)])]),h.rating?(s(),n("div",Ys,[e("span",Qs," ★ "+u(h.rating.toFixed(1)),1)])):v("",!0),h.status==="ongoing"?(s(),n("div",Js,[...r[1]||(r[1]=[e("span",{class:"text-xs px-1 py-0.5 rounded bg-emerald-500/80 text-white backdrop-blur-sm"}," ongoing ",-1)])])):v("",!0),e("div",Zs,[(s(!0),n(D,null,N((h.sources??[]).slice(0,2),M=>(s(),n("span",{key:M.type,class:"text-xs px-1 py-0.5 rounded bg-black/60 text-white/70 backdrop-blur-sm"},u(M.type),1))),128))])],2)])],8,Rs))),128))]),d.value.length===0?(s(),n("div",Xs,[e("p",{class:i(["text-sm",t(l)?"text-white/30":"text-gray-400"])}," No TV series match your search ",2)])):v("",!0)])]))}}),tn={class:"h-full flex flex-col"},sn={class:"flex items-center justify-between gap-2"},nn={class:"flex items-center gap-2 shrink-0"},ln={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-4 pb-16"},on={class:"columns-2 sm:columns-3 gap-3 space-y-3"},an=["aria-label","onClick"],rn=["src","alt","onError"],cn={key:2,class:"absolute bottom-0 left-0 right-0 p-2 bg-gradient-to-t from-black/70 via-black/30 to-transparent"},dn={key:0,class:"text-xs font-medium text-white/90 truncate"},un={key:1,class:"text-xs text-white/50 truncate"},hn={key:0,class:"flex items-center justify-center py-12"},xn=G({__name:"ImageGrid",props:{images:{},title:{default:"Images"}},emits:["selectImage"],setup(o){const{isDark:c}=Z(),l=S(new Set);function m(g){l.value.add(g.id),l.value=new Set(l.value)}return(g,b)=>(s(),n("div",tn,[e("div",{class:"p-4 space-y-3",style:W(t(c)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("div",sn,[e("h3",{class:i(["text-sm font-bold",t(c)?"text-white/90":"text-gray-900"])},u(o.title),3),e("div",nn,[e("span",{class:i(["text-xs font-mono",t(c)?"text-white/30":"text-gray-400"])},u(o.images.length)+" images ",3),re(g.$slots,"header-actions")])])],4),e("div",ln,[e("div",on,[(s(!0),n(D,null,N(o.images,p=>(s(),n("button",{key:p.id,class:i(["group w-full break-inside-avoid text-left rounded-xl overflow-hidden transition-all duration-200 hover:brightness-110 relative",t(c)?"bg-white/5":"bg-black/3"]),"aria-label":p.alt||p.title||"Image",onClick:w=>g.$emit("selectImage",p)},[l.value.has(p.id)?(s(),n("div",{key:1,class:i(["w-full aspect-[4/3] flex items-center justify-center",t(c)?"bg-white/5":"bg-black/5"])},[(s(),n("svg",{class:i(["w-8 h-8",t(c)?"text-white/15":"text-gray-300"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...b[0]||(b[0]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"},null,-1)])],2))],2)):(s(),n("img",{key:0,src:p.url,alt:p.alt||p.title||"Image",class:"w-full block transition-transform duration-300 group-hover:scale-[1.03]",loading:"lazy",onError:w=>m(p)},null,40,rn)),p.title||p.source?(s(),n("div",cn,[p.title?(s(),n("p",dn,u(p.title),1)):v("",!0),p.source?(s(),n("p",un,u(p.source),1)):v("",!0)])):v("",!0)],10,an))),128))]),o.images.length===0?(s(),n("div",hn,[e("p",{class:i(["text-sm",t(c)?"text-white/30":"text-gray-400"])}," No images found ",2)])):v("",!0)])]))}}),pn={class:"h-full flex flex-col"},gn={class:"p-4 space-y-3"},bn={class:"flex items-center justify-between"},vn={class:"shrink-0 flex items-center gap-2"},fn={key:0,class:"flex flex-wrap gap-1.5"},mn=["onClick"],wn={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pb-16"},yn={class:"grid grid-cols-2 sm:grid-cols-3 gap-3"},kn=["aria-label","onClick"],$n={class:"aspect-[4/3] relative w-full overflow-hidden rounded-t-[10px]"},_n={key:0,class:"absolute inset-0 animate-shimmer"},Cn=["src","alt","onError"],jn=["src","alt"],Sn={key:3,class:"absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent pointer-events-none"},Mn={class:"absolute bottom-0 left-0 right-0 p-2"},Tn={class:"text-xs font-semibold text-white/90 truncate"},In={class:"text-xs text-white/40 truncate mt-0.5"},Dn={key:4,class:"absolute top-1.5 right-1.5"},Bn={class:"text-xs px-1.5 py-0.5 rounded bg-black/60 text-amber-400 backdrop-blur-sm font-semibold"},Ln={key:5,class:"absolute top-1.5 left-1.5"},Pn={class:"text-xs px-1 py-0.5 rounded bg-black/60 text-white/70 backdrop-blur-sm"},Nn={key:0,class:"flex items-center justify-center py-12"},zn=G({__name:"PlaceGrid",props:{places:{},title:{default:"Places"}},emits:["selectPlace"],setup(o){const c=o,{isDark:l}=Z(),m=S(""),g=S(null),{coverSrc:b,fallbackSrc:p,onError:w,isLoading:$}=ze({items:Ne(c,"places"),id:d=>d.id,existingUrl:d=>d.photoUrl,fetch:d=>ut(d.name,d.city),fallback:d=>dt(d.name,d.cuisine||d.category)}),_=B(()=>{const d=new Map;for(const a of c.places){const r=a.cuisine||a.category;r&&d.set(r,(d.get(r)??0)+1)}return[...d.entries()].sort((a,r)=>r[1]-a[1]).slice(0,8).map(([a])=>a)}),f=B(()=>{let d=c.places;if(m.value){const a=m.value.toLowerCase();d=d.filter(r=>r.name.toLowerCase().includes(a)||r.cuisine?.toLowerCase().includes(a)||r.category?.toLowerCase().includes(a)||r.city?.toLowerCase().includes(a)||r.address?.toLowerCase().includes(a))}return g.value&&(d=d.filter(a=>a.cuisine===g.value||a.category===g.value)),d});return(d,a)=>(s(),n("div",pn,[e("div",gn,[e("div",bn,[e("h3",{class:i(["text-base font-bold",t(l)?"text-white/90":"text-gray-900"])},u(o.title||"Places"),3),e("div",vn,[e("span",{class:i(["text-xs",t(l)?"text-white/30":"text-gray-400"])},u(f.value.length)+" places ",3),re(d.$slots,"header-actions")])]),Q(e("input",{"onUpdate:modelValue":a[0]||(a[0]=r=>m.value=r),type:"text",placeholder:"Search places...",class:i(["w-full text-base px-3 py-2 rounded-lg outline-none transition-colors",t(l)?"bg-white/5 text-white/80 placeholder-white/25 focus:bg-white/8":"bg-black/5 text-gray-800 placeholder-gray-400 focus:bg-black/8"])},null,2),[[J,m.value]]),_.value.length>1?(s(),n("div",fn,[(s(!0),n(D,null,N(_.value,r=>(s(),n("button",{key:r,class:i(["text-xs px-2 py-1 rounded-md font-medium transition-all duration-150",g.value===r?"nav-tab-active":t(l)?"bg-white/5 text-white/40 hover:text-white/70":"bg-black/5 text-gray-500 hover:text-gray-800"]),onClick:h=>g.value=g.value===r?null:r},u(r),11,mn))),128))])):v("",!0)]),e("div",wn,[e("div",yn,[(s(!0),n(D,null,N(f.value,r=>(s(),n("button",{key:r.id,class:"group flex flex-col items-stretch text-left w-full path-glass-bubble rounded-2xl overflow-hidden transition-all duration-200 hover:brightness-105","aria-label":r.name,onClick:h=>d.$emit("selectPlace",r)},[e("div",$n,[t($)(r)?(s(),n("div",_n)):v("",!0),t(b)(r)?(s(),n("img",{key:1,src:t(b)(r),alt:r.name,class:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-110",loading:"lazy",onError:h=>t(w)(r)},null,40,Cn)):t($)(r)?v("",!0):(s(),n("img",{key:2,src:t(p)(r),alt:r.name,class:"w-full h-full object-cover"},null,8,jn)),t(b)(r)?(s(),n("div",Sn)):v("",!0),e("div",Mn,[e("p",Tn,u(r.name),1),e("p",In,u(r.cuisine||r.category),1)]),r.rating?(s(),n("div",Dn,[e("span",Bn," ★ "+u(r.rating.toFixed(1)),1)])):v("",!0),r.priceLevel?(s(),n("div",Ln,[e("span",Pn,u("$".repeat(r.priceLevel)),1)])):v("",!0)])],8,kn))),128))]),f.value.length===0?(s(),n("div",Nn,[e("p",{class:i(["text-xs",t(l)?"text-white/30":"text-gray-400"])}," No places match your search ",2)])):v("",!0)])]))}}),En={class:"h-full flex flex-col"},An={class:"flex items-center justify-between gap-2"},Fn={class:"flex items-center gap-2 shrink-0"},Rn={key:0,class:"flex flex-wrap gap-1.5"},Vn=["onClick"],Un={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-4 pb-16"},qn={class:"grid grid-cols-2 sm:grid-cols-3 gap-4"},Gn=["aria-label","onClick"],On={class:"cover-card flex-1 min-h-0 relative"},Hn={key:0,class:"absolute inset-0 animate-shimmer"},Wn=["src","alt","onError"],Kn=["src","alt"],Yn={key:3,class:"absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent pointer-events-none"},Qn={class:"absolute bottom-0 left-0 right-0 p-2"},Jn={class:"text-xs font-semibold text-white/90 leading-tight truncate"},Zn={class:"text-xs text-white/40 truncate mt-0.5"},Xn={class:"absolute top-1.5 right-1.5 flex gap-0.5 flex-wrap justify-end max-w-[60%]"},el={key:0,class:"flex items-center justify-center py-12"},tl=G({__name:"PodcastGrid",props:{podcasts:{},title:{default:"Recommended Podcasts"}},emits:["selectPodcast"],setup(o){const c=o,{isDark:l}=Z(),m=S(""),g=S(null),{coverSrc:b,fallbackSrc:p,onError:w,isLoading:$}=ze({items:Ne(c,"podcasts"),id:d=>d.id,existingUrl:d=>d.coverUrl,fetch:d=>xt(d.title,d.host),fallback:d=>ht(d.title,d.host)}),_=B(()=>{const d=new Map;for(const a of c.podcasts)for(const r of a.genres??[])d.set(r,(d.get(r)??0)+1);return[...d.entries()].sort((a,r)=>r[1]-a[1]).slice(0,8).map(([a])=>a)}),f=B(()=>{let d=c.podcasts;if(m.value){const a=m.value.toLowerCase();d=d.filter(r=>r.title.toLowerCase().includes(a)||(r.host??"").toLowerCase().includes(a)||(r.genres??[]).some(h=>h.toLowerCase().includes(a)))}return g.value&&(d=d.filter(a=>(a.genres??[]).includes(g.value))),d});return(d,a)=>(s(),n("div",En,[e("div",{class:"p-4 space-y-3",style:W(t(l)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("div",An,[e("h3",{class:i(["text-sm font-bold",t(l)?"text-white/90":"text-gray-900"])},u(o.title),3),e("div",Fn,[e("span",{class:i(["text-xs font-mono",t(l)?"text-white/30":"text-gray-400"])},u(f.value.length)+" podcasts ",3),re(d.$slots,"header-actions")])]),Q(e("input",{"onUpdate:modelValue":a[0]||(a[0]=r=>m.value=r),type:"text",placeholder:"Search podcasts...",class:i(["w-full px-3 py-2 rounded-lg text-base outline-none transition-colors",t(l)?"bg-white/5 text-white/80 placeholder:text-white/25 focus:bg-white/10":"bg-black/3 text-gray-800 placeholder:text-gray-400 focus:bg-black/5"])},null,2),[[J,m.value]]),_.value.length>0?(s(),n("div",Rn,[(s(!0),n(D,null,N(_.value,r=>(s(),n("button",{key:r,class:i(["text-xs px-2 py-1 rounded-md transition-all duration-150",g.value===r?"nav-tab-active":t(l)?"text-white/40 hover:text-white/70 hover:bg-white/5":"text-gray-500 hover:text-gray-800 hover:bg-black/5"]),onClick:h=>g.value=g.value===r?null:r},u(r),11,Vn))),128))])):v("",!0)],4),e("div",Un,[e("div",qn,[(s(!0),n(D,null,N(f.value,r=>(s(),n("button",{key:r.id,class:"group flex flex-col items-stretch text-left w-full path-glass-bubble rounded-2xl overflow-hidden transition-all duration-200 hover:brightness-105","aria-label":r.title,onClick:h=>d.$emit("selectPodcast",r)},[e("div",On,[e("div",{class:i(["aspect-square relative w-full overflow-hidden rounded-[10px]",t(b)(r)?"":t(l)?"bg-white/[0.06]":"bg-black/[0.04]"])},[t($)(r)?(s(),n("div",Hn)):v("",!0),t(b)(r)?(s(),n("img",{key:1,src:t(b)(r),alt:r.title,class:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-110",loading:"lazy",onError:h=>t(w)(r)},null,40,Wn)):t($)(r)?v("",!0):(s(),n("img",{key:2,src:t(p)(r),alt:r.title,class:"w-full h-full object-cover"},null,8,Kn)),t(b)(r)?(s(),n("div",Yn)):v("",!0),e("div",Qn,[e("p",Jn,u(r.title),1),e("p",Zn,u(r.host||"Podcast"),1)]),e("div",Xn,[(s(!0),n(D,null,N(r.sources.slice(0,2),h=>(s(),n("span",{key:h.type,class:"text-xs px-1 py-0.5 rounded bg-black/60 text-white/70 backdrop-blur-sm"},u(h.type),1))),128))])],2)])],8,Gn))),128))]),f.value.length===0?(s(),n("div",el,[e("p",{class:i(["text-sm",t(l)?"text-white/30":"text-gray-400"])}," No podcasts match your search ",2)])):v("",!0)])]))}}),sl={class:"shrink-0"},nl={class:"flex-1 overflow-y-auto custom-scrollbar"},ll={key:0,class:"relative overflow-hidden",style:{minHeight:"180px"}},ol={class:"absolute inset-0"},al=["src"],il={class:"relative z-10 flex flex-col justify-end h-full px-5 pb-5 pt-12",style:{"min-height":"180px"}},rl={class:"px-3 pt-2 pb-8"},cl={key:0,"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 2a10 10 0 100 20 10 10 0 000-20zm0 0v2m0 16v2m10-10h-2M4 12H2m15.07-5.07l-1.41 1.41M8.34 15.66l-1.41 1.41m0-11.14l1.41 1.41m7.32 7.32l1.41 1.41"},dl={key:1,"stroke-linecap":"round","stroke-linejoin":"round",d:"M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z"},ul={key:2,"stroke-linecap":"round","stroke-linejoin":"round",d:"M13 2L3 14h9l-1 8 10-12h-9l1-8z"},hl={key:3,"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 6h16M4 12h16M4 18h7"},xl=["onClick"],pl=["onClick"],gl={key:1,class:"flex items-center justify-center py-16 px-4"},bl=G({__name:"MagazineGrid",props:{sections:{},heroImageUrl:{default:null},title:{default:"Brief"},query:{default:""}},setup(o){const c=o,{isDark:l}=Z(),{openMagazineSectionDetail:m}=$e(),g=["compass","bookmark","lightning","lines"];function b(f){return f.replace(/\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/https?:\/\/\S+/g,"").replace(/\uFE0F/g,"").replace(new RegExp("(?:^|(?<=\\s))[\\p{Emoji_Presentation}\\p{Extended_Pictographic}]+\\s*","gu"),"").replace(/---+/g,"").replace(/^#+\s*/gm,"").replace(/\*\*/g,"").replace(/\*([^*\n]+)\*/g,"$1").replace(/\|/g,", ").replace(/,\s*,+/g,",").replace(/^\s*[-•]\s+/gm,"").replace(/\n+/g," ").replace(/(^|\s),\s*/g,"$1").trim()}function p(f,d){const a=b(f);return a.length<=d?a:a.slice(0,d).replace(/\s+\S*$/,"")+" ..."}const w=B(()=>{const f=[],d=c.sections;if(!d.length)return f;let a=0;for(const j of c.query||"brief")a=(a<<5)-a+j.charCodeAt(0)|0;let r="",h=0,M=!1;return d.forEach((j,L)=>{if(L===0&&!j.group){f.push({type:"wide",title:j.title,text:p(j.content,200),label:"The Lead",author:j.author,section:j});return}const I=j.group||"";if(I&&I!==r&&(M&&(f.push({type:"dark",title:"",text:""}),M=!1),f.push({type:"banner",title:"",text:"",icon:g[h%g.length],label:I}),h++,r=I),I){const C=M?"dark":"half",k=b(j.content),x=b(j.title),y=k.toLowerCase().startsWith(x.toLowerCase().slice(0,30));f.push({type:C,title:y?"":j.title,text:p(j.content,y?160:100),section:j}),M=!M}else M&&(f.push({type:"dark",title:"",text:""}),M=!1),f.push({type:"wide",title:j.title,text:p(j.content,180),author:j.author,section:j})}),M&&f.push({type:"dark",title:"",text:""}),f});function $(f){const d=c.sections.indexOf(f);m(f,d>=0?d:0)}const _=B(()=>{const f=(c.query??"").trim();return f?f.length>100?f.slice(0,97)+"...":f:c.title});return(f,d)=>(s(),n("div",{class:i(["magazine h-full flex flex-col",t(l)?"magazine-dark":"magazine-light"])},[e("header",{class:i(["shrink-0 px-5 py-4 flex items-center justify-between border-b",t(l)?"border-white/10":"border-black/10"])},[e("h1",{class:i(["font-serif text-xl font-bold tracking-tight",t(l)?"text-white":"text-black"])}," AI Brief ",2),e("div",sl,[re(f.$slots,"header-actions",{},void 0,!0)])],2),e("div",nl,[_.value?(s(),n("div",ll,[e("div",ol,[o.heroImageUrl?(s(),n("img",{key:0,src:o.heroImageUrl,alt:"",class:"w-full h-full object-cover",style:{filter:"saturate(0.3) contrast(1.1)"}},null,8,al)):(s(),n("div",{key:1,class:i(["w-full h-full",t(l)?"bg-gradient-to-br from-white/[0.04] via-white/[0.02] to-transparent":"bg-gradient-to-br from-black/[0.06] via-black/[0.03] to-transparent"])},null,2))]),e("div",{class:i(["absolute inset-0",t(l)?"bg-gradient-to-t from-[#0a0a0a] via-[#0a0a0a]/80 to-[#0a0a0a]/60":"bg-gradient-to-t from-[#faf9f6] via-[#faf9f6]/85 to-[#faf9f6]/65"])},null,2),e("div",il,[e("p",{class:i(["text-xs uppercase tracking-[0.3em] font-medium mb-2",t(l)?"text-white/40":"text-black/40"])}," In response to ",2),e("p",{class:i(["font-serif text-2xl italic leading-tight",t(l)?"text-white/70":"text-black/60"])},u(_.value),3)])])):v("",!0),e("div",rl,[e("div",{class:i(["grid grid-cols-2 gap-px",t(l)?"bg-white/12":"bg-black/10"])},[(s(!0),n(D,null,N(w.value,(a,r)=>(s(),n(D,{key:r},[a.type==="banner"?(s(),n("div",{key:0,class:i(["col-span-2 flex flex-col items-center justify-center py-8 px-5",t(l)?"bg-[#0a0a0a]":"bg-[#faf9f6]"])},[(s(),n("svg",{class:i(["w-5 h-5 mb-2.5",t(l)?"text-white/20":"text-black/15"]),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[a.icon==="compass"?(s(),n("path",cl)):a.icon==="bookmark"?(s(),n("path",dl)):a.icon==="lightning"?(s(),n("path",ul)):(s(),n("path",hl))],2)),e("p",{class:i(["text-xs uppercase tracking-[0.3em] font-semibold text-center",t(l)?"text-white/30":"text-black/30"])},u(a.label),3)],2)):a.type==="wide"?(s(),n("button",{key:1,class:i(["col-span-2 text-left px-5 py-5 transition-colors cursor-pointer",t(l)?"bg-[#0a0a0a] hover:bg-white/[0.03]":"bg-[#faf9f6] hover:bg-black/[0.02]"]),onClick:h=>a.section&&$(a.section)},[a.label?(s(),n("p",{key:0,class:i(["text-xs uppercase tracking-[0.3em] font-semibold mb-2",t(l)?"text-white/30":"text-black/35"])},u(a.label),3)):v("",!0),e("h2",{class:i(["font-serif text-lg font-bold leading-snug mb-2",t(l)?"text-white/95":"text-black/90"])},u(a.title),3),a.author?(s(),n("p",{key:1,class:i(["text-xs mb-2",t(l)?"text-white/40":"text-black/40"])}," By "+u(a.author),3)):v("",!0),e("p",{class:i(["font-serif text-sm leading-relaxed",t(l)?"text-white/70":"text-black/60"])},u(a.text),3)],10,xl)):(s(),n("button",{key:2,class:i(["text-left px-4 py-4 transition-colors flex flex-col cursor-pointer",[t(l)?"bg-[#0a0a0a] hover:bg-white/[0.03]":"bg-[#faf9f6] hover:bg-black/[0.02]",a.type==="dark"?t(l)?"bg-white/[0.04]":"bg-black/[0.04]":""]]),onClick:h=>a.section&&$(a.section)},[a.label?(s(),n("p",{key:0,class:i(["text-xs uppercase tracking-[0.25em] font-semibold mb-1.5",t(l)?"text-white/25":"text-black/30"])},u(a.label),3)):v("",!0),a.title?(s(),n("h3",{key:1,class:i(["font-serif text-sm font-bold leading-snug mb-1",t(l)?"text-white/90":"text-black/85"])},u(a.title),3)):v("",!0),e("p",{class:i(["font-serif text-xs leading-relaxed flex-1",[t(l)?"text-white/55":"text-black/50",a.title?"":"italic"]])},u(a.text),3)],10,pl))],64))),128))],2)]),o.sections.length===0?(s(),n("div",gl,[e("p",{class:i(["text-sm",t(l)?"text-white/40":"text-gray-400"])}," No sections to display ",2)])):v("",!0)])],2))}}),st=Ie(bl,[["__scopeId","data-v-02741b8c"]]),vl={class:"h-full flex flex-col"},fl={class:"flex items-center justify-between gap-2"},ml={class:"flex items-center gap-2 shrink-0"},wl=["placeholder"],yl={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-4 pb-16"},kl={class:"grid grid-cols-2 sm:grid-cols-3 gap-4"},$l=["aria-label","onClick"],_l={class:"cover-card flex-1 min-h-0 relative"},Cl={class:"aspect-[4/3] flex flex-col w-full overflow-hidden rounded-[10px]"},jl={class:"flex-1 min-h-0 relative"},Sl=["src","alt","onError"],Ml={key:2,class:"absolute inset-0 bg-gradient-to-t from-black/60 via-black/20 to-transparent pointer-events-none"},Tl={key:0,class:"flex items-center justify-center py-12"},nt=G({__name:"NewsGrid",props:{articles:{},title:{default:"News & Articles"},query:{default:""},variant:{default:"news"}},setup(o){const c=o,{isDark:l}=Z(),{openArticleDetail:m,openWebsiteDetail:g}=$e(),b=S(""),p=S(new Set);function w(h){return!h||typeof h!="string"?!1:/^https?:\/\//i.test(h.trim())}function $(h){p.value=new Set([...p.value,h])}function _(h){try{return new URL(h).hostname.replace(/^www\./,"")}catch{return h}}function f(h){return c.variant==="websites"?qt(h.title,_(h.url)):Gt(h.title,_(h.url))}function d(h){c.variant==="websites"?g(h):m(h)}function a(h,M){if(!M.trim())return 0;const L=M.toLowerCase().split(/\s+/).filter(y=>y.length>1);if(L.length===0)return 0;const I=h.title.toLowerCase(),C=(h.content??"").toLowerCase(),k=h.url.toLowerCase();let x=0;for(const y of L)I.includes(y)&&(x+=3),C.includes(y)&&(x+=2),k.includes(y)&&(x+=1);return x}const r=B(()=>{let h=c.articles;if(b.value.trim()){const M=b.value.toLowerCase();h=h.filter(j=>j.title.toLowerCase().includes(M)||(j.content??"").toLowerCase().includes(M)||j.url.toLowerCase().includes(M))}return c.query.trim()?[...h].sort((M,j)=>a(j,c.query)-a(M,c.query)):h});return(h,M)=>(s(),n("div",vl,[e("div",{class:"p-4 space-y-3",style:W(t(l)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("div",fl,[e("h3",{class:i(["text-sm font-bold",t(l)?"text-white/90":"text-gray-900"])},u(o.title),3),e("div",ml,[e("span",{class:i(["text-xs font-mono",t(l)?"text-white/30":"text-gray-400"])},u(r.value.length)+" "+u(o.variant==="websites"?"websites":"articles"),3),re(h.$slots,"header-actions")])]),Q(e("input",{"onUpdate:modelValue":M[0]||(M[0]=j=>b.value=j),type:"text",placeholder:o.variant==="websites"?"Search websites...":"Search articles...",class:i(["w-full px-3 py-2 rounded-lg text-base outline-none transition-colors",t(l)?"bg-white/5 text-white/80 placeholder:text-white/25 focus:bg-white/10":"bg-black/3 text-gray-800 placeholder:text-gray-400 focus:bg-black/5"])},null,10,wl),[[J,b.value]])],4),e("div",yl,[e("div",kl,[(s(!0),n(D,null,N(r.value,(j,L)=>(s(),n("button",{key:L,class:"group flex flex-col items-stretch text-left w-full path-glass-bubble rounded-2xl overflow-hidden transition-all duration-200 hover:brightness-105","aria-label":j.title,onClick:I=>d(j)},[e("div",_l,[e("div",Cl,[e("div",jl,[w(j.imgSrc)&&!p.value.has(j.url)?(s(),n("img",{key:0,src:j.imgSrc,alt:j.title,class:"absolute inset-0 w-full h-full object-cover transition-transform duration-300 group-hover:scale-110",loading:"lazy",onError:I=>$(j.url)},null,40,Sl)):(s(),n("div",{key:1,class:"absolute inset-0 bg-cover bg-center",style:W({backgroundImage:`url(${f(j)})`})},null,4)),w(j.imgSrc)&&!p.value.has(j.url)?(s(),n("div",Ml)):v("",!0)]),e("div",{class:i(["shrink-0 p-2 backdrop-blur-md rounded-b-[10px]",[t(l)?"bg-black shadow-[inset_0_1px_0_rgba(255,255,255,0.12)]":"bg-white shadow-[inset_0_1px_0_rgba(0,0,0,0.06)]"]])},[e("p",{class:i(["text-xs font-semibold leading-tight line-clamp-2",t(l)?"text-white/95":"text-gray-900"])},u(j.title),3),j.content?(s(),n("p",{key:0,class:i(["text-xs line-clamp-1 mt-0.5",t(l)?"text-white/70":"text-gray-600"])},u(j.content),3)):v("",!0),e("p",{class:i(["text-xs truncate mt-0.5",t(l)?"text-white/50":"text-gray-500"])},u(_(j.url)),3)],2)])])],8,$l))),128))]),r.value.length===0?(s(),n("div",Tl,[e("p",{class:i(["text-sm",t(l)?"text-white/30":"text-gray-400"])},u(o.variant==="websites"?"No websites match your search":"No articles match your search"),3)])):v("",!0)])]))}}),Il={key:0,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},Dl={key:1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"},Bl={class:"truncate"},Ll={key:1,class:"w-3 h-3 shrink-0 text-accent ml-auto",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Pl={key:0},Nl=G({__name:"FileTreeNode",props:{entry:{},activeFile:{},depth:{}},emits:["select"],setup(o,{emit:c}){const l=o,{isFileSelected:m}=xe(),g=c,{isDark:b}=Z(),p=S(l.depth<1),w=B(()=>!l.entry.isDirectory&&l.activeFile===l.entry.path),$=B(()=>!l.entry.isDirectory&&m(l.entry.path));function _(){l.entry.isDirectory?p.value=!p.value:g("select",l.entry.path)}return(f,d)=>{const a=Ot("FileTreeNode",!0);return s(),n("div",null,[e("button",{class:i(["w-full text-left flex items-center gap-1.5 py-1 px-2 rounded-lg text-xs transition-colors",[$.value?"bg-accent/15 text-accent ring-1 ring-accent/30":w.value?t(b)?"bg-white/10 text-white/90":"bg-black/8 text-gray-900":t(b)?"text-white/60 hover:bg-white/[0.04] hover:text-white/80":"text-gray-600 hover:bg-black/[0.03] hover:text-gray-800"]]),style:W({paddingLeft:`${o.depth*12+8}px`}),onClick:_},[o.entry.isDirectory?(s(),n("svg",{key:0,class:i(["w-3 h-3 shrink-0 transition-transform duration-150",p.value?"rotate-90":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...d[1]||(d[1]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2)):v("",!0),(s(),n("svg",{class:i(["w-3.5 h-3.5 shrink-0",o.entry.isDirectory?"text-accent/70":t(b)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[o.entry.isDirectory?(s(),n("path",Il)):(s(),n("path",Dl))],2)),e("span",Bl,u(o.entry.name),1),$.value?(s(),n("svg",Ll,[...d[2]||(d[2]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"3",d:"M5 13l4 4L19 7"},null,-1)])])):v("",!0)],6),o.entry.isDirectory&&p.value&&o.entry.children?(s(),n("div",Pl,[(s(!0),n(D,null,N(o.entry.children,r=>(s(),q(a,{key:r.path,entry:r,"active-file":o.activeFile,depth:o.depth+1,onSelect:d[0]||(d[0]=h=>f.$emit("select",h))},null,8,["entry","active-file","depth"]))),128))])):v("",!0)])}}}),zl={class:"flex flex-col h-full"},El={class:"flex items-center gap-1 min-w-0 flex-1"},Al={class:"flex items-center gap-2 shrink-0"},Fl={key:0,class:"flex-1 overflow-y-auto custom-scrollbar p-3"},Rl={class:"mb-3 flex gap-2"},Vl={class:"flex justify-end gap-2"},Ul=["disabled"],ql={class:"grid grid-cols-2 gap-2"},Gl=["onClick"],Ol={key:1,class:"flex-1 overflow-y-auto custom-scrollbar p-2"},Hl={key:0,class:"flex items-center justify-center py-12"},Wl=G({__name:"ProjectGrid",props:{isWideDesktop:{type:Boolean},isMobile:{type:Boolean}},setup(o){const{isDark:c}=Z(),{projectList:l,activeProject:m,fileTree:g,activeFile:b,codeMode:p,selectedFiles:w,selectProject:$,openFile:_,createProject:f,clearActiveFile:d,toggleFileSelection:a,isFileSelected:r,loadProjects:h}=xe();ne(()=>{l.value.length===0&&h()});const M=S(""),j=S(!1),L=S(""),I=S(null),C=B(()=>m.value?"filetree":"projects"),k=B(()=>C.value==="projects"?"Projects":m.value?.name??"Projects"),x=B(()=>{const U=M.value.toLowerCase();return U?l.value.filter(R=>R.name.toLowerCase().includes(U)||(R.language??"").toLowerCase().includes(U)):l.value});function y(U){$(U)}function z(){const{activeProject:U,fileTree:R}=xe();U.value=null,R.value=[],d()}function V(U){a(U),_(U)}function A(){j.value=!0,L.value="",ye(()=>I.value?.focus())}function K(){j.value=!1,L.value=""}function O(){const U=L.value.trim();U&&(f(U),j.value=!1,L.value="")}return(U,R)=>(s(),n("div",zl,[e("div",{class:"shrink-0 px-4 py-3 flex items-center justify-between gap-2",style:W(t(c)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("div",El,[C.value!=="projects"?(s(),n("button",{key:0,class:i(["text-xs shrink-0 transition-colors",t(c)?"text-white/40 hover:text-white/70 hover:underline":"text-gray-400 hover:text-gray-700 hover:underline"]),onClick:z}," Projects ",2)):v("",!0),C.value!=="projects"?(s(),n("span",{key:1,class:i(["text-xs shrink-0",t(c)?"text-white/20":"text-gray-300"])},"/",2)):v("",!0),e("span",{class:i(["text-sm font-semibold truncate",t(c)?"text-white/90":"text-gray-900"])},u(k.value),3)]),e("div",Al,[C.value==="projects"?(s(),n("p",{key:0,class:i(["text-xs",t(c)?"text-white/30":"text-gray-400"])},u(t(l).length)+" repos ",3)):C.value==="filetree"?(s(),n("p",{key:1,class:i(["text-xs",t(c)?"text-white/30":"text-gray-400"])},u(t(m)?.language),3)):v("",!0),re(U.$slots,"header-actions")])],4),C.value==="projects"?(s(),n("div",Fl,[e("div",Rl,[Q(e("input",{"onUpdate:modelValue":R[0]||(R[0]=H=>M.value=H),type:"text",placeholder:"Search projects...",class:i(["flex-1 min-w-0 px-3 py-2 rounded-lg text-base bg-transparent outline-none",t(c)?"text-white/80 placeholder:text-white/20 border border-white/10 focus:border-white/25":"text-gray-800 placeholder:text-gray-400 border border-black/10 focus:border-black/20"])},null,2),[[J,M.value]]),e("button",{class:i(["shrink-0 px-3 py-2 rounded-lg text-xs font-medium transition-colors flex items-center gap-1.5",t(c)?"bg-accent/20 text-accent hover:bg-accent/30":"bg-accent/10 text-accent hover:bg-accent/20"]),onClick:A},[...R[2]||(R[2]=[e("svg",{class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1),se(" New ",-1)])],2)]),j.value?(s(),n("div",{key:0,class:i(["mb-3 p-3 rounded-xl",t(c)?"bg-white/[0.05] border border-white/10":"bg-black/[0.03] border border-black/8"])},[e("p",{class:i(["text-xs font-medium mb-2",t(c)?"text-white/70":"text-gray-700"])}," New Project ",2),Q(e("input",{ref_key:"newProjectInputRef",ref:I,"onUpdate:modelValue":R[1]||(R[1]=H=>L.value=H),type:"text",placeholder:"Project name...",class:i(["w-full px-3 py-2 rounded-lg text-base bg-transparent outline-none mb-2",t(c)?"text-white/80 placeholder:text-white/20 border border-white/10 focus:border-white/25":"text-gray-800 placeholder:text-gray-400 border border-black/10 focus:border-black/20"]),onKeydown:[ae(O,["enter"]),ae(K,["escape"])]},null,34),[[J,L.value]]),e("div",Vl,[e("button",{class:i(["text-xs px-2.5 py-1 rounded-lg transition-colors",t(c)?"text-white/40 hover:text-white/70":"text-gray-500 hover:text-gray-800"]),onClick:K}," Cancel ",2),e("button",{class:i(["text-xs px-2.5 py-1 rounded-lg font-medium transition-colors",t(c)?"bg-accent/20 text-accent hover:bg-accent/30":"bg-accent/10 text-accent hover:bg-accent/20"]),disabled:!L.value.trim(),onClick:O}," Create ",10,Ul)])],2)):v("",!0),e("div",ql,[(s(!0),n(D,null,N(x.value,H=>(s(),n("button",{key:H.path,class:i(["text-left p-3 rounded-xl transition-all duration-150",t(c)?"bg-white/[0.03] hover:bg-white/[0.07] border border-white/5":"bg-black/[0.02] hover:bg-black/[0.05] border border-black/5"]),onClick:le=>y(H)},[e("div",{class:i(["w-8 h-8 rounded-lg flex items-center justify-center mb-2",t(c)?"bg-white/5":"bg-black/5"])},[(s(),n("svg",{class:i(["w-4 h-4",H.isGit?"text-accent":t(c)?"text-white/40":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...R[3]||(R[3]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)])],2))],2),e("p",{class:i(["text-xs font-medium truncate",t(c)?"text-white/80":"text-gray-800"])},u(H.name),3),e("p",{class:i(["text-xs mt-0.5 truncate",t(c)?"text-white/25":"text-gray-400"])},u(H.language),3)],10,Gl))),128))])])):C.value==="filetree"?(s(),n("div",Ol,[(s(!0),n(D,null,N(t(g),H=>(s(),q(Nl,{key:H.path,entry:H,"active-file":t(b),depth:0,onSelect:V},null,8,["entry","active-file"]))),128)),t(g).length===0?(s(),n("div",Hl,[e("p",{class:i(["text-xs",t(c)?"text-white/30":"text-gray-400"])}," Loading file tree... ",2)])):v("",!0)])):v("",!0)]))}}),Kl={class:"flex flex-col h-full"},Yl={class:"shrink-0 px-4 py-2 flex gap-1.5 overflow-x-auto scrollbar-hide"},Ql=["onClick"],Jl={class:"flex-1 overflow-y-auto px-4 py-3"},Zl={class:"grid grid-cols-2 gap-2"},Xl=["onClick"],eo=["onClick"],to={key:0,class:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},so={key:2,class:"h-8 flex items-end gap-0.5 mb-2"},no={key:3,class:"h-8 flex items-center mb-2"},lo={key:0,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"},oo={key:1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"},ao={key:2,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"},io={key:3,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828l-8.486 8.485M7 17h.01"},ro=G({__name:"DesignSystemGrid",setup(o){const{isDark:c}=Z(),{openDesignSystemItem:l}=$e(),{codeMode:m,toggleDesignToken:g,isDesignTokenSelected:b}=xe(),p=S("all"),w=[{id:"all",label:"All"},{id:"colors",label:"Colors"},{id:"typography",label:"Typography"},{id:"spacing",label:"Spacing"},{id:"atoms",label:"Atoms"},{id:"molecules",label:"Molecules"},{id:"organisms",label:"Organisms"}],$=[{id:"color-bg",name:"Background",category:"colors",preview:"inline",description:"Primary app background",code:`background-color: #0a0a0a; -/* Tailwind: bg-[#0a0a0a] */`,usedIn:"ChatPage, all panels, base layout"},{id:"color-accent",name:"Accent / Bitcoin",category:"colors",preview:"inline",description:"Primary action color, Bitcoin orange",code:`color: #F7931A; -/* Tailwind: text-accent */`,usedIn:"Gradient buttons, active tabs, zap counts, CTA elements"},{id:"color-primary",name:"Primary",category:"colors",preview:"inline",description:"Primary neutral tone",code:`color: #606060; -/* Tailwind: text-primary */`,usedIn:"Secondary text, borders, muted elements"},{id:"color-surface",name:"Glass Surface",category:"colors",preview:"inline",description:"Glass morphism panel background",code:`background: rgba(0, 0, 0, 0.35); -backdrop-filter: blur(18px); -border: 1px solid rgba(255, 255, 255, 0.18); -/* Tailwind: .glass */`,usedIn:"ChatInput, ContentPanel, all overlay panels"},{id:"color-text-scale",name:"Text Opacity Scale",category:"colors",preview:"inline",description:"/25 placeholder, /40 muted, /60 secondary, /80 body, /90 emphasis",code:`/* Text opacity scale */ -.placeholder { color: rgba(255,255,255, 0.25); } -.muted { color: rgba(255,255,255, 0.40); } -.secondary { color: rgba(255,255,255, 0.60); } -.body { color: rgba(255,255,255, 0.80); } -.emphasis { color: rgba(255,255,255, 0.90); } -.heading { color: rgba(255,255,255, 0.96); }`,usedIn:"Every component — consistent hierarchy across the system"},{id:"type-body",name:"Body Font",category:"typography",description:"Inter / system-ui for all body text",code:`font-family: Inter, system-ui, -apple-system, sans-serif; -/* Applied globally */`,usedIn:"Global default — ChatMessage, grids, detail views"},{id:"type-mono",name:"Monospace Font",category:"typography",description:"Menlo / Monaco for code and IDs",code:`font-family: Menlo, Monaco, "Courier New", monospace; -/* Tailwind: font-mono */`,usedIn:"CodeDetail, conversation IDs, relay URLs, metadata"},{id:"type-serif",name:"Serif Font",category:"typography",description:"Georgia for magazine/editorial layouts",code:`font-family: Georgia, "Times New Roman", Times, serif; -/* Used in MagazineGrid, AI Brief */`,usedIn:"MagazineGrid, MagazineSectionDetail, AI Brief"},{id:"type-sizes",name:"Text Sizes",category:"typography",description:"Compact scale: 10px labels to 2xl headings",code:`/* Key sizes used */ -text-xs /* labels, metadata */ -text-xs /* 12px - secondary text */ -text-sm /* 14px - body text */ -text-base /* 16px - primary text */ -text-lg /* 18px - section headings */ -text-xl /* 20px - page headings */ -text-2xl /* 24px - hero text */`,usedIn:"Globally — see specific usage in each size bracket"},{id:"space-grid",name:"4px Grid",category:"spacing",preview:"inline",description:"All spacing follows a 4px base grid",code:`/* 4px grid system */ -1 = 4px /* micro gap */ -2 = 8px /* tight gap */ -3 = 12px /* small padding */ -4 = 16px /* standard padding */ -5 = 20px /* section padding */ -6 = 24px /* large gap */ -8 = 32px /* section spacing */ -12 = 48px /* large sections */`,usedIn:"Every layout — padding, margins, gaps between elements"},{id:"space-radius",name:"Border Radius",category:"spacing",preview:"inline",description:"Rounded corners from subtle to full",code:`/* Border radius scale */ -rounded-md /* 6px - badges, tags */ -rounded-lg /* 8px - buttons, inputs */ -rounded-xl /* 12px - cards, panels */ -rounded-2xl /* 16px - large panels */ -rounded-full /* pill buttons */`,usedIn:"Badges (md), buttons (lg), cards (xl), panels (2xl)"},{id:"atom-glass-btn",name:"Glass Button",category:"atoms",description:"48px height, glass morphism background",code:` - -/* glass-button: - height: 48px - background: rgba(0,0,0,0.6) - backdrop-filter: blur(18px) - border-radius: 12px - border: 1px solid rgba(255,255,255,0.12) -*/`,usedIn:"ChatInput send, modal actions, primary controls"},{id:"atom-glass-btn-sm",name:"Glass Button Small",category:"atoms",description:"Compact glass button variant",code:` - -/* Compact variant of glass-button */`,usedIn:"ChatInput send/stop buttons, inline actions"},{id:"atom-icon-btn",name:"Icon Button",category:"atoms",description:"Path glass icon, 32-36px square",code:` - -/* path-glass-icon: - background: transparent - transition: colors - hover: bg-white/10 -*/`,usedIn:"ChatHeader toolbar, detail back buttons, close buttons"},{id:"atom-badge",name:"Genre Badge",category:"atoms",description:"Tiny pill badge for tags/genres",code:` - Science Fiction -`,usedIn:"FilmGrid, SongGrid, BookGrid, TVSeriesGrid genre filters"},{id:"atom-nav-tab",name:"Nav Tab",category:"atoms",description:"Content panel tab with active state",code:` - -/* Active: accent underline - Inactive: text-white/50 hover:text-white - Transition: 200ms */`,usedIn:"ContentPanel tab bar, mobile content tab filters"},{id:"atom-input",name:"Text Input",category:"atoms",description:"Search/filter input field",code:``,usedIn:"All grid search bars, ProjectGrid new project"},{id:"atom-scrollbar",name:"Custom Scrollbar",category:"atoms",description:"Thin translucent scrollbar for scroll areas",code:`.custom-scrollbar::-webkit-scrollbar { - width: 4px; -} -.custom-scrollbar::-webkit-scrollbar-thumb { - background: rgba(255,255,255, 0.1); - border-radius: 2px; -} -/* Also: .scrollbar-hide hides completely */`,usedIn:"Content grids, chat message list, file trees"},{id:"mol-glass-card",name:"Glass Card",category:"molecules",description:"Frosted glass card with border",code:`
-

Title

-

Content

-
- -/* glass-card: - background: rgba(0,0,0,0.65) - backdrop-filter: blur(18px) - border: 1px solid rgba(255,255,255,0.12) - border-radius: 16px - padding: 16px -*/`,usedIn:"ChatWindow container, content panel wrapper"},{id:"mol-gradient-card",name:"Gradient Card",category:"molecules",description:"Card with gradient background",code:`
-

Featured

-

Content

-
- -/* gradient-card: - background: linear-gradient(135deg, ...) - border-radius: 16px -*/`,usedIn:"Featured content highlights, promotional sections"},{id:"mol-source-link",name:"Source Link Row",category:"molecules",description:"Icon + label + external link arrow",code:` -
- icon -
-

Name

-

Description

-
-
- -
`,usedIn:"FilmDetail, SongDetail, PodcastDetail sources"},{id:"mol-banner-hero",name:"Banner Hero",category:"molecules",description:"Aspect 16/7 image with gradient overlay",code:`
- -
-
-

Title

-
-
`,usedIn:"FilmDetail, TVSeriesDetail, BookDetail banners"},{id:"mol-cover-card",name:"Cover Card",category:"molecules",description:"Poster/cover image card with overlay text",code:``,usedIn:"FilmGrid, TVSeriesGrid, SongGrid, BookGrid cards"},{id:"org-chat-bubble",name:"Chat Bubble",category:"organisms",description:"AI/User message bubble with streaming",code:` -
-
- Message text -
-
- - -
-
- Response with markdown -
-
`,usedIn:"ChatMessage.vue — the primary chat interface"},{id:"org-content-panel",name:"Content Panel",category:"organisms",description:"Tabs + grid + detail navigation",code:` -
- -
- -
- - - - -
`,usedIn:"ChatPage middle column, mobile Content tab"},{id:"org-detail-view",name:"Detail View",category:"organisms",description:"Full detail with banner, back button, metadata",code:` -
- -
- -
- -
-

Title

-
Metadata
-
-
- -
-

Description

-
Genre badges
-
Source links
-
-
`,usedIn:"FilmDetail, BookDetail, TVSeriesDetail, SongDetail, PodcastDetail"},{id:"org-magazine",name:"Magazine Grid",category:"organisms",description:"Editorial tile layout with hero, wide, and half tiles",code:` -
- - - - -
`,usedIn:"MagazineGrid.vue — AI Brief editorial view"},{id:"org-nostr-note",name:"Nostr Note",category:"organisms",description:"Note card with avatar, author, content, zaps",code:`
-
-
- F -
-
- - author -

- Note content...

- 21000 sats -
-
-
`,usedIn:"NostrGrid.vue — Nostr feed tab"},{id:"anim-fade-up",name:"Fade Up",category:"atoms",description:"Entry animation: translate + opacity",code:`.animate-fade-up { - animation: fadeUp 900ms ease-out; -} -@keyframes fadeUp { - from { - opacity: 0; - transform: translateY(16px); - } - to { - opacity: 1; - transform: translateY(0); - } -} -/* Also: animate-fade-up-fast (400ms) */`,usedIn:"Empty states, initial load elements, ChatWindow"},{id:"anim-scale-in",name:"Scale In",category:"atoms",description:"Micro entrance with scale and opacity",code:`.animate-scale-in { - animation: scaleIn 250ms ease-out; -} -@keyframes scaleIn { - from { - opacity: 0; - transform: scale(0.95); - } - to { - opacity: 1; - transform: scale(1); - } -}`,usedIn:"Modal entries, tooltip appearances, popovers"}],_=B(()=>p.value==="all"?$:$.filter(a=>a.category===p.value));function f(a){l(a)}function d(a){const r=/(?:background-color|color|background):\s*([^;]+)/i.exec(a);if(!r)return"#333";const h=r[1].trim();return h.startsWith("#")||h.startsWith("rgb")||h.startsWith("hsl")?h:"#333"}return(a,r)=>(s(),n("div",Kl,[e("div",{class:"shrink-0 px-4 py-3 flex items-center justify-between gap-2",style:W(t(c)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("span",{class:i(["text-sm font-semibold",t(c)?"text-white/90":"text-gray-900"])}," Design System ",2),e("p",{class:i(["text-xs",t(c)?"text-white/30":"text-gray-400"])},u(_.value.length)+" items ",3)],4),e("div",Yl,[(s(),n(D,null,N(w,h=>e("button",{key:h.id,class:i(["text-xs px-2.5 py-1 rounded-md font-medium whitespace-nowrap transition-colors",p.value===h.id?"bg-accent/20 text-accent":t(c)?"bg-white/5 text-white/50 hover:bg-white/10":"bg-black/5 text-gray-500 hover:bg-black/10"]),onClick:M=>p.value=h.id},u(h.label),11,Ql)),64))]),e("div",Jl,[e("div",Zl,[(s(!0),n(D,null,N(_.value,h=>(s(),n("button",{key:h.id,class:i(["text-left p-3 rounded-xl transition-all duration-150 group relative",[t(m)&&t(b)(h.id)?"ring-2 ring-accent/50 bg-accent/10 cursor-pointer":t(c)?"bg-white/[0.03] hover:bg-white/[0.07] cursor-pointer":"bg-black/[0.02] hover:bg-black/[0.05] cursor-pointer"]]),onClick:M=>f(h)},[t(m)?(s(),n("div",{key:0,class:i(["absolute top-2 right-2 min-w-[44px] min-h-[44px] rounded-full flex items-center justify-center z-10 cursor-pointer transition-colors",t(b)(h.id)?"bg-accent":t(c)?"bg-white/10 hover:bg-white/20":"bg-black/10 hover:bg-black/20"]),onClick:we(M=>t(g)(h.id),["stop"])},[t(b)(h.id)?(s(),n("svg",to,[...r[0]||(r[0]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"3",d:"M5 13l4 4L19 7"},null,-1)])])):v("",!0)],10,eo)):v("",!0),h.category==="colors"&&h.preview==="inline"?(s(),n("div",{key:1,class:i(["h-8 rounded-md mb-2 border",t(c)?"border-white/10":"border-black/10"]),style:W({background:d(h.code)})},null,6)):h.category==="spacing"&&h.preview==="inline"?(s(),n("div",so,[...r[1]||(r[1]=[e("div",{class:"bg-accent/40 rounded-sm",style:{width:"4px",height:"30%"}},null,-1),e("div",{class:"bg-accent/40 rounded-sm",style:{width:"4px",height:"50%"}},null,-1),e("div",{class:"bg-accent/40 rounded-sm",style:{width:"4px",height:"70%"}},null,-1),e("div",{class:"bg-accent/40 rounded-sm",style:{width:"4px",height:"100%"}},null,-1)])])):(s(),n("div",no,[(s(),n("svg",{class:i(["w-5 h-5 transition-colors",t(c)?"text-white/20 group-hover:text-white/40":"text-black/15 group-hover:text-black/30"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[h.category==="atoms"?(s(),n("path",lo)):h.category==="molecules"?(s(),n("path",oo)):h.category==="organisms"?(s(),n("path",ao)):(s(),n("path",io))],2))])),e("h3",{class:i(["text-xs font-semibold leading-tight mb-0.5",t(c)?"text-white/80":"text-gray-800"])},u(h.name),3),e("p",{class:i(["text-xs leading-snug line-clamp-2",t(c)?"text-white/40":"text-gray-400"])},u(h.description),3)],10,Xl))),128))])])]))}}),me=S(null),lt=S(!1),Re=S(!1),he=S(null);function ve(){const o=B(()=>{if(!me.value)return null;try{return He(me.value)}catch{return null}}),c=B(()=>!!me.value),l=B(()=>o.value?o.value.slice(0,12)+"..."+o.value.slice(-8):null);function m(){lt.value=typeof window<"u"&&!!window.nostr}async function g(){if(he.value=null,!window.nostr){he.value="No Nostr extension detected. Install nos2x, Alby, or another NIP-07 extension.";return}Re.value=!0;try{const w=await window.nostr.getPublicKey();me.value=w}catch(w){he.value=w instanceof Error?w.message:"Failed to get public key"}finally{Re.value=!1}}async function b(w){if(he.value=null,!window.nostr)return he.value="No Nostr extension detected",null;try{return await window.nostr.signEvent(w)}catch($){return he.value=$ instanceof Error?$.message:"Failed to sign event",null}}function p(){me.value=null,he.value=null}return ne(()=>{m(),setTimeout(m,500)}),{pubkey:me,npub:o,isAvailable:lt,isLoggedIn:c,isLoading:Re,error:he,truncatedNpub:l,login:g,logout:p,signEvent:b,checkAvailability:m}}const co="aiui-nostr-dms",uo=1,ke="messages",je=S([]),Se=S(null),Ve=S(!1);let Me=null;function vt(){return Me||(Me=new Promise((o,c)=>{const l=indexedDB.open(co,uo);l.onupgradeneeded=()=>{const m=l.result;if(!m.objectStoreNames.contains(ke)){const g=m.createObjectStore(ke,{keyPath:"id"});g.createIndex("contact","contactPubkey",{unique:!1}),g.createIndex("created_at","created_at",{unique:!1})}},l.onsuccess=()=>o(l.result),l.onerror=()=>{Me=null,c(l.error)}}),Me)}function ho(o){return o.length<=12?o:o.slice(0,8)+"..."+o.slice(-4)}async function ot(o,c){const l=await vt(),m=o.fromPubkey===c?o.toPubkey:o.fromPubkey,g={...o,contactPubkey:m};return new Promise((b,p)=>{const w=l.transaction(ke,"readwrite");w.objectStore(ke).put(g),w.oncomplete=()=>b(),w.onerror=()=>p(w.error)})}async function Ue(){const o=await vt();return new Promise((c,l)=>{const g=o.transaction(ke,"readonly").objectStore(ke).getAll();g.onsuccess=()=>c(g.result),g.onerror=()=>l(g.error)})}function qe(o){const c=new Map;for(const m of o){const g=c.get(m.contactPubkey)??[];g.push(m),c.set(m.contactPubkey,g)}const l=[];for(const[m,g]of c)g.sort((b,p)=>b.created_at-p.created_at),l.push({contactPubkey:m,contactName:ho(m),messages:g,lastMessage:g[g.length-1]??null,unread:0});return l.sort((m,g)=>(g.lastMessage?.created_at??0)-(m.lastMessage?.created_at??0)),l}function xo(){const{pubkey:o,isLoggedIn:c}=ve(),l=B(()=>Se.value?je.value.find($=>$.contactPubkey===Se.value)??null:null);async function m(){if(c.value){Ve.value=!0;try{const $=await Ue();je.value=qe($)}catch{}finally{Ve.value=!1}}}async function g($,_){if(!window.nostr?.nip04||!o.value)return!1;try{const f=await window.nostr.nip04.encrypt($,_),d={kind:4,created_at:Math.floor(Date.now()/1e3),tags:[["p",$]],content:f},a=await window.nostr.signEvent(d);if(!a)return!1;const r={id:a.id,fromPubkey:o.value,toPubkey:$,content:_,created_at:a.created_at,decrypted:!0};await ot(r,o.value);const{publishEvent:h}=await pt(()=>import("./useNostr-CZatyrb1.js"),__vite__mapDeps([0,1,2])).then(j=>j.useNostr());await h(a);const M=await Ue();return je.value=qe(M),!0}catch{return!1}}async function b($,_,f,d){if(!(!window.nostr?.nip04||!o.value))try{const a=await window.nostr.nip04.decrypt(_,f),r={id:$,fromPubkey:_,toPubkey:o.value,content:a,created_at:d,decrypted:!0};await ot(r,o.value);const h=await Ue();je.value=qe(h)}catch{}}function p($){Se.value=$}function w(){Se.value=null}return{threads:je,activeThread:l,activeContact:Se,isLoading:Ve,loadDMs:m,sendDM:g,receiveDM:b,selectContact:p,clearActiveContact:w}}const po={class:"h-full flex flex-col"},go={class:"flex items-center gap-2 px-4 py-3 border-b border-white/[0.08]"},bo={class:"flex-1 min-w-0"},vo={class:"text-xs font-semibold text-white/80 truncate"},fo={class:"text-xs text-white/30 font-mono truncate"},mo={class:"text-xs leading-relaxed break-words"},wo={class:"text-xs mt-1 text-white/25 tabular-nums"},yo={class:"px-4 py-3 border-t border-white/[0.08]"},ko={class:"flex gap-2"},$o=["disabled"],_o={class:"p-4 border-b border-white/[0.08]"},Co={class:"flex items-center justify-between gap-2 mb-3"},jo={key:0,class:"space-y-2 mb-3"},So=["disabled"],Mo={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-3 pb-16 space-y-1"},To={key:0,class:"flex items-center justify-center py-12"},Io={key:1,class:"flex items-center justify-center py-12"},Do={key:2,class:"flex items-center justify-center py-12"},Bo=["onClick"],Lo={class:"flex items-start gap-2.5"},Po={class:"w-8 h-8 rounded-full shrink-0 flex items-center justify-center text-xs font-bold bg-accent/20 text-accent"},No={class:"flex-1 min-w-0"},zo={class:"flex items-center gap-1.5"},Eo={class:"text-xs font-semibold truncate text-white/80"},Ao={key:0,class:"text-xs ml-auto shrink-0 text-white/20"},Fo={key:0,class:"text-xs mt-1 text-white/40 truncate"},Ro=G({__name:"NostrDMs",setup(o){const{threads:c,activeThread:l,activeContact:m,isLoading:g,loadDMs:b,sendDM:p,selectContact:w,clearActiveContact:$}=xo(),{pubkey:_,isLoggedIn:f}=ve(),d=S(""),a=S(!1),r=S(null),h=S(!1),M=S("");function j(k){const x=new Date(k*1e3),z=Math.floor((new Date().getTime()-x.getTime())/864e5);return z===0?x.toLocaleTimeString("en",{hour:"2-digit",minute:"2-digit"}):z<7?x.toLocaleDateString("en",{weekday:"short"}):x.toLocaleDateString("en",{month:"short",day:"numeric"})}async function L(){if(!d.value.trim()||a.value||!m.value)return;a.value=!0,await p(m.value,d.value.trim())&&(d.value="",await ye(),I()),a.value=!1}function I(){r.value&&(r.value.scrollTop=r.value.scrollHeight)}function C(){let k=M.value.trim();if(k.startsWith("npub"))try{k=gt(k)}catch{return}k.length===64&&(w(k),h.value=!1,M.value="")}return ie(m,async()=>{await ye(),I()}),ne(()=>{b()}),(k,x)=>(s(),n("div",po,[t(l)?(s(),n(D,{key:0},[e("div",go,[e("button",{class:"min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg text-white/60 hover:text-white/80 hover:bg-white/10 transition-colors",onClick:x[0]||(x[0]=(...y)=>t($)&&t($)(...y))},[...x[4]||(x[4]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),e("div",bo,[e("p",vo,u(t(l).contactName),1),e("p",fo,u(t(l).contactPubkey),1)])]),e("div",{ref_key:"messagesRef",ref:r,class:"flex-1 overflow-y-auto custom-scrollbar px-4 py-3 space-y-2"},[(s(!0),n(D,null,N(t(l).messages,y=>(s(),n("div",{key:y.id,class:i(["flex",y.fromPubkey===t(_)?"justify-end":"justify-start"])},[e("div",{class:i(["max-w-[80%] rounded-xl px-3 py-2",y.fromPubkey===t(_)?"bg-accent/15 text-white/80":"bg-white/5 text-white/70"])},[e("p",mo,u(y.content),1),e("p",wo,u(j(y.created_at)),1)],2)],2))),128))],512),e("div",yo,[e("div",ko,[Q(e("input",{"onUpdate:modelValue":x[1]||(x[1]=y=>d.value=y),type:"text",placeholder:"Type a message...",class:"flex-1 px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors",onKeydown:ae(L,["enter"])},null,544),[[J,d.value]]),e("button",{class:"px-3 py-2 rounded-lg text-xs bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors disabled:opacity-30",disabled:!d.value.trim()||a.value,onClick:L}," Send ",8,$o)])])],64)):(s(),n(D,{key:1},[e("div",_o,[e("div",Co,[x[5]||(x[5]=e("h3",{class:"text-sm font-bold text-white/90"},"Messages",-1)),e("button",{class:"text-xs px-2.5 py-1 rounded bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors",onClick:x[2]||(x[2]=y=>h.value=!h.value)},u(h.value?"Cancel":"New"),1)]),h.value?(s(),n("div",jo,[Q(e("input",{"onUpdate:modelValue":x[3]||(x[3]=y=>M.value=y),type:"text",placeholder:"Recipient hex pubkey or npub...",class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors font-mono"},null,512),[[J,M.value]]),e("button",{class:"text-xs px-2.5 py-1 rounded bg-white/5 text-white/60 hover:bg-white/10 transition-colors disabled:opacity-30",disabled:!M.value.trim(),onClick:C}," Start conversation ",8,So)])):v("",!0)]),e("div",Mo,[t(f)?t(g)?(s(),n("div",Io,[...x[7]||(x[7]=[e("p",{class:"text-xs text-white/30"},"Loading messages...",-1)])])):t(c).length===0?(s(),n("div",Do,[...x[8]||(x[8]=[e("p",{class:"text-xs text-white/30"},"No messages yet",-1)])])):v("",!0):(s(),n("div",To,[...x[6]||(x[6]=[e("p",{class:"text-xs text-white/30"},"Sign in with Nostr to use DMs",-1)])])),(s(!0),n(D,null,N(t(c),y=>(s(),n("button",{key:y.contactPubkey,class:"w-full text-left p-3 rounded-xl transition-all duration-150 bg-white/[0.03] hover:bg-white/[0.07] border border-white/5",onClick:z=>t(w)(y.contactPubkey)},[e("div",Lo,[e("div",Po,u(y.contactName.charAt(0).toUpperCase()),1),e("div",No,[e("div",zo,[e("span",Eo,u(y.contactName),1),y.lastMessage?(s(),n("span",Ao,u(j(y.lastMessage.created_at)),1)):v("",!0)]),y.lastMessage?(s(),n("p",Fo,u(y.lastMessage.content),1)):v("",!0)])])],8,Bo))),128))])],64))]))}}),Vo={class:"h-full flex flex-col"},Uo={class:"p-4 border-b border-white/[0.08]"},qo={class:"flex gap-2"},Go=["disabled"],Oo={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-3 pb-16 space-y-2"},Ho={class:"flex items-center gap-2"},Wo={class:"text-xs font-mono text-white/70 truncate flex-1"},Ko={class:"flex items-center gap-2 flex-wrap"},Yo=["onClick"],Qo=["onClick"],Jo=["disabled","onClick"],Zo=["onClick"],Xo={key:0,class:"mt-4 pt-4 border-t border-white/5"},ea=["disabled"],ta={key:0,class:"text-xs mt-1 text-white/30"},sa=G({__name:"NostrRelayManager",setup(o){const{relayStates:c,addRelay:l,removeRelay:m,toggleRelayRead:g,toggleRelayWrite:b,testRelay:p,importNIP65Relays:w,fetchNote:$}=De(),{isLoggedIn:_,pubkey:f}=ve(),d=S(""),a=S(null),r=Pe({}),h=S(!1),M=S("");function j(){let C=d.value.trim();C&&(!C.startsWith("wss://")&&!C.startsWith("ws://")&&(C="wss://"+C),l(C),d.value="")}async function L(C){a.value=C;const k=await p(C);r[C]=k,a.value=null}async function I(){if(!f.value)return;h.value=!0,M.value="Fetching relay list...";const C=await $(f.value,5e3);C?(w({id:C.id,pubkey:C.pubkey,kind:10002,content:C.content,created_at:C.created_at,tags:C.tags,sig:""}),M.value="Imported relays from NIP-65"):M.value="No NIP-65 relay list found",h.value=!1}return(C,k)=>(s(),n("div",Vo,[e("div",Uo,[k[1]||(k[1]=e("h3",{class:"text-sm font-bold text-white/90 mb-3"},"Relay Management",-1)),e("div",qo,[Q(e("input",{"onUpdate:modelValue":k[0]||(k[0]=x=>d.value=x),type:"text",placeholder:"wss://relay.example.com",class:"flex-1 px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors font-mono",onKeydown:ae(j,["enter"])},null,544),[[J,d.value]]),e("button",{class:"px-4 min-h-[44px] rounded-lg text-sm bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors disabled:opacity-30",disabled:!d.value.trim(),onClick:j}," Add ",8,Go)])]),e("div",Oo,[(s(!0),n(D,null,N(t(c),x=>(s(),n("div",{key:x.url,class:"rounded-xl bg-white/[0.03] border border-white/5 p-3 space-y-2"},[e("div",Ho,[e("span",{class:i(["w-2 h-2 rounded-full shrink-0",x.connected?"bg-emerald-500":"bg-red-400/60"])},null,2),e("span",Wo,u(x.url),1),x.latencyMs!==null?(s(),n("span",{key:0,class:i(["text-xs tabular-nums shrink-0",x.latencyMs<200?"text-emerald-400/60":x.latencyMs<500?"text-yellow-400/60":"text-red-400/60"])},u(x.latencyMs)+"ms ",3)):v("",!0),e("span",{class:i(["text-xs shrink-0",x.connected?"text-emerald-400/60":"text-red-400/60"])},u(x.connected?"Connected":"Disconnected"),3)]),e("div",Ko,[e("button",{class:i(["text-sm px-3 min-h-[44px] rounded-lg transition-colors",x.read?"bg-accent/15 text-accent/80":"bg-white/5 text-white/30 hover:text-white/50"]),onClick:y=>t(g)(x.url)}," Read ",10,Yo),e("button",{class:i(["text-sm px-3 min-h-[44px] rounded-lg transition-colors",x.write?"bg-accent/15 text-accent/80":"bg-white/5 text-white/30 hover:text-white/50"]),onClick:y=>t(b)(x.url)}," Write ",10,Qo),k[2]||(k[2]=e("div",{class:"flex-1"},null,-1)),e("button",{class:"text-sm px-3 min-h-[44px] rounded-lg bg-white/5 text-white/30 hover:text-white/50 transition-colors",disabled:a.value===x.url,onClick:y=>L(x.url)},u(a.value===x.url?"Testing...":"Test"),9,Jo),e("button",{class:"text-sm px-3 min-h-[44px] rounded-lg bg-white/5 text-red-400/50 hover:text-red-400/80 hover:bg-red-400/10 transition-colors",onClick:y=>t(m)(x.url)}," Remove ",8,Zo)]),r[x.url]!==void 0?(s(),n("p",{key:0,class:i(["text-xs",r[x.url]!==null?"text-emerald-400/60":"text-red-400/60"])},u(r[x.url]!==null?`Reachable (${r[x.url]}ms)`:"Unreachable"),3)):v("",!0)]))),128)),t(_)?(s(),n("div",Xo,[e("button",{class:"w-full text-left px-3 min-h-[44px] rounded-lg text-sm bg-white/5 text-white/40 hover:text-white/60 hover:bg-white/10 transition-colors",disabled:h.value,onClick:I},u(h.value?"Importing...":"Import relays from NIP-65 (kind:10002)"),9,ea),M.value?(s(),n("p",ta,u(M.value),1)):v("",!0)])):v("",!0)])]))}}),na={class:"h-full flex flex-col"},la={key:0,class:"flex-1 flex items-center justify-center"},oa={key:1,class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-3 pb-16 space-y-4"},aa={class:"rounded-xl overflow-hidden border border-white/5"},ia={class:"px-4 pb-4 -mt-8"},ra={key:0,class:"text-lg font-bold text-accent"},ca={class:"text-sm font-bold text-white/90 mt-2"},da={key:0,class:"text-xs text-purple-400/60"},ua={key:1,class:"text-xs text-white/50 mt-1 line-clamp-2"},ha={class:"space-y-3"},xa=["disabled"],pa=G({__name:"NostrProfileEditor",setup(o){const{isLoggedIn:c,signEvent:l,pubkey:m}=ve(),{publishEvent:g,fetchNote:b}=De(),p=Pe({name:"",display_name:"",about:"",picture:"",banner:"",website:"",nip05:"",lud16:""}),w=S(!1),$=S(""),_=S(!1);async function f(){if(!m.value)return;const a=await b(m.value,5e3);if(a&&a.kind===0)try{const r=JSON.parse(a.content);Object.assign(p,r)}catch{}}async function d(){if(!c.value)return;w.value=!0,$.value="";const a={};for(const[L,I]of Object.entries(p))I&&(a[L]=I);const r={kind:0,created_at:Math.floor(Date.now()/1e3),tags:[],content:JSON.stringify(a)},h=await l(r);if(!h){w.value=!1,$.value="Signing failed",_.value=!1;return}const M=await g(h),j=M.filter(L=>L.success).length;w.value=!1,j>0?($.value=`Published to ${j}/${M.length} relays`,_.value=!0):($.value="Failed to publish to any relay",_.value=!1)}return ne(()=>{f()}),(a,r)=>(s(),n("div",na,[r[17]||(r[17]=e("div",{class:"p-4 border-b border-white/[0.08]"},[e("h3",{class:"text-sm font-bold text-white/90"},"Nostr Profile")],-1)),t(c)?(s(),n("div",oa,[e("div",aa,[e("div",{class:i(["h-24 bg-cover bg-center",p.banner?"":"bg-gradient-to-r from-accent/20 to-purple-500/20"]),style:W(p.banner?{backgroundImage:`url(${p.banner})`}:{})},null,6),e("div",ia,[e("div",{class:i(["w-16 h-16 rounded-full border-2 border-black bg-cover bg-center flex items-center justify-center",p.picture?"":"bg-accent/20"]),style:W(p.picture?{backgroundImage:`url(${p.picture})`}:{})},[p.picture?v("",!0):(s(),n("span",ra,u((p.display_name||p.name||"?").charAt(0).toUpperCase()),1))],6),e("p",ca,u(p.display_name||p.name||"Anonymous"),1),p.nip05?(s(),n("p",da,u(p.nip05),1)):v("",!0),p.about?(s(),n("p",ua,u(p.about),1)):v("",!0)])]),e("div",ha,[e("div",null,[r[9]||(r[9]=e("label",{class:"text-xs text-white/30 block mb-1"},"Display Name",-1)),Q(e("input",{"onUpdate:modelValue":r[0]||(r[0]=h=>p.display_name=h),type:"text",class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors",placeholder:"Your display name"},null,512),[[J,p.display_name]])]),e("div",null,[r[10]||(r[10]=e("label",{class:"text-xs text-white/30 block mb-1"},"Username",-1)),Q(e("input",{"onUpdate:modelValue":r[1]||(r[1]=h=>p.name=h),type:"text",class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors",placeholder:"username"},null,512),[[J,p.name]])]),e("div",null,[r[11]||(r[11]=e("label",{class:"text-xs text-white/30 block mb-1"},"Bio",-1)),Q(e("textarea",{"onUpdate:modelValue":r[2]||(r[2]=h=>p.about=h),class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors resize-none min-h-[60px]",placeholder:"Tell the world about yourself"},null,512),[[J,p.about]])]),e("div",null,[r[12]||(r[12]=e("label",{class:"text-xs text-white/30 block mb-1"},"Avatar URL",-1)),Q(e("input",{"onUpdate:modelValue":r[3]||(r[3]=h=>p.picture=h),type:"url",class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors font-mono",placeholder:"https://example.com/avatar.jpg"},null,512),[[J,p.picture]])]),e("div",null,[r[13]||(r[13]=e("label",{class:"text-xs text-white/30 block mb-1"},"Banner URL",-1)),Q(e("input",{"onUpdate:modelValue":r[4]||(r[4]=h=>p.banner=h),type:"url",class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors font-mono",placeholder:"https://example.com/banner.jpg"},null,512),[[J,p.banner]])]),e("div",null,[r[14]||(r[14]=e("label",{class:"text-xs text-white/30 block mb-1"},"Website",-1)),Q(e("input",{"onUpdate:modelValue":r[5]||(r[5]=h=>p.website=h),type:"url",class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors font-mono",placeholder:"https://example.com"},null,512),[[J,p.website]])]),e("div",null,[r[15]||(r[15]=e("label",{class:"text-xs text-white/30 block mb-1"},"NIP-05 Address",-1)),Q(e("input",{"onUpdate:modelValue":r[6]||(r[6]=h=>p.nip05=h),type:"text",class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors font-mono",placeholder:"you@example.com"},null,512),[[J,p.nip05]])]),e("div",null,[r[16]||(r[16]=e("label",{class:"text-xs text-white/30 block mb-1"},"Lightning Address",-1)),Q(e("input",{"onUpdate:modelValue":r[7]||(r[7]=h=>p.lud16=h),type:"text",class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors font-mono",placeholder:"you@getalby.com"},null,512),[[J,p.lud16]])]),e("button",{class:"w-full min-h-[44px] rounded-lg text-sm font-medium bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors disabled:opacity-30",disabled:w.value,onClick:d},u(w.value?"Publishing...":"Publish Profile (kind:0)"),9,xa),$.value?(s(),n("div",{key:0,class:i(["text-xs text-center",_.value?"text-emerald-400/60":"text-red-400/60"])},u($.value),3)):v("",!0)])])):(s(),n("div",la,[...r[8]||(r[8]=[e("p",{class:"text-xs text-white/30"},"Sign in with Nostr to edit your profile",-1)])]))]))}}),ga={class:"relative glass-card w-[320px] max-w-[90vw] p-5 space-y-4 animate-scale-in"},ba={class:"flex items-center justify-between"},va={class:"text-xs text-white/40 truncate font-mono"},fa={class:"flex gap-1.5 flex-wrap"},ma=["onClick"],wa=["disabled"],ya={key:0,class:"space-y-2"},ka={class:"flex justify-center"},$a={class:"flex gap-1"},_a=["value"],Ca=["href"],ja={key:1,class:"text-xs text-red-400/60 text-center"},Sa=G({__name:"ZapDialog",props:{isOpen:{type:Boolean},targetName:{},lightningAddress:{}},emits:["close"],setup(o,{emit:c}){const l=o,m=c,g=S(null),b=S(null),p=[21,100,500,1e3,5e3,1e4],w=S(21),$=S(""),_=S(""),f=S(!1),d=S(""),a=S(!1),r=S(null);function h(k){return k>=1e3?`${(k/1e3).toFixed(k%1e3===0?0:1)}k`:String(k)}function M(){m("close"),_.value="",d.value="",$.value=""}async function j(){if(!(!l.lightningAddress||!w.value)){f.value=!0,d.value="",_.value="";try{const[k,x]=l.lightningAddress.split("@");if(!k||!x)throw new Error("Invalid Lightning address");const y=await fetch(`https://${x}/.well-known/lnurlp/${k}`);if(!y.ok)throw new Error("Failed to fetch LNURL");const z=await y.json();if(z.status==="ERROR")throw new Error(z.reason||"LNURL error");const V=w.value*1e3;if(V<(z.minSendable??0))throw new Error(`Minimum: ${Math.ceil((z.minSendable??0)/1e3)} sats`);if(V>(z.maxSendable??1/0))throw new Error(`Maximum: ${Math.floor((z.maxSendable??0)/1e3)} sats`);let A=z.callback;const K=A.includes("?")?"&":"?";A+=`${K}amount=${V}`,$.value&&(A+=`&comment=${encodeURIComponent($.value)}`);const O=await fetch(A);if(!O.ok)throw new Error("Failed to get invoice");const U=await O.json();if(U.status==="ERROR")throw new Error(U.reason||"Invoice error");_.value=U.pr,await ye(),L(U.pr)}catch(k){d.value=k instanceof Error?k.message:"Zap failed"}finally{f.value=!1}}}function L(k){const x=r.value;if(!x)return;const y=x.getContext("2d");if(!y)return;y.fillStyle="#1a1a1a",y.fillRect(0,0,200,200),y.fillStyle="#F7931A",y.font="10px monospace",y.textAlign="center";const z=[];for(let A=0;A{y.fillText(A,100,V+K*12)})}function I(){navigator.clipboard.writeText(_.value),a.value=!0,setTimeout(()=>{a.value=!1},2e3)}function C(k){const x=g.value;if(!x)return;const y=x.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(y.length===0)return;const z=y[0],V=y[y.length-1];k.shiftKey&&document.activeElement===z?(k.preventDefault(),V.focus()):!k.shiftKey&&document.activeElement===V&&(k.preventDefault(),z.focus())}return ie(()=>l.isOpen,async k=>{k?(await ye(),b.value?.focus()):(_.value="",d.value="")}),(k,x)=>o.isOpen?(s(),n("div",{key:0,ref_key:"dialogRef",ref:g,role:"dialog","aria-modal":"true","aria-label":"Send zap",class:"fixed inset-0 z-50 flex items-center justify-center",onClick:we(M,["self"]),onKeydown:[ae(M,["escape"]),ae(C,["tab"])]},[e("div",{class:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:M}),e("div",ga,[e("div",ba,[x[3]||(x[3]=e("h3",{class:"text-sm font-bold text-white/90"},"Zap",-1)),e("button",{ref_key:"closeButtonRef",ref:b,class:"min-w-[44px] min-h-[44px] flex items-center justify-center rounded text-white/40 hover:text-white/70 transition-colors","aria-label":"Close",onClick:M},[...x[2]||(x[2]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])],512)]),e("p",va,u(o.targetName),1),e("div",fa,[(s(),n(D,null,N(p,y=>e("button",{key:y,class:i(["text-xs px-2.5 py-1.5 rounded-lg transition-colors",w.value===y?"bg-accent/20 text-accent border border-accent/30":"bg-white/5 text-white/50 hover:bg-white/10"]),onClick:z=>w.value=y},u(h(y)),11,ma)),64))]),e("div",null,[x[4]||(x[4]=e("label",{class:"text-xs text-white/30 block mb-1"},"Amount (sats)",-1)),Q(e("input",{"onUpdate:modelValue":x[0]||(x[0]=y=>w.value=y),type:"number",min:"1",class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors tabular-nums",placeholder:"21"},null,512),[[J,w.value,void 0,{number:!0}]])]),e("div",null,[x[5]||(x[5]=e("label",{class:"text-xs text-white/30 block mb-1"},"Message (optional)",-1)),Q(e("input",{"onUpdate:modelValue":x[1]||(x[1]=y=>$.value=y),type:"text",class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors",placeholder:"Great post!"},null,512),[[J,$.value]])]),e("button",{class:"w-full py-2.5 rounded-lg text-xs font-medium bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors disabled:opacity-30",disabled:!w.value||w.value<1||f.value,onClick:j},u(f.value?"Generating invoice...":`Zap ${h(w.value)} sats`),9,wa),_.value?(s(),n("div",ya,[x[6]||(x[6]=e("p",{class:"text-xs text-white/30 text-center"},"Scan or tap to pay",-1)),e("div",ka,[e("canvas",{ref_key:"qrCanvas",ref:r,class:"rounded-lg",width:"200",height:"200"},null,512)]),e("div",$a,[e("input",{value:_.value,readonly:"",class:"flex-1 px-2 py-1.5 rounded text-base bg-white/5 text-white/40 font-mono truncate outline-none"},null,8,_a),e("button",{class:"px-2 py-1.5 rounded text-xs bg-white/5 text-white/40 hover:text-white/60 transition-colors",onClick:I},u(a.value?"Copied":"Copy"),1)]),e("a",{href:"lightning:"+_.value,class:"block w-full py-2 rounded-lg text-xs text-center bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors"}," Open in wallet ",8,Ca)])):v("",!0),d.value?(s(),n("p",ja,u(d.value),1)):v("",!0)])],544)):v("",!0)}}),Ma={class:"h-full flex flex-col"},Ta={class:"flex items-center gap-2 px-4 py-3 border-b border-white/[0.08]"},Ia={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-3 pb-16 space-y-2"},Da={key:0,class:"flex items-center justify-center py-12"},Ba={key:1,class:"rounded-xl bg-white/[0.05] border border-white/10 p-3"},La={class:"flex items-center gap-1.5 mb-1"},Pa={class:"w-6 h-6 rounded-full shrink-0 flex items-center justify-center text-xs font-bold bg-purple-500/20 text-purple-400"},Na={class:"text-xs font-semibold text-white/80"},za={class:"text-xs ml-auto text-white/20"},Ea={class:"text-xs text-white/70 leading-relaxed whitespace-pre-wrap"},Aa={key:2,class:"space-y-1"},Fa={class:"text-xs text-white/30 font-medium mt-3 mb-1"},Ra={key:3,class:"flex items-center justify-center py-12"},Va={key:0,class:"px-4 py-3 border-t border-white/[0.08]"},Ua={key:0,class:"text-xs text-white/30 mb-1"},qa={class:"flex gap-2"},Ga=["disabled"],Oa=G({__name:"NostrThread",props:{noteId:{}},emits:["back"],setup(o){const c=Ht(()=>pt(()=>import("./ThreadNode-B0koBP1i.js"),__vite__mapDeps([3,1,2]))),l=o,{fetchNote:m,publishEvent:g}=De(),{isLoggedIn:b,signEvent:p,pubkey:w}=ve(),$=S(null),_=S([]),f=S(!0),d=S(null),a=S("");function r(k){const x=new Date(k*1e3);return x.toLocaleTimeString("en",{hour:"2-digit",minute:"2-digit"})+" "+x.toLocaleDateString("en",{month:"short",day:"numeric"})}function h(k){return k.length<=12?k:k.slice(0,8)+"..."+k.slice(-4)}async function M(){f.value=!0;const k=await m(l.noteId);if(!k){f.value=!1;return}$.value=k;const x=await j(l.noteId);_.value=L(x,l.noteId),f.value=!1}async function j(k){return new Promise(x=>{const y=[],z="thread-"+Math.random().toString(36).slice(2,8);let V=!1;const A=setTimeout(()=>{V||(V=!0,x(y))},8e3),K="wss://relay.nostr.band";try{const O=new WebSocket(K);O.onopen=()=>{O.send(JSON.stringify(["REQ",z,{kinds:[1],"#e":[k],limit:100}]))},O.onmessage=U=>{try{const R=JSON.parse(U.data);if(Array.isArray(R)&&R[0]==="EVENT"&&R[1]===z&&R[2]){const H=R[2];y.find(le=>le.id===H.id)||y.push({id:H.id,pubkey:H.pubkey,authorName:h(H.pubkey),kind:H.kind,content:H.content,created_at:H.created_at,tags:H.tags??[]})}Array.isArray(R)&&R[0]==="EOSE"&&R[1]===z&&(clearTimeout(A),O.close(),V||(V=!0,x(y)))}catch{}},O.onerror=()=>{clearTimeout(A),V||(V=!0,x(y))},O.onclose=()=>{V||(V=!0,x(y))}}catch{clearTimeout(A),x(y)}})}function L(k,x,y=5){const z=new Map;for(const A of k){let K=x;const O=A.tags.filter(R=>R[0]==="e");if(O.length>0){const R=O.find(H=>H[3]==="reply");K=R?R[1]:O[O.length-1][1]}const U=z.get(K)??[];U.push(A),z.set(K,U)}function V(A,K){const O=z.get(A)??[];return O.sort((U,R)=>U.created_at-R.created_at),O.map(U=>({note:U,children:K{M()}),(k,x)=>(s(),n("div",Ma,[e("div",Ta,[e("button",{class:"min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg text-white/60 hover:text-white/80 hover:bg-white/10 transition-colors",onClick:x[0]||(x[0]=y=>k.$emit("back"))},[...x[3]||(x[3]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),x[4]||(x[4]=e("h3",{class:"text-sm font-bold text-white/90"},"Thread",-1))]),e("div",Ia,[f.value?(s(),n("div",Da,[...x[5]||(x[5]=[e("p",{class:"text-xs text-white/30"},"Loading thread...",-1)])])):v("",!0),$.value?(s(),n("div",Ba,[e("div",La,[e("div",Pa,u($.value.authorName?.charAt(0)?.toUpperCase()??"?"),1),e("span",Na,u($.value.authorName??"anon"),1),e("span",za,u(r($.value.created_at)),1)]),e("p",Ea,u($.value.content),1)])):v("",!0),_.value.length>0?(s(),n("div",Aa,[e("p",Fa,u(_.value.length)+" replies",1),(s(!0),n(D,null,N(_.value,y=>(s(),q(t(c),{key:y.note.id,node:y,depth:0,onReply:I},null,8,["node"]))),128))])):v("",!0),!f.value&&!$.value?(s(),n("div",Ra,[...x[6]||(x[6]=[e("p",{class:"text-xs text-white/30"},"Thread not found",-1)])])):v("",!0)]),$.value&&t(b)?(s(),n("div",Va,[d.value?(s(),n("p",Ua,[se(" Replying to "+u(d.value.authorName??"anon")+" ",1),e("button",{class:"text-accent/60 ml-1",onClick:x[1]||(x[1]=y=>d.value=null)},"cancel")])):v("",!0),e("div",qa,[Q(e("input",{"onUpdate:modelValue":x[2]||(x[2]=y=>a.value=y),type:"text",placeholder:"Reply...",class:"flex-1 px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors",onKeydown:ae(C,["enter"])},null,544),[[J,a.value]]),e("button",{class:"px-3 py-2 rounded-lg text-xs bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors disabled:opacity-30",disabled:!a.value.trim(),onClick:C}," Reply ",8,Ga)])])):v("",!0)]))}}),Ha={class:"h-full flex flex-col"},Wa={class:"p-4 border-b border-white/[0.08]"},Ka={class:"flex gap-1.5 flex-wrap"},Ya=["onClick"],Qa={key:0,class:"flex-1 flex items-center justify-center"},Ja={key:1,class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-3 pb-16 space-y-2"},Za={key:0,class:"flex items-center justify-center py-12"},Xa={class:"flex gap-2 mb-3"},ei=["placeholder"],ti=["disabled"],si={class:"w-6 h-6 rounded-full shrink-0 flex items-center justify-center text-xs font-bold bg-purple-500/20 text-purple-400"},ni={class:"flex-1 min-w-0"},li={class:"text-xs text-white/60 font-mono truncate"},oi={key:0,class:"text-xs text-white/30"},ai=["onClick"],ii={key:1,class:"flex items-center justify-center py-12"},ri=["disabled"],ci=G({__name:"NostrLists",setup(o){const{isLoggedIn:c,signEvent:l,pubkey:m}=ve(),{publishEvent:g}=De(),b=[{kind:3,label:"Follows"},{kind:1e4,label:"Mute"},{kind:10001,label:"Pin"},{kind:10003,label:"Bookmarks"}],p=S(3),w=S([]),$=S(!1),_=S(!1),f=S(""),d=S(!1),a=S(""),r=S(!1);function h(k){return k.length<=16?k:k.slice(0,8)+"..."+k.slice(-8)}function M(k){return k.filter(x=>x[0]==="p"||x[0]==="e"||x[0]==="t").map(x=>{let y=h(x[1]);if(x[0]==="p")try{y=He(x[1])}catch{}return{tag:x[0],value:x[1],displayValue:y,relay:x[2]||void 0,petname:x[3]||void 0}})}async function j(k){if(m.value){$.value=!0,_.value=!1,w.value=[];try{const x=new WebSocket("wss://relay.nostr.band"),y="list-"+Math.random().toString(36).slice(2,8),z=setTimeout(()=>{x.close(),$.value=!1},8e3);x.onopen=()=>{x.send(JSON.stringify(["REQ",y,{kinds:[k],authors:[m.value],limit:1}]))},x.onmessage=V=>{try{const A=JSON.parse(V.data);if(Array.isArray(A)&&A[0]==="EVENT"&&A[1]===y&&A[2]){const K=A[2];w.value=M(K.tags)}Array.isArray(A)&&A[0]==="EOSE"&&(clearTimeout(z),x.close(),$.value=!1)}catch{}},x.onerror=()=>{clearTimeout(z),$.value=!1}}catch{$.value=!1}}}function L(){let k=f.value.trim();if(!k)return;let x=k;const y=p.value===3||p.value===1e4?"p":"e";if(k.startsWith("npub"))try{x=gt(k)}catch{return}if(w.value.find(V=>V.value===x))return;let z=h(x);if(y==="p")try{z=He(x)}catch{}w.value.push({tag:y,value:x,displayValue:z}),_.value=!0,f.value=""}function I(k){w.value=w.value.filter(x=>x.value!==k.value),_.value=!0}async function C(){if(!m.value)return;d.value=!0,a.value="";const k=w.value.map(A=>{const K=[A.tag,A.value];return A.relay&&K.push(A.relay),A.petname&&K.push(A.petname),K}),x={kind:p.value,created_at:Math.floor(Date.now()/1e3),tags:k,content:""},y=await l(x);if(!y){d.value=!1,a.value="Signing failed",r.value=!1;return}const z=await g(y),V=z.filter(A=>A.success).length;d.value=!1,_.value=!1,V>0?(a.value=`Published to ${V}/${z.length} relays`,r.value=!0):(a.value="Failed to publish",r.value=!1)}return ne(()=>{j(p.value)}),(k,x)=>(s(),n("div",Ha,[e("div",Wa,[x[1]||(x[1]=e("h3",{class:"text-sm font-bold text-white/90 mb-3"},"Nostr Lists",-1)),e("div",Ka,[(s(),n(D,null,N(b,y=>e("button",{key:y.kind,class:i(["text-xs px-2 py-1 rounded-md transition-all duration-150",p.value===y.kind?"nav-tab-active":"text-white/40 hover:text-white/70 hover:bg-white/5"]),onClick:z=>{p.value=y.kind,j(y.kind)}},u(y.label),11,Ya)),64))])]),t(c)?(s(),n("div",Ja,[$.value?(s(),n("div",Za,[...x[3]||(x[3]=[e("p",{class:"text-xs text-white/30"},"Loading list...",-1)])])):v("",!0),e("div",Xa,[Q(e("input",{"onUpdate:modelValue":x[0]||(x[0]=y=>f.value=y),type:"text",placeholder:p.value===3?"Add npub or hex pubkey...":"Add item (hex id or npub)...",class:"flex-1 px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors font-mono",onKeydown:ae(L,["enter"])},null,40,ei),[[J,f.value]]),e("button",{class:"px-2.5 py-2 rounded-lg text-xs bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors disabled:opacity-30",disabled:!f.value.trim(),onClick:L}," Add ",8,ti)]),(s(!0),n(D,null,N(w.value,y=>(s(),n("div",{key:y.value,class:"flex items-center gap-2 p-2.5 rounded-xl bg-white/[0.03] border border-white/5"},[e("div",si,u(y.tag==="p"?"P":y.tag==="e"?"E":y.tag==="t"?"#":"?"),1),e("div",ni,[e("p",li,u(y.displayValue),1),y.petname?(s(),n("p",oi,u(y.petname),1)):v("",!0)]),e("button",{class:"text-xs px-2 py-1 rounded bg-white/5 text-red-400/50 hover:text-red-400/80 hover:bg-red-400/10 transition-colors shrink-0",onClick:z=>I(y)}," Remove ",8,ai)]))),128)),!$.value&&w.value.length===0?(s(),n("div",ii,[...x[4]||(x[4]=[e("p",{class:"text-xs text-white/30"},"List is empty",-1)])])):v("",!0),_.value?(s(),n("button",{key:2,class:"w-full py-2.5 rounded-lg text-xs font-medium bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors disabled:opacity-30 mt-4",disabled:d.value,onClick:C},u(d.value?"Publishing...":"Publish updated list"),9,ri)):v("",!0),a.value?(s(),n("p",{key:3,class:i(["text-xs text-center",r.value?"text-emerald-400/60":"text-red-400/60"])},u(a.value),3)):v("",!0)])):(s(),n("div",Qa,[...x[2]||(x[2]=[e("p",{class:"text-xs text-white/30"},"Sign in with Nostr to manage lists",-1)])]))]))}}),di={class:"article-reader h-full flex"},ui={key:0,class:"hidden lg:flex flex-col w-56 shrink-0 border-r border-white/5 overflow-y-auto scrollbar-hide py-4 px-3"},hi=["onClick"],xi={class:"sticky top-0 z-10 flex items-center gap-2 px-4 py-2 bg-black/60 backdrop-blur-md border-b border-white/5"},pi={class:"flex-1 text-xs text-white/40 truncate"},gi=["disabled"],bi=["disabled"],vi={key:0,class:"lg:hidden bg-black/40 backdrop-blur-md border-b border-white/5 px-4 py-2 space-y-0.5 animate-fade-up-fast"},fi=["onClick"],mi={key:0,class:"text-xl font-bold text-white/96 mb-4"},wi=["innerHTML"],yi=G({__name:"ArticleReader",props:{content:{},title:{}},emits:["back"],setup(o){const c=o,l=[13,15,17,19,21],m=localStorage.getItem("aiui-article-font-size"),g=S(m?parseInt(m,10):1);ie(g,I=>{localStorage.setItem("aiui-article-font-size",String(I))});const b=S(!1),p=new ns({html:!1,linkify:!0,breaks:!0});p.renderer.rules.heading_open=(I,C,k,x,y)=>{const z=I[C],V=parseInt(z.tag.slice(1),10);if(V===2||V===3){const O=(I[C+1]?.children?.reduce((U,R)=>U+(R.content||""),"")||"").toLowerCase().replace(/[^\w]+/g,"-").replace(/(^-|-$)/g,"");z.attrSet("id",O)}return y.renderToken(I,C,k)};const w=p.renderer.rules.link_open||function(I,C,k,x,y){return y.renderToken(I,C,k)};p.renderer.rules.link_open=function(I,C,k,x,y){return I[C].attrSet("target","_blank"),I[C].attrSet("rel","noopener noreferrer"),w(I,C,k,x,y)};const $=B(()=>p.render(c.content)),_=B(()=>{const I=[],C=/^(#{2,3})\s+(.+)$/gm;let k;for(;(k=C.exec(c.content))!==null;){const x=k[2].trim(),y=x.toLowerCase().replace(/[^\w]+/g,"-").replace(/(^-|-$)/g,"");I.push({text:x,id:y,level:k[1].length})}return I}),f=B(()=>{const I=c.content.split(/\s+/).length;return Math.max(1,Math.ceil(I/200))}),d=S(null),a=S(null),r=S(0);let h=null;function M(){if(!d.value)return;h?.disconnect(),h=new IntersectionObserver(C=>{for(const k of C)if(k.isIntersecting){const x=k.target.id,y=_.value.findIndex(z=>z.id===x);y>=0&&(r.value=y)}},{root:d.value,rootMargin:"-20% 0px -60% 0px",threshold:0}),a.value?.querySelectorAll("h2[id], h3[id]")?.forEach(C=>h.observe(C))}ne(()=>{setTimeout(M,100)}),ie(()=>c.content,()=>{setTimeout(M,100)}),Wt(()=>{h?.disconnect()});function j(I){a.value?.querySelector(`#${CSS.escape(I)}`)?.scrollIntoView({behavior:"smooth",block:"start"})}function L(){const I=window.open("","_blank");I&&(I.document.write(` -${c.title||"Article"} - -${c.title?`

${c.title}

`:""} -${$.value} -`),I.document.close(),I.print())}return(I,C)=>(s(),n("div",di,[_.value.length>1?(s(),n("aside",ui,[C[4]||(C[4]=e("p",{class:"text-xs uppercase tracking-wider text-white/30 mb-2 px-2"},"Contents",-1)),(s(!0),n(D,null,N(_.value,(k,x)=>(s(),n("button",{key:x,class:i(["text-left text-xs leading-relaxed py-1 px-2 rounded transition-colors truncate",[r.value===x?"text-accent bg-accent/10":"text-white/50 hover:text-white/70 hover:bg-white/5",k.level===3?"pl-5":""]]),onClick:y=>j(k.id)},u(k.text),11,hi))),128))])):v("",!0),e("div",{ref_key:"contentRef",ref:d,class:"flex-1 overflow-y-auto scrollbar-hide"},[e("div",xi,[e("button",{class:"min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg text-white/60 hover:text-white/80 hover:bg-white/10 transition-colors",title:"Back",onClick:C[0]||(C[0]=k=>I.$emit("back"))},[...C[5]||(C[5]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),e("span",pi,u(f.value)+" min read",1),_.value.length>1?(s(),n("button",{key:0,class:"lg:hidden min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg text-white/60 hover:text-white/80 hover:bg-white/10 transition-colors",title:"Table of contents",onClick:C[1]||(C[1]=k=>b.value=!b.value)},[...C[6]||(C[6]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h16M4 18h7"})],-1)])])):v("",!0),e("button",{class:"min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg text-white/60 hover:text-white/80 hover:bg-white/10 transition-colors",title:"Decrease font size",disabled:g.value<=0,onClick:C[2]||(C[2]=k=>g.value=Math.max(0,g.value-1))},[...C[7]||(C[7]=[e("span",{class:"text-xs font-bold"},"A-",-1)])],8,gi),e("button",{class:"min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg text-white/60 hover:text-white/80 hover:bg-white/10 transition-colors",title:"Increase font size",disabled:g.value>=l.length-1,onClick:C[3]||(C[3]=k=>g.value=Math.min(l.length-1,g.value+1))},[...C[8]||(C[8]=[e("span",{class:"text-xs font-bold"},"A+",-1)])],8,bi),e("button",{class:"min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg text-white/60 hover:text-white/80 hover:bg-white/10 transition-colors",title:"Print",onClick:L},[...C[9]||(C[9]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"})],-1)])])]),b.value&&_.value.length>1?(s(),n("div",vi,[(s(!0),n(D,null,N(_.value,(k,x)=>(s(),n("button",{key:x,class:i(["block w-full text-left text-xs py-1 px-2 rounded transition-colors truncate",[r.value===x?"text-accent bg-accent/10":"text-white/50 hover:text-white/70",k.level===3?"pl-5":""]]),onClick:y=>{j(k.id),b.value=!1}},u(k.text),11,fi))),128))])):v("",!0),e("article",{ref_key:"articleRef",ref:a,class:"article-body px-4 md:px-8 py-6 max-w-prose mx-auto leading-relaxed text-white/90",style:W({fontSize:l[g.value]+"px"})},[o.title?(s(),n("h1",mi,u(o.title),1)):v("",!0),e("div",{class:"article-content [&_h2]:text-lg [&_h2]:font-semibold [&_h2]:text-white/96 [&_h2]:mt-8 [&_h2]:mb-3 [&_h3]:text-base [&_h3]:font-medium [&_h3]:text-white/90 [&_h3]:mt-6 [&_h3]:mb-2 [&_p]:mb-4 [&_ul]:list-disc [&_ul]:ml-5 [&_ul]:mb-4 [&_ol]:list-decimal [&_ol]:ml-5 [&_ol]:mb-4 [&_li]:mb-1 [&_a]:text-accent [&_a]:underline [&_a]:underline-offset-2 [&_blockquote]:border-l-2 [&_blockquote]:border-accent/30 [&_blockquote]:pl-4 [&_blockquote]:italic [&_blockquote]:text-white/70 [&_blockquote]:my-4 [&_code]:bg-white/10 [&_code]:px-1.5 [&_code]:py-0.5 [&_code]:rounded [&_code]:text-[0.9em] [&_pre]:bg-white/5 [&_pre]:rounded-lg [&_pre]:p-4 [&_pre]:overflow-x-auto [&_pre]:my-4 [&_img]:rounded-lg [&_img]:max-w-full [&_img]:my-4 [&_hr]:border-white/10 [&_hr]:my-6",innerHTML:$.value},null,8,wi)],4)],512)]))}}),ki={class:"h-full flex flex-col"},$i={class:"flex items-center gap-2 px-4 py-3 border-b border-white/[0.08]"},_i={class:"text-xs text-white/40 truncate"},Ci={class:"flex-1 overflow-y-auto custom-scrollbar"},ji={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-3 pb-16 space-y-2"},Si={key:0,class:"flex items-center justify-center py-12"},Mi=["onClick"],Ti={class:"space-y-1"},Ii={class:"text-xs font-semibold text-white/80 line-clamp-2"},Di={class:"text-xs text-white/40 line-clamp-2"},Bi={class:"flex items-center gap-2"},Li={class:"text-xs text-white/25 font-mono"},Pi={class:"text-xs text-white/20"},Ni={key:0,class:"text-xs text-accent/40 ml-auto"},zi={key:1,class:"flex items-center justify-center py-12"},Ei=G({__name:"NostrArticles",setup(o){const c=S([]),l=S(!0),m=S(null),g=B(()=>m.value?w(m.value):"");function b(d){return d.length<=16?d:d.slice(0,8)+"..."+d.slice(-4)}function p(d){return new Date(d*1e3).toLocaleDateString("en",{month:"short",day:"numeric",year:"numeric"})}function w(d){const a=d.tags.find(h=>h[0]==="title");return a?.[1]?a[1]:d.content.split(` -`)[0].replace(/^#+ /,"").slice(0,60)||"Untitled"}function $(d){const a=d.tags.find(r=>r[0]==="summary");return a?.[1]?a[1]:d.content.slice(0,120).replace(/[#*_]/g,"")}function _(d){return d.tags.find(r=>r[0]==="image")?.[1]??null}async function f(){l.value=!0,c.value=[];const d="wss://relay.nostr.band",a="articles-"+Math.random().toString(36).slice(2,8);try{const r=new WebSocket(d),h=[],M=setTimeout(()=>{r.close(),c.value=h,l.value=!1},1e4);r.onopen=()=>{r.send(JSON.stringify(["REQ",a,{kinds:[30023],limit:30}]))},r.onmessage=j=>{try{const L=JSON.parse(j.data);if(Array.isArray(L)&&L[0]==="EVENT"&&L[1]===a&&L[2]){const I=L[2];h.find(C=>C.id===I.id)||h.push({id:I.id,pubkey:I.pubkey,authorName:b(I.pubkey),kind:I.kind,content:I.content,created_at:I.created_at,tags:I.tags??[]})}Array.isArray(L)&&L[0]==="EOSE"&&(clearTimeout(M),r.close(),h.sort((I,C)=>C.created_at-I.created_at),c.value=h,l.value=!1)}catch{}},r.onerror=()=>{clearTimeout(M),l.value=!1}}catch{l.value=!1}}return ne(()=>{f()}),(d,a)=>(s(),n("div",ki,[m.value?(s(),n(D,{key:0},[e("div",$i,[e("button",{class:"min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg text-white/60 hover:text-white/80 hover:bg-white/10 transition-colors",onClick:a[0]||(a[0]=r=>m.value=null)},[...a[1]||(a[1]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),e("span",_i,u(g.value),1)]),e("div",Ci,[te(yi,{content:m.value.content,title:g.value},null,8,["content","title"])])],64)):(s(),n(D,{key:1},[a[4]||(a[4]=e("div",{class:"p-4 border-b border-white/[0.08]"},[e("h3",{class:"text-sm font-bold text-white/90 mb-2"},"Long-Form Articles"),e("p",{class:"text-xs text-white/30"},"NIP-23 kind:30023 articles from your network")],-1)),e("div",ji,[l.value?(s(),n("div",Si,[...a[2]||(a[2]=[e("p",{class:"text-xs text-white/30"},"Loading articles...",-1)])])):v("",!0),(s(!0),n(D,null,N(c.value,r=>(s(),n("button",{key:r.id,class:"w-full text-left p-3 rounded-xl transition-all duration-150 bg-white/[0.03] hover:bg-white/[0.07] border border-white/5",onClick:h=>m.value=r},[e("div",Ti,[e("h4",Ii,u(w(r)),1),e("p",Di,u($(r)),1),e("div",Bi,[e("span",Li,u(b(r.pubkey)),1),e("span",Pi,u(p(r.created_at)),1),_(r)?(s(),n("span",Ni,"has image")):v("",!0)])])],8,Mi))),128)),!l.value&&c.value.length===0?(s(),n("div",zi,[...a[3]||(a[3]=[e("p",{class:"text-xs text-white/30"},"No articles found",-1)])])):v("",!0)])],64))]))}}),We=1440*60*1e3,ft="aiui-nip05-cache",Te=S(new Map);function Ai(){try{const o=localStorage.getItem(ft);if(o){const c=JSON.parse(o),l=Date.now(),m=c.filter(([,g])=>l-g.timestamp=We?null:b.verified}return{verifyNip05:o,isVerified:l}}const Vi={class:"h-full flex flex-col"},Ui={class:"flex gap-2 px-4 pt-3 pb-1"},qi=["onClick"],Gi={class:"p-4 space-y-3 border-b border-white/[0.08]"},Oi={class:"flex items-center justify-between gap-2"},Hi={class:"flex items-center gap-2 shrink-0"},Wi={class:"text-xs font-mono text-white/30"},Ki={key:1,class:"rounded-lg bg-white/5 border border-white/10 p-3 space-y-2"},Yi=["onKeydown"],Qi={class:"flex items-center justify-between gap-2"},Ji=["disabled"],Zi={key:0,class:"space-y-1"},Xi={class:"truncate font-mono text-white/40"},er={class:"flex gap-2"},tr=["disabled"],sr={class:"flex gap-2"},nr=["onClick"],lr={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-3 pb-16 space-y-2"},or={key:0,class:"flex flex-col items-center justify-center py-12 gap-3"},ar=["onClick"],ir={class:"flex items-start gap-2.5"},rr={class:"w-8 h-8 rounded-full shrink-0 overflow-hidden"},cr=["src","alt","onError"],dr={key:1,class:"w-full h-full flex items-center justify-center text-xs font-bold bg-purple-500/20 text-purple-400"},ur={class:"flex-1 min-w-0"},hr={class:"flex items-center gap-1.5"},xr={class:"text-xs font-semibold truncate text-white/80"},pr={key:0,class:"text-xs truncate text-purple-400/60 flex items-center gap-0.5"},gr=["title"],br={class:"text-xs ml-auto shrink-0 text-white/20"},vr={class:"text-xs mt-1 leading-relaxed line-clamp-3 text-white/60"},fr={class:"flex items-center gap-3 mt-2"},mr=["onClick"],wr={key:0,class:"text-xs px-1.5 py-0.5 rounded bg-white/5 text-white/30"},yr={class:"mt-4 pt-4 border-t border-white/5"},kr={class:"space-y-1"},$r={class:"truncate font-mono text-white/40"},_r={key:1,class:"flex items-center justify-center py-12"},Cr=G({__name:"NostrGrid",setup(o){const{events:c,isConnected:l,relayStates:m,connect:g,publishEvent:b,searchResults:p,isSearching:w,searchNostr:$}=De(),{isLoggedIn:_,signEvent:f}=ve(),{verifyNip05:d}=Ri(),a=S("feed"),r=[{id:"feed",label:"Feed"},{id:"articles",label:"Articles"},{id:"dms",label:"Messages"},{id:"lists",label:"Lists"},{id:"relays",label:"Relays"},{id:"profile",label:"Profile"}],h=S(null),M=Pe(new Set),j=S(""),L=S(null),I=S(!1),C=S(""),k=S(null),x=S(!1),y=S([]),z=S(!1),V=S(""),A=S(void 0);function K(X){V.value=X.authorName??X.pubkey.slice(0,12),A.value=void 0,z.value=!0}const O=Pe({}),U=[{id:1,label:"Notes"},{id:30023,label:"Articles"},{id:9735,label:"Zaps"},{id:6,label:"Reposts"}];function R(X){const E=Math.floor(Date.now()/1e3-X);return E<60?"now":E<3600?`${Math.floor(E/60)}m`:E<86400?`${Math.floor(E/3600)}h`:`${Math.floor(E/86400)}d`}const H=S(!1),le=B(()=>{if(H.value&&p.value.length>0){let E=p.value;return L.value!==null&&(E=E.filter(P=>P.kind===L.value)),E}let X=c.value;if(L.value!==null&&(X=X.filter(E=>E.kind===L.value)),j.value){const E=j.value.toLowerCase();X=X.filter(P=>P.content.toLowerCase().includes(E)||(P.authorName??"").toLowerCase().includes(E)||(P.nip05??"").toLowerCase().includes(E))}return X});function fe(){j.value.trim()&&(H.value=!0,$(j.value.trim(),L.value?[L.value]:void 0))}ie(j,X=>{X.trim()||(H.value=!1)}),ie(le,X=>{for(const E of X)E.nip05&&O[E.id]===void 0&&(O[E.id]=null,d(E.nip05,E.pubkey).then(P=>{O[E.id]=P}))},{immediate:!0});async function pe(){if(!C.value.trim()||x.value)return;x.value=!0,y.value=[];const X={kind:1,created_at:Math.floor(Date.now()/1e3),tags:[],content:C.value.trim()},E=await f(X);if(!E){x.value=!1;return}const P=await b(E);y.value=P,x.value=!1,P.some(ce=>ce.success)&&(C.value="",setTimeout(()=>{y.value=[],I.value=!1},3e3))}return ne(async()=>{g(),I.value&&(await ye(),k.value?.focus())}),(X,E)=>(s(),n("div",Vi,[e("div",Ui,[(s(),n(D,null,N(r,P=>e("button",{key:P.id,class:i(["text-xs px-2.5 min-h-[44px] rounded-md transition-all duration-150 flex items-center justify-center",a.value===P.id?"nav-tab-active":"text-white/40 hover:text-white/70 hover:bg-white/5"]),onClick:ce=>a.value=P.id},u(P.label),11,qi)),64))]),a.value==="dms"?(s(),q(Ro,{key:0})):a.value==="relays"?(s(),q(sa,{key:1})):a.value==="profile"?(s(),q(pa,{key:2})):a.value==="lists"?(s(),q(ci,{key:3})):a.value==="articles"?(s(),q(Ei,{key:4})):a.value==="feed"&&h.value?(s(),q(Oa,{key:5,"note-id":h.value,onBack:E[0]||(E[0]=P=>h.value=null)},null,8,["note-id"])):(s(),n(D,{key:6},[e("div",Gi,[e("div",Oi,[E[5]||(E[5]=e("h3",{class:"text-sm font-bold text-white/90"}," Nostr Feed ",-1)),e("div",Hi,[e("span",Wi,u(le.value.length)+" notes ",1),re(X.$slots,"header-actions")])]),t(_)?(s(),n("button",{key:0,class:"w-full text-left px-3 py-2 rounded-lg text-xs text-white/40 bg-white/5 hover:bg-white/10 transition-colors",onClick:E[1]||(E[1]=P=>I.value=!I.value)},u(I.value?"Cancel":"Write a note..."),1)):v("",!0),I.value&&t(_)?(s(),n("div",Ki,[Q(e("textarea",{ref_key:"composeRef",ref:k,"onUpdate:modelValue":E[2]||(E[2]=P=>C.value=P),class:"w-full bg-transparent text-base text-white/80 placeholder:text-white/25 outline-none resize-none min-h-[80px]",placeholder:"What's on your mind?",onKeydown:[ae(we(pe,["meta"]),["enter"]),ae(we(pe,["ctrl"]),["enter"])]},null,40,Yi),[[J,C.value]]),e("div",Qi,[e("span",{class:i(["text-xs tabular-nums",C.value.length>280?"text-accent/80":"text-white/25"])},u(C.value.length),3),e("button",{class:"text-xs px-3 py-1.5 rounded-lg bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors disabled:opacity-30",disabled:!C.value.trim()||x.value,onClick:pe},u(x.value?"Publishing...":"Publish"),9,Ji)]),y.value.length>0?(s(),n("div",Zi,[(s(!0),n(D,null,N(y.value,P=>(s(),n("div",{key:P.url,class:"flex items-center gap-2 text-xs px-2 py-1 rounded bg-white/[0.02]"},[e("span",{class:i(["w-1.5 h-1.5 rounded-full shrink-0",P.success?"bg-emerald-500":"bg-red-400/60"])},null,2),e("span",Xi,u(P.url),1),e("span",{class:i(["ml-auto shrink-0",P.success?"text-emerald-400/60":"text-red-400/60"])},u(P.message),3)]))),128))])):v("",!0)])):v("",!0),e("div",er,[Q(e("input",{"onUpdate:modelValue":E[3]||(E[3]=P=>j.value=P),type:"text",placeholder:"Search notes, npubs...",class:"flex-1 px-3 py-2 rounded-lg text-base outline-none transition-colors bg-white/5 text-white/80 placeholder:text-white/25 focus:bg-white/10",onKeydown:ae(fe,["enter"])},null,544),[[J,j.value]]),j.value.trim()?(s(),n("button",{key:0,class:"px-2.5 py-2 rounded-lg text-xs bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors disabled:opacity-30 shrink-0",disabled:t(w),onClick:fe},u(t(w)?"...":"NIP-50"),9,tr)):v("",!0)]),e("div",sr,[(s(),n(D,null,N(U,P=>e("button",{key:P.id,class:i(["text-xs px-2.5 min-h-[44px] rounded-md transition-all duration-150 flex items-center justify-center",L.value===P.id?"nav-tab-active":"text-white/40 hover:text-white/70 hover:bg-white/5"]),onClick:ce=>L.value=L.value===P.id?null:P.id},u(P.label),11,nr)),64))])]),e("div",lr,[!t(l)&&t(c).length===0?(s(),n("div",or,[...E[6]||(E[6]=[e("svg",{class:"w-5 h-5 animate-spin text-white/30",fill:"none",viewBox:"0 0 24 24"},[e("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})],-1),e("p",{class:"text-xs text-white/30"},"Connecting to relays...",-1)])])):v("",!0),(s(!0),n(D,null,N(le.value,P=>(s(),n("button",{key:P.id,class:"w-full text-left p-3 rounded-xl transition-all duration-150 bg-white/[0.03] hover:bg-white/[0.07] border border-white/5",onClick:ce=>h.value=P.id},[e("div",ir,[e("div",rr,[P.authorPicture&&!M.has(P.pubkey)?(s(),n("img",{key:0,src:P.authorPicture,alt:P.authorName??"profile",class:"w-full h-full object-cover",loading:"lazy",onError:ce=>M.add(P.pubkey)},null,40,cr)):(s(),n("div",dr,u(P.authorName?.charAt(0)?.toUpperCase()??"?"),1))]),e("div",ur,[e("div",hr,[e("span",xr,u(P.authorName??"anon"),1),P.nip05?(s(),n("span",pr,[O[P.id]===!0?(s(),n("svg",{key:0,class:"w-2.5 h-2.5 text-emerald-400 shrink-0",fill:"currentColor",viewBox:"0 0 20 20",title:P.nip05},[...E[7]||(E[7]=[e("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"},null,-1)])],8,gr)):v("",!0),se(" "+u(P.nip05),1)])):v("",!0),e("span",br,u(R(P.created_at)),1)]),e("p",vr,u(P.content),1),e("div",fr,[e("button",{class:"text-xs px-3 py-2 min-h-[44px] min-w-[44px] rounded bg-white/5 text-accent/60 hover:text-accent hover:bg-accent/10 transition-colors flex items-center justify-center",onClick:we(ce=>K(P),["stop"])}," Zap ",8,mr),P.kind!==1?(s(),n("span",wr," kind:"+u(P.kind),1)):v("",!0)])])])],8,ar))),128)),e("div",yr,[E[8]||(E[8]=e("p",{class:"text-xs font-medium mb-2 text-white/30"},"Relays",-1)),e("div",kr,[(s(!0),n(D,null,N(t(m),P=>(s(),n("div",{key:P.url,class:"flex items-center gap-2 text-xs px-2 py-1 rounded-lg bg-white/[0.02]"},[e("span",{class:i(["w-1.5 h-1.5 rounded-full shrink-0",P.connected?"bg-emerald-500":"bg-red-400/60"])},null,2),e("span",$r,u(P.url),1)]))),128))])]),t(l)&&le.value.length===0?(s(),n("div",_r,[...E[9]||(E[9]=[e("p",{class:"text-sm text-white/30"},"No notes match your search",-1)])])):v("",!0)])],64)),te(Sa,{"is-open":z.value,"target-name":V.value,"lightning-address":A.value,onClose:E[4]||(E[4]=P=>z.value=!1)},null,8,["is-open","target-name","lightning-address"])]))}}),jr={class:"flex-1 min-h-0 flex flex-col"},at=G({__name:"ContentGridView",props:{activeTab:{},isWideDesktop:{type:Boolean},isMobile:{type:Boolean},panelFilms:{},panelBooks:{},panelTVSeries:{},panelImages:{},panelPlaces:{},panelSongs:{},panelPodcasts:{},panelWebResults:{},panelWebsites:{},panelMagazineSections:{},panelMagazineHeroImage:{},panelTitle:{},panelQuery:{},panelResponseText:{}},setup(o){const c=o,l=B(()=>{const f=c.panelResponseText??"";if(!f)return[{title:c.panelQuery||"Prompt",content:""}];const d=ls(f);return d.length>0?d:[{title:c.panelQuery||"Response",content:os(f)}]}),{openFilmDetail:m,openBookDetail:g,openTVSeriesDetail:b,openImageDetail:p,openPlaceDetail:w,openSongDetail:$,openPodcastDetail:_}=$e();return(f,d)=>(s(),n("div",jr,[o.activeTab==="film"?(s(),q(is,{key:0,films:o.panelFilms,title:o.panelTitle,onSelectFilm:t(m)},null,8,["films","title","onSelectFilm"])):o.activeTab==="book"?(s(),q(Bs,{key:1,books:o.panelBooks,title:o.panelTitle,onSelectBook:t(g)},null,8,["books","title","onSelectBook"])):o.activeTab==="tvshow"?(s(),q(en,{key:2,series:o.panelTVSeries,title:o.panelTitle,onSelectSeries:t(b)},null,8,["series","title","onSelectSeries"])):o.activeTab==="image"?(s(),q(xn,{key:3,images:o.panelImages,title:o.panelTitle,onSelectImage:t(p)},null,8,["images","title","onSelectImage"])):o.activeTab==="place"?(s(),q(zn,{key:4,places:o.panelPlaces,title:o.panelTitle,onSelectPlace:t(w)},null,8,["places","title","onSelectPlace"])):o.activeTab==="song"?(s(),q(rs,{key:5,songs:o.panelSongs,title:o.panelTitle,onSelectSong:t($)},null,8,["songs","title","onSelectSong"])):o.activeTab==="magazine"?(s(),q(st,{key:6,sections:o.panelMagazineSections,"hero-image-url":o.panelMagazineHeroImage,title:o.panelTitle,query:o.panelQuery},null,8,["sections","hero-image-url","title","query"])):o.activeTab==="news"?(s(),q(nt,{key:7,articles:o.panelWebResults,title:o.panelTitle,query:o.panelQuery},null,8,["articles","title","query"])):o.activeTab==="websites"?(s(),q(nt,{key:8,articles:o.panelWebsites,title:o.panelTitle,variant:"websites"},null,8,["articles","title"])):o.activeTab==="podcast"?(s(),q(tl,{key:9,podcasts:o.panelPodcasts,title:o.panelTitle,onSelectPodcast:t(_)},null,8,["podcasts","title","onSelectPodcast"])):o.activeTab==="code"?(s(),q(Wl,{key:10,"is-wide-desktop":o.isWideDesktop,"is-mobile":o.isMobile},null,8,["is-wide-desktop","is-mobile"])):o.activeTab==="design-system"?(s(),q(ro,{key:11})):o.activeTab==="nostr"?(s(),q(Cr,{key:12})):o.activeTab==="prompt"?(s(),q(st,{key:13,sections:l.value,"hero-image-url":null,title:"Prompt",query:o.panelQuery},null,8,["sections","query"])):v("",!0)]))}}),Sr={class:"book-detail h-full overflow-y-auto overflow-x-hidden scrollbar-hide"},Mr={class:"relative w-full overflow-hidden"},Tr={class:"w-full aspect-[16/7] flex items-center justify-center overflow-hidden bg-black/20"},Ir=["src","alt"],Dr={class:"absolute bottom-0 left-0 right-0 p-4"},Br={class:"text-lg font-bold text-white"},Lr={class:"flex flex-wrap items-center gap-x-2 gap-y-0.5 mt-1 text-xs text-white/60"},Pr={key:0},Nr={key:1},zr={key:2,class:"text-amber-400"},Er={class:"p-4 space-y-4"},Ar={key:1,class:"flex flex-wrap gap-1.5"},Fr={class:"space-y-2"},Rr=["href"],Vr={class:"flex items-center gap-2.5"},Ur={class:"text-sm"},qr=["href"],Gr={class:"flex items-center gap-2.5"},Or={class:"text-sm"},Hr=G({__name:"BookDetail",props:{book:{}},emits:["back"],setup(o){const c=o,{isDark:l}=Z(),{bannerSrc:m,fallbackGradient:g,onBannerError:b}=bt({primaryUrls:()=>[c.book.coverUrl],apiFetch:async()=>({posterUrl:await rt(c.book.title,c.book.author),backdropUrl:null}),title:()=>c.book.title,gradientSeed:()=>c.book.title+(c.book.author??"")}),p=B(()=>`${c.book.title} ${c.book.author}`.trim().replace(/\s+/g,"+")),w=B(()=>[{name:"Open Library",url:`https://openlibrary.org/search?q=${p.value}`,icon:"📖",desc:"Free, open catalog"},{name:"Internet Archive",url:`https://archive.org/search?query=${p.value}`,icon:"🏛️",desc:"Borrow & read free"},{name:"Project Gutenberg",url:`https://www.gutenberg.org/ebooks/search/?query=${p.value}`,icon:"📜",desc:"Public domain"},{name:"Standard Ebooks",url:`https://standardebooks.org/ebooks?query=${p.value}`,icon:"📕",desc:"Beautifully formatted"}]);function $(_){return{openlibrary:"📖",gutenberg:"📜",archive:"🏛️",goodreads:"📚",libgen:"🔓",local:"💾"}[_]??"📚"}return(_,f)=>(s(),n("div",Sr,[e("div",Mr,[e("div",Tr,[t(m)?(s(),n("img",{key:0,src:t(m),alt:o.book.title,class:"w-full h-full object-cover object-center block",onError:f[0]||(f[0]=(...d)=>t(b)&&t(b)(...d))},null,40,Ir)):(s(),n("div",{key:1,class:"w-full h-full",style:W({background:t(g)})},null,4))]),f[3]||(f[3]=e("div",{class:"absolute inset-0 bg-gradient-to-t from-black/80 via-black/30 to-transparent pointer-events-none"},null,-1)),e("button",{class:"absolute top-3 left-3 min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg path-glass-icon z-10 transition-colors hover:bg-white/10",onClick:f[1]||(f[1]=d=>_.$emit("back"))},[...f[2]||(f[2]=[e("svg",{class:"w-4 h-4 text-white/90",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),e("div",Dr,[e("h2",Br,u(o.book.title),1),e("div",Lr,[e("span",null,u(o.book.author),1),o.book.year?(s(),n("span",Pr,u(o.book.year),1)):v("",!0),o.book.pages?(s(),n("span",Nr,u(o.book.pages)+" pages",1)):v("",!0),o.book.rating?(s(),n("span",zr,"★ "+u(o.book.rating.toFixed(1)),1)):v("",!0)])])]),e("div",Er,[o.book.description?(s(),n("p",{key:0,class:i(["text-sm leading-relaxed",t(l)?"text-white/70":"text-gray-600"])},u(o.book.description),3)):v("",!0),o.book.genres?.length?(s(),n("div",Ar,[(s(!0),n(D,null,N(o.book.genres,d=>(s(),n("span",{key:d,class:i(["text-xs px-2 py-1 rounded-md font-medium",t(l)?"bg-white/10 text-white/60":"bg-black/5 text-gray-600"])},u(d),3))),128))])):v("",!0),e("div",null,[e("h4",{class:i(["text-xs font-semibold mb-2",t(l)?"text-white/50":"text-gray-500"])},"Read on",2),e("div",Fr,[(s(!0),n(D,null,N(o.book.sources??[],d=>(s(),n("a",{key:d.url,href:d.url,target:"_blank",rel:"noopener",class:i(["flex items-center justify-between p-3 rounded-xl transition-colors",t(l)?"bg-white/5 hover:bg-white/10":"bg-black/3 hover:bg-black/5"])},[e("div",Vr,[e("span",Ur,u($(d.type)),1),e("p",{class:i(["text-xs font-medium",t(l)?"text-white/80":"text-gray-800"])},u(d.name),3)]),(s(),n("svg",{class:i(["w-4 h-4",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...f[4]||(f[4]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"},null,-1)])],2))],10,Rr))),128)),(s(!0),n(D,null,N(w.value,d=>(s(),n("a",{key:d.url,href:d.url,target:"_blank",rel:"noopener",class:i(["flex items-center justify-between p-3 rounded-xl transition-colors",t(l)?"bg-white/5 hover:bg-white/10":"bg-black/3 hover:bg-black/5"])},[e("div",Gr,[e("span",Or,u(d.icon),1),e("div",null,[e("p",{class:i(["text-xs font-medium",t(l)?"text-white/80":"text-gray-800"])},u(d.name),3),d.desc?(s(),n("p",{key:0,class:i(["text-xs",t(l)?"text-white/30":"text-gray-400"])},u(d.desc),3)):v("",!0)])]),(s(),n("svg",{class:i(["w-4 h-4",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...f[5]||(f[5]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"},null,-1)])],2))],10,qr))),128))])])])]))}}),Wr={class:"tv-detail h-full overflow-y-auto overflow-x-hidden scrollbar-hide"},Kr={class:"relative w-full overflow-hidden"},Yr={class:"w-full aspect-[16/7] flex items-center justify-center overflow-hidden bg-black/20"},Qr=["src","alt"],Jr={class:"absolute bottom-0 left-0 right-0 p-4"},Zr={class:"text-lg font-bold text-white"},Xr={class:"flex flex-wrap items-center gap-x-2 gap-y-0.5 mt-1 text-xs text-white/60"},ec={key:0},tc={key:1},sc={key:2},nc={key:3},lc={key:4,class:"text-amber-400"},oc={key:5,class:"text-emerald-400"},ac={key:6,class:"text-white/40"},ic={class:"p-4 space-y-4"},rc={key:3,class:"flex flex-wrap gap-1.5"},cc={class:"space-y-2"},dc=["href"],uc={class:"flex items-center gap-2.5"},hc={class:"text-sm"},xc=["href"],pc={class:"flex items-center gap-2.5"},gc={class:"text-sm"},bc=G({__name:"TVSeriesDetail",props:{series:{}},emits:["back"],setup(o){const c=o,{isDark:l}=Z(),{bannerSrc:m,fallbackGradient:g,onBannerError:b}=bt({primaryUrls:()=>[c.series.posterUrl,c.series.backdropUrl],apiFetch:()=>ct(c.series.title,c.series.year),title:()=>c.series.title}),p=B(()=>c.series.year?c.series.endYear&&c.series.endYear!==c.series.year?`${c.series.year}–${c.series.endYear}`:c.series.status==="ongoing"?`${c.series.year}–`:String(c.series.year):""),w=B(()=>c.series.title.trim().replace(/\s+/g,"+")),$=B(()=>(c.series.sources??[]).length>0?[]:[{name:"Internet Archive",url:`https://archive.org/search?query=${w.value}`,icon:"🏛️",desc:"Free, open archive"},{name:"YouTube",url:`https://youtube.com/results?search_query=${w.value}+full+series`,icon:"▶️",desc:"Free episodes"},{name:"Odysee",url:`https://odysee.com/$/search?q=${w.value}`,icon:"🔗",desc:"Decentralized"},{name:"Tubi",url:`https://tubitv.com/search/${w.value}`,icon:"📺",desc:"Free streaming"}]);function _(f){return{plex:"🟠",nextcloud:"☁️",youtube:"▶️",netflix:"🔴","free-web":"🌐",local:"💾"}[f]??"📺"}return(f,d)=>(s(),n("div",Wr,[e("div",Kr,[e("div",Yr,[t(m)?(s(),n("img",{key:0,src:t(m),alt:o.series.title,class:"w-full h-full object-cover object-center block",onError:d[0]||(d[0]=(...a)=>t(b)&&t(b)(...a))},null,40,Qr)):(s(),n("div",{key:1,class:"w-full h-full",style:W({background:t(g)})},null,4))]),d[3]||(d[3]=e("div",{class:"absolute inset-0 bg-gradient-to-t from-black/80 via-black/30 to-transparent pointer-events-none"},null,-1)),e("button",{class:"absolute top-3 left-3 min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg path-glass-icon z-10 transition-colors hover:bg-white/10",onClick:d[1]||(d[1]=a=>f.$emit("back"))},[...d[2]||(d[2]=[e("svg",{class:"w-4 h-4 text-white/90",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),e("div",Jr,[e("h2",Zr,u(o.series.title),1),e("div",Xr,[p.value?(s(),n("span",ec,u(p.value),1)):v("",!0),o.series.seasons?(s(),n("span",tc,u(o.series.seasons)+" seasons",1)):v("",!0),o.series.episodes?(s(),n("span",sc,u(o.series.episodes)+" episodes",1)):v("",!0),o.series.network?(s(),n("span",nc,u(o.series.network),1)):v("",!0),o.series.rating?(s(),n("span",lc,"★ "+u(o.series.rating.toFixed(1)),1)):v("",!0),o.series.status==="ongoing"?(s(),n("span",oc,"ongoing")):o.series.status==="ended"?(s(),n("span",ac,"ended")):v("",!0)])])]),e("div",ic,[o.series.synopsis?(s(),n("p",{key:0,class:i(["text-sm leading-relaxed",t(l)?"text-white/70":"text-gray-600"])},u(o.series.synopsis),3)):v("",!0),o.series.creator?(s(),n("div",{key:1,class:i(["text-xs",t(l)?"text-white/50":"text-gray-500"])},[d[4]||(d[4]=se(" Created by ",-1)),e("span",{class:i(["font-medium",t(l)?"text-white/70":"text-gray-700"])},u(o.series.creator),3)],2)):v("",!0),o.series.cast?.length?(s(),n("div",{key:2,class:i(["text-xs",t(l)?"text-white/50":"text-gray-500"])}," Starring: "+u(o.series.cast.slice(0,5).join(", ")),3)):v("",!0),o.series.genres?.length?(s(),n("div",rc,[(s(!0),n(D,null,N(o.series.genres,a=>(s(),n("span",{key:a,class:i(["text-xs px-2 py-1 rounded-md font-medium",t(l)?"bg-white/10 text-white/60":"bg-black/5 text-gray-600"])},u(a),3))),128))])):v("",!0),e("div",null,[e("h4",{class:i(["text-xs font-semibold mb-2",t(l)?"text-white/50":"text-gray-500"])},"Watch on",2),e("div",cc,[(s(!0),n(D,null,N(o.series.sources??[],a=>(s(),n("a",{key:a.url,href:a.url,target:"_blank",rel:"noopener",class:i(["flex items-center justify-between p-3 rounded-xl transition-colors",t(l)?"bg-white/5 hover:bg-white/10":"bg-black/3 hover:bg-black/5"])},[e("div",uc,[e("span",hc,u(_(a.type)),1),e("p",{class:i(["text-xs font-medium",t(l)?"text-white/80":"text-gray-800"])},u(a.name),3)]),(s(),n("svg",{class:i(["w-4 h-4",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...d[5]||(d[5]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"},null,-1)])],2))],10,dc))),128)),(s(!0),n(D,null,N($.value,a=>(s(),n("a",{key:a.url,href:a.url,target:"_blank",rel:"noopener",class:i(["flex items-center justify-between p-3 rounded-xl transition-colors",t(l)?"bg-white/5 hover:bg-white/10":"bg-black/3 hover:bg-black/5"])},[e("div",pc,[e("span",gc,u(a.icon),1),e("div",null,[e("p",{class:i(["text-xs font-medium",t(l)?"text-white/80":"text-gray-800"])},u(a.name),3),a.desc?(s(),n("p",{key:0,class:i(["text-xs",t(l)?"text-white/30":"text-gray-400"])},u(a.desc),3)):v("",!0)])]),(s(),n("svg",{class:i(["w-4 h-4",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...d[6]||(d[6]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"},null,-1)])],2))],10,xc))),128))])])])]))}}),vc={class:"podcast-detail h-full overflow-y-auto overflow-x-hidden scrollbar-hide"},fc={class:"relative w-full overflow-hidden"},mc={class:"w-full aspect-[16/7] flex items-center justify-center overflow-hidden bg-black/20"},wc=["src","alt"],yc={class:"absolute bottom-0 left-0 right-0 p-4"},kc={class:"text-lg font-bold text-white"},$c={class:"flex flex-wrap items-center gap-x-2 gap-y-0.5 mt-1 text-xs text-white/60"},_c={key:0},Cc={key:1},jc={key:2},Sc={class:"p-4 space-y-4"},Mc={key:1,class:"flex flex-wrap gap-1.5"},Tc={class:"space-y-2"},Ic=["href"],Dc={class:"flex items-center gap-2.5"},Bc={class:"text-sm"},Lc=["href"],Pc={class:"flex items-center gap-2.5"},Nc={class:"text-sm"},zc=G({__name:"PodcastDetail",props:{podcast:{}},emits:["back"],setup(o){const c=o,{isDark:l}=Z(),m=S(!1),g=S(null),b=B(()=>m.value?null:c.podcast.coverUrl||g.value||null);ne(()=>{c.podcast.coverUrl||xt(c.podcast.title,c.podcast.host).then(f=>{f&&(g.value=f)})});const p=B(()=>ht(c.podcast.title,c.podcast.host)),w=B(()=>`${c.podcast.title} ${c.podcast.host??""}`.trim().replace(/\s+/g,"+")),$=B(()=>c.podcast.sources.length>0?[]:[{name:"Fountain",url:`https://fountain.fm/search?q=${w.value}`,icon:"⚡",desc:"Podcasting 2.0, Lightning"},{name:"Podcast Index",url:`https://podcastindex.org/search?q=${w.value}`,icon:"📻",desc:"Open podcast directory"},{name:"YouTube",url:`https://youtube.com/results?search_query=${w.value}`,icon:"▶️",desc:"Video podcasts"},{name:"Rumble",url:`https://rumble.com/search/video?q=${w.value}`,icon:"📺",desc:"Video & podcasts"},{name:"Odysee",url:`https://odysee.com/$/search?q=${w.value}`,icon:"🔗",desc:"Decentralized"}]);function _(f){return{fountain:"⚡",rumble:"📺",youtube:"▶️",podcastindex:"📻",castopod:"🦣",odysee:"🔗",podverse:"🎧",ipfs:"🌐",rss:"📡"}[f]??"🎙️"}return(f,d)=>(s(),n("div",vc,[e("div",fc,[e("div",mc,[b.value?(s(),n("img",{key:0,src:b.value,alt:o.podcast.title,class:"w-full h-full object-cover object-center block",onError:d[0]||(d[0]=a=>m.value=!0)},null,40,wc)):(s(),n("div",{key:1,class:"w-full h-full bg-cover bg-center",style:W({backgroundImage:`url(${p.value})`})},null,4))]),d[3]||(d[3]=e("div",{class:"absolute inset-0 bg-gradient-to-t from-black/80 via-black/30 to-transparent pointer-events-none"},null,-1)),e("button",{class:"absolute top-3 left-3 min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg path-glass-icon z-10 transition-colors hover:bg-white/10",onClick:d[1]||(d[1]=a=>f.$emit("back"))},[...d[2]||(d[2]=[e("svg",{class:"w-4 h-4 text-white/90",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),e("div",yc,[e("h2",kc,u(o.podcast.title),1),e("div",$c,[o.podcast.host?(s(),n("span",_c,u(o.podcast.host),1)):v("",!0),o.podcast.year?(s(),n("span",Cc,u(o.podcast.year),1)):v("",!0),o.podcast.episodeCount?(s(),n("span",jc,u(o.podcast.episodeCount)+" episodes",1)):v("",!0)])])]),e("div",Sc,[o.podcast.description?(s(),n("p",{key:0,class:i(["text-sm leading-relaxed",t(l)?"text-white/70":"text-gray-600"])},u(o.podcast.description),3)):v("",!0),o.podcast.genres?.length?(s(),n("div",Mc,[(s(!0),n(D,null,N(o.podcast.genres,a=>(s(),n("span",{key:a,class:i(["text-xs px-2 py-1 rounded-md font-medium",t(l)?"bg-white/10 text-white/60":"bg-black/5 text-gray-600"])},u(a),3))),128))])):v("",!0),e("div",null,[e("h4",{class:i(["text-xs font-semibold mb-2",t(l)?"text-white/50":"text-gray-500"])},"Listen on",2),e("div",Tc,[(s(!0),n(D,null,N(o.podcast.sources,a=>(s(),n("a",{key:a.url,href:a.url,target:"_blank",rel:"noopener",class:i(["flex items-center justify-between p-3 rounded-xl transition-colors",t(l)?"bg-white/5 hover:bg-white/10":"bg-black/3 hover:bg-black/5"])},[e("div",Dc,[e("span",Bc,u(_(a.type)),1),e("p",{class:i(["text-xs font-medium",t(l)?"text-white/80":"text-gray-800"])},u(a.name),3)]),(s(),n("svg",{class:i(["w-4 h-4",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...d[4]||(d[4]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"},null,-1)])],2))],10,Ic))),128)),$.value.length?(s(!0),n(D,{key:0},N($.value,a=>(s(),n("a",{key:a.url,href:a.url,target:"_blank",rel:"noopener",class:i(["flex items-center justify-between p-3 rounded-xl transition-colors",t(l)?"bg-white/5 hover:bg-white/10":"bg-black/3 hover:bg-black/5"])},[e("div",Pc,[e("span",Nc,u(a.icon),1),e("div",null,[e("p",{class:i(["text-xs font-medium",t(l)?"text-white/80":"text-gray-800"])},u(a.name),3),a.desc?(s(),n("p",{key:0,class:i(["text-xs",t(l)?"text-white/30":"text-gray-400"])},u(a.desc),3)):v("",!0)])]),(s(),n("svg",{class:i(["w-4 h-4",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...d[5]||(d[5]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"},null,-1)])],2))],10,Lc))),128)):v("",!0)])])])]))}}),Ec={class:"image-detail h-full overflow-y-auto overflow-x-hidden scrollbar-hide"},Ac={class:"relative w-full overflow-hidden bg-black/20"},Fc=["src","alt"],Rc={class:"p-4 space-y-3"},Vc={class:"pt-2"},Uc=["href"],qc=G({__name:"ImageDetail",props:{image:{}},emits:["back"],setup(o){const{isDark:c}=Z(),l=S(!1);return(m,g)=>(s(),n("div",Ec,[e("div",Ac,[l.value?(s(),n("div",{key:1,class:i(["w-full aspect-video flex items-center justify-center",t(c)?"bg-white/5":"bg-black/5"])},[(s(),n("svg",{class:i(["w-12 h-12",t(c)?"text-white/15":"text-gray-300"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...g[2]||(g[2]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"},null,-1)])],2))],2)):(s(),n("img",{key:0,src:o.image.url,alt:o.image.alt||o.image.title||"Image",class:"w-full block max-h-[60vh] object-contain bg-black/40",onError:g[0]||(g[0]=b=>l.value=!0)},null,40,Fc)),e("button",{class:"absolute top-3 left-3 min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg path-glass-icon z-10 transition-colors hover:bg-white/10",onClick:g[1]||(g[1]=b=>m.$emit("back"))},[...g[3]||(g[3]=[e("svg",{class:"w-4 h-4 text-white/90",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])])]),e("div",Rc,[o.image.title?(s(),n("h2",{key:0,class:i(["text-base font-bold",t(c)?"text-white/90":"text-gray-900"])},u(o.image.title),3)):v("",!0),o.image.description?(s(),n("p",{key:1,class:i(["text-sm leading-relaxed",t(c)?"text-white/70":"text-gray-600"])},u(o.image.description),3)):v("",!0),o.image.attribution?(s(),n("div",{key:2,class:i(["text-xs",t(c)?"text-white/50":"text-gray-500"])},u(o.image.attribution),3)):v("",!0),o.image.source?(s(),n("div",{key:3,class:i(["text-xs",t(c)?"text-white/40":"text-gray-400"])}," Source: "+u(o.image.source),3)):v("",!0),o.image.width&&o.image.height?(s(),n("div",{key:4,class:i(["text-xs",t(c)?"text-white/30":"text-gray-400"])},u(o.image.width)+" × "+u(o.image.height),3)):v("",!0),e("div",Vc,[e("a",{href:o.image.url,target:"_blank",rel:"noopener",class:i(["inline-flex items-center gap-2 px-4 min-h-[44px] rounded-xl text-xs font-medium transition-colors",t(c)?"bg-white/5 hover:bg-white/10 text-white/80":"bg-black/3 hover:bg-black/5 text-gray-800"])},[...g[4]||(g[4]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1),se(" Open original ",-1)])],10,Uc)])])]))}}),Gc={class:"place-detail h-full overflow-y-auto overflow-x-hidden scrollbar-hide"},Oc={class:"relative w-full overflow-hidden"},Hc={class:"w-full aspect-[16/9] flex items-center justify-center overflow-hidden bg-black/20"},Wc=["src","alt"],Kc=["src","alt"],Yc={class:"absolute bottom-0 left-0 right-0 p-4"},Qc={class:"text-lg font-bold text-white"},Jc={class:"flex flex-wrap items-center gap-x-2 gap-y-0.5 mt-1 text-xs text-white/60"},Zc={key:0},Xc={key:1},ed={key:2,class:"text-amber-400"},td={key:3,class:"text-white/50"},sd={class:"p-4 space-y-4"},nd={key:1,class:"flex items-start gap-2.5"},ld={key:2,class:"flex items-center gap-2.5"},od={key:3,class:"flex items-start gap-2.5"},ad={key:4,class:"flex items-center gap-2.5"},id=["href"],rd={class:"space-y-2"},cd=["href"],dd={class:"flex items-center gap-2.5"},ud={class:"text-sm"},hd=["href"],xd={class:"flex items-center gap-2.5"},pd={class:"text-sm"},gd=G({__name:"PlaceDetail",props:{place:{}},emits:["back"],setup(o){const c=o,{isDark:l}=Z(),m=S(null),g=B(()=>dt(c.place.name,c.place.cuisine||c.place.category));ne(()=>{c.place.photoUrl||ut(c.place.name,c.place.city).then(_=>{_&&(m.value=_)})});const b=B(()=>{if(!c.place.website)return"";try{return new URL(c.place.website).hostname.replace(/^www\./,"")}catch{return c.place.website}}),p=B(()=>`${c.place.name} ${c.place.city??""}`.trim().replace(/\s+/g,"+")),w=B(()=>{if((c.place.sources??[]).length>0)return[];const _=[{name:"OpenStreetMap",url:`https://www.openstreetmap.org/search?query=${p.value}`,icon:"🗺️",desc:"Open source maps"},{name:"Google Maps",url:`https://www.google.com/maps/search/${p.value}`,icon:"📍",desc:"Directions & reviews"}];return c.place.lat&&c.place.lng&&(_.unshift({name:"OpenStreetMap",url:`https://www.openstreetmap.org/?mlat=${c.place.lat}&mlon=${c.place.lng}#map=17/${c.place.lat}/${c.place.lng}`,icon:"🗺️",desc:"Open source maps"}),_.splice(2)),_});function $(_){return{gmaps:"📍",osm:"🗺️",yelp:"⭐",tripadvisor:"🦉",foursquare:"📌",local:"💾"}[_]??"📍"}return(_,f)=>(s(),n("div",Gc,[e("div",Oc,[e("div",Hc,[o.place.photoUrl||m.value?(s(),n("img",{key:0,src:o.place.photoUrl||m.value,alt:o.place.name,class:"w-full h-full object-cover object-center block"},null,8,Wc)):(s(),n("img",{key:1,src:g.value,alt:o.place.name,class:"w-full h-full object-cover"},null,8,Kc))]),f[2]||(f[2]=e("div",{class:"absolute inset-0 bg-gradient-to-t from-black/80 via-black/30 to-transparent pointer-events-none"},null,-1)),e("button",{class:"absolute top-3 left-3 min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg path-glass-icon z-10 transition-colors hover:bg-white/10",onClick:f[0]||(f[0]=d=>_.$emit("back"))},[...f[1]||(f[1]=[e("svg",{class:"w-4 h-4 text-white/90",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),e("div",Yc,[e("h2",Qc,u(o.place.name),1),e("div",Jc,[o.place.cuisine||o.place.category?(s(),n("span",Zc,u(o.place.cuisine||o.place.category),1)):v("",!0),o.place.city?(s(),n("span",Xc,u(o.place.city),1)):v("",!0),o.place.rating?(s(),n("span",ed,"★ "+u(o.place.rating.toFixed(1)),1)):v("",!0),o.place.priceLevel?(s(),n("span",td,u("$".repeat(o.place.priceLevel)),1)):v("",!0)])])]),e("div",sd,[o.place.description?(s(),n("p",{key:0,class:i(["text-sm leading-relaxed",t(l)?"text-white/70":"text-gray-600"])},u(o.place.description),3)):v("",!0),o.place.address?(s(),n("div",nd,[(s(),n("svg",{class:i(["w-4 h-4 shrink-0 mt-0.5",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...f[3]||(f[3]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"},null,-1),e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"},null,-1)])],2)),e("span",{class:i(["text-xs",t(l)?"text-white/60":"text-gray-600"])},u(o.place.address),3)])):v("",!0),o.place.phone?(s(),n("div",ld,[(s(),n("svg",{class:i(["w-4 h-4 shrink-0",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...f[4]||(f[4]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"},null,-1)])],2)),e("span",{class:i(["text-xs",t(l)?"text-white/60":"text-gray-600"])},u(o.place.phone),3)])):v("",!0),o.place.hours?(s(),n("div",od,[(s(),n("svg",{class:i(["w-4 h-4 shrink-0 mt-0.5",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...f[5]||(f[5]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])],2)),e("span",{class:i(["text-xs",t(l)?"text-white/60":"text-gray-600"])},u(o.place.hours),3)])):v("",!0),o.place.website?(s(),n("div",ad,[(s(),n("svg",{class:i(["w-4 h-4 shrink-0",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...f[6]||(f[6]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"},null,-1)])],2)),e("a",{href:o.place.website,target:"_blank",rel:"noopener",class:i(["text-xs underline underline-offset-2",t(l)?"text-white/60 hover:text-white/80":"text-gray-600 hover:text-gray-800"])},u(b.value),11,id)])):v("",!0),e("div",null,[e("h4",{class:i(["text-xs font-semibold mb-2",t(l)?"text-white/50":"text-gray-500"])},"Find on",2),e("div",rd,[(s(!0),n(D,null,N(o.place.sources??[],d=>(s(),n("a",{key:d.url,href:d.url,target:"_blank",rel:"noopener",class:i(["flex items-center justify-between p-3 rounded-xl transition-colors",t(l)?"bg-white/5 hover:bg-white/10":"bg-black/3 hover:bg-black/5"])},[e("div",dd,[e("span",ud,u($(d.type)),1),e("p",{class:i(["text-xs font-medium",t(l)?"text-white/80":"text-gray-800"])},u(d.name),3)]),(s(),n("svg",{class:i(["w-4 h-4",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...f[7]||(f[7]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"},null,-1)])],2))],10,cd))),128)),(s(!0),n(D,null,N(w.value,d=>(s(),n("a",{key:d.url,href:d.url,target:"_blank",rel:"noopener",class:i(["flex items-center justify-between p-3 rounded-xl transition-colors",t(l)?"bg-white/5 hover:bg-white/10":"bg-black/3 hover:bg-black/5"])},[e("div",xd,[e("span",pd,u(d.icon),1),e("div",null,[e("p",{class:i(["text-xs font-medium",t(l)?"text-white/80":"text-gray-800"])},u(d.name),3),d.desc?(s(),n("p",{key:0,class:i(["text-xs",t(l)?"text-white/30":"text-gray-400"])},u(d.desc),3)):v("",!0)])]),(s(),n("svg",{class:i(["w-4 h-4",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...f[8]||(f[8]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"},null,-1)])],2))],10,hd))),128))])])])]))}}),bd={class:"article-detail h-full overflow-y-auto overflow-x-hidden scrollbar-hide"},vd={class:"relative w-full overflow-hidden aspect-[16/7] shrink-0"},fd=["src","alt"],md={class:"absolute bottom-0 left-0 right-0 p-4"},wd={class:"text-lg font-bold text-white"},yd={key:0,class:"text-xs text-white/60 mt-1"},kd={class:"p-4 space-y-4"},$d={key:0,class:"text-white/90 [&_p]:mb-3 [&_ul]:list-disc [&_ol]:list-decimal [&_li]:ml-4 [&_a]:underline [&_a]:underline-offset-2 [&_h1]:text-lg [&_h2]:text-base [&_h3]:text-sm [&_blockquote]:border-l-2 [&_blockquote]:pl-3 [&_blockquote]:italic"},_d=["innerHTML"],Cd={key:1,class:"py-4"},jd=["href"],Sd=G({__name:"ArticleDetail",props:{article:{}},emits:["back"],setup(o){const c=o,l=B(()=>{const b=c.article?.url;if(!b||typeof b!="string")return"";try{const p=new URL(b);return/^https?:$/i.test(p.protocol)?p.hostname.replace(/^www\./,""):""}catch{return""}}),m=B(()=>{const b=[...c.article.title].reduce((p,w)=>p+w.charCodeAt(0),0)%360;return`linear-gradient(135deg, hsl(${b}, 25%, 12%) 0%, hsl(${(b+40)%360}, 20%, 8%) 100%)`}),g=B(()=>{const b=c.article.content;return b?/<[a-z][\s\S]*>/i.test(b)?Yt(b):`

${Qt(b)}

`:""});return(b,p)=>(s(),n("div",bd,[e("div",vd,[o.article.imgSrc&&t(Kt)(o.article.imgSrc)?(s(),n("img",{key:0,src:o.article.imgSrc,alt:o.article.title,class:"absolute inset-0 w-full h-full object-cover object-center block"},null,8,fd)):(s(),n("div",{key:1,class:"absolute inset-0",style:W({background:m.value})},null,4)),p[2]||(p[2]=e("div",{class:"absolute inset-0 bg-gradient-to-t from-black/80 via-black/30 to-transparent pointer-events-none"},null,-1)),e("button",{class:"absolute top-3 left-3 p-2 rounded-lg path-glass-icon z-10 transition-colors hover:bg-white/10 text-white/80",onClick:p[0]||(p[0]=w=>b.$emit("back"))},[...p[1]||(p[1]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),e("div",md,[e("h2",wd,u(o.article.title),1),l.value?(s(),n("p",yd,u(l.value),1)):v("",!0)])]),e("div",kd,[o.article.content?(s(),n("article",$d,[e("div",{innerHTML:g.value},null,8,_d)])):(s(),n("div",Cd,[...p[3]||(p[3]=[e("p",{class:"text-sm text-white/50"}," Full article content is not available. Open the link below to read on the source site. ",-1)])])),o.article.url?(s(),n("a",{key:2,href:o.article.url,target:"_blank",rel:"noopener noreferrer",class:"inline-flex items-center gap-2 p-3 rounded-xl transition-colors bg-white/10 hover:bg-white/15 text-white/90"},[...p[4]||(p[4]=[e("svg",{class:"w-4 h-4 shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1),se(" Read full article ",-1)])],8,jd)):v("",!0)])]))}}),Md={class:"website-detail h-full flex flex-col overflow-hidden"},Td={class:"flex-1 min-w-0 pl-8"},Id=["href"],Dd={class:"flex-1 min-h-0 relative bg-black/20"},Bd=["src"],Ld=G({__name:"WebsiteDetail",props:{website:{}},emits:["back"],setup(o){const c=o,{isDark:l}=Z(),m=B(()=>{if(!c.website.url)return"";try{return new URL(c.website.url).hostname.replace(/^www\./,"")}catch{return""}});return(g,b)=>(s(),n("div",Md,[e("div",{class:"shrink-0 flex items-center gap-2 px-3 py-2.5",style:W(t(l)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("button",{class:"absolute top-3 left-3 p-2 rounded-lg path-glass-icon z-10 transition-colors hover:bg-white/10",onClick:b[0]||(b[0]=p=>g.$emit("back"))},[...b[2]||(b[2]=[e("svg",{class:"w-4 h-4 text-white/90",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),e("div",Td,[e("p",{class:i(["text-sm font-medium truncate",t(l)?"text-white/90":"text-gray-900"])},u(o.website.title||"Website"),3),m.value?(s(),n("p",{key:0,class:i(["text-xs truncate",t(l)?"text-white/30":"text-gray-400"])},u(m.value),3)):v("",!0)]),e("a",{href:o.website.url,target:"_blank",rel:"noopener noreferrer",class:i(["flex items-center justify-center w-8 h-8 rounded-lg transition-colors shrink-0",t(l)?"hover:bg-white/10 text-white/50":"hover:bg-black/5 text-gray-400"]),"aria-label":"Open in new tab",title:"Open in new tab",onClick:b[1]||(b[1]=we(()=>{},["stop"]))},[...b[3]||(b[3]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1)])],10,Id)],4),e("div",Dd,[(s(),n("iframe",{key:o.website.url,src:o.website.url,class:"absolute inset-0 w-full h-full border-0",style:{"-ms-overflow-style":"none","scrollbar-width":"none"},title:"Website content"},null,8,Bd))])]))}}),Pd=Ie(Ld,[["__scopeId","data-v-0f5111f5"]]),Nd={class:"flex-1 text-center pl-8"},zd={class:"flex-1 min-h-0 overflow-y-auto custom-scrollbar flex flex-col"},Ed={class:"px-6 py-8 md:px-8 md:py-10 max-w-lg mx-auto my-auto"},Ad={class:"space-y-4"},Fd=["href"],Rd={class:"flex items-center gap-1"},Vd=G({__name:"MagazineSectionDetail",props:{section:{},currentIndex:{},totalSections:{}},emits:["back","navigate"],setup(o){const c=o,{isDark:l}=Z(),m=B(()=>c.section.content.replace(/\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/https?:\/\/\S+/g,"").replace(/\uFE0F/g,"").replace(/\*\*/g,"").replace(/\*([^*\n]+)\*/g,"$1").replace(new RegExp("(?:^|(?<=\\s))[\\p{Emoji_Presentation}\\p{Extended_Pictographic}]+\\s*","gu"),"").replace(/---+/g,"").replace(/^#+\s*/gm,"").replace(/\|/g,", ").replace(/,\s*,+/g,",").split(/\n{2,}|\n\s*[-•]\s+/).map(b=>b.replace(/^\s*[-•]\s+/,"").replace(/(^|\n)\s*,\s*/g,"$1").trim()).filter(b=>b.length>0));return(g,b)=>(s(),n("div",{class:i(["magazine-section-detail h-full flex flex-col overflow-hidden",t(l)?"bg-[#0a0a0a]":"bg-[#faf9f6]"]),style:{"font-family":"Georgia, 'Times New Roman', Times, serif"}},[e("div",{class:"shrink-0 flex items-center justify-between px-4 py-3",style:W(t(l)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("button",{class:"absolute top-3 left-3 min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg path-glass-icon z-10 transition-colors hover:bg-white/10",onClick:b[0]||(b[0]=p=>g.$emit("back"))},[(s(),n("svg",{class:i(["w-4 h-4",t(l)?"text-white/70":"text-gray-600"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...b[3]||(b[3]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])],2))]),e("div",Nd,[e("span",{class:i(["text-xs uppercase tracking-[0.3em] font-semibold",t(l)?"text-white/30":"text-black/30"])}," AI Brief ",2)]),e("span",{class:i(["text-xs font-mono tabular-nums shrink-0",t(l)?"text-white/25":"text-black/25"])},u(o.currentIndex+1)+"/"+u(o.totalSections),3)],4),e("div",zd,[e("div",Ed,[o.section.group?(s(),n("p",{key:0,class:i(["text-xs uppercase tracking-[0.3em] font-semibold mb-4",t(l)?"text-white/25":"text-black/30"])},u(o.section.group),3)):v("",!0),e("h2",{class:i(["text-2xl md:text-3xl font-bold leading-tight mb-4",t(l)?"text-white/95":"text-black/90"])},u(o.section.title),3),o.section.author?(s(),n("p",{key:1,class:i(["text-xs mb-6",t(l)?"text-white/40":"text-black/40"])}," By "+u(o.section.author),3)):v("",!0),e("div",{class:i(["w-12 h-px mb-6",t(l)?"bg-white/15":"bg-black/15"])},null,2),e("div",Ad,[(s(!0),n(D,null,N(m.value,(p,w)=>(s(),n("p",{key:w,class:i(["text-base md:text-lg leading-relaxed",t(l)?"text-white/75":"text-black/65"])},u(p),3))),128))]),o.section.url?(s(),n("a",{key:2,href:o.section.url,target:"_blank",rel:"noopener noreferrer",class:i(["inline-flex items-center gap-2 mt-6 min-h-[44px] text-xs transition-colors",t(l)?"text-white/40 hover:text-white/70":"text-black/40 hover:text-black/70"])},[...b[4]||(b[4]=[e("svg",{class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1),se(" Source ",-1)])],10,Fd)):v("",!0)])]),e("div",{class:"shrink-0 flex items-center justify-between px-4 py-3",style:W(t(l)?"border-top: 1px solid rgba(255, 255, 255, 0.08)":"border-top: 1px solid rgba(0, 0, 0, 0.06)")},[e("button",{class:i(["flex items-center gap-1.5 px-3 min-h-[44px] rounded-lg text-xs transition-colors",t(l)?"text-white/50 hover:text-white/80 hover:bg-white/5":"text-black/40 hover:text-black/70 hover:bg-black/5"]),onClick:b[1]||(b[1]=p=>g.$emit("navigate","prev"))},[...b[5]||(b[5]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1),se(" Prev ",-1)])],2),e("div",Rd,[(s(!0),n(D,null,N(o.totalSections,p=>(s(),n("div",{key:p,class:i(["w-1.5 h-1.5 rounded-full transition-all duration-200",p-1===o.currentIndex?t(l)?"bg-white/70 scale-125":"bg-black/60 scale-125":t(l)?"bg-white/15":"bg-black/15"])},null,2))),128))]),e("button",{class:i(["flex items-center gap-1.5 px-3 min-h-[44px] rounded-lg text-xs transition-colors",t(l)?"text-white/50 hover:text-white/80 hover:bg-white/5":"text-black/40 hover:text-black/70 hover:bg-black/5"]),onClick:b[2]||(b[2]=p=>g.$emit("navigate","next"))},[...b[6]||(b[6]=[se(" Next ",-1),e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1)])],2)],4)],2))}}),Ud={class:"flex-1 min-w-0 pl-8"},qd={class:"flex items-center gap-2"},Gd={class:"flex-1 min-h-0 overflow-auto custom-scrollbar"},Od={key:0,class:"font-mono text-xs leading-relaxed"},Hd={class:"w-full border-collapse"},Wd={key:1,class:"flex items-center justify-center h-full"},Kd={class:"text-center space-y-3 px-6"},Yd=G({__name:"CodeDetail",emits:["back"],setup(o){const{isDark:c}=Z(),{activeFile:l,activeFileContent:m,activeFileLanguage:g,activeProject:b}=xe(),p=B(()=>m.value),w=B(()=>g.value),$=B(()=>l.value??""),_=B(()=>$.value.split("/").pop()??""),f=B(()=>b.value?.name??""),d=B(()=>p.value?p.value.split(` -`):[]);return(a,r)=>(s(),n("div",{class:i(["code-detail h-full flex flex-col overflow-hidden",t(c)?"bg-[#1a1a2e]":"bg-[#fafafa]"])},[e("div",{class:"shrink-0 flex items-center gap-2 px-3 py-2",style:W(t(c)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("button",{class:"absolute top-3 left-3 p-2 rounded-lg path-glass-icon z-10 transition-colors hover:bg-white/10",onClick:r[0]||(r[0]=h=>a.$emit("back"))},[(s(),n("svg",{class:i(["w-4 h-4",t(c)?"text-white/70":"text-gray-600"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...r[1]||(r[1]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])],2))]),e("div",Ud,[e("div",qd,[e("span",{class:i(["shrink-0 text-xs px-1.5 py-0.5 rounded font-mono",t(c)?"bg-white/10 text-white/50":"bg-black/5 text-gray-500"])},u(w.value),3),e("p",{class:i(["text-xs font-mono truncate",t(c)?"text-white/70":"text-gray-700"])},u(_.value),3)]),f.value?(s(),n("p",{key:0,class:i(["text-xs font-mono mt-0.5 truncate",t(c)?"text-white/25":"text-gray-400"])},u(f.value)+" / "+u($.value),3)):v("",!0)])],4),e("div",Gd,[p.value?(s(),n("div",Od,[e("table",Hd,[e("tbody",null,[(s(!0),n(D,null,N(d.value,(h,M)=>(s(),n("tr",{key:M,class:"hover:bg-white/[0.03]"},[e("td",{class:i(["select-none text-right pr-4 pl-4 py-0 align-top w-1",t(c)?"text-white/15":"text-gray-300"]),style:{"min-width":"3rem"}},u(M+1),3),e("td",{class:i(["pr-4 py-0 whitespace-pre",t(c)?"text-white/75":"text-gray-700"])},u(h),3)]))),128))])])])):(s(),n("div",Wd,[e("div",Kd,[e("div",{class:i(["w-16 h-16 rounded-2xl flex items-center justify-center mx-auto",t(c)?"bg-white/5":"bg-black/5"])},[(s(),n("svg",{class:i(["w-7 h-7",t(c)?"text-white/20":"text-gray-300"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...r[2]||(r[2]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"},null,-1)])],2))],2),e("p",{class:i(["text-xs",t(c)?"text-white/30":"text-gray-400"])}," Select a file to view its contents. ",2)])]))])],2))}}),Qd=Ie(Yd,[["__scopeId","data-v-7f40c0bc"]]),Jd={class:"h-full overflow-y-auto overflow-x-hidden scrollbar-hide"},Zd={class:"min-w-0 flex-1"},Xd={class:"p-4 space-y-4"},eu={key:0,class:"space-y-2"},tu={key:1,class:"space-y-2"},su={key:2,class:"flex items-end gap-2"},nu={key:0,class:"text-[7px] text-accent font-mono"},lu={key:3,class:"space-y-2"},ou={key:0,class:"flex gap-3"},au={key:1,class:"flex gap-3"},iu={key:2,class:"flex gap-3"},ru={key:3,class:"flex flex-wrap gap-1.5"},cu={key:4},du={class:"glass-card p-4"},uu={key:5,class:"flex gap-1.5"},hu={key:6},xu={key:7,class:"space-y-2"},pu={key:8},gu={key:9,class:"space-y-1.5"},bu={class:"flex items-center gap-2.5"},vu={key:10},fu={key:11,class:"flex gap-2"},mu={class:"absolute bottom-0 left-0 right-0 p-1.5"},wu={class:"text-xs text-white/80 font-medium truncate"},yu={key:12,class:"space-y-2"},ku={class:"flex justify-end"},$u={class:"flex justify-start"},_u={key:13,class:"space-y-2"},Cu={class:"grid grid-cols-3 gap-1"},ju={key:14,class:"space-y-2"},Su={class:"space-y-1 px-1"},Mu={key:15},Tu={key:16},Iu={class:"flex items-start gap-2.5"},Du={class:"min-w-0 flex-1"},Bu={class:"flex items-center gap-1.5"},Lu={class:"flex gap-3 mt-1.5"},Pu={key:17,class:"flex flex-col items-center gap-2"},Nu={key:18,class:"flex flex-col items-center gap-2"},zu={key:19,class:"text-center py-4"},Eu={key:0},Au=G({__name:"DesignSystemDetail",props:{item:{}},emits:["back"],setup(o){const c=o,{isDark:l}=Z(),m=S(!1),g=S(0),b=S(0),p={colors:"Colors",typography:"Typography",spacing:"Spacing",atoms:"Atoms",molecules:"Molecules",organisms:"Organisms"},w=B(()=>p[c.item.category]??c.item.category),$=B(()=>c.item.id==="type-mono"?{fontFamily:'Menlo, Monaco, "Courier New", monospace'}:c.item.id==="type-serif"?{fontFamily:'Georgia, "Times New Roman", Times, serif'}:{fontFamily:"Inter, system-ui, -apple-system, sans-serif"});function _(d){const a=/(?:background-color|color|background):\s*([^;]+)/i.exec(d);return a?a[1].trim():"#333"}async function f(){try{await navigator.clipboard.writeText(c.item.code),m.value=!0,setTimeout(()=>{m.value=!1},2e3)}catch{}}return(d,a)=>(s(),n("div",Jd,[e("div",{class:"shrink-0 px-4 py-3 flex items-center gap-3",style:W(t(l)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("button",{class:i(["min-w-[44px] min-h-[44px] rounded-lg path-glass-icon flex items-center justify-center transition-colors shrink-0",t(l)?"hover:bg-white/10":"hover:bg-black/5"]),onClick:a[0]||(a[0]=r=>d.$emit("back"))},[(s(),n("svg",{class:i(["w-3.5 h-3.5",t(l)?"text-white/70":"text-gray-500"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...a[3]||(a[3]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])],2))],2),e("div",Zd,[e("h2",{class:i(["text-sm font-semibold truncate",t(l)?"text-white/90":"text-gray-900"])},u(o.item.name),3),e("p",{class:i(["text-xs",t(l)?"text-white/40":"text-gray-400"])},u(w.value),3)]),e("button",{class:i(["text-xs px-2 py-1 rounded-md transition-colors",m.value?"bg-emerald-500/20 text-emerald-400":t(l)?"bg-white/5 text-white/50 hover:bg-white/10":"bg-black/5 text-gray-500 hover:bg-black/10"]),onClick:f},u(m.value?"Copied":"Copy"),3)],4),e("div",Xd,[e("p",{class:i(["text-sm leading-relaxed",t(l)?"text-white/60":"text-gray-600"])},u(o.item.description),3),e("div",null,[e("h4",{class:i(["text-xs uppercase tracking-[0.2em] font-semibold mb-2",t(l)?"text-white/30":"text-gray-400"])}," Preview ",2),e("div",{class:i(["rounded-xl p-4 overflow-hidden",t(l)?"bg-white/[0.03] border border-white/10":"bg-black/[0.02] border border-black/10"])},[o.item.category==="colors"?(s(),n("div",eu,[e("div",{class:i(["h-12 rounded-lg border",t(l)?"border-white/10":"border-black/10"]),style:W({background:_(o.item.code)})},null,6),e("p",{class:i(["text-xs font-mono text-center",t(l)?"text-white/40":"text-gray-400"])},u(_(o.item.code)),3)])):o.item.category==="typography"?(s(),n("div",tu,[e("p",{class:i(["text-2xl font-bold",t(l)?"text-white/90":"text-gray-900"]),style:W($.value)}," Aa Bb Cc 123 ",6),e("p",{class:i(["text-sm",t(l)?"text-white/60":"text-gray-600"]),style:W($.value)}," The quick brown fox jumps over the lazy dog. ",6)])):o.item.category==="spacing"?(s(),n("div",su,[(s(),n(D,null,N([4,8,12,16,20,24,32],(r,h)=>e("div",{key:h,class:"bg-accent/30 rounded-sm flex items-center justify-center",style:W({width:`${r}px`,height:`${r}px`})},[r>=16?(s(),n("span",nu,u(r),1)):v("",!0)],4)),64))])):(s(),n("div",lu,[o.item.id==="atom-glass-btn"?(s(),n("div",ou,[...a[4]||(a[4]=[e("button",{class:"glass-button text-sm"},"Action",-1),e("button",{class:"glass-button text-sm opacity-50 cursor-not-allowed"},"Disabled",-1)])])):o.item.id==="atom-glass-btn-sm"?(s(),n("div",au,[...a[5]||(a[5]=[e("button",{class:"glass-button glass-button-sm text-xs"},"Small",-1),e("button",{class:"glass-button glass-button-sm text-xs opacity-50 cursor-not-allowed"},"Disabled",-1)])])):o.item.id==="atom-icon-btn"?(s(),n("div",iu,[e("button",{class:i(["w-9 h-9 rounded-xl path-glass-icon flex items-center justify-center",t(l)?"text-white/70":"text-gray-500"])},[...a[6]||(a[6]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1)])],2),e("button",{class:i(["w-9 h-9 rounded-xl path-glass-icon flex items-center justify-center",t(l)?"text-white/70":"text-gray-500"])},[...a[7]||(a[7]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)])],2),e("button",{class:i(["w-9 h-9 rounded-xl path-glass-icon flex items-center justify-center",t(l)?"text-white/70":"text-gray-500"])},[...a[8]||(a[8]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])],2)])):o.item.id==="atom-badge"?(s(),n("div",ru,[e("span",{class:i(["text-xs px-2 py-1 rounded-md font-medium",t(l)?"bg-white/10 text-white/60":"bg-black/5 text-gray-600"])},"Science Fiction",2),e("span",{class:i(["text-xs px-2 py-1 rounded-md font-medium",t(l)?"bg-white/10 text-white/60":"bg-black/5 text-gray-600"])},"Drama",2),e("span",{class:i(["text-xs px-2 py-1 rounded-md font-medium",t(l)?"bg-white/10 text-white/60":"bg-black/5 text-gray-600"])},"Thriller",2)])):o.item.id==="mol-glass-card"?(s(),n("div",cu,[e("div",du,[e("h3",{class:i(["text-sm font-semibold mb-1",t(l)?"text-white/90":"text-gray-900"])},"Glass Card",2),e("p",{class:i(["text-xs",t(l)?"text-white/60":"text-gray-500"])},"Content with frosted glass background and subtle border.",2)])])):o.item.id==="atom-nav-tab"?(s(),n("div",uu,[a[9]||(a[9]=e("button",{class:"text-xs px-2.5 py-1 rounded-md font-medium bg-accent/20 text-accent"},"Films",-1)),e("button",{class:i(["text-xs px-2.5 py-1 rounded-md font-medium",t(l)?"bg-white/5 text-white/50":"bg-black/5 text-gray-500"])},"Songs",2),e("button",{class:i(["text-xs px-2.5 py-1 rounded-md font-medium",t(l)?"bg-white/5 text-white/50":"bg-black/5 text-gray-500"])},"Podcasts",2)])):o.item.id==="atom-input"?(s(),n("div",hu,[e("input",{class:i(["w-full px-3 py-2 rounded-lg text-base outline-none transition-colors",t(l)?"bg-white/5 text-white/80 placeholder:text-white/25 focus:bg-white/10":"bg-black/5 text-gray-800 placeholder:text-gray-400 focus:bg-black/10"]),placeholder:"Search...",readonly:""},null,2)])):o.item.id==="atom-scrollbar"?(s(),n("div",xu,[e("div",{class:i(["h-16 overflow-y-auto rounded-lg px-3 py-2",t(l)?"bg-white/5":"bg-black/5"]),style:{"scrollbar-width":"thin"}},[(s(),n(D,null,N(8,r=>e("p",{key:r,class:i(["text-xs py-0.5",t(l)?"text-white/40":"text-gray-400"])}," Scrollable content line "+u(r),3)),64))],2),e("p",{class:i(["text-xs text-center",t(l)?"text-white/30":"text-gray-400"])}," 4px wide, translucent thumb ",2)])):o.item.id==="mol-gradient-card"?(s(),n("div",pu,[...a[10]||(a[10]=[e("div",{class:"gradient-card p-4 rounded-2xl"},[e("h3",{class:"text-sm font-semibold mb-1 text-white"},"Featured"),e("p",{class:"text-xs text-white/70"},"Gradient background card for highlights.")],-1)])])):o.item.id==="mol-source-link"?(s(),n("div",gu,[e("div",{class:i(["flex items-center justify-between p-3 rounded-xl transition-colors",t(l)?"bg-white/5":"bg-black/5"])},[e("div",bu,[a[11]||(a[11]=e("span",{class:"text-sm"},"🎬",-1)),e("div",null,[e("p",{class:i(["text-xs font-medium",t(l)?"text-white/80":"text-gray-800"])},"Netflix",2),e("p",{class:i(["text-xs",t(l)?"text-white/30":"text-gray-400"])},"Stream now",2)])]),(s(),n("svg",{class:i(["w-3.5 h-3.5",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...a[12]||(a[12]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"},null,-1)])],2))],2)])):o.item.id==="mol-banner-hero"?(s(),n("div",vu,[...a[13]||(a[13]=[Jt('

Banner Title

Subtitle text

',1)])])):o.item.id==="mol-cover-card"?(s(),n("div",fu,[(s(),n(D,null,N(3,r=>e("div",{key:r,class:"flex-1 rounded-xl overflow-hidden"},[e("div",{class:"aspect-[2/3] relative",style:W({background:`linear-gradient(${120*r}deg, ${["#2d1b69","#1b3a4b","#3b1b2b"][r-1]}, ${["#1a0a3e","#0a2030","#200a1a"][r-1]})`})},[a[14]||(a[14]=e("div",{class:"absolute inset-0 bg-gradient-to-t from-black/60 to-transparent"},null,-1)),e("div",mu,[e("p",wu,u(["Film","Album","Series"][r-1]),1)])],4)])),64))])):o.item.id==="org-chat-bubble"?(s(),n("div",yu,[e("div",ku,[e("div",{class:i(["max-w-[80%] px-3 py-2 rounded-2xl text-xs",t(l)?"bg-white/10 text-white/90":"bg-black/10 text-gray-800"])}," What films should I watch? ",2)]),e("div",$u,[e("div",{class:i(["max-w-[80%] px-3 py-2 text-xs",t(l)?"text-white/70":"text-gray-600"])}," Here are some great picks from your library... ",2)])])):o.item.id==="org-content-panel"?(s(),n("div",_u,[e("div",{class:"flex gap-1 pb-1.5",style:W(t(l)?"border-bottom: 1px solid rgba(255,255,255,0.08)":"border-bottom: 1px solid rgba(0,0,0,0.06)")},[a[15]||(a[15]=e("span",{class:"text-xs px-2 py-0.5 rounded font-medium bg-accent/20 text-accent"},"Films",-1)),e("span",{class:i(["text-xs px-2 py-0.5 rounded font-medium",t(l)?"text-white/40":"text-gray-400"])},"Songs",2),e("span",{class:i(["text-xs px-2 py-0.5 rounded font-medium",t(l)?"text-white/40":"text-gray-400"])},"Books",2)],4),e("div",Cu,[(s(),n(D,null,N(6,r=>e("div",{key:r,class:i(["aspect-[2/3] rounded-md",t(l)?"bg-white/5":"bg-black/5"])},null,2)),64))])])):o.item.id==="org-detail-view"?(s(),n("div",ju,[e("div",{class:i(["relative aspect-[16/7] rounded-lg overflow-hidden",t(l)?"bg-white/5":"bg-black/5"])},[a[17]||(a[17]=e("div",{class:"absolute inset-0 bg-gradient-to-t from-black/60 to-transparent"},null,-1)),e("div",{class:i(["absolute top-1.5 left-1.5 w-4 h-4 rounded-md flex items-center justify-center",t(l)?"bg-white/10":"bg-black/10"])},[(s(),n("svg",{class:i(["w-2.5 h-2.5",t(l)?"text-white/60":"text-gray-500"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...a[16]||(a[16]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])],2))],2),a[18]||(a[18]=e("div",{class:"absolute bottom-1 left-2"},[e("p",{class:"text-xs font-bold text-white/90"},"Title"),e("p",{class:"text-xs text-white/50"},"Meta")],-1))],2),e("div",Su,[e("div",{class:i(["h-1.5 rounded-full w-full",t(l)?"bg-white/5":"bg-black/5"])},null,2),e("div",{class:i(["h-1.5 rounded-full w-3/4",t(l)?"bg-white/5":"bg-black/5"])},null,2)])])):o.item.id==="org-magazine"?(s(),n("div",Mu,[e("div",{class:i(["grid grid-cols-2 gap-px rounded-lg overflow-hidden",t(l)?"bg-white/[0.12]":"bg-black/[0.08]"])},[e("div",{class:i(["col-span-2 px-3 py-3",t(l)?"bg-[#0a0a0a]":"bg-white"])},[e("p",{class:i(["text-[7px] uppercase tracking-[0.3em] mb-0.5",t(l)?"text-white/30":"text-gray-400"])},"Editorial",2),e("p",{class:i(["text-xs font-serif font-bold",t(l)?"text-white/90":"text-gray-900"])},"Hero Headline",2)],2),e("div",{class:i(["px-2 py-2",t(l)?"bg-[#0a0a0a]":"bg-white"])},[e("p",{class:i(["text-xs font-serif font-bold",t(l)?"text-white/80":"text-gray-800"])},"Half Tile",2)],2),e("div",{class:i(["px-2 py-2",t(l)?"bg-[#0a0a0a]":"bg-white"])},[e("p",{class:i(["text-xs font-serif font-bold",t(l)?"text-white/80":"text-gray-800"])},"Half Tile",2)],2)],2)])):o.item.id==="org-nostr-note"?(s(),n("div",Tu,[e("div",{class:i(["p-3 rounded-xl",t(l)?"bg-white/[0.03] border border-white/5":"bg-black/[0.02] border border-black/5"])},[e("div",Iu,[a[20]||(a[20]=e("div",{class:"w-7 h-7 rounded-full flex items-center justify-center text-xs font-bold shrink-0",style:{background:"rgba(168, 85, 247, 0.2)",color:"rgba(168, 85, 247, 0.8)"}}," F ",-1)),e("div",Du,[e("div",Bu,[e("span",{class:i(["text-xs font-semibold",t(l)?"text-white/80":"text-gray-800"])},"fiatjaf",2),e("span",{class:i(["text-xs",t(l)?"text-white/25":"text-gray-300"])},"2h",2)]),e("p",{class:i(["text-xs mt-0.5 leading-relaxed",t(l)?"text-white/50":"text-gray-500"])}," Nostr is the simplest open protocol... ",2),e("div",Lu,[e("span",{class:i(["text-xs",t(l)?"text-white/25":"text-gray-300"])},"3 replies",2),a[19]||(a[19]=e("span",{class:"text-xs text-amber-500/70"},"21000 sats",-1))])])])],2)])):o.item.id==="anim-fade-up"?(s(),n("div",Pu,[(s(),n("div",{key:g.value,class:i(["animate-fade-up px-4 py-2 rounded-lg text-xs font-medium",t(l)?"bg-white/10 text-white/70":"bg-black/10 text-gray-600"])}," Fade Up (900ms) ",2)),e("button",{class:i(["text-xs px-2 py-0.5 rounded transition-colors",t(l)?"text-white/40 hover:text-white/60":"text-gray-400 hover:text-gray-600"]),onClick:a[1]||(a[1]=r=>g.value++)}," Replay ",2)])):o.item.id==="anim-scale-in"?(s(),n("div",Nu,[(s(),n("div",{key:b.value,class:i(["animate-scale-in px-4 py-2 rounded-lg text-xs font-medium",t(l)?"bg-white/10 text-white/70":"bg-black/10 text-gray-600"])}," Scale In (250ms) ",2)),e("button",{class:i(["text-xs px-2 py-0.5 rounded transition-colors",t(l)?"text-white/40 hover:text-white/60":"text-gray-400 hover:text-gray-600"]),onClick:a[2]||(a[2]=r=>b.value++)}," Replay ",2)])):(s(),n("div",zu,[e("p",{class:i(["text-xs",t(l)?"text-white/30":"text-gray-400"])}," See code below for usage pattern ",2)]))]))],2)]),o.item.usedIn?(s(),n("div",Eu,[e("h4",{class:i(["text-xs uppercase tracking-[0.2em] font-semibold mb-2",t(l)?"text-white/30":"text-gray-400"])}," Used In ",2),e("div",{class:i(["rounded-xl px-3 py-2.5",t(l)?"bg-white/[0.03] border border-white/10":"bg-black/[0.02] border border-black/10"])},[e("p",{class:i(["text-xs leading-relaxed",t(l)?"text-white/50":"text-gray-500"])},u(o.item.usedIn),3)],2)])):v("",!0),e("div",null,[e("h4",{class:i(["text-xs uppercase tracking-[0.2em] font-semibold mb-2",t(l)?"text-white/30":"text-gray-400"])}," Code ",2),e("pre",{class:i(["rounded-xl p-4 text-xs leading-relaxed font-mono overflow-x-auto",t(l)?"bg-black/40 text-white/70 border border-white/10":"bg-gray-50 text-gray-700 border border-gray-200"])},u(o.item.code),3)])])]))}}),Ge=G({__name:"DetailView",setup(o){const{isCodeMode:c,activeFile:l}=xe();function m(){const{activeFile:R,activeFileContent:H}=xe();R.value=null,H.value=""}const{selectedFilm:g,selectedBook:b,selectedTVSeries:p,selectedImage:w,selectedPlace:$,selectedSong:_,selectedPodcast:f,selectedArticle:d,closeFilmDetail:a,closeBookDetail:r,closeTVSeriesDetail:h,closeImageDetail:M,closePlaceDetail:j,closeSongDetail:L,closePodcastDetail:I,closeArticleDetail:C,selectedWebsite:k,closeWebsiteDetail:x,selectedMagazineSection:y,magazineSectionIndex:z,panelMagazineSections:V,closeMagazineSectionDetail:A,navigateMagazineSection:K,selectedDesignSystemItem:O,closeDesignSystemItem:U}=$e();return(R,H)=>t(g)?(s(),q(cs,{key:0,film:t(g),onBack:t(a)},null,8,["film","onBack"])):t(_)?(s(),q(ds,{key:1,song:t(_),onBack:t(L)},null,8,["song","onBack"])):t(f)?(s(),q(zc,{key:2,podcast:t(f),onBack:t(I)},null,8,["podcast","onBack"])):t(b)?(s(),q(Hr,{key:3,book:t(b),onBack:t(r)},null,8,["book","onBack"])):t(p)?(s(),q(bc,{key:4,series:t(p),onBack:t(h)},null,8,["series","onBack"])):t(w)?(s(),q(qc,{key:5,image:t(w),onBack:t(M)},null,8,["image","onBack"])):t($)?(s(),q(gd,{key:6,place:t($),onBack:t(j)},null,8,["place","onBack"])):t(d)?(s(),q(Sd,{key:7,article:t(d),onBack:t(C)},null,8,["article","onBack"])):t(k)?(s(),q(Pd,{key:8,website:t(k),onBack:t(x)},null,8,["website","onBack"])):t(y)?(s(),q(Vd,{key:9,section:t(y),"current-index":t(z),"total-sections":t(V).length,onBack:t(A),onNavigate:t(K)},null,8,["section","current-index","total-sections","onBack","onNavigate"])):t(c)&&t(l)?(s(),q(Qd,{key:10,onBack:m})):t(O)?(s(),q(Au,{key:11,item:t(O),onBack:t(U)},null,8,["item","onBack"])):v("",!0)}}),Oe=G({__name:"CloseButton",emits:["click"],setup(o){const{isDark:c}=Z();return(l,m)=>(s(),n("button",{class:i(["absolute top-3 right-3 z-10 p-2 rounded-lg path-glass-icon transition-colors",t(c)?"text-white/70 hover:bg-white/10":"text-gray-500 hover:bg-black/5 hover:text-gray-800"]),title:"Close","aria-label":"Close",onClick:m[0]||(m[0]=g=>l.$emit("click"))},[...m[1]||(m[1]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])],2))}}),Fu={class:"flex-1 overflow-y-auto p-4"},Ru={key:0,class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4"},Vu={key:1,class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3"},Uu={key:2,class:"space-y-3"},qu={class:"flex-1 space-y-2 py-1"},Gu={key:3,class:"space-y-0"},Ou=G({__name:"LoadingContentGrid",props:{variant:{default:"poster"},count:{default:8}},setup(o){const{isDark:c}=Z();return(l,m)=>(s(),n("div",Fu,[o.variant==="poster"?(s(),n("div",Ru,[(s(!0),n(D,null,N(o.count,g=>(s(),n("div",{key:g,class:i(["aspect-[2/3] rounded-xl animate-pulse",t(c)?"bg-white/10":"bg-black/6"])},null,2))),128))])):o.variant==="square"?(s(),n("div",Vu,[(s(!0),n(D,null,N(o.count,g=>(s(),n("div",{key:g,class:"space-y-2"},[e("div",{class:i(["aspect-square rounded-xl animate-pulse",t(c)?"bg-white/10":"bg-black/6"])},null,2),e("div",{class:i(["h-3 rounded animate-pulse w-3/4",t(c)?"bg-white/8":"bg-black/5"])},null,2),e("div",{class:i(["h-2.5 rounded animate-pulse w-1/2",t(c)?"bg-white/5":"bg-black/3"])},null,2)]))),128))])):o.variant==="list"?(s(),n("div",Uu,[(s(!0),n(D,null,N(o.count,g=>(s(),n("div",{key:g,class:i(["flex gap-3 p-3 rounded-xl animate-pulse",t(c)?"bg-white/[0.04]":"bg-black/[0.03]"])},[e("div",{class:i(["w-20 h-14 rounded-lg shrink-0",t(c)?"bg-white/10":"bg-black/6"])},null,2),e("div",qu,[e("div",{class:i(["h-3 rounded w-4/5",t(c)?"bg-white/10":"bg-black/6"])},null,2),e("div",{class:i(["h-2.5 rounded w-3/5",t(c)?"bg-white/6":"bg-black/4"])},null,2)])],2))),128))])):o.variant==="magazine"?(s(),n("div",Gu,[e("div",{class:i(["h-44 animate-pulse mb-px",t(c)?"bg-white/[0.04]":"bg-black/[0.03]"])},null,2),e("div",{class:i(["grid grid-cols-2 gap-px",t(c)?"bg-white/12":"bg-black/10"])},[(s(!0),n(D,null,N(o.count,g=>(s(),n("div",{key:g,class:i(["p-4 animate-pulse",[t(c)?"bg-[#0a0a0a]":"bg-[#faf9f6]",g<=1?"col-span-2":""]])},[e("div",{class:i(["h-2.5 rounded w-1/3 mb-2",t(c)?"bg-white/8":"bg-black/5"])},null,2),e("div",{class:i(["h-4 rounded w-4/5 mb-2",t(c)?"bg-white/10":"bg-black/6"])},null,2),e("div",{class:i(["h-2.5 rounded w-full",t(c)?"bg-white/6":"bg-black/4"])},null,2)],2))),128))],2)])):v("",!0)]))}}),Hu={class:"relative flex-1 flex flex-col min-h-0 overflow-hidden"},Wu={key:0,class:"flex-1 flex flex-col min-h-0"},Ku={class:"flex items-center gap-2 shrink-0"},Yu={key:1,class:"relative flex-1 flex items-center justify-center min-h-0"},Qu={class:"relative flex flex-col items-center gap-8"},Ju={class:"flex items-center gap-2"},Zu={class:"absolute inset-0 pointer-events-none overflow-hidden"},Xu=G({__name:"ContextLoader",props:{contextType:{default:"film"}},setup(o){const c=o,{isDark:l}=Z(),m=B(()=>c.contextType==="film"?"Film recommendations":c.contextType==="song"?"Song recommendations":c.contextType==="podcast"?"Podcast recommendations":c.contextType==="book"?"Book recommendations":c.contextType==="tvshow"?"TV Series recommendations":c.contextType==="image"?"Images":c.contextType==="news"?"Articles":c.contextType==="websites"?"Websites":c.contextType==="magazine"?"Brief":"Content"),g=B(()=>["song","podcast","image"].includes(c.contextType)?"square":["news","websites"].includes(c.contextType)?"list":c.contextType==="magazine"?"magazine":"poster"),b=B(()=>c.contextType==="magazine"||["news","websites"].includes(c.contextType)?6:12);return(p,w)=>(s(),n("div",Hu,[["film","song","podcast","book","tvshow","image","news","websites","magazine"].includes(o.contextType)?(s(),n("div",Wu,[e("div",{class:"p-4 shrink-0 flex items-center justify-between gap-2",style:W(t(l)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("p",{class:i(["text-sm font-medium",t(l)?"text-white/70":"text-gray-600"])},u(m.value),3),e("div",Ku,[e("p",{class:i(["text-xs font-mono uppercase tracking-[0.2em]",t(l)?"text-white/25":"text-gray-400"])}," Surfacing… ",2),re(p.$slots,"header-actions",{},void 0,!0)])],4),te(Ou,{variant:g.value,count:b.value},null,8,["variant","count"])])):(s(),n("div",Yu,[e("div",{class:i(["absolute inset-0 opacity-[0.04] pointer-events-none",t(l)?"bg-white":"bg-black"]),style:{"background-image":`url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")`}},null,2),e("div",Qu,[e("div",Ju,[(s(),n(D,null,N(5,($,_)=>e("div",{key:_,class:i(["w-12 h-16 rounded-lg overflow-hidden relative animate-cell-pulse",t(l)?"bg-white/8 border border-white/15 shadow-xl shadow-accent/5":"bg-black/6 border border-black/8 shadow-xl shadow-accent/10"]),style:W({animationDelay:`${_*100}ms`})},[e("div",Zu,[e("div",{class:i(["absolute inset-0 w-1/2 animate-shimmer-sweep",t(l)?"bg-gradient-to-r from-transparent via-accent/25 to-transparent":"bg-gradient-to-r from-transparent via-accent/35 to-transparent"])},null,2)])],6)),64))]),e("p",{class:i(["text-sm font-medium",t(l)?"text-white/70":"text-gray-600"])},u(m.value),3),e("div",{class:i(["w-40 h-px rounded-full overflow-hidden",t(l)?"bg-white/8":"bg-black/8"])},[...w[0]||(w[0]=[e("div",{class:"h-full bg-accent/90 rounded-full animate-progress-sweep"},null,-1)])],2)])]))]))}}),it=Ie(Xu,[["__scopeId","data-v-f8eb31f3"]]),e0={key:0,class:"absolute inset-0 pointer-events-none bg-black/20"},t0={key:0,class:"flex-1 min-w-0 flex flex-col relative"},s0={class:"flex flex-wrap gap-1.5 flex-1 min-w-0 justify-center"},n0=["onClick"],l0={key:1,class:"flex-1 min-w-0 flex flex-col"},o0={key:3,class:"flex-1 flex items-center justify-center"},a0={class:"text-center space-y-4 animate-fade-up max-w-sm px-6"},i0={class:"empty-state-icon w-20 h-20 rounded-2xl path-glass-icon flex items-center justify-center mx-auto overflow-hidden"},r0={key:0,class:"flex-1 min-w-0 path-glass-card overflow-hidden flex flex-col order-3 detail-persistent panel-slide-in",style:{"animation-delay":"0.2s"}},c0={key:1,class:"flex-1 flex items-center justify-center"},d0={class:"text-center space-y-4 max-w-[200px] px-4"},u0={class:"empty-state-icon w-16 h-16 rounded-2xl path-glass-icon flex items-center justify-center mx-auto overflow-hidden"},h0={key:1,class:"flex-1 flex flex-col min-h-0"},x0={class:"flex-1 min-h-0 flex flex-col p-2 pb-0"},p0={class:"flex-1 min-h-0 path-glass-card flex flex-col rounded-2xl overflow-hidden"},g0={class:"flex-1 min-h-0 flex flex-col p-2 pb-0"},b0={class:"flex-1 min-h-0 path-glass-card flex flex-col rounded-2xl overflow-hidden"},v0={class:"shrink-0 flex items-center gap-2 px-3 pt-2 pb-1 overflow-x-auto scrollbar-hide"},f0=["onClick"],m0={key:2,class:"flex-1 flex items-center justify-center"},w0={class:"text-center space-y-3 px-6"},y0={class:"empty-state-icon w-16 h-16 rounded-2xl path-glass-icon flex items-center justify-center mx-auto overflow-hidden"},k0={class:"flex-1 min-h-0 flex flex-col p-2 pb-0"},$0={class:"flex-1 min-h-0 path-glass-card flex flex-col rounded-2xl overflow-hidden"},_0={class:"flex-1 min-h-0 flex flex-col"},C0={key:1,class:"flex-1 flex items-center justify-center"},j0={class:"text-center space-y-3 px-6"},S0={class:"empty-state-icon w-16 h-16 rounded-2xl path-glass-icon flex items-center justify-center mx-auto overflow-hidden"},M0={class:"shrink-0 pt-3 pb-3",style:{paddingBottom:"calc(12px + env(safe-area-inset-bottom, 0px))"}},T0={class:"flex items-center h-[49px] px-2 gap-1"},I0={key:0,class:"absolute top-1.5 right-[28%] w-1.5 h-1.5 rounded-full bg-accent"},D0={key:0,class:"absolute top-1.5 right-[28%] w-1.5 h-1.5 rounded-full bg-accent"},B0=G({__name:"ChatPage",setup(o){const{hasTrack:c}=Zt(),l=ss(),{activeFile:m,isCodeMode:g,exitCodeMode:b,clearActiveFile:p}=xe(),{isDark:w}=Z(),$=!!window.__AIUI_EMBEDDED__,_="/aiui/assets/img/bg-intro-3.jpg";as();const{panelOpen:f,panelFilms:d,panelBooks:a,panelTVSeries:r,panelImages:h,panelPlaces:M,panelSongs:j,panelPodcasts:L,panelWebResults:I,panelWebsites:C,panelMagazineSections:k,panelMagazineHeroImage:x,panelTitle:y,panelQuery:z,panelResponseText:V,contentType:A,activeTab:K,availableTabs:O,setActiveTab:U,selectedFilm:R,selectedBook:H,selectedTVSeries:le,selectedImage:fe,selectedPlace:pe,selectedSong:X,selectedPodcast:E,selectedArticle:P,selectedWebsite:ce,selectedMagazineSection:Be,selectedDesignSystemItem:mt,closeFilmDetail:wt,closeBookDetail:yt,closeTVSeriesDetail:kt,closeImageDetail:$t,closePlaceDetail:_t,closeSongDetail:Ct,closePodcastDetail:jt,closeArticleDetail:St,closeWebsiteDetail:Mt,closeMagazineSectionDetail:Tt,closePanel:_e,openFilmDetail:It,openBookDetail:Dt,openTVSeriesDetail:Bt,openImageDetail:Lt,openPlaceDetail:Pt,openSongDetail:Nt,openPodcastDetail:zt,openMagazineSectionDetail:Et}=$e(),Ce=B(()=>l.panelSide),Ee=S(window.innerWidth),oe=B(()=>Ee.value<1024),de=B(()=>Ee.value>=1440),ee=S("chat"),{isKeyboardOpen:At}=Xt();function Ke(){Ee.value=window.innerWidth}function Ye(F){F.key==="Escape"&&g.value&&!oe.value&&b()}ne(()=>{window.addEventListener("resize",Ke),window.addEventListener("keydown",Ye)}),es(()=>{window.removeEventListener("resize",Ke),window.removeEventListener("keydown",Ye)}),ie(f,F=>{F&&oe.value&&!$&&(ee.value="content")}),ie(y,()=>{f.value&&oe.value&&ee.value==="chat"&&!$&&(ee.value="content")}),ie(K,()=>{f.value&&oe.value&&ee.value==="chat"&&!$&&(ee.value="content")});const ge=B(()=>!!(R.value||H.value||le.value||fe.value||pe.value||X.value||E.value||P.value||ce.value||Be.value||mt.value||g.value&&m.value));ie(ge,F=>{F&&oe.value&&(ee.value="context"),!F&&oe.value&&ee.value==="context"&&(ee.value="content")});const Ae=B(()=>f.value&&O.value.length>0);function Qe(){wt(),yt(),kt(),$t(),_t(),Ct(),jt(),St(),Mt(),Tt(),p()}const Fe=B(()=>{const F=[];return d.value.forEach(T=>F.push({open:()=>It(T)})),a.value.forEach(T=>F.push({open:()=>Dt(T)})),r.value.forEach(T=>F.push({open:()=>Bt(T)})),j.value.forEach(T=>F.push({open:()=>Nt(T)})),L.value.forEach(T=>F.push({open:()=>zt(T)})),h.value.forEach(T=>F.push({open:()=>Lt(T)})),M.value.forEach(T=>F.push({open:()=>Pt(T)})),k.value.forEach((T,Y)=>F.push({open:()=>Et(T,Y)})),F}),Je=B(()=>{if(R.value){const F=d.value.indexOf(R.value);return F>=0?F:0}if(H.value){const F=a.value.indexOf(H.value);return F>=0?d.value.length+F:0}if(le.value){const F=r.value.indexOf(le.value);return F>=0?d.value.length+a.value.length+F:0}if(X.value){const F=d.value.length+a.value.length+r.value.length,T=j.value.indexOf(X.value);return T>=0?F+T:0}if(E.value){const F=d.value.length+a.value.length+r.value.length+j.value.length,T=L.value.indexOf(E.value);return T>=0?F+T:0}if(fe.value){const F=d.value.length+a.value.length+r.value.length+j.value.length+L.value.length,T=h.value.indexOf(fe.value);return T>=0?F+T:0}if(pe.value){const F=d.value.length+a.value.length+r.value.length+j.value.length+L.value.length+h.value.length,T=M.value.indexOf(pe.value);return T>=0?F+T:0}if(Be.value){const F=d.value.length+a.value.length+r.value.length+j.value.length+L.value.length+h.value.length+M.value.length,T=k.value.indexOf(Be.value);return T>=0?F+T:0}return 0});function Ze(F){const T=Fe.value;if(!T.length)return;let Y=Je.value;Y+=F==="next"?1:-1,Y<0&&(Y=T.length-1),Y>=T.length&&(Y=0),Qe(),T[Y].open()}const Ft={film:"Films",book:"Books",tvshow:"TV",image:"Images",place:"Places",recipe:"Recipes",song:"Songs",podcast:"Podcasts",news:"News",websites:"Websites",magazine:"Brief",code:"Code","design-system":"Design",app:"Apps",nostr:"Nostr",favorites:"Favorites",discover:"Discover",prompt:"Prompt"};function Xe(F){return Ft[F]??F}const et=B(()=>{if(f.value)return A.value;const T=([...l.messages].reverse().find(Y=>Y.role==="user")?.content??"").toLowerCase();return/\b(song|music|track|album|band|artist|listen)\b/.test(T)?"song":/\b(book|novel|read|author|fiction|nonfiction|memoir)\b/.test(T)?"book":/\b(tv show|tv series|series|television|binge|season)\b/.test(T)?"tvshow":/\b(image|images|photo|photos|picture|pictures|screenshot|gallery|artwork|illustration)\b/.test(T)?"image":/\b(restaurant|restaurants|place|places|food|eat|dining|cafe|bar|pub|brunch|lunch|dinner)\b/.test(T)?"film":/\b(podcast|episode|show|listen to)\b/.test(T)?"podcast":/\b(news|latest|recent|current|what'?s happening|what are people saying)\b/.test(T)?"news":/\b(bip|protocol|debate|sentiment|bearish|bull case|macro)\b/.test(T)?"magazine":/\b(website|websites|where to check|best places|check online|resources?|sources?)\b/.test(T)?"websites":A.value});return(F,T)=>(s(),n("div",{class:i(["h-full flex flex-col relative overflow-hidden transition-colors duration-300",[]]),style:W($?{background:"transparent"}:t(w)?{background:"#000 url("+_+") center center / cover no-repeat fixed"}:{backgroundColor:"#f5f4f1"})},[t(w)&&!$?(s(),n("div",e0)):v("",!0),e("div",{class:i(["flex-1 flex h-full p-3 md:p-4 gap-3 md:gap-4 transition-[padding] duration-200",[oe.value?"hidden":""]]),style:W(t(c)&&!oe.value?{paddingBottom:"76px"}:{})},[e("main",{class:i(["flex-1 min-w-0 path-glass-card overflow-hidden flex relative panel-slide-in",[de.value?Ce.value==="left"?"order-2":"order-1":Ce.value==="left"?"order-last":"order-first",!de.value&&ge.value&&!Ae.value&&"detail-active"]]),style:{"animation-delay":"0.1s"}},[t(f)&&Ae.value&&(de.value||!ge.value)?(s(),n("div",t0,[te(Oe,{onClick:t(_e)},null,8,["onClick"]),e("div",{class:"shrink-0 flex items-center gap-2 px-4 pr-12 py-3",style:W(t(w)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("div",s0,[(s(!0),n(D,null,N(t(O),Y=>(s(),n("button",{key:Y,class:i(["text-xs px-2 py-1 rounded-md transition-all duration-150",t(K)===Y?"nav-tab-active":t(w)?"text-white/40 hover:text-white/70 hover:bg-white/5":"text-gray-500 hover:text-gray-800 hover:bg-black/5"]),onClick:Rt=>t(U)(Y)},u(Xe(Y)),11,n0))),128))])],4),te(be,{title:"Content failed to load"},{default:ue(()=>[te(at,{"active-tab":t(K),"is-wide-desktop":de.value,"is-mobile":oe.value,"panel-films":t(d),"panel-books":t(a),panelTVSeries:t(r),"panel-images":t(h),"panel-places":t(M),"panel-songs":t(j),"panel-podcasts":t(L),"panel-web-results":t(I),"panel-websites":t(C),"panel-magazine-sections":t(k),"panel-magazine-hero-image":t(x),"panel-title":t(y),"panel-query":t(z),"panel-response-text":t(V),onClose:t(_e)},null,8,["active-tab","is-wide-desktop","is-mobile","panel-films","panel-books","panelTVSeries","panel-images","panel-places","panel-songs","panel-podcasts","panel-web-results","panel-websites","panel-magazine-sections","panel-magazine-hero-image","panel-title","panel-query","panel-response-text","onClose"])]),_:1})])):!de.value&&t(f)&&ge.value?(s(),n("div",l0,[te(Oe,{onClick:T[0]||(T[0]=Y=>Ae.value?Qe():t(_e)())}),te(be,{title:"Detail view error"},{default:ue(()=>[te(Ge)]),_:1})])):t(l).isStreaming?(s(),q(it,{key:2,"context-type":et.value},{"header-actions":ue(()=>[te(Oe,{onClick:t(_e)},null,8,["onClick"])]),_:1},8,["context-type"])):(s(),n("div",o0,[e("div",a0,[e("div",i0,[e("span",{class:i(["text-3xl",t(w)?"text-[#fafafa]":"text-gray-800"])},"✦",2)]),e("div",null,[e("h2",{class:i(["text-lg font-bold mb-1",t(w)?"text-white/80":"text-gray-800"])}," Content Surface ",2),e("p",{class:i(["text-sm leading-relaxed",t(w)?"text-white/30":"text-gray-400"])}," Ask about films, songs, or podcasts in the chat to see rich content here. ",2)])])]))],2),de.value?(s(),n("div",r0,[ge.value?(s(),q(be,{key:0,title:"Detail view error"},{default:ue(()=>[te(Ge)]),_:1})):(s(),n("div",c0,[e("div",d0,[e("div",u0,[e("span",{class:i(["text-2xl",t(w)?"text-[#fafafa]":"text-gray-800"])},"✦",2)]),e("div",null,[e("h2",{class:i(["text-sm font-semibold mb-1",t(w)?"text-white/60":"text-gray-600"])}," Awaiting Context ",2),e("p",{class:i(["text-xs leading-relaxed",t(w)?"text-white/25":"text-gray-400"])}," Select an item to see details here. ",2)])])]))])):v("",!0),e("aside",{class:i(["relative z-[100] w-80 xl:w-96 shrink-0 flex flex-col path-glass-card overflow-visible panel-slide-in",de.value?Ce.value==="left"?"order-1":"order-2":Ce.value==="left"?"order-first":"order-last"]),style:{"animation-delay":"0s"}},[te(be,{title:"Chat error"},{default:ue(()=>[te(tt,{side:Ce.value,onSwitchSide:T[1]||(T[1]=Y=>t(l).switchSide())},null,8,["side"])]),_:1})],2)],6),oe.value?(s(),n("div",h0,[Q(e("div",x0,[e("div",p0,[te(be,{title:"Chat error"},{default:ue(()=>[te(tt,{variant:"standalone","show-close":!1})]),_:1})])],512),[[Le,ee.value==="chat"]]),Q(e("div",g0,[e("div",b0,[t(f)?(s(),n(D,{key:0},[e("div",v0,[e("button",{class:i(["p-1.5 rounded-lg transition-colors shrink-0",t(w)?"text-white/50 hover:text-white/80 hover:bg-white/5":"text-gray-400 hover:text-gray-700 hover:bg-black/5"]),onClick:T[2]||(T[2]=Y=>ee.value="chat")},[...T[8]||(T[8]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])],2),(s(!0),n(D,null,N(t(O),Y=>(s(),n("button",{key:Y,class:i(["text-xs px-2.5 py-1.5 rounded-lg font-medium whitespace-nowrap transition-all duration-150",t(K)===Y?"nav-tab-active":t(w)?"text-white/40 hover:text-white/70 hover:bg-white/5":"text-gray-500 hover:text-gray-800 hover:bg-black/5"]),onClick:Rt=>t(U)(Y)},u(Xe(Y)),11,f0))),128))]),te(be,{title:"Content failed to load"},{default:ue(()=>[te(at,{"active-tab":t(K),"is-wide-desktop":de.value,"is-mobile":oe.value,"panel-films":t(d),"panel-books":t(a),panelTVSeries:t(r),"panel-images":t(h),"panel-places":t(M),"panel-songs":t(j),"panel-podcasts":t(L),"panel-web-results":t(I),"panel-websites":t(C),"panel-magazine-sections":t(k),"panel-magazine-hero-image":t(x),"panel-title":t(y),"panel-query":t(z),onClose:t(_e)},null,8,["active-tab","is-wide-desktop","is-mobile","panel-films","panel-books","panelTVSeries","panel-images","panel-places","panel-songs","panel-podcasts","panel-web-results","panel-websites","panel-magazine-sections","panel-magazine-hero-image","panel-title","panel-query","onClose"])]),_:1})],64)):t(l).isStreaming?(s(),q(it,{key:1,"context-type":et.value},null,8,["context-type"])):(s(),n("div",m0,[e("div",w0,[e("div",y0,[e("span",{class:i(["text-2xl",t(w)?"text-[#fafafa]":"text-gray-800"])},"✦",2)]),e("p",{class:i(["text-xs",t(w)?"text-white/30":"text-gray-400"])}," Ask about something in the chat to see content here. ",2)])]))])],512),[[Le,ee.value==="content"]]),Q(e("div",k0,[e("div",$0,[ge.value?(s(),n(D,{key:0},[e("div",_0,[te(be,{title:"Detail view error"},{default:ue(()=>[te(Ge)]),_:1})]),!t(Be)&&Fe.value.length>1?(s(),n("div",{key:0,class:"shrink-0 flex items-center justify-between px-4 py-2",style:W(t(w)?"border-top: 1px solid rgba(255, 255, 255, 0.08)":"border-top: 1px solid rgba(0, 0, 0, 0.06)")},[e("button",{class:i(["flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs transition-colors",t(w)?"text-white/50 hover:text-white/80 hover:bg-white/5":"text-black/40 hover:text-black/70 hover:bg-black/5"]),onClick:T[3]||(T[3]=Y=>Ze("prev"))},[...T[9]||(T[9]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1),se(" Prev ",-1)])],2),e("span",{class:i(["text-xs font-mono tabular-nums",t(w)?"text-white/25":"text-black/25"])},u(Je.value+1)+"/"+u(Fe.value.length),3),e("button",{class:i(["flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs transition-colors",t(w)?"text-white/50 hover:text-white/80 hover:bg-white/5":"text-black/40 hover:text-black/70 hover:bg-black/5"]),onClick:T[4]||(T[4]=Y=>Ze("next"))},[...T[10]||(T[10]=[se(" Next ",-1),e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1)])],2)],4)):v("",!0)],64)):(s(),n("div",C0,[e("div",j0,[e("div",S0,[(s(),n("svg",{class:i(["w-7 h-7",t(w)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...T[11]||(T[11]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"},null,-1),e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"},null,-1)])],2))]),e("p",{class:i(["text-xs",t(w)?"text-white/30":"text-gray-400"])}," Tap an item in Content to view details here. ",2)])]))])],512),[[Le,ee.value==="context"]]),te(ts,{variant:"inline",compact:""}),Q(e("div",M0,[e("div",T0,[e("button",{class:i(["flex-1 flex flex-col items-center justify-center h-[49px] min-h-[44px] rounded-xl text-[10px] font-medium tracking-wide transition-all duration-150 gap-0.5",ee.value==="chat"?t(w)?"bg-white/10 text-white/90":"bg-black/8 text-gray-900":t(w)?"text-white/40 hover:text-white/60":"text-gray-400 hover:text-gray-600"]),onClick:T[5]||(T[5]=Y=>ee.value="chat")},[...T[12]||(T[12]=[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})],-1),e("span",null,"Chat",-1)])],2),e("button",{class:i(["flex-1 flex flex-col items-center justify-center h-[49px] min-h-[44px] rounded-xl text-[10px] font-medium tracking-wide transition-all duration-150 relative gap-0.5",ee.value==="content"?t(w)?"bg-white/10 text-white/90":"bg-black/8 text-gray-900":t(w)?"text-white/40 hover:text-white/60":"text-gray-400 hover:text-gray-600"]),onClick:T[6]||(T[6]=Y=>ee.value="content")},[T[13]||(T[13]=e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"})],-1)),T[14]||(T[14]=e("span",null,"Content",-1)),t(f)&&ee.value==="chat"?(s(),n("span",I0)):v("",!0)],2),e("button",{class:i(["flex-1 flex flex-col items-center justify-center h-[49px] min-h-[44px] rounded-xl text-[10px] font-medium tracking-wide transition-all duration-150 relative gap-0.5",ee.value==="context"?t(w)?"bg-white/10 text-white/90":"bg-black/8 text-gray-900":t(w)?"text-white/40 hover:text-white/60":"text-gray-400 hover:text-gray-600"]),onClick:T[7]||(T[7]=Y=>ee.value="context")},[T[15]||(T[15]=e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})],-1)),T[16]||(T[16]=e("span",null,"Context",-1)),ge.value&&ee.value!=="context"?(s(),n("span",D0)):v("",!0)],2)])],512),[[Le,!t(At)]])])):v("",!0)],4))}}),U0=Ie(B0,[["__scopeId","data-v-a57bffe4"]]);export{U0 as default}; diff --git a/demo/aiui/assets/ChatPage-sAXrmq0w.css b/demo/aiui/assets/ChatPage-CA2cZZjS.css similarity index 77% rename from demo/aiui/assets/ChatPage-sAXrmq0w.css rename to demo/aiui/assets/ChatPage-CA2cZZjS.css index f0f3e099..17caf1cb 100644 --- a/demo/aiui/assets/ChatPage-sAXrmq0w.css +++ b/demo/aiui/assets/ChatPage-CA2cZZjS.css @@ -1 +1 @@ -.magazine[data-v-02741b8c]{font-family:Georgia,Times New Roman,Times,serif}.magazine-light[data-v-02741b8c]{background-color:#faf9f6}.magazine-dark[data-v-02741b8c]{background-color:#0a0a0a}iframe[data-v-0f5111f5]::-webkit-scrollbar{display:none}.code-detail table[data-v-7f40c0bc]{font-variant-numeric:tabular-nums}.animate-cell-pulse[data-v-f8eb31f3]{animation:cell-pulse-f8eb31f3 1.8s cubic-bezier(.4,0,.2,1) infinite}.animate-shimmer-sweep[data-v-f8eb31f3]{animation:shimmer-sweep-f8eb31f3 2.2s cubic-bezier(.4,0,.2,1) infinite}.animate-progress-sweep[data-v-f8eb31f3]{animation:progress-sweep-f8eb31f3 1.6s cubic-bezier(.4,0,.2,1) infinite}@keyframes cell-pulse-f8eb31f3{0%,to{opacity:.6;transform:scale(.96)}50%{opacity:1;transform:scale(1.02)}}@keyframes shimmer-sweep-f8eb31f3{0%{transform:translate(-100%)}60%{transform:translate(200%)}to{transform:translate(200%)}}@keyframes progress-sweep-f8eb31f3{0%{width:0;margin-left:0}45%{width:60%;margin-left:20%}90%{width:0;margin-left:100%}to{width:0;margin-left:0}}.content-fade-enter-active[data-v-a57bffe4],.content-fade-leave-active[data-v-a57bffe4]{transition:opacity .2s ease}.content-fade-enter-from[data-v-a57bffe4],.content-fade-leave-to[data-v-a57bffe4]{opacity:0}.detail-active[data-v-a57bffe4]{border-color:transparent!important}.detail-persistent[data-v-a57bffe4] button[class*=absolute][class*=top-3][class*=left-3]{display:none!important} +.magazine[data-v-02741b8c]{font-family:Georgia,Times New Roman,Times,serif}.magazine-light[data-v-02741b8c]{background-color:#faf9f6}.magazine-dark[data-v-02741b8c]{background-color:#0a0a0a}iframe[data-v-0f5111f5]::-webkit-scrollbar{display:none}.code-detail table[data-v-7f40c0bc]{font-variant-numeric:tabular-nums}.animate-cell-pulse[data-v-f8eb31f3]{animation:cell-pulse-f8eb31f3 1.8s cubic-bezier(.4,0,.2,1) infinite}.animate-shimmer-sweep[data-v-f8eb31f3]{animation:shimmer-sweep-f8eb31f3 2.2s cubic-bezier(.4,0,.2,1) infinite}.animate-progress-sweep[data-v-f8eb31f3]{animation:progress-sweep-f8eb31f3 1.6s cubic-bezier(.4,0,.2,1) infinite}@keyframes cell-pulse-f8eb31f3{0%,to{opacity:.6;transform:scale(.96)}50%{opacity:1;transform:scale(1.02)}}@keyframes shimmer-sweep-f8eb31f3{0%{transform:translate(-100%)}60%{transform:translate(200%)}to{transform:translate(200%)}}@keyframes progress-sweep-f8eb31f3{0%{width:0;margin-left:0}45%{width:60%;margin-left:20%}90%{width:0;margin-left:100%}to{width:0;margin-left:0}}.content-fade-enter-active[data-v-2cb034ff],.content-fade-leave-active[data-v-2cb034ff]{transition:opacity .2s ease}.content-fade-enter-from[data-v-2cb034ff],.content-fade-leave-to[data-v-2cb034ff]{opacity:0}.detail-active[data-v-2cb034ff]{border-color:transparent!important}.detail-persistent[data-v-2cb034ff] button[class*=absolute][class*=top-3][class*=left-3]{display:none!important} diff --git a/demo/aiui/assets/ChatPage-CvJyonWj.js b/demo/aiui/assets/ChatPage-CvJyonWj.js new file mode 100644 index 00000000..c8f17826 --- /dev/null +++ b/demo/aiui/assets/ChatPage-CvJyonWj.js @@ -0,0 +1,258 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/useNostr-C64NofB2.js","assets/index-xgP_Yxxn.js","assets/index-CIeswVLz.css","assets/ThreadNode-CF2XPC8C.js"])))=>i.map(i=>d[i]); +import{a as O,Z as qt,$ as rt,p as Ne,b as s,c as n,e,h as G,u as t,n as i,t as u,f as ie,w as K,v as J,F as D,g as L,i as m,j as Z,r as j,k as B,a0 as Gt,a1 as ct,N as se,a2 as dt,a3 as ut,a4 as ht,a5 as xt,U as Ie,a6 as Ot,a7 as Ht,a8 as Wt,P as Kt,Q as q,K as ne,a9 as ae,aa as ye,z as we,_ as pt,A as ce,B as Pe,d as Yt,ab as Qt,L as te,ac as Jt,ad as Zt,ae as Xt,S as es,q as ts,af as ss,o as ns,M as ue,ag as Le,ah as ls}from"./index-xgP_Yxxn.js";import{u as os}from"./chat-BmHsA0em.js";import{u as $e,a as xe,e as He,d as gt,M as as,b as is,s as rs,c as cs,f as be,_ as tt}from"./ChatWindow.vue_vue_type_script_setup_true_lang-mndCLJgR.js";import{_ as ds}from"./FilmGrid.vue_vue_type_script_setup_true_lang-DeUdxOuC.js";import{u as Ae}from"./useContentImages-Vu33AzxO.js";import{_ as us}from"./SongGrid.vue_vue_type_script_setup_true_lang-D_qvs2R5.js";import{useNostr as De}from"./useNostr-C64NofB2.js";import{u as bt,_ as hs}from"./FilmDetail.vue_vue_type_script_setup_true_lang-CvP1bsRD.js";import{_ as xs}from"./SongDetail.vue_vue_type_script_setup_true_lang-C3aBvFsB.js";const ps={class:"h-full flex flex-col"},gs={class:"flex items-center justify-between gap-2"},bs={class:"flex items-center gap-2 shrink-0"},vs={key:0,class:"flex flex-wrap gap-1.5"},fs=["onClick"],ms={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-4 pb-16"},ws={class:"grid grid-cols-2 sm:grid-cols-3 gap-4"},ys=["aria-label","onClick"],ks={class:"cover-card flex-1 min-h-0 relative"},$s={key:0,class:"absolute inset-0 animate-shimmer"},_s=["src","alt","onError"],Cs=["src","alt"],js={key:3,class:"absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent pointer-events-none"},Ss={class:"absolute bottom-0 left-0 right-0 p-2"},Ms={class:"text-xs font-semibold text-white/90 leading-tight truncate"},Ts={class:"text-xs text-white/40 truncate mt-0.5"},Is={key:4,class:"absolute top-1.5 left-1.5"},Ds={class:"text-xs px-1.5 py-0.5 rounded bg-black/60 text-amber-400 backdrop-blur-sm font-medium"},Bs={key:5,class:"absolute top-1.5 right-1.5"},Ls={class:"text-xs px-1 py-0.5 rounded bg-black/60 text-white/70 backdrop-blur-sm"},Ps={key:0,class:"flex items-center justify-center py-12"},Ns=O({__name:"BookGrid",props:{books:{},title:{default:"Recommended Books"}},emits:["selectBook"],setup(a){const d=a,{isDark:l}=Z(),w=j(""),g=j(null),{coverSrc:v,fallbackSrc:x,onError:f,isLoading:$}=Ae({items:Ne(d,"books"),id:c=>c.id,existingUrl:c=>c.coverUrl,fetch:c=>rt(c.title,c.author),fallback:c=>qt(c.title,c.author)}),_=B(()=>{const c=new Map;for(const o of d.books)for(const r of o.genres??[])c.set(r,(c.get(r)??0)+1);return[...c.entries()].sort((o,r)=>r[1]-o[1]).slice(0,8).map(([o])=>o)}),b=B(()=>{let c=d.books;if(w.value){const o=w.value.toLowerCase();c=c.filter(r=>r.title.toLowerCase().includes(o)||r.author.toLowerCase().includes(o)||(r.genres??[]).some(h=>h.toLowerCase().includes(o)))}return g.value&&(c=c.filter(o=>(o.genres??[]).includes(g.value))),c});return(c,o)=>(s(),n("div",ps,[e("div",{class:"p-4 space-y-3",style:G(t(l)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("div",gs,[e("h3",{class:i(["text-sm font-bold",t(l)?"text-white/90":"text-gray-900"])},u(a.title),3),e("div",bs,[e("span",{class:i(["text-xs font-mono",t(l)?"text-white/30":"text-gray-400"])},u(b.value.length)+" books ",3),ie(c.$slots,"header-actions")])]),K(e("input",{"onUpdate:modelValue":o[0]||(o[0]=r=>w.value=r),type:"text",placeholder:"Search books...",class:i(["w-full px-3 py-2 rounded-lg text-base outline-none transition-colors",t(l)?"bg-white/5 text-white/80 placeholder:text-white/25 focus:bg-white/10":"bg-black/3 text-gray-800 placeholder:text-gray-400 focus:bg-black/5"])},null,2),[[J,w.value]]),_.value.length>0?(s(),n("div",vs,[(s(!0),n(D,null,L(_.value,r=>(s(),n("button",{key:r,class:i(["text-xs px-2 py-1 rounded-md transition-all duration-150",g.value===r?"nav-tab-active":t(l)?"text-white/40 hover:text-white/70 hover:bg-white/5":"text-gray-500 hover:text-gray-800 hover:bg-black/5"]),onClick:h=>g.value=g.value===r?null:r},u(r),11,fs))),128))])):m("",!0)],4),e("div",ms,[e("div",ws,[(s(!0),n(D,null,L(b.value,r=>(s(),n("button",{key:r.id,class:"group flex flex-col items-stretch text-left w-full path-glass-bubble rounded-2xl overflow-hidden transition-all duration-200 hover:brightness-105","aria-label":`${r.title} by ${r.author}`,onClick:h=>c.$emit("selectBook",r)},[e("div",ks,[e("div",{class:i(["aspect-[2/3] relative w-full overflow-hidden rounded-[10px]",t(v)(r)?"":t(l)?"bg-white/[0.06]":"bg-black/[0.04]"])},[t($)(r)?(s(),n("div",$s)):m("",!0),t(v)(r)?(s(),n("img",{key:1,src:t(v)(r),alt:`${r.title} by ${r.author}`,class:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-110",loading:"lazy",onError:h=>t(f)(r)},null,40,_s)):t($)(r)?m("",!0):(s(),n("img",{key:2,src:t(x)(r),alt:r.title,class:"w-full h-full object-cover"},null,8,Cs)),t(v)(r)?(s(),n("div",js)):m("",!0),e("div",Ss,[e("p",Ms,u(r.title),1),e("p",Ts,u(r.author),1)]),r.rating?(s(),n("div",Is,[e("span",Ds," ★ "+u(r.rating.toFixed(1)),1)])):m("",!0),r.year?(s(),n("div",Bs,[e("span",Ls,u(r.year),1)])):m("",!0)],2)])],8,ys))),128))]),b.value.length===0?(s(),n("div",Ps,[e("p",{class:i(["text-sm",t(l)?"text-white/30":"text-gray-400"])}," No books match your search ",2)])):m("",!0)])]))}}),As={class:"h-full flex flex-col"},zs={class:"flex items-center justify-between gap-2"},Es={class:"flex items-center gap-2 shrink-0"},Fs={key:0,class:"flex flex-wrap gap-1.5"},Rs=["onClick"],Vs={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-4 pb-16"},Us={class:"grid grid-cols-2 sm:grid-cols-3 gap-4"},qs=["aria-label","onClick"],Gs={class:"cover-card flex-1 min-h-0 relative"},Os={key:0,class:"absolute inset-0 animate-shimmer"},Hs=["src","alt","onError"],Ws=["src","alt"],Ks={key:3,class:"absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent pointer-events-none"},Ys={class:"absolute bottom-0 left-0 right-0 p-2"},Qs={class:"text-xs font-semibold text-white/90 leading-tight truncate"},Js={class:"text-xs text-white/40 truncate mt-0.5"},Zs={key:4,class:"absolute top-1.5 left-1.5"},Xs={class:"text-xs px-1.5 py-0.5 rounded bg-black/60 text-amber-400 backdrop-blur-sm font-medium"},en={key:5,class:"absolute top-1.5 right-1.5"},tn={class:"absolute top-1.5 right-1.5 flex gap-0.5 flex-wrap justify-end max-w-[60%]"},sn={key:0,class:"flex items-center justify-center py-12"},nn=O({__name:"TVSeriesGrid",props:{series:{},title:{default:"Recommended TV Series"}},emits:["selectSeries"],setup(a){const d=a,{isDark:l}=Z(),w=j(""),g=j(null),{coverSrc:v,fallbackSrc:x,onError:f,isLoading:$}=Ae({items:Ne(d,"series"),id:o=>o.id,existingUrl:o=>o.posterUrl||o.backdropUrl,fetch:o=>ct(o.title,o.year).then(r=>r.posterUrl),fallback:o=>Gt(o.title,o.year)});function _(o){return o.year?o.endYear&&o.endYear!==o.year?`${o.year}–${o.endYear}`:o.status==="ongoing"?`${o.year}–`:String(o.year):""}const b=B(()=>{const o=new Map;for(const r of d.series)for(const h of r.genres??[])o.set(h,(o.get(h)??0)+1);return[...o.entries()].sort((r,h)=>h[1]-r[1]).slice(0,8).map(([r])=>r)}),c=B(()=>{let o=d.series;if(w.value){const r=w.value.toLowerCase();o=o.filter(h=>h.title.toLowerCase().includes(r)||(h.creator??"").toLowerCase().includes(r)||(h.network??"").toLowerCase().includes(r)||(h.genres??[]).some(M=>M.toLowerCase().includes(r)))}return g.value&&(o=o.filter(r=>(r.genres??[]).includes(g.value))),o});return(o,r)=>(s(),n("div",As,[e("div",{class:"p-4 space-y-3",style:G(t(l)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("div",zs,[e("h3",{class:i(["text-sm font-bold",t(l)?"text-white/90":"text-gray-900"])},u(a.title),3),e("div",Es,[e("span",{class:i(["text-xs font-mono",t(l)?"text-white/30":"text-gray-400"])},u(c.value.length)+" series ",3),ie(o.$slots,"header-actions")])]),K(e("input",{"onUpdate:modelValue":r[0]||(r[0]=h=>w.value=h),type:"text",placeholder:"Search TV series...",class:i(["w-full px-3 py-2 rounded-lg text-base outline-none transition-colors",t(l)?"bg-white/5 text-white/80 placeholder:text-white/25 focus:bg-white/10":"bg-black/3 text-gray-800 placeholder:text-gray-400 focus:bg-black/5"])},null,2),[[J,w.value]]),b.value.length>0?(s(),n("div",Fs,[(s(!0),n(D,null,L(b.value,h=>(s(),n("button",{key:h,class:i(["text-xs px-2 py-1 rounded-md transition-all duration-150",g.value===h?"nav-tab-active":t(l)?"text-white/40 hover:text-white/70 hover:bg-white/5":"text-gray-500 hover:text-gray-800 hover:bg-black/5"]),onClick:M=>g.value=g.value===h?null:h},u(h),11,Rs))),128))])):m("",!0)],4),e("div",Vs,[e("div",Us,[(s(!0),n(D,null,L(c.value,h=>(s(),n("button",{key:h.id,class:"group flex flex-col items-stretch text-left w-full path-glass-bubble rounded-2xl overflow-hidden transition-all duration-200 hover:brightness-105","aria-label":h.title,onClick:M=>o.$emit("selectSeries",h)},[e("div",Gs,[e("div",{class:i(["aspect-[2/3] relative w-full overflow-hidden rounded-[10px]",t(v)(h)?"":t(l)?"bg-white/[0.06]":"bg-black/[0.04]"])},[t($)(h)?(s(),n("div",Os)):m("",!0),t(v)(h)?(s(),n("img",{key:1,src:t(v)(h),alt:`${h.title} — TV Series`,class:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-110",loading:"lazy",onError:M=>t(f)(h)},null,40,Hs)):t($)(h)?m("",!0):(s(),n("img",{key:2,src:t(x)(h),alt:h.title,class:"w-full h-full object-cover"},null,8,Ws)),t(v)(h)?(s(),n("div",Ks)):m("",!0),e("div",Ys,[e("p",Qs,u(h.title),1),e("p",Js,[se(u(_(h)),1),h.seasons?(s(),n(D,{key:0},[se(" · "+u(h.seasons)+"S",1)],64)):m("",!0)])]),h.rating?(s(),n("div",Zs,[e("span",Xs," ★ "+u(h.rating.toFixed(1)),1)])):m("",!0),h.status==="ongoing"?(s(),n("div",en,[...r[1]||(r[1]=[e("span",{class:"text-xs px-1 py-0.5 rounded bg-emerald-500/80 text-white backdrop-blur-sm"}," ongoing ",-1)])])):m("",!0),e("div",tn,[(s(!0),n(D,null,L((h.sources??[]).slice(0,2),M=>(s(),n("span",{key:M.type,class:"text-xs px-1 py-0.5 rounded bg-black/60 text-white/70 backdrop-blur-sm"},u(M.type),1))),128))])],2)])],8,qs))),128))]),c.value.length===0?(s(),n("div",sn,[e("p",{class:i(["text-sm",t(l)?"text-white/30":"text-gray-400"])}," No TV series match your search ",2)])):m("",!0)])]))}}),ln={class:"h-full flex flex-col"},on={class:"flex items-center justify-between gap-2"},an={class:"flex items-center gap-2 shrink-0"},rn={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-4 pb-16"},cn={class:"columns-2 sm:columns-3 gap-3 space-y-3"},dn=["aria-label","onClick"],un=["src","alt","onError"],hn={key:2,class:"absolute bottom-0 left-0 right-0 p-2 bg-gradient-to-t from-black/70 via-black/30 to-transparent"},xn={key:0,class:"text-xs font-medium text-white/90 truncate"},pn={key:1,class:"text-xs text-white/50 truncate"},gn={key:0,class:"flex items-center justify-center py-12"},bn=O({__name:"ImageGrid",props:{images:{},title:{default:"Images"}},emits:["selectImage"],setup(a){const{isDark:d}=Z(),l=j(new Set);function w(g){l.value.add(g.id),l.value=new Set(l.value)}return(g,v)=>(s(),n("div",ln,[e("div",{class:"p-4 space-y-3",style:G(t(d)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("div",on,[e("h3",{class:i(["text-sm font-bold",t(d)?"text-white/90":"text-gray-900"])},u(a.title),3),e("div",an,[e("span",{class:i(["text-xs font-mono",t(d)?"text-white/30":"text-gray-400"])},u(a.images.length)+" images ",3),ie(g.$slots,"header-actions")])])],4),e("div",rn,[e("div",cn,[(s(!0),n(D,null,L(a.images,x=>(s(),n("button",{key:x.id,class:i(["group w-full break-inside-avoid text-left rounded-xl overflow-hidden transition-all duration-200 hover:brightness-110 relative",t(d)?"bg-white/5":"bg-black/3"]),"aria-label":x.alt||x.title||"Image",onClick:f=>g.$emit("selectImage",x)},[l.value.has(x.id)?(s(),n("div",{key:1,class:i(["w-full aspect-[4/3] flex items-center justify-center",t(d)?"bg-white/5":"bg-black/5"])},[(s(),n("svg",{class:i(["w-8 h-8",t(d)?"text-white/15":"text-gray-300"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...v[0]||(v[0]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"},null,-1)])],2))],2)):(s(),n("img",{key:0,src:x.url,alt:x.alt||x.title||"Image",class:"w-full block transition-transform duration-300 group-hover:scale-[1.03]",loading:"lazy",onError:f=>w(x)},null,40,un)),x.title||x.source?(s(),n("div",hn,[x.title?(s(),n("p",xn,u(x.title),1)):m("",!0),x.source?(s(),n("p",pn,u(x.source),1)):m("",!0)])):m("",!0)],10,dn))),128))]),a.images.length===0?(s(),n("div",gn,[e("p",{class:i(["text-sm",t(d)?"text-white/30":"text-gray-400"])}," No images found ",2)])):m("",!0)])]))}}),vn={class:"h-full flex flex-col"},fn={class:"p-4 space-y-3"},mn={class:"flex items-center justify-between"},wn={class:"shrink-0 flex items-center gap-2"},yn={key:0,class:"flex flex-wrap gap-1.5"},kn=["onClick"],$n={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pb-16"},_n={class:"grid grid-cols-2 sm:grid-cols-3 gap-3"},Cn=["aria-label","onClick"],jn={class:"aspect-[4/3] relative w-full overflow-hidden rounded-t-[10px]"},Sn={key:0,class:"absolute inset-0 animate-shimmer"},Mn=["src","alt","onError"],Tn=["src","alt"],In={key:3,class:"absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent pointer-events-none"},Dn={class:"absolute bottom-0 left-0 right-0 p-2"},Bn={class:"text-xs font-semibold text-white/90 truncate"},Ln={class:"text-xs text-white/40 truncate mt-0.5"},Pn={key:4,class:"absolute top-1.5 right-1.5"},Nn={class:"text-xs px-1.5 py-0.5 rounded bg-black/60 text-amber-400 backdrop-blur-sm font-semibold"},An={key:5,class:"absolute top-1.5 left-1.5"},zn={class:"text-xs px-1 py-0.5 rounded bg-black/60 text-white/70 backdrop-blur-sm"},En={key:0,class:"flex items-center justify-center py-12"},Fn=O({__name:"PlaceGrid",props:{places:{},title:{default:"Places"}},emits:["selectPlace"],setup(a){const d=a,{isDark:l}=Z(),w=j(""),g=j(null),{coverSrc:v,fallbackSrc:x,onError:f,isLoading:$}=Ae({items:Ne(d,"places"),id:c=>c.id,existingUrl:c=>c.photoUrl,fetch:c=>ut(c.name,c.city),fallback:c=>dt(c.name,c.cuisine||c.category)}),_=B(()=>{const c=new Map;for(const o of d.places){const r=o.cuisine||o.category;r&&c.set(r,(c.get(r)??0)+1)}return[...c.entries()].sort((o,r)=>r[1]-o[1]).slice(0,8).map(([o])=>o)}),b=B(()=>{let c=d.places;if(w.value){const o=w.value.toLowerCase();c=c.filter(r=>r.name.toLowerCase().includes(o)||r.cuisine?.toLowerCase().includes(o)||r.category?.toLowerCase().includes(o)||r.city?.toLowerCase().includes(o)||r.address?.toLowerCase().includes(o))}return g.value&&(c=c.filter(o=>o.cuisine===g.value||o.category===g.value)),c});return(c,o)=>(s(),n("div",vn,[e("div",fn,[e("div",mn,[e("h3",{class:i(["text-base font-bold",t(l)?"text-white/90":"text-gray-900"])},u(a.title||"Places"),3),e("div",wn,[e("span",{class:i(["text-xs",t(l)?"text-white/30":"text-gray-400"])},u(b.value.length)+" places ",3),ie(c.$slots,"header-actions")])]),K(e("input",{"onUpdate:modelValue":o[0]||(o[0]=r=>w.value=r),type:"text",placeholder:"Search places...",class:i(["w-full text-base px-3 py-2 rounded-lg outline-none transition-colors",t(l)?"bg-white/5 text-white/80 placeholder-white/25 focus:bg-white/8":"bg-black/5 text-gray-800 placeholder-gray-400 focus:bg-black/8"])},null,2),[[J,w.value]]),_.value.length>1?(s(),n("div",yn,[(s(!0),n(D,null,L(_.value,r=>(s(),n("button",{key:r,class:i(["text-xs px-2 py-1 rounded-md font-medium transition-all duration-150",g.value===r?"nav-tab-active":t(l)?"bg-white/5 text-white/40 hover:text-white/70":"bg-black/5 text-gray-500 hover:text-gray-800"]),onClick:h=>g.value=g.value===r?null:r},u(r),11,kn))),128))])):m("",!0)]),e("div",$n,[e("div",_n,[(s(!0),n(D,null,L(b.value,r=>(s(),n("button",{key:r.id,class:"group flex flex-col items-stretch text-left w-full path-glass-bubble rounded-2xl overflow-hidden transition-all duration-200 hover:brightness-105","aria-label":r.name,onClick:h=>c.$emit("selectPlace",r)},[e("div",jn,[t($)(r)?(s(),n("div",Sn)):m("",!0),t(v)(r)?(s(),n("img",{key:1,src:t(v)(r),alt:r.name,class:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-110",loading:"lazy",onError:h=>t(f)(r)},null,40,Mn)):t($)(r)?m("",!0):(s(),n("img",{key:2,src:t(x)(r),alt:r.name,class:"w-full h-full object-cover"},null,8,Tn)),t(v)(r)?(s(),n("div",In)):m("",!0),e("div",Dn,[e("p",Bn,u(r.name),1),e("p",Ln,u(r.cuisine||r.category),1)]),r.rating?(s(),n("div",Pn,[e("span",Nn," ★ "+u(r.rating.toFixed(1)),1)])):m("",!0),r.priceLevel?(s(),n("div",An,[e("span",zn,u("$".repeat(r.priceLevel)),1)])):m("",!0)])],8,Cn))),128))]),b.value.length===0?(s(),n("div",En,[e("p",{class:i(["text-xs",t(l)?"text-white/30":"text-gray-400"])}," No places match your search ",2)])):m("",!0)])]))}}),Rn={class:"h-full flex flex-col"},Vn={class:"flex items-center justify-between gap-2"},Un={class:"flex items-center gap-2 shrink-0"},qn={key:0,class:"flex flex-wrap gap-1.5"},Gn=["onClick"],On={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-4 pb-16"},Hn={class:"grid grid-cols-2 sm:grid-cols-3 gap-4"},Wn=["aria-label","onClick"],Kn={class:"cover-card flex-1 min-h-0 relative"},Yn={key:0,class:"absolute inset-0 animate-shimmer"},Qn=["src","alt","onError"],Jn=["src","alt"],Zn={key:3,class:"absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent pointer-events-none"},Xn={class:"absolute bottom-0 left-0 right-0 p-2"},el={class:"text-xs font-semibold text-white/90 leading-tight truncate"},tl={class:"text-xs text-white/40 truncate mt-0.5"},sl={class:"absolute top-1.5 right-1.5 flex gap-0.5 flex-wrap justify-end max-w-[60%]"},nl={key:0,class:"flex items-center justify-center py-12"},ll=O({__name:"PodcastGrid",props:{podcasts:{},title:{default:"Recommended Podcasts"}},emits:["selectPodcast"],setup(a){const d=a,{isDark:l}=Z(),w=j(""),g=j(null),{coverSrc:v,fallbackSrc:x,onError:f,isLoading:$}=Ae({items:Ne(d,"podcasts"),id:c=>c.id,existingUrl:c=>c.coverUrl,fetch:c=>xt(c.title,c.host),fallback:c=>ht(c.title,c.host)}),_=B(()=>{const c=new Map;for(const o of d.podcasts)for(const r of o.genres??[])c.set(r,(c.get(r)??0)+1);return[...c.entries()].sort((o,r)=>r[1]-o[1]).slice(0,8).map(([o])=>o)}),b=B(()=>{let c=d.podcasts;if(w.value){const o=w.value.toLowerCase();c=c.filter(r=>r.title.toLowerCase().includes(o)||(r.host??"").toLowerCase().includes(o)||(r.genres??[]).some(h=>h.toLowerCase().includes(o)))}return g.value&&(c=c.filter(o=>(o.genres??[]).includes(g.value))),c});return(c,o)=>(s(),n("div",Rn,[e("div",{class:"p-4 space-y-3",style:G(t(l)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("div",Vn,[e("h3",{class:i(["text-sm font-bold",t(l)?"text-white/90":"text-gray-900"])},u(a.title),3),e("div",Un,[e("span",{class:i(["text-xs font-mono",t(l)?"text-white/30":"text-gray-400"])},u(b.value.length)+" podcasts ",3),ie(c.$slots,"header-actions")])]),K(e("input",{"onUpdate:modelValue":o[0]||(o[0]=r=>w.value=r),type:"text",placeholder:"Search podcasts...",class:i(["w-full px-3 py-2 rounded-lg text-base outline-none transition-colors",t(l)?"bg-white/5 text-white/80 placeholder:text-white/25 focus:bg-white/10":"bg-black/3 text-gray-800 placeholder:text-gray-400 focus:bg-black/5"])},null,2),[[J,w.value]]),_.value.length>0?(s(),n("div",qn,[(s(!0),n(D,null,L(_.value,r=>(s(),n("button",{key:r,class:i(["text-xs px-2 py-1 rounded-md transition-all duration-150",g.value===r?"nav-tab-active":t(l)?"text-white/40 hover:text-white/70 hover:bg-white/5":"text-gray-500 hover:text-gray-800 hover:bg-black/5"]),onClick:h=>g.value=g.value===r?null:r},u(r),11,Gn))),128))])):m("",!0)],4),e("div",On,[e("div",Hn,[(s(!0),n(D,null,L(b.value,r=>(s(),n("button",{key:r.id,class:"group flex flex-col items-stretch text-left w-full path-glass-bubble rounded-2xl overflow-hidden transition-all duration-200 hover:brightness-105","aria-label":r.title,onClick:h=>c.$emit("selectPodcast",r)},[e("div",Kn,[e("div",{class:i(["aspect-square relative w-full overflow-hidden rounded-[10px]",t(v)(r)?"":t(l)?"bg-white/[0.06]":"bg-black/[0.04]"])},[t($)(r)?(s(),n("div",Yn)):m("",!0),t(v)(r)?(s(),n("img",{key:1,src:t(v)(r),alt:r.title,class:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-110",loading:"lazy",onError:h=>t(f)(r)},null,40,Qn)):t($)(r)?m("",!0):(s(),n("img",{key:2,src:t(x)(r),alt:r.title,class:"w-full h-full object-cover"},null,8,Jn)),t(v)(r)?(s(),n("div",Zn)):m("",!0),e("div",Xn,[e("p",el,u(r.title),1),e("p",tl,u(r.host||"Podcast"),1)]),e("div",sl,[(s(!0),n(D,null,L(r.sources.slice(0,2),h=>(s(),n("span",{key:h.type,class:"text-xs px-1 py-0.5 rounded bg-black/60 text-white/70 backdrop-blur-sm"},u(h.type),1))),128))])],2)])],8,Wn))),128))]),b.value.length===0?(s(),n("div",nl,[e("p",{class:i(["text-sm",t(l)?"text-white/30":"text-gray-400"])}," No podcasts match your search ",2)])):m("",!0)])]))}}),ol={class:"shrink-0"},al={class:"flex-1 overflow-y-auto custom-scrollbar"},il={key:0,class:"relative overflow-hidden",style:{minHeight:"180px"}},rl={class:"absolute inset-0"},cl=["src"],dl={class:"relative z-10 flex flex-col justify-end h-full px-5 pb-5 pt-12",style:{"min-height":"180px"}},ul={class:"px-3 pt-2 pb-8"},hl={key:0,"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 2a10 10 0 100 20 10 10 0 000-20zm0 0v2m0 16v2m10-10h-2M4 12H2m15.07-5.07l-1.41 1.41M8.34 15.66l-1.41 1.41m0-11.14l1.41 1.41m7.32 7.32l1.41 1.41"},xl={key:1,"stroke-linecap":"round","stroke-linejoin":"round",d:"M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z"},pl={key:2,"stroke-linecap":"round","stroke-linejoin":"round",d:"M13 2L3 14h9l-1 8 10-12h-9l1-8z"},gl={key:3,"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 6h16M4 12h16M4 18h7"},bl=["onClick"],vl=["onClick"],fl={key:1,class:"flex items-center justify-center py-16 px-4"},ml=O({__name:"MagazineGrid",props:{sections:{},heroImageUrl:{default:null},title:{default:"Brief"},query:{default:""}},setup(a){const d=a,{isDark:l}=Z(),{openMagazineSectionDetail:w}=$e(),g=["compass","bookmark","lightning","lines"];function v(b){return b.replace(/\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/https?:\/\/\S+/g,"").replace(/\uFE0F/g,"").replace(new RegExp("(?:^|(?<=\\s))[\\p{Emoji_Presentation}\\p{Extended_Pictographic}]+\\s*","gu"),"").replace(/---+/g,"").replace(/^#+\s*/gm,"").replace(/\*\*/g,"").replace(/\*([^*\n]+)\*/g,"$1").replace(/\|/g,", ").replace(/,\s*,+/g,",").replace(/^\s*[-•]\s+/gm,"").replace(/\n+/g," ").replace(/(^|\s),\s*/g,"$1").trim()}function x(b,c){const o=v(b);return o.length<=c?o:o.slice(0,c).replace(/\s+\S*$/,"")+" ..."}const f=B(()=>{const b=[],c=d.sections;if(!c.length)return b;let o=0;for(const S of d.query||"brief")o=(o<<5)-o+S.charCodeAt(0)|0;let r="",h=0,M=!1;return c.forEach((S,N)=>{if(N===0&&!S.group){b.push({type:"wide",title:S.title,text:x(S.content,200),label:"The Lead",author:S.author,section:S});return}const I=S.group||"";if(I&&I!==r&&(M&&(b.push({type:"dark",title:"",text:""}),M=!1),b.push({type:"banner",title:"",text:"",icon:g[h%g.length],label:I}),h++,r=I),I){const C=M?"dark":"half",k=v(S.content),p=v(S.title),y=k.toLowerCase().startsWith(p.toLowerCase().slice(0,30));b.push({type:C,title:y?"":S.title,text:x(S.content,y?160:100),section:S}),M=!M}else M&&(b.push({type:"dark",title:"",text:""}),M=!1),b.push({type:"wide",title:S.title,text:x(S.content,180),author:S.author,section:S})}),M&&b.push({type:"dark",title:"",text:""}),b});function $(b){const c=d.sections.indexOf(b);w(b,c>=0?c:0)}const _=B(()=>{const b=(d.query??"").trim();return b?b.length>100?b.slice(0,97)+"...":b:d.title});return(b,c)=>(s(),n("div",{class:i(["magazine h-full flex flex-col",t(l)?"magazine-dark":"magazine-light"])},[e("header",{class:i(["shrink-0 px-5 py-4 flex items-center justify-between border-b",t(l)?"border-white/10":"border-black/10"])},[e("h1",{class:i(["font-serif text-xl font-bold tracking-tight",t(l)?"text-white":"text-black"])}," AI Brief ",2),e("div",ol,[ie(b.$slots,"header-actions",{},void 0,!0)])],2),e("div",al,[_.value?(s(),n("div",il,[e("div",rl,[a.heroImageUrl?(s(),n("img",{key:0,src:a.heroImageUrl,alt:"",class:"w-full h-full object-cover",style:{filter:"saturate(0.3) contrast(1.1)"}},null,8,cl)):(s(),n("div",{key:1,class:i(["w-full h-full",t(l)?"bg-gradient-to-br from-white/[0.04] via-white/[0.02] to-transparent":"bg-gradient-to-br from-black/[0.06] via-black/[0.03] to-transparent"])},null,2))]),e("div",{class:i(["absolute inset-0",t(l)?"bg-gradient-to-t from-[#0a0a0a] via-[#0a0a0a]/80 to-[#0a0a0a]/60":"bg-gradient-to-t from-[#faf9f6] via-[#faf9f6]/85 to-[#faf9f6]/65"])},null,2),e("div",dl,[e("p",{class:i(["text-xs uppercase tracking-[0.3em] font-medium mb-2",t(l)?"text-white/40":"text-black/40"])}," In response to ",2),e("p",{class:i(["font-serif text-2xl italic leading-tight",t(l)?"text-white/70":"text-black/60"])},u(_.value),3)])])):m("",!0),e("div",ul,[e("div",{class:i(["grid grid-cols-2 gap-px",t(l)?"bg-white/12":"bg-black/10"])},[(s(!0),n(D,null,L(f.value,(o,r)=>(s(),n(D,{key:r},[o.type==="banner"?(s(),n("div",{key:0,class:i(["col-span-2 flex flex-col items-center justify-center py-8 px-5",t(l)?"bg-[#0a0a0a]":"bg-[#faf9f6]"])},[(s(),n("svg",{class:i(["w-5 h-5 mb-2.5",t(l)?"text-white/20":"text-black/15"]),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[o.icon==="compass"?(s(),n("path",hl)):o.icon==="bookmark"?(s(),n("path",xl)):o.icon==="lightning"?(s(),n("path",pl)):(s(),n("path",gl))],2)),e("p",{class:i(["text-xs uppercase tracking-[0.3em] font-semibold text-center",t(l)?"text-white/30":"text-black/30"])},u(o.label),3)],2)):o.type==="wide"?(s(),n("button",{key:1,class:i(["col-span-2 text-left px-5 py-5 transition-colors cursor-pointer",t(l)?"bg-[#0a0a0a] hover:bg-white/[0.03]":"bg-[#faf9f6] hover:bg-black/[0.02]"]),onClick:h=>o.section&&$(o.section)},[o.label?(s(),n("p",{key:0,class:i(["text-xs uppercase tracking-[0.3em] font-semibold mb-2",t(l)?"text-white/30":"text-black/35"])},u(o.label),3)):m("",!0),e("h2",{class:i(["font-serif text-lg font-bold leading-snug mb-2",t(l)?"text-white/95":"text-black/90"])},u(o.title),3),o.author?(s(),n("p",{key:1,class:i(["text-xs mb-2",t(l)?"text-white/40":"text-black/40"])}," By "+u(o.author),3)):m("",!0),e("p",{class:i(["font-serif text-sm leading-relaxed",t(l)?"text-white/70":"text-black/60"])},u(o.text),3)],10,bl)):(s(),n("button",{key:2,class:i(["text-left px-4 py-4 transition-colors flex flex-col cursor-pointer",[t(l)?"bg-[#0a0a0a] hover:bg-white/[0.03]":"bg-[#faf9f6] hover:bg-black/[0.02]",o.type==="dark"?t(l)?"bg-white/[0.04]":"bg-black/[0.04]":""]]),onClick:h=>o.section&&$(o.section)},[o.label?(s(),n("p",{key:0,class:i(["text-xs uppercase tracking-[0.25em] font-semibold mb-1.5",t(l)?"text-white/25":"text-black/30"])},u(o.label),3)):m("",!0),o.title?(s(),n("h3",{key:1,class:i(["font-serif text-sm font-bold leading-snug mb-1",t(l)?"text-white/90":"text-black/85"])},u(o.title),3)):m("",!0),e("p",{class:i(["font-serif text-xs leading-relaxed flex-1",[t(l)?"text-white/55":"text-black/50",o.title?"":"italic"]])},u(o.text),3)],10,vl))],64))),128))],2)]),a.sections.length===0?(s(),n("div",fl,[e("p",{class:i(["text-sm",t(l)?"text-white/40":"text-gray-400"])}," No sections to display ",2)])):m("",!0)])],2))}}),st=Ie(ml,[["__scopeId","data-v-02741b8c"]]),wl={class:"h-full flex flex-col"},yl={class:"flex items-center justify-between gap-2"},kl={class:"flex items-center gap-2 shrink-0"},$l=["placeholder"],_l={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-4 pb-16"},Cl={class:"grid grid-cols-2 sm:grid-cols-3 gap-4"},jl=["aria-label","onClick"],Sl={class:"cover-card flex-1 min-h-0 relative"},Ml={class:"aspect-[4/3] flex flex-col w-full overflow-hidden rounded-[10px]"},Tl={class:"flex-1 min-h-0 relative"},Il=["src","alt","onError"],Dl={key:2,class:"absolute inset-0 bg-gradient-to-t from-black/60 via-black/20 to-transparent pointer-events-none"},Bl={key:0,class:"flex items-center justify-center py-12"},nt=O({__name:"NewsGrid",props:{articles:{},title:{default:"News & Articles"},query:{default:""},variant:{default:"news"}},setup(a){const d=a,{isDark:l}=Z(),{openArticleDetail:w,openWebsiteDetail:g}=$e(),v=j(""),x=j(new Set);function f(h){return!h||typeof h!="string"?!1:/^https?:\/\//i.test(h.trim())}function $(h){x.value=new Set([...x.value,h])}function _(h){try{return new URL(h).hostname.replace(/^www\./,"")}catch{return h}}function b(h){return d.variant==="websites"?Ot(h.title,_(h.url)):Ht(h.title,_(h.url))}function c(h){d.variant==="websites"?g(h):w(h)}function o(h,M){if(!M.trim())return 0;const N=M.toLowerCase().split(/\s+/).filter(y=>y.length>1);if(N.length===0)return 0;const I=h.title.toLowerCase(),C=(h.content??"").toLowerCase(),k=h.url.toLowerCase();let p=0;for(const y of N)I.includes(y)&&(p+=3),C.includes(y)&&(p+=2),k.includes(y)&&(p+=1);return p}const r=B(()=>{let h=d.articles;if(v.value.trim()){const M=v.value.toLowerCase();h=h.filter(S=>S.title.toLowerCase().includes(M)||(S.content??"").toLowerCase().includes(M)||S.url.toLowerCase().includes(M))}return d.query.trim()?[...h].sort((M,S)=>o(S,d.query)-o(M,d.query)):h});return(h,M)=>(s(),n("div",wl,[e("div",{class:"p-4 space-y-3",style:G(t(l)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("div",yl,[e("h3",{class:i(["text-sm font-bold",t(l)?"text-white/90":"text-gray-900"])},u(a.title),3),e("div",kl,[e("span",{class:i(["text-xs font-mono",t(l)?"text-white/30":"text-gray-400"])},u(r.value.length)+" "+u(a.variant==="websites"?"websites":"articles"),3),ie(h.$slots,"header-actions")])]),K(e("input",{"onUpdate:modelValue":M[0]||(M[0]=S=>v.value=S),type:"text",placeholder:a.variant==="websites"?"Search websites...":"Search articles...",class:i(["w-full px-3 py-2 rounded-lg text-base outline-none transition-colors",t(l)?"bg-white/5 text-white/80 placeholder:text-white/25 focus:bg-white/10":"bg-black/3 text-gray-800 placeholder:text-gray-400 focus:bg-black/5"])},null,10,$l),[[J,v.value]])],4),e("div",_l,[e("div",Cl,[(s(!0),n(D,null,L(r.value,(S,N)=>(s(),n("button",{key:N,class:"group flex flex-col items-stretch text-left w-full path-glass-bubble rounded-2xl overflow-hidden transition-all duration-200 hover:brightness-105","aria-label":S.title,onClick:I=>c(S)},[e("div",Sl,[e("div",Ml,[e("div",Tl,[f(S.imgSrc)&&!x.value.has(S.url)?(s(),n("img",{key:0,src:S.imgSrc,alt:S.title,class:"absolute inset-0 w-full h-full object-cover transition-transform duration-300 group-hover:scale-110",loading:"lazy",onError:I=>$(S.url)},null,40,Il)):(s(),n("div",{key:1,class:"absolute inset-0 bg-cover bg-center",style:G({backgroundImage:`url(${b(S)})`})},null,4)),f(S.imgSrc)&&!x.value.has(S.url)?(s(),n("div",Dl)):m("",!0)]),e("div",{class:i(["shrink-0 p-2 backdrop-blur-md rounded-b-[10px]",[t(l)?"bg-black shadow-[inset_0_1px_0_rgba(255,255,255,0.12)]":"bg-white shadow-[inset_0_1px_0_rgba(0,0,0,0.06)]"]])},[e("p",{class:i(["text-xs font-semibold leading-tight line-clamp-2",t(l)?"text-white/95":"text-gray-900"])},u(S.title),3),S.content?(s(),n("p",{key:0,class:i(["text-xs line-clamp-1 mt-0.5",t(l)?"text-white/70":"text-gray-600"])},u(S.content),3)):m("",!0),e("p",{class:i(["text-xs truncate mt-0.5",t(l)?"text-white/50":"text-gray-500"])},u(_(S.url)),3)],2)])])],8,jl))),128))]),r.value.length===0?(s(),n("div",Bl,[e("p",{class:i(["text-sm",t(l)?"text-white/30":"text-gray-400"])},u(a.variant==="websites"?"No websites match your search":"No articles match your search"),3)])):m("",!0)])]))}}),Ll={class:"h-full flex flex-col"},Pl={class:"flex items-center justify-between gap-2"},Nl={class:"flex items-center gap-2 shrink-0"},Al={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-4 pb-16"},zl={class:"grid grid-cols-1 sm:grid-cols-2 gap-3"},El=["aria-label","onClick"],Fl={class:"aspect-[3/1] relative w-full overflow-hidden"},Rl=["src","alt"],Vl={class:"p-3"},Ul={class:"flex items-center gap-3 mt-2 flex-wrap"},ql={key:0,class:"flex items-center justify-center py-12"},Gl=O({__name:"RecipeGrid",props:{recipes:{},title:{default:"Recipes"}},emits:["selectRecipe"],setup(a){const d=a,{isDark:l}=Z(),w=j(""),g=B(()=>{if(!w.value.trim())return d.recipes;const v=w.value.toLowerCase();return d.recipes.filter(x=>x.title.toLowerCase().includes(v)||x.ingredients.some(f=>f.toLowerCase().includes(v)))});return(v,x)=>(s(),n("div",Ll,[e("div",{class:"p-4 space-y-3",style:G(t(l)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("div",Pl,[e("h3",{class:i(["text-sm font-bold",t(l)?"text-white/90":"text-gray-900"])},u(a.title),3),e("div",Nl,[e("span",{class:i(["text-xs font-mono",t(l)?"text-white/30":"text-gray-400"])},u(g.value.length)+" recipes ",3),ie(v.$slots,"header-actions")])]),a.recipes.length>3?K((s(),n("input",{key:0,"onUpdate:modelValue":x[0]||(x[0]=f=>w.value=f),type:"text",placeholder:"Search recipes...",class:i(["w-full px-3 py-2 rounded-lg text-base outline-none transition-colors",t(l)?"bg-white/5 text-white/80 placeholder:text-white/25 focus:bg-white/10":"bg-black/3 text-gray-800 placeholder:text-gray-400 focus:bg-black/5"])},null,2)),[[J,w.value]]):m("",!0)],4),e("div",Al,[e("div",zl,[(s(!0),n(D,null,L(g.value,(f,$)=>(s(),n("button",{key:$,class:i(["group flex flex-col items-stretch text-left w-full rounded-2xl overflow-hidden transition-all duration-200 hover:brightness-105",t(l)?"bg-white/[0.04] border border-white/8 hover:bg-white/[0.07]":"bg-black/[0.02] border border-black/5 hover:bg-black/[0.05]"]),"aria-label":f.title,onClick:_=>v.$emit("selectRecipe",f)},[e("div",Fl,[e("img",{src:t(Wt)(f.title,f.time),alt:f.title,class:"w-full h-full object-cover"},null,8,Rl)]),e("div",Vl,[e("p",{class:i(["text-sm font-semibold leading-tight line-clamp-2",t(l)?"text-white/90":"text-gray-900"])},u(f.title),3),e("div",Ul,[f.time?(s(),n("span",{key:0,class:i(["flex items-center gap-1 text-xs",t(l)?"text-white/40":"text-gray-500"])},[x[1]||(x[1]=e("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),se(" "+u(f.time),1)],2)):m("",!0),f.servings?(s(),n("span",{key:1,class:i(["flex items-center gap-1 text-xs",t(l)?"text-white/40":"text-gray-500"])},[x[2]||(x[2]=e("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"})],-1)),se(" "+u(f.servings),1)],2)):m("",!0),f.calories?(s(),n("span",{key:2,class:i(["text-xs",t(l)?"text-white/40":"text-gray-500"])},u(f.calories)+" cal ",3)):m("",!0)]),f.ingredients.length>0?(s(),n("p",{key:0,class:i(["text-xs mt-2 line-clamp-1",t(l)?"text-white/25":"text-gray-400"])},u(f.ingredients.slice(0,4).join(" · ")),3)):m("",!0)])],10,El))),128))]),g.value.length===0?(s(),n("div",ql,[e("p",{class:i(["text-sm",t(l)?"text-white/30":"text-gray-400"])}," No recipes match your search ",2)])):m("",!0)])]))}}),Ol={class:"h-full flex flex-col"},Hl={class:"flex items-center justify-between gap-2"},Wl={class:"flex flex-wrap gap-1.5"},Kl=["onClick"],Yl={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-4 pb-16"},Ql={class:"space-y-2"},Jl=["aria-label","onClick"],Zl={class:"text-white/90"},Xl={class:"flex-1 min-w-0"},eo={class:"flex items-center gap-2"},to={class:"flex gap-1 mt-1.5"},so={key:0,class:"flex items-center justify-center py-12"},no=O({__name:"AppsGrid",props:{apps:{},title:{default:"Recommended Apps"}},emits:["selectApp"],setup(a){const d=a,{isDark:l}=Z(),w=j(""),g=j(null),v=[{value:"nostr-client",label:"Nostr"},{value:"lightning-wallet",label:"Lightning"},{value:"bitcoin-wallet",label:"Bitcoin"},{value:"privacy",label:"Privacy"},{value:"node",label:"Nodes"},{value:"dev-tool",label:"Dev"}];function x(b){return v.find(c=>c.value===b)?.label??b}function f(b){return{ios:"iOS",android:"Android",web:"Web",desktop:"Desktop",cli:"CLI",nodeos:"Node"}[b]??b}function $(b){let c=0;for(let r=0;r{let b=d.apps;if(w.value){const c=w.value.toLowerCase();b=b.filter(o=>o.name.toLowerCase().includes(c)||o.description.toLowerCase().includes(c)||o.keywords.some(r=>r.toLowerCase().includes(c)))}return g.value&&(b=b.filter(c=>c.category===g.value)),b});return(b,c)=>(s(),n("div",Ol,[e("div",{class:"p-4 space-y-3",style:G(t(l)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("div",Hl,[e("h3",{class:i(["text-sm font-bold",t(l)?"text-white/90":"text-gray-900"])},u(a.title),3),e("span",{class:i(["text-xs font-mono",t(l)?"text-white/30":"text-gray-400"])},u(_.value.length)+" apps ",3)]),K(e("input",{"onUpdate:modelValue":c[0]||(c[0]=o=>w.value=o),type:"text",placeholder:"Search apps...",class:i(["w-full px-3 py-2 rounded-lg text-base outline-none transition-colors",t(l)?"bg-white/5 text-white/80 placeholder:text-white/25 focus:bg-white/10":"bg-black/3 text-gray-800 placeholder:text-gray-400 focus:bg-black/5"])},null,2),[[J,w.value]]),e("div",Wl,[(s(),n(D,null,L(v,o=>e("button",{key:o.value,class:i(["text-xs px-2 py-1 rounded-md transition-all duration-150",g.value===o.value?"nav-tab-active":t(l)?"text-white/40 hover:text-white/70 hover:bg-white/5":"text-gray-500 hover:text-gray-800 hover:bg-black/5"]),onClick:r=>g.value=g.value===o.value?null:o.value},u(o.label),11,Kl)),64))])],4),e("div",Yl,[e("div",Ql,[(s(!0),n(D,null,L(_.value,o=>(s(),n("button",{key:o.id,class:i(["w-full text-left p-3 rounded-xl transition-all duration-200 flex items-start gap-3",t(l)?"bg-white/5 hover:bg-white/10":"bg-black/3 hover:bg-black/5"]),"aria-label":o.name,onClick:r=>b.$emit("selectApp",o)},[e("div",{class:"w-10 h-10 rounded-xl flex items-center justify-center text-lg font-bold shrink-0",style:G({background:$(o.id)})},[e("span",Zl,u(o.name.charAt(0)),1)],4),e("div",Xl,[e("div",eo,[e("p",{class:i(["text-xs font-semibold truncate",t(l)?"text-white/90":"text-gray-900"])},u(o.name),3),e("span",{class:i(["text-xs px-1.5 py-0.5 rounded font-medium shrink-0",t(l)?"bg-white/10 text-white/50":"bg-black/5 text-gray-500"])},u(x(o.category)),3)]),e("p",{class:i(["text-xs mt-0.5 line-clamp-2",t(l)?"text-white/50":"text-gray-500"])},u(o.description),3),e("div",to,[(s(!0),n(D,null,L(o.platforms,r=>(s(),n("span",{key:r,class:i(["text-xs px-1 py-0.5 rounded",t(l)?"bg-white/5 text-white/30":"bg-black/3 text-gray-400"])},u(f(r)),3))),128))])])],10,Jl))),128))]),_.value.length===0?(s(),n("div",so,[e("p",{class:i(["text-sm",t(l)?"text-white/30":"text-gray-400"])}," No apps match your search ",2)])):m("",!0)])]))}}),lo={key:0,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},oo={key:1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"},ao={class:"truncate"},io={key:1,class:"w-3 h-3 shrink-0 text-accent ml-auto",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},ro={key:0},co=O({__name:"FileTreeNode",props:{entry:{},activeFile:{},depth:{}},emits:["select"],setup(a,{emit:d}){const l=a,{isFileSelected:w}=xe(),g=d,{isDark:v}=Z(),x=j(l.depth<1),f=B(()=>!l.entry.isDirectory&&l.activeFile===l.entry.path),$=B(()=>!l.entry.isDirectory&&w(l.entry.path));function _(){l.entry.isDirectory?x.value=!x.value:g("select",l.entry.path)}return(b,c)=>{const o=Kt("FileTreeNode",!0);return s(),n("div",null,[e("button",{class:i(["w-full text-left flex items-center gap-1.5 py-1 px-2 rounded-lg text-xs transition-colors",[$.value?"bg-accent/15 text-accent ring-1 ring-accent/30":f.value?t(v)?"bg-white/10 text-white/90":"bg-black/8 text-gray-900":t(v)?"text-white/60 hover:bg-white/[0.04] hover:text-white/80":"text-gray-600 hover:bg-black/[0.03] hover:text-gray-800"]]),style:G({paddingLeft:`${a.depth*12+8}px`}),onClick:_},[a.entry.isDirectory?(s(),n("svg",{key:0,class:i(["w-3 h-3 shrink-0 transition-transform duration-150",x.value?"rotate-90":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...c[1]||(c[1]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2)):m("",!0),(s(),n("svg",{class:i(["w-3.5 h-3.5 shrink-0",a.entry.isDirectory?"text-accent/70":t(v)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a.entry.isDirectory?(s(),n("path",lo)):(s(),n("path",oo))],2)),e("span",ao,u(a.entry.name),1),$.value?(s(),n("svg",io,[...c[2]||(c[2]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"3",d:"M5 13l4 4L19 7"},null,-1)])])):m("",!0)],6),a.entry.isDirectory&&x.value&&a.entry.children?(s(),n("div",ro,[(s(!0),n(D,null,L(a.entry.children,r=>(s(),q(o,{key:r.path,entry:r,"active-file":a.activeFile,depth:a.depth+1,onSelect:c[0]||(c[0]=h=>b.$emit("select",h))},null,8,["entry","active-file","depth"]))),128))])):m("",!0)])}}}),uo={class:"flex flex-col h-full"},ho={class:"flex items-center gap-1 min-w-0 flex-1"},xo={class:"flex items-center gap-2 shrink-0"},po={key:0,class:"flex-1 overflow-y-auto custom-scrollbar p-3"},go={class:"mb-3 flex gap-2"},bo={class:"flex justify-end gap-2"},vo=["disabled"],fo={class:"grid grid-cols-2 gap-2"},mo=["onClick"],wo={key:1,class:"flex-1 overflow-y-auto custom-scrollbar p-2"},yo={key:0,class:"flex items-center justify-center py-12"},ko=O({__name:"ProjectGrid",props:{isWideDesktop:{type:Boolean},isMobile:{type:Boolean}},setup(a){const{isDark:d}=Z(),{projectList:l,activeProject:w,fileTree:g,activeFile:v,codeMode:x,selectedFiles:f,selectProject:$,openFile:_,createProject:b,clearActiveFile:c,toggleFileSelection:o,isFileSelected:r,loadProjects:h}=xe();ne(()=>{l.value.length===0&&h()});const M=j(""),S=j(!1),N=j(""),I=j(null),C=B(()=>w.value?"filetree":"projects"),k=B(()=>C.value==="projects"?"Projects":w.value?.name??"Projects"),p=B(()=>{const F=M.value.toLowerCase();return F?l.value.filter(U=>U.name.toLowerCase().includes(F)||(U.language??"").toLowerCase().includes(F)):l.value});function y(F){$(F)}function A(){const{activeProject:F,fileTree:U}=xe();F.value=null,U.value=[],c()}function V(F){o(F),_(F)}function E(){S.value=!0,N.value="",ye(()=>I.value?.focus())}function Y(){S.value=!1,N.value=""}function H(){const F=N.value.trim();F&&(b(F),S.value=!1,N.value="")}return(F,U)=>(s(),n("div",uo,[e("div",{class:"shrink-0 px-4 py-3 flex items-center justify-between gap-2",style:G(t(d)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("div",ho,[C.value!=="projects"?(s(),n("button",{key:0,class:i(["text-xs shrink-0 transition-colors",t(d)?"text-white/40 hover:text-white/70 hover:underline":"text-gray-400 hover:text-gray-700 hover:underline"]),onClick:A}," Projects ",2)):m("",!0),C.value!=="projects"?(s(),n("span",{key:1,class:i(["text-xs shrink-0",t(d)?"text-white/20":"text-gray-300"])},"/",2)):m("",!0),e("span",{class:i(["text-sm font-semibold truncate",t(d)?"text-white/90":"text-gray-900"])},u(k.value),3)]),e("div",xo,[C.value==="projects"?(s(),n("p",{key:0,class:i(["text-xs",t(d)?"text-white/30":"text-gray-400"])},u(t(l).length)+" repos ",3)):C.value==="filetree"?(s(),n("p",{key:1,class:i(["text-xs",t(d)?"text-white/30":"text-gray-400"])},u(t(w)?.language),3)):m("",!0),ie(F.$slots,"header-actions")])],4),C.value==="projects"?(s(),n("div",po,[e("div",go,[K(e("input",{"onUpdate:modelValue":U[0]||(U[0]=W=>M.value=W),type:"text",placeholder:"Search projects...",class:i(["flex-1 min-w-0 px-3 py-2 rounded-lg text-base bg-transparent outline-none",t(d)?"text-white/80 placeholder:text-white/20 border border-white/10 focus:border-white/25":"text-gray-800 placeholder:text-gray-400 border border-black/10 focus:border-black/20"])},null,2),[[J,M.value]]),e("button",{class:i(["shrink-0 px-3 py-2 rounded-lg text-xs font-medium transition-colors flex items-center gap-1.5",t(d)?"bg-accent/20 text-accent hover:bg-accent/30":"bg-accent/10 text-accent hover:bg-accent/20"]),onClick:E},[...U[2]||(U[2]=[e("svg",{class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1),se(" New ",-1)])],2)]),S.value?(s(),n("div",{key:0,class:i(["mb-3 p-3 rounded-xl",t(d)?"bg-white/[0.05] border border-white/10":"bg-black/[0.03] border border-black/8"])},[e("p",{class:i(["text-xs font-medium mb-2",t(d)?"text-white/70":"text-gray-700"])}," New Project ",2),K(e("input",{ref_key:"newProjectInputRef",ref:I,"onUpdate:modelValue":U[1]||(U[1]=W=>N.value=W),type:"text",placeholder:"Project name...",class:i(["w-full px-3 py-2 rounded-lg text-base bg-transparent outline-none mb-2",t(d)?"text-white/80 placeholder:text-white/20 border border-white/10 focus:border-white/25":"text-gray-800 placeholder:text-gray-400 border border-black/10 focus:border-black/20"]),onKeydown:[ae(H,["enter"]),ae(Y,["escape"])]},null,34),[[J,N.value]]),e("div",bo,[e("button",{class:i(["text-xs px-2.5 py-1 rounded-lg transition-colors",t(d)?"text-white/40 hover:text-white/70":"text-gray-500 hover:text-gray-800"]),onClick:Y}," Cancel ",2),e("button",{class:i(["text-xs px-2.5 py-1 rounded-lg font-medium transition-colors",t(d)?"bg-accent/20 text-accent hover:bg-accent/30":"bg-accent/10 text-accent hover:bg-accent/20"]),disabled:!N.value.trim(),onClick:H}," Create ",10,vo)])],2)):m("",!0),e("div",fo,[(s(!0),n(D,null,L(p.value,W=>(s(),n("button",{key:W.path,class:i(["text-left p-3 rounded-xl transition-all duration-150",t(d)?"bg-white/[0.03] hover:bg-white/[0.07] border border-white/5":"bg-black/[0.02] hover:bg-black/[0.05] border border-black/5"]),onClick:le=>y(W)},[e("div",{class:i(["w-8 h-8 rounded-lg flex items-center justify-center mb-2",t(d)?"bg-white/5":"bg-black/5"])},[(s(),n("svg",{class:i(["w-4 h-4",W.isGit?"text-accent":t(d)?"text-white/40":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...U[3]||(U[3]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)])],2))],2),e("p",{class:i(["text-xs font-medium truncate",t(d)?"text-white/80":"text-gray-800"])},u(W.name),3),e("p",{class:i(["text-xs mt-0.5 truncate",t(d)?"text-white/25":"text-gray-400"])},u(W.language),3)],10,mo))),128))])])):C.value==="filetree"?(s(),n("div",wo,[(s(!0),n(D,null,L(t(g),W=>(s(),q(co,{key:W.path,entry:W,"active-file":t(v),depth:0,onSelect:V},null,8,["entry","active-file"]))),128)),t(g).length===0?(s(),n("div",yo,[e("p",{class:i(["text-xs",t(d)?"text-white/30":"text-gray-400"])}," Loading file tree... ",2)])):m("",!0)])):m("",!0)]))}}),$o={class:"flex flex-col h-full"},_o={class:"shrink-0 px-4 py-2 flex gap-1.5 overflow-x-auto scrollbar-hide"},Co=["onClick"],jo={class:"flex-1 overflow-y-auto px-4 py-3"},So={class:"grid grid-cols-2 gap-2"},Mo=["onClick"],To=["onClick"],Io={key:0,class:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Do={key:2,class:"h-8 flex items-end gap-0.5 mb-2"},Bo={key:3,class:"h-8 flex items-center mb-2"},Lo={key:0,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"},Po={key:1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"},No={key:2,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"},Ao={key:3,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828l-8.486 8.485M7 17h.01"},zo=O({__name:"DesignSystemGrid",setup(a){const{isDark:d}=Z(),{openDesignSystemItem:l}=$e(),{codeMode:w,toggleDesignToken:g,isDesignTokenSelected:v}=xe(),x=j("all"),f=[{id:"all",label:"All"},{id:"colors",label:"Colors"},{id:"typography",label:"Typography"},{id:"spacing",label:"Spacing"},{id:"atoms",label:"Atoms"},{id:"molecules",label:"Molecules"},{id:"organisms",label:"Organisms"}],$=[{id:"color-bg",name:"Background",category:"colors",preview:"inline",description:"Primary app background",code:`background-color: #0a0a0a; +/* Tailwind: bg-[#0a0a0a] */`,usedIn:"ChatPage, all panels, base layout"},{id:"color-accent",name:"Accent / Bitcoin",category:"colors",preview:"inline",description:"Primary action color, Bitcoin orange",code:`color: #F7931A; +/* Tailwind: text-accent */`,usedIn:"Gradient buttons, active tabs, zap counts, CTA elements"},{id:"color-primary",name:"Primary",category:"colors",preview:"inline",description:"Primary neutral tone",code:`color: #606060; +/* Tailwind: text-primary */`,usedIn:"Secondary text, borders, muted elements"},{id:"color-surface",name:"Glass Surface",category:"colors",preview:"inline",description:"Glass morphism panel background",code:`background: rgba(0, 0, 0, 0.35); +backdrop-filter: blur(18px); +border: 1px solid rgba(255, 255, 255, 0.18); +/* Tailwind: .glass */`,usedIn:"ChatInput, ContentPanel, all overlay panels"},{id:"color-text-scale",name:"Text Opacity Scale",category:"colors",preview:"inline",description:"/25 placeholder, /40 muted, /60 secondary, /80 body, /90 emphasis",code:`/* Text opacity scale */ +.placeholder { color: rgba(255,255,255, 0.25); } +.muted { color: rgba(255,255,255, 0.40); } +.secondary { color: rgba(255,255,255, 0.60); } +.body { color: rgba(255,255,255, 0.80); } +.emphasis { color: rgba(255,255,255, 0.90); } +.heading { color: rgba(255,255,255, 0.96); }`,usedIn:"Every component — consistent hierarchy across the system"},{id:"type-body",name:"Body Font",category:"typography",description:"Inter / system-ui for all body text",code:`font-family: Inter, system-ui, -apple-system, sans-serif; +/* Applied globally */`,usedIn:"Global default — ChatMessage, grids, detail views"},{id:"type-mono",name:"Monospace Font",category:"typography",description:"Menlo / Monaco for code and IDs",code:`font-family: Menlo, Monaco, "Courier New", monospace; +/* Tailwind: font-mono */`,usedIn:"CodeDetail, conversation IDs, relay URLs, metadata"},{id:"type-serif",name:"Serif Font",category:"typography",description:"Georgia for magazine/editorial layouts",code:`font-family: Georgia, "Times New Roman", Times, serif; +/* Used in MagazineGrid, AI Brief */`,usedIn:"MagazineGrid, MagazineSectionDetail, AI Brief"},{id:"type-sizes",name:"Text Sizes",category:"typography",description:"Compact scale: 10px labels to 2xl headings",code:`/* Key sizes used */ +text-xs /* labels, metadata */ +text-xs /* 12px - secondary text */ +text-sm /* 14px - body text */ +text-base /* 16px - primary text */ +text-lg /* 18px - section headings */ +text-xl /* 20px - page headings */ +text-2xl /* 24px - hero text */`,usedIn:"Globally — see specific usage in each size bracket"},{id:"space-grid",name:"4px Grid",category:"spacing",preview:"inline",description:"All spacing follows a 4px base grid",code:`/* 4px grid system */ +1 = 4px /* micro gap */ +2 = 8px /* tight gap */ +3 = 12px /* small padding */ +4 = 16px /* standard padding */ +5 = 20px /* section padding */ +6 = 24px /* large gap */ +8 = 32px /* section spacing */ +12 = 48px /* large sections */`,usedIn:"Every layout — padding, margins, gaps between elements"},{id:"space-radius",name:"Border Radius",category:"spacing",preview:"inline",description:"Rounded corners from subtle to full",code:`/* Border radius scale */ +rounded-md /* 6px - badges, tags */ +rounded-lg /* 8px - buttons, inputs */ +rounded-xl /* 12px - cards, panels */ +rounded-2xl /* 16px - large panels */ +rounded-full /* pill buttons */`,usedIn:"Badges (md), buttons (lg), cards (xl), panels (2xl)"},{id:"atom-glass-btn",name:"Glass Button",category:"atoms",description:"48px height, glass morphism background",code:` + +/* glass-button: + height: 48px + background: rgba(0,0,0,0.6) + backdrop-filter: blur(18px) + border-radius: 12px + border: 1px solid rgba(255,255,255,0.12) +*/`,usedIn:"ChatInput send, modal actions, primary controls"},{id:"atom-glass-btn-sm",name:"Glass Button Small",category:"atoms",description:"Compact glass button variant",code:` + +/* Compact variant of glass-button */`,usedIn:"ChatInput send/stop buttons, inline actions"},{id:"atom-icon-btn",name:"Icon Button",category:"atoms",description:"Path glass icon, 32-36px square",code:` + +/* path-glass-icon: + background: transparent + transition: colors + hover: bg-white/10 +*/`,usedIn:"ChatHeader toolbar, detail back buttons, close buttons"},{id:"atom-badge",name:"Genre Badge",category:"atoms",description:"Tiny pill badge for tags/genres",code:` + Science Fiction +`,usedIn:"FilmGrid, SongGrid, BookGrid, TVSeriesGrid genre filters"},{id:"atom-nav-tab",name:"Nav Tab",category:"atoms",description:"Content panel tab with active state",code:` + +/* Active: accent underline + Inactive: text-white/50 hover:text-white + Transition: 200ms */`,usedIn:"ContentPanel tab bar, mobile content tab filters"},{id:"atom-input",name:"Text Input",category:"atoms",description:"Search/filter input field",code:``,usedIn:"All grid search bars, ProjectGrid new project"},{id:"atom-scrollbar",name:"Custom Scrollbar",category:"atoms",description:"Thin translucent scrollbar for scroll areas",code:`.custom-scrollbar::-webkit-scrollbar { + width: 4px; +} +.custom-scrollbar::-webkit-scrollbar-thumb { + background: rgba(255,255,255, 0.1); + border-radius: 2px; +} +/* Also: .scrollbar-hide hides completely */`,usedIn:"Content grids, chat message list, file trees"},{id:"mol-glass-card",name:"Glass Card",category:"molecules",description:"Frosted glass card with border",code:`
+

Title

+

Content

+
+ +/* glass-card: + background: rgba(0,0,0,0.65) + backdrop-filter: blur(18px) + border: 1px solid rgba(255,255,255,0.12) + border-radius: 16px + padding: 16px +*/`,usedIn:"ChatWindow container, content panel wrapper"},{id:"mol-gradient-card",name:"Gradient Card",category:"molecules",description:"Card with gradient background",code:`
+

Featured

+

Content

+
+ +/* gradient-card: + background: linear-gradient(135deg, ...) + border-radius: 16px +*/`,usedIn:"Featured content highlights, promotional sections"},{id:"mol-source-link",name:"Source Link Row",category:"molecules",description:"Icon + label + external link arrow",code:` +
+ icon +
+

Name

+

Description

+
+
+ +
`,usedIn:"FilmDetail, SongDetail, PodcastDetail sources"},{id:"mol-banner-hero",name:"Banner Hero",category:"molecules",description:"Aspect 16/7 image with gradient overlay",code:`
+ +
+
+

Title

+
+
`,usedIn:"FilmDetail, TVSeriesDetail, BookDetail banners"},{id:"mol-cover-card",name:"Cover Card",category:"molecules",description:"Poster/cover image card with overlay text",code:``,usedIn:"FilmGrid, TVSeriesGrid, SongGrid, BookGrid cards"},{id:"org-chat-bubble",name:"Chat Bubble",category:"organisms",description:"AI/User message bubble with streaming",code:` +
+
+ Message text +
+
+ + +
+
+ Response with markdown +
+
`,usedIn:"ChatMessage.vue — the primary chat interface"},{id:"org-content-panel",name:"Content Panel",category:"organisms",description:"Tabs + grid + detail navigation",code:` +
+ +
+ +
+ + + + +
`,usedIn:"ChatPage middle column, mobile Content tab"},{id:"org-detail-view",name:"Detail View",category:"organisms",description:"Full detail with banner, back button, metadata",code:` +
+ +
+ +
+ +
+

Title

+
Metadata
+
+
+ +
+

Description

+
Genre badges
+
Source links
+
+
`,usedIn:"FilmDetail, BookDetail, TVSeriesDetail, SongDetail, PodcastDetail"},{id:"org-magazine",name:"Magazine Grid",category:"organisms",description:"Editorial tile layout with hero, wide, and half tiles",code:` +
+ + + + +
`,usedIn:"MagazineGrid.vue — AI Brief editorial view"},{id:"org-nostr-note",name:"Nostr Note",category:"organisms",description:"Note card with avatar, author, content, zaps",code:`
+
+
+ F +
+
+ + author +

+ Note content...

+ 21000 sats +
+
+
`,usedIn:"NostrGrid.vue — Nostr feed tab"},{id:"anim-fade-up",name:"Fade Up",category:"atoms",description:"Entry animation: translate + opacity",code:`.animate-fade-up { + animation: fadeUp 900ms ease-out; +} +@keyframes fadeUp { + from { + opacity: 0; + transform: translateY(16px); + } + to { + opacity: 1; + transform: translateY(0); + } +} +/* Also: animate-fade-up-fast (400ms) */`,usedIn:"Empty states, initial load elements, ChatWindow"},{id:"anim-scale-in",name:"Scale In",category:"atoms",description:"Micro entrance with scale and opacity",code:`.animate-scale-in { + animation: scaleIn 250ms ease-out; +} +@keyframes scaleIn { + from { + opacity: 0; + transform: scale(0.95); + } + to { + opacity: 1; + transform: scale(1); + } +}`,usedIn:"Modal entries, tooltip appearances, popovers"}],_=B(()=>x.value==="all"?$:$.filter(o=>o.category===x.value));function b(o){l(o)}function c(o){const r=/(?:background-color|color|background):\s*([^;]+)/i.exec(o);if(!r)return"#333";const h=r[1].trim();return h.startsWith("#")||h.startsWith("rgb")||h.startsWith("hsl")?h:"#333"}return(o,r)=>(s(),n("div",$o,[e("div",{class:"shrink-0 px-4 py-3 flex items-center justify-between gap-2",style:G(t(d)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("span",{class:i(["text-sm font-semibold",t(d)?"text-white/90":"text-gray-900"])}," Design System ",2),e("p",{class:i(["text-xs",t(d)?"text-white/30":"text-gray-400"])},u(_.value.length)+" items ",3)],4),e("div",_o,[(s(),n(D,null,L(f,h=>e("button",{key:h.id,class:i(["text-xs px-2.5 py-1 rounded-md font-medium whitespace-nowrap transition-colors",x.value===h.id?"bg-accent/20 text-accent":t(d)?"bg-white/5 text-white/50 hover:bg-white/10":"bg-black/5 text-gray-500 hover:bg-black/10"]),onClick:M=>x.value=h.id},u(h.label),11,Co)),64))]),e("div",jo,[e("div",So,[(s(!0),n(D,null,L(_.value,h=>(s(),n("button",{key:h.id,class:i(["text-left p-3 rounded-xl transition-all duration-150 group relative",[t(w)&&t(v)(h.id)?"ring-2 ring-accent/50 bg-accent/10 cursor-pointer":t(d)?"bg-white/[0.03] hover:bg-white/[0.07] cursor-pointer":"bg-black/[0.02] hover:bg-black/[0.05] cursor-pointer"]]),onClick:M=>b(h)},[t(w)?(s(),n("div",{key:0,class:i(["absolute top-2 right-2 min-w-[44px] min-h-[44px] rounded-full flex items-center justify-center z-10 cursor-pointer transition-colors",t(v)(h.id)?"bg-accent":t(d)?"bg-white/10 hover:bg-white/20":"bg-black/10 hover:bg-black/20"]),onClick:we(M=>t(g)(h.id),["stop"])},[t(v)(h.id)?(s(),n("svg",Io,[...r[0]||(r[0]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"3",d:"M5 13l4 4L19 7"},null,-1)])])):m("",!0)],10,To)):m("",!0),h.category==="colors"&&h.preview==="inline"?(s(),n("div",{key:1,class:i(["h-8 rounded-md mb-2 border",t(d)?"border-white/10":"border-black/10"]),style:G({background:c(h.code)})},null,6)):h.category==="spacing"&&h.preview==="inline"?(s(),n("div",Do,[...r[1]||(r[1]=[e("div",{class:"bg-accent/40 rounded-sm",style:{width:"4px",height:"30%"}},null,-1),e("div",{class:"bg-accent/40 rounded-sm",style:{width:"4px",height:"50%"}},null,-1),e("div",{class:"bg-accent/40 rounded-sm",style:{width:"4px",height:"70%"}},null,-1),e("div",{class:"bg-accent/40 rounded-sm",style:{width:"4px",height:"100%"}},null,-1)])])):(s(),n("div",Bo,[(s(),n("svg",{class:i(["w-5 h-5 transition-colors",t(d)?"text-white/20 group-hover:text-white/40":"text-black/15 group-hover:text-black/30"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[h.category==="atoms"?(s(),n("path",Lo)):h.category==="molecules"?(s(),n("path",Po)):h.category==="organisms"?(s(),n("path",No)):(s(),n("path",Ao))],2))])),e("h3",{class:i(["text-xs font-semibold leading-tight mb-0.5",t(d)?"text-white/80":"text-gray-800"])},u(h.name),3),e("p",{class:i(["text-xs leading-snug line-clamp-2",t(d)?"text-white/40":"text-gray-400"])},u(h.description),3)],10,Mo))),128))])])]))}}),me=j(null),lt=j(!1),Re=j(!1),he=j(null);function ve(){const a=B(()=>{if(!me.value)return null;try{return He(me.value)}catch{return null}}),d=B(()=>!!me.value),l=B(()=>a.value?a.value.slice(0,12)+"..."+a.value.slice(-8):null);function w(){lt.value=typeof window<"u"&&!!window.nostr}async function g(){if(he.value=null,!window.nostr){he.value="No Nostr extension detected. Install nos2x, Alby, or another NIP-07 extension.";return}Re.value=!0;try{const f=await window.nostr.getPublicKey();me.value=f}catch(f){he.value=f instanceof Error?f.message:"Failed to get public key"}finally{Re.value=!1}}async function v(f){if(he.value=null,!window.nostr)return he.value="No Nostr extension detected",null;try{return await window.nostr.signEvent(f)}catch($){return he.value=$ instanceof Error?$.message:"Failed to sign event",null}}function x(){me.value=null,he.value=null}return ne(()=>{w(),setTimeout(w,500)}),{pubkey:me,npub:a,isAvailable:lt,isLoggedIn:d,isLoading:Re,error:he,truncatedNpub:l,login:g,logout:x,signEvent:v,checkAvailability:w}}const Eo="aiui-nostr-dms",Fo=1,ke="messages",je=j([]),Se=j(null),Ve=j(!1);let Me=null;function vt(){return Me||(Me=new Promise((a,d)=>{const l=indexedDB.open(Eo,Fo);l.onupgradeneeded=()=>{const w=l.result;if(!w.objectStoreNames.contains(ke)){const g=w.createObjectStore(ke,{keyPath:"id"});g.createIndex("contact","contactPubkey",{unique:!1}),g.createIndex("created_at","created_at",{unique:!1})}},l.onsuccess=()=>a(l.result),l.onerror=()=>{Me=null,d(l.error)}}),Me)}function Ro(a){return a.length<=12?a:a.slice(0,8)+"..."+a.slice(-4)}async function ot(a,d){const l=await vt(),w=a.fromPubkey===d?a.toPubkey:a.fromPubkey,g={...a,contactPubkey:w};return new Promise((v,x)=>{const f=l.transaction(ke,"readwrite");f.objectStore(ke).put(g),f.oncomplete=()=>v(),f.onerror=()=>x(f.error)})}async function Ue(){const a=await vt();return new Promise((d,l)=>{const g=a.transaction(ke,"readonly").objectStore(ke).getAll();g.onsuccess=()=>d(g.result),g.onerror=()=>l(g.error)})}function qe(a){const d=new Map;for(const w of a){const g=d.get(w.contactPubkey)??[];g.push(w),d.set(w.contactPubkey,g)}const l=[];for(const[w,g]of d)g.sort((v,x)=>v.created_at-x.created_at),l.push({contactPubkey:w,contactName:Ro(w),messages:g,lastMessage:g[g.length-1]??null,unread:0});return l.sort((w,g)=>(g.lastMessage?.created_at??0)-(w.lastMessage?.created_at??0)),l}function Vo(){const{pubkey:a,isLoggedIn:d}=ve(),l=B(()=>Se.value?je.value.find($=>$.contactPubkey===Se.value)??null:null);async function w(){if(d.value){Ve.value=!0;try{const $=await Ue();je.value=qe($)}catch{}finally{Ve.value=!1}}}async function g($,_){if(!window.nostr?.nip04||!a.value)return!1;try{const b=await window.nostr.nip04.encrypt($,_),c={kind:4,created_at:Math.floor(Date.now()/1e3),tags:[["p",$]],content:b},o=await window.nostr.signEvent(c);if(!o)return!1;const r={id:o.id,fromPubkey:a.value,toPubkey:$,content:_,created_at:o.created_at,decrypted:!0};await ot(r,a.value);const{publishEvent:h}=await pt(()=>import("./useNostr-C64NofB2.js"),__vite__mapDeps([0,1,2])).then(S=>S.useNostr());await h(o);const M=await Ue();return je.value=qe(M),!0}catch{return!1}}async function v($,_,b,c){if(!(!window.nostr?.nip04||!a.value))try{const o=await window.nostr.nip04.decrypt(_,b),r={id:$,fromPubkey:_,toPubkey:a.value,content:o,created_at:c,decrypted:!0};await ot(r,a.value);const h=await Ue();je.value=qe(h)}catch{}}function x($){Se.value=$}function f(){Se.value=null}return{threads:je,activeThread:l,activeContact:Se,isLoading:Ve,loadDMs:w,sendDM:g,receiveDM:v,selectContact:x,clearActiveContact:f}}const Uo={class:"h-full flex flex-col"},qo={class:"flex items-center gap-2 px-4 py-3 border-b border-white/[0.08]"},Go={class:"flex-1 min-w-0"},Oo={class:"text-xs font-semibold text-white/80 truncate"},Ho={class:"text-xs text-white/30 font-mono truncate"},Wo={class:"text-xs leading-relaxed break-words"},Ko={class:"text-xs mt-1 text-white/25 tabular-nums"},Yo={class:"px-4 py-3 border-t border-white/[0.08]"},Qo={class:"flex gap-2"},Jo=["disabled"],Zo={class:"p-4 border-b border-white/[0.08]"},Xo={class:"flex items-center justify-between gap-2 mb-3"},ea={key:0,class:"space-y-2 mb-3"},ta=["disabled"],sa={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-3 pb-16 space-y-1"},na={key:0,class:"flex items-center justify-center py-12"},la={key:1,class:"flex items-center justify-center py-12"},oa={key:2,class:"flex items-center justify-center py-12"},aa=["onClick"],ia={class:"flex items-start gap-2.5"},ra={class:"w-8 h-8 rounded-full shrink-0 flex items-center justify-center text-xs font-bold bg-accent/20 text-accent"},ca={class:"flex-1 min-w-0"},da={class:"flex items-center gap-1.5"},ua={class:"text-xs font-semibold truncate text-white/80"},ha={key:0,class:"text-xs ml-auto shrink-0 text-white/20"},xa={key:0,class:"text-xs mt-1 text-white/40 truncate"},pa=O({__name:"NostrDMs",setup(a){const{threads:d,activeThread:l,activeContact:w,isLoading:g,loadDMs:v,sendDM:x,selectContact:f,clearActiveContact:$}=Vo(),{pubkey:_,isLoggedIn:b}=ve(),c=j(""),o=j(!1),r=j(null),h=j(!1),M=j("");function S(k){const p=new Date(k*1e3),A=Math.floor((new Date().getTime()-p.getTime())/864e5);return A===0?p.toLocaleTimeString("en",{hour:"2-digit",minute:"2-digit"}):A<7?p.toLocaleDateString("en",{weekday:"short"}):p.toLocaleDateString("en",{month:"short",day:"numeric"})}async function N(){if(!c.value.trim()||o.value||!w.value)return;o.value=!0,await x(w.value,c.value.trim())&&(c.value="",await ye(),I()),o.value=!1}function I(){r.value&&(r.value.scrollTop=r.value.scrollHeight)}function C(){let k=M.value.trim();if(k.startsWith("npub"))try{k=gt(k)}catch{return}k.length===64&&(f(k),h.value=!1,M.value="")}return ce(w,async()=>{await ye(),I()}),ne(()=>{v()}),(k,p)=>(s(),n("div",Uo,[t(l)?(s(),n(D,{key:0},[e("div",qo,[e("button",{class:"min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg text-white/60 hover:text-white/80 hover:bg-white/10 transition-colors",onClick:p[0]||(p[0]=(...y)=>t($)&&t($)(...y))},[...p[4]||(p[4]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),e("div",Go,[e("p",Oo,u(t(l).contactName),1),e("p",Ho,u(t(l).contactPubkey),1)])]),e("div",{ref_key:"messagesRef",ref:r,class:"flex-1 overflow-y-auto custom-scrollbar px-4 py-3 space-y-2"},[(s(!0),n(D,null,L(t(l).messages,y=>(s(),n("div",{key:y.id,class:i(["flex",y.fromPubkey===t(_)?"justify-end":"justify-start"])},[e("div",{class:i(["max-w-[80%] rounded-xl px-3 py-2",y.fromPubkey===t(_)?"bg-accent/15 text-white/80":"bg-white/5 text-white/70"])},[e("p",Wo,u(y.content),1),e("p",Ko,u(S(y.created_at)),1)],2)],2))),128))],512),e("div",Yo,[e("div",Qo,[K(e("input",{"onUpdate:modelValue":p[1]||(p[1]=y=>c.value=y),type:"text",placeholder:"Type a message...",class:"flex-1 px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors",onKeydown:ae(N,["enter"])},null,544),[[J,c.value]]),e("button",{class:"px-3 py-2 rounded-lg text-xs bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors disabled:opacity-30",disabled:!c.value.trim()||o.value,onClick:N}," Send ",8,Jo)])])],64)):(s(),n(D,{key:1},[e("div",Zo,[e("div",Xo,[p[5]||(p[5]=e("h3",{class:"text-sm font-bold text-white/90"},"Messages",-1)),e("button",{class:"text-xs px-2.5 py-1 rounded bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors",onClick:p[2]||(p[2]=y=>h.value=!h.value)},u(h.value?"Cancel":"New"),1)]),h.value?(s(),n("div",ea,[K(e("input",{"onUpdate:modelValue":p[3]||(p[3]=y=>M.value=y),type:"text",placeholder:"Recipient hex pubkey or npub...",class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors font-mono"},null,512),[[J,M.value]]),e("button",{class:"text-xs px-2.5 py-1 rounded bg-white/5 text-white/60 hover:bg-white/10 transition-colors disabled:opacity-30",disabled:!M.value.trim(),onClick:C}," Start conversation ",8,ta)])):m("",!0)]),e("div",sa,[t(b)?t(g)?(s(),n("div",la,[...p[7]||(p[7]=[e("p",{class:"text-xs text-white/30"},"Loading messages...",-1)])])):t(d).length===0?(s(),n("div",oa,[...p[8]||(p[8]=[e("p",{class:"text-xs text-white/30"},"No messages yet",-1)])])):m("",!0):(s(),n("div",na,[...p[6]||(p[6]=[e("p",{class:"text-xs text-white/30"},"Sign in with Nostr to use DMs",-1)])])),(s(!0),n(D,null,L(t(d),y=>(s(),n("button",{key:y.contactPubkey,class:"w-full text-left p-3 rounded-xl transition-all duration-150 bg-white/[0.03] hover:bg-white/[0.07] border border-white/5",onClick:A=>t(f)(y.contactPubkey)},[e("div",ia,[e("div",ra,u(y.contactName.charAt(0).toUpperCase()),1),e("div",ca,[e("div",da,[e("span",ua,u(y.contactName),1),y.lastMessage?(s(),n("span",ha,u(S(y.lastMessage.created_at)),1)):m("",!0)]),y.lastMessage?(s(),n("p",xa,u(y.lastMessage.content),1)):m("",!0)])])],8,aa))),128))])],64))]))}}),ga={class:"h-full flex flex-col"},ba={class:"p-4 border-b border-white/[0.08]"},va={class:"flex gap-2"},fa=["disabled"],ma={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-3 pb-16 space-y-2"},wa={class:"flex items-center gap-2"},ya={class:"text-xs font-mono text-white/70 truncate flex-1"},ka={class:"flex items-center gap-2 flex-wrap"},$a=["onClick"],_a=["onClick"],Ca=["disabled","onClick"],ja=["onClick"],Sa={key:0,class:"mt-4 pt-4 border-t border-white/5"},Ma=["disabled"],Ta={key:0,class:"text-xs mt-1 text-white/30"},Ia=O({__name:"NostrRelayManager",setup(a){const{relayStates:d,addRelay:l,removeRelay:w,toggleRelayRead:g,toggleRelayWrite:v,testRelay:x,importNIP65Relays:f,fetchNote:$}=De(),{isLoggedIn:_,pubkey:b}=ve(),c=j(""),o=j(null),r=Pe({}),h=j(!1),M=j("");function S(){let C=c.value.trim();C&&(!C.startsWith("wss://")&&!C.startsWith("ws://")&&(C="wss://"+C),l(C),c.value="")}async function N(C){o.value=C;const k=await x(C);r[C]=k,o.value=null}async function I(){if(!b.value)return;h.value=!0,M.value="Fetching relay list...";const C=await $(b.value,5e3);C?(f({id:C.id,pubkey:C.pubkey,kind:10002,content:C.content,created_at:C.created_at,tags:C.tags,sig:""}),M.value="Imported relays from NIP-65"):M.value="No NIP-65 relay list found",h.value=!1}return(C,k)=>(s(),n("div",ga,[e("div",ba,[k[1]||(k[1]=e("h3",{class:"text-sm font-bold text-white/90 mb-3"},"Relay Management",-1)),e("div",va,[K(e("input",{"onUpdate:modelValue":k[0]||(k[0]=p=>c.value=p),type:"text",placeholder:"wss://relay.example.com",class:"flex-1 px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors font-mono",onKeydown:ae(S,["enter"])},null,544),[[J,c.value]]),e("button",{class:"px-4 min-h-[44px] rounded-lg text-sm bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors disabled:opacity-30",disabled:!c.value.trim(),onClick:S}," Add ",8,fa)])]),e("div",ma,[(s(!0),n(D,null,L(t(d),p=>(s(),n("div",{key:p.url,class:"rounded-xl bg-white/[0.03] border border-white/5 p-3 space-y-2"},[e("div",wa,[e("span",{class:i(["w-2 h-2 rounded-full shrink-0",p.connected?"bg-emerald-500":"bg-red-400/60"])},null,2),e("span",ya,u(p.url),1),p.latencyMs!==null?(s(),n("span",{key:0,class:i(["text-xs tabular-nums shrink-0",p.latencyMs<200?"text-emerald-400/60":p.latencyMs<500?"text-yellow-400/60":"text-red-400/60"])},u(p.latencyMs)+"ms ",3)):m("",!0),e("span",{class:i(["text-xs shrink-0",p.connected?"text-emerald-400/60":"text-red-400/60"])},u(p.connected?"Connected":"Disconnected"),3)]),e("div",ka,[e("button",{class:i(["text-sm px-3 min-h-[44px] rounded-lg transition-colors",p.read?"bg-accent/15 text-accent/80":"bg-white/5 text-white/30 hover:text-white/50"]),onClick:y=>t(g)(p.url)}," Read ",10,$a),e("button",{class:i(["text-sm px-3 min-h-[44px] rounded-lg transition-colors",p.write?"bg-accent/15 text-accent/80":"bg-white/5 text-white/30 hover:text-white/50"]),onClick:y=>t(v)(p.url)}," Write ",10,_a),k[2]||(k[2]=e("div",{class:"flex-1"},null,-1)),e("button",{class:"text-sm px-3 min-h-[44px] rounded-lg bg-white/5 text-white/30 hover:text-white/50 transition-colors",disabled:o.value===p.url,onClick:y=>N(p.url)},u(o.value===p.url?"Testing...":"Test"),9,Ca),e("button",{class:"text-sm px-3 min-h-[44px] rounded-lg bg-white/5 text-red-400/50 hover:text-red-400/80 hover:bg-red-400/10 transition-colors",onClick:y=>t(w)(p.url)}," Remove ",8,ja)]),r[p.url]!==void 0?(s(),n("p",{key:0,class:i(["text-xs",r[p.url]!==null?"text-emerald-400/60":"text-red-400/60"])},u(r[p.url]!==null?`Reachable (${r[p.url]}ms)`:"Unreachable"),3)):m("",!0)]))),128)),t(_)?(s(),n("div",Sa,[e("button",{class:"w-full text-left px-3 min-h-[44px] rounded-lg text-sm bg-white/5 text-white/40 hover:text-white/60 hover:bg-white/10 transition-colors",disabled:h.value,onClick:I},u(h.value?"Importing...":"Import relays from NIP-65 (kind:10002)"),9,Ma),M.value?(s(),n("p",Ta,u(M.value),1)):m("",!0)])):m("",!0)])]))}}),Da={class:"h-full flex flex-col"},Ba={key:0,class:"flex-1 flex items-center justify-center"},La={key:1,class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-3 pb-16 space-y-4"},Pa={class:"rounded-xl overflow-hidden border border-white/5"},Na={class:"px-4 pb-4 -mt-8"},Aa={key:0,class:"text-lg font-bold text-accent"},za={class:"text-sm font-bold text-white/90 mt-2"},Ea={key:0,class:"text-xs text-purple-400/60"},Fa={key:1,class:"text-xs text-white/50 mt-1 line-clamp-2"},Ra={class:"space-y-3"},Va=["disabled"],Ua=O({__name:"NostrProfileEditor",setup(a){const{isLoggedIn:d,signEvent:l,pubkey:w}=ve(),{publishEvent:g,fetchNote:v}=De(),x=Pe({name:"",display_name:"",about:"",picture:"",banner:"",website:"",nip05:"",lud16:""}),f=j(!1),$=j(""),_=j(!1);async function b(){if(!w.value)return;const o=await v(w.value,5e3);if(o&&o.kind===0)try{const r=JSON.parse(o.content);Object.assign(x,r)}catch{}}async function c(){if(!d.value)return;f.value=!0,$.value="";const o={};for(const[N,I]of Object.entries(x))I&&(o[N]=I);const r={kind:0,created_at:Math.floor(Date.now()/1e3),tags:[],content:JSON.stringify(o)},h=await l(r);if(!h){f.value=!1,$.value="Signing failed",_.value=!1;return}const M=await g(h),S=M.filter(N=>N.success).length;f.value=!1,S>0?($.value=`Published to ${S}/${M.length} relays`,_.value=!0):($.value="Failed to publish to any relay",_.value=!1)}return ne(()=>{b()}),(o,r)=>(s(),n("div",Da,[r[17]||(r[17]=e("div",{class:"p-4 border-b border-white/[0.08]"},[e("h3",{class:"text-sm font-bold text-white/90"},"Nostr Profile")],-1)),t(d)?(s(),n("div",La,[e("div",Pa,[e("div",{class:i(["h-24 bg-cover bg-center",x.banner?"":"bg-gradient-to-r from-accent/20 to-purple-500/20"]),style:G(x.banner?{backgroundImage:`url(${x.banner})`}:{})},null,6),e("div",Na,[e("div",{class:i(["w-16 h-16 rounded-full border-2 border-black bg-cover bg-center flex items-center justify-center",x.picture?"":"bg-accent/20"]),style:G(x.picture?{backgroundImage:`url(${x.picture})`}:{})},[x.picture?m("",!0):(s(),n("span",Aa,u((x.display_name||x.name||"?").charAt(0).toUpperCase()),1))],6),e("p",za,u(x.display_name||x.name||"Anonymous"),1),x.nip05?(s(),n("p",Ea,u(x.nip05),1)):m("",!0),x.about?(s(),n("p",Fa,u(x.about),1)):m("",!0)])]),e("div",Ra,[e("div",null,[r[9]||(r[9]=e("label",{class:"text-xs text-white/30 block mb-1"},"Display Name",-1)),K(e("input",{"onUpdate:modelValue":r[0]||(r[0]=h=>x.display_name=h),type:"text",class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors",placeholder:"Your display name"},null,512),[[J,x.display_name]])]),e("div",null,[r[10]||(r[10]=e("label",{class:"text-xs text-white/30 block mb-1"},"Username",-1)),K(e("input",{"onUpdate:modelValue":r[1]||(r[1]=h=>x.name=h),type:"text",class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors",placeholder:"username"},null,512),[[J,x.name]])]),e("div",null,[r[11]||(r[11]=e("label",{class:"text-xs text-white/30 block mb-1"},"Bio",-1)),K(e("textarea",{"onUpdate:modelValue":r[2]||(r[2]=h=>x.about=h),class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors resize-none min-h-[60px]",placeholder:"Tell the world about yourself"},null,512),[[J,x.about]])]),e("div",null,[r[12]||(r[12]=e("label",{class:"text-xs text-white/30 block mb-1"},"Avatar URL",-1)),K(e("input",{"onUpdate:modelValue":r[3]||(r[3]=h=>x.picture=h),type:"url",class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors font-mono",placeholder:"https://example.com/avatar.jpg"},null,512),[[J,x.picture]])]),e("div",null,[r[13]||(r[13]=e("label",{class:"text-xs text-white/30 block mb-1"},"Banner URL",-1)),K(e("input",{"onUpdate:modelValue":r[4]||(r[4]=h=>x.banner=h),type:"url",class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors font-mono",placeholder:"https://example.com/banner.jpg"},null,512),[[J,x.banner]])]),e("div",null,[r[14]||(r[14]=e("label",{class:"text-xs text-white/30 block mb-1"},"Website",-1)),K(e("input",{"onUpdate:modelValue":r[5]||(r[5]=h=>x.website=h),type:"url",class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors font-mono",placeholder:"https://example.com"},null,512),[[J,x.website]])]),e("div",null,[r[15]||(r[15]=e("label",{class:"text-xs text-white/30 block mb-1"},"NIP-05 Address",-1)),K(e("input",{"onUpdate:modelValue":r[6]||(r[6]=h=>x.nip05=h),type:"text",class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors font-mono",placeholder:"you@example.com"},null,512),[[J,x.nip05]])]),e("div",null,[r[16]||(r[16]=e("label",{class:"text-xs text-white/30 block mb-1"},"Lightning Address",-1)),K(e("input",{"onUpdate:modelValue":r[7]||(r[7]=h=>x.lud16=h),type:"text",class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors font-mono",placeholder:"you@getalby.com"},null,512),[[J,x.lud16]])]),e("button",{class:"w-full min-h-[44px] rounded-lg text-sm font-medium bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors disabled:opacity-30",disabled:f.value,onClick:c},u(f.value?"Publishing...":"Publish Profile (kind:0)"),9,Va),$.value?(s(),n("div",{key:0,class:i(["text-xs text-center",_.value?"text-emerald-400/60":"text-red-400/60"])},u($.value),3)):m("",!0)])])):(s(),n("div",Ba,[...r[8]||(r[8]=[e("p",{class:"text-xs text-white/30"},"Sign in with Nostr to edit your profile",-1)])]))]))}}),qa={class:"relative glass-card w-[320px] max-w-[90vw] p-5 space-y-4 animate-scale-in"},Ga={class:"flex items-center justify-between"},Oa={class:"text-xs text-white/40 truncate font-mono"},Ha={class:"flex gap-1.5 flex-wrap"},Wa=["onClick"],Ka=["disabled"],Ya={key:0,class:"space-y-2"},Qa={class:"flex justify-center"},Ja={class:"flex gap-1"},Za=["value"],Xa=["href"],ei={key:1,class:"text-xs text-red-400/60 text-center"},ti=O({__name:"ZapDialog",props:{isOpen:{type:Boolean},targetName:{},lightningAddress:{}},emits:["close"],setup(a,{emit:d}){const l=a,w=d,g=j(null),v=j(null),x=[21,100,500,1e3,5e3,1e4],f=j(21),$=j(""),_=j(""),b=j(!1),c=j(""),o=j(!1),r=j(null);function h(k){return k>=1e3?`${(k/1e3).toFixed(k%1e3===0?0:1)}k`:String(k)}function M(){w("close"),_.value="",c.value="",$.value=""}async function S(){if(!(!l.lightningAddress||!f.value)){b.value=!0,c.value="",_.value="";try{const[k,p]=l.lightningAddress.split("@");if(!k||!p)throw new Error("Invalid Lightning address");const y=await fetch(`https://${p}/.well-known/lnurlp/${k}`);if(!y.ok)throw new Error("Failed to fetch LNURL");const A=await y.json();if(A.status==="ERROR")throw new Error(A.reason||"LNURL error");const V=f.value*1e3;if(V<(A.minSendable??0))throw new Error(`Minimum: ${Math.ceil((A.minSendable??0)/1e3)} sats`);if(V>(A.maxSendable??1/0))throw new Error(`Maximum: ${Math.floor((A.maxSendable??0)/1e3)} sats`);let E=A.callback;const Y=E.includes("?")?"&":"?";E+=`${Y}amount=${V}`,$.value&&(E+=`&comment=${encodeURIComponent($.value)}`);const H=await fetch(E);if(!H.ok)throw new Error("Failed to get invoice");const F=await H.json();if(F.status==="ERROR")throw new Error(F.reason||"Invoice error");_.value=F.pr,await ye(),N(F.pr)}catch(k){c.value=k instanceof Error?k.message:"Zap failed"}finally{b.value=!1}}}function N(k){const p=r.value;if(!p)return;const y=p.getContext("2d");if(!y)return;y.fillStyle="#1a1a1a",y.fillRect(0,0,200,200),y.fillStyle="#F7931A",y.font="10px monospace",y.textAlign="center";const A=[];for(let E=0;E{y.fillText(E,100,V+Y*12)})}function I(){navigator.clipboard.writeText(_.value),o.value=!0,setTimeout(()=>{o.value=!1},2e3)}function C(k){const p=g.value;if(!p)return;const y=p.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(y.length===0)return;const A=y[0],V=y[y.length-1];k.shiftKey&&document.activeElement===A?(k.preventDefault(),V.focus()):!k.shiftKey&&document.activeElement===V&&(k.preventDefault(),A.focus())}return ce(()=>l.isOpen,async k=>{k?(await ye(),v.value?.focus()):(_.value="",c.value="")}),(k,p)=>a.isOpen?(s(),n("div",{key:0,ref_key:"dialogRef",ref:g,role:"dialog","aria-modal":"true","aria-label":"Send zap",class:"fixed inset-0 z-50 flex items-center justify-center",onClick:we(M,["self"]),onKeydown:[ae(M,["escape"]),ae(C,["tab"])]},[e("div",{class:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:M}),e("div",qa,[e("div",Ga,[p[3]||(p[3]=e("h3",{class:"text-sm font-bold text-white/90"},"Zap",-1)),e("button",{ref_key:"closeButtonRef",ref:v,class:"min-w-[44px] min-h-[44px] flex items-center justify-center rounded text-white/40 hover:text-white/70 transition-colors","aria-label":"Close",onClick:M},[...p[2]||(p[2]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])],512)]),e("p",Oa,u(a.targetName),1),e("div",Ha,[(s(),n(D,null,L(x,y=>e("button",{key:y,class:i(["text-xs px-2.5 py-1.5 rounded-lg transition-colors",f.value===y?"bg-accent/20 text-accent border border-accent/30":"bg-white/5 text-white/50 hover:bg-white/10"]),onClick:A=>f.value=y},u(h(y)),11,Wa)),64))]),e("div",null,[p[4]||(p[4]=e("label",{class:"text-xs text-white/30 block mb-1"},"Amount (sats)",-1)),K(e("input",{"onUpdate:modelValue":p[0]||(p[0]=y=>f.value=y),type:"number",min:"1",class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors tabular-nums",placeholder:"21"},null,512),[[J,f.value,void 0,{number:!0}]])]),e("div",null,[p[5]||(p[5]=e("label",{class:"text-xs text-white/30 block mb-1"},"Message (optional)",-1)),K(e("input",{"onUpdate:modelValue":p[1]||(p[1]=y=>$.value=y),type:"text",class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors",placeholder:"Great post!"},null,512),[[J,$.value]])]),e("button",{class:"w-full py-2.5 rounded-lg text-xs font-medium bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors disabled:opacity-30",disabled:!f.value||f.value<1||b.value,onClick:S},u(b.value?"Generating invoice...":`Zap ${h(f.value)} sats`),9,Ka),_.value?(s(),n("div",Ya,[p[6]||(p[6]=e("p",{class:"text-xs text-white/30 text-center"},"Scan or tap to pay",-1)),e("div",Qa,[e("canvas",{ref_key:"qrCanvas",ref:r,class:"rounded-lg",width:"200",height:"200"},null,512)]),e("div",Ja,[e("input",{value:_.value,readonly:"",class:"flex-1 px-2 py-1.5 rounded text-base bg-white/5 text-white/40 font-mono truncate outline-none"},null,8,Za),e("button",{class:"px-2 py-1.5 rounded text-xs bg-white/5 text-white/40 hover:text-white/60 transition-colors",onClick:I},u(o.value?"Copied":"Copy"),1)]),e("a",{href:"lightning:"+_.value,class:"block w-full py-2 rounded-lg text-xs text-center bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors"}," Open in wallet ",8,Xa)])):m("",!0),c.value?(s(),n("p",ei,u(c.value),1)):m("",!0)])],544)):m("",!0)}}),si={class:"h-full flex flex-col"},ni={class:"flex items-center gap-2 px-4 py-3 border-b border-white/[0.08]"},li={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-3 pb-16 space-y-2"},oi={key:0,class:"flex items-center justify-center py-12"},ai={key:1,class:"rounded-xl bg-white/[0.05] border border-white/10 p-3"},ii={class:"flex items-center gap-1.5 mb-1"},ri={class:"w-6 h-6 rounded-full shrink-0 flex items-center justify-center text-xs font-bold bg-purple-500/20 text-purple-400"},ci={class:"text-xs font-semibold text-white/80"},di={class:"text-xs ml-auto text-white/20"},ui={class:"text-xs text-white/70 leading-relaxed whitespace-pre-wrap"},hi={key:2,class:"space-y-1"},xi={class:"text-xs text-white/30 font-medium mt-3 mb-1"},pi={key:3,class:"flex items-center justify-center py-12"},gi={key:0,class:"px-4 py-3 border-t border-white/[0.08]"},bi={key:0,class:"text-xs text-white/30 mb-1"},vi={class:"flex gap-2"},fi=["disabled"],mi=O({__name:"NostrThread",props:{noteId:{}},emits:["back"],setup(a){const d=Yt(()=>pt(()=>import("./ThreadNode-CF2XPC8C.js"),__vite__mapDeps([3,1,2]))),l=a,{fetchNote:w,publishEvent:g}=De(),{isLoggedIn:v,signEvent:x,pubkey:f}=ve(),$=j(null),_=j([]),b=j(!0),c=j(null),o=j("");function r(k){const p=new Date(k*1e3);return p.toLocaleTimeString("en",{hour:"2-digit",minute:"2-digit"})+" "+p.toLocaleDateString("en",{month:"short",day:"numeric"})}function h(k){return k.length<=12?k:k.slice(0,8)+"..."+k.slice(-4)}async function M(){b.value=!0;const k=await w(l.noteId);if(!k){b.value=!1;return}$.value=k;const p=await S(l.noteId);_.value=N(p,l.noteId),b.value=!1}async function S(k){return new Promise(p=>{const y=[],A="thread-"+Math.random().toString(36).slice(2,8);let V=!1;const E=setTimeout(()=>{V||(V=!0,p(y))},8e3),Y="wss://relay.nostr.band";try{const H=new WebSocket(Y);H.onopen=()=>{H.send(JSON.stringify(["REQ",A,{kinds:[1],"#e":[k],limit:100}]))},H.onmessage=F=>{try{const U=JSON.parse(F.data);if(Array.isArray(U)&&U[0]==="EVENT"&&U[1]===A&&U[2]){const W=U[2];y.find(le=>le.id===W.id)||y.push({id:W.id,pubkey:W.pubkey,authorName:h(W.pubkey),kind:W.kind,content:W.content,created_at:W.created_at,tags:W.tags??[]})}Array.isArray(U)&&U[0]==="EOSE"&&U[1]===A&&(clearTimeout(E),H.close(),V||(V=!0,p(y)))}catch{}},H.onerror=()=>{clearTimeout(E),V||(V=!0,p(y))},H.onclose=()=>{V||(V=!0,p(y))}}catch{clearTimeout(E),p(y)}})}function N(k,p,y=5){const A=new Map;for(const E of k){let Y=p;const H=E.tags.filter(U=>U[0]==="e");if(H.length>0){const U=H.find(W=>W[3]==="reply");Y=U?U[1]:H[H.length-1][1]}const F=A.get(Y)??[];F.push(E),A.set(Y,F)}function V(E,Y){const H=A.get(E)??[];return H.sort((F,U)=>F.created_at-U.created_at),H.map(F=>({note:F,children:Y{M()}),(k,p)=>(s(),n("div",si,[e("div",ni,[e("button",{class:"min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg text-white/60 hover:text-white/80 hover:bg-white/10 transition-colors",onClick:p[0]||(p[0]=y=>k.$emit("back"))},[...p[3]||(p[3]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),p[4]||(p[4]=e("h3",{class:"text-sm font-bold text-white/90"},"Thread",-1))]),e("div",li,[b.value?(s(),n("div",oi,[...p[5]||(p[5]=[e("p",{class:"text-xs text-white/30"},"Loading thread...",-1)])])):m("",!0),$.value?(s(),n("div",ai,[e("div",ii,[e("div",ri,u($.value.authorName?.charAt(0)?.toUpperCase()??"?"),1),e("span",ci,u($.value.authorName??"anon"),1),e("span",di,u(r($.value.created_at)),1)]),e("p",ui,u($.value.content),1)])):m("",!0),_.value.length>0?(s(),n("div",hi,[e("p",xi,u(_.value.length)+" replies",1),(s(!0),n(D,null,L(_.value,y=>(s(),q(t(d),{key:y.note.id,node:y,depth:0,onReply:I},null,8,["node"]))),128))])):m("",!0),!b.value&&!$.value?(s(),n("div",pi,[...p[6]||(p[6]=[e("p",{class:"text-xs text-white/30"},"Thread not found",-1)])])):m("",!0)]),$.value&&t(v)?(s(),n("div",gi,[c.value?(s(),n("p",bi,[se(" Replying to "+u(c.value.authorName??"anon")+" ",1),e("button",{class:"text-accent/60 ml-1",onClick:p[1]||(p[1]=y=>c.value=null)},"cancel")])):m("",!0),e("div",vi,[K(e("input",{"onUpdate:modelValue":p[2]||(p[2]=y=>o.value=y),type:"text",placeholder:"Reply...",class:"flex-1 px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors",onKeydown:ae(C,["enter"])},null,544),[[J,o.value]]),e("button",{class:"px-3 py-2 rounded-lg text-xs bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors disabled:opacity-30",disabled:!o.value.trim(),onClick:C}," Reply ",8,fi)])])):m("",!0)]))}}),wi={class:"h-full flex flex-col"},yi={class:"p-4 border-b border-white/[0.08]"},ki={class:"flex gap-1.5 flex-wrap"},$i=["onClick"],_i={key:0,class:"flex-1 flex items-center justify-center"},Ci={key:1,class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-3 pb-16 space-y-2"},ji={key:0,class:"flex items-center justify-center py-12"},Si={class:"flex gap-2 mb-3"},Mi=["placeholder"],Ti=["disabled"],Ii={class:"w-6 h-6 rounded-full shrink-0 flex items-center justify-center text-xs font-bold bg-purple-500/20 text-purple-400"},Di={class:"flex-1 min-w-0"},Bi={class:"text-xs text-white/60 font-mono truncate"},Li={key:0,class:"text-xs text-white/30"},Pi=["onClick"],Ni={key:1,class:"flex items-center justify-center py-12"},Ai=["disabled"],zi=O({__name:"NostrLists",setup(a){const{isLoggedIn:d,signEvent:l,pubkey:w}=ve(),{publishEvent:g}=De(),v=[{kind:3,label:"Follows"},{kind:1e4,label:"Mute"},{kind:10001,label:"Pin"},{kind:10003,label:"Bookmarks"}],x=j(3),f=j([]),$=j(!1),_=j(!1),b=j(""),c=j(!1),o=j(""),r=j(!1);function h(k){return k.length<=16?k:k.slice(0,8)+"..."+k.slice(-8)}function M(k){return k.filter(p=>p[0]==="p"||p[0]==="e"||p[0]==="t").map(p=>{let y=h(p[1]);if(p[0]==="p")try{y=He(p[1])}catch{}return{tag:p[0],value:p[1],displayValue:y,relay:p[2]||void 0,petname:p[3]||void 0}})}async function S(k){if(w.value){$.value=!0,_.value=!1,f.value=[];try{const p=new WebSocket("wss://relay.nostr.band"),y="list-"+Math.random().toString(36).slice(2,8),A=setTimeout(()=>{p.close(),$.value=!1},8e3);p.onopen=()=>{p.send(JSON.stringify(["REQ",y,{kinds:[k],authors:[w.value],limit:1}]))},p.onmessage=V=>{try{const E=JSON.parse(V.data);if(Array.isArray(E)&&E[0]==="EVENT"&&E[1]===y&&E[2]){const Y=E[2];f.value=M(Y.tags)}Array.isArray(E)&&E[0]==="EOSE"&&(clearTimeout(A),p.close(),$.value=!1)}catch{}},p.onerror=()=>{clearTimeout(A),$.value=!1}}catch{$.value=!1}}}function N(){let k=b.value.trim();if(!k)return;let p=k;const y=x.value===3||x.value===1e4?"p":"e";if(k.startsWith("npub"))try{p=gt(k)}catch{return}if(f.value.find(V=>V.value===p))return;let A=h(p);if(y==="p")try{A=He(p)}catch{}f.value.push({tag:y,value:p,displayValue:A}),_.value=!0,b.value=""}function I(k){f.value=f.value.filter(p=>p.value!==k.value),_.value=!0}async function C(){if(!w.value)return;c.value=!0,o.value="";const k=f.value.map(E=>{const Y=[E.tag,E.value];return E.relay&&Y.push(E.relay),E.petname&&Y.push(E.petname),Y}),p={kind:x.value,created_at:Math.floor(Date.now()/1e3),tags:k,content:""},y=await l(p);if(!y){c.value=!1,o.value="Signing failed",r.value=!1;return}const A=await g(y),V=A.filter(E=>E.success).length;c.value=!1,_.value=!1,V>0?(o.value=`Published to ${V}/${A.length} relays`,r.value=!0):(o.value="Failed to publish",r.value=!1)}return ne(()=>{S(x.value)}),(k,p)=>(s(),n("div",wi,[e("div",yi,[p[1]||(p[1]=e("h3",{class:"text-sm font-bold text-white/90 mb-3"},"Nostr Lists",-1)),e("div",ki,[(s(),n(D,null,L(v,y=>e("button",{key:y.kind,class:i(["text-xs px-2 py-1 rounded-md transition-all duration-150",x.value===y.kind?"nav-tab-active":"text-white/40 hover:text-white/70 hover:bg-white/5"]),onClick:A=>{x.value=y.kind,S(y.kind)}},u(y.label),11,$i)),64))])]),t(d)?(s(),n("div",Ci,[$.value?(s(),n("div",ji,[...p[3]||(p[3]=[e("p",{class:"text-xs text-white/30"},"Loading list...",-1)])])):m("",!0),e("div",Si,[K(e("input",{"onUpdate:modelValue":p[0]||(p[0]=y=>b.value=y),type:"text",placeholder:x.value===3?"Add npub or hex pubkey...":"Add item (hex id or npub)...",class:"flex-1 px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors font-mono",onKeydown:ae(N,["enter"])},null,40,Mi),[[J,b.value]]),e("button",{class:"px-2.5 py-2 rounded-lg text-xs bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors disabled:opacity-30",disabled:!b.value.trim(),onClick:N}," Add ",8,Ti)]),(s(!0),n(D,null,L(f.value,y=>(s(),n("div",{key:y.value,class:"flex items-center gap-2 p-2.5 rounded-xl bg-white/[0.03] border border-white/5"},[e("div",Ii,u(y.tag==="p"?"P":y.tag==="e"?"E":y.tag==="t"?"#":"?"),1),e("div",Di,[e("p",Bi,u(y.displayValue),1),y.petname?(s(),n("p",Li,u(y.petname),1)):m("",!0)]),e("button",{class:"text-xs px-2 py-1 rounded bg-white/5 text-red-400/50 hover:text-red-400/80 hover:bg-red-400/10 transition-colors shrink-0",onClick:A=>I(y)}," Remove ",8,Pi)]))),128)),!$.value&&f.value.length===0?(s(),n("div",Ni,[...p[4]||(p[4]=[e("p",{class:"text-xs text-white/30"},"List is empty",-1)])])):m("",!0),_.value?(s(),n("button",{key:2,class:"w-full py-2.5 rounded-lg text-xs font-medium bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors disabled:opacity-30 mt-4",disabled:c.value,onClick:C},u(c.value?"Publishing...":"Publish updated list"),9,Ai)):m("",!0),o.value?(s(),n("p",{key:3,class:i(["text-xs text-center",r.value?"text-emerald-400/60":"text-red-400/60"])},u(o.value),3)):m("",!0)])):(s(),n("div",_i,[...p[2]||(p[2]=[e("p",{class:"text-xs text-white/30"},"Sign in with Nostr to manage lists",-1)])]))]))}}),Ei={class:"article-reader h-full flex"},Fi={key:0,class:"hidden lg:flex flex-col w-56 shrink-0 border-r border-white/5 overflow-y-auto scrollbar-hide py-4 px-3"},Ri=["onClick"],Vi={class:"sticky top-0 z-10 flex items-center gap-2 px-4 py-2 bg-black/60 backdrop-blur-md border-b border-white/5"},Ui={class:"flex-1 text-xs text-white/40 truncate"},qi=["disabled"],Gi=["disabled"],Oi={key:0,class:"lg:hidden bg-black/40 backdrop-blur-md border-b border-white/5 px-4 py-2 space-y-0.5 animate-fade-up-fast"},Hi=["onClick"],Wi={key:0,class:"text-xl font-bold text-white/96 mb-4"},Ki=["innerHTML"],Yi=O({__name:"ArticleReader",props:{content:{},title:{}},emits:["back"],setup(a){const d=a,l=[13,15,17,19,21],w=localStorage.getItem("aiui-article-font-size"),g=j(w?parseInt(w,10):1);ce(g,I=>{localStorage.setItem("aiui-article-font-size",String(I))});const v=j(!1),x=new as({html:!1,linkify:!0,breaks:!0});x.renderer.rules.heading_open=(I,C,k,p,y)=>{const A=I[C],V=parseInt(A.tag.slice(1),10);if(V===2||V===3){const H=(I[C+1]?.children?.reduce((F,U)=>F+(U.content||""),"")||"").toLowerCase().replace(/[^\w]+/g,"-").replace(/(^-|-$)/g,"");A.attrSet("id",H)}return y.renderToken(I,C,k)};const f=x.renderer.rules.link_open||function(I,C,k,p,y){return y.renderToken(I,C,k)};x.renderer.rules.link_open=function(I,C,k,p,y){return I[C].attrSet("target","_blank"),I[C].attrSet("rel","noopener noreferrer"),f(I,C,k,p,y)};const $=B(()=>x.render(d.content)),_=B(()=>{const I=[],C=/^(#{2,3})\s+(.+)$/gm;let k;for(;(k=C.exec(d.content))!==null;){const p=k[2].trim(),y=p.toLowerCase().replace(/[^\w]+/g,"-").replace(/(^-|-$)/g,"");I.push({text:p,id:y,level:k[1].length})}return I}),b=B(()=>{const I=d.content.split(/\s+/).length;return Math.max(1,Math.ceil(I/200))}),c=j(null),o=j(null),r=j(0);let h=null;function M(){if(!c.value)return;h?.disconnect(),h=new IntersectionObserver(C=>{for(const k of C)if(k.isIntersecting){const p=k.target.id,y=_.value.findIndex(A=>A.id===p);y>=0&&(r.value=y)}},{root:c.value,rootMargin:"-20% 0px -60% 0px",threshold:0}),o.value?.querySelectorAll("h2[id], h3[id]")?.forEach(C=>h.observe(C))}ne(()=>{setTimeout(M,100)}),ce(()=>d.content,()=>{setTimeout(M,100)}),Qt(()=>{h?.disconnect()});function S(I){o.value?.querySelector(`#${CSS.escape(I)}`)?.scrollIntoView({behavior:"smooth",block:"start"})}function N(){const I=window.open("","_blank");I&&(I.document.write(` +${d.title||"Article"} + +${d.title?`

${d.title}

`:""} +${$.value} +`),I.document.close(),I.print())}return(I,C)=>(s(),n("div",Ei,[_.value.length>1?(s(),n("aside",Fi,[C[4]||(C[4]=e("p",{class:"text-xs uppercase tracking-wider text-white/30 mb-2 px-2"},"Contents",-1)),(s(!0),n(D,null,L(_.value,(k,p)=>(s(),n("button",{key:p,class:i(["text-left text-xs leading-relaxed py-1 px-2 rounded transition-colors truncate",[r.value===p?"text-accent bg-accent/10":"text-white/50 hover:text-white/70 hover:bg-white/5",k.level===3?"pl-5":""]]),onClick:y=>S(k.id)},u(k.text),11,Ri))),128))])):m("",!0),e("div",{ref_key:"contentRef",ref:c,class:"flex-1 overflow-y-auto scrollbar-hide"},[e("div",Vi,[e("button",{class:"min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg text-white/60 hover:text-white/80 hover:bg-white/10 transition-colors",title:"Back",onClick:C[0]||(C[0]=k=>I.$emit("back"))},[...C[5]||(C[5]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),e("span",Ui,u(b.value)+" min read",1),_.value.length>1?(s(),n("button",{key:0,class:"lg:hidden min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg text-white/60 hover:text-white/80 hover:bg-white/10 transition-colors",title:"Table of contents",onClick:C[1]||(C[1]=k=>v.value=!v.value)},[...C[6]||(C[6]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h16M4 18h7"})],-1)])])):m("",!0),e("button",{class:"min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg text-white/60 hover:text-white/80 hover:bg-white/10 transition-colors",title:"Decrease font size",disabled:g.value<=0,onClick:C[2]||(C[2]=k=>g.value=Math.max(0,g.value-1))},[...C[7]||(C[7]=[e("span",{class:"text-xs font-bold"},"A-",-1)])],8,qi),e("button",{class:"min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg text-white/60 hover:text-white/80 hover:bg-white/10 transition-colors",title:"Increase font size",disabled:g.value>=l.length-1,onClick:C[3]||(C[3]=k=>g.value=Math.min(l.length-1,g.value+1))},[...C[8]||(C[8]=[e("span",{class:"text-xs font-bold"},"A+",-1)])],8,Gi),e("button",{class:"min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg text-white/60 hover:text-white/80 hover:bg-white/10 transition-colors",title:"Print",onClick:N},[...C[9]||(C[9]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"})],-1)])])]),v.value&&_.value.length>1?(s(),n("div",Oi,[(s(!0),n(D,null,L(_.value,(k,p)=>(s(),n("button",{key:p,class:i(["block w-full text-left text-xs py-1 px-2 rounded transition-colors truncate",[r.value===p?"text-accent bg-accent/10":"text-white/50 hover:text-white/70",k.level===3?"pl-5":""]]),onClick:y=>{S(k.id),v.value=!1}},u(k.text),11,Hi))),128))])):m("",!0),e("article",{ref_key:"articleRef",ref:o,class:"article-body px-4 md:px-8 py-6 max-w-prose mx-auto leading-relaxed text-white/90",style:G({fontSize:l[g.value]+"px"})},[a.title?(s(),n("h1",Wi,u(a.title),1)):m("",!0),e("div",{class:"article-content [&_h2]:text-lg [&_h2]:font-semibold [&_h2]:text-white/96 [&_h2]:mt-8 [&_h2]:mb-3 [&_h3]:text-base [&_h3]:font-medium [&_h3]:text-white/90 [&_h3]:mt-6 [&_h3]:mb-2 [&_p]:mb-4 [&_ul]:list-disc [&_ul]:ml-5 [&_ul]:mb-4 [&_ol]:list-decimal [&_ol]:ml-5 [&_ol]:mb-4 [&_li]:mb-1 [&_a]:text-accent [&_a]:underline [&_a]:underline-offset-2 [&_blockquote]:border-l-2 [&_blockquote]:border-accent/30 [&_blockquote]:pl-4 [&_blockquote]:italic [&_blockquote]:text-white/70 [&_blockquote]:my-4 [&_code]:bg-white/10 [&_code]:px-1.5 [&_code]:py-0.5 [&_code]:rounded [&_code]:text-[0.9em] [&_pre]:bg-white/5 [&_pre]:rounded-lg [&_pre]:p-4 [&_pre]:overflow-x-auto [&_pre]:my-4 [&_img]:rounded-lg [&_img]:max-w-full [&_img]:my-4 [&_hr]:border-white/10 [&_hr]:my-6",innerHTML:$.value},null,8,Ki)],4)],512)]))}}),Qi={class:"h-full flex flex-col"},Ji={class:"flex items-center gap-2 px-4 py-3 border-b border-white/[0.08]"},Zi={class:"text-xs text-white/40 truncate"},Xi={class:"flex-1 overflow-y-auto custom-scrollbar"},er={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-3 pb-16 space-y-2"},tr={key:0,class:"flex items-center justify-center py-12"},sr=["onClick"],nr={class:"space-y-1"},lr={class:"text-xs font-semibold text-white/80 line-clamp-2"},or={class:"text-xs text-white/40 line-clamp-2"},ar={class:"flex items-center gap-2"},ir={class:"text-xs text-white/25 font-mono"},rr={class:"text-xs text-white/20"},cr={key:0,class:"text-xs text-accent/40 ml-auto"},dr={key:1,class:"flex items-center justify-center py-12"},ur=O({__name:"NostrArticles",setup(a){const d=j([]),l=j(!0),w=j(null),g=B(()=>w.value?f(w.value):"");function v(c){return c.length<=16?c:c.slice(0,8)+"..."+c.slice(-4)}function x(c){return new Date(c*1e3).toLocaleDateString("en",{month:"short",day:"numeric",year:"numeric"})}function f(c){const o=c.tags.find(h=>h[0]==="title");return o?.[1]?o[1]:c.content.split(` +`)[0].replace(/^#+ /,"").slice(0,60)||"Untitled"}function $(c){const o=c.tags.find(r=>r[0]==="summary");return o?.[1]?o[1]:c.content.slice(0,120).replace(/[#*_]/g,"")}function _(c){return c.tags.find(r=>r[0]==="image")?.[1]??null}async function b(){l.value=!0,d.value=[];const c="wss://relay.nostr.band",o="articles-"+Math.random().toString(36).slice(2,8);try{const r=new WebSocket(c),h=[],M=setTimeout(()=>{r.close(),d.value=h,l.value=!1},1e4);r.onopen=()=>{r.send(JSON.stringify(["REQ",o,{kinds:[30023],limit:30}]))},r.onmessage=S=>{try{const N=JSON.parse(S.data);if(Array.isArray(N)&&N[0]==="EVENT"&&N[1]===o&&N[2]){const I=N[2];h.find(C=>C.id===I.id)||h.push({id:I.id,pubkey:I.pubkey,authorName:v(I.pubkey),kind:I.kind,content:I.content,created_at:I.created_at,tags:I.tags??[]})}Array.isArray(N)&&N[0]==="EOSE"&&(clearTimeout(M),r.close(),h.sort((I,C)=>C.created_at-I.created_at),d.value=h,l.value=!1)}catch{}},r.onerror=()=>{clearTimeout(M),l.value=!1}}catch{l.value=!1}}return ne(()=>{b()}),(c,o)=>(s(),n("div",Qi,[w.value?(s(),n(D,{key:0},[e("div",Ji,[e("button",{class:"min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg text-white/60 hover:text-white/80 hover:bg-white/10 transition-colors",onClick:o[0]||(o[0]=r=>w.value=null)},[...o[1]||(o[1]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),e("span",Zi,u(g.value),1)]),e("div",Xi,[te(Yi,{content:w.value.content,title:g.value},null,8,["content","title"])])],64)):(s(),n(D,{key:1},[o[4]||(o[4]=e("div",{class:"p-4 border-b border-white/[0.08]"},[e("h3",{class:"text-sm font-bold text-white/90 mb-2"},"Long-Form Articles"),e("p",{class:"text-xs text-white/30"},"NIP-23 kind:30023 articles from your network")],-1)),e("div",er,[l.value?(s(),n("div",tr,[...o[2]||(o[2]=[e("p",{class:"text-xs text-white/30"},"Loading articles...",-1)])])):m("",!0),(s(!0),n(D,null,L(d.value,r=>(s(),n("button",{key:r.id,class:"w-full text-left p-3 rounded-xl transition-all duration-150 bg-white/[0.03] hover:bg-white/[0.07] border border-white/5",onClick:h=>w.value=r},[e("div",nr,[e("h4",lr,u(f(r)),1),e("p",or,u($(r)),1),e("div",ar,[e("span",ir,u(v(r.pubkey)),1),e("span",rr,u(x(r.created_at)),1),_(r)?(s(),n("span",cr,"has image")):m("",!0)])])],8,sr))),128)),!l.value&&d.value.length===0?(s(),n("div",dr,[...o[3]||(o[3]=[e("p",{class:"text-xs text-white/30"},"No articles found",-1)])])):m("",!0)])],64))]))}}),We=1440*60*1e3,ft="aiui-nip05-cache",Te=j(new Map);function hr(){try{const a=localStorage.getItem(ft);if(a){const d=JSON.parse(a),l=Date.now(),w=d.filter(([,g])=>l-g.timestamp=We?null:v.verified}return{verifyNip05:a,isVerified:l}}const gr={class:"h-full flex flex-col"},br={class:"flex gap-2 px-4 pt-3 pb-1"},vr=["onClick"],fr={class:"p-4 space-y-3 border-b border-white/[0.08]"},mr={class:"flex items-center justify-between gap-2"},wr={class:"flex items-center gap-2 shrink-0"},yr={class:"text-xs font-mono text-white/30"},kr={key:1,class:"rounded-lg bg-white/5 border border-white/10 p-3 space-y-2"},$r=["onKeydown"],_r={class:"flex items-center justify-between gap-2"},Cr=["disabled"],jr={key:0,class:"space-y-1"},Sr={class:"truncate font-mono text-white/40"},Mr={class:"flex gap-2"},Tr=["disabled"],Ir={class:"flex gap-2"},Dr=["onClick"],Br={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-3 pb-16 space-y-2"},Lr={key:0,class:"flex flex-col items-center justify-center py-12 gap-3"},Pr=["onClick"],Nr={class:"flex items-start gap-2.5"},Ar={class:"w-8 h-8 rounded-full shrink-0 overflow-hidden"},zr=["src","alt","onError"],Er={key:1,class:"w-full h-full flex items-center justify-center text-xs font-bold bg-purple-500/20 text-purple-400"},Fr={class:"flex-1 min-w-0"},Rr={class:"flex items-center gap-1.5"},Vr={class:"text-xs font-semibold truncate text-white/80"},Ur={key:0,class:"text-xs truncate text-purple-400/60 flex items-center gap-0.5"},qr=["title"],Gr={class:"text-xs ml-auto shrink-0 text-white/20"},Or={class:"text-xs mt-1 leading-relaxed line-clamp-3 text-white/60"},Hr={class:"flex items-center gap-3 mt-2"},Wr=["onClick"],Kr={key:0,class:"text-xs px-1.5 py-0.5 rounded bg-white/5 text-white/30"},Yr={class:"mt-4 pt-4 border-t border-white/5"},Qr={class:"space-y-1"},Jr={class:"truncate font-mono text-white/40"},Zr={key:1,class:"flex items-center justify-center py-12"},Xr=O({__name:"NostrGrid",setup(a){const{events:d,isConnected:l,relayStates:w,connect:g,publishEvent:v,searchResults:x,isSearching:f,searchNostr:$}=De(),{isLoggedIn:_,signEvent:b}=ve(),{verifyNip05:c}=pr(),o=j("feed"),r=[{id:"feed",label:"Feed"},{id:"articles",label:"Articles"},{id:"dms",label:"Messages"},{id:"lists",label:"Lists"},{id:"relays",label:"Relays"},{id:"profile",label:"Profile"}],h=j(null),M=Pe(new Set),S=j(""),N=j(null),I=j(!1),C=j(""),k=j(null),p=j(!1),y=j([]),A=j(!1),V=j(""),E=j(void 0);function Y(X){V.value=X.authorName??X.pubkey.slice(0,12),E.value=void 0,A.value=!0}const H=Pe({}),F=[{id:1,label:"Notes"},{id:30023,label:"Articles"},{id:9735,label:"Zaps"},{id:6,label:"Reposts"}];function U(X){const z=Math.floor(Date.now()/1e3-X);return z<60?"now":z<3600?`${Math.floor(z/60)}m`:z<86400?`${Math.floor(z/3600)}h`:`${Math.floor(z/86400)}d`}const W=j(!1),le=B(()=>{if(W.value&&x.value.length>0){let z=x.value;return N.value!==null&&(z=z.filter(P=>P.kind===N.value)),z}let X=d.value;if(N.value!==null&&(X=X.filter(z=>z.kind===N.value)),S.value){const z=S.value.toLowerCase();X=X.filter(P=>P.content.toLowerCase().includes(z)||(P.authorName??"").toLowerCase().includes(z)||(P.nip05??"").toLowerCase().includes(z))}return X});function fe(){S.value.trim()&&(W.value=!0,$(S.value.trim(),N.value?[N.value]:void 0))}ce(S,X=>{X.trim()||(W.value=!1)}),ce(le,X=>{for(const z of X)z.nip05&&H[z.id]===void 0&&(H[z.id]=null,c(z.nip05,z.pubkey).then(P=>{H[z.id]=P}))},{immediate:!0});async function pe(){if(!C.value.trim()||p.value)return;p.value=!0,y.value=[];const X={kind:1,created_at:Math.floor(Date.now()/1e3),tags:[],content:C.value.trim()},z=await b(X);if(!z){p.value=!1;return}const P=await v(z);y.value=P,p.value=!1,P.some(re=>re.success)&&(C.value="",setTimeout(()=>{y.value=[],I.value=!1},3e3))}return ne(async()=>{g(),I.value&&(await ye(),k.value?.focus())}),(X,z)=>(s(),n("div",gr,[e("div",br,[(s(),n(D,null,L(r,P=>e("button",{key:P.id,class:i(["text-xs px-2.5 min-h-[44px] rounded-md transition-all duration-150 flex items-center justify-center",o.value===P.id?"nav-tab-active":"text-white/40 hover:text-white/70 hover:bg-white/5"]),onClick:re=>o.value=P.id},u(P.label),11,vr)),64))]),o.value==="dms"?(s(),q(pa,{key:0})):o.value==="relays"?(s(),q(Ia,{key:1})):o.value==="profile"?(s(),q(Ua,{key:2})):o.value==="lists"?(s(),q(zi,{key:3})):o.value==="articles"?(s(),q(ur,{key:4})):o.value==="feed"&&h.value?(s(),q(mi,{key:5,"note-id":h.value,onBack:z[0]||(z[0]=P=>h.value=null)},null,8,["note-id"])):(s(),n(D,{key:6},[e("div",fr,[e("div",mr,[z[5]||(z[5]=e("h3",{class:"text-sm font-bold text-white/90"}," Nostr Feed ",-1)),e("div",wr,[e("span",yr,u(le.value.length)+" notes ",1),ie(X.$slots,"header-actions")])]),t(_)?(s(),n("button",{key:0,class:"w-full text-left px-3 py-2 rounded-lg text-xs text-white/40 bg-white/5 hover:bg-white/10 transition-colors",onClick:z[1]||(z[1]=P=>I.value=!I.value)},u(I.value?"Cancel":"Write a note..."),1)):m("",!0),I.value&&t(_)?(s(),n("div",kr,[K(e("textarea",{ref_key:"composeRef",ref:k,"onUpdate:modelValue":z[2]||(z[2]=P=>C.value=P),class:"w-full bg-transparent text-base text-white/80 placeholder:text-white/25 outline-none resize-none min-h-[80px]",placeholder:"What's on your mind?",onKeydown:[ae(we(pe,["meta"]),["enter"]),ae(we(pe,["ctrl"]),["enter"])]},null,40,$r),[[J,C.value]]),e("div",_r,[e("span",{class:i(["text-xs tabular-nums",C.value.length>280?"text-accent/80":"text-white/25"])},u(C.value.length),3),e("button",{class:"text-xs px-3 py-1.5 rounded-lg bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors disabled:opacity-30",disabled:!C.value.trim()||p.value,onClick:pe},u(p.value?"Publishing...":"Publish"),9,Cr)]),y.value.length>0?(s(),n("div",jr,[(s(!0),n(D,null,L(y.value,P=>(s(),n("div",{key:P.url,class:"flex items-center gap-2 text-xs px-2 py-1 rounded bg-white/[0.02]"},[e("span",{class:i(["w-1.5 h-1.5 rounded-full shrink-0",P.success?"bg-emerald-500":"bg-red-400/60"])},null,2),e("span",Sr,u(P.url),1),e("span",{class:i(["ml-auto shrink-0",P.success?"text-emerald-400/60":"text-red-400/60"])},u(P.message),3)]))),128))])):m("",!0)])):m("",!0),e("div",Mr,[K(e("input",{"onUpdate:modelValue":z[3]||(z[3]=P=>S.value=P),type:"text",placeholder:"Search notes, npubs...",class:"flex-1 px-3 py-2 rounded-lg text-base outline-none transition-colors bg-white/5 text-white/80 placeholder:text-white/25 focus:bg-white/10",onKeydown:ae(fe,["enter"])},null,544),[[J,S.value]]),S.value.trim()?(s(),n("button",{key:0,class:"px-2.5 py-2 rounded-lg text-xs bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors disabled:opacity-30 shrink-0",disabled:t(f),onClick:fe},u(t(f)?"...":"NIP-50"),9,Tr)):m("",!0)]),e("div",Ir,[(s(),n(D,null,L(F,P=>e("button",{key:P.id,class:i(["text-xs px-2.5 min-h-[44px] rounded-md transition-all duration-150 flex items-center justify-center",N.value===P.id?"nav-tab-active":"text-white/40 hover:text-white/70 hover:bg-white/5"]),onClick:re=>N.value=N.value===P.id?null:P.id},u(P.label),11,Dr)),64))])]),e("div",Br,[!t(l)&&t(d).length===0?(s(),n("div",Lr,[...z[6]||(z[6]=[e("svg",{class:"w-5 h-5 animate-spin text-white/30",fill:"none",viewBox:"0 0 24 24"},[e("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})],-1),e("p",{class:"text-xs text-white/30"},"Connecting to relays...",-1)])])):m("",!0),(s(!0),n(D,null,L(le.value,P=>(s(),n("button",{key:P.id,class:"w-full text-left p-3 rounded-xl transition-all duration-150 bg-white/[0.03] hover:bg-white/[0.07] border border-white/5",onClick:re=>h.value=P.id},[e("div",Nr,[e("div",Ar,[P.authorPicture&&!M.has(P.pubkey)?(s(),n("img",{key:0,src:P.authorPicture,alt:P.authorName??"profile",class:"w-full h-full object-cover",loading:"lazy",onError:re=>M.add(P.pubkey)},null,40,zr)):(s(),n("div",Er,u(P.authorName?.charAt(0)?.toUpperCase()??"?"),1))]),e("div",Fr,[e("div",Rr,[e("span",Vr,u(P.authorName??"anon"),1),P.nip05?(s(),n("span",Ur,[H[P.id]===!0?(s(),n("svg",{key:0,class:"w-2.5 h-2.5 text-emerald-400 shrink-0",fill:"currentColor",viewBox:"0 0 20 20",title:P.nip05},[...z[7]||(z[7]=[e("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"},null,-1)])],8,qr)):m("",!0),se(" "+u(P.nip05),1)])):m("",!0),e("span",Gr,u(U(P.created_at)),1)]),e("p",Or,u(P.content),1),e("div",Hr,[e("button",{class:"text-xs px-3 py-2 min-h-[44px] min-w-[44px] rounded bg-white/5 text-accent/60 hover:text-accent hover:bg-accent/10 transition-colors flex items-center justify-center",onClick:we(re=>Y(P),["stop"])}," Zap ",8,Wr),P.kind!==1?(s(),n("span",Kr," kind:"+u(P.kind),1)):m("",!0)])])])],8,Pr))),128)),e("div",Yr,[z[8]||(z[8]=e("p",{class:"text-xs font-medium mb-2 text-white/30"},"Relays",-1)),e("div",Qr,[(s(!0),n(D,null,L(t(w),P=>(s(),n("div",{key:P.url,class:"flex items-center gap-2 text-xs px-2 py-1 rounded-lg bg-white/[0.02]"},[e("span",{class:i(["w-1.5 h-1.5 rounded-full shrink-0",P.connected?"bg-emerald-500":"bg-red-400/60"])},null,2),e("span",Jr,u(P.url),1)]))),128))])]),t(l)&&le.value.length===0?(s(),n("div",Zr,[...z[9]||(z[9]=[e("p",{class:"text-sm text-white/30"},"No notes match your search",-1)])])):m("",!0)])],64)),te(ti,{"is-open":A.value,"target-name":V.value,"lightning-address":E.value,onClose:z[4]||(z[4]=P=>A.value=!1)},null,8,["is-open","target-name","lightning-address"])]))}}),ec={class:"flex-1 min-h-0 flex flex-col"},at=O({__name:"ContentGridView",props:{activeTab:{},isWideDesktop:{type:Boolean},isMobile:{type:Boolean},panelFilms:{},panelBooks:{},panelTVSeries:{},panelImages:{},panelPlaces:{},panelSongs:{},panelPodcasts:{},panelWebResults:{},panelWebsites:{},panelMagazineSections:{},panelMagazineHeroImage:{},panelRecipes:{},panelApps:{},panelTitle:{},panelQuery:{},panelResponseText:{}},setup(a){const d=a,l=B(()=>{const o=d.panelResponseText??"";if(!o)return[{title:d.panelQuery||"Prompt",content:""}];const r=is(o);return r.length>0?r:[{title:d.panelQuery||"Response",content:rs(o)}]}),{openFilmDetail:w,openBookDetail:g,openTVSeriesDetail:v,openImageDetail:x,openPlaceDetail:f,openSongDetail:$,openPodcastDetail:_,openRecipeDetail:b,openAppDetail:c}=$e();return(o,r)=>(s(),n("div",ec,[a.activeTab==="film"?(s(),q(ds,{key:0,films:a.panelFilms,title:a.panelTitle,onSelectFilm:t(w)},null,8,["films","title","onSelectFilm"])):a.activeTab==="book"?(s(),q(Ns,{key:1,books:a.panelBooks,title:a.panelTitle,onSelectBook:t(g)},null,8,["books","title","onSelectBook"])):a.activeTab==="tvshow"?(s(),q(nn,{key:2,series:a.panelTVSeries,title:a.panelTitle,onSelectSeries:t(v)},null,8,["series","title","onSelectSeries"])):a.activeTab==="image"?(s(),q(bn,{key:3,images:a.panelImages,title:a.panelTitle,onSelectImage:t(x)},null,8,["images","title","onSelectImage"])):a.activeTab==="place"?(s(),q(Fn,{key:4,places:a.panelPlaces,title:a.panelTitle,onSelectPlace:t(f)},null,8,["places","title","onSelectPlace"])):a.activeTab==="song"?(s(),q(us,{key:5,songs:a.panelSongs,title:a.panelTitle,onSelectSong:t($)},null,8,["songs","title","onSelectSong"])):a.activeTab==="magazine"?(s(),q(st,{key:6,sections:a.panelMagazineSections,"hero-image-url":a.panelMagazineHeroImage,title:a.panelTitle,query:a.panelQuery},null,8,["sections","hero-image-url","title","query"])):a.activeTab==="news"?(s(),q(nt,{key:7,articles:a.panelWebResults,title:a.panelTitle,query:a.panelQuery},null,8,["articles","title","query"])):a.activeTab==="websites"?(s(),q(nt,{key:8,articles:a.panelWebsites,title:a.panelTitle,variant:"websites"},null,8,["articles","title"])):a.activeTab==="podcast"?(s(),q(ll,{key:9,podcasts:a.panelPodcasts,title:a.panelTitle,onSelectPodcast:t(_)},null,8,["podcasts","title","onSelectPodcast"])):a.activeTab==="recipe"?(s(),q(Gl,{key:10,recipes:a.panelRecipes,title:a.panelTitle,onSelectRecipe:t(b)},null,8,["recipes","title","onSelectRecipe"])):a.activeTab==="app"?(s(),q(no,{key:11,apps:a.panelApps,title:a.panelTitle,onSelectApp:t(c)},null,8,["apps","title","onSelectApp"])):a.activeTab==="code"?(s(),q(ko,{key:12,"is-wide-desktop":a.isWideDesktop,"is-mobile":a.isMobile},null,8,["is-wide-desktop","is-mobile"])):a.activeTab==="design-system"?(s(),q(zo,{key:13})):a.activeTab==="nostr"?(s(),q(Xr,{key:14})):a.activeTab==="prompt"?(s(),q(st,{key:15,sections:l.value,"hero-image-url":null,title:"Prompt",query:a.panelQuery},null,8,["sections","query"])):m("",!0)]))}}),tc={class:"book-detail h-full overflow-y-auto overflow-x-hidden scrollbar-hide"},sc={class:"relative w-full overflow-hidden"},nc={class:"w-full aspect-[16/7] flex items-center justify-center overflow-hidden bg-black/20"},lc=["src","alt"],oc={class:"absolute bottom-0 left-0 right-0 p-4"},ac={class:"text-lg font-bold text-white"},ic={class:"flex flex-wrap items-center gap-x-2 gap-y-0.5 mt-1 text-xs text-white/60"},rc={key:0},cc={key:1},dc={key:2,class:"text-amber-400"},uc={class:"p-4 space-y-4"},hc={key:1,class:"flex flex-wrap gap-1.5"},xc={class:"space-y-2"},pc=["href"],gc={class:"flex items-center gap-2.5"},bc={class:"text-sm"},vc=["href"],fc={class:"flex items-center gap-2.5"},mc={class:"text-sm"},wc=O({__name:"BookDetail",props:{book:{}},emits:["back"],setup(a){const d=a,{isDark:l}=Z(),{bannerSrc:w,fallbackGradient:g,onBannerError:v}=bt({primaryUrls:()=>[d.book.coverUrl],apiFetch:async()=>({posterUrl:await rt(d.book.title,d.book.author),backdropUrl:null}),title:()=>d.book.title,gradientSeed:()=>d.book.title+(d.book.author??"")}),x=B(()=>`${d.book.title} ${d.book.author}`.trim().replace(/\s+/g,"+")),f=B(()=>[{name:"Open Library",url:`https://openlibrary.org/search?q=${x.value}`,icon:"📖",desc:"Free, open catalog"},{name:"Internet Archive",url:`https://archive.org/search?query=${x.value}`,icon:"🏛️",desc:"Borrow & read free"},{name:"Project Gutenberg",url:`https://www.gutenberg.org/ebooks/search/?query=${x.value}`,icon:"📜",desc:"Public domain"},{name:"Standard Ebooks",url:`https://standardebooks.org/ebooks?query=${x.value}`,icon:"📕",desc:"Beautifully formatted"}]);function $(_){return{openlibrary:"📖",gutenberg:"📜",archive:"🏛️",goodreads:"📚",libgen:"🔓",local:"💾"}[_]??"📚"}return(_,b)=>(s(),n("div",tc,[e("div",sc,[e("div",nc,[t(w)?(s(),n("img",{key:0,src:t(w),alt:a.book.title,class:"w-full h-full object-cover object-center block",onError:b[0]||(b[0]=(...c)=>t(v)&&t(v)(...c))},null,40,lc)):(s(),n("div",{key:1,class:"w-full h-full",style:G({background:t(g)})},null,4))]),b[3]||(b[3]=e("div",{class:"absolute inset-0 bg-gradient-to-t from-black/80 via-black/30 to-transparent pointer-events-none"},null,-1)),e("button",{class:"absolute top-3 left-3 min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg path-glass-icon z-10 transition-colors hover:bg-white/10",onClick:b[1]||(b[1]=c=>_.$emit("back"))},[...b[2]||(b[2]=[e("svg",{class:"w-4 h-4 text-white/90",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),e("div",oc,[e("h2",ac,u(a.book.title),1),e("div",ic,[e("span",null,u(a.book.author),1),a.book.year?(s(),n("span",rc,u(a.book.year),1)):m("",!0),a.book.pages?(s(),n("span",cc,u(a.book.pages)+" pages",1)):m("",!0),a.book.rating?(s(),n("span",dc,"★ "+u(a.book.rating.toFixed(1)),1)):m("",!0)])])]),e("div",uc,[a.book.description?(s(),n("p",{key:0,class:i(["text-sm leading-relaxed",t(l)?"text-white/70":"text-gray-600"])},u(a.book.description),3)):m("",!0),a.book.genres?.length?(s(),n("div",hc,[(s(!0),n(D,null,L(a.book.genres,c=>(s(),n("span",{key:c,class:i(["text-xs px-2 py-1 rounded-md font-medium",t(l)?"bg-white/10 text-white/60":"bg-black/5 text-gray-600"])},u(c),3))),128))])):m("",!0),e("div",null,[e("h4",{class:i(["text-xs font-semibold mb-2",t(l)?"text-white/50":"text-gray-500"])},"Read on",2),e("div",xc,[(s(!0),n(D,null,L(a.book.sources??[],c=>(s(),n("a",{key:c.url,href:c.url,target:"_blank",rel:"noopener",class:i(["flex items-center justify-between p-3 rounded-xl transition-colors",t(l)?"bg-white/5 hover:bg-white/10":"bg-black/3 hover:bg-black/5"])},[e("div",gc,[e("span",bc,u($(c.type)),1),e("p",{class:i(["text-xs font-medium",t(l)?"text-white/80":"text-gray-800"])},u(c.name),3)]),(s(),n("svg",{class:i(["w-4 h-4",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...b[4]||(b[4]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"},null,-1)])],2))],10,pc))),128)),(s(!0),n(D,null,L(f.value,c=>(s(),n("a",{key:c.url,href:c.url,target:"_blank",rel:"noopener",class:i(["flex items-center justify-between p-3 rounded-xl transition-colors",t(l)?"bg-white/5 hover:bg-white/10":"bg-black/3 hover:bg-black/5"])},[e("div",fc,[e("span",mc,u(c.icon),1),e("div",null,[e("p",{class:i(["text-xs font-medium",t(l)?"text-white/80":"text-gray-800"])},u(c.name),3),c.desc?(s(),n("p",{key:0,class:i(["text-xs",t(l)?"text-white/30":"text-gray-400"])},u(c.desc),3)):m("",!0)])]),(s(),n("svg",{class:i(["w-4 h-4",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...b[5]||(b[5]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"},null,-1)])],2))],10,vc))),128))])])])]))}}),yc={class:"tv-detail h-full overflow-y-auto overflow-x-hidden scrollbar-hide"},kc={class:"relative w-full overflow-hidden"},$c={class:"w-full aspect-[16/7] flex items-center justify-center overflow-hidden bg-black/20"},_c=["src","alt"],Cc={class:"absolute bottom-0 left-0 right-0 p-4"},jc={class:"text-lg font-bold text-white"},Sc={class:"flex flex-wrap items-center gap-x-2 gap-y-0.5 mt-1 text-xs text-white/60"},Mc={key:0},Tc={key:1},Ic={key:2},Dc={key:3},Bc={key:4,class:"text-amber-400"},Lc={key:5,class:"text-emerald-400"},Pc={key:6,class:"text-white/40"},Nc={class:"p-4 space-y-4"},Ac={key:3,class:"flex flex-wrap gap-1.5"},zc={class:"space-y-2"},Ec=["href"],Fc={class:"flex items-center gap-2.5"},Rc={class:"text-sm"},Vc=["href"],Uc={class:"flex items-center gap-2.5"},qc={class:"text-sm"},Gc=O({__name:"TVSeriesDetail",props:{series:{}},emits:["back"],setup(a){const d=a,{isDark:l}=Z(),{bannerSrc:w,fallbackGradient:g,onBannerError:v}=bt({primaryUrls:()=>[d.series.posterUrl,d.series.backdropUrl],apiFetch:()=>ct(d.series.title,d.series.year),title:()=>d.series.title}),x=B(()=>d.series.year?d.series.endYear&&d.series.endYear!==d.series.year?`${d.series.year}–${d.series.endYear}`:d.series.status==="ongoing"?`${d.series.year}–`:String(d.series.year):""),f=B(()=>d.series.title.trim().replace(/\s+/g,"+")),$=B(()=>(d.series.sources??[]).length>0?[]:[{name:"Internet Archive",url:`https://archive.org/search?query=${f.value}`,icon:"🏛️",desc:"Free, open archive"},{name:"YouTube",url:`https://youtube.com/results?search_query=${f.value}+full+series`,icon:"▶️",desc:"Free episodes"},{name:"Odysee",url:`https://odysee.com/$/search?q=${f.value}`,icon:"🔗",desc:"Decentralized"},{name:"Tubi",url:`https://tubitv.com/search/${f.value}`,icon:"📺",desc:"Free streaming"}]);function _(b){return{plex:"🟠",nextcloud:"☁️",youtube:"▶️",netflix:"🔴","free-web":"🌐",local:"💾"}[b]??"📺"}return(b,c)=>(s(),n("div",yc,[e("div",kc,[e("div",$c,[t(w)?(s(),n("img",{key:0,src:t(w),alt:a.series.title,class:"w-full h-full object-cover object-center block",onError:c[0]||(c[0]=(...o)=>t(v)&&t(v)(...o))},null,40,_c)):(s(),n("div",{key:1,class:"w-full h-full",style:G({background:t(g)})},null,4))]),c[3]||(c[3]=e("div",{class:"absolute inset-0 bg-gradient-to-t from-black/80 via-black/30 to-transparent pointer-events-none"},null,-1)),e("button",{class:"absolute top-3 left-3 min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg path-glass-icon z-10 transition-colors hover:bg-white/10",onClick:c[1]||(c[1]=o=>b.$emit("back"))},[...c[2]||(c[2]=[e("svg",{class:"w-4 h-4 text-white/90",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),e("div",Cc,[e("h2",jc,u(a.series.title),1),e("div",Sc,[x.value?(s(),n("span",Mc,u(x.value),1)):m("",!0),a.series.seasons?(s(),n("span",Tc,u(a.series.seasons)+" seasons",1)):m("",!0),a.series.episodes?(s(),n("span",Ic,u(a.series.episodes)+" episodes",1)):m("",!0),a.series.network?(s(),n("span",Dc,u(a.series.network),1)):m("",!0),a.series.rating?(s(),n("span",Bc,"★ "+u(a.series.rating.toFixed(1)),1)):m("",!0),a.series.status==="ongoing"?(s(),n("span",Lc,"ongoing")):a.series.status==="ended"?(s(),n("span",Pc,"ended")):m("",!0)])])]),e("div",Nc,[a.series.synopsis?(s(),n("p",{key:0,class:i(["text-sm leading-relaxed",t(l)?"text-white/70":"text-gray-600"])},u(a.series.synopsis),3)):m("",!0),a.series.creator?(s(),n("div",{key:1,class:i(["text-xs",t(l)?"text-white/50":"text-gray-500"])},[c[4]||(c[4]=se(" Created by ",-1)),e("span",{class:i(["font-medium",t(l)?"text-white/70":"text-gray-700"])},u(a.series.creator),3)],2)):m("",!0),a.series.cast?.length?(s(),n("div",{key:2,class:i(["text-xs",t(l)?"text-white/50":"text-gray-500"])}," Starring: "+u(a.series.cast.slice(0,5).join(", ")),3)):m("",!0),a.series.genres?.length?(s(),n("div",Ac,[(s(!0),n(D,null,L(a.series.genres,o=>(s(),n("span",{key:o,class:i(["text-xs px-2 py-1 rounded-md font-medium",t(l)?"bg-white/10 text-white/60":"bg-black/5 text-gray-600"])},u(o),3))),128))])):m("",!0),e("div",null,[e("h4",{class:i(["text-xs font-semibold mb-2",t(l)?"text-white/50":"text-gray-500"])},"Watch on",2),e("div",zc,[(s(!0),n(D,null,L(a.series.sources??[],o=>(s(),n("a",{key:o.url,href:o.url,target:"_blank",rel:"noopener",class:i(["flex items-center justify-between p-3 rounded-xl transition-colors",t(l)?"bg-white/5 hover:bg-white/10":"bg-black/3 hover:bg-black/5"])},[e("div",Fc,[e("span",Rc,u(_(o.type)),1),e("p",{class:i(["text-xs font-medium",t(l)?"text-white/80":"text-gray-800"])},u(o.name),3)]),(s(),n("svg",{class:i(["w-4 h-4",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...c[5]||(c[5]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"},null,-1)])],2))],10,Ec))),128)),(s(!0),n(D,null,L($.value,o=>(s(),n("a",{key:o.url,href:o.url,target:"_blank",rel:"noopener",class:i(["flex items-center justify-between p-3 rounded-xl transition-colors",t(l)?"bg-white/5 hover:bg-white/10":"bg-black/3 hover:bg-black/5"])},[e("div",Uc,[e("span",qc,u(o.icon),1),e("div",null,[e("p",{class:i(["text-xs font-medium",t(l)?"text-white/80":"text-gray-800"])},u(o.name),3),o.desc?(s(),n("p",{key:0,class:i(["text-xs",t(l)?"text-white/30":"text-gray-400"])},u(o.desc),3)):m("",!0)])]),(s(),n("svg",{class:i(["w-4 h-4",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...c[6]||(c[6]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"},null,-1)])],2))],10,Vc))),128))])])])]))}}),Oc={class:"podcast-detail h-full overflow-y-auto overflow-x-hidden scrollbar-hide"},Hc={class:"relative w-full overflow-hidden"},Wc={class:"w-full aspect-[16/7] flex items-center justify-center overflow-hidden bg-black/20"},Kc=["src","alt"],Yc={class:"absolute bottom-0 left-0 right-0 p-4"},Qc={class:"text-lg font-bold text-white"},Jc={class:"flex flex-wrap items-center gap-x-2 gap-y-0.5 mt-1 text-xs text-white/60"},Zc={key:0},Xc={key:1},ed={key:2},td={class:"p-4 space-y-4"},sd={key:1,class:"flex flex-wrap gap-1.5"},nd={class:"space-y-2"},ld=["href"],od={class:"flex items-center gap-2.5"},ad={class:"text-sm"},id=["href"],rd={class:"flex items-center gap-2.5"},cd={class:"text-sm"},dd=O({__name:"PodcastDetail",props:{podcast:{}},emits:["back"],setup(a){const d=a,{isDark:l}=Z(),w=j(!1),g=j(null),v=B(()=>w.value?null:d.podcast.coverUrl||g.value||null);ne(()=>{d.podcast.coverUrl||xt(d.podcast.title,d.podcast.host).then(b=>{b&&(g.value=b)})});const x=B(()=>ht(d.podcast.title,d.podcast.host)),f=B(()=>`${d.podcast.title} ${d.podcast.host??""}`.trim().replace(/\s+/g,"+")),$=B(()=>d.podcast.sources.length>0?[]:[{name:"Fountain",url:`https://fountain.fm/search?q=${f.value}`,icon:"⚡",desc:"Podcasting 2.0, Lightning"},{name:"Podcast Index",url:`https://podcastindex.org/search?q=${f.value}`,icon:"📻",desc:"Open podcast directory"},{name:"YouTube",url:`https://youtube.com/results?search_query=${f.value}`,icon:"▶️",desc:"Video podcasts"},{name:"Rumble",url:`https://rumble.com/search/video?q=${f.value}`,icon:"📺",desc:"Video & podcasts"},{name:"Odysee",url:`https://odysee.com/$/search?q=${f.value}`,icon:"🔗",desc:"Decentralized"}]);function _(b){return{fountain:"⚡",rumble:"📺",youtube:"▶️",podcastindex:"📻",castopod:"🦣",odysee:"🔗",podverse:"🎧",ipfs:"🌐",rss:"📡"}[b]??"🎙️"}return(b,c)=>(s(),n("div",Oc,[e("div",Hc,[e("div",Wc,[v.value?(s(),n("img",{key:0,src:v.value,alt:a.podcast.title,class:"w-full h-full object-cover object-center block",onError:c[0]||(c[0]=o=>w.value=!0)},null,40,Kc)):(s(),n("div",{key:1,class:"w-full h-full bg-cover bg-center",style:G({backgroundImage:`url(${x.value})`})},null,4))]),c[3]||(c[3]=e("div",{class:"absolute inset-0 bg-gradient-to-t from-black/80 via-black/30 to-transparent pointer-events-none"},null,-1)),e("button",{class:"absolute top-3 left-3 min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg path-glass-icon z-10 transition-colors hover:bg-white/10",onClick:c[1]||(c[1]=o=>b.$emit("back"))},[...c[2]||(c[2]=[e("svg",{class:"w-4 h-4 text-white/90",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),e("div",Yc,[e("h2",Qc,u(a.podcast.title),1),e("div",Jc,[a.podcast.host?(s(),n("span",Zc,u(a.podcast.host),1)):m("",!0),a.podcast.year?(s(),n("span",Xc,u(a.podcast.year),1)):m("",!0),a.podcast.episodeCount?(s(),n("span",ed,u(a.podcast.episodeCount)+" episodes",1)):m("",!0)])])]),e("div",td,[a.podcast.description?(s(),n("p",{key:0,class:i(["text-sm leading-relaxed",t(l)?"text-white/70":"text-gray-600"])},u(a.podcast.description),3)):m("",!0),a.podcast.genres?.length?(s(),n("div",sd,[(s(!0),n(D,null,L(a.podcast.genres,o=>(s(),n("span",{key:o,class:i(["text-xs px-2 py-1 rounded-md font-medium",t(l)?"bg-white/10 text-white/60":"bg-black/5 text-gray-600"])},u(o),3))),128))])):m("",!0),e("div",null,[e("h4",{class:i(["text-xs font-semibold mb-2",t(l)?"text-white/50":"text-gray-500"])},"Listen on",2),e("div",nd,[(s(!0),n(D,null,L(a.podcast.sources,o=>(s(),n("a",{key:o.url,href:o.url,target:"_blank",rel:"noopener",class:i(["flex items-center justify-between p-3 rounded-xl transition-colors",t(l)?"bg-white/5 hover:bg-white/10":"bg-black/3 hover:bg-black/5"])},[e("div",od,[e("span",ad,u(_(o.type)),1),e("p",{class:i(["text-xs font-medium",t(l)?"text-white/80":"text-gray-800"])},u(o.name),3)]),(s(),n("svg",{class:i(["w-4 h-4",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...c[4]||(c[4]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"},null,-1)])],2))],10,ld))),128)),$.value.length?(s(!0),n(D,{key:0},L($.value,o=>(s(),n("a",{key:o.url,href:o.url,target:"_blank",rel:"noopener",class:i(["flex items-center justify-between p-3 rounded-xl transition-colors",t(l)?"bg-white/5 hover:bg-white/10":"bg-black/3 hover:bg-black/5"])},[e("div",rd,[e("span",cd,u(o.icon),1),e("div",null,[e("p",{class:i(["text-xs font-medium",t(l)?"text-white/80":"text-gray-800"])},u(o.name),3),o.desc?(s(),n("p",{key:0,class:i(["text-xs",t(l)?"text-white/30":"text-gray-400"])},u(o.desc),3)):m("",!0)])]),(s(),n("svg",{class:i(["w-4 h-4",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...c[5]||(c[5]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"},null,-1)])],2))],10,id))),128)):m("",!0)])])])]))}}),ud={class:"image-detail h-full overflow-y-auto overflow-x-hidden scrollbar-hide"},hd={class:"relative w-full overflow-hidden bg-black/20"},xd=["src","alt"],pd={class:"p-4 space-y-3"},gd={class:"pt-2"},bd=["href"],vd=O({__name:"ImageDetail",props:{image:{}},emits:["back"],setup(a){const{isDark:d}=Z(),l=j(!1);return(w,g)=>(s(),n("div",ud,[e("div",hd,[l.value?(s(),n("div",{key:1,class:i(["w-full aspect-video flex items-center justify-center",t(d)?"bg-white/5":"bg-black/5"])},[(s(),n("svg",{class:i(["w-12 h-12",t(d)?"text-white/15":"text-gray-300"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...g[2]||(g[2]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"},null,-1)])],2))],2)):(s(),n("img",{key:0,src:a.image.url,alt:a.image.alt||a.image.title||"Image",class:"w-full block max-h-[60vh] object-contain bg-black/40",onError:g[0]||(g[0]=v=>l.value=!0)},null,40,xd)),e("button",{class:"absolute top-3 left-3 min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg path-glass-icon z-10 transition-colors hover:bg-white/10",onClick:g[1]||(g[1]=v=>w.$emit("back"))},[...g[3]||(g[3]=[e("svg",{class:"w-4 h-4 text-white/90",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])])]),e("div",pd,[a.image.title?(s(),n("h2",{key:0,class:i(["text-base font-bold",t(d)?"text-white/90":"text-gray-900"])},u(a.image.title),3)):m("",!0),a.image.description?(s(),n("p",{key:1,class:i(["text-sm leading-relaxed",t(d)?"text-white/70":"text-gray-600"])},u(a.image.description),3)):m("",!0),a.image.attribution?(s(),n("div",{key:2,class:i(["text-xs",t(d)?"text-white/50":"text-gray-500"])},u(a.image.attribution),3)):m("",!0),a.image.source?(s(),n("div",{key:3,class:i(["text-xs",t(d)?"text-white/40":"text-gray-400"])}," Source: "+u(a.image.source),3)):m("",!0),a.image.width&&a.image.height?(s(),n("div",{key:4,class:i(["text-xs",t(d)?"text-white/30":"text-gray-400"])},u(a.image.width)+" × "+u(a.image.height),3)):m("",!0),e("div",gd,[e("a",{href:a.image.url,target:"_blank",rel:"noopener",class:i(["inline-flex items-center gap-2 px-4 min-h-[44px] rounded-xl text-xs font-medium transition-colors",t(d)?"bg-white/5 hover:bg-white/10 text-white/80":"bg-black/3 hover:bg-black/5 text-gray-800"])},[...g[4]||(g[4]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1),se(" Open original ",-1)])],10,bd)])])]))}}),fd={class:"place-detail h-full overflow-y-auto overflow-x-hidden scrollbar-hide"},md={class:"relative w-full overflow-hidden"},wd={class:"w-full aspect-[16/9] flex items-center justify-center overflow-hidden bg-black/20"},yd=["src","alt"],kd=["src","alt"],$d={class:"absolute bottom-0 left-0 right-0 p-4"},_d={class:"text-lg font-bold text-white"},Cd={class:"flex flex-wrap items-center gap-x-2 gap-y-0.5 mt-1 text-xs text-white/60"},jd={key:0},Sd={key:1},Md={key:2,class:"text-amber-400"},Td={key:3,class:"text-white/50"},Id={class:"p-4 space-y-4"},Dd={key:1,class:"flex items-start gap-2.5"},Bd={key:2,class:"flex items-center gap-2.5"},Ld={key:3,class:"flex items-start gap-2.5"},Pd={key:4,class:"flex items-center gap-2.5"},Nd=["href"],Ad={class:"space-y-2"},zd=["href"],Ed={class:"flex items-center gap-2.5"},Fd={class:"text-sm"},Rd=["href"],Vd={class:"flex items-center gap-2.5"},Ud={class:"text-sm"},qd=O({__name:"PlaceDetail",props:{place:{}},emits:["back"],setup(a){const d=a,{isDark:l}=Z(),w=j(null),g=B(()=>dt(d.place.name,d.place.cuisine||d.place.category));ne(()=>{d.place.photoUrl||ut(d.place.name,d.place.city).then(_=>{_&&(w.value=_)})});const v=B(()=>{if(!d.place.website)return"";try{return new URL(d.place.website).hostname.replace(/^www\./,"")}catch{return d.place.website}}),x=B(()=>`${d.place.name} ${d.place.city??""}`.trim().replace(/\s+/g,"+")),f=B(()=>{if((d.place.sources??[]).length>0)return[];const _=[{name:"OpenStreetMap",url:`https://www.openstreetmap.org/search?query=${x.value}`,icon:"🗺️",desc:"Open source maps"},{name:"Google Maps",url:`https://www.google.com/maps/search/${x.value}`,icon:"📍",desc:"Directions & reviews"}];return d.place.lat&&d.place.lng&&(_.unshift({name:"OpenStreetMap",url:`https://www.openstreetmap.org/?mlat=${d.place.lat}&mlon=${d.place.lng}#map=17/${d.place.lat}/${d.place.lng}`,icon:"🗺️",desc:"Open source maps"}),_.splice(2)),_});function $(_){return{gmaps:"📍",osm:"🗺️",yelp:"⭐",tripadvisor:"🦉",foursquare:"📌",local:"💾"}[_]??"📍"}return(_,b)=>(s(),n("div",fd,[e("div",md,[e("div",wd,[a.place.photoUrl||w.value?(s(),n("img",{key:0,src:a.place.photoUrl||w.value,alt:a.place.name,class:"w-full h-full object-cover object-center block"},null,8,yd)):(s(),n("img",{key:1,src:g.value,alt:a.place.name,class:"w-full h-full object-cover"},null,8,kd))]),b[2]||(b[2]=e("div",{class:"absolute inset-0 bg-gradient-to-t from-black/80 via-black/30 to-transparent pointer-events-none"},null,-1)),e("button",{class:"absolute top-3 left-3 min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg path-glass-icon z-10 transition-colors hover:bg-white/10",onClick:b[0]||(b[0]=c=>_.$emit("back"))},[...b[1]||(b[1]=[e("svg",{class:"w-4 h-4 text-white/90",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),e("div",$d,[e("h2",_d,u(a.place.name),1),e("div",Cd,[a.place.cuisine||a.place.category?(s(),n("span",jd,u(a.place.cuisine||a.place.category),1)):m("",!0),a.place.city?(s(),n("span",Sd,u(a.place.city),1)):m("",!0),a.place.rating?(s(),n("span",Md,"★ "+u(a.place.rating.toFixed(1)),1)):m("",!0),a.place.priceLevel?(s(),n("span",Td,u("$".repeat(a.place.priceLevel)),1)):m("",!0)])])]),e("div",Id,[a.place.description?(s(),n("p",{key:0,class:i(["text-sm leading-relaxed",t(l)?"text-white/70":"text-gray-600"])},u(a.place.description),3)):m("",!0),a.place.address?(s(),n("div",Dd,[(s(),n("svg",{class:i(["w-4 h-4 shrink-0 mt-0.5",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...b[3]||(b[3]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"},null,-1),e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"},null,-1)])],2)),e("span",{class:i(["text-xs",t(l)?"text-white/60":"text-gray-600"])},u(a.place.address),3)])):m("",!0),a.place.phone?(s(),n("div",Bd,[(s(),n("svg",{class:i(["w-4 h-4 shrink-0",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...b[4]||(b[4]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"},null,-1)])],2)),e("span",{class:i(["text-xs",t(l)?"text-white/60":"text-gray-600"])},u(a.place.phone),3)])):m("",!0),a.place.hours?(s(),n("div",Ld,[(s(),n("svg",{class:i(["w-4 h-4 shrink-0 mt-0.5",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...b[5]||(b[5]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])],2)),e("span",{class:i(["text-xs",t(l)?"text-white/60":"text-gray-600"])},u(a.place.hours),3)])):m("",!0),a.place.website?(s(),n("div",Pd,[(s(),n("svg",{class:i(["w-4 h-4 shrink-0",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...b[6]||(b[6]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"},null,-1)])],2)),e("a",{href:a.place.website,target:"_blank",rel:"noopener",class:i(["text-xs underline underline-offset-2",t(l)?"text-white/60 hover:text-white/80":"text-gray-600 hover:text-gray-800"])},u(v.value),11,Nd)])):m("",!0),e("div",null,[e("h4",{class:i(["text-xs font-semibold mb-2",t(l)?"text-white/50":"text-gray-500"])},"Find on",2),e("div",Ad,[(s(!0),n(D,null,L(a.place.sources??[],c=>(s(),n("a",{key:c.url,href:c.url,target:"_blank",rel:"noopener",class:i(["flex items-center justify-between p-3 rounded-xl transition-colors",t(l)?"bg-white/5 hover:bg-white/10":"bg-black/3 hover:bg-black/5"])},[e("div",Ed,[e("span",Fd,u($(c.type)),1),e("p",{class:i(["text-xs font-medium",t(l)?"text-white/80":"text-gray-800"])},u(c.name),3)]),(s(),n("svg",{class:i(["w-4 h-4",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...b[7]||(b[7]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"},null,-1)])],2))],10,zd))),128)),(s(!0),n(D,null,L(f.value,c=>(s(),n("a",{key:c.url,href:c.url,target:"_blank",rel:"noopener",class:i(["flex items-center justify-between p-3 rounded-xl transition-colors",t(l)?"bg-white/5 hover:bg-white/10":"bg-black/3 hover:bg-black/5"])},[e("div",Vd,[e("span",Ud,u(c.icon),1),e("div",null,[e("p",{class:i(["text-xs font-medium",t(l)?"text-white/80":"text-gray-800"])},u(c.name),3),c.desc?(s(),n("p",{key:0,class:i(["text-xs",t(l)?"text-white/30":"text-gray-400"])},u(c.desc),3)):m("",!0)])]),(s(),n("svg",{class:i(["w-4 h-4",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...b[8]||(b[8]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"},null,-1)])],2))],10,Rd))),128))])])])]))}}),Gd={class:"article-detail h-full overflow-y-auto overflow-x-hidden scrollbar-hide"},Od={class:"relative w-full overflow-hidden aspect-[16/7] shrink-0"},Hd=["src","alt"],Wd={class:"absolute bottom-0 left-0 right-0 p-4"},Kd={class:"text-lg font-bold text-white"},Yd={key:0,class:"text-xs text-white/60 mt-1"},Qd={class:"p-4 space-y-4"},Jd={key:0,class:"text-white/90 [&_p]:mb-3 [&_ul]:list-disc [&_ol]:list-decimal [&_li]:ml-4 [&_a]:underline [&_a]:underline-offset-2 [&_h1]:text-lg [&_h2]:text-base [&_h3]:text-sm [&_blockquote]:border-l-2 [&_blockquote]:pl-3 [&_blockquote]:italic"},Zd=["innerHTML"],Xd={key:1,class:"py-4"},eu=["href"],tu=O({__name:"ArticleDetail",props:{article:{}},emits:["back"],setup(a){const d=a,l=B(()=>{const v=d.article?.url;if(!v||typeof v!="string")return"";try{const x=new URL(v);return/^https?:$/i.test(x.protocol)?x.hostname.replace(/^www\./,""):""}catch{return""}}),w=B(()=>{const v=[...d.article.title].reduce((x,f)=>x+f.charCodeAt(0),0)%360;return`linear-gradient(135deg, hsl(${v}, 25%, 12%) 0%, hsl(${(v+40)%360}, 20%, 8%) 100%)`}),g=B(()=>{const v=d.article.content;return v?/<[a-z][\s\S]*>/i.test(v)?Zt(v):`

${Xt(v)}

`:""});return(v,x)=>(s(),n("div",Gd,[e("div",Od,[a.article.imgSrc&&t(Jt)(a.article.imgSrc)?(s(),n("img",{key:0,src:a.article.imgSrc,alt:a.article.title,class:"absolute inset-0 w-full h-full object-cover object-center block"},null,8,Hd)):(s(),n("div",{key:1,class:"absolute inset-0",style:G({background:w.value})},null,4)),x[2]||(x[2]=e("div",{class:"absolute inset-0 bg-gradient-to-t from-black/80 via-black/30 to-transparent pointer-events-none"},null,-1)),e("button",{class:"absolute top-3 left-3 p-2 rounded-lg path-glass-icon z-10 transition-colors hover:bg-white/10 text-white/80",onClick:x[0]||(x[0]=f=>v.$emit("back"))},[...x[1]||(x[1]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),e("div",Wd,[e("h2",Kd,u(a.article.title),1),l.value?(s(),n("p",Yd,u(l.value),1)):m("",!0)])]),e("div",Qd,[a.article.content?(s(),n("article",Jd,[e("div",{innerHTML:g.value},null,8,Zd)])):(s(),n("div",Xd,[...x[3]||(x[3]=[e("p",{class:"text-sm text-white/50"}," Full article content is not available. Open the link below to read on the source site. ",-1)])])),a.article.url?(s(),n("a",{key:2,href:a.article.url,target:"_blank",rel:"noopener noreferrer",class:"inline-flex items-center gap-2 p-3 rounded-xl transition-colors bg-white/10 hover:bg-white/15 text-white/90"},[...x[4]||(x[4]=[e("svg",{class:"w-4 h-4 shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1),se(" Read full article ",-1)])],8,eu)):m("",!0)])]))}}),su={class:"website-detail h-full flex flex-col overflow-hidden"},nu={class:"flex-1 min-w-0 pl-8"},lu=["href"],ou={class:"flex-1 min-h-0 relative bg-black/20"},au=["src"],iu=O({__name:"WebsiteDetail",props:{website:{}},emits:["back"],setup(a){const d=a,{isDark:l}=Z(),w=B(()=>{if(!d.website.url)return"";try{return new URL(d.website.url).hostname.replace(/^www\./,"")}catch{return""}});return(g,v)=>(s(),n("div",su,[e("div",{class:"shrink-0 flex items-center gap-2 px-3 py-2.5",style:G(t(l)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("button",{class:"absolute top-3 left-3 p-2 rounded-lg path-glass-icon z-10 transition-colors hover:bg-white/10",onClick:v[0]||(v[0]=x=>g.$emit("back"))},[...v[2]||(v[2]=[e("svg",{class:"w-4 h-4 text-white/90",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),e("div",nu,[e("p",{class:i(["text-sm font-medium truncate",t(l)?"text-white/90":"text-gray-900"])},u(a.website.title||"Website"),3),w.value?(s(),n("p",{key:0,class:i(["text-xs truncate",t(l)?"text-white/30":"text-gray-400"])},u(w.value),3)):m("",!0)]),e("a",{href:a.website.url,target:"_blank",rel:"noopener noreferrer",class:i(["flex items-center justify-center w-8 h-8 rounded-lg transition-colors shrink-0",t(l)?"hover:bg-white/10 text-white/50":"hover:bg-black/5 text-gray-400"]),"aria-label":"Open in new tab",title:"Open in new tab",onClick:v[1]||(v[1]=we(()=>{},["stop"]))},[...v[3]||(v[3]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1)])],10,lu)],4),e("div",ou,[(s(),n("iframe",{key:a.website.url,src:a.website.url,class:"absolute inset-0 w-full h-full border-0",style:{"-ms-overflow-style":"none","scrollbar-width":"none"},title:"Website content"},null,8,au))])]))}}),ru=Ie(iu,[["__scopeId","data-v-0f5111f5"]]),cu={class:"flex-1 text-center pl-8"},du={class:"flex-1 min-h-0 overflow-y-auto custom-scrollbar flex flex-col"},uu={class:"px-6 py-8 md:px-8 md:py-10 max-w-lg mx-auto my-auto"},hu={class:"space-y-4"},xu=["href"],pu={class:"flex items-center gap-1"},gu=O({__name:"MagazineSectionDetail",props:{section:{},currentIndex:{},totalSections:{}},emits:["back","navigate"],setup(a){const d=a,{isDark:l}=Z(),w=B(()=>d.section.content.replace(/\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/https?:\/\/\S+/g,"").replace(/\uFE0F/g,"").replace(/\*\*/g,"").replace(/\*([^*\n]+)\*/g,"$1").replace(new RegExp("(?:^|(?<=\\s))[\\p{Emoji_Presentation}\\p{Extended_Pictographic}]+\\s*","gu"),"").replace(/---+/g,"").replace(/^#+\s*/gm,"").replace(/\|/g,", ").replace(/,\s*,+/g,",").split(/\n{2,}|\n\s*[-•]\s+/).map(v=>v.replace(/^\s*[-•]\s+/,"").replace(/(^|\n)\s*,\s*/g,"$1").trim()).filter(v=>v.length>0));return(g,v)=>(s(),n("div",{class:i(["magazine-section-detail h-full flex flex-col overflow-hidden",t(l)?"bg-[#0a0a0a]":"bg-[#faf9f6]"]),style:{"font-family":"Georgia, 'Times New Roman', Times, serif"}},[e("div",{class:"shrink-0 flex items-center justify-between px-4 py-3",style:G(t(l)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("button",{class:"absolute top-3 left-3 min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg path-glass-icon z-10 transition-colors hover:bg-white/10",onClick:v[0]||(v[0]=x=>g.$emit("back"))},[(s(),n("svg",{class:i(["w-4 h-4",t(l)?"text-white/70":"text-gray-600"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...v[3]||(v[3]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])],2))]),e("div",cu,[e("span",{class:i(["text-xs uppercase tracking-[0.3em] font-semibold",t(l)?"text-white/30":"text-black/30"])}," AI Brief ",2)]),e("span",{class:i(["text-xs font-mono tabular-nums shrink-0",t(l)?"text-white/25":"text-black/25"])},u(a.currentIndex+1)+"/"+u(a.totalSections),3)],4),e("div",du,[e("div",uu,[a.section.group?(s(),n("p",{key:0,class:i(["text-xs uppercase tracking-[0.3em] font-semibold mb-4",t(l)?"text-white/25":"text-black/30"])},u(a.section.group),3)):m("",!0),e("h2",{class:i(["text-2xl md:text-3xl font-bold leading-tight mb-4",t(l)?"text-white/95":"text-black/90"])},u(a.section.title),3),a.section.author?(s(),n("p",{key:1,class:i(["text-xs mb-6",t(l)?"text-white/40":"text-black/40"])}," By "+u(a.section.author),3)):m("",!0),e("div",{class:i(["w-12 h-px mb-6",t(l)?"bg-white/15":"bg-black/15"])},null,2),e("div",hu,[(s(!0),n(D,null,L(w.value,(x,f)=>(s(),n("p",{key:f,class:i(["text-base md:text-lg leading-relaxed",t(l)?"text-white/75":"text-black/65"])},u(x),3))),128))]),a.section.url?(s(),n("a",{key:2,href:a.section.url,target:"_blank",rel:"noopener noreferrer",class:i(["inline-flex items-center gap-2 mt-6 min-h-[44px] text-xs transition-colors",t(l)?"text-white/40 hover:text-white/70":"text-black/40 hover:text-black/70"])},[...v[4]||(v[4]=[e("svg",{class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1),se(" Source ",-1)])],10,xu)):m("",!0)])]),e("div",{class:"shrink-0 flex items-center justify-between px-4 py-3",style:G(t(l)?"border-top: 1px solid rgba(255, 255, 255, 0.08)":"border-top: 1px solid rgba(0, 0, 0, 0.06)")},[e("button",{class:i(["flex items-center gap-1.5 px-3 min-h-[44px] rounded-lg text-xs transition-colors",t(l)?"text-white/50 hover:text-white/80 hover:bg-white/5":"text-black/40 hover:text-black/70 hover:bg-black/5"]),onClick:v[1]||(v[1]=x=>g.$emit("navigate","prev"))},[...v[5]||(v[5]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1),se(" Prev ",-1)])],2),e("div",pu,[(s(!0),n(D,null,L(a.totalSections,x=>(s(),n("div",{key:x,class:i(["w-1.5 h-1.5 rounded-full transition-all duration-200",x-1===a.currentIndex?t(l)?"bg-white/70 scale-125":"bg-black/60 scale-125":t(l)?"bg-white/15":"bg-black/15"])},null,2))),128))]),e("button",{class:i(["flex items-center gap-1.5 px-3 min-h-[44px] rounded-lg text-xs transition-colors",t(l)?"text-white/50 hover:text-white/80 hover:bg-white/5":"text-black/40 hover:text-black/70 hover:bg-black/5"]),onClick:v[2]||(v[2]=x=>g.$emit("navigate","next"))},[...v[6]||(v[6]=[se(" Next ",-1),e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1)])],2)],4)],2))}}),bu={class:"flex-1 min-w-0 pl-8"},vu={class:"flex items-center gap-2"},fu={class:"flex-1 min-h-0 overflow-auto custom-scrollbar"},mu={key:0,class:"font-mono text-xs leading-relaxed"},wu={class:"w-full border-collapse"},yu={key:1,class:"flex items-center justify-center h-full"},ku={class:"text-center space-y-3 px-6"},$u=O({__name:"CodeDetail",emits:["back"],setup(a){const{isDark:d}=Z(),{activeFile:l,activeFileContent:w,activeFileLanguage:g,activeProject:v}=xe(),x=B(()=>w.value),f=B(()=>g.value),$=B(()=>l.value??""),_=B(()=>$.value.split("/").pop()??""),b=B(()=>v.value?.name??""),c=B(()=>x.value?x.value.split(` +`):[]);return(o,r)=>(s(),n("div",{class:i(["code-detail h-full flex flex-col overflow-hidden",t(d)?"bg-[#1a1a2e]":"bg-[#fafafa]"])},[e("div",{class:"shrink-0 flex items-center gap-2 px-3 py-2",style:G(t(d)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("button",{class:"absolute top-3 left-3 p-2 rounded-lg path-glass-icon z-10 transition-colors hover:bg-white/10",onClick:r[0]||(r[0]=h=>o.$emit("back"))},[(s(),n("svg",{class:i(["w-4 h-4",t(d)?"text-white/70":"text-gray-600"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...r[1]||(r[1]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])],2))]),e("div",bu,[e("div",vu,[e("span",{class:i(["shrink-0 text-xs px-1.5 py-0.5 rounded font-mono",t(d)?"bg-white/10 text-white/50":"bg-black/5 text-gray-500"])},u(f.value),3),e("p",{class:i(["text-xs font-mono truncate",t(d)?"text-white/70":"text-gray-700"])},u(_.value),3)]),b.value?(s(),n("p",{key:0,class:i(["text-xs font-mono mt-0.5 truncate",t(d)?"text-white/25":"text-gray-400"])},u(b.value)+" / "+u($.value),3)):m("",!0)])],4),e("div",fu,[x.value?(s(),n("div",mu,[e("table",wu,[e("tbody",null,[(s(!0),n(D,null,L(c.value,(h,M)=>(s(),n("tr",{key:M,class:"hover:bg-white/[0.03]"},[e("td",{class:i(["select-none text-right pr-4 pl-4 py-0 align-top w-1",t(d)?"text-white/15":"text-gray-300"]),style:{"min-width":"3rem"}},u(M+1),3),e("td",{class:i(["pr-4 py-0 whitespace-pre",t(d)?"text-white/75":"text-gray-700"])},u(h),3)]))),128))])])])):(s(),n("div",yu,[e("div",ku,[e("div",{class:i(["w-16 h-16 rounded-2xl flex items-center justify-center mx-auto",t(d)?"bg-white/5":"bg-black/5"])},[(s(),n("svg",{class:i(["w-7 h-7",t(d)?"text-white/20":"text-gray-300"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...r[2]||(r[2]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"},null,-1)])],2))],2),e("p",{class:i(["text-xs",t(d)?"text-white/30":"text-gray-400"])}," Select a file to view its contents. ",2)])]))])],2))}}),_u=Ie($u,[["__scopeId","data-v-7f40c0bc"]]),Cu={class:"h-full overflow-y-auto overflow-x-hidden scrollbar-hide"},ju={class:"min-w-0 flex-1"},Su={class:"p-4 space-y-4"},Mu={key:0,class:"space-y-2"},Tu={key:1,class:"space-y-2"},Iu={key:2,class:"flex items-end gap-2"},Du={key:0,class:"text-[7px] text-accent font-mono"},Bu={key:3,class:"space-y-2"},Lu={key:0,class:"flex gap-3"},Pu={key:1,class:"flex gap-3"},Nu={key:2,class:"flex gap-3"},Au={key:3,class:"flex flex-wrap gap-1.5"},zu={key:4},Eu={class:"glass-card p-4"},Fu={key:5,class:"flex gap-1.5"},Ru={key:6},Vu={key:7,class:"space-y-2"},Uu={key:8},qu={key:9,class:"space-y-1.5"},Gu={class:"flex items-center gap-2.5"},Ou={key:10},Hu={key:11,class:"flex gap-2"},Wu={class:"absolute bottom-0 left-0 right-0 p-1.5"},Ku={class:"text-xs text-white/80 font-medium truncate"},Yu={key:12,class:"space-y-2"},Qu={class:"flex justify-end"},Ju={class:"flex justify-start"},Zu={key:13,class:"space-y-2"},Xu={class:"grid grid-cols-3 gap-1"},e0={key:14,class:"space-y-2"},t0={class:"space-y-1 px-1"},s0={key:15},n0={key:16},l0={class:"flex items-start gap-2.5"},o0={class:"min-w-0 flex-1"},a0={class:"flex items-center gap-1.5"},i0={class:"flex gap-3 mt-1.5"},r0={key:17,class:"flex flex-col items-center gap-2"},c0={key:18,class:"flex flex-col items-center gap-2"},d0={key:19,class:"text-center py-4"},u0={key:0},h0=O({__name:"DesignSystemDetail",props:{item:{}},emits:["back"],setup(a){const d=a,{isDark:l}=Z(),w=j(!1),g=j(0),v=j(0),x={colors:"Colors",typography:"Typography",spacing:"Spacing",atoms:"Atoms",molecules:"Molecules",organisms:"Organisms"},f=B(()=>x[d.item.category]??d.item.category),$=B(()=>d.item.id==="type-mono"?{fontFamily:'Menlo, Monaco, "Courier New", monospace'}:d.item.id==="type-serif"?{fontFamily:'Georgia, "Times New Roman", Times, serif'}:{fontFamily:"Inter, system-ui, -apple-system, sans-serif"});function _(c){const o=/(?:background-color|color|background):\s*([^;]+)/i.exec(c);return o?o[1].trim():"#333"}async function b(){try{await navigator.clipboard.writeText(d.item.code),w.value=!0,setTimeout(()=>{w.value=!1},2e3)}catch{}}return(c,o)=>(s(),n("div",Cu,[e("div",{class:"shrink-0 px-4 py-3 flex items-center gap-3",style:G(t(l)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("button",{class:i(["min-w-[44px] min-h-[44px] rounded-lg path-glass-icon flex items-center justify-center transition-colors shrink-0",t(l)?"hover:bg-white/10":"hover:bg-black/5"]),onClick:o[0]||(o[0]=r=>c.$emit("back"))},[(s(),n("svg",{class:i(["w-3.5 h-3.5",t(l)?"text-white/70":"text-gray-500"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...o[3]||(o[3]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])],2))],2),e("div",ju,[e("h2",{class:i(["text-sm font-semibold truncate",t(l)?"text-white/90":"text-gray-900"])},u(a.item.name),3),e("p",{class:i(["text-xs",t(l)?"text-white/40":"text-gray-400"])},u(f.value),3)]),e("button",{class:i(["text-xs px-2 py-1 rounded-md transition-colors",w.value?"bg-emerald-500/20 text-emerald-400":t(l)?"bg-white/5 text-white/50 hover:bg-white/10":"bg-black/5 text-gray-500 hover:bg-black/10"]),onClick:b},u(w.value?"Copied":"Copy"),3)],4),e("div",Su,[e("p",{class:i(["text-sm leading-relaxed",t(l)?"text-white/60":"text-gray-600"])},u(a.item.description),3),e("div",null,[e("h4",{class:i(["text-xs uppercase tracking-[0.2em] font-semibold mb-2",t(l)?"text-white/30":"text-gray-400"])}," Preview ",2),e("div",{class:i(["rounded-xl p-4 overflow-hidden",t(l)?"bg-white/[0.03] border border-white/10":"bg-black/[0.02] border border-black/10"])},[a.item.category==="colors"?(s(),n("div",Mu,[e("div",{class:i(["h-12 rounded-lg border",t(l)?"border-white/10":"border-black/10"]),style:G({background:_(a.item.code)})},null,6),e("p",{class:i(["text-xs font-mono text-center",t(l)?"text-white/40":"text-gray-400"])},u(_(a.item.code)),3)])):a.item.category==="typography"?(s(),n("div",Tu,[e("p",{class:i(["text-2xl font-bold",t(l)?"text-white/90":"text-gray-900"]),style:G($.value)}," Aa Bb Cc 123 ",6),e("p",{class:i(["text-sm",t(l)?"text-white/60":"text-gray-600"]),style:G($.value)}," The quick brown fox jumps over the lazy dog. ",6)])):a.item.category==="spacing"?(s(),n("div",Iu,[(s(),n(D,null,L([4,8,12,16,20,24,32],(r,h)=>e("div",{key:h,class:"bg-accent/30 rounded-sm flex items-center justify-center",style:G({width:`${r}px`,height:`${r}px`})},[r>=16?(s(),n("span",Du,u(r),1)):m("",!0)],4)),64))])):(s(),n("div",Bu,[a.item.id==="atom-glass-btn"?(s(),n("div",Lu,[...o[4]||(o[4]=[e("button",{class:"glass-button text-sm"},"Action",-1),e("button",{class:"glass-button text-sm opacity-50 cursor-not-allowed"},"Disabled",-1)])])):a.item.id==="atom-glass-btn-sm"?(s(),n("div",Pu,[...o[5]||(o[5]=[e("button",{class:"glass-button glass-button-sm text-xs"},"Small",-1),e("button",{class:"glass-button glass-button-sm text-xs opacity-50 cursor-not-allowed"},"Disabled",-1)])])):a.item.id==="atom-icon-btn"?(s(),n("div",Nu,[e("button",{class:i(["w-9 h-9 rounded-xl path-glass-icon flex items-center justify-center",t(l)?"text-white/70":"text-gray-500"])},[...o[6]||(o[6]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1)])],2),e("button",{class:i(["w-9 h-9 rounded-xl path-glass-icon flex items-center justify-center",t(l)?"text-white/70":"text-gray-500"])},[...o[7]||(o[7]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)])],2),e("button",{class:i(["w-9 h-9 rounded-xl path-glass-icon flex items-center justify-center",t(l)?"text-white/70":"text-gray-500"])},[...o[8]||(o[8]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])],2)])):a.item.id==="atom-badge"?(s(),n("div",Au,[e("span",{class:i(["text-xs px-2 py-1 rounded-md font-medium",t(l)?"bg-white/10 text-white/60":"bg-black/5 text-gray-600"])},"Science Fiction",2),e("span",{class:i(["text-xs px-2 py-1 rounded-md font-medium",t(l)?"bg-white/10 text-white/60":"bg-black/5 text-gray-600"])},"Drama",2),e("span",{class:i(["text-xs px-2 py-1 rounded-md font-medium",t(l)?"bg-white/10 text-white/60":"bg-black/5 text-gray-600"])},"Thriller",2)])):a.item.id==="mol-glass-card"?(s(),n("div",zu,[e("div",Eu,[e("h3",{class:i(["text-sm font-semibold mb-1",t(l)?"text-white/90":"text-gray-900"])},"Glass Card",2),e("p",{class:i(["text-xs",t(l)?"text-white/60":"text-gray-500"])},"Content with frosted glass background and subtle border.",2)])])):a.item.id==="atom-nav-tab"?(s(),n("div",Fu,[o[9]||(o[9]=e("button",{class:"text-xs px-2.5 py-1 rounded-md font-medium bg-accent/20 text-accent"},"Films",-1)),e("button",{class:i(["text-xs px-2.5 py-1 rounded-md font-medium",t(l)?"bg-white/5 text-white/50":"bg-black/5 text-gray-500"])},"Songs",2),e("button",{class:i(["text-xs px-2.5 py-1 rounded-md font-medium",t(l)?"bg-white/5 text-white/50":"bg-black/5 text-gray-500"])},"Podcasts",2)])):a.item.id==="atom-input"?(s(),n("div",Ru,[e("input",{class:i(["w-full px-3 py-2 rounded-lg text-base outline-none transition-colors",t(l)?"bg-white/5 text-white/80 placeholder:text-white/25 focus:bg-white/10":"bg-black/5 text-gray-800 placeholder:text-gray-400 focus:bg-black/10"]),placeholder:"Search...",readonly:""},null,2)])):a.item.id==="atom-scrollbar"?(s(),n("div",Vu,[e("div",{class:i(["h-16 overflow-y-auto rounded-lg px-3 py-2",t(l)?"bg-white/5":"bg-black/5"]),style:{"scrollbar-width":"thin"}},[(s(),n(D,null,L(8,r=>e("p",{key:r,class:i(["text-xs py-0.5",t(l)?"text-white/40":"text-gray-400"])}," Scrollable content line "+u(r),3)),64))],2),e("p",{class:i(["text-xs text-center",t(l)?"text-white/30":"text-gray-400"])}," 4px wide, translucent thumb ",2)])):a.item.id==="mol-gradient-card"?(s(),n("div",Uu,[...o[10]||(o[10]=[e("div",{class:"gradient-card p-4 rounded-2xl"},[e("h3",{class:"text-sm font-semibold mb-1 text-white"},"Featured"),e("p",{class:"text-xs text-white/70"},"Gradient background card for highlights.")],-1)])])):a.item.id==="mol-source-link"?(s(),n("div",qu,[e("div",{class:i(["flex items-center justify-between p-3 rounded-xl transition-colors",t(l)?"bg-white/5":"bg-black/5"])},[e("div",Gu,[o[11]||(o[11]=e("span",{class:"text-sm"},"🎬",-1)),e("div",null,[e("p",{class:i(["text-xs font-medium",t(l)?"text-white/80":"text-gray-800"])},"Netflix",2),e("p",{class:i(["text-xs",t(l)?"text-white/30":"text-gray-400"])},"Stream now",2)])]),(s(),n("svg",{class:i(["w-3.5 h-3.5",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...o[12]||(o[12]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"},null,-1)])],2))],2)])):a.item.id==="mol-banner-hero"?(s(),n("div",Ou,[...o[13]||(o[13]=[es('

Banner Title

Subtitle text

',1)])])):a.item.id==="mol-cover-card"?(s(),n("div",Hu,[(s(),n(D,null,L(3,r=>e("div",{key:r,class:"flex-1 rounded-xl overflow-hidden"},[e("div",{class:"aspect-[2/3] relative",style:G({background:`linear-gradient(${120*r}deg, ${["#2d1b69","#1b3a4b","#3b1b2b"][r-1]}, ${["#1a0a3e","#0a2030","#200a1a"][r-1]})`})},[o[14]||(o[14]=e("div",{class:"absolute inset-0 bg-gradient-to-t from-black/60 to-transparent"},null,-1)),e("div",Wu,[e("p",Ku,u(["Film","Album","Series"][r-1]),1)])],4)])),64))])):a.item.id==="org-chat-bubble"?(s(),n("div",Yu,[e("div",Qu,[e("div",{class:i(["max-w-[80%] px-3 py-2 rounded-2xl text-xs",t(l)?"bg-white/10 text-white/90":"bg-black/10 text-gray-800"])}," What films should I watch? ",2)]),e("div",Ju,[e("div",{class:i(["max-w-[80%] px-3 py-2 text-xs",t(l)?"text-white/70":"text-gray-600"])}," Here are some great picks from your library... ",2)])])):a.item.id==="org-content-panel"?(s(),n("div",Zu,[e("div",{class:"flex gap-1 pb-1.5",style:G(t(l)?"border-bottom: 1px solid rgba(255,255,255,0.08)":"border-bottom: 1px solid rgba(0,0,0,0.06)")},[o[15]||(o[15]=e("span",{class:"text-xs px-2 py-0.5 rounded font-medium bg-accent/20 text-accent"},"Films",-1)),e("span",{class:i(["text-xs px-2 py-0.5 rounded font-medium",t(l)?"text-white/40":"text-gray-400"])},"Songs",2),e("span",{class:i(["text-xs px-2 py-0.5 rounded font-medium",t(l)?"text-white/40":"text-gray-400"])},"Books",2)],4),e("div",Xu,[(s(),n(D,null,L(6,r=>e("div",{key:r,class:i(["aspect-[2/3] rounded-md",t(l)?"bg-white/5":"bg-black/5"])},null,2)),64))])])):a.item.id==="org-detail-view"?(s(),n("div",e0,[e("div",{class:i(["relative aspect-[16/7] rounded-lg overflow-hidden",t(l)?"bg-white/5":"bg-black/5"])},[o[17]||(o[17]=e("div",{class:"absolute inset-0 bg-gradient-to-t from-black/60 to-transparent"},null,-1)),e("div",{class:i(["absolute top-1.5 left-1.5 w-4 h-4 rounded-md flex items-center justify-center",t(l)?"bg-white/10":"bg-black/10"])},[(s(),n("svg",{class:i(["w-2.5 h-2.5",t(l)?"text-white/60":"text-gray-500"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...o[16]||(o[16]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])],2))],2),o[18]||(o[18]=e("div",{class:"absolute bottom-1 left-2"},[e("p",{class:"text-xs font-bold text-white/90"},"Title"),e("p",{class:"text-xs text-white/50"},"Meta")],-1))],2),e("div",t0,[e("div",{class:i(["h-1.5 rounded-full w-full",t(l)?"bg-white/5":"bg-black/5"])},null,2),e("div",{class:i(["h-1.5 rounded-full w-3/4",t(l)?"bg-white/5":"bg-black/5"])},null,2)])])):a.item.id==="org-magazine"?(s(),n("div",s0,[e("div",{class:i(["grid grid-cols-2 gap-px rounded-lg overflow-hidden",t(l)?"bg-white/[0.12]":"bg-black/[0.08]"])},[e("div",{class:i(["col-span-2 px-3 py-3",t(l)?"bg-[#0a0a0a]":"bg-white"])},[e("p",{class:i(["text-[7px] uppercase tracking-[0.3em] mb-0.5",t(l)?"text-white/30":"text-gray-400"])},"Editorial",2),e("p",{class:i(["text-xs font-serif font-bold",t(l)?"text-white/90":"text-gray-900"])},"Hero Headline",2)],2),e("div",{class:i(["px-2 py-2",t(l)?"bg-[#0a0a0a]":"bg-white"])},[e("p",{class:i(["text-xs font-serif font-bold",t(l)?"text-white/80":"text-gray-800"])},"Half Tile",2)],2),e("div",{class:i(["px-2 py-2",t(l)?"bg-[#0a0a0a]":"bg-white"])},[e("p",{class:i(["text-xs font-serif font-bold",t(l)?"text-white/80":"text-gray-800"])},"Half Tile",2)],2)],2)])):a.item.id==="org-nostr-note"?(s(),n("div",n0,[e("div",{class:i(["p-3 rounded-xl",t(l)?"bg-white/[0.03] border border-white/5":"bg-black/[0.02] border border-black/5"])},[e("div",l0,[o[20]||(o[20]=e("div",{class:"w-7 h-7 rounded-full flex items-center justify-center text-xs font-bold shrink-0",style:{background:"rgba(168, 85, 247, 0.2)",color:"rgba(168, 85, 247, 0.8)"}}," F ",-1)),e("div",o0,[e("div",a0,[e("span",{class:i(["text-xs font-semibold",t(l)?"text-white/80":"text-gray-800"])},"fiatjaf",2),e("span",{class:i(["text-xs",t(l)?"text-white/25":"text-gray-300"])},"2h",2)]),e("p",{class:i(["text-xs mt-0.5 leading-relaxed",t(l)?"text-white/50":"text-gray-500"])}," Nostr is the simplest open protocol... ",2),e("div",i0,[e("span",{class:i(["text-xs",t(l)?"text-white/25":"text-gray-300"])},"3 replies",2),o[19]||(o[19]=e("span",{class:"text-xs text-amber-500/70"},"21000 sats",-1))])])])],2)])):a.item.id==="anim-fade-up"?(s(),n("div",r0,[(s(),n("div",{key:g.value,class:i(["animate-fade-up px-4 py-2 rounded-lg text-xs font-medium",t(l)?"bg-white/10 text-white/70":"bg-black/10 text-gray-600"])}," Fade Up (900ms) ",2)),e("button",{class:i(["text-xs px-2 py-0.5 rounded transition-colors",t(l)?"text-white/40 hover:text-white/60":"text-gray-400 hover:text-gray-600"]),onClick:o[1]||(o[1]=r=>g.value++)}," Replay ",2)])):a.item.id==="anim-scale-in"?(s(),n("div",c0,[(s(),n("div",{key:v.value,class:i(["animate-scale-in px-4 py-2 rounded-lg text-xs font-medium",t(l)?"bg-white/10 text-white/70":"bg-black/10 text-gray-600"])}," Scale In (250ms) ",2)),e("button",{class:i(["text-xs px-2 py-0.5 rounded transition-colors",t(l)?"text-white/40 hover:text-white/60":"text-gray-400 hover:text-gray-600"]),onClick:o[2]||(o[2]=r=>v.value++)}," Replay ",2)])):(s(),n("div",d0,[e("p",{class:i(["text-xs",t(l)?"text-white/30":"text-gray-400"])}," See code below for usage pattern ",2)]))]))],2)]),a.item.usedIn?(s(),n("div",u0,[e("h4",{class:i(["text-xs uppercase tracking-[0.2em] font-semibold mb-2",t(l)?"text-white/30":"text-gray-400"])}," Used In ",2),e("div",{class:i(["rounded-xl px-3 py-2.5",t(l)?"bg-white/[0.03] border border-white/10":"bg-black/[0.02] border border-black/10"])},[e("p",{class:i(["text-xs leading-relaxed",t(l)?"text-white/50":"text-gray-500"])},u(a.item.usedIn),3)],2)])):m("",!0),e("div",null,[e("h4",{class:i(["text-xs uppercase tracking-[0.2em] font-semibold mb-2",t(l)?"text-white/30":"text-gray-400"])}," Code ",2),e("pre",{class:i(["rounded-xl p-4 text-xs leading-relaxed font-mono overflow-x-auto",t(l)?"bg-black/40 text-white/70 border border-white/10":"bg-gray-50 text-gray-700 border border-gray-200"])},u(a.item.code),3)])])]))}}),Ge=O({__name:"DetailView",setup(a){const{isCodeMode:d,activeFile:l}=xe();function w(){const{activeFile:U,activeFileContent:W}=xe();U.value=null,W.value=""}const{selectedFilm:g,selectedBook:v,selectedTVSeries:x,selectedImage:f,selectedPlace:$,selectedSong:_,selectedPodcast:b,selectedArticle:c,closeFilmDetail:o,closeBookDetail:r,closeTVSeriesDetail:h,closeImageDetail:M,closePlaceDetail:S,closeSongDetail:N,closePodcastDetail:I,closeArticleDetail:C,selectedWebsite:k,closeWebsiteDetail:p,selectedMagazineSection:y,magazineSectionIndex:A,panelMagazineSections:V,closeMagazineSectionDetail:E,navigateMagazineSection:Y,selectedDesignSystemItem:H,closeDesignSystemItem:F}=$e();return(U,W)=>t(g)?(s(),q(hs,{key:0,film:t(g),onBack:t(o)},null,8,["film","onBack"])):t(_)?(s(),q(xs,{key:1,song:t(_),onBack:t(N)},null,8,["song","onBack"])):t(b)?(s(),q(dd,{key:2,podcast:t(b),onBack:t(I)},null,8,["podcast","onBack"])):t(v)?(s(),q(wc,{key:3,book:t(v),onBack:t(r)},null,8,["book","onBack"])):t(x)?(s(),q(Gc,{key:4,series:t(x),onBack:t(h)},null,8,["series","onBack"])):t(f)?(s(),q(vd,{key:5,image:t(f),onBack:t(M)},null,8,["image","onBack"])):t($)?(s(),q(qd,{key:6,place:t($),onBack:t(S)},null,8,["place","onBack"])):t(c)?(s(),q(tu,{key:7,article:t(c),onBack:t(C)},null,8,["article","onBack"])):t(k)?(s(),q(ru,{key:8,website:t(k),onBack:t(p)},null,8,["website","onBack"])):t(y)?(s(),q(gu,{key:9,section:t(y),"current-index":t(A),"total-sections":t(V).length,onBack:t(E),onNavigate:t(Y)},null,8,["section","current-index","total-sections","onBack","onNavigate"])):t(d)&&t(l)?(s(),q(_u,{key:10,onBack:w})):t(H)?(s(),q(h0,{key:11,item:t(H),onBack:t(F)},null,8,["item","onBack"])):m("",!0)}}),Oe=O({__name:"CloseButton",emits:["click"],setup(a){const{isDark:d}=Z();return(l,w)=>(s(),n("button",{class:i(["absolute top-3 right-3 z-10 p-2 rounded-lg path-glass-icon transition-colors",t(d)?"text-white/70 hover:bg-white/10":"text-gray-500 hover:bg-black/5 hover:text-gray-800"]),title:"Close","aria-label":"Close",onClick:w[0]||(w[0]=g=>l.$emit("click"))},[...w[1]||(w[1]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])],2))}}),x0={class:"flex-1 overflow-y-auto p-4"},p0={key:0,class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4"},g0={key:1,class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3"},b0={key:2,class:"space-y-3"},v0={class:"flex-1 space-y-2 py-1"},f0={key:3,class:"space-y-0"},m0=O({__name:"LoadingContentGrid",props:{variant:{default:"poster"},count:{default:8}},setup(a){const{isDark:d}=Z();return(l,w)=>(s(),n("div",x0,[a.variant==="poster"?(s(),n("div",p0,[(s(!0),n(D,null,L(a.count,g=>(s(),n("div",{key:g,class:i(["aspect-[2/3] rounded-xl animate-pulse",t(d)?"bg-white/10":"bg-black/6"])},null,2))),128))])):a.variant==="square"?(s(),n("div",g0,[(s(!0),n(D,null,L(a.count,g=>(s(),n("div",{key:g,class:"space-y-2"},[e("div",{class:i(["aspect-square rounded-xl animate-pulse",t(d)?"bg-white/10":"bg-black/6"])},null,2),e("div",{class:i(["h-3 rounded animate-pulse w-3/4",t(d)?"bg-white/8":"bg-black/5"])},null,2),e("div",{class:i(["h-2.5 rounded animate-pulse w-1/2",t(d)?"bg-white/5":"bg-black/3"])},null,2)]))),128))])):a.variant==="list"?(s(),n("div",b0,[(s(!0),n(D,null,L(a.count,g=>(s(),n("div",{key:g,class:i(["flex gap-3 p-3 rounded-xl animate-pulse",t(d)?"bg-white/[0.04]":"bg-black/[0.03]"])},[e("div",{class:i(["w-20 h-14 rounded-lg shrink-0",t(d)?"bg-white/10":"bg-black/6"])},null,2),e("div",v0,[e("div",{class:i(["h-3 rounded w-4/5",t(d)?"bg-white/10":"bg-black/6"])},null,2),e("div",{class:i(["h-2.5 rounded w-3/5",t(d)?"bg-white/6":"bg-black/4"])},null,2)])],2))),128))])):a.variant==="magazine"?(s(),n("div",f0,[e("div",{class:i(["h-44 animate-pulse mb-px",t(d)?"bg-white/[0.04]":"bg-black/[0.03]"])},null,2),e("div",{class:i(["grid grid-cols-2 gap-px",t(d)?"bg-white/12":"bg-black/10"])},[(s(!0),n(D,null,L(a.count,g=>(s(),n("div",{key:g,class:i(["p-4 animate-pulse",[t(d)?"bg-[#0a0a0a]":"bg-[#faf9f6]",g<=1?"col-span-2":""]])},[e("div",{class:i(["h-2.5 rounded w-1/3 mb-2",t(d)?"bg-white/8":"bg-black/5"])},null,2),e("div",{class:i(["h-4 rounded w-4/5 mb-2",t(d)?"bg-white/10":"bg-black/6"])},null,2),e("div",{class:i(["h-2.5 rounded w-full",t(d)?"bg-white/6":"bg-black/4"])},null,2)],2))),128))],2)])):m("",!0)]))}}),w0={class:"relative flex-1 flex flex-col min-h-0 overflow-hidden"},y0={key:0,class:"flex-1 flex flex-col min-h-0"},k0={class:"flex items-center gap-2 shrink-0"},$0={key:1,class:"relative flex-1 flex items-center justify-center min-h-0"},_0={class:"relative flex flex-col items-center gap-8"},C0={class:"flex items-center gap-2"},j0={class:"absolute inset-0 pointer-events-none overflow-hidden"},S0=O({__name:"ContextLoader",props:{contextType:{default:"film"}},setup(a){const d=a,{isDark:l}=Z(),w=B(()=>d.contextType==="film"?"Film recommendations":d.contextType==="song"?"Song recommendations":d.contextType==="podcast"?"Podcast recommendations":d.contextType==="book"?"Book recommendations":d.contextType==="tvshow"?"TV Series recommendations":d.contextType==="image"?"Images":d.contextType==="news"?"Articles":d.contextType==="websites"?"Websites":d.contextType==="magazine"?"Brief":"Content"),g=B(()=>["song","podcast","image"].includes(d.contextType)?"square":["news","websites"].includes(d.contextType)?"list":d.contextType==="magazine"?"magazine":"poster"),v=B(()=>d.contextType==="magazine"||["news","websites"].includes(d.contextType)?6:12);return(x,f)=>(s(),n("div",w0,[["film","song","podcast","book","tvshow","image","news","websites","magazine"].includes(a.contextType)?(s(),n("div",y0,[e("div",{class:"p-4 shrink-0 flex items-center justify-between gap-2",style:G(t(l)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("p",{class:i(["text-sm font-medium",t(l)?"text-white/70":"text-gray-600"])},u(w.value),3),e("div",k0,[e("p",{class:i(["text-xs font-mono uppercase tracking-[0.2em]",t(l)?"text-white/25":"text-gray-400"])}," Surfacing… ",2),ie(x.$slots,"header-actions",{},void 0,!0)])],4),te(m0,{variant:g.value,count:v.value},null,8,["variant","count"])])):(s(),n("div",$0,[e("div",{class:i(["absolute inset-0 opacity-[0.04] pointer-events-none",t(l)?"bg-white":"bg-black"]),style:{"background-image":`url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")`}},null,2),e("div",_0,[e("div",C0,[(s(),n(D,null,L(5,($,_)=>e("div",{key:_,class:i(["w-12 h-16 rounded-lg overflow-hidden relative animate-cell-pulse",t(l)?"bg-white/8 border border-white/15 shadow-xl shadow-accent/5":"bg-black/6 border border-black/8 shadow-xl shadow-accent/10"]),style:G({animationDelay:`${_*100}ms`})},[e("div",j0,[e("div",{class:i(["absolute inset-0 w-1/2 animate-shimmer-sweep",t(l)?"bg-gradient-to-r from-transparent via-accent/25 to-transparent":"bg-gradient-to-r from-transparent via-accent/35 to-transparent"])},null,2)])],6)),64))]),e("p",{class:i(["text-sm font-medium",t(l)?"text-white/70":"text-gray-600"])},u(w.value),3),e("div",{class:i(["w-40 h-px rounded-full overflow-hidden",t(l)?"bg-white/8":"bg-black/8"])},[...f[0]||(f[0]=[e("div",{class:"h-full bg-accent/90 rounded-full animate-progress-sweep"},null,-1)])],2)])]))]))}}),it=Ie(S0,[["__scopeId","data-v-f8eb31f3"]]),M0={key:0,class:"absolute inset-0 pointer-events-none bg-black/20"},T0={key:0,class:"flex-1 min-w-0 flex flex-col relative"},I0={class:"flex flex-wrap gap-1.5 flex-1 min-w-0 justify-center"},D0=["onClick"],B0={key:1,class:"flex-1 min-w-0 flex flex-col"},L0={key:3,class:"flex-1 flex items-center justify-center"},P0={class:"text-center space-y-4 animate-fade-up max-w-sm px-6"},N0={class:"empty-state-icon w-20 h-20 rounded-2xl path-glass-icon flex items-center justify-center mx-auto overflow-hidden"},A0={key:0,class:"flex-1 min-w-0 path-glass-card overflow-hidden flex flex-col order-3 detail-persistent panel-slide-in",style:{"animation-delay":"0.2s"}},z0={key:1,class:"flex-1 flex items-center justify-center"},E0={class:"text-center space-y-4 max-w-[200px] px-4"},F0={class:"empty-state-icon w-16 h-16 rounded-2xl path-glass-icon flex items-center justify-center mx-auto overflow-hidden"},R0={key:1,class:"flex-1 flex flex-col min-h-0"},V0={class:"flex-1 min-h-0 flex flex-col p-2 pb-0"},U0={class:"flex-1 min-h-0 path-glass-card flex flex-col rounded-2xl overflow-hidden"},q0={class:"flex-1 min-h-0 flex flex-col p-2 pb-0"},G0={class:"flex-1 min-h-0 path-glass-card flex flex-col rounded-2xl overflow-hidden"},O0={class:"shrink-0 flex items-center gap-2 px-3 pt-2 pb-1 overflow-x-auto scrollbar-hide"},H0=["onClick"],W0={key:2,class:"flex-1 flex items-center justify-center"},K0={class:"text-center space-y-3 px-6"},Y0={class:"empty-state-icon w-16 h-16 rounded-2xl path-glass-icon flex items-center justify-center mx-auto overflow-hidden"},Q0={class:"flex-1 min-h-0 flex flex-col p-2 pb-0"},J0={class:"flex-1 min-h-0 path-glass-card flex flex-col rounded-2xl overflow-hidden"},Z0={class:"flex-1 min-h-0 flex flex-col"},X0={key:1,class:"flex-1 flex items-center justify-center"},eh={class:"text-center space-y-3 px-6"},th={class:"empty-state-icon w-16 h-16 rounded-2xl path-glass-icon flex items-center justify-center mx-auto overflow-hidden"},sh={class:"shrink-0 pt-3 pb-3",style:{paddingBottom:"calc(12px + env(safe-area-inset-bottom, 0px))"}},nh={class:"flex items-center h-[49px] px-2 gap-1"},lh={key:0,class:"absolute top-1.5 right-[28%] w-1.5 h-1.5 rounded-full bg-accent"},oh={key:0,class:"absolute top-1.5 right-[28%] w-1.5 h-1.5 rounded-full bg-accent"},ah=O({__name:"ChatPage",setup(a){const{hasTrack:d}=ts(),l=os(),{activeFile:w,isCodeMode:g,exitCodeMode:v,clearActiveFile:x}=xe(),{isDark:f}=Z(),$=!!window.__AIUI_EMBEDDED__,_="/aiui/assets/img/bg-intro-3.jpg";cs();const{panelOpen:b,panelFilms:c,panelBooks:o,panelTVSeries:r,panelImages:h,panelPlaces:M,panelSongs:S,panelPodcasts:N,panelWebResults:I,panelWebsites:C,panelMagazineSections:k,panelMagazineHeroImage:p,panelRecipes:y,panelApps:A,panelTitle:V,panelQuery:E,panelResponseText:Y,contentType:H,activeTab:F,availableTabs:U,setActiveTab:W,selectedFilm:le,selectedBook:fe,selectedTVSeries:pe,selectedImage:X,selectedPlace:z,selectedSong:P,selectedPodcast:re,selectedArticle:mt,selectedWebsite:wt,selectedMagazineSection:Be,selectedDesignSystemItem:yt,closeFilmDetail:kt,closeBookDetail:$t,closeTVSeriesDetail:_t,closeImageDetail:Ct,closePlaceDetail:jt,closeSongDetail:St,closePodcastDetail:Mt,closeArticleDetail:Tt,closeWebsiteDetail:It,closeMagazineSectionDetail:Dt,closePanel:_e,openFilmDetail:Bt,openBookDetail:Lt,openTVSeriesDetail:Pt,openImageDetail:Nt,openPlaceDetail:At,openSongDetail:zt,openPodcastDetail:Et,openMagazineSectionDetail:Ft}=$e(),Ce=B(()=>l.panelSide),ze=j(window.innerWidth),oe=B(()=>ze.value<1024),de=B(()=>ze.value>=1440),ee=j("chat"),{isKeyboardOpen:Rt}=ss();function Ke(){ze.value=window.innerWidth}function Ye(R){R.key==="Escape"&&g.value&&!oe.value&&v()}ne(()=>{window.addEventListener("resize",Ke),window.addEventListener("keydown",Ye)}),ns(()=>{window.removeEventListener("resize",Ke),window.removeEventListener("keydown",Ye)}),ce(b,R=>{R&&oe.value&&!$&&(ee.value="content")}),ce(V,()=>{b.value&&oe.value&&ee.value==="chat"&&!$&&(ee.value="content")}),ce(F,()=>{b.value&&oe.value&&ee.value==="chat"&&!$&&(ee.value="content")});const ge=B(()=>!!(le.value||fe.value||pe.value||X.value||z.value||P.value||re.value||mt.value||wt.value||Be.value||yt.value||g.value&&w.value));ce(ge,R=>{R&&oe.value&&(ee.value="context"),!R&&oe.value&&ee.value==="context"&&(ee.value="content")});const Ee=B(()=>b.value&&U.value.length>0);function Qe(){kt(),$t(),_t(),Ct(),jt(),St(),Mt(),Tt(),It(),Dt(),x()}const Fe=B(()=>{const R=[];return c.value.forEach(T=>R.push({open:()=>Bt(T)})),o.value.forEach(T=>R.push({open:()=>Lt(T)})),r.value.forEach(T=>R.push({open:()=>Pt(T)})),S.value.forEach(T=>R.push({open:()=>zt(T)})),N.value.forEach(T=>R.push({open:()=>Et(T)})),h.value.forEach(T=>R.push({open:()=>Nt(T)})),M.value.forEach(T=>R.push({open:()=>At(T)})),k.value.forEach((T,Q)=>R.push({open:()=>Ft(T,Q)})),R}),Je=B(()=>{if(le.value){const R=c.value.indexOf(le.value);return R>=0?R:0}if(fe.value){const R=o.value.indexOf(fe.value);return R>=0?c.value.length+R:0}if(pe.value){const R=r.value.indexOf(pe.value);return R>=0?c.value.length+o.value.length+R:0}if(P.value){const R=c.value.length+o.value.length+r.value.length,T=S.value.indexOf(P.value);return T>=0?R+T:0}if(re.value){const R=c.value.length+o.value.length+r.value.length+S.value.length,T=N.value.indexOf(re.value);return T>=0?R+T:0}if(X.value){const R=c.value.length+o.value.length+r.value.length+S.value.length+N.value.length,T=h.value.indexOf(X.value);return T>=0?R+T:0}if(z.value){const R=c.value.length+o.value.length+r.value.length+S.value.length+N.value.length+h.value.length,T=M.value.indexOf(z.value);return T>=0?R+T:0}if(Be.value){const R=c.value.length+o.value.length+r.value.length+S.value.length+N.value.length+h.value.length+M.value.length,T=k.value.indexOf(Be.value);return T>=0?R+T:0}return 0});function Ze(R){const T=Fe.value;if(!T.length)return;let Q=Je.value;Q+=R==="next"?1:-1,Q<0&&(Q=T.length-1),Q>=T.length&&(Q=0),Qe(),T[Q].open()}const Vt={film:"Films",book:"Books",tvshow:"TV",image:"Images",place:"Places",recipe:"Recipes",song:"Songs",podcast:"Podcasts",news:"News",websites:"Websites",magazine:"Brief",code:"Code","design-system":"Design",app:"Apps",nostr:"Nostr",favorites:"Favorites",discover:"Discover",prompt:"Prompt"};function Xe(R){return Vt[R]??R}const et=B(()=>{if(b.value)return H.value;const T=([...l.messages].reverse().find(Q=>Q.role==="user")?.content??"").toLowerCase();return/\b(song|music|track|album|band|artist|listen)\b/.test(T)?"song":/\b(book|novel|read|author|fiction|nonfiction|memoir)\b/.test(T)?"book":/\b(tv show|tv series|series|television|binge|season)\b/.test(T)?"tvshow":/\b(image|images|photo|photos|picture|pictures|screenshot|gallery|artwork|illustration)\b/.test(T)?"image":/\b(restaurant|restaurants|place|places|food|eat|dining|cafe|bar|pub|brunch|lunch|dinner)\b/.test(T)?"film":/\b(podcast|episode|show|listen to)\b/.test(T)?"podcast":/\b(news|latest|recent|current|what'?s happening|what are people saying)\b/.test(T)?"news":/\b(bip|protocol|debate|sentiment|bearish|bull case|macro)\b/.test(T)?"magazine":/\b(website|websites|where to check|best places|check online|resources?|sources?)\b/.test(T)?"websites":H.value});return(R,T)=>(s(),n("div",{class:i(["h-full flex flex-col relative overflow-hidden transition-colors duration-300",[]]),style:G($?{background:"transparent"}:t(f)?{background:"#000 url("+_+") center center / cover no-repeat fixed"}:{backgroundColor:"#f5f4f1"})},[t(f)&&!$?(s(),n("div",M0)):m("",!0),e("div",{class:i(["flex-1 flex h-full p-3 md:p-4 gap-3 md:gap-4 transition-[padding] duration-200",[oe.value?"hidden":""]]),style:G(t(d)&&!oe.value?{paddingBottom:"76px"}:{})},[e("main",{class:i(["flex-1 min-w-0 path-glass-card overflow-hidden flex relative panel-slide-in",[de.value?Ce.value==="left"?"order-2":"order-1":Ce.value==="left"?"order-last":"order-first",!de.value&&ge.value&&!Ee.value&&"detail-active"]]),style:{"animation-delay":"0.1s"}},[t(b)&&Ee.value&&(de.value||!ge.value)?(s(),n("div",T0,[te(Oe,{onClick:t(_e)},null,8,["onClick"]),e("div",{class:"shrink-0 flex items-center gap-2 px-4 pr-12 py-3",style:G(t(f)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("div",I0,[(s(!0),n(D,null,L(t(U),Q=>(s(),n("button",{key:Q,class:i(["text-xs px-2 py-1 rounded-md transition-all duration-150",t(F)===Q?"nav-tab-active":t(f)?"text-white/40 hover:text-white/70 hover:bg-white/5":"text-gray-500 hover:text-gray-800 hover:bg-black/5"]),onClick:Ut=>t(W)(Q)},u(Xe(Q)),11,D0))),128))])],4),te(be,{title:"Content failed to load"},{default:ue(()=>[te(at,{"active-tab":t(F),"is-wide-desktop":de.value,"is-mobile":oe.value,"panel-films":t(c),"panel-books":t(o),panelTVSeries:t(r),"panel-images":t(h),"panel-places":t(M),"panel-songs":t(S),"panel-podcasts":t(N),"panel-web-results":t(I),"panel-websites":t(C),"panel-magazine-sections":t(k),"panel-magazine-hero-image":t(p),"panel-recipes":t(y),"panel-apps":t(A),"panel-title":t(V),"panel-query":t(E),"panel-response-text":t(Y),onClose:t(_e)},null,8,["active-tab","is-wide-desktop","is-mobile","panel-films","panel-books","panelTVSeries","panel-images","panel-places","panel-songs","panel-podcasts","panel-web-results","panel-websites","panel-magazine-sections","panel-magazine-hero-image","panel-recipes","panel-apps","panel-title","panel-query","panel-response-text","onClose"])]),_:1})])):!de.value&&t(b)&&ge.value?(s(),n("div",B0,[te(Oe,{onClick:T[0]||(T[0]=Q=>Ee.value?Qe():t(_e)())}),te(be,{title:"Detail view error"},{default:ue(()=>[te(Ge)]),_:1})])):t(l).isStreaming?(s(),q(it,{key:2,"context-type":et.value},{"header-actions":ue(()=>[te(Oe,{onClick:t(_e)},null,8,["onClick"])]),_:1},8,["context-type"])):(s(),n("div",L0,[e("div",P0,[e("div",N0,[e("span",{class:i(["text-3xl",t(f)?"text-[#fafafa]":"text-gray-800"])},"✦",2)]),e("div",null,[e("h2",{class:i(["text-lg font-bold mb-1",t(f)?"text-white/80":"text-gray-800"])}," Content Surface ",2),e("p",{class:i(["text-sm leading-relaxed",t(f)?"text-white/30":"text-gray-400"])}," Ask about films, songs, or podcasts in the chat to see rich content here. ",2)])])]))],2),de.value?(s(),n("div",A0,[ge.value?(s(),q(be,{key:0,title:"Detail view error"},{default:ue(()=>[te(Ge)]),_:1})):(s(),n("div",z0,[e("div",E0,[e("div",F0,[e("span",{class:i(["text-2xl",t(f)?"text-[#fafafa]":"text-gray-800"])},"✦",2)]),e("div",null,[e("h2",{class:i(["text-sm font-semibold mb-1",t(f)?"text-white/60":"text-gray-600"])}," Awaiting Context ",2),e("p",{class:i(["text-xs leading-relaxed",t(f)?"text-white/25":"text-gray-400"])}," Select an item to see details here. ",2)])])]))])):m("",!0),e("aside",{class:i(["relative z-[100] w-80 xl:w-96 shrink-0 flex flex-col path-glass-card overflow-visible panel-slide-in",de.value?Ce.value==="left"?"order-1":"order-2":Ce.value==="left"?"order-first":"order-last"]),style:{"animation-delay":"0s"}},[te(be,{title:"Chat error"},{default:ue(()=>[te(tt,{side:Ce.value,onSwitchSide:T[1]||(T[1]=Q=>t(l).switchSide())},null,8,["side"])]),_:1})],2)],6),oe.value?(s(),n("div",R0,[K(e("div",V0,[e("div",U0,[te(be,{title:"Chat error"},{default:ue(()=>[te(tt,{variant:"standalone","show-close":!1})]),_:1})])],512),[[Le,ee.value==="chat"]]),K(e("div",q0,[e("div",G0,[t(b)?(s(),n(D,{key:0},[e("div",O0,[e("button",{class:i(["p-1.5 rounded-lg transition-colors shrink-0",t(f)?"text-white/50 hover:text-white/80 hover:bg-white/5":"text-gray-400 hover:text-gray-700 hover:bg-black/5"]),onClick:T[2]||(T[2]=Q=>ee.value="chat")},[...T[8]||(T[8]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])],2),(s(!0),n(D,null,L(t(U),Q=>(s(),n("button",{key:Q,class:i(["text-xs px-2.5 py-1.5 rounded-lg font-medium whitespace-nowrap transition-all duration-150",t(F)===Q?"nav-tab-active":t(f)?"text-white/40 hover:text-white/70 hover:bg-white/5":"text-gray-500 hover:text-gray-800 hover:bg-black/5"]),onClick:Ut=>t(W)(Q)},u(Xe(Q)),11,H0))),128))]),te(be,{title:"Content failed to load"},{default:ue(()=>[te(at,{"active-tab":t(F),"is-wide-desktop":de.value,"is-mobile":oe.value,"panel-films":t(c),"panel-books":t(o),panelTVSeries:t(r),"panel-images":t(h),"panel-places":t(M),"panel-songs":t(S),"panel-podcasts":t(N),"panel-web-results":t(I),"panel-websites":t(C),"panel-magazine-sections":t(k),"panel-magazine-hero-image":t(p),"panel-recipes":t(y),"panel-apps":t(A),"panel-title":t(V),"panel-query":t(E),onClose:t(_e)},null,8,["active-tab","is-wide-desktop","is-mobile","panel-films","panel-books","panelTVSeries","panel-images","panel-places","panel-songs","panel-podcasts","panel-web-results","panel-websites","panel-magazine-sections","panel-magazine-hero-image","panel-recipes","panel-apps","panel-title","panel-query","onClose"])]),_:1})],64)):t(l).isStreaming?(s(),q(it,{key:1,"context-type":et.value},null,8,["context-type"])):(s(),n("div",W0,[e("div",K0,[e("div",Y0,[e("span",{class:i(["text-2xl",t(f)?"text-[#fafafa]":"text-gray-800"])},"✦",2)]),e("p",{class:i(["text-xs",t(f)?"text-white/30":"text-gray-400"])}," Ask about something in the chat to see content here. ",2)])]))])],512),[[Le,ee.value==="content"]]),K(e("div",Q0,[e("div",J0,[ge.value?(s(),n(D,{key:0},[e("div",Z0,[te(be,{title:"Detail view error"},{default:ue(()=>[te(Ge)]),_:1})]),!t(Be)&&Fe.value.length>1?(s(),n("div",{key:0,class:"shrink-0 flex items-center justify-between px-4 py-2",style:G(t(f)?"border-top: 1px solid rgba(255, 255, 255, 0.08)":"border-top: 1px solid rgba(0, 0, 0, 0.06)")},[e("button",{class:i(["flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs transition-colors",t(f)?"text-white/50 hover:text-white/80 hover:bg-white/5":"text-black/40 hover:text-black/70 hover:bg-black/5"]),onClick:T[3]||(T[3]=Q=>Ze("prev"))},[...T[9]||(T[9]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1),se(" Prev ",-1)])],2),e("span",{class:i(["text-xs font-mono tabular-nums",t(f)?"text-white/25":"text-black/25"])},u(Je.value+1)+"/"+u(Fe.value.length),3),e("button",{class:i(["flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs transition-colors",t(f)?"text-white/50 hover:text-white/80 hover:bg-white/5":"text-black/40 hover:text-black/70 hover:bg-black/5"]),onClick:T[4]||(T[4]=Q=>Ze("next"))},[...T[10]||(T[10]=[se(" Next ",-1),e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1)])],2)],4)):m("",!0)],64)):(s(),n("div",X0,[e("div",eh,[e("div",th,[(s(),n("svg",{class:i(["w-7 h-7",t(f)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...T[11]||(T[11]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"},null,-1),e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"},null,-1)])],2))]),e("p",{class:i(["text-xs",t(f)?"text-white/30":"text-gray-400"])}," Tap an item in Content to view details here. ",2)])]))])],512),[[Le,ee.value==="context"]]),te(ls,{variant:"inline",compact:""}),K(e("div",sh,[e("div",nh,[e("button",{class:i(["flex-1 flex flex-col items-center justify-center h-[49px] min-h-[44px] rounded-xl text-[10px] font-medium tracking-wide transition-all duration-150 gap-0.5",ee.value==="chat"?t(f)?"bg-white/10 text-white/90":"bg-black/8 text-gray-900":t(f)?"text-white/40 hover:text-white/60":"text-gray-400 hover:text-gray-600"]),onClick:T[5]||(T[5]=Q=>ee.value="chat")},[...T[12]||(T[12]=[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})],-1),e("span",null,"Chat",-1)])],2),e("button",{class:i(["flex-1 flex flex-col items-center justify-center h-[49px] min-h-[44px] rounded-xl text-[10px] font-medium tracking-wide transition-all duration-150 relative gap-0.5",ee.value==="content"?t(f)?"bg-white/10 text-white/90":"bg-black/8 text-gray-900":t(f)?"text-white/40 hover:text-white/60":"text-gray-400 hover:text-gray-600"]),onClick:T[6]||(T[6]=Q=>ee.value="content")},[T[13]||(T[13]=e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"})],-1)),T[14]||(T[14]=e("span",null,"Content",-1)),t(b)&&ee.value==="chat"?(s(),n("span",lh)):m("",!0)],2),e("button",{class:i(["flex-1 flex flex-col items-center justify-center h-[49px] min-h-[44px] rounded-xl text-[10px] font-medium tracking-wide transition-all duration-150 relative gap-0.5",ee.value==="context"?t(f)?"bg-white/10 text-white/90":"bg-black/8 text-gray-900":t(f)?"text-white/40 hover:text-white/60":"text-gray-400 hover:text-gray-600"]),onClick:T[7]||(T[7]=Q=>ee.value="context")},[T[15]||(T[15]=e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})],-1)),T[16]||(T[16]=e("span",null,"Context",-1)),ge.value&&ee.value!=="context"?(s(),n("span",oh)):m("",!0)],2)])],512),[[Le,!t(Rt)]])])):m("",!0)],4))}}),bh=Ie(ah,[["__scopeId","data-v-2cb034ff"]]);export{bh as default}; diff --git a/demo/aiui/assets/ChatWindow.vue_vue_type_script_setup_true_lang-BS0iEVVD.js b/demo/aiui/assets/ChatWindow.vue_vue_type_script_setup_true_lang-BS0iEVVD.js deleted file mode 100644 index d1764932..00000000 --- a/demo/aiui/assets/ChatWindow.vue_vue_type_script_setup_true_lang-BS0iEVVD.js +++ /dev/null @@ -1,151 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-CAd6zjbx.js","assets/index-CqBtvLD5.js","assets/index-D1RpahE8.css"])))=>i.map(i=>d[i]); -import{W as Xe,N as li,O as ci,P as _n,r as k,k as A,ah as Lu,s as pu,A as Ce,ai as di,u as S,aj as fi,ak as zu,a as ne,b as p,c as m,e as d,n as F,i as D,t as C,Q as ie,E as pe,X as Yn,G as Ve,z as H,h as Se,F as q,g as Y,H as ce,V as xn,a9 as Me,U as os,_ as hu,D as Le,o as ur,f as mu,j as He,al as pi,$ as hi,Z as mi,a1 as gi,a0 as bi,y as xi,x as vi,a5 as yi,a4 as wi,a3 as ki,a2 as Ci,am as Bu,an as _i,a7 as Ai,w as De,v as Te,B as Di,aa as gu,a8 as Ie,ao as Si,ap as Ei,aq as $i,ae as Fi}from"./index-CqBtvLD5.js";import{u as wt}from"./chat-D6vURcTH.js";import{useNostr as Mi}from"./useNostr-CZatyrb1.js";async function Ru(e){if(!e.trim())return[];try{const t=new URLSearchParams({q:e.trim()}),n=await Xe(`/api/web-search?${t}`,{signal:AbortSignal.timeout(1e4)});if(!n.ok){const o=await n.text().catch(()=>"");return console.warn("[AIUI web-search]",n.status,o),[]}const s=await n.json();if(s.error)return console.warn("[AIUI web-search]",s.error),[];const u=s.results??[];return console.log("[AIUI web-search]",e.slice(0,50),"→",u.length,"results"),u}catch(t){return console.warn("[AIUI web-search] failed:",t),[]}}const Ti="aiui-vault",Ii=1,Xn="api-keys";function Pi(){return new Promise((e,t)=>{const n=indexedDB.open(Ti,Ii);n.onupgradeneeded=()=>{const s=n.result;s.objectStoreNames.contains(Xn)||s.createObjectStore(Xn,{keyPath:"provider"})},n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)})}async function bu(e){if(typeof indexedDB>"u")return null;const t=await Pi();return new Promise((n,s)=>{const o=t.transaction(Xn,"readonly").objectStore(Xn).get(e);o.onsuccess=async()=>{const r=o.result;if(!r){n(null);return}if(r.encrypted){const i=ci();if(!i){n(null);return}try{const a=await li(r.value,i);n(a)}catch{n(null)}}else n(r.value)},o.onerror=()=>s(o.error)})}const or="aiui-personas";function Li(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function zi(){try{const e=localStorage.getItem(or);return e?JSON.parse(e):[]}catch{return[]}}function Bi(e){localStorage.setItem(or,JSON.stringify(e))}const xu=_n("personas",()=>{const e=k(zi()),t=A(()=>e.value.find(a=>a.isDefault)??null),n=A(()=>[...e.value].sort((a,l)=>a.isDefault&&!l.isDefault?-1:!a.isDefault&&l.isDefault?1:a.name.localeCompare(l.name)));function s(){Bi(e.value)}function u(a){const l={...a,id:Li()};return l.isDefault&&e.value.forEach(c=>{c.isDefault=!1}),e.value.push(l),s(),l}function o(a,l){const c=e.value.find(f=>f.id===a);c&&(l.isDefault&&e.value.forEach(f=>{f.isDefault=!1}),Object.assign(c,l),s())}function r(a){const l=e.value.findIndex(c=>c.id===a);l!==-1&&(e.value.splice(l,1),s())}function i(a){return e.value.find(l=>l.id===a)}return{personas:e,sortedPersonas:n,defaultPersona:t,addPersona:u,updatePersona:o,deletePersona:r,getPersona:i}}),rr="aiui-memory",ju=20;function Ri(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function ji(){try{const e=localStorage.getItem(rr);return e?JSON.parse(e):[]}catch{return[]}}function Ui(e){localStorage.setItem(rr,JSON.stringify(e))}const ir=_n("memory",()=>{const e=k(ji()),t=A(()=>e.value.length>=ju);function n(){Ui(e.value)}function s(i){if(e.value.length>=ju)return null;const a=i.trim();if(!a)return null;const l={id:Ri(),text:a};return e.value.push(l),n(),l}function u(i,a){const l=e.value.find(c=>c.id===i);l&&(l.text=a.trim(),n())}function o(i){const a=e.value.findIndex(l=>l.id===i);a!==-1&&(e.value.splice(a,1),n())}function r(){return e.value.length===0?"":` - -**User memory (always remember these facts):** -${e.value.map(a=>`- ${a.text}`).join(` -`)}`}return{items:e,isFull:t,addItem:s,updateItem:u,deleteItem:o,buildMemoryContext:r}}),Mn=k(!1),it=k(null),Zt=pu([]),Tn=pu([]),In=k(null),It=k(""),Fs=k("plaintext"),St=k([]),Et=k([]),Ms=k(!1),Ts=k(""),ge="/Users/dorian/Projects";function Uu(e){const t=e.split(".").pop()?.toLowerCase()??"";return{ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",vue:"vue",svelte:"svelte",py:"python",rs:"rust",go:"go",java:"java",kt:"kotlin",swift:"swift",rb:"ruby",php:"php",css:"css",scss:"scss",html:"html",json:"json",yaml:"yaml",yml:"yaml",md:"markdown",toml:"toml",sh:"shell",bash:"shell",sql:"sql",graphql:"graphql",dockerfile:"dockerfile",c:"c",cpp:"cpp",h:"c",hpp:"cpp",cs:"csharp"}[t]??"plaintext"}function vu(){const e=A(()=>Mn.value),t=A(()=>it.value!==null);async function n(){try{const x=await Xe(`/api/fs/list?path=${encodeURIComponent(ge)}`);if(x.ok){const w=await x.json();Zt.value=w.projects??[]}}catch{Zt.value=s()}}function s(){return[{name:"AIUI",path:`${ge}/AIUI`,isGit:!0,language:"TypeScript/JavaScript"},{name:"archy",path:`${ge}/archy`,isGit:!0,language:"TypeScript/JavaScript"},{name:"angor",path:`${ge}/angor`,isGit:!0,language:"C#"},{name:"angor-prototype",path:`${ge}/angor-prototype`,isGit:!0,language:"TypeScript/JavaScript"},{name:"archipelago",path:`${ge}/archipelago`,isGit:!0,language:"Unknown"},{name:"archipelago-foundation",path:`${ge}/archipelago-foundation`,isGit:!0,language:"Unknown"},{name:"blossom",path:`${ge}/blossom`,isGit:!0,language:"TypeScript/JavaScript"},{name:"fedimint",path:`${ge}/fedimint`,isGit:!0,language:"Rust"},{name:"Syntopy",path:`${ge}/Syntopy`,isGit:!0,language:"Unknown"},{name:"Syntropy-Institute",path:`${ge}/Syntropy-Institute`,isGit:!0,language:"Unknown"},{name:"LoRaBell",path:`${ge}/LoRaBell`,isGit:!0,language:"Unknown"},{name:"satoshi-services",path:`${ge}/satoshi-services`,isGit:!0,language:"Unknown"},{name:"Proux",path:`${ge}/Proux`,isGit:!0,language:"Unknown"},{name:"KYC",path:`${ge}/KYC`,isGit:!0,language:"Unknown"},{name:"k484",path:`${ge}/k484`,isGit:!0,language:"Unknown"},{name:"tbf",path:`${ge}/tbf`,isGit:!0,language:"Unknown"},{name:"Icon",path:`${ge}/Icon`,isGit:!1,language:"Unknown"},{name:"indeehub-frontend",path:`${ge}/indeehub-frontend`,isGit:!0,language:"TypeScript/JavaScript"},{name:"Indeedhub Prototype",path:`${ge}/Indeedhub Prototype`,isGit:!0,language:"Unknown"},{name:"21",path:`${ge}/21`,isGit:!0,language:"Unknown"}]}function u(){Mn.value=!0,n()}function o(){Mn.value=!1,it.value=null,In.value=null,It.value="",Tn.value=[],St.value=[],Et.value=[]}function r(x){const w=St.value.indexOf(x);w>=0?St.value.splice(w,1):St.value.push(x)}function i(x){return St.value.includes(x)}function a(){St.value=[]}function l(x){const w=Et.value.indexOf(x);w>=0?Et.value.splice(w,1):Et.value.push(x)}function c(x){return Et.value.includes(x)}function f(){Et.value=[]}function h(x){it.value=x,b(x.path)}async function b(x){try{const w=await Xe(`/api/fs/tree?path=${encodeURIComponent(x)}`);if(w.ok){const M=await w.json();Tn.value=M.files??[]}}catch{Tn.value=g()}}function g(){return[{name:"src",path:"src",isDirectory:!0,children:[{name:"index.ts",path:"src/index.ts",isDirectory:!1},{name:"app.ts",path:"src/app.ts",isDirectory:!1},{name:"utils.ts",path:"src/utils.ts",isDirectory:!1}]},{name:"package.json",path:"package.json",isDirectory:!1},{name:"tsconfig.json",path:"tsconfig.json",isDirectory:!1},{name:"README.md",path:"README.md",isDirectory:!1}]}async function v(x){In.value=x,Fs.value=Uu(x),Ms.value=!0,Ts.value="";try{const w=it.value?`${it.value.path}/${x}`:x,M=await Xe(`/api/fs/read?path=${encodeURIComponent(w)}`);if(M.status===413){Ts.value="File too large to preview (max 1MB)",It.value="";return}if(M.ok){const P=await M.json();It.value=P.content??""}}catch{It.value=E(x)}finally{Ms.value=!1}}function E(x){const w=x.split("/").pop()??x;return w==="package.json"?JSON.stringify({name:it.value?.name?.toLowerCase()??"project",version:"1.0.0",type:"module",scripts:{dev:"vite",build:"vite build",test:"vitest"},dependencies:{}},null,2):w==="README.md"?`# ${it.value?.name??"Project"} - -A project in the AIUI ecosystem. -`:w.endsWith(".ts")||w.endsWith(".js")?`// ${w} -// ${it.value?.name??"Project"} - -export function main() { - console.log('Hello from ${w}') -} -`:`// ${w} -`}async function _(x){const w=x.trim().replace(/[^a-zA-Z0-9_\-. ]/g,"");if(!w)return;const M=`${ge}/${w}`;try{const N=await Xe("/api/fs/mkdir",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:M})});if(!N.ok){const se=await N.json().catch(()=>({}));console.warn("[AIUI code] Failed to create directory:",se.error??N.status)}}catch(N){console.warn("[AIUI code] Could not create directory:",N)}const P={name:w,path:M,isGit:!1,language:"Unknown"};Zt.value=[P,...Zt.value],h(P)}function y(){In.value=null,It.value="",Fs.value="plaintext"}return{codeMode:Mn,isCodeMode:e,activeProject:it,hasActiveProject:t,projectList:Zt,fileTree:Tn,activeFile:In,activeFileContent:It,activeFileLanguage:Fs,selectedDesignTokens:St,selectedFiles:Et,fileLoading:Lu(Ms),fileError:Lu(Ts),enterCodeMode:u,exitCodeMode:o,selectProject:h,openFile:v,loadProjects:n,detectLanguage:Uu,createProject:_,clearActiveFile:y,toggleDesignToken:r,isDesignTokenSelected:i,clearDesignTokens:a,toggleFileSelection:l,isFileSelected:c,clearFileSelection:f}}const Nu="aiui-settings",Is={accentColor:"#F7931A",glassIntensity:"default",fontSize:"default",hiddenContentTabs:[],shortcuts:{"send-message":"Enter","new-line":"Shift+Enter",search:"Cmd+F","new-chat":"Cmd+N",settings:"Cmd+,","close-panel":"Escape"},notificationsEnabled:!1,autoArchiveDays:0,defaultModel:"",defaultPersonaId:"",defaultWebSearch:!1,defaultShowTokens:!1,claudeApiKey:"",useOwnApiKey:!1},Ni=_n("settings",()=>{const e=k(t());function t(){try{const g=localStorage.getItem(Nu);if(g)return{...Is,...JSON.parse(g)}}catch{}return{...Is}}function n(){localStorage.setItem(Nu,JSON.stringify(e.value))}function s(){const g=document.documentElement;g.style.setProperty("--color-accent",e.value.accentColor);const v={subtle:{blur:"12px",opacity:"0.25"},default:{blur:"18px",opacity:"0.35"},strong:{blur:"28px",opacity:"0.50"}}[e.value.glassIntensity];g.style.setProperty("--glass-blur",v.blur),g.style.setProperty("--glass-opacity",v.opacity);const E={compact:"13px",default:"15px",large:"17px"};g.style.setProperty("--font-size-base",E[e.value.fontSize])}Ce(e,()=>{n(),s()},{deep:!0}),s();const u=A({get:()=>e.value.accentColor,set:g=>{e.value.accentColor=g}}),o=A({get:()=>e.value.glassIntensity,set:g=>{e.value.glassIntensity=g}}),r=A({get:()=>e.value.fontSize,set:g=>{e.value.fontSize=g}}),i=A({get:()=>e.value.hiddenContentTabs,set:g=>{e.value.hiddenContentTabs=g}}),a=A({get:()=>e.value.notificationsEnabled,set:g=>{e.value.notificationsEnabled=g}}),l=A({get:()=>e.value.autoArchiveDays,set:g=>{e.value.autoArchiveDays=g}});function c(g){return!e.value.hiddenContentTabs.includes(g)}function f(g){const v=e.value.hiddenContentTabs.indexOf(g);v>=0?e.value.hiddenContentTabs.splice(v,1):e.value.hiddenContentTabs.push(g)}function h(g,v){e.value.shortcuts[g]=v}function b(){e.value={...Is}}return{settings:e,accentColor:u,glassIntensity:o,fontSize:r,hiddenContentTabs:i,notificationsEnabled:a,autoArchiveDays:l,isTabVisible:c,toggleTabVisibility:f,setShortcut:h,resetSettings:b,applyCssVars:s}}),ar="https://image.tmdb.org/t/p",V=`${ar}/w342`,G=`${ar}/w780`,Wt=[{id:"f1",title:"Blade Runner 2049",year:2017,posterUrl:`${V}/gajva2L0rPYkEWjzgFlBXCAVBE5.jpg`,backdropUrl:`${G}/sAtoMqDVhNDQBc3QJL3RF6hlhGq.jpg`,synopsis:"A young blade runner discovers a long-buried secret that leads him to track down former blade runner Rick Deckard, who has been missing for thirty years.",genres:["Sci-Fi","Drama","Thriller"],rating:7.5,runtime:164,director:"Denis Villeneuve",cast:["Ryan Gosling","Harrison Ford","Ana de Armas"],trailerUrl:"https://www.youtube.com/watch?v=gCcx85e8rTo",sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12345",quality:"4K",icon:"plex"},{type:"youtube",name:"YouTube Rental",url:"https://www.youtube.com/watch?v=gCcx85e8rTo",quality:"HD",icon:"youtube"}]},{id:"f2",title:"Arrival",year:2016,posterUrl:`${V}/x2FJsf1ElAgr63Y3LNUTq7KZPno.jpg`,backdropUrl:`${G}/yIZ1xendHwnlqSEIFg5MpkOQ1qk.jpg`,synopsis:"A linguist works with the military to communicate with alien lifeforms after twelve mysterious spacecraft appear around the world.",genres:["Sci-Fi","Drama"],rating:7.9,runtime:116,director:"Denis Villeneuve",cast:["Amy Adams","Jeremy Renner","Forest Whitaker"],trailerUrl:"https://www.youtube.com/watch?v=tFMo3UJ4B4g",sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12346",quality:"1080p",icon:"plex"}]},{id:"f3",title:"Dune",year:2021,posterUrl:`${V}/d5NXSklXo0qyIYkgV94XAgMIckC.jpg`,backdropUrl:`${G}/jYEW5xZkZk2WTrdbMGAPFuBqbDc.jpg`,synopsis:"Paul Atreides, a brilliant and gifted young man born into a great destiny beyond his understanding, must travel to the most dangerous planet in the universe.",genres:["Sci-Fi","Adventure","Drama"],rating:7.8,runtime:155,director:"Denis Villeneuve",cast:["Timothée Chalamet","Rebecca Ferguson","Zendaya"],trailerUrl:"https://www.youtube.com/watch?v=n9xhJrPXop4",sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12347",quality:"4K HDR",icon:"plex"},{type:"youtube",name:"YouTube Purchase",url:"https://www.youtube.com/watch?v=n9xhJrPXop4",quality:"4K",icon:"youtube"}]},{id:"f4",title:"Interstellar",year:2014,posterUrl:`${V}/gEU2QniE6E77NI6lCU6MxlNBvIx.jpg`,backdropUrl:`${G}/xJHokMbljvjADYdit5fK1DDtAoB.jpg`,synopsis:"A team of explorers travel through a wormhole in space in an attempt to ensure humanity's survival.",genres:["Sci-Fi","Adventure","Drama"],rating:8.6,runtime:169,director:"Christopher Nolan",cast:["Matthew McConaughey","Anne Hathaway","Jessica Chastain"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12348",quality:"4K IMAX",icon:"plex"},{type:"nextcloud",name:"Nextcloud Files",url:"https://cloud.example.com/s/abc123",quality:"1080p",icon:"nextcloud"}]},{id:"f5",title:"The Matrix",year:1999,posterUrl:`${V}/f89U3ADr1oiB1s9GkdPOEpXUk5H.jpg`,backdropUrl:`${G}/fNG7i7RqMErkcqhohV2a6cV1Ehy.jpg`,synopsis:"A computer programmer discovers that reality as he knows it is a simulation created by machines, and joins a rebellion to break free.",genres:["Sci-Fi","Action"],rating:8.7,runtime:136,director:"Lana Wachowski",cast:["Keanu Reeves","Laurence Fishburne","Carrie-Anne Moss"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12349",quality:"4K",icon:"plex"},{type:"free-web",name:"Archive.org",url:"https://archive.org/details/thematrix",quality:"SD",icon:"archive"}]},{id:"f6",title:"Parasite",year:2019,posterUrl:`${V}/7IiTTgloJzvGI1TAYymCfbfl3vT.jpg`,backdropUrl:`${G}/TU9NIjwzjoKPwQHoHshkFcQUCG.jpg`,synopsis:"Greed and class discrimination threaten the newly formed symbiotic relationship between the wealthy Park family and the destitute Kim clan.",genres:["Drama","Thriller","Comedy"],rating:8.5,runtime:132,director:"Bong Joon-ho",cast:["Song Kang-ho","Lee Sun-kyun","Cho Yeo-jeong"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12350",quality:"1080p",icon:"plex"}]},{id:"f7",title:"Mad Max: Fury Road",year:2015,posterUrl:`${V}/8tZYtuWezp8JbcsvHYO0O46tFBO.jpg`,backdropUrl:`${G}/phszHPFVhPHhMZgo0fWTKBDQsJA.jpg`,synopsis:"In a post-apocalyptic wasteland, a woman rebels against a tyrannical ruler in search for her homeland with the aid of a drifter.",genres:["Action","Adventure","Sci-Fi"],rating:8.1,runtime:120,director:"George Miller",cast:["Tom Hardy","Charlize Theron","Nicholas Hoult"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12351",quality:"4K HDR",icon:"plex"},{type:"youtube",name:"YouTube Rental",url:"https://www.youtube.com/watch?v=hEJnMQG9ev8",quality:"HD",icon:"youtube"}]},{id:"f8",title:"Ex Machina",year:2014,posterUrl:`${V}/btbRB7BrD887pKiSfMXtCCHvyOo.jpg`,backdropUrl:`${G}/4uOaYtBvAYXOPSHuWLpFOS17SO.jpg`,synopsis:"A young programmer is selected to participate in a groundbreaking experiment in synthetic intelligence by evaluating the human qualities of a highly advanced humanoid AI.",genres:["Sci-Fi","Drama","Thriller"],rating:7.7,runtime:108,director:"Alex Garland",cast:["Alicia Vikander","Domhnall Gleeson","Oscar Isaac"],sources:[{type:"nextcloud",name:"Nextcloud Files",url:"https://cloud.example.com/s/def456",quality:"1080p",icon:"nextcloud"}]},{id:"f9",title:"The Grand Budapest Hotel",year:2014,posterUrl:`${V}/eWDyJQ3yz8mvHj7pKfRPs0h2CAl.jpg`,backdropUrl:`${G}/nX5XotM9yprCKarRH4fzOq1WZ5y.jpg`,synopsis:"A writer encounters the owner of an aging high-class hotel, who tells him of his early years serving as a lobby boy in the hotel's glorious years.",genres:["Comedy","Drama","Adventure"],rating:8.1,runtime:99,director:"Wes Anderson",cast:["Ralph Fiennes","F. Murray Abraham","Mathieu Amalric"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12352",quality:"1080p",icon:"plex"}]},{id:"f10",title:"Whiplash",year:2014,posterUrl:`${V}/7fn624j5lj3xTme2SgiLCeuedmO.jpg`,backdropUrl:`${G}/fRGxZuo7jJUWQsVg9PREb98Aclp.jpg`,synopsis:"A promising young drummer enrolls at a cut-throat music conservatory where his dreams of greatness are mentored by an instructor who will stop at nothing.",genres:["Drama","Music"],rating:8.5,runtime:107,director:"Damien Chazelle",cast:["Miles Teller","J.K. Simmons","Melissa Benoist"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12353",quality:"1080p",icon:"plex"},{type:"free-web",name:"Tubi",url:"https://tubitv.com/movies/whiplash",quality:"HD",icon:"tubi"}]},{id:"f11",title:"Drive",year:2011,posterUrl:`${V}/602vevIURmpDfzbnv5Ubi6wIkQm.jpg`,backdropUrl:`${G}/wMELEDyvaJsAykFP1cDasWKlXKv.jpg`,synopsis:"A mysterious Hollywood stuntman and mechanic moonlights as a getaway driver and finds himself in trouble when he helps out his neighbor.",genres:["Drama","Crime","Action"],rating:7.8,runtime:100,director:"Nicolas Winding Refn",cast:["Ryan Gosling","Carey Mulligan","Bryan Cranston"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12354",quality:"1080p",icon:"plex"}]},{id:"f12",title:"Spirited Away",year:2001,posterUrl:`${V}/39wmItIWsg5sZMyRUHLkWBcuVCM.jpg`,backdropUrl:`${G}/Ab8mkHmkYADjU7wQiOkia9BzGvS.jpg`,synopsis:"During her family's move to the suburbs, a sullen 10-year-old girl wanders into a world ruled by gods, witches, and spirits.",genres:["Animation","Fantasy","Adventure"],rating:8.6,runtime:125,director:"Hayao Miyazaki",cast:["Rumi Hiiragi","Miyu Irino","Mari Natsuki"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12355",quality:"1080p",icon:"plex"},{type:"nextcloud",name:"Nextcloud Files",url:"https://cloud.example.com/s/ghi789",quality:"1080p",icon:"nextcloud"}]},{id:"f13",title:"The Social Network",year:2010,posterUrl:`${V}/n0ybibhJtQ5icDqTp8eRytcIHJx.jpg`,backdropUrl:`${G}/yyMQLz9pMzB7LbLNz4l8Y1KLLBZ.jpg`,synopsis:"As Harvard student Mark Zuckerberg creates the social networking site that would become known as Facebook, he is sued by the twins who claimed he stole their idea.",genres:["Drama","Biography"],rating:7.7,runtime:120,director:"David Fincher",cast:["Jesse Eisenberg","Andrew Garfield","Justin Timberlake"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12356",quality:"1080p",icon:"plex"}]},{id:"f14",title:"Her",year:2013,posterUrl:`${V}/eCOtqtfvn7mxGl6nfmq4b1exJRc.jpg`,backdropUrl:`${G}/bbS05YfasBhMsQqY1A7gKjETJNu.jpg`,synopsis:"In a near future, a lonely writer develops an unlikely relationship with an operating system designed to meet his every need.",genres:["Sci-Fi","Drama","Romance"],rating:8,runtime:126,director:"Spike Jonze",cast:["Joaquin Phoenix","Scarlett Johansson","Amy Adams"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12357",quality:"1080p",icon:"plex"}]},{id:"f15",title:"Moonlight",year:2016,posterUrl:`${V}/4911T5FbJ9eD2Faz5Z8cT3SUhU3.jpg`,backdropUrl:`${G}/A52Lnk3UkxF4Lg3LkkmGNBCnEQ.jpg`,synopsis:"A young African-American man grapples with his identity and sexuality while experiencing the everyday struggles of childhood, adolescence, and burgeoning adulthood.",genres:["Drama"],rating:7.4,runtime:111,director:"Barry Jenkins",cast:["Mahershala Ali","Naomie Harris","Trevante Rhodes"],sources:[{type:"free-web",name:"Tubi",url:"https://tubitv.com/movies/moonlight",quality:"HD",icon:"tubi"}]},{id:"f16",title:"No Country for Old Men",year:2007,posterUrl:`${V}/bj1v6YKF8yHqA489GFfPC8oKjAz.jpg`,backdropUrl:`${G}/AoJn0YDsrjUHqBLqmJmqDTz8k6y.jpg`,synopsis:"Violence and mayhem ensue after a hunter stumbles upon a drug deal gone wrong and more than two million dollars in cash near the Rio Grande.",genres:["Crime","Drama","Thriller"],rating:8.1,runtime:122,director:"Joel Coen",cast:["Tommy Lee Jones","Javier Bardem","Josh Brolin"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12358",quality:"1080p",icon:"plex"}]},{id:"f17",title:"Everything Everywhere All at Once",year:2022,posterUrl:`${V}/w3LxiVYdWWRvEVdn5RYq6jIqkb1.jpg`,backdropUrl:`${G}/wY1HZjM2GvHH4aSyrDvEfVEEW4A.jpg`,synopsis:"An aging Chinese immigrant is swept up in an insane adventure, where she alone can save what's important to her by connecting with the lives she could have led.",genres:["Action","Adventure","Comedy"],rating:7.8,runtime:139,director:"Daniel Kwan",cast:["Michelle Yeoh","Ke Huy Quan","Stephanie Hsu"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12359",quality:"4K",icon:"plex"},{type:"youtube",name:"YouTube Purchase",url:"https://www.youtube.com/watch?v=wxN1T1qdQ",quality:"4K",icon:"youtube"}]},{id:"f18",title:"The Shawshank Redemption",year:1994,posterUrl:`${V}/q6y0Go1tsGEsmtFryDOJo3dEmqu.jpg`,backdropUrl:`${G}/kXfqcdQKsToO0OUXHcrrNCHDBzO.jpg`,synopsis:"Over the course of several years, two convicts form a friendship, seeking consolation and, eventually, redemption through basic compassion.",genres:["Drama"],rating:9.3,runtime:142,director:"Frank Darabont",cast:["Tim Robbins","Morgan Freeman","Bob Gunton"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12360",quality:"4K",icon:"plex"},{type:"free-web",name:"Archive.org",url:"https://archive.org/details/shawshank",quality:"SD",icon:"archive"}]},{id:"f19",title:"Sicario",year:2015,posterUrl:`${V}/z8sJM6ijaEmVDB8Uo3NJNOoXNqV.jpg`,backdropUrl:`${G}/bLxkraPUhKlE7JQBfaWbWg2U70b.jpg`,synopsis:"An idealistic FBI agent is enlisted by a government task force to aid in the escalating war against drugs at the border area between the U.S. and Mexico.",genres:["Action","Crime","Drama"],rating:7.6,runtime:121,director:"Denis Villeneuve",cast:["Emily Blunt","Josh Brolin","Benicio del Toro"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12361",quality:"1080p",icon:"plex"}]},{id:"f20",title:"The Dark Knight",year:2008,posterUrl:`${V}/qJ2tW6WMUDux911kpWYrhaCj5l8.jpg`,backdropUrl:`${G}/nMKdUUepR0i5zn0y1T4CsSB5ez.jpg`,synopsis:"When the menace known as the Joker wreaks havoc and chaos on the people of Gotham, Batman must accept one of the greatest psychological and physical tests of his ability to fight injustice.",genres:["Action","Crime","Drama"],rating:9,runtime:152,director:"Christopher Nolan",cast:["Christian Bale","Heath Ledger","Aaron Eckhart"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12362",quality:"4K IMAX",icon:"plex"},{type:"youtube",name:"YouTube Rental",url:"https://www.youtube.com/watch?v=EXeTwQWrcwY",quality:"HD",icon:"youtube"}]},{id:"f21",title:"Inception",year:2010,posterUrl:`${V}/edv5CZvWj09upOsy2Y6IwDhK8bt.jpg`,backdropUrl:`${G}/s3TBrRGB1iav7gFOCNx3H31MoES.jpg`,synopsis:"A thief who steals corporate secrets through dream-sharing technology is given the inverse task of planting an idea into the mind of a C.E.O.",genres:["Sci-Fi","Action","Thriller"],rating:8.8,runtime:148,director:"Christopher Nolan",cast:["Leonardo DiCaprio","Joseph Gordon-Levitt","Elliot Page"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12363",quality:"4K",icon:"plex"}]},{id:"f22",title:"Hereditary",year:2018,posterUrl:`${V}/p9fmuz2Oj3FtMGSbVMBCabd06VO.jpg`,backdropUrl:`${G}/5GbkXg1e3i4X2Gfyg4c8JdwVYmt.jpg`,synopsis:"A grieving family is haunted by tragic and disturbing occurrences after the death of their secretive grandmother.",genres:["Horror","Drama","Mystery"],rating:7.3,runtime:127,director:"Ari Aster",cast:["Toni Collette","Milly Shapiro","Gabriel Byrne"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12364",quality:"1080p",icon:"plex"}]},{id:"f23",title:"The Lighthouse",year:2019,posterUrl:`${V}/3nBrkqpG4Mzp7BnsLWDaiXH3VJZ.jpg`,backdropUrl:`${G}/5BkSkNbcABByJ6MFIxQxKiuN7UI.jpg`,synopsis:"Two lighthouse keepers try to maintain their sanity while living on a remote and mysterious New England island in the 1890s.",genres:["Drama","Fantasy","Horror"],rating:7.5,runtime:109,director:"Robert Eggers",cast:["Willem Dafoe","Robert Pattinson"],sources:[{type:"nextcloud",name:"Nextcloud Files",url:"https://cloud.example.com/s/jkl012",quality:"1080p",icon:"nextcloud"}]},{id:"f24",title:"Akira",year:1988,posterUrl:`${V}/neZ0ykEsPqxamsX6o5QNUFILQpa.jpg`,backdropUrl:`${G}/qeyColorZbMBevU5uMZDMXGxiB7.jpg`,synopsis:"A secret military project endangers Neo-Tokyo when it turns a biker gang member into a rampaging psychic psychopath.",genres:["Animation","Sci-Fi","Action"],rating:8,runtime:124,director:"Katsuhiro Otomo",cast:["Mitsuo Iwata","Nozomu Sasaki","Mami Koyama"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12365",quality:"4K",icon:"plex"},{type:"free-web",name:"Archive.org",url:"https://archive.org/details/akira",quality:"SD",icon:"archive"}]},{id:"f25",title:"There Will Be Blood",year:2007,posterUrl:`${V}/fa0RDkAlCec0STeMNAhPaF89q6U.jpg`,backdropUrl:`${G}/y6lFCjxEGJ4TpQRa5VHRuA6K0M.jpg`,synopsis:"A story of family, religion, hatred, oil and madness, focusing on a turn-of-the-century prospector in the early days of the business.",genres:["Drama"],rating:8.2,runtime:158,director:"Paul Thomas Anderson",cast:["Daniel Day-Lewis","Paul Dano","Ciarán Hinds"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12366",quality:"1080p",icon:"plex"}]},{id:"f26",title:"Oldboy",year:2003,posterUrl:`${V}/pWDtjs568ZfOTMbURQBYuT4Qxka.jpg`,backdropUrl:`${G}/4CnTFELRf0VN1jp59iFmFpYc1S.jpg`,synopsis:"After being kidnapped and imprisoned for fifteen years, Oh Dae-Su is released, only to find that he must find his captor in five days.",genres:["Action","Drama","Mystery"],rating:8.4,runtime:120,director:"Park Chan-wook",cast:["Choi Min-sik","Yoo Ji-tae","Kang Hye-jung"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12367",quality:"1080p",icon:"plex"}]},{id:"f27",title:"Stalker",year:1979,posterUrl:`${V}/iPbNAc2GnqZgKpAAbEE0Uy9V1Db.jpg`,backdropUrl:`${G}/sBPkb2gPXJrBWa60fAdh8vj4M3I.jpg`,synopsis:"A guide leads two men through an area known as the Zone to find a room that grants wishes.",genres:["Sci-Fi","Drama"],rating:8.2,runtime:163,director:"Andrei Tarkovsky",cast:["Aleksandr Kaydanovskiy","Anatoliy Solonitsyn","Nikolay Grinko"],sources:[{type:"free-web",name:"Archive.org",url:"https://archive.org/details/stalker-1979",quality:"HD Restored",icon:"archive"}]},{id:"f28",title:"Amélie",year:2001,posterUrl:`${V}/nSxDa3M9aMvs3DqxMkNizqRKvEa.jpg`,backdropUrl:`${G}/6eJMISgddTe8i4MH4CnPaFcM3hM.jpg`,synopsis:"Amélie is an innocent and naive girl in Paris with her own sense of justice. She decides to help those around her and, along the way, discovers love.",genres:["Comedy","Romance"],rating:8.3,runtime:122,director:"Jean-Pierre Jeunet",cast:["Audrey Tautou","Mathieu Kassovitz","Rufus"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12368",quality:"1080p",icon:"plex"}]},{id:"f29",title:"In the Mood for Love",year:2e3,posterUrl:`${V}/iYypPT4bhqXfq1b6sFnVVR4FySt.jpg`,backdropUrl:`${G}/ArbbMEiGPbV4g3a6ahCfrR8pF6a.jpg`,synopsis:"Two neighbors form a strong bond after both suspect extramarital activities of their spouses. However, they agree to keep their relationship platonic.",genres:["Drama","Romance"],rating:8.1,runtime:98,director:"Wong Kar-wai",cast:["Tony Leung Chiu-wai","Maggie Cheung","Ping Lam Siu"],sources:[{type:"nextcloud",name:"Nextcloud Files",url:"https://cloud.example.com/s/mno345",quality:"4K Restored",icon:"nextcloud"}]},{id:"f30",title:"The Godfather",year:1972,posterUrl:`${V}/3bhkrj58Vtu7enYsRolD1fZdja1.jpg`,backdropUrl:`${G}/tmU7GeKVybMWFButWEGl2M4GeiP.jpg`,synopsis:"The aging patriarch of an organized crime dynasty in postwar New York City transfers control of his clandestine empire to his reluctant youngest son.",genres:["Crime","Drama"],rating:9.2,runtime:175,director:"Francis Ford Coppola",cast:["Marlon Brando","Al Pacino","James Caan"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12369",quality:"4K Restored",icon:"plex"},{type:"youtube",name:"YouTube Purchase",url:"https://www.youtube.com/watch?v=UaVTIH8mujA",quality:"4K",icon:"youtube"}]},{id:"f31",title:"2001: A Space Odyssey",year:1968,posterUrl:`${V}/ve72VzNqjgM69Ml8om3OyoEQpFe.jpg`,backdropUrl:`${G}/hxl1y0AFBbzLXFHMDFcqSMsq3qz.jpg`,synopsis:"After uncovering a mysterious artifact buried beneath the lunar surface, a spacecraft is sent to Jupiter to find its origins.",genres:["Sci-Fi","Adventure"],rating:8.3,runtime:149,director:"Stanley Kubrick",cast:["Keir Dullea","Gary Lockwood","William Sylvester"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12370",quality:"4K IMAX",icon:"plex"}]},{id:"f32",title:"Pulp Fiction",year:1994,posterUrl:`${V}/d5iIlFn5s0ImszYzBPb8JPIfbXD.jpg`,backdropUrl:`${G}/suaEOtk1N1sgg2MTM7oZd2cfVp3.jpg`,synopsis:"The lives of two mob hitmen, a boxer, a gangster and his wife, and a pair of diner bandits intertwine in four tales of violence and redemption.",genres:["Crime","Drama","Thriller"],rating:8.9,runtime:154,director:"Quentin Tarantino",cast:["John Travolta","Samuel L. Jackson","Uma Thurman"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12371",quality:"4K",icon:"plex"},{type:"free-web",name:"Tubi",url:"https://tubitv.com/movies/pulp-fiction",quality:"HD",icon:"tubi"}]},{id:"f33",title:"Annihilation",year:2018,posterUrl:`${V}/d3qcpfNwbAMCNqWDHzPQsUoj7ig.jpg`,backdropUrl:`${G}/1Y2YzOmVhCQ4c0TjlCqfJBl8Ykz.jpg`,synopsis:"A biologist signs up for a dangerous, secret expedition into a mysterious zone where the laws of nature don't apply.",genres:["Sci-Fi","Horror","Adventure"],rating:6.8,runtime:115,director:"Alex Garland",cast:["Natalie Portman","Jennifer Jason Leigh","Tessa Thompson"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12372",quality:"4K",icon:"plex"}]},{id:"f34",title:"Children of Men",year:2006,posterUrl:`${V}/uONhGnVGieGqjw74vRIh5DLaZbr.jpg`,backdropUrl:`${G}/cM7wqMsIEjMZ0qsIXRoYZqfk0s.jpg`,synopsis:"In 2027, in a chaotic world in which women have somehow become infertile, a former activist agrees to help transport a miraculously pregnant woman to a sanctuary at sea.",genres:["Sci-Fi","Drama","Thriller"],rating:7.9,runtime:109,director:"Alfonso Cuarón",cast:["Clive Owen","Julianne Moore","Michael Caine"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12373",quality:"1080p",icon:"plex"},{type:"nextcloud",name:"Nextcloud Files",url:"https://cloud.example.com/s/pqr678",quality:"1080p",icon:"nextcloud"}]},{id:"f35",title:"Pan's Labyrinth",year:2006,posterUrl:`${V}/s2Ih5jSFCJwMqEIVsBYyNn0Tyx5.jpg`,backdropUrl:`${G}/4qfadVQIJm7R3LzqObDtBGN1OXi.jpg`,synopsis:"In the Falangist Spain of 1944, the bookish young stepdaughter of a sadistic army officer escapes into an eerie but captivating fantasy world.",genres:["Drama","Fantasy","War"],rating:8.2,runtime:118,director:"Guillermo del Toro",cast:["Ivana Baquero","Ariadna Gil","Sergi López"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12374",quality:"4K",icon:"plex"}]},{id:"f36",title:"Eternal Sunshine of the Spotless Mind",year:2004,posterUrl:`${V}/5MwkWH9tYHv3mV9OdYTMR5qreIz.jpg`,backdropUrl:`${G}/6f1a2p19dOLF0USwPgHx3TXbD8U.jpg`,synopsis:"When their relationship turns sour, a couple undergoes a medical procedure to have each other erased from their memories.",genres:["Drama","Romance","Sci-Fi"],rating:8.3,runtime:108,director:"Michel Gondry",cast:["Jim Carrey","Kate Winslet","Tom Wilkinson"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12375",quality:"1080p",icon:"plex"}]},{id:"f37",title:"Taxi Driver",year:1976,posterUrl:`${V}/ekstpH614fwDX8DUln1a2Opz0N8.jpg`,backdropUrl:`${G}/ghbSODMHaSDNkGg2yF6R4Rq2FM.jpg`,synopsis:"A mentally unstable veteran works as a nighttime taxi driver in New York City, where the perceived decadence and sleaze fuels his urge for violent action.",genres:["Crime","Drama"],rating:8.2,runtime:114,director:"Martin Scorsese",cast:["Robert De Niro","Jodie Foster","Cybill Shepherd"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12376",quality:"4K Restored",icon:"plex"}]},{id:"f38",title:"Mulholland Drive",year:2001,posterUrl:`${V}/tVxGt7uffLVhIIcwuldXjy4JvMH.jpg`,backdropUrl:`${G}/bV8PLdElQVafeXvOnnFiFZNrFPM.jpg`,synopsis:"After a car wreck on the winding Mulholland Drive renders a woman amnesiac, she and a perky Hollywood-hopeful search for clues and answers.",genres:["Drama","Mystery","Thriller"],rating:7.9,runtime:147,director:"David Lynch",cast:["Naomi Watts","Laura Harring","Justin Theroux"],sources:[{type:"nextcloud",name:"Nextcloud Files",url:"https://cloud.example.com/s/stu901",quality:"4K Restored",icon:"nextcloud"}]},{id:"f39",title:"The Departed",year:2006,posterUrl:`${V}/nT97ifVT2J1yMQmeq20Dqv28.jpg`,backdropUrl:`${G}/8Id2Z4LB12BMLMoJnFHMFht4bXP.jpg`,synopsis:"An undercover cop and a mole in the police attempt to identify each other while infiltrating an Irish gang in South Boston.",genres:["Crime","Drama","Thriller"],rating:8.5,runtime:151,director:"Martin Scorsese",cast:["Leonardo DiCaprio","Matt Damon","Jack Nicholson"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12377",quality:"1080p",icon:"plex"}]},{id:"f40",title:"Prisoners",year:2013,posterUrl:`${V}/uhBqwitKfOP0FBPblUBqxgce6hg.jpg`,backdropUrl:`${G}/2E0PFGHgJBMSJ4GpjBmCnaBqCmz.jpg`,synopsis:"When Keller Dover's daughter and her friend go missing, he takes matters into his own hands as the police pursue multiple leads.",genres:["Crime","Drama","Mystery"],rating:8.1,runtime:153,director:"Denis Villeneuve",cast:["Hugh Jackman","Jake Gyllenhaal","Viola Davis"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12378",quality:"1080p",icon:"plex"},{type:"youtube",name:"YouTube Rental",url:"https://www.youtube.com/watch?v=bLv3JM2x2bc",quality:"HD",icon:"youtube"}]},{id:"f41",title:"Goodfellas",year:1990,posterUrl:`${V}/aKuFiU82s5ISJpGZp7YkIr3kCUd.jpg`,backdropUrl:`${G}/sw7mordbZxgITU877yTpZCud90M.jpg`,synopsis:"The story of Henry Hill and his life in the mob, covering his relationship with his wife Karen Hill and his mob partners.",genres:["Crime","Drama","Biography"],rating:8.7,runtime:146,director:"Martin Scorsese",cast:["Robert De Niro","Ray Liotta","Joe Pesci"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12379",quality:"4K",icon:"plex"}]},{id:"f42",title:"Ghost in the Shell",year:1995,posterUrl:`${V}/9gC88zYUBbuGRzgyNcE1xj0QRZL.jpg`,backdropUrl:`${G}/t7Gy2V5tGGWsRCsH7m6hI1OXm06.jpg`,synopsis:"A cyborg policewoman and her partner hunt a mysterious and powerful hacker called the Puppet Master.",genres:["Animation","Sci-Fi","Action"],rating:8,runtime:83,director:"Mamoru Oshii",cast:["Atsuko Tanaka","Akio Ōtsuka","Iemasa Kayumi"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12380",quality:"4K",icon:"plex"},{type:"free-web",name:"Archive.org",url:"https://archive.org/details/gits1995",quality:"SD",icon:"archive"}]},{id:"f43",title:"The Prestige",year:2006,posterUrl:`${V}/tRNlZbgNCNOpLpbPEz5L8G8A0JN.jpg`,backdropUrl:`${G}/s0EfkKJONLVCT9Q3UrPW0q07rT1.jpg`,synopsis:"After a tragic accident, two stage magicians in 1890s London engage in a battle to create the ultimate illusion while sacrificing everything they have.",genres:["Drama","Mystery","Sci-Fi"],rating:8.5,runtime:130,director:"Christopher Nolan",cast:["Christian Bale","Hugh Jackman","Scarlett Johansson"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12381",quality:"1080p",icon:"plex"}]},{id:"f44",title:"Solaris",year:1972,posterUrl:`${V}/2sF5EfIwZMY0eT0U0iH5A43OLK2.jpg`,backdropUrl:`${G}/ixjQv30AYFXxGE7RaReGJn0YnQJ.jpg`,synopsis:"A psychologist is sent to a station orbiting a distant planet in order to discover what has caused the crew to go insane.",genres:["Sci-Fi","Drama","Mystery"],rating:8.1,runtime:167,director:"Andrei Tarkovsky",cast:["Natalya Bondarchuk","Donatas Banionis","Jüri Järvet"],sources:[{type:"free-web",name:"Archive.org",url:"https://archive.org/details/solaris-1972",quality:"HD Restored",icon:"archive"}]},{id:"f45",title:"City of God",year:2002,posterUrl:`${V}/k7eYdWvhYQyRQoU2TB2A2Xu2TIM.jpg`,backdropUrl:`${G}/efnAMhQJMH4EvEZqPEB5SRXWihi.jpg`,synopsis:"In the slums of Rio, two kids' paths diverge as one struggles to become a photographer and the other a kingpin.",genres:["Crime","Drama"],rating:8.6,runtime:130,director:"Fernando Meirelles",cast:["Alexandre Rodrigues","Leandro Firmino","Matheus Nachtergaele"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12382",quality:"1080p",icon:"plex"}]},{id:"f46",title:"The Truman Show",year:1998,posterUrl:`${V}/vuza0WqY239yBXOadKlGwJsZJFE.jpg`,backdropUrl:`${G}/Al5GPz9U2mB2OPktKEIiHK7v97E.jpg`,synopsis:"An insurance salesman discovers his whole life is actually a reality TV show.",genres:["Comedy","Drama","Sci-Fi"],rating:8.2,runtime:103,director:"Peter Weir",cast:["Jim Carrey","Ed Harris","Laura Linney"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12383",quality:"1080p",icon:"plex"},{type:"youtube",name:"YouTube Rental",url:"https://www.youtube.com/watch?v=dlnmQbPGuls",quality:"HD",icon:"youtube"}]},{id:"f47",title:"Gattaca",year:1997,posterUrl:`${V}/rkgZpFhI4xGSWljCxPWkb1XMoB2.jpg`,backdropUrl:`${G}/3oTf3cfrTJbVW3fnSQNaJZBL2NQ.jpg`,synopsis:"A genetically inferior man assumes the identity of a superior one in order to pursue his lifelong dream of space travel.",genres:["Sci-Fi","Drama","Thriller"],rating:7.8,runtime:106,director:"Andrew Niccol",cast:["Ethan Hawke","Uma Thurman","Jude Law"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12384",quality:"1080p",icon:"plex"}]},{id:"f48",title:"Memento",year:2e3,posterUrl:`${V}/yuNs09hvpHVU1cBTCAk9zxsL2oW.jpg`,backdropUrl:`${G}/rpMn6Rl6IrvnyXcLPLEXaJPFvK8.jpg`,synopsis:"A man with short-term memory loss attempts to track down his wife's murderer using tattoos and notes.",genres:["Mystery","Thriller"],rating:8.4,runtime:113,director:"Christopher Nolan",cast:["Guy Pearce","Carrie-Anne Moss","Joe Pantoliano"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12385",quality:"1080p",icon:"plex"},{type:"free-web",name:"Tubi",url:"https://tubitv.com/movies/memento",quality:"HD",icon:"tubi"}]},{id:"f49",title:"The Thing",year:1982,posterUrl:`${V}/tzGY49kseSE9QAKk47uuDGwnSCu.jpg`,backdropUrl:`${G}/hILmnSocNhXYn7mPGvn1ICeu5nq.jpg`,synopsis:"A research team in Antarctica is hunted by a shape-shifting alien that assumes the appearance of its victims.",genres:["Horror","Sci-Fi","Mystery"],rating:8.2,runtime:109,director:"John Carpenter",cast:["Kurt Russell","Wilford Brimley","Keith David"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12386",quality:"4K",icon:"plex"}]},{id:"f50",title:"Dune: Part Two",year:2024,posterUrl:`${V}/8b8R8l88Qje9dn9OE8PY05Nxl1X.jpg`,backdropUrl:`${G}/xOMo8BRK7PfcJv9JCnx7s5hj0PX.jpg`,synopsis:"Paul Atreides unites with Chani and the Fremen while on a warpath of revenge against the conspirators who destroyed his family.",genres:["Sci-Fi","Adventure","Drama"],rating:8.3,runtime:166,director:"Denis Villeneuve",cast:["Timothée Chalamet","Zendaya","Austin Butler"],sources:[{type:"plex",name:"Plex Library",url:"plex://play?key=/library/metadata/12387",quality:"4K IMAX",icon:"plex"},{type:"youtube",name:"YouTube Purchase",url:"https://www.youtube.com/watch?v=Way9Dexny3w",quality:"4K",icon:"youtube"}]}];[...new Set(Wt.flatMap(e=>e.genres))].sort();[...new Set(Wt.flatMap(e=>e.sources.map(t=>t.type)))];const An=[{id:"s1",title:"Never Meant",artist:"American Football",album:"American Football",year:1999,coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Music122/v4/17/90/19/179019ea-4eaf-b2e5-ca19-68cdbb795032/644110027696.png/600x600bb.jpg",duration:269,genres:["Math Rock","Emo","Indie"],sources:[{type:"spotify",name:"Spotify",url:"https://open.spotify.com/track/example",icon:"spotify"},{type:"youtube",name:"YouTube",url:"https://youtube.com/watch?v=example",icon:"youtube"}]},{id:"s2",title:"The Kill",artist:"Toe",album:"The Book About My Idle Plot on a Vague Anxiety",year:2005,coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Music115/v4/5f/d9/63/5fd96387-45fa-6b94-afd8-7b2c4a24a93b/11UMGIM38959.rgb.jpg/600x600bb.jpg",duration:248,genres:["Math Rock","Post-Rock"],sources:[{type:"spotify",name:"Spotify",url:"https://open.spotify.com/track/example2",icon:"spotify"}]},{id:"s3",title:"Caraphernelia",artist:"Pierce the Veil",album:"Selfish Machines",year:2010,coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Music114/v4/b6/02/3c/b6023c10-8d56-071d-6acc-a778a8550479/886443323360.jpg/600x600bb.jpg",duration:234,genres:["Post-Hardcore","Math Rock"],sources:[{type:"spotify",name:"Spotify",url:"https://open.spotify.com/track/example3",icon:"spotify"}]},{id:"s4",title:"Ghosts",artist:"Clever Girl",album:"No Drum and Bass in the Jazz Room",year:2016,coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Music114/v4/88/0a/47/880a475a-3878-d3d9-8e72-498085aeedd4/cover.jpg/600x600bb.jpg",duration:312,genres:["Math Rock","Instrumental"],sources:[{type:"spotify",name:"Spotify",url:"https://open.spotify.com/track/example4",icon:"spotify"}]},{id:"s5",title:"pon ponpon",artist:"TTNG",album:"Animals",year:2008,coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Music211/v4/4e/c6/80/4ec680c3-78b5-7888-b9bf-9f662c039021/113992.jpg/600x600bb.jpg",duration:198,genres:["Math Rock","Indie"],sources:[{type:"spotify",name:"Spotify",url:"https://open.spotify.com/track/example5",icon:"spotify"}]},{id:"s6",title:"Kié la, tricotées",artist:"Battles",album:"Mirrored",year:2007,coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/00/93/01/009301a8-ee08-50a9-25d4-f31e6e8d4a10/mzi.jfnvclpy.jpg/600x600bb.jpg",duration:427,genres:["Math Rock","Experimental"],sources:[{type:"spotify",name:"Spotify",url:"https://open.spotify.com/track/example6",icon:"spotify"}]},{id:"s7",title:"Delivering the Groceries at 138 Beats Per Minute",artist:"Don Caballero",album:"American Don",year:2e3,coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Music20/v4/4d/76/68/4d766801-c391-450d-521b-8a80d829c7f6/cover.jpg/600x600bb.jpg",duration:334,genres:["Math Rock","Instrumental"],sources:[{type:"bandcamp",name:"Bandcamp",url:"https://doncaballero.bandcamp.com",icon:"bandcamp"}]},{id:"s8",title:"Frozen Zoo",artist:"Tera Melos",album:"Untitled",year:2005,coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Music221/v4/bf/af/37/bfaf3751-e991-b205-82ad-524a74136d74/114135.jpg/600x600bb.jpg",duration:189,genres:["Math Rock","Noise Rock"],sources:[{type:"spotify",name:"Spotify",url:"https://open.spotify.com/track/example8",icon:"spotify"}]},{id:"s9",title:"Solid Ground",artist:"Maps & Atlases",album:"Trees, Swallows, Houses",year:2006,coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Music4/v4/2c/4d/a7/2c4da769-6d8c-c498-10d3-264aa0ae1757/885686094808.jpg/600x600bb.jpg",duration:256,genres:["Math Rock","Indie"],sources:[{type:"spotify",name:"Spotify",url:"https://open.spotify.com/track/example9",icon:"spotify"}]},{id:"s10",title:"Atlas",artist:"Polyphia",album:"Muse",year:2014,coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Music125/v4/10/ca/85/10ca8598-27aa-23d5-286d-2694e25e1d57/859738995726_cover.jpg/600x600bb.jpg",duration:245,genres:["Math Rock","Progressive"],sources:[{type:"spotify",name:"Spotify",url:"https://open.spotify.com/track/example10",icon:"spotify"}]},{id:"s11",title:"G.O.A.T.",artist:"Polyphia",album:"New Levels New Devils",year:2018,coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/57/5c/00/575c009a-6d69-6ac4-7c91-7e307d920279/794558040969.jpg/600x600bb.jpg",duration:203,genres:["Math Rock","Progressive"],sources:[{type:"youtube",name:"YouTube",url:"https://youtube.com/watch?v=goat",icon:"youtube"}]},{id:"s12",title:"Electric Sunrise",artist:"Plini",album:"Handmade Cities",year:2016,coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Music115/v4/f5/0f/6b/f50f6bb3-2e91-d365-df84-49078b627590/11689.jpg/600x600bb.jpg",duration:284,genres:["Progressive","Instrumental"],sources:[{type:"bandcamp",name:"Bandcamp",url:"https://plini.bandcamp.com",icon:"bandcamp"}]},{id:"s13",title:"The Number of the Beast",artist:"Iron Maiden",album:"The Number of the Beast",year:1982,coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/b4/37/6c/b4376c0d-5647-dfb0-d7f1-d18b73e0f9c5/4050538293227.jpg/600x600bb.jpg",duration:289,genres:["Heavy Metal","NWOBHM"],sources:[{type:"spotify",name:"Spotify",url:"https://open.spotify.com/track/example13",icon:"spotify"}]},{id:"s14",title:"Value 4 Value",artist:"Ainsley Costello",album:"Lightning Sessions",year:2023,coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Music116/v4/d5/68/47/d56847ce-fe3f-7903-0373-de3e4aeebab0/195729402522_cover.jpg/600x600bb.jpg",duration:195,genres:["Folk","Bitcoin"],sources:[{type:"wavlake",name:"Wavlake",url:"https://wavlake.com/track/v4v",icon:"wavlake"}]},{id:"s15",title:"Bitcoin Thunder",artist:"Mandrik",album:"Orange Pill",year:2022,coverUrl:void 0,duration:178,genres:["Electronic","Bitcoin"],sources:[{type:"wavlake",name:"Wavlake",url:"https://wavlake.com/track/thunder",icon:"wavlake"}]},{id:"s16",title:"Lateralus",artist:"Tool",album:"Lateralus",year:2001,coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Music113/v4/fb/99/8c/fb998c1e-1a11-2434-0fa7-0d90beba5d2b/886447824764.jpg/600x600bb.jpg",duration:563,genres:["Progressive Metal","Art Rock"],sources:[{type:"spotify",name:"Spotify",url:"https://open.spotify.com/track/example16",icon:"spotify"}]},{id:"s17",title:"Teardrop",artist:"Massive Attack",album:"Mezzanine",year:1998,coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Music115/v4/0a/98/55/0a98555b-8d9d-3b46-660a-b91261557d17/00724384559953.rgb.jpg/600x600bb.jpg",duration:323,genres:["Trip Hop","Electronic"],sources:[{type:"spotify",name:"Spotify",url:"https://open.spotify.com/track/example17",icon:"spotify"}]},{id:"s18",title:"Windowlicker",artist:"Aphex Twin",album:"Windowlicker EP",year:1999,coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Music123/v4/81/20/73/812073f2-c437-fd1d-636d-6be5a4432747/0801061910532.png/600x600bb.jpg",duration:371,genres:["IDM","Electronic"],sources:[{type:"bandcamp",name:"Bandcamp",url:"https://aphextwin.bandcamp.com",icon:"bandcamp"}]},{id:"s19",title:"Schism",artist:"Tool",album:"Lateralus",year:2001,coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Music113/v4/fb/99/8c/fb998c1e-1a11-2434-0fa7-0d90beba5d2b/886447824764.jpg/600x600bb.jpg",duration:399,genres:["Progressive Metal"],sources:[{type:"spotify",name:"Spotify",url:"https://open.spotify.com/track/example19",icon:"spotify"}]},{id:"s20",title:"Flim",artist:"Aphex Twin",album:"Come to Daddy EP",year:1997,coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Music211/v4/bf/0b/a5/bf0ba54c-1c9b-d812-2ccf-54d137dc81ae/ticket.qknfmwov.png/600x600bb.jpg",duration:170,genres:["IDM","Ambient"],sources:[{type:"bandcamp",name:"Bandcamp",url:"https://aphextwin.bandcamp.com",icon:"bandcamp"}]},{id:"s21",title:"Bitcoin is Dead",artist:"HODL Band",album:"Stack Sats",year:2024,coverUrl:void 0,duration:212,genres:["Rock","Bitcoin"],sources:[{type:"wavlake",name:"Wavlake",url:"https://wavlake.com/track/dead",icon:"wavlake"}]}],rs=[{id:"p1",title:"What Bitcoin Did",host:"Peter McCormack",description:"Interview-based podcast exploring Bitcoin, freedom, and the future of money.",coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Podcasts221/v4/fb/ff/bb/fbffbba3-1a5b-0759-fa35-cafc42f214c9/mza_4444412895211887709.jpg/600x600bb.jpg",year:2018,episodeCount:400,genres:["Bitcoin","Finance","Tech"],sources:[{type:"fountain",name:"Fountain",url:"https://fountain.fm/show/whatbitcoindid",icon:"⚡"},{type:"podcastindex",name:"Podcast Index",url:"https://podcastindex.org/podcast/123456",icon:"📻"},{type:"youtube",name:"YouTube",url:"https://youtube.com/@WhatBitcoinDid",icon:"▶️"},{type:"rss",name:"RSS",url:"https://www.whatbitcoindid.com/podcast?format=rss",icon:"📡"}]},{id:"p2",title:"The Audacity to Podcast",host:"Daniel J. Lewis",description:"Podcasting tips, strategies, and news. Podcasting 2.0 focused.",coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Podcasts123/v4/7a/b6/84/7ab6843a-3f8a-f3b6-772e-74904aeb1fa1/mza_5013277301801181914.png/600x600bb.jpg",year:2010,episodeCount:500,genres:["Podcasting","Tech","How-To"],sources:[{type:"fountain",name:"Fountain",url:"https://fountain.fm/show/1I7TKhOPXJz9MDhG5gqh",icon:"⚡"},{type:"youtube",name:"YouTube",url:"https://youtube.com/@audacitytopodcast",icon:"▶️"},{type:"castopod",name:"Castopod",url:"https://castopod.example/audacity",icon:"🦣"}]},{id:"p3",title:"Tales from the Crypt",host:"Marty Bent",description:"Bitcoin, Austrian economics, and the importance of sound money.",coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Podcasts221/v4/84/cd/73/84cd73e4-eddb-d7f6-a777-875efb65b924/mza_15569173368189135395.jpg/600x600bb.jpg",year:2017,episodeCount:300,genres:["Bitcoin","Economics","Finance"],sources:[{type:"fountain",name:"Fountain",url:"https://fountain.fm/show/talesfromthecrypt",icon:"⚡"},{type:"odysee",name:"Odysee",url:"https://odysee.com/@tftc",icon:"🔗"},{type:"rumble",name:"Rumble",url:"https://rumble.com/c/tftc",icon:"📺"},{type:"youtube",name:"YouTube",url:"https://youtube.com/@TalesFromTheCrypt",icon:"▶️"}]},{id:"p4",title:"Stephan Livera Podcast",host:"Stephan Livera",description:"Bitcoin, Lightning Network, and sovereign individual topics.",coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Podcasts113/v4/ed/fb/80/edfb8088-08fb-adfc-3a0e-89a216d0cb0a/mza_546663195369372323.jpg/600x600bb.jpg",year:2018,episodeCount:450,genres:["Bitcoin","Lightning","Tech"],sources:[{type:"fountain",name:"Fountain",url:"https://fountain.fm/show/stephanlivera",icon:"⚡"},{type:"podcastindex",name:"Podcast Index",url:"https://podcastindex.org/podcast/789012",icon:"📻"},{type:"podverse",name:"Podverse",url:"https://podverse.fm/podcast/stephan-livera",icon:"🎧"},{type:"rss",name:"RSS",url:"https://stephanlivera.com/feed/",icon:"📡"}]},{id:"p5",title:"Hell Money",host:"Brittany Kaiser & Patrick Wood",description:"Investigative podcast on financial crime, surveillance, and control systems.",coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Podcasts112/v4/dd/00/4a/dd004ad9-a2b5-d905-59f9-761309118e47/mza_8872129051801444337.jpg/600x600bb.jpg",year:2022,episodeCount:80,genres:["True Crime","Finance","Investigative"],sources:[{type:"rumble",name:"Rumble",url:"https://rumble.com/c/hellmoney",icon:"📺"},{type:"youtube",name:"YouTube",url:"https://youtube.com/@HellMoney",icon:"▶️"},{type:"odysee",name:"Odysee",url:"https://odysee.com/@HellMoney",icon:"🔗"}]},{id:"p6",title:"Cypherpunk Bitstream",host:"Brandon Zemp",description:"Decentralization, privacy tech, and cypherpunk philosophy.",coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Podcasts125/v4/82/70/44/827044a2-cabb-f681-00e7-64d2e02fff13/mza_18243182780759307932.jpg/600x600bb.jpg",year:2020,episodeCount:120,genres:["Privacy","Bitcoin","Decentralization"],sources:[{type:"fountain",name:"Fountain",url:"https://fountain.fm/show/cypherpunkbitstream",icon:"⚡"},{type:"castopod",name:"Castopod",url:"https://castopod.example/cypherpunk",icon:"🦣"},{type:"ipfs",name:"IPFS",url:"ipfs://QmCypherpunkBitstream...",icon:"🌐"},{type:"rss",name:"RSS",url:"https://cypherpunkbitstream.com/feed",icon:"📡"}]},{id:"p7",title:"Bitcoin Audible",host:"Guy Swann",description:"Reading the best in Bitcoin content, one article at a time.",coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Podcasts126/v4/a8/1c/b2/a81cb23a-7aa5-c123-60a1-9e5d0335496b/mza_12623622548899082019.jpg/600x600bb.jpg",year:2017,episodeCount:600,genres:["Bitcoin","Education"],sources:[{type:"fountain",name:"Fountain",url:"https://fountain.fm/show/bitcoinaudible",icon:"⚡"}]},{id:"p8",title:"The Bitcoin Standard Podcast",host:"Saifedean Ammous",description:"Economics, sound money, and the case for Bitcoin.",coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Podcasts221/v4/fc/a5/38/fca5380d-362d-d44c-04f5-df14044e88ac/mza_4951446082004808256.jpg/600x600bb.jpg",year:2019,episodeCount:200,genres:["Bitcoin","Economics"],sources:[{type:"fountain",name:"Fountain",url:"https://fountain.fm/show/tbs",icon:"⚡"}]},{id:"p9",title:"Bitcoin Explained",host:"Aaron van Wirdum & Sjors Provoost",description:"Technical explanations of Bitcoin protocol developments.",coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Podcasts116/v4/1a/7b/d2/1a7bd297-e8c8-bf51-860e-fd36a788242a/mza_14220953861479257188.jpg/600x600bb.jpg",year:2020,episodeCount:150,genres:["Bitcoin","Technology"],sources:[{type:"rss",name:"RSS",url:"https://bitcoinexplained.com/feed",icon:"📡"}]},{id:"p10",title:"Nostr Talks",host:"The Nostr Community",description:"Discussions about the Nostr protocol, clients, and ecosystem.",coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Podcasts211/v4/aa/3e/7b/aa3e7b40-7546-aa17-9695-6cdc506cdc10/mza_15889741860915228164.jpeg/600x600bb.jpg",year:2023,episodeCount:60,genres:["Nostr","Decentralization","Tech"],sources:[{type:"fountain",name:"Fountain",url:"https://fountain.fm/show/nostrtalks",icon:"⚡"}]},{id:"p11",title:"Lex Fridman Podcast",host:"Lex Fridman",description:"Conversations about the nature of intelligence, consciousness, love, and power.",coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Podcasts115/v4/3e/e3/9c/3ee39c89-de08-47a6-7f3d-3849cef6d255/mza_16657851278549137484.png/600x600bb.jpg",year:2018,episodeCount:420,genres:["Science","Technology","Philosophy"],sources:[{type:"youtube",name:"YouTube",url:"https://youtube.com/@lexfridman",icon:"▶️"}]},{id:"p12",title:"Darknet Diaries",host:"Jack Rhysider",description:"True stories from the dark side of the Internet.",coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Podcasts122/v4/3a/80/a7/3a80a7db-5620-f77b-9935-016e61cc2fbc/mza_9399859904175514567.jpg/600x600bb.jpg",year:2017,episodeCount:160,genres:["Cybersecurity","True Crime","Technology"],sources:[{type:"fountain",name:"Fountain",url:"https://fountain.fm/show/darknetdiaries",icon:"⚡"}]},{id:"p13",title:"The Investors Podcast",host:"Preston Pysh & Stig Brodersen",description:"Value investing, Bitcoin, and financial analysis.",coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Podcasts211/v4/e5/1d/ec/e51decd3-c299-33d3-15dc-cbf732db40ba/mza_7000864012270734067.jpg/600x600bb.jpg",year:2014,episodeCount:700,genres:["Bitcoin","Investing","Finance"],sources:[{type:"fountain",name:"Fountain",url:"https://fountain.fm/show/tip",icon:"⚡"}]},{id:"p14",title:"Rabbit Hole Recap",host:"Matt Odell & Marty Bent",description:"Weekly Bitcoin news and analysis.",coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Podcasts211/v4/f2/e2/17/f2e2177f-46df-8eba-a909-485d182cbde2/mza_8161838611335848412.jpg/600x600bb.jpg",year:2019,episodeCount:250,genres:["Bitcoin","News"],sources:[{type:"fountain",name:"Fountain",url:"https://fountain.fm/show/rhr",icon:"⚡"}]},{id:"p15",title:"Citadel Dispatch",host:"Matt Odell",description:"Interactive Bitcoin discussion with audience participation.",coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Podcasts221/v4/01/bc/59/01bc59a8-83df-55dc-3f7e-b03ad6180d21/mza_16016917205334564904.jpeg/600x600bb.jpg",year:2021,episodeCount:130,genres:["Bitcoin","Privacy","Open Source"],sources:[{type:"fountain",name:"Fountain",url:"https://fountain.fm/show/citadeldispatch",icon:"⚡"},{type:"youtube",name:"YouTube",url:"https://youtube.com/@citadeldispatch",icon:"▶️"}]},{id:"p16",title:"Hardcore History",host:"Dan Carlin",description:"Deep dives into the hardest core history topics.",coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Podcasts115/v4/49/b7/eb/49b7eb32-8f08-6fac-aadb-2f002131fe5f/mza_15196161972010256532.jpg/600x600bb.jpg",year:2006,episodeCount:70,genres:["History","Education"],sources:[{type:"rss",name:"RSS",url:"https://dchhaddendum.libsyn.com/rss",icon:"📡"}]},{id:"p17",title:"The Changelog",host:"Adam Stacoviak & Jerod Santo",description:"Conversations with the hackers, leaders, and innovators of open source.",coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Podcasts123/v4/b5/b1/43/b5b14333-7cbe-123d-c444-0204e5d08102/mza_311421542997449775.png/600x600bb.jpg",year:2009,episodeCount:600,genres:["Open Source","Technology","Programming"],sources:[{type:"rss",name:"RSS",url:"https://changelog.com/podcast/feed",icon:"📡"}]},{id:"p18",title:"Once BITten!",host:"Daniel Prince",description:"Bitcoin, philosophy, and the orange pill journey.",coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Podcasts211/v4/a8/2f/36/a82f3675-c69d-b076-9fbe-eb6e7d69c5a8/mza_2824796342334185417.jpg/600x600bb.jpg",year:2019,episodeCount:350,genres:["Bitcoin","Philosophy"],sources:[{type:"fountain",name:"Fountain",url:"https://fountain.fm/show/oncebitten",icon:"⚡"}]},{id:"p19",title:"Bitcoin Fundamentals",host:"Preston Pysh",description:"Understanding Bitcoin from first principles.",coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Podcasts211/v4/e5/1d/ec/e51decd3-c299-33d3-15dc-cbf732db40ba/mza_7000864012270734067.jpg/600x600bb.jpg",year:2020,episodeCount:180,genres:["Bitcoin","Education","Finance"],sources:[{type:"fountain",name:"Fountain",url:"https://fountain.fm/show/btcfundamentals",icon:"⚡"}]},{id:"p20",title:"Opt Out Podcast",host:"Seth For Privacy",description:"Privacy tools, techniques, and philosophy for everyone.",coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Podcasts221/v4/92/9a/27/929a27d3-bc84-fad6-052e-8e112e3e439d/mza_947152063232700697.jpg/600x600bb.jpg",year:2021,episodeCount:90,genres:["Privacy","Technology","Security"],sources:[{type:"fountain",name:"Fountain",url:"https://fountain.fm/show/optout",icon:"⚡"},{type:"rss",name:"RSS",url:"https://optoutpod.com/feed",icon:"📡"}]},{id:"p21",title:"Bitcoin Review",host:"NVK & community",description:"Technical Bitcoin development review and discussion.",coverUrl:"https://is1-ssl.mzstatic.com/image/thumb/Podcasts221/v4/9d/d9/60/9dd96097-725b-be30-4541-90f2e85c6f55/mza_11769037187183507672.jpg/600x600bb.jpg",year:2022,episodeCount:75,genres:["Bitcoin","Development","Open Source"],sources:[{type:"fountain",name:"Fountain",url:"https://fountain.fm/show/bitcoinreview",icon:"⚡"}]}],lr="/aiui/",cr=`${lr}api/claude/v1/messages`,Oi=`${lr}api/openrouter`,qi=Wt.map(e=>`- [${e.id}] "${e.title}" (${e.year}) dir. ${e.director} | ${e.genres.join(", ")} | ${e.rating}/10 | On: ${e.sources.map(t=>t.type).join(", ")}`).join(` -`),Hi=An.map(e=>`- [${e.id}] "${e.title}" by ${e.artist}${e.album?` (${e.album})`:""}${e.year?` (${e.year})`:""} | ${(e.genres??[]).join(", ")} | On: ${(e.sources??[]).map(t=>t.type).join(", ")}`).join(` -`),Wi=rs.map(e=>`- [${e.id}] "${e.title}" by ${e.host??"Unknown"}${e.year?` (${e.year})`:""} | ${(e.genres??[]).join(", ")} | On: ${e.sources.map(t=>t.type).join(", ")}`).join(` -`),Qn=k([]);let Ou=0;const Vi=1800*1e3;async function qu(){if(!(Date.now()-Ou0))try{const t=await Xe("/aiui/api/music/rankings?days=30&limit=40");if(!t.ok)return;const n=await t.json();Array.isArray(n)&&(Qn.value=n.map(s=>({title:s.title,artist:s.artist,albumTitle:s.albumTitle,duration:s.duration})),Ou=Date.now())}catch{}}function Gi(){return Qn.value.length===0?"":` - -**Wavlake trending tracks** (these are confirmed playable — prefer recommending from this list when relevant): -${Qn.value.map(t=>`- "${t.title}" by ${t.artist}${t.albumTitle?` (${t.albumTitle})`:""}`).join(` -`)}`}const Ki=`You are AIUI, a helpful AI assistant with access to the user's media library (films, songs, and podcasts). - -**News/Factual queries:** When the user asks for "news", "latest", "recent", or current information, lead with a direct answer summarizing the news/facts. You MAY add "For deeper coverage:" with [[podcast_ext:...]] tags only. Do NOT use [[song_ext:...]] or [[film_ext:...]] for news queries—podcasts are the appropriate follow-up. Never substitute an answer with only recommendations. - -**Films:** When recommending or discussing films from the user's library, use [[film:ID]] where ID is the film's id. For films NOT in the library, use [[film_ext:Title|Year|Director]], e.g. [[film_ext:Brokeback Mountain|2005|Ang Lee]]. Write a brief reason why the film is worth watching on the same line as the tag. - -**Songs:** When recommending or discussing songs, ALWAYS use tags for every song you mention: -- Library songs: [[song:ID]] where ID is the song's id (e.g. [[song:s1]]). -- Other songs: [[song_ext:Title|Artist|Year]] (year optional), e.g. [[song_ext:Never Meant|American Football|1999]]. -Never list songs in plain text only—each recommendation must have a tag so the UI can show playable cards. - -**Podcasts:** When recommending or discussing podcasts, use tags: -- Library podcasts: [[podcast:ID]] where ID is the podcast's id (e.g. [[podcast:p1]]). -- Other podcasts: [[podcast_ext:Title|Host|Year]] (year optional), e.g. [[podcast_ext:What Bitcoin Did|Peter McCormack|2018]]. -Prioritize Podcasting 2.0–friendly platforms: Fountain.fm, Podcast Index, Castopod, Odysee, Rumble, YouTube, Podverse. - -**Books:** When recommending or discussing books, use [[book_ext:Title|Author|Year]], e.g. [[book_ext:Neuromancer|William Gibson|1984]]. Write a brief reason why the book is worth reading on the same line. - -**TV Series:** When recommending or discussing TV series/shows, use [[tv_ext:Title|Year|Creator]], e.g. [[tv_ext:Breaking Bad|2008|Vince Gilligan]]. Do NOT use [[film_ext:...]] for TV series — use [[tv_ext:...]] instead. Write a brief reason why the show is worth watching on the same line. - -**Places/Restaurants:** When recommending restaurants, cafes, bars, or other places to visit, use [[place_ext:Name|Cuisine|City|Rating|PriceLevel|Address]], e.g. [[place_ext:Sushi Nakazawa|Japanese|New York|4.7|3|23 Commerce St]]. Rating is out of 5, PriceLevel is 1-4 ($ to $$$$). Omit fields you don't know. Write a brief description on the same line. - -**Websites / "Best places to check":** When listing resources, places to check online, or websites for the user to visit, use markdown links: [Name](https://full-url). For simple domains use **Name** (domain.com), e.g. **Bitcoin Mailing List** (gnusha.org). - -**Music discovery:** All music plays from **Wavlake** — a Lightning-powered, Nostr-native music platform. When recommending songs, prefer tracks from the Wavlake trending list (provided below) since those are confirmed playable. For genre requests, use [[song_ext:Title|Artist]] tags — the UI will search Wavlake automatically. Songs not on Wavlake won't play, so stick to Wavlake artists when you can. The user can zap (tip) artists with Lightning directly through the platform. - -Always include these tags so the UI can render rich cards. Write a brief reason why each is worth checking out. - -The user's film library: -${qi} - -The user's song library: -${Hi} - -The user's podcast library: -${Wi}`,Zn=k("claude"),xt=k("claude-haiku-4.5"),dr=A(()=>{const e=[{id:"claude",name:"Claude (Max)",models:[{id:"claude-haiku-4.5",name:"Claude 4.5 Haiku"},{id:"claude-sonnet-4",name:"Claude Sonnet 4"},{id:"claude-opus-4",name:"Claude Opus 4"}]}];return e.push({id:"openrouter",name:"OpenRouter",models:[{id:"meta-llama/llama-4-maverick",name:"Llama 4 Maverick"},{id:"qwen/qwen3-235b-a22b-thinking-2507",name:"Qwen3 235B Thinking"},{id:"mistralai/mistral-small-3.1-24b-instruct:free",name:"Mistral Small 3.1 (free)"},{id:"google/gemma-3-27b-it:free",name:"Gemma 3 27B (free)"}]}),e.push({id:"mock",name:"Local (no API)",models:[{id:"echo",name:"Echo (mirror input)"}]}),e});function Ji(e){Zn.value=e;const t=dr.value.find(n=>n.id===e);t&&t.models.length>0&&(xt.value=t.models[0].id)}function Zi(e){xt.value=e}function Yi(e){const t=e.content||"...";if(!e.images||e.images.length===0)return t;const n=[];for(const s of e.images)n.push({type:"image",source:{type:"base64",media_type:s.mediaType,data:s.data}});return n.push({type:"text",text:t}),n}function Hu(e){const t=[];for(const n of e){const s=n.content&&n.content.trim().length>0?n.content:"...",u={role:n.role,content:s,images:n.images};if(t.length>0&&t[t.length-1].role===u.role){const o=t[t.length-1];o.content=o.content+` -`+u.content,u.images&&u.images.length>0&&(o.images=[...o.images??[],...u.images])}else t.push(u)}return t}async function su(e,t,n){const s=e.filter(o=>o.role==="user").pop(),u=s?`You said: "${s.content}" - -This is AIUI in echo mode. Select Claude or OpenRouter from the model picker.`:"Hello! I am AIUI running in mock mode.";for(const o of u){if(n?.aborted)return;t(o),await new Promise(r=>setTimeout(r,12))}}async function uu(e,t,n,s,u,o,r){const i={"Content-Type":"application/json"},a=Ni();if(a.settings.useOwnApiKey&&a.settings.claudeApiKey)i["x-api-key"]=a.settings.claudeApiKey;else{const h=await bu("claude");h&&(i["x-api-key"]=h)}const l=e.map(h=>({role:h.role,content:Yi(h)})),c={model:xt.value,system:s,messages:l,stream:!0,webSearch:u};r?.temperature!==void 0&&(c.temperature=r.temperature),r?.maxTokens!==void 0&&(c.max_tokens=r.maxTokens),r?.topP!==void 0&&(c.top_p=r.topP),r?.stopSequences&&r.stopSequences.length>0&&(c.stop_sequences=r.stopSequences);const f=await Xe(cr,{method:"POST",headers:i,body:JSON.stringify(c),signal:o});if(!f.ok){const h=await f.text().catch(()=>"Could not read error body");n(`Claude proxy error ${f.status}: ${h}`);return}await fr(f,h=>{try{const b=JSON.parse(h);b.type==="content_block_delta"&&b.delta?.text?t(b.delta.text):b.type==="error"&&n(b.error?.message??"Claude stream error")}catch{}},n,o)}async function ou(e,t,n,s,u){const o=[{role:"system",content:s},...e.map(l=>({role:l.role,content:l.content}))],r={"Content-Type":"application/json","HTTP-Referer":window.location.origin,"X-Title":"AIUI"},i=await bu("openrouter");i&&(r.Authorization=`Bearer ${i}`);const a=await Xe(Oi,{method:"POST",headers:r,body:JSON.stringify({model:xt.value,messages:o,stream:!0}),signal:u});if(!a.ok){const l=await a.text().catch(()=>"Could not read error body");n(`OpenRouter error ${a.status}: ${l}`);return}await fr(a,l=>{if(l!=="[DONE]")try{const f=JSON.parse(l).choices?.[0]?.delta?.content;f&&t(f)}catch{}},n,u)}async function fr(e,t,n,s){const u=e.body?.getReader();if(!u){n("No response body");return}const o=new TextDecoder;let r="";try{for(;;){if(s?.aborted){u.cancel();return}const{done:i,value:a}=await u.read();if(i)break;r+=o.decode(a,{stream:!0});const l=r.split(` -`);r=l.pop()??"";for(const c of l){const f=c.trim();if(!f||!f.startsWith("data: "))continue;const h=f.slice(6);if(h==="[DONE]")return;try{t(h)}catch{}}}}catch(i){if(s?.aborted)return;n(i instanceof Error?i.message:"Stream read error")}finally{u.cancel().catch(()=>{})}}function Wu(e){return e.length===0?"":` - -**Web search results (PRIORITIZE these):** -- Answer the user's question using these results. Cite sources. -- You MAY add [[podcast_ext:...]] or [[film_ext:...]] tags for "to learn more" recommendations after your answer. - -${e.map((n,s)=>{const u=n.content?` — ${n.content.slice(0,200)}${n.content.length>200?"…":""}`:"";return`${s+1}. [${n.title}](${n.url})${u}`}).join(` -`)}`}function Vu(e){let t=Ki;const n=e.activeConversation?.personaId;if(n){const i=xu().getPersona(n);i?.systemPrompt&&(t=i.systemPrompt+` - -`+t)}t+=Gi();const s=ir();t+=s.buildMemoryContext(),e.webSearchEnabled&&(t+=` -**Web search:** You have access to WebSearch and WebFetch tools. Use them to look up current information, news, and facts when the user asks. You can search the web and fetch page content. Web search is enabled for this session—do not tell the user it is unavailable.`);const u=di();t+=u.buildArchyContext();const o=vu();if(o.isCodeMode.value){const r=[];if(o.activeProject.value&&r.push(`**Active project:** ${o.activeProject.value.name} (${o.activeProject.value.language??"Unknown"})`),o.selectedDesignTokens.value.length>0&&r.push(`**Selected design tokens:** ${o.selectedDesignTokens.value.join(", ")}`),o.selectedFiles.value.length>0&&r.push(`**Selected files:** ${o.selectedFiles.value.join(", ")}`),o.activeFileContent.value&&o.activeFile.value){const i=o.activeFileContent.value.slice(0,2e3);r.push(`**Open file (${o.activeFile.value}):** -\`\`\`${o.activeFileLanguage.value} -${i} -\`\`\``)}r.length>0&&(t+=` - -**Code Context:** -${r.join(` -`)}`)}return t}function Gu(e){const t=e.activeConversation;return t?{temperature:t.temperature,maxTokens:t.maxTokens,topP:t.topP,stopSequences:t.stopSequences}:{}}let at=null;async function Xi(e){const n=wt().conversations.get(e);if(!n||n.messages.length!==2)return;const s=n.messages[0];if(s.role!=="user")return;const u=s.content.slice(0,60)+(s.content.length>60?"...":"");if(n.title===u)try{const o={"Content-Type":"application/json"},r=await bu("claude");r&&(o["x-api-key"]=r);const i=await Xe(cr,{method:"POST",headers:o,body:JSON.stringify({model:"claude-haiku-4.5",system:"You generate very short conversation titles. Respond with ONLY a 3-5 word title, no quotes, no punctuation at the end.",messages:[{role:"user",content:`Title this conversation: "${s.content.slice(0,200)}"`}],max_tokens:20,stream:!1})});if(!i.ok)return;const l=(await i.json())?.content?.[0]?.text?.trim();l&&l.length>0&&l.length<60&&(n.title=l,n.updatedAt=Date.now())}catch{}}async function Qi(e,t,n,s,u,o){const r=n.map(a=>({role:a.role,content:a.content})),i=xt.value;xt.value=t;try{e==="claude"?await uu(r,s,u,"You are a helpful assistant.",!1,o):e==="openrouter"?await ou(r,s,u,"You are a helpful assistant.",o):await su(r,s,o)}finally{xt.value=i}}function pr(){const e=wt();qu();function t(){at&&(at.abort(),at=null),e.isStreaming=!1}async function n(r,i){qu();const a=Zn.value;at=new AbortController;const l=at.signal;let c=e.activeConversationId;c||(c=e.createConversation());const f=c;e.addMessage(f,{role:"user",content:r,images:i&&i.length>0?i:void 0});const h=e.addMessage(f,{role:"assistant",content:""});if(!h)return;e.isStreaming=!0;let b=Vu(e),g=!1;if(e.webSearchEnabled&&r.trim()){const w=await Ru(r);w.length>0?(b+=Wu(w),e.setMessageWebResults(f,h.id,w),g=!0,console.log("[AIUI] Injected",w.length,"web search results into context")):console.warn("[AIUI] Web search enabled but 0 results — proxy will handle search")}const v=e.webSearchEnabled&&!g,E=Hu(e.messages.filter(w=>w.id!==h.id).map(w=>({role:w.role,content:w.content,images:w.images}))),_=w=>e.appendToLastMessage(f,w),y=w=>{console.error(`[AIUI ${a}]`,w),e.appendToLastMessage(f,`⚠ ${w}`)},x=Gu(e);try{a==="claude"?await uu(E,_,y,b,v,l,x):a==="openrouter"?await ou(E,_,y,b,l):await su(E,_,l)}catch(w){if(w instanceof DOMException&&w.name==="AbortError")return;const M=w instanceof Error?w.message:String(w);console.error("[AIUI] Connection error:",w),e.appendToLastMessage(f,` - -⚠ Connection error: ${M}`)}finally{at=null,e.isStreaming=!1}Xi(f)}async function s(r,i){const a=e.activeConversationId;if(!a)return;const l=e.activeConversation;if(!l)return;const c=l.messages.findIndex(f=>f.id===r);c!==-1&&(e.updateMessageContent(a,r,i),e.deleteMessagesAfter(a,c+1),await o())}async function u(){const r=e.activeConversationId;if(!r)return;const i=e.activeConversation;if(!i||i.messages.length===0)return;const a=i.messages.length-1;i.messages[a].role==="assistant"&&e.deleteMessagesAfter(r,a),await o()}async function o(){const r=e.activeConversationId;if(!r)return;const i=e.activeConversation;if(!i||i.messages.length===0)return;const a=[...i.messages].reverse().find(y=>y.role==="user");if(!a)return;const l=Zn.value;at=new AbortController;const c=at.signal,f=r,h=e.addMessage(f,{role:"assistant",content:""});if(!h)return;e.isStreaming=!0;let b=Vu(e);if(e.webSearchEnabled&&a.content.trim()){const y=await Ru(a.content);y.length>0&&(b+=Wu(y),e.setMessageWebResults(f,h.id,y))}const g=Hu(e.messages.filter(y=>y.id!==h.id).map(y=>({role:y.role,content:y.content,images:y.images}))),v=y=>e.appendToLastMessage(f,y),E=y=>{console.error(`[AIUI ${l}]`,y),e.appendToLastMessage(f,`⚠ ${y}`)},_=Gu(e);try{l==="claude"?await uu(g,v,E,b,e.webSearchEnabled,c,_):l==="openrouter"?await ou(g,v,E,b,c):await su(g,v,c)}catch(y){if(y instanceof DOMException&&y.name==="AbortError")return;const x=y instanceof Error?y.message:String(y);e.appendToLastMessage(f,` - -⚠ Connection error: ${x}`)}finally{at=null,e.isStreaming=!1}}return{sendMessage:n,stopGeneration:t,editAndResend:s,regenerateLastResponse:u,activeProvider:Zn,activeModel:xt,availableProviders:dr,setProvider:Ji,setModel:Zi}}async function ea(e){const t=e.filter(n=>typeof n=="string"&&/^https?:\/\//i.test(n.trim())).slice(0,8);if(t.length===0)return[];try{const n=new URLSearchParams;t.forEach(r=>n.append("url",r));const s=await Xe(`/api/rss-articles?${n}`,{signal:AbortSignal.timeout(15e3)});return s.ok?((await s.json()).articles??[]).filter(r=>r.title&&r.url).map(r=>({title:r.title??"",url:r.url??"",content:r.content,imgSrc:r.imgSrc})):[]}catch(n){return console.warn("[AIUI rss]",n),[]}}function $t(e){const t=e.toLowerCase().trim();return t?/\b(news|latest|recent|current|what'?s happening|updates? about|headlines?|breaking|press|media coverage)\b/.test(t)||/what'?s the latest|latest \w+ news/.test(t)||/what are people saying|what'?s the word|what do people think/.test(t)||/what happened (today|this week|recently|yesterday)|any updates? on|what'?s (new|going on)|trending|in the news/i.test(t)||/current events|today'?s top|catch me up|brief me|fill me in/i.test(t):!1}function gt(e){const t=e.toLowerCase();return/for instant .* news|check these sources|for (the )?latest (bitcoin )?news|direct sources/i.test(t)||/(have )?access to (live )?web search|want me to (go back and )?search/i.test(t)||/i can'?t access the web.{0,30}(but|however)|having trouble reaching the web.{0,30}(but|however)|unable to browse.{0,30}(but|however)|can'?t search the web.{0,30}(but|however)/i.test(t)||/here are.{0,20}(reliable|trusted|good) sources|top sources for/i.test(t)}function ta(e){return e?/\b(song|songs|music|track|tracks|playlist|playlists|album|albums|listen|listening|sing|singing|singer|singers|band|bands|artist|artists|rapper|rappers|rap|hip hop|r&b|rock|jazz|classical|edm|electronic|pop music|concert|concerts|vinyl|soundtrack|anthem|beat|beats|melody|melodies|tune|tunes|lyric|lyrics|acoustic|remix|dj|genre|genres|spotify|soundcloud|bandcamp|musician|musicians|composer|composers|orchestra|symphony|punk|metal|reggae|blues|soul|funk|country music|grammys?|billboard|top 40|mixtape|ep\b|lp\b|discography|jam|jams|banger|bangers)\b/i.test(e)||/recommend.*(song|music|track|listen)/i.test(e)||/play\s+(me\s+)?(some|a)\b/i.test(e)||/what genre|favorite (song|music|band|artist|jam|tune)|best (song|album|track|music)/i.test(e):!1}function na(e){const t=e.toLowerCase().trim();return/\b(website|websites|where to check|best places? to check|places? to (look|check|find)|check online|resources?|sources? to (check|read|visit)|links?|urls?|sites?|portals?|platforms? for|tools? for|apps? for|services? for)\b/.test(t)||/where (can i|should i) (check|look|find|go|visit|browse)/.test(t)||/point me to|direct me to|link me|send me (to|a link|some links)|any good (sites|resources|tools|platforms)/i.test(t)}function sa(e){return/\b(book|books|read|reading|novel|novels|author|authors|nonfiction|non-fiction|recommend.*read|must.read|literature|memoir|memoirs|biography|biographies|autobiography|paperback|hardcover|kindle|audible|audiobook|audiobooks|bookshelf|bestseller|bestsellers|goodreads|epub)\b/i.test(e)||/what should i read|favorite reads?|reading list|book club|book recommendation|suggest.*book|what.*worth reading|good reads?|anything to read|currently reading/i.test(e)}function ua(e){return/\b(novel|author|pages?|ISBN|published|bestsell|literary|fiction|nonfiction|book)\b/i.test(e)&&(e.match(/\bby\s+[A-Z]/g)?.length??0)>=1}function es(e){return/\b(tv\b|tv shows?|tv series|series|television|streaming|binge|watch|recommend.*shows?|best shows?|seasons?|netflix|hbo|hulu|disney\+?|apple tv|amazon prime|peacock|paramount\+?|showtime|miniseries|docuseries|sitcom|drama series|limited series|pilot|showrunner|renewed|cancelled|premiere)\b/i.test(e)||/what'?s good on|anything to (binge|watch)|what should (i|we) (watch|stream)|good (shows?|series) to|new (shows?|series)|best (shows?|series)|recommend.*(shows?|series|watch)/i.test(e)}function oa(e){return/\b(image|images|photo|photos|picture|pictures|screenshot|screenshots|gallery|artwork|illustration|visual|infographic|diagram|chart)\b/i.test(e)}function Ku(e){return/\b(restaurant|restaurants|place|places|food|eat|eating|dining|cafe|cafes|bar|bars|pub|pubs|brunch|lunch|dinner|bistro|pizza|pizzeria|sushi|ramen|tacos|burger|bakery|deli|steakhouse|where to eat|good food|best food|where should i eat|recommend.*eat|recommend.*restaurant|recommend.*place|hungry|starving|takeout|take-?out|delivery|reservation|reservations|michelin|yelp|zagat|foodie|gastropub|tapas|dim sum|bbq|barbecue|food truck|brewery|winery|cocktail bar|speakeasy|rooftop bar|happy hour)\b/i.test(e)||/where.*(eat|food|drink|grab|dine)|best.*(brunch|lunch|dinner|food|restaurant|eat|spot)|good.*(food|restaurant|eat|spot)|what'?s good to eat/i.test(e)}function ra(e){return/\b(restaurant|cuisine|menu|reserv|dining|address|open|hours|price range|\$\$|\$\$\$|michelin|yelp|rating)\b/i.test(e)&&(e.match(/\b(?:restaurant|cafe|bar|bistro|pub|pizzeria|bakery|deli|steakhouse|grill)\b/gi)?.length??0)>=2}function ia(e){return e?/\b(recipe|recipes|cook|cooking|bake|baking|meal|meals|dish|dishes|ingredient|ingredients|how to make|how to cook|how to bake)\b/i.test(e)||/make me a|cook me|bake me|recipe for|what can i (make|cook|bake)|meal prep|meal plan/i.test(e):!1}function Ju(e){return/=3}function vn(e){return e?/\b(nostr|npub[a-z0-9]{8,}|nip-?\d+|damus|primal|snort|amethyst|coracle|iris|nos\.social|zaps?\b|relays?\b|naddr|nevent|nprofile|note1[a-z0-9]+|nostrich|fiatjaf)\b/i.test(e)||/\b(social media|social network|social protocol)\b.*\b(decentrali|censorship|relay|open)\b/i.test(e)||/decentralized social|censorship.resistant.*(social|network|protocol)/i.test(e):!1}function Yu(e){return/\bnostr\b/i.test(e)?!0:[/\bnpub[a-z0-9]{8,}\b/i,/\bnip-?\d+\b/i,/\b(damus|primal|snort|amethyst|coracle|iris|nos\.social|nostrudel)\b/i,/\b(relay|relays)\b.*\b(wss?:\/\/|connect|publish)\b/i,/\bzaps?\b.*\b(lightning|sats|send)\b/i,/\bnote1[a-z0-9]+\b/i,/\bnevent[a-z0-9]+\b/i,/\bnprofile[a-z0-9]+\b/i,/\bnostrich\b/i,/\bfiatjaf\b/i].filter(n=>n.test(e)).length>=2}function yu(e){return e?/\b(app|apps|application|applications|client|clients|wallet|wallets|tool|tools|software|download|install)\b/i.test(e)&&/\b(best|good|recommend|suggest|which|what|top|favorite|popular|use|try|need)\b/i.test(e)||/what app|which app|best app|recommend.*app|suggest.*app|best.*client|best.*wallet|recommend.*wallet|recommend.*tool/i.test(e)||/what.*(use|download|install) for|how (do i|to) (use|get|install|set up)/i.test(e):!1}function Ps(e){const t=/\b(what|is|are|the|a|an|latest|recent|current|news|about|for|how|why|when|where|can|could|should|would|tell|me|please|best|good)\b/gi;return e.replace(t," ").replace(/\s+/g," ").trim().slice(0,60)||""}function aa(e){const t=e.toLowerCase().trim();return/\b(film|movie|movies)\b/.test(t)?"film":/\b(song|music|track|album|band|artist|listen)\b/.test(t)?"song":/\b(podcast|episode|show|listen to)\b/.test(t)?"podcast":/\b(book|books|read|reading|novel|author|nonfiction|non-fiction)\b/.test(t)?"book":/\b(tv\b|tv show|tv series|series|television|streaming|binge|watch)\b/.test(t)?"tvshow":/\b(image|images|photo|photos|picture|pictures|screenshot|gallery|artwork|illustration)\b/.test(t)?"image":/\b(restaurant|restaurants|place|places|food|eat|dining|cafe|cafes|bar|bars|pub|pubs|brunch|lunch|dinner|bistro|pizza|pizzeria|sushi|ramen|tacos|burger|bakery|deli|steakhouse|hungry)\b/.test(t)?"place":ia(t)?"recipe":ru(t)?"code":yu(t)?"app":vn(t)?"nostr":$t(t)?"news":na(t)?"websites":null}function Xu(e,t,n,s,u,o,r,i,a,l,c,f,h,b=!1,g=!1){const v=e.toLowerCase().trim(),E=aa(e),_=[];t&&_.push("film"),u&&_.push("book"),o&&_.push("tvshow"),r&&_.push("image"),i&&_.push("place"),g&&_.push("recipe"),n&&_.push("song"),s&&_.push("podcast"),b&&_.push("code"),h&&_.push("app"),c&&_.push("magazine"),a&&_.push("news"),l&&_.push("websites"),f&&_.push("nostr");const y=x=>{const w=x.filter(P=>_.includes(P)),M=_.filter(P=>!w.includes(P));return[...w,...M]};if(vn(v))return y(["nostr","app","magazine","websites"]);if(yu(v)){const x=y(["app","nostr","magazine","websites"]);return x.length>0?x:f?["nostr"]:[]}if($t(v))return y(["magazine","news","websites","podcast"]);if(c&&_.length===1)return["magazine"];if(l&&_.length===1)return["websites"];if(E&&_.includes(E)){const x=_.filter(w=>w!==E);return[E,...x]}return _}const Qu=[{id:"damus",name:"Damus",description:"Native iOS Nostr client with Lightning zaps",longDescription:"Damus is the premier Nostr client for iOS. It provides a Twitter-like experience on the Nostr protocol with native Lightning Network integration for zaps (tips). Features include relay management, DMs, profile customization, and a smooth native UI.",category:"nostr-client",platforms:["ios"],url:"https://damus.io",keywords:["damus","damus.io","damus app"],howTo:["Download Damus from the App Store","Create a new Nostr identity or import your nsec key","Add relays (defaults are provided)","Follow people by their npub or NIP-05 address","Connect a Lightning wallet for zaps"],relatedApps:["primal","amethyst","snort"]},{id:"primal",name:"Primal",description:"Fast Nostr client with built-in wallet and caching",longDescription:"Primal is a high-performance Nostr client available on iOS, Android, and web. It features a built-in Lightning wallet (via Primal Wallet), advanced search and discovery through its caching layer, and a polished social media experience. The caching infrastructure makes it one of the fastest Nostr clients.",category:"nostr-client",platforms:["ios","android","web"],url:"https://primal.net",keywords:["primal","primal.net","primal app","primal wallet"],howTo:["Visit primal.net or download the mobile app","Create a new account or log in with your nsec/extension","Set up your Primal Wallet for sending and receiving zaps","Explore trending content and follow accounts"],relatedApps:["damus","snort","alby"]},{id:"snort",name:"Snort",description:"Clean web-based Nostr client",longDescription:"Snort is a web-based Nostr client with a clean, minimal interface. It supports NIP-07 browser extensions for key management, Lightning zaps, image/video uploads, and relay management. Great for users who prefer a browser-based experience.",category:"nostr-client",platforms:["web"],url:"https://snort.social",keywords:["snort","snort.social"],howTo:["Visit snort.social in your browser","Install a NIP-07 extension (like nos2x or Alby) for key management","Create or import your Nostr identity","Configure relays and start posting"],relatedApps:["primal","damus","alby"]},{id:"amethyst",name:"Amethyst",description:"Feature-rich Android Nostr client",longDescription:"Amethyst is the most popular Nostr client for Android. It supports a wide range of NIPs including long-form content, communities, live streams, and marketplace features. Deep Lightning integration for zaps and a highly customizable interface.",category:"nostr-client",platforms:["android"],url:"https://github.com/vitorpamplona/amethyst",keywords:["amethyst","amethyst nostr","amethyst app"],howTo:["Install from Google Play Store or F-Droid","Create a new keypair or import existing nsec","Configure your relay list","Connect a Lightning wallet for zaps"],relatedApps:["damus","primal","snort"]},{id:"coracle",name:"Coracle",description:"Relay-focused web Nostr client",longDescription:"Coracle is a web-based Nostr client that puts relay management front and center. It features excellent relay discovery, community-based feeds, and a focus on the social graph. Built with privacy and decentralization principles in mind.",category:"nostr-client",platforms:["web"],url:"https://coracle.social",keywords:["coracle","coracle.social"],relatedApps:["snort","nostrudel"]},{id:"iris",name:"Iris",description:"Nostr client with built-in key management",longDescription:"Iris is a Nostr client that focuses on ease of use with built-in key management. Available on web and as a desktop app. Features include DMs, profile management, and a clean interface.",category:"nostr-client",platforms:["web","desktop"],url:"https://iris.to",keywords:["iris","iris.to","iris nostr"],relatedApps:["snort","primal"]},{id:"nostrudel",name:"noStrudel",description:"Power-user Nostr web client",longDescription:"noStrudel is a feature-packed web client for Nostr power users. It supports a wide range of NIPs, advanced relay management, DVMs (Data Vending Machines), and experimental Nostr features. Great for developers and advanced users.",category:"nostr-client",platforms:["web"],url:"https://nostrudel.ninja",keywords:["nostrudel","nostrudel.ninja","no strudel"],relatedApps:["coracle","snort"]},{id:"phoenix",name:"Phoenix",description:"Non-custodial Lightning wallet by ACINQ",longDescription:"Phoenix is a self-custodial Lightning wallet built by ACINQ (the team behind Eclair). It automatically manages channels and liquidity, making Lightning payments as simple as on-chain transactions. No channel management needed — just send and receive.",category:"lightning-wallet",platforms:["ios","android"],url:"https://phoenix.acinq.co",keywords:["phoenix","phoenix wallet","acinq","phoenix.acinq.co"],howTo:["Download Phoenix from App Store or Play Store","Back up your 12-word seed phrase securely","Receive your first payment — a channel opens automatically","Use for Lightning payments, zaps, and daily spending"],relatedApps:["breez","zeus","mutiny"]},{id:"breez",name:"Breez",description:"Non-custodial Lightning wallet with POS features",longDescription:"Breez is a non-custodial Lightning wallet that doubles as a point-of-sale system for merchants. Features include a built-in podcast player with streaming sats, fiat on-ramps, and seamless channel management via the Breez SDK.",category:"lightning-wallet",platforms:["ios","android"],url:"https://breez.technology",keywords:["breez","breez wallet","breez.technology","breez sdk"],relatedApps:["phoenix","zeus","mutiny"]},{id:"zeus",name:"Zeus",description:"Lightning node management and wallet",longDescription:"Zeus is a mobile Lightning wallet that can connect to your own Lightning node (LND, Core Lightning, or Eclair) or run an embedded node. Full control over channels, routing, and node management from your phone.",category:"lightning-wallet",platforms:["ios","android"],url:"https://zeusln.com",keywords:["zeus","zeus wallet","zeusln","zeus lightning","zeusln.com"],relatedApps:["phoenix","breez"]},{id:"alby",name:"Alby",description:"Lightning browser extension and NIP-07 signer",longDescription:"Alby is a browser extension that brings Lightning payments and Nostr key management to every website. It acts as a NIP-07 signer for Nostr clients and enables one-click Lightning payments across the web. Also offers Alby Hub for self-custodial Lightning.",category:"lightning-wallet",platforms:["web","desktop"],url:"https://getalby.com",keywords:["alby","getalby","alby extension","alby hub","getalby.com","nip-07"],howTo:["Install the Alby browser extension","Create a new Lightning wallet or connect existing one","Use Alby to sign in to Nostr web clients","Send zaps and Lightning payments from any website"],relatedApps:["snort","phoenix","primal"]},{id:"mutiny",name:"Mutiny Wallet",description:"Self-custodial Lightning wallet in the browser",longDescription:"Mutiny is a self-custodial Bitcoin and Lightning wallet that runs entirely in your web browser using WebAssembly. Features Nostr integration, fedimint support, and LSP-managed channels. Privacy-focused with optional Tor support.",category:"lightning-wallet",platforms:["web","ios","android"],url:"https://mutinywallet.com",keywords:["mutiny","mutiny wallet","mutinywallet.com"],relatedApps:["phoenix","breez"]},{id:"wallet-of-satoshi",name:"Wallet of Satoshi",description:"Simple custodial Lightning wallet",longDescription:"Wallet of Satoshi is the easiest way to get started with Lightning. As a custodial wallet, it requires no channel management — just install and start sending/receiving. Great for beginners, though advanced users may prefer self-custodial options.",category:"lightning-wallet",platforms:["ios","android"],url:"https://www.walletofsatoshi.com",keywords:["wallet of satoshi","walletofsatoshi","wos"],relatedApps:["phoenix","breez"]},{id:"sparrow",name:"Sparrow Wallet",description:"Full-featured Bitcoin desktop wallet",longDescription:"Sparrow is the gold standard for Bitcoin desktop wallets. It supports hardware wallets, multisig, coin control, PSBT, and connects to your own node via Electrum. Excellent for privacy-conscious users with features like PayJoin and whirlpool integration.",category:"bitcoin-wallet",platforms:["desktop"],url:"https://sparrowwallet.com",keywords:["sparrow","sparrow wallet","sparrowwallet.com"],howTo:["Download from sparrowwallet.com (verify GPG signature)","Connect to your own Electrum server or use a public one","Create a new wallet or import from hardware wallet","Enable coin control for better privacy"],relatedApps:["bluewallet","nunchuk","coldcard"]},{id:"bluewallet",name:"BlueWallet",description:"Mobile Bitcoin and Lightning wallet",longDescription:"BlueWallet is a popular open-source Bitcoin wallet for iOS and Android. Supports on-chain and Lightning (via LNDHub), multisig vaults, watch-only wallets, and coin control. Clean interface suitable for both beginners and advanced users.",category:"bitcoin-wallet",platforms:["ios","android","desktop"],url:"https://bluewallet.io",keywords:["bluewallet","blue wallet","bluewallet.io"],relatedApps:["sparrow","phoenix"]},{id:"nunchuk",name:"Nunchuk",description:"Collaborative multisig Bitcoin wallet",longDescription:"Nunchuk specializes in collaborative multisig for Bitcoin self-custody. Features include assisted multisig with hardware wallets, inheritance planning, spending policies, and a clean mobile/desktop experience. Ideal for securing larger amounts.",category:"bitcoin-wallet",platforms:["ios","android","desktop"],url:"https://nunchuk.io",keywords:["nunchuk","nunchuk.io","nunchuk wallet"],relatedApps:["sparrow","coldcard"]},{id:"coldcard",name:"Coldcard",description:"Air-gapped Bitcoin hardware signer",longDescription:"Coldcard is a Bitcoin-only hardware signing device focused on security. Features air-gapped operation (via SD card or NFC), duress PINs, dice roll entropy, and PSBT support. The gold standard for cold storage security.",category:"bitcoin-wallet",platforms:["cli"],url:"https://coldcard.com",keywords:["coldcard","coldcard.com","cold card"],relatedApps:["sparrow","nunchuk"]},{id:"simplex-chat",name:"SimpleX Chat",description:"Private messenger with no user IDs",longDescription:"SimpleX Chat is the only messenger that has no user identifiers — not even random numbers. It uses temporary anonymous pairwise addresses for each contact, making metadata analysis extremely difficult. Supports groups, voice, video, and file sharing.",category:"privacy",platforms:["ios","android","desktop","cli"],url:"https://simplex.chat",keywords:["simplex","simplex chat","simplex.chat"],relatedApps:["signal"]},{id:"signal",name:"Signal",description:"End-to-end encrypted messaging",longDescription:"Signal is the industry standard for encrypted messaging. Uses the Signal Protocol for E2E encryption of messages, calls, and video. Open source, no ads, no tracking. Requires a phone number for registration.",category:"privacy",platforms:["ios","android","desktop"],url:"https://signal.org",keywords:["signal","signal.org","signal messenger","signal app"],relatedApps:["simplex-chat"]},{id:"mullvad",name:"Mullvad VPN",description:"Privacy-focused VPN accepting Bitcoin",longDescription:"Mullvad is a VPN service that prioritizes privacy. No email or personal info needed to sign up — just a generated account number. Accepts Bitcoin and cash payments. Open-source clients, WireGuard support, and a strict no-logging policy.",category:"privacy",platforms:["ios","android","desktop","cli"],url:"https://mullvad.net",keywords:["mullvad","mullvad vpn","mullvad.net"]},{id:"start9",name:"Start9",description:"Sovereign computing platform for self-hosting",longDescription:"Start9 (formerly Embassy) is a Linux-based operating system for running a personal server. Self-host Bitcoin Core, Lightning, Nostr relays, and 200+ other services with a simple web UI. True digital sovereignty without command-line knowledge.",category:"node",platforms:["nodeos","desktop"],url:"https://start9.com",keywords:["start9","start9.com","embassy","startos"],howTo:["Purchase a Start9 server or install StartOS on your own hardware","Access the web dashboard from your local network","Install services: Bitcoin Core, LND, Nostr relay, etc.","Configure Tor for remote access"],relatedApps:["umbrel","raspiblitz"]},{id:"umbrel",name:"Umbrel",description:"Personal home server OS with app store",longDescription:"Umbrel is a beautiful OS for running a personal server at home. One-click install for Bitcoin Core, Lightning, Nostr relays, and hundreds of self-hosted apps. Runs on Raspberry Pi or any x86 hardware.",category:"node",platforms:["nodeos","desktop"],url:"https://umbrel.com",keywords:["umbrel","umbrel.com","umbrel os"],relatedApps:["start9","raspiblitz"]},{id:"raspiblitz",name:"RaspiBlitz",description:"DIY Bitcoin/Lightning node for Raspberry Pi",longDescription:"RaspiBlitz is a do-it-yourself Bitcoin and Lightning Network node running on a Raspberry Pi. Features a touchscreen LCD, automated setup scripts, and a focus on education. Great for learning how nodes work hands-on.",category:"node",platforms:["nodeos"],url:"https://raspiblitz.org",keywords:["raspiblitz","raspi blitz","raspiblitz.org"],relatedApps:["start9","umbrel","mynode"]},{id:"mynode",name:"myNode",description:"Easy Bitcoin and Lightning node",longDescription:"myNode provides a simple way to run a Bitcoin and Lightning node. Premium and community editions available. Includes Bitcoin Core, LND, Electrum Server, BTC Pay Server, and other essential services.",category:"node",platforms:["nodeos"],url:"https://mynodebtc.com",keywords:["mynode","mynodebtc","my node"],relatedApps:["start9","umbrel","raspiblitz"]},{id:"ndk",name:"NDK",description:"Nostr Development Kit for building apps",longDescription:"NDK (Nostr Development Kit) is a JavaScript/TypeScript library for building Nostr applications. It handles relay connections, event signing, caching, and subscription management. The most popular framework for Nostr web development.",category:"dev-tool",platforms:["web","desktop","cli"],url:"https://github.com/nostr-dev-kit/ndk",keywords:["ndk","nostr development kit","nostr-dev-kit"],relatedApps:["nostr-tools","nak"]},{id:"nostr-tools",name:"nostr-tools",description:"Low-level Nostr protocol utilities",longDescription:"nostr-tools is a low-level JavaScript library for working with the Nostr protocol. Provides event creation, signing, relay communication, NIP implementations, and key management. Foundation library used by many Nostr clients.",category:"dev-tool",platforms:["web","desktop","cli"],url:"https://github.com/nbd-wtf/nostr-tools",keywords:["nostr-tools","nostr tools"],relatedApps:["ndk","nak"]},{id:"nak",name:"Nak",description:"Nostr CLI tool for power users",longDescription:"Nak is a command-line tool for interacting with Nostr relays. Useful for debugging, testing, and scripting. Can publish events, query relays, decode/encode Nostr identifiers, and manage keys from the terminal.",category:"dev-tool",platforms:["cli"],url:"https://github.com/fiatjaf/nak",keywords:["nak","nak cli","nak nostr"],relatedApps:["ndk","nostr-tools"]}],hr=/\[\[film:(f?\d+)\]\]/gi,wu=/\[\[film_ext:([^|]+)\|(\d{4})\|([^\]]+)\]\]/gi,mr=/\[\[song:(s?\d+)\]\]/gi,gr=/\[\[song_ext:([^|]+)\|([^|]+)(?:\|(\d{4}))?\]\]/gi,br=/\[\[podcast:(p?\d+)\]\]/gi,xr=/\[\[podcast_ext:([^|]+)\|([^|]+)(?:\|(\d{4}))?\]\]/gi,la=/\[\[book:(b?\d+)\]\]/gi,vr=/\[\[book_ext:([^|]+)\|([^|]+)(?:\|(\d{4}))?\]\]/gi,yr=/\[\[tv_ext:([^|]+)\|([^|\]]+)(?:\|([^|\]]+))?\]\]/gi,wr=/\[\[place_ext:([^|]+)\|([^|]*)(?:\|([^|]*))?(?:\|([^|]*))?(?:\|([^|]*))?(?:\|([^|]*))?\]\]/gi,ca=/\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)/g,da=/^https?:\/\//i;function fa(e){const t=/\[([^\]]*)\]\((https?:\/\/[^)]+)\)/.exec(e),n=t?t[2]:/(https?:\/\/[^\s)\]"'<>]+)/.exec(e)?.[1];if(!n?.trim())return;const s=n.trim();if(!(s.length>2048))try{const u=new URL(s);return/^https?:$/i.test(u.protocol)?u.href:void 0}catch{return}}function pa(e){const t=[/(?:analyst|according to)\s+\*{0,2}([A-Z][^*\n]+?)\*{0,2}(?:\s+(?:is|calls?|says?|cited)|\.|,)/,/\bby\s+\*{0,2}([A-Z][a-zA-Z]+(?:\s+[A-Z][a-zA-Z]+)+)\*{0,2}/,/(?:source|—)\s*:?\s*\*{0,2}([A-Z][^*\n]+?)\*{0,2}(?:\s|$|\.|,)/,/\*\*([A-Z][^*]+)\*\*(?:\s+(?:is|calls?|says?|cited|predicts?))/];for(const n of t){const s=n.exec(e);if(s){const u=s[1].trim().slice(0,60);if(u.length>3&&u.length<50)return u}}}function ha(e){const t=/!\[[^\]]*\]\((https?:\/\/[^)]+)\)/.exec(e),n=t?t[1]:/(https?:\/\/[^\s)\]"'<>]+\.(?:jpg|jpeg|png|gif|webp)(?:\?[^\s)\]]*)?)/i.exec(e)?.[1];if(n?.trim())try{const s=new URL(n.trim());return/^https?:$/i.test(s.protocol)?s.href:void 0}catch{return}}function kt(e,t,n){const s=e.lastIndexOf(` -`,t-1),u=s===-1?0:s+1,o=e.indexOf(` -`,t+n),r=o===-1?e.length:o;let i=e.slice(u,r);i=i.replace(e.slice(t,t+n),""),i=i.replace(/\[\[(?:film|song|podcast)(?:_ext)?:[^\]]*\]\]/g,""),i=i.replace(/^\s*[-*•]\s*/,"").replace(/^\s*\d+\.\s*/,""),i=i.replace(/\*\*[^*]+\*\*\s*[-–—:]\s*/,"").replace(/\*\*[^*]+\*\*\s*/,""),i=i.replace(/\*\*/g,"").replace(/\*/g,""),i=i.replace(/\(\d{4}\)\s*/g,""),i=i.replace(/^[\s\-–—:,]+/,"").replace(/[\s\-–—:,]+$/,"");const a=i.trim().slice(0,300);return a.length>=10?a:""}function ts(e){return e.toLowerCase().trim().replace(/\/$/,"")}const ma=2e3;function eo(e){return e.replace(/\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/https?:\/\/\S+/g,"").replace(/\uFE0F/g,"").replace(new RegExp("(?:^|(?<=\\s))[\\p{Emoji_Presentation}\\p{Extended_Pictographic}]+\\s*","gu"),"").replace(/\*\*/g,"").replace(/\*([^*\n]+)\*/g,"$1").replace(/---+/g,"").replace(/^#+\s*/gm,"").replace(/\|/g,", ").replace(/,\s*,+/g,",").replace(/(^|\n)\s*,\s*/g,"$1").replace(/\s*,\s*($|\n)/g,"$1")}function Ye(e,t,n,s,u){const o=eo(t).replace(/\s+/g," ").trim().slice(0,150);let r=eo(n).replace(/\n{3,}/g,` - -`).trim().slice(0,ma);if(o.length<2||r.length<15)return;const i=o.toLowerCase(),a=r.toLowerCase();if(i.length>=10&&a.startsWith(i.slice(0,Math.min(i.length,40)))&&(r=r.slice(o.length).replace(/^[\s.,:;—–-]+/,"").trim(),r.length<15))return;const l=`${o.slice(0,50)}`;if(s.has(l))return;s.add(l);const c=/!\[[^\]]*\]\((https?:\/\/[^)]+)\)/.exec(n)?.[1],f=c?(()=>{try{const h=new URL(c.trim());return/^https?:$/i.test(h.protocol)?h.href:void 0}catch{return}})():void 0;e.push({title:o,content:r,url:fa(n),author:pa(n),imageUrl:f,group:u})}function Pt(e){return e.replace(/\[\[(?:podcast|film|song|book|tvshow|podcast_ext|film_ext|song_ext|book_ext|tv_ext|place_ext|recipe_ext|event_ext):[^\]]*\]\]/g,"").replace(/^\s*\n---\s*\n?/g,"").replace(/\n---\s*$/g,"").replace(/\n{3,}/g,` - -`).trim()}function to(e){const t=[],n=new Set,s=e.replace(/\n+(?:Sources|References|Links):?\s*\n[\s\S]*$/i,"").replace(/\n+\*{0,2}For deeper[^:]*:[\s\S]*$/im,""),u=[],o=/^#{2,3}\s+(.+)$/gm;let r;for(;(r=o.exec(s))!==null;){const b=r[1].trim().replace(/[\p{Emoji_Presentation}\p{Extended_Pictographic}]\uFE0F?\s*/gu,"").replace(/^[#*_\s-]+/,"").trim();b.length>1&&u.push({title:b,start:r.index,contentStart:r.index+r[0].length})}for(let h=0;h_.replace(/^[-•]\s*/,"").trim()).filter(_=>_.length>10);if(E.length>=2)for(const _ of E){const y=Pt(_);if(y.length<15)continue;const x=/^\*\*([^*]+)\*\*\s*[:\u2014\u2013–]\s*(.+)/s.exec(y);if(x)Ye(t,x[1].trim(),x[2].trim(),n,b.title);else{const w=/^([^.!?]{10,80}[.!?])/.exec(y),M=w?w[1]:y.slice(0,60);Ye(t,M,y,n,b.title)}}else Ye(t,b.title,v,n)}const i=/\*\*([^*]+(?:camp| side| view)[^*]*)\*\*[🟠🔴🟢]?\s*\n([\s\S]+?)(?=\n\*\*[^*]+(?:camp| side)[^*]*\*\*|\n#{2,3}\s|\n\nThis is|\n\nFor deeper|$)/gimu;for(;(r=i.exec(s))!==null;){const h=r[1].trim(),b=Pt(r[2]);b.length>15&&Ye(t,h,b,n)}const a=u.length>0?u[0].start:-1,l=a>0?a:s.indexOf(` ---- -`);if(l>0){const h=s.slice(0,l).trim().replace(/^[#*_\s-]+/gm,"").trim();h.length>30&&!n.has("Summary")&&Ye(t,"Summary",h,n)}if(t.length===0){const h=/(?:^|\n)\s*\*\*([^*]+?)\*\*\s*:?\s*(?:\n|$)/g,b=[];for(;(r=h.exec(s))!==null;){const _=r[1].trim(),y=s.slice(Math.max(0,r.index-10),r.index);/\d+\.\s*$/.test(y)||/[-•]\s*$/.test(y)||_.length>2&&_.length<100&&b.push({title:_,start:r.index,end:r.index+r[0].length})}const g=/(?:^|\n)\s*\d+\.\s*\*\*([^*]+)\*\*\s*[-–—:]+\s*/g,v=[];for(;(r=g.exec(s))!==null;){const _=r[1].trim();_.length>1&&v.push({title:_,start:r.index,contentStart:r.index+r[0].length})}let E;if(v.length>0&&b.length>0){const _=v[0].start,y=b.filter(x=>x.end<=_).pop();y&&(E=y.title)}for(let _=0;_=15&&Ye(t,y.title,w,n,E)}if(t.length===0){const _=/(?:^|\n)\s*[-•]\s*\*\*([^*]+)\*\*\s*[-–—:]+\s*/g,y=[];for(;(r=_.exec(s))!==null;){const x=r[1].trim();x.length>1&&y.push({title:x,start:r.index,contentStart:r.index+r[0].length})}for(let x=0;x=15&&Ye(t,w.title,P,n)}}if(t.length===0){const _=/(?:^|\n)\s*\*\*([^*]{3,60})\*\*\s*[-–—:]+\s*([\s\S]*?)(?=\n\s*\*\*[^*]{3,60}\*\*\s*[-–—:]|\n{2,}\*\*[^*]+\*\*\s*:|\s*$)/g;for(;(r=_.exec(s))!==null;){const y=r[1].trim(),x=Pt(r[2].trim());y.length>2&&x.length>=15&&Ye(t,y,x,n)}}if(t.length>0){const _=v.length>0?v[0].start:s.length,y=b.length>0&&b[0].start<_?b[0].start:_,x=Math.min(_,y);if(x>30){const w=s.slice(0,x).replace(/\*\*/g,"").replace(/^[#*_\s-]+/gm,"").trim();w.length>30&&!n.has("Summary")&&Ye(t,"Summary",w,n)}}}const c=/(This is being called[^.]+\.[^"]*"[^"]+"[^.]*\.)/i.exec(s);c&&!n.has("Key")&&Ye(t,"Key takeaway",c[1].trim(),n);const f=["Summary","Key takeaway"];return t.sort((h,b)=>{const g=f.indexOf(h.title),v=f.indexOf(b.title);return g>=0&&v>=0?g-v:g>=0?-1:v>=0?1:0}),t}function ga(e){return ha(e)}function no(e){const t=[],n=new Set,s=/\*\*([^*]+)\*\*\s*\(([a-zA-Z0-9][-a-zA-Z0-9.]*\.[a-zA-Z]{2,})\)/g;let u;for(;(u=s.exec(e))!==null;){const o=u[1].trim().slice(0,500),r=u[2].trim();if(o.length<2)continue;const i=/^https?:\/\//i.test(r)?r:`https://${r}`,a=ts(i);n.has(a)||(n.add(a),t.push({title:o,url:i,content:void 0}))}return t}function so(e){const t=[],n=new Set;let s;const u=new RegExp(ca.source,"g");for(;(s=u.exec(e))!==null;){const o=s[1].trim().slice(0,500),r=s[2].trim();if(o.length<2||r.length<10||!da.test(r))continue;try{new URL(r)}catch{continue}const i=r.toLowerCase().replace(/\/$/,"");n.has(i)||(n.add(i),t.push({title:o,url:r,content:void 0}))}return t}function Lt(e,t){const n=new Map;for(const s of e)n.set(ts(s.url),s);for(const s of t){const u=ts(s.url);n.has(u)||n.set(u,s)}return[...n.values()]}function ba(e){return e.startsWith("f")?e:`f${e}`}function is(e){const t=[];let n;const s=new RegExp(hr.source,"gi");for(;(n=s.exec(e))!==null;){const u=ba(n[1]);t.includes(u)||t.push(u)}return t}function xa(e){return e.map(t=>Wt.find(n=>n.id===t)).filter(t=>!!t)}function va(e){const t=[],n=new Set;let s;const u=new RegExp(wu.source,"gi");for(;(s=u.exec(e))!==null;){const o=s[1].trim(),r=parseInt(s[2],10),i=s[3].trim(),a=`${o.toLowerCase()}|${r}`;n.has(a)||(n.add(a),t.push({id:`ext-${a.replace(/\W/g,"-")}`,title:o,year:r,posterUrl:"",synopsis:kt(e,s.index,s[0].length),genres:[],rating:0,runtime:0,director:i,cast:[],sources:[]}))}return t}function Ls(e){const t=xa(is(e)),n=va(e);return[...t,...n]}function ya(e){return e.startsWith("s")?e:`s${e}`}function kr(e){const t=[];let n;const s=new RegExp(mr.source,"gi");for(;(n=s.exec(e))!==null;){const u=ya(n[1]);t.includes(u)||t.push(u)}return t}function wa(e){return e.map(t=>An.find(n=>n.id===t)).filter(t=>!!t)}function Cr(e,t){const n=e.toLowerCase(),s=t.toLowerCase(),u=["latest news","protocol updates","community debates","real-time information","training cutoff","bip discussion","beyond my training","what people are saying","want me to go","search for what","look up things","direct answer","for deeper coverage","for instant","check these sources","bip 110","bip discussions","web search","developer mailing list","mailing list reactions","technical opinions","community sentiment","twitter","reddit","github","stackexchange","bitcoin bips","bitcoin mailing","canonical source","formal dev","what i'd suggest","for bip","sources to","series","season","episode","animated","anime","netflix","amazon","streaming","hbo","hulu","disney","showtime","cancelled","renewed","viewership","rotten tomatoes","imdb","published","author","edition","chapter","novel","nonfiction","product","brand","company","startup","pricing","meaning","definition","synonym","refers to","describes","example","similar to","also known as","originates from","a word","a term","conveys","evokes","suggests"];for(const o of u)if(n.includes(o)||s.includes(o))return!1;return!(n.length>55||s.length>40||/\b(the act of|a type of|when something|which means|referring to|something that)\b/i.test(s)||/^(this|these|it|that|here|there|when|where|what|how|why|if|but|and|or|the |a |an )\b/i.test(n))}function ka(e){const t=[],n=new Set;let s;const u=new RegExp(gr.source,"gi");for(;(s=u.exec(e))!==null;){const o=s[1].trim(),r=s[2].trim();if(!Cr(o,r))continue;const i=s[3]?parseInt(s[3],10):void 0,a=`${o.toLowerCase()}|${r.toLowerCase()}`;n.has(a)||(n.add(a),t.push({id:`ext-${a.replace(/\W/g,"-")}`,title:o,artist:r,year:i,coverUrl:void 0,sources:[]}))}return t}function uo(e){const t=e.toLowerCase(),n=[],s=new Set;for(const u of An){const o=u.id;if(s.has(o))continue;const r=u.title.toLowerCase(),i=u.artist.toLowerCase();if(!t.includes(r))continue;const a=new RegExp("\\b"+i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\b","i");if(!a.test(t))continue;const l=t.indexOf(r),f=t.match(a)?.index??-1;f<0||Math.abs(l-f)>120||(s.add(o),n.push({song:u,pos:Math.min(l,f)}))}return n.sort((u,o)=>u.pos-o.pos).map(u=>u.song)}function oo(e){const t=[],n=new Set,s=[{re:/"([^"]{2,80})"\s+by\s+([A-Za-z0-9][^,\n.]{1,50}?)(?:\s*[,\n.]|$)/gi,titleIdx:1,artistIdx:2},{re:/\*\*([^*]{2,80})\*\*\s+by\s+([A-Za-z0-9][^,\n.]{1,50}?)(?:\s*[,\n.]|$)/g,titleIdx:1,artistIdx:2},{re:/(?:^|\n)\s*(?:\d+\.\s*|[-•]\s*)?([^\n\-–—]{2,60}?)\s*[-–—]\s*([A-Za-z0-9][^,\n]{1,50}?)(?:\s*[,\n.]|$)/gm,titleIdx:1,artistIdx:2},{re:/([A-Za-z0-9][^\-–—\n]{2,60}?)\s+[-–—]\s+([A-Za-z0-9][^,\n]{1,50}?)(?=\s*[,\n.]|$)/g,titleIdx:1,artistIdx:2}];for(const{re:u,titleIdx:o,artistIdx:r}of s){let i;const a=new RegExp(u.source,u.flags);for(;(i=a.exec(e))!==null;){const l=i[o].trim(),c=i[r].trim();if(l.length<2||c.length<2||!Cr(l,c)||/^\d{4}$/.test(l)||/^\d{4}$/.test(c)||/(\[\[)?(film|song|podcast|book|tv|place|recipe|event)(_ext)?:/i.test(l)||/(\[\[)?(film|song|podcast|book|tv|place|recipe|event)(_ext)?:/i.test(c)||/\*\*\[\[/.test(l)||l.includes("]]**"))continue;const f=`${l.toLowerCase()}|${c.toLowerCase()}`;n.has(f)||(n.add(f),t.push({title:l,artist:c,pos:i.index}))}}return t.sort((u,o)=>u.pos-o.pos).map(({title:u,artist:o})=>({id:`ext-${`${u}|${o}`.toLowerCase().replace(/\W/g,"-")}`,title:u,artist:o,coverUrl:void 0,sources:[]}))}function zs(e,t=""){const n=wa(kr(e)),s=ka(e),u=[...n,...s],o=is(e).length>0||/\[\[film_ext:/.test(e)||ku(e).length>0||/\[\[podcast_ext:/.test(e)||/\[\[tv_ext:/.test(e)||/\[\[book_ext:/.test(e);if(u.length>0){if(o)return u;const f=uo(e),h=oo(e),b=new Set(u.map(v=>`${v.title.toLowerCase()}|${v.artist.toLowerCase()}`)),g=[...f,...h].filter(v=>!b.has(`${v.title.toLowerCase()}|${v.artist.toLowerCase()}`));return[...u,...g]}if(o)return[];if(gt(e))return[];const r=t.toLowerCase();if(r&&!ta(r))return[];const i=uo(e),a=oo(e),l=new Set(i.map(f=>`${f.title.toLowerCase()}|${f.artist.toLowerCase()}`)),c=a.filter(f=>!l.has(`${f.title.toLowerCase()}|${f.artist.toLowerCase()}`));return[...i,...c]}function Ca(e){return e.startsWith("p")?e:`p${e}`}function ku(e){const t=[];let n;const s=new RegExp(br.source,"gi");for(;(n=s.exec(e))!==null;){const u=Ca(n[1]);t.includes(u)||t.push(u)}return t}function _a(e){return e.map(t=>rs.find(n=>n.id===t)).filter(t=>!!t)}function Aa(e,t){const n=e.toLowerCase(),s=t.toLowerCase(),u=["bitcoin mailing list","mailing list","developer mailing list","gnusha.org","canonical source","formal dev","github","stackexchange","reddit","twitter","latest news","protocol updates","web search","training cutoff","documentation","bip discussion","bip 110","bitcoin bips"];for(const o of u)if(n.includes(o)||s.includes(o))return!1;return!(n.length>80||s.length>50)}function Da(e){const t=[],n=new Set;let s;const u=new RegExp(xr.source,"gi");for(;(s=u.exec(e))!==null;){const o=s[1].trim(),r=s[2].trim();if(!Aa(o,r))continue;const i=s[3]?parseInt(s[3],10):void 0,a=`${o.toLowerCase()}|${r.toLowerCase()}`;n.has(a)||(n.add(a),t.push({id:`ext-${a.replace(/\W/g,"-")}`,title:o,host:r,year:i,coverUrl:void 0,sources:[]}))}return t}function Bs(e){const t=_a(ku(e)),n=Da(e);return[...t,...n]}function Sa(e){const t=[],n=new Set;let s;const u=new RegExp(vr.source,"gi");for(;(s=u.exec(e))!==null;){const o=s[1].trim(),r=s[2].trim(),i=s[3]?parseInt(s[3],10):void 0,a=`${o.toLowerCase()}|${r.toLowerCase()}`;n.has(a)||(n.add(a),t.push({id:`ext-${a.replace(/\W/g,"-")}`,title:o,author:r,year:i,coverUrl:void 0,description:kt(e,s.index,s[0].length),genres:[],sources:[]}))}return t}function Ea(e){const t=[],n=new Set,s=[{re:/[""\u201C\u201D]([^"""\u201C\u201D]{2,80})[""\u201C\u201D]\s+by\s+([A-Z][^,\n]{1,50}?)(?:\s+(?:is|was|has|—|–|-)|[,()\n.]|$)/gi,titleIdx:1,authorIdx:2},{re:/\*\*([^*]{2,80})\*\*\s+(?:by|—|–)\s+\*?([A-Z][^*\n]{1,50}?)\*?(?:\s+(?:is|was|has|—|–|-)|[,()*\n.]|$)/g,titleIdx:1,authorIdx:2},{re:/(?:^|\n)\s*(?:\d+\.\s*|[-•]\s*)\*{0,2}([^*\n\-–—]{2,80}?)\*{0,2}\s+(?:by|—|–)\s+\*?([A-Z][^*\n]{1,50}?)\*?(?:\s+(?:is|was|has|—|–|-)|[,()*\n.]|$)/gm,titleIdx:1,authorIdx:2},{re:/(?:^|\n)\s*\d+\.\s*\*\*([^*]{2,80})\*\*\s+by\s+([A-Z][^,\n(—–-]{1,50}?)(?:\s*[,()\n—–-]|$)/gm,titleIdx:1,authorIdx:2},{re:/(?:^|\n)\s*[-•]\s+([^—–\n]{2,80}?)\s+[—–]\s+([A-Z][^,\n(]{1,50}?)(?:\s*\(\d{4}\))?(?:\s*[,\n]|$)/gm,titleIdx:1,authorIdx:2},{re:/(?:^|\n|[.!?]\s+)([A-Z][a-z]+(?:\s+[A-Z][a-z]*){1,8})\s+by\s+([A-Z][a-z]+(?:\s+[A-Z][a-z]*){0,4})(?:\s+[a-z]|[,.()\n—–-]|$)/gm,titleIdx:1,authorIdx:2},{re:/(?:read|enjoy|recommend|check out|try|start with|pick up)\s+([A-Z][a-z]+(?:\s+[A-Z][a-z]*){1,8})\s+by\s+([A-Z][a-z]+(?:\s+[A-Z][a-z]*){0,4})(?:\s+[a-z]|[,.()\n—–-]|$)/gi,titleIdx:1,authorIdx:2}];for(const{re:u,titleIdx:o,authorIdx:r}of s){let i;const a=new RegExp(u.source,u.flags);for(;(i=a.exec(e))!==null;){const l=i[o].trim().replace(/^\*\*|\*\*$/g,"").replace(/^\[|\]$/g,""),c=i[r].trim().replace(/^\*\*|\*\*$/g,"");if(l.length<2||c.length<2||/\[\[(film|song|podcast|book)(_ext)?:/.test(l)||/^\d{4}$/.test(l)||/^\d{4}$/.test(c))continue;const f=e.substring(i.index+i[0].length,i.index+i[0].length+200);if(/^\s*\]\s*\(https?:/.test(f)||/\]\(https?:\/\//.test(i[0]))continue;const h=`${l.toLowerCase()}|${c.toLowerCase()}`;if(n.has(h))continue;n.add(h);const b=kt(e,i.index,i[0].length);t.push({title:l,author:c,desc:b,pos:i.index})}}return t.sort((u,o)=>u.pos-o.pos).map(({title:u,author:o,desc:r})=>({id:`ext-${`${u}|${o}`.toLowerCase().replace(/\W/g,"-")}`,title:u,author:o,description:r,coverUrl:void 0,genres:[],sources:[]}))}function Rs(e,t){const n=Sa(e);if(n.length>0)return n;if(!sa(t)&&!ua(e))return[];if(gt(e))return[];const s=e.replace(/\n---\n\s*(?:Sources|References|Links):?\s*\n[\s\S]*$/i,"");return Ea(s)}function $a(e){const t=[],n=new Set;let s;const u=new RegExp(yr.source,"gi");for(;(s=u.exec(e))!==null;){const o=s[1].trim(),r=s[2].trim(),i=s[3]?.trim(),a=/^\d{4}$/.test(r),l=a?parseInt(r,10):i&&/^\d{4}$/.test(i)?parseInt(i,10):void 0,c=a?i||void 0:r||void 0,f=o.toLowerCase();n.has(f)||(n.add(f),t.push({id:`ext-${f.replace(/\W/g,"-")}`,title:o,creator:c||void 0,year:l,synopsis:kt(e,s.index,s[0].length),genres:[],sources:[]}))}return t}function Fa(e){return/\b(season|episodes?|showrunner|streaming|renewed|cancelled|premiere|network|HBO|Netflix|AMC|FX|Apple TV|Disney\+|created by)\b/i.test(e)?(e.match(/\bseason\b/gi)?.length??0)>=1?!0:[/\bepisodes?\b/i,/\bshowrunner\b/i,/\bstreaming\b/i,/\brenewed\b/i,/\bcancelled\b/i,/\bpremiere\b/i,/\bnetwork\b/i,/\b(HBO|Netflix|AMC|FX|Apple TV|Disney\+|Hulu|Amazon Prime)\b/i,/\bseries\b/i,/\bpilot\b/i,/\bminiseries\b/i,/\bcreated by\b/i].filter(s=>s.test(e)).length>=2:!1}function Ma(e){const t=[],n=new Set,s=[/"([^"]{2,60})"\s*[-–—]\s*(?:a |an )?(?:series|show|tv)/gi,/\*\*([^*]{2,60})\*\*\s*[-–—:]\s*(?:a |an )?(?:\w+ )?(?:series|show|drama|comedy|thriller|animated)/gi,/(?:^|\n)\s*(?:\d+\.\s*|[-•]\s*)\*{0,2}([^*\n]{2,60}?)\*{0,2}\s*\((\d{4})(?:[-–]\d{0,4})?(?:,\s*\d+ seasons?)?\)/gm,/\*\*([^*]{2,60})\*\*\s*[-–—:]\s*\d+\s*seasons?/gi,/"([^"]{2,60})"\s*[-–—]\s*([A-Z][^,\n.]{1,50}?)(?:\s*[,()\n]|$)/gi];for(const u of s){let o;const r=new RegExp(u.source,u.flags);for(;(o=r.exec(e))!==null;){const i=o[1].trim().replace(/^\*\*|\*\*$/g,"");if(i.length<2||/\[\[(film|song|podcast|book|tv)(_ext)?:/.test(i))continue;const a=i.toLowerCase();if(n.has(a))continue;n.add(a);const l=kt(e,o.index,o[0].length);t.push({title:i,desc:l,pos:o.index})}}return t.sort((u,o)=>u.pos-o.pos).map(({title:u,desc:o})=>({id:`ext-${u.toLowerCase().replace(/\W/g,"-")}`,title:u,synopsis:o,genres:[],sources:[]}))}function Ta(e){const t=[],n=new Set;let s;const u=new RegExp(wu.source,"gi");for(;(s=u.exec(e))!==null;){const o=s[1].trim(),r=parseInt(s[2],10),i=s[3].trim(),a=o.toLowerCase();n.has(a)||(n.add(a),t.push({id:`ext-${a.replace(/\W/g,"-")}`,title:o,year:r,synopsis:kt(e,s.index,s[0].length),creator:i,genres:[],sources:[]}))}return t}function js(e,t){const n=$a(e);return n.length>0?n:!es(t)&&!Fa(e)?[]:gt(e)?[]:es(t)&&/\[\[film_ext:/.test(e)?Ta(e):is(e).length>0?[]:Ma(e)}function Ia(e){const t=[],n=new Set,s=/!\[([^\]]*)\]\((https?:\/\/[^)]+)\)/gi;let u;for(;(u=s.exec(e))!==null;){const r=u[1].trim(),i=u[2].trim();if(n.has(i))continue;n.add(i);const a=new URL(i).hostname.replace(/^www\./,"");t.push({id:`img-${n.size}`,url:i,alt:r||void 0,title:r||void 0,source:a})}const o=/(https?:\/\/[^\s)"'>]+\.(?:jpg|jpeg|png|gif|webp|svg|avif|bmp|tiff)(?:\?[^\s)"'>]*)?)/gi;for(;(u=o.exec(e))!==null;){const r=u[1].trim();if(n.has(r))continue;n.add(r);const i=new URL(r).hostname.replace(/^www\./,"");t.push({id:`img-${n.size}`,url:r,source:i})}return t}function ro(e,t){const n=Ia(e);return n.length===0?[]:oa(t)||n.length>=2||n.length===1&&n[0].alt&&n[0].alt.length>2?n:[]}function Pa(e){const t=[],n=new Set;let s;const u=new RegExp(wr.source,"gi");for(;(s=u.exec(e))!==null;){const o=s[1].trim(),r=s[2]?.trim()||void 0,i=s[3]?.trim()||void 0,a=s[4]?parseFloat(s[4]):void 0,l=s[5]?parseInt(s[5],10):void 0,c=s[6]?.trim()||void 0,f=o.toLowerCase();n.has(f)||(n.add(f),t.push({id:`ext-place-${f.replace(/\W/g,"-")}`,name:o,cuisine:r,city:i,rating:a&&!isNaN(a)?a:void 0,priceLevel:l&&l>=1&&l<=4?l:void 0,address:c,description:kt(e,s.index,s[0].length),sources:[]}))}return t}function La(e){const t=[],n=new Set,s="restaurant|cafe|bar|bistro|pub|pizzeria|bakery|deli|steakhouse|grill|eatery|spot|joint|trattoria|taqueria|brasserie|cantina|chophouse|creamery|diner|tavern",u=[new RegExp(`\\*\\*([^*]{2,60})\\*\\*\\s*[-–—:]\\s*(?:a |an )?(?:(\\w[\\w\\s]{1,30}?)\\s+)?(?:${s})`,"gi"),new RegExp(`(?:^|\\n)\\s*(?:\\d+\\.\\s*|[-•]\\s*)\\*{0,2}([^*\\n]{2,60}?)\\*{0,2}\\s*[-–—(]\\s*(?:(\\w[\\w\\s&]{1,30}?)\\s+)?(?:${s}|cuisine|food|dining)`,"gim"),new RegExp(`\\*\\*([^*]{2,60})\\*\\*\\s*[-–—:]\\s*([^\\n]{3,120}?\\b(?:${s})\\b[^\\n]{0,40})`,"gi"),new RegExp(`(?:^|\\n)\\s*(?:\\d+\\.\\s*|[-•]\\s*)\\*\\*([^*]{2,60})\\*\\*\\s*[-–—:]\\s*([^\\n]{3,120}?\\b(?:${s})\\b[^\\n]{0,40})`,"gim")];for(const o of u){let r;const i=new RegExp(o.source,o.flags);for(;(r=i.exec(e))!==null;){const a=r[1].trim().replace(/^\*\*|\*\*$/g,"").replace(/^\[|\]$/g,"");if(a.length<2||/\[\[(film|song|podcast|book|tv|place)(_ext)?:/.test(a))continue;const l=a.toLowerCase();if(n.has(l))continue;n.add(l);const c=r[2]?.trim(),f=kt(e,r.index,r[0].length),h=e.slice(r.index,r.index+300),b=/(\d\.?\d?)\s*(?:\/\s*5|stars?|★)/i.exec(h),g=b?parseFloat(b[1]):void 0,v=/(\${1,4})\b/.exec(h),E=v?v[1].length:void 0;t.push({name:a,cuisine:c,desc:f,rating:g,priceLevel:E,pos:r.index})}}return t.sort((o,r)=>o.pos-r.pos).map(({name:o,cuisine:r,desc:i,rating:a,priceLevel:l})=>({id:`ext-place-${o.toLowerCase().replace(/\W/g,"-")}`,name:o,cuisine:r,rating:a,priceLevel:l,description:i,sources:[]}))}function za(e){const t=[],n=new Set,s=/(?:^|\n)\s*(?:\d+\.\s*|[-•]\s*)\*\*([^*]{2,60})\*\*\s*[-–—:]\s*([^\n]{5,200})/gm;let u;for(;(u=s.exec(e))!==null;){const o=u[1].trim();if(o.length<2||/\[\[(film|song|podcast|book|tv|place)(_ext)?:/.test(o))continue;const r=o.toLowerCase();n.has(r)||(n.add(r),t.push({name:o,desc:u[2].trim(),pos:u.index}))}return t.sort((o,r)=>o.pos-r.pos).map(({name:o,desc:r})=>({id:`ext-place-${o.toLowerCase().replace(/\W/g,"-")}`,name:o,description:r,sources:[]}))}function io(e,t){const n=Pa(e);if(n.length>0)return n;if(!Ku(t)&&!ra(e))return[];if(gt(e))return[];const s=La(e);if(Ku(t)){const u=za(e),o=new Set(s.map(a=>a.name.toLowerCase())),r=u.filter(a=>!o.has(a.name.toLowerCase())),i=[...s,...r];return i.length>0?i:[]}return s}function Us(e){const t=[],n=/```(\w*)\n([\s\S]*?)```/g;let s;for(;(s=n.exec(e))!==null;){const u=s[1]||"text",o=s[2].trimEnd();if(o.length<3)continue;const r=e.slice(Math.max(0,s.index-200),s.index),i=/(?:^|\n)\s*(?:\*\*([^*]{2,80})\*\*|#+\s+(.{2,80}))\s*\n?\s*$/.exec(r),a=i?.[1]||i?.[2]||void 0;t.push({language:u,code:o,label:a})}return t}function _r(e){return e.replace(hr,"").replace(wu,"").replace(/\n{3,}/g,` - -`).trim()}function Ar(e){return e.replace(mr,"").replace(gr,"").replace(/\n{3,}/g,` - -`).trim()}function Dr(e){return e.replace(br,"").replace(xr,"").replace(/\n{3,}/g,` - -`).trim()}function Ba(e){return e.replace(la,"").replace(vr,"").replace(/\n{3,}/g,` - -`).trim()}function Ra(e){return e.replace(yr,"").replace(/\n{3,}/g,` - -`).trim()}function ja(e){return e.replace(wr,"").replace(/\n{3,}/g,` - -`).trim()}function Ua(e){return _r(Ar(Dr(Ba(Ra(ja(Oa(Ha(e))))))))}function Na(e){return e.replace(/^[\s]*[-*]\s*\[[^\]]+\]\(https?:\/\/[^)\s]+\)\s*$/gm,"").replace(/\s*\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)/g,(t,n)=>` ${n}`).replace(/\n{3,}/g,` - -`).trim()}const Sr=/]+)>([\s\S]*?)<\/recipe_ext>/gi;function iu(e){const t=[];let n;for(;(n=Sr.exec(e))!==null;){const s=n[1],u=n[2],o=s.match(/title="([^"]*)"/)?.[1]||"Recipe",r=s.match(/servings="([^"]*)"/)?.[1],i=s.match(/time="([^"]*)"/)?.[1],a=s.match(/calories="([^"]*)"/)?.[1],l=u.split(` -`).map(h=>h.trim()).filter(Boolean),c=[],f=[];for(const h of l)/^[-*]\s+/.test(h)?c.push(h.replace(/^[-*]\s+/,"")):/^\d+[.)]\s+/.test(h)&&f.push(h.replace(/^\d+[.)]\s+/,""));t.push({title:o,servings:r,time:i,calories:a,ingredients:c,steps:f})}return t}function Oa(e){return e.replace(Sr,"").replace(/\n{3,}/g,` - -`).trim()}const Er=/]*?)(?:\/>|>([\s\S]*?)<\/event_ext>)/gi;function qa(e){const t=[];let n;for(;(n=Er.exec(e))!==null;){const s=n[1],u=n[2]?.trim(),o=s.match(/title="([^"]*)"/)?.[1]||"Event",r=s.match(/date="([^"]*)"/)?.[1]||"",i=s.match(/location="([^"]*)"/)?.[1],a=s.match(/url="([^"]*)"/)?.[1];t.push({title:o,date:r,location:i,url:a,description:u})}return t}function Ha(e){return e.replace(Er,"").replace(/\n{3,}/g,` - -`).trim()}const Wa=/\.(com|org|net|io|co|app|dev|xyz|social|news|info|me|tv|fm|live|chat|fyi|ai|so|world|land|pub|lol|cafe|money|exchange|market|tech|design|page|site|online|store|cloud|network|community|foundation)$/i,Va=/\.(js|ts|css|html|json|md|txt|pdf|png|jpg|jpeg|gif|svg|vue|yaml|yml|xml|csv|sql|sh|py|rb|go|rs|toml|lock|env|log|map|wasm|woff2?|ttf|eot|ico)$/i;function ao(e){const t=[],n=new Set,s=[];let u;const o=/\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)/g;for(;(u=o.exec(e))!==null;)s.push([u.index,u.index+u[0].length]);const r=/\*\*([^*]+)\*\*\s*\(([a-zA-Z0-9][-a-zA-Z0-9.]*\.[a-zA-Z]{2,})\)/g;for(;(u=r.exec(e))!==null;)s.push([u.index,u.index+u[0].length]);const i=/https?:\/\/[^\s)\]"'<>,]+/g;for(;(u=i.exec(e))!==null;)s.push([u.index,u.index+u[0].length]);function a(c,f){return s.some(([h,b])=>c>=h&&c+f<=b)}const l=/\b([a-zA-Z][a-zA-Z0-9-]*(?:\.[a-zA-Z][a-zA-Z0-9-]*)*\.[a-zA-Z]{2,})\b/g;for(;(u=l.exec(e))!==null;){if(a(u.index,u[0].length))continue;const c=u[1];if(!Wa.test(c)||Va.test(c)||/^\d/.test(c))continue;const f=`https://${c}`,h=ts(f);if(n.has(h))continue;n.add(h);const b=c.charAt(0).toUpperCase()+c.slice(1);t.push({title:b,url:f,content:void 0})}return t}function lo(e,t){const n=e.toLowerCase(),s=[],u=new Set;for(const a of Qu){const l=[a.name.toLowerCase(),...a.keywords.map(c=>c.toLowerCase())];for(const c of l){if(c.length<3)continue;const f=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if((c.length<=4?new RegExp(`\\b${f}\\b`,"i"):new RegExp(f,"i")).test(n)&&!u.has(a.id)){u.add(a.id),s.push(a);break}}}const o=t.toLowerCase(),r=Qu.some(a=>[a.name.toLowerCase(),...a.keywords.map(l=>l.toLowerCase())].some(l=>l.length>=3&&o.includes(l)));return(yu(t)||vn(t)||r)&&s.length>=1||s.length>=2?s:[]}const Oe=k(!1),Yt=k([]),co=k([]),fo=k([]),Pn=k([]),Ns=k([]),po=k([]),Os=k([]),ho=k(null),Xt=k([]),Qt=k([]),mo=k([]),go=k([]),bo=k([]),xo=k([]),vo=k([]),en=k(null),tn=k(null),nn=k(null),sn=k(null),un=k(null),on=k(null),rn=k(null),an=k(null),ln=k(null),cn=k(null),dn=k(null),zt=k(null),Ln=k(0),re=k("Recommended Films"),qs=k(""),yo=k(""),We=k("film"),Bt=k("film"),qe=k([]),zn=k(null),Bn=k(null),Rn=k(null),jn=k([]);function as(){function e(T,J="",he=[]){qs.value=J.trim(),yo.value=T;const ye=zs(T,J);let we=Ls(T);const $e=Bs(T),je=Rs(T,J),L=js(T,J);L.length>0&&es(J)&&(we=we.filter(rt=>!rt.id.startsWith("ext-")));const R=so(T),Z=no(T),Ee=ao(T);Ns.value=[];const ve=R.length>0||Z.length>0||Ee.length>0?R:[],Fe=Lt(Lt(ve,Z),Ee),Ft=Fe.length>0,Ct=lo(T,J),_t=Ct.length>0,ct=Us(T),At=ct.length>0&&(ru(J)||Zu(T)),dt=vn(J)||Yu(T),ft=ro(T,J),Je=io(T,J),Dt=iu(T),st=Dt.length>0||Ju(T),ut=to(T),$n=we.length>0||ye.length>0||$e.length>0||je.length>0||L.length>0||ft.length>0||Je.length>0,Mt=ut.length>=1&&($t(J)||gt(T)||/sentiment|bearish|bull case|macro|%|BTC|bitcoin|BIP|protocol|debate|what'?s happening|ETF|inflow|trading at|key developments|price recovery|institutional|analyst watch|market cap/i.test(T)||!$n&&!Ft&&ut.length>=2),Tt=$t(J)||gt(T),Gt=Tt&&(he.length>0||Fe.length>0||$t(J)),de=Lt(he,Ns.value);if(Fe.length>0&&Tt){const rt=Fe.map(Jt=>Jt.url);ea(rt).then(Jt=>{if(Jt.length===0)return;Ns.value=Jt;const Es=Lt(Pn.value,Jt);if(Pn.value=Es,!qe.value.includes("news")){const $s=qe.value.indexOf("prompt");$s>=0?qe.value=[...qe.value.slice(0,$s),"news",...qe.value.slice($s)]:qe.value=["news",...qe.value],Bt.value="news"}const Pu=Ps(qs.value);re.value=Pu?`${Pu} — ${Es.length} articles`:`${Es.length} Articles`})}const me=Xu(J,we.length>0,ye.length>0,$e.length>0,je.length>0,L.length>0,ft.length>0,Je.length>0,Gt,Ft,Mt,dt,_t,At,st),ps=me.length>0?[...me,"prompt"]:["prompt"];qe.value=ps,Bt.value=me[0]??"prompt";const hs=me.includes("film"),ms=me.includes("book"),gs=me.includes("tvshow"),bs=me.includes("image"),ze=me.includes("place"),xs=me.includes("song"),vs=me.includes("podcast"),ys=me.includes("news"),ws=me.includes("websites"),Ze=me.includes("magazine"),ks=me.includes("recipe"),Cs=me.includes("app"),_s=me.includes("code"),pt=hs?we:[],Ue=ms?je:[],Ne=gs?L:[],U=bs?ft:[],$=ze?Je:[],z=xs?ye:[],oe=vs?$e:[],ot=ys?de:[],As=ws?Fe:[],Iu=Ze?ut:[],Kt=ks?Dt:[],Ds=Cs?Ct:[],Ss=_s?ct:[];Yt.value=pt,co.value=Ue,fo.value=Ne,mo.value=U,go.value=$,Xt.value=z,Qt.value=oe,Pn.value=ot,po.value=As,bo.value=Kt,xo.value=Ds,vo.value=Ss,Os.value=Iu,ho.value=Ze?ga(T)??he[0]?.imgSrc??null:null,en.value=null,tn.value=null,nn.value=null,rn.value=null,an.value=null,sn.value=null,un.value=null,on.value=null,cn.value=null,dn.value=null,ln.value=null,zt.value=null,pt.length>0||Ue.length>0||Ne.length>0?We.value="film":z.length>0?We.value="song":oe.length>0?We.value="podcast":(ot.length>0,We.value="film");const Fn=me[0];if(Fn==="place"&&$.length>0)re.value=$.length===1?$[0].name:`${$.length} Places`;else if(Fn==="tvshow"&&Ne.length>0)re.value=Ne.length===1?Ne[0].title:`${Ne.length} TV Series`;else if(Fn==="book"&&Ue.length>0)re.value=Ue.length===1?Ue[0].title:`${Ue.length} Books`;else if(Fn==="image"&&U.length>0)re.value=`${U.length} Images`;else if(pt.length===1)re.value=pt[0].title;else if(pt.length>1)re.value=`${pt.length} Films`;else if(Ue.length===1)re.value=Ue[0].title;else if(Ue.length>1)re.value=`${Ue.length} Books`;else if(Ne.length===1)re.value=Ne[0].title;else if(Ne.length>1)re.value=`${Ne.length} TV Series`;else if(z.length===1)re.value=z[0].title;else if(z.length>1)re.value=`${z.length} Songs`;else if($.length===1)re.value=$[0].name;else if($.length>1)re.value=`${$.length} Places`;else if(oe.length===1)re.value=oe[0].title;else if(oe.length>1)re.value=`${oe.length} Podcasts`;else if(ot.length>0){const rt=Ps(J);re.value=rt?`${rt} — ${ot.length} articles`:`${ot.length} Articles`}else if(Iu.length>0){const rt=Ps(J);re.value=rt?`${rt} — Brief`:"AI Brief"}else Kt.length===1?re.value=Kt[0].title:Kt.length>1?re.value=`${Kt.length} Recipes`:Ss.length>0?re.value=`${Ss.length} Code Blocks`:Ds.length>0?re.value=`${Ds.length} Apps`:As.length>0?re.value=`${As.length} Websites`:dt?re.value="Nostr":re.value="Content";Oe.value=me.length>0}function t(T){qe.value.includes(T)&&(Bt.value=T)}function n(T,J,he=[]){let ye=Ls(T);const we=zs(T,J),$e=Bs(T),je=Rs(T,J),L=js(T,J);L.length>0&&es(J)&&(ye=ye.filter(me=>!me.id.startsWith("ext-")));const R=to(T),Z=so(T),Ee=no(T),ue=ao(T),ve=he.length>0&&($t(J)||gt(T)),Fe=ve?he:[],Ct=Z.length>0||Ee.length>0||ue.length>0?Z:[],_t=Lt(Lt(Ct,Ee),ue),ct=_t.length>0,At=lo(T,J),dt=At.length>0,ft=Us(T),Je=ft.length>0&&(ru(J)||Zu(T)),Dt=vn(J)||Yu(T),st=ro(T,J),ut=io(T,J),Mt=iu(T).length>0||Ju(T),Tt=ye.length>0||we.length>0||$e.length>0||je.length>0||L.length>0||st.length>0||ut.length>0,Gt=R.length>=1&&($t(J)||gt(T)||/sentiment|bearish|bull case|macro|%|BTC|bitcoin|BIP|protocol|debate|what'?s happening|ETF|inflow|trading at|key developments|price recovery|institutional|analyst watch|market cap/i.test(T)||!Tt&&!ct&&R.length>=2),de=Xu(J,ye.length>0,we.length>0,$e.length>0,je.length>0,L.length>0,st.length>0,ut.length>0,ve,ct,Gt,Dt,dt,Je,Mt);return{films:de.includes("film")?ye:[],books:de.includes("book")?je:[],tvSeries:de.includes("tvshow")?L:[],images:de.includes("image")?st:[],places:de.includes("place")?ut:[],songs:de.includes("song")?we:[],podcasts:de.includes("podcast")?$e:[],newsLinks:de.includes("news")?Fe:[],websitesLinks:de.includes("websites")?_t:[],magazineSections:de.includes("magazine")?R:[],apps:de.includes("app")?At:[],codeBlocks:de.includes("code")?ft:[],hasNostr:Dt}}function s(){en.value=null,tn.value=null,nn.value=null,rn.value=null,an.value=null,sn.value=null,un.value=null,on.value=null,cn.value=null,dn.value=null,ln.value=null,zt.value=null,zn.value=null,Bn.value=null,Rn.value=null,jn.value=[]}function u(T){s(),en.value=T}function o(){en.value=null}function r(T){s(),tn.value=T}function i(){tn.value=null}function a(T){s(),sn.value=T}function l(){sn.value=null}function c(T){s(),un.value=T}function f(){un.value=null}function h(T){s(),on.value=T,Oe.value=!0}function b(){on.value=null}function g(T){s(),ln.value=T,Oe.value=!0}function v(){ln.value=null}function E(T,J){s(),Bn.value={content:T,title:J},Oe.value=!0}function _(){Bn.value=null}function y(T,J){s(),Rn.value={url:T,title:J},Oe.value=!0}function x(){Rn.value=null}function w(T){s(),jn.value=T,Oe.value=!0}function M(){jn.value=[]}function P(T,J){s(),zt.value=T,Ln.value=J}function N(){zt.value=null}function se(T){const J=Os.value;if(!J.length)return;let he=Ln.value;he+=T==="next"?1:-1,he<0&&(he=J.length-1),he>=J.length&&(he=0),Ln.value=he,zt.value=J[he]}function j(T){s(),nn.value=T}function B(){nn.value=null}function Q(T){s(),rn.value=T}function ee(){rn.value=null}function K(T){s(),an.value=T}function I(){an.value=null}function X(T){s(),cn.value=T}function fe(){cn.value=null}function be(T){s(),dn.value=T}function Ke(){dn.value=null}function te(T){s(),zn.value=T}function Ae(){zn.value=null}function lt(){Oe.value=!0,Bt.value="design-system",qe.value=["design-system"],re.value="Design System",s()}function O(){Oe.value=!1,s(),Bt.value="film",qe.value=[]}function W(){Yt.value=[...Wt],Xt.value=[],Qt.value=[],re.value="Your Film Library",We.value="film",Oe.value=!0,s()}function ae(){Yt.value=[],Xt.value=[...An],Qt.value=[],re.value="Your Song Library",We.value="song",Oe.value=!0,s()}function xe(){Yt.value=[],Xt.value=[],Qt.value=[...rs],re.value="Your Podcast Library",We.value="podcast",Oe.value=!0,s()}return{panelOpen:Oe,panelFilms:Yt,panelBooks:co,panelTVSeries:fo,panelImages:mo,panelPlaces:go,panelSongs:Xt,panelPodcasts:Qt,panelWebResults:Pn,panelWebsites:po,panelRecipes:bo,panelApps:xo,panelCodeBlocks:vo,panelMagazineSections:Os,panelMagazineHeroImage:ho,selectedFilm:en,selectedBook:tn,selectedTVSeries:nn,selectedImage:rn,selectedPlace:an,selectedSong:sn,selectedPodcast:un,selectedArticle:on,selectedRecipe:cn,selectedApp:dn,selectedWebsite:ln,selectedMagazineSection:zt,magazineSectionIndex:Ln,panelTitle:re,panelQuery:qs,panelResponseText:yo,contentType:We,activeTab:Bt,availableTabs:qe,setActiveTab:t,extractFilmIds:is,extractAllFilms:Ls,extractAllBooks:Rs,extractAllTVSeries:js,extractSongIds:kr,extractAllSongs:zs,extractPodcastIds:ku,extractAllPodcasts:Bs,extractCodeBlocks:Us,getContextualInlineContent:n,updatePanelFromText:e,stripFilmTags:_r,stripSongTags:Ar,stripPodcastTags:Dr,stripContentTags:Ua,stripMarkdownLinks:Na,openFilmDetail:u,closeFilmDetail:o,openBookDetail:r,closeBookDetail:i,openSongDetail:a,closeSongDetail:l,openPodcastDetail:c,closePodcastDetail:f,openArticleDetail:h,closeArticleDetail:b,openWebsiteDetail:g,closeWebsiteDetail:v,openRecipeDetail:X,closeRecipeDetail:fe,openAppDetail:be,closeAppDetail:Ke,openMagazineSectionDetail:P,closeMagazineSectionDetail:N,navigateMagazineSection:se,openTVSeriesDetail:j,closeTVSeriesDetail:B,openImageDetail:Q,closeImageDetail:ee,openPlaceDetail:K,closePlaceDetail:I,selectedDesignSystemItem:zn,openDesignSystemItem:te,closeDesignSystemItem:Ae,longFormArticle:Bn,openLongFormArticle:E,closeLongFormArticle:_,pdfUrl:Rn,openPdfViewer:y,closePdfViewer:x,mapPlaces:jn,openMapView:w,closeMapView:M,enterDesignSystemMode:lt,closePanel:O,showAllFilms:W,showAllSongs:ae,showAllPodcasts:xe}}function Rt(e,t,n){let s=n.initialDeps??[],u,o=!0;function r(){var i,a,l;let c;n.key&&((i=n.debug)!=null&&i.call(n))&&(c=Date.now());const f=e();if(!(f.length!==s.length||f.some((g,v)=>s[v]!==g)))return u;s=f;let b;if(n.key&&((a=n.debug)!=null&&a.call(n))&&(b=Date.now()),u=t(...f),n.key&&((l=n.debug)!=null&&l.call(n))){const g=Math.round((Date.now()-c)*100)/100,v=Math.round((Date.now()-b)*100)/100,E=v/16,_=(y,x)=>{for(y=String(y);y.length{s=i},r}function wo(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Ga=(e,t)=>Math.abs(e-t)<1.01,Ka=(e,t,n)=>{let s;return function(...u){e.clearTimeout(s),s=e.setTimeout(()=>t.apply(this,u),n)}},ko=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Ja=e=>e,Za=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),s=[];for(let u=t;u<=n;u++)s.push(u);return s},Ya=(e,t)=>{const n=e.scrollElement;if(!n)return;const s=e.targetWindow;if(!s)return;const u=r=>{const{width:i,height:a}=r;t({width:Math.round(i),height:Math.round(a)})};if(u(ko(n)),!s.ResizeObserver)return()=>{};const o=new s.ResizeObserver(r=>{const i=()=>{const a=r[0];if(a?.borderBoxSize){const l=a.borderBoxSize[0];if(l){u({width:l.inlineSize,height:l.blockSize});return}}u(ko(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},Co={passive:!0},_o=typeof window>"u"?!0:"onscrollend"in window,Xa=(e,t)=>{const n=e.scrollElement;if(!n)return;const s=e.targetWindow;if(!s)return;let u=0;const o=e.options.useScrollendEvent&&_o?()=>{}:Ka(s,()=>{t(u,!1)},e.options.isScrollingResetDelay),r=c=>()=>{const{horizontal:f,isRtl:h}=e.options;u=f?n.scrollLeft*(h&&-1||1):n.scrollTop,o(),t(u,c)},i=r(!0),a=r(!1);n.addEventListener("scroll",i,Co);const l=e.options.useScrollendEvent&&_o;return l&&n.addEventListener("scrollend",a,Co),()=>{n.removeEventListener("scroll",i),l&&n.removeEventListener("scrollend",a)}},Qa=(e,t,n)=>{if(t?.borderBoxSize){const s=t.borderBoxSize[0];if(s)return Math.round(s[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},el=(e,{adjustments:t=0,behavior:n},s)=>{var u,o;const r=e+t;(o=(u=s.scrollElement)==null?void 0:u.scrollTo)==null||o.call(u,{[s.options.horizontal?"left":"top"]:r,behavior:n})};class tl{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.currentScrollToIndex=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const s=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(u=>{u.forEach(o=>{const r=()=>{this._measureElement(o.target,o)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()})}));return{disconnect:()=>{var u;(u=s())==null||u.disconnect(),n=null},observe:u=>{var o;return(o=s())==null?void 0:o.observe(u,{box:"border-box"})},unobserve:u=>{var o;return(o=s())==null?void 0:o.unobserve(u)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([s,u])=>{typeof u>"u"&&delete n[s]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Ja,rangeExtractor:Za,onChange:()=>{},measureElement:Qa,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var s,u;(u=(s=this.options).onChange)==null||u.call(s,this,n)},this.maybeNotify=Rt(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const s=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==s){if(this.cleanup(),!s){this.maybeNotify();return}this.scrollElement=s,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(u=>{this.observer.observe(u)}),this.unsubs.push(this.options.observeElementRect(this,u=>{this.scrollRect=u,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(u,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,s)=>{const u=new Map,o=new Map;for(let r=s-1;r>=0;r--){const i=n[r];if(u.has(i.lane))continue;const a=o.get(i.lane);if(a==null||i.end>a.end?o.set(i.lane,i):i.endr.end===i.end?r.index-i.index:r.end-i.end)[0]:void 0},this.getMeasurementOptions=Rt(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,s,u,o,r,i)=>(this.prevLanes!==void 0&&this.prevLanes!==i&&(this.lanesChangedFlag=!0),this.prevLanes=i,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:s,scrollMargin:u,getItemKey:o,enabled:r,lanes:i}),{key:!1}),this.getMeasurements=Rt(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:s,scrollMargin:u,getItemKey:o,enabled:r,lanes:i},a)=>{if(!r)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const h of this.laneAssignments.keys())h>=n&&this.laneAssignments.delete(h);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(h=>{this.itemSizeCache.set(h.key,h.size)}));const l=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const c=this.measurementsCache.slice(0,l),f=new Array(i).fill(void 0);for(let h=0;h1){v=g;const w=f[v],M=w!==void 0?c[w]:void 0;E=M?M.end+this.options.gap:s+u}else{const w=this.options.lanes===1?c[h-1]:this.getFurthestMeasurement(c,h);E=w?w.end+this.options.gap:s+u,v=w?w.lane:h%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(h,v)}const _=a.get(b),y=typeof _=="number"?_:this.options.estimateSize(h),x=E+y;c[h]={index:h,start:E,size:y,end:x,key:b,lane:v},f[v]=h}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Rt(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,s,u,o)=>this.range=n.length>0&&s>0?nl({measurements:n,outerSize:s,scrollOffset:u,lanes:o}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Rt(()=>{let n=null,s=null;const u=this.calculateRange();return u&&(n=u.startIndex,s=u.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,s]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,s]},(n,s,u,o,r)=>o===null||r===null?[]:n({startIndex:o,endIndex:r,overscan:s,count:u}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const s=this.options.indexAttribute,u=n.getAttribute(s);return u?parseInt(u,10):(console.warn(`Missing attribute name '${s}={index}' on measured element.`),-1)},this._measureElement=(n,s)=>{const u=this.indexFromElement(n),o=this.measurementsCache[u];if(!o)return;const r=o.key,i=this.elementsCache.get(r);i!==n&&(i&&this.observer.unobserve(i),this.observer.observe(n),this.elementsCache.set(r,n)),n.isConnected&&this.resizeItem(u,this.options.measureElement(n,s,this))},this.resizeItem=(n,s)=>{const u=this.measurementsCache[n];if(!u)return;const o=this.itemSizeCache.get(u.key)??u.size,r=s-o;r!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(u,r,this):u.start{if(!n){this.elementsCache.forEach((s,u)=>{s.isConnected||(this.observer.unobserve(s),this.elementsCache.delete(u))});return}this._measureElement(n,void 0)},this.getVirtualItems=Rt(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,s)=>{const u=[];for(let o=0,r=n.length;othis.options.debug}),this.getVirtualItemForOffset=n=>{const s=this.getMeasurements();if(s.length!==0)return wo(s[$r(0,s.length-1,u=>wo(s[u]).start,n)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(n,s,u=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),r=this.getScrollOffset();s==="auto"&&(s=n>=r+o?"end":"start"),s==="center"?n+=(u-o)/2:s==="end"&&(n-=o);const i=this.getMaxScrollOffset();return Math.max(Math.min(i,n),0)},this.getOffsetForIndex=(n,s="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const u=this.measurementsCache[n];if(!u)return;const o=this.getSize(),r=this.getScrollOffset();if(s==="auto")if(u.end>=r+o-this.options.scrollPaddingEnd)s="end";else if(u.start<=r+this.options.scrollPaddingStart)s="start";else return[r,s];if(s==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),s];const i=s==="end"?u.end+this.options.scrollPaddingEnd:u.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(i,s,u.size),s]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:s="start",behavior:u}={})=>{u==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,s),{adjustments:void 0,behavior:u})},this.scrollToIndex=(n,{align:s="auto",behavior:u}={})=>{u==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1)),this.currentScrollToIndex=n;let o=0;const r=10,i=l=>{if(!this.targetWindow)return;const c=this.getOffsetForIndex(n,l);if(!c){console.warn("Failed to get offset for index:",n);return}const[f,h]=c;this._scrollToOffset(f,{adjustments:void 0,behavior:u}),this.targetWindow.requestAnimationFrame(()=>{if(!this.targetWindow)return;const b=()=>{if(this.currentScrollToIndex!==n)return;const g=this.getScrollOffset(),v=this.getOffsetForIndex(n,h);if(!v){console.warn("Failed to get offset for index:",n);return}Ga(v[0],g)||a(h)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(b):b()})},a=l=>{this.targetWindow&&this.currentScrollToIndex===n&&(o++,oi(l)):console.warn(`Failed to scroll to index ${n} after ${r} attempts.`))};i(s)},this.scrollBy=(n,{behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:s})},this.getTotalSize=()=>{var n;const s=this.getMeasurements();let u;if(s.length===0)u=this.options.paddingStart;else if(this.options.lanes===1)u=((n=s[s.length-1])==null?void 0:n.end)??0;else{const o=Array(this.options.lanes).fill(null);let r=s.length-1;for(;r>=0&&o.some(i=>i===null);){const i=s[r];o[i.lane]===null&&(o[i.lane]=i.end),r--}u=Math.max(...o.filter(i=>i!==null))}return Math.max(u-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:s,behavior:u})=>{this.options.scrollToFn(n,{behavior:u,adjustments:s},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}}const $r=(e,t,n,s)=>{for(;e<=t;){const u=(e+t)/2|0,o=n(u);if(os)t=u-1;else return u}return e>0?e-1:0};function nl({measurements:e,outerSize:t,scrollOffset:n,lanes:s}){const u=e.length-1,o=a=>e[a].start;if(e.length<=s)return{startIndex:0,endIndex:u};let r=$r(0,u,o,n),i=r;if(s===1)for(;i1){const a=Array(s).fill(0);for(;ic=0&&l.some(c=>c>=n);){const c=e[r];l[c.lane]=c.start,r--}r=Math.max(0,r-r%s),i=Math.min(u,i+(s-1-i%s))}return{startIndex:r,endIndex:i}}function sl(e){const t=new tl(S(e)),n=pu(t),s=t._didMount();return Ce(()=>S(e).getScrollElement(),u=>{u&&t._willUpdate()},{immediate:!0}),Ce(()=>S(e),u=>{t.setOptions({...u,onChange:(o,r)=>{var i;zu(n),(i=u.onChange)==null||i.call(u,o,r)}}),t._willUpdate(),zu(n)},{immediate:!0}),fi(s),n}function ul(e){return sl(A(()=>({observeElementRect:Ya,observeElementOffset:Xa,scrollToFn:el,...S(e)})))}const Un=k(!1),Nn=k({provider:"claude",model:"claude-haiku-4.5"}),On=k({provider:"openrouter",model:"meta-llama/llama-4-maverick"}),Hs=k(""),Ws=k(""),fn=k(!1),pn=k(!1),Vs=k(null),Gs=k(null);let jt=null;function Cu(){const e=A(()=>Un.value),t=A(()=>fn.value||pn.value);function n(){Un.value=!Un.value}function s(i,a,l){const c=i===1?Nn:On;c.value={provider:a,model:l}}function u(){Hs.value="",Ws.value="",Vs.value=null,Gs.value=null}function o(){jt&&(jt.abort(),jt=null),fn.value=!1,pn.value=!1}async function r(i,a){u(),jt=new AbortController;const l=jt.signal;fn.value=!0,pn.value=!0;const c=i(Nn.value.provider,Nn.value.model,a,h=>{Hs.value+=h},h=>{Vs.value=h},l).finally(()=>{fn.value=!1}),f=i(On.value.provider,On.value.model,a,h=>{Ws.value+=h},h=>{Gs.value=h},l).finally(()=>{pn.value=!1});await Promise.allSettled([c,f]),jt=null}return{comparisonEnabled:Un,isComparing:e,isAnyStreaming:t,model1:Nn,model2:On,response1:Hs,response2:Ws,isStreaming1:fn,isStreaming2:pn,error1:Vs,error2:Gs,toggleComparison:n,setModel:s,clearResponses:u,stopComparison:o,streamBothModels:r}}function au(e){return new Date(e).toLocaleString()}function ol(e){const t=[`# ${e.title} -`,`_Exported ${au(Date.now())}_ -`];for(const n of e.messages){const s=n.role==="user"?"**You**":"**Assistant**",u=au(n.timestamp);t.push(`### ${s} — ${u} -`),t.push(n.content+` -`)}return t.join(` -`)}function rl(e){return JSON.stringify(e,null,2)}function il(e){const t=[e.title,"=".repeat(e.title.length),""];for(const n of e.messages){const s=n.role==="user"?"You":"Assistant";t.push(`[${s}] ${au(n.timestamp)}`),t.push(n.content),t.push("")}return t.join(` -`)}function Ao(e){switch(e){case"markdown":return".md";case"json":return".json";case"text":return".txt"}}function Do(e){switch(e){case"markdown":return"text/markdown";case"json":return"application/json";case"text":return"text/plain"}}async function al(e,t){let n;switch(t){case"markdown":n=ol(e);break;case"json":n=rl(e);break;case"text":n=il(e);break}const s=`${e.title.replace(/[^a-zA-Z0-9 ]/g,"").trim().replace(/\s+/g,"-").toLowerCase()}${Ao(t)}`,u=new Blob([n],{type:Do(t)});if("showSaveFilePicker"in window)try{const a=await(await window.showSaveFilePicker({suggestedName:s,types:[{description:t==="markdown"?"Markdown":t==="json"?"JSON":"Text",accept:{[Do(t)]:[Ao(t)]}}]})).createWritable();await a.write(u),await a.close();return}catch{}const o=URL.createObjectURL(u),r=document.createElement("a");r.href=o,r.download=s,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(o)}function So(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function Eo(e){if(!e||typeof e!="object")return null;const t=e;return typeof t.id=="string"&&typeof t.title=="string"&&Array.isArray(t.messages)?t:null}function ll(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){if(!n||typeof n!="object")continue;const s=n;if(typeof s.uuid=="string"&&typeof s.name=="string"&&Array.isArray(s.chat_messages)){const u=[];for(const o of s.chat_messages){if(!o||typeof o!="object")continue;const r=o.sender==="human"?"user":"assistant",i=typeof o.text=="string"?o.text:"";u.push({id:So(),role:r,content:i,timestamp:typeof o.created_at=="string"?new Date(o.created_at).getTime():Date.now()})}t.push({id:So(),title:s.name,messages:u,createdAt:typeof s.created_at=="string"?new Date(s.created_at).getTime():Date.now(),updatedAt:typeof s.updated_at=="string"?new Date(s.updated_at).getTime():Date.now()})}}return t}function cl(e){try{const t=JSON.parse(e),n=Eo(t);if(n)return{conversations:[n],format:"aiui"};const s=ll(t);if(s.length>0)return{conversations:s,format:"claude"};if(Array.isArray(t)){const u=[];for(const o of t){const r=Eo(o);r&&u.push(r)}if(u.length>0)return{conversations:u,format:"aiui"}}return{conversations:[],format:"unknown",error:"Unrecognized format"}}catch{return{conversations:[],format:"unknown",error:"Invalid JSON"}}}const dl={class:"flex items-center justify-between gap-2"},fl=["title"],pl={class:"flex items-center gap-2 shrink-0"},hl=["title"],ml=["title"],gl={key:0,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},bl={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},xl=["title"],vl={class:"w-full text-left pt-3 pb-1 min-w-0"},yl={class:"text-sm font-semibold truncate text-white/96"},wl={class:"flex items-center gap-1.5 mt-0.5"},kl={class:"text-xs truncate font-mono text-white/40"},Cl={class:"text-xs truncate text-white/50"},_l={class:"text-xs font-semibold uppercase tracking-wider mb-1.5 px-1 text-white/40"},Al={class:"space-y-0.5"},Dl=["onClick"],Sl={class:"flex-1"},El={class:"flex gap-0.5 shrink-0"},$l={key:0,class:"text-xs opacity-60",title:"Supports vision input"},Fl={key:1,class:"text-xs opacity-60",title:"Supports tool use"},Ml={key:2,class:"text-xs opacity-60",title:"Long context window"},Tl=ne({__name:"ChatHeader",props:{title:{},conversationId:{},side:{},showClose:{type:Boolean}},emits:["switchSide","newChat","close","openSettings"],setup(e){const{activeProvider:t,activeModel:n,availableProviders:s,setProvider:u,setModel:o}=pr(),r=Cu(),i={"claude-haiku-4.5":{vision:!0,tools:!0,longContext:!0},"claude-sonnet-4":{vision:!0,tools:!0,longContext:!0},"claude-opus-4":{vision:!0,tools:!0,longContext:!0},"meta-llama/llama-4-maverick":{vision:!0,tools:!0,longContext:!0},"qwen/qwen3-235b-a22b-thinking-2507":{vision:!1,tools:!1,longContext:!0},"mistralai/mistral-small-3.1-24b-instruct:free":{vision:!0,tools:!0,longContext:!1},"google/gemma-3-27b-it:free":{vision:!0,tools:!1,longContext:!1},echo:{vision:!1,tools:!1,longContext:!1}};function a(K){return i[K]??{vision:!1,tools:!1,longContext:!1}}const l=wt(),c=k(!1),f=k(!1),h=k(null),b=k({}),g=k(null),v=k(null),E=k({});function _(){Me(()=>{const K=v.value;if(K){const I=K.getBoundingClientRect();E.value={top:`${I.bottom+4}px`,right:"auto",left:`${I.left}px`,width:`${Math.max(I.width+24,220)}px`}}})}function y(){Me(()=>{const K=h.value;if(K){const I=K.getBoundingClientRect();b.value={top:`${I.bottom+4}px`,right:`${window.innerWidth-I.right}px`}}})}Ce(c,K=>{K&&_()}),Ce(f,K=>{K&&y()});const x=A(()=>{for(const K of s.value){const I=K.models.find(X=>X.id===n.value);if(I)return I.name}return n.value});function w(K,I){u(K),o(I),c.value=!1}const{enterDesignSystemMode:M}=as();function P(){M(),c.value=!1}async function N(K){const I=l.activeConversation;I&&(await al(I,K),f.value=!1)}function se(){const K=l.activeConversationId;K&&(l.deleteConversation(K),f.value=!1)}const j=k(null),B=k(null);function Q(){f.value=!1,j.value?.click()}async function ee(K){const I=K.target,X=I.files?.[0];if(X){try{const fe=await X.text(),be=cl(fe);if(be.error||be.conversations.length===0)B.value=`Error: ${be.error??"No conversations found"}`;else{for(const te of be.conversations)l.conversations.set(te.id,te);const Ke=be.conversations.length;B.value=`Imported ${Ke} conversation${Ke>1?"s":""} (${be.format})`,l.setActiveConversation(be.conversations[0].id)}}catch{B.value="Error: Failed to read file"}I.value="",setTimeout(()=>{B.value=null},3e3)}}return(K,I)=>(p(),m("div",{ref_key:"headerRef",ref:g,class:"flex flex-col gap-0 p-3 relative z-[60] shrink-0"},[d("div",dl,[d("button",{ref_key:"modelPickerTriggerRef",ref:v,class:"touch-target rounded-xl path-glass-icon shrink-0 transition-colors cursor-pointer text-[#fafafa] hover:text-white",title:`AI model: ${x.value}`,"aria-label":"Select AI model",onClick:I[0]||(I[0]=X=>c.value=!c.value)},[...I[15]||(I[15]=[d("span",{class:"text-base"},"✦",-1)])],8,fl),d("div",pl,[d("button",{class:F(["touch-target rounded-xl path-glass-icon transition-colors",S(l).showHistory?"text-accent":"text-white/70 hover:text-white"]),title:S(l).showHistory?"Back to chat":"Chat history","aria-label":"Toggle chat history",onClick:I[1]||(I[1]=X=>S(l).toggleHistory())},[...I[16]||(I[16]=[d("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)])],10,hl),d("button",{class:F(["touch-target rounded-xl path-glass-icon transition-colors",S(l).chatCollapsed?"text-accent":"text-white/70 hover:text-white"]),title:S(l).chatCollapsed?"Expand chat":"Prompt index","aria-label":"Toggle prompt index",onClick:I[2]||(I[2]=X=>S(l).toggleChatCollapse())},[S(l).chatCollapsed?(p(),m("svg",bl,[...I[18]||(I[18]=[d("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"},null,-1)])])):(p(),m("svg",gl,[...I[17]||(I[17]=[d("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h10M4 18h16"},null,-1)])]))],10,ml),d("button",{class:F(["touch-target rounded-xl path-glass-icon transition-colors",S(r).isComparing.value?"text-accent":"text-white/70 hover:text-white"]),title:S(r).isComparing.value?"Comparison mode on":"Compare models","aria-label":"Toggle model comparison",onClick:I[3]||(I[3]=X=>S(r).toggleComparison())},[...I[19]||(I[19]=[d("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 17V7m0 10a2 2 0 01-2 2H5a2 2 0 01-2-2V7a2 2 0 012-2h2a2 2 0 012 2m0 10a2 2 0 002 2h2a2 2 0 002-2M9 7a2 2 0 012-2h2a2 2 0 012 2m0 10V7"})],-1)])],10,xl),d("button",{class:"touch-target rounded-xl path-glass-icon transition-colors text-white/70 hover:text-white","aria-label":"Settings",title:"Settings",onClick:I[4]||(I[4]=X=>K.$emit("openSettings"))},[...I[20]||(I[20]=[d("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),d("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})],-1)])]),d("button",{ref_key:"menuTriggerRef",ref:h,class:"touch-target rounded-xl path-glass-icon transition-colors text-white/70 hover:text-white","aria-label":"Conversation menu",onClick:I[5]||(I[5]=X=>f.value=!f.value)},[...I[21]||(I[21]=[d("svg",{class:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20"},[d("path",{d:"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z"})],-1)])],512),d("button",{class:"touch-target rounded-xl path-glass-icon transition-colors text-white/70 hover:text-white","aria-label":"New conversation",onClick:I[6]||(I[6]=X=>K.$emit("newChat"))},[...I[22]||(I[22]=[d("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1)])]),e.showClose?(p(),m("button",{key:0,class:"touch-target rounded-xl path-glass-icon transition-colors text-white/70 hover:text-white","aria-label":"Close",onClick:I[7]||(I[7]=X=>K.$emit("close"))},[...I[23]||(I[23]=[d("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])):D("",!0)])]),d("div",vl,[d("h2",yl,C(e.title),1),d("div",wl,[d("p",kl,C(e.conversationId),1),I[24]||(I[24]=d("span",{class:"text-xs text-white/20"},"·",-1)),d("span",Cl,C(x.value),1)])]),(p(),ie(xn,{to:"body"},[c.value?(p(),m("div",{key:0,class:"fixed inset-0 z-[9998]","aria-hidden":"true",onClick:I[8]||(I[8]=X=>c.value=!1)})):D("",!0),pe(Yn,{name:"picker"},{default:Ve(()=>[c.value?(p(),m("div",{key:0,class:"fixed z-[9999] path-glass-card p-3 space-y-3 animate-fade-up-fast shadow-2xl min-w-[220px]",style:Se(E.value),onClick:I[9]||(I[9]=H(()=>{},["stop"]))},[(p(!0),m(q,null,Y(S(s),X=>(p(),m("div",{key:X.id},[d("p",_l,C(X.name),1),d("div",Al,[(p(!0),m(q,null,Y(X.models,fe=>(p(),m("button",{key:fe.id,class:F(["w-full text-left px-3 py-2 rounded-lg text-xs transition-all duration-200 flex items-center gap-2",fe.id===S(n)&&X.id===S(t)?"nav-tab-active":"text-white/60 hover:text-white hover:bg-white/10"]),onClick:be=>w(X.id,fe.id)},[d("span",Sl,C(fe.name),1),d("span",El,[a(fe.id).vision?(p(),m("span",$l,"👁")):D("",!0),a(fe.id).tools?(p(),m("span",Fl,"🔧")):D("",!0),a(fe.id).longContext?(p(),m("span",Ml,"📄")):D("",!0)])],10,Dl))),128))])]))),128)),d("div",{class:"border-t mt-2 pt-2 border-white/10"},[d("button",{class:"w-full text-left px-3 py-2 rounded-lg text-xs transition-all duration-200 flex items-center gap-2 text-white/60 hover:text-white hover:bg-white/10",onClick:P},[...I[25]||(I[25]=[d("svg",{class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828l-8.486 8.485M7 17h.01"})],-1),ce(" Design System ",-1)])])])],4)):D("",!0)]),_:1})])),(p(),ie(xn,{to:"body"},[f.value?(p(),m("div",{key:0,class:"fixed inset-0 z-[9998]","aria-hidden":"true",onClick:I[10]||(I[10]=X=>f.value=!1)})):D("",!0),pe(Yn,{name:"picker"},{default:Ve(()=>[f.value?(p(),m("div",{key:0,class:"fixed z-[9999] path-glass-card p-2 animate-fade-up-fast shadow-2xl min-w-[160px]",style:Se(b.value),onClick:I[14]||(I[14]=H(()=>{},["stop"]))},[I[26]||(I[26]=d("p",{class:"text-xs font-semibold uppercase tracking-wider mb-1.5 px-2 text-white/40"},"Export",-1)),d("button",{class:"w-full text-left px-3 py-2 rounded-lg text-xs text-white/60 hover:text-white hover:bg-white/10 transition-all",onClick:I[11]||(I[11]=X=>N("markdown"))}," Markdown (.md) "),d("button",{class:"w-full text-left px-3 py-2 rounded-lg text-xs text-white/60 hover:text-white hover:bg-white/10 transition-all",onClick:I[12]||(I[12]=X=>N("json"))}," JSON "),d("button",{class:"w-full text-left px-3 py-2 rounded-lg text-xs text-white/60 hover:text-white hover:bg-white/10 transition-all",onClick:I[13]||(I[13]=X=>N("text"))}," Plain text (.txt) "),d("div",{class:"border-t border-white/10 mt-1 pt-1"},[d("button",{class:"w-full text-left px-3 py-2 rounded-lg text-xs text-white/60 hover:text-white hover:bg-white/10 transition-all",onClick:Q}," Import conversations "),d("button",{class:"w-full text-left px-3 py-2 rounded-lg text-xs text-red-400/80 hover:text-red-400 hover:bg-white/10 transition-all",onClick:se}," Delete conversation ")])],4)):D("",!0)]),_:1})])),d("input",{ref_key:"importInputRef",ref:j,type:"file",accept:".json",class:"hidden",onChange:ee},null,544),B.value?(p(),m("div",{key:0,class:F(["absolute top-full left-3 right-3 mt-1 z-[100] glass px-3 py-2 rounded-lg text-xs animate-fade-up-fast",B.value.startsWith("Error")?"text-red-400":"text-accent"])},C(B.value),3)):D("",!0)],512))}}),Il=os(Tl,[["__scopeId","data-v-2abf766d"]]),$o={};function Pl(e){let t=$o[e];if(t)return t;t=$o[e]=[];for(let n=0;n<128;n++){const s=String.fromCharCode(n);t.push(s)}for(let n=0;n=55296&&c<=57343?u+="���":u+=String.fromCharCode(c),o+=6;continue}}if((i&248)===240&&o+91114111?u+="����":(f-=65536,u+=String.fromCharCode(55296+(f>>10),56320+(f&1023))),o+=9;continue}}u+="�"}return u})}qt.defaultChars=";/?:@&=+$,#";qt.componentChars="";const Fo={};function Ll(e){let t=Fo[e];if(t)return t;t=Fo[e]=[];for(let n=0;n<128;n++){const s=String.fromCharCode(n);/^[0-9a-z]$/i.test(s)?t.push(s):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n"u"&&(n=!0);const s=Ll(t);let u="";for(let o=0,r=e.length;o=55296&&i<=57343){if(i>=55296&&i<=56319&&o+1=56320&&a<=57343){u+=encodeURIComponent(e[o]+e[o+1]),o++;continue}}u+="%EF%BF%BD";continue}u+=encodeURIComponent(e[o])}return u}Dn.defaultChars=";/?:@&=+$,-_.!~*'()#";Dn.componentChars="-_.!~*'()";function _u(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function ns(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const zl=/^([a-z0-9.+-]+:)/i,Bl=/:[0-9]*$/,Rl=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,jl=["<",">",'"',"`"," ","\r",` -`," "],Ul=["{","}","|","\\","^","`"].concat(jl),Nl=["'"].concat(Ul),Mo=["%","/","?",";","#"].concat(Nl),To=["/","?","#"],Ol=255,Io=/^[+a-z0-9A-Z_-]{0,63}$/,ql=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Po={javascript:!0,"javascript:":!0},Lo={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Au(e,t){if(e&&e instanceof ns)return e;const n=new ns;return n.parse(e,t),n}ns.prototype.parse=function(e,t){let n,s,u,o=e;if(o=o.trim(),!t&&e.split("#").length===1){const l=Rl.exec(o);if(l)return this.pathname=l[1],l[2]&&(this.search=l[2]),this}let r=zl.exec(o);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,o=o.substr(r.length)),(t||r||o.match(/^\/\/[^@\/]+@[^@\/]+/))&&(u=o.substr(0,2)==="//",u&&!(r&&Po[r])&&(o=o.substr(2),this.slashes=!0)),!Po[r]&&(u||r&&!Lo[r])){let l=-1;for(let g=0;g127?y+="x":y+=_[x];if(!y.match(Io)){const x=g.slice(0,v),w=g.slice(v+1),M=_.match(ql);M&&(x.push(M[1]),w.unshift(M[2])),w.length&&(o=w.join(".")+o),this.hostname=x.join(".");break}}}}this.hostname.length>Ol&&(this.hostname=""),b&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const i=o.indexOf("#");i!==-1&&(this.hash=o.substr(i),o=o.slice(0,i));const a=o.indexOf("?");return a!==-1&&(this.search=o.substr(a),o=o.slice(0,a)),o&&(this.pathname=o),Lo[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};ns.prototype.parseHost=function(e){let t=Bl.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};const Hl=Object.freeze(Object.defineProperty({__proto__:null,decode:qt,encode:Dn,format:_u,parse:Au},Symbol.toStringTag,{value:"Module"})),Fr=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Mr=/[\0-\x1F\x7F-\x9F]/,Wl=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,Du=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,Tr=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Ir=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,Vl=Object.freeze(Object.defineProperty({__proto__:null,Any:Fr,Cc:Mr,Cf:Wl,P:Du,S:Tr,Z:Ir},Symbol.toStringTag,{value:"Module"})),Gl=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),Kl=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0)));var Ks;const Jl=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),Zl=(Ks=String.fromCodePoint)!==null&&Ks!==void 0?Ks:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function Yl(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=Jl.get(e))!==null&&t!==void 0?t:e}var _e;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(_e||(_e={}));const Xl=32;var bt;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(bt||(bt={}));function lu(e){return e>=_e.ZERO&&e<=_e.NINE}function Ql(e){return e>=_e.UPPER_A&&e<=_e.UPPER_F||e>=_e.LOWER_A&&e<=_e.LOWER_F}function ec(e){return e>=_e.UPPER_A&&e<=_e.UPPER_Z||e>=_e.LOWER_A&&e<=_e.LOWER_Z||lu(e)}function tc(e){return e===_e.EQUALS||ec(e)}var ke;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(ke||(ke={}));var mt;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(mt||(mt={}));class nc{constructor(t,n,s){this.decodeTree=t,this.emitCodePoint=n,this.errors=s,this.state=ke.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=mt.Strict}startEntity(t){this.decodeMode=t,this.state=ke.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case ke.EntityStart:return t.charCodeAt(n)===_e.NUM?(this.state=ke.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=ke.NamedEntity,this.stateNamedEntity(t,n));case ke.NumericStart:return this.stateNumericStart(t,n);case ke.NumericDecimal:return this.stateNumericDecimal(t,n);case ke.NumericHex:return this.stateNumericHex(t,n);case ke.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|Xl)===_e.LOWER_X?(this.state=ke.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=ke.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,s,u){if(n!==s){const o=s-n;this.result=this.result*Math.pow(u,o)+parseInt(t.substr(n,o),u),this.consumed+=o}}stateNumericHex(t,n){const s=n;for(;n>14;for(;n>14,o!==0){if(r===_e.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==mt.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:s}=this,u=(s[n]&bt.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,u,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,s){const{decodeTree:u}=this;return this.emitCodePoint(n===1?u[t]&~bt.VALUE_LENGTH:u[t+1],s),n===3&&this.emitCodePoint(u[t+2],s),s}end(){var t;switch(this.state){case ke.NamedEntity:return this.result!==0&&(this.decodeMode!==mt.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ke.NumericDecimal:return this.emitNumericEntity(0,2);case ke.NumericHex:return this.emitNumericEntity(0,3);case ke.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ke.EntityStart:return 0}}}function Pr(e){let t="";const n=new nc(e,s=>t+=Zl(s));return function(u,o){let r=0,i=0;for(;(i=u.indexOf("&",i))>=0;){t+=u.slice(r,i),n.startEntity(o);const l=n.write(u,i+1);if(l<0){r=i+n.end();break}r=i+l,i=l===0?r+1:r}const a=t+u.slice(r);return t="",a}}function sc(e,t,n,s){const u=(t&bt.BRANCH_LENGTH)>>7,o=t&bt.JUMP_TABLE;if(u===0)return o!==0&&s===o?n:-1;if(o){const a=s-o;return a<0||a>=u?-1:e[n+a]-1}let r=n,i=r+u-1;for(;r<=i;){const a=r+i>>>1,l=e[a];if(ls)i=a-1;else return e[a+u]}return-1}const uc=Pr(Gl);Pr(Kl);function Lr(e,t=mt.Legacy){return uc(e,t)}function oc(e){return Object.prototype.toString.call(e)}function Su(e){return oc(e)==="[object String]"}const rc=Object.prototype.hasOwnProperty;function ic(e,t){return rc.call(e,t)}function ls(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){if(n){if(typeof n!="object")throw new TypeError(n+"must be object");Object.keys(n).forEach(function(s){e[s]=n[s]})}}),e}function zr(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function Eu(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function ss(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const Br=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,ac=/&([a-z#][a-z0-9]{1,31});/gi,lc=new RegExp(Br.source+"|"+ac.source,"gi"),cc=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function dc(e,t){if(t.charCodeAt(0)===35&&cc.test(t)){const s=t[1].toLowerCase()==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return Eu(s)?ss(s):e}const n=Lr(e);return n!==e?n:e}function fc(e){return e.indexOf("\\")<0?e:e.replace(Br,"$1")}function Ht(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(lc,function(t,n,s){return n||dc(t,s)})}const pc=/[&<>"]/,hc=/[&<>"]/g,mc={"&":"&","<":"<",">":">",'"':"""};function gc(e){return mc[e]}function vt(e){return pc.test(e)?e.replace(hc,gc):e}const bc=/[.?*+^$[\]\\(){}|-]/g;function xc(e){return e.replace(bc,"\\$&")}function le(e){switch(e){case 9:case 32:return!0}return!1}function yn(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function wn(e){return Du.test(e)||Tr.test(e)}function kn(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function cs(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}const vc={mdurl:Hl,ucmicro:Vl},yc=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:zr,assign:ls,escapeHtml:vt,escapeRE:xc,fromCodePoint:ss,has:ic,isMdAsciiPunct:kn,isPunctChar:wn,isSpace:le,isString:Su,isValidEntityCode:Eu,isWhiteSpace:yn,lib:vc,normalizeReference:cs,unescapeAll:Ht,unescapeMd:fc},Symbol.toStringTag,{value:"Module"}));function wc(e,t,n){let s,u,o,r;const i=e.posMax,a=e.pos;for(e.pos=t+1,s=1;e.pos32))return o;if(s===41){if(r===0)break;r--}u++}return t===u||r!==0||(o.str=Ht(e.slice(t,u)),o.pos=u,o.ok=!0),o}function Cc(e,t,n,s){let u,o=t;const r={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(s)r.str=s.str,r.marker=s.marker;else{if(o>=n)return r;let i=e.charCodeAt(o);if(i!==34&&i!==39&&i!==40)return r;t++,o++,i===40&&(i=41),r.marker=i}for(;o"+vt(o.content)+""};tt.code_block=function(e,t,n,s,u){const o=e[t];return""+vt(e[t].content)+` -`};tt.fence=function(e,t,n,s,u){const o=e[t],r=o.info?Ht(o.info).trim():"";let i="",a="";if(r){const c=r.split(/(\s+)/g);i=c[0],a=c.slice(2).join("")}let l;if(n.highlight?l=n.highlight(o.content,i,a)||vt(o.content):l=vt(o.content),l.indexOf("${l} -`}return`
${l}
-`};tt.image=function(e,t,n,s,u){const o=e[t];return o.attrs[o.attrIndex("alt")][1]=u.renderInlineAsText(o.children,n,s),u.renderToken(e,t,n)};tt.hardbreak=function(e,t,n){return n.xhtmlOut?`
-`:`
-`};tt.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`
-`:`
-`:` -`};tt.text=function(e,t){return vt(e[t].content)};tt.html_block=function(e,t){return e[t].content};tt.html_inline=function(e,t){return e[t].content};function Vt(){this.rules=ls({},tt)}Vt.prototype.renderAttrs=function(t){let n,s,u;if(!t.attrs)return"";for(u="",n=0,s=t.attrs.length;n -`:">",o};Vt.prototype.renderInline=function(e,t,n){let s="";const u=this.rules;for(let o=0,r=e.length;o=0&&(s=this.attrs[n][1]),s};Ge.prototype.attrJoin=function(t,n){const s=this.attrIndex(t);s<0?this.attrPush([t,n]):this.attrs[s][1]=this.attrs[s][1]+" "+n};function Rr(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}Rr.prototype.Token=Ge;const Ac=/\r\n?|\n/g,Dc=/\0/g;function Sc(e){let t;t=e.src.replace(Ac,` -`),t=t.replace(Dc,"�"),e.src=t}function Ec(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function $c(e){const t=e.tokens;for(let n=0,s=t.length;n\s]/i.test(e)}function Mc(e){return/^<\/a\s*>/i.test(e)}function Tc(e){const t=e.tokens;if(e.md.options.linkify)for(let n=0,s=t.length;n=0;r--){const i=u[r];if(i.type==="link_close"){for(r--;u[r].level!==i.level&&u[r].type!=="link_open";)r--;continue}if(i.type==="html_inline"&&(Fc(i.content)&&o>0&&o--,Mc(i.content)&&o++),!(o>0)&&i.type==="text"&&e.md.linkify.test(i.content)){const a=i.content;let l=e.md.linkify.match(a);const c=[];let f=i.level,h=0;l.length>0&&l[0].index===0&&r>0&&u[r-1].type==="text_special"&&(l=l.slice(1));for(let b=0;bh){const M=new e.Token("text","",0);M.content=a.slice(h,_),M.level=f,c.push(M)}const y=new e.Token("link_open","a",1);y.attrs=[["href",v]],y.level=f++,y.markup="linkify",y.info="auto",c.push(y);const x=new e.Token("text","",0);x.content=E,x.level=f,c.push(x);const w=new e.Token("link_close","a",-1);w.level=--f,w.markup="linkify",w.info="auto",c.push(w),h=l[b].lastIndex}if(h=0;n--){const s=e[n];s.type==="text"&&!t&&(s.content=s.content.replace(Pc,zc)),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function Rc(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.type==="text"&&!t&&jr.test(s.content)&&(s.content=s.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function jc(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(Ic.test(e.tokens[t].content)&&Bc(e.tokens[t].children),jr.test(e.tokens[t].content)&&Rc(e.tokens[t].children))}const Uc=/['"]/,zo=/['"]/g,Bo="’";function qn(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function Nc(e,t){let n;const s=[];for(let u=0;u=0&&!(s[n].level<=r);n--);if(s.length=n+1,o.type!=="text")continue;let i=o.content,a=0,l=i.length;e:for(;a=0)g=i.charCodeAt(c.index-1);else for(n=u-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){g=e[n].content.charCodeAt(e[n].content.length-1);break}let v=32;if(a=48&&g<=57&&(h=f=!1),f&&h&&(f=E,h=_),!f&&!h){b&&(o.content=qn(o.content,c.index,Bo));continue}if(h)for(n=s.length-1;n>=0;n--){let w=s[n];if(s[n].level=0;t--)e.tokens[t].type!=="inline"||!Uc.test(e.tokens[t].content)||Nc(e.tokens[t].children,e)}function qc(e){let t,n;const s=e.tokens,u=s.length;for(let o=0;o0&&this.level++,this.tokens.push(s),s};nt.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]};nt.prototype.skipEmptyLines=function(t){for(let n=this.lineMax;tn;)if(!le(this.src.charCodeAt(--t)))return t+1;return t};nt.prototype.skipChars=function(t,n){for(let s=this.src.length;ts;)if(n!==this.src.charCodeAt(--t))return t+1;return t};nt.prototype.getLines=function(t,n,s,u){if(t>=n)return"";const o=new Array(n-t);for(let r=0,i=t;is?o[r]=new Array(a-s+1).join(" ")+this.src.slice(c,f):o[r]=this.src.slice(c,f)}return o.join("")};nt.prototype.Token=Ge;const Hc=65536;function Zs(e,t){const n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];return e.src.slice(n,s)}function Ro(e){const t=[],n=e.length;let s=0,u=e.charCodeAt(s),o=!1,r=0,i="";for(;sn)return!1;let u=t+1;if(e.sCount[u]=4)return!1;let o=e.bMarks[u]+e.tShift[u];if(o>=e.eMarks[u])return!1;const r=e.src.charCodeAt(o++);if(r!==124&&r!==45&&r!==58||o>=e.eMarks[u])return!1;const i=e.src.charCodeAt(o++);if(i!==124&&i!==45&&i!==58&&!le(i)||r===45&&le(i))return!1;for(;o=4)return!1;l=Ro(a),l.length&&l[0]===""&&l.shift(),l.length&&l[l.length-1]===""&&l.pop();const f=l.length;if(f===0||f!==c.length)return!1;if(s)return!0;const h=e.parentType;e.parentType="table";const b=e.md.block.ruler.getRules("blockquote"),g=e.push("table_open","table",1),v=[t,0];g.map=v;const E=e.push("thead_open","thead",1);E.map=[t,t+1];const _=e.push("tr_open","tr",1);_.map=[t,t+1];for(let w=0;w=4||(l=Ro(a),l.length&&l[0]===""&&l.shift(),l.length&&l[l.length-1]===""&&l.pop(),x+=f-l.length,x>Hc))break;if(u===t+2){const P=e.push("tbody_open","tbody",1);P.map=y=[t+2,0]}const M=e.push("tr_open","tr",1);M.map=[u,u+1];for(let P=0;P=4){s++,u=s;continue}break}e.line=u;const o=e.push("code_block","code",0);return o.content=e.getLines(t,u,4+e.blkIndent,!1)+` -`,o.map=[t,e.line],!0}function Gc(e,t,n,s){let u=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||u+3>o)return!1;const r=e.src.charCodeAt(u);if(r!==126&&r!==96)return!1;let i=u;u=e.skipChars(u,r);let a=u-i;if(a<3)return!1;const l=e.src.slice(i,u),c=e.src.slice(u,o);if(r===96&&c.indexOf(String.fromCharCode(r))>=0)return!1;if(s)return!0;let f=t,h=!1;for(;f++,!(f>=n||(u=i=e.bMarks[f]+e.tShift[f],o=e.eMarks[f],u=4)&&(u=e.skipChars(u,r),!(u-i=4||e.src.charCodeAt(u)!==62)return!1;if(s)return!0;const i=[],a=[],l=[],c=[],f=e.md.block.ruler.getRules("blockquote"),h=e.parentType;e.parentType="blockquote";let b=!1,g;for(g=t;g=o)break;if(e.src.charCodeAt(u++)===62&&!x){let M=e.sCount[g]+1,P,N;e.src.charCodeAt(u)===32?(u++,M++,N=!1,P=!0):e.src.charCodeAt(u)===9?(P=!0,(e.bsCount[g]+M)%4===3?(u++,M++,N=!1):N=!0):P=!1;let se=M;for(i.push(e.bMarks[g]),e.bMarks[g]=u;u=o,a.push(e.bsCount[g]),e.bsCount[g]=e.sCount[g]+1+(P?1:0),l.push(e.sCount[g]),e.sCount[g]=se-M,c.push(e.tShift[g]),e.tShift[g]=u-e.bMarks[g];continue}if(b)break;let w=!1;for(let M=0,P=f.length;M";const _=[t,0];E.map=_,e.md.block.tokenize(e,t,g);const y=e.push("blockquote_close","blockquote",-1);y.markup=">",e.lineMax=r,e.parentType=h,_[1]=e.line;for(let x=0;x=4)return!1;let o=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(o++);if(r!==42&&r!==45&&r!==95)return!1;let i=1;for(;o=s)return-1;let o=e.src.charCodeAt(u++);if(o<48||o>57)return-1;for(;;){if(u>=s)return-1;if(o=e.src.charCodeAt(u++),o>=48&&o<=57){if(u-n>=10)return-1;continue}if(o===41||o===46)break;return-1}return u=4||e.listIndent>=0&&e.sCount[a]-e.listIndent>=4&&e.sCount[a]=e.blkIndent&&(c=!0);let f,h,b;if((b=Uo(e,a))>=0){if(f=!0,r=e.bMarks[a]+e.tShift[a],h=Number(e.src.slice(r,b-1)),c&&h!==1)return!1}else if((b=jo(e,a))>=0)f=!1;else return!1;if(c&&e.skipSpaces(b)>=e.eMarks[a])return!1;if(s)return!0;const g=e.src.charCodeAt(b-1),v=e.tokens.length;f?(i=e.push("ordered_list_open","ol",1),h!==1&&(i.attrs=[["start",h]])):i=e.push("bullet_list_open","ul",1);const E=[a,0];i.map=E,i.markup=String.fromCharCode(g);let _=!1;const y=e.md.block.ruler.getRules("list"),x=e.parentType;for(e.parentType="list";a=u?N=1:N=M-w,N>4&&(N=1);const se=w+N;i=e.push("list_item_open","li",1),i.markup=String.fromCharCode(g);const j=[a,0];i.map=j,f&&(i.info=e.src.slice(r,b-1));const B=e.tight,Q=e.tShift[a],ee=e.sCount[a],K=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=se,e.tight=!0,e.tShift[a]=P-e.bMarks[a],e.sCount[a]=M,P>=u&&e.isEmpty(a+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,a,n,!0),(!e.tight||_)&&(l=!1),_=e.line-a>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=K,e.tShift[a]=Q,e.sCount[a]=ee,e.tight=B,i=e.push("list_item_close","li",-1),i.markup=String.fromCharCode(g),a=e.line,j[1]=a,a>=n||e.sCount[a]=4)break;let I=!1;for(let X=0,fe=y.length;X=4||e.src.charCodeAt(u)!==91)return!1;function i(y){const x=e.lineMax;if(y>=x||e.isEmpty(y))return null;let w=!1;if(e.sCount[y]-e.blkIndent>3&&(w=!0),e.sCount[y]<0&&(w=!0),!w){const N=e.md.block.ruler.getRules("reference"),se=e.parentType;e.parentType="reference";let j=!1;for(let B=0,Q=N.length;B"u"&&(e.env.references={}),typeof e.env.references[_]>"u"&&(e.env.references[_]={title:E,href:f}),e.line=r),!0):!1}const Qc=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],e0="[a-zA-Z_:][a-zA-Z0-9:._-]*",t0="[^\"'=<>`\\x00-\\x20]+",n0="'[^']*'",s0='"[^"]*"',u0="(?:"+t0+"|"+n0+"|"+s0+")",o0="(?:\\s+"+e0+"(?:\\s*=\\s*"+u0+")?)",Ur="<[A-Za-z][A-Za-z0-9\\-]*"+o0+"*\\s*\\/?>",Nr="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",r0="",i0="<[?][\\s\\S]*?[?]>",a0="]*>",l0="",c0=new RegExp("^(?:"+Ur+"|"+Nr+"|"+r0+"|"+i0+"|"+a0+"|"+l0+")"),d0=new RegExp("^(?:"+Ur+"|"+Nr+")"),Ut=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(d0.source+"\\s*$"),/^$/,!1]];function f0(e,t,n,s){let u=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(u)!==60)return!1;let r=e.src.slice(u,o),i=0;for(;i=4)return!1;let r=e.src.charCodeAt(u);if(r!==35||u>=o)return!1;let i=1;for(r=e.src.charCodeAt(++u);r===35&&u6||uu&&le(e.src.charCodeAt(a-1))&&(o=a),e.line=t+1;const l=e.push("heading_open","h"+String(i),1);l.markup="########".slice(0,i),l.map=[t,e.line];const c=e.push("inline","",0);c.content=e.src.slice(u,o).trim(),c.map=[t,e.line],c.children=[];const f=e.push("heading_close","h"+String(i),-1);return f.markup="########".slice(0,i),!0}function h0(e,t,n){const s=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const u=e.parentType;e.parentType="paragraph";let o=0,r,i=t+1;for(;i3)continue;if(e.sCount[i]>=e.blkIndent){let b=e.bMarks[i]+e.tShift[i];const g=e.eMarks[i];if(b=g))){o=r===61?1:2;break}}if(e.sCount[i]<0)continue;let h=!1;for(let b=0,g=s.length;b3||e.sCount[o]<0)continue;let l=!1;for(let c=0,f=s.length;c=n||e.sCount[r]=o){e.line=n;break}const a=e.line;let l=!1;for(let c=0;c=e.line)throw new Error("block rule didn't increment state.line");break}if(!l)throw new Error("none of the block rules matched");e.tight=!i,e.isEmpty(e.line-1)&&(i=!0),r=e.line,r0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],u={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(s),this.tokens_meta.push(u),s};Sn.prototype.scanDelims=function(e,t){const n=this.posMax,s=this.src.charCodeAt(e),u=e>0?this.src.charCodeAt(e-1):32;let o=e;for(;o0)return!1;const n=e.pos,s=e.posMax;if(n+3>s||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const u=e.pending.match(x0);if(!u)return!1;const o=u[1],r=e.md.linkify.matchAtStart(e.src.slice(n-o.length));if(!r)return!1;let i=r.url;if(i.length<=o.length)return!1;let a=i.length;for(;a>0&&i.charCodeAt(a-1)===42;)a--;a!==i.length&&(i=i.slice(0,a));const l=e.md.normalizeLink(i);if(!e.md.validateLink(l))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const c=e.push("link_open","a",1);c.attrs=[["href",l]],c.markup="linkify",c.info="auto";const f=e.push("text","",0);f.content=e.md.normalizeLinkText(i);const h=e.push("link_close","a",-1);h.markup="linkify",h.info="auto"}return e.pos+=i.length-o.length,!0}function y0(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const s=e.pending.length-1,u=e.posMax;if(!t)if(s>=0&&e.pending.charCodeAt(s)===32)if(s>=1&&e.pending.charCodeAt(s-1)===32){let o=s-1;for(;o>=1&&e.pending.charCodeAt(o-1)===32;)o--;e.pending=e.pending.slice(0,o),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n?@[]^_`{|}~-".split("").forEach(function(e){Fu[e.charCodeAt(0)]=1});function w0(e,t){let n=e.pos;const s=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=s))return!1;let u=e.src.charCodeAt(n);if(u===10){for(t||e.push("hardbreak","br",0),n++;n=55296&&u<=56319&&n+1=56320&&i<=57343&&(o+=e.src[n+1],n++)}const r="\\"+o;if(!t){const i=e.push("text_special","",0);u<256&&Fu[u]!==0?i.content=o:i.content=r,i.markup=r,i.info="escape"}return e.pos=n+1,!0}function k0(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;const u=n;n++;const o=e.posMax;for(;n=0;s--){const u=t[s];if(u.marker!==95&&u.marker!==42||u.end===-1)continue;const o=t[u.end],r=s>0&&t[s-1].end===u.end+1&&t[s-1].marker===u.marker&&t[s-1].token===u.token-1&&t[u.end+1].token===o.token+1,i=String.fromCharCode(u.marker),a=e.tokens[u.token];a.type=r?"strong_open":"em_open",a.tag=r?"strong":"em",a.nesting=1,a.markup=r?i+i:i,a.content="";const l=e.tokens[o.token];l.type=r?"strong_close":"em_close",l.tag=r?"strong":"em",l.nesting=-1,l.markup=r?i+i:i,l.content="",r&&(e.tokens[t[s-1].token].content="",e.tokens[t[u.end+1].token].content="",s--)}}function D0(e){const t=e.tokens_meta,n=e.tokens_meta.length;Oo(e,e.delimiters);for(let s=0;s=f)return!1;if(a=g,u=e.md.helpers.parseLinkDestination(e.src,g,e.posMax),u.ok){for(r=e.md.normalizeLink(u.str),e.md.validateLink(r)?g=u.pos:r="",a=g;g=f||e.src.charCodeAt(g)!==41)&&(l=!0),g++}if(l){if(typeof e.env.references>"u")return!1;if(g=0?s=e.src.slice(a,g++):g=b+1):g=b+1,s||(s=e.src.slice(h,b)),o=e.env.references[cs(s)],!o)return e.pos=c,!1;r=o.href,i=o.title}if(!t){e.pos=h,e.posMax=b;const v=e.push("link_open","a",1),E=[["href",r]];v.attrs=E,i&&E.push(["title",i]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=g,e.posMax=f,!0}function E0(e,t){let n,s,u,o,r,i,a,l,c="";const f=e.pos,h=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const b=e.pos+2,g=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(g<0)return!1;if(o=g+1,o=h)return!1;for(l=o,i=e.md.helpers.parseLinkDestination(e.src,o,e.posMax),i.ok&&(c=e.md.normalizeLink(i.str),e.md.validateLink(c)?o=i.pos:c=""),l=o;o=h||e.src.charCodeAt(o)!==41)return e.pos=f,!1;o++}else{if(typeof e.env.references>"u")return!1;if(o=0?u=e.src.slice(l,o++):o=g+1):o=g+1,u||(u=e.src.slice(b,g)),r=e.env.references[cs(u)],!r)return e.pos=f,!1;c=r.href,a=r.title}if(!t){s=e.src.slice(b,g);const v=[];e.md.inline.parse(s,e.md,e.env,v);const E=e.push("image","img",0),_=[["src",c],["alt",""]];E.attrs=_,E.children=v,E.content=s,a&&_.push(["title",a])}return e.pos=o,e.posMax=h,!0}const $0=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,F0=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function M0(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;const s=e.pos,u=e.posMax;for(;;){if(++n>=u)return!1;const r=e.src.charCodeAt(n);if(r===60)return!1;if(r===62)break}const o=e.src.slice(s+1,n);if(F0.test(o)){const r=e.md.normalizeLink(o);if(!e.md.validateLink(r))return!1;if(!t){const i=e.push("link_open","a",1);i.attrs=[["href",r]],i.markup="autolink",i.info="auto";const a=e.push("text","",0);a.content=e.md.normalizeLinkText(o);const l=e.push("link_close","a",-1);l.markup="autolink",l.info="auto"}return e.pos+=o.length+2,!0}if($0.test(o)){const r=e.md.normalizeLink("mailto:"+o);if(!e.md.validateLink(r))return!1;if(!t){const i=e.push("link_open","a",1);i.attrs=[["href",r]],i.markup="autolink",i.info="auto";const a=e.push("text","",0);a.content=e.md.normalizeLinkText(o);const l=e.push("link_close","a",-1);l.markup="autolink",l.info="auto"}return e.pos+=o.length+2,!0}return!1}function T0(e){return/^\s]/i.test(e)}function I0(e){return/^<\/a\s*>/i.test(e)}function P0(e){const t=e|32;return t>=97&&t<=122}function L0(e,t){if(!e.md.options.html)return!1;const n=e.posMax,s=e.pos;if(e.src.charCodeAt(s)!==60||s+2>=n)return!1;const u=e.src.charCodeAt(s+1);if(u!==33&&u!==63&&u!==47&&!P0(u))return!1;const o=e.src.slice(s).match(c0);if(!o)return!1;if(!t){const r=e.push("html_inline","",0);r.content=o[0],T0(r.content)&&e.linkLevel++,I0(r.content)&&e.linkLevel--}return e.pos+=o[0].length,!0}const z0=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,B0=/^&([a-z][a-z0-9]{1,31});/i;function R0(e,t){const n=e.pos,s=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=s)return!1;if(e.src.charCodeAt(n+1)===35){const o=e.src.slice(n).match(z0);if(o){if(!t){const r=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),i=e.push("text_special","",0);i.content=Eu(r)?ss(r):ss(65533),i.markup=o[0],i.info="entity"}return e.pos+=o[0].length,!0}}else{const o=e.src.slice(n).match(B0);if(o){const r=Lr(o[0]);if(r!==o[0]){if(!t){const i=e.push("text_special","",0);i.content=r,i.markup=o[0],i.info="entity"}return e.pos+=o[0].length,!0}}}return!1}function qo(e){const t={},n=e.length;if(!n)return;let s=0,u=-2;const o=[];for(let r=0;ra;l-=o[l]+1){const f=e[l];if(f.marker===i.marker&&f.open&&f.end<0){let h=!1;if((f.close||i.open)&&(f.length+i.length)%3===0&&(f.length%3!==0||i.length%3!==0)&&(h=!0),!h){const b=l>0&&!e[l-1].open?o[l-1]+1:0;o[r]=r-l+b,o[l]=b,i.open=!1,f.end=r,f.close=!1,c=-1,u=-2;break}}}c!==-1&&(t[i.marker][(i.open?3:0)+(i.length||0)%3]=c)}}function j0(e){const t=e.tokens_meta,n=e.tokens_meta.length;qo(e.delimiters);for(let s=0;s0&&s++,u[t].type==="text"&&t+1=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;r||e.pos++,o[t]=e.pos};En.prototype.tokenize=function(e){const t=this.ruler.getRules(""),n=t.length,s=e.posMax,u=e.md.options.maxNesting;for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=s)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()};En.prototype.parse=function(e,t,n,s){const u=new this.State(e,t,n,s);this.tokenize(u);const o=this.ruler2.getRules(""),r=o.length;for(let i=0;i|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function cu(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(s){e[s]=n[s]})}),e}function fs(e){return Object.prototype.toString.call(e)}function O0(e){return fs(e)==="[object String]"}function q0(e){return fs(e)==="[object Object]"}function H0(e){return fs(e)==="[object RegExp]"}function Ho(e){return fs(e)==="[object Function]"}function W0(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const Hr={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function V0(e){return Object.keys(e||{}).reduce(function(t,n){return t||Hr.hasOwnProperty(n)},!1)}const G0={"http:":{validate:function(e,t,n){const s=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(s)?s.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const s=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(s)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:s.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const s=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(s)?s.match(n.re.mailto)[0].length:0}}},K0="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",J0="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function Z0(e){e.__index__=-1,e.__text_cache__=""}function Y0(e){return function(t,n){const s=t.slice(n);return e.test(s)?s.match(e)[0].length:0}}function Wo(){return function(e,t){t.normalize(e)}}function us(e){const t=e.re=N0(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(K0),n.push(t.src_xn),t.src_tlds=n.join("|");function s(i){return i.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(s(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(s(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(s(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(s(t.tpl_host_fuzzy_test),"i");const u=[];e.__compiled__={};function o(i,a){throw new Error('(LinkifyIt) Invalid schema "'+i+'": '+a)}Object.keys(e.__schemas__).forEach(function(i){const a=e.__schemas__[i];if(a===null)return;const l={validate:null,link:null};if(e.__compiled__[i]=l,q0(a)){H0(a.validate)?l.validate=Y0(a.validate):Ho(a.validate)?l.validate=a.validate:o(i,a),Ho(a.normalize)?l.normalize=a.normalize:a.normalize?o(i,a):l.normalize=Wo();return}if(O0(a)){u.push(i);return}o(i,a)}),u.forEach(function(i){e.__compiled__[e.__schemas__[i]]&&(e.__compiled__[i].validate=e.__compiled__[e.__schemas__[i]].validate,e.__compiled__[i].normalize=e.__compiled__[e.__schemas__[i]].normalize)}),e.__compiled__[""]={validate:null,normalize:Wo()};const r=Object.keys(e.__compiled__).filter(function(i){return i.length>0&&e.__compiled__[i]}).map(W0).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),Z0(e)}function X0(e,t){const n=e.__index__,s=e.__last_index__,u=e.__text_cache__.slice(n,s);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=s+t,this.raw=u,this.text=u,this.url=u}function du(e,t){const n=new X0(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function Be(e,t){if(!(this instanceof Be))return new Be(e,t);t||V0(e)&&(t=e,e={}),this.__opts__=cu({},Hr,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=cu({},G0,e),this.__compiled__={},this.__tlds__=J0,this.__tlds_replaced__=!1,this.re={},us(this)}Be.prototype.add=function(t,n){return this.__schemas__[t]=n,us(this),this};Be.prototype.set=function(t){return this.__opts__=cu(this.__opts__,t),this};Be.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;let n,s,u,o,r,i,a,l,c;if(this.re.schema_test.test(t)){for(a=this.re.schema_search,a.lastIndex=0;(n=a.exec(t))!==null;)if(o=this.testSchemaAt(t,n[2],a.lastIndex),o){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+o;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=t.search(this.re.host_fuzzy_test),l>=0&&(this.__index__<0||l=0&&(u=t.match(this.re.email_fuzzy))!==null&&(r=u.index+u[1].length,i=u.index+u[0].length,(this.__index__<0||rthis.__last_index__)&&(this.__schema__="mailto:",this.__index__=r,this.__last_index__=i))),this.__index__>=0};Be.prototype.pretest=function(t){return this.re.pretest.test(t)};Be.prototype.testSchemaAt=function(t,n,s){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,s,this):0};Be.prototype.match=function(t){const n=[];let s=0;this.__index__>=0&&this.__text_cache__===t&&(n.push(du(this,s)),s=this.__last_index__);let u=s?t.slice(s):t;for(;this.test(u);)n.push(du(this,s)),u=u.slice(this.__last_index__),s+=this.__last_index__;return n.length?n:null};Be.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const s=this.testSchemaAt(t,n[2],n[0].length);return s?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+s,du(this,0)):null};Be.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(s,u,o){return s!==o[u-1]}).reverse(),us(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,us(this),this)};Be.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};Be.prototype.onCompile=function(){};const Nt=2147483647,Qe=36,Mu=1,Cn=26,Q0=38,ed=700,Wr=72,Vr=128,Gr="-",td=/^xn--/,nd=/[^\0-\x7F]/,sd=/[\x2E\u3002\uFF0E\uFF61]/g,ud={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Qs=Qe-Mu,et=Math.floor,eu=String.fromCharCode;function ht(e){throw new RangeError(ud[e])}function od(e,t){const n=[];let s=e.length;for(;s--;)n[s]=t(e[s]);return n}function Kr(e,t){const n=e.split("@");let s="";n.length>1&&(s=n[0]+"@",e=n[1]),e=e.replace(sd,".");const u=e.split("."),o=od(u,t).join(".");return s+o}function Jr(e){const t=[];let n=0;const s=e.length;for(;n=55296&&u<=56319&&nString.fromCodePoint(...e),id=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:Qe},Vo=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},Zr=function(e,t,n){let s=0;for(e=n?et(e/ed):e>>1,e+=et(e/t);e>Qs*Cn>>1;s+=Qe)e=et(e/Qs);return et(s+(Qs+1)*e/(e+Q0))},Yr=function(e){const t=[],n=e.length;let s=0,u=Vr,o=Wr,r=e.lastIndexOf(Gr);r<0&&(r=0);for(let i=0;i=128&&ht("not-basic"),t.push(e.charCodeAt(i));for(let i=r>0?r+1:0;i=n&&ht("invalid-input");const h=id(e.charCodeAt(i++));h>=Qe&&ht("invalid-input"),h>et((Nt-s)/c)&&ht("overflow"),s+=h*c;const b=f<=o?Mu:f>=o+Cn?Cn:f-o;if(het(Nt/g)&&ht("overflow"),c*=g}const l=t.length+1;o=Zr(s-a,l,a==0),et(s/l)>Nt-u&&ht("overflow"),u+=et(s/l),s%=l,t.splice(s++,0,u)}return String.fromCodePoint(...t)},Xr=function(e){const t=[];e=Jr(e);const n=e.length;let s=Vr,u=0,o=Wr;for(const a of e)a<128&&t.push(eu(a));const r=t.length;let i=r;for(r&&t.push(Gr);i=s&&cet((Nt-u)/l)&&ht("overflow"),u+=(a-s)*l,s=a;for(const c of e)if(cNt&&ht("overflow"),c===s){let f=u;for(let h=Qe;;h+=Qe){const b=h<=o?Mu:h>=o+Cn?Cn:h-o;if(f=0))try{t.hostname=Qr.toASCII(t.hostname)}catch{}return Dn(_u(t))}function xd(e){const t=Au(e,!0);if(t.hostname&&(!t.protocol||ei.indexOf(t.protocol)>=0))try{t.hostname=Qr.toUnicode(t.hostname)}catch{}return qt(_u(t),qt.defaultChars+"%")}function Re(e,t){if(!(this instanceof Re))return new Re(e,t);t||Su(e)||(t=e||{},e="default"),this.inline=new En,this.block=new ds,this.core=new $u,this.renderer=new Vt,this.linkify=new Be,this.validateLink=gd,this.normalizeLink=bd,this.normalizeLinkText=xd,this.utils=yc,this.helpers=ls({},_c),this.options={},this.configure(e),t&&this.set(t)}Re.prototype.set=function(e){return ls(this.options,e),this};Re.prototype.configure=function(e){const t=this;if(Su(e)){const n=e;if(e=pd[n],!e)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this};Re.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(u){n=n.concat(this[u].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));const s=e.filter(function(u){return n.indexOf(u)<0});if(s.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+s);return this};Re.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(u){n=n.concat(this[u].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));const s=e.filter(function(u){return n.indexOf(u)<0});if(s.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+s);return this};Re.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this};Re.prototype.parse=function(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens};Re.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)};Re.prototype.parseInline=function(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens};Re.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};let bn=null,Wn=null;async function vd(){return bn||Wn||(Wn=hu(()=>import("./katex-DGN8GczM.js"),[]).then(e=>{if(bn=e,!document.getElementById("katex-css")){const t=document.createElement("link");t.id="katex-css",t.rel="stylesheet",t.href=new URL("/aiui/assets/katex.min-CASE1JAf.css",import.meta.url).toString(),document.head.appendChild(t)}return e}),Wn)}const yd=/\$\$([\s\S]+?)\$\$/g,wd=/\$([^\n$]+?)\$/g;function Go(e,t){if(!bn)return`${Ko(e)}`;try{return bn.default.renderToString(e,{displayMode:t,throwOnError:!1,output:"html"})}catch{return`${Ko(e)}`}}function Ko(e){return e.replace(/&/g,"&").replace(//g,">")}function kd(e){return/\$\$[\s\S]+?\$\$/.test(e)||/\$[^\n$]+?\$/.test(e)}async function Cd(e){await vd();let t=e.replace(yd,(n,s)=>`
${Go(s.trim(),!0)}
`);return t=t.replace(wd,(n,s)=>Go(s.trim(),!1)),t}let Ot=null,Vn=null,Jo=!1;async function _d(){return Ot||Vn||(Vn=hu(()=>import("./mermaid.core-CAd6zjbx.js").then(e=>e.bE),__vite__mapDeps([0,1,2])).then(e=>(Ot=e,e)),Vn)}function Ad(){Jo||!Ot||(Ot.default.initialize({startOnLoad:!1,theme:"dark",themeVariables:{primaryColor:"#F7931A",primaryTextColor:"#fff",primaryBorderColor:"#F7931A",lineColor:"#666",secondaryColor:"#1a1a1a",tertiaryColor:"#111",background:"#0a0a0a",mainBkg:"#1a1a1a",nodeBorder:"#444",clusterBkg:"#111",clusterBorder:"#333",titleColor:"#ddd",edgeLabelBackground:"#1a1a1a"},fontFamily:"Inter, system-ui, sans-serif",fontSize:13}),Jo=!0)}const tu=new Map;function Dd(e){return/```mermaid/i.test(e)}let Sd=0;async function Ed(e){await _d(),Ad();const t=Ot.default,n=/
([\s\S]*?)<\/code><\/pre>/gi,s=[...e.matchAll(n)];if(s.length===0)return e;let u=e;for(const o of s){const r=o[1].replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").trim(),i=r;if(tu.has(i)){u=u.replace(o[0],tu.get(i));continue}try{const a=`mermaid-${++Sd}`,{svg:l}=await t.render(a,r),c=`
${l}
`;tu.set(i,c),u=u.replace(o[0],c)}catch{const a=`
Mermaid render error
${o[1]}
`;u=u.replace(o[0],a)}}return u}const $d=ne({__name:"ContextMenu",setup(e,{expose:t}){const n=k(!1),s=k(0),u=k(0),o=A(()=>{const f=Math.min(s.value,window.innerWidth-160-8),h=Math.min(u.value,window.innerHeight-200-8);return{left:`${Math.max(8,f)}px`,top:`${Math.max(8,h)}px`}});function r(l,c){s.value=l,u.value=c,n.value=!0}function i(){n.value=!1}function a(l){l.key==="Escape"&&n.value&&i()}return Le(()=>{document.addEventListener("keydown",a)}),ur(()=>{document.removeEventListener("keydown",a)}),t({open:r,close:i,isOpen:n}),(l,c)=>(p(),ie(xn,{to:"body"},[n.value?(p(),m("div",{key:0,class:"fixed inset-0 z-[9998]","aria-hidden":"true",onClick:i,onContextmenu:H(i,["prevent"])},null,32)):D("",!0),pe(Yn,{name:"context-menu"},{default:Ve(()=>[n.value?(p(),m("div",{key:0,class:"fixed z-[9999] glass-card p-1.5 rounded-xl shadow-2xl animate-scale-in min-w-[140px]",style:Se(o.value),role:"menu",onClick:c[0]||(c[0]=H(()=>{},["stop"]))},[mu(l.$slots,"default",{},void 0,!0)],4)):D("",!0)]),_:3})]))}}),Fd=os($d,[["__scopeId","data-v-13d6c372"]]),hn=ne({__name:"ContextMenuItem",props:{destructive:{type:Boolean,default:!1}},emits:["click"],setup(e){return(t,n)=>(p(),m("button",{class:F(["w-full text-left px-3 py-2 rounded-lg text-xs transition-all flex items-center gap-2",e.destructive?"text-red-400/80 hover:text-red-400 hover:bg-white/10":"text-white/60 hover:text-white hover:bg-white/10"]),role:"menuitem",onClick:n[0]||(n[0]=s=>t.$emit("click"))},[mu(t.$slots,"default")],2))}}),Md=["aria-label"],Td=["fill"],ti=ne({__name:"FavoriteButton",props:{favorited:{type:Boolean}},emits:["toggle"],setup(e){const{isDark:t}=He();return(n,s)=>(p(),m("button",{class:F(["p-1 rounded-full transition-all duration-200 active:scale-125",e.favorited?"text-accent hover:text-accent/80":S(t)?"text-white/20 hover:text-white/50":"text-gray-300 hover:text-gray-500"]),"aria-label":e.favorited?"Remove from favorites":"Add to favorites",onClick:s[0]||(s[0]=H(u=>n.$emit("toggle"),["stop"]))},[(p(),m("svg",{class:F(["w-4 h-4 transition-transform duration-200",{"scale-110":e.favorited}]),fill:e.favorited?"currentColor":"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...s[1]||(s[1]=[d("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"},null,-1)])],10,Td))],10,Md))}}),yt="favorites",Id="aiui-favorites",Pd=1;function Tu(){return new Promise((e,t)=>{const n=indexedDB.open(Id,Pd);n.onupgradeneeded=()=>{const s=n.result;if(!s.objectStoreNames.contains(yt)){const u=s.createObjectStore(yt,{keyPath:"id"});u.createIndex("type","type",{unique:!1}),u.createIndex("savedAt","savedAt",{unique:!1})}},n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)})}async function Ld(){const e=await Tu();return new Promise((t,n)=>{const o=e.transaction(yt,"readonly").objectStore(yt).getAll();o.onsuccess=()=>t(o.result),o.onerror=()=>n(o.error)})}async function zd(e){const t=await Tu();return new Promise((n,s)=>{const r=t.transaction(yt,"readwrite").objectStore(yt).put(e);r.onsuccess=()=>n(),r.onerror=()=>s(r.error)})}async function Bd(e){const t=await Tu();return new Promise((n,s)=>{const r=t.transaction(yt,"readwrite").objectStore(yt).delete(e);r.onsuccess=()=>n(),r.onerror=()=>s(r.error)})}const ni=_n("favorites",()=>{const e=k([]),t=k(!1);async function n(){try{e.value=await Ld()}catch{}t.value=!0}n();const s=A(()=>[...e.value].sort((l,c)=>c.savedAt-l.savedAt));function u(l){return e.value.some(c=>c.id===l)}async function o(l){if(u(l.id))return;const c={...l,savedAt:Date.now()};e.value=[...e.value,c],zd(c).catch(()=>{})}async function r(l){e.value=e.value.filter(c=>c.id!==l),Bd(l).catch(()=>{})}async function i(l){u(l.id)?await r(l.id):await o(l)}function a(l){return s.value.filter(c=>c.type===l)}return{items:e,sortedItems:s,loaded:t,isFavorited:u,addFavorite:o,removeFavorite:r,toggleFavorite:i,getFavoritesByType:a}}),Rd={class:"poster-card-sm shrink-0 w-12 aspect-[2/3] rounded-lg overflow-hidden"},jd=["src","alt"],Ud={class:"min-w-0 flex-1 py-0.5"},Nd={class:"flex items-center gap-1.5 mt-1.5"},Od=ne({__name:"FilmCard",props:{film:{}},emits:["select"],setup(e){const t=e,{isDark:n}=He(),s=ni(),u=A(()=>t.film.id.startsWith("ext-")),o=A(()=>{const r=t.film.rating;return r>=8.5?n.value?"bg-success/20 text-success":"bg-success/10 text-green-700":r>=7.5?n.value?"bg-accent/20 text-accent":"bg-accent/10 text-amber-700":n.value?"bg-white/10 text-white/50":"bg-black/5 text-gray-500"});return(r,i)=>(p(),m("button",{class:F(["flex gap-3 p-2 rounded-xl transition-all duration-200 text-left w-full group overflow-hidden",S(n)?"hover:bg-white/5 active:bg-white/10":"hover:bg-black/[0.03] active:bg-black/5"]),onClick:i[2]||(i[2]=a=>r.$emit("select",e.film))},[d("div",Rd,[e.film.posterUrl?(p(),m("img",{key:0,src:e.film.posterUrl,alt:e.film.title,class:"w-full h-full object-cover rounded-[6px] transition-transform duration-300 group-hover:scale-105",loading:"lazy",onError:i[0]||(i[0]=a=>S(pi)(a,e.film.title,e.film.year))},null,40,jd)):(p(),m("div",{key:1,class:F(["w-full h-full rounded-[6px]",S(n)?"bg-white/10":"bg-black/5"])},null,2))]),d("div",Ud,[d("p",{class:F(["text-sm font-semibold truncate",S(n)?"text-white/90":"text-gray-900"])},C(e.film.title),3),d("p",{class:F(["text-xs mt-0.5",S(n)?"text-white/40":"text-gray-500"])},[ce(C(e.film.year),1),e.film.director?(p(),m(q,{key:0},[ce(" · "+C(e.film.director),1)],64)):D("",!0)],2),u.value&&e.film.synopsis?(p(),m("p",{key:0,class:F(["text-xs mt-0.5 line-clamp-2",S(n)?"text-white/35":"text-gray-400"])},C(e.film.synopsis),3)):D("",!0),d("div",Nd,[e.film.rating>0?(p(),m("span",{key:0,class:F(["text-xs font-semibold px-1.5 py-0.5 rounded",o.value])}," ★ "+C(e.film.rating),3)):D("",!0),u.value?(p(),m("span",{key:1,class:F(["text-xs px-1.5 py-0.5 rounded font-medium",S(n)?"bg-info/15 text-info/70":"bg-info/10 text-blue-600"])}," not in library ",2)):D("",!0),(p(!0),m(q,null,Y(e.film.sources.slice(0,3),a=>(p(),m("span",{key:a.type,class:F(["text-xs px-1.5 py-0.5 rounded font-medium",S(n)?"bg-white/8 text-white/50":"bg-black/5 text-gray-500"])},C(a.type),3))),128)),pe(ti,{class:"ml-auto",favorited:S(s).isFavorited(e.film.id),onToggle:i[1]||(i[1]=a=>S(s).toggleFavorite({id:e.film.id,type:"film",title:e.film.title,subtitle:`${e.film.year} · ${e.film.director}`,data:e.film}))},null,8,["favorited"])])])],2))}}),qd={class:"w-12 h-auto shrink-0 rounded-md overflow-hidden shadow-md"},Hd={class:"aspect-[2/3] relative"},Wd=["src","alt"],Vd={class:"flex-1 min-w-0 py-0.5"},Gd={key:0},Kd=ne({__name:"BookCard",props:{book:{}},emits:["select"],setup(e){const t=e,{isDark:n}=He(),s=k(!1),u=k(null),o=A(()=>s.value?null:t.book.coverUrl||u.value),r=A(()=>mi(t.book.title,t.book.author));return Le(()=>{t.book.coverUrl||hi(t.book.title,t.book.author).then(i=>{i&&(u.value=i)})}),(i,a)=>(p(),m("button",{class:F(["flex items-start gap-3 w-full text-left p-2.5 rounded-xl transition-all duration-150",S(n)?"hover:bg-white/5":"hover:bg-black/3"]),onClick:a[1]||(a[1]=l=>i.$emit("select",e.book))},[d("div",qd,[d("div",Hd,[o.value?(p(),m("img",{key:0,src:o.value,alt:e.book.title,class:"w-full h-full object-cover",loading:"lazy",onError:a[0]||(a[0]=l=>s.value=!0)},null,40,Wd)):(p(),m("div",{key:1,class:"w-full h-full bg-cover bg-center",style:Se({backgroundImage:`url(${r.value})`})},null,4))])]),d("div",Vd,[d("p",{class:F(["text-sm font-medium leading-snug line-clamp-2",S(n)?"text-white/90":"text-gray-900"])},C(e.book.title),3),d("p",{class:F(["text-xs mt-0.5 truncate",S(n)?"text-white/50":"text-gray-500"])},[ce(C(e.book.author),1),e.book.year?(p(),m("span",Gd," · "+C(e.book.year),1)):D("",!0)],2),e.book.description?(p(),m("p",{key:0,class:F(["text-xs mt-1 line-clamp-2 leading-relaxed",S(n)?"text-white/40":"text-gray-400"])},C(e.book.description),3)):D("",!0)])],2))}}),Jd={class:"poster-card-sm shrink-0 w-12 aspect-[2/3] rounded-lg overflow-hidden"},Zd=["src","alt"],Yd={class:"min-w-0 flex-1 py-0.5"},Xd={class:"flex items-center gap-1.5 mt-1.5"},Qd=ne({__name:"TVSeriesCard",props:{series:{}},emits:["select"],setup(e){const t=e,{isDark:n}=He(),s=k(!1),u=k(null),o=A(()=>s.value?null:t.series.posterUrl||u.value),r=A(()=>bi(t.series.title,t.series.year)),i=A(()=>t.series.year?t.series.endYear&&t.series.endYear!==t.series.year?`${t.series.year}–${t.series.endYear}`:t.series.status==="ongoing"?`${t.series.year}–`:String(t.series.year):""),a=A(()=>{const l=t.series.rating??0;return l>=8.5?n.value?"bg-success/20 text-success":"bg-success/10 text-green-700":l>=7.5?n.value?"bg-accent/20 text-accent":"bg-accent/10 text-amber-700":n.value?"bg-white/10 text-white/50":"bg-black/5 text-gray-500"});return Le(()=>{t.series.posterUrl||gi(t.series.title,t.series.year).then(l=>{l.posterUrl&&(u.value=l.posterUrl)})}),(l,c)=>(p(),m("button",{class:F(["flex gap-3 p-2 rounded-xl transition-all duration-200 text-left w-full group overflow-hidden",S(n)?"hover:bg-white/5 active:bg-white/10":"hover:bg-black/[0.03] active:bg-black/5"]),onClick:c[1]||(c[1]=f=>l.$emit("select",e.series))},[d("div",Jd,[o.value?(p(),m("img",{key:0,src:o.value,alt:e.series.title,class:"w-full h-full object-cover rounded-[6px] transition-transform duration-300 group-hover:scale-105",loading:"lazy",onError:c[0]||(c[0]=f=>s.value=!0)},null,40,Zd)):(p(),m("div",{key:1,class:"w-full h-full rounded-[6px] bg-cover bg-center",style:Se({backgroundImage:`url(${r.value})`})},null,4))]),d("div",Yd,[d("p",{class:F(["text-sm font-semibold truncate",S(n)?"text-white/90":"text-gray-900"])},C(e.series.title),3),d("p",{class:F(["text-xs mt-0.5",S(n)?"text-white/40":"text-gray-500"])},[ce(C(i.value),1),e.series.network?(p(),m(q,{key:0},[ce(" · "+C(e.series.network),1)],64)):D("",!0)],2),e.series.synopsis?(p(),m("p",{key:0,class:F(["text-xs mt-0.5 line-clamp-2",S(n)?"text-white/35":"text-gray-400"])},C(e.series.synopsis),3)):D("",!0),d("div",Xd,[e.series.rating&&e.series.rating>0?(p(),m("span",{key:0,class:F(["text-xs font-semibold px-1.5 py-0.5 rounded",a.value])}," ★ "+C(e.series.rating.toFixed(1)),3)):D("",!0),e.series.seasons?(p(),m("span",{key:1,class:F(["text-xs px-1.5 py-0.5 rounded font-medium",S(n)?"bg-white/8 text-white/50":"bg-black/5 text-gray-500"])},C(e.series.seasons)+"S ",3)):D("",!0),e.series.status==="ongoing"?(p(),m("span",{key:2,class:F(["text-xs px-1.5 py-0.5 rounded font-medium",S(n)?"bg-success/15 text-success/70":"bg-green-50 text-green-600"])}," ongoing ",2)):e.series.status==="ended"?(p(),m("span",{key:3,class:F(["text-xs px-1.5 py-0.5 rounded font-medium",S(n)?"bg-white/8 text-white/40":"bg-black/5 text-gray-400"])}," ended ",2)):D("",!0)])])],2))}}),ef={class:"cover-card-sm shrink-0 w-12 h-12 rounded-lg overflow-hidden"},tf=["src","alt"],nf={class:"min-w-0 flex-1 py-0.5"},sf={class:"flex items-center gap-1.5 mt-1.5"},uf=ne({__name:"SongCard",props:{song:{}},emits:["select"],setup(e){const t=e,{isDark:n}=He(),s=ni(),u=k(!1),o=k(null),r=A(()=>u.value?null:t.song.coverUrl||o.value),i=A(()=>vi(t.song.title,t.song.artist)),a=A(()=>t.song.id.startsWith("ext-"));return Le(()=>{t.song.coverUrl||xi(t.song.title,t.song.artist,t.song.album).then(l=>{l&&(o.value=l)})}),(l,c)=>(p(),m("button",{class:F(["flex gap-3 p-2 rounded-xl transition-all duration-200 text-left w-full group overflow-hidden",S(n)?"hover:bg-white/5 active:bg-white/10":"hover:bg-black/[0.03] active:bg-black/5"]),onClick:c[2]||(c[2]=f=>l.$emit("select",e.song))},[d("div",ef,[r.value?(p(),m("img",{key:0,src:r.value,alt:e.song.title,class:"w-full h-full object-cover rounded-[6px] transition-transform duration-300 group-hover:scale-105",loading:"lazy",onError:c[0]||(c[0]=f=>u.value=!0)},null,40,tf)):(p(),m("div",{key:1,class:"w-full h-full rounded-[6px] bg-cover bg-center",style:Se({backgroundImage:`url(${i.value})`})},null,4))]),d("div",nf,[d("p",{class:F(["text-sm font-semibold truncate",S(n)?"text-white/90":"text-gray-900"])},C(e.song.title),3),d("p",{class:F(["text-xs mt-0.5",S(n)?"text-white/40":"text-gray-500"])},[ce(C(e.song.artist),1),e.song.year?(p(),m(q,{key:0},[ce(" · "+C(e.song.year),1)],64)):D("",!0)],2),d("div",sf,[a.value?(p(),m("span",{key:0,class:F(["text-xs px-1.5 py-0.5 rounded font-medium",S(n)?"bg-info/15 text-info/70":"bg-info/10 text-blue-600"])}," not in library ",2)):D("",!0),(p(!0),m(q,null,Y((e.song.sources??[]).slice(0,3),f=>(p(),m("span",{key:f.type,class:F(["text-xs px-1.5 py-0.5 rounded font-medium",S(n)?"bg-white/8 text-white/50":"bg-black/5 text-gray-500"])},C(f.type),3))),128)),pe(ti,{class:"ml-auto",favorited:S(s).isFavorited(e.song.id),onToggle:c[1]||(c[1]=f=>S(s).toggleFavorite({id:e.song.id,type:"song",title:e.song.title,subtitle:e.song.artist,data:e.song}))},null,8,["favorited"])])])],2))}}),of={class:"cover-card-sm shrink-0 w-12 h-12 rounded-lg overflow-hidden"},rf=["src","alt"],af={class:"min-w-0 flex-1 py-0.5"},lf={class:"flex items-center gap-1.5 mt-1.5"},cf=ne({__name:"PodcastCard",props:{podcast:{}},emits:["select"],setup(e){const t=e,{isDark:n}=He(),s=k(!1),u=k(null),o=A(()=>s.value?null:t.podcast.coverUrl||u.value||null);Le(()=>{t.podcast.coverUrl||yi(t.podcast.title,t.podcast.host).then(a=>{a&&(u.value=a)})});const r=A(()=>wi(t.podcast.title,t.podcast.host)),i=A(()=>t.podcast.id.startsWith("ext-"));return(a,l)=>(p(),m("button",{class:F(["flex gap-3 p-2 rounded-xl transition-all duration-200 text-left w-full group overflow-hidden",S(n)?"hover:bg-white/5 active:bg-white/10":"hover:bg-black/[0.03] active:bg-black/5"]),onClick:l[1]||(l[1]=c=>a.$emit("select",e.podcast))},[d("div",of,[o.value?(p(),m("img",{key:0,src:o.value,alt:e.podcast.title,class:"w-full h-full object-cover rounded-[6px] transition-transform duration-300 group-hover:scale-105",loading:"lazy",onError:l[0]||(l[0]=c=>s.value=!0)},null,40,rf)):(p(),m("div",{key:1,class:"w-full h-full rounded-[6px] bg-cover bg-center",style:Se({backgroundImage:`url(${r.value})`})},null,4))]),d("div",af,[d("p",{class:F(["text-sm font-semibold truncate",S(n)?"text-white/90":"text-gray-900"])},C(e.podcast.title),3),d("p",{class:F(["text-xs mt-0.5",S(n)?"text-white/40":"text-gray-500"])},[ce(C(e.podcast.host||"Podcast"),1),e.podcast.year?(p(),m(q,{key:0},[ce(" · "+C(e.podcast.year),1)],64)):D("",!0)],2),d("div",lf,[i.value?(p(),m("span",{key:0,class:F(["text-xs px-1.5 py-0.5 rounded font-medium",S(n)?"bg-info/15 text-info/70":"bg-info/10 text-blue-600"])}," not in library ",2)):D("",!0),(p(!0),m(q,null,Y(e.podcast.sources.slice(0,3),c=>(p(),m("span",{key:c.type,class:F(["text-xs px-1.5 py-0.5 rounded font-medium",S(n)?"bg-white/8 text-white/50":"bg-black/5 text-gray-500"])},C(c.type),3))),128))])])],2))}}),df={class:"shrink-0 w-12 h-12 rounded-lg overflow-hidden"},ff=["src","alt"],pf={class:"min-w-0 flex-1 py-0.5"},hf={class:"flex items-center gap-1.5 mt-1.5"},mf=ne({__name:"PlaceCard",props:{place:{}},emits:["select"],setup(e){const t=e,{isDark:n}=He(),s=k(!1),u=k(null),o=A(()=>s.value?null:t.place.photoUrl||u.value||null);Le(()=>{t.place.photoUrl||ki(t.place.name,t.place.city).then(a=>{a&&(u.value=a)})});const r=A(()=>Ci(t.place.name,t.place.cuisine||t.place.category)),i=A(()=>{const a=t.place.rating??0;return a>=4.5?n.value?"bg-success/20 text-success":"bg-success/10 text-green-700":a>=4?n.value?"bg-accent/20 text-accent":"bg-accent/10 text-amber-700":n.value?"bg-white/10 text-white/50":"bg-black/5 text-gray-500"});return(a,l)=>(p(),m("button",{class:F(["flex gap-3 p-2 rounded-xl transition-all duration-200 text-left w-full group overflow-hidden",S(n)?"hover:bg-white/5 active:bg-white/10":"hover:bg-black/[0.03] active:bg-black/5"]),onClick:l[1]||(l[1]=c=>a.$emit("select",e.place))},[d("div",df,[o.value?(p(),m("img",{key:0,src:o.value,alt:e.place.name,class:"w-full h-full object-cover rounded-[6px] transition-transform duration-300 group-hover:scale-105",loading:"lazy",onError:l[0]||(l[0]=c=>s.value=!0)},null,40,ff)):(p(),m("div",{key:1,class:"w-full h-full rounded-[6px] bg-cover bg-center",style:Se({backgroundImage:`url(${r.value})`})},null,4))]),d("div",pf,[d("p",{class:F(["text-sm font-semibold truncate",S(n)?"text-white/90":"text-gray-900"])},C(e.place.name),3),d("p",{class:F(["text-xs mt-0.5 truncate",S(n)?"text-white/40":"text-gray-500"])},[ce(C(e.place.cuisine||e.place.category),1),e.place.city?(p(),m(q,{key:0},[ce(" · "+C(e.place.city),1)],64)):D("",!0)],2),d("div",hf,[e.place.rating&&e.place.rating>0?(p(),m("span",{key:0,class:F(["text-xs font-semibold px-1.5 py-0.5 rounded",i.value])}," ★ "+C(e.place.rating.toFixed(1)),3)):D("",!0),e.place.priceLevel?(p(),m("span",{key:1,class:F(["text-xs px-1.5 py-0.5 rounded font-medium",S(n)?"bg-white/8 text-white/50":"bg-black/5 text-gray-500"])},C("$".repeat(e.place.priceLevel)),3)):D("",!0)])])],2))}}),gf={class:"cover-card-sm shrink-0 w-12 h-12 rounded-lg overflow-hidden"},bf=["src","alt"],xf={class:"min-w-0 flex-1 py-0.5"},Zo=ne({__name:"NewsCard",props:{article:{}},emits:["select-article"],setup(e){const t=e,{isDark:n}=He(),s=k(!1),u=A(()=>{if(s.value)return null;const r=t.article.imgSrc;return _i(r)?r:null}),o=A(()=>Ai(t.article.title,Bu(t.article.url)));return(r,i)=>(p(),m("button",{class:F(["flex gap-3 p-2 rounded-xl transition-all duration-200 text-left w-full group overflow-hidden",S(n)?"hover:bg-white/5 active:bg-white/10":"hover:bg-black/[0.03] active:bg-black/5"]),onClick:i[1]||(i[1]=a=>r.$emit("select-article",e.article))},[d("div",gf,[u.value?(p(),m("img",{key:0,src:u.value,alt:e.article.title,class:"w-full h-full object-cover rounded-[6px] transition-transform duration-300 group-hover:scale-105",loading:"lazy",onError:i[0]||(i[0]=a=>s.value=!0)},null,40,bf)):(p(),m("div",{key:1,class:"w-full h-full rounded-[6px] bg-cover bg-center",style:Se({backgroundImage:`url(${o.value})`})},null,4))]),d("div",xf,[d("p",{class:F(["text-sm font-semibold truncate",S(n)?"text-white/90":"text-gray-900"])},C(e.article.title),3),e.article.content?(p(),m("p",{key:0,class:F(["text-xs mt-0.5 line-clamp-2",S(n)?"text-white/40":"text-gray-500"])},C(e.article.content),3)):D("",!0),d("p",{class:F(["text-xs mt-1 truncate",S(n)?"text-white/30":"text-gray-400"])},C(S(Bu)(e.article.url)),3)]),(p(),m("svg",{class:F(["w-4 h-4 shrink-0 self-center opacity-50",S(n)?"text-white/50":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...i[2]||(i[2]=[d("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"},null,-1)])],2))],2))}}),fu="qpzry9x8gf2tvdw0s3jn54khce6mua7l",si={};for(let e=0;e>25;n=(n&33554431)<<5^s;for(let o=0;o<5;o++)u>>o&1&&(n^=t[o])}return n}function oi(e){const t=[];for(let n=0;n>5);t.push(0);for(let n=0;n>t)return null;for(u=u<=n;)o-=n,r.push(u>>o&i)}if(s)o>0&&r.push(u<=t||u<t.length||t.length>90)return null;const s=t.slice(0,n),u=t.slice(n+1),o=[];for(const a of u){const l=si[a];if(l===void 0)return null;o.push(l)}if(ui([...oi(s),...o])!==1)return null;const r=o.slice(0,-6),i=ri(r,5,8,!1);return i?{hrp:s,data:new Uint8Array(i)}:null}function gn(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}function vf(e){const t=new Uint8Array(e.length/2);for(let n=0;n>5*(5-o)&31);return u}function wf(e,t){const n=ri(Array.from(t),8,5,!0);if(!n)throw new Error("Failed to convert bits");const s=yf(e,n);return e+"1"+[...n,...s].map(u=>fu[u]).join("")}function J2(e){return wf("npub",vf(e))}function Z2(e){const t=ii(e);if(!t||t.hrp!=="npub"||t.data.length!==32)throw new Error("Invalid npub");return gn(t.data)}function kf(e){const t=ii(e);if(!t)return null;const{hrp:n,data:s}=t;if(n==="npub"&&s.length===32)return{type:"npub",hex:gn(s)};if(n==="note"&&s.length===32)return{type:"note",hex:gn(s)};if(n==="nevent"||n==="nprofile"){let u="";const o=[];let r=0;for(;r0?o:void 0}}return{type:"unknown",hex:gn(s)}}const Cf={key:0,class:"flex items-center gap-2"},_f={class:"flex-1 space-y-1"},Af={key:1,class:"flex items-center gap-2"},Df={key:2},Sf={class:"flex items-center gap-2 mb-1.5"},Ef={class:"flex items-center gap-2 mt-1.5"},$f={key:3},Ff={class:"flex items-center gap-2"},Mf=ne({__name:"NostrEmbed",props:{uri:{}},setup(e){const t=e,{isDark:n}=He(),{connect:s,fetchNote:u}=Mi(),o=k(null),r=k(!1),i=k(!1),a=A(()=>{const h=t.uri.replace(/^nostr:/,"");return kf(h)}),l=A(()=>a.value?.type==="npub"||a.value?.type==="nprofile"),c=A(()=>{const h=a.value?.hex??"";return h.length<=12?h:h.slice(0,8)+"..."+h.slice(-4)});function f(h){const b=Math.floor(Date.now()/1e3-h);return b<60?"now":b<3600?`${Math.floor(b/60)}m`:b<86400?`${Math.floor(b/3600)}h`:`${Math.floor(b/86400)}d`}return Le(async()=>{if(!a.value){i.value=!0;return}if(l.value)return;const h=a.value.hex;if(!h){i.value=!0;return}r.value=!0,s(),await new Promise(g=>setTimeout(g,500));const b=await u(h);r.value=!1,b?o.value=b:i.value=!0}),(h,b)=>(p(),m("div",{class:F(["rounded-xl p-3 transition-all duration-150",S(n)?"bg-purple-500/10 border border-purple-500/20":"bg-purple-50 border border-purple-200"])},[r.value?(p(),m("div",Cf,[d("div",{class:F(["w-6 h-6 rounded-full animate-pulse",S(n)?"bg-purple-500/20":"bg-purple-200"])},null,2),d("div",_f,[d("div",{class:F(["h-3 w-24 rounded animate-pulse",S(n)?"bg-white/10":"bg-gray-200"])},null,2),d("div",{class:F(["h-2 w-40 rounded animate-pulse",S(n)?"bg-white/5":"bg-gray-100"])},null,2)])])):i.value?(p(),m("div",Af,[d("span",{class:F(["text-xs",S(n)?"text-white/30":"text-gray-400"])},C(l.value?"Profile":"Note")+" not found ",3),d("span",{class:F(["text-xs font-mono truncate",S(n)?"text-purple-400/40":"text-purple-400"])},C(c.value),3)])):o.value?(p(),m("div",Df,[d("div",Sf,[d("div",{class:F(["w-6 h-6 rounded-full shrink-0 flex items-center justify-center text-xs font-bold",S(n)?"bg-purple-500/20 text-purple-400":"bg-purple-100 text-purple-600"])},C(o.value.authorName?.charAt(0)?.toUpperCase()??"?"),3),d("span",{class:F(["text-xs font-semibold truncate",S(n)?"text-white/70":"text-gray-700"])},C(o.value.authorName??"anon"),3),d("span",{class:F(["text-xs ml-auto shrink-0",S(n)?"text-white/20":"text-gray-300"])},C(f(o.value.created_at)),3)]),d("p",{class:F(["text-xs leading-relaxed line-clamp-4",S(n)?"text-white/60":"text-gray-600"])},C(o.value.content),3),d("div",Ef,[d("span",{class:F(["text-xs font-mono",S(n)?"text-purple-400/40":"text-purple-400/60"])}," nostr ",2)])])):l.value?(p(),m("div",$f,[d("div",Ff,[d("div",{class:F(["w-8 h-8 rounded-full shrink-0 flex items-center justify-center text-xs font-bold",S(n)?"bg-purple-500/20 text-purple-400":"bg-purple-100 text-purple-600"])},C(c.value.charAt(0).toUpperCase()),3),d("div",null,[d("span",{class:F(["text-xs font-mono block",S(n)?"text-white/60":"text-gray-600"])},C(c.value),3),d("span",{class:F(["text-xs",S(n)?"text-purple-400/40":"text-purple-400/60"])}," nostr profile ",2)])])])):D("",!0)],2))}});function Tf(e){return e.trim().startsWith("cashuA")}function If(e){const t=/cashuA[A-Za-z0-9_-]+/g;return[...e.matchAll(t)].map(n=>n[0])}function Pf(e){if(!Tf(e))return null;try{const n=e.slice(6).replace(/-/g,"+").replace(/_/g,"/"),s=atob(n),u=JSON.parse(s);if(!u.token||!Array.isArray(u.token)||u.token.length===0)return null;const o=u.token[0],r=o.proofs.reduce((i,a)=>i+a.amount,0);return{mint:o.mint,amount:r,unit:u.unit??"sat",memo:u.memo,raw:e}}catch{return null}}function Lf(e){try{const n=new URL(e).hostname;return n.length>30?n.slice(0,15)+"..."+n.slice(-12):n}catch{return e.length>30?e.slice(0,15)+"..."+e.slice(-12):e}}function zf(e,t){return t==="sat"||t==="sats"?e>=1e6?`${(e/1e6).toFixed(2)}M sats`:e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}k sats`:`${e} sats`:`${e} ${t}`}const Bf={class:"flex items-center gap-2"},Rf={class:"ml-auto text-sm font-bold text-[#F7931A]"},jf={class:"flex gap-2"},Uf=ne({__name:"CashuToken",props:{token:{}},setup(e){const{isDark:t}=He(),n=e,s=k(!1),u=A(()=>Pf(n.token)),o=A(()=>u.value?zf(u.value.amount,u.value.unit):""),r=A(()=>u.value?Lf(u.value.mint):""),i=A(()=>{const c=n.token;return c.length<=40?c:c.slice(0,20)+"..."+c.slice(-16)});async function a(){await navigator.clipboard.writeText(n.token),s.value=!0,setTimeout(()=>{s.value=!1},2e3)}function l(){window.open(`web+cashu:${n.token}`,"_blank")}return(c,f)=>u.value?(p(),m("div",{key:0,class:F(["rounded-xl p-3 space-y-2 my-2",S(t)?"bg-white/[0.03] border border-[#F7931A]/20":"bg-black/[0.02] border border-[#F7931A]/20"])},[d("div",Bf,[f[0]||(f[0]=d("div",{class:"w-6 h-6 rounded-full bg-[#F7931A]/10 flex items-center justify-center"},[d("svg",{class:"w-3.5 h-3.5 text-[#F7931A]",viewBox:"0 0 24 24",fill:"currentColor"},[d("circle",{cx:"12",cy:"12",r:"10"}),d("text",{x:"12",y:"16","text-anchor":"middle",fill:"white","font-size":"12","font-weight":"bold"},"C")])],-1)),d("span",{class:F(["text-xs font-semibold",S(t)?"text-white/80":"text-gray-800"])}," Cashu Token ",2),d("span",Rf,C(o.value),1)]),d("div",{class:F(["text-xs font-mono",S(t)?"text-white/30":"text-gray-400"])}," Mint: "+C(r.value),3),u.value.memo?(p(),m("div",{key:0,class:F(["text-xs",S(t)?"text-white/50":"text-gray-500"])},C(u.value.memo),3)):D("",!0),d("div",jf,[d("button",{class:F(["flex-1 px-3 py-1.5 rounded-lg text-xs font-medium transition-colors",S(t)?"bg-white/5 text-white/60 hover:bg-white/10":"bg-gray-100 text-gray-600 hover:bg-gray-200"]),onClick:a},C(s.value?"Copied!":"Copy Token"),3),d("button",{class:"flex-1 px-3 py-1.5 rounded-lg text-xs font-medium transition-colors bg-[#F7931A]/10 text-[#F7931A] hover:bg-[#F7931A]/20",onClick:l}," Open in Wallet ")])],2)):(p(),m("div",{key:1,class:F(["rounded-lg p-2 my-1 text-xs font-mono break-all",S(t)?"bg-white/5 text-white/40":"bg-gray-50 text-gray-500"])},C(i.value),3))}}),Nf={class:"recipe-card rounded-xl bg-white/5 border border-white/10 overflow-hidden"},Of={class:"px-4 py-3 border-b border-white/5"},qf={class:"text-sm font-semibold text-white/90"},Hf={class:"flex gap-3 mt-1.5"},Wf={key:0,class:"text-xs text-white/40 flex items-center gap-1"},Vf={key:1,class:"text-xs text-white/40 flex items-center gap-1"},Gf={key:2,class:"text-xs text-white/40"},Kf={class:"px-4 py-2 border-b border-white/5 flex items-center gap-3"},Jf={class:"text-xs text-white/50 tabular-nums w-8 text-right"},Zf={class:"px-4 py-3 border-b border-white/5"},Yf={class:"space-y-1"},Xf=["onClick"],Qf={key:0,class:"w-2.5 h-2.5 text-accent",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},ep={class:"px-4 py-3"},tp={class:"space-y-2"},np={class:"shrink-0 w-5 h-5 rounded-full bg-accent/15 text-accent text-xs flex items-center justify-center font-medium"},sp={class:"leading-relaxed"},up=ne({__name:"RecipeCard",props:{recipe:{}},setup(e){const t=e,n=k(1),s=Di(new Set),u=A(()=>{const i=parseInt(t.recipe.servings||"0",10);return i?Math.round(i*n.value):t.recipe.servings}),o=A(()=>t.recipe.ingredients.map(i=>i.replace(/(\d+\.?\d*)/g,a=>{const c=parseFloat(a)*n.value;return c%1===0?String(c):c.toFixed(1)})));function r(i){s.has(i)?s.delete(i):s.add(i)}return(i,a)=>(p(),m("div",Nf,[d("div",Of,[d("h3",qf,C(e.recipe.title),1),d("div",Hf,[e.recipe.time?(p(),m("span",Wf,[a[1]||(a[1]=d("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),ce(" "+C(e.recipe.time),1)])):D("",!0),e.recipe.servings?(p(),m("span",Vf,[a[2]||(a[2]=d("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"})],-1)),ce(" "+C(u.value)+" servings ",1)])):D("",!0),e.recipe.calories?(p(),m("span",Gf,C(e.recipe.calories)+" cal",1)):D("",!0)])]),d("div",Kf,[a[3]||(a[3]=d("label",{class:"text-xs text-white/30"},"Scale",-1)),De(d("input",{"onUpdate:modelValue":a[0]||(a[0]=l=>n.value=l),type:"range",min:"0.5",max:"4",step:"0.5",class:"flex-1 h-1 accent-[#F7931A] bg-white/10 rounded-full appearance-none cursor-pointer"},null,512),[[Te,n.value,void 0,{number:!0}]]),d("span",Jf,C(n.value)+"×",1)]),d("div",Zf,[a[5]||(a[5]=d("h4",{class:"text-xs text-white/40 uppercase tracking-wider mb-2"},"Ingredients",-1)),d("ul",Yf,[(p(!0),m(q,null,Y(o.value,(l,c)=>(p(),m("li",{key:c,class:F(["flex items-start gap-2 text-xs cursor-pointer select-none",s.has(c)?"line-through text-white/30":"text-white/70"]),onClick:f=>r(c)},[d("span",{class:F(["shrink-0 mt-0.5 w-4 h-4 rounded border flex items-center justify-center transition-colors",s.has(c)?"border-accent/50 bg-accent/20":"border-white/20"])},[s.has(c)?(p(),m("svg",Qf,[...a[4]||(a[4]=[d("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"3",d:"M5 13l4 4L19 7"},null,-1)])])):D("",!0)],2),ce(" "+C(l),1)],10,Xf))),128))])]),d("div",ep,[a[6]||(a[6]=d("h4",{class:"text-xs text-white/40 uppercase tracking-wider mb-2"},"Steps",-1)),d("ol",tp,[(p(!0),m(q,null,Y(e.recipe.steps,(l,c)=>(p(),m("li",{key:c,class:"flex gap-2 text-xs text-white/70"},[d("span",np,C(c+1),1),d("span",sp,C(l),1)]))),128))])])]))}}),op={class:"event-card rounded-xl bg-white/5 border border-white/10 px-4 py-3"},rp={class:"flex items-start gap-3"},ip={class:"shrink-0 w-14 text-center rounded-lg bg-accent/10 border border-accent/20 py-1.5"},ap={class:"text-xs text-accent/70 uppercase"},lp={class:"text-lg font-bold text-accent leading-tight"},cp={class:"flex-1 min-w-0"},dp={class:"text-sm font-semibold text-white/90 truncate"},fp={key:0,class:"text-xs text-white/50 mt-0.5 truncate"},pp={key:1,class:"text-xs text-white/40 mt-1 line-clamp-2"},hp={class:"flex gap-2 mt-2"},mp=["href"],gp=ne({__name:"EventCard",props:{event:{}},setup(e){const t=e,n=k(Date.now());let s=null;Le(()=>{s=setInterval(()=>{n.value=Date.now()},1e3)}),gu(()=>{s&&clearInterval(s)});const u=A(()=>{if(!t.event.date)return null;const h=new Date(t.event.date);return isNaN(h.getTime())?null:h}),o=A(()=>u.value?u.value.toLocaleString("en",{month:"short"}).toUpperCase():"?"),r=A(()=>u.value?u.value.getDate():"?"),i=A(()=>u.value?u.value.getTime(){if(!u.value)return"";const h=u.value.getTime()-n.value;if(h<0)return"Event has passed";const b=Math.floor(h/(1e3*60*60*24)),g=Math.floor(h%(1e3*60*60*24)/(1e3*60*60)),v=Math.floor(h%(1e3*60*60)/(1e3*60));return b>0?`${b}d ${g}h remaining`:g>0?`${g}h ${v}m remaining`:`${v}m remaining`});function l(h){return h.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,"")}function c(){const h=u.value;if(!h)return;const b=new Date(h.getTime()+3600*1e3),g=["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT",`DTSTART:${l(h)}`,`DTEND:${l(b)}`,`SUMMARY:${t.event.title}`,t.event.location?`LOCATION:${t.event.location}`:"",t.event.description?`DESCRIPTION:${t.event.description}`:"",t.event.url?`URL:${t.event.url}`:"","END:VEVENT","END:VCALENDAR"].filter(Boolean).join(`\r -`),v=new Blob([g],{type:"text/calendar"}),E=URL.createObjectURL(v),_=document.createElement("a");_.href=E,_.download=`${t.event.title.replace(/[^a-zA-Z0-9]/g,"_")}.ics`,_.click(),URL.revokeObjectURL(E)}const f=A(()=>{const h=u.value;if(!h)return"#";const b=l(h).replace("Z",""),g=l(new Date(h.getTime()+3600*1e3)).replace("Z",""),v=new URLSearchParams({action:"TEMPLATE",text:t.event.title,dates:`${b}/${g}`});return t.event.location&&v.set("location",t.event.location),t.event.description&&v.set("details",t.event.description),`https://calendar.google.com/calendar/render?${v.toString()}`});return(h,b)=>(p(),m("div",op,[d("div",rp,[d("div",ip,[d("p",ap,C(o.value),1),d("p",lp,C(r.value),1)]),d("div",cp,[d("h3",dp,C(e.event.title),1),e.event.location?(p(),m("p",fp,C(e.event.location),1)):D("",!0),e.event.description?(p(),m("p",pp,C(e.event.description),1)):D("",!0),a.value?(p(),m("p",{key:2,class:F(["text-xs mt-1.5",i.value?"text-white/30":"text-accent/70"])},C(a.value),3)):D("",!0),d("div",hp,[d("button",{class:"text-xs px-2 py-1 rounded bg-white/5 border border-white/10 text-white/60 hover:text-white/80 hover:bg-white/10 transition-colors",title:"Download ICS file",onClick:H(c,["stop"])}," Add to Calendar "),d("a",{href:f.value,target:"_blank",rel:"noopener noreferrer",class:"text-xs px-2 py-1 rounded bg-white/5 border border-white/10 text-white/60 hover:text-white/80 hover:bg-white/10 transition-colors",onClick:b[0]||(b[0]=H(()=>{},["stop"]))}," Google Calendar ",8,mp)])])])]))}}),bp={class:"interactive-table my-4 rounded-lg bg-white/5 border border-white/5 overflow-hidden"},xp={class:"flex items-center gap-2 px-3 py-2 border-b border-white/5"},vp={class:"overflow-x-auto"},yp={class:"w-full text-xs"},wp={class:"border-b border-white/10"},kp=["onClick"],Cp={class:"inline-flex items-center gap-1"},_p={key:0,class:"text-accent"},Ap={key:0,class:"px-3 py-4 text-center text-xs text-white/30"},Dp={key:1,class:"px-3 py-1.5 text-xs text-white/25 border-t border-white/5"},Sp={key:0},Ep=ne({__name:"InteractiveTable",props:{headers:{},rows:{}},setup(e){const t=e,n=k(""),s=k(-1),u=k("asc");function o(f){s.value===f?u.value=u.value==="asc"?"desc":"asc":(s.value=f,u.value="asc")}const r=A(()=>{const f=n.value.toLowerCase();return f?t.rows.filter(h=>h.some(b=>b.toLowerCase().includes(f))):t.rows}),i=A(()=>{if(s.value<0)return r.value;const f=s.value,h=u.value==="asc"?1:-1;return[...r.value].sort((b,g)=>{const v=b[f]||"",E=g[f]||"",_=parseFloat(v),y=parseFloat(E);return!isNaN(_)&&!isNaN(y)?(_-y)*h:v.localeCompare(E)*h})}),a=A(()=>i.value);function l(){const f=t.headers.map(c).join(","),h=t.rows.map(_=>_.map(c).join(",")).join(` -`),b=f+` -`+h,g=new Blob([b],{type:"text/csv"}),v=URL.createObjectURL(g),E=document.createElement("a");E.href=v,E.download="table.csv",E.click(),URL.revokeObjectURL(v)}function c(f){return f.includes(",")||f.includes('"')||f.includes(` -`)?`"${f.replace(/"/g,'""')}"`:f}return(f,h)=>(p(),m("div",bp,[d("div",xp,[De(d("input",{"onUpdate:modelValue":h[0]||(h[0]=b=>n.value=b),type:"text",class:"flex-1 bg-white/5 border border-white/10 rounded px-2 py-1 text-base text-white/80 outline-none focus:border-accent/40 placeholder:text-white/25",placeholder:"Filter rows..."},null,512),[[Te,n.value]]),d("button",{class:"text-xs px-2 py-1 rounded bg-white/5 border border-white/10 text-white/50 hover:text-white/80 hover:bg-white/10 transition-colors",title:"Export CSV",onClick:l}," CSV ")]),d("div",vp,[d("table",yp,[d("thead",null,[d("tr",wp,[(p(!0),m(q,null,Y(e.headers,(b,g)=>(p(),m("th",{key:g,class:"px-3 py-2 text-left text-white/50 font-medium cursor-pointer hover:text-white/70 select-none whitespace-nowrap",onClick:v=>o(g)},[d("span",Cp,[ce(C(b)+" ",1),s.value===g?(p(),m("span",_p,C(u.value==="asc"?"↑":"↓"),1)):D("",!0)])],8,kp))),128))])]),d("tbody",null,[(p(!0),m(q,null,Y(a.value,(b,g)=>(p(),m("tr",{key:g,class:"border-b border-white/5 hover:bg-white/5 transition-colors"},[(p(!0),m(q,null,Y(b,(v,E)=>(p(),m("td",{key:E,class:"px-3 py-1.5 text-white/70 whitespace-nowrap"},C(v),1))),128))]))),128))])])]),r.value.length===0?(p(),m("div",Ap," No matching rows ")):D("",!0),r.value.length>0?(p(),m("div",Dp,[ce(C(r.value.length)+" row"+C(r.value.length===1?"":"s")+" ",1),n.value?(p(),m("span",Sp," (filtered from "+C(e.rows.length)+")",1)):D("",!0)])):D("",!0)]))}}),$p={class:"timeline-renderer my-4"},Fp={class:"relative"},Mp={class:"text-xs text-white/40 tabular-nums pt-1"},Tp={class:"ml-10 md:ml-0 md:w-[calc(50%-2rem)] shrink-0"},Ip={class:"rounded-lg bg-white/5 border border-white/10 px-3 py-2"},Pp={class:"text-xs text-white/30 md:hidden tabular-nums"},Lp={class:"text-xs font-medium text-white/90"},zp={key:0,class:"text-xs text-white/40 mt-0.5"},Bp={key:1,class:"text-xs text-white/50 mt-1 line-clamp-2"},Rp=ne({__name:"TimelineRenderer",props:{events:{}},setup(e){function t(n){if(!n)return"";const s=new Date(n);return isNaN(s.getTime())?n:s.toLocaleDateString("en",{year:"numeric",month:"short",day:"numeric"})}return(n,s)=>(p(),m("div",$p,[d("div",Fp,[s[1]||(s[1]=d("div",{class:"absolute left-4 md:left-1/2 top-0 bottom-0 w-px bg-white/10 md:-translate-x-px"},null,-1)),(p(!0),m(q,null,Y(e.events,(u,o)=>(p(),m("div",{key:o,class:F(["relative flex items-start gap-4 mb-6 animate-fade-up-fast",o%2===0?"md:flex-row":"md:flex-row-reverse"]),style:Se({animationDelay:`${o*80}ms`})},[s[0]||(s[0]=d("div",{class:"absolute left-4 md:left-1/2 w-3 h-3 rounded-full bg-accent border-2 border-black z-10 md:-translate-x-1.5",style:{top:"6px"}},null,-1)),d("div",{class:F(["hidden md:block w-[calc(50%-2rem)] text-right shrink-0",o%2===0?"":"order-last text-left"])},[d("p",Mp,C(t(u.date)),1)],2),d("div",Tp,[d("div",Ip,[d("p",Pp,C(t(u.date)),1),d("h4",Lp,C(u.title),1),u.location?(p(),m("p",zp,C(u.location),1)):D("",!0),u.description?(p(),m("p",Bp,C(u.description),1)):D("",!0)])])],6))),128))])]))}}),jp={class:"code-runner rounded-xl bg-white/5 border border-white/10 overflow-hidden"},Up={class:"flex items-center gap-2 px-3 py-2 border-b border-white/5"},Np={class:"text-xs text-white/30 uppercase tracking-wider"},Op={class:"px-3 py-2 text-xs text-white/70 overflow-x-auto max-h-48 bg-black/20"},qp=["srcdoc"],Hp={key:1,class:"border-t border-white/5 bg-black/30 px-3 py-2 max-h-32 overflow-y-auto"},Wp=ne({__name:"CodeRunner",props:{code:{},language:{}},setup(e){const t=e,n=k([]),s=k(!1),u=k(null),o=A(()=>t.language==="html"),r=A(()=>i(t.language,t.code));function i(f,h){const b=" - + +
diff --git a/demo/aiui/sw.js b/demo/aiui/sw.js index 491eb965..6db87390 100644 --- a/demo/aiui/sw.js +++ b/demo/aiui/sw.js @@ -1 +1 @@ -if(!self.define){let s,e={};const i=(i,l)=>(i=new URL(i+".js",l).href,e[i]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=i,s.onload=e,document.head.appendChild(s)}else s=i,importScripts(i),e()}).then(()=>{let s=e[i];if(!s)throw new Error(`Module ${i} didn’t register its module`);return s}));self.define=(l,n)=>{const r=s||("document"in self?document.currentScript.src:"")||location.href;if(e[r])return;let a={};const u=s=>i(s,r),t={module:{uri:r},exports:a,require:u};e[r]=Promise.all(l.map(s=>t[s]||u(s))).then(s=>(n(...s),a))}}define(["./workbox-3c177d20"],function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"registerSW.js",revision:"c492f944af160ee2e9a237c509dd270a"},{url:"index.html",revision:"1165670067bbe4b26b8bca3df11e618d"},{url:"icon.svg",revision:"dba94027bbb3b869c0ebf9b6beee1953"},{url:"favicon.svg",revision:"72e74ad8f660d9400c34fa69912b94a3"},{url:"images/loading-poster.svg",revision:"97c56238c72450e4953e1d7db2f6e8e6"},{url:"assets/xychartDiagram-PRI3JC2R-B1UyzSBJ.js",revision:null},{url:"assets/wikipedia-BNDKhpH7.js",revision:null},{url:"assets/useNostr-CZatyrb1.js",revision:null},{url:"assets/useContentImages-CXWJDBMs.js",revision:null},{url:"assets/treemap-GDKQZRPO-BEECIbaX.js",revision:null},{url:"assets/timeline-definition-IT6M3QCI-D9ukNp00.js",revision:null},{url:"assets/stateDiagram-v2-4FDKWEC3-xcVkWlJf.js",revision:null},{url:"assets/stateDiagram-FKZM4ZOC-vcoyXa4O.js",revision:null},{url:"assets/song-renderer-DaD61hR1.js",revision:null},{url:"assets/sequenceDiagram-WL72ISMW-CeHENbHj.js",revision:null},{url:"assets/seedPrompts-CLWaUv28.js",revision:null},{url:"assets/sankeyDiagram-TZEHDZUN-COlytg-6.js",revision:null},{url:"assets/requirementDiagram-UZGBJVZJ-nYhyEINi.js",revision:null},{url:"assets/quadrantDiagram-AYHSOK5B-DbiBWZt1.js",revision:null},{url:"assets/pieDiagram-ADFJNKIX-GpWNwMiQ.js",revision:null},{url:"assets/ordinal-Cboi1Yqb.js",revision:null},{url:"assets/openlibrary-B8IPeH2e.js",revision:null},{url:"assets/nodeDemoPrompts-DjnuaxJP.js",revision:null},{url:"assets/mindmap-definition-VGOIOE7T-vbyezeJT.js",revision:null},{url:"assets/mermaid.core-CAd6zjbx.js",revision:null},{url:"assets/linear-BVk1H_UY.js",revision:null},{url:"assets/layout-BEWArI_F.js",revision:null},{url:"assets/katex.min-CASE1JAf.css",revision:null},{url:"assets/katex-DGN8GczM.js",revision:null},{url:"assets/kanban-definition-3W4ZIXB7-DFRRxhYA.js",revision:null},{url:"assets/journeyDiagram-XKPGCS4Q-BCQppdes.js",revision:null},{url:"assets/init-Gi6I4Gst.js",revision:null},{url:"assets/infoDiagram-HS3SLOUP-BG1I-z0K.js",revision:null},{url:"assets/index-D1RpahE8.css",revision:null},{url:"assets/index-CqBtvLD5.js",revision:null},{url:"assets/guideConversation-BYC5cBFP.js",revision:null},{url:"assets/graph-CJtq5AcG.js",revision:null},{url:"assets/gitGraphDiagram-V2S2FVAM-BdeiHkN2.js",revision:null},{url:"assets/ganttDiagram-JELNMOA3-DO23PGVp.js",revision:null},{url:"assets/freeFilms-B9DmMKj5.js",revision:null},{url:"assets/flowDiagram-NV44I4VS-DKPdEBIH.js",revision:null},{url:"assets/film-renderer-DjEbuBTn.js",revision:null},{url:"assets/erDiagram-Q2GNP2WA-BJADubdx.js",revision:null},{url:"assets/diagram-S2PKOQOG-BKQS725D.js",revision:null},{url:"assets/diagram-QEK2KX5R-7Quhx6dn.js",revision:null},{url:"assets/diagram-PSM6KHXK-CPHecQFp.js",revision:null},{url:"assets/defaultLocale-DX6XiGOO.js",revision:null},{url:"assets/dagre-6UL2VRFP-PYv2B6Ic.js",revision:null},{url:"assets/cytoscape.esm-5J0xJHOV.js",revision:null},{url:"assets/cose-bilkent-S5V4N54A-DPVOUiB5.js",revision:null},{url:"assets/clone-CtrcJUWv.js",revision:null},{url:"assets/claude-provider-DbzPoW6j.js",revision:null},{url:"assets/classDiagram-v2-WZHVMYZB-BR9StYyX.js",revision:null},{url:"assets/classDiagram-2ON5EDUG-BR9StYyX.js",revision:null},{url:"assets/chunk-TZMSLE5B-Cs9qm4uf.js",revision:null},{url:"assets/chunk-QZHKN3VN-p5JjbARs.js",revision:null},{url:"assets/chunk-QN33PNHL-DwbD-drI.js",revision:null},{url:"assets/chunk-FMBD7UC4-Ckq4i3s7.js",revision:null},{url:"assets/chunk-DI55MBZ5-Cjkj4Ju9.js",revision:null},{url:"assets/chunk-B4BG7PRW-Xp_L3JSR.js",revision:null},{url:"assets/chunk-55IACEB6-wvCzuWU8.js",revision:null},{url:"assets/chunk-4BX2VUAB-DvKtsWyW.js",revision:null},{url:"assets/chat-D6vURcTH.js",revision:null},{url:"assets/channel-B3uAZwi0.js",revision:null},{url:"assets/c4Diagram-YG6GDRKO-EsJfvo04.js",revision:null},{url:"assets/blockDiagram-VD42YOAC-C2UEeRHJ.js",revision:null},{url:"assets/architectureDiagram-VXUJARFQ-C167KCx-.js",revision:null},{url:"assets/arc-BxlWYvsk.js",revision:null},{url:"assets/_baseUniq-D68iWsEk.js",revision:null},{url:"assets/_basePickBy-C3OIVi4e.js",revision:null},{url:"assets/WidgetDemoPage-D_rupeyB.js",revision:null},{url:"assets/WidgetDemoPage-BSWX2CxO.css",revision:null},{url:"assets/ThreadNode-B0koBP1i.js",revision:null},{url:"assets/SongGrid.vue_vue_type_script_setup_true_lang-Bx4BvItY.js",revision:null},{url:"assets/SongGrid-BPm5eVyu.js",revision:null},{url:"assets/SongDetail.vue_vue_type_script_setup_true_lang-D619ywdc.js",revision:null},{url:"assets/SongDetail-DOTXy0Qj.js",revision:null},{url:"assets/GuidePage-iT99cF_4.css",revision:null},{url:"assets/GuidePage-CSUy4HaR.js",revision:null},{url:"assets/FilmGrid.vue_vue_type_script_setup_true_lang-Cl2ukq8v.js",revision:null},{url:"assets/FilmGrid-DE3h3PKy.js",revision:null},{url:"assets/FilmDetail.vue_vue_type_script_setup_true_lang-Ckw7Dobw.js",revision:null},{url:"assets/FilmDetail-DTcHMuvD.js",revision:null},{url:"assets/ConversationViewerPage-C6xLQlBZ.js",revision:null},{url:"assets/ChatWindow.vue_vue_type_script_setup_true_lang-BS0iEVVD.js",revision:null},{url:"assets/ChatWindow-CwFp9jEi.css",revision:null},{url:"assets/ChatPage-sAXrmq0w.css",revision:null},{url:"assets/ChatPage-C05pM21P.js",revision:null},{url:"assets/BrowsePage-IaSGp-tG.js",revision:null},{url:"assets/icons/microphone.svg",revision:null},{url:"apple-touch-icon-180x180.png",revision:"7c24333289dd2af70268ed3018b06188"},{url:"favicon.svg",revision:"72e74ad8f660d9400c34fa69912b94a3"},{url:"icon.svg",revision:"dba94027bbb3b869c0ebf9b6beee1953"},{url:"pwa-192x192.png",revision:"b808488f273b70ad731254043774b56f"},{url:"pwa-512x512.png",revision:"93c28a922e11a852a2ff9c277dc60037"},{url:"manifest.webmanifest",revision:"28fc12e11969e378feb1aaa569dafb80"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("index.html"))),s.registerRoute(/^https:\/\/api\.anthropic\.com\/.*/i,new s.NetworkOnly,"GET"),s.registerRoute(/^https:\/\/openrouter\.ai\/.*/i,new s.NetworkOnly,"GET"),s.registerRoute(/\/api\/web-search\?.*/i,new s.NetworkOnly,"GET"),s.registerRoute(/\/api\/rss-articles\?.*/i,new s.NetworkOnly,"GET"),s.registerRoute(/\/api\/tmdb\/.*/i,new s.StaleWhileRevalidate({cacheName:"tmdb-cache",plugins:[new s.ExpirationPlugin({maxEntries:200,maxAgeSeconds:86400})]}),"GET"),s.registerRoute(/^https:\/\/image\.tmdb\.org\/.*/i,new s.CacheFirst({cacheName:"tmdb-images",plugins:[new s.ExpirationPlugin({maxEntries:500,maxAgeSeconds:604800})]}),"GET"),s.registerRoute(/^https:\/\/upload\.wikimedia\.org\/.*/i,new s.CacheFirst({cacheName:"wiki-images",plugins:[new s.ExpirationPlugin({maxEntries:200,maxAgeSeconds:604800})]}),"GET"),s.registerRoute(/^https:\/\/d12wklypp119aj\.cloudfront\.net\/image\/.*/i,new s.CacheFirst({cacheName:"wavlake-images",plugins:[new s.ExpirationPlugin({maxEntries:300,maxAgeSeconds:604800})]}),"GET")}); +if(!self.define){let s,e={};const i=(i,l)=>(i=new URL(i+".js",l).href,e[i]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=i,s.onload=e,document.head.appendChild(s)}else s=i,importScripts(i),e()}).then(()=>{let s=e[i];if(!s)throw new Error(`Module ${i} didn’t register its module`);return s}));self.define=(l,n)=>{const r=s||("document"in self?document.currentScript.src:"")||location.href;if(e[r])return;let a={};const u=s=>i(s,r),t={module:{uri:r},exports:a,require:u};e[r]=Promise.all(l.map(s=>t[s]||u(s))).then(s=>(n(...s),a))}}define(["./workbox-3c177d20"],function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"registerSW.js",revision:"c492f944af160ee2e9a237c509dd270a"},{url:"index.html",revision:"d60e1393cd3a3172a55a4f8c12da714f"},{url:"icon.svg",revision:"dba94027bbb3b869c0ebf9b6beee1953"},{url:"favicon.svg",revision:"72e74ad8f660d9400c34fa69912b94a3"},{url:"images/loading-poster.svg",revision:"97c56238c72450e4953e1d7db2f6e8e6"},{url:"assets/xychartDiagram-PRI3JC2R-3XDydmCT.js",revision:null},{url:"assets/wikipedia-BNDKhpH7.js",revision:null},{url:"assets/useNostr-C64NofB2.js",revision:null},{url:"assets/useContentImages-Vu33AzxO.js",revision:null},{url:"assets/treemap-GDKQZRPO-Di5Yn9U8.js",revision:null},{url:"assets/timeline-definition-IT6M3QCI-DUTf59N6.js",revision:null},{url:"assets/stateDiagram-v2-4FDKWEC3-D58BlsiP.js",revision:null},{url:"assets/stateDiagram-FKZM4ZOC-CgSjOKBR.js",revision:null},{url:"assets/song-renderer-DDu9Ncnt.js",revision:null},{url:"assets/sequenceDiagram-WL72ISMW-DG2y6YeX.js",revision:null},{url:"assets/seedPrompts-CLWaUv28.js",revision:null},{url:"assets/sankeyDiagram-TZEHDZUN-9MsZOyR8.js",revision:null},{url:"assets/requirementDiagram-UZGBJVZJ-Dbrgehjg.js",revision:null},{url:"assets/quadrantDiagram-AYHSOK5B-Co03J7FY.js",revision:null},{url:"assets/pieDiagram-ADFJNKIX-BwviJsE1.js",revision:null},{url:"assets/ordinal-Cboi1Yqb.js",revision:null},{url:"assets/openlibrary-B8IPeH2e.js",revision:null},{url:"assets/nodeDemoPrompts-DjnuaxJP.js",revision:null},{url:"assets/mindmap-definition-VGOIOE7T-D5u25L7P.js",revision:null},{url:"assets/mermaid.core-iePVYd9u.js",revision:null},{url:"assets/linear-CtM424rk.js",revision:null},{url:"assets/layout-NUi_G0DZ.js",revision:null},{url:"assets/katex.min-CASE1JAf.css",revision:null},{url:"assets/katex-DGN8GczM.js",revision:null},{url:"assets/kanban-definition-3W4ZIXB7-DWM1OTPg.js",revision:null},{url:"assets/journeyDiagram-XKPGCS4Q-D9kOudQ3.js",revision:null},{url:"assets/init-Gi6I4Gst.js",revision:null},{url:"assets/infoDiagram-HS3SLOUP-zD5cw5Pm.js",revision:null},{url:"assets/index-xgP_Yxxn.js",revision:null},{url:"assets/index-CIeswVLz.css",revision:null},{url:"assets/guideConversation-BYC5cBFP.js",revision:null},{url:"assets/graph-BSfK3b8T.js",revision:null},{url:"assets/gitGraphDiagram-V2S2FVAM-BRU3D8S-.js",revision:null},{url:"assets/ganttDiagram-JELNMOA3-V4s5o1Vu.js",revision:null},{url:"assets/freeFilms-B9DmMKj5.js",revision:null},{url:"assets/flowDiagram-NV44I4VS-DKg6n4y6.js",revision:null},{url:"assets/film-renderer-DBPqbNdO.js",revision:null},{url:"assets/erDiagram-Q2GNP2WA-Cs-ByisQ.js",revision:null},{url:"assets/diagram-S2PKOQOG-DU40VH4K.js",revision:null},{url:"assets/diagram-QEK2KX5R-Bg_DbrXn.js",revision:null},{url:"assets/diagram-PSM6KHXK-DNgk_k0l.js",revision:null},{url:"assets/defaultLocale-DX6XiGOO.js",revision:null},{url:"assets/dagre-6UL2VRFP-Dz3cszNo.js",revision:null},{url:"assets/cytoscape.esm-5J0xJHOV.js",revision:null},{url:"assets/cose-bilkent-S5V4N54A-Bs-Pq0bU.js",revision:null},{url:"assets/clone-DT41vzT6.js",revision:null},{url:"assets/claude-provider-DbzPoW6j.js",revision:null},{url:"assets/classDiagram-v2-WZHVMYZB-6xyXU9W_.js",revision:null},{url:"assets/classDiagram-2ON5EDUG-6xyXU9W_.js",revision:null},{url:"assets/chunk-TZMSLE5B-8ngCSXJW.js",revision:null},{url:"assets/chunk-QZHKN3VN-01nA56jS.js",revision:null},{url:"assets/chunk-QN33PNHL-CSllQMMS.js",revision:null},{url:"assets/chunk-FMBD7UC4-CawlvmRh.js",revision:null},{url:"assets/chunk-DI55MBZ5-Clmyx62i.js",revision:null},{url:"assets/chunk-B4BG7PRW-BXU3S2QS.js",revision:null},{url:"assets/chunk-55IACEB6-zM9goCtL.js",revision:null},{url:"assets/chunk-4BX2VUAB-C7aSyncb.js",revision:null},{url:"assets/chat-BmHsA0em.js",revision:null},{url:"assets/channel-BMNvF04a.js",revision:null},{url:"assets/c4Diagram-YG6GDRKO-BBOdfxMZ.js",revision:null},{url:"assets/blockDiagram-VD42YOAC-BCiKdVc8.js",revision:null},{url:"assets/architectureDiagram-VXUJARFQ-BpL4JWwP.js",revision:null},{url:"assets/arc-DX9GpQH4.js",revision:null},{url:"assets/_baseUniq-CenknSnb.js",revision:null},{url:"assets/_basePickBy-BBMshl-v.js",revision:null},{url:"assets/WidgetDemoPage-ecxRMF7z.js",revision:null},{url:"assets/WidgetDemoPage-BSWX2CxO.css",revision:null},{url:"assets/ThreadNode-CF2XPC8C.js",revision:null},{url:"assets/SongGrid.vue_vue_type_script_setup_true_lang-D_qvs2R5.js",revision:null},{url:"assets/SongGrid-Dt5bo8zM.js",revision:null},{url:"assets/SongDetail.vue_vue_type_script_setup_true_lang-C3aBvFsB.js",revision:null},{url:"assets/SongDetail-M_GlU4Mz.js",revision:null},{url:"assets/GuidePage-IrS_ea-v.js",revision:null},{url:"assets/GuidePage-BvYaLEzG.css",revision:null},{url:"assets/FilmGrid.vue_vue_type_script_setup_true_lang-DeUdxOuC.js",revision:null},{url:"assets/FilmGrid-DASqK3YR.js",revision:null},{url:"assets/FilmDetail.vue_vue_type_script_setup_true_lang-CvP1bsRD.js",revision:null},{url:"assets/FilmDetail-DAXO70NW.js",revision:null},{url:"assets/ConversationViewerPage-Ba08jsEU.js",revision:null},{url:"assets/ChatWindow.vue_vue_type_script_setup_true_lang-mndCLJgR.js",revision:null},{url:"assets/ChatWindow-CwFp9jEi.css",revision:null},{url:"assets/ChatPage-CvJyonWj.js",revision:null},{url:"assets/ChatPage-CA2cZZjS.css",revision:null},{url:"assets/BrowsePage-gmAlMEXj.js",revision:null},{url:"assets/icons/microphone.svg",revision:null},{url:"apple-touch-icon-180x180.png",revision:"7c24333289dd2af70268ed3018b06188"},{url:"favicon.svg",revision:"72e74ad8f660d9400c34fa69912b94a3"},{url:"icon.svg",revision:"dba94027bbb3b869c0ebf9b6beee1953"},{url:"pwa-192x192.png",revision:"b808488f273b70ad731254043774b56f"},{url:"pwa-512x512.png",revision:"93c28a922e11a852a2ff9c277dc60037"},{url:"manifest.webmanifest",revision:"28fc12e11969e378feb1aaa569dafb80"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("index.html"))),s.registerRoute(/^https:\/\/api\.anthropic\.com\/.*/i,new s.NetworkOnly,"GET"),s.registerRoute(/^https:\/\/openrouter\.ai\/.*/i,new s.NetworkOnly,"GET"),s.registerRoute(/\/api\/web-search\?.*/i,new s.NetworkOnly,"GET"),s.registerRoute(/\/api\/rss-articles\?.*/i,new s.NetworkOnly,"GET"),s.registerRoute(/\/api\/tmdb\/.*/i,new s.StaleWhileRevalidate({cacheName:"tmdb-cache",plugins:[new s.ExpirationPlugin({maxEntries:200,maxAgeSeconds:86400})]}),"GET"),s.registerRoute(/^https:\/\/image\.tmdb\.org\/.*/i,new s.CacheFirst({cacheName:"tmdb-images",plugins:[new s.ExpirationPlugin({maxEntries:500,maxAgeSeconds:604800})]}),"GET"),s.registerRoute(/^https:\/\/upload\.wikimedia\.org\/.*/i,new s.CacheFirst({cacheName:"wiki-images",plugins:[new s.ExpirationPlugin({maxEntries:200,maxAgeSeconds:604800})]}),"GET"),s.registerRoute(/^https:\/\/d12wklypp119aj\.cloudfront\.net\/image\/.*/i,new s.CacheFirst({cacheName:"wavlake-images",plugins:[new s.ExpirationPlugin({maxEntries:300,maxAgeSeconds:604800})]}),"GET")}); diff --git a/neode-ui/src/views/Marketplace.vue b/neode-ui/src/views/Marketplace.vue index 2747cac7..65e8232e 100644 --- a/neode-ui/src/views/Marketplace.vue +++ b/neode-ui/src/views/Marketplace.vue @@ -1,7 +1,7 @@