1import{a9 as Q,j as e,r as c,u as _,f as F,B as t,l as a,dM as q,T as g,aX as N,d$ as U,C as y,s as P,aw as T,A as X,a as E,bE as Y,bF as J,dU as K,aW as O,M as V,d as Z,G as L}from"./index-DFCDAUq3.js";import{b as ee,u as re,a as ae,d as te}from"./controller.service-C1QA56N2.js";import{S as x}from"./Skeleton-Ka6wxpy7.js";import{M as se,S as ie}from"./Search-Ds-ZaUsP.js";const ne=Q(e.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear"),G=c.memo(({open:f,onClose:p,selectedSolution:i,controllers:j=[],cars:$=[],solutionInformation:m=[],isLoading:z=!1})=>{const r=_(),b=F(),[h,I]=c.useState(""),C=c.useMemo(()=>!i||!j.length?[]:j.filter(o=>{var d;return(d=o.solutions)==null?void 0:d.some(l=>l.solutionId===i.Id&&l.visible)}),[j,i]),v=c.useMemo(()=>{const o={};return C.forEach(d=>{const l=$.find(s=>s.Id===d.makeId);l&&(o[l.Id]||(o[l.Id]={make:l,controllers:[]}),o[l.Id].controllers.push(d))}),o},[C,$]),w=c.useMemo(()=>{if(!h)return v;const o={};return Object.keys(v).forEach(d=>{const l=v[d],s=l.controllers.filter(n=>n.controllername.toLowerCase().includes(h.toLowerCase())||l.make.carname.toLowerCase().includes(h.toLowerCase()));s.length>0&&(o[d]={...l,controllers:s})}),o},[v,h]),R=c.useCallback(o=>!m.length||!i?null:m.find(d=>d.controllerId===o&&d.solutionId===i.Id),[m,i]),S=c.useCallback(()=>{I("")},[]),W=h?Object.values(w).reduce((o,d)=>o+d.controllers.length,0):C.length,A=c.useMemo(()=>e.jsx(t,{children:Array.from({length:3}).map((o,d)=>e.jsxs(t,{sx:{mb:1.5},children:[e.jsxs(t,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",p:1,borderRadius:1.5,background:`linear-gradient(135deg, ${a(r.palette.primary.main,.08)}, ${a(r.palette.primary.main,.04)})`,border:`1px solid ${a(r.palette.primary.main,.15)}`,mb:.8},children:[e.jsx(x,{variant:"text",width:"40%",height:20}),e.jsx(x,{variant:"rectangular",width:24,height:22,sx:{borderRadius:1}})]}),e.jsx(t,{sx:{pl:1,pr:1},children:Array.from({length:2}).map((l,s)=>e.jsx(t,{sx:{mb:.6},children:e.jsx(t,{sx:{p:1.2,borderRadius:1.2,backgroundColor:a(r.palette.background.paper,.7),border:`1px solid ${a(r.palette.divider,.08)}`},children:e.jsxs(t,{sx:{display:"flex",alignItems:"flex-start",gap:.8},children:[e.jsx(x,{variant:"circular",width:5,height:5,sx:{mt:.7,flexShrink:0}}),e.jsxs(t,{sx:{flex:1},children:[e.jsx(x,{variant:"text",width:"85%",height:16,sx:{mb:.8}}),e.jsx(x,{variant:"text",width:"60%",height:12})]})]})})},`skeleton-controller-${s}`))})]},`skeleton-make-${d}`))}),[r.palette.primary.main,r.palette.background.paper,r.palette.divider]);return e.jsx(q,{anchor:"right",open:f,onClose:p,transitionDuration:300,sx:{"& .MuiDrawer-paper":{width:{xs:"100%",sm:500,md:600,lg:700},background:`linear-gradient(135deg, ${a(r.palette.background.paper,.98)}, ${a(r.palette.background.paper,.95)})`,backdropFilter:"blur(20px)",borderLeft:`1px solid ${a(r.palette.primary.main,.2)}`,boxShadow:`-8px 0 32px ${a(r.palette.common.black,.1)}`,transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"}},children:e.jsxs(t,{sx:{p:3,height:"100%",display:"flex",flexDirection:"column"},children:[e.jsx(t,{sx:{mb:2},children:e.jsxs(t,{sx:{mb:2},children:[e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:1.5,mb:1},children:[e.jsx(t,{sx:{p:1,borderRadius:2,background:`linear-gradient(135deg, ${a(r.palette.primary.main,.1)}, ${a(r.palette.primary.main,.05)})`,border:`1px solid ${a(r.palette.primary.main,.2)}`},children:e.jsx(se,{sx:{color:r.palette.primary.main,fontSize:20}})}),e.jsxs(t,{sx:{flex:1},children:[e.jsx(g,{variant:"h6",sx:{fontWeight:700,color:r.palette.text.primary,mb:.5},children:(i==null?void 0:i.aliasName)||b.formatMessage({id:"solutions.solutionDetails"})}),e.jsx(g,{variant:"body2",sx:{color:r.palette.text.secondary,fontSize:"0.85rem"},children:(i==null?void 0:i.solutionname)||""})]}),e.jsx(N,{onClick:p,size:"small",sx:{backgroundColor:a(r.palette.error.main,.1),color:r.palette.error.main,"&:hover":{backgroundColor:a(r.palette.error.main,.2)}},children:e.jsx(U,{fontSize:"small"})})]}),e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(y,{label:b.formatMessage({id:"solutions.ecusAvailable"},{count:W}),size:"small",sx:{backgroundColor:a(r.palette.success.main,.1),color:r.palette.success.dark,fontWeight:600,border:`1px solid ${a(r.palette.success.main,.2)}`}}),(i==null?void 0:i.category)&&e.jsx(y,{label:i.category,size:"small",sx:{backgroundColor:a(r.palette.primary.main,.1),color:r.palette.primary.main,fontWeight:600,border:`1px solid ${a(r.palette.primary.main,.2)}`}})]}),(i==null?void 0:i.information)&&String(i.information).trim().length>0&&e.jsx(g,{variant:"body2",sx:{mt:1.5,color:r.palette.text.secondary,fontSize:"0.85rem",lineHeight:1.35,backgroundColor:a(r.palette.info.main,.06),border:`1px solid ${a(r.palette.info.main,.14)}`,borderRadius:1.5,px:1.2,py:.9},children:i.information})]})}),e.jsx(t,{sx:{mb:2},children:e.jsx(P,{fullWidth:!0,placeholder:b.formatMessage({id:"solutions.searchPlaceholder"}),value:h,onChange:o=>I(o.target.value),InputProps:{startAdornment:e.jsx(T,{position:"start",children:e.jsx(ie,{sx:{color:r.palette.text.secondary,fontSize:20}})}),endAdornment:h&&e.jsx(T,{position:"end",children:e.jsx(N,{size:"small",onClick:S,children:e.jsx(ne,{fontSize:"small"})})})},sx:{"& .MuiOutlinedInput-root":{borderRadius:2,backgroundColor:a(r.palette.background.paper,.9),border:`1px solid ${a(r.palette.primary.main,.1)}`,"&:hover":{backgroundColor:r.palette.background.paper,borderColor:a(r.palette.primary.main,.3)},"&.Mui-focused":{backgroundColor:r.palette.background.paper,borderColor:r.palette.primary.main,boxShadow:`0 0 0 2px ${a(r.palette.primary.main,.1)}`}}}})}),e.jsx(t,{sx:{flex:1,overflow:"hidden"},children:z?e.jsx(t,{sx:{height:"100%",overflow:"auto",pr:1,"&::-webkit-scrollbar":{width:"6px"},"&::-webkit-scrollbar-track":{background:a(r.palette.divider,.1),borderRadius:"3px"},"&::-webkit-scrollbar-thumb":{background:a(r.palette.primary.main,.3),borderRadius:"3px","&:hover":{background:a(r.palette.primary.main,.5)}}},children:A}):Object.keys(w).length===0?e.jsx(X,{severity:"info",sx:{mt:2},children:h?b.formatMessage({id:"solutions.noControllersFound"}):b.formatMessage({id:"solutions.noControllersAvailable"})}):e.jsx(t,{sx:{height:"100%",overflow:"auto",pr:1,"&::-webkit-scrollbar":{width:"6px"},"&::-webkit-scrollbar-track":{background:a(r.palette.divider,.1),borderRadius:"3px"},"&::-webkit-scrollbar-thumb":{background:a(r.palette.primary.main,.3),borderRadius:"3px","&:hover":{background:a(r.palette.primary.main,.5)}}},children:Object.values(w).map(o=>e.jsxs(t,{sx:{mb:1.5},children:[e.jsxs(t,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",p:1,borderRadius:1.5,background:`linear-gradient(135deg, ${a(r.palette.primary.main,.08)}, ${a(r.palette.primary.main,.04)})`,border:`1px solid ${a(r.palette.primary.main,.15)}`,mb:.8},children:[e.jsx(g,{variant:"subtitle2",sx:{fontWeight:700,color:r.palette.text.primary,fontSize:"0.9rem"},children:o.make.carname}),e.jsx(y,{label:o.controllers.length,size:"small",sx:{backgroundColor:a(r.palette.primary.main,.15),color:r.palette.primary.main,fontWeight:700,fontSize:"0.7rem",height:22}})]}),e.jsx(t,{sx:{pl:1,pr:1},children:o.controllers.map(d=>{const l=R(d.Id);return e.jsx(t,{sx:{mb:.6},children:e.jsx(t,{sx:{p:1.2,borderRadius:1.2,backgroundColor:a(r.palette.background.paper,.7),border:`1px solid ${a(r.palette.divider,.08)}`,transition:"all 0.2s ease","&:hover":{backgroundColor:a(r.palette.primary.main,.04),borderColor:a(r.palette.primary.main,.15),transform:"translateX(2px)"}},children:e.jsxs(t,{sx:{display:"flex",alignItems:"flex-start",ga
1p:.8},children:[e.jsx(t,{sx:{width:5,height:5,borderRadius:"50%",backgroundColor:r.palette.success.main,mt:.7,flexShrink:0}}),e.jsxs(t,{sx:{flex:1},children:[e.jsx(g,{variant:"body2",sx:{fontWeight:600,color:r.palette.text.primary,fontSize:"0.85rem",mb:l!=null&&l.information?.8:0},children:d.controllername}),(l==null?void 0:l.information)&&e.jsxs(t,{children:[e.jsx(y,{label:e.jsx(E,{id:"solutions.important",defaultMessage:"IMPORTANT"}),size:"small",sx:{backgroundColor:a(r.palette.warning.main,.15),color:r.palette.warning.dark,fontWeight:700,fontSize:"0.65rem",height:18,mb:.6}}),e.jsx(g,{variant:"caption",sx:{display:"block",color:r.palette.text.secondary,fontStyle:"italic",lineHeight:1.3,fontSize:"0.75rem",backgroundColor:a(r.palette.warning.main,.05),p:.8,borderRadius:.8,border:`1px solid ${a(r.palette.warning.main,.1)}`},children:l.information})]})]})]})})},d.Id)})})]},o.make.Id))})})]})})});G.displayName="SolutionDetailsSidebar";var B={},oe=Y;Object.defineProperty(B,"__esModule",{value:!0});var H=B.default=void 0,le=oe(J()),de=e;H=B.default=(0,le.default)((0,de.jsx)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"Search");function he(){const f=_(),p=F(),{data:i=[],isLoading:j}=ee(),{data:$}=re(),{data:m}=ae(),{data:z=[],isLoading:r}=te(),[b,h]=c.useState(""),[I,C]=c.useState(null),[v,w]=c.useState(!1),R=c.useMemo(()=>[{name:p.formatMessage({id:"pages.dashboard.deactivation"}),key:"Deactivation",color:"#3498DB",gradient:"linear-gradient(135deg, #3498DB, #2980B9)",icon:"ð",description:"Security and protection solutions"},{name:p.formatMessage({id:"pages.dashboard.tuning"}),key:"Tuning",color:"#27AE60",gradient:"linear-gradient(135deg, #27AE60, #2ECC71)",icon:"â¡",description:"Performance optimization solutions"},{name:p.formatMessage({id:"pages.dashboard.miscellaneous"}),key:"Miscle",color:"#E67E22",gradient:"linear-gradient(135deg, #E67E22, #F39C12)",icon:"ð ï¸",description:"Additional utility solutions"}],[p]),S=c.useMemo(()=>i.length?i.filter(s=>{var M,D;if(!s)return!1;const n=((M=s.aliasName)==null?void 0:M.toLowerCase())||"",u=((D=s.solutionname)==null?void 0:D.toLowerCase())||"",k=b.toLowerCase();return n.includes(k)||u.includes(k)}):[],[i,b]),W=c.useCallback(s=>{C(s),w(!0)},[]),A=c.useCallback(s=>!(m!=null&&m.length)||!s?0:m.filter(n=>{var u;return(u=n.solutions)==null?void 0:u.some(k=>k.solutionId===s.Id&&k.visible)}).length,[m]),o=c.useCallback(()=>{w(!1),C(null)},[]),d=c.memo(({solution:s,category:n,onSolutionClick:u,getControllerCount:k})=>{const M=`${K}/images/${s.icon}`;return e.jsx(O,{onClick:()=>u(s),sx:{p:1.5,cursor:"pointer",border:`1px solid ${a(n.color,.1)}`,transition:"all 0.3s ease-in-out","&:hover":{transform:"translateY(-4px)",boxShadow:`0 6px 20px ${a(n.color,.2)}`,borderColor:n.color}},children:e.jsxs(t,{sx:{display:"flex",gap:1.5,alignItems:"center"},children:[e.jsx(t,{sx:{p:1,borderRadius:1.5,background:`linear-gradient(135deg, ${a(n.color,.15)}, ${a(n.color,.05)})`,border:`1px solid ${a(n.color,.2)}`,display:"flex",alignItems:"center",justifyContent:"center",boxShadow:`0 2px 6px ${a(n.color,.1)}`},children:e.jsx("img",{alt:s.aliasName,height:"28px",width:"28px",src:M,style:{borderRadius:"4px",objectFit:"contain",filter:"drop-shadow(0 1px 3px rgba(0,0,0,0.1))"}})}),e.jsxs(t,{sx:{flex:1},children:[e.jsx(g,{variant:"subtitle2",sx:{fontWeight:600,mb:.3,fontSize:"0.9rem",lineHeight:1.2},children:s.aliasName}),e.jsx(g,{variant:"caption",color:"text.secondary",sx:{mb:.5,fontSize:"0.75rem",lineHeight:1.2,display:"block"},children:s.solutionname}),e.jsxs(t,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs(g,{variant:"caption",sx:{display:"flex",alignItems:"center",gap:.4,color:n.color,fontWeight:600,fontSize:"0.7rem",lineHeight:1},children:[e.jsx(t,{sx:{width:4,height:4,borderRadius:"50%",backgroundColor:n.color,animation:"pulse 2s infinite","@keyframes pulse":{"0%, 100%":{opacity:1},"50%":{opacity:.5}}}}
1),e.jsx(E,{id:"solutions.clickToExplore",defaultMessage:"Click to explore â"})]}),e.jsx(y,{label:`${k(s)} ${p.formatMessage({id:"solutions.ecus",defaultMessage:"ECUs"})}`,size:"small",sx:{backgroundColor:a(n.color,.1),color:n.color,fontWeight:600,fontSize:"0.65rem",height:20,border:`1px solid ${a(n.color,.2)}`}})]})]})]})})});d.displayName="SolutionCard";const l=c.useMemo(()=>e.jsx(O,{sx:{p:1.5},children:e.jsxs(t,{sx:{display:"flex",gap:1.5,alignItems:"center"},children:[e.jsx(x,{variant:"rectangular",width:36,height:36,sx:{borderRadius:1}}),e.jsxs(t,{sx:{flex:1},children:[e.jsx(x,{variant:"text",width:"80%",height:18,sx:{mb:.5}}),e.jsx(x,{variant:"text",width:"60%",height:12,sx:{mb:.5}}),e.jsx(x,{variant:"text",width:"70%",height:10})]})]})}),[]);return e.jsxs(t,{sx:{p:{xs:2,sm:3}},children:[e.jsxs(t,{sx:{mb:4,display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:2},children:[j?e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:2},children:[e.jsx(x,{variant:"text",width:120,height:40}),e.jsx(x,{variant:"rectangular",width:80,height:24,sx:{borderRadius:1}})]}):e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:2},children:[e.jsx(g,{variant:"h4",sx:{fontWeight:700,background:`linear-gradient(45deg, ${f.palette.primary.main}, ${f.palette.secondary.main})`,backgroundClip:"text",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"},children:e.jsx(E,{id:"pages.solutions.title",defaultMessage:"Solutions"})}),e.jsx(y,{label:`${i.length} ${p.formatMessage({id:"solutions.total",defaultMessage:"Total"})}`,size:"small",sx:{background:`linear-gradient(45deg, ${a(f.palette.primary.main,.1)}, ${a(f.palette.secondary.main,.1)})`,border:`1px solid ${a(f.palette.primary.main,.3)}`,color:f.palette.primary.main,fontWeight:600}})]}),j?e.jsx(x,{variant:"rectangular",width:{xs:"100%",sm:"300px"},height:48,sx:{borderRadius:2}}):e.jsx(P,{placeholder:p.formatMessage({id:"solutions.searchPlaceholder",defaultMessage:"Search solutions..."}),value:b,onChange:s=>h(s.target.value),size:"small",sx:{width:{xs:"100%",sm:"300px"}},InputProps:{startAdornment:e.jsx(T,{position:"start",children:e.jsx(H,{})})}})]}),e.jsx(V,{sx:{p:{xs:2,sm:3}},children:R.map(s=>e.jsxs(t,{sx:{mb:4},children:[e.jsx(t,{sx:{mb:3},children:e.jsx(Z,{fullWidth:!0,variant:"contained",sx:{py:1.5,fontWeight:600,fontSize:"1rem",background:s.gradient,boxShadow:`0 4px 15px ${a(s.color,.3)}`,"&:hover":{background:s.gradient,boxShadow:`0 6px 20px ${a(s.color,.4)}`,transform:"translateY(-2px)"},transition:"all 0.3s ease"},children:e.jsxs(t,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},children:[e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx("span",{style:{fontSize:"1.2rem"},children:s.icon}),s.name]}),e.jsx(y,{label:S.filter(n=>n.category===s.key).length,size:"small",sx:{backgroundColor:a("#ffffff",.2),color:"#ffffff",fontWeight:600,border:`1px solid ${a("#ffffff",.3)}`}})]})})}),e.jsx(L,{container:!0,spacing:1.5,children:j?Array.from({length:4}).map((n,u)=>e.jsx(L,{item:!0,xs:12,sm:6,md:4,lg:3,children:l},`skeleton-${u}`)):S.filter(n=>n.category===s.key).map((n,u)=>e.jsx(L,{item:!0,xs:12,sm:6,md:4,lg:3,children:e.jsx(d,{solution:n,category:s,onSolutionClick:W,getControllerCount:A})},n.Id||u))})]},s.key))}),e.jsx(G,{open:v,onClose:o,selectedSolution:I,controllers:m,cars:$,solutionInformation:z,isLoading:r})]})}export{he as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.