const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-CJYA4M6R.js","assets/index-BD9qoze1.js","assets/index-BNvE9-tw.css"])))=>i.map(i=>d[i]);
import{W as Ve,H as di,I as fi,J as Cn,r as k,k as A,ai as Ro,s as mo,A as Ce,aj as pi,u as S,ak as hi,al as jo,a as te,b as p,c as m,e as d,n as F,i as D,t as _,Q as ie,L as pe,X as Zn,M as qe,z as H,h as Se,F as q,g as Z,N as ce,V as bn,aa as Fe,U as os,_ as go,K as Pe,o as rr,f as bo,j as He,am as mi,$ as gi,Z as bi,a1 as xi,a0 as vi,y as yi,x as wi,a5 as ki,a4 as Ci,a3 as _i,a2 as Ai,an as No,ao as Di,a7 as Si,w as De,v as Me,B as Ei,ab as xo,a9 as Te,ap as $i,aq as Fi,ar as Mi,af as Ti,P as Ii}from"./index-BD9qoze1.js";import{u as wt}from"./chat-Dx-Dx0vd.js";import{useNostr as Pi}from"./useNostr-BqBiQvAw.js";async function Uo(e){if(!e.trim())return[];try{const t=new URLSearchParams({q:e.trim()}),n=await Ve(`/api/web-search?${t}`,{signal:AbortSignal.timeout(1e4)});if(!n.ok){const u=await n.text().catch(()=>"");return console.warn("[AIUI web-search]",n.status,u),[]}const s=await n.json();if(s.error)return console.warn("[AIUI web-search]",s.error),[];const o=s.results??[];return console.log("[AIUI web-search]",e.slice(0,50),"→",o.length,"results"),o}catch(t){return console.warn("[AIUI web-search] failed:",t),[]}}const Li="aiui-vault",zi=1,Yn="api-keys";function Bi(){return new Promise((e,t)=>{const n=indexedDB.open(Li,zi);n.onupgradeneeded=()=>{const s=n.result;s.objectStoreNames.contains(Yn)||s.createObjectStore(Yn,{keyPath:"provider"})},n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)})}async function vo(e){if(typeof indexedDB>"u")return null;const t=await Bi();return new Promise((n,s)=>{const u=t.transaction(Yn,"readonly").objectStore(Yn).get(e);u.onsuccess=async()=>{const r=u.result;if(!r){n(null);return}if(r.encrypted){const i=fi();if(!i){n(null);return}try{const a=await di(r.value,i);n(a)}catch{n(null)}}else n(r.value)},u.onerror=()=>s(u.error)})}const ir="aiui-personas";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(ir);return e?JSON.parse(e):[]}catch{return[]}}function Ni(e){localStorage.setItem(ir,JSON.stringify(e))}const yo=Cn("personas",()=>{const e=k(ji()),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(){Ni(e.value)}function o(a){const l={...a,id:Ri()};return l.isDefault&&e.value.forEach(c=>{c.isDefault=!1}),e.value.push(l),s(),l}function u(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:o,updatePersona:u,deletePersona:r,getPersona:i}}),ar="aiui-memory",Oo=20;function Ui(){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 Oi(){try{const e=localStorage.getItem(ar);return e?JSON.parse(e):[]}catch{return[]}}function qi(e){localStorage.setItem(ar,JSON.stringify(e))}const lr=Cn("memory",()=>{const e=k(Oi()),t=A(()=>e.value.length>=Oo);function n(){qi(e.value)}function s(i){if(e.value.length>=Oo)return null;const a=i.trim();if(!a)return null;const l={id:Ui(),text:a};return e.value.push(l),n(),l}function o(i,a){const l=e.value.find(c=>c.id===i);l&&(l.text=a.trim(),n())}function u(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:o,deleteItem:u,buildMemoryContext:r}}),Fn=k(!1),rt=k(null),Jt=mo([]),Mn=mo([]),Tn=k(null),Tt=k(""),$s=k("plaintext"),Dt=k([]),St=k([]),Fs=k(!1),Ms=k(""),qo="/Users/dorian/Projects";function Ho(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 wo(){const e=A(()=>Fn.value),t=A(()=>rt.value!==null);async function n(){try{const v=await Ve(`/api/fs/list?path=${encodeURIComponent(qo)}`);if(v.ok){const w=await v.json();Jt.value=w.projects??[]}}catch{Jt.value=s()}}function s(){return[{name:"my-lightning-app",path:"/projects/my-lightning-app",isGit:!0,language:"TypeScript/JavaScript"},{name:"node-dashboard",path:"/projects/node-dashboard",isGit:!0,language:"TypeScript/JavaScript"},{name:"btc-price-tracker",path:"/projects/btc-price-tracker",isGit:!0,language:"Python"},{name:"nostr-relay-config",path:"/projects/nostr-relay-config",isGit:!0,language:"Rust"},{name:"channel-monitor",path:"/projects/channel-monitor",isGit:!0,language:"Go"},{name:"backup-scripts",path:"/projects/backup-scripts",isGit:!1,language:"Shell"}]}function o(){Fn.value=!0,n()}function u(){Fn.value=!1,rt.value=null,Tn.value=null,Tt.value="",Mn.value=[],Dt.value=[],St.value=[]}function r(v){const w=Dt.value.indexOf(v);w>=0?Dt.value.splice(w,1):Dt.value.push(v)}function i(v){return Dt.value.includes(v)}function a(){Dt.value=[]}function l(v){const w=St.value.indexOf(v);w>=0?St.value.splice(w,1):St.value.push(v)}function c(v){return St.value.includes(v)}function f(){St.value=[]}function h(v){rt.value=v,b(v.path)}async function b(v){try{const w=await Ve(`/api/fs/tree?path=${encodeURIComponent(v)}`);if(w.ok){const M=await w.json();Mn.value=M.files??[]}}catch{Mn.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 x(v){Tn.value=v,$s.value=Ho(v),Fs.value=!0,Ms.value="";try{const w=rt.value?`${rt.value.path}/${v}`:v,M=await Ve(`/api/fs/read?path=${encodeURIComponent(w)}`);if(M.status===413){Ms.value="File too large to preview (max 1MB)",Tt.value="";return}if(M.ok){const P=await M.json();Tt.value=P.content??""}}catch{Tt.value=E(v)}finally{Fs.value=!1}}function E(v){const w=v.split("/").pop()??v;return w==="package.json"?JSON.stringify({name:rt.value?.name?.toLowerCase()??"project",version:"1.0.0",type:"module",scripts:{dev:"vite",build:"vite build",test:"vitest"},dependencies:{}},null,2):w==="README.md"?`# ${rt.value?.name??"Project"}

A project in the AIUI ecosystem.
`:w.endsWith(".ts")||w.endsWith(".js")?`// ${w}
// ${rt.value?.name??"Project"}

export function main() {
  console.log('Hello from ${w}')
}
`:`// ${w}
`}async function C(v){const w=v.trim().replace(/[^a-zA-Z0-9_\-. ]/g,"");if(!w)return;const M=`${qo}/${w}`;try{const U=await Ve("/api/fs/mkdir",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:M})});if(!U.ok){const oe=await U.json().catch(()=>({}));console.warn("[AIUI code] Failed to create directory:",oe.error??U.status)}}catch(U){console.warn("[AIUI code] Could not create directory:",U)}const P={name:w,path:M,isGit:!1,language:"Unknown"};Jt.value=[P,...Jt.value],h(P)}function y(){Tn.value=null,Tt.value="",$s.value="plaintext"}return{codeMode:Fn,isCodeMode:e,activeProject:rt,hasActiveProject:t,projectList:Jt,fileTree:Mn,activeFile:Tn,activeFileContent:Tt,activeFileLanguage:$s,selectedDesignTokens:Dt,selectedFiles:St,fileLoading:Ro(Fs),fileError:Ro(Ms),enterCodeMode:o,exitCodeMode:u,selectProject:h,openFile:x,loadProjects:n,detectLanguage:Ho,createProject:C,clearActiveFile:y,toggleDesignToken:r,isDesignTokenSelected:i,clearDesignTokens:a,toggleFileSelection:l,isFileSelected:c,clearFileSelection:f}}const Wo="aiui-settings",Ts={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},Hi=Cn("settings",()=>{const e=k(t());function t(){try{const g=localStorage.getItem(Wo);if(g)return{...Ts,...JSON.parse(g)}}catch{}return{...Ts}}function n(){localStorage.setItem(Wo,JSON.stringify(e.value))}function s(){const g=document.documentElement;g.style.setProperty("--color-accent",e.value.accentColor);const x={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",x.blur),g.style.setProperty("--glass-opacity",x.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 o=A({get:()=>e.value.accentColor,set:g=>{e.value.accentColor=g}}),u=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 x=e.value.hiddenContentTabs.indexOf(g);x>=0?e.value.hiddenContentTabs.splice(x,1):e.value.hiddenContentTabs.push(g)}function h(g,x){e.value.shortcuts[g]=x}function b(){e.value={...Ts}}return{settings:e,accentColor:o,glassIntensity:u,fontSize:r,hiddenContentTabs:i,notificationsEnabled:a,autoArchiveDays:l,isTabVisible:c,toggleTabVisibility:f,setShortcut:h,resetSettings:b,applyCssVars:s}}),cr="https://image.tmdb.org/t/p",V=`${cr}/w342`,G=`${cr}/w780`,Ht=[{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(Ht.flatMap(e=>e.genres))].sort();[...new Set(Ht.flatMap(e=>e.sources.map(t=>t.type)))];const _n=[{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"}]}],us=[{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:"⚡"}]}],ko="/aiui/",dr=`${ko}api/claude/v1/messages`,Wi=`${ko}api/openrouter`,Vi=`${ko}api/ollama/api/chat`,Gi=Ht.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(`
`),Ki=_n.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(`
`),Ji=us.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(`
`),Xn=k([]);let Vo=0;const Zi=1800*1e3;async function Go(){if(!(Date.now()-Vo<Zi&&Xn.value.length>0))try{const t=await Ve("/aiui/api/music/rankings?days=30&limit=40");if(!t.ok)return;const n=await t.json();Array.isArray(n)&&(Xn.value=n.map(s=>({title:s.title,artist:s.artist,albumTitle:s.albumTitle,duration:s.duration})),Vo=Date.now())}catch{}}function Yi(){return Xn.value.length===0?"":`

**Wavlake trending tracks** (these are confirmed playable — prefer recommending from this list when relevant):
${Xn.value.map(t=>`- "${t.title}" by ${t.artist}${t.albumTitle?` (${t.albumTitle})`:""}`).join(`
`)}`}const Xi=`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.

**Apps/Tools:** When recommending apps, clients, wallets, or tools, use [[app_ext:Name|Category|Platforms|URL]], e.g. [[app_ext:Damus|nostr-client|iOS|https://damus.io]]. Categories: nostr-client, lightning-wallet, bitcoin-wallet, privacy, node, dev-tool. Platforms: comma-separated list of ios,android,web,desktop,cli. Write a brief description on the same line.

**Images:** When sharing or describing images, use standard markdown image syntax: ![Description](https://image-url). Include a brief caption.

**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:
${Gi}

The user's song library:
${Ki}

The user's podcast library:
${Ji}`,Jn=k("claude"),at=k("claude-haiku-4.5"),fr=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:"ollama",name:"Ollama (Local AI)",models:[{id:"qwen2.5-coder:3b",name:"Qwen 2.5 Coder 3B"},{id:"llama3.2:3b",name:"Llama 3.2 3B"},{id:"phi4-mini",name:"Phi-4 Mini"}]}),e.push({id:"mock",name:"Local (no API)",models:[{id:"echo",name:"Echo (mirror input)"}]}),e});function Qi(e){Jn.value=e;const t=fr.value.find(n=>n.id===e);t&&t.models.length>0&&(at.value=t.models[0].id)}function ea(e){at.value=e}function ta(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 Ko(e){const t=[];for(const n of e){const s=n.content&&n.content.trim().length>0?n.content:"...",o={role:n.role,content:s,images:n.images};if(t.length>0&&t[t.length-1].role===o.role){const u=t[t.length-1];u.content=u.content+`
`+o.content,o.images&&o.images.length>0&&(u.images=[...u.images??[],...o.images])}else t.push(o)}return t}async function so(e,t,n,s,o){const u=[];s&&u.push({role:"system",content:s});for(const c of e)u.push({role:c.role,content:c.content});let r;try{r=await Ve(Vi,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:at.value,messages:u,stream:!0}),signal:o})}catch{n("Cannot connect to Ollama. Is it running?");return}if(!r.ok){const c=await r.text().catch(()=>"Could not read error body");n(`Ollama error ${r.status}: ${c}`);return}const i=r.body?.getReader();if(!i){n("No response body");return}const a=new TextDecoder;let l="";try{for(;;){if(o?.aborted){i.cancel();return}const{done:c,value:f}=await i.read();if(c)break;l+=a.decode(f,{stream:!0});const h=l.split(`
`);l=h.pop()??"";for(const b of h)if(b.trim())try{const g=JSON.parse(b);if(g.message?.content&&t(g.message.content),g.done)return}catch{}}}finally{i.cancel().catch(()=>{})}}async function oo(e,t,n){const s=e.filter(u=>u.role==="user").pop(),o=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 u of o){if(n?.aborted)return;t(u),await new Promise(r=>setTimeout(r,12))}}async function uo(e,t,n,s,o,u,r){const i={"Content-Type":"application/json"},a=Hi();if(a.settings.useOwnApiKey&&a.settings.claudeApiKey)i["x-api-key"]=a.settings.claudeApiKey;else{const h=await vo("claude");h&&(i["x-api-key"]=h)}const l=e.map(h=>({role:h.role,content:ta(h)})),c={model:at.value,system:s,messages:l,stream:!0,webSearch:o};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 Ve(dr,{method:"POST",headers:i,body:JSON.stringify(c),signal:u});if(!f.ok){const h=await f.text().catch(()=>"Could not read error body");n(`Claude proxy error ${f.status}: ${h}`);return}await pr(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,u)}async function ro(e,t,n,s,o){const u=[{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 vo("openrouter");i&&(r.Authorization=`Bearer ${i}`);const a=await Ve(Wi,{method:"POST",headers:r,body:JSON.stringify({model:at.value,messages:u,stream:!0}),signal:o});if(!a.ok){const l=await a.text().catch(()=>"Could not read error body");n(`OpenRouter error ${a.status}: ${l}`);return}await pr(a,l=>{if(l!=="[DONE]")try{const f=JSON.parse(l).choices?.[0]?.delta?.content;f&&t(f)}catch{}},n,o)}async function pr(e,t,n,s){const o=e.body?.getReader();if(!o){n("No response body");return}const u=new TextDecoder;let r="";try{for(;;){if(s?.aborted){o.cancel();return}const{done:i,value:a}=await o.read();if(i)break;r+=u.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{o.cancel().catch(()=>{})}}function Jo(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 o=n.content?` — ${n.content.slice(0,200)}${n.content.length>200?"…":""}`:"";return`${s+1}. [${n.title}](${n.url})${o}`}).join(`
`)}`}function Zo(e){let t=Xi;const n=e.activeConversation?.personaId;if(n){const i=yo().getPersona(n);i?.systemPrompt&&(t=i.systemPrompt+`

`+t)}t+=Yi();const s=lr();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 o=pi();t+=o.buildArchyContext();const u=wo();if(u.isCodeMode.value){const r=[];if(u.activeProject.value&&r.push(`**Active project:** ${u.activeProject.value.name} (${u.activeProject.value.language??"Unknown"})`),u.selectedDesignTokens.value.length>0&&r.push(`**Selected design tokens:** ${u.selectedDesignTokens.value.join(", ")}`),u.selectedFiles.value.length>0&&r.push(`**Selected files:** ${u.selectedFiles.value.join(", ")}`),u.activeFileContent.value&&u.activeFile.value){const i=u.activeFileContent.value.slice(0,2e3);r.push(`**Open file (${u.activeFile.value}):**
\`\`\`${u.activeFileLanguage.value}
${i}
\`\`\``)}r.length>0&&(t+=`

**Code Context:**
${r.join(`
`)}`)}return t}function Yo(e){const t=e.activeConversation;return t?{temperature:t.temperature,maxTokens:t.maxTokens,topP:t.topP,stopSequences:t.stopSequences}:{}}let it=null;async function na(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 o=s.content.slice(0,60)+(s.content.length>60?"...":"");if(n.title===o)try{const u={"Content-Type":"application/json"},r=await vo("claude");r&&(u["x-api-key"]=r);const i=await Ve(dr,{method:"POST",headers:u,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 sa(e,t,n,s,o,u){const r=n.map(a=>({role:a.role,content:a.content})),i=at.value;at.value=t;try{e==="claude"?await uo(r,s,o,"You are a helpful assistant.",!1,u):e==="openrouter"?await ro(r,s,o,"You are a helpful assistant.",u):e==="ollama"?await so(r,s,o,"You are a helpful assistant.",u):await oo(r,s,u)}finally{at.value=i}}function hr(){const e=wt();Go();function t(){it&&(it.abort(),it=null),e.isStreaming=!1}async function n(r,i){Go();const a=Jn.value;it=new AbortController;const l=it.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=Zo(e),g=!1;if(e.webSearchEnabled&&r.trim()){const w=await Uo(r);w.length>0?(b+=Jo(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 x=e.webSearchEnabled&&!g,E=Ko(e.messages.filter(w=>w.id!==h.id).map(w=>({role:w.role,content:w.content,images:w.images}))),C=w=>e.appendToLastMessage(f,w),y=w=>{console.error(`[AIUI ${a}]`,w),e.appendToLastMessage(f,`⚠ ${w}`)},v=Yo(e);try{a==="claude"?await uo(E,C,y,b,x,l,v):a==="openrouter"?await ro(E,C,y,b,l):a==="ollama"?await so(E,C,y,b,l):await oo(E,C,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{it=null,e.isStreaming=!1}na(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 u())}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.length-1;i.messages[a].role==="assistant"&&e.deleteMessagesAfter(r,a),await u()}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].reverse().find(y=>y.role==="user");if(!a)return;const l=Jn.value;it=new AbortController;const c=it.signal,f=r,h=e.addMessage(f,{role:"assistant",content:""});if(!h)return;e.isStreaming=!0;let b=Zo(e);if(e.webSearchEnabled&&a.content.trim()){const y=await Uo(a.content);y.length>0&&(b+=Jo(y),e.setMessageWebResults(f,h.id,y))}const g=Ko(e.messages.filter(y=>y.id!==h.id).map(y=>({role:y.role,content:y.content,images:y.images}))),x=y=>e.appendToLastMessage(f,y),E=y=>{console.error(`[AIUI ${l}]`,y),e.appendToLastMessage(f,`⚠ ${y}`)},C=Yo(e);try{l==="claude"?await uo(g,x,E,b,e.webSearchEnabled,c,C):l==="openrouter"?await ro(g,x,E,b,c):l==="ollama"?await so(g,x,E,b,c):await oo(g,x,c)}catch(y){if(y instanceof DOMException&&y.name==="AbortError")return;const v=y instanceof Error?y.message:String(y);e.appendToLastMessage(f,`

⚠ Connection error: ${v}`)}finally{it=null,e.isStreaming=!1}}return{sendMessage:n,stopGeneration:t,editAndResend:s,regenerateLastResponse:o,activeProvider:Jn,activeModel:at,availableProviders:fr,setProvider:Qi,setModel:ea}}async function oa(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 Ve(`/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 Et(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 bt(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 ua(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 ra(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 ia(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 aa(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 Qn(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 la(e){return/\b(image|images|photo|photos|picture|pictures|screenshot|screenshots|gallery|artwork|illustration|visual|infographic|diagram|chart)\b/i.test(e)}function Xo(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 ca(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 da(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 Qo(e){return/<recipe_ext\s/i.test(e)}function io(e){return e?/\b(code|coding|programming|function|algorithm|implement|debug|syntax|API|library|framework|snippet|script|regex|refactor|compile|runtime|variable|class|method|module|package|dependency|typescript|javascript|python|rust|go|java|swift|kotlin|ruby|php|css|html|sql|bash|shell|cli|terminal|git|docker|webpack|vite|npm|yarn|pnpm)\b/i.test(e)||/write (me )?a |how (do i|to) (code|program|implement|build|create|make)|show me.*code|code (example|sample)|fix.*(bug|error|issue)|what does this code/i.test(e):!1}function eu(e){return(e.match(/```[\s\S]*?```/g)??[]).length>=3}function xn(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 tu(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 Co(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 fa(e){const t=e.toLowerCase();return[/popular (clients?|apps?|wallets?|tools?) include/i,/you (can|could|might|should) (use|try|check out|download|install)/i,/available (on|for) (ios|android|web|desktop|mac|windows|linux)/i,/download (from|on|at)/i,/(app store|play store|google play|f-?droid|github releases?)/i,/open.?source.*(app|client|tool|wallet)/i].filter(s=>s.test(t)).length>=2}function Is(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 pa(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":da(t)?"recipe":io(t)?"code":Co(t)?"app":xn(t)?"nostr":Et(t)?"news":ra(t)?"websites":null}function nu(e,t,n,s,o,u,r,i,a,l,c,f,h,b=!1,g=!1){const x=e.toLowerCase().trim(),E=pa(e),C=[];t&&C.push("film"),o&&C.push("book"),u&&C.push("tvshow"),r&&C.push("image"),i&&C.push("place"),g&&C.push("recipe"),n&&C.push("song"),s&&C.push("podcast"),b&&C.push("code"),h&&C.push("app"),c&&C.push("magazine"),a&&C.push("news"),l&&C.push("websites"),f&&C.push("nostr");const y=v=>{const w=v.filter(P=>C.includes(P)),M=C.filter(P=>!w.includes(P));return[...w,...M]};if(xn(x))return y(["nostr","app","magazine","websites"]);if(Co(x)){const v=y(["app","nostr","magazine","websites"]);return v.length>0?v:f?["nostr"]:[]}if(Et(x))return y(["magazine","news","websites","podcast"]);if(c&&C.length===1)return["magazine"];if(l&&C.length===1)return["websites"];if(E&&C.includes(E)){const v=C.filter(w=>w!==E);return[E,...v]}return C}const Ps=[{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"]}],mr=/\[\[film:(f?\d+)\]\]/gi,_o=/\[\[film_ext:([^|]+)\|(\d{4})\|([^\]]+)\]\]/gi,gr=/\[\[song:(s?\d+)\]\]/gi,br=/\[\[song_ext:([^|]+)\|([^|]+)(?:\|(\d{4}))?\]\]/gi,xr=/\[\[podcast:(p?\d+)\]\]/gi,vr=/\[\[podcast_ext:([^|]+)\|([^|]+)(?:\|(\d{4}))?\]\]/gi,ha=/\[\[book:(b?\d+)\]\]/gi,yr=/\[\[book_ext:([^|]+)\|([^|]+)(?:\|(\d{4}))?\]\]/gi,wr=/\[\[tv_ext:([^|]+)\|([^|\]]+)(?:\|([^|\]]+))?\]\]/gi,kr=/\[\[place_ext:([^|]+)\|([^|]*)(?:\|([^|]*))?(?:\|([^|]*))?(?:\|([^|]*))?(?:\|([^|]*))?\]\]/gi,Cr=/\[\[app_ext:([^|]+)\|([^|]*)(?:\|([^|]*))?(?:\|([^|]*))?\]\]/gi,ma=/\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)/g,ga=/^https?:\/\//i;function ba(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 o=new URL(s);return/^https?:$/i.test(o.protocol)?o.href:void 0}catch{return}}function xa(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 o=s[1].trim().slice(0,60);if(o.length>3&&o.length<50)return o}}}function va(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 lt(e,t,n){const s=e.lastIndexOf(`
`,t-1),o=s===-1?0:s+1,u=e.indexOf(`
`,t+n),r=u===-1?e.length:u;let i=e.slice(o,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 es(e){return e.toLowerCase().trim().replace(/\/$/,"")}const ya=2e3;function su(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,o){const u=su(t).replace(/\s+/g," ").trim().slice(0,150);let r=su(n).replace(/\n{3,}/g,`

`).trim().slice(0,ya);if(u.length<2||r.length<15)return;const i=u.toLowerCase(),a=r.toLowerCase();if(i.length>=10&&a.startsWith(i.slice(0,Math.min(i.length,40)))&&(r=r.slice(u.length).replace(/^[\s.,:;—–-]+/,"").trim(),r.length<15))return;const l=`${u.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:u,content:r,url:ba(n),author:xa(n),imageUrl:f,group:o})}function It(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 ou(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,""),o=[],u=/^#{2,3}\s+(.+)$/gm;let r;for(;(r=u.exec(s))!==null;){const b=r[1].trim().replace(/[\p{Emoji_Presentation}\p{Extended_Pictographic}]\uFE0F?\s*/gu,"").replace(/^[#*_\s-]+/,"").trim();b.length>1&&o.push({title:b,start:r.index,contentStart:r.index+r[0].length})}for(let h=0;h<o.length;h++){const b=o[h],g=h+1<o.length?o[h+1].start:s.length,x=It(s.slice(b.contentStart,g));if(x.length<20)continue;const E=x.split(/\n\s*[-•]\s+/).map(C=>C.replace(/^[-•]\s*/,"").trim()).filter(C=>C.length>10);if(E.length>=2)for(const C of E){const y=It(C);if(y.length<15)continue;const v=/^\*\*([^*]+)\*\*\s*[:\u2014\u2013–]\s*(.+)/s.exec(y);if(v)Ye(t,v[1].trim(),v[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,x,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=It(r[2]);b.length>15&&Ye(t,h,b,n)}const a=o.length>0?o[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 C=r[1].trim(),y=s.slice(Math.max(0,r.index-10),r.index);/\d+\.\s*$/.test(y)||/[-•]\s*$/.test(y)||C.length>2&&C.length<100&&b.push({title:C,start:r.index,end:r.index+r[0].length})}const g=/(?:^|\n)\s*\d+\.\s*\*\*([^*]+)\*\*\s*[-–—:]+\s*/g,x=[];for(;(r=g.exec(s))!==null;){const C=r[1].trim();C.length>1&&x.push({title:C,start:r.index,contentStart:r.index+r[0].length})}let E;if(x.length>0&&b.length>0){const C=x[0].start,y=b.filter(v=>v.end<=C).pop();y&&(E=y.title)}for(let C=0;C<x.length;C++){const y=x[C],v=C+1<x.length?x[C+1].start:s.length,w=It(s.slice(y.contentStart,v));w.length>=15&&Ye(t,y.title,w,n,E)}if(t.length===0){const C=/(?:^|\n)\s*[-•]\s*\*\*([^*]+)\*\*\s*[-–—:]+\s*/g,y=[];for(;(r=C.exec(s))!==null;){const v=r[1].trim();v.length>1&&y.push({title:v,start:r.index,contentStart:r.index+r[0].length})}for(let v=0;v<y.length;v++){const w=y[v],M=v+1<y.length?y[v+1].start:s.length,P=It(s.slice(w.contentStart,M));P.length>=15&&Ye(t,w.title,P,n)}}if(t.length===0){const C=/(?:^|\n)\s*\*\*([^*]{3,60})\*\*\s*[-–—:]+\s*([\s\S]*?)(?=\n\s*\*\*[^*]{3,60}\*\*\s*[-–—:]|\n{2,}\*\*[^*]+\*\*\s*:|\s*$)/g;for(;(r=C.exec(s))!==null;){const y=r[1].trim(),v=It(r[2].trim());y.length>2&&v.length>=15&&Ye(t,y,v,n)}}if(t.length>0){const C=x.length>0?x[0].start:s.length,y=b.length>0&&b[0].start<C?b[0].start:C,v=Math.min(C,y);if(v>30){const w=s.slice(0,v).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),x=f.indexOf(b.title);return g>=0&&x>=0?g-x:g>=0?-1:x>=0?1:0}),t}function wa(e){return va(e)}function uu(e){const t=[],n=new Set,s=/\*\*([^*]+)\*\*\s*\(([a-zA-Z0-9][-a-zA-Z0-9.]*\.[a-zA-Z]{2,})\)/g;let o;for(;(o=s.exec(e))!==null;){const u=o[1].trim().slice(0,500),r=o[2].trim();if(u.length<2)continue;const i=/^https?:\/\//i.test(r)?r:`https://${r}`,a=es(i);n.has(a)||(n.add(a),t.push({title:u,url:i,content:void 0}))}return t}function ru(e){const t=[],n=new Set;let s;const o=new RegExp(ma.source,"g");for(;(s=o.exec(e))!==null;){const u=s[1].trim().slice(0,500),r=s[2].trim();if(u.length<2||r.length<10||!ga.test(r))continue;try{new URL(r)}catch{continue}const i=r.toLowerCase().replace(/\/$/,"");n.has(i)||(n.add(i),t.push({title:u,url:r,content:void 0}))}return t}function Pt(e,t){const n=new Map;for(const s of e)n.set(es(s.url),s);for(const s of t){const o=es(s.url);n.has(o)||n.set(o,s)}return[...n.values()]}function ka(e){return e.startsWith("f")?e:`f${e}`}function rs(e){const t=[];let n;const s=new RegExp(mr.source,"gi");for(;(n=s.exec(e))!==null;){const o=ka(n[1]);t.includes(o)||t.push(o)}return t}function Ca(e){return e.map(t=>Ht.find(n=>n.id===t)).filter(t=>!!t)}function _a(e){const t=[],n=new Set;let s;const o=new RegExp(_o.source,"gi");for(;(s=o.exec(e))!==null;){const u=s[1].trim(),r=parseInt(s[2],10),i=s[3].trim(),a=`${u.toLowerCase()}|${r}`;n.has(a)||(n.add(a),t.push({id:`ext-${a.replace(/\W/g,"-")}`,title:u,year:r,posterUrl:"",synopsis:lt(e,s.index,s[0].length),genres:[],rating:0,runtime:0,director:i,cast:[],sources:[]}))}return t}function Ls(e){const t=Ca(rs(e)),n=_a(e);return[...t,...n]}function Aa(e){return e.startsWith("s")?e:`s${e}`}function _r(e){const t=[];let n;const s=new RegExp(gr.source,"gi");for(;(n=s.exec(e))!==null;){const o=Aa(n[1]);t.includes(o)||t.push(o)}return t}function Da(e){return e.map(t=>_n.find(n=>n.id===t)).filter(t=>!!t)}function Ar(e,t){const n=e.toLowerCase(),s=t.toLowerCase(),o=["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 u of o)if(n.includes(u)||s.includes(u))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 Sa(e){const t=[],n=new Set;let s;const o=new RegExp(br.source,"gi");for(;(s=o.exec(e))!==null;){const u=s[1].trim(),r=s[2].trim();if(!Ar(u,r))continue;const i=s[3]?parseInt(s[3],10):void 0,a=`${u.toLowerCase()}|${r.toLowerCase()}`;n.has(a)||(n.add(a),t.push({id:`ext-${a.replace(/\W/g,"-")}`,title:u,artist:r,year:i,coverUrl:void 0,sources:[]}))}return t}function iu(e){const t=e.toLowerCase(),n=[],s=new Set;for(const o of _n){const u=o.id;if(s.has(u))continue;const r=o.title.toLowerCase(),i=o.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(u),n.push({song:o,pos:Math.min(l,f)}))}return n.sort((o,u)=>o.pos-u.pos).map(o=>o.song)}function au(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:o,titleIdx:u,artistIdx:r}of s){let i;const a=new RegExp(o.source,o.flags);for(;(i=a.exec(e))!==null;){const l=i[u].trim(),c=i[r].trim();if(l.length<2||c.length<2||!Ar(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((o,u)=>o.pos-u.pos).map(({title:o,artist:u})=>({id:`ext-${`${o}|${u}`.toLowerCase().replace(/\W/g,"-")}`,title:o,artist:u,coverUrl:void 0,sources:[]}))}function zs(e,t=""){const n=Da(_r(e)),s=Sa(e),o=[...n,...s],u=rs(e).length>0||/\[\[film_ext:/.test(e)||Ao(e).length>0||/\[\[podcast_ext:/.test(e)||/\[\[tv_ext:/.test(e)||/\[\[book_ext:/.test(e);if(o.length>0){if(u)return o;const f=iu(e),h=au(e),b=new Set(o.map(x=>`${x.title.toLowerCase()}|${x.artist.toLowerCase()}`)),g=[...f,...h].filter(x=>!b.has(`${x.title.toLowerCase()}|${x.artist.toLowerCase()}`));return[...o,...g]}if(u)return[];if(bt(e))return[];const r=t.toLowerCase();if(r&&!ua(r))return[];const i=iu(e),a=au(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 Ea(e){return e.startsWith("p")?e:`p${e}`}function Ao(e){const t=[];let n;const s=new RegExp(xr.source,"gi");for(;(n=s.exec(e))!==null;){const o=Ea(n[1]);t.includes(o)||t.push(o)}return t}function $a(e){return e.map(t=>us.find(n=>n.id===t)).filter(t=>!!t)}function Fa(e,t){const n=e.toLowerCase(),s=t.toLowerCase(),o=["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 u of o)if(n.includes(u)||s.includes(u))return!1;return!(n.length>80||s.length>50)}function Ma(e){const t=[],n=new Set;let s;const o=new RegExp(vr.source,"gi");for(;(s=o.exec(e))!==null;){const u=s[1].trim(),r=s[2].trim();if(!Fa(u,r))continue;const i=s[3]?parseInt(s[3],10):void 0,a=`${u.toLowerCase()}|${r.toLowerCase()}`;n.has(a)||(n.add(a),t.push({id:`ext-${a.replace(/\W/g,"-")}`,title:u,host:r,year:i,coverUrl:void 0,sources:[]}))}return t}function Bs(e){const t=$a(Ao(e)),n=Ma(e);return[...t,...n]}function Ta(e){const t=[],n=new Set;let s;const o=new RegExp(yr.source,"gi");for(;(s=o.exec(e))!==null;){const u=s[1].trim(),r=s[2].trim(),i=s[3]?parseInt(s[3],10):void 0,a=`${u.toLowerCase()}|${r.toLowerCase()}`;n.has(a)||(n.add(a),t.push({id:`ext-${a.replace(/\W/g,"-")}`,title:u,author:r,year:i,coverUrl:void 0,description:lt(e,s.index,s[0].length),genres:[],sources:[]}))}return t}function Ia(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:o,titleIdx:u,authorIdx:r}of s){let i;const a=new RegExp(o.source,o.flags);for(;(i=a.exec(e))!==null;){const l=i[u].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=lt(e,i.index,i[0].length);t.push({title:l,author:c,desc:b,pos:i.index})}}return t.sort((o,u)=>o.pos-u.pos).map(({title:o,author:u,desc:r})=>({id:`ext-${`${o}|${u}`.toLowerCase().replace(/\W/g,"-")}`,title:o,author:u,description:r,coverUrl:void 0,genres:[],sources:[]}))}function Rs(e,t){const n=Ta(e);if(n.length>0)return n;if(!ia(t)&&!aa(e))return[];if(bt(e))return[];const s=e.replace(/\n---\n\s*(?:Sources|References|Links):?\s*\n[\s\S]*$/i,"");return Ia(s)}function Pa(e){const t=[],n=new Set;let s;const o=new RegExp(wr.source,"gi");for(;(s=o.exec(e))!==null;){const u=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=u.toLowerCase();n.has(f)||(n.add(f),t.push({id:`ext-${f.replace(/\W/g,"-")}`,title:u,creator:c||void 0,year:l,synopsis:lt(e,s.index,s[0].length),genres:[],sources:[]}))}return t}function La(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 za(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 o of s){let u;const r=new RegExp(o.source,o.flags);for(;(u=r.exec(e))!==null;){const i=u[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=lt(e,u.index,u[0].length);t.push({title:i,desc:l,pos:u.index})}}return t.sort((o,u)=>o.pos-u.pos).map(({title:o,desc:u})=>({id:`ext-${o.toLowerCase().replace(/\W/g,"-")}`,title:o,synopsis:u,genres:[],sources:[]}))}function Ba(e){const t=[],n=new Set;let s;const o=new RegExp(_o.source,"gi");for(;(s=o.exec(e))!==null;){const u=s[1].trim(),r=parseInt(s[2],10),i=s[3].trim(),a=u.toLowerCase();n.has(a)||(n.add(a),t.push({id:`ext-${a.replace(/\W/g,"-")}`,title:u,year:r,synopsis:lt(e,s.index,s[0].length),creator:i,genres:[],sources:[]}))}return t}function js(e,t){const n=Pa(e);return n.length>0?n:!Qn(t)&&!La(e)?[]:bt(e)?[]:Qn(t)&&/\[\[film_ext:/.test(e)?Ba(e):rs(e).length>0?[]:za(e)}function Ra(e){const t=[],n=new Set,s=/!\[([^\]]*)\]\((https?:\/\/[^)]+)\)/gi;let o;for(;(o=s.exec(e))!==null;){const r=o[1].trim(),i=o[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 u=/(https?:\/\/[^\s)"'>]+\.(?:jpg|jpeg|png|gif|webp|svg|avif|bmp|tiff)(?:\?[^\s)"'>]*)?)/gi;for(;(o=u.exec(e))!==null;){const r=o[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 lu(e,t){const n=Ra(e);return n.length===0?[]:la(t)||n.length>=2||n.length===1&&n[0].alt&&n[0].alt.length>2?n:[]}function ja(e){const t=[],n=new Set;let s;const o=new RegExp(kr.source,"gi");for(;(s=o.exec(e))!==null;){const u=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=u.toLowerCase();n.has(f)||(n.add(f),t.push({id:`ext-place-${f.replace(/\W/g,"-")}`,name:u,cuisine:r,city:i,rating:a&&!isNaN(a)?a:void 0,priceLevel:l&&l>=1&&l<=4?l:void 0,address:c,description:lt(e,s.index,s[0].length),sources:[]}))}return t}function Na(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",o=[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 u of o){let r;const i=new RegExp(u.source,u.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=lt(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,x=/(\${1,4})\b/.exec(h),E=x?x[1].length:void 0;t.push({name:a,cuisine:c,desc:f,rating:g,priceLevel:E,pos:r.index})}}return t.sort((u,r)=>u.pos-r.pos).map(({name:u,cuisine:r,desc:i,rating:a,priceLevel:l})=>({id:`ext-place-${u.toLowerCase().replace(/\W/g,"-")}`,name:u,cuisine:r,rating:a,priceLevel:l,description:i,sources:[]}))}function Ua(e){const t=[],n=new Set,s=/(?:^|\n)\s*(?:\d+\.\s*|[-•]\s*)\*\*([^*]{2,60})\*\*\s*[-–—:]\s*([^\n]{5,200})/gm;let o;for(;(o=s.exec(e))!==null;){const u=o[1].trim();if(u.length<2||/\[\[(film|song|podcast|book|tv|place)(_ext)?:/.test(u))continue;const r=u.toLowerCase();n.has(r)||(n.add(r),t.push({name:u,desc:o[2].trim(),pos:o.index}))}return t.sort((u,r)=>u.pos-r.pos).map(({name:u,desc:r})=>({id:`ext-place-${u.toLowerCase().replace(/\W/g,"-")}`,name:u,description:r,sources:[]}))}function cu(e,t){const n=ja(e);if(n.length>0)return n;if(!Xo(t)&&!ca(e))return[];if(bt(e))return[];const s=Na(e);if(Xo(t)){const o=Ua(e),u=new Set(s.map(a=>a.name.toLowerCase())),r=o.filter(a=>!u.has(a.name.toLowerCase())),i=[...s,...r];return i.length>0?i:[]}return s}function Ns(e){const t=[],n=/```(\w*)\n([\s\S]*?)```/g;let s;for(;(s=n.exec(e))!==null;){const o=s[1]||"text",u=s[2].trimEnd();if(u.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:o,code:u,label:a})}return t}function Dr(e){return e.replace(mr,"").replace(_o,"").replace(/\n{3,}/g,`

`).trim()}function Sr(e){return e.replace(gr,"").replace(br,"").replace(/\n{3,}/g,`

`).trim()}function Er(e){return e.replace(xr,"").replace(vr,"").replace(/\n{3,}/g,`

`).trim()}function Oa(e){return e.replace(ha,"").replace(yr,"").replace(/\n{3,}/g,`

`).trim()}function qa(e){return e.replace(wr,"").replace(/\n{3,}/g,`

`).trim()}function Ha(e){return e.replace(kr,"").replace(/\n{3,}/g,`

`).trim()}function Wa(e){return e.replace(Cr,"").replace(/\n{3,}/g,`

`).trim()}function Va(e){return Dr(Sr(Er(Oa(qa(Ha(Ka(Za(Wa(e)))))))))}function Ga(e){return e.replace(/^[\s]*[-*]\s*\[[^\]]+\]\(https?:\/\/[^)\s]+\)\s*$/gm,"").replace(/\s*\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)/g,(t,n)=>` ${n}`).replace(/\n{3,}/g,`

`).trim()}const $r=/<recipe_ext\s+([^>]+)>([\s\S]*?)<\/recipe_ext>/gi;function ao(e){const t=[];let n;for(;(n=$r.exec(e))!==null;){const s=n[1],o=n[2],u=s.match(/title="([^"]*)"/)?.[1]||"Recipe",r=s.match(/servings="([^"]*)"/)?.[1],i=s.match(/time="([^"]*)"/)?.[1],a=s.match(/calories="([^"]*)"/)?.[1],l=o.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:u,servings:r,time:i,calories:a,ingredients:c,steps:f})}return t}function Ka(e){return e.replace($r,"").replace(/\n{3,}/g,`

`).trim()}const Fr=/<event_ext\s+([^>]*?)(?:\/>|>([\s\S]*?)<\/event_ext>)/gi;function Ja(e){const t=[];let n;for(;(n=Fr.exec(e))!==null;){const s=n[1],o=n[2]?.trim(),u=s.match(/title="([^"]*)"/)?.[1]||"Event",r=s.match(/date="([^"]*)"/)?.[1]||"",i=s.match(/location="([^"]*)"/)?.[1],a=s.match(/url="([^"]*)"/)?.[1];t.push({title:u,date:r,location:i,url:a,description:o})}return t}function Za(e){return e.replace(Fr,"").replace(/\n{3,}/g,`

`).trim()}const Ya=/\.(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,Xa=/\.(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 du(e){const t=[],n=new Set,s=[];let o;const u=/\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)/g;for(;(o=u.exec(e))!==null;)s.push([o.index,o.index+o[0].length]);const r=/\*\*([^*]+)\*\*\s*\(([a-zA-Z0-9][-a-zA-Z0-9.]*\.[a-zA-Z]{2,})\)/g;for(;(o=r.exec(e))!==null;)s.push([o.index,o.index+o[0].length]);const i=/https?:\/\/[^\s)\]"'<>,]+/g;for(;(o=i.exec(e))!==null;)s.push([o.index,o.index+o[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(;(o=l.exec(e))!==null;){if(a(o.index,o[0].length))continue;const c=o[1];if(!Ya.test(c)||Xa.test(c)||/^\d/.test(c))continue;const f=`https://${c}`,h=es(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 fu(e,t){const n=[],s=new Set;let o=!1;const u=new RegExp(Cr.source,"gi");let r;for(;(r=u.exec(e))!==null;){o=!0;const f=r[1].trim(),h=r[2]?.trim()||"dev-tool",b=(r[3]?.trim()||"web").split(",").map(C=>C.trim()),g=r[4]?.trim()||"",x=`ext-${f.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;if(s.has(x))continue;s.add(x);const E=Ps.find(C=>C.name.toLowerCase()===f.toLowerCase()||C.keywords.some(y=>y.toLowerCase()===f.toLowerCase()));if(E&&!s.has(E.id))s.add(E.id),n.push(E);else if(!E){const C=lt(e,r.index,r[0].length)||`${f} — ${h} app`;n.push({id:x,name:f,description:C,longDescription:C,category:h,platforms:b,url:g,keywords:[f.toLowerCase()]})}}const i=e.toLowerCase();for(const f of Ps){if(s.has(f.id))continue;const h=[f.name.toLowerCase(),...f.keywords.map(b=>b.toLowerCase())];for(const b of h){if(b.length<3)continue;const g=b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if((b.length<=4?new RegExp(`\\b${g}\\b`,"i"):new RegExp(g,"i")).test(i)&&!s.has(f.id)){s.add(f.id),n.push(f);break}}}if(o)return n;const a=t.toLowerCase(),l=Ps.some(f=>[f.name.toLowerCase(),...f.keywords.map(h=>h.toLowerCase())].some(h=>h.length>=3&&a.includes(h)));return(Co(t)||xn(t)||l||fa(e))&&n.length>=1||n.length>=2?n:[]}const Ue=k(!1),Zt=k([]),pu=k([]),hu=k([]),In=k([]),Us=k([]),mu=k([]),Os=k([]),gu=k(null),Yt=k([]),Xt=k([]),bu=k([]),xu=k([]),vu=k([]),yu=k([]),wu=k([]),Qt=k(null),en=k(null),tn=k(null),nn=k(null),sn=k(null),on=k(null),un=k(null),rn=k(null),an=k(null),ln=k(null),cn=k(null),Lt=k(null),Pn=k(0),re=k("Recommended Films"),qs=k(""),ku=k(""),We=k("film"),zt=k("film"),Oe=k([]),Ln=k(null),zn=k(null),Bn=k(null),Rn=k([]);function is(){function e(T,J="",me=[]){qs.value=J.trim(),ku.value=T;const ye=zs(T,J);let we=Ls(T);const Ee=Bs(T),Re=Rs(T,J),z=js(T,J);z.length>0&&Qn(J)&&(we=we.filter(ut=>!ut.id.startsWith("ext-")));const L=ru(T),se=uu(T),le=du(T);Us.value=[];const ve=L.length>0||se.length>0||le.length>0?L:[],$e=Pt(Pt(ve,se),le),$t=$e.length>0,kt=fu(T,J),Ct=kt.length>0,dt=Ns(T),_t=dt.length>0&&(io(J)||eu(T)),ft=xn(J)||tu(T),pt=lu(T,J),Je=cu(T,J),At=ao(T),nt=At.length>0||Qo(T),st=ou(T),En=we.length>0||ye.length>0||Ee.length>0||Re.length>0||z.length>0||pt.length>0||Je.length>0,Ft=st.length>=1&&(Et(J)||bt(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)||!En&&!$t&&st.length>=2),Mt=Et(J)||bt(T),Vt=Mt&&(me.length>0||$e.length>0||Et(J)),fe=Pt(me,Us.value);if($e.length>0&&Mt){const ut=$e.map(Kt=>Kt.url);oa(ut).then(Kt=>{if(Kt.length===0)return;Us.value=Kt;const Ss=Pt(In.value,Kt);if(In.value=Ss,!Oe.value.includes("news")){const Es=Oe.value.indexOf("prompt");Es>=0?Oe.value=[...Oe.value.slice(0,Es),"news",...Oe.value.slice(Es)]:Oe.value=["news",...Oe.value],zt.value="news"}const Bo=Is(qs.value);re.value=Bo?`${Bo} — ${Ss.length} articles`:`${Ss.length} Articles`})}const ge=nu(J,we.length>0,ye.length>0,Ee.length>0,Re.length>0,z.length>0,pt.length>0,Je.length>0,Vt,$t,Ft,ft,Ct,_t,nt),fs=ge.length>0?[...ge,"prompt"]:["prompt"];Oe.value=fs,zt.value=ge[0]??"prompt";const ps=ge.includes("film"),hs=ge.includes("book"),ms=ge.includes("tvshow"),gs=ge.includes("image"),Le=ge.includes("place"),bs=ge.includes("song"),xs=ge.includes("podcast"),vs=ge.includes("news"),ys=ge.includes("websites"),Ze=ge.includes("magazine"),ws=ge.includes("recipe"),ks=ge.includes("app"),Cs=ge.includes("code"),ht=ps?we:[],je=hs?Re:[],Ne=ms?z:[],N=gs?pt:[],$=Le?Je:[],B=bs?ye:[],ue=xs?Ee:[],ot=vs?fe:[],_s=ys?$e:[],zo=Ze?st:[],Gt=ws?At:[],As=ks?kt:[],Ds=Cs?dt:[];Zt.value=ht,pu.value=je,hu.value=Ne,bu.value=N,xu.value=$,Yt.value=B,Xt.value=ue,In.value=ot,mu.value=_s,vu.value=Gt,yu.value=As,wu.value=Ds,Os.value=zo,gu.value=Ze?wa(T)??me[0]?.imgSrc??null:null,Qt.value=null,en.value=null,tn.value=null,un.value=null,rn.value=null,nn.value=null,sn.value=null,on.value=null,ln.value=null,cn.value=null,an.value=null,Lt.value=null,ht.length>0||je.length>0||Ne.length>0?We.value="film":B.length>0?We.value="song":ue.length>0?We.value="podcast":(ot.length>0,We.value="film");const $n=ge[0];if($n==="place"&&$.length>0)re.value=$.length===1?$[0].name:`${$.length} Places`;else if($n==="tvshow"&&Ne.length>0)re.value=Ne.length===1?Ne[0].title:`${Ne.length} TV Series`;else if($n==="book"&&je.length>0)re.value=je.length===1?je[0].title:`${je.length} Books`;else if($n==="image"&&N.length>0)re.value=`${N.length} Images`;else if(ht.length===1)re.value=ht[0].title;else if(ht.length>1)re.value=`${ht.length} Films`;else if(je.length===1)re.value=je[0].title;else if(je.length>1)re.value=`${je.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(B.length===1)re.value=B[0].title;else if(B.length>1)re.value=`${B.length} Songs`;else if($.length===1)re.value=$[0].name;else if($.length>1)re.value=`${$.length} Places`;else if(ue.length===1)re.value=ue[0].title;else if(ue.length>1)re.value=`${ue.length} Podcasts`;else if(ot.length>0){const ut=Is(J);re.value=ut?`${ut} — ${ot.length} articles`:`${ot.length} Articles`}else if(zo.length>0){const ut=Is(J);re.value=ut?`${ut} — Brief`:"AI Brief"}else Gt.length===1?re.value=Gt[0].title:Gt.length>1?re.value=`${Gt.length} Recipes`:Ds.length>0?re.value=`${Ds.length} Code Blocks`:As.length>0?re.value=`${As.length} Apps`:_s.length>0?re.value=`${_s.length} Websites`:ft?re.value="Nostr":re.value="Content";Ue.value=ge.length>0}function t(T){Oe.value.includes(T)&&(zt.value=T)}function n(T,J,me=[]){let ye=Ls(T);const we=zs(T,J),Ee=Bs(T),Re=Rs(T,J),z=js(T,J);z.length>0&&Qn(J)&&(ye=ye.filter(ge=>!ge.id.startsWith("ext-")));const L=ou(T),se=ru(T),le=uu(T),ne=du(T),ve=me.length>0&&(Et(J)||bt(T)),$e=ve?me:[],kt=se.length>0||le.length>0||ne.length>0?se:[],Ct=Pt(Pt(kt,le),ne),dt=Ct.length>0,_t=fu(T,J),ft=_t.length>0,pt=Ns(T),Je=pt.length>0&&(io(J)||eu(T)),At=xn(J)||tu(T),nt=lu(T,J),st=cu(T,J),Ft=ao(T).length>0||Qo(T),Mt=ye.length>0||we.length>0||Ee.length>0||Re.length>0||z.length>0||nt.length>0||st.length>0,Vt=L.length>=1&&(Et(J)||bt(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)||!Mt&&!dt&&L.length>=2),fe=nu(J,ye.length>0,we.length>0,Ee.length>0,Re.length>0,z.length>0,nt.length>0,st.length>0,ve,dt,Vt,At,ft,Je,Ft);return{films:fe.includes("film")?ye:[],books:fe.includes("book")?Re:[],tvSeries:fe.includes("tvshow")?z:[],images:fe.includes("image")?nt:[],places:fe.includes("place")?st:[],songs:fe.includes("song")?we:[],podcasts:fe.includes("podcast")?Ee:[],newsLinks:fe.includes("news")?$e:[],websitesLinks:fe.includes("websites")?Ct:[],magazineSections:fe.includes("magazine")?L:[],apps:fe.includes("app")?_t:[],codeBlocks:fe.includes("code")?pt:[],hasNostr:At}}function s(){Qt.value=null,en.value=null,tn.value=null,un.value=null,rn.value=null,nn.value=null,sn.value=null,on.value=null,ln.value=null,cn.value=null,an.value=null,Lt.value=null,Ln.value=null,zn.value=null,Bn.value=null,Rn.value=[]}function o(T){s(),Qt.value=T}function u(){Qt.value=null}function r(T){s(),en.value=T}function i(){en.value=null}function a(T){s(),nn.value=T}function l(){nn.value=null}function c(T){s(),sn.value=T}function f(){sn.value=null}function h(T){s(),on.value=T,Ue.value=!0}function b(){on.value=null}function g(T){s(),an.value=T,Ue.value=!0}function x(){an.value=null}function E(T,J){s(),zn.value={content:T,title:J},Ue.value=!0}function C(){zn.value=null}function y(T,J){s(),Bn.value={url:T,title:J},Ue.value=!0}function v(){Bn.value=null}function w(T){s(),Rn.value=T,Ue.value=!0}function M(){Rn.value=[]}function P(T,J){s(),Lt.value=T,Pn.value=J}function U(){Lt.value=null}function oe(T){const J=Os.value;if(!J.length)return;let me=Pn.value;me+=T==="next"?1:-1,me<0&&(me=J.length-1),me>=J.length&&(me=0),Pn.value=me,Lt.value=J[me]}function j(T){s(),tn.value=T}function R(){tn.value=null}function X(T){s(),un.value=T}function Q(){un.value=null}function K(T){s(),rn.value=T}function I(){rn.value=null}function Y(T){s(),ln.value=T}function he(){ln.value=null}function be(T){s(),cn.value=T}function Ke(){cn.value=null}function ee(T){s(),Ln.value=T}function Ae(){Ln.value=null}function ct(){Ue.value=!0,zt.value="design-system",Oe.value=["design-system"],re.value="Design System",s()}function O(){Ue.value=!1,s(),zt.value="film",Oe.value=[]}function W(){Zt.value=[...Ht],Yt.value=[],Xt.value=[],re.value="Your Film Library",We.value="film",Ue.value=!0,s()}function ae(){Zt.value=[],Yt.value=[..._n],Xt.value=[],re.value="Your Song Library",We.value="song",Ue.value=!0,s()}function xe(){Zt.value=[],Yt.value=[],Xt.value=[...us],re.value="Your Podcast Library",We.value="podcast",Ue.value=!0,s()}return{panelOpen:Ue,panelFilms:Zt,panelBooks:pu,panelTVSeries:hu,panelImages:bu,panelPlaces:xu,panelSongs:Yt,panelPodcasts:Xt,panelWebResults:In,panelWebsites:mu,panelRecipes:vu,panelApps:yu,panelCodeBlocks:wu,panelMagazineSections:Os,panelMagazineHeroImage:gu,selectedFilm:Qt,selectedBook:en,selectedTVSeries:tn,selectedImage:un,selectedPlace:rn,selectedSong:nn,selectedPodcast:sn,selectedArticle:on,selectedRecipe:ln,selectedApp:cn,selectedWebsite:an,selectedMagazineSection:Lt,magazineSectionIndex:Pn,panelTitle:re,panelQuery:qs,panelResponseText:ku,contentType:We,activeTab:zt,availableTabs:Oe,setActiveTab:t,extractFilmIds:rs,extractAllFilms:Ls,extractAllBooks:Rs,extractAllTVSeries:js,extractSongIds:_r,extractAllSongs:zs,extractPodcastIds:Ao,extractAllPodcasts:Bs,extractCodeBlocks:Ns,getContextualInlineContent:n,updatePanelFromText:e,stripFilmTags:Dr,stripSongTags:Sr,stripPodcastTags:Er,stripContentTags:Va,stripMarkdownLinks:Ga,openFilmDetail:o,closeFilmDetail:u,openBookDetail:r,closeBookDetail:i,openSongDetail:a,closeSongDetail:l,openPodcastDetail:c,closePodcastDetail:f,openArticleDetail:h,closeArticleDetail:b,openWebsiteDetail:g,closeWebsiteDetail:x,openRecipeDetail:Y,closeRecipeDetail:he,openAppDetail:be,closeAppDetail:Ke,openMagazineSectionDetail:P,closeMagazineSectionDetail:U,navigateMagazineSection:oe,openTVSeriesDetail:j,closeTVSeriesDetail:R,openImageDetail:X,closeImageDetail:Q,openPlaceDetail:K,closePlaceDetail:I,selectedDesignSystemItem:Ln,openDesignSystemItem:ee,closeDesignSystemItem:Ae,longFormArticle:zn,openLongFormArticle:E,closeLongFormArticle:C,pdfUrl:Bn,openPdfViewer:y,closePdfViewer:v,mapPlaces:Rn,openMapView:w,closeMapView:M,enterDesignSystemMode:ct,closePanel:O,showAllFilms:W,showAllSongs:ae,showAllPodcasts:xe}}function Bt(e,t,n){let s=n.initialDeps??[],o,u=!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,x)=>s[x]!==g)))return o;s=f;let b;if(n.key&&((a=n.debug)!=null&&a.call(n))&&(b=Date.now()),o=t(...f),n.key&&((l=n.debug)!=null&&l.call(n))){const g=Math.round((Date.now()-c)*100)/100,x=Math.round((Date.now()-b)*100)/100,E=x/16,C=(y,v)=>{for(y=String(y);y.length<v;)y=" "+y;return y};console.info(`%c⏱ ${C(x,5)} /${C(g,5)} ms`,`
            font-size: .6rem;
            font-weight: bold;
            color: hsl(${Math.max(0,Math.min(120-120*E,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(u&&n.skipInitialOnChange)&&n.onChange(o),u=!1,o}return r.updateDeps=i=>{s=i},r}function Cu(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Qa=(e,t)=>Math.abs(e-t)<1.01,el=(e,t,n)=>{let s;return function(...o){e.clearTimeout(s),s=e.setTimeout(()=>t.apply(this,o),n)}},_u=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},tl=e=>e,nl=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),s=[];for(let o=t;o<=n;o++)s.push(o);return s},sl=(e,t)=>{const n=e.scrollElement;if(!n)return;const s=e.targetWindow;if(!s)return;const o=r=>{const{width:i,height:a}=r;t({width:Math.round(i),height:Math.round(a)})};if(o(_u(n)),!s.ResizeObserver)return()=>{};const u=new s.ResizeObserver(r=>{const i=()=>{const a=r[0];if(a?.borderBoxSize){const l=a.borderBoxSize[0];if(l){o({width:l.inlineSize,height:l.blockSize});return}}o(_u(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()});return u.observe(n,{box:"border-box"}),()=>{u.unobserve(n)}},Au={passive:!0},Du=typeof window>"u"?!0:"onscrollend"in window,ol=(e,t)=>{const n=e.scrollElement;if(!n)return;const s=e.targetWindow;if(!s)return;let o=0;const u=e.options.useScrollendEvent&&Du?()=>{}:el(s,()=>{t(o,!1)},e.options.isScrollingResetDelay),r=c=>()=>{const{horizontal:f,isRtl:h}=e.options;o=f?n.scrollLeft*(h&&-1||1):n.scrollTop,u(),t(o,c)},i=r(!0),a=r(!1);n.addEventListener("scroll",i,Au);const l=e.options.useScrollendEvent&&Du;return l&&n.addEventListener("scrollend",a,Au),()=>{n.removeEventListener("scroll",i),l&&n.removeEventListener("scrollend",a)}},ul=(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"]},rl=(e,{adjustments:t=0,behavior:n},s)=>{var o,u;const r=e+t;(u=(o=s.scrollElement)==null?void 0:o.scrollTo)==null||u.call(o,{[s.options.horizontal?"left":"top"]:r,behavior:n})};class il{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(o=>{o.forEach(u=>{const r=()=>{this._measureElement(u.target,u)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()})}));return{disconnect:()=>{var o;(o=s())==null||o.disconnect(),n=null},observe:o=>{var u;return(u=s())==null?void 0:u.observe(o,{box:"border-box"})},unobserve:o=>{var u;return(u=s())==null?void 0:u.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([s,o])=>{typeof o>"u"&&delete n[s]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:tl,rangeExtractor:nl,onChange:()=>{},measureElement:ul,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,o;(o=(s=this.options).onChange)==null||o.call(s,this,n)},this.maybeNotify=Bt(()=>(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(o=>{this.observer.observe(o)}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,u)=>{this.scrollAdjustments=0,this.scrollDirection=u?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=u,this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.getSize=()=>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 o=new Map,u=new Map;for(let r=s-1;r>=0;r--){const i=n[r];if(o.has(i.lane))continue;const a=u.get(i.lane);if(a==null||i.end>a.end?u.set(i.lane,i):i.end<a.end&&o.set(i.lane,!0),o.size===this.options.lanes)break}return u.size===this.options.lanes?Array.from(u.values()).sort((r,i)=>r.end===i.end?r.index-i.index:r.end-i.end)[0]:void 0},this.getMeasurementOptions=Bt(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,s,o,u,r,i)=>(this.prevLanes!==void 0&&this.prevLanes!==i&&(this.lanesChangedFlag=!0),this.prevLanes=i,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:s,scrollMargin:o,getItemKey:u,enabled:r,lanes:i}),{key:!1}),this.getMeasurements=Bt(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:s,scrollMargin:o,getItemKey:u,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;h<l;h++){const b=c[h];b&&(f[b.lane]=h)}for(let h=l;h<n;h++){const b=u(h),g=this.laneAssignments.get(h);let x,E;if(g!==void 0&&this.options.lanes>1){x=g;const w=f[x],M=w!==void 0?c[w]:void 0;E=M?M.end+this.options.gap:s+o}else{const w=this.options.lanes===1?c[h-1]:this.getFurthestMeasurement(c,h);E=w?w.end+this.options.gap:s+o,x=w?w.lane:h%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(h,x)}const C=a.get(b),y=typeof C=="number"?C:this.options.estimateSize(h),v=E+y;c[h]={index:h,start:E,size:y,end:v,key:b,lane:x},f[x]=h}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Bt(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,s,o,u)=>this.range=n.length>0&&s>0?al({measurements:n,outerSize:s,scrollOffset:o,lanes:u}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Bt(()=>{let n=null,s=null;const o=this.calculateRange();return o&&(n=o.startIndex,s=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,s]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,s]},(n,s,o,u,r)=>u===null||r===null?[]:n({startIndex:u,endIndex:r,overscan:s,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const s=this.options.indexAttribute,o=n.getAttribute(s);return o?parseInt(o,10):(console.warn(`Missing attribute name '${s}={index}' on measured element.`),-1)},this._measureElement=(n,s)=>{const o=this.indexFromElement(n),u=this.measurementsCache[o];if(!u)return;const r=u.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(o,this.options.measureElement(n,s,this))},this.resizeItem=(n,s)=>{const o=this.measurementsCache[n];if(!o)return;const u=this.itemSizeCache.get(o.key)??o.size,r=s-u;r!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,r,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=r,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,s)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((s,o)=>{s.isConnected||(this.observer.unobserve(s),this.elementsCache.delete(o))});return}this._measureElement(n,void 0)},this.getVirtualItems=Bt(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,s)=>{const o=[];for(let u=0,r=n.length;u<r;u++){const i=n[u],a=s[i];o.push(a)}return o},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const s=this.getMeasurements();if(s.length!==0)return Cu(s[Mr(0,s.length-1,o=>Cu(s[o]).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,o=0)=>{if(!this.scrollElement)return 0;const u=this.getSize(),r=this.getScrollOffset();s==="auto"&&(s=n>=r+u?"end":"start"),s==="center"?n+=(o-u)/2:s==="end"&&(n-=u);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 o=this.measurementsCache[n];if(!o)return;const u=this.getSize(),r=this.getScrollOffset();if(s==="auto")if(o.end>=r+u-this.options.scrollPaddingEnd)s="end";else if(o.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"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(i,s,o.size),s]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:s="start",behavior:o}={})=>{o==="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:o})},this.scrollToIndex=(n,{align:s="auto",behavior:o}={})=>{o==="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 u=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:o}),this.targetWindow.requestAnimationFrame(()=>{if(!this.targetWindow)return;const b=()=>{if(this.currentScrollToIndex!==n)return;const g=this.getScrollOffset(),x=this.getOffsetForIndex(n,h);if(!x){console.warn("Failed to get offset for index:",n);return}Qa(x[0],g)||a(h)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(b):b()})},a=l=>{this.targetWindow&&this.currentScrollToIndex===n&&(u++,u<r?this.targetWindow.requestAnimationFrame(()=>i(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 o;if(s.length===0)o=this.options.paddingStart;else if(this.options.lanes===1)o=((n=s[s.length-1])==null?void 0:n.end)??0;else{const u=Array(this.options.lanes).fill(null);let r=s.length-1;for(;r>=0&&u.some(i=>i===null);){const i=s[r];u[i.lane]===null&&(u[i.lane]=i.end),r--}o=Math.max(...u.filter(i=>i!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:s,behavior:o})=>{this.options.scrollToFn(n,{behavior:o,adjustments:s},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}}const Mr=(e,t,n,s)=>{for(;e<=t;){const o=(e+t)/2|0,u=n(o);if(u<s)e=o+1;else if(u>s)t=o-1;else return o}return e>0?e-1:0};function al({measurements:e,outerSize:t,scrollOffset:n,lanes:s}){const o=e.length-1,u=a=>e[a].start;if(e.length<=s)return{startIndex:0,endIndex:o};let r=Mr(0,o,u,n),i=r;if(s===1)for(;i<o&&e[i].end<n+t;)i++;else if(s>1){const a=Array(s).fill(0);for(;i<o&&a.some(c=>c<n+t);){const c=e[i];a[c.lane]=c.end,i++}const l=Array(s).fill(n+t);for(;r>=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(o,i+(s-1-i%s))}return{startIndex:r,endIndex:i}}function ll(e){const t=new il(S(e)),n=mo(t),s=t._didMount();return Ce(()=>S(e).getScrollElement(),o=>{o&&t._willUpdate()},{immediate:!0}),Ce(()=>S(e),o=>{t.setOptions({...o,onChange:(u,r)=>{var i;jo(n),(i=o.onChange)==null||i.call(o,u,r)}}),t._willUpdate(),jo(n)},{immediate:!0}),hi(s),n}function cl(e){return ll(A(()=>({observeElementRect:sl,observeElementOffset:ol,scrollToFn:rl,...S(e)})))}const jn=k(!1),Nn=k({provider:"claude",model:"claude-haiku-4.5"}),Un=k({provider:"openrouter",model:"meta-llama/llama-4-maverick"}),Hs=k(""),Ws=k(""),dn=k(!1),fn=k(!1),Vs=k(null),Gs=k(null);let Rt=null;function Do(){const e=A(()=>jn.value),t=A(()=>dn.value||fn.value);function n(){jn.value=!jn.value}function s(i,a,l){const c=i===1?Nn:Un;c.value={provider:a,model:l}}function o(){Hs.value="",Ws.value="",Vs.value=null,Gs.value=null}function u(){Rt&&(Rt.abort(),Rt=null),dn.value=!1,fn.value=!1}async function r(i,a){o(),Rt=new AbortController;const l=Rt.signal;dn.value=!0,fn.value=!0;const c=i(Nn.value.provider,Nn.value.model,a,h=>{Hs.value+=h},h=>{Vs.value=h},l).finally(()=>{dn.value=!1}),f=i(Un.value.provider,Un.value.model,a,h=>{Ws.value+=h},h=>{Gs.value=h},l).finally(()=>{fn.value=!1});await Promise.allSettled([c,f]),Rt=null}return{comparisonEnabled:jn,isComparing:e,isAnyStreaming:t,model1:Nn,model2:Un,response1:Hs,response2:Ws,isStreaming1:dn,isStreaming2:fn,error1:Vs,error2:Gs,toggleComparison:n,setModel:s,clearResponses:o,stopComparison:u,streamBothModels:r}}function lo(e){return new Date(e).toLocaleString()}function dl(e){const t=[`# ${e.title}
`,`_Exported ${lo(Date.now())}_
`];for(const n of e.messages){const s=n.role==="user"?"**You**":"**Assistant**",o=lo(n.timestamp);t.push(`### ${s} — ${o}
`),t.push(n.content+`
`)}return t.join(`
`)}function fl(e){return JSON.stringify(e,null,2)}function pl(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}] ${lo(n.timestamp)}`),t.push(n.content),t.push("")}return t.join(`
`)}function Su(e){switch(e){case"markdown":return".md";case"json":return".json";case"text":return".txt"}}function Eu(e){switch(e){case"markdown":return"text/markdown";case"json":return"application/json";case"text":return"text/plain"}}async function hl(e,t){let n;switch(t){case"markdown":n=dl(e);break;case"json":n=fl(e);break;case"text":n=pl(e);break}const s=`${e.title.replace(/[^a-zA-Z0-9 ]/g,"").trim().replace(/\s+/g,"-").toLowerCase()}${Su(t)}`,o=new Blob([n],{type:Eu(t)});if("showSaveFilePicker"in window)try{const a=await(await window.showSaveFilePicker({suggestedName:s,types:[{description:t==="markdown"?"Markdown":t==="json"?"JSON":"Text",accept:{[Eu(t)]:[Su(t)]}}]})).createWritable();await a.write(o),await a.close();return}catch{}const u=URL.createObjectURL(o),r=document.createElement("a");r.href=u,r.download=s,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(u)}function $u(){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 Fu(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 ml(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 o=[];for(const u of s.chat_messages){if(!u||typeof u!="object")continue;const r=u.sender==="human"?"user":"assistant",i=typeof u.text=="string"?u.text:"";o.push({id:$u(),role:r,content:i,timestamp:typeof u.created_at=="string"?new Date(u.created_at).getTime():Date.now()})}t.push({id:$u(),title:s.name,messages:o,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 gl(e){try{const t=JSON.parse(e),n=Fu(t);if(n)return{conversations:[n],format:"aiui"};const s=ml(t);if(s.length>0)return{conversations:s,format:"claude"};if(Array.isArray(t)){const o=[];for(const u of t){const r=Fu(u);r&&o.push(r)}if(o.length>0)return{conversations:o,format:"aiui"}}return{conversations:[],format:"unknown",error:"Unrecognized format"}}catch{return{conversations:[],format:"unknown",error:"Invalid JSON"}}}const bl={class:"flex items-center justify-between gap-2"},xl=["title"],vl={class:"flex items-center gap-2 shrink-0"},yl=["title"],wl=["title"],kl={key:0,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Cl={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},_l=["title"],Al={class:"w-full text-left pt-3 pb-1 min-w-0"},Dl={class:"text-sm font-semibold truncate text-white/96"},Sl={class:"flex items-center gap-1.5 mt-0.5"},El={class:"text-xs truncate font-mono text-white/40"},$l={class:"text-xs truncate text-white/50"},Fl={class:"text-xs font-semibold uppercase tracking-wider mb-1.5 px-1 text-white/40"},Ml={class:"space-y-0.5"},Tl=["onClick"],Il={class:"flex-1"},Pl={class:"flex gap-0.5 shrink-0"},Ll={key:0,class:"text-xs opacity-60",title:"Supports vision input"},zl={key:1,class:"text-xs opacity-60",title:"Supports tool use"},Bl={key:2,class:"text-xs opacity-60",title:"Long context window"},Rl=te({__name:"ChatHeader",props:{title:{},conversationId:{},side:{},showClose:{type:Boolean}},emits:["switchSide","newChat","close","openSettings"],setup(e){const{activeProvider:t,activeModel:n,availableProviders:s,setProvider:o,setModel:u}=hr(),r=Do(),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),x=k(null),E=k({});function C(){Fe(()=>{const K=x.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(){Fe(()=>{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&&C()}),Ce(f,K=>{K&&y()});const v=A(()=>{for(const K of s.value){const I=K.models.find(Y=>Y.id===n.value);if(I)return I.name}return n.value});function w(K,I){o(K),u(I),c.value=!1}const{enterDesignSystemMode:M}=is();function P(){M(),c.value=!1}async function U(K){const I=l.activeConversation;I&&(await hl(I,K),f.value=!1)}function oe(){const K=l.activeConversationId;K&&(l.deleteConversation(K),f.value=!1)}const j=k(null),R=k(null);function X(){f.value=!1,j.value?.click()}async function Q(K){const I=K.target,Y=I.files?.[0];if(Y){try{const he=await Y.text(),be=gl(he);if(be.error||be.conversations.length===0)R.value=`Error: ${be.error??"No conversations found"}`;else{for(const ee of be.conversations)l.conversations.set(ee.id,ee);const Ke=be.conversations.length;R.value=`Imported ${Ke} conversation${Ke>1?"s":""} (${be.format})`,l.setActiveConversation(be.conversations[0].id)}}catch{R.value="Error: Failed to read file"}I.value="",setTimeout(()=>{R.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",bl,[d("button",{ref_key:"modelPickerTriggerRef",ref:x,class:"touch-target rounded-xl path-glass-icon shrink-0 transition-colors cursor-pointer text-[#fafafa] hover:text-white",title:`AI model: ${v.value}`,"aria-label":"Select AI model",onClick:I[0]||(I[0]=Y=>c.value=!c.value)},[...I[15]||(I[15]=[d("span",{class:"text-base"},"✦",-1)])],8,xl),d("div",vl,[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]=Y=>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,yl),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]=Y=>S(l).toggleChatCollapse())},[S(l).chatCollapsed?(p(),m("svg",Cl,[...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",kl,[...I[17]||(I[17]=[d("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h10M4 18h16"},null,-1)])]))],10,wl),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]=Y=>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,_l),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]=Y=>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]=Y=>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]=Y=>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]=Y=>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",Al,[d("h2",Dl,_(e.title),1),d("div",Sl,[d("p",El,_(e.conversationId),1),I[24]||(I[24]=d("span",{class:"text-xs text-white/20"},"·",-1)),d("span",$l,_(v.value),1)])]),(p(),ie(bn,{to:"body"},[c.value?(p(),m("div",{key:0,class:"fixed inset-0 z-[9998]","aria-hidden":"true",onClick:I[8]||(I[8]=Y=>c.value=!1)})):D("",!0),pe(Zn,{name:"picker"},{default:qe(()=>[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,Z(S(s),Y=>(p(),m("div",{key:Y.id},[d("p",Fl,_(Y.name),1),d("div",Ml,[(p(!0),m(q,null,Z(Y.models,he=>(p(),m("button",{key:he.id,class:F(["w-full text-left px-3 py-2 rounded-lg text-xs transition-all duration-200 flex items-center gap-2",he.id===S(n)&&Y.id===S(t)?"nav-tab-active":"text-white/60 hover:text-white hover:bg-white/10"]),onClick:be=>w(Y.id,he.id)},[d("span",Il,_(he.name),1),d("span",Pl,[a(he.id).vision?(p(),m("span",Ll,"👁")):D("",!0),a(he.id).tools?(p(),m("span",zl,"🔧")):D("",!0),a(he.id).longContext?(p(),m("span",Bl,"📄")):D("",!0)])],10,Tl))),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(bn,{to:"body"},[f.value?(p(),m("div",{key:0,class:"fixed inset-0 z-[9998]","aria-hidden":"true",onClick:I[10]||(I[10]=Y=>f.value=!1)})):D("",!0),pe(Zn,{name:"picker"},{default:qe(()=>[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]=Y=>U("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]=Y=>U("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]=Y=>U("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:X}," 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:oe}," Delete conversation ")])],4)):D("",!0)]),_:1})])),d("input",{ref_key:"importInputRef",ref:j,type:"file",accept:".json",class:"hidden",onChange:Q},null,544),R.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",R.value.startsWith("Error")?"text-red-400":"text-accent"])},_(R.value),3)):D("",!0)],512))}}),jl=os(Rl,[["__scopeId","data-v-2abf766d"]]),Mu={};function Nl(e){let t=Mu[e];if(t)return t;t=Mu[e]=[];for(let n=0;n<128;n++){const s=String.fromCharCode(n);t.push(s)}for(let n=0;n<e.length;n++){const s=e.charCodeAt(n);t[s]="%"+("0"+s.toString(16).toUpperCase()).slice(-2)}return t}function Ot(e,t){typeof t!="string"&&(t=Ot.defaultChars);const n=Nl(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(s){let o="";for(let u=0,r=s.length;u<r;u+=3){const i=parseInt(s.slice(u+1,u+3),16);if(i<128){o+=n[i];continue}if((i&224)===192&&u+3<r){const a=parseInt(s.slice(u+4,u+6),16);if((a&192)===128){const l=i<<6&1984|a&63;l<128?o+="��":o+=String.fromCharCode(l),u+=3;continue}}if((i&240)===224&&u+6<r){const a=parseInt(s.slice(u+4,u+6),16),l=parseInt(s.slice(u+7,u+9),16);if((a&192)===128&&(l&192)===128){const c=i<<12&61440|a<<6&4032|l&63;c<2048||c>=55296&&c<=57343?o+="���":o+=String.fromCharCode(c),u+=6;continue}}if((i&248)===240&&u+9<r){const a=parseInt(s.slice(u+4,u+6),16),l=parseInt(s.slice(u+7,u+9),16),c=parseInt(s.slice(u+10,u+12),16);if((a&192)===128&&(l&192)===128&&(c&192)===128){let f=i<<18&1835008|a<<12&258048|l<<6&4032|c&63;f<65536||f>1114111?o+="����":(f-=65536,o+=String.fromCharCode(55296+(f>>10),56320+(f&1023))),u+=9;continue}}o+="�"}return o})}Ot.defaultChars=";/?:@&=+$,#";Ot.componentChars="";const Tu={};function Ul(e){let t=Tu[e];if(t)return t;t=Tu[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<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function An(e,t,n){typeof t!="string"&&(n=t,t=An.defaultChars),typeof n>"u"&&(n=!0);const s=Ul(t);let o="";for(let u=0,r=e.length;u<r;u++){const i=e.charCodeAt(u);if(n&&i===37&&u+2<r&&/^[0-9a-f]{2}$/i.test(e.slice(u+1,u+3))){o+=e.slice(u,u+3),u+=2;continue}if(i<128){o+=s[i];continue}if(i>=55296&&i<=57343){if(i>=55296&&i<=56319&&u+1<r){const a=e.charCodeAt(u+1);if(a>=56320&&a<=57343){o+=encodeURIComponent(e[u]+e[u+1]),u++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(e[u])}return o}An.defaultChars=";/?:@&=+$,-_.!~*'()#";An.componentChars="-_.!~*'()";function So(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 ts(){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 Ol=/^([a-z0-9.+-]+:)/i,ql=/:[0-9]*$/,Hl=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Wl=["<",">",'"',"`"," ","\r",`
`,"	"],Vl=["{","}","|","\\","^","`"].concat(Wl),Gl=["'"].concat(Vl),Iu=["%","/","?",";","#"].concat(Gl),Pu=["/","?","#"],Kl=255,Lu=/^[+a-z0-9A-Z_-]{0,63}$/,Jl=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,zu={javascript:!0,"javascript:":!0},Bu={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Eo(e,t){if(e&&e instanceof ts)return e;const n=new ts;return n.parse(e,t),n}ts.prototype.parse=function(e,t){let n,s,o,u=e;if(u=u.trim(),!t&&e.split("#").length===1){const l=Hl.exec(u);if(l)return this.pathname=l[1],l[2]&&(this.search=l[2]),this}let r=Ol.exec(u);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,u=u.substr(r.length)),(t||r||u.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=u.substr(0,2)==="//",o&&!(r&&zu[r])&&(u=u.substr(2),this.slashes=!0)),!zu[r]&&(o||r&&!Bu[r])){let l=-1;for(let g=0;g<Pu.length;g++)s=u.indexOf(Pu[g]),s!==-1&&(l===-1||s<l)&&(l=s);let c,f;l===-1?f=u.lastIndexOf("@"):f=u.lastIndexOf("@",l),f!==-1&&(c=u.slice(0,f),u=u.slice(f+1),this.auth=c),l=-1;for(let g=0;g<Iu.length;g++)s=u.indexOf(Iu[g]),s!==-1&&(l===-1||s<l)&&(l=s);l===-1&&(l=u.length),u[l-1]===":"&&l--;const h=u.slice(0,l);u=u.slice(l),this.parseHost(h),this.hostname=this.hostname||"";const b=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!b){const g=this.hostname.split(/\./);for(let x=0,E=g.length;x<E;x++){const C=g[x];if(C&&!C.match(Lu)){let y="";for(let v=0,w=C.length;v<w;v++)C.charCodeAt(v)>127?y+="x":y+=C[v];if(!y.match(Lu)){const v=g.slice(0,x),w=g.slice(x+1),M=C.match(Jl);M&&(v.push(M[1]),w.unshift(M[2])),w.length&&(u=w.join(".")+u),this.hostname=v.join(".");break}}}}this.hostname.length>Kl&&(this.hostname=""),b&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const i=u.indexOf("#");i!==-1&&(this.hash=u.substr(i),u=u.slice(0,i));const a=u.indexOf("?");return a!==-1&&(this.search=u.substr(a),u=u.slice(0,a)),u&&(this.pathname=u),Bu[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};ts.prototype.parseHost=function(e){let t=ql.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 Zl=Object.freeze(Object.defineProperty({__proto__:null,decode:Ot,encode:An,format:So,parse:Eo},Symbol.toStringTag,{value:"Module"})),Tr=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Ir=/[\0-\x1F\x7F-\x9F]/,Yl=/[\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]/,$o=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,Pr=/[\$\+<->\^`\|~\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]/,Lr=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,Xl=Object.freeze(Object.defineProperty({__proto__:null,Any:Tr,Cc:Ir,Cf:Yl,P:$o,S:Pr,Z:Lr},Symbol.toStringTag,{value:"Module"})),Ql=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ȀDMPTǇǋǑǖ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;扐blè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;戥ǹ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ቻ኉ǲኀ\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;䅻ǲᕔ\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ƀ;oș᳊᳔ndĀ;ș᳑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;ẝẤĳạả;怄;怅怃Ā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;耀ﬃɩᾹ\0\0᾽g;耀ﬀig;耀ﬄ;쀀𝔣lig;耀ﬁlig;쀀fjƀaltῙ῜ῡt;晭ig;耀ﬂns;斱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⧓ସǳ⧟\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᪠ⵒⵗǈⵚ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㚆㚝㚵㚼ǲ㚋\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))),ec=new Uint16Array("Ȁaglq	\x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0)));var Ks;const tc=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]]),nc=(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 sc(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=tc.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 oc=32;var xt;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(xt||(xt={}));function co(e){return e>=_e.ZERO&&e<=_e.NINE}function uc(e){return e>=_e.UPPER_A&&e<=_e.UPPER_F||e>=_e.LOWER_A&&e<=_e.LOWER_F}function rc(e){return e>=_e.UPPER_A&&e<=_e.UPPER_Z||e>=_e.LOWER_A&&e<=_e.LOWER_Z||co(e)}function ic(e){return e===_e.EQUALS||rc(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 gt;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(gt||(gt={}));class ac{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=gt.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)|oc)===_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,o){if(n!==s){const u=s-n;this.result=this.result*Math.pow(o,u)+parseInt(t.substr(n,u),o),this.consumed+=u}}stateNumericHex(t,n){const s=n;for(;n<t.length;){const o=t.charCodeAt(n);if(co(o)||uc(o))n+=1;else return this.addToNumericResult(t,s,n,16),this.emitNumericEntity(o,3)}return this.addToNumericResult(t,s,n,16),-1}stateNumericDecimal(t,n){const s=n;for(;n<t.length;){const o=t.charCodeAt(n);if(co(o))n+=1;else return this.addToNumericResult(t,s,n,10),this.emitNumericEntity(o,2)}return this.addToNumericResult(t,s,n,10),-1}emitNumericEntity(t,n){var s;if(this.consumed<=n)return(s=this.errors)===null||s===void 0||s.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===_e.SEMI)this.consumed+=1;else if(this.decodeMode===gt.Strict)return 0;return this.emitCodePoint(sc(this.result),this.consumed),this.errors&&(t!==_e.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:s}=this;let o=s[this.treeIndex],u=(o&xt.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const r=t.charCodeAt(n);if(this.treeIndex=lc(s,o,this.treeIndex+Math.max(1,u),r),this.treeIndex<0)return this.result===0||this.decodeMode===gt.Attribute&&(u===0||ic(r))?0:this.emitNotTerminatedNamedEntity();if(o=s[this.treeIndex],u=(o&xt.VALUE_LENGTH)>>14,u!==0){if(r===_e.SEMI)return this.emitNamedEntityData(this.treeIndex,u,this.consumed+this.excess);this.decodeMode!==gt.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:s}=this,o=(s[n]&xt.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,o,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,s){const{decodeTree:o}=this;return this.emitCodePoint(n===1?o[t]&~xt.VALUE_LENGTH:o[t+1],s),n===3&&this.emitCodePoint(o[t+2],s),s}end(){var t;switch(this.state){case ke.NamedEntity:return this.result!==0&&(this.decodeMode!==gt.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 zr(e){let t="";const n=new ac(e,s=>t+=nc(s));return function(o,u){let r=0,i=0;for(;(i=o.indexOf("&",i))>=0;){t+=o.slice(r,i),n.startEntity(u);const l=n.write(o,i+1);if(l<0){r=i+n.end();break}r=i+l,i=l===0?r+1:r}const a=t+o.slice(r);return t="",a}}function lc(e,t,n,s){const o=(t&xt.BRANCH_LENGTH)>>7,u=t&xt.JUMP_TABLE;if(o===0)return u!==0&&s===u?n:-1;if(u){const a=s-u;return a<0||a>=o?-1:e[n+a]-1}let r=n,i=r+o-1;for(;r<=i;){const a=r+i>>>1,l=e[a];if(l<s)r=a+1;else if(l>s)i=a-1;else return e[a+o]}return-1}const cc=zr(Ql);zr(ec);function Br(e,t=gt.Legacy){return cc(e,t)}function dc(e){return Object.prototype.toString.call(e)}function Fo(e){return dc(e)==="[object String]"}const fc=Object.prototype.hasOwnProperty;function pc(e,t){return fc.call(e,t)}function as(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 Rr(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function Mo(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 ns(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 jr=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,hc=/&([a-z#][a-z0-9]{1,31});/gi,mc=new RegExp(jr.source+"|"+hc.source,"gi"),gc=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function bc(e,t){if(t.charCodeAt(0)===35&&gc.test(t)){const s=t[1].toLowerCase()==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return Mo(s)?ns(s):e}const n=Br(e);return n!==e?n:e}function xc(e){return e.indexOf("\\")<0?e:e.replace(jr,"$1")}function qt(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(mc,function(t,n,s){return n||bc(t,s)})}const vc=/[&<>"]/,yc=/[&<>"]/g,wc={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function kc(e){return wc[e]}function vt(e){return vc.test(e)?e.replace(yc,kc):e}const Cc=/[.?*+^$[\]\\(){}|-]/g;function _c(e){return e.replace(Cc,"\\$&")}function de(e){switch(e){case 9:case 32:return!0}return!1}function vn(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 yn(e){return $o.test(e)||Pr.test(e)}function wn(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 ls(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}const Ac={mdurl:Zl,ucmicro:Xl},Dc=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:Rr,assign:as,escapeHtml:vt,escapeRE:_c,fromCodePoint:ns,has:pc,isMdAsciiPunct:wn,isPunctChar:yn,isSpace:de,isString:Fo,isValidEntityCode:Mo,isWhiteSpace:vn,lib:Ac,normalizeReference:ls,unescapeAll:qt,unescapeMd:xc},Symbol.toStringTag,{value:"Module"}));function Sc(e,t,n){let s,o,u,r;const i=e.posMax,a=e.pos;for(e.pos=t+1,s=1;e.pos<i;){if(u=e.src.charCodeAt(e.pos),u===93&&(s--,s===0)){o=!0;break}if(r=e.pos,e.md.inline.skipToken(e),u===91){if(r===e.pos-1)s++;else if(n)return e.pos=a,-1}}let l=-1;return o&&(l=e.pos),e.pos=a,l}function Ec(e,t,n){let s,o=t;const u={ok:!1,pos:0,str:""};if(e.charCodeAt(o)===60){for(o++;o<n;){if(s=e.charCodeAt(o),s===10||s===60)return u;if(s===62)return u.pos=o+1,u.str=qt(e.slice(t+1,o)),u.ok=!0,u;if(s===92&&o+1<n){o+=2;continue}o++}return u}let r=0;for(;o<n&&(s=e.charCodeAt(o),!(s===32||s<32||s===127));){if(s===92&&o+1<n){if(e.charCodeAt(o+1)===32)break;o+=2;continue}if(s===40&&(r++,r>32))return u;if(s===41){if(r===0)break;r--}o++}return t===o||r!==0||(u.str=qt(e.slice(t,o)),u.pos=o,u.ok=!0),u}function $c(e,t,n,s){let o,u=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(u>=n)return r;let i=e.charCodeAt(u);if(i!==34&&i!==39&&i!==40)return r;t++,u++,i===40&&(i=41),r.marker=i}for(;u<n;){if(o=e.charCodeAt(u),o===r.marker)return r.pos=u+1,r.str+=qt(e.slice(t,u)),r.ok=!0,r;if(o===40&&r.marker===41)return r;o===92&&u+1<n&&u++,u++}return r.can_continue=!0,r.str+=qt(e.slice(t,u)),r}const Fc=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:Ec,parseLinkLabel:Sc,parseLinkTitle:$c},Symbol.toStringTag,{value:"Module"})),et={};et.code_inline=function(e,t,n,s,o){const u=e[t];return"<code"+o.renderAttrs(u)+">"+vt(u.content)+"</code>"};et.code_block=function(e,t,n,s,o){const u=e[t];return"<pre"+o.renderAttrs(u)+"><code>"+vt(e[t].content)+`</code></pre>
`};et.fence=function(e,t,n,s,o){const u=e[t],r=u.info?qt(u.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(u.content,i,a)||vt(u.content):l=vt(u.content),l.indexOf("<pre")===0)return l+`
`;if(r){const c=u.attrIndex("class"),f=u.attrs?u.attrs.slice():[];c<0?f.push(["class",n.langPrefix+i]):(f[c]=f[c].slice(),f[c][1]+=" "+n.langPrefix+i);const h={attrs:f};return`<pre><code${o.renderAttrs(h)}>${l}</code></pre>
`}return`<pre><code${o.renderAttrs(u)}>${l}</code></pre>
`};et.image=function(e,t,n,s,o){const u=e[t];return u.attrs[u.attrIndex("alt")][1]=o.renderInlineAsText(u.children,n,s),o.renderToken(e,t,n)};et.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
`:`<br>
`};et.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`<br />
`:`<br>
`:`
`};et.text=function(e,t){return vt(e[t].content)};et.html_block=function(e,t){return e[t].content};et.html_inline=function(e,t){return e[t].content};function Wt(){this.rules=as({},et)}Wt.prototype.renderAttrs=function(t){let n,s,o;if(!t.attrs)return"";for(o="",n=0,s=t.attrs.length;n<s;n++)o+=" "+vt(t.attrs[n][0])+'="'+vt(t.attrs[n][1])+'"';return o};Wt.prototype.renderToken=function(t,n,s){const o=t[n];let u="";if(o.hidden)return"";o.block&&o.nesting!==-1&&n&&t[n-1].hidden&&(u+=`
`),u+=(o.nesting===-1?"</":"<")+o.tag,u+=this.renderAttrs(o),o.nesting===0&&s.xhtmlOut&&(u+=" /");let r=!1;if(o.block&&(r=!0,o.nesting===1&&n+1<t.length)){const i=t[n+1];(i.type==="inline"||i.hidden||i.nesting===-1&&i.tag===o.tag)&&(r=!1)}return u+=r?`>
`:">",u};Wt.prototype.renderInline=function(e,t,n){let s="";const o=this.rules;for(let u=0,r=e.length;u<r;u++){const i=e[u].type;typeof o[i]<"u"?s+=o[i](e,u,t,n,this):s+=this.renderToken(e,u,t)}return s};Wt.prototype.renderInlineAsText=function(e,t,n){let s="";for(let o=0,u=e.length;o<u;o++)switch(e[o].type){case"text":s+=e[o].content;break;case"image":s+=this.renderInlineAsText(e[o].children,t,n);break;case"html_inline":case"html_block":s+=e[o].content;break;case"softbreak":case"hardbreak":s+=`
`;break}return s};Wt.prototype.render=function(e,t,n){let s="";const o=this.rules;for(let u=0,r=e.length;u<r;u++){const i=e[u].type;i==="inline"?s+=this.renderInline(e[u].children,t,n):typeof o[i]<"u"?s+=o[i](e,u,t,n,this):s+=this.renderToken(e,u,t,n)}return s};function Ie(){this.__rules__=[],this.__cache__=null}Ie.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1};Ie.prototype.__compile__=function(){const e=this,t=[""];e.__rules__.forEach(function(n){n.enabled&&n.alt.forEach(function(s){t.indexOf(s)<0&&t.push(s)})}),e.__cache__={},t.forEach(function(n){e.__cache__[n]=[],e.__rules__.forEach(function(s){s.enabled&&(n&&s.alt.indexOf(n)<0||e.__cache__[n].push(s.fn))})})};Ie.prototype.at=function(e,t,n){const s=this.__find__(e),o=n||{};if(s===-1)throw new Error("Parser rule not found: "+e);this.__rules__[s].fn=t,this.__rules__[s].alt=o.alt||[],this.__cache__=null};Ie.prototype.before=function(e,t,n,s){const o=this.__find__(e),u=s||{};if(o===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(o,0,{name:t,enabled:!0,fn:n,alt:u.alt||[]}),this.__cache__=null};Ie.prototype.after=function(e,t,n,s){const o=this.__find__(e),u=s||{};if(o===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:u.alt||[]}),this.__cache__=null};Ie.prototype.push=function(e,t,n){const s=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:s.alt||[]}),this.__cache__=null};Ie.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(s){const o=this.__find__(s);if(o<0){if(t)return;throw new Error("Rules manager: invalid rule name "+s)}this.__rules__[o].enabled=!0,n.push(s)},this),this.__cache__=null,n};Ie.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(e,t)};Ie.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(s){const o=this.__find__(s);if(o<0){if(t)return;throw new Error("Rules manager: invalid rule name "+s)}this.__rules__[o].enabled=!1,n.push(s)},this),this.__cache__=null,n};Ie.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function Ge(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}Ge.prototype.attrIndex=function(t){if(!this.attrs)return-1;const n=this.attrs;for(let s=0,o=n.length;s<o;s++)if(n[s][0]===t)return s;return-1};Ge.prototype.attrPush=function(t){this.attrs?this.attrs.push(t):this.attrs=[t]};Ge.prototype.attrSet=function(t,n){const s=this.attrIndex(t),o=[t,n];s<0?this.attrPush(o):this.attrs[s]=o};Ge.prototype.attrGet=function(t){const n=this.attrIndex(t);let s=null;return n>=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 Nr(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}Nr.prototype.Token=Ge;const Mc=/\r\n?|\n/g,Tc=/\0/g;function Ic(e){let t;t=e.src.replace(Mc,`
`),t=t.replace(Tc,"�"),e.src=t}function Pc(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 Lc(e){const t=e.tokens;for(let n=0,s=t.length;n<s;n++){const o=t[n];o.type==="inline"&&e.md.inline.parse(o.content,e.md,e.env,o.children)}}function zc(e){return/^<a[>\s]/i.test(e)}function Bc(e){return/^<\/a\s*>/i.test(e)}function Rc(e){const t=e.tokens;if(e.md.options.linkify)for(let n=0,s=t.length;n<s;n++){if(t[n].type!=="inline"||!e.md.linkify.pretest(t[n].content))continue;let o=t[n].children,u=0;for(let r=o.length-1;r>=0;r--){const i=o[r];if(i.type==="link_close"){for(r--;o[r].level!==i.level&&o[r].type!=="link_open";)r--;continue}if(i.type==="html_inline"&&(zc(i.content)&&u>0&&u--,Bc(i.content)&&u++),!(u>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&&o[r-1].type==="text_special"&&(l=l.slice(1));for(let b=0;b<l.length;b++){const g=l[b].url,x=e.md.normalizeLink(g);if(!e.md.validateLink(x))continue;let E=l[b].text;l[b].schema?l[b].schema==="mailto:"&&!/^mailto:/i.test(E)?E=e.md.normalizeLinkText("mailto:"+E).replace(/^mailto:/,""):E=e.md.normalizeLinkText(E):E=e.md.normalizeLinkText("http://"+E).replace(/^http:\/\//,"");const C=l[b].index;if(C>h){const M=new e.Token("text","",0);M.content=a.slice(h,C),M.level=f,c.push(M)}const y=new e.Token("link_open","a",1);y.attrs=[["href",x]],y.level=f++,y.markup="linkify",y.info="auto",c.push(y);const v=new e.Token("text","",0);v.content=E,v.level=f,c.push(v);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<a.length){const b=new e.Token("text","",0);b.content=a.slice(h),b.level=f,c.push(b)}t[n].children=o=Rr(o,r,c)}}}}const Ur=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,jc=/\((c|tm|r)\)/i,Nc=/\((c|tm|r)\)/ig,Uc={c:"©",r:"®",tm:"™"};function Oc(e,t){return Uc[t.toLowerCase()]}function qc(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.type==="text"&&!t&&(s.content=s.content.replace(Nc,Oc)),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function Hc(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.type==="text"&&!t&&Ur.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 Wc(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(jc.test(e.tokens[t].content)&&qc(e.tokens[t].children),Ur.test(e.tokens[t].content)&&Hc(e.tokens[t].children))}const Vc=/['"]/,Ru=/['"]/g,ju="’";function On(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function Gc(e,t){let n;const s=[];for(let o=0;o<e.length;o++){const u=e[o],r=e[o].level;for(n=s.length-1;n>=0&&!(s[n].level<=r);n--);if(s.length=n+1,u.type!=="text")continue;let i=u.content,a=0,l=i.length;e:for(;a<l;){Ru.lastIndex=a;const c=Ru.exec(i);if(!c)break;let f=!0,h=!0;a=c.index+1;const b=c[0]==="'";let g=32;if(c.index-1>=0)g=i.charCodeAt(c.index-1);else for(n=o-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 x=32;if(a<l)x=i.charCodeAt(a);else for(n=o+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){x=e[n].content.charCodeAt(0);break}const E=wn(g)||yn(String.fromCharCode(g)),C=wn(x)||yn(String.fromCharCode(x)),y=vn(g),v=vn(x);if(v?f=!1:C&&(y||E||(f=!1)),y?h=!1:E&&(v||C||(h=!1)),x===34&&c[0]==='"'&&g>=48&&g<=57&&(h=f=!1),f&&h&&(f=E,h=C),!f&&!h){b&&(u.content=On(u.content,c.index,ju));continue}if(h)for(n=s.length-1;n>=0;n--){let w=s[n];if(s[n].level<r)break;if(w.single===b&&s[n].level===r){w=s[n];let M,P;b?(M=t.md.options.quotes[2],P=t.md.options.quotes[3]):(M=t.md.options.quotes[0],P=t.md.options.quotes[1]),u.content=On(u.content,c.index,P),e[w.token].content=On(e[w.token].content,w.pos,M),a+=P.length-1,w.token===o&&(a+=M.length-1),i=u.content,l=i.length,s.length=n;continue e}}f?s.push({token:o,pos:c.index,single:b,level:r}):h&&b&&(u.content=On(u.content,c.index,ju))}}}function Kc(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!=="inline"||!Vc.test(e.tokens[t].content)||Gc(e.tokens[t].children,e)}function Jc(e){let t,n;const s=e.tokens,o=s.length;for(let u=0;u<o;u++){if(s[u].type!=="inline")continue;const r=s[u].children,i=r.length;for(t=0;t<i;t++)r[t].type==="text_special"&&(r[t].type="text");for(t=n=0;t<i;t++)r[t].type==="text"&&t+1<i&&r[t+1].type==="text"?r[t+1].content=r[t].content+r[t+1].content:(t!==n&&(r[n]=r[t]),n++);t!==n&&(r.length=n)}}const Js=[["normalize",Ic],["block",Pc],["inline",Lc],["linkify",Rc],["replacements",Wc],["smartquotes",Kc],["text_join",Jc]];function To(){this.ruler=new Ie;for(let e=0;e<Js.length;e++)this.ruler.push(Js[e][0],Js[e][1])}To.prototype.process=function(e){const t=this.ruler.getRules("");for(let n=0,s=t.length;n<s;n++)t[n](e)};To.prototype.State=Nr;function tt(e,t,n,s){this.src=e,this.md=t,this.env=n,this.tokens=s,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const o=this.src;for(let u=0,r=0,i=0,a=0,l=o.length,c=!1;r<l;r++){const f=o.charCodeAt(r);if(!c)if(de(f)){i++,f===9?a+=4-a%4:a++;continue}else c=!0;(f===10||r===l-1)&&(f!==10&&r++,this.bMarks.push(u),this.eMarks.push(r),this.tShift.push(i),this.sCount.push(a),this.bsCount.push(0),c=!1,i=0,a=0,u=r+1)}this.bMarks.push(o.length),this.eMarks.push(o.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}tt.prototype.push=function(e,t,n){const s=new Ge(e,t,n);return s.block=!0,n<0&&this.level--,s.level=this.level,n>0&&this.level++,this.tokens.push(s),s};tt.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]};tt.prototype.skipEmptyLines=function(t){for(let n=this.lineMax;t<n&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t};tt.prototype.skipSpaces=function(t){for(let n=this.src.length;t<n;t++){const s=this.src.charCodeAt(t);if(!de(s))break}return t};tt.prototype.skipSpacesBack=function(t,n){if(t<=n)return t;for(;t>n;)if(!de(this.src.charCodeAt(--t)))return t+1;return t};tt.prototype.skipChars=function(t,n){for(let s=this.src.length;t<s&&this.src.charCodeAt(t)===n;t++);return t};tt.prototype.skipCharsBack=function(t,n,s){if(t<=s)return t;for(;t>s;)if(n!==this.src.charCodeAt(--t))return t+1;return t};tt.prototype.getLines=function(t,n,s,o){if(t>=n)return"";const u=new Array(n-t);for(let r=0,i=t;i<n;i++,r++){let a=0;const l=this.bMarks[i];let c=l,f;for(i+1<n||o?f=this.eMarks[i]+1:f=this.eMarks[i];c<f&&a<s;){const h=this.src.charCodeAt(c);if(de(h))h===9?a+=4-(a+this.bsCount[i])%4:a++;else if(c-l<this.tShift[i])a++;else break;c++}a>s?u[r]=new Array(a-s+1).join(" ")+this.src.slice(c,f):u[r]=this.src.slice(c,f)}return u.join("")};tt.prototype.Token=Ge;const Zc=65536;function Zs(e,t){const n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];return e.src.slice(n,s)}function Nu(e){const t=[],n=e.length;let s=0,o=e.charCodeAt(s),u=!1,r=0,i="";for(;s<n;)o===124&&(u?(i+=e.substring(r,s-1),r=s):(t.push(i+e.substring(r,s)),i="",r=s+1)),u=o===92,s++,o=e.charCodeAt(s);return t.push(i+e.substring(r)),t}function Yc(e,t,n,s){if(t+2>n)return!1;let o=t+1;if(e.sCount[o]<e.blkIndent||e.sCount[o]-e.blkIndent>=4)return!1;let u=e.bMarks[o]+e.tShift[o];if(u>=e.eMarks[o])return!1;const r=e.src.charCodeAt(u++);if(r!==124&&r!==45&&r!==58||u>=e.eMarks[o])return!1;const i=e.src.charCodeAt(u++);if(i!==124&&i!==45&&i!==58&&!de(i)||r===45&&de(i))return!1;for(;u<e.eMarks[o];){const w=e.src.charCodeAt(u);if(w!==124&&w!==45&&w!==58&&!de(w))return!1;u++}let a=Zs(e,t+1),l=a.split("|");const c=[];for(let w=0;w<l.length;w++){const M=l[w].trim();if(!M){if(w===0||w===l.length-1)continue;return!1}if(!/^:?-+:?$/.test(M))return!1;M.charCodeAt(M.length-1)===58?c.push(M.charCodeAt(0)===58?"center":"right"):M.charCodeAt(0)===58?c.push("left"):c.push("")}if(a=Zs(e,t).trim(),a.indexOf("|")===-1||e.sCount[t]-e.blkIndent>=4)return!1;l=Nu(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),x=[t,0];g.map=x;const E=e.push("thead_open","thead",1);E.map=[t,t+1];const C=e.push("tr_open","tr",1);C.map=[t,t+1];for(let w=0;w<l.length;w++){const M=e.push("th_open","th",1);c[w]&&(M.attrs=[["style","text-align:"+c[w]]]);const P=e.push("inline","",0);P.content=l[w].trim(),P.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let y,v=0;for(o=t+2;o<n&&!(e.sCount[o]<e.blkIndent);o++){let w=!1;for(let P=0,U=b.length;P<U;P++)if(b[P](e,o,n,!0)){w=!0;break}if(w||(a=Zs(e,o).trim(),!a)||e.sCount[o]-e.blkIndent>=4||(l=Nu(a),l.length&&l[0]===""&&l.shift(),l.length&&l[l.length-1]===""&&l.pop(),v+=f-l.length,v>Zc))break;if(o===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=[o,o+1];for(let P=0;P<f;P++){const U=e.push("td_open","td",1);c[P]&&(U.attrs=[["style","text-align:"+c[P]]]);const oe=e.push("inline","",0);oe.content=l[P]?l[P].trim():"",oe.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return y&&(e.push("tbody_close","tbody",-1),y[1]=o),e.push("table_close","table",-1),x[1]=o,e.parentType=h,e.line=o,!0}function Xc(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let s=t+1,o=s;for(;s<n;){if(e.isEmpty(s)){s++;continue}if(e.sCount[s]-e.blkIndent>=4){s++,o=s;continue}break}e.line=o;const u=e.push("code_block","code",0);return u.content=e.getLines(t,o,4+e.blkIndent,!1)+`
`,u.map=[t,e.line],!0}function Qc(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||o+3>u)return!1;const r=e.src.charCodeAt(o);if(r!==126&&r!==96)return!1;let i=o;o=e.skipChars(o,r);let a=o-i;if(a<3)return!1;const l=e.src.slice(i,o),c=e.src.slice(o,u);if(r===96&&c.indexOf(String.fromCharCode(r))>=0)return!1;if(s)return!0;let f=t,h=!1;for(;f++,!(f>=n||(o=i=e.bMarks[f]+e.tShift[f],u=e.eMarks[f],o<u&&e.sCount[f]<e.blkIndent));)if(e.src.charCodeAt(o)===r&&!(e.sCount[f]-e.blkIndent>=4)&&(o=e.skipChars(o,r),!(o-i<a)&&(o=e.skipSpaces(o),!(o<u)))){h=!0;break}a=e.sCount[t],e.line=f+(h?1:0);const b=e.push("fence","code",0);return b.info=c,b.content=e.getLines(t+1,f,a,!0),b.markup=l,b.map=[t,e.line],!0}function e0(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];const r=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(o)!==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<n;g++){const v=e.sCount[g]<e.blkIndent;if(o=e.bMarks[g]+e.tShift[g],u=e.eMarks[g],o>=u)break;if(e.src.charCodeAt(o++)===62&&!v){let M=e.sCount[g]+1,P,U;e.src.charCodeAt(o)===32?(o++,M++,U=!1,P=!0):e.src.charCodeAt(o)===9?(P=!0,(e.bsCount[g]+M)%4===3?(o++,M++,U=!1):U=!0):P=!1;let oe=M;for(i.push(e.bMarks[g]),e.bMarks[g]=o;o<u;){const j=e.src.charCodeAt(o);if(de(j))j===9?oe+=4-(oe+e.bsCount[g]+(U?1:0))%4:oe++;else break;o++}b=o>=u,a.push(e.bsCount[g]),e.bsCount[g]=e.sCount[g]+1+(P?1:0),l.push(e.sCount[g]),e.sCount[g]=oe-M,c.push(e.tShift[g]),e.tShift[g]=o-e.bMarks[g];continue}if(b)break;let w=!1;for(let M=0,P=f.length;M<P;M++)if(f[M](e,g,n,!0)){w=!0;break}if(w){e.lineMax=g,e.blkIndent!==0&&(i.push(e.bMarks[g]),a.push(e.bsCount[g]),c.push(e.tShift[g]),l.push(e.sCount[g]),e.sCount[g]-=e.blkIndent);break}i.push(e.bMarks[g]),a.push(e.bsCount[g]),c.push(e.tShift[g]),l.push(e.sCount[g]),e.sCount[g]=-1}const x=e.blkIndent;e.blkIndent=0;const E=e.push("blockquote_open","blockquote",1);E.markup=">";const C=[t,0];E.map=C,e.md.block.tokenize(e,t,g);const y=e.push("blockquote_close","blockquote",-1);y.markup=">",e.lineMax=r,e.parentType=h,C[1]=e.line;for(let v=0;v<c.length;v++)e.bMarks[v+t]=i[v],e.tShift[v+t]=c[v],e.sCount[v+t]=l[v],e.bsCount[v+t]=a[v];return e.blkIndent=x,!0}function t0(e,t,n,s){const o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let u=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(u++);if(r!==42&&r!==45&&r!==95)return!1;let i=1;for(;u<o;){const l=e.src.charCodeAt(u++);if(l!==r&&!de(l))return!1;l===r&&i++}if(i<3)return!1;if(s)return!0;e.line=t+1;const a=e.push("hr","hr",0);return a.map=[t,e.line],a.markup=Array(i+1).join(String.fromCharCode(r)),!0}function Uu(e,t){const n=e.eMarks[t];let s=e.bMarks[t]+e.tShift[t];const o=e.src.charCodeAt(s++);if(o!==42&&o!==45&&o!==43)return-1;if(s<n){const u=e.src.charCodeAt(s);if(!de(u))return-1}return s}function Ou(e,t){const n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];let o=n;if(o+1>=s)return-1;let u=e.src.charCodeAt(o++);if(u<48||u>57)return-1;for(;;){if(o>=s)return-1;if(u=e.src.charCodeAt(o++),u>=48&&u<=57){if(o-n>=10)return-1;continue}if(u===41||u===46)break;return-1}return o<s&&(u=e.src.charCodeAt(o),!de(u))?-1:o}function n0(e,t){const n=e.level+2;for(let s=t+2,o=e.tokens.length-2;s<o;s++)e.tokens[s].level===n&&e.tokens[s].type==="paragraph_open"&&(e.tokens[s+2].hidden=!0,e.tokens[s].hidden=!0,s+=2)}function s0(e,t,n,s){let o,u,r,i,a=t,l=!0;if(e.sCount[a]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[a]-e.listIndent>=4&&e.sCount[a]<e.blkIndent)return!1;let c=!1;s&&e.parentType==="paragraph"&&e.sCount[a]>=e.blkIndent&&(c=!0);let f,h,b;if((b=Ou(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=Uu(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),x=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 C=!1;const y=e.md.block.ruler.getRules("list"),v=e.parentType;for(e.parentType="list";a<n;){u=b,o=e.eMarks[a];const w=e.sCount[a]+b-(e.bMarks[a]+e.tShift[a]);let M=w;for(;u<o;){const Y=e.src.charCodeAt(u);if(Y===9)M+=4-(M+e.bsCount[a])%4;else if(Y===32)M++;else break;u++}const P=u;let U;P>=o?U=1:U=M-w,U>4&&(U=1);const oe=w+U;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 R=e.tight,X=e.tShift[a],Q=e.sCount[a],K=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=oe,e.tight=!0,e.tShift[a]=P-e.bMarks[a],e.sCount[a]=M,P>=o&&e.isEmpty(a+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,a,n,!0),(!e.tight||C)&&(l=!1),C=e.line-a>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=K,e.tShift[a]=X,e.sCount[a]=Q,e.tight=R,i=e.push("list_item_close","li",-1),i.markup=String.fromCharCode(g),a=e.line,j[1]=a,a>=n||e.sCount[a]<e.blkIndent||e.sCount[a]-e.blkIndent>=4)break;let I=!1;for(let Y=0,he=y.length;Y<he;Y++)if(y[Y](e,a,n,!0)){I=!0;break}if(I)break;if(f){if(b=Ou(e,a),b<0)break;r=e.bMarks[a]+e.tShift[a]}else if(b=Uu(e,a),b<0)break;if(g!==e.src.charCodeAt(b-1))break}return f?i=e.push("ordered_list_close","ol",-1):i=e.push("bullet_list_close","ul",-1),i.markup=String.fromCharCode(g),E[1]=a,e.line=a,e.parentType=v,l&&n0(e,x),!0}function o0(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],u=e.eMarks[t],r=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(o)!==91)return!1;function i(y){const v=e.lineMax;if(y>=v||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 U=e.md.block.ruler.getRules("reference"),oe=e.parentType;e.parentType="reference";let j=!1;for(let R=0,X=U.length;R<X;R++)if(U[R](e,y,v,!0)){j=!0;break}if(e.parentType=oe,j)return null}const M=e.bMarks[y]+e.tShift[y],P=e.eMarks[y];return e.src.slice(M,P+1)}let a=e.src.slice(o,u+1);u=a.length;let l=-1;for(o=1;o<u;o++){const y=a.charCodeAt(o);if(y===91)return!1;if(y===93){l=o;break}else if(y===10){const v=i(r);v!==null&&(a+=v,u=a.length,r++)}else if(y===92&&(o++,o<u&&a.charCodeAt(o)===10)){const v=i(r);v!==null&&(a+=v,u=a.length,r++)}}if(l<0||a.charCodeAt(l+1)!==58)return!1;for(o=l+2;o<u;o++){const y=a.charCodeAt(o);if(y===10){const v=i(r);v!==null&&(a+=v,u=a.length,r++)}else if(!de(y))break}const c=e.md.helpers.parseLinkDestination(a,o,u);if(!c.ok)return!1;const f=e.md.normalizeLink(c.str);if(!e.md.validateLink(f))return!1;o=c.pos;const h=o,b=r,g=o;for(;o<u;o++){const y=a.charCodeAt(o);if(y===10){const v=i(r);v!==null&&(a+=v,u=a.length,r++)}else if(!de(y))break}let x=e.md.helpers.parseLinkTitle(a,o,u);for(;x.can_continue;){const y=i(r);if(y===null)break;a+=y,o=u,u=a.length,r++,x=e.md.helpers.parseLinkTitle(a,o,u,x)}let E;for(o<u&&g!==o&&x.ok?(E=x.str,o=x.pos):(E="",o=h,r=b);o<u;){const y=a.charCodeAt(o);if(!de(y))break;o++}if(o<u&&a.charCodeAt(o)!==10&&E)for(E="",o=h,r=b;o<u;){const y=a.charCodeAt(o);if(!de(y))break;o++}if(o<u&&a.charCodeAt(o)!==10)return!1;const C=ls(a.slice(1,l));return C?(s||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[C]>"u"&&(e.env.references[C]={title:E,href:f}),e.line=r),!0):!1}const u0=["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"],r0="[a-zA-Z_:][a-zA-Z0-9:._-]*",i0="[^\"'=<>`\\x00-\\x20]+",a0="'[^']*'",l0='"[^"]*"',c0="(?:"+i0+"|"+a0+"|"+l0+")",d0="(?:\\s+"+r0+"(?:\\s*=\\s*"+c0+")?)",Or="<[A-Za-z][A-Za-z0-9\\-]*"+d0+"*\\s*\\/?>",qr="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",f0="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",p0="<[?][\\s\\S]*?[?]>",h0="<![A-Za-z][^>]*>",m0="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",g0=new RegExp("^(?:"+Or+"|"+qr+"|"+f0+"|"+p0+"|"+h0+"|"+m0+")"),b0=new RegExp("^(?:"+Or+"|"+qr+")"),jt=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+u0.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(b0.source+"\\s*$"),/^$/,!1]];function x0(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(o)!==60)return!1;let r=e.src.slice(o,u),i=0;for(;i<jt.length&&!jt[i][0].test(r);i++);if(i===jt.length)return!1;if(s)return jt[i][2];let a=t+1;if(!jt[i][1].test(r)){for(;a<n&&!(e.sCount[a]<e.blkIndent);a++)if(o=e.bMarks[a]+e.tShift[a],u=e.eMarks[a],r=e.src.slice(o,u),jt[i][1].test(r)){r.length!==0&&a++;break}}e.line=a;const l=e.push("html_block","",0);return l.map=[t,a],l.content=e.getLines(t,a,e.blkIndent,!0),!0}function v0(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let r=e.src.charCodeAt(o);if(r!==35||o>=u)return!1;let i=1;for(r=e.src.charCodeAt(++o);r===35&&o<u&&i<=6;)i++,r=e.src.charCodeAt(++o);if(i>6||o<u&&!de(r))return!1;if(s)return!0;u=e.skipSpacesBack(u,o);const a=e.skipCharsBack(u,35,o);a>o&&de(e.src.charCodeAt(a-1))&&(u=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(o,u).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 y0(e,t,n){const s=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const o=e.parentType;e.parentType="paragraph";let u=0,r,i=t+1;for(;i<n&&!e.isEmpty(i);i++){if(e.sCount[i]-e.blkIndent>3)continue;if(e.sCount[i]>=e.blkIndent){let b=e.bMarks[i]+e.tShift[i];const g=e.eMarks[i];if(b<g&&(r=e.src.charCodeAt(b),(r===45||r===61)&&(b=e.skipChars(b,r),b=e.skipSpaces(b),b>=g))){u=r===61?1:2;break}}if(e.sCount[i]<0)continue;let h=!1;for(let b=0,g=s.length;b<g;b++)if(s[b](e,i,n,!0)){h=!0;break}if(h)break}if(!u)return!1;const a=e.getLines(t,i,e.blkIndent,!1).trim();e.line=i+1;const l=e.push("heading_open","h"+String(u),1);l.markup=String.fromCharCode(r),l.map=[t,e.line];const c=e.push("inline","",0);c.content=a,c.map=[t,e.line-1],c.children=[];const f=e.push("heading_close","h"+String(u),-1);return f.markup=String.fromCharCode(r),e.parentType=o,!0}function w0(e,t,n){const s=e.md.block.ruler.getRules("paragraph"),o=e.parentType;let u=t+1;for(e.parentType="paragraph";u<n&&!e.isEmpty(u);u++){if(e.sCount[u]-e.blkIndent>3||e.sCount[u]<0)continue;let l=!1;for(let c=0,f=s.length;c<f;c++)if(s[c](e,u,n,!0)){l=!0;break}if(l)break}const r=e.getLines(t,u,e.blkIndent,!1).trim();e.line=u;const i=e.push("paragraph_open","p",1);i.map=[t,e.line];const a=e.push("inline","",0);return a.content=r,a.map=[t,e.line],a.children=[],e.push("paragraph_close","p",-1),e.parentType=o,!0}const qn=[["table",Yc,["paragraph","reference"]],["code",Xc],["fence",Qc,["paragraph","reference","blockquote","list"]],["blockquote",e0,["paragraph","reference","blockquote","list"]],["hr",t0,["paragraph","reference","blockquote","list"]],["list",s0,["paragraph","reference","blockquote"]],["reference",o0],["html_block",x0,["paragraph","reference","blockquote"]],["heading",v0,["paragraph","reference","blockquote"]],["lheading",y0],["paragraph",w0]];function cs(){this.ruler=new Ie;for(let e=0;e<qn.length;e++)this.ruler.push(qn[e][0],qn[e][1],{alt:(qn[e][2]||[]).slice()})}cs.prototype.tokenize=function(e,t,n){const s=this.ruler.getRules(""),o=s.length,u=e.md.options.maxNesting;let r=t,i=!1;for(;r<n&&(e.line=r=e.skipEmptyLines(r),!(r>=n||e.sCount[r]<e.blkIndent));){if(e.level>=u){e.line=n;break}const a=e.line;let l=!1;for(let c=0;c<o;c++)if(l=s[c](e,r,n,!1),l){if(a>=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,r<n&&e.isEmpty(r)&&(i=!0,r++,e.line=r)}};cs.prototype.parse=function(e,t,n,s){if(!e)return;const o=new this.State(e,t,n,s);this.tokenize(o,o.line,o.lineMax)};cs.prototype.State=tt;function Dn(e,t,n,s){this.src=e,this.env=n,this.md=t,this.tokens=s,this.tokens_meta=Array(s.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}Dn.prototype.pushPending=function(){const e=new Ge("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e};Dn.prototype.push=function(e,t,n){this.pending&&this.pushPending();const s=new Ge(e,t,n);let o=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),s.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(s),this.tokens_meta.push(o),s};Dn.prototype.scanDelims=function(e,t){const n=this.posMax,s=this.src.charCodeAt(e),o=e>0?this.src.charCodeAt(e-1):32;let u=e;for(;u<n&&this.src.charCodeAt(u)===s;)u++;const r=u-e,i=u<n?this.src.charCodeAt(u):32,a=wn(o)||yn(String.fromCharCode(o)),l=wn(i)||yn(String.fromCharCode(i)),c=vn(o),f=vn(i),h=!f&&(!l||c||a),b=!c&&(!a||f||l);return{can_open:h&&(t||!b||a),can_close:b&&(t||!h||l),length:r}};Dn.prototype.Token=Ge;function k0(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function C0(e,t){let n=e.pos;for(;n<e.posMax&&!k0(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}const _0=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function A0(e,t){if(!e.md.options.linkify||e.linkLevel>0)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 o=e.pending.match(_0);if(!o)return!1;const u=o[1],r=e.md.linkify.matchAtStart(e.src.slice(n-u.length));if(!r)return!1;let i=r.url;if(i.length<=u.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,-u.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-u.length,!0}function D0(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const s=e.pending.length-1,o=e.posMax;if(!t)if(s>=0&&e.pending.charCodeAt(s)===32)if(s>=1&&e.pending.charCodeAt(s-1)===32){let u=s-1;for(;u>=1&&e.pending.charCodeAt(u-1)===32;)u--;e.pending=e.pending.slice(0,u),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<o&&de(e.src.charCodeAt(n));)n++;return e.pos=n,!0}const Io=[];for(let e=0;e<256;e++)Io.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){Io[e.charCodeAt(0)]=1});function S0(e,t){let n=e.pos;const s=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=s))return!1;let o=e.src.charCodeAt(n);if(o===10){for(t||e.push("hardbreak","br",0),n++;n<s&&(o=e.src.charCodeAt(n),!!de(o));)n++;return e.pos=n,!0}let u=e.src[n];if(o>=55296&&o<=56319&&n+1<s){const i=e.src.charCodeAt(n+1);i>=56320&&i<=57343&&(u+=e.src[n+1],n++)}const r="\\"+u;if(!t){const i=e.push("text_special","",0);o<256&&Io[o]!==0?i.content=u:i.content=r,i.markup=r,i.info="escape"}return e.pos=n+1,!0}function E0(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;const o=n;n++;const u=e.posMax;for(;n<u&&e.src.charCodeAt(n)===96;)n++;const r=e.src.slice(o,n),i=r.length;if(e.backticksScanned&&(e.backticks[i]||0)<=o)return t||(e.pending+=r),e.pos+=i,!0;let a=n,l;for(;(l=e.src.indexOf("`",a))!==-1;){for(a=l+1;a<u&&e.src.charCodeAt(a)===96;)a++;const c=a-l;if(c===i){if(!t){const f=e.push("code_inline","code",0);f.markup=r,f.content=e.src.slice(n,l).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=a,!0}e.backticks[c]=l}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=i,!0}function $0(e,t){const n=e.pos,s=e.src.charCodeAt(n);if(t||s!==126)return!1;const o=e.scanDelims(e.pos,!0);let u=o.length;const r=String.fromCharCode(s);if(u<2)return!1;let i;u%2&&(i=e.push("text","",0),i.content=r,u--);for(let a=0;a<u;a+=2)i=e.push("text","",0),i.content=r+r,e.delimiters.push({marker:s,length:0,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close});return e.pos+=o.length,!0}function qu(e,t){let n;const s=[],o=t.length;for(let u=0;u<o;u++){const r=t[u];if(r.marker!==126||r.end===-1)continue;const i=t[r.end];n=e.tokens[r.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[i.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[i.token-1].type==="text"&&e.tokens[i.token-1].content==="~"&&s.push(i.token-1)}for(;s.length;){const u=s.pop();let r=u+1;for(;r<e.tokens.length&&e.tokens[r].type==="s_close";)r++;r--,u!==r&&(n=e.tokens[r],e.tokens[r]=e.tokens[u],e.tokens[u]=n)}}function F0(e){const t=e.tokens_meta,n=e.tokens_meta.length;qu(e,e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&qu(e,t[s].delimiters)}const Hr={tokenize:$0,postProcess:F0};function M0(e,t){const n=e.pos,s=e.src.charCodeAt(n);if(t||s!==95&&s!==42)return!1;const o=e.scanDelims(e.pos,s===42);for(let u=0;u<o.length;u++){const r=e.push("text","",0);r.content=String.fromCharCode(s),e.delimiters.push({marker:s,length:o.length,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close})}return e.pos+=o.length,!0}function Hu(e,t){const n=t.length;for(let s=n-1;s>=0;s--){const o=t[s];if(o.marker!==95&&o.marker!==42||o.end===-1)continue;const u=t[o.end],r=s>0&&t[s-1].end===o.end+1&&t[s-1].marker===o.marker&&t[s-1].token===o.token-1&&t[o.end+1].token===u.token+1,i=String.fromCharCode(o.marker),a=e.tokens[o.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[u.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[o.end+1].token].content="",s--)}}function T0(e){const t=e.tokens_meta,n=e.tokens_meta.length;Hu(e,e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&Hu(e,t[s].delimiters)}const Wr={tokenize:M0,postProcess:T0};function I0(e,t){let n,s,o,u,r="",i="",a=e.pos,l=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const c=e.pos,f=e.posMax,h=e.pos+1,b=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(b<0)return!1;let g=b+1;if(g<f&&e.src.charCodeAt(g)===40){for(l=!1,g++;g<f&&(n=e.src.charCodeAt(g),!(!de(n)&&n!==10));g++);if(g>=f)return!1;if(a=g,o=e.md.helpers.parseLinkDestination(e.src,g,e.posMax),o.ok){for(r=e.md.normalizeLink(o.str),e.md.validateLink(r)?g=o.pos:r="",a=g;g<f&&(n=e.src.charCodeAt(g),!(!de(n)&&n!==10));g++);if(o=e.md.helpers.parseLinkTitle(e.src,g,e.posMax),g<f&&a!==g&&o.ok)for(i=o.str,g=o.pos;g<f&&(n=e.src.charCodeAt(g),!(!de(n)&&n!==10));g++);}(g>=f||e.src.charCodeAt(g)!==41)&&(l=!0),g++}if(l){if(typeof e.env.references>"u")return!1;if(g<f&&e.src.charCodeAt(g)===91?(a=g+1,g=e.md.helpers.parseLinkLabel(e,g),g>=0?s=e.src.slice(a,g++):g=b+1):g=b+1,s||(s=e.src.slice(h,b)),u=e.env.references[ls(s)],!u)return e.pos=c,!1;r=u.href,i=u.title}if(!t){e.pos=h,e.posMax=b;const x=e.push("link_open","a",1),E=[["href",r]];x.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 P0(e,t){let n,s,o,u,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(u=g+1,u<h&&e.src.charCodeAt(u)===40){for(u++;u<h&&(n=e.src.charCodeAt(u),!(!de(n)&&n!==10));u++);if(u>=h)return!1;for(l=u,i=e.md.helpers.parseLinkDestination(e.src,u,e.posMax),i.ok&&(c=e.md.normalizeLink(i.str),e.md.validateLink(c)?u=i.pos:c=""),l=u;u<h&&(n=e.src.charCodeAt(u),!(!de(n)&&n!==10));u++);if(i=e.md.helpers.parseLinkTitle(e.src,u,e.posMax),u<h&&l!==u&&i.ok)for(a=i.str,u=i.pos;u<h&&(n=e.src.charCodeAt(u),!(!de(n)&&n!==10));u++);else a="";if(u>=h||e.src.charCodeAt(u)!==41)return e.pos=f,!1;u++}else{if(typeof e.env.references>"u")return!1;if(u<h&&e.src.charCodeAt(u)===91?(l=u+1,u=e.md.helpers.parseLinkLabel(e,u),u>=0?o=e.src.slice(l,u++):u=g+1):u=g+1,o||(o=e.src.slice(b,g)),r=e.env.references[ls(o)],!r)return e.pos=f,!1;c=r.href,a=r.title}if(!t){s=e.src.slice(b,g);const x=[];e.md.inline.parse(s,e.md,e.env,x);const E=e.push("image","img",0),C=[["src",c],["alt",""]];E.attrs=C,E.children=x,E.content=s,a&&C.push(["title",a])}return e.pos=u,e.posMax=h,!0}const L0=/^([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])?)*)$/,z0=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function B0(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;const s=e.pos,o=e.posMax;for(;;){if(++n>=o)return!1;const r=e.src.charCodeAt(n);if(r===60)return!1;if(r===62)break}const u=e.src.slice(s+1,n);if(z0.test(u)){const r=e.md.normalizeLink(u);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(u);const l=e.push("link_close","a",-1);l.markup="autolink",l.info="auto"}return e.pos+=u.length+2,!0}if(L0.test(u)){const r=e.md.normalizeLink("mailto:"+u);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(u);const l=e.push("link_close","a",-1);l.markup="autolink",l.info="auto"}return e.pos+=u.length+2,!0}return!1}function R0(e){return/^<a[>\s]/i.test(e)}function j0(e){return/^<\/a\s*>/i.test(e)}function N0(e){const t=e|32;return t>=97&&t<=122}function U0(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 o=e.src.charCodeAt(s+1);if(o!==33&&o!==63&&o!==47&&!N0(o))return!1;const u=e.src.slice(s).match(g0);if(!u)return!1;if(!t){const r=e.push("html_inline","",0);r.content=u[0],R0(r.content)&&e.linkLevel++,j0(r.content)&&e.linkLevel--}return e.pos+=u[0].length,!0}const O0=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,q0=/^&([a-z][a-z0-9]{1,31});/i;function H0(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 u=e.src.slice(n).match(O0);if(u){if(!t){const r=u[1][0].toLowerCase()==="x"?parseInt(u[1].slice(1),16):parseInt(u[1],10),i=e.push("text_special","",0);i.content=Mo(r)?ns(r):ns(65533),i.markup=u[0],i.info="entity"}return e.pos+=u[0].length,!0}}else{const u=e.src.slice(n).match(q0);if(u){const r=Br(u[0]);if(r!==u[0]){if(!t){const i=e.push("text_special","",0);i.content=r,i.markup=u[0],i.info="entity"}return e.pos+=u[0].length,!0}}}return!1}function Wu(e){const t={},n=e.length;if(!n)return;let s=0,o=-2;const u=[];for(let r=0;r<n;r++){const i=e[r];if(u.push(0),(e[s].marker!==i.marker||o!==i.token-1)&&(s=r),o=i.token,i.length=i.length||0,!i.close)continue;t.hasOwnProperty(i.marker)||(t[i.marker]=[-1,-1,-1,-1,-1,-1]);const a=t[i.marker][(i.open?3:0)+i.length%3];let l=s-u[s]-1,c=l;for(;l>a;l-=u[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?u[l-1]+1:0;u[r]=r-l+b,u[l]=b,i.open=!1,f.end=r,f.close=!1,c=-1,o=-2;break}}}c!==-1&&(t[i.marker][(i.open?3:0)+(i.length||0)%3]=c)}}function W0(e){const t=e.tokens_meta,n=e.tokens_meta.length;Wu(e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&Wu(t[s].delimiters)}function V0(e){let t,n,s=0;const o=e.tokens,u=e.tokens.length;for(t=n=0;t<u;t++)o[t].nesting<0&&s--,o[t].level=s,o[t].nesting>0&&s++,o[t].type==="text"&&t+1<u&&o[t+1].type==="text"?o[t+1].content=o[t].content+o[t+1].content:(t!==n&&(o[n]=o[t]),n++);t!==n&&(o.length=n)}const Ys=[["text",C0],["linkify",A0],["newline",D0],["escape",S0],["backticks",E0],["strikethrough",Hr.tokenize],["emphasis",Wr.tokenize],["link",I0],["image",P0],["autolink",B0],["html_inline",U0],["entity",H0]],Xs=[["balance_pairs",W0],["strikethrough",Hr.postProcess],["emphasis",Wr.postProcess],["fragments_join",V0]];function Sn(){this.ruler=new Ie;for(let e=0;e<Ys.length;e++)this.ruler.push(Ys[e][0],Ys[e][1]);this.ruler2=new Ie;for(let e=0;e<Xs.length;e++)this.ruler2.push(Xs[e][0],Xs[e][1])}Sn.prototype.skipToken=function(e){const t=e.pos,n=this.ruler.getRules(""),s=n.length,o=e.md.options.maxNesting,u=e.cache;if(typeof u[t]<"u"){e.pos=u[t];return}let r=!1;if(e.level<o){for(let i=0;i<s;i++)if(e.level++,r=n[i](e,!0),e.level--,r){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;r||e.pos++,u[t]=e.pos};Sn.prototype.tokenize=function(e){const t=this.ruler.getRules(""),n=t.length,s=e.posMax,o=e.md.options.maxNesting;for(;e.pos<s;){const u=e.pos;let r=!1;if(e.level<o){for(let i=0;i<n;i++)if(r=t[i](e,!1),r){if(u>=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()};Sn.prototype.parse=function(e,t,n,s){const o=new this.State(e,t,n,s);this.tokenize(o);const u=this.ruler2.getRules(""),r=u.length;for(let i=0;i<r;i++)u[i](o)};Sn.prototype.State=Dn;function G0(e){const t={};e=e||{},t.src_Any=Tr.source,t.src_Cc=Ir.source,t.src_Z=Lr.source,t.src_P=$o.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><｜]";return t.src_pseudo_letter="(?:(?!"+n+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+n+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+n+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",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 fo(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(s){e[s]=n[s]})}),e}function ds(e){return Object.prototype.toString.call(e)}function K0(e){return ds(e)==="[object String]"}function J0(e){return ds(e)==="[object Object]"}function Z0(e){return ds(e)==="[object RegExp]"}function Vu(e){return ds(e)==="[object Function]"}function Y0(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const Vr={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function X0(e){return Object.keys(e||{}).reduce(function(t,n){return t||Vr.hasOwnProperty(n)},!1)}const Q0={"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}}},ed="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]",td="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function nd(e){e.__index__=-1,e.__text_cache__=""}function sd(e){return function(t,n){const s=t.slice(n);return e.test(s)?s.match(e)[0].length:0}}function Gu(){return function(e,t){t.normalize(e)}}function ss(e){const t=e.re=G0(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(ed),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 o=[];e.__compiled__={};function u(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,J0(a)){Z0(a.validate)?l.validate=sd(a.validate):Vu(a.validate)?l.validate=a.validate:u(i,a),Vu(a.normalize)?l.normalize=a.normalize:a.normalize?u(i,a):l.normalize=Gu();return}if(K0(a)){o.push(i);return}u(i,a)}),o.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:Gu()};const r=Object.keys(e.__compiled__).filter(function(i){return i.length>0&&e.__compiled__[i]}).map(Y0).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"),nd(e)}function od(e,t){const n=e.__index__,s=e.__last_index__,o=e.__text_cache__.slice(n,s);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=s+t,this.raw=o,this.text=o,this.url=o}function po(e,t){const n=new od(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function ze(e,t){if(!(this instanceof ze))return new ze(e,t);t||X0(e)&&(t=e,e={}),this.__opts__=fo({},Vr,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=fo({},Q0,e),this.__compiled__={},this.__tlds__=td,this.__tlds_replaced__=!1,this.re={},ss(this)}ze.prototype.add=function(t,n){return this.__schemas__[t]=n,ss(this),this};ze.prototype.set=function(t){return this.__opts__=fo(this.__opts__,t),this};ze.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;let n,s,o,u,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(u=this.testSchemaAt(t,n[2],a.lastIndex),u){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+u;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=t.search(this.re.host_fuzzy_test),l>=0&&(this.__index__<0||l<this.__index__)&&(s=t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(r=s.index+s[1].length,(this.__index__<0||r<this.__index__)&&(this.__schema__="",this.__index__=r,this.__last_index__=s.index+s[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(c=t.indexOf("@"),c>=0&&(o=t.match(this.re.email_fuzzy))!==null&&(r=o.index+o[1].length,i=o.index+o[0].length,(this.__index__<0||r<this.__index__||r===this.__index__&&i>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=r,this.__last_index__=i))),this.__index__>=0};ze.prototype.pretest=function(t){return this.re.pretest.test(t)};ze.prototype.testSchemaAt=function(t,n,s){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,s,this):0};ze.prototype.match=function(t){const n=[];let s=0;this.__index__>=0&&this.__text_cache__===t&&(n.push(po(this,s)),s=this.__last_index__);let o=s?t.slice(s):t;for(;this.test(o);)n.push(po(this,s)),o=o.slice(this.__last_index__),s+=this.__last_index__;return n.length?n:null};ze.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,po(this,0)):null};ze.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(s,o,u){return s!==u[o-1]}).reverse(),ss(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,ss(this),this)};ze.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};ze.prototype.onCompile=function(){};const Nt=2147483647,Xe=36,Po=1,kn=26,ud=38,rd=700,Gr=72,Kr=128,Jr="-",id=/^xn--/,ad=/[^\0-\x7F]/,ld=/[\x2E\u3002\uFF0E\uFF61]/g,cd={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Qs=Xe-Po,Qe=Math.floor,eo=String.fromCharCode;function mt(e){throw new RangeError(cd[e])}function dd(e,t){const n=[];let s=e.length;for(;s--;)n[s]=t(e[s]);return n}function Zr(e,t){const n=e.split("@");let s="";n.length>1&&(s=n[0]+"@",e=n[1]),e=e.replace(ld,".");const o=e.split("."),u=dd(o,t).join(".");return s+u}function Yr(e){const t=[];let n=0;const s=e.length;for(;n<s;){const o=e.charCodeAt(n++);if(o>=55296&&o<=56319&&n<s){const u=e.charCodeAt(n++);(u&64512)==56320?t.push(((o&1023)<<10)+(u&1023)+65536):(t.push(o),n--)}else t.push(o)}return t}const fd=e=>String.fromCodePoint(...e),pd=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:Xe},Ku=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},Xr=function(e,t,n){let s=0;for(e=n?Qe(e/rd):e>>1,e+=Qe(e/t);e>Qs*kn>>1;s+=Xe)e=Qe(e/Qs);return Qe(s+(Qs+1)*e/(e+ud))},Qr=function(e){const t=[],n=e.length;let s=0,o=Kr,u=Gr,r=e.lastIndexOf(Jr);r<0&&(r=0);for(let i=0;i<r;++i)e.charCodeAt(i)>=128&&mt("not-basic"),t.push(e.charCodeAt(i));for(let i=r>0?r+1:0;i<n;){const a=s;for(let c=1,f=Xe;;f+=Xe){i>=n&&mt("invalid-input");const h=pd(e.charCodeAt(i++));h>=Xe&&mt("invalid-input"),h>Qe((Nt-s)/c)&&mt("overflow"),s+=h*c;const b=f<=u?Po:f>=u+kn?kn:f-u;if(h<b)break;const g=Xe-b;c>Qe(Nt/g)&&mt("overflow"),c*=g}const l=t.length+1;u=Xr(s-a,l,a==0),Qe(s/l)>Nt-o&&mt("overflow"),o+=Qe(s/l),s%=l,t.splice(s++,0,o)}return String.fromCodePoint(...t)},ei=function(e){const t=[];e=Yr(e);const n=e.length;let s=Kr,o=0,u=Gr;for(const a of e)a<128&&t.push(eo(a));const r=t.length;let i=r;for(r&&t.push(Jr);i<n;){let a=Nt;for(const c of e)c>=s&&c<a&&(a=c);const l=i+1;a-s>Qe((Nt-o)/l)&&mt("overflow"),o+=(a-s)*l,s=a;for(const c of e)if(c<s&&++o>Nt&&mt("overflow"),c===s){let f=o;for(let h=Xe;;h+=Xe){const b=h<=u?Po:h>=u+kn?kn:h-u;if(f<b)break;const g=f-b,x=Xe-b;t.push(eo(Ku(b+g%x,0))),f=Qe(g/x)}t.push(eo(Ku(f,0))),u=Xr(o,l,i===r),o=0,++i}++o,++s}return t.join("")},hd=function(e){return Zr(e,function(t){return id.test(t)?Qr(t.slice(4).toLowerCase()):t})},md=function(e){return Zr(e,function(t){return ad.test(t)?"xn--"+ei(t):t})},ti={version:"2.3.1",ucs2:{decode:Yr,encode:fd},decode:Qr,encode:ei,toASCII:md,toUnicode:hd},gd={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},bd={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},xd={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}},vd={default:gd,zero:bd,commonmark:xd},yd=/^(vbscript|javascript|file|data):/,wd=/^data:image\/(gif|png|jpeg|webp);/;function kd(e){const t=e.trim().toLowerCase();return yd.test(t)?wd.test(t):!0}const ni=["http:","https:","mailto:"];function Cd(e){const t=Eo(e,!0);if(t.hostname&&(!t.protocol||ni.indexOf(t.protocol)>=0))try{t.hostname=ti.toASCII(t.hostname)}catch{}return An(So(t))}function _d(e){const t=Eo(e,!0);if(t.hostname&&(!t.protocol||ni.indexOf(t.protocol)>=0))try{t.hostname=ti.toUnicode(t.hostname)}catch{}return Ot(So(t),Ot.defaultChars+"%")}function Be(e,t){if(!(this instanceof Be))return new Be(e,t);t||Fo(e)||(t=e||{},e="default"),this.inline=new Sn,this.block=new cs,this.core=new To,this.renderer=new Wt,this.linkify=new ze,this.validateLink=kd,this.normalizeLink=Cd,this.normalizeLinkText=_d,this.utils=Dc,this.helpers=as({},Fc),this.options={},this.configure(e),t&&this.set(t)}Be.prototype.set=function(e){return as(this.options,e),this};Be.prototype.configure=function(e){const t=this;if(Fo(e)){const n=e;if(e=vd[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};Be.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(o){n=n.concat(this[o].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));const s=e.filter(function(o){return n.indexOf(o)<0});if(s.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+s);return this};Be.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(o){n=n.concat(this[o].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));const s=e.filter(function(o){return n.indexOf(o)<0});if(s.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+s);return this};Be.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this};Be.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};Be.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)};Be.prototype.parseInline=function(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens};Be.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};let gn=null,Hn=null;async function Ad(){return gn||Hn||(Hn=go(()=>import("./katex-DGN8GczM.js"),[]).then(e=>{if(gn=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}),Hn)}const Dd=/\$\$([\s\S]+?)\$\$/g,Sd=/\$([^\n$]+?)\$/g;function Ju(e,t){if(!gn)return`<code>${Zu(e)}</code>`;try{return gn.default.renderToString(e,{displayMode:t,throwOnError:!1,output:"html"})}catch{return`<code>${Zu(e)}</code>`}}function Zu(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Ed(e){return/\$\$[\s\S]+?\$\$/.test(e)||/\$[^\n$]+?\$/.test(e)}async function $d(e){await Ad();let t=e.replace(Dd,(n,s)=>`<div class="katex-block my-4 text-center overflow-x-auto">${Ju(s.trim(),!0)}</div>`);return t=t.replace(Sd,(n,s)=>Ju(s.trim(),!1)),t}let Ut=null,Wn=null,Yu=!1;async function Fd(){return Ut||Wn||(Wn=go(()=>import("./mermaid.core-CJYA4M6R.js").then(e=>e.bE),__vite__mapDeps([0,1,2])).then(e=>(Ut=e,e)),Wn)}function Md(){Yu||!Ut||(Ut.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}),Yu=!0)}const to=new Map;function Td(e){return/```mermaid/i.test(e)}let Id=0;async function Pd(e){await Fd(),Md();const t=Ut.default,n=/<pre><code class="language-mermaid">([\s\S]*?)<\/code><\/pre>/gi,s=[...e.matchAll(n)];if(s.length===0)return e;let o=e;for(const u of s){const r=u[1].replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").trim(),i=r;if(to.has(i)){o=o.replace(u[0],to.get(i));continue}try{const a=`mermaid-${++Id}`,{svg:l}=await t.render(a,r),c=`<div class="mermaid-diagram my-4 overflow-x-auto rounded-lg bg-white/5 border border-white/5 p-4">${l}</div>`;to.set(i,c),o=o.replace(u[0],c)}catch{const a=`<div class="my-4 p-3 rounded-lg bg-red-500/10 border border-red-500/20 text-xs text-red-400/70">Mermaid render error</div><pre><code>${u[1]}</code></pre>`;o=o.replace(u[0],a)}}return o}const Ld=te({__name:"ContextMenu",setup(e,{expose:t}){const n=k(!1),s=k(0),o=k(0),u=A(()=>{const f=Math.min(s.value,window.innerWidth-160-8),h=Math.min(o.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,o.value=c,n.value=!0}function i(){n.value=!1}function a(l){l.key==="Escape"&&n.value&&i()}return Pe(()=>{document.addEventListener("keydown",a)}),rr(()=>{document.removeEventListener("keydown",a)}),t({open:r,close:i,isOpen:n}),(l,c)=>(p(),ie(bn,{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(Zn,{name:"context-menu"},{default:qe(()=>[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(u.value),role:"menu",onClick:c[0]||(c[0]=H(()=>{},["stop"]))},[bo(l.$slots,"default",{},void 0,!0)],4)):D("",!0)]),_:3})]))}}),zd=os(Ld,[["__scopeId","data-v-13d6c372"]]),pn=te({__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"))},[bo(t.$slots,"default")],2))}}),Bd=["aria-label"],Rd=["fill"],si=te({__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(o=>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,Rd))],10,Bd))}}),yt="favorites",jd="aiui-favorites",Nd=1;function Lo(){return new Promise((e,t)=>{const n=indexedDB.open(jd,Nd);n.onupgradeneeded=()=>{const s=n.result;if(!s.objectStoreNames.contains(yt)){const o=s.createObjectStore(yt,{keyPath:"id"});o.createIndex("type","type",{unique:!1}),o.createIndex("savedAt","savedAt",{unique:!1})}},n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)})}async function Ud(){const e=await Lo();return new Promise((t,n)=>{const u=e.transaction(yt,"readonly").objectStore(yt).getAll();u.onsuccess=()=>t(u.result),u.onerror=()=>n(u.error)})}async function Od(e){const t=await Lo();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 qd(e){const t=await Lo();return new Promise((n,s)=>{const r=t.transaction(yt,"readwrite").objectStore(yt).delete(e);r.onsuccess=()=>n(),r.onerror=()=>s(r.error)})}const oi=Cn("favorites",()=>{const e=k([]),t=k(!1);async function n(){try{e.value=await Ud()}catch{}t.value=!0}n();const s=A(()=>[...e.value].sort((l,c)=>c.savedAt-l.savedAt));function o(l){return e.value.some(c=>c.id===l)}async function u(l){if(o(l.id))return;const c={...l,savedAt:Date.now()};e.value=[...e.value,c],Od(c).catch(()=>{})}async function r(l){e.value=e.value.filter(c=>c.id!==l),qd(l).catch(()=>{})}async function i(l){o(l.id)?await r(l.id):await u(l)}function a(l){return s.value.filter(c=>c.type===l)}return{items:e,sortedItems:s,loaded:t,isFavorited:o,addFavorite:u,removeFavorite:r,toggleFavorite:i,getFavoritesByType:a}}),Hd={class:"poster-card-sm shrink-0 w-12 aspect-[2/3] rounded-lg overflow-hidden"},Wd=["src","alt"],Vd={class:"min-w-0 flex-1 py-0.5"},Gd={class:"flex items-center gap-1.5 mt-1.5"},Kd=te({__name:"FilmCard",props:{film:{}},emits:["select"],setup(e){const t=e,{isDark:n}=He(),s=oi(),o=A(()=>t.film.id.startsWith("ext-")),u=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",Hd,[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(mi)(a,e.film.title,e.film.year))},null,40,Wd)):(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",Vd,[d("p",{class:F(["text-sm font-semibold truncate",S(n)?"text-white/90":"text-gray-900"])},_(e.film.title),3),d("p",{class:F(["text-xs mt-0.5",S(n)?"text-white/40":"text-gray-500"])},[ce(_(e.film.year),1),e.film.director?(p(),m(q,{key:0},[ce(" · "+_(e.film.director),1)],64)):D("",!0)],2),o.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"])},_(e.film.synopsis),3)):D("",!0),d("div",Gd,[e.film.rating>0?(p(),m("span",{key:0,class:F(["text-xs font-semibold px-1.5 py-0.5 rounded",u.value])}," ★ "+_(e.film.rating),3)):D("",!0),o.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,Z(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"])},_(a.type),3))),128)),pe(si,{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))}}),Jd={class:"w-12 h-auto shrink-0 rounded-md overflow-hidden shadow-md"},Zd={class:"aspect-[2/3] relative"},Yd=["src","alt"],Xd={class:"flex-1 min-w-0 py-0.5"},Qd={key:0},ef=te({__name:"BookCard",props:{book:{}},emits:["select"],setup(e){const t=e,{isDark:n}=He(),s=k(!1),o=k(null),u=A(()=>s.value?null:t.book.coverUrl||o.value),r=A(()=>bi(t.book.title,t.book.author));return Pe(()=>{t.book.coverUrl||gi(t.book.title,t.book.author).then(i=>{i&&(o.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",Jd,[d("div",Zd,[u.value?(p(),m("img",{key:0,src:u.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,Yd)):(p(),m("div",{key:1,class:"w-full h-full bg-cover bg-center",style:Se({backgroundImage:`url(${r.value})`})},null,4))])]),d("div",Xd,[d("p",{class:F(["text-sm font-medium leading-snug line-clamp-2",S(n)?"text-white/90":"text-gray-900"])},_(e.book.title),3),d("p",{class:F(["text-xs mt-0.5 truncate",S(n)?"text-white/50":"text-gray-500"])},[ce(_(e.book.author),1),e.book.year?(p(),m("span",Qd," · "+_(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"])},_(e.book.description),3)):D("",!0)])],2))}}),tf={class:"poster-card-sm shrink-0 w-12 aspect-[2/3] rounded-lg overflow-hidden"},nf=["src","alt"],sf={class:"min-w-0 flex-1 py-0.5"},of={class:"flex items-center gap-1.5 mt-1.5"},uf=te({__name:"TVSeriesCard",props:{series:{}},emits:["select"],setup(e){const t=e,{isDark:n}=He(),s=k(!1),o=k(null),u=A(()=>s.value?null:t.series.posterUrl||o.value),r=A(()=>vi(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 Pe(()=>{t.series.posterUrl||xi(t.series.title,t.series.year).then(l=>{l.posterUrl&&(o.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",tf,[u.value?(p(),m("img",{key:0,src:u.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,nf)):(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",sf,[d("p",{class:F(["text-sm font-semibold truncate",S(n)?"text-white/90":"text-gray-900"])},_(e.series.title),3),d("p",{class:F(["text-xs mt-0.5",S(n)?"text-white/40":"text-gray-500"])},[ce(_(i.value),1),e.series.network?(p(),m(q,{key:0},[ce(" · "+_(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"])},_(e.series.synopsis),3)):D("",!0),d("div",of,[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])}," ★ "+_(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"])},_(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))}}),rf={class:"cover-card-sm shrink-0 w-12 h-12 rounded-lg overflow-hidden"},af=["src","alt"],lf={class:"min-w-0 flex-1 py-0.5"},cf={class:"flex items-center gap-1.5 mt-1.5"},df=te({__name:"SongCard",props:{song:{}},emits:["select"],setup(e){const t=e,{isDark:n}=He(),s=oi(),o=k(!1),u=k(null),r=A(()=>o.value?null:t.song.coverUrl||u.value),i=A(()=>wi(t.song.title,t.song.artist)),a=A(()=>t.song.id.startsWith("ext-"));return Pe(()=>{t.song.coverUrl||yi(t.song.title,t.song.artist,t.song.album).then(l=>{l&&(u.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",rf,[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=>o.value=!0)},null,40,af)):(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",lf,[d("p",{class:F(["text-sm font-semibold truncate",S(n)?"text-white/90":"text-gray-900"])},_(e.song.title),3),d("p",{class:F(["text-xs mt-0.5",S(n)?"text-white/40":"text-gray-500"])},[ce(_(e.song.artist),1),e.song.year?(p(),m(q,{key:0},[ce(" · "+_(e.song.year),1)],64)):D("",!0)],2),d("div",cf,[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,Z((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"])},_(f.type),3))),128)),pe(si,{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))}}),ff={class:"cover-card-sm shrink-0 w-12 h-12 rounded-lg overflow-hidden"},pf=["src","alt"],hf={class:"min-w-0 flex-1 py-0.5"},mf={class:"flex items-center gap-1.5 mt-1.5"},gf=te({__name:"PodcastCard",props:{podcast:{}},emits:["select"],setup(e){const t=e,{isDark:n}=He(),s=k(!1),o=k(null),u=A(()=>s.value?null:t.podcast.coverUrl||o.value||null);Pe(()=>{t.podcast.coverUrl||ki(t.podcast.title,t.podcast.host).then(a=>{a&&(o.value=a)})});const r=A(()=>Ci(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",ff,[u.value?(p(),m("img",{key:0,src:u.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,pf)):(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",hf,[d("p",{class:F(["text-sm font-semibold truncate",S(n)?"text-white/90":"text-gray-900"])},_(e.podcast.title),3),d("p",{class:F(["text-xs mt-0.5",S(n)?"text-white/40":"text-gray-500"])},[ce(_(e.podcast.host||"Podcast"),1),e.podcast.year?(p(),m(q,{key:0},[ce(" · "+_(e.podcast.year),1)],64)):D("",!0)],2),d("div",mf,[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,Z(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.type),3))),128))])])],2))}}),bf={class:"shrink-0 w-12 h-12 rounded-lg overflow-hidden"},xf=["src","alt"],vf={class:"min-w-0 flex-1 py-0.5"},yf={class:"flex items-center gap-1.5 mt-1.5"},wf=te({__name:"PlaceCard",props:{place:{}},emits:["select"],setup(e){const t=e,{isDark:n}=He(),s=k(!1),o=k(null),u=A(()=>s.value?null:t.place.photoUrl||o.value||null);Pe(()=>{t.place.photoUrl||_i(t.place.name,t.place.city).then(a=>{a&&(o.value=a)})});const r=A(()=>Ai(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",bf,[u.value?(p(),m("img",{key:0,src:u.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,xf)):(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",vf,[d("p",{class:F(["text-sm font-semibold truncate",S(n)?"text-white/90":"text-gray-900"])},_(e.place.name),3),d("p",{class:F(["text-xs mt-0.5 truncate",S(n)?"text-white/40":"text-gray-500"])},[ce(_(e.place.cuisine||e.place.category),1),e.place.city?(p(),m(q,{key:0},[ce(" · "+_(e.place.city),1)],64)):D("",!0)],2),d("div",yf,[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])}," ★ "+_(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"])},_("$".repeat(e.place.priceLevel)),3)):D("",!0)])])],2))}}),kf={class:"cover-card-sm shrink-0 w-12 h-12 rounded-lg overflow-hidden"},Cf=["src","alt"],_f={class:"min-w-0 flex-1 py-0.5"},Xu=te({__name:"NewsCard",props:{article:{}},emits:["select-article"],setup(e){const t=e,{isDark:n}=He(),s=k(!1),o=A(()=>{if(s.value)return null;const r=t.article.imgSrc;return Di(r)?r:null}),u=A(()=>Si(t.article.title,No(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",kf,[o.value?(p(),m("img",{key:0,src:o.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,Cf)):(p(),m("div",{key:1,class:"w-full h-full rounded-[6px] bg-cover bg-center",style:Se({backgroundImage:`url(${u.value})`})},null,4))]),d("div",_f,[d("p",{class:F(["text-sm font-semibold truncate",S(n)?"text-white/90":"text-gray-900"])},_(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"])},_(e.article.content),3)):D("",!0),d("p",{class:F(["text-xs mt-1 truncate",S(n)?"text-white/30":"text-gray-400"])},_(S(No)(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))}}),ho="qpzry9x8gf2tvdw0s3jn54khce6mua7l",ui={};for(let e=0;e<ho.length;e++)ui[ho[e]]=e;function ri(e){const t=[996825010,642813549,513874426,1027748829,705979059];let n=1;for(const s of e){const o=n>>25;n=(n&33554431)<<5^s;for(let u=0;u<5;u++)o>>u&1&&(n^=t[u])}return n}function ii(e){const t=[];for(let n=0;n<e.length;n++)t.push(e.charCodeAt(n)>>5);t.push(0);for(let n=0;n<e.length;n++)t.push(e.charCodeAt(n)&31);return t}function ai(e,t,n,s){let o=0,u=0;const r=[],i=(1<<n)-1;for(const a of e){if(a<0||a>>t)return null;for(o=o<<t|a,u+=t;u>=n;)u-=n,r.push(o>>u&i)}if(s)u>0&&r.push(o<<n-u&i);else if(u>=t||o<<n-u&i)return null;return r}function li(e){const t=e.toLowerCase(),n=t.lastIndexOf("1");if(n<1||n+7>t.length||t.length>90)return null;const s=t.slice(0,n),o=t.slice(n+1),u=[];for(const a of o){const l=ui[a];if(l===void 0)return null;u.push(l)}if(ri([...ii(s),...u])!==1)return null;const r=u.slice(0,-6),i=ai(r,5,8,!1);return i?{hrp:s,data:new Uint8Array(i)}:null}function mn(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}function Af(e){const t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)t[n/2]=parseInt(e.slice(n,n+2),16);return t}function Df(e,t){const n=[...ii(e),...t,0,0,0,0,0,0],s=ri(n)^1,o=[];for(let u=0;u<6;u++)o.push(s>>5*(5-u)&31);return o}function Sf(e,t){const n=ai(Array.from(t),8,5,!0);if(!n)throw new Error("Failed to convert bits");const s=Df(e,n);return e+"1"+[...n,...s].map(o=>ho[o]).join("")}function ng(e){return Sf("npub",Af(e))}function sg(e){const t=li(e);if(!t||t.hrp!=="npub"||t.data.length!==32)throw new Error("Invalid npub");return mn(t.data)}function Ef(e){const t=li(e);if(!t)return null;const{hrp:n,data:s}=t;if(n==="npub"&&s.length===32)return{type:"npub",hex:mn(s)};if(n==="note"&&s.length===32)return{type:"note",hex:mn(s)};if(n==="nevent"||n==="nprofile"){let o="";const u=[];let r=0;for(;r<s.length;){const i=s[r],a=s[r+1];if(a===void 0)break;const l=s.slice(r+2,r+2+a);i===0&&(o=mn(l)),i===1&&u.push(new TextDecoder().decode(l)),r+=2+a}return{type:n==="nevent"?"nevent":"nprofile",hex:o,relays:u.length>0?u:void 0}}return{type:"unknown",hex:mn(s)}}const $f={key:0,class:"flex items-center gap-2"},Ff={class:"flex-1 space-y-1"},Mf={key:1,class:"flex items-center gap-2"},Tf={key:2},If={class:"flex items-center gap-2 mb-1.5"},Pf={class:"flex items-center gap-2 mt-1.5"},Lf={key:3},zf={class:"flex items-center gap-2"},Bf=te({__name:"NostrEmbed",props:{uri:{}},setup(e){const t=e,{isDark:n}=He(),{connect:s,fetchNote:o}=Pi(),u=k(null),r=k(!1),i=k(!1),a=A(()=>{const h=t.uri.replace(/^nostr:/,"");return Ef(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 Pe(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 o(h);r.value=!1,b?u.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",$f,[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",Ff,[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",Mf,[d("span",{class:F(["text-xs",S(n)?"text-white/30":"text-gray-400"])},_(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.value),3)])):u.value?(p(),m("div",Tf,[d("div",If,[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"])},_(u.value.authorName?.charAt(0)?.toUpperCase()??"?"),3),d("span",{class:F(["text-xs font-semibold truncate",S(n)?"text-white/70":"text-gray-700"])},_(u.value.authorName??"anon"),3),d("span",{class:F(["text-xs ml-auto shrink-0",S(n)?"text-white/20":"text-gray-300"])},_(f(u.value.created_at)),3)]),d("p",{class:F(["text-xs leading-relaxed line-clamp-4",S(n)?"text-white/60":"text-gray-600"])},_(u.value.content),3),d("div",Pf,[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",Lf,[d("div",zf,[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.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.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 Rf(e){return e.trim().startsWith("cashuA")}function jf(e){const t=/cashuA[A-Za-z0-9_-]+/g;return[...e.matchAll(t)].map(n=>n[0])}function Nf(e){if(!Rf(e))return null;try{const n=e.slice(6).replace(/-/g,"+").replace(/_/g,"/"),s=atob(n),o=JSON.parse(s);if(!o.token||!Array.isArray(o.token)||o.token.length===0)return null;const u=o.token[0],r=u.proofs.reduce((i,a)=>i+a.amount,0);return{mint:u.mint,amount:r,unit:o.unit??"sat",memo:o.memo,raw:e}}catch{return null}}function Uf(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 Of(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 qf={class:"flex items-center gap-2"},Hf={class:"ml-auto text-sm font-bold text-[#F7931A]"},Wf={class:"flex gap-2"},Vf=te({__name:"CashuToken",props:{token:{}},setup(e){const{isDark:t}=He(),n=e,s=k(!1),o=A(()=>Nf(n.token)),u=A(()=>o.value?Of(o.value.amount,o.value.unit):""),r=A(()=>o.value?Uf(o.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)=>o.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",qf,[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",Hf,_(u.value),1)]),d("div",{class:F(["text-xs font-mono",S(t)?"text-white/30":"text-gray-400"])}," Mint: "+_(r.value),3),o.value.memo?(p(),m("div",{key:0,class:F(["text-xs",S(t)?"text-white/50":"text-gray-500"])},_(o.value.memo),3)):D("",!0),d("div",Wf,[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},_(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"])},_(i.value),3))}}),Gf={class:"recipe-card rounded-xl bg-white/5 border border-white/10 overflow-hidden"},Kf={class:"px-4 py-3 border-b border-white/5"},Jf={class:"text-sm font-semibold text-white/90"},Zf={class:"flex gap-3 mt-1.5"},Yf={key:0,class:"text-xs text-white/40 flex items-center gap-1"},Xf={key:1,class:"text-xs text-white/40 flex items-center gap-1"},Qf={key:2,class:"text-xs text-white/40"},ep={class:"px-4 py-2 border-b border-white/5 flex items-center gap-3"},tp={class:"text-xs text-white/50 tabular-nums w-8 text-right"},np={class:"px-4 py-3 border-b border-white/5"},sp={class:"space-y-1"},op=["onClick"],up={key:0,class:"w-2.5 h-2.5 text-accent",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},rp={class:"px-4 py-3"},ip={class:"space-y-2"},ap={class:"shrink-0 w-5 h-5 rounded-full bg-accent/15 text-accent text-xs flex items-center justify-center font-medium"},lp={class:"leading-relaxed"},cp=te({__name:"RecipeCard",props:{recipe:{}},setup(e){const t=e,n=k(1),s=Ei(new Set),o=A(()=>{const i=parseInt(t.recipe.servings||"0",10);return i?Math.round(i*n.value):t.recipe.servings}),u=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",Gf,[d("div",Kf,[d("h3",Jf,_(e.recipe.title),1),d("div",Zf,[e.recipe.time?(p(),m("span",Yf,[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(" "+_(e.recipe.time),1)])):D("",!0),e.recipe.servings?(p(),m("span",Xf,[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(" "+_(o.value)+" servings ",1)])):D("",!0),e.recipe.calories?(p(),m("span",Qf,_(e.recipe.calories)+" cal",1)):D("",!0)])]),d("div",ep,[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),[[Me,n.value,void 0,{number:!0}]]),d("span",tp,_(n.value)+"×",1)]),d("div",np,[a[5]||(a[5]=d("h4",{class:"text-xs text-white/40 uppercase tracking-wider mb-2"},"Ingredients",-1)),d("ul",sp,[(p(!0),m(q,null,Z(u.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",up,[...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(" "+_(l),1)],10,op))),128))])]),d("div",rp,[a[6]||(a[6]=d("h4",{class:"text-xs text-white/40 uppercase tracking-wider mb-2"},"Steps",-1)),d("ol",ip,[(p(!0),m(q,null,Z(e.recipe.steps,(l,c)=>(p(),m("li",{key:c,class:"flex gap-2 text-xs text-white/70"},[d("span",ap,_(c+1),1),d("span",lp,_(l),1)]))),128))])])]))}}),dp={class:"event-card rounded-xl bg-white/5 border border-white/10 px-4 py-3"},fp={class:"flex items-start gap-3"},pp={class:"shrink-0 w-14 text-center rounded-lg bg-accent/10 border border-accent/20 py-1.5"},hp={class:"text-xs text-accent/70 uppercase"},mp={class:"text-lg font-bold text-accent leading-tight"},gp={class:"flex-1 min-w-0"},bp={class:"text-sm font-semibold text-white/90 truncate"},xp={key:0,class:"text-xs text-white/50 mt-0.5 truncate"},vp={key:1,class:"text-xs text-white/40 mt-1 line-clamp-2"},yp={class:"flex gap-2 mt-2"},wp=["href"],kp=te({__name:"EventCard",props:{event:{}},setup(e){const t=e,n=k(Date.now());let s=null;Pe(()=>{s=setInterval(()=>{n.value=Date.now()},1e3)}),xo(()=>{s&&clearInterval(s)});const o=A(()=>{if(!t.event.date)return null;const h=new Date(t.event.date);return isNaN(h.getTime())?null:h}),u=A(()=>o.value?o.value.toLocaleString("en",{month:"short"}).toUpperCase():"?"),r=A(()=>o.value?o.value.getDate():"?"),i=A(()=>o.value?o.value.getTime()<n.value:!1),a=A(()=>{if(!o.value)return"";const h=o.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)),x=Math.floor(h%(1e3*60*60)/(1e3*60));return b>0?`${b}d ${g}h remaining`:g>0?`${g}h ${x}m remaining`:`${x}m remaining`});function l(h){return h.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,"")}function c(){const h=o.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
`),x=new Blob([g],{type:"text/calendar"}),E=URL.createObjectURL(x),C=document.createElement("a");C.href=E,C.download=`${t.event.title.replace(/[^a-zA-Z0-9]/g,"_")}.ics`,C.click(),URL.revokeObjectURL(E)}const f=A(()=>{const h=o.value;if(!h)return"#";const b=l(h).replace("Z",""),g=l(new Date(h.getTime()+3600*1e3)).replace("Z",""),x=new URLSearchParams({action:"TEMPLATE",text:t.event.title,dates:`${b}/${g}`});return t.event.location&&x.set("location",t.event.location),t.event.description&&x.set("details",t.event.description),`https://calendar.google.com/calendar/render?${x.toString()}`});return(h,b)=>(p(),m("div",dp,[d("div",fp,[d("div",pp,[d("p",hp,_(u.value),1),d("p",mp,_(r.value),1)]),d("div",gp,[d("h3",bp,_(e.event.title),1),e.event.location?(p(),m("p",xp,_(e.event.location),1)):D("",!0),e.event.description?(p(),m("p",vp,_(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"])},_(a.value),3)):D("",!0),d("div",yp,[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,wp)])])])]))}}),Cp={class:"interactive-table my-4 rounded-lg bg-white/5 border border-white/5 overflow-hidden"},_p={class:"flex items-center gap-2 px-3 py-2 border-b border-white/5"},Ap={class:"overflow-x-auto"},Dp={class:"w-full text-xs"},Sp={class:"border-b border-white/10"},Ep=["onClick"],$p={class:"inline-flex items-center gap-1"},Fp={key:0,class:"text-accent"},Mp={key:0,class:"px-3 py-4 text-center text-xs text-white/30"},Tp={key:1,class:"px-3 py-1.5 text-xs text-white/25 border-t border-white/5"},Ip={key:0},Pp=te({__name:"InteractiveTable",props:{headers:{},rows:{}},setup(e){const t=e,n=k(""),s=k(-1),o=k("asc");function u(f){s.value===f?o.value=o.value==="asc"?"desc":"asc":(s.value=f,o.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=o.value==="asc"?1:-1;return[...r.value].sort((b,g)=>{const x=b[f]||"",E=g[f]||"",C=parseFloat(x),y=parseFloat(E);return!isNaN(C)&&!isNaN(y)?(C-y)*h:x.localeCompare(E)*h})}),a=A(()=>i.value);function l(){const f=t.headers.map(c).join(","),h=t.rows.map(C=>C.map(c).join(",")).join(`
`),b=f+`
`+h,g=new Blob([b],{type:"text/csv"}),x=URL.createObjectURL(g),E=document.createElement("a");E.href=x,E.download="table.csv",E.click(),URL.revokeObjectURL(x)}function c(f){return f.includes(",")||f.includes('"')||f.includes(`
`)?`"${f.replace(/"/g,'""')}"`:f}return(f,h)=>(p(),m("div",Cp,[d("div",_p,[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),[[Me,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",Ap,[d("table",Dp,[d("thead",null,[d("tr",Sp,[(p(!0),m(q,null,Z(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:x=>u(g)},[d("span",$p,[ce(_(b)+" ",1),s.value===g?(p(),m("span",Fp,_(o.value==="asc"?"↑":"↓"),1)):D("",!0)])],8,Ep))),128))])]),d("tbody",null,[(p(!0),m(q,null,Z(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,Z(b,(x,E)=>(p(),m("td",{key:E,class:"px-3 py-1.5 text-white/70 whitespace-nowrap"},_(x),1))),128))]))),128))])])]),r.value.length===0?(p(),m("div",Mp," No matching rows ")):D("",!0),r.value.length>0?(p(),m("div",Tp,[ce(_(r.value.length)+" row"+_(r.value.length===1?"":"s")+" ",1),n.value?(p(),m("span",Ip," (filtered from "+_(e.rows.length)+")",1)):D("",!0)])):D("",!0)]))}}),Lp={class:"timeline-renderer my-4"},zp={class:"relative"},Bp={class:"text-xs text-white/40 tabular-nums pt-1"},Rp={class:"ml-10 md:ml-0 md:w-[calc(50%-2rem)] shrink-0"},jp={class:"rounded-lg bg-white/5 border border-white/10 px-3 py-2"},Np={class:"text-xs text-white/30 md:hidden tabular-nums"},Up={class:"text-xs font-medium text-white/90"},Op={key:0,class:"text-xs text-white/40 mt-0.5"},qp={key:1,class:"text-xs text-white/50 mt-1 line-clamp-2"},Hp=te({__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",Lp,[d("div",zp,[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,Z(e.events,(o,u)=>(p(),m("div",{key:u,class:F(["relative flex items-start gap-4 mb-6 animate-fade-up-fast",u%2===0?"md:flex-row":"md:flex-row-reverse"]),style:Se({animationDelay:`${u*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",u%2===0?"":"order-last text-left"])},[d("p",Bp,_(t(o.date)),1)],2),d("div",Rp,[d("div",jp,[d("p",Np,_(t(o.date)),1),d("h4",Up,_(o.title),1),o.location?(p(),m("p",Op,_(o.location),1)):D("",!0),o.description?(p(),m("p",qp,_(o.description),1)):D("",!0)])])],6))),128))])]))}}),Wp={class:"code-runner rounded-xl bg-white/5 border border-white/10 overflow-hidden"},Vp={class:"flex items-center gap-2 px-3 py-2 border-b border-white/5"},Gp={class:"text-xs text-white/30 uppercase tracking-wider"},Kp={class:"px-3 py-2 text-xs text-white/70 overflow-x-auto max-h-48 bg-black/20"},Jp=["srcdoc"],Zp={key:1,class:"border-t border-white/5 bg-black/30 px-3 py-2 max-h-32 overflow-y-auto"},Yp=te({__name:"CodeRunner",props:{code:{},language:{}},setup(e){const t=e,n=k([]),s=k(!1),o=k(null),u=A(()=>t.language==="html"),r=A(()=>i(t.language,t.code));function i(f,h){const b="<script>",g="<\/script>",x=b+'const _post=(t,a)=>parent.postMessage({type:"code-runner-console",level:t,text:a.map(x=>typeof x==="object"?JSON.stringify(x):String(x)).join(" ")},"*");console.log=(...a)=>_post("log",a);console.error=(...a)=>_post("error",a);window.onerror=(m)=>_post("error",[m]);'+g;return f==="html"?"<!DOCTYPE html><html><head><style>body{background:#0a0a0a;color:#e0e0e0;font-family:system-ui;margin:8px}</style>"+x+"</head><body>"+h+"</body></html>":f==="javascript"||f==="js"?"<!DOCTYPE html><html><head>"+x+"</head><body>"+b+h+g+"</body></html>":f==="css"?"<!DOCTYPE html><html><head><style>"+h+'</style></head><body style="background:#0a0a0a"><div style="padding:16px;color:#e0e0e0;font-family:system-ui">CSS Preview</div></body></html>':""}function a(){n.value=[],s.value=!1,requestAnimationFrame(()=>{s.value=!0})}function l(){n.value=[]}function c(f){f.data?.type==="code-runner-console"&&n.value.push({type:f.data.level==="error"?"error":"log",text:f.data.text})}return Pe(()=>{window.addEventListener("message",c)}),xo(()=>{window.removeEventListener("message",c)}),(f,h)=>(p(),m("div",Wp,[d("div",Vp,[d("span",Gp,_(e.language),1),h[0]||(h[0]=d("div",{class:"flex-1"},null,-1)),d("button",{class:"text-xs px-2.5 py-1 rounded bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors",onClick:a}," Run "),n.value.length>0?(p(),m("button",{key:0,class:"text-xs px-2 py-1 rounded bg-white/5 text-white/40 hover:text-white/60 hover:bg-white/10 transition-colors",onClick:l}," Clear ")):D("",!0)]),d("pre",Kp,[d("code",null,_(e.code),1)]),s.value?(p(),m("iframe",{key:0,ref_key:"iframeRef",ref:o,srcdoc:r.value,sandbox:"allow-scripts",class:F(["w-full border-t border-white/5",u.value?"h-48":"h-0 invisible"]),title:"Code output"},null,10,Jp)):D("",!0),n.value.length>0?(p(),m("div",Zp,[h[1]||(h[1]=d("p",{class:"text-xs text-white/20 uppercase tracking-wider mb-1"},"Console",-1)),(p(!0),m(q,null,Z(n.value,(b,g)=>(p(),m("div",{key:g,class:F(["text-xs font-mono leading-relaxed",b.type==="error"?"text-red-400/80":"text-white/60"])},_(b.text),3))),128))])):D("",!0)]))}}),Xp={class:"rounded-xl bg-white/5 border border-white/10 p-3 space-y-2"},Qp={class:"flex items-center gap-2"},e1={class:"text-xs px-1.5 py-0.5 rounded bg-white/5 text-white/30"},t1={class:"text-xs font-mono text-white/70 break-all leading-relaxed select-all"},n1={class:"flex justify-center py-2"},s1={class:"flex gap-2"},o1=["href"],u1=te({__name:"BitcoinAddressCard",props:{address:{}},setup(e){const t=e,n=k(null),s=k(!1),o=A(()=>{const a=t.address;return a.startsWith("bc1q")?"SegWit (bech32)":a.startsWith("bc1p")?"Taproot (bech32m)":a.startsWith("1")?"Legacy (P2PKH)":a.startsWith("3")?"Nested SegWit (P2SH)":a.startsWith("tb1")||a.startsWith("2")||a.startsWith("m")||a.startsWith("n")?"Testnet":"Unknown"}),u=A(()=>`https://mempool.space/address/${t.address}`);function r(){navigator.clipboard.writeText(t.address),s.value=!0,setTimeout(()=>{s.value=!1},2e3)}function i(){const a=n.value;if(!a)return;const l=a.getContext("2d");if(!l)return;l.fillStyle="#1a1a1a",l.fillRect(0,0,160,160),l.fillStyle="#F7931A",l.font="8px monospace",l.textAlign="center";const c=`bitcoin:${t.address}`,f=[];for(let b=0;b<c.length;b+=24)f.push(c.slice(b,b+24));const h=Math.max(10,80-f.length*5);f.forEach((b,g)=>{l.fillText(b,80,h+g*10)})}return Pe(()=>{i()}),(a,l)=>(p(),m("div",Xp,[d("div",Qp,[l[0]||(l[0]=d("span",{class:"text-xs text-accent/60 uppercase tracking-wider font-bold"},"Bitcoin Address",-1)),d("span",e1,_(o.value),1)]),d("p",t1,_(e.address),1),d("div",n1,[d("canvas",{ref_key:"qrCanvas",ref:n,class:"rounded-lg",width:"160",height:"160"},null,512)]),d("div",s1,[d("button",{class:"flex-1 py-2 rounded-lg text-xs bg-white/5 text-white/50 hover:text-white/70 hover:bg-white/10 transition-colors",onClick:r},_(s.value?"Copied!":"Copy Address"),1),d("a",{href:u.value,target:"_blank",rel:"noopener noreferrer",class:"flex-1 py-2 rounded-lg text-xs text-center bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors"}," View on Mempool ",8,o1)])]))}}),r1={class:"rounded-xl bg-white/5 border border-white/10 p-3 space-y-2"},i1={class:"flex items-center gap-2"},a1={key:0,class:"text-xs px-1.5 py-0.5 rounded bg-red-400/15 text-red-400/80"},l1={key:0,class:"flex items-center gap-2"},c1={class:"text-lg font-bold text-accent tabular-nums"},d1={key:1,class:"text-xs text-white/50"},f1={key:2,class:"flex items-center gap-1.5"},p1={class:"text-xs font-mono text-white/30 break-all line-clamp-2 select-all"},h1={class:"flex gap-2"},m1=["href"],g1=te({__name:"Bolt11InvoiceCard",props:{invoice:{}},setup(e){const t=e,n=k(!1),s=k(Math.floor(Date.now()/1e3));let o=null;const u=A(()=>{const g=t.invoice.toLowerCase().match(/^lnbc(\d+)([munp]?)1/);if(!g)return null;const x=parseInt(g[1]);switch(g[2]){case"m":return x*1e5;case"u":return x*100;case"n":return Math.round(x*.1);case"p":return Math.round(x*1e-4);default:return x*1e8}}),r=A(()=>null),i=A(()=>null),a=A(()=>i.value?s.value>i.value:!1),l=A(()=>i.value?i.value-s.value<300:!1),c=A(()=>{if(!i.value)return null;const b=i.value-s.value;if(b<=0)return"Expired";const g=Math.floor(b/60);return g<60?`Expires in ${g}m`:`Expires in ${Math.floor(g/60)}h ${g%60}m`});function f(b){return b.toLocaleString()}function h(){navigator.clipboard.writeText(t.invoice),n.value=!0,setTimeout(()=>{n.value=!1},2e3)}return Pe(()=>{o=setInterval(()=>{s.value=Math.floor(Date.now()/1e3)},1e3)}),xo(()=>{o&&clearInterval(o)}),(b,g)=>(p(),m("div",r1,[d("div",i1,[g[0]||(g[0]=d("span",{class:"text-xs text-accent/60 uppercase tracking-wider font-bold"},"Lightning Invoice",-1)),a.value?(p(),m("span",a1," Expired ")):D("",!0)]),u.value?(p(),m("div",l1,[d("span",c1,_(f(u.value)),1),g[1]||(g[1]=d("span",{class:"text-xs text-white/30"},"sats",-1))])):D("",!0),r.value?(p(),m("p",d1,_(r.value),1)):D("",!0),c.value?(p(),m("div",f1,[d("span",{class:F(["text-xs tabular-nums",a.value||l.value?"text-red-400/60":"text-white/30"])},_(c.value),3)])):D("",!0),d("p",p1,_(e.invoice),1),d("div",h1,[d("button",{class:"flex-1 py-2 rounded-lg text-xs bg-white/5 text-white/50 hover:text-white/70 hover:bg-white/10 transition-colors",onClick:h},_(n.value?"Copied!":"Copy"),1),d("a",{href:"lightning:"+e.invoice,class:"flex-1 py-2 rounded-lg text-xs text-center bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors"}," Pay with wallet ",8,m1)])]))}}),b1={class:"rounded-xl bg-white/5 border border-white/10 p-3 space-y-2"},x1={class:"text-xs font-mono text-white/50 break-all line-clamp-2 select-all"},v1={class:"flex justify-center py-2"},y1={class:"flex gap-2"},w1=["href"],k1=te({__name:"Bolt12OfferCard",props:{offer:{}},setup(e){const t=e,n=k(null),s=k(!1);function o(){navigator.clipboard.writeText(t.offer),s.value=!0,setTimeout(()=>{s.value=!1},2e3)}function u(){const r=n.value;if(!r)return;const i=r.getContext("2d");if(!i)return;i.fillStyle="#1a1a1a",i.fillRect(0,0,140,140),i.fillStyle="#F7931A",i.font="7px monospace",i.textAlign="center";const a=[];for(let c=0;c<t.offer.length;c+=22)a.push(t.offer.slice(c,c+22));const l=Math.max(8,70-a.length*4);a.slice(0,14).forEach((c,f)=>{i.fillText(c,70,l+f*9)})}return Pe(()=>{u()}),(r,i)=>(p(),m("div",b1,[i[0]||(i[0]=d("div",{class:"flex items-center gap-2"},[d("span",{class:"text-xs text-accent/60 uppercase tracking-wider font-bold"},"BOLT12 Offer")],-1)),d("p",x1,_(e.offer),1),d("div",v1,[d("canvas",{ref_key:"qrCanvas",ref:n,class:"rounded-lg",width:"140",height:"140"},null,512)]),d("div",y1,[d("button",{class:"flex-1 py-2 rounded-lg text-xs bg-white/5 text-white/50 hover:text-white/70 hover:bg-white/10 transition-colors",onClick:o},_(s.value?"Copied!":"Copy Offer"),1),d("a",{href:"lightning:"+e.offer,class:"flex-1 py-2 rounded-lg text-xs text-center bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors"}," Pay with wallet ",8,w1)])]))}}),C1={class:"rounded-xl bg-white/5 border border-white/10 p-3 space-y-2"},_1={class:"flex items-center gap-2"},A1={class:"text-xs font-mono text-white/40 break-all select-all"},D1={key:0,class:"grid grid-cols-2 gap-2 text-xs"},S1={class:"text-white/60 tabular-nums"},E1={class:"text-white/60 tabular-nums"},$1={class:"text-white/60 tabular-nums"},F1={class:"text-white/60 tabular-nums"},M1={key:1,class:"py-2"},T1={key:2,class:"py-2"},I1={class:"text-xs text-red-400/60"},P1=["href"],L1=te({__name:"MempoolTxCard",props:{txid:{}},setup(e){const t=e,n=k(null),s=k(!0),o=k("");async function u(){s.value=!0,o.value="";try{const r=await fetch(`https://mempool.space/api/tx/${t.txid}`);if(!r.ok)throw new Error("Transaction not found");const i=await r.json(),a=!!i.status?.confirmed;let l=0;if(a&&i.status?.block_height){const c=await fetch("https://mempool.space/api/blocks/tip/height");c.ok&&(l=parseInt(await c.text())-i.status.block_height+1)}n.value={fee:i.fee??0,feeRate:i.weight?Math.round(i.fee/i.weight*4):0,size:i.weight?Math.round(i.weight/4):i.size??0,confirmed:a,confirmations:l,blockHeight:i.status?.block_height??null}}catch(r){o.value=r instanceof Error?r.message:"Failed to load transaction"}finally{s.value=!1}}return Pe(()=>{u()}),(r,i)=>(p(),m("div",C1,[d("div",_1,[i[0]||(i[0]=d("span",{class:"text-xs text-accent/60 uppercase tracking-wider font-bold"},"Transaction",-1)),n.value?(p(),m("span",{key:0,class:F(["text-xs px-1.5 py-0.5 rounded",n.value.confirmed?"bg-emerald-400/15 text-emerald-400/80":"bg-yellow-400/15 text-yellow-400/80"])},_(n.value.confirmed?`${n.value.confirmations} confirmations`:"Unconfirmed"),3)):D("",!0)]),d("p",A1,_(e.txid),1),n.value?(p(),m("div",D1,[d("div",null,[i[1]||(i[1]=d("p",{class:"text-white/25"},"Fee",-1)),d("p",S1,_(n.value.fee.toLocaleString())+" sats",1)]),d("div",null,[i[2]||(i[2]=d("p",{class:"text-white/25"},"Fee Rate",-1)),d("p",E1,_(n.value.feeRate)+" sat/vB",1)]),d("div",null,[i[3]||(i[3]=d("p",{class:"text-white/25"},"Size",-1)),d("p",$1,_(n.value.size)+" vB",1)]),d("div",null,[i[4]||(i[4]=d("p",{class:"text-white/25"},"Block",-1)),d("p",F1,_(n.value.blockHeight??"Pending"),1)])])):s.value?(p(),m("div",M1,[...i[5]||(i[5]=[d("p",{class:"text-xs text-white/30"},"Loading transaction...",-1)])])):o.value?(p(),m("div",T1,[d("p",I1,_(o.value),1)])):D("",!0),d("a",{href:`https://mempool.space/tx/${e.txid}`,target:"_blank",rel:"noopener noreferrer",class:"block w-full py-2 rounded-lg text-xs text-center bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors"}," View on Mempool.space ",8,P1)]))}}),z1=/\b(bc1q[a-z0-9]{38,62})\b/gi,B1=/\b(bc1p[a-z0-9]{38,62})\b/gi,R1=/\b(1[13456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{25,34})\b/g,j1=/\b(3[13456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{25,34})\b/g,N1=/\b(tb1[a-z0-9]{38,62})\b/gi,U1=/\b(lnbc[a-z0-9]+)\b/gi,O1=/\b(lno1[a-z0-9]+)\b/gi,q1=/\b([a-f0-9]{64})\b/gi;function H1(e){const t=[],n=new Set;for(const s of e.matchAll(z1))n.has(s[1].toLowerCase())||(n.add(s[1].toLowerCase()),t.push({address:s[1],type:"bech32"}));for(const s of e.matchAll(B1))n.has(s[1].toLowerCase())||(n.add(s[1].toLowerCase()),t.push({address:s[1],type:"bech32m"}));for(const s of e.matchAll(R1))n.has(s[1])||(n.add(s[1]),t.push({address:s[1],type:"p2pkh"}));for(const s of e.matchAll(j1))n.has(s[1])||(n.add(s[1]),t.push({address:s[1],type:"p2sh"}));for(const s of e.matchAll(N1))n.has(s[1].toLowerCase())||(n.add(s[1].toLowerCase()),t.push({address:s[1],type:"testnet"}));return t}function W1(e){const t=[],n=new Set;for(const s of e.matchAll(U1)){const o=s[1].toLowerCase();n.has(o)||(n.add(o),t.push({invoice:s[1]}))}return t}function V1(e){const t=[],n=new Set;for(const s of e.matchAll(O1)){const o=s[1].toLowerCase();n.has(o)||(n.add(o),t.push({offer:s[1]}))}return t}function G1(e){const t=[],n=new Set;for(const s of e.matchAll(q1))n.has(s[1])||(n.add(s[1]),t.push({txid:s[1]}));return t}const Qu=/^(\|[^\n]+\|)\n(\|[\s:|-]+\|)\n((?:\|[^\n]+\|\n?)+)/gm;function K1(e){const t=[];let n;const s=new RegExp(Qu.source,Qu.flags);for(;(n=s.exec(e))!==null;){const o=n[1],u=n[3],r=er(o),i=u.trim().split(`
`).map(er).filter(a=>a.length>0);r.length>0&&i.length>0&&t.push({headers:r,rows:i,raw:n[0]})}return t}function er(e){return e.replace(/^\|/,"").replace(/\|$/,"").split("|").map(t=>t.trim())}const J1=new Set(["html","javascript","js","css"]),tr=/```(html|javascript|js|css)\n([\s\S]*?)```/gi;function Z1(e){const t=[];let n;const s=new RegExp(tr.source,tr.flags);for(;(n=s.exec(e))!==null;){const o=n[1].toLowerCase(),u=n[2].trim();J1.has(o)&&u.length>0&&t.push({language:o,code:u})}return t}const Y1={class:"relative max-w-[85%] md:max-w-[75%]"},X1={class:"flex items-center gap-2 px-1 py-0.5 rounded-lg bg-black/60 backdrop-blur-md border border-white/10 shadow-lg"},Q1={key:3,class:"w-px h-4 bg-white/10 mx-0.5"},eh=["onKeydown"],th={key:0,class:"flex gap-2 flex-wrap mb-2"},nh=["src","alt"],sh=["innerHTML"],oh={key:2,class:"text-sm leading-relaxed whitespace-pre-wrap break-words text-white/90"},uh={key:21,class:"flex items-center gap-2 mt-1.5"},rh={class:"text-xs select-none text-white/30"},ih={key:0,class:"text-xs text-white/25 select-none"},ah=["title"],lh={key:2,class:"text-xs select-none"},ch=te({__name:"ChatMessage",props:{message:{},index:{},triggeringQuery:{default:""}},emits:["edit","regenerate","branch","reply","feedback"],setup(e,{emit:t}){const n=e,s=t;function o(N){const $=n.message.feedback===N?void 0:N;s("feedback",n.message.id,$)}const u=k(!1),r=k(""),i=k(null);function a(){r.value=n.message.content,u.value=!0,Fe(()=>{i.value?.focus(),i.value&&(i.value.style.height="auto",i.value.style.height=i.value.scrollHeight+"px")})}function l(){u.value=!1,r.value=""}function c(){const N=r.value.trim();N&&(s("edit",n.message.id,N),u.value=!1,r.value="")}const{getContextualInlineContent:f,stripContentTags:h,stripMarkdownLinks:b,updatePanelFromText:g,panelOpen:x,availableTabs:E,setActiveTab:C,openFilmDetail:y,openBookDetail:v,openTVSeriesDetail:w,openPlaceDetail:M,openSongDetail:P,openPodcastDetail:U,openArticleDetail:oe,openWebsiteDetail:j,openLongFormArticle:R,openMapView:X,closeFilmDetail:Q,closeBookDetail:K,closeTVSeriesDetail:I,closePlaceDetail:Y,closeSongDetail:he,closePodcastDetail:be}=is(),Ke=wo(),ee=A(()=>n.message.role==="user"),Ae=A(()=>ee.value?{films:[],books:[],tvSeries:[],images:[],places:[],songs:[],podcasts:[],newsLinks:[],websitesLinks:[],magazineSections:[]}:f(n.message.content,n.triggeringQuery,n.message.webResults??[])),ct=A(()=>ee.value?"path-glass-bubble-user rounded-br-md rounded-2xl":"path-glass-bubble rounded-bl-md rounded-2xl"),O=A(()=>Ae.value.films),W=A(()=>Ae.value.books??[]),ae=A(()=>Ae.value.tvSeries??[]),xe=A(()=>Ae.value.images??[]),T=A(()=>Ae.value.places??[]),J=A(()=>Ae.value.songs),me=A(()=>Ae.value.podcasts),ye=A(()=>Ae.value.newsLinks??[]),we=A(()=>Ae.value.websitesLinks??[]),Ee=A(()=>Ae.value.magazineSections??[]),Re=/nostr:(note1[a-z0-9]{58}|npub1[a-z0-9]{58}|nevent1[a-z0-9]+|nprofile1[a-z0-9]+)/g,z=A(()=>{if(ee.value)return[];const N=n.message.content.match(Re);return N?[...new Set(N)]:[]}),L=A(()=>ee.value?[]:jf(n.message.content)),se=A(()=>ee.value?[]:ao(n.message.content)),le=A(()=>ee.value?[]:K1(n.message.content)),ne=A(()=>ee.value?[]:Ja(n.message.content)),ve=A(()=>ee.value?[]:Z1(n.message.content)),$e=A(()=>ee.value?[]:H1(n.message.content)),$t=A(()=>ee.value?[]:W1(n.message.content)),kt=A(()=>ee.value?[]:V1(n.message.content)),Ct=A(()=>ee.value?[]:G1(n.message.content)),dt=A(()=>!ee.value&&n.triggeringQuery.trim().toLowerCase()==="/code"),_t=A(()=>!ee.value&&(dt.value||O.value.length>0||W.value.length>0||ae.value.length>0||xe.value.length>0||J.value.length>0||me.value.length>0||ye.value.length>0||we.value.length>0||Ee.value.length>0)),ft=new Be({html:!1,linkify:!0,breaks:!0}),pt=ft.renderer.rules.link_open||function(N,$,B,ue,ot){return ot.renderToken(N,$,B)};ft.renderer.rules.link_open=function(N,$,B,ue,ot){return N[$].attrSet("target","_blank"),N[$].attrSet("rel","noopener noreferrer"),pt(N,$,B,ue,ot)};const Je=A(()=>{if(ee.value)return n.message.content;let N=h(n.message.content);if((ye.value.length>0||we.value.length>0)&&(N=b(N)),z.value.length>0&&(N=N.replace(Re,"").replace(/\n{3,}/g,`

`).trim()),L.value.length>0){for(const $ of L.value)N=N.replace($,"");N=N.replace(/\n{3,}/g,`

`).trim()}return N}),At=A(()=>ft.render(Je.value)),nt=k("");Ce(At,async N=>{let $=N;nt.value=N,Ed(Je.value)&&($=await $d($)),Td(Je.value)&&($=await Pd($)),nt.value=$},{immediate:!0});const st=A(()=>new Date(n.message.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})),En=A(()=>{if(ee.value)return!1;const N=n.message.content,$=N.split(/\s+/).length,B=/^#{2,3}\s+.+$/m.test(N);return $>800&&B}),Ft=A(()=>Math.ceil(n.message.content.length/4)),Mt=A(()=>n.message.content.length>20),Vt=A(()=>{const N=Ft.value;return N>=1e3?`${(N/1e3).toFixed(1)}k tok`:`${N} tok`});function fe(){g(n.message.content,n.triggeringQuery,n.message.webResults??[])}function ge(N){fe(),he(),be(),y(N)}function fs(N){fe(),Q(),I(),he(),be(),v(N)}function ps(N){fe(),Q(),K(),he(),be(),w(N)}function hs(N){fe(),Q(),K(),be(),P(N)}function ms(N){fe(),Q(),K(),Y(),M(N)}function gs(N){fe(),Q(),he(),U(N)}function Le(){Q(),K(),I(),he(),be(),fe()}function bs(N){fe(),oe(N)}function xs(N){fe(),j(N)}function vs(){Ke.enterCodeMode(),x.value=!0,E.value.includes("code")||(E.value=[...E.value,"code"]),C("code")}function ys(){if(dt.value){vs();return}_t.value&&Le()}const Ze=k(null);function ws(N){Ze.value?.open(N.clientX,N.clientY)}function ks(){Ze.value?.close(),a()}function Cs(){Ze.value?.close(),s("regenerate")}function ht(){Ze.value?.close(),s("reply",n.message.id,n.message.content)}function je(){Ze.value?.close(),s("branch",n.message.id)}function Ne(){Ze.value?.close(),navigator.clipboard.writeText(n.message.content).catch(()=>{})}return(N,$)=>(p(),m("div",{class:F(["group/msg flex animate-fade-up-fast",ee.value?"justify-end":"justify-start"]),style:Se({animationDelay:`${e.index*30}ms`}),onContextmenu:H(ws,["prevent"])},[d("div",Y1,[u.value?D("",!0):(p(),m("div",{key:0,class:F(["absolute -top-4 opacity-0 group-hover/msg:opacity-100 transition-opacity duration-200 z-10",ee.value?"right-1":"left-1"])},[d("div",X1,[ee.value?(p(),m("button",{key:0,class:"touch-target rounded-md text-white/50 hover:text-white/90 hover:bg-white/10 transition-colors",title:"Edit message","aria-label":"Edit message",onClick:H(a,["stop"])},[...$[28]||($[28]=[d("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-3.5 h-3.5",viewBox:"0 0 20 20",fill:"currentColor"},[d("path",{d:"M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"})],-1)])])):D("",!0),ee.value?D("",!0):(p(),m("button",{key:1,class:"touch-target rounded-md text-white/50 hover:text-white/90 hover:bg-white/10 transition-colors",title:"Regenerate response","aria-label":"Regenerate response",onClick:$[0]||($[0]=H(B=>N.$emit("regenerate"),["stop"]))},[...$[29]||($[29]=[d("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-3.5 h-3.5",viewBox:"0 0 20 20",fill:"currentColor"},[d("path",{"fill-rule":"evenodd",d:"M4 2a1 1 0 011 1v2.101a7.002 7.002 0 0111.601 2.566 1 1 0 11-1.885.666A5.002 5.002 0 005.999 7H9a1 1 0 010 2H4a1 1 0 01-1-1V3a1 1 0 011-1zm.008 9.057a1 1 0 011.276.61A5.002 5.002 0 0014.001 13H11a1 1 0 110-2h5a1 1 0 011 1v5a1 1 0 11-2 0v-2.101a7.002 7.002 0 01-11.601-2.566 1 1 0 01.61-1.276z","clip-rule":"evenodd"})],-1)])])),d("button",{class:"touch-target rounded-md text-white/50 hover:text-white/90 hover:bg-white/10 transition-colors",title:"Reply","aria-label":"Reply",onClick:$[1]||($[1]=H(B=>N.$emit("reply",e.message.id,e.message.content),["stop"]))},[...$[30]||($[30]=[d("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-3.5 h-3.5",viewBox:"0 0 20 20",fill:"currentColor"},[d("path",{"fill-rule":"evenodd",d:"M7.707 3.293a1 1 0 010 1.414L5.414 7H11a7 7 0 017 7v2a1 1 0 11-2 0v-2a5 5 0 00-5-5H5.414l2.293 2.293a1 1 0 11-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z","clip-rule":"evenodd"})],-1)])]),ee.value?D("",!0):(p(),m("button",{key:2,class:"touch-target rounded-md text-white/50 hover:text-white/90 hover:bg-white/10 transition-colors",title:"Branch from here","aria-label":"Branch from here",onClick:$[2]||($[2]=H(B=>N.$emit("branch",e.message.id),["stop"]))},[...$[31]||($[31]=[d("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-3.5 h-3.5",viewBox:"0 0 20 20",fill:"currentColor"},[d("path",{"fill-rule":"evenodd",d:"M5 3a2 2 0 00-2 2v2a2 2 0 002 2h2a2 2 0 002-2V5a2 2 0 00-2-2H5zM5 11a2 2 0 00-2 2v2a2 2 0 002 2h2a2 2 0 002-2v-2a2 2 0 00-2-2H5zM11 5a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V5z","clip-rule":"evenodd"})],-1)])])),ee.value?D("",!0):(p(),m("div",Q1)),ee.value?D("",!0):(p(),m("button",{key:4,class:F(["touch-target rounded-md transition-colors",e.message.feedback==="up"?"text-green-400":"text-white/50 hover:text-green-400/80 hover:bg-white/10"]),title:"Good response","aria-label":"Good response",onClick:$[3]||($[3]=H(B=>o("up"),["stop"]))},[...$[32]||($[32]=[d("svg",{class:"w-3.5 h-3.5",fill:"currentColor",viewBox:"0 0 20 20"},[d("path",{d:"M2 10.5a1.5 1.5 0 113 0v6a1.5 1.5 0 01-3 0v-6zM6 10.333v5.43a2 2 0 001.106 1.79l.05.025A4 4 0 008.943 18h5.416a2 2 0 001.962-1.608l1.2-6A2 2 0 0015.56 8H12V4a2 2 0 00-2-2 1 1 0 00-1 1v.667a4 4 0 01-.8 2.4L6.8 7.933a4 4 0 00-.8 2.4z"})],-1)])],2)),ee.value?D("",!0):(p(),m("button",{key:5,class:F(["touch-target rounded-md transition-colors",e.message.feedback==="down"?"text-red-400":"text-white/50 hover:text-red-400/80 hover:bg-white/10"]),title:"Poor response","aria-label":"Poor response",onClick:$[4]||($[4]=H(B=>o("down"),["stop"]))},[...$[33]||($[33]=[d("svg",{class:"w-3.5 h-3.5",fill:"currentColor",viewBox:"0 0 20 20"},[d("path",{d:"M18 9.5a1.5 1.5 0 11-3 0v-6a1.5 1.5 0 013 0v6zM14 9.667v-5.43a2 2 0 00-1.106-1.79l-.05-.025A4 4 0 0011.057 2H5.64a2 2 0 00-1.962 1.608l-1.2 6A2 2 0 004.44 12H8v4a2 2 0 002 2 1 1 0 001-1v-.667a4 4 0 01.8-2.4l1.4-1.866a4 4 0 00.8-2.4z"})],-1)])],2))])],2)),d("div",{class:F(["rounded-2xl px-4 py-3 transition-all duration-300",[ct.value,{"cursor-pointer":_t.value}]]),onClick:ys},[u.value?(p(),m("div",{key:0,class:"space-y-2",onClick:$[6]||($[6]=H(()=>{},["stop"]))},[De(d("textarea",{ref_key:"editTextareaRef",ref:i,"onUpdate:modelValue":$[5]||($[5]=B=>r.value=B),class:"w-full bg-white/5 border border-white/10 rounded-lg px-3 py-2 text-sm text-white/90 resize-none focus:outline-none focus:border-accent/50",rows:"3",onKeydown:[Te(H(c,["exact"]),["enter"]),Te(l,["escape"])]},null,40,eh),[[Me,r.value]]),d("div",{class:"flex gap-2 justify-end"},[d("button",{class:"glass-button-sm min-h-[44px] md:min-h-0 md:!h-7 text-xs text-white/60 hover:text-white/90 px-3",onClick:l},"Cancel"),d("button",{class:"glass-button-sm min-h-[44px] md:min-h-0 md:!h-7 text-xs bg-accent/20 text-accent hover:bg-accent/30 px-3",onClick:c},"Save & Resend")])])):(p(),m(q,{key:1},[e.message.images&&e.message.images.length>0?(p(),m("div",th,[(p(!0),m(q,null,Z(e.message.images,(B,ue)=>(p(),m("img",{key:ue,src:`data:${B.mediaType};base64,${B.data}`,alt:`Attached image ${ue+1}`,class:"rounded-lg max-w-[200px] max-h-[200px] object-cover border border-white/10"},null,8,nh))),128))])):D("",!0),ee.value?e.message.content?(p(),m("p",oh,_(Je.value),1)):D("",!0):(p(),m("div",{key:1,class:"chat-markdown text-sm leading-relaxed break-words text-white/90",innerHTML:nt.value},null,8,sh))],64)),O.value.length>0?(p(),m("div",{key:2,class:"mt-3 space-y-1",onClick:$[7]||($[7]=H(()=>{},["stop"]))},[(p(!0),m(q,null,Z(O.value,B=>(p(),ie(Kd,{key:B.id,film:B,onSelect:ge},null,8,["film"]))),128))])):D("",!0),W.value.length>0?(p(),m("div",{key:3,class:"mt-3 space-y-1",onClick:$[8]||($[8]=H(()=>{},["stop"]))},[(p(!0),m(q,null,Z(W.value,B=>(p(),ie(ef,{key:B.id,book:B,onSelect:fs},null,8,["book"]))),128))])):D("",!0),ae.value.length>0?(p(),m("div",{key:4,class:"mt-3 space-y-1",onClick:$[9]||($[9]=H(()=>{},["stop"]))},[(p(!0),m(q,null,Z(ae.value,B=>(p(),ie(uf,{key:B.id,series:B,onSelect:ps},null,8,["series"]))),128))])):D("",!0),J.value.length>0?(p(),m("div",{key:5,class:"mt-3 space-y-1",onClick:$[10]||($[10]=H(()=>{},["stop"]))},[(p(!0),m(q,null,Z(J.value,B=>(p(),ie(df,{key:B.id,song:B,onSelect:hs},null,8,["song"]))),128))])):D("",!0),me.value.length>0?(p(),m("div",{key:6,class:"mt-3 space-y-1",onClick:$[11]||($[11]=H(()=>{},["stop"]))},[(p(!0),m(q,null,Z(me.value,B=>(p(),ie(gf,{key:B.id,podcast:B,onSelect:gs},null,8,["podcast"]))),128))])):D("",!0),T.value.length>0?(p(),m("div",{key:7,class:"mt-3 space-y-1",onClick:$[12]||($[12]=H(()=>{},["stop"]))},[(p(!0),m(q,null,Z(T.value,B=>(p(),ie(wf,{key:B.id,place:B,onSelect:ms},null,8,["place"]))),128))])):D("",!0),z.value.length>0?(p(),m("div",{key:8,class:"mt-3 space-y-1.5",onClick:$[13]||($[13]=H(()=>{},["stop"]))},[(p(!0),m(q,null,Z(z.value,B=>(p(),ie(Bf,{key:B,uri:B},null,8,["uri"]))),128))])):D("",!0),L.value.length>0?(p(),m("div",{key:9,class:"mt-3 space-y-1.5",onClick:$[14]||($[14]=H(()=>{},["stop"]))},[(p(!0),m(q,null,Z(L.value,B=>(p(),ie(Vf,{key:B,token:B},null,8,["token"]))),128))])):D("",!0),se.value.length>0?(p(),m("div",{key:10,class:"mt-3 space-y-2",onClick:$[15]||($[15]=H(()=>{},["stop"]))},[(p(!0),m(q,null,Z(se.value,(B,ue)=>(p(),ie(cp,{key:`recipe-${ue}`,recipe:B},null,8,["recipe"]))),128))])):D("",!0),ne.value.length>=3?(p(),m("div",{key:11,class:"mt-3",onClick:$[16]||($[16]=H(()=>{},["stop"]))},[pe(Hp,{events:ne.value},null,8,["events"])])):ne.value.length>0?(p(),m("div",{key:12,class:"mt-3 space-y-2",onClick:$[17]||($[17]=H(()=>{},["stop"]))},[(p(!0),m(q,null,Z(ne.value,(B,ue)=>(p(),ie(kp,{key:`event-${ue}`,event:B},null,8,["event"]))),128))])):D("",!0),le.value.length>0?(p(),m("div",{key:13,class:"mt-3 space-y-2",onClick:$[18]||($[18]=H(()=>{},["stop"]))},[(p(!0),m(q,null,Z(le.value,(B,ue)=>(p(),ie(Pp,{key:`table-${ue}`,headers:B.headers,rows:B.rows},null,8,["headers","rows"]))),128))])):D("",!0),ve.value.length>0?(p(),m("div",{key:14,class:"mt-3 space-y-2",onClick:$[19]||($[19]=H(()=>{},["stop"]))},[(p(!0),m(q,null,Z(ve.value,(B,ue)=>(p(),ie(Yp,{key:`code-${ue}`,code:B.code,language:B.language},null,8,["code","language"]))),128))])):D("",!0),$e.value.length>0?(p(),m("div",{key:15,class:"mt-3 space-y-2",onClick:$[20]||($[20]=H(()=>{},["stop"]))},[(p(!0),m(q,null,Z($e.value,(B,ue)=>(p(),ie(u1,{key:`btc-${ue}`,address:B.address},null,8,["address"]))),128))])):D("",!0),$t.value.length>0?(p(),m("div",{key:16,class:"mt-3 space-y-2",onClick:$[21]||($[21]=H(()=>{},["stop"]))},[(p(!0),m(q,null,Z($t.value,(B,ue)=>(p(),ie(g1,{key:`bolt11-${ue}`,invoice:B.invoice},null,8,["invoice"]))),128))])):D("",!0),kt.value.length>0?(p(),m("div",{key:17,class:"mt-3 space-y-2",onClick:$[22]||($[22]=H(()=>{},["stop"]))},[(p(!0),m(q,null,Z(kt.value,(B,ue)=>(p(),ie(k1,{key:`bolt12-${ue}`,offer:B.offer},null,8,["offer"]))),128))])):D("",!0),Ct.value.length>0?(p(),m("div",{key:18,class:"mt-3 space-y-2",onClick:$[23]||($[23]=H(()=>{},["stop"]))},[(p(!0),m(q,null,Z(Ct.value,(B,ue)=>(p(),ie(L1,{key:`tx-${ue}`,txid:B.txid},null,8,["txid"]))),128))])):D("",!0),ye.value.length>0?(p(),m("div",{key:19,class:"mt-3 space-y-1",onClick:$[24]||($[24]=H(()=>{},["stop"]))},[(p(!0),m(q,null,Z(ye.value,(B,ue)=>(p(),ie(Xu,{key:ue,article:B,onSelectArticle:bs},null,8,["article"]))),128))])):D("",!0),we.value.length>0?(p(),m("div",{key:20,class:"mt-3 space-y-1",onClick:$[25]||($[25]=H(()=>{},["stop"]))},[(p(!0),m(q,null,Z(we.value,(B,ue)=>(p(),ie(Xu,{key:`web-${ue}`,article:B,onSelectArticle:xs},null,8,["article"]))),128))])):D("",!0),u.value?D("",!0):(p(),m("div",uh,[d("span",rh,_(st.value),1),e.message.editedAt?(p(),m("span",ih,"(edited)")):D("",!0),Mt.value?(p(),m("span",{key:1,class:"text-xs text-white/20 select-none",title:`~${Ft.value} tokens`},_(Vt.value),9,ah)):D("",!0),e.message.feedback?(p(),m("span",lh,_(e.message.feedback==="up"?"👍":"👎"),1)):D("",!0),O.value.length>1?(p(),m("button",{key:3,class:"text-xs text-accent/70 hover:text-accent transition-colors",onClick:H(Le,["stop"])}," View all "+_(O.value.length)+" films → ",1)):W.value.length>1?(p(),m("button",{key:4,class:"text-xs text-accent/70 hover:text-accent transition-colors",onClick:H(Le,["stop"])}," View all "+_(W.value.length)+" books → ",1)):ae.value.length>1?(p(),m("button",{key:5,class:"text-xs text-accent/70 hover:text-accent transition-colors",onClick:H(Le,["stop"])}," View all "+_(ae.value.length)+" series → ",1)):xe.value.length>1?(p(),m("button",{key:6,class:"text-xs text-accent/70 hover:text-accent transition-colors",onClick:H(Le,["stop"])}," View all "+_(xe.value.length)+" images → ",1)):T.value.length>1?(p(),m("button",{key:7,class:"text-xs text-accent/70 hover:text-accent transition-colors",onClick:H(Le,["stop"])}," View all "+_(T.value.length)+" places → ",1)):D("",!0),T.value.length>0&&T.value.some(B=>B.lat!=null)?(p(),m("button",{key:8,class:"text-xs text-accent/70 hover:text-accent transition-colors",onClick:$[26]||($[26]=H(B=>S(X)(T.value),["stop"]))}," View on map → ")):J.value.length>1?(p(),m("button",{key:9,class:"text-xs text-accent/70 hover:text-accent transition-colors",onClick:H(Le,["stop"])}," View all "+_(J.value.length)+" songs → ",1)):me.value.length>1?(p(),m("button",{key:10,class:"text-xs text-accent/70 hover:text-accent transition-colors",onClick:H(Le,["stop"])}," View all "+_(me.value.length)+" podcasts → ",1)):ye.value.length>1?(p(),m("button",{key:11,class:"text-xs text-accent/70 hover:text-accent transition-colors",onClick:H(Le,["stop"])}," View all "+_(ye.value.length)+" articles → ",1)):we.value.length>1?(p(),m("button",{key:12,class:"text-xs text-accent/70 hover:text-accent transition-colors",onClick:H(Le,["stop"])}," View all "+_(we.value.length)+" websites → ",1)):Ee.value.length>0?(p(),m("button",{key:13,class:"text-xs text-accent/70 hover:text-accent transition-colors",onClick:H(Le,["stop"])}," View brief → ")):D("",!0),En.value?(p(),m("button",{key:14,class:"text-xs text-accent/70 hover:text-accent transition-colors",onClick:$[27]||($[27]=H(B=>S(R)(e.message.content),["stop"]))}," Read as article → ")):D("",!0)]))],2)]),pe(zd,{ref_key:"contextMenuRef",ref:Ze},{default:qe(()=>[ee.value?(p(),ie(pn,{key:0,onClick:ks},{default:qe(()=>[...$[34]||($[34]=[ce("Edit",-1)])]),_:1})):D("",!0),ee.value?D("",!0):(p(),ie(pn,{key:1,onClick:Cs},{default:qe(()=>[...$[35]||($[35]=[ce("Regenerate",-1)])]),_:1})),pe(pn,{onClick:ht},{default:qe(()=>[...$[36]||($[36]=[ce("Reply",-1)])]),_:1}),ee.value?D("",!0):(p(),ie(pn,{key:2,onClick:je},{default:qe(()=>[...$[37]||($[37]=[ce("Branch from here",-1)])]),_:1})),pe(pn,{onClick:Ne},{default:qe(()=>[...$[38]||($[38]=[ce("Copy",-1)])]),_:1})]),_:1},512)],38))}}),Vn=k(""),Gn=k([]),hn=k(!1);let no=null;function dh(e){const t=e.toLowerCase(),n=[];for(const s of Ht)(s.title.toLowerCase().includes(t)||s.director.toLowerCase().includes(t)||s.genres.some(o=>o.toLowerCase().includes(t)))&&n.push({type:"film",title:s.title,subtitle:`${s.year} · ${s.director}`,id:s.id,data:s});for(const s of _n)(s.title.toLowerCase().includes(t)||s.artist.toLowerCase().includes(t)||(s.album??"").toLowerCase().includes(t))&&n.push({type:"song",title:s.title,subtitle:s.artist,id:s.id,data:s});for(const s of us)(s.title.toLowerCase().includes(t)||(s.host??"").toLowerCase().includes(t))&&n.push({type:"podcast",title:s.title,subtitle:s.host??"Unknown",id:s.id,data:s});return n.slice(0,20)}function fh(){function e(n){Vn.value=n}function t(){Vn.value="",Gn.value=[],hn.value=!1}return Ce(Vn,n=>{if(no&&clearTimeout(no),!n.trim()){Gn.value=[],hn.value=!1;return}hn.value=!0,no=setTimeout(()=>{Gn.value=dh(n.trim()),hn.value=!1},150)}),{query:Vn,results:Gn,isSearching:hn,search:e,clear:t}}const ph={key:0,class:"p-3 text-center"},hh=["onClick","onMouseenter"],mh={class:"min-w-0 flex-1"},gh=te({__name:"SearchResults",props:{results:{},isSearching:{type:Boolean}},emits:["select"],setup(e,{expose:t}){const n=e,{isDark:s}=He(),o=k(0),u=A(()=>{const a={};for(const f of n.results)a[f.type]||(a[f.type]=[]),a[f.type].push(f);const l={film:"Films",song:"Songs",podcast:"Podcasts"};let c=0;return Object.entries(a).map(([f,h])=>{const b={type:f,label:l[f]??f,items:h,startIndex:c};return c+=h.length,b})});function r(a){return{film:"🎬",song:"🎵",podcast:"🎙"}[a]??"📄"}function i(a){return s.value?{film:"bg-blue-500/20 text-blue-400",song:"bg-green-500/20 text-green-400",podcast:"bg-orange-500/20 text-orange-400"}[a]??"bg-white/10 text-white/40":{film:"bg-blue-50 text-blue-600",song:"bg-green-50 text-green-600",podcast:"bg-orange-50 text-orange-600"}[a]??"bg-gray-50 text-gray-600"}return t({selectedIndex:o}),(a,l)=>e.results.length>0||e.isSearching?(p(),m("div",{key:0,class:F(["absolute bottom-full left-0 right-0 mb-1 max-h-72 overflow-y-auto rounded-xl shadow-lg z-50",S(s)?"bg-gray-900/95 backdrop-blur-xl border border-white/10":"bg-white/95 backdrop-blur-xl border border-gray-200"])},[e.isSearching?(p(),m("div",ph,[d("span",{class:F(["text-xs",S(s)?"text-white/40":"text-gray-400"])}," Searching... ",2)])):(p(!0),m(q,{key:1},Z(u.value,c=>(p(),m("div",{key:c.type,class:"py-1"},[d("div",{class:F(["px-3 py-1 text-xs font-bold uppercase tracking-wider",S(s)?"text-white/30":"text-gray-400"])},_(c.label),3),(p(!0),m(q,null,Z(c.items,(f,h)=>(p(),m("button",{key:f.id,class:F(["w-full text-left px-3 py-2 flex items-center gap-2 transition-colors",[o.value===c.startIndex+h?S(s)?"bg-white/10":"bg-gray-100":S(s)?"hover:bg-white/5":"hover:bg-gray-50"]]),onClick:b=>a.$emit("select",f),onMouseenter:b=>o.value=c.startIndex+h},[d("span",{class:F(["text-xs w-5 h-5 rounded flex items-center justify-center shrink-0",i(f.type)])},_(r(f.type)),3),d("div",mh,[d("div",{class:F(["text-xs font-medium truncate",S(s)?"text-white/80":"text-gray-800"])},_(f.title),3),d("div",{class:F(["text-xs truncate",S(s)?"text-white/40":"text-gray-500"])},_(f.subtitle),3)])],42,hh))),128))]))),128))],2)):D("",!0)}}),ci="aiui-prompt-templates";function nr(){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)})}const sr=[{id:"builtin-explain",title:"Explain like I'm 5",content:"Explain {{topic}} in simple terms that a 5-year-old would understand.",preview:"Simplify complex topics"},{id:"builtin-compare",title:"Compare & Contrast",content:"Compare and contrast {{option A}} and {{option B}}. List pros, cons, and a recommendation.",preview:"Side-by-side analysis"},{id:"builtin-summarise",title:"Summarise",content:`Summarise the following in {{length}} bullet points:

{{text}}`,preview:"Condense text to key points"},{id:"builtin-translate",title:"Translate",content:`Translate the following to {{language}}:

{{text}}`,preview:"Translate text to another language"}];function bh(){try{const e=localStorage.getItem(ci);return e?JSON.parse(e):[...sr]}catch{return[...sr]}}function xh(e){localStorage.setItem(ci,JSON.stringify(e))}function or(e){const t=e.match(/\{\{([^}]+)\}\}/g);return t?[...new Set(t.map(n=>n.slice(2,-2).trim()))]:[]}const vh=Cn("promptTemplates",()=>{const e=k(bh()),t=A(()=>[...e.value].sort((a,l)=>a.title.localeCompare(l.title)));function n(){xh(e.value)}function s(a){const l={...a,id:nr()};return e.value.push(l),n(),l}function o(a,l){const c=e.value.find(f=>f.id===a);c&&(Object.assign(c,l),n())}function u(a){const l=e.value.findIndex(c=>c.id===a);l!==-1&&(e.value.splice(l,1),n())}function r(){return JSON.stringify(e.value,null,2)}function i(a){try{const l=JSON.parse(a);if(!Array.isArray(l))return 0;let c=0;for(const f of l)f.title&&f.content&&!e.value.find(h=>h.id===f.id)&&(e.value.push({id:f.id||nr(),title:f.title,content:f.content,preview:f.preview}),c++);return n(),c}catch{return 0}}return{templates:e,sortedTemplates:t,addTemplate:s,updateTemplate:o,deleteTemplate:u,exportTemplates:r,importTemplates:i}}),yh={key:0,class:"absolute bottom-full left-2 right-2 mb-1 z-50"},wh={key:0,class:"rounded-2xl bg-[#1a1a1a] border border-white/10 shadow-2xl p-4 space-y-3 animate-scale-in"},kh={class:"flex items-center justify-between"},Ch={class:"text-xs font-semibold text-white/80"},_h={class:"text-xs text-white/40"},Ah=["onUpdate:modelValue","placeholder"],Dh={key:1,class:"rounded-2xl bg-[#1a1a1a] border border-white/10 shadow-2xl max-h-72 overflow-y-auto animate-scale-in"},Sh={key:0},Eh=["onClick","onMouseenter"],$h={class:"flex items-center gap-2"},Fh={class:"text-xs font-mono text-accent/70"},Mh={class:"text-sm text-white/80"},Th={key:0,class:"text-xs text-white/40 mt-0.5 truncate"},Ih={key:1},Ph=["onClick","onMouseenter"],Lh={class:"text-sm text-white/80"},zh={key:0,class:"text-xs text-white/40 mt-0.5 truncate"},Bh={key:2,class:"px-3 py-4 text-center"},Rh=te({__name:"PromptPalette",props:{query:{},isOpen:{type:Boolean}},emits:["select","close"],setup(e,{expose:t,emit:n}){const s=[{id:"cmd-code",slash:"/code",title:"Code",preview:"Open project browser and code editor"},{id:"cmd-nostr",slash:"/nostr",title:"Nostr",preview:"Browse the Nostr network feed"},{id:"cmd-design",slash:"/design",title:"Design System",preview:"Open the design system viewer"},{id:"cmd-search",slash:"/search ",title:"Search",preview:"Search your content library"},{id:"cmd-seed",slash:"/seed",title:"Seed",preview:"Load seed conversations for all content types"},{id:"cmd-freefilms",slash:"/freefilms",title:"Free Films",preview:"Browse free documentary films from InDeeHub"}],o=e,u=n,r=vh(),i=k(0),a=k(null),l=k({}),c=A(()=>{const M=o.query.toLowerCase();return M?s.filter(P=>P.slash.toLowerCase().includes("/"+M)||P.title.toLowerCase().includes(M)||P.preview.toLowerCase().includes(M)):s}),f=A(()=>{const M=o.query.toLowerCase();return M?r.sortedTemplates.filter(P=>P.title.toLowerCase().includes(M)||(P.preview??"").toLowerCase().includes(M)):r.sortedTemplates}),h=A(()=>c.value.length+f.value.length),b=A(()=>a.value?or(a.value.content):[]);Ce(()=>o.query,()=>{i.value=0,a.value=null}),Ce(()=>o.isOpen,M=>{M||(a.value=null,l.value={},i.value=0)});function g(M){u("select",M.slash)}function x(M){const P=or(M.content);if(P.length===0){u("select",M.content);return}a.value=M,l.value=Object.fromEntries(P.map(U=>[U,""]))}function E(){if(!a.value)return;let M=a.value.content;for(const[P,U]of Object.entries(l.value))M=M.replaceAll(`{{${P}}}`,U||P);u("select",M),a.value=null,l.value={}}function C(){a.value=null,l.value={}}function y(){i.value>0&&i.value--}function v(){i.value<h.value-1&&i.value++}function w(){const M=i.value;if(M<c.value.length)g(c.value[M]);else{const P=f.value[M-c.value.length];P&&x(P)}}return t({navigateUp:y,navigateDown:v,selectHighlighted:w,hasSelectedTemplate:A(()=>!!a.value)}),(M,P)=>e.isOpen?(p(),m("div",yh,[a.value&&b.value.length>0?(p(),m("div",wh,[d("div",kh,[d("h4",Ch,_(a.value.title),1),d("button",{class:"text-xs text-white/40 hover:text-white/60 transition-colors",onClick:C}," Cancel ")]),(p(!0),m(q,null,Z(b.value,U=>(p(),m("div",{key:U,class:"space-y-1"},[d("label",_h,_(U),1),De(d("input",{"onUpdate:modelValue":oe=>l.value[U]=oe,type:"text",class:"w-full bg-white/5 border border-white/10 rounded-lg px-3 py-1.5 text-base text-white/90 focus:outline-none focus:border-accent/50",placeholder:U,onKeydown:Te(E,["enter"])},null,40,Ah),[[Me,l.value[U]]])]))),128)),d("button",{class:"w-full py-1.5 rounded-lg text-xs bg-accent/20 text-accent hover:bg-accent/30 transition-all",onClick:E}," Insert ")])):(p(),m("div",Dh,[c.value.length>0?(p(),m("div",Sh,[P[0]||(P[0]=d("div",{class:"p-2 border-b border-white/5"},[d("p",{class:"text-xs text-white/30 px-2"},"Commands")],-1)),(p(!0),m(q,null,Z(c.value,(U,oe)=>(p(),m("div",{key:U.id,class:F(["px-3 py-2 cursor-pointer transition-colors",oe===i.value?"bg-white/10":"hover:bg-white/5"]),onClick:j=>g(U),onMouseenter:j=>i.value=oe},[d("div",$h,[d("span",Fh,_(U.slash),1),d("p",Mh,_(U.title),1)]),U.preview?(p(),m("p",Th,_(U.preview),1)):D("",!0)],42,Eh))),128))])):D("",!0),f.value.length>0?(p(),m("div",Ih,[P[1]||(P[1]=d("div",{class:"p-2 border-b border-white/5"},[d("p",{class:"text-xs text-white/30 px-2"},"Templates")],-1)),(p(!0),m(q,null,Z(f.value,(U,oe)=>(p(),m("div",{key:U.id,class:F(["px-3 py-2 cursor-pointer transition-colors",c.value.length+oe===i.value?"bg-white/10":"hover:bg-white/5"]),onClick:j=>x(U),onMouseenter:j=>i.value=c.value.length+oe},[d("p",Lh,_(U.title),1),U.preview?(p(),m("p",zh,_(U.preview),1)):D("",!0)],42,Ph))),128))])):D("",!0),c.value.length===0&&f.value.length===0?(p(),m("div",Bh,[...P[2]||(P[2]=[d("p",{class:"text-xs text-white/30"},"No matching commands",-1)])])):D("",!0)]))])):D("",!0)}}),jh={key:1,class:"mb-2 flex items-start gap-2 rounded-xl bg-white/5 border border-white/10 px-3 py-2 animate-fade-up-fast"},Nh={class:"flex-1 min-w-0"},Uh={class:"text-xs text-white/50 truncate"},Oh={key:2,class:"mb-2 flex gap-2 flex-wrap animate-fade-up-fast"},qh=["src","alt"],Hh=["onClick"],Wh={key:0,class:"self-center text-xs text-white/30"},Vh={key:3,class:"absolute inset-0 z-10 flex items-center justify-center rounded-2xl border-2 border-dashed border-accent/50 bg-accent/5 backdrop-blur-sm pointer-events-none"},Gh=["placeholder"],Kh=["disabled"],Jh=["disabled"],Kn=4,Zh=te({__name:"ChatInput",props:{disabled:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1},placeholder:{default:"Message AIUI..."},activeTab:{default:""},replyTo:{default:null}},emits:["send","extract","stop","clearReply"],setup(e,{emit:t}){const n=["image/jpeg","image/png","image/gif","image/webp"],s=e,o=A(()=>s.activeTab==="code"),u=t,r=k(""),i=k(!1),a=k(!1),l=k(!1),c=k(null),f=k(null),h=k([]),b=k(null),g=A(()=>{const O=r.value.trimStart();return O==="/"||O.startsWith("/")&&!O.includes(" ")}),x=A(()=>g.value?r.value.trimStart().slice(1):"");function E(O){if(O.startsWith("/")&&!O.includes("{{")){if(r.value=O,O.trimEnd()==="/search"){Fe(()=>{Y(),c.value?.focus()});return}Fe(()=>M());return}r.value=O,Fe(()=>{Y(),c.value?.focus()})}function C(){r.value.trimStart()==="/"&&(r.value="")}function y(){i.value=!0,Fe(()=>{c.value?.scrollIntoView({block:"end",behavior:"smooth"})})}function v(O){if(g.value&&!b.value?.hasSelectedTemplate){if(O.key==="ArrowUp"){O.preventDefault(),b.value?.navigateUp();return}if(O.key==="ArrowDown"){O.preventDefault(),b.value?.navigateDown();return}if(O.key==="Enter"){O.preventDefault(),b.value?.selectHighlighted();return}if(O.key==="Escape"){O.preventDefault(),C();return}}O.key==="Enter"&&!O.shiftKey&&(O.preventDefault(),M())}const w=A(()=>(r.value.trim().length>0||h.value.length>0)&&!s.disabled);function M(){w.value&&(u("send",r.value.trim(),[...h.value]),r.value="",h.value=[],a.value=!1,Fe(Y))}function P(){w.value&&(u("extract",r.value.trim()),r.value="",a.value=!1,Fe(Y))}function U(O){const W=O.clipboardData?.items;if(!W){a.value=!0;return}let ae=!1;for(const xe of W)if(n.includes(xe.type)){ae=!0;const T=xe.getAsFile();T&&K(T)}ae||(a.value=!0)}function oe(O){O.dataTransfer?.types.includes("Files")&&(l.value=!0)}function j(){l.value=!1}function R(O){l.value=!1;const W=O.dataTransfer?.files;if(W)for(const ae of W)n.includes(ae.type)&&K(ae)}function X(){f.value?.click()}function Q(O){const W=O.target,ae=W.files;if(ae){for(const xe of ae)n.includes(xe.type)&&K(xe);W.value=""}}function K(O){if(h.value.length>=Kn)return;const W=new FileReader;W.onload=()=>{const xe=W.result.split(",")[1];xe&&h.value.push({data:xe,mediaType:O.type})},W.readAsDataURL(O)}function I(O){h.value.splice(O,1)}function Y(){const O=c.value;O&&(O.style.height="auto",O.style.height=Math.min(O.scrollHeight,120)+"px")}const{results:he,isSearching:be,search:Ke,clear:ee}=fh(),Ae=A(()=>r.value.trimStart().startsWith("/search "));Ce(r,O=>{if(Ae.value){const W=O.trimStart().replace(/^\/search\s+/,"");Ke(W)}else ee()});function ct(O){const W={film:`[[film:${O.id}]]`,song:`[[song:${O.id}]]`,podcast:`[[podcast:${O.id}]]`};r.value=W[O.type]??O.title,ee(),Fe(()=>c.value?.focus())}return(O,W)=>(p(),m("div",{class:"p-3 md:p-4 relative",onDragover:H(oe,["prevent"]),onDragleave:j,onDrop:H(R,["prevent"])},[Ae.value?(p(),ie(gh,{key:0,results:S(he),"is-searching":S(be),onSelect:ct},null,8,["results","is-searching"])):D("",!0),e.replyTo?(p(),m("div",jh,[d("div",Nh,[W[4]||(W[4]=d("p",{class:"text-xs text-accent/70 font-medium mb-0.5"},"Replying to",-1)),d("p",Uh,_(e.replyTo.excerpt),1)]),d("button",{class:"shrink-0 touch-target rounded-md hover:bg-white/10 transition-colors text-white/40 hover:text-white/70","aria-label":"Cancel reply",onClick:W[0]||(W[0]=ae=>O.$emit("clearReply"))},[...W[5]||(W[5]=[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:"M6 18L18 6M6 6l12 12"})],-1)])])])):D("",!0),h.value.length>0?(p(),m("div",Oh,[(p(!0),m(q,null,Z(h.value,(ae,xe)=>(p(),m("div",{key:xe,class:"relative group w-16 h-16 rounded-lg overflow-hidden border border-white/10 bg-white/5"},[d("img",{src:`data:${ae.mediaType};base64,${ae.data}`,alt:`Attached image ${xe+1}`,class:"w-full h-full object-cover"},null,8,qh),d("button",{class:"absolute inset-0 flex items-center justify-center bg-black/60 opacity-0 group-hover:opacity-100 transition-opacity","aria-label":"Remove image",onClick:T=>I(xe)},[...W[6]||(W[6]=[d("svg",{class:"w-4 h-4 text-white/80",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)])],8,Hh)]))),128)),h.value.length>=Kn?(p(),m("span",Wh," Max "+_(Kn)+" images ")):D("",!0)])):D("",!0),pe(Rh,{ref_key:"paletteRef",ref:b,query:x.value,"is-open":g.value,onSelect:E,onClose:C},null,8,["query","is-open"]),l.value?(p(),m("div",Vh,[...W[7]||(W[7]=[d("p",{class:"text-sm text-accent/80 font-medium"},"Drop image here",-1)])])):D("",!0),d("div",{class:F(["rounded-2xl px-4 py-3 flex items-center gap-2 transition-all duration-300",[o.value?"bg-accent/15 border border-accent/25 backdrop-blur-xl":"path-glass-bubble",i.value?o.value?"border-accent/40":"border-white/30":""]])},[!e.streaming&&h.value.length<Kn?(p(),m("button",{key:0,class:"shrink-0 min-w-[44px] min-h-[44px] -my-2 flex items-center justify-center rounded-lg text-white/40 hover:text-white/70 hover:bg-white/10 transition-all","aria-label":"Attach image",onClick:X},[...W[8]||(W[8]=[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:"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"})],-1)])])):D("",!0),De(d("textarea",{ref_key:"textareaRef",ref:c,"onUpdate:modelValue":W[1]||(W[1]=ae=>r.value=ae),rows:"1",placeholder:e.placeholder,class:"flex-1 resize-none bg-transparent text-base outline-none min-h-[24px] max-h-[120px] text-white/90 placeholder:text-white/25",onKeydown:v,onInput:Y,onPaste:U,onFocus:y,onBlur:W[2]||(W[2]=ae=>i.value=!1)},null,40,Gh),[[Me,r.value]]),e.streaming?(p(),m("button",{key:1,class:"shrink-0 path-glass-button path-glass-button-sm rounded-xl px-3 transition-all duration-200 hover:opacity-80 active:scale-95","aria-label":"Stop generation",onClick:W[3]||(W[3]=ae=>O.$emit("stop"))},[...W[9]||(W[9]=[d("svg",{class:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24"},[d("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})],-1)])])):(p(),m(q,{key:2},[a.value&&w.value?(p(),m("button",{key:0,disabled:!w.value,class:"shrink-0 path-glass-button path-glass-button-sm rounded-xl px-3 transition-all duration-200 hover:opacity-80 active:scale-95 text-accent/80","aria-label":"Extract content",title:"Contextualize — extract media without sending to AI",onClick:P},[...W[10]||(W[10]=[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 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"})],-1)])],8,Kh)):D("",!0),d("button",{disabled:!w.value,class:F(["shrink-0 rounded-xl px-3 transition-all duration-200",[o.value?"bg-accent/80 text-white":"path-glass-button path-glass-button-sm",w.value?"hover:opacity-80 active:scale-95":"opacity-30 cursor-not-allowed"]]),style:Se(o.value?"height: 32px":""),"aria-label":"Send message",onClick:M},[...W[11]||(W[11]=[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 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5"})],-1)])],14,Jh)],64))],2),d("input",{ref_key:"fileInputRef",ref:f,type:"file",accept:"image/jpeg,image/png,image/gif,image/webp",multiple:"",class:"hidden",onChange:Q},null,544)],32))}}),Yh={},Xh={class:"flex justify-start animate-fade-up-fast"},Qh={class:"path-glass-card rounded-2xl rounded-bl-md px-4 py-3"},em={class:"flex items-center gap-1.5"};function tm(e,t){return p(),m("div",Xh,[d("div",Qh,[d("div",em,[(p(),m(q,null,Z(3,n=>d("span",{key:n,class:"w-1.5 h-1.5 rounded-full bg-white/40 animate-pulse-glow",style:Se({animationDelay:`${n*200}ms`})},null,4)),64))])])])}const ur=os(Yh,[["render",tm]]),nm={class:"flex-1 min-h-0 overflow-y-auto scrollbar-hide p-3 space-y-1"},sm={key:0,class:"flex items-center justify-center h-full"},om=["onClick"],um={class:"text-sm leading-snug truncate text-white/90"},rm={class:"flex items-center gap-1.5 mt-1 flex-wrap"},im={class:"text-xs text-white/30"},am=te({__name:"PromptIndex",props:{messages:{}},emits:["select"],setup(e,{emit:t}){const n=e,s=t,{getContextualInlineContent:o}=is(),u=k(null),r=A(()=>{const l=[],c=n.messages;for(let f=0;f<c.length;f++){if(c[f].role!=="user")continue;const h=c[f],b=f+1<c.length&&c[f+1].role==="assistant"?c[f+1]:null,g=[];if(b&&b.content){const x=o(b.content,h.content,b.webResults??[]);x.films.length>0&&g.push("Films"),(x.books?.length??0)>0&&g.push("Books"),(x.tvSeries?.length??0)>0&&g.push("TV"),(x.images?.length??0)>0&&g.push("Images"),(x.places?.length??0)>0&&g.push("Places"),x.songs.length>0&&g.push("Music"),x.podcasts.length>0&&g.push("Podcasts"),x.magazineSections.length>0&&g.push("Magazine"),(x.newsLinks?.length??0)>0&&g.push("News"),(x.websitesLinks?.length??0)>0&&g.push("Web"),(x.codeBlocks?.length??0)>0&&g.push("Code"),(x.apps?.length??0)>0&&g.push("Apps"),x.hasNostr&&g.push("Nostr")}l.push({userMsg:h,assistantMsg:b,badges:g})}return l});function i(l,c){u.value=c,s("select",l.userMsg,l.assistantMsg)}function a(l){return new Date(l).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}return(l,c)=>(p(),m("div",nm,[r.value.length===0?(p(),m("div",sm,[...c[0]||(c[0]=[d("p",{class:"text-xs text-white/30"}," No prompts yet ",-1)])])):D("",!0),(p(!0),m(q,null,Z(r.value,(f,h)=>(p(),m("button",{key:f.userMsg.id,class:F(["w-full text-left px-3 py-2.5 rounded-xl transition-all duration-150 group",[u.value===h?"path-glass-bubble-user":"hover:bg-white/5"]]),onClick:b=>i(f,h)},[d("p",um,_(f.userMsg.content),1),d("div",rm,[d("span",im,_(a(f.userMsg.timestamp)),1),(p(!0),m(q,null,Z(f.badges,b=>(p(),m("span",{key:b,class:"text-xs px-1.5 py-0.5 rounded-md bg-white/8 text-white/40"},_(b),1))),128))])],10,om))),128))]))}}),lm={class:"flex-1 min-h-0 overflow-y-auto scrollbar-hide p-3 space-y-1"},cm={key:0,class:"flex items-center justify-center h-32"},dm=["onClick"],fm={class:"flex items-center gap-1.5 mt-1"},pm={class:"text-xs text-white/30"},hm={class:"text-xs text-white/30"},mm=te({__name:"ChatHistory",emits:["select","newChat"],setup(e,{emit:t}){const n=t,s=wt(),o=A(()=>s.conversationList),u=A(()=>s.activeConversationId);function r(a){n("select",a)}function i(a){const c=Date.now()-a,f=Math.floor(c/6e4);if(f<1)return"Just now";if(f<60)return`${f}m ago`;const h=Math.floor(f/60);if(h<24)return`${h}h ago`;const b=Math.floor(h/24);return b<7?`${b}d ago`:new Date(a).toLocaleDateString([],{month:"short",day:"numeric"})}return(a,l)=>(p(),m("div",lm,[d("button",{class:"w-full text-left px-3 py-2.5 min-h-[44px] rounded-xl transition-all duration-150 hover:bg-white/5 flex items-center gap-2 text-white/70 mb-2",onClick:l[0]||(l[0]=c=>a.$emit("newChat"))},[...l[1]||(l[1]=[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),d("span",{class:"text-sm font-medium"},"New Chat",-1)])]),o.value.length===0?(p(),m("div",cm,[...l[2]||(l[2]=[d("p",{class:"text-xs text-white/30"},"No conversations yet",-1)])])):D("",!0),(p(!0),m(q,null,Z(o.value,c=>(p(),m("button",{key:c.id,class:F(["w-full text-left px-3 py-2.5 min-h-[44px] rounded-xl transition-all duration-150",c.id===u.value?"nav-tab-active":"hover:bg-white/5"]),onClick:f=>r(c.id)},[d("p",{class:F(["text-sm leading-snug truncate",c.id===u.value?"text-white":"text-white/90"])},_(c.title||"Untitled"),3),d("div",fm,[d("span",pm,_(i(c.updatedAt)),1),l[3]||(l[3]=d("span",{class:"text-xs text-white/20"},"·",-1)),d("span",hm,_(c.messages.length)+" msg"+_(c.messages.length!==1?"s":""),1)])],10,dm))),128))]))}}),gm={key:0,class:"flex items-center justify-center px-4 py-1.5 animate-fade-up-fast"},bm={class:"glass-button-sm min-h-[44px] md:min-h-0 md:!h-7 flex items-center gap-1.5 px-2 text-xs"},xm=["disabled"],vm={class:"text-white/70 select-none whitespace-nowrap"},ym=["disabled"],wm=te({__name:"BranchSwitcher",setup(e){const t=wt(),n=A(()=>t.activeConversationId?t.getSiblingBranches(t.activeConversationId):[]),s=A(()=>n.value.findIndex(u=>u.isCurrent));function o(u){const r=n.value[u];r&&t.setActiveConversation(r.id)}return(u,r)=>n.value.length>1?(p(),m("div",gm,[d("div",bm,[d("button",{class:"min-w-[44px] min-h-[44px] flex items-center justify-center rounded-md hover:bg-white/10 transition-colors text-white/60 hover:text-white/90 disabled:opacity-30 disabled:cursor-default",disabled:s.value<=0,"aria-label":"Previous branch",onClick:r[0]||(r[0]=i=>o(s.value-1))},[...r[2]||(r[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:"M15 19l-7-7 7-7"})],-1)])],8,xm),d("span",vm," Branch "+_(s.value+1)+" of "+_(n.value.length),1),d("button",{class:"min-w-[44px] min-h-[44px] flex items-center justify-center rounded-md hover:bg-white/10 transition-colors text-white/60 hover:text-white/90 disabled:opacity-30 disabled:cursor-default",disabled:s.value>=n.value.length-1,"aria-label":"Next branch",onClick:r[1]||(r[1]=i=>o(s.value+1))},[...r[3]||(r[3]=[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:"M9 5l7 7-7 7"})],-1)])],8,ym)])])):D("",!0)}}),km={key:0,class:"glass px-3 py-2 mx-3 mb-1 rounded-xl flex items-center gap-2 animate-fade-up-fast"},Cm=["onKeydown"],_m={key:0,class:"text-xs text-white/40 whitespace-nowrap select-none"},Am=["disabled"],Dm=["disabled"],Sm=te({__name:"ChatSearch",props:{messages:{}},emits:["scrollToMessage"],setup(e,{expose:t,emit:n}){const s=e,o=n,u=k(!1),r=k(""),i=k(0),a=k(null),l=A(()=>{if(!r.value.trim())return[];const E=r.value.toLowerCase(),C=[];for(let y=0;y<s.messages.length;y++)s.messages[y].content.toLowerCase().includes(E)&&C.push(y);return C}),c=A(()=>l.value.length);Ce(r,()=>{i.value=0,l.value.length>0&&o("scrollToMessage",l.value[0])});function f(){c.value!==0&&(i.value=(i.value+1)%c.value,o("scrollToMessage",l.value[i.value]))}function h(){c.value!==0&&(i.value=(i.value-1+c.value)%c.value,o("scrollToMessage",l.value[i.value]))}function b(){u.value=!0,Fe(()=>a.value?.focus())}function g(){u.value=!1,r.value="",i.value=0}function x(E){(E.metaKey||E.ctrlKey)&&E.key==="f"&&(E.preventDefault(),u.value?a.value?.focus():b())}return Pe(()=>{document.addEventListener("keydown",x)}),rr(()=>{document.removeEventListener("keydown",x)}),t({open:b,close:g,isOpen:u,matchingIndices:l,currentMatchIndex:i}),(E,C)=>u.value?(p(),m("div",km,[C[4]||(C[4]=d("svg",{class:"w-4 h-4 text-white/40 shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[d("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)),De(d("input",{ref_key:"inputRef",ref:a,"onUpdate:modelValue":C[0]||(C[0]=y=>r.value=y),type:"text",placeholder:"Search messages...",class:"flex-1 bg-transparent text-base text-white/90 placeholder:text-white/25 outline-none min-w-0",onKeydown:[Te(H(f,["exact"]),["enter"]),Te(H(h,["shift"]),["enter"]),Te(g,["escape"]),Te(H(h,["prevent"]),["up"]),Te(H(f,["prevent"]),["down"])]},null,40,Cm),[[Me,r.value]]),r.value?(p(),m("span",_m,_(c.value>0?`${i.value+1}/${c.value}`:"No results"),1)):D("",!0),d("button",{class:"touch-target rounded-md hover:bg-white/10 transition-colors text-white/50 hover:text-white/80 disabled:opacity-30",disabled:c.value===0,"aria-label":"Previous match",onClick:h},[...C[1]||(C[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:"M5 15l7-7 7 7"})],-1)])],8,Am),d("button",{class:"touch-target rounded-md hover:bg-white/10 transition-colors text-white/50 hover:text-white/80 disabled:opacity-30",disabled:c.value===0,"aria-label":"Next match",onClick:f},[...C[2]||(C[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:"M19 9l-7 7-7-7"})],-1)])],8,Dm),d("button",{class:"touch-target rounded-md hover:bg-white/10 transition-colors text-white/50 hover:text-white/80","aria-label":"Close search",onClick:g},[...C[3]||(C[3]=[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:"M6 18L18 6M6 6l12 12"})],-1)])])])):D("",!0)}}),Em=["title"],$m={class:"absolute -top-8 left-1/2 -translate-x-1/2 hidden group-hover:flex items-center px-2 py-1 rounded-md bg-black/80 text-xs text-white/80 whitespace-nowrap pointer-events-none z-10"},Fm=te({__name:"ContextBar",props:{messages:{},contextWindow:{},activeModel:{}},setup(e){const t=e,n=A(()=>t.contextWindow??2e5),s=A(()=>{let a=0;for(const l of t.messages)a+=l.content.length;return Math.ceil(a/4)}),o=A(()=>n.value===0?0:s.value/n.value*100),u={"claude-haiku-4.5":{input:.8,output:4},"claude-sonnet-4":{input:3,output:15},"claude-opus-4":{input:15,output:75}},r=A(()=>{const a=u[t.activeModel??""];if(!a)return null;const l=s.value*.7,c=s.value*.3;return(l*a.input+c*a.output)/1e6}),i=A(()=>{const a=s.value.toLocaleString(),l=n.value.toLocaleString();let c=`~${a} / ${l} tokens used`;return r.value!==null&&(c+=` · ~$${r.value.toFixed(4)}`),c});return(a,l)=>e.messages.length>0?(p(),m("div",{key:0,class:"h-1 mx-3 rounded-full bg-white/5 overflow-hidden shrink-0 group cursor-help relative",title:i.value},[d("div",{class:F(["h-full rounded-full transition-all duration-500",o.value>80?"bg-red-500":"bg-accent"]),style:Se({width:`${Math.min(o.value,100)}%`})},null,6),d("div",$m,_(i.value),1)],8,Em)):D("",!0)}}),Mm={class:"flex flex-col h-full"},Tm={class:"flex md:hidden gap-2 px-3 pt-2"},Im=["onClick"],Pm={class:"flex-1 min-h-0 flex gap-0.5 p-2"},Lm={class:"px-3 py-2 flex items-center justify-between border-b border-white/5"},zm={class:"text-xs text-accent font-medium truncate"},Bm={key:0,class:"text-xs text-white/30 animate-pulse"},Rm={class:"flex-1 overflow-y-auto p-3"},jm=["innerHTML"],Nm={key:1,class:"text-sm text-red-400/80"},Um={key:2,class:"text-sm text-white/25 italic"},Om={class:"px-3 py-2 flex items-center justify-between border-b border-white/5"},qm={class:"text-xs text-accent font-medium truncate"},Hm={key:0,class:"text-xs text-white/30 animate-pulse"},Wm={class:"flex-1 overflow-y-auto p-3"},Vm=["innerHTML"],Gm={key:1,class:"text-sm text-red-400/80"},Km={key:2,class:"text-sm text-white/25 italic"},Jm=te({__name:"ComparisonView",setup(e){const{model1:t,model2:n,response1:s,response2:o,isStreaming1:u,isStreaming2:r,error1:i,error2:a}=Do(),l=k(0),c=A(()=>[f.value,h.value]),f=A(()=>`${t.value.provider}/${t.value.model}`.split("/").pop()??"Model 1"),h=A(()=>`${n.value.provider}/${n.value.model}`.split("/").pop()??"Model 2"),b=new Be({html:!1,linkify:!0,breaks:!0}),g=A(()=>b.render(s.value)),x=A(()=>b.render(o.value));return(E,C)=>(p(),m("div",Mm,[d("div",Tm,[(p(!0),m(q,null,Z(c.value,(y,v)=>(p(),m("button",{key:v,class:F(["flex-1 text-sm min-h-[44px] rounded-lg transition-all",l.value===v?"bg-accent/20 text-accent":"text-white/50 hover:text-white/70"]),onClick:w=>l.value=v},_(y),11,Im))),128))]),d("div",Pm,[d("div",{class:F(["flex-1 min-w-0 flex flex-col glass rounded-xl overflow-hidden",{"hidden md:flex":l.value!==0}])},[d("div",Lm,[d("span",zm,_(f.value),1),S(u)?(p(),m("span",Bm,"streaming...")):D("",!0)]),d("div",Rm,[S(s)?(p(),m("div",{key:0,class:"chat-markdown text-sm leading-relaxed break-words text-white/90",innerHTML:g.value},null,8,jm)):S(i)?(p(),m("div",Nm,_(S(i)),1)):(p(),m("div",Um,"Waiting for response..."))])],2),d("div",{class:F(["flex-1 min-w-0 flex flex-col glass rounded-xl overflow-hidden",{"hidden md:flex":l.value!==1}])},[d("div",Om,[d("span",qm,_(h.value),1),S(r)?(p(),m("span",Hm,"streaming...")):D("",!0)]),d("div",Wm,[S(o)?(p(),m("div",{key:0,class:"chat-markdown text-sm leading-relaxed break-words text-white/90",innerHTML:x.value},null,8,Vm)):S(a)?(p(),m("div",Gm,_(S(a)),1)):(p(),m("div",Km,"Waiting for response..."))])],2)])]))}}),Zm={key:0,class:"px-3 md:px-4"},Ym={class:"flex items-center gap-1.5 flex-wrap"},Xm=["onClick"],Qm={class:"relative glass-card w-full max-w-md p-5 space-y-4 animate-scale-in"},e2={class:"flex items-center justify-between"},t2={class:"text-sm font-semibold text-white/90"},n2={class:"space-y-3"},s2={class:"flex gap-3"},o2={class:"flex-1"},u2={class:"w-20"},r2={class:"flex items-center gap-2 text-xs text-white/60"},i2={class:"flex items-center gap-2 pt-1"},a2=["disabled"],l2=te({__name:"PersonaSelector",setup(e){const t=yo(),n=wt(),s=k(!1),o=k(null),u=k(""),r=k(""),i=k(""),a=k("#F7931A"),l=k(!1),c=A(()=>n.activeConversation?.personaId??null);function f(y){return c.value===y}function h(y){const v=n.activeConversation;if(v){if(v.personaId===y){g(t.getPersona(y));return}v.personaId=y,v.updatedAt=Date.now()}}function b(){const y=n.activeConversation;y&&(y.personaId=void 0,y.updatedAt=Date.now())}function g(y){y?(o.value=y,u.value=y.name,r.value=y.systemPrompt,i.value=y.modelPreference??"",a.value=y.accentColor??"#F7931A",l.value=y.isDefault??!1):(o.value=null,u.value="",r.value="",i.value="",a.value="#F7931A",l.value=!1),s.value=!0}function x(){s.value=!1,o.value=null}function E(){if(!u.value.trim())return;const y={name:u.value.trim(),systemPrompt:r.value.trim(),modelPreference:i.value||void 0,accentColor:a.value,isDefault:l.value};if(o.value)t.updatePersona(o.value.id,y);else{const v=t.addPersona(y),w=n.activeConversation;w&&(w.personaId=v.id,w.updatedAt=Date.now())}x()}function C(){if(!o.value)return;const y=o.value.id,v=n.activeConversation;v?.personaId===y&&(v.personaId=void 0),t.deletePersona(y),x()}return(y,v)=>S(t).personas.length>0?(p(),m("div",Zm,[d("div",Ym,[(p(!0),m(q,null,Z(S(t).sortedPersonas,w=>(p(),m("button",{key:w.id,class:F(["px-2.5 py-1 rounded-full text-xs font-medium transition-all duration-200 border",f(w.id)?"bg-accent/20 text-accent border-accent/30":"bg-white/5 text-white/50 border-white/10 hover:text-white/70 hover:bg-white/10"]),onClick:M=>h(w.id)},[w.accentColor?(p(),m("span",{key:0,class:"inline-block w-2 h-2 rounded-full mr-1",style:Se({backgroundColor:w.accentColor})},null,4)):D("",!0),ce(" "+_(w.name),1)],10,Xm))),128)),d("button",{class:"px-2 py-1 rounded-full text-xs text-white/30 hover:text-white/60 border border-transparent hover:border-white/10 transition-all duration-200",onClick:v[0]||(v[0]=w=>s.value=!0)}," + New "),c.value?(p(),m("button",{key:0,class:"px-2 py-1 rounded-full text-xs text-white/30 hover:text-white/60 transition-all",title:"Clear persona",onClick:b}," ✕ ")):D("",!0)]),(p(),ie(bn,{to:"body"},[s.value?(p(),m("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4",onClick:H(x,["self"])},[v[14]||(v[14]=d("div",{class:"absolute inset-0 bg-black/60 backdrop-blur-sm"},null,-1)),d("div",Qm,[d("div",e2,[d("h3",t2,_(o.value?"Edit Persona":"New Persona"),1),d("button",{class:"min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg text-white/40 hover:text-white/70 hover:bg-white/10 transition-all",onClick:x},[...v[6]||(v[6]=[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("div",n2,[d("div",null,[v[7]||(v[7]=d("label",{class:"block text-xs text-white/40 mb-1"},"Name",-1)),De(d("input",{"onUpdate:modelValue":v[1]||(v[1]=w=>u.value=w),type:"text",class:"w-full bg-white/5 border border-white/10 rounded-lg px-3 py-2 text-base text-white/90 focus:outline-none focus:border-accent/50",placeholder:"e.g. Film Critic"},null,512),[[Me,u.value]])]),d("div",null,[v[8]||(v[8]=d("label",{class:"block text-xs text-white/40 mb-1"},"System Prompt",-1)),De(d("textarea",{"onUpdate:modelValue":v[2]||(v[2]=w=>r.value=w),class:"w-full bg-white/5 border border-white/10 rounded-lg px-3 py-2 text-base text-white/90 resize-none focus:outline-none focus:border-accent/50",rows:"5",placeholder:"You are a film critic who..."},null,512),[[Me,r.value]])]),d("div",s2,[d("div",o2,[v[10]||(v[10]=d("label",{class:"block text-xs text-white/40 mb-1"},"Model Preference",-1)),De(d("select",{"onUpdate:modelValue":v[3]||(v[3]=w=>i.value=w),class:"w-full bg-white/5 border border-white/10 rounded-lg px-3 py-2 text-base text-white/90 focus:outline-none focus:border-accent/50"},[...v[9]||(v[9]=[d("option",{value:""},"Default",-1),d("option",{value:"claude-haiku-4.5"},"Claude 4.5 Haiku",-1),d("option",{value:"claude-sonnet-4"},"Claude Sonnet 4",-1),d("option",{value:"claude-opus-4"},"Claude Opus 4",-1)])],512),[[$i,i.value]])]),d("div",u2,[v[11]||(v[11]=d("label",{class:"block text-xs text-white/40 mb-1"},"Colour",-1)),De(d("input",{"onUpdate:modelValue":v[4]||(v[4]=w=>a.value=w),type:"color",class:"w-full h-9 rounded-lg bg-white/5 border border-white/10 cursor-pointer"},null,512),[[Me,a.value]])])]),d("label",r2,[De(d("input",{"onUpdate:modelValue":v[5]||(v[5]=w=>l.value=w),type:"checkbox",class:"accent-[#F7931A]"},null,512),[[Fi,l.value]]),v[12]||(v[12]=ce(" Set as default for new conversations ",-1))])]),d("div",i2,[o.value?(p(),m("button",{key:0,class:"px-3 py-1.5 rounded-lg text-xs text-red-400/80 hover:text-red-400 hover:bg-red-400/10 transition-all",onClick:C}," Delete ")):D("",!0),v[13]||(v[13]=d("div",{class:"flex-1"},null,-1)),d("button",{class:"px-3 py-1.5 rounded-lg text-xs text-white/50 hover:text-white/70 hover:bg-white/10 transition-all",onClick:x}," Cancel "),d("button",{class:"px-4 py-1.5 rounded-lg text-xs bg-accent/20 text-accent hover:bg-accent/30 transition-all",disabled:!u.value.trim(),onClick:E},_(o.value?"Save":"Create"),9,a2)])])])):D("",!0)]))])):D("",!0)}}),c2={class:"glass-card relative w-full max-w-md p-5 space-y-5 animate-scale-in max-h-[85vh] overflow-y-auto scrollbar-hide"},d2={class:"flex items-center justify-between"},f2={class:"space-y-2"},p2={class:"text-xs font-semibold uppercase tracking-wider text-white/50"},h2={class:"space-y-1.5"},m2={key:0,class:"flex-1 flex gap-1.5"},g2=["onKeydown"],b2=["onClick"],x2={class:"flex-1 text-xs text-white/60 leading-relaxed"},v2={class:"shrink-0 flex gap-2 opacity-0 group-hover:opacity-100 transition-opacity"},y2=["onClick"],w2=["onClick"],k2={key:0,class:"flex gap-1.5"},C2=["disabled"],_2={key:1,class:"text-xs text-white/25"},A2={class:"space-y-3"},D2={class:"space-y-1"},S2={class:"flex items-center justify-between"},E2={class:"text-xs text-white/50 tabular-nums"},$2={class:"space-y-1"},F2={class:"flex items-center justify-between"},M2={class:"text-xs text-white/50 tabular-nums"},T2={class:"space-y-1"},I2={class:"flex items-center justify-between"},P2={class:"text-xs text-white/50 tabular-nums"},L2={class:"space-y-1"},z2={key:0,class:"flex gap-1 flex-wrap mb-1"},B2=["onClick"],R2={key:1,class:"text-xs text-white/30"},j2=te({__name:"SettingsModal",props:{open:{type:Boolean}},emits:["update:open"],setup(e){const t=e,n=k(null),s=k(null);function o(j){const R=n.value;if(!R)return;const X=R.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(X.length===0)return;const Q=X[0],K=X[X.length-1];j.shiftKey&&document.activeElement===Q?(j.preventDefault(),K.focus()):!j.shiftKey&&document.activeElement===K&&(j.preventDefault(),Q.focus())}Ce(()=>t.open,async j=>{j&&(await Fe(),s.value?.focus())});const u=lr(),r=k(""),i=k(null),a=k("");function l(){r.value.trim()&&(u.addItem(r.value),r.value="")}function c(j){i.value=j.id,a.value=j.text}function f(j){a.value.trim()&&u.updateItem(j,a.value),i.value=null,a.value=""}function h(){i.value=null,a.value=""}const b=wt(),g=A(()=>b.activeConversation),x=k(""),E=k(1),C=k(4096),y=k(1),v=k([]);Ce(()=>b.activeConversationId,()=>w(),{immediate:!0});function w(){const j=g.value;E.value=j?.temperature??1,C.value=j?.maxTokens??4096,y.value=j?.topP??1,v.value=j?.stopSequences?[...j.stopSequences]:[]}function M(){const j=g.value;j&&(j.temperature=E.value,j.maxTokens=C.value,j.topP=y.value,j.updatedAt=Date.now())}function P(){const j=x.value.trim();if(!j)return;v.value.push(j),x.value="";const R=g.value;R&&(R.stopSequences=[...v.value],R.updatedAt=Date.now())}function U(j){v.value.splice(j,1);const R=g.value;R&&(R.stopSequences=[...v.value],R.updatedAt=Date.now())}function oe(){E.value=1,C.value=4096,y.value=1,v.value=[],x.value="";const j=g.value;j&&(j.temperature=void 0,j.maxTokens=void 0,j.topP=void 0,j.stopSequences=void 0,j.updatedAt=Date.now())}return(j,R)=>(p(),ie(bn,{to:"body"},[pe(Zn,{name:"settings-modal"},{default:qe(()=>[e.open?(p(),m("div",{key:0,ref_key:"dialogRef",ref:n,role:"dialog","aria-modal":"true","aria-label":"Settings",class:"fixed inset-0 z-50 flex items-center justify-center p-4",onKeydown:[R[8]||(R[8]=Te(X=>j.$emit("update:open",!1),["escape"])),Te(o,["tab"])]},[d("div",{class:"absolute inset-0 bg-black/70 backdrop-blur-sm",onClick:R[0]||(R[0]=H(X=>j.$emit("update:open",!1),["self"]))}),d("div",c2,[d("div",d2,[R[10]||(R[10]=d("h2",{class:"text-sm font-semibold text-white/96"},"Settings",-1)),d("button",{ref_key:"closeButtonRef",ref:s,class:"min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg text-white/40 hover:text-white/70 hover:bg-white/10 transition-all","aria-label":"Close settings",onClick:R[1]||(R[1]=X=>j.$emit("update:open",!1))},[...R[9]||(R[9]=[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)])],512)]),d("div",f2,[d("h3",p2," Memory ("+_(S(u).items.length)+"/20) ",1),d("div",h2,[(p(!0),m(q,null,Z(S(u).items,X=>(p(),m("div",{key:X.id,class:"group flex items-start gap-2 rounded-lg bg-white/5 border border-white/5 px-2.5 py-1.5"},[i.value===X.id?(p(),m("div",m2,[De(d("input",{"onUpdate:modelValue":R[2]||(R[2]=Q=>a.value=Q),type:"text",class:"flex-1 bg-transparent text-base text-white/80 outline-none",onKeydown:[Te(Q=>f(X.id),["enter"]),Te(h,["escape"])]},null,40,g2),[[Me,a.value]]),d("button",{class:"text-xs text-accent/70 hover:text-accent",onClick:Q=>f(X.id)}," Save ",8,b2)])):(p(),m(q,{key:1},[d("p",x2,_(X.text),1),d("div",v2,[d("button",{class:"min-w-[44px] min-h-[44px] flex items-center justify-center rounded text-white/30 hover:text-white/60 hover:bg-white/10 transition-all",title:"Edit",onClick:Q=>c(X)},[...R[11]||(R[11]=[d("svg",{class:"w-3 h-3",viewBox:"0 0 20 20",fill:"currentColor"},[d("path",{d:"M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"})],-1)])],8,y2),d("button",{class:"min-w-[44px] min-h-[44px] flex items-center justify-center rounded text-white/30 hover:text-red-400/80 hover:bg-white/10 transition-all",title:"Delete",onClick:Q=>S(u).deleteItem(X.id)},[...R[12]||(R[12]=[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:"M6 18L18 6M6 6l12 12"})],-1)])],8,w2)])],64))]))),128)),S(u).isFull?(p(),m("p",_2," Maximum 20 memories reached ")):(p(),m("div",k2,[De(d("input",{"onUpdate:modelValue":R[3]||(R[3]=X=>r.value=X),type:"text",class:"flex-1 bg-white/5 border border-white/10 rounded-lg px-2.5 py-1.5 text-base text-white/80 outline-none focus:border-accent/40 placeholder:text-white/25",placeholder:"Add a memory...",onKeydown:Te(l,["enter"])},null,544),[[Me,r.value]]),d("button",{class:"px-2.5 py-1.5 rounded-lg text-xs bg-accent/15 text-accent/80 hover:bg-accent/25 transition-all",disabled:!r.value.trim(),onClick:l}," Add ",8,C2)]))])]),R[18]||(R[18]=d("div",{class:"border-t border-white/5"},null,-1)),d("div",A2,[R[17]||(R[17]=d("h3",{class:"text-xs font-semibold uppercase tracking-wider text-white/50"}," Advanced ",-1)),g.value?(p(),m(q,{key:0},[d("div",D2,[d("div",S2,[R[13]||(R[13]=d("label",{class:"text-xs text-white/50"},"Temperature",-1)),d("span",E2,_(E.value.toFixed(2)),1)]),De(d("input",{"onUpdate:modelValue":R[4]||(R[4]=X=>E.value=X),type:"range",min:"0",max:"1",step:"0.05",class:"w-full h-1 accent-[#F7931A] bg-white/10 rounded-full appearance-none cursor-pointer",onInput:M},null,544),[[Me,E.value,void 0,{number:!0}]])]),d("div",$2,[d("div",F2,[R[14]||(R[14]=d("label",{class:"text-xs text-white/50"},"Max Tokens",-1)),d("span",M2,_(C.value),1)]),De(d("input",{"onUpdate:modelValue":R[5]||(R[5]=X=>C.value=X),type:"range",min:"256",max:"8192",step:"256",class:"w-full h-1 accent-[#F7931A] bg-white/10 rounded-full appearance-none cursor-pointer",onInput:M},null,544),[[Me,C.value,void 0,{number:!0}]])]),d("div",T2,[d("div",I2,[R[15]||(R[15]=d("label",{class:"text-xs text-white/50"},"Top P",-1)),d("span",P2,_(y.value.toFixed(2)),1)]),De(d("input",{"onUpdate:modelValue":R[6]||(R[6]=X=>y.value=X),type:"range",min:"0",max:"1",step:"0.05",class:"w-full h-1 accent-[#F7931A] bg-white/10 rounded-full appearance-none cursor-pointer",onInput:M},null,544),[[Me,y.value,void 0,{number:!0}]])]),d("div",L2,[R[16]||(R[16]=d("label",{class:"text-xs text-white/50"},"Stop Sequences",-1)),v.value.length>0?(p(),m("div",z2,[(p(!0),m(q,null,Z(v.value,(X,Q)=>(p(),m("span",{key:Q,class:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-white/5 border border-white/10 text-xs text-white/50"},[ce(_(X)+" ",1),d("button",{class:"text-white/30 hover:text-white/60",onClick:K=>U(Q)},"×",8,B2)]))),128))])):D("",!0),De(d("input",{"onUpdate:modelValue":R[7]||(R[7]=X=>x.value=X),type:"text",class:"w-full bg-white/5 border border-white/10 rounded-lg px-2.5 py-1.5 text-base text-white/80 outline-none focus:border-accent/40 placeholder:text-white/25",placeholder:"Add stop sequence (Enter to add)",onKeydown:Te(P,["enter"])},null,544),[[Me,x.value]])]),d("button",{class:"text-xs text-white/30 hover:text-white/50 transition-colors",onClick:oe}," Reset to defaults ")],64)):(p(),m("p",R2,"Start a conversation to configure parameters"))])])],544)):D("",!0)]),_:1})]))}}),N2=os(j2,[["__scopeId","data-v-c97db749"]]),U2={key:1,class:"flex items-center justify-center p-4",role:"alert"},O2={class:"flex items-start gap-3"},q2={class:"min-w-0"},H2=te({__name:"ErrorBoundary",props:{title:{default:"Something went wrong"}},setup(e){const{isDark:t}=He(),n=k(null),s=k("");Mi(u=>(n.value=u,s.value=u.message||"An unexpected error occurred",console.error("[ErrorBoundary]",u),!1));function o(){n.value=null,s.value=""}return(u,r)=>n.value?(p(),m("div",U2,[d("div",{class:F(["rounded-xl p-4 max-w-sm w-full space-y-3",S(t)?"bg-red-500/10 border border-red-500/20":"bg-red-50 border border-red-200"])},[d("div",O2,[r[0]||(r[0]=d("svg",{class:"w-5 h-5 text-red-500 shrink-0 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4.5c-.77-.833-2.694-.833-3.464 0L3.34 16.5c-.77.833.192 2.5 1.732 2.5z"})],-1)),d("div",q2,[d("h3",{class:F(["text-sm font-semibold",S(t)?"text-red-400":"text-red-900"])},_(e.title),3),s.value?(p(),m("p",{key:0,class:F(["text-xs mt-1 break-words",S(t)?"text-red-300/70":"text-red-700/70"])},_(s.value),3)):D("",!0)])]),d("button",{class:F(["text-xs px-3 py-1.5 rounded-lg transition-colors",S(t)?"text-red-300 hover:bg-red-500/20":"text-red-600 hover:bg-red-100"]),onClick:o}," Try again ",2)],2)])):bo(u.$slots,"default",{key:0})}}),W2={class:"flex flex-col h-full rounded-2xl overflow-visible transition-all duration-300"},V2={key:0,class:"px-4 pb-3"},G2={key:0,class:"flex items-center justify-center h-full p-4"},K2={class:"text-center space-y-4 animate-fade-up"},J2=["data-index"],Z2={key:2,class:"px-4 pb-4"},Y2={key:4,class:"px-3 pb-1 flex items-center gap-1.5"},X2={class:"text-xs px-2 py-0.5 rounded-md bg-accent/15 text-accent font-medium truncate max-w-[200px]"},og=te({__name:"ChatWindow",props:{variant:{default:"standalone"},side:{default:"right"},showClose:{type:Boolean,default:!1}},emits:["switchSide","close"],setup(e){const t=wt(),{sendMessage:n,stopGeneration:s,editAndResend:o,regenerateLastResponse:u,activeModel:r}=hr(),{updatePanelFromText:i,panelOpen:a,panelFilms:l,panelTitle:c,activeTab:f,availableTabs:h,setActiveTab:b,enterDesignSystemMode:g}=is(),x=wo(),E=yo(),C=Do(),y=k(null),v=k(null),w=k(!1),M=new Map;function P(){const z=y.value,L=t.activeConversationId;z&&L&&M.set(L,z.scrollTop)}function U(z){const L=M.get(z);L!==void 0&&Fe(()=>{const se=y.value;se&&(se.scrollTop=L)})}function oe(z){K.value.scrollToIndex(z,{align:"center"})}const j=k(null);function R(z,L){const se=L.slice(0,100)+(L.length>100?"...":"");j.value={messageId:z,excerpt:se}}function X(){j.value=null}const Q=A(()=>t.messages),K=cl(A(()=>({count:Q.value.length,getScrollElement:()=>y.value,estimateSize:z=>Q.value[z]?.role==="user"?60:200,overscan:5}))),I=A(()=>t.isStreaming),Y=A(()=>t.chatCollapsed),he=A(()=>t.showHistory),be=A(()=>t.activeConversation?.title??"New Chat"),Ke=A(()=>t.activeConversationId?.slice(0,8)??"—"),ee=A(()=>{const z=Q.value;return z.length===0?!0:z[z.length-1].content===""});function Ae(z,L){if(z[L]?.role!=="assistant")return"";for(let se=L-1;se>=0;se--)if(z[se]?.role==="user")return z[se].content??"";return""}function ct(){t.createConversation("New Chat",E.defaultPersona?.id),t.showHistory=!1}function O(z){t.setActiveConversation(z),t.showHistory=!1}function W(){s(),C.stopComparison()}async function ae(z,L){await o(z,L)}async function xe(){await u()}function T(z){const L=t.activeConversationId;L&&t.branchFromMessage(L,z)}function J(z,L){const se=t.activeConversationId;se&&t.setMessageFeedback(se,z,L)}function me(z){const L=t.activeConversationId??t.createConversation();t.addMessage(L,{role:"user",content:`[Extract] ${z.slice(0,80)}${z.length>80?"…":""}`}),t.addMessage(L,{role:"assistant",content:z}),i(z,"",[])}async function ye(z,L=[]){const se=z.trim().toLowerCase();if(se==="/code"){x.enterCodeMode(),a.value=!0,h.value.includes("code")||(h.value=[...h.value,"code"]),b("code");const ne=t.activeConversationId;ne&&(t.addMessage(ne,{role:"user",content:"/code"}),t.addMessage(ne,{role:"assistant",content:"Code mode activated. Select a project from the content panel to start coding."}));return}if(se==="/seed"){await t.loadSeedChats(),t.chatCollapsed=!0,t.showHistory=!1;return}if(se==="/nostr"){a.value=!0,h.value.includes("nostr")||(h.value=[...h.value,"nostr"]),b("nostr");const ne=t.activeConversationId;ne&&(t.addMessage(ne,{role:"user",content:"/nostr"}),t.addMessage(ne,{role:"assistant",content:"Nostr feed opened. Browse notes, articles, and zaps from the network."}));return}if(se==="/design"){g();const ne=t.activeConversationId;ne&&(t.addMessage(ne,{role:"user",content:"/design"}),t.addMessage(ne,{role:"assistant",content:"Design system viewer opened. Browse colors, typography, spacing, and components."}));return}if(se==="/freefilms"){const{freeFilms:ne}=await go(async()=>{const{freeFilms:$e}=await import("./freeFilms-B9DmMKj5.js");return{freeFilms:$e}},[]);l.value=ne,c.value="Free Documentary Films",a.value=!0,h.value=["film","prompt"],b("film");const ve=t.activeConversationId;ve&&(t.addMessage(ve,{role:"user",content:"/freefilms"}),t.addMessage(ve,{role:"assistant",content:`Browse ${ne.length} free documentary films from InDeeHub. Click any film to see details, and hit play to watch.`}));return}if((se==="/code exit"||se==="/exit")&&x.isCodeMode.value){x.exitCodeMode(),h.value=h.value.filter(ve=>ve!=="code");const ne=t.activeConversationId;ne&&t.addMessage(ne,{role:"assistant",content:"Code mode deactivated."});return}let le=z;if(j.value&&(le=`${j.value.excerpt.split(`
`).map(ve=>`> ${ve}`).join(`
`)}

${z}`,X()),C.isComparing.value){const ne=t.activeConversationId??t.createConversation();t.addMessage(ne,{role:"user",content:le,images:L.length>0?L:void 0});const ve=t.messages.map($e=>({role:$e.role,content:$e.content}));await C.streamBothModels(sa,ve);return}await n(le,L.length>0?L:void 0)}function we(z,L){if((z.content?.trim().toLowerCase()??"")==="/code"){x.enterCodeMode(),a.value=!0,h.value.includes("code")||(h.value=[...h.value,"code"]),b("code");return}L?.content&&i(L.content,z.content,L.webResults??[])}function Ee(){Fe(()=>{Q.value.length>0&&K.value.scrollToIndex(Q.value.length-1,{align:"end"}),Fe(()=>{const z=y.value;z&&(z.scrollTop=z.scrollHeight)})})}Ce(Y,(z,L)=>{!z&&L&&Ee()});const{isKeyboardOpen:Re}=Ti();return Ce(Re,z=>{z&&Ee()}),Ce(()=>t.activeConversationId,(z,L)=>{L&&P(),z&&U(z)}),Ce(()=>Q.value.length,()=>Ee()),Ce(()=>{const z=Q.value,L=z[z.length-1];return L?{content:L.content,webResults:L.webResults}:null},z=>{if(Ee(),z?.content){const L=Q.value,se=L[L.length-1],ne=[...L].reverse().find(ve=>ve.role==="user")?.content?.trim()??"";ne.startsWith("/")||i(z.content,ne,se?.webResults??[])}},{deep:!0,immediate:!0}),(z,L)=>{const se=Ii("router-link");return p(),m("div",W2,[pe(jl,{title:be.value,"conversation-id":Ke.value,side:e.side,"show-close":e.showClose,onSwitchSide:L[0]||(L[0]=le=>z.$emit("switchSide")),onNewChat:ct,onClose:L[1]||(L[1]=le=>z.$emit("close")),onOpenSettings:L[2]||(L[2]=le=>w.value=!0)},null,8,["title","conversation-id","side","show-close"]),pe(wm),pe(Sm,{ref_key:"chatSearchRef",ref:v,messages:Q.value,onScrollToMessage:oe},null,8,["messages"]),pe(Fm,{messages:Q.value,"active-model":S(r)},null,8,["messages","active-model"]),pe(l2),pe(N2,{open:w.value,"onUpdate:open":L[3]||(L[3]=le=>w.value=le)},null,8,["open"]),he.value?(p(),ie(mm,{key:0,onSelect:O,onNewChat:ct})):Y.value?(p(),m(q,{key:1},[pe(am,{messages:Q.value,onSelect:we},null,8,["messages"]),I.value?(p(),m("div",V2,[pe(ur)])):D("",!0)],64)):(p(),m("div",{key:2,ref_key:"messageListRef",ref:y,class:"relative z-0 flex-1 min-h-0 overflow-y-auto scrollbar-hide"},[Q.value.length===0?(p(),m("div",G2,[d("div",K2,[L[6]||(L[6]=d("div",{class:"empty-state-icon w-16 h-16 rounded-2xl path-glass-icon flex items-center justify-center mx-auto overflow-hidden"},[d("span",{class:"text-2xl text-[#fafafa]"},"✦")],-1)),L[7]||(L[7]=d("p",{class:"text-sm text-white/30"}," Start a conversation ",-1)),pe(se,{to:"/guide",class:"inline-flex items-center gap-1.5 text-xs text-white/25 hover:text-white/50 transition-colors"},{default:qe(()=>[...L[5]||(L[5]=[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":"1.5",d:"M12 6.042A8.967 8.967 0 006 3.75c-1.052 0-2.062.18-3 .512v14.25A8.987 8.987 0 016 18c2.305 0 4.408.867 6 2.292m0-14.25a8.966 8.966 0 016-2.292c1.052 0 2.062.18 3 .512v14.25A8.987 8.987 0 0018 18a8.967 8.967 0 00-6 2.292m0-14.25v14.25"})],-1),ce(" AIUI Guide ",-1)])]),_:1})])])):(p(),m("div",{key:1,style:Se({height:`${S(K).getTotalSize()}px`,width:"100%",position:"relative"})},[(p(!0),m(q,null,Z(S(K).getVirtualItems(),le=>(p(),m("div",{key:Q.value[le.index].id,ref_for:!0,ref:ne=>ne&&S(K).measureElement(ne),"data-index":le.index,style:Se({position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${le.start}px)`}),class:F(["px-4 py-2.5",le.index===0?"pt-6":""])},[pe(H2,{title:"Message failed to render"},{default:qe(()=>[pe(ch,{message:Q.value[le.index],index:le.index,"triggering-query":Ae(Q.value,le.index),onEdit:ae,onRegenerate:xe,onBranch:T,onReply:R,onFeedback:J},null,8,["message","index","triggering-query"])]),_:2},1024)],14,J2))),128))],4)),I.value&&ee.value?(p(),m("div",Z2,[pe(ur)])):D("",!0)],512)),S(C).isComparing.value&&(S(C).response1.value||S(C).response2.value)?(p(),ie(Jm,{key:3,class:"flex-1 min-h-0"})):D("",!0),S(x).isCodeMode.value&&S(x).activeProject.value?(p(),m("div",Y2,[d("span",X2,_(S(x).activeProject.value.name),1),d("button",{class:"text-white/30 hover:text-white/60 transition-colors p-0.5",onClick:L[4]||(L[4]=le=>S(x).exitCodeMode())},[...L[8]||(L[8]=[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:"M6 18L18 6M6 6l12 12"})],-1)])])])):D("",!0),pe(Zh,{disabled:I.value||S(C).isAnyStreaming.value,streaming:I.value||S(C).isAnyStreaming.value,placeholder:S(f)==="code"?"Code...":I.value?"Waiting for response...":"Message AIUI...","active-tab":S(f),"reply-to":j.value,onSend:ye,onExtract:me,onStop:W,onClearReply:X},null,8,["disabled","streaming","placeholder","active-tab","reply-to"])])}}});export{Be as M,og as _,wo as a,ou as b,hr as c,sg as d,ng as e,H2 as f,Va as s,is as u};
