(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,38149,e=>{"use strict";var s=e.i(43476);function t({title:e,description:t,controls:r,output:a}){return(0,s.jsxs)("div",{className:"container mx-auto px-4 py-8 max-w-7xl",children:[(0,s.jsxs)("div",{className:"mb-8",children:[(0,s.jsx)("h1",{className:"text-3xl font-bold tracking-tight text-foreground mb-2",children:e}),(0,s.jsx)("p",{className:"text-muted-foreground",children:t})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 items-start",children:[(0,s.jsx)("div",{className:"space-y-6",children:(0,s.jsx)("div",{className:"bg-card rounded-2xl border border-border p-6 shadow-sm",children:r})}),(0,s.jsx)("div",{className:"lg:sticky lg:top-24",children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wider px-1",children:"Generated Output"}),a]})})]})]})}e.s(["ToolLayout",()=>t])},2527,e=>{"use strict";var s=e.i(43476),t=e.i(71645),r=e.i(38149);let a=[{id:"const_missing",pattern:/^[ \t]*[A-Z][a-zA-Z0-9_]+\([^)]*\),/gm,message:"Consider adding 'const' keyword to this constructor if all its arguments are constant.",severity:"info"},{id:"heavy_build",pattern:/class .+\s+extends\s+StatelessWidget(?:\s|\{)[\s\S]+?@override[\s\S]+?\.map\(|new List\(/gm,message:"Heavy loops or list generation found inside build() method. Move these to a variable or state.",severity:"warning"},{id:"unnecessary_setstate",pattern:/setState\(\(\)\s*=>\s*[^;]+=[^;]+\)/gm,message:"Ensure you are only updating variables that affect the UI inside setState.",severity:"info"},{id:"nested_builders",pattern:/Builder\([\s\S]+?Builder\(/g,message:"Nested Builders detected. This might increase widget tree depth unnecessarily.",severity:"warning"},{id:"missing_onpressed",pattern:/onPressed: \(\) \{ \}/g,message:"Empty onPressed callback might cause the button to be disabled or redundant.",severity:"info"}];function l(){let[e,l]=(0,t.useState)(`class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Text("Title"),
        ListView(
          children: [1,2,3,4].map((i) => Text("Item $i")).toList(),
        ),
      ],
    );
  }
}`),[i,n]=(0,t.useState)([]);return(0,s.jsx)(r.ToolLayout,{title:"Performance Analyzer",description:"Static code analysis for Flutter widgets. Detect common anti-patterns that might cause performance issues.",controls:(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-sm font-medium text-muted-foreground",children:"Flutter Code to Analyze"}),(0,s.jsx)("textarea",{value:e,onChange:e=>l(e.target.value),className:"w-full h-80 px-4 py-3 bg-slate-900 border border-border rounded-xl font-mono text-xs text-yellow-500 focus:ring-2 focus:ring-primary outline-none transition-all resize-none",placeholder:"Paste widget code here..."})]}),(0,s.jsxs)("button",{onClick:()=>{let s=[];a.forEach(t=>{let r;for(;null!==(r=t.pattern.exec(e));)s.push({...t,line:e.substring(0,r.index).split("\n").length})}),n(s)},className:"w-full py-4 bg-primary text-white font-bold rounded-xl shadow-lg transition-all hover:brightness-110 active:scale-95 flex items-center justify-center gap-2",children:[(0,s.jsx)("span",{children:"⚡"})," RUN ANALYSIS"]}),i.length>0&&(0,s.jsxs)("div",{className:"space-y-3 mt-8",children:[(0,s.jsxs)("span",{className:"text-xs font-bold text-muted-foreground uppercase tracking-widest block mb-1",children:["Detected Issues (",i.length,")"]}),i.map((e,t)=>(0,s.jsxs)("div",{className:`p-4 rounded-xl border ${"warning"===e.severity?"bg-orange-500/5 border-orange-500/20":"bg-blue-500/5 border-blue-500/20"}`,children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-1",children:[(0,s.jsxs)("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:["Line ",e.line]}),(0,s.jsx)("span",{className:`text-[10px] px-1.5 py-0.5 rounded uppercase font-bold ${"warning"===e.severity?"bg-orange-500 text-white":"bg-blue-500 text-white"}`,children:e.severity})]}),(0,s.jsx)("p",{className:"text-sm font-medium leading-relaxed",children:e.message})]},t))]})]}),output:(0,s.jsxs)("div",{className:"h-full flex flex-col p-8 bg-card rounded-2xl border border-border",children:[(0,s.jsxs)("div",{className:"flex items-center gap-4 mb-8",children:[(0,s.jsx)("div",{className:"w-12 h-12 rounded-2xl bg-primary/10 flex items-center justify-center text-xl",children:"🚀"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-bold text-lg",children:"Performance Score"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Optimization assessment based on static rules."})]})]}),(0,s.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center",children:[(0,s.jsxs)("div",{className:"relative w-48 h-48 flex items-center justify-center",children:[(0,s.jsxs)("svg",{className:"w-full h-full transform -rotate-90",children:[(0,s.jsx)("circle",{cx:"96",cy:"96",r:"80",fill:"none",stroke:"currentColor",strokeWidth:"12",className:"text-muted/10"}),(0,s.jsx)("circle",{cx:"96",cy:"96",r:"80",fill:"none",stroke:"currentColor",strokeWidth:"12",strokeDasharray:2*Math.PI*80,strokeDashoffset:2*Math.PI*80*(1-(i.length>0?.7:.95)),className:"text-primary transition-all duration-1000"})]}),(0,s.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[(0,s.jsx)("span",{className:"text-4xl font-black",children:i.length>0?"70":"95"}),(0,s.jsx)("span",{className:"text-[10px] font-bold text-muted-foreground",children:"OPTIMAL"})]})]}),(0,s.jsxs)("div",{className:"mt-12 grid grid-cols-2 gap-4 w-full",children:[(0,s.jsxs)("div",{className:"p-4 rounded-2xl bg-secondary/50 border border-border text-center",children:[(0,s.jsx)("div",{className:"text-xl font-bold",children:"0ms"}),(0,s.jsx)("div",{className:"text-[10px] text-muted-foreground",children:"FRAME LATENCY"})]}),(0,s.jsxs)("div",{className:"p-4 rounded-2xl bg-secondary/50 border border-border text-center",children:[(0,s.jsx)("div",{className:"text-xl font-bold",children:"60fps"}),(0,s.jsx)("div",{className:"text-[10px] text-muted-foreground",children:"TARGET FPS"})]})]})]})]})})}e.s(["default",()=>l])}]);