"use strict";(()=>{var e={};e.id=875,e.ids=[875],e.modules={92885:e=>{e.exports=require("@supabase/supabase-js")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},39810:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>y,patchFetch:()=>x,requestAsyncStorage:()=>b,routeModule:()=>m,serverHooks:()=>E,staticGenerationAsyncStorage:()=>f});var s={};t.r(s),t.d(s,{GET:()=>h,dynamic:()=>u,fetchCache:()=>d});var o=t(49303),a=t(88716),i=t(60670),n=t(87070),l=t(92885),c=t(74016);let u="force-dynamic",d="force-no-store",p=process.env.NEXT_PUBLIC_SUPABASE_URL||"",g=process.env.SUPABASE_SERVICE_ROLE_KEY||"";async function h(e){console.log(`
=== SIMPLE FEED REQUEST @ ${new Date().toISOString()} ===`),console.log(`URL: ${e.url}`);try{let r=new URL(e.url),t=r.searchParams.get("before"),s="true"===r.searchParams.get("refresh");if(console.log(`Request params: beforeCursor=${t||"none"}, refresh=${s}`),s&&console.log("\uD83D\uDD04 REFRESH requested - ensuring fresh data"),!p||!g)return console.error("Missing Supabase credentials"),n.NextResponse.json({error:"Server configuration error"},{status:500});let o=(0,l.createClient)(p,g),{data:a}=await o.from("flushing_records").select("id").order("id",{ascending:!1}).limit(1);console.log("Highest ID in database:",a?.[0]?.id||"unknown");let i=[];if(t){console.log(`Fetching entries older than ID ${t}`);let{data:e,error:r}=await o.from("flushing_records").select("*").lt("id",t).order("id",{ascending:!1}).limit(20);if(r)throw Error(`Database query error: ${r.message}`);i=e||[]}else{console.log("Fetching latest entries");let{data:e,error:r}=await o.from("flushing_records").select("*").order("id",{ascending:!1}).limit(20);if(r)throw Error(`Database query error: ${r.message}`);i=e||[]}if(console.log(`Query returned ${i.length} entries`),i.length>0){console.log("Top 5 entries:");for(let e=0;e<Math.min(5,i.length);e++){let r=i[e];console.log(`  ${e+1}. ID: ${r.id}, Handle: ${r.handle||"unknown"}, Text: "${r.text.substring(0,20)}..."`)}}else console.warn("No entries found - this may indicate a database problem");let u=i.map(e=>{if((0,c.Lt)(e.text))return null;let r=e.handle||(e.did.startsWith("did:plc:")?`${e.did.substring(8,16)}...`:`${e.did.substring(0,8)}...`);return{id:e.id,uri:e.uri,cid:e.cid,authorDid:e.did,authorHandle:r,text:(0,c.oO)(e.text),emoji:e.emoji,createdAt:e.created_at}}).filter(e=>null!==e);return n.NextResponse.json({entries:u,source:"simple-query"})}catch(e){return console.error("Error in simple feed API:",e),n.NextResponse.json({error:"Failed to fetch feed",message:e.message},{status:500})}}let m=new o.AppRouteRouteModule({definition:{kind:a.x.APP_ROUTE,page:"/api/bluesky/feed-simple/route",pathname:"/api/bluesky/feed-simple",filename:"route",bundlePath:"app/api/bluesky/feed-simple/route"},resolvedPagePath:"/Users/dame/Library/Mobile Documents/com~apple~CloudDocs/Software/flushes/app/src/app/api/bluesky/feed-simple/route.ts",nextConfigOutput:"standalone",userland:s}),{requestAsyncStorage:b,staticGenerationAsyncStorage:f,serverHooks:E}=m,y="/api/bluesky/feed-simple/route";function x(){return(0,i.patchFetch)({serverHooks:E,staticGenerationAsyncStorage:f})}},74016:(e,r,t)=>{t.d(r,{Lt:()=>a,oO:()=>i});let s=["slur","racist","bigot","bigotry","homophobic","transphobic","fuck","damn","ass","asshole","bitch","kill","murder","attack","violence","harm","hurt","retard","retarded","idiot","stupid","dumb","penis","vagina","dick","cock","pussy","sex","masturbate","orgasm","horny","erection","blowjob","handjob","viagra","cialis","enlarge","cryptocurrency","bitcoin","ethereum","make money","get rich","earn fast","pyramid","scheme","discord.gg","telegram.me"],o=[/\bc[hH][iIl1][nN][kKsS]?\b/,/\bc[oO]{2}[nN][sS]?\b/,/\bf[aA][gG]{1,2}([oOeE][tT]?|[iIyY][nNeE]?)?s?\b/,/\bk[iIyY][kK][eE][sS]?\b/,/\bn[iIl1oO][gG]{2}([aAeE][rR]?|[lL][eE][tT]|[nNoO][gG])?s?\b/,/\bn[iIl1oO][gG]{2}[aAeE][sS]\b/,/\bt[rR][aA][nN][nN][iIyY][eE]?[sS]?\b/];function a(e){if(!e)return!1;let r=e.toLowerCase().replace(/0/g,"o").replace(/1/g,"i").replace(/3/g,"e").replace(/4/g,"a").replace(/5/g,"s").replace(/\$/g,"s").replace(/@/g,"a").replace(/!/g,"i").replace(/\*/g,"").replace(/\./g,"").replace(/-/g,"").replace(/_/g,"").replace(/\s+/g," ");for(let r of o)if(r.test(e))return!0;return s.some(e=>{if(RegExp(`\\b${e}\\b`,"i").test(r))return!0;let t=e.split("").join("\\s*");return!!RegExp(`\\b${t}\\b`,"i").test(r)||e.length<=4&&RegExp(e,"i").test(r)})}function i(e){if(!e)return e;let r=e;return s.forEach(e=>{let t=RegExp(`\\b${e}\\b`,"gi");r=r.replace(t,"*".repeat(e.length))}),s.forEach(e=>{if(e.length>2){let t=e.split("").join("\\s*"),s=RegExp(`\\b${t}\\b`,"gi");r=r.replace(s,e=>"*".repeat(e.replace(/\s+/g,"").length))}}),s.filter(e=>e.length<=4).forEach(e=>{let t=RegExp(`(?<!\\w)${e}(?!\\w)`,"gi");r=r.replace(t,"*".repeat(e.length))}),r}}};var r=require("../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[276,972],()=>t(39810));module.exports=s})();