import{j as s,a,ak as S,G as k,dG as C,bd as I,c as h,u as b,b as w,r as f,g as T,e as g,dA as B,O as m,cr as H,b0 as v,dH as D,dI as G,dJ as M}from"./index-d6499a22.js";import{D as N,u as A}from"./Deprecated-ec8916ed.js";import{F as E}from"./FeatureGroupTypeBadge-0a81479c.js";const F={wrapper:(e,t,o)=>({transition:"all 0.2s linear",color:"primary",cursor:"pointer",...t&&{cursor:"default"},...e&&{boxShadow:"0px 0px 2px 2px"},"&:hover":{boxShadow:"0px 0px 0 2px"},...o&&{bg:"primaryShade1",border:"1px solid",borderColor:"var(--quartz-colors-labels-orange-_light)",div:{bg:"grayShade2",color:"gray",button:{color:"grayShade1"}}}})},R=({children:e,highlights:t,isSelected:o=!1,isLocked:r=!1,onClick:n})=>s.jsxs(a,{flexDirection:"column",sx:F.wrapper(o,r),onClick:n,children:[e,t&&!S(t)&&s.jsx(a,{flexDirection:"column",sx:d.container,children:Object.entries(t).map(([p,l])=>{const i=k(y,C(l),O);return s.jsxs(a,{sx:{gap:"10px"},children:[s.jsx(I,{sx:d.title,value:p}),s.jsx(i,{value:l})]})})})]}),y=({value:e})=>s.jsx(a,{sx:d.highlights,dangerouslySetInnerHTML:{__html:e}}),L=({value:e})=>s.jsx(a,{flexDirection:"column",sx:{gap:"5px"},children:e.map(t=>Object.entries(t).map(([o,r])=>s.jsxs(a,{children:[s.jsxs(h,{children:[o,":"]}),s.jsx(a,{sx:d.highlights,dangerouslySetInnerHTML:{__html:r}})]},o)))}),O={String:y,Array:L},d={container:{bg:"white",borderTopWidth:"2px",borderTopStyle:"solid",borderTopColor:"labels.yellow",gap:"10px",p:"7px",fontFamily:"Inter"},title:{borderWidth:"1px",borderStyle:"solid",borderColor:"labels.yellow",backgroundColor:"labels.yellowShade2"},highlights:{color:"black",fontSize:"12px","> em":{color:"#272727",fontWeight:600,px:"2px",mx:"2px",fontStyle:"normal",backgroundColor:"labels.yellow"}}},_=({value:{data:e,hasMatchText:t}})=>{const{id:o}=b(),{data:r}=w(),n=r==null?void 0:r.map(({projectId:i})=>i),p=f.useMemo(()=>T(g.featureGroup.overview,g.project.value,{id:o,fgId:e.id,fsId:e.featurestoreId}),[e.featurestoreId,e.id,o]),l=i=>i.stopPropagation();return s.jsxs(a,{children:[e.deprecated&&s.jsx(N,{mr:"5px"}),s.jsx(B,{onClick:l,href:p,fontSize:"12px",fontWeight:"bold",color:n!=null&&n.includes(e.parentProjectId)&&t?"gray":"black",sx:{textDecoration:"none"},children:e.name})]})},U=({value:e})=>s.jsx(a,{pl:"5px",children:s.jsx(E,{type:e.type,onlineEnabled:e.onlineEnabled})}),$=({value:e})=>s.jsx(m,{width:"32px",children:s.jsx(H,{firstName:e.firstName,lastName:e.lastName})}),q=({value:e})=>s.jsx(h,{bold:e.bold,gray:e.gray,children:e.title}),J=({value:e,boxProps:t})=>{const{id:o}=b(),r=v(),{isActiveFg:n,handleBasket:p}=A(),[l,i]=f.useState(void 0),j=async()=>{var u;const c=await r(M.getFeatureGroupById.initiate({pId:+o,fsId:e.featurestoreId,fgId:e.id}));i(c.data),p(((u=c.data)==null?void 0:u.features)??[],c.data)()},x=n(e.id);return s.jsx(m,{onClick:c=>c.stopPropagation(),...t,children:s.jsx(D,{handleClick:j,mode:G.bulk,possible:!0,tooltipMainText:x?"Remove all features from basket":"Add all features to basket",tooltipSecondaryText:l?`${l.features.length} features`:"",inBasket:!!x})})};export{J as B,_ as N,U as T,$ as U,R as W,q as a,F as s};
