module.exports=[114207,a=>{"use strict";function b(a){if(!a||!a.startsWith("/")||a.startsWith("//")||a.includes("\\"))return!1;try{let b=decodeURIComponent(a);if(b.startsWith("//")||b.includes("://")||b.includes("\\"))return!1}catch{return!1}return!0}a.s(["buildLoginUrlWithCurrentPath",0,function(){var a=void 0;let b="/login";if(!a)return b;let c=encodeURIComponent(a);return`${b}?returnUrl=${c}`},"getSafeReturnUrl",0,function(a,c="/"){return b(a)?a:c},"isValidReturnUrl",0,b])},918458,651428,a=>{"use strict";var b=a.i(542082),c=a.i(607410),d=a.i(972912),e=a.i(211783),f=a.i(888409),g=a.i(284141),h=a.i(225526),i=a.i(888890),j=a.i(114207);let k={not_found:404,forbidden:403,unauthorized:401,internal_server_error:500,service_unavailable:503,bad_request:400,validation_error:400,unprocessable_entity:422};function l(a){if(a)return k[a]}function m(a){return"object"==typeof a&&null!==a&&"status"in a&&"number"==typeof a.status}a.s(["getErrorCode",0,function(a){return a&&"object"==typeof a?a.error?.code?a.error.code:a.code?a.code:a.status?function(a){switch(a){case 400:return"bad_request";case 401:return"unauthorized";case 403:return"forbidden";case 404:return"not_found";case 422:return"unprocessable_entity";case 500:return"internal_server_error";case 503:return"service_unavailable";default:return"unknown_error"}}(a.status):void 0:void 0},"getStatusCodeFromErrorCode",0,l],651428);let n={404:"not_found",403:"forbidden",401:"unauthorized",500:"internal_server_error",503:"service_unavailable",400:"bad_request",422:"unprocessable_entity"};function o({error:a,errorCode:k,icon:p=c.AlertTriangle,reset:q,title:r,description:s,link:t,linkText:u,statusCode:v,showRetry:w=!0,onRetry:x,context:y="resource"}){let z=(0,g.useRouter)(),[A,B]=(0,h.useState)(!1),C=k,D=v;!C&&!D&&a&&("object"==typeof a&&null!==a&&"status"in a&&"number"==typeof a.status&&"error"in a&&"object"==typeof a.error&&null!==a.error&&"message"in a.error&&"string"==typeof a.error.message?D=a.status:m(a.cause)?D=a.cause.status:m(a)&&(D=a.status));C&&!D?D=l(C):D&&!C&&(C=function(a){if(a)return n[a]}(D)),(0,h.useEffect)(()=>{if((401===D||"unauthorized"===C)&&!A){B(!0);let a=(0,j.buildLoginUrlWithCurrentPath)();z.push(a)}},[D,C,z,A]);let E=r,F=s;if(!E){let a=function(a,b){let c=b.charAt(0).toUpperCase()+b.slice(1);switch(a){case"not_found":return{title:`${c} not found`,description:`The ${b} you are looking for does not exist or has been deleted.`};case"forbidden":return{title:"Access denied",description:`You do not have permission to access this ${b}.`};case"unauthorized":return{title:"Authentication required",description:"Please sign in to access this resource."};case"internal_server_error":return{title:"Server error",description:"An error occurred on the server. Please try again later."};case"service_unavailable":return{title:"Service unavailable",description:"The service is temporarily unavailable. Please try again in a few moments."};case"bad_request":case"validation_error":case"unprocessable_entity":return{title:"Invalid request",description:`The request to load this ${b} was invalid. Please try again.`};default:return{title:`Failed to load ${b}`,description:`An unexpected error occurred while loading this ${b}.`}}}(C,y);E=a.title,F||(F=a.description)}return(F||(F="An unexpected error occurred. Please try again."),A&&(401===D||"unauthorized"===C))?(0,b.jsxs)("main",{"aria-labelledby":"redirect-title",className:"flex flex-col items-center justify-center h-full gap-10 px-4",children:[(0,b.jsx)("h1",{id:"redirect-title",className:"sr-only",children:"Redirecting to login"}),(0,b.jsx)("div",{className:"text-muted-foreground text-sm",children:"Redirecting to login..."})]}):(0,b.jsxs)("main",{"aria-labelledby":"error-title",className:"flex flex-col items-center justify-center h-full gap-10 px-4",children:[(0,b.jsx)("h1",{id:"error-title",className:"sr-only",children:E}),D?(0,b.jsx)("div",{className:"text-8xl font-mono font-bold text-foreground","aria-hidden":"true",children:D}):(0,b.jsx)(p,{className:"w-14 h-14 text-foreground",strokeWidth:1,"aria-hidden":"true"}),(0,b.jsxs)("div",{className:"flex flex-col items-center gap-2 text-center max-w-md",children:[(0,b.jsx)("h2",{className:"text-lg text-muted-foreground font-mono uppercase",children:E}),(0,b.jsx)("div",{className:"text-muted-foreground text-sm",children:F})]}),(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[w&&(0,b.jsxs)(i.Button,{onClick:()=>{q?q():x?x():window.location.reload()},variant:"outline",children:[(0,b.jsx)(e.RefreshCw,{className:"w-4 h-4"}),"Try Again"]}),t&&u&&(0,b.jsx)(i.Button,{asChild:!0,variant:"outline",children:(0,b.jsxs)(f.default,{href:t,className:"flex items-center gap-2",children:[(0,b.jsx)(d.ArrowLeft,{className:"w-4 h-4"}),u]})})]})]})}a.s(["ErrorContent",0,o,"default",0,function(a){let c=l(a.errorCode);return(0,b.jsx)(o,{statusCode:c,...a})}],918458)}];

//# sourceMappingURL=agents-manage-ui_src_02s8o73._.js.map