import{F as _,b as S,eh as g,ei as j,a as v,fF as w,r as n,f as M,i as b,fG as C,ej as x,j as o,S as z,K as k}from"./index-43bf7a1c.js";import{S as E}from"./SideMenuDetailLayout-48e12b5d.js";import"./index-4113d4cf.js";import"./index.esm-0548c843.js";import"./index.esm-f9e0a906.js";import"./yup-3b80ed10.js";import"./SelectComponent-84e66b0a.js";import"./objectSpread2-c31b885b.js";import"./floating-ui.dom-e7d69f3b.js";import"./InputLabel-6c7474f0.js";import"./useFormControl-2c5d60c2.js";import"./TextArea-23730be7.js";import"./TextField-4da97115.js";import"./FormControl-8d011aab.js";import"./OutlinedInput-6bcf3cf8.js";import"./List-6fcc4821.js";import"./Select-44fd3147.js";import"./Menu-362130d3.js";import"./Grow-ca573f65.js";import"./useControlled-ab567149.js";import"./createSvgIcon-f118be02.js";import"./AvatarGroup-0dfacdbf.js";import"./Avatar-ec89b895.js";import"./Tooltip-c7371fbe.js";import"./ScrollableList-e19132c3.js";import"./Loader-aabe9ed3.js";import"./CardContent-69a98a60.js";import"./Chip-94eea1f7.js";import"./DialogContent-d5902709.js";import"./DialogTitle-20dc6f66.js";import"./LoadingButton-570cb73d.js";import"./index-913b2dc6.js";import"./useMediaQuery-d6627623.js";import"./composeClasses-b42b2e69.js";import"./useToggle-cac8da91.js";import"./useViewPort-a450f252.js";import"./index-4d9acd7a.js";import"./AntdIcon-634507e8.js";import"./presets-bb9bdfd8.js";import"./FilterFilled-ccc86e02.js";import"./FilterOutlined-908c8e25.js";import"./InfoCircleOutlined-93449dd4.js";import"./SolutionOutlined-2be2f413.js";const je=()=>{const p=_(),a=S(),{id:r,tab:T}=g(),{tenders:{selectedData:t},system:{tenderMenuItemsList:m,userAccessList:i}}=j(),{caseSheet:{caseSheetList:c,pageParams:l}}=v(e=>w(e)),[h,f]=n.useState(!1);return n.useEffect(()=>{a(M({showMobileMenu:!1})),a(b({code:"MENU0009",from:"tendermenu"})),a(C({...l,search:"",page:1,page_size:10,tender:r}))},[]),n.useEffect(()=>{r&&a(x({id:r||""}))},[r]),o.jsx(o.Fragment,{children:o.jsx(E,{menuCode:"MENU0009",fromScreen:"tendermenu",data:t,app_label:"TenderManagement",model_name:"tender",goBackUrl:"/tenders",assignUserCallback:e=>{f((e==null?void 0:e.length)>0)},tabsData:m&&[{key:"overview",label:"Over View",icon:"DashboardOutlined",url:"/",urlParams:{id:r}},...m.filter(e=>{var s;return!(t.authorized_status!==2&&t.authorized_status!==5&&e.url!=="/tender_items"&&e.url!=="/tender_stages"||!((s=t==null?void 0:t.is_reverse_auction)!=null&&s.id)&&e.url==="/reverse_auction"||!h&&e.url==="/case_sheet"||!c.some(d=>d.authorized_status===4||d.authorized_status===2)&&e.url!=="/tender_items"&&e.url!=="/case_sheet"&&e.url!=="/tender_stages")})],headerContent:o.jsx(z,{direction:"row",spacing:1,children:(i==null?void 0:i.indexOf("ProjectManagement.change_project"))!==-1&&t.authorized_status!=1&&t.authorized_status!=5&&o.jsx(k,{variant:"contained",size:"large",onClick:()=>{var e;p(`/work_order/${r}/${(e=t==null?void 0:t.project)==null?void 0:e.id}`)},children:"Convert To Project"})}),onTabClick:(e,u,s)=>{p(`/tenders/view/${e}/${u}${s}`)}})})};export{je as default};
