import{z as F,d as R,a as S,b as C,F as z,j as s,B as r,a2 as u,T as g,I as L,dZ as I,R as A}from"./index-83d9c1e2.js";import{R as N,a as B}from"./index.esm-316fec71.js";import{c as $,b as k,u as E}from"./index.esm-82874186.js";import{o as G}from"./yup-dfe9f223.js";import{D as O}from"./Divider-71865361.js";import{F as P}from"./FilterFilled-eb3492a9.js";const Y=({pageTitle:t,pageText:o,addModelTile:l,goBack:c,modalVisible:Z,setIsModalVisible:i,postfix:q,prefix:H,navigationToAdd:x,gobackurl:m,otherButtons:p,showFilterButton:y=!1,openFilter:d,filteredData:a,searchComponent:h,children:b})=>{var j,f;const n=F();R(),S(e=>C(e));const v=z();let w=$({search:k()});return E({resolver:G(w),values:{search:a==null?void 0:a.search}}),s.jsxs(r,{sx:{flexGrow:1,margin:0,padding:0},children:[s.jsx(u,{sx:{padding:0,border:"none",margin:0,width:"100%",borderRadius:0,boxShadow:"none"},children:s.jsxs(r,{display:"flex",justifyContent:"space-between",alignItems:"center",sx:{padding:2,mt:1},children:[s.jsxs(r,{display:"flex",alignItems:"center",children:[c&&s.jsx("span",{onClick:()=>{n(m||-1)},style:{cursor:"pointer",color:(f=(j=v.palette)==null?void 0:j.primary)==null?void 0:f.main},children:s.jsx(N,{size:20})}),t&&s.jsx(g,{variant:"h5",sx:{marginLeft:c?"12px":"0",mt:-1},children:t}),o&&s.jsx(g,{variant:"body2",style:{marginLeft:"8px"},children:o})]}),s.jsxs(r,{display:"flex",gap:1,alignItems:"center",children:[h&&h,y&&s.jsx(L,{onClick:()=>d&&d(!0),children:Object.values(a).every(e=>e==null||e==""||e==null)?s.jsx(I,{className:"hp-mr-10",style:{fontSize:"16px"}}):s.jsx(P,{className:"hp-mr-10",style:{fontSize:"16px"}})}),p&&p,l&&s.jsx(A,{variant:"contained",color:"primary",onClick:e=>{i?(i&&i(!0),e.target.blur()):x&&n(x)},startIcon:s.jsx(B,{size:16}),children:l})]})]})}),s.jsx(O,{sx:{width:"calc(100% + 40px)",marginLeft:"-20px",mb:2}}),s.jsx(u,{sx:{padding:0,border:"none",margin:0,width:"100%",borderRadius:0,boxShadow:"none"},children:s.jsx(r,{sx:{padding:2},children:b})})]})};export{Y as M};
