"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")},70066:(e,t,a)=>{a.r(t),a.d(t,{headerHooks:()=>b,originalPathname:()=>g,patchFetch:()=>k,requestAsyncStorage:()=>p,routeModule:()=>h,serverHooks:()=>m,staticGenerationAsyncStorage:()=>f,staticGenerationBailout:()=>w});var r={};a.r(r),a.d(r,{GET:()=>l,POST:()=>d});var n=a(95419),o=a(69108),s=a(99678),i=a(98984),u=a(35070);function c(e,t){let{url:a,headers:r,...n}=e,o=new URL(a);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("/"),r.set("api_key","NEYNAR_FRAMES_JS"),r.delete("host"),r.delete("referer"),new Request(o,{headers:r,...n})}async function l(e,{params:{hubPath:t}}){let a=await (0,u.K)(e,t);if(a)return i.NextResponse.json(await a.json(),{status:a.status});console.warn(`info: Mock hub: Forwarding message ${t.join("/")} to a real hub`);let r=c(e,t),n=await fetch(r);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 a=c(e,t),r=await fetch(a);return i.NextResponse.json(await r.json(),{status:r.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:r}),{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})}},35070:(e,t,a)=>{a.d(t,{K:()=>h,H:()=>p});var r=a(31542);a(68616);let n=require("node:fs/promises");var o=a.n(n);let s=require("node:path");var i=a.n(s);let u=require("node:os");var c=a.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 a;let r=d();if(!await o().access(r,o().constants.F_OK).then(()=>!0).catch(()=>!1))return;let n=await o().readFile(r,"utf-8");try{a=JSON.parse(n)}catch(e){console.error(e);return}if(!a.enabled)return;let s=new URL(e.url).searchParams,i=`/${t.join("/")}?${l(s)}`,u=a.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:{fid:a,castId:r}}=await e.clone().json(),n=`/v1/linkById?${l(new URLSearchParams({fid:a,target_fid:r.fid,link_type:"follow"}))}`,s=`/v1/linkById?${l(new URLSearchParams({fid:r.fid,target_fid:a,link_type:"follow"}))}`,i=`/v1/reactionById?${l(new URLSearchParams({fid:a,reaction_type:"1",target_fid:r.fid,target_hash:r.hash}))}`,u=`/v1/reactionById?${l(new URLSearchParams({fid:a,reaction_type:"2",target_fid:r.fid,target_hash:r.hash}))}`,c=d(),h={enabled:t.enabled,requests:{[n]:{ok:t.enabled&&t.requesterFollowsCaster},[s]:{ok:t.enabled&&t.casterFollowsRequester},[i]:{ok:t.enabled&&t.likedCast},[u]:{ok:t.enabled&&t.recastedCast}}};await o().writeFile(c,JSON.stringify(h,null,2))}(0,a(42053).h)([h,p]),(0,r.j)("668cc1704f67d1862dec0e2bb3930b410f76e7cf",h),(0,r.j)("200203f807ba81e68f51128a595b566297c0c674",p)}};var t=require("../../../webpack-runtime.js");t.C(e);var a=e=>t(t.s=e),r=t.X(0,[1638,2791,9222],()=>a(70066));module.exports=r})();