(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6188],{33135:function(e,o,t){"use strict";t.r(o),t.d(o,{config:function(){return P},default:function(){return k}});var r=t(92809),a=t(67294),n=t(27361),l=t.n(n),i=t(2962),s=t(12918),d=t(18499),u=t(99971),g=t(74619),h=t(48122),c=t(68751),m=t(50501),f=t(90875),x=t(85885),b=t(52161),p=t(41120),v=t(6610),j=t(24216),y=t(99956),Z=t(22318),B=t(282),_=t(85893),I=(0,p.Z)((function(e){return{blogHeader:{paddingBottom:e.spacing(2),borderBottom:"1px solid "+e.palette.background.outline},blogTitle:{fontWeight:700}}}));function w(e){var o,t,r=I(),n=(0,a.useState)(),i=n[0],u=n[1],g=(0,a.useState)(),h=g[0],c=g[1],m=(0,a.useState)(1),f=m[0],p=m[1],w=void 0;e.search&&(o='Search results for "'+e.search+'"'),e.tag&&(o="Articles tagged "+e.tag),e.authorName&&(o="Articles published by "+e.authorName),e.year&&e.year>1900&&e.year<2100&&(""!==e.month&&e.month<13&&e.month>0?(t=e.year+"-"+e.month+"-01",w=(0,j.Dz)(t,"month","YYYY-MM-DD"),o="Articles published in "+(0,j.vc)(t,"YYYY MM DD","MMMM YYYY")):(t=e.year+"-01-01",w=e.year+"-12-31",o="Articles published in "+e.year));var N={};N=""===e.tag||void 0===e.tag?{endCursor:i,search:e.search,dateStart:t,dateEnd:w,authorId:e.authorId,bloghomeId:e.blogHomeId}:{endCursor:i,tags:["#"+e.tag],search:e.search,dateStart:t,dateEnd:w,authorId:e.authorId,bloghomeId:e.blogHomeId};var M=(0,d.aM)(x.lb,{variables:N}),Y=M.loading,H=M.error,P=M.data;if(H)return(0,_.jsx)(s.default,{});if(Y)return(0,_.jsx)(b.Z,{});var T=l()(P,"allBlogs.pageInfo.startCursor"),k=l()(P,"allBlogs.pageInfo.endCursor"),C=l()(P,"allBlogs.pageInfo.hasNextPage");return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(y.Z,{className:r.blogHeader,mb:4,children:[(0,_.jsx)(Z.Z,{className:r.blogTitle,component:"h1",variant:"h3",gutterBottom:!0,children:e.title}),o&&(0,_.jsx)(Z.Z,{variant:"h5",children:o})]}),P&&P.allBlogs&&P.allBlogs.edges?P.allBlogs.edges.map((function(e){return e.node})).filter((function(e){return!l()(e,"_meta.uid").includes("test--")})).map((function(e,o){return(0,_.jsx)(v.Z,{data:e,type:"listing"},o)})):[],(0,_.jsxs)(y.Z,{mb:4,display:"flex",justifyContent:"center",children:[h&&h!==i&&(0,_.jsx)(B.Z,{variant:"contained",color:"primary",onClick:function(){return u(h),p(f-1),void(window&&window.scrollTo(0,0))},children:"Previous Posts"}),f>1&&(0,_.jsx)(y.Z,{p:2,children:(0,_.jsxs)(Z.Z,{variant:"h5",children:["Page ",f]})}),C&&(0,_.jsx)(B.Z,{variant:"contained",color:"primary",onClick:function(){return u(k),c(T),p(f+1),void(window&&window.scrollTo(0,0))},children:"More Posts"})]})]})}function N(e){var o=(0,d.aM)(x.nj,{skip:!e.authorUid,variables:{uid:e.authorUid}}),t=o.loading,r=o.error,a=o.data;if(r)return(0,_.jsx)(s.default,{});if(t)return(0,_.jsx)(b.Z,{});var n=l()(a,"allPublishers.edges[0].node._meta.id",""),i=n?l()(a,"allPublishers.edges[0].node.name[0].text",l()(e,"authorSlug")):" : author not found";return(0,_.jsx)(w,{blog_type:e.uid,title:e.title,authorId:n,authorName:i,blogHomeId:e.blogHomeId})}var M=t(58503),Y=t(43832),H=t(41749),P={amp:"hybrid"},T=(0,p.Z)((function(e){return{blogIndex:{marginTop:e.spacing(4),"& h1, h2, h3, h4, h5":{fontFamily:e.typography.body1.fontFamily,color:e.palette.text.primary,textTransform:"none"},"& h1":(0,r.Z)({},e.breakpoints.down("lg"),{lineHeight:"3rem"}),"& a":{borderBottom:0,"&:hover":{borderBottom:0}}},title:{fontWeight:700}}})),k=(0,u.Z)((function(e){var o=e.query,t=o.uid,r=void 0===t?"":t,a=o.authorSlug,n=void 0===a?"":a,u=o.tag,p=void 0===u?"":u,v=o.search,j=void 0===v?"":v,B=o.year,I=void 0===B?"":B,P=o.month,k=void 0===P?"":P,C=e.config;r=(0,g.lT)(r);var S=T(),E=(0,d.aM)(x.vE,{variables:{uid:r}}),A=E.loading,D=E.error,F=E.data;if(D)return(0,_.jsx)(s.default,{});if(A)return(0,_.jsx)(b.Z,{});var U=l()(F,"allBloghomes.edges[0].node.title")?c.Z.asText(l()(F,"allBloghomes.edges[0].node.title")):"",W=""!==l()(F,"allBloghomes.edges[0].node.disclaimer[0].text","")?(0,_.jsx)(c.Z,{render:l()(F,"allBloghomes.edges[0].node.disclaimer")}):"",O=l()(F,"allBloghomes.edges[0].node._meta.uid"),X=l()(F,"allBloghomes.edges[0].node._meta.id"),q=l()(F,"allBloghomes.edges[0].node.menu"),z=(0,m.L)(l()(F,"allBloghomes.edges[0].node")),G=l()(F,"allBloghomes.edges[0].node.body"),L=(0,h.Wc)().findAndGetUrls("bloghome",{uid:r}).urls.as.replace(/--/g,"/");return(0,_.jsxs)(f.Z,{communityMenu:q,config:C,pageSeo:z,disclaimer:W,children:[(0,_.jsx)(i.PB,{canonical:L}),(0,_.jsx)(Y.Z,{maxWidth:"xl",children:(0,_.jsx)(H.Z,{container:!0,className:S.blogIndex,children:O?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(H.Z,{item:!0,xs:12,md:G&&G.length>0?8:12,children:n?(0,_.jsx)(N,{blog_type:r,title:U,authorUid:n,blogHomeId:X}):(0,_.jsx)(w,{blog_type:r,blogHomeId:X,title:U,month:k,year:I,tag:p,search:j})}),G&&(0,_.jsx)(H.Z,{item:!0,xs:12,md:4,children:(0,_.jsx)(M.Z,{slices:G,blog_type:r,blogHomeId:X})})]}):(0,_.jsx)(H.Z,{item:!0,xs:12,children:(0,_.jsx)(y.Z,{mb:8,children:(0,_.jsx)(Z.Z,{className:S.title,variant:"h3",gutterBottom:!0,children:"No Blog Found"})})})})})]})}))},82991:function(e,o,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/bloghome",function(){return t(33135)}])}},function(e){e.O(0,[9774,3662,4885,5026,2432,9803,886,1309,2861,2221,7627,5951,2888,179],(function(){return o=82991,e(e.s=o);var o}));var o=e.O();_N_E=o}]);