(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[195],{46055:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/blog",function(){return n(65836)}])},44323:function(e,t){"use strict";t.Z={src:"/_next/static/media/hero-image.e1f8c7ba.png",height:803,width:1200,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAMAAABPT11nAAAAM1BMVEXSxrfRy8OYlpSim5NwbGjCtqZ6d3WXjoTJva6yqp+4t7ayr6u1qJiMhH6CgH6jmpB9dW1ltEtQAAAACXBIWXMAAAsTAAALEwEAmpwYAAAALUlEQVR4nAXBiQEAIAjEsKLogf/+05pgWaf2KFjqPo1JBPLqhxZkUe+sFkD6BxlcAQaBwPsYAAAAAElFTkSuQmCC",blurWidth:8,blurHeight:5}},99736:function(e,t,n){"use strict";n.d(t,{U:function(){return hasValue}});let hasValue=e=>Object.values(e).some(e=>e.length>0)},26223:function(e,t,n){"use strict";var l=n(82729),a=n(35944),r=n(26601),i=n(25675),c=n.n(i),o=n(44323);function _templateObject(){let e=(0,l._)(["\n min-height: 30vh;\n display: flex;\n justify-content: center;\n align-items: center;\n background-image: linear-gradient(\n to right,\n hsla(20, 80%, 26%, 95%) 25%,\n hsla(17, 80%, 20%, 0%)\n );\n margin-bottom: var(--space-lg);\n position: relative;\n"]);return _templateObject=function(){return e},e}let s=r.Z.div(_templateObject());t.Z=e=>{let{children:t}=e;return(0,a.BX)(s,{children:[(0,a.tZ)(c(),{alt:"Hero Image of men on smaller photographs",src:o.Z,fill:"true",quality:"100",priority:"true",className:"-z-50 object-cover object-right"}),(0,a.tZ)("h1",{className:"text-white text-center text-6xl sm:text-4xl md:text-5xl",children:t})]})}},82:function(e,t,n){"use strict";var l=n(35944),a=n(9008),r=n.n(a);t.Z=e=>{let{children:t,metaImage:n,metaTitle:a,title:i,meta:c,metaDescription:o,description:s}=e;return(0,l.BX)(l.HY,{children:[(0,l.BX)(r(),{children:[c?(0,l.BX)(l.HY,{children:[(0,l.tZ)("meta",{property:"og:type",content:"website"}),(0,l.tZ)("meta",{property:"og:title",content:a||null}),(0,l.tZ)("meta",{property:"og:description",content:o||null}),(0,l.tZ)("meta",{property:"og:image",content:n||null}),(0,l.tZ)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,l.tZ)("meta",{name:"twitter:title",content:a||null}),(0,l.tZ)("meta",{name:"twitter:description",content:o||null}),(0,l.tZ)("meta",{name:"twitter:image",content:n||null})]}):null,i?(0,l.tZ)("title",{children:i}):null,s?(0,l.tZ)("meta",{name:"description",content:s}):null]}),t]})}},65836:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return Blog}});var l=n(35944);n(74191);var a=n(67294),r=n(26223),i=n(19930),c=n(34211),o=n(789),s=n(56515),components_BlogPreview=e=>{let{blog:t,onClickHandlerFilter:n}=e;return(0,l.tZ)("div",{className:"w-full text-black",children:(0,l.BX)("div",{className:"flex md:flex-col gap-6 items-center",children:[(0,l.tZ)("div",{className:"min-w-[320px] max-h-52 flex justify-center items-center rounded-md",children:(0,l.tZ)("div",{className:"p-2 border-2 rounded-md",children:(0,l.tZ)(s.Z,{src:t.featuredImage?"".concat(i.Z.backendUrl,"/images/").concat(t.featuredImage):"".concat(i.Z.backendUrl,"/images/eegs.png"),width:300,height:208,className:"max-h-52 rounded-md drop-shadow-2xl overflow-hidden object-contain"})})}),(0,l.BX)("div",{className:"flex flex-col md:px-2 gap-4 justify-center",children:[(0,l.BX)("h3",{className:"text-3xl",children:[t.title.split("").slice(0,105).join(""),t.title.split("").length>105?"[...]":null]}),(0,l.BX)("p",{className:"",children:[(0,l.tZ)(o.gr,{oneLiner:!0,content:t.content}),"[...]"]}),(0,l.BX)("div",{className:"flex md:flex-col-reverse gap-4 items-center",children:[(0,l.tZ)(c.zx,{href:"/blog/".concat(t.slug),className:"py-3 px-6 whitespace-nowrap font-bold",children:"Read Article"}),(0,l.tZ)("p",{className:"text-gray-500 whitespace-nowrap",children:new Date(+t.publishedDate).toLocaleDateString("en-US",{month:"short",year:"numeric",day:"numeric"})}),(0,l.tZ)("p",{className:"whitespace-nowrap",children:(0,l.BX)("span",{className:"text-gray-500",children:[(0,l.tZ)("i",{children:"by"})," ",t.author]})}),(0,l.BX)("p",{className:"whitespace-nowrap",children:[(0,l.tZ)("span",{className:"italic text-gray-500",children:"in "}),(0,l.tZ)("button",{className:"font-bold underline",onClick:()=>n("categories",t.category),children:t.category})]})]})]})]})})};let getFilters=e=>({categories:e.reduce((e,t)=>{let n=e.find(e=>e.name===t.category);return n?n.count++:e.push({name:t.category,count:1}),e},[]).sort((e,t)=>e.name.localeCompare(t.name)),archives:e.reduce((e,t)=>{let n=new Date(+t.publishedDate),l=new Date,a=n.getFullYear(),r=n.getMonth(),i=(l.getFullYear()-a)*12+l.getMonth()-r,c=n.toLocaleString("default",{month:"short"}),o=i<=12?"".concat(c," ").concat(a):"".concat(a),s="".concat(a,"-").concat(r<9?"0".concat(r+1):r+1),d=e.find(e=>e.sortKey===s);return d?d.count++:e.push({name:o,count:1,sortKey:s}),e},[]).sort((e,t)=>t.sortKey.localeCompare(e.sortKey)).map(e=>{let{name:t,count:n}=e;return{name:t,count:n}}),tags:Array.from(new Set(e.reduce((e,t)=>e.concat(t.tags),[])))}),filterByObject=(e,t)=>e.filter(e=>{var n,l,a,r;let i;let c=new Date(+e.publishedDate),o=new Date,s=(o.getFullYear()-c.getFullYear())*12+(o.getMonth()-c.getMonth());if(s<=12){let e=c.toLocaleString("default",{month:"short"});i="".concat(e," ").concat(c.getFullYear())}else i="".concat(c.getFullYear());return(null===(n=t.archives)||void 0===n||!n.length||!!t.archives.includes(i))&&(null===(l=t.categories)||void 0===l||!l.length||!!t.categories.includes(e.category))&&(null===(a=t.authors)||void 0===a||!a.length||!!t.authors.includes(e.author))&&(null===(r=t.tags)||void 0===r||!r.length||!!e.tags.some(e=>t.tags.includes(e)))});var d=n(99736),allBlogs_BlogFilters=e=>{let{blogs:t,onClickHandlerFilter:n,filters:a}=e,r=getFilters(t);return(0,l.tZ)("div",{className:"w-[25%] md:w-full md:px-2 flex flex-col gap-6 ml-auto",children:(0,l.tZ)("div",{className:"w-full flex flex-col gap-4",children:Object.entries(r).map(e=>{let[t,r]=e;return(0,l.BX)("div",{children:[(0,l.tZ)("div",{className:"bg-dark-orange text-white font-bold rounded-t-md p-4 capitalize",children:t}),(0,l.tZ)("div",{className:"text-black",children:"tags"!==t?r.map((e,i)=>{var c;return(0,l.BX)("div",{onClick:()=>n(t,e.name),className:"flex justify-between p-4 cursor-pointer ".concat(i%2==0?"bg-off-white":"bg-off-white2"," ").concat(i===r.length-1?"rounded-b-md":""," ").concat((null===(c=a[t])||void 0===c?void 0:c.includes(e.name))||!(0,d.U)(a)?"":"opacity-25"),children:[(0,l.tZ)("p",{className:"font-medium",children:e.name}),(0,l.tZ)("p",{className:"text-sm bg-orange rounded-full px-2 text-white font-bold flex justify-center items-center",children:e.count})]},i)}):(0,l.tZ)("div",{className:"p-4 bg-off-white rounded-b-md",children:(0,l.tZ)("p",{children:r.map((e,i)=>{var c;return(0,l.BX)("span",{children:[(0,l.tZ)("span",{className:"font-medium cursor-pointer ".concat((null===(c=a[t])||void 0===c?void 0:c.includes(e))||!(0,d.U)(a)?"":"opacity-40"),onClick:()=>n(t,e),children:e}),i===r.length-1?"":", "]},i)})})})})]},t)})})})};let blogHandlers=e=>{let{setPage:t,setFilters:n,blogs:l}=e;return{pageUpHandler:()=>{t(e=>e>=l.length?e:e+1)},pageDownHandler:()=>{t(e=>1===e?e:e-1)},pageQuantityHandler:e=>{t(e)},onClickHandlerFilter:(e,t)=>{n(n=>{let l={},a=n[e];return a?a.includes(t)?(a=a.filter(e=>e!==t),{...l,[e]:a}):{...l,[e]:[t]}:(a=[t],{...l,[e]:a})})}}};var u=n(71641),g=n(82729),m=n(17283);function _templateObject(){let e=(0,g._)(["\n query GetPublishedBlogs {\n getPublishedBlogs {\n title\n publishedDate\n category\n featuredImage\n tags\n status\n author\n content\n images\n createdAt\n slug\n _id\n }\n }\n"]);return _templateObject=function(){return e},e}let h=(0,m.Ps)(_templateObject());var p=n(92066),f=n(64227),x=n(1826),Index=()=>{let{data:e,loading:t}=(0,u.a)(h),[n,c]=(0,a.useState)([]),[o,s]=(0,a.useState)([]),[d,g]=(0,a.useState)({}),{manager:m,pagedItems:b}=(0,x.k)(o.length?null==o?void 0:o.slice().sort((e,t)=>t.publishedDate-e.publishedDate):void 0,i.Z.blogPageResults),{onClickHandlerFilter:w}=blogHandlers({setFilters:g,blogs:o});return(0,a.useEffect)(()=>{(null==e?void 0:e.getPublishedBlogs)&&c(null==e?void 0:e.getPublishedBlogs.flat())},[e]),(0,a.useEffect)(()=>{n&&s(n)},[n]),(0,a.useEffect)(()=>{o&&s(filterByObject(n.slice(),d))},[d]),(0,l.BX)(l.HY,{children:[(0,l.tZ)(r.Z,{children:"Blog"}),(null==b?void 0:b.length)?(0,l.tZ)("div",{className:"m-auto py-24 max-w-[1232px]",children:(0,l.BX)("div",{className:"flex md:flex-col-reverse w-full gap-6",children:[(0,l.BX)("div",{className:"flex flex-col gap-12",children:[null==b?void 0:b.map(e=>(0,l.tZ)(components_BlogPreview,{blog:e,onClickHandlerFilter:w},e._id)),(0,l.tZ)(x.Z,{paginationManager:m})]}),(0,l.tZ)(allBlogs_BlogFilters,{filters:d,blogs:n.slice(),onClickHandlerFilter:w})]})}):t?(0,l.tZ)(p.Yr,{width:240,color:f.O.darkOrange}):(0,l.tZ)("div",{className:"flex justify-between m-auto py-24 max-w-[1232px]",children:(0,l.BX)("div",{className:"w-full flex justify-center items-center flex-col gap-4",children:[(0,l.tZ)("i",{className:"fa-solid fa-folder-xmark text-5xl"}),(0,l.tZ)("h3",{className:"text-3xl font-poppins",children:"Sorry no posts found."}),(0,l.tZ)("p",{className:"text-xl font-poppins",children:"New content coming soon!"})]})})]})},b=n(82);function Blog(){return(0,l.tZ)(b.Z,{title:"Blog—East European Genealogical Society (EEGS)",description:"Read about Society news as well as articles offering insights and tips on eastern European genealogical research.",children:(0,l.tZ)(Index,{})})}}},function(e){e.O(0,[774,888,179],function(){return e(e.s=46055)}),_N_E=e.O()}]);