"use strict";(()=>{var e={};e.id=555,e.ids=[555],e.modules={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")},49411:e=>{e.exports=require("node:path")},70066:(e,t,r)=>{r.r(t),r.d(t,{headerHooks:()=>b,originalPathname:()=>g,patchFetch:()=>k,requestAsyncStorage:()=>p,routeModule:()=>h,serverHooks:()=>m,staticGenerationAsyncStorage:()=>f,staticGenerationBailout:()=>w});var a={};r.r(a),r.d(a,{GET:()=>l,POST:()=>d});var n=r(95419),o=r(69108),s=r(99678),i=r(98984),u=r(15911);function c(e,t){let{url:r,headers:a,...n}=e,o=new URL(r);if(process.env.DEBUG_HUB_HTTP_URL){let e=new URL(process.env.DEBUG_HUB_HTTP_URL);o.protocol=e.protocol,o.hostname=e.hostname,o.port=e.port}else o.protocol="https",o.hostname="hub-api.neynar.com",o.port="443";return console.log("info: Mock hub: Forwarding message to",o.toString()),o.pathname=t.join("/"),a.set("api_key","NEYNAR_FRAMES_JS"),a.delete("host"),a.delete("referer"),new Request(o,{headers:a,...n})}async function l(e,{params:{hubPath:t}}){let r=await (0,u.K)(e,t);if(r)return i.NextResponse.json(await r.json(),{status:r.status});console.warn(`info: Mock hub: Forwarding message ${t.join("/")} to a real hub`);let a=c(e,t),n=await fetch(a);return i.NextResponse.json(await n.json(),{status:n.status})}async function d(e,{params:{hubPath:t}}){console.warn(`info: Mock hub: Forwarding message ${t.join("/")} to a real hub`);let r=c(e,t),a=await fetch(r);return i.NextResponse.json(await a.json(),{status:a.status})}let h=new n.AppRouteRouteModule({definition:{kind:o.x.APP_ROUTE,page:"/hub/[...hubPath]/route",pathname:"/hub/[...hubPath]",filename:"route",bundlePath:"app/hub/[...hubPath]/route"},resolvedPagePath:"/Users/stephan/environments/mod/framesjs-monorepo/packages/debugger/app/hub/[...hubPath]/route.ts",nextConfigOutput:"",userland:a}),{requestAsyncStorage:p,staticGenerationAsyncStorage:f,serverHooks:m,headerHooks:b,staticGenerationBailout:w}=h,g="/hub/[...hubPath]/route";function k(){return(0,s.patchFetch)({serverHooks:m,staticGenerationAsyncStorage:f})}},15911:(e,t,r)=>{r.d(t,{K:()=>h,H:()=>p});var a=r(31542);r(68616);let n=require("node:fs/promises");var o=r.n(n),s=r(49411),i=r.n(s);let u=require("node:os");var c=r.n(u);function l(e){return Array.from(e).sort().map(e=>e.join("=")).join("&")}function d(){return i().join(c().tmpdir(),"framesjsmocks.json")}async function h(e,t){let r;let a=d();if(!await o().access(a,o().constants.F_OK).then(()=>!0).catch(()=>!1))return;let n=await o().readFile(a,"utf-8");try{r=JSON.parse(n)}catch(e){console.error(e);return}if(!r.enabled)return;let s=new URL(e.url).searchParams,i=`/${t.join("/")}?${l(s)}`,u=r.requests[i];if(u?.ok!=null)return console.log(`info: Mock hub: Found mock for ${i}, returning ${u.ok?"200":"404"}`),new Response(JSON.stringify(u),{headers:{"content-type":"application/json"},status:u.ok?200:404})}async function p(e){let{mockData:t,untrustedData:r}=await e.clone().json();if(!t||!r?.castId)return;let{fid:a,castId:n}=r,s=`/v1/linkById?${l(new URLSearchParams({fid:a,target_fid:n.fid,link_type:"follow"}))}`,i=`/v1/linkById?${l(new URLSearchParams({fid:n.fid,target_fid:a,link_type:"follow"}))}`,u=`/v1/reactionById?${l(new URLSearchParams({fid:a,reaction_type:"1",target_fid:n.fid,target_hash:n.hash}))}`,c=`/v1/reactionById?${l(new URLSearchParams({fid:a,reaction_type:"2",target_fid:n.fid,target_hash:n.hash}))}`,h=d(),p={enabled:t.enabled,requests:{[s]:{ok:t.enabled&&t.requesterFollowsCaster},[i]:{ok:t.enabled&&t.casterFollowsRequester},[u]:{ok:t.enabled&&t.likedCast},[c]:{ok:t.enabled&&t.recastedCast}}};await o().writeFile(h,JSON.stringify(p,null,2))}(0,r(42053).h)([h,p]),(0,a.j)("668cc1704f67d1862dec0e2bb3930b410f76e7cf",h),(0,a.j)("200203f807ba81e68f51128a595b566297c0c674",p)},95419:(e,t,r)=>{e.exports=r(30517)}};var t=require("../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),a=t.X(0,[1638,8984,9222],()=>r(70066));module.exports=a})();