1import{u as I,I as A,r as l,b as E,a9 as T,a3 as u,j as s,S as N,P as $}from"./index-DnzkrJT-.js";const F="_blog_page_desktop_view_1obuy_1",R="_blog_page_mobile_view_1obuy_9",M="_header_section_1obuy_31",P="_search_section_1obuy_59",U="_input_search_icon_1obuy_67",V="_filter_button_section_1obuy_119",G="_button_style_1obuy_151",O="_card_section_1obuy_341",z="_card_1obuy_341",H="_card_details_1obuy_373",Q="_card_image_1obuy_379",q="_card_header_section_1obuy_397",J="_card_title_1obuy_411",K="_card_sub_title_1obuy_449",W="_card_header_content_1obuy_551",X="_wellnwess_watch_1obuy_787",Y="_blogs_container_1obuy_793",c={blog_page_desktop_view:F,blog_page_mobile_view:R,header_section:M,search_section:P,input_search_icon:U,filter_button_section:V,button_style:G,card_section:O,card:z,card_details:H,card_image:Q,card_header_section:q,card_title:J,card_sub_title:K,card_header_content:W,wellnwess_watch:X,blogs_container:Y};function se(Z){const x=I(),m=A(),g=localStorage.getItem("token"),[h,k]=l.useState(""),[r,y]=l.useState(null),[v,S]=l.useState(!1),[L,C]=l.useState([]),{blogList:t}=E(e=>e.blogStore),_=l.useRef(null);l.useEffect(()=>{r===null&&v&&_.current?_.current.scrollIntoView({behavior:"smooth",block:"center"}):r!==null&&_.current&&_.current.scrollIntoView({behavior:"smooth",block:"center"})},[r,v]),l.useEffect(()=>{g&&m(T(g))},[m,g]);const b=t!=null&&t.length?t==null?void 0:t.filter(e=>{var f,w;const o=h==null?void 0:h.toLowerCase(),i=(f=e==null?void 0:e.title)==null?void 0:f.toLowerCase().includes(o),a=(w=e==null?void 0:e.description)==null?void 0:w.toLowerCase().includes(o),d=!r||u(e==null?void 0:e.categoryName)===r;return(i||a)&&d}):[],p=[...new Set(t==null?void 0:t.map(e=>u(e==null?void 0:e.categoryName)))],j=["#0F5EA7","#0D9B2C","#5C2D91","#FFA8A8","#A876E0"],n={},D=e=>{const o=u(e),i=Object.keys(n);i.includes(o)||i.push(o);const a=i.indexOf(o);return n[o]||(n[o]=j[a%j.length]),n[o]};t!=null&&t.length&&(t==null||t.forEach((e,o)=>{D(e==null?void 0:e.categoryName)}));const B=(e,o="")=>{const i="https://drive.google.com/file/d/";if(e.includes("drive.google.com/file/d/")){const d=e.split("/d/")[1].split("/")[0];return s.jsxs("div",{style:{position:"relative",width:"100%",height:"100%"},children:[s.jsx("iframe",{src:`${i}${d}/preview`,width:"100%",style:{overflow:"hidden",borderTopLeftRadius:"15px",borderTopRightRadius:"15px",touchAction:"none"}}),s.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",cursor:"pointer",backgroundColor:"transparent"}})]})}else if(o=="Image")return s.jsx("img",{src:`https://neubergpublic.s3.ap-south-1.amazonaws.com/blog/${e}`});return s.jsx("img",{src:e})};return s.jsx(s.Fragment,{children:s.jsxs("div",{children:[s.jsx("div",{className:` ${c.blog_page_desktop_view}`,children:s.jsx(N,{})}),s.jsx("div",{className:` ${c.blog_page_mobile_view}`,children:s.jsx(N,{isBannerVisible:!1})}),s.jsxs("div",{className:`container-fluid ${c.blogs_container}`,children:[s.jsxs("div",{className:` ${c.header_section}`,children:[s.jsx("div",{className:`${c.wellnwess_watch}`,children:s.jsx("p",{children:" Wellness Watch "})}),s.jsx("div",{className:` ${c.search_section}`,children:s.jsxs("div",{className:`${c.input_search_icon}`,children:[s.jsx("img",{src:"/assets/images/search_icon.svg"}),s.jsx("input",{type:"text",placeholder:"Search Blogs",value:h,onChange:e=>{k(e.target.value)}})]})}),s.jsxs("div",{className:` ${c.filter_button_section}`,children:[s.jsx("button",{type:"button",className:`btn ${c.button_style}`,style:{backgroundColor:"#5C2D91D9"},onClick:()=>{y(null),S(!0)},children:s.jsx("span",{children:"All Blogs"})}),p==null?void 0:p.map((e,o)=>s.jsx(s.Fragment,{children:s.jsx("button",{type:"button",className:`btn ${c.button_style}`,style:{backgroundColor:n[e]},id:o,onClick:()=>y(e),children:s.jsxs("span",{children:[" ",e," "]})},o)}))]})]}),s.jsx("div",{ref:_,className:` ${c.card_main_section}`,children:s.jsx("div",{className:` ${c.card_section}`,children:b==null?void 0:b.map((e,o)=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:` ${c.card}`,onClick:()=>x(`${$.blogDetails}/${e==null?void 0:e._id}`,{state:{categoryColorMapping:n,userCommented:e==null?void 0:e.userCommented}}),children:[s.jsx("div",{className:` ${c.card_image}`,children:B(e.blogImage,e==null?void 0:e.fileType)}),s.jsx("div",{className:` ${c.card_details}`,children:s.jsx("div",{className:` ${c.card_header_section}`,children:s.jsx("div",{className:` ${c.card_header_content}`,children:s.jsxs("div",{children:[s.jsxs("div",{className:"d-flex align-items-start justify-content-between gap-2",children:[s.jsxs("p",{title:e==null?void 0:e.title,className:`${c.card_title}`,children:[" ",e==null?void 0:e.title," "]}),s.jsx("button",{type:"button",className:` mt-2 ${c.button_style}`,onClick:()=>x($.blogDetails),style:{backgroundColor:n[u(e==null?void 0:e.categoryName)]},children:s.jsxs("span",{children:[" ",u(e==null?void 0:e.categoryName)," "]})})]}),s.jsxs("p",{title:e==null?void 0:e.description,className:` ${c.card_sub_title}`,children:[" ",e==null?void 0:e.description," "]})]})})})})]},o)}))})})]})]})})}export{se 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.