1import{g as Ce,u as Te,r as t,a as Ee,ao as ye,aH as Ne,iM as Ae,aJ as X,iN as W,aL as w,aM as S,eK as De,ay as Y,V as J,aK as Re,gt as $,j as a,a_ as xe,y as Fe,o as Q,bY as Oe,aY as N,a7 as C,aU as be,aO as Le,av as Z,az as je,ae as U,bU as Ie,iO as Pe,a8 as ee}from"./index.1t6HhxO5.js";import{g as _e}from"./knowledgeCenter.BDADDxPf.js";import{A as ve}from"./chip.DMZxplBx.js";import{A as Be}from"./fileCard.Mx8fEhX9.js";import{A as we}from"./heroHeader.B7V2xjnI.js";import{A as Ue}from"./pagination.BXb3Gv6B.js";import{A as ke}from"./share.B2204dDv.js";import{u as Me}from"./useShare.DoC0J73d.js";import He from"./index.M3q8wv_9.js";import{F as Ke}from"./constants.CLg2Cjgp.js";import"./Chip.BNxZHIIn.js";import"./webinar.B1r2gQCe.js";import"./article.C0ikDnAj.js";import"./playIconOrange.CZPzM6tN.js";import"./newInvestorDashboardBackground.DY9-oAg2.js";import"./LastPage.BfK_ZFDu.js";import"./shareContent.VMMmiAbe.js";import"./shareContent.CFb4no_R.js";import"./share.COoyJKyP.js";import"./formik.esm.BmM_XPwb.js";import"./isSymbol.CYvIzdD2.js";import"./mobileTextField.DH2IUpRQ.js";import"./autoComplete.CQdD_T8f.js";import"./radioButton.CFe-h0H6.js";import"./FormControlLabel.CnMDDTHu.js";import"./Radio.B6zUtL0I.js";import"./SwitchBase.DmQkQXy3.js";import"./useAutocomplete.DMP67eid.js";import"./Checkbox.CcmUMXMA.js";import"./index.Rt5GSqVM.js";/* empty css */import"./tabPanel.CFdUHbak.js";import"./whatsapp.v-W2Fm6L.js";import"./email.1n_Bflds.js";import"./yellowInfo.wYnB_VKK.js";import"./constants.CQRbq1Oy.js";import"./array.Coj5nQtv.js";/* empty css */import"./dscOrder.SNK89iwh.js";import"./constant.BePOqr5N.js";import"./iciciBankLogo.NwSrcl8r.js";const k=Ce("knowledgeCenterV2"),Ve=({videoBlogList:A,getVideoListData:D,allCategoryData:l,getCategoryData:T,isSearch:R,isFetching:d,pageCount:E=C?.ONE})=>{const y=Le(),x=Te(e=>e.commonField.globalConstants),F=t.useRef(null),c=Ee(),O=ye(),u=Ne(),[r,p]=t.useState(),[m,g]=t.useState({label:r?r[S]?.label:w.SORT_ORDER,code:r?r[S]?.code:W,order:r&&r[S]?.code===W?Ae:X}),b=decodeURIComponent(c?.search),s=new URLSearchParams(b),[n,o]=t.useState(""),[M,L]=t.useState(!1),f=t.useCallback(()=>L(e=>!e),[]),[j,I]=t.useState(1),[H,te]=t.useState(""),K=De(H,500),P=t.useRef(!1),{categoryCardFormik:se,shareOpen:ae,shareLongURL:re,shareHandler:oe,shareDataHandler:ne}=Me(),V=s?.get("title"),_=s?.get("categoryId"),ie=s?.get("level"),h=s?.get("fileType"),G=s?.get("page"),ce=s?.get("subCategoryId"),le=t.useMemo(()=>r?r?.filter(({isActive:e})=>e).map(({code:e})=>e)||[]:[],[r]),de=e=>{g&&g(e),f()},q=(e,i=K?.trim(),z)=>{const he=e||Ke,Se=z||h;D({userType:J(),categoryId:_,level:ie,page:he,size:C?.FIFTEEN,fileType:Se,title:i,sortBy:m?.code,orderBy:m?.order})},v=e=>{R.current=e};t.useEffect(()=>{P?.current?(v(!0),q(1,H,n)):P.current=!0},[K]),t.useEffect(()=>{o(h||l[0]?.supportedFileTypes?.[0]?.code),Y(0)},[h,l]),t.useEffect(()=>{T({categoryId:_,userType:J(),level:s?.get("level")})},[_,ce]);const ue=async()=>{try{const e=await _e();if(e.data){const i=e?.data?.success?.data;p(i?.sortBy)}}catch{p([])}},B=()=>A?.filter(e=>{if(e.fileCode===n)return e});t.useEffect(()=>{P?.current&&n&&(v(!1),te(""),q(j,"",n),Y(0))},[n,j,m]);const me=e=>()=>{I(C?.ONE),o(e?.code),s.set("fileType",e?.code),s.set("page","1"),O.replace({pathname:c.pathname,search:s.toString()})},pe=(e,i)=>{I(i),v(!1),s.set("page",i.toString()),O.replace({pathname:c.pathname,search:s.toString()})};t.useEffect(()=>{h&&o(h),G&&I(Number(G))},[c.search]);const ge=t.useCallback(()=>{g&&g({label:r?r[S]?.label:w.SORT_ORDER,code:r?r[S]?.code:Re,order:X}),f()},[u,f]);t.useEffect(()=>(ue(),u($(!0)),()=>{u($(!1))}),[]);const fe=e=>a.jsx(Be,{modalHandler:ne,knowledgeCenterData:e,data:B(),isThumbRequired:!0,isShareRequired:!0,isDescriptionRequired:!0,thumbnailUrl:e?.thumbnail,routeConstants:y,globalConstants:x,knowledgeCenterPageConstants:w,isTitleUptoFourLines:!0,showDate:!0,actionButtonText:"",hideFileType:!1,shareNewDesign:!1,categoryCardFormik:se});return a.jsxs("div",{className:"fund-list",ref:F,children:[a.jsx(we,{title:k[V]||V}),a.jsxs(xe,{className:"container",children:[a.jsx("div",{className:"mt-8 mt-md-12 mb-6",children:l?.[0]?.supportedFileTypes?.length>1?l?.[0]?.supportedFileTypes?.map((e,i)=>a.jsx(Fe.Fragment,{children:a.jsx(ve,{className:Oe("category-chip",{active:e?.code===n}),label:a.jsx(Q,{variant:"label4",component:"p",styleType:"Reg",children:k[e?.code]||e?.text}),onClick:me(e)})},i)):null}),a.jsx(N,{container:!0,rowSpacing:4,columnSpacing:3,className:"card-padding pt-6",children:B()?.length?B()?.map((e,i)=>a.jsx(N,{item:!0,xs:12,sm:6,md:4,className:"pl-0 pt-0",children:fe(e)},i)):a.jsx(N,{item:!0,xs:12,className:"no-records",children:a.jsx(Q,{variant:"body2",styleType:"Bold",children:k?.NO_RECORD_FOUND})})}),E>C?.ONE?a.jsx(N,{item:!0,md:8,mt:2,className:"manage-group-pagination",children:a.jsx(Ue,{pageCount:E,currentPage:j,pageSizePerPage:C?.FIFTEEN,onChange:pe})}):null]}),a.jsx(be,{isOpen:M,onClose:f,className:"fund-sort-modal",children:a.jsx(He,{onClose:f,onClear:ge,activeSort:m,sortParams:r,enabledSort:le,setActiveSort:de,isOrderByHidden:!0})}),a.jsx(ke,{shareOpen:ae,shareLongURL:re,shareHandler:oe,copyLinkBtn:!1})]})},jt=()=>{const[A,D]=t.useState([]),[l,T]=t.useState([]),[R,d]=t.useState([]),[E,y]=t.useState(!1),[x,F]=t.useState(1),c=t.useRef(!1),[O,u]=t.useState({isError:!1,errorCode:"",message:""}),{mutate:r,isLoading:p}=Z(s=>Ie(s),{onSuccess:(s,n)=>{const o=s?.data?.success;
1if(o)if(c.current)n?.title?.length?d(U(o?.data?.files,ee)):d([]);else{structuredClone(l);const L=[...U(o?.data?.files,ee)];d([]),T(L),F(o?.data?.pageCount),y(o?.data?.isNext)}},onError:s=>{c.current?d([]):(y(!1),d([]),T([])),u({isError:!0,errorCode:"",message:""})}}),{mutate:m,isLoading:g}=Z(s=>Pe(s),{onSuccess:s=>{const n=s?.data?.success?.data,o=U(n);D(o)},onError:s=>{u({isError:!0,errorCode:"",message:""})}}),b=()=>p;return a.jsxs(a.Fragment,{children:[b()&&a.jsx(je,{className:"page-level"}),a.jsx(Ve,{videoBlogList:l,getCategoryData:m,allCategoryData:A,getVideoListData:r,isNext:E,pageCount:x,filesFromSearch:R,isSearch:c,isFetching:p})]})};export{jt 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.