import{z as k,d as y,av as M,r as x,g as _,i as I,j as e,B as l,T as $,hs as P,P as v,ht as S,a as T,hu as B,hv as E}from"./index-ba11e6ab.js";import{I as O,R}from"./index-11ce9410.js";import{A}from"./index-c37d9c93.js";import{T as L,a as U}from"./Tabs-c5e952d3.js";import"./AntdIcon-d49f53d6.js";import"./objectSpread2-d72b34ab.js";import"./index-33824b7d.js";import"./index-e5978b8b.js";import"./FilterFilled-94a9d775.js";import"./FilterOutlined-6af8de61.js";import"./InfoCircleOutlined-89e06b36.js";import"./SolutionOutlined-ff18151f.js";import"./index.esm-39ef576a.js";import"./yup-902af9ab.js";import"./SelectComponent-b2bed2ac.js";import"./TextField-16337ecc.js";import"./Select-f9434f8a.js";import"./Grow-1038181b.js";import"./isMuiElement-f8265807.js";import"./Checkbox-3e187368.js";import"./SwitchBase-7d4e0bc8.js";import"./TextArea-1c46e0e4.js";import"./Avatar-1c5fb46d.js";import"./Delete-80b10bc9.js";import"./ScrollableList-b4fc4d99.js";import"./CircularProgress-509803a6.js";import"./Container-1e359259.js";import"./ListItem-205885e3.js";import"./ListItemText-d9d8b5fd.js";import"./listItemTextClasses-a4497781.js";import"./DialogContent-af77e042.js";import"./DialogTitle-dc43931f.js";import"./DialogContentText-990aa19e.js";import"./DialogActions-3fe54b4c.js";import"./LoadingButton-a3eae003.js";import"./composeClasses-b42b2e69.js";import"./Divider-7b675f59.js";import"./dividerClasses-ab944802.js";import"./KeyboardArrowRight-36117cc9.js";function W(o){const{children:a,value:r,index:t,...c}=o;return e.jsx("div",{role:"tabpanel",hidden:r!==t,id:`simple-tabpanel-${t}`,"aria-labelledby":`simple-tab-${t}`,...c,children:r===t&&e.jsx(l,{mt:2,children:a})})}function z(o){return{id:`simple-tab-${o}`,"aria-controls":`simple-tabpanel-${o}`}}const D=({menuCode:o,fromScreen:a,callback:r,data:t,app_label:c,model_name:i,goBackUrl:m,assignUserCallback:b,headerContent:s,tabsData:d,onTabClick:u})=>{const w=k(),h=y(),{id:f,tab:n}=M(),C=`${c}.${i}`;return x.useEffect(()=>{h(_({showMobileMenu:!1})),h(I({code:o,from:a}))},[]),e.jsx(e.Fragment,{children:e.jsx(l,{sx:{width:"100%"},children:e.jsxs(l,{sx:{mt:1},children:[e.jsxs(l,{sx:{py:1,display:"flex",alignItems:"center",justifyContent:"space-between",gap:2},children:[e.jsxs($,{variant:"h4",sx:{display:"flex",alignItems:"center",gap:1,cursor:"pointer",fontWeight:"500"},onClick:()=>{w(m,{relative:"path"})},children:[e.jsx(P,{size:24}),`${t==null?void 0:t.code}`]}),e.jsxs(l,{sx:{display:"flex",alignItems:"center",gap:2},children:[e.jsx(A,{instance_id:f||"",modal_path:C,callback:b}),s&&s]})]}),e.jsx(l,{sx:{borderColor:"divider",mt:1},children:e.jsx(v,{sx:{boxShadow:"none",borderRadius:"10px",pb:"10px",pt:"3px"},children:e.jsx(L,{value:n?+n:0,sx:{".MuiButtonBase-root":{m:0,p:0},".MuiTabs-flexContainer":{p:0,m:0,px:0,gap:"0px"},".MuiTab-root":{minHeight:"18px",padding:"12px !important",minWidth:"18px !important",boxShadow:"none",borderRadius:"6px",mt:"5px"}},"aria-label":"scrollable auto tabs example",variant:"scrollable",scrollButtons:"auto",children:d&&d.map((p,j)=>{const g=O[p.icon];return e.jsx(U,{icon:g?e.jsx(g,{style:{fontSize:16}}):e.jsx(R,{style:{fontSize:16}}),onClick:()=>u(f||"",j,(p==null?void 0:p.url)||""),iconPosition:"start",label:p.label,...z(j)},p.key)})})})}),e.jsx(W,{value:n?+n:0,index:n?+n:0,children:e.jsx(v,{variant:"elevation",sx:{p:2,borderRadius:"10px"},children:e.jsx(S,{})})})]})})})},Ce=()=>{const o=k(),a=y(),{id:r,tab:t,tenderId:c}=M(),{workOrder:{selectedData:i},system:{projectsMenuItemsList:m,userAccessList:b}}=T(s=>B(s));return x.useEffect(()=>{a(_({showMobileMenu:!1})),a(I({code:"MENU0011",from:"projectsmenu"}))},[]),x.useEffect(()=>{r&&a(E({id:r||""}))},[r]),e.jsx(e.Fragment,{children:e.jsx(D,{menuCode:"MENU0011",fromScreen:"projectsmenu",data:i,app_label:"ProjectManagement",model_name:"project",goBackUrl:"/work_order",assignUserCallback:()=>{},tabsData:m&&[{key:"project_details",label:"Details",icon:"DashboardOutlined",url:"/",urlParams:{id:r}},...m.filter(s=>!(!(i!=null&&i.is_performace_bank_guarantee)&&s.url==="/project/performance_bank_guarantee"))],onTabClick:(s,d,u)=>{o(`/work_order/view/${s}/${d}${u}`)}})})};export{Ce as default};
