module.exports=[733057,a=>{"use strict";let b="better-auth",c="__Secure-",d=`${b}.session_token`;a.s(["AUTH_COOKIE_PREFIX",0,b,"SESSION_COOKIE_NAME",0,d,"isAuthCookie",0,function(a){return a.startsWith(b)||a.startsWith(`${c}${b}`)},"isSessionCookie",0,function(a){return a===d||a===`${c}${d}`}])},334209,a=>{"use strict";a.s(["ApiError",0,class extends Error{error;status;data;constructor(a,b,c){super(a.message),this.name="ApiError",this.error=a,this.status=b,this.data=c}}])},992676,a=>{"use strict";var b=a.i(733057),c=a.i(109972),d=a.i(334209);let e=null,f=!1;function g(){return null===e&&(e=process.env.INKEEP_AGENTS_API_URL||c.DEFAULT_INKEEP_AGENTS_API_URL,process.env.INKEEP_AGENTS_API_URL||f||(console.warn(`INKEEP_AGENTS_API_URL is not set, falling back to: ${c.DEFAULT_INKEEP_AGENTS_API_URL}`),f=!0)),e}async function h(c,e,f={}){let g,i=`${c}/${e}`;try{let{headers:c}=await a.A(568604),d=(await c()).get("cookie");if(d&&(g=d.split(";").map(a=>a.trim()).filter(a=>(0,b.isAuthCookie)(a)).join("; ")),!g){let{cookies:c}=await a.A(568604);g=(await c()).getAll().filter(a=>(0,b.isAuthCookie)(a.name)).map(a=>`${a.name}=${a.value}`).join("; ")}}catch{}let j=!!process.env.INKEEP_AGENTS_MANAGE_API_BYPASS_SECRET,k=j?"bypass-secret":g?"cookie":"none";"none"===k&&console.warn(`[api-config] No auth credentials for ${e} - set INKEEP_AGENTS_MANAGE_API_BYPASS_SECRET or ensure session cookies are forwarded`);let l={"Content-Type":"application/json",...f.headers,...g&&{Cookie:g},...j&&{Authorization:`Bearer ${process.env.INKEEP_AGENTS_MANAGE_API_BYPASS_SECRET}`}};try{let a=await fetch(i,{...f,headers:l,cache:"no-store"});if(!a.ok){let b;try{let c=await a.text();b=c?JSON.parse(c):null}catch{b=null}if(400===a.status&&b?.errors&&Array.isArray(b.errors)){let c=b.errors.map(a=>`${a.name||a.pointer||"field"}: ${a.detail||a.reason||a.message}`).join(", "),e=`Validation failed: ${c}`;throw console.error("API Validation Error Response:",{status:a.status,errorData:b,validationErrors:c}),new d.ApiError({code:"validation_error",message:e},a.status)}let c=b?.error?.message||b?.message||b?.detail||`HTTP ${a.status}: ${a.statusText}`||"Unknown error occurred",e=b?.error?.code||b?.code||"unknown";throw console.error("API Error Response:",{status:a.status,statusText:a.statusText,errorData:b,errorMessage:c,errorCode:e,authMode:k}),new d.ApiError({code:e,message:c},a.status,b??void 0)}let b=a.headers.get("content-type");if(b?.includes("application/json")){let b=await a.text();return b?JSON.parse(b):void 0}return}catch(a){if(a instanceof d.ApiError)throw a;throw new d.ApiError({code:"internal_server_error",message:a instanceof Error?a.message:"Network error occurred"},500)}}async function i(a,b={}){return h(g(),`manage/${a}`,b)}a.s(["getAgentsApiUrl",0,g,"makeManagementApiRequest",0,i])},440570,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"registerServerReference",{enumerable:!0,get:function(){return d.registerServerReference}});let d=a.r(420358)},97190,(a,b,c)=>{"use strict";function d(a){for(let b=0;b<a.length;b++){let c=a[b];if("function"!=typeof c)throw Object.defineProperty(Error(`A "use server" file can only export async functions, found ${typeof c}.
Read more: https://nextjs.org/docs/messages/invalid-use-server-value`),"__NEXT_ERROR_CODE",{value:"E352",enumerable:!1,configurable:!0})}}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"ensureServerEntryExports",{enumerable:!0,get:function(){return d}})},106209,a=>{"use strict";var b=a.i(440570),c=a.i(992676),d=a.i(334209);async function e(a){try{let b=await (0,c.makeManagementApiRequest)("api/invitations",{method:"POST",body:JSON.stringify(a)});return{success:!0,results:b.data}}catch(a){return console.error("[inviteMembers] Error:",a),{success:!1,error:a instanceof d.ApiError?a.message:"Failed to invite members"}}}async function f(a){try{return await (0,c.makeManagementApiRequest)(`api/invitations/${encodeURIComponent(a)}/email-status`)}catch(b){return console.warn("[getInvitationEmailStatus] Failed to fetch email status:",{invitationId:a,error:b instanceof Error?b.message:String(b)}),{emailSent:!1}}}async function g(a){try{let b=await (0,c.makeManagementApiRequest)(`api/invitations/pending?email=${encodeURIComponent(a)}`);return{success:!0,invitations:b}}catch(a){return console.error("[getPendingInvitations] Error:",a),{success:!1,error:a instanceof d.ApiError?a.message:"Failed to load invitations"}}}async function h(a,b){try{return await (0,c.makeManagementApiRequest)(`api/invitations/verify?id=${encodeURIComponent(a)}&email=${encodeURIComponent(b)}`)}catch(a){return{valid:!1,error:a instanceof d.ApiError?a.message:"Failed to validate invitation"}}}(0,a.i(97190).ensureServerEntryExports)([e,f,g,h]),(0,b.registerServerReference)(e,"408576d423a6860d4b2444a9c46cf49a8ef15ed63a",null),(0,b.registerServerReference)(f,"4048bfd3970308bf9154a3ee9dad77e489b84fda53",null),(0,b.registerServerReference)(g,"40a8499e8e0832b386714bea00e582bf0f97ee4eb8",null),(0,b.registerServerReference)(h,"60d153fc944aed7d7bb972609149693ffa7faf359f",null),a.s(["getInvitationEmailStatus",0,f,"getPendingInvitations",0,g,"inviteMembers",0,e,"verifyInvitation",0,h])},415402,a=>{"use strict";var b=a.i(440570),c=a.i(992676);async function d(a){try{return await (0,c.makeManagementApiRequest)(`api/users/${a}/profile`)}catch{return null}}async function e(a,b){await (0,c.makeManagementApiRequest)(`api/users/${a}/profile`,{method:"PUT",body:JSON.stringify({timezone:b})})}(0,a.i(97190).ensureServerEntryExports)([d,e]),(0,b.registerServerReference)(d,"406657e96844131c5f713ba3d55e523fbd6115ec06",null),(0,b.registerServerReference)(e,"60e079ee4242cd6c801ed7ac0d5e8b19c590b867fe",null),a.s(["getUserProfile",0,d,"updateUserProfileTimezone",0,e])},239328,a=>{"use strict";var b=a.i(106209),c=a.i(415402);a.s([],984224),a.i(984224),a.s(["60d153fc944aed7d7bb972609149693ffa7faf359f",()=>b.verifyInvitation,"60e079ee4242cd6c801ed7ac0d5e8b19c590b867fe",()=>c.updateUserProfileTimezone],239328)},568604,a=>{a.v(b=>Promise.all(["server/chunks/ssr/0blw_next_dist_shared_lib_action-revalidation-kind_0iim3me.js","server/chunks/ssr/0blw_next_0b3pfhf._.js"].map(b=>a.l(b))).then(()=>b(900566)))}];

//# sourceMappingURL=_0~8fi.1._.js.map