next
Version:
The React Framework
1 lines • 5.71 kB
JavaScript
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,22565,__turbopack_context__=>{var __TURBOPACK__imported__module__24514__=__turbopack_context__.i(24514),__TURBOPACK__imported__module__36909__=__turbopack_context__.i(36909),__TURBOPACK__imported__module__46914__=__turbopack_context__.i(46914);let RefreshCw=(0,__TURBOPACK__imported__module__46914__.f)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),TriangleAlert=(0,__TURBOPACK__imported__module__46914__.f)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var __TURBOPACK__imported__module__40092__=__turbopack_context__.i(40092);function ErrorState(t0){let t1,t2,t3,t5,t6,t7,$=(0,__TURBOPACK__imported__module__36909__.c)(12),{error,onRetry}=t0,isNetwork=error instanceof __TURBOPACK__imported__module__40092__.f,title=isNetwork?"Server Connection Lost":"Error",message=isNetwork?"Unable to connect to the bundle analyzer server. Please ensure the server is running and try again.":error?.message??"An unexpected error occurred.";$[0]===Symbol.for("react.memo_cache_sentinel")?(t1=(0,__TURBOPACK__imported__module__24514__.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-destructive/10 text-destructive mb-2",children:(0,__TURBOPACK__imported__module__24514__.jsx)(TriangleAlert,{className:"w-8 h-8"})}),$[0]=t1):t1=$[0],$[1]!==title?(t2=(0,__TURBOPACK__imported__module__24514__.jsx)("h3",{className:"text-lg font-semibold text-foreground mb-2",children:title}),$[1]=title,$[2]=t2):t2=$[2],$[3]!==message?(t3=(0,__TURBOPACK__imported__module__24514__.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:message}),$[3]=message,$[4]=t3):t3=$[4];let t4=onRetry??_temp;return $[5]===Symbol.for("react.memo_cache_sentinel")?(t5=(0,__TURBOPACK__imported__module__24514__.jsx)(RefreshCw,{className:"w-4 h-4"}),$[5]=t5):t5=$[5],$[6]!==t4?(t6=(0,__TURBOPACK__imported__module__24514__.jsxs)("button",{onClick:t4,className:"inline-flex items-center gap-2 px-4 py-2 rounded-md bg-primary text-primary-foreground hover:bg-primary/90 transition-colors text-sm font-medium",children:[t5,"Retry Connection"]}),$[6]=t4,$[7]=t6):t6=$[7],$[8]!==t2||$[9]!==t3||$[10]!==t6?(t7=(0,__TURBOPACK__imported__module__24514__.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,__TURBOPACK__imported__module__24514__.jsxs)("div",{className:"text-center space-y-4 max-w-md px-6",children:[t1,(0,__TURBOPACK__imported__module__24514__.jsxs)("div",{children:[t2,t3,t6]})]})}),$[8]=t2,$[9]=t3,$[10]=t6,$[11]=t7):t7=$[11],t7}function _temp(){return window.location.reload()}var __TURBOPACK__imported__module__95184__=__turbopack_context__.i(95184);function Error1(t0){let t1,t2,t3,$=(0,__TURBOPACK__imported__module__36909__.c)(6),{error,reset}=t0;return $[0]!==error?(t1=()=>{console.error(error)},t2=[error],$[0]=error,$[1]=t1,$[2]=t2):(t1=$[1],t2=$[2]),(0,__TURBOPACK__imported__module__95184__.useEffect)(t1,t2),$[3]!==error||$[4]!==reset?(t3=(0,__TURBOPACK__imported__module__24514__.jsx)("main",{className:"h-screen flex bg-background",children:(0,__TURBOPACK__imported__module__24514__.jsx)(ErrorState,{error:error,onRetry:reset})}),$[3]=error,$[4]=reset,$[5]=t3):t3=$[5],t3}__turbopack_context__.s(["default",0,Error1],22565)},46914,40092,__turbopack_context__=>{var __TURBOPACK__imported__module__95184__=__turbopack_context__.i(95184);let toPascalCase=string=>{let camelCase=string.replace(/^([A-Z])|[\s-_]+(\w)/g,(match,p1,p2)=>p2?p2.toUpperCase():p1.toLowerCase());return camelCase.charAt(0).toUpperCase()+camelCase.slice(1)},mergeClasses=(...classes)=>classes.filter((className,index,array)=>!!className&&""!==className.trim()&&array.indexOf(className)===index).join(" ").trim();var defaultAttributes={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let Icon=(0,__TURBOPACK__imported__module__95184__.forwardRef)(({color="currentColor",size=24,strokeWidth=2,absoluteStrokeWidth,className="",children,iconNode,...rest},ref)=>(0,__TURBOPACK__imported__module__95184__.createElement)("svg",{ref,...defaultAttributes,width:size,height:size,stroke:color,strokeWidth:absoluteStrokeWidth?24*Number(strokeWidth)/Number(size):strokeWidth,className:mergeClasses("lucide",className),...!children&&!(props=>{for(let prop in props)if(prop.startsWith("aria-")||"role"===prop||"title"===prop)return!0})(rest)&&{"aria-hidden":"true"},...rest},[...iconNode.map(([tag,attrs])=>(0,__TURBOPACK__imported__module__95184__.createElement)(tag,attrs)),...Array.isArray(children)?children:[children]]));__turbopack_context__.s(["f",0,(iconName,iconNode)=>{let Component=(0,__TURBOPACK__imported__module__95184__.forwardRef)(({className,...props},ref)=>(0,__TURBOPACK__imported__module__95184__.createElement)(Icon,{ref,iconNode,className:mergeClasses(`lucide-${toPascalCase(iconName).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${iconName}`,className),...props}));return Component.displayName=toPascalCase(iconName),Component}],46914);class NetworkError extends Error{constructor(message,options){super(message),this.name="NetworkError",options&&"cause"in options&&(this.cause=options.cause)}}__turbopack_context__.s(["f",0,NetworkError],40092)}])})();